diff --git a/public/css/font-awesome.css b/public/css/font-awesome.css new file mode 100644 index 0000000..35bb02e --- /dev/null +++ b/public/css/font-awesome.css @@ -0,0 +1,2036 @@ +/*! + * Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ +/* FONT PATH + * -------------------------- */ +@font-face { + font-family: 'FontAwesome'; + src: url("../fonts/fontawesome-webfont.eot?v=4.1.0"); + src: url("../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0") format("embedded-opentype"), url("../fonts/fontawesome-webfont.woff?v=4.1.0") format("woff"), url("../fonts/fontawesome-webfont.ttf?v=4.1.0") format("truetype"), url("../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular") format("svg"); + font-weight: normal; + font-style: normal; +} + +.fa { + display: inline-block; + font-family: FontAwesome; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +/* makes the font 33% larger relative to the icon container */ +.fa-lg { + font-size: 1.33333em; + line-height: 0.75em; + vertical-align: -15%; +} + +.fa-2x { + font-size: 2em; +} + +.fa-3x { + font-size: 3em; +} + +.fa-4x { + font-size: 4em; +} + +.fa-5x { + font-size: 5em; +} + +.fa-fw { + width: 1.28571em; + text-align: center; +} + +.fa-ul { + padding-left: 0; + margin-left: 2.14286em; + list-style-type: none; +} +.fa-ul > li { + position: relative; +} + +.fa-li { + position: absolute; + left: -2.14286em; + width: 2.14286em; + top: 0.14286em; + text-align: center; +} +.fa-li.fa-lg { + left: -1.85714em; +} + +.fa-border { + padding: .2em .25em .15em; + border: solid 0.08em #eeeeee; + border-radius: .1em; +} + +.pull-right { + float: right; +} + +.pull-left { + float: left; +} + +.fa.pull-left { + margin-right: .3em; +} +.fa.pull-right { + margin-left: .3em; +} + +.fa-spin { + -webkit-animation: spin 2s infinite linear; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} + +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg); + } + + 100% { + -moz-transform: rotate(359deg); + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(359deg); + } +} + +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg); + } + + 100% { + -o-transform: rotate(359deg); + } +} + +@keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} + +.fa-rotate-90 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + -o-transform: rotate(90deg); + transform: rotate(90deg); +} + +.fa-rotate-180 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); +} + +.fa-rotate-270 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); + -webkit-transform: rotate(270deg); + -moz-transform: rotate(270deg); + -ms-transform: rotate(270deg); + -o-transform: rotate(270deg); + transform: rotate(270deg); +} + +.fa-flip-horizontal { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0); + -webkit-transform: scale(-1, 1); + -moz-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + transform: scale(-1, 1); +} + +.fa-flip-vertical { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); + -webkit-transform: scale(1, -1); + -moz-transform: scale(1, -1); + -ms-transform: scale(1, -1); + -o-transform: scale(1, -1); + transform: scale(1, -1); +} + +.fa-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} + +.fa-stack-1x, .fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} + +.fa-stack-1x { + line-height: inherit; +} + +.fa-stack-2x { + font-size: 2em; +} + +.fa-inverse { + color: white; +} + +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.fa-glass:before { + content: "\f000"; +} + +.fa-music:before { + content: "\f001"; +} + +.fa-search:before { + content: "\f002"; +} + +.fa-envelope-o:before { + content: "\f003"; +} + +.fa-heart:before { + content: "\f004"; +} + +.fa-star:before { + content: "\f005"; +} + +.fa-star-o:before { + content: "\f006"; +} + +.fa-user:before { + content: "\f007"; +} + +.fa-film:before { + content: "\f008"; +} + +.fa-th-large:before { + content: "\f009"; +} + +.fa-th:before { + content: "\f00a"; +} + +.fa-th-list:before { + content: "\f00b"; +} + +.fa-check:before { + content: "\f00c"; +} + +.fa-times:before { + content: "\f00d"; +} + +.fa-search-plus:before { + content: "\f00e"; +} + +.fa-search-minus:before { + content: "\f010"; +} + +.fa-power-off:before { + content: "\f011"; +} + +.fa-signal:before { + content: "\f012"; +} + +.fa-gear:before, +.fa-cog:before { + content: "\f013"; +} + +.fa-trash-o:before { + content: "\f014"; +} + +.fa-home:before { + content: "\f015"; +} + +.fa-file-o:before { + content: "\f016"; +} + +.fa-clock-o:before { + content: "\f017"; +} + +.fa-road:before { + content: "\f018"; +} + +.fa-download:before { + content: "\f019"; +} + +.fa-arrow-circle-o-down:before { + content: "\f01a"; +} + +.fa-arrow-circle-o-up:before { + content: "\f01b"; +} + +.fa-inbox:before { + content: "\f01c"; +} + +.fa-play-circle-o:before { + content: "\f01d"; +} + +.fa-rotate-right:before, +.fa-repeat:before { + content: "\f01e"; +} + +.fa-refresh:before { + content: "\f021"; +} + +.fa-list-alt:before { + content: "\f022"; +} + +.fa-lock:before { + content: "\f023"; +} + +.fa-flag:before { + content: "\f024"; +} + +.fa-headphones:before { + content: "\f025"; +} + +.fa-volume-off:before { + content: "\f026"; +} + +.fa-volume-down:before { + content: "\f027"; +} + +.fa-volume-up:before { + content: "\f028"; +} + +.fa-qrcode:before { + content: "\f029"; +} + +.fa-barcode:before { + content: "\f02a"; +} + +.fa-tag:before { + content: "\f02b"; +} + +.fa-tags:before { + content: "\f02c"; +} + +.fa-book:before { + content: "\f02d"; +} + +.fa-bookmark:before { + content: "\f02e"; +} + +.fa-print:before { + content: "\f02f"; +} + +.fa-camera:before { + content: "\f030"; +} + +.fa-font:before { + content: "\f031"; +} + +.fa-bold:before { + content: "\f032"; +} + +.fa-italic:before { + content: "\f033"; +} + +.fa-text-height:before { + content: "\f034"; +} + +.fa-text-width:before { + content: "\f035"; +} + +.fa-align-left:before { + content: "\f036"; +} + +.fa-align-center:before { + content: "\f037"; +} + +.fa-align-right:before { + content: "\f038"; +} + +.fa-align-justify:before { + content: "\f039"; +} + +.fa-list:before { + content: "\f03a"; +} + +.fa-dedent:before, +.fa-outdent:before { + content: "\f03b"; +} + +.fa-indent:before { + content: "\f03c"; +} + +.fa-video-camera:before { + content: "\f03d"; +} + +.fa-photo:before, +.fa-image:before, +.fa-picture-o:before { + content: "\f03e"; +} + +.fa-pencil:before { + content: "\f040"; +} + +.fa-map-marker:before { + content: "\f041"; +} + +.fa-adjust:before { + content: "\f042"; +} + +.fa-tint:before { + content: "\f043"; +} + +.fa-edit:before, +.fa-pencil-square-o:before { + content: "\f044"; +} + +.fa-share-square-o:before { + content: "\f045"; +} + +.fa-check-square-o:before { + content: "\f046"; +} + +.fa-arrows:before { + content: "\f047"; +} + +.fa-step-backward:before { + content: "\f048"; +} + +.fa-fast-backward:before { + content: "\f049"; +} + +.fa-backward:before { + content: "\f04a"; +} + +.fa-play:before { + content: "\f04b"; +} + +.fa-pause:before { + content: "\f04c"; +} + +.fa-stop:before { + content: "\f04d"; +} + +.fa-forward:before { + content: "\f04e"; +} + +.fa-fast-forward:before { + content: "\f050"; +} + +.fa-step-forward:before { + content: "\f051"; +} + +.fa-eject:before { + content: "\f052"; +} + +.fa-chevron-left:before { + content: "\f053"; +} + +.fa-chevron-right:before { + content: "\f054"; +} + +.fa-plus-circle:before { + content: "\f055"; +} + +.fa-minus-circle:before { + content: "\f056"; +} + +.fa-times-circle:before { + content: "\f057"; +} + +.fa-check-circle:before { + content: "\f058"; +} + +.fa-question-circle:before { + content: "\f059"; +} + +.fa-info-circle:before { + content: "\f05a"; +} + +.fa-crosshairs:before { + content: "\f05b"; +} + +.fa-times-circle-o:before { + content: "\f05c"; +} + +.fa-check-circle-o:before { + content: "\f05d"; +} + +.fa-ban:before { + content: "\f05e"; +} + +.fa-arrow-left:before { + content: "\f060"; +} + +.fa-arrow-right:before { + content: "\f061"; +} + +.fa-arrow-up:before { + content: "\f062"; +} + +.fa-arrow-down:before { + content: "\f063"; +} + +.fa-mail-forward:before, +.fa-share:before { + content: "\f064"; +} + +.fa-expand:before { + content: "\f065"; +} + +.fa-compress:before { + content: "\f066"; +} + +.fa-plus:before { + content: "\f067"; +} + +.fa-minus:before { + content: "\f068"; +} + +.fa-asterisk:before { + content: "\f069"; +} + +.fa-exclamation-circle:before { + content: "\f06a"; +} + +.fa-gift:before { + content: "\f06b"; +} + +.fa-leaf:before { + content: "\f06c"; +} + +.fa-fire:before { + content: "\f06d"; +} + +.fa-eye:before { + content: "\f06e"; +} + +.fa-eye-slash:before { + content: "\f070"; +} + +.fa-warning:before, +.fa-exclamation-triangle:before { + content: "\f071"; +} + +.fa-plane:before { + content: "\f072"; +} + +.fa-calendar:before { + content: "\f073"; +} + +.fa-random:before { + content: "\f074"; +} + +.fa-comment:before { + content: "\f075"; +} + +.fa-magnet:before { + content: "\f076"; +} + +.fa-chevron-up:before { + content: "\f077"; +} + +.fa-chevron-down:before { + content: "\f078"; +} + +.fa-retweet:before { + content: "\f079"; +} + +.fa-shopping-cart:before { + content: "\f07a"; +} + +.fa-folder:before { + content: "\f07b"; +} + +.fa-folder-open:before { + content: "\f07c"; +} + +.fa-arrows-v:before { + content: "\f07d"; +} + +.fa-arrows-h:before { + content: "\f07e"; +} + +.fa-bar-chart-o:before { + content: "\f080"; +} + +.fa-twitter-square:before { + content: "\f081"; +} + +.fa-facebook-square:before { + content: "\f082"; +} + +.fa-camera-retro:before { + content: "\f083"; +} + +.fa-key:before { + content: "\f084"; +} + +.fa-gears:before, +.fa-cogs:before { + content: "\f085"; +} + +.fa-comments:before { + content: "\f086"; +} + +.fa-thumbs-o-up:before { + content: "\f087"; +} + +.fa-thumbs-o-down:before { + content: "\f088"; +} + +.fa-star-half:before { + content: "\f089"; +} + +.fa-heart-o:before { + content: "\f08a"; +} + +.fa-sign-out:before { + content: "\f08b"; +} + +.fa-linkedin-square:before { + content: "\f08c"; +} + +.fa-thumb-tack:before { + content: "\f08d"; +} + +.fa-external-link:before { + content: "\f08e"; +} + +.fa-sign-in:before { + content: "\f090"; +} + +.fa-trophy:before { + content: "\f091"; +} + +.fa-github-square:before { + content: "\f092"; +} + +.fa-upload:before { + content: "\f093"; +} + +.fa-lemon-o:before { + content: "\f094"; +} + +.fa-phone:before { + content: "\f095"; +} + +.fa-square-o:before { + content: "\f096"; +} + +.fa-bookmark-o:before { + content: "\f097"; +} + +.fa-phone-square:before { + content: "\f098"; +} + +.fa-twitter:before { + content: "\f099"; +} + +.fa-facebook:before { + content: "\f09a"; +} + +.fa-github:before { + content: "\f09b"; +} + +.fa-unlock:before { + content: "\f09c"; +} + +.fa-credit-card:before { + content: "\f09d"; +} + +.fa-rss:before { + content: "\f09e"; +} + +.fa-hdd-o:before { + content: "\f0a0"; +} + +.fa-bullhorn:before { + content: "\f0a1"; +} + +.fa-bell:before { + content: "\f0f3"; +} + +.fa-certificate:before { + content: "\f0a3"; +} + +.fa-hand-o-right:before { + content: "\f0a4"; +} + +.fa-hand-o-left:before { + content: "\f0a5"; +} + +.fa-hand-o-up:before { + content: "\f0a6"; +} + +.fa-hand-o-down:before { + content: "\f0a7"; +} + +.fa-arrow-circle-left:before { + content: "\f0a8"; +} + +.fa-arrow-circle-right:before { + content: "\f0a9"; +} + +.fa-arrow-circle-up:before { + content: "\f0aa"; +} + +.fa-arrow-circle-down:before { + content: "\f0ab"; +} + +.fa-globe:before { + content: "\f0ac"; +} + +.fa-wrench:before { + content: "\f0ad"; +} + +.fa-tasks:before { + content: "\f0ae"; +} + +.fa-filter:before { + content: "\f0b0"; +} + +.fa-briefcase:before { + content: "\f0b1"; +} + +.fa-arrows-alt:before { + content: "\f0b2"; +} + +.fa-group:before, +.fa-users:before { + content: "\f0c0"; +} + +.fa-chain:before, +.fa-link:before { + content: "\f0c1"; +} + +.fa-cloud:before { + content: "\f0c2"; +} + +.fa-flask:before { + content: "\f0c3"; +} + +.fa-cut:before, +.fa-scissors:before { + content: "\f0c4"; +} + +.fa-copy:before, +.fa-files-o:before { + content: "\f0c5"; +} + +.fa-paperclip:before { + content: "\f0c6"; +} + +.fa-save:before, +.fa-floppy-o:before { + content: "\f0c7"; +} + +.fa-square:before { + content: "\f0c8"; +} + +.fa-navicon:before, +.fa-reorder:before, +.fa-bars:before { + content: "\f0c9"; +} + +.fa-list-ul:before { + content: "\f0ca"; +} + +.fa-list-ol:before { + content: "\f0cb"; +} + +.fa-strikethrough:before { + content: "\f0cc"; +} + +.fa-underline:before { + content: "\f0cd"; +} + +.fa-table:before { + content: "\f0ce"; +} + +.fa-magic:before { + content: "\f0d0"; +} + +.fa-truck:before { + content: "\f0d1"; +} + +.fa-pinterest:before { + content: "\f0d2"; +} + +.fa-pinterest-square:before { + content: "\f0d3"; +} + +.fa-google-plus-square:before { + content: "\f0d4"; +} + +.fa-google-plus:before { + content: "\f0d5"; +} + +.fa-money:before { + content: "\f0d6"; +} + +.fa-caret-down:before { + content: "\f0d7"; +} + +.fa-caret-up:before { + content: "\f0d8"; +} + +.fa-caret-left:before { + content: "\f0d9"; +} + +.fa-caret-right:before { + content: "\f0da"; +} + +.fa-columns:before { + content: "\f0db"; +} + +.fa-unsorted:before, +.fa-sort:before { + content: "\f0dc"; +} + +.fa-sort-down:before, +.fa-sort-desc:before { + content: "\f0dd"; +} + +.fa-sort-up:before, +.fa-sort-asc:before { + content: "\f0de"; +} + +.fa-envelope:before { + content: "\f0e0"; +} + +.fa-linkedin:before { + content: "\f0e1"; +} + +.fa-rotate-left:before, +.fa-undo:before { + content: "\f0e2"; +} + +.fa-legal:before, +.fa-gavel:before { + content: "\f0e3"; +} + +.fa-dashboard:before, +.fa-tachometer:before { + content: "\f0e4"; +} + +.fa-comment-o:before { + content: "\f0e5"; +} + +.fa-comments-o:before { + content: "\f0e6"; +} + +.fa-flash:before, +.fa-bolt:before { + content: "\f0e7"; +} + +.fa-sitemap:before { + content: "\f0e8"; +} + +.fa-umbrella:before { + content: "\f0e9"; +} + +.fa-paste:before, +.fa-clipboard:before { + content: "\f0ea"; +} + +.fa-lightbulb-o:before { + content: "\f0eb"; +} + +.fa-exchange:before { + content: "\f0ec"; +} + +.fa-cloud-download:before { + content: "\f0ed"; +} + +.fa-cloud-upload:before { + content: "\f0ee"; +} + +.fa-user-md:before { + content: "\f0f0"; +} + +.fa-stethoscope:before { + content: "\f0f1"; +} + +.fa-suitcase:before { + content: "\f0f2"; +} + +.fa-bell-o:before { + content: "\f0a2"; +} + +.fa-coffee:before { + content: "\f0f4"; +} + +.fa-cutlery:before { + content: "\f0f5"; +} + +.fa-file-text-o:before { + content: "\f0f6"; +} + +.fa-building-o:before { + content: "\f0f7"; +} + +.fa-hospital-o:before { + content: "\f0f8"; +} + +.fa-ambulance:before { + content: "\f0f9"; +} + +.fa-medkit:before { + content: "\f0fa"; +} + +.fa-fighter-jet:before { + content: "\f0fb"; +} + +.fa-beer:before { + content: "\f0fc"; +} + +.fa-h-square:before { + content: "\f0fd"; +} + +.fa-plus-square:before { + content: "\f0fe"; +} + +.fa-angle-double-left:before { + content: "\f100"; +} + +.fa-angle-double-right:before { + content: "\f101"; +} + +.fa-angle-double-up:before { + content: "\f102"; +} + +.fa-angle-double-down:before { + content: "\f103"; +} + +.fa-angle-left:before { + content: "\f104"; +} + +.fa-angle-right:before { + content: "\f105"; +} + +.fa-angle-up:before { + content: "\f106"; +} + +.fa-angle-down:before { + content: "\f107"; +} + +.fa-desktop:before { + content: "\f108"; +} + +.fa-laptop:before { + content: "\f109"; +} + +.fa-tablet:before { + content: "\f10a"; +} + +.fa-mobile-phone:before, +.fa-mobile:before { + content: "\f10b"; +} + +.fa-circle-o:before { + content: "\f10c"; +} + +.fa-quote-left:before { + content: "\f10d"; +} + +.fa-quote-right:before { + content: "\f10e"; +} + +.fa-spinner:before { + content: "\f110"; +} + +.fa-circle:before { + content: "\f111"; +} + +.fa-mail-reply:before, +.fa-reply:before { + content: "\f112"; +} + +.fa-github-alt:before { + content: "\f113"; +} + +.fa-folder-o:before { + content: "\f114"; +} + +.fa-folder-open-o:before { + content: "\f115"; +} + +.fa-smile-o:before { + content: "\f118"; +} + +.fa-frown-o:before { + content: "\f119"; +} + +.fa-meh-o:before { + content: "\f11a"; +} + +.fa-gamepad:before { + content: "\f11b"; +} + +.fa-keyboard-o:before { + content: "\f11c"; +} + +.fa-flag-o:before { + content: "\f11d"; +} + +.fa-flag-checkered:before { + content: "\f11e"; +} + +.fa-terminal:before { + content: "\f120"; +} + +.fa-code:before { + content: "\f121"; +} + +.fa-mail-reply-all:before, +.fa-reply-all:before { + content: "\f122"; +} + +.fa-star-half-empty:before, +.fa-star-half-full:before, +.fa-star-half-o:before { + content: "\f123"; +} + +.fa-location-arrow:before { + content: "\f124"; +} + +.fa-crop:before { + content: "\f125"; +} + +.fa-code-fork:before { + content: "\f126"; +} + +.fa-unlink:before, +.fa-chain-broken:before { + content: "\f127"; +} + +.fa-question:before { + content: "\f128"; +} + +.fa-info:before { + content: "\f129"; +} + +.fa-exclamation:before { + content: "\f12a"; +} + +.fa-superscript:before { + content: "\f12b"; +} + +.fa-subscript:before { + content: "\f12c"; +} + +.fa-eraser:before { + content: "\f12d"; +} + +.fa-puzzle-piece:before { + content: "\f12e"; +} + +.fa-microphone:before { + content: "\f130"; +} + +.fa-microphone-slash:before { + content: "\f131"; +} + +.fa-shield:before { + content: "\f132"; +} + +.fa-calendar-o:before { + content: "\f133"; +} + +.fa-fire-extinguisher:before { + content: "\f134"; +} + +.fa-rocket:before { + content: "\f135"; +} + +.fa-maxcdn:before { + content: "\f136"; +} + +.fa-chevron-circle-left:before { + content: "\f137"; +} + +.fa-chevron-circle-right:before { + content: "\f138"; +} + +.fa-chevron-circle-up:before { + content: "\f139"; +} + +.fa-chevron-circle-down:before { + content: "\f13a"; +} + +.fa-html5:before { + content: "\f13b"; +} + +.fa-css3:before { + content: "\f13c"; +} + +.fa-anchor:before { + content: "\f13d"; +} + +.fa-unlock-alt:before { + content: "\f13e"; +} + +.fa-bullseye:before { + content: "\f140"; +} + +.fa-ellipsis-h:before { + content: "\f141"; +} + +.fa-ellipsis-v:before { + content: "\f142"; +} + +.fa-rss-square:before { + content: "\f143"; +} + +.fa-play-circle:before { + content: "\f144"; +} + +.fa-ticket:before { + content: "\f145"; +} + +.fa-minus-square:before { + content: "\f146"; +} + +.fa-minus-square-o:before { + content: "\f147"; +} + +.fa-level-up:before { + content: "\f148"; +} + +.fa-level-down:before { + content: "\f149"; +} + +.fa-check-square:before { + content: "\f14a"; +} + +.fa-pencil-square:before { + content: "\f14b"; +} + +.fa-external-link-square:before { + content: "\f14c"; +} + +.fa-share-square:before { + content: "\f14d"; +} + +.fa-compass:before { + content: "\f14e"; +} + +.fa-toggle-down:before, +.fa-caret-square-o-down:before { + content: "\f150"; +} + +.fa-toggle-up:before, +.fa-caret-square-o-up:before { + content: "\f151"; +} + +.fa-toggle-right:before, +.fa-caret-square-o-right:before { + content: "\f152"; +} + +.fa-euro:before, +.fa-eur:before { + content: "\f153"; +} + +.fa-gbp:before { + content: "\f154"; +} + +.fa-dollar:before, +.fa-usd:before { + content: "\f155"; +} + +.fa-rupee:before, +.fa-inr:before { + content: "\f156"; +} + +.fa-cny:before, +.fa-rmb:before, +.fa-yen:before, +.fa-jpy:before { + content: "\f157"; +} + +.fa-ruble:before, +.fa-rouble:before, +.fa-rub:before { + content: "\f158"; +} + +.fa-won:before, +.fa-krw:before { + content: "\f159"; +} + +.fa-bitcoin:before, +.fa-btc:before { + content: "\f15a"; +} + +.fa-file:before { + content: "\f15b"; +} + +.fa-file-text:before { + content: "\f15c"; +} + +.fa-sort-alpha-asc:before { + content: "\f15d"; +} + +.fa-sort-alpha-desc:before { + content: "\f15e"; +} + +.fa-sort-amount-asc:before { + content: "\f160"; +} + +.fa-sort-amount-desc:before { + content: "\f161"; +} + +.fa-sort-numeric-asc:before { + content: "\f162"; +} + +.fa-sort-numeric-desc:before { + content: "\f163"; +} + +.fa-thumbs-up:before { + content: "\f164"; +} + +.fa-thumbs-down:before { + content: "\f165"; +} + +.fa-youtube-square:before { + content: "\f166"; +} + +.fa-youtube:before { + content: "\f167"; +} + +.fa-xing:before { + content: "\f168"; +} + +.fa-xing-square:before { + content: "\f169"; +} + +.fa-youtube-play:before { + content: "\f16a"; +} + +.fa-dropbox:before { + content: "\f16b"; +} + +.fa-stack-overflow:before { + content: "\f16c"; +} + +.fa-instagram:before { + content: "\f16d"; +} + +.fa-flickr:before { + content: "\f16e"; +} + +.fa-adn:before { + content: "\f170"; +} + +.fa-bitbucket:before { + content: "\f171"; +} + +.fa-bitbucket-square:before { + content: "\f172"; +} + +.fa-tumblr:before { + content: "\f173"; +} + +.fa-tumblr-square:before { + content: "\f174"; +} + +.fa-long-arrow-down:before { + content: "\f175"; +} + +.fa-long-arrow-up:before { + content: "\f176"; +} + +.fa-long-arrow-left:before { + content: "\f177"; +} + +.fa-long-arrow-right:before { + content: "\f178"; +} + +.fa-apple:before { + content: "\f179"; +} + +.fa-windows:before { + content: "\f17a"; +} + +.fa-android:before { + content: "\f17b"; +} + +.fa-linux:before { + content: "\f17c"; +} + +.fa-dribbble:before { + content: "\f17d"; +} + +.fa-skype:before { + content: "\f17e"; +} + +.fa-foursquare:before { + content: "\f180"; +} + +.fa-trello:before { + content: "\f181"; +} + +.fa-female:before { + content: "\f182"; +} + +.fa-male:before { + content: "\f183"; +} + +.fa-gittip:before { + content: "\f184"; +} + +.fa-sun-o:before { + content: "\f185"; +} + +.fa-moon-o:before { + content: "\f186"; +} + +.fa-archive:before { + content: "\f187"; +} + +.fa-bug:before { + content: "\f188"; +} + +.fa-vk:before { + content: "\f189"; +} + +.fa-weibo:before { + content: "\f18a"; +} + +.fa-renren:before { + content: "\f18b"; +} + +.fa-pagelines:before { + content: "\f18c"; +} + +.fa-stack-exchange:before { + content: "\f18d"; +} + +.fa-arrow-circle-o-right:before { + content: "\f18e"; +} + +.fa-arrow-circle-o-left:before { + content: "\f190"; +} + +.fa-toggle-left:before, +.fa-caret-square-o-left:before { + content: "\f191"; +} + +.fa-dot-circle-o:before { + content: "\f192"; +} + +.fa-wheelchair:before { + content: "\f193"; +} + +.fa-vimeo-square:before { + content: "\f194"; +} + +.fa-turkish-lira:before, +.fa-try:before { + content: "\f195"; +} + +.fa-plus-square-o:before { + content: "\f196"; +} + +.fa-space-shuttle:before { + content: "\f197"; +} + +.fa-slack:before { + content: "\f198"; +} + +.fa-envelope-square:before { + content: "\f199"; +} + +.fa-wordpress:before { + content: "\f19a"; +} + +.fa-openid:before { + content: "\f19b"; +} + +.fa-institution:before, +.fa-bank:before, +.fa-university:before { + content: "\f19c"; +} + +.fa-mortar-board:before, +.fa-graduation-cap:before { + content: "\f19d"; +} + +.fa-yahoo:before { + content: "\f19e"; +} + +.fa-google:before { + content: "\f1a0"; +} + +.fa-reddit:before { + content: "\f1a1"; +} + +.fa-reddit-square:before { + content: "\f1a2"; +} + +.fa-stumbleupon-circle:before { + content: "\f1a3"; +} + +.fa-stumbleupon:before { + content: "\f1a4"; +} + +.fa-delicious:before { + content: "\f1a5"; +} + +.fa-digg:before { + content: "\f1a6"; +} + +.fa-pied-piper-square:before, +.fa-pied-piper:before { + content: "\f1a7"; +} + +.fa-pied-piper-alt:before { + content: "\f1a8"; +} + +.fa-drupal:before { + content: "\f1a9"; +} + +.fa-joomla:before { + content: "\f1aa"; +} + +.fa-language:before { + content: "\f1ab"; +} + +.fa-fax:before { + content: "\f1ac"; +} + +.fa-building:before { + content: "\f1ad"; +} + +.fa-child:before { + content: "\f1ae"; +} + +.fa-paw:before { + content: "\f1b0"; +} + +.fa-spoon:before { + content: "\f1b1"; +} + +.fa-cube:before { + content: "\f1b2"; +} + +.fa-cubes:before { + content: "\f1b3"; +} + +.fa-behance:before { + content: "\f1b4"; +} + +.fa-behance-square:before { + content: "\f1b5"; +} + +.fa-steam:before { + content: "\f1b6"; +} + +.fa-steam-square:before { + content: "\f1b7"; +} + +.fa-recycle:before { + content: "\f1b8"; +} + +.fa-automobile:before, +.fa-car:before { + content: "\f1b9"; +} + +.fa-cab:before, +.fa-taxi:before { + content: "\f1ba"; +} + +.fa-tree:before { + content: "\f1bb"; +} + +.fa-spotify:before { + content: "\f1bc"; +} + +.fa-deviantart:before { + content: "\f1bd"; +} + +.fa-soundcloud:before { + content: "\f1be"; +} + +.fa-database:before { + content: "\f1c0"; +} + +.fa-file-pdf-o:before { + content: "\f1c1"; +} + +.fa-file-word-o:before { + content: "\f1c2"; +} + +.fa-file-excel-o:before { + content: "\f1c3"; +} + +.fa-file-powerpoint-o:before { + content: "\f1c4"; +} + +.fa-file-photo-o:before, +.fa-file-picture-o:before, +.fa-file-image-o:before { + content: "\f1c5"; +} + +.fa-file-zip-o:before, +.fa-file-archive-o:before { + content: "\f1c6"; +} + +.fa-file-sound-o:before, +.fa-file-audio-o:before { + content: "\f1c7"; +} + +.fa-file-movie-o:before, +.fa-file-video-o:before { + content: "\f1c8"; +} + +.fa-file-code-o:before { + content: "\f1c9"; +} + +.fa-vine:before { + content: "\f1ca"; +} + +.fa-codepen:before { + content: "\f1cb"; +} + +.fa-jsfiddle:before { + content: "\f1cc"; +} + +.fa-life-bouy:before, +.fa-life-saver:before, +.fa-support:before, +.fa-life-ring:before { + content: "\f1cd"; +} + +.fa-circle-o-notch:before { + content: "\f1ce"; +} + +.fa-ra:before, +.fa-rebel:before { + content: "\f1d0"; +} + +.fa-ge:before, +.fa-empire:before { + content: "\f1d1"; +} + +.fa-git-square:before { + content: "\f1d2"; +} + +.fa-git:before { + content: "\f1d3"; +} + +.fa-hacker-news:before { + content: "\f1d4"; +} + +.fa-tencent-weibo:before { + content: "\f1d5"; +} + +.fa-qq:before { + content: "\f1d6"; +} + +.fa-wechat:before, +.fa-weixin:before { + content: "\f1d7"; +} + +.fa-send:before, +.fa-paper-plane:before { + content: "\f1d8"; +} + +.fa-send-o:before, +.fa-paper-plane-o:before { + content: "\f1d9"; +} + +.fa-history:before { + content: "\f1da"; +} + +.fa-circle-thin:before { + content: "\f1db"; +} + +.fa-header:before { + content: "\f1dc"; +} + +.fa-paragraph:before { + content: "\f1dd"; +} + +.fa-sliders:before { + content: "\f1de"; +} + +.fa-share-alt:before { + content: "\f1e0"; +} + +.fa-share-alt-square:before { + content: "\f1e1"; +} + +.fa-bomb:before { + content: "\f1e2"; +} diff --git a/public/css/font-awesome.min.css b/public/css/font-awesome.min.css new file mode 100644 index 0000000..0b4da0b --- /dev/null +++ b/public/css/font-awesome.min.css @@ -0,0 +1 @@ +@font-face{font-family:FontAwesome;src:url(../fonts/fontawesome-webfont.eot?v=4.1.0);src:url(../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0) format("embedded-opentype"),url(../fonts/fontawesome-webfont.woff?v=4.1.0) format("woff"),url(../fonts/fontawesome-webfont.ttf?v=4.1.0) format("truetype"),url(../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-square:before,.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"} \ No newline at end of file diff --git a/public/css/ink-flex.css b/public/css/ink-flex.css new file mode 100644 index 0000000..3e5d7ef --- /dev/null +++ b/public/css/ink-flex.css @@ -0,0 +1,9690 @@ +@charset "UTF-8"; +/** + * Ink + * + * A set of tools for quick development of web interfaces. + * + * @package Ink + * @author Sapo Ink Team + * @license http://opensource.org/licenses/MIT MIT + * @link http://ink.sapo.pt + * @version 3.0.5 + */ +/** + * Ink class names prefix + * Used in all of Inks components root elements + */ +/** + * Grid class names + */ +/** + * Alerts class names + */ +/** + * Badges class names + */ +/** + * Buttons class names + */ +/** + * Forms class names + */ +/** + * Labels class names + */ +/** + * Navigation class names + */ +/** + * Dropdown class names + */ +/** + * Tables class names + */ +/** + * Images class names + */ +/** + * JS UI components classe names + */ +/** + * Sets the grids maximum width + * @var $grid-max-width (pixels|ems|percentage) + */ +/*! + * Sets the grids breakpoint + * + * To add a new break point you'll need to add an element to the list. + * + * Here's an example: ( class-name-prefix, minimum-width, maximum-width, gutter-width, no-media-query). + * + * media: media type. + * class-name-prefix: this is the prefix used in tons of inks classes i.e.: large-100, small-40, etc. + * minimum-width: (pixels|null) the minimum width for the breakpoint + * maximum-width: (pixels|null) the maximum width for the breakpoint + * gutter-width: (ems) the width for the gutters (space between grid columns) for the breakpoint + * no-media-query: (true|false) if you need to support IE8 set this to true on a single breakpoint. + * Since IE8 does not support the @media statement leaving one of the breakpoints + * outside a @media query let's you use the grid in IE8. + * + */ +.grid-order { + flex: 100%; +} + +.show-all { + display: inherit; +} + +.hide-all { + display: none !important; +} + +.no-margin { + margin: 0 !important; +} + +.no-padding { + padding: 0 !important; +} + +.push-left { + float: left; + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + justify-content: flex-start; +} + +.push-center { + float: none !important; + margin-left: auto; + margin-right: auto; + -webkit-justify-content: center; + -moz-justify-content: center; + justify-content: center; +} + +.push-right { + float: right; + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + justify-content: flex-end; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +.clearfix { + overflow: hidden; + *zoom: 1; + *zoom: 1; +} +.clearfix:after { + content: ""; + display: table; + clear: both; +} + +/*! normalize.css v3.0.0 | MIT License | git.io/normalize */ +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ +html { + font-family: sans-serif; + /* 1 */ + -ms-text-size-adjust: 100%; + /* 2 */ + -webkit-text-size-adjust: 100%; + /* 2 */ +} +html * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +/** + * Remove default margin. + */ +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ +/** + * Correct `block` display not defined in IE 8/9. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ +audio, +canvas, +progress, +video { + display: inline-block; + /* 1 */ + vertical-align: baseline; + /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9. + * Hide the `template` element in IE, Safari, and Firefox < 22. + */ +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ +/** + * Remove the gray background color from active links in IE 10. + */ +a { + background: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ +/** + * Address styling not present in IE 8/9, Safari 5, and Chrome. + */ +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. + */ +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari 5, and Chrome. + */ +h1 { + font-size: 2em; + margin: .67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -.5em; +} + +sub { + bottom: -.25em; +} + +/* Embedded content + ========================================================================== */ +/** + * Remove border when inside `a` element in IE 8/9. + */ +img { + border: 0; +} + +/** + * Correct overflow displayed oddly in IE 9. + */ +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ +/** + * Address margin not present in IE 8/9 and Safari 5. + */ +figure { + margin: 0; +} + +/** + * Address differences between Firefox and other browsers. + */ +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. + */ +button, +input, +optgroup, +select, +textarea { + color: inherit; + /* 1 */ + font: inherit; + /* 2 */ + margin: 0; + /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10. + */ +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8+, and Opera + * Correct `select` style inheritance in Firefox. + */ +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + /* 2 */ + cursor: pointer; + /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + /* 2 */ + box-sizing: border-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: .35em .625em .75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ +legend { + border: 0; + /* 1 */ + padding: 0; + /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9. + */ +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ +/** + * Remove most spacing between table cells. + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} + +.ink-alert.basic, .ink-alert.block { + font-size: .938em; + margin: 1em 0; + position: relative; + overflow: hidden; +} +.ink-alert.basic { + padding: 1em 3em 1em 1em; +} +.ink-alert.basic p { + margin: 0; +} +.ink-alert.basic .ink-close { + top: .55em; + *top: .2em; +} +.ink-alert.block { + font-size: 1em; +} +.ink-alert.block > h4 { + padding: 1em 3em 1em 1em; + font-size: .938em; + line-height: 1.5; + margin: 0; +} +.ink-alert.block p { + margin: 1.5em 1em; +} +.ink-alert.block ul { + list-style: inside; +} +.ink-alert .ink-dismiss { + position: absolute; + line-height: .56em; + font-size: 1.8em; + padding: 5px; + border: none; + background: none; + top: .5em; + *top: .2em; + right: .4em; +} + +.ink-badge { + padding: 0.2em 0.6em; + font-size: 0.813em; + margin-left: .6em; +} + +.ink-button { + -webkit-appearance: menuitem; + padding: 8px 12px; + cursor: pointer; + text-decoration: none; + text-align: center; + display: inline-block; + vertical-align: middle; + white-space: nowrap; + line-height: normal; +} +.ink-button + .ink-button { + margin-left: 5px; +} + +.button-group { + *zoom: 1; +} +.button-group > .ink-button { + float: left; + margin: 5px 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + -ms-border-radius: 0; + -o-border-radius: 0; + border-radius: 0; + border-left: none; +} +.button-group > .ink-button:hover, .button-group > .ink-button:active { + border-left: none; +} +.button-group > .ink-button:first-child { + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; + border-left: 1px solid #bfbfbf; +} +.button-group > .ink-button:last-child { + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.button-group:after { + content: ""; + display: table; + clear: both; +} + +.button-toolbar { + *zoom: 1; +} +.button-toolbar > .button-group { + margin-right: 10px; + float: left; +} +.button-toolbar:after { + content: ""; + display: table; + clear: both; +} + +.ink-form fieldset { + border: none; + margin-bottom: 1.5em; + padding: 0; + margin: 0; +} +.ink-form fieldset legend { + font-size: 1.438em; + font-weight: 700; + width: 100%; + border-bottom: 1px solid #ddd; +} +.ink-form fieldset legend + * { + -webkit-margin-top-collapse: separate; + margin: 2em 0; +} +.ink-form p.tip { + font-size: .875em; + color: #909090; + position: relative; + margin: .2em 0 0 .1em; +} +.ink-form p.label { + padding: 0; + margin: 0; + color: #555555; + white-space: normal; +} +.ink-form select, +.ink-form textarea, +.ink-form input[type="text"], +.ink-form input[type="password"], +.ink-form input[type="datetime"], +.ink-form input[type="datetime-local"], +.ink-form input[type="date"], +.ink-form input[type="month"], +.ink-form input[type="time"], +.ink-form input[type="week"], +.ink-form input[type="number"], +.ink-form input[type="email"], +.ink-form input[type="url"], +.ink-form input[type="search"], +.ink-form input[type="tel"], +.ink-form input[type="color"] { + font-family: "Roboto", Arial, Helvetica, sans-serif; + font-weight: 300; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + padding: 8px 6px; + border: 1px solid #c6c6c6; + resize: none; + background: white; + vertical-align: middle; +} +.ink-form select:focus, +.ink-form textarea:focus, +.ink-form input[type="text"]:focus, +.ink-form input[type="password"]:focus, +.ink-form input[type="datetime"]:focus, +.ink-form input[type="datetime-local"]:focus, +.ink-form input[type="date"]:focus, +.ink-form input[type="month"]:focus, +.ink-form input[type="time"]:focus, +.ink-form input[type="week"]:focus, +.ink-form input[type="number"]:focus, +.ink-form input[type="email"]:focus, +.ink-form input[type="url"]:focus, +.ink-form input[type="search"]:focus, +.ink-form input[type="tel"]:focus, +.ink-form input[type="color"]:focus { + outline: none; + border-color: rgba(153, 153, 153, 0.9); + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + outline: 0 none; +} +.ink-form select:disabled, +.ink-form textarea:disabled, +.ink-form input[type="text"]:disabled, +.ink-form input[type="password"]:disabled, +.ink-form input[type="datetime"]:disabled, +.ink-form input[type="datetime-local"]:disabled, +.ink-form input[type="date"]:disabled, +.ink-form input[type="month"]:disabled, +.ink-form input[type="time"]:disabled, +.ink-form input[type="week"]:disabled, +.ink-form input[type="number"]:disabled, +.ink-form input[type="email"]:disabled, +.ink-form input[type="url"]:disabled, +.ink-form input[type="search"]:disabled, +.ink-form input[type="tel"]:disabled, +.ink-form input[type="color"]:disabled { + background: #f2f2f2; + cursor: not-allowed; +} +.ink-form .input-file { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + padding: 6px; + border: 1px solid #c6c6c6; + background: white; + vertical-align: middle; + line-height: 1.2; +} +.ink-form .input-file input[type="file"] { + -webkit-border-radius: 0; + -moz-border-radius: 0; + -ms-border-radius: 0; + -o-border-radius: 0; + border-radius: 0; + border: none; + padding: 0; + background: none; + width: 100%; +} +.ink-form .ink-button { + margin: 0 5px; +} +.ink-form label { + cursor: pointer; +} +.ink-form select { + line-height: 2; + cursor: pointer; +} +.ink-form textarea { + min-height: 5em; +} +.ink-form .control-group { + line-height: 2; + margin-bottom: 1em; + *zoom: 1; +} +.ink-form .control-group:after { + content: ""; + display: table; + clear: both; +} +.ink-form .control-group .control { + position: relative; + *zoom: 1; +} +.ink-form .control-group .control:after { + content: ""; + display: table; + clear: both; +} +.ink-form .control-group .control > li { + margin: 0; + *zoom: 1; +} +.ink-form .control-group .control > li:after { + content: ""; + display: table; + clear: both; +} +.ink-form .control-group .control > input, .ink-form .control-group .control > select, .ink-form .control-group .control > textarea { + width: 100%; +} +.ink-form .control-group .control > input + [class^="icon-"], .ink-form .control-group .control > input + [class*=" icon-"], .ink-form .control-group .control > select + [class^="icon-"], .ink-form .control-group .control > select + [class*=" icon-"], .ink-form .control-group .control > textarea + [class^="icon-"], .ink-form .control-group .control > textarea + [class*=" icon-"] { + display: none; +} +.ink-form .control-group .control.append-button span, .ink-form .control-group .control.append-symbol span, .ink-form .control-group .control.prepend-button span, .ink-form .control-group .control.prepend-symbol span { + width: 100%; + position: relative; +} +.ink-form .control-group .control.append-button span > input, .ink-form .control-group .control.append-button span > select, .ink-form .control-group .control.append-button span > textarea, .ink-form .control-group .control.append-symbol span > input, .ink-form .control-group .control.append-symbol span > select, .ink-form .control-group .control.append-symbol span > textarea, .ink-form .control-group .control.prepend-button span > input, .ink-form .control-group .control.prepend-button span > select, .ink-form .control-group .control.prepend-button span > textarea, .ink-form .control-group .control.prepend-symbol span > input, .ink-form .control-group .control.prepend-symbol span > select, .ink-form .control-group .control.prepend-symbol span > textarea { + width: 100%; +} +.ink-form .control-group .control.append-button > input[type="submit"], .ink-form .control-group .control.append-button > input[type="button"], .ink-form .control-group .control.append-button > input[type="reset"], .ink-form .control-group .control.append-symbol > input[type="submit"], .ink-form .control-group .control.append-symbol > input[type="button"], .ink-form .control-group .control.append-symbol > input[type="reset"], .ink-form .control-group .control.prepend-button > input[type="submit"], .ink-form .control-group .control.prepend-button > input[type="button"], .ink-form .control-group .control.prepend-button > input[type="reset"], .ink-form .control-group .control.prepend-symbol > input[type="submit"], .ink-form .control-group .control.prepend-symbol > input[type="button"], .ink-form .control-group .control.prepend-symbol > input[type="reset"] { + width: auto; +} +.ink-form .control-group .control.append-button { + display: -webkit-flex; + display: flex; + display: -ms-flexbox; +} +.ink-form .control-group .control.append-button span { + display: table-cell; +} +.ink-form .control-group .control.append-button span > input, .ink-form .control-group .control.append-button span > select, .ink-form .control-group .control.append-button span > textarea { + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.ink-form .control-group .control.append-button .ink-button { + margin: 0; + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; + border-left: none; +} +.ink-form .control-group .control.prepend-button { + display: -webkit-flex; + display: flex; + display: -ms-flexbox; +} +.ink-form .control-group .control.prepend-button span { + display: table-cell; +} +.ink-form .control-group .control.prepend-button span > input, .ink-form .control-group .control.prepend-button span > select, .ink-form .control-group .control.prepend-button span > textarea { + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.ink-form .control-group .control.prepend-button .ink-button { + margin: 0; + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; + border-right: none; +} +.ink-form .control-group .control.append-symbol span { + display: block; +} +.ink-form .control-group .control.append-symbol span > input, .ink-form .control-group .control.append-symbol span > select, .ink-form .control-group .control.append-symbol span > textarea { + padding-right: 2.5em; +} +.ink-form .control-group .control.append-symbol span > [class^="fa-"], .ink-form .control-group .control.append-symbol span > [class*=" fa-"] { + position: absolute; + right: 1em; + top: .86em; + pointer-events: none; +} +.ink-form .control-group .control.prepend-symbol span { + display: block; +} +.ink-form .control-group .control.prepend-symbol span > input, .ink-form .control-group .control.prepend-symbol span > select, .ink-form .control-group .control.prepend-symbol span > textarea { + padding-left: 2.5em; +} +.ink-form .control-group .control.prepend-symbol span > [class^="fa-"], .ink-form .control-group .control.prepend-symbol span > [class*=" fa-"] { + position: absolute; + left: 1em; + top: .86em; + pointer-events: none; +} +.ink-form .control-group input[type="radio"], +.ink-form .control-group input[type="checkbox"] { + padding: 0; + margin: .55em 0; + border: none; + clear: left; + float: left; + cursor: pointer; +} +.ink-form .control-group input[type="radio"] + label, +.ink-form .control-group input[type="checkbox"] + label { + float: left; + margin: .25em 0 .25em .4em; +} +.ink-form .control-group .inline li { + padding: 0; +} +.ink-form .control-group .inline li label { + margin-right: 1em; +} +.ink-form .control-group.validation.error input, .ink-form .control-group.validation.error textarea, .ink-form .control-group.validation.error select { + outline: none; + border-color: rgba(200, 10, 16, 0.8); + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + border: 1px solid rgba(200, 10, 16, 0.5); +} +.ink-form .control-group.validation.error p.tip { + color: rgba(150, 7, 12, 0.55); +} +.ink-form .control-group.validation.warning input, .ink-form .control-group.validation.warning textarea, .ink-form .control-group.validation.warning select { + outline: none; + border-color: rgba(255, 156, 0, 0.9); + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + border: 1px solid rgba(255, 156, 0, 0.6); +} +.ink-form .control-group.validation.warning p.tip { + color: rgba(204, 125, 0, 0.6); +} +.ink-form .control-group.required label, .ink-form .control-group.required p.label { + color: #555555; +} +.ink-form .control-group.required label:after, .ink-form .control-group.required p.label:after { + content: "\f069"; + color: #c91111; + margin-left: .6em; + font-family: FontAwesome; + font-size: .75em; + width: 1.25em; +} +.ink-form .control-group.required ul.control label:after { + content: ""; +} + +.ink-grid { + width: auto; + max-width: 1440px; + margin: 0 auto; +} + +.order-1 { + order: 1; + -ms-flex-order: 1; +} + +.order-2 { + order: 2; + -ms-flex-order: 2; +} + +.order-3 { + order: 3; + -ms-flex-order: 3; +} + +.order-4 { + order: 4; + -ms-flex-order: 4; +} + +.order-5 { + order: 5; + -ms-flex-order: 5; +} + +.order-6 { + order: 6; + -ms-flex-order: 6; +} + +.order-7 { + order: 7; + -ms-flex-order: 7; +} + +.order-8 { + order: 8; + -ms-flex-order: 8; +} + +.order-9 { + order: 9; + -ms-flex-order: 9; +} + +.order-10 { + order: 10; + -ms-flex-order: 10; +} + +.all-5 { + width: 5%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-10 { + width: 10%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-15 { + width: 15%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-16 { + width: 16.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-20 { + width: 20%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-25 { + width: 25%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-30 { + width: 30%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-33 { + width: 33.33333%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-35 { + width: 35%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-40 { + width: 40%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-45 { + width: 45%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-50 { + width: 50%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-55 { + width: 55%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-60 { + width: 60%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-65 { + width: 65%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-66 { + width: 66.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-70 { + width: 70%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-75 { + width: 75%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-80 { + width: 80%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-85 { + width: 85%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-90 { + width: 90%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-95 { + width: 95%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-100 { + width: 100%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; +} + +.all-auto { + -webkit-box-flex: 1; + -webkit-flex: 1; + -moz-box-flex: 1; + -ms-flex: 1; + flex: 1; +} + +@media screen and (min-width: 1261px) { + .ink-grid { + padding: 0 2em; + } + + .column-group.gutters { + margin-left: -2em; + } + .column-group.gutters > [class*=xlarge-], .column-group.gutters > [class*=all-], .column-group.gutters > .all-auto { + padding-left: 2em; + margin-bottom: 2em; + } + + .column-group.horizontal-gutters { + margin-left: -2em; + } + .column-group.horizontal-gutters > [class*=xlarge-], .column-group.horizontal-gutters > [class*=all-], .column-group.horizontal-gutters > .all-auto { + padding-left: 2em; + } + + .column-group.vertical-gutters > [class*=xlarge-], .column-group.vertical-gutters > [class*=all-], .column-group.vertical-gutters > .all-auto { + margin-bottom: 2em; + } + + .column-group.double-gutters { + margin-left: -4em; + } + .column-group.double-gutters > [class*=xlarge-], .column-group.double-gutters > [class*=all-], .column-group.double-gutters > .all-auto { + padding-left: 4em; + margin-bottom: 4em; + } + + .column-group.double-horizontal-gutters { + margin-left: -4em; + } + .column-group.double-horizontal-gutters > [class*=xlarge-], .column-group.double-horizontal-gutters > [class*=all-], .column-group.double-horizontal-gutters > .all-auto { + padding-left: 4em; + } + + .column-group.double-vertical-gutters > [class*=xlarge-], .column-group.double-vertical-gutters > [class*=all-], .column-group.double-vertical-gutters > .all-auto { + margin-bottom: 4em; + } + + .column-group.half-gutters { + margin-left: -1em; + } + .column-group.half-gutters > [class*=xlarge-], .column-group.half-gutters > [class*=all-], .column-group.half-gutters > .all-auto { + padding-left: 1em; + margin-bottom: 1em; + } + + .column-group.half-horizontal-gutters { + margin-left: -1em; + } + .column-group.half-horizontal-gutters > [class*=xlarge-], .column-group.half-horizontal-gutters > [class*=all-], .column-group.half-horizontal-gutters > .all-auto { + padding-left: 1em; + } + + .column-group.half-vertical-gutters > [class*=xlarge-], .column-group.half-vertical-gutters > [class*=all-], .column-group.half-vertical-gutters > .all-auto { + margin-bottom: 1em; + } + + .column-group.quarter-gutters { + margin-left: -0.5em; + } + .column-group.quarter-gutters > [class*=xlarge-], .column-group.quarter-gutters > [class*=all-], .column-group.quarter-gutters > .all-auto { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + + .column-group.quarter-horizontal-gutters { + margin-left: -0.5em; + } + .column-group.quarter-horizontal-gutters > [class*=xlarge-], .column-group.quarter-horizontal-gutters > [class*=all-], .column-group.quarter-horizontal-gutters > .all-auto { + padding-left: 0.5em; + } + + .column-group.quarter-vertical-gutters > [class*=xlarge-], .column-group.quarter-vertical-gutters > [class*=all-], .column-group.quarter-vertical-gutters > .all-auto { + margin-bottom: 0.5em; + } + + .column-group.xlarge-gutters { + margin-left: -2em; + } + .column-group.xlarge-gutters > [class*=xlarge-], .column-group.xlarge-gutters > [class*=all-], .column-group.xlarge-gutters > .all-auto { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + + .column-group.xlarge-horizontal-gutters { + margin-left: -2em; + } + .column-group.xlarge-horizontal-gutters > [class*=xlarge-], .column-group.xlarge-horizontal-gutters > [class*=all-], .column-group.xlarge-horizontal-gutters > .all-auto { + padding-left: 2em; + } + + .column-group.xlarge-vertical-gutters > [class*=xlarge-], .column-group.xlarge-vertical-gutters > [class*=all-], .column-group.xlarge-vertical-gutters > .all-auto { + margin-bottom: 2em; + } + + .column-group.xlarge-double-gutters { + margin-left: -4em; + } + .column-group.xlarge-double-gutters > [class*=xlarge-], .column-group.xlarge-double-gutters > [class*=all-], .column-group.xlarge-double-gutters > .all-auto { + padding-left: 4em; + margin-bottom: 4em; + } + + .column-group.xlarge-double-horizontal-gutters { + margin-left: -4em; + } + .column-group.xlarge-double-horizontal-gutters > [class*=xlarge-], .column-group.xlarge-double-horizontal-gutters > [class*=all-], .column-group.xlarge-double-horizontal-gutters > .all-auto { + padding-left: 4em; + } + + .column-group.xlarge-double-vertical-gutters > [class*=xlarge-], .column-group.xlarge-double-vertical-gutters > [class*=all-], .column-group.xlarge-double-vertical-gutters > .all-auto { + margin-bottom: 4em; + } + + .column-group.xlarge-half-gutters { + margin-left: -1em; + } + .column-group.xlarge-half-gutters > [class*=xlarge-], .column-group.xlarge-half-gutters > [class*=all-], .column-group.xlarge-half-gutters > .all-auto { + padding-left: 1em; + margin-bottom: 1em; + } + + .column-group.xlarge-half-horizontal-gutters { + margin-left: -1em; + } + .column-group.xlarge-half-horizontal-gutters > [class*=xlarge-], .column-group.xlarge-half-horizontal-gutters > [class*=all-], .column-group.xlarge-half-horizontal-gutters > .all-auto { + padding-left: 1em; + } + + .column-group.xlarge-half-vertical-gutters > [class*=xlarge-], .column-group.xlarge-half-vertical-gutters > [class*=all-], .column-group.xlarge-half-vertical-gutters > .all-auto { + margin-bottom: 1em; + } + + .column-group.xlarge-quarter-gutters { + margin-left: -0.5em; + } + .column-group.xlarge-quarter-gutters > [class*=xlarge-], .column-group.xlarge-quarter-gutters > [class*=all-], .column-group.xlarge-quarter-gutters > .all-auto { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + + .column-group.xlarge-quarter-horizontal-gutters { + margin-left: -0.5em; + } + .column-group.xlarge-quarter-horizontal-gutters > [class*=xlarge-], .column-group.xlarge-quarter-horizontal-gutters > [class*=all-], .column-group.xlarge-quarter-horizontal-gutters > .all-auto { + padding-left: 0.5em; + } + + .column-group.xlarge-quarter-vertical-gutters > [class*=xlarge-], .column-group.xlarge-quarter-vertical-gutters > [class*=all-], .column-group.xlarge-quarter-vertical-gutters > .all-auto { + margin-bottom: 0.5em; + } + + .column-group.xlarge-no-gutters { + margin-left: 0; + } + .column-group.xlarge-no-gutters > [class*=xlarge-], .column-group.xlarge-no-gutters > [class*=all-], .column-group.xlarge-no-gutters > .all-auto { + padding-left: 0; + margin-bottom: 0; + } + + .xlarge-5 { + width: 5%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-10 { + width: 10%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-15 { + width: 15%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-16 { + width: 16.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-20 { + width: 20%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-25 { + width: 25%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-30 { + width: 30%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-33 { + width: 33.33333%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-35 { + width: 35%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-40 { + width: 40%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-45 { + width: 45%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-50 { + width: 50%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-55 { + width: 55%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-60 { + width: 60%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-65 { + width: 65%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-66 { + width: 66.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-70 { + width: 70%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-75 { + width: 75%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-80 { + width: 80%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-85 { + width: 85%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-90 { + width: 90%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-95 { + width: 95%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-100 { + width: 100%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .xlarge-auto { + -webkit-box-flex: 1; + -webkit-flex: 1; + -moz-box-flex: 1; + -ms-flex: 1; + flex: 1; + } + + .ink-flex, + .column-group { + display: -webkit-flex; + display: flex; + display: -ms-flexbox; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + list-style: none; + } + .ink-flex.xlarge-reverse, .ink-flex.reverse, + .column-group.xlarge-reverse, + .column-group.reverse { + -webkit-flex-direction: row-reverse; + -moz-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .ink-flex.xlarge-vertical, .ink-flex.vertical, + .column-group.xlarge-vertical, + .column-group.vertical { + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + } + .ink-flex.xlarge-vertical.xlarge-reverse, .ink-flex.vertical.reverse, + .column-group.xlarge-vertical.xlarge-reverse, + .column-group.vertical.reverse { + -webkit-flex-direction: column-reverse; + -moz-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + + .xlarge-order-1 { + order: 1; + -ms-flex-order: 1; + } + + .xlarge-order-2 { + order: 2; + -ms-flex-order: 2; + } + + .xlarge-order-3 { + order: 3; + -ms-flex-order: 3; + } + + .xlarge-order-4 { + order: 4; + -ms-flex-order: 4; + } + + .xlarge-order-5 { + order: 5; + -ms-flex-order: 5; + } + + .xlarge-order-6 { + order: 6; + -ms-flex-order: 6; + } + + .xlarge-order-7 { + order: 7; + -ms-flex-order: 7; + } + + .xlarge-order-8 { + order: 8; + -ms-flex-order: 8; + } + + .xlarge-order-9 { + order: 9; + -ms-flex-order: 9; + } + + .xlarge-order-10 { + order: 10; + -ms-flex-order: 10; + } + + .column-group .xlarge-auto { + -webkit-flex-basis: auto; + -ms-flex-basis: auto; + flex-basis: auto; + -webkit-flex-grow: 1; + -ms-flex-grow: 1; + flex-grow: 1; + } + + .push-top, + .xlarge-push-top { + -webkit-box-align: start; + -webkit-align-items: flex-start; + -moz-box-align: start; + -ms-flex-align: start; + align-items: flex-start; + -webkit-align-self: flex-start; + -ms-flex-item-align: start; + align-self: flex-start; + } + + .push-bottom, + .xlarge-push-bottom { + -webkit-box-align: end; + -webkit-align-items: flex-end; + -moz-box-align: end; + -ms-flex-align: end; + align-items: flex-end; + -webkit-align-self: flex-end; + -ms-flex-item-align: end; + align-self: flex-end; + } + + .push-middle, + .xlarge-push-middle { + -webkit-box-align: center; + -webkit-align-items: center; + -moz-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-align-self: flex-center; + -ms-flex-item-align: center; + align-self: center; + } + + .push-left, + .xlarge-push-left { + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + justify-content: flex-start; + -ms-flex-pack: start; + float: left; + } + + .push-center, + .xlarge-push-center { + float: none !important; + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + justify-content: center; + -ms-flex-pack: center; + margin-left: auto; + margin-right: auto; + } + + .push-right, + .xlarge-push-right { + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + -ms-justify-content: flex-end; + justify-content: flex-end; + -ms-flex-pack: end; + float: right; + } + + .xlarge-align-left { + text-align: left; + } + + .xlarge-align-center { + text-align: center; + } + + .xlarge-align-right { + text-align: right; + } + + .space { + margin: 2em; + } + + .xlarge-space { + margin: 2em; + } + + .padding { + padding: 2em; + } + + .xlarge-padding { + padding: 2em; + } + + .double-space { + margin: 4em; + } + + .xlarge-double-space { + margin: 4em; + } + + .double-padding { + padding: 4em; + } + + .xlarge-double-padding { + padding: 4em; + } + + .half-space { + margin: 1em; + } + + .xlarge-half-space { + margin: 1em; + } + + .half-padding { + padding: 1em; + } + + .xlarge-half-padding { + padding: 1em; + } + + .quarter-space { + margin: 0.5em; + } + + .xlarge-quarter-space { + margin: 0.5em; + } + + .quarter-padding { + padding: 0.5em; + } + + .xlarge-quarter-padding { + padding: 0.5em; + } + + .vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + + .xlarge-vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + + .vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + + .xlarge-vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + + .double-vertical-space { + margin-top: 4em; + margin-bottom: 4em; + } + + .xlarge-double-vertical-space { + margin-top: 4em; + margin-bottom: 4em; + } + + .double-vertical-padding { + padding-top: 4em; + padding-bottom: 4em; + } + + .xlarge-double-vertical-padding { + padding-top: 4em; + padding-bottom: 4em; + } + + .half-vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + + .xlarge-half-vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + + .half-vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + + .xlarge-half-vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + + .quarter-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + .xlarge-quarter-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + .quarter-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + + .xlarge-quarter-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + + .horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + + .xlarge-horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + + .horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + + .xlarge-horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + + .double-horizontal-space { + margin-left: 4em; + margin-right: 4em; + } + + .xlarge-double-horizontal-space { + margin-left: 4em; + margin-right: 4em; + } + + .double-horizontal-padding { + padding-left: 4em; + padding-right: 4em; + } + + .xlarge-double-horizontal-padding { + padding-left: 4em; + padding-right: 4em; + } + + .half-horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + + .xlarge-half-horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + + .half-horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + + .xlarge-half-horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + + .quarter-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + + .xlarge-quarter-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + + .quarter-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + + .xlarge-quarter-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + + .top-space { + margin-top: 2em; + } + + .xlarge-top-space { + margin-top: 2em; + } + + .top-padding { + padding-top: 2em; + } + + .xlarge-top-padding { + padding-top: 2em; + } + + .double-top-space { + margin-top: 4em; + } + + .xlarge-double-top-space { + margin-top: 4em; + } + + .double-top-padding { + padding-top: 4em; + } + + .xlarge-double-top-padding { + padding-top: 4em; + } + + .half-top-space { + margin-top: 1em; + } + + .xlarge-half-top-space { + margin-top: 1em; + } + + .half-top-padding { + padding-top: 1em; + } + + .xlarge-half-top-padding { + padding-top: 1em; + } + + .quarter-top-space { + margin-top: 0.5em; + } + + .xlarge-quarter-top-space { + margin-top: 0.5em; + } + + .quarter-top-padding { + padding-top: 0.5em; + } + + .xlarge-quarter-top-padding { + padding-top: 0.5em; + } + + .right-space { + margin-right: 2em; + } + + .xlarge-right-space { + margin-right: 2em; + } + + .right-padding { + padding-right: 2em; + } + + .xlarge-right-padding { + padding-right: 2em; + } + + .double-right-space { + margin-right: 4em; + } + + .xlarge-double-right-space { + margin-right: 4em; + } + + .double-right-padding { + padding-right: 4em; + } + + .xlarge-double-right-padding { + padding-right: 4em; + } + + .half-right-space { + margin-right: 1em; + } + + .xlarge-half-right-space { + margin-right: 1em; + } + + .half-right-padding { + padding-right: 1em; + } + + .xlarge-half-right-padding { + padding-right: 1em; + } + + .quarter-right-space { + margin-right: 0.5em; + } + + .xlarge-quarter-right-space { + margin-right: 0.5em; + } + + .quarter-right-padding { + padding-right: 0.5em; + } + + .xlarge-quarter-right-padding { + padding-right: 0.5em; + } + + .bottom-space { + margin-bottom: 2em; + } + + .xlarge-bottom-space { + margin-bottom: 2em; + } + + .bottom-padding { + padding-bottom: 2em; + } + + .xlarge-bottom-padding { + padding-bottom: 2em; + } + + .double-bottom-space { + margin-bottom: 4em; + } + + .xlarge-double-bottom-space { + margin-bottom: 4em; + } + + .double-bottom-padding { + padding-bottom: 4em; + } + + .xlarge-double-bottom-padding { + padding-bottom: 4em; + } + + .half-bottom-space { + margin-bottom: 1em; + } + + .xlarge-half-bottom-space { + margin-bottom: 1em; + } + + .half-bottom-padding { + padding-bottom: 1em; + } + + .xlarge-half-bottom-padding { + padding-bottom: 1em; + } + + .quarter-bottom-space { + margin-bottom: 0.5em; + } + + .xlarge-quarter-bottom-space { + margin-bottom: 0.5em; + } + + .quarter-bottom-padding { + padding-bottom: 0.5em; + } + + .xlarge-quarter-bottom-padding { + padding-bottom: 0.5em; + } + + .left-space { + margin-left: 2em; + } + + .xlarge-left-space { + margin-left: 2em; + } + + .left-padding { + padding-left: 2em; + } + + .xlarge-left-padding { + padding-left: 2em; + } + + .double-left-space { + margin-left: 4em; + } + + .xlarge-double-left-space { + margin-left: 4em; + } + + .double-left-padding { + padding-left: 4em; + } + + .xlarge-double-left-padding { + padding-left: 4em; + } + + .half-left-space { + margin-left: 1em; + } + + .xlarge-half-left-space { + margin-left: 1em; + } + + .half-left-padding { + padding-left: 1em; + } + + .xlarge-half-left-padding { + padding-left: 1em; + } + + .quarter-left-space { + margin-left: 0.5em; + } + + .xlarge-quarter-left-space { + margin-left: 0.5em; + } + + .quarter-left-padding { + padding-left: 0.5em; + } + + .xlarge-quarter-left-padding { + padding-left: 0.5em; + } + + .hide-xlarge { + display: none !important; + } + + .show-xlarge { + display: inherit !important; + } + + table.show-xlarge { + display: table; + } + + thead.show-xlarge { + display: table-header-group; + } + + tbody.show-xlarge { + display: table-row-group; + } + + tfoot.show-xlarge { + display: table-footer-group; + } + + tr.show-xlarge { + display: table-row; + } + + th.show-xlarge, + td.show-xlarge { + display: table-cell; + } +} +@media screen and (min-width: 961px) and (max-width: 1260px) { + .ink-grid { + padding: 0 1.75em; + } + + .column-group.gutters { + margin-left: -1.75em; + } + .column-group.gutters > [class*=large-], .column-group.gutters > [class*=all-], .column-group.gutters > .all-auto { + padding-left: 1.75em; + margin-bottom: 1.75em; + } + + .column-group.horizontal-gutters { + margin-left: -1.75em; + } + .column-group.horizontal-gutters > [class*=large-], .column-group.horizontal-gutters > [class*=all-], .column-group.horizontal-gutters > .all-auto { + padding-left: 1.75em; + } + + .column-group.vertical-gutters > [class*=large-], .column-group.vertical-gutters > [class*=all-], .column-group.vertical-gutters > .all-auto { + margin-bottom: 1.75em; + } + + .column-group.double-gutters { + margin-left: -3.5em; + } + .column-group.double-gutters > [class*=large-], .column-group.double-gutters > [class*=all-], .column-group.double-gutters > .all-auto { + padding-left: 3.5em; + margin-bottom: 3.5em; + } + + .column-group.double-horizontal-gutters { + margin-left: -3.5em; + } + .column-group.double-horizontal-gutters > [class*=large-], .column-group.double-horizontal-gutters > [class*=all-], .column-group.double-horizontal-gutters > .all-auto { + padding-left: 3.5em; + } + + .column-group.double-vertical-gutters > [class*=large-], .column-group.double-vertical-gutters > [class*=all-], .column-group.double-vertical-gutters > .all-auto { + margin-bottom: 3.5em; + } + + .column-group.half-gutters { + margin-left: -0.875em; + } + .column-group.half-gutters > [class*=large-], .column-group.half-gutters > [class*=all-], .column-group.half-gutters > .all-auto { + padding-left: 0.875em; + margin-bottom: 0.875em; + } + + .column-group.half-horizontal-gutters { + margin-left: -0.875em; + } + .column-group.half-horizontal-gutters > [class*=large-], .column-group.half-horizontal-gutters > [class*=all-], .column-group.half-horizontal-gutters > .all-auto { + padding-left: 0.875em; + } + + .column-group.half-vertical-gutters > [class*=large-], .column-group.half-vertical-gutters > [class*=all-], .column-group.half-vertical-gutters > .all-auto { + margin-bottom: 0.875em; + } + + .column-group.quarter-gutters { + margin-left: -0.4375em; + } + .column-group.quarter-gutters > [class*=large-], .column-group.quarter-gutters > [class*=all-], .column-group.quarter-gutters > .all-auto { + padding-left: 0.4375em; + margin-bottom: 0.4375em; + } + + .column-group.quarter-horizontal-gutters { + margin-left: -0.4375em; + } + .column-group.quarter-horizontal-gutters > [class*=large-], .column-group.quarter-horizontal-gutters > [class*=all-], .column-group.quarter-horizontal-gutters > .all-auto { + padding-left: 0.4375em; + } + + .column-group.quarter-vertical-gutters > [class*=large-], .column-group.quarter-vertical-gutters > [class*=all-], .column-group.quarter-vertical-gutters > .all-auto { + margin-bottom: 0.4375em; + } + + .column-group.large-gutters { + margin-left: -1.75em; + } + .column-group.large-gutters > [class*=large-], .column-group.large-gutters > [class*=all-], .column-group.large-gutters > .all-auto { + padding-left: 0.4375em; + margin-bottom: 0.4375em; + } + + .column-group.large-horizontal-gutters { + margin-left: -1.75em; + } + .column-group.large-horizontal-gutters > [class*=large-], .column-group.large-horizontal-gutters > [class*=all-], .column-group.large-horizontal-gutters > .all-auto { + padding-left: 1.75em; + } + + .column-group.large-vertical-gutters > [class*=large-], .column-group.large-vertical-gutters > [class*=all-], .column-group.large-vertical-gutters > .all-auto { + margin-bottom: 1.75em; + } + + .column-group.large-double-gutters { + margin-left: -3.5em; + } + .column-group.large-double-gutters > [class*=large-], .column-group.large-double-gutters > [class*=all-], .column-group.large-double-gutters > .all-auto { + padding-left: 3.5em; + margin-bottom: 3.5em; + } + + .column-group.large-double-horizontal-gutters { + margin-left: -3.5em; + } + .column-group.large-double-horizontal-gutters > [class*=large-], .column-group.large-double-horizontal-gutters > [class*=all-], .column-group.large-double-horizontal-gutters > .all-auto { + padding-left: 3.5em; + } + + .column-group.large-double-vertical-gutters > [class*=large-], .column-group.large-double-vertical-gutters > [class*=all-], .column-group.large-double-vertical-gutters > .all-auto { + margin-bottom: 3.5em; + } + + .column-group.large-half-gutters { + margin-left: -0.875em; + } + .column-group.large-half-gutters > [class*=large-], .column-group.large-half-gutters > [class*=all-], .column-group.large-half-gutters > .all-auto { + padding-left: 0.875em; + margin-bottom: 0.875em; + } + + .column-group.large-half-horizontal-gutters { + margin-left: -0.875em; + } + .column-group.large-half-horizontal-gutters > [class*=large-], .column-group.large-half-horizontal-gutters > [class*=all-], .column-group.large-half-horizontal-gutters > .all-auto { + padding-left: 0.875em; + } + + .column-group.large-half-vertical-gutters > [class*=large-], .column-group.large-half-vertical-gutters > [class*=all-], .column-group.large-half-vertical-gutters > .all-auto { + margin-bottom: 0.875em; + } + + .column-group.large-quarter-gutters { + margin-left: -0.4375em; + } + .column-group.large-quarter-gutters > [class*=large-], .column-group.large-quarter-gutters > [class*=all-], .column-group.large-quarter-gutters > .all-auto { + padding-left: 0.4375em; + margin-bottom: 0.4375em; + } + + .column-group.large-quarter-horizontal-gutters { + margin-left: -0.4375em; + } + .column-group.large-quarter-horizontal-gutters > [class*=large-], .column-group.large-quarter-horizontal-gutters > [class*=all-], .column-group.large-quarter-horizontal-gutters > .all-auto { + padding-left: 0.4375em; + } + + .column-group.large-quarter-vertical-gutters > [class*=large-], .column-group.large-quarter-vertical-gutters > [class*=all-], .column-group.large-quarter-vertical-gutters > .all-auto { + margin-bottom: 0.4375em; + } + + .column-group.large-no-gutters { + margin-left: 0; + } + .column-group.large-no-gutters > [class*=large-], .column-group.large-no-gutters > [class*=all-], .column-group.large-no-gutters > .all-auto { + padding-left: 0; + margin-bottom: 0; + } + + .large-5 { + width: 5%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-10 { + width: 10%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-15 { + width: 15%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-16 { + width: 16.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-20 { + width: 20%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-25 { + width: 25%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-30 { + width: 30%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-33 { + width: 33.33333%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-35 { + width: 35%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-40 { + width: 40%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-45 { + width: 45%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-50 { + width: 50%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-55 { + width: 55%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-60 { + width: 60%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-65 { + width: 65%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-66 { + width: 66.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-70 { + width: 70%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-75 { + width: 75%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-80 { + width: 80%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-85 { + width: 85%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-90 { + width: 90%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-95 { + width: 95%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-100 { + width: 100%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .large-auto { + -webkit-box-flex: 1; + -webkit-flex: 1; + -moz-box-flex: 1; + -ms-flex: 1; + flex: 1; + } + + .ink-flex, + .column-group { + display: -webkit-flex; + display: flex; + display: -ms-flexbox; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + list-style: none; + } + .ink-flex.large-reverse, .ink-flex.reverse, + .column-group.large-reverse, + .column-group.reverse { + -webkit-flex-direction: row-reverse; + -moz-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .ink-flex.large-vertical, .ink-flex.vertical, + .column-group.large-vertical, + .column-group.vertical { + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + } + .ink-flex.large-vertical.large-reverse, .ink-flex.vertical.reverse, + .column-group.large-vertical.large-reverse, + .column-group.vertical.reverse { + -webkit-flex-direction: column-reverse; + -moz-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + + .large-order-1 { + order: 1; + -ms-flex-order: 1; + } + + .large-order-2 { + order: 2; + -ms-flex-order: 2; + } + + .large-order-3 { + order: 3; + -ms-flex-order: 3; + } + + .large-order-4 { + order: 4; + -ms-flex-order: 4; + } + + .large-order-5 { + order: 5; + -ms-flex-order: 5; + } + + .large-order-6 { + order: 6; + -ms-flex-order: 6; + } + + .large-order-7 { + order: 7; + -ms-flex-order: 7; + } + + .large-order-8 { + order: 8; + -ms-flex-order: 8; + } + + .large-order-9 { + order: 9; + -ms-flex-order: 9; + } + + .large-order-10 { + order: 10; + -ms-flex-order: 10; + } + + .column-group .large-auto { + -webkit-flex-basis: auto; + -ms-flex-basis: auto; + flex-basis: auto; + -webkit-flex-grow: 1; + -ms-flex-grow: 1; + flex-grow: 1; + } + + .push-top, + .large-push-top { + -webkit-box-align: start; + -webkit-align-items: flex-start; + -moz-box-align: start; + -ms-flex-align: start; + align-items: flex-start; + -webkit-align-self: flex-start; + -ms-flex-item-align: start; + align-self: flex-start; + } + + .push-bottom, + .large-push-bottom { + -webkit-box-align: end; + -webkit-align-items: flex-end; + -moz-box-align: end; + -ms-flex-align: end; + align-items: flex-end; + -webkit-align-self: flex-end; + -ms-flex-item-align: end; + align-self: flex-end; + } + + .push-middle, + .large-push-middle { + -webkit-box-align: center; + -webkit-align-items: center; + -moz-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-align-self: flex-center; + -ms-flex-item-align: center; + align-self: center; + } + + .push-left, + .large-push-left { + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + justify-content: flex-start; + -ms-flex-pack: start; + float: left; + } + + .push-center, + .large-push-center { + float: none !important; + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + justify-content: center; + -ms-flex-pack: center; + margin-left: auto; + margin-right: auto; + } + + .push-right, + .large-push-right { + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + -ms-justify-content: flex-end; + justify-content: flex-end; + -ms-flex-pack: end; + float: right; + } + + .large-align-left { + text-align: left; + } + + .large-align-center { + text-align: center; + } + + .large-align-right { + text-align: right; + } + + .space { + margin: 1.75em; + } + + .large-space { + margin: 1.75em; + } + + .padding { + padding: 1.75em; + } + + .large-padding { + padding: 1.75em; + } + + .double-space { + margin: 3.5em; + } + + .large-double-space { + margin: 3.5em; + } + + .double-padding { + padding: 3.5em; + } + + .large-double-padding { + padding: 3.5em; + } + + .half-space { + margin: 0.875em; + } + + .large-half-space { + margin: 0.875em; + } + + .half-padding { + padding: 0.875em; + } + + .large-half-padding { + padding: 0.875em; + } + + .quarter-space { + margin: 0.4375em; + } + + .large-quarter-space { + margin: 0.4375em; + } + + .quarter-padding { + padding: 0.4375em; + } + + .large-quarter-padding { + padding: 0.4375em; + } + + .vertical-space { + margin-top: 1.75em; + margin-bottom: 1.75em; + } + + .large-vertical-space { + margin-top: 1.75em; + margin-bottom: 1.75em; + } + + .vertical-padding { + padding-top: 1.75em; + padding-bottom: 1.75em; + } + + .large-vertical-padding { + padding-top: 1.75em; + padding-bottom: 1.75em; + } + + .double-vertical-space { + margin-top: 3.5em; + margin-bottom: 3.5em; + } + + .large-double-vertical-space { + margin-top: 3.5em; + margin-bottom: 3.5em; + } + + .double-vertical-padding { + padding-top: 3.5em; + padding-bottom: 3.5em; + } + + .large-double-vertical-padding { + padding-top: 3.5em; + padding-bottom: 3.5em; + } + + .half-vertical-space { + margin-top: 0.875em; + margin-bottom: 0.875em; + } + + .large-half-vertical-space { + margin-top: 0.875em; + margin-bottom: 0.875em; + } + + .half-vertical-padding { + padding-top: 0.875em; + padding-bottom: 0.875em; + } + + .large-half-vertical-padding { + padding-top: 0.875em; + padding-bottom: 0.875em; + } + + .quarter-vertical-space { + margin-top: 0.4375em; + margin-bottom: 0.4375em; + } + + .large-quarter-vertical-space { + margin-top: 0.4375em; + margin-bottom: 0.4375em; + } + + .quarter-vertical-padding { + padding-top: 0.4375em; + padding-bottom: 0.4375em; + } + + .large-quarter-vertical-padding { + padding-top: 0.4375em; + padding-bottom: 0.4375em; + } + + .horizontal-space { + margin-left: 1.75em; + margin-right: 1.75em; + } + + .large-horizontal-space { + margin-left: 1.75em; + margin-right: 1.75em; + } + + .horizontal-padding { + padding-left: 1.75em; + padding-right: 1.75em; + } + + .large-horizontal-padding { + padding-left: 1.75em; + padding-right: 1.75em; + } + + .double-horizontal-space { + margin-left: 3.5em; + margin-right: 3.5em; + } + + .large-double-horizontal-space { + margin-left: 3.5em; + margin-right: 3.5em; + } + + .double-horizontal-padding { + padding-left: 3.5em; + padding-right: 3.5em; + } + + .large-double-horizontal-padding { + padding-left: 3.5em; + padding-right: 3.5em; + } + + .half-horizontal-space { + margin-left: 0.875em; + margin-right: 0.875em; + } + + .large-half-horizontal-space { + margin-left: 0.875em; + margin-right: 0.875em; + } + + .half-horizontal-padding { + padding-left: 0.875em; + padding-right: 0.875em; + } + + .large-half-horizontal-padding { + padding-left: 0.875em; + padding-right: 0.875em; + } + + .quarter-horizontal-space { + margin-left: 0.4375em; + margin-right: 0.4375em; + } + + .large-quarter-horizontal-space { + margin-left: 0.4375em; + margin-right: 0.4375em; + } + + .quarter-horizontal-padding { + padding-left: 0.4375em; + padding-right: 0.4375em; + } + + .large-quarter-horizontal-padding { + padding-left: 0.4375em; + padding-right: 0.4375em; + } + + .top-space { + margin-top: 1.75em; + } + + .large-top-space { + margin-top: 1.75em; + } + + .top-padding { + padding-top: 1.75em; + } + + .large-top-padding { + padding-top: 1.75em; + } + + .double-top-space { + margin-top: 3.5em; + } + + .large-double-top-space { + margin-top: 3.5em; + } + + .double-top-padding { + padding-top: 3.5em; + } + + .large-double-top-padding { + padding-top: 3.5em; + } + + .half-top-space { + margin-top: 0.875em; + } + + .large-half-top-space { + margin-top: 0.875em; + } + + .half-top-padding { + padding-top: 0.875em; + } + + .large-half-top-padding { + padding-top: 0.875em; + } + + .quarter-top-space { + margin-top: 0.4375em; + } + + .large-quarter-top-space { + margin-top: 0.4375em; + } + + .quarter-top-padding { + padding-top: 0.4375em; + } + + .large-quarter-top-padding { + padding-top: 0.4375em; + } + + .right-space { + margin-right: 1.75em; + } + + .large-right-space { + margin-right: 1.75em; + } + + .right-padding { + padding-right: 1.75em; + } + + .large-right-padding { + padding-right: 1.75em; + } + + .double-right-space { + margin-right: 3.5em; + } + + .large-double-right-space { + margin-right: 3.5em; + } + + .double-right-padding { + padding-right: 3.5em; + } + + .large-double-right-padding { + padding-right: 3.5em; + } + + .half-right-space { + margin-right: 0.875em; + } + + .large-half-right-space { + margin-right: 0.875em; + } + + .half-right-padding { + padding-right: 0.875em; + } + + .large-half-right-padding { + padding-right: 0.875em; + } + + .quarter-right-space { + margin-right: 0.4375em; + } + + .large-quarter-right-space { + margin-right: 0.4375em; + } + + .quarter-right-padding { + padding-right: 0.4375em; + } + + .large-quarter-right-padding { + padding-right: 0.4375em; + } + + .bottom-space { + margin-bottom: 1.75em; + } + + .large-bottom-space { + margin-bottom: 1.75em; + } + + .bottom-padding { + padding-bottom: 1.75em; + } + + .large-bottom-padding { + padding-bottom: 1.75em; + } + + .double-bottom-space { + margin-bottom: 3.5em; + } + + .large-double-bottom-space { + margin-bottom: 3.5em; + } + + .double-bottom-padding { + padding-bottom: 3.5em; + } + + .large-double-bottom-padding { + padding-bottom: 3.5em; + } + + .half-bottom-space { + margin-bottom: 0.875em; + } + + .large-half-bottom-space { + margin-bottom: 0.875em; + } + + .half-bottom-padding { + padding-bottom: 0.875em; + } + + .large-half-bottom-padding { + padding-bottom: 0.875em; + } + + .quarter-bottom-space { + margin-bottom: 0.4375em; + } + + .large-quarter-bottom-space { + margin-bottom: 0.4375em; + } + + .quarter-bottom-padding { + padding-bottom: 0.4375em; + } + + .large-quarter-bottom-padding { + padding-bottom: 0.4375em; + } + + .left-space { + margin-left: 1.75em; + } + + .large-left-space { + margin-left: 1.75em; + } + + .left-padding { + padding-left: 1.75em; + } + + .large-left-padding { + padding-left: 1.75em; + } + + .double-left-space { + margin-left: 3.5em; + } + + .large-double-left-space { + margin-left: 3.5em; + } + + .double-left-padding { + padding-left: 3.5em; + } + + .large-double-left-padding { + padding-left: 3.5em; + } + + .half-left-space { + margin-left: 0.875em; + } + + .large-half-left-space { + margin-left: 0.875em; + } + + .half-left-padding { + padding-left: 0.875em; + } + + .large-half-left-padding { + padding-left: 0.875em; + } + + .quarter-left-space { + margin-left: 0.4375em; + } + + .large-quarter-left-space { + margin-left: 0.4375em; + } + + .quarter-left-padding { + padding-left: 0.4375em; + } + + .large-quarter-left-padding { + padding-left: 0.4375em; + } + + .hide-large { + display: none !important; + } + + .show-large { + display: inherit !important; + } + + table.show-large { + display: table; + } + + thead.show-large { + display: table-header-group; + } + + tbody.show-large { + display: table-row-group; + } + + tfoot.show-large { + display: table-footer-group; + } + + tr.show-large { + display: table-row; + } + + th.show-large, + td.show-large { + display: table-cell; + } +} +@media screen and (min-width: 641px) and (max-width: 960px) { + .ink-grid { + padding: 0 1.5em; + } + + .column-group.gutters { + margin-left: -1.5em; + } + .column-group.gutters > [class*=medium-], .column-group.gutters > [class*=all-], .column-group.gutters > .all-auto { + padding-left: 1.5em; + margin-bottom: 1.5em; + } + + .column-group.horizontal-gutters { + margin-left: -1.5em; + } + .column-group.horizontal-gutters > [class*=medium-], .column-group.horizontal-gutters > [class*=all-], .column-group.horizontal-gutters > .all-auto { + padding-left: 1.5em; + } + + .column-group.vertical-gutters > [class*=medium-], .column-group.vertical-gutters > [class*=all-], .column-group.vertical-gutters > .all-auto { + margin-bottom: 1.5em; + } + + .column-group.double-gutters { + margin-left: -3em; + } + .column-group.double-gutters > [class*=medium-], .column-group.double-gutters > [class*=all-], .column-group.double-gutters > .all-auto { + padding-left: 3em; + margin-bottom: 3em; + } + + .column-group.double-horizontal-gutters { + margin-left: -3em; + } + .column-group.double-horizontal-gutters > [class*=medium-], .column-group.double-horizontal-gutters > [class*=all-], .column-group.double-horizontal-gutters > .all-auto { + padding-left: 3em; + } + + .column-group.double-vertical-gutters > [class*=medium-], .column-group.double-vertical-gutters > [class*=all-], .column-group.double-vertical-gutters > .all-auto { + margin-bottom: 3em; + } + + .column-group.half-gutters { + margin-left: -0.75em; + } + .column-group.half-gutters > [class*=medium-], .column-group.half-gutters > [class*=all-], .column-group.half-gutters > .all-auto { + padding-left: 0.75em; + margin-bottom: 0.75em; + } + + .column-group.half-horizontal-gutters { + margin-left: -0.75em; + } + .column-group.half-horizontal-gutters > [class*=medium-], .column-group.half-horizontal-gutters > [class*=all-], .column-group.half-horizontal-gutters > .all-auto { + padding-left: 0.75em; + } + + .column-group.half-vertical-gutters > [class*=medium-], .column-group.half-vertical-gutters > [class*=all-], .column-group.half-vertical-gutters > .all-auto { + margin-bottom: 0.75em; + } + + .column-group.quarter-gutters { + margin-left: -0.375em; + } + .column-group.quarter-gutters > [class*=medium-], .column-group.quarter-gutters > [class*=all-], .column-group.quarter-gutters > .all-auto { + padding-left: 0.375em; + margin-bottom: 0.375em; + } + + .column-group.quarter-horizontal-gutters { + margin-left: -0.375em; + } + .column-group.quarter-horizontal-gutters > [class*=medium-], .column-group.quarter-horizontal-gutters > [class*=all-], .column-group.quarter-horizontal-gutters > .all-auto { + padding-left: 0.375em; + } + + .column-group.quarter-vertical-gutters > [class*=medium-], .column-group.quarter-vertical-gutters > [class*=all-], .column-group.quarter-vertical-gutters > .all-auto { + margin-bottom: 0.375em; + } + + .column-group.medium-gutters { + margin-left: -1.5em; + } + .column-group.medium-gutters > [class*=medium-], .column-group.medium-gutters > [class*=all-], .column-group.medium-gutters > .all-auto { + padding-left: 0.375em; + margin-bottom: 0.375em; + } + + .column-group.medium-horizontal-gutters { + margin-left: -1.5em; + } + .column-group.medium-horizontal-gutters > [class*=medium-], .column-group.medium-horizontal-gutters > [class*=all-], .column-group.medium-horizontal-gutters > .all-auto { + padding-left: 1.5em; + } + + .column-group.medium-vertical-gutters > [class*=medium-], .column-group.medium-vertical-gutters > [class*=all-], .column-group.medium-vertical-gutters > .all-auto { + margin-bottom: 1.5em; + } + + .column-group.medium-double-gutters { + margin-left: -3em; + } + .column-group.medium-double-gutters > [class*=medium-], .column-group.medium-double-gutters > [class*=all-], .column-group.medium-double-gutters > .all-auto { + padding-left: 3em; + margin-bottom: 3em; + } + + .column-group.medium-double-horizontal-gutters { + margin-left: -3em; + } + .column-group.medium-double-horizontal-gutters > [class*=medium-], .column-group.medium-double-horizontal-gutters > [class*=all-], .column-group.medium-double-horizontal-gutters > .all-auto { + padding-left: 3em; + } + + .column-group.medium-double-vertical-gutters > [class*=medium-], .column-group.medium-double-vertical-gutters > [class*=all-], .column-group.medium-double-vertical-gutters > .all-auto { + margin-bottom: 3em; + } + + .column-group.medium-half-gutters { + margin-left: -0.75em; + } + .column-group.medium-half-gutters > [class*=medium-], .column-group.medium-half-gutters > [class*=all-], .column-group.medium-half-gutters > .all-auto { + padding-left: 0.75em; + margin-bottom: 0.75em; + } + + .column-group.medium-half-horizontal-gutters { + margin-left: -0.75em; + } + .column-group.medium-half-horizontal-gutters > [class*=medium-], .column-group.medium-half-horizontal-gutters > [class*=all-], .column-group.medium-half-horizontal-gutters > .all-auto { + padding-left: 0.75em; + } + + .column-group.medium-half-vertical-gutters > [class*=medium-], .column-group.medium-half-vertical-gutters > [class*=all-], .column-group.medium-half-vertical-gutters > .all-auto { + margin-bottom: 0.75em; + } + + .column-group.medium-quarter-gutters { + margin-left: -0.375em; + } + .column-group.medium-quarter-gutters > [class*=medium-], .column-group.medium-quarter-gutters > [class*=all-], .column-group.medium-quarter-gutters > .all-auto { + padding-left: 0.375em; + margin-bottom: 0.375em; + } + + .column-group.medium-quarter-horizontal-gutters { + margin-left: -0.375em; + } + .column-group.medium-quarter-horizontal-gutters > [class*=medium-], .column-group.medium-quarter-horizontal-gutters > [class*=all-], .column-group.medium-quarter-horizontal-gutters > .all-auto { + padding-left: 0.375em; + } + + .column-group.medium-quarter-vertical-gutters > [class*=medium-], .column-group.medium-quarter-vertical-gutters > [class*=all-], .column-group.medium-quarter-vertical-gutters > .all-auto { + margin-bottom: 0.375em; + } + + .column-group.medium-no-gutters { + margin-left: 0; + } + .column-group.medium-no-gutters > [class*=medium-], .column-group.medium-no-gutters > [class*=all-], .column-group.medium-no-gutters > .all-auto { + padding-left: 0; + margin-bottom: 0; + } + + .medium-5 { + width: 5%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-10 { + width: 10%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-15 { + width: 15%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-16 { + width: 16.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-20 { + width: 20%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-25 { + width: 25%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-30 { + width: 30%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-33 { + width: 33.33333%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-35 { + width: 35%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-40 { + width: 40%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-45 { + width: 45%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-50 { + width: 50%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-55 { + width: 55%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-60 { + width: 60%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-65 { + width: 65%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-66 { + width: 66.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-70 { + width: 70%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-75 { + width: 75%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-80 { + width: 80%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-85 { + width: 85%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-90 { + width: 90%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-95 { + width: 95%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-100 { + width: 100%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .medium-auto { + -webkit-box-flex: 1; + -webkit-flex: 1; + -moz-box-flex: 1; + -ms-flex: 1; + flex: 1; + } + + .ink-flex, + .column-group { + display: -webkit-flex; + display: flex; + display: -ms-flexbox; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + list-style: none; + } + .ink-flex.medium-reverse, .ink-flex.reverse, + .column-group.medium-reverse, + .column-group.reverse { + -webkit-flex-direction: row-reverse; + -moz-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .ink-flex.medium-vertical, .ink-flex.vertical, + .column-group.medium-vertical, + .column-group.vertical { + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + } + .ink-flex.medium-vertical.medium-reverse, .ink-flex.vertical.reverse, + .column-group.medium-vertical.medium-reverse, + .column-group.vertical.reverse { + -webkit-flex-direction: column-reverse; + -moz-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + + .medium-order-1 { + order: 1; + -ms-flex-order: 1; + } + + .medium-order-2 { + order: 2; + -ms-flex-order: 2; + } + + .medium-order-3 { + order: 3; + -ms-flex-order: 3; + } + + .medium-order-4 { + order: 4; + -ms-flex-order: 4; + } + + .medium-order-5 { + order: 5; + -ms-flex-order: 5; + } + + .medium-order-6 { + order: 6; + -ms-flex-order: 6; + } + + .medium-order-7 { + order: 7; + -ms-flex-order: 7; + } + + .medium-order-8 { + order: 8; + -ms-flex-order: 8; + } + + .medium-order-9 { + order: 9; + -ms-flex-order: 9; + } + + .medium-order-10 { + order: 10; + -ms-flex-order: 10; + } + + .column-group .medium-auto { + -webkit-flex-basis: auto; + -ms-flex-basis: auto; + flex-basis: auto; + -webkit-flex-grow: 1; + -ms-flex-grow: 1; + flex-grow: 1; + } + + .push-top, + .medium-push-top { + -webkit-box-align: start; + -webkit-align-items: flex-start; + -moz-box-align: start; + -ms-flex-align: start; + align-items: flex-start; + -webkit-align-self: flex-start; + -ms-flex-item-align: start; + align-self: flex-start; + } + + .push-bottom, + .medium-push-bottom { + -webkit-box-align: end; + -webkit-align-items: flex-end; + -moz-box-align: end; + -ms-flex-align: end; + align-items: flex-end; + -webkit-align-self: flex-end; + -ms-flex-item-align: end; + align-self: flex-end; + } + + .push-middle, + .medium-push-middle { + -webkit-box-align: center; + -webkit-align-items: center; + -moz-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-align-self: flex-center; + -ms-flex-item-align: center; + align-self: center; + } + + .push-left, + .medium-push-left { + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + justify-content: flex-start; + -ms-flex-pack: start; + float: left; + } + + .push-center, + .medium-push-center { + float: none !important; + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + justify-content: center; + -ms-flex-pack: center; + margin-left: auto; + margin-right: auto; + } + + .push-right, + .medium-push-right { + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + -ms-justify-content: flex-end; + justify-content: flex-end; + -ms-flex-pack: end; + float: right; + } + + .medium-align-left { + text-align: left; + } + + .medium-align-center { + text-align: center; + } + + .medium-align-right { + text-align: right; + } + + .space { + margin: 1.5em; + } + + .medium-space { + margin: 1.5em; + } + + .padding { + padding: 1.5em; + } + + .medium-padding { + padding: 1.5em; + } + + .double-space { + margin: 3em; + } + + .medium-double-space { + margin: 3em; + } + + .double-padding { + padding: 3em; + } + + .medium-double-padding { + padding: 3em; + } + + .half-space { + margin: 0.75em; + } + + .medium-half-space { + margin: 0.75em; + } + + .half-padding { + padding: 0.75em; + } + + .medium-half-padding { + padding: 0.75em; + } + + .quarter-space { + margin: 0.375em; + } + + .medium-quarter-space { + margin: 0.375em; + } + + .quarter-padding { + padding: 0.375em; + } + + .medium-quarter-padding { + padding: 0.375em; + } + + .vertical-space { + margin-top: 1.5em; + margin-bottom: 1.5em; + } + + .medium-vertical-space { + margin-top: 1.5em; + margin-bottom: 1.5em; + } + + .vertical-padding { + padding-top: 1.5em; + padding-bottom: 1.5em; + } + + .medium-vertical-padding { + padding-top: 1.5em; + padding-bottom: 1.5em; + } + + .double-vertical-space { + margin-top: 3em; + margin-bottom: 3em; + } + + .medium-double-vertical-space { + margin-top: 3em; + margin-bottom: 3em; + } + + .double-vertical-padding { + padding-top: 3em; + padding-bottom: 3em; + } + + .medium-double-vertical-padding { + padding-top: 3em; + padding-bottom: 3em; + } + + .half-vertical-space { + margin-top: 0.75em; + margin-bottom: 0.75em; + } + + .medium-half-vertical-space { + margin-top: 0.75em; + margin-bottom: 0.75em; + } + + .half-vertical-padding { + padding-top: 0.75em; + padding-bottom: 0.75em; + } + + .medium-half-vertical-padding { + padding-top: 0.75em; + padding-bottom: 0.75em; + } + + .quarter-vertical-space { + margin-top: 0.375em; + margin-bottom: 0.375em; + } + + .medium-quarter-vertical-space { + margin-top: 0.375em; + margin-bottom: 0.375em; + } + + .quarter-vertical-padding { + padding-top: 0.375em; + padding-bottom: 0.375em; + } + + .medium-quarter-vertical-padding { + padding-top: 0.375em; + padding-bottom: 0.375em; + } + + .horizontal-space { + margin-left: 1.5em; + margin-right: 1.5em; + } + + .medium-horizontal-space { + margin-left: 1.5em; + margin-right: 1.5em; + } + + .horizontal-padding { + padding-left: 1.5em; + padding-right: 1.5em; + } + + .medium-horizontal-padding { + padding-left: 1.5em; + padding-right: 1.5em; + } + + .double-horizontal-space { + margin-left: 3em; + margin-right: 3em; + } + + .medium-double-horizontal-space { + margin-left: 3em; + margin-right: 3em; + } + + .double-horizontal-padding { + padding-left: 3em; + padding-right: 3em; + } + + .medium-double-horizontal-padding { + padding-left: 3em; + padding-right: 3em; + } + + .half-horizontal-space { + margin-left: 0.75em; + margin-right: 0.75em; + } + + .medium-half-horizontal-space { + margin-left: 0.75em; + margin-right: 0.75em; + } + + .half-horizontal-padding { + padding-left: 0.75em; + padding-right: 0.75em; + } + + .medium-half-horizontal-padding { + padding-left: 0.75em; + padding-right: 0.75em; + } + + .quarter-horizontal-space { + margin-left: 0.375em; + margin-right: 0.375em; + } + + .medium-quarter-horizontal-space { + margin-left: 0.375em; + margin-right: 0.375em; + } + + .quarter-horizontal-padding { + padding-left: 0.375em; + padding-right: 0.375em; + } + + .medium-quarter-horizontal-padding { + padding-left: 0.375em; + padding-right: 0.375em; + } + + .top-space { + margin-top: 1.5em; + } + + .medium-top-space { + margin-top: 1.5em; + } + + .top-padding { + padding-top: 1.5em; + } + + .medium-top-padding { + padding-top: 1.5em; + } + + .double-top-space { + margin-top: 3em; + } + + .medium-double-top-space { + margin-top: 3em; + } + + .double-top-padding { + padding-top: 3em; + } + + .medium-double-top-padding { + padding-top: 3em; + } + + .half-top-space { + margin-top: 0.75em; + } + + .medium-half-top-space { + margin-top: 0.75em; + } + + .half-top-padding { + padding-top: 0.75em; + } + + .medium-half-top-padding { + padding-top: 0.75em; + } + + .quarter-top-space { + margin-top: 0.375em; + } + + .medium-quarter-top-space { + margin-top: 0.375em; + } + + .quarter-top-padding { + padding-top: 0.375em; + } + + .medium-quarter-top-padding { + padding-top: 0.375em; + } + + .right-space { + margin-right: 1.5em; + } + + .medium-right-space { + margin-right: 1.5em; + } + + .right-padding { + padding-right: 1.5em; + } + + .medium-right-padding { + padding-right: 1.5em; + } + + .double-right-space { + margin-right: 3em; + } + + .medium-double-right-space { + margin-right: 3em; + } + + .double-right-padding { + padding-right: 3em; + } + + .medium-double-right-padding { + padding-right: 3em; + } + + .half-right-space { + margin-right: 0.75em; + } + + .medium-half-right-space { + margin-right: 0.75em; + } + + .half-right-padding { + padding-right: 0.75em; + } + + .medium-half-right-padding { + padding-right: 0.75em; + } + + .quarter-right-space { + margin-right: 0.375em; + } + + .medium-quarter-right-space { + margin-right: 0.375em; + } + + .quarter-right-padding { + padding-right: 0.375em; + } + + .medium-quarter-right-padding { + padding-right: 0.375em; + } + + .bottom-space { + margin-bottom: 1.5em; + } + + .medium-bottom-space { + margin-bottom: 1.5em; + } + + .bottom-padding { + padding-bottom: 1.5em; + } + + .medium-bottom-padding { + padding-bottom: 1.5em; + } + + .double-bottom-space { + margin-bottom: 3em; + } + + .medium-double-bottom-space { + margin-bottom: 3em; + } + + .double-bottom-padding { + padding-bottom: 3em; + } + + .medium-double-bottom-padding { + padding-bottom: 3em; + } + + .half-bottom-space { + margin-bottom: 0.75em; + } + + .medium-half-bottom-space { + margin-bottom: 0.75em; + } + + .half-bottom-padding { + padding-bottom: 0.75em; + } + + .medium-half-bottom-padding { + padding-bottom: 0.75em; + } + + .quarter-bottom-space { + margin-bottom: 0.375em; + } + + .medium-quarter-bottom-space { + margin-bottom: 0.375em; + } + + .quarter-bottom-padding { + padding-bottom: 0.375em; + } + + .medium-quarter-bottom-padding { + padding-bottom: 0.375em; + } + + .left-space { + margin-left: 1.5em; + } + + .medium-left-space { + margin-left: 1.5em; + } + + .left-padding { + padding-left: 1.5em; + } + + .medium-left-padding { + padding-left: 1.5em; + } + + .double-left-space { + margin-left: 3em; + } + + .medium-double-left-space { + margin-left: 3em; + } + + .double-left-padding { + padding-left: 3em; + } + + .medium-double-left-padding { + padding-left: 3em; + } + + .half-left-space { + margin-left: 0.75em; + } + + .medium-half-left-space { + margin-left: 0.75em; + } + + .half-left-padding { + padding-left: 0.75em; + } + + .medium-half-left-padding { + padding-left: 0.75em; + } + + .quarter-left-space { + margin-left: 0.375em; + } + + .medium-quarter-left-space { + margin-left: 0.375em; + } + + .quarter-left-padding { + padding-left: 0.375em; + } + + .medium-quarter-left-padding { + padding-left: 0.375em; + } + + .hide-medium { + display: none !important; + } + + .show-medium { + display: inherit !important; + } + + table.show-medium { + display: table; + } + + thead.show-medium { + display: table-header-group; + } + + tbody.show-medium { + display: table-row-group; + } + + tfoot.show-medium { + display: table-footer-group; + } + + tr.show-medium { + display: table-row; + } + + th.show-medium, + td.show-medium { + display: table-cell; + } +} +@media screen and (min-width: 321px) and (max-width: 640px) { + .ink-grid { + padding: 0 1.25em; + } + + .column-group.gutters { + margin-left: -1.25em; + } + .column-group.gutters > [class*=small-], .column-group.gutters > [class*=all-], .column-group.gutters > .all-auto { + padding-left: 1.25em; + margin-bottom: 1.25em; + } + + .column-group.horizontal-gutters { + margin-left: -1.25em; + } + .column-group.horizontal-gutters > [class*=small-], .column-group.horizontal-gutters > [class*=all-], .column-group.horizontal-gutters > .all-auto { + padding-left: 1.25em; + } + + .column-group.vertical-gutters > [class*=small-], .column-group.vertical-gutters > [class*=all-], .column-group.vertical-gutters > .all-auto { + margin-bottom: 1.25em; + } + + .column-group.double-gutters { + margin-left: -2.5em; + } + .column-group.double-gutters > [class*=small-], .column-group.double-gutters > [class*=all-], .column-group.double-gutters > .all-auto { + padding-left: 2.5em; + margin-bottom: 2.5em; + } + + .column-group.double-horizontal-gutters { + margin-left: -2.5em; + } + .column-group.double-horizontal-gutters > [class*=small-], .column-group.double-horizontal-gutters > [class*=all-], .column-group.double-horizontal-gutters > .all-auto { + padding-left: 2.5em; + } + + .column-group.double-vertical-gutters > [class*=small-], .column-group.double-vertical-gutters > [class*=all-], .column-group.double-vertical-gutters > .all-auto { + margin-bottom: 2.5em; + } + + .column-group.half-gutters { + margin-left: -0.625em; + } + .column-group.half-gutters > [class*=small-], .column-group.half-gutters > [class*=all-], .column-group.half-gutters > .all-auto { + padding-left: 0.625em; + margin-bottom: 0.625em; + } + + .column-group.half-horizontal-gutters { + margin-left: -0.625em; + } + .column-group.half-horizontal-gutters > [class*=small-], .column-group.half-horizontal-gutters > [class*=all-], .column-group.half-horizontal-gutters > .all-auto { + padding-left: 0.625em; + } + + .column-group.half-vertical-gutters > [class*=small-], .column-group.half-vertical-gutters > [class*=all-], .column-group.half-vertical-gutters > .all-auto { + margin-bottom: 0.625em; + } + + .column-group.quarter-gutters { + margin-left: -0.3125em; + } + .column-group.quarter-gutters > [class*=small-], .column-group.quarter-gutters > [class*=all-], .column-group.quarter-gutters > .all-auto { + padding-left: 0.3125em; + margin-bottom: 0.3125em; + } + + .column-group.quarter-horizontal-gutters { + margin-left: -0.3125em; + } + .column-group.quarter-horizontal-gutters > [class*=small-], .column-group.quarter-horizontal-gutters > [class*=all-], .column-group.quarter-horizontal-gutters > .all-auto { + padding-left: 0.3125em; + } + + .column-group.quarter-vertical-gutters > [class*=small-], .column-group.quarter-vertical-gutters > [class*=all-], .column-group.quarter-vertical-gutters > .all-auto { + margin-bottom: 0.3125em; + } + + .column-group.small-gutters { + margin-left: -1.25em; + } + .column-group.small-gutters > [class*=small-], .column-group.small-gutters > [class*=all-], .column-group.small-gutters > .all-auto { + padding-left: 0.3125em; + margin-bottom: 0.3125em; + } + + .column-group.small-horizontal-gutters { + margin-left: -1.25em; + } + .column-group.small-horizontal-gutters > [class*=small-], .column-group.small-horizontal-gutters > [class*=all-], .column-group.small-horizontal-gutters > .all-auto { + padding-left: 1.25em; + } + + .column-group.small-vertical-gutters > [class*=small-], .column-group.small-vertical-gutters > [class*=all-], .column-group.small-vertical-gutters > .all-auto { + margin-bottom: 1.25em; + } + + .column-group.small-double-gutters { + margin-left: -2.5em; + } + .column-group.small-double-gutters > [class*=small-], .column-group.small-double-gutters > [class*=all-], .column-group.small-double-gutters > .all-auto { + padding-left: 2.5em; + margin-bottom: 2.5em; + } + + .column-group.small-double-horizontal-gutters { + margin-left: -2.5em; + } + .column-group.small-double-horizontal-gutters > [class*=small-], .column-group.small-double-horizontal-gutters > [class*=all-], .column-group.small-double-horizontal-gutters > .all-auto { + padding-left: 2.5em; + } + + .column-group.small-double-vertical-gutters > [class*=small-], .column-group.small-double-vertical-gutters > [class*=all-], .column-group.small-double-vertical-gutters > .all-auto { + margin-bottom: 2.5em; + } + + .column-group.small-half-gutters { + margin-left: -0.625em; + } + .column-group.small-half-gutters > [class*=small-], .column-group.small-half-gutters > [class*=all-], .column-group.small-half-gutters > .all-auto { + padding-left: 0.625em; + margin-bottom: 0.625em; + } + + .column-group.small-half-horizontal-gutters { + margin-left: -0.625em; + } + .column-group.small-half-horizontal-gutters > [class*=small-], .column-group.small-half-horizontal-gutters > [class*=all-], .column-group.small-half-horizontal-gutters > .all-auto { + padding-left: 0.625em; + } + + .column-group.small-half-vertical-gutters > [class*=small-], .column-group.small-half-vertical-gutters > [class*=all-], .column-group.small-half-vertical-gutters > .all-auto { + margin-bottom: 0.625em; + } + + .column-group.small-quarter-gutters { + margin-left: -0.3125em; + } + .column-group.small-quarter-gutters > [class*=small-], .column-group.small-quarter-gutters > [class*=all-], .column-group.small-quarter-gutters > .all-auto { + padding-left: 0.3125em; + margin-bottom: 0.3125em; + } + + .column-group.small-quarter-horizontal-gutters { + margin-left: -0.3125em; + } + .column-group.small-quarter-horizontal-gutters > [class*=small-], .column-group.small-quarter-horizontal-gutters > [class*=all-], .column-group.small-quarter-horizontal-gutters > .all-auto { + padding-left: 0.3125em; + } + + .column-group.small-quarter-vertical-gutters > [class*=small-], .column-group.small-quarter-vertical-gutters > [class*=all-], .column-group.small-quarter-vertical-gutters > .all-auto { + margin-bottom: 0.3125em; + } + + .column-group.small-no-gutters { + margin-left: 0; + } + .column-group.small-no-gutters > [class*=small-], .column-group.small-no-gutters > [class*=all-], .column-group.small-no-gutters > .all-auto { + padding-left: 0; + margin-bottom: 0; + } + + .small-5 { + width: 5%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-10 { + width: 10%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-15 { + width: 15%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-16 { + width: 16.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-20 { + width: 20%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-25 { + width: 25%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-30 { + width: 30%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-33 { + width: 33.33333%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-35 { + width: 35%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-40 { + width: 40%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-45 { + width: 45%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-50 { + width: 50%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-55 { + width: 55%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-60 { + width: 60%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-65 { + width: 65%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-66 { + width: 66.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-70 { + width: 70%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-75 { + width: 75%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-80 { + width: 80%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-85 { + width: 85%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-90 { + width: 90%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-95 { + width: 95%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-100 { + width: 100%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .small-auto { + -webkit-box-flex: 1; + -webkit-flex: 1; + -moz-box-flex: 1; + -ms-flex: 1; + flex: 1; + } + + .ink-flex, + .column-group { + display: -webkit-flex; + display: flex; + display: -ms-flexbox; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + list-style: none; + } + .ink-flex.small-reverse, .ink-flex.reverse, + .column-group.small-reverse, + .column-group.reverse { + -webkit-flex-direction: row-reverse; + -moz-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .ink-flex.small-vertical, .ink-flex.vertical, + .column-group.small-vertical, + .column-group.vertical { + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + } + .ink-flex.small-vertical.small-reverse, .ink-flex.vertical.reverse, + .column-group.small-vertical.small-reverse, + .column-group.vertical.reverse { + -webkit-flex-direction: column-reverse; + -moz-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + + .small-order-1 { + order: 1; + -ms-flex-order: 1; + } + + .small-order-2 { + order: 2; + -ms-flex-order: 2; + } + + .small-order-3 { + order: 3; + -ms-flex-order: 3; + } + + .small-order-4 { + order: 4; + -ms-flex-order: 4; + } + + .small-order-5 { + order: 5; + -ms-flex-order: 5; + } + + .small-order-6 { + order: 6; + -ms-flex-order: 6; + } + + .small-order-7 { + order: 7; + -ms-flex-order: 7; + } + + .small-order-8 { + order: 8; + -ms-flex-order: 8; + } + + .small-order-9 { + order: 9; + -ms-flex-order: 9; + } + + .small-order-10 { + order: 10; + -ms-flex-order: 10; + } + + .column-group .small-auto { + -webkit-flex-basis: auto; + -ms-flex-basis: auto; + flex-basis: auto; + -webkit-flex-grow: 1; + -ms-flex-grow: 1; + flex-grow: 1; + } + + .push-top, + .small-push-top { + -webkit-box-align: start; + -webkit-align-items: flex-start; + -moz-box-align: start; + -ms-flex-align: start; + align-items: flex-start; + -webkit-align-self: flex-start; + -ms-flex-item-align: start; + align-self: flex-start; + } + + .push-bottom, + .small-push-bottom { + -webkit-box-align: end; + -webkit-align-items: flex-end; + -moz-box-align: end; + -ms-flex-align: end; + align-items: flex-end; + -webkit-align-self: flex-end; + -ms-flex-item-align: end; + align-self: flex-end; + } + + .push-middle, + .small-push-middle { + -webkit-box-align: center; + -webkit-align-items: center; + -moz-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-align-self: flex-center; + -ms-flex-item-align: center; + align-self: center; + } + + .push-left, + .small-push-left { + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + justify-content: flex-start; + -ms-flex-pack: start; + float: left; + } + + .push-center, + .small-push-center { + float: none !important; + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + justify-content: center; + -ms-flex-pack: center; + margin-left: auto; + margin-right: auto; + } + + .push-right, + .small-push-right { + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + -ms-justify-content: flex-end; + justify-content: flex-end; + -ms-flex-pack: end; + float: right; + } + + .small-align-left { + text-align: left; + } + + .small-align-center { + text-align: center; + } + + .small-align-right { + text-align: right; + } + + .space { + margin: 1.25em; + } + + .small-space { + margin: 1.25em; + } + + .padding { + padding: 1.25em; + } + + .small-padding { + padding: 1.25em; + } + + .double-space { + margin: 2.5em; + } + + .small-double-space { + margin: 2.5em; + } + + .double-padding { + padding: 2.5em; + } + + .small-double-padding { + padding: 2.5em; + } + + .half-space { + margin: 0.625em; + } + + .small-half-space { + margin: 0.625em; + } + + .half-padding { + padding: 0.625em; + } + + .small-half-padding { + padding: 0.625em; + } + + .quarter-space { + margin: 0.3125em; + } + + .small-quarter-space { + margin: 0.3125em; + } + + .quarter-padding { + padding: 0.3125em; + } + + .small-quarter-padding { + padding: 0.3125em; + } + + .vertical-space { + margin-top: 1.25em; + margin-bottom: 1.25em; + } + + .small-vertical-space { + margin-top: 1.25em; + margin-bottom: 1.25em; + } + + .vertical-padding { + padding-top: 1.25em; + padding-bottom: 1.25em; + } + + .small-vertical-padding { + padding-top: 1.25em; + padding-bottom: 1.25em; + } + + .double-vertical-space { + margin-top: 2.5em; + margin-bottom: 2.5em; + } + + .small-double-vertical-space { + margin-top: 2.5em; + margin-bottom: 2.5em; + } + + .double-vertical-padding { + padding-top: 2.5em; + padding-bottom: 2.5em; + } + + .small-double-vertical-padding { + padding-top: 2.5em; + padding-bottom: 2.5em; + } + + .half-vertical-space { + margin-top: 0.625em; + margin-bottom: 0.625em; + } + + .small-half-vertical-space { + margin-top: 0.625em; + margin-bottom: 0.625em; + } + + .half-vertical-padding { + padding-top: 0.625em; + padding-bottom: 0.625em; + } + + .small-half-vertical-padding { + padding-top: 0.625em; + padding-bottom: 0.625em; + } + + .quarter-vertical-space { + margin-top: 0.3125em; + margin-bottom: 0.3125em; + } + + .small-quarter-vertical-space { + margin-top: 0.3125em; + margin-bottom: 0.3125em; + } + + .quarter-vertical-padding { + padding-top: 0.3125em; + padding-bottom: 0.3125em; + } + + .small-quarter-vertical-padding { + padding-top: 0.3125em; + padding-bottom: 0.3125em; + } + + .horizontal-space { + margin-left: 1.25em; + margin-right: 1.25em; + } + + .small-horizontal-space { + margin-left: 1.25em; + margin-right: 1.25em; + } + + .horizontal-padding { + padding-left: 1.25em; + padding-right: 1.25em; + } + + .small-horizontal-padding { + padding-left: 1.25em; + padding-right: 1.25em; + } + + .double-horizontal-space { + margin-left: 2.5em; + margin-right: 2.5em; + } + + .small-double-horizontal-space { + margin-left: 2.5em; + margin-right: 2.5em; + } + + .double-horizontal-padding { + padding-left: 2.5em; + padding-right: 2.5em; + } + + .small-double-horizontal-padding { + padding-left: 2.5em; + padding-right: 2.5em; + } + + .half-horizontal-space { + margin-left: 0.625em; + margin-right: 0.625em; + } + + .small-half-horizontal-space { + margin-left: 0.625em; + margin-right: 0.625em; + } + + .half-horizontal-padding { + padding-left: 0.625em; + padding-right: 0.625em; + } + + .small-half-horizontal-padding { + padding-left: 0.625em; + padding-right: 0.625em; + } + + .quarter-horizontal-space { + margin-left: 0.3125em; + margin-right: 0.3125em; + } + + .small-quarter-horizontal-space { + margin-left: 0.3125em; + margin-right: 0.3125em; + } + + .quarter-horizontal-padding { + padding-left: 0.3125em; + padding-right: 0.3125em; + } + + .small-quarter-horizontal-padding { + padding-left: 0.3125em; + padding-right: 0.3125em; + } + + .top-space { + margin-top: 1.25em; + } + + .small-top-space { + margin-top: 1.25em; + } + + .top-padding { + padding-top: 1.25em; + } + + .small-top-padding { + padding-top: 1.25em; + } + + .double-top-space { + margin-top: 2.5em; + } + + .small-double-top-space { + margin-top: 2.5em; + } + + .double-top-padding { + padding-top: 2.5em; + } + + .small-double-top-padding { + padding-top: 2.5em; + } + + .half-top-space { + margin-top: 0.625em; + } + + .small-half-top-space { + margin-top: 0.625em; + } + + .half-top-padding { + padding-top: 0.625em; + } + + .small-half-top-padding { + padding-top: 0.625em; + } + + .quarter-top-space { + margin-top: 0.3125em; + } + + .small-quarter-top-space { + margin-top: 0.3125em; + } + + .quarter-top-padding { + padding-top: 0.3125em; + } + + .small-quarter-top-padding { + padding-top: 0.3125em; + } + + .right-space { + margin-right: 1.25em; + } + + .small-right-space { + margin-right: 1.25em; + } + + .right-padding { + padding-right: 1.25em; + } + + .small-right-padding { + padding-right: 1.25em; + } + + .double-right-space { + margin-right: 2.5em; + } + + .small-double-right-space { + margin-right: 2.5em; + } + + .double-right-padding { + padding-right: 2.5em; + } + + .small-double-right-padding { + padding-right: 2.5em; + } + + .half-right-space { + margin-right: 0.625em; + } + + .small-half-right-space { + margin-right: 0.625em; + } + + .half-right-padding { + padding-right: 0.625em; + } + + .small-half-right-padding { + padding-right: 0.625em; + } + + .quarter-right-space { + margin-right: 0.3125em; + } + + .small-quarter-right-space { + margin-right: 0.3125em; + } + + .quarter-right-padding { + padding-right: 0.3125em; + } + + .small-quarter-right-padding { + padding-right: 0.3125em; + } + + .bottom-space { + margin-bottom: 1.25em; + } + + .small-bottom-space { + margin-bottom: 1.25em; + } + + .bottom-padding { + padding-bottom: 1.25em; + } + + .small-bottom-padding { + padding-bottom: 1.25em; + } + + .double-bottom-space { + margin-bottom: 2.5em; + } + + .small-double-bottom-space { + margin-bottom: 2.5em; + } + + .double-bottom-padding { + padding-bottom: 2.5em; + } + + .small-double-bottom-padding { + padding-bottom: 2.5em; + } + + .half-bottom-space { + margin-bottom: 0.625em; + } + + .small-half-bottom-space { + margin-bottom: 0.625em; + } + + .half-bottom-padding { + padding-bottom: 0.625em; + } + + .small-half-bottom-padding { + padding-bottom: 0.625em; + } + + .quarter-bottom-space { + margin-bottom: 0.3125em; + } + + .small-quarter-bottom-space { + margin-bottom: 0.3125em; + } + + .quarter-bottom-padding { + padding-bottom: 0.3125em; + } + + .small-quarter-bottom-padding { + padding-bottom: 0.3125em; + } + + .left-space { + margin-left: 1.25em; + } + + .small-left-space { + margin-left: 1.25em; + } + + .left-padding { + padding-left: 1.25em; + } + + .small-left-padding { + padding-left: 1.25em; + } + + .double-left-space { + margin-left: 2.5em; + } + + .small-double-left-space { + margin-left: 2.5em; + } + + .double-left-padding { + padding-left: 2.5em; + } + + .small-double-left-padding { + padding-left: 2.5em; + } + + .half-left-space { + margin-left: 0.625em; + } + + .small-half-left-space { + margin-left: 0.625em; + } + + .half-left-padding { + padding-left: 0.625em; + } + + .small-half-left-padding { + padding-left: 0.625em; + } + + .quarter-left-space { + margin-left: 0.3125em; + } + + .small-quarter-left-space { + margin-left: 0.3125em; + } + + .quarter-left-padding { + padding-left: 0.3125em; + } + + .small-quarter-left-padding { + padding-left: 0.3125em; + } + + .hide-small { + display: none !important; + } + + .show-small { + display: inherit !important; + } + + table.show-small { + display: table; + } + + thead.show-small { + display: table-header-group; + } + + tbody.show-small { + display: table-row-group; + } + + tfoot.show-small { + display: table-footer-group; + } + + tr.show-small { + display: table-row; + } + + th.show-small, + td.show-small { + display: table-cell; + } +} +@media screen and (max-width: 320px) { + .ink-grid { + padding: 0 1em; + } + + .column-group.gutters { + margin-left: -1em; + } + .column-group.gutters > [class*=tiny-], .column-group.gutters > [class*=all-], .column-group.gutters > .all-auto { + padding-left: 1em; + margin-bottom: 1em; + } + + .column-group.horizontal-gutters { + margin-left: -1em; + } + .column-group.horizontal-gutters > [class*=tiny-], .column-group.horizontal-gutters > [class*=all-], .column-group.horizontal-gutters > .all-auto { + padding-left: 1em; + } + + .column-group.vertical-gutters > [class*=tiny-], .column-group.vertical-gutters > [class*=all-], .column-group.vertical-gutters > .all-auto { + margin-bottom: 1em; + } + + .column-group.double-gutters { + margin-left: -2em; + } + .column-group.double-gutters > [class*=tiny-], .column-group.double-gutters > [class*=all-], .column-group.double-gutters > .all-auto { + padding-left: 2em; + margin-bottom: 2em; + } + + .column-group.double-horizontal-gutters { + margin-left: -2em; + } + .column-group.double-horizontal-gutters > [class*=tiny-], .column-group.double-horizontal-gutters > [class*=all-], .column-group.double-horizontal-gutters > .all-auto { + padding-left: 2em; + } + + .column-group.double-vertical-gutters > [class*=tiny-], .column-group.double-vertical-gutters > [class*=all-], .column-group.double-vertical-gutters > .all-auto { + margin-bottom: 2em; + } + + .column-group.half-gutters { + margin-left: -0.5em; + } + .column-group.half-gutters > [class*=tiny-], .column-group.half-gutters > [class*=all-], .column-group.half-gutters > .all-auto { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + + .column-group.half-horizontal-gutters { + margin-left: -0.5em; + } + .column-group.half-horizontal-gutters > [class*=tiny-], .column-group.half-horizontal-gutters > [class*=all-], .column-group.half-horizontal-gutters > .all-auto { + padding-left: 0.5em; + } + + .column-group.half-vertical-gutters > [class*=tiny-], .column-group.half-vertical-gutters > [class*=all-], .column-group.half-vertical-gutters > .all-auto { + margin-bottom: 0.5em; + } + + .column-group.quarter-gutters { + margin-left: -0.25em; + } + .column-group.quarter-gutters > [class*=tiny-], .column-group.quarter-gutters > [class*=all-], .column-group.quarter-gutters > .all-auto { + padding-left: 0.25em; + margin-bottom: 0.25em; + } + + .column-group.quarter-horizontal-gutters { + margin-left: -0.25em; + } + .column-group.quarter-horizontal-gutters > [class*=tiny-], .column-group.quarter-horizontal-gutters > [class*=all-], .column-group.quarter-horizontal-gutters > .all-auto { + padding-left: 0.25em; + } + + .column-group.quarter-vertical-gutters > [class*=tiny-], .column-group.quarter-vertical-gutters > [class*=all-], .column-group.quarter-vertical-gutters > .all-auto { + margin-bottom: 0.25em; + } + + .column-group.tiny-gutters { + margin-left: -1em; + } + .column-group.tiny-gutters > [class*=tiny-], .column-group.tiny-gutters > [class*=all-], .column-group.tiny-gutters > .all-auto { + padding-left: 0.25em; + margin-bottom: 0.25em; + } + + .column-group.tiny-horizontal-gutters { + margin-left: -1em; + } + .column-group.tiny-horizontal-gutters > [class*=tiny-], .column-group.tiny-horizontal-gutters > [class*=all-], .column-group.tiny-horizontal-gutters > .all-auto { + padding-left: 1em; + } + + .column-group.tiny-vertical-gutters > [class*=tiny-], .column-group.tiny-vertical-gutters > [class*=all-], .column-group.tiny-vertical-gutters > .all-auto { + margin-bottom: 1em; + } + + .column-group.tiny-double-gutters { + margin-left: -2em; + } + .column-group.tiny-double-gutters > [class*=tiny-], .column-group.tiny-double-gutters > [class*=all-], .column-group.tiny-double-gutters > .all-auto { + padding-left: 2em; + margin-bottom: 2em; + } + + .column-group.tiny-double-horizontal-gutters { + margin-left: -2em; + } + .column-group.tiny-double-horizontal-gutters > [class*=tiny-], .column-group.tiny-double-horizontal-gutters > [class*=all-], .column-group.tiny-double-horizontal-gutters > .all-auto { + padding-left: 2em; + } + + .column-group.tiny-double-vertical-gutters > [class*=tiny-], .column-group.tiny-double-vertical-gutters > [class*=all-], .column-group.tiny-double-vertical-gutters > .all-auto { + margin-bottom: 2em; + } + + .column-group.tiny-half-gutters { + margin-left: -0.5em; + } + .column-group.tiny-half-gutters > [class*=tiny-], .column-group.tiny-half-gutters > [class*=all-], .column-group.tiny-half-gutters > .all-auto { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + + .column-group.tiny-half-horizontal-gutters { + margin-left: -0.5em; + } + .column-group.tiny-half-horizontal-gutters > [class*=tiny-], .column-group.tiny-half-horizontal-gutters > [class*=all-], .column-group.tiny-half-horizontal-gutters > .all-auto { + padding-left: 0.5em; + } + + .column-group.tiny-half-vertical-gutters > [class*=tiny-], .column-group.tiny-half-vertical-gutters > [class*=all-], .column-group.tiny-half-vertical-gutters > .all-auto { + margin-bottom: 0.5em; + } + + .column-group.tiny-quarter-gutters { + margin-left: -0.25em; + } + .column-group.tiny-quarter-gutters > [class*=tiny-], .column-group.tiny-quarter-gutters > [class*=all-], .column-group.tiny-quarter-gutters > .all-auto { + padding-left: 0.25em; + margin-bottom: 0.25em; + } + + .column-group.tiny-quarter-horizontal-gutters { + margin-left: -0.25em; + } + .column-group.tiny-quarter-horizontal-gutters > [class*=tiny-], .column-group.tiny-quarter-horizontal-gutters > [class*=all-], .column-group.tiny-quarter-horizontal-gutters > .all-auto { + padding-left: 0.25em; + } + + .column-group.tiny-quarter-vertical-gutters > [class*=tiny-], .column-group.tiny-quarter-vertical-gutters > [class*=all-], .column-group.tiny-quarter-vertical-gutters > .all-auto { + margin-bottom: 0.25em; + } + + .column-group.tiny-no-gutters { + margin-left: 0; + } + .column-group.tiny-no-gutters > [class*=tiny-], .column-group.tiny-no-gutters > [class*=all-], .column-group.tiny-no-gutters > .all-auto { + padding-left: 0; + margin-bottom: 0; + } + + .tiny-5 { + width: 5%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-10 { + width: 10%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-15 { + width: 15%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-16 { + width: 16.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-20 { + width: 20%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-25 { + width: 25%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-30 { + width: 30%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-33 { + width: 33.33333%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-35 { + width: 35%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-40 { + width: 40%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-45 { + width: 45%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-50 { + width: 50%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-55 { + width: 55%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-60 { + width: 60%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-65 { + width: 65%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-66 { + width: 66.66666%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-70 { + width: 70%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-75 { + width: 75%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-80 { + width: 80%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-85 { + width: 85%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-90 { + width: 90%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-95 { + width: 95%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-100 { + width: 100%; + -webkit-flex-grow: 0; + -ms-flex-grow: 0; + flex-grow: 0; + } + + .tiny-auto { + -webkit-box-flex: 1; + -webkit-flex: 1; + -moz-box-flex: 1; + -ms-flex: 1; + flex: 1; + } + + .ink-flex, + .column-group { + display: -webkit-flex; + display: flex; + display: -ms-flexbox; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + list-style: none; + } + .ink-flex.tiny-reverse, .ink-flex.reverse, + .column-group.tiny-reverse, + .column-group.reverse { + -webkit-flex-direction: row-reverse; + -moz-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .ink-flex.tiny-vertical, .ink-flex.vertical, + .column-group.tiny-vertical, + .column-group.vertical { + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + } + .ink-flex.tiny-vertical.tiny-reverse, .ink-flex.vertical.reverse, + .column-group.tiny-vertical.tiny-reverse, + .column-group.vertical.reverse { + -webkit-flex-direction: column-reverse; + -moz-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + + .tiny-order-1 { + order: 1; + -ms-flex-order: 1; + } + + .tiny-order-2 { + order: 2; + -ms-flex-order: 2; + } + + .tiny-order-3 { + order: 3; + -ms-flex-order: 3; + } + + .tiny-order-4 { + order: 4; + -ms-flex-order: 4; + } + + .tiny-order-5 { + order: 5; + -ms-flex-order: 5; + } + + .tiny-order-6 { + order: 6; + -ms-flex-order: 6; + } + + .tiny-order-7 { + order: 7; + -ms-flex-order: 7; + } + + .tiny-order-8 { + order: 8; + -ms-flex-order: 8; + } + + .tiny-order-9 { + order: 9; + -ms-flex-order: 9; + } + + .tiny-order-10 { + order: 10; + -ms-flex-order: 10; + } + + .column-group .tiny-auto { + -webkit-flex-basis: auto; + -ms-flex-basis: auto; + flex-basis: auto; + -webkit-flex-grow: 1; + -ms-flex-grow: 1; + flex-grow: 1; + } + + .push-top, + .tiny-push-top { + -webkit-box-align: start; + -webkit-align-items: flex-start; + -moz-box-align: start; + -ms-flex-align: start; + align-items: flex-start; + -webkit-align-self: flex-start; + -ms-flex-item-align: start; + align-self: flex-start; + } + + .push-bottom, + .tiny-push-bottom { + -webkit-box-align: end; + -webkit-align-items: flex-end; + -moz-box-align: end; + -ms-flex-align: end; + align-items: flex-end; + -webkit-align-self: flex-end; + -ms-flex-item-align: end; + align-self: flex-end; + } + + .push-middle, + .tiny-push-middle { + -webkit-box-align: center; + -webkit-align-items: center; + -moz-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-align-self: flex-center; + -ms-flex-item-align: center; + align-self: center; + } + + .push-left, + .tiny-push-left { + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + justify-content: flex-start; + -ms-flex-pack: start; + float: left; + } + + .push-center, + .tiny-push-center { + float: none !important; + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + justify-content: center; + -ms-flex-pack: center; + margin-left: auto; + margin-right: auto; + } + + .push-right, + .tiny-push-right { + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + -ms-justify-content: flex-end; + justify-content: flex-end; + -ms-flex-pack: end; + float: right; + } + + .tiny-align-left { + text-align: left; + } + + .tiny-align-center { + text-align: center; + } + + .tiny-align-right { + text-align: right; + } + + .space { + margin: 1em; + } + + .tiny-space { + margin: 1em; + } + + .padding { + padding: 1em; + } + + .tiny-padding { + padding: 1em; + } + + .double-space { + margin: 2em; + } + + .tiny-double-space { + margin: 2em; + } + + .double-padding { + padding: 2em; + } + + .tiny-double-padding { + padding: 2em; + } + + .half-space { + margin: 0.5em; + } + + .tiny-half-space { + margin: 0.5em; + } + + .half-padding { + padding: 0.5em; + } + + .tiny-half-padding { + padding: 0.5em; + } + + .quarter-space { + margin: 0.25em; + } + + .tiny-quarter-space { + margin: 0.25em; + } + + .quarter-padding { + padding: 0.25em; + } + + .tiny-quarter-padding { + padding: 0.25em; + } + + .vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + + .tiny-vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + + .vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + + .tiny-vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + + .double-vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + + .tiny-double-vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + + .double-vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + + .tiny-double-vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + + .half-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + .tiny-half-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + .half-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + + .tiny-half-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + + .quarter-vertical-space { + margin-top: 0.25em; + margin-bottom: 0.25em; + } + + .tiny-quarter-vertical-space { + margin-top: 0.25em; + margin-bottom: 0.25em; + } + + .quarter-vertical-padding { + padding-top: 0.25em; + padding-bottom: 0.25em; + } + + .tiny-quarter-vertical-padding { + padding-top: 0.25em; + padding-bottom: 0.25em; + } + + .horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + + .tiny-horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + + .horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + + .tiny-horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + + .double-horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + + .tiny-double-horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + + .double-horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + + .tiny-double-horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + + .half-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + + .tiny-half-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + + .half-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + + .tiny-half-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + + .quarter-horizontal-space { + margin-left: 0.25em; + margin-right: 0.25em; + } + + .tiny-quarter-horizontal-space { + margin-left: 0.25em; + margin-right: 0.25em; + } + + .quarter-horizontal-padding { + padding-left: 0.25em; + padding-right: 0.25em; + } + + .tiny-quarter-horizontal-padding { + padding-left: 0.25em; + padding-right: 0.25em; + } + + .top-space { + margin-top: 1em; + } + + .tiny-top-space { + margin-top: 1em; + } + + .top-padding { + padding-top: 1em; + } + + .tiny-top-padding { + padding-top: 1em; + } + + .double-top-space { + margin-top: 2em; + } + + .tiny-double-top-space { + margin-top: 2em; + } + + .double-top-padding { + padding-top: 2em; + } + + .tiny-double-top-padding { + padding-top: 2em; + } + + .half-top-space { + margin-top: 0.5em; + } + + .tiny-half-top-space { + margin-top: 0.5em; + } + + .half-top-padding { + padding-top: 0.5em; + } + + .tiny-half-top-padding { + padding-top: 0.5em; + } + + .quarter-top-space { + margin-top: 0.25em; + } + + .tiny-quarter-top-space { + margin-top: 0.25em; + } + + .quarter-top-padding { + padding-top: 0.25em; + } + + .tiny-quarter-top-padding { + padding-top: 0.25em; + } + + .right-space { + margin-right: 1em; + } + + .tiny-right-space { + margin-right: 1em; + } + + .right-padding { + padding-right: 1em; + } + + .tiny-right-padding { + padding-right: 1em; + } + + .double-right-space { + margin-right: 2em; + } + + .tiny-double-right-space { + margin-right: 2em; + } + + .double-right-padding { + padding-right: 2em; + } + + .tiny-double-right-padding { + padding-right: 2em; + } + + .half-right-space { + margin-right: 0.5em; + } + + .tiny-half-right-space { + margin-right: 0.5em; + } + + .half-right-padding { + padding-right: 0.5em; + } + + .tiny-half-right-padding { + padding-right: 0.5em; + } + + .quarter-right-space { + margin-right: 0.25em; + } + + .tiny-quarter-right-space { + margin-right: 0.25em; + } + + .quarter-right-padding { + padding-right: 0.25em; + } + + .tiny-quarter-right-padding { + padding-right: 0.25em; + } + + .bottom-space { + margin-bottom: 1em; + } + + .tiny-bottom-space { + margin-bottom: 1em; + } + + .bottom-padding { + padding-bottom: 1em; + } + + .tiny-bottom-padding { + padding-bottom: 1em; + } + + .double-bottom-space { + margin-bottom: 2em; + } + + .tiny-double-bottom-space { + margin-bottom: 2em; + } + + .double-bottom-padding { + padding-bottom: 2em; + } + + .tiny-double-bottom-padding { + padding-bottom: 2em; + } + + .half-bottom-space { + margin-bottom: 0.5em; + } + + .tiny-half-bottom-space { + margin-bottom: 0.5em; + } + + .half-bottom-padding { + padding-bottom: 0.5em; + } + + .tiny-half-bottom-padding { + padding-bottom: 0.5em; + } + + .quarter-bottom-space { + margin-bottom: 0.25em; + } + + .tiny-quarter-bottom-space { + margin-bottom: 0.25em; + } + + .quarter-bottom-padding { + padding-bottom: 0.25em; + } + + .tiny-quarter-bottom-padding { + padding-bottom: 0.25em; + } + + .left-space { + margin-left: 1em; + } + + .tiny-left-space { + margin-left: 1em; + } + + .left-padding { + padding-left: 1em; + } + + .tiny-left-padding { + padding-left: 1em; + } + + .double-left-space { + margin-left: 2em; + } + + .tiny-double-left-space { + margin-left: 2em; + } + + .double-left-padding { + padding-left: 2em; + } + + .tiny-double-left-padding { + padding-left: 2em; + } + + .half-left-space { + margin-left: 0.5em; + } + + .tiny-half-left-space { + margin-left: 0.5em; + } + + .half-left-padding { + padding-left: 0.5em; + } + + .tiny-half-left-padding { + padding-left: 0.5em; + } + + .quarter-left-space { + margin-left: 0.25em; + } + + .tiny-quarter-left-space { + margin-left: 0.25em; + } + + .quarter-left-padding { + padding-left: 0.25em; + } + + .tiny-quarter-left-padding { + padding-left: 0.25em; + } + + .hide-tiny { + display: none !important; + } + + .show-tiny { + display: inherit !important; + } + + table.show-tiny { + display: table; + } + + thead.show-tiny { + display: table-header-group; + } + + tbody.show-tiny { + display: table-row-group; + } + + tfoot.show-tiny { + display: table-footer-group; + } + + tr.show-tiny { + display: table-row; + } + + th.show-tiny, + td.show-tiny { + display: table-cell; + } +} +@media screen and (min-width: 1261px) { + html { + font-size: 1.08em; + } + html:after { + content: '[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]'; + display: none; + } +} +@media screen and (min-width: 961px) and (max-width: 1260px) { + html { + font-size: 1.05em; + } + html:after { + content: '[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]'; + display: none; + } +} +@media screen and (min-width: 641px) and (max-width: 960px) { + html { + font-size: 1em; + } + html:after { + content: '[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]'; + display: none; + } +} +@media screen and (min-width: 321px) and (max-width: 640px) { + html { + font-size: 0.98em; + } + html:after { + content: '[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]'; + display: none; + } +} +@media screen and (max-width: 320px) { + html { + font-size: 0.97em; + } + html:after { + content: '[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]'; + display: none; + } +} +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-thin-webfont.eot'); + src: url('../fonts/Roboto/roboto-thin-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-thin-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-thin-webfont.ttf') format('truetype'); + font-weight: 100; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-thinitalic-webfont.eot'); + src: url('../fonts/Roboto/roboto-thinitalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-thinitalic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-thinitalic-webfont.ttf') format('truetype'); + font-weight: 100; + font-style: italic; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-light-webfont.eot'); + src: url('../fonts/Roboto/roboto-light-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-light-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-light-webfont.ttf') format('truetype'); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-lightitalic-webfont.eot'); + src: url('../fonts/Roboto/roboto-lightitalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-lightitalic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-lightitalic-webfont.ttf') format('truetype'); + font-weight: 300; + font-style: italic; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-regular-webfont.eot'); + src: url('../fonts/Roboto/roboto-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-regular-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-regular-webfont.ttf') format('truetype'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-italic-webfont.eot'); + src: url('../fonts/Roboto/roboto-italic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-italic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-italic-webfont.ttf') format('truetype'); + font-weight: 400; + font-style: italic; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-medium-webfont.eot'); + src: url('../fonts/Roboto/roboto-medium-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-medium-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-medium-webfont.ttf') format('truetype'); + font-weight: 500; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-mediumitalic-webfont.eot'); + src: url('../fonts/Roboto/roboto-mediumitalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-mediumitalic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-mediumitalic-webfont.ttf') format('truetype'); + font-weight: 500; + font-style: italic; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-bold-webfont.eot'); + src: url('../fonts/Roboto/roboto-bold-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-bold-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-bold-webfont.ttf') format('truetype'); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-bolditalic-webfont.eot'); + src: url('../fonts/Roboto/roboto-bolditalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-bolditalic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-bolditalic-webfont.ttf') format('truetype'); + font-weight: 700; + font-style: italic; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-black-webfont.eot'); + src: url('../fonts/Roboto/roboto-black-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-black-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-black-webfont.ttf') format('truetype'); + font-weight: 900; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-blackitalic-webfont.eot'); + src: url('../fonts/Roboto/roboto-blackitalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-blackitalic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-blackitalic-webfont.ttf') format('truetype'); + font-weight: 900; + font-style: italic; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-light-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-light-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-light-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-light-webfont.ttf') format('truetype'); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.ttf') format('truetype'); + font-weight: 300; + font-style: italic; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-regular-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-regular-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-regular-webfont.ttf') format('truetype'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-italic-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-italic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-italic-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-italic-webfont.ttf') format('truetype'); + font-weight: 400; + font-style: italic; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-bold-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-bold-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-bold-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-bold-webfont.ttf') format('truetype'); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.ttf') format('truetype'); + font-weight: 700; + font-style: italic; +} + +@font-face { + font-family: "Roboto_slab"; + src: url('../fonts/Roboto_slab/robotoslab-thin-webfont.eot'); + src: url('../fonts/Roboto_slab/robotoslab-thin-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_slab/robotoslab-thin-webfont.woff') format('woff'), url('../fonts/Roboto_slab/robotoslab-thin-webfont.ttf') format('truetype'); + font-weight: 100; + font-style: normal; +} + +@font-face { + font-family: "Roboto_slab"; + src: url('../fonts/Roboto_slab/robotoslab-light-webfont.eot'); + src: url('../fonts/Roboto_slab/robotoslab-light-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_slab/robotoslab-light-webfont.woff') format('woff'), url('../fonts/Roboto_slab/robotoslab-light-webfont.ttf') format('truetype'); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: "Roboto_slab"; + src: url('../fonts/Roboto_slab/robotoslab-regular-webfont.eot'); + src: url('../fonts/Roboto_slab/robotoslab-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_slab/robotoslab-regular-webfont.woff') format('woff'), url('../fonts/Roboto_slab/robotoslab-regular-webfont.ttf') format('truetype'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: "Roboto_slab"; + src: url('../fonts/Roboto_slab/robotoslab-bold-webfont.eot'); + src: url('../fonts/Roboto_slab/robotoslab-bold-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_slab/robotoslab-bold-webfont.woff') format('woff'), url('../fonts/Roboto_slab/robotoslab-bold-webfont.ttf') format('truetype'); + font-weight: 700; + font-style: normal; +} + +.ink-label { + padding: 0 0.35em; + white-space: nowrap; +} + +.ink-navigation { + overflow: visible; +} +.ink-navigation ul { + list-style-type: none; + padding: 0; + margin: 0; +} +.ink-navigation ul li { + margin: 0; +} + +.ink-navigation .breadcrumbs li { + line-height: 2.7em; + display: inline; +} +.ink-navigation .breadcrumbs li a { + display: inline; + padding: 0; +} +.ink-navigation .breadcrumbs li a:hover { + background: transparent; +} +.ink-navigation .breadcrumbs li.active a { + cursor: default; + text-decoration: none; +} +.ink-navigation .breadcrumbs li:first-child a { + padding-left: 1.2em; +} +.ink-navigation .breadcrumbs li:after { + content: '/'; + display: inline; + margin: 0 .7em; +} +.ink-navigation .breadcrumbs li:last-child:after { + content: ''; + display: none; +} + +.ink-dropdown, +.ink-navigation { + position: relative; +} +.ink-dropdown ul.dropdown-menu, +.ink-dropdown ul.dropdown, +.ink-navigation ul.dropdown-menu, +.ink-navigation ul.dropdown { + position: absolute; + top: 110%; + background: white; + z-index: 30; + border: 1px solid #d9d9d9; + height: auto; + width: auto; + min-width: 10em; + max-width: 12em; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: rgba(100, 100, 100, 0.3) 0 0 1px 0; + -moz-box-shadow: rgba(100, 100, 100, 0.3) 0 0 1px 0; + box-shadow: rgba(100, 100, 100, 0.3) 0 0 1px 0; + padding: .3em 0; + margin-left: 0px; + padding: .35em 0; + font-size: .85em; +} +.ink-dropdown ul.dropdown-menu li, +.ink-dropdown ul.dropdown li, +.ink-navigation ul.dropdown-menu li, +.ink-navigation ul.dropdown li { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + -webkit-border-radius: none; + -moz-border-radius: none; + -ms-border-radius: none; + -o-border-radius: none; + border-radius: none; + width: auto; + height: auto; + min-height: auto; + display: list-item; + float: none; + margin: 0; + text-align: left; + text-transform: none; + padding: 0; + position: relative; + list-style-type: none; +} +.ink-dropdown ul.dropdown-menu li.separator-above, +.ink-dropdown ul.dropdown li.separator-above, +.ink-navigation ul.dropdown-menu li.separator-above, +.ink-navigation ul.dropdown li.separator-above { + padding-top: .35em; + margin-top: .35em; + border-top: 1px solid #d9d9d9; +} +.ink-dropdown ul.dropdown-menu li.separator-below, +.ink-dropdown ul.dropdown li.separator-below, +.ink-navigation ul.dropdown-menu li.separator-below, +.ink-navigation ul.dropdown li.separator-below { + padding-bottom: .35em; + margin-bottom: .35em; + border-bottom: 1px solid #d9d9d9; +} +.ink-dropdown ul.dropdown-menu li.heading, +.ink-dropdown ul.dropdown li.heading, +.ink-navigation ul.dropdown-menu li.heading, +.ink-navigation ul.dropdown li.heading { + font-weight: 700; + padding-bottom: .35em; + margin-bottom: .35em; + padding: .5em .8em; + color: #333333; +} +.ink-dropdown ul.dropdown-menu li a, +.ink-dropdown ul.dropdown li a, +.ink-navigation ul.dropdown-menu li a, +.ink-navigation ul.dropdown li a { + color: #444; + padding: .5em .8em; + display: block; + clear: both; +} +.ink-dropdown ul.dropdown-menu li a:hover, +.ink-dropdown ul.dropdown li a:hover, +.ink-navigation ul.dropdown-menu li a:hover, +.ink-navigation ul.dropdown li a:hover { + background: #f2f2f2; + text-decoration: none; +} +.ink-dropdown ul.dropdown-menu li.active a, +.ink-dropdown ul.dropdown li.active a, +.ink-navigation ul.dropdown-menu li.active a, +.ink-navigation ul.dropdown li.active a { + background: #999999; + color: white; +} +.ink-dropdown ul.dropdown-menu li.disabled a, +.ink-dropdown ul.dropdown li.disabled a, +.ink-navigation ul.dropdown-menu li.disabled a, +.ink-navigation ul.dropdown li.disabled a { + color: #b3b3b3; +} +.ink-dropdown ul.dropdown-menu li.disabled a:hover, +.ink-dropdown ul.dropdown li.disabled a:hover, +.ink-navigation ul.dropdown-menu li.disabled a:hover, +.ink-navigation ul.dropdown li.disabled a:hover { + background: transparent; + cursor: default; +} +.ink-dropdown ul.dropdown-menu li.submenu, +.ink-dropdown ul.dropdown li.submenu, +.ink-navigation ul.dropdown-menu li.submenu, +.ink-navigation ul.dropdown li.submenu { + overflow: visible; +} +.ink-dropdown ul.dropdown-menu li.submenu > a, +.ink-dropdown ul.dropdown li.submenu > a, +.ink-navigation ul.dropdown-menu li.submenu > a, +.ink-navigation ul.dropdown li.submenu > a { + white-space: nowrap; +} +.ink-dropdown ul.dropdown-menu li.submenu > a:after, +.ink-dropdown ul.dropdown li.submenu > a:after, +.ink-navigation ul.dropdown-menu li.submenu > a:after, +.ink-navigation ul.dropdown li.submenu > a:after { + content: "\f0da"; + width: auto; + margin-left: .8em; + font-family: FontAwesome; + color: #b3b3b3; +} +.ink-dropdown ul.dropdown-menu li.submenu:hover > a, +.ink-dropdown ul.dropdown li.submenu:hover > a, +.ink-navigation ul.dropdown-menu li.submenu:hover > a, +.ink-navigation ul.dropdown li.submenu:hover > a { + background: #f2f2f2; + text-decoration: none; +} +.ink-dropdown ul.dropdown-menu li.submenu:hover:hover > ul.dropdown-menu, .ink-dropdown ul.dropdown-menu li.submenu:hover:hover > ul.dropdown, +.ink-dropdown ul.dropdown li.submenu:hover:hover > ul.dropdown-menu, +.ink-dropdown ul.dropdown li.submenu:hover:hover > ul.dropdown, +.ink-navigation ul.dropdown-menu li.submenu:hover:hover > ul.dropdown-menu, +.ink-navigation ul.dropdown-menu li.submenu:hover:hover > ul.dropdown, +.ink-navigation ul.dropdown li.submenu:hover:hover > ul.dropdown-menu, +.ink-navigation ul.dropdown li.submenu:hover:hover > ul.dropdown { + display: block; +} +.ink-dropdown ul.dropdown-menu li.submenu > ul.dropdown-menu, .ink-dropdown ul.dropdown-menu li.submenu > ul.dropdown, +.ink-dropdown ul.dropdown li.submenu > ul.dropdown-menu, +.ink-dropdown ul.dropdown li.submenu > ul.dropdown, +.ink-navigation ul.dropdown-menu li.submenu > ul.dropdown-menu, +.ink-navigation ul.dropdown-menu li.submenu > ul.dropdown, +.ink-navigation ul.dropdown li.submenu > ul.dropdown-menu, +.ink-navigation ul.dropdown li.submenu > ul.dropdown { + font-size: inherit; + position: absolute; + top: -.36em; + left: 100%; + display: none; +} + +.ink-navigation ul.pagination { + overflow: hidden; + *zoom: 1; +} +.ink-navigation ul.pagination li { + line-height: 1.7; + float: left; +} +.ink-navigation ul.pagination li a { + padding: 0.5em 1em; + display: block; + float: left; +} +.ink-navigation ul.pagination.dotted li a { + display: block; + height: 1em; + width: 1em; + margin-right: .6em; + padding: 0; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + -ms-border-radius: 50%; + -o-border-radius: 50%; + border-radius: 50%; + text-indent: 99999px; +} +.ink-navigation ul.pagination.dotted li a:first-child, .ink-navigation ul.pagination.dotted li a:last-child { + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + -ms-border-radius: 50%; + -o-border-radius: 50%; + border-radius: 50%; +} +.ink-navigation ul.pagination.chevron li { + display: none; +} +.ink-navigation ul.pagination.chevron li.next, .ink-navigation ul.pagination.chevron li.previous { + display: block; +} +.ink-navigation ul.pagination.chevron li.next a, .ink-navigation ul.pagination.chevron li.previous a { + display: block; + position: absolute; + top: 35%; + padding: 0 .5em; + margin: 0; + font-family: FontAwesome; + font-size: 4em; +} +.ink-navigation ul.pagination.chevron li.next a span, .ink-navigation ul.pagination.chevron li.previous a span { + text-indent: -99999px; + display: inline-block; +} +.ink-navigation ul.pagination.chevron li.disabled a { + color: rgba(255, 255, 255, 0.6); + text-shadow: none; +} +.ink-navigation ul.pagination.chevron li.disabled a:hover, .ink-navigation ul.pagination.chevron li.disabled a:focus { + color: rgba(255, 255, 255, 0.6); +} +.ink-navigation ul.pagination.chevron li.previous a { + left: 0; +} +.ink-navigation ul.pagination.chevron li.previous a:after { + content: "\f137"; +} +.ink-navigation ul.pagination.chevron li.next a { + right: 0; +} +.ink-navigation ul.pagination.chevron li.next a:after { + content: "\f138"; +} + +.ink-navigation .pills { + overflow: hidden; + *zoom: 1; +} +.ink-navigation .pills li { + overflow: hidden; + display: block; + float: left; + margin: 0 .5em .5em 0; + line-height: 1.7; +} +.ink-navigation .pills li a { + display: block; + padding: 0.5em 1em; +} +.ink-navigation .pills li a:hover { + text-decoration: none; +} +.ink-navigation .pills li.active a, .ink-navigation .pills li.disabled a { + cursor: default; +} + +.ink-navigation ul { + *height: 100%; +} +.ink-navigation ul.menu { + *zoom: 1; +} +.ink-navigation ul.menu:after { + content: ""; + display: table; + clear: both; +} +.ink-navigation ul.menu li { + *height: 100%; +} +.ink-navigation ul.menu li:hover > ul.submenu { + display: block; +} +.ink-navigation ul.menu li ul.submenu { + display: none; + position: absolute; + z-index: 10; +} +.ink-navigation ul.menu li ul.submenu li a { + padding: 0.5em 1em; + display: block; + float: none; +} +.ink-navigation ul.menu.horizontal li { + float: left; + position: relative; +} +.ink-navigation ul.menu.horizontal li a { + padding: 0.5em 1em; + display: block; + line-height: 1.7; +} +.ink-navigation ul.menu.horizontal li .control { + margin-top: .3em; +} +.ink-navigation ul.menu.horizontal li ul.submenu { + min-width: 100%; + left: 0; + z-index: 50; + top: auto; + left: auto; +} +.ink-navigation ul.menu.horizontal li ul.submenu li { + float: none; +} +.ink-navigation ul.menu.horizontal li ul.submenu li .flyout { + position: absolute; + top: 0; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.menu.horizontal li ul.submenu li .flyout.left { + right: 100%; +} +.ink-navigation ul.menu.horizontal li ul.submenu li .flyout.right { + left: 100%; +} +.ink-navigation ul.menu.vertical li { + line-height: 1.7; + position: relative; +} +.ink-navigation ul.menu.vertical li a { + padding: 0.5em 1em; + display: block; +} +.ink-navigation ul.menu.vertical li ul.submenu { + position: relative; + top: auto; + left: auto; +} +.ink-navigation ul.menu.vertical li ul.submenu.flyout { + position: absolute; + min-width: 8em; + top: 0; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.menu.vertical li ul.submenu.flyout.left { + right: 100%; +} +.ink-navigation ul.menu.vertical li ul.submenu.flyout.right { + left: 100%; +} + +table.ink-table { + width: 100%; + border-collapse: collapse; + border-spacing: 0; +} +table.ink-table tr th { + padding: 5px 10px; + line-height: 1.3; +} +table.ink-table tr th[data-sortable="true"]:hover { + cursor: pointer; + text-decoration: underline; +} +table.ink-table tr th[data-sortable="true"]:hover i { + text-decoration: none; +} +table.ink-table tr th[data-sortable="true"] i { + padding-left: .5em; +} +table.ink-table tr td { + padding: 5px 10px; + line-height: 1.3; +} +table.ink-table.hover tbody tr:hover { + cursor: pointer; +} +table.ink-table.bordered { + border-collapse: separate; +} + +html { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} + +body { + color: #555555; + font-family: "Roboto", Arial, Helvetica, sans-serif; + line-height: 1.45; +} + +.fw-100, .fw-light { + font-weight: 100; +} + +.fw-300, .fw-thin { + font-weight: 300; +} + +.fw-400, .fw-regular { + font-weight: 400; +} + +.fw-500, .fw-medium { + font-weight: 500; +} + +.fw-700, .fw-bold { + font-weight: 700; +} + +.fw-900, .fw-black { + font-weight: 900; +} + +.condensed-300, .condensed-thin { + font-weight: 200; + font-family: Roboto_condensed, Arial, Helvetica, sans-serif; +} + +.condensed-400, .condensed-regular { + font-weight: 400; + font-family: Roboto_condensed, Arial, Helvetica, sans-serif; +} + +.condensed-700, .condensed-bold { + font-weight: 700; + font-family: Roboto_condensed, Arial, Helvetica, sans-serif; +} + +.slab-100, .slab-light { + font-weight: 100; + font-family: Roboto_slab, Arial, Helvetica, sans-serif; +} + +.slab-300, .slab-thin { + font-weight: 300; + font-family: Roboto_slab, Arial, Helvetica, sans-serif; +} + +.slab-400, .slab-regular { + font-weight: 400; + font-family: Roboto_slab, Arial, Helvetica, sans-serif; +} + +.slab-700, .slab-bold { + font-weight: 700; + font-family: Roboto_slab, Arial, Helvetica, sans-serif; +} + +.sans { + font-family: "Roboto", Arial, Helvetica, sans-serif; +} + +.serif { + font-family: Times, "Times New Roman", serif; +} + +.monospace { + font-family: Monaco, "Andale Mono", "Courier New", monospace; +} + +.condensed { + font-family: Roboto_condensed, Arial, Helvetica, sans-serif; +} + +.slab { + font-family: Roboto_slab, Arial, Helvetica, sans-serif; +} + +.italic { + font-style: italic; +} + +.uppercase { + text-transform: uppercase; +} + +.lowercase { + text-transform: lowercase; +} + +.capitalizer { + text-transform: capitalize; +} + +.fa { + font-size: 14px; +} + +a { + color: #6998c9; + text-decoration: none; + cursor: pointer; +} +a:hover { + color: #007ed5; + text-decoration: underline; +} + +h1 { + font-size: 2.2em; + margin-top: 0; + margin-bottom: 0.57539em; +} + +h2 { + font-size: 1.75em; + margin-top: 0; + margin-bottom: 0.72334em; +} + +h3 { + font-size: 1.5em; + margin-top: 0; + margin-bottom: 0.8439em; +} + +h4 { + font-size: 1.25em; + margin-top: 0; + margin-bottom: 1.01268em; +} + +h5 { + font-size: 1.1em; + margin-top: 0; + margin-bottom: 1.15077em; +} + +h6 { + font-size: 1.1em; + margin-top: 0; + margin-bottom: 1.15077em; +} + +p { + font-size: 1em; + margin-top: 0; + margin-bottom: 1.26585em; +} + +table { + font-size: 1em; + margin-top: 0; + margin-bottom: 1.26585em; +} + +h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child, p:first-child { + margin-top: 0; +} + +/* Headings */ +h1, h2, h3, h4, h5, h6 { + color: #404040; + font-weight: 700; + line-height: 1.16; +} + +small { + color: #888888; +} + +input, textarea { + color: #666; +} + +h1 small, h2 small, h3 small, h4 small { + color: #bbb; + font-size: .6em; + font-weight: 100; + line-height: 1; +} + +mark { + background: #dae5f2; +} + +address { + color: #777777; + font-size: 1em; + line-height: 1.4; +} +address p { + margin-top: 0; +} +address h6 { + color: #555555; +} + +abbr:hover { + cursor: help; +} + +blockquote { + border-left: 4px solid #ddd; + padding-left: 25px; + margin: 1em 0; + font-weight: 200; + font-size: 1.1em; +} +blockquote small { + font-size: .9em; +} +blockquote small::before, blockquote small::after { + content: ' — '; +} + +.note { + font-size: .9em; + color: #777777; +} +.note strong { + color: #555555; +} + +.small { + font-size: .75em; +} + +.medium { + font-size: .85em; +} + +.large { + font-size: 1.2em; +} + +.extralarge { + font-size: 1.45em !important; +} + +hr { + border: 0; + border-top: 1px solid #ddd; + margin: 1em 0; +} + +.lead { + font-size: 1.1em; + font-weight: bold; +} + +ul, ol { + line-height: 1.4; + padding: 0 0 0 1.45em; + margin: 1em 0; +} +ul li, ol li { + margin: .5em 0; +} + +ul.unstyled { + list-style: none; + padding-left: 0em; +} +ul.unstyled ul { + list-style: disc outside; +} +ul.inline { + list-style: none; +} +ul.inline li { + display: inline-block; + padding: 0 .5em; +} +ul.inline li:first-child { + padding: 0 .5em 0 0; +} + +dl { + margin: 1em 0; +} +dl dt { + font-weight: bold; + margin: .5em 0; +} +dl dd { + margin: 0.5em 0 0.5em 25px; +} +dl.inline dt { + float: left; + clear: left; + text-align: right; + width: 180px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + margin: 0; +} +dl.inline dd { + margin: .5em 0 .5em 200px; +} + +figure.ink-image { + position: relative; + border: 1px solid #555555; +} +figure.ink-image > img { + width: 100%; +} +figure.ink-image > figcaption { + padding: 1em; + background: white; + line-height: 1.3; +} +figure.ink-image > figcaption.over-top, figure.ink-image > figcaption.over-bottom { + position: absolute; + width: 100%; + left: 0; + border: none; +} +figure.ink-image > figcaption.over-top.dark, figure.ink-image > figcaption.over-bottom.dark { + color: white; + background: rgba(0, 0, 0, 0.6); +} +figure.ink-image > figcaption.over-top { + top: 0; + background: rgba(255, 255, 255, 0.7); +} +figure.ink-image > figcaption.over-bottom { + bottom: 0; + background: rgba(255, 255, 255, 0.7); +} +figure.ink-image > figcaption.dark { + color: white; + background: #222222; +} + +img { + border: 0; + width: auto; + max-width: 100%; + vertical-align: top; +} + +.ink-alert.basic, .ink-alert.block { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-alert.basic { + background: rgba(255, 156, 0, 0.25); + color: #b87814; + border: 1px solid #b87814; +} +.ink-alert.basic .ink-dismiss { + color: #b87814; +} +.ink-alert.basic.success { + background: rgba(74, 155, 23, 0.25); + color: #38621d; + border: 1px solid #38621d; +} +.ink-alert.basic.success .ink-dismiss { + color: #38621d; +} +.ink-alert.basic.error { + background: rgba(201, 17, 17, 0.25); + color: #891e1e; + border: 1px solid #891e1e; +} +.ink-alert.basic.error .ink-dismiss { + color: #891e1e; +} +.ink-alert.basic.info { + background: rgba(15, 117, 218, 0.25); + color: #1e5b98; + border: 1px solid #1e5b98; +} +.ink-alert.basic.info .ink-dismiss { + color: #1e5b98; +} +.ink-alert.block { + border: 1px solid #b87814; + background: white; +} +.ink-alert.block > h4 { + background: rgba(255, 156, 0, 0.3); + color: #b87814; +} +.ink-alert.block .ink-dismiss { + color: #b87814; +} +.ink-alert.block.success { + border: 1px solid #38621d; + background: white; +} +.ink-alert.block.success > h4 { + background: rgba(74, 155, 23, 0.3); + color: #38621d; +} +.ink-alert.block.success .ink-dismiss { + color: #38621d; +} +.ink-alert.block.error { + border: 1px solid #891e1e; + background: white; +} +.ink-alert.block.error > h4 { + background: rgba(201, 17, 17, 0.3); + color: #891e1e; +} +.ink-alert.block.error .ink-dismiss { + color: #891e1e; +} +.ink-alert.block.info { + border: 1px solid #1e5b98; + background: white; +} +.ink-alert.block.info > h4 { + background: rgba(15, 117, 218, 0.3); + color: #1e5b98; +} +.ink-alert.block.info .ink-dismiss { + color: #1e5b98; +} +.ink-alert .ink-dismiss { + font-family: Arial, sans-serif; + font-weight: bold; + text-shadow: white 0 1px 0; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=25); + opacity: 0.25; +} +.ink-alert .ink-dismiss:hover { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + opacity: 0.6; +} + +.ink-badge { + -webkit-border-radius: 8em; + -moz-border-radius: 8em; + -ms-border-radius: 8em; + -o-border-radius: 8em; + border-radius: 8em; + color: white; +} +.ink-badge.white { + background: white; + color: #555555; +} +.ink-badge.black { + background: black; +} +.ink-badge.orange { + background: #ff9c00; +} +.ink-badge.red { + background: #c91111; +} +.ink-badge.green { + background: #4a9b17; +} +.ink-badge.blue { + background: #0f75da; +} +.ink-badge.yellow { + background: #ffd500; + color: #555555; +} +.ink-badge.grey { + background: gray; +} +.ink-badge + .ink-badge { + margin-left: .2em; +} + +.ink-button { + background: #d9d9d9; + color: black; + border: 1px solid #bfbfbf; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + font-weight: 300; +} +.ink-button:hover, .ink-button:active { + text-decoration: none; + color: black; + background: #cccccc; + border: 1px solid #b3b3b3; + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px; + box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px; +} +.ink-button:focus { + outline: none; + background: #cccccc; + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; +} +.ink-button[disabled] { + background: #e6e6e6; + border: 1px solid #e6e6e6; + color: #999999; +} +.ink-button[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.blue { + color: white; + background: #0f75da; + border: 1px solid #0c63b9; +} +.ink-button.blue:hover, .ink-button.blue:active { + background: #0d68c2; + border: 1px solid #0a56a1; + color: white; + text-decoration: none; +} +.ink-button.blue:focus { + background: #0d68c2; +} +.ink-button.blue[disabled] { + background: rgba(15, 117, 218, 0.6); + border: 1px solid rgba(15, 117, 218, 0); + color: #0c5baa; +} +.ink-button.blue[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.green { + color: white; + background: #4a9b17; + border: 1px solid #3e8313; +} +.ink-button.green:hover, .ink-button.green:active { + background: #3f8514; + border: 1px solid #336d10; + color: white; + text-decoration: none; +} +.ink-button.green:focus { + background: #3f8514; +} +.ink-button.green[disabled] { + background: rgba(74, 155, 23, 0.6); + border: 1px solid rgba(74, 155, 23, 0); + color: #356f10; +} +.ink-button.green[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.orange { + color: white; + background: #ff9c00; + border: 1px solid #d88400; +} +.ink-button.orange:hover, .ink-button.orange:active { + background: #e68c00; + border: 1px solid #bf7400; + color: white; + text-decoration: none; +} +.ink-button.orange:focus { + background: #e68c00; +} +.ink-button.orange[disabled] { + background: rgba(255, 156, 0, 0.6); + border: 1px solid rgba(255, 156, 0, 0); + color: #cc7d00; +} +.ink-button.orange[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.red { + color: white; + background: #c91111; + border: 1px solid #aa0e0e; +} +.ink-button.red:hover, .ink-button.red:active { + background: #b10f0f; + border: 1px solid #920c0c; + color: white; + text-decoration: none; +} +.ink-button.red:focus { + background: #b10f0f; +} +.ink-button.red[disabled] { + background: rgba(201, 17, 17, 0.6); + border: 1px solid rgba(201, 17, 17, 0); + color: #9a0d0d; +} +.ink-button.red[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.black { + color: white; + background: #1a1a1a; + border: 1px solid #161616; +} +.ink-button.black:hover, .ink-button.black:active { + background: #0d0d0d; + border: 1px solid #090909; + color: white; + text-decoration: none; +} +.ink-button.black:focus { + background: #0d0d0d; +} +.ink-button.black[disabled] { + background: rgba(26, 26, 26, 0.6); + border: 1px solid rgba(26, 26, 26, 0); + color: black; +} +.ink-button.black[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.white { + color: #555555; + background: white; + border: 1px solid #d8d8d8; +} +.ink-button.white:hover, .ink-button.white:active { + background: #f2f2f2; + border: 1px solid #cbcbcb; + color: #555555; + text-decoration: none; +} +.ink-button.white:focus { + background: #f2f2f2; +} +.ink-button.white[disabled] { + background: rgba(255, 255, 255, 0.6); + border: 1px solid rgba(255, 255, 255, 0); + color: #e6e6e6; +} +.ink-button.white[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.button-group > .ink-button[disabled] { + background: #e6e6e6; + border: 1px solid rgba(217, 217, 217, 0.6); +} +.button-group > .ink-button[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.button-group > .ink-button.blue:first-child { + border-left: #0c63b9; +} +.button-group > .ink-button.blue[disabled] { + background: rgba(15, 117, 218, 0.6); + border: 1px solid rgba(15, 117, 218, 0.3); +} +.button-group > .ink-button.green:first-child { + border-left: #3e8313; +} +.button-group > .ink-button.green[disabled] { + background: rgba(74, 155, 23, 0.6); + border: 1px solid rgba(74, 155, 23, 0.3); +} +.button-group > .ink-button.orange:first-child { + border-left: #d88400; +} +.button-group > .ink-button.orange[disabled] { + background: rgba(255, 156, 0, 0.6); + border: 1px solid rgba(255, 156, 0, 0.3); +} +.button-group > .ink-button.red:first-child { + border-left: #aa0e0e; +} +.button-group > .ink-button.red[disabled] { + background: rgba(201, 17, 17, 0.6); + border: 1px solid rgba(201, 17, 17, 0.3); +} +.button-group > .ink-button.black:first-child { + border-left: #161616; +} +.button-group > .ink-button.black[disabled] { + background: rgba(26, 26, 26, 0.6); + border: 1px solid rgba(26, 26, 26, 0.3); +} +.button-group > .ink-button.white:first-child { + border-left: #d8d8d8; +} +.button-group > .ink-button.white[disabled] { + background: rgba(255, 255, 255, 0.6); + border: 1px solid rgba(255, 255, 255, 0.3); +} + +.ink-label { + color: white; + font-weight: 300; + font-size: 0.938em; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-label.white { + background: white; + color: #555555; +} +.ink-label.black { + background: black; +} +.ink-label.orange { + background: #ff9c00; +} +.ink-label.red { + background: #c91111; +} +.ink-label.green { + background: #4a9b17; +} +.ink-label.blue { + background: #0f75da; +} +.ink-label.yellow { + background: #ffd500; + color: #555555; +} +.ink-label.grey { + background: gray; +} +.ink-label + .ink-label { + margin-left: .2em; +} + +.ink-navigation ul.breadcrumbs { + font-weight: 300; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.breadcrumbs li.active a { + background: none; + color: #999999; +} +.ink-navigation ul.breadcrumbs li.active a:hover { + cursor: default; + text-decoration: none; +} +.ink-navigation ul.breadcrumbs li a:hover { + background: none; + text-decoration: underline; +} +.ink-navigation ul.breadcrumbs.white { + background: white; +} +.ink-navigation ul.breadcrumbs.white li a, .ink-navigation ul.breadcrumbs.white li:after { + color: #555555; +} +.ink-navigation ul.breadcrumbs.white li.active a { + color: #cccccc; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.breadcrumbs.grey { + background: #d9d9d9; +} +.ink-navigation ul.breadcrumbs.grey li a, .ink-navigation ul.breadcrumbs.grey li:after { + color: #555555; +} +.ink-navigation ul.breadcrumbs.grey li.active a { + color: #a6a6a6; + text-shadow: #ededed 0 1px 0; +} +.ink-navigation ul.breadcrumbs.black { + background: #1a1a1a; +} +.ink-navigation ul.breadcrumbs.black li a, .ink-navigation ul.breadcrumbs.black li:after { + color: white; +} +.ink-navigation ul.breadcrumbs.black li.active a { + color: #666666; + text-shadow: black 0 -1px 0; +} +.ink-navigation ul.breadcrumbs.blue { + background: #1b75ce; +} +.ink-navigation ul.breadcrumbs.blue li a, .ink-navigation ul.breadcrumbs.blue li:after { + color: white; +} +.ink-navigation ul.breadcrumbs.blue li.active a { + color: #08427b; + text-shadow: #1884ef 0 1px 0; +} +.ink-navigation ul.breadcrumbs.orange { + background: #f2990d; +} +.ink-navigation ul.breadcrumbs.orange li a, .ink-navigation ul.breadcrumbs.orange li:after { + color: white; +} +.ink-navigation ul.breadcrumbs.orange li.active a { + color: #995e00; + text-shadow: #ffa81f 0 1px 0; +} +.ink-navigation ul.breadcrumbs.green { + background: #4c9220; +} +.ink-navigation ul.breadcrumbs.green li a, .ink-navigation ul.breadcrumbs.green li:after { + color: white; +} +.ink-navigation ul.breadcrumbs.green li.active a { + color: #20420a; + text-shadow: #57b61b 0 1px 0; +} +.ink-navigation ul.breadcrumbs.red { + background: #be1c1c; +} +.ink-navigation ul.breadcrumbs.red li a, .ink-navigation ul.breadcrumbs.red li:after { + color: white; +} +.ink-navigation ul.breadcrumbs.red li.active a { + color: #6b0909; + text-shadow: #e51313 0 1px 0; +} + +.ink-dropdown.blue ul.dropdown-menu li.active a { + background: #0f75da; + color: white; +} +.ink-dropdown.green ul.dropdown-menu li.active a { + background: #4a9b17; + color: white; +} +.ink-dropdown.orange ul.dropdown-menu li.active a { + background: #ff9c00; + color: white; +} +.ink-dropdown.red ul.dropdown-menu li.active a { + background: #c91111; + color: white; +} +.ink-dropdown.black ul.dropdown-menu li.active a { + background: #1a1a1a; + color: white; +} +.ink-dropdown.blue ul.dropdown-menu li.active a { + background: #0f75da; + color: white; +} + +.ink-navigation ul.menu { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.menu > li { + font-weight: 300; +} +.ink-navigation ul.menu > li.active a { + text-decoration: underline; +} +.ink-navigation ul.menu > li.heading { + font-weight: 500; +} +.ink-navigation ul.menu > li.disabled a { + color: #b3b3b3; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.menu > li.disabled a:hover { + cursor: default; + background: none; + text-decoration: none; +} +.ink-navigation ul.menu > li ul.submenu li { + font-size: .875em; +} +.ink-navigation ul.menu > li ul.submenu li a { + border-bottom: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.vertical li a { + border-bottom: 1px solid rgba(0, 0, 0, 0.15); +} +.ink-navigation ul.menu.vertical li:first-child { + -webkit-border-radius: 2px 2px 0 0; + -moz-border-radius: 2px 2px 0 0; + -ms-border-radius: 2px 2px 0 0; + -o-border-radius: 2px 2px 0 0; + border-radius: 2px 2px 0 0; +} +.ink-navigation ul.menu.vertical li:first-child > a { + -webkit-border-radius: 2px 2px 0 0; + -moz-border-radius: 2px 2px 0 0; + -ms-border-radius: 2px 2px 0 0; + -o-border-radius: 2px 2px 0 0; + border-radius: 2px 2px 0 0; +} +.ink-navigation ul.menu.vertical li:last-child { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.vertical li:last-child > a { + border-bottom: none; + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.vertical li:last-child .submenu { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.vertical li:last-child .submenu.flyout { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.menu.vertical li:last-child .submenu li:last-child { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.vertical li:last-child .submenu li:last-child a { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.horizontal > li:first-child { + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.ink-navigation ul.menu.horizontal > li:first-child a { + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.ink-navigation ul.menu.horizontal > li:last-child { + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.ink-navigation ul.menu.horizontal > li:last-child a { + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.ink-navigation ul.menu.horizontal > li ul.submenu { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; + background: white; +} +.ink-navigation ul.menu.horizontal > li ul.submenu li:last-child { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.horizontal > li ul.submenu li:last-child a { + border-bottom: none; +} +.ink-navigation ul.menu.white { + background: white; +} +.ink-navigation ul.menu.white li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.white li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.white li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.white li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.white li.active { + background: #e6e6e6; +} +.ink-navigation ul.menu.white li.disabled a { + color: #cccccc; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.menu.white li a { + color: #555555; + text-decoration: none; +} +.ink-navigation ul.menu.white li a:hover { + background: #f2f2f2; +} +.ink-navigation ul.menu.grey { + background: #d9d9d9; +} +.ink-navigation ul.menu.grey li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.grey li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.grey li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.grey li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.grey li.active { + background: #bfbfbf; +} +.ink-navigation ul.menu.grey li.disabled a { + color: #a6a6a6; + text-shadow: #ededed 0 1px 0; +} +.ink-navigation ul.menu.grey li a { + color: #555555; + text-decoration: none; +} +.ink-navigation ul.menu.grey li a:hover { + background: #cccccc; +} +.ink-navigation ul.menu.black { + background: #1a1a1a; +} +.ink-navigation ul.menu.black li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.black li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.black li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.black li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.black li.active { + background: #333333; +} +.ink-navigation ul.menu.black li.disabled a { + color: #666666; + text-shadow: black 0 -1px 0; +} +.ink-navigation ul.menu.black li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.menu.black li a:hover { + background: #404040; +} +.ink-navigation ul.menu.blue { + background: #1b75ce; +} +.ink-navigation ul.menu.blue li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.blue li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.blue li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.blue li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.blue li.active { + background: #0c5baa; +} +.ink-navigation ul.menu.blue li.disabled a { + color: #08427b; + text-shadow: #2289f0 0 1px 0; +} +.ink-navigation ul.menu.blue li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.menu.blue li a:hover { + background: #0d68c2; +} +.ink-navigation ul.menu.green { + background: #4c9220; +} +.ink-navigation ul.menu.green li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.green li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.green li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.green li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.green li.active { + background: #356f10; +} +.ink-navigation ul.menu.green li.disabled a { + color: #20420a; + text-shadow: #5bbf1c 0 1px 0; +} +.ink-navigation ul.menu.green li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.menu.green li a:hover { + background: #3f8514; +} +.ink-navigation ul.menu.orange { + background: #f2990d; +} +.ink-navigation ul.menu.orange li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.orange li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.orange li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.orange li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.orange li.active { + background: #cc7d00; +} +.ink-navigation ul.menu.orange li.disabled a { + color: #995e00; + text-shadow: #ffac29 0 1px 0; +} +.ink-navigation ul.menu.orange li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.menu.orange li a:hover { + background: #e68c00; +} +.ink-navigation ul.menu.red { + background: #be1c1c; +} +.ink-navigation ul.menu.red li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.red li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.red li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.red li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.red li.active { + background: #9a0d0d; +} +.ink-navigation ul.menu.red li.disabled a { + color: #6b0909; + text-shadow: #eb1717 0 1px 0; +} +.ink-navigation ul.menu.red li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.menu.red li a:hover { + background: #b10f0f; +} + +.ink-navigation ul.pagination { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.pagination li { + font-weight: 300; +} +.ink-navigation ul.pagination li.active a { + text-decoration: underline; +} +.ink-navigation ul.pagination li.disabled a { + color: #b3b3b3; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.pagination li.disabled a:hover { + cursor: default; + background: none; + text-decoration: none; +} +.ink-navigation ul.pagination li:first-child, .ink-navigation ul.pagination li:first-child a { + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.ink-navigation ul.pagination li:last-child, .ink-navigation ul.pagination li:last-child a { + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.ink-navigation ul.pagination.white li { + background: white; +} +.ink-navigation ul.pagination.white li.active a { + background: #e6e6e6; +} +.ink-navigation ul.pagination.white li.disabled a { + color: #cccccc; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.pagination.white li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.white li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.white li a:hover { + background: #e6e6e6; +} +.ink-navigation ul.pagination.white li { + background: white; +} +.ink-navigation ul.pagination.white li.active a { + background: #e6e6e6; +} +.ink-navigation ul.pagination.white li.disabled a { + color: #cccccc; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.pagination.white li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.white li a { + color: #555555; + text-decoration: none; +} +.ink-navigation ul.pagination.white li a:hover { + background: #f2f2f2; +} +.ink-navigation ul.pagination.grey li { + background: #d9d9d9; +} +.ink-navigation ul.pagination.grey li.active a { + background: #bfbfbf; +} +.ink-navigation ul.pagination.grey li.disabled a { + color: #a6a6a6; + text-shadow: #ededed 0 1px 0; +} +.ink-navigation ul.pagination.grey li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.grey li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.grey li a:hover { + background: #bfbfbf; +} +.ink-navigation ul.pagination.grey li { + background: #d9d9d9; +} +.ink-navigation ul.pagination.grey li.active a { + background: #bfbfbf; +} +.ink-navigation ul.pagination.grey li.disabled a { + color: #a6a6a6; + text-shadow: #ededed 0 1px 0; +} +.ink-navigation ul.pagination.grey li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.grey li a { + color: #555555; + text-decoration: none; +} +.ink-navigation ul.pagination.grey li a:hover { + background: #cccccc; +} +.ink-navigation ul.pagination.black li { + background: #1a1a1a; +} +.ink-navigation ul.pagination.black li.active a { + background: black; +} +.ink-navigation ul.pagination.black li.disabled a { + color: black; + text-shadow: #2e2e2e 0 1px 0; +} +.ink-navigation ul.pagination.black li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.black li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.black li a:hover { + background: black; +} +.ink-navigation ul.pagination.black li { + background: #1a1a1a; +} +.ink-navigation ul.pagination.black li.active a { + background: #333333; +} +.ink-navigation ul.pagination.black li.disabled a { + color: #666666; + text-shadow: black 0 -1px 0; +} +.ink-navigation ul.pagination.black li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.black li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.black li a:hover { + background: #292929; +} +.ink-navigation ul.pagination.orange li { + background: #f2990d; +} +.ink-navigation ul.pagination.orange li.active a { + background: #cc7d00; +} +.ink-navigation ul.pagination.orange li.disabled a { + color: #995e00; + text-shadow: #ffac29 0 1px 0; +} +.ink-navigation ul.pagination.orange li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.orange li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.orange li a:hover { + background: #cc7d00; +} +.ink-navigation ul.pagination.orange li { + background: #f2990d; +} +.ink-navigation ul.pagination.orange li.active a { + background: #cc7d00; +} +.ink-navigation ul.pagination.orange li.disabled a { + color: #995e00; + text-shadow: #ffac29 0 1px 0; +} +.ink-navigation ul.pagination.orange li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.orange li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.orange li a:hover { + background: #e68c00; +} +.ink-navigation ul.pagination.blue li { + background: #1b75ce; +} +.ink-navigation ul.pagination.blue li.active a { + background: #0c5baa; +} +.ink-navigation ul.pagination.blue li.disabled a { + color: #08427b; + text-shadow: #2289f0 0 1px 0; +} +.ink-navigation ul.pagination.blue li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.blue li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.blue li a:hover { + background: #0c5baa; +} +.ink-navigation ul.pagination.blue li { + background: #1b75ce; +} +.ink-navigation ul.pagination.blue li.active a { + background: #0c5baa; +} +.ink-navigation ul.pagination.blue li.disabled a { + color: #08427b; + text-shadow: #2289f0 0 1px 0; +} +.ink-navigation ul.pagination.blue li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.blue li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.blue li a:hover { + background: #0d68c2; +} +.ink-navigation ul.pagination.green li { + background: #4c9220; +} +.ink-navigation ul.pagination.green li.active a { + background: #356f10; +} +.ink-navigation ul.pagination.green li.disabled a { + color: #20420a; + text-shadow: #5bbf1c 0 1px 0; +} +.ink-navigation ul.pagination.green li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.green li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.green li a:hover { + background: #356f10; +} +.ink-navigation ul.pagination.green li { + background: #4c9220; +} +.ink-navigation ul.pagination.green li.active a { + background: #356f10; +} +.ink-navigation ul.pagination.green li.disabled a { + color: #20420a; + text-shadow: #5bbf1c 0 1px 0; +} +.ink-navigation ul.pagination.green li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.green li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.green li a:hover { + background: #3f8514; +} +.ink-navigation ul.pagination.red li { + background: #be1c1c; +} +.ink-navigation ul.pagination.red li.active a { + background: #9a0d0d; +} +.ink-navigation ul.pagination.red li.disabled a { + color: #6b0909; + text-shadow: #eb1717 0 1px 0; +} +.ink-navigation ul.pagination.red li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.red li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.red li a:hover { + background: #9a0d0d; +} +.ink-navigation ul.pagination.red li { + background: #be1c1c; +} +.ink-navigation ul.pagination.red li.active a { + background: #9a0d0d; +} +.ink-navigation ul.pagination.red li.disabled a { + color: #6b0909; + text-shadow: #eb1717 0 1px 0; +} +.ink-navigation ul.pagination.red li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.red li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.red li a:hover { + background: #b10f0f; +} +.ink-navigation ul.pagination.dotted li { + background: none; +} +.ink-navigation ul.pagination.dotted li a { + background: #999999; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); + opacity: 0.5; +} +.ink-navigation ul.pagination.dotted li:hover a, .ink-navigation ul.pagination.dotted li.active a { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} +.ink-navigation ul.pagination.dotted.black li a { + background: #1a1a1a; +} +.ink-navigation ul.pagination.dotted.white li a { + background: white; +} +.ink-navigation ul.pagination.dotted.blue li a { + background: #1b75ce; +} +.ink-navigation ul.pagination.dotted.green li a { + background: #4c9220; +} +.ink-navigation ul.pagination.dotted.orange li a { + background: #f2990d; +} +.ink-navigation ul.pagination.dotted.red li a { + background: #be1c1c; +} +.ink-navigation ul.pagination.chevron li.next a, .ink-navigation ul.pagination.chevron li.previous a { + color: white; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + opacity: 0.6; +} +.ink-navigation ul.pagination.chevron li.next a:hover, .ink-navigation ul.pagination.chevron li.next a:focus, .ink-navigation ul.pagination.chevron li.next a.active, .ink-navigation ul.pagination.chevron li.previous a:hover, .ink-navigation ul.pagination.chevron li.previous a:focus, .ink-navigation ul.pagination.chevron li.previous a.active { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); + opacity: 0.8; + text-decoration: none; + background: none; +} +.ink-navigation ul.pagination.chevron li.disabled a { + color: white; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + opacity: 0.6; + text-shadow: none; +} +.ink-navigation ul.pagination.chevron li.disabled a:hover, .ink-navigation ul.pagination.chevron li.disabled a:focus { + color: white; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + opacity: 0.6; +} +.ink-navigation ul.pagination.chevron.black li.next a, .ink-navigation ul.pagination.chevron.black li.previous a, .ink-navigation ul.pagination.chevron.black li.disabled a { + color: #1a1a1a; +} +.ink-navigation ul.pagination.chevron.grey li.next a, .ink-navigation ul.pagination.chevron.grey li.previous a, .ink-navigation ul.pagination.chevron.grey li.disabled a { + color: #d9d9d9; +} +.ink-navigation ul.pagination.chevron.blue li.next a, .ink-navigation ul.pagination.chevron.blue li.previous a, .ink-navigation ul.pagination.chevron.blue li.disabled a { + color: #1b75ce; +} +.ink-navigation ul.pagination.chevron.green li.next a, .ink-navigation ul.pagination.chevron.green li.previous a, .ink-navigation ul.pagination.chevron.green li.disabled a { + color: #4c9220; +} +.ink-navigation ul.pagination.chevron.orange li.next a, .ink-navigation ul.pagination.chevron.orange li.previous a, .ink-navigation ul.pagination.chevron.orange li.disabled a { + color: #f2990d; +} +.ink-navigation ul.pagination.chevron.red li.next a, .ink-navigation ul.pagination.chevron.red li.previous a, .ink-navigation ul.pagination.chevron.red li.disabled a { + color: #be1c1c; +} + +.ink-navigation ul.pills li { + background: white; + font-weight: 300; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.pills li a { + color: #555555; + background: none; +} +.ink-navigation ul.pills li a:hover { + background: #e6e6e6; +} +.ink-navigation ul.pills li.active a { + background: #e6e6e6; +} +.ink-navigation ul.pills li.disabled a { + color: #999999; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.pills li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.grey li { + background: #d9d9d9; +} +.ink-navigation ul.pills.grey li.active a { + background: #bfbfbf; +} +.ink-navigation ul.pills.grey li.disabled a { + color: #a6a6a6; + text-shadow: #ededed 0 1px 0; +} +.ink-navigation ul.pills.grey li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.grey li a { + color: #555555; +} +.ink-navigation ul.pills.grey li a:hover { + background: #cccccc; +} +.ink-navigation ul.pills.black li { + background: #1a1a1a; +} +.ink-navigation ul.pills.black li.active a { + background: #333333; +} +.ink-navigation ul.pills.black li.disabled a { + color: #666666; + text-shadow: black 0 -1px 0; +} +.ink-navigation ul.pills.black li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.black li a { + color: white; +} +.ink-navigation ul.pills.black li a:hover { + background: #292929; +} +.ink-navigation ul.pills.blue li { + background: #1b75ce; +} +.ink-navigation ul.pills.blue li.active a { + background: #0c5baa; +} +.ink-navigation ul.pills.blue li.disabled a { + color: #08427b; + text-shadow: #2289f0 0 1px 0; +} +.ink-navigation ul.pills.blue li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.blue li a { + color: white; +} +.ink-navigation ul.pills.blue li a:hover { + background: #0d68c2; +} +.ink-navigation ul.pills.green li { + background: #4c9220; +} +.ink-navigation ul.pills.green li.active a { + background: #356f10; +} +.ink-navigation ul.pills.green li.disabled a { + color: #20420a; + text-shadow: #5bbf1c 0 1px 0; +} +.ink-navigation ul.pills.green li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.green li a { + color: white; +} +.ink-navigation ul.pills.green li a:hover { + background: #3f8514; +} +.ink-navigation ul.pills.orange li { + background: #f2990d; +} +.ink-navigation ul.pills.orange li.active a { + background: #cc7d00; +} +.ink-navigation ul.pills.orange li.disabled a { + color: #995e00; + text-shadow: #ffac29 0 1px 0; +} +.ink-navigation ul.pills.orange li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.orange li a { + color: white; +} +.ink-navigation ul.pills.orange li a:hover { + background: #e68c00; +} +.ink-navigation ul.pills.red li { + background: #be1c1c; +} +.ink-navigation ul.pills.red li.active a { + background: #9a0d0d; +} +.ink-navigation ul.pills.red li.disabled a { + color: #6b0909; + text-shadow: #eb1717 0 1px 0; +} +.ink-navigation ul.pills.red li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.red li a { + color: white; +} +.ink-navigation ul.pills.red li a:hover { + background: #b10f0f; +} + +table.ink-table { + background: white; +} +table.ink-table tr th, table.ink-table tr td { + border-bottom: #bbbbbb 1px solid; + background: none; +} +table.ink-table tr:last-child td { + border-bottom: none; +} +table.ink-table tfoot tr th, table.ink-table tfoot tr td { + border-top: #bbbbbb 1px solid; +} +table.ink-table.alternating tbody tr:nth-child(odd) { + background-color: whitesmoke; +} +table.ink-table.hover tbody tr:hover { + background: #fefbd6; + color: #555555; +} +table.ink-table.bordered { + border: #bbbbbb 1px solid; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +table.ink-table.bordered tr th { + border-left: #bbbbbb 1px solid; +} +table.ink-table.bordered tr th:first-child { + border-left: none; +} +table.ink-table.bordered tr:last-child td { + border-bottom: none; +} +table.ink-table.bordered tr td { + border-left: #bbbbbb 1px solid; +} +table.ink-table.bordered tr td:first-child { + border-left: none; +} +table.ink-table tbody > tr.red td { + background: #c91111; + color: white; +} +table.ink-table tbody > tr.green td { + background: #4a9b17; + color: white; +} +table.ink-table tbody > tr.blue td { + background: #0f75da; + color: white; +} +table.ink-table tbody > tr.orange td { + background: #ff9c00; + color: white; +} +table.ink-table tbody > tr.black td { + background: black; + color: #cccccc; +} +table.ink-table tbody > tr.yellow td { + background: #ffd500; + color: black; +} + +.animated.slow { + animation-duration: 1s; +} +.animated.medium { + animation-duration: 0.5s; +} +.animated.fast { + animation-duration: 0.2s; +} + +.ink-carousel { + width: 100%; + position: relative; + overflow: hidden; + display: block; +} +.ink-carousel .stage { + left: 0; + height: auto !important; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + list-style-type: none; + white-space: nowrap; + position: relative; + -webkit-transition: all 0.5s ease; + -moz-transition: all 0.5s ease; + -o-transition: all 0.5s ease; + transition: all 0.5s ease; +} +.ink-carousel .stage .slide { + position: relative; + display: inline-block; + vertical-align: top; + white-space: normal; + margin: 0; + float: none; + zoom: 1; + *display: inline; +} +.ink-carousel .ink-navigation { + position: static; +} + +.ink-carousel { + width: 100%; + position: relative; + overflow: hidden; + display: block; +} +.ink-carousel .stage { + left: 0; + height: auto !important; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + list-style-type: none; + white-space: nowrap; + position: relative; + overflow: visible; + -webkit-transition: all 0.5s ease; + -moz-transition: all 0.5s ease; + -o-transition: all 0.5s ease; + transition: all 0.5s ease; +} +.ink-carousel .stage.column-group { + display: -webkit-block; + display: -moz-block; + display: block; + -webkit-flex-flow: none; + -moz-flex-flow: none; + flex-flow: none; +} +.ink-carousel .stage .slide { + position: relative; + display: inline-block; + vertical-align: top; + white-space: normal; + margin: 0; + float: none; + zoom: 1; + *display: inline; +} + +.ink-datepicker-wrapper { + position: relative; +} + +.ink-datepicker-calendar { + margin-top: 0; + position: absolute; +} +.ink-datepicker-calendar.right { + left: 100%; + top: 0; +} +.ink-datepicker-calendar.left { + right: 100%; + top: 0; +} +.ink-datepicker-calendar.bottom { + top: 100%; + left: 0; +} +.ink-datepicker-calendar.top { + bottom: 100%; + left: 0; +} + +.ink-datepicker-wrapper, .ink-datepicker-calendar { + display: inline; + display: inline-block; +} + +.ink-calendar { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + text-align: center; + padding: 0.3em; + min-width: 17.4em; + font-size: 13px; + -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0 1px 2px 0; + -moz-box-shadow: rgba(0, 0, 0, 0.4) 0 1px 2px 0; + box-shadow: rgba(0, 0, 0, 0.4) 0 1px 2px 0; + background: white; + z-index: 10; +} +.ink-calendar a { + text-decoration: none; +} +.ink-calendar li { + list-style: none inside; +} + +html.ink-modal-is-open .ink-calendar { + z-index: 101; +} + +.ink-calendar-top-options { + padding: 5px; + font-size: .813em; + cursor: pointer; +} +.ink-calendar-top-options .clean { + float: left; +} +.ink-calendar-top-options .close { + float: right; +} + +.ink-calendar-top { + line-height: 2em; + background: #e6e6e6; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-calendar-top div { + float: left; +} +.ink-calendar-top .ink-calendar-prev, +.ink-calendar-top .ink-calendar-next { + width: 10%; +} +.ink-calendar-top .ink-calendar-prev a, +.ink-calendar-top .ink-calendar-next a { + display: block; +} +.ink-calendar-top .ink-calendar-month_desc { + width: 80%; +} + +.ink-calendar-month, +.ink-calendar-year-selector, +.ink-calendar-month-selector { + margin-top: .5em; + padding-left: 0; +} +.ink-calendar-month li a, +.ink-calendar-year-selector li a, +.ink-calendar-month-selector li a { + margin: 0px; + line-height: 2em; + vertical-align: middle; + display: block; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + color: #444444; +} +.ink-calendar-month li a:hover, +.ink-calendar-year-selector li a:hover, +.ink-calendar-month-selector li a:hover { + background: #e6e6e6; +} +.ink-calendar-month li a.ink-calendar-on, .ink-calendar-month li a.ink-calendar-on:hover, +.ink-calendar-year-selector li a.ink-calendar-on, +.ink-calendar-year-selector li a.ink-calendar-on:hover, +.ink-calendar-month-selector li a.ink-calendar-on, +.ink-calendar-month-selector li a.ink-calendar-on:hover { + background: #0069d6; + color: white; +} +.ink-calendar-month li a.ink-calendar-off, .ink-calendar-month li a.ink-calendar-off:hover, +.ink-calendar-year-selector li a.ink-calendar-off, +.ink-calendar-year-selector li a.ink-calendar-off:hover, +.ink-calendar-month-selector li a.ink-calendar-off, +.ink-calendar-month-selector li a.ink-calendar-off:hover { + background: white; + color: #aaaaaa; + cursor: default; +} +.ink-calendar-month ul, +.ink-calendar-year-selector ul, +.ink-calendar-month-selector ul { + clear: both; + padding-left: 0; +} +.ink-calendar-month ul li, +.ink-calendar-year-selector ul li, +.ink-calendar-month-selector ul li { + width: 2.4em; + float: left; + text-align: center; + padding: 0; + margin: 0; +} + +.ink-calendar-year-selector ul li { + width: 25%; +} + +.ink-calendar-month-selector ul li { + width: 25%; +} + +.ink-calendar-year-selector, +.ink-calendar-month-selector { + display: none; +} + +.ink-calendar-off, .action_inactive { + color: #ddd !important; +} + +.ink-calendar-month .ink-calendar-header { + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + padding-bottom: .5em; + margin-bottom: .5em; + color: #aaa; +} + +.ink-calendar-top, +.ink-calendar-middle, +.ink-calendar-top-options, +.ink-calendar-month .ink-calendar-header, +.ink-calendar-month .ink-calendar-middle ul { + *zoom: 1; +} +.ink-calendar-top:after, +.ink-calendar-middle:after, +.ink-calendar-top-options:after, +.ink-calendar-month .ink-calendar-header:after, +.ink-calendar-month .ink-calendar-middle ul:after { + content: ""; + display: table; + clear: both; +} + +body.ink-drawer { + max-width: 100%; +} +body.ink-drawer .left-drawer, +body.ink-drawer .right-drawer, +body.ink-drawer .content-drawer { + -webkit-transition-property: translate3d; + -moz-transition-property: translate3d; + -o-transition-property: translate3d; + transition-property: translate3d; + -webkit-transition-duration: 300ms; + -moz-transition-duration: 300ms; + -o-transition-duration: 300ms; + transition-duration: 300ms; + -webkit-transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + -moz-transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + -o-transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); +} +body.ink-drawer .left-drawer { + left: -220px; +} +body.ink-drawer .right-drawer { + right: -220px; +} +body.ink-drawer .content-drawer { + width: 100%; +} +body.ink-drawer .left-drawer, +body.ink-drawer .right-drawer { + position: absolute; + top: 0; + z-index: 0; + display: none; + overflow-x: hidden; + overflow-y: auto; + width: 220px; + height: 100%; + -webkit-overflow-scrolling: touch; +} +body.ink-drawer .left-drawer.show, +body.ink-drawer .right-drawer.show { + display: block; +} +body.ink-drawer.push { + overflow: hidden; + width: 100%; + height: 100%; + position: fixed; +} +body.ink-drawer.push .content-drawer { + overflow: hidden; +} +body.ink-drawer.push.left .left-drawer, body.ink-drawer.push.left .content-drawer { + -webkit-transform: translate3d(220px, 0, 0); + -moz-transform: translate3d(220px, 0, 0); + -ms-transform: translate3d(220px, 0, 0); + -o-transform: translate3d(220px, 0, 0); + transform: translate3d(220px, 0, 0); +} +body.ink-drawer.push.right .right-drawer, body.ink-drawer.push.right .content-drawer { + -webkit-transform: translate3d(-220px, 0, 0); + -moz-transform: translate3d(-220px, 0, 0); + -ms-transform: translate3d(-220px, 0, 0); + -o-transform: translate3d(-220px, 0, 0); + transform: translate3d(-220px, 0, 0); +} +body.ink-drawer.over { + overflow: hidden; + -webkit-user-drag: none; +} +body.ink-drawer.over.left .left-drawer { + -webkit-transform: translate3d(220px, 0, 0); + -moz-transform: translate3d(220px, 0, 0); + -ms-transform: translate3d(220px, 0, 0); + -o-transform: translate3d(220px, 0, 0); + transform: translate3d(220px, 0, 0); +} +body.ink-drawer.over.right .right-drawer { + -webkit-transform: translate3d(-220px, 0, 0); + -moz-transform: translate3d(-220px, 0, 0); + -ms-transform: translate3d(-220px, 0, 0); + -o-transform: translate3d(-220px, 0, 0); + transform: translate3d(-220px, 0, 0); +} + +.ink-shade { + background: rgba(0, 0, 0, 0.8); + width: 100%; + height: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0; + margin-top: 0; + position: fixed; + z-index: 100; + display: none; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); + opacity: 0; +} +.ink-shade.fade { + -webkit-transition: opacity 300ms; + -moz-transition: opacity 300ms; + -o-transition: opacity 300ms; + transition: opacity 300ms; +} +.ink-shade.visible { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} + +.ink-modal { + top: 50%; + left: 50%; + width: 90%; + height: 90%; + background: white; + z-index: 100; + position: absolute; + overflow: hidden; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; + -webkit-box-shadow: rgba(0, 0, 0, 0.8) 0 0 15px 0; + -moz-box-shadow: rgba(0, 0, 0, 0.8) 0 0 15px 0; + box-shadow: rgba(0, 0, 0, 0.8) 0 0 15px 0; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + *zoom: 1; +} +.ink-modal:after { + content: ""; + display: table; + clear: both; +} +.ink-modal > .modal-body { + padding: 1em; + overflow-y: auto; + overflow-x: hidden; + height: auto; +} +.ink-modal > .modal-body .ink-grid { + padding-left: 0; + padding-right: 0; + width: 100%; + min-width: 100%; +} +.ink-modal > .modal-header, .ink-modal > header { + border-bottom: 1px #e6e6e6 solid; + overflow: hidden; + -webkit-box-shadow: rgba(175, 175, 175, 0.2) 0 1px 2px 0; + -moz-box-shadow: rgba(175, 175, 175, 0.2) 0 1px 2px 0; + box-shadow: rgba(175, 175, 175, 0.2) 0 1px 2px 0; +} +.ink-modal > .modal-header > .modal-close, .ink-modal > header > .modal-close { + padding-top: 2px; + text-align: center; + color: white; + width: 26px; + height: 26px; + line-height: 1.2em; + border: 0; + background: #bfbfbf; + font-size: 0; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + -ms-border-radius: 50%; + -o-border-radius: 50%; + border-radius: 50%; + text-shadow: rgba(0, 0, 0, 0.6) 0 -1px 0; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + opacity: 0.6; + float: right; +} +.ink-modal > .modal-header > .modal-close:after, .ink-modal > header > .modal-close:after { + content: "\f00d"; + font-family: FontAwesome; + font-size: medium; + line-height: 22px; +} +.ink-modal > .modal-header > .modal-close:hover, .ink-modal > header > .modal-close:hover { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} +.ink-modal > .modal-footer, .ink-modal > footer { + background: #e6e6e6; + margin-bottom: 0; + zoom: 1; + -webkit-box-shadow: rgba(175, 175, 175, 0.2) 0 -1px 2px 0; + -moz-box-shadow: rgba(175, 175, 175, 0.2) 0 -1px 2px 0; + box-shadow: rgba(175, 175, 175, 0.2) 0 -1px 2px 0; +} +.ink-modal > .modal-header, .ink-modal > header, .ink-modal > .modal-footer, .ink-modal > footer { + padding: .8em 1em .65em 1em; +} +.ink-modal > .modal-header:before, .ink-modal > .modal-header:after, .ink-modal > header:before, .ink-modal > header:after, .ink-modal > .modal-footer:before, .ink-modal > .modal-footer:after, .ink-modal > footer:before, .ink-modal > footer:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +.ink-modal-open { + overflow: hidden; +} + +/* Progess bars */ +.ink-progress-bar { + margin-bottom: 1em; + overflow: hidden; + background: #f2f2f2; + position: relative; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: 0, 1px, 3px, 0, rgba(0, 0, 0, 0.2), inset; + -moz-box-shadow: 0, 1px, 3px, 0, rgba(0, 0, 0, 0.2), inset; + box-shadow: 0, 1px, 3px, 0, rgba(0, 0, 0, 0.2), inset; +} +.ink-progress-bar .caption { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + line-height: 1.7; + text-align: center; + color: black; + font-size: 0.813em; + z-index: 10; +} +.ink-progress-bar .bar { + height: 1.3em; + text-shadow: rgba(0, 0, 0, 0.25), 0, 1px, 0; + -webkit-box-shadow: 0, 1px, 1px, 0, rgba(0, 0, 0, 0.1), inset; + -moz-box-shadow: 0, 1px, 1px, 0, rgba(0, 0, 0, 0.1), inset; + box-shadow: 0, 1px, 1px, 0, rgba(0, 0, 0, 0.1), inset; + -webkit-transition-property: width; + -moz-transition-property: width; + -o-transition-property: width; + transition-property: width; + -webkit-transition-duration: 0.6s; + -moz-transition-duration: 0.6s; + -o-transition-duration: 0.6s; + transition-duration: 0.6s; + -webkit-transition-timing-function: ease; + -moz-transition-timing-function: ease; + -o-transition-timing-function: ease; + transition-timing-function: ease; +} +.ink-progress-bar .bar.grey { + background: #cccccc; + color: #555555; +} +.ink-progress-bar .bar.green { + background: #4a9b17; + color: white; +} +.ink-progress-bar .bar.blue { + background: #0f75da; + color: white; +} +.ink-progress-bar .bar.red { + background: #c91111; + color: white; +} +.ink-progress-bar .bar.orange { + background: #ff9c00; + color: #555555; +} +.ink-progress-bar .bar.black { + background: black; + color: white; +} + +.dragging, .ink-sortable-list li { + cursor: move; + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: none; + -o-user-select: none; + -ms-user-select: none; + user-select: none; + -ms-user-drag: none; + -moz-user-drag: none; + -khtml-user-drag: none; + -webkit-user-drag: none; + -o-user-drag: none; + user-drag: none; +} + +.drag, .ink-sortable-list li.placeholder { + -webkit-box-shadow: 0, 0px, 10px, 0, rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0, 0px, 10px, 0, rgba(0, 0, 0, 0.3); + box-shadow: 0, 0px, 10px, 0, rgba(0, 0, 0, 0.3); +} + +.ink-sortable-list li { + margin: 0; + border-bottom: 1px solid #ccc; + line-height: 40px; +} +.ink-sortable-list li:hover, .ink-sortable-list li.placeholder { + background: #cccccc; + background: rgba(204, 204, 204, 0.2); +} +.ink-sortable-list li .ink-label { + margin: 0 .8em; +} + +.ink-sticky-stuck { + position: fixed; +} + +/* Tabs */ +.ink-tabs .tabs-nav { + list-style: none; + padding: 0em; + *zoom: 1; +} +.ink-tabs .tabs-nav li { + line-height: 1.7; + position: relative; + margin: 0; +} +.ink-tabs .tabs-nav li a { + padding: 0.5em 1em; + display: block; +} +.ink-tabs .tabs-nav li a:hover { + background: #f0f0f0; +} +.ink-tabs .tabs-nav li.active a { + color: #555555; + cursor: default; + text-decoration: none; + background: white; + border: 1px solid #cccccc; +} +.ink-tabs .tabs-nav:after { + content: ""; + display: table; + clear: both; +} +.ink-tabs .tabs-content { + margin-top: 1.5em; + overflow: auto; +} +.ink-tabs.top > .tabs-nav { + border-bottom: 1px solid #cccccc; +} +.ink-tabs.top > .tabs-nav li { + float: left; +} +.ink-tabs.top > .tabs-nav li a { + margin-right: .4em; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + -ms-border-radius: 4px 4px 0 0; + -o-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.ink-tabs.top > .tabs-nav li.active { + margin: 0 0 -2px 0; +} +.ink-tabs.top > .tabs-nav li.active a { + border-bottom-color: transparent; +} +.ink-tabs.bottom > .tabs-nav { + border-top: 1px solid #cccccc; +} +.ink-tabs.bottom > .tabs-nav li { + float: left; +} +.ink-tabs.bottom > .tabs-nav li a { + margin-right: .4em; + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + -ms-border-radius: 0 0 4px 4px; + -o-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.ink-tabs.bottom > .tabs-nav li.active { + margin: -2px 0 0 0; +} +.ink-tabs.bottom > .tabs-nav li.active a { + border-top-color: transparent; +} +.ink-tabs.left > .tabs-nav { + border-right: 1px solid #cccccc; + float: left; + margin-right: 2em; +} +.ink-tabs.left > .tabs-nav li { + float: none; + text-align: right; +} +.ink-tabs.left > .tabs-nav li a { + margin-bottom: .4em; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + -ms-border-radius: 4px 0 0 4px; + -o-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.ink-tabs.left > .tabs-nav li.active { + margin: 0 -2px 0 0; +} +.ink-tabs.left > .tabs-nav li.active a { + border-right-color: transparent; +} +.ink-tabs.right > .tabs-nav { + border-left: 1px solid #cccccc; + float: right; + margin-left: 2em; +} +.ink-tabs.right > .tabs-nav li { + float: none; +} +.ink-tabs.right > .tabs-nav li a { + margin-bottom: .4em; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + -ms-border-radius: 0 4px 4px 0; + -o-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.ink-tabs.right > .tabs-nav li.active { + margin: 0 0 0 -2px; +} +.ink-tabs.right > .tabs-nav li.active a { + border-left-color: transparent; +} + +.ink-tagfield input[type="text"].new-tag-input { + background-color: #fff; + border: 1px solid #ccc; + line-height: 1em; + margin: 0; + padding: 5px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-tagfield input[type="text"].new-tag-input:focus { + -webkit-box-shadow: 0px, 0px, 0px, 3px, #eaeaea; + -moz-box-shadow: 0px, 0px, 0px, 3px, #eaeaea; + box-shadow: 0px, 0px, 0px, 3px, #eaeaea; + border: 1px solid #c3c3c3; +} +.ink-tagfield span.ink-tag { + background-color: #1b1b1b; + color: #eaeaea; + text-shadow: none; + font-size: .9em; + font-weight: normal; + border: 1px solid #000; + padding: 4px 6px; +} +.ink-tagfield span.ink-tag i.icon-remove { + color: #ccc; + font-size: .9em; + font-weight: normal; + margin-left: 4px; +} +.ink-tagfield span.ink-tag i.icon-remove:hover { + cursor: pointer; + color: red; +} + +.ink-tooltip { + display: inline-block; + position: relative; +} +.ink-tooltip > .content { + background: #f0f0f0; + padding: 0.5em 0.6em; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + font-size: 0.8em; + color: #8c8c8c; +} +.ink-tooltip > .arrow { + position: absolute; +} +.ink-tooltip > .arrow.up, .ink-tooltip > .arrow.down, .ink-tooltip > .arrow.left, .ink-tooltip > .arrow.right { + width: 0; + height: 0; +} +.ink-tooltip > .arrow.up { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #f0f0f0; + top: -6px; + left: 50%; + margin-left: -3px; +} +.ink-tooltip > .arrow.down { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 6px solid #f0f0f0; + bottom: -5.45455px; + left: 50%; + margin-left: -3px; +} +.ink-tooltip > .arrow.right { + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + border-left: 6px solid #f0f0f0; + top: 50%; + right: -5.45455px; + margin-top: -6px; +} +.ink-tooltip > .arrow.left { + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + border-right: 6px solid #f0f0f0; + top: 50%; + left: -5.45455px; + margin-top: -6px; +} +.ink-tooltip.blue > .content { + background: #0f75da; + color: white; +} +.ink-tooltip.blue > .arrow.up { + border-bottom-color: #0f75da; +} +.ink-tooltip.blue > .arrow.down { + border-top-color: #0f75da; +} +.ink-tooltip.blue > .arrow.left { + border-right-color: #0f75da; +} +.ink-tooltip.blue > .arrow.right { + border-left-color: #0f75da; +} +.ink-tooltip.red > .content { + background: #c91111; + color: white; +} +.ink-tooltip.red > .arrow.up { + border-bottom-color: #c91111; +} +.ink-tooltip.red > .arrow.down { + border-top-color: #c91111; +} +.ink-tooltip.red > .arrow.left { + border-right-color: #c91111; +} +.ink-tooltip.red > .arrow.right { + border-left-color: #c91111; +} +.ink-tooltip.orange > .content { + background: #ff9c00; + color: white; +} +.ink-tooltip.orange > .arrow.up { + border-bottom-color: #ff9c00; +} +.ink-tooltip.orange > .arrow.down { + border-top-color: #ff9c00; +} +.ink-tooltip.orange > .arrow.left { + border-right-color: #ff9c00; +} +.ink-tooltip.orange > .arrow.right { + border-left-color: #ff9c00; +} +.ink-tooltip.green > .content { + background: #4a9b17; + color: white; +} +.ink-tooltip.green > .arrow.up { + border-bottom-color: #4a9b17; +} +.ink-tooltip.green > .arrow.down { + border-top-color: #4a9b17; +} +.ink-tooltip.green > .arrow.left { + border-right-color: #4a9b17; +} +.ink-tooltip.green > .arrow.right { + border-left-color: #4a9b17; +} +.ink-tooltip.black > .content { + background: black; + color: white; +} +.ink-tooltip.black > .arrow.up { + border-bottom-color: black; +} +.ink-tooltip.black > .arrow.down { + border-top-color: black; +} +.ink-tooltip.black > .arrow.left { + border-right-color: black; +} +.ink-tooltip.black > .arrow.right { + border-left-color: black; +} +.ink-tooltip.grey > .content { + background: #cccccc; + color: #333333; +} +.ink-tooltip.grey > .arrow.up { + border-bottom-color: #cccccc; +} +.ink-tooltip.grey > .arrow.down { + border-top-color: #cccccc; +} +.ink-tooltip.grey > .arrow.left { + border-right-color: #cccccc; +} +.ink-tooltip.grey > .arrow.right { + border-left-color: #cccccc; +} + +.ink-tree-view li { + list-style-type: none; +} +.ink-tree-view [data-open] > :before { + margin-left: -1.3em; + margin-right: .4em; + text-decoration: none; +} diff --git a/public/css/ink-flex.min.css b/public/css/ink-flex.min.css new file mode 100644 index 0000000..57c81df --- /dev/null +++ b/public/css/ink-flex.min.css @@ -0,0 +1 @@ +@charset "UTF-8";.grid-order{flex:100%}.show-all{display:inherit}.hide-all{display:none!important}.no-margin{margin:0!important}.no-padding{padding:0!important}.push-left{float:left;-webkit-justify-content:flex-start;-moz-justify-content:flex-start;justify-content:flex-start}.push-center{float:none!important;margin-left:auto;margin-right:auto;-webkit-justify-content:center;-moz-justify-content:center;justify-content:center}.push-right{float:right;-webkit-justify-content:flex-end;-moz-justify-content:flex-end;justify-content:flex-end}.align-left{text-align:left}.align-center{text-align:center}.align-right{text-align:right}.clearfix{overflow:hidden;*zoom:1;*zoom:1}.clearfix:after{content:"";display:table;clear:both}html{font-family:sans-serif}html *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}figure{margin:0}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.ink-alert.basic,.ink-alert.block{font-size:.938em;margin:1em 0;position:relative;overflow:hidden}.ink-alert.basic{padding:1em 3em 1em 1em}.ink-alert.basic p{margin:0}.ink-alert.basic .ink-close{top:.55em;*top:.2em}.ink-alert.block{font-size:1em}.ink-alert.block>h4{padding:1em 3em 1em 1em;font-size:.938em;line-height:1.5;margin:0}.ink-alert.block p{margin:1.5em 1em}.ink-alert.block ul{list-style:inside}.ink-alert .ink-dismiss{position:absolute;line-height:.56em;font-size:1.8em;padding:5px;border:0;background:0 0;top:.5em;*top:.2em;right:.4em}.ink-badge{padding:.2em .6em;font-size:.813em;margin-left:.6em}.ink-button{-webkit-appearance:menuitem;padding:8px 12px;cursor:pointer;text-decoration:none;text-align:center;display:inline-block;vertical-align:middle;white-space:nowrap;line-height:normal}.ink-button+.ink-button{margin-left:5px}.button-group{*zoom:1}.button-group>.ink-button{float:left;margin:5px 0;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;border-left:0}.button-group>.ink-button:active,.button-group>.ink-button:hover{border-left:0}.button-group>.ink-button:first-child{-webkit-border-radius:2px 0 0 2px;-moz-border-radius:2px 0 0 2px;-ms-border-radius:2px 0 0 2px;-o-border-radius:2px 0 0 2px;border-radius:2px 0 0 2px;border-left:1px solid #bfbfbf}.button-group>.ink-button:last-child{-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-ms-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0}.button-group:after{content:"";display:table;clear:both}.button-toolbar{*zoom:1}.button-toolbar>.button-group{margin-right:10px;float:left}.button-toolbar:after{content:"";display:table;clear:both}.ink-form fieldset{border:0;padding:0;margin:0}.ink-form fieldset legend{font-size:1.438em;font-weight:700;width:100%;border-bottom:1px solid #ddd}.ink-form fieldset legend+*{-webkit-margin-top-collapse:separate;margin:2em 0}.ink-form p.tip{font-size:.875em;color:#909090;position:relative;margin:.2em 0 0 .1em}.ink-form p.label{padding:0;margin:0;color:#555;white-space:normal}.ink-form input[type=color],.ink-form input[type=date],.ink-form input[type=datetime-local],.ink-form input[type=datetime],.ink-form input[type=email],.ink-form input[type=month],.ink-form input[type=number],.ink-form input[type=password],.ink-form input[type=search],.ink-form input[type=tel],.ink-form input[type=text],.ink-form input[type=time],.ink-form input[type=url],.ink-form input[type=week],.ink-form select,.ink-form textarea{font-family:Roboto,Arial,Helvetica,sans-serif;font-weight:300;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;padding:8px 6px;border:1px solid #c6c6c6;resize:none;background:#fff;vertical-align:middle}.ink-form input[type=color]:focus,.ink-form input[type=date]:focus,.ink-form input[type=datetime-local]:focus,.ink-form input[type=datetime]:focus,.ink-form input[type=email]:focus,.ink-form input[type=month]:focus,.ink-form input[type=number]:focus,.ink-form input[type=password]:focus,.ink-form input[type=search]:focus,.ink-form input[type=tel]:focus,.ink-form input[type=text]:focus,.ink-form input[type=time]:focus,.ink-form input[type=url]:focus,.ink-form input[type=week]:focus,.ink-form select:focus,.ink-form textarea:focus{border-color:rgba(153,153,153,.9);-webkit-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;-moz-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;outline:0 none}.ink-form input[type=color]:disabled,.ink-form input[type=date]:disabled,.ink-form input[type=datetime-local]:disabled,.ink-form input[type=datetime]:disabled,.ink-form input[type=email]:disabled,.ink-form input[type=month]:disabled,.ink-form input[type=number]:disabled,.ink-form input[type=password]:disabled,.ink-form input[type=search]:disabled,.ink-form input[type=tel]:disabled,.ink-form input[type=text]:disabled,.ink-form input[type=time]:disabled,.ink-form input[type=url]:disabled,.ink-form input[type=week]:disabled,.ink-form select:disabled,.ink-form textarea:disabled{background:#f2f2f2;cursor:not-allowed}.ink-form .input-file{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;padding:6px;border:1px solid #c6c6c6;background:#fff;vertical-align:middle;line-height:1.2}.ink-form .input-file input[type=file]{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;border:0;padding:0;background:0 0;width:100%}.ink-form .ink-button{margin:0 5px}.ink-form label{cursor:pointer}.ink-form select{line-height:2;cursor:pointer}.ink-form textarea{min-height:5em}.ink-form .control-group{line-height:2;margin-bottom:1em;*zoom:1}.ink-form .control-group:after{content:"";display:table;clear:both}.ink-form .control-group .control{position:relative;*zoom:1}.ink-form .control-group .control:after{content:"";display:table;clear:both}.ink-form .control-group .control>li{margin:0;*zoom:1}.ink-form .control-group .control>li:after{content:"";display:table;clear:both}.ink-form .control-group .control>input,.ink-form .control-group .control>select,.ink-form .control-group .control>textarea{width:100%}.ink-form .control-group .control>input+[class*=" icon-"],.ink-form .control-group .control>input+[class^=icon-],.ink-form .control-group .control>select+[class*=" icon-"],.ink-form .control-group .control>select+[class^=icon-],.ink-form .control-group .control>textarea+[class*=" icon-"],.ink-form .control-group .control>textarea+[class^=icon-]{display:none}.ink-form .control-group .control.append-button span,.ink-form .control-group .control.append-symbol span,.ink-form .control-group .control.prepend-button span,.ink-form .control-group .control.prepend-symbol span{width:100%;position:relative}.ink-form .control-group .control.append-button span>input,.ink-form .control-group .control.append-button span>select,.ink-form .control-group .control.append-button span>textarea,.ink-form .control-group .control.append-symbol span>input,.ink-form .control-group .control.append-symbol span>select,.ink-form .control-group .control.append-symbol span>textarea,.ink-form .control-group .control.prepend-button span>input,.ink-form .control-group .control.prepend-button span>select,.ink-form .control-group .control.prepend-button span>textarea,.ink-form .control-group .control.prepend-symbol span>input,.ink-form .control-group .control.prepend-symbol span>select,.ink-form .control-group .control.prepend-symbol span>textarea{width:100%}.ink-form .control-group .control.append-button>input[type=button],.ink-form .control-group .control.append-button>input[type=reset],.ink-form .control-group .control.append-button>input[type=submit],.ink-form .control-group .control.append-symbol>input[type=button],.ink-form .control-group .control.append-symbol>input[type=reset],.ink-form .control-group .control.append-symbol>input[type=submit],.ink-form .control-group .control.prepend-button>input[type=button],.ink-form .control-group .control.prepend-button>input[type=reset],.ink-form .control-group .control.prepend-button>input[type=submit],.ink-form .control-group .control.prepend-symbol>input[type=button],.ink-form .control-group .control.prepend-symbol>input[type=reset],.ink-form .control-group .control.prepend-symbol>input[type=submit]{width:auto}.ink-form .control-group .control.append-button{display:-webkit-flex;display:flex;display:-ms-flexbox}.ink-form .control-group .control.append-button span{display:table-cell}.ink-form .control-group .control.append-button span>input,.ink-form .control-group .control.append-button span>select,.ink-form .control-group .control.append-button span>textarea{-webkit-border-radius:2px 0 0 2px;-moz-border-radius:2px 0 0 2px;-ms-border-radius:2px 0 0 2px;-o-border-radius:2px 0 0 2px;border-radius:2px 0 0 2px}.ink-form .control-group .control.append-button .ink-button{margin:0;-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-ms-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0;border-left:0}.ink-form .control-group .control.prepend-button{display:-webkit-flex;display:flex;display:-ms-flexbox}.ink-form .control-group .control.prepend-button span{display:table-cell}.ink-form .control-group .control.prepend-button span>input,.ink-form .control-group .control.prepend-button span>select,.ink-form .control-group .control.prepend-button span>textarea{-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-ms-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0}.ink-form .control-group .control.prepend-button .ink-button{margin:0;-webkit-border-radius:2px 0 0 2px;-moz-border-radius:2px 0 0 2px;-ms-border-radius:2px 0 0 2px;-o-border-radius:2px 0 0 2px;border-radius:2px 0 0 2px;border-right:0}.ink-form .control-group .control.append-symbol span{display:block}.ink-form .control-group .control.append-symbol span>input,.ink-form .control-group .control.append-symbol span>select,.ink-form .control-group .control.append-symbol span>textarea{padding-right:2.5em}.ink-form .control-group .control.append-symbol span>[class*=" fa-"],.ink-form .control-group .control.append-symbol span>[class^=fa-]{position:absolute;right:1em;top:.86em;pointer-events:none}.ink-form .control-group .control.prepend-symbol span{display:block}.ink-form .control-group .control.prepend-symbol span>input,.ink-form .control-group .control.prepend-symbol span>select,.ink-form .control-group .control.prepend-symbol span>textarea{padding-left:2.5em}.ink-form .control-group .control.prepend-symbol span>[class*=" fa-"],.ink-form .control-group .control.prepend-symbol span>[class^=fa-]{position:absolute;left:1em;top:.86em;pointer-events:none}.ink-form .control-group input[type=checkbox],.ink-form .control-group input[type=radio]{padding:0;margin:.55em 0;border:0;clear:left;float:left;cursor:pointer}.ink-form .control-group input[type=checkbox]+label,.ink-form .control-group input[type=radio]+label{float:left;margin:.25em 0 .25em .4em}.ink-form .control-group .inline li{padding:0}.ink-form .control-group .inline li label{margin-right:1em}.ink-form .control-group.validation.error input,.ink-form .control-group.validation.error select,.ink-form .control-group.validation.error textarea{outline:0;-webkit-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;-moz-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;border:1px solid rgba(200,10,16,.5)}.ink-form .control-group.validation.error p.tip{color:rgba(150,7,12,.55)}.ink-form .control-group.validation.warning input,.ink-form .control-group.validation.warning select,.ink-form .control-group.validation.warning textarea{outline:0;-webkit-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;-moz-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;border:1px solid rgba(255,156,0,.6)}.ink-form .control-group.validation.warning p.tip{color:rgba(204,125,0,.6)}.ink-form .control-group.required label,.ink-form .control-group.required p.label{color:#555}.ink-form .control-group.required label:after,.ink-form .control-group.required p.label:after{content:"\f069";color:#c91111;margin-left:.6em;font-family:FontAwesome;font-size:.75em;width:1.25em}.ink-form .control-group.required ul.control label:after{content:""}.ink-grid{width:auto;max-width:1440px;margin:0 auto}.order-1{order:1;-ms-flex-order:1}.order-2{order:2;-ms-flex-order:2}.order-3{order:3;-ms-flex-order:3}.order-4{order:4;-ms-flex-order:4}.order-5{order:5;-ms-flex-order:5}.order-6{order:6;-ms-flex-order:6}.order-7{order:7;-ms-flex-order:7}.order-8{order:8;-ms-flex-order:8}.order-9{order:9;-ms-flex-order:9}.order-10{order:10;-ms-flex-order:10}.all-5{width:5%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-10{width:10%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-15{width:15%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-16{width:16.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-20{width:20%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-25{width:25%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-30{width:30%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-33{width:33.33333%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-35{width:35%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-40{width:40%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-45{width:45%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-50{width:50%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-55{width:55%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-60{width:60%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-65{width:65%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-66{width:66.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-70{width:70%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-75{width:75%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-80{width:80%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-85{width:85%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-90{width:90%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-95{width:95%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-100{width:100%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.all-auto{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1}@media screen and (min-width:1261px){.ink-grid{padding:0 2em}.column-group.gutters{margin-left:-2em}.column-group.gutters>.all-auto,.column-group.gutters>[class*=all-],.column-group.gutters>[class*=xlarge-]{padding-left:2em;margin-bottom:2em}.column-group.horizontal-gutters{margin-left:-2em}.column-group.horizontal-gutters>.all-auto,.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=xlarge-]{padding-left:2em}.column-group.vertical-gutters>.all-auto,.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=xlarge-]{margin-bottom:2em}.column-group.double-gutters{margin-left:-4em}.column-group.double-gutters>.all-auto,.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=xlarge-]{padding-left:4em;margin-bottom:4em}.column-group.double-horizontal-gutters{margin-left:-4em}.column-group.double-horizontal-gutters>.all-auto,.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=xlarge-]{padding-left:4em}.column-group.double-vertical-gutters>.all-auto,.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=xlarge-]{margin-bottom:4em}.column-group.half-gutters{margin-left:-1em}.column-group.half-gutters>.all-auto,.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=xlarge-]{padding-left:1em;margin-bottom:1em}.column-group.half-horizontal-gutters{margin-left:-1em}.column-group.half-horizontal-gutters>.all-auto,.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=xlarge-]{padding-left:1em}.column-group.half-vertical-gutters>.all-auto,.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=xlarge-]{margin-bottom:1em}.column-group.quarter-gutters{margin-left:-.5em}.column-group.quarter-gutters>.all-auto,.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=xlarge-]{padding-left:.5em;margin-bottom:.5em}.column-group.quarter-horizontal-gutters{margin-left:-.5em}.column-group.quarter-horizontal-gutters>.all-auto,.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=xlarge-]{padding-left:.5em}.column-group.quarter-vertical-gutters>.all-auto,.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=xlarge-]{margin-bottom:.5em}.column-group.xlarge-gutters{margin-left:-2em}.column-group.xlarge-gutters>.all-auto,.column-group.xlarge-gutters>[class*=all-],.column-group.xlarge-gutters>[class*=xlarge-]{padding-left:.5em;margin-bottom:.5em}.column-group.xlarge-horizontal-gutters{margin-left:-2em}.column-group.xlarge-horizontal-gutters>.all-auto,.column-group.xlarge-horizontal-gutters>[class*=all-],.column-group.xlarge-horizontal-gutters>[class*=xlarge-]{padding-left:2em}.column-group.xlarge-vertical-gutters>.all-auto,.column-group.xlarge-vertical-gutters>[class*=all-],.column-group.xlarge-vertical-gutters>[class*=xlarge-]{margin-bottom:2em}.column-group.xlarge-double-gutters{margin-left:-4em}.column-group.xlarge-double-gutters>.all-auto,.column-group.xlarge-double-gutters>[class*=all-],.column-group.xlarge-double-gutters>[class*=xlarge-]{padding-left:4em;margin-bottom:4em}.column-group.xlarge-double-horizontal-gutters{margin-left:-4em}.column-group.xlarge-double-horizontal-gutters>.all-auto,.column-group.xlarge-double-horizontal-gutters>[class*=all-],.column-group.xlarge-double-horizontal-gutters>[class*=xlarge-]{padding-left:4em}.column-group.xlarge-double-vertical-gutters>.all-auto,.column-group.xlarge-double-vertical-gutters>[class*=all-],.column-group.xlarge-double-vertical-gutters>[class*=xlarge-]{margin-bottom:4em}.column-group.xlarge-half-gutters{margin-left:-1em}.column-group.xlarge-half-gutters>.all-auto,.column-group.xlarge-half-gutters>[class*=all-],.column-group.xlarge-half-gutters>[class*=xlarge-]{padding-left:1em;margin-bottom:1em}.column-group.xlarge-half-horizontal-gutters{margin-left:-1em}.column-group.xlarge-half-horizontal-gutters>.all-auto,.column-group.xlarge-half-horizontal-gutters>[class*=all-],.column-group.xlarge-half-horizontal-gutters>[class*=xlarge-]{padding-left:1em}.column-group.xlarge-half-vertical-gutters>.all-auto,.column-group.xlarge-half-vertical-gutters>[class*=all-],.column-group.xlarge-half-vertical-gutters>[class*=xlarge-]{margin-bottom:1em}.column-group.xlarge-quarter-gutters{margin-left:-.5em}.column-group.xlarge-quarter-gutters>.all-auto,.column-group.xlarge-quarter-gutters>[class*=all-],.column-group.xlarge-quarter-gutters>[class*=xlarge-]{padding-left:.5em;margin-bottom:.5em}.column-group.xlarge-quarter-horizontal-gutters{margin-left:-.5em}.column-group.xlarge-quarter-horizontal-gutters>.all-auto,.column-group.xlarge-quarter-horizontal-gutters>[class*=all-],.column-group.xlarge-quarter-horizontal-gutters>[class*=xlarge-]{padding-left:.5em}.column-group.xlarge-quarter-vertical-gutters>.all-auto,.column-group.xlarge-quarter-vertical-gutters>[class*=all-],.column-group.xlarge-quarter-vertical-gutters>[class*=xlarge-]{margin-bottom:.5em}.column-group.xlarge-no-gutters{margin-left:0}.column-group.xlarge-no-gutters>.all-auto,.column-group.xlarge-no-gutters>[class*=all-],.column-group.xlarge-no-gutters>[class*=xlarge-]{padding-left:0;margin-bottom:0}.xlarge-5{width:5%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-10{width:10%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-15{width:15%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-16{width:16.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-20{width:20%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-25{width:25%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-30{width:30%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-33{width:33.33333%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-35{width:35%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-40{width:40%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-45{width:45%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-50{width:50%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-55{width:55%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-60{width:60%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-65{width:65%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-66{width:66.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-70{width:70%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-75{width:75%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-80{width:80%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-85{width:85%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-90{width:90%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-95{width:95%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-100{width:100%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.xlarge-auto{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1}.column-group,.ink-flex{display:-webkit-flex;display:flex;display:-ms-flexbox;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;list-style:none}.column-group.reverse,.column-group.xlarge-reverse,.ink-flex.reverse,.ink-flex.xlarge-reverse{-webkit-flex-direction:row-reverse;-moz-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.column-group.vertical,.column-group.xlarge-vertical,.ink-flex.vertical,.ink-flex.xlarge-vertical{-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.column-group.vertical.reverse,.column-group.xlarge-vertical.xlarge-reverse,.ink-flex.vertical.reverse,.ink-flex.xlarge-vertical.xlarge-reverse{-webkit-flex-direction:column-reverse;-moz-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.xlarge-order-1{order:1;-ms-flex-order:1}.xlarge-order-2{order:2;-ms-flex-order:2}.xlarge-order-3{order:3;-ms-flex-order:3}.xlarge-order-4{order:4;-ms-flex-order:4}.xlarge-order-5{order:5;-ms-flex-order:5}.xlarge-order-6{order:6;-ms-flex-order:6}.xlarge-order-7{order:7;-ms-flex-order:7}.xlarge-order-8{order:8;-ms-flex-order:8}.xlarge-order-9{order:9;-ms-flex-order:9}.xlarge-order-10{order:10;-ms-flex-order:10}.column-group .xlarge-auto{-webkit-flex-basis:auto;-ms-flex-basis:auto;flex-basis:auto;-webkit-flex-grow:1;-ms-flex-grow:1;flex-grow:1}.push-top,.xlarge-push-top{-webkit-box-align:start;-webkit-align-items:flex-start;-moz-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start}.push-bottom,.xlarge-push-bottom{-webkit-box-align:end;-webkit-align-items:flex-end;-moz-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end}.push-middle,.xlarge-push-middle{-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-self:flex-center;-ms-flex-item-align:center;align-self:center}.push-left,.xlarge-push-left{-webkit-justify-content:flex-start;-moz-justify-content:flex-start;-ms-justify-content:flex-start;justify-content:flex-start;-ms-flex-pack:start;float:left}.push-center,.xlarge-push-center{float:none!important;-webkit-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;justify-content:center;-ms-flex-pack:center;margin-left:auto;margin-right:auto}.push-right,.xlarge-push-right{-webkit-justify-content:flex-end;-moz-justify-content:flex-end;-ms-justify-content:flex-end;justify-content:flex-end;-ms-flex-pack:end;float:right}.xlarge-align-left{text-align:left}.xlarge-align-center{text-align:center}.xlarge-align-right{text-align:right}.space,.xlarge-space{margin:2em}.padding,.xlarge-padding{padding:2em}.double-space,.xlarge-double-space{margin:4em}.double-padding,.xlarge-double-padding{padding:4em}.half-space,.xlarge-half-space{margin:1em}.half-padding,.xlarge-half-padding{padding:1em}.quarter-space,.xlarge-quarter-space{margin:.5em}.quarter-padding,.xlarge-quarter-padding{padding:.5em}.vertical-space,.xlarge-vertical-space{margin-top:2em;margin-bottom:2em}.vertical-padding,.xlarge-vertical-padding{padding-top:2em;padding-bottom:2em}.double-vertical-space,.xlarge-double-vertical-space{margin-top:4em;margin-bottom:4em}.double-vertical-padding,.xlarge-double-vertical-padding{padding-top:4em;padding-bottom:4em}.half-vertical-space,.xlarge-half-vertical-space{margin-top:1em;margin-bottom:1em}.half-vertical-padding,.xlarge-half-vertical-padding{padding-top:1em;padding-bottom:1em}.quarter-vertical-space,.xlarge-quarter-vertical-space{margin-top:.5em;margin-bottom:.5em}.quarter-vertical-padding,.xlarge-quarter-vertical-padding{padding-top:.5em;padding-bottom:.5em}.horizontal-space,.xlarge-horizontal-space{margin-left:2em;margin-right:2em}.horizontal-padding,.xlarge-horizontal-padding{padding-left:2em;padding-right:2em}.double-horizontal-space,.xlarge-double-horizontal-space{margin-left:4em;margin-right:4em}.double-horizontal-padding,.xlarge-double-horizontal-padding{padding-left:4em;padding-right:4em}.half-horizontal-space,.xlarge-half-horizontal-space{margin-left:1em;margin-right:1em}.half-horizontal-padding,.xlarge-half-horizontal-padding{padding-left:1em;padding-right:1em}.quarter-horizontal-space,.xlarge-quarter-horizontal-space{margin-left:.5em;margin-right:.5em}.quarter-horizontal-padding,.xlarge-quarter-horizontal-padding{padding-left:.5em;padding-right:.5em}.top-space,.xlarge-top-space{margin-top:2em}.top-padding,.xlarge-top-padding{padding-top:2em}.double-top-space,.xlarge-double-top-space{margin-top:4em}.double-top-padding,.xlarge-double-top-padding{padding-top:4em}.half-top-space,.xlarge-half-top-space{margin-top:1em}.half-top-padding,.xlarge-half-top-padding{padding-top:1em}.quarter-top-space,.xlarge-quarter-top-space{margin-top:.5em}.quarter-top-padding,.xlarge-quarter-top-padding{padding-top:.5em}.right-space,.xlarge-right-space{margin-right:2em}.right-padding,.xlarge-right-padding{padding-right:2em}.double-right-space,.xlarge-double-right-space{margin-right:4em}.double-right-padding,.xlarge-double-right-padding{padding-right:4em}.half-right-space,.xlarge-half-right-space{margin-right:1em}.half-right-padding,.xlarge-half-right-padding{padding-right:1em}.quarter-right-space,.xlarge-quarter-right-space{margin-right:.5em}.quarter-right-padding,.xlarge-quarter-right-padding{padding-right:.5em}.bottom-space,.xlarge-bottom-space{margin-bottom:2em}.bottom-padding,.xlarge-bottom-padding{padding-bottom:2em}.double-bottom-space,.xlarge-double-bottom-space{margin-bottom:4em}.double-bottom-padding,.xlarge-double-bottom-padding{padding-bottom:4em}.half-bottom-space,.xlarge-half-bottom-space{margin-bottom:1em}.half-bottom-padding,.xlarge-half-bottom-padding{padding-bottom:1em}.quarter-bottom-space,.xlarge-quarter-bottom-space{margin-bottom:.5em}.quarter-bottom-padding,.xlarge-quarter-bottom-padding{padding-bottom:.5em}.left-space,.xlarge-left-space{margin-left:2em}.left-padding,.xlarge-left-padding{padding-left:2em}.double-left-space,.xlarge-double-left-space{margin-left:4em}.double-left-padding,.xlarge-double-left-padding{padding-left:4em}.half-left-space,.xlarge-half-left-space{margin-left:1em}.half-left-padding,.xlarge-half-left-padding{padding-left:1em}.quarter-left-space,.xlarge-quarter-left-space{margin-left:.5em}.quarter-left-padding,.xlarge-quarter-left-padding{padding-left:.5em}.hide-xlarge{display:none!important}.show-xlarge{display:inherit!important}table.show-xlarge{display:table}thead.show-xlarge{display:table-header-group}tbody.show-xlarge{display:table-row-group}tfoot.show-xlarge{display:table-footer-group}tr.show-xlarge{display:table-row}td.show-xlarge,th.show-xlarge{display:table-cell}}@media screen and (min-width:961px) and (max-width:1260px){.ink-grid{padding:0 1.75em}.column-group.gutters{margin-left:-1.75em}.column-group.gutters>.all-auto,.column-group.gutters>[class*=all-],.column-group.gutters>[class*=large-]{padding-left:1.75em;margin-bottom:1.75em}.column-group.horizontal-gutters{margin-left:-1.75em}.column-group.horizontal-gutters>.all-auto,.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=large-]{padding-left:1.75em}.column-group.vertical-gutters>.all-auto,.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=large-]{margin-bottom:1.75em}.column-group.double-gutters{margin-left:-3.5em}.column-group.double-gutters>.all-auto,.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=large-]{padding-left:3.5em;margin-bottom:3.5em}.column-group.double-horizontal-gutters{margin-left:-3.5em}.column-group.double-horizontal-gutters>.all-auto,.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=large-]{padding-left:3.5em}.column-group.double-vertical-gutters>.all-auto,.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=large-]{margin-bottom:3.5em}.column-group.half-gutters{margin-left:-.875em}.column-group.half-gutters>.all-auto,.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=large-]{padding-left:.875em;margin-bottom:.875em}.column-group.half-horizontal-gutters{margin-left:-.875em}.column-group.half-horizontal-gutters>.all-auto,.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=large-]{padding-left:.875em}.column-group.half-vertical-gutters>.all-auto,.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=large-]{margin-bottom:.875em}.column-group.quarter-gutters{margin-left:-.4375em}.column-group.quarter-gutters>.all-auto,.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=large-]{padding-left:.4375em;margin-bottom:.4375em}.column-group.quarter-horizontal-gutters{margin-left:-.4375em}.column-group.quarter-horizontal-gutters>.all-auto,.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=large-]{padding-left:.4375em}.column-group.quarter-vertical-gutters>.all-auto,.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=large-]{margin-bottom:.4375em}.column-group.large-gutters{margin-left:-1.75em}.column-group.large-gutters>.all-auto,.column-group.large-gutters>[class*=all-],.column-group.large-gutters>[class*=large-]{padding-left:.4375em;margin-bottom:.4375em}.column-group.large-horizontal-gutters{margin-left:-1.75em}.column-group.large-horizontal-gutters>.all-auto,.column-group.large-horizontal-gutters>[class*=all-],.column-group.large-horizontal-gutters>[class*=large-]{padding-left:1.75em}.column-group.large-vertical-gutters>.all-auto,.column-group.large-vertical-gutters>[class*=all-],.column-group.large-vertical-gutters>[class*=large-]{margin-bottom:1.75em}.column-group.large-double-gutters{margin-left:-3.5em}.column-group.large-double-gutters>.all-auto,.column-group.large-double-gutters>[class*=all-],.column-group.large-double-gutters>[class*=large-]{padding-left:3.5em;margin-bottom:3.5em}.column-group.large-double-horizontal-gutters{margin-left:-3.5em}.column-group.large-double-horizontal-gutters>.all-auto,.column-group.large-double-horizontal-gutters>[class*=all-],.column-group.large-double-horizontal-gutters>[class*=large-]{padding-left:3.5em}.column-group.large-double-vertical-gutters>.all-auto,.column-group.large-double-vertical-gutters>[class*=all-],.column-group.large-double-vertical-gutters>[class*=large-]{margin-bottom:3.5em}.column-group.large-half-gutters{margin-left:-.875em}.column-group.large-half-gutters>.all-auto,.column-group.large-half-gutters>[class*=all-],.column-group.large-half-gutters>[class*=large-]{padding-left:.875em;margin-bottom:.875em}.column-group.large-half-horizontal-gutters{margin-left:-.875em}.column-group.large-half-horizontal-gutters>.all-auto,.column-group.large-half-horizontal-gutters>[class*=all-],.column-group.large-half-horizontal-gutters>[class*=large-]{padding-left:.875em}.column-group.large-half-vertical-gutters>.all-auto,.column-group.large-half-vertical-gutters>[class*=all-],.column-group.large-half-vertical-gutters>[class*=large-]{margin-bottom:.875em}.column-group.large-quarter-gutters{margin-left:-.4375em}.column-group.large-quarter-gutters>.all-auto,.column-group.large-quarter-gutters>[class*=all-],.column-group.large-quarter-gutters>[class*=large-]{padding-left:.4375em;margin-bottom:.4375em}.column-group.large-quarter-horizontal-gutters{margin-left:-.4375em}.column-group.large-quarter-horizontal-gutters>.all-auto,.column-group.large-quarter-horizontal-gutters>[class*=all-],.column-group.large-quarter-horizontal-gutters>[class*=large-]{padding-left:.4375em}.column-group.large-quarter-vertical-gutters>.all-auto,.column-group.large-quarter-vertical-gutters>[class*=all-],.column-group.large-quarter-vertical-gutters>[class*=large-]{margin-bottom:.4375em}.column-group.large-no-gutters{margin-left:0}.column-group.large-no-gutters>.all-auto,.column-group.large-no-gutters>[class*=all-],.column-group.large-no-gutters>[class*=large-]{padding-left:0;margin-bottom:0}.large-5{width:5%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-10{width:10%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-15{width:15%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-16{width:16.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-20{width:20%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-25{width:25%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-30{width:30%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-33{width:33.33333%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-35{width:35%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-40{width:40%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-45{width:45%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-50{width:50%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-55{width:55%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-60{width:60%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-65{width:65%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-66{width:66.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-70{width:70%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-75{width:75%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-80{width:80%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-85{width:85%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-90{width:90%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-95{width:95%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-100{width:100%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.large-auto{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1}.column-group,.ink-flex{display:-webkit-flex;display:flex;display:-ms-flexbox;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;list-style:none}.column-group.large-reverse,.column-group.reverse,.ink-flex.large-reverse,.ink-flex.reverse{-webkit-flex-direction:row-reverse;-moz-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.column-group.large-vertical,.column-group.vertical,.ink-flex.large-vertical,.ink-flex.vertical{-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.column-group.large-vertical.large-reverse,.column-group.vertical.reverse,.ink-flex.large-vertical.large-reverse,.ink-flex.vertical.reverse{-webkit-flex-direction:column-reverse;-moz-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.large-order-1{order:1;-ms-flex-order:1}.large-order-2{order:2;-ms-flex-order:2}.large-order-3{order:3;-ms-flex-order:3}.large-order-4{order:4;-ms-flex-order:4}.large-order-5{order:5;-ms-flex-order:5}.large-order-6{order:6;-ms-flex-order:6}.large-order-7{order:7;-ms-flex-order:7}.large-order-8{order:8;-ms-flex-order:8}.large-order-9{order:9;-ms-flex-order:9}.large-order-10{order:10;-ms-flex-order:10}.column-group .large-auto{-webkit-flex-basis:auto;-ms-flex-basis:auto;flex-basis:auto;-webkit-flex-grow:1;-ms-flex-grow:1;flex-grow:1}.large-push-top,.push-top{-webkit-box-align:start;-webkit-align-items:flex-start;-moz-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start}.large-push-bottom,.push-bottom{-webkit-box-align:end;-webkit-align-items:flex-end;-moz-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end}.large-push-middle,.push-middle{-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-self:flex-center;-ms-flex-item-align:center;align-self:center}.large-push-left,.push-left{-webkit-justify-content:flex-start;-moz-justify-content:flex-start;-ms-justify-content:flex-start;justify-content:flex-start;-ms-flex-pack:start;float:left}.large-push-center,.push-center{float:none!important;-webkit-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;justify-content:center;-ms-flex-pack:center;margin-left:auto;margin-right:auto}.large-push-right,.push-right{-webkit-justify-content:flex-end;-moz-justify-content:flex-end;-ms-justify-content:flex-end;justify-content:flex-end;-ms-flex-pack:end;float:right}.large-align-left{text-align:left}.large-align-center{text-align:center}.large-align-right{text-align:right}.large-space,.space{margin:1.75em}.large-padding,.padding{padding:1.75em}.double-space,.large-double-space{margin:3.5em}.double-padding,.large-double-padding{padding:3.5em}.half-space,.large-half-space{margin:.875em}.half-padding,.large-half-padding{padding:.875em}.large-quarter-space,.quarter-space{margin:.4375em}.large-quarter-padding,.quarter-padding{padding:.4375em}.large-vertical-space,.vertical-space{margin-top:1.75em;margin-bottom:1.75em}.large-vertical-padding,.vertical-padding{padding-top:1.75em;padding-bottom:1.75em}.double-vertical-space,.large-double-vertical-space{margin-top:3.5em;margin-bottom:3.5em}.double-vertical-padding,.large-double-vertical-padding{padding-top:3.5em;padding-bottom:3.5em}.half-vertical-space,.large-half-vertical-space{margin-top:.875em;margin-bottom:.875em}.half-vertical-padding,.large-half-vertical-padding{padding-top:.875em;padding-bottom:.875em}.large-quarter-vertical-space,.quarter-vertical-space{margin-top:.4375em;margin-bottom:.4375em}.large-quarter-vertical-padding,.quarter-vertical-padding{padding-top:.4375em;padding-bottom:.4375em}.horizontal-space,.large-horizontal-space{margin-left:1.75em;margin-right:1.75em}.horizontal-padding,.large-horizontal-padding{padding-left:1.75em;padding-right:1.75em}.double-horizontal-space,.large-double-horizontal-space{margin-left:3.5em;margin-right:3.5em}.double-horizontal-padding,.large-double-horizontal-padding{padding-left:3.5em;padding-right:3.5em}.half-horizontal-space,.large-half-horizontal-space{margin-left:.875em;margin-right:.875em}.half-horizontal-padding,.large-half-horizontal-padding{padding-left:.875em;padding-right:.875em}.large-quarter-horizontal-space,.quarter-horizontal-space{margin-left:.4375em;margin-right:.4375em}.large-quarter-horizontal-padding,.quarter-horizontal-padding{padding-left:.4375em;padding-right:.4375em}.large-top-space,.top-space{margin-top:1.75em}.large-top-padding,.top-padding{padding-top:1.75em}.double-top-space,.large-double-top-space{margin-top:3.5em}.double-top-padding,.large-double-top-padding{padding-top:3.5em}.half-top-space,.large-half-top-space{margin-top:.875em}.half-top-padding,.large-half-top-padding{padding-top:.875em}.large-quarter-top-space,.quarter-top-space{margin-top:.4375em}.large-quarter-top-padding,.quarter-top-padding{padding-top:.4375em}.large-right-space,.right-space{margin-right:1.75em}.large-right-padding,.right-padding{padding-right:1.75em}.double-right-space,.large-double-right-space{margin-right:3.5em}.double-right-padding,.large-double-right-padding{padding-right:3.5em}.half-right-space,.large-half-right-space{margin-right:.875em}.half-right-padding,.large-half-right-padding{padding-right:.875em}.large-quarter-right-space,.quarter-right-space{margin-right:.4375em}.large-quarter-right-padding,.quarter-right-padding{padding-right:.4375em}.bottom-space,.large-bottom-space{margin-bottom:1.75em}.bottom-padding,.large-bottom-padding{padding-bottom:1.75em}.double-bottom-space,.large-double-bottom-space{margin-bottom:3.5em}.double-bottom-padding,.large-double-bottom-padding{padding-bottom:3.5em}.half-bottom-space,.large-half-bottom-space{margin-bottom:.875em}.half-bottom-padding,.large-half-bottom-padding{padding-bottom:.875em}.large-quarter-bottom-space,.quarter-bottom-space{margin-bottom:.4375em}.large-quarter-bottom-padding,.quarter-bottom-padding{padding-bottom:.4375em}.large-left-space,.left-space{margin-left:1.75em}.large-left-padding,.left-padding{padding-left:1.75em}.double-left-space,.large-double-left-space{margin-left:3.5em}.double-left-padding,.large-double-left-padding{padding-left:3.5em}.half-left-space,.large-half-left-space{margin-left:.875em}.half-left-padding,.large-half-left-padding{padding-left:.875em}.large-quarter-left-space,.quarter-left-space{margin-left:.4375em}.large-quarter-left-padding,.quarter-left-padding{padding-left:.4375em}.hide-large{display:none!important}.show-large{display:inherit!important}table.show-large{display:table}thead.show-large{display:table-header-group}tbody.show-large{display:table-row-group}tfoot.show-large{display:table-footer-group}tr.show-large{display:table-row}td.show-large,th.show-large{display:table-cell}}@media screen and (min-width:641px) and (max-width:960px){.ink-grid{padding:0 1.5em}.column-group.gutters{margin-left:-1.5em}.column-group.gutters>.all-auto,.column-group.gutters>[class*=all-],.column-group.gutters>[class*=medium-]{padding-left:1.5em;margin-bottom:1.5em}.column-group.horizontal-gutters{margin-left:-1.5em}.column-group.horizontal-gutters>.all-auto,.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=medium-]{padding-left:1.5em}.column-group.vertical-gutters>.all-auto,.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=medium-]{margin-bottom:1.5em}.column-group.double-gutters{margin-left:-3em}.column-group.double-gutters>.all-auto,.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=medium-]{padding-left:3em;margin-bottom:3em}.column-group.double-horizontal-gutters{margin-left:-3em}.column-group.double-horizontal-gutters>.all-auto,.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=medium-]{padding-left:3em}.column-group.double-vertical-gutters>.all-auto,.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=medium-]{margin-bottom:3em}.column-group.half-gutters{margin-left:-.75em}.column-group.half-gutters>.all-auto,.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=medium-]{padding-left:.75em;margin-bottom:.75em}.column-group.half-horizontal-gutters{margin-left:-.75em}.column-group.half-horizontal-gutters>.all-auto,.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=medium-]{padding-left:.75em}.column-group.half-vertical-gutters>.all-auto,.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=medium-]{margin-bottom:.75em}.column-group.quarter-gutters{margin-left:-.375em}.column-group.quarter-gutters>.all-auto,.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=medium-]{padding-left:.375em;margin-bottom:.375em}.column-group.quarter-horizontal-gutters{margin-left:-.375em}.column-group.quarter-horizontal-gutters>.all-auto,.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=medium-]{padding-left:.375em}.column-group.quarter-vertical-gutters>.all-auto,.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=medium-]{margin-bottom:.375em}.column-group.medium-gutters{margin-left:-1.5em}.column-group.medium-gutters>.all-auto,.column-group.medium-gutters>[class*=all-],.column-group.medium-gutters>[class*=medium-]{padding-left:.375em;margin-bottom:.375em}.column-group.medium-horizontal-gutters{margin-left:-1.5em}.column-group.medium-horizontal-gutters>.all-auto,.column-group.medium-horizontal-gutters>[class*=all-],.column-group.medium-horizontal-gutters>[class*=medium-]{padding-left:1.5em}.column-group.medium-vertical-gutters>.all-auto,.column-group.medium-vertical-gutters>[class*=all-],.column-group.medium-vertical-gutters>[class*=medium-]{margin-bottom:1.5em}.column-group.medium-double-gutters{margin-left:-3em}.column-group.medium-double-gutters>.all-auto,.column-group.medium-double-gutters>[class*=all-],.column-group.medium-double-gutters>[class*=medium-]{padding-left:3em;margin-bottom:3em}.column-group.medium-double-horizontal-gutters{margin-left:-3em}.column-group.medium-double-horizontal-gutters>.all-auto,.column-group.medium-double-horizontal-gutters>[class*=all-],.column-group.medium-double-horizontal-gutters>[class*=medium-]{padding-left:3em}.column-group.medium-double-vertical-gutters>.all-auto,.column-group.medium-double-vertical-gutters>[class*=all-],.column-group.medium-double-vertical-gutters>[class*=medium-]{margin-bottom:3em}.column-group.medium-half-gutters{margin-left:-.75em}.column-group.medium-half-gutters>.all-auto,.column-group.medium-half-gutters>[class*=all-],.column-group.medium-half-gutters>[class*=medium-]{padding-left:.75em;margin-bottom:.75em}.column-group.medium-half-horizontal-gutters{margin-left:-.75em}.column-group.medium-half-horizontal-gutters>.all-auto,.column-group.medium-half-horizontal-gutters>[class*=all-],.column-group.medium-half-horizontal-gutters>[class*=medium-]{padding-left:.75em}.column-group.medium-half-vertical-gutters>.all-auto,.column-group.medium-half-vertical-gutters>[class*=all-],.column-group.medium-half-vertical-gutters>[class*=medium-]{margin-bottom:.75em}.column-group.medium-quarter-gutters{margin-left:-.375em}.column-group.medium-quarter-gutters>.all-auto,.column-group.medium-quarter-gutters>[class*=all-],.column-group.medium-quarter-gutters>[class*=medium-]{padding-left:.375em;margin-bottom:.375em}.column-group.medium-quarter-horizontal-gutters{margin-left:-.375em}.column-group.medium-quarter-horizontal-gutters>.all-auto,.column-group.medium-quarter-horizontal-gutters>[class*=all-],.column-group.medium-quarter-horizontal-gutters>[class*=medium-]{padding-left:.375em}.column-group.medium-quarter-vertical-gutters>.all-auto,.column-group.medium-quarter-vertical-gutters>[class*=all-],.column-group.medium-quarter-vertical-gutters>[class*=medium-]{margin-bottom:.375em}.column-group.medium-no-gutters{margin-left:0}.column-group.medium-no-gutters>.all-auto,.column-group.medium-no-gutters>[class*=all-],.column-group.medium-no-gutters>[class*=medium-]{padding-left:0;margin-bottom:0}.medium-5{width:5%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-10{width:10%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-15{width:15%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-16{width:16.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-20{width:20%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-25{width:25%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-30{width:30%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-33{width:33.33333%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-35{width:35%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-40{width:40%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-45{width:45%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-50{width:50%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-55{width:55%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-60{width:60%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-65{width:65%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-66{width:66.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-70{width:70%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-75{width:75%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-80{width:80%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-85{width:85%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-90{width:90%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-95{width:95%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-100{width:100%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.medium-auto{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1}.column-group,.ink-flex{display:-webkit-flex;display:flex;display:-ms-flexbox;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;list-style:none}.column-group.medium-reverse,.column-group.reverse,.ink-flex.medium-reverse,.ink-flex.reverse{-webkit-flex-direction:row-reverse;-moz-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.column-group.medium-vertical,.column-group.vertical,.ink-flex.medium-vertical,.ink-flex.vertical{-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.column-group.medium-vertical.medium-reverse,.column-group.vertical.reverse,.ink-flex.medium-vertical.medium-reverse,.ink-flex.vertical.reverse{-webkit-flex-direction:column-reverse;-moz-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.medium-order-1{order:1;-ms-flex-order:1}.medium-order-2{order:2;-ms-flex-order:2}.medium-order-3{order:3;-ms-flex-order:3}.medium-order-4{order:4;-ms-flex-order:4}.medium-order-5{order:5;-ms-flex-order:5}.medium-order-6{order:6;-ms-flex-order:6}.medium-order-7{order:7;-ms-flex-order:7}.medium-order-8{order:8;-ms-flex-order:8}.medium-order-9{order:9;-ms-flex-order:9}.medium-order-10{order:10;-ms-flex-order:10}.column-group .medium-auto{-webkit-flex-basis:auto;-ms-flex-basis:auto;flex-basis:auto;-webkit-flex-grow:1;-ms-flex-grow:1;flex-grow:1}.medium-push-top,.push-top{-webkit-box-align:start;-webkit-align-items:flex-start;-moz-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start}.medium-push-bottom,.push-bottom{-webkit-box-align:end;-webkit-align-items:flex-end;-moz-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end}.medium-push-middle,.push-middle{-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-self:flex-center;-ms-flex-item-align:center;align-self:center}.medium-push-left,.push-left{-webkit-justify-content:flex-start;-moz-justify-content:flex-start;-ms-justify-content:flex-start;justify-content:flex-start;-ms-flex-pack:start;float:left}.medium-push-center,.push-center{float:none!important;-webkit-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;justify-content:center;-ms-flex-pack:center;margin-left:auto;margin-right:auto}.medium-push-right,.push-right{-webkit-justify-content:flex-end;-moz-justify-content:flex-end;-ms-justify-content:flex-end;justify-content:flex-end;-ms-flex-pack:end;float:right}.medium-align-left{text-align:left}.medium-align-center{text-align:center}.medium-align-right{text-align:right}.medium-space,.space{margin:1.5em}.medium-padding,.padding{padding:1.5em}.double-space,.medium-double-space{margin:3em}.double-padding,.medium-double-padding{padding:3em}.half-space,.medium-half-space{margin:.75em}.half-padding,.medium-half-padding{padding:.75em}.medium-quarter-space,.quarter-space{margin:.375em}.medium-quarter-padding,.quarter-padding{padding:.375em}.medium-vertical-space,.vertical-space{margin-top:1.5em;margin-bottom:1.5em}.medium-vertical-padding,.vertical-padding{padding-top:1.5em;padding-bottom:1.5em}.double-vertical-space,.medium-double-vertical-space{margin-top:3em;margin-bottom:3em}.double-vertical-padding,.medium-double-vertical-padding{padding-top:3em;padding-bottom:3em}.half-vertical-space,.medium-half-vertical-space{margin-top:.75em;margin-bottom:.75em}.half-vertical-padding,.medium-half-vertical-padding{padding-top:.75em;padding-bottom:.75em}.medium-quarter-vertical-space,.quarter-vertical-space{margin-top:.375em;margin-bottom:.375em}.medium-quarter-vertical-padding,.quarter-vertical-padding{padding-top:.375em;padding-bottom:.375em}.horizontal-space,.medium-horizontal-space{margin-left:1.5em;margin-right:1.5em}.horizontal-padding,.medium-horizontal-padding{padding-left:1.5em;padding-right:1.5em}.double-horizontal-space,.medium-double-horizontal-space{margin-left:3em;margin-right:3em}.double-horizontal-padding,.medium-double-horizontal-padding{padding-left:3em;padding-right:3em}.half-horizontal-space,.medium-half-horizontal-space{margin-left:.75em;margin-right:.75em}.half-horizontal-padding,.medium-half-horizontal-padding{padding-left:.75em;padding-right:.75em}.medium-quarter-horizontal-space,.quarter-horizontal-space{margin-left:.375em;margin-right:.375em}.medium-quarter-horizontal-padding,.quarter-horizontal-padding{padding-left:.375em;padding-right:.375em}.medium-top-space,.top-space{margin-top:1.5em}.medium-top-padding,.top-padding{padding-top:1.5em}.double-top-space,.medium-double-top-space{margin-top:3em}.double-top-padding,.medium-double-top-padding{padding-top:3em}.half-top-space,.medium-half-top-space{margin-top:.75em}.half-top-padding,.medium-half-top-padding{padding-top:.75em}.medium-quarter-top-space,.quarter-top-space{margin-top:.375em}.medium-quarter-top-padding,.quarter-top-padding{padding-top:.375em}.medium-right-space,.right-space{margin-right:1.5em}.medium-right-padding,.right-padding{padding-right:1.5em}.double-right-space,.medium-double-right-space{margin-right:3em}.double-right-padding,.medium-double-right-padding{padding-right:3em}.half-right-space,.medium-half-right-space{margin-right:.75em}.half-right-padding,.medium-half-right-padding{padding-right:.75em}.medium-quarter-right-space,.quarter-right-space{margin-right:.375em}.medium-quarter-right-padding,.quarter-right-padding{padding-right:.375em}.bottom-space,.medium-bottom-space{margin-bottom:1.5em}.bottom-padding,.medium-bottom-padding{padding-bottom:1.5em}.double-bottom-space,.medium-double-bottom-space{margin-bottom:3em}.double-bottom-padding,.medium-double-bottom-padding{padding-bottom:3em}.half-bottom-space,.medium-half-bottom-space{margin-bottom:.75em}.half-bottom-padding,.medium-half-bottom-padding{padding-bottom:.75em}.medium-quarter-bottom-space,.quarter-bottom-space{margin-bottom:.375em}.medium-quarter-bottom-padding,.quarter-bottom-padding{padding-bottom:.375em}.left-space,.medium-left-space{margin-left:1.5em}.left-padding,.medium-left-padding{padding-left:1.5em}.double-left-space,.medium-double-left-space{margin-left:3em}.double-left-padding,.medium-double-left-padding{padding-left:3em}.half-left-space,.medium-half-left-space{margin-left:.75em}.half-left-padding,.medium-half-left-padding{padding-left:.75em}.medium-quarter-left-space,.quarter-left-space{margin-left:.375em}.medium-quarter-left-padding,.quarter-left-padding{padding-left:.375em}.hide-medium{display:none!important}.show-medium{display:inherit!important}table.show-medium{display:table}thead.show-medium{display:table-header-group}tbody.show-medium{display:table-row-group}tfoot.show-medium{display:table-footer-group}tr.show-medium{display:table-row}td.show-medium,th.show-medium{display:table-cell}}@media screen and (min-width:321px) and (max-width:640px){.ink-grid{padding:0 1.25em}.column-group.gutters{margin-left:-1.25em}.column-group.gutters>.all-auto,.column-group.gutters>[class*=all-],.column-group.gutters>[class*=small-]{padding-left:1.25em;margin-bottom:1.25em}.column-group.horizontal-gutters{margin-left:-1.25em}.column-group.horizontal-gutters>.all-auto,.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=small-]{padding-left:1.25em}.column-group.vertical-gutters>.all-auto,.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=small-]{margin-bottom:1.25em}.column-group.double-gutters{margin-left:-2.5em}.column-group.double-gutters>.all-auto,.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=small-]{padding-left:2.5em;margin-bottom:2.5em}.column-group.double-horizontal-gutters{margin-left:-2.5em}.column-group.double-horizontal-gutters>.all-auto,.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=small-]{padding-left:2.5em}.column-group.double-vertical-gutters>.all-auto,.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=small-]{margin-bottom:2.5em}.column-group.half-gutters{margin-left:-.625em}.column-group.half-gutters>.all-auto,.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=small-]{padding-left:.625em;margin-bottom:.625em}.column-group.half-horizontal-gutters{margin-left:-.625em}.column-group.half-horizontal-gutters>.all-auto,.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=small-]{padding-left:.625em}.column-group.half-vertical-gutters>.all-auto,.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=small-]{margin-bottom:.625em}.column-group.quarter-gutters{margin-left:-.3125em}.column-group.quarter-gutters>.all-auto,.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=small-]{padding-left:.3125em;margin-bottom:.3125em}.column-group.quarter-horizontal-gutters{margin-left:-.3125em}.column-group.quarter-horizontal-gutters>.all-auto,.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=small-]{padding-left:.3125em}.column-group.quarter-vertical-gutters>.all-auto,.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=small-]{margin-bottom:.3125em}.column-group.small-gutters{margin-left:-1.25em}.column-group.small-gutters>.all-auto,.column-group.small-gutters>[class*=all-],.column-group.small-gutters>[class*=small-]{padding-left:.3125em;margin-bottom:.3125em}.column-group.small-horizontal-gutters{margin-left:-1.25em}.column-group.small-horizontal-gutters>.all-auto,.column-group.small-horizontal-gutters>[class*=all-],.column-group.small-horizontal-gutters>[class*=small-]{padding-left:1.25em}.column-group.small-vertical-gutters>.all-auto,.column-group.small-vertical-gutters>[class*=all-],.column-group.small-vertical-gutters>[class*=small-]{margin-bottom:1.25em}.column-group.small-double-gutters{margin-left:-2.5em}.column-group.small-double-gutters>.all-auto,.column-group.small-double-gutters>[class*=all-],.column-group.small-double-gutters>[class*=small-]{padding-left:2.5em;margin-bottom:2.5em}.column-group.small-double-horizontal-gutters{margin-left:-2.5em}.column-group.small-double-horizontal-gutters>.all-auto,.column-group.small-double-horizontal-gutters>[class*=all-],.column-group.small-double-horizontal-gutters>[class*=small-]{padding-left:2.5em}.column-group.small-double-vertical-gutters>.all-auto,.column-group.small-double-vertical-gutters>[class*=all-],.column-group.small-double-vertical-gutters>[class*=small-]{margin-bottom:2.5em}.column-group.small-half-gutters{margin-left:-.625em}.column-group.small-half-gutters>.all-auto,.column-group.small-half-gutters>[class*=all-],.column-group.small-half-gutters>[class*=small-]{padding-left:.625em;margin-bottom:.625em}.column-group.small-half-horizontal-gutters{margin-left:-.625em}.column-group.small-half-horizontal-gutters>.all-auto,.column-group.small-half-horizontal-gutters>[class*=all-],.column-group.small-half-horizontal-gutters>[class*=small-]{padding-left:.625em}.column-group.small-half-vertical-gutters>.all-auto,.column-group.small-half-vertical-gutters>[class*=all-],.column-group.small-half-vertical-gutters>[class*=small-]{margin-bottom:.625em}.column-group.small-quarter-gutters{margin-left:-.3125em}.column-group.small-quarter-gutters>.all-auto,.column-group.small-quarter-gutters>[class*=all-],.column-group.small-quarter-gutters>[class*=small-]{padding-left:.3125em;margin-bottom:.3125em}.column-group.small-quarter-horizontal-gutters{margin-left:-.3125em}.column-group.small-quarter-horizontal-gutters>.all-auto,.column-group.small-quarter-horizontal-gutters>[class*=all-],.column-group.small-quarter-horizontal-gutters>[class*=small-]{padding-left:.3125em}.column-group.small-quarter-vertical-gutters>.all-auto,.column-group.small-quarter-vertical-gutters>[class*=all-],.column-group.small-quarter-vertical-gutters>[class*=small-]{margin-bottom:.3125em}.column-group.small-no-gutters{margin-left:0}.column-group.small-no-gutters>.all-auto,.column-group.small-no-gutters>[class*=all-],.column-group.small-no-gutters>[class*=small-]{padding-left:0;margin-bottom:0}.small-5{width:5%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-10{width:10%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-15{width:15%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-16{width:16.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-20{width:20%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-25{width:25%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-30{width:30%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-33{width:33.33333%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-35{width:35%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-40{width:40%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-45{width:45%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-50{width:50%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-55{width:55%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-60{width:60%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-65{width:65%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-66{width:66.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-70{width:70%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-75{width:75%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-80{width:80%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-85{width:85%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-90{width:90%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-95{width:95%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-100{width:100%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.small-auto{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1}.column-group,.ink-flex{display:-webkit-flex;display:flex;display:-ms-flexbox;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;list-style:none}.column-group.reverse,.column-group.small-reverse,.ink-flex.reverse,.ink-flex.small-reverse{-webkit-flex-direction:row-reverse;-moz-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.column-group.small-vertical,.column-group.vertical,.ink-flex.small-vertical,.ink-flex.vertical{-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.column-group.small-vertical.small-reverse,.column-group.vertical.reverse,.ink-flex.small-vertical.small-reverse,.ink-flex.vertical.reverse{-webkit-flex-direction:column-reverse;-moz-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.small-order-1{order:1;-ms-flex-order:1}.small-order-2{order:2;-ms-flex-order:2}.small-order-3{order:3;-ms-flex-order:3}.small-order-4{order:4;-ms-flex-order:4}.small-order-5{order:5;-ms-flex-order:5}.small-order-6{order:6;-ms-flex-order:6}.small-order-7{order:7;-ms-flex-order:7}.small-order-8{order:8;-ms-flex-order:8}.small-order-9{order:9;-ms-flex-order:9}.small-order-10{order:10;-ms-flex-order:10}.column-group .small-auto{-webkit-flex-basis:auto;-ms-flex-basis:auto;flex-basis:auto;-webkit-flex-grow:1;-ms-flex-grow:1;flex-grow:1}.push-top,.small-push-top{-webkit-box-align:start;-webkit-align-items:flex-start;-moz-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start}.push-bottom,.small-push-bottom{-webkit-box-align:end;-webkit-align-items:flex-end;-moz-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end}.push-middle,.small-push-middle{-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-self:flex-center;-ms-flex-item-align:center;align-self:center}.push-left,.small-push-left{-webkit-justify-content:flex-start;-moz-justify-content:flex-start;-ms-justify-content:flex-start;justify-content:flex-start;-ms-flex-pack:start;float:left}.push-center,.small-push-center{float:none!important;-webkit-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;justify-content:center;-ms-flex-pack:center;margin-left:auto;margin-right:auto}.push-right,.small-push-right{-webkit-justify-content:flex-end;-moz-justify-content:flex-end;-ms-justify-content:flex-end;justify-content:flex-end;-ms-flex-pack:end;float:right}.small-align-left{text-align:left}.small-align-center{text-align:center}.small-align-right{text-align:right}.small-space,.space{margin:1.25em}.padding,.small-padding{padding:1.25em}.double-space,.small-double-space{margin:2.5em}.double-padding,.small-double-padding{padding:2.5em}.half-space,.small-half-space{margin:.625em}.half-padding,.small-half-padding{padding:.625em}.quarter-space,.small-quarter-space{margin:.3125em}.quarter-padding,.small-quarter-padding{padding:.3125em}.small-vertical-space,.vertical-space{margin-top:1.25em;margin-bottom:1.25em}.small-vertical-padding,.vertical-padding{padding-top:1.25em;padding-bottom:1.25em}.double-vertical-space,.small-double-vertical-space{margin-top:2.5em;margin-bottom:2.5em}.double-vertical-padding,.small-double-vertical-padding{padding-top:2.5em;padding-bottom:2.5em}.half-vertical-space,.small-half-vertical-space{margin-top:.625em;margin-bottom:.625em}.half-vertical-padding,.small-half-vertical-padding{padding-top:.625em;padding-bottom:.625em}.quarter-vertical-space,.small-quarter-vertical-space{margin-top:.3125em;margin-bottom:.3125em}.quarter-vertical-padding,.small-quarter-vertical-padding{padding-top:.3125em;padding-bottom:.3125em}.horizontal-space,.small-horizontal-space{margin-left:1.25em;margin-right:1.25em}.horizontal-padding,.small-horizontal-padding{padding-left:1.25em;padding-right:1.25em}.double-horizontal-space,.small-double-horizontal-space{margin-left:2.5em;margin-right:2.5em}.double-horizontal-padding,.small-double-horizontal-padding{padding-left:2.5em;padding-right:2.5em}.half-horizontal-space,.small-half-horizontal-space{margin-left:.625em;margin-right:.625em}.half-horizontal-padding,.small-half-horizontal-padding{padding-left:.625em;padding-right:.625em}.quarter-horizontal-space,.small-quarter-horizontal-space{margin-left:.3125em;margin-right:.3125em}.quarter-horizontal-padding,.small-quarter-horizontal-padding{padding-left:.3125em;padding-right:.3125em}.small-top-space,.top-space{margin-top:1.25em}.small-top-padding,.top-padding{padding-top:1.25em}.double-top-space,.small-double-top-space{margin-top:2.5em}.double-top-padding,.small-double-top-padding{padding-top:2.5em}.half-top-space,.small-half-top-space{margin-top:.625em}.half-top-padding,.small-half-top-padding{padding-top:.625em}.quarter-top-space,.small-quarter-top-space{margin-top:.3125em}.quarter-top-padding,.small-quarter-top-padding{padding-top:.3125em}.right-space,.small-right-space{margin-right:1.25em}.right-padding,.small-right-padding{padding-right:1.25em}.double-right-space,.small-double-right-space{margin-right:2.5em}.double-right-padding,.small-double-right-padding{padding-right:2.5em}.half-right-space,.small-half-right-space{margin-right:.625em}.half-right-padding,.small-half-right-padding{padding-right:.625em}.quarter-right-space,.small-quarter-right-space{margin-right:.3125em}.quarter-right-padding,.small-quarter-right-padding{padding-right:.3125em}.bottom-space,.small-bottom-space{margin-bottom:1.25em}.bottom-padding,.small-bottom-padding{padding-bottom:1.25em}.double-bottom-space,.small-double-bottom-space{margin-bottom:2.5em}.double-bottom-padding,.small-double-bottom-padding{padding-bottom:2.5em}.half-bottom-space,.small-half-bottom-space{margin-bottom:.625em}.half-bottom-padding,.small-half-bottom-padding{padding-bottom:.625em}.quarter-bottom-space,.small-quarter-bottom-space{margin-bottom:.3125em}.quarter-bottom-padding,.small-quarter-bottom-padding{padding-bottom:.3125em}.left-space,.small-left-space{margin-left:1.25em}.left-padding,.small-left-padding{padding-left:1.25em}.double-left-space,.small-double-left-space{margin-left:2.5em}.double-left-padding,.small-double-left-padding{padding-left:2.5em}.half-left-space,.small-half-left-space{margin-left:.625em}.half-left-padding,.small-half-left-padding{padding-left:.625em}.quarter-left-space,.small-quarter-left-space{margin-left:.3125em}.quarter-left-padding,.small-quarter-left-padding{padding-left:.3125em}.hide-small{display:none!important}.show-small{display:inherit!important}table.show-small{display:table}thead.show-small{display:table-header-group}tbody.show-small{display:table-row-group}tfoot.show-small{display:table-footer-group}tr.show-small{display:table-row}td.show-small,th.show-small{display:table-cell}}@media screen and (max-width:320px){.ink-grid{padding:0 1em}.column-group.gutters{margin-left:-1em}.column-group.gutters>.all-auto,.column-group.gutters>[class*=all-],.column-group.gutters>[class*=tiny-]{padding-left:1em;margin-bottom:1em}.column-group.horizontal-gutters{margin-left:-1em}.column-group.horizontal-gutters>.all-auto,.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=tiny-]{padding-left:1em}.column-group.vertical-gutters>.all-auto,.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=tiny-]{margin-bottom:1em}.column-group.double-gutters{margin-left:-2em}.column-group.double-gutters>.all-auto,.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=tiny-]{padding-left:2em;margin-bottom:2em}.column-group.double-horizontal-gutters{margin-left:-2em}.column-group.double-horizontal-gutters>.all-auto,.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=tiny-]{padding-left:2em}.column-group.double-vertical-gutters>.all-auto,.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=tiny-]{margin-bottom:2em}.column-group.half-gutters{margin-left:-.5em}.column-group.half-gutters>.all-auto,.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=tiny-]{padding-left:.5em;margin-bottom:.5em}.column-group.half-horizontal-gutters{margin-left:-.5em}.column-group.half-horizontal-gutters>.all-auto,.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=tiny-]{padding-left:.5em}.column-group.half-vertical-gutters>.all-auto,.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=tiny-]{margin-bottom:.5em}.column-group.quarter-gutters{margin-left:-.25em}.column-group.quarter-gutters>.all-auto,.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=tiny-]{padding-left:.25em;margin-bottom:.25em}.column-group.quarter-horizontal-gutters{margin-left:-.25em}.column-group.quarter-horizontal-gutters>.all-auto,.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=tiny-]{padding-left:.25em}.column-group.quarter-vertical-gutters>.all-auto,.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=tiny-]{margin-bottom:.25em}.column-group.tiny-gutters{margin-left:-1em}.column-group.tiny-gutters>.all-auto,.column-group.tiny-gutters>[class*=all-],.column-group.tiny-gutters>[class*=tiny-]{padding-left:.25em;margin-bottom:.25em}.column-group.tiny-horizontal-gutters{margin-left:-1em}.column-group.tiny-horizontal-gutters>.all-auto,.column-group.tiny-horizontal-gutters>[class*=all-],.column-group.tiny-horizontal-gutters>[class*=tiny-]{padding-left:1em}.column-group.tiny-vertical-gutters>.all-auto,.column-group.tiny-vertical-gutters>[class*=all-],.column-group.tiny-vertical-gutters>[class*=tiny-]{margin-bottom:1em}.column-group.tiny-double-gutters{margin-left:-2em}.column-group.tiny-double-gutters>.all-auto,.column-group.tiny-double-gutters>[class*=all-],.column-group.tiny-double-gutters>[class*=tiny-]{padding-left:2em;margin-bottom:2em}.column-group.tiny-double-horizontal-gutters{margin-left:-2em}.column-group.tiny-double-horizontal-gutters>.all-auto,.column-group.tiny-double-horizontal-gutters>[class*=all-],.column-group.tiny-double-horizontal-gutters>[class*=tiny-]{padding-left:2em}.column-group.tiny-double-vertical-gutters>.all-auto,.column-group.tiny-double-vertical-gutters>[class*=all-],.column-group.tiny-double-vertical-gutters>[class*=tiny-]{margin-bottom:2em}.column-group.tiny-half-gutters{margin-left:-.5em}.column-group.tiny-half-gutters>.all-auto,.column-group.tiny-half-gutters>[class*=all-],.column-group.tiny-half-gutters>[class*=tiny-]{padding-left:.5em;margin-bottom:.5em}.column-group.tiny-half-horizontal-gutters{margin-left:-.5em}.column-group.tiny-half-horizontal-gutters>.all-auto,.column-group.tiny-half-horizontal-gutters>[class*=all-],.column-group.tiny-half-horizontal-gutters>[class*=tiny-]{padding-left:.5em}.column-group.tiny-half-vertical-gutters>.all-auto,.column-group.tiny-half-vertical-gutters>[class*=all-],.column-group.tiny-half-vertical-gutters>[class*=tiny-]{margin-bottom:.5em}.column-group.tiny-quarter-gutters{margin-left:-.25em}.column-group.tiny-quarter-gutters>.all-auto,.column-group.tiny-quarter-gutters>[class*=all-],.column-group.tiny-quarter-gutters>[class*=tiny-]{padding-left:.25em;margin-bottom:.25em}.column-group.tiny-quarter-horizontal-gutters{margin-left:-.25em}.column-group.tiny-quarter-horizontal-gutters>.all-auto,.column-group.tiny-quarter-horizontal-gutters>[class*=all-],.column-group.tiny-quarter-horizontal-gutters>[class*=tiny-]{padding-left:.25em}.column-group.tiny-quarter-vertical-gutters>.all-auto,.column-group.tiny-quarter-vertical-gutters>[class*=all-],.column-group.tiny-quarter-vertical-gutters>[class*=tiny-]{margin-bottom:.25em}.column-group.tiny-no-gutters{margin-left:0}.column-group.tiny-no-gutters>.all-auto,.column-group.tiny-no-gutters>[class*=all-],.column-group.tiny-no-gutters>[class*=tiny-]{padding-left:0;margin-bottom:0}.tiny-5{width:5%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-10{width:10%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-15{width:15%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-16{width:16.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-20{width:20%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-25{width:25%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-30{width:30%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-33{width:33.33333%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-35{width:35%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-40{width:40%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-45{width:45%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-50{width:50%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-55{width:55%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-60{width:60%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-65{width:65%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-66{width:66.66666%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-70{width:70%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-75{width:75%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-80{width:80%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-85{width:85%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-90{width:90%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-95{width:95%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-100{width:100%;-webkit-flex-grow:0;-ms-flex-grow:0;flex-grow:0}.tiny-auto{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1}.column-group,.ink-flex{display:-webkit-flex;display:flex;display:-ms-flexbox;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;list-style:none}.column-group.reverse,.column-group.tiny-reverse,.ink-flex.reverse,.ink-flex.tiny-reverse{-webkit-flex-direction:row-reverse;-moz-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.column-group.tiny-vertical,.column-group.vertical,.ink-flex.tiny-vertical,.ink-flex.vertical{-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.column-group.tiny-vertical.tiny-reverse,.column-group.vertical.reverse,.ink-flex.tiny-vertical.tiny-reverse,.ink-flex.vertical.reverse{-webkit-flex-direction:column-reverse;-moz-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.tiny-order-1{order:1;-ms-flex-order:1}.tiny-order-2{order:2;-ms-flex-order:2}.tiny-order-3{order:3;-ms-flex-order:3}.tiny-order-4{order:4;-ms-flex-order:4}.tiny-order-5{order:5;-ms-flex-order:5}.tiny-order-6{order:6;-ms-flex-order:6}.tiny-order-7{order:7;-ms-flex-order:7}.tiny-order-8{order:8;-ms-flex-order:8}.tiny-order-9{order:9;-ms-flex-order:9}.tiny-order-10{order:10;-ms-flex-order:10}.column-group .tiny-auto{-webkit-flex-basis:auto;-ms-flex-basis:auto;flex-basis:auto;-webkit-flex-grow:1;-ms-flex-grow:1;flex-grow:1}.push-top,.tiny-push-top{-webkit-box-align:start;-webkit-align-items:flex-start;-moz-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start}.push-bottom,.tiny-push-bottom{-webkit-box-align:end;-webkit-align-items:flex-end;-moz-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end}.push-middle,.tiny-push-middle{-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-self:flex-center;-ms-flex-item-align:center;align-self:center}.push-left,.tiny-push-left{-webkit-justify-content:flex-start;-moz-justify-content:flex-start;-ms-justify-content:flex-start;justify-content:flex-start;-ms-flex-pack:start;float:left}.push-center,.tiny-push-center{float:none!important;-webkit-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;justify-content:center;-ms-flex-pack:center;margin-left:auto;margin-right:auto}.push-right,.tiny-push-right{-webkit-justify-content:flex-end;-moz-justify-content:flex-end;-ms-justify-content:flex-end;justify-content:flex-end;-ms-flex-pack:end;float:right}.tiny-align-left{text-align:left}.tiny-align-center{text-align:center}.tiny-align-right{text-align:right}.space,.tiny-space{margin:1em}.padding,.tiny-padding{padding:1em}.double-space,.tiny-double-space{margin:2em}.double-padding,.tiny-double-padding{padding:2em}.half-space,.tiny-half-space{margin:.5em}.half-padding,.tiny-half-padding{padding:.5em}.quarter-space,.tiny-quarter-space{margin:.25em}.quarter-padding,.tiny-quarter-padding{padding:.25em}.tiny-vertical-space,.vertical-space{margin-top:1em;margin-bottom:1em}.tiny-vertical-padding,.vertical-padding{padding-top:1em;padding-bottom:1em}.double-vertical-space,.tiny-double-vertical-space{margin-top:2em;margin-bottom:2em}.double-vertical-padding,.tiny-double-vertical-padding{padding-top:2em;padding-bottom:2em}.half-vertical-space,.tiny-half-vertical-space{margin-top:.5em;margin-bottom:.5em}.half-vertical-padding,.tiny-half-vertical-padding{padding-top:.5em;padding-bottom:.5em}.quarter-vertical-space,.tiny-quarter-vertical-space{margin-top:.25em;margin-bottom:.25em}.quarter-vertical-padding,.tiny-quarter-vertical-padding{padding-top:.25em;padding-bottom:.25em}.horizontal-space,.tiny-horizontal-space{margin-left:1em;margin-right:1em}.horizontal-padding,.tiny-horizontal-padding{padding-left:1em;padding-right:1em}.double-horizontal-space,.tiny-double-horizontal-space{margin-left:2em;margin-right:2em}.double-horizontal-padding,.tiny-double-horizontal-padding{padding-left:2em;padding-right:2em}.half-horizontal-space,.tiny-half-horizontal-space{margin-left:.5em;margin-right:.5em}.half-horizontal-padding,.tiny-half-horizontal-padding{padding-left:.5em;padding-right:.5em}.quarter-horizontal-space,.tiny-quarter-horizontal-space{margin-left:.25em;margin-right:.25em}.quarter-horizontal-padding,.tiny-quarter-horizontal-padding{padding-left:.25em;padding-right:.25em}.tiny-top-space,.top-space{margin-top:1em}.tiny-top-padding,.top-padding{padding-top:1em}.double-top-space,.tiny-double-top-space{margin-top:2em}.double-top-padding,.tiny-double-top-padding{padding-top:2em}.half-top-space,.tiny-half-top-space{margin-top:.5em}.half-top-padding,.tiny-half-top-padding{padding-top:.5em}.quarter-top-space,.tiny-quarter-top-space{margin-top:.25em}.quarter-top-padding,.tiny-quarter-top-padding{padding-top:.25em}.right-space,.tiny-right-space{margin-right:1em}.right-padding,.tiny-right-padding{padding-right:1em}.double-right-space,.tiny-double-right-space{margin-right:2em}.double-right-padding,.tiny-double-right-padding{padding-right:2em}.half-right-space,.tiny-half-right-space{margin-right:.5em}.half-right-padding,.tiny-half-right-padding{padding-right:.5em}.quarter-right-space,.tiny-quarter-right-space{margin-right:.25em}.quarter-right-padding,.tiny-quarter-right-padding{padding-right:.25em}.bottom-space,.tiny-bottom-space{margin-bottom:1em}.bottom-padding,.tiny-bottom-padding{padding-bottom:1em}.double-bottom-space,.tiny-double-bottom-space{margin-bottom:2em}.double-bottom-padding,.tiny-double-bottom-padding{padding-bottom:2em}.half-bottom-space,.tiny-half-bottom-space{margin-bottom:.5em}.half-bottom-padding,.tiny-half-bottom-padding{padding-bottom:.5em}.quarter-bottom-space,.tiny-quarter-bottom-space{margin-bottom:.25em}.quarter-bottom-padding,.tiny-quarter-bottom-padding{padding-bottom:.25em}.left-space,.tiny-left-space{margin-left:1em}.left-padding,.tiny-left-padding{padding-left:1em}.double-left-space,.tiny-double-left-space{margin-left:2em}.double-left-padding,.tiny-double-left-padding{padding-left:2em}.half-left-space,.tiny-half-left-space{margin-left:.5em}.half-left-padding,.tiny-half-left-padding{padding-left:.5em}.quarter-left-space,.tiny-quarter-left-space{margin-left:.25em}.quarter-left-padding,.tiny-quarter-left-padding{padding-left:.25em}.hide-tiny{display:none!important}.show-tiny{display:inherit!important}table.show-tiny{display:table}thead.show-tiny{display:table-header-group}tbody.show-tiny{display:table-row-group}tfoot.show-tiny{display:table-footer-group}tr.show-tiny{display:table-row}td.show-tiny,th.show-tiny{display:table-cell}}@media screen and (min-width:1261px){html{font-size:1.08em}html:after{content:'[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]';display:none}}@media screen and (min-width:961px) and (max-width:1260px){html{font-size:1.05em}html:after{content:'[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]';display:none}}@media screen and (min-width:641px) and (max-width:960px){html{font-size:1em}html:after{content:'[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]';display:none}}@media screen and (min-width:321px) and (max-width:640px){html{font-size:.98em}html:after{content:'[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]';display:none}}@media screen and (max-width:320px){html{font-size:.97em}html:after{content:'[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]';display:none}}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-thin-webfont.eot);src:url(../fonts/Roboto/roboto-thin-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-thin-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-thin-webfont.ttf) format('truetype');font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-thinitalic-webfont.eot);src:url(../fonts/Roboto/roboto-thinitalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-thinitalic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-thinitalic-webfont.ttf) format('truetype');font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-light-webfont.eot);src:url(../fonts/Roboto/roboto-light-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-light-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-light-webfont.ttf) format('truetype');font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-lightitalic-webfont.eot);src:url(../fonts/Roboto/roboto-lightitalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-lightitalic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-lightitalic-webfont.ttf) format('truetype');font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-regular-webfont.eot);src:url(../fonts/Roboto/roboto-regular-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-regular-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-regular-webfont.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-italic-webfont.eot);src:url(../fonts/Roboto/roboto-italic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-italic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-italic-webfont.ttf) format('truetype');font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-medium-webfont.eot);src:url(../fonts/Roboto/roboto-medium-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-medium-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-medium-webfont.ttf) format('truetype');font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-mediumitalic-webfont.eot);src:url(../fonts/Roboto/roboto-mediumitalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-mediumitalic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-mediumitalic-webfont.ttf) format('truetype');font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-bold-webfont.eot);src:url(../fonts/Roboto/roboto-bold-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-bold-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-bold-webfont.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-bolditalic-webfont.eot);src:url(../fonts/Roboto/roboto-bolditalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-bolditalic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-bolditalic-webfont.ttf) format('truetype');font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-black-webfont.eot);src:url(../fonts/Roboto/roboto-black-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-black-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-black-webfont.ttf) format('truetype');font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-blackitalic-webfont.eot);src:url(../fonts/Roboto/roboto-blackitalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-blackitalic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-blackitalic-webfont.ttf) format('truetype');font-weight:900;font-style:italic}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-light-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-light-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-light-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-light-webfont.ttf) format('truetype');font-weight:300;font-style:normal}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.ttf) format('truetype');font-weight:300;font-style:italic}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-regular-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-regular-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-regular-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-regular-webfont.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-italic-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-italic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-italic-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-italic-webfont.ttf) format('truetype');font-weight:400;font-style:italic}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-bold-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-bold-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-bold-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-bold-webfont.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.ttf) format('truetype');font-weight:700;font-style:italic}@font-face{font-family:Roboto_slab;src:url(../fonts/Roboto_slab/robotoslab-thin-webfont.eot);src:url(../fonts/Roboto_slab/robotoslab-thin-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_slab/robotoslab-thin-webfont.woff) format('woff'),url(../fonts/Roboto_slab/robotoslab-thin-webfont.ttf) format('truetype');font-weight:100;font-style:normal}@font-face{font-family:Roboto_slab;src:url(../fonts/Roboto_slab/robotoslab-light-webfont.eot);src:url(../fonts/Roboto_slab/robotoslab-light-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_slab/robotoslab-light-webfont.woff) format('woff'),url(../fonts/Roboto_slab/robotoslab-light-webfont.ttf) format('truetype');font-weight:300;font-style:normal}@font-face{font-family:Roboto_slab;src:url(../fonts/Roboto_slab/robotoslab-regular-webfont.eot);src:url(../fonts/Roboto_slab/robotoslab-regular-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_slab/robotoslab-regular-webfont.woff) format('woff'),url(../fonts/Roboto_slab/robotoslab-regular-webfont.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:Roboto_slab;src:url(../fonts/Roboto_slab/robotoslab-bold-webfont.eot);src:url(../fonts/Roboto_slab/robotoslab-bold-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_slab/robotoslab-bold-webfont.woff) format('woff'),url(../fonts/Roboto_slab/robotoslab-bold-webfont.ttf) format('truetype');font-weight:700;font-style:normal}.ink-label{padding:0 .35em;white-space:nowrap}.ink-navigation{overflow:visible}.ink-navigation ul{list-style-type:none;padding:0;margin:0}.ink-navigation ul li{margin:0}.ink-navigation .breadcrumbs li{line-height:2.7em;display:inline}.ink-navigation .breadcrumbs li a{display:inline;padding:0}.ink-navigation .breadcrumbs li a:hover{background:0 0}.ink-navigation .breadcrumbs li.active a{cursor:default;text-decoration:none}.ink-navigation .breadcrumbs li:first-child a{padding-left:1.2em}.ink-navigation .breadcrumbs li:after{content:'/';display:inline;margin:0 .7em}.ink-navigation .breadcrumbs li:last-child:after{content:'';display:none}.ink-dropdown,.ink-navigation{position:relative}.ink-dropdown ul.dropdown,.ink-dropdown ul.dropdown-menu,.ink-navigation ul.dropdown,.ink-navigation ul.dropdown-menu{position:absolute;top:110%;background:#fff;z-index:30;border:1px solid #d9d9d9;height:auto;width:auto;min-width:10em;max-width:12em;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;-webkit-box-shadow:rgba(100,100,100,.3) 0 0 1px 0;-moz-box-shadow:rgba(100,100,100,.3) 0 0 1px 0;box-shadow:rgba(100,100,100,.3) 0 0 1px 0;margin-left:0;padding:.35em 0;font-size:.85em}.ink-dropdown ul.dropdown li,.ink-dropdown ul.dropdown-menu li,.ink-navigation ul.dropdown li,.ink-navigation ul.dropdown-menu li{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-border-radius:none;-moz-border-radius:none;-ms-border-radius:none;-o-border-radius:none;border-radius:none;width:auto;height:auto;min-height:auto;display:list-item;float:none;margin:0;text-align:left;text-transform:none;padding:0;position:relative;list-style-type:none}.ink-dropdown ul.dropdown li.separator-above,.ink-dropdown ul.dropdown-menu li.separator-above,.ink-navigation ul.dropdown li.separator-above,.ink-navigation ul.dropdown-menu li.separator-above{padding-top:.35em;margin-top:.35em;border-top:1px solid #d9d9d9}.ink-dropdown ul.dropdown li.separator-below,.ink-dropdown ul.dropdown-menu li.separator-below,.ink-navigation ul.dropdown li.separator-below,.ink-navigation ul.dropdown-menu li.separator-below{padding-bottom:.35em;margin-bottom:.35em;border-bottom:1px solid #d9d9d9}.ink-dropdown ul.dropdown li.heading,.ink-dropdown ul.dropdown-menu li.heading,.ink-navigation ul.dropdown li.heading,.ink-navigation ul.dropdown-menu li.heading{font-weight:700;margin-bottom:.35em;padding:.5em .8em;color:#333}.ink-dropdown ul.dropdown li a,.ink-dropdown ul.dropdown-menu li a,.ink-navigation ul.dropdown li a,.ink-navigation ul.dropdown-menu li a{color:#444;padding:.5em .8em;display:block;clear:both}.ink-dropdown ul.dropdown li a:hover,.ink-dropdown ul.dropdown-menu li a:hover,.ink-navigation ul.dropdown li a:hover,.ink-navigation ul.dropdown-menu li a:hover{background:#f2f2f2;text-decoration:none}.ink-dropdown ul.dropdown li.active a,.ink-dropdown ul.dropdown-menu li.active a,.ink-navigation ul.dropdown li.active a,.ink-navigation ul.dropdown-menu li.active a{background:#999;color:#fff}.ink-dropdown ul.dropdown li.disabled a,.ink-dropdown ul.dropdown-menu li.disabled a,.ink-navigation ul.dropdown li.disabled a,.ink-navigation ul.dropdown-menu li.disabled a{color:#b3b3b3}.ink-dropdown ul.dropdown li.disabled a:hover,.ink-dropdown ul.dropdown-menu li.disabled a:hover,.ink-navigation ul.dropdown li.disabled a:hover,.ink-navigation ul.dropdown-menu li.disabled a:hover{background:0 0;cursor:default}.ink-dropdown ul.dropdown li.submenu,.ink-dropdown ul.dropdown-menu li.submenu,.ink-navigation ul.dropdown li.submenu,.ink-navigation ul.dropdown-menu li.submenu{overflow:visible}.ink-dropdown ul.dropdown li.submenu>a,.ink-dropdown ul.dropdown-menu li.submenu>a,.ink-navigation ul.dropdown li.submenu>a,.ink-navigation ul.dropdown-menu li.submenu>a{white-space:nowrap}.ink-dropdown ul.dropdown li.submenu>a:after,.ink-dropdown ul.dropdown-menu li.submenu>a:after,.ink-navigation ul.dropdown li.submenu>a:after,.ink-navigation ul.dropdown-menu li.submenu>a:after{content:"\f0da";width:auto;margin-left:.8em;font-family:FontAwesome;color:#b3b3b3}.ink-dropdown ul.dropdown li.submenu:hover>a,.ink-dropdown ul.dropdown-menu li.submenu:hover>a,.ink-navigation ul.dropdown li.submenu:hover>a,.ink-navigation ul.dropdown-menu li.submenu:hover>a{background:#f2f2f2;text-decoration:none}.ink-dropdown ul.dropdown li.submenu:hover:hover>ul.dropdown,.ink-dropdown ul.dropdown li.submenu:hover:hover>ul.dropdown-menu,.ink-dropdown ul.dropdown-menu li.submenu:hover:hover>ul.dropdown,.ink-dropdown ul.dropdown-menu li.submenu:hover:hover>ul.dropdown-menu,.ink-navigation ul.dropdown li.submenu:hover:hover>ul.dropdown,.ink-navigation ul.dropdown li.submenu:hover:hover>ul.dropdown-menu,.ink-navigation ul.dropdown-menu li.submenu:hover:hover>ul.dropdown,.ink-navigation ul.dropdown-menu li.submenu:hover:hover>ul.dropdown-menu{display:block}.ink-dropdown ul.dropdown li.submenu>ul.dropdown,.ink-dropdown ul.dropdown li.submenu>ul.dropdown-menu,.ink-dropdown ul.dropdown-menu li.submenu>ul.dropdown,.ink-dropdown ul.dropdown-menu li.submenu>ul.dropdown-menu,.ink-navigation ul.dropdown li.submenu>ul.dropdown,.ink-navigation ul.dropdown li.submenu>ul.dropdown-menu,.ink-navigation ul.dropdown-menu li.submenu>ul.dropdown,.ink-navigation ul.dropdown-menu li.submenu>ul.dropdown-menu{font-size:inherit;position:absolute;top:-.36em;left:100%;display:none}.ink-navigation ul.pagination{overflow:hidden;*zoom:1}.ink-navigation ul.pagination li{line-height:1.7;float:left}.ink-navigation ul.pagination li a{padding:.5em 1em;display:block;float:left}.ink-navigation ul.pagination.dotted li a{display:block;height:1em;width:1em;margin-right:.6em;padding:0;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;text-indent:99999px}.ink-navigation ul.pagination.dotted li a:first-child,.ink-navigation ul.pagination.dotted li a:last-child{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%}.ink-navigation ul.pagination.chevron li{display:none}.ink-navigation ul.pagination.chevron li.next,.ink-navigation ul.pagination.chevron li.previous{display:block}.ink-navigation ul.pagination.chevron li.next a,.ink-navigation ul.pagination.chevron li.previous a{display:block;position:absolute;top:35%;padding:0 .5em;margin:0;font-family:FontAwesome;font-size:4em}.ink-navigation ul.pagination.chevron li.next a span,.ink-navigation ul.pagination.chevron li.previous a span{text-indent:-99999px;display:inline-block}.ink-navigation ul.pagination.chevron li.previous a{left:0}.ink-navigation ul.pagination.chevron li.previous a:after{content:"\f137"}.ink-navigation ul.pagination.chevron li.next a{right:0}.ink-navigation ul.pagination.chevron li.next a:after{content:"\f138"}.ink-navigation .pills{overflow:hidden;*zoom:1}.ink-navigation .pills li{overflow:hidden;display:block;float:left;margin:0 .5em .5em 0;line-height:1.7}.ink-navigation .pills li a{display:block;padding:.5em 1em}.ink-navigation .pills li a:hover{text-decoration:none}.ink-navigation .pills li.active a,.ink-navigation .pills li.disabled a{cursor:default}.ink-navigation ul{*height:100%}.ink-navigation ul.menu{*zoom:1}.ink-navigation ul.menu:after{content:"";display:table;clear:both}.ink-navigation ul.menu li{*height:100%}.ink-navigation ul.menu li:hover>ul.submenu{display:block}.ink-navigation ul.menu li ul.submenu{display:none;position:absolute;z-index:10}.ink-navigation ul.menu li ul.submenu li a{padding:.5em 1em;display:block;float:none}.ink-navigation ul.menu.horizontal li{float:left;position:relative}.ink-navigation ul.menu.horizontal li a{padding:.5em 1em;display:block;line-height:1.7}.ink-navigation ul.menu.horizontal li .control{margin-top:.3em}.ink-navigation ul.menu.horizontal li ul.submenu{min-width:100%;z-index:50;top:auto;left:auto}.ink-navigation ul.menu.horizontal li ul.submenu li{float:none}.ink-navigation ul.menu.horizontal li ul.submenu li .flyout{position:absolute;top:0;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.menu.horizontal li ul.submenu li .flyout.left{right:100%}.ink-navigation ul.menu.horizontal li ul.submenu li .flyout.right{left:100%}.ink-navigation ul.menu.vertical li{line-height:1.7;position:relative}.ink-navigation ul.menu.vertical li a{padding:.5em 1em;display:block}.ink-navigation ul.menu.vertical li ul.submenu{position:relative;top:auto;left:auto}.ink-navigation ul.menu.vertical li ul.submenu.flyout{position:absolute;min-width:8em;top:0;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.menu.vertical li ul.submenu.flyout.left{right:100%}.ink-navigation ul.menu.vertical li ul.submenu.flyout.right{left:100%}table.ink-table{width:100%;border-collapse:collapse;border-spacing:0}table.ink-table tr th{padding:5px 10px;line-height:1.3}table.ink-table tr th[data-sortable=true]:hover{cursor:pointer;text-decoration:underline}table.ink-table tr th[data-sortable=true]:hover i{text-decoration:none}table.ink-table tr th[data-sortable=true] i{padding-left:.5em}table.ink-table tr td{padding:5px 10px;line-height:1.3}table.ink-table.hover tbody tr:hover{cursor:pointer}table.ink-table.bordered{border-collapse:separate}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{color:#555;font-family:Roboto,Arial,Helvetica,sans-serif;line-height:1.45}.fw-100,.fw-light{font-weight:100}.fw-300,.fw-thin{font-weight:300}.fw-400,.fw-regular{font-weight:400}.fw-500,.fw-medium{font-weight:500}.fw-700,.fw-bold{font-weight:700}.fw-900,.fw-black{font-weight:900}.condensed-300,.condensed-thin{font-weight:200;font-family:Roboto_condensed,Arial,Helvetica,sans-serif}.condensed-400,.condensed-regular{font-weight:400;font-family:Roboto_condensed,Arial,Helvetica,sans-serif}.condensed-700,.condensed-bold{font-weight:700;font-family:Roboto_condensed,Arial,Helvetica,sans-serif}.slab-100,.slab-light{font-weight:100;font-family:Roboto_slab,Arial,Helvetica,sans-serif}.slab-300,.slab-thin{font-weight:300;font-family:Roboto_slab,Arial,Helvetica,sans-serif}.slab-400,.slab-regular{font-weight:400;font-family:Roboto_slab,Arial,Helvetica,sans-serif}.slab-700,.slab-bold{font-weight:700;font-family:Roboto_slab,Arial,Helvetica,sans-serif}.sans{font-family:Roboto,Arial,Helvetica,sans-serif}.serif{font-family:Times,"Times New Roman",serif}.monospace{font-family:Monaco,"Andale Mono","Courier New",monospace}.condensed{font-family:Roboto_condensed,Arial,Helvetica,sans-serif}.slab{font-family:Roboto_slab,Arial,Helvetica,sans-serif}.italic{font-style:italic}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalizer{text-transform:capitalize}.fa{font-size:14px}a{color:#6998c9;text-decoration:none;cursor:pointer}a:hover{color:#007ed5;text-decoration:underline}h1{font-size:2.2em;margin-top:0;margin-bottom:.57539em}h2{font-size:1.75em;margin-top:0;margin-bottom:.72334em}h3{font-size:1.5em;margin-top:0;margin-bottom:.8439em}h4{font-size:1.25em;margin-top:0;margin-bottom:1.01268em}h5,h6{font-size:1.1em;margin-top:0;margin-bottom:1.15077em}p,table{font-size:1em;margin-top:0;margin-bottom:1.26585em}h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child,h6:first-child,p:first-child{margin-top:0}h1,h2,h3,h4,h5,h6{color:#404040;font-weight:700;line-height:1.16}small{color:#888}input,textarea{color:#666}h1 small,h2 small,h3 small,h4 small{color:#bbb;font-size:.6em;font-weight:100;line-height:1}mark{background:#dae5f2}address{color:#777;font-size:1em;line-height:1.4}address p{margin-top:0}address h6{color:#555}abbr:hover{cursor:help}blockquote{border-left:4px solid #ddd;padding-left:25px;margin:1em 0;font-weight:200;font-size:1.1em}blockquote small{font-size:.9em}blockquote small::after,blockquote small::before{content:' — '}.note{font-size:.9em;color:#777}.note strong{color:#555}.small{font-size:.75em}.medium{font-size:.85em}.large{font-size:1.2em}.extralarge{font-size:1.45em!important}hr{border:0;border-top:1px solid #ddd;margin:1em 0}.lead{font-size:1.1em;font-weight:700}ol,ul{line-height:1.4;padding:0 0 0 1.45em;margin:1em 0}ol li,ul li{margin:.5em 0}ul.unstyled{list-style:none;padding-left:0}ul.unstyled ul{list-style:disc outside}ul.inline{list-style:none}ul.inline li{display:inline-block;padding:0 .5em}ul.inline li:first-child{padding:0 .5em 0 0}dl{margin:1em 0}dl dt{font-weight:700;margin:.5em 0}dl dd{margin:.5em 0 .5em 25px}dl.inline dt{float:left;clear:left;text-align:right;width:180px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin:0}dl.inline dd{margin:.5em 0 .5em 200px}figure.ink-image{position:relative;border:1px solid #555}figure.ink-image>img{width:100%}figure.ink-image>figcaption{padding:1em;background:#fff;line-height:1.3}figure.ink-image>figcaption.over-bottom,figure.ink-image>figcaption.over-top{position:absolute;width:100%;left:0;border:0}figure.ink-image>figcaption.over-bottom.dark,figure.ink-image>figcaption.over-top.dark{color:#fff;background:rgba(0,0,0,.6)}figure.ink-image>figcaption.over-top{top:0;background:rgba(255,255,255,.7)}figure.ink-image>figcaption.over-bottom{bottom:0;background:rgba(255,255,255,.7)}figure.ink-image>figcaption.dark{color:#fff;background:#222}img{border:0;width:auto;max-width:100%;vertical-align:top}.ink-alert.basic,.ink-alert.block{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-alert.basic{background:rgba(255,156,0,.25);color:#b87814;border:1px solid #b87814}.ink-alert.basic .ink-dismiss{color:#b87814}.ink-alert.basic.success{background:rgba(74,155,23,.25);color:#38621d;border:1px solid #38621d}.ink-alert.basic.success .ink-dismiss{color:#38621d}.ink-alert.basic.error{background:rgba(201,17,17,.25);color:#891e1e;border:1px solid #891e1e}.ink-alert.basic.error .ink-dismiss{color:#891e1e}.ink-alert.basic.info{background:rgba(15,117,218,.25);color:#1e5b98;border:1px solid #1e5b98}.ink-alert.basic.info .ink-dismiss{color:#1e5b98}.ink-alert.block{border:1px solid #b87814;background:#fff}.ink-alert.block>h4{background:rgba(255,156,0,.3);color:#b87814}.ink-alert.block .ink-dismiss{color:#b87814}.ink-alert.block.success{border:1px solid #38621d;background:#fff}.ink-alert.block.success>h4{background:rgba(74,155,23,.3);color:#38621d}.ink-alert.block.success .ink-dismiss{color:#38621d}.ink-alert.block.error{border:1px solid #891e1e;background:#fff}.ink-alert.block.error>h4{background:rgba(201,17,17,.3);color:#891e1e}.ink-alert.block.error .ink-dismiss{color:#891e1e}.ink-alert.block.info{border:1px solid #1e5b98;background:#fff}.ink-alert.block.info>h4{background:rgba(15,117,218,.3);color:#1e5b98}.ink-alert.block.info .ink-dismiss{color:#1e5b98}.ink-alert .ink-dismiss{font-family:Arial,sans-serif;font-weight:700;text-shadow:#fff 0 1px 0;filter:alpha(Opacity=25);opacity:.25}.ink-alert .ink-dismiss:hover{filter:alpha(Opacity=60);opacity:.6}.ink-badge{-webkit-border-radius:8em;-moz-border-radius:8em;-ms-border-radius:8em;-o-border-radius:8em;border-radius:8em;color:#fff}.ink-badge.white{background:#fff;color:#555}.ink-badge.black{background:#000}.ink-badge.orange{background:#ff9c00}.ink-badge.red{background:#c91111}.ink-badge.green{background:#4a9b17}.ink-badge.blue{background:#0f75da}.ink-badge.yellow{background:#ffd500;color:#555}.ink-badge.grey{background:gray}.ink-badge+.ink-badge{margin-left:.2em}.ink-button{background:#d9d9d9;color:#000;border:1px solid #bfbfbf;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;font-weight:300}.ink-button:active,.ink-button:hover{text-decoration:none;color:#000;background:#ccc;border:1px solid #b3b3b3;-webkit-box-shadow:rgba(0,0,0,.2) 0 1px 1px;-moz-box-shadow:rgba(0,0,0,.2) 0 1px 1px;box-shadow:rgba(0,0,0,.2) 0 1px 1px}.ink-button:focus{outline:0;background:#ccc;-webkit-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;-moz-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;box-shadow:rgba(0,0,0,.2) 0 1px 1px inset}.ink-button[disabled]{background:#e6e6e6;border:1px solid #e6e6e6;color:#999}.ink-button[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.blue{color:#fff;background:#0f75da;border:1px solid #0c63b9}.ink-button.blue:active,.ink-button.blue:hover{background:#0d68c2;border:1px solid #0a56a1;color:#fff;text-decoration:none}.ink-button.blue:focus{background:#0d68c2}.ink-button.blue[disabled]{background:rgba(15,117,218,.6);border:1px solid rgba(15,117,218,0);color:#0c5baa}.ink-button.blue[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.green{color:#fff;background:#4a9b17;border:1px solid #3e8313}.ink-button.green:active,.ink-button.green:hover{background:#3f8514;border:1px solid #336d10;color:#fff;text-decoration:none}.ink-button.green:focus{background:#3f8514}.ink-button.green[disabled]{background:rgba(74,155,23,.6);border:1px solid rgba(74,155,23,0);color:#356f10}.ink-button.green[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.orange{color:#fff;background:#ff9c00;border:1px solid #d88400}.ink-button.orange:active,.ink-button.orange:hover{background:#e68c00;border:1px solid #bf7400;color:#fff;text-decoration:none}.ink-button.orange:focus{background:#e68c00}.ink-button.orange[disabled]{background:rgba(255,156,0,.6);border:1px solid rgba(255,156,0,0);color:#cc7d00}.ink-button.orange[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.red{color:#fff;background:#c91111;border:1px solid #aa0e0e}.ink-button.red:active,.ink-button.red:hover{background:#b10f0f;border:1px solid #920c0c;color:#fff;text-decoration:none}.ink-button.red:focus{background:#b10f0f}.ink-button.red[disabled]{background:rgba(201,17,17,.6);border:1px solid rgba(201,17,17,0);color:#9a0d0d}.ink-button.red[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.black{color:#fff;background:#1a1a1a;border:1px solid #161616}.ink-button.black:active,.ink-button.black:hover{background:#0d0d0d;border:1px solid #090909;color:#fff;text-decoration:none}.ink-button.black:focus{background:#0d0d0d}.ink-button.black[disabled]{background:rgba(26,26,26,.6);border:1px solid rgba(26,26,26,0);color:#000}.ink-button.black[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.white{color:#555;background:#fff;border:1px solid #d8d8d8}.ink-button.white:active,.ink-button.white:hover{background:#f2f2f2;border:1px solid #cbcbcb;color:#555;text-decoration:none}.ink-button.white:focus{background:#f2f2f2}.ink-button.white[disabled]{background:rgba(255,255,255,.6);border:1px solid rgba(255,255,255,0);color:#e6e6e6}.ink-button.white[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.button-group>.ink-button[disabled]{background:#e6e6e6;border:1px solid rgba(217,217,217,.6)}.button-group>.ink-button[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.button-group>.ink-button.blue:first-child{border-left:#0c63b9}.button-group>.ink-button.blue[disabled]{background:rgba(15,117,218,.6);border:1px solid rgba(15,117,218,.3)}.button-group>.ink-button.green:first-child{border-left:#3e8313}.button-group>.ink-button.green[disabled]{background:rgba(74,155,23,.6);border:1px solid rgba(74,155,23,.3)}.button-group>.ink-button.orange:first-child{border-left:#d88400}.button-group>.ink-button.orange[disabled]{background:rgba(255,156,0,.6);border:1px solid rgba(255,156,0,.3)}.button-group>.ink-button.red:first-child{border-left:#aa0e0e}.button-group>.ink-button.red[disabled]{background:rgba(201,17,17,.6);border:1px solid rgba(201,17,17,.3)}.button-group>.ink-button.black:first-child{border-left:#161616}.button-group>.ink-button.black[disabled]{background:rgba(26,26,26,.6);border:1px solid rgba(26,26,26,.3)}.button-group>.ink-button.white:first-child{border-left:#d8d8d8}.button-group>.ink-button.white[disabled]{background:rgba(255,255,255,.6);border:1px solid rgba(255,255,255,.3)}.ink-label{color:#fff;font-weight:300;font-size:.938em;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-label.white{background:#fff;color:#555}.ink-label.black{background:#000}.ink-label.orange{background:#ff9c00}.ink-label.red{background:#c91111}.ink-label.green{background:#4a9b17}.ink-label.blue{background:#0f75da}.ink-label.yellow{background:#ffd500;color:#555}.ink-label.grey{background:gray}.ink-label+.ink-label{margin-left:.2em}.ink-navigation ul.breadcrumbs{font-weight:300;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.breadcrumbs li.active a{background:0 0;color:#999}.ink-navigation ul.breadcrumbs li.active a:hover{cursor:default;text-decoration:none}.ink-navigation ul.breadcrumbs li a:hover{background:0 0;text-decoration:underline}.ink-navigation ul.breadcrumbs.white{background:#fff}.ink-navigation ul.breadcrumbs.white li a,.ink-navigation ul.breadcrumbs.white li:after{color:#555}.ink-navigation ul.breadcrumbs.white li.active a{color:#ccc;text-shadow:#fff 0 1px 0}.ink-navigation ul.breadcrumbs.grey{background:#d9d9d9}.ink-navigation ul.breadcrumbs.grey li a,.ink-navigation ul.breadcrumbs.grey li:after{color:#555}.ink-navigation ul.breadcrumbs.grey li.active a{color:#a6a6a6;text-shadow:#ededed 0 1px 0}.ink-navigation ul.breadcrumbs.black{background:#1a1a1a}.ink-navigation ul.breadcrumbs.black li a,.ink-navigation ul.breadcrumbs.black li:after{color:#fff}.ink-navigation ul.breadcrumbs.black li.active a{color:#666;text-shadow:#000 0 -1px 0}.ink-navigation ul.breadcrumbs.blue{background:#1b75ce}.ink-navigation ul.breadcrumbs.blue li a,.ink-navigation ul.breadcrumbs.blue li:after{color:#fff}.ink-navigation ul.breadcrumbs.blue li.active a{color:#08427b;text-shadow:#1884ef 0 1px 0}.ink-navigation ul.breadcrumbs.orange{background:#f2990d}.ink-navigation ul.breadcrumbs.orange li a,.ink-navigation ul.breadcrumbs.orange li:after{color:#fff}.ink-navigation ul.breadcrumbs.orange li.active a{color:#995e00;text-shadow:#ffa81f 0 1px 0}.ink-navigation ul.breadcrumbs.green{background:#4c9220}.ink-navigation ul.breadcrumbs.green li a,.ink-navigation ul.breadcrumbs.green li:after{color:#fff}.ink-navigation ul.breadcrumbs.green li.active a{color:#20420a;text-shadow:#57b61b 0 1px 0}.ink-navigation ul.breadcrumbs.red{background:#be1c1c}.ink-navigation ul.breadcrumbs.red li a,.ink-navigation ul.breadcrumbs.red li:after{color:#fff}.ink-navigation ul.breadcrumbs.red li.active a{color:#6b0909;text-shadow:#e51313 0 1px 0}.ink-dropdown.green ul.dropdown-menu li.active a{background:#4a9b17;color:#fff}.ink-dropdown.orange ul.dropdown-menu li.active a{background:#ff9c00;color:#fff}.ink-dropdown.red ul.dropdown-menu li.active a{background:#c91111;color:#fff}.ink-dropdown.black ul.dropdown-menu li.active a{background:#1a1a1a;color:#fff}.ink-dropdown.blue ul.dropdown-menu li.active a{background:#0f75da;color:#fff}.ink-navigation ul.menu{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.menu>li{font-weight:300}.ink-navigation ul.menu>li.active a{text-decoration:underline}.ink-navigation ul.menu>li.heading{font-weight:500}.ink-navigation ul.menu>li.disabled a{color:#b3b3b3;text-shadow:#fff 0 1px 0}.ink-navigation ul.menu>li.disabled a:hover{cursor:default;background:0 0;text-decoration:none}.ink-navigation ul.menu>li ul.submenu li{font-size:.875em}.ink-navigation ul.menu>li ul.submenu li a{border-bottom:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.vertical li a{border-bottom:1px solid rgba(0,0,0,.15)}.ink-navigation ul.menu.vertical li:first-child,.ink-navigation ul.menu.vertical li:first-child>a{-webkit-border-radius:2px 2px 0 0;-moz-border-radius:2px 2px 0 0;-ms-border-radius:2px 2px 0 0;-o-border-radius:2px 2px 0 0;border-radius:2px 2px 0 0}.ink-navigation ul.menu.vertical li:last-child{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px}.ink-navigation ul.menu.vertical li:last-child>a{border-bottom:0;-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px}.ink-navigation ul.menu.vertical li:last-child .submenu{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px}.ink-navigation ul.menu.vertical li:last-child .submenu.flyout{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.menu.vertical li:last-child .submenu li:last-child,.ink-navigation ul.menu.vertical li:last-child .submenu li:last-child a{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px}.ink-navigation ul.menu.horizontal>li:first-child,.ink-navigation ul.menu.horizontal>li:first-child a{-webkit-border-radius:2px 0 0 2px;-moz-border-radius:2px 0 0 2px;-ms-border-radius:2px 0 0 2px;-o-border-radius:2px 0 0 2px;border-radius:2px 0 0 2px}.ink-navigation ul.menu.horizontal>li:last-child,.ink-navigation ul.menu.horizontal>li:last-child a{-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-ms-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0}.ink-navigation ul.menu.horizontal>li ul.submenu{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px;background:#fff}.ink-navigation ul.menu.horizontal>li ul.submenu li:last-child{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px}.ink-navigation ul.menu.horizontal>li ul.submenu li:last-child a{border-bottom:0}.ink-navigation ul.menu.white{background:#fff}.ink-navigation ul.menu.white li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.white li ul.submenu li a{color:#555}.ink-navigation ul.menu.white li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.white li.disabled a:hover{background:0 0}.ink-navigation ul.menu.white li.active{background:#e6e6e6}.ink-navigation ul.menu.white li.disabled a{color:#ccc;text-shadow:#fff 0 1px 0}.ink-navigation ul.menu.white li a{color:#555;text-decoration:none}.ink-navigation ul.menu.white li a:hover{background:#f2f2f2}.ink-navigation ul.menu.grey{background:#d9d9d9}.ink-navigation ul.menu.grey li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.grey li ul.submenu li a{color:#555}.ink-navigation ul.menu.grey li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.grey li.disabled a:hover{background:0 0}.ink-navigation ul.menu.grey li.active{background:#bfbfbf}.ink-navigation ul.menu.grey li.disabled a{color:#a6a6a6;text-shadow:#ededed 0 1px 0}.ink-navigation ul.menu.grey li a{color:#555;text-decoration:none}.ink-navigation ul.menu.grey li a:hover{background:#ccc}.ink-navigation ul.menu.black{background:#1a1a1a}.ink-navigation ul.menu.black li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.black li ul.submenu li a{color:#555}.ink-navigation ul.menu.black li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.black li.disabled a:hover{background:0 0}.ink-navigation ul.menu.black li.active{background:#333}.ink-navigation ul.menu.black li.disabled a{color:#666;text-shadow:#000 0 -1px 0}.ink-navigation ul.menu.black li a{color:#fff;text-decoration:none}.ink-navigation ul.menu.black li a:hover{background:#404040}.ink-navigation ul.menu.blue{background:#1b75ce}.ink-navigation ul.menu.blue li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.blue li ul.submenu li a{color:#555}.ink-navigation ul.menu.blue li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.blue li.disabled a:hover{background:0 0}.ink-navigation ul.menu.blue li.active{background:#0c5baa}.ink-navigation ul.menu.blue li.disabled a{color:#08427b;text-shadow:#2289f0 0 1px 0}.ink-navigation ul.menu.blue li a{color:#fff;text-decoration:none}.ink-navigation ul.menu.blue li a:hover{background:#0d68c2}.ink-navigation ul.menu.green{background:#4c9220}.ink-navigation ul.menu.green li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.green li ul.submenu li a{color:#555}.ink-navigation ul.menu.green li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.green li.disabled a:hover{background:0 0}.ink-navigation ul.menu.green li.active{background:#356f10}.ink-navigation ul.menu.green li.disabled a{color:#20420a;text-shadow:#5bbf1c 0 1px 0}.ink-navigation ul.menu.green li a{color:#fff;text-decoration:none}.ink-navigation ul.menu.green li a:hover{background:#3f8514}.ink-navigation ul.menu.orange{background:#f2990d}.ink-navigation ul.menu.orange li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.orange li ul.submenu li a{color:#555}.ink-navigation ul.menu.orange li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.orange li.disabled a:hover{background:0 0}.ink-navigation ul.menu.orange li.active{background:#cc7d00}.ink-navigation ul.menu.orange li.disabled a{color:#995e00;text-shadow:#ffac29 0 1px 0}.ink-navigation ul.menu.orange li a{color:#fff;text-decoration:none}.ink-navigation ul.menu.orange li a:hover{background:#e68c00}.ink-navigation ul.menu.red{background:#be1c1c}.ink-navigation ul.menu.red li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.red li ul.submenu li a{color:#555}.ink-navigation ul.menu.red li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.red li.disabled a:hover{background:0 0}.ink-navigation ul.menu.red li.active{background:#9a0d0d}.ink-navigation ul.menu.red li.disabled a{color:#6b0909;text-shadow:#eb1717 0 1px 0}.ink-navigation ul.menu.red li a{color:#fff;text-decoration:none}.ink-navigation ul.menu.red li a:hover{background:#b10f0f}.ink-navigation ul.pagination{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.pagination li{font-weight:300}.ink-navigation ul.pagination li.active a{text-decoration:underline}.ink-navigation ul.pagination li.disabled a{color:#b3b3b3;text-shadow:#fff 0 1px 0}.ink-navigation ul.pagination li.disabled a:hover{cursor:default;background:0 0;text-decoration:none}.ink-navigation ul.pagination li:first-child,.ink-navigation ul.pagination li:first-child a{-webkit-border-radius:2px 0 0 2px;-moz-border-radius:2px 0 0 2px;-ms-border-radius:2px 0 0 2px;-o-border-radius:2px 0 0 2px;border-radius:2px 0 0 2px}.ink-navigation ul.pagination li:last-child,.ink-navigation ul.pagination li:last-child a{-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-ms-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0}.ink-navigation ul.pagination.white li{background:#fff}.ink-navigation ul.pagination.white li.active a{background:#e6e6e6}.ink-navigation ul.pagination.white li.disabled a{color:#ccc;text-shadow:#fff 0 1px 0}.ink-navigation ul.pagination.white li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.white li a{color:#555;text-decoration:none}.ink-navigation ul.pagination.white li a:hover{background:#f2f2f2}.ink-navigation ul.pagination.grey li{background:#d9d9d9}.ink-navigation ul.pagination.grey li.active a{background:#bfbfbf}.ink-navigation ul.pagination.grey li.disabled a{color:#a6a6a6;text-shadow:#ededed 0 1px 0}.ink-navigation ul.pagination.grey li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.grey li a{color:#555;text-decoration:none}.ink-navigation ul.pagination.grey li a:hover{background:#ccc}.ink-navigation ul.pagination.black li{background:#1a1a1a}.ink-navigation ul.pagination.black li.active a{background:#333}.ink-navigation ul.pagination.black li.disabled a{color:#666;text-shadow:#000 0 -1px 0}.ink-navigation ul.pagination.black li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.black li a{color:#fff;text-decoration:none}.ink-navigation ul.pagination.black li a:hover{background:#292929}.ink-navigation ul.pagination.orange li{background:#f2990d}.ink-navigation ul.pagination.orange li.active a{background:#cc7d00}.ink-navigation ul.pagination.orange li.disabled a{color:#995e00;text-shadow:#ffac29 0 1px 0}.ink-navigation ul.pagination.orange li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.orange li a{color:#fff;text-decoration:none}.ink-navigation ul.pagination.orange li a:hover{background:#e68c00}.ink-navigation ul.pagination.blue li{background:#1b75ce}.ink-navigation ul.pagination.blue li.active a{background:#0c5baa}.ink-navigation ul.pagination.blue li.disabled a{color:#08427b;text-shadow:#2289f0 0 1px 0}.ink-navigation ul.pagination.blue li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.blue li a{color:#fff;text-decoration:none}.ink-navigation ul.pagination.blue li a:hover{background:#0d68c2}.ink-navigation ul.pagination.green li{background:#4c9220}.ink-navigation ul.pagination.green li.active a{background:#356f10}.ink-navigation ul.pagination.green li.disabled a{color:#20420a;text-shadow:#5bbf1c 0 1px 0}.ink-navigation ul.pagination.green li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.green li a{color:#fff;text-decoration:none}.ink-navigation ul.pagination.green li a:hover{background:#3f8514}.ink-navigation ul.pagination.red li{background:#be1c1c}.ink-navigation ul.pagination.red li.active a{background:#9a0d0d}.ink-navigation ul.pagination.red li.disabled a{color:#6b0909;text-shadow:#eb1717 0 1px 0}.ink-navigation ul.pagination.red li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.red li a{color:#fff;text-decoration:none}.ink-navigation ul.pagination.red li a:hover{background:#b10f0f}.ink-navigation ul.pagination.dotted li{background:0 0}.ink-navigation ul.pagination.dotted li a{background:#999;filter:alpha(Opacity=50);opacity:.5}.ink-navigation ul.pagination.dotted li.active a,.ink-navigation ul.pagination.dotted li:hover a{filter:alpha(Opacity=100);opacity:1}.ink-navigation ul.pagination.dotted.black li a{background:#1a1a1a}.ink-navigation ul.pagination.dotted.white li a{background:#fff}.ink-navigation ul.pagination.dotted.blue li a{background:#1b75ce}.ink-navigation ul.pagination.dotted.green li a{background:#4c9220}.ink-navigation ul.pagination.dotted.orange li a{background:#f2990d}.ink-navigation ul.pagination.dotted.red li a{background:#be1c1c}.ink-navigation ul.pagination.chevron li.next a,.ink-navigation ul.pagination.chevron li.previous a{color:#fff;filter:alpha(Opacity=60);opacity:.6}.ink-navigation ul.pagination.chevron li.next a.active,.ink-navigation ul.pagination.chevron li.next a:focus,.ink-navigation ul.pagination.chevron li.next a:hover,.ink-navigation ul.pagination.chevron li.previous a.active,.ink-navigation ul.pagination.chevron li.previous a:focus,.ink-navigation ul.pagination.chevron li.previous a:hover{filter:alpha(Opacity=80);opacity:.8;text-decoration:none;background:0 0}.ink-navigation ul.pagination.chevron li.disabled a{color:#fff;filter:alpha(Opacity=60);opacity:.6;text-shadow:none}.ink-navigation ul.pagination.chevron li.disabled a:focus,.ink-navigation ul.pagination.chevron li.disabled a:hover{color:#fff;filter:alpha(Opacity=60);opacity:.6}.ink-navigation ul.pagination.chevron.black li.disabled a,.ink-navigation ul.pagination.chevron.black li.next a,.ink-navigation ul.pagination.chevron.black li.previous a{color:#1a1a1a}.ink-navigation ul.pagination.chevron.grey li.disabled a,.ink-navigation ul.pagination.chevron.grey li.next a,.ink-navigation ul.pagination.chevron.grey li.previous a{color:#d9d9d9}.ink-navigation ul.pagination.chevron.blue li.disabled a,.ink-navigation ul.pagination.chevron.blue li.next a,.ink-navigation ul.pagination.chevron.blue li.previous a{color:#1b75ce}.ink-navigation ul.pagination.chevron.green li.disabled a,.ink-navigation ul.pagination.chevron.green li.next a,.ink-navigation ul.pagination.chevron.green li.previous a{color:#4c9220}.ink-navigation ul.pagination.chevron.orange li.disabled a,.ink-navigation ul.pagination.chevron.orange li.next a,.ink-navigation ul.pagination.chevron.orange li.previous a{color:#f2990d}.ink-navigation ul.pagination.chevron.red li.disabled a,.ink-navigation ul.pagination.chevron.red li.next a,.ink-navigation ul.pagination.chevron.red li.previous a{color:#be1c1c}.ink-navigation ul.pills li{background:#fff;font-weight:300;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.pills li a{color:#555;background:0 0}.ink-navigation ul.pills li a:hover,.ink-navigation ul.pills li.active a{background:#e6e6e6}.ink-navigation ul.pills li.disabled a{color:#999;text-shadow:#fff 0 1px 0}.ink-navigation ul.pills li.disabled a:hover{background:0 0}.ink-navigation ul.pills.grey li{background:#d9d9d9}.ink-navigation ul.pills.grey li.active a{background:#bfbfbf}.ink-navigation ul.pills.grey li.disabled a{color:#a6a6a6;text-shadow:#ededed 0 1px 0}.ink-navigation ul.pills.grey li.disabled a:hover{background:0 0}.ink-navigation ul.pills.grey li a{color:#555}.ink-navigation ul.pills.grey li a:hover{background:#ccc}.ink-navigation ul.pills.black li{background:#1a1a1a}.ink-navigation ul.pills.black li.active a{background:#333}.ink-navigation ul.pills.black li.disabled a{color:#666;text-shadow:#000 0 -1px 0}.ink-navigation ul.pills.black li.disabled a:hover{background:0 0}.ink-navigation ul.pills.black li a{color:#fff}.ink-navigation ul.pills.black li a:hover{background:#292929}.ink-navigation ul.pills.blue li{background:#1b75ce}.ink-navigation ul.pills.blue li.active a{background:#0c5baa}.ink-navigation ul.pills.blue li.disabled a{color:#08427b;text-shadow:#2289f0 0 1px 0}.ink-navigation ul.pills.blue li.disabled a:hover{background:0 0}.ink-navigation ul.pills.blue li a{color:#fff}.ink-navigation ul.pills.blue li a:hover{background:#0d68c2}.ink-navigation ul.pills.green li{background:#4c9220}.ink-navigation ul.pills.green li.active a{background:#356f10}.ink-navigation ul.pills.green li.disabled a{color:#20420a;text-shadow:#5bbf1c 0 1px 0}.ink-navigation ul.pills.green li.disabled a:hover{background:0 0}.ink-navigation ul.pills.green li a{color:#fff}.ink-navigation ul.pills.green li a:hover{background:#3f8514}.ink-navigation ul.pills.orange li{background:#f2990d}.ink-navigation ul.pills.orange li.active a{background:#cc7d00}.ink-navigation ul.pills.orange li.disabled a{color:#995e00;text-shadow:#ffac29 0 1px 0}.ink-navigation ul.pills.orange li.disabled a:hover{background:0 0}.ink-navigation ul.pills.orange li a{color:#fff}.ink-navigation ul.pills.orange li a:hover{background:#e68c00}.ink-navigation ul.pills.red li{background:#be1c1c}.ink-navigation ul.pills.red li.active a{background:#9a0d0d}.ink-navigation ul.pills.red li.disabled a{color:#6b0909;text-shadow:#eb1717 0 1px 0}.ink-navigation ul.pills.red li.disabled a:hover{background:0 0}.ink-navigation ul.pills.red li a{color:#fff}.ink-navigation ul.pills.red li a:hover{background:#b10f0f}table.ink-table{background:#fff}table.ink-table tr td,table.ink-table tr th{border-bottom:#bbb 1px solid;background:0 0}table.ink-table tr:last-child td{border-bottom:0}table.ink-table tfoot tr td,table.ink-table tfoot tr th{border-top:#bbb 1px solid}table.ink-table.alternating tbody tr:nth-child(odd){background-color:#f5f5f5}table.ink-table.hover tbody tr:hover{background:#fefbd6;color:#555}table.ink-table.bordered{border:#bbb 1px solid;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}table.ink-table.bordered tr th{border-left:#bbb 1px solid}table.ink-table.bordered tr th:first-child{border-left:0}table.ink-table.bordered tr:last-child td{border-bottom:0}table.ink-table.bordered tr td{border-left:#bbb 1px solid}table.ink-table.bordered tr td:first-child{border-left:0}table.ink-table tbody>tr.red td{background:#c91111;color:#fff}table.ink-table tbody>tr.green td{background:#4a9b17;color:#fff}table.ink-table tbody>tr.blue td{background:#0f75da;color:#fff}table.ink-table tbody>tr.orange td{background:#ff9c00;color:#fff}table.ink-table tbody>tr.black td{background:#000;color:#ccc}table.ink-table tbody>tr.yellow td{background:#ffd500;color:#000}.animated.slow{animation-duration:1s}.animated.medium{animation-duration:.5s}.animated.fast{animation-duration:.2s}.ink-carousel .ink-navigation{position:static}.ink-carousel{width:100%;position:relative;overflow:hidden;display:block}.ink-carousel .stage{left:0;height:auto!important;margin-top:0;margin-bottom:0;padding-left:0;list-style-type:none;white-space:nowrap;position:relative;overflow:visible;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease}.ink-carousel .stage.column-group{display:-webkit-block;display:-moz-block;display:block;-webkit-flex-flow:none;-moz-flex-flow:none;flex-flow:none}.ink-carousel .stage .slide{position:relative;display:inline-block;vertical-align:top;white-space:normal;margin:0;float:none;zoom:1;*display:inline}.ink-datepicker-wrapper{position:relative}.ink-datepicker-calendar{margin-top:0;position:absolute}.ink-datepicker-calendar.right{left:100%;top:0}.ink-datepicker-calendar.left{right:100%;top:0}.ink-datepicker-calendar.bottom{top:100%;left:0}.ink-datepicker-calendar.top{bottom:100%;left:0}.ink-datepicker-calendar,.ink-datepicker-wrapper{display:inline;display:inline-block}.ink-calendar{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;text-align:center;padding:.3em;min-width:17.4em;font-size:13px;-webkit-box-shadow:rgba(0,0,0,.4) 0 1px 2px 0;-moz-box-shadow:rgba(0,0,0,.4) 0 1px 2px 0;box-shadow:rgba(0,0,0,.4) 0 1px 2px 0;background:#fff;z-index:10}.ink-calendar a{text-decoration:none}.ink-calendar li{list-style:none inside}html.ink-modal-is-open .ink-calendar{z-index:101}.ink-calendar-top-options{padding:5px;font-size:.813em;cursor:pointer}.ink-calendar-top-options .clean{float:left}.ink-calendar-top-options .close{float:right}.ink-calendar-top{line-height:2em;background:#e6e6e6;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-calendar-top div{float:left}.ink-calendar-top .ink-calendar-next,.ink-calendar-top .ink-calendar-prev{width:10%}.ink-calendar-top .ink-calendar-next a,.ink-calendar-top .ink-calendar-prev a{display:block}.ink-calendar-top .ink-calendar-month_desc{width:80%}.ink-calendar-month,.ink-calendar-month-selector,.ink-calendar-year-selector{margin-top:.5em;padding-left:0}.ink-calendar-month li a,.ink-calendar-month-selector li a,.ink-calendar-year-selector li a{margin:0;line-height:2em;vertical-align:middle;display:block;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;color:#444}.ink-calendar-month li a:hover,.ink-calendar-month-selector li a:hover,.ink-calendar-year-selector li a:hover{background:#e6e6e6}.ink-calendar-month li a.ink-calendar-on,.ink-calendar-month li a.ink-calendar-on:hover,.ink-calendar-month-selector li a.ink-calendar-on,.ink-calendar-month-selector li a.ink-calendar-on:hover,.ink-calendar-year-selector li a.ink-calendar-on,.ink-calendar-year-selector li a.ink-calendar-on:hover{background:#0069d6;color:#fff}.ink-calendar-month li a.ink-calendar-off,.ink-calendar-month li a.ink-calendar-off:hover,.ink-calendar-month-selector li a.ink-calendar-off,.ink-calendar-month-selector li a.ink-calendar-off:hover,.ink-calendar-year-selector li a.ink-calendar-off,.ink-calendar-year-selector li a.ink-calendar-off:hover{background:#fff;color:#aaa;cursor:default}.ink-calendar-month ul,.ink-calendar-month-selector ul,.ink-calendar-year-selector ul{clear:both;padding-left:0}.ink-calendar-month ul li,.ink-calendar-month-selector ul li,.ink-calendar-year-selector ul li{width:2.4em;float:left;text-align:center;padding:0;margin:0}.ink-calendar-month-selector ul li,.ink-calendar-year-selector ul li{width:25%}.ink-calendar-month-selector,.ink-calendar-year-selector{display:none}.action_inactive,.ink-calendar-off{color:#ddd!important}.ink-calendar-month .ink-calendar-header{border-bottom:1px solid rgba(0,0,0,.1);padding-bottom:.5em;margin-bottom:.5em;color:#aaa}.ink-calendar-middle,.ink-calendar-month .ink-calendar-header,.ink-calendar-month .ink-calendar-middle ul,.ink-calendar-top,.ink-calendar-top-options{*zoom:1}.ink-calendar-middle:after,.ink-calendar-month .ink-calendar-header:after,.ink-calendar-month .ink-calendar-middle ul:after,.ink-calendar-top-options:after,.ink-calendar-top:after{content:"";display:table;clear:both}body.ink-drawer{max-width:100%}body.ink-drawer .content-drawer,body.ink-drawer .left-drawer,body.ink-drawer .right-drawer{-webkit-transition-property:translate3d;-moz-transition-property:translate3d;-o-transition-property:translate3d;transition-property:translate3d;-webkit-transition-duration:300ms;-moz-transition-duration:300ms;-o-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.86,0,.07,1);-moz-transition-timing-function:cubic-bezier(0.86,0,.07,1);-o-transition-timing-function:cubic-bezier(0.86,0,.07,1);transition-timing-function:cubic-bezier(0.86,0,.07,1)}body.ink-drawer .left-drawer{left:-220px}body.ink-drawer .right-drawer{right:-220px}body.ink-drawer .content-drawer{width:100%}body.ink-drawer .left-drawer,body.ink-drawer .right-drawer{position:absolute;top:0;z-index:0;display:none;overflow-x:hidden;overflow-y:auto;width:220px;height:100%;-webkit-overflow-scrolling:touch}body.ink-drawer .left-drawer.show,body.ink-drawer .right-drawer.show{display:block}body.ink-drawer.push{overflow:hidden;width:100%;height:100%;position:fixed}body.ink-drawer.push .content-drawer{overflow:hidden}body.ink-drawer.push.left .content-drawer,body.ink-drawer.push.left .left-drawer{-webkit-transform:translate3d(220px,0,0);-moz-transform:translate3d(220px,0,0);-ms-transform:translate3d(220px,0,0);-o-transform:translate3d(220px,0,0);transform:translate3d(220px,0,0)}body.ink-drawer.push.right .content-drawer,body.ink-drawer.push.right .right-drawer{-webkit-transform:translate3d(-220px,0,0);-moz-transform:translate3d(-220px,0,0);-ms-transform:translate3d(-220px,0,0);-o-transform:translate3d(-220px,0,0);transform:translate3d(-220px,0,0)}body.ink-drawer.over{overflow:hidden;-webkit-user-drag:none}body.ink-drawer.over.left .left-drawer{-webkit-transform:translate3d(220px,0,0);-moz-transform:translate3d(220px,0,0);-ms-transform:translate3d(220px,0,0);-o-transform:translate3d(220px,0,0);transform:translate3d(220px,0,0)}body.ink-drawer.over.right .right-drawer{-webkit-transform:translate3d(-220px,0,0);-moz-transform:translate3d(-220px,0,0);-ms-transform:translate3d(-220px,0,0);-o-transform:translate3d(-220px,0,0);transform:translate3d(-220px,0,0)}.ink-shade{background:rgba(0,0,0,.8);width:100%;height:100%;top:0;right:0;bottom:0;left:0;margin-top:0;position:fixed;z-index:100;display:none;filter:alpha(Opacity=0);opacity:0}.ink-shade.fade{-webkit-transition:opacity 300ms;-moz-transition:opacity 300ms;-o-transition:opacity 300ms;transition:opacity 300ms}.ink-shade.visible{filter:alpha(Opacity=100);opacity:1}.ink-modal{top:50%;left:50%;width:90%;height:90%;background:#fff;z-index:100;position:absolute;overflow:hidden;filter:alpha(Opacity=100);opacity:1;-webkit-box-shadow:rgba(0,0,0,.8) 0 0 15px 0;-moz-box-shadow:rgba(0,0,0,.8) 0 0 15px 0;box-shadow:rgba(0,0,0,.8) 0 0 15px 0;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;*zoom:1}.ink-modal:after{content:"";display:table;clear:both}.ink-modal>.modal-body{padding:1em;overflow-y:auto;overflow-x:hidden;height:auto}.ink-modal>.modal-body .ink-grid{padding-left:0;padding-right:0;width:100%;min-width:100%}.ink-modal>.modal-header,.ink-modal>header{border-bottom:1px #e6e6e6 solid;overflow:hidden;-webkit-box-shadow:rgba(175,175,175,.2) 0 1px 2px 0;-moz-box-shadow:rgba(175,175,175,.2) 0 1px 2px 0;box-shadow:rgba(175,175,175,.2) 0 1px 2px 0}.ink-modal>.modal-header>.modal-close,.ink-modal>header>.modal-close{padding-top:2px;text-align:center;color:#fff;width:26px;height:26px;line-height:1.2em;border:0;background:#bfbfbf;font-size:0;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;text-shadow:rgba(0,0,0,.6) 0 -1px 0;filter:alpha(Opacity=60);opacity:.6;float:right}.ink-modal>.modal-header>.modal-close:after,.ink-modal>header>.modal-close:after{content:"\f00d";font-family:FontAwesome;font-size:medium;line-height:22px}.ink-modal>.modal-header>.modal-close:hover,.ink-modal>header>.modal-close:hover{filter:alpha(Opacity=100);opacity:1}.ink-modal>.modal-footer,.ink-modal>footer{background:#e6e6e6;margin-bottom:0;zoom:1;-webkit-box-shadow:rgba(175,175,175,.2) 0 -1px 2px 0;-moz-box-shadow:rgba(175,175,175,.2) 0 -1px 2px 0;box-shadow:rgba(175,175,175,.2) 0 -1px 2px 0}.ink-modal>.modal-footer,.ink-modal>.modal-header,.ink-modal>footer,.ink-modal>header{padding:.8em 1em .65em}.ink-modal>.modal-footer:after,.ink-modal>.modal-footer:before,.ink-modal>.modal-header:after,.ink-modal>.modal-header:before,.ink-modal>footer:after,.ink-modal>footer:before,.ink-modal>header:after,.ink-modal>header:before{content:".";display:block;height:0;clear:both;visibility:hidden}.ink-modal-open{overflow:hidden}.ink-progress-bar{margin-bottom:1em;overflow:hidden;background:#f2f2f2;position:relative;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;-webkit-box-shadow:0,1px,3px,0,rgba(0,0,0,.2),inset;-moz-box-shadow:0,1px,3px,0,rgba(0,0,0,.2),inset;box-shadow:0,1px,3px,0,rgba(0,0,0,.2),inset}.ink-progress-bar .caption{position:absolute;top:0;left:0;width:100%;height:100%;line-height:1.7;text-align:center;color:#000;font-size:.813em;z-index:10}.ink-progress-bar .bar{height:1.3em;text-shadow:rgba(0,0,0,.25),0,1px,0;-webkit-box-shadow:0,1px,1px,0,rgba(0,0,0,.1),inset;-moz-box-shadow:0,1px,1px,0,rgba(0,0,0,.1),inset;box-shadow:0,1px,1px,0,rgba(0,0,0,.1),inset;-webkit-transition-property:width;-moz-transition-property:width;-o-transition-property:width;transition-property:width;-webkit-transition-duration:.6s;-moz-transition-duration:.6s;-o-transition-duration:.6s;transition-duration:.6s;-webkit-transition-timing-function:ease;-moz-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.ink-progress-bar .bar.grey{background:#ccc;color:#555}.ink-progress-bar .bar.green{background:#4a9b17;color:#fff}.ink-progress-bar .bar.blue{background:#0f75da;color:#fff}.ink-progress-bar .bar.red{background:#c91111;color:#fff}.ink-progress-bar .bar.orange{background:#ff9c00;color:#555}.ink-progress-bar .bar.black{background:#000;color:#fff}.dragging,.ink-sortable-list li{cursor:move;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;-ms-user-select:none;user-select:none;-ms-user-drag:none;-moz-user-drag:none;-khtml-user-drag:none;-webkit-user-drag:none;-o-user-drag:none;user-drag:none}.drag,.ink-sortable-list li.placeholder{-webkit-box-shadow:0,0,10px,0,rgba(0,0,0,.3);-moz-box-shadow:0,0,10px,0,rgba(0,0,0,.3);box-shadow:0,0,10px,0,rgba(0,0,0,.3)}.ink-sortable-list li{margin:0;border-bottom:1px solid #ccc;line-height:40px}.ink-sortable-list li.placeholder,.ink-sortable-list li:hover{background:#ccc;background:rgba(204,204,204,.2)}.ink-sortable-list li .ink-label{margin:0 .8em}.ink-sticky-stuck{position:fixed}.ink-tabs .tabs-nav{list-style:none;padding:0;*zoom:1}.ink-tabs .tabs-nav li{line-height:1.7;position:relative;margin:0}.ink-tabs .tabs-nav li a{padding:.5em 1em;display:block}.ink-tabs .tabs-nav li a:hover{background:#f0f0f0}.ink-tabs .tabs-nav li.active a{color:#555;cursor:default;text-decoration:none;background:#fff;border:1px solid #ccc}.ink-tabs .tabs-nav:after{content:"";display:table;clear:both}.ink-tabs .tabs-content{margin-top:1.5em;overflow:auto}.ink-tabs.top>.tabs-nav{border-bottom:1px solid #ccc}.ink-tabs.top>.tabs-nav li{float:left}.ink-tabs.top>.tabs-nav li a{margin-right:.4em;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;-ms-border-radius:4px 4px 0 0;-o-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.ink-tabs.top>.tabs-nav li.active{margin:0 0 -2px 0}.ink-tabs.top>.tabs-nav li.active a{border-bottom-color:transparent}.ink-tabs.bottom>.tabs-nav{border-top:1px solid #ccc}.ink-tabs.bottom>.tabs-nav li{float:left}.ink-tabs.bottom>.tabs-nav li a{margin-right:.4em;-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;-ms-border-radius:0 0 4px 4px;-o-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.ink-tabs.bottom>.tabs-nav li.active{margin:-2px 0 0 0}.ink-tabs.bottom>.tabs-nav li.active a{border-top-color:transparent}.ink-tabs.left>.tabs-nav{border-right:1px solid #ccc;float:left;margin-right:2em}.ink-tabs.left>.tabs-nav li{float:none;text-align:right}.ink-tabs.left>.tabs-nav li a{margin-bottom:.4em;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;-ms-border-radius:4px 0 0 4px;-o-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.ink-tabs.left>.tabs-nav li.active{margin:0 -2px 0 0}.ink-tabs.left>.tabs-nav li.active a{border-right-color:transparent}.ink-tabs.right>.tabs-nav{border-left:1px solid #ccc;float:right;margin-left:2em}.ink-tabs.right>.tabs-nav li{float:none}.ink-tabs.right>.tabs-nav li a{margin-bottom:.4em;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;-ms-border-radius:0 4px 4px 0;-o-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.ink-tabs.right>.tabs-nav li.active{margin:0 0 0 -2px}.ink-tabs.right>.tabs-nav li.active a{border-left-color:transparent}.ink-tagfield input[type=text].new-tag-input{background-color:#fff;border:1px solid #ccc;line-height:1em;margin:0;padding:5px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-tagfield input[type=text].new-tag-input:focus{-webkit-box-shadow:0,0,0,3px,#eaeaea;-moz-box-shadow:0,0,0,3px,#eaeaea;box-shadow:0,0,0,3px,#eaeaea;border:1px solid #c3c3c3}.ink-tagfield span.ink-tag{background-color:#1b1b1b;color:#eaeaea;text-shadow:none;font-size:.9em;font-weight:400;border:1px solid #000;padding:4px 6px}.ink-tagfield span.ink-tag i.icon-remove{color:#ccc;font-size:.9em;font-weight:400;margin-left:4px}.ink-tagfield span.ink-tag i.icon-remove:hover{cursor:pointer;color:red}.ink-tooltip{display:inline-block;position:relative}.ink-tooltip>.content{background:#f0f0f0;padding:.5em .6em;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;font-size:.8em;color:#8c8c8c}.ink-tooltip>.arrow{position:absolute}.ink-tooltip>.arrow.down,.ink-tooltip>.arrow.left,.ink-tooltip>.arrow.right,.ink-tooltip>.arrow.up{width:0;height:0}.ink-tooltip>.arrow.up{border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #f0f0f0;top:-6px;left:50%;margin-left:-3px}.ink-tooltip>.arrow.down{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #f0f0f0;bottom:-5.45455px;left:50%;margin-left:-3px}.ink-tooltip>.arrow.right{border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:6px solid #f0f0f0;top:50%;right:-5.45455px;margin-top:-6px}.ink-tooltip>.arrow.left{border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:6px solid #f0f0f0;top:50%;left:-5.45455px;margin-top:-6px}.ink-tooltip.blue>.content{background:#0f75da;color:#fff}.ink-tooltip.blue>.arrow.up{border-bottom-color:#0f75da}.ink-tooltip.blue>.arrow.down{border-top-color:#0f75da}.ink-tooltip.blue>.arrow.left{border-right-color:#0f75da}.ink-tooltip.blue>.arrow.right{border-left-color:#0f75da}.ink-tooltip.red>.content{background:#c91111;color:#fff}.ink-tooltip.red>.arrow.up{border-bottom-color:#c91111}.ink-tooltip.red>.arrow.down{border-top-color:#c91111}.ink-tooltip.red>.arrow.left{border-right-color:#c91111}.ink-tooltip.red>.arrow.right{border-left-color:#c91111}.ink-tooltip.orange>.content{background:#ff9c00;color:#fff}.ink-tooltip.orange>.arrow.up{border-bottom-color:#ff9c00}.ink-tooltip.orange>.arrow.down{border-top-color:#ff9c00}.ink-tooltip.orange>.arrow.left{border-right-color:#ff9c00}.ink-tooltip.orange>.arrow.right{border-left-color:#ff9c00}.ink-tooltip.green>.content{background:#4a9b17;color:#fff}.ink-tooltip.green>.arrow.up{border-bottom-color:#4a9b17}.ink-tooltip.green>.arrow.down{border-top-color:#4a9b17}.ink-tooltip.green>.arrow.left{border-right-color:#4a9b17}.ink-tooltip.green>.arrow.right{border-left-color:#4a9b17}.ink-tooltip.black>.content{background:#000;color:#fff}.ink-tooltip.black>.arrow.up{border-bottom-color:#000}.ink-tooltip.black>.arrow.down{border-top-color:#000}.ink-tooltip.black>.arrow.left{border-right-color:#000}.ink-tooltip.black>.arrow.right{border-left-color:#000}.ink-tooltip.grey>.content{background:#ccc;color:#333}.ink-tooltip.grey>.arrow.up{border-bottom-color:#ccc}.ink-tooltip.grey>.arrow.down{border-top-color:#ccc}.ink-tooltip.grey>.arrow.left{border-right-color:#ccc}.ink-tooltip.grey>.arrow.right{border-left-color:#ccc}.ink-tree-view li{list-style-type:none}.ink-tree-view [data-open]>:before{margin-left:-1.3em;margin-right:.4em;text-decoration:none} \ No newline at end of file diff --git a/public/css/ink-ie.css b/public/css/ink-ie.css new file mode 100644 index 0000000..6e7cfcf --- /dev/null +++ b/public/css/ink-ie.css @@ -0,0 +1,896 @@ +/** + * Ink + * + * A set of tools for quick development of web interfaces. + * + * @package Ink + * @author Sapo Ink Team + * @license http://opensource.org/licenses/MIT MIT + * @link http://ink.sapo.pt + * @version 3.0.5 + */ +/** + * Ink class names prefix + * Used in all of Inks components root elements + */ +/** + * Grid class names + */ +/** + * Alerts class names + */ +/** + * Badges class names + */ +/** + * Buttons class names + */ +/** + * Forms class names + */ +/** + * Labels class names + */ +/** + * Navigation class names + */ +/** + * Dropdown class names + */ +/** + * Tables class names + */ +/** + * Images class names + */ +/** + * JS UI components classe names + */ +/** + * Sets the grids maximum width + * @var $grid-max-width (pixels|ems|percentage) + */ +/*! + * Sets the grids breakpoint + * + * To add a new break point you'll need to add an element to the list. + * + * Here's an example: ( class-name-prefix, minimum-width, maximum-width, gutter-width, no-media-query). + * + * media: media type. + * class-name-prefix: this is the prefix used in tons of inks classes i.e.: large-100, small-40, etc. + * minimum-width: (pixels|null) the minimum width for the breakpoint + * maximum-width: (pixels|null) the maximum width for the breakpoint + * gutter-width: (ems) the width for the gutters (space between grid columns) for the breakpoint + * no-media-query: (true|false) if you need to support IE8 set this to true on a single breakpoint. + * Since IE8 does not support the @media statement leaving one of the breakpoints + * outside a @media query let's you use the grid in IE8. + * + */ +.ink-grid { + width: auto; + max-width: 1440px; + margin: 0 auto; +} + +.ink-grid { + padding: 0 1.75em; +} + +.column-group > [class*=large-] { + float: left; + clear: none; +} + +.large-5 { + width: 5%; +} + +.large-10 { + width: 10%; +} + +.large-15 { + width: 15%; +} + +.large-16 { + width: 16.66%; +} + +.large-20 { + width: 20%; +} + +.large-25 { + width: 25%; +} + +.large-30 { + width: 30%; +} + +.large-33 { + width: 33.33%; +} + +.large-35 { + width: 35%; +} + +.large-40 { + width: 40%; +} + +.large-45 { + width: 45%; +} + +.large-50 { + width: 50%; +} + +.large-55 { + width: 55%; +} + +.large-60 { + width: 60%; +} + +.large-65 { + width: 65%; +} + +.large-66 { + width: 66.66%; +} + +.large-70 { + width: 70%; +} + +.large-75 { + width: 75%; +} + +.large-80 { + width: 80%; +} + +.large-85 { + width: 85%; +} + +.large-90 { + width: 90%; +} + +.large-95 { + width: 95%; +} + +.large-100 { + width: 100%; +} + +[class*=large-100] { + float: none; + clear: both; +} + +.column-group { + *zoom: 1; +} +.column-group:after { + content: ""; + display: table; + clear: both; +} + +.column-group.gutters { + margin-left: -1.75em; +} +.column-group.gutters > [class*=large-], .column-group.gutters > [class*=all-] { + padding-left: 1.75em; + margin-bottom: 1.75em; +} + +.column-group.horizontal-gutters { + margin-left: -1.75em; +} +.column-group.horizontal-gutters > [class*=large-], .column-group.horizontal-gutters > [class*=all-] { + padding-left: 1.75em; +} + +.column-group.vertical-gutters > [class*=large-], .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 1.75em; +} + +.column-group.double-gutters { + margin-left: -3.5em; +} +.column-group.double-gutters > [class*=large-], .column-group.double-gutters > [class*=all-] { + padding-left: 3.5em; + margin-bottom: 3.5em; +} + +.column-group.double-horizontal-gutters { + margin-left: -3.5em; +} +.column-group.double-horizontal-gutters > [class*=large-], .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 3.5em; +} + +.column-group.double-vertical-gutters > [class*=large-], .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 3.5em; +} + +.column-group.half-gutters { + margin-left: -0.875em; +} +.column-group.half-gutters > [class*=large-], .column-group.half-gutters > [class*=all-] { + padding-left: 0.875em; + margin-bottom: 0.875em; +} + +.column-group.half-horizontal-gutters { + margin-left: -0.875em; +} +.column-group.half-horizontal-gutters > [class*=large-], .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 0.875em; +} + +.column-group.half-vertical-gutters > [class*=large-], .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 0.875em; +} + +.column-group.quarter-gutters { + margin-left: -0.4375em; +} +.column-group.quarter-gutters > [class*=large-], .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.4375em; + margin-bottom: 0.4375em; +} + +.column-group.quarter-horizontal-gutters { + margin-left: -0.4375em; +} +.column-group.quarter-horizontal-gutters > [class*=large-], .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.4375em; +} + +.column-group.quarter-vertical-gutters > [class*=large-], .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.4375em; +} + +.column-group.large-gutters { + margin-left: -1.75em; +} +.column-group.large-gutters > [class*=large-], .column-group.large-gutters > [class*=all-] { + padding-left: 1.75em; + margin-bottom: 1.75em; +} + +.column-group.large-horizontal-gutters { + margin-left: -1.75em; +} +.column-group.large-horizontal-gutters > [class*=large-], .column-group.large-horizontal-gutters > [class*=all-] { + padding-left: 1.75em; +} + +.column-group.large-vertical-gutters > [class*=large-], .column-group.large-vertical-gutters > [class*=all-] { + margin-bottom: 1.75em; +} + +.column-group.large-double-gutters { + margin-left: -3.5em; +} +.column-group.large-double-gutters > [class*=large-], .column-group.large-double-gutters > [class*=all-] { + padding-left: 3.5em; + margin-bottom: 3.5em; +} + +.column-group.large-double-horizontal-gutters { + margin-left: -3.5em; +} +.column-group.large-double-horizontal-gutters > [class*=large-], .column-group.large-double-horizontal-gutters > [class*=all-] { + padding-left: 3.5em; +} + +.column-group.large-double-vertical-gutters > [class*=large-], .column-group.large-double-vertical-gutters > [class*=all-] { + margin-bottom: 3.5em; +} + +.column-group.large-half-gutters { + margin-left: -0.875em; +} +.column-group.large-half-gutters > [class*=large-], .column-group.large-half-gutters > [class*=all-] { + padding-left: 0.875em; + margin-bottom: 0.875em; +} + +.column-group.large-half-horizontal-gutters { + margin-left: -0.875em; +} +.column-group.large-half-horizontal-gutters > [class*=large-], .column-group.large-half-horizontal-gutters > [class*=all-] { + padding-left: 0.875em; +} + +.column-group.large-half-vertical-gutters > [class*=large-], .column-group.large-half-vertical-gutters > [class*=all-] { + margin-bottom: 0.875em; +} + +.column-group.large-quarter-gutters { + margin-left: -0.4375em; +} +.column-group.large-quarter-gutters > [class*=large-], .column-group.large-quarter-gutters > [class*=all-] { + padding-left: 0.4375em; + margin-bottom: 0.4375em; +} + +.column-group.large-quarter-horizontal-gutters { + margin-left: -0.4375em; +} +.column-group.large-quarter-horizontal-gutters > [class*=large-], .column-group.large-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.4375em; +} + +.column-group.large-quarter-vertical-gutters > [class*=large-], .column-group.large-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.4375em; +} + +.column-group.large-no-gutters { + margin-left: 0; +} +.column-group.large-no-gutters > [class*=large-], .column-group.large-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; +} + +.ink-table td[class*=large-], .ink-table th[class*=large-], .ink-table tr[class*=large-], .ink-table thead[class*=large-], .ink-table tbody[class*=large-], .ink-table tfoot[class*=large-] { + float: none; +} + +.large-push-left { + float: left; +} + +.large-push-center { + float: none; + margin-left: auto; + margin-right: auto; +} + +.large-push-right { + float: right; +} + +.large-align-left { + text-align: left; +} + +.large-align-center { + text-align: center; +} + +.large-align-right { + text-align: right; +} + +.large-no-margin { + margin: 0 !important; +} + +.space { + margin: 1.75em; +} + +.large-space { + margin: 1.75em; +} + +.padding { + padding: 1.75em; +} + +.large-padding { + padding: 1.75em; +} + +.double-space { + margin: 3.5em; +} + +.large-double-space { + margin: 3.5em; +} + +.double-padding { + padding: 3.5em; +} + +.large-double-padding { + padding: 3.5em; +} + +.half-space { + margin: 0.875em; +} + +.large-half-space { + margin: 0.875em; +} + +.half-padding { + padding: 0.875em; +} + +.large-half-padding { + padding: 0.875em; +} + +.quarter-space { + margin: 0.4375em; +} + +.large-quarter-space { + margin: 0.4375em; +} + +.quarter-padding { + padding: 0.4375em; +} + +.large-quarter-padding { + padding: 0.4375em; +} + +.vertical-space { + margin-top: 1.75em; + margin-bottom: 1.75em; +} + +.large-vertical-space { + margin-top: 1.75em; + margin-bottom: 1.75em; +} + +.vertical-padding { + padding-top: 1.75em; + padding-bottom: 1.75em; +} + +.large-vertical-padding { + padding-top: 1.75em; + padding-bottom: 1.75em; +} + +.double-vertical-space { + margin-top: 3.5em; + margin-bottom: 3.5em; +} + +.large-double-vertical-space { + margin-top: 3.5em; + margin-bottom: 3.5em; +} + +.double-vertical-padding { + padding-top: 3.5em; + padding-bottom: 3.5em; +} + +.large-double-vertical-padding { + padding-top: 3.5em; + padding-bottom: 3.5em; +} + +.half-vertical-space { + margin-top: 0.875em; + margin-bottom: 0.875em; +} + +.large-half-vertical-space { + margin-top: 0.875em; + margin-bottom: 0.875em; +} + +.half-vertical-padding { + padding-top: 0.875em; + padding-bottom: 0.875em; +} + +.large-half-vertical-padding { + padding-top: 0.875em; + padding-bottom: 0.875em; +} + +.quarter-vertical-space { + margin-top: 0.4375em; + margin-bottom: 0.4375em; +} + +.large-quarter-vertical-space { + margin-top: 0.4375em; + margin-bottom: 0.4375em; +} + +.quarter-vertical-padding { + padding-top: 0.4375em; + padding-bottom: 0.4375em; +} + +.large-quarter-vertical-padding { + padding-top: 0.4375em; + padding-bottom: 0.4375em; +} + +.horizontal-space { + margin-left: 1.75em; + margin-right: 1.75em; +} + +.large-horizontal-space { + margin-left: 1.75em; + margin-right: 1.75em; +} + +.horizontal-padding { + padding-left: 1.75em; + padding-right: 1.75em; +} + +.large-horizontal-padding { + padding-left: 1.75em; + padding-right: 1.75em; +} + +.double-horizontal-space { + margin-left: 3.5em; + margin-right: 3.5em; +} + +.large-double-horizontal-space { + margin-left: 3.5em; + margin-right: 3.5em; +} + +.double-horizontal-padding { + padding-left: 3.5em; + padding-right: 3.5em; +} + +.large-double-horizontal-padding { + padding-left: 3.5em; + padding-right: 3.5em; +} + +.half-horizontal-space { + margin-left: 0.875em; + margin-right: 0.875em; +} + +.large-half-horizontal-space { + margin-left: 0.875em; + margin-right: 0.875em; +} + +.half-horizontal-padding { + padding-left: 0.875em; + padding-right: 0.875em; +} + +.large-half-horizontal-padding { + padding-left: 0.875em; + padding-right: 0.875em; +} + +.quarter-horizontal-space { + margin-left: 0.4375em; + margin-right: 0.4375em; +} + +.large-quarter-horizontal-space { + margin-left: 0.4375em; + margin-right: 0.4375em; +} + +.quarter-horizontal-padding { + padding-left: 0.4375em; + padding-right: 0.4375em; +} + +.large-quarter-horizontal-padding { + padding-left: 0.4375em; + padding-right: 0.4375em; +} + +.top-space { + margin-top: 1.75em; +} + +.large-top-space { + margin-top: 1.75em; +} + +.top-padding { + padding-top: 1.75em; +} + +.large-top-padding { + padding-top: 1.75em; +} + +.double-top-space { + margin-top: 3.5em; +} + +.large-double-top-space { + margin-top: 3.5em; +} + +.double-top-padding { + padding-top: 3.5em; +} + +.large-double-top-padding { + padding-top: 3.5em; +} + +.half-top-space { + margin-top: 0.875em; +} + +.large-half-top-space { + margin-top: 0.875em; +} + +.half-top-padding { + padding-top: 0.875em; +} + +.large-half-top-padding { + padding-top: 0.875em; +} + +.quarter-top-space { + margin-top: 0.4375em; +} + +.large-quarter-top-space { + margin-top: 0.4375em; +} + +.quarter-top-padding { + padding-top: 0.4375em; +} + +.large-quarter-top-padding { + padding-top: 0.4375em; +} + +.right-space { + margin-right: 1.75em; +} + +.large-right-space { + margin-right: 1.75em; +} + +.right-padding { + padding-right: 1.75em; +} + +.large-right-padding { + padding-right: 1.75em; +} + +.double-right-space { + margin-right: 3.5em; +} + +.large-double-right-space { + margin-right: 3.5em; +} + +.double-right-padding { + padding-right: 3.5em; +} + +.large-double-right-padding { + padding-right: 3.5em; +} + +.half-right-space { + margin-right: 0.875em; +} + +.large-half-right-space { + margin-right: 0.875em; +} + +.half-right-padding { + padding-right: 0.875em; +} + +.large-half-right-padding { + padding-right: 0.875em; +} + +.quarter-right-space { + margin-right: 0.4375em; +} + +.large-quarter-right-space { + margin-right: 0.4375em; +} + +.quarter-right-padding { + padding-right: 0.4375em; +} + +.large-quarter-right-padding { + padding-right: 0.4375em; +} + +.bottom-space { + margin-bottom: 1.75em; +} + +.large-bottom-space { + margin-bottom: 1.75em; +} + +.bottom-padding { + padding-bottom: 1.75em; +} + +.large-bottom-padding { + padding-bottom: 1.75em; +} + +.double-bottom-space { + margin-bottom: 3.5em; +} + +.large-double-bottom-space { + margin-bottom: 3.5em; +} + +.double-bottom-padding { + padding-bottom: 3.5em; +} + +.large-double-bottom-padding { + padding-bottom: 3.5em; +} + +.half-bottom-space { + margin-bottom: 0.875em; +} + +.large-half-bottom-space { + margin-bottom: 0.875em; +} + +.half-bottom-padding { + padding-bottom: 0.875em; +} + +.large-half-bottom-padding { + padding-bottom: 0.875em; +} + +.quarter-bottom-space { + margin-bottom: 0.4375em; +} + +.large-quarter-bottom-space { + margin-bottom: 0.4375em; +} + +.quarter-bottom-padding { + padding-bottom: 0.4375em; +} + +.large-quarter-bottom-padding { + padding-bottom: 0.4375em; +} + +.left-space { + margin-left: 1.75em; +} + +.large-left-space { + margin-left: 1.75em; +} + +.left-padding { + padding-left: 1.75em; +} + +.large-left-padding { + padding-left: 1.75em; +} + +.double-left-space { + margin-left: 3.5em; +} + +.large-double-left-space { + margin-left: 3.5em; +} + +.double-left-padding { + padding-left: 3.5em; +} + +.large-double-left-padding { + padding-left: 3.5em; +} + +.half-left-space { + margin-left: 0.875em; +} + +.large-half-left-space { + margin-left: 0.875em; +} + +.half-left-padding { + padding-left: 0.875em; +} + +.large-half-left-padding { + padding-left: 0.875em; +} + +.quarter-left-space { + margin-left: 0.4375em; +} + +.large-quarter-left-space { + margin-left: 0.4375em; +} + +.quarter-left-padding { + padding-left: 0.4375em; +} + +.large-quarter-left-padding { + padding-left: 0.4375em; +} + +.hide-large { + display: none !important; +} + +.show-large { + display: inherit !important; +} + +table.show-large { + display: table; +} + +thead.show-large { + display: table-header-group; +} + +tbody.show-large { + display: table-row-group; +} + +tfoot.show-large { + display: table-footer-group; +} + +tr.show-large { + display: table-row; +} + +th.show-large, +td.show-large { + display: table-cell; +} diff --git a/public/css/ink-ie.min.css b/public/css/ink-ie.min.css new file mode 100644 index 0000000..362447a --- /dev/null +++ b/public/css/ink-ie.min.css @@ -0,0 +1 @@ +.ink-grid{width:auto;max-width:1440px;margin:0 auto;padding:0 1.75em}.column-group>[class*=large-]{float:left;clear:none}.large-5{width:5%}.large-10{width:10%}.large-15{width:15%}.large-16{width:16.66%}.large-20{width:20%}.large-25{width:25%}.large-30{width:30%}.large-33{width:33.33%}.large-35{width:35%}.large-40{width:40%}.large-45{width:45%}.large-50{width:50%}.large-55{width:55%}.large-60{width:60%}.large-65{width:65%}.large-66{width:66.66%}.large-70{width:70%}.large-75{width:75%}.large-80{width:80%}.large-85{width:85%}.large-90{width:90%}.large-95{width:95%}.large-100{width:100%}[class*=large-100]{float:none;clear:both}.column-group{*zoom:1}.column-group:after{content:"";display:table;clear:both}.column-group.gutters{margin-left:-1.75em}.column-group.gutters>[class*=all-],.column-group.gutters>[class*=large-]{padding-left:1.75em;margin-bottom:1.75em}.column-group.horizontal-gutters{margin-left:-1.75em}.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=large-]{padding-left:1.75em}.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=large-]{margin-bottom:1.75em}.column-group.double-gutters{margin-left:-3.5em}.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=large-]{padding-left:3.5em;margin-bottom:3.5em}.column-group.double-horizontal-gutters{margin-left:-3.5em}.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=large-]{padding-left:3.5em}.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=large-]{margin-bottom:3.5em}.column-group.half-gutters{margin-left:-.875em}.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=large-]{padding-left:.875em;margin-bottom:.875em}.column-group.half-horizontal-gutters{margin-left:-.875em}.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=large-]{padding-left:.875em}.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=large-]{margin-bottom:.875em}.column-group.quarter-gutters{margin-left:-.4375em}.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=large-]{padding-left:.4375em;margin-bottom:.4375em}.column-group.quarter-horizontal-gutters{margin-left:-.4375em}.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=large-]{padding-left:.4375em}.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=large-]{margin-bottom:.4375em}.column-group.large-gutters{margin-left:-1.75em}.column-group.large-gutters>[class*=all-],.column-group.large-gutters>[class*=large-]{padding-left:1.75em;margin-bottom:1.75em}.column-group.large-horizontal-gutters{margin-left:-1.75em}.column-group.large-horizontal-gutters>[class*=all-],.column-group.large-horizontal-gutters>[class*=large-]{padding-left:1.75em}.column-group.large-vertical-gutters>[class*=all-],.column-group.large-vertical-gutters>[class*=large-]{margin-bottom:1.75em}.column-group.large-double-gutters{margin-left:-3.5em}.column-group.large-double-gutters>[class*=all-],.column-group.large-double-gutters>[class*=large-]{padding-left:3.5em;margin-bottom:3.5em}.column-group.large-double-horizontal-gutters{margin-left:-3.5em}.column-group.large-double-horizontal-gutters>[class*=all-],.column-group.large-double-horizontal-gutters>[class*=large-]{padding-left:3.5em}.column-group.large-double-vertical-gutters>[class*=all-],.column-group.large-double-vertical-gutters>[class*=large-]{margin-bottom:3.5em}.column-group.large-half-gutters{margin-left:-.875em}.column-group.large-half-gutters>[class*=all-],.column-group.large-half-gutters>[class*=large-]{padding-left:.875em;margin-bottom:.875em}.column-group.large-half-horizontal-gutters{margin-left:-.875em}.column-group.large-half-horizontal-gutters>[class*=all-],.column-group.large-half-horizontal-gutters>[class*=large-]{padding-left:.875em}.column-group.large-half-vertical-gutters>[class*=all-],.column-group.large-half-vertical-gutters>[class*=large-]{margin-bottom:.875em}.column-group.large-quarter-gutters{margin-left:-.4375em}.column-group.large-quarter-gutters>[class*=all-],.column-group.large-quarter-gutters>[class*=large-]{padding-left:.4375em;margin-bottom:.4375em}.column-group.large-quarter-horizontal-gutters{margin-left:-.4375em}.column-group.large-quarter-horizontal-gutters>[class*=all-],.column-group.large-quarter-horizontal-gutters>[class*=large-]{padding-left:.4375em}.column-group.large-quarter-vertical-gutters>[class*=all-],.column-group.large-quarter-vertical-gutters>[class*=large-]{margin-bottom:.4375em}.column-group.large-no-gutters{margin-left:0}.column-group.large-no-gutters>[class*=all-],.column-group.large-no-gutters>[class*=large-]{padding-left:0;margin-bottom:0}.ink-table tbody[class*=large-],.ink-table td[class*=large-],.ink-table tfoot[class*=large-],.ink-table th[class*=large-],.ink-table thead[class*=large-],.ink-table tr[class*=large-]{float:none}.large-push-left{float:left}.large-push-center{float:none;margin-left:auto;margin-right:auto}.large-push-right{float:right}.large-align-left{text-align:left}.large-align-center{text-align:center}.large-align-right{text-align:right}.large-no-margin{margin:0!important}.large-space,.space{margin:1.75em}.large-padding,.padding{padding:1.75em}.double-space,.large-double-space{margin:3.5em}.double-padding,.large-double-padding{padding:3.5em}.half-space,.large-half-space{margin:.875em}.half-padding,.large-half-padding{padding:.875em}.large-quarter-space,.quarter-space{margin:.4375em}.large-quarter-padding,.quarter-padding{padding:.4375em}.large-vertical-space,.vertical-space{margin-top:1.75em;margin-bottom:1.75em}.large-vertical-padding,.vertical-padding{padding-top:1.75em;padding-bottom:1.75em}.double-vertical-space,.large-double-vertical-space{margin-top:3.5em;margin-bottom:3.5em}.double-vertical-padding,.large-double-vertical-padding{padding-top:3.5em;padding-bottom:3.5em}.half-vertical-space,.large-half-vertical-space{margin-top:.875em;margin-bottom:.875em}.half-vertical-padding,.large-half-vertical-padding{padding-top:.875em;padding-bottom:.875em}.large-quarter-vertical-space,.quarter-vertical-space{margin-top:.4375em;margin-bottom:.4375em}.large-quarter-vertical-padding,.quarter-vertical-padding{padding-top:.4375em;padding-bottom:.4375em}.horizontal-space,.large-horizontal-space{margin-left:1.75em;margin-right:1.75em}.horizontal-padding,.large-horizontal-padding{padding-left:1.75em;padding-right:1.75em}.double-horizontal-space,.large-double-horizontal-space{margin-left:3.5em;margin-right:3.5em}.double-horizontal-padding,.large-double-horizontal-padding{padding-left:3.5em;padding-right:3.5em}.half-horizontal-space,.large-half-horizontal-space{margin-left:.875em;margin-right:.875em}.half-horizontal-padding,.large-half-horizontal-padding{padding-left:.875em;padding-right:.875em}.large-quarter-horizontal-space,.quarter-horizontal-space{margin-left:.4375em;margin-right:.4375em}.large-quarter-horizontal-padding,.quarter-horizontal-padding{padding-left:.4375em;padding-right:.4375em}.large-top-space,.top-space{margin-top:1.75em}.large-top-padding,.top-padding{padding-top:1.75em}.double-top-space,.large-double-top-space{margin-top:3.5em}.double-top-padding,.large-double-top-padding{padding-top:3.5em}.half-top-space,.large-half-top-space{margin-top:.875em}.half-top-padding,.large-half-top-padding{padding-top:.875em}.large-quarter-top-space,.quarter-top-space{margin-top:.4375em}.large-quarter-top-padding,.quarter-top-padding{padding-top:.4375em}.large-right-space,.right-space{margin-right:1.75em}.large-right-padding,.right-padding{padding-right:1.75em}.double-right-space,.large-double-right-space{margin-right:3.5em}.double-right-padding,.large-double-right-padding{padding-right:3.5em}.half-right-space,.large-half-right-space{margin-right:.875em}.half-right-padding,.large-half-right-padding{padding-right:.875em}.large-quarter-right-space,.quarter-right-space{margin-right:.4375em}.large-quarter-right-padding,.quarter-right-padding{padding-right:.4375em}.bottom-space,.large-bottom-space{margin-bottom:1.75em}.bottom-padding,.large-bottom-padding{padding-bottom:1.75em}.double-bottom-space,.large-double-bottom-space{margin-bottom:3.5em}.double-bottom-padding,.large-double-bottom-padding{padding-bottom:3.5em}.half-bottom-space,.large-half-bottom-space{margin-bottom:.875em}.half-bottom-padding,.large-half-bottom-padding{padding-bottom:.875em}.large-quarter-bottom-space,.quarter-bottom-space{margin-bottom:.4375em}.large-quarter-bottom-padding,.quarter-bottom-padding{padding-bottom:.4375em}.large-left-space,.left-space{margin-left:1.75em}.large-left-padding,.left-padding{padding-left:1.75em}.double-left-space,.large-double-left-space{margin-left:3.5em}.double-left-padding,.large-double-left-padding{padding-left:3.5em}.half-left-space,.large-half-left-space{margin-left:.875em}.half-left-padding,.large-half-left-padding{padding-left:.875em}.large-quarter-left-space,.quarter-left-space{margin-left:.4375em}.large-quarter-left-padding,.quarter-left-padding{padding-left:.4375em}.hide-large{display:none!important}.show-large{display:inherit!important}table.show-large{display:table}thead.show-large{display:table-header-group}tbody.show-large{display:table-row-group}tfoot.show-large{display:table-footer-group}tr.show-large{display:table-row}td.show-large,th.show-large{display:table-cell} \ No newline at end of file diff --git a/public/css/ink-legacy.css b/public/css/ink-legacy.css new file mode 100644 index 0000000..080dee2 --- /dev/null +++ b/public/css/ink-legacy.css @@ -0,0 +1,4685 @@ +/** + * Ink + * + * A set of tools for quick development of web interfaces. + * + * @package Ink + * @author Sapo Ink Team + * @license http://opensource.org/licenses/MIT MIT + * @link http://ink.sapo.pt + * @version 3.0.5 + */ +/** + * Ink class names prefix + * Used in all of Inks components root elements + */ +/** + * Grid class names + */ +/** + * Alerts class names + */ +/** + * Badges class names + */ +/** + * Buttons class names + */ +/** + * Forms class names + */ +/** + * Labels class names + */ +/** + * Navigation class names + */ +/** + * Dropdown class names + */ +/** + * Tables class names + */ +/** + * Images class names + */ +/** + * JS UI components classe names + */ +/** + * Sets the grids maximum width + * @var $grid-max-width (pixels|ems|percentage) + */ +/*! + * Sets the grids breakpoint + * + * To add a new break point you'll need to add an element to the list. + * + * Here's an example: ( class-name-prefix, minimum-width, maximum-width, gutter-width, no-media-query). + * + * media: media type. + * class-name-prefix: this is the prefix used in tons of inks classes i.e.: large-100, small-40, etc. + * minimum-width: (pixels|null) the minimum width for the breakpoint + * maximum-width: (pixels|null) the maximum width for the breakpoint + * gutter-width: (ems) the width for the gutters (space between grid columns) for the breakpoint + * no-media-query: (true|false) if you need to support IE8 set this to true on a single breakpoint. + * Since IE8 does not support the @media statement leaving one of the breakpoints + * outside a @media query let's you use the grid in IE8. + * + */ +.show-all { + display: inherit; +} + +.hide-all { + display: none !important; +} + +.no-margin { + margin: 0 !important; +} + +.no-padding { + padding: 0 !important; +} + +.push-left { + float: left; +} + +.push-center { + float: none !important; + margin-left: auto; + margin-right: auto; +} + +.push-right { + float: right; + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + justify-content: flex-end; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +.clearfix { + *zoom: 1; + overflow: hidden; + *zoom: 1; +} +.clearfix:after { + content: ""; + display: table; + clear: both; +} + +html.no-flexbox, +html.no-flexboxlegacy { + font-size: 0.97em; +} +html.no-flexbox .ink-grid, +html.no-flexboxlegacy .ink-grid { + width: auto; + max-width: 1440px; + margin: 0 auto; +} +html.no-flexbox .all-5, +html.no-flexboxlegacy .all-5 { + width: 5%; + float: left; + clear: none; +} +html.no-flexbox .all-10, +html.no-flexboxlegacy .all-10 { + width: 10%; + float: left; + clear: none; +} +html.no-flexbox .all-15, +html.no-flexboxlegacy .all-15 { + width: 15%; + float: left; + clear: none; +} +html.no-flexbox .all-16, +html.no-flexboxlegacy .all-16 { + width: 16.66%; + float: left; + clear: none; +} +html.no-flexbox .all-20, +html.no-flexboxlegacy .all-20 { + width: 20%; + float: left; + clear: none; +} +html.no-flexbox .all-25, +html.no-flexboxlegacy .all-25 { + width: 25%; + float: left; + clear: none; +} +html.no-flexbox .all-30, +html.no-flexboxlegacy .all-30 { + width: 30%; + float: left; + clear: none; +} +html.no-flexbox .all-33, +html.no-flexboxlegacy .all-33 { + width: 33.33%; + float: left; + clear: none; +} +html.no-flexbox .all-35, +html.no-flexboxlegacy .all-35 { + width: 35%; + float: left; + clear: none; +} +html.no-flexbox .all-40, +html.no-flexboxlegacy .all-40 { + width: 40%; + float: left; + clear: none; +} +html.no-flexbox .all-45, +html.no-flexboxlegacy .all-45 { + width: 45%; + float: left; + clear: none; +} +html.no-flexbox .all-50, +html.no-flexboxlegacy .all-50 { + width: 50%; + float: left; + clear: none; +} +html.no-flexbox .all-55, +html.no-flexboxlegacy .all-55 { + width: 55%; + float: left; + clear: none; +} +html.no-flexbox .all-60, +html.no-flexboxlegacy .all-60 { + width: 60%; + float: left; + clear: none; +} +html.no-flexbox .all-65, +html.no-flexboxlegacy .all-65 { + width: 65%; + float: left; + clear: none; +} +html.no-flexbox .all-66, +html.no-flexboxlegacy .all-66 { + width: 66.66%; + float: left; + clear: none; +} +html.no-flexbox .all-70, +html.no-flexboxlegacy .all-70 { + width: 70%; + float: left; + clear: none; +} +html.no-flexbox .all-75, +html.no-flexboxlegacy .all-75 { + width: 75%; + float: left; + clear: none; +} +html.no-flexbox .all-80, +html.no-flexboxlegacy .all-80 { + width: 80%; + float: left; + clear: none; +} +html.no-flexbox .all-85, +html.no-flexboxlegacy .all-85 { + width: 85%; + float: left; + clear: none; +} +html.no-flexbox .all-90, +html.no-flexboxlegacy .all-90 { + width: 90%; + float: left; + clear: none; +} +html.no-flexbox .all-95, +html.no-flexboxlegacy .all-95 { + width: 95%; + float: left; + clear: none; +} +html.no-flexbox .all-100, +html.no-flexboxlegacy .all-100 { + width: 100%; + float: left; + clear: none; +} +html.no-flexbox [class~=all-100], +html.no-flexboxlegacy [class~=all-100] { + float: none; + clear: both; +} +@media screen and (min-width: 1261px) { + html.no-flexbox .ink-grid, + html.no-flexboxlegacy .ink-grid { + padding: 0 2em; + } + html.no-flexbox .column-group > [class*=xlarge-], + html.no-flexboxlegacy .column-group > [class*=xlarge-] { + float: left; + clear: none; + } + html.no-flexbox .xlarge-5, + html.no-flexboxlegacy .xlarge-5 { + width: 5%; + } + html.no-flexbox .xlarge-10, + html.no-flexboxlegacy .xlarge-10 { + width: 10%; + } + html.no-flexbox .xlarge-15, + html.no-flexboxlegacy .xlarge-15 { + width: 15%; + } + html.no-flexbox .xlarge-16, + html.no-flexboxlegacy .xlarge-16 { + width: 16.66%; + } + html.no-flexbox .xlarge-20, + html.no-flexboxlegacy .xlarge-20 { + width: 20%; + } + html.no-flexbox .xlarge-25, + html.no-flexboxlegacy .xlarge-25 { + width: 25%; + } + html.no-flexbox .xlarge-30, + html.no-flexboxlegacy .xlarge-30 { + width: 30%; + } + html.no-flexbox .xlarge-33, + html.no-flexboxlegacy .xlarge-33 { + width: 33.33%; + } + html.no-flexbox .xlarge-35, + html.no-flexboxlegacy .xlarge-35 { + width: 35%; + } + html.no-flexbox .xlarge-40, + html.no-flexboxlegacy .xlarge-40 { + width: 40%; + } + html.no-flexbox .xlarge-45, + html.no-flexboxlegacy .xlarge-45 { + width: 45%; + } + html.no-flexbox .xlarge-50, + html.no-flexboxlegacy .xlarge-50 { + width: 50%; + } + html.no-flexbox .xlarge-55, + html.no-flexboxlegacy .xlarge-55 { + width: 55%; + } + html.no-flexbox .xlarge-60, + html.no-flexboxlegacy .xlarge-60 { + width: 60%; + } + html.no-flexbox .xlarge-65, + html.no-flexboxlegacy .xlarge-65 { + width: 65%; + } + html.no-flexbox .xlarge-66, + html.no-flexboxlegacy .xlarge-66 { + width: 66.66%; + } + html.no-flexbox .xlarge-70, + html.no-flexboxlegacy .xlarge-70 { + width: 70%; + } + html.no-flexbox .xlarge-75, + html.no-flexboxlegacy .xlarge-75 { + width: 75%; + } + html.no-flexbox .xlarge-80, + html.no-flexboxlegacy .xlarge-80 { + width: 80%; + } + html.no-flexbox .xlarge-85, + html.no-flexboxlegacy .xlarge-85 { + width: 85%; + } + html.no-flexbox .xlarge-90, + html.no-flexboxlegacy .xlarge-90 { + width: 90%; + } + html.no-flexbox .xlarge-95, + html.no-flexboxlegacy .xlarge-95 { + width: 95%; + } + html.no-flexbox .xlarge-100, + html.no-flexboxlegacy .xlarge-100 { + width: 100%; + } + html.no-flexbox [class*=xlarge-100], + html.no-flexboxlegacy [class*=xlarge-100] { + float: none; + clear: both; + } + html.no-flexbox .column-group, + html.no-flexboxlegacy .column-group { + *zoom: 1; + } + html.no-flexbox .column-group:after, + html.no-flexboxlegacy .column-group:after { + content: ""; + display: table; + clear: both; + } + html.no-flexbox .column-group.gutters, + html.no-flexboxlegacy .column-group.gutters { + margin-left: -2em; + } + html.no-flexbox .column-group.gutters > [class*=xlarge-], html.no-flexbox .column-group.gutters > [class*=all-], + html.no-flexboxlegacy .column-group.gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.gutters > [class*=all-] { + padding-left: 2em; + margin-bottom: 2em; + } + html.no-flexbox .column-group.horizontal-gutters, + html.no-flexboxlegacy .column-group.horizontal-gutters { + margin-left: -2em; + } + html.no-flexbox .column-group.horizontal-gutters > [class*=xlarge-], html.no-flexbox .column-group.horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.horizontal-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.horizontal-gutters > [class*=all-] { + padding-left: 2em; + } + html.no-flexbox .column-group.vertical-gutters > [class*=xlarge-], html.no-flexbox .column-group.vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.vertical-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 2em; + } + html.no-flexbox .column-group.double-gutters, + html.no-flexboxlegacy .column-group.double-gutters { + margin-left: -4em; + } + html.no-flexbox .column-group.double-gutters > [class*=xlarge-], html.no-flexbox .column-group.double-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.double-gutters > [class*=all-] { + padding-left: 4em; + margin-bottom: 4em; + } + html.no-flexbox .column-group.double-horizontal-gutters, + html.no-flexboxlegacy .column-group.double-horizontal-gutters { + margin-left: -4em; + } + html.no-flexbox .column-group.double-horizontal-gutters > [class*=xlarge-], html.no-flexbox .column-group.double-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-horizontal-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 4em; + } + html.no-flexbox .column-group.double-vertical-gutters > [class*=xlarge-], html.no-flexbox .column-group.double-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-vertical-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 4em; + } + html.no-flexbox .column-group.half-gutters, + html.no-flexboxlegacy .column-group.half-gutters { + margin-left: -1em; + } + html.no-flexbox .column-group.half-gutters > [class*=xlarge-], html.no-flexbox .column-group.half-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.half-gutters > [class*=all-] { + padding-left: 1em; + margin-bottom: 1em; + } + html.no-flexbox .column-group.half-horizontal-gutters, + html.no-flexboxlegacy .column-group.half-horizontal-gutters { + margin-left: -1em; + } + html.no-flexbox .column-group.half-horizontal-gutters > [class*=xlarge-], html.no-flexbox .column-group.half-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-horizontal-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 1em; + } + html.no-flexbox .column-group.half-vertical-gutters > [class*=xlarge-], html.no-flexbox .column-group.half-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-vertical-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 1em; + } + html.no-flexbox .column-group.quarter-gutters, + html.no-flexboxlegacy .column-group.quarter-gutters { + margin-left: -0.5em; + } + html.no-flexbox .column-group.quarter-gutters > [class*=xlarge-], html.no-flexbox .column-group.quarter-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + html.no-flexbox .column-group.quarter-horizontal-gutters, + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters { + margin-left: -0.5em; + } + html.no-flexbox .column-group.quarter-horizontal-gutters > [class*=xlarge-], html.no-flexbox .column-group.quarter-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.5em; + } + html.no-flexbox .column-group.quarter-vertical-gutters > [class*=xlarge-], html.no-flexbox .column-group.quarter-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-vertical-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.5em; + } + html.no-flexbox .column-group.xlarge-gutters, + html.no-flexboxlegacy .column-group.xlarge-gutters { + margin-left: -2em; + } + html.no-flexbox .column-group.xlarge-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-gutters > [class*=all-] { + padding-left: 2em; + margin-bottom: 2em; + } + html.no-flexbox .column-group.xlarge-horizontal-gutters, + html.no-flexboxlegacy .column-group.xlarge-horizontal-gutters { + margin-left: -2em; + } + html.no-flexbox .column-group.xlarge-horizontal-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-horizontal-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-horizontal-gutters > [class*=all-] { + padding-left: 2em; + } + html.no-flexbox .column-group.xlarge-vertical-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-vertical-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-vertical-gutters > [class*=all-] { + margin-bottom: 2em; + } + html.no-flexbox .column-group.xlarge-double-gutters, + html.no-flexboxlegacy .column-group.xlarge-double-gutters { + margin-left: -4em; + } + html.no-flexbox .column-group.xlarge-double-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-double-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-double-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-double-gutters > [class*=all-] { + padding-left: 4em; + margin-bottom: 4em; + } + html.no-flexbox .column-group.xlarge-double-horizontal-gutters, + html.no-flexboxlegacy .column-group.xlarge-double-horizontal-gutters { + margin-left: -4em; + } + html.no-flexbox .column-group.xlarge-double-horizontal-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-double-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-double-horizontal-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-double-horizontal-gutters > [class*=all-] { + padding-left: 4em; + } + html.no-flexbox .column-group.xlarge-double-vertical-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-double-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-double-vertical-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-double-vertical-gutters > [class*=all-] { + margin-bottom: 4em; + } + html.no-flexbox .column-group.xlarge-half-gutters, + html.no-flexboxlegacy .column-group.xlarge-half-gutters { + margin-left: -1em; + } + html.no-flexbox .column-group.xlarge-half-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-half-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-half-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-half-gutters > [class*=all-] { + padding-left: 1em; + margin-bottom: 1em; + } + html.no-flexbox .column-group.xlarge-half-horizontal-gutters, + html.no-flexboxlegacy .column-group.xlarge-half-horizontal-gutters { + margin-left: -1em; + } + html.no-flexbox .column-group.xlarge-half-horizontal-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-half-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-half-horizontal-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-half-horizontal-gutters > [class*=all-] { + padding-left: 1em; + } + html.no-flexbox .column-group.xlarge-half-vertical-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-half-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-half-vertical-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-half-vertical-gutters > [class*=all-] { + margin-bottom: 1em; + } + html.no-flexbox .column-group.xlarge-quarter-gutters, + html.no-flexboxlegacy .column-group.xlarge-quarter-gutters { + margin-left: -0.5em; + } + html.no-flexbox .column-group.xlarge-quarter-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-quarter-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-quarter-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-quarter-gutters > [class*=all-] { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + html.no-flexbox .column-group.xlarge-quarter-horizontal-gutters, + html.no-flexboxlegacy .column-group.xlarge-quarter-horizontal-gutters { + margin-left: -0.5em; + } + html.no-flexbox .column-group.xlarge-quarter-horizontal-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-quarter-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-quarter-horizontal-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.5em; + } + html.no-flexbox .column-group.xlarge-quarter-vertical-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-quarter-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-quarter-vertical-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.5em; + } + html.no-flexbox .column-group.xlarge-no-gutters, + html.no-flexboxlegacy .column-group.xlarge-no-gutters { + margin-left: 0; + } + html.no-flexbox .column-group.xlarge-no-gutters > [class*=xlarge-], html.no-flexbox .column-group.xlarge-no-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.xlarge-no-gutters > [class*=xlarge-], + html.no-flexboxlegacy .column-group.xlarge-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; + } + html.no-flexbox .ink-table td[class*=xlarge-], html.no-flexbox .ink-table th[class*=xlarge-], html.no-flexbox .ink-table tr[class*=xlarge-], html.no-flexbox .ink-table thead[class*=xlarge-], html.no-flexbox .ink-table tbody[class*=xlarge-], html.no-flexbox .ink-table tfoot[class*=xlarge-], + html.no-flexboxlegacy .ink-table td[class*=xlarge-], + html.no-flexboxlegacy .ink-table th[class*=xlarge-], + html.no-flexboxlegacy .ink-table tr[class*=xlarge-], + html.no-flexboxlegacy .ink-table thead[class*=xlarge-], + html.no-flexboxlegacy .ink-table tbody[class*=xlarge-], + html.no-flexboxlegacy .ink-table tfoot[class*=xlarge-] { + float: none; + } + html.no-flexbox .xlarge-push-left, + html.no-flexboxlegacy .xlarge-push-left { + float: left; + } + html.no-flexbox .xlarge-push-center, + html.no-flexboxlegacy .xlarge-push-center { + float: none; + margin-left: auto; + margin-right: auto; + } + html.no-flexbox .xlarge-push-right, + html.no-flexboxlegacy .xlarge-push-right { + float: right; + } + html.no-flexbox .xlarge-align-left, + html.no-flexboxlegacy .xlarge-align-left { + text-align: left; + } + html.no-flexbox .xlarge-align-center, + html.no-flexboxlegacy .xlarge-align-center { + text-align: center; + } + html.no-flexbox .xlarge-align-right, + html.no-flexboxlegacy .xlarge-align-right { + text-align: right; + } + html.no-flexbox .xlarge-no-margin, + html.no-flexboxlegacy .xlarge-no-margin { + margin: 0 !important; + } + html.no-flexbox .space, + html.no-flexboxlegacy .space { + margin: 2em; + } + html.no-flexbox .xlarge-space, + html.no-flexboxlegacy .xlarge-space { + margin: 2em; + } + html.no-flexbox .padding, + html.no-flexboxlegacy .padding { + padding: 2em; + } + html.no-flexbox .xlarge-padding, + html.no-flexboxlegacy .xlarge-padding { + padding: 2em; + } + html.no-flexbox .double-space, + html.no-flexboxlegacy .double-space { + margin: 4em; + } + html.no-flexbox .xlarge-double-space, + html.no-flexboxlegacy .xlarge-double-space { + margin: 4em; + } + html.no-flexbox .double-padding, + html.no-flexboxlegacy .double-padding { + padding: 4em; + } + html.no-flexbox .xlarge-double-padding, + html.no-flexboxlegacy .xlarge-double-padding { + padding: 4em; + } + html.no-flexbox .half-space, + html.no-flexboxlegacy .half-space { + margin: 1em; + } + html.no-flexbox .xlarge-half-space, + html.no-flexboxlegacy .xlarge-half-space { + margin: 1em; + } + html.no-flexbox .half-padding, + html.no-flexboxlegacy .half-padding { + padding: 1em; + } + html.no-flexbox .xlarge-half-padding, + html.no-flexboxlegacy .xlarge-half-padding { + padding: 1em; + } + html.no-flexbox .quarter-space, + html.no-flexboxlegacy .quarter-space { + margin: 0.5em; + } + html.no-flexbox .xlarge-quarter-space, + html.no-flexboxlegacy .xlarge-quarter-space { + margin: 0.5em; + } + html.no-flexbox .quarter-padding, + html.no-flexboxlegacy .quarter-padding { + padding: 0.5em; + } + html.no-flexbox .xlarge-quarter-padding, + html.no-flexboxlegacy .xlarge-quarter-padding { + padding: 0.5em; + } + html.no-flexbox .vertical-space, + html.no-flexboxlegacy .vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + html.no-flexbox .xlarge-vertical-space, + html.no-flexboxlegacy .xlarge-vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + html.no-flexbox .vertical-padding, + html.no-flexboxlegacy .vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + html.no-flexbox .xlarge-vertical-padding, + html.no-flexboxlegacy .xlarge-vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + html.no-flexbox .double-vertical-space, + html.no-flexboxlegacy .double-vertical-space { + margin-top: 4em; + margin-bottom: 4em; + } + html.no-flexbox .xlarge-double-vertical-space, + html.no-flexboxlegacy .xlarge-double-vertical-space { + margin-top: 4em; + margin-bottom: 4em; + } + html.no-flexbox .double-vertical-padding, + html.no-flexboxlegacy .double-vertical-padding { + padding-top: 4em; + padding-bottom: 4em; + } + html.no-flexbox .xlarge-double-vertical-padding, + html.no-flexboxlegacy .xlarge-double-vertical-padding { + padding-top: 4em; + padding-bottom: 4em; + } + html.no-flexbox .half-vertical-space, + html.no-flexboxlegacy .half-vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + html.no-flexbox .xlarge-half-vertical-space, + html.no-flexboxlegacy .xlarge-half-vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + html.no-flexbox .half-vertical-padding, + html.no-flexboxlegacy .half-vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + html.no-flexbox .xlarge-half-vertical-padding, + html.no-flexboxlegacy .xlarge-half-vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + html.no-flexbox .quarter-vertical-space, + html.no-flexboxlegacy .quarter-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + html.no-flexbox .xlarge-quarter-vertical-space, + html.no-flexboxlegacy .xlarge-quarter-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + html.no-flexbox .quarter-vertical-padding, + html.no-flexboxlegacy .quarter-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + html.no-flexbox .xlarge-quarter-vertical-padding, + html.no-flexboxlegacy .xlarge-quarter-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + html.no-flexbox .horizontal-space, + html.no-flexboxlegacy .horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + html.no-flexbox .xlarge-horizontal-space, + html.no-flexboxlegacy .xlarge-horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + html.no-flexbox .horizontal-padding, + html.no-flexboxlegacy .horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + html.no-flexbox .xlarge-horizontal-padding, + html.no-flexboxlegacy .xlarge-horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + html.no-flexbox .double-horizontal-space, + html.no-flexboxlegacy .double-horizontal-space { + margin-left: 4em; + margin-right: 4em; + } + html.no-flexbox .xlarge-double-horizontal-space, + html.no-flexboxlegacy .xlarge-double-horizontal-space { + margin-left: 4em; + margin-right: 4em; + } + html.no-flexbox .double-horizontal-padding, + html.no-flexboxlegacy .double-horizontal-padding { + padding-left: 4em; + padding-right: 4em; + } + html.no-flexbox .xlarge-double-horizontal-padding, + html.no-flexboxlegacy .xlarge-double-horizontal-padding { + padding-left: 4em; + padding-right: 4em; + } + html.no-flexbox .half-horizontal-space, + html.no-flexboxlegacy .half-horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + html.no-flexbox .xlarge-half-horizontal-space, + html.no-flexboxlegacy .xlarge-half-horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + html.no-flexbox .half-horizontal-padding, + html.no-flexboxlegacy .half-horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + html.no-flexbox .xlarge-half-horizontal-padding, + html.no-flexboxlegacy .xlarge-half-horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + html.no-flexbox .quarter-horizontal-space, + html.no-flexboxlegacy .quarter-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + html.no-flexbox .xlarge-quarter-horizontal-space, + html.no-flexboxlegacy .xlarge-quarter-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + html.no-flexbox .quarter-horizontal-padding, + html.no-flexboxlegacy .quarter-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + html.no-flexbox .xlarge-quarter-horizontal-padding, + html.no-flexboxlegacy .xlarge-quarter-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + html.no-flexbox .top-space, + html.no-flexboxlegacy .top-space { + margin-top: 2em; + } + html.no-flexbox .xlarge-top-space, + html.no-flexboxlegacy .xlarge-top-space { + margin-top: 2em; + } + html.no-flexbox .top-padding, + html.no-flexboxlegacy .top-padding { + padding-top: 2em; + } + html.no-flexbox .xlarge-top-padding, + html.no-flexboxlegacy .xlarge-top-padding { + padding-top: 2em; + } + html.no-flexbox .double-top-space, + html.no-flexboxlegacy .double-top-space { + margin-top: 4em; + } + html.no-flexbox .xlarge-double-top-space, + html.no-flexboxlegacy .xlarge-double-top-space { + margin-top: 4em; + } + html.no-flexbox .double-top-padding, + html.no-flexboxlegacy .double-top-padding { + padding-top: 4em; + } + html.no-flexbox .xlarge-double-top-padding, + html.no-flexboxlegacy .xlarge-double-top-padding { + padding-top: 4em; + } + html.no-flexbox .half-top-space, + html.no-flexboxlegacy .half-top-space { + margin-top: 1em; + } + html.no-flexbox .xlarge-half-top-space, + html.no-flexboxlegacy .xlarge-half-top-space { + margin-top: 1em; + } + html.no-flexbox .half-top-padding, + html.no-flexboxlegacy .half-top-padding { + padding-top: 1em; + } + html.no-flexbox .xlarge-half-top-padding, + html.no-flexboxlegacy .xlarge-half-top-padding { + padding-top: 1em; + } + html.no-flexbox .quarter-top-space, + html.no-flexboxlegacy .quarter-top-space { + margin-top: 0.5em; + } + html.no-flexbox .xlarge-quarter-top-space, + html.no-flexboxlegacy .xlarge-quarter-top-space { + margin-top: 0.5em; + } + html.no-flexbox .quarter-top-padding, + html.no-flexboxlegacy .quarter-top-padding { + padding-top: 0.5em; + } + html.no-flexbox .xlarge-quarter-top-padding, + html.no-flexboxlegacy .xlarge-quarter-top-padding { + padding-top: 0.5em; + } + html.no-flexbox .right-space, + html.no-flexboxlegacy .right-space { + margin-right: 2em; + } + html.no-flexbox .xlarge-right-space, + html.no-flexboxlegacy .xlarge-right-space { + margin-right: 2em; + } + html.no-flexbox .right-padding, + html.no-flexboxlegacy .right-padding { + padding-right: 2em; + } + html.no-flexbox .xlarge-right-padding, + html.no-flexboxlegacy .xlarge-right-padding { + padding-right: 2em; + } + html.no-flexbox .double-right-space, + html.no-flexboxlegacy .double-right-space { + margin-right: 4em; + } + html.no-flexbox .xlarge-double-right-space, + html.no-flexboxlegacy .xlarge-double-right-space { + margin-right: 4em; + } + html.no-flexbox .double-right-padding, + html.no-flexboxlegacy .double-right-padding { + padding-right: 4em; + } + html.no-flexbox .xlarge-double-right-padding, + html.no-flexboxlegacy .xlarge-double-right-padding { + padding-right: 4em; + } + html.no-flexbox .half-right-space, + html.no-flexboxlegacy .half-right-space { + margin-right: 1em; + } + html.no-flexbox .xlarge-half-right-space, + html.no-flexboxlegacy .xlarge-half-right-space { + margin-right: 1em; + } + html.no-flexbox .half-right-padding, + html.no-flexboxlegacy .half-right-padding { + padding-right: 1em; + } + html.no-flexbox .xlarge-half-right-padding, + html.no-flexboxlegacy .xlarge-half-right-padding { + padding-right: 1em; + } + html.no-flexbox .quarter-right-space, + html.no-flexboxlegacy .quarter-right-space { + margin-right: 0.5em; + } + html.no-flexbox .xlarge-quarter-right-space, + html.no-flexboxlegacy .xlarge-quarter-right-space { + margin-right: 0.5em; + } + html.no-flexbox .quarter-right-padding, + html.no-flexboxlegacy .quarter-right-padding { + padding-right: 0.5em; + } + html.no-flexbox .xlarge-quarter-right-padding, + html.no-flexboxlegacy .xlarge-quarter-right-padding { + padding-right: 0.5em; + } + html.no-flexbox .bottom-space, + html.no-flexboxlegacy .bottom-space { + margin-bottom: 2em; + } + html.no-flexbox .xlarge-bottom-space, + html.no-flexboxlegacy .xlarge-bottom-space { + margin-bottom: 2em; + } + html.no-flexbox .bottom-padding, + html.no-flexboxlegacy .bottom-padding { + padding-bottom: 2em; + } + html.no-flexbox .xlarge-bottom-padding, + html.no-flexboxlegacy .xlarge-bottom-padding { + padding-bottom: 2em; + } + html.no-flexbox .double-bottom-space, + html.no-flexboxlegacy .double-bottom-space { + margin-bottom: 4em; + } + html.no-flexbox .xlarge-double-bottom-space, + html.no-flexboxlegacy .xlarge-double-bottom-space { + margin-bottom: 4em; + } + html.no-flexbox .double-bottom-padding, + html.no-flexboxlegacy .double-bottom-padding { + padding-bottom: 4em; + } + html.no-flexbox .xlarge-double-bottom-padding, + html.no-flexboxlegacy .xlarge-double-bottom-padding { + padding-bottom: 4em; + } + html.no-flexbox .half-bottom-space, + html.no-flexboxlegacy .half-bottom-space { + margin-bottom: 1em; + } + html.no-flexbox .xlarge-half-bottom-space, + html.no-flexboxlegacy .xlarge-half-bottom-space { + margin-bottom: 1em; + } + html.no-flexbox .half-bottom-padding, + html.no-flexboxlegacy .half-bottom-padding { + padding-bottom: 1em; + } + html.no-flexbox .xlarge-half-bottom-padding, + html.no-flexboxlegacy .xlarge-half-bottom-padding { + padding-bottom: 1em; + } + html.no-flexbox .quarter-bottom-space, + html.no-flexboxlegacy .quarter-bottom-space { + margin-bottom: 0.5em; + } + html.no-flexbox .xlarge-quarter-bottom-space, + html.no-flexboxlegacy .xlarge-quarter-bottom-space { + margin-bottom: 0.5em; + } + html.no-flexbox .quarter-bottom-padding, + html.no-flexboxlegacy .quarter-bottom-padding { + padding-bottom: 0.5em; + } + html.no-flexbox .xlarge-quarter-bottom-padding, + html.no-flexboxlegacy .xlarge-quarter-bottom-padding { + padding-bottom: 0.5em; + } + html.no-flexbox .left-space, + html.no-flexboxlegacy .left-space { + margin-left: 2em; + } + html.no-flexbox .xlarge-left-space, + html.no-flexboxlegacy .xlarge-left-space { + margin-left: 2em; + } + html.no-flexbox .left-padding, + html.no-flexboxlegacy .left-padding { + padding-left: 2em; + } + html.no-flexbox .xlarge-left-padding, + html.no-flexboxlegacy .xlarge-left-padding { + padding-left: 2em; + } + html.no-flexbox .double-left-space, + html.no-flexboxlegacy .double-left-space { + margin-left: 4em; + } + html.no-flexbox .xlarge-double-left-space, + html.no-flexboxlegacy .xlarge-double-left-space { + margin-left: 4em; + } + html.no-flexbox .double-left-padding, + html.no-flexboxlegacy .double-left-padding { + padding-left: 4em; + } + html.no-flexbox .xlarge-double-left-padding, + html.no-flexboxlegacy .xlarge-double-left-padding { + padding-left: 4em; + } + html.no-flexbox .half-left-space, + html.no-flexboxlegacy .half-left-space { + margin-left: 1em; + } + html.no-flexbox .xlarge-half-left-space, + html.no-flexboxlegacy .xlarge-half-left-space { + margin-left: 1em; + } + html.no-flexbox .half-left-padding, + html.no-flexboxlegacy .half-left-padding { + padding-left: 1em; + } + html.no-flexbox .xlarge-half-left-padding, + html.no-flexboxlegacy .xlarge-half-left-padding { + padding-left: 1em; + } + html.no-flexbox .quarter-left-space, + html.no-flexboxlegacy .quarter-left-space { + margin-left: 0.5em; + } + html.no-flexbox .xlarge-quarter-left-space, + html.no-flexboxlegacy .xlarge-quarter-left-space { + margin-left: 0.5em; + } + html.no-flexbox .quarter-left-padding, + html.no-flexboxlegacy .quarter-left-padding { + padding-left: 0.5em; + } + html.no-flexbox .xlarge-quarter-left-padding, + html.no-flexboxlegacy .xlarge-quarter-left-padding { + padding-left: 0.5em; + } + html.no-flexbox .hide-xlarge, + html.no-flexboxlegacy .hide-xlarge { + display: none !important; + } + html.no-flexbox .show-xlarge, + html.no-flexboxlegacy .show-xlarge { + display: inherit !important; + } + html.no-flexbox table.show-xlarge, + html.no-flexboxlegacy table.show-xlarge { + display: table; + } + html.no-flexbox thead.show-xlarge, + html.no-flexboxlegacy thead.show-xlarge { + display: table-header-group; + } + html.no-flexbox tbody.show-xlarge, + html.no-flexboxlegacy tbody.show-xlarge { + display: table-row-group; + } + html.no-flexbox tfoot.show-xlarge, + html.no-flexboxlegacy tfoot.show-xlarge { + display: table-footer-group; + } + html.no-flexbox tr.show-xlarge, + html.no-flexboxlegacy tr.show-xlarge { + display: table-row; + } + html.no-flexbox th.show-xlarge, + html.no-flexbox td.show-xlarge, + html.no-flexboxlegacy th.show-xlarge, + html.no-flexboxlegacy td.show-xlarge { + display: table-cell; + } +} +@media screen and (min-width: 961px) and (max-width: 1260px) { + html.no-flexbox .ink-grid, + html.no-flexboxlegacy .ink-grid { + padding: 0 1.75em; + } + html.no-flexbox .column-group > [class*=large-], + html.no-flexboxlegacy .column-group > [class*=large-] { + float: left; + clear: none; + } + html.no-flexbox .large-5, + html.no-flexboxlegacy .large-5 { + width: 5%; + } + html.no-flexbox .large-10, + html.no-flexboxlegacy .large-10 { + width: 10%; + } + html.no-flexbox .large-15, + html.no-flexboxlegacy .large-15 { + width: 15%; + } + html.no-flexbox .large-16, + html.no-flexboxlegacy .large-16 { + width: 16.66%; + } + html.no-flexbox .large-20, + html.no-flexboxlegacy .large-20 { + width: 20%; + } + html.no-flexbox .large-25, + html.no-flexboxlegacy .large-25 { + width: 25%; + } + html.no-flexbox .large-30, + html.no-flexboxlegacy .large-30 { + width: 30%; + } + html.no-flexbox .large-33, + html.no-flexboxlegacy .large-33 { + width: 33.33%; + } + html.no-flexbox .large-35, + html.no-flexboxlegacy .large-35 { + width: 35%; + } + html.no-flexbox .large-40, + html.no-flexboxlegacy .large-40 { + width: 40%; + } + html.no-flexbox .large-45, + html.no-flexboxlegacy .large-45 { + width: 45%; + } + html.no-flexbox .large-50, + html.no-flexboxlegacy .large-50 { + width: 50%; + } + html.no-flexbox .large-55, + html.no-flexboxlegacy .large-55 { + width: 55%; + } + html.no-flexbox .large-60, + html.no-flexboxlegacy .large-60 { + width: 60%; + } + html.no-flexbox .large-65, + html.no-flexboxlegacy .large-65 { + width: 65%; + } + html.no-flexbox .large-66, + html.no-flexboxlegacy .large-66 { + width: 66.66%; + } + html.no-flexbox .large-70, + html.no-flexboxlegacy .large-70 { + width: 70%; + } + html.no-flexbox .large-75, + html.no-flexboxlegacy .large-75 { + width: 75%; + } + html.no-flexbox .large-80, + html.no-flexboxlegacy .large-80 { + width: 80%; + } + html.no-flexbox .large-85, + html.no-flexboxlegacy .large-85 { + width: 85%; + } + html.no-flexbox .large-90, + html.no-flexboxlegacy .large-90 { + width: 90%; + } + html.no-flexbox .large-95, + html.no-flexboxlegacy .large-95 { + width: 95%; + } + html.no-flexbox .large-100, + html.no-flexboxlegacy .large-100 { + width: 100%; + } + html.no-flexbox [class*=large-100], + html.no-flexboxlegacy [class*=large-100] { + float: none; + clear: both; + } + html.no-flexbox .column-group, + html.no-flexboxlegacy .column-group { + *zoom: 1; + } + html.no-flexbox .column-group:after, + html.no-flexboxlegacy .column-group:after { + content: ""; + display: table; + clear: both; + } + html.no-flexbox .column-group.gutters, + html.no-flexboxlegacy .column-group.gutters { + margin-left: -1.75em; + } + html.no-flexbox .column-group.gutters > [class*=large-], html.no-flexbox .column-group.gutters > [class*=all-], + html.no-flexboxlegacy .column-group.gutters > [class*=large-], + html.no-flexboxlegacy .column-group.gutters > [class*=all-] { + padding-left: 1.75em; + margin-bottom: 1.75em; + } + html.no-flexbox .column-group.horizontal-gutters, + html.no-flexboxlegacy .column-group.horizontal-gutters { + margin-left: -1.75em; + } + html.no-flexbox .column-group.horizontal-gutters > [class*=large-], html.no-flexbox .column-group.horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.horizontal-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.horizontal-gutters > [class*=all-] { + padding-left: 1.75em; + } + html.no-flexbox .column-group.vertical-gutters > [class*=large-], html.no-flexbox .column-group.vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.vertical-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 1.75em; + } + html.no-flexbox .column-group.double-gutters, + html.no-flexboxlegacy .column-group.double-gutters { + margin-left: -3.5em; + } + html.no-flexbox .column-group.double-gutters > [class*=large-], html.no-flexbox .column-group.double-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.double-gutters > [class*=all-] { + padding-left: 3.5em; + margin-bottom: 3.5em; + } + html.no-flexbox .column-group.double-horizontal-gutters, + html.no-flexboxlegacy .column-group.double-horizontal-gutters { + margin-left: -3.5em; + } + html.no-flexbox .column-group.double-horizontal-gutters > [class*=large-], html.no-flexbox .column-group.double-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-horizontal-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 3.5em; + } + html.no-flexbox .column-group.double-vertical-gutters > [class*=large-], html.no-flexbox .column-group.double-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-vertical-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 3.5em; + } + html.no-flexbox .column-group.half-gutters, + html.no-flexboxlegacy .column-group.half-gutters { + margin-left: -0.875em; + } + html.no-flexbox .column-group.half-gutters > [class*=large-], html.no-flexbox .column-group.half-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.half-gutters > [class*=all-] { + padding-left: 0.875em; + margin-bottom: 0.875em; + } + html.no-flexbox .column-group.half-horizontal-gutters, + html.no-flexboxlegacy .column-group.half-horizontal-gutters { + margin-left: -0.875em; + } + html.no-flexbox .column-group.half-horizontal-gutters > [class*=large-], html.no-flexbox .column-group.half-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-horizontal-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 0.875em; + } + html.no-flexbox .column-group.half-vertical-gutters > [class*=large-], html.no-flexbox .column-group.half-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-vertical-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 0.875em; + } + html.no-flexbox .column-group.quarter-gutters, + html.no-flexboxlegacy .column-group.quarter-gutters { + margin-left: -0.4375em; + } + html.no-flexbox .column-group.quarter-gutters > [class*=large-], html.no-flexbox .column-group.quarter-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.4375em; + margin-bottom: 0.4375em; + } + html.no-flexbox .column-group.quarter-horizontal-gutters, + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters { + margin-left: -0.4375em; + } + html.no-flexbox .column-group.quarter-horizontal-gutters > [class*=large-], html.no-flexbox .column-group.quarter-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.4375em; + } + html.no-flexbox .column-group.quarter-vertical-gutters > [class*=large-], html.no-flexbox .column-group.quarter-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-vertical-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.4375em; + } + html.no-flexbox .column-group.large-gutters, + html.no-flexboxlegacy .column-group.large-gutters { + margin-left: -1.75em; + } + html.no-flexbox .column-group.large-gutters > [class*=large-], html.no-flexbox .column-group.large-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-gutters > [class*=all-] { + padding-left: 1.75em; + margin-bottom: 1.75em; + } + html.no-flexbox .column-group.large-horizontal-gutters, + html.no-flexboxlegacy .column-group.large-horizontal-gutters { + margin-left: -1.75em; + } + html.no-flexbox .column-group.large-horizontal-gutters > [class*=large-], html.no-flexbox .column-group.large-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-horizontal-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-horizontal-gutters > [class*=all-] { + padding-left: 1.75em; + } + html.no-flexbox .column-group.large-vertical-gutters > [class*=large-], html.no-flexbox .column-group.large-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-vertical-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-vertical-gutters > [class*=all-] { + margin-bottom: 1.75em; + } + html.no-flexbox .column-group.large-double-gutters, + html.no-flexboxlegacy .column-group.large-double-gutters { + margin-left: -3.5em; + } + html.no-flexbox .column-group.large-double-gutters > [class*=large-], html.no-flexbox .column-group.large-double-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-double-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-double-gutters > [class*=all-] { + padding-left: 3.5em; + margin-bottom: 3.5em; + } + html.no-flexbox .column-group.large-double-horizontal-gutters, + html.no-flexboxlegacy .column-group.large-double-horizontal-gutters { + margin-left: -3.5em; + } + html.no-flexbox .column-group.large-double-horizontal-gutters > [class*=large-], html.no-flexbox .column-group.large-double-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-double-horizontal-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-double-horizontal-gutters > [class*=all-] { + padding-left: 3.5em; + } + html.no-flexbox .column-group.large-double-vertical-gutters > [class*=large-], html.no-flexbox .column-group.large-double-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-double-vertical-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-double-vertical-gutters > [class*=all-] { + margin-bottom: 3.5em; + } + html.no-flexbox .column-group.large-half-gutters, + html.no-flexboxlegacy .column-group.large-half-gutters { + margin-left: -0.875em; + } + html.no-flexbox .column-group.large-half-gutters > [class*=large-], html.no-flexbox .column-group.large-half-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-half-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-half-gutters > [class*=all-] { + padding-left: 0.875em; + margin-bottom: 0.875em; + } + html.no-flexbox .column-group.large-half-horizontal-gutters, + html.no-flexboxlegacy .column-group.large-half-horizontal-gutters { + margin-left: -0.875em; + } + html.no-flexbox .column-group.large-half-horizontal-gutters > [class*=large-], html.no-flexbox .column-group.large-half-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-half-horizontal-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-half-horizontal-gutters > [class*=all-] { + padding-left: 0.875em; + } + html.no-flexbox .column-group.large-half-vertical-gutters > [class*=large-], html.no-flexbox .column-group.large-half-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-half-vertical-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-half-vertical-gutters > [class*=all-] { + margin-bottom: 0.875em; + } + html.no-flexbox .column-group.large-quarter-gutters, + html.no-flexboxlegacy .column-group.large-quarter-gutters { + margin-left: -0.4375em; + } + html.no-flexbox .column-group.large-quarter-gutters > [class*=large-], html.no-flexbox .column-group.large-quarter-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-quarter-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-quarter-gutters > [class*=all-] { + padding-left: 0.4375em; + margin-bottom: 0.4375em; + } + html.no-flexbox .column-group.large-quarter-horizontal-gutters, + html.no-flexboxlegacy .column-group.large-quarter-horizontal-gutters { + margin-left: -0.4375em; + } + html.no-flexbox .column-group.large-quarter-horizontal-gutters > [class*=large-], html.no-flexbox .column-group.large-quarter-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-quarter-horizontal-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.4375em; + } + html.no-flexbox .column-group.large-quarter-vertical-gutters > [class*=large-], html.no-flexbox .column-group.large-quarter-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-quarter-vertical-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.4375em; + } + html.no-flexbox .column-group.large-no-gutters, + html.no-flexboxlegacy .column-group.large-no-gutters { + margin-left: 0; + } + html.no-flexbox .column-group.large-no-gutters > [class*=large-], html.no-flexbox .column-group.large-no-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.large-no-gutters > [class*=large-], + html.no-flexboxlegacy .column-group.large-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; + } + html.no-flexbox .ink-table td[class*=large-], html.no-flexbox .ink-table th[class*=large-], html.no-flexbox .ink-table tr[class*=large-], html.no-flexbox .ink-table thead[class*=large-], html.no-flexbox .ink-table tbody[class*=large-], html.no-flexbox .ink-table tfoot[class*=large-], + html.no-flexboxlegacy .ink-table td[class*=large-], + html.no-flexboxlegacy .ink-table th[class*=large-], + html.no-flexboxlegacy .ink-table tr[class*=large-], + html.no-flexboxlegacy .ink-table thead[class*=large-], + html.no-flexboxlegacy .ink-table tbody[class*=large-], + html.no-flexboxlegacy .ink-table tfoot[class*=large-] { + float: none; + } + html.no-flexbox .large-push-left, + html.no-flexboxlegacy .large-push-left { + float: left; + } + html.no-flexbox .large-push-center, + html.no-flexboxlegacy .large-push-center { + float: none; + margin-left: auto; + margin-right: auto; + } + html.no-flexbox .large-push-right, + html.no-flexboxlegacy .large-push-right { + float: right; + } + html.no-flexbox .large-align-left, + html.no-flexboxlegacy .large-align-left { + text-align: left; + } + html.no-flexbox .large-align-center, + html.no-flexboxlegacy .large-align-center { + text-align: center; + } + html.no-flexbox .large-align-right, + html.no-flexboxlegacy .large-align-right { + text-align: right; + } + html.no-flexbox .large-no-margin, + html.no-flexboxlegacy .large-no-margin { + margin: 0 !important; + } + html.no-flexbox .space, + html.no-flexboxlegacy .space { + margin: 1.75em; + } + html.no-flexbox .large-space, + html.no-flexboxlegacy .large-space { + margin: 1.75em; + } + html.no-flexbox .padding, + html.no-flexboxlegacy .padding { + padding: 1.75em; + } + html.no-flexbox .large-padding, + html.no-flexboxlegacy .large-padding { + padding: 1.75em; + } + html.no-flexbox .double-space, + html.no-flexboxlegacy .double-space { + margin: 3.5em; + } + html.no-flexbox .large-double-space, + html.no-flexboxlegacy .large-double-space { + margin: 3.5em; + } + html.no-flexbox .double-padding, + html.no-flexboxlegacy .double-padding { + padding: 3.5em; + } + html.no-flexbox .large-double-padding, + html.no-flexboxlegacy .large-double-padding { + padding: 3.5em; + } + html.no-flexbox .half-space, + html.no-flexboxlegacy .half-space { + margin: 0.875em; + } + html.no-flexbox .large-half-space, + html.no-flexboxlegacy .large-half-space { + margin: 0.875em; + } + html.no-flexbox .half-padding, + html.no-flexboxlegacy .half-padding { + padding: 0.875em; + } + html.no-flexbox .large-half-padding, + html.no-flexboxlegacy .large-half-padding { + padding: 0.875em; + } + html.no-flexbox .quarter-space, + html.no-flexboxlegacy .quarter-space { + margin: 0.4375em; + } + html.no-flexbox .large-quarter-space, + html.no-flexboxlegacy .large-quarter-space { + margin: 0.4375em; + } + html.no-flexbox .quarter-padding, + html.no-flexboxlegacy .quarter-padding { + padding: 0.4375em; + } + html.no-flexbox .large-quarter-padding, + html.no-flexboxlegacy .large-quarter-padding { + padding: 0.4375em; + } + html.no-flexbox .vertical-space, + html.no-flexboxlegacy .vertical-space { + margin-top: 1.75em; + margin-bottom: 1.75em; + } + html.no-flexbox .large-vertical-space, + html.no-flexboxlegacy .large-vertical-space { + margin-top: 1.75em; + margin-bottom: 1.75em; + } + html.no-flexbox .vertical-padding, + html.no-flexboxlegacy .vertical-padding { + padding-top: 1.75em; + padding-bottom: 1.75em; + } + html.no-flexbox .large-vertical-padding, + html.no-flexboxlegacy .large-vertical-padding { + padding-top: 1.75em; + padding-bottom: 1.75em; + } + html.no-flexbox .double-vertical-space, + html.no-flexboxlegacy .double-vertical-space { + margin-top: 3.5em; + margin-bottom: 3.5em; + } + html.no-flexbox .large-double-vertical-space, + html.no-flexboxlegacy .large-double-vertical-space { + margin-top: 3.5em; + margin-bottom: 3.5em; + } + html.no-flexbox .double-vertical-padding, + html.no-flexboxlegacy .double-vertical-padding { + padding-top: 3.5em; + padding-bottom: 3.5em; + } + html.no-flexbox .large-double-vertical-padding, + html.no-flexboxlegacy .large-double-vertical-padding { + padding-top: 3.5em; + padding-bottom: 3.5em; + } + html.no-flexbox .half-vertical-space, + html.no-flexboxlegacy .half-vertical-space { + margin-top: 0.875em; + margin-bottom: 0.875em; + } + html.no-flexbox .large-half-vertical-space, + html.no-flexboxlegacy .large-half-vertical-space { + margin-top: 0.875em; + margin-bottom: 0.875em; + } + html.no-flexbox .half-vertical-padding, + html.no-flexboxlegacy .half-vertical-padding { + padding-top: 0.875em; + padding-bottom: 0.875em; + } + html.no-flexbox .large-half-vertical-padding, + html.no-flexboxlegacy .large-half-vertical-padding { + padding-top: 0.875em; + padding-bottom: 0.875em; + } + html.no-flexbox .quarter-vertical-space, + html.no-flexboxlegacy .quarter-vertical-space { + margin-top: 0.4375em; + margin-bottom: 0.4375em; + } + html.no-flexbox .large-quarter-vertical-space, + html.no-flexboxlegacy .large-quarter-vertical-space { + margin-top: 0.4375em; + margin-bottom: 0.4375em; + } + html.no-flexbox .quarter-vertical-padding, + html.no-flexboxlegacy .quarter-vertical-padding { + padding-top: 0.4375em; + padding-bottom: 0.4375em; + } + html.no-flexbox .large-quarter-vertical-padding, + html.no-flexboxlegacy .large-quarter-vertical-padding { + padding-top: 0.4375em; + padding-bottom: 0.4375em; + } + html.no-flexbox .horizontal-space, + html.no-flexboxlegacy .horizontal-space { + margin-left: 1.75em; + margin-right: 1.75em; + } + html.no-flexbox .large-horizontal-space, + html.no-flexboxlegacy .large-horizontal-space { + margin-left: 1.75em; + margin-right: 1.75em; + } + html.no-flexbox .horizontal-padding, + html.no-flexboxlegacy .horizontal-padding { + padding-left: 1.75em; + padding-right: 1.75em; + } + html.no-flexbox .large-horizontal-padding, + html.no-flexboxlegacy .large-horizontal-padding { + padding-left: 1.75em; + padding-right: 1.75em; + } + html.no-flexbox .double-horizontal-space, + html.no-flexboxlegacy .double-horizontal-space { + margin-left: 3.5em; + margin-right: 3.5em; + } + html.no-flexbox .large-double-horizontal-space, + html.no-flexboxlegacy .large-double-horizontal-space { + margin-left: 3.5em; + margin-right: 3.5em; + } + html.no-flexbox .double-horizontal-padding, + html.no-flexboxlegacy .double-horizontal-padding { + padding-left: 3.5em; + padding-right: 3.5em; + } + html.no-flexbox .large-double-horizontal-padding, + html.no-flexboxlegacy .large-double-horizontal-padding { + padding-left: 3.5em; + padding-right: 3.5em; + } + html.no-flexbox .half-horizontal-space, + html.no-flexboxlegacy .half-horizontal-space { + margin-left: 0.875em; + margin-right: 0.875em; + } + html.no-flexbox .large-half-horizontal-space, + html.no-flexboxlegacy .large-half-horizontal-space { + margin-left: 0.875em; + margin-right: 0.875em; + } + html.no-flexbox .half-horizontal-padding, + html.no-flexboxlegacy .half-horizontal-padding { + padding-left: 0.875em; + padding-right: 0.875em; + } + html.no-flexbox .large-half-horizontal-padding, + html.no-flexboxlegacy .large-half-horizontal-padding { + padding-left: 0.875em; + padding-right: 0.875em; + } + html.no-flexbox .quarter-horizontal-space, + html.no-flexboxlegacy .quarter-horizontal-space { + margin-left: 0.4375em; + margin-right: 0.4375em; + } + html.no-flexbox .large-quarter-horizontal-space, + html.no-flexboxlegacy .large-quarter-horizontal-space { + margin-left: 0.4375em; + margin-right: 0.4375em; + } + html.no-flexbox .quarter-horizontal-padding, + html.no-flexboxlegacy .quarter-horizontal-padding { + padding-left: 0.4375em; + padding-right: 0.4375em; + } + html.no-flexbox .large-quarter-horizontal-padding, + html.no-flexboxlegacy .large-quarter-horizontal-padding { + padding-left: 0.4375em; + padding-right: 0.4375em; + } + html.no-flexbox .top-space, + html.no-flexboxlegacy .top-space { + margin-top: 1.75em; + } + html.no-flexbox .large-top-space, + html.no-flexboxlegacy .large-top-space { + margin-top: 1.75em; + } + html.no-flexbox .top-padding, + html.no-flexboxlegacy .top-padding { + padding-top: 1.75em; + } + html.no-flexbox .large-top-padding, + html.no-flexboxlegacy .large-top-padding { + padding-top: 1.75em; + } + html.no-flexbox .double-top-space, + html.no-flexboxlegacy .double-top-space { + margin-top: 3.5em; + } + html.no-flexbox .large-double-top-space, + html.no-flexboxlegacy .large-double-top-space { + margin-top: 3.5em; + } + html.no-flexbox .double-top-padding, + html.no-flexboxlegacy .double-top-padding { + padding-top: 3.5em; + } + html.no-flexbox .large-double-top-padding, + html.no-flexboxlegacy .large-double-top-padding { + padding-top: 3.5em; + } + html.no-flexbox .half-top-space, + html.no-flexboxlegacy .half-top-space { + margin-top: 0.875em; + } + html.no-flexbox .large-half-top-space, + html.no-flexboxlegacy .large-half-top-space { + margin-top: 0.875em; + } + html.no-flexbox .half-top-padding, + html.no-flexboxlegacy .half-top-padding { + padding-top: 0.875em; + } + html.no-flexbox .large-half-top-padding, + html.no-flexboxlegacy .large-half-top-padding { + padding-top: 0.875em; + } + html.no-flexbox .quarter-top-space, + html.no-flexboxlegacy .quarter-top-space { + margin-top: 0.4375em; + } + html.no-flexbox .large-quarter-top-space, + html.no-flexboxlegacy .large-quarter-top-space { + margin-top: 0.4375em; + } + html.no-flexbox .quarter-top-padding, + html.no-flexboxlegacy .quarter-top-padding { + padding-top: 0.4375em; + } + html.no-flexbox .large-quarter-top-padding, + html.no-flexboxlegacy .large-quarter-top-padding { + padding-top: 0.4375em; + } + html.no-flexbox .right-space, + html.no-flexboxlegacy .right-space { + margin-right: 1.75em; + } + html.no-flexbox .large-right-space, + html.no-flexboxlegacy .large-right-space { + margin-right: 1.75em; + } + html.no-flexbox .right-padding, + html.no-flexboxlegacy .right-padding { + padding-right: 1.75em; + } + html.no-flexbox .large-right-padding, + html.no-flexboxlegacy .large-right-padding { + padding-right: 1.75em; + } + html.no-flexbox .double-right-space, + html.no-flexboxlegacy .double-right-space { + margin-right: 3.5em; + } + html.no-flexbox .large-double-right-space, + html.no-flexboxlegacy .large-double-right-space { + margin-right: 3.5em; + } + html.no-flexbox .double-right-padding, + html.no-flexboxlegacy .double-right-padding { + padding-right: 3.5em; + } + html.no-flexbox .large-double-right-padding, + html.no-flexboxlegacy .large-double-right-padding { + padding-right: 3.5em; + } + html.no-flexbox .half-right-space, + html.no-flexboxlegacy .half-right-space { + margin-right: 0.875em; + } + html.no-flexbox .large-half-right-space, + html.no-flexboxlegacy .large-half-right-space { + margin-right: 0.875em; + } + html.no-flexbox .half-right-padding, + html.no-flexboxlegacy .half-right-padding { + padding-right: 0.875em; + } + html.no-flexbox .large-half-right-padding, + html.no-flexboxlegacy .large-half-right-padding { + padding-right: 0.875em; + } + html.no-flexbox .quarter-right-space, + html.no-flexboxlegacy .quarter-right-space { + margin-right: 0.4375em; + } + html.no-flexbox .large-quarter-right-space, + html.no-flexboxlegacy .large-quarter-right-space { + margin-right: 0.4375em; + } + html.no-flexbox .quarter-right-padding, + html.no-flexboxlegacy .quarter-right-padding { + padding-right: 0.4375em; + } + html.no-flexbox .large-quarter-right-padding, + html.no-flexboxlegacy .large-quarter-right-padding { + padding-right: 0.4375em; + } + html.no-flexbox .bottom-space, + html.no-flexboxlegacy .bottom-space { + margin-bottom: 1.75em; + } + html.no-flexbox .large-bottom-space, + html.no-flexboxlegacy .large-bottom-space { + margin-bottom: 1.75em; + } + html.no-flexbox .bottom-padding, + html.no-flexboxlegacy .bottom-padding { + padding-bottom: 1.75em; + } + html.no-flexbox .large-bottom-padding, + html.no-flexboxlegacy .large-bottom-padding { + padding-bottom: 1.75em; + } + html.no-flexbox .double-bottom-space, + html.no-flexboxlegacy .double-bottom-space { + margin-bottom: 3.5em; + } + html.no-flexbox .large-double-bottom-space, + html.no-flexboxlegacy .large-double-bottom-space { + margin-bottom: 3.5em; + } + html.no-flexbox .double-bottom-padding, + html.no-flexboxlegacy .double-bottom-padding { + padding-bottom: 3.5em; + } + html.no-flexbox .large-double-bottom-padding, + html.no-flexboxlegacy .large-double-bottom-padding { + padding-bottom: 3.5em; + } + html.no-flexbox .half-bottom-space, + html.no-flexboxlegacy .half-bottom-space { + margin-bottom: 0.875em; + } + html.no-flexbox .large-half-bottom-space, + html.no-flexboxlegacy .large-half-bottom-space { + margin-bottom: 0.875em; + } + html.no-flexbox .half-bottom-padding, + html.no-flexboxlegacy .half-bottom-padding { + padding-bottom: 0.875em; + } + html.no-flexbox .large-half-bottom-padding, + html.no-flexboxlegacy .large-half-bottom-padding { + padding-bottom: 0.875em; + } + html.no-flexbox .quarter-bottom-space, + html.no-flexboxlegacy .quarter-bottom-space { + margin-bottom: 0.4375em; + } + html.no-flexbox .large-quarter-bottom-space, + html.no-flexboxlegacy .large-quarter-bottom-space { + margin-bottom: 0.4375em; + } + html.no-flexbox .quarter-bottom-padding, + html.no-flexboxlegacy .quarter-bottom-padding { + padding-bottom: 0.4375em; + } + html.no-flexbox .large-quarter-bottom-padding, + html.no-flexboxlegacy .large-quarter-bottom-padding { + padding-bottom: 0.4375em; + } + html.no-flexbox .left-space, + html.no-flexboxlegacy .left-space { + margin-left: 1.75em; + } + html.no-flexbox .large-left-space, + html.no-flexboxlegacy .large-left-space { + margin-left: 1.75em; + } + html.no-flexbox .left-padding, + html.no-flexboxlegacy .left-padding { + padding-left: 1.75em; + } + html.no-flexbox .large-left-padding, + html.no-flexboxlegacy .large-left-padding { + padding-left: 1.75em; + } + html.no-flexbox .double-left-space, + html.no-flexboxlegacy .double-left-space { + margin-left: 3.5em; + } + html.no-flexbox .large-double-left-space, + html.no-flexboxlegacy .large-double-left-space { + margin-left: 3.5em; + } + html.no-flexbox .double-left-padding, + html.no-flexboxlegacy .double-left-padding { + padding-left: 3.5em; + } + html.no-flexbox .large-double-left-padding, + html.no-flexboxlegacy .large-double-left-padding { + padding-left: 3.5em; + } + html.no-flexbox .half-left-space, + html.no-flexboxlegacy .half-left-space { + margin-left: 0.875em; + } + html.no-flexbox .large-half-left-space, + html.no-flexboxlegacy .large-half-left-space { + margin-left: 0.875em; + } + html.no-flexbox .half-left-padding, + html.no-flexboxlegacy .half-left-padding { + padding-left: 0.875em; + } + html.no-flexbox .large-half-left-padding, + html.no-flexboxlegacy .large-half-left-padding { + padding-left: 0.875em; + } + html.no-flexbox .quarter-left-space, + html.no-flexboxlegacy .quarter-left-space { + margin-left: 0.4375em; + } + html.no-flexbox .large-quarter-left-space, + html.no-flexboxlegacy .large-quarter-left-space { + margin-left: 0.4375em; + } + html.no-flexbox .quarter-left-padding, + html.no-flexboxlegacy .quarter-left-padding { + padding-left: 0.4375em; + } + html.no-flexbox .large-quarter-left-padding, + html.no-flexboxlegacy .large-quarter-left-padding { + padding-left: 0.4375em; + } + html.no-flexbox .hide-large, + html.no-flexboxlegacy .hide-large { + display: none !important; + } + html.no-flexbox .show-large, + html.no-flexboxlegacy .show-large { + display: inherit !important; + } + html.no-flexbox table.show-large, + html.no-flexboxlegacy table.show-large { + display: table; + } + html.no-flexbox thead.show-large, + html.no-flexboxlegacy thead.show-large { + display: table-header-group; + } + html.no-flexbox tbody.show-large, + html.no-flexboxlegacy tbody.show-large { + display: table-row-group; + } + html.no-flexbox tfoot.show-large, + html.no-flexboxlegacy tfoot.show-large { + display: table-footer-group; + } + html.no-flexbox tr.show-large, + html.no-flexboxlegacy tr.show-large { + display: table-row; + } + html.no-flexbox th.show-large, + html.no-flexbox td.show-large, + html.no-flexboxlegacy th.show-large, + html.no-flexboxlegacy td.show-large { + display: table-cell; + } +} +@media screen and (min-width: 641px) and (max-width: 960px) { + html.no-flexbox .ink-grid, + html.no-flexboxlegacy .ink-grid { + padding: 0 1.5em; + } + html.no-flexbox .column-group > [class*=medium-], + html.no-flexboxlegacy .column-group > [class*=medium-] { + float: left; + clear: none; + } + html.no-flexbox .medium-5, + html.no-flexboxlegacy .medium-5 { + width: 5%; + } + html.no-flexbox .medium-10, + html.no-flexboxlegacy .medium-10 { + width: 10%; + } + html.no-flexbox .medium-15, + html.no-flexboxlegacy .medium-15 { + width: 15%; + } + html.no-flexbox .medium-16, + html.no-flexboxlegacy .medium-16 { + width: 16.66%; + } + html.no-flexbox .medium-20, + html.no-flexboxlegacy .medium-20 { + width: 20%; + } + html.no-flexbox .medium-25, + html.no-flexboxlegacy .medium-25 { + width: 25%; + } + html.no-flexbox .medium-30, + html.no-flexboxlegacy .medium-30 { + width: 30%; + } + html.no-flexbox .medium-33, + html.no-flexboxlegacy .medium-33 { + width: 33.33%; + } + html.no-flexbox .medium-35, + html.no-flexboxlegacy .medium-35 { + width: 35%; + } + html.no-flexbox .medium-40, + html.no-flexboxlegacy .medium-40 { + width: 40%; + } + html.no-flexbox .medium-45, + html.no-flexboxlegacy .medium-45 { + width: 45%; + } + html.no-flexbox .medium-50, + html.no-flexboxlegacy .medium-50 { + width: 50%; + } + html.no-flexbox .medium-55, + html.no-flexboxlegacy .medium-55 { + width: 55%; + } + html.no-flexbox .medium-60, + html.no-flexboxlegacy .medium-60 { + width: 60%; + } + html.no-flexbox .medium-65, + html.no-flexboxlegacy .medium-65 { + width: 65%; + } + html.no-flexbox .medium-66, + html.no-flexboxlegacy .medium-66 { + width: 66.66%; + } + html.no-flexbox .medium-70, + html.no-flexboxlegacy .medium-70 { + width: 70%; + } + html.no-flexbox .medium-75, + html.no-flexboxlegacy .medium-75 { + width: 75%; + } + html.no-flexbox .medium-80, + html.no-flexboxlegacy .medium-80 { + width: 80%; + } + html.no-flexbox .medium-85, + html.no-flexboxlegacy .medium-85 { + width: 85%; + } + html.no-flexbox .medium-90, + html.no-flexboxlegacy .medium-90 { + width: 90%; + } + html.no-flexbox .medium-95, + html.no-flexboxlegacy .medium-95 { + width: 95%; + } + html.no-flexbox .medium-100, + html.no-flexboxlegacy .medium-100 { + width: 100%; + } + html.no-flexbox [class*=medium-100], + html.no-flexboxlegacy [class*=medium-100] { + float: none; + clear: both; + } + html.no-flexbox .column-group, + html.no-flexboxlegacy .column-group { + *zoom: 1; + } + html.no-flexbox .column-group:after, + html.no-flexboxlegacy .column-group:after { + content: ""; + display: table; + clear: both; + } + html.no-flexbox .column-group.gutters, + html.no-flexboxlegacy .column-group.gutters { + margin-left: -1.5em; + } + html.no-flexbox .column-group.gutters > [class*=medium-], html.no-flexbox .column-group.gutters > [class*=all-], + html.no-flexboxlegacy .column-group.gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.gutters > [class*=all-] { + padding-left: 1.5em; + margin-bottom: 1.5em; + } + html.no-flexbox .column-group.horizontal-gutters, + html.no-flexboxlegacy .column-group.horizontal-gutters { + margin-left: -1.5em; + } + html.no-flexbox .column-group.horizontal-gutters > [class*=medium-], html.no-flexbox .column-group.horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.horizontal-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.horizontal-gutters > [class*=all-] { + padding-left: 1.5em; + } + html.no-flexbox .column-group.vertical-gutters > [class*=medium-], html.no-flexbox .column-group.vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.vertical-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 1.5em; + } + html.no-flexbox .column-group.double-gutters, + html.no-flexboxlegacy .column-group.double-gutters { + margin-left: -3em; + } + html.no-flexbox .column-group.double-gutters > [class*=medium-], html.no-flexbox .column-group.double-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.double-gutters > [class*=all-] { + padding-left: 3em; + margin-bottom: 3em; + } + html.no-flexbox .column-group.double-horizontal-gutters, + html.no-flexboxlegacy .column-group.double-horizontal-gutters { + margin-left: -3em; + } + html.no-flexbox .column-group.double-horizontal-gutters > [class*=medium-], html.no-flexbox .column-group.double-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-horizontal-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 3em; + } + html.no-flexbox .column-group.double-vertical-gutters > [class*=medium-], html.no-flexbox .column-group.double-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-vertical-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 3em; + } + html.no-flexbox .column-group.half-gutters, + html.no-flexboxlegacy .column-group.half-gutters { + margin-left: -0.75em; + } + html.no-flexbox .column-group.half-gutters > [class*=medium-], html.no-flexbox .column-group.half-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.half-gutters > [class*=all-] { + padding-left: 0.75em; + margin-bottom: 0.75em; + } + html.no-flexbox .column-group.half-horizontal-gutters, + html.no-flexboxlegacy .column-group.half-horizontal-gutters { + margin-left: -0.75em; + } + html.no-flexbox .column-group.half-horizontal-gutters > [class*=medium-], html.no-flexbox .column-group.half-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-horizontal-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 0.75em; + } + html.no-flexbox .column-group.half-vertical-gutters > [class*=medium-], html.no-flexbox .column-group.half-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-vertical-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 0.75em; + } + html.no-flexbox .column-group.quarter-gutters, + html.no-flexboxlegacy .column-group.quarter-gutters { + margin-left: -0.375em; + } + html.no-flexbox .column-group.quarter-gutters > [class*=medium-], html.no-flexbox .column-group.quarter-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.375em; + margin-bottom: 0.375em; + } + html.no-flexbox .column-group.quarter-horizontal-gutters, + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters { + margin-left: -0.375em; + } + html.no-flexbox .column-group.quarter-horizontal-gutters > [class*=medium-], html.no-flexbox .column-group.quarter-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.375em; + } + html.no-flexbox .column-group.quarter-vertical-gutters > [class*=medium-], html.no-flexbox .column-group.quarter-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-vertical-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.375em; + } + html.no-flexbox .column-group.medium-gutters, + html.no-flexboxlegacy .column-group.medium-gutters { + margin-left: -1.5em; + } + html.no-flexbox .column-group.medium-gutters > [class*=medium-], html.no-flexbox .column-group.medium-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-gutters > [class*=all-] { + padding-left: 1.5em; + margin-bottom: 1.5em; + } + html.no-flexbox .column-group.medium-horizontal-gutters, + html.no-flexboxlegacy .column-group.medium-horizontal-gutters { + margin-left: -1.5em; + } + html.no-flexbox .column-group.medium-horizontal-gutters > [class*=medium-], html.no-flexbox .column-group.medium-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-horizontal-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-horizontal-gutters > [class*=all-] { + padding-left: 1.5em; + } + html.no-flexbox .column-group.medium-vertical-gutters > [class*=medium-], html.no-flexbox .column-group.medium-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-vertical-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-vertical-gutters > [class*=all-] { + margin-bottom: 1.5em; + } + html.no-flexbox .column-group.medium-double-gutters, + html.no-flexboxlegacy .column-group.medium-double-gutters { + margin-left: -3em; + } + html.no-flexbox .column-group.medium-double-gutters > [class*=medium-], html.no-flexbox .column-group.medium-double-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-double-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-double-gutters > [class*=all-] { + padding-left: 3em; + margin-bottom: 3em; + } + html.no-flexbox .column-group.medium-double-horizontal-gutters, + html.no-flexboxlegacy .column-group.medium-double-horizontal-gutters { + margin-left: -3em; + } + html.no-flexbox .column-group.medium-double-horizontal-gutters > [class*=medium-], html.no-flexbox .column-group.medium-double-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-double-horizontal-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-double-horizontal-gutters > [class*=all-] { + padding-left: 3em; + } + html.no-flexbox .column-group.medium-double-vertical-gutters > [class*=medium-], html.no-flexbox .column-group.medium-double-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-double-vertical-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-double-vertical-gutters > [class*=all-] { + margin-bottom: 3em; + } + html.no-flexbox .column-group.medium-half-gutters, + html.no-flexboxlegacy .column-group.medium-half-gutters { + margin-left: -0.75em; + } + html.no-flexbox .column-group.medium-half-gutters > [class*=medium-], html.no-flexbox .column-group.medium-half-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-half-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-half-gutters > [class*=all-] { + padding-left: 0.75em; + margin-bottom: 0.75em; + } + html.no-flexbox .column-group.medium-half-horizontal-gutters, + html.no-flexboxlegacy .column-group.medium-half-horizontal-gutters { + margin-left: -0.75em; + } + html.no-flexbox .column-group.medium-half-horizontal-gutters > [class*=medium-], html.no-flexbox .column-group.medium-half-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-half-horizontal-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-half-horizontal-gutters > [class*=all-] { + padding-left: 0.75em; + } + html.no-flexbox .column-group.medium-half-vertical-gutters > [class*=medium-], html.no-flexbox .column-group.medium-half-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-half-vertical-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-half-vertical-gutters > [class*=all-] { + margin-bottom: 0.75em; + } + html.no-flexbox .column-group.medium-quarter-gutters, + html.no-flexboxlegacy .column-group.medium-quarter-gutters { + margin-left: -0.375em; + } + html.no-flexbox .column-group.medium-quarter-gutters > [class*=medium-], html.no-flexbox .column-group.medium-quarter-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-quarter-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-quarter-gutters > [class*=all-] { + padding-left: 0.375em; + margin-bottom: 0.375em; + } + html.no-flexbox .column-group.medium-quarter-horizontal-gutters, + html.no-flexboxlegacy .column-group.medium-quarter-horizontal-gutters { + margin-left: -0.375em; + } + html.no-flexbox .column-group.medium-quarter-horizontal-gutters > [class*=medium-], html.no-flexbox .column-group.medium-quarter-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-quarter-horizontal-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.375em; + } + html.no-flexbox .column-group.medium-quarter-vertical-gutters > [class*=medium-], html.no-flexbox .column-group.medium-quarter-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-quarter-vertical-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.375em; + } + html.no-flexbox .column-group.medium-no-gutters, + html.no-flexboxlegacy .column-group.medium-no-gutters { + margin-left: 0; + } + html.no-flexbox .column-group.medium-no-gutters > [class*=medium-], html.no-flexbox .column-group.medium-no-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.medium-no-gutters > [class*=medium-], + html.no-flexboxlegacy .column-group.medium-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; + } + html.no-flexbox .ink-table td[class*=medium-], html.no-flexbox .ink-table th[class*=medium-], html.no-flexbox .ink-table tr[class*=medium-], html.no-flexbox .ink-table thead[class*=medium-], html.no-flexbox .ink-table tbody[class*=medium-], html.no-flexbox .ink-table tfoot[class*=medium-], + html.no-flexboxlegacy .ink-table td[class*=medium-], + html.no-flexboxlegacy .ink-table th[class*=medium-], + html.no-flexboxlegacy .ink-table tr[class*=medium-], + html.no-flexboxlegacy .ink-table thead[class*=medium-], + html.no-flexboxlegacy .ink-table tbody[class*=medium-], + html.no-flexboxlegacy .ink-table tfoot[class*=medium-] { + float: none; + } + html.no-flexbox .medium-push-left, + html.no-flexboxlegacy .medium-push-left { + float: left; + } + html.no-flexbox .medium-push-center, + html.no-flexboxlegacy .medium-push-center { + float: none; + margin-left: auto; + margin-right: auto; + } + html.no-flexbox .medium-push-right, + html.no-flexboxlegacy .medium-push-right { + float: right; + } + html.no-flexbox .medium-align-left, + html.no-flexboxlegacy .medium-align-left { + text-align: left; + } + html.no-flexbox .medium-align-center, + html.no-flexboxlegacy .medium-align-center { + text-align: center; + } + html.no-flexbox .medium-align-right, + html.no-flexboxlegacy .medium-align-right { + text-align: right; + } + html.no-flexbox .medium-no-margin, + html.no-flexboxlegacy .medium-no-margin { + margin: 0 !important; + } + html.no-flexbox .space, + html.no-flexboxlegacy .space { + margin: 1.5em; + } + html.no-flexbox .medium-space, + html.no-flexboxlegacy .medium-space { + margin: 1.5em; + } + html.no-flexbox .padding, + html.no-flexboxlegacy .padding { + padding: 1.5em; + } + html.no-flexbox .medium-padding, + html.no-flexboxlegacy .medium-padding { + padding: 1.5em; + } + html.no-flexbox .double-space, + html.no-flexboxlegacy .double-space { + margin: 3em; + } + html.no-flexbox .medium-double-space, + html.no-flexboxlegacy .medium-double-space { + margin: 3em; + } + html.no-flexbox .double-padding, + html.no-flexboxlegacy .double-padding { + padding: 3em; + } + html.no-flexbox .medium-double-padding, + html.no-flexboxlegacy .medium-double-padding { + padding: 3em; + } + html.no-flexbox .half-space, + html.no-flexboxlegacy .half-space { + margin: 0.75em; + } + html.no-flexbox .medium-half-space, + html.no-flexboxlegacy .medium-half-space { + margin: 0.75em; + } + html.no-flexbox .half-padding, + html.no-flexboxlegacy .half-padding { + padding: 0.75em; + } + html.no-flexbox .medium-half-padding, + html.no-flexboxlegacy .medium-half-padding { + padding: 0.75em; + } + html.no-flexbox .quarter-space, + html.no-flexboxlegacy .quarter-space { + margin: 0.375em; + } + html.no-flexbox .medium-quarter-space, + html.no-flexboxlegacy .medium-quarter-space { + margin: 0.375em; + } + html.no-flexbox .quarter-padding, + html.no-flexboxlegacy .quarter-padding { + padding: 0.375em; + } + html.no-flexbox .medium-quarter-padding, + html.no-flexboxlegacy .medium-quarter-padding { + padding: 0.375em; + } + html.no-flexbox .vertical-space, + html.no-flexboxlegacy .vertical-space { + margin-top: 1.5em; + margin-bottom: 1.5em; + } + html.no-flexbox .medium-vertical-space, + html.no-flexboxlegacy .medium-vertical-space { + margin-top: 1.5em; + margin-bottom: 1.5em; + } + html.no-flexbox .vertical-padding, + html.no-flexboxlegacy .vertical-padding { + padding-top: 1.5em; + padding-bottom: 1.5em; + } + html.no-flexbox .medium-vertical-padding, + html.no-flexboxlegacy .medium-vertical-padding { + padding-top: 1.5em; + padding-bottom: 1.5em; + } + html.no-flexbox .double-vertical-space, + html.no-flexboxlegacy .double-vertical-space { + margin-top: 3em; + margin-bottom: 3em; + } + html.no-flexbox .medium-double-vertical-space, + html.no-flexboxlegacy .medium-double-vertical-space { + margin-top: 3em; + margin-bottom: 3em; + } + html.no-flexbox .double-vertical-padding, + html.no-flexboxlegacy .double-vertical-padding { + padding-top: 3em; + padding-bottom: 3em; + } + html.no-flexbox .medium-double-vertical-padding, + html.no-flexboxlegacy .medium-double-vertical-padding { + padding-top: 3em; + padding-bottom: 3em; + } + html.no-flexbox .half-vertical-space, + html.no-flexboxlegacy .half-vertical-space { + margin-top: 0.75em; + margin-bottom: 0.75em; + } + html.no-flexbox .medium-half-vertical-space, + html.no-flexboxlegacy .medium-half-vertical-space { + margin-top: 0.75em; + margin-bottom: 0.75em; + } + html.no-flexbox .half-vertical-padding, + html.no-flexboxlegacy .half-vertical-padding { + padding-top: 0.75em; + padding-bottom: 0.75em; + } + html.no-flexbox .medium-half-vertical-padding, + html.no-flexboxlegacy .medium-half-vertical-padding { + padding-top: 0.75em; + padding-bottom: 0.75em; + } + html.no-flexbox .quarter-vertical-space, + html.no-flexboxlegacy .quarter-vertical-space { + margin-top: 0.375em; + margin-bottom: 0.375em; + } + html.no-flexbox .medium-quarter-vertical-space, + html.no-flexboxlegacy .medium-quarter-vertical-space { + margin-top: 0.375em; + margin-bottom: 0.375em; + } + html.no-flexbox .quarter-vertical-padding, + html.no-flexboxlegacy .quarter-vertical-padding { + padding-top: 0.375em; + padding-bottom: 0.375em; + } + html.no-flexbox .medium-quarter-vertical-padding, + html.no-flexboxlegacy .medium-quarter-vertical-padding { + padding-top: 0.375em; + padding-bottom: 0.375em; + } + html.no-flexbox .horizontal-space, + html.no-flexboxlegacy .horizontal-space { + margin-left: 1.5em; + margin-right: 1.5em; + } + html.no-flexbox .medium-horizontal-space, + html.no-flexboxlegacy .medium-horizontal-space { + margin-left: 1.5em; + margin-right: 1.5em; + } + html.no-flexbox .horizontal-padding, + html.no-flexboxlegacy .horizontal-padding { + padding-left: 1.5em; + padding-right: 1.5em; + } + html.no-flexbox .medium-horizontal-padding, + html.no-flexboxlegacy .medium-horizontal-padding { + padding-left: 1.5em; + padding-right: 1.5em; + } + html.no-flexbox .double-horizontal-space, + html.no-flexboxlegacy .double-horizontal-space { + margin-left: 3em; + margin-right: 3em; + } + html.no-flexbox .medium-double-horizontal-space, + html.no-flexboxlegacy .medium-double-horizontal-space { + margin-left: 3em; + margin-right: 3em; + } + html.no-flexbox .double-horizontal-padding, + html.no-flexboxlegacy .double-horizontal-padding { + padding-left: 3em; + padding-right: 3em; + } + html.no-flexbox .medium-double-horizontal-padding, + html.no-flexboxlegacy .medium-double-horizontal-padding { + padding-left: 3em; + padding-right: 3em; + } + html.no-flexbox .half-horizontal-space, + html.no-flexboxlegacy .half-horizontal-space { + margin-left: 0.75em; + margin-right: 0.75em; + } + html.no-flexbox .medium-half-horizontal-space, + html.no-flexboxlegacy .medium-half-horizontal-space { + margin-left: 0.75em; + margin-right: 0.75em; + } + html.no-flexbox .half-horizontal-padding, + html.no-flexboxlegacy .half-horizontal-padding { + padding-left: 0.75em; + padding-right: 0.75em; + } + html.no-flexbox .medium-half-horizontal-padding, + html.no-flexboxlegacy .medium-half-horizontal-padding { + padding-left: 0.75em; + padding-right: 0.75em; + } + html.no-flexbox .quarter-horizontal-space, + html.no-flexboxlegacy .quarter-horizontal-space { + margin-left: 0.375em; + margin-right: 0.375em; + } + html.no-flexbox .medium-quarter-horizontal-space, + html.no-flexboxlegacy .medium-quarter-horizontal-space { + margin-left: 0.375em; + margin-right: 0.375em; + } + html.no-flexbox .quarter-horizontal-padding, + html.no-flexboxlegacy .quarter-horizontal-padding { + padding-left: 0.375em; + padding-right: 0.375em; + } + html.no-flexbox .medium-quarter-horizontal-padding, + html.no-flexboxlegacy .medium-quarter-horizontal-padding { + padding-left: 0.375em; + padding-right: 0.375em; + } + html.no-flexbox .top-space, + html.no-flexboxlegacy .top-space { + margin-top: 1.5em; + } + html.no-flexbox .medium-top-space, + html.no-flexboxlegacy .medium-top-space { + margin-top: 1.5em; + } + html.no-flexbox .top-padding, + html.no-flexboxlegacy .top-padding { + padding-top: 1.5em; + } + html.no-flexbox .medium-top-padding, + html.no-flexboxlegacy .medium-top-padding { + padding-top: 1.5em; + } + html.no-flexbox .double-top-space, + html.no-flexboxlegacy .double-top-space { + margin-top: 3em; + } + html.no-flexbox .medium-double-top-space, + html.no-flexboxlegacy .medium-double-top-space { + margin-top: 3em; + } + html.no-flexbox .double-top-padding, + html.no-flexboxlegacy .double-top-padding { + padding-top: 3em; + } + html.no-flexbox .medium-double-top-padding, + html.no-flexboxlegacy .medium-double-top-padding { + padding-top: 3em; + } + html.no-flexbox .half-top-space, + html.no-flexboxlegacy .half-top-space { + margin-top: 0.75em; + } + html.no-flexbox .medium-half-top-space, + html.no-flexboxlegacy .medium-half-top-space { + margin-top: 0.75em; + } + html.no-flexbox .half-top-padding, + html.no-flexboxlegacy .half-top-padding { + padding-top: 0.75em; + } + html.no-flexbox .medium-half-top-padding, + html.no-flexboxlegacy .medium-half-top-padding { + padding-top: 0.75em; + } + html.no-flexbox .quarter-top-space, + html.no-flexboxlegacy .quarter-top-space { + margin-top: 0.375em; + } + html.no-flexbox .medium-quarter-top-space, + html.no-flexboxlegacy .medium-quarter-top-space { + margin-top: 0.375em; + } + html.no-flexbox .quarter-top-padding, + html.no-flexboxlegacy .quarter-top-padding { + padding-top: 0.375em; + } + html.no-flexbox .medium-quarter-top-padding, + html.no-flexboxlegacy .medium-quarter-top-padding { + padding-top: 0.375em; + } + html.no-flexbox .right-space, + html.no-flexboxlegacy .right-space { + margin-right: 1.5em; + } + html.no-flexbox .medium-right-space, + html.no-flexboxlegacy .medium-right-space { + margin-right: 1.5em; + } + html.no-flexbox .right-padding, + html.no-flexboxlegacy .right-padding { + padding-right: 1.5em; + } + html.no-flexbox .medium-right-padding, + html.no-flexboxlegacy .medium-right-padding { + padding-right: 1.5em; + } + html.no-flexbox .double-right-space, + html.no-flexboxlegacy .double-right-space { + margin-right: 3em; + } + html.no-flexbox .medium-double-right-space, + html.no-flexboxlegacy .medium-double-right-space { + margin-right: 3em; + } + html.no-flexbox .double-right-padding, + html.no-flexboxlegacy .double-right-padding { + padding-right: 3em; + } + html.no-flexbox .medium-double-right-padding, + html.no-flexboxlegacy .medium-double-right-padding { + padding-right: 3em; + } + html.no-flexbox .half-right-space, + html.no-flexboxlegacy .half-right-space { + margin-right: 0.75em; + } + html.no-flexbox .medium-half-right-space, + html.no-flexboxlegacy .medium-half-right-space { + margin-right: 0.75em; + } + html.no-flexbox .half-right-padding, + html.no-flexboxlegacy .half-right-padding { + padding-right: 0.75em; + } + html.no-flexbox .medium-half-right-padding, + html.no-flexboxlegacy .medium-half-right-padding { + padding-right: 0.75em; + } + html.no-flexbox .quarter-right-space, + html.no-flexboxlegacy .quarter-right-space { + margin-right: 0.375em; + } + html.no-flexbox .medium-quarter-right-space, + html.no-flexboxlegacy .medium-quarter-right-space { + margin-right: 0.375em; + } + html.no-flexbox .quarter-right-padding, + html.no-flexboxlegacy .quarter-right-padding { + padding-right: 0.375em; + } + html.no-flexbox .medium-quarter-right-padding, + html.no-flexboxlegacy .medium-quarter-right-padding { + padding-right: 0.375em; + } + html.no-flexbox .bottom-space, + html.no-flexboxlegacy .bottom-space { + margin-bottom: 1.5em; + } + html.no-flexbox .medium-bottom-space, + html.no-flexboxlegacy .medium-bottom-space { + margin-bottom: 1.5em; + } + html.no-flexbox .bottom-padding, + html.no-flexboxlegacy .bottom-padding { + padding-bottom: 1.5em; + } + html.no-flexbox .medium-bottom-padding, + html.no-flexboxlegacy .medium-bottom-padding { + padding-bottom: 1.5em; + } + html.no-flexbox .double-bottom-space, + html.no-flexboxlegacy .double-bottom-space { + margin-bottom: 3em; + } + html.no-flexbox .medium-double-bottom-space, + html.no-flexboxlegacy .medium-double-bottom-space { + margin-bottom: 3em; + } + html.no-flexbox .double-bottom-padding, + html.no-flexboxlegacy .double-bottom-padding { + padding-bottom: 3em; + } + html.no-flexbox .medium-double-bottom-padding, + html.no-flexboxlegacy .medium-double-bottom-padding { + padding-bottom: 3em; + } + html.no-flexbox .half-bottom-space, + html.no-flexboxlegacy .half-bottom-space { + margin-bottom: 0.75em; + } + html.no-flexbox .medium-half-bottom-space, + html.no-flexboxlegacy .medium-half-bottom-space { + margin-bottom: 0.75em; + } + html.no-flexbox .half-bottom-padding, + html.no-flexboxlegacy .half-bottom-padding { + padding-bottom: 0.75em; + } + html.no-flexbox .medium-half-bottom-padding, + html.no-flexboxlegacy .medium-half-bottom-padding { + padding-bottom: 0.75em; + } + html.no-flexbox .quarter-bottom-space, + html.no-flexboxlegacy .quarter-bottom-space { + margin-bottom: 0.375em; + } + html.no-flexbox .medium-quarter-bottom-space, + html.no-flexboxlegacy .medium-quarter-bottom-space { + margin-bottom: 0.375em; + } + html.no-flexbox .quarter-bottom-padding, + html.no-flexboxlegacy .quarter-bottom-padding { + padding-bottom: 0.375em; + } + html.no-flexbox .medium-quarter-bottom-padding, + html.no-flexboxlegacy .medium-quarter-bottom-padding { + padding-bottom: 0.375em; + } + html.no-flexbox .left-space, + html.no-flexboxlegacy .left-space { + margin-left: 1.5em; + } + html.no-flexbox .medium-left-space, + html.no-flexboxlegacy .medium-left-space { + margin-left: 1.5em; + } + html.no-flexbox .left-padding, + html.no-flexboxlegacy .left-padding { + padding-left: 1.5em; + } + html.no-flexbox .medium-left-padding, + html.no-flexboxlegacy .medium-left-padding { + padding-left: 1.5em; + } + html.no-flexbox .double-left-space, + html.no-flexboxlegacy .double-left-space { + margin-left: 3em; + } + html.no-flexbox .medium-double-left-space, + html.no-flexboxlegacy .medium-double-left-space { + margin-left: 3em; + } + html.no-flexbox .double-left-padding, + html.no-flexboxlegacy .double-left-padding { + padding-left: 3em; + } + html.no-flexbox .medium-double-left-padding, + html.no-flexboxlegacy .medium-double-left-padding { + padding-left: 3em; + } + html.no-flexbox .half-left-space, + html.no-flexboxlegacy .half-left-space { + margin-left: 0.75em; + } + html.no-flexbox .medium-half-left-space, + html.no-flexboxlegacy .medium-half-left-space { + margin-left: 0.75em; + } + html.no-flexbox .half-left-padding, + html.no-flexboxlegacy .half-left-padding { + padding-left: 0.75em; + } + html.no-flexbox .medium-half-left-padding, + html.no-flexboxlegacy .medium-half-left-padding { + padding-left: 0.75em; + } + html.no-flexbox .quarter-left-space, + html.no-flexboxlegacy .quarter-left-space { + margin-left: 0.375em; + } + html.no-flexbox .medium-quarter-left-space, + html.no-flexboxlegacy .medium-quarter-left-space { + margin-left: 0.375em; + } + html.no-flexbox .quarter-left-padding, + html.no-flexboxlegacy .quarter-left-padding { + padding-left: 0.375em; + } + html.no-flexbox .medium-quarter-left-padding, + html.no-flexboxlegacy .medium-quarter-left-padding { + padding-left: 0.375em; + } + html.no-flexbox .hide-medium, + html.no-flexboxlegacy .hide-medium { + display: none !important; + } + html.no-flexbox .show-medium, + html.no-flexboxlegacy .show-medium { + display: inherit !important; + } + html.no-flexbox table.show-medium, + html.no-flexboxlegacy table.show-medium { + display: table; + } + html.no-flexbox thead.show-medium, + html.no-flexboxlegacy thead.show-medium { + display: table-header-group; + } + html.no-flexbox tbody.show-medium, + html.no-flexboxlegacy tbody.show-medium { + display: table-row-group; + } + html.no-flexbox tfoot.show-medium, + html.no-flexboxlegacy tfoot.show-medium { + display: table-footer-group; + } + html.no-flexbox tr.show-medium, + html.no-flexboxlegacy tr.show-medium { + display: table-row; + } + html.no-flexbox th.show-medium, + html.no-flexbox td.show-medium, + html.no-flexboxlegacy th.show-medium, + html.no-flexboxlegacy td.show-medium { + display: table-cell; + } +} +@media screen and (min-width: 321px) and (max-width: 640px) { + html.no-flexbox .ink-grid, + html.no-flexboxlegacy .ink-grid { + padding: 0 1.25em; + } + html.no-flexbox .column-group > [class*=small-], + html.no-flexboxlegacy .column-group > [class*=small-] { + float: left; + clear: none; + } + html.no-flexbox .small-5, + html.no-flexboxlegacy .small-5 { + width: 5%; + } + html.no-flexbox .small-10, + html.no-flexboxlegacy .small-10 { + width: 10%; + } + html.no-flexbox .small-15, + html.no-flexboxlegacy .small-15 { + width: 15%; + } + html.no-flexbox .small-16, + html.no-flexboxlegacy .small-16 { + width: 16.66%; + } + html.no-flexbox .small-20, + html.no-flexboxlegacy .small-20 { + width: 20%; + } + html.no-flexbox .small-25, + html.no-flexboxlegacy .small-25 { + width: 25%; + } + html.no-flexbox .small-30, + html.no-flexboxlegacy .small-30 { + width: 30%; + } + html.no-flexbox .small-33, + html.no-flexboxlegacy .small-33 { + width: 33.33%; + } + html.no-flexbox .small-35, + html.no-flexboxlegacy .small-35 { + width: 35%; + } + html.no-flexbox .small-40, + html.no-flexboxlegacy .small-40 { + width: 40%; + } + html.no-flexbox .small-45, + html.no-flexboxlegacy .small-45 { + width: 45%; + } + html.no-flexbox .small-50, + html.no-flexboxlegacy .small-50 { + width: 50%; + } + html.no-flexbox .small-55, + html.no-flexboxlegacy .small-55 { + width: 55%; + } + html.no-flexbox .small-60, + html.no-flexboxlegacy .small-60 { + width: 60%; + } + html.no-flexbox .small-65, + html.no-flexboxlegacy .small-65 { + width: 65%; + } + html.no-flexbox .small-66, + html.no-flexboxlegacy .small-66 { + width: 66.66%; + } + html.no-flexbox .small-70, + html.no-flexboxlegacy .small-70 { + width: 70%; + } + html.no-flexbox .small-75, + html.no-flexboxlegacy .small-75 { + width: 75%; + } + html.no-flexbox .small-80, + html.no-flexboxlegacy .small-80 { + width: 80%; + } + html.no-flexbox .small-85, + html.no-flexboxlegacy .small-85 { + width: 85%; + } + html.no-flexbox .small-90, + html.no-flexboxlegacy .small-90 { + width: 90%; + } + html.no-flexbox .small-95, + html.no-flexboxlegacy .small-95 { + width: 95%; + } + html.no-flexbox .small-100, + html.no-flexboxlegacy .small-100 { + width: 100%; + } + html.no-flexbox [class*=small-100], + html.no-flexboxlegacy [class*=small-100] { + float: none; + clear: both; + } + html.no-flexbox .column-group, + html.no-flexboxlegacy .column-group { + *zoom: 1; + } + html.no-flexbox .column-group:after, + html.no-flexboxlegacy .column-group:after { + content: ""; + display: table; + clear: both; + } + html.no-flexbox .column-group.gutters, + html.no-flexboxlegacy .column-group.gutters { + margin-left: -1.25em; + } + html.no-flexbox .column-group.gutters > [class*=small-], html.no-flexbox .column-group.gutters > [class*=all-], + html.no-flexboxlegacy .column-group.gutters > [class*=small-], + html.no-flexboxlegacy .column-group.gutters > [class*=all-] { + padding-left: 1.25em; + margin-bottom: 1.25em; + } + html.no-flexbox .column-group.horizontal-gutters, + html.no-flexboxlegacy .column-group.horizontal-gutters { + margin-left: -1.25em; + } + html.no-flexbox .column-group.horizontal-gutters > [class*=small-], html.no-flexbox .column-group.horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.horizontal-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.horizontal-gutters > [class*=all-] { + padding-left: 1.25em; + } + html.no-flexbox .column-group.vertical-gutters > [class*=small-], html.no-flexbox .column-group.vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.vertical-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 1.25em; + } + html.no-flexbox .column-group.double-gutters, + html.no-flexboxlegacy .column-group.double-gutters { + margin-left: -2.5em; + } + html.no-flexbox .column-group.double-gutters > [class*=small-], html.no-flexbox .column-group.double-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.double-gutters > [class*=all-] { + padding-left: 2.5em; + margin-bottom: 2.5em; + } + html.no-flexbox .column-group.double-horizontal-gutters, + html.no-flexboxlegacy .column-group.double-horizontal-gutters { + margin-left: -2.5em; + } + html.no-flexbox .column-group.double-horizontal-gutters > [class*=small-], html.no-flexbox .column-group.double-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-horizontal-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 2.5em; + } + html.no-flexbox .column-group.double-vertical-gutters > [class*=small-], html.no-flexbox .column-group.double-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-vertical-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 2.5em; + } + html.no-flexbox .column-group.half-gutters, + html.no-flexboxlegacy .column-group.half-gutters { + margin-left: -0.625em; + } + html.no-flexbox .column-group.half-gutters > [class*=small-], html.no-flexbox .column-group.half-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.half-gutters > [class*=all-] { + padding-left: 0.625em; + margin-bottom: 0.625em; + } + html.no-flexbox .column-group.half-horizontal-gutters, + html.no-flexboxlegacy .column-group.half-horizontal-gutters { + margin-left: -0.625em; + } + html.no-flexbox .column-group.half-horizontal-gutters > [class*=small-], html.no-flexbox .column-group.half-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-horizontal-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 0.625em; + } + html.no-flexbox .column-group.half-vertical-gutters > [class*=small-], html.no-flexbox .column-group.half-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-vertical-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 0.625em; + } + html.no-flexbox .column-group.quarter-gutters, + html.no-flexboxlegacy .column-group.quarter-gutters { + margin-left: -0.3125em; + } + html.no-flexbox .column-group.quarter-gutters > [class*=small-], html.no-flexbox .column-group.quarter-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.3125em; + margin-bottom: 0.3125em; + } + html.no-flexbox .column-group.quarter-horizontal-gutters, + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters { + margin-left: -0.3125em; + } + html.no-flexbox .column-group.quarter-horizontal-gutters > [class*=small-], html.no-flexbox .column-group.quarter-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.3125em; + } + html.no-flexbox .column-group.quarter-vertical-gutters > [class*=small-], html.no-flexbox .column-group.quarter-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-vertical-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.3125em; + } + html.no-flexbox .column-group.small-gutters, + html.no-flexboxlegacy .column-group.small-gutters { + margin-left: -1.25em; + } + html.no-flexbox .column-group.small-gutters > [class*=small-], html.no-flexbox .column-group.small-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-gutters > [class*=all-] { + padding-left: 1.25em; + margin-bottom: 1.25em; + } + html.no-flexbox .column-group.small-horizontal-gutters, + html.no-flexboxlegacy .column-group.small-horizontal-gutters { + margin-left: -1.25em; + } + html.no-flexbox .column-group.small-horizontal-gutters > [class*=small-], html.no-flexbox .column-group.small-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-horizontal-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-horizontal-gutters > [class*=all-] { + padding-left: 1.25em; + } + html.no-flexbox .column-group.small-vertical-gutters > [class*=small-], html.no-flexbox .column-group.small-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-vertical-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-vertical-gutters > [class*=all-] { + margin-bottom: 1.25em; + } + html.no-flexbox .column-group.small-double-gutters, + html.no-flexboxlegacy .column-group.small-double-gutters { + margin-left: -2.5em; + } + html.no-flexbox .column-group.small-double-gutters > [class*=small-], html.no-flexbox .column-group.small-double-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-double-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-double-gutters > [class*=all-] { + padding-left: 2.5em; + margin-bottom: 2.5em; + } + html.no-flexbox .column-group.small-double-horizontal-gutters, + html.no-flexboxlegacy .column-group.small-double-horizontal-gutters { + margin-left: -2.5em; + } + html.no-flexbox .column-group.small-double-horizontal-gutters > [class*=small-], html.no-flexbox .column-group.small-double-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-double-horizontal-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-double-horizontal-gutters > [class*=all-] { + padding-left: 2.5em; + } + html.no-flexbox .column-group.small-double-vertical-gutters > [class*=small-], html.no-flexbox .column-group.small-double-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-double-vertical-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-double-vertical-gutters > [class*=all-] { + margin-bottom: 2.5em; + } + html.no-flexbox .column-group.small-half-gutters, + html.no-flexboxlegacy .column-group.small-half-gutters { + margin-left: -0.625em; + } + html.no-flexbox .column-group.small-half-gutters > [class*=small-], html.no-flexbox .column-group.small-half-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-half-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-half-gutters > [class*=all-] { + padding-left: 0.625em; + margin-bottom: 0.625em; + } + html.no-flexbox .column-group.small-half-horizontal-gutters, + html.no-flexboxlegacy .column-group.small-half-horizontal-gutters { + margin-left: -0.625em; + } + html.no-flexbox .column-group.small-half-horizontal-gutters > [class*=small-], html.no-flexbox .column-group.small-half-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-half-horizontal-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-half-horizontal-gutters > [class*=all-] { + padding-left: 0.625em; + } + html.no-flexbox .column-group.small-half-vertical-gutters > [class*=small-], html.no-flexbox .column-group.small-half-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-half-vertical-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-half-vertical-gutters > [class*=all-] { + margin-bottom: 0.625em; + } + html.no-flexbox .column-group.small-quarter-gutters, + html.no-flexboxlegacy .column-group.small-quarter-gutters { + margin-left: -0.3125em; + } + html.no-flexbox .column-group.small-quarter-gutters > [class*=small-], html.no-flexbox .column-group.small-quarter-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-quarter-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-quarter-gutters > [class*=all-] { + padding-left: 0.3125em; + margin-bottom: 0.3125em; + } + html.no-flexbox .column-group.small-quarter-horizontal-gutters, + html.no-flexboxlegacy .column-group.small-quarter-horizontal-gutters { + margin-left: -0.3125em; + } + html.no-flexbox .column-group.small-quarter-horizontal-gutters > [class*=small-], html.no-flexbox .column-group.small-quarter-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-quarter-horizontal-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.3125em; + } + html.no-flexbox .column-group.small-quarter-vertical-gutters > [class*=small-], html.no-flexbox .column-group.small-quarter-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-quarter-vertical-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.3125em; + } + html.no-flexbox .column-group.small-no-gutters, + html.no-flexboxlegacy .column-group.small-no-gutters { + margin-left: 0; + } + html.no-flexbox .column-group.small-no-gutters > [class*=small-], html.no-flexbox .column-group.small-no-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.small-no-gutters > [class*=small-], + html.no-flexboxlegacy .column-group.small-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; + } + html.no-flexbox .ink-table td[class*=small-], html.no-flexbox .ink-table th[class*=small-], html.no-flexbox .ink-table tr[class*=small-], html.no-flexbox .ink-table thead[class*=small-], html.no-flexbox .ink-table tbody[class*=small-], html.no-flexbox .ink-table tfoot[class*=small-], + html.no-flexboxlegacy .ink-table td[class*=small-], + html.no-flexboxlegacy .ink-table th[class*=small-], + html.no-flexboxlegacy .ink-table tr[class*=small-], + html.no-flexboxlegacy .ink-table thead[class*=small-], + html.no-flexboxlegacy .ink-table tbody[class*=small-], + html.no-flexboxlegacy .ink-table tfoot[class*=small-] { + float: none; + } + html.no-flexbox .small-push-left, + html.no-flexboxlegacy .small-push-left { + float: left; + } + html.no-flexbox .small-push-center, + html.no-flexboxlegacy .small-push-center { + float: none; + margin-left: auto; + margin-right: auto; + } + html.no-flexbox .small-push-right, + html.no-flexboxlegacy .small-push-right { + float: right; + } + html.no-flexbox .small-align-left, + html.no-flexboxlegacy .small-align-left { + text-align: left; + } + html.no-flexbox .small-align-center, + html.no-flexboxlegacy .small-align-center { + text-align: center; + } + html.no-flexbox .small-align-right, + html.no-flexboxlegacy .small-align-right { + text-align: right; + } + html.no-flexbox .small-no-margin, + html.no-flexboxlegacy .small-no-margin { + margin: 0 !important; + } + html.no-flexbox .space, + html.no-flexboxlegacy .space { + margin: 1.25em; + } + html.no-flexbox .small-space, + html.no-flexboxlegacy .small-space { + margin: 1.25em; + } + html.no-flexbox .padding, + html.no-flexboxlegacy .padding { + padding: 1.25em; + } + html.no-flexbox .small-padding, + html.no-flexboxlegacy .small-padding { + padding: 1.25em; + } + html.no-flexbox .double-space, + html.no-flexboxlegacy .double-space { + margin: 2.5em; + } + html.no-flexbox .small-double-space, + html.no-flexboxlegacy .small-double-space { + margin: 2.5em; + } + html.no-flexbox .double-padding, + html.no-flexboxlegacy .double-padding { + padding: 2.5em; + } + html.no-flexbox .small-double-padding, + html.no-flexboxlegacy .small-double-padding { + padding: 2.5em; + } + html.no-flexbox .half-space, + html.no-flexboxlegacy .half-space { + margin: 0.625em; + } + html.no-flexbox .small-half-space, + html.no-flexboxlegacy .small-half-space { + margin: 0.625em; + } + html.no-flexbox .half-padding, + html.no-flexboxlegacy .half-padding { + padding: 0.625em; + } + html.no-flexbox .small-half-padding, + html.no-flexboxlegacy .small-half-padding { + padding: 0.625em; + } + html.no-flexbox .quarter-space, + html.no-flexboxlegacy .quarter-space { + margin: 0.3125em; + } + html.no-flexbox .small-quarter-space, + html.no-flexboxlegacy .small-quarter-space { + margin: 0.3125em; + } + html.no-flexbox .quarter-padding, + html.no-flexboxlegacy .quarter-padding { + padding: 0.3125em; + } + html.no-flexbox .small-quarter-padding, + html.no-flexboxlegacy .small-quarter-padding { + padding: 0.3125em; + } + html.no-flexbox .vertical-space, + html.no-flexboxlegacy .vertical-space { + margin-top: 1.25em; + margin-bottom: 1.25em; + } + html.no-flexbox .small-vertical-space, + html.no-flexboxlegacy .small-vertical-space { + margin-top: 1.25em; + margin-bottom: 1.25em; + } + html.no-flexbox .vertical-padding, + html.no-flexboxlegacy .vertical-padding { + padding-top: 1.25em; + padding-bottom: 1.25em; + } + html.no-flexbox .small-vertical-padding, + html.no-flexboxlegacy .small-vertical-padding { + padding-top: 1.25em; + padding-bottom: 1.25em; + } + html.no-flexbox .double-vertical-space, + html.no-flexboxlegacy .double-vertical-space { + margin-top: 2.5em; + margin-bottom: 2.5em; + } + html.no-flexbox .small-double-vertical-space, + html.no-flexboxlegacy .small-double-vertical-space { + margin-top: 2.5em; + margin-bottom: 2.5em; + } + html.no-flexbox .double-vertical-padding, + html.no-flexboxlegacy .double-vertical-padding { + padding-top: 2.5em; + padding-bottom: 2.5em; + } + html.no-flexbox .small-double-vertical-padding, + html.no-flexboxlegacy .small-double-vertical-padding { + padding-top: 2.5em; + padding-bottom: 2.5em; + } + html.no-flexbox .half-vertical-space, + html.no-flexboxlegacy .half-vertical-space { + margin-top: 0.625em; + margin-bottom: 0.625em; + } + html.no-flexbox .small-half-vertical-space, + html.no-flexboxlegacy .small-half-vertical-space { + margin-top: 0.625em; + margin-bottom: 0.625em; + } + html.no-flexbox .half-vertical-padding, + html.no-flexboxlegacy .half-vertical-padding { + padding-top: 0.625em; + padding-bottom: 0.625em; + } + html.no-flexbox .small-half-vertical-padding, + html.no-flexboxlegacy .small-half-vertical-padding { + padding-top: 0.625em; + padding-bottom: 0.625em; + } + html.no-flexbox .quarter-vertical-space, + html.no-flexboxlegacy .quarter-vertical-space { + margin-top: 0.3125em; + margin-bottom: 0.3125em; + } + html.no-flexbox .small-quarter-vertical-space, + html.no-flexboxlegacy .small-quarter-vertical-space { + margin-top: 0.3125em; + margin-bottom: 0.3125em; + } + html.no-flexbox .quarter-vertical-padding, + html.no-flexboxlegacy .quarter-vertical-padding { + padding-top: 0.3125em; + padding-bottom: 0.3125em; + } + html.no-flexbox .small-quarter-vertical-padding, + html.no-flexboxlegacy .small-quarter-vertical-padding { + padding-top: 0.3125em; + padding-bottom: 0.3125em; + } + html.no-flexbox .horizontal-space, + html.no-flexboxlegacy .horizontal-space { + margin-left: 1.25em; + margin-right: 1.25em; + } + html.no-flexbox .small-horizontal-space, + html.no-flexboxlegacy .small-horizontal-space { + margin-left: 1.25em; + margin-right: 1.25em; + } + html.no-flexbox .horizontal-padding, + html.no-flexboxlegacy .horizontal-padding { + padding-left: 1.25em; + padding-right: 1.25em; + } + html.no-flexbox .small-horizontal-padding, + html.no-flexboxlegacy .small-horizontal-padding { + padding-left: 1.25em; + padding-right: 1.25em; + } + html.no-flexbox .double-horizontal-space, + html.no-flexboxlegacy .double-horizontal-space { + margin-left: 2.5em; + margin-right: 2.5em; + } + html.no-flexbox .small-double-horizontal-space, + html.no-flexboxlegacy .small-double-horizontal-space { + margin-left: 2.5em; + margin-right: 2.5em; + } + html.no-flexbox .double-horizontal-padding, + html.no-flexboxlegacy .double-horizontal-padding { + padding-left: 2.5em; + padding-right: 2.5em; + } + html.no-flexbox .small-double-horizontal-padding, + html.no-flexboxlegacy .small-double-horizontal-padding { + padding-left: 2.5em; + padding-right: 2.5em; + } + html.no-flexbox .half-horizontal-space, + html.no-flexboxlegacy .half-horizontal-space { + margin-left: 0.625em; + margin-right: 0.625em; + } + html.no-flexbox .small-half-horizontal-space, + html.no-flexboxlegacy .small-half-horizontal-space { + margin-left: 0.625em; + margin-right: 0.625em; + } + html.no-flexbox .half-horizontal-padding, + html.no-flexboxlegacy .half-horizontal-padding { + padding-left: 0.625em; + padding-right: 0.625em; + } + html.no-flexbox .small-half-horizontal-padding, + html.no-flexboxlegacy .small-half-horizontal-padding { + padding-left: 0.625em; + padding-right: 0.625em; + } + html.no-flexbox .quarter-horizontal-space, + html.no-flexboxlegacy .quarter-horizontal-space { + margin-left: 0.3125em; + margin-right: 0.3125em; + } + html.no-flexbox .small-quarter-horizontal-space, + html.no-flexboxlegacy .small-quarter-horizontal-space { + margin-left: 0.3125em; + margin-right: 0.3125em; + } + html.no-flexbox .quarter-horizontal-padding, + html.no-flexboxlegacy .quarter-horizontal-padding { + padding-left: 0.3125em; + padding-right: 0.3125em; + } + html.no-flexbox .small-quarter-horizontal-padding, + html.no-flexboxlegacy .small-quarter-horizontal-padding { + padding-left: 0.3125em; + padding-right: 0.3125em; + } + html.no-flexbox .top-space, + html.no-flexboxlegacy .top-space { + margin-top: 1.25em; + } + html.no-flexbox .small-top-space, + html.no-flexboxlegacy .small-top-space { + margin-top: 1.25em; + } + html.no-flexbox .top-padding, + html.no-flexboxlegacy .top-padding { + padding-top: 1.25em; + } + html.no-flexbox .small-top-padding, + html.no-flexboxlegacy .small-top-padding { + padding-top: 1.25em; + } + html.no-flexbox .double-top-space, + html.no-flexboxlegacy .double-top-space { + margin-top: 2.5em; + } + html.no-flexbox .small-double-top-space, + html.no-flexboxlegacy .small-double-top-space { + margin-top: 2.5em; + } + html.no-flexbox .double-top-padding, + html.no-flexboxlegacy .double-top-padding { + padding-top: 2.5em; + } + html.no-flexbox .small-double-top-padding, + html.no-flexboxlegacy .small-double-top-padding { + padding-top: 2.5em; + } + html.no-flexbox .half-top-space, + html.no-flexboxlegacy .half-top-space { + margin-top: 0.625em; + } + html.no-flexbox .small-half-top-space, + html.no-flexboxlegacy .small-half-top-space { + margin-top: 0.625em; + } + html.no-flexbox .half-top-padding, + html.no-flexboxlegacy .half-top-padding { + padding-top: 0.625em; + } + html.no-flexbox .small-half-top-padding, + html.no-flexboxlegacy .small-half-top-padding { + padding-top: 0.625em; + } + html.no-flexbox .quarter-top-space, + html.no-flexboxlegacy .quarter-top-space { + margin-top: 0.3125em; + } + html.no-flexbox .small-quarter-top-space, + html.no-flexboxlegacy .small-quarter-top-space { + margin-top: 0.3125em; + } + html.no-flexbox .quarter-top-padding, + html.no-flexboxlegacy .quarter-top-padding { + padding-top: 0.3125em; + } + html.no-flexbox .small-quarter-top-padding, + html.no-flexboxlegacy .small-quarter-top-padding { + padding-top: 0.3125em; + } + html.no-flexbox .right-space, + html.no-flexboxlegacy .right-space { + margin-right: 1.25em; + } + html.no-flexbox .small-right-space, + html.no-flexboxlegacy .small-right-space { + margin-right: 1.25em; + } + html.no-flexbox .right-padding, + html.no-flexboxlegacy .right-padding { + padding-right: 1.25em; + } + html.no-flexbox .small-right-padding, + html.no-flexboxlegacy .small-right-padding { + padding-right: 1.25em; + } + html.no-flexbox .double-right-space, + html.no-flexboxlegacy .double-right-space { + margin-right: 2.5em; + } + html.no-flexbox .small-double-right-space, + html.no-flexboxlegacy .small-double-right-space { + margin-right: 2.5em; + } + html.no-flexbox .double-right-padding, + html.no-flexboxlegacy .double-right-padding { + padding-right: 2.5em; + } + html.no-flexbox .small-double-right-padding, + html.no-flexboxlegacy .small-double-right-padding { + padding-right: 2.5em; + } + html.no-flexbox .half-right-space, + html.no-flexboxlegacy .half-right-space { + margin-right: 0.625em; + } + html.no-flexbox .small-half-right-space, + html.no-flexboxlegacy .small-half-right-space { + margin-right: 0.625em; + } + html.no-flexbox .half-right-padding, + html.no-flexboxlegacy .half-right-padding { + padding-right: 0.625em; + } + html.no-flexbox .small-half-right-padding, + html.no-flexboxlegacy .small-half-right-padding { + padding-right: 0.625em; + } + html.no-flexbox .quarter-right-space, + html.no-flexboxlegacy .quarter-right-space { + margin-right: 0.3125em; + } + html.no-flexbox .small-quarter-right-space, + html.no-flexboxlegacy .small-quarter-right-space { + margin-right: 0.3125em; + } + html.no-flexbox .quarter-right-padding, + html.no-flexboxlegacy .quarter-right-padding { + padding-right: 0.3125em; + } + html.no-flexbox .small-quarter-right-padding, + html.no-flexboxlegacy .small-quarter-right-padding { + padding-right: 0.3125em; + } + html.no-flexbox .bottom-space, + html.no-flexboxlegacy .bottom-space { + margin-bottom: 1.25em; + } + html.no-flexbox .small-bottom-space, + html.no-flexboxlegacy .small-bottom-space { + margin-bottom: 1.25em; + } + html.no-flexbox .bottom-padding, + html.no-flexboxlegacy .bottom-padding { + padding-bottom: 1.25em; + } + html.no-flexbox .small-bottom-padding, + html.no-flexboxlegacy .small-bottom-padding { + padding-bottom: 1.25em; + } + html.no-flexbox .double-bottom-space, + html.no-flexboxlegacy .double-bottom-space { + margin-bottom: 2.5em; + } + html.no-flexbox .small-double-bottom-space, + html.no-flexboxlegacy .small-double-bottom-space { + margin-bottom: 2.5em; + } + html.no-flexbox .double-bottom-padding, + html.no-flexboxlegacy .double-bottom-padding { + padding-bottom: 2.5em; + } + html.no-flexbox .small-double-bottom-padding, + html.no-flexboxlegacy .small-double-bottom-padding { + padding-bottom: 2.5em; + } + html.no-flexbox .half-bottom-space, + html.no-flexboxlegacy .half-bottom-space { + margin-bottom: 0.625em; + } + html.no-flexbox .small-half-bottom-space, + html.no-flexboxlegacy .small-half-bottom-space { + margin-bottom: 0.625em; + } + html.no-flexbox .half-bottom-padding, + html.no-flexboxlegacy .half-bottom-padding { + padding-bottom: 0.625em; + } + html.no-flexbox .small-half-bottom-padding, + html.no-flexboxlegacy .small-half-bottom-padding { + padding-bottom: 0.625em; + } + html.no-flexbox .quarter-bottom-space, + html.no-flexboxlegacy .quarter-bottom-space { + margin-bottom: 0.3125em; + } + html.no-flexbox .small-quarter-bottom-space, + html.no-flexboxlegacy .small-quarter-bottom-space { + margin-bottom: 0.3125em; + } + html.no-flexbox .quarter-bottom-padding, + html.no-flexboxlegacy .quarter-bottom-padding { + padding-bottom: 0.3125em; + } + html.no-flexbox .small-quarter-bottom-padding, + html.no-flexboxlegacy .small-quarter-bottom-padding { + padding-bottom: 0.3125em; + } + html.no-flexbox .left-space, + html.no-flexboxlegacy .left-space { + margin-left: 1.25em; + } + html.no-flexbox .small-left-space, + html.no-flexboxlegacy .small-left-space { + margin-left: 1.25em; + } + html.no-flexbox .left-padding, + html.no-flexboxlegacy .left-padding { + padding-left: 1.25em; + } + html.no-flexbox .small-left-padding, + html.no-flexboxlegacy .small-left-padding { + padding-left: 1.25em; + } + html.no-flexbox .double-left-space, + html.no-flexboxlegacy .double-left-space { + margin-left: 2.5em; + } + html.no-flexbox .small-double-left-space, + html.no-flexboxlegacy .small-double-left-space { + margin-left: 2.5em; + } + html.no-flexbox .double-left-padding, + html.no-flexboxlegacy .double-left-padding { + padding-left: 2.5em; + } + html.no-flexbox .small-double-left-padding, + html.no-flexboxlegacy .small-double-left-padding { + padding-left: 2.5em; + } + html.no-flexbox .half-left-space, + html.no-flexboxlegacy .half-left-space { + margin-left: 0.625em; + } + html.no-flexbox .small-half-left-space, + html.no-flexboxlegacy .small-half-left-space { + margin-left: 0.625em; + } + html.no-flexbox .half-left-padding, + html.no-flexboxlegacy .half-left-padding { + padding-left: 0.625em; + } + html.no-flexbox .small-half-left-padding, + html.no-flexboxlegacy .small-half-left-padding { + padding-left: 0.625em; + } + html.no-flexbox .quarter-left-space, + html.no-flexboxlegacy .quarter-left-space { + margin-left: 0.3125em; + } + html.no-flexbox .small-quarter-left-space, + html.no-flexboxlegacy .small-quarter-left-space { + margin-left: 0.3125em; + } + html.no-flexbox .quarter-left-padding, + html.no-flexboxlegacy .quarter-left-padding { + padding-left: 0.3125em; + } + html.no-flexbox .small-quarter-left-padding, + html.no-flexboxlegacy .small-quarter-left-padding { + padding-left: 0.3125em; + } + html.no-flexbox .hide-small, + html.no-flexboxlegacy .hide-small { + display: none !important; + } + html.no-flexbox .show-small, + html.no-flexboxlegacy .show-small { + display: inherit !important; + } + html.no-flexbox table.show-small, + html.no-flexboxlegacy table.show-small { + display: table; + } + html.no-flexbox thead.show-small, + html.no-flexboxlegacy thead.show-small { + display: table-header-group; + } + html.no-flexbox tbody.show-small, + html.no-flexboxlegacy tbody.show-small { + display: table-row-group; + } + html.no-flexbox tfoot.show-small, + html.no-flexboxlegacy tfoot.show-small { + display: table-footer-group; + } + html.no-flexbox tr.show-small, + html.no-flexboxlegacy tr.show-small { + display: table-row; + } + html.no-flexbox th.show-small, + html.no-flexbox td.show-small, + html.no-flexboxlegacy th.show-small, + html.no-flexboxlegacy td.show-small { + display: table-cell; + } +} +@media screen and (max-width: 320px) { + html.no-flexbox .ink-grid, + html.no-flexboxlegacy .ink-grid { + padding: 0 1em; + } + html.no-flexbox .column-group > [class*=tiny-], + html.no-flexboxlegacy .column-group > [class*=tiny-] { + float: left; + clear: none; + } + html.no-flexbox .tiny-5, + html.no-flexboxlegacy .tiny-5 { + width: 5%; + } + html.no-flexbox .tiny-10, + html.no-flexboxlegacy .tiny-10 { + width: 10%; + } + html.no-flexbox .tiny-15, + html.no-flexboxlegacy .tiny-15 { + width: 15%; + } + html.no-flexbox .tiny-16, + html.no-flexboxlegacy .tiny-16 { + width: 16.66%; + } + html.no-flexbox .tiny-20, + html.no-flexboxlegacy .tiny-20 { + width: 20%; + } + html.no-flexbox .tiny-25, + html.no-flexboxlegacy .tiny-25 { + width: 25%; + } + html.no-flexbox .tiny-30, + html.no-flexboxlegacy .tiny-30 { + width: 30%; + } + html.no-flexbox .tiny-33, + html.no-flexboxlegacy .tiny-33 { + width: 33.33%; + } + html.no-flexbox .tiny-35, + html.no-flexboxlegacy .tiny-35 { + width: 35%; + } + html.no-flexbox .tiny-40, + html.no-flexboxlegacy .tiny-40 { + width: 40%; + } + html.no-flexbox .tiny-45, + html.no-flexboxlegacy .tiny-45 { + width: 45%; + } + html.no-flexbox .tiny-50, + html.no-flexboxlegacy .tiny-50 { + width: 50%; + } + html.no-flexbox .tiny-55, + html.no-flexboxlegacy .tiny-55 { + width: 55%; + } + html.no-flexbox .tiny-60, + html.no-flexboxlegacy .tiny-60 { + width: 60%; + } + html.no-flexbox .tiny-65, + html.no-flexboxlegacy .tiny-65 { + width: 65%; + } + html.no-flexbox .tiny-66, + html.no-flexboxlegacy .tiny-66 { + width: 66.66%; + } + html.no-flexbox .tiny-70, + html.no-flexboxlegacy .tiny-70 { + width: 70%; + } + html.no-flexbox .tiny-75, + html.no-flexboxlegacy .tiny-75 { + width: 75%; + } + html.no-flexbox .tiny-80, + html.no-flexboxlegacy .tiny-80 { + width: 80%; + } + html.no-flexbox .tiny-85, + html.no-flexboxlegacy .tiny-85 { + width: 85%; + } + html.no-flexbox .tiny-90, + html.no-flexboxlegacy .tiny-90 { + width: 90%; + } + html.no-flexbox .tiny-95, + html.no-flexboxlegacy .tiny-95 { + width: 95%; + } + html.no-flexbox .tiny-100, + html.no-flexboxlegacy .tiny-100 { + width: 100%; + } + html.no-flexbox [class*=tiny-100], + html.no-flexboxlegacy [class*=tiny-100] { + float: none; + clear: both; + } + html.no-flexbox .column-group, + html.no-flexboxlegacy .column-group { + *zoom: 1; + } + html.no-flexbox .column-group:after, + html.no-flexboxlegacy .column-group:after { + content: ""; + display: table; + clear: both; + } + html.no-flexbox .column-group.gutters, + html.no-flexboxlegacy .column-group.gutters { + margin-left: -1em; + } + html.no-flexbox .column-group.gutters > [class*=tiny-], html.no-flexbox .column-group.gutters > [class*=all-], + html.no-flexboxlegacy .column-group.gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.gutters > [class*=all-] { + padding-left: 1em; + margin-bottom: 1em; + } + html.no-flexbox .column-group.horizontal-gutters, + html.no-flexboxlegacy .column-group.horizontal-gutters { + margin-left: -1em; + } + html.no-flexbox .column-group.horizontal-gutters > [class*=tiny-], html.no-flexbox .column-group.horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.horizontal-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.horizontal-gutters > [class*=all-] { + padding-left: 1em; + } + html.no-flexbox .column-group.vertical-gutters > [class*=tiny-], html.no-flexbox .column-group.vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.vertical-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 1em; + } + html.no-flexbox .column-group.double-gutters, + html.no-flexboxlegacy .column-group.double-gutters { + margin-left: -2em; + } + html.no-flexbox .column-group.double-gutters > [class*=tiny-], html.no-flexbox .column-group.double-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.double-gutters > [class*=all-] { + padding-left: 2em; + margin-bottom: 2em; + } + html.no-flexbox .column-group.double-horizontal-gutters, + html.no-flexboxlegacy .column-group.double-horizontal-gutters { + margin-left: -2em; + } + html.no-flexbox .column-group.double-horizontal-gutters > [class*=tiny-], html.no-flexbox .column-group.double-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-horizontal-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 2em; + } + html.no-flexbox .column-group.double-vertical-gutters > [class*=tiny-], html.no-flexbox .column-group.double-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.double-vertical-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 2em; + } + html.no-flexbox .column-group.half-gutters, + html.no-flexboxlegacy .column-group.half-gutters { + margin-left: -0.5em; + } + html.no-flexbox .column-group.half-gutters > [class*=tiny-], html.no-flexbox .column-group.half-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.half-gutters > [class*=all-] { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + html.no-flexbox .column-group.half-horizontal-gutters, + html.no-flexboxlegacy .column-group.half-horizontal-gutters { + margin-left: -0.5em; + } + html.no-flexbox .column-group.half-horizontal-gutters > [class*=tiny-], html.no-flexbox .column-group.half-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-horizontal-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 0.5em; + } + html.no-flexbox .column-group.half-vertical-gutters > [class*=tiny-], html.no-flexbox .column-group.half-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.half-vertical-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 0.5em; + } + html.no-flexbox .column-group.quarter-gutters, + html.no-flexboxlegacy .column-group.quarter-gutters { + margin-left: -0.25em; + } + html.no-flexbox .column-group.quarter-gutters > [class*=tiny-], html.no-flexbox .column-group.quarter-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.25em; + margin-bottom: 0.25em; + } + html.no-flexbox .column-group.quarter-horizontal-gutters, + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters { + margin-left: -0.25em; + } + html.no-flexbox .column-group.quarter-horizontal-gutters > [class*=tiny-], html.no-flexbox .column-group.quarter-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.25em; + } + html.no-flexbox .column-group.quarter-vertical-gutters > [class*=tiny-], html.no-flexbox .column-group.quarter-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.quarter-vertical-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.25em; + } + html.no-flexbox .column-group.tiny-gutters, + html.no-flexboxlegacy .column-group.tiny-gutters { + margin-left: -1em; + } + html.no-flexbox .column-group.tiny-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-gutters > [class*=all-] { + padding-left: 1em; + margin-bottom: 1em; + } + html.no-flexbox .column-group.tiny-horizontal-gutters, + html.no-flexboxlegacy .column-group.tiny-horizontal-gutters { + margin-left: -1em; + } + html.no-flexbox .column-group.tiny-horizontal-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-horizontal-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-horizontal-gutters > [class*=all-] { + padding-left: 1em; + } + html.no-flexbox .column-group.tiny-vertical-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-vertical-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-vertical-gutters > [class*=all-] { + margin-bottom: 1em; + } + html.no-flexbox .column-group.tiny-double-gutters, + html.no-flexboxlegacy .column-group.tiny-double-gutters { + margin-left: -2em; + } + html.no-flexbox .column-group.tiny-double-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-double-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-double-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-double-gutters > [class*=all-] { + padding-left: 2em; + margin-bottom: 2em; + } + html.no-flexbox .column-group.tiny-double-horizontal-gutters, + html.no-flexboxlegacy .column-group.tiny-double-horizontal-gutters { + margin-left: -2em; + } + html.no-flexbox .column-group.tiny-double-horizontal-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-double-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-double-horizontal-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-double-horizontal-gutters > [class*=all-] { + padding-left: 2em; + } + html.no-flexbox .column-group.tiny-double-vertical-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-double-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-double-vertical-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-double-vertical-gutters > [class*=all-] { + margin-bottom: 2em; + } + html.no-flexbox .column-group.tiny-half-gutters, + html.no-flexboxlegacy .column-group.tiny-half-gutters { + margin-left: -0.5em; + } + html.no-flexbox .column-group.tiny-half-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-half-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-half-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-half-gutters > [class*=all-] { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + html.no-flexbox .column-group.tiny-half-horizontal-gutters, + html.no-flexboxlegacy .column-group.tiny-half-horizontal-gutters { + margin-left: -0.5em; + } + html.no-flexbox .column-group.tiny-half-horizontal-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-half-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-half-horizontal-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-half-horizontal-gutters > [class*=all-] { + padding-left: 0.5em; + } + html.no-flexbox .column-group.tiny-half-vertical-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-half-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-half-vertical-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-half-vertical-gutters > [class*=all-] { + margin-bottom: 0.5em; + } + html.no-flexbox .column-group.tiny-quarter-gutters, + html.no-flexboxlegacy .column-group.tiny-quarter-gutters { + margin-left: -0.25em; + } + html.no-flexbox .column-group.tiny-quarter-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-quarter-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-quarter-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-quarter-gutters > [class*=all-] { + padding-left: 0.25em; + margin-bottom: 0.25em; + } + html.no-flexbox .column-group.tiny-quarter-horizontal-gutters, + html.no-flexboxlegacy .column-group.tiny-quarter-horizontal-gutters { + margin-left: -0.25em; + } + html.no-flexbox .column-group.tiny-quarter-horizontal-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-quarter-horizontal-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-quarter-horizontal-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.25em; + } + html.no-flexbox .column-group.tiny-quarter-vertical-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-quarter-vertical-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-quarter-vertical-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.25em; + } + html.no-flexbox .column-group.tiny-no-gutters, + html.no-flexboxlegacy .column-group.tiny-no-gutters { + margin-left: 0; + } + html.no-flexbox .column-group.tiny-no-gutters > [class*=tiny-], html.no-flexbox .column-group.tiny-no-gutters > [class*=all-], + html.no-flexboxlegacy .column-group.tiny-no-gutters > [class*=tiny-], + html.no-flexboxlegacy .column-group.tiny-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; + } + html.no-flexbox .ink-table td[class*=tiny-], html.no-flexbox .ink-table th[class*=tiny-], html.no-flexbox .ink-table tr[class*=tiny-], html.no-flexbox .ink-table thead[class*=tiny-], html.no-flexbox .ink-table tbody[class*=tiny-], html.no-flexbox .ink-table tfoot[class*=tiny-], + html.no-flexboxlegacy .ink-table td[class*=tiny-], + html.no-flexboxlegacy .ink-table th[class*=tiny-], + html.no-flexboxlegacy .ink-table tr[class*=tiny-], + html.no-flexboxlegacy .ink-table thead[class*=tiny-], + html.no-flexboxlegacy .ink-table tbody[class*=tiny-], + html.no-flexboxlegacy .ink-table tfoot[class*=tiny-] { + float: none; + } + html.no-flexbox .tiny-push-left, + html.no-flexboxlegacy .tiny-push-left { + float: left; + } + html.no-flexbox .tiny-push-center, + html.no-flexboxlegacy .tiny-push-center { + float: none; + margin-left: auto; + margin-right: auto; + } + html.no-flexbox .tiny-push-right, + html.no-flexboxlegacy .tiny-push-right { + float: right; + } + html.no-flexbox .tiny-align-left, + html.no-flexboxlegacy .tiny-align-left { + text-align: left; + } + html.no-flexbox .tiny-align-center, + html.no-flexboxlegacy .tiny-align-center { + text-align: center; + } + html.no-flexbox .tiny-align-right, + html.no-flexboxlegacy .tiny-align-right { + text-align: right; + } + html.no-flexbox .tiny-no-margin, + html.no-flexboxlegacy .tiny-no-margin { + margin: 0 !important; + } + html.no-flexbox .space, + html.no-flexboxlegacy .space { + margin: 1em; + } + html.no-flexbox .tiny-space, + html.no-flexboxlegacy .tiny-space { + margin: 1em; + } + html.no-flexbox .padding, + html.no-flexboxlegacy .padding { + padding: 1em; + } + html.no-flexbox .tiny-padding, + html.no-flexboxlegacy .tiny-padding { + padding: 1em; + } + html.no-flexbox .double-space, + html.no-flexboxlegacy .double-space { + margin: 2em; + } + html.no-flexbox .tiny-double-space, + html.no-flexboxlegacy .tiny-double-space { + margin: 2em; + } + html.no-flexbox .double-padding, + html.no-flexboxlegacy .double-padding { + padding: 2em; + } + html.no-flexbox .tiny-double-padding, + html.no-flexboxlegacy .tiny-double-padding { + padding: 2em; + } + html.no-flexbox .half-space, + html.no-flexboxlegacy .half-space { + margin: 0.5em; + } + html.no-flexbox .tiny-half-space, + html.no-flexboxlegacy .tiny-half-space { + margin: 0.5em; + } + html.no-flexbox .half-padding, + html.no-flexboxlegacy .half-padding { + padding: 0.5em; + } + html.no-flexbox .tiny-half-padding, + html.no-flexboxlegacy .tiny-half-padding { + padding: 0.5em; + } + html.no-flexbox .quarter-space, + html.no-flexboxlegacy .quarter-space { + margin: 0.25em; + } + html.no-flexbox .tiny-quarter-space, + html.no-flexboxlegacy .tiny-quarter-space { + margin: 0.25em; + } + html.no-flexbox .quarter-padding, + html.no-flexboxlegacy .quarter-padding { + padding: 0.25em; + } + html.no-flexbox .tiny-quarter-padding, + html.no-flexboxlegacy .tiny-quarter-padding { + padding: 0.25em; + } + html.no-flexbox .vertical-space, + html.no-flexboxlegacy .vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + html.no-flexbox .tiny-vertical-space, + html.no-flexboxlegacy .tiny-vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + html.no-flexbox .vertical-padding, + html.no-flexboxlegacy .vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + html.no-flexbox .tiny-vertical-padding, + html.no-flexboxlegacy .tiny-vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + html.no-flexbox .double-vertical-space, + html.no-flexboxlegacy .double-vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + html.no-flexbox .tiny-double-vertical-space, + html.no-flexboxlegacy .tiny-double-vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + html.no-flexbox .double-vertical-padding, + html.no-flexboxlegacy .double-vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + html.no-flexbox .tiny-double-vertical-padding, + html.no-flexboxlegacy .tiny-double-vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + html.no-flexbox .half-vertical-space, + html.no-flexboxlegacy .half-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + html.no-flexbox .tiny-half-vertical-space, + html.no-flexboxlegacy .tiny-half-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + html.no-flexbox .half-vertical-padding, + html.no-flexboxlegacy .half-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + html.no-flexbox .tiny-half-vertical-padding, + html.no-flexboxlegacy .tiny-half-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + html.no-flexbox .quarter-vertical-space, + html.no-flexboxlegacy .quarter-vertical-space { + margin-top: 0.25em; + margin-bottom: 0.25em; + } + html.no-flexbox .tiny-quarter-vertical-space, + html.no-flexboxlegacy .tiny-quarter-vertical-space { + margin-top: 0.25em; + margin-bottom: 0.25em; + } + html.no-flexbox .quarter-vertical-padding, + html.no-flexboxlegacy .quarter-vertical-padding { + padding-top: 0.25em; + padding-bottom: 0.25em; + } + html.no-flexbox .tiny-quarter-vertical-padding, + html.no-flexboxlegacy .tiny-quarter-vertical-padding { + padding-top: 0.25em; + padding-bottom: 0.25em; + } + html.no-flexbox .horizontal-space, + html.no-flexboxlegacy .horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + html.no-flexbox .tiny-horizontal-space, + html.no-flexboxlegacy .tiny-horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + html.no-flexbox .horizontal-padding, + html.no-flexboxlegacy .horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + html.no-flexbox .tiny-horizontal-padding, + html.no-flexboxlegacy .tiny-horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + html.no-flexbox .double-horizontal-space, + html.no-flexboxlegacy .double-horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + html.no-flexbox .tiny-double-horizontal-space, + html.no-flexboxlegacy .tiny-double-horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + html.no-flexbox .double-horizontal-padding, + html.no-flexboxlegacy .double-horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + html.no-flexbox .tiny-double-horizontal-padding, + html.no-flexboxlegacy .tiny-double-horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + html.no-flexbox .half-horizontal-space, + html.no-flexboxlegacy .half-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + html.no-flexbox .tiny-half-horizontal-space, + html.no-flexboxlegacy .tiny-half-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + html.no-flexbox .half-horizontal-padding, + html.no-flexboxlegacy .half-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + html.no-flexbox .tiny-half-horizontal-padding, + html.no-flexboxlegacy .tiny-half-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + html.no-flexbox .quarter-horizontal-space, + html.no-flexboxlegacy .quarter-horizontal-space { + margin-left: 0.25em; + margin-right: 0.25em; + } + html.no-flexbox .tiny-quarter-horizontal-space, + html.no-flexboxlegacy .tiny-quarter-horizontal-space { + margin-left: 0.25em; + margin-right: 0.25em; + } + html.no-flexbox .quarter-horizontal-padding, + html.no-flexboxlegacy .quarter-horizontal-padding { + padding-left: 0.25em; + padding-right: 0.25em; + } + html.no-flexbox .tiny-quarter-horizontal-padding, + html.no-flexboxlegacy .tiny-quarter-horizontal-padding { + padding-left: 0.25em; + padding-right: 0.25em; + } + html.no-flexbox .top-space, + html.no-flexboxlegacy .top-space { + margin-top: 1em; + } + html.no-flexbox .tiny-top-space, + html.no-flexboxlegacy .tiny-top-space { + margin-top: 1em; + } + html.no-flexbox .top-padding, + html.no-flexboxlegacy .top-padding { + padding-top: 1em; + } + html.no-flexbox .tiny-top-padding, + html.no-flexboxlegacy .tiny-top-padding { + padding-top: 1em; + } + html.no-flexbox .double-top-space, + html.no-flexboxlegacy .double-top-space { + margin-top: 2em; + } + html.no-flexbox .tiny-double-top-space, + html.no-flexboxlegacy .tiny-double-top-space { + margin-top: 2em; + } + html.no-flexbox .double-top-padding, + html.no-flexboxlegacy .double-top-padding { + padding-top: 2em; + } + html.no-flexbox .tiny-double-top-padding, + html.no-flexboxlegacy .tiny-double-top-padding { + padding-top: 2em; + } + html.no-flexbox .half-top-space, + html.no-flexboxlegacy .half-top-space { + margin-top: 0.5em; + } + html.no-flexbox .tiny-half-top-space, + html.no-flexboxlegacy .tiny-half-top-space { + margin-top: 0.5em; + } + html.no-flexbox .half-top-padding, + html.no-flexboxlegacy .half-top-padding { + padding-top: 0.5em; + } + html.no-flexbox .tiny-half-top-padding, + html.no-flexboxlegacy .tiny-half-top-padding { + padding-top: 0.5em; + } + html.no-flexbox .quarter-top-space, + html.no-flexboxlegacy .quarter-top-space { + margin-top: 0.25em; + } + html.no-flexbox .tiny-quarter-top-space, + html.no-flexboxlegacy .tiny-quarter-top-space { + margin-top: 0.25em; + } + html.no-flexbox .quarter-top-padding, + html.no-flexboxlegacy .quarter-top-padding { + padding-top: 0.25em; + } + html.no-flexbox .tiny-quarter-top-padding, + html.no-flexboxlegacy .tiny-quarter-top-padding { + padding-top: 0.25em; + } + html.no-flexbox .right-space, + html.no-flexboxlegacy .right-space { + margin-right: 1em; + } + html.no-flexbox .tiny-right-space, + html.no-flexboxlegacy .tiny-right-space { + margin-right: 1em; + } + html.no-flexbox .right-padding, + html.no-flexboxlegacy .right-padding { + padding-right: 1em; + } + html.no-flexbox .tiny-right-padding, + html.no-flexboxlegacy .tiny-right-padding { + padding-right: 1em; + } + html.no-flexbox .double-right-space, + html.no-flexboxlegacy .double-right-space { + margin-right: 2em; + } + html.no-flexbox .tiny-double-right-space, + html.no-flexboxlegacy .tiny-double-right-space { + margin-right: 2em; + } + html.no-flexbox .double-right-padding, + html.no-flexboxlegacy .double-right-padding { + padding-right: 2em; + } + html.no-flexbox .tiny-double-right-padding, + html.no-flexboxlegacy .tiny-double-right-padding { + padding-right: 2em; + } + html.no-flexbox .half-right-space, + html.no-flexboxlegacy .half-right-space { + margin-right: 0.5em; + } + html.no-flexbox .tiny-half-right-space, + html.no-flexboxlegacy .tiny-half-right-space { + margin-right: 0.5em; + } + html.no-flexbox .half-right-padding, + html.no-flexboxlegacy .half-right-padding { + padding-right: 0.5em; + } + html.no-flexbox .tiny-half-right-padding, + html.no-flexboxlegacy .tiny-half-right-padding { + padding-right: 0.5em; + } + html.no-flexbox .quarter-right-space, + html.no-flexboxlegacy .quarter-right-space { + margin-right: 0.25em; + } + html.no-flexbox .tiny-quarter-right-space, + html.no-flexboxlegacy .tiny-quarter-right-space { + margin-right: 0.25em; + } + html.no-flexbox .quarter-right-padding, + html.no-flexboxlegacy .quarter-right-padding { + padding-right: 0.25em; + } + html.no-flexbox .tiny-quarter-right-padding, + html.no-flexboxlegacy .tiny-quarter-right-padding { + padding-right: 0.25em; + } + html.no-flexbox .bottom-space, + html.no-flexboxlegacy .bottom-space { + margin-bottom: 1em; + } + html.no-flexbox .tiny-bottom-space, + html.no-flexboxlegacy .tiny-bottom-space { + margin-bottom: 1em; + } + html.no-flexbox .bottom-padding, + html.no-flexboxlegacy .bottom-padding { + padding-bottom: 1em; + } + html.no-flexbox .tiny-bottom-padding, + html.no-flexboxlegacy .tiny-bottom-padding { + padding-bottom: 1em; + } + html.no-flexbox .double-bottom-space, + html.no-flexboxlegacy .double-bottom-space { + margin-bottom: 2em; + } + html.no-flexbox .tiny-double-bottom-space, + html.no-flexboxlegacy .tiny-double-bottom-space { + margin-bottom: 2em; + } + html.no-flexbox .double-bottom-padding, + html.no-flexboxlegacy .double-bottom-padding { + padding-bottom: 2em; + } + html.no-flexbox .tiny-double-bottom-padding, + html.no-flexboxlegacy .tiny-double-bottom-padding { + padding-bottom: 2em; + } + html.no-flexbox .half-bottom-space, + html.no-flexboxlegacy .half-bottom-space { + margin-bottom: 0.5em; + } + html.no-flexbox .tiny-half-bottom-space, + html.no-flexboxlegacy .tiny-half-bottom-space { + margin-bottom: 0.5em; + } + html.no-flexbox .half-bottom-padding, + html.no-flexboxlegacy .half-bottom-padding { + padding-bottom: 0.5em; + } + html.no-flexbox .tiny-half-bottom-padding, + html.no-flexboxlegacy .tiny-half-bottom-padding { + padding-bottom: 0.5em; + } + html.no-flexbox .quarter-bottom-space, + html.no-flexboxlegacy .quarter-bottom-space { + margin-bottom: 0.25em; + } + html.no-flexbox .tiny-quarter-bottom-space, + html.no-flexboxlegacy .tiny-quarter-bottom-space { + margin-bottom: 0.25em; + } + html.no-flexbox .quarter-bottom-padding, + html.no-flexboxlegacy .quarter-bottom-padding { + padding-bottom: 0.25em; + } + html.no-flexbox .tiny-quarter-bottom-padding, + html.no-flexboxlegacy .tiny-quarter-bottom-padding { + padding-bottom: 0.25em; + } + html.no-flexbox .left-space, + html.no-flexboxlegacy .left-space { + margin-left: 1em; + } + html.no-flexbox .tiny-left-space, + html.no-flexboxlegacy .tiny-left-space { + margin-left: 1em; + } + html.no-flexbox .left-padding, + html.no-flexboxlegacy .left-padding { + padding-left: 1em; + } + html.no-flexbox .tiny-left-padding, + html.no-flexboxlegacy .tiny-left-padding { + padding-left: 1em; + } + html.no-flexbox .double-left-space, + html.no-flexboxlegacy .double-left-space { + margin-left: 2em; + } + html.no-flexbox .tiny-double-left-space, + html.no-flexboxlegacy .tiny-double-left-space { + margin-left: 2em; + } + html.no-flexbox .double-left-padding, + html.no-flexboxlegacy .double-left-padding { + padding-left: 2em; + } + html.no-flexbox .tiny-double-left-padding, + html.no-flexboxlegacy .tiny-double-left-padding { + padding-left: 2em; + } + html.no-flexbox .half-left-space, + html.no-flexboxlegacy .half-left-space { + margin-left: 0.5em; + } + html.no-flexbox .tiny-half-left-space, + html.no-flexboxlegacy .tiny-half-left-space { + margin-left: 0.5em; + } + html.no-flexbox .half-left-padding, + html.no-flexboxlegacy .half-left-padding { + padding-left: 0.5em; + } + html.no-flexbox .tiny-half-left-padding, + html.no-flexboxlegacy .tiny-half-left-padding { + padding-left: 0.5em; + } + html.no-flexbox .quarter-left-space, + html.no-flexboxlegacy .quarter-left-space { + margin-left: 0.25em; + } + html.no-flexbox .tiny-quarter-left-space, + html.no-flexboxlegacy .tiny-quarter-left-space { + margin-left: 0.25em; + } + html.no-flexbox .quarter-left-padding, + html.no-flexboxlegacy .quarter-left-padding { + padding-left: 0.25em; + } + html.no-flexbox .tiny-quarter-left-padding, + html.no-flexboxlegacy .tiny-quarter-left-padding { + padding-left: 0.25em; + } + html.no-flexbox .hide-tiny, + html.no-flexboxlegacy .hide-tiny { + display: none !important; + } + html.no-flexbox .show-tiny, + html.no-flexboxlegacy .show-tiny { + display: inherit !important; + } + html.no-flexbox table.show-tiny, + html.no-flexboxlegacy table.show-tiny { + display: table; + } + html.no-flexbox thead.show-tiny, + html.no-flexboxlegacy thead.show-tiny { + display: table-header-group; + } + html.no-flexbox tbody.show-tiny, + html.no-flexboxlegacy tbody.show-tiny { + display: table-row-group; + } + html.no-flexbox tfoot.show-tiny, + html.no-flexboxlegacy tfoot.show-tiny { + display: table-footer-group; + } + html.no-flexbox tr.show-tiny, + html.no-flexboxlegacy tr.show-tiny { + display: table-row; + } + html.no-flexbox th.show-tiny, + html.no-flexbox td.show-tiny, + html.no-flexboxlegacy th.show-tiny, + html.no-flexboxlegacy td.show-tiny { + display: table-cell; + } +} +html.no-flexbox:after, +html.no-flexboxlegacy:after { + content: '[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]'; + display: none; +} +html.no-flexbox .ink-carousel, +html.no-flexboxlegacy .ink-carousel { + width: 100%; + position: relative; + overflow: hidden; + display: block; +} +html.no-flexbox .ink-carousel .stage, +html.no-flexboxlegacy .ink-carousel .stage { + left: 0; + height: auto !important; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + list-style-type: none; + white-space: nowrap; + position: relative; + -webkit-transition: all 0.5s ease; + -moz-transition: all 0.5s ease; + -o-transition: all 0.5s ease; + transition: all 0.5s ease; +} +html.no-flexbox .ink-carousel .stage .slide, +html.no-flexboxlegacy .ink-carousel .stage .slide { + position: relative; + display: inline-block; + vertical-align: top; + white-space: normal; + margin: 0; + float: none; + zoom: 1; + *display: inline; +} +html.no-flexbox .ink-carousel .ink-navigation, +html.no-flexboxlegacy .ink-carousel .ink-navigation { + position: static; +} diff --git a/public/css/ink-legacy.min.css b/public/css/ink-legacy.min.css new file mode 100644 index 0000000..798ff98 --- /dev/null +++ b/public/css/ink-legacy.min.css @@ -0,0 +1 @@ +.show-all{display:inherit}.hide-all{display:none!important}.no-margin{margin:0!important}.no-padding{padding:0!important}.push-left{float:left}.push-center{float:none!important;margin-left:auto;margin-right:auto}.push-right{float:right;-webkit-justify-content:flex-end;-moz-justify-content:flex-end;justify-content:flex-end}.align-left{text-align:left}.align-center{text-align:center}.align-right{text-align:right}.clearfix{overflow:hidden;*zoom:1}.clearfix:after{content:"";display:table;clear:both}html.no-flexbox,html.no-flexboxlegacy{font-size:.97em}html.no-flexbox .ink-grid,html.no-flexboxlegacy .ink-grid{width:auto;max-width:1440px;margin:0 auto}html.no-flexbox .all-5,html.no-flexboxlegacy .all-5{width:5%;float:left;clear:none}html.no-flexbox .all-10,html.no-flexboxlegacy .all-10{width:10%;float:left;clear:none}html.no-flexbox .all-15,html.no-flexboxlegacy .all-15{width:15%;float:left;clear:none}html.no-flexbox .all-16,html.no-flexboxlegacy .all-16{width:16.66%;float:left;clear:none}html.no-flexbox .all-20,html.no-flexboxlegacy .all-20{width:20%;float:left;clear:none}html.no-flexbox .all-25,html.no-flexboxlegacy .all-25{width:25%;float:left;clear:none}html.no-flexbox .all-30,html.no-flexboxlegacy .all-30{width:30%;float:left;clear:none}html.no-flexbox .all-33,html.no-flexboxlegacy .all-33{width:33.33%;float:left;clear:none}html.no-flexbox .all-35,html.no-flexboxlegacy .all-35{width:35%;float:left;clear:none}html.no-flexbox .all-40,html.no-flexboxlegacy .all-40{width:40%;float:left;clear:none}html.no-flexbox .all-45,html.no-flexboxlegacy .all-45{width:45%;float:left;clear:none}html.no-flexbox .all-50,html.no-flexboxlegacy .all-50{width:50%;float:left;clear:none}html.no-flexbox .all-55,html.no-flexboxlegacy .all-55{width:55%;float:left;clear:none}html.no-flexbox .all-60,html.no-flexboxlegacy .all-60{width:60%;float:left;clear:none}html.no-flexbox .all-65,html.no-flexboxlegacy .all-65{width:65%;float:left;clear:none}html.no-flexbox .all-66,html.no-flexboxlegacy .all-66{width:66.66%;float:left;clear:none}html.no-flexbox .all-70,html.no-flexboxlegacy .all-70{width:70%;float:left;clear:none}html.no-flexbox .all-75,html.no-flexboxlegacy .all-75{width:75%;float:left;clear:none}html.no-flexbox .all-80,html.no-flexboxlegacy .all-80{width:80%;float:left;clear:none}html.no-flexbox .all-85,html.no-flexboxlegacy .all-85{width:85%;float:left;clear:none}html.no-flexbox .all-90,html.no-flexboxlegacy .all-90{width:90%;float:left;clear:none}html.no-flexbox .all-95,html.no-flexboxlegacy .all-95{width:95%;float:left;clear:none}html.no-flexbox .all-100,html.no-flexboxlegacy .all-100{width:100%;float:left;clear:none}html.no-flexbox [class~=all-100],html.no-flexboxlegacy [class~=all-100]{float:none;clear:both}@media screen and (min-width:1261px){html.no-flexbox .ink-grid,html.no-flexboxlegacy .ink-grid{padding:0 2em}html.no-flexbox .column-group>[class*=xlarge-],html.no-flexboxlegacy .column-group>[class*=xlarge-]{float:left;clear:none}html.no-flexbox .xlarge-5,html.no-flexboxlegacy .xlarge-5{width:5%}html.no-flexbox .xlarge-10,html.no-flexboxlegacy .xlarge-10{width:10%}html.no-flexbox .xlarge-15,html.no-flexboxlegacy .xlarge-15{width:15%}html.no-flexbox .xlarge-16,html.no-flexboxlegacy .xlarge-16{width:16.66%}html.no-flexbox .xlarge-20,html.no-flexboxlegacy .xlarge-20{width:20%}html.no-flexbox .xlarge-25,html.no-flexboxlegacy .xlarge-25{width:25%}html.no-flexbox .xlarge-30,html.no-flexboxlegacy .xlarge-30{width:30%}html.no-flexbox .xlarge-33,html.no-flexboxlegacy .xlarge-33{width:33.33%}html.no-flexbox .xlarge-35,html.no-flexboxlegacy .xlarge-35{width:35%}html.no-flexbox .xlarge-40,html.no-flexboxlegacy .xlarge-40{width:40%}html.no-flexbox .xlarge-45,html.no-flexboxlegacy .xlarge-45{width:45%}html.no-flexbox .xlarge-50,html.no-flexboxlegacy .xlarge-50{width:50%}html.no-flexbox .xlarge-55,html.no-flexboxlegacy .xlarge-55{width:55%}html.no-flexbox .xlarge-60,html.no-flexboxlegacy .xlarge-60{width:60%}html.no-flexbox .xlarge-65,html.no-flexboxlegacy .xlarge-65{width:65%}html.no-flexbox .xlarge-66,html.no-flexboxlegacy .xlarge-66{width:66.66%}html.no-flexbox .xlarge-70,html.no-flexboxlegacy .xlarge-70{width:70%}html.no-flexbox .xlarge-75,html.no-flexboxlegacy .xlarge-75{width:75%}html.no-flexbox .xlarge-80,html.no-flexboxlegacy .xlarge-80{width:80%}html.no-flexbox .xlarge-85,html.no-flexboxlegacy .xlarge-85{width:85%}html.no-flexbox .xlarge-90,html.no-flexboxlegacy .xlarge-90{width:90%}html.no-flexbox .xlarge-95,html.no-flexboxlegacy .xlarge-95{width:95%}html.no-flexbox .xlarge-100,html.no-flexboxlegacy .xlarge-100{width:100%}html.no-flexbox [class*=xlarge-100],html.no-flexboxlegacy [class*=xlarge-100]{float:none;clear:both}html.no-flexbox .column-group,html.no-flexboxlegacy .column-group{*zoom:1}html.no-flexbox .column-group:after,html.no-flexboxlegacy .column-group:after{content:"";display:table;clear:both}html.no-flexbox .column-group.gutters,html.no-flexboxlegacy .column-group.gutters{margin-left:-2em}html.no-flexbox .column-group.gutters>[class*=all-],html.no-flexbox .column-group.gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.gutters>[class*=all-],html.no-flexboxlegacy .column-group.gutters>[class*=xlarge-]{padding-left:2em;margin-bottom:2em}html.no-flexbox .column-group.horizontal-gutters,html.no-flexboxlegacy .column-group.horizontal-gutters{margin-left:-2em}html.no-flexbox .column-group.horizontal-gutters>[class*=all-],html.no-flexbox .column-group.horizontal-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.horizontal-gutters>[class*=xlarge-]{padding-left:2em}html.no-flexbox .column-group.vertical-gutters>[class*=all-],html.no-flexbox .column-group.vertical-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.vertical-gutters>[class*=xlarge-]{margin-bottom:2em}html.no-flexbox .column-group.double-gutters,html.no-flexboxlegacy .column-group.double-gutters{margin-left:-4em}html.no-flexbox .column-group.double-gutters>[class*=all-],html.no-flexbox .column-group.double-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.double-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-gutters>[class*=xlarge-]{padding-left:4em;margin-bottom:4em}html.no-flexbox .column-group.double-horizontal-gutters,html.no-flexboxlegacy .column-group.double-horizontal-gutters{margin-left:-4em}html.no-flexbox .column-group.double-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.double-horizontal-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.double-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-horizontal-gutters>[class*=xlarge-]{padding-left:4em}html.no-flexbox .column-group.double-vertical-gutters>[class*=all-],html.no-flexbox .column-group.double-vertical-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.double-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-vertical-gutters>[class*=xlarge-]{margin-bottom:4em}html.no-flexbox .column-group.half-gutters,html.no-flexboxlegacy .column-group.half-gutters{margin-left:-1em}html.no-flexbox .column-group.half-gutters>[class*=all-],html.no-flexbox .column-group.half-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.half-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-gutters>[class*=xlarge-]{padding-left:1em;margin-bottom:1em}html.no-flexbox .column-group.half-horizontal-gutters,html.no-flexboxlegacy .column-group.half-horizontal-gutters{margin-left:-1em}html.no-flexbox .column-group.half-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.half-horizontal-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.half-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-horizontal-gutters>[class*=xlarge-]{padding-left:1em}html.no-flexbox .column-group.half-vertical-gutters>[class*=all-],html.no-flexbox .column-group.half-vertical-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.half-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-vertical-gutters>[class*=xlarge-]{margin-bottom:1em}html.no-flexbox .column-group.quarter-gutters,html.no-flexboxlegacy .column-group.quarter-gutters{margin-left:-.5em}html.no-flexbox .column-group.quarter-gutters>[class*=all-],html.no-flexbox .column-group.quarter-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.quarter-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-gutters>[class*=xlarge-]{padding-left:.5em;margin-bottom:.5em}html.no-flexbox .column-group.quarter-horizontal-gutters,html.no-flexboxlegacy .column-group.quarter-horizontal-gutters{margin-left:-.5em}html.no-flexbox .column-group.quarter-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.quarter-horizontal-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.quarter-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-horizontal-gutters>[class*=xlarge-]{padding-left:.5em}html.no-flexbox .column-group.quarter-vertical-gutters>[class*=all-],html.no-flexbox .column-group.quarter-vertical-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.quarter-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-vertical-gutters>[class*=xlarge-]{margin-bottom:.5em}html.no-flexbox .column-group.xlarge-gutters,html.no-flexboxlegacy .column-group.xlarge-gutters{margin-left:-2em}html.no-flexbox .column-group.xlarge-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-gutters>[class*=xlarge-]{padding-left:2em;margin-bottom:2em}html.no-flexbox .column-group.xlarge-horizontal-gutters,html.no-flexboxlegacy .column-group.xlarge-horizontal-gutters{margin-left:-2em}html.no-flexbox .column-group.xlarge-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-horizontal-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-horizontal-gutters>[class*=xlarge-]{padding-left:2em}html.no-flexbox .column-group.xlarge-vertical-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-vertical-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-vertical-gutters>[class*=xlarge-]{margin-bottom:2em}html.no-flexbox .column-group.xlarge-double-gutters,html.no-flexboxlegacy .column-group.xlarge-double-gutters{margin-left:-4em}html.no-flexbox .column-group.xlarge-double-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-double-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-double-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-double-gutters>[class*=xlarge-]{padding-left:4em;margin-bottom:4em}html.no-flexbox .column-group.xlarge-double-horizontal-gutters,html.no-flexboxlegacy .column-group.xlarge-double-horizontal-gutters{margin-left:-4em}html.no-flexbox .column-group.xlarge-double-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-double-horizontal-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-double-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-double-horizontal-gutters>[class*=xlarge-]{padding-left:4em}html.no-flexbox .column-group.xlarge-double-vertical-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-double-vertical-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-double-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-double-vertical-gutters>[class*=xlarge-]{margin-bottom:4em}html.no-flexbox .column-group.xlarge-half-gutters,html.no-flexboxlegacy .column-group.xlarge-half-gutters{margin-left:-1em}html.no-flexbox .column-group.xlarge-half-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-half-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-half-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-half-gutters>[class*=xlarge-]{padding-left:1em;margin-bottom:1em}html.no-flexbox .column-group.xlarge-half-horizontal-gutters,html.no-flexboxlegacy .column-group.xlarge-half-horizontal-gutters{margin-left:-1em}html.no-flexbox .column-group.xlarge-half-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-half-horizontal-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-half-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-half-horizontal-gutters>[class*=xlarge-]{padding-left:1em}html.no-flexbox .column-group.xlarge-half-vertical-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-half-vertical-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-half-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-half-vertical-gutters>[class*=xlarge-]{margin-bottom:1em}html.no-flexbox .column-group.xlarge-quarter-gutters,html.no-flexboxlegacy .column-group.xlarge-quarter-gutters{margin-left:-.5em}html.no-flexbox .column-group.xlarge-quarter-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-quarter-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-quarter-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-quarter-gutters>[class*=xlarge-]{padding-left:.5em;margin-bottom:.5em}html.no-flexbox .column-group.xlarge-quarter-horizontal-gutters,html.no-flexboxlegacy .column-group.xlarge-quarter-horizontal-gutters{margin-left:-.5em}html.no-flexbox .column-group.xlarge-quarter-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-quarter-horizontal-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-quarter-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-quarter-horizontal-gutters>[class*=xlarge-]{padding-left:.5em}html.no-flexbox .column-group.xlarge-quarter-vertical-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-quarter-vertical-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-quarter-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-quarter-vertical-gutters>[class*=xlarge-]{margin-bottom:.5em}html.no-flexbox .column-group.xlarge-no-gutters,html.no-flexboxlegacy .column-group.xlarge-no-gutters{margin-left:0}html.no-flexbox .column-group.xlarge-no-gutters>[class*=all-],html.no-flexbox .column-group.xlarge-no-gutters>[class*=xlarge-],html.no-flexboxlegacy .column-group.xlarge-no-gutters>[class*=all-],html.no-flexboxlegacy .column-group.xlarge-no-gutters>[class*=xlarge-]{padding-left:0;margin-bottom:0}html.no-flexbox .ink-table tbody[class*=xlarge-],html.no-flexbox .ink-table td[class*=xlarge-],html.no-flexbox .ink-table tfoot[class*=xlarge-],html.no-flexbox .ink-table th[class*=xlarge-],html.no-flexbox .ink-table thead[class*=xlarge-],html.no-flexbox .ink-table tr[class*=xlarge-],html.no-flexboxlegacy .ink-table tbody[class*=xlarge-],html.no-flexboxlegacy .ink-table td[class*=xlarge-],html.no-flexboxlegacy .ink-table tfoot[class*=xlarge-],html.no-flexboxlegacy .ink-table th[class*=xlarge-],html.no-flexboxlegacy .ink-table thead[class*=xlarge-],html.no-flexboxlegacy .ink-table tr[class*=xlarge-]{float:none}html.no-flexbox .xlarge-push-left,html.no-flexboxlegacy .xlarge-push-left{float:left}html.no-flexbox .xlarge-push-center,html.no-flexboxlegacy .xlarge-push-center{float:none;margin-left:auto;margin-right:auto}html.no-flexbox .xlarge-push-right,html.no-flexboxlegacy .xlarge-push-right{float:right}html.no-flexbox .xlarge-align-left,html.no-flexboxlegacy .xlarge-align-left{text-align:left}html.no-flexbox .xlarge-align-center,html.no-flexboxlegacy .xlarge-align-center{text-align:center}html.no-flexbox .xlarge-align-right,html.no-flexboxlegacy .xlarge-align-right{text-align:right}html.no-flexbox .xlarge-no-margin,html.no-flexboxlegacy .xlarge-no-margin{margin:0!important}html.no-flexbox .space,html.no-flexbox .xlarge-space,html.no-flexboxlegacy .space,html.no-flexboxlegacy .xlarge-space{margin:2em}html.no-flexbox .padding,html.no-flexbox .xlarge-padding,html.no-flexboxlegacy .padding,html.no-flexboxlegacy .xlarge-padding{padding:2em}html.no-flexbox .double-space,html.no-flexbox .xlarge-double-space,html.no-flexboxlegacy .double-space,html.no-flexboxlegacy .xlarge-double-space{margin:4em}html.no-flexbox .double-padding,html.no-flexbox .xlarge-double-padding,html.no-flexboxlegacy .double-padding,html.no-flexboxlegacy .xlarge-double-padding{padding:4em}html.no-flexbox .half-space,html.no-flexbox .xlarge-half-space,html.no-flexboxlegacy .half-space,html.no-flexboxlegacy .xlarge-half-space{margin:1em}html.no-flexbox .half-padding,html.no-flexbox .xlarge-half-padding,html.no-flexboxlegacy .half-padding,html.no-flexboxlegacy .xlarge-half-padding{padding:1em}html.no-flexbox .quarter-space,html.no-flexbox .xlarge-quarter-space,html.no-flexboxlegacy .quarter-space,html.no-flexboxlegacy .xlarge-quarter-space{margin:.5em}html.no-flexbox .quarter-padding,html.no-flexbox .xlarge-quarter-padding,html.no-flexboxlegacy .quarter-padding,html.no-flexboxlegacy .xlarge-quarter-padding{padding:.5em}html.no-flexbox .vertical-space,html.no-flexbox .xlarge-vertical-space,html.no-flexboxlegacy .vertical-space,html.no-flexboxlegacy .xlarge-vertical-space{margin-top:2em;margin-bottom:2em}html.no-flexbox .vertical-padding,html.no-flexbox .xlarge-vertical-padding,html.no-flexboxlegacy .vertical-padding,html.no-flexboxlegacy .xlarge-vertical-padding{padding-top:2em;padding-bottom:2em}html.no-flexbox .double-vertical-space,html.no-flexbox .xlarge-double-vertical-space,html.no-flexboxlegacy .double-vertical-space,html.no-flexboxlegacy .xlarge-double-vertical-space{margin-top:4em;margin-bottom:4em}html.no-flexbox .double-vertical-padding,html.no-flexbox .xlarge-double-vertical-padding,html.no-flexboxlegacy .double-vertical-padding,html.no-flexboxlegacy .xlarge-double-vertical-padding{padding-top:4em;padding-bottom:4em}html.no-flexbox .half-vertical-space,html.no-flexbox .xlarge-half-vertical-space,html.no-flexboxlegacy .half-vertical-space,html.no-flexboxlegacy .xlarge-half-vertical-space{margin-top:1em;margin-bottom:1em}html.no-flexbox .half-vertical-padding,html.no-flexbox .xlarge-half-vertical-padding,html.no-flexboxlegacy .half-vertical-padding,html.no-flexboxlegacy .xlarge-half-vertical-padding{padding-top:1em;padding-bottom:1em}html.no-flexbox .quarter-vertical-space,html.no-flexbox .xlarge-quarter-vertical-space,html.no-flexboxlegacy .quarter-vertical-space,html.no-flexboxlegacy .xlarge-quarter-vertical-space{margin-top:.5em;margin-bottom:.5em}html.no-flexbox .quarter-vertical-padding,html.no-flexbox .xlarge-quarter-vertical-padding,html.no-flexboxlegacy .quarter-vertical-padding,html.no-flexboxlegacy .xlarge-quarter-vertical-padding{padding-top:.5em;padding-bottom:.5em}html.no-flexbox .horizontal-space,html.no-flexbox .xlarge-horizontal-space,html.no-flexboxlegacy .horizontal-space,html.no-flexboxlegacy .xlarge-horizontal-space{margin-left:2em;margin-right:2em}html.no-flexbox .horizontal-padding,html.no-flexbox .xlarge-horizontal-padding,html.no-flexboxlegacy .horizontal-padding,html.no-flexboxlegacy .xlarge-horizontal-padding{padding-left:2em;padding-right:2em}html.no-flexbox .double-horizontal-space,html.no-flexbox .xlarge-double-horizontal-space,html.no-flexboxlegacy .double-horizontal-space,html.no-flexboxlegacy .xlarge-double-horizontal-space{margin-left:4em;margin-right:4em}html.no-flexbox .double-horizontal-padding,html.no-flexbox .xlarge-double-horizontal-padding,html.no-flexboxlegacy .double-horizontal-padding,html.no-flexboxlegacy .xlarge-double-horizontal-padding{padding-left:4em;padding-right:4em}html.no-flexbox .half-horizontal-space,html.no-flexbox .xlarge-half-horizontal-space,html.no-flexboxlegacy .half-horizontal-space,html.no-flexboxlegacy .xlarge-half-horizontal-space{margin-left:1em;margin-right:1em}html.no-flexbox .half-horizontal-padding,html.no-flexbox .xlarge-half-horizontal-padding,html.no-flexboxlegacy .half-horizontal-padding,html.no-flexboxlegacy .xlarge-half-horizontal-padding{padding-left:1em;padding-right:1em}html.no-flexbox .quarter-horizontal-space,html.no-flexbox .xlarge-quarter-horizontal-space,html.no-flexboxlegacy .quarter-horizontal-space,html.no-flexboxlegacy .xlarge-quarter-horizontal-space{margin-left:.5em;margin-right:.5em}html.no-flexbox .quarter-horizontal-padding,html.no-flexbox .xlarge-quarter-horizontal-padding,html.no-flexboxlegacy .quarter-horizontal-padding,html.no-flexboxlegacy .xlarge-quarter-horizontal-padding{padding-left:.5em;padding-right:.5em}html.no-flexbox .top-space,html.no-flexbox .xlarge-top-space,html.no-flexboxlegacy .top-space,html.no-flexboxlegacy .xlarge-top-space{margin-top:2em}html.no-flexbox .top-padding,html.no-flexbox .xlarge-top-padding,html.no-flexboxlegacy .top-padding,html.no-flexboxlegacy .xlarge-top-padding{padding-top:2em}html.no-flexbox .double-top-space,html.no-flexbox .xlarge-double-top-space,html.no-flexboxlegacy .double-top-space,html.no-flexboxlegacy .xlarge-double-top-space{margin-top:4em}html.no-flexbox .double-top-padding,html.no-flexbox .xlarge-double-top-padding,html.no-flexboxlegacy .double-top-padding,html.no-flexboxlegacy .xlarge-double-top-padding{padding-top:4em}html.no-flexbox .half-top-space,html.no-flexbox .xlarge-half-top-space,html.no-flexboxlegacy .half-top-space,html.no-flexboxlegacy .xlarge-half-top-space{margin-top:1em}html.no-flexbox .half-top-padding,html.no-flexbox .xlarge-half-top-padding,html.no-flexboxlegacy .half-top-padding,html.no-flexboxlegacy .xlarge-half-top-padding{padding-top:1em}html.no-flexbox .quarter-top-space,html.no-flexbox .xlarge-quarter-top-space,html.no-flexboxlegacy .quarter-top-space,html.no-flexboxlegacy .xlarge-quarter-top-space{margin-top:.5em}html.no-flexbox .quarter-top-padding,html.no-flexbox .xlarge-quarter-top-padding,html.no-flexboxlegacy .quarter-top-padding,html.no-flexboxlegacy .xlarge-quarter-top-padding{padding-top:.5em}html.no-flexbox .right-space,html.no-flexbox .xlarge-right-space,html.no-flexboxlegacy .right-space,html.no-flexboxlegacy .xlarge-right-space{margin-right:2em}html.no-flexbox .right-padding,html.no-flexbox .xlarge-right-padding,html.no-flexboxlegacy .right-padding,html.no-flexboxlegacy .xlarge-right-padding{padding-right:2em}html.no-flexbox .double-right-space,html.no-flexbox .xlarge-double-right-space,html.no-flexboxlegacy .double-right-space,html.no-flexboxlegacy .xlarge-double-right-space{margin-right:4em}html.no-flexbox .double-right-padding,html.no-flexbox .xlarge-double-right-padding,html.no-flexboxlegacy .double-right-padding,html.no-flexboxlegacy .xlarge-double-right-padding{padding-right:4em}html.no-flexbox .half-right-space,html.no-flexbox .xlarge-half-right-space,html.no-flexboxlegacy .half-right-space,html.no-flexboxlegacy .xlarge-half-right-space{margin-right:1em}html.no-flexbox .half-right-padding,html.no-flexbox .xlarge-half-right-padding,html.no-flexboxlegacy .half-right-padding,html.no-flexboxlegacy .xlarge-half-right-padding{padding-right:1em}html.no-flexbox .quarter-right-space,html.no-flexbox .xlarge-quarter-right-space,html.no-flexboxlegacy .quarter-right-space,html.no-flexboxlegacy .xlarge-quarter-right-space{margin-right:.5em}html.no-flexbox .quarter-right-padding,html.no-flexbox .xlarge-quarter-right-padding,html.no-flexboxlegacy .quarter-right-padding,html.no-flexboxlegacy .xlarge-quarter-right-padding{padding-right:.5em}html.no-flexbox .bottom-space,html.no-flexbox .xlarge-bottom-space,html.no-flexboxlegacy .bottom-space,html.no-flexboxlegacy .xlarge-bottom-space{margin-bottom:2em}html.no-flexbox .bottom-padding,html.no-flexbox .xlarge-bottom-padding,html.no-flexboxlegacy .bottom-padding,html.no-flexboxlegacy .xlarge-bottom-padding{padding-bottom:2em}html.no-flexbox .double-bottom-space,html.no-flexbox .xlarge-double-bottom-space,html.no-flexboxlegacy .double-bottom-space,html.no-flexboxlegacy .xlarge-double-bottom-space{margin-bottom:4em}html.no-flexbox .double-bottom-padding,html.no-flexbox .xlarge-double-bottom-padding,html.no-flexboxlegacy .double-bottom-padding,html.no-flexboxlegacy .xlarge-double-bottom-padding{padding-bottom:4em}html.no-flexbox .half-bottom-space,html.no-flexbox .xlarge-half-bottom-space,html.no-flexboxlegacy .half-bottom-space,html.no-flexboxlegacy .xlarge-half-bottom-space{margin-bottom:1em}html.no-flexbox .half-bottom-padding,html.no-flexbox .xlarge-half-bottom-padding,html.no-flexboxlegacy .half-bottom-padding,html.no-flexboxlegacy .xlarge-half-bottom-padding{padding-bottom:1em}html.no-flexbox .quarter-bottom-space,html.no-flexbox .xlarge-quarter-bottom-space,html.no-flexboxlegacy .quarter-bottom-space,html.no-flexboxlegacy .xlarge-quarter-bottom-space{margin-bottom:.5em}html.no-flexbox .quarter-bottom-padding,html.no-flexbox .xlarge-quarter-bottom-padding,html.no-flexboxlegacy .quarter-bottom-padding,html.no-flexboxlegacy .xlarge-quarter-bottom-padding{padding-bottom:.5em}html.no-flexbox .left-space,html.no-flexbox .xlarge-left-space,html.no-flexboxlegacy .left-space,html.no-flexboxlegacy .xlarge-left-space{margin-left:2em}html.no-flexbox .left-padding,html.no-flexbox .xlarge-left-padding,html.no-flexboxlegacy .left-padding,html.no-flexboxlegacy .xlarge-left-padding{padding-left:2em}html.no-flexbox .double-left-space,html.no-flexbox .xlarge-double-left-space,html.no-flexboxlegacy .double-left-space,html.no-flexboxlegacy .xlarge-double-left-space{margin-left:4em}html.no-flexbox .double-left-padding,html.no-flexbox .xlarge-double-left-padding,html.no-flexboxlegacy .double-left-padding,html.no-flexboxlegacy .xlarge-double-left-padding{padding-left:4em}html.no-flexbox .half-left-space,html.no-flexbox .xlarge-half-left-space,html.no-flexboxlegacy .half-left-space,html.no-flexboxlegacy .xlarge-half-left-space{margin-left:1em}html.no-flexbox .half-left-padding,html.no-flexbox .xlarge-half-left-padding,html.no-flexboxlegacy .half-left-padding,html.no-flexboxlegacy .xlarge-half-left-padding{padding-left:1em}html.no-flexbox .quarter-left-space,html.no-flexbox .xlarge-quarter-left-space,html.no-flexboxlegacy .quarter-left-space,html.no-flexboxlegacy .xlarge-quarter-left-space{margin-left:.5em}html.no-flexbox .quarter-left-padding,html.no-flexbox .xlarge-quarter-left-padding,html.no-flexboxlegacy .quarter-left-padding,html.no-flexboxlegacy .xlarge-quarter-left-padding{padding-left:.5em}html.no-flexbox .hide-xlarge,html.no-flexboxlegacy .hide-xlarge{display:none!important}html.no-flexbox .show-xlarge,html.no-flexboxlegacy .show-xlarge{display:inherit!important}html.no-flexbox table.show-xlarge,html.no-flexboxlegacy table.show-xlarge{display:table}html.no-flexbox thead.show-xlarge,html.no-flexboxlegacy thead.show-xlarge{display:table-header-group}html.no-flexbox tbody.show-xlarge,html.no-flexboxlegacy tbody.show-xlarge{display:table-row-group}html.no-flexbox tfoot.show-xlarge,html.no-flexboxlegacy tfoot.show-xlarge{display:table-footer-group}html.no-flexbox tr.show-xlarge,html.no-flexboxlegacy tr.show-xlarge{display:table-row}html.no-flexbox td.show-xlarge,html.no-flexbox th.show-xlarge,html.no-flexboxlegacy td.show-xlarge,html.no-flexboxlegacy th.show-xlarge{display:table-cell}}@media screen and (min-width:961px) and (max-width:1260px){html.no-flexbox .ink-grid,html.no-flexboxlegacy .ink-grid{padding:0 1.75em}html.no-flexbox .column-group>[class*=large-],html.no-flexboxlegacy .column-group>[class*=large-]{float:left;clear:none}html.no-flexbox .large-5,html.no-flexboxlegacy .large-5{width:5%}html.no-flexbox .large-10,html.no-flexboxlegacy .large-10{width:10%}html.no-flexbox .large-15,html.no-flexboxlegacy .large-15{width:15%}html.no-flexbox .large-16,html.no-flexboxlegacy .large-16{width:16.66%}html.no-flexbox .large-20,html.no-flexboxlegacy .large-20{width:20%}html.no-flexbox .large-25,html.no-flexboxlegacy .large-25{width:25%}html.no-flexbox .large-30,html.no-flexboxlegacy .large-30{width:30%}html.no-flexbox .large-33,html.no-flexboxlegacy .large-33{width:33.33%}html.no-flexbox .large-35,html.no-flexboxlegacy .large-35{width:35%}html.no-flexbox .large-40,html.no-flexboxlegacy .large-40{width:40%}html.no-flexbox .large-45,html.no-flexboxlegacy .large-45{width:45%}html.no-flexbox .large-50,html.no-flexboxlegacy .large-50{width:50%}html.no-flexbox .large-55,html.no-flexboxlegacy .large-55{width:55%}html.no-flexbox .large-60,html.no-flexboxlegacy .large-60{width:60%}html.no-flexbox .large-65,html.no-flexboxlegacy .large-65{width:65%}html.no-flexbox .large-66,html.no-flexboxlegacy .large-66{width:66.66%}html.no-flexbox .large-70,html.no-flexboxlegacy .large-70{width:70%}html.no-flexbox .large-75,html.no-flexboxlegacy .large-75{width:75%}html.no-flexbox .large-80,html.no-flexboxlegacy .large-80{width:80%}html.no-flexbox .large-85,html.no-flexboxlegacy .large-85{width:85%}html.no-flexbox .large-90,html.no-flexboxlegacy .large-90{width:90%}html.no-flexbox .large-95,html.no-flexboxlegacy .large-95{width:95%}html.no-flexbox .large-100,html.no-flexboxlegacy .large-100{width:100%}html.no-flexbox [class*=large-100],html.no-flexboxlegacy [class*=large-100]{float:none;clear:both}html.no-flexbox .column-group,html.no-flexboxlegacy .column-group{*zoom:1}html.no-flexbox .column-group:after,html.no-flexboxlegacy .column-group:after{content:"";display:table;clear:both}html.no-flexbox .column-group.gutters,html.no-flexboxlegacy .column-group.gutters{margin-left:-1.75em}html.no-flexbox .column-group.gutters>[class*=all-],html.no-flexbox .column-group.gutters>[class*=large-],html.no-flexboxlegacy .column-group.gutters>[class*=all-],html.no-flexboxlegacy .column-group.gutters>[class*=large-]{padding-left:1.75em;margin-bottom:1.75em}html.no-flexbox .column-group.horizontal-gutters,html.no-flexboxlegacy .column-group.horizontal-gutters{margin-left:-1.75em}html.no-flexbox .column-group.horizontal-gutters>[class*=all-],html.no-flexbox .column-group.horizontal-gutters>[class*=large-],html.no-flexboxlegacy .column-group.horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.horizontal-gutters>[class*=large-]{padding-left:1.75em}html.no-flexbox .column-group.vertical-gutters>[class*=all-],html.no-flexbox .column-group.vertical-gutters>[class*=large-],html.no-flexboxlegacy .column-group.vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.vertical-gutters>[class*=large-]{margin-bottom:1.75em}html.no-flexbox .column-group.double-gutters,html.no-flexboxlegacy .column-group.double-gutters{margin-left:-3.5em}html.no-flexbox .column-group.double-gutters>[class*=all-],html.no-flexbox .column-group.double-gutters>[class*=large-],html.no-flexboxlegacy .column-group.double-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-gutters>[class*=large-]{padding-left:3.5em;margin-bottom:3.5em}html.no-flexbox .column-group.double-horizontal-gutters,html.no-flexboxlegacy .column-group.double-horizontal-gutters{margin-left:-3.5em}html.no-flexbox .column-group.double-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.double-horizontal-gutters>[class*=large-],html.no-flexboxlegacy .column-group.double-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-horizontal-gutters>[class*=large-]{padding-left:3.5em}html.no-flexbox .column-group.double-vertical-gutters>[class*=all-],html.no-flexbox .column-group.double-vertical-gutters>[class*=large-],html.no-flexboxlegacy .column-group.double-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-vertical-gutters>[class*=large-]{margin-bottom:3.5em}html.no-flexbox .column-group.half-gutters,html.no-flexboxlegacy .column-group.half-gutters{margin-left:-.875em}html.no-flexbox .column-group.half-gutters>[class*=all-],html.no-flexbox .column-group.half-gutters>[class*=large-],html.no-flexboxlegacy .column-group.half-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-gutters>[class*=large-]{padding-left:.875em;margin-bottom:.875em}html.no-flexbox .column-group.half-horizontal-gutters,html.no-flexboxlegacy .column-group.half-horizontal-gutters{margin-left:-.875em}html.no-flexbox .column-group.half-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.half-horizontal-gutters>[class*=large-],html.no-flexboxlegacy .column-group.half-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-horizontal-gutters>[class*=large-]{padding-left:.875em}html.no-flexbox .column-group.half-vertical-gutters>[class*=all-],html.no-flexbox .column-group.half-vertical-gutters>[class*=large-],html.no-flexboxlegacy .column-group.half-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-vertical-gutters>[class*=large-]{margin-bottom:.875em}html.no-flexbox .column-group.quarter-gutters,html.no-flexboxlegacy .column-group.quarter-gutters{margin-left:-.4375em}html.no-flexbox .column-group.quarter-gutters>[class*=all-],html.no-flexbox .column-group.quarter-gutters>[class*=large-],html.no-flexboxlegacy .column-group.quarter-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-gutters>[class*=large-]{padding-left:.4375em;margin-bottom:.4375em}html.no-flexbox .column-group.quarter-horizontal-gutters,html.no-flexboxlegacy .column-group.quarter-horizontal-gutters{margin-left:-.4375em}html.no-flexbox .column-group.quarter-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.quarter-horizontal-gutters>[class*=large-],html.no-flexboxlegacy .column-group.quarter-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-horizontal-gutters>[class*=large-]{padding-left:.4375em}html.no-flexbox .column-group.quarter-vertical-gutters>[class*=all-],html.no-flexbox .column-group.quarter-vertical-gutters>[class*=large-],html.no-flexboxlegacy .column-group.quarter-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-vertical-gutters>[class*=large-]{margin-bottom:.4375em}html.no-flexbox .column-group.large-gutters,html.no-flexboxlegacy .column-group.large-gutters{margin-left:-1.75em}html.no-flexbox .column-group.large-gutters>[class*=all-],html.no-flexbox .column-group.large-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-gutters>[class*=large-]{padding-left:1.75em;margin-bottom:1.75em}html.no-flexbox .column-group.large-horizontal-gutters,html.no-flexboxlegacy .column-group.large-horizontal-gutters{margin-left:-1.75em}html.no-flexbox .column-group.large-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.large-horizontal-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-horizontal-gutters>[class*=large-]{padding-left:1.75em}html.no-flexbox .column-group.large-vertical-gutters>[class*=all-],html.no-flexbox .column-group.large-vertical-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-vertical-gutters>[class*=large-]{margin-bottom:1.75em}html.no-flexbox .column-group.large-double-gutters,html.no-flexboxlegacy .column-group.large-double-gutters{margin-left:-3.5em}html.no-flexbox .column-group.large-double-gutters>[class*=all-],html.no-flexbox .column-group.large-double-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-double-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-double-gutters>[class*=large-]{padding-left:3.5em;margin-bottom:3.5em}html.no-flexbox .column-group.large-double-horizontal-gutters,html.no-flexboxlegacy .column-group.large-double-horizontal-gutters{margin-left:-3.5em}html.no-flexbox .column-group.large-double-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.large-double-horizontal-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-double-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-double-horizontal-gutters>[class*=large-]{padding-left:3.5em}html.no-flexbox .column-group.large-double-vertical-gutters>[class*=all-],html.no-flexbox .column-group.large-double-vertical-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-double-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-double-vertical-gutters>[class*=large-]{margin-bottom:3.5em}html.no-flexbox .column-group.large-half-gutters,html.no-flexboxlegacy .column-group.large-half-gutters{margin-left:-.875em}html.no-flexbox .column-group.large-half-gutters>[class*=all-],html.no-flexbox .column-group.large-half-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-half-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-half-gutters>[class*=large-]{padding-left:.875em;margin-bottom:.875em}html.no-flexbox .column-group.large-half-horizontal-gutters,html.no-flexboxlegacy .column-group.large-half-horizontal-gutters{margin-left:-.875em}html.no-flexbox .column-group.large-half-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.large-half-horizontal-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-half-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-half-horizontal-gutters>[class*=large-]{padding-left:.875em}html.no-flexbox .column-group.large-half-vertical-gutters>[class*=all-],html.no-flexbox .column-group.large-half-vertical-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-half-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-half-vertical-gutters>[class*=large-]{margin-bottom:.875em}html.no-flexbox .column-group.large-quarter-gutters,html.no-flexboxlegacy .column-group.large-quarter-gutters{margin-left:-.4375em}html.no-flexbox .column-group.large-quarter-gutters>[class*=all-],html.no-flexbox .column-group.large-quarter-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-quarter-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-quarter-gutters>[class*=large-]{padding-left:.4375em;margin-bottom:.4375em}html.no-flexbox .column-group.large-quarter-horizontal-gutters,html.no-flexboxlegacy .column-group.large-quarter-horizontal-gutters{margin-left:-.4375em}html.no-flexbox .column-group.large-quarter-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.large-quarter-horizontal-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-quarter-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-quarter-horizontal-gutters>[class*=large-]{padding-left:.4375em}html.no-flexbox .column-group.large-quarter-vertical-gutters>[class*=all-],html.no-flexbox .column-group.large-quarter-vertical-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-quarter-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-quarter-vertical-gutters>[class*=large-]{margin-bottom:.4375em}html.no-flexbox .column-group.large-no-gutters,html.no-flexboxlegacy .column-group.large-no-gutters{margin-left:0}html.no-flexbox .column-group.large-no-gutters>[class*=all-],html.no-flexbox .column-group.large-no-gutters>[class*=large-],html.no-flexboxlegacy .column-group.large-no-gutters>[class*=all-],html.no-flexboxlegacy .column-group.large-no-gutters>[class*=large-]{padding-left:0;margin-bottom:0}html.no-flexbox .ink-table tbody[class*=large-],html.no-flexbox .ink-table td[class*=large-],html.no-flexbox .ink-table tfoot[class*=large-],html.no-flexbox .ink-table th[class*=large-],html.no-flexbox .ink-table thead[class*=large-],html.no-flexbox .ink-table tr[class*=large-],html.no-flexboxlegacy .ink-table tbody[class*=large-],html.no-flexboxlegacy .ink-table td[class*=large-],html.no-flexboxlegacy .ink-table tfoot[class*=large-],html.no-flexboxlegacy .ink-table th[class*=large-],html.no-flexboxlegacy .ink-table thead[class*=large-],html.no-flexboxlegacy .ink-table tr[class*=large-]{float:none}html.no-flexbox .large-push-left,html.no-flexboxlegacy .large-push-left{float:left}html.no-flexbox .large-push-center,html.no-flexboxlegacy .large-push-center{float:none;margin-left:auto;margin-right:auto}html.no-flexbox .large-push-right,html.no-flexboxlegacy .large-push-right{float:right}html.no-flexbox .large-align-left,html.no-flexboxlegacy .large-align-left{text-align:left}html.no-flexbox .large-align-center,html.no-flexboxlegacy .large-align-center{text-align:center}html.no-flexbox .large-align-right,html.no-flexboxlegacy .large-align-right{text-align:right}html.no-flexbox .large-no-margin,html.no-flexboxlegacy .large-no-margin{margin:0!important}html.no-flexbox .large-space,html.no-flexbox .space,html.no-flexboxlegacy .large-space,html.no-flexboxlegacy .space{margin:1.75em}html.no-flexbox .large-padding,html.no-flexbox .padding,html.no-flexboxlegacy .large-padding,html.no-flexboxlegacy .padding{padding:1.75em}html.no-flexbox .double-space,html.no-flexbox .large-double-space,html.no-flexboxlegacy .double-space,html.no-flexboxlegacy .large-double-space{margin:3.5em}html.no-flexbox .double-padding,html.no-flexbox .large-double-padding,html.no-flexboxlegacy .double-padding,html.no-flexboxlegacy .large-double-padding{padding:3.5em}html.no-flexbox .half-space,html.no-flexbox .large-half-space,html.no-flexboxlegacy .half-space,html.no-flexboxlegacy .large-half-space{margin:.875em}html.no-flexbox .half-padding,html.no-flexbox .large-half-padding,html.no-flexboxlegacy .half-padding,html.no-flexboxlegacy .large-half-padding{padding:.875em}html.no-flexbox .large-quarter-space,html.no-flexbox .quarter-space,html.no-flexboxlegacy .large-quarter-space,html.no-flexboxlegacy .quarter-space{margin:.4375em}html.no-flexbox .large-quarter-padding,html.no-flexbox .quarter-padding,html.no-flexboxlegacy .large-quarter-padding,html.no-flexboxlegacy .quarter-padding{padding:.4375em}html.no-flexbox .large-vertical-space,html.no-flexbox .vertical-space,html.no-flexboxlegacy .large-vertical-space,html.no-flexboxlegacy .vertical-space{margin-top:1.75em;margin-bottom:1.75em}html.no-flexbox .large-vertical-padding,html.no-flexbox .vertical-padding,html.no-flexboxlegacy .large-vertical-padding,html.no-flexboxlegacy .vertical-padding{padding-top:1.75em;padding-bottom:1.75em}html.no-flexbox .double-vertical-space,html.no-flexbox .large-double-vertical-space,html.no-flexboxlegacy .double-vertical-space,html.no-flexboxlegacy .large-double-vertical-space{margin-top:3.5em;margin-bottom:3.5em}html.no-flexbox .double-vertical-padding,html.no-flexbox .large-double-vertical-padding,html.no-flexboxlegacy .double-vertical-padding,html.no-flexboxlegacy .large-double-vertical-padding{padding-top:3.5em;padding-bottom:3.5em}html.no-flexbox .half-vertical-space,html.no-flexbox .large-half-vertical-space,html.no-flexboxlegacy .half-vertical-space,html.no-flexboxlegacy .large-half-vertical-space{margin-top:.875em;margin-bottom:.875em}html.no-flexbox .half-vertical-padding,html.no-flexbox .large-half-vertical-padding,html.no-flexboxlegacy .half-vertical-padding,html.no-flexboxlegacy .large-half-vertical-padding{padding-top:.875em;padding-bottom:.875em}html.no-flexbox .large-quarter-vertical-space,html.no-flexbox .quarter-vertical-space,html.no-flexboxlegacy .large-quarter-vertical-space,html.no-flexboxlegacy .quarter-vertical-space{margin-top:.4375em;margin-bottom:.4375em}html.no-flexbox .large-quarter-vertical-padding,html.no-flexbox .quarter-vertical-padding,html.no-flexboxlegacy .large-quarter-vertical-padding,html.no-flexboxlegacy .quarter-vertical-padding{padding-top:.4375em;padding-bottom:.4375em}html.no-flexbox .horizontal-space,html.no-flexbox .large-horizontal-space,html.no-flexboxlegacy .horizontal-space,html.no-flexboxlegacy .large-horizontal-space{margin-left:1.75em;margin-right:1.75em}html.no-flexbox .horizontal-padding,html.no-flexbox .large-horizontal-padding,html.no-flexboxlegacy .horizontal-padding,html.no-flexboxlegacy .large-horizontal-padding{padding-left:1.75em;padding-right:1.75em}html.no-flexbox .double-horizontal-space,html.no-flexbox .large-double-horizontal-space,html.no-flexboxlegacy .double-horizontal-space,html.no-flexboxlegacy .large-double-horizontal-space{margin-left:3.5em;margin-right:3.5em}html.no-flexbox .double-horizontal-padding,html.no-flexbox .large-double-horizontal-padding,html.no-flexboxlegacy .double-horizontal-padding,html.no-flexboxlegacy .large-double-horizontal-padding{padding-left:3.5em;padding-right:3.5em}html.no-flexbox .half-horizontal-space,html.no-flexbox .large-half-horizontal-space,html.no-flexboxlegacy .half-horizontal-space,html.no-flexboxlegacy .large-half-horizontal-space{margin-left:.875em;margin-right:.875em}html.no-flexbox .half-horizontal-padding,html.no-flexbox .large-half-horizontal-padding,html.no-flexboxlegacy .half-horizontal-padding,html.no-flexboxlegacy .large-half-horizontal-padding{padding-left:.875em;padding-right:.875em}html.no-flexbox .large-quarter-horizontal-space,html.no-flexbox .quarter-horizontal-space,html.no-flexboxlegacy .large-quarter-horizontal-space,html.no-flexboxlegacy .quarter-horizontal-space{margin-left:.4375em;margin-right:.4375em}html.no-flexbox .large-quarter-horizontal-padding,html.no-flexbox .quarter-horizontal-padding,html.no-flexboxlegacy .large-quarter-horizontal-padding,html.no-flexboxlegacy .quarter-horizontal-padding{padding-left:.4375em;padding-right:.4375em}html.no-flexbox .large-top-space,html.no-flexbox .top-space,html.no-flexboxlegacy .large-top-space,html.no-flexboxlegacy .top-space{margin-top:1.75em}html.no-flexbox .large-top-padding,html.no-flexbox .top-padding,html.no-flexboxlegacy .large-top-padding,html.no-flexboxlegacy .top-padding{padding-top:1.75em}html.no-flexbox .double-top-space,html.no-flexbox .large-double-top-space,html.no-flexboxlegacy .double-top-space,html.no-flexboxlegacy .large-double-top-space{margin-top:3.5em}html.no-flexbox .double-top-padding,html.no-flexbox .large-double-top-padding,html.no-flexboxlegacy .double-top-padding,html.no-flexboxlegacy .large-double-top-padding{padding-top:3.5em}html.no-flexbox .half-top-space,html.no-flexbox .large-half-top-space,html.no-flexboxlegacy .half-top-space,html.no-flexboxlegacy .large-half-top-space{margin-top:.875em}html.no-flexbox .half-top-padding,html.no-flexbox .large-half-top-padding,html.no-flexboxlegacy .half-top-padding,html.no-flexboxlegacy .large-half-top-padding{padding-top:.875em}html.no-flexbox .large-quarter-top-space,html.no-flexbox .quarter-top-space,html.no-flexboxlegacy .large-quarter-top-space,html.no-flexboxlegacy .quarter-top-space{margin-top:.4375em}html.no-flexbox .large-quarter-top-padding,html.no-flexbox .quarter-top-padding,html.no-flexboxlegacy .large-quarter-top-padding,html.no-flexboxlegacy .quarter-top-padding{padding-top:.4375em}html.no-flexbox .large-right-space,html.no-flexbox .right-space,html.no-flexboxlegacy .large-right-space,html.no-flexboxlegacy .right-space{margin-right:1.75em}html.no-flexbox .large-right-padding,html.no-flexbox .right-padding,html.no-flexboxlegacy .large-right-padding,html.no-flexboxlegacy .right-padding{padding-right:1.75em}html.no-flexbox .double-right-space,html.no-flexbox .large-double-right-space,html.no-flexboxlegacy .double-right-space,html.no-flexboxlegacy .large-double-right-space{margin-right:3.5em}html.no-flexbox .double-right-padding,html.no-flexbox .large-double-right-padding,html.no-flexboxlegacy .double-right-padding,html.no-flexboxlegacy .large-double-right-padding{padding-right:3.5em}html.no-flexbox .half-right-space,html.no-flexbox .large-half-right-space,html.no-flexboxlegacy .half-right-space,html.no-flexboxlegacy .large-half-right-space{margin-right:.875em}html.no-flexbox .half-right-padding,html.no-flexbox .large-half-right-padding,html.no-flexboxlegacy .half-right-padding,html.no-flexboxlegacy .large-half-right-padding{padding-right:.875em}html.no-flexbox .large-quarter-right-space,html.no-flexbox .quarter-right-space,html.no-flexboxlegacy .large-quarter-right-space,html.no-flexboxlegacy .quarter-right-space{margin-right:.4375em}html.no-flexbox .large-quarter-right-padding,html.no-flexbox .quarter-right-padding,html.no-flexboxlegacy .large-quarter-right-padding,html.no-flexboxlegacy .quarter-right-padding{padding-right:.4375em}html.no-flexbox .bottom-space,html.no-flexbox .large-bottom-space,html.no-flexboxlegacy .bottom-space,html.no-flexboxlegacy .large-bottom-space{margin-bottom:1.75em}html.no-flexbox .bottom-padding,html.no-flexbox .large-bottom-padding,html.no-flexboxlegacy .bottom-padding,html.no-flexboxlegacy .large-bottom-padding{padding-bottom:1.75em}html.no-flexbox .double-bottom-space,html.no-flexbox .large-double-bottom-space,html.no-flexboxlegacy .double-bottom-space,html.no-flexboxlegacy .large-double-bottom-space{margin-bottom:3.5em}html.no-flexbox .double-bottom-padding,html.no-flexbox .large-double-bottom-padding,html.no-flexboxlegacy .double-bottom-padding,html.no-flexboxlegacy .large-double-bottom-padding{padding-bottom:3.5em}html.no-flexbox .half-bottom-space,html.no-flexbox .large-half-bottom-space,html.no-flexboxlegacy .half-bottom-space,html.no-flexboxlegacy .large-half-bottom-space{margin-bottom:.875em}html.no-flexbox .half-bottom-padding,html.no-flexbox .large-half-bottom-padding,html.no-flexboxlegacy .half-bottom-padding,html.no-flexboxlegacy .large-half-bottom-padding{padding-bottom:.875em}html.no-flexbox .large-quarter-bottom-space,html.no-flexbox .quarter-bottom-space,html.no-flexboxlegacy .large-quarter-bottom-space,html.no-flexboxlegacy .quarter-bottom-space{margin-bottom:.4375em}html.no-flexbox .large-quarter-bottom-padding,html.no-flexbox .quarter-bottom-padding,html.no-flexboxlegacy .large-quarter-bottom-padding,html.no-flexboxlegacy .quarter-bottom-padding{padding-bottom:.4375em}html.no-flexbox .large-left-space,html.no-flexbox .left-space,html.no-flexboxlegacy .large-left-space,html.no-flexboxlegacy .left-space{margin-left:1.75em}html.no-flexbox .large-left-padding,html.no-flexbox .left-padding,html.no-flexboxlegacy .large-left-padding,html.no-flexboxlegacy .left-padding{padding-left:1.75em}html.no-flexbox .double-left-space,html.no-flexbox .large-double-left-space,html.no-flexboxlegacy .double-left-space,html.no-flexboxlegacy .large-double-left-space{margin-left:3.5em}html.no-flexbox .double-left-padding,html.no-flexbox .large-double-left-padding,html.no-flexboxlegacy .double-left-padding,html.no-flexboxlegacy .large-double-left-padding{padding-left:3.5em}html.no-flexbox .half-left-space,html.no-flexbox .large-half-left-space,html.no-flexboxlegacy .half-left-space,html.no-flexboxlegacy .large-half-left-space{margin-left:.875em}html.no-flexbox .half-left-padding,html.no-flexbox .large-half-left-padding,html.no-flexboxlegacy .half-left-padding,html.no-flexboxlegacy .large-half-left-padding{padding-left:.875em}html.no-flexbox .large-quarter-left-space,html.no-flexbox .quarter-left-space,html.no-flexboxlegacy .large-quarter-left-space,html.no-flexboxlegacy .quarter-left-space{margin-left:.4375em}html.no-flexbox .large-quarter-left-padding,html.no-flexbox .quarter-left-padding,html.no-flexboxlegacy .large-quarter-left-padding,html.no-flexboxlegacy .quarter-left-padding{padding-left:.4375em}html.no-flexbox .hide-large,html.no-flexboxlegacy .hide-large{display:none!important}html.no-flexbox .show-large,html.no-flexboxlegacy .show-large{display:inherit!important}html.no-flexbox table.show-large,html.no-flexboxlegacy table.show-large{display:table}html.no-flexbox thead.show-large,html.no-flexboxlegacy thead.show-large{display:table-header-group}html.no-flexbox tbody.show-large,html.no-flexboxlegacy tbody.show-large{display:table-row-group}html.no-flexbox tfoot.show-large,html.no-flexboxlegacy tfoot.show-large{display:table-footer-group}html.no-flexbox tr.show-large,html.no-flexboxlegacy tr.show-large{display:table-row}html.no-flexbox td.show-large,html.no-flexbox th.show-large,html.no-flexboxlegacy td.show-large,html.no-flexboxlegacy th.show-large{display:table-cell}}@media screen and (min-width:641px) and (max-width:960px){html.no-flexbox .ink-grid,html.no-flexboxlegacy .ink-grid{padding:0 1.5em}html.no-flexbox .column-group>[class*=medium-],html.no-flexboxlegacy .column-group>[class*=medium-]{float:left;clear:none}html.no-flexbox .medium-5,html.no-flexboxlegacy .medium-5{width:5%}html.no-flexbox .medium-10,html.no-flexboxlegacy .medium-10{width:10%}html.no-flexbox .medium-15,html.no-flexboxlegacy .medium-15{width:15%}html.no-flexbox .medium-16,html.no-flexboxlegacy .medium-16{width:16.66%}html.no-flexbox .medium-20,html.no-flexboxlegacy .medium-20{width:20%}html.no-flexbox .medium-25,html.no-flexboxlegacy .medium-25{width:25%}html.no-flexbox .medium-30,html.no-flexboxlegacy .medium-30{width:30%}html.no-flexbox .medium-33,html.no-flexboxlegacy .medium-33{width:33.33%}html.no-flexbox .medium-35,html.no-flexboxlegacy .medium-35{width:35%}html.no-flexbox .medium-40,html.no-flexboxlegacy .medium-40{width:40%}html.no-flexbox .medium-45,html.no-flexboxlegacy .medium-45{width:45%}html.no-flexbox .medium-50,html.no-flexboxlegacy .medium-50{width:50%}html.no-flexbox .medium-55,html.no-flexboxlegacy .medium-55{width:55%}html.no-flexbox .medium-60,html.no-flexboxlegacy .medium-60{width:60%}html.no-flexbox .medium-65,html.no-flexboxlegacy .medium-65{width:65%}html.no-flexbox .medium-66,html.no-flexboxlegacy .medium-66{width:66.66%}html.no-flexbox .medium-70,html.no-flexboxlegacy .medium-70{width:70%}html.no-flexbox .medium-75,html.no-flexboxlegacy .medium-75{width:75%}html.no-flexbox .medium-80,html.no-flexboxlegacy .medium-80{width:80%}html.no-flexbox .medium-85,html.no-flexboxlegacy .medium-85{width:85%}html.no-flexbox .medium-90,html.no-flexboxlegacy .medium-90{width:90%}html.no-flexbox .medium-95,html.no-flexboxlegacy .medium-95{width:95%}html.no-flexbox .medium-100,html.no-flexboxlegacy .medium-100{width:100%}html.no-flexbox [class*=medium-100],html.no-flexboxlegacy [class*=medium-100]{float:none;clear:both}html.no-flexbox .column-group,html.no-flexboxlegacy .column-group{*zoom:1}html.no-flexbox .column-group:after,html.no-flexboxlegacy .column-group:after{content:"";display:table;clear:both}html.no-flexbox .column-group.gutters,html.no-flexboxlegacy .column-group.gutters{margin-left:-1.5em}html.no-flexbox .column-group.gutters>[class*=all-],html.no-flexbox .column-group.gutters>[class*=medium-],html.no-flexboxlegacy .column-group.gutters>[class*=all-],html.no-flexboxlegacy .column-group.gutters>[class*=medium-]{padding-left:1.5em;margin-bottom:1.5em}html.no-flexbox .column-group.horizontal-gutters,html.no-flexboxlegacy .column-group.horizontal-gutters{margin-left:-1.5em}html.no-flexbox .column-group.horizontal-gutters>[class*=all-],html.no-flexbox .column-group.horizontal-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.horizontal-gutters>[class*=medium-]{padding-left:1.5em}html.no-flexbox .column-group.vertical-gutters>[class*=all-],html.no-flexbox .column-group.vertical-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.vertical-gutters>[class*=medium-]{margin-bottom:1.5em}html.no-flexbox .column-group.double-gutters,html.no-flexboxlegacy .column-group.double-gutters{margin-left:-3em}html.no-flexbox .column-group.double-gutters>[class*=all-],html.no-flexbox .column-group.double-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.double-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-gutters>[class*=medium-]{padding-left:3em;margin-bottom:3em}html.no-flexbox .column-group.double-horizontal-gutters,html.no-flexboxlegacy .column-group.double-horizontal-gutters{margin-left:-3em}html.no-flexbox .column-group.double-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.double-horizontal-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.double-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-horizontal-gutters>[class*=medium-]{padding-left:3em}html.no-flexbox .column-group.double-vertical-gutters>[class*=all-],html.no-flexbox .column-group.double-vertical-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.double-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-vertical-gutters>[class*=medium-]{margin-bottom:3em}html.no-flexbox .column-group.half-gutters,html.no-flexboxlegacy .column-group.half-gutters{margin-left:-.75em}html.no-flexbox .column-group.half-gutters>[class*=all-],html.no-flexbox .column-group.half-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.half-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-gutters>[class*=medium-]{padding-left:.75em;margin-bottom:.75em}html.no-flexbox .column-group.half-horizontal-gutters,html.no-flexboxlegacy .column-group.half-horizontal-gutters{margin-left:-.75em}html.no-flexbox .column-group.half-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.half-horizontal-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.half-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-horizontal-gutters>[class*=medium-]{padding-left:.75em}html.no-flexbox .column-group.half-vertical-gutters>[class*=all-],html.no-flexbox .column-group.half-vertical-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.half-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-vertical-gutters>[class*=medium-]{margin-bottom:.75em}html.no-flexbox .column-group.quarter-gutters,html.no-flexboxlegacy .column-group.quarter-gutters{margin-left:-.375em}html.no-flexbox .column-group.quarter-gutters>[class*=all-],html.no-flexbox .column-group.quarter-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.quarter-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-gutters>[class*=medium-]{padding-left:.375em;margin-bottom:.375em}html.no-flexbox .column-group.quarter-horizontal-gutters,html.no-flexboxlegacy .column-group.quarter-horizontal-gutters{margin-left:-.375em}html.no-flexbox .column-group.quarter-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.quarter-horizontal-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.quarter-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-horizontal-gutters>[class*=medium-]{padding-left:.375em}html.no-flexbox .column-group.quarter-vertical-gutters>[class*=all-],html.no-flexbox .column-group.quarter-vertical-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.quarter-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-vertical-gutters>[class*=medium-]{margin-bottom:.375em}html.no-flexbox .column-group.medium-gutters,html.no-flexboxlegacy .column-group.medium-gutters{margin-left:-1.5em}html.no-flexbox .column-group.medium-gutters>[class*=all-],html.no-flexbox .column-group.medium-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-gutters>[class*=medium-]{padding-left:1.5em;margin-bottom:1.5em}html.no-flexbox .column-group.medium-horizontal-gutters,html.no-flexboxlegacy .column-group.medium-horizontal-gutters{margin-left:-1.5em}html.no-flexbox .column-group.medium-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.medium-horizontal-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-horizontal-gutters>[class*=medium-]{padding-left:1.5em}html.no-flexbox .column-group.medium-vertical-gutters>[class*=all-],html.no-flexbox .column-group.medium-vertical-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-vertical-gutters>[class*=medium-]{margin-bottom:1.5em}html.no-flexbox .column-group.medium-double-gutters,html.no-flexboxlegacy .column-group.medium-double-gutters{margin-left:-3em}html.no-flexbox .column-group.medium-double-gutters>[class*=all-],html.no-flexbox .column-group.medium-double-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-double-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-double-gutters>[class*=medium-]{padding-left:3em;margin-bottom:3em}html.no-flexbox .column-group.medium-double-horizontal-gutters,html.no-flexboxlegacy .column-group.medium-double-horizontal-gutters{margin-left:-3em}html.no-flexbox .column-group.medium-double-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.medium-double-horizontal-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-double-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-double-horizontal-gutters>[class*=medium-]{padding-left:3em}html.no-flexbox .column-group.medium-double-vertical-gutters>[class*=all-],html.no-flexbox .column-group.medium-double-vertical-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-double-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-double-vertical-gutters>[class*=medium-]{margin-bottom:3em}html.no-flexbox .column-group.medium-half-gutters,html.no-flexboxlegacy .column-group.medium-half-gutters{margin-left:-.75em}html.no-flexbox .column-group.medium-half-gutters>[class*=all-],html.no-flexbox .column-group.medium-half-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-half-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-half-gutters>[class*=medium-]{padding-left:.75em;margin-bottom:.75em}html.no-flexbox .column-group.medium-half-horizontal-gutters,html.no-flexboxlegacy .column-group.medium-half-horizontal-gutters{margin-left:-.75em}html.no-flexbox .column-group.medium-half-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.medium-half-horizontal-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-half-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-half-horizontal-gutters>[class*=medium-]{padding-left:.75em}html.no-flexbox .column-group.medium-half-vertical-gutters>[class*=all-],html.no-flexbox .column-group.medium-half-vertical-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-half-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-half-vertical-gutters>[class*=medium-]{margin-bottom:.75em}html.no-flexbox .column-group.medium-quarter-gutters,html.no-flexboxlegacy .column-group.medium-quarter-gutters{margin-left:-.375em}html.no-flexbox .column-group.medium-quarter-gutters>[class*=all-],html.no-flexbox .column-group.medium-quarter-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-quarter-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-quarter-gutters>[class*=medium-]{padding-left:.375em;margin-bottom:.375em}html.no-flexbox .column-group.medium-quarter-horizontal-gutters,html.no-flexboxlegacy .column-group.medium-quarter-horizontal-gutters{margin-left:-.375em}html.no-flexbox .column-group.medium-quarter-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.medium-quarter-horizontal-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-quarter-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-quarter-horizontal-gutters>[class*=medium-]{padding-left:.375em}html.no-flexbox .column-group.medium-quarter-vertical-gutters>[class*=all-],html.no-flexbox .column-group.medium-quarter-vertical-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-quarter-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-quarter-vertical-gutters>[class*=medium-]{margin-bottom:.375em}html.no-flexbox .column-group.medium-no-gutters,html.no-flexboxlegacy .column-group.medium-no-gutters{margin-left:0}html.no-flexbox .column-group.medium-no-gutters>[class*=all-],html.no-flexbox .column-group.medium-no-gutters>[class*=medium-],html.no-flexboxlegacy .column-group.medium-no-gutters>[class*=all-],html.no-flexboxlegacy .column-group.medium-no-gutters>[class*=medium-]{padding-left:0;margin-bottom:0}html.no-flexbox .ink-table tbody[class*=medium-],html.no-flexbox .ink-table td[class*=medium-],html.no-flexbox .ink-table tfoot[class*=medium-],html.no-flexbox .ink-table th[class*=medium-],html.no-flexbox .ink-table thead[class*=medium-],html.no-flexbox .ink-table tr[class*=medium-],html.no-flexboxlegacy .ink-table tbody[class*=medium-],html.no-flexboxlegacy .ink-table td[class*=medium-],html.no-flexboxlegacy .ink-table tfoot[class*=medium-],html.no-flexboxlegacy .ink-table th[class*=medium-],html.no-flexboxlegacy .ink-table thead[class*=medium-],html.no-flexboxlegacy .ink-table tr[class*=medium-]{float:none}html.no-flexbox .medium-push-left,html.no-flexboxlegacy .medium-push-left{float:left}html.no-flexbox .medium-push-center,html.no-flexboxlegacy .medium-push-center{float:none;margin-left:auto;margin-right:auto}html.no-flexbox .medium-push-right,html.no-flexboxlegacy .medium-push-right{float:right}html.no-flexbox .medium-align-left,html.no-flexboxlegacy .medium-align-left{text-align:left}html.no-flexbox .medium-align-center,html.no-flexboxlegacy .medium-align-center{text-align:center}html.no-flexbox .medium-align-right,html.no-flexboxlegacy .medium-align-right{text-align:right}html.no-flexbox .medium-no-margin,html.no-flexboxlegacy .medium-no-margin{margin:0!important}html.no-flexbox .medium-space,html.no-flexbox .space,html.no-flexboxlegacy .medium-space,html.no-flexboxlegacy .space{margin:1.5em}html.no-flexbox .medium-padding,html.no-flexbox .padding,html.no-flexboxlegacy .medium-padding,html.no-flexboxlegacy .padding{padding:1.5em}html.no-flexbox .double-space,html.no-flexbox .medium-double-space,html.no-flexboxlegacy .double-space,html.no-flexboxlegacy .medium-double-space{margin:3em}html.no-flexbox .double-padding,html.no-flexbox .medium-double-padding,html.no-flexboxlegacy .double-padding,html.no-flexboxlegacy .medium-double-padding{padding:3em}html.no-flexbox .half-space,html.no-flexbox .medium-half-space,html.no-flexboxlegacy .half-space,html.no-flexboxlegacy .medium-half-space{margin:.75em}html.no-flexbox .half-padding,html.no-flexbox .medium-half-padding,html.no-flexboxlegacy .half-padding,html.no-flexboxlegacy .medium-half-padding{padding:.75em}html.no-flexbox .medium-quarter-space,html.no-flexbox .quarter-space,html.no-flexboxlegacy .medium-quarter-space,html.no-flexboxlegacy .quarter-space{margin:.375em}html.no-flexbox .medium-quarter-padding,html.no-flexbox .quarter-padding,html.no-flexboxlegacy .medium-quarter-padding,html.no-flexboxlegacy .quarter-padding{padding:.375em}html.no-flexbox .medium-vertical-space,html.no-flexbox .vertical-space,html.no-flexboxlegacy .medium-vertical-space,html.no-flexboxlegacy .vertical-space{margin-top:1.5em;margin-bottom:1.5em}html.no-flexbox .medium-vertical-padding,html.no-flexbox .vertical-padding,html.no-flexboxlegacy .medium-vertical-padding,html.no-flexboxlegacy .vertical-padding{padding-top:1.5em;padding-bottom:1.5em}html.no-flexbox .double-vertical-space,html.no-flexbox .medium-double-vertical-space,html.no-flexboxlegacy .double-vertical-space,html.no-flexboxlegacy .medium-double-vertical-space{margin-top:3em;margin-bottom:3em}html.no-flexbox .double-vertical-padding,html.no-flexbox .medium-double-vertical-padding,html.no-flexboxlegacy .double-vertical-padding,html.no-flexboxlegacy .medium-double-vertical-padding{padding-top:3em;padding-bottom:3em}html.no-flexbox .half-vertical-space,html.no-flexbox .medium-half-vertical-space,html.no-flexboxlegacy .half-vertical-space,html.no-flexboxlegacy .medium-half-vertical-space{margin-top:.75em;margin-bottom:.75em}html.no-flexbox .half-vertical-padding,html.no-flexbox .medium-half-vertical-padding,html.no-flexboxlegacy .half-vertical-padding,html.no-flexboxlegacy .medium-half-vertical-padding{padding-top:.75em;padding-bottom:.75em}html.no-flexbox .medium-quarter-vertical-space,html.no-flexbox .quarter-vertical-space,html.no-flexboxlegacy .medium-quarter-vertical-space,html.no-flexboxlegacy .quarter-vertical-space{margin-top:.375em;margin-bottom:.375em}html.no-flexbox .medium-quarter-vertical-padding,html.no-flexbox .quarter-vertical-padding,html.no-flexboxlegacy .medium-quarter-vertical-padding,html.no-flexboxlegacy .quarter-vertical-padding{padding-top:.375em;padding-bottom:.375em}html.no-flexbox .horizontal-space,html.no-flexbox .medium-horizontal-space,html.no-flexboxlegacy .horizontal-space,html.no-flexboxlegacy .medium-horizontal-space{margin-left:1.5em;margin-right:1.5em}html.no-flexbox .horizontal-padding,html.no-flexbox .medium-horizontal-padding,html.no-flexboxlegacy .horizontal-padding,html.no-flexboxlegacy .medium-horizontal-padding{padding-left:1.5em;padding-right:1.5em}html.no-flexbox .double-horizontal-space,html.no-flexbox .medium-double-horizontal-space,html.no-flexboxlegacy .double-horizontal-space,html.no-flexboxlegacy .medium-double-horizontal-space{margin-left:3em;margin-right:3em}html.no-flexbox .double-horizontal-padding,html.no-flexbox .medium-double-horizontal-padding,html.no-flexboxlegacy .double-horizontal-padding,html.no-flexboxlegacy .medium-double-horizontal-padding{padding-left:3em;padding-right:3em}html.no-flexbox .half-horizontal-space,html.no-flexbox .medium-half-horizontal-space,html.no-flexboxlegacy .half-horizontal-space,html.no-flexboxlegacy .medium-half-horizontal-space{margin-left:.75em;margin-right:.75em}html.no-flexbox .half-horizontal-padding,html.no-flexbox .medium-half-horizontal-padding,html.no-flexboxlegacy .half-horizontal-padding,html.no-flexboxlegacy .medium-half-horizontal-padding{padding-left:.75em;padding-right:.75em}html.no-flexbox .medium-quarter-horizontal-space,html.no-flexbox .quarter-horizontal-space,html.no-flexboxlegacy .medium-quarter-horizontal-space,html.no-flexboxlegacy .quarter-horizontal-space{margin-left:.375em;margin-right:.375em}html.no-flexbox .medium-quarter-horizontal-padding,html.no-flexbox .quarter-horizontal-padding,html.no-flexboxlegacy .medium-quarter-horizontal-padding,html.no-flexboxlegacy .quarter-horizontal-padding{padding-left:.375em;padding-right:.375em}html.no-flexbox .medium-top-space,html.no-flexbox .top-space,html.no-flexboxlegacy .medium-top-space,html.no-flexboxlegacy .top-space{margin-top:1.5em}html.no-flexbox .medium-top-padding,html.no-flexbox .top-padding,html.no-flexboxlegacy .medium-top-padding,html.no-flexboxlegacy .top-padding{padding-top:1.5em}html.no-flexbox .double-top-space,html.no-flexbox .medium-double-top-space,html.no-flexboxlegacy .double-top-space,html.no-flexboxlegacy .medium-double-top-space{margin-top:3em}html.no-flexbox .double-top-padding,html.no-flexbox .medium-double-top-padding,html.no-flexboxlegacy .double-top-padding,html.no-flexboxlegacy .medium-double-top-padding{padding-top:3em}html.no-flexbox .half-top-space,html.no-flexbox .medium-half-top-space,html.no-flexboxlegacy .half-top-space,html.no-flexboxlegacy .medium-half-top-space{margin-top:.75em}html.no-flexbox .half-top-padding,html.no-flexbox .medium-half-top-padding,html.no-flexboxlegacy .half-top-padding,html.no-flexboxlegacy .medium-half-top-padding{padding-top:.75em}html.no-flexbox .medium-quarter-top-space,html.no-flexbox .quarter-top-space,html.no-flexboxlegacy .medium-quarter-top-space,html.no-flexboxlegacy .quarter-top-space{margin-top:.375em}html.no-flexbox .medium-quarter-top-padding,html.no-flexbox .quarter-top-padding,html.no-flexboxlegacy .medium-quarter-top-padding,html.no-flexboxlegacy .quarter-top-padding{padding-top:.375em}html.no-flexbox .medium-right-space,html.no-flexbox .right-space,html.no-flexboxlegacy .medium-right-space,html.no-flexboxlegacy .right-space{margin-right:1.5em}html.no-flexbox .medium-right-padding,html.no-flexbox .right-padding,html.no-flexboxlegacy .medium-right-padding,html.no-flexboxlegacy .right-padding{padding-right:1.5em}html.no-flexbox .double-right-space,html.no-flexbox .medium-double-right-space,html.no-flexboxlegacy .double-right-space,html.no-flexboxlegacy .medium-double-right-space{margin-right:3em}html.no-flexbox .double-right-padding,html.no-flexbox .medium-double-right-padding,html.no-flexboxlegacy .double-right-padding,html.no-flexboxlegacy .medium-double-right-padding{padding-right:3em}html.no-flexbox .half-right-space,html.no-flexbox .medium-half-right-space,html.no-flexboxlegacy .half-right-space,html.no-flexboxlegacy .medium-half-right-space{margin-right:.75em}html.no-flexbox .half-right-padding,html.no-flexbox .medium-half-right-padding,html.no-flexboxlegacy .half-right-padding,html.no-flexboxlegacy .medium-half-right-padding{padding-right:.75em}html.no-flexbox .medium-quarter-right-space,html.no-flexbox .quarter-right-space,html.no-flexboxlegacy .medium-quarter-right-space,html.no-flexboxlegacy .quarter-right-space{margin-right:.375em}html.no-flexbox .medium-quarter-right-padding,html.no-flexbox .quarter-right-padding,html.no-flexboxlegacy .medium-quarter-right-padding,html.no-flexboxlegacy .quarter-right-padding{padding-right:.375em}html.no-flexbox .bottom-space,html.no-flexbox .medium-bottom-space,html.no-flexboxlegacy .bottom-space,html.no-flexboxlegacy .medium-bottom-space{margin-bottom:1.5em}html.no-flexbox .bottom-padding,html.no-flexbox .medium-bottom-padding,html.no-flexboxlegacy .bottom-padding,html.no-flexboxlegacy .medium-bottom-padding{padding-bottom:1.5em}html.no-flexbox .double-bottom-space,html.no-flexbox .medium-double-bottom-space,html.no-flexboxlegacy .double-bottom-space,html.no-flexboxlegacy .medium-double-bottom-space{margin-bottom:3em}html.no-flexbox .double-bottom-padding,html.no-flexbox .medium-double-bottom-padding,html.no-flexboxlegacy .double-bottom-padding,html.no-flexboxlegacy .medium-double-bottom-padding{padding-bottom:3em}html.no-flexbox .half-bottom-space,html.no-flexbox .medium-half-bottom-space,html.no-flexboxlegacy .half-bottom-space,html.no-flexboxlegacy .medium-half-bottom-space{margin-bottom:.75em}html.no-flexbox .half-bottom-padding,html.no-flexbox .medium-half-bottom-padding,html.no-flexboxlegacy .half-bottom-padding,html.no-flexboxlegacy .medium-half-bottom-padding{padding-bottom:.75em}html.no-flexbox .medium-quarter-bottom-space,html.no-flexbox .quarter-bottom-space,html.no-flexboxlegacy .medium-quarter-bottom-space,html.no-flexboxlegacy .quarter-bottom-space{margin-bottom:.375em}html.no-flexbox .medium-quarter-bottom-padding,html.no-flexbox .quarter-bottom-padding,html.no-flexboxlegacy .medium-quarter-bottom-padding,html.no-flexboxlegacy .quarter-bottom-padding{padding-bottom:.375em}html.no-flexbox .left-space,html.no-flexbox .medium-left-space,html.no-flexboxlegacy .left-space,html.no-flexboxlegacy .medium-left-space{margin-left:1.5em}html.no-flexbox .left-padding,html.no-flexbox .medium-left-padding,html.no-flexboxlegacy .left-padding,html.no-flexboxlegacy .medium-left-padding{padding-left:1.5em}html.no-flexbox .double-left-space,html.no-flexbox .medium-double-left-space,html.no-flexboxlegacy .double-left-space,html.no-flexboxlegacy .medium-double-left-space{margin-left:3em}html.no-flexbox .double-left-padding,html.no-flexbox .medium-double-left-padding,html.no-flexboxlegacy .double-left-padding,html.no-flexboxlegacy .medium-double-left-padding{padding-left:3em}html.no-flexbox .half-left-space,html.no-flexbox .medium-half-left-space,html.no-flexboxlegacy .half-left-space,html.no-flexboxlegacy .medium-half-left-space{margin-left:.75em}html.no-flexbox .half-left-padding,html.no-flexbox .medium-half-left-padding,html.no-flexboxlegacy .half-left-padding,html.no-flexboxlegacy .medium-half-left-padding{padding-left:.75em}html.no-flexbox .medium-quarter-left-space,html.no-flexbox .quarter-left-space,html.no-flexboxlegacy .medium-quarter-left-space,html.no-flexboxlegacy .quarter-left-space{margin-left:.375em}html.no-flexbox .medium-quarter-left-padding,html.no-flexbox .quarter-left-padding,html.no-flexboxlegacy .medium-quarter-left-padding,html.no-flexboxlegacy .quarter-left-padding{padding-left:.375em}html.no-flexbox .hide-medium,html.no-flexboxlegacy .hide-medium{display:none!important}html.no-flexbox .show-medium,html.no-flexboxlegacy .show-medium{display:inherit!important}html.no-flexbox table.show-medium,html.no-flexboxlegacy table.show-medium{display:table}html.no-flexbox thead.show-medium,html.no-flexboxlegacy thead.show-medium{display:table-header-group}html.no-flexbox tbody.show-medium,html.no-flexboxlegacy tbody.show-medium{display:table-row-group}html.no-flexbox tfoot.show-medium,html.no-flexboxlegacy tfoot.show-medium{display:table-footer-group}html.no-flexbox tr.show-medium,html.no-flexboxlegacy tr.show-medium{display:table-row}html.no-flexbox td.show-medium,html.no-flexbox th.show-medium,html.no-flexboxlegacy td.show-medium,html.no-flexboxlegacy th.show-medium{display:table-cell}}@media screen and (min-width:321px) and (max-width:640px){html.no-flexbox .ink-grid,html.no-flexboxlegacy .ink-grid{padding:0 1.25em}html.no-flexbox .column-group>[class*=small-],html.no-flexboxlegacy .column-group>[class*=small-]{float:left;clear:none}html.no-flexbox .small-5,html.no-flexboxlegacy .small-5{width:5%}html.no-flexbox .small-10,html.no-flexboxlegacy .small-10{width:10%}html.no-flexbox .small-15,html.no-flexboxlegacy .small-15{width:15%}html.no-flexbox .small-16,html.no-flexboxlegacy .small-16{width:16.66%}html.no-flexbox .small-20,html.no-flexboxlegacy .small-20{width:20%}html.no-flexbox .small-25,html.no-flexboxlegacy .small-25{width:25%}html.no-flexbox .small-30,html.no-flexboxlegacy .small-30{width:30%}html.no-flexbox .small-33,html.no-flexboxlegacy .small-33{width:33.33%}html.no-flexbox .small-35,html.no-flexboxlegacy .small-35{width:35%}html.no-flexbox .small-40,html.no-flexboxlegacy .small-40{width:40%}html.no-flexbox .small-45,html.no-flexboxlegacy .small-45{width:45%}html.no-flexbox .small-50,html.no-flexboxlegacy .small-50{width:50%}html.no-flexbox .small-55,html.no-flexboxlegacy .small-55{width:55%}html.no-flexbox .small-60,html.no-flexboxlegacy .small-60{width:60%}html.no-flexbox .small-65,html.no-flexboxlegacy .small-65{width:65%}html.no-flexbox .small-66,html.no-flexboxlegacy .small-66{width:66.66%}html.no-flexbox .small-70,html.no-flexboxlegacy .small-70{width:70%}html.no-flexbox .small-75,html.no-flexboxlegacy .small-75{width:75%}html.no-flexbox .small-80,html.no-flexboxlegacy .small-80{width:80%}html.no-flexbox .small-85,html.no-flexboxlegacy .small-85{width:85%}html.no-flexbox .small-90,html.no-flexboxlegacy .small-90{width:90%}html.no-flexbox .small-95,html.no-flexboxlegacy .small-95{width:95%}html.no-flexbox .small-100,html.no-flexboxlegacy .small-100{width:100%}html.no-flexbox [class*=small-100],html.no-flexboxlegacy [class*=small-100]{float:none;clear:both}html.no-flexbox .column-group,html.no-flexboxlegacy .column-group{*zoom:1}html.no-flexbox .column-group:after,html.no-flexboxlegacy .column-group:after{content:"";display:table;clear:both}html.no-flexbox .column-group.gutters,html.no-flexboxlegacy .column-group.gutters{margin-left:-1.25em}html.no-flexbox .column-group.gutters>[class*=all-],html.no-flexbox .column-group.gutters>[class*=small-],html.no-flexboxlegacy .column-group.gutters>[class*=all-],html.no-flexboxlegacy .column-group.gutters>[class*=small-]{padding-left:1.25em;margin-bottom:1.25em}html.no-flexbox .column-group.horizontal-gutters,html.no-flexboxlegacy .column-group.horizontal-gutters{margin-left:-1.25em}html.no-flexbox .column-group.horizontal-gutters>[class*=all-],html.no-flexbox .column-group.horizontal-gutters>[class*=small-],html.no-flexboxlegacy .column-group.horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.horizontal-gutters>[class*=small-]{padding-left:1.25em}html.no-flexbox .column-group.vertical-gutters>[class*=all-],html.no-flexbox .column-group.vertical-gutters>[class*=small-],html.no-flexboxlegacy .column-group.vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.vertical-gutters>[class*=small-]{margin-bottom:1.25em}html.no-flexbox .column-group.double-gutters,html.no-flexboxlegacy .column-group.double-gutters{margin-left:-2.5em}html.no-flexbox .column-group.double-gutters>[class*=all-],html.no-flexbox .column-group.double-gutters>[class*=small-],html.no-flexboxlegacy .column-group.double-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-gutters>[class*=small-]{padding-left:2.5em;margin-bottom:2.5em}html.no-flexbox .column-group.double-horizontal-gutters,html.no-flexboxlegacy .column-group.double-horizontal-gutters{margin-left:-2.5em}html.no-flexbox .column-group.double-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.double-horizontal-gutters>[class*=small-],html.no-flexboxlegacy .column-group.double-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-horizontal-gutters>[class*=small-]{padding-left:2.5em}html.no-flexbox .column-group.double-vertical-gutters>[class*=all-],html.no-flexbox .column-group.double-vertical-gutters>[class*=small-],html.no-flexboxlegacy .column-group.double-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-vertical-gutters>[class*=small-]{margin-bottom:2.5em}html.no-flexbox .column-group.half-gutters,html.no-flexboxlegacy .column-group.half-gutters{margin-left:-.625em}html.no-flexbox .column-group.half-gutters>[class*=all-],html.no-flexbox .column-group.half-gutters>[class*=small-],html.no-flexboxlegacy .column-group.half-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-gutters>[class*=small-]{padding-left:.625em;margin-bottom:.625em}html.no-flexbox .column-group.half-horizontal-gutters,html.no-flexboxlegacy .column-group.half-horizontal-gutters{margin-left:-.625em}html.no-flexbox .column-group.half-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.half-horizontal-gutters>[class*=small-],html.no-flexboxlegacy .column-group.half-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-horizontal-gutters>[class*=small-]{padding-left:.625em}html.no-flexbox .column-group.half-vertical-gutters>[class*=all-],html.no-flexbox .column-group.half-vertical-gutters>[class*=small-],html.no-flexboxlegacy .column-group.half-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-vertical-gutters>[class*=small-]{margin-bottom:.625em}html.no-flexbox .column-group.quarter-gutters,html.no-flexboxlegacy .column-group.quarter-gutters{margin-left:-.3125em}html.no-flexbox .column-group.quarter-gutters>[class*=all-],html.no-flexbox .column-group.quarter-gutters>[class*=small-],html.no-flexboxlegacy .column-group.quarter-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-gutters>[class*=small-]{padding-left:.3125em;margin-bottom:.3125em}html.no-flexbox .column-group.quarter-horizontal-gutters,html.no-flexboxlegacy .column-group.quarter-horizontal-gutters{margin-left:-.3125em}html.no-flexbox .column-group.quarter-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.quarter-horizontal-gutters>[class*=small-],html.no-flexboxlegacy .column-group.quarter-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-horizontal-gutters>[class*=small-]{padding-left:.3125em}html.no-flexbox .column-group.quarter-vertical-gutters>[class*=all-],html.no-flexbox .column-group.quarter-vertical-gutters>[class*=small-],html.no-flexboxlegacy .column-group.quarter-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-vertical-gutters>[class*=small-]{margin-bottom:.3125em}html.no-flexbox .column-group.small-gutters,html.no-flexboxlegacy .column-group.small-gutters{margin-left:-1.25em}html.no-flexbox .column-group.small-gutters>[class*=all-],html.no-flexbox .column-group.small-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-gutters>[class*=small-]{padding-left:1.25em;margin-bottom:1.25em}html.no-flexbox .column-group.small-horizontal-gutters,html.no-flexboxlegacy .column-group.small-horizontal-gutters{margin-left:-1.25em}html.no-flexbox .column-group.small-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.small-horizontal-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-horizontal-gutters>[class*=small-]{padding-left:1.25em}html.no-flexbox .column-group.small-vertical-gutters>[class*=all-],html.no-flexbox .column-group.small-vertical-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-vertical-gutters>[class*=small-]{margin-bottom:1.25em}html.no-flexbox .column-group.small-double-gutters,html.no-flexboxlegacy .column-group.small-double-gutters{margin-left:-2.5em}html.no-flexbox .column-group.small-double-gutters>[class*=all-],html.no-flexbox .column-group.small-double-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-double-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-double-gutters>[class*=small-]{padding-left:2.5em;margin-bottom:2.5em}html.no-flexbox .column-group.small-double-horizontal-gutters,html.no-flexboxlegacy .column-group.small-double-horizontal-gutters{margin-left:-2.5em}html.no-flexbox .column-group.small-double-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.small-double-horizontal-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-double-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-double-horizontal-gutters>[class*=small-]{padding-left:2.5em}html.no-flexbox .column-group.small-double-vertical-gutters>[class*=all-],html.no-flexbox .column-group.small-double-vertical-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-double-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-double-vertical-gutters>[class*=small-]{margin-bottom:2.5em}html.no-flexbox .column-group.small-half-gutters,html.no-flexboxlegacy .column-group.small-half-gutters{margin-left:-.625em}html.no-flexbox .column-group.small-half-gutters>[class*=all-],html.no-flexbox .column-group.small-half-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-half-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-half-gutters>[class*=small-]{padding-left:.625em;margin-bottom:.625em}html.no-flexbox .column-group.small-half-horizontal-gutters,html.no-flexboxlegacy .column-group.small-half-horizontal-gutters{margin-left:-.625em}html.no-flexbox .column-group.small-half-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.small-half-horizontal-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-half-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-half-horizontal-gutters>[class*=small-]{padding-left:.625em}html.no-flexbox .column-group.small-half-vertical-gutters>[class*=all-],html.no-flexbox .column-group.small-half-vertical-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-half-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-half-vertical-gutters>[class*=small-]{margin-bottom:.625em}html.no-flexbox .column-group.small-quarter-gutters,html.no-flexboxlegacy .column-group.small-quarter-gutters{margin-left:-.3125em}html.no-flexbox .column-group.small-quarter-gutters>[class*=all-],html.no-flexbox .column-group.small-quarter-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-quarter-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-quarter-gutters>[class*=small-]{padding-left:.3125em;margin-bottom:.3125em}html.no-flexbox .column-group.small-quarter-horizontal-gutters,html.no-flexboxlegacy .column-group.small-quarter-horizontal-gutters{margin-left:-.3125em}html.no-flexbox .column-group.small-quarter-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.small-quarter-horizontal-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-quarter-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-quarter-horizontal-gutters>[class*=small-]{padding-left:.3125em}html.no-flexbox .column-group.small-quarter-vertical-gutters>[class*=all-],html.no-flexbox .column-group.small-quarter-vertical-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-quarter-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-quarter-vertical-gutters>[class*=small-]{margin-bottom:.3125em}html.no-flexbox .column-group.small-no-gutters,html.no-flexboxlegacy .column-group.small-no-gutters{margin-left:0}html.no-flexbox .column-group.small-no-gutters>[class*=all-],html.no-flexbox .column-group.small-no-gutters>[class*=small-],html.no-flexboxlegacy .column-group.small-no-gutters>[class*=all-],html.no-flexboxlegacy .column-group.small-no-gutters>[class*=small-]{padding-left:0;margin-bottom:0}html.no-flexbox .ink-table tbody[class*=small-],html.no-flexbox .ink-table td[class*=small-],html.no-flexbox .ink-table tfoot[class*=small-],html.no-flexbox .ink-table th[class*=small-],html.no-flexbox .ink-table thead[class*=small-],html.no-flexbox .ink-table tr[class*=small-],html.no-flexboxlegacy .ink-table tbody[class*=small-],html.no-flexboxlegacy .ink-table td[class*=small-],html.no-flexboxlegacy .ink-table tfoot[class*=small-],html.no-flexboxlegacy .ink-table th[class*=small-],html.no-flexboxlegacy .ink-table thead[class*=small-],html.no-flexboxlegacy .ink-table tr[class*=small-]{float:none}html.no-flexbox .small-push-left,html.no-flexboxlegacy .small-push-left{float:left}html.no-flexbox .small-push-center,html.no-flexboxlegacy .small-push-center{float:none;margin-left:auto;margin-right:auto}html.no-flexbox .small-push-right,html.no-flexboxlegacy .small-push-right{float:right}html.no-flexbox .small-align-left,html.no-flexboxlegacy .small-align-left{text-align:left}html.no-flexbox .small-align-center,html.no-flexboxlegacy .small-align-center{text-align:center}html.no-flexbox .small-align-right,html.no-flexboxlegacy .small-align-right{text-align:right}html.no-flexbox .small-no-margin,html.no-flexboxlegacy .small-no-margin{margin:0!important}html.no-flexbox .small-space,html.no-flexbox .space,html.no-flexboxlegacy .small-space,html.no-flexboxlegacy .space{margin:1.25em}html.no-flexbox .padding,html.no-flexbox .small-padding,html.no-flexboxlegacy .padding,html.no-flexboxlegacy .small-padding{padding:1.25em}html.no-flexbox .double-space,html.no-flexbox .small-double-space,html.no-flexboxlegacy .double-space,html.no-flexboxlegacy .small-double-space{margin:2.5em}html.no-flexbox .double-padding,html.no-flexbox .small-double-padding,html.no-flexboxlegacy .double-padding,html.no-flexboxlegacy .small-double-padding{padding:2.5em}html.no-flexbox .half-space,html.no-flexbox .small-half-space,html.no-flexboxlegacy .half-space,html.no-flexboxlegacy .small-half-space{margin:.625em}html.no-flexbox .half-padding,html.no-flexbox .small-half-padding,html.no-flexboxlegacy .half-padding,html.no-flexboxlegacy .small-half-padding{padding:.625em}html.no-flexbox .quarter-space,html.no-flexbox .small-quarter-space,html.no-flexboxlegacy .quarter-space,html.no-flexboxlegacy .small-quarter-space{margin:.3125em}html.no-flexbox .quarter-padding,html.no-flexbox .small-quarter-padding,html.no-flexboxlegacy .quarter-padding,html.no-flexboxlegacy .small-quarter-padding{padding:.3125em}html.no-flexbox .small-vertical-space,html.no-flexbox .vertical-space,html.no-flexboxlegacy .small-vertical-space,html.no-flexboxlegacy .vertical-space{margin-top:1.25em;margin-bottom:1.25em}html.no-flexbox .small-vertical-padding,html.no-flexbox .vertical-padding,html.no-flexboxlegacy .small-vertical-padding,html.no-flexboxlegacy .vertical-padding{padding-top:1.25em;padding-bottom:1.25em}html.no-flexbox .double-vertical-space,html.no-flexbox .small-double-vertical-space,html.no-flexboxlegacy .double-vertical-space,html.no-flexboxlegacy .small-double-vertical-space{margin-top:2.5em;margin-bottom:2.5em}html.no-flexbox .double-vertical-padding,html.no-flexbox .small-double-vertical-padding,html.no-flexboxlegacy .double-vertical-padding,html.no-flexboxlegacy .small-double-vertical-padding{padding-top:2.5em;padding-bottom:2.5em}html.no-flexbox .half-vertical-space,html.no-flexbox .small-half-vertical-space,html.no-flexboxlegacy .half-vertical-space,html.no-flexboxlegacy .small-half-vertical-space{margin-top:.625em;margin-bottom:.625em}html.no-flexbox .half-vertical-padding,html.no-flexbox .small-half-vertical-padding,html.no-flexboxlegacy .half-vertical-padding,html.no-flexboxlegacy .small-half-vertical-padding{padding-top:.625em;padding-bottom:.625em}html.no-flexbox .quarter-vertical-space,html.no-flexbox .small-quarter-vertical-space,html.no-flexboxlegacy .quarter-vertical-space,html.no-flexboxlegacy .small-quarter-vertical-space{margin-top:.3125em;margin-bottom:.3125em}html.no-flexbox .quarter-vertical-padding,html.no-flexbox .small-quarter-vertical-padding,html.no-flexboxlegacy .quarter-vertical-padding,html.no-flexboxlegacy .small-quarter-vertical-padding{padding-top:.3125em;padding-bottom:.3125em}html.no-flexbox .horizontal-space,html.no-flexbox .small-horizontal-space,html.no-flexboxlegacy .horizontal-space,html.no-flexboxlegacy .small-horizontal-space{margin-left:1.25em;margin-right:1.25em}html.no-flexbox .horizontal-padding,html.no-flexbox .small-horizontal-padding,html.no-flexboxlegacy .horizontal-padding,html.no-flexboxlegacy .small-horizontal-padding{padding-left:1.25em;padding-right:1.25em}html.no-flexbox .double-horizontal-space,html.no-flexbox .small-double-horizontal-space,html.no-flexboxlegacy .double-horizontal-space,html.no-flexboxlegacy .small-double-horizontal-space{margin-left:2.5em;margin-right:2.5em}html.no-flexbox .double-horizontal-padding,html.no-flexbox .small-double-horizontal-padding,html.no-flexboxlegacy .double-horizontal-padding,html.no-flexboxlegacy .small-double-horizontal-padding{padding-left:2.5em;padding-right:2.5em}html.no-flexbox .half-horizontal-space,html.no-flexbox .small-half-horizontal-space,html.no-flexboxlegacy .half-horizontal-space,html.no-flexboxlegacy .small-half-horizontal-space{margin-left:.625em;margin-right:.625em}html.no-flexbox .half-horizontal-padding,html.no-flexbox .small-half-horizontal-padding,html.no-flexboxlegacy .half-horizontal-padding,html.no-flexboxlegacy .small-half-horizontal-padding{padding-left:.625em;padding-right:.625em}html.no-flexbox .quarter-horizontal-space,html.no-flexbox .small-quarter-horizontal-space,html.no-flexboxlegacy .quarter-horizontal-space,html.no-flexboxlegacy .small-quarter-horizontal-space{margin-left:.3125em;margin-right:.3125em}html.no-flexbox .quarter-horizontal-padding,html.no-flexbox .small-quarter-horizontal-padding,html.no-flexboxlegacy .quarter-horizontal-padding,html.no-flexboxlegacy .small-quarter-horizontal-padding{padding-left:.3125em;padding-right:.3125em}html.no-flexbox .small-top-space,html.no-flexbox .top-space,html.no-flexboxlegacy .small-top-space,html.no-flexboxlegacy .top-space{margin-top:1.25em}html.no-flexbox .small-top-padding,html.no-flexbox .top-padding,html.no-flexboxlegacy .small-top-padding,html.no-flexboxlegacy .top-padding{padding-top:1.25em}html.no-flexbox .double-top-space,html.no-flexbox .small-double-top-space,html.no-flexboxlegacy .double-top-space,html.no-flexboxlegacy .small-double-top-space{margin-top:2.5em}html.no-flexbox .double-top-padding,html.no-flexbox .small-double-top-padding,html.no-flexboxlegacy .double-top-padding,html.no-flexboxlegacy .small-double-top-padding{padding-top:2.5em}html.no-flexbox .half-top-space,html.no-flexbox .small-half-top-space,html.no-flexboxlegacy .half-top-space,html.no-flexboxlegacy .small-half-top-space{margin-top:.625em}html.no-flexbox .half-top-padding,html.no-flexbox .small-half-top-padding,html.no-flexboxlegacy .half-top-padding,html.no-flexboxlegacy .small-half-top-padding{padding-top:.625em}html.no-flexbox .quarter-top-space,html.no-flexbox .small-quarter-top-space,html.no-flexboxlegacy .quarter-top-space,html.no-flexboxlegacy .small-quarter-top-space{margin-top:.3125em}html.no-flexbox .quarter-top-padding,html.no-flexbox .small-quarter-top-padding,html.no-flexboxlegacy .quarter-top-padding,html.no-flexboxlegacy .small-quarter-top-padding{padding-top:.3125em}html.no-flexbox .right-space,html.no-flexbox .small-right-space,html.no-flexboxlegacy .right-space,html.no-flexboxlegacy .small-right-space{margin-right:1.25em}html.no-flexbox .right-padding,html.no-flexbox .small-right-padding,html.no-flexboxlegacy .right-padding,html.no-flexboxlegacy .small-right-padding{padding-right:1.25em}html.no-flexbox .double-right-space,html.no-flexbox .small-double-right-space,html.no-flexboxlegacy .double-right-space,html.no-flexboxlegacy .small-double-right-space{margin-right:2.5em}html.no-flexbox .double-right-padding,html.no-flexbox .small-double-right-padding,html.no-flexboxlegacy .double-right-padding,html.no-flexboxlegacy .small-double-right-padding{padding-right:2.5em}html.no-flexbox .half-right-space,html.no-flexbox .small-half-right-space,html.no-flexboxlegacy .half-right-space,html.no-flexboxlegacy .small-half-right-space{margin-right:.625em}html.no-flexbox .half-right-padding,html.no-flexbox .small-half-right-padding,html.no-flexboxlegacy .half-right-padding,html.no-flexboxlegacy .small-half-right-padding{padding-right:.625em}html.no-flexbox .quarter-right-space,html.no-flexbox .small-quarter-right-space,html.no-flexboxlegacy .quarter-right-space,html.no-flexboxlegacy .small-quarter-right-space{margin-right:.3125em}html.no-flexbox .quarter-right-padding,html.no-flexbox .small-quarter-right-padding,html.no-flexboxlegacy .quarter-right-padding,html.no-flexboxlegacy .small-quarter-right-padding{padding-right:.3125em}html.no-flexbox .bottom-space,html.no-flexbox .small-bottom-space,html.no-flexboxlegacy .bottom-space,html.no-flexboxlegacy .small-bottom-space{margin-bottom:1.25em}html.no-flexbox .bottom-padding,html.no-flexbox .small-bottom-padding,html.no-flexboxlegacy .bottom-padding,html.no-flexboxlegacy .small-bottom-padding{padding-bottom:1.25em}html.no-flexbox .double-bottom-space,html.no-flexbox .small-double-bottom-space,html.no-flexboxlegacy .double-bottom-space,html.no-flexboxlegacy .small-double-bottom-space{margin-bottom:2.5em}html.no-flexbox .double-bottom-padding,html.no-flexbox .small-double-bottom-padding,html.no-flexboxlegacy .double-bottom-padding,html.no-flexboxlegacy .small-double-bottom-padding{padding-bottom:2.5em}html.no-flexbox .half-bottom-space,html.no-flexbox .small-half-bottom-space,html.no-flexboxlegacy .half-bottom-space,html.no-flexboxlegacy .small-half-bottom-space{margin-bottom:.625em}html.no-flexbox .half-bottom-padding,html.no-flexbox .small-half-bottom-padding,html.no-flexboxlegacy .half-bottom-padding,html.no-flexboxlegacy .small-half-bottom-padding{padding-bottom:.625em}html.no-flexbox .quarter-bottom-space,html.no-flexbox .small-quarter-bottom-space,html.no-flexboxlegacy .quarter-bottom-space,html.no-flexboxlegacy .small-quarter-bottom-space{margin-bottom:.3125em}html.no-flexbox .quarter-bottom-padding,html.no-flexbox .small-quarter-bottom-padding,html.no-flexboxlegacy .quarter-bottom-padding,html.no-flexboxlegacy .small-quarter-bottom-padding{padding-bottom:.3125em}html.no-flexbox .left-space,html.no-flexbox .small-left-space,html.no-flexboxlegacy .left-space,html.no-flexboxlegacy .small-left-space{margin-left:1.25em}html.no-flexbox .left-padding,html.no-flexbox .small-left-padding,html.no-flexboxlegacy .left-padding,html.no-flexboxlegacy .small-left-padding{padding-left:1.25em}html.no-flexbox .double-left-space,html.no-flexbox .small-double-left-space,html.no-flexboxlegacy .double-left-space,html.no-flexboxlegacy .small-double-left-space{margin-left:2.5em}html.no-flexbox .double-left-padding,html.no-flexbox .small-double-left-padding,html.no-flexboxlegacy .double-left-padding,html.no-flexboxlegacy .small-double-left-padding{padding-left:2.5em}html.no-flexbox .half-left-space,html.no-flexbox .small-half-left-space,html.no-flexboxlegacy .half-left-space,html.no-flexboxlegacy .small-half-left-space{margin-left:.625em}html.no-flexbox .half-left-padding,html.no-flexbox .small-half-left-padding,html.no-flexboxlegacy .half-left-padding,html.no-flexboxlegacy .small-half-left-padding{padding-left:.625em}html.no-flexbox .quarter-left-space,html.no-flexbox .small-quarter-left-space,html.no-flexboxlegacy .quarter-left-space,html.no-flexboxlegacy .small-quarter-left-space{margin-left:.3125em}html.no-flexbox .quarter-left-padding,html.no-flexbox .small-quarter-left-padding,html.no-flexboxlegacy .quarter-left-padding,html.no-flexboxlegacy .small-quarter-left-padding{padding-left:.3125em}html.no-flexbox .hide-small,html.no-flexboxlegacy .hide-small{display:none!important}html.no-flexbox .show-small,html.no-flexboxlegacy .show-small{display:inherit!important}html.no-flexbox table.show-small,html.no-flexboxlegacy table.show-small{display:table}html.no-flexbox thead.show-small,html.no-flexboxlegacy thead.show-small{display:table-header-group}html.no-flexbox tbody.show-small,html.no-flexboxlegacy tbody.show-small{display:table-row-group}html.no-flexbox tfoot.show-small,html.no-flexboxlegacy tfoot.show-small{display:table-footer-group}html.no-flexbox tr.show-small,html.no-flexboxlegacy tr.show-small{display:table-row}html.no-flexbox td.show-small,html.no-flexbox th.show-small,html.no-flexboxlegacy td.show-small,html.no-flexboxlegacy th.show-small{display:table-cell}}@media screen and (max-width:320px){html.no-flexbox .ink-grid,html.no-flexboxlegacy .ink-grid{padding:0 1em}html.no-flexbox .column-group>[class*=tiny-],html.no-flexboxlegacy .column-group>[class*=tiny-]{float:left;clear:none}html.no-flexbox .tiny-5,html.no-flexboxlegacy .tiny-5{width:5%}html.no-flexbox .tiny-10,html.no-flexboxlegacy .tiny-10{width:10%}html.no-flexbox .tiny-15,html.no-flexboxlegacy .tiny-15{width:15%}html.no-flexbox .tiny-16,html.no-flexboxlegacy .tiny-16{width:16.66%}html.no-flexbox .tiny-20,html.no-flexboxlegacy .tiny-20{width:20%}html.no-flexbox .tiny-25,html.no-flexboxlegacy .tiny-25{width:25%}html.no-flexbox .tiny-30,html.no-flexboxlegacy .tiny-30{width:30%}html.no-flexbox .tiny-33,html.no-flexboxlegacy .tiny-33{width:33.33%}html.no-flexbox .tiny-35,html.no-flexboxlegacy .tiny-35{width:35%}html.no-flexbox .tiny-40,html.no-flexboxlegacy .tiny-40{width:40%}html.no-flexbox .tiny-45,html.no-flexboxlegacy .tiny-45{width:45%}html.no-flexbox .tiny-50,html.no-flexboxlegacy .tiny-50{width:50%}html.no-flexbox .tiny-55,html.no-flexboxlegacy .tiny-55{width:55%}html.no-flexbox .tiny-60,html.no-flexboxlegacy .tiny-60{width:60%}html.no-flexbox .tiny-65,html.no-flexboxlegacy .tiny-65{width:65%}html.no-flexbox .tiny-66,html.no-flexboxlegacy .tiny-66{width:66.66%}html.no-flexbox .tiny-70,html.no-flexboxlegacy .tiny-70{width:70%}html.no-flexbox .tiny-75,html.no-flexboxlegacy .tiny-75{width:75%}html.no-flexbox .tiny-80,html.no-flexboxlegacy .tiny-80{width:80%}html.no-flexbox .tiny-85,html.no-flexboxlegacy .tiny-85{width:85%}html.no-flexbox .tiny-90,html.no-flexboxlegacy .tiny-90{width:90%}html.no-flexbox .tiny-95,html.no-flexboxlegacy .tiny-95{width:95%}html.no-flexbox .tiny-100,html.no-flexboxlegacy .tiny-100{width:100%}html.no-flexbox [class*=tiny-100],html.no-flexboxlegacy [class*=tiny-100]{float:none;clear:both}html.no-flexbox .column-group,html.no-flexboxlegacy .column-group{*zoom:1}html.no-flexbox .column-group:after,html.no-flexboxlegacy .column-group:after{content:"";display:table;clear:both}html.no-flexbox .column-group.gutters,html.no-flexboxlegacy .column-group.gutters{margin-left:-1em}html.no-flexbox .column-group.gutters>[class*=all-],html.no-flexbox .column-group.gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.gutters>[class*=all-],html.no-flexboxlegacy .column-group.gutters>[class*=tiny-]{padding-left:1em;margin-bottom:1em}html.no-flexbox .column-group.horizontal-gutters,html.no-flexboxlegacy .column-group.horizontal-gutters{margin-left:-1em}html.no-flexbox .column-group.horizontal-gutters>[class*=all-],html.no-flexbox .column-group.horizontal-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.horizontal-gutters>[class*=tiny-]{padding-left:1em}html.no-flexbox .column-group.vertical-gutters>[class*=all-],html.no-flexbox .column-group.vertical-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.vertical-gutters>[class*=tiny-]{margin-bottom:1em}html.no-flexbox .column-group.double-gutters,html.no-flexboxlegacy .column-group.double-gutters{margin-left:-2em}html.no-flexbox .column-group.double-gutters>[class*=all-],html.no-flexbox .column-group.double-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.double-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-gutters>[class*=tiny-]{padding-left:2em;margin-bottom:2em}html.no-flexbox .column-group.double-horizontal-gutters,html.no-flexboxlegacy .column-group.double-horizontal-gutters{margin-left:-2em}html.no-flexbox .column-group.double-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.double-horizontal-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.double-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-horizontal-gutters>[class*=tiny-]{padding-left:2em}html.no-flexbox .column-group.double-vertical-gutters>[class*=all-],html.no-flexbox .column-group.double-vertical-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.double-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.double-vertical-gutters>[class*=tiny-]{margin-bottom:2em}html.no-flexbox .column-group.half-gutters,html.no-flexboxlegacy .column-group.half-gutters{margin-left:-.5em}html.no-flexbox .column-group.half-gutters>[class*=all-],html.no-flexbox .column-group.half-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.half-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-gutters>[class*=tiny-]{padding-left:.5em;margin-bottom:.5em}html.no-flexbox .column-group.half-horizontal-gutters,html.no-flexboxlegacy .column-group.half-horizontal-gutters{margin-left:-.5em}html.no-flexbox .column-group.half-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.half-horizontal-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.half-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-horizontal-gutters>[class*=tiny-]{padding-left:.5em}html.no-flexbox .column-group.half-vertical-gutters>[class*=all-],html.no-flexbox .column-group.half-vertical-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.half-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.half-vertical-gutters>[class*=tiny-]{margin-bottom:.5em}html.no-flexbox .column-group.quarter-gutters,html.no-flexboxlegacy .column-group.quarter-gutters{margin-left:-.25em}html.no-flexbox .column-group.quarter-gutters>[class*=all-],html.no-flexbox .column-group.quarter-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.quarter-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-gutters>[class*=tiny-]{padding-left:.25em;margin-bottom:.25em}html.no-flexbox .column-group.quarter-horizontal-gutters,html.no-flexboxlegacy .column-group.quarter-horizontal-gutters{margin-left:-.25em}html.no-flexbox .column-group.quarter-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.quarter-horizontal-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.quarter-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-horizontal-gutters>[class*=tiny-]{padding-left:.25em}html.no-flexbox .column-group.quarter-vertical-gutters>[class*=all-],html.no-flexbox .column-group.quarter-vertical-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.quarter-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.quarter-vertical-gutters>[class*=tiny-]{margin-bottom:.25em}html.no-flexbox .column-group.tiny-gutters,html.no-flexboxlegacy .column-group.tiny-gutters{margin-left:-1em}html.no-flexbox .column-group.tiny-gutters>[class*=all-],html.no-flexbox .column-group.tiny-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-gutters>[class*=tiny-]{padding-left:1em;margin-bottom:1em}html.no-flexbox .column-group.tiny-horizontal-gutters,html.no-flexboxlegacy .column-group.tiny-horizontal-gutters{margin-left:-1em}html.no-flexbox .column-group.tiny-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.tiny-horizontal-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-horizontal-gutters>[class*=tiny-]{padding-left:1em}html.no-flexbox .column-group.tiny-vertical-gutters>[class*=all-],html.no-flexbox .column-group.tiny-vertical-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-vertical-gutters>[class*=tiny-]{margin-bottom:1em}html.no-flexbox .column-group.tiny-double-gutters,html.no-flexboxlegacy .column-group.tiny-double-gutters{margin-left:-2em}html.no-flexbox .column-group.tiny-double-gutters>[class*=all-],html.no-flexbox .column-group.tiny-double-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-double-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-double-gutters>[class*=tiny-]{padding-left:2em;margin-bottom:2em}html.no-flexbox .column-group.tiny-double-horizontal-gutters,html.no-flexboxlegacy .column-group.tiny-double-horizontal-gutters{margin-left:-2em}html.no-flexbox .column-group.tiny-double-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.tiny-double-horizontal-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-double-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-double-horizontal-gutters>[class*=tiny-]{padding-left:2em}html.no-flexbox .column-group.tiny-double-vertical-gutters>[class*=all-],html.no-flexbox .column-group.tiny-double-vertical-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-double-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-double-vertical-gutters>[class*=tiny-]{margin-bottom:2em}html.no-flexbox .column-group.tiny-half-gutters,html.no-flexboxlegacy .column-group.tiny-half-gutters{margin-left:-.5em}html.no-flexbox .column-group.tiny-half-gutters>[class*=all-],html.no-flexbox .column-group.tiny-half-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-half-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-half-gutters>[class*=tiny-]{padding-left:.5em;margin-bottom:.5em}html.no-flexbox .column-group.tiny-half-horizontal-gutters,html.no-flexboxlegacy .column-group.tiny-half-horizontal-gutters{margin-left:-.5em}html.no-flexbox .column-group.tiny-half-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.tiny-half-horizontal-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-half-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-half-horizontal-gutters>[class*=tiny-]{padding-left:.5em}html.no-flexbox .column-group.tiny-half-vertical-gutters>[class*=all-],html.no-flexbox .column-group.tiny-half-vertical-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-half-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-half-vertical-gutters>[class*=tiny-]{margin-bottom:.5em}html.no-flexbox .column-group.tiny-quarter-gutters,html.no-flexboxlegacy .column-group.tiny-quarter-gutters{margin-left:-.25em}html.no-flexbox .column-group.tiny-quarter-gutters>[class*=all-],html.no-flexbox .column-group.tiny-quarter-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-quarter-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-quarter-gutters>[class*=tiny-]{padding-left:.25em;margin-bottom:.25em}html.no-flexbox .column-group.tiny-quarter-horizontal-gutters,html.no-flexboxlegacy .column-group.tiny-quarter-horizontal-gutters{margin-left:-.25em}html.no-flexbox .column-group.tiny-quarter-horizontal-gutters>[class*=all-],html.no-flexbox .column-group.tiny-quarter-horizontal-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-quarter-horizontal-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-quarter-horizontal-gutters>[class*=tiny-]{padding-left:.25em}html.no-flexbox .column-group.tiny-quarter-vertical-gutters>[class*=all-],html.no-flexbox .column-group.tiny-quarter-vertical-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-quarter-vertical-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-quarter-vertical-gutters>[class*=tiny-]{margin-bottom:.25em}html.no-flexbox .column-group.tiny-no-gutters,html.no-flexboxlegacy .column-group.tiny-no-gutters{margin-left:0}html.no-flexbox .column-group.tiny-no-gutters>[class*=all-],html.no-flexbox .column-group.tiny-no-gutters>[class*=tiny-],html.no-flexboxlegacy .column-group.tiny-no-gutters>[class*=all-],html.no-flexboxlegacy .column-group.tiny-no-gutters>[class*=tiny-]{padding-left:0;margin-bottom:0}html.no-flexbox .ink-table tbody[class*=tiny-],html.no-flexbox .ink-table td[class*=tiny-],html.no-flexbox .ink-table tfoot[class*=tiny-],html.no-flexbox .ink-table th[class*=tiny-],html.no-flexbox .ink-table thead[class*=tiny-],html.no-flexbox .ink-table tr[class*=tiny-],html.no-flexboxlegacy .ink-table tbody[class*=tiny-],html.no-flexboxlegacy .ink-table td[class*=tiny-],html.no-flexboxlegacy .ink-table tfoot[class*=tiny-],html.no-flexboxlegacy .ink-table th[class*=tiny-],html.no-flexboxlegacy .ink-table thead[class*=tiny-],html.no-flexboxlegacy .ink-table tr[class*=tiny-]{float:none}html.no-flexbox .tiny-push-left,html.no-flexboxlegacy .tiny-push-left{float:left}html.no-flexbox .tiny-push-center,html.no-flexboxlegacy .tiny-push-center{float:none;margin-left:auto;margin-right:auto}html.no-flexbox .tiny-push-right,html.no-flexboxlegacy .tiny-push-right{float:right}html.no-flexbox .tiny-align-left,html.no-flexboxlegacy .tiny-align-left{text-align:left}html.no-flexbox .tiny-align-center,html.no-flexboxlegacy .tiny-align-center{text-align:center}html.no-flexbox .tiny-align-right,html.no-flexboxlegacy .tiny-align-right{text-align:right}html.no-flexbox .tiny-no-margin,html.no-flexboxlegacy .tiny-no-margin{margin:0!important}html.no-flexbox .space,html.no-flexbox .tiny-space,html.no-flexboxlegacy .space,html.no-flexboxlegacy .tiny-space{margin:1em}html.no-flexbox .padding,html.no-flexbox .tiny-padding,html.no-flexboxlegacy .padding,html.no-flexboxlegacy .tiny-padding{padding:1em}html.no-flexbox .double-space,html.no-flexbox .tiny-double-space,html.no-flexboxlegacy .double-space,html.no-flexboxlegacy .tiny-double-space{margin:2em}html.no-flexbox .double-padding,html.no-flexbox .tiny-double-padding,html.no-flexboxlegacy .double-padding,html.no-flexboxlegacy .tiny-double-padding{padding:2em}html.no-flexbox .half-space,html.no-flexbox .tiny-half-space,html.no-flexboxlegacy .half-space,html.no-flexboxlegacy .tiny-half-space{margin:.5em}html.no-flexbox .half-padding,html.no-flexbox .tiny-half-padding,html.no-flexboxlegacy .half-padding,html.no-flexboxlegacy .tiny-half-padding{padding:.5em}html.no-flexbox .quarter-space,html.no-flexbox .tiny-quarter-space,html.no-flexboxlegacy .quarter-space,html.no-flexboxlegacy .tiny-quarter-space{margin:.25em}html.no-flexbox .quarter-padding,html.no-flexbox .tiny-quarter-padding,html.no-flexboxlegacy .quarter-padding,html.no-flexboxlegacy .tiny-quarter-padding{padding:.25em}html.no-flexbox .tiny-vertical-space,html.no-flexbox .vertical-space,html.no-flexboxlegacy .tiny-vertical-space,html.no-flexboxlegacy .vertical-space{margin-top:1em;margin-bottom:1em}html.no-flexbox .tiny-vertical-padding,html.no-flexbox .vertical-padding,html.no-flexboxlegacy .tiny-vertical-padding,html.no-flexboxlegacy .vertical-padding{padding-top:1em;padding-bottom:1em}html.no-flexbox .double-vertical-space,html.no-flexbox .tiny-double-vertical-space,html.no-flexboxlegacy .double-vertical-space,html.no-flexboxlegacy .tiny-double-vertical-space{margin-top:2em;margin-bottom:2em}html.no-flexbox .double-vertical-padding,html.no-flexbox .tiny-double-vertical-padding,html.no-flexboxlegacy .double-vertical-padding,html.no-flexboxlegacy .tiny-double-vertical-padding{padding-top:2em;padding-bottom:2em}html.no-flexbox .half-vertical-space,html.no-flexbox .tiny-half-vertical-space,html.no-flexboxlegacy .half-vertical-space,html.no-flexboxlegacy .tiny-half-vertical-space{margin-top:.5em;margin-bottom:.5em}html.no-flexbox .half-vertical-padding,html.no-flexbox .tiny-half-vertical-padding,html.no-flexboxlegacy .half-vertical-padding,html.no-flexboxlegacy .tiny-half-vertical-padding{padding-top:.5em;padding-bottom:.5em}html.no-flexbox .quarter-vertical-space,html.no-flexbox .tiny-quarter-vertical-space,html.no-flexboxlegacy .quarter-vertical-space,html.no-flexboxlegacy .tiny-quarter-vertical-space{margin-top:.25em;margin-bottom:.25em}html.no-flexbox .quarter-vertical-padding,html.no-flexbox .tiny-quarter-vertical-padding,html.no-flexboxlegacy .quarter-vertical-padding,html.no-flexboxlegacy .tiny-quarter-vertical-padding{padding-top:.25em;padding-bottom:.25em}html.no-flexbox .horizontal-space,html.no-flexbox .tiny-horizontal-space,html.no-flexboxlegacy .horizontal-space,html.no-flexboxlegacy .tiny-horizontal-space{margin-left:1em;margin-right:1em}html.no-flexbox .horizontal-padding,html.no-flexbox .tiny-horizontal-padding,html.no-flexboxlegacy .horizontal-padding,html.no-flexboxlegacy .tiny-horizontal-padding{padding-left:1em;padding-right:1em}html.no-flexbox .double-horizontal-space,html.no-flexbox .tiny-double-horizontal-space,html.no-flexboxlegacy .double-horizontal-space,html.no-flexboxlegacy .tiny-double-horizontal-space{margin-left:2em;margin-right:2em}html.no-flexbox .double-horizontal-padding,html.no-flexbox .tiny-double-horizontal-padding,html.no-flexboxlegacy .double-horizontal-padding,html.no-flexboxlegacy .tiny-double-horizontal-padding{padding-left:2em;padding-right:2em}html.no-flexbox .half-horizontal-space,html.no-flexbox .tiny-half-horizontal-space,html.no-flexboxlegacy .half-horizontal-space,html.no-flexboxlegacy .tiny-half-horizontal-space{margin-left:.5em;margin-right:.5em}html.no-flexbox .half-horizontal-padding,html.no-flexbox .tiny-half-horizontal-padding,html.no-flexboxlegacy .half-horizontal-padding,html.no-flexboxlegacy .tiny-half-horizontal-padding{padding-left:.5em;padding-right:.5em}html.no-flexbox .quarter-horizontal-space,html.no-flexbox .tiny-quarter-horizontal-space,html.no-flexboxlegacy .quarter-horizontal-space,html.no-flexboxlegacy .tiny-quarter-horizontal-space{margin-left:.25em;margin-right:.25em}html.no-flexbox .quarter-horizontal-padding,html.no-flexbox .tiny-quarter-horizontal-padding,html.no-flexboxlegacy .quarter-horizontal-padding,html.no-flexboxlegacy .tiny-quarter-horizontal-padding{padding-left:.25em;padding-right:.25em}html.no-flexbox .tiny-top-space,html.no-flexbox .top-space,html.no-flexboxlegacy .tiny-top-space,html.no-flexboxlegacy .top-space{margin-top:1em}html.no-flexbox .tiny-top-padding,html.no-flexbox .top-padding,html.no-flexboxlegacy .tiny-top-padding,html.no-flexboxlegacy .top-padding{padding-top:1em}html.no-flexbox .double-top-space,html.no-flexbox .tiny-double-top-space,html.no-flexboxlegacy .double-top-space,html.no-flexboxlegacy .tiny-double-top-space{margin-top:2em}html.no-flexbox .double-top-padding,html.no-flexbox .tiny-double-top-padding,html.no-flexboxlegacy .double-top-padding,html.no-flexboxlegacy .tiny-double-top-padding{padding-top:2em}html.no-flexbox .half-top-space,html.no-flexbox .tiny-half-top-space,html.no-flexboxlegacy .half-top-space,html.no-flexboxlegacy .tiny-half-top-space{margin-top:.5em}html.no-flexbox .half-top-padding,html.no-flexbox .tiny-half-top-padding,html.no-flexboxlegacy .half-top-padding,html.no-flexboxlegacy .tiny-half-top-padding{padding-top:.5em}html.no-flexbox .quarter-top-space,html.no-flexbox .tiny-quarter-top-space,html.no-flexboxlegacy .quarter-top-space,html.no-flexboxlegacy .tiny-quarter-top-space{margin-top:.25em}html.no-flexbox .quarter-top-padding,html.no-flexbox .tiny-quarter-top-padding,html.no-flexboxlegacy .quarter-top-padding,html.no-flexboxlegacy .tiny-quarter-top-padding{padding-top:.25em}html.no-flexbox .right-space,html.no-flexbox .tiny-right-space,html.no-flexboxlegacy .right-space,html.no-flexboxlegacy .tiny-right-space{margin-right:1em}html.no-flexbox .right-padding,html.no-flexbox .tiny-right-padding,html.no-flexboxlegacy .right-padding,html.no-flexboxlegacy .tiny-right-padding{padding-right:1em}html.no-flexbox .double-right-space,html.no-flexbox .tiny-double-right-space,html.no-flexboxlegacy .double-right-space,html.no-flexboxlegacy .tiny-double-right-space{margin-right:2em}html.no-flexbox .double-right-padding,html.no-flexbox .tiny-double-right-padding,html.no-flexboxlegacy .double-right-padding,html.no-flexboxlegacy .tiny-double-right-padding{padding-right:2em}html.no-flexbox .half-right-space,html.no-flexbox .tiny-half-right-space,html.no-flexboxlegacy .half-right-space,html.no-flexboxlegacy .tiny-half-right-space{margin-right:.5em}html.no-flexbox .half-right-padding,html.no-flexbox .tiny-half-right-padding,html.no-flexboxlegacy .half-right-padding,html.no-flexboxlegacy .tiny-half-right-padding{padding-right:.5em}html.no-flexbox .quarter-right-space,html.no-flexbox .tiny-quarter-right-space,html.no-flexboxlegacy .quarter-right-space,html.no-flexboxlegacy .tiny-quarter-right-space{margin-right:.25em}html.no-flexbox .quarter-right-padding,html.no-flexbox .tiny-quarter-right-padding,html.no-flexboxlegacy .quarter-right-padding,html.no-flexboxlegacy .tiny-quarter-right-padding{padding-right:.25em}html.no-flexbox .bottom-space,html.no-flexbox .tiny-bottom-space,html.no-flexboxlegacy .bottom-space,html.no-flexboxlegacy .tiny-bottom-space{margin-bottom:1em}html.no-flexbox .bottom-padding,html.no-flexbox .tiny-bottom-padding,html.no-flexboxlegacy .bottom-padding,html.no-flexboxlegacy .tiny-bottom-padding{padding-bottom:1em}html.no-flexbox .double-bottom-space,html.no-flexbox .tiny-double-bottom-space,html.no-flexboxlegacy .double-bottom-space,html.no-flexboxlegacy .tiny-double-bottom-space{margin-bottom:2em}html.no-flexbox .double-bottom-padding,html.no-flexbox .tiny-double-bottom-padding,html.no-flexboxlegacy .double-bottom-padding,html.no-flexboxlegacy .tiny-double-bottom-padding{padding-bottom:2em}html.no-flexbox .half-bottom-space,html.no-flexbox .tiny-half-bottom-space,html.no-flexboxlegacy .half-bottom-space,html.no-flexboxlegacy .tiny-half-bottom-space{margin-bottom:.5em}html.no-flexbox .half-bottom-padding,html.no-flexbox .tiny-half-bottom-padding,html.no-flexboxlegacy .half-bottom-padding,html.no-flexboxlegacy .tiny-half-bottom-padding{padding-bottom:.5em}html.no-flexbox .quarter-bottom-space,html.no-flexbox .tiny-quarter-bottom-space,html.no-flexboxlegacy .quarter-bottom-space,html.no-flexboxlegacy .tiny-quarter-bottom-space{margin-bottom:.25em}html.no-flexbox .quarter-bottom-padding,html.no-flexbox .tiny-quarter-bottom-padding,html.no-flexboxlegacy .quarter-bottom-padding,html.no-flexboxlegacy .tiny-quarter-bottom-padding{padding-bottom:.25em}html.no-flexbox .left-space,html.no-flexbox .tiny-left-space,html.no-flexboxlegacy .left-space,html.no-flexboxlegacy .tiny-left-space{margin-left:1em}html.no-flexbox .left-padding,html.no-flexbox .tiny-left-padding,html.no-flexboxlegacy .left-padding,html.no-flexboxlegacy .tiny-left-padding{padding-left:1em}html.no-flexbox .double-left-space,html.no-flexbox .tiny-double-left-space,html.no-flexboxlegacy .double-left-space,html.no-flexboxlegacy .tiny-double-left-space{margin-left:2em}html.no-flexbox .double-left-padding,html.no-flexbox .tiny-double-left-padding,html.no-flexboxlegacy .double-left-padding,html.no-flexboxlegacy .tiny-double-left-padding{padding-left:2em}html.no-flexbox .half-left-space,html.no-flexbox .tiny-half-left-space,html.no-flexboxlegacy .half-left-space,html.no-flexboxlegacy .tiny-half-left-space{margin-left:.5em}html.no-flexbox .half-left-padding,html.no-flexbox .tiny-half-left-padding,html.no-flexboxlegacy .half-left-padding,html.no-flexboxlegacy .tiny-half-left-padding{padding-left:.5em}html.no-flexbox .quarter-left-space,html.no-flexbox .tiny-quarter-left-space,html.no-flexboxlegacy .quarter-left-space,html.no-flexboxlegacy .tiny-quarter-left-space{margin-left:.25em}html.no-flexbox .quarter-left-padding,html.no-flexbox .tiny-quarter-left-padding,html.no-flexboxlegacy .quarter-left-padding,html.no-flexboxlegacy .tiny-quarter-left-padding{padding-left:.25em}html.no-flexbox .hide-tiny,html.no-flexboxlegacy .hide-tiny{display:none!important}html.no-flexbox .show-tiny,html.no-flexboxlegacy .show-tiny{display:inherit!important}html.no-flexbox table.show-tiny,html.no-flexboxlegacy table.show-tiny{display:table}html.no-flexbox thead.show-tiny,html.no-flexboxlegacy thead.show-tiny{display:table-header-group}html.no-flexbox tbody.show-tiny,html.no-flexboxlegacy tbody.show-tiny{display:table-row-group}html.no-flexbox tfoot.show-tiny,html.no-flexboxlegacy tfoot.show-tiny{display:table-footer-group}html.no-flexbox tr.show-tiny,html.no-flexboxlegacy tr.show-tiny{display:table-row}html.no-flexbox td.show-tiny,html.no-flexbox th.show-tiny,html.no-flexboxlegacy td.show-tiny,html.no-flexboxlegacy th.show-tiny{display:table-cell}}html.no-flexbox:after,html.no-flexboxlegacy:after{content:'[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]';display:none}html.no-flexbox .ink-carousel,html.no-flexboxlegacy .ink-carousel{width:100%;position:relative;overflow:hidden;display:block}html.no-flexbox .ink-carousel .stage,html.no-flexboxlegacy .ink-carousel .stage{left:0;height:auto!important;margin-top:0;margin-bottom:0;padding-left:0;list-style-type:none;white-space:nowrap;position:relative;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease}html.no-flexbox .ink-carousel .stage .slide,html.no-flexboxlegacy .ink-carousel .stage .slide{position:relative;display:inline-block;vertical-align:top;white-space:normal;margin:0;float:none;zoom:1;*display:inline}html.no-flexbox .ink-carousel .ink-navigation,html.no-flexboxlegacy .ink-carousel .ink-navigation{position:static} \ No newline at end of file diff --git a/public/css/ink.css b/public/css/ink.css new file mode 100644 index 0000000..eb0c4f9 --- /dev/null +++ b/public/css/ink.css @@ -0,0 +1,8518 @@ +@charset "UTF-8"; +/** + * Ink + * + * A set of tools for quick development of web interfaces. + * + * @package Ink + * @author Sapo Ink Team + * @license http://opensource.org/licenses/MIT MIT + * @link http://ink.sapo.pt + * @version 3.0.5 + */ +/** + * Ink class names prefix + * Used in all of Inks components root elements + */ +/** + * Grid class names + */ +/** + * Alerts class names + */ +/** + * Badges class names + */ +/** + * Buttons class names + */ +/** + * Forms class names + */ +/** + * Labels class names + */ +/** + * Navigation class names + */ +/** + * Dropdown class names + */ +/** + * Tables class names + */ +/** + * Images class names + */ +/** + * JS UI components classe names + */ +/** + * Sets the grids maximum width + * @var $grid-max-width (pixels|ems|percentage) + */ +/*! + * Sets the grids breakpoint + * + * To add a new break point you'll need to add an element to the list. + * + * Here's an example: ( class-name-prefix, minimum-width, maximum-width, gutter-width, no-media-query). + * + * media: media type. + * class-name-prefix: this is the prefix used in tons of inks classes i.e.: large-100, small-40, etc. + * minimum-width: (pixels|null) the minimum width for the breakpoint + * maximum-width: (pixels|null) the maximum width for the breakpoint + * gutter-width: (ems) the width for the gutters (space between grid columns) for the breakpoint + * no-media-query: (true|false) if you need to support IE8 set this to true on a single breakpoint. + * Since IE8 does not support the @media statement leaving one of the breakpoints + * outside a @media query let's you use the grid in IE8. + * + */ +.show-all { + display: inherit; +} + +.hide-all { + display: none !important; +} + +.no-margin { + margin: 0 !important; +} + +.no-padding { + padding: 0 !important; +} + +.push-left { + float: left; +} + +.push-center { + float: none !important; + margin-left: auto; + margin-right: auto; +} + +.push-right { + float: right; + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + justify-content: flex-end; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +.clearfix { + *zoom: 1; + overflow: hidden; + *zoom: 1; +} +.clearfix:after { + content: ""; + display: table; + clear: both; +} + +/*! normalize.css v3.0.0 | MIT License | git.io/normalize */ +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ +html { + font-family: sans-serif; + /* 1 */ + -ms-text-size-adjust: 100%; + /* 2 */ + -webkit-text-size-adjust: 100%; + /* 2 */ +} +html * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +/** + * Remove default margin. + */ +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ +/** + * Correct `block` display not defined in IE 8/9. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ +audio, +canvas, +progress, +video { + display: inline-block; + /* 1 */ + vertical-align: baseline; + /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9. + * Hide the `template` element in IE, Safari, and Firefox < 22. + */ +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ +/** + * Remove the gray background color from active links in IE 10. + */ +a { + background: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ +/** + * Address styling not present in IE 8/9, Safari 5, and Chrome. + */ +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. + */ +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari 5, and Chrome. + */ +h1 { + font-size: 2em; + margin: .67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -.5em; +} + +sub { + bottom: -.25em; +} + +/* Embedded content + ========================================================================== */ +/** + * Remove border when inside `a` element in IE 8/9. + */ +img { + border: 0; +} + +/** + * Correct overflow displayed oddly in IE 9. + */ +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ +/** + * Address margin not present in IE 8/9 and Safari 5. + */ +figure { + margin: 0; +} + +/** + * Address differences between Firefox and other browsers. + */ +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. + */ +button, +input, +optgroup, +select, +textarea { + color: inherit; + /* 1 */ + font: inherit; + /* 2 */ + margin: 0; + /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10. + */ +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8+, and Opera + * Correct `select` style inheritance in Firefox. + */ +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + /* 2 */ + cursor: pointer; + /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + /* 2 */ + box-sizing: border-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: .35em .625em .75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ +legend { + border: 0; + /* 1 */ + padding: 0; + /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9. + */ +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ +/** + * Remove most spacing between table cells. + */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} + +.ink-alert.basic, .ink-alert.block { + font-size: .938em; + margin: 1em 0; + position: relative; + overflow: hidden; +} +.ink-alert.basic { + padding: 1em 3em 1em 1em; +} +.ink-alert.basic p { + margin: 0; +} +.ink-alert.basic .ink-close { + top: .55em; + *top: .2em; +} +.ink-alert.block { + font-size: 1em; +} +.ink-alert.block > h4 { + padding: 1em 3em 1em 1em; + font-size: .938em; + line-height: 1.5; + margin: 0; +} +.ink-alert.block p { + margin: 1.5em 1em; +} +.ink-alert.block ul { + list-style: inside; +} +.ink-alert .ink-dismiss { + position: absolute; + line-height: .56em; + font-size: 1.8em; + padding: 5px; + border: none; + background: none; + top: .5em; + *top: .2em; + right: .4em; +} + +.ink-badge { + padding: 0.2em 0.6em; + font-size: 0.813em; + margin-left: .6em; +} + +.ink-button { + -webkit-appearance: menuitem; + padding: 8px 12px; + cursor: pointer; + text-decoration: none; + text-align: center; + display: inline-block; + vertical-align: middle; + white-space: nowrap; + line-height: normal; +} +.ink-button + .ink-button { + margin-left: 5px; +} + +.button-group { + *zoom: 1; +} +.button-group > .ink-button { + float: left; + margin: 5px 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + -ms-border-radius: 0; + -o-border-radius: 0; + border-radius: 0; + border-left: none; +} +.button-group > .ink-button:hover, .button-group > .ink-button:active { + border-left: none; +} +.button-group > .ink-button:first-child { + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; + border-left: 1px solid #bfbfbf; +} +.button-group > .ink-button:last-child { + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.button-group:after { + content: ""; + display: table; + clear: both; +} + +.button-toolbar { + *zoom: 1; +} +.button-toolbar > .button-group { + margin-right: 10px; + float: left; +} +.button-toolbar:after { + content: ""; + display: table; + clear: both; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-thin-webfont.eot'); + src: url('../fonts/Roboto/roboto-thin-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-thin-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-thin-webfont.ttf') format('truetype'); + font-weight: 100; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-thinitalic-webfont.eot'); + src: url('../fonts/Roboto/roboto-thinitalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-thinitalic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-thinitalic-webfont.ttf') format('truetype'); + font-weight: 100; + font-style: italic; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-light-webfont.eot'); + src: url('../fonts/Roboto/roboto-light-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-light-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-light-webfont.ttf') format('truetype'); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-lightitalic-webfont.eot'); + src: url('../fonts/Roboto/roboto-lightitalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-lightitalic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-lightitalic-webfont.ttf') format('truetype'); + font-weight: 300; + font-style: italic; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-regular-webfont.eot'); + src: url('../fonts/Roboto/roboto-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-regular-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-regular-webfont.ttf') format('truetype'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-italic-webfont.eot'); + src: url('../fonts/Roboto/roboto-italic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-italic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-italic-webfont.ttf') format('truetype'); + font-weight: 400; + font-style: italic; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-medium-webfont.eot'); + src: url('../fonts/Roboto/roboto-medium-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-medium-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-medium-webfont.ttf') format('truetype'); + font-weight: 500; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-mediumitalic-webfont.eot'); + src: url('../fonts/Roboto/roboto-mediumitalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-mediumitalic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-mediumitalic-webfont.ttf') format('truetype'); + font-weight: 500; + font-style: italic; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-bold-webfont.eot'); + src: url('../fonts/Roboto/roboto-bold-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-bold-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-bold-webfont.ttf') format('truetype'); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-bolditalic-webfont.eot'); + src: url('../fonts/Roboto/roboto-bolditalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-bolditalic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-bolditalic-webfont.ttf') format('truetype'); + font-weight: 700; + font-style: italic; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-black-webfont.eot'); + src: url('../fonts/Roboto/roboto-black-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-black-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-black-webfont.ttf') format('truetype'); + font-weight: 900; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url('../fonts/Roboto/roboto-blackitalic-webfont.eot'); + src: url('../fonts/Roboto/roboto-blackitalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto/roboto-blackitalic-webfont.woff') format('woff'), url('../fonts/Roboto/roboto-blackitalic-webfont.ttf') format('truetype'); + font-weight: 900; + font-style: italic; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-light-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-light-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-light-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-light-webfont.ttf') format('truetype'); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.ttf') format('truetype'); + font-weight: 300; + font-style: italic; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-regular-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-regular-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-regular-webfont.ttf') format('truetype'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-italic-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-italic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-italic-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-italic-webfont.ttf') format('truetype'); + font-weight: 400; + font-style: italic; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-bold-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-bold-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-bold-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-bold-webfont.ttf') format('truetype'); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: "Roboto_condensed"; + src: url('../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot'); + src: url('../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.woff') format('woff'), url('../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.ttf') format('truetype'); + font-weight: 700; + font-style: italic; +} + +@font-face { + font-family: "Roboto_slab"; + src: url('../fonts/Roboto_slab/robotoslab-thin-webfont.eot'); + src: url('../fonts/Roboto_slab/robotoslab-thin-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_slab/robotoslab-thin-webfont.woff') format('woff'), url('../fonts/Roboto_slab/robotoslab-thin-webfont.ttf') format('truetype'); + font-weight: 100; + font-style: normal; +} + +@font-face { + font-family: "Roboto_slab"; + src: url('../fonts/Roboto_slab/robotoslab-light-webfont.eot'); + src: url('../fonts/Roboto_slab/robotoslab-light-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_slab/robotoslab-light-webfont.woff') format('woff'), url('../fonts/Roboto_slab/robotoslab-light-webfont.ttf') format('truetype'); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: "Roboto_slab"; + src: url('../fonts/Roboto_slab/robotoslab-regular-webfont.eot'); + src: url('../fonts/Roboto_slab/robotoslab-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_slab/robotoslab-regular-webfont.woff') format('woff'), url('../fonts/Roboto_slab/robotoslab-regular-webfont.ttf') format('truetype'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: "Roboto_slab"; + src: url('../fonts/Roboto_slab/robotoslab-bold-webfont.eot'); + src: url('../fonts/Roboto_slab/robotoslab-bold-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Roboto_slab/robotoslab-bold-webfont.woff') format('woff'), url('../fonts/Roboto_slab/robotoslab-bold-webfont.ttf') format('truetype'); + font-weight: 700; + font-style: normal; +} + +.ink-form fieldset { + border: none; + margin-bottom: 1.5em; + padding: 0; + margin: 0; +} +.ink-form fieldset legend { + font-size: 1.438em; + font-weight: 700; + width: 100%; + border-bottom: 1px solid #ddd; +} +.ink-form fieldset legend + * { + -webkit-margin-top-collapse: separate; + margin: 2em 0; +} +.ink-form p.tip { + font-size: .875em; + color: #909090; + position: relative; + margin: .2em 0 0 .1em; +} +.ink-form p.label { + padding: 0; + margin: 0; + color: #555555; + white-space: normal; +} +.ink-form select, +.ink-form textarea, +.ink-form input[type="text"], +.ink-form input[type="password"], +.ink-form input[type="datetime"], +.ink-form input[type="datetime-local"], +.ink-form input[type="date"], +.ink-form input[type="month"], +.ink-form input[type="time"], +.ink-form input[type="week"], +.ink-form input[type="number"], +.ink-form input[type="email"], +.ink-form input[type="url"], +.ink-form input[type="search"], +.ink-form input[type="tel"], +.ink-form input[type="color"] { + font-family: "Roboto", Arial, Helvetica, sans-serif; + font-weight: 300; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + padding: 8px 6px; + border: 1px solid #c6c6c6; + resize: none; + background: white; + vertical-align: middle; +} +.ink-form select:focus, +.ink-form textarea:focus, +.ink-form input[type="text"]:focus, +.ink-form input[type="password"]:focus, +.ink-form input[type="datetime"]:focus, +.ink-form input[type="datetime-local"]:focus, +.ink-form input[type="date"]:focus, +.ink-form input[type="month"]:focus, +.ink-form input[type="time"]:focus, +.ink-form input[type="week"]:focus, +.ink-form input[type="number"]:focus, +.ink-form input[type="email"]:focus, +.ink-form input[type="url"]:focus, +.ink-form input[type="search"]:focus, +.ink-form input[type="tel"]:focus, +.ink-form input[type="color"]:focus { + outline: none; + border-color: rgba(153, 153, 153, 0.9); + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + outline: 0 none; +} +.ink-form select:disabled, +.ink-form textarea:disabled, +.ink-form input[type="text"]:disabled, +.ink-form input[type="password"]:disabled, +.ink-form input[type="datetime"]:disabled, +.ink-form input[type="datetime-local"]:disabled, +.ink-form input[type="date"]:disabled, +.ink-form input[type="month"]:disabled, +.ink-form input[type="time"]:disabled, +.ink-form input[type="week"]:disabled, +.ink-form input[type="number"]:disabled, +.ink-form input[type="email"]:disabled, +.ink-form input[type="url"]:disabled, +.ink-form input[type="search"]:disabled, +.ink-form input[type="tel"]:disabled, +.ink-form input[type="color"]:disabled { + background: #f2f2f2; + cursor: not-allowed; +} +.ink-form .input-file { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + padding: 6px; + border: 1px solid #c6c6c6; + background: white; + vertical-align: middle; + line-height: 1.2; +} +.ink-form .input-file input[type="file"] { + -webkit-border-radius: 0; + -moz-border-radius: 0; + -ms-border-radius: 0; + -o-border-radius: 0; + border-radius: 0; + border: none; + padding: 0; + background: none; + width: 100%; +} +.ink-form .ink-button { + margin: 0 5px; +} +.ink-form label { + cursor: pointer; +} +.ink-form select { + line-height: 2; + cursor: pointer; +} +.ink-form textarea { + min-height: 5em; +} +.ink-form .control-group { + line-height: 2; + margin-bottom: 1em; + *zoom: 1; +} +.ink-form .control-group:after { + content: ""; + display: table; + clear: both; +} +.ink-form .control-group .control { + position: relative; + *zoom: 1; +} +.ink-form .control-group .control:after { + content: ""; + display: table; + clear: both; +} +.ink-form .control-group .control > li { + margin: 0; + *zoom: 1; +} +.ink-form .control-group .control > li:after { + content: ""; + display: table; + clear: both; +} +.ink-form .control-group .control > input, .ink-form .control-group .control > select, .ink-form .control-group .control > textarea { + width: 100%; +} +.ink-form .control-group .control > input + [class^="icon-"], .ink-form .control-group .control > input + [class*=" icon-"], .ink-form .control-group .control > select + [class^="icon-"], .ink-form .control-group .control > select + [class*=" icon-"], .ink-form .control-group .control > textarea + [class^="icon-"], .ink-form .control-group .control > textarea + [class*=" icon-"] { + display: none; +} +.ink-form .control-group .control.append-button span, .ink-form .control-group .control.append-symbol span, .ink-form .control-group .control.prepend-button span, .ink-form .control-group .control.prepend-symbol span { + width: 100%; + position: relative; +} +.ink-form .control-group .control.append-button span > input, .ink-form .control-group .control.append-button span > select, .ink-form .control-group .control.append-button span > textarea, .ink-form .control-group .control.append-symbol span > input, .ink-form .control-group .control.append-symbol span > select, .ink-form .control-group .control.append-symbol span > textarea, .ink-form .control-group .control.prepend-button span > input, .ink-form .control-group .control.prepend-button span > select, .ink-form .control-group .control.prepend-button span > textarea, .ink-form .control-group .control.prepend-symbol span > input, .ink-form .control-group .control.prepend-symbol span > select, .ink-form .control-group .control.prepend-symbol span > textarea { + width: 100%; +} +.ink-form .control-group .control.append-button > input[type="submit"], .ink-form .control-group .control.append-button > input[type="button"], .ink-form .control-group .control.append-button > input[type="reset"], .ink-form .control-group .control.append-symbol > input[type="submit"], .ink-form .control-group .control.append-symbol > input[type="button"], .ink-form .control-group .control.append-symbol > input[type="reset"], .ink-form .control-group .control.prepend-button > input[type="submit"], .ink-form .control-group .control.prepend-button > input[type="button"], .ink-form .control-group .control.prepend-button > input[type="reset"], .ink-form .control-group .control.prepend-symbol > input[type="submit"], .ink-form .control-group .control.prepend-symbol > input[type="button"], .ink-form .control-group .control.prepend-symbol > input[type="reset"] { + width: auto; +} +.ink-form .control-group .control.append-button { + display: table; +} +.ink-form .control-group .control.append-button span { + display: table-cell; +} +.ink-form .control-group .control.append-button span > input, .ink-form .control-group .control.append-button span > select, .ink-form .control-group .control.append-button span > textarea { + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.ink-form .control-group .control.append-button .ink-button { + margin: 0; + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; + border-left: none; +} +.ink-form .control-group .control.prepend-button { + display: table; +} +.ink-form .control-group .control.prepend-button span { + display: table-cell; +} +.ink-form .control-group .control.prepend-button span > input, .ink-form .control-group .control.prepend-button span > select, .ink-form .control-group .control.prepend-button span > textarea { + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.ink-form .control-group .control.prepend-button .ink-button { + margin: 0; + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; + border-right: none; +} +.ink-form .control-group .control.append-symbol span { + display: block; +} +.ink-form .control-group .control.append-symbol span > input, .ink-form .control-group .control.append-symbol span > select, .ink-form .control-group .control.append-symbol span > textarea { + padding-right: 2.5em; +} +.ink-form .control-group .control.append-symbol span > [class^="fa-"], .ink-form .control-group .control.append-symbol span > [class*=" fa-"] { + position: absolute; + right: 1em; + top: .86em; + pointer-events: none; +} +.ink-form .control-group .control.prepend-symbol span { + display: block; +} +.ink-form .control-group .control.prepend-symbol span > input, .ink-form .control-group .control.prepend-symbol span > select, .ink-form .control-group .control.prepend-symbol span > textarea { + padding-left: 2.5em; +} +.ink-form .control-group .control.prepend-symbol span > [class^="fa-"], .ink-form .control-group .control.prepend-symbol span > [class*=" fa-"] { + position: absolute; + left: 1em; + top: .86em; + pointer-events: none; +} +.ink-form .control-group input[type="radio"], +.ink-form .control-group input[type="checkbox"] { + padding: 0; + margin: .55em 0; + border: none; + clear: left; + float: left; + cursor: pointer; +} +.ink-form .control-group input[type="radio"] + label, +.ink-form .control-group input[type="checkbox"] + label { + float: left; + margin: .25em 0 .25em .4em; +} +.ink-form .control-group .inline li { + padding: 0; +} +.ink-form .control-group .inline li label { + margin-right: 1em; +} +.ink-form .control-group.validation.error input, .ink-form .control-group.validation.error textarea, .ink-form .control-group.validation.error select { + outline: none; + border-color: rgba(200, 10, 16, 0.8); + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + border: 1px solid rgba(200, 10, 16, 0.5); +} +.ink-form .control-group.validation.error p.tip { + color: rgba(150, 7, 12, 0.55); +} +.ink-form .control-group.validation.warning input, .ink-form .control-group.validation.warning textarea, .ink-form .control-group.validation.warning select { + outline: none; + border-color: rgba(255, 156, 0, 0.9); + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + border: 1px solid rgba(255, 156, 0, 0.6); +} +.ink-form .control-group.validation.warning p.tip { + color: rgba(204, 125, 0, 0.6); +} +.ink-form .control-group.required label, .ink-form .control-group.required p.label { + color: #555555; +} +.ink-form .control-group.required label:after, .ink-form .control-group.required p.label:after { + content: "\f069"; + color: #c91111; + margin-left: .6em; + font-family: FontAwesome; + font-size: .75em; + width: 1.25em; +} +.ink-form .control-group.required ul.control label:after { + content: ""; +} + +.ink-grid { + width: auto; + max-width: 1440px; + margin: 0 auto; +} + +.all-5 { + width: 5%; + float: left; + clear: none; +} + +.all-10 { + width: 10%; + float: left; + clear: none; +} + +.all-15 { + width: 15%; + float: left; + clear: none; +} + +.all-16 { + width: 16.66%; + float: left; + clear: none; +} + +.all-20 { + width: 20%; + float: left; + clear: none; +} + +.all-25 { + width: 25%; + float: left; + clear: none; +} + +.all-30 { + width: 30%; + float: left; + clear: none; +} + +.all-33 { + width: 33.33%; + float: left; + clear: none; +} + +.all-35 { + width: 35%; + float: left; + clear: none; +} + +.all-40 { + width: 40%; + float: left; + clear: none; +} + +.all-45 { + width: 45%; + float: left; + clear: none; +} + +.all-50 { + width: 50%; + float: left; + clear: none; +} + +.all-55 { + width: 55%; + float: left; + clear: none; +} + +.all-60 { + width: 60%; + float: left; + clear: none; +} + +.all-65 { + width: 65%; + float: left; + clear: none; +} + +.all-66 { + width: 66.66%; + float: left; + clear: none; +} + +.all-70 { + width: 70%; + float: left; + clear: none; +} + +.all-75 { + width: 75%; + float: left; + clear: none; +} + +.all-80 { + width: 80%; + float: left; + clear: none; +} + +.all-85 { + width: 85%; + float: left; + clear: none; +} + +.all-90 { + width: 90%; + float: left; + clear: none; +} + +.all-95 { + width: 95%; + float: left; + clear: none; +} + +.all-100 { + width: 100%; + float: left; + clear: none; +} + +[class~=all-100] { + float: none; + clear: both; +} + +@media screen and (min-width: 1261px) { + .ink-grid { + padding: 0 2em; + } + + .column-group > [class*=xlarge-] { + float: left; + clear: none; + } + + .xlarge-5 { + width: 5%; + } + + .xlarge-10 { + width: 10%; + } + + .xlarge-15 { + width: 15%; + } + + .xlarge-16 { + width: 16.66%; + } + + .xlarge-20 { + width: 20%; + } + + .xlarge-25 { + width: 25%; + } + + .xlarge-30 { + width: 30%; + } + + .xlarge-33 { + width: 33.33%; + } + + .xlarge-35 { + width: 35%; + } + + .xlarge-40 { + width: 40%; + } + + .xlarge-45 { + width: 45%; + } + + .xlarge-50 { + width: 50%; + } + + .xlarge-55 { + width: 55%; + } + + .xlarge-60 { + width: 60%; + } + + .xlarge-65 { + width: 65%; + } + + .xlarge-66 { + width: 66.66%; + } + + .xlarge-70 { + width: 70%; + } + + .xlarge-75 { + width: 75%; + } + + .xlarge-80 { + width: 80%; + } + + .xlarge-85 { + width: 85%; + } + + .xlarge-90 { + width: 90%; + } + + .xlarge-95 { + width: 95%; + } + + .xlarge-100 { + width: 100%; + } + + [class*=xlarge-100] { + float: none; + clear: both; + } + + .column-group { + *zoom: 1; + } + .column-group:after { + content: ""; + display: table; + clear: both; + } + + .column-group.gutters { + margin-left: -2em; + } + .column-group.gutters > [class*=xlarge-], .column-group.gutters > [class*=all-] { + padding-left: 2em; + margin-bottom: 2em; + } + + .column-group.horizontal-gutters { + margin-left: -2em; + } + .column-group.horizontal-gutters > [class*=xlarge-], .column-group.horizontal-gutters > [class*=all-] { + padding-left: 2em; + } + + .column-group.vertical-gutters > [class*=xlarge-], .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 2em; + } + + .column-group.double-gutters { + margin-left: -4em; + } + .column-group.double-gutters > [class*=xlarge-], .column-group.double-gutters > [class*=all-] { + padding-left: 4em; + margin-bottom: 4em; + } + + .column-group.double-horizontal-gutters { + margin-left: -4em; + } + .column-group.double-horizontal-gutters > [class*=xlarge-], .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 4em; + } + + .column-group.double-vertical-gutters > [class*=xlarge-], .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 4em; + } + + .column-group.half-gutters { + margin-left: -1em; + } + .column-group.half-gutters > [class*=xlarge-], .column-group.half-gutters > [class*=all-] { + padding-left: 1em; + margin-bottom: 1em; + } + + .column-group.half-horizontal-gutters { + margin-left: -1em; + } + .column-group.half-horizontal-gutters > [class*=xlarge-], .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 1em; + } + + .column-group.half-vertical-gutters > [class*=xlarge-], .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 1em; + } + + .column-group.quarter-gutters { + margin-left: -0.5em; + } + .column-group.quarter-gutters > [class*=xlarge-], .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + + .column-group.quarter-horizontal-gutters { + margin-left: -0.5em; + } + .column-group.quarter-horizontal-gutters > [class*=xlarge-], .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.5em; + } + + .column-group.quarter-vertical-gutters > [class*=xlarge-], .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.5em; + } + + .column-group.xlarge-gutters { + margin-left: -2em; + } + .column-group.xlarge-gutters > [class*=xlarge-], .column-group.xlarge-gutters > [class*=all-] { + padding-left: 2em; + margin-bottom: 2em; + } + + .column-group.xlarge-horizontal-gutters { + margin-left: -2em; + } + .column-group.xlarge-horizontal-gutters > [class*=xlarge-], .column-group.xlarge-horizontal-gutters > [class*=all-] { + padding-left: 2em; + } + + .column-group.xlarge-vertical-gutters > [class*=xlarge-], .column-group.xlarge-vertical-gutters > [class*=all-] { + margin-bottom: 2em; + } + + .column-group.xlarge-double-gutters { + margin-left: -4em; + } + .column-group.xlarge-double-gutters > [class*=xlarge-], .column-group.xlarge-double-gutters > [class*=all-] { + padding-left: 4em; + margin-bottom: 4em; + } + + .column-group.xlarge-double-horizontal-gutters { + margin-left: -4em; + } + .column-group.xlarge-double-horizontal-gutters > [class*=xlarge-], .column-group.xlarge-double-horizontal-gutters > [class*=all-] { + padding-left: 4em; + } + + .column-group.xlarge-double-vertical-gutters > [class*=xlarge-], .column-group.xlarge-double-vertical-gutters > [class*=all-] { + margin-bottom: 4em; + } + + .column-group.xlarge-half-gutters { + margin-left: -1em; + } + .column-group.xlarge-half-gutters > [class*=xlarge-], .column-group.xlarge-half-gutters > [class*=all-] { + padding-left: 1em; + margin-bottom: 1em; + } + + .column-group.xlarge-half-horizontal-gutters { + margin-left: -1em; + } + .column-group.xlarge-half-horizontal-gutters > [class*=xlarge-], .column-group.xlarge-half-horizontal-gutters > [class*=all-] { + padding-left: 1em; + } + + .column-group.xlarge-half-vertical-gutters > [class*=xlarge-], .column-group.xlarge-half-vertical-gutters > [class*=all-] { + margin-bottom: 1em; + } + + .column-group.xlarge-quarter-gutters { + margin-left: -0.5em; + } + .column-group.xlarge-quarter-gutters > [class*=xlarge-], .column-group.xlarge-quarter-gutters > [class*=all-] { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + + .column-group.xlarge-quarter-horizontal-gutters { + margin-left: -0.5em; + } + .column-group.xlarge-quarter-horizontal-gutters > [class*=xlarge-], .column-group.xlarge-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.5em; + } + + .column-group.xlarge-quarter-vertical-gutters > [class*=xlarge-], .column-group.xlarge-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.5em; + } + + .column-group.xlarge-no-gutters { + margin-left: 0; + } + .column-group.xlarge-no-gutters > [class*=xlarge-], .column-group.xlarge-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; + } + + .ink-table td[class*=xlarge-], .ink-table th[class*=xlarge-], .ink-table tr[class*=xlarge-], .ink-table thead[class*=xlarge-], .ink-table tbody[class*=xlarge-], .ink-table tfoot[class*=xlarge-] { + float: none; + } + + .xlarge-push-left { + float: left; + } + + .xlarge-push-center { + float: none; + margin-left: auto; + margin-right: auto; + } + + .xlarge-push-right { + float: right; + } + + .xlarge-align-left { + text-align: left; + } + + .xlarge-align-center { + text-align: center; + } + + .xlarge-align-right { + text-align: right; + } + + .xlarge-no-margin { + margin: 0 !important; + } + + .space { + margin: 2em; + } + + .xlarge-space { + margin: 2em; + } + + .padding { + padding: 2em; + } + + .xlarge-padding { + padding: 2em; + } + + .double-space { + margin: 4em; + } + + .xlarge-double-space { + margin: 4em; + } + + .double-padding { + padding: 4em; + } + + .xlarge-double-padding { + padding: 4em; + } + + .half-space { + margin: 1em; + } + + .xlarge-half-space { + margin: 1em; + } + + .half-padding { + padding: 1em; + } + + .xlarge-half-padding { + padding: 1em; + } + + .quarter-space { + margin: 0.5em; + } + + .xlarge-quarter-space { + margin: 0.5em; + } + + .quarter-padding { + padding: 0.5em; + } + + .xlarge-quarter-padding { + padding: 0.5em; + } + + .vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + + .xlarge-vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + + .vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + + .xlarge-vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + + .double-vertical-space { + margin-top: 4em; + margin-bottom: 4em; + } + + .xlarge-double-vertical-space { + margin-top: 4em; + margin-bottom: 4em; + } + + .double-vertical-padding { + padding-top: 4em; + padding-bottom: 4em; + } + + .xlarge-double-vertical-padding { + padding-top: 4em; + padding-bottom: 4em; + } + + .half-vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + + .xlarge-half-vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + + .half-vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + + .xlarge-half-vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + + .quarter-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + .xlarge-quarter-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + .quarter-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + + .xlarge-quarter-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + + .horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + + .xlarge-horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + + .horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + + .xlarge-horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + + .double-horizontal-space { + margin-left: 4em; + margin-right: 4em; + } + + .xlarge-double-horizontal-space { + margin-left: 4em; + margin-right: 4em; + } + + .double-horizontal-padding { + padding-left: 4em; + padding-right: 4em; + } + + .xlarge-double-horizontal-padding { + padding-left: 4em; + padding-right: 4em; + } + + .half-horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + + .xlarge-half-horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + + .half-horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + + .xlarge-half-horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + + .quarter-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + + .xlarge-quarter-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + + .quarter-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + + .xlarge-quarter-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + + .top-space { + margin-top: 2em; + } + + .xlarge-top-space { + margin-top: 2em; + } + + .top-padding { + padding-top: 2em; + } + + .xlarge-top-padding { + padding-top: 2em; + } + + .double-top-space { + margin-top: 4em; + } + + .xlarge-double-top-space { + margin-top: 4em; + } + + .double-top-padding { + padding-top: 4em; + } + + .xlarge-double-top-padding { + padding-top: 4em; + } + + .half-top-space { + margin-top: 1em; + } + + .xlarge-half-top-space { + margin-top: 1em; + } + + .half-top-padding { + padding-top: 1em; + } + + .xlarge-half-top-padding { + padding-top: 1em; + } + + .quarter-top-space { + margin-top: 0.5em; + } + + .xlarge-quarter-top-space { + margin-top: 0.5em; + } + + .quarter-top-padding { + padding-top: 0.5em; + } + + .xlarge-quarter-top-padding { + padding-top: 0.5em; + } + + .right-space { + margin-right: 2em; + } + + .xlarge-right-space { + margin-right: 2em; + } + + .right-padding { + padding-right: 2em; + } + + .xlarge-right-padding { + padding-right: 2em; + } + + .double-right-space { + margin-right: 4em; + } + + .xlarge-double-right-space { + margin-right: 4em; + } + + .double-right-padding { + padding-right: 4em; + } + + .xlarge-double-right-padding { + padding-right: 4em; + } + + .half-right-space { + margin-right: 1em; + } + + .xlarge-half-right-space { + margin-right: 1em; + } + + .half-right-padding { + padding-right: 1em; + } + + .xlarge-half-right-padding { + padding-right: 1em; + } + + .quarter-right-space { + margin-right: 0.5em; + } + + .xlarge-quarter-right-space { + margin-right: 0.5em; + } + + .quarter-right-padding { + padding-right: 0.5em; + } + + .xlarge-quarter-right-padding { + padding-right: 0.5em; + } + + .bottom-space { + margin-bottom: 2em; + } + + .xlarge-bottom-space { + margin-bottom: 2em; + } + + .bottom-padding { + padding-bottom: 2em; + } + + .xlarge-bottom-padding { + padding-bottom: 2em; + } + + .double-bottom-space { + margin-bottom: 4em; + } + + .xlarge-double-bottom-space { + margin-bottom: 4em; + } + + .double-bottom-padding { + padding-bottom: 4em; + } + + .xlarge-double-bottom-padding { + padding-bottom: 4em; + } + + .half-bottom-space { + margin-bottom: 1em; + } + + .xlarge-half-bottom-space { + margin-bottom: 1em; + } + + .half-bottom-padding { + padding-bottom: 1em; + } + + .xlarge-half-bottom-padding { + padding-bottom: 1em; + } + + .quarter-bottom-space { + margin-bottom: 0.5em; + } + + .xlarge-quarter-bottom-space { + margin-bottom: 0.5em; + } + + .quarter-bottom-padding { + padding-bottom: 0.5em; + } + + .xlarge-quarter-bottom-padding { + padding-bottom: 0.5em; + } + + .left-space { + margin-left: 2em; + } + + .xlarge-left-space { + margin-left: 2em; + } + + .left-padding { + padding-left: 2em; + } + + .xlarge-left-padding { + padding-left: 2em; + } + + .double-left-space { + margin-left: 4em; + } + + .xlarge-double-left-space { + margin-left: 4em; + } + + .double-left-padding { + padding-left: 4em; + } + + .xlarge-double-left-padding { + padding-left: 4em; + } + + .half-left-space { + margin-left: 1em; + } + + .xlarge-half-left-space { + margin-left: 1em; + } + + .half-left-padding { + padding-left: 1em; + } + + .xlarge-half-left-padding { + padding-left: 1em; + } + + .quarter-left-space { + margin-left: 0.5em; + } + + .xlarge-quarter-left-space { + margin-left: 0.5em; + } + + .quarter-left-padding { + padding-left: 0.5em; + } + + .xlarge-quarter-left-padding { + padding-left: 0.5em; + } + + .hide-xlarge { + display: none !important; + } + + .show-xlarge { + display: inherit !important; + } + + table.show-xlarge { + display: table; + } + + thead.show-xlarge { + display: table-header-group; + } + + tbody.show-xlarge { + display: table-row-group; + } + + tfoot.show-xlarge { + display: table-footer-group; + } + + tr.show-xlarge { + display: table-row; + } + + th.show-xlarge, + td.show-xlarge { + display: table-cell; + } +} +@media screen and (min-width: 961px) and (max-width: 1260px) { + .ink-grid { + padding: 0 1.75em; + } + + .column-group > [class*=large-] { + float: left; + clear: none; + } + + .large-5 { + width: 5%; + } + + .large-10 { + width: 10%; + } + + .large-15 { + width: 15%; + } + + .large-16 { + width: 16.66%; + } + + .large-20 { + width: 20%; + } + + .large-25 { + width: 25%; + } + + .large-30 { + width: 30%; + } + + .large-33 { + width: 33.33%; + } + + .large-35 { + width: 35%; + } + + .large-40 { + width: 40%; + } + + .large-45 { + width: 45%; + } + + .large-50 { + width: 50%; + } + + .large-55 { + width: 55%; + } + + .large-60 { + width: 60%; + } + + .large-65 { + width: 65%; + } + + .large-66 { + width: 66.66%; + } + + .large-70 { + width: 70%; + } + + .large-75 { + width: 75%; + } + + .large-80 { + width: 80%; + } + + .large-85 { + width: 85%; + } + + .large-90 { + width: 90%; + } + + .large-95 { + width: 95%; + } + + .large-100 { + width: 100%; + } + + [class*=large-100] { + float: none; + clear: both; + } + + .column-group { + *zoom: 1; + } + .column-group:after { + content: ""; + display: table; + clear: both; + } + + .column-group.gutters { + margin-left: -1.75em; + } + .column-group.gutters > [class*=large-], .column-group.gutters > [class*=all-] { + padding-left: 1.75em; + margin-bottom: 1.75em; + } + + .column-group.horizontal-gutters { + margin-left: -1.75em; + } + .column-group.horizontal-gutters > [class*=large-], .column-group.horizontal-gutters > [class*=all-] { + padding-left: 1.75em; + } + + .column-group.vertical-gutters > [class*=large-], .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 1.75em; + } + + .column-group.double-gutters { + margin-left: -3.5em; + } + .column-group.double-gutters > [class*=large-], .column-group.double-gutters > [class*=all-] { + padding-left: 3.5em; + margin-bottom: 3.5em; + } + + .column-group.double-horizontal-gutters { + margin-left: -3.5em; + } + .column-group.double-horizontal-gutters > [class*=large-], .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 3.5em; + } + + .column-group.double-vertical-gutters > [class*=large-], .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 3.5em; + } + + .column-group.half-gutters { + margin-left: -0.875em; + } + .column-group.half-gutters > [class*=large-], .column-group.half-gutters > [class*=all-] { + padding-left: 0.875em; + margin-bottom: 0.875em; + } + + .column-group.half-horizontal-gutters { + margin-left: -0.875em; + } + .column-group.half-horizontal-gutters > [class*=large-], .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 0.875em; + } + + .column-group.half-vertical-gutters > [class*=large-], .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 0.875em; + } + + .column-group.quarter-gutters { + margin-left: -0.4375em; + } + .column-group.quarter-gutters > [class*=large-], .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.4375em; + margin-bottom: 0.4375em; + } + + .column-group.quarter-horizontal-gutters { + margin-left: -0.4375em; + } + .column-group.quarter-horizontal-gutters > [class*=large-], .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.4375em; + } + + .column-group.quarter-vertical-gutters > [class*=large-], .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.4375em; + } + + .column-group.large-gutters { + margin-left: -1.75em; + } + .column-group.large-gutters > [class*=large-], .column-group.large-gutters > [class*=all-] { + padding-left: 1.75em; + margin-bottom: 1.75em; + } + + .column-group.large-horizontal-gutters { + margin-left: -1.75em; + } + .column-group.large-horizontal-gutters > [class*=large-], .column-group.large-horizontal-gutters > [class*=all-] { + padding-left: 1.75em; + } + + .column-group.large-vertical-gutters > [class*=large-], .column-group.large-vertical-gutters > [class*=all-] { + margin-bottom: 1.75em; + } + + .column-group.large-double-gutters { + margin-left: -3.5em; + } + .column-group.large-double-gutters > [class*=large-], .column-group.large-double-gutters > [class*=all-] { + padding-left: 3.5em; + margin-bottom: 3.5em; + } + + .column-group.large-double-horizontal-gutters { + margin-left: -3.5em; + } + .column-group.large-double-horizontal-gutters > [class*=large-], .column-group.large-double-horizontal-gutters > [class*=all-] { + padding-left: 3.5em; + } + + .column-group.large-double-vertical-gutters > [class*=large-], .column-group.large-double-vertical-gutters > [class*=all-] { + margin-bottom: 3.5em; + } + + .column-group.large-half-gutters { + margin-left: -0.875em; + } + .column-group.large-half-gutters > [class*=large-], .column-group.large-half-gutters > [class*=all-] { + padding-left: 0.875em; + margin-bottom: 0.875em; + } + + .column-group.large-half-horizontal-gutters { + margin-left: -0.875em; + } + .column-group.large-half-horizontal-gutters > [class*=large-], .column-group.large-half-horizontal-gutters > [class*=all-] { + padding-left: 0.875em; + } + + .column-group.large-half-vertical-gutters > [class*=large-], .column-group.large-half-vertical-gutters > [class*=all-] { + margin-bottom: 0.875em; + } + + .column-group.large-quarter-gutters { + margin-left: -0.4375em; + } + .column-group.large-quarter-gutters > [class*=large-], .column-group.large-quarter-gutters > [class*=all-] { + padding-left: 0.4375em; + margin-bottom: 0.4375em; + } + + .column-group.large-quarter-horizontal-gutters { + margin-left: -0.4375em; + } + .column-group.large-quarter-horizontal-gutters > [class*=large-], .column-group.large-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.4375em; + } + + .column-group.large-quarter-vertical-gutters > [class*=large-], .column-group.large-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.4375em; + } + + .column-group.large-no-gutters { + margin-left: 0; + } + .column-group.large-no-gutters > [class*=large-], .column-group.large-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; + } + + .ink-table td[class*=large-], .ink-table th[class*=large-], .ink-table tr[class*=large-], .ink-table thead[class*=large-], .ink-table tbody[class*=large-], .ink-table tfoot[class*=large-] { + float: none; + } + + .large-push-left { + float: left; + } + + .large-push-center { + float: none; + margin-left: auto; + margin-right: auto; + } + + .large-push-right { + float: right; + } + + .large-align-left { + text-align: left; + } + + .large-align-center { + text-align: center; + } + + .large-align-right { + text-align: right; + } + + .large-no-margin { + margin: 0 !important; + } + + .space { + margin: 1.75em; + } + + .large-space { + margin: 1.75em; + } + + .padding { + padding: 1.75em; + } + + .large-padding { + padding: 1.75em; + } + + .double-space { + margin: 3.5em; + } + + .large-double-space { + margin: 3.5em; + } + + .double-padding { + padding: 3.5em; + } + + .large-double-padding { + padding: 3.5em; + } + + .half-space { + margin: 0.875em; + } + + .large-half-space { + margin: 0.875em; + } + + .half-padding { + padding: 0.875em; + } + + .large-half-padding { + padding: 0.875em; + } + + .quarter-space { + margin: 0.4375em; + } + + .large-quarter-space { + margin: 0.4375em; + } + + .quarter-padding { + padding: 0.4375em; + } + + .large-quarter-padding { + padding: 0.4375em; + } + + .vertical-space { + margin-top: 1.75em; + margin-bottom: 1.75em; + } + + .large-vertical-space { + margin-top: 1.75em; + margin-bottom: 1.75em; + } + + .vertical-padding { + padding-top: 1.75em; + padding-bottom: 1.75em; + } + + .large-vertical-padding { + padding-top: 1.75em; + padding-bottom: 1.75em; + } + + .double-vertical-space { + margin-top: 3.5em; + margin-bottom: 3.5em; + } + + .large-double-vertical-space { + margin-top: 3.5em; + margin-bottom: 3.5em; + } + + .double-vertical-padding { + padding-top: 3.5em; + padding-bottom: 3.5em; + } + + .large-double-vertical-padding { + padding-top: 3.5em; + padding-bottom: 3.5em; + } + + .half-vertical-space { + margin-top: 0.875em; + margin-bottom: 0.875em; + } + + .large-half-vertical-space { + margin-top: 0.875em; + margin-bottom: 0.875em; + } + + .half-vertical-padding { + padding-top: 0.875em; + padding-bottom: 0.875em; + } + + .large-half-vertical-padding { + padding-top: 0.875em; + padding-bottom: 0.875em; + } + + .quarter-vertical-space { + margin-top: 0.4375em; + margin-bottom: 0.4375em; + } + + .large-quarter-vertical-space { + margin-top: 0.4375em; + margin-bottom: 0.4375em; + } + + .quarter-vertical-padding { + padding-top: 0.4375em; + padding-bottom: 0.4375em; + } + + .large-quarter-vertical-padding { + padding-top: 0.4375em; + padding-bottom: 0.4375em; + } + + .horizontal-space { + margin-left: 1.75em; + margin-right: 1.75em; + } + + .large-horizontal-space { + margin-left: 1.75em; + margin-right: 1.75em; + } + + .horizontal-padding { + padding-left: 1.75em; + padding-right: 1.75em; + } + + .large-horizontal-padding { + padding-left: 1.75em; + padding-right: 1.75em; + } + + .double-horizontal-space { + margin-left: 3.5em; + margin-right: 3.5em; + } + + .large-double-horizontal-space { + margin-left: 3.5em; + margin-right: 3.5em; + } + + .double-horizontal-padding { + padding-left: 3.5em; + padding-right: 3.5em; + } + + .large-double-horizontal-padding { + padding-left: 3.5em; + padding-right: 3.5em; + } + + .half-horizontal-space { + margin-left: 0.875em; + margin-right: 0.875em; + } + + .large-half-horizontal-space { + margin-left: 0.875em; + margin-right: 0.875em; + } + + .half-horizontal-padding { + padding-left: 0.875em; + padding-right: 0.875em; + } + + .large-half-horizontal-padding { + padding-left: 0.875em; + padding-right: 0.875em; + } + + .quarter-horizontal-space { + margin-left: 0.4375em; + margin-right: 0.4375em; + } + + .large-quarter-horizontal-space { + margin-left: 0.4375em; + margin-right: 0.4375em; + } + + .quarter-horizontal-padding { + padding-left: 0.4375em; + padding-right: 0.4375em; + } + + .large-quarter-horizontal-padding { + padding-left: 0.4375em; + padding-right: 0.4375em; + } + + .top-space { + margin-top: 1.75em; + } + + .large-top-space { + margin-top: 1.75em; + } + + .top-padding { + padding-top: 1.75em; + } + + .large-top-padding { + padding-top: 1.75em; + } + + .double-top-space { + margin-top: 3.5em; + } + + .large-double-top-space { + margin-top: 3.5em; + } + + .double-top-padding { + padding-top: 3.5em; + } + + .large-double-top-padding { + padding-top: 3.5em; + } + + .half-top-space { + margin-top: 0.875em; + } + + .large-half-top-space { + margin-top: 0.875em; + } + + .half-top-padding { + padding-top: 0.875em; + } + + .large-half-top-padding { + padding-top: 0.875em; + } + + .quarter-top-space { + margin-top: 0.4375em; + } + + .large-quarter-top-space { + margin-top: 0.4375em; + } + + .quarter-top-padding { + padding-top: 0.4375em; + } + + .large-quarter-top-padding { + padding-top: 0.4375em; + } + + .right-space { + margin-right: 1.75em; + } + + .large-right-space { + margin-right: 1.75em; + } + + .right-padding { + padding-right: 1.75em; + } + + .large-right-padding { + padding-right: 1.75em; + } + + .double-right-space { + margin-right: 3.5em; + } + + .large-double-right-space { + margin-right: 3.5em; + } + + .double-right-padding { + padding-right: 3.5em; + } + + .large-double-right-padding { + padding-right: 3.5em; + } + + .half-right-space { + margin-right: 0.875em; + } + + .large-half-right-space { + margin-right: 0.875em; + } + + .half-right-padding { + padding-right: 0.875em; + } + + .large-half-right-padding { + padding-right: 0.875em; + } + + .quarter-right-space { + margin-right: 0.4375em; + } + + .large-quarter-right-space { + margin-right: 0.4375em; + } + + .quarter-right-padding { + padding-right: 0.4375em; + } + + .large-quarter-right-padding { + padding-right: 0.4375em; + } + + .bottom-space { + margin-bottom: 1.75em; + } + + .large-bottom-space { + margin-bottom: 1.75em; + } + + .bottom-padding { + padding-bottom: 1.75em; + } + + .large-bottom-padding { + padding-bottom: 1.75em; + } + + .double-bottom-space { + margin-bottom: 3.5em; + } + + .large-double-bottom-space { + margin-bottom: 3.5em; + } + + .double-bottom-padding { + padding-bottom: 3.5em; + } + + .large-double-bottom-padding { + padding-bottom: 3.5em; + } + + .half-bottom-space { + margin-bottom: 0.875em; + } + + .large-half-bottom-space { + margin-bottom: 0.875em; + } + + .half-bottom-padding { + padding-bottom: 0.875em; + } + + .large-half-bottom-padding { + padding-bottom: 0.875em; + } + + .quarter-bottom-space { + margin-bottom: 0.4375em; + } + + .large-quarter-bottom-space { + margin-bottom: 0.4375em; + } + + .quarter-bottom-padding { + padding-bottom: 0.4375em; + } + + .large-quarter-bottom-padding { + padding-bottom: 0.4375em; + } + + .left-space { + margin-left: 1.75em; + } + + .large-left-space { + margin-left: 1.75em; + } + + .left-padding { + padding-left: 1.75em; + } + + .large-left-padding { + padding-left: 1.75em; + } + + .double-left-space { + margin-left: 3.5em; + } + + .large-double-left-space { + margin-left: 3.5em; + } + + .double-left-padding { + padding-left: 3.5em; + } + + .large-double-left-padding { + padding-left: 3.5em; + } + + .half-left-space { + margin-left: 0.875em; + } + + .large-half-left-space { + margin-left: 0.875em; + } + + .half-left-padding { + padding-left: 0.875em; + } + + .large-half-left-padding { + padding-left: 0.875em; + } + + .quarter-left-space { + margin-left: 0.4375em; + } + + .large-quarter-left-space { + margin-left: 0.4375em; + } + + .quarter-left-padding { + padding-left: 0.4375em; + } + + .large-quarter-left-padding { + padding-left: 0.4375em; + } + + .hide-large { + display: none !important; + } + + .show-large { + display: inherit !important; + } + + table.show-large { + display: table; + } + + thead.show-large { + display: table-header-group; + } + + tbody.show-large { + display: table-row-group; + } + + tfoot.show-large { + display: table-footer-group; + } + + tr.show-large { + display: table-row; + } + + th.show-large, + td.show-large { + display: table-cell; + } +} +@media screen and (min-width: 641px) and (max-width: 960px) { + .ink-grid { + padding: 0 1.5em; + } + + .column-group > [class*=medium-] { + float: left; + clear: none; + } + + .medium-5 { + width: 5%; + } + + .medium-10 { + width: 10%; + } + + .medium-15 { + width: 15%; + } + + .medium-16 { + width: 16.66%; + } + + .medium-20 { + width: 20%; + } + + .medium-25 { + width: 25%; + } + + .medium-30 { + width: 30%; + } + + .medium-33 { + width: 33.33%; + } + + .medium-35 { + width: 35%; + } + + .medium-40 { + width: 40%; + } + + .medium-45 { + width: 45%; + } + + .medium-50 { + width: 50%; + } + + .medium-55 { + width: 55%; + } + + .medium-60 { + width: 60%; + } + + .medium-65 { + width: 65%; + } + + .medium-66 { + width: 66.66%; + } + + .medium-70 { + width: 70%; + } + + .medium-75 { + width: 75%; + } + + .medium-80 { + width: 80%; + } + + .medium-85 { + width: 85%; + } + + .medium-90 { + width: 90%; + } + + .medium-95 { + width: 95%; + } + + .medium-100 { + width: 100%; + } + + [class*=medium-100] { + float: none; + clear: both; + } + + .column-group { + *zoom: 1; + } + .column-group:after { + content: ""; + display: table; + clear: both; + } + + .column-group.gutters { + margin-left: -1.5em; + } + .column-group.gutters > [class*=medium-], .column-group.gutters > [class*=all-] { + padding-left: 1.5em; + margin-bottom: 1.5em; + } + + .column-group.horizontal-gutters { + margin-left: -1.5em; + } + .column-group.horizontal-gutters > [class*=medium-], .column-group.horizontal-gutters > [class*=all-] { + padding-left: 1.5em; + } + + .column-group.vertical-gutters > [class*=medium-], .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 1.5em; + } + + .column-group.double-gutters { + margin-left: -3em; + } + .column-group.double-gutters > [class*=medium-], .column-group.double-gutters > [class*=all-] { + padding-left: 3em; + margin-bottom: 3em; + } + + .column-group.double-horizontal-gutters { + margin-left: -3em; + } + .column-group.double-horizontal-gutters > [class*=medium-], .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 3em; + } + + .column-group.double-vertical-gutters > [class*=medium-], .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 3em; + } + + .column-group.half-gutters { + margin-left: -0.75em; + } + .column-group.half-gutters > [class*=medium-], .column-group.half-gutters > [class*=all-] { + padding-left: 0.75em; + margin-bottom: 0.75em; + } + + .column-group.half-horizontal-gutters { + margin-left: -0.75em; + } + .column-group.half-horizontal-gutters > [class*=medium-], .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 0.75em; + } + + .column-group.half-vertical-gutters > [class*=medium-], .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 0.75em; + } + + .column-group.quarter-gutters { + margin-left: -0.375em; + } + .column-group.quarter-gutters > [class*=medium-], .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.375em; + margin-bottom: 0.375em; + } + + .column-group.quarter-horizontal-gutters { + margin-left: -0.375em; + } + .column-group.quarter-horizontal-gutters > [class*=medium-], .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.375em; + } + + .column-group.quarter-vertical-gutters > [class*=medium-], .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.375em; + } + + .column-group.medium-gutters { + margin-left: -1.5em; + } + .column-group.medium-gutters > [class*=medium-], .column-group.medium-gutters > [class*=all-] { + padding-left: 1.5em; + margin-bottom: 1.5em; + } + + .column-group.medium-horizontal-gutters { + margin-left: -1.5em; + } + .column-group.medium-horizontal-gutters > [class*=medium-], .column-group.medium-horizontal-gutters > [class*=all-] { + padding-left: 1.5em; + } + + .column-group.medium-vertical-gutters > [class*=medium-], .column-group.medium-vertical-gutters > [class*=all-] { + margin-bottom: 1.5em; + } + + .column-group.medium-double-gutters { + margin-left: -3em; + } + .column-group.medium-double-gutters > [class*=medium-], .column-group.medium-double-gutters > [class*=all-] { + padding-left: 3em; + margin-bottom: 3em; + } + + .column-group.medium-double-horizontal-gutters { + margin-left: -3em; + } + .column-group.medium-double-horizontal-gutters > [class*=medium-], .column-group.medium-double-horizontal-gutters > [class*=all-] { + padding-left: 3em; + } + + .column-group.medium-double-vertical-gutters > [class*=medium-], .column-group.medium-double-vertical-gutters > [class*=all-] { + margin-bottom: 3em; + } + + .column-group.medium-half-gutters { + margin-left: -0.75em; + } + .column-group.medium-half-gutters > [class*=medium-], .column-group.medium-half-gutters > [class*=all-] { + padding-left: 0.75em; + margin-bottom: 0.75em; + } + + .column-group.medium-half-horizontal-gutters { + margin-left: -0.75em; + } + .column-group.medium-half-horizontal-gutters > [class*=medium-], .column-group.medium-half-horizontal-gutters > [class*=all-] { + padding-left: 0.75em; + } + + .column-group.medium-half-vertical-gutters > [class*=medium-], .column-group.medium-half-vertical-gutters > [class*=all-] { + margin-bottom: 0.75em; + } + + .column-group.medium-quarter-gutters { + margin-left: -0.375em; + } + .column-group.medium-quarter-gutters > [class*=medium-], .column-group.medium-quarter-gutters > [class*=all-] { + padding-left: 0.375em; + margin-bottom: 0.375em; + } + + .column-group.medium-quarter-horizontal-gutters { + margin-left: -0.375em; + } + .column-group.medium-quarter-horizontal-gutters > [class*=medium-], .column-group.medium-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.375em; + } + + .column-group.medium-quarter-vertical-gutters > [class*=medium-], .column-group.medium-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.375em; + } + + .column-group.medium-no-gutters { + margin-left: 0; + } + .column-group.medium-no-gutters > [class*=medium-], .column-group.medium-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; + } + + .ink-table td[class*=medium-], .ink-table th[class*=medium-], .ink-table tr[class*=medium-], .ink-table thead[class*=medium-], .ink-table tbody[class*=medium-], .ink-table tfoot[class*=medium-] { + float: none; + } + + .medium-push-left { + float: left; + } + + .medium-push-center { + float: none; + margin-left: auto; + margin-right: auto; + } + + .medium-push-right { + float: right; + } + + .medium-align-left { + text-align: left; + } + + .medium-align-center { + text-align: center; + } + + .medium-align-right { + text-align: right; + } + + .medium-no-margin { + margin: 0 !important; + } + + .space { + margin: 1.5em; + } + + .medium-space { + margin: 1.5em; + } + + .padding { + padding: 1.5em; + } + + .medium-padding { + padding: 1.5em; + } + + .double-space { + margin: 3em; + } + + .medium-double-space { + margin: 3em; + } + + .double-padding { + padding: 3em; + } + + .medium-double-padding { + padding: 3em; + } + + .half-space { + margin: 0.75em; + } + + .medium-half-space { + margin: 0.75em; + } + + .half-padding { + padding: 0.75em; + } + + .medium-half-padding { + padding: 0.75em; + } + + .quarter-space { + margin: 0.375em; + } + + .medium-quarter-space { + margin: 0.375em; + } + + .quarter-padding { + padding: 0.375em; + } + + .medium-quarter-padding { + padding: 0.375em; + } + + .vertical-space { + margin-top: 1.5em; + margin-bottom: 1.5em; + } + + .medium-vertical-space { + margin-top: 1.5em; + margin-bottom: 1.5em; + } + + .vertical-padding { + padding-top: 1.5em; + padding-bottom: 1.5em; + } + + .medium-vertical-padding { + padding-top: 1.5em; + padding-bottom: 1.5em; + } + + .double-vertical-space { + margin-top: 3em; + margin-bottom: 3em; + } + + .medium-double-vertical-space { + margin-top: 3em; + margin-bottom: 3em; + } + + .double-vertical-padding { + padding-top: 3em; + padding-bottom: 3em; + } + + .medium-double-vertical-padding { + padding-top: 3em; + padding-bottom: 3em; + } + + .half-vertical-space { + margin-top: 0.75em; + margin-bottom: 0.75em; + } + + .medium-half-vertical-space { + margin-top: 0.75em; + margin-bottom: 0.75em; + } + + .half-vertical-padding { + padding-top: 0.75em; + padding-bottom: 0.75em; + } + + .medium-half-vertical-padding { + padding-top: 0.75em; + padding-bottom: 0.75em; + } + + .quarter-vertical-space { + margin-top: 0.375em; + margin-bottom: 0.375em; + } + + .medium-quarter-vertical-space { + margin-top: 0.375em; + margin-bottom: 0.375em; + } + + .quarter-vertical-padding { + padding-top: 0.375em; + padding-bottom: 0.375em; + } + + .medium-quarter-vertical-padding { + padding-top: 0.375em; + padding-bottom: 0.375em; + } + + .horizontal-space { + margin-left: 1.5em; + margin-right: 1.5em; + } + + .medium-horizontal-space { + margin-left: 1.5em; + margin-right: 1.5em; + } + + .horizontal-padding { + padding-left: 1.5em; + padding-right: 1.5em; + } + + .medium-horizontal-padding { + padding-left: 1.5em; + padding-right: 1.5em; + } + + .double-horizontal-space { + margin-left: 3em; + margin-right: 3em; + } + + .medium-double-horizontal-space { + margin-left: 3em; + margin-right: 3em; + } + + .double-horizontal-padding { + padding-left: 3em; + padding-right: 3em; + } + + .medium-double-horizontal-padding { + padding-left: 3em; + padding-right: 3em; + } + + .half-horizontal-space { + margin-left: 0.75em; + margin-right: 0.75em; + } + + .medium-half-horizontal-space { + margin-left: 0.75em; + margin-right: 0.75em; + } + + .half-horizontal-padding { + padding-left: 0.75em; + padding-right: 0.75em; + } + + .medium-half-horizontal-padding { + padding-left: 0.75em; + padding-right: 0.75em; + } + + .quarter-horizontal-space { + margin-left: 0.375em; + margin-right: 0.375em; + } + + .medium-quarter-horizontal-space { + margin-left: 0.375em; + margin-right: 0.375em; + } + + .quarter-horizontal-padding { + padding-left: 0.375em; + padding-right: 0.375em; + } + + .medium-quarter-horizontal-padding { + padding-left: 0.375em; + padding-right: 0.375em; + } + + .top-space { + margin-top: 1.5em; + } + + .medium-top-space { + margin-top: 1.5em; + } + + .top-padding { + padding-top: 1.5em; + } + + .medium-top-padding { + padding-top: 1.5em; + } + + .double-top-space { + margin-top: 3em; + } + + .medium-double-top-space { + margin-top: 3em; + } + + .double-top-padding { + padding-top: 3em; + } + + .medium-double-top-padding { + padding-top: 3em; + } + + .half-top-space { + margin-top: 0.75em; + } + + .medium-half-top-space { + margin-top: 0.75em; + } + + .half-top-padding { + padding-top: 0.75em; + } + + .medium-half-top-padding { + padding-top: 0.75em; + } + + .quarter-top-space { + margin-top: 0.375em; + } + + .medium-quarter-top-space { + margin-top: 0.375em; + } + + .quarter-top-padding { + padding-top: 0.375em; + } + + .medium-quarter-top-padding { + padding-top: 0.375em; + } + + .right-space { + margin-right: 1.5em; + } + + .medium-right-space { + margin-right: 1.5em; + } + + .right-padding { + padding-right: 1.5em; + } + + .medium-right-padding { + padding-right: 1.5em; + } + + .double-right-space { + margin-right: 3em; + } + + .medium-double-right-space { + margin-right: 3em; + } + + .double-right-padding { + padding-right: 3em; + } + + .medium-double-right-padding { + padding-right: 3em; + } + + .half-right-space { + margin-right: 0.75em; + } + + .medium-half-right-space { + margin-right: 0.75em; + } + + .half-right-padding { + padding-right: 0.75em; + } + + .medium-half-right-padding { + padding-right: 0.75em; + } + + .quarter-right-space { + margin-right: 0.375em; + } + + .medium-quarter-right-space { + margin-right: 0.375em; + } + + .quarter-right-padding { + padding-right: 0.375em; + } + + .medium-quarter-right-padding { + padding-right: 0.375em; + } + + .bottom-space { + margin-bottom: 1.5em; + } + + .medium-bottom-space { + margin-bottom: 1.5em; + } + + .bottom-padding { + padding-bottom: 1.5em; + } + + .medium-bottom-padding { + padding-bottom: 1.5em; + } + + .double-bottom-space { + margin-bottom: 3em; + } + + .medium-double-bottom-space { + margin-bottom: 3em; + } + + .double-bottom-padding { + padding-bottom: 3em; + } + + .medium-double-bottom-padding { + padding-bottom: 3em; + } + + .half-bottom-space { + margin-bottom: 0.75em; + } + + .medium-half-bottom-space { + margin-bottom: 0.75em; + } + + .half-bottom-padding { + padding-bottom: 0.75em; + } + + .medium-half-bottom-padding { + padding-bottom: 0.75em; + } + + .quarter-bottom-space { + margin-bottom: 0.375em; + } + + .medium-quarter-bottom-space { + margin-bottom: 0.375em; + } + + .quarter-bottom-padding { + padding-bottom: 0.375em; + } + + .medium-quarter-bottom-padding { + padding-bottom: 0.375em; + } + + .left-space { + margin-left: 1.5em; + } + + .medium-left-space { + margin-left: 1.5em; + } + + .left-padding { + padding-left: 1.5em; + } + + .medium-left-padding { + padding-left: 1.5em; + } + + .double-left-space { + margin-left: 3em; + } + + .medium-double-left-space { + margin-left: 3em; + } + + .double-left-padding { + padding-left: 3em; + } + + .medium-double-left-padding { + padding-left: 3em; + } + + .half-left-space { + margin-left: 0.75em; + } + + .medium-half-left-space { + margin-left: 0.75em; + } + + .half-left-padding { + padding-left: 0.75em; + } + + .medium-half-left-padding { + padding-left: 0.75em; + } + + .quarter-left-space { + margin-left: 0.375em; + } + + .medium-quarter-left-space { + margin-left: 0.375em; + } + + .quarter-left-padding { + padding-left: 0.375em; + } + + .medium-quarter-left-padding { + padding-left: 0.375em; + } + + .hide-medium { + display: none !important; + } + + .show-medium { + display: inherit !important; + } + + table.show-medium { + display: table; + } + + thead.show-medium { + display: table-header-group; + } + + tbody.show-medium { + display: table-row-group; + } + + tfoot.show-medium { + display: table-footer-group; + } + + tr.show-medium { + display: table-row; + } + + th.show-medium, + td.show-medium { + display: table-cell; + } +} +@media screen and (min-width: 321px) and (max-width: 640px) { + .ink-grid { + padding: 0 1.25em; + } + + .column-group > [class*=small-] { + float: left; + clear: none; + } + + .small-5 { + width: 5%; + } + + .small-10 { + width: 10%; + } + + .small-15 { + width: 15%; + } + + .small-16 { + width: 16.66%; + } + + .small-20 { + width: 20%; + } + + .small-25 { + width: 25%; + } + + .small-30 { + width: 30%; + } + + .small-33 { + width: 33.33%; + } + + .small-35 { + width: 35%; + } + + .small-40 { + width: 40%; + } + + .small-45 { + width: 45%; + } + + .small-50 { + width: 50%; + } + + .small-55 { + width: 55%; + } + + .small-60 { + width: 60%; + } + + .small-65 { + width: 65%; + } + + .small-66 { + width: 66.66%; + } + + .small-70 { + width: 70%; + } + + .small-75 { + width: 75%; + } + + .small-80 { + width: 80%; + } + + .small-85 { + width: 85%; + } + + .small-90 { + width: 90%; + } + + .small-95 { + width: 95%; + } + + .small-100 { + width: 100%; + } + + [class*=small-100] { + float: none; + clear: both; + } + + .column-group { + *zoom: 1; + } + .column-group:after { + content: ""; + display: table; + clear: both; + } + + .column-group.gutters { + margin-left: -1.25em; + } + .column-group.gutters > [class*=small-], .column-group.gutters > [class*=all-] { + padding-left: 1.25em; + margin-bottom: 1.25em; + } + + .column-group.horizontal-gutters { + margin-left: -1.25em; + } + .column-group.horizontal-gutters > [class*=small-], .column-group.horizontal-gutters > [class*=all-] { + padding-left: 1.25em; + } + + .column-group.vertical-gutters > [class*=small-], .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 1.25em; + } + + .column-group.double-gutters { + margin-left: -2.5em; + } + .column-group.double-gutters > [class*=small-], .column-group.double-gutters > [class*=all-] { + padding-left: 2.5em; + margin-bottom: 2.5em; + } + + .column-group.double-horizontal-gutters { + margin-left: -2.5em; + } + .column-group.double-horizontal-gutters > [class*=small-], .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 2.5em; + } + + .column-group.double-vertical-gutters > [class*=small-], .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 2.5em; + } + + .column-group.half-gutters { + margin-left: -0.625em; + } + .column-group.half-gutters > [class*=small-], .column-group.half-gutters > [class*=all-] { + padding-left: 0.625em; + margin-bottom: 0.625em; + } + + .column-group.half-horizontal-gutters { + margin-left: -0.625em; + } + .column-group.half-horizontal-gutters > [class*=small-], .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 0.625em; + } + + .column-group.half-vertical-gutters > [class*=small-], .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 0.625em; + } + + .column-group.quarter-gutters { + margin-left: -0.3125em; + } + .column-group.quarter-gutters > [class*=small-], .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.3125em; + margin-bottom: 0.3125em; + } + + .column-group.quarter-horizontal-gutters { + margin-left: -0.3125em; + } + .column-group.quarter-horizontal-gutters > [class*=small-], .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.3125em; + } + + .column-group.quarter-vertical-gutters > [class*=small-], .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.3125em; + } + + .column-group.small-gutters { + margin-left: -1.25em; + } + .column-group.small-gutters > [class*=small-], .column-group.small-gutters > [class*=all-] { + padding-left: 1.25em; + margin-bottom: 1.25em; + } + + .column-group.small-horizontal-gutters { + margin-left: -1.25em; + } + .column-group.small-horizontal-gutters > [class*=small-], .column-group.small-horizontal-gutters > [class*=all-] { + padding-left: 1.25em; + } + + .column-group.small-vertical-gutters > [class*=small-], .column-group.small-vertical-gutters > [class*=all-] { + margin-bottom: 1.25em; + } + + .column-group.small-double-gutters { + margin-left: -2.5em; + } + .column-group.small-double-gutters > [class*=small-], .column-group.small-double-gutters > [class*=all-] { + padding-left: 2.5em; + margin-bottom: 2.5em; + } + + .column-group.small-double-horizontal-gutters { + margin-left: -2.5em; + } + .column-group.small-double-horizontal-gutters > [class*=small-], .column-group.small-double-horizontal-gutters > [class*=all-] { + padding-left: 2.5em; + } + + .column-group.small-double-vertical-gutters > [class*=small-], .column-group.small-double-vertical-gutters > [class*=all-] { + margin-bottom: 2.5em; + } + + .column-group.small-half-gutters { + margin-left: -0.625em; + } + .column-group.small-half-gutters > [class*=small-], .column-group.small-half-gutters > [class*=all-] { + padding-left: 0.625em; + margin-bottom: 0.625em; + } + + .column-group.small-half-horizontal-gutters { + margin-left: -0.625em; + } + .column-group.small-half-horizontal-gutters > [class*=small-], .column-group.small-half-horizontal-gutters > [class*=all-] { + padding-left: 0.625em; + } + + .column-group.small-half-vertical-gutters > [class*=small-], .column-group.small-half-vertical-gutters > [class*=all-] { + margin-bottom: 0.625em; + } + + .column-group.small-quarter-gutters { + margin-left: -0.3125em; + } + .column-group.small-quarter-gutters > [class*=small-], .column-group.small-quarter-gutters > [class*=all-] { + padding-left: 0.3125em; + margin-bottom: 0.3125em; + } + + .column-group.small-quarter-horizontal-gutters { + margin-left: -0.3125em; + } + .column-group.small-quarter-horizontal-gutters > [class*=small-], .column-group.small-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.3125em; + } + + .column-group.small-quarter-vertical-gutters > [class*=small-], .column-group.small-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.3125em; + } + + .column-group.small-no-gutters { + margin-left: 0; + } + .column-group.small-no-gutters > [class*=small-], .column-group.small-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; + } + + .ink-table td[class*=small-], .ink-table th[class*=small-], .ink-table tr[class*=small-], .ink-table thead[class*=small-], .ink-table tbody[class*=small-], .ink-table tfoot[class*=small-] { + float: none; + } + + .small-push-left { + float: left; + } + + .small-push-center { + float: none; + margin-left: auto; + margin-right: auto; + } + + .small-push-right { + float: right; + } + + .small-align-left { + text-align: left; + } + + .small-align-center { + text-align: center; + } + + .small-align-right { + text-align: right; + } + + .small-no-margin { + margin: 0 !important; + } + + .space { + margin: 1.25em; + } + + .small-space { + margin: 1.25em; + } + + .padding { + padding: 1.25em; + } + + .small-padding { + padding: 1.25em; + } + + .double-space { + margin: 2.5em; + } + + .small-double-space { + margin: 2.5em; + } + + .double-padding { + padding: 2.5em; + } + + .small-double-padding { + padding: 2.5em; + } + + .half-space { + margin: 0.625em; + } + + .small-half-space { + margin: 0.625em; + } + + .half-padding { + padding: 0.625em; + } + + .small-half-padding { + padding: 0.625em; + } + + .quarter-space { + margin: 0.3125em; + } + + .small-quarter-space { + margin: 0.3125em; + } + + .quarter-padding { + padding: 0.3125em; + } + + .small-quarter-padding { + padding: 0.3125em; + } + + .vertical-space { + margin-top: 1.25em; + margin-bottom: 1.25em; + } + + .small-vertical-space { + margin-top: 1.25em; + margin-bottom: 1.25em; + } + + .vertical-padding { + padding-top: 1.25em; + padding-bottom: 1.25em; + } + + .small-vertical-padding { + padding-top: 1.25em; + padding-bottom: 1.25em; + } + + .double-vertical-space { + margin-top: 2.5em; + margin-bottom: 2.5em; + } + + .small-double-vertical-space { + margin-top: 2.5em; + margin-bottom: 2.5em; + } + + .double-vertical-padding { + padding-top: 2.5em; + padding-bottom: 2.5em; + } + + .small-double-vertical-padding { + padding-top: 2.5em; + padding-bottom: 2.5em; + } + + .half-vertical-space { + margin-top: 0.625em; + margin-bottom: 0.625em; + } + + .small-half-vertical-space { + margin-top: 0.625em; + margin-bottom: 0.625em; + } + + .half-vertical-padding { + padding-top: 0.625em; + padding-bottom: 0.625em; + } + + .small-half-vertical-padding { + padding-top: 0.625em; + padding-bottom: 0.625em; + } + + .quarter-vertical-space { + margin-top: 0.3125em; + margin-bottom: 0.3125em; + } + + .small-quarter-vertical-space { + margin-top: 0.3125em; + margin-bottom: 0.3125em; + } + + .quarter-vertical-padding { + padding-top: 0.3125em; + padding-bottom: 0.3125em; + } + + .small-quarter-vertical-padding { + padding-top: 0.3125em; + padding-bottom: 0.3125em; + } + + .horizontal-space { + margin-left: 1.25em; + margin-right: 1.25em; + } + + .small-horizontal-space { + margin-left: 1.25em; + margin-right: 1.25em; + } + + .horizontal-padding { + padding-left: 1.25em; + padding-right: 1.25em; + } + + .small-horizontal-padding { + padding-left: 1.25em; + padding-right: 1.25em; + } + + .double-horizontal-space { + margin-left: 2.5em; + margin-right: 2.5em; + } + + .small-double-horizontal-space { + margin-left: 2.5em; + margin-right: 2.5em; + } + + .double-horizontal-padding { + padding-left: 2.5em; + padding-right: 2.5em; + } + + .small-double-horizontal-padding { + padding-left: 2.5em; + padding-right: 2.5em; + } + + .half-horizontal-space { + margin-left: 0.625em; + margin-right: 0.625em; + } + + .small-half-horizontal-space { + margin-left: 0.625em; + margin-right: 0.625em; + } + + .half-horizontal-padding { + padding-left: 0.625em; + padding-right: 0.625em; + } + + .small-half-horizontal-padding { + padding-left: 0.625em; + padding-right: 0.625em; + } + + .quarter-horizontal-space { + margin-left: 0.3125em; + margin-right: 0.3125em; + } + + .small-quarter-horizontal-space { + margin-left: 0.3125em; + margin-right: 0.3125em; + } + + .quarter-horizontal-padding { + padding-left: 0.3125em; + padding-right: 0.3125em; + } + + .small-quarter-horizontal-padding { + padding-left: 0.3125em; + padding-right: 0.3125em; + } + + .top-space { + margin-top: 1.25em; + } + + .small-top-space { + margin-top: 1.25em; + } + + .top-padding { + padding-top: 1.25em; + } + + .small-top-padding { + padding-top: 1.25em; + } + + .double-top-space { + margin-top: 2.5em; + } + + .small-double-top-space { + margin-top: 2.5em; + } + + .double-top-padding { + padding-top: 2.5em; + } + + .small-double-top-padding { + padding-top: 2.5em; + } + + .half-top-space { + margin-top: 0.625em; + } + + .small-half-top-space { + margin-top: 0.625em; + } + + .half-top-padding { + padding-top: 0.625em; + } + + .small-half-top-padding { + padding-top: 0.625em; + } + + .quarter-top-space { + margin-top: 0.3125em; + } + + .small-quarter-top-space { + margin-top: 0.3125em; + } + + .quarter-top-padding { + padding-top: 0.3125em; + } + + .small-quarter-top-padding { + padding-top: 0.3125em; + } + + .right-space { + margin-right: 1.25em; + } + + .small-right-space { + margin-right: 1.25em; + } + + .right-padding { + padding-right: 1.25em; + } + + .small-right-padding { + padding-right: 1.25em; + } + + .double-right-space { + margin-right: 2.5em; + } + + .small-double-right-space { + margin-right: 2.5em; + } + + .double-right-padding { + padding-right: 2.5em; + } + + .small-double-right-padding { + padding-right: 2.5em; + } + + .half-right-space { + margin-right: 0.625em; + } + + .small-half-right-space { + margin-right: 0.625em; + } + + .half-right-padding { + padding-right: 0.625em; + } + + .small-half-right-padding { + padding-right: 0.625em; + } + + .quarter-right-space { + margin-right: 0.3125em; + } + + .small-quarter-right-space { + margin-right: 0.3125em; + } + + .quarter-right-padding { + padding-right: 0.3125em; + } + + .small-quarter-right-padding { + padding-right: 0.3125em; + } + + .bottom-space { + margin-bottom: 1.25em; + } + + .small-bottom-space { + margin-bottom: 1.25em; + } + + .bottom-padding { + padding-bottom: 1.25em; + } + + .small-bottom-padding { + padding-bottom: 1.25em; + } + + .double-bottom-space { + margin-bottom: 2.5em; + } + + .small-double-bottom-space { + margin-bottom: 2.5em; + } + + .double-bottom-padding { + padding-bottom: 2.5em; + } + + .small-double-bottom-padding { + padding-bottom: 2.5em; + } + + .half-bottom-space { + margin-bottom: 0.625em; + } + + .small-half-bottom-space { + margin-bottom: 0.625em; + } + + .half-bottom-padding { + padding-bottom: 0.625em; + } + + .small-half-bottom-padding { + padding-bottom: 0.625em; + } + + .quarter-bottom-space { + margin-bottom: 0.3125em; + } + + .small-quarter-bottom-space { + margin-bottom: 0.3125em; + } + + .quarter-bottom-padding { + padding-bottom: 0.3125em; + } + + .small-quarter-bottom-padding { + padding-bottom: 0.3125em; + } + + .left-space { + margin-left: 1.25em; + } + + .small-left-space { + margin-left: 1.25em; + } + + .left-padding { + padding-left: 1.25em; + } + + .small-left-padding { + padding-left: 1.25em; + } + + .double-left-space { + margin-left: 2.5em; + } + + .small-double-left-space { + margin-left: 2.5em; + } + + .double-left-padding { + padding-left: 2.5em; + } + + .small-double-left-padding { + padding-left: 2.5em; + } + + .half-left-space { + margin-left: 0.625em; + } + + .small-half-left-space { + margin-left: 0.625em; + } + + .half-left-padding { + padding-left: 0.625em; + } + + .small-half-left-padding { + padding-left: 0.625em; + } + + .quarter-left-space { + margin-left: 0.3125em; + } + + .small-quarter-left-space { + margin-left: 0.3125em; + } + + .quarter-left-padding { + padding-left: 0.3125em; + } + + .small-quarter-left-padding { + padding-left: 0.3125em; + } + + .hide-small { + display: none !important; + } + + .show-small { + display: inherit !important; + } + + table.show-small { + display: table; + } + + thead.show-small { + display: table-header-group; + } + + tbody.show-small { + display: table-row-group; + } + + tfoot.show-small { + display: table-footer-group; + } + + tr.show-small { + display: table-row; + } + + th.show-small, + td.show-small { + display: table-cell; + } +} +@media screen and (max-width: 320px) { + .ink-grid { + padding: 0 1em; + } + + .column-group > [class*=tiny-] { + float: left; + clear: none; + } + + .tiny-5 { + width: 5%; + } + + .tiny-10 { + width: 10%; + } + + .tiny-15 { + width: 15%; + } + + .tiny-16 { + width: 16.66%; + } + + .tiny-20 { + width: 20%; + } + + .tiny-25 { + width: 25%; + } + + .tiny-30 { + width: 30%; + } + + .tiny-33 { + width: 33.33%; + } + + .tiny-35 { + width: 35%; + } + + .tiny-40 { + width: 40%; + } + + .tiny-45 { + width: 45%; + } + + .tiny-50 { + width: 50%; + } + + .tiny-55 { + width: 55%; + } + + .tiny-60 { + width: 60%; + } + + .tiny-65 { + width: 65%; + } + + .tiny-66 { + width: 66.66%; + } + + .tiny-70 { + width: 70%; + } + + .tiny-75 { + width: 75%; + } + + .tiny-80 { + width: 80%; + } + + .tiny-85 { + width: 85%; + } + + .tiny-90 { + width: 90%; + } + + .tiny-95 { + width: 95%; + } + + .tiny-100 { + width: 100%; + } + + [class*=tiny-100] { + float: none; + clear: both; + } + + .column-group { + *zoom: 1; + } + .column-group:after { + content: ""; + display: table; + clear: both; + } + + .column-group.gutters { + margin-left: -1em; + } + .column-group.gutters > [class*=tiny-], .column-group.gutters > [class*=all-] { + padding-left: 1em; + margin-bottom: 1em; + } + + .column-group.horizontal-gutters { + margin-left: -1em; + } + .column-group.horizontal-gutters > [class*=tiny-], .column-group.horizontal-gutters > [class*=all-] { + padding-left: 1em; + } + + .column-group.vertical-gutters > [class*=tiny-], .column-group.vertical-gutters > [class*=all-] { + margin-bottom: 1em; + } + + .column-group.double-gutters { + margin-left: -2em; + } + .column-group.double-gutters > [class*=tiny-], .column-group.double-gutters > [class*=all-] { + padding-left: 2em; + margin-bottom: 2em; + } + + .column-group.double-horizontal-gutters { + margin-left: -2em; + } + .column-group.double-horizontal-gutters > [class*=tiny-], .column-group.double-horizontal-gutters > [class*=all-] { + padding-left: 2em; + } + + .column-group.double-vertical-gutters > [class*=tiny-], .column-group.double-vertical-gutters > [class*=all-] { + margin-bottom: 2em; + } + + .column-group.half-gutters { + margin-left: -0.5em; + } + .column-group.half-gutters > [class*=tiny-], .column-group.half-gutters > [class*=all-] { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + + .column-group.half-horizontal-gutters { + margin-left: -0.5em; + } + .column-group.half-horizontal-gutters > [class*=tiny-], .column-group.half-horizontal-gutters > [class*=all-] { + padding-left: 0.5em; + } + + .column-group.half-vertical-gutters > [class*=tiny-], .column-group.half-vertical-gutters > [class*=all-] { + margin-bottom: 0.5em; + } + + .column-group.quarter-gutters { + margin-left: -0.25em; + } + .column-group.quarter-gutters > [class*=tiny-], .column-group.quarter-gutters > [class*=all-] { + padding-left: 0.25em; + margin-bottom: 0.25em; + } + + .column-group.quarter-horizontal-gutters { + margin-left: -0.25em; + } + .column-group.quarter-horizontal-gutters > [class*=tiny-], .column-group.quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.25em; + } + + .column-group.quarter-vertical-gutters > [class*=tiny-], .column-group.quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.25em; + } + + .column-group.tiny-gutters { + margin-left: -1em; + } + .column-group.tiny-gutters > [class*=tiny-], .column-group.tiny-gutters > [class*=all-] { + padding-left: 1em; + margin-bottom: 1em; + } + + .column-group.tiny-horizontal-gutters { + margin-left: -1em; + } + .column-group.tiny-horizontal-gutters > [class*=tiny-], .column-group.tiny-horizontal-gutters > [class*=all-] { + padding-left: 1em; + } + + .column-group.tiny-vertical-gutters > [class*=tiny-], .column-group.tiny-vertical-gutters > [class*=all-] { + margin-bottom: 1em; + } + + .column-group.tiny-double-gutters { + margin-left: -2em; + } + .column-group.tiny-double-gutters > [class*=tiny-], .column-group.tiny-double-gutters > [class*=all-] { + padding-left: 2em; + margin-bottom: 2em; + } + + .column-group.tiny-double-horizontal-gutters { + margin-left: -2em; + } + .column-group.tiny-double-horizontal-gutters > [class*=tiny-], .column-group.tiny-double-horizontal-gutters > [class*=all-] { + padding-left: 2em; + } + + .column-group.tiny-double-vertical-gutters > [class*=tiny-], .column-group.tiny-double-vertical-gutters > [class*=all-] { + margin-bottom: 2em; + } + + .column-group.tiny-half-gutters { + margin-left: -0.5em; + } + .column-group.tiny-half-gutters > [class*=tiny-], .column-group.tiny-half-gutters > [class*=all-] { + padding-left: 0.5em; + margin-bottom: 0.5em; + } + + .column-group.tiny-half-horizontal-gutters { + margin-left: -0.5em; + } + .column-group.tiny-half-horizontal-gutters > [class*=tiny-], .column-group.tiny-half-horizontal-gutters > [class*=all-] { + padding-left: 0.5em; + } + + .column-group.tiny-half-vertical-gutters > [class*=tiny-], .column-group.tiny-half-vertical-gutters > [class*=all-] { + margin-bottom: 0.5em; + } + + .column-group.tiny-quarter-gutters { + margin-left: -0.25em; + } + .column-group.tiny-quarter-gutters > [class*=tiny-], .column-group.tiny-quarter-gutters > [class*=all-] { + padding-left: 0.25em; + margin-bottom: 0.25em; + } + + .column-group.tiny-quarter-horizontal-gutters { + margin-left: -0.25em; + } + .column-group.tiny-quarter-horizontal-gutters > [class*=tiny-], .column-group.tiny-quarter-horizontal-gutters > [class*=all-] { + padding-left: 0.25em; + } + + .column-group.tiny-quarter-vertical-gutters > [class*=tiny-], .column-group.tiny-quarter-vertical-gutters > [class*=all-] { + margin-bottom: 0.25em; + } + + .column-group.tiny-no-gutters { + margin-left: 0; + } + .column-group.tiny-no-gutters > [class*=tiny-], .column-group.tiny-no-gutters > [class*=all-] { + padding-left: 0; + margin-bottom: 0; + } + + .ink-table td[class*=tiny-], .ink-table th[class*=tiny-], .ink-table tr[class*=tiny-], .ink-table thead[class*=tiny-], .ink-table tbody[class*=tiny-], .ink-table tfoot[class*=tiny-] { + float: none; + } + + .tiny-push-left { + float: left; + } + + .tiny-push-center { + float: none; + margin-left: auto; + margin-right: auto; + } + + .tiny-push-right { + float: right; + } + + .tiny-align-left { + text-align: left; + } + + .tiny-align-center { + text-align: center; + } + + .tiny-align-right { + text-align: right; + } + + .tiny-no-margin { + margin: 0 !important; + } + + .space { + margin: 1em; + } + + .tiny-space { + margin: 1em; + } + + .padding { + padding: 1em; + } + + .tiny-padding { + padding: 1em; + } + + .double-space { + margin: 2em; + } + + .tiny-double-space { + margin: 2em; + } + + .double-padding { + padding: 2em; + } + + .tiny-double-padding { + padding: 2em; + } + + .half-space { + margin: 0.5em; + } + + .tiny-half-space { + margin: 0.5em; + } + + .half-padding { + padding: 0.5em; + } + + .tiny-half-padding { + padding: 0.5em; + } + + .quarter-space { + margin: 0.25em; + } + + .tiny-quarter-space { + margin: 0.25em; + } + + .quarter-padding { + padding: 0.25em; + } + + .tiny-quarter-padding { + padding: 0.25em; + } + + .vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + + .tiny-vertical-space { + margin-top: 1em; + margin-bottom: 1em; + } + + .vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + + .tiny-vertical-padding { + padding-top: 1em; + padding-bottom: 1em; + } + + .double-vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + + .tiny-double-vertical-space { + margin-top: 2em; + margin-bottom: 2em; + } + + .double-vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + + .tiny-double-vertical-padding { + padding-top: 2em; + padding-bottom: 2em; + } + + .half-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + .tiny-half-vertical-space { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + .half-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + + .tiny-half-vertical-padding { + padding-top: 0.5em; + padding-bottom: 0.5em; + } + + .quarter-vertical-space { + margin-top: 0.25em; + margin-bottom: 0.25em; + } + + .tiny-quarter-vertical-space { + margin-top: 0.25em; + margin-bottom: 0.25em; + } + + .quarter-vertical-padding { + padding-top: 0.25em; + padding-bottom: 0.25em; + } + + .tiny-quarter-vertical-padding { + padding-top: 0.25em; + padding-bottom: 0.25em; + } + + .horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + + .tiny-horizontal-space { + margin-left: 1em; + margin-right: 1em; + } + + .horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + + .tiny-horizontal-padding { + padding-left: 1em; + padding-right: 1em; + } + + .double-horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + + .tiny-double-horizontal-space { + margin-left: 2em; + margin-right: 2em; + } + + .double-horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + + .tiny-double-horizontal-padding { + padding-left: 2em; + padding-right: 2em; + } + + .half-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + + .tiny-half-horizontal-space { + margin-left: 0.5em; + margin-right: 0.5em; + } + + .half-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + + .tiny-half-horizontal-padding { + padding-left: 0.5em; + padding-right: 0.5em; + } + + .quarter-horizontal-space { + margin-left: 0.25em; + margin-right: 0.25em; + } + + .tiny-quarter-horizontal-space { + margin-left: 0.25em; + margin-right: 0.25em; + } + + .quarter-horizontal-padding { + padding-left: 0.25em; + padding-right: 0.25em; + } + + .tiny-quarter-horizontal-padding { + padding-left: 0.25em; + padding-right: 0.25em; + } + + .top-space { + margin-top: 1em; + } + + .tiny-top-space { + margin-top: 1em; + } + + .top-padding { + padding-top: 1em; + } + + .tiny-top-padding { + padding-top: 1em; + } + + .double-top-space { + margin-top: 2em; + } + + .tiny-double-top-space { + margin-top: 2em; + } + + .double-top-padding { + padding-top: 2em; + } + + .tiny-double-top-padding { + padding-top: 2em; + } + + .half-top-space { + margin-top: 0.5em; + } + + .tiny-half-top-space { + margin-top: 0.5em; + } + + .half-top-padding { + padding-top: 0.5em; + } + + .tiny-half-top-padding { + padding-top: 0.5em; + } + + .quarter-top-space { + margin-top: 0.25em; + } + + .tiny-quarter-top-space { + margin-top: 0.25em; + } + + .quarter-top-padding { + padding-top: 0.25em; + } + + .tiny-quarter-top-padding { + padding-top: 0.25em; + } + + .right-space { + margin-right: 1em; + } + + .tiny-right-space { + margin-right: 1em; + } + + .right-padding { + padding-right: 1em; + } + + .tiny-right-padding { + padding-right: 1em; + } + + .double-right-space { + margin-right: 2em; + } + + .tiny-double-right-space { + margin-right: 2em; + } + + .double-right-padding { + padding-right: 2em; + } + + .tiny-double-right-padding { + padding-right: 2em; + } + + .half-right-space { + margin-right: 0.5em; + } + + .tiny-half-right-space { + margin-right: 0.5em; + } + + .half-right-padding { + padding-right: 0.5em; + } + + .tiny-half-right-padding { + padding-right: 0.5em; + } + + .quarter-right-space { + margin-right: 0.25em; + } + + .tiny-quarter-right-space { + margin-right: 0.25em; + } + + .quarter-right-padding { + padding-right: 0.25em; + } + + .tiny-quarter-right-padding { + padding-right: 0.25em; + } + + .bottom-space { + margin-bottom: 1em; + } + + .tiny-bottom-space { + margin-bottom: 1em; + } + + .bottom-padding { + padding-bottom: 1em; + } + + .tiny-bottom-padding { + padding-bottom: 1em; + } + + .double-bottom-space { + margin-bottom: 2em; + } + + .tiny-double-bottom-space { + margin-bottom: 2em; + } + + .double-bottom-padding { + padding-bottom: 2em; + } + + .tiny-double-bottom-padding { + padding-bottom: 2em; + } + + .half-bottom-space { + margin-bottom: 0.5em; + } + + .tiny-half-bottom-space { + margin-bottom: 0.5em; + } + + .half-bottom-padding { + padding-bottom: 0.5em; + } + + .tiny-half-bottom-padding { + padding-bottom: 0.5em; + } + + .quarter-bottom-space { + margin-bottom: 0.25em; + } + + .tiny-quarter-bottom-space { + margin-bottom: 0.25em; + } + + .quarter-bottom-padding { + padding-bottom: 0.25em; + } + + .tiny-quarter-bottom-padding { + padding-bottom: 0.25em; + } + + .left-space { + margin-left: 1em; + } + + .tiny-left-space { + margin-left: 1em; + } + + .left-padding { + padding-left: 1em; + } + + .tiny-left-padding { + padding-left: 1em; + } + + .double-left-space { + margin-left: 2em; + } + + .tiny-double-left-space { + margin-left: 2em; + } + + .double-left-padding { + padding-left: 2em; + } + + .tiny-double-left-padding { + padding-left: 2em; + } + + .half-left-space { + margin-left: 0.5em; + } + + .tiny-half-left-space { + margin-left: 0.5em; + } + + .half-left-padding { + padding-left: 0.5em; + } + + .tiny-half-left-padding { + padding-left: 0.5em; + } + + .quarter-left-space { + margin-left: 0.25em; + } + + .tiny-quarter-left-space { + margin-left: 0.25em; + } + + .quarter-left-padding { + padding-left: 0.25em; + } + + .tiny-quarter-left-padding { + padding-left: 0.25em; + } + + .hide-tiny { + display: none !important; + } + + .show-tiny { + display: inherit !important; + } + + table.show-tiny { + display: table; + } + + thead.show-tiny { + display: table-header-group; + } + + tbody.show-tiny { + display: table-row-group; + } + + tfoot.show-tiny { + display: table-footer-group; + } + + tr.show-tiny { + display: table-row; + } + + th.show-tiny, + td.show-tiny { + display: table-cell; + } +} +html { + font-size: 0.97em; +} +html:after { + content: '[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]'; + display: none; +} + +.ink-label { + padding: 0 0.35em; + white-space: nowrap; +} + +.ink-navigation { + overflow: visible; +} +.ink-navigation ul { + list-style-type: none; + padding: 0; + margin: 0; +} +.ink-navigation ul li { + margin: 0; +} + +.ink-navigation .breadcrumbs li { + line-height: 2.7em; + display: inline; +} +.ink-navigation .breadcrumbs li a { + display: inline; + padding: 0; +} +.ink-navigation .breadcrumbs li a:hover { + background: transparent; +} +.ink-navigation .breadcrumbs li.active a { + cursor: default; + text-decoration: none; +} +.ink-navigation .breadcrumbs li:first-child a { + padding-left: 1.2em; +} +.ink-navigation .breadcrumbs li:after { + content: '/'; + display: inline; + margin: 0 .7em; +} +.ink-navigation .breadcrumbs li:last-child:after { + content: ''; + display: none; +} + +.ink-dropdown, +.ink-navigation { + position: relative; +} +.ink-dropdown ul.dropdown-menu, +.ink-dropdown ul.dropdown, +.ink-navigation ul.dropdown-menu, +.ink-navigation ul.dropdown { + position: absolute; + top: 110%; + background: white; + z-index: 30; + border: 1px solid #d9d9d9; + height: auto; + width: auto; + min-width: 10em; + max-width: 12em; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: rgba(100, 100, 100, 0.3) 0 0 1px 0; + -moz-box-shadow: rgba(100, 100, 100, 0.3) 0 0 1px 0; + box-shadow: rgba(100, 100, 100, 0.3) 0 0 1px 0; + padding: .3em 0; + margin-left: 0px; + padding: .35em 0; + font-size: .85em; +} +.ink-dropdown ul.dropdown-menu li, +.ink-dropdown ul.dropdown li, +.ink-navigation ul.dropdown-menu li, +.ink-navigation ul.dropdown li { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + -webkit-border-radius: none; + -moz-border-radius: none; + -ms-border-radius: none; + -o-border-radius: none; + border-radius: none; + width: auto; + height: auto; + min-height: auto; + display: list-item; + float: none; + margin: 0; + text-align: left; + text-transform: none; + padding: 0; + position: relative; + list-style-type: none; +} +.ink-dropdown ul.dropdown-menu li.separator-above, +.ink-dropdown ul.dropdown li.separator-above, +.ink-navigation ul.dropdown-menu li.separator-above, +.ink-navigation ul.dropdown li.separator-above { + padding-top: .35em; + margin-top: .35em; + border-top: 1px solid #d9d9d9; +} +.ink-dropdown ul.dropdown-menu li.separator-below, +.ink-dropdown ul.dropdown li.separator-below, +.ink-navigation ul.dropdown-menu li.separator-below, +.ink-navigation ul.dropdown li.separator-below { + padding-bottom: .35em; + margin-bottom: .35em; + border-bottom: 1px solid #d9d9d9; +} +.ink-dropdown ul.dropdown-menu li.heading, +.ink-dropdown ul.dropdown li.heading, +.ink-navigation ul.dropdown-menu li.heading, +.ink-navigation ul.dropdown li.heading { + font-weight: 700; + padding-bottom: .35em; + margin-bottom: .35em; + padding: .5em .8em; + color: #333333; +} +.ink-dropdown ul.dropdown-menu li a, +.ink-dropdown ul.dropdown li a, +.ink-navigation ul.dropdown-menu li a, +.ink-navigation ul.dropdown li a { + color: #444; + padding: .5em .8em; + display: block; + clear: both; +} +.ink-dropdown ul.dropdown-menu li a:hover, +.ink-dropdown ul.dropdown li a:hover, +.ink-navigation ul.dropdown-menu li a:hover, +.ink-navigation ul.dropdown li a:hover { + background: #f2f2f2; + text-decoration: none; +} +.ink-dropdown ul.dropdown-menu li.active a, +.ink-dropdown ul.dropdown li.active a, +.ink-navigation ul.dropdown-menu li.active a, +.ink-navigation ul.dropdown li.active a { + background: #999999; + color: white; +} +.ink-dropdown ul.dropdown-menu li.disabled a, +.ink-dropdown ul.dropdown li.disabled a, +.ink-navigation ul.dropdown-menu li.disabled a, +.ink-navigation ul.dropdown li.disabled a { + color: #b3b3b3; +} +.ink-dropdown ul.dropdown-menu li.disabled a:hover, +.ink-dropdown ul.dropdown li.disabled a:hover, +.ink-navigation ul.dropdown-menu li.disabled a:hover, +.ink-navigation ul.dropdown li.disabled a:hover { + background: transparent; + cursor: default; +} +.ink-dropdown ul.dropdown-menu li.submenu, +.ink-dropdown ul.dropdown li.submenu, +.ink-navigation ul.dropdown-menu li.submenu, +.ink-navigation ul.dropdown li.submenu { + overflow: visible; +} +.ink-dropdown ul.dropdown-menu li.submenu > a, +.ink-dropdown ul.dropdown li.submenu > a, +.ink-navigation ul.dropdown-menu li.submenu > a, +.ink-navigation ul.dropdown li.submenu > a { + white-space: nowrap; +} +.ink-dropdown ul.dropdown-menu li.submenu > a:after, +.ink-dropdown ul.dropdown li.submenu > a:after, +.ink-navigation ul.dropdown-menu li.submenu > a:after, +.ink-navigation ul.dropdown li.submenu > a:after { + content: "\f0da"; + width: auto; + margin-left: .8em; + font-family: FontAwesome; + color: #b3b3b3; +} +.ink-dropdown ul.dropdown-menu li.submenu:hover > a, +.ink-dropdown ul.dropdown li.submenu:hover > a, +.ink-navigation ul.dropdown-menu li.submenu:hover > a, +.ink-navigation ul.dropdown li.submenu:hover > a { + background: #f2f2f2; + text-decoration: none; +} +.ink-dropdown ul.dropdown-menu li.submenu:hover:hover > ul.dropdown-menu, .ink-dropdown ul.dropdown-menu li.submenu:hover:hover > ul.dropdown, +.ink-dropdown ul.dropdown li.submenu:hover:hover > ul.dropdown-menu, +.ink-dropdown ul.dropdown li.submenu:hover:hover > ul.dropdown, +.ink-navigation ul.dropdown-menu li.submenu:hover:hover > ul.dropdown-menu, +.ink-navigation ul.dropdown-menu li.submenu:hover:hover > ul.dropdown, +.ink-navigation ul.dropdown li.submenu:hover:hover > ul.dropdown-menu, +.ink-navigation ul.dropdown li.submenu:hover:hover > ul.dropdown { + display: block; +} +.ink-dropdown ul.dropdown-menu li.submenu > ul.dropdown-menu, .ink-dropdown ul.dropdown-menu li.submenu > ul.dropdown, +.ink-dropdown ul.dropdown li.submenu > ul.dropdown-menu, +.ink-dropdown ul.dropdown li.submenu > ul.dropdown, +.ink-navigation ul.dropdown-menu li.submenu > ul.dropdown-menu, +.ink-navigation ul.dropdown-menu li.submenu > ul.dropdown, +.ink-navigation ul.dropdown li.submenu > ul.dropdown-menu, +.ink-navigation ul.dropdown li.submenu > ul.dropdown { + font-size: inherit; + position: absolute; + top: -.36em; + left: 100%; + display: none; +} + +.ink-navigation ul.pagination { + overflow: hidden; + *zoom: 1; +} +.ink-navigation ul.pagination li { + line-height: 1.7; + float: left; +} +.ink-navigation ul.pagination li a { + padding: 0.5em 1em; + display: block; + float: left; +} +.ink-navigation ul.pagination.dotted li a { + display: block; + height: 1em; + width: 1em; + margin-right: .6em; + padding: 0; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + -ms-border-radius: 50%; + -o-border-radius: 50%; + border-radius: 50%; + text-indent: 99999px; +} +.ink-navigation ul.pagination.dotted li a:first-child, .ink-navigation ul.pagination.dotted li a:last-child { + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + -ms-border-radius: 50%; + -o-border-radius: 50%; + border-radius: 50%; +} +.ink-navigation ul.pagination.chevron li { + display: none; +} +.ink-navigation ul.pagination.chevron li.next, .ink-navigation ul.pagination.chevron li.previous { + display: block; +} +.ink-navigation ul.pagination.chevron li.next a, .ink-navigation ul.pagination.chevron li.previous a { + display: block; + position: absolute; + top: 35%; + padding: 0 .5em; + margin: 0; + font-family: FontAwesome; + font-size: 4em; +} +.ink-navigation ul.pagination.chevron li.next a span, .ink-navigation ul.pagination.chevron li.previous a span { + text-indent: -99999px; + display: inline-block; +} +.ink-navigation ul.pagination.chevron li.disabled a { + color: rgba(255, 255, 255, 0.6); + text-shadow: none; +} +.ink-navigation ul.pagination.chevron li.disabled a:hover, .ink-navigation ul.pagination.chevron li.disabled a:focus { + color: rgba(255, 255, 255, 0.6); +} +.ink-navigation ul.pagination.chevron li.previous a { + left: 0; +} +.ink-navigation ul.pagination.chevron li.previous a:after { + content: "\f137"; +} +.ink-navigation ul.pagination.chevron li.next a { + right: 0; +} +.ink-navigation ul.pagination.chevron li.next a:after { + content: "\f138"; +} + +.ink-navigation .pills { + overflow: hidden; + *zoom: 1; +} +.ink-navigation .pills li { + overflow: hidden; + display: block; + float: left; + margin: 0 .5em .5em 0; + line-height: 1.7; +} +.ink-navigation .pills li a { + display: block; + padding: 0.5em 1em; +} +.ink-navigation .pills li a:hover { + text-decoration: none; +} +.ink-navigation .pills li.active a, .ink-navigation .pills li.disabled a { + cursor: default; +} + +.ink-navigation ul { + *height: 100%; +} +.ink-navigation ul.menu { + *zoom: 1; +} +.ink-navigation ul.menu:after { + content: ""; + display: table; + clear: both; +} +.ink-navigation ul.menu li { + *height: 100%; +} +.ink-navigation ul.menu li:hover > ul.submenu { + display: block; +} +.ink-navigation ul.menu li ul.submenu { + display: none; + position: absolute; + z-index: 10; +} +.ink-navigation ul.menu li ul.submenu li a { + padding: 0.5em 1em; + display: block; + float: none; +} +.ink-navigation ul.menu.horizontal li { + float: left; + position: relative; +} +.ink-navigation ul.menu.horizontal li a { + padding: 0.5em 1em; + display: block; + line-height: 1.7; +} +.ink-navigation ul.menu.horizontal li .control { + margin-top: .3em; +} +.ink-navigation ul.menu.horizontal li ul.submenu { + min-width: 100%; + left: 0; + z-index: 50; + top: auto; + left: auto; +} +.ink-navigation ul.menu.horizontal li ul.submenu li { + float: none; +} +.ink-navigation ul.menu.horizontal li ul.submenu li .flyout { + position: absolute; + top: 0; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.menu.horizontal li ul.submenu li .flyout.left { + right: 100%; +} +.ink-navigation ul.menu.horizontal li ul.submenu li .flyout.right { + left: 100%; +} +.ink-navigation ul.menu.vertical li { + line-height: 1.7; + position: relative; +} +.ink-navigation ul.menu.vertical li a { + padding: 0.5em 1em; + display: block; +} +.ink-navigation ul.menu.vertical li ul.submenu { + position: relative; + top: auto; + left: auto; +} +.ink-navigation ul.menu.vertical li ul.submenu.flyout { + position: absolute; + min-width: 8em; + top: 0; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.menu.vertical li ul.submenu.flyout.left { + right: 100%; +} +.ink-navigation ul.menu.vertical li ul.submenu.flyout.right { + left: 100%; +} + +table.ink-table { + width: 100%; + border-collapse: collapse; + border-spacing: 0; +} +table.ink-table tr th { + padding: 5px 10px; + line-height: 1.3; +} +table.ink-table tr th[data-sortable="true"]:hover { + cursor: pointer; + text-decoration: underline; +} +table.ink-table tr th[data-sortable="true"]:hover i { + text-decoration: none; +} +table.ink-table tr th[data-sortable="true"] i { + padding-left: .5em; +} +table.ink-table tr td { + padding: 5px 10px; + line-height: 1.3; +} +table.ink-table.hover tbody tr:hover { + cursor: pointer; +} +table.ink-table.bordered { + border-collapse: separate; +} + +html { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} + +body { + color: #555555; + font-family: "Roboto", Arial, Helvetica, sans-serif; + line-height: 1.45; +} + +.fw-100, .fw-light { + font-weight: 100; +} + +.fw-300, .fw-thin { + font-weight: 300; +} + +.fw-400, .fw-regular { + font-weight: 400; +} + +.fw-500, .fw-medium { + font-weight: 500; +} + +.fw-700, .fw-bold { + font-weight: 700; +} + +.fw-900, .fw-black { + font-weight: 900; +} + +.condensed-300, .condensed-thin { + font-weight: 200; + font-family: Roboto_condensed, Arial, Helvetica, sans-serif; +} + +.condensed-400, .condensed-regular { + font-weight: 400; + font-family: Roboto_condensed, Arial, Helvetica, sans-serif; +} + +.condensed-700, .condensed-bold { + font-weight: 700; + font-family: Roboto_condensed, Arial, Helvetica, sans-serif; +} + +.slab-100, .slab-light { + font-weight: 100; + font-family: Roboto_slab, Arial, Helvetica, sans-serif; +} + +.slab-300, .slab-thin { + font-weight: 300; + font-family: Roboto_slab, Arial, Helvetica, sans-serif; +} + +.slab-400, .slab-regular { + font-weight: 400; + font-family: Roboto_slab, Arial, Helvetica, sans-serif; +} + +.slab-700, .slab-bold { + font-weight: 700; + font-family: Roboto_slab, Arial, Helvetica, sans-serif; +} + +.sans { + font-family: "Roboto", Arial, Helvetica, sans-serif; +} + +.serif { + font-family: Times, "Times New Roman", serif; +} + +.monospace { + font-family: Monaco, "Andale Mono", "Courier New", monospace; +} + +.condensed { + font-family: Roboto_condensed, Arial, Helvetica, sans-serif; +} + +.slab { + font-family: Roboto_slab, Arial, Helvetica, sans-serif; +} + +.italic { + font-style: italic; +} + +.uppercase { + text-transform: uppercase; +} + +.lowercase { + text-transform: lowercase; +} + +.capitalizer { + text-transform: capitalize; +} + +.fa { + font-size: 14px; +} + +a { + color: #6998c9; + text-decoration: none; + cursor: pointer; +} +a:hover { + color: #007ed5; + text-decoration: underline; +} + +h1 { + font-size: 2.2em; + margin-top: 0; + margin-bottom: 0.57539em; +} + +h2 { + font-size: 1.75em; + margin-top: 0; + margin-bottom: 0.72334em; +} + +h3 { + font-size: 1.5em; + margin-top: 0; + margin-bottom: 0.8439em; +} + +h4 { + font-size: 1.25em; + margin-top: 0; + margin-bottom: 1.01268em; +} + +h5 { + font-size: 1.1em; + margin-top: 0; + margin-bottom: 1.15077em; +} + +h6 { + font-size: 1.1em; + margin-top: 0; + margin-bottom: 1.15077em; +} + +p { + font-size: 1em; + margin-top: 0; + margin-bottom: 1.26585em; +} + +table { + font-size: 1em; + margin-top: 0; + margin-bottom: 1.26585em; +} + +h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child, p:first-child { + margin-top: 0; +} + +/* Headings */ +h1, h2, h3, h4, h5, h6 { + color: #404040; + font-weight: 700; + line-height: 1.16; +} + +small { + color: #888888; +} + +input, textarea { + color: #666; +} + +h1 small, h2 small, h3 small, h4 small { + color: #bbb; + font-size: .6em; + font-weight: 100; + line-height: 1; +} + +mark { + background: #dae5f2; +} + +address { + color: #777777; + font-size: 1em; + line-height: 1.4; +} +address p { + margin-top: 0; +} +address h6 { + color: #555555; +} + +abbr:hover { + cursor: help; +} + +blockquote { + border-left: 4px solid #ddd; + padding-left: 25px; + margin: 1em 0; + font-weight: 200; + font-size: 1.1em; +} +blockquote small { + font-size: .9em; +} +blockquote small::before, blockquote small::after { + content: ' — '; +} + +.note { + font-size: .9em; + color: #777777; +} +.note strong { + color: #555555; +} + +.small { + font-size: .75em; +} + +.medium { + font-size: .85em; +} + +.large { + font-size: 1.2em; +} + +.extralarge { + font-size: 1.45em !important; +} + +hr { + border: 0; + border-top: 1px solid #ddd; + margin: 1em 0; +} + +.lead { + font-size: 1.1em; + font-weight: bold; +} + +ul, ol { + line-height: 1.4; + padding: 0 0 0 1.45em; + margin: 1em 0; +} +ul li, ol li { + margin: .5em 0; +} + +ul.unstyled { + list-style: none; + padding-left: 0em; +} +ul.unstyled ul { + list-style: disc outside; +} +ul.inline { + list-style: none; +} +ul.inline li { + display: inline-block; + padding: 0 .5em; +} +ul.inline li:first-child { + padding: 0 .5em 0 0; +} + +dl { + margin: 1em 0; +} +dl dt { + font-weight: bold; + margin: .5em 0; +} +dl dd { + margin: 0.5em 0 0.5em 25px; +} +dl.inline dt { + float: left; + clear: left; + text-align: right; + width: 180px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + margin: 0; +} +dl.inline dd { + margin: .5em 0 .5em 200px; +} + +figure.ink-image { + position: relative; + border: 1px solid #555555; +} +figure.ink-image > img { + width: 100%; +} +figure.ink-image > figcaption { + padding: 1em; + background: white; + line-height: 1.3; +} +figure.ink-image > figcaption.over-top, figure.ink-image > figcaption.over-bottom { + position: absolute; + width: 100%; + left: 0; + border: none; +} +figure.ink-image > figcaption.over-top.dark, figure.ink-image > figcaption.over-bottom.dark { + color: white; + background: rgba(0, 0, 0, 0.6); +} +figure.ink-image > figcaption.over-top { + top: 0; + background: rgba(255, 255, 255, 0.7); +} +figure.ink-image > figcaption.over-bottom { + bottom: 0; + background: rgba(255, 255, 255, 0.7); +} +figure.ink-image > figcaption.dark { + color: white; + background: #222222; +} + +img { + border: 0; + width: auto; + max-width: 100%; + vertical-align: top; +} + +.ink-alert.basic, .ink-alert.block { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-alert.basic { + background: rgba(255, 156, 0, 0.25); + color: #b87814; + border: 1px solid #b87814; +} +.ink-alert.basic .ink-dismiss { + color: #b87814; +} +.ink-alert.basic.success { + background: rgba(74, 155, 23, 0.25); + color: #38621d; + border: 1px solid #38621d; +} +.ink-alert.basic.success .ink-dismiss { + color: #38621d; +} +.ink-alert.basic.error { + background: rgba(201, 17, 17, 0.25); + color: #891e1e; + border: 1px solid #891e1e; +} +.ink-alert.basic.error .ink-dismiss { + color: #891e1e; +} +.ink-alert.basic.info { + background: rgba(15, 117, 218, 0.25); + color: #1e5b98; + border: 1px solid #1e5b98; +} +.ink-alert.basic.info .ink-dismiss { + color: #1e5b98; +} +.ink-alert.block { + border: 1px solid #b87814; + background: white; +} +.ink-alert.block > h4 { + background: rgba(255, 156, 0, 0.3); + color: #b87814; +} +.ink-alert.block .ink-dismiss { + color: #b87814; +} +.ink-alert.block.success { + border: 1px solid #38621d; + background: white; +} +.ink-alert.block.success > h4 { + background: rgba(74, 155, 23, 0.3); + color: #38621d; +} +.ink-alert.block.success .ink-dismiss { + color: #38621d; +} +.ink-alert.block.error { + border: 1px solid #891e1e; + background: white; +} +.ink-alert.block.error > h4 { + background: rgba(201, 17, 17, 0.3); + color: #891e1e; +} +.ink-alert.block.error .ink-dismiss { + color: #891e1e; +} +.ink-alert.block.info { + border: 1px solid #1e5b98; + background: white; +} +.ink-alert.block.info > h4 { + background: rgba(15, 117, 218, 0.3); + color: #1e5b98; +} +.ink-alert.block.info .ink-dismiss { + color: #1e5b98; +} +.ink-alert .ink-dismiss { + font-family: Arial, sans-serif; + font-weight: bold; + text-shadow: white 0 1px 0; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=25); + opacity: 0.25; +} +.ink-alert .ink-dismiss:hover { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + opacity: 0.6; +} + +.ink-badge { + -webkit-border-radius: 8em; + -moz-border-radius: 8em; + -ms-border-radius: 8em; + -o-border-radius: 8em; + border-radius: 8em; + color: white; +} +.ink-badge.white { + background: white; + color: #555555; +} +.ink-badge.black { + background: black; +} +.ink-badge.orange { + background: #ff9c00; +} +.ink-badge.red { + background: #c91111; +} +.ink-badge.green { + background: #4a9b17; +} +.ink-badge.blue { + background: #0f75da; +} +.ink-badge.yellow { + background: #ffd500; + color: #555555; +} +.ink-badge.grey { + background: gray; +} +.ink-badge + .ink-badge { + margin-left: .2em; +} + +.ink-button { + background: #d9d9d9; + color: black; + border: 1px solid #bfbfbf; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + font-weight: 300; +} +.ink-button:hover, .ink-button:active { + text-decoration: none; + color: black; + background: #cccccc; + border: 1px solid #b3b3b3; + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px; + box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px; +} +.ink-button:focus { + outline: none; + background: #cccccc; + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; + box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px inset; +} +.ink-button[disabled] { + background: #e6e6e6; + border: 1px solid #e6e6e6; + color: #999999; +} +.ink-button[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.blue { + color: white; + background: #0f75da; + border: 1px solid #0c63b9; +} +.ink-button.blue:hover, .ink-button.blue:active { + background: #0d68c2; + border: 1px solid #0a56a1; + color: white; + text-decoration: none; +} +.ink-button.blue:focus { + background: #0d68c2; +} +.ink-button.blue[disabled] { + background: rgba(15, 117, 218, 0.6); + border: 1px solid rgba(15, 117, 218, 0); + color: #0c5baa; +} +.ink-button.blue[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.green { + color: white; + background: #4a9b17; + border: 1px solid #3e8313; +} +.ink-button.green:hover, .ink-button.green:active { + background: #3f8514; + border: 1px solid #336d10; + color: white; + text-decoration: none; +} +.ink-button.green:focus { + background: #3f8514; +} +.ink-button.green[disabled] { + background: rgba(74, 155, 23, 0.6); + border: 1px solid rgba(74, 155, 23, 0); + color: #356f10; +} +.ink-button.green[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.orange { + color: white; + background: #ff9c00; + border: 1px solid #d88400; +} +.ink-button.orange:hover, .ink-button.orange:active { + background: #e68c00; + border: 1px solid #bf7400; + color: white; + text-decoration: none; +} +.ink-button.orange:focus { + background: #e68c00; +} +.ink-button.orange[disabled] { + background: rgba(255, 156, 0, 0.6); + border: 1px solid rgba(255, 156, 0, 0); + color: #cc7d00; +} +.ink-button.orange[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.red { + color: white; + background: #c91111; + border: 1px solid #aa0e0e; +} +.ink-button.red:hover, .ink-button.red:active { + background: #b10f0f; + border: 1px solid #920c0c; + color: white; + text-decoration: none; +} +.ink-button.red:focus { + background: #b10f0f; +} +.ink-button.red[disabled] { + background: rgba(201, 17, 17, 0.6); + border: 1px solid rgba(201, 17, 17, 0); + color: #9a0d0d; +} +.ink-button.red[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.black { + color: white; + background: #1a1a1a; + border: 1px solid #161616; +} +.ink-button.black:hover, .ink-button.black:active { + background: #0d0d0d; + border: 1px solid #090909; + color: white; + text-decoration: none; +} +.ink-button.black:focus { + background: #0d0d0d; +} +.ink-button.black[disabled] { + background: rgba(26, 26, 26, 0.6); + border: 1px solid rgba(26, 26, 26, 0); + color: black; +} +.ink-button.black[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.ink-button.white { + color: #555555; + background: white; + border: 1px solid #d8d8d8; +} +.ink-button.white:hover, .ink-button.white:active { + background: #f2f2f2; + border: 1px solid #cbcbcb; + color: #555555; + text-decoration: none; +} +.ink-button.white:focus { + background: #f2f2f2; +} +.ink-button.white[disabled] { + background: rgba(255, 255, 255, 0.6); + border: 1px solid rgba(255, 255, 255, 0); + color: #e6e6e6; +} +.ink-button.white[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.button-group > .ink-button[disabled] { + background: #e6e6e6; + border: 1px solid rgba(217, 217, 217, 0.6); +} +.button-group > .ink-button[disabled]:hover { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.button-group > .ink-button.blue:first-child { + border-left: #0c63b9; +} +.button-group > .ink-button.blue[disabled] { + background: rgba(15, 117, 218, 0.6); + border: 1px solid rgba(15, 117, 218, 0.3); +} +.button-group > .ink-button.green:first-child { + border-left: #3e8313; +} +.button-group > .ink-button.green[disabled] { + background: rgba(74, 155, 23, 0.6); + border: 1px solid rgba(74, 155, 23, 0.3); +} +.button-group > .ink-button.orange:first-child { + border-left: #d88400; +} +.button-group > .ink-button.orange[disabled] { + background: rgba(255, 156, 0, 0.6); + border: 1px solid rgba(255, 156, 0, 0.3); +} +.button-group > .ink-button.red:first-child { + border-left: #aa0e0e; +} +.button-group > .ink-button.red[disabled] { + background: rgba(201, 17, 17, 0.6); + border: 1px solid rgba(201, 17, 17, 0.3); +} +.button-group > .ink-button.black:first-child { + border-left: #161616; +} +.button-group > .ink-button.black[disabled] { + background: rgba(26, 26, 26, 0.6); + border: 1px solid rgba(26, 26, 26, 0.3); +} +.button-group > .ink-button.white:first-child { + border-left: #d8d8d8; +} +.button-group > .ink-button.white[disabled] { + background: rgba(255, 255, 255, 0.6); + border: 1px solid rgba(255, 255, 255, 0.3); +} + +.ink-label { + color: white; + font-weight: 300; + font-size: 0.938em; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-label.white { + background: white; + color: #555555; +} +.ink-label.black { + background: black; +} +.ink-label.orange { + background: #ff9c00; +} +.ink-label.red { + background: #c91111; +} +.ink-label.green { + background: #4a9b17; +} +.ink-label.blue { + background: #0f75da; +} +.ink-label.yellow { + background: #ffd500; + color: #555555; +} +.ink-label.grey { + background: gray; +} +.ink-label + .ink-label { + margin-left: .2em; +} + +.ink-navigation ul.breadcrumbs { + font-weight: 300; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.breadcrumbs li.active a { + background: none; + color: #999999; +} +.ink-navigation ul.breadcrumbs li.active a:hover { + cursor: default; + text-decoration: none; +} +.ink-navigation ul.breadcrumbs li a:hover { + background: none; + text-decoration: underline; +} +.ink-navigation ul.breadcrumbs.white { + background: white; +} +.ink-navigation ul.breadcrumbs.white li a, .ink-navigation ul.breadcrumbs.white li:after { + color: #555555; +} +.ink-navigation ul.breadcrumbs.white li.active a { + color: #cccccc; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.breadcrumbs.grey { + background: #d9d9d9; +} +.ink-navigation ul.breadcrumbs.grey li a, .ink-navigation ul.breadcrumbs.grey li:after { + color: #555555; +} +.ink-navigation ul.breadcrumbs.grey li.active a { + color: #a6a6a6; + text-shadow: #ededed 0 1px 0; +} +.ink-navigation ul.breadcrumbs.black { + background: #1a1a1a; +} +.ink-navigation ul.breadcrumbs.black li a, .ink-navigation ul.breadcrumbs.black li:after { + color: white; +} +.ink-navigation ul.breadcrumbs.black li.active a { + color: #666666; + text-shadow: black 0 -1px 0; +} +.ink-navigation ul.breadcrumbs.blue { + background: #1b75ce; +} +.ink-navigation ul.breadcrumbs.blue li a, .ink-navigation ul.breadcrumbs.blue li:after { + color: white; +} +.ink-navigation ul.breadcrumbs.blue li.active a { + color: #08427b; + text-shadow: #1884ef 0 1px 0; +} +.ink-navigation ul.breadcrumbs.orange { + background: #f2990d; +} +.ink-navigation ul.breadcrumbs.orange li a, .ink-navigation ul.breadcrumbs.orange li:after { + color: white; +} +.ink-navigation ul.breadcrumbs.orange li.active a { + color: #995e00; + text-shadow: #ffa81f 0 1px 0; +} +.ink-navigation ul.breadcrumbs.green { + background: #4c9220; +} +.ink-navigation ul.breadcrumbs.green li a, .ink-navigation ul.breadcrumbs.green li:after { + color: white; +} +.ink-navigation ul.breadcrumbs.green li.active a { + color: #20420a; + text-shadow: #57b61b 0 1px 0; +} +.ink-navigation ul.breadcrumbs.red { + background: #be1c1c; +} +.ink-navigation ul.breadcrumbs.red li a, .ink-navigation ul.breadcrumbs.red li:after { + color: white; +} +.ink-navigation ul.breadcrumbs.red li.active a { + color: #6b0909; + text-shadow: #e51313 0 1px 0; +} + +.ink-dropdown.blue ul.dropdown-menu li.active a { + background: #0f75da; + color: white; +} +.ink-dropdown.green ul.dropdown-menu li.active a { + background: #4a9b17; + color: white; +} +.ink-dropdown.orange ul.dropdown-menu li.active a { + background: #ff9c00; + color: white; +} +.ink-dropdown.red ul.dropdown-menu li.active a { + background: #c91111; + color: white; +} +.ink-dropdown.black ul.dropdown-menu li.active a { + background: #1a1a1a; + color: white; +} +.ink-dropdown.blue ul.dropdown-menu li.active a { + background: #0f75da; + color: white; +} + +.ink-navigation ul.menu { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.menu > li { + font-weight: 300; +} +.ink-navigation ul.menu > li.active a { + text-decoration: underline; +} +.ink-navigation ul.menu > li.heading { + font-weight: 500; +} +.ink-navigation ul.menu > li.disabled a { + color: #b3b3b3; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.menu > li.disabled a:hover { + cursor: default; + background: none; + text-decoration: none; +} +.ink-navigation ul.menu > li ul.submenu li { + font-size: .875em; +} +.ink-navigation ul.menu > li ul.submenu li a { + border-bottom: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.vertical li a { + border-bottom: 1px solid rgba(0, 0, 0, 0.15); +} +.ink-navigation ul.menu.vertical li:first-child { + -webkit-border-radius: 2px 2px 0 0; + -moz-border-radius: 2px 2px 0 0; + -ms-border-radius: 2px 2px 0 0; + -o-border-radius: 2px 2px 0 0; + border-radius: 2px 2px 0 0; +} +.ink-navigation ul.menu.vertical li:first-child > a { + -webkit-border-radius: 2px 2px 0 0; + -moz-border-radius: 2px 2px 0 0; + -ms-border-radius: 2px 2px 0 0; + -o-border-radius: 2px 2px 0 0; + border-radius: 2px 2px 0 0; +} +.ink-navigation ul.menu.vertical li:last-child { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.vertical li:last-child > a { + border-bottom: none; + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.vertical li:last-child .submenu { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.vertical li:last-child .submenu.flyout { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.menu.vertical li:last-child .submenu li:last-child { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.vertical li:last-child .submenu li:last-child a { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.horizontal > li:first-child { + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.ink-navigation ul.menu.horizontal > li:first-child a { + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.ink-navigation ul.menu.horizontal > li:last-child { + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.ink-navigation ul.menu.horizontal > li:last-child a { + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.ink-navigation ul.menu.horizontal > li ul.submenu { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; + background: white; +} +.ink-navigation ul.menu.horizontal > li ul.submenu li:last-child { + -webkit-border-radius: 0 0 2px 2px; + -moz-border-radius: 0 0 2px 2px; + -ms-border-radius: 0 0 2px 2px; + -o-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.ink-navigation ul.menu.horizontal > li ul.submenu li:last-child a { + border-bottom: none; +} +.ink-navigation ul.menu.white { + background: white; +} +.ink-navigation ul.menu.white li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.white li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.white li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.white li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.white li.active { + background: #e6e6e6; +} +.ink-navigation ul.menu.white li.disabled a { + color: #cccccc; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.menu.white li a { + color: #555555; + text-decoration: none; +} +.ink-navigation ul.menu.white li a:hover { + background: #f2f2f2; +} +.ink-navigation ul.menu.grey { + background: #d9d9d9; +} +.ink-navigation ul.menu.grey li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.grey li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.grey li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.grey li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.grey li.active { + background: #bfbfbf; +} +.ink-navigation ul.menu.grey li.disabled a { + color: #a6a6a6; + text-shadow: #ededed 0 1px 0; +} +.ink-navigation ul.menu.grey li a { + color: #555555; + text-decoration: none; +} +.ink-navigation ul.menu.grey li a:hover { + background: #cccccc; +} +.ink-navigation ul.menu.black { + background: #1a1a1a; +} +.ink-navigation ul.menu.black li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.black li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.black li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.black li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.black li.active { + background: #333333; +} +.ink-navigation ul.menu.black li.disabled a { + color: #666666; + text-shadow: black 0 -1px 0; +} +.ink-navigation ul.menu.black li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.menu.black li a:hover { + background: #404040; +} +.ink-navigation ul.menu.blue { + background: #1b75ce; +} +.ink-navigation ul.menu.blue li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.blue li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.blue li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.blue li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.blue li.active { + background: #0c5baa; +} +.ink-navigation ul.menu.blue li.disabled a { + color: #08427b; + text-shadow: #2289f0 0 1px 0; +} +.ink-navigation ul.menu.blue li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.menu.blue li a:hover { + background: #0d68c2; +} +.ink-navigation ul.menu.green { + background: #4c9220; +} +.ink-navigation ul.menu.green li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.green li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.green li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.green li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.green li.active { + background: #356f10; +} +.ink-navigation ul.menu.green li.disabled a { + color: #20420a; + text-shadow: #5bbf1c 0 1px 0; +} +.ink-navigation ul.menu.green li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.menu.green li a:hover { + background: #3f8514; +} +.ink-navigation ul.menu.orange { + background: #f2990d; +} +.ink-navigation ul.menu.orange li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.orange li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.orange li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.orange li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.orange li.active { + background: #cc7d00; +} +.ink-navigation ul.menu.orange li.disabled a { + color: #995e00; + text-shadow: #ffac29 0 1px 0; +} +.ink-navigation ul.menu.orange li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.menu.orange li a:hover { + background: #e68c00; +} +.ink-navigation ul.menu.red { + background: #be1c1c; +} +.ink-navigation ul.menu.red li ul.submenu { + background: white; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.ink-navigation ul.menu.red li ul.submenu li a { + color: #555555; +} +.ink-navigation ul.menu.red li ul.submenu li a:hover { + background: rgba(0, 0, 0, 0.05); +} +.ink-navigation ul.menu.red li.disabled a:hover { + background: none; +} +.ink-navigation ul.menu.red li.active { + background: #9a0d0d; +} +.ink-navigation ul.menu.red li.disabled a { + color: #6b0909; + text-shadow: #eb1717 0 1px 0; +} +.ink-navigation ul.menu.red li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.menu.red li a:hover { + background: #b10f0f; +} + +.ink-navigation ul.pagination { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.pagination li { + font-weight: 300; +} +.ink-navigation ul.pagination li.active a { + text-decoration: underline; +} +.ink-navigation ul.pagination li.disabled a { + color: #b3b3b3; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.pagination li.disabled a:hover { + cursor: default; + background: none; + text-decoration: none; +} +.ink-navigation ul.pagination li:first-child, .ink-navigation ul.pagination li:first-child a { + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + -ms-border-radius: 2px 0 0 2px; + -o-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.ink-navigation ul.pagination li:last-child, .ink-navigation ul.pagination li:last-child a { + -webkit-border-radius: 0 2px 2px 0; + -moz-border-radius: 0 2px 2px 0; + -ms-border-radius: 0 2px 2px 0; + -o-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.ink-navigation ul.pagination.white li { + background: white; +} +.ink-navigation ul.pagination.white li.active a { + background: #e6e6e6; +} +.ink-navigation ul.pagination.white li.disabled a { + color: #cccccc; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.pagination.white li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.white li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.white li a:hover { + background: #e6e6e6; +} +.ink-navigation ul.pagination.white li { + background: white; +} +.ink-navigation ul.pagination.white li.active a { + background: #e6e6e6; +} +.ink-navigation ul.pagination.white li.disabled a { + color: #cccccc; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.pagination.white li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.white li a { + color: #555555; + text-decoration: none; +} +.ink-navigation ul.pagination.white li a:hover { + background: #f2f2f2; +} +.ink-navigation ul.pagination.grey li { + background: #d9d9d9; +} +.ink-navigation ul.pagination.grey li.active a { + background: #bfbfbf; +} +.ink-navigation ul.pagination.grey li.disabled a { + color: #a6a6a6; + text-shadow: #ededed 0 1px 0; +} +.ink-navigation ul.pagination.grey li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.grey li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.grey li a:hover { + background: #bfbfbf; +} +.ink-navigation ul.pagination.grey li { + background: #d9d9d9; +} +.ink-navigation ul.pagination.grey li.active a { + background: #bfbfbf; +} +.ink-navigation ul.pagination.grey li.disabled a { + color: #a6a6a6; + text-shadow: #ededed 0 1px 0; +} +.ink-navigation ul.pagination.grey li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.grey li a { + color: #555555; + text-decoration: none; +} +.ink-navigation ul.pagination.grey li a:hover { + background: #cccccc; +} +.ink-navigation ul.pagination.black li { + background: #1a1a1a; +} +.ink-navigation ul.pagination.black li.active a { + background: black; +} +.ink-navigation ul.pagination.black li.disabled a { + color: black; + text-shadow: #2e2e2e 0 1px 0; +} +.ink-navigation ul.pagination.black li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.black li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.black li a:hover { + background: black; +} +.ink-navigation ul.pagination.black li { + background: #1a1a1a; +} +.ink-navigation ul.pagination.black li.active a { + background: #333333; +} +.ink-navigation ul.pagination.black li.disabled a { + color: #666666; + text-shadow: black 0 -1px 0; +} +.ink-navigation ul.pagination.black li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.black li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.black li a:hover { + background: #292929; +} +.ink-navigation ul.pagination.orange li { + background: #f2990d; +} +.ink-navigation ul.pagination.orange li.active a { + background: #cc7d00; +} +.ink-navigation ul.pagination.orange li.disabled a { + color: #995e00; + text-shadow: #ffac29 0 1px 0; +} +.ink-navigation ul.pagination.orange li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.orange li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.orange li a:hover { + background: #cc7d00; +} +.ink-navigation ul.pagination.orange li { + background: #f2990d; +} +.ink-navigation ul.pagination.orange li.active a { + background: #cc7d00; +} +.ink-navigation ul.pagination.orange li.disabled a { + color: #995e00; + text-shadow: #ffac29 0 1px 0; +} +.ink-navigation ul.pagination.orange li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.orange li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.orange li a:hover { + background: #e68c00; +} +.ink-navigation ul.pagination.blue li { + background: #1b75ce; +} +.ink-navigation ul.pagination.blue li.active a { + background: #0c5baa; +} +.ink-navigation ul.pagination.blue li.disabled a { + color: #08427b; + text-shadow: #2289f0 0 1px 0; +} +.ink-navigation ul.pagination.blue li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.blue li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.blue li a:hover { + background: #0c5baa; +} +.ink-navigation ul.pagination.blue li { + background: #1b75ce; +} +.ink-navigation ul.pagination.blue li.active a { + background: #0c5baa; +} +.ink-navigation ul.pagination.blue li.disabled a { + color: #08427b; + text-shadow: #2289f0 0 1px 0; +} +.ink-navigation ul.pagination.blue li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.blue li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.blue li a:hover { + background: #0d68c2; +} +.ink-navigation ul.pagination.green li { + background: #4c9220; +} +.ink-navigation ul.pagination.green li.active a { + background: #356f10; +} +.ink-navigation ul.pagination.green li.disabled a { + color: #20420a; + text-shadow: #5bbf1c 0 1px 0; +} +.ink-navigation ul.pagination.green li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.green li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.green li a:hover { + background: #356f10; +} +.ink-navigation ul.pagination.green li { + background: #4c9220; +} +.ink-navigation ul.pagination.green li.active a { + background: #356f10; +} +.ink-navigation ul.pagination.green li.disabled a { + color: #20420a; + text-shadow: #5bbf1c 0 1px 0; +} +.ink-navigation ul.pagination.green li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.green li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.green li a:hover { + background: #3f8514; +} +.ink-navigation ul.pagination.red li { + background: #be1c1c; +} +.ink-navigation ul.pagination.red li.active a { + background: #9a0d0d; +} +.ink-navigation ul.pagination.red li.disabled a { + color: #6b0909; + text-shadow: #eb1717 0 1px 0; +} +.ink-navigation ul.pagination.red li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.red li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.red li a:hover { + background: #9a0d0d; +} +.ink-navigation ul.pagination.red li { + background: #be1c1c; +} +.ink-navigation ul.pagination.red li.active a { + background: #9a0d0d; +} +.ink-navigation ul.pagination.red li.disabled a { + color: #6b0909; + text-shadow: #eb1717 0 1px 0; +} +.ink-navigation ul.pagination.red li.disabled a:hover { + background: none; +} +.ink-navigation ul.pagination.red li a { + color: white; + text-decoration: none; +} +.ink-navigation ul.pagination.red li a:hover { + background: #b10f0f; +} +.ink-navigation ul.pagination.dotted li { + background: none; +} +.ink-navigation ul.pagination.dotted li a { + background: #999999; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); + opacity: 0.5; +} +.ink-navigation ul.pagination.dotted li:hover a, .ink-navigation ul.pagination.dotted li.active a { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} +.ink-navigation ul.pagination.dotted.black li a { + background: #1a1a1a; +} +.ink-navigation ul.pagination.dotted.white li a { + background: white; +} +.ink-navigation ul.pagination.dotted.blue li a { + background: #1b75ce; +} +.ink-navigation ul.pagination.dotted.green li a { + background: #4c9220; +} +.ink-navigation ul.pagination.dotted.orange li a { + background: #f2990d; +} +.ink-navigation ul.pagination.dotted.red li a { + background: #be1c1c; +} +.ink-navigation ul.pagination.chevron li.next a, .ink-navigation ul.pagination.chevron li.previous a { + color: white; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + opacity: 0.6; +} +.ink-navigation ul.pagination.chevron li.next a:hover, .ink-navigation ul.pagination.chevron li.next a:focus, .ink-navigation ul.pagination.chevron li.next a.active, .ink-navigation ul.pagination.chevron li.previous a:hover, .ink-navigation ul.pagination.chevron li.previous a:focus, .ink-navigation ul.pagination.chevron li.previous a.active { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); + opacity: 0.8; + text-decoration: none; + background: none; +} +.ink-navigation ul.pagination.chevron li.disabled a { + color: white; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + opacity: 0.6; + text-shadow: none; +} +.ink-navigation ul.pagination.chevron li.disabled a:hover, .ink-navigation ul.pagination.chevron li.disabled a:focus { + color: white; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + opacity: 0.6; +} +.ink-navigation ul.pagination.chevron.black li.next a, .ink-navigation ul.pagination.chevron.black li.previous a, .ink-navigation ul.pagination.chevron.black li.disabled a { + color: #1a1a1a; +} +.ink-navigation ul.pagination.chevron.grey li.next a, .ink-navigation ul.pagination.chevron.grey li.previous a, .ink-navigation ul.pagination.chevron.grey li.disabled a { + color: #d9d9d9; +} +.ink-navigation ul.pagination.chevron.blue li.next a, .ink-navigation ul.pagination.chevron.blue li.previous a, .ink-navigation ul.pagination.chevron.blue li.disabled a { + color: #1b75ce; +} +.ink-navigation ul.pagination.chevron.green li.next a, .ink-navigation ul.pagination.chevron.green li.previous a, .ink-navigation ul.pagination.chevron.green li.disabled a { + color: #4c9220; +} +.ink-navigation ul.pagination.chevron.orange li.next a, .ink-navigation ul.pagination.chevron.orange li.previous a, .ink-navigation ul.pagination.chevron.orange li.disabled a { + color: #f2990d; +} +.ink-navigation ul.pagination.chevron.red li.next a, .ink-navigation ul.pagination.chevron.red li.previous a, .ink-navigation ul.pagination.chevron.red li.disabled a { + color: #be1c1c; +} + +.ink-navigation ul.pills li { + background: white; + font-weight: 300; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-navigation ul.pills li a { + color: #555555; + background: none; +} +.ink-navigation ul.pills li a:hover { + background: #e6e6e6; +} +.ink-navigation ul.pills li.active a { + background: #e6e6e6; +} +.ink-navigation ul.pills li.disabled a { + color: #999999; + text-shadow: white 0 1px 0; +} +.ink-navigation ul.pills li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.grey li { + background: #d9d9d9; +} +.ink-navigation ul.pills.grey li.active a { + background: #bfbfbf; +} +.ink-navigation ul.pills.grey li.disabled a { + color: #a6a6a6; + text-shadow: #ededed 0 1px 0; +} +.ink-navigation ul.pills.grey li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.grey li a { + color: #555555; +} +.ink-navigation ul.pills.grey li a:hover { + background: #cccccc; +} +.ink-navigation ul.pills.black li { + background: #1a1a1a; +} +.ink-navigation ul.pills.black li.active a { + background: #333333; +} +.ink-navigation ul.pills.black li.disabled a { + color: #666666; + text-shadow: black 0 -1px 0; +} +.ink-navigation ul.pills.black li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.black li a { + color: white; +} +.ink-navigation ul.pills.black li a:hover { + background: #292929; +} +.ink-navigation ul.pills.blue li { + background: #1b75ce; +} +.ink-navigation ul.pills.blue li.active a { + background: #0c5baa; +} +.ink-navigation ul.pills.blue li.disabled a { + color: #08427b; + text-shadow: #2289f0 0 1px 0; +} +.ink-navigation ul.pills.blue li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.blue li a { + color: white; +} +.ink-navigation ul.pills.blue li a:hover { + background: #0d68c2; +} +.ink-navigation ul.pills.green li { + background: #4c9220; +} +.ink-navigation ul.pills.green li.active a { + background: #356f10; +} +.ink-navigation ul.pills.green li.disabled a { + color: #20420a; + text-shadow: #5bbf1c 0 1px 0; +} +.ink-navigation ul.pills.green li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.green li a { + color: white; +} +.ink-navigation ul.pills.green li a:hover { + background: #3f8514; +} +.ink-navigation ul.pills.orange li { + background: #f2990d; +} +.ink-navigation ul.pills.orange li.active a { + background: #cc7d00; +} +.ink-navigation ul.pills.orange li.disabled a { + color: #995e00; + text-shadow: #ffac29 0 1px 0; +} +.ink-navigation ul.pills.orange li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.orange li a { + color: white; +} +.ink-navigation ul.pills.orange li a:hover { + background: #e68c00; +} +.ink-navigation ul.pills.red li { + background: #be1c1c; +} +.ink-navigation ul.pills.red li.active a { + background: #9a0d0d; +} +.ink-navigation ul.pills.red li.disabled a { + color: #6b0909; + text-shadow: #eb1717 0 1px 0; +} +.ink-navigation ul.pills.red li.disabled a:hover { + background: none; +} +.ink-navigation ul.pills.red li a { + color: white; +} +.ink-navigation ul.pills.red li a:hover { + background: #b10f0f; +} + +table.ink-table { + background: white; +} +table.ink-table tr th, table.ink-table tr td { + border-bottom: #bbbbbb 1px solid; + background: none; +} +table.ink-table tr:last-child td { + border-bottom: none; +} +table.ink-table tfoot tr th, table.ink-table tfoot tr td { + border-top: #bbbbbb 1px solid; +} +table.ink-table.alternating tbody tr:nth-child(odd) { + background-color: whitesmoke; +} +table.ink-table.hover tbody tr:hover { + background: #fefbd6; + color: #555555; +} +table.ink-table.bordered { + border: #bbbbbb 1px solid; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +table.ink-table.bordered tr th { + border-left: #bbbbbb 1px solid; +} +table.ink-table.bordered tr th:first-child { + border-left: none; +} +table.ink-table.bordered tr:last-child td { + border-bottom: none; +} +table.ink-table.bordered tr td { + border-left: #bbbbbb 1px solid; +} +table.ink-table.bordered tr td:first-child { + border-left: none; +} +table.ink-table tbody > tr.red td { + background: #c91111; + color: white; +} +table.ink-table tbody > tr.green td { + background: #4a9b17; + color: white; +} +table.ink-table tbody > tr.blue td { + background: #0f75da; + color: white; +} +table.ink-table tbody > tr.orange td { + background: #ff9c00; + color: white; +} +table.ink-table tbody > tr.black td { + background: black; + color: #cccccc; +} +table.ink-table tbody > tr.yellow td { + background: #ffd500; + color: black; +} + +.animated.slow { + animation-duration: 1s; +} +.animated.medium { + animation-duration: 0.5s; +} +.animated.fast { + animation-duration: 0.2s; +} + +.ink-carousel { + width: 100%; + position: relative; + overflow: hidden; + display: block; +} +.ink-carousel .stage { + left: 0; + height: auto !important; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + list-style-type: none; + white-space: nowrap; + position: relative; + -webkit-transition: all 0.5s ease; + -moz-transition: all 0.5s ease; + -o-transition: all 0.5s ease; + transition: all 0.5s ease; +} +.ink-carousel .stage .slide { + position: relative; + display: inline-block; + vertical-align: top; + white-space: normal; + margin: 0; + float: none; + zoom: 1; + *display: inline; +} +.ink-carousel .ink-navigation { + position: static; +} + +.ink-datepicker-wrapper { + position: relative; +} + +.ink-datepicker-calendar { + margin-top: 0; + position: absolute; +} +.ink-datepicker-calendar.right { + left: 100%; + top: 0; +} +.ink-datepicker-calendar.left { + right: 100%; + top: 0; +} +.ink-datepicker-calendar.bottom { + top: 100%; + left: 0; +} +.ink-datepicker-calendar.top { + bottom: 100%; + left: 0; +} + +.ink-datepicker-wrapper, .ink-datepicker-calendar { + display: inline; + display: inline-block; +} + +.ink-calendar { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + text-align: center; + padding: 0.3em; + min-width: 17.4em; + font-size: 13px; + -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0 1px 2px 0; + -moz-box-shadow: rgba(0, 0, 0, 0.4) 0 1px 2px 0; + box-shadow: rgba(0, 0, 0, 0.4) 0 1px 2px 0; + background: white; + z-index: 10; +} +.ink-calendar a { + text-decoration: none; +} +.ink-calendar li { + list-style: none inside; +} + +html.ink-modal-is-open .ink-calendar { + z-index: 101; +} + +.ink-calendar-top-options { + padding: 5px; + font-size: .813em; + cursor: pointer; +} +.ink-calendar-top-options .clean { + float: left; +} +.ink-calendar-top-options .close { + float: right; +} + +.ink-calendar-top { + line-height: 2em; + background: #e6e6e6; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-calendar-top div { + float: left; +} +.ink-calendar-top .ink-calendar-prev, +.ink-calendar-top .ink-calendar-next { + width: 10%; +} +.ink-calendar-top .ink-calendar-prev a, +.ink-calendar-top .ink-calendar-next a { + display: block; +} +.ink-calendar-top .ink-calendar-month_desc { + width: 80%; +} + +.ink-calendar-month, +.ink-calendar-year-selector, +.ink-calendar-month-selector { + margin-top: .5em; + padding-left: 0; +} +.ink-calendar-month li a, +.ink-calendar-year-selector li a, +.ink-calendar-month-selector li a { + margin: 0px; + line-height: 2em; + vertical-align: middle; + display: block; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + color: #444444; +} +.ink-calendar-month li a:hover, +.ink-calendar-year-selector li a:hover, +.ink-calendar-month-selector li a:hover { + background: #e6e6e6; +} +.ink-calendar-month li a.ink-calendar-on, .ink-calendar-month li a.ink-calendar-on:hover, +.ink-calendar-year-selector li a.ink-calendar-on, +.ink-calendar-year-selector li a.ink-calendar-on:hover, +.ink-calendar-month-selector li a.ink-calendar-on, +.ink-calendar-month-selector li a.ink-calendar-on:hover { + background: #0069d6; + color: white; +} +.ink-calendar-month li a.ink-calendar-off, .ink-calendar-month li a.ink-calendar-off:hover, +.ink-calendar-year-selector li a.ink-calendar-off, +.ink-calendar-year-selector li a.ink-calendar-off:hover, +.ink-calendar-month-selector li a.ink-calendar-off, +.ink-calendar-month-selector li a.ink-calendar-off:hover { + background: white; + color: #aaaaaa; + cursor: default; +} +.ink-calendar-month ul, +.ink-calendar-year-selector ul, +.ink-calendar-month-selector ul { + clear: both; + padding-left: 0; +} +.ink-calendar-month ul li, +.ink-calendar-year-selector ul li, +.ink-calendar-month-selector ul li { + width: 2.4em; + float: left; + text-align: center; + padding: 0; + margin: 0; +} + +.ink-calendar-year-selector ul li { + width: 25%; +} + +.ink-calendar-month-selector ul li { + width: 25%; +} + +.ink-calendar-year-selector, +.ink-calendar-month-selector { + display: none; +} + +.ink-calendar-off, .action_inactive { + color: #ddd !important; +} + +.ink-calendar-month .ink-calendar-header { + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + padding-bottom: .5em; + margin-bottom: .5em; + color: #aaa; +} + +.ink-calendar-top, +.ink-calendar-middle, +.ink-calendar-top-options, +.ink-calendar-month .ink-calendar-header, +.ink-calendar-month .ink-calendar-middle ul { + *zoom: 1; +} +.ink-calendar-top:after, +.ink-calendar-middle:after, +.ink-calendar-top-options:after, +.ink-calendar-month .ink-calendar-header:after, +.ink-calendar-month .ink-calendar-middle ul:after { + content: ""; + display: table; + clear: both; +} + +body.ink-drawer { + max-width: 100%; +} +body.ink-drawer .left-drawer, +body.ink-drawer .right-drawer, +body.ink-drawer .content-drawer { + -webkit-transition-property: translate3d; + -moz-transition-property: translate3d; + -o-transition-property: translate3d; + transition-property: translate3d; + -webkit-transition-duration: 300ms; + -moz-transition-duration: 300ms; + -o-transition-duration: 300ms; + transition-duration: 300ms; + -webkit-transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + -moz-transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + -o-transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); + transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); +} +body.ink-drawer .left-drawer { + left: -220px; +} +body.ink-drawer .right-drawer { + right: -220px; +} +body.ink-drawer .content-drawer { + width: 100%; +} +body.ink-drawer .left-drawer, +body.ink-drawer .right-drawer { + position: absolute; + top: 0; + z-index: 0; + display: none; + overflow-x: hidden; + overflow-y: auto; + width: 220px; + height: 100%; + -webkit-overflow-scrolling: touch; +} +body.ink-drawer .left-drawer.show, +body.ink-drawer .right-drawer.show { + display: block; +} +body.ink-drawer.push { + overflow: hidden; + width: 100%; + height: 100%; + position: fixed; +} +body.ink-drawer.push .content-drawer { + overflow: hidden; +} +body.ink-drawer.push.left .left-drawer, body.ink-drawer.push.left .content-drawer { + -webkit-transform: translate3d(220px, 0, 0); + -moz-transform: translate3d(220px, 0, 0); + -ms-transform: translate3d(220px, 0, 0); + -o-transform: translate3d(220px, 0, 0); + transform: translate3d(220px, 0, 0); +} +body.ink-drawer.push.right .right-drawer, body.ink-drawer.push.right .content-drawer { + -webkit-transform: translate3d(-220px, 0, 0); + -moz-transform: translate3d(-220px, 0, 0); + -ms-transform: translate3d(-220px, 0, 0); + -o-transform: translate3d(-220px, 0, 0); + transform: translate3d(-220px, 0, 0); +} +body.ink-drawer.over { + overflow: hidden; + -webkit-user-drag: none; +} +body.ink-drawer.over.left .left-drawer { + -webkit-transform: translate3d(220px, 0, 0); + -moz-transform: translate3d(220px, 0, 0); + -ms-transform: translate3d(220px, 0, 0); + -o-transform: translate3d(220px, 0, 0); + transform: translate3d(220px, 0, 0); +} +body.ink-drawer.over.right .right-drawer { + -webkit-transform: translate3d(-220px, 0, 0); + -moz-transform: translate3d(-220px, 0, 0); + -ms-transform: translate3d(-220px, 0, 0); + -o-transform: translate3d(-220px, 0, 0); + transform: translate3d(-220px, 0, 0); +} + +.ink-shade { + background: rgba(0, 0, 0, 0.8); + width: 100%; + height: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0; + margin-top: 0; + position: fixed; + z-index: 100; + display: none; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); + opacity: 0; +} +.ink-shade.fade { + -webkit-transition: opacity 300ms; + -moz-transition: opacity 300ms; + -o-transition: opacity 300ms; + transition: opacity 300ms; +} +.ink-shade.visible { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} + +.ink-modal { + top: 50%; + left: 50%; + width: 90%; + height: 90%; + background: white; + z-index: 100; + position: absolute; + overflow: hidden; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; + -webkit-box-shadow: rgba(0, 0, 0, 0.8) 0 0 15px 0; + -moz-box-shadow: rgba(0, 0, 0, 0.8) 0 0 15px 0; + box-shadow: rgba(0, 0, 0, 0.8) 0 0 15px 0; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + *zoom: 1; +} +.ink-modal:after { + content: ""; + display: table; + clear: both; +} +.ink-modal > .modal-body { + padding: 1em; + overflow-y: auto; + overflow-x: hidden; + height: auto; +} +.ink-modal > .modal-body .ink-grid { + padding-left: 0; + padding-right: 0; + width: 100%; + min-width: 100%; +} +.ink-modal > .modal-header, .ink-modal > header { + border-bottom: 1px #e6e6e6 solid; + overflow: hidden; + -webkit-box-shadow: rgba(175, 175, 175, 0.2) 0 1px 2px 0; + -moz-box-shadow: rgba(175, 175, 175, 0.2) 0 1px 2px 0; + box-shadow: rgba(175, 175, 175, 0.2) 0 1px 2px 0; +} +.ink-modal > .modal-header > .modal-close, .ink-modal > header > .modal-close { + padding-top: 2px; + text-align: center; + color: white; + width: 26px; + height: 26px; + line-height: 1.2em; + border: 0; + background: #bfbfbf; + font-size: 0; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + -ms-border-radius: 50%; + -o-border-radius: 50%; + border-radius: 50%; + text-shadow: rgba(0, 0, 0, 0.6) 0 -1px 0; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); + opacity: 0.6; + float: right; +} +.ink-modal > .modal-header > .modal-close:after, .ink-modal > header > .modal-close:after { + content: "\f00d"; + font-family: FontAwesome; + font-size: medium; + line-height: 22px; +} +.ink-modal > .modal-header > .modal-close:hover, .ink-modal > header > .modal-close:hover { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + opacity: 1; +} +.ink-modal > .modal-footer, .ink-modal > footer { + background: #e6e6e6; + margin-bottom: 0; + zoom: 1; + -webkit-box-shadow: rgba(175, 175, 175, 0.2) 0 -1px 2px 0; + -moz-box-shadow: rgba(175, 175, 175, 0.2) 0 -1px 2px 0; + box-shadow: rgba(175, 175, 175, 0.2) 0 -1px 2px 0; +} +.ink-modal > .modal-header, .ink-modal > header, .ink-modal > .modal-footer, .ink-modal > footer { + padding: .8em 1em .65em 1em; +} +.ink-modal > .modal-header:before, .ink-modal > .modal-header:after, .ink-modal > header:before, .ink-modal > header:after, .ink-modal > .modal-footer:before, .ink-modal > .modal-footer:after, .ink-modal > footer:before, .ink-modal > footer:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +.ink-modal-open { + overflow: hidden; +} + +/* Progess bars */ +.ink-progress-bar { + margin-bottom: 1em; + overflow: hidden; + background: #f2f2f2; + position: relative; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: 0, 1px, 3px, 0, rgba(0, 0, 0, 0.2), inset; + -moz-box-shadow: 0, 1px, 3px, 0, rgba(0, 0, 0, 0.2), inset; + box-shadow: 0, 1px, 3px, 0, rgba(0, 0, 0, 0.2), inset; +} +.ink-progress-bar .caption { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + line-height: 1.7; + text-align: center; + color: black; + font-size: 0.813em; + z-index: 10; +} +.ink-progress-bar .bar { + height: 1.3em; + text-shadow: rgba(0, 0, 0, 0.25), 0, 1px, 0; + -webkit-box-shadow: 0, 1px, 1px, 0, rgba(0, 0, 0, 0.1), inset; + -moz-box-shadow: 0, 1px, 1px, 0, rgba(0, 0, 0, 0.1), inset; + box-shadow: 0, 1px, 1px, 0, rgba(0, 0, 0, 0.1), inset; + -webkit-transition-property: width; + -moz-transition-property: width; + -o-transition-property: width; + transition-property: width; + -webkit-transition-duration: 0.6s; + -moz-transition-duration: 0.6s; + -o-transition-duration: 0.6s; + transition-duration: 0.6s; + -webkit-transition-timing-function: ease; + -moz-transition-timing-function: ease; + -o-transition-timing-function: ease; + transition-timing-function: ease; +} +.ink-progress-bar .bar.grey { + background: #cccccc; + color: #555555; +} +.ink-progress-bar .bar.green { + background: #4a9b17; + color: white; +} +.ink-progress-bar .bar.blue { + background: #0f75da; + color: white; +} +.ink-progress-bar .bar.red { + background: #c91111; + color: white; +} +.ink-progress-bar .bar.orange { + background: #ff9c00; + color: #555555; +} +.ink-progress-bar .bar.black { + background: black; + color: white; +} + +.dragging, .ink-sortable-list li { + cursor: move; + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: none; + -o-user-select: none; + -ms-user-select: none; + user-select: none; + -ms-user-drag: none; + -moz-user-drag: none; + -khtml-user-drag: none; + -webkit-user-drag: none; + -o-user-drag: none; + user-drag: none; +} + +.drag, .ink-sortable-list li.placeholder { + -webkit-box-shadow: 0, 0px, 10px, 0, rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0, 0px, 10px, 0, rgba(0, 0, 0, 0.3); + box-shadow: 0, 0px, 10px, 0, rgba(0, 0, 0, 0.3); +} + +.ink-sortable-list li { + margin: 0; + border-bottom: 1px solid #ccc; + line-height: 40px; +} +.ink-sortable-list li:hover, .ink-sortable-list li.placeholder { + background: #cccccc; + background: rgba(204, 204, 204, 0.2); +} +.ink-sortable-list li .ink-label { + margin: 0 .8em; +} + +.ink-sticky-stuck { + position: fixed; +} + +/* Tabs */ +.ink-tabs .tabs-nav { + list-style: none; + padding: 0em; + *zoom: 1; +} +.ink-tabs .tabs-nav li { + line-height: 1.7; + position: relative; + margin: 0; +} +.ink-tabs .tabs-nav li a { + padding: 0.5em 1em; + display: block; +} +.ink-tabs .tabs-nav li a:hover { + background: #f0f0f0; +} +.ink-tabs .tabs-nav li.active a { + color: #555555; + cursor: default; + text-decoration: none; + background: white; + border: 1px solid #cccccc; +} +.ink-tabs .tabs-nav:after { + content: ""; + display: table; + clear: both; +} +.ink-tabs .tabs-content { + margin-top: 1.5em; + overflow: auto; +} +.ink-tabs.top > .tabs-nav { + border-bottom: 1px solid #cccccc; +} +.ink-tabs.top > .tabs-nav li { + float: left; +} +.ink-tabs.top > .tabs-nav li a { + margin-right: .4em; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + -ms-border-radius: 4px 4px 0 0; + -o-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.ink-tabs.top > .tabs-nav li.active { + margin: 0 0 -2px 0; +} +.ink-tabs.top > .tabs-nav li.active a { + border-bottom-color: transparent; +} +.ink-tabs.bottom > .tabs-nav { + border-top: 1px solid #cccccc; +} +.ink-tabs.bottom > .tabs-nav li { + float: left; +} +.ink-tabs.bottom > .tabs-nav li a { + margin-right: .4em; + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + -ms-border-radius: 0 0 4px 4px; + -o-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.ink-tabs.bottom > .tabs-nav li.active { + margin: -2px 0 0 0; +} +.ink-tabs.bottom > .tabs-nav li.active a { + border-top-color: transparent; +} +.ink-tabs.left > .tabs-nav { + border-right: 1px solid #cccccc; + float: left; + margin-right: 2em; +} +.ink-tabs.left > .tabs-nav li { + float: none; + text-align: right; +} +.ink-tabs.left > .tabs-nav li a { + margin-bottom: .4em; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + -ms-border-radius: 4px 0 0 4px; + -o-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.ink-tabs.left > .tabs-nav li.active { + margin: 0 -2px 0 0; +} +.ink-tabs.left > .tabs-nav li.active a { + border-right-color: transparent; +} +.ink-tabs.right > .tabs-nav { + border-left: 1px solid #cccccc; + float: right; + margin-left: 2em; +} +.ink-tabs.right > .tabs-nav li { + float: none; +} +.ink-tabs.right > .tabs-nav li a { + margin-bottom: .4em; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + -ms-border-radius: 0 4px 4px 0; + -o-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.ink-tabs.right > .tabs-nav li.active { + margin: 0 0 0 -2px; +} +.ink-tabs.right > .tabs-nav li.active a { + border-left-color: transparent; +} + +.ink-tagfield input[type="text"].new-tag-input { + background-color: #fff; + border: 1px solid #ccc; + line-height: 1em; + margin: 0; + padding: 5px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; +} +.ink-tagfield input[type="text"].new-tag-input:focus { + -webkit-box-shadow: 0px, 0px, 0px, 3px, #eaeaea; + -moz-box-shadow: 0px, 0px, 0px, 3px, #eaeaea; + box-shadow: 0px, 0px, 0px, 3px, #eaeaea; + border: 1px solid #c3c3c3; +} +.ink-tagfield span.ink-tag { + background-color: #1b1b1b; + color: #eaeaea; + text-shadow: none; + font-size: .9em; + font-weight: normal; + border: 1px solid #000; + padding: 4px 6px; +} +.ink-tagfield span.ink-tag i.icon-remove { + color: #ccc; + font-size: .9em; + font-weight: normal; + margin-left: 4px; +} +.ink-tagfield span.ink-tag i.icon-remove:hover { + cursor: pointer; + color: red; +} + +.ink-tooltip { + display: inline-block; + position: relative; +} +.ink-tooltip > .content { + background: #f0f0f0; + padding: 0.5em 0.6em; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + -o-border-radius: 2px; + border-radius: 2px; + font-size: 0.8em; + color: #8c8c8c; +} +.ink-tooltip > .arrow { + position: absolute; +} +.ink-tooltip > .arrow.up, .ink-tooltip > .arrow.down, .ink-tooltip > .arrow.left, .ink-tooltip > .arrow.right { + width: 0; + height: 0; +} +.ink-tooltip > .arrow.up { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #f0f0f0; + top: -6px; + left: 50%; + margin-left: -3px; +} +.ink-tooltip > .arrow.down { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 6px solid #f0f0f0; + bottom: -5.45455px; + left: 50%; + margin-left: -3px; +} +.ink-tooltip > .arrow.right { + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + border-left: 6px solid #f0f0f0; + top: 50%; + right: -5.45455px; + margin-top: -6px; +} +.ink-tooltip > .arrow.left { + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + border-right: 6px solid #f0f0f0; + top: 50%; + left: -5.45455px; + margin-top: -6px; +} +.ink-tooltip.blue > .content { + background: #0f75da; + color: white; +} +.ink-tooltip.blue > .arrow.up { + border-bottom-color: #0f75da; +} +.ink-tooltip.blue > .arrow.down { + border-top-color: #0f75da; +} +.ink-tooltip.blue > .arrow.left { + border-right-color: #0f75da; +} +.ink-tooltip.blue > .arrow.right { + border-left-color: #0f75da; +} +.ink-tooltip.red > .content { + background: #c91111; + color: white; +} +.ink-tooltip.red > .arrow.up { + border-bottom-color: #c91111; +} +.ink-tooltip.red > .arrow.down { + border-top-color: #c91111; +} +.ink-tooltip.red > .arrow.left { + border-right-color: #c91111; +} +.ink-tooltip.red > .arrow.right { + border-left-color: #c91111; +} +.ink-tooltip.orange > .content { + background: #ff9c00; + color: white; +} +.ink-tooltip.orange > .arrow.up { + border-bottom-color: #ff9c00; +} +.ink-tooltip.orange > .arrow.down { + border-top-color: #ff9c00; +} +.ink-tooltip.orange > .arrow.left { + border-right-color: #ff9c00; +} +.ink-tooltip.orange > .arrow.right { + border-left-color: #ff9c00; +} +.ink-tooltip.green > .content { + background: #4a9b17; + color: white; +} +.ink-tooltip.green > .arrow.up { + border-bottom-color: #4a9b17; +} +.ink-tooltip.green > .arrow.down { + border-top-color: #4a9b17; +} +.ink-tooltip.green > .arrow.left { + border-right-color: #4a9b17; +} +.ink-tooltip.green > .arrow.right { + border-left-color: #4a9b17; +} +.ink-tooltip.black > .content { + background: black; + color: white; +} +.ink-tooltip.black > .arrow.up { + border-bottom-color: black; +} +.ink-tooltip.black > .arrow.down { + border-top-color: black; +} +.ink-tooltip.black > .arrow.left { + border-right-color: black; +} +.ink-tooltip.black > .arrow.right { + border-left-color: black; +} +.ink-tooltip.grey > .content { + background: #cccccc; + color: #333333; +} +.ink-tooltip.grey > .arrow.up { + border-bottom-color: #cccccc; +} +.ink-tooltip.grey > .arrow.down { + border-top-color: #cccccc; +} +.ink-tooltip.grey > .arrow.left { + border-right-color: #cccccc; +} +.ink-tooltip.grey > .arrow.right { + border-left-color: #cccccc; +} + +.ink-tree-view li { + list-style-type: none; +} +.ink-tree-view [data-open] > :before { + margin-left: -1.3em; + margin-right: .4em; + text-decoration: none; +} diff --git a/public/css/ink.min.css b/public/css/ink.min.css new file mode 100644 index 0000000..2d28618 --- /dev/null +++ b/public/css/ink.min.css @@ -0,0 +1 @@ +@charset "UTF-8";.show-all{display:inherit}.hide-all{display:none!important}.no-margin{margin:0!important}.no-padding{padding:0!important}.push-left{float:left}.push-center{float:none!important;margin-left:auto;margin-right:auto}.push-right{float:right;-webkit-justify-content:flex-end;-moz-justify-content:flex-end;justify-content:flex-end}.align-left{text-align:left}.align-center{text-align:center}.align-right{text-align:right}.clearfix{overflow:hidden;*zoom:1}.clearfix:after{content:"";display:table;clear:both}html{font-family:sans-serif}html *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}figure{margin:0}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.ink-alert.basic,.ink-alert.block{font-size:.938em;margin:1em 0;position:relative;overflow:hidden}.ink-alert.basic{padding:1em 3em 1em 1em}.ink-alert.basic p{margin:0}.ink-alert.basic .ink-close{top:.55em;*top:.2em}.ink-alert.block{font-size:1em}.ink-alert.block>h4{padding:1em 3em 1em 1em;font-size:.938em;line-height:1.5;margin:0}.ink-alert.block p{margin:1.5em 1em}.ink-alert.block ul{list-style:inside}.ink-alert .ink-dismiss{position:absolute;line-height:.56em;font-size:1.8em;padding:5px;border:0;background:0 0;top:.5em;*top:.2em;right:.4em}.ink-badge{padding:.2em .6em;font-size:.813em;margin-left:.6em}.ink-button{-webkit-appearance:menuitem;padding:8px 12px;cursor:pointer;text-decoration:none;text-align:center;display:inline-block;vertical-align:middle;white-space:nowrap;line-height:normal}.ink-button+.ink-button{margin-left:5px}.button-group{*zoom:1}.button-group>.ink-button{float:left;margin:5px 0;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;border-left:0}.button-group>.ink-button:active,.button-group>.ink-button:hover{border-left:0}.button-group>.ink-button:first-child{-webkit-border-radius:2px 0 0 2px;-moz-border-radius:2px 0 0 2px;-ms-border-radius:2px 0 0 2px;-o-border-radius:2px 0 0 2px;border-radius:2px 0 0 2px;border-left:1px solid #bfbfbf}.button-group>.ink-button:last-child{-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-ms-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0}.button-group:after{content:"";display:table;clear:both}.button-toolbar{*zoom:1}.button-toolbar>.button-group{margin-right:10px;float:left}.button-toolbar:after{content:"";display:table;clear:both}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-thin-webfont.eot);src:url(../fonts/Roboto/roboto-thin-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-thin-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-thin-webfont.ttf) format('truetype');font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-thinitalic-webfont.eot);src:url(../fonts/Roboto/roboto-thinitalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-thinitalic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-thinitalic-webfont.ttf) format('truetype');font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-light-webfont.eot);src:url(../fonts/Roboto/roboto-light-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-light-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-light-webfont.ttf) format('truetype');font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-lightitalic-webfont.eot);src:url(../fonts/Roboto/roboto-lightitalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-lightitalic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-lightitalic-webfont.ttf) format('truetype');font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-regular-webfont.eot);src:url(../fonts/Roboto/roboto-regular-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-regular-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-regular-webfont.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-italic-webfont.eot);src:url(../fonts/Roboto/roboto-italic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-italic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-italic-webfont.ttf) format('truetype');font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-medium-webfont.eot);src:url(../fonts/Roboto/roboto-medium-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-medium-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-medium-webfont.ttf) format('truetype');font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-mediumitalic-webfont.eot);src:url(../fonts/Roboto/roboto-mediumitalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-mediumitalic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-mediumitalic-webfont.ttf) format('truetype');font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-bold-webfont.eot);src:url(../fonts/Roboto/roboto-bold-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-bold-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-bold-webfont.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-bolditalic-webfont.eot);src:url(../fonts/Roboto/roboto-bolditalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-bolditalic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-bolditalic-webfont.ttf) format('truetype');font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-black-webfont.eot);src:url(../fonts/Roboto/roboto-black-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-black-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-black-webfont.ttf) format('truetype');font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(../fonts/Roboto/roboto-blackitalic-webfont.eot);src:url(../fonts/Roboto/roboto-blackitalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto/roboto-blackitalic-webfont.woff) format('woff'),url(../fonts/Roboto/roboto-blackitalic-webfont.ttf) format('truetype');font-weight:900;font-style:italic}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-light-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-light-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-light-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-light-webfont.ttf) format('truetype');font-weight:300;font-style:normal}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.ttf) format('truetype');font-weight:300;font-style:italic}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-regular-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-regular-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-regular-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-regular-webfont.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-italic-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-italic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-italic-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-italic-webfont.ttf) format('truetype');font-weight:400;font-style:italic}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-bold-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-bold-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-bold-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-bold-webfont.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:Roboto_condensed;src:url(../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot);src:url(../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.woff) format('woff'),url(../fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.ttf) format('truetype');font-weight:700;font-style:italic}@font-face{font-family:Roboto_slab;src:url(../fonts/Roboto_slab/robotoslab-thin-webfont.eot);src:url(../fonts/Roboto_slab/robotoslab-thin-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_slab/robotoslab-thin-webfont.woff) format('woff'),url(../fonts/Roboto_slab/robotoslab-thin-webfont.ttf) format('truetype');font-weight:100;font-style:normal}@font-face{font-family:Roboto_slab;src:url(../fonts/Roboto_slab/robotoslab-light-webfont.eot);src:url(../fonts/Roboto_slab/robotoslab-light-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_slab/robotoslab-light-webfont.woff) format('woff'),url(../fonts/Roboto_slab/robotoslab-light-webfont.ttf) format('truetype');font-weight:300;font-style:normal}@font-face{font-family:Roboto_slab;src:url(../fonts/Roboto_slab/robotoslab-regular-webfont.eot);src:url(../fonts/Roboto_slab/robotoslab-regular-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_slab/robotoslab-regular-webfont.woff) format('woff'),url(../fonts/Roboto_slab/robotoslab-regular-webfont.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:Roboto_slab;src:url(../fonts/Roboto_slab/robotoslab-bold-webfont.eot);src:url(../fonts/Roboto_slab/robotoslab-bold-webfont.eot?#iefix) format('embedded-opentype'),url(../fonts/Roboto_slab/robotoslab-bold-webfont.woff) format('woff'),url(../fonts/Roboto_slab/robotoslab-bold-webfont.ttf) format('truetype');font-weight:700;font-style:normal}.ink-form fieldset{border:0;padding:0;margin:0}.ink-form fieldset legend{font-size:1.438em;font-weight:700;width:100%;border-bottom:1px solid #ddd}.ink-form fieldset legend+*{-webkit-margin-top-collapse:separate;margin:2em 0}.ink-form p.tip{font-size:.875em;color:#909090;position:relative;margin:.2em 0 0 .1em}.ink-form p.label{padding:0;margin:0;color:#555;white-space:normal}.ink-form input[type=color],.ink-form input[type=date],.ink-form input[type=datetime-local],.ink-form input[type=datetime],.ink-form input[type=email],.ink-form input[type=month],.ink-form input[type=number],.ink-form input[type=password],.ink-form input[type=search],.ink-form input[type=tel],.ink-form input[type=text],.ink-form input[type=time],.ink-form input[type=url],.ink-form input[type=week],.ink-form select,.ink-form textarea{font-family:Roboto,Arial,Helvetica,sans-serif;font-weight:300;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;padding:8px 6px;border:1px solid #c6c6c6;resize:none;background:#fff;vertical-align:middle}.ink-form input[type=color]:focus,.ink-form input[type=date]:focus,.ink-form input[type=datetime-local]:focus,.ink-form input[type=datetime]:focus,.ink-form input[type=email]:focus,.ink-form input[type=month]:focus,.ink-form input[type=number]:focus,.ink-form input[type=password]:focus,.ink-form input[type=search]:focus,.ink-form input[type=tel]:focus,.ink-form input[type=text]:focus,.ink-form input[type=time]:focus,.ink-form input[type=url]:focus,.ink-form input[type=week]:focus,.ink-form select:focus,.ink-form textarea:focus{border-color:rgba(153,153,153,.9);-webkit-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;-moz-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;outline:0 none}.ink-form input[type=color]:disabled,.ink-form input[type=date]:disabled,.ink-form input[type=datetime-local]:disabled,.ink-form input[type=datetime]:disabled,.ink-form input[type=email]:disabled,.ink-form input[type=month]:disabled,.ink-form input[type=number]:disabled,.ink-form input[type=password]:disabled,.ink-form input[type=search]:disabled,.ink-form input[type=tel]:disabled,.ink-form input[type=text]:disabled,.ink-form input[type=time]:disabled,.ink-form input[type=url]:disabled,.ink-form input[type=week]:disabled,.ink-form select:disabled,.ink-form textarea:disabled{background:#f2f2f2;cursor:not-allowed}.ink-form .input-file{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;padding:6px;border:1px solid #c6c6c6;background:#fff;vertical-align:middle;line-height:1.2}.ink-form .input-file input[type=file]{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;border:0;padding:0;background:0 0;width:100%}.ink-form .ink-button{margin:0 5px}.ink-form label{cursor:pointer}.ink-form select{line-height:2;cursor:pointer}.ink-form textarea{min-height:5em}.ink-form .control-group{line-height:2;margin-bottom:1em;*zoom:1}.ink-form .control-group:after{content:"";display:table;clear:both}.ink-form .control-group .control{position:relative;*zoom:1}.ink-form .control-group .control:after{content:"";display:table;clear:both}.ink-form .control-group .control>li{margin:0;*zoom:1}.ink-form .control-group .control>li:after{content:"";display:table;clear:both}.ink-form .control-group .control>input,.ink-form .control-group .control>select,.ink-form .control-group .control>textarea{width:100%}.ink-form .control-group .control>input+[class*=" icon-"],.ink-form .control-group .control>input+[class^=icon-],.ink-form .control-group .control>select+[class*=" icon-"],.ink-form .control-group .control>select+[class^=icon-],.ink-form .control-group .control>textarea+[class*=" icon-"],.ink-form .control-group .control>textarea+[class^=icon-]{display:none}.ink-form .control-group .control.append-button span,.ink-form .control-group .control.append-symbol span,.ink-form .control-group .control.prepend-button span,.ink-form .control-group .control.prepend-symbol span{width:100%;position:relative}.ink-form .control-group .control.append-button span>input,.ink-form .control-group .control.append-button span>select,.ink-form .control-group .control.append-button span>textarea,.ink-form .control-group .control.append-symbol span>input,.ink-form .control-group .control.append-symbol span>select,.ink-form .control-group .control.append-symbol span>textarea,.ink-form .control-group .control.prepend-button span>input,.ink-form .control-group .control.prepend-button span>select,.ink-form .control-group .control.prepend-button span>textarea,.ink-form .control-group .control.prepend-symbol span>input,.ink-form .control-group .control.prepend-symbol span>select,.ink-form .control-group .control.prepend-symbol span>textarea{width:100%}.ink-form .control-group .control.append-button>input[type=button],.ink-form .control-group .control.append-button>input[type=reset],.ink-form .control-group .control.append-button>input[type=submit],.ink-form .control-group .control.append-symbol>input[type=button],.ink-form .control-group .control.append-symbol>input[type=reset],.ink-form .control-group .control.append-symbol>input[type=submit],.ink-form .control-group .control.prepend-button>input[type=button],.ink-form .control-group .control.prepend-button>input[type=reset],.ink-form .control-group .control.prepend-button>input[type=submit],.ink-form .control-group .control.prepend-symbol>input[type=button],.ink-form .control-group .control.prepend-symbol>input[type=reset],.ink-form .control-group .control.prepend-symbol>input[type=submit]{width:auto}.ink-form .control-group .control.append-button{display:table}.ink-form .control-group .control.append-button span{display:table-cell}.ink-form .control-group .control.append-button span>input,.ink-form .control-group .control.append-button span>select,.ink-form .control-group .control.append-button span>textarea{-webkit-border-radius:2px 0 0 2px;-moz-border-radius:2px 0 0 2px;-ms-border-radius:2px 0 0 2px;-o-border-radius:2px 0 0 2px;border-radius:2px 0 0 2px}.ink-form .control-group .control.append-button .ink-button{margin:0;-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-ms-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0;border-left:0}.ink-form .control-group .control.prepend-button{display:table}.ink-form .control-group .control.prepend-button span{display:table-cell}.ink-form .control-group .control.prepend-button span>input,.ink-form .control-group .control.prepend-button span>select,.ink-form .control-group .control.prepend-button span>textarea{-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-ms-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0}.ink-form .control-group .control.prepend-button .ink-button{margin:0;-webkit-border-radius:2px 0 0 2px;-moz-border-radius:2px 0 0 2px;-ms-border-radius:2px 0 0 2px;-o-border-radius:2px 0 0 2px;border-radius:2px 0 0 2px;border-right:0}.ink-form .control-group .control.append-symbol span{display:block}.ink-form .control-group .control.append-symbol span>input,.ink-form .control-group .control.append-symbol span>select,.ink-form .control-group .control.append-symbol span>textarea{padding-right:2.5em}.ink-form .control-group .control.append-symbol span>[class*=" fa-"],.ink-form .control-group .control.append-symbol span>[class^=fa-]{position:absolute;right:1em;top:.86em;pointer-events:none}.ink-form .control-group .control.prepend-symbol span{display:block}.ink-form .control-group .control.prepend-symbol span>input,.ink-form .control-group .control.prepend-symbol span>select,.ink-form .control-group .control.prepend-symbol span>textarea{padding-left:2.5em}.ink-form .control-group .control.prepend-symbol span>[class*=" fa-"],.ink-form .control-group .control.prepend-symbol span>[class^=fa-]{position:absolute;left:1em;top:.86em;pointer-events:none}.ink-form .control-group input[type=checkbox],.ink-form .control-group input[type=radio]{padding:0;margin:.55em 0;border:0;clear:left;float:left;cursor:pointer}.ink-form .control-group input[type=checkbox]+label,.ink-form .control-group input[type=radio]+label{float:left;margin:.25em 0 .25em .4em}.ink-form .control-group .inline li{padding:0}.ink-form .control-group .inline li label{margin-right:1em}.ink-form .control-group.validation.error input,.ink-form .control-group.validation.error select,.ink-form .control-group.validation.error textarea{outline:0;-webkit-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;-moz-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;border:1px solid rgba(200,10,16,.5)}.ink-form .control-group.validation.error p.tip{color:rgba(150,7,12,.55)}.ink-form .control-group.validation.warning input,.ink-form .control-group.validation.warning select,.ink-form .control-group.validation.warning textarea{outline:0;-webkit-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;-moz-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;border:1px solid rgba(255,156,0,.6)}.ink-form .control-group.validation.warning p.tip{color:rgba(204,125,0,.6)}.ink-form .control-group.required label,.ink-form .control-group.required p.label{color:#555}.ink-form .control-group.required label:after,.ink-form .control-group.required p.label:after{content:"\f069";color:#c91111;margin-left:.6em;font-family:FontAwesome;font-size:.75em;width:1.25em}.ink-form .control-group.required ul.control label:after{content:""}.ink-grid{width:auto;max-width:1440px;margin:0 auto}.all-5{width:5%;float:left;clear:none}.all-10{width:10%;float:left;clear:none}.all-15{width:15%;float:left;clear:none}.all-16{width:16.66%;float:left;clear:none}.all-20{width:20%;float:left;clear:none}.all-25{width:25%;float:left;clear:none}.all-30{width:30%;float:left;clear:none}.all-33{width:33.33%;float:left;clear:none}.all-35{width:35%;float:left;clear:none}.all-40{width:40%;float:left;clear:none}.all-45{width:45%;float:left;clear:none}.all-50{width:50%;float:left;clear:none}.all-55{width:55%;float:left;clear:none}.all-60{width:60%;float:left;clear:none}.all-65{width:65%;float:left;clear:none}.all-66{width:66.66%;float:left;clear:none}.all-70{width:70%;float:left;clear:none}.all-75{width:75%;float:left;clear:none}.all-80{width:80%;float:left;clear:none}.all-85{width:85%;float:left;clear:none}.all-90{width:90%;float:left;clear:none}.all-95{width:95%;float:left;clear:none}.all-100{width:100%;float:left;clear:none}[class~=all-100]{float:none;clear:both}@media screen and (min-width:1261px){.ink-grid{padding:0 2em}.column-group>[class*=xlarge-]{float:left;clear:none}.xlarge-5{width:5%}.xlarge-10{width:10%}.xlarge-15{width:15%}.xlarge-16{width:16.66%}.xlarge-20{width:20%}.xlarge-25{width:25%}.xlarge-30{width:30%}.xlarge-33{width:33.33%}.xlarge-35{width:35%}.xlarge-40{width:40%}.xlarge-45{width:45%}.xlarge-50{width:50%}.xlarge-55{width:55%}.xlarge-60{width:60%}.xlarge-65{width:65%}.xlarge-66{width:66.66%}.xlarge-70{width:70%}.xlarge-75{width:75%}.xlarge-80{width:80%}.xlarge-85{width:85%}.xlarge-90{width:90%}.xlarge-95{width:95%}.xlarge-100{width:100%}[class*=xlarge-100]{float:none;clear:both}.column-group{*zoom:1}.column-group:after{content:"";display:table;clear:both}.column-group.gutters{margin-left:-2em}.column-group.gutters>[class*=all-],.column-group.gutters>[class*=xlarge-]{padding-left:2em;margin-bottom:2em}.column-group.horizontal-gutters{margin-left:-2em}.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=xlarge-]{padding-left:2em}.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=xlarge-]{margin-bottom:2em}.column-group.double-gutters{margin-left:-4em}.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=xlarge-]{padding-left:4em;margin-bottom:4em}.column-group.double-horizontal-gutters{margin-left:-4em}.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=xlarge-]{padding-left:4em}.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=xlarge-]{margin-bottom:4em}.column-group.half-gutters{margin-left:-1em}.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=xlarge-]{padding-left:1em;margin-bottom:1em}.column-group.half-horizontal-gutters{margin-left:-1em}.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=xlarge-]{padding-left:1em}.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=xlarge-]{margin-bottom:1em}.column-group.quarter-gutters{margin-left:-.5em}.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=xlarge-]{padding-left:.5em;margin-bottom:.5em}.column-group.quarter-horizontal-gutters{margin-left:-.5em}.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=xlarge-]{padding-left:.5em}.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=xlarge-]{margin-bottom:.5em}.column-group.xlarge-gutters{margin-left:-2em}.column-group.xlarge-gutters>[class*=all-],.column-group.xlarge-gutters>[class*=xlarge-]{padding-left:2em;margin-bottom:2em}.column-group.xlarge-horizontal-gutters{margin-left:-2em}.column-group.xlarge-horizontal-gutters>[class*=all-],.column-group.xlarge-horizontal-gutters>[class*=xlarge-]{padding-left:2em}.column-group.xlarge-vertical-gutters>[class*=all-],.column-group.xlarge-vertical-gutters>[class*=xlarge-]{margin-bottom:2em}.column-group.xlarge-double-gutters{margin-left:-4em}.column-group.xlarge-double-gutters>[class*=all-],.column-group.xlarge-double-gutters>[class*=xlarge-]{padding-left:4em;margin-bottom:4em}.column-group.xlarge-double-horizontal-gutters{margin-left:-4em}.column-group.xlarge-double-horizontal-gutters>[class*=all-],.column-group.xlarge-double-horizontal-gutters>[class*=xlarge-]{padding-left:4em}.column-group.xlarge-double-vertical-gutters>[class*=all-],.column-group.xlarge-double-vertical-gutters>[class*=xlarge-]{margin-bottom:4em}.column-group.xlarge-half-gutters{margin-left:-1em}.column-group.xlarge-half-gutters>[class*=all-],.column-group.xlarge-half-gutters>[class*=xlarge-]{padding-left:1em;margin-bottom:1em}.column-group.xlarge-half-horizontal-gutters{margin-left:-1em}.column-group.xlarge-half-horizontal-gutters>[class*=all-],.column-group.xlarge-half-horizontal-gutters>[class*=xlarge-]{padding-left:1em}.column-group.xlarge-half-vertical-gutters>[class*=all-],.column-group.xlarge-half-vertical-gutters>[class*=xlarge-]{margin-bottom:1em}.column-group.xlarge-quarter-gutters{margin-left:-.5em}.column-group.xlarge-quarter-gutters>[class*=all-],.column-group.xlarge-quarter-gutters>[class*=xlarge-]{padding-left:.5em;margin-bottom:.5em}.column-group.xlarge-quarter-horizontal-gutters{margin-left:-.5em}.column-group.xlarge-quarter-horizontal-gutters>[class*=all-],.column-group.xlarge-quarter-horizontal-gutters>[class*=xlarge-]{padding-left:.5em}.column-group.xlarge-quarter-vertical-gutters>[class*=all-],.column-group.xlarge-quarter-vertical-gutters>[class*=xlarge-]{margin-bottom:.5em}.column-group.xlarge-no-gutters{margin-left:0}.column-group.xlarge-no-gutters>[class*=all-],.column-group.xlarge-no-gutters>[class*=xlarge-]{padding-left:0;margin-bottom:0}.ink-table tbody[class*=xlarge-],.ink-table td[class*=xlarge-],.ink-table tfoot[class*=xlarge-],.ink-table th[class*=xlarge-],.ink-table thead[class*=xlarge-],.ink-table tr[class*=xlarge-]{float:none}.xlarge-push-left{float:left}.xlarge-push-center{float:none;margin-left:auto;margin-right:auto}.xlarge-push-right{float:right}.xlarge-align-left{text-align:left}.xlarge-align-center{text-align:center}.xlarge-align-right{text-align:right}.xlarge-no-margin{margin:0!important}.space,.xlarge-space{margin:2em}.padding,.xlarge-padding{padding:2em}.double-space,.xlarge-double-space{margin:4em}.double-padding,.xlarge-double-padding{padding:4em}.half-space,.xlarge-half-space{margin:1em}.half-padding,.xlarge-half-padding{padding:1em}.quarter-space,.xlarge-quarter-space{margin:.5em}.quarter-padding,.xlarge-quarter-padding{padding:.5em}.vertical-space,.xlarge-vertical-space{margin-top:2em;margin-bottom:2em}.vertical-padding,.xlarge-vertical-padding{padding-top:2em;padding-bottom:2em}.double-vertical-space,.xlarge-double-vertical-space{margin-top:4em;margin-bottom:4em}.double-vertical-padding,.xlarge-double-vertical-padding{padding-top:4em;padding-bottom:4em}.half-vertical-space,.xlarge-half-vertical-space{margin-top:1em;margin-bottom:1em}.half-vertical-padding,.xlarge-half-vertical-padding{padding-top:1em;padding-bottom:1em}.quarter-vertical-space,.xlarge-quarter-vertical-space{margin-top:.5em;margin-bottom:.5em}.quarter-vertical-padding,.xlarge-quarter-vertical-padding{padding-top:.5em;padding-bottom:.5em}.horizontal-space,.xlarge-horizontal-space{margin-left:2em;margin-right:2em}.horizontal-padding,.xlarge-horizontal-padding{padding-left:2em;padding-right:2em}.double-horizontal-space,.xlarge-double-horizontal-space{margin-left:4em;margin-right:4em}.double-horizontal-padding,.xlarge-double-horizontal-padding{padding-left:4em;padding-right:4em}.half-horizontal-space,.xlarge-half-horizontal-space{margin-left:1em;margin-right:1em}.half-horizontal-padding,.xlarge-half-horizontal-padding{padding-left:1em;padding-right:1em}.quarter-horizontal-space,.xlarge-quarter-horizontal-space{margin-left:.5em;margin-right:.5em}.quarter-horizontal-padding,.xlarge-quarter-horizontal-padding{padding-left:.5em;padding-right:.5em}.top-space,.xlarge-top-space{margin-top:2em}.top-padding,.xlarge-top-padding{padding-top:2em}.double-top-space,.xlarge-double-top-space{margin-top:4em}.double-top-padding,.xlarge-double-top-padding{padding-top:4em}.half-top-space,.xlarge-half-top-space{margin-top:1em}.half-top-padding,.xlarge-half-top-padding{padding-top:1em}.quarter-top-space,.xlarge-quarter-top-space{margin-top:.5em}.quarter-top-padding,.xlarge-quarter-top-padding{padding-top:.5em}.right-space,.xlarge-right-space{margin-right:2em}.right-padding,.xlarge-right-padding{padding-right:2em}.double-right-space,.xlarge-double-right-space{margin-right:4em}.double-right-padding,.xlarge-double-right-padding{padding-right:4em}.half-right-space,.xlarge-half-right-space{margin-right:1em}.half-right-padding,.xlarge-half-right-padding{padding-right:1em}.quarter-right-space,.xlarge-quarter-right-space{margin-right:.5em}.quarter-right-padding,.xlarge-quarter-right-padding{padding-right:.5em}.bottom-space,.xlarge-bottom-space{margin-bottom:2em}.bottom-padding,.xlarge-bottom-padding{padding-bottom:2em}.double-bottom-space,.xlarge-double-bottom-space{margin-bottom:4em}.double-bottom-padding,.xlarge-double-bottom-padding{padding-bottom:4em}.half-bottom-space,.xlarge-half-bottom-space{margin-bottom:1em}.half-bottom-padding,.xlarge-half-bottom-padding{padding-bottom:1em}.quarter-bottom-space,.xlarge-quarter-bottom-space{margin-bottom:.5em}.quarter-bottom-padding,.xlarge-quarter-bottom-padding{padding-bottom:.5em}.left-space,.xlarge-left-space{margin-left:2em}.left-padding,.xlarge-left-padding{padding-left:2em}.double-left-space,.xlarge-double-left-space{margin-left:4em}.double-left-padding,.xlarge-double-left-padding{padding-left:4em}.half-left-space,.xlarge-half-left-space{margin-left:1em}.half-left-padding,.xlarge-half-left-padding{padding-left:1em}.quarter-left-space,.xlarge-quarter-left-space{margin-left:.5em}.quarter-left-padding,.xlarge-quarter-left-padding{padding-left:.5em}.hide-xlarge{display:none!important}.show-xlarge{display:inherit!important}table.show-xlarge{display:table}thead.show-xlarge{display:table-header-group}tbody.show-xlarge{display:table-row-group}tfoot.show-xlarge{display:table-footer-group}tr.show-xlarge{display:table-row}td.show-xlarge,th.show-xlarge{display:table-cell}}@media screen and (min-width:961px) and (max-width:1260px){.ink-grid{padding:0 1.75em}.column-group>[class*=large-]{float:left;clear:none}.large-5{width:5%}.large-10{width:10%}.large-15{width:15%}.large-16{width:16.66%}.large-20{width:20%}.large-25{width:25%}.large-30{width:30%}.large-33{width:33.33%}.large-35{width:35%}.large-40{width:40%}.large-45{width:45%}.large-50{width:50%}.large-55{width:55%}.large-60{width:60%}.large-65{width:65%}.large-66{width:66.66%}.large-70{width:70%}.large-75{width:75%}.large-80{width:80%}.large-85{width:85%}.large-90{width:90%}.large-95{width:95%}.large-100{width:100%}[class*=large-100]{float:none;clear:both}.column-group{*zoom:1}.column-group:after{content:"";display:table;clear:both}.column-group.gutters{margin-left:-1.75em}.column-group.gutters>[class*=all-],.column-group.gutters>[class*=large-]{padding-left:1.75em;margin-bottom:1.75em}.column-group.horizontal-gutters{margin-left:-1.75em}.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=large-]{padding-left:1.75em}.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=large-]{margin-bottom:1.75em}.column-group.double-gutters{margin-left:-3.5em}.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=large-]{padding-left:3.5em;margin-bottom:3.5em}.column-group.double-horizontal-gutters{margin-left:-3.5em}.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=large-]{padding-left:3.5em}.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=large-]{margin-bottom:3.5em}.column-group.half-gutters{margin-left:-.875em}.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=large-]{padding-left:.875em;margin-bottom:.875em}.column-group.half-horizontal-gutters{margin-left:-.875em}.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=large-]{padding-left:.875em}.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=large-]{margin-bottom:.875em}.column-group.quarter-gutters{margin-left:-.4375em}.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=large-]{padding-left:.4375em;margin-bottom:.4375em}.column-group.quarter-horizontal-gutters{margin-left:-.4375em}.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=large-]{padding-left:.4375em}.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=large-]{margin-bottom:.4375em}.column-group.large-gutters{margin-left:-1.75em}.column-group.large-gutters>[class*=all-],.column-group.large-gutters>[class*=large-]{padding-left:1.75em;margin-bottom:1.75em}.column-group.large-horizontal-gutters{margin-left:-1.75em}.column-group.large-horizontal-gutters>[class*=all-],.column-group.large-horizontal-gutters>[class*=large-]{padding-left:1.75em}.column-group.large-vertical-gutters>[class*=all-],.column-group.large-vertical-gutters>[class*=large-]{margin-bottom:1.75em}.column-group.large-double-gutters{margin-left:-3.5em}.column-group.large-double-gutters>[class*=all-],.column-group.large-double-gutters>[class*=large-]{padding-left:3.5em;margin-bottom:3.5em}.column-group.large-double-horizontal-gutters{margin-left:-3.5em}.column-group.large-double-horizontal-gutters>[class*=all-],.column-group.large-double-horizontal-gutters>[class*=large-]{padding-left:3.5em}.column-group.large-double-vertical-gutters>[class*=all-],.column-group.large-double-vertical-gutters>[class*=large-]{margin-bottom:3.5em}.column-group.large-half-gutters{margin-left:-.875em}.column-group.large-half-gutters>[class*=all-],.column-group.large-half-gutters>[class*=large-]{padding-left:.875em;margin-bottom:.875em}.column-group.large-half-horizontal-gutters{margin-left:-.875em}.column-group.large-half-horizontal-gutters>[class*=all-],.column-group.large-half-horizontal-gutters>[class*=large-]{padding-left:.875em}.column-group.large-half-vertical-gutters>[class*=all-],.column-group.large-half-vertical-gutters>[class*=large-]{margin-bottom:.875em}.column-group.large-quarter-gutters{margin-left:-.4375em}.column-group.large-quarter-gutters>[class*=all-],.column-group.large-quarter-gutters>[class*=large-]{padding-left:.4375em;margin-bottom:.4375em}.column-group.large-quarter-horizontal-gutters{margin-left:-.4375em}.column-group.large-quarter-horizontal-gutters>[class*=all-],.column-group.large-quarter-horizontal-gutters>[class*=large-]{padding-left:.4375em}.column-group.large-quarter-vertical-gutters>[class*=all-],.column-group.large-quarter-vertical-gutters>[class*=large-]{margin-bottom:.4375em}.column-group.large-no-gutters{margin-left:0}.column-group.large-no-gutters>[class*=all-],.column-group.large-no-gutters>[class*=large-]{padding-left:0;margin-bottom:0}.ink-table tbody[class*=large-],.ink-table td[class*=large-],.ink-table tfoot[class*=large-],.ink-table th[class*=large-],.ink-table thead[class*=large-],.ink-table tr[class*=large-]{float:none}.large-push-left{float:left}.large-push-center{float:none;margin-left:auto;margin-right:auto}.large-push-right{float:right}.large-align-left{text-align:left}.large-align-center{text-align:center}.large-align-right{text-align:right}.large-no-margin{margin:0!important}.large-space,.space{margin:1.75em}.large-padding,.padding{padding:1.75em}.double-space,.large-double-space{margin:3.5em}.double-padding,.large-double-padding{padding:3.5em}.half-space,.large-half-space{margin:.875em}.half-padding,.large-half-padding{padding:.875em}.large-quarter-space,.quarter-space{margin:.4375em}.large-quarter-padding,.quarter-padding{padding:.4375em}.large-vertical-space,.vertical-space{margin-top:1.75em;margin-bottom:1.75em}.large-vertical-padding,.vertical-padding{padding-top:1.75em;padding-bottom:1.75em}.double-vertical-space,.large-double-vertical-space{margin-top:3.5em;margin-bottom:3.5em}.double-vertical-padding,.large-double-vertical-padding{padding-top:3.5em;padding-bottom:3.5em}.half-vertical-space,.large-half-vertical-space{margin-top:.875em;margin-bottom:.875em}.half-vertical-padding,.large-half-vertical-padding{padding-top:.875em;padding-bottom:.875em}.large-quarter-vertical-space,.quarter-vertical-space{margin-top:.4375em;margin-bottom:.4375em}.large-quarter-vertical-padding,.quarter-vertical-padding{padding-top:.4375em;padding-bottom:.4375em}.horizontal-space,.large-horizontal-space{margin-left:1.75em;margin-right:1.75em}.horizontal-padding,.large-horizontal-padding{padding-left:1.75em;padding-right:1.75em}.double-horizontal-space,.large-double-horizontal-space{margin-left:3.5em;margin-right:3.5em}.double-horizontal-padding,.large-double-horizontal-padding{padding-left:3.5em;padding-right:3.5em}.half-horizontal-space,.large-half-horizontal-space{margin-left:.875em;margin-right:.875em}.half-horizontal-padding,.large-half-horizontal-padding{padding-left:.875em;padding-right:.875em}.large-quarter-horizontal-space,.quarter-horizontal-space{margin-left:.4375em;margin-right:.4375em}.large-quarter-horizontal-padding,.quarter-horizontal-padding{padding-left:.4375em;padding-right:.4375em}.large-top-space,.top-space{margin-top:1.75em}.large-top-padding,.top-padding{padding-top:1.75em}.double-top-space,.large-double-top-space{margin-top:3.5em}.double-top-padding,.large-double-top-padding{padding-top:3.5em}.half-top-space,.large-half-top-space{margin-top:.875em}.half-top-padding,.large-half-top-padding{padding-top:.875em}.large-quarter-top-space,.quarter-top-space{margin-top:.4375em}.large-quarter-top-padding,.quarter-top-padding{padding-top:.4375em}.large-right-space,.right-space{margin-right:1.75em}.large-right-padding,.right-padding{padding-right:1.75em}.double-right-space,.large-double-right-space{margin-right:3.5em}.double-right-padding,.large-double-right-padding{padding-right:3.5em}.half-right-space,.large-half-right-space{margin-right:.875em}.half-right-padding,.large-half-right-padding{padding-right:.875em}.large-quarter-right-space,.quarter-right-space{margin-right:.4375em}.large-quarter-right-padding,.quarter-right-padding{padding-right:.4375em}.bottom-space,.large-bottom-space{margin-bottom:1.75em}.bottom-padding,.large-bottom-padding{padding-bottom:1.75em}.double-bottom-space,.large-double-bottom-space{margin-bottom:3.5em}.double-bottom-padding,.large-double-bottom-padding{padding-bottom:3.5em}.half-bottom-space,.large-half-bottom-space{margin-bottom:.875em}.half-bottom-padding,.large-half-bottom-padding{padding-bottom:.875em}.large-quarter-bottom-space,.quarter-bottom-space{margin-bottom:.4375em}.large-quarter-bottom-padding,.quarter-bottom-padding{padding-bottom:.4375em}.large-left-space,.left-space{margin-left:1.75em}.large-left-padding,.left-padding{padding-left:1.75em}.double-left-space,.large-double-left-space{margin-left:3.5em}.double-left-padding,.large-double-left-padding{padding-left:3.5em}.half-left-space,.large-half-left-space{margin-left:.875em}.half-left-padding,.large-half-left-padding{padding-left:.875em}.large-quarter-left-space,.quarter-left-space{margin-left:.4375em}.large-quarter-left-padding,.quarter-left-padding{padding-left:.4375em}.hide-large{display:none!important}.show-large{display:inherit!important}table.show-large{display:table}thead.show-large{display:table-header-group}tbody.show-large{display:table-row-group}tfoot.show-large{display:table-footer-group}tr.show-large{display:table-row}td.show-large,th.show-large{display:table-cell}}@media screen and (min-width:641px) and (max-width:960px){.ink-grid{padding:0 1.5em}.column-group>[class*=medium-]{float:left;clear:none}.medium-5{width:5%}.medium-10{width:10%}.medium-15{width:15%}.medium-16{width:16.66%}.medium-20{width:20%}.medium-25{width:25%}.medium-30{width:30%}.medium-33{width:33.33%}.medium-35{width:35%}.medium-40{width:40%}.medium-45{width:45%}.medium-50{width:50%}.medium-55{width:55%}.medium-60{width:60%}.medium-65{width:65%}.medium-66{width:66.66%}.medium-70{width:70%}.medium-75{width:75%}.medium-80{width:80%}.medium-85{width:85%}.medium-90{width:90%}.medium-95{width:95%}.medium-100{width:100%}[class*=medium-100]{float:none;clear:both}.column-group{*zoom:1}.column-group:after{content:"";display:table;clear:both}.column-group.gutters{margin-left:-1.5em}.column-group.gutters>[class*=all-],.column-group.gutters>[class*=medium-]{padding-left:1.5em;margin-bottom:1.5em}.column-group.horizontal-gutters{margin-left:-1.5em}.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=medium-]{padding-left:1.5em}.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=medium-]{margin-bottom:1.5em}.column-group.double-gutters{margin-left:-3em}.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=medium-]{padding-left:3em;margin-bottom:3em}.column-group.double-horizontal-gutters{margin-left:-3em}.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=medium-]{padding-left:3em}.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=medium-]{margin-bottom:3em}.column-group.half-gutters{margin-left:-.75em}.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=medium-]{padding-left:.75em;margin-bottom:.75em}.column-group.half-horizontal-gutters{margin-left:-.75em}.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=medium-]{padding-left:.75em}.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=medium-]{margin-bottom:.75em}.column-group.quarter-gutters{margin-left:-.375em}.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=medium-]{padding-left:.375em;margin-bottom:.375em}.column-group.quarter-horizontal-gutters{margin-left:-.375em}.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=medium-]{padding-left:.375em}.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=medium-]{margin-bottom:.375em}.column-group.medium-gutters{margin-left:-1.5em}.column-group.medium-gutters>[class*=all-],.column-group.medium-gutters>[class*=medium-]{padding-left:1.5em;margin-bottom:1.5em}.column-group.medium-horizontal-gutters{margin-left:-1.5em}.column-group.medium-horizontal-gutters>[class*=all-],.column-group.medium-horizontal-gutters>[class*=medium-]{padding-left:1.5em}.column-group.medium-vertical-gutters>[class*=all-],.column-group.medium-vertical-gutters>[class*=medium-]{margin-bottom:1.5em}.column-group.medium-double-gutters{margin-left:-3em}.column-group.medium-double-gutters>[class*=all-],.column-group.medium-double-gutters>[class*=medium-]{padding-left:3em;margin-bottom:3em}.column-group.medium-double-horizontal-gutters{margin-left:-3em}.column-group.medium-double-horizontal-gutters>[class*=all-],.column-group.medium-double-horizontal-gutters>[class*=medium-]{padding-left:3em}.column-group.medium-double-vertical-gutters>[class*=all-],.column-group.medium-double-vertical-gutters>[class*=medium-]{margin-bottom:3em}.column-group.medium-half-gutters{margin-left:-.75em}.column-group.medium-half-gutters>[class*=all-],.column-group.medium-half-gutters>[class*=medium-]{padding-left:.75em;margin-bottom:.75em}.column-group.medium-half-horizontal-gutters{margin-left:-.75em}.column-group.medium-half-horizontal-gutters>[class*=all-],.column-group.medium-half-horizontal-gutters>[class*=medium-]{padding-left:.75em}.column-group.medium-half-vertical-gutters>[class*=all-],.column-group.medium-half-vertical-gutters>[class*=medium-]{margin-bottom:.75em}.column-group.medium-quarter-gutters{margin-left:-.375em}.column-group.medium-quarter-gutters>[class*=all-],.column-group.medium-quarter-gutters>[class*=medium-]{padding-left:.375em;margin-bottom:.375em}.column-group.medium-quarter-horizontal-gutters{margin-left:-.375em}.column-group.medium-quarter-horizontal-gutters>[class*=all-],.column-group.medium-quarter-horizontal-gutters>[class*=medium-]{padding-left:.375em}.column-group.medium-quarter-vertical-gutters>[class*=all-],.column-group.medium-quarter-vertical-gutters>[class*=medium-]{margin-bottom:.375em}.column-group.medium-no-gutters{margin-left:0}.column-group.medium-no-gutters>[class*=all-],.column-group.medium-no-gutters>[class*=medium-]{padding-left:0;margin-bottom:0}.ink-table tbody[class*=medium-],.ink-table td[class*=medium-],.ink-table tfoot[class*=medium-],.ink-table th[class*=medium-],.ink-table thead[class*=medium-],.ink-table tr[class*=medium-]{float:none}.medium-push-left{float:left}.medium-push-center{float:none;margin-left:auto;margin-right:auto}.medium-push-right{float:right}.medium-align-left{text-align:left}.medium-align-center{text-align:center}.medium-align-right{text-align:right}.medium-no-margin{margin:0!important}.medium-space,.space{margin:1.5em}.medium-padding,.padding{padding:1.5em}.double-space,.medium-double-space{margin:3em}.double-padding,.medium-double-padding{padding:3em}.half-space,.medium-half-space{margin:.75em}.half-padding,.medium-half-padding{padding:.75em}.medium-quarter-space,.quarter-space{margin:.375em}.medium-quarter-padding,.quarter-padding{padding:.375em}.medium-vertical-space,.vertical-space{margin-top:1.5em;margin-bottom:1.5em}.medium-vertical-padding,.vertical-padding{padding-top:1.5em;padding-bottom:1.5em}.double-vertical-space,.medium-double-vertical-space{margin-top:3em;margin-bottom:3em}.double-vertical-padding,.medium-double-vertical-padding{padding-top:3em;padding-bottom:3em}.half-vertical-space,.medium-half-vertical-space{margin-top:.75em;margin-bottom:.75em}.half-vertical-padding,.medium-half-vertical-padding{padding-top:.75em;padding-bottom:.75em}.medium-quarter-vertical-space,.quarter-vertical-space{margin-top:.375em;margin-bottom:.375em}.medium-quarter-vertical-padding,.quarter-vertical-padding{padding-top:.375em;padding-bottom:.375em}.horizontal-space,.medium-horizontal-space{margin-left:1.5em;margin-right:1.5em}.horizontal-padding,.medium-horizontal-padding{padding-left:1.5em;padding-right:1.5em}.double-horizontal-space,.medium-double-horizontal-space{margin-left:3em;margin-right:3em}.double-horizontal-padding,.medium-double-horizontal-padding{padding-left:3em;padding-right:3em}.half-horizontal-space,.medium-half-horizontal-space{margin-left:.75em;margin-right:.75em}.half-horizontal-padding,.medium-half-horizontal-padding{padding-left:.75em;padding-right:.75em}.medium-quarter-horizontal-space,.quarter-horizontal-space{margin-left:.375em;margin-right:.375em}.medium-quarter-horizontal-padding,.quarter-horizontal-padding{padding-left:.375em;padding-right:.375em}.medium-top-space,.top-space{margin-top:1.5em}.medium-top-padding,.top-padding{padding-top:1.5em}.double-top-space,.medium-double-top-space{margin-top:3em}.double-top-padding,.medium-double-top-padding{padding-top:3em}.half-top-space,.medium-half-top-space{margin-top:.75em}.half-top-padding,.medium-half-top-padding{padding-top:.75em}.medium-quarter-top-space,.quarter-top-space{margin-top:.375em}.medium-quarter-top-padding,.quarter-top-padding{padding-top:.375em}.medium-right-space,.right-space{margin-right:1.5em}.medium-right-padding,.right-padding{padding-right:1.5em}.double-right-space,.medium-double-right-space{margin-right:3em}.double-right-padding,.medium-double-right-padding{padding-right:3em}.half-right-space,.medium-half-right-space{margin-right:.75em}.half-right-padding,.medium-half-right-padding{padding-right:.75em}.medium-quarter-right-space,.quarter-right-space{margin-right:.375em}.medium-quarter-right-padding,.quarter-right-padding{padding-right:.375em}.bottom-space,.medium-bottom-space{margin-bottom:1.5em}.bottom-padding,.medium-bottom-padding{padding-bottom:1.5em}.double-bottom-space,.medium-double-bottom-space{margin-bottom:3em}.double-bottom-padding,.medium-double-bottom-padding{padding-bottom:3em}.half-bottom-space,.medium-half-bottom-space{margin-bottom:.75em}.half-bottom-padding,.medium-half-bottom-padding{padding-bottom:.75em}.medium-quarter-bottom-space,.quarter-bottom-space{margin-bottom:.375em}.medium-quarter-bottom-padding,.quarter-bottom-padding{padding-bottom:.375em}.left-space,.medium-left-space{margin-left:1.5em}.left-padding,.medium-left-padding{padding-left:1.5em}.double-left-space,.medium-double-left-space{margin-left:3em}.double-left-padding,.medium-double-left-padding{padding-left:3em}.half-left-space,.medium-half-left-space{margin-left:.75em}.half-left-padding,.medium-half-left-padding{padding-left:.75em}.medium-quarter-left-space,.quarter-left-space{margin-left:.375em}.medium-quarter-left-padding,.quarter-left-padding{padding-left:.375em}.hide-medium{display:none!important}.show-medium{display:inherit!important}table.show-medium{display:table}thead.show-medium{display:table-header-group}tbody.show-medium{display:table-row-group}tfoot.show-medium{display:table-footer-group}tr.show-medium{display:table-row}td.show-medium,th.show-medium{display:table-cell}}@media screen and (min-width:321px) and (max-width:640px){.ink-grid{padding:0 1.25em}.column-group>[class*=small-]{float:left;clear:none}.small-5{width:5%}.small-10{width:10%}.small-15{width:15%}.small-16{width:16.66%}.small-20{width:20%}.small-25{width:25%}.small-30{width:30%}.small-33{width:33.33%}.small-35{width:35%}.small-40{width:40%}.small-45{width:45%}.small-50{width:50%}.small-55{width:55%}.small-60{width:60%}.small-65{width:65%}.small-66{width:66.66%}.small-70{width:70%}.small-75{width:75%}.small-80{width:80%}.small-85{width:85%}.small-90{width:90%}.small-95{width:95%}.small-100{width:100%}[class*=small-100]{float:none;clear:both}.column-group{*zoom:1}.column-group:after{content:"";display:table;clear:both}.column-group.gutters{margin-left:-1.25em}.column-group.gutters>[class*=all-],.column-group.gutters>[class*=small-]{padding-left:1.25em;margin-bottom:1.25em}.column-group.horizontal-gutters{margin-left:-1.25em}.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=small-]{padding-left:1.25em}.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=small-]{margin-bottom:1.25em}.column-group.double-gutters{margin-left:-2.5em}.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=small-]{padding-left:2.5em;margin-bottom:2.5em}.column-group.double-horizontal-gutters{margin-left:-2.5em}.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=small-]{padding-left:2.5em}.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=small-]{margin-bottom:2.5em}.column-group.half-gutters{margin-left:-.625em}.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=small-]{padding-left:.625em;margin-bottom:.625em}.column-group.half-horizontal-gutters{margin-left:-.625em}.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=small-]{padding-left:.625em}.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=small-]{margin-bottom:.625em}.column-group.quarter-gutters{margin-left:-.3125em}.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=small-]{padding-left:.3125em;margin-bottom:.3125em}.column-group.quarter-horizontal-gutters{margin-left:-.3125em}.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=small-]{padding-left:.3125em}.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=small-]{margin-bottom:.3125em}.column-group.small-gutters{margin-left:-1.25em}.column-group.small-gutters>[class*=all-],.column-group.small-gutters>[class*=small-]{padding-left:1.25em;margin-bottom:1.25em}.column-group.small-horizontal-gutters{margin-left:-1.25em}.column-group.small-horizontal-gutters>[class*=all-],.column-group.small-horizontal-gutters>[class*=small-]{padding-left:1.25em}.column-group.small-vertical-gutters>[class*=all-],.column-group.small-vertical-gutters>[class*=small-]{margin-bottom:1.25em}.column-group.small-double-gutters{margin-left:-2.5em}.column-group.small-double-gutters>[class*=all-],.column-group.small-double-gutters>[class*=small-]{padding-left:2.5em;margin-bottom:2.5em}.column-group.small-double-horizontal-gutters{margin-left:-2.5em}.column-group.small-double-horizontal-gutters>[class*=all-],.column-group.small-double-horizontal-gutters>[class*=small-]{padding-left:2.5em}.column-group.small-double-vertical-gutters>[class*=all-],.column-group.small-double-vertical-gutters>[class*=small-]{margin-bottom:2.5em}.column-group.small-half-gutters{margin-left:-.625em}.column-group.small-half-gutters>[class*=all-],.column-group.small-half-gutters>[class*=small-]{padding-left:.625em;margin-bottom:.625em}.column-group.small-half-horizontal-gutters{margin-left:-.625em}.column-group.small-half-horizontal-gutters>[class*=all-],.column-group.small-half-horizontal-gutters>[class*=small-]{padding-left:.625em}.column-group.small-half-vertical-gutters>[class*=all-],.column-group.small-half-vertical-gutters>[class*=small-]{margin-bottom:.625em}.column-group.small-quarter-gutters{margin-left:-.3125em}.column-group.small-quarter-gutters>[class*=all-],.column-group.small-quarter-gutters>[class*=small-]{padding-left:.3125em;margin-bottom:.3125em}.column-group.small-quarter-horizontal-gutters{margin-left:-.3125em}.column-group.small-quarter-horizontal-gutters>[class*=all-],.column-group.small-quarter-horizontal-gutters>[class*=small-]{padding-left:.3125em}.column-group.small-quarter-vertical-gutters>[class*=all-],.column-group.small-quarter-vertical-gutters>[class*=small-]{margin-bottom:.3125em}.column-group.small-no-gutters{margin-left:0}.column-group.small-no-gutters>[class*=all-],.column-group.small-no-gutters>[class*=small-]{padding-left:0;margin-bottom:0}.ink-table tbody[class*=small-],.ink-table td[class*=small-],.ink-table tfoot[class*=small-],.ink-table th[class*=small-],.ink-table thead[class*=small-],.ink-table tr[class*=small-]{float:none}.small-push-left{float:left}.small-push-center{float:none;margin-left:auto;margin-right:auto}.small-push-right{float:right}.small-align-left{text-align:left}.small-align-center{text-align:center}.small-align-right{text-align:right}.small-no-margin{margin:0!important}.small-space,.space{margin:1.25em}.padding,.small-padding{padding:1.25em}.double-space,.small-double-space{margin:2.5em}.double-padding,.small-double-padding{padding:2.5em}.half-space,.small-half-space{margin:.625em}.half-padding,.small-half-padding{padding:.625em}.quarter-space,.small-quarter-space{margin:.3125em}.quarter-padding,.small-quarter-padding{padding:.3125em}.small-vertical-space,.vertical-space{margin-top:1.25em;margin-bottom:1.25em}.small-vertical-padding,.vertical-padding{padding-top:1.25em;padding-bottom:1.25em}.double-vertical-space,.small-double-vertical-space{margin-top:2.5em;margin-bottom:2.5em}.double-vertical-padding,.small-double-vertical-padding{padding-top:2.5em;padding-bottom:2.5em}.half-vertical-space,.small-half-vertical-space{margin-top:.625em;margin-bottom:.625em}.half-vertical-padding,.small-half-vertical-padding{padding-top:.625em;padding-bottom:.625em}.quarter-vertical-space,.small-quarter-vertical-space{margin-top:.3125em;margin-bottom:.3125em}.quarter-vertical-padding,.small-quarter-vertical-padding{padding-top:.3125em;padding-bottom:.3125em}.horizontal-space,.small-horizontal-space{margin-left:1.25em;margin-right:1.25em}.horizontal-padding,.small-horizontal-padding{padding-left:1.25em;padding-right:1.25em}.double-horizontal-space,.small-double-horizontal-space{margin-left:2.5em;margin-right:2.5em}.double-horizontal-padding,.small-double-horizontal-padding{padding-left:2.5em;padding-right:2.5em}.half-horizontal-space,.small-half-horizontal-space{margin-left:.625em;margin-right:.625em}.half-horizontal-padding,.small-half-horizontal-padding{padding-left:.625em;padding-right:.625em}.quarter-horizontal-space,.small-quarter-horizontal-space{margin-left:.3125em;margin-right:.3125em}.quarter-horizontal-padding,.small-quarter-horizontal-padding{padding-left:.3125em;padding-right:.3125em}.small-top-space,.top-space{margin-top:1.25em}.small-top-padding,.top-padding{padding-top:1.25em}.double-top-space,.small-double-top-space{margin-top:2.5em}.double-top-padding,.small-double-top-padding{padding-top:2.5em}.half-top-space,.small-half-top-space{margin-top:.625em}.half-top-padding,.small-half-top-padding{padding-top:.625em}.quarter-top-space,.small-quarter-top-space{margin-top:.3125em}.quarter-top-padding,.small-quarter-top-padding{padding-top:.3125em}.right-space,.small-right-space{margin-right:1.25em}.right-padding,.small-right-padding{padding-right:1.25em}.double-right-space,.small-double-right-space{margin-right:2.5em}.double-right-padding,.small-double-right-padding{padding-right:2.5em}.half-right-space,.small-half-right-space{margin-right:.625em}.half-right-padding,.small-half-right-padding{padding-right:.625em}.quarter-right-space,.small-quarter-right-space{margin-right:.3125em}.quarter-right-padding,.small-quarter-right-padding{padding-right:.3125em}.bottom-space,.small-bottom-space{margin-bottom:1.25em}.bottom-padding,.small-bottom-padding{padding-bottom:1.25em}.double-bottom-space,.small-double-bottom-space{margin-bottom:2.5em}.double-bottom-padding,.small-double-bottom-padding{padding-bottom:2.5em}.half-bottom-space,.small-half-bottom-space{margin-bottom:.625em}.half-bottom-padding,.small-half-bottom-padding{padding-bottom:.625em}.quarter-bottom-space,.small-quarter-bottom-space{margin-bottom:.3125em}.quarter-bottom-padding,.small-quarter-bottom-padding{padding-bottom:.3125em}.left-space,.small-left-space{margin-left:1.25em}.left-padding,.small-left-padding{padding-left:1.25em}.double-left-space,.small-double-left-space{margin-left:2.5em}.double-left-padding,.small-double-left-padding{padding-left:2.5em}.half-left-space,.small-half-left-space{margin-left:.625em}.half-left-padding,.small-half-left-padding{padding-left:.625em}.quarter-left-space,.small-quarter-left-space{margin-left:.3125em}.quarter-left-padding,.small-quarter-left-padding{padding-left:.3125em}.hide-small{display:none!important}.show-small{display:inherit!important}table.show-small{display:table}thead.show-small{display:table-header-group}tbody.show-small{display:table-row-group}tfoot.show-small{display:table-footer-group}tr.show-small{display:table-row}td.show-small,th.show-small{display:table-cell}}@media screen and (max-width:320px){.ink-grid{padding:0 1em}.column-group>[class*=tiny-]{float:left;clear:none}.tiny-5{width:5%}.tiny-10{width:10%}.tiny-15{width:15%}.tiny-16{width:16.66%}.tiny-20{width:20%}.tiny-25{width:25%}.tiny-30{width:30%}.tiny-33{width:33.33%}.tiny-35{width:35%}.tiny-40{width:40%}.tiny-45{width:45%}.tiny-50{width:50%}.tiny-55{width:55%}.tiny-60{width:60%}.tiny-65{width:65%}.tiny-66{width:66.66%}.tiny-70{width:70%}.tiny-75{width:75%}.tiny-80{width:80%}.tiny-85{width:85%}.tiny-90{width:90%}.tiny-95{width:95%}.tiny-100{width:100%}[class*=tiny-100]{float:none;clear:both}.column-group{*zoom:1}.column-group:after{content:"";display:table;clear:both}.column-group.gutters{margin-left:-1em}.column-group.gutters>[class*=all-],.column-group.gutters>[class*=tiny-]{padding-left:1em;margin-bottom:1em}.column-group.horizontal-gutters{margin-left:-1em}.column-group.horizontal-gutters>[class*=all-],.column-group.horizontal-gutters>[class*=tiny-]{padding-left:1em}.column-group.vertical-gutters>[class*=all-],.column-group.vertical-gutters>[class*=tiny-]{margin-bottom:1em}.column-group.double-gutters{margin-left:-2em}.column-group.double-gutters>[class*=all-],.column-group.double-gutters>[class*=tiny-]{padding-left:2em;margin-bottom:2em}.column-group.double-horizontal-gutters{margin-left:-2em}.column-group.double-horizontal-gutters>[class*=all-],.column-group.double-horizontal-gutters>[class*=tiny-]{padding-left:2em}.column-group.double-vertical-gutters>[class*=all-],.column-group.double-vertical-gutters>[class*=tiny-]{margin-bottom:2em}.column-group.half-gutters{margin-left:-.5em}.column-group.half-gutters>[class*=all-],.column-group.half-gutters>[class*=tiny-]{padding-left:.5em;margin-bottom:.5em}.column-group.half-horizontal-gutters{margin-left:-.5em}.column-group.half-horizontal-gutters>[class*=all-],.column-group.half-horizontal-gutters>[class*=tiny-]{padding-left:.5em}.column-group.half-vertical-gutters>[class*=all-],.column-group.half-vertical-gutters>[class*=tiny-]{margin-bottom:.5em}.column-group.quarter-gutters{margin-left:-.25em}.column-group.quarter-gutters>[class*=all-],.column-group.quarter-gutters>[class*=tiny-]{padding-left:.25em;margin-bottom:.25em}.column-group.quarter-horizontal-gutters{margin-left:-.25em}.column-group.quarter-horizontal-gutters>[class*=all-],.column-group.quarter-horizontal-gutters>[class*=tiny-]{padding-left:.25em}.column-group.quarter-vertical-gutters>[class*=all-],.column-group.quarter-vertical-gutters>[class*=tiny-]{margin-bottom:.25em}.column-group.tiny-gutters{margin-left:-1em}.column-group.tiny-gutters>[class*=all-],.column-group.tiny-gutters>[class*=tiny-]{padding-left:1em;margin-bottom:1em}.column-group.tiny-horizontal-gutters{margin-left:-1em}.column-group.tiny-horizontal-gutters>[class*=all-],.column-group.tiny-horizontal-gutters>[class*=tiny-]{padding-left:1em}.column-group.tiny-vertical-gutters>[class*=all-],.column-group.tiny-vertical-gutters>[class*=tiny-]{margin-bottom:1em}.column-group.tiny-double-gutters{margin-left:-2em}.column-group.tiny-double-gutters>[class*=all-],.column-group.tiny-double-gutters>[class*=tiny-]{padding-left:2em;margin-bottom:2em}.column-group.tiny-double-horizontal-gutters{margin-left:-2em}.column-group.tiny-double-horizontal-gutters>[class*=all-],.column-group.tiny-double-horizontal-gutters>[class*=tiny-]{padding-left:2em}.column-group.tiny-double-vertical-gutters>[class*=all-],.column-group.tiny-double-vertical-gutters>[class*=tiny-]{margin-bottom:2em}.column-group.tiny-half-gutters{margin-left:-.5em}.column-group.tiny-half-gutters>[class*=all-],.column-group.tiny-half-gutters>[class*=tiny-]{padding-left:.5em;margin-bottom:.5em}.column-group.tiny-half-horizontal-gutters{margin-left:-.5em}.column-group.tiny-half-horizontal-gutters>[class*=all-],.column-group.tiny-half-horizontal-gutters>[class*=tiny-]{padding-left:.5em}.column-group.tiny-half-vertical-gutters>[class*=all-],.column-group.tiny-half-vertical-gutters>[class*=tiny-]{margin-bottom:.5em}.column-group.tiny-quarter-gutters{margin-left:-.25em}.column-group.tiny-quarter-gutters>[class*=all-],.column-group.tiny-quarter-gutters>[class*=tiny-]{padding-left:.25em;margin-bottom:.25em}.column-group.tiny-quarter-horizontal-gutters{margin-left:-.25em}.column-group.tiny-quarter-horizontal-gutters>[class*=all-],.column-group.tiny-quarter-horizontal-gutters>[class*=tiny-]{padding-left:.25em}.column-group.tiny-quarter-vertical-gutters>[class*=all-],.column-group.tiny-quarter-vertical-gutters>[class*=tiny-]{margin-bottom:.25em}.column-group.tiny-no-gutters{margin-left:0}.column-group.tiny-no-gutters>[class*=all-],.column-group.tiny-no-gutters>[class*=tiny-]{padding-left:0;margin-bottom:0}.ink-table tbody[class*=tiny-],.ink-table td[class*=tiny-],.ink-table tfoot[class*=tiny-],.ink-table th[class*=tiny-],.ink-table thead[class*=tiny-],.ink-table tr[class*=tiny-]{float:none}.tiny-push-left{float:left}.tiny-push-center{float:none;margin-left:auto;margin-right:auto}.tiny-push-right{float:right}.tiny-align-left{text-align:left}.tiny-align-center{text-align:center}.tiny-align-right{text-align:right}.tiny-no-margin{margin:0!important}.space,.tiny-space{margin:1em}.padding,.tiny-padding{padding:1em}.double-space,.tiny-double-space{margin:2em}.double-padding,.tiny-double-padding{padding:2em}.half-space,.tiny-half-space{margin:.5em}.half-padding,.tiny-half-padding{padding:.5em}.quarter-space,.tiny-quarter-space{margin:.25em}.quarter-padding,.tiny-quarter-padding{padding:.25em}.tiny-vertical-space,.vertical-space{margin-top:1em;margin-bottom:1em}.tiny-vertical-padding,.vertical-padding{padding-top:1em;padding-bottom:1em}.double-vertical-space,.tiny-double-vertical-space{margin-top:2em;margin-bottom:2em}.double-vertical-padding,.tiny-double-vertical-padding{padding-top:2em;padding-bottom:2em}.half-vertical-space,.tiny-half-vertical-space{margin-top:.5em;margin-bottom:.5em}.half-vertical-padding,.tiny-half-vertical-padding{padding-top:.5em;padding-bottom:.5em}.quarter-vertical-space,.tiny-quarter-vertical-space{margin-top:.25em;margin-bottom:.25em}.quarter-vertical-padding,.tiny-quarter-vertical-padding{padding-top:.25em;padding-bottom:.25em}.horizontal-space,.tiny-horizontal-space{margin-left:1em;margin-right:1em}.horizontal-padding,.tiny-horizontal-padding{padding-left:1em;padding-right:1em}.double-horizontal-space,.tiny-double-horizontal-space{margin-left:2em;margin-right:2em}.double-horizontal-padding,.tiny-double-horizontal-padding{padding-left:2em;padding-right:2em}.half-horizontal-space,.tiny-half-horizontal-space{margin-left:.5em;margin-right:.5em}.half-horizontal-padding,.tiny-half-horizontal-padding{padding-left:.5em;padding-right:.5em}.quarter-horizontal-space,.tiny-quarter-horizontal-space{margin-left:.25em;margin-right:.25em}.quarter-horizontal-padding,.tiny-quarter-horizontal-padding{padding-left:.25em;padding-right:.25em}.tiny-top-space,.top-space{margin-top:1em}.tiny-top-padding,.top-padding{padding-top:1em}.double-top-space,.tiny-double-top-space{margin-top:2em}.double-top-padding,.tiny-double-top-padding{padding-top:2em}.half-top-space,.tiny-half-top-space{margin-top:.5em}.half-top-padding,.tiny-half-top-padding{padding-top:.5em}.quarter-top-space,.tiny-quarter-top-space{margin-top:.25em}.quarter-top-padding,.tiny-quarter-top-padding{padding-top:.25em}.right-space,.tiny-right-space{margin-right:1em}.right-padding,.tiny-right-padding{padding-right:1em}.double-right-space,.tiny-double-right-space{margin-right:2em}.double-right-padding,.tiny-double-right-padding{padding-right:2em}.half-right-space,.tiny-half-right-space{margin-right:.5em}.half-right-padding,.tiny-half-right-padding{padding-right:.5em}.quarter-right-space,.tiny-quarter-right-space{margin-right:.25em}.quarter-right-padding,.tiny-quarter-right-padding{padding-right:.25em}.bottom-space,.tiny-bottom-space{margin-bottom:1em}.bottom-padding,.tiny-bottom-padding{padding-bottom:1em}.double-bottom-space,.tiny-double-bottom-space{margin-bottom:2em}.double-bottom-padding,.tiny-double-bottom-padding{padding-bottom:2em}.half-bottom-space,.tiny-half-bottom-space{margin-bottom:.5em}.half-bottom-padding,.tiny-half-bottom-padding{padding-bottom:.5em}.quarter-bottom-space,.tiny-quarter-bottom-space{margin-bottom:.25em}.quarter-bottom-padding,.tiny-quarter-bottom-padding{padding-bottom:.25em}.left-space,.tiny-left-space{margin-left:1em}.left-padding,.tiny-left-padding{padding-left:1em}.double-left-space,.tiny-double-left-space{margin-left:2em}.double-left-padding,.tiny-double-left-padding{padding-left:2em}.half-left-space,.tiny-half-left-space{margin-left:.5em}.half-left-padding,.tiny-half-left-padding{padding-left:.5em}.quarter-left-space,.tiny-quarter-left-space{margin-left:.25em}.quarter-left-padding,.tiny-quarter-left-padding{padding-left:.25em}.hide-tiny{display:none!important}.show-tiny{display:inherit!important}table.show-tiny{display:table}thead.show-tiny{display:table-header-group}tbody.show-tiny{display:table-row-group}tfoot.show-tiny{display:table-footer-group}tr.show-tiny{display:table-row}td.show-tiny,th.show-tiny{display:table-cell}}html{font-size:.97em}html:after{content:'[{"name":"xlarge", "size":{"min":"1261px","max":""}},{"name":"large", "size":{"min":"961px","max":"1260px"}},{"name":"medium", "size":{"min":"641px","max":"960px"}},{"name":"small", "size":{"min":"321px","max":"640px"}},{"name":"tiny", "size":{"min":"","max":"320px"}}]';display:none}.ink-label{padding:0 .35em;white-space:nowrap}.ink-navigation{overflow:visible}.ink-navigation ul{list-style-type:none;padding:0;margin:0}.ink-navigation ul li{margin:0}.ink-navigation .breadcrumbs li{line-height:2.7em;display:inline}.ink-navigation .breadcrumbs li a{display:inline;padding:0}.ink-navigation .breadcrumbs li a:hover{background:0 0}.ink-navigation .breadcrumbs li.active a{cursor:default;text-decoration:none}.ink-navigation .breadcrumbs li:first-child a{padding-left:1.2em}.ink-navigation .breadcrumbs li:after{content:'/';display:inline;margin:0 .7em}.ink-navigation .breadcrumbs li:last-child:after{content:'';display:none}.ink-dropdown,.ink-navigation{position:relative}.ink-dropdown ul.dropdown,.ink-dropdown ul.dropdown-menu,.ink-navigation ul.dropdown,.ink-navigation ul.dropdown-menu{position:absolute;top:110%;background:#fff;z-index:30;border:1px solid #d9d9d9;height:auto;width:auto;min-width:10em;max-width:12em;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;-webkit-box-shadow:rgba(100,100,100,.3) 0 0 1px 0;-moz-box-shadow:rgba(100,100,100,.3) 0 0 1px 0;box-shadow:rgba(100,100,100,.3) 0 0 1px 0;margin-left:0;padding:.35em 0;font-size:.85em}.ink-dropdown ul.dropdown li,.ink-dropdown ul.dropdown-menu li,.ink-navigation ul.dropdown li,.ink-navigation ul.dropdown-menu li{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-border-radius:none;-moz-border-radius:none;-ms-border-radius:none;-o-border-radius:none;border-radius:none;width:auto;height:auto;min-height:auto;display:list-item;float:none;margin:0;text-align:left;text-transform:none;padding:0;position:relative;list-style-type:none}.ink-dropdown ul.dropdown li.separator-above,.ink-dropdown ul.dropdown-menu li.separator-above,.ink-navigation ul.dropdown li.separator-above,.ink-navigation ul.dropdown-menu li.separator-above{padding-top:.35em;margin-top:.35em;border-top:1px solid #d9d9d9}.ink-dropdown ul.dropdown li.separator-below,.ink-dropdown ul.dropdown-menu li.separator-below,.ink-navigation ul.dropdown li.separator-below,.ink-navigation ul.dropdown-menu li.separator-below{padding-bottom:.35em;margin-bottom:.35em;border-bottom:1px solid #d9d9d9}.ink-dropdown ul.dropdown li.heading,.ink-dropdown ul.dropdown-menu li.heading,.ink-navigation ul.dropdown li.heading,.ink-navigation ul.dropdown-menu li.heading{font-weight:700;margin-bottom:.35em;padding:.5em .8em;color:#333}.ink-dropdown ul.dropdown li a,.ink-dropdown ul.dropdown-menu li a,.ink-navigation ul.dropdown li a,.ink-navigation ul.dropdown-menu li a{color:#444;padding:.5em .8em;display:block;clear:both}.ink-dropdown ul.dropdown li a:hover,.ink-dropdown ul.dropdown-menu li a:hover,.ink-navigation ul.dropdown li a:hover,.ink-navigation ul.dropdown-menu li a:hover{background:#f2f2f2;text-decoration:none}.ink-dropdown ul.dropdown li.active a,.ink-dropdown ul.dropdown-menu li.active a,.ink-navigation ul.dropdown li.active a,.ink-navigation ul.dropdown-menu li.active a{background:#999;color:#fff}.ink-dropdown ul.dropdown li.disabled a,.ink-dropdown ul.dropdown-menu li.disabled a,.ink-navigation ul.dropdown li.disabled a,.ink-navigation ul.dropdown-menu li.disabled a{color:#b3b3b3}.ink-dropdown ul.dropdown li.disabled a:hover,.ink-dropdown ul.dropdown-menu li.disabled a:hover,.ink-navigation ul.dropdown li.disabled a:hover,.ink-navigation ul.dropdown-menu li.disabled a:hover{background:0 0;cursor:default}.ink-dropdown ul.dropdown li.submenu,.ink-dropdown ul.dropdown-menu li.submenu,.ink-navigation ul.dropdown li.submenu,.ink-navigation ul.dropdown-menu li.submenu{overflow:visible}.ink-dropdown ul.dropdown li.submenu>a,.ink-dropdown ul.dropdown-menu li.submenu>a,.ink-navigation ul.dropdown li.submenu>a,.ink-navigation ul.dropdown-menu li.submenu>a{white-space:nowrap}.ink-dropdown ul.dropdown li.submenu>a:after,.ink-dropdown ul.dropdown-menu li.submenu>a:after,.ink-navigation ul.dropdown li.submenu>a:after,.ink-navigation ul.dropdown-menu li.submenu>a:after{content:"\f0da";width:auto;margin-left:.8em;font-family:FontAwesome;color:#b3b3b3}.ink-dropdown ul.dropdown li.submenu:hover>a,.ink-dropdown ul.dropdown-menu li.submenu:hover>a,.ink-navigation ul.dropdown li.submenu:hover>a,.ink-navigation ul.dropdown-menu li.submenu:hover>a{background:#f2f2f2;text-decoration:none}.ink-dropdown ul.dropdown li.submenu:hover:hover>ul.dropdown,.ink-dropdown ul.dropdown li.submenu:hover:hover>ul.dropdown-menu,.ink-dropdown ul.dropdown-menu li.submenu:hover:hover>ul.dropdown,.ink-dropdown ul.dropdown-menu li.submenu:hover:hover>ul.dropdown-menu,.ink-navigation ul.dropdown li.submenu:hover:hover>ul.dropdown,.ink-navigation ul.dropdown li.submenu:hover:hover>ul.dropdown-menu,.ink-navigation ul.dropdown-menu li.submenu:hover:hover>ul.dropdown,.ink-navigation ul.dropdown-menu li.submenu:hover:hover>ul.dropdown-menu{display:block}.ink-dropdown ul.dropdown li.submenu>ul.dropdown,.ink-dropdown ul.dropdown li.submenu>ul.dropdown-menu,.ink-dropdown ul.dropdown-menu li.submenu>ul.dropdown,.ink-dropdown ul.dropdown-menu li.submenu>ul.dropdown-menu,.ink-navigation ul.dropdown li.submenu>ul.dropdown,.ink-navigation ul.dropdown li.submenu>ul.dropdown-menu,.ink-navigation ul.dropdown-menu li.submenu>ul.dropdown,.ink-navigation ul.dropdown-menu li.submenu>ul.dropdown-menu{font-size:inherit;position:absolute;top:-.36em;left:100%;display:none}.ink-navigation ul.pagination{overflow:hidden;*zoom:1}.ink-navigation ul.pagination li{line-height:1.7;float:left}.ink-navigation ul.pagination li a{padding:.5em 1em;display:block;float:left}.ink-navigation ul.pagination.dotted li a{display:block;height:1em;width:1em;margin-right:.6em;padding:0;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;text-indent:99999px}.ink-navigation ul.pagination.dotted li a:first-child,.ink-navigation ul.pagination.dotted li a:last-child{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%}.ink-navigation ul.pagination.chevron li{display:none}.ink-navigation ul.pagination.chevron li.next,.ink-navigation ul.pagination.chevron li.previous{display:block}.ink-navigation ul.pagination.chevron li.next a,.ink-navigation ul.pagination.chevron li.previous a{display:block;position:absolute;top:35%;padding:0 .5em;margin:0;font-family:FontAwesome;font-size:4em}.ink-navigation ul.pagination.chevron li.next a span,.ink-navigation ul.pagination.chevron li.previous a span{text-indent:-99999px;display:inline-block}.ink-navigation ul.pagination.chevron li.previous a{left:0}.ink-navigation ul.pagination.chevron li.previous a:after{content:"\f137"}.ink-navigation ul.pagination.chevron li.next a{right:0}.ink-navigation ul.pagination.chevron li.next a:after{content:"\f138"}.ink-navigation .pills{overflow:hidden;*zoom:1}.ink-navigation .pills li{overflow:hidden;display:block;float:left;margin:0 .5em .5em 0;line-height:1.7}.ink-navigation .pills li a{display:block;padding:.5em 1em}.ink-navigation .pills li a:hover{text-decoration:none}.ink-navigation .pills li.active a,.ink-navigation .pills li.disabled a{cursor:default}.ink-navigation ul{*height:100%}.ink-navigation ul.menu{*zoom:1}.ink-navigation ul.menu:after{content:"";display:table;clear:both}.ink-navigation ul.menu li{*height:100%}.ink-navigation ul.menu li:hover>ul.submenu{display:block}.ink-navigation ul.menu li ul.submenu{display:none;position:absolute;z-index:10}.ink-navigation ul.menu li ul.submenu li a{padding:.5em 1em;display:block;float:none}.ink-navigation ul.menu.horizontal li{float:left;position:relative}.ink-navigation ul.menu.horizontal li a{padding:.5em 1em;display:block;line-height:1.7}.ink-navigation ul.menu.horizontal li .control{margin-top:.3em}.ink-navigation ul.menu.horizontal li ul.submenu{min-width:100%;z-index:50;top:auto;left:auto}.ink-navigation ul.menu.horizontal li ul.submenu li{float:none}.ink-navigation ul.menu.horizontal li ul.submenu li .flyout{position:absolute;top:0;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.menu.horizontal li ul.submenu li .flyout.left{right:100%}.ink-navigation ul.menu.horizontal li ul.submenu li .flyout.right{left:100%}.ink-navigation ul.menu.vertical li{line-height:1.7;position:relative}.ink-navigation ul.menu.vertical li a{padding:.5em 1em;display:block}.ink-navigation ul.menu.vertical li ul.submenu{position:relative;top:auto;left:auto}.ink-navigation ul.menu.vertical li ul.submenu.flyout{position:absolute;min-width:8em;top:0;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.menu.vertical li ul.submenu.flyout.left{right:100%}.ink-navigation ul.menu.vertical li ul.submenu.flyout.right{left:100%}table.ink-table{width:100%;border-collapse:collapse;border-spacing:0}table.ink-table tr th{padding:5px 10px;line-height:1.3}table.ink-table tr th[data-sortable=true]:hover{cursor:pointer;text-decoration:underline}table.ink-table tr th[data-sortable=true]:hover i{text-decoration:none}table.ink-table tr th[data-sortable=true] i{padding-left:.5em}table.ink-table tr td{padding:5px 10px;line-height:1.3}table.ink-table.hover tbody tr:hover{cursor:pointer}table.ink-table.bordered{border-collapse:separate}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{color:#555;font-family:Roboto,Arial,Helvetica,sans-serif;line-height:1.45}.fw-100,.fw-light{font-weight:100}.fw-300,.fw-thin{font-weight:300}.fw-400,.fw-regular{font-weight:400}.fw-500,.fw-medium{font-weight:500}.fw-700,.fw-bold{font-weight:700}.fw-900,.fw-black{font-weight:900}.condensed-300,.condensed-thin{font-weight:200;font-family:Roboto_condensed,Arial,Helvetica,sans-serif}.condensed-400,.condensed-regular{font-weight:400;font-family:Roboto_condensed,Arial,Helvetica,sans-serif}.condensed-700,.condensed-bold{font-weight:700;font-family:Roboto_condensed,Arial,Helvetica,sans-serif}.slab-100,.slab-light{font-weight:100;font-family:Roboto_slab,Arial,Helvetica,sans-serif}.slab-300,.slab-thin{font-weight:300;font-family:Roboto_slab,Arial,Helvetica,sans-serif}.slab-400,.slab-regular{font-weight:400;font-family:Roboto_slab,Arial,Helvetica,sans-serif}.slab-700,.slab-bold{font-weight:700;font-family:Roboto_slab,Arial,Helvetica,sans-serif}.sans{font-family:Roboto,Arial,Helvetica,sans-serif}.serif{font-family:Times,"Times New Roman",serif}.monospace{font-family:Monaco,"Andale Mono","Courier New",monospace}.condensed{font-family:Roboto_condensed,Arial,Helvetica,sans-serif}.slab{font-family:Roboto_slab,Arial,Helvetica,sans-serif}.italic{font-style:italic}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalizer{text-transform:capitalize}.fa{font-size:14px}a{color:#6998c9;text-decoration:none;cursor:pointer}a:hover{color:#007ed5;text-decoration:underline}h1{font-size:2.2em;margin-top:0;margin-bottom:.57539em}h2{font-size:1.75em;margin-top:0;margin-bottom:.72334em}h3{font-size:1.5em;margin-top:0;margin-bottom:.8439em}h4{font-size:1.25em;margin-top:0;margin-bottom:1.01268em}h5,h6{font-size:1.1em;margin-top:0;margin-bottom:1.15077em}p,table{font-size:1em;margin-top:0;margin-bottom:1.26585em}h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child,h6:first-child,p:first-child{margin-top:0}h1,h2,h3,h4,h5,h6{color:#404040;font-weight:700;line-height:1.16}small{color:#888}input,textarea{color:#666}h1 small,h2 small,h3 small,h4 small{color:#bbb;font-size:.6em;font-weight:100;line-height:1}mark{background:#dae5f2}address{color:#777;font-size:1em;line-height:1.4}address p{margin-top:0}address h6{color:#555}abbr:hover{cursor:help}blockquote{border-left:4px solid #ddd;padding-left:25px;margin:1em 0;font-weight:200;font-size:1.1em}blockquote small{font-size:.9em}blockquote small::after,blockquote small::before{content:' — '}.note{font-size:.9em;color:#777}.note strong{color:#555}.small{font-size:.75em}.medium{font-size:.85em}.large{font-size:1.2em}.extralarge{font-size:1.45em!important}hr{border:0;border-top:1px solid #ddd;margin:1em 0}.lead{font-size:1.1em;font-weight:700}ol,ul{line-height:1.4;padding:0 0 0 1.45em;margin:1em 0}ol li,ul li{margin:.5em 0}ul.unstyled{list-style:none;padding-left:0}ul.unstyled ul{list-style:disc outside}ul.inline{list-style:none}ul.inline li{display:inline-block;padding:0 .5em}ul.inline li:first-child{padding:0 .5em 0 0}dl{margin:1em 0}dl dt{font-weight:700;margin:.5em 0}dl dd{margin:.5em 0 .5em 25px}dl.inline dt{float:left;clear:left;text-align:right;width:180px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin:0}dl.inline dd{margin:.5em 0 .5em 200px}figure.ink-image{position:relative;border:1px solid #555}figure.ink-image>img{width:100%}figure.ink-image>figcaption{padding:1em;background:#fff;line-height:1.3}figure.ink-image>figcaption.over-bottom,figure.ink-image>figcaption.over-top{position:absolute;width:100%;left:0;border:0}figure.ink-image>figcaption.over-bottom.dark,figure.ink-image>figcaption.over-top.dark{color:#fff;background:rgba(0,0,0,.6)}figure.ink-image>figcaption.over-top{top:0;background:rgba(255,255,255,.7)}figure.ink-image>figcaption.over-bottom{bottom:0;background:rgba(255,255,255,.7)}figure.ink-image>figcaption.dark{color:#fff;background:#222}img{border:0;width:auto;max-width:100%;vertical-align:top}.ink-alert.basic,.ink-alert.block{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-alert.basic{background:rgba(255,156,0,.25);color:#b87814;border:1px solid #b87814}.ink-alert.basic .ink-dismiss{color:#b87814}.ink-alert.basic.success{background:rgba(74,155,23,.25);color:#38621d;border:1px solid #38621d}.ink-alert.basic.success .ink-dismiss{color:#38621d}.ink-alert.basic.error{background:rgba(201,17,17,.25);color:#891e1e;border:1px solid #891e1e}.ink-alert.basic.error .ink-dismiss{color:#891e1e}.ink-alert.basic.info{background:rgba(15,117,218,.25);color:#1e5b98;border:1px solid #1e5b98}.ink-alert.basic.info .ink-dismiss{color:#1e5b98}.ink-alert.block{border:1px solid #b87814;background:#fff}.ink-alert.block>h4{background:rgba(255,156,0,.3);color:#b87814}.ink-alert.block .ink-dismiss{color:#b87814}.ink-alert.block.success{border:1px solid #38621d;background:#fff}.ink-alert.block.success>h4{background:rgba(74,155,23,.3);color:#38621d}.ink-alert.block.success .ink-dismiss{color:#38621d}.ink-alert.block.error{border:1px solid #891e1e;background:#fff}.ink-alert.block.error>h4{background:rgba(201,17,17,.3);color:#891e1e}.ink-alert.block.error .ink-dismiss{color:#891e1e}.ink-alert.block.info{border:1px solid #1e5b98;background:#fff}.ink-alert.block.info>h4{background:rgba(15,117,218,.3);color:#1e5b98}.ink-alert.block.info .ink-dismiss{color:#1e5b98}.ink-alert .ink-dismiss{font-family:Arial,sans-serif;font-weight:700;text-shadow:#fff 0 1px 0;filter:alpha(Opacity=25);opacity:.25}.ink-alert .ink-dismiss:hover{filter:alpha(Opacity=60);opacity:.6}.ink-badge{-webkit-border-radius:8em;-moz-border-radius:8em;-ms-border-radius:8em;-o-border-radius:8em;border-radius:8em;color:#fff}.ink-badge.white{background:#fff;color:#555}.ink-badge.black{background:#000}.ink-badge.orange{background:#ff9c00}.ink-badge.red{background:#c91111}.ink-badge.green{background:#4a9b17}.ink-badge.blue{background:#0f75da}.ink-badge.yellow{background:#ffd500;color:#555}.ink-badge.grey{background:gray}.ink-badge+.ink-badge{margin-left:.2em}.ink-button{background:#d9d9d9;color:#000;border:1px solid #bfbfbf;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;font-weight:300}.ink-button:active,.ink-button:hover{text-decoration:none;color:#000;background:#ccc;border:1px solid #b3b3b3;-webkit-box-shadow:rgba(0,0,0,.2) 0 1px 1px;-moz-box-shadow:rgba(0,0,0,.2) 0 1px 1px;box-shadow:rgba(0,0,0,.2) 0 1px 1px}.ink-button:focus{outline:0;background:#ccc;-webkit-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;-moz-box-shadow:rgba(0,0,0,.2) 0 1px 1px inset;box-shadow:rgba(0,0,0,.2) 0 1px 1px inset}.ink-button[disabled]{background:#e6e6e6;border:1px solid #e6e6e6;color:#999}.ink-button[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.blue{color:#fff;background:#0f75da;border:1px solid #0c63b9}.ink-button.blue:active,.ink-button.blue:hover{background:#0d68c2;border:1px solid #0a56a1;color:#fff;text-decoration:none}.ink-button.blue:focus{background:#0d68c2}.ink-button.blue[disabled]{background:rgba(15,117,218,.6);border:1px solid rgba(15,117,218,0);color:#0c5baa}.ink-button.blue[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.green{color:#fff;background:#4a9b17;border:1px solid #3e8313}.ink-button.green:active,.ink-button.green:hover{background:#3f8514;border:1px solid #336d10;color:#fff;text-decoration:none}.ink-button.green:focus{background:#3f8514}.ink-button.green[disabled]{background:rgba(74,155,23,.6);border:1px solid rgba(74,155,23,0);color:#356f10}.ink-button.green[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.orange{color:#fff;background:#ff9c00;border:1px solid #d88400}.ink-button.orange:active,.ink-button.orange:hover{background:#e68c00;border:1px solid #bf7400;color:#fff;text-decoration:none}.ink-button.orange:focus{background:#e68c00}.ink-button.orange[disabled]{background:rgba(255,156,0,.6);border:1px solid rgba(255,156,0,0);color:#cc7d00}.ink-button.orange[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.red{color:#fff;background:#c91111;border:1px solid #aa0e0e}.ink-button.red:active,.ink-button.red:hover{background:#b10f0f;border:1px solid #920c0c;color:#fff;text-decoration:none}.ink-button.red:focus{background:#b10f0f}.ink-button.red[disabled]{background:rgba(201,17,17,.6);border:1px solid rgba(201,17,17,0);color:#9a0d0d}.ink-button.red[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.black{color:#fff;background:#1a1a1a;border:1px solid #161616}.ink-button.black:active,.ink-button.black:hover{background:#0d0d0d;border:1px solid #090909;color:#fff;text-decoration:none}.ink-button.black:focus{background:#0d0d0d}.ink-button.black[disabled]{background:rgba(26,26,26,.6);border:1px solid rgba(26,26,26,0);color:#000}.ink-button.black[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ink-button.white{color:#555;background:#fff;border:1px solid #d8d8d8}.ink-button.white:active,.ink-button.white:hover{background:#f2f2f2;border:1px solid #cbcbcb;color:#555;text-decoration:none}.ink-button.white:focus{background:#f2f2f2}.ink-button.white[disabled]{background:rgba(255,255,255,.6);border:1px solid rgba(255,255,255,0);color:#e6e6e6}.ink-button.white[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.button-group>.ink-button[disabled]{background:#e6e6e6;border:1px solid rgba(217,217,217,.6)}.button-group>.ink-button[disabled]:hover{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.button-group>.ink-button.blue:first-child{border-left:#0c63b9}.button-group>.ink-button.blue[disabled]{background:rgba(15,117,218,.6);border:1px solid rgba(15,117,218,.3)}.button-group>.ink-button.green:first-child{border-left:#3e8313}.button-group>.ink-button.green[disabled]{background:rgba(74,155,23,.6);border:1px solid rgba(74,155,23,.3)}.button-group>.ink-button.orange:first-child{border-left:#d88400}.button-group>.ink-button.orange[disabled]{background:rgba(255,156,0,.6);border:1px solid rgba(255,156,0,.3)}.button-group>.ink-button.red:first-child{border-left:#aa0e0e}.button-group>.ink-button.red[disabled]{background:rgba(201,17,17,.6);border:1px solid rgba(201,17,17,.3)}.button-group>.ink-button.black:first-child{border-left:#161616}.button-group>.ink-button.black[disabled]{background:rgba(26,26,26,.6);border:1px solid rgba(26,26,26,.3)}.button-group>.ink-button.white:first-child{border-left:#d8d8d8}.button-group>.ink-button.white[disabled]{background:rgba(255,255,255,.6);border:1px solid rgba(255,255,255,.3)}.ink-label{color:#fff;font-weight:300;font-size:.938em;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-label.white{background:#fff;color:#555}.ink-label.black{background:#000}.ink-label.orange{background:#ff9c00}.ink-label.red{background:#c91111}.ink-label.green{background:#4a9b17}.ink-label.blue{background:#0f75da}.ink-label.yellow{background:#ffd500;color:#555}.ink-label.grey{background:gray}.ink-label+.ink-label{margin-left:.2em}.ink-navigation ul.breadcrumbs{font-weight:300;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.breadcrumbs li.active a{background:0 0;color:#999}.ink-navigation ul.breadcrumbs li.active a:hover{cursor:default;text-decoration:none}.ink-navigation ul.breadcrumbs li a:hover{background:0 0;text-decoration:underline}.ink-navigation ul.breadcrumbs.white{background:#fff}.ink-navigation ul.breadcrumbs.white li a,.ink-navigation ul.breadcrumbs.white li:after{color:#555}.ink-navigation ul.breadcrumbs.white li.active a{color:#ccc;text-shadow:#fff 0 1px 0}.ink-navigation ul.breadcrumbs.grey{background:#d9d9d9}.ink-navigation ul.breadcrumbs.grey li a,.ink-navigation ul.breadcrumbs.grey li:after{color:#555}.ink-navigation ul.breadcrumbs.grey li.active a{color:#a6a6a6;text-shadow:#ededed 0 1px 0}.ink-navigation ul.breadcrumbs.black{background:#1a1a1a}.ink-navigation ul.breadcrumbs.black li a,.ink-navigation ul.breadcrumbs.black li:after{color:#fff}.ink-navigation ul.breadcrumbs.black li.active a{color:#666;text-shadow:#000 0 -1px 0}.ink-navigation ul.breadcrumbs.blue{background:#1b75ce}.ink-navigation ul.breadcrumbs.blue li a,.ink-navigation ul.breadcrumbs.blue li:after{color:#fff}.ink-navigation ul.breadcrumbs.blue li.active a{color:#08427b;text-shadow:#1884ef 0 1px 0}.ink-navigation ul.breadcrumbs.orange{background:#f2990d}.ink-navigation ul.breadcrumbs.orange li a,.ink-navigation ul.breadcrumbs.orange li:after{color:#fff}.ink-navigation ul.breadcrumbs.orange li.active a{color:#995e00;text-shadow:#ffa81f 0 1px 0}.ink-navigation ul.breadcrumbs.green{background:#4c9220}.ink-navigation ul.breadcrumbs.green li a,.ink-navigation ul.breadcrumbs.green li:after{color:#fff}.ink-navigation ul.breadcrumbs.green li.active a{color:#20420a;text-shadow:#57b61b 0 1px 0}.ink-navigation ul.breadcrumbs.red{background:#be1c1c}.ink-navigation ul.breadcrumbs.red li a,.ink-navigation ul.breadcrumbs.red li:after{color:#fff}.ink-navigation ul.breadcrumbs.red li.active a{color:#6b0909;text-shadow:#e51313 0 1px 0}.ink-dropdown.green ul.dropdown-menu li.active a{background:#4a9b17;color:#fff}.ink-dropdown.orange ul.dropdown-menu li.active a{background:#ff9c00;color:#fff}.ink-dropdown.red ul.dropdown-menu li.active a{background:#c91111;color:#fff}.ink-dropdown.black ul.dropdown-menu li.active a{background:#1a1a1a;color:#fff}.ink-dropdown.blue ul.dropdown-menu li.active a{background:#0f75da;color:#fff}.ink-navigation ul.menu{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.menu>li{font-weight:300}.ink-navigation ul.menu>li.active a{text-decoration:underline}.ink-navigation ul.menu>li.heading{font-weight:500}.ink-navigation ul.menu>li.disabled a{color:#b3b3b3;text-shadow:#fff 0 1px 0}.ink-navigation ul.menu>li.disabled a:hover{cursor:default;background:0 0;text-decoration:none}.ink-navigation ul.menu>li ul.submenu li{font-size:.875em}.ink-navigation ul.menu>li ul.submenu li a{border-bottom:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.vertical li a{border-bottom:1px solid rgba(0,0,0,.15)}.ink-navigation ul.menu.vertical li:first-child,.ink-navigation ul.menu.vertical li:first-child>a{-webkit-border-radius:2px 2px 0 0;-moz-border-radius:2px 2px 0 0;-ms-border-radius:2px 2px 0 0;-o-border-radius:2px 2px 0 0;border-radius:2px 2px 0 0}.ink-navigation ul.menu.vertical li:last-child{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px}.ink-navigation ul.menu.vertical li:last-child>a{border-bottom:0;-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px}.ink-navigation ul.menu.vertical li:last-child .submenu{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px}.ink-navigation ul.menu.vertical li:last-child .submenu.flyout{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.menu.vertical li:last-child .submenu li:last-child,.ink-navigation ul.menu.vertical li:last-child .submenu li:last-child a{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px}.ink-navigation ul.menu.horizontal>li:first-child,.ink-navigation ul.menu.horizontal>li:first-child a{-webkit-border-radius:2px 0 0 2px;-moz-border-radius:2px 0 0 2px;-ms-border-radius:2px 0 0 2px;-o-border-radius:2px 0 0 2px;border-radius:2px 0 0 2px}.ink-navigation ul.menu.horizontal>li:last-child,.ink-navigation ul.menu.horizontal>li:last-child a{-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-ms-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0}.ink-navigation ul.menu.horizontal>li ul.submenu{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px;background:#fff}.ink-navigation ul.menu.horizontal>li ul.submenu li:last-child{-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-ms-border-radius:0 0 2px 2px;-o-border-radius:0 0 2px 2px;border-radius:0 0 2px 2px}.ink-navigation ul.menu.horizontal>li ul.submenu li:last-child a{border-bottom:0}.ink-navigation ul.menu.white{background:#fff}.ink-navigation ul.menu.white li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.white li ul.submenu li a{color:#555}.ink-navigation ul.menu.white li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.white li.disabled a:hover{background:0 0}.ink-navigation ul.menu.white li.active{background:#e6e6e6}.ink-navigation ul.menu.white li.disabled a{color:#ccc;text-shadow:#fff 0 1px 0}.ink-navigation ul.menu.white li a{color:#555;text-decoration:none}.ink-navigation ul.menu.white li a:hover{background:#f2f2f2}.ink-navigation ul.menu.grey{background:#d9d9d9}.ink-navigation ul.menu.grey li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.grey li ul.submenu li a{color:#555}.ink-navigation ul.menu.grey li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.grey li.disabled a:hover{background:0 0}.ink-navigation ul.menu.grey li.active{background:#bfbfbf}.ink-navigation ul.menu.grey li.disabled a{color:#a6a6a6;text-shadow:#ededed 0 1px 0}.ink-navigation ul.menu.grey li a{color:#555;text-decoration:none}.ink-navigation ul.menu.grey li a:hover{background:#ccc}.ink-navigation ul.menu.black{background:#1a1a1a}.ink-navigation ul.menu.black li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.black li ul.submenu li a{color:#555}.ink-navigation ul.menu.black li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.black li.disabled a:hover{background:0 0}.ink-navigation ul.menu.black li.active{background:#333}.ink-navigation ul.menu.black li.disabled a{color:#666;text-shadow:#000 0 -1px 0}.ink-navigation ul.menu.black li a{color:#fff;text-decoration:none}.ink-navigation ul.menu.black li a:hover{background:#404040}.ink-navigation ul.menu.blue{background:#1b75ce}.ink-navigation ul.menu.blue li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.blue li ul.submenu li a{color:#555}.ink-navigation ul.menu.blue li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.blue li.disabled a:hover{background:0 0}.ink-navigation ul.menu.blue li.active{background:#0c5baa}.ink-navigation ul.menu.blue li.disabled a{color:#08427b;text-shadow:#2289f0 0 1px 0}.ink-navigation ul.menu.blue li a{color:#fff;text-decoration:none}.ink-navigation ul.menu.blue li a:hover{background:#0d68c2}.ink-navigation ul.menu.green{background:#4c9220}.ink-navigation ul.menu.green li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.green li ul.submenu li a{color:#555}.ink-navigation ul.menu.green li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.green li.disabled a:hover{background:0 0}.ink-navigation ul.menu.green li.active{background:#356f10}.ink-navigation ul.menu.green li.disabled a{color:#20420a;text-shadow:#5bbf1c 0 1px 0}.ink-navigation ul.menu.green li a{color:#fff;text-decoration:none}.ink-navigation ul.menu.green li a:hover{background:#3f8514}.ink-navigation ul.menu.orange{background:#f2990d}.ink-navigation ul.menu.orange li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.orange li ul.submenu li a{color:#555}.ink-navigation ul.menu.orange li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.orange li.disabled a:hover{background:0 0}.ink-navigation ul.menu.orange li.active{background:#cc7d00}.ink-navigation ul.menu.orange li.disabled a{color:#995e00;text-shadow:#ffac29 0 1px 0}.ink-navigation ul.menu.orange li a{color:#fff;text-decoration:none}.ink-navigation ul.menu.orange li a:hover{background:#e68c00}.ink-navigation ul.menu.red{background:#be1c1c}.ink-navigation ul.menu.red li ul.submenu{background:#fff;border:1px solid rgba(0,0,0,.1)}.ink-navigation ul.menu.red li ul.submenu li a{color:#555}.ink-navigation ul.menu.red li ul.submenu li a:hover{background:rgba(0,0,0,.05)}.ink-navigation ul.menu.red li.disabled a:hover{background:0 0}.ink-navigation ul.menu.red li.active{background:#9a0d0d}.ink-navigation ul.menu.red li.disabled a{color:#6b0909;text-shadow:#eb1717 0 1px 0}.ink-navigation ul.menu.red li a{color:#fff;text-decoration:none}.ink-navigation ul.menu.red li a:hover{background:#b10f0f}.ink-navigation ul.pagination{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.pagination li{font-weight:300}.ink-navigation ul.pagination li.active a{text-decoration:underline}.ink-navigation ul.pagination li.disabled a{color:#b3b3b3;text-shadow:#fff 0 1px 0}.ink-navigation ul.pagination li.disabled a:hover{cursor:default;background:0 0;text-decoration:none}.ink-navigation ul.pagination li:first-child,.ink-navigation ul.pagination li:first-child a{-webkit-border-radius:2px 0 0 2px;-moz-border-radius:2px 0 0 2px;-ms-border-radius:2px 0 0 2px;-o-border-radius:2px 0 0 2px;border-radius:2px 0 0 2px}.ink-navigation ul.pagination li:last-child,.ink-navigation ul.pagination li:last-child a{-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-ms-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0}.ink-navigation ul.pagination.white li{background:#fff}.ink-navigation ul.pagination.white li.active a{background:#e6e6e6}.ink-navigation ul.pagination.white li.disabled a{color:#ccc;text-shadow:#fff 0 1px 0}.ink-navigation ul.pagination.white li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.white li a{color:#555;text-decoration:none}.ink-navigation ul.pagination.white li a:hover{background:#f2f2f2}.ink-navigation ul.pagination.grey li{background:#d9d9d9}.ink-navigation ul.pagination.grey li.active a{background:#bfbfbf}.ink-navigation ul.pagination.grey li.disabled a{color:#a6a6a6;text-shadow:#ededed 0 1px 0}.ink-navigation ul.pagination.grey li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.grey li a{color:#555;text-decoration:none}.ink-navigation ul.pagination.grey li a:hover{background:#ccc}.ink-navigation ul.pagination.black li{background:#1a1a1a}.ink-navigation ul.pagination.black li.active a{background:#333}.ink-navigation ul.pagination.black li.disabled a{color:#666;text-shadow:#000 0 -1px 0}.ink-navigation ul.pagination.black li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.black li a{color:#fff;text-decoration:none}.ink-navigation ul.pagination.black li a:hover{background:#292929}.ink-navigation ul.pagination.orange li{background:#f2990d}.ink-navigation ul.pagination.orange li.active a{background:#cc7d00}.ink-navigation ul.pagination.orange li.disabled a{color:#995e00;text-shadow:#ffac29 0 1px 0}.ink-navigation ul.pagination.orange li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.orange li a{color:#fff;text-decoration:none}.ink-navigation ul.pagination.orange li a:hover{background:#e68c00}.ink-navigation ul.pagination.blue li{background:#1b75ce}.ink-navigation ul.pagination.blue li.active a{background:#0c5baa}.ink-navigation ul.pagination.blue li.disabled a{color:#08427b;text-shadow:#2289f0 0 1px 0}.ink-navigation ul.pagination.blue li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.blue li a{color:#fff;text-decoration:none}.ink-navigation ul.pagination.blue li a:hover{background:#0d68c2}.ink-navigation ul.pagination.green li{background:#4c9220}.ink-navigation ul.pagination.green li.active a{background:#356f10}.ink-navigation ul.pagination.green li.disabled a{color:#20420a;text-shadow:#5bbf1c 0 1px 0}.ink-navigation ul.pagination.green li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.green li a{color:#fff;text-decoration:none}.ink-navigation ul.pagination.green li a:hover{background:#3f8514}.ink-navigation ul.pagination.red li{background:#be1c1c}.ink-navigation ul.pagination.red li.active a{background:#9a0d0d}.ink-navigation ul.pagination.red li.disabled a{color:#6b0909;text-shadow:#eb1717 0 1px 0}.ink-navigation ul.pagination.red li.disabled a:hover{background:0 0}.ink-navigation ul.pagination.red li a{color:#fff;text-decoration:none}.ink-navigation ul.pagination.red li a:hover{background:#b10f0f}.ink-navigation ul.pagination.dotted li{background:0 0}.ink-navigation ul.pagination.dotted li a{background:#999;filter:alpha(Opacity=50);opacity:.5}.ink-navigation ul.pagination.dotted li.active a,.ink-navigation ul.pagination.dotted li:hover a{filter:alpha(Opacity=100);opacity:1}.ink-navigation ul.pagination.dotted.black li a{background:#1a1a1a}.ink-navigation ul.pagination.dotted.white li a{background:#fff}.ink-navigation ul.pagination.dotted.blue li a{background:#1b75ce}.ink-navigation ul.pagination.dotted.green li a{background:#4c9220}.ink-navigation ul.pagination.dotted.orange li a{background:#f2990d}.ink-navigation ul.pagination.dotted.red li a{background:#be1c1c}.ink-navigation ul.pagination.chevron li.next a,.ink-navigation ul.pagination.chevron li.previous a{color:#fff;filter:alpha(Opacity=60);opacity:.6}.ink-navigation ul.pagination.chevron li.next a.active,.ink-navigation ul.pagination.chevron li.next a:focus,.ink-navigation ul.pagination.chevron li.next a:hover,.ink-navigation ul.pagination.chevron li.previous a.active,.ink-navigation ul.pagination.chevron li.previous a:focus,.ink-navigation ul.pagination.chevron li.previous a:hover{filter:alpha(Opacity=80);opacity:.8;text-decoration:none;background:0 0}.ink-navigation ul.pagination.chevron li.disabled a{color:#fff;filter:alpha(Opacity=60);opacity:.6;text-shadow:none}.ink-navigation ul.pagination.chevron li.disabled a:focus,.ink-navigation ul.pagination.chevron li.disabled a:hover{color:#fff;filter:alpha(Opacity=60);opacity:.6}.ink-navigation ul.pagination.chevron.black li.disabled a,.ink-navigation ul.pagination.chevron.black li.next a,.ink-navigation ul.pagination.chevron.black li.previous a{color:#1a1a1a}.ink-navigation ul.pagination.chevron.grey li.disabled a,.ink-navigation ul.pagination.chevron.grey li.next a,.ink-navigation ul.pagination.chevron.grey li.previous a{color:#d9d9d9}.ink-navigation ul.pagination.chevron.blue li.disabled a,.ink-navigation ul.pagination.chevron.blue li.next a,.ink-navigation ul.pagination.chevron.blue li.previous a{color:#1b75ce}.ink-navigation ul.pagination.chevron.green li.disabled a,.ink-navigation ul.pagination.chevron.green li.next a,.ink-navigation ul.pagination.chevron.green li.previous a{color:#4c9220}.ink-navigation ul.pagination.chevron.orange li.disabled a,.ink-navigation ul.pagination.chevron.orange li.next a,.ink-navigation ul.pagination.chevron.orange li.previous a{color:#f2990d}.ink-navigation ul.pagination.chevron.red li.disabled a,.ink-navigation ul.pagination.chevron.red li.next a,.ink-navigation ul.pagination.chevron.red li.previous a{color:#be1c1c}.ink-navigation ul.pills li{background:#fff;font-weight:300;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-navigation ul.pills li a{color:#555;background:0 0}.ink-navigation ul.pills li a:hover,.ink-navigation ul.pills li.active a{background:#e6e6e6}.ink-navigation ul.pills li.disabled a{color:#999;text-shadow:#fff 0 1px 0}.ink-navigation ul.pills li.disabled a:hover{background:0 0}.ink-navigation ul.pills.grey li{background:#d9d9d9}.ink-navigation ul.pills.grey li.active a{background:#bfbfbf}.ink-navigation ul.pills.grey li.disabled a{color:#a6a6a6;text-shadow:#ededed 0 1px 0}.ink-navigation ul.pills.grey li.disabled a:hover{background:0 0}.ink-navigation ul.pills.grey li a{color:#555}.ink-navigation ul.pills.grey li a:hover{background:#ccc}.ink-navigation ul.pills.black li{background:#1a1a1a}.ink-navigation ul.pills.black li.active a{background:#333}.ink-navigation ul.pills.black li.disabled a{color:#666;text-shadow:#000 0 -1px 0}.ink-navigation ul.pills.black li.disabled a:hover{background:0 0}.ink-navigation ul.pills.black li a{color:#fff}.ink-navigation ul.pills.black li a:hover{background:#292929}.ink-navigation ul.pills.blue li{background:#1b75ce}.ink-navigation ul.pills.blue li.active a{background:#0c5baa}.ink-navigation ul.pills.blue li.disabled a{color:#08427b;text-shadow:#2289f0 0 1px 0}.ink-navigation ul.pills.blue li.disabled a:hover{background:0 0}.ink-navigation ul.pills.blue li a{color:#fff}.ink-navigation ul.pills.blue li a:hover{background:#0d68c2}.ink-navigation ul.pills.green li{background:#4c9220}.ink-navigation ul.pills.green li.active a{background:#356f10}.ink-navigation ul.pills.green li.disabled a{color:#20420a;text-shadow:#5bbf1c 0 1px 0}.ink-navigation ul.pills.green li.disabled a:hover{background:0 0}.ink-navigation ul.pills.green li a{color:#fff}.ink-navigation ul.pills.green li a:hover{background:#3f8514}.ink-navigation ul.pills.orange li{background:#f2990d}.ink-navigation ul.pills.orange li.active a{background:#cc7d00}.ink-navigation ul.pills.orange li.disabled a{color:#995e00;text-shadow:#ffac29 0 1px 0}.ink-navigation ul.pills.orange li.disabled a:hover{background:0 0}.ink-navigation ul.pills.orange li a{color:#fff}.ink-navigation ul.pills.orange li a:hover{background:#e68c00}.ink-navigation ul.pills.red li{background:#be1c1c}.ink-navigation ul.pills.red li.active a{background:#9a0d0d}.ink-navigation ul.pills.red li.disabled a{color:#6b0909;text-shadow:#eb1717 0 1px 0}.ink-navigation ul.pills.red li.disabled a:hover{background:0 0}.ink-navigation ul.pills.red li a{color:#fff}.ink-navigation ul.pills.red li a:hover{background:#b10f0f}table.ink-table{background:#fff}table.ink-table tr td,table.ink-table tr th{border-bottom:#bbb 1px solid;background:0 0}table.ink-table tr:last-child td{border-bottom:0}table.ink-table tfoot tr td,table.ink-table tfoot tr th{border-top:#bbb 1px solid}table.ink-table.alternating tbody tr:nth-child(odd){background-color:#f5f5f5}table.ink-table.hover tbody tr:hover{background:#fefbd6;color:#555}table.ink-table.bordered{border:#bbb 1px solid;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}table.ink-table.bordered tr th{border-left:#bbb 1px solid}table.ink-table.bordered tr th:first-child{border-left:0}table.ink-table.bordered tr:last-child td{border-bottom:0}table.ink-table.bordered tr td{border-left:#bbb 1px solid}table.ink-table.bordered tr td:first-child{border-left:0}table.ink-table tbody>tr.red td{background:#c91111;color:#fff}table.ink-table tbody>tr.green td{background:#4a9b17;color:#fff}table.ink-table tbody>tr.blue td{background:#0f75da;color:#fff}table.ink-table tbody>tr.orange td{background:#ff9c00;color:#fff}table.ink-table tbody>tr.black td{background:#000;color:#ccc}table.ink-table tbody>tr.yellow td{background:#ffd500;color:#000}.animated.slow{animation-duration:1s}.animated.medium{animation-duration:.5s}.animated.fast{animation-duration:.2s}.ink-carousel{width:100%;position:relative;overflow:hidden;display:block}.ink-carousel .stage{left:0;height:auto!important;margin-top:0;margin-bottom:0;padding-left:0;list-style-type:none;white-space:nowrap;position:relative;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease}.ink-carousel .stage .slide{position:relative;display:inline-block;vertical-align:top;white-space:normal;margin:0;float:none;zoom:1;*display:inline}.ink-carousel .ink-navigation{position:static}.ink-datepicker-wrapper{position:relative}.ink-datepicker-calendar{margin-top:0;position:absolute}.ink-datepicker-calendar.right{left:100%;top:0}.ink-datepicker-calendar.left{right:100%;top:0}.ink-datepicker-calendar.bottom{top:100%;left:0}.ink-datepicker-calendar.top{bottom:100%;left:0}.ink-datepicker-calendar,.ink-datepicker-wrapper{display:inline;display:inline-block}.ink-calendar{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;text-align:center;padding:.3em;min-width:17.4em;font-size:13px;-webkit-box-shadow:rgba(0,0,0,.4) 0 1px 2px 0;-moz-box-shadow:rgba(0,0,0,.4) 0 1px 2px 0;box-shadow:rgba(0,0,0,.4) 0 1px 2px 0;background:#fff;z-index:10}.ink-calendar a{text-decoration:none}.ink-calendar li{list-style:none inside}html.ink-modal-is-open .ink-calendar{z-index:101}.ink-calendar-top-options{padding:5px;font-size:.813em;cursor:pointer}.ink-calendar-top-options .clean{float:left}.ink-calendar-top-options .close{float:right}.ink-calendar-top{line-height:2em;background:#e6e6e6;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-calendar-top div{float:left}.ink-calendar-top .ink-calendar-next,.ink-calendar-top .ink-calendar-prev{width:10%}.ink-calendar-top .ink-calendar-next a,.ink-calendar-top .ink-calendar-prev a{display:block}.ink-calendar-top .ink-calendar-month_desc{width:80%}.ink-calendar-month,.ink-calendar-month-selector,.ink-calendar-year-selector{margin-top:.5em;padding-left:0}.ink-calendar-month li a,.ink-calendar-month-selector li a,.ink-calendar-year-selector li a{margin:0;line-height:2em;vertical-align:middle;display:block;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;color:#444}.ink-calendar-month li a:hover,.ink-calendar-month-selector li a:hover,.ink-calendar-year-selector li a:hover{background:#e6e6e6}.ink-calendar-month li a.ink-calendar-on,.ink-calendar-month li a.ink-calendar-on:hover,.ink-calendar-month-selector li a.ink-calendar-on,.ink-calendar-month-selector li a.ink-calendar-on:hover,.ink-calendar-year-selector li a.ink-calendar-on,.ink-calendar-year-selector li a.ink-calendar-on:hover{background:#0069d6;color:#fff}.ink-calendar-month li a.ink-calendar-off,.ink-calendar-month li a.ink-calendar-off:hover,.ink-calendar-month-selector li a.ink-calendar-off,.ink-calendar-month-selector li a.ink-calendar-off:hover,.ink-calendar-year-selector li a.ink-calendar-off,.ink-calendar-year-selector li a.ink-calendar-off:hover{background:#fff;color:#aaa;cursor:default}.ink-calendar-month ul,.ink-calendar-month-selector ul,.ink-calendar-year-selector ul{clear:both;padding-left:0}.ink-calendar-month ul li,.ink-calendar-month-selector ul li,.ink-calendar-year-selector ul li{width:2.4em;float:left;text-align:center;padding:0;margin:0}.ink-calendar-month-selector ul li,.ink-calendar-year-selector ul li{width:25%}.ink-calendar-month-selector,.ink-calendar-year-selector{display:none}.action_inactive,.ink-calendar-off{color:#ddd!important}.ink-calendar-month .ink-calendar-header{border-bottom:1px solid rgba(0,0,0,.1);padding-bottom:.5em;margin-bottom:.5em;color:#aaa}.ink-calendar-middle,.ink-calendar-month .ink-calendar-header,.ink-calendar-month .ink-calendar-middle ul,.ink-calendar-top,.ink-calendar-top-options{*zoom:1}.ink-calendar-middle:after,.ink-calendar-month .ink-calendar-header:after,.ink-calendar-month .ink-calendar-middle ul:after,.ink-calendar-top-options:after,.ink-calendar-top:after{content:"";display:table;clear:both}body.ink-drawer{max-width:100%}body.ink-drawer .content-drawer,body.ink-drawer .left-drawer,body.ink-drawer .right-drawer{-webkit-transition-property:translate3d;-moz-transition-property:translate3d;-o-transition-property:translate3d;transition-property:translate3d;-webkit-transition-duration:300ms;-moz-transition-duration:300ms;-o-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.86,0,.07,1);-moz-transition-timing-function:cubic-bezier(0.86,0,.07,1);-o-transition-timing-function:cubic-bezier(0.86,0,.07,1);transition-timing-function:cubic-bezier(0.86,0,.07,1)}body.ink-drawer .left-drawer{left:-220px}body.ink-drawer .right-drawer{right:-220px}body.ink-drawer .content-drawer{width:100%}body.ink-drawer .left-drawer,body.ink-drawer .right-drawer{position:absolute;top:0;z-index:0;display:none;overflow-x:hidden;overflow-y:auto;width:220px;height:100%;-webkit-overflow-scrolling:touch}body.ink-drawer .left-drawer.show,body.ink-drawer .right-drawer.show{display:block}body.ink-drawer.push{overflow:hidden;width:100%;height:100%;position:fixed}body.ink-drawer.push .content-drawer{overflow:hidden}body.ink-drawer.push.left .content-drawer,body.ink-drawer.push.left .left-drawer{-webkit-transform:translate3d(220px,0,0);-moz-transform:translate3d(220px,0,0);-ms-transform:translate3d(220px,0,0);-o-transform:translate3d(220px,0,0);transform:translate3d(220px,0,0)}body.ink-drawer.push.right .content-drawer,body.ink-drawer.push.right .right-drawer{-webkit-transform:translate3d(-220px,0,0);-moz-transform:translate3d(-220px,0,0);-ms-transform:translate3d(-220px,0,0);-o-transform:translate3d(-220px,0,0);transform:translate3d(-220px,0,0)}body.ink-drawer.over{overflow:hidden;-webkit-user-drag:none}body.ink-drawer.over.left .left-drawer{-webkit-transform:translate3d(220px,0,0);-moz-transform:translate3d(220px,0,0);-ms-transform:translate3d(220px,0,0);-o-transform:translate3d(220px,0,0);transform:translate3d(220px,0,0)}body.ink-drawer.over.right .right-drawer{-webkit-transform:translate3d(-220px,0,0);-moz-transform:translate3d(-220px,0,0);-ms-transform:translate3d(-220px,0,0);-o-transform:translate3d(-220px,0,0);transform:translate3d(-220px,0,0)}.ink-shade{background:rgba(0,0,0,.8);width:100%;height:100%;top:0;right:0;bottom:0;left:0;margin-top:0;position:fixed;z-index:100;display:none;filter:alpha(Opacity=0);opacity:0}.ink-shade.fade{-webkit-transition:opacity 300ms;-moz-transition:opacity 300ms;-o-transition:opacity 300ms;transition:opacity 300ms}.ink-shade.visible{filter:alpha(Opacity=100);opacity:1}.ink-modal{top:50%;left:50%;width:90%;height:90%;background:#fff;z-index:100;position:absolute;overflow:hidden;filter:alpha(Opacity=100);opacity:1;-webkit-box-shadow:rgba(0,0,0,.8) 0 0 15px 0;-moz-box-shadow:rgba(0,0,0,.8) 0 0 15px 0;box-shadow:rgba(0,0,0,.8) 0 0 15px 0;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;*zoom:1}.ink-modal:after{content:"";display:table;clear:both}.ink-modal>.modal-body{padding:1em;overflow-y:auto;overflow-x:hidden;height:auto}.ink-modal>.modal-body .ink-grid{padding-left:0;padding-right:0;width:100%;min-width:100%}.ink-modal>.modal-header,.ink-modal>header{border-bottom:1px #e6e6e6 solid;overflow:hidden;-webkit-box-shadow:rgba(175,175,175,.2) 0 1px 2px 0;-moz-box-shadow:rgba(175,175,175,.2) 0 1px 2px 0;box-shadow:rgba(175,175,175,.2) 0 1px 2px 0}.ink-modal>.modal-header>.modal-close,.ink-modal>header>.modal-close{padding-top:2px;text-align:center;color:#fff;width:26px;height:26px;line-height:1.2em;border:0;background:#bfbfbf;font-size:0;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;text-shadow:rgba(0,0,0,.6) 0 -1px 0;filter:alpha(Opacity=60);opacity:.6;float:right}.ink-modal>.modal-header>.modal-close:after,.ink-modal>header>.modal-close:after{content:"\f00d";font-family:FontAwesome;font-size:medium;line-height:22px}.ink-modal>.modal-header>.modal-close:hover,.ink-modal>header>.modal-close:hover{filter:alpha(Opacity=100);opacity:1}.ink-modal>.modal-footer,.ink-modal>footer{background:#e6e6e6;margin-bottom:0;zoom:1;-webkit-box-shadow:rgba(175,175,175,.2) 0 -1px 2px 0;-moz-box-shadow:rgba(175,175,175,.2) 0 -1px 2px 0;box-shadow:rgba(175,175,175,.2) 0 -1px 2px 0}.ink-modal>.modal-footer,.ink-modal>.modal-header,.ink-modal>footer,.ink-modal>header{padding:.8em 1em .65em}.ink-modal>.modal-footer:after,.ink-modal>.modal-footer:before,.ink-modal>.modal-header:after,.ink-modal>.modal-header:before,.ink-modal>footer:after,.ink-modal>footer:before,.ink-modal>header:after,.ink-modal>header:before{content:".";display:block;height:0;clear:both;visibility:hidden}.ink-modal-open{overflow:hidden}.ink-progress-bar{margin-bottom:1em;overflow:hidden;background:#f2f2f2;position:relative;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;-webkit-box-shadow:0,1px,3px,0,rgba(0,0,0,.2),inset;-moz-box-shadow:0,1px,3px,0,rgba(0,0,0,.2),inset;box-shadow:0,1px,3px,0,rgba(0,0,0,.2),inset}.ink-progress-bar .caption{position:absolute;top:0;left:0;width:100%;height:100%;line-height:1.7;text-align:center;color:#000;font-size:.813em;z-index:10}.ink-progress-bar .bar{height:1.3em;text-shadow:rgba(0,0,0,.25),0,1px,0;-webkit-box-shadow:0,1px,1px,0,rgba(0,0,0,.1),inset;-moz-box-shadow:0,1px,1px,0,rgba(0,0,0,.1),inset;box-shadow:0,1px,1px,0,rgba(0,0,0,.1),inset;-webkit-transition-property:width;-moz-transition-property:width;-o-transition-property:width;transition-property:width;-webkit-transition-duration:.6s;-moz-transition-duration:.6s;-o-transition-duration:.6s;transition-duration:.6s;-webkit-transition-timing-function:ease;-moz-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.ink-progress-bar .bar.grey{background:#ccc;color:#555}.ink-progress-bar .bar.green{background:#4a9b17;color:#fff}.ink-progress-bar .bar.blue{background:#0f75da;color:#fff}.ink-progress-bar .bar.red{background:#c91111;color:#fff}.ink-progress-bar .bar.orange{background:#ff9c00;color:#555}.ink-progress-bar .bar.black{background:#000;color:#fff}.dragging,.ink-sortable-list li{cursor:move;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;-ms-user-select:none;user-select:none;-ms-user-drag:none;-moz-user-drag:none;-khtml-user-drag:none;-webkit-user-drag:none;-o-user-drag:none;user-drag:none}.drag,.ink-sortable-list li.placeholder{-webkit-box-shadow:0,0,10px,0,rgba(0,0,0,.3);-moz-box-shadow:0,0,10px,0,rgba(0,0,0,.3);box-shadow:0,0,10px,0,rgba(0,0,0,.3)}.ink-sortable-list li{margin:0;border-bottom:1px solid #ccc;line-height:40px}.ink-sortable-list li.placeholder,.ink-sortable-list li:hover{background:#ccc;background:rgba(204,204,204,.2)}.ink-sortable-list li .ink-label{margin:0 .8em}.ink-sticky-stuck{position:fixed}.ink-tabs .tabs-nav{list-style:none;padding:0;*zoom:1}.ink-tabs .tabs-nav li{line-height:1.7;position:relative;margin:0}.ink-tabs .tabs-nav li a{padding:.5em 1em;display:block}.ink-tabs .tabs-nav li a:hover{background:#f0f0f0}.ink-tabs .tabs-nav li.active a{color:#555;cursor:default;text-decoration:none;background:#fff;border:1px solid #ccc}.ink-tabs .tabs-nav:after{content:"";display:table;clear:both}.ink-tabs .tabs-content{margin-top:1.5em;overflow:auto}.ink-tabs.top>.tabs-nav{border-bottom:1px solid #ccc}.ink-tabs.top>.tabs-nav li{float:left}.ink-tabs.top>.tabs-nav li a{margin-right:.4em;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;-ms-border-radius:4px 4px 0 0;-o-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.ink-tabs.top>.tabs-nav li.active{margin:0 0 -2px 0}.ink-tabs.top>.tabs-nav li.active a{border-bottom-color:transparent}.ink-tabs.bottom>.tabs-nav{border-top:1px solid #ccc}.ink-tabs.bottom>.tabs-nav li{float:left}.ink-tabs.bottom>.tabs-nav li a{margin-right:.4em;-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;-ms-border-radius:0 0 4px 4px;-o-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.ink-tabs.bottom>.tabs-nav li.active{margin:-2px 0 0 0}.ink-tabs.bottom>.tabs-nav li.active a{border-top-color:transparent}.ink-tabs.left>.tabs-nav{border-right:1px solid #ccc;float:left;margin-right:2em}.ink-tabs.left>.tabs-nav li{float:none;text-align:right}.ink-tabs.left>.tabs-nav li a{margin-bottom:.4em;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;-ms-border-radius:4px 0 0 4px;-o-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.ink-tabs.left>.tabs-nav li.active{margin:0 -2px 0 0}.ink-tabs.left>.tabs-nav li.active a{border-right-color:transparent}.ink-tabs.right>.tabs-nav{border-left:1px solid #ccc;float:right;margin-left:2em}.ink-tabs.right>.tabs-nav li{float:none}.ink-tabs.right>.tabs-nav li a{margin-bottom:.4em;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;-ms-border-radius:0 4px 4px 0;-o-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.ink-tabs.right>.tabs-nav li.active{margin:0 0 0 -2px}.ink-tabs.right>.tabs-nav li.active a{border-left-color:transparent}.ink-tagfield input[type=text].new-tag-input{background-color:#fff;border:1px solid #ccc;line-height:1em;margin:0;padding:5px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.ink-tagfield input[type=text].new-tag-input:focus{-webkit-box-shadow:0,0,0,3px,#eaeaea;-moz-box-shadow:0,0,0,3px,#eaeaea;box-shadow:0,0,0,3px,#eaeaea;border:1px solid #c3c3c3}.ink-tagfield span.ink-tag{background-color:#1b1b1b;color:#eaeaea;text-shadow:none;font-size:.9em;font-weight:400;border:1px solid #000;padding:4px 6px}.ink-tagfield span.ink-tag i.icon-remove{color:#ccc;font-size:.9em;font-weight:400;margin-left:4px}.ink-tagfield span.ink-tag i.icon-remove:hover{cursor:pointer;color:red}.ink-tooltip{display:inline-block;position:relative}.ink-tooltip>.content{background:#f0f0f0;padding:.5em .6em;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;font-size:.8em;color:#8c8c8c}.ink-tooltip>.arrow{position:absolute}.ink-tooltip>.arrow.down,.ink-tooltip>.arrow.left,.ink-tooltip>.arrow.right,.ink-tooltip>.arrow.up{width:0;height:0}.ink-tooltip>.arrow.up{border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #f0f0f0;top:-6px;left:50%;margin-left:-3px}.ink-tooltip>.arrow.down{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #f0f0f0;bottom:-5.45455px;left:50%;margin-left:-3px}.ink-tooltip>.arrow.right{border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:6px solid #f0f0f0;top:50%;right:-5.45455px;margin-top:-6px}.ink-tooltip>.arrow.left{border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:6px solid #f0f0f0;top:50%;left:-5.45455px;margin-top:-6px}.ink-tooltip.blue>.content{background:#0f75da;color:#fff}.ink-tooltip.blue>.arrow.up{border-bottom-color:#0f75da}.ink-tooltip.blue>.arrow.down{border-top-color:#0f75da}.ink-tooltip.blue>.arrow.left{border-right-color:#0f75da}.ink-tooltip.blue>.arrow.right{border-left-color:#0f75da}.ink-tooltip.red>.content{background:#c91111;color:#fff}.ink-tooltip.red>.arrow.up{border-bottom-color:#c91111}.ink-tooltip.red>.arrow.down{border-top-color:#c91111}.ink-tooltip.red>.arrow.left{border-right-color:#c91111}.ink-tooltip.red>.arrow.right{border-left-color:#c91111}.ink-tooltip.orange>.content{background:#ff9c00;color:#fff}.ink-tooltip.orange>.arrow.up{border-bottom-color:#ff9c00}.ink-tooltip.orange>.arrow.down{border-top-color:#ff9c00}.ink-tooltip.orange>.arrow.left{border-right-color:#ff9c00}.ink-tooltip.orange>.arrow.right{border-left-color:#ff9c00}.ink-tooltip.green>.content{background:#4a9b17;color:#fff}.ink-tooltip.green>.arrow.up{border-bottom-color:#4a9b17}.ink-tooltip.green>.arrow.down{border-top-color:#4a9b17}.ink-tooltip.green>.arrow.left{border-right-color:#4a9b17}.ink-tooltip.green>.arrow.right{border-left-color:#4a9b17}.ink-tooltip.black>.content{background:#000;color:#fff}.ink-tooltip.black>.arrow.up{border-bottom-color:#000}.ink-tooltip.black>.arrow.down{border-top-color:#000}.ink-tooltip.black>.arrow.left{border-right-color:#000}.ink-tooltip.black>.arrow.right{border-left-color:#000}.ink-tooltip.grey>.content{background:#ccc;color:#333}.ink-tooltip.grey>.arrow.up{border-bottom-color:#ccc}.ink-tooltip.grey>.arrow.down{border-top-color:#ccc}.ink-tooltip.grey>.arrow.left{border-right-color:#ccc}.ink-tooltip.grey>.arrow.right{border-left-color:#ccc}.ink-tree-view li{list-style-type:none}.ink-tree-view [data-open]>:before{margin-left:-1.3em;margin-right:.4em;text-decoration:none} \ No newline at end of file diff --git a/public/css/quick-start.css b/public/css/quick-start.css new file mode 100644 index 0000000..cc4169a --- /dev/null +++ b/public/css/quick-start.css @@ -0,0 +1,52 @@ +/** +* Ink +* +* A set of tools for quick development of web interfaces. +* +* @package Ink +* @author Sapo Ink Team +* @license http://opensource.org/licenses/MIT MIT +* @link http://ink.sapo.pt +* @version 3.0.5 +*/ +/** + * Sets the grids maximum width + * @var $grid-max-width (pixels|ems|percentage) + */ +/*! + * Sets the grids breakpoint + * + * To add a new break point you'll need to add an element to the list. + * + * Here's an example: ( class-name-prefix, minimum-width, maximum-width, gutter-width, no-media-query). + * + * media: media type. + * class-name-prefix: this is the prefix used in tons of inks classes i.e.: large-100, small-40, etc. + * minimum-width: (pixels|null) the minimum width for the breakpoint + * maximum-width: (pixels|null) the maximum width for the breakpoint + * gutter-width: (ems) the width for the gutters (space between grid columns) for the breakpoint + * no-media-query: (true|false) if you need to support IE8 set this to true on a single breakpoint. + * Since IE8 does not support the @media statement leaving one of the breakpoints + * outside a @media query let's you use the grid in IE8. + * + */ +/* for xlarge screens */ +@media screen and (min-width: 1261px) { + /* your css for xlarge screens goes here ... */ +} +/* for large screens */ +@media screen and (min-width: 961px) and (max-width: 1260px) { + /* your css for large screens goes here ... */ +} +/* for medium screens */ +@media screen and (min-width: 641px) and (max-width: 960px) { + /* your css for medium screens goes here ... */ +} +/* for small screens */ +@media screen and (min-width: 321px) and (max-width: 640px) { + /* your css for small screens goes here ... */ +} +/* for tiny screens */ +@media screen and (max-width: 320px) { + /* your css for tiny screens goes here ... */ +} diff --git a/public/fonts/FontAwesome.otf b/public/fonts/FontAwesome.otf new file mode 100644 index 0000000..7012545 Binary files /dev/null and b/public/fonts/FontAwesome.otf differ diff --git a/public/fonts/Roboto/roboto-black-webfont.eot b/public/fonts/Roboto/roboto-black-webfont.eot new file mode 100644 index 0000000..60f0e22 Binary files /dev/null and b/public/fonts/Roboto/roboto-black-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-black-webfont.ttf b/public/fonts/Roboto/roboto-black-webfont.ttf new file mode 100644 index 0000000..c340165 Binary files /dev/null and b/public/fonts/Roboto/roboto-black-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-black-webfont.woff b/public/fonts/Roboto/roboto-black-webfont.woff new file mode 100644 index 0000000..266eba4 Binary files /dev/null and b/public/fonts/Roboto/roboto-black-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-blackitalic-webfont.eot b/public/fonts/Roboto/roboto-blackitalic-webfont.eot new file mode 100644 index 0000000..d9fafc5 Binary files /dev/null and b/public/fonts/Roboto/roboto-blackitalic-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-blackitalic-webfont.ttf b/public/fonts/Roboto/roboto-blackitalic-webfont.ttf new file mode 100644 index 0000000..7a26899 Binary files /dev/null and b/public/fonts/Roboto/roboto-blackitalic-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-blackitalic-webfont.woff b/public/fonts/Roboto/roboto-blackitalic-webfont.woff new file mode 100644 index 0000000..b8d75fb Binary files /dev/null and b/public/fonts/Roboto/roboto-blackitalic-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-bold-webfont.eot b/public/fonts/Roboto/roboto-bold-webfont.eot new file mode 100644 index 0000000..6261bf0 Binary files /dev/null and b/public/fonts/Roboto/roboto-bold-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-bold-webfont.ttf b/public/fonts/Roboto/roboto-bold-webfont.ttf new file mode 100644 index 0000000..c601e56 Binary files /dev/null and b/public/fonts/Roboto/roboto-bold-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-bold-webfont.woff b/public/fonts/Roboto/roboto-bold-webfont.woff new file mode 100644 index 0000000..aeae6e4 Binary files /dev/null and b/public/fonts/Roboto/roboto-bold-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-bolditalic-webfont.eot b/public/fonts/Roboto/roboto-bolditalic-webfont.eot new file mode 100644 index 0000000..3e5e605 Binary files /dev/null and b/public/fonts/Roboto/roboto-bolditalic-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-bolditalic-webfont.ttf b/public/fonts/Roboto/roboto-bolditalic-webfont.ttf new file mode 100644 index 0000000..9f6c031 Binary files /dev/null and b/public/fonts/Roboto/roboto-bolditalic-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-bolditalic-webfont.woff b/public/fonts/Roboto/roboto-bolditalic-webfont.woff new file mode 100644 index 0000000..1652851 Binary files /dev/null and b/public/fonts/Roboto/roboto-bolditalic-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-italic-webfont.eot b/public/fonts/Roboto/roboto-italic-webfont.eot new file mode 100644 index 0000000..e024f66 Binary files /dev/null and b/public/fonts/Roboto/roboto-italic-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-italic-webfont.ttf b/public/fonts/Roboto/roboto-italic-webfont.ttf new file mode 100644 index 0000000..c33f1fc Binary files /dev/null and b/public/fonts/Roboto/roboto-italic-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-italic-webfont.woff b/public/fonts/Roboto/roboto-italic-webfont.woff new file mode 100644 index 0000000..5084464 Binary files /dev/null and b/public/fonts/Roboto/roboto-italic-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-light-webfont.eot b/public/fonts/Roboto/roboto-light-webfont.eot new file mode 100644 index 0000000..3c3bb4b Binary files /dev/null and b/public/fonts/Roboto/roboto-light-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-light-webfont.ttf b/public/fonts/Roboto/roboto-light-webfont.ttf new file mode 100644 index 0000000..50efac8 Binary files /dev/null and b/public/fonts/Roboto/roboto-light-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-light-webfont.woff b/public/fonts/Roboto/roboto-light-webfont.woff new file mode 100644 index 0000000..c2daccb Binary files /dev/null and b/public/fonts/Roboto/roboto-light-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-lightitalic-webfont.eot b/public/fonts/Roboto/roboto-lightitalic-webfont.eot new file mode 100644 index 0000000..fd18877 Binary files /dev/null and b/public/fonts/Roboto/roboto-lightitalic-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-lightitalic-webfont.ttf b/public/fonts/Roboto/roboto-lightitalic-webfont.ttf new file mode 100644 index 0000000..6d6d04a Binary files /dev/null and b/public/fonts/Roboto/roboto-lightitalic-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-lightitalic-webfont.woff b/public/fonts/Roboto/roboto-lightitalic-webfont.woff new file mode 100644 index 0000000..c972aad Binary files /dev/null and b/public/fonts/Roboto/roboto-lightitalic-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-medium-webfont.eot b/public/fonts/Roboto/roboto-medium-webfont.eot new file mode 100644 index 0000000..1cd7774 Binary files /dev/null and b/public/fonts/Roboto/roboto-medium-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-medium-webfont.ttf b/public/fonts/Roboto/roboto-medium-webfont.ttf new file mode 100644 index 0000000..d42a7e7 Binary files /dev/null and b/public/fonts/Roboto/roboto-medium-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-medium-webfont.woff b/public/fonts/Roboto/roboto-medium-webfont.woff new file mode 100644 index 0000000..e62aea7 Binary files /dev/null and b/public/fonts/Roboto/roboto-medium-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-mediumitalic-webfont.eot b/public/fonts/Roboto/roboto-mediumitalic-webfont.eot new file mode 100644 index 0000000..00fc0eb Binary files /dev/null and b/public/fonts/Roboto/roboto-mediumitalic-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-mediumitalic-webfont.ttf b/public/fonts/Roboto/roboto-mediumitalic-webfont.ttf new file mode 100644 index 0000000..6720187 Binary files /dev/null and b/public/fonts/Roboto/roboto-mediumitalic-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-mediumitalic-webfont.woff b/public/fonts/Roboto/roboto-mediumitalic-webfont.woff new file mode 100644 index 0000000..34b0bb5 Binary files /dev/null and b/public/fonts/Roboto/roboto-mediumitalic-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-regular-webfont.eot b/public/fonts/Roboto/roboto-regular-webfont.eot new file mode 100644 index 0000000..ea3f5d5 Binary files /dev/null and b/public/fonts/Roboto/roboto-regular-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-regular-webfont.ttf b/public/fonts/Roboto/roboto-regular-webfont.ttf new file mode 100644 index 0000000..c111789 Binary files /dev/null and b/public/fonts/Roboto/roboto-regular-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-regular-webfont.woff b/public/fonts/Roboto/roboto-regular-webfont.woff new file mode 100644 index 0000000..8bb88d9 Binary files /dev/null and b/public/fonts/Roboto/roboto-regular-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-thin-webfont.eot b/public/fonts/Roboto/roboto-thin-webfont.eot new file mode 100644 index 0000000..6977e84 Binary files /dev/null and b/public/fonts/Roboto/roboto-thin-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-thin-webfont.ttf b/public/fonts/Roboto/roboto-thin-webfont.ttf new file mode 100644 index 0000000..9cda002 Binary files /dev/null and b/public/fonts/Roboto/roboto-thin-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-thin-webfont.woff b/public/fonts/Roboto/roboto-thin-webfont.woff new file mode 100644 index 0000000..1797934 Binary files /dev/null and b/public/fonts/Roboto/roboto-thin-webfont.woff differ diff --git a/public/fonts/Roboto/roboto-thinitalic-webfont.eot b/public/fonts/Roboto/roboto-thinitalic-webfont.eot new file mode 100644 index 0000000..50fca17 Binary files /dev/null and b/public/fonts/Roboto/roboto-thinitalic-webfont.eot differ diff --git a/public/fonts/Roboto/roboto-thinitalic-webfont.ttf b/public/fonts/Roboto/roboto-thinitalic-webfont.ttf new file mode 100644 index 0000000..537140a Binary files /dev/null and b/public/fonts/Roboto/roboto-thinitalic-webfont.ttf differ diff --git a/public/fonts/Roboto/roboto-thinitalic-webfont.woff b/public/fonts/Roboto/roboto-thinitalic-webfont.woff new file mode 100644 index 0000000..364305d Binary files /dev/null and b/public/fonts/Roboto/roboto-thinitalic-webfont.woff differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-bold-webfont.eot b/public/fonts/Roboto_condensed/robotocondensed-bold-webfont.eot new file mode 100644 index 0000000..9efd87b Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-bold-webfont.eot differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-bold-webfont.ttf b/public/fonts/Roboto_condensed/robotocondensed-bold-webfont.ttf new file mode 100644 index 0000000..2042120 Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-bold-webfont.ttf differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-bold-webfont.woff b/public/fonts/Roboto_condensed/robotocondensed-bold-webfont.woff new file mode 100644 index 0000000..cd0030f Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-bold-webfont.woff differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot b/public/fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot new file mode 100644 index 0000000..158770c Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.eot differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.ttf b/public/fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.ttf new file mode 100644 index 0000000..9406933 Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.ttf differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.woff b/public/fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.woff new file mode 100644 index 0000000..808f98b Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-bolditalic-webfont.woff differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-italic-webfont.eot b/public/fonts/Roboto_condensed/robotocondensed-italic-webfont.eot new file mode 100644 index 0000000..9be7c55 Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-italic-webfont.eot differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-italic-webfont.ttf b/public/fonts/Roboto_condensed/robotocondensed-italic-webfont.ttf new file mode 100644 index 0000000..ec00577 Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-italic-webfont.ttf differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-italic-webfont.woff b/public/fonts/Roboto_condensed/robotocondensed-italic-webfont.woff new file mode 100644 index 0000000..89251fd Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-italic-webfont.woff differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-light-webfont.eot b/public/fonts/Roboto_condensed/robotocondensed-light-webfont.eot new file mode 100644 index 0000000..762eaa6 Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-light-webfont.eot differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-light-webfont.ttf b/public/fonts/Roboto_condensed/robotocondensed-light-webfont.ttf new file mode 100644 index 0000000..68f30cb Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-light-webfont.ttf differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-light-webfont.woff b/public/fonts/Roboto_condensed/robotocondensed-light-webfont.woff new file mode 100644 index 0000000..a0b66cb Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-light-webfont.woff differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot b/public/fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot new file mode 100644 index 0000000..559a83c Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.eot differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.ttf b/public/fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.ttf new file mode 100644 index 0000000..00516c6 Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.ttf differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.woff b/public/fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.woff new file mode 100644 index 0000000..5b4f9cc Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-lightitalic-webfont.woff differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-regular-webfont.eot b/public/fonts/Roboto_condensed/robotocondensed-regular-webfont.eot new file mode 100644 index 0000000..a9dbc9c Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-regular-webfont.eot differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-regular-webfont.ttf b/public/fonts/Roboto_condensed/robotocondensed-regular-webfont.ttf new file mode 100644 index 0000000..f113561 Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-regular-webfont.ttf differ diff --git a/public/fonts/Roboto_condensed/robotocondensed-regular-webfont.woff b/public/fonts/Roboto_condensed/robotocondensed-regular-webfont.woff new file mode 100644 index 0000000..ead3319 Binary files /dev/null and b/public/fonts/Roboto_condensed/robotocondensed-regular-webfont.woff differ diff --git a/public/fonts/Roboto_slab/robotoslab-bold-webfont.eot b/public/fonts/Roboto_slab/robotoslab-bold-webfont.eot new file mode 100644 index 0000000..1dba9e4 Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-bold-webfont.eot differ diff --git a/public/fonts/Roboto_slab/robotoslab-bold-webfont.ttf b/public/fonts/Roboto_slab/robotoslab-bold-webfont.ttf new file mode 100644 index 0000000..c99c82e Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-bold-webfont.ttf differ diff --git a/public/fonts/Roboto_slab/robotoslab-bold-webfont.woff b/public/fonts/Roboto_slab/robotoslab-bold-webfont.woff new file mode 100644 index 0000000..34933d4 Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-bold-webfont.woff differ diff --git a/public/fonts/Roboto_slab/robotoslab-light-webfont.eot b/public/fonts/Roboto_slab/robotoslab-light-webfont.eot new file mode 100644 index 0000000..23ca73b Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-light-webfont.eot differ diff --git a/public/fonts/Roboto_slab/robotoslab-light-webfont.ttf b/public/fonts/Roboto_slab/robotoslab-light-webfont.ttf new file mode 100644 index 0000000..f580f94 Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-light-webfont.ttf differ diff --git a/public/fonts/Roboto_slab/robotoslab-light-webfont.woff b/public/fonts/Roboto_slab/robotoslab-light-webfont.woff new file mode 100644 index 0000000..f3d5dfe Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-light-webfont.woff differ diff --git a/public/fonts/Roboto_slab/robotoslab-regular-webfont.eot b/public/fonts/Roboto_slab/robotoslab-regular-webfont.eot new file mode 100644 index 0000000..dc13d45 Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-regular-webfont.eot differ diff --git a/public/fonts/Roboto_slab/robotoslab-regular-webfont.ttf b/public/fonts/Roboto_slab/robotoslab-regular-webfont.ttf new file mode 100644 index 0000000..3452f9f Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-regular-webfont.ttf differ diff --git a/public/fonts/Roboto_slab/robotoslab-regular-webfont.woff b/public/fonts/Roboto_slab/robotoslab-regular-webfont.woff new file mode 100644 index 0000000..31c3534 Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-regular-webfont.woff differ diff --git a/public/fonts/Roboto_slab/robotoslab-thin-webfont.eot b/public/fonts/Roboto_slab/robotoslab-thin-webfont.eot new file mode 100644 index 0000000..41dce4b Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-thin-webfont.eot differ diff --git a/public/fonts/Roboto_slab/robotoslab-thin-webfont.ttf b/public/fonts/Roboto_slab/robotoslab-thin-webfont.ttf new file mode 100644 index 0000000..0d5ed94 Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-thin-webfont.ttf differ diff --git a/public/fonts/Roboto_slab/robotoslab-thin-webfont.woff b/public/fonts/Roboto_slab/robotoslab-thin-webfont.woff new file mode 100644 index 0000000..7340240 Binary files /dev/null and b/public/fonts/Roboto_slab/robotoslab-thin-webfont.woff differ diff --git a/public/fonts/fontawesome-webfont.eot b/public/fonts/fontawesome-webfont.eot new file mode 100644 index 0000000..0662cb9 Binary files /dev/null and b/public/fonts/fontawesome-webfont.eot differ diff --git a/public/fonts/fontawesome-webfont.ttf b/public/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..d365924 Binary files /dev/null and b/public/fonts/fontawesome-webfont.ttf differ diff --git a/public/fonts/fontawesome-webfont.woff b/public/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..b9bd17e Binary files /dev/null and b/public/fonts/fontawesome-webfont.woff differ diff --git a/public/img/SAPOlogo.png b/public/img/SAPOlogo.png new file mode 100644 index 0000000..fc62e56 Binary files /dev/null and b/public/img/SAPOlogo.png differ diff --git a/public/img/favicon.ico b/public/img/favicon.ico new file mode 100644 index 0000000..03515b1 Binary files /dev/null and b/public/img/favicon.ico differ diff --git a/public/img/home_bkg.png b/public/img/home_bkg.png new file mode 100644 index 0000000..c6faad8 Binary files /dev/null and b/public/img/home_bkg.png differ diff --git a/public/img/home_logo_IE.jpg b/public/img/home_logo_IE.jpg new file mode 100644 index 0000000..e038b41 Binary files /dev/null and b/public/img/home_logo_IE.jpg differ diff --git a/public/img/icon_Sprite.png b/public/img/icon_Sprite.png new file mode 100644 index 0000000..56f46c4 Binary files /dev/null and b/public/img/icon_Sprite.png differ diff --git a/public/img/ink-favicon.ico b/public/img/ink-favicon.ico new file mode 100644 index 0000000..64e2d44 Binary files /dev/null and b/public/img/ink-favicon.ico differ diff --git a/public/img/logo_home.png b/public/img/logo_home.png new file mode 100644 index 0000000..a286cf6 Binary files /dev/null and b/public/img/logo_home.png differ diff --git a/public/img/splash.1024x748.png b/public/img/splash.1024x748.png new file mode 100644 index 0000000..b7db706 Binary files /dev/null and b/public/img/splash.1024x748.png differ diff --git a/public/img/splash.320x460.png b/public/img/splash.320x460.png new file mode 100644 index 0000000..66fd16a Binary files /dev/null and b/public/img/splash.320x460.png differ diff --git a/public/img/splash.768x1004.png b/public/img/splash.768x1004.png new file mode 100644 index 0000000..643529b Binary files /dev/null and b/public/img/splash.768x1004.png differ diff --git a/public/img/touch-icon.114.png b/public/img/touch-icon.114.png new file mode 100644 index 0000000..6deac38 Binary files /dev/null and b/public/img/touch-icon.114.png differ diff --git a/public/img/touch-icon.16.png b/public/img/touch-icon.16.png new file mode 100644 index 0000000..1318a7b Binary files /dev/null and b/public/img/touch-icon.16.png differ diff --git a/public/img/touch-icon.256.png b/public/img/touch-icon.256.png new file mode 100644 index 0000000..32cefb5 Binary files /dev/null and b/public/img/touch-icon.256.png differ diff --git a/public/img/touch-icon.57.png b/public/img/touch-icon.57.png new file mode 100644 index 0000000..91e8a39 Binary files /dev/null and b/public/img/touch-icon.57.png differ diff --git a/public/img/touch-icon.72.png b/public/img/touch-icon.72.png new file mode 100644 index 0000000..600036e Binary files /dev/null and b/public/img/touch-icon.72.png differ diff --git a/public/js/autoload.js b/public/js/autoload.js new file mode 100644 index 0000000..aec0c3c --- /dev/null +++ b/public/js/autoload.js @@ -0,0 +1,154 @@ +/** + * @module Ink.Autoload + * @version 1 + * Create Ink UI components easily + */ +Ink.createModule('Ink.Autoload', 1, ['Ink.Dom.Selector_1', 'Ink.Util.Array_1', 'Ink.Dom.Loaded_1', 'Ink.UI.SmoothScroller_1', 'Ink.UI.Close_1'], function( Selector, InkArray, Loaded, Scroller, Close ){ + 'use strict'; + + /** + * @namespace Ink.Autoload + * @static + */ + + var el = document.createElement('div'); + // See if a selector is valid. + function validSelector(sel) { + try { + Selector.select(sel, el); + } catch(e) { + Ink.error(e); + return false; + } + return true; + } + + var Autoload = { + /** + * Matches module names to default selectors. + * + * @property selectors {Object} + * @public + **/ + selectors: { + /* Match module names to element classes (or more complex selectors) + * which get the UI modules instantiated automatically. */ + 'Animate_1' : '.ink-animate', + 'Carousel_1' : '.ink-carousel', + 'DatePicker_1' : '.ink-datepicker', + 'Dropdown_1' : '.ink-dropdown', + 'Gallery_1' : 'ul.ink-gallery-source', + 'Modal_1' : '.ink-modal', + 'ProgressBar_1' : '.ink-progress-bar', + 'SortableList_1': '.ink-sortable-list', + 'Spy_1' : '[data-spy="true"]', + 'Stacker_1' : '.ink-stacker', + 'Sticky_1' : '.ink-sticky, .sticky', + 'Table_1' : '.ink-table', + 'Tabs_1' : '.ink-tabs', + 'Toggle_1' : '.ink-toggle, .toggle', + 'Tooltip_1' : '.ink-tooltip, .tooltip', + 'TreeView_1' : '.ink-tree-view' + }, + defaultOptions: {}, + + /** + * Run Autoload on a specific element. + * + * Useful when you load something from AJAX and want it to have automatically loaded Ink modules. + * @method run + * @param {DOMElement} parentEl + * @param {Object} [options] Options object, containing: + * @param {Boolean} [options.forceAutoload] Autoload things on elements even if they have `data-autoload="false"` + * @param {Boolean} [options.createClose] Whether to create the Ink.UI.Close component. Defaults to `true`. + * @param {Boolean} [options.createSmoothScroller] Whether to create the Scroller component. Defaults to `true`. + * @param {Object} [options.selectors=Ink.Autoload.selectors] A hash mapping module names to selectors that match elements to load these modules. For example, `{ 'Modal_1': '.my-specific-modal' }`. + * @param {Boolean} [options.waitForDOMLoaded=false] Do nothing until the DOM is loaded. Uses Ink.Dom.Loaded.run(); + * @public + * @sample Autoload_1.html + **/ + run: function (parentEl, options){ + options = Ink.extendObj({ + // The below lines are not required because undefined is falsy anyway.. + // forceAutoload: false, + // waitForDOMLoaded: false, + // createClose: false, + // createSmoothScroller: false, + selectors: Autoload.selectors + }, options || {}); + + for(var mod in options.selectors) if (options.selectors.hasOwnProperty(mod)) { + // `elements` need to be in a closure because requireModules is async. + findElements(mod); + } + if (options.createClose !== false) { + new Close(); + } + if (options.createSmoothScroller !== false) { + Scroller.init(); + } + + function findElements(mod) { + var modName = 'Ink.UI.' + mod; + var elements = Selector.select( options.selectors[mod], parentEl ); + + elements = InkArray.filter(elements, autoloadElement); + + if( elements.length ){ + Ink.requireModules( [modName], function( Component ) { + InkArray.forEach(elements, function (el) { + new Component(el, Autoload.defaultOptions[modName]); + }); + }); + } + } + + function autoloadElement(element) { + if (options.forceAutoload === true) { return true; } + if (typeof element.getAttribute === 'function') { + return element.getAttribute('data-autoload') !== 'false'; + } + } + }, + /** + * Add a new entry to be autoloaded. + * @method add + * @param moduleName {String} + * @param selector {String} + */ + add: function (moduleName, selector) { + if (!validSelector(selector)) { return false; } + + if (Autoload.selectors[moduleName]) { + Autoload.selectors[moduleName] += ', ' + selector; + } else { + Autoload.selectors[moduleName] = selector; + } + }, + /** + * Removes a module from autoload, making it not be automatically loaded. + * @method remove + * @param moduleName {String} + **/ + remove: function (moduleName) { + delete Autoload.selectors[moduleName]; + } + }; + + for (var k in Autoload.selectors) if (Autoload.selectors.hasOwnProperty(k)) { + Autoload.defaultOptions[k] = {}; + } + + if (!window.INK_NO_AUTO_LOAD) { + Loaded.run(function () { + Autoload.run(document, { + createSmoothScroller: true, + createClose: true + }); + Autoload.firstRunDone = true; + }); + } + + return Autoload; +}); + diff --git a/public/js/holder.js b/public/js/holder.js new file mode 100644 index 0000000..f85fc54 --- /dev/null +++ b/public/js/holder.js @@ -0,0 +1,440 @@ +/* + +Holder - 1.9 - client side image placeholders +(c) 2012-2013 Ivan Malopinsky / http://imsky.co + +Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 +Commercial use requires attribution. + +*/ + +var Holder = Holder || {}; +(function (app, win) { + +var preempted = false, +fallback = false, +canvas = document.createElement('canvas'); + +//getElementsByClassName polyfill +document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i 1) { + text_height = template.size / (ctx.measureText(text).width / width); + } + //Resetting font size if necessary + ctx.font = "bold " + (text_height * ratio) + "px " + font; + ctx.fillText(text, (width / 2), (height / 2), width); + return canvas.toDataURL("image/png"); +} + +function render(mode, el, holder, src) { + var dimensions = holder.dimensions, + theme = holder.theme, + text = holder.text ? decodeURIComponent(holder.text) : holder.text; + var dimensions_caption = dimensions.width + "x" + dimensions.height; + + theme = (text ? extend(theme, { + text: text + }) : theme); + theme = (holder.font ? extend(theme, { + font: holder.font + }) : theme); + + if (mode == "image") { + el.setAttribute("data-src", src); + el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption); + + if (fallback || !holder.auto) { + el.style.width = dimensions.width + "px"; + el.style.height = dimensions.height + "px"; + } + + if (fallback) { + el.style.backgroundColor = theme.background; + + } else { + el.setAttribute("src", draw(ctx, dimensions, theme, ratio)); + } + } else { + if (!fallback) { + el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")"; + el.style.backgroundSize = dimensions.width + "px " + dimensions.height + "px"; + } + } +}; + +function fluid(el, holder, src) { + var dimensions = holder.dimensions, + theme = holder.theme, + text = holder.text; + var dimensions_caption = dimensions.width + "x" + dimensions.height; + theme = (text ? extend(theme, { + text: text + }) : theme); + + var fluid = document.createElement("div"); + + if (el.fluidRef) { + fluid = el.fluidRef; + } + + fluid.style.backgroundColor = theme.background; + fluid.style.color = theme.foreground; + fluid.className = el.className + " holderjs-fluid"; + fluid.style.width = holder.dimensions.width + (holder.dimensions.width.indexOf("%") > 0 ? "" : "px"); + fluid.style.height = holder.dimensions.height + (holder.dimensions.height.indexOf("%") > 0 ? "" : "px"); + fluid.id = el.id; + + el.style.width = 0; + el.style.height = 0; + + if (!el.fluidRef) { + + if (theme.text) { + fluid.appendChild(document.createTextNode(theme.text)) + } else { + fluid.appendChild(document.createTextNode(dimensions_caption)) + fluid_images.push(fluid); + setTimeout(fluid_update, 0); + } + + } + + el.fluidRef = fluid; + el.parentNode.insertBefore(fluid, el.nextSibling) + + if (window.jQuery) { + jQuery(function ($) { + $(el).on("load", function () { + el.style.width = fluid.style.width; + el.style.height = fluid.style.height; + $(el).show(); + $(fluid).remove(); + }); + }) + } +} + +function fluid_update() { + for (i in fluid_images) { + if (!fluid_images.hasOwnProperty(i)) continue; + var el = fluid_images[i], + label = el.firstChild; + + el.style.lineHeight = el.offsetHeight + "px"; + label.data = el.offsetWidth + "x" + el.offsetHeight; + } +} + +function parse_flags(flags, options) { + + var ret = { + theme: settings.themes.gray + }, render = false; + + for (sl = flags.length, j = 0; j < sl; j++) { + var flag = flags[j]; + if (app.flags.dimensions.match(flag)) { + render = true; + ret.dimensions = app.flags.dimensions.output(flag); + } else if (app.flags.fluid.match(flag)) { + render = true; + ret.dimensions = app.flags.fluid.output(flag); + ret.fluid = true; + } else if (app.flags.colors.match(flag)) { + ret.theme = app.flags.colors.output(flag); + } else if (options.themes[flag]) { + //If a theme is specified, it will override custom colors + ret.theme = options.themes[flag]; + } else if (app.flags.text.match(flag)) { + ret.text = app.flags.text.output(flag); + } else if (app.flags.font.match(flag)) { + ret.font = app.flags.font.output(flag); + } else if (app.flags.auto.match(flag)) { + ret.auto = true; + } + } + + return render ? ret : false; + +}; + + + +if (!canvas.getContext) { + fallback = true; +} else { + if (canvas.toDataURL("image/png") + .indexOf("data:image/png") < 0) { + //Android doesn't support data URI + fallback = true; + } else { + var ctx = canvas.getContext("2d"); + } +} + +var dpr = 1, bsr = 1; + +if(!fallback){ + dpr = window.devicePixelRatio || 1, + bsr = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1; +} + +var ratio = dpr / bsr; + +var fluid_images = []; + +var settings = { + domain: "holder.js", + images: "img", + bgnodes: ".holderjs", + themes: { + "gray": { + background: "#eee", + foreground: "#aaa", + size: 12 + }, + "social": { + background: "#3a5a97", + foreground: "#fff", + size: 12 + }, + "industrial": { + background: "#434A52", + foreground: "#C2F200", + size: 12 + }, + "ink": { + background: "#222", + foreground: "#fff", + size: 18 + } + }, + stylesheet: ".holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;margin:0}" +}; + + +app.flags = { + dimensions: { + regex: /^(\d+)x(\d+)$/, + output: function (val) { + var exec = this.regex.exec(val); + return { + width: +exec[1], + height: +exec[2] + } + } + }, + fluid: { + regex: /^([0-9%]+)x([0-9%]+)$/, + output: function (val) { + var exec = this.regex.exec(val); + return { + width: exec[1], + height: exec[2] + } + } + }, + colors: { + regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i, + output: function (val) { + var exec = this.regex.exec(val); + return { + size: settings.themes.gray.size, + foreground: "#" + exec[2], + background: "#" + exec[1] + } + } + }, + text: { + regex: /text\:(.*)/, + output: function (val) { + return this.regex.exec(val)[1]; + } + }, + font: { + regex: /font\:(.*)/, + output: function (val) { + return this.regex.exec(val)[1]; + } + }, + auto: { + regex: /^auto$/ + } +} + +for (var flag in app.flags) { + if (!app.flags.hasOwnProperty(flag)) continue; + app.flags[flag].match = function (val) { + return val.match(this.regex) + } +} + +app.add_theme = function (name, theme) { + name != null && theme != null && (settings.themes[name] = theme); + return app; +}; + +app.add_image = function (src, el) { + var node = selector(el); + if (node.length) { + for (var i = 0, l = node.length; i < l; i++) { + var img = document.createElement("img") + img.setAttribute("data-src", src); + node[i].appendChild(img); + } + } + return app; +}; + +app.run = function (o) { + var options = extend(settings, o), + images = [], imageNodes = [], bgnodes = []; + + if(typeof(options.images) == "string"){ + imageNodes = selector(options.images); + } + else if (window.NodeList && options.images instanceof window.NodeList) { + imageNodes = options.images; + } else if (window.Node && options.images instanceof window.Node) { + imageNodes = [options.images]; + } + + if(typeof(options.bgnodes) == "string"){ + bgnodes = selector(options.bgnodes); + } else if (window.NodeList && options.elements instanceof window.NodeList) { + bgnodes = options.bgnodes; + } else if (window.Node && options.bgnodes instanceof window.Node) { + bgnodes = [options.bgnodes]; + } + + preempted = true; + + for (i = 0, l = imageNodes.length; i < l; i++) images.push(imageNodes[i]); + + var holdercss = document.getElementById("holderjs-style"); + if (!holdercss) { + holdercss = document.createElement("style"); + holdercss.setAttribute("id", "holderjs-style"); + holdercss.type = "text/css"; + document.getElementsByTagName("head")[0].appendChild(holdercss); + } + + if (!options.nocss) { + if (holdercss.styleSheet) { + holdercss.styleSheet.cssText += options.stylesheet; + } else { + holdercss.appendChild(document.createTextNode(options.stylesheet)); + } + } + + + + var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)"); + + for (var l = bgnodes.length, i = 0; i < l; i++) { + var src = window.getComputedStyle(bgnodes[i], null) + .getPropertyValue("background-image"); + var flags = src.match(cssregex); + if (flags) { + var holder = parse_flags(flags[1].split("/"), options); + if (holder) { + render("background", bgnodes[i], holder, src); + } + } + } + + for (l = images.length, i = 0; i < l; i++) { + + var attr_src = attr_data_src = src = null; + + try{ + attr_src = images[i].getAttribute("src"); + attr_datasrc = images[i].getAttribute("data-src"); + }catch(e){} + + if (attr_datasrc == null && !! attr_src && attr_src.indexOf(options.domain) >= 0) { + src = attr_src; + } else if ( !! attr_datasrc && attr_datasrc.indexOf(options.domain) >= 0) { + src = attr_datasrc; + } + + if (src) { + var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1) + .split("/"), options); + if (holder) { + if (holder.fluid) { + fluid(images[i], holder, src); + } else { + render("image", images[i], holder, src); + } + } + } + } + return app; +}; + +contentLoaded(win, function () { + if (window.addEventListener) { + window.addEventListener("resize", fluid_update, false); + window.addEventListener("orientationchange", fluid_update, false); + } else { + window.attachEvent("onresize", fluid_update) + } + preempted || app.run(); +}); + +if (typeof define === "function" && define.amd) { + define("Holder", [], function () { + return app; + }); +} + +})(Holder, window); diff --git a/public/js/html5shiv-printshiv.js b/public/js/html5shiv-printshiv.js new file mode 100644 index 0000000..b12379e --- /dev/null +++ b/public/js/html5shiv-printshiv.js @@ -0,0 +1,11 @@ +/* + HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +(function(j,f){function s(a,b){var c=a.createElement("p"),m=a.getElementsByTagName("head")[0]||a.documentElement;c.innerHTML="x";return m.insertBefore(c.lastChild,m.firstChild)}function o(){var a=d.elements;return"string"==typeof a?a.split(" "):a}function n(a){var b=t[a[u]];b||(b={},p++,a[u]=p,t[p]=b);return b}function v(a,b,c){b||(b=f);if(e)return b.createElement(a);c||(c=n(b));b=c.cache[a]?c.cache[a].cloneNode():y.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a); +return b.canHaveChildren&&!z.test(a)?c.frag.appendChild(b):b}function A(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();a.createElement=function(c){return!d.shivMethods?b.createElem(c):v(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+o().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(d,b.frag)} +function w(a){a||(a=f);var b=n(a);if(d.shivCSS&&!q&&!b.hasCSS)b.hasCSS=!!s(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}");e||A(a,b);return a}function B(a){for(var b,c=a.attributes,m=c.length,f=a.ownerDocument.createElement(l+":"+a.nodeName);m--;)b=c[m],b.specified&&f.setAttribute(b.nodeName,b.nodeValue);f.style.cssText=a.style.cssText;return f}function x(a){function b(){clearTimeout(d._removeSheetTimer); +c&&c.removeNode(!0);c=null}var c,f,d=n(a),e=a.namespaces,j=a.parentWindow;if(!C||a.printShived)return a;"undefined"==typeof e[l]&&e.add(l);j.attachEvent("onbeforeprint",function(){b();var g,i,d;d=a.styleSheets;for(var e=[],h=d.length,k=Array(h);h--;)k[h]=d[h];for(;d=k.pop();)if(!d.disabled&&D.test(d.media)){try{g=d.imports,i=g.length}catch(j){i=0}for(h=0;h+~])("+o().join("|")+")(?=[[\\s,>+~#.:]|$)", +"gi");for(k="$1"+l+"\\:$2";i--;)e=g[i]=g[i].split("}"),e[e.length-1]=e[e.length-1].replace(h,k),g[i]=e.join("}");e=g.join("{");i=a.getElementsByTagName("*");h=i.length;k=RegExp("^(?:"+o().join("|")+")$","i");for(d=[];h--;)g=i[h],k.test(g.nodeName)&&d.push(g.applyElement(B(g)));f=d;c=s(a,e)});j.attachEvent("onafterprint",function(){for(var a=f,c=a.length;c--;)a[c].removeNode();clearTimeout(d._removeSheetTimer);d._removeSheetTimer=setTimeout(b,500)});a.printShived=!0;return a}var r=j.html5||{},z=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, +y=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q,u="_html5shiv",p=0,t={},e;(function(){try{var a=f.createElement("a");a.innerHTML="";q="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}e=b}catch(d){e=q=!0}})();var d={elements:r.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video", +version:"3.7.0",shivCSS:!1!==r.shivCSS,supportsUnknownElements:e,shivMethods:!1!==r.shivMethods,type:"default",shivDocument:w,createElement:v,createDocumentFragment:function(a,b){a||(a=f);if(e)return a.createDocumentFragment();for(var b=b||n(a),c=b.frag.cloneNode(),d=0,j=o(),l=j.length;darticle,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}"; +c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| +"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f); +if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d 0) { + pRMs.push(o); + } + else { + cb = o.cb; + if (!cb) { continue; } + delete o.cb; // to make sure I won't call this more than once! + cb.apply(false, o.args); + } + } + + pendingRMs = pRMs; + + if (pendingRMs.length > 0) { + setTimeout( function() { Ink._checkPendingRequireModules(); }, 0 ); + } + }, + + /** + * Get the full path of a module. + * This method looks up the paths given in setPath (and ultimately the default Ink's path). + * + * @method getPath + * @param {String} key Name of the module you want to get the path + * @param {Boolean} [noLib] Flag to skip appending 'lib.js' to the returned path. + */ + getPath: function(key, noLib) { + var split = key.split(/[._]/g); + var curKey; + var i; + var root; + var path; + + // Look for Ink.Dom.Element.1, Ink.Dom.Element, Ink.Dom, Ink in this order. + for (i = split.length; i >= 0; i -= 1) { + curKey = split.slice(0, i + 1).join('.'); // See comment in setPath + if (paths[curKey]) { + root = curKey; + break; + } + } + + if (root in paths) { + path = paths[root]; + } else { + return null; + } + + if (!/\/$/.test(path)) { + path += '/'; + } + if (i < split.length) { + // Add the rest of the path. For example, if we found + // paths['Ink.Dom'] to be 'http://example.com/Ink/Dom/', + // we now add '/Element/' to get the full path. + path += split.slice(i + 1).join('/') + '/'; + } + if (!noLib) { + path += 'lib.js'; + } + return path; + }, + + /** + * Sets the URL path for a namespace. + * Use this to customize where requireModules and createModule will load dependencies from. + * This can be useful to set your own CDN for dynamic module loading or simply to change your module folder structure + * + * @method setPath + * + * @param {String} key Module or namespace + * @param {String} rootURI Base URL path and schema to be appended to the module or namespace + * + * @example + * Ink.setPath('Ink', 'http://my-cdn/Ink/'); + * Ink.setPath('Lol', 'http://my-cdn/Lol/'); + * + * // Loads from http://my-cdn/Ink/Dom/Whatever/lib.js + * Ink.requireModules(['Ink.Dom.Whatever'], function () { ... }); + * // Loads from http://my-cdn/Lol/Whatever/lib.js + * Ink.requireModules(['Lol.Whatever'], function () { ... }); + */ + setPath: function(key, rootURI) { + // Replacing version separator with dot because the difference + // between a submodule and a version doesn't matter here. + // It would also overcomplicate the implementation of getPath + paths[key.replace(/_/, '.')] = rootURI; + }, + + /** + * Loads a script URL. + * This creates a `script` tag in the `head` of the document. + * Reports errors by listening to 'error' and 'readystatechange' events. + * + * @method loadScript + * @param {String} uri Can be an external URL or a module name + * @param {String} [contentType]='text/javascript' The `type` attribute of the new script tag. + */ + loadScript: function(uri, contentType) { + /*jshint evil:true */ + + if (uri.indexOf('/') === -1) { + var givenUri = uri; // For the error message + uri = this.getPath(uri); + if (uri === null) { + throw new Error('Could not load script "' + givenUri + '". ' + + 'Path not found in the registry. Did you misspell ' + + 'the name, or forgot to call setPath()?'); + } + } + + var scriptEl = document.createElement('script'); + scriptEl.setAttribute('type', contentType || 'text/javascript'); + scriptEl.setAttribute('src', uri); + + scriptEl.onerror = scriptEl.onreadystatechange = function (ev) { + ev = ev || window.event; + if (ev.type === 'readystatechange' && scriptEl.readyState !== 'loaded') { + // if not readyState == 'loaded' it's not an error. + return; + } + Ink.error(['Failed to load script from ', uri, '.'].join('')); + }; + // CHECK ON ALL BROWSERS + /*if (document.readyState !== 'complete' && !document.body) { + document.write( scriptEl.outerHTML ); + } + else {*/ + var aHead = document.getElementsByTagName('head'); + if(aHead.length > 0) { + aHead[0].appendChild(scriptEl); + } + //} + }, + + _loadLater: function (dep) { + setTimeout(function () { + if (modules[dep] || modulesRequested[dep] || + modulesWaitingForDeps[dep]) { + return; + } + modulesRequested[dep] = true; + Ink.loadScript(dep); + }, 0); + }, + + /** + * Defines a module namespace. + * + * @method namespace + * @param {String} ns Namespace to define. + * @param {Boolean} [returnParentAndKey] Flag to change the return value to an array containing the namespace parent and the namespace key + * @return {Object|Array} Returns the created namespace object + */ + namespace: function(ns, returnParentAndKey) { + if (!ns || !ns.length) { return null; } + + var levels = ns.split('.'); + var nsobj = window; + var parent; + + for (var i = 0, f = levels.length; i < f; ++i) { + nsobj[ levels[i] ] = nsobj[ levels[i] ] || {}; + parent = nsobj; + nsobj = nsobj[ levels[i] ]; + } + + if (returnParentAndKey) { + return [ + parent, + levels[i-1] + ]; + } + + return nsobj; + }, + + /** + * Loads a module. + * A synchronous method to get the module from the internal registry. + * It assumes the module is defined and loaded already! + * + * @method getModule + * @param {String} mod Module name + * @param {Number} [version] Version number of the module + * @return {Object|Function} Module object or function, depending how the module is defined + */ + getModule: function(mod, version) { + var key = version ? [mod, '_', version].join('') : mod; + return modules[key]; + }, + + /** + * Creates a new module. + * Use this to wrap your code and benefit from the module loading used throughout the Ink library + * + * @method createModule + * @param {String} mod Module name, separated by dots. Like Ink.Dom.Selector, Ink.UI.Modal + * @param {Number} version Version number + * @param {Array} deps Array of module names which are dependencies of the module being created. The order in which they are passed here will define the order they will be passed to the callback function. + * @param {Function} modFn The callback function to be executed when all the dependencies are resolved. The dependencies are passed as arguments, in the same order they were declared. The function itself should return the module. + * @sample Ink_1_createModule.html + * + */ + createModule: function(mod, ver, deps, modFn) { // define + if (typeof mod !== 'string') { + throw new Error('module name must be a string!'); + } + + // validate version correctness + if (!(typeof ver === 'number' || (typeof ver === 'string' && ver.length > 0))) { + throw new Error('version number missing!'); + } + + var modAll = [mod, '_', ver].join(''); + + modulesWaitingForDeps[modAll] = true; + + var cb = function() { + //console.log(['createModule(', mod, ', ', ver, ', [', deps.join(', '), '], ', !!modFn, ')'].join('')); + + // make sure module in not loaded twice + if (modules[modAll]) { + //console.warn(['Ink.createModule ', modAll, ': module has been defined already.'].join('')); + return; + } + + + // delete related pending tasks + delete modulesRequested[modAll]; + delete modulesRequested[mod]; + + + // run module's supplied factory + var args = Array.prototype.slice.call(arguments); + var moduleContent = modFn.apply(window, args); + modulesLoadOrder.push(modAll); + // console.log('** loaded module ' + modAll + '**'); + + + // set version + if (typeof moduleContent === 'object') { // Dom.Css Dom.Event + moduleContent._version = ver; + } + else if (typeof moduleContent === 'function') { + moduleContent.prototype._version = ver; // if constructor + moduleContent._version = ver; // if regular function + } + + + // add to global namespace... + var isInkModule = mod.indexOf('Ink.') === 0; + var t; + if (isInkModule) { + t = Ink.namespace(mod, true); // for mod 'Ink.Dom.Css', t[0] gets 'Ink.Dom' object and t[1] 'Css' + } + + + // versioned + modules[ modAll ] = moduleContent; // in modules + delete modulesWaitingForDeps[ modAll ]; + + if (isInkModule) { + t[0][ t[1] + '_' + ver ] = moduleContent; // in namespace + } + + + // unversioned + modules[ mod ] = moduleContent; // in modules + + if (isInkModule) { + if (isEmptyObject( t[0][ t[1] ] )) { + t[0][ t[1] ] = moduleContent; // in namespace + } + // else { + // console.warn(['Ink.createModule ', modAll, ': module has been defined already with a different version!'].join('')); + // } + } + + + if (this) { // there may be pending requires expecting this module, check... + Ink._checkPendingRequireModules(); + } + }; + + this.requireModules(deps, cb); + }, + + /** + * Requires modules asynchronously + * Use this to get modules, even if they're not loaded yet + * + * @method requireModules + * @param {Array} deps Array of module names. The order in which they are passed here will define the order they will be passed to the callback function. + * @param {Function} cbFn The callback function to be executed when all the dependencies are resolved. The dependencies are passed as arguments, in the same order they were declared. + * @sample Ink_1_requireModules.html + */ + requireModules: function(deps, cbFn) { // require + //console.log(['requireModules([', deps.join(', '), '], ', !!cbFn, ')'].join('')); + var i, f, o, dep, mod; + f = deps && deps.length; + o = { + args: new Array(f), + left: {}, + remaining: f, + cb: cbFn + }; + + if (!(typeof deps === 'object' && deps.length !== undefined)) { + throw new Error('Dependency list should be an array!'); + } + if (typeof cbFn !== 'function') { + throw new Error('Callback should be a function!'); + } + + for (i = 0; i < f; ++i) { + if (Ink._moduleRenames[deps[i]]) { + Ink.warn(deps[i] + ' was renamed to ' + Ink._moduleRenames[deps[i]]); + dep = Ink._moduleRenames[deps[i]]; + } else { + dep = deps[i]; + } + + // Because trailing commas in oldIE bring us undefined values here + if (!dep) { + --o.remaining; + continue; + } + + mod = modules[dep]; + if (mod) { + o.args[i] = mod; + --o.remaining; + continue; + } + else if (!modulesRequested[dep]) { + Ink._loadLater(dep); + } + o.left[dep] = i; + } + + if (o.remaining > 0) { + pendingRMs.push(o); + } + else { + cbFn.apply(true, o.args); + } + }, + + _moduleRenames: { + 'Ink.UI.Aux_1': 'Ink.UI.Common_1' + }, + + /** + * Lists loaded module names. + * The list is ordered by loaded time (oldest module comes first) + * + * @method getModulesLoadOrder + * @return {Array} returns the order in which modules were resolved and correctly loaded + */ + getModulesLoadOrder: function() { + return modulesLoadOrder.slice(); + }, + + /** + * Builds the markup needed to load the modules. + * This method builds the script tags needed to load the currently used modules + * + * @method getModuleScripts + * @uses getModulesLoadOrder + * @return {String} The script markup + */ + getModuleScripts: function() { + var mlo = this.getModulesLoadOrder(); + mlo.unshift('Ink_1'); + mlo = mlo.map(function(m) { + return [''].join(''); + }); + + return mlo.join('\n'); + }, + + /** + * Creates an Ink.Ext module + * + * Does exactly the same as createModule but creates the module in the Ink.Ext namespace + * + * @method createExt + * @uses createModule + * @param {String} moduleName Extension name + * @param {String} version Extension version + * @param {Array} dependencies Extension dependencies + * @param {Function} modFn Function returning the extension + * @sample Ink_1_createExt.html + */ + createExt: function (moduleName, version, dependencies, modFn) { + return Ink.createModule('Ink.Ext.' + moduleName, version, dependencies, modFn); + }, + + /** + * Function.prototype.bind alternative. + * Creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. + * + * @method bind + * @param {Function} fn The function + * @param {Object} context The value to be passed as the this parameter to the target function when the bound function is called. If used as false, it preserves the original context and just binds the arguments. + * @param {Any} [args*] Additional arguments will be sent to the original function as prefix arguments. + * @return {Function} + * @sample Ink_1_bind.html + */ + bind: function(fn, context) { + var args = Array.prototype.slice.call(arguments, 2); + return function() { + var innerArgs = Array.prototype.slice.call(arguments); + var finalArgs = args.concat(innerArgs); + return fn.apply(context === false ? this : context, finalArgs); + }; + }, + + /** + * Function.prototype.bind alternative for class methods + * Creates a new function that, when called, has this k + * @method bindMethod + * @uses bind + * @param {Object} object The object that contains the method to bind + * @param {String} methodName The name of the method that will be bound + * @param {Any} [args*] Additional arguments will be sent to the new method as prefix arguments. + * @return {Function} + * @sample Ink_1_bindMethod.html + */ + bindMethod: function (object, methodName) { + return Ink.bind.apply(Ink, + [object[methodName], object].concat([].slice.call(arguments, 2))); + }, + + /** + * Function.prototype.bind alternative for event handlers. + * Same as bind but keeps first argument of the call the original event. + * Set "context" to `false` to preserve the original context of the function and just bind the arguments. + * + * @method bindEvent + * @param {Function} fn The function + * @param {Object} context The value to be passed as the this parameter to the target + * @param {Any} [args*] Additional arguments will be sent to the original function as prefix arguments + * @return {Function} + * @sample Ink_1_bindEvent.html + */ + bindEvent: function(fn, context) { + var args = Array.prototype.slice.call(arguments, 2); + return function(event) { + var finalArgs = args.slice(); + finalArgs.unshift(event || window.event); + return fn.apply(context === false ? this : context, finalArgs); + }; + }, + + /** + * Alias to document.getElementById + * + * @method i + * @param {String} id Element ID + * @return {DOMElement} + * @sample Ink_1_i.html + */ + i: function(id) { + if(!id) { + throw new Error('Ink.i => id or element must be passed'); + } + if(typeof(id) === 'string') { + return document.getElementById(id); + } + return id; + }, + + /** + * Alias for Ink.Dom.Selector + * + * @method ss + * @uses Ink.Dom.Selector.select + * @param {String} rule + * @param {DOMElement} [from] + * @return {Array} array of DOMElements + * @sample Ink_1_ss.html + */ + ss: function(rule, from) + { + if(typeof(Ink.Dom) === 'undefined' || typeof(Ink.Dom.Selector) === 'undefined') { + throw new Error('This method requires Ink.Dom.Selector'); + } + return Ink.Dom.Selector.select(rule, (from || document)); + }, + + /** + * Alias for Ink.Dom.Selector first result + * + * @method s + * @uses Ink.Dom.Selector.select + * @param {String} rule Selector string + * @param {DOMElement} [from] Context element. If set to a DOM element, the rule will only look for descendants of this DOM Element. + * @return {DOMElement} + * @sample Ink_1_s.html + */ + s: function(rule, from) + { + if(typeof(Ink.Dom) === 'undefined' || typeof(Ink.Dom.Selector) === 'undefined') { + throw new Error('This method requires Ink.Dom.Selector'); + } + return Ink.Dom.Selector.select(rule, (from || document))[0] || null; + }, + + /** + * Extends an object with another + * Copy all of the properties in one or more source objects over to the destination object, and return the destination object. It's in-order, so the last source will override properties of the same name in previous arguments. + * + * @method extendObj + * @param {Object} destination The object that will receive the new/updated properties + * @param {Object} source The object whose properties will be copied over to the destination object + * @param {Object} [args*] Additional source objects. The last source will override properties of the same name in the previous defined sources + * @return destination object, enriched with defaults from the sources + * @sample Ink_1_extendObj.html + */ + extendObj: function(destination/*, source... */) { + var sources = [].slice.call(arguments, 1); + + for (var i = 0, len = sources.length; i < len; i++) { + if (!sources[i]) { continue; } + for (var property in sources[i]) { + if(Object.prototype.hasOwnProperty.call(sources[i], property)) { + destination[property] = sources[i][property]; + } + } + } + + return destination; + }, + + /** + * Calls native console.log if available. + * + * @method log + * @param {Any} [args*] Arguments to be evaluated + * @sample Ink_1_log.html + **/ + log: function () { + // IE does not have console.log.apply in IE10 emulated mode + var console = window.console; + if (console && console.log) { + apply.call(console.log, console, arguments); + } + }, + + /** + * Calls native console.warn if available. + * + * @method warn + * @param {Any} [args*] Arguments to be evaluated + * @sample Ink_1_warn.html + **/ + warn: function () { + // IE does not have console.log.apply in IE10 emulated mode + var console = window.console; + if (console && console.warn) { + apply.call(console.warn, console, arguments); + } + }, + + /** + * Calls native console.error if available. + * + * @method error + * @param {Any} [args*] Arguments to be evaluated + * @sample Ink_1_error.html + **/ + error: function () { + // IE does not have console.log.apply in IE10 emulated mode + var console = window.console; + if (console && console.error) { + apply.call(console.error, console, arguments); + } + } + }; + + + // TODO for debug - to detect pending stuff + /* + var failCount = {}; // fail count per module name + var maxFails = 3; // times + var checkDelta = 0.5; //seconds + + var tmpTmr = setInterval(function() { + var mk = Object.keys(modulesRequested); + var l = mk.length; + + if (l > 0) { + // console.log('** waiting for modules: ' + mk.join(', ') + ' **'); + + for (var i = 0, f = mk.length, k, v; i < f; ++i) { + k = mk[i]; + v = failCount[k]; + failCount[k] = (v === undefined) ? 1 : ++v; + + if (v >= maxFails) { + console.error('** Loading of module ' + k + ' failed! **'); + delete modulesRequested[k]; + } + } + } + else { + // console.log('** Module loads complete. **'); + clearInterval(tmpTmr); + } + }, checkDelta*1000); + */ +}(window, document)); + +/** + * Cross Browser Ajax requests + * @module Ink.Net.Ajax_1 + * @version 1 + */ + +Ink.createModule('Ink.Net.Ajax', '1', [], function() { + + 'use strict'; + + /** + * Creates a new XMLHttpRequest object + * + * @class Ink.Net.Ajax + * @constructor + * + * @param {String} url Request URL + * @param {Object} options Request options + * @param {Boolean} [options.asynchronous]=true If false, the request synchronous. + * @param {Boolean} [options.cors] Flag to activate CORS. Set this to true if you're doing a cross-origin request + * @param {String} [options.method]='POST' HTTP request method. POST by default. + * @param {Object|String} [options.parameters] Request parameters to be sent with the request + * @param {Number} [options.timeout] Request timeout in seconds + * @param {Number} [options.delay] Artificial delay. If the request is completed faster than this delay, wait the remaining time before executing the callbacks + * @param {String} [options.postBody] POST request body. If not specified, it's filled with the contents from parameters + * @param {String} [options.contentType] Content-type header to be sent. Defaults to 'application/x-www-form-urlencoded' + * @param {Object} [options.requestHeaders] Key-value pairs for additional request headers + * @param {Function} [options.onComplete] Callback executed after the request is completed, regardless of what happened during the request. + * @param {Function} [options.onSuccess] Callback executed if the request is successful (requests with 2xx status codes) + * @param {Function} [options.onFailure] Callback executed if the request fails (requests with status codes different from 2xx) + * @param {Function} [options.onException] Callback executed if an exception occurs. Receives the exception as a parameter. + * @param {Function} [options.onCreate] Callback executed after object initialization but before the request is made + * @param {Function} [options.onInit] Callback executed before any initialization + * @param {Function} [options.onTimeout] Callback executed if the request times out + * @param {Boolean|String} [options.evalJS]=true If the request Content-type header is application/json, evaluates the response and populates responseJSON. Use 'force' if you want to force the response evaluation, no matter what Content-type it's using. + * @param {Boolean} [options.sanitizeJSON] Flag to sanitize the content of responseText before evaluation + * @param {String} [options.xhrProxy] URI for proxy service hosted on the same server as the web app, that can fetch documents from other domains. The service must pipe all input and output untouched (some input sanitization is allowed, like clearing cookies). e.g., requesting http://example.org/doc can become /proxy/http%3A%2F%2Fexample.org%2Fdoc The proxy service will be used for cross-domain requests, if set, else a network error is returned as exception. + * + * @sample Ink_Net_Ajax_1.html + */ + var Ajax = function(url, options){ + + // start of AjaxMock patch - uncomment to enable it + /*var AM = SAPO.Communication.AjaxMock; + if (AM && !options.inMock) { + if (AM.autoRecordThisUrl && AM.autoRecordThisUrl(url)) { + return new AM.Record(url, options); + } + if (AM.mockThisUrl && AM.mockThisUrl(url)) { + return new AM.Play(url, options, true); + } + }*/ + // end of AjaxMock patch + + this.init(url, options); + }; + + /** + * Options for all requests. These can then be overriden for individual ones. + */ + Ajax.globalOptions = { + parameters: {}, + requestHeaders: {} + }; + + + // IE10 does not need XDomainRequest + var xMLHttpRequestWithCredentials = 'XMLHttpRequest' in window && 'withCredentials' in (new XMLHttpRequest()); + + + + Ajax.prototype = { + + init: function(url, userOptions) { + if (!url) { + throw new Error("WRONG_ARGUMENTS_ERR"); + } + var options = Ink.extendObj({ + asynchronous: true, + method: 'POST', + parameters: null, + timeout: 0, + delay: 0, + postBody: '', + contentType: 'application/x-www-form-urlencoded', + requestHeaders: null, + onComplete: null, + onSuccess: null, + onFailure: null, + onException: null, + onHeaders: null, + onCreate: null, + onInit: null, + onTimeout: null, + sanitizeJSON: false, + evalJS: true, + xhrProxy: '', + cors: false, + debug: false, + useCredentials: false, + signRequest: false + }, Ajax.globalOptions); + + if (userOptions && typeof userOptions === 'object') { + options = Ink.extendObj(options, userOptions); + + + if (typeof userOptions.parameters === 'object') { + options.parameters = Ink.extendObj(Ink.extendObj({}, Ajax.globalOptions.parameters), userOptions.parameters); + } else if (userOptions.parameters !== null) { + var globalParameters = this.paramsObjToStr(Ajax.globalOptions.parameters); + if (globalParameters) { + options.parameters = userOptions.parameters + '&' + globalParameters; + } + } + + options.requestHeaders = Ink.extendObj({}, Ajax.globalOptions.requestHeaders); + options.requestHeaders = Ink.extendObj(options.requestHeaders, userOptions.requestHeaders); + } + + this.options = options; + + this.safeCall('onInit'); + + this.url = url; + + var urlLocation = this._locationFromURL(url); + this.isHTTP = this._locationIsHTTP(urlLocation); + this.isCrossDomain = this._locationIsCrossDomain(urlLocation, location); + + this.requestHasBody = options.method.search(/^get|head$/i) < 0; + + if(this.options.cors) { + this.isCrossDomain = false; + } + + this.transport = this.getTransport(); + + this.request(); + }, + + /** + * Returns a location object from an URL + * + * @method _locationFromUrl + * @param url + * @private + **/ + _locationFromURL: function (url) { + var urlLocation = document.createElementNS ? + document.createElementNS('http://www.w3.org/1999/xhtml', 'a') : + document.createElement('a'); + urlLocation.href = url; + return urlLocation; + }, + + /** + * Checks whether a location is HTTP or HTTPS + * + * @method locationIsHttp + * @param urlLocation + * @private + */ + _locationIsHTTP: function (urlLocation) { + return urlLocation.protocol.match(/^https?:/i) ? true : false; + }, + + /** + * Checks whether a location is cross-domain from another + * + * @method _locationIsCrossDomain + * @param urlLocation {Location} + * @param otherLocation {Location} + */ + _locationIsCrossDomain: function (urlLocation, location) { + location = location || window.location; + if (!Ajax.prototype._locationIsHTTP(urlLocation) || location.protocol === 'widget:' || typeof window.widget === 'object') { + return false; + } else { + return location.protocol !== urlLocation.protocol || + location.host.split(':')[0] !== urlLocation.host.split(':')[0]; + } + }, + + /** + * Creates the appropriate XMLHttpRequest object + * + * @method getTransport + * @return {Object} XMLHttpRequest object + */ + getTransport: function() + { + /*global XDomainRequest:false, ActiveXObject:false */ + if (!xMLHttpRequestWithCredentials && this.options.cors && 'XDomainRequest' in window) { + this.usingXDomainReq = true; + return new XDomainRequest(); + } + else if (typeof XMLHttpRequest !== 'undefined') { + return new XMLHttpRequest(); + } + else if (typeof ActiveXObject !== 'undefined') { + try { + return new ActiveXObject('Msxml2.XMLHTTP'); + } catch (e) { + return new ActiveXObject('Microsoft.XMLHTTP'); + } + } else { + return null; + } + }, + + /** + * Set the necessary headers for an ajax request + * + * @method setHeaders + * @param {String} url The url for the request + */ + setHeaders: function() + { + if (this.transport) { + try { + var headers = { + "Accept": "text/javascript,text/xml,application/xml,application/xhtml+xml,text/html,application/json;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1", + "Accept-Language": navigator.language, + "X-Requested-With": "XMLHttpRequest", + "X-Ink-Version": "2" + }; + if (this.options.cors) { + if (!this.options.signRequest) { + delete headers['X-Requested-With']; + } + delete headers['X-Ink-Version']; + } + + if (this.options.requestHeaders && typeof this.options.requestHeaders === 'object') { + for(var headerReqName in this.options.requestHeaders) { + if (this.options.requestHeaders.hasOwnProperty(headerReqName)) { + headers[headerReqName] = this.options.requestHeaders[headerReqName]; + } + } + } + + if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) { + headers.Connection = 'close'; + } + + for (var headerName in headers) { + if(headers.hasOwnProperty(headerName)) { + this.transport.setRequestHeader(headerName, headers[headerName]); + } + } + } catch(e) {} + } + }, + + /** + * Converts an object with parameters to a querystring + * + * @method paramsObjToStr + * @param {Object|String} optParams parameters object + * @return {String} querystring + */ + paramsObjToStr: function(optParams) { + var k, m, p, a, params = []; + if (typeof optParams === 'object') { + for (p in optParams){ + if (optParams.hasOwnProperty(p)) { + a = optParams[p]; + if (Object.prototype.toString.call(a) === '[object Array]' && !isNaN(a.length)) { + for (k = 0, m = a.length; k < m; k++) { + params = params.concat([ + encodeURIComponent(p), '[]', '=', + encodeURIComponent(a[k]), '&' + ]); + } + } + else { + params = params.concat([ + encodeURIComponent(p), '=', + encodeURIComponent(a), '&' + ]); + } + } + } + if (params.length > 0) { + params.pop(); + } + } + else + { + return optParams; + } + return params.join(''); + }, + + /** + * Set the url parameters for a GET request + * + * @method setParams + */ + setParams: function() + { + var params = null, optParams = this.options.parameters; + + if(typeof optParams === "object"){ + params = this.paramsObjToStr(optParams); + } else { + params = '' + optParams; + } + + if(params){ + if(this.url.indexOf('?') > -1) { + this.url = this.url.split('#')[0] + '&' + params; + } else { + this.url = this.url.split('#')[0] + '?' + params; + } + } + }, + + /** + * Gets an HTTP header from the response + * + * @method getHeader + * @param {String} name Header name + * @return {String} header Content + */ + getHeader: function(name) + { + if (this.usingXDomainReq && name === 'Content-Type') { + return this.transport.contentType; + } + try{ + return this.transport.getResponseHeader(name); + } catch(e) { + return null; + } + }, + + /** + * Gets all the HTTP headers from the response + * + * @method getAllHeaders + * @return {String} The headers, each separated by a newline + */ + getAllHeaders: function() + { + try { + return this.transport.getAllResponseHeaders(); + } catch(e) { + return null; + } + }, + + /** + * Sets the response object + * + * @method getResponse + * @return {Object} the response object + */ + getResponse: function(){ + // setup our own stuff + var t = this.transport, + r = { + headerJSON: null, + responseJSON: null, + getHeader: this.getHeader, + getAllHeaders: this.getAllHeaders, + request: this, + transport: t, + timeTaken: new Date() - this.startTime, + requestedUrl: this.url + }; + + // setup things expected from the native object + r.readyState = t.readyState; + try { r.responseText = t.responseText; } catch(e) {} + try { r.responseXML = t.responseXML; } catch(e) {} + try { r.status = t.status; } catch(e) { r.status = 0; } + try { r.statusText = t.statusText; } catch(e) { r.statusText = ''; } + + return r; + }, + + /** + * Aborts the request if still running. No callbacks are called + * + * @method abort + */ + abort: function(){ + if (this.transport) { + clearTimeout(this.delayTimeout); + clearTimeout(this.stoTimeout); + try { this.transport.abort(); } catch(ex) {} + this.finish(); + } + }, + + /** + * Executes the state changing phase of an ajax request + * + * @method runStateChange + */ + runStateChange: function() + { + var rs = this.transport.readyState; + if (rs === 3) { + if (this.isHTTP) { + this.safeCall('onHeaders'); + } + } else if (rs === 4 || this.usingXDomainReq) { + + if (this.options.asynchronous && this.options.delay && (this.startTime + this.options.delay > new Date().getTime())) { + this.delayTimeout = setTimeout(Ink.bind(this.runStateChange, this), this.options.delay + this.startTime - new Date().getTime()); + return; + } + + var responseJSON, + responseContent = this.transport.responseText, + response = this.getResponse(), + curStatus = this.transport.status; + + if (this.isHTTP && !this.options.asynchronous) { + this.safeCall('onHeaders'); + } + + clearTimeout(this.stoTimeout); + + if (curStatus === 0) { + // Status 0 indicates network error for http requests. + // For http less requests, 0 is always returned. + if (this.isHTTP) { + this.safeCall('onException', this.makeError(18, 'NETWORK_ERR')); + } else { + curStatus = responseContent ? 200 : 404; + } + } + else if (curStatus === 304) { + curStatus = 200; + } + var isSuccess = this.usingXDomainReq || 200 <= curStatus && curStatus < 300; + + var headerContentType = this.getHeader('Content-Type') || ''; + if (this.options.evalJS && + (headerContentType.indexOf("application/json") >= 0 || this.options.evalJS === 'force')){ + try { + responseJSON = this.evalJSON(responseContent, this.sanitizeJSON); + if(responseJSON){ + responseContent = response.responseJSON = responseJSON; + } + } catch(e){ + if (isSuccess) { + // If the request failed, then this is perhaps an error page + // so don't notify error. + this.safeCall('onException', e); + } + } + } + + if (this.usingXDomainReq && headerContentType.indexOf('xml') !== -1 && 'DOMParser' in window) { + // http://msdn.microsoft.com/en-us/library/ie/ff975278(v=vs.85).aspx + var mimeType; + switch (headerContentType) { + case 'application/xml': + case 'application/xhtml+xml': + case 'image/svg+xml': + mimeType = headerContentType; + break; + default: + mimeType = 'text/xml'; + } + var xmlDoc = (new DOMParser()).parseFromString( this.transport.responseText, mimeType); + this.transport.responseXML = xmlDoc; + response.responseXML = xmlDoc; + } + + if (this.transport.responseXML !== null && response.responseJSON === null && this.transport.responseXML.xml !== ""){ + responseContent = this.transport.responseXML; + } + + if (curStatus || this.usingXDomainReq) { + if (isSuccess) { + this.safeCall('onSuccess', response, responseContent); + } else { + this.safeCall('onFailure', response, responseContent); + } + this.safeCall('on'+curStatus, response, responseContent); + } + this.finish(response, responseContent); + } + }, + + /** + * Last step after XHR is complete. Call onComplete and cleanup object + * + * @method finish + * @param {Any} response + * @param {Any} responseContent + */ + finish: function(response, responseContent){ + if (response) { + this.safeCall('onComplete', response, responseContent); + } + clearTimeout(this.stoTimeout); + + if (this.transport) { + // IE6 sometimes barfs on this one + try{ this.transport.onreadystatechange = null; } catch(e){} + + if (typeof this.transport.destroy === 'function') { + // Stuff for Samsung. + this.transport.destroy(); + } + + // Let XHR be collected. + this.transport = null; + } + }, + + /** + * Safely calls a callback function. + * Verifies that the callback is well defined and traps errors + * + * @method safeCall + * @param {Function} listener + */ + safeCall: function(listener, first/*, second*/) { + function rethrow(exception){ + setTimeout(function() { + // Rethrow exception so it'll land in + // the error console, firebug, whatever. + if (exception.message) { + exception.message += '\n'+(exception.stacktrace || exception.stack || ''); + } + throw exception; + }, 1); + } + if (typeof this.options[listener] === 'function') { + //SAPO.safeCall(this, this.options[listener], first, second); + //return object[listener].apply(object, [].slice.call(arguments, 2)); + try { + this.options[listener].apply(this, [].slice.call(arguments, 1)); + } catch(ex) { + rethrow(ex); + } + } else if (first && window.Error && (first instanceof Error)) { + rethrow(first); + } + }, + + /** + * Sets a new request header for the next http request + * + * @method setRequestHeader + * @param {String} name + * @param {String} value + */ + setRequestHeader: function(name, value){ + if (!this.options.requestHeaders) { + this.options.requestHeaders = {}; + } + this.options.requestHeaders[name] = value; + }, + + /** + * Executes the request + * + * @method request + */ + request: function() + { + if(this.transport) { + var params = null; + if(this.requestHasBody) { + if(this.options.postBody !== null && this.options.postBody !== '') { + params = this.options.postBody; + this.setParams(); + } else if (this.options.parameters !== null && this.options.parameters !== ''){ + params = this.options.parameters; + } + + if (typeof params === "object" && !params.nodeType) { + params = this.paramsObjToStr(params); + } else if (typeof params !== "object" && params !== null){ + params = '' + params; + } + + if(this.options.contentType) { + this.setRequestHeader('Content-Type', this.options.contentType); + } + } else { + this.setParams(); + } + + var url = this.url; + var method = this.options.method; + var crossDomain = this.isCrossDomain; + + if (crossDomain && this.options.xhrProxy) { + this.setRequestHeader('X-Url', url); + url = this.options.xhrProxy + encodeURIComponent(url); + crossDomain = false; + } + + try { + this.transport.open(method, url, this.options.asynchronous); + } catch(e) { + this.safeCall('onException', e); + return this.finish(this.getResponse(), null); + } + + this.setHeaders(); + + this.safeCall('onCreate'); + + if(this.options.timeout && !isNaN(this.options.timeout)) { + this.stoTimeout = setTimeout(Ink.bind(function() { + if(this.options.onTimeout) { + this.safeCall('onTimeout'); + this.abort(); + } + }, this), (this.options.timeout * 1000)); + } + + if(this.options.useCredentials && !this.usingXDomainReq) { + this.transport.withCredentials = true; + } + + if(this.options.asynchronous && !this.usingXDomainReq) { + this.transport.onreadystatechange = Ink.bind(this.runStateChange, this); + } + else if (this.usingXDomainReq) { + this.transport.onload = Ink.bind(this.runStateChange, this); + } + + try { + if (crossDomain) { + // Need explicit handling because Mozila aborts + // the script and Chrome fails silently.per the spec + throw this.makeError(18, 'NETWORK_ERR'); + } else { + this.startTime = new Date().getTime(); + this.transport.send(params); + } + } catch(e) { + this.safeCall('onException', e); + return this.finish(this.getResponse(), null); + } + + if(!this.options.asynchronous) { + this.runStateChange(); + } + } + }, + + /** + * Returns a new exception object that can be thrown + * + * @method makeError + * @param code Error Code + * @param message Message + * @returns {Object} + */ + makeError: function(code, message){ + if (typeof Error !== 'function') { + return {code: code, message: message}; + } + var e = new Error(message); + e.code = code; + return e; + }, + + /** + * Checks if a given string is valid JSON + * + * @method isJSON + * @param {String} str String to be evaluated + * @return {Boolean} True if the string is valid JSON + */ + isJSON: function(str) + { + if (typeof str !== "string" || !str){ return false; } + str = str.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); + return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); + }, + + /** + * Evaluates a given string as JSON + * + * @method evalJSON + * @param {String} str String to be evaluated + * @param {Boolean} sanitize Flag to sanitize the content + * @return {Object} JSON content as an object + */ + evalJSON: function(strJSON, sanitize) + { + if (strJSON && (!sanitize || this.isJSON(strJSON))) { + try { + if (typeof JSON !== "undefined" && typeof JSON.parse !== 'undefined'){ + return JSON.parse(strJSON); + } + /*jshint evil:true */ + return eval('(' + strJSON + ')'); + } catch(e) { + throw new Error('ERROR: Bad JSON string...'); + } + } + return null; + } + }; + + /** + * Loads content from a given url through an XMLHttpRequest. + * + * Shortcut function for simple AJAX use cases. Works with JSON, XML and plain text. + * + * @method load + * @param {String} url Request URL + * @param {Function} callback Callback to be executed if the request is successful + * @return {Object} XMLHttpRequest object + * + * @sample Ink_Net_Ajax_load.html + */ + Ajax.load = function(url, callback){ + return new Ajax(url, { + method: 'GET', + onSuccess: function(response){ + callback(response.responseJSON || response.responseText, response); + } + }); + }; + + /** + * Loads content from a given url through an XMLHttpRequest. + * Shortcut function for simple AJAX use cases. + * + * @method ping + * @param {String} url Request url + * @param {Function} callback Callback to be executed if the request is successful + * @return {Object} XMLHttpRequest object + */ + Ajax.ping = function(url, callback){ + return new Ajax(url, { + method: 'HEAD', + onSuccess: function(response){ + if (typeof callback === 'function'){ + callback(response); + } + } + }); + }; + + + return Ajax; +}); + +/** + * Cross Browser JsonP requests + * @module Ink.Net.JsonP_1 + * @version 1 + */ + +Ink.createModule('Ink.Net.JsonP', '1', [], function() { + + 'use strict'; + + /** + * Executes a JSONP request + * + * @class Ink.Net.JsonP + * @constructor + * + * @param {String} uri Request URL + * @param {Object} options Request options + * @param {Function} options.onSuccess Success callback + * @param {Function} [options.onFailure] Failure callback + * @param {Object} [options.failureObj] Object to be passed as argument to failure callback + * @param {Number} [options.timeout] Timeout for request fail, in seconds. defaults to 10 + * @param {Object} [options.params] Object with the parameters and respective values to unfold + * @param {String} [options.callbackParam] Parameter to use as callback. defaults to 'jsoncallback' + * @param {String} [options.internalCallback] Name of the callback function stored in the Ink.Net.JsonP object. + * @param {String} [options.randVar] (Advanced, not recommended unless you know what you're doing) A string to append to the callback name. By default, generate a random number. Use an empty string if you already passed the correct name in the internalCallback option. + * + * @sample Ink_Net_JsonP_1.html + */ + var JsonP = function(uri, options) { + this.init(uri, options); + }; + + JsonP.prototype = { + + init: function(uri, options) { + this.options = Ink.extendObj( { + onSuccess: undefined, + onFailure: undefined, + failureObj: {}, + timeout: 10, + params: {}, + callbackParam: 'jsoncallback', + internalCallback: '_cb', + randVar: false + }, options || {}); + + if(this.options.randVar !== false) { + this.randVar = this.options.randVar; + } else { + this.randVar = parseInt(Math.random() * 100000, 10); + } + + this.options.internalCallback += this.randVar; + + this.uri = uri; + + // prevent SAPO legacy onComplete - make it onSuccess + if(typeof(this.options.onComplete) === 'function') { + this.options.onSuccess = this.options.onComplete; + } + + if (typeof this.uri !== 'string') { + throw 'Please define an URI'; + } + + if (typeof this.options.onSuccess !== 'function') { + throw 'please define a callback function on option onSuccess!'; + } + + Ink.Net.JsonP[this.options.internalCallback] = Ink.bind(function() { + window.clearTimeout(this.timeout); + delete window.Ink.Net.JsonP[this.options.internalCallback]; + this._removeScriptTag(); + this.options.onSuccess(arguments[0]); + }, this); + + this._addScriptTag(); + }, + + _addParamsToGet: function(uri, params) { + var hasQuestionMark = uri.indexOf('?') !== -1; + var sep, pKey, pValue, parts = [uri]; + + for (pKey in params) { + if (params.hasOwnProperty(pKey)) { + if (!hasQuestionMark) { sep = '?'; hasQuestionMark = true; } + else { sep = '&'; } + pValue = params[pKey]; + if (typeof pValue !== 'number' && !pValue) { pValue = ''; } + parts = parts.concat([sep, pKey, '=', encodeURIComponent(pValue)]); + } + } + + return parts.join(''); + }, + + _getScriptContainer: function() { + var headEls = document.getElementsByTagName('head'); + if (headEls.length === 0) { + var scriptEls = document.getElementsByTagName('script'); + return scriptEls[0]; + } + return headEls[0]; + }, + + _addScriptTag: function() { + // enrich options will callback and random seed + this.options.params[this.options.callbackParam] = 'Ink.Net.JsonP.' + this.options.internalCallback; + this.options.params.rnd_seed = this.randVar; + this.uri = this._addParamsToGet(this.uri, this.options.params); + // create script tag + var scriptEl = document.createElement('script'); + scriptEl.type = 'text/javascript'; + scriptEl.src = this.uri; + var scriptCtn = this._getScriptContainer(); + scriptCtn.appendChild(scriptEl); + this.timeout = setTimeout(Ink.bind(this._requestFailed, this), (this.options.timeout * 1000)); + }, + + _requestFailed : function () { + delete Ink.Net.JsonP[this.options.internalCallback]; + this._removeScriptTag(); + if(typeof this.options.onFailure === 'function'){ + this.options.onFailure(this.options.failureObj); + } + }, + + _removeScriptTag: function() { + var scriptEl; + var scriptEls = document.getElementsByTagName('script'); + var scriptUri; + for (var i = 0, f = scriptEls.length; i < f; ++i) { + scriptEl = scriptEls[i]; + scriptUri = scriptEl.getAttribute('src') || scriptEl.src; + if (scriptUri !== null && scriptUri === this.uri) { + scriptEl.parentNode.removeChild(scriptEl); + return; + } + } + } + + }; + + return JsonP; + +}); + +/** + * Browser Detection and User Agent sniffing + * @module Ink.Dom.Browser_1 + * @version 1 + */ +Ink.createModule('Ink.Dom.Browser', '1', [], function() { + 'use strict'; + + /** + * @namespace Ink.Dom.Browser + * @version 1 + * @static + * @example + * + */ + var Browser = { + /** + * True if the browser is Internet Explorer + * + * @property IE + * @type {Boolean} + * @public + * @static + */ + IE: false, + + /** + * True if the browser is Gecko based + * + * @property GECKO + * @type {Boolean} + * @public + * @static + */ + GECKO: false, + + /** + * True if the browser is Opera + * + * @property OPERA + * @type {Boolean} + * @public + * @static + */ + OPERA: false, + + /** + * True if the browser is Safari + * + * @property SAFARI + * @type {Boolean} + * @public + * @static + */ + SAFARI: false, + + /** + * True if the browser is Konqueror + * + * @property KONQUEROR + * @type {Boolean} + * @public + * @static + */ + KONQUEROR: false, + + /** + * True if browser is Chrome + * + * @property CHROME + * @type {Boolean} + * @public + * @static + */ + CHROME: false, + + /** + * The specific browser model. + * False if it is unavailable. + * + * @property model + * @type {Boolean|String} + * @public + * @static + */ + model: false, + + /** + * The browser version. + * False if it is unavailable. + * + * @property version + * @type {Boolean|String} + * @public + * @static + */ + version: false, + + /** + * The user agent string. + * False if it is unavailable. + * + * @property userAgent + * @type {Boolean|String} + * @public + * @static + */ + userAgent: false, + + /** + * The CSS prefix (-moz-, -webkit-, -ms-, ...) + * False if it is unavailable + * + * @property cssPrefix + * @type {Boolean|String} + * @public + * @static + */ + cssPrefix: false, + + /** + * The DOM prefix (Moz, Webkit, ms, ...) + * False if it is unavailable + * @property domPrefix + * @type {Boolean|String} + * @public + * @static + */ + domPrefix: false, + + /** + * Initialization function for the Browser object. + * + * Is called automatically when this module is loaded, and calls setDimensions, setBrowser and setReferrer. + * + * @method init + * @public + */ + init: function() { + this.detectBrowser(); + this.setDimensions(); + this.setReferrer(); + }, + + /** + * Retrieves and stores window dimensions in this object. Called automatically when this module is loaded. + * + * @method setDimensions + * @public + */ + setDimensions: function() { + //this.windowWidth=window.innerWidth !== null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body !== null ? document.body.clientWidth : null; + //this.windowHeight=window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null; + var myWidth = 0, myHeight = 0; + if ( typeof window.innerWidth=== 'number' ) { + myWidth = window.innerWidth; + myHeight = window.innerHeight; + } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { + myWidth = document.documentElement.clientWidth; + myHeight = document.documentElement.clientHeight; + } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { + myWidth = document.body.clientWidth; + myHeight = document.body.clientHeight; + } + this.windowWidth = myWidth; + this.windowHeight = myHeight; + }, + + /** + * Stores the referrer. Called automatically when this module is loaded. + * + * @method setReferrer + * @public + */ + setReferrer: function() { + if (document.referrer && document.referrer.length) { + this.referrer = window.escape(document.referrer); + } else { + this.referrer = false; + } + }, + + /** + * Detects the browser and stores the found properties. Called automatically when this module is loaded. + * + * @method detectBrowser + * @public + */ + detectBrowser: function() { + this._sniffUserAgent(navigator.userAgent); + }, + + _sniffUserAgent: function (sAgent) { + this.userAgent = sAgent; + + sAgent = sAgent.toLowerCase(); + + if (/applewebkit\//.test(sAgent)) { + this.cssPrefix = '-webkit-'; + this.domPrefix = 'Webkit'; + if(/(chrome|crios)\//.test(sAgent)) { + // Chrome + this.CHROME = true; + this.model = 'chrome'; + this.version = sAgent.replace(/(.*)chrome\/([^\s]+)(.*)/, "$2"); + } else { + // Safari + this.SAFARI = true; + this.model = 'safari'; + var rVersion = /version\/([^) ]+)/; + if (rVersion.test(sAgent)) { + this.version = sAgent.match(rVersion)[1]; + } else { + this.version = sAgent.replace(/(.*)applewebkit\/([^\s]+)(.*)/, "$2"); + } + } + } else if (/opera/.test(sAgent)) { + // Opera + this.OPERA = true; + this.model = 'opera'; + this.version = sAgent.replace(/(.*)opera.([^\s$]+)(.*)/, "$2"); + this.cssPrefix = '-o-'; + this.domPrefix = 'O'; + } else if (/konqueror/.test(sAgent)) { + // Konqueroh + this.KONQUEROR = true; + this.model = 'konqueror'; + this.version = sAgent.replace(/(.*)konqueror\/([^;]+);(.*)/, "$2"); + this.cssPrefix = '-khtml-'; + this.domPrefix = 'Khtml'; + } else if (/(msie|trident)/i.test(sAgent)) { + // MSIE + this.IE = true; + this.model = 'ie'; + if (/rv:((?:\d|\.)+)/.test(sAgent)) { // IE 11 + this.version = sAgent.match(/rv:((?:\d|\.)+)/)[1]; + } else { + this.version = sAgent.replace(/(.*)\smsie\s([^;]+);(.*)/, "$2"); + } + this.cssPrefix = '-ms-'; + this.domPrefix = 'ms'; + } else if (/gecko/.test(sAgent)) { + // GECKO + // Supports only: + // Camino, Chimera, Epiphany, Minefield (firefox 3), Firefox, Firebird, Phoenix, Galeon, + // Iceweasel, K-Meleon, SeaMonkey, Netscape, Songbird, Sylera, + this.cssPrefix = '-moz-'; + this.domPrefix = 'Moz'; + + this.GECKO = true; + + var re = /(camino|chimera|epiphany|minefield|firefox|firebird|phoenix|galeon|iceweasel|k\-meleon|seamonkey|netscape|songbird|sylera)/; + if(re.test(sAgent)) { + this.model = sAgent.match(re)[1]; + this.version = sAgent.replace(new RegExp("(.*)"+this.model+"\/([^;\\s$]+)(.*)"), "$2"); + } else { + // probably is mozilla + this.model = 'mozilla'; + var reVersion = /(.*)rv:([^)]+)(.*)/; + if(reVersion.test(sAgent)) { + this.version = sAgent.replace(reVersion, "$2"); + } + } + } + }, + + /** + * Debug function which displays browser (and Ink.Dom.Browser) information as an alert message. + * + * @method debug + * @public + * @sample Ink_Dom_Browser_1_debug.html + */ + debug: function() { + /*global alert:false */ + var str = "known browsers: (ie, gecko, opera, safari, konqueror) \n"; + str += [this.IE, this.GECKO, this.OPERA, this.SAFARI, this.KONQUEROR] +"\n"; + str += "cssPrefix -> "+this.cssPrefix+"\n"; + str += "domPrefix -> "+this.domPrefix+"\n"; + str += "model -> "+this.model+"\n"; + str += "version -> "+this.version+"\n"; + str += "\n"; + str += "original UA -> "+this.userAgent; + + alert(str); + } + }; + + Browser.init(); + + return Browser; +}); + +/** + * CSS Utilities and toolbox + * @module Ink.Dom.Css_1 + * @version 1 + */ + +Ink.createModule( 'Ink.Dom.Css', 1, [], function() { + + 'use strict'; + + // getComputedStyle feature detection. + var getCs = ("defaultView" in document) && ("getComputedStyle" in document.defaultView) ? document.defaultView.getComputedStyle : window.getComputedStyle; + + /** + * @namespace Ink.Dom.Css + * @static + */ + + var Css = { + /** + * Adds of removes a class. + * Depending on addRemState, this method either adds a class if it's true or removes if if false. + * + * @method addRemoveClassName + * @param {DOMElement|string} elm DOM element or element id + * @param {string} className class name to add or remove. + * @param {boolean} addRemState Whether to add or remove. `true` to add, `false` to remove. + * @sample Ink_Dom_Css_addRemoveClassName.html + */ + addRemoveClassName: function(elm, className, addRemState) { + if (addRemState) { + return this.addClassName(elm, className); + } + this.removeClassName(elm, className); + }, + + /** + * Adds a class to a given element + * + * @method addClassName + * @param {DOMElement|String} elm DOM element or element id + * @param {String|Array} className Classes + * @sample Ink_Dom_Css_addClassName.html + */ + addClassName: function(elm, className) { + elm = Ink.i(elm); + if (!elm || !className) { return null; } + className = ('' + className).split(/[, ]+/); + var i = 0; + var len = className.length; + + for (; i < len; i++) { + // remove whitespace and ignore on empty string + if (className[i].replace(/^\s+|\s+$/g, '')) { + if (typeof elm.classList !== "undefined") { + elm.classList.add(className[i]); + } else if (!Css.hasClassName(elm, className[i])) { + elm.className += (elm.className ? ' ' : '') + className[i]; + } + } + } + }, + + /** + * Removes a class from a given element + * + * @method removeClassName + * @param {DOMElement|String} elm DOM element or element id + * @param {String|Array} className Class names to remove. You can either use a space separated string of classnames, comma-separated list or an array + * @sample Ink_Dom_Css_removeClassName.html + */ + removeClassName: function(elm, className) { + elm = Ink.i(elm); + if (!elm || !className) { return null; } + + className = ('' + className).split(/[, ]+/); + var i = 0; + var len = className.length; + + if (typeof elm.classList !== "undefined"){ + for (; i < len; i++) { + elm.classList.remove(className[i]); + } + } else { + var elmClassName = elm.className || ''; + var re; + for (; i < len; i++) { + re = new RegExp("(^|\\s+)" + className[i] + "(\\s+|$)"); + elmClassName = elmClassName.replace(re, ' '); + } + elm.className = (elmClassName + .replace(/^\s+/, '') + .replace(/\s+$/, '')); + } + }, + + /** + * Alias to addRemoveClassName. + * Utility function, saves many if/elses. + * + * @method setClassName + * @uses addRemoveClassName + * @param {DOMElement|String} elm DOM element or element id + * @param {String|Array} className Class names to add\remove. Comma separated, space separated or simply an Array + * @param {Boolean} [add]=false Flag to switch behavior from removal to addition. true to add, false to remove + */ + setClassName: function(elm, className, add) { + this.addRemoveClassName(elm, className, add || false); + }, + + /** + * Checks if an element has a class. + * This method verifies if an element has ONE of a list of classes. If the last argument is flagged as true, instead checks if the element has ALL the classes + * + * @method hasClassName + * @param {DOMElement|String} elm DOM element or element id + * @param {String|Array} className Class names to test + * @param {Boolean} [all]=false If flagged as true, it will check if the element contains ALL the CSS classes + * @return {Boolean} true if a given class is applied to a given element + * @sample Ink_Dom_Css_hasClassName.html + */ + hasClassName: function(elm, className, all) { + elm = Ink.i(elm); + if (!elm || !className) { return false; } + + className = ('' + className).split(/[, ]+/); + var i = 0; + var len = className.length; + var has; + var re; + + for ( ; i < len; i++) { + if (typeof elm.classList !== "undefined"){ + has = elm.classList.contains(className[i]); + } else { + var elmClassName = elm.className; + if (elmClassName === className[i]) { + has = true; + } else { + re = new RegExp("(^|\\s)" + className[i] + "(\\s|$)"); + has = re.test(elmClassName); + } + } + if (has && !all) { return true; } // return if looking for any class + if (!has && all) { return false; } // return if looking for all classes + } + + if (all) { + // if we got here, all classes were found so far + return true; + } else { + // if we got here with all == false, no class was found + return false; + } + }, + + /** + * Blinks a class from an element + * Add and removes the class from the element with a timeout, so it blinks + * + * @method blinkClass + * @uses addRemoveClassName + * @param {DOMElement|String} elm DOM element or element id + * @param {String|Array} className Class name(s) to blink + * @param {Number} timeout timeout in ms between adding and removing, default 100 ms + * @param {Boolean} negate is true, class is removed then added + * @sample Ink_Dom_Css_blinkClass.html + */ + blinkClass: function(element, className, timeout, negate){ + element = Ink.i(element); + Css.addRemoveClassName(element, className, !negate); + setTimeout(function() { + Css.addRemoveClassName(element, className, negate); + }, Number(timeout) || 100); + }, + + /** + * Toggles a class name from a given element + * + * @method toggleClassName + * @param {DOMElement|String} elm DOM element or element id + * @param {String} className Class name + * @param {Boolean} [forceAdd] Flag to force adding the the classe names if they don't exist yet. + * @sample Ink_Dom_Css_toggleClassName.html + */ + toggleClassName: function(elm, className, forceAdd) { + if (elm && className){ + if (typeof elm.classList !== "undefined" && !/[, ]/.test(className)){ + elm = Ink.i(elm); + if (elm !== null){ + elm.classList.toggle(className); + } + return true; + } + } + + if (typeof forceAdd !== 'undefined') { + if (forceAdd === true) { + Css.addClassName(elm, className); + } + else if (forceAdd === false) { + Css.removeClassName(elm, className); + } + } else { + if (Css.hasClassName(elm, className)) { + Css.removeClassName(elm, className); + } else { + Css.addClassName(elm, className); + } + } + }, + + /** + * Sets the opacity of given element + * + * @method setOpacity + * @param {DOMElement|String} elm DOM element or element id + * @param {Number} value allows 0 to 1(default mode decimal) or percentage (warning using 0 or 1 will reset to default mode) + * @sample Ink_Dom_Css_setOpacity.html + */ + setOpacity: function(elm, value) { + elm = Ink.i(elm); + if (elm !== null){ + var val = 1; + + if (!isNaN(Number(value))){ + if (value <= 0) { val = 0; } + else if (value <= 1) { val = value; } + else if (value <= 100) { val = value / 100; } + else { val = 1; } + } + + if (typeof elm.style.opacity !== 'undefined') { + elm.style.opacity = val; + } + else { + elm.style.filter = "alpha(opacity:"+(val*100|0)+")"; + } + } + }, + + /** + * Converts a css property name to a string in camelcase to be used with CSSStyleDeclaration. + * @method _camelCase + * @private + * @param {String} str String to convert + * @return {String} Converted string + */ + _camelCase: function(str) { + return str ? str.replace(/-(\w)/g, function (_, $1) { + return $1.toUpperCase(); + }) : str; + }, + + + /** + * Gets the value for an element's style attribute + * + * @method getStyle + * @param {DOMElement|String} elm DOM element or element id + * @param {String} style Which css attribute to fetch + * @return Style value + * @sample Ink_Dom_Css_getStyle.html + */ + getStyle: function(elm, style) { + elm = Ink.i(elm); + if (elm !== null && elm.style) { + style = style === 'float' ? 'cssFloat': this._camelCase(style); + + var value = elm.style[style]; + + if (getCs && (!value || value === 'auto')) { + var css = getCs(elm, null); + value = css ? css[style] : null; + } + else if (!value && elm.currentStyle) { + value = elm.currentStyle[style]; + if (value === 'auto' && (style === 'width' || style === 'height')) { + value = elm["offset" + style.charAt(0).toUpperCase() + style.slice(1)] + "px"; + } + } + + if (style === 'opacity') { + return value ? parseFloat(value, 10) : 1.0; + } + else if (style === 'borderTopWidth' || style === 'borderBottomWidth' || + style === 'borderRightWidth' || style === 'borderLeftWidth' ) { + if (value === 'thin') { return '1px'; } + else if (value === 'medium') { return '3px'; } + else if (value === 'thick') { return '5px'; } + } + + return value === 'auto' ? null : value; + } + }, + + + /** + * Adds CSS rules to an element's style attribute. + * + * @method setStyle + * @param {DOMElement|String} elm DOM element or element id + * @param {String} style Which css attribute to set + * @sample Ink_Dom_Css_setStyle.html + */ + setStyle: function(elm, style) { + elm = Ink.i(elm); + if (elm === null) { return; } + if (typeof style === 'string') { + elm.style.cssText += '; '+style; + + if (style.indexOf('opacity') !== -1) { + this.setOpacity(elm, style.match(/opacity:\s*(\d?\.?\d*)/)[1]); + } + } + else { + for (var prop in style) { + if (style.hasOwnProperty(prop)){ + if (prop === 'opacity') { + this.setOpacity(elm, style[prop]); + } + else if (prop === 'float' || prop === 'cssFloat') { + if (typeof elm.style.styleFloat === 'undefined') { + elm.style.cssFloat = style[prop]; + } + else { + elm.style.styleFloat = style[prop]; + } + } else { + elm.style[prop] = style[prop]; + } + } + } + } + }, + + + /** + * Shows an element. + * Internally it unsets the display property of an element. You can force a specific display property using forceDisplayProperty + * + * @method show + * @param {DOMElement|String} elm DOM element or element id + * @param {String} [forceDisplayProperty] Css display property to apply on show + * @sample Ink_Dom_Css_show.html + */ + show: function(elm, forceDisplayProperty) { + elm = Ink.i(elm); + if (elm !== null) { + elm.style.display = (forceDisplayProperty) ? forceDisplayProperty : ''; + } + }, + + /** + * Hides an element. + * + * @method hide + * @param {DOMElement|String} elm DOM element or element id + * @sample Ink_Dom_Css_hide.html + */ + hide: function(elm) { + elm = Ink.i(elm); + if (elm !== null) { + elm.style.display = 'none'; + } + }, + + /** + * Shows or hides an element. + * If the show parameter is true, it shows the element. Otherwise, hides it. + * + * @method showHide + * @param {DOMElement|String} elm DOM element or element id + * @param {boolean} [show]=false Whether to show or hide `elm`. + * @sample Ink_Dom_Css_showHide.html + */ + showHide: function(elm, show) { + elm = Ink.i(elm); + if (elm) { + elm.style.display = show ? '' : 'none'; + } + }, + + /** + * Toggles an element visibility. + * + * @method toggle + * @param {DOMElement|String} elm DOM element or element id + * @param {Boolean} forceShow Forces showing if element is hidden + * @sample Ink_Dom_Css_toggle.html + */ + toggle: function(elm, forceShow) { + elm = Ink.i(elm); + if (elm !== null) { + if (typeof forceShow !== 'undefined') { + if (forceShow === true) { + this.show(elm); + } else { + this.hide(elm); + } + } else { + if (this.getStyle(elm,'display').toLowerCase() === 'none') { + this.show(elm); + } + else { + this.hide(elm); + } + } + } + }, + + _getRefTag: function(head){ + if (head.firstElementChild) { + return head.firstElementChild; + } + + for (var child = head.firstChild; child; child = child.nextSibling){ + if (child.nodeType === 1){ + return child; + } + } + return null; + }, + + /** + * Injects style tags with rules to the page. + * + * @method appendStyleTag + * @param {String} selector The css selector for the rule + * @param {String} style The content of the style rule + * @param {Object} options Options for the tag + * @param {String} [options.type]='text/css' File type + * @param {Boolean} [options.force]=false If true, the style tag will be appended to end of head + * + * @sample Ink_Dom_Css_appendStyleTag.html + */ + appendStyleTag: function(selector, style, options){ + options = Ink.extendObj({ + type: 'text/css', + force: false + }, options || {}); + + var styles = document.getElementsByTagName("style"), + oldStyle = false, setStyle = true, i, l; + + for (i=0, l=styles.length; i= 0) { + setStyle = false; + } + } + + if (setStyle) { + var defStyle = document.createElement("style"), + head = document.getElementsByTagName("head")[0], + refTag = false, styleStr = ''; + + defStyle.type = options.type; + + styleStr += selector +" {"; + styleStr += style; + styleStr += "} "; + + if (typeof defStyle.styleSheet !== "undefined") { + defStyle.styleSheet.cssText = styleStr; + } else { + defStyle.appendChild(document.createTextNode(styleStr)); + } + + if (options.force){ + head.appendChild(defStyle); + } else { + refTag = this._getRefTag(head); + if (refTag){ + head.insertBefore(defStyle, refTag); + } + } + } + }, + + /** + * Injects an external link tag. + * This method add a stylesheet to the head of a page + * + * @method appendStylesheet + * @param {String} path File path + * @param {Object} options Options for the tag + * @param {String} [options.media]='screen' Media type + * @param {String} [options.type]='text/css' File type + * @param {Boolean} [options.force]=false If true, tag will be appended to end of head + * @sample Ink_Dom_Css_appendStylesheet.html + */ + appendStylesheet: function(path, options){ + options = Ink.extendObj({ + media: 'screen', + type: 'text/css', + force: false + }, options || {}); + + var refTag, + style = document.createElement("link"), + head = document.getElementsByTagName("head")[0]; + + style.media = options.media; + style.type = options.type; + style.href = path; + style.rel = "Stylesheet"; + + if (options.force){ + head.appendChild(style); + } + else { + refTag = this._getRefTag(head); + if (refTag){ + head.insertBefore(style, refTag); + } + } + }, + + /** + * Injects an external link tag. + * Loads CSS via LINK element inclusion in HEAD (skips append if already there) + * + * Works similarly to appendStylesheet but: + * supports optional callback which gets invoked once the CSS has been applied + * + * @method appendStylesheetCb + * @param {String} cssURI URI of the CSS to load, if empty ignores and just calls back directly + * @param {Function(cssURI)} [callback] optional callback which will be called once the CSS is loaded + * @sample Ink_Dom_Css_appendStylesheetCb.html + */ + _loadingCSSFiles: {}, + _loadedCSSFiles: {}, + appendStylesheetCb: function(url, callback) { + if (!url) { + return callback(url); + } + + if (this._loadedCSSFiles[url]) { + return callback(url); + } + + var cbs = this._loadingCSSFiles[url]; + if (cbs) { + return cbs.push(callback); + } + + this._loadingCSSFiles[url] = [callback]; + + var linkEl = document.createElement('link'); + linkEl.type = 'text/css'; + linkEl.rel = 'stylesheet'; + linkEl.href = url; + + var headEl = document.getElementsByTagName('head')[0]; + headEl.appendChild(linkEl); + + var imgEl = document.createElement('img'); + /* + var _self = this; + (function(_url) { + imgEl.onerror = function() { + //var url = this; + var url = _url; + _self._loadedCSSFiles[url] = true; + var callbacks = _self._loadingCSSFiles[url]; + for (var i = 0, f = callbacks.length; i < f; ++i) { + callbacks[i](url); + } + delete _self._loadingCSSFiles[url]; + }; + })(url); + */ + imgEl.onerror = Ink.bindEvent(function(event, _url) { + //var url = this; + var url = _url; + this._loadedCSSFiles[url] = true; + var callbacks = this._loadingCSSFiles[url]; + for (var i = 0, f = callbacks.length; i < f; ++i) { + callbacks[i](url); + } + delete this._loadingCSSFiles[url]; + }, this, url); + imgEl.src = url; + }, + + /** + * Converts decimal to hexadecimal values + * Useful to convert colors to their hexadecimal representation. + * + * @method decToHex + * @param {String} dec Either a single decimal value, an rgb(r, g, b) string or an Object with r, g and b properties + * @return {String} Hexadecimal value + * @sample Ink_Dom_Css_decToHex.html + */ + decToHex: function(dec) { + var normalizeTo2 = function(val) { + if (val.length === 1) { + val = '0' + val; + } + val = val.toUpperCase(); + return val; + }; + + if (typeof dec === 'object') { + var rDec = normalizeTo2(parseInt(dec.r, 10).toString(16)); + var gDec = normalizeTo2(parseInt(dec.g, 10).toString(16)); + var bDec = normalizeTo2(parseInt(dec.b, 10).toString(16)); + return rDec+gDec+bDec; + } + else { + dec += ''; + var rgb = dec.match(/\((\d+),\s?(\d+),\s?(\d+)\)/); + if (rgb !== null) { + return normalizeTo2(parseInt(rgb[1], 10).toString(16)) + + normalizeTo2(parseInt(rgb[2], 10).toString(16)) + + normalizeTo2(parseInt(rgb[3], 10).toString(16)); + } + else { + return normalizeTo2(parseInt(dec, 10).toString(16)); + } + } + }, + + /** + * Converts hexadecimal values to decimal + * Useful to use with CSS colors + * + * @method hexToDec + * @param {String} hex hexadecimal Value with 6, 3, 2 or 1 characters + * @return {Number} Object with properties r, g, b if length of number is >= 3 or decimal value instead. + * @sample Ink_Dom_Css_hexToDec.html + */ + hexToDec: function(hex){ + if (hex.indexOf('#') === 0) { + hex = hex.substr(1); + } + if (hex.length === 6) { // will return object RGB + return { + r: parseInt(hex.substr(0,2), 16), + g: parseInt(hex.substr(2,2), 16), + b: parseInt(hex.substr(4,2), 16) + }; + } + else if (hex.length === 3) { // will return object RGB + return { + r: parseInt(hex.charAt(0) + hex.charAt(0), 16), + g: parseInt(hex.charAt(1) + hex.charAt(1), 16), + b: parseInt(hex.charAt(2) + hex.charAt(2), 16) + }; + } + else if (hex.length <= 2) { // will return int + return parseInt(hex, 16); + } + }, + + /** + * Get a single property from a stylesheet. + * Use this to obtain the value of a CSS property (searched from loaded CSS documents) + * + * @method getPropertyFromStylesheet + * @param {String} selector a CSS rule. must be an exact match + * @param {String} property a CSS property + * @return {String} value of the found property, or null if it wasn't matched + */ + getPropertyFromStylesheet: function(selector, property) { + var rule = this.getRuleFromStylesheet(selector); + if (rule) { + return rule.style[property]; + } + return null; + }, + + getPropertyFromStylesheet2: function(selector, property) { + var rules = this.getRulesFromStylesheet(selector); + /* + rules.forEach(function(rule) { + var x = rule.style[property]; + if (x !== null && x !== undefined) { + return x; + } + }); + */ + var x; + for(var i=0, t=rules.length; i < t; i++) { + x = rules[i].style[property]; + if (x !== null && x !== undefined) { + return x; + } + } + return null; + }, + + getRuleFromStylesheet: function(selector) { + var sheet, rules, ri, rf, rule; + var s = document.styleSheets; + if (!s) { + return null; + } + + for (var si = 0, sf = document.styleSheets.length; si < sf; ++si) { + sheet = document.styleSheets[si]; + rules = sheet.rules ? sheet.rules : sheet.cssRules; + if (!rules) { return null; } + + for (ri = 0, rf = rules.length; ri < rf; ++ri) { + rule = rules[ri]; + if (!rule.selectorText) { continue; } + if (rule.selectorText === selector) { + return rule; + } + } + } + + return null; + }, + + getRulesFromStylesheet: function(selector) { + var res = []; + var sheet, rules, ri, rf, rule; + var s = document.styleSheets; + if (!s) { return res; } + + for (var si = 0, sf = document.styleSheets.length; si < sf; ++si) { + sheet = document.styleSheets[si]; + rules = sheet.rules ? sheet.rules : sheet.cssRules; + if (!rules) { + return null; + } + + for (ri = 0, rf = rules.length; ri < rf; ++ri) { + rule = rules[ri]; + if (!rule.selectorText) { continue; } + if (rule.selectorText === selector) { + res.push(rule); + } + } + } + + return res; + }, + + getPropertiesFromRule: function(selector) { + var rule = this.getRuleFromStylesheet(selector); + var props = {}; + var prop, i, f; + + /*if (typeof rule.style.length === 'snumber') { + for (i = 0, f = rule.style.length; i < f; ++i) { + prop = this._camelCase( rule.style[i] ); + props[prop] = rule.style[prop]; + } + } + else { // HANDLES IE 8, FIREFOX RULE JOINING... */ + rule = rule.style.cssText; + var parts = rule.split(';'); + var steps, val, pre, pos; + for (i = 0, f = parts.length; i < f; ++i) { + if (parts[i].charAt(0) === ' ') { + parts[i] = parts[i].substring(1); + } + steps = parts[i].split(':'); + prop = this._camelCase( steps[0].toLowerCase() ); + val = steps[1]; + if (val) { + val = val.substring(1); + + if (prop === 'padding' || prop === 'margin' || prop === 'borderWidth') { + + if (prop === 'borderWidth') { pre = 'border'; pos = 'Width'; } + else { pre = prop; pos = ''; } + + if (val.indexOf(' ') !== -1) { + val = val.split(' '); + props[pre + 'Top' + pos] = val[0]; + props[pre + 'Bottom'+ pos] = val[0]; + props[pre + 'Left' + pos] = val[1]; + props[pre + 'Right' + pos] = val[1]; + } + else { + props[pre + 'Top' + pos] = val; + props[pre + 'Bottom'+ pos] = val; + props[pre + 'Left' + pos] = val; + props[pre + 'Right' + pos] = val; + } + } + else if (prop === 'borderRadius') { + if (val.indexOf(' ') !== -1) { + val = val.split(' '); + props.borderTopLeftRadius = val[0]; + props.borderBottomRightRadius = val[0]; + props.borderTopRightRadius = val[1]; + props.borderBottomLeftRadius = val[1]; + } + else { + props.borderTopLeftRadius = val; + props.borderTopRightRadius = val; + props.borderBottomLeftRadius = val; + props.borderBottomRightRadius = val; + } + } + else { + props[prop] = val; + } + } + } + //} + //console.log(props); + + return props; + }, + + /** + * Change the font size of elements. + * Changes the font size of the elements which match the given CSS rule + * For this function to work, the CSS file must be in the same domain than the host page, otherwise JS can't access it. + * + * @method changeFontSize + * @param {String} selector CSS selector rule + * @param {Number} delta Number of pixels to change on font-size + * @param {String} [op] Supported operations are '+' and '*'. defaults to '+' + * @param {Number} [minVal] If result gets smaller than minVal, change does not occurr + * @param {Number} [maxVal] If result gets bigger than maxVal, change does not occurr + */ + changeFontSize: function(selector, delta, op, minVal, maxVal) { + var that = this; + Ink.requireModules(['Ink.Dom.Selector_1'], function(Selector) { + var e; + if (typeof selector !== 'string') { e = '1st argument must be a CSS selector rule.'; } + else if (typeof delta !== 'number') { e = '2nd argument must be a number.'; } + else if (op !== undefined && op !== '+' && op !== '*') { e = '3rd argument must be one of "+", "*".'; } + else if (minVal !== undefined && (typeof minVal !== 'number' || minVal <= 0)) { e = '4th argument must be a positive number.'; } + else if (maxVal !== undefined && (typeof maxVal !== 'number' || maxVal < maxVal)) { e = '5th argument must be a positive number greater than minValue.'; } + if (e) { throw new TypeError(e); } + + var val, el, els = Selector.select(selector); + if (minVal === undefined) { minVal = 1; } + op = (op === '*') ? function(a,b){return a*b;} : function(a,b){return a+b;}; + for (var i = 0, f = els.length; i < f; ++i) { + el = els[i]; + val = parseFloat( that.getStyle(el, 'fontSize')); + val = op(val, delta); + if (val < minVal) { continue; } + if (typeof maxVal === 'number' && val > maxVal) { continue; } + el.style.fontSize = val + 'px'; + } + }); + } + + }; + + return Css; + +}); + +/** + * DOM Traversal and manipulation + * @module Ink.Dom.Element_1 + * @version 1 + */ + +Ink.createModule('Ink.Dom.Element', 1, [], function() { + + 'use strict'; + + var createContextualFragmentSupport = ( + typeof document.createRange === 'function' && + typeof window.Range.prototype.createContextualFragment === 'function'); + + var deleteThisTbodyToken = 'Ink.Dom.Element tbody: ' + Math.random(); + var browserCreatesTbodies = (function () { + var div = document.createElement('div'); + div.innerHTML = ''; + return div.getElementsByTagName('tbody').length !== 0; + }()); + + function rect(elem){ + var dimensions = {}; + try { + dimensions = elem.getBoundingClientRect(); + } catch(e){ + dimensions = { top: elem.offsetTop, left: elem.offsetLeft }; + } + return dimensions; + } + + /** + * @namespace Ink.Dom.Element_1 + */ + + var InkElement = { + + /** + * Checks if something is a DOM Element. + * + * @method isDOMElement + * @static + * @param {Mixed} o The object to be checked. + * @return {Boolean} True if it's a valid DOM Element. + * @example + * var el = Ink.s('#element'); + * if( InkElement.isDOMElement( el ) === true ){ + * // It is a DOM Element. + * } else { + * // It is NOT a DOM Element. + * } + */ + isDOMElement: function(o) { + return o !== null && typeof o === 'object' && 'nodeType' in o && o.nodeType === 1; + }, + + /** + * Shortcut for `document.getElementById` + * + * @method get + * @param {String|DOMElement} elm Either an ID of an element, or an element. + * @return {DOMElement|null} The DOM element with the given id or null when it was not found + * @sample Ink_Dom_Element_1_get.html + */ + get: function(elm) { + if(typeof elm !== 'undefined') { + if(typeof elm === 'string') { + return document.getElementById(elm); + } + return elm; + } + return null; + }, + + /** + * Creates a DOM element + * + * @method create + * @param {String} tag tag name + * @param {Object} properties object with properties to be set on the element. You can also call other functions in Ink.Dom.Element like this + * @sample Ink_Dom_Element_1_create.html + */ + create: function(tag, properties) { + var el = document.createElement(tag); + //Ink.extendObj(el, properties); + for(var property in properties) { + if(properties.hasOwnProperty(property)) { + if (property in InkElement) { + InkElement[property](el, properties[property]); + } else { + if(property === 'className' || property === 'class') { + el.className = properties.className || properties['class']; + } else { + el.setAttribute(property, properties[property]); + } + } + } + } + return el; + }, + + /** + * Removes a DOM Element + * + * @method remove + * @param {DOMElement} elm The element to remove + * @sample Ink_Dom_Element_1_remove.html + */ + remove: function(el) { + el = Ink.i(el); + var parEl; + if (el && (parEl = el.parentNode)) { + parEl.removeChild(el); + } + }, + + /** + * Scrolls the window to an element + * + * @method scrollTo + * @param {DOMElement|String} elm Element where to scroll + * @sample Ink_Dom_Element_1_scrollTo.html + */ + scrollTo: function(elm) { + elm = InkElement.get(elm); + if(elm) { + if (elm.scrollIntoView) { + return elm.scrollIntoView(); + } + + var elmOffset = {}, + elmTop = 0, elmLeft = 0; + + do { + elmTop += elm.offsetTop || 0; + elmLeft += elm.offsetLeft || 0; + + elm = elm.offsetParent; + } while(elm); + + elmOffset = {x: elmLeft, y: elmTop}; + + window.scrollTo(elmOffset.x, elmOffset.y); + } + }, + + /** + * Gets the top offset of an element + * + * @method offsetTop + * @uses Ink.Dom.Browser + * + * @param {DOMElement|String} elm Target element + * @return {Number} Offset from the target element to the top of the document + * @sample Ink_Dom_Element_1_offsetTop.html + */ + offsetTop: function(elm) { + return InkElement.offset(elm)[1]; + }, + + /** + * Gets the left offset of an element + * + * @method offsetLeft + * @uses Ink.Dom.Browser + * + * @param {DOMElement|String} elm Target element + * @return {Number} Offset from the target element to the left of the document + * @sample Ink_Dom_Element_1_offsetLeft.html + */ + offsetLeft: function(elm) { + return InkElement.offset(elm)[0]; + }, + + /** + * Gets the relative offset of an element + * + * @method positionedOffset + * @param {DOMElement|String} elm Target element + * @return {Array} Array with the element offsetleft and offsettop relative to the closest positioned ancestor + * @sample Ink_Dom_Element_1_positionedOffset.html + */ + positionedOffset: function(element) { + var valueTop = 0, valueLeft = 0; + element = InkElement.get(element); + do { + valueTop += element.offsetTop || 0; + valueLeft += element.offsetLeft || 0; + element = element.offsetParent; + if (element) { + if (element.tagName.toLowerCase() === 'body') { break; } + + var value = element.style.position; + if (!value && element.currentStyle) { + value = element.currentStyle.position; + } + if ((!value || value === 'auto') && typeof getComputedStyle !== 'undefined') { + var css = getComputedStyle(element, null); + value = css ? css.position : null; + } + if (value === 'relative' || value === 'absolute') { break; } + } + } while (element); + return [valueLeft, valueTop]; + }, + + /** + * Gets the cumulative offset for an element + * + * Returns the top left position of the element on the page + * + * @method offset + * @uses Ink.Dom.Browser + * + * @method offset + * @param {DOMElement|String} elm Target element + * @return {[Number, Number]} Array with pixel distance from the target element to the top left corner of the document + * @sample Ink_Dom_Element_1_offset.html + */ + offset: function(el) { + /*jshint boss:true */ + el = Ink.i(el); + var res = [0, 0]; + var doc = el.ownerDocument, + docElem = doc.documentElement, + box = rect(el), + body = doc.body, + clientTop = docElem.clientTop || body.clientTop || 0, + clientLeft = docElem.clientLeft || body.clientLeft || 0, + scrollTop = doc.pageYOffset || docElem.scrollTop || body.scrollTop, + scrollLeft = doc.pageXOffset || docElem.scrollLeft || body.scrollLeft, + top = box.top + scrollTop - clientTop, + left = box.left + scrollLeft - clientLeft; + res = [left, top]; + return res; + }, + + /** + * Gets the scroll of the element + * + * @method scroll + * @param {DOMElement|String} [elm] Target element or document.body + * @returns {Array} offset values for x and y scroll + * @sample Ink_Dom_Element_1_scroll.html + */ + scroll: function(elm) { + elm = elm ? Ink.i(elm) : document.body; + return [ + ( ( !window.pageXOffset ) ? elm.scrollLeft : window.pageXOffset ), + ( ( !window.pageYOffset ) ? elm.scrollTop : window.pageYOffset ) + ]; + }, + + _getPropPx: function(cs, prop) { + var n, c; + var val = cs.getPropertyValue ? cs.getPropertyValue(prop) : cs[prop]; + if (!val) { n = 0; } + else { + c = val.indexOf('px'); + if (c === -1) { n = 0; } + else { + n = parseFloat(val, 10); + } + } + + //console.log([prop, ' "', val, '" ', n].join('')); + + return n; + }, + + /** + * Alias for offset() + * + * @method offset2 + * @deprecated Kept for historic reasons. Use offset() instead. + */ + offset2: function(el) { + return InkElement.offset(el); + }, + + /** + * Checks if an element has an attribute + * + * @method hasAttribute + * @param {Object} elm Target element + * @param {String} attr Attribute name + * @return {Boolean} Boolean based on existance of attribute + * @sample Ink_Dom_Element_1_hasAttribute.html + */ + hasAttribute: function(elm, attr){ + elm = Ink.i(elm); + return elm.hasAttribute ? elm.hasAttribute(attr) : !!elm.getAttribute(attr); + }, + /** + * Inserts an element right after another + * + * @method insertAfter + * @param {DOMElement} newElm Element to be inserted + * @param {DOMElement|String} targetElm Key element + * @sample Ink_Dom_Element_1_insertAfter.html + */ + insertAfter: function(newElm, targetElm) { + /*jshint boss:true */ + if (targetElm = InkElement.get(targetElm)) { + if (targetElm.nextSibling !== null) { + targetElm.parentNode.insertBefore(newElm, targetElm.nextSibling); + } else { + targetElm.parentNode.appendChild(newElm); + } + } + }, + + /** + * Inserts an element before another + * + * @method insertBefore + * @param {DOMElement} newElm Element to be inserted + * @param {DOMElement|String} targetElm Key element + * @sample Ink_Dom_Element_1_insertBefore.html + */ + insertBefore: function (newElm, targetElm) { + /*jshint boss:true */ + if ( (targetElm = InkElement.get(targetElm)) ) { + targetElm.parentNode.insertBefore(newElm, targetElm); + } + }, + + /** + * Inserts an element as the first child of another + * + * @method insertTop + * @param {DOMElement} newElm Element to be inserted + * @param {DOMElement|String} targetElm Key element + * @sample Ink_Dom_Element_1_insertTop.html + */ + insertTop: function(newElm,targetElm) { + /*jshint boss:true */ + if (targetElm = InkElement.get(targetElm)) { + if (targetElm.firstChild) { + targetElm.insertBefore(newElm, targetElm.firstChild); + } else { + targetElm.appendChild(newElm); + } + } + }, + + /** + * Inserts an element as the last child of another + * + * @method insertBottom + * @param {DOMElement} newElm Element to be inserted + * @param {DOMElement|String} targetElm Key element + * @sample Ink_Dom_Element_1_insertBottom.html + */ + insertBottom: function(newElm, targetElm) { + /*jshint boss:true */ + targetElm = Ink.i(targetElm); + targetElm.appendChild(newElm); + }, + + /** + * Retrieves textContent from node + * + * @method textContent + * @param {DOMNode} node Where to retreive text from. Can be any node type. + * @return {String} the text + * @sample Ink_Dom_Element_1_textContent.html + */ + textContent: function(node){ + node = Ink.i(node); + var text, k, cs, m; + + switch(node && node.nodeType) { + case 9: /*DOCUMENT_NODE*/ + // IE quirks mode does not have documentElement + return InkElement.textContent(node.documentElement || node.body && node.body.parentNode || node.body); + + case 1: /*ELEMENT_NODE*/ + text = node.innerText; + if (typeof text !== 'undefined') { + return text; + } + /* falls through */ + case 11: /*DOCUMENT_FRAGMENT_NODE*/ + text = node.textContent; + if (typeof text !== 'undefined') { + return text; + } + + if (node.firstChild === node.lastChild) { + // Common case: 0 or 1 children + return InkElement.textContent(node.firstChild); + } + + text = []; + cs = node.childNodes; + for (k = 0, m = cs.length; k < m; ++k) { + text.push( InkElement.textContent( cs[k] ) ); + } + return text.join(''); + + case 3: /*TEXT_NODE*/ + case 4: /*CDATA_SECTION_NODE*/ + return node.nodeValue; + } + return ''; + }, + + /** + * Replaces text content of a DOM Node + * This method removes any child node previously present + * + * @method setTextContent + * @param {DOMNode} node node Target node where the text will be added. + * @param {String} text text Text to be added on the node. + * @sample Ink_Dom_Element_1_setTextContent.html + */ + setTextContent: function(node, text){ + node = Ink.i(node); + switch(node && node.nodeType) + { + case 1: /*ELEMENT_NODE*/ + if ('innerText' in node) { + node.innerText = text; + break; + } + /* falls through */ + case 11: /*DOCUMENT_FRAGMENT_NODE*/ + if ('textContent' in node) { + node.textContent = text; + break; + } + /* falls through */ + case 9: /*DOCUMENT_NODE*/ + while(node.firstChild) { + node.removeChild(node.firstChild); + } + if (text !== '') { + var doc = node.ownerDocument || node; + node.appendChild(doc.createTextNode(text)); + } + break; + + case 3: /*TEXT_NODE*/ + case 4: /*CDATA_SECTION_NODE*/ + node.nodeValue = text; + break; + } + }, + + /** + * Checks if an element is a link + * + * @method isLink + * @param {DOMNode} node Node to check if it's link + * @return {Boolean} + * @sample Ink_Dom_Element_1_isLink.html + */ + isLink: function(element){ + var b = element && element.nodeType === 1 && ((/^a|area$/i).test(element.tagName) || + element.hasAttributeNS && element.hasAttributeNS('http://www.w3.org/1999/xlink','href')); + return !!b; + }, + + /** + * Checks if a node is an ancestor of another + * + * @method isAncestorOf + * @param {DOMNode} ancestor Ancestor node + * @param {DOMNode} node Descendant node + * @return {Boolean} + * @sample Ink_Dom_Element_1_isAncestorOf.html + */ + isAncestorOf: function(ancestor, node){ + /*jshint boss:true */ + if (!node || !ancestor) { + return false; + } + if (node.compareDocumentPosition) { + return (ancestor.compareDocumentPosition(node) & 0x10) !== 0;/*Node.DOCUMENT_POSITION_CONTAINED_BY*/ + } + while (node = node.parentNode){ + if (node === ancestor){ + return true; + } + } + return false; + }, + + /** + * Checks if a node is descendant of another + * + * @method descendantOf + * @param {DOMNode} node The ancestor + * @param {DOMNode} descendant The descendant + * @return {Boolean} true if 'descendant' is descendant of 'node' + * @sample Ink_Dom_Element_1_descendantOf.html + */ + descendantOf: function(node, descendant){ + return node !== descendant && InkElement.isAncestorOf(node, descendant); + }, + + /** + * Get first child element of another + * @method firstElementChild + * @param {DOMElement} elm Parent node + * @return {DOMElement} the Element child + * @sample Ink_Dom_Element_1_firstElementChild.html + */ + firstElementChild: function(elm){ + if(!elm) { + return null; + } + if ('firstElementChild' in elm) { + return elm.firstElementChild; + } + var child = elm.firstChild; + while(child && child.nodeType !== 1) { + child = child.nextSibling; + } + return child; + }, + + /** + * Get the last child element of another + * @method lastElementChild + * @param {DOMElement} elm Parent node + * @return {DOMElement} the Element child + * @sample Ink_Dom_Element_1_lastElementChild.html + */ + lastElementChild: function(elm){ + if(!elm) { + return null; + } + if ('lastElementChild' in elm) { + return elm.lastElementChild; + } + var child = elm.lastChild; + while(child && child.nodeType !== 1) { + child = child.previousSibling; + } + return child; + }, + + /** + * Get the first sibling element after the node + * + * @method nextElementSibling + * @param {DOMNode} node The current node + * @return {DOMElement|Null} The first sibling element after node or null if none is found + * @sample Ink_Dom_Element_1_nextElementSibling.html + */ + nextElementSibling: function(node){ + var sibling = null; + + if(!node){ return sibling; } + + if("nextElementSibling" in node){ + return node.nextElementSibling; + } else { + sibling = node.nextSibling; + + // 1 === Node.ELEMENT_NODE + while(sibling && sibling.nodeType !== 1){ + sibling = sibling.nextSibling; + } + + return sibling; + } + }, + + /** + * Get the first sibling element before the node + * + * @method previousElementSibling + * @param {DOMNode} node The current node + * @return {DOMElement|Null} The first element sibling before node or null if none is found + * @sample Ink_Dom_Element_1_previousElementSibling.html + */ + previousElementSibling: function(node){ + var sibling = null; + + if(!node){ return sibling; } + + if("previousElementSibling" in node){ + return node.previousElementSibling; + } else { + sibling = node.previousSibling; + + // 1 === Node.ELEMENT_NODE + while(sibling && sibling.nodeType !== 1){ + sibling = sibling.previousSibling; + } + + return sibling; + } + }, + + /** + * Get an element's width in pixels. + * + * @method elementWidth + * @param {DOMElement|String} element Target DOM element or target ID + * @return {Number} The element's width + * @sample Ink_Dom_Element_1_elementWidth.html + */ + elementWidth: function(element) { + if(typeof element === "string") { + element = document.getElementById(element); + } + return element.offsetWidth; + }, + + /** + * Get an element's height in pixels. + * + * @method elementHeight + * @param {DOMElement|String} element DOM element or target ID + * @return {Number} The element's height + * @sample Ink_Dom_Element_1_elementHeight.html + */ + elementHeight: function(element) { + if(typeof element === "string") { + element = document.getElementById(element); + } + return element.offsetHeight; + }, + + /** + * Deprecated. Alias for offsetLeft() + * + * @method elementLeft + * @param {DOMElement|String} element DOM element or target ID + * @return {Number} Element's left position + */ + elementLeft: function(element) { + return InkElement.offsetLeft(element); + }, + + /** + * Deprecated. Alias for offsetTop() + * + * @method elementTop + * @param {DOMElement|string} element Target DOM element or target ID + * @return {Number} element's top position + */ + elementTop: function(element) { + return InkElement.offsetTop(element); + }, + + /** + * Get an element's dimensions in pixels. + * + * @method elementDimensions + * @param {DOMElement|string} element DOM element or target ID + * @return {Array} Array with element's width and height + * @sample Ink_Dom_Element_1_elementDimensions.html + */ + elementDimensions: function(element) { + element = Ink.i(element); + return [element.offsetWidth, element.offsetHeight]; + }, + + /** + * Get the outer dimensions of an element in pixels. + * + * @method outerDimensions + * @uses Ink.Dom.Css + * + * @param {DOMElement} element Target element + * @return {Array} Array with element width and height. + * @sample Ink_Dom_Element_1_outerDimensions.html + */ + outerDimensions: function (element) { + var bbox = rect(element); + + var Css = Ink.getModule('Ink.Dom.Css_1'); + var getStyle = Ink.bindMethod(Css, 'getStyle', element); + + return [ + bbox.right - bbox.left + parseFloat(getStyle('marginLeft') || 0) + parseFloat(getStyle('marginRight') || 0), // w + bbox.bottom - bbox.top + parseFloat(getStyle('marginTop') || 0) + parseFloat(getStyle('marginBottom') || 0) // h + ]; + }, + + /** + * Check if an element is inside the viewport + * + * @method inViewport + * @param {DOMElement} element DOM Element + * @param {Object} [options] Options object. If you pass a Boolean value here, it is interpreted as `options.partial` + * @param {Boolean} [options.partial]=false Return `true` even if it is only partially visible. + * @param {Number} [options.margin]=0 Consider a margin all around the viewport with `opts.margin` width a dead zone. + * @return {Boolean} + * @sample Ink_Dom_Element_1_inViewport.html + */ + inViewport: function (element, opts) { + var dims = rect(Ink.i(element)); + if (typeof opts === 'boolean') { + opts = {partial: opts, margin: 0}; + } + opts = Ink.extendObj({ partial: false, margin: 0}, opts || {}); + if (opts.partial) { + return dims.bottom + opts.margin > 0 && // from the top + dims.left - opts.margin < InkElement.viewportWidth() && // from the right + dims.top - opts.margin < InkElement.viewportHeight() && // from the bottom + dims.right + opts.margin > 0; // from the left + } else { + return dims.top + opts.margin > 0 && // from the top + dims.right - opts.margin < InkElement.viewportWidth() && // from the right + dims.bottom - opts.margin < InkElement.viewportHeight() && // from the bottom + dims.left + opts.margin > 0; // from the left + } + }, + + /** + * Check if an element is hidden. + * Taken from Mootools Element extras ( https://gist.github.com/cheeaun/73342 ) + * Does not take into account visibility:hidden + * @method isHidden + * @param {DOMElement} element Element to check + * @return {Boolean} + * @sample Ink_Dom_Element_1_isHidden.html + */ + + isHidden: function (element) { + var w = element.offsetWidth, + h = element.offsetHeight, + force = (element.tagName.toLowerCase() === 'tr'); + + var Css = Ink.getModule('Ink.Dom.Css_1'); + + return (w===0 && h===0 && !force) ? true : + (w!==0 && h!==0 && !force) ? false : + Css.getStyle(element, 'display').toLowerCase() === 'none'; + }, + + /** + * Check if an element is visible + * + * @method isVisible + * @uses isHidden + * @param {DOMElement} element Element to check + * @return {Boolean} + * @sample Ink_Dom_Element_1_isVisible.html + */ + + isVisible: function (element) { + return !this.isHidden(element); + }, + + /** + * Clones an element's position to another + * + * @method clonePosition + * @param {DOMElement} cloneTo element to be position cloned + * @param {DOMElement} cloneFrom element to get the cloned position + * @return {DOMElement} The element with positionClone + * @sample Ink_Dom_Element_1_clonePosition.html + */ + clonePosition: function(cloneTo, cloneFrom){ + var pos = InkElement.offset(cloneFrom); + cloneTo.style.left = pos[0]+'px'; + cloneTo.style.top = pos[1]+'px'; + + return cloneTo; + }, + + /** + * Text-overflow: ellipsis emulation + * Slices off a piece of text at the end of the element and adds the ellipsis so all text fits inside. + * + * @method ellipsizeText + * @param {DOMElement} element Element to modify text content + * @param {String} [ellipsis]='\u2026' String to append to the chopped text + */ + ellipsizeText: function(element/*, ellipsis*/){ + if ((element = Ink.i(element))) { + element.style.overflow = 'hidden'; + element.style.whiteSpace = 'nowrap'; + element.style.textOverflow = 'ellipsis'; + } + }, + + /** + * Finds the closest ancestor element matching your test function + * + * + * @method findUpwardsHaving + * @param {DOMElement} element Element to base the search from + * @param {Function} boolTest Testing function + * @return {DOMElement|false} The matched element or false if did not match + * @sample Ink_Dom_Element_1_findUpwardsHaving.html + */ + findUpwardsHaving: function(element, boolTest) { + while (element && element.nodeType === 1) { + if (boolTest(element)) { + return element; + } + element = element.parentNode; + } + return false; + }, + + /** + * Finds the closest ancestor by class name + * + * @method findUpwardsByClass + * @uses findUpwardsHaving + * @param {DOMElement} element Element to base the search from + * @param {String} className Class name to search + * @returns {DOMElement|false} The matched element or false if did not match + * @sample Ink_Dom_Element_1_findUpwardsByClass.html + */ + findUpwardsByClass: function(element, className) { + var re = new RegExp("(^|\\s)" + className + "(\\s|$)"); + var tst = function(el) { + var cls = el.className; + return cls && re.test(cls); + }; + return InkElement.findUpwardsHaving(element, tst); + }, + + /** + * Finds the closest ancestor by tag name + * + * @method findUpwardsByTag + * @param {DOMElement} element Element to base the search from + * @param {String} tag Tag to search + * @returns {DOMElement|false} the matched element or false if did not match + * @sample Ink_Dom_Element_1_findUpwardsByTag.html + */ + findUpwardsByTag: function(element, tag) { + tag = tag.toUpperCase(); + var tst = function(el) { + return el.nodeName && el.nodeName.toUpperCase() === tag; + }; + return InkElement.findUpwardsHaving(element, tst); + }, + + /** + * Finds the closest ancestor by id + * + * @method findUpwardsById + * @param {HtmlElement} element Element to base the search from + * @param {String} id ID to search + * @returns {HtmlElement|false} The matched element or false if did not match + * @sample Ink_Dom_Element_1_findUpwardsById.html + */ + findUpwardsById: function(element, id) { + var tst = function(el) { + return el.id === id; + }; + return InkElement.findUpwardsHaving(element, tst); + }, + + /** + * Finds the closest ancestor by CSS selector + * + * @method findUpwardsBySelector + * @param {HtmlElement} element Element to base the search from + * @param {String} sel CSS selector + * @returns {HtmlElement|false} The matched element or false if did not match + * @sample Ink_Dom_Element_1_findUpwardsBySelector.html + */ + findUpwardsBySelector: function(element, sel) { + var Selector = Ink.getModule('Ink.Dom.Selector', '1'); + if (!Selector) { + throw new Error('This method requires Ink.Dom.Selector'); + } + var tst = function(el) { + return Selector.matchesSelector(el, sel); + }; + return InkElement.findUpwardsHaving(element, tst); + }, + + /** + * Gets the trimmed text of an element + * + * @method getChildrenText + * @param {DOMElement} el Element to base the search from + * @param {Boolean} [removeIt] Flag to remove the text from the element + * @return {String} Text found + * @sample Ink_Dom_Element_1_getChildrenText.html + */ + getChildrenText: function(el, removeIt) { + var node, + j, + part, + nodes = el.childNodes, + jLen = nodes.length, + text = ''; + + if (!el) { + return text; + } + + for (j = 0; j < jLen; ++j) { + node = nodes[j]; + if (!node) { continue; } + if (node.nodeType === 3) { // TEXT NODE + part = InkElement._trimString( String(node.data) ); + if (part.length > 0) { + text += part; + if (removeIt) { el.removeChild(node); } + } + else { el.removeChild(node); } + } + } + + return text; + }, + + /** + * String trim implementation + * Used by getChildrenText + * + * function _trimString + * param {String} text + * return {String} trimmed text + */ + _trimString: function(text) { + return (String.prototype.trim) ? text.trim() : text.replace(/^\s*/, '').replace(/\s*$/, ''); + }, + + /** + * Gets value of a select element + * + * @method getSelectValues + * @param {DOMElement|String} select element + * @return {Array} The selected values + * @sample Ink_Dom_Element_1_getSelectValues.html + */ + getSelectValues: function (select) { + var selectEl = Ink.i(select); + var values = []; + for (var i = 0; i < selectEl.options.length; ++i) { + values.push( selectEl.options[i].value ); + } + return values; + }, + + + /* used by fills */ + _normalizeData: function(data) { + var d, data2 = []; + for (var i = 0, f = data.length; i < f; ++i) { + d = data[i]; + + if (!(d instanceof Array)) { // if not array, wraps primitive twice: val -> [val, val] + d = [d, d]; + } + else if (d.length === 1) { // if 1 element array: [val] -> [val, val] + d.push(d[0]); + } + data2.push(d); + } + return data2; + }, + + + /** + * Fills a select element with options + * + * @method fillSelect + * @param {DOMElement|String} container Select element which will get filled + * @param {Array} data Data to populate the component + * @param {Boolean} [skipEmpty] Flag to skip empty option + * @param {String|Number} [defaultValue] Initial selected value + * + * @sample Ink_Dom_Element_1_fillSelect.html + */ + fillSelect: function(container, data, skipEmpty, defaultValue) { + var containerEl = Ink.i(container); + if (!containerEl) { return; } + + containerEl.innerHTML = ''; + var d, optionEl; + + if (!skipEmpty) { + // add initial empty option + optionEl = document.createElement('option'); + optionEl.setAttribute('value', ''); + containerEl.appendChild(optionEl); + } + + data = InkElement._normalizeData(data); + + for (var i = 0, f = data.length; i < f; ++i) { + d = data[i]; + + optionEl = document.createElement('option'); + optionEl.setAttribute('value', d[0]); + if (d.length > 2) { + optionEl.setAttribute('extra', d[2]); + } + optionEl.appendChild( document.createTextNode(d[1]) ); + + if (d[0] === defaultValue) { + optionEl.setAttribute('selected', 'selected'); + } + + containerEl.appendChild(optionEl); + } + }, + + + /** + * Creates a set of radio buttons from an array of data + * + * @method fillRadios + * @param {DOMElement|String} insertAfterEl Element after which the input elements will be created + * @param {String} name Name for the form field ([] is added if not present as a suffix) + * @param {Array} data Data to populate the component + * @param {Boolean} [skipEmpty] Flag to skip creation of empty options + * @param {String|Number} [defaultValue] Initial selected value + * @param {String} [splitEl] Name of element to add after each input element (example: 'br') + * @return {DOMElement} Wrapper element around the radio buttons + */ + fillRadios: function(insertAfterEl, name, data, skipEmpty, defaultValue, splitEl) { + insertAfterEl = Ink.i(insertAfterEl); + var containerEl = document.createElement('span'); + InkElement.insertAfter(containerEl, insertAfterEl); + + data = InkElement._normalizeData(data); + + /* + if (name.substring(name.length - 1) !== ']') { + name += '[]'; + } + */ + + var d, inputEl; + + if (!skipEmpty) { + // add initial empty option + inputEl = document.createElement('input'); + inputEl.setAttribute('type', 'radio'); + inputEl.setAttribute('name', name); + inputEl.setAttribute('value', ''); + containerEl.appendChild(inputEl); + if (splitEl) { containerEl.appendChild( document.createElement(splitEl) ); } + } + + for (var i = 0; i < data.length; ++i) { + d = data[i]; + + inputEl = document.createElement('input'); + inputEl.setAttribute('type', 'radio'); + inputEl.setAttribute('name', name); + inputEl.setAttribute('value', d[0]); + containerEl.appendChild(inputEl); + containerEl.appendChild( document.createTextNode(d[1]) ); + if (splitEl) { containerEl.appendChild( document.createElement(splitEl) ); } + + if (d[0] === defaultValue) { + inputEl.checked = true; + } + } + + return containerEl; + }, + + + /** + * Creates set of checkbox buttons + * + * @method fillChecks + * @param {DOMElement|String} insertAfterEl Element after which the input elements will be created + * @param {String} name Name for the form field ([] is added if not present as a suffix) + * @param {Array} data Data to populate the component + * @param {Boolean} [skipEmpty] Flag to skip creation of empty options + * @param {String|Number} [defaultValue] Initial selected value + * @param {String} [splitEl] Name of element to add after each input element (example: 'br') + * @return {DOMElement} Wrapper element around the checkboxes + */ + fillChecks: function(insertAfterEl, name, data, defaultValue, splitEl) { + insertAfterEl = Ink.i(insertAfterEl); + var containerEl = document.createElement('span'); + InkElement.insertAfter(containerEl, insertAfterEl); + + data = InkElement._normalizeData(data); + + if (name.substring(name.length - 1) !== ']') { + name += '[]'; + } + + var d, inputEl; + + for (var i = 0; i < data.length; ++i) { + d = data[i]; + + inputEl = document.createElement('input'); + inputEl.setAttribute('type', 'checkbox'); + inputEl.setAttribute('name', name); + inputEl.setAttribute('value', d[0]); + containerEl.appendChild(inputEl); + containerEl.appendChild( document.createTextNode(d[1]) ); + if (splitEl) { containerEl.appendChild( document.createElement(splitEl) ); } + + if (d[0] === defaultValue) { + inputEl.checked = true; + } + } + + return containerEl; + }, + + + /** + * Gets the index of an element relative to a parent + * + * @method parentIndexOf + * @param {DOMElement} parentEl Element to parse + * @param {DOMElement} childEl Child Element to look for + * @return {Number} The index of the childEl inside parentEl. Returns -1 if it's not a direct child + * @sample Ink_Dom_Element_1_parentIndexOf.html + */ + parentIndexOf: function(parentEl, childEl) { + var node, idx = 0; + for (var i = 0, f = parentEl.childNodes.length; i < f; ++i) { + node = parentEl.childNodes[i]; + if (node.nodeType === 1) { // ELEMENT + if (node === childEl) { return idx; } + ++idx; + } + } + return -1; + }, + + + /** + * Gets the next siblings of an element + * + * @method nextSiblings + * @param {String|DOMElement} elm Element + * @return {Array} Array of next sibling elements + * @sample Ink_Dom_Element_1_nextSiblings.html + */ + nextSiblings: function(elm) { + elm = Ink.i(elm); + if(typeof(elm) === 'object' && elm !== null && elm.nodeType && elm.nodeType === 1) { + var elements = [], + siblings = elm.parentNode.children, + index = InkElement.parentIndexOf(elm.parentNode, elm); + + for(var i = ++index, len = siblings.length; i
" + deleteThisTbodyToken + "
"; + } else { + div.innerHTML = "" + html + "
"; + } + return div.firstChild; + }, + TBODY: function (div, html) { + div.innerHTML = '' + html + '
'; + return div.firstChild.getElementsByTagName('tbody')[0]; + }, + THEAD: function (div, html) { + div.innerHTML = '' + html + '
'; + return div.firstChild.getElementsByTagName('thead')[0]; + }, + TFOOT: function (div, html) { + div.innerHTML = '' + html + '
'; + return div.firstChild.getElementsByTagName('tfoot')[0]; + }, + TR: function (div, html) { + div.innerHTML = '' + html + '
'; + return div.firstChild.firstChild.firstChild; + } + }, + + /** + * Gets a wrapper DIV with a certain HTML content to be inserted inside another element. + * This is necessary for appendHTML,prependHTML functions, because they need a container element to copy the children from. + * + * Works around IE table quirks + * @method _getWrapper + * @private + * @param elm + * @param html + */ + _getWrapper: function (elm, html) { + var nodeName = elm.nodeName && elm.nodeName.toUpperCase(); + var wrapper = document.createElement('div'); + var wrapFunc = InkElement._wrapElements[nodeName]; + + if ( !wrapFunc ) { + wrapper.innerHTML = html; + return wrapper; + } + // special cases + wrapper = wrapFunc(wrapper, html); + // worst case: tbody auto-creation even when our HTML has a tbody. + if (browserCreatesTbodies && nodeName === 'TABLE') { + // terrible case. Deal with tbody creation too. + var tds = wrapper.getElementsByTagName('td'); + for (var i = 0, len = tds.length; i < len; i++) { + if (tds[i].innerHTML === deleteThisTbodyToken) { + var tbody = tds[i].parentNode.parentNode; + tbody.parentNode.removeChild(tbody); + } + } + } + return wrapper; + }, + + /** + * Appends HTML to an element. + * This method parses the html string and doesn't modify its contents + * + * @method appendHTML + * @param {String|DOMElement} elm Element + * @param {String} html Markup string + * @sample Ink_Dom_Element_1_appendHTML.html + */ + appendHTML: function(elm, html){ + elm = Ink.i(elm); + if(elm !== null) { + var wrapper = InkElement._getWrapper(elm, html); + while (wrapper.firstChild) { + elm.appendChild(wrapper.firstChild); + } + } + }, + + /** + * Prepends HTML to an element. + * This method parses the html string and doesn't modify its contents + * + * @method prependHTML + * @param {String|DOMElement} elm Element + * @param {String} html Markup string + * @sample Ink_Dom_Element_1_prependHTML.html + */ + prependHTML: function(elm, html){ + elm = Ink.i(elm); + if(elm !== null) { + var wrapper = InkElement._getWrapper(elm, html); + while (wrapper.lastChild) { + elm.insertBefore(wrapper.lastChild, elm.firstChild); + } + } + }, + + /** + * Sets the inner HTML of an element. + * + * @method setHTML + * @param {String|DOMElement} elm Element + * @param {String} html Markup string + * @sample Ink_Dom_Element_1_setHTML.html + */ + setHTML: function (elm, html) { + elm = Ink.i(elm); + if(elm !== null) { + try { + elm.innerHTML = html; + } catch (e) { + // Tables in IE7 + while (elm.firstChild) { + elm.removeChild(elm.firstChild); + } + InkElement.appendHTML(elm, html); + } + } + }, + + /** + * Wraps an element inside a container. + * + * The container may or may not be in the document yet. + * + * @method wrap + * @param {String|DOMElement} target Element to be wrapped + * @param {String|DOMElement} container Element to wrap the target + * @return Container element + * @sample Ink_Dom_Element_1_wrap.html + * + * @example + * before: + * + *
+ * + * call this function to wrap #target with a wrapper div. + * + * InkElement.wrap('target', InkElement.create('div', {id: 'container'}); + * + * after: + * + *
+ */ + wrap: function (target, container) { + target = Ink.i(target); + container = Ink.i(container); + + var nextNode = target.nextSibling; + var parent = target.parentNode; + + container.appendChild(target); + + if (nextNode !== null) { + parent.insertBefore(container, nextNode); + } else { + parent.appendChild(container); + } + + return container; + }, + + /** + * Places an element outside a wrapper. + * + * @method unwrap + * @param {DOMElement} elem The element you're trying to unwrap. This should be an ancestor of the wrapper. + * @param {String} [wrapperSelector] CSS Selector for the ancestor. Use this if your wrapper is not the direct parent of elem. + * @sample Ink_Dom_Element_1_unwrap.html + * + * @example + * + * When you have this: + * + *
+ *
+ *
+ * + * If you do this: + * + * InkElement.unwrap('unwrapMe'); + * + * You get this: + * + *
+ *
+ * + **/ + unwrap: function (elem, wrapperSelector) { + elem = Ink.i(elem); + var wrapper; + if (typeof wrapperSelector === 'string') { + wrapper = InkElement.findUpwardsBySelector(elem, wrapperSelector); + } else if (typeof wrapperSelector === 'object' && wrapperSelector.tagName) { + wrapper = InkElement.findUpwardsHaving(elem, function (ancestor) { + return ancestor === wrapperSelector; + }); + } else { + wrapper = elem.parentNode; + } + if (!wrapper || !wrapper.parentNode) { return; } + + InkElement.insertBefore(elem, wrapper); + }, + + /** + * Replaces an element with another. + * + * @method replace + * @param element The element to be replaced. + * @param replacement The new element. + * @sample Ink_Dom_Element_1_replace.html + * + * @example + * var newelement1 = InkElement.create('div'); + * // ... + * replace(Ink.i('element1'), newelement1); + */ + replace: function (element, replacement) { + element = Ink.i(element); + if(element !== null) { + element.parentNode.replaceChild(replacement, element); + } + }, + + /** + * Removes direct text children. + * Useful to remove nasty layout gaps generated by whitespace on the markup. + * + * @method removeTextNodeChildren + * @param {DOMElement} el Element to remove text from + * @sample Ink_Dom_Element_1_removeTextNodeChildren.html + */ + removeTextNodeChildren: function(el) { + el = Ink.i(el); + if(el !== null) { + var prevEl, toRemove, parent = el; + el = el.firstChild; + while (el) { + toRemove = (el.nodeType === 3); + prevEl = el; + el = el.nextSibling; + if (toRemove) { + parent.removeChild(prevEl); + } + } + } + }, + + /** + * Creates a documentFragment from an HTML string. + * + * @method htmlToFragment + * @param {String} html HTML string + * @return {DocumentFragment} DocumentFragment containing all of the elements from the html string + * @sample Ink_Dom_Element_1_htmlToFragment.html + */ + htmlToFragment: (createContextualFragmentSupport ? + function(html){ + var range; + + if(typeof html !== 'string'){ return document.createDocumentFragment(); } + + range = document.createRange(); + + // set the context to document.body (firefox does this already, webkit doesn't) + range.selectNode(document.body); + + return range.createContextualFragment(html); + } : function (html) { + var fragment = document.createDocumentFragment(), + tempElement, + current; + + if(typeof html !== 'string'){ return fragment; } + + tempElement = document.createElement('div'); + tempElement.innerHTML = html; + + // append child removes elements from the original parent + while( (current = tempElement.firstChild) ){ // intentional assignment + fragment.appendChild(current); + } + + return fragment; + }), + + _camelCase: function(str) + { + return str ? str.replace(/-(\w)/g, function (_, $1){ + return $1.toUpperCase(); + }) : str; + }, + + /** + * Gets data attributes from an element + * + * @method data + * @param {String|DOMElement} selector Element or CSS selector + * @return {Object} Object with the data-* properties. If no data-attributes are present, an empty object is returned. + * @sample Ink_Dom_Element_1_data.html + */ + data: function(selector) { + var el; + if (typeof selector !== 'object' && typeof selector !== 'string') { + throw '[Ink.Dom.Element.data] :: Invalid selector defined'; + } + + if (typeof selector === 'object') { + el = selector; + } + else { + var InkDomSelector = Ink.getModule('Ink.Dom.Selector', 1); + if (!InkDomSelector) { + throw "[Ink.Dom.Element.data] :: this method requires Ink.Dom.Selector - v1"; + } + el = InkDomSelector.select(selector); + if (el.length <= 0) { + throw "[Ink.Dom.Element.data] :: Can't find any element with the specified selector"; + } + el = el[0]; + } + + var dataset = {}; + var attrs = el.attributes || []; + + var curAttr, curAttrName, curAttrValue; + if (attrs) { + for (var i = 0, total = attrs.length; i < total; ++i) { + curAttr = attrs[i]; + curAttrName = curAttr.name; + curAttrValue = curAttr.value; + if (curAttrName && curAttrName.indexOf('data-') === 0) { + dataset[InkElement._camelCase(curAttrName.replace('data-', ''))] = curAttrValue; + } + } + } + + return dataset; + }, + + /** + * Move the cursor on an input or textarea element. + * @method moveCursorTo + * @param {DOMElement} el Input or Textarea element + * @param {Number} t Index of the character to move the cursor to + * @sample Ink_Dom_Element_1_moveCursorTo.html + */ + moveCursorTo: function(el, t) { + el = Ink.i(el); + if(el !== null) { + if (el.setSelectionRange) { + el.setSelectionRange(t, t); + //el.focus(); + } + else { + var range = el.createTextRange(); + range.collapse(true); + range.moveEnd( 'character', t); + range.moveStart('character', t); + range.select(); + } + } + }, + + /** + * Get the page's width. + * @method pageWidth + * @return {Number} Page width in pixels + * @sample Ink_Dom_Element_1_pageWidth.html + */ + pageWidth: function() { + var xScroll; + + if (window.innerWidth && window.scrollMaxX) { + xScroll = window.innerWidth + window.scrollMaxX; + } else if (document.body.scrollWidth > document.body.offsetWidth){ + xScroll = document.body.scrollWidth; + } else { + xScroll = document.body.offsetWidth; + } + + var windowWidth; + + if (window.self.innerWidth) { + if(document.documentElement.clientWidth){ + windowWidth = document.documentElement.clientWidth; + } else { + windowWidth = window.self.innerWidth; + } + } else if (document.documentElement && document.documentElement.clientWidth) { + windowWidth = document.documentElement.clientWidth; + } else if (document.body) { + windowWidth = document.body.clientWidth; + } + + if(xScroll < windowWidth){ + return xScroll; + } else { + return windowWidth; + } + }, + + /** + * Get the page's height. + * @method pageHeight + * @return {Number} Page height in pixels + * @sample Ink_Dom_Element_1_pageHeight.html + */ + pageHeight: function() { + var yScroll; + + if (window.innerHeight && window.scrollMaxY) { + yScroll = window.innerHeight + window.scrollMaxY; + } else if (document.body.scrollHeight > document.body.offsetHeight){ + yScroll = document.body.scrollHeight; + } else { + yScroll = document.body.offsetHeight; + } + + var windowHeight; + + if (window.self.innerHeight) { + windowHeight = window.self.innerHeight; + } else if (document.documentElement && document.documentElement.clientHeight) { + windowHeight = document.documentElement.clientHeight; + } else if (document.body) { + windowHeight = document.body.clientHeight; + } + + if(yScroll < windowHeight){ + return windowHeight; + } else { + return yScroll; + } + }, + + /** + * Get the viewport's width. + * @method viewportWidth + * @return {Number} Viewport width in pixels + * @sample Ink_Dom_Element_1_viewportWidth.html + */ + viewportWidth: function() { + if(typeof window.innerWidth !== "undefined") { + return window.innerWidth; + } + if (document.documentElement && typeof document.documentElement.offsetWidth !== "undefined") { + return document.documentElement.offsetWidth; + } + }, + + /** + * Get the viewport's height. + * @method viewportHeight + * @return {Number} Viewport height in pixels + * @sample Ink_Dom_Element_1_viewportHeight.html + */ + viewportHeight: function() { + if (typeof window.innerHeight !== "undefined") { + return window.innerHeight; + } + if (document.documentElement && typeof document.documentElement.offsetHeight !== "undefined") { + return document.documentElement.offsetHeight; + } + }, + + /** + * Get the scroll's width. + * @method scrollWidth + * @return {Number} Scroll width + */ + scrollWidth: function() { + if (typeof window.self.pageXOffset !== 'undefined') { + return window.self.pageXOffset; + } + if (typeof document.documentElement !== 'undefined' && typeof document.documentElement.scrollLeft !== 'undefined') { + return document.documentElement.scrollLeft; + } + return document.body.scrollLeft; + }, + + /** + * Get the scroll's height. + * @method scrollHeight + * @return {Number} Scroll height + */ + scrollHeight: function() { + if (typeof window.self.pageYOffset !== 'undefined') { + return window.self.pageYOffset; + } + if (typeof document.documentElement !== 'undefined' && typeof document.documentElement.scrollTop !== 'undefined') { + return document.documentElement.scrollTop; + } + return document.body.scrollTop; + } + }; + + return InkElement; + +}); + +/** + * Event management + * @module Ink.Dom.Event_1 + * @version 1 + */ + +Ink.createModule('Ink.Dom.Event', 1, [], function() { + /* jshint + asi:true, + strict:false, + laxcomma:true, + eqeqeq:false, + laxbreak:true, + boss:true, + curly:false, + expr:true + */ + + /** + * @namespace Ink.Dom.Event_1 + * @static + */ + + /*! + * Bean - copyright (c) Jacob Thornton 2011-2012 + * https://github.com/fat/bean + * MIT license + */ + var bean = (function (name, context, definition) { + return definition() + })('bean', this, function (name, context) { + name = name || 'bean' + context = context || this + + var win = window + , old = context[name] + , namespaceRegex = /[^\.]*(?=\..*)\.|.*/ + , nameRegex = /\..*/ + , addEvent = 'addEventListener' + , removeEvent = 'removeEventListener' + , doc = document || {} + , root = doc.documentElement || {} + , W3C_MODEL = root[addEvent] + , eventSupport = W3C_MODEL ? addEvent : 'attachEvent' + , ONE = {} // singleton for quick matching making add() do one() + + , slice = Array.prototype.slice + , str2arr = function (s, d) { return s.split(d || ' ') } + , isString = function (o) { return typeof o == 'string' } + , isFunction = function (o) { return typeof o == 'function' } + + // events that we consider to be 'native', anything not in this list will + // be treated as a custom event + , standardNativeEvents = + 'click dblclick mouseup mousedown contextmenu ' + // mouse buttons + 'mousewheel mousemultiwheel DOMMouseScroll ' + // mouse wheel + 'mouseover mouseout mousemove selectstart selectend ' + // mouse movement + 'keydown keypress keyup ' + // keyboard + 'orientationchange ' + // mobile + 'focus blur change reset select submit ' + // form elements + 'load unload beforeunload resize move DOMContentLoaded ' + // window + 'readystatechange message ' + // window + 'error abort scroll ' // misc + // element.fireEvent('onXYZ'... is not forgiving if we try to fire an event + // that doesn't actually exist, so make sure we only do these on newer browsers + , w3cNativeEvents = + 'show ' + // mouse buttons + 'input invalid ' + // form elements + 'touchstart touchmove touchend touchcancel ' + // touch + 'gesturestart gesturechange gestureend ' + // gesture + 'textinput' + // TextEvent + 'readystatechange pageshow pagehide popstate ' + // window + 'hashchange offline online ' + // window + 'afterprint beforeprint ' + // printing + 'dragstart dragenter dragover dragleave drag drop dragend ' + // dnd + 'loadstart progress suspend emptied stalled loadmetadata ' + // media + 'loadeddata canplay canplaythrough playing waiting seeking ' + // media + 'seeked ended durationchange timeupdate play pause ratechange ' + // media + 'volumechange cuechange ' + // media + 'checking noupdate downloading cached updateready obsolete ' // appcache + + // convert to a hash for quick lookups + , nativeEvents = (function (hash, events, i) { + for (i = 0; i < events.length; i++) events[i] && (hash[events[i]] = 1) + return hash + }({}, str2arr(standardNativeEvents + (W3C_MODEL ? w3cNativeEvents : '')))) + + // custom events are events that we *fake*, they are not provided natively but + // we can use native events to generate them + , customEvents = (function () { + var isAncestor = 'compareDocumentPosition' in root + ? function (element, container) { + return container.compareDocumentPosition && (container.compareDocumentPosition(element) & 16) === 16 + } + : 'contains' in root + ? function (element, container) { + container = container.nodeType === 9 || container === window ? root : container + return container !== element && container.contains(element) + } + : function (element, container) { + while (element = element.parentNode) if (element === container) return 1 + return 0 + } + , check = function (event) { + var related = event.relatedTarget + return !related + ? related == null + : (related !== this && related.prefix !== 'xul' && !/document/.test(this.toString()) + && !isAncestor(related, this)) + } + + return { + mouseenter: { base: 'mouseover', condition: check } + , mouseleave: { base: 'mouseout', condition: check } + , mousewheel: { base: /Firefox/.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel' } + } + }()) + + // we provide a consistent Event object across browsers by taking the actual DOM + // event object and generating a new one from its properties. + , Event = (function () { + // a whitelist of properties (for different event types) tells us what to check for and copy + var commonProps = str2arr('altKey attrChange attrName bubbles cancelable ctrlKey currentTarget ' + + 'detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey ' + + 'srcElement target timeStamp type view which propertyName') + , mouseProps = commonProps.concat(str2arr('button buttons clientX clientY dataTransfer ' + + 'fromElement offsetX offsetY pageX pageY screenX screenY toElement')) + , mouseWheelProps = mouseProps.concat(str2arr('wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ ' + + 'axis')) // 'axis' is FF specific + , keyProps = commonProps.concat(str2arr('char charCode key keyCode keyIdentifier ' + + 'keyLocation location')) + , textProps = commonProps.concat(str2arr('data')) + , touchProps = commonProps.concat(str2arr('touches targetTouches changedTouches scale rotation')) + , messageProps = commonProps.concat(str2arr('data origin source')) + , stateProps = commonProps.concat(str2arr('state')) + , overOutRegex = /over|out/ + // some event types need special handling and some need special properties, do that all here + , typeFixers = [ + { // key events + reg: /key/i + , fix: function (event, newEvent) { + newEvent.keyCode = event.keyCode || event.which + return keyProps + } + } + , { // mouse events + reg: /click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i + , fix: function (event, newEvent, type) { + newEvent.rightClick = event.which === 3 || event.button === 2 + newEvent.pos = { x: 0, y: 0 } + if (event.pageX || event.pageY) { + newEvent.clientX = event.pageX + newEvent.clientY = event.pageY + } else if (event.clientX || event.clientY) { + newEvent.clientX = event.clientX + doc.body.scrollLeft + root.scrollLeft + newEvent.clientY = event.clientY + doc.body.scrollTop + root.scrollTop + } + if (overOutRegex.test(type)) { + newEvent.relatedTarget = event.relatedTarget + || event[(type == 'mouseover' ? 'from' : 'to') + 'Element'] + } + return mouseProps + } + } + , { // mouse wheel events + reg: /mouse.*(wheel|scroll)/i + , fix: function () { return mouseWheelProps } + } + , { // TextEvent + reg: /^text/i + , fix: function () { return textProps } + } + , { // touch and gesture events + reg: /^touch|^gesture/i + , fix: function () { return touchProps } + } + , { // message events + reg: /^message$/i + , fix: function () { return messageProps } + } + , { // popstate events + reg: /^popstate$/i + , fix: function () { return stateProps } + } + , { // everything else + reg: /.*/ + , fix: function () { return commonProps } + } + ] + , typeFixerMap = {} // used to map event types to fixer functions (above), a basic cache mechanism + + , Event = function (event, element, isNative) { + if (!arguments.length) return + event = event || ((element.ownerDocument || element.document || element).parentWindow || win).event + this.originalEvent = event + this.isNative = isNative + this.isBean = true + + if (!event) return + + var type = event.type + , target = event.target || event.srcElement + , i, l, p, props, fixer + + this.target = target && target.nodeType === 3 ? target.parentNode : target + + if (isNative) { // we only need basic augmentation on custom events, the rest expensive & pointless + fixer = typeFixerMap[type] + if (!fixer) { // haven't encountered this event type before, map a fixer function for it + for (i = 0, l = typeFixers.length; i < l; i++) { + if (typeFixers[i].reg.test(type)) { // guaranteed to match at least one, last is .* + typeFixerMap[type] = fixer = typeFixers[i].fix + break + } + } + } + + props = fixer(event, this, type) + for (i = props.length; i--;) { + if (!((p = props[i]) in this) && p in event) this[p] = event[p] + } + } + } + + // preventDefault() and stopPropagation() are a consistent interface to those functions + // on the DOM, stop() is an alias for both of them together + Event.prototype.preventDefault = function () { + if (this.originalEvent.preventDefault) this.originalEvent.preventDefault() + else this.originalEvent.returnValue = false + } + Event.prototype.stopPropagation = function () { + if (this.originalEvent.stopPropagation) this.originalEvent.stopPropagation() + else this.originalEvent.cancelBubble = true + } + Event.prototype.stop = function () { + this.preventDefault() + this.stopPropagation() + this.stopped = true + } + // stopImmediatePropagation() has to be handled internally because we manage the event list for + // each element + // note that originalElement may be a Bean#Event object in some situations + Event.prototype.stopImmediatePropagation = function () { + if (this.originalEvent.stopImmediatePropagation) this.originalEvent.stopImmediatePropagation() + this.isImmediatePropagationStopped = function () { return true } + } + Event.prototype.isImmediatePropagationStopped = function () { + return this.originalEvent.isImmediatePropagationStopped && this.originalEvent.isImmediatePropagationStopped() + } + Event.prototype.clone = function (currentTarget) { + //TODO: this is ripe for optimisation, new events are *expensive* + // improving this will speed up delegated events + var ne = new Event(this, this.element, this.isNative) + ne.currentTarget = currentTarget + return ne + } + + return Event + }()) + + // if we're in old IE we can't do onpropertychange on doc or win so we use doc.documentElement for both + , targetElement = function (element, isNative) { + return !W3C_MODEL && !isNative && (element === doc || element === win) ? root : element + } + + /** + * Bean maintains an internal registry for event listeners. We don't touch elements, objects + * or functions to identify them, instead we store everything in the registry. + * Each event listener has a RegEntry object, we have one 'registry' for the whole instance. + */ + , RegEntry = (function () { + // each handler is wrapped so we can handle delegation and custom events + var wrappedHandler = function (element, fn, condition, args) { + var call = function (event, eargs) { + return fn.apply(element, args ? slice.call(eargs, event ? 0 : 1).concat(args) : eargs) + } + , findTarget = function (event, eventElement) { + return fn.__beanDel ? fn.__beanDel.ft(event.target, element) : eventElement + } + , handler = condition + ? function (event) { + var target = findTarget(event, this) // deleated event + if (condition.apply(target, arguments)) { + if (event) event.currentTarget = target + return call(event, arguments) + } + } + : function (event) { + if (fn.__beanDel) event = event.clone(findTarget(event)) // delegated event, fix the fix + return call(event, arguments) + } + handler.__beanDel = fn.__beanDel + return handler + } + + , RegEntry = function (element, type, handler, original, namespaces, args, root) { + var customType = customEvents[type] + , isNative + + if (type == 'unload') { + // self clean-up + handler = once(removeListener, element, type, handler, original) + } + + if (customType) { + if (customType.condition) { + handler = wrappedHandler(element, handler, customType.condition, args) + } + type = customType.base || type + } + + this.isNative = isNative = nativeEvents[type] && !!element[eventSupport] + this.customType = !W3C_MODEL && !isNative && type + this.element = element + this.type = type + this.original = original + this.namespaces = namespaces + this.eventType = W3C_MODEL || isNative ? type : 'propertychange' + this.target = targetElement(element, isNative) + this[eventSupport] = !!this.target[eventSupport] + this.root = root + this.handler = wrappedHandler(element, handler, null, args) + } + + // given a list of namespaces, is our entry in any of them? + RegEntry.prototype.inNamespaces = function (checkNamespaces) { + var i, j, c = 0 + if (!checkNamespaces) return true + if (!this.namespaces) return false + for (i = checkNamespaces.length; i--;) { + for (j = this.namespaces.length; j--;) { + if (checkNamespaces[i] == this.namespaces[j]) c++ + } + } + return checkNamespaces.length === c + } + + // match by element, original fn (opt), handler fn (opt) + RegEntry.prototype.matches = function (checkElement, checkOriginal, checkHandler) { + return this.element === checkElement && + (!checkOriginal || this.original === checkOriginal) && + (!checkHandler || this.handler === checkHandler) + } + + return RegEntry + }()) + + , registry = (function () { + // our map stores arrays by event type, just because it's better than storing + // everything in a single array. + // uses '$' as a prefix for the keys for safety and 'r' as a special prefix for + // rootListeners so we can look them up fast + var map = {} + + // generic functional search of our registry for matching listeners, + // `fn` returns false to break out of the loop + , forAll = function (element, type, original, handler, root, fn) { + var pfx = root ? 'r' : '$' + if (!type || type == '*') { + // search the whole registry + for (var t in map) { + if (t.charAt(0) == pfx) { + forAll(element, t.substr(1), original, handler, root, fn) + } + } + } else { + var i = 0, l, list = map[pfx + type], all = element == '*' + if (!list) return + for (l = list.length; i < l; i++) { + if ((all || list[i].matches(element, original, handler)) && !fn(list[i], list, i, type)) return + } + } + } + + , has = function (element, type, original, root) { + // we're not using forAll here simply because it's a bit slower and this + // needs to be fast + var i, list = map[(root ? 'r' : '$') + type] + if (list) { + for (i = list.length; i--;) { + if (!list[i].root && list[i].matches(element, original, null)) return true + } + } + return false + } + + , get = function (element, type, original, root) { + var entries = [] + forAll(element, type, original, null, root, function (entry) { + return entries.push(entry) + }) + return entries + } + + , put = function (entry) { + var has = !entry.root && !this.has(entry.element, entry.type, null, false) + , key = (entry.root ? 'r' : '$') + entry.type + ;(map[key] || (map[key] = [])).push(entry) + return has + } + + , del = function (entry) { + forAll(entry.element, entry.type, null, entry.handler, entry.root, function (entry, list, i) { + list.splice(i, 1) + entry.removed = true + if (list.length === 0) delete map[(entry.root ? 'r' : '$') + entry.type] + return false + }) + } + + // dump all entries, used for onunload + , entries = function () { + var t, entries = [] + for (t in map) { + if (t.charAt(0) == '$') entries = entries.concat(map[t]) + } + return entries + } + + return { has: has, get: get, put: put, del: del, entries: entries } + }()) + + // we need a selector engine for delegated events, use querySelectorAll if it exists + // but for older browsers we need Qwery, Sizzle or similar + , selectorEngine + , setSelectorEngine = function (e) { + if (!arguments.length) { + selectorEngine = doc.querySelectorAll + ? function (s, r) { + return r.querySelectorAll(s) + } + : function () { + throw new Error('Bean: No selector engine installed') // eeek + } + } else { + selectorEngine = e + } + } + + // we attach this listener to each DOM event that we need to listen to, only once + // per event type per DOM element + , rootListener = function (event, type) { + if (!W3C_MODEL && type && event && event.propertyName != '_on' + type) return + + var listeners = registry.get(this, type || event.type, null, false) + , l = listeners.length + , i = 0 + + event = new Event(event, this, true) + if (type) event.type = type + + // iterate through all handlers registered for this type, calling them unless they have + // been removed by a previous handler or stopImmediatePropagation() has been called + for (; i < l && !event.isImmediatePropagationStopped(); i++) { + if (!listeners[i].removed) listeners[i].handler.call(this, event) + } + } + + // add and remove listeners to DOM elements + , listener = W3C_MODEL + ? function (element, type, add) { + // new browsers + element[add ? addEvent : removeEvent](type, rootListener, false) + } + : function (element, type, add, custom) { + // IE8 and below, use attachEvent/detachEvent and we have to piggy-back propertychange events + // to simulate event bubbling etc. + var entry + if (add) { + registry.put(entry = new RegEntry( + element + , custom || type + , function (event) { // handler + rootListener.call(element, event, custom) + } + , rootListener + , null + , null + , true // is root + )) + if (custom && element['_on' + custom] == null) element['_on' + custom] = 0 + entry.target.attachEvent('on' + entry.eventType, entry.handler) + } else { + entry = registry.get(element, custom || type, rootListener, true)[0] + if (entry) { + entry.target.detachEvent('on' + entry.eventType, entry.handler) + registry.del(entry) + } + } + } + + , once = function (rm, element, type, fn, originalFn) { + // wrap the handler in a handler that does a remove as well + return function () { + fn.apply(this, arguments) + rm(element, type, originalFn) + } + } + + , removeListener = function (element, orgType, handler, namespaces) { + var type = orgType && orgType.replace(nameRegex, '') + , handlers = registry.get(element, type, null, false) + , removed = {} + , i, l + + for (i = 0, l = handlers.length; i < l; i++) { + if ((!handler || handlers[i].original === handler) && handlers[i].inNamespaces(namespaces)) { + // TODO: this is problematic, we have a registry.get() and registry.del() that + // both do registry searches so we waste cycles doing this. Needs to be rolled into + // a single registry.forAll(fn) that removes while finding, but the catch is that + // we'll be splicing the arrays that we're iterating over. Needs extra tests to + // make sure we don't screw it up. @rvagg + registry.del(handlers[i]) + if (!removed[handlers[i].eventType] && handlers[i][eventSupport]) + removed[handlers[i].eventType] = { t: handlers[i].eventType, c: handlers[i].type } + } + } + // check each type/element for removed listeners and remove the rootListener where it's no longer needed + for (i in removed) { + if (!registry.has(element, removed[i].t, null, false)) { + // last listener of this type, remove the rootListener + listener(element, removed[i].t, false, removed[i].c) + } + } + } + + // set up a delegate helper using the given selector, wrap the handler function + , delegate = function (selector, fn) { + //TODO: findTarget (therefore $) is called twice, once for match and once for + // setting e.currentTarget, fix this so it's only needed once + var findTarget = function (target, root) { + var i, array = isString(selector) ? selectorEngine(selector, root) : selector + for (; target && target !== root; target = target.parentNode) { + for (i = array.length; i--;) { + if (array[i] === target) return target + } + } + } + , handler = function (e) { + var match = findTarget(e.target, this) + if (match) fn.apply(match, arguments) + } + + // __beanDel isn't pleasant but it's a private function, not exposed outside of Bean + handler.__beanDel = { + ft : findTarget // attach it here for customEvents to use too + , selector : selector + } + return handler + } + + , fireListener = W3C_MODEL ? function (isNative, type, element) { + // modern browsers, do a proper dispatchEvent() + var evt = doc.createEvent(isNative ? 'HTMLEvents' : 'UIEvents') + evt[isNative ? 'initEvent' : 'initUIEvent'](type, true, true, win, 1) + element.dispatchEvent(evt) + } : function (isNative, type, element) { + // old browser use onpropertychange, just increment a custom property to trigger the event + element = targetElement(element, isNative) + isNative ? element.fireEvent('on' + type, doc.createEventObject()) : element['_on' + type]++ + } + + /** + * Public API: off(), on(), add(), (remove()), one(), fire(), clone() + */ + + /** + * off(element[, eventType(s)[, handler ]]) + */ + , off = function (element, typeSpec, fn) { + var isTypeStr = isString(typeSpec) + , k, type, namespaces, i + + if (isTypeStr && typeSpec.indexOf(' ') > 0) { + // off(el, 't1 t2 t3', fn) or off(el, 't1 t2 t3') + typeSpec = str2arr(typeSpec) + for (i = typeSpec.length; i--;) + off(element, typeSpec[i], fn) + return element + } + + type = isTypeStr && typeSpec.replace(nameRegex, '') + if (type && customEvents[type]) type = customEvents[type].base + + if (!typeSpec || isTypeStr) { + // off(el) or off(el, t1.ns) or off(el, .ns) or off(el, .ns1.ns2.ns3) + if (namespaces = isTypeStr && typeSpec.replace(namespaceRegex, '')) namespaces = str2arr(namespaces, '.') + removeListener(element, type, fn, namespaces) + } else if (isFunction(typeSpec)) { + // off(el, fn) + removeListener(element, null, typeSpec) + } else { + // off(el, { t1: fn1, t2, fn2 }) + for (k in typeSpec) { + if (typeSpec.hasOwnProperty(k)) off(element, k, typeSpec[k]) + } + } + + return element + } + + /** + * on(element, eventType(s)[, selector], handler[, args ]) + */ + , on = function(element, events, selector, fn) { + var originalFn, type, types, i, args, entry, first + + //TODO: the undefined check means you can't pass an 'args' argument, fix this perhaps? + if (selector === undefined && typeof events == 'object') { + //TODO: this can't handle delegated events + for (type in events) { + if (events.hasOwnProperty(type)) { + on.call(this, element, type, events[type]) + } + } + return + } + + if (!isFunction(selector)) { + // delegated event + originalFn = fn + args = slice.call(arguments, 4) + fn = delegate(selector, originalFn, selectorEngine) + } else { + args = slice.call(arguments, 3) + fn = originalFn = selector + } + + types = str2arr(events) + + // special case for one(), wrap in a self-removing handler + if (this === ONE) { + fn = once(off, element, events, fn, originalFn) + } + + for (i = types.length; i--;) { + // add new handler to the registry and check if it's the first for this element/type + first = registry.put(entry = new RegEntry( + element + , types[i].replace(nameRegex, '') // event type + , fn + , originalFn + , str2arr(types[i].replace(namespaceRegex, ''), '.') // namespaces + , args + , false // not root + )) + if (entry[eventSupport] && first) { + // first event of this type on this element, add root listener + listener(element, entry.eventType, true, entry.customType) + } + } + + return element + } + + /** + * add(element[, selector], eventType(s), handler[, args ]) + * + * Deprecated: kept (for now) for backward-compatibility + */ + , add = function (element, events, fn, delfn) { + return on.apply( + null + , !isString(fn) + ? slice.call(arguments) + : [ element, fn, events, delfn ].concat(arguments.length > 3 ? slice.call(arguments, 5) : []) + ) + } + + /** + * one(element, eventType(s)[, selector], handler[, args ]) + */ + , one = function () { + return on.apply(ONE, arguments) + } + + /** + * fire(element, eventType(s)[, args ]) + * + * The optional 'args' argument must be an array, if no 'args' argument is provided + * then we can use the browser's DOM event system, otherwise we trigger handlers manually + */ + , fire = function (element, type, args) { + var types = str2arr(type) + , i, j, l, names, handlers + + for (i = types.length; i--;) { + type = types[i].replace(nameRegex, '') + if (names = types[i].replace(namespaceRegex, '')) names = str2arr(names, '.') + if (!names && !args && element[eventSupport]) { + fireListener(nativeEvents[type], type, element) + } else { + // non-native event, either because of a namespace, arguments or a non DOM element + // iterate over all listeners and manually 'fire' + handlers = registry.get(element, type, null, false) + args = [false].concat(args) + for (j = 0, l = handlers.length; j < l; j++) { + if (handlers[j].inNamespaces(names)) { + handlers[j].handler.apply(element, args) + } + } + } + } + return element + } + + /** + * clone(dstElement, srcElement[, eventType ]) + * + * TODO: perhaps for consistency we should allow the same flexibility in type specifiers? + */ + , clone = function (element, from, type) { + var handlers = registry.get(from, type, null, false) + , l = handlers.length + , i = 0 + , args, beanDel + + for (; i < l; i++) { + if (handlers[i].original) { + args = [ element, handlers[i].type ] + if (beanDel = handlers[i].handler.__beanDel) args.push(beanDel.selector) + args.push(handlers[i].original) + on.apply(null, args) + } + } + return element + } + + , bean = { + 'on' : on + , 'add' : add + , 'one' : one + , 'off' : off + , 'remove' : off + , 'clone' : clone + , 'fire' : fire + , 'Event' : Event + , 'setSelectorEngine' : setSelectorEngine + , 'noConflict' : function () { + context[name] = old + return this + } + } + + // for IE, clean up on unload to avoid leaks + if (win.attachEvent) { + var cleanup = function () { + var i, entries = registry.entries() + for (i in entries) { + if (entries[i].type && entries[i].type !== 'unload') off(entries[i].element, entries[i].type) + } + win.detachEvent('onunload', cleanup) + win.CollectGarbage && win.CollectGarbage() + } + win.attachEvent('onunload', cleanup) + } + + // initialize selector engine to internal default (qSA or throw Error) + setSelectorEngine(Ink.ss) + + return bean + }); + + /** + * Keep this declaration here and off Bean as it extends the Event + * object and some properties are readonly in strict mode + */ + 'use strict'; + + var InkEvent = { + + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_SPACE: 32, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + KEY_HOME: 36, + KEY_END: 35, + KEY_PAGEUP: 33, + KEY_PAGEDOWN: 34, + KEY_INSERT: 45, + + /** + * Creates a debounced version of a function. + * Returns a function which calls `func`, waiting at least `wait` milliseconds between calls. This is useful for events such as `scroll` or `resize`, which can be triggered too many times per second, slowing down the browser with needless function calls. + * + * *note:* This does not delay the first function call to the function. + * + * @method throttle + * @param {Function} func Function to call. Arguments and context are both passed. + * @param {Number} [wait]=0 Milliseconds to wait between calls. + * @sample Ink_Dom_Event_1_throttle.html + **/ + throttle: function (func, wait) { + wait = wait || 0; + var lastCall = 0; // Warning: This breaks on Jan 1st 1970 0:00 + var timeout; + var throttled = function () { + var now = +new Date(); + var timeDiff = now - lastCall; + if (timeDiff >= wait) { + lastCall = now; + return func.apply(this, [].slice.call(arguments)); + } else { + var that = this; + var args = [].slice.call(arguments); + if (!timeout) { + timeout = setTimeout(function () { + timeout = null; + return throttled.apply(that, args); + }, wait - timeDiff); + } + } + }; + return throttled; + }, + + /** + * Gets the event's target element. + * + * @method element + * @param {Object} ev Event object + * @return {DOMNode} The target + * @sample Ink_Dom_Event_1_element.html + */ + element: function(ev) { + var node = ev.delegationTarget || + ev.target || + // IE stuff + (ev.type === 'mouseout' && ev.fromElement) || + (ev.type === 'mouseleave' && ev.fromElement) || + (ev.type === 'mouseover' && ev.toElement) || + (ev.type === 'mouseenter' && ev.toElement) || + ev.srcElement || + null; + return node && (node.nodeType === 3 || node.nodeType === 4) ? node.parentNode : node; + }, + + /** + * Gets the event's related target element. + * + * @method relatedTarget + * @param {Object} ev event object + * @return {DOMNode} The related target + * @sample Ink_Dom_Event_1_relatedTarget.html + */ + relatedTarget: function(ev){ + var node = ev.relatedTarget || + // IE stuff + (ev.type === 'mouseout' && ev.toElement) || + (ev.type === 'mouseleave' && ev.toElement) || + (ev.type === 'mouseover' && ev.fromElement) || + (ev.type === 'mouseenter' && ev.fromElement) || + null; + return node && (node.nodeType === 3 || node.nodeType === 4) ? node.parentNode : node; + }, + + /** + * Find closest ancestor element by tag name related to the event target. + * Navigate up the DOM tree, looking for a tag with the name `elmTagName`. + * + * If such tag is not found, `document` is returned. + * + * @method findElement + * @param {Object} ev Event object + * @param {String} elmTagName Tag name to find + * @param {Boolean} [force]=false Flag to skip returning `document` and to return `false` instead. + * @return {DOMElement} the first element which matches given tag name or the document element if the wanted tag is not found + * @sample Ink_Dom_Event_1_findElement.html + */ + findElement: function(ev, elmTagName, force) + { + var node = this.element(ev); + while(true) { + if(node.nodeName.toLowerCase() === elmTagName.toLowerCase()) { + return node; + } else { + node = node.parentNode; + if(!node) { + if(force) { + return false; + } + return document; + } + if(!node.parentNode){ + if(force){ return false; } + return document; + } + } + } + }, + + /** + * Attaches an event to element + * + * @method observe + * @param {DOMElement|String} element Element id or element + * @param {String} eventName Event name + * @param {Function} callBack Receives the event object as a parameter. If you're manually firing custom events, check it's eventName property to make sure you're handling the right event. + * @param {Boolean} [useCapture] Flag to change event listening from bubbling to capture. + * @return {Function} The event handler used. Hang on to this if you want to `stopObserving` later. + * @sample Ink_Dom_Event_1_observe.html + */ + observe: function(element, eventName, callBack, useCapture) { + element = Ink.i(element); + if(element) { + if(element.addEventListener) { + element.addEventListener(eventName, callBack, !!useCapture); + } else { + element.attachEvent('on' + eventName, (callBack = Ink.bind(callBack, element))); + } + return callBack; + } + }, + + /** + * Like observe, but listen to the event only once. + * + * @method observeOnce + * @param {DOMElement|String} element Element id or element + * @param {String} eventName Event name + * @param {Function} callBack Receives the event object as a parameter. If you're manually firing custom events, check it's eventName property to make sure you're handling the right event. + * @param {Boolean} [useCapture] Flag to change event listening from bubbling to capture. + * @return {Function} The event handler used. Hang on to this if you want to `stopObserving` later. + * @sample Ink_Dom_Event_1_observeOnce.html + */ + observeOnce: function (element, eventName, callBack, useCapture) { + var onceBack = function () { + InkEvent.stopObserving(element, eventName, onceBack); + return callBack(); + }; + return InkEvent.observe(element, eventName, onceBack, useCapture); + }, + + /** + * Attaches an event to a selector or array of elements. + * + * @method observeMulti + * @param {Array|String} elements + * @param {String} eventName Event name + * @param {Function} callBack Receives the event object as a parameter. If you're manually firing custom events, check it's eventName property to make sure you're handling the right event. + * @param {Boolean} [useCapture] Flag change event listening from bubbling to capture. + * @return {Function} The used callback. + * @sample Ink_Dom_Event_1_observeMulti.html + */ + observeMulti: function (elements, eventName, callBack, useCapture) { + if (typeof elements === 'string') { + elements = Ink.ss(elements); + } else if ( /* is an element */ elements && elements.nodeType === 1) { + elements = [elements]; + } + if (!elements[0]) { return false; } + + for (var i = 0, len = elements.length; i < len; i++) { + this.observe(elements[i], eventName, callBack, useCapture); + } + return callBack; + }, + + /** + * Observes an event on an element and its descendants matching the selector. + * + * Requires Ink.Dom.Selector if you need to use a selector. + * + * @method observeDelegated + * @param {DOMElement|String} element Element to observe. + * @param {String} eventName Event name to observe. + * @param {String} selector Child element selector. When null, finds any element. + * @param {Function} callback Callback to be called when the event is fired + * @return {Function} The used callback, for ceasing to listen to the event later. + * @sample Ink_Dom_Event_1_observeDelegated.html + **/ + observeDelegated: function (element, eventName, selector, callback) { + return InkEvent.observe(element, eventName, function (event) { + var fromElement = InkEvent.element(event); + if (!fromElement || fromElement === element) { return; } + + var cursor = fromElement; + + // Go up the document tree until we hit the element itself. + while (cursor !== element && cursor !== document && cursor) { + if (Ink.Dom.Selector_1.matchesSelector(cursor, selector)) { + event.delegationTarget = cursor; + return callback(event); + } + cursor = cursor.parentNode; + } + }); + }, + + /** + * Removes an event attached to an element. + * + * @method stopObserving + * @param {DOMElement|String} element Element id or element + * @param {String} eventName Event name + * @param {Function} callBack Callback function + * @param {Boolean} [useCapture] Set to true if the event was being observed with useCapture set to true as well. + * @sample Ink_Dom_Event_1_stopObserving.html + */ + stopObserving: function(element, eventName, callBack, useCapture) { + element = Ink.i(element); + + if(element) { + if(element.removeEventListener) { + element.removeEventListener(eventName, callBack, !!useCapture); + } else { + element.detachEvent('on' + eventName, callBack); + } + } + }, + + /** + * Stops event propagation and bubbling. + * + * @method stop + * @param {Object} event Event handle + * @sample Ink_Dom_Event_1_stop.html + */ + stop: function(event) + { + if(event.cancelBubble !== null) { + event.cancelBubble = true; + } + if(event.stopPropagation) { + event.stopPropagation(); + } + if(event.preventDefault) { + event.preventDefault(); + } + if(window.attachEvent) { + event.returnValue = false; + } + if(event.cancel !== null) { + event.cancel = true; + } + }, + + /** + * Stops event propagation. + * + * @method stopPropagation + * @param {Object} event Event handle + * @sample Ink_Dom_Event_1_stopPropagation.html + */ + stopPropagation: function(event) { + if(event.cancelBubble !== null) { + event.cancelBubble = true; + } + if(event.stopPropagation) { + event.stopPropagation(); + } + }, + + /** + * Stops event default behaviour. + * + * @method stopDefault + * @param {Object} event Event handle + * @sample Ink_Dom_Event_1_stopDefault.html + */ + stopDefault: function(event) + { + if(event.preventDefault) { + event.preventDefault(); + } + if(window.attachEvent) { + event.returnValue = false; + } + if(event.cancel !== null) { + event.cancel = true; + } + }, + + /** + * Gets the pointer's coordinates from the event object. + * + * @method pointer + * @param {Object} ev Event object + * @return {Object} An object with the mouse X and Y position + * @sample Ink_Dom_Event_1_pointer.html + */ + pointer: function(ev) + { + return { + x: this.pointerX(ev), + y: this.pointerY(ev) + }; + }, + + /** + * Gets the pointer's X coordinate. + * + * @method pointerX + * @param {Object} ev Event object + * @return {Number} Mouse X position + */ + pointerX: function(ev) + { + return (ev.touches && ev.touches[0] && ev.touches[0].clientX) || + (ev.pageX) || + (ev.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)); + }, + + /** + * Gets the pointer's Y coordinate. + * + * @method pointerY + * @param {Object} ev Event object + * @return {Number} Mouse Y position + */ + pointerY: function(ev) + { + return (ev.touches && ev.touches[0] && ev.touches[0].clientY) || + (ev.pageY) || + (ev.clientY + (document.documentElement.scrollTop || document.body.scrollTop)); + }, + + /** + * Checks if an event is a left click. + * + * @method isLeftClick + * @param {Object} ev Event object + * @return {Boolean} True if the event is a left click + * @sample Ink_Dom_Event_1_isLeftClick.html + */ + isLeftClick: function(ev) { + if (window.addEventListener) { + if(ev.button === 0){ + return true; + } else if(ev.type === 'touchend' && ev.button === null){ + // [todo] do the above check for pointerEvents too + return true; + } + } + else { + if(ev.button === 1){ return true; } + } + return false; + }, + + /** + * Checks if an event is a right click. + * + * @method isRightClick + * @param {Object} ev Event object + * @return {Boolean} True if the event is a right click + * @sample Ink_Dom_Event_1_isRightClick.html + */ + isRightClick: function(ev) { + return (ev.button === 2); + }, + + /** + * Checks if an event is a middle click. + * + * @method isMiddleClick + * @param {Object} ev Event object + * @return {Boolean} True if the event is a middle click + * @sample Ink_Dom_Event_1_isMiddleClick.html + */ + isMiddleClick: function(ev) { + if (window.addEventListener) { + return (ev.button === 1); + } + else { + return (ev.button === 4); + } + return false; + }, + + /** + * Gets character from an event. + * + * @method getCharFromKeyboardEvent + * @param {Object} event Keyboard event + * @param {Boolean} [changeCasing] If true uppercases, if false lowercases, otherwise keeps casing + * @return {String} Character representation of pressed key combination + * @sample Ink_Dom_Event_1_getCharFromKeyboardEvent.html + */ + getCharFromKeyboardEvent: function(event, changeCasing) { + var k = event.keyCode; + var c = String.fromCharCode(k); + + var shiftOn = event.shiftKey; + if (k >= 65 && k <= 90) { // A-Z + if (typeof changeCasing === 'boolean') { + shiftOn = changeCasing; + } + return (shiftOn) ? c : c.toLowerCase(); + } + else if (k >= 96 && k <= 105) { // numpad digits + return String.fromCharCode( 48 + (k-96) ); + } + switch (k) { + case 109: case 189: return '-'; + case 107: case 187: return '+'; + } + return c; + }, + + debug: function(){} +}; + +/** + * Lets you attach event listeners to both elements and objects. + * http://github.com/fat/bean#on + * + * @method on + * @param {DOMElement|Object} element An HTML DOM element or any JavaScript Object + * @param {String} eventType An Event (or multiple events, space separated) to listen to + * @param {String} [selector] A CSS DOM Element selector string to bind the listener to child elements matching the selector + * @param {Function} [handler] The callback function + * @param {Object} [args...] Additional arguments to pass to the callback function when triggered + * + * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object + * @sample Ink_Dom_Event_1_on.html + */ + +/** + * Alias for `on` but will only be executed once. + * bean.one() is an alias for bean.on() except that the handler will only be executed once and then removed for the event type(s). + * http://github.com/fat/bean#one + * + * @method one + * @param {DOMElement|Object} element An HTML DOM element or any JavaScript Object + * @param {String} eventType An Event (or multiple events, space separated) to listen to + * @param {String} [selector] A CSS DOM Element selector string to bind the listener to child elements matching the selector + * @param {Function} [handler] The callback function + * @param [args...] Additional arguments to pass to the callback function when triggered + * + * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object + * @sample Ink_Dom_Event_1_one.html + */ + +/** + * Removes event handlers. + * bean.off() is how you get rid of handlers once you no longer want them active. It's also a good idea to call off on elements before you remove them from your DOM; this gives Bean a chance to clean up some things and prevents memory leaks. + * http://github.com/fat/bean#off + * + * @method off + * @param {DOMElement|Object} element An HTML DOM element or any JavaScript Object + * @param {String} eventType An Event (or multiple events, space separated) to remove + * @param {Function} [handler] The specific callback function to remove + * + * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object + * @sample Ink_Dom_Event_1_off.html + */ + +/** + * Clones events from one object to another + * bean.clone() is a method for cloning events from one DOM element or object to another. + * http://github.com/fat/bean#clone + * + * @method clone + * @param {DOMElement|Object} destElement An HTML DOM element or any JavaScript Object to copy events to + * @param {String} srcElement An HTML DOM element or any JavaScript Object to copy events from + * @param {String} [eventType] An Event (or multiple events, space separated) to clone + * + * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object + * @sample Ink_Dom_Event_1_clone.html + */ + +/** + * Triggers events. + * http://github.com/fat/bean#fire + * + * @method fire + * @param {DOMElement|Object} destElement An HTML DOM element or any JavaScript Object fire the event on + * @param {String} eventType An Event (or multiple events, space separated) to fire + * @param [args...] Additional arguments to pass to the callback function when triggered + * + * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object + * @sample Ink_Dom_Event_1_fire.html + */ + +return Ink.extendObj(InkEvent, bean); + +}); + +/** + * @module Ink.Dom.FormSerialize_1 + * Two way serialization of form data and javascript objects. + * Valid applications are ad hoc AJAX/syndicated submission of forms, restoring form values from server side state, etc. + */ + +Ink.createModule('Ink.Dom.FormSerialize', 1, ['Ink.Util.Array_1', 'Ink.Dom.Element_1', 'Ink.Dom.Selector_1'], function (InkArray, InkElement, Selector) { + 'use strict'; + + // Check whether something is not a string or a DOM element, but still has length. + function isArrayIsh(obj) { + return obj != null && + (!InkElement.isDOMElement(obj)) && + (InkArray.isArray(obj) || (typeof obj !== 'string' && typeof obj.length === 'number')); + } + + function toArray(obj) { + if (isArrayIsh(obj)) { return obj; } + else { return [obj]; } + } + + /** + * @namespace Ink.Dom.FormSerialize + * @static + **/ + var FormSerialize = { + + /** + * Serializes a form element into a JS object + * It turns field names into keys and field values into values. + * + * note: Multi-select and checkboxes with multiple values will result in arrays + * + * @method serialize + * @param {DOMElement|String} form Form element to extract data + * @return {Object} Map of fieldName -> String|String[]|Boolean + * @sample Ink_Dom_FormSerialize_serialize.html + */ + serialize: function(form) { + var out = {}; + var emptyArrayToken = {}; // A hack so that empty select[multiple] elements appear although empty. + + var pairs = this.asPairs(form, { elements: true, emptyArray: emptyArrayToken }); + if (pairs == null) { return pairs; } + InkArray.forEach(pairs, function (pair) { + var name = pair[0].replace(/\[\]$/, ''); + var value = pair[1]; + var el = pair[2]; + + if (value === emptyArrayToken) { + out[name] = []; // It's an empty select[multiple] + } else if (!(FormSerialize._resultsInArray(el) || /\[\]$/.test(pair[0]))) { + out[name] = value; + } else { + out[name] = out[name] || []; + out[name].push(value); + } + }); + + return out; + }, + + /** + * Like `serialize`, but returns an array of [fieldName, value] pairs. + * + * @method asPairs + * @param {DOMElement|String} form Form element + * @param {Object} [options] Options object, containing: + * @param {Boolean} [options.elements] Instead of returning an array of [fieldName, value] pairs, return an array of [fieldName, value, fieldElement] triples. + * @param {Boolean} [options.emptyArray] What to emit as the value of an empty select[multiple]. If you don't pass this option, nothing comes out. + * + * @return Array of [fieldName, value] pairs. + **/ + asPairs: function (form, options) { + var out = []; + options = options || {}; + + function emit(name, val, el) { + if (options.elements) { + out.push([name, val, el]); + } else { + out.push([name, val]); + } + } + + function serializeEl(el) { + if (el.nodeName.toLowerCase() === 'select' && el.multiple) { + var didEmit = false; + InkArray.forEach(Selector.select('option:checked', el), function (thisOption) { + emit(el.name, thisOption.value, el); + didEmit = true; + }); + if (!didEmit && 'emptyArray' in options) { + emit(el.name, options.emptyArray, el); + } + } else { + emit(el.name, el.value, el); + } + } + + if ((form = Ink.i(form))) { + var inputs = InkArray.filter(form.elements, FormSerialize._isSerialized); + for (var i = 0, len = inputs.length; i < len; i++) { + serializeEl(inputs[i]); + } + return out; + } + + return null; + }, + + /** + * Sets form elements' values with values from an object + * + * Note: You can't set the values of an input with `type="file"` (browser prohibits it) + * + * @method fillIn + * @param {DOMElement|String} form Form element to be populated + * @param {Object|Array} map2 mapping of fields to values contained in fields. Can be a hash (keys as names, strings or arrays for values), or an array of [name, value] pairs. + * @sample Ink_Dom_FormSerialize_fillIn.html + */ + fillIn: function(form, map2) { + if (!(form = Ink.i(form))) { return null; } + + var pairs; + + if (typeof map2 === 'object' && !isArrayIsh(map2)) { + pairs = FormSerialize._objToPairs(map2); + } else if (isArrayIsh(map2)) { + pairs = map2; + } else { + return null; + } + + return FormSerialize._fillInPairs(form, pairs); + }, + + _objToPairs: function (obj) { + var pairs = []; + var val; + for (var name in obj) if (obj.hasOwnProperty(name)) { + val = toArray(obj[name]); + for (var i = 0, len = val.length; i < len; i++) { + pairs.push([name, val[i]]); + } + if (len === 0) { + pairs.push([name, []]); + } + } + return pairs; + }, + + _fillInPairs: function (form, pairs) { + pairs = InkArray.groupBy(pairs, { + key: function (pair) { return pair[0].replace(/\[\]$/, ''); } + }); + + // For each chunk... + pairs = InkArray.map(pairs, function (pair) { + // Join the items in the chunk by concatenating the values together and leaving the names alone + var values = InkArray.reduce(pair, function (left, right) { + return [null, left[1].concat([right[1]])]; + }, [null, []])[1]; + return [pair[0][0], values]; + }); + + var name; + var inputs; + var values; + for (var i = 0, len = pairs.length; i < len; i++) { + name = pairs[i][0]; + + if (name in form) { + inputs = form[name]; + } else if ((name + '[]') in form) { + inputs = form[name + '[]']; + name = name + '[]'; + } else { + continue; + } + + inputs = toArray(inputs); + values = pairs[i][1]; + + FormSerialize._fillInOne(name, inputs, values); + } + }, + + _fillInOne: function (name, inputs, values) { + var firstOne = inputs[0]; + var firstNodeName = firstOne.nodeName.toLowerCase(); + var firstType = firstOne.getAttribute('type'); + firstType = firstType && firstType.toLowerCase(); + var isSelectMulti = firstNodeName === 'select' && InkElement.hasAttribute(firstOne, 'multiple'); + + if (firstType === 'checkbox' || firstType === 'radio') { + FormSerialize._fillInBoolean(inputs, values, 'checked'); + } else if (isSelectMulti) { + FormSerialize._fillInBoolean(inputs[0].options, values, 'selected'); + } else { + if (inputs.length !== values.length) { + Ink.warn('Form had ' + inputs.length + ' inputs named "' + name + '", but received ' + values.length + ' values.'); + } + + for (var i = 0, len = Math.min(inputs.length, values.length); i < len; i += 1) { + inputs[i].value = values[i]; + } + } + }, + + _fillInBoolean: function (inputs, values, checkAttr /* 'selected' or 'checked' */) { + InkArray.forEach(inputs, function (input) { + var isChecked = InkArray.inArray(input.value, values); + input[checkAttr] = isChecked; + }); + }, + + /** + * Whether FormSerialize.serialize() should produce an array when looking at this element. + * @method _resultsInArray + * @private + * @param element + **/ + _resultsInArray: function (element) { + var type = element.getAttribute('type'); + var nodeName = element.nodeName.toLowerCase(); + + return type === 'checkbox' || + (nodeName === 'select' && InkElement.hasAttribute(element, 'multiple')); + }, + + _isSerialized: function (element) { + if (!InkElement.isDOMElement(element)) { return false; } + if (!InkElement.hasAttribute(element, 'name')) { return false; } + + var nodeName = element.nodeName.toLowerCase(); + + if (!nodeName || nodeName === 'fieldset') { return false; } + + if (element.type === 'checkbox' || element.type === 'radio') { + return !!element.checked; + } + + return true; + } + }; + + return FormSerialize; +}); + +/** + * Execute code only when the DOM is loaded. + * @module Ink.Dom.Loaded_1 + * @version 1 + */ + +Ink.createModule('Ink.Dom.Loaded', 1, [], function() { + + 'use strict'; + + /** + * @namespace Ink.Dom.Loaded_1 + **/ + var Loaded = { + + /** + * Callbacks and their contexts. Array of 2-arrays. + * + * [] + * + * @attribute _contexts Array + * @private + * + */ + _contexts: [], // Callbacks' queue + + /** + * Specify a function to execute when the DOM is fully loaded. + * + * @method run + * @param {Object} [win]=window Window object to attach/add the event + * @param {Function} fn Callback function to be executed after the DOM is ready + * @public + * @sample Ink_Dom_Loaded_run.html + */ + run: function(win, fn) { + if (!fn) { + fn = win; + win = window; + } + + var context; + + for (var i = 0, len = this._contexts.length; i < len; i++) { + if (this._contexts[i][0] === win) { + context = this._contexts[i][1]; + break; + } + } + if (!context) { + context = { + cbQueue: [], + win: win, + doc: win.document, + root: win.document.documentElement, + done: false, + top: true + }; + context.handlers = { + checkState: Ink.bindEvent(this._checkState, this, context), + poll: Ink.bind(this._poll, this, context) + }; + this._contexts.push( + [win, context] // Javascript Objects cannot map different windows to + // different values. + ); + } + + var ael = context.doc.addEventListener; + context.add = ael ? 'addEventListener' : 'attachEvent'; + context.rem = ael ? 'removeEventListener' : 'detachEvent'; + context.pre = ael ? '' : 'on'; + context.det = ael ? 'DOMContentLoaded' : 'onreadystatechange'; + context.wet = context.pre + 'load'; + + var csf = context.handlers.checkState; + var alreadyLoaded = ( + /complete|interactive|loaded/.test(context.doc.readyState) && + context.win.location.toString() !== 'about:blank'); // https://code.google.com/p/chromium/issues/detail?id=32357 + + if (alreadyLoaded){ + setTimeout(Ink.bind(function () { + fn.call(context.win, 'lazy'); + }, this), 0); + } else { + context.cbQueue.push(fn); + + context.doc[context.add]( context.det , csf ); + context.win[context.add]( context.wet , csf ); + + var frameElement = 1; + try{ + frameElement = context.win.frameElement; + } catch(e) {} + if ( !ael && context.root && context.root.doScroll ) { // IE HACK + try { + context.top = !frameElement; + } catch(e) { } + if (context.top) { + this._poll(context); + } + } + } + }, + + /** + * Function that will be running the callbacks after the page is loaded + * + * @method _checkState + * @param {Event} event Triggered event + * @private + */ + _checkState: function(event, context) { + if ( !event || (event.type === 'readystatechange' && context.doc.readyState !== 'complete')) { + return; + } + var where = (event.type === 'load') ? context.win : context.doc; + where[context.rem](context.pre+event.type, context.handlers.checkState, false); + this._ready(context); + }, + + /** + * Polls the load progress of the page to see if it has already loaded or not + * + * @method _poll + * @private + */ + + /** + * + * function _poll + */ + _poll: function(context) { + try { + context.root.doScroll('left'); + } catch(e) { + return setTimeout(context.handlers.poll, 50); + } + this._ready(context); + }, + + /** + * Function that runs the callbacks from the queue when the document is ready. + * + * @method _ready + * @private + */ + _ready: function(context) { + if (!context.done) { + context.done = true; + for (var i = 0; i < context.cbQueue.length; ++i) { + context.cbQueue[i].call(context.win); + } + context.cbQueue = []; + } + } + }; + + return Loaded; + +}); + +/** + * CSS selector engine + * @module Ink.Dom.Selector_1 + * @version 1 + */ + +Ink.createModule('Ink.Dom.Selector', 1, [], function() { + /*jshint forin:false, eqnull:true, noempty:false, expr:true, boss:true, maxdepth:false*/ + 'use strict'; + +/*! + * Sizzle CSS Selector Engine + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license + * http://sizzlejs.com/ + */ + +var i, + cachedruns, + Expr, + getText, + isXML, + compile, + outermostContext, + recompare, + sortInput, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + -(new Date()), + preferredDoc = window.document, + support = {}, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + hasDuplicate = false, + sortOrder = function() { return 0; }, + + // General-purpose constants + strundefined = typeof undefined, + MAX_NEGATIVE = 1 << 31, + + // Array methods + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf if we can't use a native one + indexOf = arr.indexOf || function( elem ) { + var i = 0, + len = this.length; + for ( ; i < len; i++ ) { + if ( this[i] === elem ) { + return i; + } + } + return -1; + }, + + + // Regular expressions + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + operators = "([*^$|!~]?=)", + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", + + // Prefer arguments quoted, + // then not containing pseudos/brackets, + // then attribute selectors/non-parenthetical expressions, + // then anything else + // These preferences are here to reduce the number of selectors + // needing tokenize in the PSEUDO preFilter + pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rsibling = /[\x20\t\r\n\f]*[+~]/, + + rnative = /^[^{]+\{\s*\[native code/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rescape = /'|\\/g, + rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, + funescape = function( _, escaped ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + return high !== high ? + escaped : + // BMP codepoint + high < 0 ? + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +/* + * For feature detection + * @param {Function} fn The function to test for native support + */ +function isNative( fn ) { + return rnative.test( fn + "" ); +} + +/* + * Create key-value caches of limited size + * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var cache, + keys = []; + + return (cache = function( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key += " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key ] = value); + }); +} + +/* + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/* + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // release memory in IE + div = null; + } +} + +function Sizzle( selector, context, results, seed ) { + var match, elem, m, nodeType, + // QSA vars + i, groups, old, nid, newContext, newSelector; + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + + context = context || document; + results = results || []; + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { + return []; + } + + if ( documentIsHTML && !seed ) { + + // Shortcuts + if ( (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // QSA path + if ( support.qsa && !rbuggyQSA.test(selector) ) { + old = true; + nid = expando; + newContext = context; + newSelector = nodeType === 9 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + toSelector( groups[i] ); + } + newContext = rsibling.test( selector ) && context.parentNode || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/* + * Detect xml + * @param {Element|Object} elem An element or a document + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/* + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var doc = node ? node.ownerDocument || node : preferredDoc; + + // If no document and documentElement is available, return + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Set our document + document = doc; + docElem = doc.documentElement; + + // Support tests + documentIsHTML = !isXML( doc ); + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( doc.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Check if attributes should be retrieved by attribute nodes + support.attributes = assert(function( div ) { + div.innerHTML = ""; + var type = typeof div.lastChild.getAttribute("multiple"); + // IE8 returns a string for some attributes even when not present + return type !== "boolean" && type !== "string"; + }); + + // Check if getElementsByClassName can be trusted + support.getElementsByClassName = assert(function( div ) { + // Opera can't find a second classname (in 9.6) + div.innerHTML = ""; + if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { + return false; + } + + // Safari 3.2 caches class attributes and doesn't catch changes + div.lastChild.className = "e"; + return div.getElementsByClassName("e").length === 2; + }); + + // Check if getElementsByName privileges form controls or returns elements by ID + // If so, assume (for broader support) that getElementById returns elements by name + support.getByName = assert(function( div ) { + // Inject content + div.id = expando + 0; + // Support: Windows 8 Native Apps + // Assigning innerHTML with "name" attributes throws uncatchable exceptions + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx + div.appendChild( document.createElement("a") ).setAttribute( "name", expando ); + div.appendChild( document.createElement("i") ).setAttribute( "name", expando ); + docElem.appendChild( div ); + + // Test + var pass = doc.getElementsByName && + // buggy browsers will return fewer than the correct 2 + doc.getElementsByName( expando ).length === 2 + + // buggy browsers will return more than the correct 0 + doc.getElementsByName( expando + 0 ).length; + + // Cleanup + docElem.removeChild( div ); + + return pass; + }); + + // Support: Webkit<537.32 + // Detached nodes confoundingly follow *each other* + support.sortDetached = assert(function( div1 ) { + return div1.compareDocumentPosition && + // Should return 1, but Webkit returns 4 (following) + (div1.compareDocumentPosition( document.createElement("div") ) & 1); + }); + + // IE6/7 return modified attributes + Expr.attrHandle = assert(function( div ) { + div.innerHTML = ""; + return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && + div.firstChild.getAttribute("href") === "#"; + }) ? + {} : + { + "href": function( elem ) { + return elem.getAttribute( "href", 2 ); + }, + "type": function( elem ) { + return elem.getAttribute("type"); + } + }; + + // ID find and filter + if ( support.getByName ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && documentIsHTML ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && documentIsHTML ) { + var m = context.getElementById( id ); + + return m ? + m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? + [m] : + undefined : + []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== strundefined ) { + return context.getElementsByTagName( tag ); + } + } : + function( tag, context ) { + var elem, + tmp = [], + i = 0, + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Name + Expr.find["NAME"] = support.getByName && function( tag, context ) { + if ( typeof context.getElementsByName !== strundefined ) { + return context.getElementsByName( name ); + } + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21), + // no need to also add to buggyMatches since matches checks buggyQSA + // A support test would require too much code (would include document ready) + rbuggyQSA = [ ":focus" ]; + + if ( (support.qsa = isNative(doc.querySelectorAll)) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + div.innerHTML = ""; + + // IE8 - Some boolean attributes are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + }); + + assert(function( div ) { + + // Opera 10-12/IE8 - ^= $= *= and empty values + // Should not select anything + div.innerHTML = ""; + if ( div.querySelectorAll("[i^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || + docElem.mozMatchesSelector || + docElem.webkitMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + // Element contains another + // Purposefully does not implement inclusive descendent + // As in, an element does not contain itself + contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + // Document order sorting + sortOrder = docElem.compareDocumentPosition ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); + + if ( compare ) { + // Disconnected nodes + if ( compare & 1 || + (recompare && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === doc || contains(preferredDoc, a) ) { + return -1; + } + if ( b === doc || contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } + + // Not directly comparable, sort on existence of method + return a.compareDocumentPosition ? -1 : 1; + } : + function( a, b ) { + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Parentless nodes are either documents or disconnected + } else if ( !aup || !bup ) { + return a === doc ? -1 : + b === doc ? 1 : + aup ? -1 : + bup ? 1 : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + // rbuggyQSA always contains :focus, so no need for an existence check + if ( support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch(e) {} + } + + return Sizzle( expr, document, null, [elem] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + var val; + + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + if ( documentIsHTML ) { + name = name.toLowerCase(); + } + if ( (val = Expr.attrHandle[ name ]) ) { + return val( elem ); + } + if ( !documentIsHTML || support.attributes ) { + return elem.getAttribute( name ); + } + return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? + name : + val && val.specified ? val.value : null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +// Document sorting and removing duplicates +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + // Compensate for sort limitations + recompare = !support.sortDetached; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + return results; +}; + +/* + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns Returns -1 if a precedes b, 1 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +// Returns a function to use in pseudos for input types +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +// Returns a function to use in pseudos for buttons +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +// Returns a function to use in pseudos for positionals +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/* + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + for ( ; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (see #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[5] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[4] ) { + match[2] = match[4]; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeName ) { + if ( nodeName === "*" ) { + return function() { return true; }; + } + + nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, outerCache, node, diff, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + // Seek `elem` from a previously-cached index + outerCache = parent[ expando ] || (parent[ expando ] = {}); + cache = outerCache[ type ] || []; + nodeIndex = cache[0] === dirruns && cache[1]; + diff = cache[0] === dirruns && cache[2]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + // Use previously-cached element index if available + } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { + diff = cache[1]; + + // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) + } else { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { + // Cache the index of each encountered element + if ( useCache ) { + (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf.call( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), + // not comment, processing instructions, or others + // Thanks to Diego Perini for the nodeName shortcut + // Greater than "@" means alpha characters (specifically not starting with "#" or "?") + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +function tokenize( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( tokens = [] ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push( { + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + } ); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push( { + value: matched, + type: type, + matches: match + } ); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +} + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var data, cache, outerCache, + dirkey = dirruns + " " + doneName; + + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { + if ( (data = cache[1]) === true || data === cachedruns ) { + return data === true; + } + } else { + cache = outerCache[ dir ] = [ dirkey ]; + cache[1] = matcher( elem, context, xml ) || cachedruns; + if ( cache[1] === true ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf.call( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + // A counter to specify which element is currently being matched + var matcherCachedRuns = 0, + bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, expandContext ) { + var elem, j, matcher, + setMatched = [], + matchedCount = 0, + i = "0", + unmatched = seed && [], + outermost = expandContext != null, + contextBackup = outermostContext, + // We must always have either seed elements or context + elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); + + if ( outermost ) { + outermostContext = context !== document && context; + cachedruns = matcherCachedRuns; + } + + // Add elements passing elementMatchers directly to results + // Keep `i` a string if there are no elements so `matchedCount` will be "00" below + for ( ; (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + cachedruns = ++matcherCachedRuns; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !group ) { + group = tokenize( selector ); + } + i = group.length; + while ( i-- ) { + cached = matcherFromTokens( group[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + } + return cached; +}; + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function select( selector, context, results, seed ) { + var i, tokens, token, type, find, + match = tokenize( selector ); + + if ( !seed ) { + // Try to minimize operations if there is only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && context.parentNode || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + } + + // Compile and execute a filtering function + // Provide `match` to avoid retokenization if we modified the selector above + compile( selector, match )( + seed, + context, + !documentIsHTML, + results, + rsibling.test( selector ) + ); + return results; +} + +// Deprecated +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +// Check sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Initialize with the default document +setDocument(); + +// Always assume the presence of duplicates if sort doesn't +// pass them to our comparison function (as in Google Chrome). +[0, 0].sort( sortOrder ); +support.detectDuplicates = hasDuplicate; + +// EXPOSE +/*if ( typeof define === "function" && define.amd ) { + define(function() { return Sizzle; }); +} else { + window.Sizzle = Sizzle; +}*/ +// EXPOSE + +/** + * @namespace Ink.Dom.Selector + * @static + */ + +/** + * Alias for the Sizzle selector engine + * + * @method select + * @param {String} selector CSS selector to search for elements + * @param {DOMElement} [context] By default the search is done in the document element. However, you can specify an element as search context + * @param {Array} [results] By default this is considered an empty array. But if you want to merge it with other searches you did, pass their result array through here. + * @return {Array} Array of resulting DOM Elements + * @sample Ink_Dom_Selector_select.html + */ + +/** + * Filters elements that match a CSS selector. + * + * @method matches + * @param {String} selector CSS selector to search for elements + * @param {Array} matches Elements to be 'matched' with + * @return {Array} Elements that matched + * @sample Ink_Dom_Selector_matches.html + */ + +/** + * Checks if an element matches a given selector + * + * @method matchesSelector + * @param {DOMElement} element Element to test + * @param {String} selector CSS selector to test the element with + * @return {Boolean} True if element matches the CSS selector + * @sample Ink_Dom_Selector_matchesSelector.html + */ + +return { + select: Sizzle, + matches: Sizzle.matches, + matchesSelector: Sizzle.matchesSelector +}; + + +}); //( window ); + +/** + * Array Utilities + * @module Ink.Util.Array_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Array', '1', [], function() { + + 'use strict'; + + var arrayProto = Array.prototype; + + /** + * @namespace Ink.Util.Array_1 + */ + + var InkArray = { + + /** + * Checks if a value is an array + * + * @method isArray + * @param testedObject {Mixed} The object we want to check + **/ + isArray: Array.isArray || function (testedObject) { + return {}.toString.call(testedObject) === '[object Array]'; + }, + + /** + * Loops through an array, grouping similar items together. + * @method groupBy + * @param arr {Array} The input array. + * @param [options] {Object} options object, containing: + * @param [options.key] {Function} A function which computes the group key by which the items are grouped. + * @param [options.pairs] {Boolean} Set to `true` if you want to output an array of `[key, [group...]]` pairs instead of an array of groups. + * @return {Array} An array of arrays of chunks. + * + * @example + * + * InkArray.groupBy([1, 1, 2, 2, 3, 1]) // -> [ [1, 1], [2, 2], [3], [1] ] + * InkArray.groupBy([1.1, 1.2, 2.1], { key: Math.floor }) // -> [ [1.1, 1.2], [2.1] ] + * InkArray.groupBy([1.1, 1.2, 2.1], { key: Math.floor, pairs: true }) // -> [ [1, [1.1, 1.2]], [2, [2.1]] ] + * + **/ + groupBy: function (arr, options) { + options = options || {}; + var ret = []; + var latestGroup; + function eq(a, b) { + return outKey(a) === outKey(b); + } + function outKey(item) { + if (typeof options.key === 'function') { + return options.key(item); + } else { + return item; + } + } + + for (var i = 0, len = arr.length; i < len; i++) { + latestGroup = [arr[i]]; + + // Chunkin' + while ((i + 1 < len) && eq(arr[i], arr[i + 1])) { + latestGroup.push(arr[i + 1]); + i++; + } + + if (options.pairs) { + ret.push([outKey(arr[i]), latestGroup]); + } else { + ret.push(latestGroup); + } + } + return ret; + }, + + /** + * Replacement for Array.prototype.reduce. + * + * Produces a single result from a list of values by calling an "aggregator" function. + * + * Falls back to Array.prototype.reduce if available. + * + * @method reduce + * @param array {Array} Input array to be reduced. + * @param callback {Function} `function (previousValue, currentValue, index, all) { return {Mixed} }` to execute for each value. + * @param initial {Mixed} Object used as the first argument to the first call of `callback` + * + * @example + * var sum = InkArray.reduce([1, 2, 3], function (a, b) { return a + b; }); // -> 6 + */ + reduce: function (array, callback, initial) { + if (arrayProto.reduce) { + return arrayProto.reduce.apply(array, [].slice.call(arguments, 1)); + } + + // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Polyfill + var t = Object( array ), len = t.length >>> 0, k = 0, value; + if ( arguments.length >= 3 ) { + value = initial; + } else { + while ( k < len && !(k in t) ) k++; + if ( k >= len ) + throw new TypeError('Reduce of empty array with no initial value'); + value = t[ k++ ]; + } + for ( ; k < len ; k++ ) { + if ( k in t ) { + value = callback( value, t[k], k, t ); + } + } + return value; + }, + + /** + * Checks if a value exists in array + * + * @method inArray + * @public + * @static + * @param {Mixed} value Value to check + * @param {Array} arr Array to search in + * @return {Boolean} True if value exists in the array + * @sample Ink_Util_Array_inArray.html + */ + inArray: function(value, arr) { + if (typeof arr === 'object') { + for (var i = 0, f = arr.length; i < f; ++i) { + if (arr[i] === value) { + return true; + } + } + } + return false; + }, + + /** + * Sorts an array of objects by an object property + * + * @method sortMulti + * @param {Array} arr Array of objects to sort + * @param {String} key Property to sort by + * @return {Array|Boolean} False if it's not an array, returns a sorted array if it's an array. + * @public + * @static + * @sample Ink_Util_Array_sortMulti.html + */ + sortMulti: function(arr, key) { + if (typeof arr === 'undefined' || arr.constructor !== Array) { return false; } + if (typeof key !== 'string') { return arr.sort(); } + if (arr.length > 0) { + if (typeof(arr[0][key]) === 'undefined') { return false; } + arr.sort(function(a, b){ + var x = a[key]; + var y = b[key]; + return ((x < y) ? -1 : ((x > y) ? 1 : 0)); + }); + } + return arr; + }, + + /** + * Gets the indexes of a value in an array + * + * @method keyValue + * @param {String} value Value to search for. + * @param {Array} arr Array to run the search in. + * @param {Boolean} [first] Flag to stop the search at the first match. It also returns an index number instead of an array of indexes. + * @return {Boolean|Number|Array} False for no matches. Array of matches or first match index. + * @public + * @static + * @sample Ink_Util_Array_keyValue.html + */ + keyValue: function(value, arr, first) { + if (typeof value !== 'undefined' && typeof arr === 'object' && this.inArray(value, arr)) { + var aKeys = []; + for (var i = 0, f = arr.length; i < f; ++i) { + if (arr[i] === value) { + if (typeof first !== 'undefined' && first === true) { + return i; + } else { + aKeys.push(i); + } + } + } + return aKeys; + } + return false; + }, + + /** + * Shuffles an array. + * + * @method shuffle + * @param {Array} arr Array to shuffle + * @return {Array|Boolean} Shuffled Array or false if not an array. + * @public + * @static + * @sample Ink_Util_Array_shuffle.html + */ + shuffle: function(arr) { + if (typeof(arr) !== 'undefined' && arr.constructor !== Array) { return false; } + var total = arr.length, + tmp1 = false, + rnd = false; + + while (total--) { + rnd = Math.floor(Math.random() * (total + 1)); + tmp1 = arr[total]; + arr[total] = arr[rnd]; + arr[rnd] = tmp1; + } + return arr; + }, + + /** + * Runs a function through each of the elements of an array + * + * @method forEach + * @param {Array} arr The array to be cycled/iterated + * @param {Function} cb The function receives as arguments the value, index and array. + * @return {Array} Iterated array. + * @public + * @static + * @sample Ink_Util_Array_forEach.html + */ + forEach: function(array, callback, context) { + if (arrayProto.forEach) { + return arrayProto.forEach.call(array, callback, context); + } + for (var i = 0, len = array.length >>> 0; i < len; i++) { + callback.call(context, array[i], i, array); + } + }, + + /** + * Alias for backwards compatibility. See forEach + * + * @method each + */ + each: function () { + InkArray.forEach.apply(InkArray, [].slice.call(arguments)); + }, + + /** + * Runs a function for each item in the array. + * That function will receive each item as an argument and its return value will change the corresponding array item. + * @method map + * @param {Array} array The array to map over + * @param {Function} map The map function. Will take `(item, index, array)` as arguments and `this` will be the `context` argument. + * @param {Object} [context] Object to be `this` in the map function. + * + * @sample Ink_Util_Array_map.html + */ + map: function (array, callback, context) { + if (arrayProto.map) { + return arrayProto.map.call(array, callback, context); + } + var mapped = new Array(len); + for (var i = 0, len = array.length >>> 0; i < len; i++) { + mapped[i] = callback.call(context, array[i], i, array); + } + return mapped; + }, + + /** + * Filters an array based on a truth test. + * This method runs a test function on all the array values and returns a new array with all the values that pass the test. + * @method filter + * @param {Array} array The array to filter + * @param {Function} test A test function taking `(item, index, array)` + * @param {Object} [context] Object to be `this` in the test function. + * @return {Array} Returns the filtered array + * + * @sample Ink_Util_Array_filter.html + */ + filter: function (array, test, context) { + if (arrayProto.filter) { + return arrayProto.filter.call(array, test, context); + } + var filtered = [], + val = null; + for (var i = 0, len = array.length; i < len; i++) { + val = array[i]; // it might be mutated + if (test.call(context, val, i, array)) { + filtered.push(val); + } + } + return filtered; + }, + + /** + * Checks if some element in the array passes a truth test + * + * @method some + * @param {Array} arr The array to iterate through + * @param {Function} cb The callback to be called on the array's elements. It receives the value, the index and the array as arguments. + * @param {Object} context Object of the callback function + * @return {Boolean} True if the callback returns true at any point, false otherwise + * @public + * @static + * @sample Ink_Util_Array_some.html + */ + some: function(arr, cb, context){ + + if (arr === null){ + throw new TypeError('First argument is invalid.'); + } + + var t = Object(arr); + var len = t.length >>> 0; + if (typeof cb !== "function"){ throw new TypeError('Second argument must be a function.'); } + + for (var i = 0; i < len; i++) { + if (i in t && cb.call(context, t[i], i, t)){ return true; } + } + + return false; + }, + + /** + * Compares the values of two arrays and return the matches + * + * @method intersect + * @param {Array} arr1 First array + * @param {Array} arr2 Second array + * @return {Array} Empty array if one of the arrays is false (or do not intersect) | Array with the intersected values + * @public + * @static + * @sample Ink_Util_Array_intersect.html + */ + intersect: function(arr1, arr2) { + if (!arr1 || !arr2 || arr1 instanceof Array === false || arr2 instanceof Array === false) { + return []; + } + + var shared = []; + for (var i = 0, I = arr1.length; i 0) { + for (x = a; x < b; x += step) { + r.push(x); + } + } else { + for (x = a; x > b; x += step) { + r.push(x); + } + } + + return r; + }, + + /** + * Inserts a value on a specified index + * + * @method insert + * @param {Array} arr Array where the value will be inserted + * @param {Number} idx Index of the array where the value should be inserted + * @param {Mixed} value Value to be inserted + * @public + * @static + * @sample Ink_Util_Array_insert.html + */ + insert: function(arr, idx, value) { + arr.splice(idx, 0, value); + }, + + /** + * Removes a range of values from the array + * + * @method remove + * @param {Array} arr Array where the value will be removed + * @param {Number} from Index of the array where the removal will start removing. + * @param {Number} rLen Number of items to be removed from the index onwards. + * @return {Array} An array with the remaining values + * @public + * @static + * @sample Ink_Util_Array_remove.html + */ + remove: function(arr, from, rLen){ + var output = []; + + for(var i = 0, iLen = arr.length; i < iLen; i++){ + if(i >= from && i < from + rLen){ + continue; + } + + output.push(arr[i]); + } + + return output; + } + }; + + return InkArray; + +}); + +/** + * Binary Packing algorithm implementation + * @module Ink.Util.BinPack_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.BinPack', '1', [], function() { + + 'use strict'; + + /*jshint boss:true */ + + // https://github.com/jakesgordon/bin-packing/ + + /* + Copyright (c) 2011, 2012, 2013 Jake Gordon and contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + + + + var Packer = function(w, h) { + this.init(w, h); + }; + + Packer.prototype = { + + init: function(w, h) { + this.root = { x: 0, y: 0, w: w, h: h }; + }, + + fit: function(blocks) { + var n, node, block; + for (n = 0; n < blocks.length; ++n) { + block = blocks[n]; + if (node = this.findNode(this.root, block.w, block.h)) { + block.fit = this.splitNode(node, block.w, block.h); + } + } + }, + + findNode: function(root, w, h) { + if (root.used) { + return this.findNode(root.right, w, h) || this.findNode(root.down, w, h); + } + else if ((w <= root.w) && (h <= root.h)) { + return root; + } + else { + return null; + } + }, + + splitNode: function(node, w, h) { + node.used = true; + node.down = { x: node.x, y: node.y + h, w: node.w, h: node.h - h }; + node.right = { x: node.x + w, y: node.y, w: node.w - w, h: h }; + return node; + } + + }; + + + + var GrowingPacker = function() {}; + + GrowingPacker.prototype = { + + fit: function(blocks) { + var n, node, block, len = blocks.length; + var w = len > 0 ? blocks[0].w : 0; + var h = len > 0 ? blocks[0].h : 0; + this.root = { x: 0, y: 0, w: w, h: h }; + for (n = 0; n < len ; n++) { + block = blocks[n]; + if (node = this.findNode(this.root, block.w, block.h)) { + block.fit = this.splitNode(node, block.w, block.h); + } + else { + block.fit = this.growNode(block.w, block.h); + } + } + }, + + findNode: function(root, w, h) { + if (root.used) { + return this.findNode(root.right, w, h) || this.findNode(root.down, w, h); + } + else if ((w <= root.w) && (h <= root.h)) { + return root; + } + else { + return null; + } + }, + + splitNode: function(node, w, h) { + node.used = true; + node.down = { x: node.x, y: node.y + h, w: node.w, h: node.h - h }; + node.right = { x: node.x + w, y: node.y, w: node.w - w, h: h }; + return node; + }, + + growNode: function(w, h) { + var canGrowDown = (w <= this.root.w); + var canGrowRight = (h <= this.root.h); + + var shouldGrowRight = canGrowRight && (this.root.h >= (this.root.w + w)); // attempt to keep square-ish by growing right when height is much greater than width + var shouldGrowDown = canGrowDown && (this.root.w >= (this.root.h + h)); // attempt to keep square-ish by growing down when width is much greater than height + + if (shouldGrowRight) { + return this.growRight(w, h); + } + else if (shouldGrowDown) { + return this.growDown(w, h); + } + else if (canGrowRight) { + return this.growRight(w, h); + } + else if (canGrowDown) { + return this.growDown(w, h); + } + else { + return null; // need to ensure sensible root starting size to avoid this happening + } + }, + + growRight: function(w, h) { + this.root = { + used: true, + x: 0, + y: 0, + w: this.root.w + w, + h: this.root.h, + down: this.root, + right: { x: this.root.w, y: 0, w: w, h: this.root.h } + }; + var node; + if (node = this.findNode(this.root, w, h)) { + return this.splitNode(node, w, h); + } + else { + return null; + } + }, + + growDown: function(w, h) { + this.root = { + used: true, + x: 0, + y: 0, + w: this.root.w, + h: this.root.h + h, + down: { x: 0, y: this.root.h, w: this.root.w, h: h }, + right: this.root + }; + var node; + if (node = this.findNode(this.root, w, h)) { + return this.splitNode(node, w, h); + } + else { + return null; + } + } + + }; + + + + var sorts = { + random: function() { return Math.random() - 0.5; }, + w: function(a, b) { return b.w - a.w; }, + h: function(a, b) { return b.h - a.h; }, + a: function(a, b) { return b.area - a.area; }, + max: function(a, b) { return Math.max(b.w, b.h) - Math.max(a.w, a.h); }, + min: function(a, b) { return Math.min(b.w, b.h) - Math.min(a.w, a.h); }, + height: function(a, b) { return sorts.msort(a, b, ['h', 'w']); }, + width: function(a, b) { return sorts.msort(a, b, ['w', 'h']); }, + area: function(a, b) { return sorts.msort(a, b, ['a', 'h', 'w']); }, + maxside: function(a, b) { return sorts.msort(a, b, ['max', 'min', 'h', 'w']); }, + msort: function(a, b, criteria) { /* sort by multiple criteria */ + var diff, n; + for (n = 0; n < criteria.length; ++n) { + diff = sorts[ criteria[n] ](a, b); + if (diff !== 0) { + return diff; + } + } + return 0; + } + }; + + + + // end of Jake's code + + + + // aux, used to display blocks in unfitted property + var toString = function() { + return [this.w, ' x ', this.h].join(''); + }; + + + + /** + * Binary Packing algorithm implementation + * + * Based on the work of Jake Gordon + * + * see https://github.com/jakesgordon/bin-packing/ + * + * @namespace Ink.Util.BinPack + * @version 1 + * @static + */ + var BinPack = { + + /** + * @method binPack + * @param {Object} o Options + * @param {Array} o.blocks Array of items with width and height integer attributes. + * @param {Array} [o.dimensions] Flag to fix container dimensions + * @param {String} [o.sorter] Sorting function. One of: random, height, width, area, maxside + * @return {Object} Returns an object containing container dimensions, filled ratio, fitted blocks, unfitted blocks and all blocks + * @static + */ + binPack: function(o) { + var i, f, bl; + + + + // calculate area if not there already + for (i = 0, f = o.blocks.length; i < f; ++i) { + bl = o.blocks[i]; + if (! ('area' in bl) ) { + bl.area = bl.w * bl.h; + } + } + + + + // apply algorithm + var packer = o.dimensions ? new Packer(o.dimensions[0], o.dimensions[1]) : new GrowingPacker(); + + if (!o.sorter) { o.sorter = 'maxside'; } + + o.blocks.sort( sorts[ o.sorter ] ); + + packer.fit(o.blocks); + + var dims2 = [packer.root.w, packer.root.h]; + + + + // layout is done here, generating report data... + var fitted = []; + var unfitted = []; + + for (i = 0, f = o.blocks.length; i < f; ++i) { + bl = o.blocks[i]; + if (bl.fit) { + fitted.push(bl); + } + else { + bl.toString = toString; // TO AID SERIALIZATION + unfitted.push(bl); + } + } + + var area = dims2[0] * dims2[1]; + var fit = 0; + for (i = 0, f = fitted.length; i < f; ++i) { + bl = fitted[i]; + fit += bl.area; + } + + return { + dimensions: dims2, + filled: fit / area, + blocks: o.blocks, + fitted: fitted, + unfitted: unfitted + }; + } + }; + + + + return BinPack; + +}); +/** + * Cookie Utilities + * @module Ink.Util.Cookie_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Cookie', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.Cookie_1 + */ + var Cookie = { + + /** + * Gets an object with the current page cookies. + * + * @method get + * @param {String} name The cookie name. + * @return {String|Object} If the name is specified, it returns the value of that key. Otherwise it returns the full cookie object + * @public + * @static + * @sample Ink_Util_Cookie_get.html + */ + get: function(name) + { + var cookie = document.cookie || false; + + var _Cookie = {}; + if(cookie) { + cookie = cookie.replace(new RegExp("; ", "g"), ';'); + var aCookie = cookie.split(';'); + var aItem = []; + if(aCookie.length > 0) { + for(var i=0; i < aCookie.length; i++) { + aItem = aCookie[i].split('='); + if(aItem.length === 2) { + _Cookie[aItem[0]] = decodeURIComponent(aItem[1]); + } + aItem = []; + } + } + } + if(name) { + if(typeof(_Cookie[name]) !== 'undefined') { + return _Cookie[name]; + } else { + return null; + } + } + return _Cookie; + }, + + /** + * Sets a cookie. + * + * @method set + * @param {String} name Cookie name. + * @param {String} value Cookie value. + * @param {Number} [expires] Number of seconds the cookie will be valid for. + * @param {String} [path] Path for the cookie. Defaults to '/'. + * @param {String} [domain] Domain for the cookie. Defaults to current hostname. + * @param {Boolean} [secure] Flag for secure. Default 'false'. + * @public + * @static + * @sample Ink_Util_Cookie_set.html + */ + set: function(name, value, expires, path, domain, secure) + { + var sName; + if(!name || value===false || typeof(name) === 'undefined' || typeof(value) === 'undefined') { + return false; + } else { + sName = name+'='+encodeURIComponent(value); + } + var sExpires = false; + var sPath = false; + var sDomain = false; + var sSecure = false; + + if(expires && typeof(expires) !== 'undefined' && !isNaN(expires)) { + var oDate = new Date(); + var sDate = (parseInt(Number(oDate.valueOf()), 10) + (Number(parseInt(expires, 10)) * 1000)); + + var nDate = new Date(sDate); + var expiresString = nDate.toGMTString(); + + var re = new RegExp("([^\\s]+)(\\s\\d\\d)\\s(\\w\\w\\w)\\s(.*)"); + expiresString = expiresString.replace(re, "$1$2-$3-$4"); + + sExpires = 'expires='+expiresString; + } else { + if(typeof(expires) !== 'undefined' && !isNaN(expires) && Number(parseInt(expires, 10))===0) { + sExpires = ''; + } else { + sExpires = 'expires=Thu, 01-Jan-2037 00:00:01 GMT'; + } + } + + if(path && typeof(path) !== 'undefined') { + sPath = 'path='+path; + } else { + sPath = 'path=/'; + } + + if(domain && typeof(domain) !== 'undefined') { + sDomain = 'domain='+domain; + } else { + var portClean = new RegExp(":(.*)"); + sDomain = 'domain='+window.location.host; + sDomain = sDomain.replace(portClean,""); + } + + if(secure && typeof(secure) !== 'undefined') { + sSecure = secure; + } else { + sSecure = false; + } + + document.cookie = sName+'; '+sExpires+'; '+sPath+'; '+sDomain+'; '+sSecure; + }, + + /** + * Deletes a cookie. + * + * @method remove + * @param {String} cookieName Cookie name. + * @param {String} [path] Path of the cookie. Defaults to '/'. + * @param {String} [domain] Domain of the cookie. Defaults to current hostname. + * @public + * @static + * @sample Ink_Util_Cookie_remove.html + */ + remove: function(cookieName, path, domain) + { + //var expiresDate = 'Thu, 01-Jan-1970 00:00:01 GMT'; + var sPath = false; + var sDomain = false; + var expiresDate = -999999999; + + if(path && typeof(path) !== 'undefined') { + sPath = path; + } else { + sPath = '/'; + } + + if(domain && typeof(domain) !== 'undefined') { + sDomain = domain; + } else { + sDomain = window.location.host; + } + + this.set(cookieName, 'deleted', expiresDate, sPath, sDomain); + } + }; + + return Cookie; + +}); + +/** + * Date utility functions + * @module Ink.Util.Date_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Date', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.Date_1 + */ + var InkDate = { + + /** + * Function that returns the string representation of the month [PT only] + * + * @method _months + * @param {Number} index Month javascript (0 to 11) + * @return {String} The month's name + * @private + * @static + * @example + * console.log( InkDate._months(0) ); // Result: Janeiro + */ + _months: function(index){ + var _m = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro']; + return _m[index]; + }, + + /** + * Function that returns the month [PT only] ( 0 to 11 ) + * + * @method _iMonth + * @param {String} month Month javascript (0 to 11) + * @return {Number} The month's number + * @private + * @static + * @example + * console.log( InkDate._iMonth('maio') ); // Result: 4 + */ + _iMonth : function( month ) + { + if ( Number( month ) ) { return +month - 1; } + return { + 'janeiro' : 0 , + 'jan' : 0 , + 'fevereiro' : 1 , + 'fev' : 1 , + 'março' : 2 , + 'mar' : 2 , + 'abril' : 3 , + 'abr' : 3 , + 'maio' : 4 , + 'mai' : 4 , + 'junho' : 5 , + 'jun' : 5 , + 'julho' : 6 , + 'jul' : 6 , + 'agosto' : 7 , + 'ago' : 7 , + 'setembro' : 8 , + 'set' : 8 , + 'outubro' : 9 , + 'out' : 9 , + 'novembro' : 10 , + 'nov' : 10 , + 'dezembro' : 11 , + 'dez' : 11 + }[ month.toLowerCase( ) ]; + } , + + /** + * Function that returns the representation the day of the week [PT Only] + * + * @method _wDays + * @param {Number} index Week's day index + * @return {String} The week's day name + * @private + * @static + * @example + * console.log( InkDate._wDays(0) ); // Result: Domingo + */ + _wDays: function(index){ + var _d = ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado']; + return _d[index]; + }, + + /** + * Function that returns day of the week in javascript 1 to 7 + * + * @method _iWeek + * @param {String} week Week's day name + * @return {Number} The week's day index + * @private + * @static + * @example + * console.log( InkDate._iWeek('quarta') ); // Result: 3 + */ + _iWeek: function( week ) + { + if ( Number( week ) ) { return +week || 7; } + return { + 'segunda' : 1 , + 'seg' : 1 , + 'terça' : 2 , + 'ter' : 2 , + 'quarta' : 3 , + 'qua' : 3 , + 'quinta' : 4 , + 'qui' : 4 , + 'sexta' : 5 , + 'sex' : 5 , + 'sábado' : 6 , + 'sáb' : 6 , + 'domingo' : 7 , + 'dom' : 7 + }[ week.toLowerCase( ) ]; + }, + + /** + * Function that returns the number of days of a given month (m) on a given year (y) + * + * @method _daysInMonth + * @param {Number} _m Month + * @param {Number} _y Year + * @return {Number} Number of days of a give month on a given year + * @private + * @static + * @example + * console.log( InkDate._daysInMonth(2,2013) ); // Result: 28 + */ + _daysInMonth: function(_m,_y){ + var nDays; + + if(_m===1 || _m===3 || _m===5 || _m===7 || _m===8 || _m===10 || _m===12) + { + nDays= 31; + } + else if ( _m===4 || _m===6 || _m===9 || _m===11) + { + nDays = 30; + } + else + { + if((_y%400===0) || (_y%4===0 && _y%100!==0)) + { + nDays = 29; + } + else + { + nDays = 28; + } + } + return nDays; + }, + + /** + * Formats a date object. + * This works exactly as php date() function. http://php.net/manual/en/function.date.php + * + * @method get + * @param {String} format The format in which the date it will be formatted. + * @param {Date} [_date] The date to format. Can receive unix timestamp or a date object. Defaults to current time. + * @return {String} Formatted date + * @public + * @static + * @sample Ink_Util_Date_get.html + */ + get: function(format, _date){ + /*jshint maxcomplexity:65 */ + if(typeof(format) === 'undefined' || format === ''){ + format = "Y-m-d"; + } + + + var iFormat = format.split(""); + var result = new Array(iFormat.length); + var escapeChar = "\\"; + var jsDate; + + if (typeof(_date) === 'undefined'){ + jsDate = new Date(); + } else if (typeof(_date)==='number'){ + jsDate = new Date(_date*1000); + } else { + jsDate = new Date(_date); + } + + var jsFirstDay, jsThisDay, jsHour; + /* This switch is presented in the same order as in php date function (PHP 5.2.2) */ + for (var i = 0; i < iFormat.length; i++) { + switch(iFormat[i]) { + case escapeChar: + result[i] = iFormat[i+1]; + i++; + break; + + + /* DAY */ + case "d": /* Day of the month, 2 digits with leading zeros; ex: 01 to 31 */ + var jsDay = jsDate.getDate(); + result[i] = (String(jsDay).length > 1) ? jsDay : "0" + jsDay; + break; + + case "D": /* A textual representation of a day, three letters; Seg to Dom */ + result[i] = this._wDays(jsDate.getDay()).substring(0, 3); + break; + + case "j": /* Day of the month without leading zeros; ex: 1 to 31 */ + result[i] = jsDate.getDate(); + break; + + case "l": /* A full textual representation of the day of the week; Domingo to Sabado */ + result[i] = this._wDays(jsDate.getDay()); + break; + + case "N": /* ISO-8601 numeric representation of the day of the week; 1 (Segunda) to 7 (Domingo) */ + result[i] = jsDate.getDay() || 7; + break; + + case "S": /* English ordinal suffix for the day of the month, 2 characters; st, nd, rd or th. Works well with j */ + var temp = jsDate.getDate(); + var suffixes = ["st", "nd", "rd"]; + var suffix = ""; + + if (temp >= 11 && temp <= 13) { + result[i] = "th"; + } else { + result[i] = (suffix = suffixes[String(temp).substr(-1) - 1]) ? (suffix) : ("th"); + } + break; + + case "w": /* Numeric representation of the day of the week; 0 (for Sunday) through 6 (for Saturday) */ + result[i] = jsDate.getDay(); + break; + + case "z": /* The day of the year (starting from 0); 0 to 365 */ + jsFirstDay = Date.UTC(jsDate.getFullYear(), 0, 0); + jsThisDay = Date.UTC(jsDate.getFullYear(), jsDate.getMonth(), jsDate.getDate()); + result[i] = Math.floor((jsThisDay - jsFirstDay) / (1000 * 60 * 60 * 24)); + break; + + /* WEEK */ + case "W": /* ISO-8601 week number of year, weeks starting on Monday; ex: 42 (the 42nd week in the year) */ + var jsYearStart = new Date( jsDate.getFullYear( ) , 0 , 1 ); + jsFirstDay = jsYearStart.getDay() || 7; + + var days = Math.floor( ( jsDate - jsYearStart ) / ( 24 * 60 * 60 * 1000 ) + 1 ); + + result[ i ] = Math.ceil( ( days - ( 8 - jsFirstDay ) ) / 7 ) + 1; + break; + + + /* MONTH */ + case "F": /* A full textual representation of a month, such as Janeiro or Marco; Janeiro a Dezembro */ + result[i] = this._months(jsDate.getMonth()); + break; + + case "m": /* Numeric representation of a month, with leading zeros; 01 to 12 */ + var jsMonth = String(jsDate.getMonth() + 1); + result[i] = (jsMonth.length > 1) ? jsMonth : "0" + jsMonth; + break; + + case "M": /* A short textual representation of a month, three letters; Jan a Dez */ + result[i] = this._months(jsDate.getMonth()).substring(0,3); + break; + + case "n": /* Numeric representation of a month, without leading zeros; 1 a 12 */ + result[i] = jsDate.getMonth() + 1; + break; + + case "t": /* Number of days in the given month; ex: 28 */ + result[i] = this._daysInMonth(jsDate.getMonth()+1,jsDate.getYear()); + break; + + /* YEAR */ + case "L": /* Whether it's a leap year; 1 if it is a leap year, 0 otherwise. */ + var jsYear = jsDate.getFullYear(); + result[i] = (jsYear % 4) ? false : ( (jsYear % 100) ? true : ( (jsYear % 400) ? false : true ) ); + break; + + case "o": /* ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. */ + throw '"o" not implemented!'; + + case "Y": /* A full numeric representation of a year, 4 digits; 1999 */ + result[i] = jsDate.getFullYear(); + break; + + case "y": /* A two digit representation of a year; 99 */ + result[i] = String(jsDate.getFullYear()).substring(2); + break; + + /* TIME */ + case "a": /* Lowercase Ante meridiem and Post meridiem; am or pm */ + result[i] = (jsDate.getHours() < 12) ? "am" : "pm"; + break; + + case "A": /* Uppercase Ante meridiem and Post meridiem; AM or PM */ + result[i] = (jsDate.getHours < 12) ? "AM" : "PM"; + break; + + case "B": /* Swatch Internet time; 000 through 999 */ + throw '"B" not implemented!'; + + case "g": /* 12-hour format of an hour without leading zeros; 1 to 12 */ + jsHour = jsDate.getHours(); + result[i] = (jsHour <= 12) ? jsHour : (jsHour - 12); + break; + + case "G": /* 24-hour format of an hour without leading zeros; 1 to 23 */ + result[i] = String(jsDate.getHours()); + break; + + case "h": /* 12-hour format of an hour with leading zeros; 01 to 12 */ + jsHour = String(jsDate.getHours()); + jsHour = (jsHour <= 12) ? jsHour : (jsHour - 12); + result[i] = (jsHour.length > 1) ? jsHour : "0" + jsHour; + break; + + case "H": /* 24-hour format of an hour with leading zeros; 01 to 24 */ + jsHour = String(jsDate.getHours()); + result[i] = (jsHour.length > 1) ? jsHour : "0" + jsHour; + break; + + case "i": /* Minutes with leading zeros; 00 to 59 */ + var jsMinute = String(jsDate.getMinutes()); + result[i] = (jsMinute.length > 1) ? jsMinute : "0" + jsMinute; + break; + + case "s": /* Seconds with leading zeros; 00 to 59; */ + var jsSecond = String(jsDate.getSeconds()); + result[i] = (jsSecond.length > 1) ? jsSecond : "0" + jsSecond; + break; + + case "u": /* Microseconds */ + throw '"u" not implemented!'; + + + /* TIMEZONE */ + + case "e": /* Timezone identifier */ + throw '"e" not implemented!'; + + case "I": /* "1" if Daylight Savings Time, "0" otherwise. Works only on the northern hemisphere */ + jsFirstDay = new Date(jsDate.getFullYear(), 0, 1); + result[i] = (jsDate.getTimezoneOffset() !== jsFirstDay.getTimezoneOffset()) ? (1) : (0); + break; + + case "O": /* Difference to Greenwich time (GMT) in hours */ + var jsMinZone = jsDate.getTimezoneOffset(); + var jsMinutes = jsMinZone % 60; + jsHour = String(((jsMinZone - jsMinutes) / 60) * -1); + + if (jsHour.charAt(0) !== "-") { + jsHour = "+" + jsHour; + } + + jsHour = (jsHour.length === 3) ? (jsHour) : (jsHour.replace(/([+\-])(\d)/, "$1" + 0 + "$2")); + result[i] = jsHour + jsMinutes + "0"; + break; + + case "P": /* Difference to Greenwich time (GMT) with colon between hours and minutes */ + throw '"P" not implemented!'; + + case "T": /* Timezone abbreviation */ + throw '"T" not implemented!'; + + case "Z": /* Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. */ + result[i] = jsDate.getTimezoneOffset() * 60; + break; + + + /* FULL DATE/TIME */ + + case "c": /* ISO 8601 date */ + throw '"c" not implemented!'; + + case "r": /* RFC 2822 formatted date */ + var jsDayName = this._wDays(jsDate.getDay()).substr(0, 3); + var jsMonthName = this._months(jsDate.getMonth()).substr(0, 3); + result[i] = jsDayName + ", " + jsDate.getDate() + " " + jsMonthName + this.get(" Y H:i:s O",jsDate); + break; + + case "U": /* Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) */ + result[i] = Math.floor(jsDate.getTime() / 1000); + break; + + default: + result[i] = iFormat[i]; + } + } + + return result.join(''); + + }, + + /** + * Creates a date object based on a format string. + * This works exactly as php date() function. http://php.net/manual/en/function.date.php + * + * @method set + * @param {String} [format] The format in which the date will be formatted. Defaults to 'Y-m-d' + * @param {String} str_date The date formatted. + * @return {Date} Date object based on the formatted date and format + * @public + * @static + * @sample Ink_Util_Date_set.html + */ + set : function( format , str_date ) { + if ( typeof str_date === 'undefined' ) { return ; } + if ( typeof format === 'undefined' || format === '' ) { format = "Y-m-d"; } + + var iFormat = format.split(""); + var result = new Array( iFormat.length ); + var escapeChar = "\\"; + var mList; + + var objIndex = { + year : undefined , + month : undefined , + day : undefined , + dayY : undefined , + dayW : undefined , + week : undefined , + hour : undefined , + hourD : undefined , + min : undefined , + sec : undefined , + msec : undefined , + ampm : undefined , + diffM : undefined , + diffH : undefined , + date : undefined + }; + + var matches = 0; + + /* This switch is presented in the same order as in php date function (PHP 5.2.2) */ + for ( var i = 0; i < iFormat.length; i++) { + switch( iFormat[ i ] ) { + case escapeChar: + result[i] = iFormat[ i + 1 ]; + i++; + break; + + /* DAY */ + case "d": /* Day of the month, 2 digits with leading zeros; ex: 01 to 31 */ + result[ i ] = '(\\d{2})'; + objIndex.day = { original : i , match : matches++ }; + break; + + case "j": /* Day of the month without leading zeros; ex: 1 to 31 */ + result[ i ] = '(\\d{1,2})'; + objIndex.day = { original : i , match : matches++ }; + break; + + case "D": /* A textual representation of a day, three letters; Seg to Dom */ + result[ i ] = '([\\wá]{3})'; + objIndex.dayW = { original : i , match : matches++ }; + break; + + case "l": /* A full textual representation of the day of the week; Domingo to Sabado */ + result[i] = '([\\wá]{5,7})'; + objIndex.dayW = { original : i , match : matches++ }; + break; + + case "N": /* ISO-8601 numeric representation of the day of the week; 1 (Segunda) to 7 (Domingo) */ + result[ i ] = '(\\d)'; + objIndex.dayW = { original : i , match : matches++ }; + break; + + case "w": /* Numeric representation of the day of the week; 0 (for Sunday) through 6 (for Saturday) */ + result[ i ] = '(\\d)'; + objIndex.dayW = { original : i , match : matches++ }; + break; + + case "S": /* English ordinal suffix for the day of the month, 2 characters; st, nd, rd or th. Works well with j */ + result[ i ] = '\\w{2}'; + break; + + case "z": /* The day of the year (starting from 0); 0 to 365 */ + result[ i ] = '(\\d{1,3})'; + objIndex.dayY = { original : i , match : matches++ }; + break; + + /* WEEK */ + case "W": /* ISO-8601 week number of year, weeks starting on Monday; ex: 42 (the 42nd week in the year) */ + result[ i ] = '(\\d{1,2})'; + objIndex.week = { original : i , match : matches++ }; + break; + + /* MONTH */ + case "F": /* A full textual representation of a month, such as Janeiro or Marco; Janeiro a Dezembro */ + result[ i ] = '([\\wç]{4,9})'; + objIndex.month = { original : i , match : matches++ }; + break; + + case "M": /* A short textual representation of a month, three letters; Jan a Dez */ + result[ i ] = '(\\w{3})'; + objIndex.month = { original : i , match : matches++ }; + break; + + case "m": /* Numeric representation of a month, with leading zeros; 01 to 12 */ + result[ i ] = '(\\d{2})'; + objIndex.month = { original : i , match : matches++ }; + break; + + case "n": /* Numeric representation of a month, without leading zeros; 1 a 12 */ + result[ i ] = '(\\d{1,2})'; + objIndex.month = { original : i , match : matches++ }; + break; + + case "t": /* Number of days in the given month; ex: 28 */ + result[ i ] = '\\d{2}'; + break; + + /* YEAR */ + case "L": /* Whether it's a leap year; 1 if it is a leap year, 0 otherwise. */ + result[ i ] = '\\w{4,5}'; + break; + + case "o": /* ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. */ + throw '"o" not implemented!'; + + case "Y": /* A full numeric representation of a year, 4 digits; 1999 */ + result[ i ] = '(\\d{4})'; + objIndex.year = { original : i , match : matches++ }; + break; + + case "y": /* A two digit representation of a year; 99 */ + result[ i ] = '(\\d{2})'; + if ( typeof objIndex.year === 'undefined' || iFormat[ objIndex.year.original ] !== 'Y' ) { + objIndex.year = { original : i , match : matches++ }; + } + break; + + /* TIME */ + case "a": /* Lowercase Ante meridiem and Post meridiem; am or pm */ + result[ i ] = '(am|pm)'; + objIndex.ampm = { original : i , match : matches++ }; + break; + + case "A": /* Uppercase Ante meridiem and Post meridiem; AM or PM */ + result[ i ] = '(AM|PM)'; + objIndex.ampm = { original : i , match : matches++ }; + break; + + case "B": /* Swatch Internet time; 000 through 999 */ + throw '"B" not implemented!'; + + case "g": /* 12-hour format of an hour without leading zeros; 1 to 12 */ + result[ i ] = '(\\d{1,2})'; + objIndex.hourD = { original : i , match : matches++ }; + break; + + case "G": /* 24-hour format of an hour without leading zeros; 1 to 23 */ + result[ i ] = '(\\d{1,2})'; + objIndex.hour = { original : i , match : matches++ }; + break; + + case "h": /* 12-hour format of an hour with leading zeros; 01 to 12 */ + result[ i ] = '(\\d{2})'; + objIndex.hourD = { original : i , match : matches++ }; + break; + + case "H": /* 24-hour format of an hour with leading zeros; 01 to 24 */ + result[ i ] = '(\\d{2})'; + objIndex.hour = { original : i , match : matches++ }; + break; + + case "i": /* Minutes with leading zeros; 00 to 59 */ + result[ i ] = '(\\d{2})'; + objIndex.min = { original : i , match : matches++ }; + break; + + case "s": /* Seconds with leading zeros; 00 to 59; */ + result[ i ] = '(\\d{2})'; + objIndex.sec = { original : i , match : matches++ }; + break; + + case "u": /* Microseconds */ + throw '"u" not implemented!'; + + /* TIMEZONE */ + case "e": /* Timezone identifier */ + throw '"e" not implemented!'; + + case "I": /* "1" if Daylight Savings Time, "0" otherwise. Works only on the northern hemisphere */ + result[i] = '\\d'; + break; + + case "O": /* Difference to Greenwich time (GMT) in hours */ + result[ i ] = '([-+]\\d{4})'; + objIndex.diffH = { original : i , match : matches++ }; + break; + + case "P": /* Difference to Greenwich time (GMT) with colon between hours and minutes */ + throw '"P" not implemented!'; + + case "T": /* Timezone abbreviation */ + throw '"T" not implemented!'; + + case "Z": /* Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. */ + result[ i ] = '(\\-?\\d{1,5})'; + objIndex.diffM = { original : i , match : matches++ }; + break; + + /* FULL DATE/TIME */ + case "c": /* ISO 8601 date */ + throw '"c" not implemented!'; + + case "r": /* RFC 2822 formatted date */ + result[ i ] = '([\\wá]{3}, \\d{1,2} \\w{3} \\d{4} \\d{2}:\\d{2}:\\d{2} [+\\-]\\d{4})'; + objIndex.date = { original : i , match : matches++ }; + break; + + case "U": /* Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) */ + result[ i ] = '(\\d{1,13})'; + objIndex.date = { original : i , match : matches++ }; + break; + + default: + result[ i ] = iFormat[ i ]; + } + } + + var pattr = new RegExp( result.join('') ); + + try { + mList = str_date.match( pattr ); + if ( !mList ) { return; } + } + catch ( e ) { return ; } + + var _haveDatetime = typeof objIndex.date !== 'undefined'; + + var _haveYear = typeof objIndex.year !== 'undefined'; + + var _haveYDay = typeof objIndex.dayY !== 'undefined'; + + var _haveDay = typeof objIndex.day !== 'undefined'; + var _haveMonth = typeof objIndex.month !== 'undefined'; + var _haveMonthDay = _haveMonth && _haveDay; + var _haveOnlyDay = !_haveMonth && _haveDay; + + var _haveWDay = typeof objIndex.dayW !== 'undefined'; + var _haveWeek = typeof objIndex.week !== 'undefined'; + var _haveWeekWDay = _haveWeek && _haveWDay; + var _haveOnlyWDay = !_haveWeek && _haveWDay; + + var _validDate = _haveYDay || _haveMonthDay || !_haveYear && _haveOnlyDay || _haveWeekWDay || !_haveYear && _haveOnlyWDay; + var _noDate = !_haveYear && !_haveYDay && !_haveDay && !_haveMonth && !_haveWDay && !_haveWeek; + + var _haveHour12 = typeof objIndex.hourD !== 'undefined' && typeof objIndex.ampm !== 'undefined'; + var _haveHour24 = typeof objIndex.hour !== 'undefined'; + var _haveHour = _haveHour12 || _haveHour24; + + var _haveMin = typeof objIndex.min !== 'undefined'; + var _haveSec = typeof objIndex.sec !== 'undefined'; + var _haveMSec = typeof objIndex.msec !== 'undefined'; + + var _haveMoreM = !_noDate || _haveHour; + var _haveMoreS = _haveMoreM || _haveMin; + + var _haveDiffM = typeof objIndex.diffM !== 'undefined'; + var _haveDiffH = typeof objIndex.diffH !== 'undefined'; + //var _haveGMT = _haveDiffM || _haveDiffH; + var hour; + var min; + + if ( _haveDatetime ) { + if ( iFormat[ objIndex.date.original ] === 'U' ) { + return new Date( +mList[ objIndex.date.match + 1 ] * 1000 ); + } + + var dList = mList[ objIndex.date.match + 1 ].match( /\w{3}, (\d{1,2}) (\w{3}) (\d{4}) (\d{2}):(\d{2}):(\d{2}) ([+\-]\d{4})/ ); + hour = +dList[ 4 ] + ( +dList[ 7 ].slice( 0 , 3 ) ); + min = +dList[ 5 ] + ( dList[ 7 ].slice( 0 , 1 ) + dList[ 7 ].slice( 3 ) ) / 100 * 60; + + return new Date( dList[ 3 ] , this._iMonth( dList[ 2 ] ) , dList[ 1 ] , hour , min , dList[ 6 ] ); + } + + var _d = new Date( ); + var year; + var month; + var day; + var sec; + var msec; + var gmt; + + if ( !_validDate && !_noDate ) { return ; } + + if ( _validDate ) { + if ( _haveYear ) { + var _y = _d.getFullYear( ) - 50 + ''; + year = mList[ objIndex.year.match + 1 ]; + if ( iFormat[ objIndex.year.original ] === 'y' ) { + year = +_y.slice( 0 , 2 ) + ( year >= ( _y ).slice( 2 ) ? 0 : 1 ) + year; + } + } else { + year = _d.getFullYear(); + } + + if ( _haveYDay ) { + month = 0; + day = mList[ objIndex.dayY.match + 1 ]; + } else if ( _haveDay ) { + if ( _haveMonth ) { + month = this._iMonth( mList[ objIndex.month.match + 1 ] ); + } else { + month = _d.getMonth( ); + } + + day = mList[ objIndex.day.match + 1 ]; + } else { + month = 0; + + var week; + if ( _haveWeek ) { + week = mList[ objIndex.week.match + 1 ]; + } else { + week = this.get( 'W' , _d ); + } + + day = ( week - 2 ) * 7 + ( 8 - ( ( new Date( year , 0 , 1 ) ).getDay( ) || 7 ) ) + this._iWeek( mList[ objIndex.week.match + 1 ] ); + } + + if ( month === 0 && day > 31 ) { + var aux = new Date( year , month , day ); + month = aux.getMonth( ); + day = aux.getDate( ); + } + } + else { + year = _d.getFullYear( ); + month = _d.getMonth( ); + day = _d.getDate( ); + } + + if ( _haveHour12 ) { hour = +mList[ objIndex.hourD.match + 1 ] + ( mList[ objIndex.ampm.match + 1 ] === 'pm' ? 12 : 0 ); } + else if ( _haveHour24 ) { hour = mList[ objIndex.hour.match + 1 ]; } + else if ( _noDate ) { hour = _d.getHours( ); } + else { hour = '00'; } + + if ( _haveMin ) { min = mList[ objIndex.min.match + 1 ]; } + else if ( !_haveMoreM ) { min = _d.getMinutes( ); } + else { min = '00'; } + + if ( _haveSec ) { sec = mList[ objIndex.sec.match + 1 ]; } + else if ( !_haveMoreS ) { sec = _d.getSeconds( ); } + else { sec = '00'; } + + if ( _haveMSec ) { msec = mList[ objIndex.msec.match + 1 ]; } + else { msec = '000'; } + + if ( _haveDiffH ) { gmt = mList[ objIndex.diffH.match + 1 ]; } + else if ( _haveDiffM ) { gmt = String( -1 * mList[ objIndex.diffM.match + 1 ] / 60 * 100 ).replace( /^(\d)/ , '+$1' ).replace( /(^[\-+])(\d{3}$)/ , '$10$2' ); } + else { gmt = '+0000'; } + + return new Date( year, month, day, hour, min, sec ); + } + }; + + + return InkDate; + +}); + +/** + * Dump/Profiling Utilities + * @module Ink.Util.Dumper_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Dumper', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.Dumper_1 + */ + + var Dumper = { + + /** + * Hex code for the 'tab' + * + * @property _tab + * @type {String} + * @private + * @readOnly + * @static + * + */ + _tab: '\xA0\xA0\xA0\xA0', + + /** + * Function that returns the argument passed formatted + * + * @method _formatParam + * @param {Mixed} param + * @return {String} The argument passed formatted + * @private + * @static + */ + _formatParam: function(param) + { + var formated = ''; + + switch(typeof(param)) { + case 'string': + formated = '(string) '+param; + break; + case 'number': + formated = '(number) '+param; + break; + case 'boolean': + formated = '(boolean) '+param; + break; + case 'object': + if(param !== null) { + if(param.constructor === Array) { + formated = 'Array \n{\n' + this._outputFormat(param, 0) + '\n}'; + } else { + formated = 'Object \n{\n' + this._outputFormat(param, 0) + '\n}'; + } + } else { + formated = 'null'; + } + break; + default: + formated = false; + } + + return formated; + }, + + /** + * Function that returns the tabs concatenated + * + * @method _getTabs + * @param {Number} numberOfTabs Number of Tabs + * @return {String} Tabs concatenated + * @private + * @static + */ + _getTabs: function(numberOfTabs) + { + var tabs = ''; + for(var _i = 0; _i < numberOfTabs; _i++) { + tabs += this._tab; + } + return tabs; + }, + + /** + * Function that formats the parameter to display. + * + * @method _outputFormat + * @param {Any} param + * @param {Number} dim + * @return {String} The parameter passed formatted to displat + * @private + * @static + */ + _outputFormat: function(param, dim) + { + var formated = ''; + //var _strVal = false; + var _typeof = false; + for(var key in param) { + if(param[key] !== null) { + if(typeof(param[key]) === 'object' && (param[key].constructor === Array || param[key].constructor === Object)) { + if(param[key].constructor === Array) { + _typeof = 'Array'; + } else if(param[key].constructor === Object) { + _typeof = 'Object'; + } + formated += this._tab + this._getTabs(dim) + '[' + key + '] => '+_typeof+'\n'; + formated += this._tab + this._getTabs(dim) + '{\n'; + formated += this._outputFormat(param[key], dim + 1) + this._tab + this._getTabs(dim) + '}\n'; + } else if(param[key].constructor === Function) { + continue; + } else { + formated = formated + this._tab + this._getTabs(dim) + '[' + key + '] => ' + param[key] + '\n'; + } + } else { + formated = formated + this._tab + this._getTabs(dim) + '[' + key + '] => null \n'; + } + } + return formated; + }, + + /** + * Prints variable structure. + * + * @method printDump + * @param {Any} param Variable to be dumped. + * @param {DOMElement|String} [target] Element to print the dump on. + * @public + * @static + * @sample Ink_Util_Dumper_printDump.html + */ + printDump: function(param, target) + { + /*jshint evil:true */ + if(!target || typeof(target) === 'undefined') { + document.write('
'+this._formatParam(param)+'
'); + } else { + if(typeof(target) === 'string') { + document.getElementById(target).innerHTML = '
' + this._formatParam(param) + '
'; + } else if(typeof(target) === 'object') { + target.innerHTML = '
'+this._formatParam(param)+'
'; + } else { + throw "TARGET must be an element or an element ID"; + } + } + }, + + /** + * Get a variable's structure. + * + * @method returnDump + * @param {Any} param Variable to get the structure. + * @return {String} The variable's structure. + * @public + * @static + * @sample Ink_Util_Dumper_returnDump.html + */ + returnDump: function(param) + { + return this._formatParam(param); + }, + + /** + * Alert a variable's structure. + * + * @method alertDump + * @param {Any} param Variable to be dumped. + * @public + * @static + * @sample Ink_Util_Dumper_alertDump.html + */ + alertDump: function(param) + { + window.alert(this._formatParam(param).replace(/()(Array|Object)(<\/b>)/g, "$2")); + }, + + /** + * Prints the variable structure to a new window. + * + * @method windowDump + * @param {Any} param Variable to be dumped. + * @public + * @static + * @sample Ink_Util_Dumper_windowDump.html + */ + windowDump: function(param) + { + var dumperwindow = 'dumperwindow_'+(Math.random() * 10000); + var win = window.open('', + dumperwindow, + 'width=400,height=300,left=50,top=50,status,menubar,scrollbars,resizable' + ); + win.document.open(); + win.document.write('
'+this._formatParam(param)+'
'); + win.document.close(); + win.focus(); + } + + }; + + return Dumper; + +}); + +/** + * Internationalization Utilities + * @module Ink.Util.I18n_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.I18n', '1', [], function () { + 'use strict'; + + var pattrText = /\{(?:(\{.*?})|(?:%s:)?(\d+)|(?:%s)?|([\w-]+))}/g; + + var funcOrVal = function( ret , args ) { + if ( typeof ret === 'function' ) { + return ret.apply(this, args); + } else if (typeof ret !== undefined) { + return ret; + } else { + return ''; + } + }; + + /** + * You can use this module to internationalize your applications. It roughly emulates GNU gettext's API. + * + * @class Ink.Util.I18n + * @constructor + * + * @param {Object} dict Object mapping language codes (in the form of `pt_PT`, `pt_BR`, `fr`, `en_US`, etc.) to their `dictionaries` + * @param {String} [lang='pt_PT'] language code of the target language + * + * @sample Ink_Util_I18n_1.html + */ + var I18n = function( dict , lang , testMode ) { + if ( !( this instanceof I18n ) ) { return new I18n( dict , lang , testMode ); } + + this.reset( ) + .lang( lang ) + .testMode( testMode ) + .append( dict || { } , lang ); + }; + + I18n.prototype = { + reset: function( ) { + this._dicts = [ ]; + this._dict = { }; + this._testMode = false; + this._lang = this._gLang; + + return this; + }, + /** + * Adds translation strings for the helper to use. + * + * @method append + * @param {Object} dict Object containing language objects identified by their language code + * + * @sample Ink_Util_I18n_1_append.html + */ + append: function( dict ) { + this._dicts.push( dict ); + + this._dict = Ink.extendObj(this._dict , dict[ this._lang ] ); + + return this; + }, + /** + * Gets or sets the language. + * If there are more dictionaries available in cache, they will be loaded. + * + * @method lang + * @param {String} lang Language code to set this instance to. + */ + lang: function( lang ) { + if ( !arguments.length ) { return this._lang; } + + if ( lang && this._lang !== lang ) { + this._lang = lang; + + this._dict = { }; + + for ( var i = 0, l = this._dicts.length; i < l; i++ ) { + this._dict = Ink.extendObj( this._dict , this._dicts[ i ][ lang ] || { } ); + } + } + + return this; + }, + /** + * Sets or unsets test mode. + * In test mode, unknown strings are wrapped in `[ ... ]`. This is useful for debugging your application and to make sure all your translation keys are in place. + * + * @method testMode + * @param {Boolean} bool Flag to set the test mode state + */ + testMode: function( bool ) { + if ( !arguments.length ) { return !!this._testMode; } + + if ( bool !== undefined ) { this._testMode = !!bool; } + + return this; + }, + + /** + * Gest a key from the current dictionary + * + * @method getKey + * @param {String} key + * @return {Mixed} The object which happened to be in the current language dictionary on the given key. + * + * @sample Ink_Util_I18n_1_getKey.html + */ + getKey: function( key ) { + var ret; + var gLang = this._gLang; + var lang = this._lang; + + if ( key in this._dict ) { + ret = this._dict[ key ]; + } else { + I18n.langGlobal( lang ); + + ret = this._gDict[ key ]; + + I18n.langGlobal( gLang ); + } + + return ret; + }, + + /** + * Translates a string. + * Given a translation key, return a translated string, with replaced parameters. + * When a translated string is not available, the original string is returned unchanged. + * + * @method text + * @param {String} str Key to look for in i18n dictionary (which is returned verbatim if unknown) + * @param {Object} [namedParms] Named replacements. Replaces {named} with values in this object. + * @param {String} [args] Replacement #1 (replaces first {} and all {1}) + * @param {String} [arg2] Replacement #2 (replaces second {} and all {2}) + * @param {String} [argn*] Replacement #n (replaces nth {} and all {n}) + * + * @sample Ink_Util_I18n_1_text.html + */ + text: function( str /*, replacements...*/ ) { + if ( typeof str !== 'string' ) { return; } // Backwards-compat + + var pars = Array.prototype.slice.call( arguments , 1 ); + var idx = 0; + var isObj = typeof pars[ 0 ] === 'object'; + + var original = this.getKey( str ); + if ( original === undefined ) { original = this._testMode ? '[' + str + ']' : str; } + if ( typeof original === 'number' ) { original += ''; } + + if (typeof original === 'string') { + original = original.replace( pattrText , function( m , $1 , $2 , $3 ) { + var ret = + $1 ? $1 : + $2 ? pars[ $2 - ( isObj ? 0 : 1 ) ] : + $3 ? pars[ 0 ][ $3 ] || '' : + pars[ (idx++) + ( isObj ? 1 : 0 ) ]; + return funcOrVal( ret , [idx].concat(pars) ); + }); + return original; + } + + return ( + typeof original === 'function' ? original.apply( this , pars ) : + original instanceof Array ? funcOrVal( original[ pars[ 0 ] ] , pars ) : + typeof original === 'object' ? funcOrVal( original[ pars[ 0 ] ] , pars ) : + ''); + }, + + /** + * Translates and pluralizes text. + * Given a singular string, a plural string and a number, translates either the singular or plural string. + * + * @method ntext + * @return {String} + * + * @param {String} strSin Word to use when count is 1 + * @param {String} strPlur Word to use otherwise + * @param {Number} count Number which defines which word to use + * @param [args*] Extra arguments, to be passed to `text()` + * + * @sample Ink_Util_I18n_1_ntext.html + */ + ntext: function( strSin , strPlur , count ) { + var pars = Array.prototype.slice.apply( arguments ); + var original; + + if ( pars.length === 2 && typeof strPlur === 'number' ) { + original = this.getKey( strSin ); + if ( !( original instanceof Array ) ) { return ''; } + + pars.splice( 0 , 1 ); + original = original[ strPlur === 1 ? 0 : 1 ]; + } else { + pars.splice( 0 , 2 ); + original = count === 1 ? strSin : strPlur; + } + + return this.text.apply( this , [ original ].concat( pars ) ); + }, + + /** + * Gets the ordinal suffix of a number. + * + * This works by using transforms (in the form of Objects or Functions) passed into the function or found in the special key `_ordinals` in the active language dictionary. + * + * @method ordinal + * + * @param {Number} num Input number + * @param {Object|Function} [options]={} Dictionaries for translating. Each of these options' fallback is found in the current language's dictionary. The lookup order is the following: `exceptions`, `byLastDigit`, `default`. Each of these may be either an `Object` or a `Function`. If it's a function, it is called (with `number` and `digit` for any function except for byLastDigit, which is called with the `lastDigit` of the number in question), and if the function returns a string, that is used. If it's an object, the property is looked up using `obj[prop]`. If what is found is a string, it is used directly. + * @param {Object|Function} [options.byLastDigit]={} If the language requires the last digit to be considered, mappings of last digits to ordinal suffixes can be created here. + * @param {Object|Function} [options.exceptions]={} Map unique, special cases to their ordinal suffixes. + * + * @returns {String} Ordinal suffix for `num`. + * + * @sample Ink_Util_I18n_1_ordinal.html + **/ + ordinal: function( num ) { + if ( num === undefined ) { return ''; } + + var lastDig = +num.toString( ).slice( -1 ); + + var ordDict = this.getKey( '_ordinals' ); + if ( ordDict === undefined ) { return ''; } + + if ( typeof ordDict === 'string' ) { return ordDict; } + + var ret; + + if ( typeof ordDict === 'function' ) { + ret = ordDict( num , lastDig ); + + if ( typeof ret === 'string' ) { return ret; } + } + + if ( 'exceptions' in ordDict ) { + ret = typeof ordDict.exceptions === 'function' ? ordDict.exceptions( num , lastDig ) : + num in ordDict.exceptions ? funcOrVal( ordDict.exceptions[ num ] , [num , lastDig] ) : + undefined; + + if ( typeof ret === 'string' ) { return ret; } + } + + if ( 'byLastDigit' in ordDict ) { + ret = typeof ordDict.byLastDigit === 'function' ? ordDict.byLastDigit( lastDig , num ) : + lastDig in ordDict.byLastDigit ? funcOrVal( ordDict.byLastDigit[ lastDig ] , [lastDig , num] ) : + undefined; + + if ( typeof ret === 'string' ) { return ret; } + } + + if ( 'default' in ordDict ) { + ret = funcOrVal( ordDict['default'] , [ num , lastDig ] ); + + if ( typeof ret === 'string' ) { return ret; } + } + + return ''; + }, + + /** + * Create an alias. + * + * Returns an alias to this I18n instance. It contains the I18n methods documented here, but is also a function. If you call it, it just calls `text()`. This is commonly assigned to "_". + * + * @method alias + * @returns {Function} an alias to `text()` on this instance. You can also access the rest of the translation API through this alias. + * + * @sample Ink_Util_I18n_1_alias.html + */ + alias: function( ) { + var ret = Ink.bind( I18n.prototype.text , this ); + ret.ntext = Ink.bind( I18n.prototype.ntext , this ); + ret.append = Ink.bind( I18n.prototype.append , this ); + ret.ordinal = Ink.bind( I18n.prototype.ordinal , this ); + ret.testMode = Ink.bind( I18n.prototype.testMode , this ); + + return ret; + } + }; + + /** + * Resets I18n global state (global dictionaries, and default language for instances) + * + * @method reset + * @static + * + **/ + I18n.reset = function( ) { + I18n.prototype._gDicts = [ ]; + I18n.prototype._gDict = { }; + I18n.prototype._gLang = 'pt_PT'; + }; + I18n.reset( ); + + /** + * Adds a dictionary to be used in all I18n instances for the corresponding language. + * + * @method appendGlobal + * @static + * + * @param dict {Object} Dictionary to be added + * @param lang {String} Language fo the dictionary being added + * + */ + I18n.appendGlobal = function( dict , lang ) { + if ( lang ) { + if ( !( lang in dict ) ) { + var obj = { }; + + obj[ lang ] = dict; + + dict = obj; + } + + if ( lang !== I18n.prototype._gLang ) { I18n.langGlobal( lang ); } + } + + I18n.prototype._gDicts.push( dict ); + + Ink.extendObj( I18n.prototype._gDict , dict[ I18n.prototype._gLang ] ); + }; + + I18n.append = function () { + // [3.1.0] remove this alias + Ink.warn('Ink.Util.I18n.append() was renamed to appendGlobal().'); + return I18n.appendGlobal.apply(I18n, [].slice.call(arguments)); + }; + + /** + * Gets or sets the current default language of I18n instances. + * + * @method langGlobal + * @param lang the new language for all I18n instances + * + * @static + * + * @return {String} language code + */ + I18n.langGlobal = function( lang ) { + if ( !arguments.length ) { return I18n.prototype._gLang; } + + if ( lang && I18n.prototype._gLang !== lang ) { + I18n.prototype._gLang = lang; + + I18n.prototype._gDict = { }; + + for ( var i = 0, l = I18n.prototype._gDicts.length; i < l; i++ ) { + Ink.extendObj( I18n.prototype._gDict , I18n.prototype._gDicts[ i ][ lang ] || { } ); + } + } + }; + + I18n.lang = function () { + // [3.1.0] remove this alias + Ink.warn('Ink.Util.I18n.lang() was renamed to langGlobal().'); + return I18n.langGlobal.apply(I18n, [].slice.call(arguments)); + }; + + return I18n; +}); +/** + * JSON Utilities + * @module Ink.Util.Json_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Json', '1', [], function() { + 'use strict'; + + var function_call = Function.prototype.call; + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; + + function twoDigits(n) { + var r = '' + n; + if (r.length === 1) { + return '0' + r; + } else { + return r; + } + } + + var dateToISOString = Date.prototype.toISOString ? + Ink.bind(function_call, Date.prototype.toISOString) : + function(date) { + // Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString + return date.getUTCFullYear() + + '-' + twoDigits( date.getUTCMonth() + 1 ) + + '-' + twoDigits( date.getUTCDate() ) + + 'T' + twoDigits( date.getUTCHours() ) + + ':' + twoDigits( date.getUTCMinutes() ) + + ':' + twoDigits( date.getUTCSeconds() ) + + '.' + String( (date.getUTCMilliseconds()/1000).toFixed(3) ).slice( 2, 5 ) + + 'Z'; + }; + + /** + * Use this class to convert JSON strings to JavaScript objects + * `.parse()` and also to do the opposite operation `.stringify()`. + * Internally, the standard JSON implementation is used if available + * Otherwise, the functions mimic the standard implementation. + * + * Here's how to produce JSON from an existing object: + * + * Ink.requireModules(['Ink.Util.Json_1'], function (Json) { + * var obj = { + * key1: 'value1', + * key2: 'value2', + * keyArray: ['arrayValue1', 'arrayValue2', 'arrayValue3'] + * }; + * Json.stringify(obj); // The above object as a JSON string + * }); + * + * And here is how to parse JSON: + * + * Ink.requireModules(['Ink.Util.Json_1'], function (Json) { + * var source = '{"key": "value", "array": [true, null, false]}'; + * Json.parse(source); // The above JSON string as an object + * }); + * + * @namespace Ink.Util.Json_1 + * @static + * + */ + var InkJson = { + _nativeJSON: window.JSON || null, + + _convertToUnicode: false, + + // Escape characters so as to embed them in JSON strings + _escape: function (theString) { + var _m = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\' }; + + if (/["\\\x00-\x1f]/.test(theString)) { + theString = theString.replace(/([\x00-\x1f\\"])/g, function(a, b) { + var c = _m[b]; + if (c) { + return c; + } + c = b.charCodeAt(); + return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16); + }); + } + + return theString; + }, + + // A character conversion map + _toUnicode: function (theString) + { + if(!this._convertToUnicode) { + return this._escape(theString); + } else { + var unicodeString = ''; + var inInt = false; + var theUnicode = false; + var i = 0; + var total = theString.length; + while(i < total) { + inInt = theString.charCodeAt(i); + if( (inInt >= 32 && inInt <= 126) || + //(inInt >= 48 && inInt <= 57) || + //(inInt >= 65 && inInt <= 90) || + //(inInt >= 97 && inInt <= 122) || + inInt === 8 || + inInt === 9 || + inInt === 10 || + inInt === 12 || + inInt === 13 || + inInt === 32 || + inInt === 34 || + inInt === 47 || + inInt === 58 || + inInt === 92) { + + if(inInt === 34 || inInt === 92 || inInt === 47) { + theUnicode = '\\'+theString.charAt(i); + } else if(inInt === 8) { + theUnicode = '\\b'; + } else if(inInt === 9) { + theUnicode = '\\t'; + } else if(inInt === 10) { + theUnicode = '\\n'; + } else if(inInt === 12) { + theUnicode = '\\f'; + } else if(inInt === 13) { + theUnicode = '\\r'; + } else { + theUnicode = theString.charAt(i); + } + } else { + if(this._convertToUnicode) { + theUnicode = theString.charCodeAt(i).toString(16)+''.toUpperCase(); + while (theUnicode.length < 4) { + theUnicode = '0' + theUnicode; + } + theUnicode = '\\u' + theUnicode; + } else { + theUnicode = theString.charAt(i); + } + } + unicodeString += theUnicode; + + i++; + } + + return unicodeString; + } + + }, + + _stringifyValue: function(param) { + if (typeof param === 'string') { + return '"' + this._toUnicode(param) + '"'; + } else if (typeof param === 'number' && (isNaN(param) || !isFinite(param))) { // Unusable numbers go null + return 'null'; + } else if (typeof param === 'undefined' || param === null) { // And so does undefined + return 'null'; + } else if (typeof param.toJSON === 'function') { + var t = param.toJSON(); + if (typeof t === 'string') { + return '"' + this._escape(t) + '"'; + } else { + return this._escape(t.toString()); + } + } else if (typeof param === 'number' || typeof param === 'boolean') { // These ones' toString methods return valid JSON. + return '' + param; + } else if (typeof param === 'function') { + return 'null'; // match JSON.stringify + } else if (param.constructor === Date) { + return '"' + this._escape(dateToISOString(param)) + '"'; + } else if (param.constructor === Array) { + var arrayString = ''; + for (var i = 0, len = param.length; i < len; i++) { + if (i > 0) { + arrayString += ','; + } + arrayString += this._stringifyValue(param[i]); + } + return '[' + arrayString + ']'; + } else { // Object + var objectString = ''; + for (var k in param) { + if ({}.hasOwnProperty.call(param, k)) { + if (objectString !== '') { + objectString += ','; + } + objectString += '"' + this._escape(k) + '": ' + this._stringifyValue(param[k]); + } + } + return '{' + objectString + '}'; + } + }, + + /** + * Serializes a JSON object into a string. + * + * @method stringify + * @param {Object} input Data to be serialized into JSON + * @param {Boolean} convertToUnicode When `true`, converts string contents to unicode \uXXXX + * @return {String} Serialized string + * + * @sample Ink_Util_Json_stringify.html + */ + stringify: function(input, convertToUnicode) { + this._convertToUnicode = !!convertToUnicode; + if(!this._convertToUnicode && this._nativeJSON) { + return this._nativeJSON.stringify(input); + } + return this._stringifyValue(input); // And recurse. + }, + + /** + * Parses a JSON text through a function + * + * @method parse + * @param text {String} Input string + * @param reviver {Function} Function receiving `(key, value)`, and `this`=(containing object), used to walk objects. + * + * @return {Object} JSON object + * + * @sample Ink_Util_Json_parse.html + */ + /* From https://github.com/douglascrockford/JSON-js/blob/master/json.js */ + parse: function (text, reviver) { + /*jshint evil:true*/ + +// The parse method takes a text and an optional reviver function, and returns +// a JavaScript value if the text is a valid JSON text. + + var j; + + function walk(holder, key) { + +// The walk method is used to recursively walk the resulting structure so +// that modifications can be made. + + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + + +// Parsing happens in four stages. In the first stage, we replace certain +// Unicode characters with escape sequences. JavaScript handles many characters +// incorrectly, either silently deleting them, or treating them as line endings. + + text = String(text); + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + +// In the second stage, we run the text against regular expressions that look +// for non-JSON patterns. We are especially concerned with '()' and 'new' +// because they can cause invocation, and '=' because it can cause mutation. +// But just to be safe, we want to reject all unexpected forms. + +// We split the second stage into 4 regexp operations in order to work around +// crippling inefficiencies in IE's and Safari's regexp engines. First we +// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we +// replace all simple value tokens with ']' characters. Third, we delete all +// open brackets that follow a colon or comma or that begin the text. Finally, +// we look to see that the remaining characters are only whitespace or ']' or +// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. + + if (/^[\],:{}\s]*$/ + .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') + .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + +// In the third stage we use the eval function to compile the text into a +// JavaScript structure. The '{' operator is subject to a syntactic ambiguity +// in JavaScript: it can begin a block or an object literal. We wrap the text +// in parens to eliminate the ambiguity. + + j = eval('(' + text + ')'); + +// In the optional fourth stage, we recursively walk the new structure, passing +// each name/value pair to a reviver function for possible transformation. + + return typeof reviver === 'function' ? + walk({'': j}, '') : + j; + } + +// If the text is not JSON parseable, then a SyntaxError is thrown. + + throw new SyntaxError('JSON.parse'); + } + }; + + return InkJson; +}); + +/** + * String Utilities + * @module Ink.Util.String_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.String', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.String_1 + */ + var InkUtilString = { + + /** + * List of special chars + * + * @property _chars + * @type {Array} + * @private + * @readOnly + * @static + */ + _chars: ['&','à','á','â','ã','ä','å','æ','ç','è','é', + 'ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô', + 'õ','ö','ø','ù','ú','û','ü','ý','þ','ÿ','À', + 'Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë', + 'Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö', + 'Ø','Ù','Ú','Û','Ü','Ý','Þ','€','\"','ß','<', + '>','¢','£','¤','¥','¦','§','¨','©','ª','«', + '¬','\xad','®','¯','°','±','²','³','´','µ','¶', + '·','¸','¹','º','»','¼','½','¾'], + + /** + * List of the special characters' html entities + * + * @property _entities + * @type {Array} + * @private + * @readOnly + * @static + */ + _entities: ['amp','agrave','aacute','acirc','atilde','auml','aring', + 'aelig','ccedil','egrave','eacute','ecirc','euml','igrave', + 'iacute','icirc','iuml','eth','ntilde','ograve','oacute', + 'ocirc','otilde','ouml','oslash','ugrave','uacute','ucirc', + 'uuml','yacute','thorn','yuml','Agrave','Aacute','Acirc', + 'Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute', + 'Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde', + 'Ograve','Oacute','Ocirc','Otilde','Ouml','Oslash','Ugrave', + 'Uacute','Ucirc','Uuml','Yacute','THORN','euro','quot','szlig', + 'lt','gt','cent','pound','curren','yen','brvbar','sect','uml', + 'copy','ordf','laquo','not','shy','reg','macr','deg','plusmn', + 'sup2','sup3','acute','micro','para','middot','cedil','sup1', + 'ordm','raquo','frac14','frac12','frac34'], + + /** + * List of accented chars + * + * @property _accentedChars + * @type {Array} + * @private + * @readOnly + * @static + */ + _accentedChars:['à','á','â','ã','ä','å', + 'è','é','ê','ë', + 'ì','í','î','ï', + 'ò','ó','ô','õ','ö', + 'ù','ú','û','ü', + 'ç','ñ', + 'À','Á','Â','Ã','Ä','Å', + 'È','É','Ê','Ë', + 'Ì','Í','Î','Ï', + 'Ò','Ó','Ô','Õ','Ö', + 'Ù','Ú','Û','Ü', + 'Ç','Ñ'], + + /** + * List of the accented chars (above), but without the accents + * + * @property _accentedRemovedChars + * @type {Array} + * @private + * @readOnly + * @static + */ + _accentedRemovedChars:['a','a','a','a','a','a', + 'e','e','e','e', + 'i','i','i','i', + 'o','o','o','o','o', + 'u','u','u','u', + 'c','n', + 'A','A','A','A','A','A', + 'E','E','E','E', + 'I','I','I','I', + 'O','O','O','O','O', + 'U','U','U','U', + 'C','N'], + /** + * Object that contains the basic HTML unsafe chars, as keys, and their HTML entities as values + * + * @property _htmlUnsafeChars + * @type {Object} + * @private + * @readOnly + * @static + */ + _htmlUnsafeChars:{'<':'<','>':'>','&':'&','"':'"',"'":'''}, + + /** + * Capitalizes a word. + * If param as more than one word, it converts first letter of all words that have more than 2 letters + * + * @method ucFirst + * @param {String} string String to capitalize. + * @param {Boolean} [firstWordOnly]=false Flag to capitalize only the first word. + * @return {String} Camel cased string. + * @public + * @static + * @sample Ink_Util_String_ucFirst.html + */ + ucFirst: function(string, firstWordOnly) { + var replacer = firstWordOnly ? /(^|\s)(\w)(\S{2,})/ : /(^|\s)(\w)(\S{2,})/g; + return string ? String(string).replace(replacer, function(_, $1, $2, $3){ + return $1 + $2.toUpperCase() + $3.toLowerCase(); + }) : string; + }, + + /** + * Trims whitespace from strings + * + * @method trim + * @param {String} string String to be trimmed + * @return {String} Trimmed string + * @public + * @static + * @sample Ink_Util_String_trim.html + */ + trim: function(string) + { + if (typeof string === 'string') { + return string.replace(/^\s+|\s+$|\n+$/g, ''); + } + return string; + }, + + /** + * Strips HTML tags from strings + * + * @method stripTags + * @param {String} string String to strip tags from. + * @param {String} allowed Comma separated list of allowed tags. + * @return {String} Stripped string + * @public + * @static + * @sample Ink_Util_String_stripTags.html + */ + stripTags: function(string, allowed) + { + if (allowed && typeof allowed === 'string') { + var aAllowed = InkUtilString.trim(allowed).split(','); + var aNewAllowed = []; + var cleanedTag = false; + for(var i=0; i < aAllowed.length; i++) { + if(InkUtilString.trim(aAllowed[i]) !== '') { + cleanedTag = InkUtilString.trim(aAllowed[i].replace(/(<|\>)/g, '').replace(/\s/, '')); + aNewAllowed.push('(<'+cleanedTag+'\\s[^>]+>|<(\\s|\\/)?(\\s|\\/)?'+cleanedTag+'>)'); + } + } + var strAllowed = aNewAllowed.join('|'); + var reAllowed = new RegExp(strAllowed, "i"); + + var aFoundTags = string.match(new RegExp("<[^>]*>", "g")); + + for(var j=0; j < aFoundTags.length; j++) { + if(!aFoundTags[j].match(reAllowed)) { + string = string.replace((new RegExp(aFoundTags[j], "gm")), ''); + } + } + return string; + } else { + return string.replace(/<[^\>]+\>/g, ''); + } + }, + + /** + * Encodes string into HTML entities. + * + * @method htmlEntitiesEncode + * @param {String} string + * @return {String} string encoded + * @public + * @static + * @sample Ink_Util_String_htmlEntitiesEncode.html + */ + htmlEntitiesEncode: function(string) + { + if (string && string.replace) { + var re = false; + for (var i = 0; i < InkUtilString._chars.length; i++) { + re = new RegExp(InkUtilString._chars[i], "gm"); + string = string.replace(re, '&' + InkUtilString._entities[i] + ';'); + } + } + return string; + }, + + /** + * Decodes string from HTML entities. + * + * @method htmlEntitiesDecode + * @param {String} string String to be decoded + * @return {String} Decoded string + * @public + * @static + * @sample Ink_Util_String_htmlEntitiesDecode.html + */ + htmlEntitiesDecode: function(string) + { + if (string && string.replace) { + var re = false; + for (var i = 0; i < InkUtilString._entities.length; i++) { + re = new RegExp("&"+InkUtilString._entities[i]+";", "gm"); + string = string.replace(re, InkUtilString._chars[i]); + } + string = string.replace(/&#[^;]+;?/g, function($0){ + if ($0.charAt(2) === 'x') { + return String.fromCharCode(parseInt($0.substring(3), 16)); + } + else { + return String.fromCharCode(parseInt($0.substring(2), 10)); + } + }); + } + return string; + }, + + /** + * Encode a string to UTF-8. + * + * @method utf8Encode + * @param {String} string String to be encoded + * @return {String} string UTF-8 encoded string + * @public + * @static + */ + utf8Encode: function(string) { + /*jshint bitwise:false*/ + string = string.replace(/\r\n/g,"\n"); + var utfstring = ""; + + for (var n = 0; n < string.length; n++) { + + var c = string.charCodeAt(n); + + if (c < 128) { + utfstring += String.fromCharCode(c); + } + else if((c > 127) && (c < 2048)) { + utfstring += String.fromCharCode((c >> 6) | 192); + utfstring += String.fromCharCode((c & 63) | 128); + } + else { + utfstring += String.fromCharCode((c >> 12) | 224); + utfstring += String.fromCharCode(((c >> 6) & 63) | 128); + utfstring += String.fromCharCode((c & 63) | 128); + } + + } + return utfstring; + }, + + /** + * Truncates a string without breaking words. + * + * @method shortString + * @param {String} str String to truncate + * @param {Number} n Number of chars of the short string + * @return {String} + * @public + * @static + * @sample Ink_Util_String_shortString.html + */ + shortString: function(str,n) { + var words = str.split(' '); + var resultstr = ''; + for(var i = 0; i < words.length; i++ ){ + if((resultstr + words[i] + ' ').length>=n){ + resultstr += '…'; + break; + } + resultstr += words[i] + ' '; + } + return resultstr; + }, + + /** + * Truncates a string, breaking words and adding ... at the end. + * + * @method truncateString + * @param {String} str String to truncate + * @param {Number} length Limit for the returned string, ellipsis included. + * @return {String} Truncated String + * @public + * @static + * @sample Ink_Util_String_truncateString.html + */ + truncateString: function(str, length) { + if(str.length - 1 > length) { + return str.substr(0, length - 1) + "\u2026"; + } else { + return str; + } + }, + + /** + * Decodes a string from UTF-8. + * + * @method utf8Decode + * @param {String} string String to be decoded + * @return {String} Decoded string + * @public + * @static + */ + utf8Decode: function(utfstring) { + /*jshint bitwise:false*/ + var string = ""; + var i = 0, c = 0, c2 = 0, c3 = 0; + + while ( i < utfstring.length ) { + + c = utfstring.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) { + c2 = utfstring.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + c2 = utfstring.charCodeAt(i+1); + c3 = utfstring.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + + } + return string; + }, + + /** + * Removes all accented characters from a string. + * + * @method removeAccentedChars + * @param {String} string String to remove accents from + * @return {String} String without accented chars + * @public + * @static + * @sample Ink_Util_String_removeAccentedChars.html + */ + removeAccentedChars: function(string) + { + var newString = string; + var re = false; + for (var i = 0; i < InkUtilString._accentedChars.length; i++) { + re = new RegExp(InkUtilString._accentedChars[i], "gm"); + newString = newString.replace(re, '' + InkUtilString._accentedRemovedChars[i] + ''); + } + return newString; + }, + + /** + * Count the number of occurrences of a specific needle in a haystack + * + * @method substrCount + * @param {String} haystack String to search in + * @param {String} needle String to search for + * @return {Number} Number of occurrences + * @public + * @static + * @sample Ink_Util_String_substrCount.html + */ + substrCount: function(haystack,needle) + { + return haystack ? haystack.split(needle).length - 1 : 0; + }, + + /** + * Eval a JSON - We recommend you Ink.Util.Json + * + * @method evalJSON + * @param {String} strJSON JSON string to eval + * @param {Boolean} sanitize Flag to sanitize input + * @return {Object} JS Object + * @public + * @static + */ + evalJSON: function(strJSON, sanitize) { + /* jshint evil:true */ + if( (typeof sanitize === 'undefined' || sanitize === null) || InkUtilString.isJSON(strJSON)) { + try { + if(typeof(JSON) !== "undefined" && typeof(JSON.parse) !== 'undefined'){ + return JSON.parse(strJSON); + } + return eval('('+strJSON+')'); + } catch(e) { + throw new Error('ERROR: Bad JSON string...'); + } + } + }, + + /** + * Checks if a string is a valid JSON object (string encoded) + * + * @method isJSON + * @param {String} str String to check + * @return {Boolean} + * @public + * @static + */ + isJSON: function(str) + { + str = str.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); + return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); + }, + + /** + * Escapes unsafe html chars as HTML entities + * + * @method htmlEscapeUnsafe + * @param {String} str String to escape + * @return {String} Escaped string + * @public + * @static + * @sample Ink_Util_String_htmlEscapeUnsafe.html + */ + htmlEscapeUnsafe: function(str){ + var chars = InkUtilString._htmlUnsafeChars; + return str !== null ? String(str).replace(/[<>&'"]/g,function(c){return chars[c];}) : str; + }, + + /** + * Normalizes whitespace in string. + * String is trimmed and sequences of whitespaces are collapsed. + * + * @method normalizeWhitespace + * @param {String} str String to normalize + * @return {String} Normalized string + * @public + * @static + * @sample Ink_Util_String_normalizeWhitespace.html + */ + normalizeWhitespace: function(str){ + return str !== null ? InkUtilString.trim(String(str).replace(/\s+/g,' ')) : str; + }, + + /** + * Converts string to unicode. + * + * @method toUnicode + * @param {String} str String to convert + * @return {String} Unicoded String + * @public + * @static + * @sample Ink_Util_String_toUnicode.html + */ + toUnicode: function(str) { + if (typeof str === 'string') { + var unicodeString = ''; + var inInt = false; + var theUnicode = false; + var total = str.length; + var i=0; + + while(i < total) + { + inInt = str.charCodeAt(i); + if( (inInt >= 32 && inInt <= 126) || + inInt === 8 || + inInt === 9 || + inInt === 10 || + inInt === 12 || + inInt === 13 || + inInt === 32 || + inInt === 34 || + inInt === 47 || + inInt === 58 || + inInt === 92) { + + /* + if(inInt == 34 || inInt == 92 || inInt == 47) { + theUnicode = '\\'+str.charAt(i); + } else { + } + */ + if(inInt === 8) { + theUnicode = '\\b'; + } else if(inInt === 9) { + theUnicode = '\\t'; + } else if(inInt === 10) { + theUnicode = '\\n'; + } else if(inInt === 12) { + theUnicode = '\\f'; + } else if(inInt === 13) { + theUnicode = '\\r'; + } else { + theUnicode = str.charAt(i); + } + } else { + theUnicode = str.charCodeAt(i).toString(16)+''.toUpperCase(); + while (theUnicode.length < 4) { + theUnicode = '0' + theUnicode; + } + theUnicode = '\\u' + theUnicode; + } + unicodeString += theUnicode; + + i++; + } + return unicodeString; + } + }, + + /** + * Escapes a unicode character. + * + * @method escape + * @param {String} c Character to escape + * @return {String} Escaped character. Returns \xXX if hex smaller than 0x100, otherwise \uXXXX + * @public + * @static + * @sample Ink_Util_String_escape.html + */ + escape: function(c) { + var hex = (c).charCodeAt(0).toString(16).split(''); + if (hex.length < 3) { + while (hex.length < 2) { hex.unshift('0'); } + hex.unshift('x'); + } + else { + while (hex.length < 4) { hex.unshift('0'); } + hex.unshift('u'); + } + + hex.unshift('\\'); + return hex.join(''); + }, + + /** + * Unescapes a unicode character escape sequence + * + * @method unescape + * @param {String} es Escape sequence + * @return {String} String un-unicoded + * @public + * @static + * @sample Ink_Util_String_unescape.html + */ + unescape: function(es) { + var idx = es.lastIndexOf('0'); + idx = idx === -1 ? 2 : Math.min(idx, 2); + //console.log(idx); + var hexNum = es.substring(idx); + //console.log(hexNum); + var num = parseInt(hexNum, 16); + return String.fromCharCode(num); + }, + + /** + * Escapes a string to unicode characters + * + * @method escapeText + * @param {String} txt + * @param {Array} [whiteList] Whitelist of characters + * @return {String} String escaped to Unicode + * @public + * @static + * @sample Ink_Util_String_escapeText.html + */ + escapeText: function(txt, whiteList) { + if (whiteList === undefined) { + whiteList = ['[', ']', '\'', ',']; + } + var txt2 = []; + var c, C; + for (var i = 0, f = txt.length; i < f; ++i) { + c = txt[i]; + C = c.charCodeAt(0); + if (C < 32 || C > 126 && whiteList.indexOf(c) === -1) { + c = InkUtilString.escape(c); + } + txt2.push(c); + } + return txt2.join(''); + }, + + /** + * Regex to check escaped strings + * + * @property escapedCharRegex + * @type {Regex} + * @public + * @readOnly + * @static + */ + escapedCharRegex: /(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4})/g, + + /** + * Unescapes a string + * + * @method unescapeText + * @param {String} txt + * @return {String} Unescaped string + * @public + * @static + * @sample Ink_Util_String_unescapeText.html + */ + unescapeText: function(txt) { + /*jshint boss:true */ + var m; + while (m = InkUtilString.escapedCharRegex.exec(txt)) { + m = m[0]; + txt = txt.replace(m, InkUtilString.unescape(m)); + InkUtilString.escapedCharRegex.lastIndex = 0; + } + return txt; + }, + + /** + * Compares two strings. + * + * @method strcmp + * @param {String} str1 First String + * @param {String} str2 Second String + * @return {Number} + * @public + * @static + * @sample Ink_Util_String_strcmp.html + */ + strcmp: function(str1, str2) { + return ((str1 === str2) ? 0 : ((str1 > str2) ? 1 : -1)); + }, + + /** + * Splits a string into smaller chunks + * + * @method packetize + * @param {String} str String to divide + * @param {Number} maxLen Maximum chunk size (in characters) + * @return {Array} Chunks of the original string + * @public + * @static + * @sample Ink_Util_String_packetize.html + */ + packetize: function(str, maxLen) { + var len = str.length; + var parts = new Array( Math.ceil(len / maxLen) ); + var chars = str.split(''); + var sz, i = 0; + while (len) { + sz = Math.min(maxLen, len); + parts[i++] = chars.splice(0, sz).join(''); + len -= sz; + } + return parts; + } + }; + + return InkUtilString; + +}); + +/** + * URL Utilities + * @module Ink.Util.Url_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Url', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.Url_1 + */ + var Url = { + + /** + * Auxiliary string for encoding + * + * @property _keyStr + * @type {String} + * @readOnly + * @private + */ + _keyStr : 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + + + /** + * Gets URL of current page + * + * @method getUrl + * @return Current URL + * @public + * @static + * @sample Ink_Util_Url_getUrl.html + */ + getUrl: function() + { + return window.location.href; + }, + + /** + * Generates an URL string. + * + * @method genQueryString + * @param {String} uri Base URL + * @param {Object} params Object to transform to query string + * @return {String} URI with query string set + * @public + * @static + * @sample Ink_Util_Url_genQueryString.html + */ + genQueryString: function(uri, params) { + var hasQuestionMark = uri.indexOf('?') !== -1; + var sep, pKey, pValue, parts = [uri]; + + for (pKey in params) { + if (params.hasOwnProperty(pKey)) { + if (!hasQuestionMark) { + sep = '?'; + hasQuestionMark = true; + } else { + sep = '&'; + } + pValue = params[pKey]; + if (typeof pValue !== 'number' && !pValue) { + pValue = ''; + } + parts = parts.concat([sep, encodeURIComponent(pKey), '=', encodeURIComponent(pValue)]); + } + } + + return parts.join(''); + }, + + /** + * Gets an object from an URL encoded string. + * + * @method getQueryString + * @param {String} [str] URL String. When not specified it uses the current URL. + * @return {Object} Key-Value pair object + * @public + * @static + * @sample Ink_Util_Url_getQueryString.html + */ + getQueryString: function(str) + { + var url; + if(str && typeof(str) !== 'undefined') { + url = str; + } else { + url = this.getUrl(); + } + var aParams = {}; + if(url.match(/\?(.+)/i)) { + var queryStr = url.replace(/^(.*)\?([^\#]+)(\#(.*))?/g, "$2"); + if(queryStr.length > 0) { + var aQueryStr = queryStr.split(/[;&]/); + for(var i=0; i < aQueryStr.length; i++) { + var pairVar = aQueryStr[i].split('='); + aParams[decodeURIComponent(pairVar[0])] = (typeof(pairVar[1]) !== 'undefined' && pairVar[1]) ? decodeURIComponent(pairVar[1]) : false; + } + } + } + return aParams; + }, + + /** + * Gets the URL hash value + * + * @method getAnchor + * @param {String} [str] URL String. Defaults to current page URL. + * @return {String|Boolean} Hash in the URL. If there's no hash, returns false. + * @public + * @static + * @sample Ink_Util_Url_getAnchor.html + */ + getAnchor: function(str) + { + var url; + if(str && typeof(str) !== 'undefined') { + url = str; + } else { + url = this.getUrl(); + } + var anchor = false; + if(url.match(/#(.+)/)) { + anchor = url.replace(/([^#]+)#(.*)/, "$2"); + } + return anchor; + }, + + /** + * Gets the anchor string of an URL + * + * @method getAnchorString + * @param {String} [string] URL to parse. Defaults to current URL. + * @return {Object} Key-value pair object of the URL's hashtag 'variables' + * @public + * @static + * @sample Ink_Util_Url_getAnchorString.html + */ + getAnchorString: function(string) + { + var url; + if(string && typeof(string) !== 'undefined') { + url = string; + } else { + url = this.getUrl(); + } + var aParams = {}; + if(url.match(/#(.+)/i)) { + var anchorStr = url.replace(/^([^#]+)#(.*)?/g, "$2"); + if(anchorStr.length > 0) { + var aAnchorStr = anchorStr.split(/[;&]/); + for(var i=0; i < aAnchorStr.length; i++) { + var pairVar = aAnchorStr[i].split('='); + aParams[decodeURIComponent(pairVar[0])] = (typeof(pairVar[1]) !== 'undefined' && pairVar[1]) ? decodeURIComponent(pairVar[1]) : false; + } + } + } + return aParams; + }, + + + /** + * Parses URL string into URL parts + * + * @method parseUrl + * @param {String} url URL to be parsed + * @return {Object} Parsed URL as a key-value object. + * @public + * @static + * @sample Ink_Util_Url_parseUrl.html + */ + parseUrl: function(url) { + var aURL = {}; + if(url && typeof url === 'string') { + if(url.match(/^([^:]+):\/\//i)) { + var re = /^([^:]+):\/\/([^\/]*)\/?([^\?#]*)\??([^#]*)#?(.*)/i; + if(url.match(re)) { + aURL.scheme = url.replace(re, "$1"); + aURL.host = url.replace(re, "$2"); + aURL.path = '/'+url.replace(re, "$3"); + aURL.query = url.replace(re, "$4") || false; + aURL.fragment = url.replace(re, "$5") || false; + } + } else { + var re1 = new RegExp("^([^\\?]+)\\?([^#]+)#(.*)", "i"); + var re2 = new RegExp("^([^\\?]+)\\?([^#]+)#?", "i"); + var re3 = new RegExp("^([^\\?]+)\\??", "i"); + if(url.match(re1)) { + aURL.scheme = false; + aURL.host = false; + aURL.path = url.replace(re1, "$1"); + aURL.query = url.replace(re1, "$2"); + aURL.fragment = url.replace(re1, "$3"); + } else if(url.match(re2)) { + aURL.scheme = false; + aURL.host = false; + aURL.path = url.replace(re2, "$1"); + aURL.query = url.replace(re2, "$2"); + aURL.fragment = false; + } else if(url.match(re3)) { + aURL.scheme = false; + aURL.host = false; + aURL.path = url.replace(re3, "$1"); + aURL.query = false; + aURL.fragment = false; + } + } + if(aURL.host) { + var regPort = /^(.*?)\\:(\\d+)$/i; + // check for port + if(aURL.host.match(regPort)) { + var tmpHost1 = aURL.host; + aURL.host = tmpHost1.replace(regPort, "$1"); + aURL.port = tmpHost1.replace(regPort, "$2"); + } else { + aURL.port = false; + } + // check for user and pass + if(aURL.host.match(/@/i)) { + var tmpHost2 = aURL.host; + aURL.host = tmpHost2.split('@')[1]; + var tmpUserPass = tmpHost2.split('@')[0]; + if(tmpUserPass.match(/\:/)) { + aURL.user = tmpUserPass.split(':')[0]; + aURL.pass = tmpUserPass.split(':')[1]; + } else { + aURL.user = tmpUserPass; + aURL.pass = false; + } + } + } + } + return aURL; + }, + + /** + * Formats an URL object into an URL string. + * + * @method format + * @param urlObj Window.location, a.href, or parseUrl object to format + * @return {String} Full URL. + */ + format: function (urlObj) { + var protocol = ''; + var host = ''; + var path = ''; + var frag = ''; + var query = ''; + + if (typeof urlObj.protocol === 'string') { + protocol = urlObj.protocol + '//'; // here it comes with the colon + } else if (typeof urlObj.scheme === 'string') { + protocol = urlObj.scheme + '://'; + } + + host = urlObj.host || urlObj.hostname || ''; + path = urlObj.path || ''; + + if (typeof urlObj.query === 'string') { + query = urlObj.query; + } else if (typeof urlObj.search === 'string') { + query = urlObj.search.replace(/^\?/, ''); + } + if (typeof urlObj.fragment === 'string') { + frag = urlObj.fragment; + } else if (typeof urlObj.hash === 'string') { + frag = urlObj.hash.replace(/#$/, ''); + } + + return [ + protocol, + host, + path, + query && '?' + query, + frag && '#' + frag + ].join(''); + }, + + /** + * Gets the last loaded script element + * + * @method currentScriptElement + * @param {String} [match] String to match against the script src attribute + * @return {DOMElement|Boolean} Returns the `script` DOM Element or false if unable to find it. + * @public + * @static + * @sample Ink_Util_Url_currentScriptElement.html + */ + currentScriptElement: function(match) + { + var aScripts = document.getElementsByTagName('script'); + if(typeof(match) === 'undefined') { + if(aScripts.length > 0) { + return aScripts[(aScripts.length - 1)]; + } else { + return false; + } + } else { + var curScript = false; + var re = new RegExp(""+match+"", "i"); + for(var i=0, total = aScripts.length; i < total; i++) { + curScript = aScripts[i]; + if(re.test(curScript.src)) { + return curScript; + } + } + return false; + } + }, + + + /* + base64Encode: function(string) + { + /** + * --function {String} ? + * --Convert a string to BASE 64 + * @param {String} string - string to convert + * @return base64 encoded string + * + * + if(!SAPO.Utility.String || typeof(SAPO.Utility.String) === 'undefined') { + throw "SAPO.Utility.Url.base64Encode depends of SAPO.Utility.String, which has not been referred."; + } + + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + + var input = SAPO.Utility.String.utf8Encode(string); + + while (i < input.length) { + + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); + } + return output; + }, + base64Decode: function(string) + { + * --function {String} ? + * Decode a BASE 64 encoded string + * --param {String} string base64 encoded string + * --return string decoded + if(!SAPO.Utility.String || typeof(SAPO.Utility.String) === 'undefined') { + throw "SAPO.Utility.Url.base64Decode depends of SAPO.Utility.String, which has not been referred."; + } + + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + + var input = string.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + while (i < input.length) { + + enc1 = this._keyStr.indexOf(input.charAt(i++)); + enc2 = this._keyStr.indexOf(input.charAt(i++)); + enc3 = this._keyStr.indexOf(input.charAt(i++)); + enc4 = this._keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output = output + String.fromCharCode(chr1); + + if (enc3 !== 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 !== 64) { + output = output + String.fromCharCode(chr3); + } + } + output = SAPO.Utility.String.utf8Decode(output); + return output; + }, + */ + + + /** + * Debug function ? + * + * @method _debug + * @private + * @static + */ + _debug: function() {} + + }; + + return Url; + +}); + +/** + * Validation Utilities + * @module Ink.Util.Validator_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Validator', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.Validator_1 + */ + var Validator = { + + /** + * List of country codes avaible for the isPhone method + * + * @property _countryCodes + * @type {Array} + * @private + * @static + * @readOnly + */ + _countryCodes : [ + 'AO', + 'CV', + 'MZ', + 'PT' + ], + + /** + * International number for portugal + * + * @property _internacionalPT + * @type {Number} + * @private + * @static + * @readOnly + * + */ + _internacionalPT: 351, + + /** + * List of all portuguese number prefixes + * + * @property _indicativosPT + * @type {Object} + * @private + * @static + * @readOnly + * + */ + _indicativosPT: { + 21: 'lisboa', + 22: 'porto', + 231: 'mealhada', + 232: 'viseu', + 233: 'figueira da foz', + 234: 'aveiro', + 235: 'arganil', + 236: 'pombal', + 238: 'seia', + 239: 'coimbra', + 241: 'abrantes', + 242: 'ponte de sôr', + 243: 'santarém', + 244: 'leiria', + 245: 'portalegre', + 249: 'torres novas', + 251: 'valença', + 252: 'vila nova de famalicão', + 253: 'braga', + 254: 'peso da régua', + 255: 'penafiel', + 256: 'são joão da madeira', + 258: 'viana do castelo', + 259: 'vila real', + 261: 'torres vedras', + 262: 'caldas da raínha', + 263: 'vila franca de xira', + 265: 'setúbal', + 266: 'évora', + 268: 'estremoz', + 269: 'santiago do cacém', + 271: 'guarda', + 272: 'castelo branco', + 273: 'bragança', + 274: 'proença-a-nova', + 275: 'covilhã', + 276: 'chaves', + 277: 'idanha-a-nova', + 278: 'mirandela', + 279: 'moncorvo', + 281: 'tavira', + 282: 'portimão', + 283: 'odemira', + 284: 'beja', + 285: 'moura', + 286: 'castro verde', + 289: 'faro', + 291: 'funchal, porto santo', + 292: 'corvo, faial, flores, horta, pico', + 295: 'angra do heroísmo, graciosa, são jorge, terceira', + 296: 'ponta delgada, são miguel, santa maria', + + 91 : 'rede móvel 91 (Vodafone / Yorn)', + 93 : 'rede móvel 93 (Optimus)', + 96 : 'rede móvel 96 (TMN)', + 92 : 'rede móvel 92 (TODOS)', + //925 : 'rede móvel 925 (TMN 925)', + //926 : 'rede móvel 926 (TMN 926)', + //927 : 'rede móvel 927 (TMN 927)', + //922 : 'rede móvel 922 (Phone-ix)', + + 707: 'número único', + 760: 'número único', + 800: 'número grátis', + 808: 'chamada local', + 30: 'voip' + }, + /** + * International number for Cabo Verde + * + * @property _internacionalCV + * @type {Number} + * @private + * @static + * @readOnly + */ + _internacionalCV: 238, + + /** + * List of all Cabo Verde number prefixes + * + * @property _indicativosCV + * @type {Object} + * @private + * @static + * @readOnly + */ + _indicativosCV: { + 2: 'fixo', + 91: 'móvel 91', + 95: 'móvel 95', + 97: 'móvel 97', + 98: 'móvel 98', + 99: 'móvel 99' + }, + /** + * International number for Angola + * + * @property _internacionalAO + * @type {Number} + * @private + * @static + * @readOnly + */ + _internacionalAO: 244, + + /** + * List of all Angola number prefixes + * + * @property _indicativosAO + * @type {Object} + * @private + * @static + * @readOnly + */ + _indicativosAO: { + 2: 'fixo', + 91: 'móvel 91', + 92: 'móvel 92' + }, + /** + * International number for Mozambique + * + * @property _internacionalMZ + * @type {Number} + * @private + * @static + * @readOnly + */ + _internacionalMZ: 258, + + /** + * List of all Mozambique number prefixes + * + * @property _indicativosMZ + * @type {Object} + * @private + * @static + * @readOnly + */ + _indicativosMZ: { + 2: 'fixo', + 82: 'móvel 82', + 84: 'móvel 84' + }, + + /** + * International number for Timor + * + * @property _internacionalTL + * @type {Number} + * @private + * @static + * @readOnly + */ + _internacionalTL: 670, + + /** + * List of all Timor number prefixes + * + * @property _indicativosTL + * @type {Object} + * @private + * @static + * @readOnly + */ + _indicativosTL: { + 3: 'fixo', + 7: 'móvel 7' + }, + + /** + * Regular expression groups for several groups of characters + * + * http://en.wikipedia.org/wiki/C0_Controls_and_Basic_Latin + * http://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane + * http://en.wikipedia.org/wiki/ISO_8859-1 + * + * @property _characterGroups + * @type {Object} + * @private + * @static + * @readOnly + */ + _characterGroups: { + numbers: ['0-9'], + asciiAlpha: ['a-zA-Z'], + latin1Alpha: ['a-zA-Z', '\u00C0-\u00FF'], + unicodeAlpha: ['a-zA-Z', '\u00C0-\u00FF', '\u0100-\u1FFF', '\u2C00-\uD7FF'], + /* whitespace characters */ + space: [' '], + dash: ['-'], + underscore: ['_'], + nicknamePunctuation: ['_.-'], + + singleLineWhitespace: ['\t '], + newline: ['\n'], + whitespace: ['\t\n\u000B\f\r\u00A0 '], + + asciiPunctuation: ['\u0021-\u002F', '\u003A-\u0040', '\u005B-\u0060', '\u007B-\u007E'], + latin1Punctuation: ['\u0021-\u002F', '\u003A-\u0040', '\u005B-\u0060', '\u007B-\u007E', '\u00A1-\u00BF', '\u00D7', '\u00F7'], + unicodePunctuation: ['\u0021-\u002F', '\u003A-\u0040', '\u005B-\u0060', '\u007B-\u007E', '\u00A1-\u00BF', '\u00D7', '\u00F7', '\u2000-\u206F', '\u2E00-\u2E7F', '\u3000-\u303F'] + }, + + /** + * Creates a regular expression for several character groups. + * + * @method createRegExp + * + * @param Groups* {Object} + * Groups to build regular expressions for. Possible keys are: + * + * - **numbers**: 0-9 + * - **asciiAlpha**: a-z, A-Z + * - **latin1Alpha**: asciiAlpha, plus printable characters in latin-1 + * - **unicodeAlpha**: unicode alphanumeric characters. + * - **space**: ' ', the space character. + * - **dash**: dash character. + * - **underscore**: underscore character. + * - **nicknamePunctuation**: dash, dot, underscore + * - **singleLineWhitespace**: space and tab (whitespace which only spans one line). + * - **newline**: newline character ('\n') + * - **whitespace**: whitespace characters in the ASCII character set. + * - **asciiPunctuation**: punctuation characters in the ASCII character set. + * - **latin1Punctuation**: punctuation characters in latin-1. + * - **unicodePunctuation**: punctuation characters in unicode. + * + */ + createRegExp: function (groups) { + var re = '^['; + for (var key in groups) if (groups.hasOwnProperty(key)) { + if (!(key in Validator._characterGroups)) { + throw new Error('group ' + key + ' is not a valid character group'); + } else if (groups[key]) { + re += Validator._characterGroups[key].join(''); + } + } + if (re === '^[') { + // No changes + return new RegExp('$^'); // match nothing + } + return new RegExp(re + ']*?$'); + }, + + /** + * Checks if a field has the required groups. + * + * @method checkCharacterGroups + * @param {String} s The validation string + * @param {Object} [groups]={} What groups are included. See createRegexp + * @sample Ink_Util_Validator_checkCharacterGroups.html + */ + checkCharacterGroups: function (s, groups) { + return Validator.createRegExp(groups).test(s); + }, + + /** + * Checks if a field contains unicode printable characters. + * + * @method unicode + * @param {String} s The validation string + * @param {Object} [options]={} Optional configuration object. See createRegexp + */ + unicode: function (s, options) { + return Validator.checkCharacterGroups(s, Ink.extendObj({ + unicodeAlpha: true}, options)); + }, + + /** + * Checks if a field only contains latin-1 alphanumeric characters. + * Takes options for allowing singleline whitespace, cross-line whitespace and punctuation. + * + * @method latin1 + * + * @param {String} s The validation string + * @param {Object} [options]={} Optional configuration object. See createRegexp + * @sample Ink_Util_Validator_latin1.html + */ + latin1: function (s, options) { + return Validator.checkCharacterGroups(s, Ink.extendObj({ + latin1Alpha: true}, options)); + }, + + /** + * Checks if a field only contains only ASCII alphanumeric characters. + * Takes options for allowing singleline whitespace, cross-line whitespace and punctuation. + * + * @method ascii + * + * @param {String} s The validation string + * @param {Object} [options]={} Optional configuration object. See createRegexp + * @sample Ink_Util_Validator_ascii.html + */ + ascii: function (s, options) { + return Validator.checkCharacterGroups(s, Ink.extendObj({ + asciiAlpha: true}, options)); + }, + + /** + * Checks if a number is a valid + * + * @method number + * @param {String} numb The number + * @param {Object} [options] Further options + * @param [options.decimalSep]='.' Allow decimal separator. + * @param [options.thousandSep]="," Strip this character from the number. + * @param [options.negative]=false Allow negative numbers. + * @param [options.decimalPlaces]=null Maximum number of decimal places. Use `0` for an integer number. + * @param [options.max]=null Maximum number + * @param [options.min]=null Minimum number + * @param [options.returnNumber]=false When this option is true, return the number itself when the value is valid. + * @sample Ink_Util_Validator_number.html + */ + number: function (numb, inOptions) { + numb = numb + ''; + var options = Ink.extendObj({ + decimalSep: '.', + thousandSep: '', + negative: true, + decimalPlaces: null, + maxDigits: null, + max: null, + min: null, + returnNumber: false + }, inOptions || {}); + // smart recursion thing sets up aliases for options. + if (options.thousandSep) { + numb = numb.replace(new RegExp('\\' + options.thousandSep, 'g'), ''); + options.thousandSep = ''; + return Validator.number(numb, options); + } + if (options.negative === false) { + options.min = 0; + options.negative = true; + return Validator.number(numb, options); + } + if (options.decimalSep !== '.') { + numb = numb.replace(new RegExp('\\' + options.decimalSep, 'g'), '.'); + } + + if (!/^(-)?(\d+)?(\.\d+)?$/.test(numb) || numb === '') { + return false; // forbidden character found + } + + var split; + if (options.decimalSep && numb.indexOf(options.decimalSep) !== -1) { + split = numb.split(options.decimalSep); + if (options.decimalPlaces !== null && + split[1].length > options.decimalPlaces) { + return false; + } + } else { + split = ['' + numb, '']; + } + + if (options.maxDigits!== null) { + if (split[0].replace(/-/g, '').length > options.maxDigits) { + return split; + } + } + + // Now look at the actual float + var ret = parseFloat(numb); + + if (options.maxExcl !== null && ret >= options.maxExcl || + options.minExcl !== null && ret <= options.minExcl) { + return false; + } + if (options.max !== null && ret > options.max || + options.min !== null && ret < options.min) { + return false; + } + + if (options.returnNumber) { + return ret; + } else { + return true; + } + }, + + /** + * Checks if a year is Leap "Bissexto" + * + * @method _isLeapYear + * @param {Number} year Year to be checked + * @return {Boolean} True if it is a leap year. + * @private + * @static + * @example + * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){ + * console.log( InkValidator._isLeapYear( 2004 ) ); // Result: true + * console.log( InkValidator._isLeapYear( 2006 ) ); // Result: false + * }); + */ + _isLeapYear: function(year){ + + var yearRegExp = /^\d{4}$/; + + if(yearRegExp.test(year)){ + return ((year%4) ? false: ((year%100) ? true : ((year%400)? false : true)) ); + } + + return false; + }, + + /** + * Object with the date formats available for validation + * + * @property _dateParsers + * @type {Object} + * @private + * @static + * @readOnly + */ + _dateParsers: { + 'yyyy-mm-dd': {day:5, month:3, year:1, sep: '-', parser: /^(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/}, + 'yyyy/mm/dd': {day:5, month:3, year:1, sep: '/', parser: /^(\d{4})(\/)(\d{1,2})(\/)(\d{1,2})$/}, + 'yy-mm-dd': {day:5, month:3, year:1, sep: '-', parser: /^(\d{2})(\-)(\d{1,2})(\-)(\d{1,2})$/}, + 'yy/mm/dd': {day:5, month:3, year:1, sep: '/', parser: /^(\d{2})(\/)(\d{1,2})(\/)(\d{1,2})$/}, + 'dd-mm-yyyy': {day:1, month:3, year:5, sep: '-', parser: /^(\d{1,2})(\-)(\d{1,2})(\-)(\d{4})$/}, + 'dd/mm/yyyy': {day:1, month:3, year:5, sep: '/', parser: /^(\d{1,2})(\/)(\d{1,2})(\/)(\d{4})$/}, + 'dd-mm-yy': {day:1, month:3, year:5, sep: '-', parser: /^(\d{1,2})(\-)(\d{1,2})(\-)(\d{2})$/}, + 'dd/mm/yy': {day:1, month:3, year:5, sep: '/', parser: /^(\d{1,2})(\/)(\d{1,2})(\/)(\d{2})$/} + }, + + /** + * Gets the number of days in a given month of a given year + * + * @method _daysInMonth + * @param {Number} _m Month (1 to 12) + * @param {Number} _y Year + * @return {Number} Returns the number of days in a given month of a given year + * @private + * @static + * @example + * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){ + * console.log( InkValidator._daysInMonth( 2, 2004 ) ); // Result: 29 + * console.log( InkValidator._daysInMonth( 2, 2006 ) ); // Result: 28 + * }); + */ + _daysInMonth: function(_m,_y){ + var nDays=0; + + _m = parseInt(_m, 10); + _y = parseInt(_y, 10); + + if(_m===1 || _m===3 || _m===5 || _m===7 || _m===8 || _m===10 || _m===12) { + nDays= 31; + } else if ( _m===4 || _m===6 || _m===9 || _m===11) { + nDays = 30; + } else if (_m===2) { + if((_y%400===0) || (_y%4===0 && _y%100!==0)) { + nDays = 29; + } else { + nDays = 28; + } + } + + return nDays; + }, + + + + /** + * Checks if a date is valid + * + * @method _isValidDate + * @param {Number} year + * @param {Number} month + * @param {Number} day + * @return {Boolean} True if valid + * @private + * @static + * @example + * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){ + * console.log( InkValidator._isValidDate( 2004, 2, 29 ) ); // Result: true + * console.log( InkValidator._isValidDate( 2006, 2, 29 ) ); // Result: false + * }); + */ + _isValidDate: function(year, month, day){ + + var yearRegExp = /^\d{4}$/; + var validOneOrTwo = /^\d{1,2}$/; + if(yearRegExp.test(year) && validOneOrTwo.test(month) && validOneOrTwo.test(day)){ + if(month>=1 && month<=12 && day>=1 && this._daysInMonth(month,year)>=day){ + return true; + } + } + + return false; + }, + + /** + * Checks if an email is valid + * + * @method mail + * @param {String} email + * @return {Boolean} True if it's valid + * @public + * @static + * @sample Ink_Util_Validator_mail.html + */ + email: function(email) + { + var emailValido = new RegExp("^[_a-z0-9-]+((\\.|\\+)[_a-z0-9-]+)*@([\\w]*-?[\\w]*\\.)+[a-z]{2,4}$", "i"); + if(!emailValido.test(email)) { + return false; + } else { + return true; + } + }, + + /** + * Deprecated. Alias for email(). Use it instead. + * + * @method mail + * @public + * @static + * @private + */ + mail: function (mail) { return Validator.email(mail); }, + + /** + * Checks if an url is valid + * + * @method url + * @param {String} url URL to be checked + * @param {Boolean} [full] If true, validates a full URL (one that should start with 'http') + * @return {Boolean} True if valid + * @public + * @static + * @sample Ink_Util_Validator_url.html + */ + url: function(url, full) + { + if(typeof full === "undefined" || full === false) { + var reHTTP = new RegExp("(^(http\\:\\/\\/|https\\:\\/\\/)(.+))", "i"); + if(reHTTP.test(url) === false) { + url = 'http://'+url; + } + } + + var reUrl = new RegExp("^(http:\\/\\/|https:\\/\\/)([\\w]*(-?[\\w]*)*\\.)+[a-z]{2,4}", "i"); + if(reUrl.test(url) === false) { + return false; + } else { + return true; + } + }, + + /** + * Checks if a phone is valid in Portugal + * + * @method isPTPhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid Portuguese Phone + * @public + * @static + * @sample Ink_Util_Validator_isPTPhone.html + */ + isPTPhone: function(phone) + { + + phone = phone.toString(); + var aInd = []; + for(var i in this._indicativosPT) { + if(typeof(this._indicativosPT[i]) === 'string') { + aInd.push(i); + } + } + var strInd = aInd.join('|'); + + var re351 = /^(00351|\+351)/; + if(re351.test(phone)) { + phone = phone.replace(re351, ""); + } + + var reSpecialChars = /(\s|\-|\.)+/g; + phone = phone.replace(reSpecialChars, ''); + //var reInt = new RegExp("\\d", "i"); + var reInt = /[\d]{9}/i; + if(phone.length === 9 && reInt.test(phone)) { + var reValid = new RegExp("^("+strInd+")"); + if(reValid.test(phone)) { + return true; + } + } + + return false; + }, + + /** + * Alias function for isPTPhone + * + * @method isPortuguesePhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid Portuguese Phone + * @public + * @static + */ + isPortuguesePhone: function(phone) + { + return this.isPTPhone(phone); + }, + + /** + * Checks if a phone is valid in Cabo Verde + * + * @method isCVPhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid Cape Verdean Phone + * @public + * @static + * @sample Ink_Util_Validator_isCVPhone.html + */ + isCVPhone: function(phone) + { + phone = phone.toString(); + var aInd = []; + for(var i in this._indicativosCV) { + if(typeof(this._indicativosCV[i]) === 'string') { + aInd.push(i); + } + } + var strInd = aInd.join('|'); + + var re238 = /^(00238|\+238)/; + if(re238.test(phone)) { + phone = phone.replace(re238, ""); + } + + var reSpecialChars = /(\s|\-|\.)+/g; + phone = phone.replace(reSpecialChars, ''); + //var reInt = new RegExp("\\d", "i"); + var reInt = /[\d]{7}/i; + if(phone.length === 7 && reInt.test(phone)) { + var reValid = new RegExp("^("+strInd+")"); + if(reValid.test(phone)) { + return true; + } + } + + return false; + }, + + /** + * Checks if a phone is valid in Angola + * + * @method isAOPhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid Angolan Phone + * @public + * @static + * @sample Ink_Util_Validator_isAOPhone.html + */ + isAOPhone: function(phone) + { + + phone = phone.toString(); + var aInd = []; + for(var i in this._indicativosAO) { + if(typeof(this._indicativosAO[i]) === 'string') { + aInd.push(i); + } + } + var strInd = aInd.join('|'); + + var re244 = /^(00244|\+244)/; + if(re244.test(phone)) { + phone = phone.replace(re244, ""); + } + + var reSpecialChars = /(\s|\-|\.)+/g; + phone = phone.replace(reSpecialChars, ''); + //var reInt = new RegExp("\\d", "i"); + var reInt = /[\d]{9}/i; + if(phone.length === 9 && reInt.test(phone)) { + var reValid = new RegExp("^("+strInd+")"); + if(reValid.test(phone)) { + return true; + } + } + + return false; + }, + + /** + * Checks if a phone is valid in Mozambique + * + * @method isMZPhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid Mozambican Phone + * @public + * @static + * @sample Ink_Util_Validator_isMZPhone.html + */ + isMZPhone: function(phone) + { + + phone = phone.toString(); + var aInd = []; + for(var i in this._indicativosMZ) { + if(typeof(this._indicativosMZ[i]) === 'string') { + aInd.push(i); + } + } + var strInd = aInd.join('|'); + var re258 = /^(00258|\+258)/; + if(re258.test(phone)) { + phone = phone.replace(re258, ""); + } + + var reSpecialChars = /(\s|\-|\.)+/g; + phone = phone.replace(reSpecialChars, ''); + //var reInt = new RegExp("\\d", "i"); + var reInt = /[\d]{8,9}/i; + if((phone.length === 9 || phone.length === 8) && reInt.test(phone)) { + var reValid = new RegExp("^("+strInd+")"); + if(reValid.test(phone)) { + if(phone.indexOf('2') === 0 && phone.length === 8) { + return true; + } else if(phone.indexOf('8') === 0 && phone.length === 9) { + return true; + } + } + } + + return false; + }, + + /** + * Checks if a phone is valid in Timor + * + * @method isTLPhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid phone from Timor-Leste + * @public + * @static + * @sample Ink_Util_Validator_isTLPhone.html + */ + isTLPhone: function(phone) + { + + phone = phone.toString(); + var aInd = []; + for(var i in this._indicativosTL) { + if(typeof(this._indicativosTL[i]) === 'string') { + aInd.push(i); + } + } + var strInd = aInd.join('|'); + var re670 = /^(00670|\+670)/; + if(re670.test(phone)) { + phone = phone.replace(re670, ""); + } + + + var reSpecialChars = /(\s|\-|\.)+/g; + phone = phone.replace(reSpecialChars, ''); + //var reInt = new RegExp("\\d", "i"); + var reInt = /[\d]{7}/i; + if(phone.length === 7 && reInt.test(phone)) { + var reValid = new RegExp("^("+strInd+")"); + if(reValid.test(phone)) { + return true; + } + } + + return false; + }, + + /** + * Checks if a number is a phone number. + * This method validates the number in all country codes available the ones set in the second param + * + * @method isPhone + * @param {String} phone Phone number to validate + * @param {String|Array} [countryCode] Country code or array of countries to validate + * @return {Boolean} True if it's a valid phone in any country available + * @public + * @static + * @sample Ink_Util_Validator_isPhone.html + */ + isPhone: function(){ + var index; + + if(arguments.length===0){ + return false; + } + + var phone = arguments[0]; + + if(arguments.length>1){ + if(arguments[1].constructor === Array){ + var func; + for(index=0; index= 0 && match[i-1] <= 100){ + valid = true; + } else { + return false; + } + } + // check 0 to 255 values + if(i===1 || i===3 || i===5 && (typeof match[i+1] === "undefined" || match[i+1] === "")){ + if(typeof match[i] !== "undefined" && match[i] >= 0 && match[i] <= 255){ + valid = true; + } else { + return false; + } + } + } + } + + // hsl range check + if((match = hsl.exec(str)) !== null || (match = hsla.exec(str)) !== null){ + i = match.length; + while(i--){ + // check percentage values + if(i===3 || i===5){ + if(typeof match[i-1] !== "undefined" && typeof match[i] !== "undefined" && match[i] !== "" && + match[i-1] >= 0 && match[i-1] <= 100){ + valid = true; + } else { + return false; + } + } + // check 0 to 360 value + if(i===1){ + if(typeof match[i] !== "undefined" && match[i] >= 0 && match[i] <= 360){ + valid = true; + } else { + return false; + } + } + } + } + + return valid; + }, + + /** + * Checks if the value is a valid IP. + * + * @method isIP + * @param {String} value Value to be checked + * @param {String} ipType Type of IP to be validated. The values are: ipv4, ipv6. By default is ipv4. + * @return {Boolean} True if the value is a valid IP address. False if not. + * @sample Ink_Util_Validator_isIP.html + */ + isIP: function( value, ipType ){ + if( typeof value !== 'string' ){ + return false; + } + + ipType = (ipType || 'ipv4').toLowerCase(); + + switch( ipType ){ + case 'ipv4': + return (/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/).test(value); + case 'ipv6': + return (/^\s*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}, + + /** + * Credit Card specifications, to be used in the credit card verification. + * + * @property _creditCardSpecs + * @type {Object} + * @private + */ + _creditCardSpecs: { + 'default': { + 'length': '13,14,15,16,17,18,19', + 'prefix': /^.+/, + 'luhn': true + }, + + 'american express': { + 'length': '15', + 'prefix': /^3[47]/, + 'luhn' : true + }, + + 'diners club': { + 'length': '14,16', + 'prefix': /^36|55|30[0-5]/, + 'luhn' : true + }, + + 'discover': { + 'length': '16', + 'prefix': /^6(?:5|011)/, + 'luhn' : true + }, + + 'jcb': { + 'length': '15,16', + 'prefix': /^3|1800|2131/, + 'luhn' : true + }, + + 'maestro': { + 'length': '16,18', + 'prefix': /^50(?:20|38)|6(?:304|759)/, + 'luhn' : true + }, + + 'mastercard': { + 'length': '16', + 'prefix': /^5[1-5]/, + 'luhn' : true + }, + + 'visa': { + 'length': '13,16', + 'prefix': /^4/, + 'luhn' : true + } + }, + + /** + * Luhn function, to be used when validating credit cards + * + */ + _luhn: function (num){ + + num = parseInt(num,10); + + if ( (typeof num !== 'number') && (num % 1 !== 0) ){ + // Luhn can only be used on nums! + return false; + } + + num = num+''; + // Check num length + var length = num.length; + + // Checksum of the card num + var + i, checksum = 0 + ; + + for (i = length - 1; i >= 0; i -= 2) + { + // Add up every 2nd digit, starting from the right + checksum += parseInt(num.substr(i, 1),10); + } + + for (i = length - 2; i >= 0; i -= 2) + { + // Add up every 2nd digit doubled, starting from the right + var dbl = parseInt(num.substr(i, 1) * 2,10); + + // Subtract 9 from the dbl where value is greater than 10 + checksum += (dbl >= 10) ? (dbl - 9) : dbl; + } + + // If the checksum is a multiple of 10, the number is valid + return (checksum % 10 === 0); + }, + + /** + * Checks if a number is of a specific credit card type + * @method isCreditCard + * @param {String} num Number to be validates + * @param {String|Array} creditCardType Credit card type. See _creditCardSpecs for the list of supported values. + * @return {Boolean} + * @sample Ink_Util_Validator_isCreditCard.html + */ + isCreditCard: function(num, creditCardType){ + + if ( /\d+/.test(num) === false ){ + return false; + } + + if ( typeof creditCardType === 'undefined' ){ + creditCardType = 'default'; + } + else if ( creditCardType instanceof Array ){ + var i, ccLength = creditCardType.length; + for ( i=0; i < ccLength; i++ ){ + // Test each type for validity + if (this.isCreditCard(num, creditCardType[i]) ){ + return true; + } + } + + return false; + } + + // Check card type + creditCardType = creditCardType.toLowerCase(); + + if ( typeof this._creditCardSpecs[creditCardType] === 'undefined' ){ + return false; + } + + // Check card number length + var length = num.length+''; + + // Validate the card length by the card type + if ( this._creditCardSpecs[creditCardType]['length'].split(",").indexOf(length) === -1 ){ + return false; + } + + // Check card number prefix + if ( !this._creditCardSpecs[creditCardType]['prefix'].test(num) ){ + return false; + } + + // No Luhn check required + if (this._creditCardSpecs[creditCardType]['luhn'] === false){ + return true; + } + + return this._luhn(num); + } + }; + + return Validator; + +}); + +/** + * Animate.css Utility + * + * This module is a wrapper around animate.css's CSS classes to produce animation. + * It contains options to ease common tasks, like listen to the "animationend" event with all necessary prefixes, remove the necessary class names when the animation finishes, or configure the duration of your animation with the necessary browser prefix. + * + * @module Ink.UI.Animate_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.Animate', 1, ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Css_1'], function (Common, InkEvent, Css) { + 'use strict'; + + var animationPrefix = (function (el) { + return ('animationName' in el.style) ? 'animation' : + ('oAnimationName' in el.style) ? 'oAnimation' : + ('msAnimationName' in el.style) ? 'msAnimation' : + ('webkitAnimationName' in el.style) ? 'webkitAnimation' : null; + }(document.createElement('div'))); + + var animationEndEventName = { + animation: 'animationend', + oAnimation: 'oanimationend', + msAnimation: 'MSAnimationEnd', + webkitAnimation: 'webkitAnimationEnd' + }[animationPrefix]; + + /** + * @class Ink.UI.Animate_1 + * @constructor + * + * @param {DOMElement} element Animated element + * @param {Object} options Options object + * @param {String} options.animation Animation name + * @param {String|Number} [options.duration] Duration name (fast|medium|slow) or duration in milliseconds. Defaults to 'medium'. + * @param {Boolean} [options.removeClass] Flag to remove the CSS class when finished animating. Defaults to false. + * @param {Function} [options.onEnd] Callback for the animation end + * + * @sample Ink_UI_Animate_1.html + * + **/ + function Animate() { + Common.BaseUIComponent.apply(this, arguments); + } + + Animate._name = 'Animate_1'; + + Animate._optionDefinition = { + trigger: ['Element', null], + duration: ['String', 'slow'], // Actually a string with a duration name, or a number of ms + animation: ['String'], + removeClass: ['Boolean', true], + onEnd: ['Function', function () {}] + }; + + Animate.prototype._init = function () { + if (!isNaN(parseInt(this._options.duration, 10))) { + this._options.duration = parseInt(this._options.duration, 10); + } + + if (this._options.trigger) { + InkEvent.observe(this._options.trigger, 'click', Ink.bind(function () { + this.animate(); + }, this)); // later + } else { + this.animate(); + } + }; + + Animate.prototype.animate = function () { + Animate.animate(this._element, this._options.animation, this._options); + }; + + Ink.extendObj(Animate, { + /** + * Browser prefix for the CSS animations. + * + * @property _animationPrefix + * @private + **/ + _animationPrefix: animationPrefix, + + /** + * Boolean which says whether this browser has CSS3 animation support. + * + * @property animationSupported + **/ + animationSupported: !!animationPrefix, + + /** + * Prefixed 'animationend' event name. + * + * @property animationEndEventName + **/ + animationEndEventName: animationEndEventName, + + /** + * Animate an element using one of the animate.css classes + * + * **Note: This is a utility method inside the `Animate` class, which you can access through `Animate.animate()`. Do not mix these up.** + * + * @static + * @method animate + * @param element {DOMElement} animated element + * @param animation {String} animation name + * @param [options] {Object} + * @param [options.onEnd=null] {Function} callback for animation end + * @param [options.removeClass=false] {Boolean} whether to remove the Css class when finished + * @param [options.duration=medium] {String|Number} duration name (fast|medium|slow) or duration in ms + * + * @sample Ink_UI_Animate_1_animate.html + **/ + animate: function (element, animation, options) { + element = Common.elOrSelector(element); + + if (typeof options === 'number' || typeof options === 'string') { + options = { duration: options }; + } else if (!options) { + options = {}; + } + + if (typeof arguments[3] === 'function') { + options.onEnd = arguments[3]; + } + + if (typeof options.duration !== 'number' && typeof options.duration !== 'string') { + options.duration = 400; + } + + if (!Animate.animationSupported) { + if (options.onEnd) { + setTimeout(function () { + options.onEnd(null); + }, 0); + } + return; + } + + if (typeof options.duration === 'number') { + element.style[animationPrefix + 'Duration'] = options.duration + 'ms'; + } else if (typeof options.duration === 'string') { + Css.addClassName(element, options.duration); + } + + Css.addClassName(element, ['animated', animation]); + + function onAnimationEnd(event) { + if (event.target !== element) { return; } + if (event.animationName !== animation) { return; } + if (options.onEnd) { options.onEnd(event); } + if (options.removeClass) { + Css.removeClassName(element, animation); + } + if (typeof options.duration === 'string') { + Css.removeClassName(element, options.duration); + } + element.removeEventListener(animationEndEventName, onAnimationEnd, false); + } + + element.addEventListener(animationEndEventName, onAnimationEnd, false); + } + }); + + Common.createUIComponent(Animate); + + return Animate; +}); + +/** + * Flexible Carousel + * @module Ink.UI.Carousel_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.Carousel', '1', + ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Css_1', 'Ink.Dom.Element_1', 'Ink.UI.Pagination_1', 'Ink.Dom.Browser_1', 'Ink.Dom.Selector_1'], + function(Common, InkEvent, Css, InkElement, Pagination, Browser/*, Selector*/) { + 'use strict'; + + /* + * TODO: + * keyboardSupport + */ + + function limitRange(n, min, max) { + return Math.min(max, Math.max(min, n)); + } + + var requestAnimationFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || + function (cb) {return setTimeout(cb, 1000 / 30); }; + + /** + * @class Ink.UI.Carousel_1 + * @constructor + * + * @param {String|DOMElement} selector DOM element or element id + * @param {Object} [options] Carousel Options + * @param {Integer} [options.autoAdvance] Milliseconds to wait before auto-advancing pages. Set to 0 to disable auto-advance. Defaults to 0. + * @param {String} [options.axis] Axis of the carousel. Set to 'y' for a vertical carousel. Defaults to 'x'. + * @param {Number} [options.initialPage] Initial index page of the carousel. Defaults to 0. + * @param {Boolean} [options.spaceAfterLastSlide=true] If there are not enough slides to fill the full width of the last page, leave white space. Defaults to `true`. + * @param {Boolean} [options.swipe] Enable swipe support if available. Defaults to true. + * @param {Mixed} [options.pagination] Either an ul element to add pagination markup to or an `Ink.UI.Pagination` instance to use. + * @param {Function} [options.onChange] Callback to be called when the page changes. + * + * @sample Ink_UI_Carousel_1.html + */ + function Carousel() { + Common.BaseUIComponent.apply(this, arguments); + } + + Carousel._name = 'Carousel_1'; + + Carousel._optionDefinition = { + autoAdvance: ['Integer', 0], + axis: ['String', 'x'], + initialPage: ['Integer', 0], + spaceAfterLastSlide: ['Boolean', true], + hideLast: ['Boolean', false], + // [3.1.0] Deprecate "center". It is only needed when things are of unknown widths. + center: ['Boolean', false], + keyboardSupport:['Boolean', false], + pagination: ['String', null], + onChange: ['Function', null], + onInit: ['Function', function () {}], + swipe: ['Boolean', true] + // TODO exponential swipe + // TODO specify break point for next page when moving finger + }; + + Carousel.prototype = { + _init: function () { + this._handlers = { + paginationChange: Ink.bindMethod(this, '_onPaginationChange'), + windowResize: InkEvent.throttle(Ink.bindMethod(this, 'refit'), 200) + }; + + InkEvent.observe(window, 'resize', this._handlers.windowResize); + + this._isY = (this._options.axis === 'y'); + + var ulEl = Ink.s('ul.stage', this._element); + this._ulEl = ulEl; + + InkElement.removeTextNodeChildren(ulEl); + + if (this._options.pagination == null) { + this._currentPage = this._options.initialPage; + } + + this.refit(); // recalculate this._numPages + + if (this._isY) { + // Override white-space: no-wrap which is only necessary to make sure horizontal stuff stays horizontal, but breaks stuff intended to be vertical. + this._ulEl.style.whiteSpace = 'normal'; + } + + if (this._options.swipe) { + InkEvent.observe(this._element, 'touchstart', Ink.bindMethod(this, '_onTouchStart')); + InkEvent.observe(this._element, 'touchmove', Ink.bindMethod(this, '_onTouchMove')); + InkEvent.observe(this._element, 'touchend', Ink.bindMethod(this, '_onTouchEnd')); + } + + this._setUpPagination(); + this._setUpAutoAdvance(); + this._setUpHider(); + + this._options.onInit.call(this, this); + }, + + /** + * Repositions elements around. + * Measure the carousel once again, adjusting the involved elements' sizes. This is called automatically when the window resizes, in order to cater for changes from responsive media queries, for instance. + * + * @method refit + * @public + */ + refit: function() { + var _isY = this._isY; + + var size = function (elm, perpendicular) { + if (!elm) { return 0; } + + if (!perpendicular) { + return InkElement.outerDimensions(elm)[_isY ? 1 : 0]; + } else { + return InkElement.outerDimensions(elm)[_isY ? 0 : 1]; + } + }; + + this._liEls = Ink.ss('li.slide', this._ulEl); + var numSlides = this._liEls.length; + + var contRect = this._ulEl.getBoundingClientRect(); + this._ctnLength = _isY ? contRect.bottom - contRect.top : contRect.right - contRect.left; + this._elLength = size(this._liEls[0]); + this._slidesPerPage = Math.floor( this._ctnLength / this._elLength ) || 1; + if (!isFinite(this._slidesPerPage)) { this._slidesPerPage = 1; } + + var numPages = Math.ceil( numSlides / this._slidesPerPage ); + var numPagesChanged = this._numPages !== numPages; + this._numPages = numPages; + this._deltaLength = this._slidesPerPage * this._elLength; + + this._center(); + this._updateHider(); + this._IE7(); + + if (this._pagination && numPagesChanged) { + this._pagination.setSize(this._numPages); + } + this.setPage(limitRange(this.getPage(), 0, this._numPages)); + }, + + _setUpPagination: function () { + if (this._options.pagination) { + if (Common.isDOMElement(this._options.pagination) || + typeof this._options.pagination === 'string') { + // if dom element or css selector string... + this._pagination = new Pagination(this._options.pagination, { + size: this._numPages, + onChange: this._handlers.paginationChange + }); + } else { + // assumes instantiated pagination + this._pagination = this._options.pagination; + this._pagination._options.onChange = this._handlers.paginationChange; + this._pagination.setSize(this._numPages); + } + this._pagination.setCurrent(this._options.initialPage || 0); + } else { + this._currentPage = this._options.initialPage || 0; + } + }, + + _setUpAutoAdvance: function () { + if (!this._options.autoAdvance) { return; } + var self = this; + + setTimeout(function autoAdvance() { + self.nextPage(true /* wrap */); + setTimeout(autoAdvance, self._options.autoAdvance); + }, this._options.autoAdvance); + }, + + _setUpHider: function () { + if (this._options.hideLast) { + var hiderEl = InkElement.create('div', { + className: 'hider', + insertBottom: this._element + }); + hiderEl.style.position = 'absolute'; + hiderEl.style[ this._isY ? 'left' : 'top' ] = '0'; // fix to top.. + hiderEl.style[ this._isY ? 'right' : 'bottom' ] = '0'; // and bottom... + hiderEl.style[ this._isY ? 'bottom' : 'right' ] = '0'; // and move to the end. + this._hiderEl = hiderEl; + } + }, + + // [3.1.0] Deprecate this already + _center: function() { + if (!this._options.center) { return; } + var gap = Math.floor( (this._ctnLength - (this._elLength * this._slidesPerPage) ) / 2 ); + + var pad; + if (this._isY) { + pad = [gap, 'px 0']; + } else { + pad = ['0 ', gap, 'px']; + } + + this._ulEl.style.padding = pad.join(''); + }, + + // [3.1.0] Deprecate this already + _updateHider: function() { + if (!this._hiderEl) { return; } + if (this.getPage() === 0) { + var gap = Math.floor( this._ctnLength - (this._elLength * this._slidesPerPage) ); + if (this._options.center) { + gap /= 2; + } + this._hiderEl.style[ this._isY ? 'height' : 'width' ] = gap + 'px'; + } else { + this._hiderEl.style[ this._isY ? 'height' : 'width' ] = '0px'; + } + }, + + /** + * Refits elements for IE7 because it doesn't support inline-block. + * + * @method _IE7 + * @private + */ + _IE7: function () { + if (Browser.IE && '' + Browser.version.split('.')[0] === '7') { + // var numPages = this._numPages; + var slides = Ink.ss('li.slide', this._ulEl); + var stl = function (prop, val) {slides[i].style[prop] = val; }; + for (var i = 0, len = slides.length; i < len; i++) { + stl('position', 'absolute'); + stl(this._isY ? 'top' : 'left', (i * this._elLength) + 'px'); + } + } + }, + + _onTouchStart: function (event) { + if (event.touches.length > 1) { return; } + + this._swipeData = { + x: InkEvent.pointerX(event), + y: InkEvent.pointerY(event) + }; + + var ulRect = this._ulEl.getBoundingClientRect(); + + this._swipeData.firstUlPos = ulRect[this._isY ? 'top' : 'left']; + + this._swipeData.inUlX = this._swipeData.x - ulRect.left; + this._swipeData.inUlY = this._swipeData.y - ulRect.top; + + setTransitionProperty(this._ulEl, 'none'); + + this._touchMoveIsFirstTouchMove = true; + }, + + _onTouchMove: function (event) { + if (event.touches.length > 1) { return; /* multitouch event, not my problem. */ } + + var pointerX = InkEvent.pointerX(event); + var pointerY = InkEvent.pointerY(event); + + var deltaY = Math.abs(pointerY - this._swipeData.y); + var deltaX = Math.abs(pointerX - this._swipeData.x); + + if (this._touchMoveIsFirstTouchMove) { + this._touchMoveIsFirstTouchMove = undefined; + this._scrolling = this._isY ? + deltaX > deltaY : + deltaY > deltaX ; + + if (!this._scrolling) { + this._onAnimationFrame(); + } + } + + if (!this._scrolling && this._swipeData) { + InkEvent.stopDefault(event); + + this._swipeData.pointerPos = this._isY ? pointerY : pointerX; + } + }, + + _onAnimationFrame: function () { + var swipeData = this._swipeData; + + if (!swipeData || this._scrolling || this._touchMoveIsFirstTouchMove) { return; } + + var elRect = this._element.getBoundingClientRect(); + + var newPos; + + if (!this._isY) { + newPos = swipeData.pointerPos - swipeData.inUlX - elRect.left; + } else { + newPos = swipeData.pointerPos - swipeData.inUlY - elRect.top; + } + + this._ulEl.style[this._isY ? 'top' : 'left'] = newPos + 'px'; + + requestAnimationFrame(Ink.bindMethod(this, '_onAnimationFrame')); + }, + + _onTouchEnd: function (event) { + if (this._swipeData && this._swipeData.pointerPos && !this._scrolling && !this._touchMoveIsFirstTouchMove) { + var snapToNext = 0.1; // swipe 10% of the way to change page + + var relProgress = this._swipeData.firstUlPos - + this._ulEl.getBoundingClientRect()[this._isY ? 'top' : 'left']; + + var curPage = this.getPage(); + + // How many pages were advanced? May be fractional. + var progressInPages = relProgress / this._elLength / this._slidesPerPage; + + // Have we advanced enough to change page? + if (Math.abs(progressInPages) > snapToNext) { + curPage += Math[ relProgress < 0 ? 'floor' : 'ceil' ](progressInPages); + } + + // If something used to calculate progressInPages was zero, we get NaN here. + if (!isNaN(curPage)) { + this.setPage(curPage); + } + + InkEvent.stopDefault(event); + } + + setTransitionProperty(this._ulEl, null /* transition: left, top */); + this._swipeData = null; + this._touchMoveIsFirstTouchMove = undefined; + this._scrolling = undefined; + }, + + _onPaginationChange: function(pgn) { + this._setPage(pgn.getCurrent()); + }, + + /** + * Gets the current page index + * @method getPage + * @return The current page number + **/ + getPage: function () { + if (this._pagination) { + return this._pagination.getCurrent(); + } else { + return this._currentPage || 0; + } + }, + + /** + * Sets the current page index + * @method setPage + * @param {Number} page Index of the destination page. + * @param {Boolean} [wrap] Flag to activate circular counting. + **/ + setPage: function (page, wrap) { + if (wrap) { + // Pages outside the range [0..this._numPages] are wrapped. + page = page % this._numPages; + if (page < 0) { page = this._numPages - page; } + } + page = limitRange(page, 0, this._numPages - 1); + + if (this._pagination) { + this._pagination.setCurrent(page); // _setPage is called by pagination because it listens to its Change event. + } else { + this._setPage(page); + } + }, + + _setPage: function (page) { + var _lengthToGo = page * this._deltaLength; + var isLastPage = page === (this._numPages - 1); + + if (!this._options.spaceAfterLastSlide && isLastPage && page > 0) { + var _itemsInLastPage = this._liEls.length - (page * this._slidesPerPage); + if(_itemsInLastPage < this._slidesPerPage) { + _lengthToGo = ((page - 1) * this._deltaLength) + (_itemsInLastPage * this._elLength); + } + } + + this._ulEl.style[ this._isY ? 'top' : 'left'] = + ['-', _lengthToGo, 'px'].join(''); + + if (this._options.onChange) { + this._options.onChange.call(this, page); + } + + this._currentPage = page; + + this._updateHider(); + }, + + /** + * Goes to the next page + * @method nextPage + * @param {Boolean} [wrap] Flag to loop from last page to first page. + **/ + nextPage: function (wrap) { + this.setPage(this.getPage() + 1, wrap); + }, + + /** + * Goes to the previous page + * @method previousPage + * @param {Boolean} [wrap] Flag to loop from first page to last page. + **/ + previousPage: function (wrap) { this.setPage(this.getPage() - 1, wrap); }, + + /** + * Returns how many slides fit into a page + * @method getSlidesPerPage + * @return {Number} The number of slides per page + * @public + */ + getSlidesPerPage: function() { + return this._slidesPerPage; + }, + + /** + * Get the amount of pages in the carousel. + * @method getTotalPages + * @return {Number} The number of pages + * @public + */ + getTotalPages: function() { + return this._numPages; + }, + + /** + * Get the stage element (your UL with the class ".stage"). + * @method getStageElm + * @public + * @return {DOMElement} Stage element + **/ + getStageElm: function() { + return this._ulEl; + }, + + /** + * Get a list of your slides (elements with the ".slide" class inside your stage) + * @method getSlidesList + * @return {DOMElement[]} Array containing the slides. + * @public + */ + getSlidesList: function() { + return this._liEls; + }, + + /** + * Get the total number of slides + * @method getTotalSlides + * @return {Number} The number of slides + * @public + */ + getTotalSlides: function() { + return this.getSlidesList().length; + } + }; + + function setTransitionProperty(el, newTransition) { + el.style.transitionProperty = + el.style.oTransitionProperty = + el.style.msTransitionProperty = + el.style.mozTransitionProperty = + el.style.webkitTransitionProperty = newTransition; + } + + Common.createUIComponent(Carousel); + + return Carousel; + +}); + +/** + * Closing utilities + * @module Ink.UI.Close_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Close', '1', ['Ink.Dom.Event_1','Ink.Dom.Element_1'], function(InkEvent, InkElement) { + 'use strict'; + + /** + * Subscribes clicks on the document.body. + * Whenever an element with the classes ".ink-close" or ".ink-dismiss" is clicked, this module finds an ancestor ".ink-alert" or ".ink-alert-block" element and removes it from the DOM. + * This module should be created only once per page. + * + * @class Ink.UI.Close + * @constructor + * @example + * + * + * @sample Ink_UI_Close_1.html + */ + var Close = function() { + InkEvent.observe(document.body, 'click', function(ev) { + var el = InkEvent.element(ev); + + el = InkElement.findUpwardsByClass(el, 'ink-close') || + InkElement.findUpwardsByClass(el, 'ink-dismiss'); + + if (!el) { + return; // ink-close or ink-dismiss class not found + } + + var toRemove = InkElement.findUpwardsByClass(el, 'ink-alert') || + InkElement.findUpwardsByClass(el, 'ink-alert-block') || + el; + + if (toRemove) { + InkEvent.stop(ev); + InkElement.remove(toRemove); + } + }); + }; + + Close._name = 'Close_1'; + + return Close; +}); + +/** + * Auxiliar utilities for UI Modules + * @module Ink.UI.Common_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.Common', '1', ['Ink.Dom.Element_1', 'Ink.Net.Ajax_1','Ink.Dom.Css_1','Ink.Dom.Selector_1','Ink.Util.Url_1'], function(InkElement, Ajax,Css,Selector,Url) { + + 'use strict'; + + var nothing = {} /* a marker, for reference comparison. */; + + var keys = Object.keys || function (obj) { + var ret = []; + for (var k in obj) if (obj.hasOwnProperty(k)) { + ret.push(k); + } + return ret; + }; + + var es6WeakMapSupport = 'WeakMap' in window; + var instances = es6WeakMapSupport ? new WeakMap() : null; + + var domRegistry = { + get: function get(el) { + return es6WeakMapSupport ? + instances.get(el) : + el.__InkInstances; + }, + set: function set(el, thing) { + if (es6WeakMapSupport) { + instances.set(el, thing); + } else { + el.__InkInstances = thing; + } + } + }; + + /** + * @namespace Ink.UI.Common_1 + */ + + var Common = { + + /** + * Supported Ink Layouts + * + * @property Layouts + * @type Object + * @readOnly + */ + Layouts: { + TINY: 'tiny', + SMALL: 'small', + MEDIUM: 'medium', + LARGE: 'large', + XLARGE: 'xlarge' + }, + + /** + * Checks if an item is a valid DOM Element. + * + * @method isDOMElement + * @static + * @param {Mixed} o The object to be checked. + * @return {Boolean} True if it's a valid DOM Element. + * @example + * var el = Ink.s('#element'); + * if( Ink.UI.Common.isDOMElement( el ) === true ){ + * // It is a DOM Element. + * } else { + * // It is NOT a DOM Element. + * } + */ + isDOMElement: InkElement.isDOMElement, + + /** + * Checks if an item is a valid integer. + * + * @method isInteger + * @static + * @param {Mixed} n The value to be checked. + * @return {Boolean} True if it's a valid integer. + * @example + * var value = 1; + * if( Ink.UI.Common.isInteger( value ) === true ){ + * // It is an integer. + * } else { + * // It is NOT an integer. + * } + */ + isInteger: function(n) { + return (typeof n === 'number' && n % 1 === 0); + }, + + /** + * Gets a DOM Element. + * + * @method elOrSelector + * @static + * @param {DOMElement|String} elOrSelector DOM Element or CSS Selector + * @param {String} fieldName The name of the field. Commonly used for debugging. + * @return {DOMElement} Returns the DOMElement passed or the first result of the CSS Selector. Otherwise it throws an exception. + * @example + * // In case there are several .myInput, it will retrieve the first found + * var el = Ink.UI.Common.elOrSelector('.myInput','My Input'); + */ + elOrSelector: function(elOrSelector, fieldName) { + if (!this.isDOMElement(elOrSelector)) { + var t = Selector.select(elOrSelector); + if (t.length === 0) { + Ink.warn(fieldName + ' must either be a DOM Element or a selector expression!\nThe script element must also be after the DOM Element itself.'); + return null; + } + return t[0]; + } + return elOrSelector; + }, + + /** + * Alias for `elOrSelector` but returns an array of elements. + * + * @method elsOrSelector + * + * @static + * @param {DOMElement|String} elOrSelector DOM Element or CSS Selector + * @param {String} fieldName The name of the field. Commonly used for debugging. + * @return {DOMElement} Returns the DOMElement passed or the first result of the CSS Selector. Otherwise it throws an exception. + * @param {Boolean} required Flag to accept an empty array as output. + * @return {Array} The selected DOM Elements. + * @example + * var elements = Ink.UI.Common.elsOrSelector('input.my-inputs', 'My Input'); + */ + elsOrSelector: function(elsOrSelector, fieldName, required) { + var ret; + if (typeof elsOrSelector === 'string') { + ret = Selector.select(elsOrSelector); + } else if (Common.isDOMElement(elsOrSelector)) { + ret = [elsOrSelector]; + } else if (elsOrSelector && typeof elsOrSelector === 'object' && typeof elsOrSelector.length === 'number') { + ret = elsOrSelector; + } + + if (ret && ret.length) { + return ret; + } else { + if (required) { + throw new TypeError(fieldName + ' must either be a DOM Element, an Array of elements, or a selector expression!\nThe script element must also be after the DOM Element itself.'); + } else { + return []; + } + } + }, + + /** + * Gets options an object and element's metadata. + * + * The element's data attributes take precedence. Values from the element's data-atrributes are coerced into the required type. + * + * @method options + * + * @param {Object} [fieldId] Name to be used in debugging features. + * @param {Object} defaults Object with the options' types and defaults. + * @param {Object} overrides Options to override the defaults. Usually passed when instantiating an UI module. + * @param {DOMElement} [element] Element with data-attributes + * + * @example + * + * this._options = Ink.UI.Common.options('MyComponent', { + * 'anobject': ['Object', null], // Defaults to null + * 'target': ['Element', null], + * 'stuff': ['Number', 0.1], + * 'stuff2': ['Integer', 0], + * 'doKickFlip': ['Boolean', false], + * 'targets': ['Elements'], // Required option since no default was given + * 'onClick': ['Function', null] + * }, options || {}, elm) + * + * @example + * + * ### Note about booleans + * + * Here is how options are read from the markup + * data-attributes, for several values`data-a-boolean`. + * + * Options considered true: + * + * - `data-a-boolean="true"` + * - (Every other value which is not on the list below.) + * + * Options considered false: + * + * - `data-a-boolean="false"` + * - `data-a-boolean=""` + * - `data-a-boolean` + * + * Options which go to default: + * + * - (no attribute). When `data-a-boolean` is ommitted, the + * option is not considered true nor false, and as such + * defaults to what is in the `defaults` argument. + * + **/ + options: function (fieldId, defaults, overrides, element) { + if (typeof fieldId !== 'string') { + element = overrides; + overrides = defaults; + defaults = fieldId; + fieldId = ''; + } + overrides = overrides || {}; + var out = {}; + var dataAttrs = element ? InkElement.data(element) : {}; + var fromDataAttrs; + var type; + var lType; + var defaultVal; + + var invalidStr = function (str) { + if (fieldId) { str = fieldId + ': "' + ('' + str).replace(/"/, '\\"') + '"'; } + return str; + }; + + var quote = function (str) { + return '"' + ('' + str).replace(/"/, '\\"') + '"'; + }; + + var invalidThrow = function (str) { + throw new Error(invalidStr(str)); + }; + + var invalid = function (str) { + Ink.error(invalidStr(str) + '. Ignoring option.'); + }; + + function optionValue(key) { + type = defaults[key][0]; + lType = type.toLowerCase(); + defaultVal = defaults[key].length === 2 ? defaults[key][1] : nothing; + + if (!type) { + invalidThrow('Ink.UI.Common.options: Always specify a type!'); + } + if (!(lType in Common._coerce_funcs)) { + invalidThrow('Ink.UI.Common.options: ' + defaults[key][0] + ' is not a valid type. Use one of ' + keys(Common._coerce_funcs).join(', ')); + + } + if (!defaults[key].length || defaults[key].length > 2) { + invalidThrow('the "defaults" argument must be an object mapping option names to [typestring, optional] arrays.'); + } + + if (key in dataAttrs) { + fromDataAttrs = Common._coerce_from_string(lType, dataAttrs[key], key, fieldId); + // (above can return `nothing`) + } else { + fromDataAttrs = nothing; + } + + if (fromDataAttrs !== nothing) { + if (!Common._options_validate(fromDataAttrs, lType)) { + invalid('(' + key + ' option) Invalid ' + lType + ' ' + quote(fromDataAttrs)); + return defaultVal; + } else { + return fromDataAttrs; + } + } else if (key in overrides) { + return overrides[key]; + } else if (defaultVal !== nothing) { + return defaultVal; + } else { + invalidThrow('Option ' + key + ' is required!'); + } + } + + for (var key in defaults) { + if (defaults.hasOwnProperty(key)) { + out[key] = optionValue(key); + } + } + + return out; + }, + + _coerce_from_string: function (type, val, paramName, fieldId) { + if (type in Common._coerce_funcs) { + return Common._coerce_funcs[type](val, paramName, fieldId); + } else { + return val; + } + }, + + _options_validate: function (val, type) { + if (type in Common._options_validate_types) { + return Common._options_validate_types[type].call(Common, val); + } else { + // 'object' options cannot be passed through data-attributes. + // Json you say? Not any good to embed in HTML. + return false; + } + }, + + _coerce_funcs: (function () { + var ret = { + element: function (val) { + return Common.elOrSelector(val, ''); + }, + elements: function (val) { + return Common.elsOrSelector(val, '', false /*not required, so don't throw an exception now*/); + }, + object: function (val) { return val; }, + number: function (val) { return parseFloat(val); }, + 'boolean': function (val) { + return !(val === 'false' || val === '' || val === null); + }, + string: function (val) { return val; }, + 'function': function (val, paramName, fieldId) { + Ink.error(fieldId + ': You cannot specify the option "' + paramName + '" through data-attributes because it\'s a function'); + return nothing; + } + }; + ret['float'] = ret.integer = ret.number; + return ret; + }()), + + _options_validate_types: (function () { + var types = { + string: function (val) { + return typeof val === 'string'; + }, + number: function (val) { + return typeof val === 'number' && !isNaN(val) && isFinite(val); + }, + integer: function (val) { + return val === Math.round(val); + }, + element: function (val) { + return Common.isDOMElement(val); + }, + elements: function (val) { + return val && typeof val === 'object' && typeof val.length === 'number' && val.length; + }, + 'boolean': function (val) { + return typeof val === 'boolean'; + }, + object: function () { return true; } + }; + types['float'] = types.number; + return types; + }()), + + /** + * Deep copy (clone) an object. + * Note: The object cannot have referece loops. + * + * @method clone + * @static + * @param {Object} o The object to be cloned/copied. + * @return {Object} Returns the result of the clone/copy. + * @example + * var originalObj = { + * key1: 'value1', + * key2: 'value2', + * key3: 'value3' + * }; + * var cloneObj = Ink.UI.Common.clone( originalObj ); + */ + clone: function(o) { + try { + return JSON.parse( JSON.stringify(o) ); + } catch (ex) { + throw new Error('Given object cannot have loops!'); + } + }, + + + /** + * Gets an element's one-base index relative to its parent. + * + * @method childIndex + * @static + * @param {DOMElement} childEl Valid DOM Element. + * @return {Number} Numerical position of an element relatively to its parent. + * @example + * + *
    + *
  • One
  • + *
  • Two
  • + *
  • Three
  • + *
  • Four
  • + *
+ * + * + */ + childIndex: function(childEl) { + if( Common.isDOMElement(childEl) ){ + var els = Selector.select('> *', childEl.parentNode); + for (var i = 0, f = els.length; i < f; ++i) { + if (els[i] === childEl) { + return i; + } + } + } + throw 'not found!'; + }, + + + /** + * AJAX JSON request shortcut method + * It provides a more convenient way to do an AJAX request and expect a JSON response.It also offers a callback option, as third parameter, for better async handling. + * + * @method ajaxJSON + * @static + * @async + * @param {String} endpoint Valid URL to be used as target by the request. + * @param {Object} params This field is used in the thrown Exception to identify the parameter. + * @param {Function} cb Callback for the request. + * @example + * // In case there are several .myInput, it will retrieve the first found + * var el = Ink.UI.Common.elOrSelector('.myInput','My Input'); + */ + ajaxJSON: function(endpoint, params, cb) { + new Ajax( + endpoint, + { + evalJS: 'force', + method: 'POST', + parameters: params, + + onSuccess: function( r) { + try { + r = r.responseJSON; + if (r.status !== 'ok') { + throw 'server error: ' + r.message; + } + cb(null, r); + } catch (ex) { + cb(ex); + } + }, + + onFailure: function() { + cb('communication failure'); + } + } + ); + }, + + + /** + * Gets the current Ink layout. + * + * @method currentLayout + * @static + * @return {String} A string representation of the current layout name. + * @example + * var inkLayout = Ink.UI.Common.currentLayout(); + * if (inkLayout === 'small') { + * // ... + * } + */ + currentLayout: function() { + var i, f, k, v, el, detectorEl = Selector.select('#ink-layout-detector')[0]; + if (!detectorEl) { + detectorEl = document.createElement('div'); + detectorEl.id = 'ink-layout-detector'; + for (k in this.Layouts) { + if (this.Layouts.hasOwnProperty(k)) { + v = this.Layouts[k]; + el = document.createElement('div'); + el.className = 'show-' + v + ' hide-all'; + el.setAttribute('data-ink-layout', v); + detectorEl.appendChild(el); + } + } + document.body.appendChild(detectorEl); + } + + for (i = 0, f = detectorEl.children.length; i < f; ++i) { + el = detectorEl.children[i]; + if (Css.getStyle(el, 'display') === 'block') { + return el.getAttribute('data-ink-layout'); + } + } + + return 'large'; + }, + + + /** + * Sets the location's hash (window.location.hash). + * + * @method hashSet + * @static + * @param {Object} o Object with the info to be placed in the location's hash. + * @example + * // It will set the location's hash like: #key1=value1&key2=value2&key3=value3 + * Ink.UI.Common.hashSet({ + * key1: 'value1', + * key2: 'value2', + * key3: 'value3' + * }); + */ + hashSet: function(o) { + if (typeof o !== 'object') { throw new TypeError('o should be an object!'); } + var hashParams = Url.getAnchorString(); + hashParams = Ink.extendObj(hashParams, o); + window.location.hash = Url.genQueryString('', hashParams).substring(1); + }, + + /** + * Removes children nodes from a given object. + * This method was initially created to help solve a problem in Internet Explorer(s) that occurred when trying to set the innerHTML of some specific elements like 'table'. + * + * @method cleanChildren + * @static + * @param {DOMElement} parentEl Valid DOM Element + * @example + * + *
    + *
  • One
  • + *
  • Two
  • + *
  • Three
  • + *
  • Four
  • + *
+ * + * + * + * + *
    + */ + cleanChildren: function(parentEl) { + if( !Common.isDOMElement(parentEl) ){ + throw 'Please provide a valid DOMElement'; + } + var prevEl, el = parentEl.lastChild; + while (el) { + prevEl = el.previousSibling; + parentEl.removeChild(el); + el = prevEl; + } + }, + + /** + * Stores the id and/or classes of an element in an object. + * + * @method storeIdAndClasses + * @static + * @param {DOMElement} fromEl Valid DOM Element to get the id and classes from. + * @param {Object} inObj Object where the id and classes will be saved. + * @example + *
    + * + * + */ + storeIdAndClasses: function(fromEl, inObj) { + if( !Common.isDOMElement(fromEl) ){ + throw 'Please provide a valid DOMElement as first parameter'; + } + + var id = fromEl.id; + if (id) { + inObj._id = id; + } + + var classes = fromEl.className; + if (classes) { + inObj._classes = classes; + } + }, + + /** + * Sets the id and className properties of an element based + * + * @method restoreIdAndClasses + * @static + * @param {DOMElement} toEl Valid DOM Element to set the id and classes on. + * @param {Object} inObj Object where the id and classes to be set are. This method uses the same format as the one given in `storeIdAndClasses` + * @example + *
    + * + * + * + * + *
    + */ + restoreIdAndClasses: function(toEl, inObj) { + + if( !Common.isDOMElement(toEl) ){ + throw 'Please provide a valid DOMElement as first parameter'; + } + + if (inObj._id && toEl.id !== inObj._id) { + toEl.id = inObj._id; + } + + if (inObj._classes && toEl.className.indexOf(inObj._classes) === -1) { + if (toEl.className) { toEl.className += ' ' + inObj._classes; } + else { toEl.className = inObj._classes; } + } + + if (inObj._instanceId && !toEl.getAttribute('data-instance')) { + toEl.setAttribute('data-instance', inObj._instanceId); + } + }, + + _warnDoubleInstantiation: function (elm, newInstance) { + var instances = Common.getInstance(elm); + + if (getName(newInstance) === '') { return; } + if (!instances) { return; } + + var nameWithoutVersion = getName(newInstance); + + if (!nameWithoutVersion) { return; } + + for (var i = 0, len = instances.length; i < len; i++) { + if (nameWithoutVersion === getName(instances[i])) { + // Yes, I am using + to concatenate and , to split + // arguments. + // + // Elements can't be concatenated with strings, but if + // they are passed in an argument, modern debuggers will + // pretty-print them and make it easy to find them in the + // element inspector. + // + // On the other hand, if strings are passed as different + // arguments, they get pretty printed. And the pretty + // print of a string has quotes around it. + // + // If some day people find out that strings are not + // just text and they start preserving contextual + // information, then by all means change this to a + // regular concatenation. + // + // But they won't. So don't change this. + Ink.warn('Creating more than one ' + nameWithoutVersion + '.', + '(Was creating a ' + nameWithoutVersion + ' on:', elm, ').'); + return false; + } + } + + function getName(thing) { + return ((thing.constructor && (thing.constructor._name)) || + thing._name || + '').replace(/_.*?$/, ''); + } + + return true; + }, + + /** + * Saves a component's instance reference for later retrieval. + * + * @method registerInstance + * @static + * @param {Object} inst Object that holds the instance. + * @param {DOMElement} el DOM Element to associate with the object. + */ + registerInstance: function(inst, el) { + if (!inst) { return; } + + if (!Common.isDOMElement(el)) { throw new TypeError('Ink.UI.Common.registerInstance: The element passed in is not a DOM element!'); } + + // [todo] this belongs in the BaseUIComponent's initialization + if (Common._warnDoubleInstantiation(el, inst) === false) { + return false; + } + + var instances = domRegistry.get(el); + + if (!instances) { + instances = []; + domRegistry.set(el, instances); + } + + instances.push(inst); + + return true; + }, + + /** + * Deletes an instance with a given id. + * + * @method unregisterInstance + * @static + * @param {String} id Id of the instance to be destroyed. + */ + unregisterInstance: function(inst) { + if (!inst || !inst._element) { return; } + var instances = domRegistry.get(inst._element); + for (var i = 0, len = instances.length; i < len; i++) { + if (instances[i] === inst) { + instances.splice(i, 1); + } + } + }, + + /** + * Gets an UI instance from an element or instance id. + * + * @method getInstance + * @static + * @param {String|DOMElement} el DOM Element from which we want the instances. + * @return {Object|Array} Returns an instance or a collection of instances. + */ + getInstance: function(el, UIComponent) { + el = Common.elOrSelector(el); + var instances = domRegistry.get(el); + + if (!instances) { + instances = []; + } + + if (typeof UIComponent !== 'function') { + return instances; + } + + for (var i = 0, len = instances.length; i < len; i++) { + if (instances[i] instanceof UIComponent) { + return instances[i]; + } + } + + return null; + }, + + /** + * Gets an instance based on a selector. + * + * @method getInstanceFromSelector + * @static + * @param {String} selector CSS selector to get the instances from. + * @return {Object|Array} Returns an instance or a collection of instances. + */ + getInstanceFromSelector: function(selector) { + return Common.getInstance(Common.elOrSelector(selector)); + }, + + /** + * Gets all the instance ids + * + * @method getInstanceIds + * @static + * @return {Array} Collection of instance ids + */ + getInstanceIds: function() { + var res = []; + for (var id in instances) { + if (instances.hasOwnProperty(id)) { + res.push( id ); + } + } + return res; + }, + + /** + * Gets all the instances + * + * @method getInstances + * @static + * @return {Array} Collection of existing instances. + */ + getInstances: function() { + var res = []; + for (var id in instances) { + if (instances.hasOwnProperty(id)) { + res.push( instances[id] ); + } + } + return res; + }, + + /** + * Boilerplate method to destroy a component. + * Components should copy this method as its destroy method and modify it. + * + * @method destroyComponent + * @static + */ + destroyComponent: function() { + Common.unregisterInstance(this); + this._element.parentNode.removeChild(this._element); + } + + }; + + + + + /** + * Ink UI Base Class + **/ + + function warnStub() { + /* jshint validthis: true */ + if (!this || this === window || typeof this.constructor !== 'function') { return; } + Ink.warn('You called a method on an incorrectly instantiated ' + this.constructor._name + ' component. Check the warnings above to see what went wrong.'); + } + + function stub(prototype, obj) { + for (var k in prototype) if (prototype.hasOwnProperty(k)) { + if (k === 'constructor') { continue; } + if (typeof obj[k] === 'function') { + obj[k] = warnStub; + } + } + } + + /** + * Ink UI Base Class + * + * You don't use this class directly, or inherit from it directly. + * + * See createUIComponent() (in this module) for how to create a UI component and inherit from this. It's not plain old JS inheritance, for several reasons. + * + * @class Ink.UI.Common.BaseUIComponent + * @constructor + * + * @param element + * @param options + **/ + function BaseUIComponent(element, options) { + var constructor = this.constructor; + var _name = constructor._name; + + if (!this || this === window) { + throw new Error('Use "new InkComponent()" instead of "InkComponent()"'); + } + + if (this && !(this instanceof BaseUIComponent)) { + throw new Error('You forgot to call Ink.UI.Common.createUIComponent() on this module!'); + } + + if (!element && !constructor._componentOptions.elementIsOptional) { + Ink.error(new Error(_name + ': You need to pass an element or a selector as the first argument to "new ' + _name + '()"')); + return; + } else { + this._element = Common.elsOrSelector(element, + _name + ': An element with the selector "' + element + '" was not found!')[0]; + } + + if (!this._element && !constructor._componentOptions.elementIsOptional) { + isValidInstance = false; + Ink.error(new Error(element + ' does not match an element on the page. You need to pass a valid selector to "new ' + _name + '".')); + } + + // TODO Change Common.options's signature? the below looks better, more manageable + // var options = Common.options({ + // element: this._element, + // modName: constructor._name, + // options: constructor._optionDefinition, + // defaults: constructor._globalDefaults + // }); + + this._options = Common.options(_name, constructor._optionDefinition, options, this._element); + + var isValidInstance = BaseUIComponent._validateInstance(this) === true; + + if (isValidInstance && typeof this._init === 'function') { + try { + this._init.apply(this, arguments); + } catch(e) { + isValidInstance = false; + Ink.error(e); + } + } + + if (!isValidInstance) { + BaseUIComponent._stubInstance(this, constructor, _name); + } else if (this._element) { + Common.registerInstance(this, this._element); + } + } + + /** + * Calls the `instance`'s _validate() method so it can validate itself. + * + * Returns false if the method exists, was called, but no Error was returned or thrown. + * + * @method _validateInstance + * @private + */ + BaseUIComponent._validateInstance = function (instance) { + var err; + + if (typeof instance._validate !== 'function') { return true; } + + try { + err = instance._validate(); + } catch (e) { + err = e; + } + + if (err instanceof Error) { + instance._validationError = err; + return false; + } + + return true; + }; + + + /** + * Replaces every method in the instance with stub functions which just call Ink.warn(). + * + * This avoids breaking the page when there are errors. + * + * @method _stubInstance + * @param instance + * @param constructor + * @param name + * @private + */ + BaseUIComponent._stubInstance = function (instance, constructor, name) { + stub(constructor.prototype, instance); + stub(BaseUIComponent.prototype, instance); + Ink.warn(name + ' was not correctly created. ' + (instance._validationError || '')); + }; + + // TODO BaseUIComponent.setGlobalOptions = function () {} + // TODO BaseUIComponent.createMany = function (selector) {} + BaseUIComponent.getInstance = function (elOrSelector) { + elOrSelector = Common.elOrSelector(elOrSelector); + return Common.getInstance(elOrSelector, this /* get instance by constructor */); + }; + + Ink.extendObj(BaseUIComponent.prototype, { + /** + * Get an UI component's option's value. + * + * @method getOption + * @param name + * + * @return The option value, or undefined if nothing is found. + * + * @example + * + * var myUIComponent = new Modal('#element', { trigger: '#trigger' }); // or anything else inheriting BaseUIComponent + * myUIComponent.getOption('trigger'); // -> The trigger element (not the selector string, mind you) + * + **/ + getOption: function (name) { + if (this.constructor && !(name in this.constructor._optionDefinition)) { + Ink.error('"' + name + '" is not an option for ' + this.constructor._name); + return undefined; + } + + return this._options[name]; + }, + + /** + * Sets an option's value + * + * @method getOption + * @param name + * @param value + * + * @example + * + * var myUIComponent = new Modal(...); + * myUIComponent.setOption('trigger', '#some-element'); + **/ + setOption: function (name, value) { + if (this.constructor && !(name in this.constructor._optionDefinition)) { + Ink.error('"' + name + ' is not an option for ' + this.constructor._name); + return; + } + + this._options[name] = value; + }, + + /** + * Get the element associated with an UI component (IE the one you used in the constructor) + * + * @method getElement + * @return {Element} The component's element. + * + * @example + * var myUIComponent = new Modal('#element'); // or anything else inheriting BaseUIComponent + * myUIComponent.getElement(); // -> The '#element' (not the selector string, mind you). + * + **/ + getElement: function () { + return this._element; + } + }); + + Common.BaseUIComponent = BaseUIComponent; + + /** + * @method createUIComponent + * @param theConstructor UI component constructor. It should have an _init function in its prototype, an _optionDefinition object, and a _name property indicating its name. + * @param options + * @param [options.elementIsOptional=false] Whether the element argument is optional (For example, when the component might work on existing markup or create its own). + **/ + Common.createUIComponent = function createUIComponent(theConstructor, options) { + theConstructor._componentOptions = options || {}; + + function assert(test, msg) { + if (!test) { + throw new Error('Ink.UI_1.createUIComponent: ' + msg); + } + } + + function assertProp(prop, propType, message) { + var propVal = theConstructor[prop]; + // Check that the property was passed + assert(typeof propVal !== 'undefined', + theConstructor + ' doesn\'t have a "' + prop + '" property. ' + message); + // Check that its type is correct + assert(propType && typeof propVal === propType, + 'typeof ' + theConstructor + '.' + prop + ' is not "' + propType + '". ' + message); + } + + assert(typeof theConstructor === 'function', + 'constructor argument is not a function!'); + + assertProp('_name', 'string', 'This property is used for error ' + + 'messages. Set it to the full module path and version (Ink.My.Module_1).'); + assertProp('_optionDefinition', 'object', 'This property contains the ' + + 'option names, types and defaults. See Ink.UI.Common.options() for reference.'); + + // Extend the instance methods and props + var _oldProto = theConstructor.prototype; + + if (typeof Object.create === 'function') { + theConstructor.prototype = Object.create(BaseUIComponent.prototype); + } else { + theConstructor.prototype = (function hideF() { + function F() {} + F.prototype = BaseUIComponent.prototype; + return new F(); + }()); + } + + Ink.extendObj(theConstructor.prototype, _oldProto); + theConstructor.prototype.constructor = theConstructor; + // Extend static methods + Ink.extendObj(theConstructor, BaseUIComponent); + }; + + return Common; + +}); + +/** + * Date selector + * @module Ink.UI.DatePicker_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.DatePicker', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1','Ink.Util.Date_1', 'Ink.Dom.Browser_1'], function(Common, Event, Css, InkElement, Selector, InkArray, InkDate ) { + 'use strict'; + + // Clamp a number into a min/max limit + function clamp(n, min, max) { + if (n > max) { n = max; } + if (n < min) { n = min; } + + return n; + } + + function dateishFromYMDString(YMD) { + var split = YMD.split('-'); + return dateishFromYMD(+split[0], +split[1] - 1, +split[2]); + } + + function dateishFromYMD(year, month, day) { + return {_year: year, _month: month, _day: day}; + } + + function dateishFromDate(date) { + return {_year: date.getFullYear(), _month: date.getMonth(), _day: date.getDate()}; + } + + /** + * @class Ink.UI.DatePicker + * @constructor + * @version 1 + * + * @param {String|DOMElement} selector + * @param {Object} [options] Options + * @param {Boolean} [options.autoOpen] Flag to automatically open the datepicker. + * @param {String} [options.cleanText] Text for the clean button. Defaults to 'Clear'. + * @param {String} [options.closeText] Text for the close button. Defaults to 'Close'. + * @param {String} [options.cssClass] CSS class to be applied on the datepicker + * @param {String|DOMElement} [options.pickerField] (if not using in an input[type="text"]) Element which displays the DatePicker when clicked. Defaults to an "open" link. + * @param {String} [options.dateRange] Enforce limits to year, month and day for the Date, ex: '1990-08-25:2020-11' + * @param {Boolean} [options.displayInSelect] Flag to display the component in a select element. + * @param {String|DOMElement} [options.dayField] (if using options.displayInSelect) `select` field with days. + * @param {String|DOMElement} [options.monthField] (if using options.displayInSelect) `select` field with months. + * @param {String|DOMElement} [options.yearField] (if using options.displayInSelect) `select` field with years. + * @param {String} [options.format] Date format string + * @param {Object} [options.month] Hash of month names. Defaults to portuguese month names. January is 1. + * @param {String} [options.nextLinkText] Text for the previous button. Defaults to '«'. + * @param {String} [options.ofText] Text to show between month and year. Defaults to ' of '. + * @param {Boolean} [options.onFocus] If the datepicker should open when the target element is focused. Defaults to true. + * @param {Function} [options.onMonthSelected] Callback to execute when the month is selected. + * @param {Function} [options.onSetDate] Callback to execute when the date is set. + * @param {Function} [options.onYearSelected] Callback to execute when the year is selected. + * @param {String} [options.position] Position for the datepicker. Either 'right' or 'bottom'. Defaults to 'right'. + * @param {String} [options.prevLinkText] Text for the previous button. Defaults to '«'. + * @param {Boolean} [options.showClean] If the clean button should be visible. Defaults to true. + * @param {Boolean} [options.showClose] If the close button should be visible. Defaults to true. + * @param {Boolean} [options.shy] If the datepicker should start automatically. Defaults to true. + * @param {String} [options.startDate] Date to define initial month. Must be in yyyy-mm-dd format. + * @param {Number} [options.startWeekDay] First day of the week. Sunday is zero. Defaults to 1 (Monday). + * @param {Function} [options.validYearFn] Callback to execute when 'rendering' the month (in the month view) + * @param {Function} [options.validMonthFn] Callback to execute when 'rendering' the month (in the month view) + * @param {Function} [options.validDayFn] Callback to execute when 'rendering' the day (in the month view) + * @param {Function} [options.nextValidDateFn] Function to calculate the next valid date, given the current. Useful when there's invalid dates or time frames. + * @param {Function} [options.prevValidDateFn] Function to calculate the previous valid date, given the current. Useful when there's invalid dates or time frames. + * @param {Object} [options.wDay] Hash of week day names. Sunday is 0. Defaults to { 0:'Sunday', 1:'Monday', etc... + * @param {String} [options.yearRange] Enforce limits to year for the Date, ex: '1990:2020' (deprecated) + * + * @sample Ink_UI_DatePicker_1.html + */ + var DatePicker = function() { + Common.BaseUIComponent.apply(this, arguments); + }; + + DatePicker._name = 'DatePicker_1'; + + DatePicker._optionDefinition = { + autoOpen: ['Boolean', false], + cleanText: ['String', 'Clear'], + closeText: ['String', 'Close'], + pickerField: ['Element', null], + containerElement:['Element', null], + cssClass: ['String', 'ink-calendar bottom'], + dateRange: ['String', null], + + // use this in a + * + * By applying this UI class to the above input, you get a tag field with the tags "initial" and "value". The class preserves the original input element. It remains hidden and is updated with new tag information dynamically, so regular HTML form logic still applies. + * + * Below "input" refers to the current value of the input tag (updated as the user enters text, of course), and "output" refers to the value which this class writes back to said input tag. + * + * @class Ink.UI.TagField + * @version 1 + * @constructor + * @param {String|DOMElement} element Selector or DOM Input Element. + * @param {Object} [options] Options object + * @param {String|Array} [options.tags] Initial tags in the input + * @param {Boolean} [options.allowRepeated] Flag to allow user to input several tags. Defaults to true. + * @param {RegExp} [options.separator] Split the input by this RegExp. Defaults to /[,;(space)]+/g (spaces, commas and semicolons) + * @param {String} [options.outSeparator] Use this string to separate each tag from the next in the output. Defaults to ','. + * @param {Boolean} [options.autoSplit] Flag to activate tag creation when the user types a separator. Defaults to true. + * @param {Integer} [options.maxTags] Maximum number of tags allowed. Set to -1 for no limit. Defaults to -1. + * @example + */ + function TagField() { + Common.BaseUIComponent.apply(this, arguments); + } + + TagField._name = 'TagField_1'; + + TagField._optionDefinition = { + tags: ['String', []], + tagQuery: ['Object', null], + tagQueryAsync: ['Object', null], + allowRepeated: ['Boolean', false], + maxTags: ['Integer', -1], + outSeparator: ['String', ','], + separator: ['String', /[,; ]+/g], + autoSplit: ['Boolean', true] + }; + + TagField.prototype = { + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function() { + var o = this._options; + if (typeof o.separator === 'string') { + o.separator = new RegExp(o.separator, 'g'); + } + + if (typeof o.tags === 'string') { + // coerce to array using the separator + o.tags = this._readInput(o.tags); + } + + Css.addClassName(this._element, 'hide-all'); + + this._viewElm = InkElement.create('div', { + className: 'ink-tagfield', + insertAfter: this._element + }); + + this._input = InkElement.create('input', { + type: 'text', + className: 'new-tag-input', + insertBottom: this._viewElm + }); + + var tags = [].concat(o.tags, this._tagsFromMarkup(this._element)); + + this._tags = []; + + InkArray.each(tags, Ink.bindMethod(this, '_addTag')); + + InkEvent.observe(this._input, 'keyup', Ink.bindEvent(this._onKeyUp, this)); + InkEvent.observe(this._input, 'change', Ink.bindEvent(this._onKeyUp, this)); + InkEvent.observe(this._input, 'keydown', Ink.bindEvent(this._onKeyDown, this)); + InkEvent.observe(this._input, 'blur', Ink.bindEvent(this._onBlur, this)); + InkEvent.observe(this._viewElm, 'click', Ink.bindEvent(this._refocus, this)); + }, + + destroy: function () { + InkElement.remove(this._viewElm); + Css.removeClassName(this._element, 'hide-all'); + }, + + _tagsFromMarkup: function (element) { + var tagname = element.tagName.toLowerCase(); + if (tagname === 'input') { + return this._readInput(element.value); + } else if (tagname === 'select') { + return InkArray.map(element.getElementsByTagName('option'), function (option) { + return InkElement.textContent(option); + }); + } else { + throw new Error('Cannot read tags from a ' + tagname + ' tag. Unknown tag'); + } + }, + + _tagsToMarkup: function (tags, element) { + var tagname = element.tagName.toLowerCase(); + if (tagname === 'input') { + if (this._options.separator) { + element.value = tags.join(this._options.outSeparator); + } + } else if (tagname === 'select') { + element.innerHTML = ''; + InkArray.each(tags, function (tag) { + var opt = InkElement.create('option', {selected: 'selected'}); + InkElement.setTextContent(opt, tag); + element.appendChild(opt); + }); + } else { + throw new Error('TagField: Cannot read tags from a ' + tagname + ' tag. Unknown tag'); + } + }, + + _addTag: function (tag) { + if (this._options.maxTags !== -1 && + this._tags.length >= this._options.maxTags) { + return; + } + if ((!this._options.allowRepeated && + InkArray.inArray(tag, this._tags, tag)) || !tag) { + return false; + } + var elm = InkElement.create('span', { + className: 'ink-tag', + setTextContent: tag + ' ' + }); + + var remove = InkElement.create('span', { + className: 'remove fa fa-times', + insertBottom: elm + }); + InkEvent.observe(remove, 'click', Ink.bindEvent(this._removeTag, this, null)); + + var spc = document.createTextNode(' '); + + this._tags.push(tag); + this._viewElm.insertBefore(elm, this._input); + this._viewElm.insertBefore(spc, this._input); + this._tagsToMarkup(this._tags, this._element); + }, + + _readInput: function (text) { + if (this._options.separator) { + return InkArray.filter(text.split(this._options.separator), isTruthy); + } else { + return [text]; + } + }, + + _onKeyUp: function () { // TODO control input box size + if (!this._options.autoSplit) { + return; + } + var split = this._input.value.split(this._options.separator); + if (split.length <= 1) { + return; + } + var last = split[split.length - 1]; + split = split.splice(0, split.length - 1); + split = InkArray.filter(split, isTruthy); + + InkArray.each(split, Ink.bind(this._addTag, this)); + this._input.value = last; + }, + + _onKeyDown: function (event) { + if (event.which === enterKey) { + return this._onEnterKeyDown(event); + } else if (event.which === backspaceKey) { + return this._onBackspaceKeyDown(); + } else if (this._removeConfirm) { + // user pressed another key, cancel removal from a backspace key + this._unsetRemovingVisual(this._tags.length - 1); + } + }, + + /** + * When the user presses backspace twice on the empty input, we delete the last tag on the field. + * @method onBackspaceKeyDown + * @private + */ + _onBackspaceKeyDown: function () { + if (this._input.value) { return; } + + if (this._removeConfirm) { + this._unsetRemovingVisual(this._tags.length - 1); + this._removeTag(this._tags.length - 1); + this._removeConfirm = null; + } else { + this._setRemovingVisual(this._tags.length - 1); + } + }, + + _onEnterKeyDown: function (event) { + var tag = this._input.value; + if (tag) { + this._addTag(tag); + this._input.value = ''; + } + InkEvent.stopDefault(event); + }, + + _onBlur: function () { + this._addTag(this._input.value); + this._input.value = ''; + }, + + /* For when the user presses backspace. + * Set the style of the tag so that it seems like it's going to be removed + * if they press backspace again. */ + _setRemovingVisual: function (tagIndex) { + var elm = this._viewElm.children[tagIndex]; + if (!elm) { return; } + + Css.addClassName(elm, 'tag-deleting'); + + this._removeRemovingVisualTimeout = setTimeout(Ink.bindMethod(this, '_unsetRemovingVisual', tagIndex), 4000); + InkEvent.observe(this._input, 'blur', Ink.bindMethod(this, '_unsetRemovingVisual', tagIndex)); + this._removeConfirm = true; + }, + _unsetRemovingVisual: function (tagIndex) { + var elm = this._viewElm.children[tagIndex]; + if (elm) { + Css.removeClassName(elm, 'tag-deleting'); + clearTimeout(this._removeRemovingVisualTimeout); + } + this._removeConfirm = null; + }, + + _removeTag: function (event) { + var index; + if (typeof event === 'object') { // click event on close button + var elm = InkEvent.element(event).parentNode; + index = InkElement.parentIndexOf(this._viewElm, elm); + } else if (typeof event === 'number') { // manual removal + index = event; + } + this._tags = InkArray.remove(this._tags, index, 1); + InkElement.remove(this._viewElm.children[index]); + this._tagsToMarkup(this._tags, this._element); + }, + + _refocus: function (event) { + this._input.focus(); + InkEvent.stop(event); + return false; + } + }; + + Common.createUIComponent(TagField); + + return TagField; +}); + +/** + * Toggle the visibility of elements. + * @module Ink.UI.Toggle_1 + * @version 1 + */ + + Ink.createModule('Ink.UI.Toggle', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, InkEvent, Css, InkElement, Selector, InkArray ) { + 'use strict'; + + /** + * + * You need two elements to use Toggle: the `trigger` element, and the `target` element (or elements). The default behaviour is to toggle the `target`(s) when you click the `trigger`. + * + * The toggle has a state. It is either "on" or "off". It works by switching between the CSS classes in `classNameOn` and `classNameOff` according to the current state. + * + * When you initialize the Toggle, it will check if the targets are visible to figure out what the initial state is. You can force the toggle to consider itself turned "on" or "off" by setting the `initialState` option to `true` or `false`, respectively. + * + * You can get the current state of the Toggle by calling `getState`, or by checking if your `trigger` element has the "active" class. + * The state can be changed through JavaScript. Just call `setState(true)` + * to turn the Toggle on (or `setState(false)` to turn it off). + * + * @class Ink.UI.Toggle + * @constructor + * @version 1 + * @param {String|DOMElement} selector Trigger element. By clicking this, the target (or targets) are triggered. + * @param {Object} [options] Options object, containing: + * + * @param {String} options.target CSS Selector that specifies the elements that this component will toggle + * @param {String} [options.classNameOn] CSS class to toggle when on. Defaults to 'show-all'. + * @param {String} [options.classNameOff] CSS class to toggle when off. Defaults to 'hide-all'. + * @param {String} [options.triggerEvent] Event that will trigger the toggling. Defaults to 'click'. + * @param {Boolean} [options.closeOnClick] Flag to toggle the targe off when clicking outside the toggled content. Defaults to true. + * @param {String} [options.closeOnInsideClick] Toggle off when a child element matching this selector is clicked. Set to null to deactivate the check. Defaults to 'a[href]'. + * @param {Boolean} [options.initialState] Flag to define initial state. false: off, true: on, null: markup. Defaults to null. + * @param {Function} [options.onChangeState] Callback when the toggle state changes. Return `false` to cancel the event. + * + * @sample Ink_UI_Toggle_1_constructor.html + */ + function Toggle(){ + Common.BaseUIComponent.apply(this, arguments); + } + + Toggle._name = 'Toggle_1'; + + Toggle._optionDefinition = { + target: ['Elements'], + triggerEvent: ['String', 'click'], + closeOnClick: ['Boolean', true], + isAccordion: ['Boolean', false], + initialState: ['Boolean', null], // May be true, false, or null to be what it is right now + classNameOn: ['String', 'show-all'], + classNameOff: ['String', 'hide-all'], + closeOnInsideClick: ['String', 'a[href]'], // closes the toggle when a target is clicked and it is a link + onChangeState: ['Function', null] + }; + + Toggle.prototype = { + + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function(){ + var i, len; + + this._targets = Common.elsOrSelector(this._options.target); + + // Boolean option handling + this._options.closeOnClick = this._options.closeOnClick.toString() === 'true'; + // Actually a throolean + if (this._options.initialState !== null){ + this._options.initialState = this._options.initialState.toString() === 'true'; + } else { + this._options.initialState = Css.getStyle(this._targets[0], 'display') !== 'none'; + } + + if (this._options.classNameOn !== 'show-all' || this._options.classNameOff !== 'hide-all') { + for (i = 0, len = this._targets.length; i < len; i++) { + Css.removeClassName(this._targets[i], 'show-all'); + Css.removeClassName(this._targets[i], 'hide-all'); + } + } + + this._accordion = ( Css.hasClassName(this._element.parentNode,'accordion') || Css.hasClassName(this._targets[0].parentNode,'accordion') ); + + this._firstTime = true; + + this._bindEvents(); + + if (this._options.initialState !== null) { + this.setState(this._options.initialState, true); + } else { + // Add initial classes matching the current "display" of the object. + var state = Css.getStyle(this._targets[0], 'display') !== 'none'; + this.setState(state, true); + } + // Aditionally, remove any inline "display" style. + for (i = 0, len = this._targets.length; i < len; i++) { + if (this._targets[i].style.display) { + this._targets[i].style.display = ''; // becomes default + } + } + + this._element.setAttribute('data-is-toggle-trigger', 'true'); + }, + + /** + * @method _bindEvents + * @private + */ + _bindEvents: function () { + if ( this._options.triggerEvent ) { + InkEvent.observe( + this._element, + this._options.triggerEvent, + Ink.bind(this._onTriggerEvent, this)); + } + if( this._options.closeOnClick ){ + InkEvent.observe( document, 'click', Ink.bind(this._onOutsideClick, this)); + } + if( this._options.closeOnInsideClick && this._options.closeOnInsideClick !== 'false') { + var sel = this._options.closeOnInsideClick; + if (sel.toString() === 'true') { + sel = '*'; + } + InkEvent.observeMulti(this._targets, 'click', Ink.bind(function (e) { + if ( InkElement.findUpwardsBySelector(InkEvent.element(e), sel) ) { + this.setState(false, true); + } + }, this)); + } + }, + + /** + * Event handler. It's responsible for handling the `triggerEvent` as defined in the options. + * + * This will trigger the toggle. + * + * @method _onTriggerEvent + * @param {Event} event + * @private + */ + _onTriggerEvent: function( event ){ + // When the togglee is a child of the toggler, we get the togglee's events here. We have to check that this event is for us. + var target = InkEvent.element(event); + + var isAncestorOfClickedElement = InkArray.some(this._targets, function (thisOne) { + return thisOne === target || InkElement.isAncestorOf(thisOne, target); + }); + + if (isAncestorOfClickedElement) { + return; + } + + if (this._accordion) { + this._updateAccordion(); + } + + var has = this.getState(); + this.setState(!has, true); + if (!has && this._firstTime) { + this._firstTime = false; + } + + InkEvent.stopDefault(event); + }, + + /** + * Be compatible with accordions + * + * @method _updateAccordion + **/ + _updateAccordion: function () { + var elms, accordionElement; + if( Css.hasClassName(this._targets[0].parentNode,'accordion') ){ + accordionElement = this._targets[0].parentNode; + } else { + accordionElement = this._targets[0].parentNode.parentNode; + } + elms = Selector.select('.toggle, .ink-toggle',accordionElement); + for(var i=0; i 0) && (targetElm[0] !== this._targets[0]) ){ + targetElm[0].style.display = 'none'; + } + } + }, + + /** + * Click handler. Will handle clicks outside the toggle component. + * + * @method _onOutsideClick + * @param {Event} event + * @private + */ + _onOutsideClick: function( event ){ + var tgtEl = InkEvent.element(event), + shades; + + if (InkElement.findUpwardsBySelector(tgtEl, '[data-is-toggle-trigger="true"]')) return; + + var ancestorOfTargets = InkArray.some(this._targets, function (target) { + return InkElement.isAncestorOf(target, tgtEl) || target === tgtEl; + }); + + if( (this._element === tgtEl) || InkElement.isAncestorOf(this._element, tgtEl) || ancestorOfTargets) { + return; + } else if( (shades = Ink.ss('.ink-shade')).length ) { + var shadesLength = shades.length; + + for( var i = 0; i < shadesLength; i++ ){ + if( InkElement.isAncestorOf(shades[i],tgtEl) && InkElement.isAncestorOf(shades[i],this._element) ){ + return; + } + } + } + + this.setState(false, true); // dismiss + }, + + /** + * Sets the state of the toggle. (on/off) + * + * @method setState + * @param newState {Boolean} New state (on/off) + */ + setState: function (on, callHandler) { + if (on === this.getState()) { return; } + if (callHandler && typeof this._options.onChangeState === 'function') { + var ret = this._options.onChangeState(on); + if (ret === false) { return false; } // Canceled by the event handler + } + for (var i = 0, len = this._targets.length; i < len; i++) { + Css.addRemoveClassName(this._targets[i], this._options.classNameOn, on); + Css.addRemoveClassName(this._targets[i], this._options.classNameOff, !on); + } + Css.addRemoveClassName(this._element, 'active', on); + }, + + /** + * Gets the state of the toggle. (on/off) + * + * @method getState + * + * @return {Boolean} whether the toggle is toggled on. + */ + getState: function () { + return Css.hasClassName(this._element, 'active'); + } + }; + + Common.createUIComponent(Toggle); + + return Toggle; +}); + +/** + * Content Tooltips + * @module Ink.UI.Tooltip_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Tooltip', '1', ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Element_1', 'Ink.Dom.Selector_1', 'Ink.Util.Array_1', 'Ink.Dom.Css_1', 'Ink.Dom.Browser_1'], function (Common, InkEvent, InkElement, Selector, InkArray, Css) { + 'use strict'; + + /** + * Tooltips are useful as a means to display information about functionality while avoiding clutter. + * + * Tooltips show up when you hover elements which "have" tooltips. + * + * This class will "give" a tooltip to many elements, selected by its first argument (`target`). This is contrary to the other UI modules in Ink, which are created once per element. + * + * You can define options either through the second argument of the Tooltip constructor, or as data-attributes in each `target` element. Options set through data-attributes all start with "data-tip", and override options passed into the Tooltip constructor. + * + * @class Ink.UI.Tooltip + * @constructor + * + * @param {DOMElement|String} target Target element or selector of elements, to display the tooltips on. + * @param {Object} [options] Options object + * @param {String} [options.text] Text content for the tooltip. + * @param {String} [options.html] HTML for the tooltip. Same as above, but won't escape HTML. + * @param {String} [options.where] Positioning for the tooltip. Options are 'up', 'down', 'left', 'right', 'mousemove' (follows the cursor), and 'mousefix' (stays fixed). Defaults to 'up'. + * + * @param {String} [options.color] Color of the tooltip. Options are red, orange, blue, green and black. Default is white. + * @param {Number} [options.fade] Number of seconds to fade in/out. Defaults to 0.3. + * @param {Boolean} [options.forever] Flag to prevent the tooltip from being erased when the mouse hovers away from the target. + * @param {Number} [options.timeout] Number of seconds the tooltip will stay open. Useful together with options.forever. Defaults to 0. + * @param {Number} [options.delay] Time the tooltip waits until it is displayed. Useful to avoid getting the attention of the user unnecessarily + * @param {DOMElement|Selector} [options.template] Element or selector containing HTML to be cloned into the tooltips. Can be a hidden element, because CSS `display` is set to `block`. + * @param {String} [options.templatefield] Selector within the template element to choose where the text is inserted into the tooltip. Useful when a wrapper DIV is required. + * @param {Number} [options.left] Spacing from the target to the tooltip, when `where` is `mousemove` or `mousefix`. Defaults to 10. + * @param {Number} [options.top] Spacing from the target to the tooltip, when `where` is `mousemove` or `mousefix`. Defaults to 10. + * @param {Number} [options.spacing] Spacing between the tooltip and the target element, when `where` is not `mousemove` or `mousefix`. Defaults to 8. + * + * @sample Ink_UI_Tooltip_1.html + */ + function Tooltip(element, options) { + this._init(element, options || {}); + } + + function EachTooltip(root, elm) { + this._init(root, elm); + } + + var transitionDurationName, + transitionPropertyName, + transitionTimingFunctionName; + (function () { // Feature detection + var test = document.createElement('DIV'); + var names = ['transition', 'oTransition', 'msTransition', 'mozTransition', + 'webkitTransition']; + for (var i = 0; i < names.length; i++) { + if (typeof test.style[names[i] + 'Duration'] !== 'undefined') { + transitionDurationName = names[i] + 'Duration'; + transitionPropertyName = names[i] + 'Property'; + transitionTimingFunctionName = names[i] + 'TimingFunction'; + break; + } + } + }()); + + // Body or documentElement + var bodies = document.getElementsByTagName('body'); + var body = bodies.length ? bodies[0] : document.documentElement; + + Tooltip.prototype = { + _init: function(element, options) { + var elements; + + this.options = Ink.extendObj({ + where: 'up', + zIndex: 10000, + left: 10, + top: 10, + spacing: 8, + forever: 0, + color: '', + timeout: 0, + delay: 0, + template: null, + templatefield: null, + fade: 0.3, + text: '' + }, options || {}); + + if (typeof element === 'string') { + elements = Selector.select(element); + } else if (typeof element === 'object') { + elements = [element]; + } else { + throw 'Element expected'; + } + + this.tooltips = []; + + for (var i = 0, len = elements.length; i < len; i++) { + this.tooltips[i] = new EachTooltip(this, elements[i]); + } + }, + /** + * Destroys the tooltips created by this instance + * + * @method destroy + */ + destroy: function () { + InkArray.each(this.tooltips, function (tooltip) { + tooltip._destroy(); + }); + this.tooltips = null; + this.options = null; + } + }; + + EachTooltip.prototype = { + _oppositeDirections: { + left: 'right', + right: 'left', + up: 'down', + down: 'up' + }, + _init: function(root, elm) { + InkEvent.observe(elm, 'mouseover', Ink.bindEvent(this._onMouseOver, this)); + InkEvent.observe(elm, 'mouseout', Ink.bindEvent(this._onMouseOut, this)); + InkEvent.observe(elm, 'mousemove', Ink.bindEvent(this._onMouseMove, this)); + + this.root = root; + this.element = elm; + this._delayTimeout = null; + this.tooltip = null; + + Common.registerInstance(this, this.element); + }, + _makeTooltip: function (mousePosition) { + if (!this._getOpt('text') && + !this._getOpt('html') && + !InkElement.hasAttribute(this.element, 'title')) { + return false; + } + + var tooltip = this._createTooltipElement(); + + if (this.tooltip) { + this._removeTooltip(); + } + + this.tooltip = tooltip; + + this._fadeInTooltipElement(tooltip); + this._placeTooltipElement(tooltip, mousePosition); + + InkEvent.observe(tooltip, 'mouseover', Ink.bindEvent(this._onTooltipMouseOver, this)); + + var timeout = this._getFloatOpt('timeout'); + if (timeout) { + setTimeout(Ink.bind(function () { + if (this.tooltip === tooltip) { + this._removeTooltip(); + } + }, this), timeout * 1000); + } + }, + _createTooltipElement: function () { + var template = this._getOpt('template'), // User template instead of our HTML + templatefield = this._getOpt('templatefield'), + + tooltip, // The element we float + field; // Element where we write our message. Child or same as the above + + if (template) { // The user told us of a template to use. We copy it. + var temp = document.createElement('DIV'); + temp.innerHTML = Common.elOrSelector(template, 'options.template').outerHTML; + tooltip = temp.firstChild; + + if (templatefield) { + field = Selector.select(templatefield, tooltip); + if (field) { + field = field[0]; + } else { + throw 'options.templatefield must be a valid selector within options.template'; + } + } else { + field = tooltip; // Assume same element if user did not specify a field + } + } else { // We create the default structure + tooltip = document.createElement('DIV'); + Css.addClassName(tooltip, 'ink-tooltip'); + Css.addClassName(tooltip, this._getOpt('color')); + + field = document.createElement('DIV'); + Css.addClassName(field, 'content'); + + tooltip.appendChild(field); + } + + if (this._getOpt('html')) { + field.innerHTML = this._getOpt('html'); + } else if (this._getOpt('text')) { + InkElement.setTextContent(field, this._getOpt('text')); + } else { + InkElement.setTextContent(field, this.element.getAttribute('title')); + } + tooltip.style.display = 'block'; + tooltip.style.position = 'absolute'; + tooltip.style.zIndex = this._getIntOpt('zIndex'); + + return tooltip; + }, + _fadeInTooltipElement: function (tooltip) { + var fadeTime = this._getFloatOpt('fade'); + if (transitionDurationName && fadeTime) { + tooltip.style.opacity = '0'; + tooltip.style[transitionDurationName] = fadeTime + 's'; + tooltip.style[transitionPropertyName] = 'opacity'; + tooltip.style[transitionTimingFunctionName] = 'ease-in-out'; + setTimeout(function () { + tooltip.style.opacity = '1'; + }, 0); // Wait a tick + } + }, + _placeTooltipElement: function (tooltip, mousePosition) { + var where = this._getOpt('where'); + + if (where === 'mousemove' || where === 'mousefix') { + var mPos = mousePosition; + this._setPos(mPos[0], mPos[1]); + body.appendChild(tooltip); + } else if (where.match(/(up|down|left|right)/)) { + body.appendChild(tooltip); + var targetElementPos = InkElement.offset(this.element); + var tleft = targetElementPos[0], + ttop = targetElementPos[1]; + + var centerh = (InkElement.elementWidth(this.element) / 2) - (InkElement.elementWidth(tooltip) / 2), + centerv = (InkElement.elementHeight(this.element) / 2) - (InkElement.elementHeight(tooltip) / 2); + var spacing = this._getIntOpt('spacing'); + + var tooltipDims = InkElement.elementDimensions(tooltip); + var elementDims = InkElement.elementDimensions(this.element); + + var maxX = InkElement.scrollWidth() + InkElement.viewportWidth(); + var maxY = InkElement.scrollHeight() + InkElement.viewportHeight(); + + where = this._getWhereValueInsideViewport(where, { + left: tleft - tooltipDims[0], + right: tleft + tooltipDims[0], + top: ttop + tooltipDims[1], + bottom: ttop + tooltipDims[1] + }, { + right: maxX, + bottom: maxY + }); + + if (where === 'up') { + ttop -= tooltipDims[1]; + ttop -= spacing; + tleft += centerh; + } else if (where === 'down') { + ttop += elementDims[1]; + ttop += spacing; + tleft += centerh; + } else if (where === 'left') { + tleft -= tooltipDims[0]; + tleft -= spacing; + ttop += centerv; + } else if (where === 'right') { + tleft += elementDims[0]; + tleft += spacing; + ttop += centerv; + } + + var arrow = null; + if (where.match(/(up|down|left|right)/)) { + arrow = document.createElement('SPAN'); + Css.addClassName(arrow, 'arrow'); + Css.addClassName(arrow, this._oppositeDirections[where]); + tooltip.appendChild(arrow); + } + + var tooltipLeft = tleft; + var tooltipTop = ttop; + + var toBottom = (tooltipTop + tooltipDims[1]) - maxY; + var toRight = (tooltipLeft + tooltipDims[0]) - maxX; + var toLeft = 0 - tooltipLeft; + var toTop = 0 - tooltipTop; + + if (toBottom > 0) { + if (arrow) { arrow.style.top = (tooltipDims[1] / 2) + toBottom + 'px'; } + tooltipTop -= toBottom; + } else if (toTop > 0) { + if (arrow) { arrow.style.top = (tooltipDims[1] / 2) - toTop + 'px'; } + tooltipTop += toTop; + } else if (toRight > 0) { + if (arrow) { arrow.style.left = (tooltipDims[0] / 2) + toRight + 'px'; } + tooltipLeft -= toRight; + } else if (toLeft > 0) { + if (arrow) { arrow.style.left = (tooltipDims[0] / 2) - toLeft + 'px'; } + tooltipLeft += toLeft; + } + + tooltip.style.left = tooltipLeft + 'px'; + tooltip.style.top = tooltipTop + 'px'; + } + }, + + /** + * Get a value for "where" (left/right/up/down) which doesn't put the + * tooltip off the screen + * + * @method _getWhereValueInsideViewport + * @param where {String} "where" value which was given by the user and we might change + * @param bbox {BoundingBox} A bounding box like what you get from getBoundingClientRect ({top, bottom, left, right}) with pixel positions from the top left corner of the viewport. + * @param viewport {BoundingBox} Bounding box for the viewport. "top" and "left" are omitted because these coordinates are relative to the top-left corner of the viewport so they are zero. + * + * @TODO: we can't use getBoundingClientRect in this case because it returns {0,0,0,0} on our uncreated tooltip. + */ + _getWhereValueInsideViewport: function (where, bbox, viewport) { + if (where === 'left' && bbox.left < 0) { + return 'right'; + } else if (where === 'right' && bbox.right > viewport.right) { + return 'left'; + } else if (where === 'up' && bbox.top < 0) { + return 'down'; + } else if (where === 'down' && bbox.bottom > viewport.bottom) { + return 'up'; + } + + return where; + }, + _removeTooltip: function() { + var tooltip = this.tooltip; + if (!tooltip) {return;} + + var remove = Ink.bind(InkElement.remove, {}, tooltip); + + if (this._getOpt('where') !== 'mousemove' && transitionDurationName) { + tooltip.style.opacity = 0; + // remove() will operate on correct tooltip, although this.tooltip === null then + setTimeout(remove, this._getFloatOpt('fade') * 1000); + } else { + remove(); + } + this.tooltip = null; + }, + _getOpt: function (option) { + var dataAttrVal = InkElement.data(this.element)[InkElement._camelCase('tip-' + option)]; + if (dataAttrVal /* either null or "" may signify the absense of this attribute*/) { + return dataAttrVal; + } + var instanceOption = this.root.options[option]; + if (typeof instanceOption !== 'undefined') { + return instanceOption; + } + }, + _getIntOpt: function (option) { + return parseInt(this._getOpt(option), 10); + }, + _getFloatOpt: function (option) { + return parseFloat(this._getOpt(option), 10); + }, + _destroy: function () { + if (this.tooltip) { + InkElement.remove(this.tooltip); + } + this.root = null; // Cyclic reference = memory leaks + this.element = null; + this.tooltip = null; + }, + _onMouseOver: function(e) { + // on IE < 10 you can't access the mouse event not even a tick after it fired + var mousePosition = this._getMousePosition(e); + var delay = this._getFloatOpt('delay'); + if (delay) { + this._delayTimeout = setTimeout(Ink.bind(function () { + if (!this.tooltip) { + this._makeTooltip(mousePosition); + } + this._delayTimeout = null; + }, this), delay * 1000); + } else { + this._makeTooltip(mousePosition); + } + }, + _onMouseMove: function(e) { + if (this._getOpt('where') === 'mousemove' && this.tooltip) { + var mPos = this._getMousePosition(e); + this._setPos(mPos[0], mPos[1]); + } + }, + _onMouseOut: function () { + if (!this._getIntOpt('forever')) { + this._removeTooltip(); + } + if (this._delayTimeout) { + clearTimeout(this._delayTimeout); + this._delayTimeout = null; + } + }, + _onTooltipMouseOver: function () { + if (this.tooltip) { // If tooltip is already being removed, this has no effect + this._removeTooltip(); + } + }, + _setPos: function(left, top) { + left += this._getIntOpt('left'); + top += this._getIntOpt('top'); + var pageDims = this._getPageXY(); + if (this.tooltip) { + var elmDims = [InkElement.elementWidth(this.tooltip), InkElement.elementHeight(this.tooltip)]; + var scrollDim = this._getScroll(); + + if((elmDims[0] + left - scrollDim[0]) >= (pageDims[0] - 20)) { + left = (left - elmDims[0] - this._getIntOpt('left') - 10); + } + if((elmDims[1] + top - scrollDim[1]) >= (pageDims[1] - 20)) { + top = (top - elmDims[1] - this._getIntOpt('top') - 10); + } + + this.tooltip.style.left = left + 'px'; + this.tooltip.style.top = top + 'px'; + } + }, + _getPageXY: function() { + var cWidth = 0; + var cHeight = 0; + if( typeof( window.innerWidth ) === 'number' ) { + cWidth = window.innerWidth; + cHeight = window.innerHeight; + } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { + cWidth = document.documentElement.clientWidth; + cHeight = document.documentElement.clientHeight; + } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { + cWidth = document.body.clientWidth; + cHeight = document.body.clientHeight; + } + return [parseInt(cWidth, 10), parseInt(cHeight, 10)]; + }, + _getScroll: function() { + var dd = document.documentElement, db = document.body; + if (dd && (dd.scrollLeft || dd.scrollTop)) { + return [dd.scrollLeft, dd.scrollTop]; + } else if (db) { + return [db.scrollLeft, db.scrollTop]; + } else { + return [0, 0]; + } + }, + _getMousePosition: function(e) { + return [parseInt(InkEvent.pointerX(e), 10), parseInt(InkEvent.pointerY(e), 10)]; + } + }; + + return Tooltip; +}); + +/** + * Elements in a tree structure + * @module Ink.UI.TreeView_1 + * @version 1 + */ +Ink.createModule('Ink.UI.TreeView', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, Event, Css, Element, Selector, InkArray ) { + 'use strict'; + + + /** + * Shows elements in a tree structure which can be expanded and contracted. + * A TreeView is built with "node"s and "children". "node"s are `li` tags, and "children" are `ul` tags. + * You can build your TreeView out of a regular UL and LI element structure which you already use to display lists with several levels. + * If you want a node to be open when the TreeView is built, just add the data-open="true" attribute to it. + * + * @class Ink.UI.TreeView + * @constructor + * @version 1 + * @param {String|DOMElement} selector Element or selector. + * @param {String} [options] Options object, containing: + * @param {String} [options.node] Selector for the nodes. Defaults to 'li'. + * @param {String} [options.children] Selector for the children. Defaults to 'ul'. + * @param {String} [options.parentClass] CSS classes to be added to parent nodes. Defaults to 'parent'. + * @param {String} [options.openClass] CSS classes to be added to the icon when a parent is open. Defaults to 'fa fa-minus-circle'. + * @param {String} [options.closedClass] CSS classes to be added to the icon when a parent is closed. Defaults to 'fa fa-plus-circle'. + * @param {String} [options.hideClass] CSS Class to toggle visibility of the children. Defaults to 'hide-all'. + * @param {String} [options.iconTag] The name of icon tag. The component tries to find a tag with that name as a direct child of the node. If it doesn't find it, it creates it. Defaults to 'i'. + * @param {Boolean} [options.stopDefault] Flag to stops the default behavior of the click handler. Defaults to true. + * @example + * + * + * + * @sample Ink_UI_TreeView_1.html + */ + function TreeView() { + Common.BaseUIComponent.apply(this, arguments); + } + + TreeView._name = 'TreeView_1'; + + TreeView._optionDefinition = { + 'node': ['String', 'li'], + // [3.0.1] Deprecate this terrible, terrible name + 'child': ['String',null], + 'children': ['String','ul'], + 'parentClass': ['String','parent'], + 'openNodeClass': ['String', 'open'], + 'openClass': ['String','fa fa-minus-circle'], + 'closedClass': ['String','fa fa-plus-circle'], + 'hideClass': ['String','hide-all'], + 'iconTag': ['String', 'i'], + 'stopDefault' : ['Boolean', true] + }; + + TreeView.prototype = { + /** + * Init function called by the constructor. Sets the necessary event handlers. + * + * @method _init + * @private + */ + _init: function(){ + if (this._options.child) { + Ink.warn('Ink.UI.TreeView: options.child is being renamed to options.children.'); + this._options.children = this._options.child; + } + + this._handlers = { + click: Ink.bindEvent(this._onClick,this) + }; + + Event.on(this._element, 'click', this._options.node, this._handlers.click); + + InkArray.each(Ink.ss(this._options.node, this._element), Ink.bind(function(item){ + if( this.isParent(item) ) { + Css.addClassName(item, this._options.parentClass); + + var isOpen = this.isOpen(item); + if( !this._getIcon(item) ){ + Element.create(this._options.iconTag, { insertTop: item }); + } + + this._setNodeOpen(item, isOpen); + } + },this)); + }, + + _getIcon: function (node) { + return Ink.s('> ' + this._options.iconTag, node); + }, + + /** + * Checks if a node is open. + * + * @method isOpen + * @param {DOMElement} node The tree node to check + **/ + isOpen: function (node) { + if (!this._getChild(node)) { + throw new Error('not a node!'); + } + + return Element.data(node).open === 'true' || + Css.hasClassName(node, this._options.openNodeClass); + }, + + /** + * Checks if a node is a parent. + * + * @method isParent + * @param {DOMElement} node Node to check + **/ + isParent: function (node) { + return Css.hasClassName(node, this._options.parentClass) || + this._getChild(node) != null; + }, + + _setNodeOpen: function (node, beOpen) { + var child = this._getChild(node); + if (child) { + Css.setClassName(child, this._options.hideClass, !beOpen); + var icon = this._getIcon(node); + + node.setAttribute('data-open', beOpen); + + /* + * Don't refactor this to + * + * setClassName(el, className, status); setClassName(el, className, !status); + * + * because it won't work with multiple classes. + * + * Doing: + * setClassName(el, 'fa fa-whatever', true);setClassName(el, 'fa fa-whatever-else', false); + * + * will remove 'fa' although it is a class we want. + */ + + var toAdd = beOpen ? this._options.openClass : this._options.closedClass; + var toRemove = beOpen ? this._options.closedClass : this._options.openClass; + Css.removeClassName(icon, toRemove); + Css.addClassName(icon, toAdd); + + Css.setClassName(node, this._options.openNodeClass, beOpen); + } else { + Ink.error('Ink.UI.TreeView: node', node, 'is not a node!'); + } + }, + + /** + * Opens one of the tree nodes + * + * Make sure you pass the node's DOMElement + * @method open + * @param {DOMElement} node The node you wish to open. + **/ + open: function (node) { + this._setNodeOpen(node, true); + }, + + /** + * Closes one of the tree nodes + * + * Make sure you pass the node's DOMElement + * @method close + * @param {DOMElement} node The node you wish to close. + **/ + close: function (node) { + this._setNodeOpen(node, false); + }, + + /** + * Toggles a node state + * + * @method toggle + * @param {DOMElement} node The node to toggle. + **/ + toggle: function (node) { + if (this.isOpen(node)) { + this.close(node); + } else { + this.open(node); + } + }, + + _getChild: function (node) { + return Selector.select(this._options.children, node)[0] || null; + }, + + /** + * Handles the click event (as specified in the _init function). + * + * @method _onClick + * @param {Event} event + * @private + */ + _onClick: function(ev){ + /** + * Summary: + * If the clicked element is a "node" as defined in the options, will check if it has any "child". + * If so, will toggle its state and stop the event's default behavior if the stopDefault option is true. + **/ + + if (!this.isParent(ev.currentTarget) || + Selector.matchesSelector(ev.target, this._options.node) || + Selector.matchesSelector(ev.target, this._options.children)) { + return; + } + + if (this._options.stopDefault){ + ev.preventDefault(); + } + + this.toggle(ev.currentTarget); + } + }; + + Common.createUIComponent(TreeView); + + return TreeView; +}); + +Ink.createModule('Ink.UI.Upload', '1', [ + 'Ink.Dom.Event_1', + 'Ink.Dom.Element_1', + 'Ink.Dom.Browser_1', + 'Ink.UI.Common_1' +], function(Event, Element, Browser, Common) { + 'use strict'; + + var DirectoryReader = function(options) { + this.init(options); + }; + + DirectoryReader.prototype = { + init: function(options) { + this._options = Ink.extendObj({ + entry: undefined, + maxDepth: 10 + }, options || {}); + + try { + this._read(); + } catch(e) { + Ink.error(e); + } + }, + + + _read: function() { + if(!this._options.entry) { + Ink.error('You must specify the entry!'); + return; + } + + try { + this._readDirectories(); + } catch(e) { + Ink.error(e); + } + }, + + + _readDirectories: function() { + var entries = [], + running = false, + maxDepth = 0; + + /* TODO return as tree because much better well */ + var _readEntries = Ink.bind(function(currentEntry) { + var dir = currentEntry.createReader(); + running = true; + + dir.readEntries(Ink.bind(function(res) { + if(res.length > 0) { + for(var i = 0, len = res.length; i=0; i--) { + if(typeof(arr[i]) === 'undefined' || arr[i] === null || arr[i] === '') { + arr.splice(i, 1); + } + } + return arr; + } + }; + + var Queue = { + lists: [], + items: [], + + + /** + * Create new queue list + * @function create + * @public + * @param {String} list name + * @param {Function} function to iterate on items + * @return {Object} list id + */ + create: function(name) { + var id; + name = String(name); + this.lists.push({name: name}); + id = this.lists.length - 1; + return id; + }, + + + getItems: function(parentId) { + if(!parentId) { + return this.items; + } + var items = []; + for(var i = 0, len = this.items.length; i=0; i--) { + if(this.items[i] && id === this.items[i].parentId) { + this.remove(this.items[i].parentId, this.items[i].pid); + } + } + if(!keepList) { + this.lists.splice(id, 1); + } + return true; + } catch(e) { + Ink.error('Purge: invalid id'); + return false; + } + }, + + + /** + * add an item to a list + * @function add + * @public + * @param {String} name + * @param {Object} item + * @return {Number} pid + */ + add: function(parentId, item, priority) { + if(!this.lists[parentId]) { + return false; + } + if(typeof(item) !== 'object') { + item = String(item); + } + + var pid = parseInt(Math.round(Math.random() * 100000) + "" + Math.round(Math.random() * 100000), 10); + priority = priority || 0; + + this.items.push({parentId: parentId, item: item, priority: priority || 0, pid: pid}); + return pid; + }, + + + /** + * View list + * @function view + * @public + * @param {Number} list id + * @param {Number} process id + * @return {Object} item + */ + view: function(parentId, pid) { + var id = this._searchByPid(parentId, pid); + if(id === false) { + return false; + } + return this.items[id]; + }, + + + /** + * Remove an item + * @function remove + * @public + * @param {Object} item + * @return {Object|Boolean} removed item or false if not found + */ + remove: function(parentId, pid) { + try { + var id = this._searchByPid(parentId, pid); + if(id === false) { + return false; + } + this.items.splice(id, 1); + return true; + } catch(e) { + Ink.error('Remove: invalid id'); + return false; + } + }, + + _searchByPid: function(parentId, pid) { + if(!parentId && typeof(parentId) === 'boolean' || !pid) { + return false; + } + + parentId = parseInt(parentId, 10); + pid = parseInt(pid, 10); + + if(isNaN(parentId) || isNaN(pid)) { + return false; + } + + for(var i = 0, len = this.items.length; i this._options.minSizeToUseChunks; + }, + + + _dropEventHandler: function(ev) { + Event.stop(ev); + + this.publish('DropComplete', ev.dataTransfer); + + var data = ev.dataTransfer; + + if(!data || !data.files || !data.files.length) { + return false; + } + + this._files = data.files; + this._files = Array.prototype.slice.call(this._files || [], 0); + + // check if webkitGetAsEntry exists on first item + if(data.items && data.items[0] && data.items[0].webkitGetAsEntry) { + if(!this._options.foldersEnabled) { + return setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0); + } + var entry, folders = []; + for(var i = ev.dataTransfer.items.length-1; i>=0; i--) { + entry = ev.dataTransfer.items[i].webkitGetAsEntry(); + if(entry && entry.isDirectory) { + folders.push(entry); + this._files[i].isDirectory = true; + this._files.splice(i, 1); + } + } + // starting callback hell + this._addFolderToQueue(folders, Ink.bind(function() { + setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0); + }, this)); + } else { + setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0); + } + + return true; + }, + + + _addFolderToQueue: function(folders, cb) { + var files = [], invalidFolders = {}; + + if(!folders || !folders.length) { + cb(); + return files; + } + + var getFiles = function(entries) { + var files = []; + for(var i = 0, len = entries.length; i this._options.maxFilesize) { + this.publish('MaxSizeFailure', file, this._options.maxFilesize); + continue; + } + + fileID = parseInt(Math.round(Math.random() * 100000) + "" + Math.round(Math.random() * 100000), 10); + o = { id: i, data: file, fileID: fileID, directory: file.isDirectory }; + Queue.add(this._queueId, o); + + this.publish('FileAddedToQueue', o); + } + this._processQueue(true); + this._files = []; + }, + + + _processQueue: function(internalUpload) { + if(this._queueRunning) { + return false; + } + + this.running = 0; + var max = 1, i = 0, items, + queueLen = Queue.items.length; + this._queueRunning = true; + + this.interval = setInterval(Ink.bind(function() { + if(Queue.items.length === i && this.running === 0) { + Queue.purge(this._queueId, true); + this._queueRunning = false; + clearInterval(this.interval); + this.publish('QueueEnd', this._queueId, queueLen); + } + + items = Queue.getItems(this._queueId); + + if(this.running < max && items[i]) { + if(!items[i].canceled) { + _doRequest.call(this, items[i].pid, items[i].item.data, items[i].item.fileID, items[i].item.directory, internalUpload); + this.running++; + i++; + } else { + var j = i; + while(items[j] && items[j].canceled) { + i++; + j++; + } + } + return true; + } + return false; + }, this), 100); + + + var _doRequest = function(pid, data, fileID, directory, internalUpload) { + var o = { + file: data, + fileID: fileID, + cb: Ink.bind(function() { + this.running--; + }, this) + }; + if(internalUpload) { + if(directory) { + // do magic + o.cb(); + } else { + this._upload(o); + } + } + }; + + return true; + }, + + + _upload: function(o) { + var file = o.file, + xhr = new XMLHttpRequest(), + fileID = o.fileID; + + this.publish('BeforeUpload', file, this._options.extraData, fileID, xhr, this._supportChunks(file.size)); + + var forceAbort = function(showError) { + if(o.cb && typeof(o.cb === 'function')) { + o.cb(); + } + + this.publish('OnProgress', { + length: file.size, + lengthComputable: true, + loaded: file.size, + total: file.size + }, file, fileID); + this.publish('EndUpload', file, fileID, (showError ? { error: true } : true)); + this.publish('InvalidFile', file, 'name'); + xhr.abort(); + }; + + if(this._options.INVALID_FILE_NAME && this._options.INVALID_FILE_NAME instanceof RegExp) { + if(this._options.INVALID_FILE_NAME.test(o.file.name)) { + forceAbort.call(this); + return; + } + } + + // If file was renamed, abort it + // FU OPERA: Opera always return lastModified date as null + if(!file.lastModifiedDate && !Ink.Dom.Browser.OPERA) { + forceAbort.call(this, true); + return; + } + + xhr.upload.onprogress = Ink.bind(this.publish, this, 'OnProgress', file, fileID); + + var endpoint, method; + if(this._supportChunks(file.size)) { + if(file.size <= file.chunk_offset) { + endpoint = this._options.endpointChunkCommit; + method = 'POST'; + } else { + endpoint = this._options.endpointChunk; + if(file.chunk_upload_id) { + endpoint += '?upload_id=' + file.chunk_upload_id; + } + if(file.chunk_offset) { + endpoint += '&offset=' + file.chunk_offset; + } + method = 'PUT'; + } + } else { + endpoint = this._options.endpoint; + method = 'POST'; + } + + xhr.open(method, endpoint, true); + xhr.withCredentials = true; + xhr.setRequestHeader("x-requested-with", "XMLHttpRequest"); + if(this._supportChunks(file.size)) { + xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + } + + var fd = new FormData(), + blob; + + if("Blob" in window && typeof Blob === 'function') { + blob = new Blob([file], { type: file.type }); + if(this._supportChunks(file.size)) { + file.chunk_offset = file.chunk_offset || 0; + blob = blob.slice(file.chunk_offset, file.chunk_offset + this._options.chunkSize); + } else { + fd.append(this._options.fileFormName, blob, file.name); + } + } else { + fd.append(this._options.fileFormName, file); + } + + if(!this._supportChunks(file.size)) { + for(var k in this._options.extraData) { + if(this._options.extraData.hasOwnProperty(k)) { + fd.append(k, this._options.extraData[k]); + } + } + } else { + fd.append('upload_id', file.chunk_upload_id); + fd.append('path', file.upload_path); + } + + if(!file.hasParent) { + if(!this._supportChunks(file.size)) { + xhr.send(fd); + } else { + if(file.size <= file.chunk_offset) { + xhr.send('upload_id=' + file.chunk_upload_id + '&path=' + file.upload_path + '/' + file.name); + } else { + xhr.send(blob); + } + } + } else { + this.publish('cbCreateFolder', file.parentID, file.fullPath, this._options.extraData, this._folders, file.rootPath, Ink.bind(function() { + if(!this._supportChunks(file.size)) { + xhr.send(fd); + } else { + if(file.size <= file.chunk_offset) { + xhr.send('upload_id=' + file.chunk_upload_id + '&path=' + file.upload_path + '/' + file.name); + } else { + xhr.send(blob); + } + } + }, this)); + } + + + xhr.onload = Ink.bindEvent(function() { + /* jshint boss:true */ + if(this._supportChunks(file.size) && file.size > file.chunk_offset) { + if(xhr.response) { + var response = JSON.parse(xhr.response); + + // check expected offset + var invalidOffset = file.chunk_offset && response.offset !== (file.chunk_offset + this._options.chunkSize) && file.size !== response.offset; + if(invalidOffset) { + if(o.cb) { + o.cb(); + } + this.publish('ErrorUpload', file, fileID); + } else { + file.chunk_upload_id = response.upload_id; + file.chunk_offset = response.offset; + file.chunk_expires = response.expires; + this._upload(o); + } + } else { + if(o.cb) { + o.cb(); + } + this.publish('ErrorUpload', file, fileID); + } + return (xhr = null); + } + + if(o.cb) { + o.cb(); + } + + if(xhr.responseText && xhr['status'] < 400) { + this.publish('EndUpload', file, fileID, xhr.responseText); + } else { + this.publish('ErrorUpload', file, fileID); + } + return (xhr = null); + }, this); + + + xhr.onerror = Ink.bindEvent(function() { + if(o.cb) { + o.cb(); + } + this.publish('ErrorUpload', file, fileID); + }, this); + + xhr.onabort = Ink.bindEvent(function() { + if(o.cb) { + o.cb(); + } + this.publish('AbortUpload', file, fileID, { + abortAll: Ink.bind(this.abortAll, this), + abortOne: Ink.bind(this.abortOne, this) + }); + }, this); + }, + + + abortAll: function() { + if(!this._queueRunning) { + return false; + } + clearInterval(this.interval); + this._queueRunning = false; + Queue.purge(this._queueId, true); + return true; + }, + + abortOne: function(id, cb) { + var items = Queue.getItems(0), + o; + for(var i = 0, len = items.length; ia;++a)if(c=g[a]){for(e in c.left)c.left.hasOwnProperty(e)&&(f=d[e],f&&(c.args[c.left[e]]=f,delete c.left[e],--c.remaining));if(c.remaining>0)i.push(c);else{if(h=c.cb,!h)continue;delete c.cb,h.apply(!1,c.args)}}g=i,g.length>0&&setTimeout(function(){Ink._checkPendingRequireModules()},0)},getPath:function(a,b){var d=a.split(/[._]/g),e,f,g,h;for(f=d.length;f>=0;f-=1)if(e=d.slice(0,f+1).join("."),c[e]){g=e;break}return g in c?(h=c[g],/\/$/.test(h)||(h+="/"),f0&&g[0].appendChild(f)},_loadLater:function(a){setTimeout(function(){d[a]||f[a]||h[a]||(f[a]=!0,Ink.loadScript(a))},0)},namespace:function(b,c){if(!b||!b.length)return null;for(var d=b.split("."),e=a,f,g=0,h=d.length;h>g;++g)e[d[g]]=e[d[g]]||{},f=e,e=e[d[g]];return c?[f,d[g-1]]:e},getModule:function(a,b){var c=b?[a,"_",b].join(""):a;return d[c]},createModule:function(b,c,g,i){if("string"!=typeof b)throw new Error("module name must be a string!");if(!("number"==typeof c||"string"==typeof c&&c.length>0))throw new Error("version number missing!");var k=[b,"_",c].join("");h[k]=!0;var l=function(){if(!d[k]){delete f[k],delete f[b];var g=Array.prototype.slice.call(arguments),l=i.apply(a,g);e.push(k),"object"==typeof l?l._version=c:"function"==typeof l&&(l.prototype._version=c,l._version=c);var m=0===b.indexOf("Ink."),n;m&&(n=Ink.namespace(b,!0)),d[k]=l,delete h[k],m&&(n[0][n[1]+"_"+c]=l),d[b]=l,m&&j(n[0][n[1]])&&(n[0][n[1]]=l),this&&Ink._checkPendingRequireModules()}};this.requireModules(g,l)},requireModules:function(a,b){var c,e,h,i,j;if(e=a&&a.length,h={args:new Array(e),left:{},remaining:e,cb:b},"object"!=typeof a||void 0===a.length)throw new Error("Dependency list should be an array!");if("function"!=typeof b)throw new Error("Callback should be a function!");for(c=0;e>c;++c)Ink._moduleRenames[a[c]]?(Ink.warn(a[c]+" was renamed to "+Ink._moduleRenames[a[c]]),i=Ink._moduleRenames[a[c]]):i=a[c],i?(j=d[i],j?(h.args[c]=j,--h.remaining):(f[i]||Ink._loadLater(i),h.left[i]=c)):--h.remaining;h.remaining>0?g.push(h):b.apply(!0,h.args)},_moduleRenames:{"Ink.UI.Aux_1":"Ink.UI.Common_1"},getModulesLoadOrder:function(){return e.slice()},getModuleScripts:function(){var a=this.getModulesLoadOrder();return a.unshift("Ink_1"),a=a.map(function(a){return[""].join("")}),a.join("\n")},createExt:function(a,b,c,d){return Ink.createModule("Ink.Ext."+a,b,c,d)},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=Array.prototype.slice.call(arguments),e=c.concat(d);return a.apply(b===!1?this:b,e)}},bindMethod:function(a,b){return Ink.bind.apply(Ink,[a[b],a].concat([].slice.call(arguments,2)))},bindEvent:function(b,c){var d=Array.prototype.slice.call(arguments,2);return function(e){var f=d.slice();return f.unshift(e||a.event),b.apply(c===!1?this:c,f)}},i:function(a){if(!a)throw new Error("Ink.i => id or element must be passed");return"string"==typeof a?b.getElementById(a):a},ss:function(a,c){if("undefined"==typeof Ink.Dom||"undefined"==typeof Ink.Dom.Selector)throw new Error("This method requires Ink.Dom.Selector");return Ink.Dom.Selector.select(a,c||b)},s:function(a,c){if("undefined"==typeof Ink.Dom||"undefined"==typeof Ink.Dom.Selector)throw new Error("This method requires Ink.Dom.Selector");return Ink.Dom.Selector.select(a,c||b)[0]||null},extendObj:function(a){for(var b=[].slice.call(arguments,1),c=0,d=b.length;d>c;c++)if(b[c])for(var e in b[c])Object.prototype.hasOwnProperty.call(b[c],e)&&(a[e]=b[c][e]);return a},log:function(){var b=a.console;b&&b.log&&i.call(b.log,b,arguments)},warn:function(){var b=a.console;b&&b.warn&&i.call(b.warn,b,arguments)},error:function(){var b=a.console;b&&b.error&&i.call(b.error,b,arguments)}}}}(window,document),Ink.createModule("Ink.Net.Ajax","1",[],function(){"use strict";var Ajax=function(a,b){this.init(a,b)};Ajax.globalOptions={parameters:{},requestHeaders:{}};var xMLHttpRequestWithCredentials="XMLHttpRequest"in window&&"withCredentials"in new XMLHttpRequest;return Ajax.prototype={init:function(a,b){if(!a)throw new Error("WRONG_ARGUMENTS_ERR");var c=Ink.extendObj({asynchronous:!0,method:"POST",parameters:null,timeout:0,delay:0,postBody:"",contentType:"application/x-www-form-urlencoded",requestHeaders:null,onComplete:null,onSuccess:null,onFailure:null,onException:null,onHeaders:null,onCreate:null,onInit:null,onTimeout:null,sanitizeJSON:!1,evalJS:!0,xhrProxy:"",cors:!1,debug:!1,useCredentials:!1,signRequest:!1},Ajax.globalOptions);if(b&&"object"==typeof b){if(c=Ink.extendObj(c,b),"object"==typeof b.parameters)c.parameters=Ink.extendObj(Ink.extendObj({},Ajax.globalOptions.parameters),b.parameters);else if(null!==b.parameters){var d=this.paramsObjToStr(Ajax.globalOptions.parameters);d&&(c.parameters=b.parameters+"&"+d)}c.requestHeaders=Ink.extendObj({},Ajax.globalOptions.requestHeaders),c.requestHeaders=Ink.extendObj(c.requestHeaders,b.requestHeaders)}this.options=c,this.safeCall("onInit"),this.url=a;var e=this._locationFromURL(a);this.isHTTP=this._locationIsHTTP(e),this.isCrossDomain=this._locationIsCrossDomain(e,location),this.requestHasBody=c.method.search(/^get|head$/i)<0,this.options.cors&&(this.isCrossDomain=!1),this.transport=this.getTransport(),this.request()},_locationFromURL:function(a){var b=document.createElementNS?document.createElementNS("http://www.w3.org/1999/xhtml","a"):document.createElement("a");return b.href=a,b},_locationIsHTTP:function(a){return a.protocol.match(/^https?:/i)?!0:!1},_locationIsCrossDomain:function(a,b){return b=b||window.location,Ajax.prototype._locationIsHTTP(a)&&"widget:"!==b.protocol&&"object"!=typeof window.widget?b.protocol!==a.protocol||b.host.split(":")[0]!==a.host.split(":")[0]:!1},getTransport:function(){if(!xMLHttpRequestWithCredentials&&this.options.cors&&"XDomainRequest"in window)return this.usingXDomainReq=!0,new XDomainRequest;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"==typeof ActiveXObject)return null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){return new ActiveXObject("Microsoft.XMLHTTP")}},setHeaders:function(){if(this.transport)try{var a={Accept:"text/javascript,text/xml,application/xml,application/xhtml+xml,text/html,application/json;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1","Accept-Language":navigator.language,"X-Requested-With":"XMLHttpRequest","X-Ink-Version":"2"};if(this.options.cors&&(this.options.signRequest||delete a["X-Requested-With"],delete a["X-Ink-Version"]),this.options.requestHeaders&&"object"==typeof this.options.requestHeaders)for(var b in this.options.requestHeaders)this.options.requestHeaders.hasOwnProperty(b)&&(a[b]=this.options.requestHeaders[b]);this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005&&(a.Connection="close");for(var c in a)a.hasOwnProperty(c)&&this.transport.setRequestHeader(c,a[c])}catch(d){}},paramsObjToStr:function(a){var b,c,d,e,f=[];if("object"!=typeof a)return a;for(d in a)if(a.hasOwnProperty(d))if(e=a[d],"[object Array]"!==Object.prototype.toString.call(e)||isNaN(e.length))f=f.concat([encodeURIComponent(d),"=",encodeURIComponent(e),"&"]);else for(b=0,c=e.length;c>b;b++)f=f.concat([encodeURIComponent(d),"[]","=",encodeURIComponent(e[b]),"&"]);return f.length>0&&f.pop(),f.join("")},setParams:function(){var a=null,b=this.options.parameters;a="object"==typeof b?this.paramsObjToStr(b):""+b,a&&(this.url=this.url.indexOf("?")>-1?this.url.split("#")[0]+"&"+a:this.url.split("#")[0]+"?"+a)},getHeader:function(a){if(this.usingXDomainReq&&"Content-Type"===a)return this.transport.contentType;try{return this.transport.getResponseHeader(a)}catch(b){return null}},getAllHeaders:function(){try{return this.transport.getAllResponseHeaders()}catch(a){return null}},getResponse:function(){var a=this.transport,b={headerJSON:null,responseJSON:null,getHeader:this.getHeader,getAllHeaders:this.getAllHeaders,request:this,transport:a,timeTaken:new Date-this.startTime,requestedUrl:this.url};b.readyState=a.readyState;try{b.responseText=a.responseText}catch(c){}try{b.responseXML=a.responseXML}catch(c){}try{b.status=a.status}catch(c){b.status=0}try{b.statusText=a.statusText}catch(c){b.statusText=""}return b},abort:function(){if(this.transport){clearTimeout(this.delayTimeout),clearTimeout(this.stoTimeout);try{this.transport.abort()}catch(a){}this.finish()}},runStateChange:function(){var a=this.transport.readyState;if(3===a)this.isHTTP&&this.safeCall("onHeaders");else if(4===a||this.usingXDomainReq){if(this.options.asynchronous&&this.options.delay&&this.startTime+this.options.delay>(new Date).getTime())return void(this.delayTimeout=setTimeout(Ink.bind(this.runStateChange,this),this.options.delay+this.startTime-(new Date).getTime()));var b,c=this.transport.responseText,d=this.getResponse(),e=this.transport.status;this.isHTTP&&!this.options.asynchronous&&this.safeCall("onHeaders"),clearTimeout(this.stoTimeout),0===e?this.isHTTP?this.safeCall("onException",this.makeError(18,"NETWORK_ERR")):e=c?200:404:304===e&&(e=200);var f=this.usingXDomainReq||e>=200&&300>e,g=this.getHeader("Content-Type")||"";if(this.options.evalJS&&(g.indexOf("application/json")>=0||"force"===this.options.evalJS))try{b=this.evalJSON(c,this.sanitizeJSON),b&&(c=d.responseJSON=b)}catch(h){f&&this.safeCall("onException",h)}if(this.usingXDomainReq&&-1!==g.indexOf("xml")&&"DOMParser"in window){var i;switch(g){case"application/xml":case"application/xhtml+xml":case"image/svg+xml":i=g;break;default:i="text/xml"}var j=(new DOMParser).parseFromString(this.transport.responseText,i);this.transport.responseXML=j,d.responseXML=j}null!==this.transport.responseXML&&null===d.responseJSON&&""!==this.transport.responseXML.xml&&(c=this.transport.responseXML),(e||this.usingXDomainReq)&&(f?this.safeCall("onSuccess",d,c):this.safeCall("onFailure",d,c),this.safeCall("on"+e,d,c)),this.finish(d,c)}},finish:function(a,b){if(a&&this.safeCall("onComplete",a,b),clearTimeout(this.stoTimeout),this.transport){try{this.transport.onreadystatechange=null}catch(c){}"function"==typeof this.transport.destroy&&this.transport.destroy(),this.transport=null}},safeCall:function(a,b){function c(a){setTimeout(function(){throw a.message&&(a.message+="\n"+(a.stacktrace||a.stack||"")),a},1)}if("function"==typeof this.options[a])try{this.options[a].apply(this,[].slice.call(arguments,1))}catch(d){c(d)}else b&&window.Error&&b instanceof Error&&c(b)},setRequestHeader:function(a,b){this.options.requestHeaders||(this.options.requestHeaders={}),this.options.requestHeaders[a]=b},request:function(){if(this.transport){var a=null;this.requestHasBody?(null!==this.options.postBody&&""!==this.options.postBody?(a=this.options.postBody,this.setParams()):null!==this.options.parameters&&""!==this.options.parameters&&(a=this.options.parameters),"object"!=typeof a||a.nodeType?"object"!=typeof a&&null!==a&&(a=""+a):a=this.paramsObjToStr(a),this.options.contentType&&this.setRequestHeader("Content-Type",this.options.contentType)):this.setParams();var b=this.url,c=this.options.method,d=this.isCrossDomain;d&&this.options.xhrProxy&&(this.setRequestHeader("X-Url",b),b=this.options.xhrProxy+encodeURIComponent(b),d=!1);try{this.transport.open(c,b,this.options.asynchronous)}catch(e){return this.safeCall("onException",e),this.finish(this.getResponse(),null)}this.setHeaders(),this.safeCall("onCreate"),this.options.timeout&&!isNaN(this.options.timeout)&&(this.stoTimeout=setTimeout(Ink.bind(function(){this.options.onTimeout&&(this.safeCall("onTimeout"),this.abort())},this),1e3*this.options.timeout)),this.options.useCredentials&&!this.usingXDomainReq&&(this.transport.withCredentials=!0),this.options.asynchronous&&!this.usingXDomainReq?this.transport.onreadystatechange=Ink.bind(this.runStateChange,this):this.usingXDomainReq&&(this.transport.onload=Ink.bind(this.runStateChange,this));try{if(d)throw this.makeError(18,"NETWORK_ERR");this.startTime=(new Date).getTime(),this.transport.send(a)}catch(e){return this.safeCall("onException",e),this.finish(this.getResponse(),null)}this.options.asynchronous||this.runStateChange()}},makeError:function(a,b){if("function"!=typeof Error)return{code:a,message:b};var c=new Error(b);return c.code=a,c},isJSON:function(a){return"string"==typeof a&&a?(a=a.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""),/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(a)):!1},evalJSON:function(strJSON,sanitize){if(strJSON&&(!sanitize||this.isJSON(strJSON)))try{return"undefined"!=typeof JSON&&"undefined"!=typeof JSON.parse?JSON.parse(strJSON):eval("("+strJSON+")")}catch(e){throw new Error("ERROR: Bad JSON string...")}return null}},Ajax.load=function(a,b){return new Ajax(a,{method:"GET",onSuccess:function(a){b(a.responseJSON||a.responseText,a)}})},Ajax.ping=function(a,b){return new Ajax(a,{method:"HEAD",onSuccess:function(a){"function"==typeof b&&b(a)}})},Ajax}),Ink.createModule("Ink.Net.JsonP","1",[],function(){"use strict";var a=function(a,b){this.init(a,b)};return a.prototype={init:function(a,b){if(this.options=Ink.extendObj({onSuccess:void 0,onFailure:void 0,failureObj:{},timeout:10,params:{},callbackParam:"jsoncallback",internalCallback:"_cb",randVar:!1},b||{}),this.randVar=this.options.randVar!==!1?this.options.randVar:parseInt(1e5*Math.random(),10),this.options.internalCallback+=this.randVar,this.uri=a,"function"==typeof this.options.onComplete&&(this.options.onSuccess=this.options.onComplete),"string"!=typeof this.uri)throw"Please define an URI";if("function"!=typeof this.options.onSuccess)throw"please define a callback function on option onSuccess!";Ink.Net.JsonP[this.options.internalCallback]=Ink.bind(function(){window.clearTimeout(this.timeout),delete window.Ink.Net.JsonP[this.options.internalCallback],this._removeScriptTag(),this.options.onSuccess(arguments[0])},this),this._addScriptTag()},_addParamsToGet:function(a,b){var c=-1!==a.indexOf("?"),d,e,f,g=[a];for(e in b)b.hasOwnProperty(e)&&(c?d="&":(d="?",c=!0),f=b[e],"number"==typeof f||f||(f=""),g=g.concat([d,e,"=",encodeURIComponent(f)]));return g.join("")},_getScriptContainer:function(){var a=document.getElementsByTagName("head");if(0===a.length){var b=document.getElementsByTagName("script");return b[0]}return a[0]},_addScriptTag:function(){this.options.params[this.options.callbackParam]="Ink.Net.JsonP."+this.options.internalCallback,this.options.params.rnd_seed=this.randVar,this.uri=this._addParamsToGet(this.uri,this.options.params);var a=document.createElement("script");a.type="text/javascript",a.src=this.uri;var b=this._getScriptContainer();b.appendChild(a),this.timeout=setTimeout(Ink.bind(this._requestFailed,this),1e3*this.options.timeout)},_requestFailed:function(){delete Ink.Net.JsonP[this.options.internalCallback],this._removeScriptTag(),"function"==typeof this.options.onFailure&&this.options.onFailure(this.options.failureObj)},_removeScriptTag:function(){for(var a,b=document.getElementsByTagName("script"),c,d=0,e=b.length;e>d;++d)if(a=b[d],c=a.getAttribute("src")||a.src,null!==c&&c===this.uri)return void a.parentNode.removeChild(a)}},a}),Ink.createModule("Ink.Dom.Browser","1",[],function(){"use strict";var a={IE:!1,GECKO:!1,OPERA:!1,SAFARI:!1,KONQUEROR:!1,CHROME:!1,model:!1,version:!1,userAgent:!1,cssPrefix:!1,domPrefix:!1,init:function(){this.detectBrowser(),this.setDimensions(),this.setReferrer()},setDimensions:function(){var a=0,b=0;"number"==typeof window.innerWidth?(a=window.innerWidth,b=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(a=document.documentElement.clientWidth,b=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(a=document.body.clientWidth,b=document.body.clientHeight),this.windowWidth=a,this.windowHeight=b},setReferrer:function(){this.referrer=document.referrer&&document.referrer.length?window.escape(document.referrer):!1},detectBrowser:function(){this._sniffUserAgent(navigator.userAgent)},_sniffUserAgent:function(a){if(this.userAgent=a,a=a.toLowerCase(),/applewebkit\//.test(a))if(this.cssPrefix="-webkit-",this.domPrefix="Webkit",/(chrome|crios)\//.test(a))this.CHROME=!0,this.model="chrome",this.version=a.replace(/(.*)chrome\/([^\s]+)(.*)/,"$2");else{this.SAFARI=!0,this.model="safari";var b=/version\/([^) ]+)/;this.version=b.test(a)?a.match(b)[1]:a.replace(/(.*)applewebkit\/([^\s]+)(.*)/,"$2")}else if(/opera/.test(a))this.OPERA=!0,this.model="opera",this.version=a.replace(/(.*)opera.([^\s$]+)(.*)/,"$2"),this.cssPrefix="-o-",this.domPrefix="O";else if(/konqueror/.test(a))this.KONQUEROR=!0,this.model="konqueror",this.version=a.replace(/(.*)konqueror\/([^;]+);(.*)/,"$2"),this.cssPrefix="-khtml-",this.domPrefix="Khtml";else if(/(msie|trident)/i.test(a))this.IE=!0,this.model="ie",this.version=/rv:((?:\d|\.)+)/.test(a)?a.match(/rv:((?:\d|\.)+)/)[1]:a.replace(/(.*)\smsie\s([^;]+);(.*)/,"$2"),this.cssPrefix="-ms-",this.domPrefix="ms";else if(/gecko/.test(a)){this.cssPrefix="-moz-",this.domPrefix="Moz",this.GECKO=!0;var c=/(camino|chimera|epiphany|minefield|firefox|firebird|phoenix|galeon|iceweasel|k\-meleon|seamonkey|netscape|songbird|sylera)/;if(c.test(a))this.model=a.match(c)[1],this.version=a.replace(new RegExp("(.*)"+this.model+"/([^;\\s$]+)(.*)"),"$2");else{this.model="mozilla";var d=/(.*)rv:([^)]+)(.*)/;d.test(a)&&(this.version=a.replace(d,"$2"))}}},debug:function(){var a="known browsers: (ie, gecko, opera, safari, konqueror) \n";a+=[this.IE,this.GECKO,this.OPERA,this.SAFARI,this.KONQUEROR]+"\n",a+="cssPrefix -> "+this.cssPrefix+"\n",a+="domPrefix -> "+this.domPrefix+"\n",a+="model -> "+this.model+"\n",a+="version -> "+this.version+"\n",a+="\n",a+="original UA -> "+this.userAgent,alert(a)}};return a.init(),a}),Ink.createModule("Ink.Dom.Css",1,[],function(){"use strict";var a="defaultView"in document&&"getComputedStyle"in document.defaultView?document.defaultView.getComputedStyle:window.getComputedStyle,b={addRemoveClassName:function(a,b,c){return c?this.addClassName(a,b):void this.removeClassName(a,b)},addClassName:function(a,c){if(a=Ink.i(a),!a||!c)return null;c=(""+c).split(/[, ]+/);for(var d=0,e=c.length;e>d;d++)c[d].replace(/^\s+|\s+$/g,"")&&("undefined"!=typeof a.classList?a.classList.add(c[d]):b.hasClassName(a,c[d])||(a.className+=(a.className?" ":"")+c[d]))},removeClassName:function(a,b){if(a=Ink.i(a),!a||!b)return null;b=(""+b).split(/[, ]+/);var c=0,d=b.length;if("undefined"!=typeof a.classList)for(;d>c;c++)a.classList.remove(b[c]);else{for(var e=a.className||"",f;d>c;c++)f=new RegExp("(^|\\s+)"+b[c]+"(\\s+|$)"),e=e.replace(f," ");a.className=e.replace(/^\s+/,"").replace(/\s+$/,"")}},setClassName:function(a,b,c){this.addRemoveClassName(a,b,c||!1)},hasClassName:function(a,b,c){if(a=Ink.i(a),!a||!b)return!1;b=(""+b).split(/[, ]+/);for(var d=0,e=b.length,f,g;e>d;d++){if("undefined"!=typeof a.classList)f=a.classList.contains(b[d]);else{var h=a.className;h===b[d]?f=!0:(g=new RegExp("(^|\\s)"+b[d]+"(\\s|$)"),f=g.test(h))}if(f&&!c)return!0;if(!f&&c)return!1}return c?!0:!1},blinkClass:function(a,c,d,e){a=Ink.i(a),b.addRemoveClassName(a,c,!e),setTimeout(function(){b.addRemoveClassName(a,c,e)},Number(d)||100)},toggleClassName:function(a,c,d){return a&&c&&"undefined"!=typeof a.classList&&!/[, ]/.test(c)?(a=Ink.i(a),null!==a&&a.classList.toggle(c),!0):void("undefined"!=typeof d?d===!0?b.addClassName(a,c):d===!1&&b.removeClassName(a,c):b.hasClassName(a,c)?b.removeClassName(a,c):b.addClassName(a,c))},setOpacity:function(a,b){if(a=Ink.i(a),null!==a){var c=1;isNaN(Number(b))||(c=0>=b?0:1>=b?b:100>=b?b/100:1),"undefined"!=typeof a.style.opacity?a.style.opacity=c:a.style.filter="alpha(opacity:"+(100*c|0)+")"}},_camelCase:function(a){return a?a.replace(/-(\w)/g,function(a,b){return b.toUpperCase()}):a},getStyle:function(b,c){if(b=Ink.i(b),null!==b&&b.style){c="float"===c?"cssFloat":this._camelCase(c);var d=b.style[c];if(!a||d&&"auto"!==d)!d&&b.currentStyle&&(d=b.currentStyle[c],"auto"!==d||"width"!==c&&"height"!==c||(d=b["offset"+c.charAt(0).toUpperCase()+c.slice(1)]+"px"));else{var e=a(b,null);d=e?e[c]:null}if("opacity"===c)return d?parseFloat(d,10):1;if("borderTopWidth"===c||"borderBottomWidth"===c||"borderRightWidth"===c||"borderLeftWidth"===c){if("thin"===d)return"1px";if("medium"===d)return"3px";if("thick"===d)return"5px"}return"auto"===d?null:d}},setStyle:function(a,b){if(a=Ink.i(a),null!==a)if("string"==typeof b)a.style.cssText+="; "+b,-1!==b.indexOf("opacity")&&this.setOpacity(a,b.match(/opacity:\s*(\d?\.?\d*)/)[1]);else for(var c in b)b.hasOwnProperty(c)&&("opacity"===c?this.setOpacity(a,b[c]):"float"===c||"cssFloat"===c?"undefined"==typeof a.style.styleFloat?a.style.cssFloat=b[c]:a.style.styleFloat=b[c]:a.style[c]=b[c])},show:function(a,b){a=Ink.i(a),null!==a&&(a.style.display=b?b:"")},hide:function(a){a=Ink.i(a),null!==a&&(a.style.display="none")},showHide:function(a,b){a=Ink.i(a),a&&(a.style.display=b?"":"none")},toggle:function(a,b){a=Ink.i(a),null!==a&&("undefined"!=typeof b?b===!0?this.show(a):this.hide(a):"none"===this.getStyle(a,"display").toLowerCase()?this.show(a):this.hide(a))},_getRefTag:function(a){if(a.firstElementChild)return a.firstElementChild;for(var b=a.firstChild;b;b=b.nextSibling)if(1===b.nodeType)return b;return null},appendStyleTag:function(a,b,c){c=Ink.extendObj({type:"text/css",force:!1},c||{});var d=document.getElementsByTagName("style"),e=!1,f=!0,g,h;for(g=0,h=d.length;h>g;g++)e=d[g].innerHTML,e.indexOf(a)>=0&&(f=!1);if(f){var i=document.createElement("style"),j=document.getElementsByTagName("head")[0],k=!1,l="";i.type=c.type,l+=a+" {",l+=b,l+="} ","undefined"!=typeof i.styleSheet?i.styleSheet.cssText=l:i.appendChild(document.createTextNode(l)),c.force?j.appendChild(i):(k=this._getRefTag(j),k&&j.insertBefore(i,k))}},appendStylesheet:function(a,b){b=Ink.extendObj({media:"screen",type:"text/css",force:!1},b||{});var c,d=document.createElement("link"),e=document.getElementsByTagName("head")[0];d.media=b.media,d.type=b.type,d.href=a,d.rel="Stylesheet",b.force?e.appendChild(d):(c=this._getRefTag(e),c&&e.insertBefore(d,c))},_loadingCSSFiles:{},_loadedCSSFiles:{},appendStylesheetCb:function(a,b){if(!a)return b(a);if(this._loadedCSSFiles[a])return b(a);var c=this._loadingCSSFiles[a];if(c)return c.push(b);this._loadingCSSFiles[a]=[b];var d=document.createElement("link");d.type="text/css",d.rel="stylesheet",d.href=a;var e=document.getElementsByTagName("head")[0];e.appendChild(d);var f=document.createElement("img");f.onerror=Ink.bindEvent(function(a,b){var c=b;this._loadedCSSFiles[c]=!0;for(var d=this._loadingCSSFiles[c],e=0,f=d.length;f>e;++e)d[e](c);delete this._loadingCSSFiles[c]},this,a),f.src=a},decToHex:function(a){var b=function(a){return 1===a.length&&(a="0"+a),a=a.toUpperCase()};if("object"==typeof a){var c=b(parseInt(a.r,10).toString(16)),d=b(parseInt(a.g,10).toString(16)),e=b(parseInt(a.b,10).toString(16));return c+d+e}a+="";var f=a.match(/\((\d+),\s?(\d+),\s?(\d+)\)/);return null!==f?b(parseInt(f[1],10).toString(16))+b(parseInt(f[2],10).toString(16))+b(parseInt(f[3],10).toString(16)):b(parseInt(a,10).toString(16))},hexToDec:function(a){return 0===a.indexOf("#")&&(a=a.substr(1)),6===a.length?{r:parseInt(a.substr(0,2),16),g:parseInt(a.substr(2,2),16),b:parseInt(a.substr(4,2),16)}:3===a.length?{r:parseInt(a.charAt(0)+a.charAt(0),16),g:parseInt(a.charAt(1)+a.charAt(1),16),b:parseInt(a.charAt(2)+a.charAt(2),16)}:a.length<=2?parseInt(a,16):void 0},getPropertyFromStylesheet:function(a,b){var c=this.getRuleFromStylesheet(a);return c?c.style[b]:null},getPropertyFromStylesheet2:function(a,b){for(var c=this.getRulesFromStylesheet(a),d,e=0,f=c.length;f>e;e++)if(d=c[e].style[b],null!==d&&void 0!==d)return d;return null},getRuleFromStylesheet:function(a){var b,c,d,e,f,g=document.styleSheets;if(!g)return null;for(var h=0,i=document.styleSheets.length;i>h;++h){if(b=document.styleSheets[h],c=b.rules?b.rules:b.cssRules,!c)return null;for(d=0,e=c.length;e>d;++d)if(f=c[d],f.selectorText&&f.selectorText===a)return f}return null},getRulesFromStylesheet:function(a){var b=[],c,d,e,f,g,h=document.styleSheets;if(!h)return b;for(var i=0,j=document.styleSheets.length;j>i;++i){if(c=document.styleSheets[i],d=c.rules?c.rules:c.cssRules,!d)return null;for(e=0,f=d.length;f>e;++e)g=d[e],g.selectorText&&g.selectorText===a&&b.push(g)}return b},getPropertiesFromRule:function(a){var b=this.getRuleFromStylesheet(a),c={},d,e,f;b=b.style.cssText;var g=b.split(";"),h,i,j,k;for(e=0,f=g.length;f>e;++e)" "===g[e].charAt(0)&&(g[e]=g[e].substring(1)),h=g[e].split(":"),d=this._camelCase(h[0].toLowerCase()),i=h[1],i&&(i=i.substring(1),"padding"===d||"margin"===d||"borderWidth"===d?("borderWidth"===d?(j="border",k="Width"):(j=d,k=""),-1!==i.indexOf(" ")?(i=i.split(" "),c[j+"Top"+k]=i[0],c[j+"Bottom"+k]=i[0],c[j+"Left"+k]=i[1],c[j+"Right"+k]=i[1]):(c[j+"Top"+k]=i,c[j+"Bottom"+k]=i,c[j+"Left"+k]=i,c[j+"Right"+k]=i)):"borderRadius"===d?-1!==i.indexOf(" ")?(i=i.split(" "),c.borderTopLeftRadius=i[0],c.borderBottomRightRadius=i[0],c.borderTopRightRadius=i[1],c.borderBottomLeftRadius=i[1]):(c.borderTopLeftRadius=i,c.borderTopRightRadius=i,c.borderBottomLeftRadius=i,c.borderBottomRightRadius=i):c[d]=i);return c},changeFontSize:function(a,b,c,d,e){var f=this;Ink.requireModules(["Ink.Dom.Selector_1"],function(g){var h;if("string"!=typeof a?h="1st argument must be a CSS selector rule.":"number"!=typeof b?h="2nd argument must be a number.":void 0!==c&&"+"!==c&&"*"!==c?h='3rd argument must be one of "+", "*".':void 0!==d&&("number"!=typeof d||0>=d)?h="4th argument must be a positive number.":void 0!==e&&("number"!=typeof e||e>e)&&(h="5th argument must be a positive number greater than minValue."),h)throw new TypeError(h);var i,j,k=g.select(a);void 0===d&&(d=1),c="*"===c?function(a,b){return a*b}:function(a,b){return a+b};for(var l=0,m=k.length;m>l;++l)j=k[l],i=parseFloat(f.getStyle(j,"fontSize")),i=c(i,b),d>i||"number"==typeof e&&i>e||(j.style.fontSize=i+"px")})}};return b}),Ink.createModule("Ink.Dom.Element",1,[],function(){"use strict";function a(a){var b={};try{b=a.getBoundingClientRect()}catch(c){b={top:a.offsetTop,left:a.offsetLeft}}return b}var b="function"==typeof document.createRange&&"function"==typeof window.Range.prototype.createContextualFragment,c="Ink.Dom.Element tbody: "+Math.random(),d=function(){var a=document.createElement("div");return a.innerHTML="",0!==a.getElementsByTagName("tbody").length}(),e={isDOMElement:function(a){return null!==a&&"object"==typeof a&&"nodeType"in a&&1===a.nodeType},get:function(a){return"undefined"!=typeof a?"string"==typeof a?document.getElementById(a):a:null},create:function(a,b){var c=document.createElement(a);for(var d in b)b.hasOwnProperty(d)&&(d in e?e[d](c,b[d]):"className"===d||"class"===d?c.className=b.className||b["class"]:c.setAttribute(d,b[d]));return c},remove:function(a){a=Ink.i(a);var b;a&&(b=a.parentNode)&&b.removeChild(a)},scrollTo:function(a){if(a=e.get(a)){if(a.scrollIntoView)return a.scrollIntoView();var b={},c=0,d=0;do c+=a.offsetTop||0,d+=a.offsetLeft||0,a=a.offsetParent;while(a);b={x:d,y:c},window.scrollTo(b.x,b.y)}},offsetTop:function(a){return e.offset(a)[1]},offsetLeft:function(a){return e.offset(a)[0]},positionedOffset:function(a){var b=0,c=0;a=e.get(a);do if(b+=a.offsetTop||0,c+=a.offsetLeft||0,a=a.offsetParent){if("body"===a.tagName.toLowerCase())break;var d=a.style.position;if(!d&&a.currentStyle&&(d=a.currentStyle.position),(!d||"auto"===d)&&"undefined"!=typeof getComputedStyle){var f=getComputedStyle(a,null);d=f?f.position:null}if("relative"===d||"absolute"===d)break}while(a);return[c,b]},offset:function(b){b=Ink.i(b);var c=[0,0],d=b.ownerDocument,e=d.documentElement,f=a(b),g=d.body,h=e.clientTop||g.clientTop||0,i=e.clientLeft||g.clientLeft||0,j=d.pageYOffset||e.scrollTop||g.scrollTop,k=d.pageXOffset||e.scrollLeft||g.scrollLeft,l=f.top+j-h,m=f.left+k-i;return c=[m,l]},scroll:function(a){return a=a?Ink.i(a):document.body,[window.pageXOffset?window.pageXOffset:a.scrollLeft,window.pageYOffset?window.pageYOffset:a.scrollTop]},_getPropPx:function(a,b){var c,d,e=a.getPropertyValue?a.getPropertyValue(b):a[b];return e?(d=e.indexOf("px"),c=-1===d?0:parseFloat(e,10)):c=0,c},offset2:function(a){return e.offset(a)},hasAttribute:function(a,b){return a=Ink.i(a),a.hasAttribute?a.hasAttribute(b):!!a.getAttribute(b)},insertAfter:function(a,b){(b=e.get(b))&&(null!==b.nextSibling?b.parentNode.insertBefore(a,b.nextSibling):b.parentNode.appendChild(a))},insertBefore:function(a,b){(b=e.get(b))&&b.parentNode.insertBefore(a,b)},insertTop:function(a,b){(b=e.get(b))&&(b.firstChild?b.insertBefore(a,b.firstChild):b.appendChild(a))},insertBottom:function(a,b){b=Ink.i(b),b.appendChild(a)},textContent:function(a){a=Ink.i(a);var b,c,d,f;switch(a&&a.nodeType){case 9:return e.textContent(a.documentElement||a.body&&a.body.parentNode||a.body);case 1:if(b=a.innerText,"undefined"!=typeof b)return b;case 11:if(b=a.textContent,"undefined"!=typeof b)return b;if(a.firstChild===a.lastChild)return e.textContent(a.firstChild);for(b=[],d=a.childNodes,c=0,f=d.length;f>c;++c)b.push(e.textContent(d[c]));return b.join("");case 3:case 4:return a.nodeValue}return""},setTextContent:function(a,b){switch(a=Ink.i(a),a&&a.nodeType){case 1:if("innerText"in a){a.innerText=b;break}case 11:if("textContent"in a){a.textContent=b;break}case 9:for(;a.firstChild;)a.removeChild(a.firstChild);if(""!==b){var c=a.ownerDocument||a;a.appendChild(c.createTextNode(b))}break;case 3:case 4:a.nodeValue=b}},isLink:function(a){var b=a&&1===a.nodeType&&(/^a|area$/i.test(a.tagName)||a.hasAttributeNS&&a.hasAttributeNS("http://www.w3.org/1999/xlink","href"));return!!b},isAncestorOf:function(a,b){if(!b||!a)return!1;if(b.compareDocumentPosition)return 0!==(16&a.compareDocumentPosition(b));for(;b=b.parentNode;)if(b===a)return!0;return!1},descendantOf:function(a,b){return a!==b&&e.isAncestorOf(a,b)},firstElementChild:function(a){if(!a)return null;if("firstElementChild"in a)return a.firstElementChild;for(var b=a.firstChild;b&&1!==b.nodeType;)b=b.nextSibling;return b},lastElementChild:function(a){if(!a)return null;if("lastElementChild"in a)return a.lastElementChild;for(var b=a.lastChild;b&&1!==b.nodeType;)b=b.previousSibling;return b},nextElementSibling:function(a){var b=null;if(!a)return b;if("nextElementSibling"in a)return a.nextElementSibling;for(b=a.nextSibling;b&&1!==b.nodeType;)b=b.nextSibling;return b},previousElementSibling:function(a){var b=null;if(!a)return b;if("previousElementSibling"in a)return a.previousElementSibling;for(b=a.previousSibling;b&&1!==b.nodeType;)b=b.previousSibling;return b},elementWidth:function(a){return"string"==typeof a&&(a=document.getElementById(a)),a.offsetWidth},elementHeight:function(a){return"string"==typeof a&&(a=document.getElementById(a)),a.offsetHeight},elementLeft:function(a){return e.offsetLeft(a)},elementTop:function(a){return e.offsetTop(a)},elementDimensions:function(a){return a=Ink.i(a),[a.offsetWidth,a.offsetHeight]},outerDimensions:function(b){var c=a(b),d=Ink.getModule("Ink.Dom.Css_1"),e=Ink.bindMethod(d,"getStyle",b);return[c.right-c.left+parseFloat(e("marginLeft")||0)+parseFloat(e("marginRight")||0),c.bottom-c.top+parseFloat(e("marginTop")||0)+parseFloat(e("marginBottom")||0)] +},inViewport:function(b,c){var d=a(Ink.i(b));return"boolean"==typeof c&&(c={partial:c,margin:0}),c=Ink.extendObj({partial:!1,margin:0},c||{}),c.partial?d.bottom+c.margin>0&&d.left-c.margin0:d.top+c.margin>0&&d.right-c.margin0},isHidden:function(a){var b=a.offsetWidth,c=a.offsetHeight,d="tr"===a.tagName.toLowerCase(),e=Ink.getModule("Ink.Dom.Css_1");return 0!==b||0!==c||d?0===b||0===c||d?"none"===e.getStyle(a,"display").toLowerCase():!1:!0},isVisible:function(a){return!this.isHidden(a)},clonePosition:function(a,b){var c=e.offset(b);return a.style.left=c[0]+"px",a.style.top=c[1]+"px",a},ellipsizeText:function(a){(a=Ink.i(a))&&(a.style.overflow="hidden",a.style.whiteSpace="nowrap",a.style.textOverflow="ellipsis")},findUpwardsHaving:function(a,b){for(;a&&1===a.nodeType;){if(b(a))return a;a=a.parentNode}return!1},findUpwardsByClass:function(a,b){var c=new RegExp("(^|\\s)"+b+"(\\s|$)"),d=function(a){var b=a.className;return b&&c.test(b)};return e.findUpwardsHaving(a,d)},findUpwardsByTag:function(a,b){b=b.toUpperCase();var c=function(a){return a.nodeName&&a.nodeName.toUpperCase()===b};return e.findUpwardsHaving(a,c)},findUpwardsById:function(a,b){var c=function(a){return a.id===b};return e.findUpwardsHaving(a,c)},findUpwardsBySelector:function(a,b){var c=Ink.getModule("Ink.Dom.Selector","1");if(!c)throw new Error("This method requires Ink.Dom.Selector");var d=function(a){return c.matchesSelector(a,b)};return e.findUpwardsHaving(a,d)},getChildrenText:function(a,b){var c,d,f,g=a.childNodes,h=g.length,i="";if(!a)return i;for(d=0;h>d;++d)c=g[d],c&&3===c.nodeType&&(f=e._trimString(String(c.data)),f.length>0?(i+=f,b&&a.removeChild(c)):a.removeChild(c));return i},_trimString:function(a){return String.prototype.trim?a.trim():a.replace(/^\s*/,"").replace(/\s*$/,"")},getSelectValues:function(a){for(var b=Ink.i(a),c=[],d=0;dd;++d)b=a[d],b instanceof Array?1===b.length&&b.push(b[0]):b=[b,b],c.push(b);return c},fillSelect:function(a,b,c,d){var f=Ink.i(a);if(f){f.innerHTML="";var g,h;c||(h=document.createElement("option"),h.setAttribute("value",""),f.appendChild(h)),b=e._normalizeData(b);for(var i=0,j=b.length;j>i;++i)g=b[i],h=document.createElement("option"),h.setAttribute("value",g[0]),g.length>2&&h.setAttribute("extra",g[2]),h.appendChild(document.createTextNode(g[1])),g[0]===d&&h.setAttribute("selected","selected"),f.appendChild(h)}},fillRadios:function(a,b,c,d,f,g){a=Ink.i(a);var h=document.createElement("span");e.insertAfter(h,a),c=e._normalizeData(c);var i,j;d||(j=document.createElement("input"),j.setAttribute("type","radio"),j.setAttribute("name",b),j.setAttribute("value",""),h.appendChild(j),g&&h.appendChild(document.createElement(g)));for(var k=0;ke;++e)if(c=a.childNodes[e],1===c.nodeType){if(c===b)return d;++d}return-1},nextSiblings:function(a){if(a=Ink.i(a),"object"==typeof a&&null!==a&&a.nodeType&&1===a.nodeType){for(var b=[],c=a.parentNode.children,d=e.parentIndexOf(a.parentNode,a),f=++d,g=c.length;g>f;f++)b.push(c[f]);return b}return[]},previousSiblings:function(a){if(a=Ink.i(a),"object"==typeof a&&null!==a&&a.nodeType&&1===a.nodeType){for(var b=[],c=a.parentNode.children,d=e.parentIndexOf(a.parentNode,a),f=0,g=d;g>f;f++)b.push(c[f]);return b}return[]},siblings:function(a){if(a=Ink.i(a),"object"==typeof a&&null!==a&&a.nodeType&&1===a.nodeType){for(var b=[],c=a.parentNode.children,d=0,e=c.length;e>d;d++)a!==c[d]&&b.push(c[d]);return b}return[]},childElementCount:function(a){return a=Ink.i(a),"childElementCount"in a?a.childElementCount:a?e.siblings(a).length+1:0},_wrapElements:{TABLE:function(a,b){return a.innerHTML=d?"
    "+b+"
    "+c+"
    ":""+b+"
    ",a.firstChild},TBODY:function(a,b){return a.innerHTML=""+b+"
    ",a.firstChild.getElementsByTagName("tbody")[0]},THEAD:function(a,b){return a.innerHTML=""+b+"
    ",a.firstChild.getElementsByTagName("thead")[0]},TFOOT:function(a,b){return a.innerHTML=""+b+"
    ",a.firstChild.getElementsByTagName("tfoot")[0]},TR:function(a,b){return a.innerHTML=""+b+"
    ",a.firstChild.firstChild.firstChild}},_getWrapper:function(a,b){var f=a.nodeName&&a.nodeName.toUpperCase(),g=document.createElement("div"),h=e._wrapElements[f];if(!h)return g.innerHTML=b,g;if(g=h(g,b),d&&"TABLE"===f)for(var i=g.getElementsByTagName("td"),j=0,k=i.length;k>j;j++)if(i[j].innerHTML===c){var l=i[j].parentNode.parentNode;l.parentNode.removeChild(l)}return g},appendHTML:function(a,b){if(a=Ink.i(a),null!==a)for(var c=e._getWrapper(a,b);c.firstChild;)a.appendChild(c.firstChild)},prependHTML:function(a,b){if(a=Ink.i(a),null!==a)for(var c=e._getWrapper(a,b);c.lastChild;)a.insertBefore(c.lastChild,a.firstChild)},setHTML:function(a,b){if(a=Ink.i(a),null!==a)try{a.innerHTML=b}catch(c){for(;a.firstChild;)a.removeChild(a.firstChild);e.appendHTML(a,b)}},wrap:function(a,b){a=Ink.i(a),b=Ink.i(b);var c=a.nextSibling,d=a.parentNode;return b.appendChild(a),null!==c?d.insertBefore(b,c):d.appendChild(b),b},unwrap:function(a,b){a=Ink.i(a);var c;c="string"==typeof b?e.findUpwardsBySelector(a,b):"object"==typeof b&&b.tagName?e.findUpwardsHaving(a,function(a){return a===b}):a.parentNode,c&&c.parentNode&&e.insertBefore(a,c)},replace:function(a,b){a=Ink.i(a),null!==a&&a.parentNode.replaceChild(b,a)},removeTextNodeChildren:function(a){if(a=Ink.i(a),null!==a){var b,c,d=a;for(a=a.firstChild;a;)c=3===a.nodeType,b=a,a=a.nextSibling,c&&d.removeChild(b)}},htmlToFragment:b?function(a){var b;return"string"!=typeof a?document.createDocumentFragment():(b=document.createRange(),b.selectNode(document.body),b.createContextualFragment(a))}:function(a){var b=document.createDocumentFragment(),c,d;if("string"!=typeof a)return b;for(c=document.createElement("div"),c.innerHTML=a;d=c.firstChild;)b.appendChild(d);return b},_camelCase:function(a){return a?a.replace(/-(\w)/g,function(a,b){return b.toUpperCase()}):a},data:function(a){var b;if("object"!=typeof a&&"string"!=typeof a)throw"[Ink.Dom.Element.data] :: Invalid selector defined";if("object"==typeof a)b=a;else{var c=Ink.getModule("Ink.Dom.Selector",1);if(!c)throw"[Ink.Dom.Element.data] :: this method requires Ink.Dom.Selector - v1";if(b=c.select(a),b.length<=0)throw"[Ink.Dom.Element.data] :: Can't find any element with the specified selector";b=b[0]}var d={},f=b.attributes||[],g,h,i;if(f)for(var j=0,k=f.length;k>j;++j)g=f[j],h=g.name,i=g.value,h&&0===h.indexOf("data-")&&(d[e._camelCase(h.replace("data-",""))]=i);return d},moveCursorTo:function(a,b){if(a=Ink.i(a),null!==a)if(a.setSelectionRange)a.setSelectionRange(b,b);else{var c=a.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",b),c.select()}},pageWidth:function(){var a;a=window.innerWidth&&window.scrollMaxX?window.innerWidth+window.scrollMaxX:document.body.scrollWidth>document.body.offsetWidth?document.body.scrollWidth:document.body.offsetWidth;var b;return window.self.innerWidth?b=document.documentElement.clientWidth?document.documentElement.clientWidth:window.self.innerWidth:document.documentElement&&document.documentElement.clientWidth?b=document.documentElement.clientWidth:document.body&&(b=document.body.clientWidth),b>a?a:b},pageHeight:function(){var a;a=window.innerHeight&&window.scrollMaxY?window.innerHeight+window.scrollMaxY:document.body.scrollHeight>document.body.offsetHeight?document.body.scrollHeight:document.body.offsetHeight;var b;return window.self.innerHeight?b=window.self.innerHeight:document.documentElement&&document.documentElement.clientHeight?b=document.documentElement.clientHeight:document.body&&(b=document.body.clientHeight),b>a?b:a},viewportWidth:function(){return"undefined"!=typeof window.innerWidth?window.innerWidth:document.documentElement&&"undefined"!=typeof document.documentElement.offsetWidth?document.documentElement.offsetWidth:void 0},viewportHeight:function(){return"undefined"!=typeof window.innerHeight?window.innerHeight:document.documentElement&&"undefined"!=typeof document.documentElement.offsetHeight?document.documentElement.offsetHeight:void 0},scrollWidth:function(){return"undefined"!=typeof window.self.pageXOffset?window.self.pageXOffset:"undefined"!=typeof document.documentElement&&"undefined"!=typeof document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft},scrollHeight:function(){return"undefined"!=typeof window.self.pageYOffset?window.self.pageYOffset:"undefined"!=typeof document.documentElement&&"undefined"!=typeof document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop}};return e}),Ink.createModule("Ink.Dom.Event",1,[],function(){var a=function(a,b,c){return c()}("bean",this,function(a,b){a=a||"bean",b=b||this;var c=window,d=b[a],e=/[^\.]*(?=\..*)\.|.*/,f=/\..*/,g="addEventListener",h="removeEventListener",i=document||{},j=i.documentElement||{},k=j[g],l=k?g:"attachEvent",m={},n=Array.prototype.slice,o=function(a,b){return a.split(b||" ")},p=function(a){return"string"==typeof a},q=function(a){return"function"==typeof a},r="click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll ",s="show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinputreadystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ",t=function(a,b,c){for(c=0;cg;g++)if(m[g].reg.test(e)){n[e]=k=m[g].fix;break}for(j=k(a,this,e),g=j.length;g--;)!((i=j[g])in this)&&i in a&&(this[i]=a[i])}}};return p.prototype.preventDefault=function(){this.originalEvent.preventDefault?this.originalEvent.preventDefault():this.originalEvent.returnValue=!1},p.prototype.stopPropagation=function(){this.originalEvent.stopPropagation?this.originalEvent.stopPropagation():this.originalEvent.cancelBubble=!0},p.prototype.stop=function(){this.preventDefault(),this.stopPropagation(),this.stopped=!0},p.prototype.stopImmediatePropagation=function(){this.originalEvent.stopImmediatePropagation&&this.originalEvent.stopImmediatePropagation(),this.isImmediatePropagationStopped=function(){return!0}},p.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()},p.prototype.clone=function(a){var b=new p(this,this.element,this.isNative);return b.currentTarget=a,b},p}(),w=function(a,b){return k||b||a!==i&&a!==c?a:j},x=function(){var a=function(a,b,c,d){var e=function(c,e){return b.apply(a,d?n.call(e,c?0:1).concat(d):e)},f=function(c,d){return b.__beanDel?b.__beanDel.ft(c.target,a):d},g=c?function(a){var b=f(a,this);return c.apply(b,arguments)?(a&&(a.currentTarget=b),e(a,arguments)):void 0}:function(a){return b.__beanDel&&(a=a.clone(f(a))),e(a,arguments)};return g.__beanDel=b.__beanDel,g},b=function(b,c,d,e,f,g,h){var i=u[c],j;"unload"==c&&(d=D(E,b,c,d,e)),i&&(i.condition&&(d=a(b,d,i.condition,g)),c=i.base||c),this.isNative=j=t[c]&&!!b[l],this.customType=!k&&!j&&c,this.element=b,this.type=c,this.original=e,this.namespaces=f,this.eventType=k||j?c:"propertychange",this.target=w(b,j),this[l]=!!this.target[l],this.root=h,this.handler=a(b,d,null,g)};return b.prototype.inNamespaces=function(a){var b,c,d=0;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)a[b]==this.namespaces[c]&&d++;return a.length===d},b.prototype.matches=function(a,b,c){return!(this.element!==a||b&&this.original!==b||c&&this.handler!==c)},b}(),y=function(){var a={},b=function(c,d,e,f,g,h){var i=g?"r":"$";if(d&&"*"!=d){var j=0,k,l=a[i+d],m="*"==c;if(!l)return;for(k=l.length;k>j;j++)if((m||l[j].matches(c,e,f))&&!h(l[j],l,j,d))return}else for(var n in a)n.charAt(0)==i&&b(c,n.substr(1),e,f,g,h)},c=function(b,c,d,e){var f,g=a[(e?"r":"$")+c];if(g)for(f=g.length;f--;)if(!g[f].root&&g[f].matches(b,d,null))return!0;return!1},d=function(a,c,d,e){var f=[];return b(a,c,d,null,e,function(a){return f.push(a)}),f},e=function(b){var c=!b.root&&!this.has(b.element,b.type,null,!1),d=(b.root?"r":"$")+b.type;return(a[d]||(a[d]=[])).push(b),c},f=function(c){b(c.element,c.type,null,c.handler,c.root,function(b,c,d){return c.splice(d,1),b.removed=!0,0===c.length&&delete a[(b.root?"r":"$")+b.type],!1})},g=function(){var b,c=[];for(b in a)"$"==b.charAt(0)&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),z,A=function(a){z=arguments.length?a:i.querySelectorAll?function(a,b){return b.querySelectorAll(a)}:function(){throw new Error("Bean: No selector engine installed")}},B=function(a,b){if(k||!b||!a||a.propertyName=="_on"+b){var c=y.get(this,b||a.type,null,!1),d=c.length,e=0;for(a=new v(a,this,!0),b&&(a.type=b);d>e&&!a.isImmediatePropagationStopped();e++)c[e].removed||c[e].handler.call(this,a)}},C=k?function(a,b,c){a[c?g:h](b,B,!1)}:function(a,b,c,d){var e;c?(y.put(e=new x(a,d||b,function(b){B.call(a,b,d)},B,null,null,!0)),d&&null==a["_on"+d]&&(a["_on"+d]=0),e.target.attachEvent("on"+e.eventType,e.handler)):(e=y.get(a,d||b,B,!0)[0],e&&(e.target.detachEvent("on"+e.eventType,e.handler),y.del(e)))},D=function(a,b,c,d,e){return function(){d.apply(this,arguments),a(b,c,e)}},E=function(a,b,c,d){var e=b&&b.replace(f,""),g=y.get(a,e,null,!1),h={},i,j;for(i=0,j=g.length;j>i;i++)c&&g[i].original!==c||!g[i].inNamespaces(d)||(y.del(g[i]),!h[g[i].eventType]&&g[i][l]&&(h[g[i].eventType]={t:g[i].eventType,c:g[i].type}));for(i in h)y.has(a,h[i].t,null,!1)||C(a,h[i].t,!1,h[i].c)},F=function(a,b){var c=function(b,c){for(var d,e=p(a)?z(a,c):a;b&&b!==c;b=b.parentNode)for(d=e.length;d--;)if(e[d]===b)return b},d=function(a){var d=c(a.target,this);d&&b.apply(d,arguments)};return d.__beanDel={ft:c,selector:a},d},G=k?function(a,b,d){var e=i.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=w(c,a),a?c.fireEvent("on"+b,i.createEventObject()):c["_on"+b]++},H=function(a,b,c){var d=p(b),g,h,i,j;if(d&&b.indexOf(" ")>0){for(b=o(b),j=b.length;j--;)H(a,b[j],c);return a}if(h=d&&b.replace(f,""),h&&u[h]&&(h=u[h].base),!b||d)(i=d&&b.replace(e,""))&&(i=o(i,".")),E(a,h,c,i);else if(q(b))E(a,null,b);else for(g in b)b.hasOwnProperty(g)&&H(a,g,b[g]);return a},I=function(a,b,c,d){var g,h,i,j,k,p,r;{if(void 0!==c||"object"!=typeof b){for(q(c)?(k=n.call(arguments,3),d=g=c):(g=d,k=n.call(arguments,4),d=F(c,g,z)),i=o(b),this===m&&(d=D(H,a,b,d,g)),j=i.length;j--;)r=y.put(p=new x(a,i[j].replace(f,""),d,g,o(i[j].replace(e,""),"."),k,!1)),p[l]&&r&&C(a,p.eventType,!0,p.customType);return a}for(h in b)b.hasOwnProperty(h)&&I.call(this,a,h,b[h])}},J=function(a,b,c,d){return I.apply(null,p(c)?[a,c,b,d].concat(arguments.length>3?n.call(arguments,5):[]):n.call(arguments))},K=function(){return I.apply(m,arguments)},L=function(a,b,c){var d=o(b),g,h,i,j,k;for(g=d.length;g--;)if(b=d[g].replace(f,""),(j=d[g].replace(e,""))&&(j=o(j,".")),j||c||!a[l])for(k=y.get(a,b,null,!1),c=[!1].concat(c),h=0,i=k.length;i>h;h++)k[h].inNamespaces(j)&&k[h].handler.apply(a,c);else G(t[b],b,a);return a},M=function(a,b,c){for(var d=y.get(b,c,null,!1),e=d.length,f=0,g,h;e>f;f++)d[f].original&&(g=[a,d[f].type],(h=d[f].handler.__beanDel)&&g.push(h.selector),g.push(d[f].original),I.apply(null,g));return a},N={on:I,add:J,one:K,off:H,remove:H,clone:M,fire:L,Event:v,setSelectorEngine:A,noConflict:function(){return b[a]=d,this}};if(c.attachEvent){var O=function(){var a,b=y.entries();for(a in b)b[a].type&&"unload"!==b[a].type&&H(b[a].element,b[a].type);c.detachEvent("onunload",O),c.CollectGarbage&&c.CollectGarbage()};c.attachEvent("onunload",O)}return A(Ink.ss),N}),b={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_SPACE:32,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,throttle:function(a,b){b=b||0;var c=0,d,e=function(){var f=+new Date,g=f-c;if(g>=b)return c=f,a.apply(this,[].slice.call(arguments));var h=this,i=[].slice.call(arguments);d||(d=setTimeout(function(){return d=null,e.apply(h,i)},b-g))};return e},element:function(a){var b=a.delegationTarget||a.target||"mouseout"===a.type&&a.fromElement||"mouseleave"===a.type&&a.fromElement||"mouseover"===a.type&&a.toElement||"mouseenter"===a.type&&a.toElement||a.srcElement||null;return!b||3!==b.nodeType&&4!==b.nodeType?b:b.parentNode},relatedTarget:function(a){var b=a.relatedTarget||"mouseout"===a.type&&a.toElement||"mouseleave"===a.type&&a.toElement||"mouseover"===a.type&&a.fromElement||"mouseenter"===a.type&&a.fromElement||null;return!b||3!==b.nodeType&&4!==b.nodeType?b:b.parentNode},findElement:function(a,b,c){for(var d=this.element(a);;){if(d.nodeName.toLowerCase()===b.toLowerCase())return d;if(d=d.parentNode,!d)return c?!1:document;if(!d.parentNode)return c?!1:document}},observe:function(a,b,c,d){return a=Ink.i(a),a?(a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent("on"+b,c=Ink.bind(c,a)),c):void 0},observeOnce:function(a,c,d,e){var f=function(){return b.stopObserving(a,c,f),d()};return b.observe(a,c,f,e)},observeMulti:function(a,b,c,d){if("string"==typeof a?a=Ink.ss(a):a&&1===a.nodeType&&(a=[a]),!a[0])return!1;for(var e=0,f=a.length;f>e;e++)this.observe(a[e],b,c,d);return c},observeDelegated:function(a,c,d,e){return b.observe(a,c,function(c){var f=b.element(c);if(f&&f!==a)for(var g=f;g!==a&&g!==document&&g;){if(Ink.Dom.Selector_1.matchesSelector(g,d))return c.delegationTarget=g,e(c);g=g.parentNode}})},stopObserving:function(a,b,c,d){a=Ink.i(a),a&&(a.removeEventListener?a.removeEventListener(b,c,!!d):a.detachEvent("on"+b,c))},stop:function(a){null!==a.cancelBubble&&(a.cancelBubble=!0),a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),window.attachEvent&&(a.returnValue=!1),null!==a.cancel&&(a.cancel=!0)},stopPropagation:function(a){null!==a.cancelBubble&&(a.cancelBubble=!0),a.stopPropagation&&a.stopPropagation()},stopDefault:function(a){a.preventDefault&&a.preventDefault(),window.attachEvent&&(a.returnValue=!1),null!==a.cancel&&(a.cancel=!0)},pointer:function(a){return{x:this.pointerX(a),y:this.pointerY(a)}},pointerX:function(a){return a.touches&&a.touches[0]&&a.touches[0].clientX||a.pageX||a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)},pointerY:function(a){return a.touches&&a.touches[0]&&a.touches[0].clientY||a.pageY||a.clientY+(document.documentElement.scrollTop||document.body.scrollTop)},isLeftClick:function(a){if(window.addEventListener){if(0===a.button)return!0;if("touchend"===a.type&&null===a.button)return!0}else if(1===a.button)return!0;return!1},isRightClick:function(a){return 2===a.button},isMiddleClick:function(a){return window.addEventListener?1===a.button:4===a.button;return!1},getCharFromKeyboardEvent:function(a,b){var c=a.keyCode,d=String.fromCharCode(c),e=a.shiftKey;if(c>=65&&90>=c)return"boolean"==typeof b&&(e=b),e?d:d.toLowerCase();if(c>=96&&105>=c)return String.fromCharCode(48+(c-96));switch(c){case 109:case 189:return"-";case 107:case 187:return"+"}return d},debug:function(){}};return Ink.extendObj(b,a)}),Ink.createModule("Ink.Dom.FormSerialize",1,["Ink.Util.Array_1","Ink.Dom.Element_1","Ink.Dom.Selector_1"],function(a,b,c){"use strict";function d(c){return null!=c&&!b.isDOMElement(c)&&(a.isArray(c)||"string"!=typeof c&&"number"==typeof c.length)}function e(a){return d(a)?a:[a]}var f={serialize:function(b){var c={},d={},e=this.asPairs(b,{elements:!0,emptyArray:d});return null==e?e:(a.forEach(e,function(a){var b=a[0].replace(/\[\]$/,""),e=a[1],g=a[2];e===d?c[b]=[]:f._resultsInArray(g)||/\[\]$/.test(a[0])?(c[b]=c[b]||[],c[b].push(e)):c[b]=e}),c)},asPairs:function(b,d){function e(a,b,c){h.push(d.elements?[a,b,c]:[a,b])}function g(b){if("select"===b.nodeName.toLowerCase()&&b.multiple){var f=!1;a.forEach(c.select("option:checked",b),function(a){e(b.name,a.value,b),f=!0}),!f&&"emptyArray"in d&&e(b.name,d.emptyArray,b)}else e(b.name,b.value,b)}var h=[];if(d=d||{},b=Ink.i(b)){for(var i=a.filter(b.elements,f._isSerialized),j=0,k=i.length;k>j;j++)g(i[j]);return h}return null},fillIn:function(a,b){if(!(a=Ink.i(a)))return null;var c;if("object"!=typeof b||d(b)){if(!d(b))return null;c=b}else c=f._objToPairs(b);return f._fillInPairs(a,c)},_objToPairs:function(a){var b=[],c;for(var d in a)if(a.hasOwnProperty(d)){c=e(a[d]);for(var f=0,g=c.length;g>f;f++)b.push([d,c[f]]);0===g&&b.push([d,[]])}return b},_fillInPairs:function(b,c){c=a.groupBy(c,{key:function(a){return a[0].replace(/\[\]$/,"")}}),c=a.map(c,function(b){var c=a.reduce(b,function(a,b){return[null,a[1].concat([b[1]])]},[null,[]])[1];return[b[0][0],c]});for(var d,g,h,i=0,j=c.length;j>i;i++){if(d=c[i][0],d in b)g=b[d];else{if(!(d+"[]"in b))continue;g=b[d+"[]"],d+="[]"}g=e(g),h=c[i][1],f._fillInOne(d,g,h)}},_fillInOne:function(a,c,d){var e=c[0],g=e.nodeName.toLowerCase(),h=e.getAttribute("type");h=h&&h.toLowerCase();var i="select"===g&&b.hasAttribute(e,"multiple");if("checkbox"===h||"radio"===h)f._fillInBoolean(c,d,"checked");else if(i)f._fillInBoolean(c[0].options,d,"selected");else{c.length!==d.length&&Ink.warn("Form had "+c.length+' inputs named "'+a+'", but received '+d.length+" values.");for(var j=0,k=Math.min(c.length,d.length);k>j;j+=1)c[j].value=d[j]}},_fillInBoolean:function(b,c,d){a.forEach(b,function(b){var e=a.inArray(b.value,c);b[d]=e})},_resultsInArray:function(a){var c=a.getAttribute("type"),d=a.nodeName.toLowerCase();return"checkbox"===c||"select"===d&&b.hasAttribute(a,"multiple")},_isSerialized:function(a){if(!b.isDOMElement(a))return!1;if(!b.hasAttribute(a,"name"))return!1;var c=a.nodeName.toLowerCase();return c&&"fieldset"!==c?"checkbox"===a.type||"radio"===a.type?!!a.checked:!0:!1}};return f}),Ink.createModule("Ink.Dom.Loaded",1,[],function(){"use strict";var a={_contexts:[],run:function(a,b){b||(b=a,a=window);for(var c,d=0,e=this._contexts.length;e>d;d++)if(this._contexts[d][0]===a){c=this._contexts[d][1];break}c||(c={cbQueue:[],win:a,doc:a.document,root:a.document.documentElement,done:!1,top:!0},c.handlers={checkState:Ink.bindEvent(this._checkState,this,c),poll:Ink.bind(this._poll,this,c)},this._contexts.push([a,c]));var f=c.doc.addEventListener;c.add=f?"addEventListener":"attachEvent",c.rem=f?"removeEventListener":"detachEvent",c.pre=f?"":"on",c.det=f?"DOMContentLoaded":"onreadystatechange",c.wet=c.pre+"load";var g=c.handlers.checkState,h=/complete|interactive|loaded/.test(c.doc.readyState)&&"about:blank"!==c.win.location.toString();if(h)setTimeout(Ink.bind(function(){b.call(c.win,"lazy")},this),0);else{c.cbQueue.push(b),c.doc[c.add](c.det,g),c.win[c.add](c.wet,g);var i=1;try{i=c.win.frameElement}catch(j){}if(!f&&c.root&&c.root.doScroll){try{c.top=!i}catch(j){}c.top&&this._poll(c)}}},_checkState:function(a,b){if(a&&("readystatechange"!==a.type||"complete"===b.doc.readyState)){var c="load"===a.type?b.win:b.doc;c[b.rem](b.pre+a.type,b.handlers.checkState,!1),this._ready(b)}},_poll:function(a){try{a.root.doScroll("left")}catch(b){return setTimeout(a.handlers.poll,50)}this._ready(a)},_ready:function(a){if(!a.done){a.done=!0;for(var b=0;bw.cacheLength&&delete a[b.shift()],a[c]=d}}function c(a){return a[L]=!0,a}function d(a){var b=E.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b=null}}function e(a,b,c,d){var e,f,g,h,i,l,m,n,o,p;if((b?b.ownerDocument||b:M)!==E&&D(b),b=b||E,c=c||[],!a||"string"!=typeof a)return c;if(1!==(h=b.nodeType)&&9!==h)return[];if(G&&!d){if(e=pb.exec(a))if(g=e[1]){if(9===h){if(f=b.getElementById(g),!f||!f.parentNode)return c;if(f.id===g)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(g))&&K(b,f)&&f.id===g)return c.push(f),c}else{if(e[2])return $.apply(c,b.getElementsByTagName(a)),c;if((g=e[3])&&N.getElementsByClassName&&b.getElementsByClassName)return $.apply(c,b.getElementsByClassName(g)),c}if(N.qsa&&!H.test(a)){if(m=!0,n=L,o=b,p=9===h&&a,1===h&&"object"!==b.nodeName.toLowerCase()){for(l=j(a),(m=b.getAttribute("id"))?n=m.replace(sb,"\\$&"):b.setAttribute("id",n),n="[id='"+n+"'] ",i=l.length;i--;)l[i]=n+k(l[i]);o=nb.test(a)&&b.parentNode||b,p=l.join(",")}if(p)try{return $.apply(c,o.querySelectorAll(p)),c}catch(q){}finally{m||b.removeAttribute("id")}}}return s(a.replace(hb,"$1"),b,c,d)}function f(a,b){var c=b&&a,d=c&&(~b.sourceIndex||W)-(~a.sourceIndex||W);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function g(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function h(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function i(a){return c(function(b){return b=+b,c(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function j(a,b){var c,d,f,g,h,i,j,k=R[a+" "];if(k)return b?0:k.slice(0);for(h=a,i=[],j=w.preFilter;h;){(!c||(d=ib.exec(h)))&&(d&&(h=h.slice(d[0].length)||h),i.push(f=[])),c=!1,(d=jb.exec(h))&&(c=d.shift(),f.push({value:c,type:d[0].replace(hb," ")}),h=h.slice(c.length));for(g in w.filter)!(d=mb[g].exec(h))||j[g]&&!(d=j[g](d))||(c=d.shift(),f.push({value:c,type:g,matches:d}),h=h.slice(c.length));if(!c)break}return b?h.length:h?e.error(a):R(a,i).slice(0)}function k(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function l(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=P++;return b.first?function(b,c,f){for(;b=b[d];)if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=O+" "+f;if(g){for(;b=b[d];)if((1===b.nodeType||e)&&a(b,c,g))return!0}else for(;b=b[d];)if(1===b.nodeType||e)if(j=b[L]||(b[L]={}),(i=j[d])&&i[0]===k){if((h=i[1])===!0||h===v)return h===!0}else if(i=j[d]=[k],i[1]=a(b,c,g)||v,i[1]===!0)return!0}}function m(a){return a.length>1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function n(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function o(a,b,d,e,f,g){return e&&!e[L]&&(e=o(e)),f&&!f[L]&&(f=o(f,g)),c(function(c,g,h,i){var j,k,l,m=[],o=[],p=g.length,q=c||r(b||"*",h.nodeType?[h]:h,[]),s=!a||!c&&b?q:n(q,m,a,h,i),t=d?f||(c?a:p||e)?[]:g:s;if(d&&d(s,t,h,i),e)for(j=n(t,o),e(j,[],h,i),k=j.length;k--;)(l=j[k])&&(t[o[k]]=!(s[o[k]]=l));if(c){if(f||a){if(f){for(j=[],k=t.length;k--;)(l=t[k])&&j.push(s[k]=l);f(null,t=[],j,i)}for(k=t.length;k--;)(l=t[k])&&(j=f?ab.call(c,l):m[k])>-1&&(c[j]=!(g[j]=l))}}else t=n(t===g?t.splice(p,t.length):t),f?f(null,g,t,i):$.apply(g,t)})}function p(a){for(var b,c,d,e=a.length,f=w.relative[a[0].type],g=f||w.relative[" "],h=f?1:0,i=l(function(a){return a===b},g,!0),j=l(function(a){return ab.call(b,a)>-1},g,!0),n=[function(a,c,d){return!f&&(d||c!==A)||((b=c).nodeType?i(a,c,d):j(a,c,d))}];e>h;h++)if(c=w.relative[a[h].type])n=[l(m(n),c)];else{if(c=w.filter[a[h].type].apply(null,a[h].matches),c[L]){for(d=++h;e>d&&!w.relative[a[d].type];d++);return o(h>1&&m(n),h>1&&k(a.slice(0,h-1)).replace(hb,"$1"),c,d>h&&p(a.slice(h,d)),e>d&&p(a=a.slice(d)),e>d&&k(a))}n.push(c)}return m(n)}function q(a,b){var d=0,f=b.length>0,g=a.length>0,h=function(c,h,i,j,k){var l,m,o,p=[],q=0,r="0",s=c&&[],t=null!=k,u=A,x=c||g&&w.find.TAG("*",k&&h.parentNode||h),y=O+=null==u?1:Math.random()||.1;for(t&&(A=h!==E&&h,v=d);null!=(l=x[r]);r++){if(g&&l){for(m=0;o=a[m++];)if(o(l,h,i)){j.push(l);break}t&&(O=y,v=++d)}f&&((l=!o&&l)&&q--,c&&s.push(l))}if(q+=r,f&&r!==q){for(m=0;o=b[m++];)o(s,p,h,i);if(c){if(q>0)for(;r--;)s[r]||p[r]||(p[r]=Y.call(j));p=n(p)}$.apply(j,p),t&&!c&&p.length>0&&q+b.length>1&&e.uniqueSort(j)}return t&&(O=y,A=u),s};return f?c(h):h}function r(a,b,c){for(var d=0,f=b.length;f>d;d++)e(a,b[d],c);return c}function s(a,b,c,d){var e,f,g,h,i,l=j(a);if(!d&&1===l.length){if(f=l[0]=l[0].slice(0),f.length>2&&"ID"===(g=f[0]).type&&9===b.nodeType&&G&&w.relative[f[1].type]){if(b=(w.find.ID(g.matches[0].replace(ub,vb),b)||[])[0],!b)return c;a=a.slice(f.shift().value.length)}for(e=mb.needsContext.test(a)?0:f.length;e--&&(g=f[e],!w.relative[h=g.type]);)if((i=w.find[h])&&(d=i(g.matches[0].replace(ub,vb),nb.test(f[0].type)&&b.parentNode||b))){if(f.splice(e,1),a=d.length&&k(f),!a)return $.apply(c,d),c; +break}}return z(a,l)(d,b,!G,c,nb.test(a)),c}function t(){}var u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L="sizzle"+-new Date,M=window.document,N={},O=0,P=0,Q=b(),R=b(),S=b(),T=!1,U=function(){return 0},V="undefined",W=1<<31,X=[],Y=X.pop,Z=X.push,$=X.push,_=X.slice,ab=X.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},bb="[\\x20\\t\\r\\n\\f]",cb="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",db=cb.replace("w","w#"),eb="([*^$|!~]?=)",fb="\\["+bb+"*("+cb+")"+bb+"*(?:"+eb+bb+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+db+")|)|)"+bb+"*\\]",gb=":("+cb+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+fb.replace(3,8)+")*)|.*)\\)|)",hb=new RegExp("^"+bb+"+|((?:^|[^\\\\])(?:\\\\.)*)"+bb+"+$","g"),ib=new RegExp("^"+bb+"*,"+bb+"*"),jb=new RegExp("^"+bb+"*([\\x20\\t\\r\\n\\f>+~])"+bb+"*"),kb=new RegExp(gb),lb=new RegExp("^"+db+"$"),mb={ID:new RegExp("^#("+cb+")"),CLASS:new RegExp("^\\.("+cb+")"),NAME:new RegExp("^\\[name=['\"]?("+cb+")['\"]?\\]"),TAG:new RegExp("^("+cb.replace("w","w*")+")"),ATTR:new RegExp("^"+fb),PSEUDO:new RegExp("^"+gb),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+bb+"*(even|odd|(([+-]|)(\\d*)n|)"+bb+"*(?:([+-]|)"+bb+"*(\\d+)|))"+bb+"*\\)|)","i"),needsContext:new RegExp("^"+bb+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+bb+"*((?:-\\d)?\\d*)"+bb+"*\\)|)(?=[^-]|$)","i")},nb=/[\x20\t\r\n\f]*[+~]/,ob=/^[^{]+\{\s*\[native code/,pb=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,qb=/^(?:input|select|textarea|button)$/i,rb=/^h\d$/i,sb=/'|\\/g,tb=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,ub=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,vb=function(a,b){var c="0x"+b-65536;return c!==c?b:0>c?String.fromCharCode(c+65536):String.fromCharCode(c>>10|55296,1023&c|56320)};try{$.apply(X=_.call(M.childNodes),M.childNodes),X[M.childNodes.length].nodeType}catch(wb){$={apply:X.length?function(a,b){Z.apply(a,_.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}y=e.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},D=e.setDocument=function(b){var c=b?b.ownerDocument||b:M;return c!==E&&9===c.nodeType&&c.documentElement?(E=c,F=c.documentElement,G=!y(c),N.getElementsByTagName=d(function(a){return a.appendChild(c.createComment("")),!a.getElementsByTagName("*").length}),N.attributes=d(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return"boolean"!==b&&"string"!==b}),N.getElementsByClassName=d(function(a){return a.innerHTML="",a.getElementsByClassName&&a.getElementsByClassName("e").length?(a.lastChild.className="e",2===a.getElementsByClassName("e").length):!1}),N.getByName=d(function(a){a.id=L+0,a.appendChild(E.createElement("a")).setAttribute("name",L),a.appendChild(E.createElement("i")).setAttribute("name",L),F.appendChild(a);var b=c.getElementsByName&&c.getElementsByName(L).length===2+c.getElementsByName(L+0).length;return F.removeChild(a),b}),N.sortDetached=d(function(a){return a.compareDocumentPosition&&1&a.compareDocumentPosition(E.createElement("div"))}),w.attrHandle=d(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==V&&"#"===a.firstChild.getAttribute("href")})?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},N.getByName?(w.find.ID=function(a,b){if(typeof b.getElementById!==V&&G){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},w.filter.ID=function(a){var b=a.replace(ub,vb);return function(a){return a.getAttribute("id")===b}}):(w.find.ID=function(a,b){if(typeof b.getElementById!==V&&G){var c=b.getElementById(a);return c?c.id===a||typeof c.getAttributeNode!==V&&c.getAttributeNode("id").value===a?[c]:void 0:[]}},w.filter.ID=function(a){var b=a.replace(ub,vb);return function(a){var c=typeof a.getAttributeNode!==V&&a.getAttributeNode("id");return c&&c.value===b}}),w.find.TAG=N.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==V?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},w.find.NAME=N.getByName&&function(a,b){return typeof b.getElementsByName!==V?b.getElementsByName(name):void 0},w.find.CLASS=N.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==V&&G?b.getElementsByClassName(a):void 0},I=[],H=[":focus"],(N.qsa=a(c.querySelectorAll))&&(d(function(a){a.innerHTML="",a.querySelectorAll("[selected]").length||H.push("\\["+bb+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||H.push(":checked")}),d(function(a){a.innerHTML="",a.querySelectorAll("[i^='']").length&&H.push("[*^$]="+bb+"*(?:\"\"|'')"),a.querySelectorAll(":enabled").length||H.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),H.push(",.*:")})),(N.matchesSelector=a(J=F.matchesSelector||F.mozMatchesSelector||F.webkitMatchesSelector||F.oMatchesSelector||F.msMatchesSelector))&&d(function(a){N.disconnectedMatch=J.call(a,"div"),J.call(a,"[s!='']:x"),I.push("!=",gb)}),H=new RegExp(H.join("|")),I=I.length&&new RegExp(I.join("|")),K=a(F.contains)||F.compareDocumentPosition?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},U=F.compareDocumentPosition?function(a,b){if(a===b)return T=!0,0;var d=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b);return d?1&d||B&&b.compareDocumentPosition(a)===d?a===c||K(M,a)?-1:b===c||K(M,b)?1:C?ab.call(C,a)-ab.call(C,b):0:4&d?-1:1:a.compareDocumentPosition?-1:1}:function(a,b){var d,e=0,g=a.parentNode,h=b.parentNode,i=[a],j=[b];if(a===b)return T=!0,0;if(!g||!h)return a===c?-1:b===c?1:g?-1:h?1:0;if(g===h)return f(a,b);for(d=a;d=d.parentNode;)i.unshift(d);for(d=b;d=d.parentNode;)j.unshift(d);for(;i[e]===j[e];)e++;return e?f(i[e],j[e]):i[e]===M?-1:j[e]===M?1:0},E):E},e.matches=function(a,b){return e(a,null,null,b)},e.matchesSelector=function(a,b){if((a.ownerDocument||a)!==E&&D(a),b=b.replace(tb,"='$1']"),N.matchesSelector&&G&&(!I||!I.test(b))&&!H.test(b))try{var c=J.call(a,b);if(c||N.disconnectedMatch||a.document&&11!==a.document.nodeType)return c}catch(d){}return e(b,E,null,[a]).length>0},e.contains=function(a,b){return(a.ownerDocument||a)!==E&&D(a),K(a,b)},e.attr=function(a,b){var c;return(a.ownerDocument||a)!==E&&D(a),G&&(b=b.toLowerCase()),(c=w.attrHandle[b])?c(a):!G||N.attributes?a.getAttribute(b):((c=a.getAttributeNode(b))||a.getAttribute(b))&&a[b]===!0?b:c&&c.specified?c.value:null},e.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},e.uniqueSort=function(a){var b,c=[],d=0,e=0;if(T=!N.detectDuplicates,B=!N.sortDetached,C=!N.sortStable&&a.slice(0),a.sort(U),T){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return a},x=e.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=x(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d];d++)c+=x(b);return c},w=e.selectors={cacheLength:50,createPseudo:c,match:mb,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ub,vb),a[3]=(a[4]||a[5]||"").replace(ub,vb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||e.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&e.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return mb.CHILD.test(a[0])?null:(a[4]?a[2]=a[4]:c&&kb.test(c)&&(b=j(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){return"*"===a?function(){return!0}:(a=a.replace(ub,vb).toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=Q[a+" "];return b||(b=new RegExp("(^|"+bb+")"+a+"("+bb+"|$)"))&&Q(a,function(a){return b.test(a.className||typeof a.getAttribute!==V&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var f=e.attr(d,a);return null==f?"!="===b:b?(f+="","="===b?f===c:"!="===b?f!==c:"^="===b?c&&0===f.indexOf(c):"*="===b?c&&f.indexOf(c)>-1:"$="===b?c&&f.slice(-c.length)===c:"~="===b?(" "+f+" ").indexOf(c)>-1:"|="===b?f===c||f.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){for(;p;){for(l=b;l=l[p];)if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(k=q[L]||(q[L]={}),j=k[a]||[],n=j[0]===O&&j[1],m=j[0]===O&&j[2],l=n&&q.childNodes[n];l=++n&&l&&l[p]||(m=n=0)||o.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[O,n,m];break}}else if(s&&(j=(b[L]||(b[L]={}))[a])&&j[0]===O)m=j[1];else for(;(l=++n&&l&&l[p]||(m=n=0)||o.pop())&&((h?l.nodeName.toLowerCase()!==r:1!==l.nodeType)||!++m||(s&&((l[L]||(l[L]={}))[a]=[O,m]),l!==b)););return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var d,f=w.pseudos[a]||w.setFilters[a.toLowerCase()]||e.error("unsupported pseudo: "+a);return f[L]?f(b):f.length>1?(d=[a,a,"",b],w.setFilters.hasOwnProperty(a.toLowerCase())?c(function(a,c){for(var d,e=f(a,b),g=e.length;g--;)d=ab.call(a,e[g]),a[d]=!(c[d]=e[g])}):function(a){return f(a,0,d)}):f}},pseudos:{not:c(function(a){var b=[],d=[],e=z(a.replace(hb,"$1"));return e[L]?c(function(a,b,c,d){for(var f,g=e(a,null,d,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,c,f){return b[0]=a,e(b,null,f,d),!d.pop()}}),has:c(function(a){return function(b){return e(a,b).length>0}}),contains:c(function(a){return function(b){return(b.textContent||b.innerText||x(b)).indexOf(a)>-1}}),lang:c(function(a){return lb.test(a||"")||e.error("unsupported lang: "+a),a=a.replace(ub,vb).toLowerCase(),function(b){var c;do if(c=G?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(a){var b=window.location&&window.location.hash;return b&&b.slice(1)===a.id},root:function(a){return a===F},focus:function(a){return a===E.activeElement&&(!E.hasFocus||E.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeName>"@"||3===a.nodeType||4===a.nodeType)return!1;return!0},parent:function(a){return!w.pseudos.empty(a)},header:function(a){return rb.test(a.nodeName)},input:function(a){return qb.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||b.toLowerCase()===a.type)},first:i(function(){return[0]}),last:i(function(a,b){return[b-1]}),eq:i(function(a,b,c){return[0>c?c+b:c]}),even:i(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:i(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:i(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:i(function(a,b,c){for(var d=0>c?c+b:c;++dc;c++)b("position","absolute"),b(this._isY?"top":"left",c*this._elLength+"px")},_onTouchStart:function(a){if(!(a.touches.length>1)){this._swipeData={x:b.pointerX(a),y:b.pointerY(a)};var c=this._ulEl.getBoundingClientRect();this._swipeData.firstUlPos=c[this._isY?"top":"left"],this._swipeData.inUlX=this._swipeData.x-c.left,this._swipeData.inUlY=this._swipeData.y-c.top,i(this._ulEl,"none"),this._touchMoveIsFirstTouchMove=!0}},_onTouchMove:function(a){if(!(a.touches.length>1)){var c=b.pointerX(a),d=b.pointerY(a),e=Math.abs(d-this._swipeData.y),f=Math.abs(c-this._swipeData.x);this._touchMoveIsFirstTouchMove&&(this._touchMoveIsFirstTouchMove=void 0,this._scrolling=this._isY?f>e:e>f,this._scrolling||this._onAnimationFrame()),!this._scrolling&&this._swipeData&&(b.stopDefault(a),this._swipeData.pointerPos=this._isY?d:c)}},_onAnimationFrame:function(){var a=this._swipeData;if(a&&!this._scrolling&&!this._touchMoveIsFirstTouchMove){var b=this._element.getBoundingClientRect(),c;c=this._isY?a.pointerPos-a.inUlY-b.top:a.pointerPos-a.inUlX-b.left,this._ulEl.style[this._isY?"top":"left"]=c+"px",j(Ink.bindMethod(this,"_onAnimationFrame"))}},_onTouchEnd:function(a){if(this._swipeData&&this._swipeData.pointerPos&&!this._scrolling&&!this._touchMoveIsFirstTouchMove){var c=.1,d=this._swipeData.firstUlPos-this._ulEl.getBoundingClientRect()[this._isY?"top":"left"],e=this.getPage(),f=d/this._elLength/this._slidesPerPage;Math.abs(f)>c&&(e+=Math[0>d?"floor":"ceil"](f)),isNaN(e)||this.setPage(e),b.stopDefault(a)}i(this._ulEl,null),this._swipeData=null,this._touchMoveIsFirstTouchMove=void 0,this._scrolling=void 0},_onPaginationChange:function(a){this._setPage(a.getCurrent())},getPage:function(){return this._pagination?this._pagination.getCurrent():this._currentPage||0},setPage:function(a,b){b&&(a%=this._numPages,0>a&&(a=this._numPages-a)),a=g(a,0,this._numPages-1),this._pagination?this._pagination.setCurrent(a):this._setPage(a)},_setPage:function(a){var b=a*this._deltaLength,c=a===this._numPages-1;if(!this._options.spaceAfterLastSlide&&c&&a>0){var d=this._liEls.length-a*this._slidesPerPage;d2)&&r('the "defaults" argument must be an object mapping option names to [typestring, optional] arrays.'),k=a in h?n._coerce_from_string(m,h[a],a,b):i,k!==i?n._options_validate(k,m)?k:(s("("+a+" option) Invalid "+m+" "+q(k)),o):a in d?d[a]:o!==i?o:void r("Option "+a+" is required!")}"string"!=typeof b&&(e=d,d=c,c=b,b=""),d=d||{};var g={},h=e?a.data(e):{},k,l,m,o,p=function(a){return b&&(a=b+': "'+(""+a).replace(/"/,'\\"')+'"'),a},q=function(a){return'"'+(""+a).replace(/"/,'\\"')+'"'},r=function(a){throw new Error(p(a))},s=function(a){Ink.error(p(a)+". Ignoring option.")};for(var t in c)c.hasOwnProperty(t)&&(g[t]=f(t));return g},_coerce_from_string:function(a,b,c,d){return a in n._coerce_funcs?n._coerce_funcs[a](b,c,d):b},_options_validate:function(a,b){return b in n._options_validate_types?n._options_validate_types[b].call(n,a):!1},_coerce_funcs:function(){var a={element:function(a){return n.elOrSelector(a,"")},elements:function(a){return n.elsOrSelector(a,"",!1)},object:function(a){return a},number:function(a){return parseFloat(a)},"boolean":function(a){return!("false"===a||""===a||null===a)},string:function(a){return a},"function":function(a,b,c){return Ink.error(c+': You cannot specify the option "'+b+"\" through data-attributes because it's a function"),i}};return a["float"]=a.integer=a.number,a}(),_options_validate_types:function(){var a={string:function(a){return"string"==typeof a},number:function(a){return"number"==typeof a&&!isNaN(a)&&isFinite(a)},integer:function(a){return a===Math.round(a)},element:function(a){return n.isDOMElement(a)},elements:function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&a.length},"boolean":function(a){return"boolean"==typeof a},object:function(){return!0}};return a["float"]=a.number,a}(),clone:function(a){try{return JSON.parse(JSON.stringify(a))}catch(b){throw new Error("Given object cannot have loops!")}},childIndex:function(a){if(n.isDOMElement(a))for(var b=d.select("> *",a.parentNode),c=0,e=b.length;e>c;++c)if(b[c]===a)return c;throw"not found!"},ajaxJSON:function(a,c,d){new b(a,{evalJS:"force",method:"POST",parameters:c,onSuccess:function(a){try{if(a=a.responseJSON,"ok"!==a.status)throw"server error: "+a.message;d(null,a)}catch(b){d(b)}},onFailure:function(){d("communication failure")}})},currentLayout:function(){var a,b,e,f,g,h=d.select("#ink-layout-detector")[0];if(!h){h=document.createElement("div"),h.id="ink-layout-detector";for(e in this.Layouts)this.Layouts.hasOwnProperty(e)&&(f=this.Layouts[e],g=document.createElement("div"),g.className="show-"+f+" hide-all",g.setAttribute("data-ink-layout",f),h.appendChild(g));document.body.appendChild(h)}for(a=0,b=h.children.length;b>a;++a)if(g=h.children[a],"block"===c.getStyle(g,"display"))return g.getAttribute("data-ink-layout");return"large"},hashSet:function(a){if("object"!=typeof a)throw new TypeError("o should be an object!");var b=e.getAnchorString();b=Ink.extendObj(b,a),window.location.hash=e.genQueryString("",b).substring(1)},cleanChildren:function(a){if(!n.isDOMElement(a))throw"Please provide a valid DOMElement";for(var b,c=a.lastChild;c;)b=c.previousSibling,a.removeChild(c),c=b},storeIdAndClasses:function(a,b){if(!n.isDOMElement(a))throw"Please provide a valid DOMElement as first parameter";var c=a.id;c&&(b._id=c);var d=a.className;d&&(b._classes=d)},restoreIdAndClasses:function(a,b){if(!n.isDOMElement(a))throw"Please provide a valid DOMElement as first parameter";b._id&&a.id!==b._id&&(a.id=b._id),b._classes&&-1===a.className.indexOf(b._classes)&&(a.className?a.className+=" "+b._classes:a.className=b._classes),b._instanceId&&!a.getAttribute("data-instance")&&a.setAttribute("data-instance",b._instanceId)},_warnDoubleInstantiation:function(a,b){function c(a){return(a.constructor&&a.constructor._name||a._name||"").replace(/_.*?$/,"")}var d=n.getInstance(a);if(""!==c(b)&&d){var e=c(b);if(e){for(var f=0,g=d.length;g>f;f++)if(e===c(d[f]))return Ink.warn("Creating more than one "+e+".","(Was creating a "+e+" on:",a,")."),!1;return!0}}},registerInstance:function(a,b){if(a){if(!n.isDOMElement(b))throw new TypeError("Ink.UI.Common.registerInstance: The element passed in is not a DOM element!");if(n._warnDoubleInstantiation(b,a)===!1)return!1;var c=m.get(b);return c||(c=[],m.set(b,c)),c.push(a),!0}},unregisterInstance:function(a){if(a&&a._element)for(var b=m.get(a._element),c=0,d=b.length;d>c;c++)b[c]===a&&b.splice(c,1)},getInstance:function(a,b){a=n.elOrSelector(a);var c=m.get(a);if(c||(c=[]),"function"!=typeof b)return c;for(var d=0,e=c.length;e>d;d++)if(c[d]instanceof b)return c[d];return null},getInstanceFromSelector:function(a){return n.getInstance(n.elOrSelector(a))},getInstanceIds:function(){var a=[];for(var b in l)l.hasOwnProperty(b)&&a.push(b);return a},getInstances:function(){var a=[];for(var b in l)l.hasOwnProperty(b)&&a.push(l[b]);return a},destroyComponent:function(){n.unregisterInstance(this),this._element.parentNode.removeChild(this._element)}};return h._validateInstance=function(a){var b;if("function"!=typeof a._validate)return!0;try{b=a._validate()}catch(c){b=c}return b instanceof Error?(a._validationError=b,!1):!0},h._stubInstance=function(a,b,c){g(b.prototype,a),g(h.prototype,a),Ink.warn(c+" was not correctly created. "+(a._validationError||""))},h.getInstance=function(a){return a=n.elOrSelector(a),n.getInstance(a,this)},Ink.extendObj(h.prototype,{getOption:function(a){return!this.constructor||a in this.constructor._optionDefinition?this._options[a]:void Ink.error('"'+a+'" is not an option for '+this.constructor._name)},setOption:function(a,b){return!this.constructor||a in this.constructor._optionDefinition?void(this._options[a]=b):void Ink.error('"'+a+" is not an option for "+this.constructor._name)},getElement:function(){return this._element}}),n.BaseUIComponent=h,n.createUIComponent=function q(a,b){function c(a,b){if(!a)throw new Error("Ink.UI_1.createUIComponent: "+b)}function d(b,d,e){var f=a[b];c("undefined"!=typeof f,a+" doesn't have a \""+b+'" property. '+e),c(d&&typeof f===d,"typeof "+a+"."+b+' is not "'+d+'". '+e)}a._componentOptions=b||{},c("function"==typeof a,"constructor argument is not a function!"),d("_name","string","This property is used for error messages. Set it to the full module path and version (Ink.My.Module_1)."),d("_optionDefinition","object","This property contains the option names, types and defaults. See Ink.UI.Common.options() for reference.");var e=a.prototype;a.prototype="function"==typeof Object.create?Object.create(h.prototype):function f(){function a(){}return a.prototype=h.prototype,new a}(),Ink.extendObj(a.prototype,e),a.prototype.constructor=a,Ink.extendObj(a,h)},n}),Ink.createModule("Ink.UI.DatePicker","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1","Ink.Util.Date_1","Ink.Dom.Browser_1"],function(a,b,c,d,e,f,g){"use strict";function h(a,b,c){return a>c&&(a=c),b>a&&(a=b),a}function i(a){var b=a.split("-");return j(+b[0],+b[1]-1,+b[2])}function j(a,b,c){return{_year:a,_month:b,_day:c}}function k(a){return{_year:a.getFullYear(),_month:a.getMonth(),_day:a.getDate()}}var l=function(){a.BaseUIComponent.apply(this,arguments)};return l._name="DatePicker_1",l._optionDefinition={autoOpen:["Boolean",!1],cleanText:["String","Clear"],closeText:["String","Close"],pickerField:["Element",null],containerElement:["Element",null],cssClass:["String","ink-calendar bottom"],dateRange:["String",null],displayInSelect:["Boolean",!1],dayField:["Element",null],monthField:["Element",null],yearField:["Element",null],format:["String","yyyy-mm-dd"],nextLinkText:["String","»"],ofText:["String"," of "],onFocus:["Boolean",!0],onMonthSelected:["Function",null],onSetDate:["Function",null],onYearSelected:["Function",null],position:["String","right"],prevLinkText:["String","«"],showClean:["Boolean",!0],showClose:["Boolean",!0],shy:["Boolean",!0],startDate:["String",null],startWeekDay:["Number",1],validDayFn:["Function",null],validMonthFn:["Function",null],validYearFn:["Function",null],nextValidDateFn:["Function",null],prevValidDateFn:["Function",null],yearRange:["String",null],month:["Object",{1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"}],wDay:["Object",{0:"Sunday",1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday"}]},l.prototype={_init:function(){this._options.format=this._dateParsers[this._options.format]||this._options.format,this._hoverPicker=!1,this._picker=this._options.pickerField||null,this._setMinMax(this._options.dateRange||this._options.yearRange),this.setDate(this._options.startDate?this._options.startDate:this._element&&this._element.value?this._element.value:new Date),(this._options.startWeekDay<0||this._options.startWeekDay>6)&&(Ink.warn('Ink.UI.DatePicker_1: option "startWeekDay" must be between 0 (sunday) and 6 (saturday)'),this._options.startWeekDay=h(this._options.startWeekDay,0,6)),Ink.extendObj(this._options,this._lang||{}),this._render(),this._listenToContainerObjectEvents() +},_validate:function(){if(this._options.displayInSelect&&!(this._options.dayField&&this._options.monthField&&this._options.yearField))throw new Error("Ink.UI.DatePicker: displayInSelect option enabled.Please specify dayField, monthField and yearField selectors.")},_render:function(){this._containerObject=document.createElement("div"),this._containerObject.className=this._options.cssClass+" ink-datepicker-calendar hide-all",this._renderSuperTopBar();var b=document.createElement("div");b.className="ink-calendar-top",this._monthDescContainer=document.createElement("div"),this._monthDescContainer.className="ink-calendar-month_desc",this._monthPrev=document.createElement("div"),this._monthPrev.className="ink-calendar-prev",this._monthPrev.appendChild(d.create("a",{href:"#prev",className:"change_month_prev",setHTML:this._options.prevLinkText})),this._monthNext=document.createElement("div"),this._monthNext.className="ink-calendar-next",this._monthNext.appendChild(d.create("a",{href:"#next",className:"change_month_next",setHTML:this._options.nextLinkText})),b.appendChild(this._monthPrev),b.appendChild(this._monthDescContainer),b.appendChild(this._monthNext),this._monthContainer=document.createElement("div"),this._monthContainer.className="ink-calendar-month",this._containerObject.appendChild(b),this._containerObject.appendChild(this._monthContainer),this._monthSelector=this._renderMonthSelector(),this._containerObject.appendChild(this._monthSelector),this._yearSelector=document.createElement("ul"),this._yearSelector.className="ink-calendar-year-selector",this._containerObject.appendChild(this._yearSelector),(!this._options.onFocus||this._options.displayInSelect)&&(this._picker=this._options.pickerField?a.elOrSelector(this._options.pickerField,"pickerField"):d.create("a",{href:"#open_cal",setHTML:"open",insertBottom:this._element.parentNode,className:"ink-datepicker-picker-field"})),this._appendDatePickerToDom(),this._renderMonth(),this._monthChanger=d.create("a",{href:"#monthchanger",className:"ink-calendar-link-month",setTextContent:this._options.month[this._month+1]}),this._ofText=d.create("span",{className:"ink-calendar-of-text",setHTML:this._options.ofText}),this._yearChanger=d.create("a",{href:"#yearchanger",className:"ink-calendar-link-year",setTextContent:this._year}),this._monthDescContainer.appendChild(this._monthChanger),this._monthDescContainer.appendChild(this._ofText),this._monthDescContainer.appendChild(this._yearChanger),this._options.inline?this.show():this._addOpenCloseEvents(),this._addDateChangeHandlersToInputs()},_addDateChangeHandlersToInputs:function(){var a=this._element;this._options.displayInSelect&&(a=[this._options.dayField,this._options.monthField,this._options.yearField]),b.observeMulti(a,"change",Ink.bindEvent(function(){this._updateDate(),this._showDefaultView(),this.setDate(),this._inline||this._hoverPicker||this._hide(!0)},this))},show:function(){this._updateDate(),this._renderMonth(),c.removeClassName(this._containerObject,"hide-all")},_addOpenCloseEvents:function(){var a=this._picker||this._element;b.observe(a,"click",Ink.bindEvent(function(a){b.stop(a),this.show()},this)),this._options.autoOpen&&this.show(),this._options.displayInSelect||b.observe(a,"blur",Ink.bindEvent(function(){this._hoverPicker||this._hide(!0)},this)),this._options.shy&&b.observe(document,"click",Ink.bindEvent(function(a){for(var c=b.element(a),e=[this._options.dayField,this._options.monthField,this._options.yearField,this._picker,this._element],f=0,g=e.length;g>f;f++)if(e[f]&&d.descendantOf(e[f],c))return;this._hide(!0)},this))},_renderMonthSelector:function(){var a=document.createElement("ul");a.className="ink-calendar-month-selector";for(var b=document.createElement("ul"),c=1;12>=c;c++)b.appendChild(this._renderMonthButton(c)),c%4===0&&(a.appendChild(b),b=document.createElement("ul"));return a},_renderMonthButton:function(a){var b=document.createElement("li");return b.appendChild(d.create("a",{"data-cal-month":a,setTextContent:this._options.month[a].substring(0,3)})),b},_appendDatePickerToDom:function(){if(this._options.containerElement){var b=a.elOrSelector(this._options.containerElement);b.appendChild(this._containerObject)}var c=e.matchesSelector(this._element.parentNode,".ink-form .control-group .control");c?(this._wrapper=this._element.parentNode,this._wrapperIsControl=!0):(this._wrapper=d.create("div",{className:"ink-datepicker-wrapper"}),d.wrap(this._element,this._wrapper)),d.insertAfter(this._containerObject,this._element)},_renderSuperTopBar:function(){this._options.showClose&&this._options.showClean&&(this._superTopBar=document.createElement("div"),this._superTopBar.className="ink-calendar-top-options",this._options.showClean&&this._superTopBar.appendChild(d.create("a",{className:"clean",setHTML:this._options.cleanText})),this._options.showClose&&this._superTopBar.appendChild(d.create("a",{className:"close",setHTML:this._options.closeText})),this._containerObject.appendChild(this._superTopBar))},_listenToContainerObjectEvents:function(){b.observe(this._containerObject,"mouseover",Ink.bindEvent(function(a){b.stop(a),this._hoverPicker=!0},this)),b.observe(this._containerObject,"mouseout",Ink.bindEvent(function(a){b.stop(a),this._hoverPicker=!1},this)),b.observe(this._containerObject,"click",Ink.bindEvent(this._onClick,this))},_onClick:function(a){var d=b.element(a);return c.hasClassName(d,"ink-calendar-off")?(b.stopDefault(a),null):(b.stop(a),this._onRelativeChangerClick(d),this._onAbsoluteChangerClick(d),c.hasClassName(d,"ink-calendar-link-month")?this._showMonthSelector():c.hasClassName(d,"ink-calendar-link-year")?this._showYearSelector():c.hasClassName(d,"clean")?this._clean():c.hasClassName(d,"close")&&this._hide(!1),void this._updateDescription())},_onRelativeChangerClick:function(a){var b={change_year_next:1,change_year_prev:-1},c={change_month_next:1,change_month_prev:-1};a.className in c?this._updateCal(c[a.className]):a.className in b&&this._showYearSelector(b[a.className])},_onAbsoluteChangerClick:function(a){var b=d.data(a);Number(b.calDay)?(this.setDate(new Date(this._year,this._month,b.calDay)),this._hide()):Number(b.calMonth)?(this._month=Number(b.calMonth)-1,this._showDefaultView(),this._updateCal()):Number(b.calYear)&&this._changeYear(Number(b.calYear))},_changeYear:function(a){a=+a,isNaN(a)||(this._year=a,"function"==typeof this._options.onYearSelected&&this._options.onYearSelected(this,{year:this._year}),this._showMonthSelector())},_clean:function(){this._options.displayInSelect?(this._options.yearField.selectedIndex=0,this._options.monthField.selectedIndex=0,this._options.dayField.selectedIndex=0):this._element.value=""},_hide:function(a){a=void 0===a?!0:a,(a===!1||a&&this._options.shy)&&c.addClassName(this._containerObject,"hide-all")},_setMinMax:function(a){function b(){c._min=d,c._max=e}var c=this,d={_year:-Number.MAX_VALUE,_month:0,_day:1},e={_year:Number.MAX_VALUE,_month:11,_day:31};if(!a)return b();var g=a.split(":"),j=/^(\d{4})((\-)(\d{1,2})((\-)(\d{1,2}))?)?$/;f.each([{name:"_min",date:g[0],noLim:d},{name:"_max",date:g[1],noLim:e}],Ink.bind(function(a){var b=a.noLim;if("NOW"===a.date.toUpperCase()){var c=new Date;b=k(c)}else"EVER"===a.date.toUpperCase()?b=a.noLim:j.test(a.date)&&(b=i(a.date),b._month=h(b._month,0,11),b._day=h(b._day,1,this._daysInMonth(b._year,b._month+1)));this[a.name]=b},this));var l=-1!==this._dateCmp(this._max,this._min);l||b()},_fitDateToRange:function(a){return this._isValidDate(a)||(a=k(new Date)),-1===this._dateCmp(a,this._min)?Ink.extendObj({},this._min):1===this._dateCmp(a,this._max)?Ink.extendObj({},this._max):Ink.extendObj({},a)},_dateWithinRange:function(a){return arguments.length||(a=this),!this._dateAboveMax(a)&&!this._dateBelowMin(a)},_dateAboveMax:function(a){return 1===this._dateCmp(a,this._max)},_dateBelowMin:function(a){return-1===this._dateCmp(a,this._min)},_dateCmp:function(a,b){return this._dateCmpUntil(a,b,"_day")},_dateCmpUntil:function(a,b,c){var d=["_year","_month","_day"],e=-1;do{if(e++,a[d[e]]>b[d[e]])return 1;if(a[d[e]]this._min._year){var f=d.create("li");f.appendChild(d.create("a",{href:"#year_prev",className:"change_year_prev",setHTML:this._options.prevLinkText})),e.appendChild(f)}else e.appendChild(d.create("li",{setHTML:" "}));for(var g=1;11>g;g++)g%4===0&&(e=d.create("ul"),this._yearSelector.appendChild(e)),c=b+g-1,e.appendChild(this._getYearButton(c));if(cthis._max._year||b+9=1&&+a._month+1<=12&&+a._day>=1&&+a._day<=this._daysInMonth(a._year,a._month+1)},_isDate:function(a,b){try{if("undefined"==typeof a)return!1;var c=g.set(a,b);if(c&&this._isValidDate(k(c)))return!0}catch(d){}return!1},_acceptableDay:function(a){return this._acceptableDateComponent(a,"validDayFn")},_acceptableMonth:function(a){return this._acceptableDateComponent(a,"validMonthFn")},_acceptableYear:function(a){return this._acceptableDateComponent(a,"validYearFn")},_acceptableDateComponent:function(a,b){return this._options[b]?this._callUserCallbackBool(this._options[b],a):this._dateWithinRange(a)},_writeDateInFormat:function(){return g.get(this._options.format,this.getDate())},setDate:function(a){if(a&&"function"==typeof a.getDate&&(a=[a.getFullYear(),a.getMonth()+1,a.getDate()].join("-")),/\d{4}-\d{1,2}-\d{1,2}/.test(a)){var b=a.split("-");this._year=+b[0],this._month=+b[1]-1,this._day=+b[2]}this._setDate()},getDate:function(){if(!this._day)throw"Ink.UI.DatePicker: Still picking a date. Cannot getDate now!";return new Date(this._year,this._month,this._day)},_setDate:function(a){if(a){var b=d.data(a);this._day=+b.calDay||this._day}var c=this._fitDateToRange(this);this._year=c._year,this._month=c._month,this._day=c._day,this._options.displayInSelect?(this._options.dayField.value=this._day,this._options.monthField.value=this._month+1,this._options.yearField.value=this._year):this._element.value=this._writeDateInFormat(),this._options.onSetDate&&this._options.onSetDate(this,{date:this.getDate()})},_updateCal:function(a){"function"==typeof this._options.onMonthSelected&&this._options.onMonthSelected(this,{year:this._year,month:this._month}),a&&null===this._updateMonth(a)||this._renderMonth()},_daysInMonth:function(a,b){var c={2:a%400===0||a%4===0&&a%100!==0?29:28,4:30,6:30,9:30,11:30};return c[b]||31},_updateMonth:function(a){var b;return a>0?b=this._getNextMonth():0>a&&(b=this._getPrevMonth()),b?(this._year=b._year,this._month=b._month,void(this._day=b._day)):null},_getNextMonth:function(a){return this._tryLeap(a,"Month","next",function(a){return a._month+=1,a._month>11&&(a._month=0,a._year+=1),a})},_getPrevMonth:function(a){return this._tryLeap(a,"Month","prev",function(a){return a._month-=1,a._month<0&&(a._month=11,a._year-=1),a})},_getPrevYear:function(a){return this._tryLeap(a,"Year","prev",function(a){return a._year-=1,a})},_getNextYear:function(a){return this._tryLeap(a,"Year","next",function(a){return a._year+=1,a})},_tryLeap:function(a,b,c,d){a=a||{_year:this._year,_month:this._month,_day:this._day};var e="prev"===c?"_min":"_max",f=this[e];if(0===this._dateCmpUntil(a,f,b))return null;var g=this._options[c+"ValidDateFn"];return g?this._callUserCallbackDate(g,a):(a=d(a),a=this._fitDateToRange(a),this["_acceptable"+b](a)?a:null)},_getNextDecade:function(a){a=a||{_year:this._year,_month:this._month,_day:this._day};var b=this._getCurrentDecade(a);return b+10>this._max._year?null:b+10},_getPrevDecade:function(a){a=a||{_year:this._year,_month:this._month,_day:this._day};var b=this._getCurrentDecade(a);return b-10e&&(e+=6),e},_getDayButtons:function(a,b){var c=this._daysInMonth(a,b+1),e=document.createDocumentFragment(),f=d.create("ul");e.appendChild(f);for(var g=this._getFirstDayIndex(a,b),h=0;g>h;h++)f.appendChild(d.create("li",{className:"ink-calendar-empty",setHTML:" "}));for(var i=1;c>=i;i++)(i-1+g)%7===0&&(f=d.create("ul"),e.appendChild(f)),f.appendChild(this._getDayButton(a,b,i));return e},_getDayButton:function(a,b,c){var e={},f=j(a,b,c);this._acceptableDay(f)?(e["data-cal-day"]=c,this._day&&0===this._dateCmp(f,this)&&(e.className="ink-calendar-on")):e.className="ink-calendar-off",e.setTextContent=c;var g=d.create("li");return g.appendChild(d.create("a",e)),g},_getMonthCalendarHeader:function(a){for(var b=d.create("ul",{className:"ink-calendar-header"}),c,e=0;7>e;e++)c=(a+e)%7,b.appendChild(d.create("li",{setTextContent:this._options.wDay[c].substring(0,1)}));return b},_addMonthClassNames:function(a){f.forEach((a||this._monthSelector).getElementsByTagName("a"),Ink.bindMethod(this,"_addMonthButtonClassNames"))},_addMonthButtonClassNames:function(a){var b=d.data(a);if(!b.calMonth)throw"not a calendar month button!";var e=+b.calMonth-1;if(e===this._month)c.addClassName(a,"ink-calendar-on"),c.removeClassName(a,"ink-calendar-off");else{c.removeClassName(a,"ink-calendar-on");var f=!this._acceptableMonth({_year:this._year,_month:e});c.addRemoveClassName(a,"ink-calendar-off",f)}},lang:function(a){this._lang=a},showMonth:function(){this._renderMonth()},isMonthRendered:function(){var a=e.select(".ink-calendar-header",this._containerObject)[0];return"none"!==c.getStyle(a.parentNode,"display")&&"none"!==c.getStyle(a.parentNode.parentNode,"display")},destroy:function(){d.unwrap(this._element),d.remove(this._wrapper),d.remove(this._containerObject),a.unregisterInstance.call(this)}},a.createUIComponent(l),l}),Ink.createModule("Ink.UI.Draggable","1",["Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Browser_1","Ink.Dom.Selector_1","Ink.UI.Common_1"],function(a,b,c,d,e,f){"use strict";function g(a,b,c){return a=Math.min(a,c),a=Math.max(a,b)}function h(){f.BaseUIComponent.apply(this,arguments)}var i=0,j=1;return h._name="Draggable_1",h._optionDefinition={constraint:["String",!1],constraintElm:["Element",!1],top:["Number",!1],right:["Number",!1],bottom:["Number",!1],left:["Number",!1],handle:["Element",!1],revert:["Boolean",!1],cursor:["String","move"],zIndex:["Number",9999],fps:["Number",0],droppableProxy:["Element",!1],mouseAnchor:["String",void 0],dragClass:["String","drag"],skipChildren:["Boolean",!0],onStart:["Function",!1],onEnd:["Function",!1],onDrag:["Function",!1],onChange:["Function",!1]},h.prototype={_init:function(){var a=this._options;this.constraintElm=a.constraintElm&&f.elOrSelector(a.constraintElm),this.handle=!1,this.elmStartPosition=!1,this.active=!1,this.dragged=!1,this.prevCoords=!1,this.placeholder=!1,this.position=!1,this.zindex=!1,this.firstDrag=!0,a.fps&&(this.deltaMs=1e3/a.fps,this.lastRunAt=0),this.handlers={},this.handlers.start=Ink.bindEvent(this._onStart,this),this.handlers.dragFacade=Ink.bindEvent(this._onDragFacade,this),this.handlers.drag=Ink.bindEvent(this._onDrag,this),this.handlers.end=Ink.bindEvent(this._onEnd,this),this.handlers.selectStart=function(a){return b.stop(a),!1},this.handle=this._options.handle?f.elOrSelector(this._options.handle):this._element,this.handle.style.cursor=a.cursor,b.observe(this.handle,"touchstart",this.handlers.start),b.observe(this.handle,"mousedown",this.handlers.start),d.IE&&b.observe(this._element,"selectstart",this.handlers.selectStart)},destroy:function(){b.stopObserving(this.handle,"touchstart",this.handlers.start),b.stopObserving(this.handle,"mousedown",this.handlers.start),d.IE&&b.stopObserving(this._element,"selectstart",this.handlers.selectStart)},_getCoords:function(b){var c=[a.scrollWidth(),a.scrollHeight()];return{x:(b.touches?b.touches[0].clientX:b.clientX)+c[i],y:(b.touches?b.touches[0].clientY:b.clientY)+c[j]}},_cloneStyle:function(b,d){d.className=b.className,d.style.borderWidth="0",d.style.padding="0",d.style.position="absolute",d.style.width=a.elementWidth(b)+"px",d.style.height=a.elementHeight(b)+"px",d.style.left=a.elementLeft(b)+"px",d.style.top=a.elementTop(b)+"px",d.style.cssFloat=c.getStyle(b,"float"),d.style.display=c.getStyle(b,"display")},_onStart:function(d){if(!this.active&&b.isLeftClick(d)||"undefined"==typeof d.button){var e=b.element(d);if(this._options.skipChildren&&e!==this.handle)return;b.stop(d),c.addClassName(this._element,this._options.dragClass),this.elmStartPosition=[a.elementLeft(this._element),a.elementTop(this._element)];var f=[parseInt(c.getStyle(this._element,"left"),10),parseInt(c.getStyle(this._element,"top"),10)],g=a.elementDimensions(this._element);this.originalPosition=[f[i]?f[i]:null,f[j]?f[j]:null],this.delta=this._getCoords(d),this.active=!0,this.position=c.getStyle(this._element,"position"),this.zindex=c.getStyle(this._element,"zIndex");var h=document.createElement("div");if(h.style.position=this.position,h.style.width=g[i]+"px",h.style.height=g[j]+"px",h.style.marginTop=c.getStyle(this._element,"margin-top"),h.style.marginBottom=c.getStyle(this._element,"margin-bottom"),h.style.marginLeft=c.getStyle(this._element,"margin-left"),h.style.marginRight=c.getStyle(this._element,"margin-right"),h.style.borderWidth="0",h.style.padding="0",h.style.cssFloat=c.getStyle(this._element,"float"),h.style.display=c.getStyle(this._element,"display"),h.style.visibility="hidden",this.delta2=[this.delta.x-this.elmStartPosition[i],this.delta.y-this.elmStartPosition[j]],this._options.mouseAnchor){var k=this._options.mouseAnchor.split(" "),l=[g[i],g[j]];"left"===k[0]?l[i]=0:"center"===k[0]&&(l[i]=parseInt(l[i]/2,10)),"top"===k[1]?l[j]=0:"center"===k[1]&&(l[j]=parseInt(l[j]/2,10)),this.applyDelta=[this.delta2[i]-l[i],this.delta2[j]-l[j]]}var m=this._options.fps?"dragFacade":"drag";if(this.placeholder=h,this._options.onStart&&this._options.onStart(this._element,d),this._options.droppableProxy){this.proxy=document.createElement("div"),g=[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight];var n=this.proxy.style;n.width=g[i]+"px",n.height=g[j]+"px",n.position="fixed",n.left="0",n.top="0",n.zIndex=this._options.zindex+1,n.backgroundColor="#FF0000",c.setOpacity(this.proxy,0);for(var o=document.body.firstChild;o&&1!==o.nodeType;)o=o.nextSibling;document.body.insertBefore(this.proxy,o),b.observe(this.proxy,"mousemove",this.handlers[m]),b.observe(this.proxy,"touchmove",this.handlers[m])}else b.observe(document,"mousemove",this.handlers[m]);return this._element.style.position="absolute",this._element.style.zIndex=this._options.zindex,this._element.parentNode.insertBefore(this.placeholder,this._element),this._onDrag(d),b.observe(document,"mouseup",this.handlers.end),b.observe(document,"touchend",this.handlers.end),!1}},_onDragFacade:function(a){var b=+new Date;(!this.lastRunAt||b>this.lastRunAt+this.deltaMs)&&(this.lastRunAt=b,this._onDrag(a))},_onDrag:function(c){if(this.active){b.stop(c),this.dragged=!0;var d=this._getCoords(c),e=d.x,f=d.y,h=this._options,k=!1,l=!1;if(this.prevCoords&&e!==this.prevCoords.x||f!==this.prevCoords.y){h.onDrag&&h.onDrag(this._element,c),this.prevCoords=d,k=this.elmStartPosition[i]+e-this.delta.x,l=this.elmStartPosition[j]+f-this.delta.y;var m=a.elementDimensions(this._element);if(this.constraintElm){var n=a.offset(this.constraintElm),o=a.elementDimensions(this.constraintElm),p=n[j]+(h.top||0),q=n[j]+o[j]-(h.bottom||0),r=n[i]+(h.left||0),s=n[i]+o[i]-(h.right||0);l=g(l,p,q-m[j]),k=g(k,r,s-m[i])}else if(h.constraint){var t=h.right===!1?a.pageWidth()-m[i]:h.right,u=h.left===!1?0:h.left,v=h.top===!1?0:h.top,w=h.bottom===!1?a.pageHeight()-m[j]:h.bottom;("horizontal"===h.constraint||"both"===h.constraint)&&(k=g(k,u,t)),("vertical"===h.constraint||"both"===h.constraint)&&(l=g(l,v,w))}var x=Ink.getModule("Ink.UI.Droppable_1");if(this.firstDrag&&(x&&x.updateAll(),this.firstDrag=!1),k&&(this._element.style.left=k+"px"),l&&(this._element.style.top=l+"px"),x){var y=this._options.mouseAnchor?{x:e-this.applyDelta[i],y:f-this.applyDelta[j]}:d;x.action(y,"drag",c,this._element)}h.onChange&&h.onChange(this)}}},_onEnd:function(d){if(b.stopObserving(document,"mousemove",this.handlers.drag),b.stopObserving(document,"touchmove",this.handlers.drag),this._options.fps&&this._onDrag(d),c.removeClassName(this._element,this._options.dragClass),this.active&&this.dragged){this._options.droppableProxy&&document.body.removeChild(this.proxy),this.pt&&(a.remove(this.pt),this.pt=void 0),this.placeholder&&a.remove(this.placeholder),this._options.revert&&(this._element.style.position=this.position,this._element.style.zIndex=null!==this.zindex?this.zindex:"auto",this._element.style.left=this.originalPosition[i]?this.originalPosition[i]+"px":"",this._element.style.top=this.originalPosition[j]?this.originalPosition[j]+"px":""),this._options.onEnd&&this._options.onEnd(this._element,d);var e=Ink.getModule("Ink.UI.Droppable_1");e&&e.action(this._getCoords(d),"drop",d,this._element),this.position=!1,this.zindex=!1,this.firstDrag=!0}this.active=!1,this.dragged=!1}},f.createUIComponent(h),h}),Ink.createModule("Ink.UI.Drawer","1",["Ink.UI.Common_1","Ink.Dom.Loaded_1","Ink.Dom.Selector_1","Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Css_1"],function(a,b,c,d,e,f){"use strict";function g(a){Ink.warn('Ink.UI.Drawer_1: Could not find the "'+a+'" element on this page. Please make sure it exists.')}function h(b){a.BaseUIComponent.apply(this,[document.body,b])}return h._name="Drawer_1",h._optionDefinition={parentSelector:["String",".ink-drawer"],leftDrawer:["String",".left-drawer"],leftTrigger:["String",".left-drawer-trigger"],rightDrawer:["String",".right-drawer"],rightTrigger:["String",".right-drawer-trigger"],contentDrawer:["String",".content-drawer"],closeOnContentClick:["Boolean",!0],closeOnLinkClick:["Boolean",!0],mode:["String","push"],sides:["String","both"]},h.prototype={_init:function(){if(this._contentDrawers=Ink.ss(this._options.contentDrawer),this._leftDrawer=Ink.s(this._options.leftDrawer),this._leftTriggers=Ink.ss(this._options.leftTrigger),this._rightDrawer=Ink.s(this._options.rightDrawer),this._rightTriggers=Ink.ss(this._options.rightTrigger),f.addClassName(document.body,"ink-drawer"),0===this._contentDrawers.length)throw new Error('Ink.UI.Drawer_1: Could not find any "'+this._options.contentDrawer+'" elements on this page. Please make sure you have at least one.');switch(this._options.sides){case"both":this._triggers=this._options.leftTrigger+", "+this._options.rightTrigger+", "+this._options.contentDrawer;break;case"left":this._triggers=this._options.leftTrigger+", "+this._options.contentDrawer;break;case"right":this._triggers=this._options.rightTrigger+", "+this._options.contentDrawer}"left"===this._options.sides||"both"===this._options.sides?(this._leftDrawer||g(this._options.leftDrawer),0===this._leftTriggers.length&&g(this._options.leftTrigger)):(this._rightDrawer||g(this._options.rightDrawer),0===this._rightTriggers.length&&g(this._options.rightTrigger)),this._isOpen=!1,this._direction=void 0,this._handlers={click:Ink.bindEvent(this._onClick,this),afterTransition:Ink.bindEvent(this._afterTransition,this)},this._delay=10,this._addEvents()},_onClick:function(a){var b=Ink.bind(function(b){this._isOpen?this.close():this.open(b),a.preventDefault()},this);d.findUpwardsBySelector(a.currentTarget,this._options.leftTrigger)?b("left"):d.findUpwardsBySelector(a.currentTarget,this._options.rightTrigger)?b("right"):d.findUpwardsBySelector(a.currentTarget,this._options.contentDrawer)?this._options.closeOnContentClick&&this.close():this._options.closeOnLinkClick&&d.isLink(a.target)&&this.close()},_afterTransition:function(){this._isOpen||("left"===this._direction?f.removeClassName(this._leftDrawer,"show"):f.removeClassName(this._rightDrawer,"show"))},_addEvents:function(){e.on(document.body,"click",this._triggers+', a[href*="#"]',this._handlers.click)},open:function(a){this._isOpen=!0,this._direction=a;var b="left"===a?this._leftDrawer:this._rightDrawer;f.addClassName(b,"show"),setTimeout(Ink.bind(function(){f.addClassName(document.body,[this._options.mode,a])},this),this._delay)},close:function(){this._isOpen!==!1&&(this._isOpen=!1,e.one(document.body,"transitionend oTransitionEnd webkitTransitionEnd",this._handlers.afterTransition),f.removeClassName(document.body,[this._options.mode,this._direction]))}},a.createUIComponent(h),h}),Ink.createModule("Ink.UI.Dropdown","1",["Ink.UI.Common_1","Ink.UI.Toggle_1","Ink.Dom.Event_1","Ink.Dom.Element_1"],function(a,b,c,d){"use strict";function e(){a.BaseUIComponent.apply(this,arguments)}return e._name="Dropdown_1",e._optionDefinition={target:["Element"],hoverOpen:["Number",null],dismissOnInsideClick:["Boolean",!1],dismissOnOutsideClick:["Boolean",!0],dismissAfter:["Number",null],onInsideClick:["Function",null],onOutsideClick:["Function",null],onOpen:["Function",null],onDismiss:["Function",null]},e.prototype={_init:function(){this._toggle=new b(this._element,{target:this._options.target,closeOnInsideClick:null,closeOnClick:!1,onChangeState:Ink.bind(function(a){return this._openOrDismiss(a,!0,!0)},this)}),c.observeMulti([this._options.target,this._element],"mouseout",Ink.bindMethod(this,"_onMouseOut")),c.observeMulti([this._options.target,this._element],"mouseover",Ink.bindMethod(this,"_onMouseOver")),c.observe(this._options.target,"click",Ink.bindMethod(this,"_onInsideClick")),c.observe(document,"click",Ink.bindMethod(this,"_onOutsideClick"))},_onMouseOver:function(){"number"==typeof this._options.hoverOpen&&this._toggle.getState()===!1&&(clearTimeout(this._openTimeout),this._openTimeout=setTimeout(Ink.bindMethod(this,"open",!0),1e3*this._options.hoverOpen)),"number"==typeof this._options.dismissAfter&&clearTimeout(this._dismissTimeout)},_onMouseOut:function(){"number"==typeof this._options.dismissAfter&&this._toggle.getState()===!0&&(clearTimeout(this._dismissTimeout),this._dismissTimeout=setTimeout(Ink.bindMethod(this,"dismiss",!0),1e3*this._options.dismissAfter)),"number"==typeof this._options.hoverOpen&&clearTimeout(this._openTimeout)},_onInsideClick:function(a){var b=this._handlerCall("onInsideClick",c.element(a));b!==!1&&this._options.dismissOnInsideClick&&this.dismiss(!0)},_onOutsideClick:function(a){var b=c.element(a),e=d.findUpwardsHaving(b,Ink.bind(function(a){return a===this._element},this)),f=d.findUpwardsHaving(b,Ink.bind(function(a){return a===this._options.target},this));if(!e&&!f){var g=this._handlerCall("onOutsideClick",b);if(g===!1)return;this._options.dismissOnOutsideClick&&this.dismiss(!0)}},dismiss:function(a,b){this._openOrDismiss(!1,a,b)},open:function(a,b){this._openOrDismiss(!0,a,b)},_openOrDismiss:function(a,b,c){if(!this._toggle||this._toggle.getState()!==a){if(b&&this._handlerCall(a?"onOpen":"onDismiss")===!1)return!1;c||this._toggle.setState(a),clearTimeout(this._dismissTimeout),clearTimeout(this._openTimeout)}},_handlerCall:function(a){return this._options[a]?this._options[a].call(this,[].slice.call(arguments,1)):void 0}},a.createUIComponent(e),e}),Ink.createModule("Ink.UI.Droppable","1",["Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.UI.Common_1","Ink.Util.Array_1","Ink.Dom.Selector_1"],function(a,b,c,d,e,f){"use strict";var g=function(a){return function(b){return c.addClassName(a,b)}},h=function(a){return function(b){return c.removeClassName(a,b)}},i={debug:!1,_droppables:[],_draggables:[],add:function(b,c){function e(a){a.style.position="inherit"}b=d.elOrSelector(b,"Droppable.add target element");var f=Ink.extendObj({hoverClass:c.hoverclass||!1,accept:!1,onHover:!1,onDrop:!1,onDropOut:!1},c||{},a.data(b));"string"==typeof f.hoverClass&&(f.hoverClass=f.hoverClass.split(/\s+/));var g=this,h={move:function(a,b){e(a),b.appendChild(a)},copy:function(a,b){e(a),b.appendChild(a.cloneNode(!0))},revert:function(a){g._findDraggable(a).originalParent.appendChild(a),e(a)}},i;if("string"==typeof f.onHover&&(i=f.onHover,f.onHover=h[i],void 0===f.onHover))throw new Error("Unknown hover event handler: "+i);if("string"==typeof f.onDrop&&(i=f.onDrop,f.onDrop=h[i],void 0===f.onDrop))throw new Error("Unknown drop event handler: "+i);if("string"==typeof f.onDropOut&&(i=f.onDropOut,f.onDropOut=h[i],void 0===f.onDropOut))throw new Error("Unknown dropOut event handler: "+i);var j={element:b,data:{},options:f};this._droppables.push(j),this._update(j)},_findData:function(a){for(var b=this._droppables,c=0,d=b.length;d>c;c++)if(b[c].element===a)return b[c]},_findDraggable:function(a){for(var b=this._draggables,c=0,d=b.length;d>c;c++)if(b[c].element===a)return b[c]},updateAll:function(){e.each(this._droppables,i._update) +},update:function(a){this._update(this._findData(a))},_update:function(b){var c=b.data,d=b.element;c.left=a.offsetLeft(d),c.top=a.offsetTop(d),c.right=c.left+a.elementWidth(d),c.bottom=c.top+a.elementHeight(d)},remove:function(a){a=d.elOrSelector(a);for(var b=this._droppables.length,c=0;b>c;c++)if(this._droppables[c].element===a){this._droppables.splice(c,1);break}return b!==this._droppables.length},action:function(a,b,c,d){e.each(this._droppables,Ink.bind(function(i){var j=i.data,k=i.options,l=i.element;(!k.accept||f.matches(k.accept,[d]).length)&&("drag"!==b||this._findDraggable(d)||this._draggables.push({element:d,originalParent:d.parentNode}),a.x>=j.left&&a.x<=j.right&&a.y>=j.top&&a.y<=j.bottom?"drag"===b?(k.hoverClass&&e.each(k.hoverClass,g(l)),k.onHover&&k.onHover(d,l)):"drop"===b&&(k.hoverClass&&e.each(k.hoverClass,h(l)),k.onDrop&&k.onDrop(d,l,c)):"drag"===b&&k.hoverClass?e.each(k.hoverClass,h(l)):"drop"===b&&k.onDropOut&&k.onDropOut(d,l,c))},this))}};return i}),Ink.createModule("Ink.UI.FormValidator","1",["Ink.Dom.Element_1","Ink.Dom.Css_1","Ink.Util.Validator_1","Ink.Dom.Selector_1"],function(a,b,c,d){"use strict";function e(a){if(!a.name)return[];if(!a.form)return d.select('name="'+a.name+'"');var b=a.form[a.name];return"undefined"==typeof b.length&&(b=[b]),b}var f={version:"1",_flagMap:{"ink-fv-required":{msg:"Required field"},"ink-fv-email":{msg:"Invalid e-mail address"},"ink-fv-url":{msg:"Invalid URL"},"ink-fv-number":{msg:"Invalid number"},"ink-fv-phone_pt":{msg:"Invalid phone number"},"ink-fv-phone_cv":{msg:"Invalid phone number"},"ink-fv-phone_mz":{msg:"Invalid phone number"},"ink-fv-phone_ao":{msg:"Invalid phone number"},"ink-fv-date":{msg:"Invalid date"},"ink-fv-confirm":{msg:"Confirmation does not match"},"ink-fv-custom":{msg:""}},elements:{},confirmElms:{},hasConfirm:{},_errorClassName:"tip error",_errorValidationClassName:"validaton",_errorTypeWarningClassName:"warning",_errorTypeErrorClassName:"error",validate:function(a,b){if(this._free(),b=Ink.extendObj({onSuccess:!1,onError:!1,customFlag:!1,confirmGroup:[]},b||{}),"string"==typeof a&&(a=document.getElementById(a)),null===a)return!1;this.element=a,("undefined"==typeof this.element.id||null===this.element.id||""===this.element.id)&&(this.element.id="ink-fv_randomid_"+Math.round(99999*Math.random())),this.custom=b.customFlag,this.confirmGroup=b.confirmGroup;var c=this._validateElements();return c.length>0?(b.onError?b.onError(c):this._showError(a,c),!1):(b.onError||this._clearError(a),this._clearCache(),b.onSuccess&&b.onSuccess(),!0)},reset:function(){this._clearError(),this._clearCache()},_free:function(){this.element=null,this.custom=!1,this.confirmGroup=!1},_clearCache:function(){this.element=null,this.elements=[],this.custom=!1,this.confirmGroup=!1},_getElements:function(){var a=this.elements[this.element.id]=[];this.confirmElms[this.element.id]=[];for(var c=d.select(":input",this.element),e=!1,f=0,g=c.length;g>f;f++){e=c[f];var h=(e.getAttribute("type")+"").toLowerCase();if("radio"===h||"checkbox"===h){if(0===a.length||e.getAttribute("type")!==a[a.length-1].getAttribute("type")&&e.getAttribute("name")!==a[a.length-1].getAttribute("name"))for(var i in this._flagMap)if(b.hasClassName(e,i)){a.push(e);break}}else{for(var j in this._flagMap)if(b.hasClassName(e,j)&&"ink-fv-confirm"!==j){a.push(e);break}b.hasClassName(e,"ink-fv-confirm")&&(this.confirmElms[this.element.id].push(e),this.hasConfirm[this.element.id]=!0)}}},_validateElements:function(){var a;this._getElements(),this.hasConfirm[this.element.id]===!0&&(a=this._makeConfirmGroups());for(var c=[],d=!1,e=!1,f,g=0,h=this.elements[this.element.id].length;h>g;g++)if(f=!1,d=this.elements[this.element.id][g],!d.disabled)for(var i in this._flagMap)if(b.hasClassName(d,i))if("ink-fv-custom"!==i&&"ink-fv-confirm"!==i)this._isValid(d,i)||(f?c[c.length-1].errors.push(i):(c.push({elm:d,errors:[i]}),f=!0));else if("ink-fv-confirm"!==i)e=this._isCustomValid(d),e.length>0&&c.push({elm:d,errors:[i],custom:e});else if("ink-fv-confirm"===i)continue;return c=this._validateConfirmGroups(a,c)},_validateConfirmGroups:function(a,b){var c=!1;for(var d in a)a.hasOwnProperty(d)&&(c=a[d],2===c.length&&c[0].value!==c[1].value&&b.push({elm:c[1],errors:["ink-fv-confirm"]}));return b},_makeConfirmGroups:function(){var a;if(this.confirmGroup&&this.confirmGroup.length>0){a={};for(var c=!1,d=!1,e=0,f=this.confirmElms[this.element.id].length;f>e;e++){c=this.confirmElms[this.element.id][e];for(var g=0,h=this.confirmGroup.length;h>g;g++)d=this.confirmGroup[g],b.hasClassName(c,d)&&("undefined"==typeof a[d]?a[d]=[c]:a[d].push(c))}return a}return 2===this.confirmElms[this.element.id].length&&(a={"ink-fv-confirm":[this.confirmElms[this.element.id][0],this.confirmElms[this.element.id][1]]}),a;return!1},_isCustomValid:function(a){for(var c=[],d=!1,e=0,f=this.custom.length;f>e;e++)d=this.custom[e],b.hasClassName(a,d.flag)&&(d.callback(a,d.msg)||c.push({flag:d.flag,msg:d.msg}));return c},_isValid:function(a,d){var f=a.nodeName.toLowerCase(),g=(a.getAttribute("type")||"").toLowerCase(),h=this._trim(a.value);if("ink-fv-required"!==d&&"checkbox"!==g&&"radio"!==g&&""===h)return!b.hasClassName(a,"ink-fv-required");switch(d){case"ink-fv-required":if("select"===f)return a.selectedIndex>0?!0:!1;if("checkbox"!==g&&"radio"!==g&&""!==h)return!0;if("checkbox"===g||"radio"===g){for(var i=e(a),j=!1,k=0,l=i.length;l>k;k++)if(i[k].checked===!0){j=!0;break}return j}return!1;case"ink-fv-email":return c.mail(a.value);case"ink-fv-url":return c.url(a.value);case"ink-fv-number":return!isNaN(Number(a.value))&&isFinite(Number(a.value));case"ink-fv-phone_pt":return c.isPTPhone(a.value);case"ink-fv-phone_cv":return c.isCVPhone(a.value);case"ink-fv-phone_ao":return c.isAOPhone(a.value);case"ink-fv-phone_mz":return c.isMZPhone(a.value);case"ink-fv-date":var m=Ink.getModule("Ink.Dom.Element",1),n=m.data(a),o="yyyy-mm-dd";if(b.hasClassName(a,"ink-datepicker")&&"format"in n?o=n.format:"validFormat"in n&&(o=n.validFormat),!(o in c._dateParsers)){var p=[];for(var q in c._dateParsers)c._dateParsers.hasOwnProperty(q)&&p.push(q);throw new Error("The attribute data-valid-format must be one of the following values: "+p.join(", "))}return c.isDate(o,a.value);case"ink-fv-custom":}return!1},_showError:function(a,b){this._clearError(a);for(var c=!1,d=0,e=b.length;e>d;d++)c=b[d].elm,c&&this._showAnErrorOnElement(c,b[d])},_showAnErrorOnElement:function(c,d){var e=a.findUpwardsByClass(c,"control-group"),f=a.findUpwardsByClass(c,"control"),g=[this._errorClassName,this._errorTypeClassName].join(" "),h=a.create("p",{className:g});h.innerHTML="ink-fv-custom"!==d.errors[0]?this._flagMap[d.errors[0]].msg:d.custom[0].msg;var i=f||e;i?i.appendChild(h):a.insertAfter(h,c),f&&("ink-fv-required"===d.errors[0]?b.addClassName(e,"validation error"):b.addClassName(e,"validation warning"))},_clearError:function(c){for(var d=c.getElementsByTagName("p"),e,f,g=d.length-1;g>=0;g--)e=d[g],b.hasClassName(e,this._errorClassName)&&(f=a.findUpwardsBySelector(e,".control-group"),f&&b.removeClassName(f,["validation","error","warning"]),b.hasClassName(e,this._errorClassName,!0)&&a.remove(e));var h=c.getElementsByTagName("ul");for(g=h.length-1;g>=0;g--)e=h[g],b.hasClassName(e,"control-group")&&b.removeClassName(e,"validation error")},_trim:function(a){return"string"==typeof a?a.replace(/^\s+|\s+$|\n+$/g,""):void 0}};return f}),Ink.createModule("Ink.UI.FormValidator","2",["Ink.UI.Common_1","Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Selector_1","Ink.Dom.Css_1","Ink.Util.Array_1","Ink.Util.I18n_1","Ink.Util.Validator_1"],function(a,b,c,d,e,f,g,h){"use strict";function i(){a.BaseUIComponent.apply(this,arguments)}function j(){a.BaseUIComponent.apply(this,arguments)}var k={required:function(a){return"undefined"!=typeof a&&!/^\s*$/.test(a)},min_length:function(a,b){return"string"==typeof a&&a.length>=parseInt(b,10)},max_length:function(a,b){return"string"==typeof a&&a.length<=parseInt(b,10)},exact_length:function(a,b){return"string"==typeof a&&a.length===parseInt(b,10)},email:function(a){return"string"==typeof a&&h.mail(a)},url:function(a,b){return b=b||!1,"string"==typeof a&&h.url(a,b)},ip:function(a,b){return"string"!=typeof a?!1:h.isIP(a,b)},phone:function(a,b){if("string"!=typeof a)return!1;var c=b?b.toUpperCase():"";return h["is"+c+"Phone"](a)},credit_card:function(a,b){return"string"!=typeof a?!1:h.isCreditCard(a,b||"default")},date:function(a,b){return"string"==typeof a&&h.isDate(b,a)},alpha:function(a,b){return h.ascii(a,{singleLineWhitespace:b})},text:function(a,b,c){return h.unicode(a,{singleLineWhitespace:b,unicodePunctuation:c})},latin:function(a,b,c){return"string"!=typeof a?!1:h.latin1(a,{latin1Punctuation:b,singleLineWhitespace:c})},alpha_numeric:function(a){return h.ascii(a,{numbers:!0})},alpha_dash:function(a){return h.ascii(a,{dash:!0,underscore:!0})},digit:function(a){return"string"==typeof a&&/^[0-9]{1}$/.test(a)},integer:function(a,b){return h.number(a,{negative:!b,decimalPlaces:0})},decimal:function(a,b,c,d){return h.number(a,{decimalSep:b||".",decimalPlaces:+c||null,maxDigits:+d})},numeric:function(a,b,c,d){return b=b||".",-1!==a.indexOf(b)?k.decimal(a,b,c,d):k.integer(a)},range:function(a,b,c,d){return a=+a,b=+b,c=+c,isNaN(a)||isNaN(b)||isNaN(c)?!1:b>a||a>c?!1:d?(a-b)%d===0:!0},color:function(a){return h.isColor(a)},matches:function(a,b){return a===this.getFormElements()[b][0].getValue()}},l=new g({en_US:{"formvalidator.required":"The {field} filling is mandatory","formvalidator.min_length":"The {field} must have a minimum size of {param1} characters","formvalidator.max_length":"The {field} must have a maximum size of {param1} characters","formvalidator.exact_length":"The {field} must have an exact size of {param1} characters","formvalidator.email":"The {field} must have a valid e-mail address","formvalidator.url":"The {field} must have a valid URL","formvalidator.ip":"The {field} does not contain a valid {param1} IP address","formvalidator.phone":"The {field} does not contain a valid {param1} phone number","formvalidator.credit_card":"The {field} does not contain a valid {param1} credit card","formvalidator.date":"The {field} should contain a date in the {param1} format","formvalidator.alpha":"The {field} should only contain letters","formvalidator.text":"The {field} should only contain alphabetic characters","formvalidator.latin":"The {field} should only contain alphabetic characters","formvalidator.alpha_numeric":"The {field} should only contain letters or numbers","formvalidator.alpha_dash":"The {field} should only contain letters or dashes","formvalidator.digit":"The {field} should only contain a digit","formvalidator.integer":"The {field} should only contain an integer","formvalidator.decimal":"The {field} should contain a valid decimal number","formvalidator.numeric":"The {field} should contain a number","formvalidator.range":"The {field} should contain a number between {param1} and {param2}","formvalidator.color":"The {field} should contain a valid color","formvalidator.matches":"The {field} should match the field {param1}","formvalidator.validation_function_not_found":"The rule {rule} has not been defined"},pt_PT:{"formvalidator.required":"Preencher {field} é obrigatório","formvalidator.min_length":"{field} deve ter no mínimo {param1} caracteres","formvalidator.max_length":"{field} tem um tamanho máximo de {param1} caracteres","formvalidator.exact_length":"{field} devia ter exactamente {param1} caracteres","formvalidator.email":"{field} deve ser um e-mail válido","formvalidator.url":"O {field} deve ser um URL válido","formvalidator.ip":"{field} não tem um endereço IP {param1} válido","formvalidator.phone":"{field} deve ser preenchido com um número de telefone {param1} válido.","formvalidator.credit_card":"{field} não tem um cartão de crédito {param1} válido","formvalidator.date":"{field} deve conter uma data no formato {param1}","formvalidator.alpha":"O campo {field} deve conter apenas caracteres alfabéticos","formvalidator.text":"O campo {field} deve conter apenas caracteres alfabéticos","formvalidator.latin":"O campo {field} deve conter apenas caracteres alfabéticos","formvalidator.alpha_numeric":"{field} deve conter apenas letras e números","formvalidator.alpha_dash":"{field} deve conter apenas letras e traços","formvalidator.digit":"{field} destina-se a ser preenchido com apenas um dígito","formvalidator.integer":"{field} deve conter um número inteiro","formvalidator.decimal":"{field} deve conter um número válido","formvalidator.numeric":"{field} deve conter um número válido","formvalidator.range":"{field} deve conter um número entre {param1} e {param2}","formvalidator.color":"{field} deve conter uma cor válida","formvalidator.matches":"{field} deve corresponder ao campo {param1}","formvalidator.validation_function_not_found":"[A regra {rule} não foi definida]"}},"en_US");return i._name="FormElement_1",i._optionDefinition={label:["String",null],rules:["String",null],form:["Object"]},i.prototype={_init:function(){this._errors={},this._rules={},this._value=null,null===this._options.label&&(this._options.label=this._getLabel())},_getLabel:function(){var a=b.findUpwardsBySelector(this._element,".control-group label");return a?b.textContent(a):this._element.name||this._element.id||""},_parseRules:function(a){this._rules={},a=a.split("|");var b,c=a.length,d,e,f;if(c>0)for(b=0;c>b;b++)if(d=a[b])if(-1!==(f=d.indexOf("["))){e=d.substr(f+1),e=e.split("]"),e=e[0],e=e.split(",");for(var g=0,h=e.length;h>g;g++)e[g]="true"===e[g]?!0:"false"===e[g]?!1:e[g];e.splice(0,0,this.getValue()),d=d.substr(0,f),this._rules[d]=e}else this._rules[d]=[this.getValue()]},_addError:function(a){for(var b=this._rules[a]||[],c={field:this._options.label,value:this.getValue()},d=1;d"),this._errorMessages.push(f)},this)),!1)}},a.createUIComponent(j),j}),Ink.createModule("Ink.UI.ImageQuery","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Util.Array_1"],function(a,b,c,d){"use strict";function e(){a.BaseUIComponent.apply(this,arguments)}return e._name="ImageQuery_1",e._optionDefinition={src:["String"],retina:["String",void 0],queries:["Object"],onLoad:["Function",null]},e.prototype={_init:function(){var a;if(-1!==(a=this._element.src.lastIndexOf("?"))){var c=this._element.src.substr(a);this._filename=this._element.src.replace(c,"").split("/").pop()+c}else this._filename=this._element.src.split("/").pop();this._options.queries||(this._options.queries=[]),this._options.queries=d.sortMulti(this._options.queries,"width").reverse(),"function"==typeof this._options.onLoad&&b.observe(this._element,"onload",Ink.bindEvent(this._onLoad,this)),this._onResize(),b.observe(window,"resize",b.throttle(Ink.bindMethod(this,"_onResize"),400))},_onResize:function(){if(this._options.queries.length){var a=this._findCurrentQuery(),b=a.src||this._options.src;if(window.devicePixelRatio>1&&void 0!==this._options.retina&&(b=a.retina||this._options.retina),a.file=this._filename,"function"==typeof b&&(b=b.apply(this,[this._element,a]),"string"!=typeof b))throw'[ImageQuery] :: "src" callback does not return a string';b=b.replace(/{:(.*?)}/g,function(b,c){return a[c]}),this._element.src=b,delete a.file}},_findCurrentQuery:function(){for(var a=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,b=this._options.queries,c=b.length-1,d=0;c>d;d+=1)if(b[d].width<=a)return b[d];return b[c]},_onLoad:function(){this._options.onLoad.call(this)}},a.createUIComponent(e),e}),Ink.createModule("Ink.UI.LazyLoad","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1"],function(a,b,c){"use strict";function d(){a.BaseUIComponent.apply(this,arguments)}return d._name="LazyLoad_1",d._optionDefinition={item:["String",".lazyload-item"],placeholder:["String",null],source:["String","data-src"],destination:["String","src"],delay:["Number",100],delta:["Number",0],image:["Boolean",!0],scrollElement:["Element",window],touchEvents:["Boolean",!0],onInsideViewport:["Function",!1],onAfterAttributeChange:["Function",!1],autoInit:["Boolean",!0]},d.prototype={_init:function(){this._rootElm=this._element,this._aData=[],this._hasEvents=!1,this._options.autoInit&&this._activate()},_activate:function(){this._getData(),this._hasEvents||this._addEvents(),this._onScrollThrottled()},_getData:function(){for(var a=Ink.ss(this._options.item),b=null,d=0,e=a.length;e>d;d++)null==this._options.placeholder||c.hasAttribute(a[d],this._options.destination)||a[d].setAttribute(this._options.destination,this._options.placeholder),b=a[d].getAttribute(this._options.source),null===b&&this._options.image||this._aData.push({elm:a[d],original:b})},_addEvents:function(){this._onScrollThrottled=b.throttle(Ink.bindEvent(this._onScroll,this),this._options.delay),"ontouchmove"in document.documentElement&&this._options.touchEvents&&b.observe(document.documentElement,"touchmove",this._onScrollThrottled),b.observe(this._options.scrollElement,"scroll",this._onScrollThrottled),this._hasEvents=!0},_removeEvents:function(){"ontouchmove"in document.documentElement&&this._options.touchEvents&&b.stopObserving(document.documentElement,"touchmove",this._onScrollThrottled),b.stopObserving(this._options.scrollElement,"scroll",this._onScrollThrottled),this._hasEvents=!1},_onScroll:function(){for(var a,b=0;bthis.originalStatus[c]?this._modalDivStyle[h(c)]:Math.round(.9*b[c])+"px")},this)),this._resizeContainer(),this._reposition(),this._resizeTimeout=void 0},_onShadeClick:function(a){var f=b.element(a);if(c.hasClassName(f,"ink-close")||c.hasClassName(f,"ink-dismiss")||d.findUpwardsBySelector(f,".ink-close,.ink-dismiss")||this._options.closeOnClick&&(!d.descendantOf(this._shadeElement,f)||f===this._shadeElement)){for(var g=e.select(".ink-alert",this._shadeElement),h=g.length,i=0;h>i;i++)if(d.descendantOf(g[i],f))return;this.dismiss(),this._wasDismissed&&b.stop(a)}},_onKeyDown:function(a){27!==a.keyCode||this._wasDismissed||"true"===this._options.closeOnEscape.toString()&&k[k.length-1]===this&&(this.dismiss(),this._wasDismissed&&b.stop(a))},_resizeContainer:function(){var a=d.elementHeight(this._modalDiv);this._modalHeader=e.select(".modal-header",this._modalDiv)[0],this._modalHeader&&(a-=d.elementHeight(this._modalHeader)),this._modalFooter=e.select(".modal-footer",this._modalDiv)[0],this._modalFooter&&(a-=d.elementHeight(this._modalFooter)),this._contentContainer.style.height=a+"px",a!==d.elementHeight(this._contentContainer)&&(this._contentContainer.style.height=~~(a-(d.elementHeight(this._contentContainer)-a))+"px"),this._markupMode},open:function(a){a&&b.stop(a);var e="CSS1Compat"===document.compatMode?document.documentElement:document.body;this._resizeTimeout=null,c.addClassName(this._modalShadow,"ink-shade"),this._modalShadowStyle.display=this._modalDivStyle.display="block",setTimeout(Ink.bind(function(){c.addClassName(this._modalShadow,"visible"),c.addClassName(this._modalDiv,"visible")},this),100),this._contentElement=this._modalDiv,this._shadeElement=this._modalShadow,this._markupMode||this.setContentMarkup(this._options.markup);var i={width:-1!==(""+this._options.width).indexOf("%"),height:-1!==(""+this._options.height).indexOf("%")};f.forEach(["width","height"],Ink.bind(function(a){void 0!==this._options[a]?(this._modalDivStyle[a]=this._options[a],i[a]||(this._modalDivStyle[h(a)]=d["element"+g(a)](this._modalDiv)+"px")):this._modalDivStyle[h(a)]=d["element"+g(a)](this._modalDiv)+"px",i[a]&&parseInt(e["client"+h(a)],10)<=parseInt(this._modalDivStyle[a],10)&&(this._modalDivStyle[a]=Math.round(.9*parseInt(e["client"+h(a)],10))+"px")},this)),this.originalStatus={viewportHeight:d.elementHeight(e),viewportWidth:d.elementWidth(e),height:d.elementHeight(this._modalDiv),width:d.elementWidth(this._modalDiv)},"true"===this._options.responsive.toString()?(this._onResize(!0),b.observe(window,"resize",this._handlers.resize)):(this._resizeContainer(),this._reposition()),this._options.onShow&&this._options.onShow(this),b.observe(this._shadeElement,"click",this._handlers.click),"true"===this._options.closeOnEscape.toString()&&b.observe(document,"keydown",this._handlers.keyDown),this._wasDismissed=!1,k.push(this),c.addClassName(document.documentElement,"ink-modal-open")},dismiss:function(){if(!this._wasDismissed){if(this._options.onDismiss){var a=this._options.onDismiss(this);if(a===!1)return}if(this._wasDismissed=!0,this._options.responsive&&b.stopObserving(window,"resize",this._handlers.resize),this._markupMode?(c.removeClassName(this._modalDiv,"visible"),c.removeClassName(this._modalShadow,"visible"),this._waitForFade(this._modalShadow,Ink.bind(function(){this._modalShadowStyle.display="none"},this))):(this._modalShadow.parentNode.removeChild(this._modalShadow),this.destroy()),k=f.remove(k,f.keyValue(this,k),1),0===k.length){var d=document.documentElement;c.removeClassName(d,"ink-modal-open")}}},_waitForFade:function(a,d){if(!j)return d();for(var e=["transitionEnd","oTransitionEnd","webkitTransitionEnd"],f,g,h=0,i=e.length;i>h;h++)if(g=e[h],f="on"+g.toLowerCase(),f in a)return void b.observeOnce(a,g,d);var k=function(){+c.getStyle(a,"opacity")>0?setTimeout(k,250):d()};setTimeout(k,500)},destroy:function(){a.unregisterInstance(this._instanceId)},getContentElement:function(){return this._contentContainer},setContentMarkup:function(a){if(this._markupMode)this._contentContainer.innerHTML=a;else{if(this._modalDiv.innerHTML=[a].join(""),this._contentContainer=e.select(".modal-body",this._modalDiv),!this._contentContainer.length){var b=e.select(".modal-header",this._modalDiv),g=e.select(".modal-footer",this._modalDiv);f.each(b,d.remove),f.each(g,d.remove);var h=document.createElement("div");c.addClassName(h,"modal-body"),h.innerHTML=this._modalDiv.innerHTML,this._modalDiv.innerHTML="";var i=b.concat([h]).concat(g);f.each(i,Ink.bindMethod(this._modalDiv,"appendChild")),this._contentContainer=e.select(".modal-body",this._modalDiv)}this._contentContainer=this._contentContainer[0]}this._contentElement=this._modalDiv,this._resizeContainer()}},a.createUIComponent(i,{elementIsOptional:!0}),i}),Ink.createModule("Ink.UI.Pagination","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1"],function(a,b,c,d,e){"use strict";function f(){a.BaseUIComponent.apply(this,arguments)}var g=function(a,b,c){var d=document.createElement("a");if(d.setAttribute("href","#"),"number"==typeof b&&d.setAttribute("data-index",b),c&&c.wrapText){var e=document.createElement("span");d.appendChild(e),e.innerHTML=a}else d.innerHTML=a;return d};return f._name="Pagination_1",f._optionDefinition={size:["Integer",null],totalItemCount:["Integer",null],itemsPerPage:["Integer",null],maxSize:["Integer",null],start:["Integer",1],sideButtons:["Boolean",1],firstLabel:["String","First"],lastLabel:["String","Last"],previousLabel:["String","Previous"],nextLabel:["String","Next"],previousPageLabel:["String",null],nextPageLabel:["String",null],onChange:["Function",void 0],hashParameter:["String","page"],parentTag:["String","ul"],childTag:["String","li"],wrapperClass:["String","ink-navigation"],paginationClass:["String","pagination"],activeClass:["String","active"],disabledClass:["String","disabled"],hideClass:["String","hide-all"],previousClass:["String","previous"],previousPageClass:["String","previousPage"],nextClass:["String","next"],nextPageClass:["String","nextPage"],numberFormatter:["Function",function(a){return a+1}]},f.prototype={_init:function(){this._options.previousPageLabel||(this._options.previousPageLabel=this._options.previousLabel+" "+this._options.maxSize),this._options.nextPageLabel||(this._options.nextPageLabel=this._options.nextLabel+" "+this._options.maxSize),this._handlers={click:Ink.bindEvent(this._onClick,this)},a.isInteger(this._options.totalItemCount)&&a.isInteger(this._options.itemsPerPage)?this._size=this._calculateSize(this._options.totalItemCount,this._options.itemsPerPage):a.isInteger(this._options.size)?this._size=this._options.size:(Ink.error("Ink.UI.Pagination: Please supply a size option or totalItemCount and itemsPerPage options."),this._size=0),this._current=this._options.start-1,this._itemLiEls=[],this._generateMarkup(this._element),this._updateItems(),this._observe()},_observe:function(){b.observeDelegated(this._element,"click","."+this._options.paginationClass+" > "+this._options.childTag,this._handlers.click) +},_calculateSize:function(a,b){return Math.ceil(a/b)},_updateItems:function(){var a=this._itemLiEls,b=this._size===a.length,d,e,f;if(b)for(d=0,e=this._size;e>d;++d)c.setClassName(a[d],this._options.activeClass,d===this._current);else{for(d=a.length-1;d>=0;--d)this._ulEl.removeChild(a[d]);for(a=[],d=0,e=this._size;e>d;++d)f=document.createElement(this._options.childTag),f.appendChild(g(this._options.numberFormatter(d),d)),c.setClassName(f,this._options.activeClass,d===this._current),this._nextEl?this._ulEl.insertBefore(f,this._nextEl):this._ulEl.appendChild(f),a.push(f);this._itemLiEls=a}if(this._options.maxSize){var h=Math.floor(this._current/this._options.maxSize),i=this._options.maxSize*h,j=i+this._options.maxSize-1;for(d=0,e=this._size;e>d;++d)f=a[d],c.setClassName(f,this._options.hideClass,i>d||d>j);this._pageStart=i,this._pageEnd=j,this._page=h,c.setClassName(this._prevPageEl,this._options.disabledClass,!this.hasPreviousPage()),c.setClassName(this._nextPageEl,this._options.disabledClass,!this.hasNextPage()),c.setClassName(this._firstEl,this._options.disabledClass,this.isFirst()),c.setClassName(this._lastEl,this._options.disabledClass,this.isLast())}this._prevEl&&c.setClassName(this._prevEl,this._options.disabledClass,!this.hasPrevious()),this._nextEl&&c.setClassName(this._nextEl,this._options.disabledClass,!this.hasNext())},_generateMarkup:function(a){c.addClassName(a,"ink-navigation");var b=Ink.s("."+this._options.paginationClass,a),d=!1;b?d=!0:(b=document.createElement(this._options.parentTag),c.addClassName(b,this._options.paginationClass));var e=c.hasClassName(b,"chevron"),f=c.hasClassName(b,"dotted"),h=Ink.bind(function(a,d){var e=document.createElement(this._options.childTag),f=g(this._options[a+"Label"],void 0,{wrapText:d&&d.wrapText});return c.addClassName(e,this._options[a+"Class"]),e.appendChild(f),b.appendChild(e),e},this);!f&&this._options.maxSize&&(this._firstEl=h("first"),this._prevPageEl=h("previousPage")),(f&&this._options.sideButtons===!0||!f&&this._options.sideButtons)&&(this._prevEl=h("previous",{wrapText:e}),this._nextEl=h("next",{wrapText:e})),!f&&this._options.maxSize&&(this._nextPageEl=h("nextPage"),this._lastEl=h("last")),d||a.appendChild(b),this._ulEl=b},_onClick:function(a){b.stop(a);var d=b.element(a);if(!c.hasClassName(d,this._options.activeClass)&&!c.hasClassName(d,this._options.disabledClass)){var f=c.hasClassName(d,this._options.previousClass),g=c.hasClassName(d,this._options.nextClass),h=c.hasClassName(d,this._options.previousPageClass),i=c.hasClassName(d,this._options.nextPageClass),j=c.hasClassName(d,this._options.firstClass),k=c.hasClassName(d,this._options.lastClass);if(j)this.setCurrent(0);else if(k)this.setCurrent(this._size-1);else if(h||i)this.setCurrent((h?-1:1)*this._options.maxSize,!0);else if(f||g)this.setCurrent(f?-1:1,!0);else{var l=e.select("[data-index]",d)[0],m=l&&parseInt(l.getAttribute("data-index"),10);this.setCurrent(m)}}},setOnChange:function(a){if(void 0!==a&&"function"!=typeof a)throw new TypeError("onChange option must be a function!");this._options.onChange=a},setSize:function(b){if(!a.isInteger(b))throw new TypeError("1st argument must be an integer number!");this._size=b,this._updateItems(),this._current=0},setSizeInItems:function(a,b){var c=Math.ceil(a/b);this.setSize(c)},setCurrent:function(b,c){if(!a.isInteger(b))throw new TypeError("1st argument must be an integer number!");c&&(b+=this._current),b>this._size-1&&(b=this._size-1),0>b&&(b=0),this._current=b,this._updateItems(),this._options.onChange&&this._options.onChange(this,b)},getSize:function(){return this._size},getCurrent:function(){return this._current},isFirst:function(){return 0===this._current},isLast:function(){return this._current===this._size-1},hasPrevious:function(){return this._current>0},hasNext:function(){return this._currentthis._options.maxSize-1},hasNextPage:function(){return this._options.maxSize&&this._size-this._current>=this._options.maxSize+1},destroy:a.destroyComponent},a.createUIComponent(f),f}),Ink.createModule("Ink.UI.ProgressBar","1",["Ink.UI.Common_1","Ink.Dom.Selector_1"],function(a,b){"use strict";function c(){a.BaseUIComponent.apply(this,arguments)}return c._name="ProgressBar_1",c._optionDefinition={startValue:["Number",0],onStart:["Function",function(){}],onEnd:["Function",function(){}]},c.prototype={_init:function(){if(this._value=this._options.startValue,this._elementBar=b.select(".bar",this._element),this._elementBar.length<1)throw new Error("[Ink.UI.ProgressBar] :: Bar element not found");this._elementBar=this._elementBar[0],this.setValue(this._options.startValue)},setValue:function(a){this._options.onStart.call(this,this._value),a=parseInt(a,10),isNaN(a)||0>a?a=0:a>100&&(a=100),this._value=a,this._elementBar.style.width=this._value+"%",this._options.onEnd.call(this,this._value)}},a.createUIComponent(c),c}),Ink.createModule("Ink.UI.SmoothScroller","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Dom.Css_1"],function(a,b,c,d,e){"use strict";var f=window.requestAnimationFrame||function(a){return setTimeout(a,10)},g=window.cancelAnimationFrame||function(a){clearTimeout(a)},h={speed:10,changeHash:!0,margin:0,scroll:function(a,b){var d=Math.round(c.scrollHeight()),e=Math.round(a-b.margin);d+=e>d?Math.ceil((e-d)/b.speed):(e-d)/b.speed,g(h.interval),d!==e&&h.offsetTop!==d?h.interval=f(Ink.bindMethod(h,"scroll",a,b),document.body):h.onDone(b),window.scrollTo(0,d),h.offsetTop=d},init:function(a){b.on(document,"click",a||"a.scrollableLink, a.ink-smooth-scroll",h.onClick)},render:function(){},onClick:function(b){var d=b.currentTarget,f=(location+"").replace(/#.*?$/,""),g=(d.href+"").replace(/#.*?$/,"");if(g===f){var i=d.getAttribute("data-hash")||(d.getAttribute("href")||"").replace(/^.*?#/,"");if(i){b.preventDefault();var j="ul > li.active > "+k,k='a[name="'+i+'"],#'+i,l=Ink.s(k),m=Ink.s(j);if(m=m&&m.parentNode,l){e.hasClassName(d.parentNode,"active")||(m&&e.removeClassName(m,"active"),e.addClassName(d.parentNode,"active"));var n=a.options("SmoothScroller link options",{margin:["Number",h.margin],speed:["Number",h.speed],changeHash:["Boolean",h.changeHash]},{},d);h.hash=i,h.scroll(c.offsetTop(l),n)}}}},onDone:function(a){a.changeHash===!0&&(window.location.hash=h.hash),h.hash=h.offsetTop=null}};return h}),Ink.createModule("Ink.UI.SortableList","1",["Ink.UI.Common_1","Ink.Dom.Css_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Selector_1"],function(a,b,c,d,e){"use strict";function f(){a.BaseUIComponent.apply(this,arguments)}var g="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;return f._name="SortableList_1",f._optionDefinition={placeholderClass:["String","placeholder"],draggedClass:["String","hide-all"],draggingClass:["String","dragging"],dragSelector:["String","li"],dragObject:["String",null],handleSelector:["String",null],moveSelector:["String",!1],swap:["Boolean",!1],cancelMouseOut:["Boolean",!1],onDrop:["Function",function(){}]},f.prototype={_init:function(){null!=this._options.dragObject&&(Ink.warn("Ink.UI.SortableList: options.dragObject is now deprecated. Please use options.handleSelector instead."),this._options.handleSelector=this._options.handleSelector||this._options.dragObject),this._handlers={down:Ink.bind(this._onDown,this),move:Ink.bind(this._onMove,this),up:Ink.bind(this._onUp,this)},this._isMoving=!1,this._down=g?"touchstart mousedown":"mousedown",this._move=g?"touchmove mousemove":"mousemove",this._up=g?"touchend mouseup":"mouseup",this._observe()},_observe:function(){c.on(this._element,this._down,this._options.dragSelector,this._handlers.down),c.on(this._element,this._move,this._options.dragSelector,this._handlers.move),this._options.cancelMouseOut&&c.on(this._element,"mouseleave",Ink.bind(this.stopMoving,this)),c.on(document.documentElement,this._up,this._handlers.up)},_onDown:function(a){if(!(this._isMoving||this._placeholder||this._options.handleSelector&&!e.matchesSelector(a.target,this._options.handleSelector))){var b=a.currentTarget;return this._isMoving=b,this._placeholder=b.cloneNode(!0),this._movePlaceholder(b),this._addMovingClasses(),!1}},_onMove:function(a){var b=a.currentTarget;if("touchmove"===a.type){var c=a.touches[0];b=document.elementFromPoint(c.clientX,c.clientY),b=d.findUpwardsBySelector(b,this._options.dragSelector)}this.validateMove(b),a.preventDefault()},_onUp:function(a){return this._isMoving&&this._placeholder&&a.currentTarget!==this._isMoving&&a.currentTarget!==this._placeholder?(d.insertBefore(this._isMoving,this._placeholder),this.stopMoving(),this._options.onDrop.call(this,{droppedElement:a.currentTarget}),!1):void 0},_addMovingClasses:function(){b.addClassName(this._placeholder,this._options.placeholderClass),b.addClassName(this._isMoving,this._options.draggedClass),b.addClassName(document.documentElement,this._options.draggingClass)},_removeMovingClasses:function(){this._isMoving&&b.removeClassName(this._isMoving,this._options.draggedClass),this._placeholder&&b.removeClassName(this._placeholder,this._options.placeholderClass),b.removeClassName(document.documentElement,this._options.draggingClass)},_movePlaceholder:function(a){var b=this._placeholder,c,e,f,g;b?this._options.swap?(d.insertAfter(b,a),d.insertBefore(a,this._isMoving),d.insertBefore(this._isMoving,b)):(c=d.offset(a),e=d.offset(this._placeholder),f=c[1]>e[1],g=c[0]>e[0],f&&g||!f&&!g?d.insertBefore(b,a):d.insertAfter(b,a),d.insertBefore(this._isMoving,b)):d.insertAfter(b,a)},destroy:a.destroyComponent,stopMoving:function(){this._removeMovingClasses(),d.remove(this._placeholder),this._placeholder=!1,this._isMoving=!1},validateMove:function(a){a&&this._isMoving&&this._placeholder&&a!==this._placeholder&&a!==this._isMoving&&(!this._options.moveSelector||e.matchesSelector(a,this._options.moveSelector)?this._movePlaceholder(a):this.stopMoving())}},a.createUIComponent(f),f}),Ink.createModule("Ink.UI.Spy","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1"],function(a,b,c,d,e){"use strict";function f(a){for(var b=0,c=m.length;c>b;b++)if(m[b][0]===a)return b;return null}function g(a,b){var c=f(b);null===c?m.push([b,[a]]):m[c][1].push(a)}function h(){n||(n=!0,b.observe(document,"scroll",b.throttle(i,300)))}function i(){for(var a=0,b=m.length;b>a;a++)j(m[a][0],m[a][1])}function j(a,b){for(var f=k(b),g=e.select("li.active",a),h=0,i=g.length;i>h;h++)c.removeClassName(g[h],"active");if(null!==f){var j='a[href$="#'+(f.name||f.id)+'"]',l=e.select(j,a);for(h=0,i=l.length;i>h;h++)c.addClassName(d.findUpwardsByTag(l[h],"li"),"active")}}function k(a){for(var b=-1/0,c,d,e=0,f=a.length;f>e;e++)d=a[e].getBoundingClientRect(),d.top<=0&&d.top>b&&(b=d.top,c=e);return void 0===c?null:a[c]}function l(){a.BaseUIComponent.apply(this,arguments)}var m=[],n=!1;return l._name="Spy_1",l._optionDefinition={target:["Element",void 0],activeClass:["String","active"]},l.prototype={_init:function(){g(this._element,this._options.target),h(),i()}},a.createUIComponent(l),l}),Ink.createModule("Ink.UI.Stacker",1,["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1"],function(a,b,c){"use strict";function d(){a.BaseUIComponent.apply(this,arguments)}return d._name="Stacker_1",d._optionDefinition={column:["String",".stacker-column"],item:["String",".stacker-item"],customBreakPoints:["Object",null],largeMax:["Number",Number.MAX_VALUE],largeMin:["Number",961],mediumMax:["Number",960],mediumMin:["Number",651],smallMax:["Number",650],smallMin:["Number",0],largeCols:["Integer",3],mediumCols:["Integer",2],smallCols:["Integer",1],isOrdered:["Boolean",!0],onRunCallback:["Function",null],onResizeCallback:["Function",null],onAPIReloadCallback:["Function",null]},d.prototype={_init:function(){this._aList=[],this._curLayout="large",this._runFirstTime=!1,this._getPageItemsToList(),(this._canApplyLayoutChange()||!this._runFirstTime)&&(this._runFirstTime=!0,this._applyLayoutChange(),"function"==typeof this._options.onRunCallback&&this._options.onRunCallback(this._curLayout)),this._addEvents()},addItem:function(a){this._aList.push(a)},reloadItems:function(){this._applyLayoutChange(),"function"==typeof this._options.onAPIReloadCallback&&this._options.onAPIReloadCallback(this._curLayout)},_addEvents:function(){b.observe(window,"resize",Ink.bindEvent(this._onResize,this))},_onResize:function(){this._canApplyLayoutChange()&&(this._removeDomItems(),this._applyLayoutChange(),"function"==typeof this._options.onResizeCallback&&this._options.onResizeCallback(this._curLayout))},_setCurLayout:function(){var a=c.viewportWidth();if(this._options.customBreakpoints&&"object"==typeof this._options.customBreakPoints){for(var b in this._options.customBreakPoints)if(this._options.customBreakPoints.hasOwnProperty(b)&&a>=Number(this._options.customBreakPoints[b].min)&&a<=Number(this._options.customBreakPoints[b].max)&&this._curLayout!==b)return void(this._curLayout=b)}else a<=Number(this._options.largeMax)&&a>=Number(this._options.largeMin)&&"large"!==this._curLayout?this._curLayout="large":a>=Number(this._options.mediumMin)&&a<=Number(this._options.mediumMax)&&"medium"!==this._curLayout?this._curLayout="medium":a>=Number(this._options.smallMin)&&a<=Number(this._options.smallMax)&&"small"!==this._curLayout&&(this._curLayout="small")},_getColumnsToShow:function(){return Number(this._options.customBreakPoints&&"object"==typeof this._options.customBreakPoints?this._options.customBreakPoints[this._curLayout].cols:this._options[this._curLayout+"Cols"])},_canApplyLayoutChange:function(){var a=this._curLayout;return this._setCurLayout(),a!==this._curLayout?!0:!1},_getPageItemsToList:function(){this._aColumn=Ink.ss(this._options.column,this._element);var a=this._aColumn.length,b=0;if(a>0){for(var c=0;c0&&this._options.isOrdered){for(var f=[],g=0;g0)for(var b=0;a>b;b++)for(var c=Ink.ss(this._options.item,this._aColumn[b]),d=c.length-1;d>=0;d--)c[d].parentNode.removeChild(c[d])},_applyLayoutChange:function(){var a=this._getColumnsToShow(),b=this._aList.length,c=0,d=0;if(a>0)for(;a>d;){if(this._aColumn[d].appendChild(this._aList[c]),c++,d++,c===b)return;d===a&&(d=0)}}},a.createUIComponent(d),d}),Ink.createModule("Ink.UI.Sticky","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Css_1"],function(a,b,c,d){"use strict";function e(){a.BaseUIComponent.apply(this,arguments)}return e._name="Sticky_1",e._optionDefinition={offsetBottom:["Integer",0],offsetTop:["Integer",0],topElement:["Element",null],wrapperClass:["String","ink-sticky-wrapper"],stickyClass:["String","ink-sticky-stuck"],inlineDimensions:["Boolean",!0],inlinePosition:["Boolean",!0],bottomElement:["Element",null],activateInLayouts:["String","tiny,small,medium,large,xlarge"]},e.prototype={_init:function(){this._options.activateInLayouts=this._options.activateInLayouts.toString(),this._dims=null,this._options.offsetTop=parseInt(this._options.offsetTop,10)||0,this._options.offsetBottom=parseInt(this._options.offsetBottom,10)||0,this._options.topElement&&(this._options.topElement=a.elOrSelector(this._options.topElement,"Top Element")),this._options.bottomElement&&(this._options.bottomElement=a.elOrSelector(this._options.bottomElement,"Sticky bottom Element")),this._wrapper=c.create("div",{className:this._options.wrapperClass}),c.wrap(this._element,this._wrapper);var d=document.addEventListener?document:window;this._onScroll=Ink.bind(b.throttle(this._onScroll,33),this),b.observe(d,"scroll",this._onScroll),b.observe(window,"resize",Ink.bindEvent(b.throttle(this._onResize,100),this)),this._onScroll()},_isDisabledInLayout:function(){var b=a.currentLayout();return b?-1===this._options.activateInLayouts.indexOf(b):!1},_onScroll:function(){var a=this._getDims(),b=c.scrollHeight(),d=this._isDisabledInLayout()||b<=a.top-this._options.offsetTop||this._options.topElement&&this._options.topElement.getBoundingClientRect().bottom+this._options.offsetTop>0;if(d)return void this._unstick();var e=this._options.offsetTop+a.height+c.scrollHeight(),f=document.body.scrollHeight;this._options.bottomElement&&(f=this._options.bottomElement.getBoundingClientRect().top+c.scrollHeight()),f-=this._options.offsetBottom,this._stickTo(f>e?"screen":"bottom")},_stickTo:function(a){var b=this._element.style,e=this._getDims();if(d.addClassName(this._element,this._options.stickyClass),this._wrapper.style.height=e.height+"px",this._inlineDimensions(e.height+"px",e.width+"px"),this._options.inlinePosition!==!1)if(b.left=e.left+"px","screen"===a)b.bottom=null,b.top=this._options.offsetTop+"px";else if("bottom"===a){var f=this._getBottomOffset(),g=c.scrollHeight()+c.viewportHeight(),h=c.pageHeight()-g;b.bottom=f-h+"px",b.top="auto"}},_unstick:function(){d.removeClassName(this._element,this._options.stickyClass),this._inlineDimensions(null,null),this._options.inlinePosition&&(this._element.style.left=null,this._element.style.top=null,this._element.style.bottom=null),this._wrapper.style.height=null,this._wrapper.style.width=null,this._dims=null},_onResize:function(){this._dims=null,this._onScroll()},_getDims:function(){if(null!==this._dims)return this._dims;var a=this._element.style,b=a.position,d=a.width;a.position="static",a.width=null;var e=c.outerDimensions(this._element),f=this._wrapper.getBoundingClientRect();return this._dims={height:e[1],width:e[0],left:f.left+c.scrollWidth(),top:f.top+c.scrollHeight()},a.position=b,a.width=d,this._dims},_inlineDimensions:function(a,b){this._options.inlineDimensions&&(this._element.style.height=a,this._element.style.width=b)},_getBottomOffset:function(){var a=this._options.offsetBottom;return this._options.bottomElement&&(a+=c.pageHeight()-c.offsetTop(this._options.bottomElement)),a}},a.createUIComponent(e),e}),Ink.createModule("Ink.UI.Swipe","1",["Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.UI.Common_1"],function(a,b,c){"use strict";function d(){"function"==typeof arguments[1]&&(arguments[1]={onEnd:arguments[1]}),c.BaseUIComponent.apply(this,arguments)}return d._name="Swipe_1",d._optionDefinition={onEnd:["Function",void 0],onStart:["Function",void 0],onMove:["Function",void 0],minDist:["Number",void 0],maxDist:["Number",void 0],minDuration:["Number",void 0],maxDuration:["Number",void 0],axis:["String",void 0],storeGesture:["Boolean",!1],stopEvents:["Boolean",!0]},d.prototype={_supported:"ontouchstart"in document.documentElement,_init:function(){this._handlers={down:Ink.bindEvent(this._onDown,this),move:Ink.bindEvent(this._onMove,this),up:Ink.bindEvent(this._onUp,this)};var b=document.body;a.observe(b,"touchstart",this._handlers.down),(this._options.storeGesture||this._options.onMove)&&a.observe(b,"touchmove",this._handlers.move),a.observe(b,"touchend",this._handlers.up),this._isOn=!1},_isMeOrParent:function(a,b){if(a){do{if(a===b)return!0;a=a.parentNode}while(a);return!1}},_pushGesture:function(a,b){this._options.storeGesture&&(this._gesture.push(a),this._time.push(b))},_onDown:function(b){1===b.changedTouches.length&&this._isMeOrParent(b.target,this._element)&&(this._options.stopEvents===!0&&a.stop(b),b=b.changedTouches[0],this._isOn=!0,this._target=b.target,this._t0=+new Date,this._p0=[b.pageX,b.pageY],this._options.storeGesture&&(this._gesture=[],this._time=[]),this._pushGesture(this._p0,0),this._options.onStart&&this._options.onStart({event:b,element:this._element,instance:this,position:this._p0,dt:0}))},_onMove:function(b){if(this._isOn&&1===b.changedTouches.length){this._options.stopEvents===!0&&a.stop(b),b=b.changedTouches[0];var c=+new Date,d=c-this._t0,e=[b.pageX,b.pageY];this._pushGesture(e,d),this._options.onMove&&this._options.onMove({event:b,element:this._element,instance:this,position:e,dt:d})}},_onUp:function(b){if(this._isOn&&1===b.changedTouches.length){this._options.stopEvents===!0&&a.stop(b),b=b.changedTouches[0],this._isOn=!1;var c=+new Date,d=[b.pageX,b.pageY],e=c-this._t0,f=[d[0]-this._p0[0],d[1]-this._p0[1]],g=Math.sqrt(f[0]*f[0]+f[1]*f[1]),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",i=this._options;i.minDist&&gi.maxDist||i.minDuration&&ei.maxDuration||i.axis&&h!==i.axis||this._options.onEnd&&this._options.onEnd({event:b,element:this._element,instance:this,gesture:this._gesture,time:this._time,axis:h,overallMovement:f,overallTime:e})}}},c.createUIComponent(d),d}),Ink.createModule("Ink.UI.Table","1",["Ink.Util.Url_1","Ink.UI.Pagination_1","Ink.Net.Ajax_1","Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1","Ink.Util.String_1","Ink.Util.Json_1"],function(a,b,c,d,e,f,g,h,i,j,k){"use strict";function l(a){return!isNaN(a)&&r.test(a)?parseInt(a,10):isNaN(a)?a:parseFloat(a)}function m(a,b){return a===b?0:a>b?1:-1}function n(a,b){var c=l(g.textContent(a)),d=l(g.textContent(b));return m(c,d)}function o(a){if("undefined"!=typeof Object.keys)return Object.keys(a);var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b}function p(){d.BaseUIComponent.apply(this,arguments)}function q(a){return a}var r=/\d/g;return p._name="Table_1",p._optionDefinition={pageSize:["Integer",null],caretUpClass:["String","fa fa-caret-up"],caretDownClass:["String","fa fa-caret-down"],endpoint:["String",null],createEndpointUrl:["Function",null],getDataFromEndPoint:["Function",null],processJSONRows:["Function",q],processJSONRow:["Function",q],processJSONField:["Function",q],processJSONHeaders:["Function",function(a){return a.fields}],processJSONTotalRows:["Function",function(a){return a.length||a.totalRows}],getSortKey:["Function",null],pagination:["Element",null],allowResetSorting:["Boolean",!1],visibleFields:["String",null],tdClassNames:["Object",{}],paginationOptions:["Object",null]},p.prototype={_validate:function(){if("table"!==this._element.nodeName.toLowerCase())throw new Error("[Ink.UI.Table] :: The element is not a table")},_init:function(){this._markupMode=!this._options.endpoint,this._options.visibleFields&&(this._options.visibleFields=this._options.visibleFields.toString().split(/[, ]+/g)),this._thead=this._element.tHead||this._element.createTHead(),this._headers=h.select("th",this._thead),this._handlers={thClick:null},this._originalFields=[],this._sortableFields={},this._originalData=this._data=[],this._pagination=null,this._totalRows=0,this._handlers.thClick=e.observeDelegated(this._element,"click",'thead th[data-sortable="true"]',Ink.bindMethod(this,"_onThClick")),this._markupMode?(this._resetSortOrder(),this._addHeadersClasses(),this._data=h.select("tbody tr",this._element),this._originalData=this._data.slice(0),this._totalRows=this._data.length,this._setPagination()):this._getData()},_addHeadersClasses:function(){for(var a,b,c=0,d=this._headers.length;d>c;c++)a=g.textContent(this._headers[c]),b=this._options.tdClassNames[a],b&&f.addClassName(this._headers[c],b)},_onThClick:function(a){var b=e.element(a),c=void 0!==this._options.pageSize;e.stop(a);var f=i.keyValue(b,this._headers,!0),g=f!==!1&&void 0!==this._sortableFields[f];if(g)if(!this._markupMode&&c)this._invertSortOrder(f,!1);else{"desc"===this._sortableFields[f]&&this._options.allowResetSorting?(this._setSortOrderOfColumn(f,null),this._data=this._originalData.slice(0)):this._invertSortOrder(f,!0);var j=h.select("tbody",this._element)[0];d.cleanChildren(j),i.each(this._data,Ink.bindMethod(j,"appendChild")),this._pagination&&(this._pagination.setCurrent(0),this._paginate(1))}},_invertSortOrder:function(a,b){for(var c="asc"===this._sortableFields[a],d=0,e=this._headers.length;e>d;d++)this._setSortOrderOfColumn(d,null);b&&(this._sort(a),c&&this._data.reverse()),this._setSortOrderOfColumn(a,!c)},_setSortOrderOfColumn:function(a,b){var c=this._headers[a],d=[""],e="none";b===!0?(d=[''],e="asc"):b===!1&&(d=[''],e="desc"),this._sortableFields[a]=e,c.innerHTML=g.textContent(c)+d.join("")},_paginate:function(a){if(this._pagination){var b=this._options.pageSize,c=(a-1)*b,d=c+b;i.each(this._data,function(a,b){b>=c&&d>b?f.removeClassName(a,"hide-all"):f.addClassName(a,"hide-all")})}},_registerFieldNames:function(a){this._originalFields=[],i.forEach(a,Ink.bind(function(a){this._fieldIsVisible(a)&&this._originalFields.push(a)},this))},_fieldIsVisible:function(a){return!this._options.visibleFields||-1!==this._options.visibleFields.indexOf(a)},_sort:function(a){function b(b){return d.call(e,{columnIndex:a,columnName:c,data:g.textContent(b),element:b})}var c=g.textContent(this._headers[a]),d=this._options.getSortKey;d&&(d="function"==typeof d[c]?d[c]:"function"==typeof d?d:null);var e=this;this._data.sort(function(c,e){var f=Ink.ss("td",c)[a],g=Ink.ss("td",e)[a];return d?m(b(f),b(g)):n(f,g,a)})},_createHeadersFromJson:function(a){if(this._registerFieldNames(o(a)),!this._thead.children.length)for(var b=this._thead.insertRow(0),c,d=0,e=a.length;e>d;d++)this._fieldIsVisible(a[d])&&(c=g.create("th"),c=this._createSingleHeaderFromJson(a[d],c),b.appendChild(c),this._headers.push(c))},_createSingleHeaderFromJson:function(a,b){return a.sortable&&b.setAttribute("data-sortable","true"),a.label&&g.setTextContent(b,a.label),b},_resetSortOrder:function(){for(var a=0,b=this._headers.length;b>a;a++){var c=g.data(this._headers[a]);c.sortable&&"true"===c.sortable.toString()&&(this._sortableFields[a]="none")}},_createRowsFromJSON:function(a){var b=h.select("tbody",this._element)[0];b?g.setHTML(b,""):(b=document.createElement("tbody"),this._element.appendChild(b)),this._data=[];var c;for(var d in a)a.hasOwnProperty(d)&&(c=this._options.processJSONRow(a[d]),this._createSingleRowFromJson(b,c,d));this._originalData=this._data.slice(0)},_createSingleRowFromJson:function(a,b,c){var d=document.createElement("tr");a.appendChild(d);for(var e in b)b.hasOwnProperty(e)&&this._createFieldFromJson(d,b[e],e,c);this._data.push(d)},_createFieldFromJson:function(a,b,c,d){if(this._fieldIsVisible(c)){var e=this._options.processJSONField[c]||this._options.processJSONField,g;g="function"==typeof e?e(b,c,d):b;var h=this._elOrFieldData(g),i=this._options.tdClassNames[c];i&&f.addClassName(h,i),a.appendChild(h)}},_elOrFieldData:function(a){if(d.isDOMElement(a))return a;var b="string"==typeof a,c="number"==typeof a,e=g.create("td");if(b&&/^\s*? li.active",this._menu),g=0,h=f.length;h>g;g++)f[g]!==a&&c.removeClassName(f[g],"active");return this._activeMenuTab&&(c.removeClassName(this._activeMenuTab,"active"),c.removeClassName(this._activeSection,"active"),c.addClassName(this._activeSection,"hide-all")),this._activeMenuLink=a,this._activeMenuTab=this._activeMenuLink.parentNode,this._activeSection=e.select(d.substr(d.indexOf("#")),this._element)[0],this._activeSection?(c.addClassName(this._activeMenuTab,"active"),c.addClassName(this._activeSection,"active"),c.removeClassName(this._activeSection,"hide-all"),void(b&&"undefined"!=typeof this._options.onChange&&this._options.onChange(this))):void(this._activeMenuLink=this._activeMenuTab=this._activeSection=null)},_onTabClickedGeneric:function(a){a.preventDefault(),c.hasClassName(a.currentTarget,"ink-disabled")||this._onTabClicked(a.currentTarget)},_onTabClicked:function(a){var b=a.getAttribute("href");b=b.substr(b.indexOf("#")),b&&null!==Ink.i(this._dehashify(b))&&(this._options.preventUrlChange||(window.location.hash=b),a!==this._activeMenuLink&&this.changeTab(a))},_onResize:function(){var b=a.currentLayout();if(b!==this._lastLayout){var d=b===a.Layouts.TINY||b===a.Layouts.SMALL||b===a.Layouts.MEDIUM; +d?(c.removeClassName(this._menu,"menu"),c.removeClassName(this._menu,"horizontal")):(c.addClassName(this._menu,"menu"),c.addClassName(this._menu,"horizontal")),this._lastLayout=b}},_hashify:function(a){return a?0===a.indexOf("#")?a:"#"+a:""},_dehashify:function(a){return a?(""+a).replace(/^#/,""):""},_findLinkByHref:function(a){if(!a)return null;if(1===a.nodeType){if(d.isAncestorOf(a,this._element))return null;for(var b=e.select("a",this._menu),c=a.getAttribute("id"),f=0,g=b.length;g>f;f++){if(b[f]===a||d.isAncestorOf(a,b[f]))return b[f];if(c&&c===this._dehashify(b[f].getAttribute("href")))return b[f]}return null}return a=this._hashify(a),e.select('a[href$="'+a+'"]',this._menu)[0]||null},changeTab:function(a){a=this._findLinkByHref(a),a&&!c.hasClassName(a,"ink-disabled")&&this._changeTab(a,!0)},disable:function(a){c.addClassName(this._findLinkByHref(a),"ink-disabled")},enable:function(a){c.removeClassName(this._findLinkByHref(a),"ink-disabled")},activeTab:function(){return this._activeSection.getAttribute("id")},activeMenuTab:function(){return Ink.warn("Ink.UI.Tabs.activeMenuTab() is deprecated"),this._activeMenuTab},activeMenuLink:function(){return this._activeMenuLink},activeSection:function(){return this._activeSection},activeContentTab:function(){return Ink.warn("Ink.UI.Tabs.activeContentTab() is deprecated. Use activeSection instead."),this._activeSection()},destroy:a.destroyComponent},a.createUIComponent(f),f}),Ink.createModule("Ink.UI.TagField","1",["Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Browser_1","Ink.UI.Droppable_1","Ink.Util.Array_1","Ink.Dom.Selector_1","Ink.UI.Common_1"],function(a,b,c,d,e,f,g,h){"use strict";function i(){h.BaseUIComponent.apply(this,arguments)}var j=13,k=8,l=function(a){return!!a};return i._name="TagField_1",i._optionDefinition={tags:["String",[]],tagQuery:["Object",null],tagQueryAsync:["Object",null],allowRepeated:["Boolean",!1],maxTags:["Integer",-1],outSeparator:["String",","],separator:["String",/[,; ]+/g],autoSplit:["Boolean",!0]},i.prototype={_init:function(){var d=this._options;"string"==typeof d.separator&&(d.separator=new RegExp(d.separator,"g")),"string"==typeof d.tags&&(d.tags=this._readInput(d.tags)),c.addClassName(this._element,"hide-all"),this._viewElm=a.create("div",{className:"ink-tagfield",insertAfter:this._element}),this._input=a.create("input",{type:"text",className:"new-tag-input",insertBottom:this._viewElm});var e=[].concat(d.tags,this._tagsFromMarkup(this._element));this._tags=[],f.each(e,Ink.bindMethod(this,"_addTag")),b.observe(this._input,"keyup",Ink.bindEvent(this._onKeyUp,this)),b.observe(this._input,"change",Ink.bindEvent(this._onKeyUp,this)),b.observe(this._input,"keydown",Ink.bindEvent(this._onKeyDown,this)),b.observe(this._input,"blur",Ink.bindEvent(this._onBlur,this)),b.observe(this._viewElm,"click",Ink.bindEvent(this._refocus,this))},destroy:function(){a.remove(this._viewElm),c.removeClassName(this._element,"hide-all")},_tagsFromMarkup:function(b){var c=b.tagName.toLowerCase();if("input"===c)return this._readInput(b.value);if("select"===c)return f.map(b.getElementsByTagName("option"),function(b){return a.textContent(b)});throw new Error("Cannot read tags from a "+c+" tag. Unknown tag")},_tagsToMarkup:function(b,c){var d=c.tagName.toLowerCase();if("input"===d)this._options.separator&&(c.value=b.join(this._options.outSeparator));else{if("select"!==d)throw new Error("TagField: Cannot read tags from a "+d+" tag. Unknown tag");c.innerHTML="",f.each(b,function(b){var d=a.create("option",{selected:"selected"});a.setTextContent(d,b),c.appendChild(d)})}},_addTag:function(c){if(!(-1!==this._options.maxTags&&this._tags.length>=this._options.maxTags)){if(!this._options.allowRepeated&&f.inArray(c,this._tags,c)||!c)return!1;var d=a.create("span",{className:"ink-tag",setTextContent:c+" "}),e=a.create("span",{className:"remove fa fa-times",insertBottom:d});b.observe(e,"click",Ink.bindEvent(this._removeTag,this,null));var g=document.createTextNode(" ");this._tags.push(c),this._viewElm.insertBefore(d,this._input),this._viewElm.insertBefore(g,this._input),this._tagsToMarkup(this._tags,this._element)}},_readInput:function(a){return this._options.separator?f.filter(a.split(this._options.separator),l):[a]},_onKeyUp:function(){if(this._options.autoSplit){var a=this._input.value.split(this._options.separator);if(!(a.length<=1)){var b=a[a.length-1];a=a.splice(0,a.length-1),a=f.filter(a,l),f.each(a,Ink.bind(this._addTag,this)),this._input.value=b}}},_onKeyDown:function(a){return a.which===j?this._onEnterKeyDown(a):a.which===k?this._onBackspaceKeyDown():void(this._removeConfirm&&this._unsetRemovingVisual(this._tags.length-1))},_onBackspaceKeyDown:function(){this._input.value||(this._removeConfirm?(this._unsetRemovingVisual(this._tags.length-1),this._removeTag(this._tags.length-1),this._removeConfirm=null):this._setRemovingVisual(this._tags.length-1))},_onEnterKeyDown:function(a){var c=this._input.value;c&&(this._addTag(c),this._input.value=""),b.stopDefault(a)},_onBlur:function(){this._addTag(this._input.value),this._input.value=""},_setRemovingVisual:function(a){var d=this._viewElm.children[a];d&&(c.addClassName(d,"tag-deleting"),this._removeRemovingVisualTimeout=setTimeout(Ink.bindMethod(this,"_unsetRemovingVisual",a),4e3),b.observe(this._input,"blur",Ink.bindMethod(this,"_unsetRemovingVisual",a)),this._removeConfirm=!0)},_unsetRemovingVisual:function(a){var b=this._viewElm.children[a];b&&(c.removeClassName(b,"tag-deleting"),clearTimeout(this._removeRemovingVisualTimeout)),this._removeConfirm=null},_removeTag:function(c){var d;if("object"==typeof c){var e=b.element(c).parentNode;d=a.parentIndexOf(this._viewElm,e)}else"number"==typeof c&&(d=c);this._tags=f.remove(this._tags,d,1),a.remove(this._viewElm.children[d]),this._tagsToMarkup(this._tags,this._element)},_refocus:function(a){return this._input.focus(),b.stop(a),!1}},h.createUIComponent(i),i}),Ink.createModule("Ink.UI.Toggle","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(a,b,c,d,e,f){"use strict";function g(){a.BaseUIComponent.apply(this,arguments)}return g._name="Toggle_1",g._optionDefinition={target:["Elements"],triggerEvent:["String","click"],closeOnClick:["Boolean",!0],isAccordion:["Boolean",!1],initialState:["Boolean",null],classNameOn:["String","show-all"],classNameOff:["String","hide-all"],closeOnInsideClick:["String","a[href]"],onChangeState:["Function",null]},g.prototype={_init:function(){var b,d;if(this._targets=a.elsOrSelector(this._options.target),this._options.closeOnClick="true"===this._options.closeOnClick.toString(),this._options.initialState=null!==this._options.initialState?"true"===this._options.initialState.toString():"none"!==c.getStyle(this._targets[0],"display"),"show-all"!==this._options.classNameOn||"hide-all"!==this._options.classNameOff)for(b=0,d=this._targets.length;d>b;b++)c.removeClassName(this._targets[b],"show-all"),c.removeClassName(this._targets[b],"hide-all");if(this._accordion=c.hasClassName(this._element.parentNode,"accordion")||c.hasClassName(this._targets[0].parentNode,"accordion"),this._firstTime=!0,this._bindEvents(),null!==this._options.initialState)this.setState(this._options.initialState,!0);else{var e="none"!==c.getStyle(this._targets[0],"display");this.setState(e,!0)}for(b=0,d=this._targets.length;d>b;b++)this._targets[b].style.display&&(this._targets[b].style.display="");this._element.setAttribute("data-is-toggle-trigger","true")},_bindEvents:function(){if(this._options.triggerEvent&&b.observe(this._element,this._options.triggerEvent,Ink.bind(this._onTriggerEvent,this)),this._options.closeOnClick&&b.observe(document,"click",Ink.bind(this._onOutsideClick,this)),this._options.closeOnInsideClick&&"false"!==this._options.closeOnInsideClick){var a=this._options.closeOnInsideClick;"true"===a.toString()&&(a="*"),b.observeMulti(this._targets,"click",Ink.bind(function(c){d.findUpwardsBySelector(b.element(c),a)&&this.setState(!1,!0)},this))}},_onTriggerEvent:function(a){var c=b.element(a),e=f.some(this._targets,function(a){return a===c||d.isAncestorOf(a,c)});if(!e){this._accordion&&this._updateAccordion();var g=this.getState();this.setState(!g,!0),!g&&this._firstTime&&(this._firstTime=!1),b.stopDefault(a)}},_updateAccordion:function(){var a,b;b=c.hasClassName(this._targets[0].parentNode,"accordion")?this._targets[0].parentNode:this._targets[0].parentNode.parentNode,a=e.select(".toggle, .ink-toggle",b);for(var f=0;f0&&h[0]!==this._targets[0]&&(h[0].style.display="none")}},_onOutsideClick:function(a){var c=b.element(a),e;if(!d.findUpwardsBySelector(c,'[data-is-toggle-trigger="true"]')){var g=f.some(this._targets,function(a){return d.isAncestorOf(a,c)||a===c});if(this._element!==c&&!d.isAncestorOf(this._element,c)&&!g){if((e=Ink.ss(".ink-shade")).length)for(var h=e.length,i=0;h>i;i++)if(d.isAncestorOf(e[i],c)&&d.isAncestorOf(e[i],this._element))return;this.setState(!1,!0)}}},setState:function(a,b){if(a!==this.getState()){if(b&&"function"==typeof this._options.onChangeState){var d=this._options.onChangeState(a);if(d===!1)return!1}for(var e=0,f=this._targets.length;f>e;e++)c.addRemoveClassName(this._targets[e],this._options.classNameOn,a),c.addRemoveClassName(this._targets[e],this._options.classNameOff,!a);c.addRemoveClassName(this._element,"active",a)}},getState:function(){return c.hasClassName(this._element,"active")}},a.createUIComponent(g),g}),Ink.createModule("Ink.UI.Tooltip","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1","Ink.Dom.Css_1","Ink.Dom.Browser_1"],function(a,b,c,d,e,f){"use strict";function g(a,b){this._init(a,b||{})}function h(a,b){this._init(a,b)}var i,j,k;!function(){for(var a=document.createElement("DIV"),b=["transition","oTransition","msTransition","mozTransition","webkitTransition"],c=0;ce;e++)this.tooltips[e]=new h(this,c[e])},destroy:function(){e.each(this.tooltips,function(a){a._destroy()}),this.tooltips=null,this.options=null}},h.prototype={_oppositeDirections:{left:"right",right:"left",up:"down",down:"up"},_init:function(c,d){b.observe(d,"mouseover",Ink.bindEvent(this._onMouseOver,this)),b.observe(d,"mouseout",Ink.bindEvent(this._onMouseOut,this)),b.observe(d,"mousemove",Ink.bindEvent(this._onMouseMove,this)),this.root=c,this.element=d,this._delayTimeout=null,this.tooltip=null,a.registerInstance(this,this.element)},_makeTooltip:function(a){if(!this._getOpt("text")&&!this._getOpt("html")&&!c.hasAttribute(this.element,"title"))return!1;var d=this._createTooltipElement();this.tooltip&&this._removeTooltip(),this.tooltip=d,this._fadeInTooltipElement(d),this._placeTooltipElement(d,a),b.observe(d,"mouseover",Ink.bindEvent(this._onTooltipMouseOver,this));var e=this._getFloatOpt("timeout");e&&setTimeout(Ink.bind(function(){this.tooltip===d&&this._removeTooltip()},this),1e3*e)},_createTooltipElement:function(){var b=this._getOpt("template"),e=this._getOpt("templatefield"),g,h;if(b){var i=document.createElement("DIV");if(i.innerHTML=a.elOrSelector(b,"options.template").outerHTML,g=i.firstChild,e){if(h=d.select(e,g),!h)throw"options.templatefield must be a valid selector within options.template";h=h[0]}else h=g}else g=document.createElement("DIV"),f.addClassName(g,"ink-tooltip"),f.addClassName(g,this._getOpt("color")),h=document.createElement("DIV"),f.addClassName(h,"content"),g.appendChild(h);return this._getOpt("html")?h.innerHTML=this._getOpt("html"):this._getOpt("text")?c.setTextContent(h,this._getOpt("text")):c.setTextContent(h,this.element.getAttribute("title")),g.style.display="block",g.style.position="absolute",g.style.zIndex=this._getIntOpt("zIndex"),g},_fadeInTooltipElement:function(a){var b=this._getFloatOpt("fade");i&&b&&(a.style.opacity="0",a.style[i]=b+"s",a.style[j]="opacity",a.style[k]="ease-in-out",setTimeout(function(){a.style.opacity="1"},0))},_placeTooltipElement:function(a,b){var d=this._getOpt("where");if("mousemove"===d||"mousefix"===d){var e=b;this._setPos(e[0],e[1]),m.appendChild(a)}else if(d.match(/(up|down|left|right)/)){m.appendChild(a);var g=c.offset(this.element),h=g[0],i=g[1],j=c.elementWidth(this.element)/2-c.elementWidth(a)/2,k=c.elementHeight(this.element)/2-c.elementHeight(a)/2,l=this._getIntOpt("spacing"),n=c.elementDimensions(a),o=c.elementDimensions(this.element),p=c.scrollWidth()+c.viewportWidth(),q=c.scrollHeight()+c.viewportHeight();d=this._getWhereValueInsideViewport(d,{left:h-n[0],right:h+n[0],top:i+n[1],bottom:i+n[1]},{right:p,bottom:q}),"up"===d?(i-=n[1],i-=l,h+=j):"down"===d?(i+=o[1],i+=l,h+=j):"left"===d?(h-=n[0],h-=l,i+=k):"right"===d&&(h+=o[0],h+=l,i+=k);var r=null;d.match(/(up|down|left|right)/)&&(r=document.createElement("SPAN"),f.addClassName(r,"arrow"),f.addClassName(r,this._oppositeDirections[d]),a.appendChild(r));var s=h,t=i,u=t+n[1]-q,v=s+n[0]-p,w=0-s,x=0-t;u>0?(r&&(r.style.top=n[1]/2+u+"px"),t-=u):x>0?(r&&(r.style.top=n[1]/2-x+"px"),t+=x):v>0?(r&&(r.style.left=n[0]/2+v+"px"),s-=v):w>0&&(r&&(r.style.left=n[0]/2-w+"px"),s+=w),a.style.left=s+"px",a.style.top=t+"px"}},_getWhereValueInsideViewport:function(a,b,c){return"left"===a&&b.left<0?"right":"right"===a&&b.right>c.right?"left":"up"===a&&b.top<0?"down":"down"===a&&b.bottom>c.bottom?"up":a},_removeTooltip:function(){var a=this.tooltip;if(a){var b=Ink.bind(c.remove,{},a);"mousemove"!==this._getOpt("where")&&i?(a.style.opacity=0,setTimeout(b,1e3*this._getFloatOpt("fade"))):b(),this.tooltip=null}},_getOpt:function(a){var b=c.data(this.element)[c._camelCase("tip-"+a)];if(b)return b;var d=this.root.options[a];return"undefined"!=typeof d?d:void 0},_getIntOpt:function(a){return parseInt(this._getOpt(a),10)},_getFloatOpt:function(a){return parseFloat(this._getOpt(a),10)},_destroy:function(){this.tooltip&&c.remove(this.tooltip),this.root=null,this.element=null,this.tooltip=null},_onMouseOver:function(a){var b=this._getMousePosition(a),c=this._getFloatOpt("delay");c?this._delayTimeout=setTimeout(Ink.bind(function(){this.tooltip||this._makeTooltip(b),this._delayTimeout=null},this),1e3*c):this._makeTooltip(b)},_onMouseMove:function(a){if("mousemove"===this._getOpt("where")&&this.tooltip){var b=this._getMousePosition(a);this._setPos(b[0],b[1])}},_onMouseOut:function(){this._getIntOpt("forever")||this._removeTooltip(),this._delayTimeout&&(clearTimeout(this._delayTimeout),this._delayTimeout=null)},_onTooltipMouseOver:function(){this.tooltip&&this._removeTooltip()},_setPos:function(a,b){a+=this._getIntOpt("left"),b+=this._getIntOpt("top");var d=this._getPageXY();if(this.tooltip){var e=[c.elementWidth(this.tooltip),c.elementHeight(this.tooltip)],f=this._getScroll();e[0]+a-f[0]>=d[0]-20&&(a=a-e[0]-this._getIntOpt("left")-10),e[1]+b-f[1]>=d[1]-20&&(b=b-e[1]-this._getIntOpt("top")-10),this.tooltip.style.left=a+"px",this.tooltip.style.top=b+"px"}},_getPageXY:function(){var a=0,b=0;return"number"==typeof window.innerWidth?(a=window.innerWidth,b=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(a=document.documentElement.clientWidth,b=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(a=document.body.clientWidth,b=document.body.clientHeight),[parseInt(a,10),parseInt(b,10)]},_getScroll:function(){var a=document.documentElement,b=document.body;return a&&(a.scrollLeft||a.scrollTop)?[a.scrollLeft,a.scrollTop]:b?[b.scrollLeft,b.scrollTop]:[0,0]},_getMousePosition:function(a){return[parseInt(b.pointerX(a),10),parseInt(b.pointerY(a),10)]}},g}),Ink.createModule("Ink.UI.TreeView","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(a,b,c,d,e,f){"use strict";function g(){a.BaseUIComponent.apply(this,arguments)}return g._name="TreeView_1",g._optionDefinition={node:["String","li"],child:["String",null],children:["String","ul"],parentClass:["String","parent"],openNodeClass:["String","open"],openClass:["String","fa fa-minus-circle"],closedClass:["String","fa fa-plus-circle"],hideClass:["String","hide-all"],iconTag:["String","i"],stopDefault:["Boolean",!0]},g.prototype={_init:function(){this._options.child&&(Ink.warn("Ink.UI.TreeView: options.child is being renamed to options.children."),this._options.children=this._options.child),this._handlers={click:Ink.bindEvent(this._onClick,this)},b.on(this._element,"click",this._options.node,this._handlers.click),f.each(Ink.ss(this._options.node,this._element),Ink.bind(function(a){if(this.isParent(a)){c.addClassName(a,this._options.parentClass);var b=this.isOpen(a);this._getIcon(a)||d.create(this._options.iconTag,{insertTop:a}),this._setNodeOpen(a,b)}},this))},_getIcon:function(a){return Ink.s("> "+this._options.iconTag,a)},isOpen:function(a){if(!this._getChild(a))throw new Error("not a node!");return"true"===d.data(a).open||c.hasClassName(a,this._options.openNodeClass)},isParent:function(a){return c.hasClassName(a,this._options.parentClass)||null!=this._getChild(a)},_setNodeOpen:function(a,b){var d=this._getChild(a);if(d){c.setClassName(d,this._options.hideClass,!b);var e=this._getIcon(a);a.setAttribute("data-open",b);var f=b?this._options.openClass:this._options.closedClass,g=b?this._options.closedClass:this._options.openClass;c.removeClassName(e,g),c.addClassName(e,f),c.setClassName(a,this._options.openNodeClass,b)}else Ink.error("Ink.UI.TreeView: node",a,"is not a node!")},open:function(a){this._setNodeOpen(a,!0)},close:function(a){this._setNodeOpen(a,!1)},toggle:function(a){this.isOpen(a)?this.close(a):this.open(a)},_getChild:function(a){return e.select(this._options.children,a)[0]||null},_onClick:function(a){!this.isParent(a.currentTarget)||e.matchesSelector(a.target,this._options.node)||e.matchesSelector(a.target,this._options.children)||(this._options.stopDefault&&a.preventDefault(),this.toggle(a.currentTarget))}},a.createUIComponent(g),g}),Ink.createModule("Ink.UI.Upload","1",["Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Browser_1","Ink.UI.Common_1"],function(a,b,c,d){"use strict";var e=function(a){this.init(a)};e.prototype={init:function(a){this._options=Ink.extendObj({entry:void 0,maxDepth:10},a||{});try{this._read()}catch(b){Ink.error(b)}},_read:function(){if(!this._options.entry)return void Ink.error("You must specify the entry!");try{this._readDirectories()}catch(a){Ink.error(a)}},_readDirectories:function(){var a=[],b=!1,c=0,d=Ink.bind(function(e){var f=e.createReader();b=!0,f.readEntries(Ink.bind(function(e){if(e.length>0){for(var f=0,g=e.length;g>f;f++)a.push(e[f]),e[f].isDirectory&&(c=this.clearArray(e[f].fullPath.split("/")),c.shift(),c=c.length,c<=this._options.maxDepth&&d(e[f]));this._stopActivityTimeout&&clearTimeout(this._stopActivityTimeout),this._stopActivityTimeout=setTimeout(function(){b=!1},250)}e.length||(b=!1)},this),Ink.bind(function(a){this._options.readError(a,e)},this))},this);d(this._options.entry);var e,f=function(){return b?!1:(clearInterval(e),this._options.readComplete&&"function"==typeof this._options.readComplete&&this._options.readComplete(a),!0)};e=setInterval(Ink.bind(f,this),250)},clearArray:function(a){for(var b=a.length-1;b>=0;b--)("undefined"==typeof a[b]||null===a[b]||""===a[b])&&a.splice(b,1);return a}};var f={lists:[],items:[],create:function(a){var b;return a=String(a),this.lists.push({name:a}),b=this.lists.length-1},getItems:function(a){if(!a)return this.items;for(var b=[],c=0,d=this.items.length;d>c;c++)this.items[c].parentId===a&&b.push(this.items[c]);return b},purge:function(a,b){if("number"!=typeof a||isNaN(Number(a)))return!1;try{for(var c=this.items.length;c>=0;c--)this.items[c]&&a===this.items[c].parentId&&this.remove(this.items[c].parentId,this.items[c].pid);return b||this.lists.splice(a,1),!0}catch(d){return Ink.error("Purge: invalid id"),!1}},add:function(a,b,c){if(!this.lists[a])return!1;"object"!=typeof b&&(b=String(b));var d=parseInt(Math.round(1e5*Math.random())+""+Math.round(1e5*Math.random()),10);return c=c||0,this.items.push({parentId:a,item:b,priority:c||0,pid:d}),d},view:function(a,b){var c=this._searchByPid(a,b);return c===!1?!1:this.items[c]},remove:function(a,b){try{var c=this._searchByPid(a,b);return c===!1?!1:(this.items.splice(c,1),!0)}catch(d){return Ink.error("Remove: invalid id"),!1}},_searchByPid:function(a,b){if(!a&&"boolean"==typeof a||!b)return!1;if(a=parseInt(a,10),b=parseInt(b,10),isNaN(a)||isNaN(b))return!1;for(var c=0,d=this.items.length;d>c;c++)if(this.items[c].parentId===a&&this.items[c].pid===b)return c;return!1}},g=function(a){this.Upload=a,this.init()};g.prototype={init:function(){this._fileButton=this.Upload._options.fileButton,this._dropzone=this.Upload._options.dropzone,this._setDropEvent(),this._setFileButton()},_setDropEvent:function(){var a=this._dropzone;if(a)for(var b=0,c=a.length;c>b;b++)a[b].ondrop=Ink.bindEvent(this.Upload._dropEventHandler,this.Upload),a[b].ondragleave=Ink.bindEvent(this._onDragLeave,this),a[b].ondragend=Ink.bindEvent(this._onDragEndEventHandler,this),a[b].ondragdrop=Ink.bindEvent(this._onDragEndEventHandler,this),a[b].ondragenter=Ink.bindEvent(this._onDragEnterHandler,this),a[b].ondragover=Ink.bindEvent(this._onDragOverHandler,this)},_onDragEnterHandler:function(a){return a&&a.stopPropagation&&a.stopPropagation(),a&&a.preventDefault&&a.preventDefault(),a&&(a.returnValue=!1),this.Upload.publish("DragEnter",a),!1},_onDragOverHandler:function(a){return a?(a.preventDefault(),a.stopPropagation(),a.returnValue=!1,!0):!1},_onDragLeave:function(a){return this.Upload.publish("DragLeave",a)},_onDragEndEventHandler:function(a){return this.Upload.publish("DragEnd",a)},_setFileButton:function(){var b=this._fileButton;b&&a.observeMulti(b,"change",Ink.bindEvent(this._fileChangeHandler,this))},_fileChangeHandler:function(c){var d=a.element(c),e=d.files,f=b.findUpwardsByTag(d,"form");return e&&window.FormData&&"withCredentials"in new XMLHttpRequest?(this.Upload._addFilesToQueue(e),void(d.value="")):(f.parentNode.submit(),!1)}};var h=function(a){this.Queue=f,this.init(a),this._events={}};return h.prototype={init:function(a){if("string"==typeof a&&(a=b.data(d.elOrSelector(a,"1st argument"))),this._options=Ink.extendObj({dropzone:void 0,fileButton:void 0,fileFormName:"Ink_Filelist",endpoint:"",maxFilesize:300<<20,INVALID_FILE_NAME:void 0,extraData:{},useChunks:!1,chunkSize:4194304,minSizeToUseChunks:20971520,endpointChunk:"",endpointChunkCommit:"",foldersEnabled:!1,directoryMaxDepth:10},a||{}),this._queueId=f.create("Ink_UPLOAD"),this._queueRunning=!1,this._folders={},this._options.dropzone&&(this._options.dropzone=d.elsOrSelector(this._options.dropzone,"Ink.UI.Upload - dropzone")),this._options.fileButton&&(this._options.fileButton=d.elsOrSelector(this._options.fileButton,"Ink.UI.Upload - fileButton")),!this._options.dropzone&&!this._options.fileButton)throw new TypeError("Ink.UI.Upload: Specify a fileButton or a Dropzone!");new g(this)},_supportChunks:function(a){return this._options.useChunks&&"Blob"in window&&(new Blob).slice&&a>this._options.minSizeToUseChunks},_dropEventHandler:function(b){a.stop(b),this.publish("DropComplete",b.dataTransfer);var c=b.dataTransfer;if(!c||!c.files||!c.files.length)return!1;if(this._files=c.files,this._files=Array.prototype.slice.call(this._files||[],0),c.items&&c.items[0]&&c.items[0].webkitGetAsEntry){if(!this._options.foldersEnabled)return setTimeout(Ink.bind(this._addFilesToQueue,this,this._files),0);for(var d,e=[],f=b.dataTransfer.items.length-1;f>=0;f--)d=b.dataTransfer.items[f].webkitGetAsEntry(),d&&d.isDirectory&&(e.push(d),this._files[f].isDirectory=!0,this._files.splice(f,1));this._addFolderToQueue(e,Ink.bind(function(){setTimeout(Ink.bind(this._addFilesToQueue,this,this._files),0)},this))}else setTimeout(Ink.bind(this._addFilesToQueue,this,this._files),0);return!0},_addFolderToQueue:function(a,b){var c=[],d={};if(!a||!a.length)return b(),c;var f=function(a){for(var b=[],c=0,d=a.length;d>c;c++)a[c].isFile&&b.push(a[c]);return b},g=function(a,b){var d;return b=b||0,this._files[b]?"fileentry"!==this._files[b].constructor.name.toLowerCase()?g.apply(this,[a,++b]):void this._files[b].file(Ink.bind(function(c){d=this._files[b].fullPath,this._files[b]=c,this._files[b].hasParent=!0,this._files[b].fullPath||(this._files[b].fullPath=d),g.apply(this,[a,++b])},this),Ink.bind(function(){this._files.splice(b,1),g.apply(this,[a,b])},this)):(a(),c)},h=Ink.bind(function(i){return a[i]?void new e({entry:a[i],maxDepth:this._options.directoryMaxDepth,readComplete:Ink.bind(function(b){if(c=c.concat(f(b)),a[i]&&!(a[i].fullPath in this._folders)){this._folders[a[i].fullPath]={items:b,files:c,length:b.length,created:!1,root:!0};for(var e=0,g=b.length;g>e;e++)b[e].isFile||(b[e].fullPath in d?delete d[b[e].fullPath]:this._folders[b[e].fullPath]={created:!1,root:!1});h(++i)}},this),readError:Ink.bind(function(a,b){d[b.fullPath]={},d[b.fullPath].error=a},this)}):(this._files=this._files.concat(c),g.call(this,b),!1)},this);return h(0),c},_addFilesToQueue:function(a){for(var b,d,e,g=0,h=a.length;h>g;g++)b=a[g],b.isDirectory||null!==b&&(b.type||b.size%4096!==0||c.CHROME&&this._options.foldersEnabled)?b.size>this._options.maxFilesize?this.publish("MaxSizeFailure",b,this._options.maxFilesize):(d=parseInt(Math.round(1e5*Math.random())+""+Math.round(1e5*Math.random()),10),e={id:g,data:b,fileID:d,directory:b.isDirectory},f.add(this._queueId,e),this.publish("FileAddedToQueue",e)):this.publish("InvalidFile",b,"size");this._processQueue(!0),this._files=[]},_processQueue:function(a){if(this._queueRunning)return!1;this.running=0;var b=1,c=0,d,e=f.items.length;this._queueRunning=!0,this.interval=setInterval(Ink.bind(function(){if(f.items.length===c&&0===this.running&&(f.purge(this._queueId,!0),this._queueRunning=!1,clearInterval(this.interval),this.publish("QueueEnd",this._queueId,e)),d=f.getItems(this._queueId),this.runningb.chunk_offset){if(c.response){var e=JSON.parse(c.response),f=b.chunk_offset&&e.offset!==b.chunk_offset+this._options.chunkSize&&b.size!==e.offset;f?(a.cb&&a.cb(),this.publish("ErrorUpload",b,d)):(b.chunk_upload_id=e.upload_id,b.chunk_offset=e.offset,b.chunk_expires=e.expires,this._upload(a))}else a.cb&&a.cb(),this.publish("ErrorUpload",b,d);return c=null}return a.cb&&a.cb(),c.responseText&&c.status<400?this.publish("EndUpload",b,d,c.responseText):this.publish("ErrorUpload",b,d),c=null},this),c.onerror=Ink.bindEvent(function(){a.cb&&a.cb(),this.publish("ErrorUpload",b,d)},this),c.onabort=Ink.bindEvent(function(){a.cb&&a.cb(),this.publish("AbortUpload",b,d,{abortAll:Ink.bind(this.abortAll,this),abortOne:Ink.bind(this.abortOne,this)})},this)},abortAll:function(){return this._queueRunning?(clearInterval(this.interval),this._queueRunning=!1,f.purge(this._queueId,!0),!0):!1},abortOne:function(a,b){for(var c=f.getItems(0),d,e=0,g=c.length;g>e;e++)if(c[e].item.fileID===a)return d={id:c[e].item.fileID,name:c[e].item.data.name,size:c[e].item.data.size,hasParent:c[e].item.data.hasParent},f.remove(0,c[e].pid),b&&b(d),!0;return!1},subscribe:function(a,b){return this._events[a]||(this._events[a]=[]),this._events[a].push(b),this._events[a]},publish:function(a){var b=this._events[a],c=Array.prototype.slice.call(arguments||[],0);if(b)for(var d=0,e=b.length;e>d;d++)try{b[d].apply(this,c.splice(1,c.length))}catch(f){Ink.error(a+": "+f)}}},h}),Ink.createModule("Ink.Util.Array","1",[],function(){"use strict";var a=Array.prototype,b={isArray:Array.isArray||function(a){return"[object Array]"==={}.toString.call(a)},groupBy:function(a,b){function c(a,b){return d(a)===d(b)}function d(a){return"function"==typeof b.key?b.key(a):a}b=b||{};for(var e=[],f,g=0,h=a.length;h>g;g++){for(f=[a[g]];h>g+1&&c(a[g],a[g+1]);)f.push(a[g+1]),g++;e.push(b.pairs?[d(a[g]),f]:f)}return e},reduce:function(b,c,d){if(a.reduce)return a.reduce.apply(b,[].slice.call(arguments,1));var e=Object(b),f=e.length>>>0,g=0,h;if(arguments.length>=3)h=d;else{for(;f>g&&!(g in e);)g++;if(g>=f)throw new TypeError("Reduce of empty array with no initial value");h=e[g++]}for(;f>g;g++)g in e&&(h=c(h,e[g],g,e));return h},inArray:function(a,b){if("object"==typeof b)for(var c=0,d=b.length;d>c;++c)if(b[c]===a)return!0;return!1},sortMulti:function(a,b){if("undefined"==typeof a||a.constructor!==Array)return!1;if("string"!=typeof b)return a.sort();if(a.length>0){if("undefined"==typeof a[0][b])return!1;a.sort(function(a,c){var d=a[b],e=c[b];return e>d?-1:d>e?1:0})}return a},keyValue:function(a,b,c){if("undefined"!=typeof a&&"object"==typeof b&&this.inArray(a,b)){for(var d=[],e=0,f=b.length;f>e;++e)if(b[e]===a){if("undefined"!=typeof c&&c===!0)return e;d.push(e)}return d}return!1},shuffle:function(a){if("undefined"!=typeof a&&a.constructor!==Array)return!1;for(var b=a.length,c=!1,d=!1;b--;)d=Math.floor(Math.random()*(b+1)),c=a[b],a[b]=a[d],a[d]=c;return a},forEach:function(b,c,d){if(a.forEach)return a.forEach.call(b,c,d);for(var e=0,f=b.length>>>0;f>e;e++)c.call(d,b[e],e,b) +},each:function(){b.forEach.apply(b,[].slice.call(arguments))},map:function(b,c,d){if(a.map)return a.map.call(b,c,d);for(var e=new Array(g),f=0,g=b.length>>>0;g>f;f++)e[f]=c.call(d,b[f],f,b);return e},filter:function(b,c,d){if(a.filter)return a.filter.call(b,c,d);for(var e=[],f=null,g=0,h=b.length;h>g;g++)f=b[g],c.call(d,f,g,b)&&e.push(f);return e},some:function(a,b,c){if(null===a)throw new TypeError("First argument is invalid.");var d=Object(a),e=d.length>>>0;if("function"!=typeof b)throw new TypeError("Second argument must be a function.");for(var f=0;e>f;f++)if(f in d&&b.call(c,d[f],f,d))return!0;return!1},intersect:function(a,b){if(!a||!b||a instanceof Array==!1||b instanceof Array==!1)return[];for(var c=[],d=0,e=a.length;e>d;++d)for(var f=0,g=b.length;g>f;++f)a[d]===b[f]&&c.push(a[d]);return c},convert:function(b){return a.slice.call(b||[],0)},unique:function(a){if(!Array.prototype.lastIndexOf){var c=[];return b.forEach(b.convert(a),function(a){b.inArray(a,c)||c.push(a)}),c}return b.filter(b.convert(a),function(a,b,c){return c.lastIndexOf(a)===b})},range:function c(a,b,d){d||(d=1);var e=[],f;if(d>0)for(f=a;b>f;f+=d)e.push(f);else for(f=a;f>b;f+=d)e.push(f);return e},insert:function(a,b,c){a.splice(b,0,c)},remove:function(a,b,c){for(var d=[],e=0,f=a.length;f>e;e++)e>=b&&b+c>e||d.push(a[e]);return d}};return b}),Ink.createModule("Ink.Util.BinPack","1",[],function(){"use strict";var a=function(a,b){this.init(a,b)};a.prototype={init:function(a,b){this.root={x:0,y:0,w:a,h:b}},fit:function(a){var b,c,d;for(b=0;b0?a[0].w:0,g=e>0?a[0].h:0;for(this.root={x:0,y:0,w:f,h:g},b=0;e>b;b++)d=a[b],d.fit=(c=this.findNode(this.root,d.w,d.h))?this.splitNode(c,d.w,d.h):this.growNode(d.w,d.h)},findNode:function(a,b,c){return a.used?this.findNode(a.right,b,c)||this.findNode(a.down,b,c):b<=a.w&&c<=a.h?a:null},splitNode:function(a,b,c){return a.used=!0,a.down={x:a.x,y:a.y+c,w:a.w,h:a.h-c},a.right={x:a.x+b,y:a.y,w:a.w-b,h:c},a},growNode:function(a,b){var c=a<=this.root.w,d=b<=this.root.h,e=d&&this.root.h>=this.root.w+a,f=c&&this.root.w>=this.root.h+b;return e?this.growRight(a,b):f?this.growDown(a,b):d?this.growRight(a,b):c?this.growDown(a,b):null},growRight:function(a,b){this.root={used:!0,x:0,y:0,w:this.root.w+a,h:this.root.h,down:this.root,right:{x:this.root.w,y:0,w:a,h:this.root.h}};var c;return(c=this.findNode(this.root,a,b))?this.splitNode(c,a,b):null},growDown:function(a,b){this.root={used:!0,x:0,y:0,w:this.root.w,h:this.root.h+b,down:{x:0,y:this.root.h,w:this.root.w,h:b},right:this.root};var c;return(c=this.findNode(this.root,a,b))?this.splitNode(c,a,b):null}};var c={random:function(){return Math.random()-.5},w:function(a,b){return b.w-a.w},h:function(a,b){return b.h-a.h},a:function(a,b){return b.area-a.area},max:function(a,b){return Math.max(b.w,b.h)-Math.max(a.w,a.h)},min:function(a,b){return Math.min(b.w,b.h)-Math.min(a.w,a.h)},height:function(a,b){return c.msort(a,b,["h","w"])},width:function(a,b){return c.msort(a,b,["w","h"])},area:function(a,b){return c.msort(a,b,["a","h","w"])},maxside:function(a,b){return c.msort(a,b,["max","min","h","w"])},msort:function(a,b,d){var e,f;for(f=0;ff;++f)h=e.blocks[f],"area"in h||(h.area=h.w*h.h);var i=e.dimensions?new a(e.dimensions[0],e.dimensions[1]):new b;e.sorter||(e.sorter="maxside"),e.blocks.sort(c[e.sorter]),i.fit(e.blocks);var j=[i.root.w,i.root.h],k=[],l=[];for(f=0,g=e.blocks.length;g>f;++f)h=e.blocks[f],h.fit?k.push(h):(h.toString=d,l.push(h));var m=j[0]*j[1],n=0;for(f=0,g=k.length;g>f;++f)h=k[f],n+=h.area;return{dimensions:j,filled:n/m,blocks:e.blocks,fitted:k,unfitted:l}}};return e}),Ink.createModule("Ink.Util.Cookie","1",[],function(){"use strict";var a={get:function(a){var b=document.cookie||!1,c={};if(b){b=b.replace(new RegExp("; ","g"),";");var d=b.split(";"),e=[];if(d.length>0)for(var f=0;f1?k:"0"+k;break;case"D":d[j]=this._wDays(f.getDay()).substring(0,3);break;case"j":d[j]=f.getDate();break;case"l":d[j]=this._wDays(f.getDay());break;case"N":d[j]=f.getDay()||7;break;case"S":var l=f.getDate(),m=["st","nd","rd"],n="";d[j]=l>=11&&13>=l?"th":(n=m[String(l).substr(-1)-1])?n:"th";break;case"w":d[j]=f.getDay();break;case"z":g=Date.UTC(f.getFullYear(),0,0),h=Date.UTC(f.getFullYear(),f.getMonth(),f.getDate()),d[j]=Math.floor((h-g)/864e5);break;case"W":var o=new Date(f.getFullYear(),0,1);g=o.getDay()||7;var p=Math.floor((f-o)/864e5+1);d[j]=Math.ceil((p-(8-g))/7)+1;break;case"F":d[j]=this._months(f.getMonth());break;case"m":var q=String(f.getMonth()+1);d[j]=q.length>1?q:"0"+q;break;case"M":d[j]=this._months(f.getMonth()).substring(0,3);break;case"n":d[j]=f.getMonth()+1;break;case"t":d[j]=this._daysInMonth(f.getMonth()+1,f.getYear());break;case"L":var r=f.getFullYear();d[j]=r%4?!1:r%100?!0:r%400?!1:!0;break;case"o":throw'"o" not implemented!';case"Y":d[j]=f.getFullYear();break;case"y":d[j]=String(f.getFullYear()).substring(2);break;case"a":d[j]=f.getHours()<12?"am":"pm";break;case"A":d[j]=f.getHours<12?"AM":"PM";break;case"B":throw'"B" not implemented!';case"g":i=f.getHours(),d[j]=12>=i?i:i-12;break;case"G":d[j]=String(f.getHours());break;case"h":i=String(f.getHours()),i=12>=i?i:i-12,d[j]=i.length>1?i:"0"+i;break;case"H":i=String(f.getHours()),d[j]=i.length>1?i:"0"+i;break;case"i":var s=String(f.getMinutes());d[j]=s.length>1?s:"0"+s;break;case"s":var t=String(f.getSeconds());d[j]=t.length>1?t:"0"+t;break;case"u":throw'"u" not implemented!';case"e":throw'"e" not implemented!';case"I":g=new Date(f.getFullYear(),0,1),d[j]=f.getTimezoneOffset()!==g.getTimezoneOffset()?1:0;break;case"O":var u=f.getTimezoneOffset(),v=u%60;i=String((u-v)/60*-1),"-"!==i.charAt(0)&&(i="+"+i),i=3===i.length?i:i.replace(/([+\-])(\d)/,"$10$2"),d[j]=i+v+"0";break;case"P":throw'"P" not implemented!';case"T":throw'"T" not implemented!';case"Z":d[j]=60*f.getTimezoneOffset();break;case"c":throw'"c" not implemented!';case"r":var w=this._wDays(f.getDay()).substr(0,3),x=this._months(f.getMonth()).substr(0,3);d[j]=w+", "+f.getDate()+" "+x+this.get(" Y H:i:s O",f);break;case"U":d[j]=Math.floor(f.getTime()/1e3);break;default:d[j]=c[j]}return d.join("")},set:function(a,b){if("undefined"!=typeof b){("undefined"==typeof a||""===a)&&(a="Y-m-d");for(var c=a.split(""),d=new Array(c.length),e="\\",f,g={year:void 0,month:void 0,day:void 0,dayY:void 0,dayW:void 0,week:void 0,hour:void 0,hourD:void 0,min:void 0,sec:void 0,msec:void 0,ampm:void 0,diffM:void 0,diffH:void 0,date:void 0},h=0,i=0;i=S.slice(2)?0:1)+M)}else M=L.getFullYear();if(n)N=0,O=f[g.dayY.match+1];else if(o)N=p?this._iMonth(f[g.month.match+1]):L.getMonth(),O=f[g.day.match+1];else{N=0;var T;T=t?f[g.week.match+1]:this.get("W",L),O=7*(T-2)+(8-(new Date(M,0,1).getDay()||7))+this._iWeek(f[g.week.match+1])}if(0===N&&O>31){var U=new Date(M,N,O);N=U.getMonth(),O=U.getDate()}}else M=L.getFullYear(),N=L.getMonth(),O=L.getDate();return I=y?+f[g.hourD.match+1]+("pm"===f[g.ampm.match+1]?12:0):z?f[g.hour.match+1]:x?L.getHours():"00",J=B?f[g.min.match+1]:E?"00":L.getMinutes(),P=C?f[g.sec.match+1]:F?"00":L.getSeconds(),Q=D?f[g.msec.match+1]:"000",R=H?f[g.diffH.match+1]:G?String(-1*f[g.diffM.match+1]/60*100).replace(/^(\d)/,"+$1").replace(/(^[\-+])(\d{3}$)/,"$10$2"):"+0000",new Date(M,N,O,I,J,P)}}}};return a}),Ink.createModule("Ink.Util.Dumper","1",[],function(){"use strict";var a={_tab:"    ",_formatParam:function(a){var b="";switch(typeof a){case"string":b="(string) "+a;break;case"number":b="(number) "+a;break;case"boolean":b="(boolean) "+a;break;case"object":b=null!==a?a.constructor===Array?"Array \n{\n"+this._outputFormat(a,0)+"\n}":"Object \n{\n"+this._outputFormat(a,0)+"\n}":"null";break;default:b=!1}return b},_getTabs:function(a){for(var b="",c=0;a>c;c++)b+=this._tab;return b},_outputFormat:function(a,b){var c="",d=!1;for(var e in a)if(null!==a[e])if("object"!=typeof a[e]||a[e].constructor!==Array&&a[e].constructor!==Object){if(a[e].constructor===Function)continue;c=c+this._tab+this._getTabs(b)+"["+e+"] => "+a[e]+"\n"}else a[e].constructor===Array?d="Array":a[e].constructor===Object&&(d="Object"),c+=this._tab+this._getTabs(b)+"["+e+"] => "+d+"\n",c+=this._tab+this._getTabs(b)+"{\n",c+=this._outputFormat(a[e],b+1)+this._tab+this._getTabs(b)+"}\n";else c=c+this._tab+this._getTabs(b)+"["+e+"] => null \n";return c},printDump:function(a,b){if(b&&"undefined"!=typeof b)if("string"==typeof b)document.getElementById(b).innerHTML="
    "+this._formatParam(a)+"
    ";else{if("object"!=typeof b)throw"TARGET must be an element or an element ID";b.innerHTML="
    "+this._formatParam(a)+"
    "}else document.write("
    "+this._formatParam(a)+"
    ")},returnDump:function(a){return this._formatParam(a)},alertDump:function(a){window.alert(this._formatParam(a).replace(/()(Array|Object)(<\/b>)/g,"$2"))},windowDump:function(a){var b="dumperwindow_"+1e4*Math.random(),c=window.open("",b,"width=400,height=300,left=50,top=50,status,menubar,scrollbars,resizable");c.document.open(),c.document.write("
    "+this._formatParam(a)+"
    "),c.document.close(),c.focus()}};return a}),Ink.createModule("Ink.Util.I18n","1",[],function(){"use strict";var a=/\{(?:(\{.*?})|(?:%s:)?(\d+)|(?:%s)?|([\w-]+))}/g,b=function(a,b){return"function"==typeof a?a.apply(this,b):void 0!==typeof a?a:""},c=function(a,b,d){return this instanceof c?void this.reset().lang(b).testMode(d).append(a||{},b):new c(a,b,d)};return c.prototype={reset:function(){return this._dicts=[],this._dict={},this._testMode=!1,this._lang=this._gLang,this},append:function(a){return this._dicts.push(a),this._dict=Ink.extendObj(this._dict,a[this._lang]),this},lang:function(a){if(!arguments.length)return this._lang;if(a&&this._lang!==a){this._lang=a,this._dict={};for(var b=0,c=this._dicts.length;c>b;b++)this._dict=Ink.extendObj(this._dict,this._dicts[b][a]||{})}return this},testMode:function(a){return arguments.length?(void 0!==a&&(this._testMode=!!a),this):!!this._testMode},getKey:function(a){var b,d=this._gLang,e=this._lang;return a in this._dict?b=this._dict[a]:(c.langGlobal(e),b=this._gDict[a],c.langGlobal(d)),b},text:function(c){if("string"==typeof c){var d=Array.prototype.slice.call(arguments,1),e=0,f="object"==typeof d[0],g=this.getKey(c);return void 0===g&&(g=this._testMode?"["+c+"]":c),"number"==typeof g&&(g+=""),"string"==typeof g?g=g.replace(a,function(a,c,g,h){var i=c?c:g?d[g-(f?0:1)]:h?d[0][h]||"":d[e++ +(f?1:0)];return b(i,[e].concat(d))}):"function"==typeof g?g.apply(this,d):g instanceof Array?b(g[d[0]],d):"object"==typeof g?b(g[d[0]],d):""}},ntext:function(a,b,c){var d=Array.prototype.slice.apply(arguments),e;if(2===d.length&&"number"==typeof b){if(e=this.getKey(a),!(e instanceof Array))return"";d.splice(0,1),e=e[1===b?0:1]}else d.splice(0,2),e=1===c?a:b;return this.text.apply(this,[e].concat(d))},ordinal:function(a){if(void 0===a)return"";var c=+a.toString().slice(-1),d=this.getKey("_ordinals");if(void 0===d)return"";if("string"==typeof d)return d;var e;return"function"==typeof d&&(e=d(a,c),"string"==typeof e)?e:"exceptions"in d&&(e="function"==typeof d.exceptions?d.exceptions(a,c):a in d.exceptions?b(d.exceptions[a],[a,c]):void 0,"string"==typeof e)?e:"byLastDigit"in d&&(e="function"==typeof d.byLastDigit?d.byLastDigit(c,a):c in d.byLastDigit?b(d.byLastDigit[c],[c,a]):void 0,"string"==typeof e)?e:"default"in d&&(e=b(d["default"],[a,c]),"string"==typeof e)?e:""},alias:function(){var a=Ink.bind(c.prototype.text,this);return a.ntext=Ink.bind(c.prototype.ntext,this),a.append=Ink.bind(c.prototype.append,this),a.ordinal=Ink.bind(c.prototype.ordinal,this),a.testMode=Ink.bind(c.prototype.testMode,this),a}},c.reset=function(){c.prototype._gDicts=[],c.prototype._gDict={},c.prototype._gLang="pt_PT"},c.reset(),c.appendGlobal=function(a,b){if(b){if(!(b in a)){var d={};d[b]=a,a=d}b!==c.prototype._gLang&&c.langGlobal(b)}c.prototype._gDicts.push(a),Ink.extendObj(c.prototype._gDict,a[c.prototype._gLang])},c.append=function(){return Ink.warn("Ink.Util.I18n.append() was renamed to appendGlobal()."),c.appendGlobal.apply(c,[].slice.call(arguments))},c.langGlobal=function(a){if(!arguments.length)return c.prototype._gLang;if(a&&c.prototype._gLang!==a){c.prototype._gLang=a,c.prototype._gDict={};for(var b=0,d=c.prototype._gDicts.length;d>b;b++)Ink.extendObj(c.prototype._gDict,c.prototype._gDicts[b][a]||{})}},c.lang=function(){return Ink.warn("Ink.Util.I18n.lang() was renamed to langGlobal()."),c.langGlobal.apply(c,[].slice.call(arguments))},c}),Ink.createModule("Ink.Util.Json","1",[],function(){"use strict";function twoDigits(a){var b=""+a;return 1===b.length?"0"+b:b}var function_call=Function.prototype.call,cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,dateToISOString=Date.prototype.toISOString?Ink.bind(function_call,Date.prototype.toISOString):function(a){return a.getUTCFullYear()+"-"+twoDigits(a.getUTCMonth()+1)+"-"+twoDigits(a.getUTCDate())+"T"+twoDigits(a.getUTCHours())+":"+twoDigits(a.getUTCMinutes())+":"+twoDigits(a.getUTCSeconds())+"."+String((a.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"},InkJson={_nativeJSON:window.JSON||null,_convertToUnicode:!1,_escape:function(a){var b={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(a)&&(a=a.replace(/([\x00-\x1f\\"])/g,function(a,c){var d=b[c];return d?d:(d=c.charCodeAt(),"\\u00"+Math.floor(d/16).toString(16)+(d%16).toString(16))})),a},_toUnicode:function(a){if(this._convertToUnicode){for(var b="",c=!1,d=!1,e=0,f=a.length;f>e;){if(c=a.charCodeAt(e),c>=32&&126>=c||8===c||9===c||10===c||12===c||13===c||32===c||34===c||47===c||58===c||92===c)d=34===c||92===c||47===c?"\\"+a.charAt(e):8===c?"\\b":9===c?"\\t":10===c?"\\n":12===c?"\\f":13===c?"\\r":a.charAt(e);else if(this._convertToUnicode){for(d=a.charCodeAt(e).toString(16)+"".toUpperCase();d.length<4;)d="0"+d;d="\\u"+d}else d=a.charAt(e);b+=d,e++}return b}return this._escape(a)},_stringifyValue:function(a){if("string"==typeof a)return'"'+this._toUnicode(a)+'"';if("number"!=typeof a||!isNaN(a)&&isFinite(a)){if("undefined"==typeof a||null===a)return"null";if("function"==typeof a.toJSON){var b=a.toJSON();return"string"==typeof b?'"'+this._escape(b)+'"':this._escape(b.toString())}if("number"==typeof a||"boolean"==typeof a)return""+a;if("function"==typeof a)return"null";if(a.constructor===Date)return'"'+this._escape(dateToISOString(a))+'"';if(a.constructor===Array){for(var c="",d=0,e=a.length;e>d;d++)d>0&&(c+=","),c+=this._stringifyValue(a[d]);return"["+c+"]"}var f="";for(var g in a)({}).hasOwnProperty.call(a,g)&&(""!==f&&(f+=","),f+='"'+this._escape(g)+'": '+this._stringifyValue(a[g]));return"{"+f+"}"}return"null"},stringify:function(a,b){return this._convertToUnicode=!!b,!this._convertToUnicode&&this._nativeJSON?this._nativeJSON.stringify(a):this._stringifyValue(a)},parse:function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&"object"==typeof e)for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),void 0!==d?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")}};return InkJson}),Ink.createModule("Ink.Util.String","1",[],function(){"use strict";var InkUtilString={_chars:["&","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","ø","ù","ú","û","ü","ý","þ","ÿ","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","Ø","Ù","Ú","Û","Ü","Ý","Þ","€",'"',"ß","<",">","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾"],_entities:["amp","agrave","aacute","acirc","atilde","auml","aring","aelig","ccedil","egrave","eacute","ecirc","euml","igrave","iacute","icirc","iuml","eth","ntilde","ograve","oacute","ocirc","otilde","ouml","oslash","ugrave","uacute","ucirc","uuml","yacute","thorn","yuml","Agrave","Aacute","Acirc","Atilde","Auml","Aring","AElig","Ccedil","Egrave","Eacute","Ecirc","Euml","Igrave","Iacute","Icirc","Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde","Ouml","Oslash","Ugrave","Uacute","Ucirc","Uuml","Yacute","THORN","euro","quot","szlig","lt","gt","cent","pound","curren","yen","brvbar","sect","uml","copy","ordf","laquo","not","shy","reg","macr","deg","plusmn","sup2","sup3","acute","micro","para","middot","cedil","sup1","ordm","raquo","frac14","frac12","frac34"],_accentedChars:["à","á","â","ã","ä","å","è","é","ê","ë","ì","í","î","ï","ò","ó","ô","õ","ö","ù","ú","û","ü","ç","ñ","À","Á","Â","Ã","Ä","Å","È","É","Ê","Ë","Ì","Í","Î","Ï","Ò","Ó","Ô","Õ","Ö","Ù","Ú","Û","Ü","Ç","Ñ"],_accentedRemovedChars:["a","a","a","a","a","a","e","e","e","e","i","i","i","i","o","o","o","o","o","u","u","u","u","c","n","A","A","A","A","A","A","E","E","E","E","I","I","I","I","O","O","O","O","O","U","U","U","U","C","N"],_htmlUnsafeChars:{"<":"<",">":">","&":"&",'"':""","'":"'"},ucFirst:function(a,b){var c=b?/(^|\s)(\w)(\S{2,})/:/(^|\s)(\w)(\S{2,})/g;return a?String(a).replace(c,function(a,b,c,d){return b+c.toUpperCase()+d.toLowerCase()}):a},trim:function(a){return"string"==typeof a?a.replace(/^\s+|\s+$|\n+$/g,""):a},stripTags:function(a,b){if(b&&"string"==typeof b){for(var c=InkUtilString.trim(b).split(","),d=[],e=!1,f=0;f)/g,"").replace(/\s/,"")),d.push("(<"+e+"\\s[^>]+>|<(\\s|\\/)?(\\s|\\/)?"+e+">)"));for(var g=d.join("|"),h=new RegExp(g,"i"),i=a.match(new RegExp("<[^>]*>","g")),j=0;j]+\>/g,"")},htmlEntitiesEncode:function(a){if(a&&a.replace)for(var b=!1,c=0;cd?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},shortString:function(a,b){for(var c=a.split(" "),d="",e=0;e=b){d+="…";break}d+=c[e]+" "}return d},truncateString:function(a,b){return a.length-1>b?a.substr(0,b-1)+"…":a},utf8Decode:function(a){for(var b="",c=0,d=0,e=0,f=0;cd?(b+=String.fromCharCode(d),c++):d>191&&224>d?(e=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&e),c+=2):(e=a.charCodeAt(c+1),f=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&e)<<6|63&f),c+=3);return b},removeAccentedChars:function(a){for(var b=a,c=!1,d=0;d&'"]/g,function(a){return b[a]}):a},normalizeWhitespace:function(a){return null!==a?InkUtilString.trim(String(a).replace(/\s+/g," ")):a},toUnicode:function(a){if("string"==typeof a){for(var b="",c=!1,d=!1,e=a.length,f=0;e>f;){if(c=a.charCodeAt(f),c>=32&&126>=c||8===c||9===c||10===c||12===c||13===c||32===c||34===c||47===c||58===c||92===c)d=8===c?"\\b":9===c?"\\t":10===c?"\\n":12===c?"\\f":13===c?"\\r":a.charAt(f);else{for(d=a.charCodeAt(f).toString(16)+"".toUpperCase();d.length<4;)d="0"+d;d="\\u"+d}b+=d,f++}return b}},escape:function(a){var b=a.charCodeAt(0).toString(16).split("");if(b.length<3){for(;b.length<2;)b.unshift("0");b.unshift("x")}else{for(;b.length<4;)b.unshift("0");b.unshift("u")}return b.unshift("\\"),b.join("")},unescape:function(a){var b=a.lastIndexOf("0");b=-1===b?2:Math.min(b,2);var c=a.substring(b),d=parseInt(c,16);return String.fromCharCode(d)},escapeText:function(a,b){void 0===b&&(b=["[","]","'",","]);for(var c=[],d,e,f=0,g=a.length;g>f;++f)d=a[f],e=d.charCodeAt(0),(32>e||e>126&&-1===b.indexOf(d))&&(d=InkUtilString.escape(d)),c.push(d);return c.join("")},escapedCharRegex:/(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4})/g,unescapeText:function(a){for(var b;b=InkUtilString.escapedCharRegex.exec(a);)b=b[0],a=a.replace(b,InkUtilString.unescape(b)),InkUtilString.escapedCharRegex.lastIndex=0;return a},strcmp:function(a,b){return a===b?0:a>b?1:-1},packetize:function(a,b){for(var c=a.length,d=new Array(Math.ceil(c/b)),e=a.split(""),f,g=0;c;)f=Math.min(b,c),d[g++]=e.splice(0,f).join(""),c-=f;return d}};return InkUtilString}),Ink.createModule("Ink.Util.Url","1",[],function(){"use strict";var a={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",getUrl:function(){return window.location.href},genQueryString:function(a,b){var c=-1!==a.indexOf("?"),d,e,f,g=[a];for(e in b)b.hasOwnProperty(e)&&(c?d="&":(d="?",c=!0),f=b[e],"number"==typeof f||f||(f=""),g=g.concat([d,encodeURIComponent(e),"=",encodeURIComponent(f)]));return g.join("")},getQueryString:function(a){var b;b=a&&"undefined"!=typeof a?a:this.getUrl();var c={};if(b.match(/\?(.+)/i)){var d=b.replace(/^(.*)\?([^\#]+)(\#(.*))?/g,"$2");if(d.length>0)for(var e=d.split(/[;&]/),f=0;f0)for(var e=d.split(/[;&]/),f=0;f0?b[b.length-1]:!1;for(var c=!1,d=new RegExp(""+a,"i"),e=0,f=b.length;f>e;e++)if(c=b[e],d.test(c.src))return c;return!1},_debug:function(){}};return a}),Ink.createModule("Ink.Util.Validator","1",[],function(){"use strict";var a={_countryCodes:["AO","CV","MZ","PT"],_internacionalPT:351,_indicativosPT:{21:"lisboa",22:"porto",231:"mealhada",232:"viseu",233:"figueira da foz",234:"aveiro",235:"arganil",236:"pombal",238:"seia",239:"coimbra",241:"abrantes",242:"ponte de sôr",243:"santarém",244:"leiria",245:"portalegre",249:"torres novas",251:"valença",252:"vila nova de famalicão",253:"braga",254:"peso da régua",255:"penafiel",256:"são joão da madeira",258:"viana do castelo",259:"vila real",261:"torres vedras",262:"caldas da raínha",263:"vila franca de xira",265:"setúbal",266:"évora",268:"estremoz",269:"santiago do cacém",271:"guarda",272:"castelo branco",273:"bragança",274:"proença-a-nova",275:"covilhã",276:"chaves",277:"idanha-a-nova",278:"mirandela",279:"moncorvo",281:"tavira",282:"portimão",283:"odemira",284:"beja",285:"moura",286:"castro verde",289:"faro",291:"funchal, porto santo",292:"corvo, faial, flores, horta, pico",295:"angra do heroísmo, graciosa, são jorge, terceira",296:"ponta delgada, são miguel, santa maria",91:"rede móvel 91 (Vodafone / Yorn)",93:"rede móvel 93 (Optimus)",96:"rede móvel 96 (TMN)",92:"rede móvel 92 (TODOS)",707:"número único",760:"número único",800:"número grátis",808:"chamada local",30:"voip"},_internacionalCV:238,_indicativosCV:{2:"fixo",91:"móvel 91",95:"móvel 95",97:"móvel 97",98:"móvel 98",99:"móvel 99"},_internacionalAO:244,_indicativosAO:{2:"fixo",91:"móvel 91",92:"móvel 92"},_internacionalMZ:258,_indicativosMZ:{2:"fixo",82:"móvel 82",84:"móvel 84"},_internacionalTL:670,_indicativosTL:{3:"fixo",7:"móvel 7"},_characterGroups:{numbers:["0-9"],asciiAlpha:["a-zA-Z"],latin1Alpha:["a-zA-Z","À-ÿ"],unicodeAlpha:["a-zA-Z","À-ÿ","Ā-῿","Ⰰ-퟿"],space:[" "],dash:["-"],underscore:["_"],nicknamePunctuation:["_.-"],singleLineWhitespace:[" "],newline:["\n"],whitespace:[" \n \f\r  "],asciiPunctuation:["!-/",":-@","[-`","{-~"],latin1Punctuation:["!-/",":-@","[-`","{-~","¡-¿","×","÷"],unicodePunctuation:["!-/",":-@","[-`","{-~","¡-¿","×","÷"," -","⸀-⹿"," -〿"]},createRegExp:function(b){var c="^["; +for(var d in b)if(b.hasOwnProperty(d)){if(!(d in a._characterGroups))throw new Error("group "+d+" is not a valid character group");b[d]&&(c+=a._characterGroups[d].join(""))}return new RegExp("^["===c?"$^":c+"]*?$")},checkCharacterGroups:function(b,c){return a.createRegExp(c).test(b)},unicode:function(b,c){return a.checkCharacterGroups(b,Ink.extendObj({unicodeAlpha:!0},c))},latin1:function(b,c){return a.checkCharacterGroups(b,Ink.extendObj({latin1Alpha:!0},c))},ascii:function(b,c){return a.checkCharacterGroups(b,Ink.extendObj({asciiAlpha:!0},c))},number:function(b,c){b+="";var d=Ink.extendObj({decimalSep:".",thousandSep:"",negative:!0,decimalPlaces:null,maxDigits:null,max:null,min:null,returnNumber:!1},c||{});if(d.thousandSep)return b=b.replace(new RegExp("\\"+d.thousandSep,"g"),""),d.thousandSep="",a.number(b,d);if(d.negative===!1)return d.min=0,d.negative=!0,a.number(b,d);if("."!==d.decimalSep&&(b=b.replace(new RegExp("\\"+d.decimalSep,"g"),".")),!/^(-)?(\d+)?(\.\d+)?$/.test(b)||""===b)return!1;var e;if(d.decimalSep&&-1!==b.indexOf(d.decimalSep)){if(e=b.split(d.decimalSep),null!==d.decimalPlaces&&e[1].length>d.decimalPlaces)return!1}else e=[""+b,""];if(null!==d.maxDigits&&e[0].replace(/-/g,"").length>d.maxDigits)return e;var f=parseFloat(b);return null!==d.maxExcl&&f>=d.maxExcl||null!==d.minExcl&&f<=d.minExcl?!1:null!==d.max&&f>d.max||null!==d.min&&f=1&&12>=b&&c>=1&&this._daysInMonth(b,a)>=c?!0:!1},email:function(a){var b=new RegExp("^[_a-z0-9-]+((\\.|\\+)[_a-z0-9-]+)*@([\\w]*-?[\\w]*\\.)+[a-z]{2,4}$","i");return b.test(a)?!0:!1},mail:function(b){return a.email(b)},url:function(a,b){if("undefined"==typeof b||b===!1){var c=new RegExp("(^(http\\:\\/\\/|https\\:\\/\\/)(.+))","i");c.test(a)===!1&&(a="http://"+a)}var d=new RegExp("^(http:\\/\\/|https:\\/\\/)([\\w]*(-?[\\w]*)*\\.)+[a-z]{2,4}","i");return d.test(a)===!1?!1:!0},isPTPhone:function(a){a=a.toString();var b=[];for(var c in this._indicativosPT)"string"==typeof this._indicativosPT[c]&&b.push(c);var d=b.join("|"),e=/^(00351|\+351)/;e.test(a)&&(a=a.replace(e,""));var f=/(\s|\-|\.)+/g;a=a.replace(f,"");var g=/[\d]{9}/i;if(9===a.length&&g.test(a)){var h=new RegExp("^("+d+")");if(h.test(a))return!0}return!1},isPortuguesePhone:function(a){return this.isPTPhone(a)},isCVPhone:function(a){a=a.toString();var b=[];for(var c in this._indicativosCV)"string"==typeof this._indicativosCV[c]&&b.push(c);var d=b.join("|"),e=/^(00238|\+238)/;e.test(a)&&(a=a.replace(e,""));var f=/(\s|\-|\.)+/g;a=a.replace(f,"");var g=/[\d]{7}/i;if(7===a.length&&g.test(a)){var h=new RegExp("^("+d+")");if(h.test(a))return!0}return!1},isAOPhone:function(a){a=a.toString();var b=[];for(var c in this._indicativosAO)"string"==typeof this._indicativosAO[c]&&b.push(c);var d=b.join("|"),e=/^(00244|\+244)/;e.test(a)&&(a=a.replace(e,""));var f=/(\s|\-|\.)+/g;a=a.replace(f,"");var g=/[\d]{9}/i;if(9===a.length&&g.test(a)){var h=new RegExp("^("+d+")");if(h.test(a))return!0}return!1},isMZPhone:function(a){a=a.toString();var b=[];for(var c in this._indicativosMZ)"string"==typeof this._indicativosMZ[c]&&b.push(c);var d=b.join("|"),e=/^(00258|\+258)/;e.test(a)&&(a=a.replace(e,""));var f=/(\s|\-|\.)+/g;a=a.replace(f,"");var g=/[\d]{8,9}/i;if((9===a.length||8===a.length)&&g.test(a)){var h=new RegExp("^("+d+")");if(h.test(a)){if(0===a.indexOf("2")&&8===a.length)return!0;if(0===a.indexOf("8")&&9===a.length)return!0}}return!1},isTLPhone:function(a){a=a.toString();var b=[];for(var c in this._indicativosTL)"string"==typeof this._indicativosTL[c]&&b.push(c);var d=b.join("|"),e=/^(00670|\+670)/;e.test(a)&&(a=a.replace(e,""));var f=/(\s|\-|\.)+/g;a=a.replace(f,"");var g=/[\d]{7}/i;if(7===a.length&&g.test(a)){var h=new RegExp("^("+d+")");if(h.test(a))return!0}return!1},isPhone:function(){var a;if(0===arguments.length)return!1;var b=arguments[0];if(arguments.length>1){if(arguments[1].constructor!==Array){if("function"==typeof this["is"+arguments[1].toUpperCase()+"Phone"])return this["is"+arguments[1].toUpperCase()+"Phone"](b);throw"Invalid Country Code!"}var c;for(a=0;a=0&&b[j-1]<=100))return!1;c=!0}if(1===j||3===j||5===j&&("undefined"==typeof b[j+1]||""===b[j+1])){if(!("undefined"!=typeof b[j]&&b[j]>=0&&b[j]<=255))return!1;c=!0}}if(null!==(b=h.exec(a))||null!==(b=i.exec(a)))for(j=b.length;j--;){if(3===j||5===j){if(!("undefined"!=typeof b[j-1]&&"undefined"!=typeof b[j]&&""!==b[j]&&b[j-1]>=0&&b[j-1]<=100))return!1;c=!0}if(1===j){if(!("undefined"!=typeof b[j]&&b[j]>=0&&b[j]<=360))return!1;c=!0}}return c},isIP:function(a,b){if("string"!=typeof a)return!1;switch(b=(b||"ipv4").toLowerCase()){case"ipv4":return/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(a);case"ipv6":return/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/.test(a);default:return!1}},_creditCardSpecs:{"default":{length:"13,14,15,16,17,18,19",prefix:/^.+/,luhn:!0},"american express":{length:"15",prefix:/^3[47]/,luhn:!0},"diners club":{length:"14,16",prefix:/^36|55|30[0-5]/,luhn:!0},discover:{length:"16",prefix:/^6(?:5|011)/,luhn:!0},jcb:{length:"15,16",prefix:/^3|1800|2131/,luhn:!0},maestro:{length:"16,18",prefix:/^50(?:20|38)|6(?:304|759)/,luhn:!0},mastercard:{length:"16",prefix:/^5[1-5]/,luhn:!0},visa:{length:"13,16",prefix:/^4/,luhn:!0}},_luhn:function(a){if(a=parseInt(a,10),"number"!=typeof a&&a%1!==0)return!1;a+="";var b=a.length,c,d=0;for(c=b-1;c>=0;c-=2)d+=parseInt(a.substr(c,1),10);for(c=b-2;c>=0;c-=2){var e=parseInt(2*a.substr(c,1),10);d+=e>=10?e-9:e}return d%10===0},isCreditCard:function(a,b){if(/\d+/.test(a)===!1)return!1;if("undefined"==typeof b)b="default";else if(b instanceof Array){var c,d=b.length;for(c=0;d>c;c++)if(this.isCreditCard(a,b[c]))return!0;return!1}if(b=b.toLowerCase(),"undefined"==typeof this._creditCardSpecs[b])return!1;var e=a.length+"";return-1===this._creditCardSpecs[b].length.split(",").indexOf(e)?!1:this._creditCardSpecs[b].prefix.test(a)?this._creditCardSpecs[b].luhn===!1?!0:this._luhn(a):!1}};return a}); +//# sourceMappingURL=ink-all.min.map \ No newline at end of file diff --git a/public/js/ink-all.min.map b/public/js/ink-all.min.map new file mode 100644 index 0000000..6a1f110 --- /dev/null +++ b/public/js/ink-all.min.map @@ -0,0 +1 @@ +{"version":3,"file":"ink-all.min.js","sources":["../../src/js/Ink/1/lib.js","../../src/js/Ink/Net/Ajax/1/lib.js","../../src/js/Ink/Net/JsonP/1/lib.js","../../src/js/Ink/Dom/Browser/1/lib.js","../../src/js/Ink/Dom/Css/1/lib.js","../../src/js/Ink/Dom/Element/1/lib.js","../../src/js/Ink/Dom/Event/1/lib.js","../../src/js/Ink/Dom/FormSerialize/1/lib.js","../../src/js/Ink/Dom/Loaded/1/lib.js","../../src/js/Ink/Dom/Selector/1/lib.js","../../src/js/Ink/UI/Animate/1/lib.js","../../src/js/Ink/UI/Carousel/1/lib.js","../../src/js/Ink/UI/Close/1/lib.js","../../src/js/Ink/UI/Common/1/lib.js","../../src/js/Ink/UI/DatePicker/1/lib.js","../../src/js/Ink/UI/Draggable/1/lib.js","../../src/js/Ink/UI/Drawer/1/lib.js","../../src/js/Ink/UI/Dropdown/1/lib.js","../../src/js/Ink/UI/Droppable/1/lib.js","../../src/js/Ink/UI/FormValidator/1/lib.js","../../src/js/Ink/UI/FormValidator/2/lib.js","../../src/js/Ink/UI/ImageQuery/1/lib.js","../../src/js/Ink/UI/LazyLoad/1/lib.js","../../src/js/Ink/UI/Modal/1/lib.js","../../src/js/Ink/UI/Pagination/1/lib.js","../../src/js/Ink/UI/ProgressBar/1/lib.js","../../src/js/Ink/UI/SmoothScroller/1/lib.js","../../src/js/Ink/UI/SortableList/1/lib.js","../../src/js/Ink/UI/Spy/1/lib.js","../../src/js/Ink/UI/Stacker/1/lib.js","../../src/js/Ink/UI/Sticky/1/lib.js","../../src/js/Ink/UI/Swipe/1/lib.js","../../src/js/Ink/UI/Table/1/lib.js","../../src/js/Ink/UI/Tabs/1/lib.js","../../src/js/Ink/UI/TagField/1/lib.js","../../src/js/Ink/UI/Toggle/1/lib.js","../../src/js/Ink/UI/Tooltip/1/lib.js","../../src/js/Ink/UI/TreeView/1/lib.js","../../src/js/Ink/UI/Upload/1/lib.js","../../src/js/Ink/Util/Array/1/lib.js","../../src/js/Ink/Util/BinPack/1/lib.js","../../src/js/Ink/Util/Cookie/1/lib.js","../../src/js/Ink/Util/Date/1/lib.js","../../src/js/Ink/Util/Dumper/1/lib.js","../../src/js/Ink/Util/I18n/1/lib.js","../../src/js/Ink/Util/Json/1/lib.js","../../src/js/Ink/Util/String/1/lib.js","../../src/js/Ink/Util/Url/1/lib.js","../../src/js/Ink/Util/Validator/1/lib.js"],"names":["window","document","paths","modules","modulesLoadOrder","modulesRequested","pendingRMs","modulesWaitingForDeps","apply","Function","prototype","isEmptyObject","o","k","hasOwnProperty","Ink","VERSION","_checkPendingRequireModules","I","F","dep","mod","cb","pRMs","length","left","args","remaining","push","setTimeout","getPath","key","noLib","split","curKey","i","root","path","slice","join","test","setPath","rootURI","replace","loadScript","uri","contentType","indexOf","givenUri","this","Error","scriptEl","createElement","setAttribute","onerror","onreadystatechange","ev","event","type","readyState","error","aHead","getElementsByTagName","appendChild","_loadLater","namespace","ns","returnParentAndKey","levels","nsobj","parent","f","getModule","version","createModule","ver","deps","modFn","modAll","Array","call","arguments","moduleContent","_version","isInkModule","t","requireModules","cbFn","undefined","_moduleRenames","warn","Ink.UI.Aux_1","getModulesLoadOrder","getModuleScripts","mlo","unshift","map","m","getModuleURL","createExt","moduleName","dependencies","bind","fn","context","innerArgs","finalArgs","concat","bindMethod","object","methodName","bindEvent","id","getElementById","ss","rule","from","Dom","Selector","select","s","extendObj","destination","sources","len","property","Object","log","console","Ajax","url","options","init","globalOptions","parameters","requestHeaders","xMLHttpRequestWithCredentials","XMLHttpRequest","userOptions","asynchronous","method","timeout","delay","postBody","onComplete","onSuccess","onFailure","onException","onHeaders","onCreate","onInit","onTimeout","sanitizeJSON","evalJS","xhrProxy","cors","debug","useCredentials","signRequest","globalParameters","paramsObjToStr","safeCall","urlLocation","_locationFromURL","isHTTP","_locationIsHTTP","isCrossDomain","_locationIsCrossDomain","location","requestHasBody","search","transport","getTransport","request","createElementNS","href","protocol","match","widget","host","usingXDomainReq","XDomainRequest","ActiveXObject","e","setHeaders","headers","Accept","Accept-Language","navigator","language","X-Requested-With","X-Ink-Version","headerReqName","overrideMimeType","userAgent","Connection","headerName","setRequestHeader","optParams","p","a","params","toString","isNaN","encodeURIComponent","pop","setParams","getHeader","name","getResponseHeader","getAllHeaders","getAllResponseHeaders","getResponse","r","headerJSON","responseJSON","timeTaken","Date","startTime","requestedUrl","responseText","responseXML","status","statusText","abort","clearTimeout","delayTimeout","stoTimeout","ex","finish","runStateChange","rs","getTime","responseContent","response","curStatus","makeError","isSuccess","headerContentType","evalJSON","mimeType","xmlDoc","DOMParser","parseFromString","xml","destroy","listener","first","rethrow","exception","message","stacktrace","stack","value","nodeType","crossDomain","open","withCredentials","onload","send","code","isJSON","str","strJSON","sanitize","JSON","parse","eval","load","callback","ping","JsonP","failureObj","callbackParam","internalCallback","randVar","parseInt","Math","random","Net","_removeScriptTag","_addScriptTag","_addParamsToGet","hasQuestionMark","sep","pKey","pValue","parts","_getScriptContainer","headEls","scriptEls","rnd_seed","src","scriptCtn","_requestFailed","scriptUri","getAttribute","parentNode","removeChild","Browser","IE","GECKO","OPERA","SAFARI","KONQUEROR","CHROME","model","cssPrefix","domPrefix","detectBrowser","setDimensions","setReferrer","myWidth","myHeight","innerWidth","innerHeight","documentElement","clientWidth","clientHeight","body","windowWidth","windowHeight","referrer","escape","_sniffUserAgent","sAgent","toLowerCase","rVersion","re","RegExp","reVersion","alert","getCs","defaultView","getComputedStyle","Css","addRemoveClassName","elm","className","addRemState","addClassName","removeClassName","classList","add","hasClassName","remove","elmClassName","setClassName","all","has","contains","blinkClass","element","negate","Number","toggleClassName","forceAdd","toggle","setOpacity","val","style","opacity","filter","_camelCase","_","$1","toUpperCase","getStyle","currentStyle","charAt","css","parseFloat","setStyle","cssText","prop","styleFloat","cssFloat","show","forceDisplayProperty","display","hide","showHide","forceShow","_getRefTag","head","firstElementChild","child","firstChild","nextSibling","appendStyleTag","selector","force","styles","oldStyle","l","innerHTML","defStyle","refTag","styleStr","styleSheet","createTextNode","insertBefore","appendStylesheet","media","rel","_loadingCSSFiles","_loadedCSSFiles","appendStylesheetCb","cbs","linkEl","headEl","imgEl","_url","callbacks","decToHex","dec","normalizeTo2","rDec","gDec","g","bDec","b","rgb","hexToDec","hex","substr","getPropertyFromStylesheet","getRuleFromStylesheet","getPropertyFromStylesheet2","rules","getRulesFromStylesheet","x","sheet","ri","rf","styleSheets","si","sf","cssRules","selectorText","res","getPropertiesFromRule","props","steps","pre","pos","substring","borderTopLeftRadius","borderBottomRightRadius","borderTopRightRadius","borderBottomLeftRadius","changeFontSize","delta","op","minVal","maxVal","that","TypeError","el","els","fontSize","rect","elem","dimensions","getBoundingClientRect","top","offsetTop","offsetLeft","createContextualFragmentSupport","createRange","Range","createContextualFragment","deleteThisTbodyToken","browserCreatesTbodies","div","InkElement","isDOMElement","get","create","tag","properties","parEl","scrollTo","scrollIntoView","elmOffset","elmTop","elmLeft","offsetParent","y","offset","positionedOffset","valueTop","valueLeft","tagName","position","doc","ownerDocument","docElem","box","clientTop","clientLeft","scrollTop","pageYOffset","scrollLeft","pageXOffset","scroll","_getPropPx","cs","n","c","getPropertyValue","offset2","hasAttribute","attr","insertAfter","newElm","targetElm","insertTop","insertBottom","textContent","node","text","innerText","lastChild","childNodes","nodeValue","setTextContent","isLink","hasAttributeNS","isAncestorOf","ancestor","compareDocumentPosition","descendantOf","descendant","lastElementChild","previousSibling","nextElementSibling","sibling","previousElementSibling","elementWidth","offsetWidth","elementHeight","offsetHeight","elementLeft","elementTop","elementDimensions","outerDimensions","bbox","right","bottom","inViewport","opts","dims","partial","margin","viewportWidth","viewportHeight","isHidden","w","h","isVisible","clonePosition","cloneTo","cloneFrom","ellipsizeText","overflow","whiteSpace","textOverflow","findUpwardsHaving","boolTest","findUpwardsByClass","tst","cls","findUpwardsByTag","nodeName","findUpwardsById","findUpwardsBySelector","sel","matchesSelector","getChildrenText","removeIt","j","part","nodes","jLen","_trimString","String","data","trim","getSelectValues","selectEl","values","_normalizeData","d","data2","fillSelect","container","skipEmpty","defaultValue","containerEl","optionEl","fillRadios","insertAfterEl","splitEl","inputEl","checked","fillChecks","parentIndexOf","parentEl","childEl","idx","nextSiblings","elements","siblings","children","index","previousSiblings","childElementCount","_wrapElements","TABLE","html","TBODY","THEAD","TFOOT","TR","_getWrapper","wrapper","wrapFunc","tds","tbody","appendHTML","prependHTML","setHTML","wrap","target","nextNode","unwrap","wrapperSelector","replacement","replaceChild","removeTextNodeChildren","prevEl","toRemove","htmlToFragment","range","createDocumentFragment","selectNode","fragment","tempElement","current","InkDomSelector","dataset","attrs","attributes","curAttr","curAttrName","curAttrValue","total","moveCursorTo","setSelectionRange","createTextRange","collapse","moveEnd","moveStart","pageWidth","xScroll","scrollMaxX","scrollWidth","self","pageHeight","yScroll","scrollMaxY","scrollHeight","bean","definition","win","old","namespaceRegex","nameRegex","addEvent","removeEvent","W3C_MODEL","eventSupport","ONE","str2arr","isString","isFunction","standardNativeEvents","w3cNativeEvents","nativeEvents","hash","events","customEvents","isAncestor","check","related","relatedTarget","prefix","mouseenter","base","condition","mouseleave","mousewheel","Event","commonProps","mouseProps","mouseWheelProps","keyProps","textProps","touchProps","messageProps","stateProps","overOutRegex","typeFixers","reg","fix","newEvent","keyCode","which","rightClick","button","pageX","pageY","clientX","clientY","typeFixerMap","isNative","parentWindow","originalEvent","isBean","srcElement","fixer","preventDefault","returnValue","stopPropagation","cancelBubble","stop","stopped","stopImmediatePropagation","isImmediatePropagationStopped","clone","currentTarget","ne","targetElement","RegEntry","wrappedHandler","eargs","findTarget","eventElement","__beanDel","ft","handler","original","namespaces","customType","once","removeListener","eventType","inNamespaces","checkNamespaces","matches","checkElement","checkOriginal","checkHandler","registry","forAll","pfx","list","entries","entry","put","del","splice","removed","selectorEngine","setSelectorEngine","querySelectorAll","rootListener","propertyName","listeners","custom","attachEvent","detachEvent","rm","originalFn","orgType","handlers","delegate","array","fireListener","evt","createEvent","dispatchEvent","fireEvent","createEventObject","off","typeSpec","isTypeStr","on","types","delfn","one","fire","names","beanDel","noConflict","cleanup","CollectGarbage","InkEvent","KEY_BACKSPACE","KEY_TAB","KEY_RETURN","KEY_ESC","KEY_SPACE","KEY_LEFT","KEY_UP","KEY_RIGHT","KEY_DOWN","KEY_DELETE","KEY_HOME","KEY_END","KEY_PAGEUP","KEY_PAGEDOWN","KEY_INSERT","throttle","func","wait","lastCall","throttled","now","timeDiff","delegationTarget","fromElement","toElement","findElement","elmTagName","observe","eventName","callBack","useCapture","addEventListener","observeOnce","onceBack","stopObserving","observeMulti","observeDelegated","cursor","Selector_1","removeEventListener","cancel","stopDefault","pointer","pointerX","pointerY","touches","isLeftClick","isRightClick","isMiddleClick","getCharFromKeyboardEvent","changeCasing","fromCharCode","shiftOn","shiftKey","InkArray","isArrayIsh","obj","isArray","toArray","FormSerialize","serialize","form","out","emptyArrayToken","pairs","asPairs","emptyArray","forEach","pair","_resultsInArray","emit","serializeEl","multiple","didEmit","thisOption","inputs","_isSerialized","fillIn","map2","_objToPairs","_fillInPairs","groupBy","reduce","_fillInOne","firstOne","firstNodeName","firstType","isSelectMulti","_fillInBoolean","min","checkAttr","input","isChecked","inArray","Loaded","_contexts","run","cbQueue","done","checkState","_checkState","poll","_poll","ael","rem","det","wet","csf","alreadyLoaded","frameElement","doScroll","where","_ready","rnative","createCache","cache","keys","Expr","cacheLength","shift","markFunction","expando","assert","Sizzle","results","seed","groups","nid","newContext","newSelector","preferredDoc","setDocument","documentIsHTML","rquickExpr","exec","support","getElementsByClassName","qsa","rbuggyQSA","tokenize","rescape","toSelector","rsibling","qsaError","removeAttribute","rtrim","siblingCheck","cur","diff","sourceIndex","MAX_NEGATIVE","createInputPseudo","createButtonPseudo","createPositionalPseudo","argument","matchIndexes","parseOnly","matched","tokens","soFar","preFilters","cached","tokenCache","preFilter","rcomma","rcombinators","matchExpr","addCombinator","matcher","combinator","dir","checkNonElements","doneName","outerCache","dirkey","dirruns","cachedruns","elementMatcher","matchers","condense","unmatched","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","elems","multipleContexts","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","relative","implicitRelative","matchContext","matchAnyContext","outermostContext","matcherFromGroupMatchers","elementMatchers","setMatchers","matcherCachedRuns","bySet","byElement","superMatcher","expandContext","setMatched","matchedCount","outermost","contextBackup","find","dirrunsUnique","uniqueSort","contexts","token","runescape","funescape","compile","setFilters","getText","isXML","recompare","sortInput","rbuggyMatches","classCache","compilerCache","hasDuplicate","sortOrder","strundefined","arr","push_native","whitespace","characterEncoding","identifier","operators","pseudos","rpseudo","ridentifier","ID","CLASS","NAME","TAG","ATTR","PSEUDO","CHILD","needsContext","rinputs","rheader","rattributeQuotes","escaped","high","createComment","getByName","pass","getElementsByName","sortDetached","div1","attrHandle","attrId","getAttributeNode","tmp","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","adown","bup","compare","aup","ap","bp","expr","ret","specified","msg","duplicates","detectDuplicates","sortStable","sort","selectors","createPseudo",">"," ","+","~","excess","unquoted","pattern","operator","result","what","last","simple","forward","ofType","nodeIndex","start","useCache","pseudo","not","lang","elemLang","focus","activeElement","hasFocus","tabIndex","enabled","disabled","selected","selectedIndex","empty","header","eq","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","group","filters","Common","Animate","BaseUIComponent","animationPrefix","animationEndEventName","animation","oAnimation","msAnimation","webkitAnimation","_name","_optionDefinition","trigger","duration","removeClass","onEnd","_init","_options","animate","_element","_animationPrefix","animationSupported","onAnimationEnd","animationName","elOrSelector","createUIComponent","Pagination","limitRange","max","Carousel","setTransitionProperty","newTransition","transitionProperty","oTransitionProperty","msTransitionProperty","mozTransitionProperty","webkitTransitionProperty","requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","autoAdvance","axis","initialPage","spaceAfterLastSlide","hideLast","center","keyboardSupport","pagination","onChange","swipe","_handlers","paginationChange","windowResize","_isY","ulEl","_ulEl","_currentPage","refit","_setUpPagination","_setUpAutoAdvance","_setUpHider","size","perpendicular","_liEls","numSlides","contRect","_ctnLength","_elLength","_slidesPerPage","floor","isFinite","numPages","ceil","numPagesChanged","_numPages","_deltaLength","_center","_updateHider","_IE7","_pagination","setSize","setPage","getPage","setCurrent","nextPage","hiderEl","_hiderEl","gap","pad","padding","slides","stl","_onTouchStart","_swipeData","ulRect","firstUlPos","inUlX","inUlY","_touchMoveIsFirstTouchMove","_onTouchMove","deltaY","abs","deltaX","_scrolling","_onAnimationFrame","pointerPos","swipeData","elRect","newPos","_onTouchEnd","snapToNext","relProgress","curPage","progressInPages","_onPaginationChange","pgn","_setPage","getCurrent","page","_lengthToGo","isLastPage","_itemsInLastPage","previousPage","getSlidesPerPage","getTotalPages","getStageElm","getSlidesList","getTotalSlides","Close","Url","warnStub","constructor","stub","_componentOptions","elementIsOptional","elsOrSelector","isValidInstance","_validateInstance","registerInstance","_stubInstance","nothing","es6WeakMapSupport","instances","WeakMap","domRegistry","__InkInstances","set","thing","Layouts","TINY","SMALL","MEDIUM","LARGE","XLARGE","isInteger","fieldName","required","fieldId","defaults","overrides","optionValue","lType","defaultVal","invalidThrow","_coerce_funcs","fromDataAttrs","dataAttrs","_coerce_from_string","_options_validate","invalid","quote","invalidStr","paramName","_options_validate_types","number","boolean","string","function","integer","round","stringify","childIndex","ajaxJSON","endpoint","currentLayout","v","detectorEl","hashSet","hashParams","getAnchorString","genQueryString","cleanChildren","storeIdAndClasses","fromEl","inObj","_id","classes","_classes","restoreIdAndClasses","toEl","_instanceId","_warnDoubleInstantiation","newInstance","getName","getInstance","nameWithoutVersion","inst","unregisterInstance","UIComponent","getInstanceFromSelector","getInstanceIds","getInstances","destroyComponent","instance","err","_validate","_validationError","getOption","setOption","getElement","theConstructor","assertProp","propType","propVal","_oldProto","hideF","InkDate","clamp","dateishFromYMDString","YMD","dateishFromYMD","year","month","day","_year","_month","_day","dateishFromDate","date","getFullYear","getMonth","getDate","DatePicker","autoOpen","cleanText","closeText","pickerField","containerElement","cssClass","dateRange","displayInSelect","dayField","monthField","yearField","format","nextLinkText","ofText","onFocus","onMonthSelected","onSetDate","onYearSelected","prevLinkText","showClean","showClose","shy","startDate","startWeekDay","validDayFn","validMonthFn","validYearFn","nextValidDateFn","prevValidDateFn","yearRange",1,2,3,4,5,6,7,8,9,10,11,12,"wDay","_dateParsers","_hoverPicker","_picker","_setMinMax","setDate","_lang","_render","_listenToContainerObjectEvents","_containerObject","_renderSuperTopBar","calendarTop","_monthDescContainer","_monthPrev","_monthNext","_monthContainer","_monthSelector","_renderMonthSelector","_yearSelector","_appendDatePickerToDom","_renderMonth","_monthChanger","_ofText","_yearChanger","inline","_addOpenCloseEvents","_addDateChangeHandlersToInputs","fields","_updateDate","_showDefaultView","_inline","_hide","opener","cannotBe","ulSelector","mon","_renderMonthButton","liMonth","data-cal-month","appendTarget","parentIsControl","_wrapper","_wrapperIsControl","_superTopBar","_onClick","_onRelativeChangerClick","_onAbsoluteChangerClick","_showMonthSelector","_showYearSelector","_clean","_updateDescription","changeYear","change_year_next","change_year_prev","changeMonth","change_month_next","change_month_prev","_updateCal","elemData","calDay","calMonth","calYear","_changeYear","blur","noLimits","_min","noMinLimit","_max","noMaxLimit","MAX_VALUE","dates","rDate","each","noLim","lim","_daysInMonth","valid","_dateCmp","_fitDateToRange","_isValidDate","_dateWithinRange","_dateAboveMax","_dateBelowMin","oth","_dateCmpUntil","depth","_getPrevMonth","_getNextMonth","dataParsed","_parseDate","_setDate","inc","_incrementViewingYear","firstYear","thisYear","yearUl","prevYearLi","_getYearButton","nextYearLi","_acceptableYear","li","data-cal-year","_addMonthClassNames","dateStr","yearRegExp","validOneOrTwo","_isDate","_acceptableDay","_acceptableDateComponent","_acceptableMonth","userCb","_callUserCallbackBool","_writeDateInFormat","dateString","auxDate","objClicked","dt","_updateMonth","_y","_m","exceptions","incValue","_tryLeap","_getPrevYear","_getNextYear","atomName","directionName","advancer","maxOrMin","boundary","leapUserCb","_callUserCallbackDate","_getNextDecade","decade","_getCurrentDecade","_getPrevDecade","_callUserCallbackBase","yyyy-mm-dd","yyyy/mm/dd","yy-mm-dd","yy/mm/dd","dd-mm-yyyy","dd/mm/yyyy","dd-mm-yy","dd/mm/yy","mm/dd/yyyy","mm-dd-yyyy","_getMonthCalendarHeader","_getDayButtons","_getFirstDayIndex","wDayFirst","getDay","daysInMonth","ul","firstDayIndex","_getDayButton","dayButton","_addMonthButtonClassNames","btn","toDisable","showMonth","isMonthRendered","between","Draggable","constraint","constraintElm","handle","revert","zIndex","fps","droppableProxy","mouseAnchor","dragClass","skipChildren","onStart","onDrag","elmStartPosition","active","dragged","prevCoords","placeholder","zindex","firstDrag","deltaMs","lastRunAt","_onStart","dragFacade","_onDragFacade","drag","_onDrag","end","_onEnd","selectStart","_getCoords","ps","_cloneStyle","dst","borderWidth","width","height","tgtEl","originalPosition","marginTop","marginBottom","marginLeft","marginRight","visibility","delta2","ad","applyDelta","dragHandlerName","proxy","fs","backgroundColor","firstEl","mouseCoords","mPosX","mPosY","newX","newY","draggableSize","constTop","constBottom","constLeft","constRight","Droppable","updateAll","mouseCoords2","action","pt","Element","elNotFound","Drawer","parentSelector","leftDrawer","leftTrigger","rightDrawer","rightTrigger","contentDrawer","closeOnContentClick","closeOnLinkClick","mode","sides","_contentDrawers","_leftDrawer","_leftTriggers","_rightDrawer","_rightTriggers","_triggers","_isOpen","_direction","click","afterTransition","_afterTransition","_delay","_addEvents","triggerClicked","side","close","direction","Toggle","Dropdown","hoverOpen","dismissOnInsideClick","dismissOnOutsideClick","dismissAfter","onInsideClick","onOutsideClick","onOpen","onDismiss","_toggle","closeOnInsideClick","closeOnClick","onChangeState","newState","_openOrDismiss","_onMouseOver","getState","_openTimeout","_dismissTimeout","_onMouseOut","_onInsideClick","_handlerCall","dismiss","_onOutsideClick","foundElem","needle","foundTarget","callHandler","doNotInformToggle","_doNotInformToggle","setState","hAddClassName","hRemoveClassName","_droppables","_draggables","cleanStyle","draggable","opt","hoverClass","hoverclass","accept","onHover","onDrop","onDropOut","namedEventHandlers","move","droppable","copy","cloneNode","_findDraggable","originalParent","elementData","_update","_findData","elms","update","coords","InkValidator","elementsWithSameName","FormValidator","_flagMap","ink-fv-required","ink-fv-email","ink-fv-url","ink-fv-number","ink-fv-phone_pt","ink-fv-phone_cv","ink-fv-phone_mz","ink-fv-phone_ao","ink-fv-date","ink-fv-confirm","ink-fv-custom","confirmElms","hasConfirm","_errorClassName","_errorValidationClassName","_errorTypeWarningClassName","_errorTypeErrorClassName","validate","_free","onError","customFlag","confirmGroup","fail","_validateElements","_showError","_clearError","_clearCache","_getElements","formElms","curElm","totalElm","flag","flag2","oGroups","_makeConfirmGroups","errors","customErrors","_isValid","_isCustomValid","_validateConfirmGroups","curGroup","totalG","curFlag","tCustom","fieldType","inputType","_trim","aFormRadios","totalRadio","mail","isPTPhone","isCVPhone","isAOPhone","isMZPhone","validFormat","validValues","isDate","formElm","aFail","tFail","_showAnErrorOnElement","controlGroupElm","controlElm","errorClasses","_errorTypeClassName","errorMsg","aErrorLabel","control","aErrorLabel2","I18n","FormElement","validationFunctions","min_length","minSize","max_length","maxSize","exact_length","exactSize","email","fullCheck","ip","ipType","isIP","phone","phoneType","countryCode","credit_card","cardType","isCreditCard","alpha","supportSpaces","ascii","singleLineWhitespace","punctuation","unicode","unicodePunctuation","latin","latin1","latin1Punctuation","alpha_numeric","numbers","alpha_dash","dash","underscore","digit","positive","negative","decimalPlaces","decimal","decimalSeparator","leftDigits","decimalSep","maxDigits","numeric","minValue","maxValue","multipleOf","color","isColor","fieldToCompare","getFormElements","getValue","validationMessages","en_US","formvalidator.required","formvalidator.min_length","formvalidator.max_length","formvalidator.exact_length","formvalidator.email","formvalidator.url","formvalidator.ip","formvalidator.phone","formvalidator.credit_card","formvalidator.date","formvalidator.alpha","formvalidator.text","formvalidator.latin","formvalidator.alpha_numeric","formvalidator.alpha_dash","formvalidator.digit","formvalidator.integer","formvalidator.decimal","formvalidator.numeric","formvalidator.range","formvalidator.color","formvalidator.matches","formvalidator.validation_function_not_found","pt_PT","label","_errors","_rules","_value","_getLabel","_parseRules","rulesLength","paramStartPos","_addError","paramObj","field","i18nKey","getErrors","_formElements","eventTrigger","neverSubmit","searchFor","beforeValidation","setRule","errorMessage","getKey","langObj","dictObj","append","getI18n","setI18n","i18n","appendI18n","setLanguage","getRules","_rootElement","_errorMessages","_markedErrorElements","getElements","formElements","errorElement","errorElements","counter","cancelEventOnSuccess","formElement","controlGroupElement","controlElement","paragraph","errorArr","ImageQuery","retina","queries","onLoad","lastIndexOf","_filename","sortMulti","reverse","_onLoad","_onResize","_findCurrentQuery","devicePixelRatio","query","LazyLoad","item","source","scrollElement","touchEvents","onInsideViewport","onAfterAttributeChange","autoInit","_rootElm","_aData","_hasEvents","_activate","_getData","_onScrollThrottled","aElms","_onScroll","_removeEvents","_elInViewport","_userCallback","reload","upName","dimension","firstCharacter","maxName","Modal","opacitySupported","openModals","shadeClass","modalClass","triggerEvent","autoDisplay","markup","onShow","closeOnEscape","responsive","_onShadeClick","keyDown","_onKeyDown","resize","_wasDismissed","_markupMode","_modalDiv","_modalDivStyle","_modalShadow","_modalShadowStyle","_contentContainer","setContentMarkup","triggerElements","_reposition","runNow","_timeoutResizeFunction","_resizeTimeout","isPercentage","currentViewport","originalStatus","_resizeContainer","_shadeElement","alertsInTheModal","alertsLength","containerHeight","_modalHeader","_modalFooter","compatMode","_contentElement","_waitForFade","keyValue","htmlEl","transitionEndEventNames","classicName","evName","fadeChecker","getContentElement","contentMarkup","tempHeader","tempFooter","toAdd","genAEl","inner","aEl","wrapText","spanEl","totalItemCount","itemsPerPage","sideButtons","firstLabel","lastLabel","previousLabel","nextLabel","previousPageLabel","nextPageLabel","hashParameter","parentTag","childTag","wrapperClass","paginationClass","activeClass","disabledClass","hideClass","previousClass","previousPageClass","nextClass","nextPageClass","numberFormatter","_size","_calculateSize","_current","_itemLiEls","_generateMarkup","_updateItems","_observe","count","liEls","isSimpleToggle","liEl","_nextEl","pi","pf","_pageStart","_pageEnd","_page","_prevPageEl","hasPreviousPage","_nextPageEl","hasNextPage","_firstEl","isFirst","_lastEl","isLast","_prevEl","hasPrevious","hasNext","hasUlAlready","isChevron","isDotted","createLiEl","isPrev","isNext","isPrevPage","isNextPage","firstClass","lastClass","aElem","nr","setOnChange","sz","setSizeInItems","totalItems","pageNumber","isRelative","getSize","ProgressBar","startValue","_elementBar","setValue","newValue","cancelAnimationFrame","SmoothScroller","speed","changeHash","endPos","interval","onDone","onClick","render","link","thisDocument","linkedDocument","activeLiSelector","activeLi","Events","SortableList","hasTouch","maxTouchPoints","msMaxTouchPoints","placeholderClass","draggedClass","draggingClass","dragSelector","dragObject","handleSelector","moveSelector","swap","cancelMouseOut","down","_onDown","_onMove","up","_onUp","_isMoving","_down","_move","_up","stopMoving","_placeholder","_movePlaceholder","_addMovingClasses","touch","elementFromPoint","validateMove","droppedElement","_removeMovingClasses","target_position","placeholder_position","from_top","from_left","targetIndex","spyTargets","addSpied","spied","observeOnScroll","observingOnScroll","onScroll","onScrollForTarget","activeEl","findActiveElement","toDeactivate","menuLinkSelector","toActivate","closest","Infinity","closestIndex","bBox","Spy","Stacker","column","customBreakPoints","largeMax","largeMin","mediumMax","mediumMin","smallMax","smallMin","largeCols","mediumCols","smallCols","isOrdered","onRunCallback","onResizeCallback","onAPIReloadCallback","_aList","_curLayout","_runFirstTime","_getPageItemsToList","_canApplyLayoutChange","_applyLayoutChange","addItem","reloadItems","_removeDomItems","_setCurLayout","customBreakpoints","_getColumnsToShow","cols","curLayout","_aColumn","totalCols","aItems","aNewList","ii","countCol","Sticky","offsetBottom","topElement","stickyClass","inlineDimensions","inlinePosition","bottomElement","activateInLayouts","_dims","scrollTarget","_isDisabledInLayout","_getDims","unstick","_unstick","bottomOfSticky","maxBottomOfSticky","_stickTo","_inlineDimensions","_getBottomOffset","bottomOfViewport","toBottomOfDocument","oldPosition","oldWidth","dimensionsInStatic","Swipe","onMove","minDist","maxDist","minDuration","maxDuration","storeGesture","stopEvents","_supported","db","_isOn","_isMeOrParent","_pushGesture","_gesture","_time","changedTouches","_target","_t0","_p0","t1","gesture","p1","dr","dist","sqrt","time","overallMovement","overallTime","InkUrl","InkString","Json","maybeTurnIntoNumber","rNumber","cmp","numberishEnabledCmp","aValue","bValue","Table","sameSame","pageSize","caretUpClass","caretDownClass","createEndpointUrl","getDataFromEndPoint","processJSONRows","processJSONRow","processJSONField","processJSONHeaders","processJSONTotalRows","totalRows","getSortKey","allowResetSorting","visibleFields","tdClassNames","paginationOptions","_thead","tHead","createTHead","_headers","thClick","_originalFields","_sortableFields","_originalData","_data","_totalRows","_resetSortOrder","_addHeadersClasses","_setPagination","headerLabel","classNames","_onThClick","paginated","sortable","_invertSortOrder","_setSortOrderOfColumn","_paginate","sortAndReverse","isAscending","_sort","caretHtml","order","firstIndex","lastIndex","_registerFieldNames","_fieldIsVisible","userKey","keyFunction","columnIndex","columnName","trA","trB","elementA","elementB","_createHeadersFromJson","tr","insertRow","th","_createSingleHeaderFromJson","_createRowsFromJSON","rows","row","trIndex","_createSingleRowFromJson","rowIndex","_createFieldFromJson","fieldData","processor","_elOrFieldData","processed","isNumber","setEndpoint","currentPage","paginationEl","pageNo","_getSortOrder","_getDataViaAjax","_getUrl","urlCreator","parseUrl","sortField","endpointUri","success","JSONData","_onAjaxSuccess","getDataFromEndpoint","jsonResponse","_rowLength","Tabs","preventUrlChange","onBeforeChange","menuSelector","contentSelector","tabSelector","triggerEventsOnLoad","_menu","_initializeDom","_setFirstActive","contentTabs","activeMenuLink","_findLinkByHref","_changeTab","runCallbacks","activeTabs","_activeMenuTab","_activeSection","_activeMenuLink","_onTabClickedGeneric","_onTabClicked","tabElm","_dehashify","changeTab","_lastLayout","smallLayout","_hashify","links","disable","enable","activeTab","activeMenuTab","activeSection","activeContentTab","TagField","enterKey","backspaceKey","isTruthy","tags","tagQuery","tagQueryAsync","allowRepeated","maxTags","outSeparator","separator","autoSplit","_readInput","_viewElm","_input","_tagsFromMarkup","_tags","_onKeyUp","_onBlur","_refocus","tagname","option","_tagsToMarkup","_addTag","_removeTag","spc","_onEnterKeyDown","_onBackspaceKeyDown","_removeConfirm","_unsetRemovingVisual","_setRemovingVisual","tagIndex","_removeRemovingVisualTimeout","isAccordion","initialState","classNameOn","classNameOff","_targets","_accordion","_firstTime","_bindEvents","state","_onTriggerEvent","isAncestorOfClickedElement","some","thisOne","_updateAccordion","accordionElement","shades","ancestorOfTargets","shadesLength","Tooltip","EachTooltip","transitionDurationName","transitionPropertyName","transitionTimingFunctionName","bodies","spacing","forever","template","templatefield","fade","tooltips","tooltip","_destroy","_oppositeDirections","_onMouseMove","_delayTimeout","_makeTooltip","mousePosition","_getOpt","_createTooltipElement","_removeTooltip","_fadeInTooltipElement","_placeTooltipElement","_onTooltipMouseOver","_getFloatOpt","outerHTML","_getIntOpt","fadeTime","mPos","_setPos","targetElementPos","tleft","ttop","centerh","centerv","tooltipDims","elementDims","maxX","maxY","_getWhereValueInsideViewport","arrow","tooltipLeft","tooltipTop","toBottom","toRight","toLeft","toTop","viewport","dataAttrVal","instanceOption","_getMousePosition","pageDims","_getPageXY","elmDims","scrollDim","_getScroll","cWidth","cHeight","dd","TreeView","parentClass","openNodeClass","openClass","closedClass","iconTag","isParent","isOpen","_getIcon","_setNodeOpen","_getChild","beOpen","icon","DirectoryReader","maxDepth","_read","_readDirectories","running","_readEntries","currentEntry","createReader","readEntries","isDirectory","clearArray","fullPath","_stopActivityTimeout","readError","activity","checkActivity","clearInterval","readComplete","setInterval","Queue","lists","items","getItems","parentId","purge","keepList","pid","priority","view","_searchByPid","UI","Upload","_fileButton","fileButton","_dropzone","dropzone","_setDropEvent","_setFileButton","dropzones","ondrop","_dropEventHandler","ondragleave","_onDragLeave","ondragend","_onDragEndEventHandler","ondragdrop","ondragenter","_onDragEnterHandler","ondragover","_onDragOverHandler","publish","btns","_fileChangeHandler","files","FormData","_addFilesToQueue","_events","fileFormName","maxFilesize","INVALID_FILE_NAME","extraData","useChunks","chunkSize","minSizeToUseChunks","endpointChunk","endpointChunkCommit","foldersEnabled","directoryMaxDepth","_queueId","_queueRunning","_folders","_supportChunks","Blob","dataTransfer","_files","webkitGetAsEntry","folders","_addFolderToQueue","invalidFolders","getFiles","isFile","convertToFile","hasParent","getSubDirs","created","fileID","directory","_processQueue","internalUpload","queueLen","canceled","_doRequest","_upload","xhr","forceAbort","showError","lengthComputable","loaded","lastModifiedDate","upload","onprogress","chunk_offset","chunk_upload_id","fd","blob","upload_path","parentID","rootPath","invalidOffset","upload_id","chunk_expires","expires","onabort","abortAll","abortOne","subscribe","arrayProto","testedObject","outKey","latestGroup","initial","aKeys","shuffle","tmp1","rnd","filtered","intersect","arr1","arr2","shared","J","convert","unique","newArr","step","insert","rLen","output","iLen","Packer","fit","blocks","block","findNode","splitNode","used","GrowingPacker","growNode","canGrowDown","canGrowRight","shouldGrowRight","shouldGrowDown","growRight","growDown","sorts","area","msort","maxside","criteria","BinPack","binPack","bl","packer","sorter","dims2","fitted","unfitted","filled","Cookie","cookie","_Cookie","aCookie","aItem","decodeURIComponent","domain","secure","sName","sExpires","sPath","sDomain","sSecure","oDate","sDate","valueOf","nDate","expiresString","toGMTString","portClean","cookieName","expiresDate","_months","_iMonth","janeiro","jan","fevereiro","fev","março","mar","abril","abr","maio","mai","junho","jun","julho","jul","agosto","ago","setembro","outubro","novembro","nov","dezembro","dez","_wDays","_d","_iWeek","week","segunda","seg","terça","ter","quarta","qua","quinta","qui","sexta","sex","sábado","sáb","domingo","dom","nDays","_date","iFormat","escapeChar","jsDate","jsFirstDay","jsThisDay","jsHour","jsDay","suffixes","suffix","UTC","jsYearStart","days","jsMonth","getYear","jsYear","getHours","jsMinute","getMinutes","jsSecond","getSeconds","getTimezoneOffset","jsMinZone","jsMinutes","jsDayName","jsMonthName","str_date","mList","objIndex","dayY","dayW","hour","hourD","sec","msec","ampm","diffM","diffH","pattr","_haveDatetime","_haveYear","_haveYDay","_haveDay","_haveMonth","_haveMonthDay","_haveOnlyDay","_haveWDay","_haveWeek","_haveWeekWDay","_haveOnlyWDay","_validDate","_noDate","_haveHour12","_haveHour24","_haveHour","_haveMin","_haveSec","_haveMSec","_haveMoreM","_haveMoreS","_haveDiffM","_haveDiffH","dList","gmt","aux","Dumper","_tab","_formatParam","param","formated","_outputFormat","_getTabs","numberOfTabs","tabs","_i","dim","_typeof","printDump","write","returnDump","alertDump","windowDump","dumperwindow","pattrText","funcOrVal","dict","testMode","_dicts","_dict","_testMode","_gLang","bool","gLang","langGlobal","_gDict","pars","isObj","$2","$3","ntext","strSin","strPlur","ordinal","num","lastDig","ordDict","byLastDigit","alias","_gDicts","appendGlobal","twoDigits","function_call","cx","dateToISOString","toISOString","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","toFixed","InkJson","_nativeJSON","_convertToUnicode","_escape","theString","\b","\t","\n","\f","\r","\"","\\","charCodeAt","_toUnicode","unicodeString","inInt","theUnicode","_stringifyValue","toJSON","arrayString","objectString","convertToUnicode","reviver","walk","holder","SyntaxError","InkUtilString","_chars","_entities","_accentedChars","_accentedRemovedChars","_htmlUnsafeChars","<","&","'","ucFirst","firstWordOnly","replacer","stripTags","allowed","aAllowed","aNewAllowed","cleanedTag","strAllowed","reAllowed","aFoundTags","htmlEntitiesEncode","htmlEntitiesDecode","$0","utf8Encode","utfstring","shortString","words","resultstr","truncateString","utf8Decode","c2","c3","removeAccentedChars","newString","substrCount","haystack","htmlEscapeUnsafe","chars","normalizeWhitespace","toUnicode","unescape","es","hexNum","escapeText","txt","whiteList","txt2","C","escapedCharRegex","unescapeText","strcmp","str1","str2","packetize","maxLen","_keyStr","getUrl","getQueryString","aParams","queryStr","aQueryStr","pairVar","getAnchor","anchor","anchorStr","aAnchorStr","aURL","scheme","re1","re2","re3","regPort","tmpHost1","port","tmpHost2","tmpUserPass","user","urlObj","frag","hostname","currentScriptElement","aScripts","curScript","_debug","Validator","_countryCodes","_internacionalPT","_indicativosPT",21,22,231,232,233,234,235,236,238,239,241,242,243,244,245,249,251,252,253,254,255,256,258,259,261,262,263,265,266,268,269,271,272,273,274,275,276,277,278,279,281,282,283,284,285,286,289,291,292,295,296,91,93,96,92,707,760,800,808,30,"_internacionalCV","_indicativosCV",95,97,98,99,"_internacionalAO","_indicativosAO","_internacionalMZ","_indicativosMZ",82,84,"_internacionalTL","_indicativosTL","_characterGroups","asciiAlpha","latin1Alpha","unicodeAlpha","space","nicknamePunctuation","newline","asciiPunctuation","createRegExp","checkCharacterGroups","numb","inOptions","thousandSep","returnNumber","maxExcl","minExcl","_isLeapYear","parser","emailValido","full","reHTTP","reUrl","aInd","strInd","re351","reSpecialChars","reInt","reValid","isPortuguesePhone","re238","re244","re258","isTLPhone","re670","isPhone","codPostal","cp1","cp2","returnBothResults","cPostalSep","cPostal4","cPostal3","parserCPostal","cPostal","yearIndex","monthIndex","dayIndex","dateParser","keyword","hexa","rgba","hsl","hsla","_creditCardSpecs","default","luhn","american express","diners club","discover","jcb","maestro","mastercard","visa","_luhn","checksum","dbl","creditCardType","ccLength"],"mappings":"CAME,SAASA,EAAQC,GAEf,YAGA,MAAI,OAASD,IAAb,CASA,GAAIE,MACAC,KACAC,KACAC,KACAC,KACAC,KAEAC,EAAQC,SAASC,UAAUF,MAG3BG,EAAgB,SAASC,GAEzB,GAAiB,gBAANA,GAAkB,OAAO,CACpC,KAAK,GAAIC,KAAKD,GACV,GAAIA,EAAEE,eAAeD,GACjB,OAAO,CAGf,QAAO,EAOXb,GAAOe,KACHC,QAAS,QACTC,4BAA6B,WACzB,GAAIC,GAAGC,EAAGP,EAAGQ,EAAKC,EAAKC,EAAIC,IAC3B,KAAKL,EAAI,EAAGC,EAAIb,EAAWkB,OAAYL,EAAJD,IAASA,EAGxC,GAFAN,EAAIN,EAAWY,GAEf,CAEA,IAAKE,IAAOR,GAAEa,KACNb,EAAEa,KAAKX,eAAeM,KACtBC,EAAMlB,EAAQiB,GACVC,IACAT,EAAEc,KAAKd,EAAEa,KAAKL,IAASC,QAChBT,GAAEa,KAAKL,KACZR,EAAEe,WAKhB,IAAIf,EAAEe,UAAY,EACdJ,EAAKK,KAAKhB,OAET,CAED,GADAU,EAAKV,EAAEU,IACFA,EAAM,eACJV,GAAEU,GACTA,EAAGd,OAAM,EAAOI,EAAEc,OAI1BpB,EAAaiB,EAETjB,EAAWkB,OAAS,GACpBK,WAAY,WAAad,IAAIE,+BAAkC,IAYvEa,QA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,GAAsB,QAAM,GAC3C,EAGJzgG,KAAKsgG,MAAM/Q,IARP,GAYnB,OAAOkI","sourcesContent":["/**\n * Ink Core.\n * @module Ink_1\n * This module provides the necessary methods to create and load the modules using Ink.\n */\n\n;(function(window, document) {\n\n 'use strict';\n\n // skip redefinition of Ink core\n if ('Ink' in window) { return; }\n\n\n // internal data\n\n /*\n * NOTE:\n * invoke Ink.setPath('Ink', '/Ink/'); before requiring local modules\n */\n var paths = {};\n var modules = {};\n var modulesLoadOrder = [];\n var modulesRequested = {};\n var pendingRMs = [];\n var modulesWaitingForDeps = {};\n\n var apply = Function.prototype.apply;\n\n // auxiliary fns\n var isEmptyObject = function(o) {\n /*jshint unused:false */\n if (typeof o !== 'object') { return false; }\n for (var k in o) {\n if (o.hasOwnProperty(k)) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * @namespace Ink_1\n */\n\n window.Ink = {\n VERSION: '3.0.5',\n _checkPendingRequireModules: function() {\n var I, F, o, dep, mod, cb, pRMs = [];\n for (I = 0, F = pendingRMs.length; I < F; ++I) {\n o = pendingRMs[I];\n\n if (!o) { continue; }\n\n for (dep in o.left) {\n if (o.left.hasOwnProperty(dep)) {\n mod = modules[dep];\n if (mod) {\n o.args[o.left[dep] ] = mod;\n delete o.left[dep];\n --o.remaining;\n }\n }\n }\n\n if (o.remaining > 0) {\n pRMs.push(o);\n }\n else {\n cb = o.cb;\n if (!cb) { continue; }\n delete o.cb; // to make sure I won't call this more than once!\n cb.apply(false, o.args);\n }\n }\n\n pendingRMs = pRMs;\n\n if (pendingRMs.length > 0) {\n setTimeout( function() { Ink._checkPendingRequireModules(); }, 0 );\n }\n },\n\n /**\n * Get the full path of a module.\n * This method looks up the paths given in setPath (and ultimately the default Ink's path).\n *\n * @method getPath\n * @param {String} key Name of the module you want to get the path\n * @param {Boolean} [noLib] Flag to skip appending 'lib.js' to the returned path.\n */\n getPath: function(key, noLib) {\n var split = key.split(/[._]/g);\n var curKey;\n var i;\n var root;\n var path;\n\n // Look for Ink.Dom.Element.1, Ink.Dom.Element, Ink.Dom, Ink in this order.\n for (i = split.length; i >= 0; i -= 1) {\n curKey = split.slice(0, i + 1).join('.'); // See comment in setPath\n if (paths[curKey]) {\n root = curKey;\n break;\n }\n }\n\n if (root in paths) {\n path = paths[root];\n } else {\n return null;\n }\n\n if (!/\\/$/.test(path)) {\n path += '/';\n }\n if (i < split.length) {\n // Add the rest of the path. For example, if we found\n // paths['Ink.Dom'] to be 'http://example.com/Ink/Dom/',\n // we now add '/Element/' to get the full path.\n path += split.slice(i + 1).join('/') + '/';\n }\n if (!noLib) {\n path += 'lib.js';\n }\n return path;\n },\n \n /**\n * Sets the URL path for a namespace.\n * Use this to customize where requireModules and createModule will load dependencies from.\n * This can be useful to set your own CDN for dynamic module loading or simply to change your module folder structure\n * \n * @method setPath\n *\n * @param {String} key Module or namespace\n * @param {String} rootURI Base URL path and schema to be appended to the module or namespace\n *\n * @example\n * Ink.setPath('Ink', 'http://my-cdn/Ink/');\n * Ink.setPath('Lol', 'http://my-cdn/Lol/');\n *\n * // Loads from http://my-cdn/Ink/Dom/Whatever/lib.js\n * Ink.requireModules(['Ink.Dom.Whatever'], function () { ... });\n * // Loads from http://my-cdn/Lol/Whatever/lib.js\n * Ink.requireModules(['Lol.Whatever'], function () { ... });\n */\n setPath: function(key, rootURI) {\n // Replacing version separator with dot because the difference\n // between a submodule and a version doesn't matter here.\n // It would also overcomplicate the implementation of getPath\n paths[key.replace(/_/, '.')] = rootURI;\n },\n\n /**\n * Loads a script URL.\n * This creates a `script` tag in the `head` of the document.\n * Reports errors by listening to 'error' and 'readystatechange' events.\n *\n * @method loadScript\n * @param {String} uri Can be an external URL or a module name\n * @param {String} [contentType]='text/javascript' The `type` attribute of the new script tag.\n */\n loadScript: function(uri, contentType) {\n /*jshint evil:true */\n\n if (uri.indexOf('/') === -1) {\n var givenUri = uri; // For the error message\n uri = this.getPath(uri);\n if (uri === null) {\n throw new Error('Could not load script \"' + givenUri + '\". ' +\n 'Path not found in the registry. Did you misspell ' +\n 'the name, or forgot to call setPath()?');\n }\n }\n\n var scriptEl = document.createElement('script');\n scriptEl.setAttribute('type', contentType || 'text/javascript');\n scriptEl.setAttribute('src', uri);\n\n scriptEl.onerror = scriptEl.onreadystatechange = function (ev) {\n ev = ev || window.event;\n if (ev.type === 'readystatechange' && scriptEl.readyState !== 'loaded') {\n // if not readyState == 'loaded' it's not an error.\n return;\n }\n Ink.error(['Failed to load script from ', uri, '.'].join(''));\n };\n // CHECK ON ALL BROWSERS\n /*if (document.readyState !== 'complete' && !document.body) {\n document.write( scriptEl.outerHTML );\n }\n else {*/\n var aHead = document.getElementsByTagName('head');\n if(aHead.length > 0) {\n aHead[0].appendChild(scriptEl);\n }\n //}\n },\n\n _loadLater: function (dep) {\n setTimeout(function () {\n if (modules[dep] || modulesRequested[dep] ||\n modulesWaitingForDeps[dep]) {\n return;\n }\n modulesRequested[dep] = true;\n Ink.loadScript(dep);\n }, 0);\n },\n\n /**\n * Defines a module namespace.\n *\n * @method namespace\n * @param {String} ns Namespace to define.\n * @param {Boolean} [returnParentAndKey] Flag to change the return value to an array containing the namespace parent and the namespace key\n * @return {Object|Array} Returns the created namespace object\n */\n namespace: function(ns, returnParentAndKey) {\n if (!ns || !ns.length) { return null; }\n\n var levels = ns.split('.');\n var nsobj = window;\n var parent;\n\n for (var i = 0, f = levels.length; i < f; ++i) {\n nsobj[ levels[i] ] = nsobj[ levels[i] ] || {};\n parent = nsobj;\n nsobj = nsobj[ levels[i] ];\n }\n\n if (returnParentAndKey) {\n return [\n parent,\n levels[i-1]\n ];\n }\n\n return nsobj;\n },\n\n /**\n * Loads a module.\n * A synchronous method to get the module from the internal registry.\n * It assumes the module is defined and loaded already!\n *\n * @method getModule\n * @param {String} mod Module name\n * @param {Number} [version] Version number of the module\n * @return {Object|Function} Module object or function, depending how the module is defined\n */\n getModule: function(mod, version) {\n var key = version ? [mod, '_', version].join('') : mod;\n return modules[key];\n },\n\n /**\n * Creates a new module. \n * Use this to wrap your code and benefit from the module loading used throughout the Ink library\n *\n * @method createModule\n * @param {String} mod Module name, separated by dots. Like Ink.Dom.Selector, Ink.UI.Modal\n * @param {Number} version Version number\n * @param {Array} deps Array of module names which are dependencies of the module being created. The order in which they are passed here will define the order they will be passed to the callback function.\n * @param {Function} modFn The callback function to be executed when all the dependencies are resolved. The dependencies are passed as arguments, in the same order they were declared. The function itself should return the module.\n * @sample Ink_1_createModule.html \n *\n */\n createModule: function(mod, ver, deps, modFn) { // define\n if (typeof mod !== 'string') {\n throw new Error('module name must be a string!');\n }\n\n // validate version correctness\n if (!(typeof ver === 'number' || (typeof ver === 'string' && ver.length > 0))) {\n throw new Error('version number missing!');\n }\n\n var modAll = [mod, '_', ver].join('');\n\n modulesWaitingForDeps[modAll] = true;\n\n var cb = function() {\n //console.log(['createModule(', mod, ', ', ver, ', [', deps.join(', '), '], ', !!modFn, ')'].join(''));\n\n // make sure module in not loaded twice\n if (modules[modAll]) {\n //console.warn(['Ink.createModule ', modAll, ': module has been defined already.'].join(''));\n return;\n }\n\n\n // delete related pending tasks\n delete modulesRequested[modAll];\n delete modulesRequested[mod];\n\n\n // run module's supplied factory\n var args = Array.prototype.slice.call(arguments);\n var moduleContent = modFn.apply(window, args);\n modulesLoadOrder.push(modAll);\n // console.log('** loaded module ' + modAll + '**');\n\n\n // set version\n if (typeof moduleContent === 'object') { // Dom.Css Dom.Event\n moduleContent._version = ver;\n }\n else if (typeof moduleContent === 'function') {\n moduleContent.prototype._version = ver; // if constructor\n moduleContent._version = ver; // if regular function\n }\n\n\n // add to global namespace...\n var isInkModule = mod.indexOf('Ink.') === 0;\n var t;\n if (isInkModule) {\n t = Ink.namespace(mod, true); // for mod 'Ink.Dom.Css', t[0] gets 'Ink.Dom' object and t[1] 'Css'\n }\n\n\n // versioned\n modules[ modAll ] = moduleContent; // in modules\n delete modulesWaitingForDeps[ modAll ];\n\n if (isInkModule) {\n t[0][ t[1] + '_' + ver ] = moduleContent; // in namespace\n }\n\n\n // unversioned\n modules[ mod ] = moduleContent; // in modules\n\n if (isInkModule) {\n if (isEmptyObject( t[0][ t[1] ] )) {\n t[0][ t[1] ] = moduleContent; // in namespace\n }\n // else {\n // console.warn(['Ink.createModule ', modAll, ': module has been defined already with a different version!'].join(''));\n // }\n }\n\n\n if (this) { // there may be pending requires expecting this module, check...\n Ink._checkPendingRequireModules();\n }\n };\n\n this.requireModules(deps, cb);\n },\n\n /**\n * Requires modules asynchronously \n * Use this to get modules, even if they're not loaded yet\n *\n * @method requireModules\n * @param {Array} deps Array of module names. The order in which they are passed here will define the order they will be passed to the callback function. \n * @param {Function} cbFn The callback function to be executed when all the dependencies are resolved. The dependencies are passed as arguments, in the same order they were declared.\n * @sample Ink_1_requireModules.html \n */\n requireModules: function(deps, cbFn) { // require\n //console.log(['requireModules([', deps.join(', '), '], ', !!cbFn, ')'].join(''));\n var i, f, o, dep, mod;\n f = deps && deps.length;\n o = {\n args: new Array(f),\n left: {},\n remaining: f,\n cb: cbFn\n };\n\n if (!(typeof deps === 'object' && deps.length !== undefined)) {\n throw new Error('Dependency list should be an array!');\n }\n if (typeof cbFn !== 'function') {\n throw new Error('Callback should be a function!');\n }\n\n for (i = 0; i < f; ++i) {\n if (Ink._moduleRenames[deps[i]]) {\n Ink.warn(deps[i] + ' was renamed to ' + Ink._moduleRenames[deps[i]]);\n dep = Ink._moduleRenames[deps[i]];\n } else {\n dep = deps[i];\n }\n\n // Because trailing commas in oldIE bring us undefined values here\n if (!dep) {\n --o.remaining;\n continue;\n }\n\n mod = modules[dep];\n if (mod) {\n o.args[i] = mod;\n --o.remaining;\n continue;\n }\n else if (!modulesRequested[dep]) {\n Ink._loadLater(dep);\n }\n o.left[dep] = i;\n }\n\n if (o.remaining > 0) {\n pendingRMs.push(o);\n }\n else {\n cbFn.apply(true, o.args);\n }\n },\n\n _moduleRenames: {\n 'Ink.UI.Aux_1': 'Ink.UI.Common_1'\n },\n\n /**\n * Lists loaded module names.\n * The list is ordered by loaded time (oldest module comes first)\n *\n * @method getModulesLoadOrder\n * @return {Array} returns the order in which modules were resolved and correctly loaded\n */\n getModulesLoadOrder: function() {\n return modulesLoadOrder.slice();\n },\n\n /**\n * Builds the markup needed to load the modules.\n * This method builds the script tags needed to load the currently used modules\n * \n * @method getModuleScripts\n * @uses getModulesLoadOrder\n * @return {String} The script markup\n */\n getModuleScripts: function() {\n var mlo = this.getModulesLoadOrder();\n mlo.unshift('Ink_1');\n mlo = mlo.map(function(m) {\n return [''].join('');\n });\n\n return mlo.join('\\n');\n },\n \n /**\n * Creates an Ink.Ext module\n *\n * Does exactly the same as createModule but creates the module in the Ink.Ext namespace\n *\n * @method createExt\n * @uses createModule\n * @param {String} moduleName Extension name\n * @param {String} version Extension version\n * @param {Array} dependencies Extension dependencies\n * @param {Function} modFn Function returning the extension\n * @sample Ink_1_createExt.html \n */\n createExt: function (moduleName, version, dependencies, modFn) {\n return Ink.createModule('Ink.Ext.' + moduleName, version, dependencies, modFn);\n },\n\n /**\n * Function.prototype.bind alternative.\n * Creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.\n *\n * @method bind\n * @param {Function} fn The function \n * @param {Object} context The value to be passed as the this parameter to the target function when the bound function is called. If used as false, it preserves the original context and just binds the arguments.\n * @param {Any} [args*] Additional arguments will be sent to the original function as prefix arguments.\n * @return {Function}\n * @sample Ink_1_bind.html \n */\n bind: function(fn, context) {\n var args = Array.prototype.slice.call(arguments, 2);\n return function() {\n var innerArgs = Array.prototype.slice.call(arguments);\n var finalArgs = args.concat(innerArgs);\n return fn.apply(context === false ? this : context, finalArgs);\n };\n },\n\n /**\n * Function.prototype.bind alternative for class methods\n * Creates a new function that, when called, has this k\n * @method bindMethod\n * @uses bind\n * @param {Object} object The object that contains the method to bind\n * @param {String} methodName The name of the method that will be bound\n * @param {Any} [args*] Additional arguments will be sent to the new method as prefix arguments.\n * @return {Function}\n * @sample Ink_1_bindMethod.html \n */\n bindMethod: function (object, methodName) {\n return Ink.bind.apply(Ink,\n [object[methodName], object].concat([].slice.call(arguments, 2)));\n },\n\n /**\n * Function.prototype.bind alternative for event handlers.\n * Same as bind but keeps first argument of the call the original event.\n * Set \"context\" to `false` to preserve the original context of the function and just bind the arguments.\n *\n * @method bindEvent\n * @param {Function} fn The function \n * @param {Object} context The value to be passed as the this parameter to the target \n * @param {Any} [args*] Additional arguments will be sent to the original function as prefix arguments\n * @return {Function}\n * @sample Ink_1_bindEvent.html \n */\n bindEvent: function(fn, context) {\n var args = Array.prototype.slice.call(arguments, 2);\n return function(event) {\n var finalArgs = args.slice();\n finalArgs.unshift(event || window.event);\n return fn.apply(context === false ? this : context, finalArgs);\n };\n },\n\n /**\n * Alias to document.getElementById\n *\n * @method i\n * @param {String} id Element ID\n * @return {DOMElement}\n * @sample Ink_1_i.html \n */\n i: function(id) {\n if(!id) {\n throw new Error('Ink.i => id or element must be passed');\n }\n if(typeof(id) === 'string') {\n return document.getElementById(id);\n }\n return id;\n },\n\n /**\n * Alias for Ink.Dom.Selector\n *\n * @method ss\n * @uses Ink.Dom.Selector.select\n * @param {String} rule\n * @param {DOMElement} [from]\n * @return {Array} array of DOMElements\n * @sample Ink_1_ss.html \n */\n ss: function(rule, from)\n {\n if(typeof(Ink.Dom) === 'undefined' || typeof(Ink.Dom.Selector) === 'undefined') {\n throw new Error('This method requires Ink.Dom.Selector');\n }\n return Ink.Dom.Selector.select(rule, (from || document));\n },\n\n /**\n * Alias for Ink.Dom.Selector first result\n *\n * @method s\n * @uses Ink.Dom.Selector.select\n * @param {String} rule Selector string\n * @param {DOMElement} [from] Context element. If set to a DOM element, the rule will only look for descendants of this DOM Element.\n * @return {DOMElement}\n * @sample Ink_1_s.html \n */\n s: function(rule, from)\n {\n if(typeof(Ink.Dom) === 'undefined' || typeof(Ink.Dom.Selector) === 'undefined') {\n throw new Error('This method requires Ink.Dom.Selector');\n }\n return Ink.Dom.Selector.select(rule, (from || document))[0] || null;\n },\n\n /**\n * Extends an object with another\n * Copy all of the properties in one or more source objects over to the destination object, and return the destination object. It's in-order, so the last source will override properties of the same name in previous arguments.\n *\n * @method extendObj\n * @param {Object} destination The object that will receive the new/updated properties\n * @param {Object} source The object whose properties will be copied over to the destination object\n * @param {Object} [args*] Additional source objects. The last source will override properties of the same name in the previous defined sources\n * @return destination object, enriched with defaults from the sources\n * @sample Ink_1_extendObj.html \n */\n extendObj: function(destination/*, source... */) {\n var sources = [].slice.call(arguments, 1);\n\n for (var i = 0, len = sources.length; i < len; i++) {\n if (!sources[i]) { continue; }\n for (var property in sources[i]) {\n if(Object.prototype.hasOwnProperty.call(sources[i], property)) {\n destination[property] = sources[i][property];\n }\n }\n }\n\n return destination;\n },\n\n /**\n * Calls native console.log if available.\n *\n * @method log\n * @param {Any} [args*] Arguments to be evaluated\n * @sample Ink_1_log.html \n **/\n log: function () {\n // IE does not have console.log.apply in IE10 emulated mode\n var console = window.console;\n if (console && console.log) {\n apply.call(console.log, console, arguments);\n }\n },\n\n /**\n * Calls native console.warn if available.\n *\n * @method warn\n * @param {Any} [args*] Arguments to be evaluated\n * @sample Ink_1_warn.html \n **/\n warn: function () {\n // IE does not have console.log.apply in IE10 emulated mode\n var console = window.console;\n if (console && console.warn) {\n apply.call(console.warn, console, arguments);\n }\n },\n\n /**\n * Calls native console.error if available.\n *\n * @method error\n * @param {Any} [args*] Arguments to be evaluated\n * @sample Ink_1_error.html \n **/\n error: function () {\n // IE does not have console.log.apply in IE10 emulated mode\n var console = window.console;\n if (console && console.error) {\n apply.call(console.error, console, arguments);\n }\n }\n };\n\n\n // TODO for debug - to detect pending stuff\n /*\n var failCount = {}; // fail count per module name\n var maxFails = 3; // times\n var checkDelta = 0.5; //seconds\n\n var tmpTmr = setInterval(function() {\n var mk = Object.keys(modulesRequested);\n var l = mk.length;\n\n if (l > 0) {\n // console.log('** waiting for modules: ' + mk.join(', ') + ' **');\n\n for (var i = 0, f = mk.length, k, v; i < f; ++i) {\n k = mk[i];\n v = failCount[k];\n failCount[k] = (v === undefined) ? 1 : ++v;\n\n if (v >= maxFails) {\n console.error('** Loading of module ' + k + ' failed! **');\n delete modulesRequested[k];\n }\n }\n }\n else {\n // console.log('** Module loads complete. **');\n clearInterval(tmpTmr);\n }\n }, checkDelta*1000);\n */\n}(window, document));\n","/**\n * Cross Browser Ajax requests\n * @module Ink.Net.Ajax_1\n * @version 1\n */\n\nInk.createModule('Ink.Net.Ajax', '1', [], function() {\n\n 'use strict';\n\n /**\n * Creates a new XMLHttpRequest object\n *\n * @class Ink.Net.Ajax\n * @constructor\n *\n * @param {String} url Request URL\n * @param {Object} options Request options\n * @param {Boolean} [options.asynchronous]=true If false, the request synchronous.\n * @param {Boolean} [options.cors] Flag to activate CORS. Set this to true if you're doing a cross-origin request\n * @param {String} [options.method]='POST' HTTP request method. POST by default.\n * @param {Object|String} [options.parameters] Request parameters to be sent with the request\n * @param {Number} [options.timeout] Request timeout in seconds\n * @param {Number} [options.delay] Artificial delay. If the request is completed faster than this delay, wait the remaining time before executing the callbacks\n * @param {String} [options.postBody] POST request body. If not specified, it's filled with the contents from parameters\n * @param {String} [options.contentType] Content-type header to be sent. Defaults to 'application/x-www-form-urlencoded'\n * @param {Object} [options.requestHeaders] Key-value pairs for additional request headers\n * @param {Function} [options.onComplete] Callback executed after the request is completed, regardless of what happened during the request.\n * @param {Function} [options.onSuccess] Callback executed if the request is successful (requests with 2xx status codes)\n * @param {Function} [options.onFailure] Callback executed if the request fails (requests with status codes different from 2xx)\n * @param {Function} [options.onException] Callback executed if an exception occurs. Receives the exception as a parameter.\n * @param {Function} [options.onCreate] Callback executed after object initialization but before the request is made\n * @param {Function} [options.onInit] Callback executed before any initialization\n * @param {Function} [options.onTimeout] Callback executed if the request times out\n * @param {Boolean|String} [options.evalJS]=true If the request Content-type header is application/json, evaluates the response and populates responseJSON. Use 'force' if you want to force the response evaluation, no matter what Content-type it's using.\n * @param {Boolean} [options.sanitizeJSON] Flag to sanitize the content of responseText before evaluation\n * @param {String} [options.xhrProxy] URI for proxy service hosted on the same server as the web app, that can fetch documents from other domains. The service must pipe all input and output untouched (some input sanitization is allowed, like clearing cookies). e.g., requesting http://example.org/doc can become /proxy/http%3A%2F%2Fexample.org%2Fdoc The proxy service will be used for cross-domain requests, if set, else a network error is returned as exception.\n *\n * @sample Ink_Net_Ajax_1.html \n */\n var Ajax = function(url, options){\n\n // start of AjaxMock patch - uncomment to enable it\n /*var AM = SAPO.Communication.AjaxMock;\n if (AM && !options.inMock) {\n if (AM.autoRecordThisUrl && AM.autoRecordThisUrl(url)) {\n return new AM.Record(url, options);\n }\n if (AM.mockThisUrl && AM.mockThisUrl(url)) {\n return new AM.Play(url, options, true);\n }\n }*/\n // end of AjaxMock patch\n\n this.init(url, options);\n };\n\n /**\n * Options for all requests. These can then be overriden for individual ones.\n */\n Ajax.globalOptions = {\n parameters: {},\n requestHeaders: {}\n };\n\n\n // IE10 does not need XDomainRequest\n var xMLHttpRequestWithCredentials = 'XMLHttpRequest' in window && 'withCredentials' in (new XMLHttpRequest());\n\n\n\n Ajax.prototype = {\n\n init: function(url, userOptions) {\n if (!url) {\n throw new Error(\"WRONG_ARGUMENTS_ERR\");\n }\n var options = Ink.extendObj({\n asynchronous: true,\n method: 'POST',\n parameters: null,\n timeout: 0,\n delay: 0,\n postBody: '',\n contentType: 'application/x-www-form-urlencoded',\n requestHeaders: null,\n onComplete: null,\n onSuccess: null,\n onFailure: null,\n onException: null,\n onHeaders: null,\n onCreate: null,\n onInit: null,\n onTimeout: null,\n sanitizeJSON: false,\n evalJS: true,\n xhrProxy: '',\n cors: false,\n debug: false,\n useCredentials: false,\n signRequest: false\n }, Ajax.globalOptions);\n\n if (userOptions && typeof userOptions === 'object') {\n options = Ink.extendObj(options, userOptions);\n\n\n if (typeof userOptions.parameters === 'object') {\n options.parameters = Ink.extendObj(Ink.extendObj({}, Ajax.globalOptions.parameters), userOptions.parameters);\n } else if (userOptions.parameters !== null) {\n var globalParameters = this.paramsObjToStr(Ajax.globalOptions.parameters);\n if (globalParameters) {\n options.parameters = userOptions.parameters + '&' + globalParameters;\n }\n }\n\n options.requestHeaders = Ink.extendObj({}, Ajax.globalOptions.requestHeaders);\n options.requestHeaders = Ink.extendObj(options.requestHeaders, userOptions.requestHeaders);\n }\n\n this.options = options;\n\n this.safeCall('onInit');\n\n this.url = url;\n\n var urlLocation = this._locationFromURL(url);\n this.isHTTP = this._locationIsHTTP(urlLocation);\n this.isCrossDomain = this._locationIsCrossDomain(urlLocation, location);\n\n this.requestHasBody = options.method.search(/^get|head$/i) < 0;\n\n if(this.options.cors) {\n this.isCrossDomain = false;\n }\n\n this.transport = this.getTransport();\n\n this.request();\n },\n\n /**\n * Returns a location object from an URL\n *\n * @method _locationFromUrl\n * @param url\n * @private\n **/\n _locationFromURL: function (url) {\n var urlLocation = document.createElementNS ?\n document.createElementNS('http://www.w3.org/1999/xhtml', 'a') :\n document.createElement('a');\n urlLocation.href = url;\n return urlLocation;\n },\n\n /**\n * Checks whether a location is HTTP or HTTPS\n *\n * @method locationIsHttp\n * @param urlLocation\n * @private\n */\n _locationIsHTTP: function (urlLocation) {\n return urlLocation.protocol.match(/^https?:/i) ? true : false;\n },\n\n /**\n * Checks whether a location is cross-domain from another\n *\n * @method _locationIsCrossDomain\n * @param urlLocation {Location}\n * @param otherLocation {Location}\n */\n _locationIsCrossDomain: function (urlLocation, location) {\n location = location || window.location;\n if (!Ajax.prototype._locationIsHTTP(urlLocation) || location.protocol === 'widget:' || typeof window.widget === 'object') {\n return false;\n } else {\n return location.protocol !== urlLocation.protocol ||\n location.host.split(':')[0] !== urlLocation.host.split(':')[0];\n }\n },\n\n /**\n * Creates the appropriate XMLHttpRequest object\n *\n * @method getTransport\n * @return {Object} XMLHttpRequest object\n */\n getTransport: function()\n {\n /*global XDomainRequest:false, ActiveXObject:false */\n if (!xMLHttpRequestWithCredentials && this.options.cors && 'XDomainRequest' in window) {\n this.usingXDomainReq = true;\n return new XDomainRequest();\n }\n else if (typeof XMLHttpRequest !== 'undefined') {\n return new XMLHttpRequest();\n }\n else if (typeof ActiveXObject !== 'undefined') {\n try {\n return new ActiveXObject('Msxml2.XMLHTTP');\n } catch (e) {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n } else {\n return null;\n }\n },\n\n /**\n * Set the necessary headers for an ajax request\n *\n * @method setHeaders\n * @param {String} url The url for the request\n */\n setHeaders: function()\n {\n if (this.transport) {\n try {\n var headers = {\n \"Accept\": \"text/javascript,text/xml,application/xml,application/xhtml+xml,text/html,application/json;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1\",\n \"Accept-Language\": navigator.language,\n \"X-Requested-With\": \"XMLHttpRequest\",\n \"X-Ink-Version\": \"2\"\n };\n if (this.options.cors) {\n if (!this.options.signRequest) {\n delete headers['X-Requested-With'];\n }\n delete headers['X-Ink-Version'];\n }\n\n if (this.options.requestHeaders && typeof this.options.requestHeaders === 'object') {\n for(var headerReqName in this.options.requestHeaders) {\n if (this.options.requestHeaders.hasOwnProperty(headerReqName)) {\n headers[headerReqName] = this.options.requestHeaders[headerReqName];\n }\n }\n }\n\n if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\\/(\\d{4})/) || [0,2005])[1] < 2005) {\n headers.Connection = 'close';\n }\n\n for (var headerName in headers) {\n if(headers.hasOwnProperty(headerName)) {\n this.transport.setRequestHeader(headerName, headers[headerName]);\n }\n }\n } catch(e) {}\n }\n },\n\n /**\n * Converts an object with parameters to a querystring\n *\n * @method paramsObjToStr\n * @param {Object|String} optParams parameters object\n * @return {String} querystring\n */\n paramsObjToStr: function(optParams) {\n var k, m, p, a, params = [];\n if (typeof optParams === 'object') {\n for (p in optParams){\n if (optParams.hasOwnProperty(p)) {\n a = optParams[p];\n if (Object.prototype.toString.call(a) === '[object Array]' && !isNaN(a.length)) {\n for (k = 0, m = a.length; k < m; k++) {\n params = params.concat([\n encodeURIComponent(p), '[]', '=',\n encodeURIComponent(a[k]), '&'\n ]);\n }\n }\n else {\n params = params.concat([\n encodeURIComponent(p), '=',\n encodeURIComponent(a), '&'\n ]);\n }\n }\n }\n if (params.length > 0) {\n params.pop();\n }\n }\n else\n {\n return optParams;\n }\n return params.join('');\n },\n\n /**\n * Set the url parameters for a GET request\n *\n * @method setParams\n */\n setParams: function()\n {\n var params = null, optParams = this.options.parameters;\n\n if(typeof optParams === \"object\"){\n params = this.paramsObjToStr(optParams);\n } else {\n params = '' + optParams;\n }\n\n if(params){\n if(this.url.indexOf('?') > -1) {\n this.url = this.url.split('#')[0] + '&' + params;\n } else {\n this.url = this.url.split('#')[0] + '?' + params;\n }\n }\n },\n\n /**\n * Gets an HTTP header from the response\n *\n * @method getHeader\n * @param {String} name Header name\n * @return {String} header Content\n */\n getHeader: function(name)\n {\n if (this.usingXDomainReq && name === 'Content-Type') {\n return this.transport.contentType;\n }\n try{\n return this.transport.getResponseHeader(name);\n } catch(e) {\n return null;\n }\n },\n\n /**\n * Gets all the HTTP headers from the response\n *\n * @method getAllHeaders\n * @return {String} The headers, each separated by a newline\n */\n getAllHeaders: function()\n {\n try {\n return this.transport.getAllResponseHeaders();\n } catch(e) {\n return null;\n }\n },\n\n /**\n * Sets the response object\n *\n * @method getResponse\n * @return {Object} the response object\n */\n getResponse: function(){\n // setup our own stuff\n var t = this.transport,\n r = {\n headerJSON: null,\n responseJSON: null,\n getHeader: this.getHeader,\n getAllHeaders: this.getAllHeaders,\n request: this,\n transport: t,\n timeTaken: new Date() - this.startTime,\n requestedUrl: this.url\n };\n\n // setup things expected from the native object\n r.readyState = t.readyState;\n try { r.responseText = t.responseText; } catch(e) {}\n try { r.responseXML = t.responseXML; } catch(e) {}\n try { r.status = t.status; } catch(e) { r.status = 0; }\n try { r.statusText = t.statusText; } catch(e) { r.statusText = ''; }\n\n return r;\n },\n\n /**\n * Aborts the request if still running. No callbacks are called\n *\n * @method abort\n */\n abort: function(){\n if (this.transport) {\n clearTimeout(this.delayTimeout);\n clearTimeout(this.stoTimeout);\n try { this.transport.abort(); } catch(ex) {}\n this.finish();\n }\n },\n\n /**\n * Executes the state changing phase of an ajax request\n *\n * @method runStateChange\n */\n runStateChange: function()\n {\n var rs = this.transport.readyState;\n if (rs === 3) {\n if (this.isHTTP) {\n this.safeCall('onHeaders');\n }\n } else if (rs === 4 || this.usingXDomainReq) {\n\n if (this.options.asynchronous && this.options.delay && (this.startTime + this.options.delay > new Date().getTime())) {\n this.delayTimeout = setTimeout(Ink.bind(this.runStateChange, this), this.options.delay + this.startTime - new Date().getTime());\n return;\n }\n\n var responseJSON,\n responseContent = this.transport.responseText,\n response = this.getResponse(),\n curStatus = this.transport.status;\n\n if (this.isHTTP && !this.options.asynchronous) {\n this.safeCall('onHeaders');\n }\n\n clearTimeout(this.stoTimeout);\n\n if (curStatus === 0) {\n // Status 0 indicates network error for http requests.\n // For http less requests, 0 is always returned.\n if (this.isHTTP) {\n this.safeCall('onException', this.makeError(18, 'NETWORK_ERR'));\n } else {\n curStatus = responseContent ? 200 : 404;\n }\n }\n else if (curStatus === 304) {\n curStatus = 200;\n }\n var isSuccess = this.usingXDomainReq || 200 <= curStatus && curStatus < 300;\n\n var headerContentType = this.getHeader('Content-Type') || '';\n if (this.options.evalJS &&\n (headerContentType.indexOf(\"application/json\") >= 0 || this.options.evalJS === 'force')){\n try {\n responseJSON = this.evalJSON(responseContent, this.sanitizeJSON);\n if(responseJSON){\n responseContent = response.responseJSON = responseJSON;\n }\n } catch(e){\n if (isSuccess) {\n // If the request failed, then this is perhaps an error page\n // so don't notify error.\n this.safeCall('onException', e);\n }\n }\n }\n\n if (this.usingXDomainReq && headerContentType.indexOf('xml') !== -1 && 'DOMParser' in window) {\n // http://msdn.microsoft.com/en-us/library/ie/ff975278(v=vs.85).aspx\n var mimeType;\n switch (headerContentType) {\n case 'application/xml':\n case 'application/xhtml+xml':\n case 'image/svg+xml':\n mimeType = headerContentType;\n break;\n default:\n mimeType = 'text/xml';\n }\n var xmlDoc = (new DOMParser()).parseFromString( this.transport.responseText, mimeType);\n this.transport.responseXML = xmlDoc;\n response.responseXML = xmlDoc;\n }\n\n if (this.transport.responseXML !== null && response.responseJSON === null && this.transport.responseXML.xml !== \"\"){\n responseContent = this.transport.responseXML;\n }\n\n if (curStatus || this.usingXDomainReq) {\n if (isSuccess) {\n this.safeCall('onSuccess', response, responseContent);\n } else {\n this.safeCall('onFailure', response, responseContent);\n }\n this.safeCall('on'+curStatus, response, responseContent);\n }\n this.finish(response, responseContent);\n }\n },\n\n /**\n * Last step after XHR is complete. Call onComplete and cleanup object\n *\n * @method finish\n * @param {Any} response\n * @param {Any} responseContent\n */\n finish: function(response, responseContent){\n if (response) {\n this.safeCall('onComplete', response, responseContent);\n }\n clearTimeout(this.stoTimeout);\n\n if (this.transport) {\n // IE6 sometimes barfs on this one\n try{ this.transport.onreadystatechange = null; } catch(e){}\n\n if (typeof this.transport.destroy === 'function') {\n // Stuff for Samsung.\n this.transport.destroy();\n }\n\n // Let XHR be collected.\n this.transport = null;\n }\n },\n\n /**\n * Safely calls a callback function.\n * Verifies that the callback is well defined and traps errors\n *\n * @method safeCall\n * @param {Function} listener\n */\n safeCall: function(listener, first/*, second*/) {\n function rethrow(exception){\n setTimeout(function() {\n // Rethrow exception so it'll land in\n // the error console, firebug, whatever.\n if (exception.message) {\n exception.message += '\\n'+(exception.stacktrace || exception.stack || '');\n }\n throw exception;\n }, 1);\n }\n if (typeof this.options[listener] === 'function') {\n //SAPO.safeCall(this, this.options[listener], first, second);\n //return object[listener].apply(object, [].slice.call(arguments, 2));\n try {\n this.options[listener].apply(this, [].slice.call(arguments, 1));\n } catch(ex) {\n rethrow(ex);\n }\n } else if (first && window.Error && (first instanceof Error)) {\n rethrow(first);\n }\n },\n\n /**\n * Sets a new request header for the next http request\n *\n * @method setRequestHeader\n * @param {String} name\n * @param {String} value\n */\n setRequestHeader: function(name, value){\n if (!this.options.requestHeaders) {\n this.options.requestHeaders = {};\n }\n this.options.requestHeaders[name] = value;\n },\n\n /**\n * Executes the request\n *\n * @method request\n */\n request: function()\n {\n if(this.transport) {\n var params = null;\n if(this.requestHasBody) {\n if(this.options.postBody !== null && this.options.postBody !== '') {\n params = this.options.postBody;\n this.setParams();\n } else if (this.options.parameters !== null && this.options.parameters !== ''){\n params = this.options.parameters;\n }\n\n if (typeof params === \"object\" && !params.nodeType) {\n params = this.paramsObjToStr(params);\n } else if (typeof params !== \"object\" && params !== null){\n params = '' + params;\n }\n\n if(this.options.contentType) {\n this.setRequestHeader('Content-Type', this.options.contentType);\n }\n } else {\n this.setParams();\n }\n\n var url = this.url;\n var method = this.options.method;\n var crossDomain = this.isCrossDomain;\n\n if (crossDomain && this.options.xhrProxy) {\n this.setRequestHeader('X-Url', url);\n url = this.options.xhrProxy + encodeURIComponent(url);\n crossDomain = false;\n }\n\n try {\n this.transport.open(method, url, this.options.asynchronous);\n } catch(e) {\n this.safeCall('onException', e);\n return this.finish(this.getResponse(), null);\n }\n\n this.setHeaders();\n\n this.safeCall('onCreate');\n\n if(this.options.timeout && !isNaN(this.options.timeout)) {\n this.stoTimeout = setTimeout(Ink.bind(function() {\n if(this.options.onTimeout) {\n this.safeCall('onTimeout');\n this.abort();\n }\n }, this), (this.options.timeout * 1000));\n }\n\n if(this.options.useCredentials && !this.usingXDomainReq) {\n this.transport.withCredentials = true;\n }\n\n if(this.options.asynchronous && !this.usingXDomainReq) {\n this.transport.onreadystatechange = Ink.bind(this.runStateChange, this);\n }\n else if (this.usingXDomainReq) {\n this.transport.onload = Ink.bind(this.runStateChange, this);\n }\n\n try {\n if (crossDomain) {\n // Need explicit handling because Mozila aborts\n // the script and Chrome fails silently.per the spec\n throw this.makeError(18, 'NETWORK_ERR');\n } else {\n this.startTime = new Date().getTime();\n this.transport.send(params);\n }\n } catch(e) {\n this.safeCall('onException', e);\n return this.finish(this.getResponse(), null);\n }\n\n if(!this.options.asynchronous) {\n this.runStateChange();\n }\n }\n },\n\n /**\n * Returns a new exception object that can be thrown\n *\n * @method makeError\n * @param code Error Code\n * @param message Message\n * @returns {Object}\n */\n makeError: function(code, message){\n if (typeof Error !== 'function') {\n return {code: code, message: message};\n }\n var e = new Error(message);\n e.code = code;\n return e;\n },\n\n /**\n * Checks if a given string is valid JSON\n *\n * @method isJSON\n * @param {String} str String to be evaluated\n * @return {Boolean} True if the string is valid JSON\n */\n isJSON: function(str)\n {\n if (typeof str !== \"string\" || !str){ return false; }\n str = str.replace(/\\\\./g, '@').replace(/\"[^\"\\\\\\n\\r]*\"/g, '');\n return (/^[,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]*$/).test(str);\n },\n\n /**\n * Evaluates a given string as JSON\n *\n * @method evalJSON\n * @param {String} str String to be evaluated\n * @param {Boolean} sanitize Flag to sanitize the content\n * @return {Object} JSON content as an object\n */\n evalJSON: function(strJSON, sanitize)\n {\n if (strJSON && (!sanitize || this.isJSON(strJSON))) {\n try {\n if (typeof JSON !== \"undefined\" && typeof JSON.parse !== 'undefined'){\n return JSON.parse(strJSON);\n }\n /*jshint evil:true */\n return eval('(' + strJSON + ')');\n } catch(e) {\n throw new Error('ERROR: Bad JSON string...');\n }\n }\n return null;\n }\n };\n\n /**\n * Loads content from a given url through an XMLHttpRequest.\n *\n * Shortcut function for simple AJAX use cases. Works with JSON, XML and plain text.\n *\n * @method load\n * @param {String} url Request URL\n * @param {Function} callback Callback to be executed if the request is successful\n * @return {Object} XMLHttpRequest object\n *\n * @sample Ink_Net_Ajax_load.html \n */\n Ajax.load = function(url, callback){\n return new Ajax(url, {\n method: 'GET',\n onSuccess: function(response){\n callback(response.responseJSON || response.responseText, response);\n }\n });\n };\n\n /**\n * Loads content from a given url through an XMLHttpRequest.\n * Shortcut function for simple AJAX use cases.\n *\n * @method ping\n * @param {String} url Request url\n * @param {Function} callback Callback to be executed if the request is successful\n * @return {Object} XMLHttpRequest object\n */\n Ajax.ping = function(url, callback){\n return new Ajax(url, {\n method: 'HEAD',\n onSuccess: function(response){\n if (typeof callback === 'function'){\n callback(response);\n }\n }\n });\n };\n\n\n return Ajax;\n});\n","/**\n * Cross Browser JsonP requests\n * @module Ink.Net.JsonP_1\n * @version 1\n */\n\nInk.createModule('Ink.Net.JsonP', '1', [], function() {\n\n 'use strict';\n\n /**\n * Executes a JSONP request\n *\n * @class Ink.Net.JsonP\n * @constructor\n *\n * @param {String} uri Request URL\n * @param {Object} options Request options\n * @param {Function} options.onSuccess Success callback\n * @param {Function} [options.onFailure] Failure callback\n * @param {Object} [options.failureObj] Object to be passed as argument to failure callback\n * @param {Number} [options.timeout] Timeout for request fail, in seconds. defaults to 10\n * @param {Object} [options.params] Object with the parameters and respective values to unfold\n * @param {String} [options.callbackParam] Parameter to use as callback. defaults to 'jsoncallback'\n * @param {String} [options.internalCallback] Name of the callback function stored in the Ink.Net.JsonP object.\n * @param {String} [options.randVar] (Advanced, not recommended unless you know what you're doing) A string to append to the callback name. By default, generate a random number. Use an empty string if you already passed the correct name in the internalCallback option.\n *\n * @sample Ink_Net_JsonP_1.html \n */\n var JsonP = function(uri, options) {\n this.init(uri, options);\n };\n\n JsonP.prototype = {\n\n init: function(uri, options) {\n this.options = Ink.extendObj( {\n onSuccess: undefined,\n onFailure: undefined,\n failureObj: {},\n timeout: 10,\n params: {},\n callbackParam: 'jsoncallback',\n internalCallback: '_cb',\n randVar: false\n }, options || {});\n\n if(this.options.randVar !== false) {\n this.randVar = this.options.randVar;\n } else {\n this.randVar = parseInt(Math.random() * 100000, 10);\n }\n\n this.options.internalCallback += this.randVar;\n\n this.uri = uri;\n\n // prevent SAPO legacy onComplete - make it onSuccess\n if(typeof(this.options.onComplete) === 'function') {\n this.options.onSuccess = this.options.onComplete;\n }\n\n if (typeof this.uri !== 'string') {\n throw 'Please define an URI';\n }\n\n if (typeof this.options.onSuccess !== 'function') {\n throw 'please define a callback function on option onSuccess!';\n }\n\n Ink.Net.JsonP[this.options.internalCallback] = Ink.bind(function() {\n window.clearTimeout(this.timeout);\n delete window.Ink.Net.JsonP[this.options.internalCallback];\n this._removeScriptTag();\n this.options.onSuccess(arguments[0]);\n }, this);\n\n this._addScriptTag();\n },\n\n _addParamsToGet: function(uri, params) {\n var hasQuestionMark = uri.indexOf('?') !== -1;\n var sep, pKey, pValue, parts = [uri];\n\n for (pKey in params) {\n if (params.hasOwnProperty(pKey)) {\n if (!hasQuestionMark) { sep = '?'; hasQuestionMark = true; }\n else { sep = '&'; }\n pValue = params[pKey];\n if (typeof pValue !== 'number' && !pValue) { pValue = ''; }\n parts = parts.concat([sep, pKey, '=', encodeURIComponent(pValue)]);\n }\n }\n\n return parts.join('');\n },\n\n _getScriptContainer: function() {\n var headEls = document.getElementsByTagName('head');\n if (headEls.length === 0) {\n var scriptEls = document.getElementsByTagName('script');\n return scriptEls[0];\n }\n return headEls[0];\n },\n\n _addScriptTag: function() {\n // enrich options will callback and random seed\n this.options.params[this.options.callbackParam] = 'Ink.Net.JsonP.' + this.options.internalCallback;\n this.options.params.rnd_seed = this.randVar;\n this.uri = this._addParamsToGet(this.uri, this.options.params);\n // create script tag\n var scriptEl = document.createElement('script');\n scriptEl.type = 'text/javascript';\n scriptEl.src = this.uri;\n var scriptCtn = this._getScriptContainer();\n scriptCtn.appendChild(scriptEl);\n this.timeout = setTimeout(Ink.bind(this._requestFailed, this), (this.options.timeout * 1000));\n },\n\n _requestFailed : function () {\n delete Ink.Net.JsonP[this.options.internalCallback];\n this._removeScriptTag();\n if(typeof this.options.onFailure === 'function'){\n this.options.onFailure(this.options.failureObj);\n }\n },\n\n _removeScriptTag: function() {\n var scriptEl;\n var scriptEls = document.getElementsByTagName('script');\n var scriptUri;\n for (var i = 0, f = scriptEls.length; i < f; ++i) {\n scriptEl = scriptEls[i];\n scriptUri = scriptEl.getAttribute('src') || scriptEl.src;\n if (scriptUri !== null && scriptUri === this.uri) {\n scriptEl.parentNode.removeChild(scriptEl);\n return;\n }\n }\n }\n\n };\n\n return JsonP;\n\n});\n","/**\n * Browser Detection and User Agent sniffing\n * @module Ink.Dom.Browser_1\n * @version 1\n */\nInk.createModule('Ink.Dom.Browser', '1', [], function() {\n 'use strict'; \n\n /**\n * @namespace Ink.Dom.Browser\n * @version 1\n * @static\n * @example\n * \n */\n var Browser = {\n /**\n * True if the browser is Internet Explorer\n *\n * @property IE\n * @type {Boolean}\n * @public\n * @static\n */\n IE: false,\n\n /**\n * True if the browser is Gecko based\n *\n * @property GECKO\n * @type {Boolean}\n * @public\n * @static\n */\n GECKO: false,\n\n /**\n * True if the browser is Opera\n *\n * @property OPERA\n * @type {Boolean}\n * @public\n * @static\n */\n OPERA: false,\n\n /**\n * True if the browser is Safari\n *\n * @property SAFARI\n * @type {Boolean}\n * @public\n * @static\n */\n SAFARI: false,\n\n /**\n * True if the browser is Konqueror\n *\n * @property KONQUEROR\n * @type {Boolean}\n * @public\n * @static\n */\n KONQUEROR: false,\n\n /**\n * True if browser is Chrome\n *\n * @property CHROME\n * @type {Boolean}\n * @public\n * @static\n */\n CHROME: false,\n\n /**\n * The specific browser model.\n * False if it is unavailable.\n *\n * @property model\n * @type {Boolean|String}\n * @public\n * @static\n */\n model: false,\n\n /**\n * The browser version.\n * False if it is unavailable.\n *\n * @property version\n * @type {Boolean|String}\n * @public\n * @static\n */\n version: false,\n\n /**\n * The user agent string.\n * False if it is unavailable.\n *\n * @property userAgent\n * @type {Boolean|String}\n * @public\n * @static\n */\n userAgent: false,\n\n /**\n * The CSS prefix (-moz-, -webkit-, -ms-, ...)\n * False if it is unavailable \n *\n * @property cssPrefix \n * @type {Boolean|String}\n * @public \n * @static \n */\n cssPrefix: false, \n\n /**\n * The DOM prefix (Moz, Webkit, ms, ...)\n * False if it is unavailable \n * @property domPrefix \n * @type {Boolean|String}\n * @public \n * @static \n */\n domPrefix: false,\n\n /**\n * Initialization function for the Browser object.\n *\n * Is called automatically when this module is loaded, and calls setDimensions, setBrowser and setReferrer.\n *\n * @method init\n * @public\n */\n init: function() {\n this.detectBrowser();\n this.setDimensions();\n this.setReferrer();\n },\n\n /**\n * Retrieves and stores window dimensions in this object. Called automatically when this module is loaded.\n *\n * @method setDimensions\n * @public\n */\n setDimensions: function() {\n //this.windowWidth=window.innerWidth !== null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body !== null ? document.body.clientWidth : null;\n //this.windowHeight=window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;\n var myWidth = 0, myHeight = 0;\n if ( typeof window.innerWidth=== 'number' ) {\n myWidth = window.innerWidth;\n myHeight = window.innerHeight;\n } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {\n myWidth = document.documentElement.clientWidth;\n myHeight = document.documentElement.clientHeight;\n } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {\n myWidth = document.body.clientWidth;\n myHeight = document.body.clientHeight;\n }\n this.windowWidth = myWidth;\n this.windowHeight = myHeight;\n },\n\n /**\n * Stores the referrer. Called automatically when this module is loaded.\n *\n * @method setReferrer\n * @public\n */\n setReferrer: function() {\n if (document.referrer && document.referrer.length) {\n this.referrer = window.escape(document.referrer);\n } else {\n this.referrer = false;\n }\n },\n\n /**\n * Detects the browser and stores the found properties. Called automatically when this module is loaded.\n *\n * @method detectBrowser\n * @public\n */\n detectBrowser: function() {\n this._sniffUserAgent(navigator.userAgent);\n },\n\n _sniffUserAgent: function (sAgent) {\n this.userAgent = sAgent;\n\n sAgent = sAgent.toLowerCase();\n\n if (/applewebkit\\//.test(sAgent)) {\n this.cssPrefix = '-webkit-';\n this.domPrefix = 'Webkit';\n if(/(chrome|crios)\\//.test(sAgent)) {\n // Chrome\n this.CHROME = true;\n this.model = 'chrome';\n this.version = sAgent.replace(/(.*)chrome\\/([^\\s]+)(.*)/, \"$2\");\n } else {\n // Safari\n this.SAFARI = true;\n this.model = 'safari';\n var rVersion = /version\\/([^) ]+)/;\n if (rVersion.test(sAgent)) {\n this.version = sAgent.match(rVersion)[1];\n } else {\n this.version = sAgent.replace(/(.*)applewebkit\\/([^\\s]+)(.*)/, \"$2\");\n }\n }\n } else if (/opera/.test(sAgent)) {\n // Opera\n this.OPERA = true;\n this.model = 'opera';\n this.version = sAgent.replace(/(.*)opera.([^\\s$]+)(.*)/, \"$2\");\n this.cssPrefix = '-o-';\n this.domPrefix = 'O';\n } else if (/konqueror/.test(sAgent)) {\n // Konqueroh\n this.KONQUEROR = true;\n this.model = 'konqueror';\n this.version = sAgent.replace(/(.*)konqueror\\/([^;]+);(.*)/, \"$2\");\n this.cssPrefix = '-khtml-';\n this.domPrefix = 'Khtml';\n } else if (/(msie|trident)/i.test(sAgent)) {\n // MSIE\n this.IE = true;\n this.model = 'ie';\n if (/rv:((?:\\d|\\.)+)/.test(sAgent)) { // IE 11\n this.version = sAgent.match(/rv:((?:\\d|\\.)+)/)[1];\n } else {\n this.version = sAgent.replace(/(.*)\\smsie\\s([^;]+);(.*)/, \"$2\");\n }\n this.cssPrefix = '-ms-';\n this.domPrefix = 'ms';\n } else if (/gecko/.test(sAgent)) {\n // GECKO\n // Supports only:\n // Camino, Chimera, Epiphany, Minefield (firefox 3), Firefox, Firebird, Phoenix, Galeon,\n // Iceweasel, K-Meleon, SeaMonkey, Netscape, Songbird, Sylera,\n this.cssPrefix = '-moz-';\n this.domPrefix = 'Moz';\n\n this.GECKO = true;\n\n var re = /(camino|chimera|epiphany|minefield|firefox|firebird|phoenix|galeon|iceweasel|k\\-meleon|seamonkey|netscape|songbird|sylera)/;\n if(re.test(sAgent)) {\n this.model = sAgent.match(re)[1];\n this.version = sAgent.replace(new RegExp(\"(.*)\"+this.model+\"\\/([^;\\\\s$]+)(.*)\"), \"$2\");\n } else {\n // probably is mozilla\n this.model = 'mozilla';\n var reVersion = /(.*)rv:([^)]+)(.*)/;\n if(reVersion.test(sAgent)) {\n this.version = sAgent.replace(reVersion, \"$2\");\n }\n }\n }\n },\n\n /**\n * Debug function which displays browser (and Ink.Dom.Browser) information as an alert message.\n *\n * @method debug\n * @public\n * @sample Ink_Dom_Browser_1_debug.html\n */\n debug: function() {\n /*global alert:false */\n var str = \"known browsers: (ie, gecko, opera, safari, konqueror) \\n\";\n str += [this.IE, this.GECKO, this.OPERA, this.SAFARI, this.KONQUEROR] +\"\\n\";\n str += \"cssPrefix -> \"+this.cssPrefix+\"\\n\";\n str += \"domPrefix -> \"+this.domPrefix+\"\\n\";\n str += \"model -> \"+this.model+\"\\n\";\n str += \"version -> \"+this.version+\"\\n\";\n str += \"\\n\";\n str += \"original UA -> \"+this.userAgent;\n\n alert(str);\n }\n };\n\n Browser.init();\n\n return Browser;\n});\n","/**\n * CSS Utilities and toolbox\n * @module Ink.Dom.Css_1\n * @version 1\n */\n\nInk.createModule( 'Ink.Dom.Css', 1, [], function() {\n\n 'use strict';\n\n // getComputedStyle feature detection.\n var getCs = (\"defaultView\" in document) && (\"getComputedStyle\" in document.defaultView) ? document.defaultView.getComputedStyle : window.getComputedStyle;\n\n /**\n * @namespace Ink.Dom.Css\n * @static\n */\n\n var Css = {\n /**\n * Adds of removes a class.\n * Depending on addRemState, this method either adds a class if it's true or removes if if false.\n *\n * @method addRemoveClassName\n * @param {DOMElement|string} elm DOM element or element id\n * @param {string} className class name to add or remove.\n * @param {boolean} addRemState Whether to add or remove. `true` to add, `false` to remove.\n * @sample Ink_Dom_Css_addRemoveClassName.html \n */\n addRemoveClassName: function(elm, className, addRemState) {\n if (addRemState) {\n return this.addClassName(elm, className);\n }\n this.removeClassName(elm, className);\n },\n\n /**\n * Adds a class to a given element\n *\n * @method addClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String|Array} className Classes \n * @sample Ink_Dom_Css_addClassName.html\n */\n addClassName: function(elm, className) {\n elm = Ink.i(elm);\n if (!elm || !className) { return null; }\n className = ('' + className).split(/[, ]+/);\n var i = 0;\n var len = className.length;\n\n for (; i < len; i++) {\n // remove whitespace and ignore on empty string\n if (className[i].replace(/^\\s+|\\s+$/g, '')) {\n if (typeof elm.classList !== \"undefined\") {\n elm.classList.add(className[i]);\n } else if (!Css.hasClassName(elm, className[i])) {\n elm.className += (elm.className ? ' ' : '') + className[i];\n }\n }\n }\n },\n\n /**\n * Removes a class from a given element\n *\n * @method removeClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String|Array} className Class names to remove. You can either use a space separated string of classnames, comma-separated list or an array\n * @sample Ink_Dom_Css_removeClassName.html \n */\n removeClassName: function(elm, className) {\n elm = Ink.i(elm);\n if (!elm || !className) { return null; }\n \n className = ('' + className).split(/[, ]+/);\n var i = 0;\n var len = className.length;\n\n if (typeof elm.classList !== \"undefined\"){\n for (; i < len; i++) {\n elm.classList.remove(className[i]);\n }\n } else {\n var elmClassName = elm.className || '';\n var re;\n for (; i < len; i++) {\n re = new RegExp(\"(^|\\\\s+)\" + className[i] + \"(\\\\s+|$)\");\n elmClassName = elmClassName.replace(re, ' ');\n }\n elm.className = (elmClassName\n .replace(/^\\s+/, '')\n .replace(/\\s+$/, ''));\n }\n },\n\n /**\n * Alias to addRemoveClassName. \n * Utility function, saves many if/elses.\n *\n * @method setClassName\n * @uses addRemoveClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String|Array} className Class names to add\\remove. Comma separated, space separated or simply an Array\n * @param {Boolean} [add]=false Flag to switch behavior from removal to addition. true to add, false to remove\n */\n setClassName: function(elm, className, add) {\n this.addRemoveClassName(elm, className, add || false);\n },\n\n /**\n * Checks if an element has a class.\n * This method verifies if an element has ONE of a list of classes. If the last argument is flagged as true, instead checks if the element has ALL the classes\n * \n * @method hasClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String|Array} className Class names to test\n * @param {Boolean} [all]=false If flagged as true, it will check if the element contains ALL the CSS classes\n * @return {Boolean} true if a given class is applied to a given element\n * @sample Ink_Dom_Css_hasClassName.html \n */\n hasClassName: function(elm, className, all) {\n elm = Ink.i(elm);\n if (!elm || !className) { return false; }\n\n className = ('' + className).split(/[, ]+/);\n var i = 0;\n var len = className.length;\n var has;\n var re;\n\n for ( ; i < len; i++) {\n if (typeof elm.classList !== \"undefined\"){\n has = elm.classList.contains(className[i]);\n } else {\n var elmClassName = elm.className;\n if (elmClassName === className[i]) {\n has = true;\n } else {\n re = new RegExp(\"(^|\\\\s)\" + className[i] + \"(\\\\s|$)\");\n has = re.test(elmClassName);\n }\n }\n if (has && !all) { return true; } // return if looking for any class\n if (!has && all) { return false; } // return if looking for all classes\n }\n\n if (all) {\n // if we got here, all classes were found so far\n return true;\n } else {\n // if we got here with all == false, no class was found\n return false;\n }\n },\n\n /**\n * Blinks a class from an element\n * Add and removes the class from the element with a timeout, so it blinks\n *\n * @method blinkClass\n * @uses addRemoveClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String|Array} className Class name(s) to blink\n * @param {Number} timeout timeout in ms between adding and removing, default 100 ms\n * @param {Boolean} negate is true, class is removed then added\n * @sample Ink_Dom_Css_blinkClass.html \n */\n blinkClass: function(element, className, timeout, negate){\n element = Ink.i(element);\n Css.addRemoveClassName(element, className, !negate);\n setTimeout(function() {\n Css.addRemoveClassName(element, className, negate);\n }, Number(timeout) || 100);\n },\n\n /**\n * Toggles a class name from a given element\n *\n * @method toggleClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String} className Class name\n * @param {Boolean} [forceAdd] Flag to force adding the the classe names if they don't exist yet.\n * @sample Ink_Dom_Css_toggleClassName.html \n */\n toggleClassName: function(elm, className, forceAdd) {\n if (elm && className){\n if (typeof elm.classList !== \"undefined\" && !/[, ]/.test(className)){\n elm = Ink.i(elm);\n if (elm !== null){\n elm.classList.toggle(className);\n }\n return true;\n }\n }\n\n if (typeof forceAdd !== 'undefined') {\n if (forceAdd === true) {\n Css.addClassName(elm, className);\n }\n else if (forceAdd === false) {\n Css.removeClassName(elm, className);\n }\n } else {\n if (Css.hasClassName(elm, className)) {\n Css.removeClassName(elm, className);\n } else {\n Css.addClassName(elm, className);\n }\n }\n },\n\n /**\n * Sets the opacity of given element \n *\n * @method setOpacity\n * @param {DOMElement|String} elm DOM element or element id\n * @param {Number} value allows 0 to 1(default mode decimal) or percentage (warning using 0 or 1 will reset to default mode)\n * @sample Ink_Dom_Css_setOpacity.html \n */\n setOpacity: function(elm, value) {\n elm = Ink.i(elm);\n if (elm !== null){\n var val = 1;\n\n if (!isNaN(Number(value))){\n if (value <= 0) { val = 0; }\n else if (value <= 1) { val = value; }\n else if (value <= 100) { val = value / 100; }\n else { val = 1; }\n }\n\n if (typeof elm.style.opacity !== 'undefined') {\n elm.style.opacity = val;\n }\n else {\n elm.style.filter = \"alpha(opacity:\"+(val*100|0)+\")\";\n }\n }\n },\n\n /**\n * Converts a css property name to a string in camelcase to be used with CSSStyleDeclaration.\n * @method _camelCase\n * @private\n * @param {String} str String to convert\n * @return {String} Converted string\n */\n _camelCase: function(str) {\n return str ? str.replace(/-(\\w)/g, function (_, $1) {\n return $1.toUpperCase();\n }) : str;\n },\n\n\n /**\n * Gets the value for an element's style attribute\n *\n * @method getStyle\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String} style Which css attribute to fetch\n * @return Style value\n * @sample Ink_Dom_Css_getStyle.html \n */\n getStyle: function(elm, style) {\n elm = Ink.i(elm);\n if (elm !== null && elm.style) {\n style = style === 'float' ? 'cssFloat': this._camelCase(style);\n\n var value = elm.style[style];\n\n if (getCs && (!value || value === 'auto')) {\n var css = getCs(elm, null);\n value = css ? css[style] : null;\n }\n else if (!value && elm.currentStyle) {\n value = elm.currentStyle[style];\n if (value === 'auto' && (style === 'width' || style === 'height')) {\n value = elm[\"offset\" + style.charAt(0).toUpperCase() + style.slice(1)] + \"px\";\n }\n }\n\n if (style === 'opacity') {\n return value ? parseFloat(value, 10) : 1.0;\n }\n else if (style === 'borderTopWidth' || style === 'borderBottomWidth' ||\n style === 'borderRightWidth' || style === 'borderLeftWidth' ) {\n if (value === 'thin') { return '1px'; }\n else if (value === 'medium') { return '3px'; }\n else if (value === 'thick') { return '5px'; }\n }\n\n return value === 'auto' ? null : value;\n }\n },\n\n\n /**\n * Adds CSS rules to an element's style attribute.\n *\n * @method setStyle\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String} style Which css attribute to set\n * @sample Ink_Dom_Css_setStyle.html \n */\n setStyle: function(elm, style) {\n elm = Ink.i(elm);\n if (elm === null) { return; }\n if (typeof style === 'string') {\n elm.style.cssText += '; '+style;\n\n if (style.indexOf('opacity') !== -1) {\n this.setOpacity(elm, style.match(/opacity:\\s*(\\d?\\.?\\d*)/)[1]);\n }\n }\n else {\n for (var prop in style) {\n if (style.hasOwnProperty(prop)){\n if (prop === 'opacity') {\n this.setOpacity(elm, style[prop]);\n }\n else if (prop === 'float' || prop === 'cssFloat') {\n if (typeof elm.style.styleFloat === 'undefined') {\n elm.style.cssFloat = style[prop];\n }\n else {\n elm.style.styleFloat = style[prop];\n }\n } else {\n elm.style[prop] = style[prop];\n }\n }\n }\n }\n },\n\n\n /**\n * Shows an element.\n * Internally it unsets the display property of an element. You can force a specific display property using forceDisplayProperty\n *\n * @method show\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String} [forceDisplayProperty] Css display property to apply on show\n * @sample Ink_Dom_Css_show.html \n */\n show: function(elm, forceDisplayProperty) {\n elm = Ink.i(elm);\n if (elm !== null) {\n elm.style.display = (forceDisplayProperty) ? forceDisplayProperty : '';\n }\n },\n\n /**\n * Hides an element.\n *\n * @method hide\n * @param {DOMElement|String} elm DOM element or element id\n * @sample Ink_Dom_Css_hide.html \n */\n hide: function(elm) {\n elm = Ink.i(elm);\n if (elm !== null) {\n elm.style.display = 'none';\n }\n },\n\n /**\n * Shows or hides an element.\n * If the show parameter is true, it shows the element. Otherwise, hides it.\n *\n * @method showHide\n * @param {DOMElement|String} elm DOM element or element id\n * @param {boolean} [show]=false Whether to show or hide `elm`.\n * @sample Ink_Dom_Css_showHide.html \n */\n showHide: function(elm, show) {\n elm = Ink.i(elm);\n if (elm) {\n elm.style.display = show ? '' : 'none';\n }\n },\n\n /**\n * Toggles an element visibility.\n * \n * @method toggle\n * @param {DOMElement|String} elm DOM element or element id\n * @param {Boolean} forceShow Forces showing if element is hidden\n * @sample Ink_Dom_Css_toggle.html \n */\n toggle: function(elm, forceShow) {\n elm = Ink.i(elm);\n if (elm !== null) {\n if (typeof forceShow !== 'undefined') {\n if (forceShow === true) {\n this.show(elm);\n } else {\n this.hide(elm);\n }\n } else {\n if (this.getStyle(elm,'display').toLowerCase() === 'none') {\n this.show(elm);\n }\n else {\n this.hide(elm);\n }\n }\n }\n },\n\n _getRefTag: function(head){\n if (head.firstElementChild) {\n return head.firstElementChild;\n }\n\n for (var child = head.firstChild; child; child = child.nextSibling){\n if (child.nodeType === 1){\n return child;\n }\n }\n return null;\n },\n\n /**\n * Injects style tags with rules to the page.\n *\n * @method appendStyleTag\n * @param {String} selector The css selector for the rule\n * @param {String} style The content of the style rule\n * @param {Object} options Options for the tag\n * @param {String} [options.type]='text/css' File type\n * @param {Boolean} [options.force]=false If true, the style tag will be appended to end of head\n * \n * @sample Ink_Dom_Css_appendStyleTag.html \n */\n appendStyleTag: function(selector, style, options){\n options = Ink.extendObj({\n type: 'text/css',\n force: false\n }, options || {});\n\n var styles = document.getElementsByTagName(\"style\"),\n oldStyle = false, setStyle = true, i, l;\n\n for (i=0, l=styles.length; i= 0) {\n setStyle = false;\n }\n }\n\n if (setStyle) {\n var defStyle = document.createElement(\"style\"),\n head = document.getElementsByTagName(\"head\")[0],\n refTag = false, styleStr = '';\n\n defStyle.type = options.type;\n\n styleStr += selector +\" {\";\n styleStr += style;\n styleStr += \"} \";\n\n if (typeof defStyle.styleSheet !== \"undefined\") {\n defStyle.styleSheet.cssText = styleStr;\n } else {\n defStyle.appendChild(document.createTextNode(styleStr));\n }\n\n if (options.force){\n head.appendChild(defStyle);\n } else {\n refTag = this._getRefTag(head);\n if (refTag){\n head.insertBefore(defStyle, refTag);\n }\n }\n }\n },\n\n /**\n * Injects an external link tag.\n * This method add a stylesheet to the head of a page\n *\n * @method appendStylesheet\n * @param {String} path File path\n * @param {Object} options Options for the tag\n * @param {String} [options.media]='screen' Media type\n * @param {String} [options.type]='text/css' File type\n * @param {Boolean} [options.force]=false If true, tag will be appended to end of head\n * @sample Ink_Dom_Css_appendStylesheet.html \n */\n appendStylesheet: function(path, options){\n options = Ink.extendObj({\n media: 'screen',\n type: 'text/css',\n force: false\n }, options || {});\n\n var refTag,\n style = document.createElement(\"link\"),\n head = document.getElementsByTagName(\"head\")[0];\n\n style.media = options.media;\n style.type = options.type;\n style.href = path;\n style.rel = \"Stylesheet\";\n\n if (options.force){\n head.appendChild(style);\n }\n else {\n refTag = this._getRefTag(head);\n if (refTag){\n head.insertBefore(style, refTag);\n }\n }\n },\n\n /**\n * Injects an external link tag.\n * Loads CSS via LINK element inclusion in HEAD (skips append if already there)\n *\n * Works similarly to appendStylesheet but:\n * supports optional callback which gets invoked once the CSS has been applied\n *\n * @method appendStylesheetCb\n * @param {String} cssURI URI of the CSS to load, if empty ignores and just calls back directly\n * @param {Function(cssURI)} [callback] optional callback which will be called once the CSS is loaded\n * @sample Ink_Dom_Css_appendStylesheetCb.html \n */\n _loadingCSSFiles: {},\n _loadedCSSFiles: {},\n appendStylesheetCb: function(url, callback) {\n if (!url) {\n return callback(url);\n }\n\n if (this._loadedCSSFiles[url]) {\n return callback(url);\n }\n\n var cbs = this._loadingCSSFiles[url];\n if (cbs) {\n return cbs.push(callback);\n }\n\n this._loadingCSSFiles[url] = [callback];\n\n var linkEl = document.createElement('link');\n linkEl.type = 'text/css';\n linkEl.rel = 'stylesheet';\n linkEl.href = url;\n\n var headEl = document.getElementsByTagName('head')[0];\n headEl.appendChild(linkEl);\n\n var imgEl = document.createElement('img');\n /*\n var _self = this;\n (function(_url) {\n imgEl.onerror = function() {\n //var url = this;\n var url = _url;\n _self._loadedCSSFiles[url] = true;\n var callbacks = _self._loadingCSSFiles[url];\n for (var i = 0, f = callbacks.length; i < f; ++i) {\n callbacks[i](url);\n }\n delete _self._loadingCSSFiles[url];\n };\n })(url);\n */\n imgEl.onerror = Ink.bindEvent(function(event, _url) {\n //var url = this;\n var url = _url;\n this._loadedCSSFiles[url] = true;\n var callbacks = this._loadingCSSFiles[url];\n for (var i = 0, f = callbacks.length; i < f; ++i) {\n callbacks[i](url);\n }\n delete this._loadingCSSFiles[url];\n }, this, url);\n imgEl.src = url;\n },\n\n /**\n * Converts decimal to hexadecimal values\n * Useful to convert colors to their hexadecimal representation.\n *\n * @method decToHex\n * @param {String} dec Either a single decimal value, an rgb(r, g, b) string or an Object with r, g and b properties\n * @return {String} Hexadecimal value\n * @sample Ink_Dom_Css_decToHex.html \n */\n decToHex: function(dec) {\n var normalizeTo2 = function(val) {\n if (val.length === 1) {\n val = '0' + val;\n }\n val = val.toUpperCase();\n return val;\n };\n\n if (typeof dec === 'object') {\n var rDec = normalizeTo2(parseInt(dec.r, 10).toString(16));\n var gDec = normalizeTo2(parseInt(dec.g, 10).toString(16));\n var bDec = normalizeTo2(parseInt(dec.b, 10).toString(16));\n return rDec+gDec+bDec;\n }\n else {\n dec += '';\n var rgb = dec.match(/\\((\\d+),\\s?(\\d+),\\s?(\\d+)\\)/);\n if (rgb !== null) {\n return normalizeTo2(parseInt(rgb[1], 10).toString(16)) +\n normalizeTo2(parseInt(rgb[2], 10).toString(16)) +\n normalizeTo2(parseInt(rgb[3], 10).toString(16));\n }\n else {\n return normalizeTo2(parseInt(dec, 10).toString(16));\n }\n }\n },\n\n /**\n * Converts hexadecimal values to decimal\n * Useful to use with CSS colors\n *\n * @method hexToDec\n * @param {String} hex hexadecimal Value with 6, 3, 2 or 1 characters\n * @return {Number} Object with properties r, g, b if length of number is >= 3 or decimal value instead.\n * @sample Ink_Dom_Css_hexToDec.html \n */\n hexToDec: function(hex){\n if (hex.indexOf('#') === 0) {\n hex = hex.substr(1);\n }\n if (hex.length === 6) { // will return object RGB\n return {\n r: parseInt(hex.substr(0,2), 16),\n g: parseInt(hex.substr(2,2), 16),\n b: parseInt(hex.substr(4,2), 16)\n };\n }\n else if (hex.length === 3) { // will return object RGB\n return {\n r: parseInt(hex.charAt(0) + hex.charAt(0), 16),\n g: parseInt(hex.charAt(1) + hex.charAt(1), 16),\n b: parseInt(hex.charAt(2) + hex.charAt(2), 16)\n };\n }\n else if (hex.length <= 2) { // will return int\n return parseInt(hex, 16);\n }\n },\n\n /**\n * Get a single property from a stylesheet.\n * Use this to obtain the value of a CSS property (searched from loaded CSS documents)\n *\n * @method getPropertyFromStylesheet\n * @param {String} selector a CSS rule. must be an exact match\n * @param {String} property a CSS property\n * @return {String} value of the found property, or null if it wasn't matched\n */\n getPropertyFromStylesheet: function(selector, property) {\n var rule = this.getRuleFromStylesheet(selector);\n if (rule) {\n return rule.style[property];\n }\n return null;\n },\n\n getPropertyFromStylesheet2: function(selector, property) {\n var rules = this.getRulesFromStylesheet(selector);\n /*\n rules.forEach(function(rule) {\n var x = rule.style[property];\n if (x !== null && x !== undefined) {\n return x;\n }\n });\n */\n var x;\n for(var i=0, t=rules.length; i < t; i++) {\n x = rules[i].style[property];\n if (x !== null && x !== undefined) {\n return x;\n }\n }\n return null;\n },\n\n getRuleFromStylesheet: function(selector) {\n var sheet, rules, ri, rf, rule;\n var s = document.styleSheets;\n if (!s) {\n return null;\n }\n\n for (var si = 0, sf = document.styleSheets.length; si < sf; ++si) {\n sheet = document.styleSheets[si];\n rules = sheet.rules ? sheet.rules : sheet.cssRules;\n if (!rules) { return null; }\n\n for (ri = 0, rf = rules.length; ri < rf; ++ri) {\n rule = rules[ri];\n if (!rule.selectorText) { continue; }\n if (rule.selectorText === selector) {\n return rule;\n }\n }\n }\n\n return null;\n },\n\n getRulesFromStylesheet: function(selector) {\n var res = [];\n var sheet, rules, ri, rf, rule;\n var s = document.styleSheets;\n if (!s) { return res; }\n\n for (var si = 0, sf = document.styleSheets.length; si < sf; ++si) {\n sheet = document.styleSheets[si];\n rules = sheet.rules ? sheet.rules : sheet.cssRules;\n if (!rules) {\n return null;\n }\n\n for (ri = 0, rf = rules.length; ri < rf; ++ri) {\n rule = rules[ri];\n if (!rule.selectorText) { continue; }\n if (rule.selectorText === selector) {\n res.push(rule);\n }\n }\n }\n\n return res;\n },\n\n getPropertiesFromRule: function(selector) {\n var rule = this.getRuleFromStylesheet(selector);\n var props = {};\n var prop, i, f;\n\n /*if (typeof rule.style.length === 'snumber') {\n for (i = 0, f = rule.style.length; i < f; ++i) {\n prop = this._camelCase( rule.style[i] );\n props[prop] = rule.style[prop];\n }\n }\n else { // HANDLES IE 8, FIREFOX RULE JOINING... */\n rule = rule.style.cssText;\n var parts = rule.split(';');\n var steps, val, pre, pos;\n for (i = 0, f = parts.length; i < f; ++i) {\n if (parts[i].charAt(0) === ' ') {\n parts[i] = parts[i].substring(1);\n }\n steps = parts[i].split(':');\n prop = this._camelCase( steps[0].toLowerCase() );\n val = steps[1];\n if (val) {\n val = val.substring(1);\n\n if (prop === 'padding' || prop === 'margin' || prop === 'borderWidth') {\n\n if (prop === 'borderWidth') { pre = 'border'; pos = 'Width'; }\n else { pre = prop; pos = ''; }\n\n if (val.indexOf(' ') !== -1) {\n val = val.split(' ');\n props[pre + 'Top' + pos] = val[0];\n props[pre + 'Bottom'+ pos] = val[0];\n props[pre + 'Left' + pos] = val[1];\n props[pre + 'Right' + pos] = val[1];\n }\n else {\n props[pre + 'Top' + pos] = val;\n props[pre + 'Bottom'+ pos] = val;\n props[pre + 'Left' + pos] = val;\n props[pre + 'Right' + pos] = val;\n }\n }\n else if (prop === 'borderRadius') {\n if (val.indexOf(' ') !== -1) {\n val = val.split(' ');\n props.borderTopLeftRadius = val[0];\n props.borderBottomRightRadius = val[0];\n props.borderTopRightRadius = val[1];\n props.borderBottomLeftRadius = val[1];\n }\n else {\n props.borderTopLeftRadius = val;\n props.borderTopRightRadius = val;\n props.borderBottomLeftRadius = val;\n props.borderBottomRightRadius = val;\n }\n }\n else {\n props[prop] = val;\n }\n }\n }\n //}\n //console.log(props);\n\n return props;\n },\n\n /**\n * Change the font size of elements.\n * Changes the font size of the elements which match the given CSS rule\n * For this function to work, the CSS file must be in the same domain than the host page, otherwise JS can't access it.\n *\n * @method changeFontSize\n * @param {String} selector CSS selector rule\n * @param {Number} delta Number of pixels to change on font-size\n * @param {String} [op] Supported operations are '+' and '*'. defaults to '+'\n * @param {Number} [minVal] If result gets smaller than minVal, change does not occurr\n * @param {Number} [maxVal] If result gets bigger than maxVal, change does not occurr\n */\n changeFontSize: function(selector, delta, op, minVal, maxVal) {\n var that = this;\n Ink.requireModules(['Ink.Dom.Selector_1'], function(Selector) {\n var e;\n if (typeof selector !== 'string') { e = '1st argument must be a CSS selector rule.'; }\n else if (typeof delta !== 'number') { e = '2nd argument must be a number.'; }\n else if (op !== undefined && op !== '+' && op !== '*') { e = '3rd argument must be one of \"+\", \"*\".'; }\n else if (minVal !== undefined && (typeof minVal !== 'number' || minVal <= 0)) { e = '4th argument must be a positive number.'; }\n else if (maxVal !== undefined && (typeof maxVal !== 'number' || maxVal < maxVal)) { e = '5th argument must be a positive number greater than minValue.'; }\n if (e) { throw new TypeError(e); }\n\n var val, el, els = Selector.select(selector);\n if (minVal === undefined) { minVal = 1; }\n op = (op === '*') ? function(a,b){return a*b;} : function(a,b){return a+b;};\n for (var i = 0, f = els.length; i < f; ++i) {\n el = els[i];\n val = parseFloat( that.getStyle(el, 'fontSize'));\n val = op(val, delta);\n if (val < minVal) { continue; }\n if (typeof maxVal === 'number' && val > maxVal) { continue; }\n el.style.fontSize = val + 'px';\n }\n });\n }\n\n };\n\n return Css;\n\n});\n","/**\n * DOM Traversal and manipulation\n * @module Ink.Dom.Element_1\n * @version 1\n */\n\nInk.createModule('Ink.Dom.Element', 1, [], function() {\n\n 'use strict';\n\n var createContextualFragmentSupport = (\n typeof document.createRange === 'function' &&\n typeof window.Range.prototype.createContextualFragment === 'function');\n\n var deleteThisTbodyToken = 'Ink.Dom.Element tbody: ' + Math.random();\n var browserCreatesTbodies = (function () {\n var div = document.createElement('div');\n div.innerHTML = '';\n return div.getElementsByTagName('tbody').length !== 0;\n }());\n\n function rect(elem){\n var dimensions = {};\n try {\n dimensions = elem.getBoundingClientRect();\n } catch(e){\n dimensions = { top: elem.offsetTop, left: elem.offsetLeft };\n }\n return dimensions;\n }\n\n /**\n * @namespace Ink.Dom.Element_1\n */\n\n var InkElement = {\n\n /**\n * Checks if something is a DOM Element.\n *\n * @method isDOMElement\n * @static\n * @param {Mixed} o The object to be checked.\n * @return {Boolean} True if it's a valid DOM Element.\n * @example\n * var el = Ink.s('#element');\n * if( InkElement.isDOMElement( el ) === true ){\n * // It is a DOM Element.\n * } else {\n * // It is NOT a DOM Element.\n * }\n */\n isDOMElement: function(o) {\n return o !== null && typeof o === 'object' && 'nodeType' in o && o.nodeType === 1;\n },\n\n /**\n * Shortcut for `document.getElementById`\n *\n * @method get\n * @param {String|DOMElement} elm Either an ID of an element, or an element.\n * @return {DOMElement|null} The DOM element with the given id or null when it was not found\n * @sample Ink_Dom_Element_1_get.html\n */\n get: function(elm) {\n if(typeof elm !== 'undefined') {\n if(typeof elm === 'string') {\n return document.getElementById(elm);\n }\n return elm;\n }\n return null;\n },\n\n /**\n * Creates a DOM element\n *\n * @method create\n * @param {String} tag tag name\n * @param {Object} properties object with properties to be set on the element. You can also call other functions in Ink.Dom.Element like this\n * @sample Ink_Dom_Element_1_create.html\n */\n create: function(tag, properties) {\n var el = document.createElement(tag);\n //Ink.extendObj(el, properties);\n for(var property in properties) {\n if(properties.hasOwnProperty(property)) {\n if (property in InkElement) {\n InkElement[property](el, properties[property]);\n } else {\n if(property === 'className' || property === 'class') {\n el.className = properties.className || properties['class'];\n } else {\n el.setAttribute(property, properties[property]);\n }\n }\n }\n }\n return el;\n },\n\n /**\n * Removes a DOM Element\n *\n * @method remove\n * @param {DOMElement} elm The element to remove\n * @sample Ink_Dom_Element_1_remove.html\n */\n remove: function(el) {\n el = Ink.i(el);\n var parEl;\n if (el && (parEl = el.parentNode)) {\n parEl.removeChild(el);\n }\n },\n\n /**\n * Scrolls the window to an element\n *\n * @method scrollTo\n * @param {DOMElement|String} elm Element where to scroll\n * @sample Ink_Dom_Element_1_scrollTo.html\n */\n scrollTo: function(elm) {\n elm = InkElement.get(elm);\n if(elm) {\n if (elm.scrollIntoView) {\n return elm.scrollIntoView();\n }\n\n var elmOffset = {},\n elmTop = 0, elmLeft = 0;\n\n do {\n elmTop += elm.offsetTop || 0;\n elmLeft += elm.offsetLeft || 0;\n\n elm = elm.offsetParent;\n } while(elm);\n\n elmOffset = {x: elmLeft, y: elmTop};\n\n window.scrollTo(elmOffset.x, elmOffset.y);\n }\n },\n\n /**\n * Gets the top offset of an element\n *\n * @method offsetTop\n * @uses Ink.Dom.Browser\n *\n * @param {DOMElement|String} elm Target element\n * @return {Number} Offset from the target element to the top of the document\n * @sample Ink_Dom_Element_1_offsetTop.html\n */\n offsetTop: function(elm) {\n return InkElement.offset(elm)[1];\n },\n\n /**\n * Gets the left offset of an element\n *\n * @method offsetLeft\n * @uses Ink.Dom.Browser\n *\n * @param {DOMElement|String} elm Target element\n * @return {Number} Offset from the target element to the left of the document\n * @sample Ink_Dom_Element_1_offsetLeft.html\n */\n offsetLeft: function(elm) {\n return InkElement.offset(elm)[0];\n },\n\n /**\n * Gets the relative offset of an element\n *\n * @method positionedOffset\n * @param {DOMElement|String} elm Target element\n * @return {Array} Array with the element offsetleft and offsettop relative to the closest positioned ancestor\n * @sample Ink_Dom_Element_1_positionedOffset.html\n */\n positionedOffset: function(element) {\n var valueTop = 0, valueLeft = 0;\n element = InkElement.get(element);\n do {\n valueTop += element.offsetTop || 0;\n valueLeft += element.offsetLeft || 0;\n element = element.offsetParent;\n if (element) {\n if (element.tagName.toLowerCase() === 'body') { break; }\n\n var value = element.style.position;\n if (!value && element.currentStyle) {\n value = element.currentStyle.position;\n }\n if ((!value || value === 'auto') && typeof getComputedStyle !== 'undefined') {\n var css = getComputedStyle(element, null);\n value = css ? css.position : null;\n }\n if (value === 'relative' || value === 'absolute') { break; }\n }\n } while (element);\n return [valueLeft, valueTop];\n },\n\n /**\n * Gets the cumulative offset for an element\n *\n * Returns the top left position of the element on the page\n *\n * @method offset\n * @uses Ink.Dom.Browser\n *\n * @method offset\n * @param {DOMElement|String} elm Target element\n * @return {[Number, Number]} Array with pixel distance from the target element to the top left corner of the document\n * @sample Ink_Dom_Element_1_offset.html\n */\n offset: function(el) {\n /*jshint boss:true */\n el = Ink.i(el);\n var res = [0, 0];\n var doc = el.ownerDocument,\n docElem = doc.documentElement,\n box = rect(el),\n body = doc.body,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n scrollTop = doc.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = doc.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n top = box.top + scrollTop - clientTop,\n left = box.left + scrollLeft - clientLeft;\n res = [left, top];\n return res;\n },\n\n /**\n * Gets the scroll of the element\n *\n * @method scroll\n * @param {DOMElement|String} [elm] Target element or document.body\n * @returns {Array} offset values for x and y scroll\n * @sample Ink_Dom_Element_1_scroll.html\n */\n scroll: function(elm) {\n elm = elm ? Ink.i(elm) : document.body;\n return [\n ( ( !window.pageXOffset ) ? elm.scrollLeft : window.pageXOffset ),\n ( ( !window.pageYOffset ) ? elm.scrollTop : window.pageYOffset )\n ];\n },\n\n _getPropPx: function(cs, prop) {\n var n, c;\n var val = cs.getPropertyValue ? cs.getPropertyValue(prop) : cs[prop];\n if (!val) { n = 0; }\n else {\n c = val.indexOf('px');\n if (c === -1) { n = 0; }\n else {\n n = parseFloat(val, 10);\n }\n }\n\n //console.log([prop, ' \"', val, '\" ', n].join(''));\n\n return n;\n },\n\n /**\n * Alias for offset()\n *\n * @method offset2\n * @deprecated Kept for historic reasons. Use offset() instead.\n */\n offset2: function(el) {\n return InkElement.offset(el);\n },\n\n /**\n * Checks if an element has an attribute\n *\n * @method hasAttribute\n * @param {Object} elm Target element\n * @param {String} attr Attribute name\n * @return {Boolean} Boolean based on existance of attribute\n * @sample Ink_Dom_Element_1_hasAttribute.html\n */\n hasAttribute: function(elm, attr){\n elm = Ink.i(elm);\n return elm.hasAttribute ? elm.hasAttribute(attr) : !!elm.getAttribute(attr);\n },\n /**\n * Inserts an element right after another\n *\n * @method insertAfter\n * @param {DOMElement} newElm Element to be inserted\n * @param {DOMElement|String} targetElm Key element\n * @sample Ink_Dom_Element_1_insertAfter.html\n */\n insertAfter: function(newElm, targetElm) {\n /*jshint boss:true */\n if (targetElm = InkElement.get(targetElm)) {\n if (targetElm.nextSibling !== null) {\n targetElm.parentNode.insertBefore(newElm, targetElm.nextSibling);\n } else {\n targetElm.parentNode.appendChild(newElm);\n }\n }\n },\n\n /**\n * Inserts an element before another\n *\n * @method insertBefore\n * @param {DOMElement} newElm Element to be inserted\n * @param {DOMElement|String} targetElm Key element\n * @sample Ink_Dom_Element_1_insertBefore.html\n */\n insertBefore: function (newElm, targetElm) {\n /*jshint boss:true */\n if ( (targetElm = InkElement.get(targetElm)) ) {\n targetElm.parentNode.insertBefore(newElm, targetElm);\n }\n },\n\n /**\n * Inserts an element as the first child of another\n *\n * @method insertTop\n * @param {DOMElement} newElm Element to be inserted\n * @param {DOMElement|String} targetElm Key element\n * @sample Ink_Dom_Element_1_insertTop.html\n */\n insertTop: function(newElm,targetElm) {\n /*jshint boss:true */\n if (targetElm = InkElement.get(targetElm)) {\n if (targetElm.firstChild) {\n targetElm.insertBefore(newElm, targetElm.firstChild);\n } else {\n targetElm.appendChild(newElm);\n }\n }\n },\n\n /**\n * Inserts an element as the last child of another\n *\n * @method insertBottom\n * @param {DOMElement} newElm Element to be inserted\n * @param {DOMElement|String} targetElm Key element\n * @sample Ink_Dom_Element_1_insertBottom.html\n */\n insertBottom: function(newElm, targetElm) {\n /*jshint boss:true */\n targetElm = Ink.i(targetElm);\n targetElm.appendChild(newElm);\n },\n\n /**\n * Retrieves textContent from node\n *\n * @method textContent\n * @param {DOMNode} node Where to retreive text from. Can be any node type.\n * @return {String} the text\n * @sample Ink_Dom_Element_1_textContent.html\n */\n textContent: function(node){\n node = Ink.i(node);\n var text, k, cs, m;\n\n switch(node && node.nodeType) {\n case 9: /*DOCUMENT_NODE*/\n // IE quirks mode does not have documentElement\n return InkElement.textContent(node.documentElement || node.body && node.body.parentNode || node.body);\n\n case 1: /*ELEMENT_NODE*/\n text = node.innerText;\n if (typeof text !== 'undefined') {\n return text;\n }\n /* falls through */\n case 11: /*DOCUMENT_FRAGMENT_NODE*/\n text = node.textContent;\n if (typeof text !== 'undefined') {\n return text;\n }\n\n if (node.firstChild === node.lastChild) {\n // Common case: 0 or 1 children\n return InkElement.textContent(node.firstChild);\n }\n\n text = [];\n cs = node.childNodes;\n for (k = 0, m = cs.length; k < m; ++k) {\n text.push( InkElement.textContent( cs[k] ) );\n }\n return text.join('');\n\n case 3: /*TEXT_NODE*/\n case 4: /*CDATA_SECTION_NODE*/\n return node.nodeValue;\n }\n return '';\n },\n\n /**\n * Replaces text content of a DOM Node\n * This method removes any child node previously present\n *\n * @method setTextContent\n * @param {DOMNode} node node Target node where the text will be added.\n * @param {String} text text Text to be added on the node.\n * @sample Ink_Dom_Element_1_setTextContent.html\n */\n setTextContent: function(node, text){\n node = Ink.i(node);\n switch(node && node.nodeType)\n {\n case 1: /*ELEMENT_NODE*/\n if ('innerText' in node) {\n node.innerText = text;\n break;\n }\n /* falls through */\n case 11: /*DOCUMENT_FRAGMENT_NODE*/\n if ('textContent' in node) {\n node.textContent = text;\n break;\n }\n /* falls through */\n case 9: /*DOCUMENT_NODE*/\n while(node.firstChild) {\n node.removeChild(node.firstChild);\n }\n if (text !== '') {\n var doc = node.ownerDocument || node;\n node.appendChild(doc.createTextNode(text));\n }\n break;\n\n case 3: /*TEXT_NODE*/\n case 4: /*CDATA_SECTION_NODE*/\n node.nodeValue = text;\n break;\n }\n },\n\n /**\n * Checks if an element is a link\n *\n * @method isLink\n * @param {DOMNode} node Node to check if it's link\n * @return {Boolean}\n * @sample Ink_Dom_Element_1_isLink.html\n */\n isLink: function(element){\n var b = element && element.nodeType === 1 && ((/^a|area$/i).test(element.tagName) ||\n element.hasAttributeNS && element.hasAttributeNS('http://www.w3.org/1999/xlink','href'));\n return !!b;\n },\n\n /**\n * Checks if a node is an ancestor of another\n *\n * @method isAncestorOf\n * @param {DOMNode} ancestor Ancestor node\n * @param {DOMNode} node Descendant node\n * @return {Boolean}\n * @sample Ink_Dom_Element_1_isAncestorOf.html\n */\n isAncestorOf: function(ancestor, node){\n /*jshint boss:true */\n if (!node || !ancestor) {\n return false;\n }\n if (node.compareDocumentPosition) {\n return (ancestor.compareDocumentPosition(node) & 0x10) !== 0;/*Node.DOCUMENT_POSITION_CONTAINED_BY*/\n }\n while (node = node.parentNode){\n if (node === ancestor){\n return true;\n }\n }\n return false;\n },\n\n /**\n * Checks if a node is descendant of another\n *\n * @method descendantOf\n * @param {DOMNode} node The ancestor\n * @param {DOMNode} descendant The descendant\n * @return {Boolean} true if 'descendant' is descendant of 'node'\n * @sample Ink_Dom_Element_1_descendantOf.html\n */\n descendantOf: function(node, descendant){\n return node !== descendant && InkElement.isAncestorOf(node, descendant);\n },\n\n /**\n * Get first child element of another\n * @method firstElementChild\n * @param {DOMElement} elm Parent node\n * @return {DOMElement} the Element child\n * @sample Ink_Dom_Element_1_firstElementChild.html\n */\n firstElementChild: function(elm){\n if(!elm) {\n return null;\n }\n if ('firstElementChild' in elm) {\n return elm.firstElementChild;\n }\n var child = elm.firstChild;\n while(child && child.nodeType !== 1) {\n child = child.nextSibling;\n }\n return child;\n },\n\n /**\n * Get the last child element of another\n * @method lastElementChild\n * @param {DOMElement} elm Parent node\n * @return {DOMElement} the Element child\n * @sample Ink_Dom_Element_1_lastElementChild.html\n */\n lastElementChild: function(elm){\n if(!elm) {\n return null;\n }\n if ('lastElementChild' in elm) {\n return elm.lastElementChild;\n }\n var child = elm.lastChild;\n while(child && child.nodeType !== 1) {\n child = child.previousSibling;\n }\n return child;\n },\n\n /**\n * Get the first sibling element after the node\n *\n * @method nextElementSibling\n * @param {DOMNode} node The current node\n * @return {DOMElement|Null} The first sibling element after node or null if none is found\n * @sample Ink_Dom_Element_1_nextElementSibling.html \n */\n nextElementSibling: function(node){\n var sibling = null;\n\n if(!node){ return sibling; }\n\n if(\"nextElementSibling\" in node){\n return node.nextElementSibling;\n } else {\n sibling = node.nextSibling;\n\n // 1 === Node.ELEMENT_NODE\n while(sibling && sibling.nodeType !== 1){\n sibling = sibling.nextSibling;\n }\n\n return sibling;\n }\n },\n\n /**\n * Get the first sibling element before the node\n *\n * @method previousElementSibling\n * @param {DOMNode} node The current node\n * @return {DOMElement|Null} The first element sibling before node or null if none is found\n * @sample Ink_Dom_Element_1_previousElementSibling.html \n */\n previousElementSibling: function(node){\n var sibling = null;\n\n if(!node){ return sibling; }\n\n if(\"previousElementSibling\" in node){\n return node.previousElementSibling;\n } else {\n sibling = node.previousSibling;\n\n // 1 === Node.ELEMENT_NODE\n while(sibling && sibling.nodeType !== 1){\n sibling = sibling.previousSibling;\n }\n\n return sibling;\n }\n },\n\n /**\n * Get an element's width in pixels.\n *\n * @method elementWidth\n * @param {DOMElement|String} element Target DOM element or target ID\n * @return {Number} The element's width\n * @sample Ink_Dom_Element_1_elementWidth.html \n */\n elementWidth: function(element) {\n if(typeof element === \"string\") {\n element = document.getElementById(element);\n }\n return element.offsetWidth;\n },\n\n /**\n * Get an element's height in pixels.\n *\n * @method elementHeight\n * @param {DOMElement|String} element DOM element or target ID\n * @return {Number} The element's height\n * @sample Ink_Dom_Element_1_elementHeight.html \n */\n elementHeight: function(element) {\n if(typeof element === \"string\") {\n element = document.getElementById(element);\n }\n return element.offsetHeight;\n },\n\n /**\n * Deprecated. Alias for offsetLeft()\n *\n * @method elementLeft\n * @param {DOMElement|String} element DOM element or target ID\n * @return {Number} Element's left position\n */\n elementLeft: function(element) {\n return InkElement.offsetLeft(element);\n },\n\n /**\n * Deprecated. Alias for offsetTop()\n *\n * @method elementTop\n * @param {DOMElement|string} element Target DOM element or target ID\n * @return {Number} element's top position\n */\n elementTop: function(element) {\n return InkElement.offsetTop(element);\n },\n\n /**\n * Get an element's dimensions in pixels.\n *\n * @method elementDimensions\n * @param {DOMElement|string} element DOM element or target ID\n * @return {Array} Array with element's width and height\n * @sample Ink_Dom_Element_1_elementDimensions.html \n */\n elementDimensions: function(element) {\n element = Ink.i(element);\n return [element.offsetWidth, element.offsetHeight];\n },\n\n /**\n * Get the outer dimensions of an element in pixels.\n *\n * @method outerDimensions\n * @uses Ink.Dom.Css\n *\n * @param {DOMElement} element Target element\n * @return {Array} Array with element width and height.\n * @sample Ink_Dom_Element_1_outerDimensions.html \n */\n outerDimensions: function (element) {\n var bbox = rect(element);\n\n var Css = Ink.getModule('Ink.Dom.Css_1');\n var getStyle = Ink.bindMethod(Css, 'getStyle', element);\n\n return [\n bbox.right - bbox.left + parseFloat(getStyle('marginLeft') || 0) + parseFloat(getStyle('marginRight') || 0), // w\n bbox.bottom - bbox.top + parseFloat(getStyle('marginTop') || 0) + parseFloat(getStyle('marginBottom') || 0) // h\n ];\n },\n\n /**\n * Check if an element is inside the viewport\n *\n * @method inViewport\n * @param {DOMElement} element DOM Element\n * @param {Object} [options] Options object. If you pass a Boolean value here, it is interpreted as `options.partial`\n * @param {Boolean} [options.partial]=false Return `true` even if it is only partially visible.\n * @param {Number} [options.margin]=0 Consider a margin all around the viewport with `opts.margin` width a dead zone.\n * @return {Boolean}\n * @sample Ink_Dom_Element_1_inViewport.html \n */\n inViewport: function (element, opts) {\n var dims = rect(Ink.i(element));\n if (typeof opts === 'boolean') {\n opts = {partial: opts, margin: 0};\n }\n opts = Ink.extendObj({ partial: false, margin: 0}, opts || {});\n if (opts.partial) {\n return dims.bottom + opts.margin > 0 && // from the top\n dims.left - opts.margin < InkElement.viewportWidth() && // from the right\n dims.top - opts.margin < InkElement.viewportHeight() && // from the bottom\n dims.right + opts.margin > 0; // from the left\n } else {\n return dims.top + opts.margin > 0 && // from the top\n dims.right - opts.margin < InkElement.viewportWidth() && // from the right\n dims.bottom - opts.margin < InkElement.viewportHeight() && // from the bottom\n dims.left + opts.margin > 0; // from the left\n }\n },\n\n /**\n * Check if an element is hidden.\n * Taken from Mootools Element extras ( https://gist.github.com/cheeaun/73342 )\n * Does not take into account visibility:hidden\n * @method isHidden\n * @param {DOMElement} element Element to check\n * @return {Boolean}\n * @sample Ink_Dom_Element_1_isHidden.html \n */\n\n isHidden: function (element) {\n var w = element.offsetWidth, \n h = element.offsetHeight,\n force = (element.tagName.toLowerCase() === 'tr');\n\n var Css = Ink.getModule('Ink.Dom.Css_1');\n\n return (w===0 && h===0 && !force) ? true :\n (w!==0 && h!==0 && !force) ? false :\n Css.getStyle(element, 'display').toLowerCase() === 'none';\n },\n\n /**\n * Check if an element is visible \n *\n * @method isVisible\n * @uses isHidden\n * @param {DOMElement} element Element to check\n * @return {Boolean}\n * @sample Ink_Dom_Element_1_isVisible.html \n */\n\n isVisible: function (element) {\n return !this.isHidden(element);\n },\n\n /**\n * Clones an element's position to another\n *\n * @method clonePosition\n * @param {DOMElement} cloneTo element to be position cloned\n * @param {DOMElement} cloneFrom element to get the cloned position\n * @return {DOMElement} The element with positionClone\n * @sample Ink_Dom_Element_1_clonePosition.html \n */\n clonePosition: function(cloneTo, cloneFrom){\n var pos = InkElement.offset(cloneFrom);\n cloneTo.style.left = pos[0]+'px';\n cloneTo.style.top = pos[1]+'px';\n\n return cloneTo;\n },\n\n /**\n * Text-overflow: ellipsis emulation\n * Slices off a piece of text at the end of the element and adds the ellipsis so all text fits inside.\n *\n * @method ellipsizeText\n * @param {DOMElement} element Element to modify text content\n * @param {String} [ellipsis]='\\u2026' String to append to the chopped text\n */\n ellipsizeText: function(element/*, ellipsis*/){\n if ((element = Ink.i(element))) {\n element.style.overflow = 'hidden';\n element.style.whiteSpace = 'nowrap';\n element.style.textOverflow = 'ellipsis';\n }\n },\n\n /**\n * Finds the closest ancestor element matching your test function\n * \n *\n * @method findUpwardsHaving\n * @param {DOMElement} element Element to base the search from\n * @param {Function} boolTest Testing function\n * @return {DOMElement|false} The matched element or false if did not match\n * @sample Ink_Dom_Element_1_findUpwardsHaving.html \n */\n findUpwardsHaving: function(element, boolTest) {\n while (element && element.nodeType === 1) {\n if (boolTest(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n },\n\n /**\n * Finds the closest ancestor by class name\n *\n * @method findUpwardsByClass\n * @uses findUpwardsHaving\n * @param {DOMElement} element Element to base the search from\n * @param {String} className Class name to search\n * @returns {DOMElement|false} The matched element or false if did not match\n * @sample Ink_Dom_Element_1_findUpwardsByClass.html \n */\n findUpwardsByClass: function(element, className) {\n var re = new RegExp(\"(^|\\\\s)\" + className + \"(\\\\s|$)\");\n var tst = function(el) {\n var cls = el.className;\n return cls && re.test(cls);\n };\n return InkElement.findUpwardsHaving(element, tst);\n },\n\n /**\n * Finds the closest ancestor by tag name\n *\n * @method findUpwardsByTag\n * @param {DOMElement} element Element to base the search from\n * @param {String} tag Tag to search\n * @returns {DOMElement|false} the matched element or false if did not match\n * @sample Ink_Dom_Element_1_findUpwardsByTag.html \n */\n findUpwardsByTag: function(element, tag) {\n tag = tag.toUpperCase();\n var tst = function(el) {\n return el.nodeName && el.nodeName.toUpperCase() === tag;\n };\n return InkElement.findUpwardsHaving(element, tst);\n },\n\n /**\n * Finds the closest ancestor by id\n *\n * @method findUpwardsById\n * @param {HtmlElement} element Element to base the search from\n * @param {String} id ID to search\n * @returns {HtmlElement|false} The matched element or false if did not match\n * @sample Ink_Dom_Element_1_findUpwardsById.html \n */\n findUpwardsById: function(element, id) {\n var tst = function(el) {\n return el.id === id;\n };\n return InkElement.findUpwardsHaving(element, tst);\n },\n\n /**\n * Finds the closest ancestor by CSS selector\n *\n * @method findUpwardsBySelector\n * @param {HtmlElement} element Element to base the search from\n * @param {String} sel CSS selector\n * @returns {HtmlElement|false} The matched element or false if did not match\n * @sample Ink_Dom_Element_1_findUpwardsBySelector.html \n */\n findUpwardsBySelector: function(element, sel) {\n var Selector = Ink.getModule('Ink.Dom.Selector', '1');\n if (!Selector) {\n throw new Error('This method requires Ink.Dom.Selector');\n }\n var tst = function(el) {\n return Selector.matchesSelector(el, sel);\n };\n return InkElement.findUpwardsHaving(element, tst);\n },\n\n /**\n * Gets the trimmed text of an element\n *\n * @method getChildrenText\n * @param {DOMElement} el Element to base the search from\n * @param {Boolean} [removeIt] Flag to remove the text from the element\n * @return {String} Text found\n * @sample Ink_Dom_Element_1_getChildrenText.html \n */\n getChildrenText: function(el, removeIt) {\n var node,\n j,\n part,\n nodes = el.childNodes,\n jLen = nodes.length,\n text = '';\n\n if (!el) {\n return text;\n }\n\n for (j = 0; j < jLen; ++j) {\n node = nodes[j];\n if (!node) { continue; }\n if (node.nodeType === 3) { // TEXT NODE\n part = InkElement._trimString( String(node.data) );\n if (part.length > 0) {\n text += part;\n if (removeIt) { el.removeChild(node); }\n }\n else { el.removeChild(node); }\n }\n }\n\n return text;\n },\n\n /**\n * String trim implementation\n * Used by getChildrenText\n *\n * function _trimString\n * param {String} text\n * return {String} trimmed text\n */\n _trimString: function(text) {\n return (String.prototype.trim) ? text.trim() : text.replace(/^\\s*/, '').replace(/\\s*$/, '');\n },\n\n /**\n * Gets value of a select element\n *\n * @method getSelectValues\n * @param {DOMElement|String} select element\n * @return {Array} The selected values\n * @sample Ink_Dom_Element_1_getSelectValues.html \n */\n getSelectValues: function (select) {\n var selectEl = Ink.i(select);\n var values = [];\n for (var i = 0; i < selectEl.options.length; ++i) {\n values.push( selectEl.options[i].value );\n }\n return values;\n },\n\n\n /* used by fills */\n _normalizeData: function(data) {\n var d, data2 = [];\n for (var i = 0, f = data.length; i < f; ++i) {\n d = data[i];\n\n if (!(d instanceof Array)) { // if not array, wraps primitive twice: val -> [val, val]\n d = [d, d];\n }\n else if (d.length === 1) { // if 1 element array: [val] -> [val, val]\n d.push(d[0]);\n }\n data2.push(d);\n }\n return data2;\n },\n\n\n /**\n * Fills a select element with options\n *\n * @method fillSelect\n * @param {DOMElement|String} container Select element which will get filled\n * @param {Array} data Data to populate the component\n * @param {Boolean} [skipEmpty] Flag to skip empty option\n * @param {String|Number} [defaultValue] Initial selected value\n *\n * @sample Ink_Dom_Element_1_fillSelect.html \n */\n fillSelect: function(container, data, skipEmpty, defaultValue) {\n var containerEl = Ink.i(container);\n if (!containerEl) { return; }\n\n containerEl.innerHTML = '';\n var d, optionEl;\n\n if (!skipEmpty) {\n // add initial empty option\n optionEl = document.createElement('option');\n optionEl.setAttribute('value', '');\n containerEl.appendChild(optionEl);\n }\n\n data = InkElement._normalizeData(data);\n\n for (var i = 0, f = data.length; i < f; ++i) {\n d = data[i];\n\n optionEl = document.createElement('option');\n optionEl.setAttribute('value', d[0]);\n if (d.length > 2) {\n optionEl.setAttribute('extra', d[2]);\n }\n optionEl.appendChild( document.createTextNode(d[1]) );\n\n if (d[0] === defaultValue) {\n optionEl.setAttribute('selected', 'selected');\n }\n\n containerEl.appendChild(optionEl);\n }\n },\n\n\n /**\n * Creates a set of radio buttons from an array of data\n *\n * @method fillRadios\n * @param {DOMElement|String} insertAfterEl Element after which the input elements will be created\n * @param {String} name Name for the form field ([] is added if not present as a suffix)\n * @param {Array} data Data to populate the component\n * @param {Boolean} [skipEmpty] Flag to skip creation of empty options\n * @param {String|Number} [defaultValue] Initial selected value\n * @param {String} [splitEl] Name of element to add after each input element (example: 'br')\n * @return {DOMElement} Wrapper element around the radio buttons\n */\n fillRadios: function(insertAfterEl, name, data, skipEmpty, defaultValue, splitEl) {\n insertAfterEl = Ink.i(insertAfterEl);\n var containerEl = document.createElement('span');\n InkElement.insertAfter(containerEl, insertAfterEl);\n\n data = InkElement._normalizeData(data);\n\n /*\n if (name.substring(name.length - 1) !== ']') {\n name += '[]';\n }\n */\n\n var d, inputEl;\n\n if (!skipEmpty) {\n // add initial empty option\n inputEl = document.createElement('input');\n inputEl.setAttribute('type', 'radio');\n inputEl.setAttribute('name', name);\n inputEl.setAttribute('value', '');\n containerEl.appendChild(inputEl);\n if (splitEl) { containerEl.appendChild( document.createElement(splitEl) ); }\n }\n\n for (var i = 0; i < data.length; ++i) {\n d = data[i];\n\n inputEl = document.createElement('input');\n inputEl.setAttribute('type', 'radio');\n inputEl.setAttribute('name', name);\n inputEl.setAttribute('value', d[0]);\n containerEl.appendChild(inputEl);\n containerEl.appendChild( document.createTextNode(d[1]) );\n if (splitEl) { containerEl.appendChild( document.createElement(splitEl) ); }\n\n if (d[0] === defaultValue) {\n inputEl.checked = true;\n }\n }\n\n return containerEl;\n },\n\n\n /**\n * Creates set of checkbox buttons\n *\n * @method fillChecks\n * @param {DOMElement|String} insertAfterEl Element after which the input elements will be created\n * @param {String} name Name for the form field ([] is added if not present as a suffix)\n * @param {Array} data Data to populate the component\n * @param {Boolean} [skipEmpty] Flag to skip creation of empty options\n * @param {String|Number} [defaultValue] Initial selected value\n * @param {String} [splitEl] Name of element to add after each input element (example: 'br')\n * @return {DOMElement} Wrapper element around the checkboxes\n */\n fillChecks: function(insertAfterEl, name, data, defaultValue, splitEl) {\n insertAfterEl = Ink.i(insertAfterEl);\n var containerEl = document.createElement('span');\n InkElement.insertAfter(containerEl, insertAfterEl);\n\n data = InkElement._normalizeData(data);\n\n if (name.substring(name.length - 1) !== ']') {\n name += '[]';\n }\n\n var d, inputEl;\n\n for (var i = 0; i < data.length; ++i) {\n d = data[i];\n\n inputEl = document.createElement('input');\n inputEl.setAttribute('type', 'checkbox');\n inputEl.setAttribute('name', name);\n inputEl.setAttribute('value', d[0]);\n containerEl.appendChild(inputEl);\n containerEl.appendChild( document.createTextNode(d[1]) );\n if (splitEl) { containerEl.appendChild( document.createElement(splitEl) ); }\n\n if (d[0] === defaultValue) {\n inputEl.checked = true;\n }\n }\n\n return containerEl;\n },\n\n\n /**\n * Gets the index of an element relative to a parent\n *\n * @method parentIndexOf\n * @param {DOMElement} parentEl Element to parse\n * @param {DOMElement} childEl Child Element to look for\n * @return {Number} The index of the childEl inside parentEl. Returns -1 if it's not a direct child\n * @sample Ink_Dom_Element_1_parentIndexOf.html \n */\n parentIndexOf: function(parentEl, childEl) {\n var node, idx = 0;\n for (var i = 0, f = parentEl.childNodes.length; i < f; ++i) {\n node = parentEl.childNodes[i];\n if (node.nodeType === 1) { // ELEMENT\n if (node === childEl) { return idx; }\n ++idx;\n }\n }\n return -1;\n },\n\n\n /**\n * Gets the next siblings of an element\n *\n * @method nextSiblings\n * @param {String|DOMElement} elm Element\n * @return {Array} Array of next sibling elements\n * @sample Ink_Dom_Element_1_nextSiblings.html \n */\n nextSiblings: function(elm) {\n elm = Ink.i(elm);\n if(typeof(elm) === 'object' && elm !== null && elm.nodeType && elm.nodeType === 1) {\n var elements = [],\n siblings = elm.parentNode.children,\n index = InkElement.parentIndexOf(elm.parentNode, elm);\n\n for(var i = ++index, len = siblings.length; i\" + html + \"
    \" + deleteThisTbodyToken + \"
    \";\n } else {\n div.innerHTML = \"\" + html + \"
    \";\n }\n return div.firstChild;\n },\n TBODY: function (div, html) {\n div.innerHTML = '' + html + '
    ';\n return div.firstChild.getElementsByTagName('tbody')[0];\n },\n THEAD: function (div, html) {\n div.innerHTML = '' + html + '
    ';\n return div.firstChild.getElementsByTagName('thead')[0];\n },\n TFOOT: function (div, html) {\n div.innerHTML = '' + html + '
    ';\n return div.firstChild.getElementsByTagName('tfoot')[0];\n },\n TR: function (div, html) {\n div.innerHTML = '' + html + '
    ';\n return div.firstChild.firstChild.firstChild;\n }\n },\n\n /**\n * Gets a wrapper DIV with a certain HTML content to be inserted inside another element.\n * This is necessary for appendHTML,prependHTML functions, because they need a container element to copy the children from.\n *\n * Works around IE table quirks\n * @method _getWrapper\n * @private\n * @param elm\n * @param html\n */\n _getWrapper: function (elm, html) {\n var nodeName = elm.nodeName && elm.nodeName.toUpperCase();\n var wrapper = document.createElement('div');\n var wrapFunc = InkElement._wrapElements[nodeName];\n\n if ( !wrapFunc ) {\n wrapper.innerHTML = html;\n return wrapper;\n }\n // special cases\n wrapper = wrapFunc(wrapper, html);\n // worst case: tbody auto-creation even when our HTML has a tbody.\n if (browserCreatesTbodies && nodeName === 'TABLE') {\n // terrible case. Deal with tbody creation too.\n var tds = wrapper.getElementsByTagName('td');\n for (var i = 0, len = tds.length; i < len; i++) {\n if (tds[i].innerHTML === deleteThisTbodyToken) {\n var tbody = tds[i].parentNode.parentNode;\n tbody.parentNode.removeChild(tbody);\n }\n }\n }\n return wrapper;\n },\n\n /**\n * Appends HTML to an element.\n * This method parses the html string and doesn't modify its contents\n *\n * @method appendHTML\n * @param {String|DOMElement} elm Element\n * @param {String} html Markup string\n * @sample Ink_Dom_Element_1_appendHTML.html \n */\n appendHTML: function(elm, html){\n elm = Ink.i(elm);\n if(elm !== null) {\n var wrapper = InkElement._getWrapper(elm, html);\n while (wrapper.firstChild) {\n elm.appendChild(wrapper.firstChild);\n }\n }\n },\n\n /**\n * Prepends HTML to an element.\n * This method parses the html string and doesn't modify its contents\n *\n * @method prependHTML\n * @param {String|DOMElement} elm Element\n * @param {String} html Markup string\n * @sample Ink_Dom_Element_1_prependHTML.html \n */\n prependHTML: function(elm, html){\n elm = Ink.i(elm);\n if(elm !== null) {\n var wrapper = InkElement._getWrapper(elm, html);\n while (wrapper.lastChild) {\n elm.insertBefore(wrapper.lastChild, elm.firstChild);\n }\n }\n },\n\n /**\n * Sets the inner HTML of an element.\n *\n * @method setHTML\n * @param {String|DOMElement} elm Element\n * @param {String} html Markup string\n * @sample Ink_Dom_Element_1_setHTML.html \n */\n setHTML: function (elm, html) {\n elm = Ink.i(elm);\n if(elm !== null) {\n try {\n elm.innerHTML = html;\n } catch (e) {\n // Tables in IE7\n while (elm.firstChild) {\n elm.removeChild(elm.firstChild);\n }\n InkElement.appendHTML(elm, html);\n }\n }\n },\n\n /**\n * Wraps an element inside a container.\n *\n * The container may or may not be in the document yet.\n *\n * @method wrap\n * @param {String|DOMElement} target Element to be wrapped\n * @param {String|DOMElement} container Element to wrap the target\n * @return Container element\n * @sample Ink_Dom_Element_1_wrap.html \n *\n * @example\n * before:\n *\n *
    \n *\n * call this function to wrap #target with a wrapper div.\n *\n * InkElement.wrap('target', InkElement.create('div', {id: 'container'});\n * \n * after: \n *\n *
    \n */\n wrap: function (target, container) {\n target = Ink.i(target);\n container = Ink.i(container);\n \n var nextNode = target.nextSibling;\n var parent = target.parentNode;\n\n container.appendChild(target);\n\n if (nextNode !== null) {\n parent.insertBefore(container, nextNode);\n } else {\n parent.appendChild(container);\n }\n\n return container;\n },\n\n /**\n * Places an element outside a wrapper.\n *\n * @method unwrap\n * @param {DOMElement} elem The element you're trying to unwrap. This should be an ancestor of the wrapper.\n * @param {String} [wrapperSelector] CSS Selector for the ancestor. Use this if your wrapper is not the direct parent of elem.\n * @sample Ink_Dom_Element_1_unwrap.html \n *\n * @example\n *\n * When you have this:\n *\n *
    \n *
    \n *
    \n *\n * If you do this:\n *\n * InkElement.unwrap('unwrapMe');\n *\n * You get this:\n *\n *
    \n *
    \n * \n **/\n unwrap: function (elem, wrapperSelector) {\n elem = Ink.i(elem);\n var wrapper;\n if (typeof wrapperSelector === 'string') {\n wrapper = InkElement.findUpwardsBySelector(elem, wrapperSelector);\n } else if (typeof wrapperSelector === 'object' && wrapperSelector.tagName) {\n wrapper = InkElement.findUpwardsHaving(elem, function (ancestor) {\n return ancestor === wrapperSelector;\n });\n } else {\n wrapper = elem.parentNode;\n }\n if (!wrapper || !wrapper.parentNode) { return; }\n\n InkElement.insertBefore(elem, wrapper);\n },\n\n /**\n * Replaces an element with another.\n *\n * @method replace\n * @param element The element to be replaced.\n * @param replacement The new element.\n * @sample Ink_Dom_Element_1_replace.html \n *\n * @example\n * var newelement1 = InkElement.create('div');\n * // ...\n * replace(Ink.i('element1'), newelement1);\n */\n replace: function (element, replacement) {\n element = Ink.i(element);\n if(element !== null) {\n element.parentNode.replaceChild(replacement, element);\n }\n },\n\n /**\n * Removes direct text children.\n * Useful to remove nasty layout gaps generated by whitespace on the markup.\n *\n * @method removeTextNodeChildren\n * @param {DOMElement} el Element to remove text from\n * @sample Ink_Dom_Element_1_removeTextNodeChildren.html \n */\n removeTextNodeChildren: function(el) {\n el = Ink.i(el);\n if(el !== null) {\n var prevEl, toRemove, parent = el;\n el = el.firstChild;\n while (el) {\n toRemove = (el.nodeType === 3);\n prevEl = el;\n el = el.nextSibling;\n if (toRemove) {\n parent.removeChild(prevEl);\n }\n }\n }\n },\n\n /**\n * Creates a documentFragment from an HTML string.\n *\n * @method htmlToFragment\n * @param {String} html HTML string\n * @return {DocumentFragment} DocumentFragment containing all of the elements from the html string\n * @sample Ink_Dom_Element_1_htmlToFragment.html \n */\n htmlToFragment: (createContextualFragmentSupport ?\n function(html){\n var range;\n\n if(typeof html !== 'string'){ return document.createDocumentFragment(); }\n\n range = document.createRange();\n\n // set the context to document.body (firefox does this already, webkit doesn't)\n range.selectNode(document.body);\n\n return range.createContextualFragment(html);\n } : function (html) {\n var fragment = document.createDocumentFragment(),\n tempElement,\n current;\n\n if(typeof html !== 'string'){ return fragment; }\n\n tempElement = document.createElement('div');\n tempElement.innerHTML = html;\n\n // append child removes elements from the original parent\n while( (current = tempElement.firstChild) ){ // intentional assignment\n fragment.appendChild(current);\n }\n\n return fragment;\n }),\n\n _camelCase: function(str)\n {\n return str ? str.replace(/-(\\w)/g, function (_, $1){\n return $1.toUpperCase();\n }) : str;\n },\n\n /**\n * Gets data attributes from an element\n *\n * @method data\n * @param {String|DOMElement} selector Element or CSS selector\n * @return {Object} Object with the data-* properties. If no data-attributes are present, an empty object is returned.\n * @sample Ink_Dom_Element_1_data.html \n */\n data: function(selector) {\n var el;\n if (typeof selector !== 'object' && typeof selector !== 'string') {\n throw '[Ink.Dom.Element.data] :: Invalid selector defined';\n }\n\n if (typeof selector === 'object') {\n el = selector;\n }\n else {\n var InkDomSelector = Ink.getModule('Ink.Dom.Selector', 1);\n if (!InkDomSelector) {\n throw \"[Ink.Dom.Element.data] :: this method requires Ink.Dom.Selector - v1\";\n }\n el = InkDomSelector.select(selector);\n if (el.length <= 0) {\n throw \"[Ink.Dom.Element.data] :: Can't find any element with the specified selector\";\n }\n el = el[0];\n }\n\n var dataset = {};\n var attrs = el.attributes || [];\n\n var curAttr, curAttrName, curAttrValue;\n if (attrs) {\n for (var i = 0, total = attrs.length; i < total; ++i) {\n curAttr = attrs[i];\n curAttrName = curAttr.name;\n curAttrValue = curAttr.value;\n if (curAttrName && curAttrName.indexOf('data-') === 0) {\n dataset[InkElement._camelCase(curAttrName.replace('data-', ''))] = curAttrValue;\n }\n }\n }\n\n return dataset;\n },\n\n /**\n * Move the cursor on an input or textarea element.\n * @method moveCursorTo\n * @param {DOMElement} el Input or Textarea element\n * @param {Number} t Index of the character to move the cursor to\n * @sample Ink_Dom_Element_1_moveCursorTo.html \n */\n moveCursorTo: function(el, t) {\n el = Ink.i(el);\n if(el !== null) {\n if (el.setSelectionRange) {\n el.setSelectionRange(t, t);\n //el.focus();\n }\n else {\n var range = el.createTextRange();\n range.collapse(true);\n range.moveEnd( 'character', t);\n range.moveStart('character', t);\n range.select();\n }\n }\n },\n\n /**\n * Get the page's width.\n * @method pageWidth\n * @return {Number} Page width in pixels\n * @sample Ink_Dom_Element_1_pageWidth.html \n */\n pageWidth: function() {\n var xScroll;\n\n if (window.innerWidth && window.scrollMaxX) {\n xScroll = window.innerWidth + window.scrollMaxX;\n } else if (document.body.scrollWidth > document.body.offsetWidth){\n xScroll = document.body.scrollWidth;\n } else {\n xScroll = document.body.offsetWidth;\n }\n\n var windowWidth;\n\n if (window.self.innerWidth) {\n if(document.documentElement.clientWidth){\n windowWidth = document.documentElement.clientWidth;\n } else {\n windowWidth = window.self.innerWidth;\n }\n } else if (document.documentElement && document.documentElement.clientWidth) {\n windowWidth = document.documentElement.clientWidth;\n } else if (document.body) {\n windowWidth = document.body.clientWidth;\n }\n\n if(xScroll < windowWidth){\n return xScroll;\n } else {\n return windowWidth;\n }\n },\n\n /**\n * Get the page's height.\n * @method pageHeight\n * @return {Number} Page height in pixels\n * @sample Ink_Dom_Element_1_pageHeight.html \n */\n pageHeight: function() {\n var yScroll;\n\n if (window.innerHeight && window.scrollMaxY) {\n yScroll = window.innerHeight + window.scrollMaxY;\n } else if (document.body.scrollHeight > document.body.offsetHeight){\n yScroll = document.body.scrollHeight;\n } else {\n yScroll = document.body.offsetHeight;\n }\n\n var windowHeight;\n\n if (window.self.innerHeight) {\n windowHeight = window.self.innerHeight;\n } else if (document.documentElement && document.documentElement.clientHeight) {\n windowHeight = document.documentElement.clientHeight;\n } else if (document.body) {\n windowHeight = document.body.clientHeight;\n }\n\n if(yScroll < windowHeight){\n return windowHeight;\n } else {\n return yScroll;\n }\n },\n\n /**\n * Get the viewport's width.\n * @method viewportWidth\n * @return {Number} Viewport width in pixels\n * @sample Ink_Dom_Element_1_viewportWidth.html \n */\n viewportWidth: function() {\n if(typeof window.innerWidth !== \"undefined\") {\n return window.innerWidth;\n }\n if (document.documentElement && typeof document.documentElement.offsetWidth !== \"undefined\") {\n return document.documentElement.offsetWidth;\n }\n },\n\n /**\n * Get the viewport's height.\n * @method viewportHeight\n * @return {Number} Viewport height in pixels\n * @sample Ink_Dom_Element_1_viewportHeight.html \n */\n viewportHeight: function() {\n if (typeof window.innerHeight !== \"undefined\") {\n return window.innerHeight;\n }\n if (document.documentElement && typeof document.documentElement.offsetHeight !== \"undefined\") {\n return document.documentElement.offsetHeight;\n }\n },\n\n /**\n * Get the scroll's width.\n * @method scrollWidth\n * @return {Number} Scroll width\n */\n scrollWidth: function() {\n if (typeof window.self.pageXOffset !== 'undefined') {\n return window.self.pageXOffset;\n }\n if (typeof document.documentElement !== 'undefined' && typeof document.documentElement.scrollLeft !== 'undefined') {\n return document.documentElement.scrollLeft;\n }\n return document.body.scrollLeft;\n },\n\n /**\n * Get the scroll's height.\n * @method scrollHeight\n * @return {Number} Scroll height\n */\n scrollHeight: function() {\n if (typeof window.self.pageYOffset !== 'undefined') {\n return window.self.pageYOffset;\n }\n if (typeof document.documentElement !== 'undefined' && typeof document.documentElement.scrollTop !== 'undefined') {\n return document.documentElement.scrollTop;\n }\n return document.body.scrollTop;\n }\n };\n\n return InkElement;\n\n});\n","/**\n * Event management\n * @module Ink.Dom.Event_1\n * @version 1\n */\n\nInk.createModule('Ink.Dom.Event', 1, [], function() {\n /* jshint\n asi:true,\n strict:false,\n laxcomma:true,\n eqeqeq:false,\n laxbreak:true,\n boss:true,\n curly:false,\n expr:true\n */\n\n /**\n * @namespace Ink.Dom.Event_1\n * @static\n */\n\n /*!\n * Bean - copyright (c) Jacob Thornton 2011-2012\n * https://github.com/fat/bean\n * MIT license\n */\n var bean = (function (name, context, definition) {\n return definition()\n })('bean', this, function (name, context) {\n name = name || 'bean'\n context = context || this\n\n var win = window\n , old = context[name]\n , namespaceRegex = /[^\\.]*(?=\\..*)\\.|.*/\n , nameRegex = /\\..*/\n , addEvent = 'addEventListener'\n , removeEvent = 'removeEventListener'\n , doc = document || {}\n , root = doc.documentElement || {}\n , W3C_MODEL = root[addEvent]\n , eventSupport = W3C_MODEL ? addEvent : 'attachEvent'\n , ONE = {} // singleton for quick matching making add() do one()\n\n , slice = Array.prototype.slice\n , str2arr = function (s, d) { return s.split(d || ' ') }\n , isString = function (o) { return typeof o == 'string' }\n , isFunction = function (o) { return typeof o == 'function' }\n\n // events that we consider to be 'native', anything not in this list will\n // be treated as a custom event\n , standardNativeEvents =\n 'click dblclick mouseup mousedown contextmenu ' + // mouse buttons\n 'mousewheel mousemultiwheel DOMMouseScroll ' + // mouse wheel\n 'mouseover mouseout mousemove selectstart selectend ' + // mouse movement\n 'keydown keypress keyup ' + // keyboard\n 'orientationchange ' + // mobile\n 'focus blur change reset select submit ' + // form elements\n 'load unload beforeunload resize move DOMContentLoaded ' + // window\n 'readystatechange message ' + // window\n 'error abort scroll ' // misc\n // element.fireEvent('onXYZ'... is not forgiving if we try to fire an event\n // that doesn't actually exist, so make sure we only do these on newer browsers\n , w3cNativeEvents =\n 'show ' + // mouse buttons\n 'input invalid ' + // form elements\n 'touchstart touchmove touchend touchcancel ' + // touch\n 'gesturestart gesturechange gestureend ' + // gesture\n 'textinput' + // TextEvent\n 'readystatechange pageshow pagehide popstate ' + // window\n 'hashchange offline online ' + // window\n 'afterprint beforeprint ' + // printing\n 'dragstart dragenter dragover dragleave drag drop dragend ' + // dnd\n 'loadstart progress suspend emptied stalled loadmetadata ' + // media\n 'loadeddata canplay canplaythrough playing waiting seeking ' + // media\n 'seeked ended durationchange timeupdate play pause ratechange ' + // media\n 'volumechange cuechange ' + // media\n 'checking noupdate downloading cached updateready obsolete ' // appcache\n\n // convert to a hash for quick lookups\n , nativeEvents = (function (hash, events, i) {\n for (i = 0; i < events.length; i++) events[i] && (hash[events[i]] = 1)\n return hash\n }({}, str2arr(standardNativeEvents + (W3C_MODEL ? w3cNativeEvents : ''))))\n\n // custom events are events that we *fake*, they are not provided natively but\n // we can use native events to generate them\n , customEvents = (function () {\n var isAncestor = 'compareDocumentPosition' in root\n ? function (element, container) {\n return container.compareDocumentPosition && (container.compareDocumentPosition(element) & 16) === 16\n }\n : 'contains' in root\n ? function (element, container) {\n container = container.nodeType === 9 || container === window ? root : container\n return container !== element && container.contains(element)\n }\n : function (element, container) {\n while (element = element.parentNode) if (element === container) return 1\n return 0\n }\n , check = function (event) {\n var related = event.relatedTarget\n return !related\n ? related == null\n : (related !== this && related.prefix !== 'xul' && !/document/.test(this.toString())\n && !isAncestor(related, this))\n }\n\n return {\n mouseenter: { base: 'mouseover', condition: check }\n , mouseleave: { base: 'mouseout', condition: check }\n , mousewheel: { base: /Firefox/.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel' }\n }\n }())\n\n // we provide a consistent Event object across browsers by taking the actual DOM\n // event object and generating a new one from its properties.\n , Event = (function () {\n // a whitelist of properties (for different event types) tells us what to check for and copy\n var commonProps = str2arr('altKey attrChange attrName bubbles cancelable ctrlKey currentTarget ' +\n 'detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey ' +\n 'srcElement target timeStamp type view which propertyName')\n , mouseProps = commonProps.concat(str2arr('button buttons clientX clientY dataTransfer ' +\n 'fromElement offsetX offsetY pageX pageY screenX screenY toElement'))\n , mouseWheelProps = mouseProps.concat(str2arr('wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ ' +\n 'axis')) // 'axis' is FF specific\n , keyProps = commonProps.concat(str2arr('char charCode key keyCode keyIdentifier ' +\n 'keyLocation location'))\n , textProps = commonProps.concat(str2arr('data'))\n , touchProps = commonProps.concat(str2arr('touches targetTouches changedTouches scale rotation'))\n , messageProps = commonProps.concat(str2arr('data origin source'))\n , stateProps = commonProps.concat(str2arr('state'))\n , overOutRegex = /over|out/\n // some event types need special handling and some need special properties, do that all here\n , typeFixers = [\n { // key events\n reg: /key/i\n , fix: function (event, newEvent) {\n newEvent.keyCode = event.keyCode || event.which\n return keyProps\n }\n }\n , { // mouse events\n reg: /click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i\n , fix: function (event, newEvent, type) {\n newEvent.rightClick = event.which === 3 || event.button === 2\n newEvent.pos = { x: 0, y: 0 }\n if (event.pageX || event.pageY) {\n newEvent.clientX = event.pageX\n newEvent.clientY = event.pageY\n } else if (event.clientX || event.clientY) {\n newEvent.clientX = event.clientX + doc.body.scrollLeft + root.scrollLeft\n newEvent.clientY = event.clientY + doc.body.scrollTop + root.scrollTop\n }\n if (overOutRegex.test(type)) {\n newEvent.relatedTarget = event.relatedTarget\n || event[(type == 'mouseover' ? 'from' : 'to') + 'Element']\n }\n return mouseProps\n }\n }\n , { // mouse wheel events\n reg: /mouse.*(wheel|scroll)/i\n , fix: function () { return mouseWheelProps }\n }\n , { // TextEvent\n reg: /^text/i\n , fix: function () { return textProps }\n }\n , { // touch and gesture events\n reg: /^touch|^gesture/i\n , fix: function () { return touchProps }\n }\n , { // message events\n reg: /^message$/i\n , fix: function () { return messageProps }\n }\n , { // popstate events\n reg: /^popstate$/i\n , fix: function () { return stateProps }\n }\n , { // everything else\n reg: /.*/\n , fix: function () { return commonProps }\n }\n ]\n , typeFixerMap = {} // used to map event types to fixer functions (above), a basic cache mechanism\n\n , Event = function (event, element, isNative) {\n if (!arguments.length) return\n event = event || ((element.ownerDocument || element.document || element).parentWindow || win).event\n this.originalEvent = event\n this.isNative = isNative\n this.isBean = true\n\n if (!event) return\n\n var type = event.type\n , target = event.target || event.srcElement\n , i, l, p, props, fixer\n\n this.target = target && target.nodeType === 3 ? target.parentNode : target\n\n if (isNative) { // we only need basic augmentation on custom events, the rest expensive & pointless\n fixer = typeFixerMap[type]\n if (!fixer) { // haven't encountered this event type before, map a fixer function for it\n for (i = 0, l = typeFixers.length; i < l; i++) {\n if (typeFixers[i].reg.test(type)) { // guaranteed to match at least one, last is .*\n typeFixerMap[type] = fixer = typeFixers[i].fix\n break\n }\n }\n }\n\n props = fixer(event, this, type)\n for (i = props.length; i--;) {\n if (!((p = props[i]) in this) && p in event) this[p] = event[p]\n }\n }\n }\n\n // preventDefault() and stopPropagation() are a consistent interface to those functions\n // on the DOM, stop() is an alias for both of them together\n Event.prototype.preventDefault = function () {\n if (this.originalEvent.preventDefault) this.originalEvent.preventDefault()\n else this.originalEvent.returnValue = false\n }\n Event.prototype.stopPropagation = function () {\n if (this.originalEvent.stopPropagation) this.originalEvent.stopPropagation()\n else this.originalEvent.cancelBubble = true\n }\n Event.prototype.stop = function () {\n this.preventDefault()\n this.stopPropagation()\n this.stopped = true\n }\n // stopImmediatePropagation() has to be handled internally because we manage the event list for\n // each element\n // note that originalElement may be a Bean#Event object in some situations\n Event.prototype.stopImmediatePropagation = function () {\n if (this.originalEvent.stopImmediatePropagation) this.originalEvent.stopImmediatePropagation()\n this.isImmediatePropagationStopped = function () { return true }\n }\n Event.prototype.isImmediatePropagationStopped = function () {\n return this.originalEvent.isImmediatePropagationStopped && this.originalEvent.isImmediatePropagationStopped()\n }\n Event.prototype.clone = function (currentTarget) {\n //TODO: this is ripe for optimisation, new events are *expensive*\n // improving this will speed up delegated events\n var ne = new Event(this, this.element, this.isNative)\n ne.currentTarget = currentTarget\n return ne\n }\n\n return Event\n }())\n\n // if we're in old IE we can't do onpropertychange on doc or win so we use doc.documentElement for both\n , targetElement = function (element, isNative) {\n return !W3C_MODEL && !isNative && (element === doc || element === win) ? root : element\n }\n\n /**\n * Bean maintains an internal registry for event listeners. We don't touch elements, objects\n * or functions to identify them, instead we store everything in the registry.\n * Each event listener has a RegEntry object, we have one 'registry' for the whole instance.\n */\n , RegEntry = (function () {\n // each handler is wrapped so we can handle delegation and custom events\n var wrappedHandler = function (element, fn, condition, args) {\n var call = function (event, eargs) {\n return fn.apply(element, args ? slice.call(eargs, event ? 0 : 1).concat(args) : eargs)\n }\n , findTarget = function (event, eventElement) {\n return fn.__beanDel ? fn.__beanDel.ft(event.target, element) : eventElement\n }\n , handler = condition\n ? function (event) {\n var target = findTarget(event, this) // deleated event\n if (condition.apply(target, arguments)) {\n if (event) event.currentTarget = target\n return call(event, arguments)\n }\n }\n : function (event) {\n if (fn.__beanDel) event = event.clone(findTarget(event)) // delegated event, fix the fix\n return call(event, arguments)\n }\n handler.__beanDel = fn.__beanDel\n return handler\n }\n\n , RegEntry = function (element, type, handler, original, namespaces, args, root) {\n var customType = customEvents[type]\n , isNative\n\n if (type == 'unload') {\n // self clean-up\n handler = once(removeListener, element, type, handler, original)\n }\n\n if (customType) {\n if (customType.condition) {\n handler = wrappedHandler(element, handler, customType.condition, args)\n }\n type = customType.base || type\n }\n\n this.isNative = isNative = nativeEvents[type] && !!element[eventSupport]\n this.customType = !W3C_MODEL && !isNative && type\n this.element = element\n this.type = type\n this.original = original\n this.namespaces = namespaces\n this.eventType = W3C_MODEL || isNative ? type : 'propertychange'\n this.target = targetElement(element, isNative)\n this[eventSupport] = !!this.target[eventSupport]\n this.root = root\n this.handler = wrappedHandler(element, handler, null, args)\n }\n\n // given a list of namespaces, is our entry in any of them?\n RegEntry.prototype.inNamespaces = function (checkNamespaces) {\n var i, j, c = 0\n if (!checkNamespaces) return true\n if (!this.namespaces) return false\n for (i = checkNamespaces.length; i--;) {\n for (j = this.namespaces.length; j--;) {\n if (checkNamespaces[i] == this.namespaces[j]) c++\n }\n }\n return checkNamespaces.length === c\n }\n\n // match by element, original fn (opt), handler fn (opt)\n RegEntry.prototype.matches = function (checkElement, checkOriginal, checkHandler) {\n return this.element === checkElement &&\n (!checkOriginal || this.original === checkOriginal) &&\n (!checkHandler || this.handler === checkHandler)\n }\n\n return RegEntry\n }())\n\n , registry = (function () {\n // our map stores arrays by event type, just because it's better than storing\n // everything in a single array.\n // uses '$' as a prefix for the keys for safety and 'r' as a special prefix for\n // rootListeners so we can look them up fast\n var map = {}\n\n // generic functional search of our registry for matching listeners,\n // `fn` returns false to break out of the loop\n , forAll = function (element, type, original, handler, root, fn) {\n var pfx = root ? 'r' : '$'\n if (!type || type == '*') {\n // search the whole registry\n for (var t in map) {\n if (t.charAt(0) == pfx) {\n forAll(element, t.substr(1), original, handler, root, fn)\n }\n }\n } else {\n var i = 0, l, list = map[pfx + type], all = element == '*'\n if (!list) return\n for (l = list.length; i < l; i++) {\n if ((all || list[i].matches(element, original, handler)) && !fn(list[i], list, i, type)) return\n }\n }\n }\n\n , has = function (element, type, original, root) {\n // we're not using forAll here simply because it's a bit slower and this\n // needs to be fast\n var i, list = map[(root ? 'r' : '$') + type]\n if (list) {\n for (i = list.length; i--;) {\n if (!list[i].root && list[i].matches(element, original, null)) return true\n }\n }\n return false\n }\n\n , get = function (element, type, original, root) {\n var entries = []\n forAll(element, type, original, null, root, function (entry) {\n return entries.push(entry)\n })\n return entries\n }\n\n , put = function (entry) {\n var has = !entry.root && !this.has(entry.element, entry.type, null, false)\n , key = (entry.root ? 'r' : '$') + entry.type\n ;(map[key] || (map[key] = [])).push(entry)\n return has\n }\n\n , del = function (entry) {\n forAll(entry.element, entry.type, null, entry.handler, entry.root, function (entry, list, i) {\n list.splice(i, 1)\n entry.removed = true\n if (list.length === 0) delete map[(entry.root ? 'r' : '$') + entry.type]\n return false\n })\n }\n\n // dump all entries, used for onunload\n , entries = function () {\n var t, entries = []\n for (t in map) {\n if (t.charAt(0) == '$') entries = entries.concat(map[t])\n }\n return entries\n }\n\n return { has: has, get: get, put: put, del: del, entries: entries }\n }())\n\n // we need a selector engine for delegated events, use querySelectorAll if it exists\n // but for older browsers we need Qwery, Sizzle or similar\n , selectorEngine\n , setSelectorEngine = function (e) {\n if (!arguments.length) {\n selectorEngine = doc.querySelectorAll\n ? function (s, r) {\n return r.querySelectorAll(s)\n }\n : function () {\n throw new Error('Bean: No selector engine installed') // eeek\n }\n } else {\n selectorEngine = e\n }\n }\n\n // we attach this listener to each DOM event that we need to listen to, only once\n // per event type per DOM element\n , rootListener = function (event, type) {\n if (!W3C_MODEL && type && event && event.propertyName != '_on' + type) return\n\n var listeners = registry.get(this, type || event.type, null, false)\n , l = listeners.length\n , i = 0\n\n event = new Event(event, this, true)\n if (type) event.type = type\n\n // iterate through all handlers registered for this type, calling them unless they have\n // been removed by a previous handler or stopImmediatePropagation() has been called\n for (; i < l && !event.isImmediatePropagationStopped(); i++) {\n if (!listeners[i].removed) listeners[i].handler.call(this, event)\n }\n }\n\n // add and remove listeners to DOM elements\n , listener = W3C_MODEL\n ? function (element, type, add) {\n // new browsers\n element[add ? addEvent : removeEvent](type, rootListener, false)\n }\n : function (element, type, add, custom) {\n // IE8 and below, use attachEvent/detachEvent and we have to piggy-back propertychange events\n // to simulate event bubbling etc.\n var entry\n if (add) {\n registry.put(entry = new RegEntry(\n element\n , custom || type\n , function (event) { // handler\n rootListener.call(element, event, custom)\n }\n , rootListener\n , null\n , null\n , true // is root\n ))\n if (custom && element['_on' + custom] == null) element['_on' + custom] = 0\n entry.target.attachEvent('on' + entry.eventType, entry.handler)\n } else {\n entry = registry.get(element, custom || type, rootListener, true)[0]\n if (entry) {\n entry.target.detachEvent('on' + entry.eventType, entry.handler)\n registry.del(entry)\n }\n }\n }\n\n , once = function (rm, element, type, fn, originalFn) {\n // wrap the handler in a handler that does a remove as well\n return function () {\n fn.apply(this, arguments)\n rm(element, type, originalFn)\n }\n }\n\n , removeListener = function (element, orgType, handler, namespaces) {\n var type = orgType && orgType.replace(nameRegex, '')\n , handlers = registry.get(element, type, null, false)\n , removed = {}\n , i, l\n\n for (i = 0, l = handlers.length; i < l; i++) {\n if ((!handler || handlers[i].original === handler) && handlers[i].inNamespaces(namespaces)) {\n // TODO: this is problematic, we have a registry.get() and registry.del() that\n // both do registry searches so we waste cycles doing this. Needs to be rolled into\n // a single registry.forAll(fn) that removes while finding, but the catch is that\n // we'll be splicing the arrays that we're iterating over. Needs extra tests to\n // make sure we don't screw it up. @rvagg\n registry.del(handlers[i])\n if (!removed[handlers[i].eventType] && handlers[i][eventSupport])\n removed[handlers[i].eventType] = { t: handlers[i].eventType, c: handlers[i].type }\n }\n }\n // check each type/element for removed listeners and remove the rootListener where it's no longer needed\n for (i in removed) {\n if (!registry.has(element, removed[i].t, null, false)) {\n // last listener of this type, remove the rootListener\n listener(element, removed[i].t, false, removed[i].c)\n }\n }\n }\n\n // set up a delegate helper using the given selector, wrap the handler function\n , delegate = function (selector, fn) {\n //TODO: findTarget (therefore $) is called twice, once for match and once for\n // setting e.currentTarget, fix this so it's only needed once\n var findTarget = function (target, root) {\n var i, array = isString(selector) ? selectorEngine(selector, root) : selector\n for (; target && target !== root; target = target.parentNode) {\n for (i = array.length; i--;) {\n if (array[i] === target) return target\n }\n }\n }\n , handler = function (e) {\n var match = findTarget(e.target, this)\n if (match) fn.apply(match, arguments)\n }\n\n // __beanDel isn't pleasant but it's a private function, not exposed outside of Bean\n handler.__beanDel = {\n ft : findTarget // attach it here for customEvents to use too\n , selector : selector\n }\n return handler\n }\n\n , fireListener = W3C_MODEL ? function (isNative, type, element) {\n // modern browsers, do a proper dispatchEvent()\n var evt = doc.createEvent(isNative ? 'HTMLEvents' : 'UIEvents')\n evt[isNative ? 'initEvent' : 'initUIEvent'](type, true, true, win, 1)\n element.dispatchEvent(evt)\n } : function (isNative, type, element) {\n // old browser use onpropertychange, just increment a custom property to trigger the event\n element = targetElement(element, isNative)\n isNative ? element.fireEvent('on' + type, doc.createEventObject()) : element['_on' + type]++\n }\n\n /**\n * Public API: off(), on(), add(), (remove()), one(), fire(), clone()\n */\n\n /**\n * off(element[, eventType(s)[, handler ]])\n */\n , off = function (element, typeSpec, fn) {\n var isTypeStr = isString(typeSpec)\n , k, type, namespaces, i\n\n if (isTypeStr && typeSpec.indexOf(' ') > 0) {\n // off(el, 't1 t2 t3', fn) or off(el, 't1 t2 t3')\n typeSpec = str2arr(typeSpec)\n for (i = typeSpec.length; i--;)\n off(element, typeSpec[i], fn)\n return element\n }\n\n type = isTypeStr && typeSpec.replace(nameRegex, '')\n if (type && customEvents[type]) type = customEvents[type].base\n\n if (!typeSpec || isTypeStr) {\n // off(el) or off(el, t1.ns) or off(el, .ns) or off(el, .ns1.ns2.ns3)\n if (namespaces = isTypeStr && typeSpec.replace(namespaceRegex, '')) namespaces = str2arr(namespaces, '.')\n removeListener(element, type, fn, namespaces)\n } else if (isFunction(typeSpec)) {\n // off(el, fn)\n removeListener(element, null, typeSpec)\n } else {\n // off(el, { t1: fn1, t2, fn2 })\n for (k in typeSpec) {\n if (typeSpec.hasOwnProperty(k)) off(element, k, typeSpec[k])\n }\n }\n\n return element\n }\n\n /**\n * on(element, eventType(s)[, selector], handler[, args ])\n */\n , on = function(element, events, selector, fn) {\n var originalFn, type, types, i, args, entry, first\n\n //TODO: the undefined check means you can't pass an 'args' argument, fix this perhaps?\n if (selector === undefined && typeof events == 'object') {\n //TODO: this can't handle delegated events\n for (type in events) {\n if (events.hasOwnProperty(type)) {\n on.call(this, element, type, events[type])\n }\n }\n return\n }\n\n if (!isFunction(selector)) {\n // delegated event\n originalFn = fn\n args = slice.call(arguments, 4)\n fn = delegate(selector, originalFn, selectorEngine)\n } else {\n args = slice.call(arguments, 3)\n fn = originalFn = selector\n }\n\n types = str2arr(events)\n\n // special case for one(), wrap in a self-removing handler\n if (this === ONE) {\n fn = once(off, element, events, fn, originalFn)\n }\n\n for (i = types.length; i--;) {\n // add new handler to the registry and check if it's the first for this element/type\n first = registry.put(entry = new RegEntry(\n element\n , types[i].replace(nameRegex, '') // event type\n , fn\n , originalFn\n , str2arr(types[i].replace(namespaceRegex, ''), '.') // namespaces\n , args\n , false // not root\n ))\n if (entry[eventSupport] && first) {\n // first event of this type on this element, add root listener\n listener(element, entry.eventType, true, entry.customType)\n }\n }\n\n return element\n }\n\n /**\n * add(element[, selector], eventType(s), handler[, args ])\n *\n * Deprecated: kept (for now) for backward-compatibility\n */\n , add = function (element, events, fn, delfn) {\n return on.apply(\n null\n , !isString(fn)\n ? slice.call(arguments)\n : [ element, fn, events, delfn ].concat(arguments.length > 3 ? slice.call(arguments, 5) : [])\n )\n }\n\n /**\n * one(element, eventType(s)[, selector], handler[, args ])\n */\n , one = function () {\n return on.apply(ONE, arguments)\n }\n\n /**\n * fire(element, eventType(s)[, args ])\n *\n * The optional 'args' argument must be an array, if no 'args' argument is provided\n * then we can use the browser's DOM event system, otherwise we trigger handlers manually\n */\n , fire = function (element, type, args) {\n var types = str2arr(type)\n , i, j, l, names, handlers\n\n for (i = types.length; i--;) {\n type = types[i].replace(nameRegex, '')\n if (names = types[i].replace(namespaceRegex, '')) names = str2arr(names, '.')\n if (!names && !args && element[eventSupport]) {\n fireListener(nativeEvents[type], type, element)\n } else {\n // non-native event, either because of a namespace, arguments or a non DOM element\n // iterate over all listeners and manually 'fire'\n handlers = registry.get(element, type, null, false)\n args = [false].concat(args)\n for (j = 0, l = handlers.length; j < l; j++) {\n if (handlers[j].inNamespaces(names)) {\n handlers[j].handler.apply(element, args)\n }\n }\n }\n }\n return element\n }\n\n /**\n * clone(dstElement, srcElement[, eventType ])\n *\n * TODO: perhaps for consistency we should allow the same flexibility in type specifiers?\n */\n , clone = function (element, from, type) {\n var handlers = registry.get(from, type, null, false)\n , l = handlers.length\n , i = 0\n , args, beanDel\n\n for (; i < l; i++) {\n if (handlers[i].original) {\n args = [ element, handlers[i].type ]\n if (beanDel = handlers[i].handler.__beanDel) args.push(beanDel.selector)\n args.push(handlers[i].original)\n on.apply(null, args)\n }\n }\n return element\n }\n\n , bean = {\n 'on' : on\n , 'add' : add\n , 'one' : one\n , 'off' : off\n , 'remove' : off\n , 'clone' : clone\n , 'fire' : fire\n , 'Event' : Event\n , 'setSelectorEngine' : setSelectorEngine\n , 'noConflict' : function () {\n context[name] = old\n return this\n }\n }\n\n // for IE, clean up on unload to avoid leaks\n if (win.attachEvent) {\n var cleanup = function () {\n var i, entries = registry.entries()\n for (i in entries) {\n if (entries[i].type && entries[i].type !== 'unload') off(entries[i].element, entries[i].type)\n }\n win.detachEvent('onunload', cleanup)\n win.CollectGarbage && win.CollectGarbage()\n }\n win.attachEvent('onunload', cleanup)\n }\n\n // initialize selector engine to internal default (qSA or throw Error)\n setSelectorEngine(Ink.ss)\n\n return bean\n });\n\n /**\n * Keep this declaration here and off Bean as it extends the Event\n * object and some properties are readonly in strict mode\n */\n 'use strict';\n\n var InkEvent = {\n\n KEY_BACKSPACE: 8,\n KEY_TAB: 9,\n KEY_RETURN: 13,\n KEY_ESC: 27,\n KEY_SPACE: 32,\n KEY_LEFT: 37,\n KEY_UP: 38,\n KEY_RIGHT: 39,\n KEY_DOWN: 40,\n KEY_DELETE: 46,\n KEY_HOME: 36,\n KEY_END: 35,\n KEY_PAGEUP: 33,\n KEY_PAGEDOWN: 34,\n KEY_INSERT: 45,\n \n /**\n * Creates a debounced version of a function.\n * Returns a function which calls `func`, waiting at least `wait` milliseconds between calls. This is useful for events such as `scroll` or `resize`, which can be triggered too many times per second, slowing down the browser with needless function calls.\n *\n * *note:* This does not delay the first function call to the function.\n *\n * @method throttle\n * @param {Function} func Function to call. Arguments and context are both passed.\n * @param {Number} [wait]=0 Milliseconds to wait between calls.\n * @sample Ink_Dom_Event_1_throttle.html \n **/\n throttle: function (func, wait) {\n wait = wait || 0;\n var lastCall = 0; // Warning: This breaks on Jan 1st 1970 0:00\n var timeout;\n var throttled = function () {\n var now = +new Date();\n var timeDiff = now - lastCall;\n if (timeDiff >= wait) {\n lastCall = now;\n return func.apply(this, [].slice.call(arguments));\n } else {\n var that = this;\n var args = [].slice.call(arguments);\n if (!timeout) {\n timeout = setTimeout(function () {\n timeout = null;\n return throttled.apply(that, args);\n }, wait - timeDiff);\n }\n }\n };\n return throttled;\n },\n\n /**\n * Gets the event's target element.\n *\n * @method element\n * @param {Object} ev Event object\n * @return {DOMNode} The target\n * @sample Ink_Dom_Event_1_element.html \n */\n element: function(ev) {\n var node = ev.delegationTarget ||\n ev.target ||\n // IE stuff\n (ev.type === 'mouseout' && ev.fromElement) ||\n (ev.type === 'mouseleave' && ev.fromElement) ||\n (ev.type === 'mouseover' && ev.toElement) ||\n (ev.type === 'mouseenter' && ev.toElement) ||\n ev.srcElement ||\n null;\n return node && (node.nodeType === 3 || node.nodeType === 4) ? node.parentNode : node;\n },\n\n /**\n * Gets the event's related target element.\n *\n * @method relatedTarget\n * @param {Object} ev event object\n * @return {DOMNode} The related target\n * @sample Ink_Dom_Event_1_relatedTarget.html \n */\n relatedTarget: function(ev){\n var node = ev.relatedTarget ||\n // IE stuff\n (ev.type === 'mouseout' && ev.toElement) ||\n (ev.type === 'mouseleave' && ev.toElement) ||\n (ev.type === 'mouseover' && ev.fromElement) ||\n (ev.type === 'mouseenter' && ev.fromElement) ||\n null;\n return node && (node.nodeType === 3 || node.nodeType === 4) ? node.parentNode : node;\n },\n\n /**\n * Find closest ancestor element by tag name related to the event target.\n * Navigate up the DOM tree, looking for a tag with the name `elmTagName`.\n *\n * If such tag is not found, `document` is returned.\n *\n * @method findElement\n * @param {Object} ev Event object\n * @param {String} elmTagName Tag name to find\n * @param {Boolean} [force]=false Flag to skip returning `document` and to return `false` instead.\n * @return {DOMElement} the first element which matches given tag name or the document element if the wanted tag is not found\n * @sample Ink_Dom_Event_1_findElement.html \n */\n findElement: function(ev, elmTagName, force)\n {\n var node = this.element(ev);\n while(true) {\n if(node.nodeName.toLowerCase() === elmTagName.toLowerCase()) {\n return node;\n } else {\n node = node.parentNode;\n if(!node) {\n if(force) {\n return false;\n }\n return document;\n }\n if(!node.parentNode){\n if(force){ return false; }\n return document;\n }\n }\n }\n },\n\n /**\n * Attaches an event to element\n *\n * @method observe\n * @param {DOMElement|String} element Element id or element\n * @param {String} eventName Event name\n * @param {Function} callBack Receives the event object as a parameter. If you're manually firing custom events, check it's eventName property to make sure you're handling the right event.\n * @param {Boolean} [useCapture] Flag to change event listening from bubbling to capture.\n * @return {Function} The event handler used. Hang on to this if you want to `stopObserving` later.\n * @sample Ink_Dom_Event_1_observe.html \n */\n observe: function(element, eventName, callBack, useCapture) {\n element = Ink.i(element);\n if(element) {\n if(element.addEventListener) {\n element.addEventListener(eventName, callBack, !!useCapture);\n } else {\n element.attachEvent('on' + eventName, (callBack = Ink.bind(callBack, element)));\n }\n return callBack;\n }\n },\n\n /**\n * Like observe, but listen to the event only once.\n *\n * @method observeOnce\n * @param {DOMElement|String} element Element id or element\n * @param {String} eventName Event name\n * @param {Function} callBack Receives the event object as a parameter. If you're manually firing custom events, check it's eventName property to make sure you're handling the right event.\n * @param {Boolean} [useCapture] Flag to change event listening from bubbling to capture.\n * @return {Function} The event handler used. Hang on to this if you want to `stopObserving` later.\n * @sample Ink_Dom_Event_1_observeOnce.html \n */\n observeOnce: function (element, eventName, callBack, useCapture) {\n var onceBack = function () {\n InkEvent.stopObserving(element, eventName, onceBack);\n return callBack();\n };\n return InkEvent.observe(element, eventName, onceBack, useCapture);\n },\n\n /**\n * Attaches an event to a selector or array of elements.\n *\n * @method observeMulti\n * @param {Array|String} elements \n * @param {String} eventName Event name\n * @param {Function} callBack Receives the event object as a parameter. If you're manually firing custom events, check it's eventName property to make sure you're handling the right event.\n * @param {Boolean} [useCapture] Flag change event listening from bubbling to capture.\n * @return {Function} The used callback.\n * @sample Ink_Dom_Event_1_observeMulti.html \n */\n observeMulti: function (elements, eventName, callBack, useCapture) {\n if (typeof elements === 'string') {\n elements = Ink.ss(elements);\n } else if ( /* is an element */ elements && elements.nodeType === 1) {\n elements = [elements];\n }\n if (!elements[0]) { return false; }\n\n for (var i = 0, len = elements.length; i < len; i++) {\n this.observe(elements[i], eventName, callBack, useCapture);\n }\n return callBack;\n },\n\n /**\n * Observes an event on an element and its descendants matching the selector.\n *\n * Requires Ink.Dom.Selector if you need to use a selector.\n *\n * @method observeDelegated\n * @param {DOMElement|String} element Element to observe.\n * @param {String} eventName Event name to observe.\n * @param {String} selector Child element selector. When null, finds any element.\n * @param {Function} callback Callback to be called when the event is fired\n * @return {Function} The used callback, for ceasing to listen to the event later.\n * @sample Ink_Dom_Event_1_observeDelegated.html \n **/\n observeDelegated: function (element, eventName, selector, callback) {\n return InkEvent.observe(element, eventName, function (event) {\n var fromElement = InkEvent.element(event);\n if (!fromElement || fromElement === element) { return; }\n\n var cursor = fromElement;\n\n // Go up the document tree until we hit the element itself.\n while (cursor !== element && cursor !== document && cursor) {\n if (Ink.Dom.Selector_1.matchesSelector(cursor, selector)) {\n event.delegationTarget = cursor;\n return callback(event);\n }\n cursor = cursor.parentNode;\n }\n });\n },\n\n /**\n * Removes an event attached to an element.\n *\n * @method stopObserving\n * @param {DOMElement|String} element Element id or element\n * @param {String} eventName Event name\n * @param {Function} callBack Callback function\n * @param {Boolean} [useCapture] Set to true if the event was being observed with useCapture set to true as well.\n * @sample Ink_Dom_Event_1_stopObserving.html \n */\n stopObserving: function(element, eventName, callBack, useCapture) {\n element = Ink.i(element);\n\n if(element) {\n if(element.removeEventListener) {\n element.removeEventListener(eventName, callBack, !!useCapture);\n } else {\n element.detachEvent('on' + eventName, callBack);\n }\n }\n },\n\n /**\n * Stops event propagation and bubbling.\n *\n * @method stop\n * @param {Object} event Event handle\n * @sample Ink_Dom_Event_1_stop.html \n */\n stop: function(event)\n {\n if(event.cancelBubble !== null) {\n event.cancelBubble = true;\n }\n if(event.stopPropagation) {\n event.stopPropagation();\n }\n if(event.preventDefault) {\n event.preventDefault();\n }\n if(window.attachEvent) {\n event.returnValue = false;\n }\n if(event.cancel !== null) {\n event.cancel = true;\n }\n },\n\n /**\n * Stops event propagation.\n *\n * @method stopPropagation\n * @param {Object} event Event handle\n * @sample Ink_Dom_Event_1_stopPropagation.html \n */\n stopPropagation: function(event) {\n if(event.cancelBubble !== null) {\n event.cancelBubble = true;\n }\n if(event.stopPropagation) {\n event.stopPropagation();\n }\n },\n\n /**\n * Stops event default behaviour.\n *\n * @method stopDefault\n * @param {Object} event Event handle\n * @sample Ink_Dom_Event_1_stopDefault.html \n */\n stopDefault: function(event)\n {\n if(event.preventDefault) {\n event.preventDefault();\n }\n if(window.attachEvent) {\n event.returnValue = false;\n }\n if(event.cancel !== null) {\n event.cancel = true;\n }\n },\n\n /**\n * Gets the pointer's coordinates from the event object.\n *\n * @method pointer\n * @param {Object} ev Event object\n * @return {Object} An object with the mouse X and Y position\n * @sample Ink_Dom_Event_1_pointer.html \n */\n pointer: function(ev)\n {\n return {\n x: this.pointerX(ev),\n y: this.pointerY(ev)\n };\n },\n\n /**\n * Gets the pointer's X coordinate.\n *\n * @method pointerX\n * @param {Object} ev Event object\n * @return {Number} Mouse X position\n */\n pointerX: function(ev)\n {\n return (ev.touches && ev.touches[0] && ev.touches[0].clientX) ||\n (ev.pageX) ||\n (ev.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft));\n },\n\n /**\n * Gets the pointer's Y coordinate.\n *\n * @method pointerY\n * @param {Object} ev Event object\n * @return {Number} Mouse Y position\n */\n pointerY: function(ev)\n {\n return (ev.touches && ev.touches[0] && ev.touches[0].clientY) ||\n (ev.pageY) ||\n (ev.clientY + (document.documentElement.scrollTop || document.body.scrollTop));\n },\n\n /**\n * Checks if an event is a left click.\n *\n * @method isLeftClick\n * @param {Object} ev Event object\n * @return {Boolean} True if the event is a left click\n * @sample Ink_Dom_Event_1_isLeftClick.html \n */\n isLeftClick: function(ev) {\n if (window.addEventListener) {\n if(ev.button === 0){\n return true;\n } else if(ev.type === 'touchend' && ev.button === null){\n // [todo] do the above check for pointerEvents too\n return true;\n }\n }\n else {\n if(ev.button === 1){ return true; }\n }\n return false;\n },\n\n /**\n * Checks if an event is a right click.\n *\n * @method isRightClick\n * @param {Object} ev Event object\n * @return {Boolean} True if the event is a right click\n * @sample Ink_Dom_Event_1_isRightClick.html \n */\n isRightClick: function(ev) {\n return (ev.button === 2);\n },\n\n /**\n * Checks if an event is a middle click.\n *\n * @method isMiddleClick\n * @param {Object} ev Event object\n * @return {Boolean} True if the event is a middle click\n * @sample Ink_Dom_Event_1_isMiddleClick.html \n */\n isMiddleClick: function(ev) {\n if (window.addEventListener) {\n return (ev.button === 1);\n }\n else {\n return (ev.button === 4);\n }\n return false;\n },\n\n /**\n * Gets character from an event.\n *\n * @method getCharFromKeyboardEvent\n * @param {Object} event Keyboard event\n * @param {Boolean} [changeCasing] If true uppercases, if false lowercases, otherwise keeps casing\n * @return {String} Character representation of pressed key combination\n * @sample Ink_Dom_Event_1_getCharFromKeyboardEvent.html \n */\n getCharFromKeyboardEvent: function(event, changeCasing) {\n var k = event.keyCode;\n var c = String.fromCharCode(k);\n\n var shiftOn = event.shiftKey;\n if (k >= 65 && k <= 90) { // A-Z\n if (typeof changeCasing === 'boolean') {\n shiftOn = changeCasing;\n }\n return (shiftOn) ? c : c.toLowerCase();\n }\n else if (k >= 96 && k <= 105) { // numpad digits\n return String.fromCharCode( 48 + (k-96) );\n }\n switch (k) {\n case 109: case 189: return '-';\n case 107: case 187: return '+';\n }\n return c;\n },\n\n debug: function(){}\n};\n\n/**\n * Lets you attach event listeners to both elements and objects.\n * http://github.com/fat/bean#on\n *\n * @method on\n * @param {DOMElement|Object} element An HTML DOM element or any JavaScript Object\n * @param {String} eventType An Event (or multiple events, space separated) to listen to\n * @param {String} [selector] A CSS DOM Element selector string to bind the listener to child elements matching the selector\n * @param {Function} [handler] The callback function\n * @param {Object} [args...] Additional arguments to pass to the callback function when triggered\n * \n * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object\n * @sample Ink_Dom_Event_1_on.html \n */\n\n/**\n * Alias for `on` but will only be executed once.\n * bean.one() is an alias for bean.on() except that the handler will only be executed once and then removed for the event type(s).\n * http://github.com/fat/bean#one\n *\n * @method one\n * @param {DOMElement|Object} element An HTML DOM element or any JavaScript Object\n * @param {String} eventType An Event (or multiple events, space separated) to listen to\n * @param {String} [selector] A CSS DOM Element selector string to bind the listener to child elements matching the selector\n * @param {Function} [handler] The callback function\n * @param [args...] Additional arguments to pass to the callback function when triggered\n * \n * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object\n * @sample Ink_Dom_Event_1_one.html \n */\n\n/**\n * Removes event handlers.\n * bean.off() is how you get rid of handlers once you no longer want them active. It's also a good idea to call off on elements before you remove them from your DOM; this gives Bean a chance to clean up some things and prevents memory leaks.\n * http://github.com/fat/bean#off\n *\n * @method off\n * @param {DOMElement|Object} element An HTML DOM element or any JavaScript Object\n * @param {String} eventType An Event (or multiple events, space separated) to remove\n * @param {Function} [handler] The specific callback function to remove\n * \n * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object\n * @sample Ink_Dom_Event_1_off.html \n */\n\n/**\n * Clones events from one object to another\n * bean.clone() is a method for cloning events from one DOM element or object to another.\n * http://github.com/fat/bean#clone\n *\n * @method clone\n * @param {DOMElement|Object} destElement An HTML DOM element or any JavaScript Object to copy events to\n * @param {String} srcElement An HTML DOM element or any JavaScript Object to copy events from\n * @param {String} [eventType] An Event (or multiple events, space separated) to clone\n * \n * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object\n * @sample Ink_Dom_Event_1_clone.html \n */\n\n/**\n * Triggers events.\n * http://github.com/fat/bean#fire\n *\n * @method fire\n * @param {DOMElement|Object} destElement An HTML DOM element or any JavaScript Object fire the event on\n * @param {String} eventType An Event (or multiple events, space separated) to fire\n * @param [args...] Additional arguments to pass to the callback function when triggered\n *\n * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object\n * @sample Ink_Dom_Event_1_fire.html \n */\n\nreturn Ink.extendObj(InkEvent, bean);\n\n});\n","/**\n * @module Ink.Dom.FormSerialize_1\n * Two way serialization of form data and javascript objects.\n * Valid applications are ad hoc AJAX/syndicated submission of forms, restoring form values from server side state, etc.\n */\n\nInk.createModule('Ink.Dom.FormSerialize', 1, ['Ink.Util.Array_1', 'Ink.Dom.Element_1', 'Ink.Dom.Selector_1'], function (InkArray, InkElement, Selector) {\n 'use strict';\n\n // Check whether something is not a string or a DOM element, but still has length.\n function isArrayIsh(obj) {\n return obj != null &&\n (!InkElement.isDOMElement(obj)) &&\n (InkArray.isArray(obj) || (typeof obj !== 'string' && typeof obj.length === 'number'));\n }\n\n function toArray(obj) {\n if (isArrayIsh(obj)) { return obj; }\n else { return [obj]; }\n }\n\n /**\n * @namespace Ink.Dom.FormSerialize\n * @static\n **/\n var FormSerialize = {\n\n /**\n * Serializes a form element into a JS object\n * It turns field names into keys and field values into values.\n *\n * note: Multi-select and checkboxes with multiple values will result in arrays\n *\n * @method serialize\n * @param {DOMElement|String} form Form element to extract data\n * @return {Object} Map of fieldName -> String|String[]|Boolean\n * @sample Ink_Dom_FormSerialize_serialize.html \n */\n serialize: function(form) {\n var out = {};\n var emptyArrayToken = {}; // A hack so that empty select[multiple] elements appear although empty.\n\n var pairs = this.asPairs(form, { elements: true, emptyArray: emptyArrayToken });\n if (pairs == null) { return pairs; }\n InkArray.forEach(pairs, function (pair) {\n var name = pair[0].replace(/\\[\\]$/, '');\n var value = pair[1];\n var el = pair[2];\n\n if (value === emptyArrayToken) {\n out[name] = []; // It's an empty select[multiple]\n } else if (!(FormSerialize._resultsInArray(el) || /\\[\\]$/.test(pair[0]))) {\n out[name] = value;\n } else {\n out[name] = out[name] || [];\n out[name].push(value);\n }\n });\n\n return out;\n },\n\n /**\n * Like `serialize`, but returns an array of [fieldName, value] pairs.\n *\n * @method asPairs\n * @param {DOMElement|String} form Form element\n * @param {Object} [options] Options object, containing:\n * @param {Boolean} [options.elements] Instead of returning an array of [fieldName, value] pairs, return an array of [fieldName, value, fieldElement] triples.\n * @param {Boolean} [options.emptyArray] What to emit as the value of an empty select[multiple]. If you don't pass this option, nothing comes out.\n *\n * @return Array of [fieldName, value] pairs.\n **/\n asPairs: function (form, options) {\n var out = [];\n options = options || {};\n\n function emit(name, val, el) {\n if (options.elements) {\n out.push([name, val, el]);\n } else {\n out.push([name, val]);\n }\n }\n\n function serializeEl(el) {\n if (el.nodeName.toLowerCase() === 'select' && el.multiple) {\n var didEmit = false;\n InkArray.forEach(Selector.select('option:checked', el), function (thisOption) {\n emit(el.name, thisOption.value, el);\n didEmit = true;\n });\n if (!didEmit && 'emptyArray' in options) {\n emit(el.name, options.emptyArray, el);\n }\n } else {\n emit(el.name, el.value, el);\n }\n }\n\n if ((form = Ink.i(form))) {\n var inputs = InkArray.filter(form.elements, FormSerialize._isSerialized);\n for (var i = 0, len = inputs.length; i < len; i++) {\n serializeEl(inputs[i]);\n }\n return out;\n }\n\n return null;\n },\n\n /**\n * Sets form elements' values with values from an object\n *\n * Note: You can't set the values of an input with `type=\"file\"` (browser prohibits it)\n *\n * @method fillIn \n * @param {DOMElement|String} form Form element to be populated\n * @param {Object|Array} map2 mapping of fields to values contained in fields. Can be a hash (keys as names, strings or arrays for values), or an array of [name, value] pairs.\n * @sample Ink_Dom_FormSerialize_fillIn.html \n */\n fillIn: function(form, map2) {\n if (!(form = Ink.i(form))) { return null; }\n\n var pairs;\n\n if (typeof map2 === 'object' && !isArrayIsh(map2)) {\n pairs = FormSerialize._objToPairs(map2);\n } else if (isArrayIsh(map2)) {\n pairs = map2;\n } else {\n return null;\n }\n\n return FormSerialize._fillInPairs(form, pairs);\n },\n\n _objToPairs: function (obj) {\n var pairs = [];\n var val;\n for (var name in obj) if (obj.hasOwnProperty(name)) {\n val = toArray(obj[name]);\n for (var i = 0, len = val.length; i < len; i++) {\n pairs.push([name, val[i]]);\n }\n if (len === 0) {\n pairs.push([name, []]);\n }\n }\n return pairs;\n },\n\n _fillInPairs: function (form, pairs) {\n pairs = InkArray.groupBy(pairs, {\n key: function (pair) { return pair[0].replace(/\\[\\]$/, ''); }\n });\n\n // For each chunk...\n pairs = InkArray.map(pairs, function (pair) {\n // Join the items in the chunk by concatenating the values together and leaving the names alone\n var values = InkArray.reduce(pair, function (left, right) {\n return [null, left[1].concat([right[1]])];\n }, [null, []])[1];\n return [pair[0][0], values];\n });\n\n var name;\n var inputs;\n var values;\n for (var i = 0, len = pairs.length; i < len; i++) {\n name = pairs[i][0];\n\n if (name in form) {\n inputs = form[name];\n } else if ((name + '[]') in form) {\n inputs = form[name + '[]'];\n name = name + '[]';\n } else {\n continue;\n }\n\n inputs = toArray(inputs);\n values = pairs[i][1];\n\n FormSerialize._fillInOne(name, inputs, values);\n }\n },\n\n _fillInOne: function (name, inputs, values) {\n var firstOne = inputs[0];\n var firstNodeName = firstOne.nodeName.toLowerCase();\n var firstType = firstOne.getAttribute('type');\n firstType = firstType && firstType.toLowerCase();\n var isSelectMulti = firstNodeName === 'select' && InkElement.hasAttribute(firstOne, 'multiple');\n\n if (firstType === 'checkbox' || firstType === 'radio') {\n FormSerialize._fillInBoolean(inputs, values, 'checked');\n } else if (isSelectMulti) {\n FormSerialize._fillInBoolean(inputs[0].options, values, 'selected');\n } else {\n if (inputs.length !== values.length) {\n Ink.warn('Form had ' + inputs.length + ' inputs named \"' + name + '\", but received ' + values.length + ' values.');\n }\n\n for (var i = 0, len = Math.min(inputs.length, values.length); i < len; i += 1) {\n inputs[i].value = values[i];\n }\n }\n },\n\n _fillInBoolean: function (inputs, values, checkAttr /* 'selected' or 'checked' */) {\n InkArray.forEach(inputs, function (input) {\n var isChecked = InkArray.inArray(input.value, values);\n input[checkAttr] = isChecked;\n });\n },\n\n /**\n * Whether FormSerialize.serialize() should produce an array when looking at this element.\n * @method _resultsInArray\n * @private\n * @param element\n **/\n _resultsInArray: function (element) {\n var type = element.getAttribute('type');\n var nodeName = element.nodeName.toLowerCase();\n\n return type === 'checkbox' ||\n (nodeName === 'select' && InkElement.hasAttribute(element, 'multiple'));\n },\n\n _isSerialized: function (element) {\n if (!InkElement.isDOMElement(element)) { return false; }\n if (!InkElement.hasAttribute(element, 'name')) { return false; }\n\n var nodeName = element.nodeName.toLowerCase();\n\n if (!nodeName || nodeName === 'fieldset') { return false; }\n\n if (element.type === 'checkbox' || element.type === 'radio') {\n return !!element.checked;\n }\n\n return true;\n }\n };\n\n return FormSerialize;\n});\n","/**\n * Execute code only when the DOM is loaded.\n * @module Ink.Dom.Loaded_1\n * @version 1\n */\n \nInk.createModule('Ink.Dom.Loaded', 1, [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Dom.Loaded_1\n **/\n var Loaded = {\n\n /**\n * Callbacks and their contexts. Array of 2-arrays.\n *\n * []\n *\n * @attribute _contexts Array\n * @private\n * \n */\n _contexts: [], // Callbacks' queue\n\n /**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @method run\n * @param {Object} [win]=window Window object to attach/add the event\n * @param {Function} fn Callback function to be executed after the DOM is ready\n * @public\n * @sample Ink_Dom_Loaded_run.html \n */\n run: function(win, fn) {\n if (!fn) {\n fn = win;\n win = window;\n }\n\n var context;\n\n for (var i = 0, len = this._contexts.length; i < len; i++) {\n if (this._contexts[i][0] === win) {\n context = this._contexts[i][1];\n break;\n }\n }\n if (!context) {\n context = {\n cbQueue: [],\n win: win,\n doc: win.document,\n root: win.document.documentElement,\n done: false,\n top: true\n };\n context.handlers = {\n checkState: Ink.bindEvent(this._checkState, this, context),\n poll: Ink.bind(this._poll, this, context)\n };\n this._contexts.push(\n [win, context] // Javascript Objects cannot map different windows to\n // different values.\n );\n }\n\n var ael = context.doc.addEventListener;\n context.add = ael ? 'addEventListener' : 'attachEvent';\n context.rem = ael ? 'removeEventListener' : 'detachEvent';\n context.pre = ael ? '' : 'on';\n context.det = ael ? 'DOMContentLoaded' : 'onreadystatechange';\n context.wet = context.pre + 'load';\n\n var csf = context.handlers.checkState;\n var alreadyLoaded = (\n /complete|interactive|loaded/.test(context.doc.readyState) &&\n context.win.location.toString() !== 'about:blank'); // https://code.google.com/p/chromium/issues/detail?id=32357\n\n if (alreadyLoaded){\n setTimeout(Ink.bind(function () {\n fn.call(context.win, 'lazy');\n }, this), 0);\n } else {\n context.cbQueue.push(fn);\n\n context.doc[context.add]( context.det , csf );\n context.win[context.add]( context.wet , csf );\n\n var frameElement = 1;\n try{\n frameElement = context.win.frameElement;\n } catch(e) {}\n if ( !ael && context.root && context.root.doScroll ) { // IE HACK\n try {\n context.top = !frameElement;\n } catch(e) { }\n if (context.top) {\n this._poll(context);\n }\n }\n }\n },\n\n /**\n * Function that will be running the callbacks after the page is loaded\n *\n * @method _checkState\n * @param {Event} event Triggered event\n * @private\n */\n _checkState: function(event, context) {\n if ( !event || (event.type === 'readystatechange' && context.doc.readyState !== 'complete')) {\n return;\n }\n var where = (event.type === 'load') ? context.win : context.doc;\n where[context.rem](context.pre+event.type, context.handlers.checkState, false);\n this._ready(context);\n },\n\n /**\n * Polls the load progress of the page to see if it has already loaded or not\n *\n * @method _poll\n * @private\n */\n\n /**\n *\n * function _poll\n */\n _poll: function(context) {\n try {\n context.root.doScroll('left');\n } catch(e) {\n return setTimeout(context.handlers.poll, 50);\n }\n this._ready(context);\n },\n\n /**\n * Function that runs the callbacks from the queue when the document is ready.\n *\n * @method _ready\n * @private\n */\n _ready: function(context) {\n if (!context.done) {\n context.done = true;\n for (var i = 0; i < context.cbQueue.length; ++i) {\n context.cbQueue[i].call(context.win);\n }\n context.cbQueue = [];\n }\n }\n };\n\n return Loaded;\n\n});\n","/**\n * CSS selector engine\n * @module Ink.Dom.Selector_1\n * @version 1\n */\n \nInk.createModule('Ink.Dom.Selector', 1, [], function() {\n /*jshint forin:false, eqnull:true, noempty:false, expr:true, boss:true, maxdepth:false*/\n\t'use strict';\n\n/*!\n * Sizzle CSS Selector Engine\n * Copyright 2013 jQuery Foundation and other contributors\n * Released under the MIT license\n * http://sizzlejs.com/\n */\n\nvar i,\n\tcachedruns,\n\tExpr,\n\tgetText,\n\tisXML,\n\tcompile,\n\toutermostContext,\n\trecompare,\n\tsortInput,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + -(new Date()),\n\tpreferredDoc = window.document,\n\tsupport = {},\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\thasDuplicate = false,\n\tsortOrder = function() { return 0; },\n\n\t// General-purpose constants\n\tstrundefined = typeof undefined,\n\tMAX_NEGATIVE = 1 << 31,\n\n\t// Array methods\n\tarr = [],\n\tpop = arr.pop,\n\tpush_native = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\t// Use a stripped-down indexOf if we can't use a native one\n\tindexOf = arr.indexOf || function( elem ) {\n\t\tvar i = 0,\n\t\t\tlen = this.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( this[i] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\n\t// Regular expressions\n\n\t// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\t// http://www.w3.org/TR/css3-syntax/#characters\n\tcharacterEncoding = \"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",\n\n\t// Loosely modeled on CSS identifier characters\n\t// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors\n\t// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = characterEncoding.replace( \"w\", \"w#\" ),\n\n\t// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors\n\toperators = \"([*^$|!~]?=)\",\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + characterEncoding + \")\" + whitespace +\n\t\t\"*(?:\" + operators + whitespace + \"*(?:(['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|(\" + identifier + \")|)|)\" + whitespace + \"*\\\\]\",\n\n\t// Prefer arguments quoted,\n\t// then not containing pseudos/brackets,\n\t// then attribute selectors/non-parenthetical expressions,\n\t// then anything else\n\t// These preferences are here to reduce the number of selectors\n\t// needing tokenize in the PSEUDO preFilter\n\tpseudos = \":(\" + characterEncoding + \")(?:\\\\(((['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes.replace( 3, 8 ) + \")*)|.*)\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([\\\\x20\\\\t\\\\r\\\\n\\\\f>+~])\" + whitespace + \"*\" ),\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + characterEncoding + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + characterEncoding + \")\" ),\n\t\t\"NAME\": new RegExp( \"^\\\\[name=['\\\"]?(\" + characterEncoding + \")['\\\"]?\\\\]\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + characterEncoding.replace( \"w\", \"w*\" ) + \")\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n\t\t\t\"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n\t\t\t\"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n\t\t\twhitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trsibling = /[\\x20\\t\\r\\n\\f]*[+~]/,\n\n\trnative = /^[^{]+\\{\\s*\\[native code/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trescape = /'|\\\\/g,\n\trattributeQuotes = /\\=[\\x20\\t\\r\\n\\f]*([^'\"\\]]*)[\\x20\\t\\r\\n\\f]*\\]/g,\n\n\t// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = /\\\\([\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|.)/g,\n\tfunescape = function( _, escaped ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\treturn high !== high ?\n\t\t\tescaped :\n\t\t\t// BMP codepoint\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t};\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t(arr = slice.call( preferredDoc.childNodes )),\n\t\tpreferredDoc.childNodes\n\t);\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpush_native.apply( target, slice.call(els) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( (target[j++] = els[i++]) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\n/*\n * For feature detection\n * @param {Function} fn The function to test for native support\n */\nfunction isNative( fn ) {\n\treturn rnative.test( fn + \"\" );\n}\n\n/*\n * Create key-value caches of limited size\n * @returns {Function(string, Object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar cache,\n\t\tkeys = [];\n\n\treturn (cache = function( key, value ) {\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key += \" \" ) > Expr.cacheLength ) {\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn (cache[ key ] = value);\n\t});\n}\n\n/*\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/*\n * Support testing using an element\n * @param {Function} fn Passed the created div and expects a boolean result\n */\nfunction assert( fn ) {\n\tvar div = document.createElement(\"div\");\n\n\ttry {\n\t\treturn !!fn( div );\n\t} catch (e) {\n\t\treturn false;\n\t} finally {\n\t\t// release memory in IE\n\t\tdiv = null;\n\t}\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar match, elem, m, nodeType,\n\t\t// QSA vars\n\t\ti, groups, old, nid, newContext, newSelector;\n\n\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\n\tcontext = context || document;\n\tresults = results || [];\n\n\tif ( !selector || typeof selector !== \"string\" ) {\n\t\treturn results;\n\t}\n\n\tif ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {\n\t\treturn [];\n\t}\n\n\tif ( documentIsHTML && !seed ) {\n\n\t\t// Shortcuts\n\t\tif ( (match = rquickExpr.exec( selector )) ) {\n\t\t\t// Speed-up: Sizzle(\"#ID\")\n\t\t\tif ( (m = match[1]) ) {\n\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\telem = context.getElementById( m );\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Handle the case where IE, Opera, and Webkit return items\n\t\t\t\t\t\t// by name instead of ID\n\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Context is not a document\n\t\t\t\t\tif ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\n\t\t\t\t\t\tcontains( context, elem ) && elem.id === m ) {\n\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Speed-up: Sizzle(\"TAG\")\n\t\t\t} else if ( match[2] ) {\n\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\treturn results;\n\n\t\t\t// Speed-up: Sizzle(\".CLASS\")\n\t\t\t} else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {\n\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\treturn results;\n\t\t\t}\n\t\t}\n\n\t\t// QSA path\n\t\tif ( support.qsa && !rbuggyQSA.test(selector) ) {\n\t\t\told = true;\n\t\t\tnid = expando;\n\t\t\tnewContext = context;\n\t\t\tnewSelector = nodeType === 9 && selector;\n\n\t\t\t// qSA works strangely on Element-rooted queries\n\t\t\t// We can work around this by specifying an extra ID on the root\n\t\t\t// and working up from there (Thanks to Andrew Dupont for the technique)\n\t\t\t// IE 8 doesn't work on object elements\n\t\t\tif ( nodeType === 1 && context.nodeName.toLowerCase() !== \"object\" ) {\n\t\t\t\tgroups = tokenize( selector );\n\n\t\t\t\tif ( (old = context.getAttribute(\"id\")) ) {\n\t\t\t\t\tnid = old.replace( rescape, \"\\\\$&\" );\n\t\t\t\t} else {\n\t\t\t\t\tcontext.setAttribute( \"id\", nid );\n\t\t\t\t}\n\t\t\t\tnid = \"[id='\" + nid + \"'] \";\n\n\t\t\t\ti = groups.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tgroups[i] = nid + toSelector( groups[i] );\n\t\t\t\t}\n\t\t\t\tnewContext = rsibling.test( selector ) && context.parentNode || context;\n\t\t\t\tnewSelector = groups.join(\",\");\n\t\t\t}\n\n\t\t\tif ( newSelector ) {\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch(qsaError) {\n\t\t\t\t} finally {\n\t\t\t\t\tif ( !old ) {\n\t\t\t\t\t\tcontext.removeAttribute(\"id\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/*\n * Detect xml\n * @param {Element|Object} elem An element or a document\n */\nisXML = Sizzle.isXML = function( elem ) {\n\t// documentElement is verified for cases where it doesn't yet exist\n\t// (such as loading iframes in IE - #4833)\n\tvar documentElement = elem && (elem.ownerDocument || elem).documentElement;\n\treturn documentElement ? documentElement.nodeName !== \"HTML\" : false;\n};\n\n/*\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar doc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// If no document and documentElement is available, return\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Set our document\n\tdocument = doc;\n\tdocElem = doc.documentElement;\n\n\t// Support tests\n\tdocumentIsHTML = !isXML( doc );\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert(function( div ) {\n\t\tdiv.appendChild( doc.createComment(\"\") );\n\t\treturn !div.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Check if attributes should be retrieved by attribute nodes\n\tsupport.attributes = assert(function( div ) {\n\t\tdiv.innerHTML = \"\";\n\t\tvar type = typeof div.lastChild.getAttribute(\"multiple\");\n\t\t// IE8 returns a string for some attributes even when not present\n\t\treturn type !== \"boolean\" && type !== \"string\";\n\t});\n\n\t// Check if getElementsByClassName can be trusted\n\tsupport.getElementsByClassName = assert(function( div ) {\n\t\t// Opera can't find a second classname (in 9.6)\n\t\tdiv.innerHTML = \"\";\n\t\tif ( !div.getElementsByClassName || !div.getElementsByClassName(\"e\").length ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Safari 3.2 caches class attributes and doesn't catch changes\n\t\tdiv.lastChild.className = \"e\";\n\t\treturn div.getElementsByClassName(\"e\").length === 2;\n\t});\n\n\t// Check if getElementsByName privileges form controls or returns elements by ID\n\t// If so, assume (for broader support) that getElementById returns elements by name\n\tsupport.getByName = assert(function( div ) {\n\t\t// Inject content\n\t\tdiv.id = expando + 0;\n\t\t// Support: Windows 8 Native Apps\n\t\t// Assigning innerHTML with \"name\" attributes throws uncatchable exceptions\n\t\t// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx\n\t\tdiv.appendChild( document.createElement(\"a\") ).setAttribute( \"name\", expando );\n\t\tdiv.appendChild( document.createElement(\"i\") ).setAttribute( \"name\", expando );\n\t\tdocElem.appendChild( div );\n\n\t\t// Test\n\t\tvar pass = doc.getElementsByName &&\n\t\t\t// buggy browsers will return fewer than the correct 2\n\t\t\tdoc.getElementsByName( expando ).length === 2 +\n\t\t\t// buggy browsers will return more than the correct 0\n\t\t\tdoc.getElementsByName( expando + 0 ).length;\n\n\t\t// Cleanup\n\t\tdocElem.removeChild( div );\n\n\t\treturn pass;\n\t});\n\n\t// Support: Webkit<537.32\n\t// Detached nodes confoundingly follow *each other*\n\tsupport.sortDetached = assert(function( div1 ) {\n\t\treturn div1.compareDocumentPosition &&\n\t\t\t// Should return 1, but Webkit returns 4 (following)\n\t\t\t(div1.compareDocumentPosition( document.createElement(\"div\") ) & 1);\n\t});\n\n\t// IE6/7 return modified attributes\n\tExpr.attrHandle = assert(function( div ) {\n\t\tdiv.innerHTML = \"\";\n\t\treturn div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&\n\t\t\tdiv.firstChild.getAttribute(\"href\") === \"#\";\n\t}) ?\n\t\t{} :\n\t\t{\n\t\t\t\"href\": function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"href\", 2 );\n\t\t\t},\n\t\t\t\"type\": function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"type\");\n\t\t\t}\n\t\t};\n\n\t// ID find and filter\n\tif ( support.getByName ) {\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== strundefined && documentIsHTML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\treturn m && m.parentNode ? [m] : [];\n\t\t\t}\n\t\t};\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"id\") === attrId;\n\t\t\t};\n\t\t};\n\t} else {\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== strundefined && documentIsHTML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\n\t\t\t\treturn m ?\n\t\t\t\t\tm.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode(\"id\").value === id ?\n\t\t\t\t\t\t[m] :\n\t\t\t\t\t\tundefined :\n\t\t\t\t\t[];\n\t\t\t}\n\t\t};\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode(\"id\");\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[\"TAG\"] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== strundefined ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\t\t\t}\n\t\t} :\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( (elem = results[i++]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Name\n\tExpr.find[\"NAME\"] = support.getByName && function( tag, context ) {\n\t\tif ( typeof context.getElementsByName !== strundefined ) {\n\t\t\treturn context.getElementsByName( name );\n\t\t}\n\t};\n\n\t// Class\n\tExpr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21),\n\t// no need to also add to buggyMatches since matches checks buggyQSA\n\t// A support test would require too much code (would include document ready)\n\trbuggyQSA = [ \":focus\" ];\n\n\tif ( (support.qsa = isNative(doc.querySelectorAll)) ) {\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert(function( div ) {\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// http://bugs.jquery.com/ticket/12359\n\t\t\tdiv.innerHTML = \"\";\n\n\t\t\t// IE8 - Some boolean attributes are not treated correctly\n\t\t\tif ( !div.querySelectorAll(\"[selected]\").length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:checked|disabled|ismap|multiple|readonly|selected|value)\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":checked\").length ) {\n\t\t\t\trbuggyQSA.push(\":checked\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( div ) {\n\n\t\t\t// Opera 10-12/IE8 - ^= $= *= and empty values\n\t\t\t// Should not select anything\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tif ( div.querySelectorAll(\"[i^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:\\\"\\\"|'')\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":enabled\").length ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tdiv.querySelectorAll(\"*,:x\");\n\t\t\trbuggyQSA.push(\",.*:\");\n\t\t});\n\t}\n\n\tif ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector) )) ) {\n\n\t\tassert(function( div ) {\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( div, \"div\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( div, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t});\n\t}\n\n\trbuggyQSA = new RegExp( rbuggyQSA.join(\"|\") );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n\t// Element contains another\n\t// Purposefully does not implement inclusive descendent\n\t// As in, an element does not contain itself\n\tcontains = isNative(docElem.contains) || docElem.compareDocumentPosition ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t));\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( (b = b.parentNode) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t// Document order sorting\n\tsortOrder = docElem.compareDocumentPosition ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );\n\n\t\tif ( compare ) {\n\t\t\t// Disconnected nodes\n\t\t\tif ( compare & 1 ||\n\t\t\t\t(recompare && b.compareDocumentPosition( a ) === compare) ) {\n\n\t\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t\tif ( a === doc || contains(preferredDoc, a) ) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif ( b === doc || contains(preferredDoc, b) ) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\t// Maintain original order\n\t\t\t\treturn sortInput ?\n\t\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t\t0;\n\t\t\t}\n\n\t\t\treturn compare & 4 ? -1 : 1;\n\t\t}\n\n\t\t// Not directly comparable, sort on existence of method\n\t\treturn a.compareDocumentPosition ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\t} else if ( !aup || !bup ) {\n\t\t\treturn a === doc ? -1 :\n\t\t\t\tb === doc ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[i] === bp[i] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[i], bp[i] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\tap[i] === preferredDoc ? -1 :\n\t\t\tbp[i] === preferredDoc ? 1 :\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\t// Make sure that attribute selectors are quoted\n\texpr = expr.replace( rattributeQuotes, \"='$1']\" );\n\n\t// rbuggyQSA always contains :focus, so no need for an existence check\n\tif ( support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch(e) {}\n\t}\n\n\treturn Sizzle( expr, document, null, [elem] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\t// Set document vars if needed\n\tif ( ( context.ownerDocument || context ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\tvar val;\n\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tif ( documentIsHTML ) {\n\t\tname = name.toLowerCase();\n\t}\n\tif ( (val = Expr.attrHandle[ name ]) ) {\n\t\treturn val( elem );\n\t}\n\tif ( !documentIsHTML || support.attributes ) {\n\t\treturn elem.getAttribute( name );\n\t}\n\treturn ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?\n\t\tname :\n\t\tval && val.specified ? val.value : null;\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n// Document sorting and removing duplicates\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\t// Compensate for sort limitations\n\trecompare = !support.sortDetached;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( (elem = results[i++]) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\treturn results;\n};\n\n/*\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns Returns -1 if a precedes b, 1 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( (cur = cur.nextSibling) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n// Returns a function to use in pseudos for input types\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n// Returns a function to use in pseudos for buttons\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}\n\n// Returns a function to use in pseudos for positionals\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n/*\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\t\t// If no nodeType, this is expected to be an array\n\t\tfor ( ; (node = elem[i]); i++ ) {\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (see #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[1] = match[1].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[3] = ( match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[2] === \"~=\" ) {\n\t\t\t\tmatch[3] = \" \" + match[3] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[1] = match[1].toLowerCase();\n\n\t\t\tif ( match[1].slice( 0, 3 ) === \"nth\" ) {\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[3] ) {\n\t\t\t\t\tSizzle.error( match[0] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n\t\t\t\tmatch[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[3] ) {\n\t\t\t\tSizzle.error( match[0] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[5] && match[2];\n\n\t\t\tif ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[4] ) {\n\t\t\t\tmatch[2] = match[4];\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t(excess = tokenize( unquoted, true )) &&\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t(excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[0] = match[0].slice( 0, excess );\n\t\t\t\tmatch[2] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeName ) {\n\t\t\tif ( nodeName === \"*\" ) {\n\t\t\t\treturn function() { return true; };\n\t\t\t}\n\n\t\t\tnodeName = nodeName.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t(pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute(\"class\")) || \"\" );\n\t\t\t\t});\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tvar cache, outerCache, node, diff, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( (node = node[ dir ]) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\t\t\t\t\t\t\touterCache = parent[ expando ] || (parent[ expando ] = {});\n\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[0] === dirruns && cache[1];\n\t\t\t\t\t\t\tdiff = cache[0] === dirruns && cache[2];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {\n\t\t\t\t\t\t\tdiff = cache[1];\n\n\t\t\t\t\t\t// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\tif ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {\n\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction(function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf.call( seed, matched[i] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction(function( selector ) {\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction(function( seed, matches, context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = unmatched[i]) ) {\n\t\t\t\t\t\t\tseed[i] = !(matches[i] = elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}) :\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tinput[0] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t}),\n\n\t\t\"has\": markFunction(function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t}),\n\n\t\t\"contains\": markFunction(function( text ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t}),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test(lang || \"\") ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( (elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": function( elem ) {\n\t\t\treturn elem.disabled === false;\n\t\t},\n\n\t\t\"disabled\": function( elem ) {\n\t\t\treturn elem.disabled === true;\n\t\t},\n\n\t\t\"checked\": function( elem ) {\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),\n\t\t\t// not comment, processing instructions, or others\n\t\t\t// Thanks to Diego Perini for the nodeName shortcut\n\t\t\t// Greater than \"@\" means alpha characters (specifically not starting with \"#\" or \"?\")\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeName > \"@\" || elem.nodeType === 3 || elem.nodeType === 4 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[\"empty\"]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\t// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\n\t\t\t// use getAttribute instead to test this case\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === elem.type );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo(function() {\n\t\t\treturn [ 0 ];\n\t\t}),\n\n\t\t\"last\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t}),\n\n\t\t\"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t}),\n\n\t\t\"even\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t})\n\t}\n};\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\nfunction tokenize( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || (match = rcomma.exec( soFar )) ) {\n\t\t\tif ( match ) {\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[0].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( tokens = [] );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( (match = rcombinators.exec( soFar )) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[0].replace( rtrim, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n\t\t\t\t(match = preFilters[ type ]( match ))) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n}\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[i].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tcheckNonElements = base && dir === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar data, cache, outerCache,\n\t\t\t\tdirkey = dirruns + \" \" + doneName;\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || (elem[ expando ] = {});\n\t\t\t\t\t\tif ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {\n\t\t\t\t\t\t\tif ( (data = cache[1]) === true || data === cachedruns ) {\n\t\t\t\t\t\t\t\treturn data === true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcache = outerCache[ dir ] = [ dirkey ];\n\t\t\t\t\t\t\tcache[1] = matcher( elem, context, xml ) || cachedruns;\n\t\t\t\t\t\t\tif ( cache[1] === true ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[i]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[0];\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (elem = unmatched[i]) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction(function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( (elem = temp[i]) ) {\n\t\t\t\t\tmatcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = matcherOut[i]) ) {\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( (matcherIn[i] = elem) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, (matcherOut = []), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( (elem = matcherOut[i]) &&\n\t\t\t\t\t\t(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {\n\n\t\t\t\t\t\tseed[temp] = !(results[temp] = elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[0].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[\" \"],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf.call( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\treturn ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t(checkContext = context).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n\t\t\tmatchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[j].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\t// A counter to specify which element is currently being matched\n\tvar matcherCachedRuns = 0,\n\t\tbySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, expandContext ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tsetMatched = [],\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\toutermost = expandContext != null,\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", expandContext && context.parentNode || context ),\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context !== document && context;\n\t\t\t\tcachedruns = matcherCachedRuns;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Keep `i` a string if there are no elements so `matchedCount` will be \"00\" below\n\t\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t\tcachedruns = ++matcherCachedRuns;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( (elem = !matcher && elem) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\tmatchedCount += i;\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (matcher = setMatchers[j++]) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !(unmatched[i] || setMatched[i]) ) {\n\t\t\t\t\t\t\t\tsetMatched[i] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !group ) {\n\t\t\tgroup = tokenize( selector );\n\t\t}\n\t\ti = group.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( group[i] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\t}\n\treturn cached;\n};\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[i], results );\n\t}\n\treturn results;\n}\n\nfunction select( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tmatch = tokenize( selector );\n\n\tif ( !seed ) {\n\t\t// Try to minimize operations if there is only one group\n\t\tif ( match.length === 1 ) {\n\n\t\t\t// Take a shortcut and set the context if the root selector is an ID\n\t\t\ttokens = match[0] = match[0].slice( 0 );\n\t\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\t\tcontext.nodeType === 9 && documentIsHTML &&\n\t\t\t\t\tExpr.relative[ tokens[1].type ] ) {\n\n\t\t\t\tcontext = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n\t\t\t\tif ( !context ) {\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\n\t\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t\t}\n\n\t\t\t// Fetch a seed set for right-to-left matching\n\t\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\ttoken = tokens[i];\n\n\t\t\t\t// Abort if we hit a combinator\n\t\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\t\tif ( (seed = find(\n\t\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\t\trsibling.test( tokens[0].type ) && context.parentNode || context\n\t\t\t\t\t)) ) {\n\n\t\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\tcompile( selector, match )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\trsibling.test( selector )\n\t);\n\treturn results;\n}\n\n// Deprecated\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\n// Check sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Initialize with the default document\nsetDocument();\n\n// Always assume the presence of duplicates if sort doesn't\n// pass them to our comparison function (as in Google Chrome).\n[0, 0].sort( sortOrder );\nsupport.detectDuplicates = hasDuplicate;\n\n// EXPOSE\n/*if ( typeof define === \"function\" && define.amd ) {\n\tdefine(function() { return Sizzle; });\n} else {\n\twindow.Sizzle = Sizzle;\n}*/\n// EXPOSE\n\n/**\n * @namespace Ink.Dom.Selector\n * @static\n */\n\n/**\n * Alias for the Sizzle selector engine\n *\n * @method select\n * @param {String} selector CSS selector to search for elements\n * @param {DOMElement} [context] By default the search is done in the document element. However, you can specify an element as search context\n * @param {Array} [results] By default this is considered an empty array. But if you want to merge it with other searches you did, pass their result array through here.\n * @return {Array} Array of resulting DOM Elements\n * @sample Ink_Dom_Selector_select.html\n */\n\n/**\n * Filters elements that match a CSS selector.\n *\n * @method matches\n * @param {String} selector CSS selector to search for elements\n * @param {Array} matches Elements to be 'matched' with\n * @return {Array} Elements that matched\n * @sample Ink_Dom_Selector_matches.html\n */\n\n/**\n * Checks if an element matches a given selector\n *\n * @method matchesSelector\n * @param {DOMElement} element Element to test\n * @param {String} selector CSS selector to test the element with\n * @return {Boolean} True if element matches the CSS selector\n * @sample Ink_Dom_Selector_matchesSelector.html \n */\n\nreturn {\n select: Sizzle,\n matches: Sizzle.matches,\n matchesSelector: Sizzle.matchesSelector\n};\n\n\n}); //( window );\n","/**\n * Animate.css Utility\n *\n * This module is a wrapper around animate.css's CSS classes to produce animation.\n * It contains options to ease common tasks, like listen to the \"animationend\" event with all necessary prefixes, remove the necessary class names when the animation finishes, or configure the duration of your animation with the necessary browser prefix.\n *\n * @module Ink.UI.Animate_1\n * @version 1\n */\n\nInk.createModule('Ink.UI.Animate', 1, ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Css_1'], function (Common, InkEvent, Css) {\n 'use strict';\n\n var animationPrefix = (function (el) {\n return ('animationName' in el.style) ? 'animation' :\n ('oAnimationName' in el.style) ? 'oAnimation' :\n ('msAnimationName' in el.style) ? 'msAnimation' :\n ('webkitAnimationName' in el.style) ? 'webkitAnimation' : null;\n }(document.createElement('div')));\n\n var animationEndEventName = {\n animation: 'animationend',\n oAnimation: 'oanimationend',\n msAnimation: 'MSAnimationEnd',\n webkitAnimation: 'webkitAnimationEnd'\n }[animationPrefix];\n\n /**\n * @class Ink.UI.Animate_1\n * @constructor\n *\n * @param {DOMElement} element Animated element\n * @param {Object} options Options object\n * @param {String} options.animation Animation name\n * @param {String|Number} [options.duration] Duration name (fast|medium|slow) or duration in milliseconds. Defaults to 'medium'.\n * @param {Boolean} [options.removeClass] Flag to remove the CSS class when finished animating. Defaults to false.\n * @param {Function} [options.onEnd] Callback for the animation end\n *\n * @sample Ink_UI_Animate_1.html\n *\n **/\n function Animate() {\n Common.BaseUIComponent.apply(this, arguments);\n }\n\n Animate._name = 'Animate_1';\n\n Animate._optionDefinition = {\n trigger: ['Element', null],\n duration: ['String', 'slow'], // Actually a string with a duration name, or a number of ms\n animation: ['String'],\n removeClass: ['Boolean', true],\n onEnd: ['Function', function () {}]\n };\n\n Animate.prototype._init = function () {\n if (!isNaN(parseInt(this._options.duration, 10))) {\n this._options.duration = parseInt(this._options.duration, 10);\n }\n\n if (this._options.trigger) {\n InkEvent.observe(this._options.trigger, 'click', Ink.bind(function () {\n this.animate();\n }, this)); // later\n } else {\n this.animate();\n }\n };\n\n Animate.prototype.animate = function () {\n Animate.animate(this._element, this._options.animation, this._options);\n };\n\n Ink.extendObj(Animate, {\n /**\n * Browser prefix for the CSS animations.\n *\n * @property _animationPrefix\n * @private\n **/\n _animationPrefix: animationPrefix,\n\n /**\n * Boolean which says whether this browser has CSS3 animation support.\n *\n * @property animationSupported\n **/\n animationSupported: !!animationPrefix,\n\n /**\n * Prefixed 'animationend' event name.\n *\n * @property animationEndEventName\n **/\n animationEndEventName: animationEndEventName,\n\n /**\n * Animate an element using one of the animate.css classes\n *\n * **Note: This is a utility method inside the `Animate` class, which you can access through `Animate.animate()`. Do not mix these up.**\n *\n * @static\n * @method animate\n * @param element {DOMElement} animated element\n * @param animation {String} animation name\n * @param [options] {Object}\n * @param [options.onEnd=null] {Function} callback for animation end\n * @param [options.removeClass=false] {Boolean} whether to remove the Css class when finished\n * @param [options.duration=medium] {String|Number} duration name (fast|medium|slow) or duration in ms\n *\n * @sample Ink_UI_Animate_1_animate.html\n **/\n animate: function (element, animation, options) {\n element = Common.elOrSelector(element);\n\n if (typeof options === 'number' || typeof options === 'string') {\n options = { duration: options };\n } else if (!options) {\n options = {};\n }\n\n if (typeof arguments[3] === 'function') {\n options.onEnd = arguments[3];\n }\n\n if (typeof options.duration !== 'number' && typeof options.duration !== 'string') {\n options.duration = 400;\n }\n\n if (!Animate.animationSupported) {\n if (options.onEnd) {\n setTimeout(function () {\n options.onEnd(null);\n }, 0);\n }\n return;\n }\n\n if (typeof options.duration === 'number') {\n element.style[animationPrefix + 'Duration'] = options.duration + 'ms';\n } else if (typeof options.duration === 'string') {\n Css.addClassName(element, options.duration);\n }\n\n Css.addClassName(element, ['animated', animation]);\n\n function onAnimationEnd(event) {\n if (event.target !== element) { return; }\n if (event.animationName !== animation) { return; }\n if (options.onEnd) { options.onEnd(event); }\n if (options.removeClass) {\n Css.removeClassName(element, animation);\n }\n if (typeof options.duration === 'string') {\n Css.removeClassName(element, options.duration);\n }\n element.removeEventListener(animationEndEventName, onAnimationEnd, false);\n }\n\n element.addEventListener(animationEndEventName, onAnimationEnd, false);\n }\n });\n\n Common.createUIComponent(Animate);\n\n return Animate;\n});\n","/**\n * Flexible Carousel\n * @module Ink.UI.Carousel_1\n * @version 1\n */\n\nInk.createModule('Ink.UI.Carousel', '1',\n ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Css_1', 'Ink.Dom.Element_1', 'Ink.UI.Pagination_1', 'Ink.Dom.Browser_1', 'Ink.Dom.Selector_1'],\n function(Common, InkEvent, Css, InkElement, Pagination, Browser/*, Selector*/) {\n 'use strict';\n\n /*\n * TODO:\n * keyboardSupport\n */\n\n function limitRange(n, min, max) {\n return Math.min(max, Math.max(min, n));\n }\n\n var requestAnimationFrame = window.requestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n function (cb) {return setTimeout(cb, 1000 / 30); };\n\n /**\n * @class Ink.UI.Carousel_1\n * @constructor\n *\n * @param {String|DOMElement} selector DOM element or element id\n * @param {Object} [options] Carousel Options\n * @param {Integer} [options.autoAdvance] Milliseconds to wait before auto-advancing pages. Set to 0 to disable auto-advance. Defaults to 0.\n * @param {String} [options.axis] Axis of the carousel. Set to 'y' for a vertical carousel. Defaults to 'x'.\n * @param {Number} [options.initialPage] Initial index page of the carousel. Defaults to 0.\n * @param {Boolean} [options.spaceAfterLastSlide=true] If there are not enough slides to fill the full width of the last page, leave white space. Defaults to `true`.\n * @param {Boolean} [options.swipe] Enable swipe support if available. Defaults to true.\n * @param {Mixed} [options.pagination] Either an ul element to add pagination markup to or an `Ink.UI.Pagination` instance to use.\n * @param {Function} [options.onChange] Callback to be called when the page changes.\n *\n * @sample Ink_UI_Carousel_1.html\n */\n function Carousel() {\n Common.BaseUIComponent.apply(this, arguments);\n }\n\n Carousel._name = 'Carousel_1';\n\n Carousel._optionDefinition = {\n autoAdvance: ['Integer', 0],\n axis: ['String', 'x'],\n initialPage: ['Integer', 0],\n spaceAfterLastSlide: ['Boolean', true],\n hideLast: ['Boolean', false],\n // [3.1.0] Deprecate \"center\". It is only needed when things are of unknown widths.\n center: ['Boolean', false],\n keyboardSupport:['Boolean', false],\n pagination: ['String', null],\n onChange: ['Function', null],\n onInit: ['Function', function () {}],\n swipe: ['Boolean', true]\n // TODO exponential swipe\n // TODO specify break point for next page when moving finger\n };\n\n Carousel.prototype = {\n _init: function () {\n this._handlers = {\n paginationChange: Ink.bindMethod(this, '_onPaginationChange'),\n windowResize: InkEvent.throttle(Ink.bindMethod(this, 'refit'), 200)\n };\n\n InkEvent.observe(window, 'resize', this._handlers.windowResize);\n\n this._isY = (this._options.axis === 'y');\n\n var ulEl = Ink.s('ul.stage', this._element);\n this._ulEl = ulEl;\n\n InkElement.removeTextNodeChildren(ulEl);\n\n if (this._options.pagination == null) {\n this._currentPage = this._options.initialPage;\n }\n\n this.refit(); // recalculate this._numPages\n\n if (this._isY) {\n // Override white-space: no-wrap which is only necessary to make sure horizontal stuff stays horizontal, but breaks stuff intended to be vertical.\n this._ulEl.style.whiteSpace = 'normal';\n }\n\n if (this._options.swipe) {\n InkEvent.observe(this._element, 'touchstart', Ink.bindMethod(this, '_onTouchStart'));\n InkEvent.observe(this._element, 'touchmove', Ink.bindMethod(this, '_onTouchMove'));\n InkEvent.observe(this._element, 'touchend', Ink.bindMethod(this, '_onTouchEnd'));\n }\n\n this._setUpPagination();\n this._setUpAutoAdvance();\n this._setUpHider();\n\n this._options.onInit.call(this, this);\n },\n\n /**\n * Repositions elements around.\n * Measure the carousel once again, adjusting the involved elements' sizes. This is called automatically when the window resizes, in order to cater for changes from responsive media queries, for instance.\n *\n * @method refit\n * @public\n */\n refit: function() {\n var _isY = this._isY;\n\n var size = function (elm, perpendicular) {\n if (!elm) { return 0; }\n\n if (!perpendicular) {\n return InkElement.outerDimensions(elm)[_isY ? 1 : 0];\n } else {\n return InkElement.outerDimensions(elm)[_isY ? 0 : 1];\n }\n };\n\n this._liEls = Ink.ss('li.slide', this._ulEl);\n var numSlides = this._liEls.length;\n\n var contRect = this._ulEl.getBoundingClientRect();\n this._ctnLength = _isY ? contRect.bottom - contRect.top : contRect.right - contRect.left;\n this._elLength = size(this._liEls[0]);\n this._slidesPerPage = Math.floor( this._ctnLength / this._elLength ) || 1;\n if (!isFinite(this._slidesPerPage)) { this._slidesPerPage = 1; }\n\n var numPages = Math.ceil( numSlides / this._slidesPerPage );\n var numPagesChanged = this._numPages !== numPages;\n this._numPages = numPages;\n this._deltaLength = this._slidesPerPage * this._elLength;\n \n this._center();\n this._updateHider();\n this._IE7();\n\n if (this._pagination && numPagesChanged) {\n this._pagination.setSize(this._numPages);\n }\n this.setPage(limitRange(this.getPage(), 0, this._numPages));\n },\n\n _setUpPagination: function () {\n if (this._options.pagination) {\n if (Common.isDOMElement(this._options.pagination) ||\n typeof this._options.pagination === 'string') {\n // if dom element or css selector string...\n this._pagination = new Pagination(this._options.pagination, {\n size: this._numPages,\n onChange: this._handlers.paginationChange\n });\n } else {\n // assumes instantiated pagination\n this._pagination = this._options.pagination;\n this._pagination._options.onChange = this._handlers.paginationChange;\n this._pagination.setSize(this._numPages);\n }\n this._pagination.setCurrent(this._options.initialPage || 0);\n } else {\n this._currentPage = this._options.initialPage || 0;\n }\n },\n\n _setUpAutoAdvance: function () {\n if (!this._options.autoAdvance) { return; }\n var self = this;\n\n setTimeout(function autoAdvance() {\n self.nextPage(true /* wrap */);\n setTimeout(autoAdvance, self._options.autoAdvance);\n }, this._options.autoAdvance);\n },\n\n _setUpHider: function () {\n if (this._options.hideLast) {\n var hiderEl = InkElement.create('div', {\n className: 'hider',\n insertBottom: this._element\n });\n hiderEl.style.position = 'absolute';\n hiderEl.style[ this._isY ? 'left' : 'top' ] = '0'; // fix to top..\n hiderEl.style[ this._isY ? 'right' : 'bottom' ] = '0'; // and bottom...\n hiderEl.style[ this._isY ? 'bottom' : 'right' ] = '0'; // and move to the end.\n this._hiderEl = hiderEl;\n }\n },\n\n // [3.1.0] Deprecate this already\n _center: function() {\n if (!this._options.center) { return; }\n var gap = Math.floor( (this._ctnLength - (this._elLength * this._slidesPerPage) ) / 2 );\n\n var pad;\n if (this._isY) {\n pad = [gap, 'px 0'];\n } else {\n pad = ['0 ', gap, 'px'];\n }\n\n this._ulEl.style.padding = pad.join('');\n },\n\n // [3.1.0] Deprecate this already\n _updateHider: function() {\n if (!this._hiderEl) { return; }\n if (this.getPage() === 0) {\n var gap = Math.floor( this._ctnLength - (this._elLength * this._slidesPerPage) );\n if (this._options.center) {\n gap /= 2;\n }\n this._hiderEl.style[ this._isY ? 'height' : 'width' ] = gap + 'px';\n } else {\n this._hiderEl.style[ this._isY ? 'height' : 'width' ] = '0px';\n }\n },\n \n /**\n * Refits elements for IE7 because it doesn't support inline-block.\n *\n * @method _IE7\n * @private\n */\n _IE7: function () {\n if (Browser.IE && '' + Browser.version.split('.')[0] === '7') {\n // var numPages = this._numPages;\n var slides = Ink.ss('li.slide', this._ulEl);\n var stl = function (prop, val) {slides[i].style[prop] = val; };\n for (var i = 0, len = slides.length; i < len; i++) {\n stl('position', 'absolute');\n stl(this._isY ? 'top' : 'left', (i * this._elLength) + 'px');\n }\n }\n },\n\n _onTouchStart: function (event) {\n if (event.touches.length > 1) { return; }\n\n this._swipeData = {\n x: InkEvent.pointerX(event),\n y: InkEvent.pointerY(event)\n };\n\n var ulRect = this._ulEl.getBoundingClientRect();\n\n this._swipeData.firstUlPos = ulRect[this._isY ? 'top' : 'left'];\n\n this._swipeData.inUlX = this._swipeData.x - ulRect.left;\n this._swipeData.inUlY = this._swipeData.y - ulRect.top;\n\n setTransitionProperty(this._ulEl, 'none');\n\n this._touchMoveIsFirstTouchMove = true;\n },\n\n _onTouchMove: function (event) {\n if (event.touches.length > 1) { return; /* multitouch event, not my problem. */ }\n\n var pointerX = InkEvent.pointerX(event);\n var pointerY = InkEvent.pointerY(event);\n\n var deltaY = Math.abs(pointerY - this._swipeData.y);\n var deltaX = Math.abs(pointerX - this._swipeData.x);\n\n if (this._touchMoveIsFirstTouchMove) {\n this._touchMoveIsFirstTouchMove = undefined;\n this._scrolling = this._isY ?\n deltaX > deltaY :\n deltaY > deltaX ;\n\n if (!this._scrolling) {\n this._onAnimationFrame();\n }\n }\n\n if (!this._scrolling && this._swipeData) {\n InkEvent.stopDefault(event);\n\n this._swipeData.pointerPos = this._isY ? pointerY : pointerX;\n }\n },\n\n _onAnimationFrame: function () {\n var swipeData = this._swipeData;\n\n if (!swipeData || this._scrolling || this._touchMoveIsFirstTouchMove) { return; }\n\n var elRect = this._element.getBoundingClientRect();\n\n var newPos;\n\n if (!this._isY) {\n newPos = swipeData.pointerPos - swipeData.inUlX - elRect.left;\n } else {\n newPos = swipeData.pointerPos - swipeData.inUlY - elRect.top;\n }\n\n this._ulEl.style[this._isY ? 'top' : 'left'] = newPos + 'px';\n\n requestAnimationFrame(Ink.bindMethod(this, '_onAnimationFrame'));\n },\n\n _onTouchEnd: function (event) {\n if (this._swipeData && this._swipeData.pointerPos && !this._scrolling && !this._touchMoveIsFirstTouchMove) {\n var snapToNext = 0.1; // swipe 10% of the way to change page\n\n var relProgress = this._swipeData.firstUlPos -\n this._ulEl.getBoundingClientRect()[this._isY ? 'top' : 'left'];\n\n var curPage = this.getPage();\n\n // How many pages were advanced? May be fractional.\n var progressInPages = relProgress / this._elLength / this._slidesPerPage;\n\n // Have we advanced enough to change page?\n if (Math.abs(progressInPages) > snapToNext) {\n curPage += Math[ relProgress < 0 ? 'floor' : 'ceil' ](progressInPages);\n }\n\n // If something used to calculate progressInPages was zero, we get NaN here.\n if (!isNaN(curPage)) {\n this.setPage(curPage);\n }\n\n InkEvent.stopDefault(event);\n }\n\n setTransitionProperty(this._ulEl, null /* transition: left, top */);\n this._swipeData = null;\n this._touchMoveIsFirstTouchMove = undefined;\n this._scrolling = undefined;\n },\n\n _onPaginationChange: function(pgn) {\n this._setPage(pgn.getCurrent());\n },\n\n /**\n * Gets the current page index\n * @method getPage\n * @return The current page number\n **/\n getPage: function () {\n if (this._pagination) {\n return this._pagination.getCurrent();\n } else {\n return this._currentPage || 0;\n }\n },\n\n /**\n * Sets the current page index\n * @method setPage\n * @param {Number} page Index of the destination page.\n * @param {Boolean} [wrap] Flag to activate circular counting.\n **/\n setPage: function (page, wrap) {\n if (wrap) {\n // Pages outside the range [0..this._numPages] are wrapped.\n page = page % this._numPages;\n if (page < 0) { page = this._numPages - page; }\n }\n page = limitRange(page, 0, this._numPages - 1);\n\n if (this._pagination) {\n this._pagination.setCurrent(page); // _setPage is called by pagination because it listens to its Change event.\n } else {\n this._setPage(page);\n }\n },\n\n _setPage: function (page) {\n var _lengthToGo = page * this._deltaLength;\n var isLastPage = page === (this._numPages - 1);\n\n if (!this._options.spaceAfterLastSlide && isLastPage && page > 0) { \n var _itemsInLastPage = this._liEls.length - (page * this._slidesPerPage);\n if(_itemsInLastPage < this._slidesPerPage) {\n _lengthToGo = ((page - 1) * this._deltaLength) + (_itemsInLastPage * this._elLength);\n }\n }\n\n this._ulEl.style[ this._isY ? 'top' : 'left'] =\n ['-', _lengthToGo, 'px'].join('');\n\n if (this._options.onChange) {\n this._options.onChange.call(this, page);\n }\n\n this._currentPage = page;\n\n this._updateHider();\n },\n\n /**\n * Goes to the next page\n * @method nextPage\n * @param {Boolean} [wrap] Flag to loop from last page to first page.\n **/\n nextPage: function (wrap) {\n this.setPage(this.getPage() + 1, wrap);\n },\n\n /**\n * Goes to the previous page\n * @method previousPage\n * @param {Boolean} [wrap] Flag to loop from first page to last page.\n **/\n previousPage: function (wrap) { this.setPage(this.getPage() - 1, wrap); },\n\n /**\n * Returns how many slides fit into a page\n * @method getSlidesPerPage\n * @return {Number} The number of slides per page\n * @public\n */\n getSlidesPerPage: function() {\n return this._slidesPerPage;\n },\n\n /**\n * Get the amount of pages in the carousel.\n * @method getTotalPages\n * @return {Number} The number of pages\n * @public\n */\n getTotalPages: function() {\n return this._numPages;\n },\n\n /**\n * Get the stage element (your UL with the class \".stage\").\n * @method getStageElm\n * @public\n * @return {DOMElement} Stage element\n **/\n getStageElm: function() {\n return this._ulEl;\n },\n\n /**\n * Get a list of your slides (elements with the \".slide\" class inside your stage)\n * @method getSlidesList\n * @return {DOMElement[]} Array containing the slides.\n * @public\n */\n getSlidesList: function() {\n return this._liEls;\n },\n\n /**\n * Get the total number of slides\n * @method getTotalSlides\n * @return {Number} The number of slides\n * @public\n */\n getTotalSlides: function() {\n return this.getSlidesList().length;\n }\n };\n\n function setTransitionProperty(el, newTransition) {\n el.style.transitionProperty =\n el.style.oTransitionProperty =\n el.style.msTransitionProperty =\n el.style.mozTransitionProperty =\n el.style.webkitTransitionProperty = newTransition;\n }\n\n Common.createUIComponent(Carousel);\n\n return Carousel;\n\n});\n","/**\n * Closing utilities\n * @module Ink.UI.Close_1\n * @version 1\n */\nInk.createModule('Ink.UI.Close', '1', ['Ink.Dom.Event_1','Ink.Dom.Element_1'], function(InkEvent, InkElement) {\n 'use strict';\n\n /**\n * Subscribes clicks on the document.body.\n * Whenever an element with the classes \".ink-close\" or \".ink-dismiss\" is clicked, this module finds an ancestor \".ink-alert\" or \".ink-alert-block\" element and removes it from the DOM.\n * This module should be created only once per page.\n * \n * @class Ink.UI.Close\n * @constructor\n * @example\n * \n *\n * @sample Ink_UI_Close_1.html\n */\n var Close = function() {\n InkEvent.observe(document.body, 'click', function(ev) {\n var el = InkEvent.element(ev);\n\n el = InkElement.findUpwardsByClass(el, 'ink-close') ||\n InkElement.findUpwardsByClass(el, 'ink-dismiss');\n\n if (!el) {\n return; // ink-close or ink-dismiss class not found\n }\n\n var toRemove = InkElement.findUpwardsByClass(el, 'ink-alert') ||\n InkElement.findUpwardsByClass(el, 'ink-alert-block') ||\n el;\n\n if (toRemove) {\n InkEvent.stop(ev);\n InkElement.remove(toRemove);\n }\n });\n };\n\n Close._name = 'Close_1';\n\n return Close;\n});\n","/**\n * Auxiliar utilities for UI Modules\n * @module Ink.UI.Common_1\n * @version 1\n */\n \nInk.createModule('Ink.UI.Common', '1', ['Ink.Dom.Element_1', 'Ink.Net.Ajax_1','Ink.Dom.Css_1','Ink.Dom.Selector_1','Ink.Util.Url_1'], function(InkElement, Ajax,Css,Selector,Url) {\n\n 'use strict';\n\n var nothing = {} /* a marker, for reference comparison. */;\n\n var keys = Object.keys || function (obj) {\n var ret = [];\n for (var k in obj) if (obj.hasOwnProperty(k)) {\n ret.push(k);\n }\n return ret;\n };\n\n var es6WeakMapSupport = 'WeakMap' in window;\n var instances = es6WeakMapSupport ? new WeakMap() : null;\n\n var domRegistry = {\n get: function get(el) {\n return es6WeakMapSupport ?\n instances.get(el) :\n el.__InkInstances;\n },\n set: function set(el, thing) {\n if (es6WeakMapSupport) {\n instances.set(el, thing);\n } else {\n el.__InkInstances = thing;\n }\n }\n };\n\n /**\n * @namespace Ink.UI.Common_1\n */\n\n var Common = {\n\n /**\n * Supported Ink Layouts\n *\n * @property Layouts\n * @type Object\n * @readOnly\n */\n Layouts: {\n TINY: 'tiny',\n SMALL: 'small',\n MEDIUM: 'medium',\n LARGE: 'large',\n XLARGE: 'xlarge'\n },\n\n /**\n * Checks if an item is a valid DOM Element.\n *\n * @method isDOMElement\n * @static\n * @param {Mixed} o The object to be checked.\n * @return {Boolean} True if it's a valid DOM Element.\n * @example\n * var el = Ink.s('#element');\n * if( Ink.UI.Common.isDOMElement( el ) === true ){\n * // It is a DOM Element.\n * } else {\n * // It is NOT a DOM Element.\n * }\n */\n isDOMElement: InkElement.isDOMElement,\n\n /**\n * Checks if an item is a valid integer.\n *\n * @method isInteger\n * @static\n * @param {Mixed} n The value to be checked.\n * @return {Boolean} True if it's a valid integer.\n * @example\n * var value = 1;\n * if( Ink.UI.Common.isInteger( value ) === true ){\n * // It is an integer.\n * } else {\n * // It is NOT an integer.\n * }\n */\n isInteger: function(n) {\n return (typeof n === 'number' && n % 1 === 0);\n },\n\n /**\n * Gets a DOM Element. \n *\n * @method elOrSelector\n * @static\n * @param {DOMElement|String} elOrSelector DOM Element or CSS Selector\n * @param {String} fieldName The name of the field. Commonly used for debugging.\n * @return {DOMElement} Returns the DOMElement passed or the first result of the CSS Selector. Otherwise it throws an exception.\n * @example\n * // In case there are several .myInput, it will retrieve the first found\n * var el = Ink.UI.Common.elOrSelector('.myInput','My Input');\n */\n elOrSelector: function(elOrSelector, fieldName) {\n if (!this.isDOMElement(elOrSelector)) {\n var t = Selector.select(elOrSelector);\n if (t.length === 0) {\n Ink.warn(fieldName + ' must either be a DOM Element or a selector expression!\\nThe script element must also be after the DOM Element itself.');\n return null;\n }\n return t[0];\n }\n return elOrSelector;\n },\n\n /**\n * Alias for `elOrSelector` but returns an array of elements.\n *\n * @method elsOrSelector\n *\n * @static\n * @param {DOMElement|String} elOrSelector DOM Element or CSS Selector\n * @param {String} fieldName The name of the field. Commonly used for debugging.\n * @return {DOMElement} Returns the DOMElement passed or the first result of the CSS Selector. Otherwise it throws an exception.\n * @param {Boolean} required Flag to accept an empty array as output.\n * @return {Array} The selected DOM Elements.\n * @example\n * var elements = Ink.UI.Common.elsOrSelector('input.my-inputs', 'My Input');\n */\n elsOrSelector: function(elsOrSelector, fieldName, required) {\n var ret;\n if (typeof elsOrSelector === 'string') {\n ret = Selector.select(elsOrSelector);\n } else if (Common.isDOMElement(elsOrSelector)) {\n ret = [elsOrSelector];\n } else if (elsOrSelector && typeof elsOrSelector === 'object' && typeof elsOrSelector.length === 'number') {\n ret = elsOrSelector;\n }\n\n if (ret && ret.length) {\n return ret;\n } else {\n if (required) {\n throw new TypeError(fieldName + ' must either be a DOM Element, an Array of elements, or a selector expression!\\nThe script element must also be after the DOM Element itself.');\n } else {\n return [];\n }\n }\n },\n\n /**\n * Gets options an object and element's metadata.\n *\n * The element's data attributes take precedence. Values from the element's data-atrributes are coerced into the required type.\n *\n * @method options\n *\n * @param {Object} [fieldId] Name to be used in debugging features.\n * @param {Object} defaults Object with the options' types and defaults.\n * @param {Object} overrides Options to override the defaults. Usually passed when instantiating an UI module.\n * @param {DOMElement} [element] Element with data-attributes\n *\n * @example\n *\n * this._options = Ink.UI.Common.options('MyComponent', {\n * 'anobject': ['Object', null], // Defaults to null\n * 'target': ['Element', null],\n * 'stuff': ['Number', 0.1],\n * 'stuff2': ['Integer', 0],\n * 'doKickFlip': ['Boolean', false],\n * 'targets': ['Elements'], // Required option since no default was given\n * 'onClick': ['Function', null]\n * }, options || {}, elm)\n *\n * @example\n *\n * ### Note about booleans\n *\n * Here is how options are read from the markup\n * data-attributes, for several values`data-a-boolean`.\n *\n * Options considered true:\n *\n * - `data-a-boolean=\"true\"`\n * - (Every other value which is not on the list below.)\n * \n * Options considered false:\n *\n * - `data-a-boolean=\"false\"`\n * - `data-a-boolean=\"\"`\n * - `data-a-boolean`\n *\n * Options which go to default:\n *\n * - (no attribute). When `data-a-boolean` is ommitted, the\n * option is not considered true nor false, and as such\n * defaults to what is in the `defaults` argument.\n *\n **/\n options: function (fieldId, defaults, overrides, element) {\n if (typeof fieldId !== 'string') {\n element = overrides;\n overrides = defaults;\n defaults = fieldId;\n fieldId = '';\n }\n overrides = overrides || {};\n var out = {};\n var dataAttrs = element ? InkElement.data(element) : {};\n var fromDataAttrs;\n var type;\n var lType;\n var defaultVal;\n\n var invalidStr = function (str) {\n if (fieldId) { str = fieldId + ': \"' + ('' + str).replace(/\"/, '\\\\\"') + '\"'; }\n return str;\n };\n\n var quote = function (str) {\n return '\"' + ('' + str).replace(/\"/, '\\\\\"') + '\"';\n };\n\n var invalidThrow = function (str) {\n throw new Error(invalidStr(str));\n };\n\n var invalid = function (str) {\n Ink.error(invalidStr(str) + '. Ignoring option.');\n };\n\n function optionValue(key) {\n type = defaults[key][0];\n lType = type.toLowerCase();\n defaultVal = defaults[key].length === 2 ? defaults[key][1] : nothing;\n\n if (!type) {\n invalidThrow('Ink.UI.Common.options: Always specify a type!');\n }\n if (!(lType in Common._coerce_funcs)) {\n invalidThrow('Ink.UI.Common.options: ' + defaults[key][0] + ' is not a valid type. Use one of ' + keys(Common._coerce_funcs).join(', '));\n\n }\n if (!defaults[key].length || defaults[key].length > 2) {\n invalidThrow('the \"defaults\" argument must be an object mapping option names to [typestring, optional] arrays.');\n }\n\n if (key in dataAttrs) {\n fromDataAttrs = Common._coerce_from_string(lType, dataAttrs[key], key, fieldId);\n // (above can return `nothing`)\n } else {\n fromDataAttrs = nothing;\n }\n\n if (fromDataAttrs !== nothing) {\n if (!Common._options_validate(fromDataAttrs, lType)) {\n invalid('(' + key + ' option) Invalid ' + lType + ' ' + quote(fromDataAttrs));\n return defaultVal;\n } else {\n return fromDataAttrs;\n }\n } else if (key in overrides) {\n return overrides[key];\n } else if (defaultVal !== nothing) {\n return defaultVal;\n } else {\n invalidThrow('Option ' + key + ' is required!');\n }\n }\n\n for (var key in defaults) {\n if (defaults.hasOwnProperty(key)) {\n out[key] = optionValue(key);\n }\n }\n\n return out;\n },\n\n _coerce_from_string: function (type, val, paramName, fieldId) {\n if (type in Common._coerce_funcs) {\n return Common._coerce_funcs[type](val, paramName, fieldId);\n } else {\n return val;\n }\n },\n\n _options_validate: function (val, type) {\n if (type in Common._options_validate_types) {\n return Common._options_validate_types[type].call(Common, val);\n } else {\n // 'object' options cannot be passed through data-attributes.\n // Json you say? Not any good to embed in HTML.\n return false;\n }\n },\n\n _coerce_funcs: (function () {\n var ret = {\n element: function (val) {\n return Common.elOrSelector(val, '');\n },\n elements: function (val) {\n return Common.elsOrSelector(val, '', false /*not required, so don't throw an exception now*/);\n },\n object: function (val) { return val; },\n number: function (val) { return parseFloat(val); },\n 'boolean': function (val) {\n return !(val === 'false' || val === '' || val === null);\n },\n string: function (val) { return val; },\n 'function': function (val, paramName, fieldId) {\n Ink.error(fieldId + ': You cannot specify the option \"' + paramName + '\" through data-attributes because it\\'s a function');\n return nothing;\n }\n };\n ret['float'] = ret.integer = ret.number;\n return ret;\n }()),\n\n _options_validate_types: (function () {\n var types = {\n string: function (val) {\n return typeof val === 'string';\n },\n number: function (val) {\n return typeof val === 'number' && !isNaN(val) && isFinite(val);\n },\n integer: function (val) {\n return val === Math.round(val);\n },\n element: function (val) {\n return Common.isDOMElement(val);\n },\n elements: function (val) {\n return val && typeof val === 'object' && typeof val.length === 'number' && val.length;\n },\n 'boolean': function (val) {\n return typeof val === 'boolean';\n },\n object: function () { return true; }\n };\n types['float'] = types.number;\n return types;\n }()),\n\n /**\n * Deep copy (clone) an object.\n * Note: The object cannot have referece loops.\n *\n * @method clone\n * @static\n * @param {Object} o The object to be cloned/copied.\n * @return {Object} Returns the result of the clone/copy.\n * @example\n * var originalObj = {\n * key1: 'value1',\n * key2: 'value2',\n * key3: 'value3'\n * };\n * var cloneObj = Ink.UI.Common.clone( originalObj );\n */\n clone: function(o) {\n try {\n return JSON.parse( JSON.stringify(o) );\n } catch (ex) {\n throw new Error('Given object cannot have loops!');\n }\n },\n\n\n /**\n * Gets an element's one-base index relative to its parent.\n *\n * @method childIndex\n * @static\n * @param {DOMElement} childEl Valid DOM Element.\n * @return {Number} Numerical position of an element relatively to its parent.\n * @example\n * \n *
      \n *
    • One
    • \n *
    • Two
    • \n *
    • Three
    • \n *
    • Four
    • \n *
    \n *\n * \n */\n childIndex: function(childEl) {\n if( Common.isDOMElement(childEl) ){\n var els = Selector.select('> *', childEl.parentNode);\n for (var i = 0, f = els.length; i < f; ++i) {\n if (els[i] === childEl) {\n return i;\n }\n }\n }\n throw 'not found!';\n },\n\n\n /**\n * AJAX JSON request shortcut method\n * It provides a more convenient way to do an AJAX request and expect a JSON response.It also offers a callback option, as third parameter, for better async handling.\n *\n * @method ajaxJSON\n * @static\n * @async\n * @param {String} endpoint Valid URL to be used as target by the request.\n * @param {Object} params This field is used in the thrown Exception to identify the parameter.\n * @param {Function} cb Callback for the request.\n * @example\n * // In case there are several .myInput, it will retrieve the first found\n * var el = Ink.UI.Common.elOrSelector('.myInput','My Input');\n */\n ajaxJSON: function(endpoint, params, cb) {\n new Ajax(\n endpoint,\n {\n evalJS: 'force',\n method: 'POST',\n parameters: params,\n\n onSuccess: function( r) {\n try {\n r = r.responseJSON;\n if (r.status !== 'ok') {\n throw 'server error: ' + r.message;\n }\n cb(null, r);\n } catch (ex) {\n cb(ex);\n }\n },\n\n onFailure: function() {\n cb('communication failure');\n }\n }\n );\n },\n\n\n /**\n * Gets the current Ink layout.\n *\n * @method currentLayout\n * @static\n * @return {String} A string representation of the current layout name.\n * @example\n * var inkLayout = Ink.UI.Common.currentLayout();\n * if (inkLayout === 'small') {\n * // ...\n * }\n */\n currentLayout: function() {\n var i, f, k, v, el, detectorEl = Selector.select('#ink-layout-detector')[0];\n if (!detectorEl) {\n detectorEl = document.createElement('div');\n detectorEl.id = 'ink-layout-detector';\n for (k in this.Layouts) {\n if (this.Layouts.hasOwnProperty(k)) {\n v = this.Layouts[k];\n el = document.createElement('div');\n el.className = 'show-' + v + ' hide-all';\n el.setAttribute('data-ink-layout', v);\n detectorEl.appendChild(el);\n }\n }\n document.body.appendChild(detectorEl);\n }\n\n for (i = 0, f = detectorEl.children.length; i < f; ++i) {\n el = detectorEl.children[i];\n if (Css.getStyle(el, 'display') === 'block') {\n return el.getAttribute('data-ink-layout');\n }\n }\n\n return 'large';\n },\n\n\n /**\n * Sets the location's hash (window.location.hash).\n *\n * @method hashSet\n * @static\n * @param {Object} o Object with the info to be placed in the location's hash.\n * @example\n * // It will set the location's hash like: #key1=value1&key2=value2&key3=value3\n * Ink.UI.Common.hashSet({\n * key1: 'value1',\n * key2: 'value2',\n * key3: 'value3'\n * });\n */\n hashSet: function(o) {\n if (typeof o !== 'object') { throw new TypeError('o should be an object!'); }\n var hashParams = Url.getAnchorString();\n hashParams = Ink.extendObj(hashParams, o);\n window.location.hash = Url.genQueryString('', hashParams).substring(1);\n },\n\n /**\n * Removes children nodes from a given object.\n * This method was initially created to help solve a problem in Internet Explorer(s) that occurred when trying to set the innerHTML of some specific elements like 'table'.\n *\n * @method cleanChildren\n * @static\n * @param {DOMElement} parentEl Valid DOM Element\n * @example\n * \n *
      \n *
    • One
    • \n *
    • Two
    • \n *
    • Three
    • \n *
    • Four
    • \n *
    \n *\n * \n *\n * \n *
      \n */\n cleanChildren: function(parentEl) {\n if( !Common.isDOMElement(parentEl) ){\n throw 'Please provide a valid DOMElement';\n }\n var prevEl, el = parentEl.lastChild;\n while (el) {\n prevEl = el.previousSibling;\n parentEl.removeChild(el);\n el = prevEl;\n }\n },\n\n /**\n * Stores the id and/or classes of an element in an object.\n *\n * @method storeIdAndClasses\n * @static\n * @param {DOMElement} fromEl Valid DOM Element to get the id and classes from.\n * @param {Object} inObj Object where the id and classes will be saved.\n * @example\n *
      \n *\n * \n */\n storeIdAndClasses: function(fromEl, inObj) {\n if( !Common.isDOMElement(fromEl) ){\n throw 'Please provide a valid DOMElement as first parameter';\n }\n\n var id = fromEl.id;\n if (id) {\n inObj._id = id;\n }\n\n var classes = fromEl.className;\n if (classes) {\n inObj._classes = classes;\n }\n },\n\n /**\n * Sets the id and className properties of an element based \n *\n * @method restoreIdAndClasses\n * @static\n * @param {DOMElement} toEl Valid DOM Element to set the id and classes on.\n * @param {Object} inObj Object where the id and classes to be set are. This method uses the same format as the one given in `storeIdAndClasses`\n * @example\n *
      \n *\n * \n *\n * \n *
      \n */\n restoreIdAndClasses: function(toEl, inObj) {\n\n if( !Common.isDOMElement(toEl) ){\n throw 'Please provide a valid DOMElement as first parameter';\n }\n\n if (inObj._id && toEl.id !== inObj._id) {\n toEl.id = inObj._id;\n }\n\n if (inObj._classes && toEl.className.indexOf(inObj._classes) === -1) {\n if (toEl.className) { toEl.className += ' ' + inObj._classes; }\n else { toEl.className = inObj._classes; }\n }\n\n if (inObj._instanceId && !toEl.getAttribute('data-instance')) {\n toEl.setAttribute('data-instance', inObj._instanceId);\n }\n },\n\n _warnDoubleInstantiation: function (elm, newInstance) {\n var instances = Common.getInstance(elm);\n\n if (getName(newInstance) === '') { return; }\n if (!instances) { return; }\n\n var nameWithoutVersion = getName(newInstance);\n\n if (!nameWithoutVersion) { return; }\n\n for (var i = 0, len = instances.length; i < len; i++) {\n if (nameWithoutVersion === getName(instances[i])) {\n // Yes, I am using + to concatenate and , to split\n // arguments.\n //\n // Elements can't be concatenated with strings, but if\n // they are passed in an argument, modern debuggers will\n // pretty-print them and make it easy to find them in the\n // element inspector.\n //\n // On the other hand, if strings are passed as different\n // arguments, they get pretty printed. And the pretty\n // print of a string has quotes around it.\n //\n // If some day people find out that strings are not\n // just text and they start preserving contextual\n // information, then by all means change this to a\n // regular concatenation.\n //\n // But they won't. So don't change this.\n Ink.warn('Creating more than one ' + nameWithoutVersion + '.',\n '(Was creating a ' + nameWithoutVersion + ' on:', elm, ').');\n return false;\n }\n }\n\n function getName(thing) {\n return ((thing.constructor && (thing.constructor._name)) ||\n thing._name ||\n '').replace(/_.*?$/, '');\n }\n\n return true;\n },\n\n /**\n * Saves a component's instance reference for later retrieval.\n *\n * @method registerInstance\n * @static\n * @param {Object} inst Object that holds the instance.\n * @param {DOMElement} el DOM Element to associate with the object.\n */\n registerInstance: function(inst, el) {\n if (!inst) { return; }\n\n if (!Common.isDOMElement(el)) { throw new TypeError('Ink.UI.Common.registerInstance: The element passed in is not a DOM element!'); }\n\n // [todo] this belongs in the BaseUIComponent's initialization\n if (Common._warnDoubleInstantiation(el, inst) === false) {\n return false;\n }\n\n var instances = domRegistry.get(el);\n\n if (!instances) {\n instances = [];\n domRegistry.set(el, instances);\n }\n\n instances.push(inst);\n\n return true;\n },\n\n /**\n * Deletes an instance with a given id.\n *\n * @method unregisterInstance\n * @static\n * @param {String} id Id of the instance to be destroyed.\n */\n unregisterInstance: function(inst) {\n if (!inst || !inst._element) { return; }\n var instances = domRegistry.get(inst._element);\n for (var i = 0, len = instances.length; i < len; i++) {\n if (instances[i] === inst) {\n instances.splice(i, 1);\n }\n }\n },\n\n /**\n * Gets an UI instance from an element or instance id.\n *\n * @method getInstance\n * @static\n * @param {String|DOMElement} el DOM Element from which we want the instances.\n * @return {Object|Array} Returns an instance or a collection of instances.\n */\n getInstance: function(el, UIComponent) {\n el = Common.elOrSelector(el);\n var instances = domRegistry.get(el);\n\n if (!instances) {\n instances = [];\n }\n\n if (typeof UIComponent !== 'function') {\n return instances;\n }\n\n for (var i = 0, len = instances.length; i < len; i++) {\n if (instances[i] instanceof UIComponent) {\n return instances[i];\n }\n }\n\n return null;\n },\n\n /**\n * Gets an instance based on a selector.\n *\n * @method getInstanceFromSelector\n * @static\n * @param {String} selector CSS selector to get the instances from.\n * @return {Object|Array} Returns an instance or a collection of instances.\n */\n getInstanceFromSelector: function(selector) {\n return Common.getInstance(Common.elOrSelector(selector));\n },\n\n /**\n * Gets all the instance ids\n *\n * @method getInstanceIds\n * @static\n * @return {Array} Collection of instance ids\n */\n getInstanceIds: function() {\n var res = [];\n for (var id in instances) {\n if (instances.hasOwnProperty(id)) {\n res.push( id );\n }\n }\n return res;\n },\n\n /**\n * Gets all the instances\n *\n * @method getInstances\n * @static\n * @return {Array} Collection of existing instances.\n */\n getInstances: function() {\n var res = [];\n for (var id in instances) {\n if (instances.hasOwnProperty(id)) {\n res.push( instances[id] );\n }\n }\n return res;\n },\n\n /**\n * Boilerplate method to destroy a component.\n * Components should copy this method as its destroy method and modify it.\n *\n * @method destroyComponent\n * @static\n */\n destroyComponent: function() {\n Common.unregisterInstance(this);\n this._element.parentNode.removeChild(this._element);\n }\n\n };\n\n\n\n\n /**\n * Ink UI Base Class\n **/\n\n function warnStub() {\n /* jshint validthis: true */\n if (!this || this === window || typeof this.constructor !== 'function') { return; }\n Ink.warn('You called a method on an incorrectly instantiated ' + this.constructor._name + ' component. Check the warnings above to see what went wrong.');\n }\n\n function stub(prototype, obj) {\n for (var k in prototype) if (prototype.hasOwnProperty(k)) {\n if (k === 'constructor') { continue; }\n if (typeof obj[k] === 'function') {\n obj[k] = warnStub;\n }\n }\n }\n\n /**\n * Ink UI Base Class\n *\n * You don't use this class directly, or inherit from it directly.\n *\n * See createUIComponent() (in this module) for how to create a UI component and inherit from this. It's not plain old JS inheritance, for several reasons.\n *\n * @class Ink.UI.Common.BaseUIComponent\n * @constructor\n *\n * @param element\n * @param options\n **/\n function BaseUIComponent(element, options) {\n var constructor = this.constructor;\n var _name = constructor._name;\n\n if (!this || this === window) {\n throw new Error('Use \"new InkComponent()\" instead of \"InkComponent()\"');\n }\n\n if (this && !(this instanceof BaseUIComponent)) {\n throw new Error('You forgot to call Ink.UI.Common.createUIComponent() on this module!');\n }\n\n if (!element && !constructor._componentOptions.elementIsOptional) {\n Ink.error(new Error(_name + ': You need to pass an element or a selector as the first argument to \"new ' + _name + '()\"'));\n return;\n } else {\n this._element = Common.elsOrSelector(element,\n _name + ': An element with the selector \"' + element + '\" was not found!')[0];\n }\n\n if (!this._element && !constructor._componentOptions.elementIsOptional) {\n isValidInstance = false;\n Ink.error(new Error(element + ' does not match an element on the page. You need to pass a valid selector to \"new ' + _name + '\".'));\n }\n\n // TODO Change Common.options's signature? the below looks better, more manageable\n // var options = Common.options({\n // element: this._element,\n // modName: constructor._name,\n // options: constructor._optionDefinition,\n // defaults: constructor._globalDefaults\n // });\n\n this._options = Common.options(_name, constructor._optionDefinition, options, this._element);\n\n var isValidInstance = BaseUIComponent._validateInstance(this) === true;\n\n if (isValidInstance && typeof this._init === 'function') {\n try {\n this._init.apply(this, arguments);\n } catch(e) {\n isValidInstance = false;\n Ink.error(e);\n }\n }\n\n if (!isValidInstance) {\n BaseUIComponent._stubInstance(this, constructor, _name);\n } else if (this._element) {\n Common.registerInstance(this, this._element);\n }\n }\n\n /**\n * Calls the `instance`'s _validate() method so it can validate itself.\n *\n * Returns false if the method exists, was called, but no Error was returned or thrown.\n *\n * @method _validateInstance\n * @private\n */\n BaseUIComponent._validateInstance = function (instance) {\n var err;\n\n if (typeof instance._validate !== 'function') { return true; }\n\n try {\n err = instance._validate();\n } catch (e) {\n err = e;\n }\n\n if (err instanceof Error) {\n instance._validationError = err;\n return false;\n }\n\n return true;\n };\n\n\n /**\n * Replaces every method in the instance with stub functions which just call Ink.warn().\n *\n * This avoids breaking the page when there are errors.\n *\n * @method _stubInstance\n * @param instance\n * @param constructor\n * @param name\n * @private\n */\n BaseUIComponent._stubInstance = function (instance, constructor, name) {\n stub(constructor.prototype, instance);\n stub(BaseUIComponent.prototype, instance);\n Ink.warn(name + ' was not correctly created. ' + (instance._validationError || ''));\n };\n\n // TODO BaseUIComponent.setGlobalOptions = function () {}\n // TODO BaseUIComponent.createMany = function (selector) {}\n BaseUIComponent.getInstance = function (elOrSelector) {\n elOrSelector = Common.elOrSelector(elOrSelector);\n return Common.getInstance(elOrSelector, this /* get instance by constructor */);\n };\n\n Ink.extendObj(BaseUIComponent.prototype, {\n /**\n * Get an UI component's option's value.\n *\n * @method getOption\n * @param name\n *\n * @return The option value, or undefined if nothing is found.\n *\n * @example\n *\n * var myUIComponent = new Modal('#element', { trigger: '#trigger' }); // or anything else inheriting BaseUIComponent\n * myUIComponent.getOption('trigger'); // -> The trigger element (not the selector string, mind you)\n *\n **/\n getOption: function (name) {\n if (this.constructor && !(name in this.constructor._optionDefinition)) {\n Ink.error('\"' + name + '\" is not an option for ' + this.constructor._name);\n return undefined;\n }\n\n return this._options[name];\n },\n\n /**\n * Sets an option's value\n *\n * @method getOption\n * @param name\n * @param value\n *\n * @example\n *\n * var myUIComponent = new Modal(...);\n * myUIComponent.setOption('trigger', '#some-element');\n **/\n setOption: function (name, value) {\n if (this.constructor && !(name in this.constructor._optionDefinition)) {\n Ink.error('\"' + name + ' is not an option for ' + this.constructor._name);\n return;\n }\n\n this._options[name] = value;\n },\n\n /**\n * Get the element associated with an UI component (IE the one you used in the constructor)\n *\n * @method getElement\n * @return {Element} The component's element.\n *\n * @example\n * var myUIComponent = new Modal('#element'); // or anything else inheriting BaseUIComponent\n * myUIComponent.getElement(); // -> The '#element' (not the selector string, mind you).\n *\n **/\n getElement: function () {\n return this._element;\n }\n });\n\n Common.BaseUIComponent = BaseUIComponent;\n\n /**\n * @method createUIComponent\n * @param theConstructor UI component constructor. It should have an _init function in its prototype, an _optionDefinition object, and a _name property indicating its name.\n * @param options\n * @param [options.elementIsOptional=false] Whether the element argument is optional (For example, when the component might work on existing markup or create its own).\n **/\n Common.createUIComponent = function createUIComponent(theConstructor, options) {\n theConstructor._componentOptions = options || {};\n\n function assert(test, msg) {\n if (!test) {\n throw new Error('Ink.UI_1.createUIComponent: ' + msg);\n }\n }\n\n function assertProp(prop, propType, message) {\n var propVal = theConstructor[prop];\n // Check that the property was passed\n assert(typeof propVal !== 'undefined',\n theConstructor + ' doesn\\'t have a \"' + prop + '\" property. ' + message);\n // Check that its type is correct\n assert(propType && typeof propVal === propType,\n 'typeof ' + theConstructor + '.' + prop + ' is not \"' + propType + '\". ' + message);\n }\n\n assert(typeof theConstructor === 'function',\n 'constructor argument is not a function!');\n\n assertProp('_name', 'string', 'This property is used for error ' +\n 'messages. Set it to the full module path and version (Ink.My.Module_1).');\n assertProp('_optionDefinition', 'object', 'This property contains the ' +\n 'option names, types and defaults. See Ink.UI.Common.options() for reference.');\n\n // Extend the instance methods and props\n var _oldProto = theConstructor.prototype;\n\n if (typeof Object.create === 'function') {\n theConstructor.prototype = Object.create(BaseUIComponent.prototype);\n } else {\n theConstructor.prototype = (function hideF() {\n function F() {}\n F.prototype = BaseUIComponent.prototype;\n return new F();\n }());\n }\n\n Ink.extendObj(theConstructor.prototype, _oldProto);\n theConstructor.prototype.constructor = theConstructor;\n // Extend static methods\n Ink.extendObj(theConstructor, BaseUIComponent);\n };\n\n return Common;\n\n});\n","/**\n * Date selector\n * @module Ink.UI.DatePicker_1\n * @version 1\n */\n\nInk.createModule('Ink.UI.DatePicker', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1','Ink.Util.Date_1', 'Ink.Dom.Browser_1'], function(Common, Event, Css, InkElement, Selector, InkArray, InkDate ) {\n 'use strict';\n\n // Clamp a number into a min/max limit\n function clamp(n, min, max) {\n if (n > max) { n = max; }\n if (n < min) { n = min; }\n\n return n;\n }\n\n function dateishFromYMDString(YMD) {\n var split = YMD.split('-');\n return dateishFromYMD(+split[0], +split[1] - 1, +split[2]);\n }\n\n function dateishFromYMD(year, month, day) {\n return {_year: year, _month: month, _day: day};\n }\n\n function dateishFromDate(date) {\n return {_year: date.getFullYear(), _month: date.getMonth(), _day: date.getDate()};\n }\n\n /**\n * @class Ink.UI.DatePicker\n * @constructor\n * @version 1\n *\n * @param {String|DOMElement} selector\n * @param {Object} [options] Options\n * @param {Boolean} [options.autoOpen] Flag to automatically open the datepicker.\n * @param {String} [options.cleanText] Text for the clean button. Defaults to 'Clear'.\n * @param {String} [options.closeText] Text for the close button. Defaults to 'Close'.\n * @param {String} [options.cssClass] CSS class to be applied on the datepicker\n * @param {String|DOMElement} [options.pickerField] (if not using in an input[type=\"text\"]) Element which displays the DatePicker when clicked. Defaults to an \"open\" link.\n * @param {String} [options.dateRange] Enforce limits to year, month and day for the Date, ex: '1990-08-25:2020-11'\n * @param {Boolean} [options.displayInSelect] Flag to display the component in a select element.\n * @param {String|DOMElement} [options.dayField] (if using options.displayInSelect) `select` field with days.\n * @param {String|DOMElement} [options.monthField] (if using options.displayInSelect) `select` field with months.\n * @param {String|DOMElement} [options.yearField] (if using options.displayInSelect) `select` field with years.\n * @param {String} [options.format] Date format string\n * @param {Object} [options.month] Hash of month names. Defaults to portuguese month names. January is 1.\n * @param {String} [options.nextLinkText] Text for the previous button. Defaults to '«'.\n * @param {String} [options.ofText] Text to show between month and year. Defaults to ' of '.\n * @param {Boolean} [options.onFocus] If the datepicker should open when the target element is focused. Defaults to true.\n * @param {Function} [options.onMonthSelected] Callback to execute when the month is selected.\n * @param {Function} [options.onSetDate] Callback to execute when the date is set.\n * @param {Function} [options.onYearSelected] Callback to execute when the year is selected.\n * @param {String} [options.position] Position for the datepicker. Either 'right' or 'bottom'. Defaults to 'right'.\n * @param {String} [options.prevLinkText] Text for the previous button. Defaults to '«'.\n * @param {Boolean} [options.showClean] If the clean button should be visible. Defaults to true.\n * @param {Boolean} [options.showClose] If the close button should be visible. Defaults to true.\n * @param {Boolean} [options.shy] If the datepicker should start automatically. Defaults to true.\n * @param {String} [options.startDate] Date to define initial month. Must be in yyyy-mm-dd format.\n * @param {Number} [options.startWeekDay] First day of the week. Sunday is zero. Defaults to 1 (Monday).\n * @param {Function} [options.validYearFn] Callback to execute when 'rendering' the month (in the month view)\n * @param {Function} [options.validMonthFn] Callback to execute when 'rendering' the month (in the month view)\n * @param {Function} [options.validDayFn] Callback to execute when 'rendering' the day (in the month view)\n * @param {Function} [options.nextValidDateFn] Function to calculate the next valid date, given the current. Useful when there's invalid dates or time frames.\n * @param {Function} [options.prevValidDateFn] Function to calculate the previous valid date, given the current. Useful when there's invalid dates or time frames.\n * @param {Object} [options.wDay] Hash of week day names. Sunday is 0. Defaults to { 0:'Sunday', 1:'Monday', etc...\n * @param {String} [options.yearRange] Enforce limits to year for the Date, ex: '1990:2020' (deprecated)\n *\n * @sample Ink_UI_DatePicker_1.html\n */\n var DatePicker = function() {\n Common.BaseUIComponent.apply(this, arguments);\n };\n\n DatePicker._name = 'DatePicker_1';\n\n DatePicker._optionDefinition = {\n autoOpen: ['Boolean', false],\n cleanText: ['String', 'Clear'],\n closeText: ['String', 'Close'],\n pickerField: ['Element', null],\n containerElement:['Element', null],\n cssClass: ['String', 'ink-calendar bottom'],\n dateRange: ['String', null],\n \n // use this in a \n *\n * By applying this UI class to the above input, you get a tag field with the tags \"initial\" and \"value\". The class preserves the original input element. It remains hidden and is updated with new tag information dynamically, so regular HTML form logic still applies.\n *\n * Below \"input\" refers to the current value of the input tag (updated as the user enters text, of course), and \"output\" refers to the value which this class writes back to said input tag.\n *\n * @class Ink.UI.TagField\n * @version 1\n * @constructor\n * @param {String|DOMElement} element Selector or DOM Input Element.\n * @param {Object} [options] Options object\n * @param {String|Array} [options.tags] Initial tags in the input\n * @param {Boolean} [options.allowRepeated] Flag to allow user to input several tags. Defaults to true.\n * @param {RegExp} [options.separator] Split the input by this RegExp. Defaults to /[,;(space)]+/g (spaces, commas and semicolons)\n * @param {String} [options.outSeparator] Use this string to separate each tag from the next in the output. Defaults to ','.\n * @param {Boolean} [options.autoSplit] Flag to activate tag creation when the user types a separator. Defaults to true.\n * @param {Integer} [options.maxTags] Maximum number of tags allowed. Set to -1 for no limit. Defaults to -1.\n * @example\n */\n function TagField() {\n Common.BaseUIComponent.apply(this, arguments);\n }\n\n TagField._name = 'TagField_1';\n\n TagField._optionDefinition = {\n tags: ['String', []],\n tagQuery: ['Object', null],\n tagQueryAsync: ['Object', null],\n allowRepeated: ['Boolean', false],\n maxTags: ['Integer', -1],\n outSeparator: ['String', ','],\n separator: ['String', /[,; ]+/g],\n autoSplit: ['Boolean', true]\n };\n\n TagField.prototype = {\n /**\n * Init function called by the constructor\n * \n * @method _init\n * @private\n */\n _init: function() {\n var o = this._options;\n if (typeof o.separator === 'string') {\n o.separator = new RegExp(o.separator, 'g');\n }\n\n if (typeof o.tags === 'string') {\n // coerce to array using the separator\n o.tags = this._readInput(o.tags);\n }\n\n Css.addClassName(this._element, 'hide-all');\n\n this._viewElm = InkElement.create('div', {\n className: 'ink-tagfield',\n insertAfter: this._element\n });\n\n this._input = InkElement.create('input', {\n type: 'text',\n className: 'new-tag-input',\n insertBottom: this._viewElm\n });\n\n var tags = [].concat(o.tags, this._tagsFromMarkup(this._element));\n\n this._tags = [];\n\n InkArray.each(tags, Ink.bindMethod(this, '_addTag'));\n\n InkEvent.observe(this._input, 'keyup', Ink.bindEvent(this._onKeyUp, this));\n InkEvent.observe(this._input, 'change', Ink.bindEvent(this._onKeyUp, this));\n InkEvent.observe(this._input, 'keydown', Ink.bindEvent(this._onKeyDown, this));\n InkEvent.observe(this._input, 'blur', Ink.bindEvent(this._onBlur, this));\n InkEvent.observe(this._viewElm, 'click', Ink.bindEvent(this._refocus, this));\n },\n\n destroy: function () {\n InkElement.remove(this._viewElm);\n Css.removeClassName(this._element, 'hide-all');\n },\n\n _tagsFromMarkup: function (element) {\n var tagname = element.tagName.toLowerCase();\n if (tagname === 'input') {\n return this._readInput(element.value);\n } else if (tagname === 'select') {\n return InkArray.map(element.getElementsByTagName('option'), function (option) {\n return InkElement.textContent(option);\n });\n } else {\n throw new Error('Cannot read tags from a ' + tagname + ' tag. Unknown tag');\n }\n },\n\n _tagsToMarkup: function (tags, element) {\n var tagname = element.tagName.toLowerCase();\n if (tagname === 'input') {\n if (this._options.separator) {\n element.value = tags.join(this._options.outSeparator);\n }\n } else if (tagname === 'select') {\n element.innerHTML = '';\n InkArray.each(tags, function (tag) {\n var opt = InkElement.create('option', {selected: 'selected'});\n InkElement.setTextContent(opt, tag);\n element.appendChild(opt);\n });\n } else {\n throw new Error('TagField: Cannot read tags from a ' + tagname + ' tag. Unknown tag');\n }\n },\n\n _addTag: function (tag) {\n if (this._options.maxTags !== -1 &&\n this._tags.length >= this._options.maxTags) {\n return;\n }\n if ((!this._options.allowRepeated &&\n InkArray.inArray(tag, this._tags, tag)) || !tag) {\n return false;\n }\n var elm = InkElement.create('span', {\n className: 'ink-tag',\n setTextContent: tag + ' '\n });\n\n var remove = InkElement.create('span', {\n className: 'remove fa fa-times',\n insertBottom: elm\n });\n InkEvent.observe(remove, 'click', Ink.bindEvent(this._removeTag, this, null));\n\n var spc = document.createTextNode(' ');\n\n this._tags.push(tag);\n this._viewElm.insertBefore(elm, this._input);\n this._viewElm.insertBefore(spc, this._input);\n this._tagsToMarkup(this._tags, this._element);\n },\n\n _readInput: function (text) {\n if (this._options.separator) {\n return InkArray.filter(text.split(this._options.separator), isTruthy);\n } else {\n return [text];\n }\n },\n\n _onKeyUp: function () { // TODO control input box size\n if (!this._options.autoSplit) {\n return;\n }\n var split = this._input.value.split(this._options.separator);\n if (split.length <= 1) {\n return;\n }\n var last = split[split.length - 1];\n split = split.splice(0, split.length - 1);\n split = InkArray.filter(split, isTruthy);\n \n InkArray.each(split, Ink.bind(this._addTag, this));\n this._input.value = last;\n },\n\n _onKeyDown: function (event) {\n if (event.which === enterKey) {\n return this._onEnterKeyDown(event);\n } else if (event.which === backspaceKey) {\n return this._onBackspaceKeyDown();\n } else if (this._removeConfirm) {\n // user pressed another key, cancel removal from a backspace key\n this._unsetRemovingVisual(this._tags.length - 1);\n }\n },\n\n /**\n * When the user presses backspace twice on the empty input, we delete the last tag on the field.\n * @method onBackspaceKeyDown\n * @private\n */\n _onBackspaceKeyDown: function () {\n if (this._input.value) { return; }\n\n if (this._removeConfirm) {\n this._unsetRemovingVisual(this._tags.length - 1);\n this._removeTag(this._tags.length - 1);\n this._removeConfirm = null;\n } else {\n this._setRemovingVisual(this._tags.length - 1);\n }\n },\n\n _onEnterKeyDown: function (event) {\n var tag = this._input.value;\n if (tag) {\n this._addTag(tag);\n this._input.value = '';\n }\n InkEvent.stopDefault(event);\n },\n\n _onBlur: function () {\n this._addTag(this._input.value);\n this._input.value = '';\n },\n\n /* For when the user presses backspace.\n * Set the style of the tag so that it seems like it's going to be removed\n * if they press backspace again. */\n _setRemovingVisual: function (tagIndex) {\n var elm = this._viewElm.children[tagIndex];\n if (!elm) { return; }\n\n Css.addClassName(elm, 'tag-deleting');\n\n this._removeRemovingVisualTimeout = setTimeout(Ink.bindMethod(this, '_unsetRemovingVisual', tagIndex), 4000);\n InkEvent.observe(this._input, 'blur', Ink.bindMethod(this, '_unsetRemovingVisual', tagIndex));\n this._removeConfirm = true;\n },\n _unsetRemovingVisual: function (tagIndex) {\n var elm = this._viewElm.children[tagIndex];\n if (elm) {\n Css.removeClassName(elm, 'tag-deleting');\n clearTimeout(this._removeRemovingVisualTimeout);\n }\n this._removeConfirm = null;\n },\n\n _removeTag: function (event) {\n var index;\n if (typeof event === 'object') { // click event on close button\n var elm = InkEvent.element(event).parentNode;\n index = InkElement.parentIndexOf(this._viewElm, elm);\n } else if (typeof event === 'number') { // manual removal\n index = event;\n }\n this._tags = InkArray.remove(this._tags, index, 1);\n InkElement.remove(this._viewElm.children[index]);\n this._tagsToMarkup(this._tags, this._element);\n },\n\n _refocus: function (event) {\n this._input.focus();\n InkEvent.stop(event);\n return false;\n }\n };\n\n Common.createUIComponent(TagField);\n\n return TagField;\n});\n","/**\n * Toggle the visibility of elements.\n * @module Ink.UI.Toggle_1\n * @version 1\n */\n\n Ink.createModule('Ink.UI.Toggle', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, InkEvent, Css, InkElement, Selector, InkArray ) {\n 'use strict';\n\n /**\n *\n * You need two elements to use Toggle: the `trigger` element, and the `target` element (or elements). The default behaviour is to toggle the `target`(s) when you click the `trigger`.\n *\n * The toggle has a state. It is either \"on\" or \"off\". It works by switching between the CSS classes in `classNameOn` and `classNameOff` according to the current state.\n *\n * When you initialize the Toggle, it will check if the targets are visible to figure out what the initial state is. You can force the toggle to consider itself turned \"on\" or \"off\" by setting the `initialState` option to `true` or `false`, respectively.\n *\n * You can get the current state of the Toggle by calling `getState`, or by checking if your `trigger` element has the \"active\" class.\n * The state can be changed through JavaScript. Just call `setState(true)` \n * to turn the Toggle on (or `setState(false)` to turn it off).\n *\n * @class Ink.UI.Toggle\n * @constructor\n * @version 1\n * @param {String|DOMElement} selector Trigger element. By clicking this, the target (or targets) are triggered.\n * @param {Object} [options] Options object, containing:\n *\n * @param {String} options.target CSS Selector that specifies the elements that this component will toggle\n * @param {String} [options.classNameOn] CSS class to toggle when on. Defaults to 'show-all'.\n * @param {String} [options.classNameOff] CSS class to toggle when off. Defaults to 'hide-all'.\n * @param {String} [options.triggerEvent] Event that will trigger the toggling. Defaults to 'click'.\n * @param {Boolean} [options.closeOnClick] Flag to toggle the targe off when clicking outside the toggled content. Defaults to true.\n * @param {String} [options.closeOnInsideClick] Toggle off when a child element matching this selector is clicked. Set to null to deactivate the check. Defaults to 'a[href]'.\n * @param {Boolean} [options.initialState] Flag to define initial state. false: off, true: on, null: markup. Defaults to null.\n * @param {Function} [options.onChangeState] Callback when the toggle state changes. Return `false` to cancel the event.\n *\n * @sample Ink_UI_Toggle_1_constructor.html\n */\n function Toggle(){\n Common.BaseUIComponent.apply(this, arguments);\n }\n\n Toggle._name = 'Toggle_1';\n\n Toggle._optionDefinition = {\n target: ['Elements'],\n triggerEvent: ['String', 'click'],\n closeOnClick: ['Boolean', true],\n isAccordion: ['Boolean', false],\n initialState: ['Boolean', null], // May be true, false, or null to be what it is right now\n classNameOn: ['String', 'show-all'],\n classNameOff: ['String', 'hide-all'],\n closeOnInsideClick: ['String', 'a[href]'], // closes the toggle when a target is clicked and it is a link\n onChangeState: ['Function', null]\n };\n\n Toggle.prototype = {\n\n /**\n * Init function called by the constructor\n * \n * @method _init\n * @private\n */\n _init: function(){\n var i, len;\n\n this._targets = Common.elsOrSelector(this._options.target);\n\n // Boolean option handling\n this._options.closeOnClick = this._options.closeOnClick.toString() === 'true';\n // Actually a throolean\n if (this._options.initialState !== null){\n this._options.initialState = this._options.initialState.toString() === 'true';\n } else {\n this._options.initialState = Css.getStyle(this._targets[0], 'display') !== 'none';\n }\n\n if (this._options.classNameOn !== 'show-all' || this._options.classNameOff !== 'hide-all') {\n for (i = 0, len = this._targets.length; i < len; i++) {\n Css.removeClassName(this._targets[i], 'show-all');\n Css.removeClassName(this._targets[i], 'hide-all');\n }\n }\n\n this._accordion = ( Css.hasClassName(this._element.parentNode,'accordion') || Css.hasClassName(this._targets[0].parentNode,'accordion') );\n\n this._firstTime = true;\n\n this._bindEvents();\n\n if (this._options.initialState !== null) {\n this.setState(this._options.initialState, true);\n } else {\n // Add initial classes matching the current \"display\" of the object.\n var state = Css.getStyle(this._targets[0], 'display') !== 'none';\n this.setState(state, true);\n }\n // Aditionally, remove any inline \"display\" style.\n for (i = 0, len = this._targets.length; i < len; i++) {\n if (this._targets[i].style.display) {\n this._targets[i].style.display = ''; // becomes default\n }\n }\n\n this._element.setAttribute('data-is-toggle-trigger', 'true');\n },\n\n /**\n * @method _bindEvents\n * @private\n */\n _bindEvents: function () {\n if ( this._options.triggerEvent ) {\n InkEvent.observe(\n this._element,\n this._options.triggerEvent,\n Ink.bind(this._onTriggerEvent, this));\n }\n if( this._options.closeOnClick ){\n InkEvent.observe( document, 'click', Ink.bind(this._onOutsideClick, this));\n }\n if( this._options.closeOnInsideClick && this._options.closeOnInsideClick !== 'false') {\n var sel = this._options.closeOnInsideClick;\n if (sel.toString() === 'true') {\n sel = '*';\n }\n InkEvent.observeMulti(this._targets, 'click', Ink.bind(function (e) {\n if ( InkElement.findUpwardsBySelector(InkEvent.element(e), sel) ) {\n this.setState(false, true);\n }\n }, this));\n }\n },\n\n /**\n * Event handler. It's responsible for handling the `triggerEvent` as defined in the options.\n *\n * This will trigger the toggle.\n * \n * @method _onTriggerEvent\n * @param {Event} event\n * @private\n */\n _onTriggerEvent: function( event ){\n // When the togglee is a child of the toggler, we get the togglee's events here. We have to check that this event is for us.\n var target = InkEvent.element(event);\n\n var isAncestorOfClickedElement = InkArray.some(this._targets, function (thisOne) {\n return thisOne === target || InkElement.isAncestorOf(thisOne, target);\n });\n\n if (isAncestorOfClickedElement) {\n return;\n }\n\n if (this._accordion) {\n this._updateAccordion();\n }\n\n var has = this.getState();\n this.setState(!has, true);\n if (!has && this._firstTime) {\n this._firstTime = false;\n }\n\n InkEvent.stopDefault(event);\n },\n\n /**\n * Be compatible with accordions\n *\n * @method _updateAccordion\n **/\n _updateAccordion: function () {\n var elms, accordionElement;\n if( Css.hasClassName(this._targets[0].parentNode,'accordion') ){\n accordionElement = this._targets[0].parentNode;\n } else {\n accordionElement = this._targets[0].parentNode.parentNode;\n }\n elms = Selector.select('.toggle, .ink-toggle',accordionElement);\n for(var i=0; i 0) && (targetElm[0] !== this._targets[0]) ){\n targetElm[0].style.display = 'none';\n }\n }\n },\n\n /**\n * Click handler. Will handle clicks outside the toggle component.\n * \n * @method _onOutsideClick\n * @param {Event} event\n * @private\n */\n _onOutsideClick: function( event ){\n var tgtEl = InkEvent.element(event),\n shades;\n\n if (InkElement.findUpwardsBySelector(tgtEl, '[data-is-toggle-trigger=\"true\"]')) return;\n\n var ancestorOfTargets = InkArray.some(this._targets, function (target) {\n return InkElement.isAncestorOf(target, tgtEl) || target === tgtEl;\n });\n\n if( (this._element === tgtEl) || InkElement.isAncestorOf(this._element, tgtEl) || ancestorOfTargets) {\n return;\n } else if( (shades = Ink.ss('.ink-shade')).length ) {\n var shadesLength = shades.length;\n\n for( var i = 0; i < shadesLength; i++ ){\n if( InkElement.isAncestorOf(shades[i],tgtEl) && InkElement.isAncestorOf(shades[i],this._element) ){\n return;\n }\n }\n }\n\n this.setState(false, true); // dismiss\n },\n\n /**\n * Sets the state of the toggle. (on/off)\n *\n * @method setState\n * @param newState {Boolean} New state (on/off)\n */\n setState: function (on, callHandler) {\n if (on === this.getState()) { return; }\n if (callHandler && typeof this._options.onChangeState === 'function') {\n var ret = this._options.onChangeState(on);\n if (ret === false) { return false; } // Canceled by the event handler\n }\n for (var i = 0, len = this._targets.length; i < len; i++) {\n Css.addRemoveClassName(this._targets[i], this._options.classNameOn, on);\n Css.addRemoveClassName(this._targets[i], this._options.classNameOff, !on);\n }\n Css.addRemoveClassName(this._element, 'active', on);\n },\n\n /**\n * Gets the state of the toggle. (on/off)\n *\n * @method getState\n *\n * @return {Boolean} whether the toggle is toggled on.\n */\n getState: function () {\n return Css.hasClassName(this._element, 'active');\n }\n };\n\n Common.createUIComponent(Toggle);\n\n return Toggle;\n});\n","/**\n * Content Tooltips\n * @module Ink.UI.Tooltip_1\n * @version 1\n */\nInk.createModule('Ink.UI.Tooltip', '1', ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Element_1', 'Ink.Dom.Selector_1', 'Ink.Util.Array_1', 'Ink.Dom.Css_1', 'Ink.Dom.Browser_1'], function (Common, InkEvent, InkElement, Selector, InkArray, Css) {\n 'use strict';\n\n /**\n * Tooltips are useful as a means to display information about functionality while avoiding clutter.\n *\n * Tooltips show up when you hover elements which \"have\" tooltips.\n *\n * This class will \"give\" a tooltip to many elements, selected by its first argument (`target`). This is contrary to the other UI modules in Ink, which are created once per element.\n *\n * You can define options either through the second argument of the Tooltip constructor, or as data-attributes in each `target` element. Options set through data-attributes all start with \"data-tip\", and override options passed into the Tooltip constructor.\n *\n * @class Ink.UI.Tooltip\n * @constructor\n *\n * @param {DOMElement|String} target Target element or selector of elements, to display the tooltips on.\n * @param {Object} [options] Options object\n * @param {String} [options.text] Text content for the tooltip.\n * @param {String} [options.html] HTML for the tooltip. Same as above, but won't escape HTML.\n * @param {String} [options.where] Positioning for the tooltip. Options are 'up', 'down', 'left', 'right', 'mousemove' (follows the cursor), and 'mousefix' (stays fixed). Defaults to 'up'.\n * \n * @param {String} [options.color] Color of the tooltip. Options are red, orange, blue, green and black. Default is white.\n * @param {Number} [options.fade] Number of seconds to fade in/out. Defaults to 0.3.\n * @param {Boolean} [options.forever] Flag to prevent the tooltip from being erased when the mouse hovers away from the target.\n * @param {Number} [options.timeout] Number of seconds the tooltip will stay open. Useful together with options.forever. Defaults to 0.\n * @param {Number} [options.delay] Time the tooltip waits until it is displayed. Useful to avoid getting the attention of the user unnecessarily\n * @param {DOMElement|Selector} [options.template] Element or selector containing HTML to be cloned into the tooltips. Can be a hidden element, because CSS `display` is set to `block`.\n * @param {String} [options.templatefield] Selector within the template element to choose where the text is inserted into the tooltip. Useful when a wrapper DIV is required.\n * @param {Number} [options.left] Spacing from the target to the tooltip, when `where` is `mousemove` or `mousefix`. Defaults to 10.\n * @param {Number} [options.top] Spacing from the target to the tooltip, when `where` is `mousemove` or `mousefix`. Defaults to 10.\n * @param {Number} [options.spacing] Spacing between the tooltip and the target element, when `where` is not `mousemove` or `mousefix`. Defaults to 8.\n * \n * @sample Ink_UI_Tooltip_1.html\n */\n function Tooltip(element, options) {\n this._init(element, options || {});\n }\n\n function EachTooltip(root, elm) {\n this._init(root, elm);\n }\n\n var transitionDurationName,\n transitionPropertyName,\n transitionTimingFunctionName;\n (function () { // Feature detection\n var test = document.createElement('DIV');\n var names = ['transition', 'oTransition', 'msTransition', 'mozTransition',\n 'webkitTransition'];\n for (var i = 0; i < names.length; i++) {\n if (typeof test.style[names[i] + 'Duration'] !== 'undefined') {\n transitionDurationName = names[i] + 'Duration';\n transitionPropertyName = names[i] + 'Property';\n transitionTimingFunctionName = names[i] + 'TimingFunction';\n break;\n }\n }\n }());\n\n // Body or documentElement\n var bodies = document.getElementsByTagName('body');\n var body = bodies.length ? bodies[0] : document.documentElement;\n\n Tooltip.prototype = {\n _init: function(element, options) {\n var elements;\n\n this.options = Ink.extendObj({\n where: 'up',\n zIndex: 10000,\n left: 10,\n top: 10,\n spacing: 8,\n forever: 0,\n color: '',\n timeout: 0,\n delay: 0,\n template: null,\n templatefield: null,\n fade: 0.3,\n text: ''\n }, options || {});\n\n if (typeof element === 'string') {\n elements = Selector.select(element);\n } else if (typeof element === 'object') {\n elements = [element];\n } else {\n throw 'Element expected';\n }\n\n this.tooltips = [];\n\n for (var i = 0, len = elements.length; i < len; i++) {\n this.tooltips[i] = new EachTooltip(this, elements[i]);\n }\n },\n /**\n * Destroys the tooltips created by this instance\n *\n * @method destroy\n */\n destroy: function () {\n InkArray.each(this.tooltips, function (tooltip) {\n tooltip._destroy();\n });\n this.tooltips = null;\n this.options = null;\n }\n };\n\n EachTooltip.prototype = {\n _oppositeDirections: {\n left: 'right',\n right: 'left',\n up: 'down',\n down: 'up'\n },\n _init: function(root, elm) {\n InkEvent.observe(elm, 'mouseover', Ink.bindEvent(this._onMouseOver, this));\n InkEvent.observe(elm, 'mouseout', Ink.bindEvent(this._onMouseOut, this));\n InkEvent.observe(elm, 'mousemove', Ink.bindEvent(this._onMouseMove, this));\n\n this.root = root;\n this.element = elm;\n this._delayTimeout = null;\n this.tooltip = null;\n\n Common.registerInstance(this, this.element);\n },\n _makeTooltip: function (mousePosition) {\n if (!this._getOpt('text') &&\n !this._getOpt('html') &&\n !InkElement.hasAttribute(this.element, 'title')) {\n return false;\n }\n\n var tooltip = this._createTooltipElement();\n\n if (this.tooltip) {\n this._removeTooltip();\n }\n\n this.tooltip = tooltip;\n\n this._fadeInTooltipElement(tooltip);\n this._placeTooltipElement(tooltip, mousePosition);\n\n InkEvent.observe(tooltip, 'mouseover', Ink.bindEvent(this._onTooltipMouseOver, this));\n\n var timeout = this._getFloatOpt('timeout');\n if (timeout) {\n setTimeout(Ink.bind(function () {\n if (this.tooltip === tooltip) {\n this._removeTooltip();\n }\n }, this), timeout * 1000);\n }\n },\n _createTooltipElement: function () {\n var template = this._getOpt('template'), // User template instead of our HTML\n templatefield = this._getOpt('templatefield'),\n \n tooltip, // The element we float\n field; // Element where we write our message. Child or same as the above\n\n if (template) { // The user told us of a template to use. We copy it.\n var temp = document.createElement('DIV');\n temp.innerHTML = Common.elOrSelector(template, 'options.template').outerHTML;\n tooltip = temp.firstChild;\n \n if (templatefield) {\n field = Selector.select(templatefield, tooltip);\n if (field) {\n field = field[0];\n } else {\n throw 'options.templatefield must be a valid selector within options.template';\n }\n } else {\n field = tooltip; // Assume same element if user did not specify a field\n }\n } else { // We create the default structure\n tooltip = document.createElement('DIV');\n Css.addClassName(tooltip, 'ink-tooltip');\n Css.addClassName(tooltip, this._getOpt('color'));\n\n field = document.createElement('DIV');\n Css.addClassName(field, 'content');\n\n tooltip.appendChild(field);\n }\n \n if (this._getOpt('html')) {\n field.innerHTML = this._getOpt('html');\n } else if (this._getOpt('text')) {\n InkElement.setTextContent(field, this._getOpt('text'));\n } else {\n InkElement.setTextContent(field, this.element.getAttribute('title'));\n }\n tooltip.style.display = 'block';\n tooltip.style.position = 'absolute';\n tooltip.style.zIndex = this._getIntOpt('zIndex');\n\n return tooltip;\n },\n _fadeInTooltipElement: function (tooltip) {\n var fadeTime = this._getFloatOpt('fade');\n if (transitionDurationName && fadeTime) {\n tooltip.style.opacity = '0';\n tooltip.style[transitionDurationName] = fadeTime + 's';\n tooltip.style[transitionPropertyName] = 'opacity';\n tooltip.style[transitionTimingFunctionName] = 'ease-in-out';\n setTimeout(function () {\n tooltip.style.opacity = '1';\n }, 0); // Wait a tick\n }\n },\n _placeTooltipElement: function (tooltip, mousePosition) {\n var where = this._getOpt('where');\n\n if (where === 'mousemove' || where === 'mousefix') {\n var mPos = mousePosition;\n this._setPos(mPos[0], mPos[1]);\n body.appendChild(tooltip);\n } else if (where.match(/(up|down|left|right)/)) {\n body.appendChild(tooltip);\n var targetElementPos = InkElement.offset(this.element);\n var tleft = targetElementPos[0],\n ttop = targetElementPos[1];\n\n var centerh = (InkElement.elementWidth(this.element) / 2) - (InkElement.elementWidth(tooltip) / 2),\n centerv = (InkElement.elementHeight(this.element) / 2) - (InkElement.elementHeight(tooltip) / 2);\n var spacing = this._getIntOpt('spacing');\n\n var tooltipDims = InkElement.elementDimensions(tooltip);\n var elementDims = InkElement.elementDimensions(this.element);\n\n var maxX = InkElement.scrollWidth() + InkElement.viewportWidth();\n var maxY = InkElement.scrollHeight() + InkElement.viewportHeight();\n \n where = this._getWhereValueInsideViewport(where, {\n left: tleft - tooltipDims[0],\n right: tleft + tooltipDims[0],\n top: ttop + tooltipDims[1],\n bottom: ttop + tooltipDims[1]\n }, {\n right: maxX,\n bottom: maxY\n });\n \n if (where === 'up') {\n ttop -= tooltipDims[1];\n ttop -= spacing;\n tleft += centerh;\n } else if (where === 'down') {\n ttop += elementDims[1];\n ttop += spacing;\n tleft += centerh;\n } else if (where === 'left') {\n tleft -= tooltipDims[0];\n tleft -= spacing;\n ttop += centerv;\n } else if (where === 'right') {\n tleft += elementDims[0];\n tleft += spacing;\n ttop += centerv;\n }\n \n var arrow = null;\n if (where.match(/(up|down|left|right)/)) {\n arrow = document.createElement('SPAN');\n Css.addClassName(arrow, 'arrow');\n Css.addClassName(arrow, this._oppositeDirections[where]);\n tooltip.appendChild(arrow);\n }\n\n var tooltipLeft = tleft;\n var tooltipTop = ttop;\n\n var toBottom = (tooltipTop + tooltipDims[1]) - maxY;\n var toRight = (tooltipLeft + tooltipDims[0]) - maxX;\n var toLeft = 0 - tooltipLeft;\n var toTop = 0 - tooltipTop;\n\n if (toBottom > 0) {\n if (arrow) { arrow.style.top = (tooltipDims[1] / 2) + toBottom + 'px'; }\n tooltipTop -= toBottom;\n } else if (toTop > 0) {\n if (arrow) { arrow.style.top = (tooltipDims[1] / 2) - toTop + 'px'; }\n tooltipTop += toTop;\n } else if (toRight > 0) {\n if (arrow) { arrow.style.left = (tooltipDims[0] / 2) + toRight + 'px'; }\n tooltipLeft -= toRight;\n } else if (toLeft > 0) {\n if (arrow) { arrow.style.left = (tooltipDims[0] / 2) - toLeft + 'px'; }\n tooltipLeft += toLeft;\n }\n\n tooltip.style.left = tooltipLeft + 'px';\n tooltip.style.top = tooltipTop + 'px';\n }\n },\n\n /**\n * Get a value for \"where\" (left/right/up/down) which doesn't put the\n * tooltip off the screen\n *\n * @method _getWhereValueInsideViewport\n * @param where {String} \"where\" value which was given by the user and we might change\n * @param bbox {BoundingBox} A bounding box like what you get from getBoundingClientRect ({top, bottom, left, right}) with pixel positions from the top left corner of the viewport.\n * @param viewport {BoundingBox} Bounding box for the viewport. \"top\" and \"left\" are omitted because these coordinates are relative to the top-left corner of the viewport so they are zero.\n *\n * @TODO: we can't use getBoundingClientRect in this case because it returns {0,0,0,0} on our uncreated tooltip.\n */\n _getWhereValueInsideViewport: function (where, bbox, viewport) {\n if (where === 'left' && bbox.left < 0) {\n return 'right';\n } else if (where === 'right' && bbox.right > viewport.right) {\n return 'left';\n } else if (where === 'up' && bbox.top < 0) {\n return 'down';\n } else if (where === 'down' && bbox.bottom > viewport.bottom) {\n return 'up';\n }\n\n return where;\n },\n _removeTooltip: function() {\n var tooltip = this.tooltip;\n if (!tooltip) {return;}\n\n var remove = Ink.bind(InkElement.remove, {}, tooltip);\n\n if (this._getOpt('where') !== 'mousemove' && transitionDurationName) {\n tooltip.style.opacity = 0;\n // remove() will operate on correct tooltip, although this.tooltip === null then\n setTimeout(remove, this._getFloatOpt('fade') * 1000);\n } else {\n remove();\n }\n this.tooltip = null;\n },\n _getOpt: function (option) {\n var dataAttrVal = InkElement.data(this.element)[InkElement._camelCase('tip-' + option)];\n if (dataAttrVal /* either null or \"\" may signify the absense of this attribute*/) {\n return dataAttrVal;\n }\n var instanceOption = this.root.options[option];\n if (typeof instanceOption !== 'undefined') {\n return instanceOption;\n }\n },\n _getIntOpt: function (option) {\n return parseInt(this._getOpt(option), 10);\n },\n _getFloatOpt: function (option) {\n return parseFloat(this._getOpt(option), 10);\n },\n _destroy: function () {\n if (this.tooltip) {\n InkElement.remove(this.tooltip);\n }\n this.root = null; // Cyclic reference = memory leaks\n this.element = null;\n this.tooltip = null;\n },\n _onMouseOver: function(e) {\n // on IE < 10 you can't access the mouse event not even a tick after it fired\n var mousePosition = this._getMousePosition(e);\n var delay = this._getFloatOpt('delay');\n if (delay) {\n this._delayTimeout = setTimeout(Ink.bind(function () {\n if (!this.tooltip) {\n this._makeTooltip(mousePosition);\n }\n this._delayTimeout = null;\n }, this), delay * 1000);\n } else {\n this._makeTooltip(mousePosition);\n }\n },\n _onMouseMove: function(e) {\n if (this._getOpt('where') === 'mousemove' && this.tooltip) {\n var mPos = this._getMousePosition(e);\n this._setPos(mPos[0], mPos[1]);\n }\n },\n _onMouseOut: function () {\n if (!this._getIntOpt('forever')) {\n this._removeTooltip();\n }\n if (this._delayTimeout) {\n clearTimeout(this._delayTimeout);\n this._delayTimeout = null;\n }\n },\n _onTooltipMouseOver: function () {\n if (this.tooltip) { // If tooltip is already being removed, this has no effect\n this._removeTooltip();\n }\n },\n _setPos: function(left, top) {\n left += this._getIntOpt('left');\n top += this._getIntOpt('top');\n var pageDims = this._getPageXY();\n if (this.tooltip) {\n var elmDims = [InkElement.elementWidth(this.tooltip), InkElement.elementHeight(this.tooltip)];\n var scrollDim = this._getScroll();\n\n if((elmDims[0] + left - scrollDim[0]) >= (pageDims[0] - 20)) {\n left = (left - elmDims[0] - this._getIntOpt('left') - 10);\n }\n if((elmDims[1] + top - scrollDim[1]) >= (pageDims[1] - 20)) {\n top = (top - elmDims[1] - this._getIntOpt('top') - 10);\n }\n\n this.tooltip.style.left = left + 'px';\n this.tooltip.style.top = top + 'px';\n }\n },\n _getPageXY: function() {\n var cWidth = 0;\n var cHeight = 0;\n if( typeof( window.innerWidth ) === 'number' ) {\n cWidth = window.innerWidth;\n cHeight = window.innerHeight;\n } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {\n cWidth = document.documentElement.clientWidth;\n cHeight = document.documentElement.clientHeight;\n } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {\n cWidth = document.body.clientWidth;\n cHeight = document.body.clientHeight;\n }\n return [parseInt(cWidth, 10), parseInt(cHeight, 10)];\n },\n _getScroll: function() {\n var dd = document.documentElement, db = document.body;\n if (dd && (dd.scrollLeft || dd.scrollTop)) {\n return [dd.scrollLeft, dd.scrollTop];\n } else if (db) {\n return [db.scrollLeft, db.scrollTop];\n } else {\n return [0, 0];\n }\n },\n _getMousePosition: function(e) {\n return [parseInt(InkEvent.pointerX(e), 10), parseInt(InkEvent.pointerY(e), 10)];\n }\n };\n\n return Tooltip;\n});\n","/**\n * Elements in a tree structure\n * @module Ink.UI.TreeView_1\n * @version 1\n */\nInk.createModule('Ink.UI.TreeView', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, Event, Css, Element, Selector, InkArray ) {\n 'use strict';\n\n\n /**\n * Shows elements in a tree structure which can be expanded and contracted.\n * A TreeView is built with \"node\"s and \"children\". \"node\"s are `li` tags, and \"children\" are `ul` tags.\n * You can build your TreeView out of a regular UL and LI element structure which you already use to display lists with several levels.\n * If you want a node to be open when the TreeView is built, just add the data-open=\"true\" attribute to it.\n * \n * @class Ink.UI.TreeView\n * @constructor\n * @version 1\n * @param {String|DOMElement} selector Element or selector.\n * @param {String} [options] Options object, containing:\n * @param {String} [options.node] Selector for the nodes. Defaults to 'li'.\n * @param {String} [options.children] Selector for the children. Defaults to 'ul'.\n * @param {String} [options.parentClass] CSS classes to be added to parent nodes. Defaults to 'parent'.\n * @param {String} [options.openClass] CSS classes to be added to the icon when a parent is open. Defaults to 'fa fa-minus-circle'.\n * @param {String} [options.closedClass] CSS classes to be added to the icon when a parent is closed. Defaults to 'fa fa-plus-circle'.\n * @param {String} [options.hideClass] CSS Class to toggle visibility of the children. Defaults to 'hide-all'.\n * @param {String} [options.iconTag] The name of icon tag. The component tries to find a tag with that name as a direct child of the node. If it doesn't find it, it creates it. Defaults to 'i'.\n * @param {Boolean} [options.stopDefault] Flag to stops the default behavior of the click handler. Defaults to true.\n * @example\n * \n * \n * \n * @sample Ink_UI_TreeView_1.html\n */\n function TreeView() {\n Common.BaseUIComponent.apply(this, arguments);\n }\n\n TreeView._name = 'TreeView_1';\n\n TreeView._optionDefinition = {\n 'node': ['String', 'li'],\n // [3.0.1] Deprecate this terrible, terrible name\n 'child': ['String',null],\n 'children': ['String','ul'],\n 'parentClass': ['String','parent'],\n 'openNodeClass': ['String', 'open'],\n 'openClass': ['String','fa fa-minus-circle'],\n 'closedClass': ['String','fa fa-plus-circle'],\n 'hideClass': ['String','hide-all'],\n 'iconTag': ['String', 'i'],\n 'stopDefault' : ['Boolean', true]\n };\n\n TreeView.prototype = {\n /**\n * Init function called by the constructor. Sets the necessary event handlers.\n * \n * @method _init\n * @private\n */\n _init: function(){\n if (this._options.child) {\n Ink.warn('Ink.UI.TreeView: options.child is being renamed to options.children.');\n this._options.children = this._options.child;\n }\n\n this._handlers = {\n click: Ink.bindEvent(this._onClick,this)\n };\n\n Event.on(this._element, 'click', this._options.node, this._handlers.click);\n\n InkArray.each(Ink.ss(this._options.node, this._element), Ink.bind(function(item){\n if( this.isParent(item) ) {\n Css.addClassName(item, this._options.parentClass);\n\n var isOpen = this.isOpen(item);\n if( !this._getIcon(item) ){\n Element.create(this._options.iconTag, { insertTop: item });\n }\n\n this._setNodeOpen(item, isOpen);\n }\n },this));\n },\n\n _getIcon: function (node) {\n return Ink.s('> ' + this._options.iconTag, node);\n },\n\n /**\n * Checks if a node is open.\n *\n * @method isOpen\n * @param {DOMElement} node The tree node to check\n **/\n isOpen: function (node) {\n if (!this._getChild(node)) {\n throw new Error('not a node!');\n }\n\n return Element.data(node).open === 'true' ||\n Css.hasClassName(node, this._options.openNodeClass);\n },\n\n /**\n * Checks if a node is a parent.\n *\n * @method isParent\n * @param {DOMElement} node Node to check\n **/\n isParent: function (node) {\n return Css.hasClassName(node, this._options.parentClass) ||\n this._getChild(node) != null;\n },\n\n _setNodeOpen: function (node, beOpen) {\n var child = this._getChild(node);\n if (child) {\n Css.setClassName(child, this._options.hideClass, !beOpen);\n var icon = this._getIcon(node);\n\n node.setAttribute('data-open', beOpen);\n\n /*\n * Don't refactor this to\n *\n * setClassName(el, className, status); setClassName(el, className, !status);\n *\n * because it won't work with multiple classes.\n *\n * Doing:\n * setClassName(el, 'fa fa-whatever', true);setClassName(el, 'fa fa-whatever-else', false);\n *\n * will remove 'fa' although it is a class we want.\n */\n\n var toAdd = beOpen ? this._options.openClass : this._options.closedClass;\n var toRemove = beOpen ? this._options.closedClass : this._options.openClass;\n Css.removeClassName(icon, toRemove);\n Css.addClassName(icon, toAdd);\n\n Css.setClassName(node, this._options.openNodeClass, beOpen);\n } else {\n Ink.error('Ink.UI.TreeView: node', node, 'is not a node!');\n }\n },\n\n /**\n * Opens one of the tree nodes\n *\n * Make sure you pass the node's DOMElement\n * @method open\n * @param {DOMElement} node The node you wish to open.\n **/\n open: function (node) {\n this._setNodeOpen(node, true);\n },\n\n /**\n * Closes one of the tree nodes\n *\n * Make sure you pass the node's DOMElement\n * @method close\n * @param {DOMElement} node The node you wish to close.\n **/\n close: function (node) {\n this._setNodeOpen(node, false);\n },\n\n /**\n * Toggles a node state\n *\n * @method toggle\n * @param {DOMElement} node The node to toggle.\n **/\n toggle: function (node) {\n if (this.isOpen(node)) {\n this.close(node);\n } else {\n this.open(node);\n }\n },\n\n _getChild: function (node) {\n return Selector.select(this._options.children, node)[0] || null;\n },\n\n /**\n * Handles the click event (as specified in the _init function).\n * \n * @method _onClick\n * @param {Event} event\n * @private\n */\n _onClick: function(ev){\n /**\n * Summary:\n * If the clicked element is a \"node\" as defined in the options, will check if it has any \"child\".\n * If so, will toggle its state and stop the event's default behavior if the stopDefault option is true.\n **/\n\n if (!this.isParent(ev.currentTarget) ||\n Selector.matchesSelector(ev.target, this._options.node) ||\n Selector.matchesSelector(ev.target, this._options.children)) {\n return;\n }\n\n if (this._options.stopDefault){\n ev.preventDefault();\n }\n\n this.toggle(ev.currentTarget);\n }\n };\n\n Common.createUIComponent(TreeView);\n\n return TreeView;\n});\n","Ink.createModule('Ink.UI.Upload', '1', [\n 'Ink.Dom.Event_1',\n 'Ink.Dom.Element_1',\n 'Ink.Dom.Browser_1',\n 'Ink.UI.Common_1'\n], function(Event, Element, Browser, Common) {\n 'use strict';\n\n var DirectoryReader = function(options) {\n this.init(options);\n };\n\n DirectoryReader.prototype = {\n init: function(options) {\n this._options = Ink.extendObj({\n entry: undefined,\n maxDepth: 10\n }, options || {});\n\n try {\n this._read();\n } catch(e) {\n Ink.error(e);\n }\n },\n\n\n _read: function() {\n if(!this._options.entry) {\n Ink.error('You must specify the entry!');\n return;\n }\n\n try {\n this._readDirectories();\n } catch(e) {\n Ink.error(e);\n }\n },\n\n\n _readDirectories: function() {\n var entries = [],\n running = false,\n maxDepth = 0;\n\n /* TODO return as tree because much better well */\n var _readEntries = Ink.bind(function(currentEntry) {\n var dir = currentEntry.createReader();\n running = true;\n\n dir.readEntries(Ink.bind(function(res) {\n if(res.length > 0) {\n for(var i = 0, len = res.length; i=0; i--) {\n if(typeof(arr[i]) === 'undefined' || arr[i] === null || arr[i] === '') {\n arr.splice(i, 1);\n }\n }\n return arr;\n }\n };\n\n var Queue = {\n lists: [],\n items: [],\n\n\n /**\n * Create new queue list\n * @function create\n * @public\n * @param {String} list name\n * @param {Function} function to iterate on items\n * @return {Object} list id\n */\n create: function(name) {\n var id;\n name = String(name);\n this.lists.push({name: name});\n id = this.lists.length - 1;\n return id;\n },\n\n\n getItems: function(parentId) {\n if(!parentId) {\n return this.items;\n }\n var items = [];\n for(var i = 0, len = this.items.length; i=0; i--) {\n if(this.items[i] && id === this.items[i].parentId) {\n this.remove(this.items[i].parentId, this.items[i].pid);\n }\n }\n if(!keepList) {\n this.lists.splice(id, 1);\n }\n return true;\n } catch(e) {\n Ink.error('Purge: invalid id');\n return false;\n }\n },\n\n\n /**\n * add an item to a list\n * @function add\n * @public\n * @param {String} name\n * @param {Object} item\n * @return {Number} pid\n */\n add: function(parentId, item, priority) {\n if(!this.lists[parentId]) {\n return false;\n }\n if(typeof(item) !== 'object') {\n item = String(item);\n }\n\n var pid = parseInt(Math.round(Math.random() * 100000) + \"\" + Math.round(Math.random() * 100000), 10);\n priority = priority || 0;\n\n this.items.push({parentId: parentId, item: item, priority: priority || 0, pid: pid});\n return pid;\n },\n\n\n /**\n * View list\n * @function view\n * @public\n * @param {Number} list id\n * @param {Number} process id\n * @return {Object} item\n */\n view: function(parentId, pid) {\n var id = this._searchByPid(parentId, pid);\n if(id === false) {\n return false;\n }\n return this.items[id];\n },\n\n\n /**\n * Remove an item\n * @function remove\n * @public\n * @param {Object} item\n * @return {Object|Boolean} removed item or false if not found\n */\n remove: function(parentId, pid) {\n try {\n var id = this._searchByPid(parentId, pid);\n if(id === false) {\n return false;\n }\n this.items.splice(id, 1);\n return true;\n } catch(e) {\n Ink.error('Remove: invalid id');\n return false;\n }\n },\n\n _searchByPid: function(parentId, pid) {\n if(!parentId && typeof(parentId) === 'boolean' || !pid) {\n return false;\n }\n\n parentId = parseInt(parentId, 10);\n pid = parseInt(pid, 10);\n\n if(isNaN(parentId) || isNaN(pid)) {\n return false;\n }\n\n for(var i = 0, len = this.items.length; i this._options.minSizeToUseChunks;\n },\n\n\n _dropEventHandler: function(ev) {\n Event.stop(ev);\n\n this.publish('DropComplete', ev.dataTransfer);\n\n var data = ev.dataTransfer;\n\n if(!data || !data.files || !data.files.length) {\n return false;\n }\n\n this._files = data.files;\n this._files = Array.prototype.slice.call(this._files || [], 0);\n\n // check if webkitGetAsEntry exists on first item\n if(data.items && data.items[0] && data.items[0].webkitGetAsEntry) {\n if(!this._options.foldersEnabled) {\n return setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0);\n }\n var entry, folders = [];\n for(var i = ev.dataTransfer.items.length-1; i>=0; i--) {\n entry = ev.dataTransfer.items[i].webkitGetAsEntry();\n if(entry && entry.isDirectory) {\n folders.push(entry);\n this._files[i].isDirectory = true;\n this._files.splice(i, 1);\n }\n }\n // starting callback hell\n this._addFolderToQueue(folders, Ink.bind(function() {\n setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0);\n }, this));\n } else {\n setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0);\n }\n\n return true;\n },\n\n\n _addFolderToQueue: function(folders, cb) {\n var files = [], invalidFolders = {};\n\n if(!folders || !folders.length) {\n cb();\n return files;\n }\n\n var getFiles = function(entries) {\n var files = [];\n for(var i = 0, len = entries.length; i this._options.maxFilesize) {\n this.publish('MaxSizeFailure', file, this._options.maxFilesize);\n continue;\n }\n\n fileID = parseInt(Math.round(Math.random() * 100000) + \"\" + Math.round(Math.random() * 100000), 10);\n o = { id: i, data: file, fileID: fileID, directory: file.isDirectory };\n Queue.add(this._queueId, o);\n\n this.publish('FileAddedToQueue', o);\n }\n this._processQueue(true);\n this._files = [];\n },\n\n\n _processQueue: function(internalUpload) {\n if(this._queueRunning) {\n return false;\n }\n\n this.running = 0;\n var max = 1, i = 0, items,\n queueLen = Queue.items.length;\n this._queueRunning = true;\n\n this.interval = setInterval(Ink.bind(function() {\n if(Queue.items.length === i && this.running === 0) {\n Queue.purge(this._queueId, true);\n this._queueRunning = false;\n clearInterval(this.interval);\n this.publish('QueueEnd', this._queueId, queueLen);\n }\n\n items = Queue.getItems(this._queueId);\n\n if(this.running < max && items[i]) {\n if(!items[i].canceled) {\n _doRequest.call(this, items[i].pid, items[i].item.data, items[i].item.fileID, items[i].item.directory, internalUpload);\n this.running++;\n i++;\n } else {\n var j = i;\n while(items[j] && items[j].canceled) {\n i++;\n j++;\n }\n }\n return true;\n }\n return false;\n }, this), 100);\n\n\n var _doRequest = function(pid, data, fileID, directory, internalUpload) {\n var o = {\n file: data,\n fileID: fileID,\n cb: Ink.bind(function() {\n this.running--;\n }, this)\n };\n if(internalUpload) {\n if(directory) {\n // do magic\n o.cb();\n } else {\n this._upload(o);\n }\n }\n };\n\n return true;\n },\n\n\n _upload: function(o) {\n var file = o.file,\n xhr = new XMLHttpRequest(),\n fileID = o.fileID;\n\n this.publish('BeforeUpload', file, this._options.extraData, fileID, xhr, this._supportChunks(file.size));\n\n var forceAbort = function(showError) {\n if(o.cb && typeof(o.cb === 'function')) {\n o.cb();\n }\n\n this.publish('OnProgress', {\n length: file.size,\n lengthComputable: true,\n loaded: file.size,\n total: file.size\n }, file, fileID);\n this.publish('EndUpload', file, fileID, (showError ? { error: true } : true));\n this.publish('InvalidFile', file, 'name');\n xhr.abort();\n };\n\n if(this._options.INVALID_FILE_NAME && this._options.INVALID_FILE_NAME instanceof RegExp) {\n if(this._options.INVALID_FILE_NAME.test(o.file.name)) {\n forceAbort.call(this);\n return;\n }\n }\n\n // If file was renamed, abort it\n // FU OPERA: Opera always return lastModified date as null\n if(!file.lastModifiedDate && !Ink.Dom.Browser.OPERA) {\n forceAbort.call(this, true);\n return;\n }\n\n xhr.upload.onprogress = Ink.bind(this.publish, this, 'OnProgress', file, fileID);\n\n var endpoint, method;\n if(this._supportChunks(file.size)) {\n if(file.size <= file.chunk_offset) {\n endpoint = this._options.endpointChunkCommit;\n method = 'POST';\n } else {\n endpoint = this._options.endpointChunk;\n if(file.chunk_upload_id) {\n endpoint += '?upload_id=' + file.chunk_upload_id;\n }\n if(file.chunk_offset) {\n endpoint += '&offset=' + file.chunk_offset;\n }\n method = 'PUT';\n }\n } else {\n endpoint = this._options.endpoint;\n method = 'POST';\n }\n\n xhr.open(method, endpoint, true);\n xhr.withCredentials = true;\n xhr.setRequestHeader(\"x-requested-with\", \"XMLHttpRequest\");\n if(this._supportChunks(file.size)) {\n xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n }\n\n var fd = new FormData(),\n blob;\n\n if(\"Blob\" in window && typeof Blob === 'function') {\n blob = new Blob([file], { type: file.type });\n if(this._supportChunks(file.size)) {\n file.chunk_offset = file.chunk_offset || 0;\n blob = blob.slice(file.chunk_offset, file.chunk_offset + this._options.chunkSize);\n } else {\n fd.append(this._options.fileFormName, blob, file.name);\n }\n } else {\n fd.append(this._options.fileFormName, file);\n }\n\n if(!this._supportChunks(file.size)) {\n for(var k in this._options.extraData) {\n if(this._options.extraData.hasOwnProperty(k)) {\n fd.append(k, this._options.extraData[k]);\n }\n }\n } else {\n fd.append('upload_id', file.chunk_upload_id);\n fd.append('path', file.upload_path);\n }\n\n if(!file.hasParent) {\n if(!this._supportChunks(file.size)) {\n xhr.send(fd);\n } else {\n if(file.size <= file.chunk_offset) {\n xhr.send('upload_id=' + file.chunk_upload_id + '&path=' + file.upload_path + '/' + file.name);\n } else {\n xhr.send(blob);\n }\n }\n } else {\n this.publish('cbCreateFolder', file.parentID, file.fullPath, this._options.extraData, this._folders, file.rootPath, Ink.bind(function() {\n if(!this._supportChunks(file.size)) {\n xhr.send(fd);\n } else {\n if(file.size <= file.chunk_offset) {\n xhr.send('upload_id=' + file.chunk_upload_id + '&path=' + file.upload_path + '/' + file.name);\n } else {\n xhr.send(blob);\n }\n }\n }, this));\n }\n\n\n xhr.onload = Ink.bindEvent(function() {\n /* jshint boss:true */\n if(this._supportChunks(file.size) && file.size > file.chunk_offset) {\n if(xhr.response) {\n var response = JSON.parse(xhr.response);\n\n // check expected offset\n var invalidOffset = file.chunk_offset && response.offset !== (file.chunk_offset + this._options.chunkSize) && file.size !== response.offset;\n if(invalidOffset) {\n if(o.cb) {\n o.cb();\n }\n this.publish('ErrorUpload', file, fileID);\n } else {\n file.chunk_upload_id = response.upload_id;\n file.chunk_offset = response.offset;\n file.chunk_expires = response.expires;\n this._upload(o);\n }\n } else {\n if(o.cb) {\n o.cb();\n }\n this.publish('ErrorUpload', file, fileID);\n }\n return (xhr = null);\n }\n\n if(o.cb) {\n o.cb();\n }\n\n if(xhr.responseText && xhr['status'] < 400) {\n this.publish('EndUpload', file, fileID, xhr.responseText);\n } else {\n this.publish('ErrorUpload', file, fileID);\n }\n return (xhr = null);\n }, this);\n\n\n xhr.onerror = Ink.bindEvent(function() {\n if(o.cb) {\n o.cb();\n }\n this.publish('ErrorUpload', file, fileID);\n }, this);\n\n xhr.onabort = Ink.bindEvent(function() {\n if(o.cb) {\n o.cb();\n }\n this.publish('AbortUpload', file, fileID, {\n abortAll: Ink.bind(this.abortAll, this),\n abortOne: Ink.bind(this.abortOne, this)\n });\n }, this);\n },\n\n\n abortAll: function() {\n if(!this._queueRunning) {\n return false;\n }\n clearInterval(this.interval);\n this._queueRunning = false;\n Queue.purge(this._queueId, true);\n return true;\n },\n\n abortOne: function(id, cb) {\n var items = Queue.getItems(0),\n o;\n for(var i = 0, len = items.length; i [ [1, 1], [2, 2], [3], [1] ]\n * InkArray.groupBy([1.1, 1.2, 2.1], { key: Math.floor }) // -> [ [1.1, 1.2], [2.1] ]\n * InkArray.groupBy([1.1, 1.2, 2.1], { key: Math.floor, pairs: true }) // -> [ [1, [1.1, 1.2]], [2, [2.1]] ]\n *\n **/\n groupBy: function (arr, options) {\n options = options || {};\n var ret = [];\n var latestGroup;\n function eq(a, b) {\n return outKey(a) === outKey(b);\n }\n function outKey(item) {\n if (typeof options.key === 'function') {\n return options.key(item);\n } else {\n return item;\n }\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n latestGroup = [arr[i]];\n\n // Chunkin'\n while ((i + 1 < len) && eq(arr[i], arr[i + 1])) {\n latestGroup.push(arr[i + 1]);\n i++;\n }\n\n if (options.pairs) {\n ret.push([outKey(arr[i]), latestGroup]);\n } else {\n ret.push(latestGroup);\n }\n }\n return ret;\n },\n\n /**\n * Replacement for Array.prototype.reduce.\n *\n * Produces a single result from a list of values by calling an \"aggregator\" function.\n *\n * Falls back to Array.prototype.reduce if available.\n *\n * @method reduce\n * @param array {Array} Input array to be reduced.\n * @param callback {Function} `function (previousValue, currentValue, index, all) { return {Mixed} }` to execute for each value.\n * @param initial {Mixed} Object used as the first argument to the first call of `callback`\n *\n * @example\n * var sum = InkArray.reduce([1, 2, 3], function (a, b) { return a + b; }); // -> 6\n */\n reduce: function (array, callback, initial) {\n if (arrayProto.reduce) {\n return arrayProto.reduce.apply(array, [].slice.call(arguments, 1));\n }\n\n // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Polyfill\n var t = Object( array ), len = t.length >>> 0, k = 0, value;\n if ( arguments.length >= 3 ) {\n value = initial;\n } else {\n while ( k < len && !(k in t) ) k++;\n if ( k >= len )\n throw new TypeError('Reduce of empty array with no initial value');\n value = t[ k++ ];\n }\n for ( ; k < len ; k++ ) {\n if ( k in t ) {\n value = callback( value, t[k], k, t );\n }\n }\n return value;\n },\n\n /**\n * Checks if a value exists in array\n *\n * @method inArray\n * @public\n * @static\n * @param {Mixed} value Value to check\n * @param {Array} arr Array to search in\n * @return {Boolean} True if value exists in the array\n * @sample Ink_Util_Array_inArray.html\n */\n inArray: function(value, arr) {\n if (typeof arr === 'object') {\n for (var i = 0, f = arr.length; i < f; ++i) {\n if (arr[i] === value) {\n return true;\n }\n }\n }\n return false;\n },\n\n /**\n * Sorts an array of objects by an object property\n *\n * @method sortMulti\n * @param {Array} arr Array of objects to sort\n * @param {String} key Property to sort by\n * @return {Array|Boolean} False if it's not an array, returns a sorted array if it's an array.\n * @public\n * @static\n * @sample Ink_Util_Array_sortMulti.html\n */\n sortMulti: function(arr, key) {\n if (typeof arr === 'undefined' || arr.constructor !== Array) { return false; }\n if (typeof key !== 'string') { return arr.sort(); }\n if (arr.length > 0) {\n if (typeof(arr[0][key]) === 'undefined') { return false; }\n arr.sort(function(a, b){\n var x = a[key];\n var y = b[key];\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\n });\n }\n return arr;\n },\n\n /**\n * Gets the indexes of a value in an array\n *\n * @method keyValue\n * @param {String} value Value to search for.\n * @param {Array} arr Array to run the search in.\n * @param {Boolean} [first] Flag to stop the search at the first match. It also returns an index number instead of an array of indexes.\n * @return {Boolean|Number|Array} False for no matches. Array of matches or first match index.\n * @public\n * @static\n * @sample Ink_Util_Array_keyValue.html\n */\n keyValue: function(value, arr, first) {\n if (typeof value !== 'undefined' && typeof arr === 'object' && this.inArray(value, arr)) {\n var aKeys = [];\n for (var i = 0, f = arr.length; i < f; ++i) {\n if (arr[i] === value) {\n if (typeof first !== 'undefined' && first === true) {\n return i;\n } else {\n aKeys.push(i);\n }\n }\n }\n return aKeys;\n }\n return false;\n },\n\n /**\n * Shuffles an array.\n *\n * @method shuffle\n * @param {Array} arr Array to shuffle\n * @return {Array|Boolean} Shuffled Array or false if not an array.\n * @public\n * @static\n * @sample Ink_Util_Array_shuffle.html\n */\n shuffle: function(arr) {\n if (typeof(arr) !== 'undefined' && arr.constructor !== Array) { return false; }\n var total = arr.length,\n tmp1 = false,\n rnd = false;\n\n while (total--) {\n rnd = Math.floor(Math.random() * (total + 1));\n tmp1 = arr[total];\n arr[total] = arr[rnd];\n arr[rnd] = tmp1;\n }\n return arr;\n },\n\n /**\n * Runs a function through each of the elements of an array\n *\n * @method forEach\n * @param {Array} arr The array to be cycled/iterated\n * @param {Function} cb The function receives as arguments the value, index and array.\n * @return {Array} Iterated array.\n * @public\n * @static\n * @sample Ink_Util_Array_forEach.html\n */\n forEach: function(array, callback, context) {\n if (arrayProto.forEach) {\n return arrayProto.forEach.call(array, callback, context);\n }\n for (var i = 0, len = array.length >>> 0; i < len; i++) {\n callback.call(context, array[i], i, array);\n }\n },\n\n /**\n * Alias for backwards compatibility. See forEach\n *\n * @method each\n */\n each: function () {\n InkArray.forEach.apply(InkArray, [].slice.call(arguments));\n },\n\n /**\n * Runs a function for each item in the array.\n * That function will receive each item as an argument and its return value will change the corresponding array item.\n * @method map\n * @param {Array} array The array to map over\n * @param {Function} map The map function. Will take `(item, index, array)` as arguments and `this` will be the `context` argument.\n * @param {Object} [context] Object to be `this` in the map function.\n *\n * @sample Ink_Util_Array_map.html\n */\n map: function (array, callback, context) {\n if (arrayProto.map) {\n return arrayProto.map.call(array, callback, context);\n }\n var mapped = new Array(len);\n for (var i = 0, len = array.length >>> 0; i < len; i++) {\n mapped[i] = callback.call(context, array[i], i, array);\n }\n return mapped;\n },\n\n /**\n * Filters an array based on a truth test.\n * This method runs a test function on all the array values and returns a new array with all the values that pass the test.\n * @method filter\n * @param {Array} array The array to filter\n * @param {Function} test A test function taking `(item, index, array)`\n * @param {Object} [context] Object to be `this` in the test function.\n * @return {Array} Returns the filtered array\n *\n * @sample Ink_Util_Array_filter.html\n */\n filter: function (array, test, context) {\n if (arrayProto.filter) {\n return arrayProto.filter.call(array, test, context);\n }\n var filtered = [],\n val = null;\n for (var i = 0, len = array.length; i < len; i++) {\n val = array[i]; // it might be mutated\n if (test.call(context, val, i, array)) {\n filtered.push(val);\n }\n }\n return filtered;\n },\n\n /**\n * Checks if some element in the array passes a truth test\n *\n * @method some\n * @param {Array} arr The array to iterate through\n * @param {Function} cb The callback to be called on the array's elements. It receives the value, the index and the array as arguments.\n * @param {Object} context Object of the callback function\n * @return {Boolean} True if the callback returns true at any point, false otherwise\n * @public\n * @static\n * @sample Ink_Util_Array_some.html\n */\n some: function(arr, cb, context){\n\n if (arr === null){\n throw new TypeError('First argument is invalid.');\n }\n\n var t = Object(arr);\n var len = t.length >>> 0;\n if (typeof cb !== \"function\"){ throw new TypeError('Second argument must be a function.'); }\n\n for (var i = 0; i < len; i++) {\n if (i in t && cb.call(context, t[i], i, t)){ return true; }\n }\n\n return false;\n },\n\n /**\n * Compares the values of two arrays and return the matches\n *\n * @method intersect\n * @param {Array} arr1 First array\n * @param {Array} arr2 Second array\n * @return {Array} Empty array if one of the arrays is false (or do not intersect) | Array with the intersected values\n * @public\n * @static\n * @sample Ink_Util_Array_intersect.html\n */\n intersect: function(arr1, arr2) {\n if (!arr1 || !arr2 || arr1 instanceof Array === false || arr2 instanceof Array === false) {\n return [];\n }\n\n var shared = [];\n for (var i = 0, I = arr1.length; i 0) {\n for (x = a; x < b; x += step) {\n r.push(x);\n }\n } else {\n for (x = a; x > b; x += step) {\n r.push(x);\n }\n }\n\n return r;\n },\n\n /**\n * Inserts a value on a specified index\n *\n * @method insert\n * @param {Array} arr Array where the value will be inserted\n * @param {Number} idx Index of the array where the value should be inserted\n * @param {Mixed} value Value to be inserted\n * @public\n * @static\n * @sample Ink_Util_Array_insert.html\n */\n insert: function(arr, idx, value) {\n arr.splice(idx, 0, value);\n },\n\n /**\n * Removes a range of values from the array\n *\n * @method remove\n * @param {Array} arr Array where the value will be removed\n * @param {Number} from Index of the array where the removal will start removing.\n * @param {Number} rLen Number of items to be removed from the index onwards.\n * @return {Array} An array with the remaining values\n * @public\n * @static\n * @sample Ink_Util_Array_remove.html\n */\n remove: function(arr, from, rLen){\n var output = [];\n\n for(var i = 0, iLen = arr.length; i < iLen; i++){\n if(i >= from && i < from + rLen){\n continue;\n }\n\n output.push(arr[i]);\n }\n\n return output;\n }\n };\n\n return InkArray;\n\n});\n","/**\n * Binary Packing algorithm implementation\n * @module Ink.Util.BinPack_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.BinPack', '1', [], function() {\n\n 'use strict';\n\n /*jshint boss:true */\n\n // https://github.com/jakesgordon/bin-packing/\n\n /*\n Copyright (c) 2011, 2012, 2013 Jake Gordon and contributors\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n\n\n var Packer = function(w, h) {\n this.init(w, h);\n };\n\n Packer.prototype = {\n\n init: function(w, h) {\n this.root = { x: 0, y: 0, w: w, h: h };\n },\n\n fit: function(blocks) {\n var n, node, block;\n for (n = 0; n < blocks.length; ++n) {\n block = blocks[n];\n if (node = this.findNode(this.root, block.w, block.h)) {\n block.fit = this.splitNode(node, block.w, block.h);\n }\n }\n },\n\n findNode: function(root, w, h) {\n if (root.used) {\n return this.findNode(root.right, w, h) || this.findNode(root.down, w, h);\n }\n else if ((w <= root.w) && (h <= root.h)) {\n return root;\n }\n else {\n return null;\n }\n },\n\n splitNode: function(node, w, h) {\n node.used = true;\n node.down = { x: node.x, y: node.y + h, w: node.w, h: node.h - h };\n node.right = { x: node.x + w, y: node.y, w: node.w - w, h: h };\n return node;\n }\n\n };\n\n\n\n var GrowingPacker = function() {};\n\n GrowingPacker.prototype = {\n\n fit: function(blocks) {\n var n, node, block, len = blocks.length;\n var w = len > 0 ? blocks[0].w : 0;\n var h = len > 0 ? blocks[0].h : 0;\n this.root = { x: 0, y: 0, w: w, h: h };\n for (n = 0; n < len ; n++) {\n block = blocks[n];\n if (node = this.findNode(this.root, block.w, block.h)) {\n block.fit = this.splitNode(node, block.w, block.h);\n }\n else {\n block.fit = this.growNode(block.w, block.h);\n }\n }\n },\n\n findNode: function(root, w, h) {\n if (root.used) {\n return this.findNode(root.right, w, h) || this.findNode(root.down, w, h);\n }\n else if ((w <= root.w) && (h <= root.h)) {\n return root;\n }\n else {\n return null;\n }\n },\n\n splitNode: function(node, w, h) {\n node.used = true;\n node.down = { x: node.x, y: node.y + h, w: node.w, h: node.h - h };\n node.right = { x: node.x + w, y: node.y, w: node.w - w, h: h };\n return node;\n },\n\n growNode: function(w, h) {\n var canGrowDown = (w <= this.root.w);\n var canGrowRight = (h <= this.root.h);\n\n var shouldGrowRight = canGrowRight && (this.root.h >= (this.root.w + w)); // attempt to keep square-ish by growing right when height is much greater than width\n var shouldGrowDown = canGrowDown && (this.root.w >= (this.root.h + h)); // attempt to keep square-ish by growing down when width is much greater than height\n\n if (shouldGrowRight) {\n return this.growRight(w, h);\n }\n else if (shouldGrowDown) {\n return this.growDown(w, h);\n }\n else if (canGrowRight) {\n return this.growRight(w, h);\n }\n else if (canGrowDown) {\n return this.growDown(w, h);\n }\n else {\n return null; // need to ensure sensible root starting size to avoid this happening\n }\n },\n\n growRight: function(w, h) {\n this.root = {\n used: true,\n x: 0,\n y: 0,\n w: this.root.w + w,\n h: this.root.h,\n down: this.root,\n right: { x: this.root.w, y: 0, w: w, h: this.root.h }\n };\n var node;\n if (node = this.findNode(this.root, w, h)) {\n return this.splitNode(node, w, h);\n }\n else {\n return null;\n }\n },\n\n growDown: function(w, h) {\n this.root = {\n used: true,\n x: 0,\n y: 0,\n w: this.root.w,\n h: this.root.h + h,\n down: { x: 0, y: this.root.h, w: this.root.w, h: h },\n right: this.root\n };\n var node;\n if (node = this.findNode(this.root, w, h)) {\n return this.splitNode(node, w, h);\n }\n else {\n return null;\n }\n }\n\n };\n\n\n\n var sorts = {\n random: function() { return Math.random() - 0.5; },\n w: function(a, b) { return b.w - a.w; },\n h: function(a, b) { return b.h - a.h; },\n a: function(a, b) { return b.area - a.area; },\n max: function(a, b) { return Math.max(b.w, b.h) - Math.max(a.w, a.h); },\n min: function(a, b) { return Math.min(b.w, b.h) - Math.min(a.w, a.h); },\n height: function(a, b) { return sorts.msort(a, b, ['h', 'w']); },\n width: function(a, b) { return sorts.msort(a, b, ['w', 'h']); },\n area: function(a, b) { return sorts.msort(a, b, ['a', 'h', 'w']); },\n maxside: function(a, b) { return sorts.msort(a, b, ['max', 'min', 'h', 'w']); },\n msort: function(a, b, criteria) { /* sort by multiple criteria */\n var diff, n;\n for (n = 0; n < criteria.length; ++n) {\n diff = sorts[ criteria[n] ](a, b);\n if (diff !== 0) {\n return diff;\n }\n }\n return 0;\n }\n };\n\n\n\n // end of Jake's code\n\n\n\n // aux, used to display blocks in unfitted property\n var toString = function() {\n return [this.w, ' x ', this.h].join('');\n };\n\n\n\n /**\n * Binary Packing algorithm implementation\n *\n * Based on the work of Jake Gordon\n *\n * see https://github.com/jakesgordon/bin-packing/\n *\n * @namespace Ink.Util.BinPack\n * @version 1\n * @static\n */\n var BinPack = {\n\n /**\n * @method binPack\n * @param {Object} o Options\n * @param {Array} o.blocks Array of items with width and height integer attributes.\n * @param {Array} [o.dimensions] Flag to fix container dimensions\n * @param {String} [o.sorter] Sorting function. One of: random, height, width, area, maxside\n * @return {Object} Returns an object containing container dimensions, filled ratio, fitted blocks, unfitted blocks and all blocks\n * @static\n */\n binPack: function(o) {\n var i, f, bl;\n\n\n\n // calculate area if not there already\n for (i = 0, f = o.blocks.length; i < f; ++i) {\n bl = o.blocks[i];\n if (! ('area' in bl) ) {\n bl.area = bl.w * bl.h;\n }\n }\n\n\n\n // apply algorithm\n var packer = o.dimensions ? new Packer(o.dimensions[0], o.dimensions[1]) : new GrowingPacker();\n\n if (!o.sorter) { o.sorter = 'maxside'; }\n\n o.blocks.sort( sorts[ o.sorter ] );\n\n packer.fit(o.blocks);\n\n var dims2 = [packer.root.w, packer.root.h];\n\n\n\n // layout is done here, generating report data...\n var fitted = [];\n var unfitted = [];\n\n for (i = 0, f = o.blocks.length; i < f; ++i) {\n bl = o.blocks[i];\n if (bl.fit) {\n fitted.push(bl);\n }\n else {\n bl.toString = toString; // TO AID SERIALIZATION\n unfitted.push(bl);\n }\n }\n\n var area = dims2[0] * dims2[1];\n var fit = 0;\n for (i = 0, f = fitted.length; i < f; ++i) {\n bl = fitted[i];\n fit += bl.area;\n }\n\n return {\n dimensions: dims2,\n filled: fit / area,\n blocks: o.blocks,\n fitted: fitted,\n unfitted: unfitted\n };\n }\n };\n\n\n\n return BinPack;\n\n});","/**\n * Cookie Utilities\n * @module Ink.Util.Cookie_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Cookie', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.Cookie_1\n */\n var Cookie = {\n\n /**\n * Gets an object with the current page cookies.\n *\n * @method get\n * @param {String} name The cookie name.\n * @return {String|Object} If the name is specified, it returns the value of that key. Otherwise it returns the full cookie object\n * @public\n * @static\n * @sample Ink_Util_Cookie_get.html\n */\n get: function(name)\n {\n var cookie = document.cookie || false;\n\n var _Cookie = {};\n if(cookie) {\n cookie = cookie.replace(new RegExp(\"; \", \"g\"), ';');\n var aCookie = cookie.split(';');\n var aItem = [];\n if(aCookie.length > 0) {\n for(var i=0; i < aCookie.length; i++) {\n aItem = aCookie[i].split('=');\n if(aItem.length === 2) {\n _Cookie[aItem[0]] = decodeURIComponent(aItem[1]);\n }\n aItem = [];\n }\n }\n }\n if(name) {\n if(typeof(_Cookie[name]) !== 'undefined') {\n return _Cookie[name];\n } else {\n return null;\n }\n }\n return _Cookie;\n },\n\n /**\n * Sets a cookie.\n *\n * @method set\n * @param {String} name Cookie name.\n * @param {String} value Cookie value.\n * @param {Number} [expires] Number of seconds the cookie will be valid for.\n * @param {String} [path] Path for the cookie. Defaults to '/'.\n * @param {String} [domain] Domain for the cookie. Defaults to current hostname.\n * @param {Boolean} [secure] Flag for secure. Default 'false'.\n * @public\n * @static\n * @sample Ink_Util_Cookie_set.html\n */\n set: function(name, value, expires, path, domain, secure)\n {\n var sName;\n if(!name || value===false || typeof(name) === 'undefined' || typeof(value) === 'undefined') {\n return false;\n } else {\n sName = name+'='+encodeURIComponent(value);\n }\n var sExpires = false;\n var sPath = false;\n var sDomain = false;\n var sSecure = false;\n\n if(expires && typeof(expires) !== 'undefined' && !isNaN(expires)) {\n var oDate = new Date();\n var sDate = (parseInt(Number(oDate.valueOf()), 10) + (Number(parseInt(expires, 10)) * 1000));\n\n var nDate = new Date(sDate);\n var expiresString = nDate.toGMTString();\n\n var re = new RegExp(\"([^\\\\s]+)(\\\\s\\\\d\\\\d)\\\\s(\\\\w\\\\w\\\\w)\\\\s(.*)\");\n expiresString = expiresString.replace(re, \"$1$2-$3-$4\");\n\n sExpires = 'expires='+expiresString;\n } else {\n if(typeof(expires) !== 'undefined' && !isNaN(expires) && Number(parseInt(expires, 10))===0) {\n sExpires = '';\n } else {\n sExpires = 'expires=Thu, 01-Jan-2037 00:00:01 GMT';\n }\n }\n\n if(path && typeof(path) !== 'undefined') {\n sPath = 'path='+path;\n } else {\n sPath = 'path=/';\n }\n\n if(domain && typeof(domain) !== 'undefined') {\n sDomain = 'domain='+domain;\n } else {\n var portClean = new RegExp(\":(.*)\");\n sDomain = 'domain='+window.location.host;\n sDomain = sDomain.replace(portClean,\"\");\n }\n\n if(secure && typeof(secure) !== 'undefined') {\n sSecure = secure;\n } else {\n sSecure = false;\n }\n\n document.cookie = sName+'; '+sExpires+'; '+sPath+'; '+sDomain+'; '+sSecure;\n },\n\n /**\n * Deletes a cookie.\n *\n * @method remove\n * @param {String} cookieName Cookie name.\n * @param {String} [path] Path of the cookie. Defaults to '/'.\n * @param {String} [domain] Domain of the cookie. Defaults to current hostname.\n * @public\n * @static\n * @sample Ink_Util_Cookie_remove.html\n */\n remove: function(cookieName, path, domain)\n {\n //var expiresDate = 'Thu, 01-Jan-1970 00:00:01 GMT';\n var sPath = false;\n var sDomain = false;\n var expiresDate = -999999999;\n\n if(path && typeof(path) !== 'undefined') {\n sPath = path;\n } else {\n sPath = '/';\n }\n\n if(domain && typeof(domain) !== 'undefined') {\n sDomain = domain;\n } else {\n sDomain = window.location.host;\n }\n\n this.set(cookieName, 'deleted', expiresDate, sPath, sDomain);\n }\n };\n\n return Cookie;\n\n});\n","/**\n * Date utility functions\n * @module Ink.Util.Date_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Date', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.Date_1 \n */\n var InkDate = {\n\n /**\n * Function that returns the string representation of the month [PT only]\n *\n * @method _months\n * @param {Number} index Month javascript (0 to 11)\n * @return {String} The month's name\n * @private\n * @static\n * @example\n * console.log( InkDate._months(0) ); // Result: Janeiro\n */\n _months: function(index){\n var _m = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];\n return _m[index];\n },\n\n /**\n * Function that returns the month [PT only] ( 0 to 11 )\n *\n * @method _iMonth\n * @param {String} month Month javascript (0 to 11)\n * @return {Number} The month's number\n * @private\n * @static\n * @example\n * console.log( InkDate._iMonth('maio') ); // Result: 4\n */\n _iMonth : function( month )\n {\n if ( Number( month ) ) { return +month - 1; }\n return {\n 'janeiro' : 0 ,\n 'jan' : 0 ,\n 'fevereiro' : 1 ,\n 'fev' : 1 ,\n 'março' : 2 ,\n 'mar' : 2 ,\n 'abril' : 3 ,\n 'abr' : 3 ,\n 'maio' : 4 ,\n 'mai' : 4 ,\n 'junho' : 5 ,\n 'jun' : 5 ,\n 'julho' : 6 ,\n 'jul' : 6 ,\n 'agosto' : 7 ,\n 'ago' : 7 ,\n 'setembro' : 8 ,\n 'set' : 8 ,\n 'outubro' : 9 ,\n 'out' : 9 ,\n 'novembro' : 10 ,\n 'nov' : 10 ,\n 'dezembro' : 11 ,\n 'dez' : 11\n }[ month.toLowerCase( ) ];\n } ,\n\n /**\n * Function that returns the representation the day of the week [PT Only]\n *\n * @method _wDays\n * @param {Number} index Week's day index\n * @return {String} The week's day name\n * @private\n * @static\n * @example\n * console.log( InkDate._wDays(0) ); // Result: Domingo\n */\n _wDays: function(index){\n var _d = ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'];\n return _d[index];\n },\n\n /**\n * Function that returns day of the week in javascript 1 to 7\n *\n * @method _iWeek\n * @param {String} week Week's day name\n * @return {Number} The week's day index\n * @private\n * @static\n * @example\n * console.log( InkDate._iWeek('quarta') ); // Result: 3\n */\n _iWeek: function( week )\n {\n if ( Number( week ) ) { return +week || 7; }\n return {\n 'segunda' : 1 ,\n 'seg' : 1 ,\n 'terça' : 2 ,\n 'ter' : 2 ,\n 'quarta' : 3 ,\n 'qua' : 3 ,\n 'quinta' : 4 ,\n 'qui' : 4 ,\n 'sexta' : 5 ,\n 'sex' : 5 ,\n 'sábado' : 6 ,\n 'sáb' : 6 ,\n 'domingo' : 7 ,\n 'dom' : 7\n }[ week.toLowerCase( ) ];\n },\n\n /**\n * Function that returns the number of days of a given month (m) on a given year (y)\n *\n * @method _daysInMonth\n * @param {Number} _m Month\n * @param {Number} _y Year\n * @return {Number} Number of days of a give month on a given year\n * @private\n * @static\n * @example\n * console.log( InkDate._daysInMonth(2,2013) ); // Result: 28\n */\n _daysInMonth: function(_m,_y){\n var nDays;\n\n if(_m===1 || _m===3 || _m===5 || _m===7 || _m===8 || _m===10 || _m===12)\n {\n nDays= 31;\n }\n else if ( _m===4 || _m===6 || _m===9 || _m===11)\n {\n nDays = 30;\n }\n else\n {\n if((_y%400===0) || (_y%4===0 && _y%100!==0))\n {\n nDays = 29;\n }\n else\n {\n nDays = 28;\n }\n }\n return nDays;\n },\n\n /**\n * Formats a date object.\n * This works exactly as php date() function. http://php.net/manual/en/function.date.php\n *\n * @method get\n * @param {String} format The format in which the date it will be formatted.\n * @param {Date} [_date] The date to format. Can receive unix timestamp or a date object. Defaults to current time.\n * @return {String} Formatted date\n * @public\n * @static\n * @sample Ink_Util_Date_get.html \n */\n get: function(format, _date){\n /*jshint maxcomplexity:65 */\n if(typeof(format) === 'undefined' || format === ''){\n format = \"Y-m-d\";\n }\n\n\n var iFormat = format.split(\"\");\n var result = new Array(iFormat.length);\n var escapeChar = \"\\\\\";\n var jsDate;\n\n if (typeof(_date) === 'undefined'){\n jsDate = new Date();\n } else if (typeof(_date)==='number'){\n jsDate = new Date(_date*1000);\n } else {\n jsDate = new Date(_date);\n }\n\n var jsFirstDay, jsThisDay, jsHour;\n /* This switch is presented in the same order as in php date function (PHP 5.2.2) */\n for (var i = 0; i < iFormat.length; i++) {\n switch(iFormat[i]) {\n case escapeChar:\n result[i] = iFormat[i+1];\n i++;\n break;\n\n\n /* DAY */\n case \"d\": /* Day of the month, 2 digits with leading zeros; ex: 01 to 31 */\n var jsDay = jsDate.getDate();\n result[i] = (String(jsDay).length > 1) ? jsDay : \"0\" + jsDay;\n break;\n\n case \"D\": /* A textual representation of a day, three letters; Seg to Dom */\n result[i] = this._wDays(jsDate.getDay()).substring(0, 3);\n break;\n\n case \"j\": /* Day of the month without leading zeros; ex: 1 to 31 */\n result[i] = jsDate.getDate();\n break;\n\n case \"l\": /* A full textual representation of the day of the week; Domingo to Sabado */\n result[i] = this._wDays(jsDate.getDay());\n break;\n\n case \"N\": /* ISO-8601 numeric representation of the day of the week; 1 (Segunda) to 7 (Domingo) */\n result[i] = jsDate.getDay() || 7;\n break;\n\n case \"S\": /* English ordinal suffix for the day of the month, 2 characters; st, nd, rd or th. Works well with j */\n var temp = jsDate.getDate();\n var suffixes = [\"st\", \"nd\", \"rd\"];\n var suffix = \"\";\n\n if (temp >= 11 && temp <= 13) {\n result[i] = \"th\";\n } else {\n result[i] = (suffix = suffixes[String(temp).substr(-1) - 1]) ? (suffix) : (\"th\");\n }\n break;\n\n case \"w\": /* Numeric representation of the day of the week; 0 (for Sunday) through 6 (for Saturday) */\n result[i] = jsDate.getDay();\n break;\n\n case \"z\": /* The day of the year (starting from 0); 0 to 365 */\n jsFirstDay = Date.UTC(jsDate.getFullYear(), 0, 0);\n jsThisDay = Date.UTC(jsDate.getFullYear(), jsDate.getMonth(), jsDate.getDate());\n result[i] = Math.floor((jsThisDay - jsFirstDay) / (1000 * 60 * 60 * 24));\n break;\n\n /* WEEK */\n case \"W\": /* ISO-8601 week number of year, weeks starting on Monday; ex: 42 (the 42nd week in the year) */\n var jsYearStart = new Date( jsDate.getFullYear( ) , 0 , 1 );\n jsFirstDay = jsYearStart.getDay() || 7;\n\n var days = Math.floor( ( jsDate - jsYearStart ) / ( 24 * 60 * 60 * 1000 ) + 1 );\n\n result[ i ] = Math.ceil( ( days - ( 8 - jsFirstDay ) ) / 7 ) + 1;\n break;\n\n\n /* MONTH */\n case \"F\": /* A full textual representation of a month, such as Janeiro or Marco; Janeiro a Dezembro */\n result[i] = this._months(jsDate.getMonth());\n break;\n\n case \"m\": /* Numeric representation of a month, with leading zeros; 01 to 12 */\n var jsMonth = String(jsDate.getMonth() + 1);\n result[i] = (jsMonth.length > 1) ? jsMonth : \"0\" + jsMonth;\n break;\n\n case \"M\": /* A short textual representation of a month, three letters; Jan a Dez */\n result[i] = this._months(jsDate.getMonth()).substring(0,3);\n break;\n\n case \"n\": /* Numeric representation of a month, without leading zeros; 1 a 12 */\n result[i] = jsDate.getMonth() + 1;\n break;\n\n case \"t\": /* Number of days in the given month; ex: 28 */\n result[i] = this._daysInMonth(jsDate.getMonth()+1,jsDate.getYear());\n break;\n\n /* YEAR */\n case \"L\": /* Whether it's a leap year; 1 if it is a leap year, 0 otherwise. */\n var jsYear = jsDate.getFullYear();\n result[i] = (jsYear % 4) ? false : ( (jsYear % 100) ? true : ( (jsYear % 400) ? false : true ) );\n break;\n\n case \"o\": /* ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. */\n throw '\"o\" not implemented!';\n\n case \"Y\": /* A full numeric representation of a year, 4 digits; 1999 */\n result[i] = jsDate.getFullYear();\n break;\n\n case \"y\": /* A two digit representation of a year; 99 */\n result[i] = String(jsDate.getFullYear()).substring(2);\n break;\n\n /* TIME */\n case \"a\": /* Lowercase Ante meridiem and Post meridiem; am or pm */\n result[i] = (jsDate.getHours() < 12) ? \"am\" : \"pm\";\n break;\n\n case \"A\": /* Uppercase Ante meridiem and Post meridiem; AM or PM */\n result[i] = (jsDate.getHours < 12) ? \"AM\" : \"PM\";\n break;\n\n case \"B\": /* Swatch Internet time; 000 through 999 */\n throw '\"B\" not implemented!';\n\n case \"g\": /* 12-hour format of an hour without leading zeros; 1 to 12 */\n jsHour = jsDate.getHours();\n result[i] = (jsHour <= 12) ? jsHour : (jsHour - 12);\n break;\n\n case \"G\": /* 24-hour format of an hour without leading zeros; 1 to 23 */\n result[i] = String(jsDate.getHours());\n break;\n\n case \"h\": /* 12-hour format of an hour with leading zeros; 01 to 12 */\n jsHour = String(jsDate.getHours());\n jsHour = (jsHour <= 12) ? jsHour : (jsHour - 12);\n result[i] = (jsHour.length > 1) ? jsHour : \"0\" + jsHour;\n break;\n\n case \"H\": /* 24-hour format of an hour with leading zeros; 01 to 24 */\n jsHour = String(jsDate.getHours());\n result[i] = (jsHour.length > 1) ? jsHour : \"0\" + jsHour;\n break;\n\n case \"i\": /* Minutes with leading zeros; 00 to 59 */\n var jsMinute = String(jsDate.getMinutes());\n result[i] = (jsMinute.length > 1) ? jsMinute : \"0\" + jsMinute;\n break;\n\n case \"s\": /* Seconds with leading zeros; 00 to 59; */\n var jsSecond = String(jsDate.getSeconds());\n result[i] = (jsSecond.length > 1) ? jsSecond : \"0\" + jsSecond;\n break;\n\n case \"u\": /* Microseconds */\n throw '\"u\" not implemented!';\n\n\n /* TIMEZONE */\n\n case \"e\": /* Timezone identifier */\n throw '\"e\" not implemented!';\n\n case \"I\": /* \"1\" if Daylight Savings Time, \"0\" otherwise. Works only on the northern hemisphere */\n jsFirstDay = new Date(jsDate.getFullYear(), 0, 1);\n result[i] = (jsDate.getTimezoneOffset() !== jsFirstDay.getTimezoneOffset()) ? (1) : (0);\n break;\n\n case \"O\": /* Difference to Greenwich time (GMT) in hours */\n var jsMinZone = jsDate.getTimezoneOffset();\n var jsMinutes = jsMinZone % 60;\n jsHour = String(((jsMinZone - jsMinutes) / 60) * -1);\n\n if (jsHour.charAt(0) !== \"-\") {\n jsHour = \"+\" + jsHour;\n }\n\n jsHour = (jsHour.length === 3) ? (jsHour) : (jsHour.replace(/([+\\-])(\\d)/, \"$1\" + 0 + \"$2\"));\n result[i] = jsHour + jsMinutes + \"0\";\n break;\n\n case \"P\": /* Difference to Greenwich time (GMT) with colon between hours and minutes */\n throw '\"P\" not implemented!';\n\n case \"T\": /* Timezone abbreviation */\n throw '\"T\" not implemented!';\n\n case \"Z\": /* Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. */\n result[i] = jsDate.getTimezoneOffset() * 60;\n break;\n\n\n /* FULL DATE/TIME */\n\n case \"c\": /* ISO 8601 date */\n throw '\"c\" not implemented!';\n\n case \"r\": /* RFC 2822 formatted date */\n var jsDayName = this._wDays(jsDate.getDay()).substr(0, 3);\n var jsMonthName = this._months(jsDate.getMonth()).substr(0, 3);\n result[i] = jsDayName + \", \" + jsDate.getDate() + \" \" + jsMonthName + this.get(\" Y H:i:s O\",jsDate);\n break;\n\n case \"U\": /* Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) */\n result[i] = Math.floor(jsDate.getTime() / 1000);\n break;\n\n default:\n result[i] = iFormat[i];\n }\n }\n\n return result.join('');\n\n },\n\n /**\n * Creates a date object based on a format string.\n * This works exactly as php date() function. http://php.net/manual/en/function.date.php\n *\n * @method set\n * @param {String} [format] The format in which the date will be formatted. Defaults to 'Y-m-d'\n * @param {String} str_date The date formatted.\n * @return {Date} Date object based on the formatted date and format\n * @public\n * @static\n * @sample Ink_Util_Date_set.html \n */\n set : function( format , str_date ) {\n if ( typeof str_date === 'undefined' ) { return ; }\n if ( typeof format === 'undefined' || format === '' ) { format = \"Y-m-d\"; }\n\n var iFormat = format.split(\"\");\n var result = new Array( iFormat.length );\n var escapeChar = \"\\\\\";\n var mList;\n\n var objIndex = {\n year : undefined ,\n month : undefined ,\n day : undefined ,\n dayY : undefined ,\n dayW : undefined ,\n week : undefined ,\n hour : undefined ,\n hourD : undefined ,\n min : undefined ,\n sec : undefined ,\n msec : undefined ,\n ampm : undefined ,\n diffM : undefined ,\n diffH : undefined ,\n date : undefined\n };\n\n var matches = 0;\n\n /* This switch is presented in the same order as in php date function (PHP 5.2.2) */\n for ( var i = 0; i < iFormat.length; i++) {\n switch( iFormat[ i ] ) {\n case escapeChar:\n result[i] = iFormat[ i + 1 ];\n i++;\n break;\n\n /* DAY */\n case \"d\": /* Day of the month, 2 digits with leading zeros; ex: 01 to 31 */\n result[ i ] = '(\\\\d{2})';\n objIndex.day = { original : i , match : matches++ };\n break;\n\n case \"j\": /* Day of the month without leading zeros; ex: 1 to 31 */\n result[ i ] = '(\\\\d{1,2})';\n objIndex.day = { original : i , match : matches++ };\n break;\n\n case \"D\": /* A textual representation of a day, three letters; Seg to Dom */\n result[ i ] = '([\\\\wá]{3})';\n objIndex.dayW = { original : i , match : matches++ };\n break;\n\n case \"l\": /* A full textual representation of the day of the week; Domingo to Sabado */\n result[i] = '([\\\\wá]{5,7})';\n objIndex.dayW = { original : i , match : matches++ };\n break;\n\n case \"N\": /* ISO-8601 numeric representation of the day of the week; 1 (Segunda) to 7 (Domingo) */\n result[ i ] = '(\\\\d)';\n objIndex.dayW = { original : i , match : matches++ };\n break;\n\n case \"w\": /* Numeric representation of the day of the week; 0 (for Sunday) through 6 (for Saturday) */\n result[ i ] = '(\\\\d)';\n objIndex.dayW = { original : i , match : matches++ };\n break;\n\n case \"S\": /* English ordinal suffix for the day of the month, 2 characters; st, nd, rd or th. Works well with j */\n result[ i ] = '\\\\w{2}';\n break;\n\n case \"z\": /* The day of the year (starting from 0); 0 to 365 */\n result[ i ] = '(\\\\d{1,3})';\n objIndex.dayY = { original : i , match : matches++ };\n break;\n\n /* WEEK */\n case \"W\": /* ISO-8601 week number of year, weeks starting on Monday; ex: 42 (the 42nd week in the year) */\n result[ i ] = '(\\\\d{1,2})';\n objIndex.week = { original : i , match : matches++ };\n break;\n\n /* MONTH */\n case \"F\": /* A full textual representation of a month, such as Janeiro or Marco; Janeiro a Dezembro */\n result[ i ] = '([\\\\wç]{4,9})';\n objIndex.month = { original : i , match : matches++ };\n break;\n\n case \"M\": /* A short textual representation of a month, three letters; Jan a Dez */\n result[ i ] = '(\\\\w{3})';\n objIndex.month = { original : i , match : matches++ };\n break;\n\n case \"m\": /* Numeric representation of a month, with leading zeros; 01 to 12 */\n result[ i ] = '(\\\\d{2})';\n objIndex.month = { original : i , match : matches++ };\n break;\n\n case \"n\": /* Numeric representation of a month, without leading zeros; 1 a 12 */\n result[ i ] = '(\\\\d{1,2})';\n objIndex.month = { original : i , match : matches++ };\n break;\n\n case \"t\": /* Number of days in the given month; ex: 28 */\n result[ i ] = '\\\\d{2}';\n break;\n\n /* YEAR */\n case \"L\": /* Whether it's a leap year; 1 if it is a leap year, 0 otherwise. */\n result[ i ] = '\\\\w{4,5}';\n break;\n\n case \"o\": /* ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. */\n throw '\"o\" not implemented!';\n\n case \"Y\": /* A full numeric representation of a year, 4 digits; 1999 */\n result[ i ] = '(\\\\d{4})';\n objIndex.year = { original : i , match : matches++ };\n break;\n\n case \"y\": /* A two digit representation of a year; 99 */\n result[ i ] = '(\\\\d{2})';\n if ( typeof objIndex.year === 'undefined' || iFormat[ objIndex.year.original ] !== 'Y' ) {\n objIndex.year = { original : i , match : matches++ };\n }\n break;\n\n /* TIME */\n case \"a\": /* Lowercase Ante meridiem and Post meridiem; am or pm */\n result[ i ] = '(am|pm)';\n objIndex.ampm = { original : i , match : matches++ };\n break;\n\n case \"A\": /* Uppercase Ante meridiem and Post meridiem; AM or PM */\n result[ i ] = '(AM|PM)';\n objIndex.ampm = { original : i , match : matches++ };\n break;\n\n case \"B\": /* Swatch Internet time; 000 through 999 */\n throw '\"B\" not implemented!';\n\n case \"g\": /* 12-hour format of an hour without leading zeros; 1 to 12 */\n result[ i ] = '(\\\\d{1,2})';\n objIndex.hourD = { original : i , match : matches++ };\n break;\n\n case \"G\": /* 24-hour format of an hour without leading zeros; 1 to 23 */\n result[ i ] = '(\\\\d{1,2})';\n objIndex.hour = { original : i , match : matches++ };\n break;\n\n case \"h\": /* 12-hour format of an hour with leading zeros; 01 to 12 */\n result[ i ] = '(\\\\d{2})';\n objIndex.hourD = { original : i , match : matches++ };\n break;\n\n case \"H\": /* 24-hour format of an hour with leading zeros; 01 to 24 */\n result[ i ] = '(\\\\d{2})';\n objIndex.hour = { original : i , match : matches++ };\n break;\n\n case \"i\": /* Minutes with leading zeros; 00 to 59 */\n result[ i ] = '(\\\\d{2})';\n objIndex.min = { original : i , match : matches++ };\n break;\n\n case \"s\": /* Seconds with leading zeros; 00 to 59; */\n result[ i ] = '(\\\\d{2})';\n objIndex.sec = { original : i , match : matches++ };\n break;\n\n case \"u\": /* Microseconds */\n throw '\"u\" not implemented!';\n\n /* TIMEZONE */\n case \"e\": /* Timezone identifier */\n throw '\"e\" not implemented!';\n\n case \"I\": /* \"1\" if Daylight Savings Time, \"0\" otherwise. Works only on the northern hemisphere */\n result[i] = '\\\\d';\n break;\n\n case \"O\": /* Difference to Greenwich time (GMT) in hours */\n result[ i ] = '([-+]\\\\d{4})';\n objIndex.diffH = { original : i , match : matches++ };\n break;\n\n case \"P\": /* Difference to Greenwich time (GMT) with colon between hours and minutes */\n throw '\"P\" not implemented!';\n\n case \"T\": /* Timezone abbreviation */\n throw '\"T\" not implemented!';\n\n case \"Z\": /* Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. */\n result[ i ] = '(\\\\-?\\\\d{1,5})';\n objIndex.diffM = { original : i , match : matches++ };\n break;\n\n /* FULL DATE/TIME */\n case \"c\": /* ISO 8601 date */\n throw '\"c\" not implemented!';\n\n case \"r\": /* RFC 2822 formatted date */\n result[ i ] = '([\\\\wá]{3}, \\\\d{1,2} \\\\w{3} \\\\d{4} \\\\d{2}:\\\\d{2}:\\\\d{2} [+\\\\-]\\\\d{4})';\n objIndex.date = { original : i , match : matches++ };\n break;\n\n case \"U\": /* Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) */\n result[ i ] = '(\\\\d{1,13})';\n objIndex.date = { original : i , match : matches++ };\n break;\n\n default:\n result[ i ] = iFormat[ i ];\n }\n }\n\n var pattr = new RegExp( result.join('') );\n\n try {\n mList = str_date.match( pattr );\n if ( !mList ) { return; }\n }\n catch ( e ) { return ; }\n\n var _haveDatetime = typeof objIndex.date !== 'undefined';\n\n var _haveYear = typeof objIndex.year !== 'undefined';\n\n var _haveYDay = typeof objIndex.dayY !== 'undefined';\n\n var _haveDay = typeof objIndex.day !== 'undefined';\n var _haveMonth = typeof objIndex.month !== 'undefined';\n var _haveMonthDay = _haveMonth && _haveDay;\n var _haveOnlyDay = !_haveMonth && _haveDay;\n\n var _haveWDay = typeof objIndex.dayW !== 'undefined';\n var _haveWeek = typeof objIndex.week !== 'undefined';\n var _haveWeekWDay = _haveWeek && _haveWDay;\n var _haveOnlyWDay = !_haveWeek && _haveWDay;\n\n var _validDate = _haveYDay || _haveMonthDay || !_haveYear && _haveOnlyDay || _haveWeekWDay || !_haveYear && _haveOnlyWDay;\n var _noDate = !_haveYear && !_haveYDay && !_haveDay && !_haveMonth && !_haveWDay && !_haveWeek;\n\n var _haveHour12 = typeof objIndex.hourD !== 'undefined' && typeof objIndex.ampm !== 'undefined';\n var _haveHour24 = typeof objIndex.hour !== 'undefined';\n var _haveHour = _haveHour12 || _haveHour24;\n\n var _haveMin = typeof objIndex.min !== 'undefined';\n var _haveSec = typeof objIndex.sec !== 'undefined';\n var _haveMSec = typeof objIndex.msec !== 'undefined';\n\n var _haveMoreM = !_noDate || _haveHour;\n var _haveMoreS = _haveMoreM || _haveMin;\n\n var _haveDiffM = typeof objIndex.diffM !== 'undefined';\n var _haveDiffH = typeof objIndex.diffH !== 'undefined';\n //var _haveGMT = _haveDiffM || _haveDiffH;\n var hour;\n var min;\n\n if ( _haveDatetime ) {\n if ( iFormat[ objIndex.date.original ] === 'U' ) {\n return new Date( +mList[ objIndex.date.match + 1 ] * 1000 );\n }\n\n var dList = mList[ objIndex.date.match + 1 ].match( /\\w{3}, (\\d{1,2}) (\\w{3}) (\\d{4}) (\\d{2}):(\\d{2}):(\\d{2}) ([+\\-]\\d{4})/ );\n hour = +dList[ 4 ] + ( +dList[ 7 ].slice( 0 , 3 ) );\n min = +dList[ 5 ] + ( dList[ 7 ].slice( 0 , 1 ) + dList[ 7 ].slice( 3 ) ) / 100 * 60;\n\n return new Date( dList[ 3 ] , this._iMonth( dList[ 2 ] ) , dList[ 1 ] , hour , min , dList[ 6 ] );\n }\n\n var _d = new Date( );\n var year;\n var month;\n var day;\n var sec;\n var msec;\n var gmt;\n\n if ( !_validDate && !_noDate ) { return ; }\n\n if ( _validDate ) {\n if ( _haveYear ) {\n var _y = _d.getFullYear( ) - 50 + '';\n year = mList[ objIndex.year.match + 1 ];\n if ( iFormat[ objIndex.year.original ] === 'y' ) {\n year = +_y.slice( 0 , 2 ) + ( year >= ( _y ).slice( 2 ) ? 0 : 1 ) + year;\n }\n } else {\n year = _d.getFullYear();\n }\n\n if ( _haveYDay ) {\n month = 0;\n day = mList[ objIndex.dayY.match + 1 ];\n } else if ( _haveDay ) {\n if ( _haveMonth ) {\n month = this._iMonth( mList[ objIndex.month.match + 1 ] );\n } else {\n month = _d.getMonth( );\n }\n\n day = mList[ objIndex.day.match + 1 ];\n } else {\n month = 0;\n\n var week;\n if ( _haveWeek ) {\n week = mList[ objIndex.week.match + 1 ];\n } else {\n week = this.get( 'W' , _d );\n }\n\n day = ( week - 2 ) * 7 + ( 8 - ( ( new Date( year , 0 , 1 ) ).getDay( ) || 7 ) ) + this._iWeek( mList[ objIndex.week.match + 1 ] );\n }\n\n if ( month === 0 && day > 31 ) {\n var aux = new Date( year , month , day );\n month = aux.getMonth( );\n day = aux.getDate( );\n }\n }\n else {\n year = _d.getFullYear( );\n month = _d.getMonth( );\n day = _d.getDate( );\n }\n\n if ( _haveHour12 ) { hour = +mList[ objIndex.hourD.match + 1 ] + ( mList[ objIndex.ampm.match + 1 ] === 'pm' ? 12 : 0 ); }\n else if ( _haveHour24 ) { hour = mList[ objIndex.hour.match + 1 ]; }\n else if ( _noDate ) { hour = _d.getHours( ); }\n else { hour = '00'; }\n\n if ( _haveMin ) { min = mList[ objIndex.min.match + 1 ]; }\n else if ( !_haveMoreM ) { min = _d.getMinutes( ); }\n else { min = '00'; }\n\n if ( _haveSec ) { sec = mList[ objIndex.sec.match + 1 ]; }\n else if ( !_haveMoreS ) { sec = _d.getSeconds( ); }\n else { sec = '00'; }\n\n if ( _haveMSec ) { msec = mList[ objIndex.msec.match + 1 ]; }\n else { msec = '000'; }\n\n if ( _haveDiffH ) { gmt = mList[ objIndex.diffH.match + 1 ]; }\n else if ( _haveDiffM ) { gmt = String( -1 * mList[ objIndex.diffM.match + 1 ] / 60 * 100 ).replace( /^(\\d)/ , '+$1' ).replace( /(^[\\-+])(\\d{3}$)/ , '$10$2' ); }\n else { gmt = '+0000'; }\n\n return new Date( year, month, day, hour, min, sec );\n }\n };\n\n\n return InkDate;\n\n});\n","/**\n * Dump/Profiling Utilities\n * @module Ink.Util.Dumper_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Dumper', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.Dumper_1 \n */\n\n var Dumper = {\n\n /**\n * Hex code for the 'tab'\n * \n * @property _tab\n * @type {String}\n * @private\n * @readOnly\n * @static\n *\n */\n _tab: '\\xA0\\xA0\\xA0\\xA0',\n\n /**\n * Function that returns the argument passed formatted\n *\n * @method _formatParam\n * @param {Mixed} param\n * @return {String} The argument passed formatted\n * @private\n * @static\n */\n _formatParam: function(param)\n {\n var formated = '';\n\n switch(typeof(param)) {\n case 'string':\n formated = '(string) '+param;\n break;\n case 'number':\n formated = '(number) '+param;\n break;\n case 'boolean':\n formated = '(boolean) '+param;\n break;\n case 'object':\n if(param !== null) {\n if(param.constructor === Array) {\n formated = 'Array \\n{\\n' + this._outputFormat(param, 0) + '\\n}';\n } else {\n formated = 'Object \\n{\\n' + this._outputFormat(param, 0) + '\\n}';\n }\n } else {\n formated = 'null';\n }\n break;\n default:\n formated = false;\n }\n\n return formated;\n },\n\n /**\n * Function that returns the tabs concatenated\n *\n * @method _getTabs\n * @param {Number} numberOfTabs Number of Tabs\n * @return {String} Tabs concatenated\n * @private\n * @static\n */\n _getTabs: function(numberOfTabs)\n {\n var tabs = '';\n for(var _i = 0; _i < numberOfTabs; _i++) {\n tabs += this._tab;\n }\n return tabs;\n },\n\n /**\n * Function that formats the parameter to display.\n *\n * @method _outputFormat\n * @param {Any} param\n * @param {Number} dim\n * @return {String} The parameter passed formatted to displat\n * @private\n * @static\n */\n _outputFormat: function(param, dim)\n {\n var formated = '';\n //var _strVal = false;\n var _typeof = false;\n for(var key in param) {\n if(param[key] !== null) {\n if(typeof(param[key]) === 'object' && (param[key].constructor === Array || param[key].constructor === Object)) {\n if(param[key].constructor === Array) {\n _typeof = 'Array';\n } else if(param[key].constructor === Object) {\n _typeof = 'Object';\n }\n formated += this._tab + this._getTabs(dim) + '[' + key + '] => '+_typeof+'\\n';\n formated += this._tab + this._getTabs(dim) + '{\\n';\n formated += this._outputFormat(param[key], dim + 1) + this._tab + this._getTabs(dim) + '}\\n';\n } else if(param[key].constructor === Function) {\n continue;\n } else {\n formated = formated + this._tab + this._getTabs(dim) + '[' + key + '] => ' + param[key] + '\\n';\n }\n } else {\n formated = formated + this._tab + this._getTabs(dim) + '[' + key + '] => null \\n';\n }\n }\n return formated;\n },\n\n /**\n * Prints variable structure.\n *\n * @method printDump\n * @param {Any} param Variable to be dumped.\n * @param {DOMElement|String} [target] Element to print the dump on.\n * @public\n * @static\n * @sample Ink_Util_Dumper_printDump.html \n */\n printDump: function(param, target)\n {\n /*jshint evil:true */\n if(!target || typeof(target) === 'undefined') {\n document.write('
      '+this._formatParam(param)+'
      ');\n } else {\n if(typeof(target) === 'string') {\n document.getElementById(target).innerHTML = '
      ' + this._formatParam(param) + '
      ';\n } else if(typeof(target) === 'object') {\n target.innerHTML = '
      '+this._formatParam(param)+'
      ';\n } else {\n throw \"TARGET must be an element or an element ID\";\n }\n }\n },\n\n /**\n * Get a variable's structure.\n *\n * @method returnDump\n * @param {Any} param Variable to get the structure.\n * @return {String} The variable's structure.\n * @public\n * @static\n * @sample Ink_Util_Dumper_returnDump.html \n */\n returnDump: function(param)\n {\n return this._formatParam(param);\n },\n\n /**\n * Alert a variable's structure.\n *\n * @method alertDump\n * @param {Any} param Variable to be dumped.\n * @public\n * @static\n * @sample Ink_Util_Dumper_alertDump.html \n */\n alertDump: function(param)\n {\n window.alert(this._formatParam(param).replace(/()(Array|Object)(<\\/b>)/g, \"$2\"));\n },\n\n /**\n * Prints the variable structure to a new window.\n *\n * @method windowDump\n * @param {Any} param Variable to be dumped.\n * @public\n * @static\n * @sample Ink_Util_Dumper_windowDump.html \n */\n windowDump: function(param)\n {\n var dumperwindow = 'dumperwindow_'+(Math.random() * 10000);\n var win = window.open('',\n dumperwindow,\n 'width=400,height=300,left=50,top=50,status,menubar,scrollbars,resizable'\n );\n win.document.open();\n win.document.write('
      '+this._formatParam(param)+'
      ');\n win.document.close();\n win.focus();\n }\n\n };\n\n return Dumper;\n\n});\n","/**\n * Internationalization Utilities \n * @module Ink.Util.I18n_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.I18n', '1', [], function () {\n 'use strict';\n\n var pattrText = /\\{(?:(\\{.*?})|(?:%s:)?(\\d+)|(?:%s)?|([\\w-]+))}/g;\n\n var funcOrVal = function( ret , args ) {\n if ( typeof ret === 'function' ) {\n return ret.apply(this, args);\n } else if (typeof ret !== undefined) {\n return ret;\n } else {\n return '';\n }\n };\n\n /**\n * You can use this module to internationalize your applications. It roughly emulates GNU gettext's API.\n *\n * @class Ink.Util.I18n\n * @constructor\n *\n * @param {Object} dict Object mapping language codes (in the form of `pt_PT`, `pt_BR`, `fr`, `en_US`, etc.) to their `dictionaries`\n * @param {String} [lang='pt_PT'] language code of the target language\n *\n * @sample Ink_Util_I18n_1.html\n */\n var I18n = function( dict , lang , testMode ) {\n if ( !( this instanceof I18n ) ) { return new I18n( dict , lang , testMode ); }\n\n this.reset( )\n .lang( lang )\n .testMode( testMode )\n .append( dict || { } , lang );\n };\n\n I18n.prototype = {\n reset: function( ) {\n this._dicts = [ ];\n this._dict = { };\n this._testMode = false;\n this._lang = this._gLang;\n\n return this;\n },\n /**\n * Adds translation strings for the helper to use.\n *\n * @method append\n * @param {Object} dict Object containing language objects identified by their language code\n *\n * @sample Ink_Util_I18n_1_append.html\n */\n append: function( dict ) {\n this._dicts.push( dict );\n\n this._dict = Ink.extendObj(this._dict , dict[ this._lang ] );\n\n return this;\n },\n /**\n * Gets or sets the language.\n * If there are more dictionaries available in cache, they will be loaded.\n *\n * @method lang\n * @param {String} lang Language code to set this instance to.\n */\n lang: function( lang ) {\n if ( !arguments.length ) { return this._lang; }\n\n if ( lang && this._lang !== lang ) {\n this._lang = lang;\n\n this._dict = { };\n\n for ( var i = 0, l = this._dicts.length; i < l; i++ ) {\n this._dict = Ink.extendObj( this._dict , this._dicts[ i ][ lang ] || { } );\n }\n }\n\n return this;\n },\n /**\n * Sets or unsets test mode.\n * In test mode, unknown strings are wrapped in `[ ... ]`. This is useful for debugging your application and to make sure all your translation keys are in place.\n *\n * @method testMode\n * @param {Boolean} bool Flag to set the test mode state\n */\n testMode: function( bool ) {\n if ( !arguments.length ) { return !!this._testMode; }\n\n if ( bool !== undefined ) { this._testMode = !!bool; }\n\n return this;\n },\n\n /**\n * Gest a key from the current dictionary\n *\n * @method getKey\n * @param {String} key\n * @return {Mixed} The object which happened to be in the current language dictionary on the given key.\n *\n * @sample Ink_Util_I18n_1_getKey.html\n */\n getKey: function( key ) {\n var ret;\n var gLang = this._gLang;\n var lang = this._lang;\n \n if ( key in this._dict ) {\n ret = this._dict[ key ];\n } else {\n I18n.langGlobal( lang );\n \n ret = this._gDict[ key ];\n \n I18n.langGlobal( gLang );\n }\n \n return ret;\n },\n\n /**\n * Translates a string.\n * Given a translation key, return a translated string, with replaced parameters.\n * When a translated string is not available, the original string is returned unchanged.\n *\n * @method text\n * @param {String} str Key to look for in i18n dictionary (which is returned verbatim if unknown)\n * @param {Object} [namedParms] Named replacements. Replaces {named} with values in this object.\n * @param {String} [args] Replacement #1 (replaces first {} and all {1})\n * @param {String} [arg2] Replacement #2 (replaces second {} and all {2})\n * @param {String} [argn*] Replacement #n (replaces nth {} and all {n})\n *\n * @sample Ink_Util_I18n_1_text.html\n */\n text: function( str /*, replacements...*/ ) {\n if ( typeof str !== 'string' ) { return; } // Backwards-compat\n\n var pars = Array.prototype.slice.call( arguments , 1 );\n var idx = 0;\n var isObj = typeof pars[ 0 ] === 'object';\n\n var original = this.getKey( str );\n if ( original === undefined ) { original = this._testMode ? '[' + str + ']' : str; }\n if ( typeof original === 'number' ) { original += ''; }\n\n if (typeof original === 'string') {\n original = original.replace( pattrText , function( m , $1 , $2 , $3 ) {\n var ret =\n $1 ? $1 :\n $2 ? pars[ $2 - ( isObj ? 0 : 1 ) ] :\n $3 ? pars[ 0 ][ $3 ] || '' :\n pars[ (idx++) + ( isObj ? 1 : 0 ) ];\n return funcOrVal( ret , [idx].concat(pars) );\n });\n return original;\n }\n \n return (\n typeof original === 'function' ? original.apply( this , pars ) :\n original instanceof Array ? funcOrVal( original[ pars[ 0 ] ] , pars ) :\n typeof original === 'object' ? funcOrVal( original[ pars[ 0 ] ] , pars ) :\n '');\n },\n\n /**\n * Translates and pluralizes text.\n * Given a singular string, a plural string and a number, translates either the singular or plural string.\n *\n * @method ntext\n * @return {String}\n *\n * @param {String} strSin Word to use when count is 1\n * @param {String} strPlur Word to use otherwise\n * @param {Number} count Number which defines which word to use\n * @param [args*] Extra arguments, to be passed to `text()`\n *\n * @sample Ink_Util_I18n_1_ntext.html\n */\n ntext: function( strSin , strPlur , count ) {\n var pars = Array.prototype.slice.apply( arguments );\n var original;\n\n if ( pars.length === 2 && typeof strPlur === 'number' ) {\n original = this.getKey( strSin );\n if ( !( original instanceof Array ) ) { return ''; }\n\n pars.splice( 0 , 1 );\n original = original[ strPlur === 1 ? 0 : 1 ];\n } else {\n pars.splice( 0 , 2 );\n original = count === 1 ? strSin : strPlur;\n }\n\n return this.text.apply( this , [ original ].concat( pars ) );\n },\n\n /**\n * Gets the ordinal suffix of a number.\n *\n * This works by using transforms (in the form of Objects or Functions) passed into the function or found in the special key `_ordinals` in the active language dictionary.\n *\n * @method ordinal\n *\n * @param {Number} num Input number\n * @param {Object|Function} [options]={} Dictionaries for translating. Each of these options' fallback is found in the current language's dictionary. The lookup order is the following: `exceptions`, `byLastDigit`, `default`. Each of these may be either an `Object` or a `Function`. If it's a function, it is called (with `number` and `digit` for any function except for byLastDigit, which is called with the `lastDigit` of the number in question), and if the function returns a string, that is used. If it's an object, the property is looked up using `obj[prop]`. If what is found is a string, it is used directly.\n * @param {Object|Function} [options.byLastDigit]={} If the language requires the last digit to be considered, mappings of last digits to ordinal suffixes can be created here.\n * @param {Object|Function} [options.exceptions]={} Map unique, special cases to their ordinal suffixes.\n *\n * @returns {String} Ordinal suffix for `num`.\n *\n * @sample Ink_Util_I18n_1_ordinal.html\n **/\n ordinal: function( num ) {\n if ( num === undefined ) { return ''; }\n\n var lastDig = +num.toString( ).slice( -1 );\n\n var ordDict = this.getKey( '_ordinals' );\n if ( ordDict === undefined ) { return ''; }\n\n if ( typeof ordDict === 'string' ) { return ordDict; }\n\n var ret;\n\n if ( typeof ordDict === 'function' ) {\n ret = ordDict( num , lastDig );\n\n if ( typeof ret === 'string' ) { return ret; }\n }\n\n if ( 'exceptions' in ordDict ) {\n ret = typeof ordDict.exceptions === 'function' ? ordDict.exceptions( num , lastDig ) :\n num in ordDict.exceptions ? funcOrVal( ordDict.exceptions[ num ] , [num , lastDig] ) :\n undefined;\n\n if ( typeof ret === 'string' ) { return ret; }\n }\n\n if ( 'byLastDigit' in ordDict ) {\n ret = typeof ordDict.byLastDigit === 'function' ? ordDict.byLastDigit( lastDig , num ) :\n lastDig in ordDict.byLastDigit ? funcOrVal( ordDict.byLastDigit[ lastDig ] , [lastDig , num] ) :\n undefined;\n\n if ( typeof ret === 'string' ) { return ret; }\n }\n\n if ( 'default' in ordDict ) {\n ret = funcOrVal( ordDict['default'] , [ num , lastDig ] );\n\n if ( typeof ret === 'string' ) { return ret; }\n }\n\n return '';\n },\n\n /**\n * Create an alias.\n *\n * Returns an alias to this I18n instance. It contains the I18n methods documented here, but is also a function. If you call it, it just calls `text()`. This is commonly assigned to \"_\".\n *\n * @method alias\n * @returns {Function} an alias to `text()` on this instance. You can also access the rest of the translation API through this alias.\n *\n * @sample Ink_Util_I18n_1_alias.html\n */\n alias: function( ) {\n var ret = Ink.bind( I18n.prototype.text , this );\n ret.ntext = Ink.bind( I18n.prototype.ntext , this );\n ret.append = Ink.bind( I18n.prototype.append , this );\n ret.ordinal = Ink.bind( I18n.prototype.ordinal , this );\n ret.testMode = Ink.bind( I18n.prototype.testMode , this );\n\n return ret;\n }\n };\n\n /**\n * Resets I18n global state (global dictionaries, and default language for instances)\n *\n * @method reset\n * @static\n *\n **/\n I18n.reset = function( ) {\n I18n.prototype._gDicts = [ ];\n I18n.prototype._gDict = { };\n I18n.prototype._gLang = 'pt_PT';\n };\n I18n.reset( );\n\n /**\n * Adds a dictionary to be used in all I18n instances for the corresponding language.\n *\n * @method appendGlobal\n * @static\n *\n * @param dict {Object} Dictionary to be added\n * @param lang {String} Language fo the dictionary being added\n *\n */\n I18n.appendGlobal = function( dict , lang ) {\n if ( lang ) {\n if ( !( lang in dict ) ) {\n var obj = { };\n\n obj[ lang ] = dict;\n\n dict = obj;\n }\n\n if ( lang !== I18n.prototype._gLang ) { I18n.langGlobal( lang ); }\n }\n\n I18n.prototype._gDicts.push( dict );\n\n Ink.extendObj( I18n.prototype._gDict , dict[ I18n.prototype._gLang ] );\n };\n\n I18n.append = function () {\n // [3.1.0] remove this alias\n Ink.warn('Ink.Util.I18n.append() was renamed to appendGlobal().');\n return I18n.appendGlobal.apply(I18n, [].slice.call(arguments));\n };\n\n /**\n * Gets or sets the current default language of I18n instances.\n *\n * @method langGlobal\n * @param lang the new language for all I18n instances\n *\n * @static\n *\n * @return {String} language code\n */\n I18n.langGlobal = function( lang ) {\n if ( !arguments.length ) { return I18n.prototype._gLang; }\n\n if ( lang && I18n.prototype._gLang !== lang ) {\n I18n.prototype._gLang = lang;\n\n I18n.prototype._gDict = { };\n\n for ( var i = 0, l = I18n.prototype._gDicts.length; i < l; i++ ) {\n Ink.extendObj( I18n.prototype._gDict , I18n.prototype._gDicts[ i ][ lang ] || { } );\n }\n }\n };\n\n I18n.lang = function () {\n // [3.1.0] remove this alias\n Ink.warn('Ink.Util.I18n.lang() was renamed to langGlobal().');\n return I18n.langGlobal.apply(I18n, [].slice.call(arguments));\n };\n \n return I18n;\n});","/**\n * JSON Utilities\n * @module Ink.Util.Json_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Json', '1', [], function() {\n 'use strict';\n\n var function_call = Function.prototype.call;\n var cx = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function twoDigits(n) {\n var r = '' + n;\n if (r.length === 1) {\n return '0' + r;\n } else {\n return r;\n }\n }\n\n var dateToISOString = Date.prototype.toISOString ?\n Ink.bind(function_call, Date.prototype.toISOString) :\n function(date) {\n // Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString\n return date.getUTCFullYear() +\n '-' + twoDigits( date.getUTCMonth() + 1 ) +\n '-' + twoDigits( date.getUTCDate() ) +\n 'T' + twoDigits( date.getUTCHours() ) +\n ':' + twoDigits( date.getUTCMinutes() ) +\n ':' + twoDigits( date.getUTCSeconds() ) +\n '.' + String( (date.getUTCMilliseconds()/1000).toFixed(3) ).slice( 2, 5 ) +\n 'Z';\n };\n\n /**\n * Use this class to convert JSON strings to JavaScript objects\n * `.parse()` and also to do the opposite operation `.stringify()`.\n * Internally, the standard JSON implementation is used if available\n * Otherwise, the functions mimic the standard implementation.\n *\n * Here's how to produce JSON from an existing object:\n * \n * Ink.requireModules(['Ink.Util.Json_1'], function (Json) {\n * var obj = {\n * key1: 'value1',\n * key2: 'value2',\n * keyArray: ['arrayValue1', 'arrayValue2', 'arrayValue3']\n * };\n * Json.stringify(obj); // The above object as a JSON string\n * });\n *\n * And here is how to parse JSON:\n *\n * Ink.requireModules(['Ink.Util.Json_1'], function (Json) {\n * var source = '{\"key\": \"value\", \"array\": [true, null, false]}';\n * Json.parse(source); // The above JSON string as an object\n * });\n *\n * @namespace Ink.Util.Json_1 \n * @static\n * \n */\n var InkJson = {\n _nativeJSON: window.JSON || null,\n\n _convertToUnicode: false,\n\n // Escape characters so as to embed them in JSON strings\n _escape: function (theString) {\n var _m = { '\\b': '\\\\b', '\\t': '\\\\t', '\\n': '\\\\n', '\\f': '\\\\f', '\\r': '\\\\r', '\"': '\\\\\"', '\\\\': '\\\\\\\\' };\n\n if (/[\"\\\\\\x00-\\x1f]/.test(theString)) {\n theString = theString.replace(/([\\x00-\\x1f\\\\\"])/g, function(a, b) {\n var c = _m[b];\n if (c) {\n return c;\n }\n c = b.charCodeAt();\n return '\\\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);\n });\n }\n\n return theString;\n },\n\n // A character conversion map\n _toUnicode: function (theString)\n {\n if(!this._convertToUnicode) {\n return this._escape(theString);\n } else {\n var unicodeString = '';\n var inInt = false;\n var theUnicode = false;\n var i = 0;\n var total = theString.length;\n while(i < total) {\n inInt = theString.charCodeAt(i);\n if( (inInt >= 32 && inInt <= 126) ||\n //(inInt >= 48 && inInt <= 57) ||\n //(inInt >= 65 && inInt <= 90) ||\n //(inInt >= 97 && inInt <= 122) ||\n inInt === 8 ||\n inInt === 9 ||\n inInt === 10 ||\n inInt === 12 ||\n inInt === 13 ||\n inInt === 32 ||\n inInt === 34 ||\n inInt === 47 ||\n inInt === 58 ||\n inInt === 92) {\n\n if(inInt === 34 || inInt === 92 || inInt === 47) {\n theUnicode = '\\\\'+theString.charAt(i);\n } else if(inInt === 8) {\n theUnicode = '\\\\b';\n } else if(inInt === 9) {\n theUnicode = '\\\\t';\n } else if(inInt === 10) {\n theUnicode = '\\\\n';\n } else if(inInt === 12) {\n theUnicode = '\\\\f';\n } else if(inInt === 13) {\n theUnicode = '\\\\r';\n } else {\n theUnicode = theString.charAt(i);\n }\n } else {\n if(this._convertToUnicode) {\n theUnicode = theString.charCodeAt(i).toString(16)+''.toUpperCase();\n while (theUnicode.length < 4) {\n theUnicode = '0' + theUnicode;\n }\n theUnicode = '\\\\u' + theUnicode;\n } else {\n theUnicode = theString.charAt(i);\n }\n }\n unicodeString += theUnicode;\n\n i++;\n }\n\n return unicodeString;\n }\n\n },\n\n _stringifyValue: function(param) {\n if (typeof param === 'string') {\n return '\"' + this._toUnicode(param) + '\"';\n } else if (typeof param === 'number' && (isNaN(param) || !isFinite(param))) { // Unusable numbers go null\n return 'null';\n } else if (typeof param === 'undefined' || param === null) { // And so does undefined\n return 'null';\n } else if (typeof param.toJSON === 'function') {\n var t = param.toJSON();\n if (typeof t === 'string') {\n return '\"' + this._escape(t) + '\"';\n } else {\n return this._escape(t.toString());\n }\n } else if (typeof param === 'number' || typeof param === 'boolean') { // These ones' toString methods return valid JSON.\n return '' + param;\n } else if (typeof param === 'function') {\n return 'null'; // match JSON.stringify\n } else if (param.constructor === Date) {\n return '\"' + this._escape(dateToISOString(param)) + '\"';\n } else if (param.constructor === Array) {\n var arrayString = '';\n for (var i = 0, len = param.length; i < len; i++) {\n if (i > 0) {\n arrayString += ',';\n }\n arrayString += this._stringifyValue(param[i]);\n }\n return '[' + arrayString + ']';\n } else { // Object\n var objectString = '';\n for (var k in param) {\n if ({}.hasOwnProperty.call(param, k)) {\n if (objectString !== '') {\n objectString += ',';\n }\n objectString += '\"' + this._escape(k) + '\": ' + this._stringifyValue(param[k]);\n }\n }\n return '{' + objectString + '}';\n }\n },\n\n /**\n * Serializes a JSON object into a string.\n *\n * @method stringify\n * @param {Object} input Data to be serialized into JSON\n * @param {Boolean} convertToUnicode When `true`, converts string contents to unicode \\uXXXX\n * @return {String} Serialized string\n *\n * @sample Ink_Util_Json_stringify.html \n */\n stringify: function(input, convertToUnicode) {\n this._convertToUnicode = !!convertToUnicode;\n if(!this._convertToUnicode && this._nativeJSON) {\n return this._nativeJSON.stringify(input);\n }\n return this._stringifyValue(input); // And recurse.\n },\n \n /**\n * Parses a JSON text through a function\n * \n * @method parse\n * @param text {String} Input string\n * @param reviver {Function} Function receiving `(key, value)`, and `this`=(containing object), used to walk objects.\n * \n * @return {Object} JSON object\n *\n * @sample Ink_Util_Json_parse.html \n */\n /* From https://github.com/douglascrockford/JSON-js/blob/master/json.js */\n parse: function (text, reviver) {\n /*jshint evil:true*/\n\n// The parse method takes a text and an optional reviver function, and returns\n// a JavaScript value if the text is a valid JSON text.\n\n var j;\n\n function walk(holder, key) {\n\n// The walk method is used to recursively walk the resulting structure so\n// that modifications can be made.\n\n var k, v, value = holder[key];\n if (value && typeof value === 'object') {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = walk(value, k);\n if (v !== undefined) {\n value[k] = v;\n } else {\n delete value[k];\n }\n }\n }\n }\n return reviver.call(holder, key, value);\n }\n\n\n// Parsing happens in four stages. In the first stage, we replace certain\n// Unicode characters with escape sequences. JavaScript handles many characters\n// incorrectly, either silently deleting them, or treating them as line endings.\n\n text = String(text);\n cx.lastIndex = 0;\n if (cx.test(text)) {\n text = text.replace(cx, function (a) {\n return '\\\\u' +\n ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n });\n }\n\n// In the second stage, we run the text against regular expressions that look\n// for non-JSON patterns. We are especially concerned with '()' and 'new'\n// because they can cause invocation, and '=' because it can cause mutation.\n// But just to be safe, we want to reject all unexpected forms.\n\n// We split the second stage into 4 regexp operations in order to work around\n// crippling inefficiencies in IE's and Safari's regexp engines. First we\n// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we\n// replace all simple value tokens with ']' characters. Third, we delete all\n// open brackets that follow a colon or comma or that begin the text. Finally,\n// we look to see that the remaining characters are only whitespace or ']' or\n// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.\n\n if (/^[\\],:{}\\s]*$/\n .test(text.replace(/\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')\n .replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g, ']')\n .replace(/(?:^|:|,)(?:\\s*\\[)+/g, ''))) {\n\n// In the third stage we use the eval function to compile the text into a\n// JavaScript structure. The '{' operator is subject to a syntactic ambiguity\n// in JavaScript: it can begin a block or an object literal. We wrap the text\n// in parens to eliminate the ambiguity.\n\n j = eval('(' + text + ')');\n\n// In the optional fourth stage, we recursively walk the new structure, passing\n// each name/value pair to a reviver function for possible transformation.\n\n return typeof reviver === 'function' ?\n walk({'': j}, '') :\n j;\n }\n\n// If the text is not JSON parseable, then a SyntaxError is thrown.\n\n throw new SyntaxError('JSON.parse');\n }\n };\n\n return InkJson;\n});\n","/**\n * String Utilities\n * @module Ink.Util.String_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.String', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.String_1 \n */\n var InkUtilString = {\n\n /**\n * List of special chars\n * \n * @property _chars\n * @type {Array}\n * @private\n * @readOnly\n * @static\n */\n _chars: ['&','à','á','â','ã','ä','å','æ','ç','è','é',\n 'ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô',\n 'õ','ö','ø','ù','ú','û','ü','ý','þ','ÿ','À',\n 'Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë',\n 'Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö',\n 'Ø','Ù','Ú','Û','Ü','Ý','Þ','€','\\\"','ß','<',\n '>','¢','£','¤','¥','¦','§','¨','©','ª','«',\n '¬','\\xad','®','¯','°','±','²','³','´','µ','¶',\n '·','¸','¹','º','»','¼','½','¾'],\n\n /**\n * List of the special characters' html entities\n * \n * @property _entities\n * @type {Array}\n * @private\n * @readOnly\n * @static\n */\n _entities: ['amp','agrave','aacute','acirc','atilde','auml','aring',\n 'aelig','ccedil','egrave','eacute','ecirc','euml','igrave',\n 'iacute','icirc','iuml','eth','ntilde','ograve','oacute',\n 'ocirc','otilde','ouml','oslash','ugrave','uacute','ucirc',\n 'uuml','yacute','thorn','yuml','Agrave','Aacute','Acirc',\n 'Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute',\n 'Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde',\n 'Ograve','Oacute','Ocirc','Otilde','Ouml','Oslash','Ugrave',\n 'Uacute','Ucirc','Uuml','Yacute','THORN','euro','quot','szlig',\n 'lt','gt','cent','pound','curren','yen','brvbar','sect','uml',\n 'copy','ordf','laquo','not','shy','reg','macr','deg','plusmn',\n 'sup2','sup3','acute','micro','para','middot','cedil','sup1',\n 'ordm','raquo','frac14','frac12','frac34'],\n\n /**\n * List of accented chars\n * \n * @property _accentedChars\n * @type {Array}\n * @private\n * @readOnly\n * @static\n */\n _accentedChars:['à','á','â','ã','ä','å',\n 'è','é','ê','ë',\n 'ì','í','î','ï',\n 'ò','ó','ô','õ','ö',\n 'ù','ú','û','ü',\n 'ç','ñ',\n 'À','Á','Â','Ã','Ä','Å',\n 'È','É','Ê','Ë',\n 'Ì','Í','Î','Ï',\n 'Ò','Ó','Ô','Õ','Ö',\n 'Ù','Ú','Û','Ü',\n 'Ç','Ñ'],\n\n /**\n * List of the accented chars (above), but without the accents\n * \n * @property _accentedRemovedChars\n * @type {Array}\n * @private\n * @readOnly\n * @static\n */\n _accentedRemovedChars:['a','a','a','a','a','a',\n 'e','e','e','e',\n 'i','i','i','i',\n 'o','o','o','o','o',\n 'u','u','u','u',\n 'c','n',\n 'A','A','A','A','A','A',\n 'E','E','E','E',\n 'I','I','I','I',\n 'O','O','O','O','O',\n 'U','U','U','U',\n 'C','N'],\n /**\n * Object that contains the basic HTML unsafe chars, as keys, and their HTML entities as values\n * \n * @property _htmlUnsafeChars\n * @type {Object}\n * @private\n * @readOnly\n * @static\n */\n _htmlUnsafeChars:{'<':'<','>':'>','&':'&','\"':'"',\"'\":'''},\n\n /**\n * Capitalizes a word.\n * If param as more than one word, it converts first letter of all words that have more than 2 letters\n *\n * @method ucFirst\n * @param {String} string String to capitalize.\n * @param {Boolean} [firstWordOnly]=false Flag to capitalize only the first word.\n * @return {String} Camel cased string.\n * @public\n * @static\n * @sample Ink_Util_String_ucFirst.html \n */\n ucFirst: function(string, firstWordOnly) {\n var replacer = firstWordOnly ? /(^|\\s)(\\w)(\\S{2,})/ : /(^|\\s)(\\w)(\\S{2,})/g;\n return string ? String(string).replace(replacer, function(_, $1, $2, $3){\n return $1 + $2.toUpperCase() + $3.toLowerCase();\n }) : string;\n },\n\n /**\n * Trims whitespace from strings\n *\n * @method trim\n * @param {String} string String to be trimmed\n * @return {String} Trimmed string\n * @public\n * @static\n * @sample Ink_Util_String_trim.html \n */\n trim: function(string)\n {\n if (typeof string === 'string') {\n return string.replace(/^\\s+|\\s+$|\\n+$/g, '');\n }\n return string;\n },\n\n /**\n * Strips HTML tags from strings\n *\n * @method stripTags\n * @param {String} string String to strip tags from.\n * @param {String} allowed Comma separated list of allowed tags.\n * @return {String} Stripped string\n * @public\n * @static\n * @sample Ink_Util_String_stripTags.html \n */\n stripTags: function(string, allowed)\n {\n if (allowed && typeof allowed === 'string') {\n var aAllowed = InkUtilString.trim(allowed).split(',');\n var aNewAllowed = [];\n var cleanedTag = false;\n for(var i=0; i < aAllowed.length; i++) {\n if(InkUtilString.trim(aAllowed[i]) !== '') {\n cleanedTag = InkUtilString.trim(aAllowed[i].replace(/(<|\\>)/g, '').replace(/\\s/, ''));\n aNewAllowed.push('(<'+cleanedTag+'\\\\s[^>]+>|<(\\\\s|\\\\/)?(\\\\s|\\\\/)?'+cleanedTag+'>)');\n }\n }\n var strAllowed = aNewAllowed.join('|');\n var reAllowed = new RegExp(strAllowed, \"i\");\n\n var aFoundTags = string.match(new RegExp(\"<[^>]*>\", \"g\"));\n\n for(var j=0; j < aFoundTags.length; j++) {\n if(!aFoundTags[j].match(reAllowed)) {\n string = string.replace((new RegExp(aFoundTags[j], \"gm\")), '');\n }\n }\n return string;\n } else {\n return string.replace(/<[^\\>]+\\>/g, '');\n }\n },\n\n /**\n * Encodes string into HTML entities.\n *\n * @method htmlEntitiesEncode\n * @param {String} string\n * @return {String} string encoded\n * @public\n * @static\n * @sample Ink_Util_String_htmlEntitiesEncode.html \n */\n htmlEntitiesEncode: function(string)\n {\n if (string && string.replace) {\n var re = false;\n for (var i = 0; i < InkUtilString._chars.length; i++) {\n re = new RegExp(InkUtilString._chars[i], \"gm\");\n string = string.replace(re, '&' + InkUtilString._entities[i] + ';');\n }\n }\n return string;\n },\n\n /**\n * Decodes string from HTML entities.\n *\n * @method htmlEntitiesDecode\n * @param {String} string String to be decoded\n * @return {String} Decoded string\n * @public\n * @static\n * @sample Ink_Util_String_htmlEntitiesDecode.html \n */\n htmlEntitiesDecode: function(string)\n {\n if (string && string.replace) {\n var re = false;\n for (var i = 0; i < InkUtilString._entities.length; i++) {\n re = new RegExp(\"&\"+InkUtilString._entities[i]+\";\", \"gm\");\n string = string.replace(re, InkUtilString._chars[i]);\n }\n string = string.replace(/&#[^;]+;?/g, function($0){\n if ($0.charAt(2) === 'x') {\n return String.fromCharCode(parseInt($0.substring(3), 16));\n }\n else {\n return String.fromCharCode(parseInt($0.substring(2), 10));\n }\n });\n }\n return string;\n },\n\n /**\n * Encode a string to UTF-8.\n *\n * @method utf8Encode\n * @param {String} string String to be encoded\n * @return {String} string UTF-8 encoded string\n * @public\n * @static\n */\n utf8Encode: function(string) {\n /*jshint bitwise:false*/\n string = string.replace(/\\r\\n/g,\"\\n\");\n var utfstring = \"\";\n\n for (var n = 0; n < string.length; n++) {\n\n var c = string.charCodeAt(n);\n\n if (c < 128) {\n utfstring += String.fromCharCode(c);\n }\n else if((c > 127) && (c < 2048)) {\n utfstring += String.fromCharCode((c >> 6) | 192);\n utfstring += String.fromCharCode((c & 63) | 128);\n }\n else {\n utfstring += String.fromCharCode((c >> 12) | 224);\n utfstring += String.fromCharCode(((c >> 6) & 63) | 128);\n utfstring += String.fromCharCode((c & 63) | 128);\n }\n\n }\n return utfstring;\n },\n\n /**\n * Truncates a string without breaking words.\n *\n * @method shortString\n * @param {String} str String to truncate\n * @param {Number} n Number of chars of the short string\n * @return {String} \n * @public\n * @static\n * @sample Ink_Util_String_shortString.html \n */\n shortString: function(str,n) {\n var words = str.split(' ');\n var resultstr = '';\n for(var i = 0; i < words.length; i++ ){\n if((resultstr + words[i] + ' ').length>=n){\n resultstr += '…';\n break;\n }\n resultstr += words[i] + ' ';\n }\n return resultstr;\n },\n\n /**\n * Truncates a string, breaking words and adding ... at the end.\n *\n * @method truncateString\n * @param {String} str String to truncate\n * @param {Number} length Limit for the returned string, ellipsis included.\n * @return {String} Truncated String\n * @public\n * @static\n * @sample Ink_Util_String_truncateString.html \n */\n truncateString: function(str, length) {\n if(str.length - 1 > length) {\n return str.substr(0, length - 1) + \"\\u2026\";\n } else {\n return str;\n }\n },\n\n /**\n * Decodes a string from UTF-8.\n *\n * @method utf8Decode\n * @param {String} string String to be decoded\n * @return {String} Decoded string\n * @public\n * @static\n */\n utf8Decode: function(utfstring) {\n /*jshint bitwise:false*/\n var string = \"\";\n var i = 0, c = 0, c2 = 0, c3 = 0;\n\n while ( i < utfstring.length ) {\n\n c = utfstring.charCodeAt(i);\n\n if (c < 128) {\n string += String.fromCharCode(c);\n i++;\n }\n else if((c > 191) && (c < 224)) {\n c2 = utfstring.charCodeAt(i+1);\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n i += 2;\n }\n else {\n c2 = utfstring.charCodeAt(i+1);\n c3 = utfstring.charCodeAt(i+2);\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n i += 3;\n }\n\n }\n return string;\n },\n\n /**\n * Removes all accented characters from a string.\n *\n * @method removeAccentedChars\n * @param {String} string String to remove accents from\n * @return {String} String without accented chars\n * @public\n * @static\n * @sample Ink_Util_String_removeAccentedChars.html \n */\n removeAccentedChars: function(string)\n {\n var newString = string;\n var re = false;\n for (var i = 0; i < InkUtilString._accentedChars.length; i++) {\n re = new RegExp(InkUtilString._accentedChars[i], \"gm\");\n newString = newString.replace(re, '' + InkUtilString._accentedRemovedChars[i] + '');\n }\n return newString;\n },\n\n /**\n * Count the number of occurrences of a specific needle in a haystack\n *\n * @method substrCount\n * @param {String} haystack String to search in\n * @param {String} needle String to search for\n * @return {Number} Number of occurrences\n * @public\n * @static\n * @sample Ink_Util_String_substrCount.html \n */\n substrCount: function(haystack,needle)\n {\n return haystack ? haystack.split(needle).length - 1 : 0;\n },\n\n /**\n * Eval a JSON - We recommend you Ink.Util.Json\n *\n * @method evalJSON\n * @param {String} strJSON JSON string to eval\n * @param {Boolean} sanitize Flag to sanitize input\n * @return {Object} JS Object\n * @public\n * @static\n */\n evalJSON: function(strJSON, sanitize) {\n /* jshint evil:true */\n if( (typeof sanitize === 'undefined' || sanitize === null) || InkUtilString.isJSON(strJSON)) {\n try {\n if(typeof(JSON) !== \"undefined\" && typeof(JSON.parse) !== 'undefined'){\n return JSON.parse(strJSON);\n }\n return eval('('+strJSON+')');\n } catch(e) {\n throw new Error('ERROR: Bad JSON string...');\n }\n }\n },\n\n /**\n * Checks if a string is a valid JSON object (string encoded)\n *\n * @method isJSON \n * @param {String} str String to check\n * @return {Boolean}\n * @public\n * @static\n */\n isJSON: function(str)\n {\n str = str.replace(/\\\\./g, '@').replace(/\"[^\"\\\\\\n\\r]*\"/g, '');\n return (/^[,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]*$/).test(str);\n },\n\n /**\n * Escapes unsafe html chars as HTML entities\n *\n * @method htmlEscapeUnsafe\n * @param {String} str String to escape\n * @return {String} Escaped string\n * @public\n * @static\n * @sample Ink_Util_String_htmlEscapeUnsafe.html \n */\n htmlEscapeUnsafe: function(str){\n var chars = InkUtilString._htmlUnsafeChars;\n return str !== null ? String(str).replace(/[<>&'\"]/g,function(c){return chars[c];}) : str;\n },\n\n /**\n * Normalizes whitespace in string.\n * String is trimmed and sequences of whitespaces are collapsed.\n *\n * @method normalizeWhitespace\n * @param {String} str String to normalize\n * @return {String} Normalized string\n * @public\n * @static\n * @sample Ink_Util_String_normalizeWhitespace.html \n */\n normalizeWhitespace: function(str){\n return str !== null ? InkUtilString.trim(String(str).replace(/\\s+/g,' ')) : str;\n },\n\n /**\n * Converts string to unicode.\n *\n * @method toUnicode\n * @param {String} str String to convert\n * @return {String} Unicoded String\n * @public\n * @static\n * @sample Ink_Util_String_toUnicode.html \n */\n toUnicode: function(str) {\n if (typeof str === 'string') {\n var unicodeString = '';\n var inInt = false;\n var theUnicode = false;\n var total = str.length;\n var i=0;\n\n while(i < total)\n {\n inInt = str.charCodeAt(i);\n if( (inInt >= 32 && inInt <= 126) ||\n inInt === 8 ||\n inInt === 9 ||\n inInt === 10 ||\n inInt === 12 ||\n inInt === 13 ||\n inInt === 32 ||\n inInt === 34 ||\n inInt === 47 ||\n inInt === 58 ||\n inInt === 92) {\n\n /*\n if(inInt == 34 || inInt == 92 || inInt == 47) {\n theUnicode = '\\\\'+str.charAt(i);\n } else {\n }\n */\n if(inInt === 8) {\n theUnicode = '\\\\b';\n } else if(inInt === 9) {\n theUnicode = '\\\\t';\n } else if(inInt === 10) {\n theUnicode = '\\\\n';\n } else if(inInt === 12) {\n theUnicode = '\\\\f';\n } else if(inInt === 13) {\n theUnicode = '\\\\r';\n } else {\n theUnicode = str.charAt(i);\n }\n } else {\n theUnicode = str.charCodeAt(i).toString(16)+''.toUpperCase();\n while (theUnicode.length < 4) {\n theUnicode = '0' + theUnicode;\n }\n theUnicode = '\\\\u' + theUnicode;\n }\n unicodeString += theUnicode;\n\n i++;\n }\n return unicodeString;\n }\n },\n\n /**\n * Escapes a unicode character.\n *\n * @method escape\n * @param {String} c Character to escape\n * @return {String} Escaped character. Returns \\xXX if hex smaller than 0x100, otherwise \\uXXXX\n * @public\n * @static\n * @sample Ink_Util_String_escape.html \n */\n escape: function(c) {\n var hex = (c).charCodeAt(0).toString(16).split('');\n if (hex.length < 3) {\n while (hex.length < 2) { hex.unshift('0'); }\n hex.unshift('x');\n }\n else {\n while (hex.length < 4) { hex.unshift('0'); }\n hex.unshift('u');\n }\n\n hex.unshift('\\\\');\n return hex.join('');\n },\n\n /**\n * Unescapes a unicode character escape sequence\n *\n * @method unescape\n * @param {String} es Escape sequence\n * @return {String} String un-unicoded\n * @public\n * @static\n * @sample Ink_Util_String_unescape.html \n */\n unescape: function(es) {\n var idx = es.lastIndexOf('0');\n idx = idx === -1 ? 2 : Math.min(idx, 2);\n //console.log(idx);\n var hexNum = es.substring(idx);\n //console.log(hexNum);\n var num = parseInt(hexNum, 16);\n return String.fromCharCode(num);\n },\n\n /**\n * Escapes a string to unicode characters\n *\n * @method escapeText\n * @param {String} txt \n * @param {Array} [whiteList] Whitelist of characters\n * @return {String} String escaped to Unicode\n * @public\n * @static\n * @sample Ink_Util_String_escapeText.html \n */\n escapeText: function(txt, whiteList) {\n if (whiteList === undefined) {\n whiteList = ['[', ']', '\\'', ','];\n }\n var txt2 = [];\n var c, C;\n for (var i = 0, f = txt.length; i < f; ++i) {\n c = txt[i];\n C = c.charCodeAt(0);\n if (C < 32 || C > 126 && whiteList.indexOf(c) === -1) {\n c = InkUtilString.escape(c);\n }\n txt2.push(c);\n }\n return txt2.join('');\n },\n\n /**\n * Regex to check escaped strings\n *\n * @property escapedCharRegex\n * @type {Regex}\n * @public\n * @readOnly\n * @static\n */\n escapedCharRegex: /(\\\\x[0-9a-fA-F]{2})|(\\\\u[0-9a-fA-F]{4})/g,\n\n /**\n * Unescapes a string\n *\n * @method unescapeText\n * @param {String} txt\n * @return {String} Unescaped string\n * @public\n * @static\n * @sample Ink_Util_String_unescapeText.html \n */\n unescapeText: function(txt) {\n /*jshint boss:true */\n var m;\n while (m = InkUtilString.escapedCharRegex.exec(txt)) {\n m = m[0];\n txt = txt.replace(m, InkUtilString.unescape(m));\n InkUtilString.escapedCharRegex.lastIndex = 0;\n }\n return txt;\n },\n\n /**\n * Compares two strings.\n *\n * @method strcmp\n * @param {String} str1 First String\n * @param {String} str2 Second String\n * @return {Number}\n * @public\n * @static\n * @sample Ink_Util_String_strcmp.html \n */\n strcmp: function(str1, str2) {\n return ((str1 === str2) ? 0 : ((str1 > str2) ? 1 : -1));\n },\n\n /**\n * Splits a string into smaller chunks\n *\n * @method packetize\n * @param {String} str String to divide\n * @param {Number} maxLen Maximum chunk size (in characters)\n * @return {Array} Chunks of the original string\n * @public\n * @static\n * @sample Ink_Util_String_packetize.html \n */\n packetize: function(str, maxLen) {\n var len = str.length;\n var parts = new Array( Math.ceil(len / maxLen) );\n var chars = str.split('');\n var sz, i = 0;\n while (len) {\n sz = Math.min(maxLen, len);\n parts[i++] = chars.splice(0, sz).join('');\n len -= sz;\n }\n return parts;\n }\n };\n\n return InkUtilString;\n\n});\n","/**\n * URL Utilities\n * @module Ink.Util.Url_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Url', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.Url_1\n */\n var Url = {\n\n /**\n * Auxiliary string for encoding\n *\n * @property _keyStr\n * @type {String}\n * @readOnly\n * @private\n */\n _keyStr : 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n\n\n /**\n * Gets URL of current page\n *\n * @method getUrl\n * @return Current URL\n * @public\n * @static\n * @sample Ink_Util_Url_getUrl.html \n */\n getUrl: function()\n {\n return window.location.href;\n },\n\n /**\n * Generates an URL string.\n *\n * @method genQueryString\n * @param {String} uri Base URL\n * @param {Object} params Object to transform to query string\n * @return {String} URI with query string set\n * @public\n * @static\n * @sample Ink_Util_Url_genQueryString.html \n */\n genQueryString: function(uri, params) {\n var hasQuestionMark = uri.indexOf('?') !== -1;\n var sep, pKey, pValue, parts = [uri];\n\n for (pKey in params) {\n if (params.hasOwnProperty(pKey)) {\n if (!hasQuestionMark) {\n sep = '?';\n hasQuestionMark = true;\n } else {\n sep = '&';\n }\n pValue = params[pKey];\n if (typeof pValue !== 'number' && !pValue) {\n pValue = '';\n }\n parts = parts.concat([sep, encodeURIComponent(pKey), '=', encodeURIComponent(pValue)]);\n }\n }\n\n return parts.join('');\n },\n\n /**\n * Gets an object from an URL encoded string.\n *\n * @method getQueryString\n * @param {String} [str] URL String. When not specified it uses the current URL.\n * @return {Object} Key-Value pair object\n * @public\n * @static\n * @sample Ink_Util_Url_getQueryString.html \n */\n getQueryString: function(str)\n {\n var url;\n if(str && typeof(str) !== 'undefined') {\n url = str;\n } else {\n url = this.getUrl();\n }\n var aParams = {};\n if(url.match(/\\?(.+)/i)) {\n var queryStr = url.replace(/^(.*)\\?([^\\#]+)(\\#(.*))?/g, \"$2\");\n if(queryStr.length > 0) {\n var aQueryStr = queryStr.split(/[;&]/);\n for(var i=0; i < aQueryStr.length; i++) {\n var pairVar = aQueryStr[i].split('=');\n aParams[decodeURIComponent(pairVar[0])] = (typeof(pairVar[1]) !== 'undefined' && pairVar[1]) ? decodeURIComponent(pairVar[1]) : false;\n }\n }\n }\n return aParams;\n },\n\n /**\n * Gets the URL hash value\n *\n * @method getAnchor\n * @param {String} [str] URL String. Defaults to current page URL.\n * @return {String|Boolean} Hash in the URL. If there's no hash, returns false.\n * @public\n * @static\n * @sample Ink_Util_Url_getAnchor.html \n */\n getAnchor: function(str)\n {\n var url;\n if(str && typeof(str) !== 'undefined') {\n url = str;\n } else {\n url = this.getUrl();\n }\n var anchor = false;\n if(url.match(/#(.+)/)) {\n anchor = url.replace(/([^#]+)#(.*)/, \"$2\");\n }\n return anchor;\n },\n\n /**\n * Gets the anchor string of an URL\n *\n * @method getAnchorString\n * @param {String} [string] URL to parse. Defaults to current URL.\n * @return {Object} Key-value pair object of the URL's hashtag 'variables'\n * @public\n * @static\n * @sample Ink_Util_Url_getAnchorString.html \n */\n getAnchorString: function(string)\n {\n var url;\n if(string && typeof(string) !== 'undefined') {\n url = string;\n } else {\n url = this.getUrl();\n }\n var aParams = {};\n if(url.match(/#(.+)/i)) {\n var anchorStr = url.replace(/^([^#]+)#(.*)?/g, \"$2\");\n if(anchorStr.length > 0) {\n var aAnchorStr = anchorStr.split(/[;&]/);\n for(var i=0; i < aAnchorStr.length; i++) {\n var pairVar = aAnchorStr[i].split('=');\n aParams[decodeURIComponent(pairVar[0])] = (typeof(pairVar[1]) !== 'undefined' && pairVar[1]) ? decodeURIComponent(pairVar[1]) : false;\n }\n }\n }\n return aParams;\n },\n\n\n /**\n * Parses URL string into URL parts\n *\n * @method parseUrl\n * @param {String} url URL to be parsed\n * @return {Object} Parsed URL as a key-value object.\n * @public\n * @static\n * @sample Ink_Util_Url_parseUrl.html \n */\n parseUrl: function(url) {\n var aURL = {};\n if(url && typeof url === 'string') {\n if(url.match(/^([^:]+):\\/\\//i)) {\n var re = /^([^:]+):\\/\\/([^\\/]*)\\/?([^\\?#]*)\\??([^#]*)#?(.*)/i;\n if(url.match(re)) {\n aURL.scheme = url.replace(re, \"$1\");\n aURL.host = url.replace(re, \"$2\");\n aURL.path = '/'+url.replace(re, \"$3\");\n aURL.query = url.replace(re, \"$4\") || false;\n aURL.fragment = url.replace(re, \"$5\") || false;\n }\n } else {\n var re1 = new RegExp(\"^([^\\\\?]+)\\\\?([^#]+)#(.*)\", \"i\");\n var re2 = new RegExp(\"^([^\\\\?]+)\\\\?([^#]+)#?\", \"i\");\n var re3 = new RegExp(\"^([^\\\\?]+)\\\\??\", \"i\");\n if(url.match(re1)) {\n aURL.scheme = false;\n aURL.host = false;\n aURL.path = url.replace(re1, \"$1\");\n aURL.query = url.replace(re1, \"$2\");\n aURL.fragment = url.replace(re1, \"$3\");\n } else if(url.match(re2)) {\n aURL.scheme = false;\n aURL.host = false;\n aURL.path = url.replace(re2, \"$1\");\n aURL.query = url.replace(re2, \"$2\");\n aURL.fragment = false;\n } else if(url.match(re3)) {\n aURL.scheme = false;\n aURL.host = false;\n aURL.path = url.replace(re3, \"$1\");\n aURL.query = false;\n aURL.fragment = false;\n }\n }\n if(aURL.host) {\n var regPort = /^(.*?)\\\\:(\\\\d+)$/i;\n // check for port\n if(aURL.host.match(regPort)) {\n var tmpHost1 = aURL.host;\n aURL.host = tmpHost1.replace(regPort, \"$1\");\n aURL.port = tmpHost1.replace(regPort, \"$2\");\n } else {\n aURL.port = false;\n }\n // check for user and pass\n if(aURL.host.match(/@/i)) {\n var tmpHost2 = aURL.host;\n aURL.host = tmpHost2.split('@')[1];\n var tmpUserPass = tmpHost2.split('@')[0];\n if(tmpUserPass.match(/\\:/)) {\n aURL.user = tmpUserPass.split(':')[0];\n aURL.pass = tmpUserPass.split(':')[1];\n } else {\n aURL.user = tmpUserPass;\n aURL.pass = false;\n }\n }\n }\n }\n return aURL;\n },\n\n /**\n * Formats an URL object into an URL string.\n *\n * @method format\n * @param urlObj Window.location, a.href, or parseUrl object to format\n * @return {String} Full URL.\n */\n format: function (urlObj) {\n var protocol = '';\n var host = '';\n var path = '';\n var frag = '';\n var query = '';\n\n if (typeof urlObj.protocol === 'string') {\n protocol = urlObj.protocol + '//'; // here it comes with the colon\n } else if (typeof urlObj.scheme === 'string') {\n protocol = urlObj.scheme + '://';\n }\n\n host = urlObj.host || urlObj.hostname || '';\n path = urlObj.path || '';\n\n if (typeof urlObj.query === 'string') {\n query = urlObj.query;\n } else if (typeof urlObj.search === 'string') {\n query = urlObj.search.replace(/^\\?/, '');\n }\n if (typeof urlObj.fragment === 'string') {\n frag = urlObj.fragment;\n } else if (typeof urlObj.hash === 'string') {\n frag = urlObj.hash.replace(/#$/, '');\n }\n\n return [\n protocol,\n host,\n path,\n query && '?' + query,\n frag && '#' + frag\n ].join('');\n },\n\n /**\n * Gets the last loaded script element\n *\n * @method currentScriptElement\n * @param {String} [match] String to match against the script src attribute\n * @return {DOMElement|Boolean} Returns the `script` DOM Element or false if unable to find it.\n * @public\n * @static\n * @sample Ink_Util_Url_currentScriptElement.html \n */\n currentScriptElement: function(match)\n {\n var aScripts = document.getElementsByTagName('script');\n if(typeof(match) === 'undefined') {\n if(aScripts.length > 0) {\n return aScripts[(aScripts.length - 1)];\n } else {\n return false;\n }\n } else {\n var curScript = false;\n var re = new RegExp(\"\"+match+\"\", \"i\");\n for(var i=0, total = aScripts.length; i < total; i++) {\n curScript = aScripts[i];\n if(re.test(curScript.src)) {\n return curScript;\n }\n }\n return false;\n }\n },\n\n \n /*\n base64Encode: function(string)\n {\n /**\n * --function {String} ?\n * --Convert a string to BASE 64\n * @param {String} string - string to convert\n * @return base64 encoded string\n *\n * \n if(!SAPO.Utility.String || typeof(SAPO.Utility.String) === 'undefined') {\n throw \"SAPO.Utility.Url.base64Encode depends of SAPO.Utility.String, which has not been referred.\";\n }\n\n var output = \"\";\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n\n var input = SAPO.Utility.String.utf8Encode(string);\n\n while (i < input.length) {\n\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +\n this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);\n }\n return output;\n },\n base64Decode: function(string)\n {\n * --function {String} ?\n * Decode a BASE 64 encoded string\n * --param {String} string base64 encoded string\n * --return string decoded\n if(!SAPO.Utility.String || typeof(SAPO.Utility.String) === 'undefined') {\n throw \"SAPO.Utility.Url.base64Decode depends of SAPO.Utility.String, which has not been referred.\";\n }\n\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n\n var input = string.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n while (i < input.length) {\n\n enc1 = this._keyStr.indexOf(input.charAt(i++));\n enc2 = this._keyStr.indexOf(input.charAt(i++));\n enc3 = this._keyStr.indexOf(input.charAt(i++));\n enc4 = this._keyStr.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output = output + String.fromCharCode(chr1);\n\n if (enc3 !== 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 !== 64) {\n output = output + String.fromCharCode(chr3);\n }\n }\n output = SAPO.Utility.String.utf8Decode(output);\n return output;\n },\n */\n\n\n /**\n * Debug function ?\n *\n * @method _debug\n * @private\n * @static\n */\n _debug: function() {}\n\n };\n\n return Url;\n\n});\n","/**\n * Validation Utilities\n * @module Ink.Util.Validator_1\n * @version 1\n */\n \nInk.createModule('Ink.Util.Validator', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.Validator_1 \n */\n var Validator = {\n\n /**\n * List of country codes avaible for the isPhone method\n *\n * @property _countryCodes\n * @type {Array}\n * @private\n * @static\n * @readOnly\n */\n _countryCodes : [\n 'AO',\n 'CV',\n 'MZ',\n 'PT'\n ],\n\n /**\n * International number for portugal\n *\n * @property _internacionalPT\n * @type {Number}\n * @private\n * @static\n * @readOnly\n *\n */\n _internacionalPT: 351,\n\n /**\n * List of all portuguese number prefixes\n *\n * @property _indicativosPT\n * @type {Object}\n * @private\n * @static\n * @readOnly\n *\n */\n _indicativosPT: {\n 21: 'lisboa',\n 22: 'porto',\n 231: 'mealhada',\n 232: 'viseu',\n 233: 'figueira da foz',\n 234: 'aveiro',\n 235: 'arganil',\n 236: 'pombal',\n 238: 'seia',\n 239: 'coimbra',\n 241: 'abrantes',\n 242: 'ponte de sôr',\n 243: 'santarém',\n 244: 'leiria',\n 245: 'portalegre',\n 249: 'torres novas',\n 251: 'valença',\n 252: 'vila nova de famalicão',\n 253: 'braga',\n 254: 'peso da régua',\n 255: 'penafiel',\n 256: 'são joão da madeira',\n 258: 'viana do castelo',\n 259: 'vila real',\n 261: 'torres vedras',\n 262: 'caldas da raínha',\n 263: 'vila franca de xira',\n 265: 'setúbal',\n 266: 'évora',\n 268: 'estremoz',\n 269: 'santiago do cacém',\n 271: 'guarda',\n 272: 'castelo branco',\n 273: 'bragança',\n 274: 'proença-a-nova',\n 275: 'covilhã',\n 276: 'chaves',\n 277: 'idanha-a-nova',\n 278: 'mirandela',\n 279: 'moncorvo',\n 281: 'tavira',\n 282: 'portimão',\n 283: 'odemira',\n 284: 'beja',\n 285: 'moura',\n 286: 'castro verde',\n 289: 'faro',\n 291: 'funchal, porto santo',\n 292: 'corvo, faial, flores, horta, pico',\n 295: 'angra do heroísmo, graciosa, são jorge, terceira',\n 296: 'ponta delgada, são miguel, santa maria',\n\n 91 : 'rede móvel 91 (Vodafone / Yorn)',\n 93 : 'rede móvel 93 (Optimus)',\n 96 : 'rede móvel 96 (TMN)',\n 92 : 'rede móvel 92 (TODOS)',\n //925 : 'rede móvel 925 (TMN 925)',\n //926 : 'rede móvel 926 (TMN 926)',\n //927 : 'rede móvel 927 (TMN 927)',\n //922 : 'rede móvel 922 (Phone-ix)',\n\n 707: 'número único',\n 760: 'número único',\n 800: 'número grátis',\n 808: 'chamada local',\n 30: 'voip'\n },\n /**\n * International number for Cabo Verde\n *\n * @property _internacionalCV\n * @type {Number}\n * @private\n * @static\n * @readOnly\n */\n _internacionalCV: 238,\n\n /**\n * List of all Cabo Verde number prefixes\n *\n * @property _indicativosCV\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _indicativosCV: {\n 2: 'fixo',\n 91: 'móvel 91',\n 95: 'móvel 95',\n 97: 'móvel 97',\n 98: 'móvel 98',\n 99: 'móvel 99'\n },\n /**\n * International number for Angola\n *\n * @property _internacionalAO\n * @type {Number}\n * @private\n * @static\n * @readOnly\n */\n _internacionalAO: 244,\n\n /**\n * List of all Angola number prefixes\n *\n * @property _indicativosAO\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _indicativosAO: {\n 2: 'fixo',\n 91: 'móvel 91',\n 92: 'móvel 92'\n },\n /**\n * International number for Mozambique\n *\n * @property _internacionalMZ\n * @type {Number}\n * @private\n * @static\n * @readOnly\n */\n _internacionalMZ: 258,\n\n /**\n * List of all Mozambique number prefixes\n *\n * @property _indicativosMZ\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _indicativosMZ: {\n 2: 'fixo',\n 82: 'móvel 82',\n 84: 'móvel 84'\n },\n\n /**\n * International number for Timor\n *\n * @property _internacionalTL\n * @type {Number}\n * @private\n * @static\n * @readOnly\n */\n _internacionalTL: 670,\n\n /**\n * List of all Timor number prefixes\n *\n * @property _indicativosTL\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _indicativosTL: {\n 3: 'fixo',\n 7: 'móvel 7'\n },\n\n /**\n * Regular expression groups for several groups of characters\n *\n * http://en.wikipedia.org/wiki/C0_Controls_and_Basic_Latin\n * http://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane\n * http://en.wikipedia.org/wiki/ISO_8859-1\n *\n * @property _characterGroups\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _characterGroups: {\n numbers: ['0-9'],\n asciiAlpha: ['a-zA-Z'],\n latin1Alpha: ['a-zA-Z', '\\u00C0-\\u00FF'],\n unicodeAlpha: ['a-zA-Z', '\\u00C0-\\u00FF', '\\u0100-\\u1FFF', '\\u2C00-\\uD7FF'],\n /* whitespace characters */\n space: [' '],\n dash: ['-'],\n underscore: ['_'],\n nicknamePunctuation: ['_.-'],\n\n singleLineWhitespace: ['\\t '],\n newline: ['\\n'],\n whitespace: ['\\t\\n\\u000B\\f\\r\\u00A0 '],\n\n asciiPunctuation: ['\\u0021-\\u002F', '\\u003A-\\u0040', '\\u005B-\\u0060', '\\u007B-\\u007E'],\n latin1Punctuation: ['\\u0021-\\u002F', '\\u003A-\\u0040', '\\u005B-\\u0060', '\\u007B-\\u007E', '\\u00A1-\\u00BF', '\\u00D7', '\\u00F7'],\n unicodePunctuation: ['\\u0021-\\u002F', '\\u003A-\\u0040', '\\u005B-\\u0060', '\\u007B-\\u007E', '\\u00A1-\\u00BF', '\\u00D7', '\\u00F7', '\\u2000-\\u206F', '\\u2E00-\\u2E7F', '\\u3000-\\u303F']\n },\n\n /**\n * Creates a regular expression for several character groups.\n *\n * @method createRegExp\n *\n * @param Groups* {Object}\n * Groups to build regular expressions for. Possible keys are:\n *\n * - **numbers**: 0-9\n * - **asciiAlpha**: a-z, A-Z\n * - **latin1Alpha**: asciiAlpha, plus printable characters in latin-1\n * - **unicodeAlpha**: unicode alphanumeric characters.\n * - **space**: ' ', the space character.\n * - **dash**: dash character.\n * - **underscore**: underscore character.\n * - **nicknamePunctuation**: dash, dot, underscore\n * - **singleLineWhitespace**: space and tab (whitespace which only spans one line).\n * - **newline**: newline character ('\\n')\n * - **whitespace**: whitespace characters in the ASCII character set.\n * - **asciiPunctuation**: punctuation characters in the ASCII character set.\n * - **latin1Punctuation**: punctuation characters in latin-1.\n * - **unicodePunctuation**: punctuation characters in unicode.\n *\n */\n createRegExp: function (groups) {\n var re = '^[';\n for (var key in groups) if (groups.hasOwnProperty(key)) {\n if (!(key in Validator._characterGroups)) {\n throw new Error('group ' + key + ' is not a valid character group');\n } else if (groups[key]) {\n re += Validator._characterGroups[key].join('');\n }\n }\n if (re === '^[') {\n // No changes\n return new RegExp('$^'); // match nothing\n }\n return new RegExp(re + ']*?$');\n },\n\n /**\n * Checks if a field has the required groups.\n *\n * @method checkCharacterGroups\n * @param {String} s The validation string\n * @param {Object} [groups]={} What groups are included. See createRegexp\n * @sample Ink_Util_Validator_checkCharacterGroups.html \n */\n checkCharacterGroups: function (s, groups) {\n return Validator.createRegExp(groups).test(s);\n },\n\n /**\n * Checks if a field contains unicode printable characters.\n *\n * @method unicode\n * @param {String} s The validation string\n * @param {Object} [options]={} Optional configuration object. See createRegexp\n */\n unicode: function (s, options) {\n return Validator.checkCharacterGroups(s, Ink.extendObj({\n unicodeAlpha: true}, options));\n },\n\n /**\n * Checks if a field only contains latin-1 alphanumeric characters. \n * Takes options for allowing singleline whitespace, cross-line whitespace and punctuation.\n *\n * @method latin1\n *\n * @param {String} s The validation string\n * @param {Object} [options]={} Optional configuration object. See createRegexp\n * @sample Ink_Util_Validator_latin1.html \n */\n latin1: function (s, options) {\n return Validator.checkCharacterGroups(s, Ink.extendObj({\n latin1Alpha: true}, options));\n },\n\n /**\n * Checks if a field only contains only ASCII alphanumeric characters. \n * Takes options for allowing singleline whitespace, cross-line whitespace and punctuation.\n *\n * @method ascii\n *\n * @param {String} s The validation string\n * @param {Object} [options]={} Optional configuration object. See createRegexp\n * @sample Ink_Util_Validator_ascii.html \n */\n ascii: function (s, options) {\n return Validator.checkCharacterGroups(s, Ink.extendObj({\n asciiAlpha: true}, options));\n },\n\n /**\n * Checks if a number is a valid\n *\n * @method number\n * @param {String} numb The number\n * @param {Object} [options] Further options\n * @param [options.decimalSep]='.' Allow decimal separator.\n * @param [options.thousandSep]=\",\" Strip this character from the number.\n * @param [options.negative]=false Allow negative numbers.\n * @param [options.decimalPlaces]=null Maximum number of decimal places. Use `0` for an integer number.\n * @param [options.max]=null Maximum number\n * @param [options.min]=null Minimum number\n * @param [options.returnNumber]=false When this option is true, return the number itself when the value is valid.\n * @sample Ink_Util_Validator_number.html \n */\n number: function (numb, inOptions) {\n numb = numb + '';\n var options = Ink.extendObj({\n decimalSep: '.',\n thousandSep: '',\n negative: true,\n decimalPlaces: null,\n maxDigits: null,\n max: null,\n min: null,\n returnNumber: false\n }, inOptions || {});\n // smart recursion thing sets up aliases for options.\n if (options.thousandSep) {\n numb = numb.replace(new RegExp('\\\\' + options.thousandSep, 'g'), '');\n options.thousandSep = '';\n return Validator.number(numb, options);\n }\n if (options.negative === false) {\n options.min = 0;\n options.negative = true;\n return Validator.number(numb, options);\n }\n if (options.decimalSep !== '.') {\n numb = numb.replace(new RegExp('\\\\' + options.decimalSep, 'g'), '.');\n }\n\n if (!/^(-)?(\\d+)?(\\.\\d+)?$/.test(numb) || numb === '') {\n return false; // forbidden character found\n }\n \n var split;\n if (options.decimalSep && numb.indexOf(options.decimalSep) !== -1) {\n split = numb.split(options.decimalSep);\n if (options.decimalPlaces !== null &&\n split[1].length > options.decimalPlaces) {\n return false;\n }\n } else {\n split = ['' + numb, ''];\n }\n \n if (options.maxDigits!== null) {\n if (split[0].replace(/-/g, '').length > options.maxDigits) {\n return split;\n }\n }\n \n // Now look at the actual float\n var ret = parseFloat(numb);\n \n if (options.maxExcl !== null && ret >= options.maxExcl ||\n options.minExcl !== null && ret <= options.minExcl) {\n return false;\n }\n if (options.max !== null && ret > options.max ||\n options.min !== null && ret < options.min) {\n return false;\n }\n \n if (options.returnNumber) {\n return ret;\n } else {\n return true;\n }\n },\n\n /**\n * Checks if a year is Leap \"Bissexto\"\n *\n * @method _isLeapYear\n * @param {Number} year Year to be checked\n * @return {Boolean} True if it is a leap year.\n * @private\n * @static\n * @example\n * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){\n * console.log( InkValidator._isLeapYear( 2004 ) ); // Result: true\n * console.log( InkValidator._isLeapYear( 2006 ) ); // Result: false\n * });\n */\n _isLeapYear: function(year){\n\n var yearRegExp = /^\\d{4}$/;\n\n if(yearRegExp.test(year)){\n return ((year%4) ? false: ((year%100) ? true : ((year%400)? false : true)) );\n }\n\n return false;\n },\n\n /**\n * Object with the date formats available for validation\n *\n * @property _dateParsers\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _dateParsers: {\n 'yyyy-mm-dd': {day:5, month:3, year:1, sep: '-', parser: /^(\\d{4})(\\-)(\\d{1,2})(\\-)(\\d{1,2})$/},\n 'yyyy/mm/dd': {day:5, month:3, year:1, sep: '/', parser: /^(\\d{4})(\\/)(\\d{1,2})(\\/)(\\d{1,2})$/},\n 'yy-mm-dd': {day:5, month:3, year:1, sep: '-', parser: /^(\\d{2})(\\-)(\\d{1,2})(\\-)(\\d{1,2})$/},\n 'yy/mm/dd': {day:5, month:3, year:1, sep: '/', parser: /^(\\d{2})(\\/)(\\d{1,2})(\\/)(\\d{1,2})$/},\n 'dd-mm-yyyy': {day:1, month:3, year:5, sep: '-', parser: /^(\\d{1,2})(\\-)(\\d{1,2})(\\-)(\\d{4})$/},\n 'dd/mm/yyyy': {day:1, month:3, year:5, sep: '/', parser: /^(\\d{1,2})(\\/)(\\d{1,2})(\\/)(\\d{4})$/},\n 'dd-mm-yy': {day:1, month:3, year:5, sep: '-', parser: /^(\\d{1,2})(\\-)(\\d{1,2})(\\-)(\\d{2})$/},\n 'dd/mm/yy': {day:1, month:3, year:5, sep: '/', parser: /^(\\d{1,2})(\\/)(\\d{1,2})(\\/)(\\d{2})$/}\n },\n\n /**\n * Gets the number of days in a given month of a given year\n *\n * @method _daysInMonth\n * @param {Number} _m Month (1 to 12)\n * @param {Number} _y Year\n * @return {Number} Returns the number of days in a given month of a given year\n * @private\n * @static\n * @example\n * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){\n * console.log( InkValidator._daysInMonth( 2, 2004 ) ); // Result: 29\n * console.log( InkValidator._daysInMonth( 2, 2006 ) ); // Result: 28\n * });\n */\n _daysInMonth: function(_m,_y){\n var nDays=0;\n\n _m = parseInt(_m, 10);\n _y = parseInt(_y, 10);\n\n if(_m===1 || _m===3 || _m===5 || _m===7 || _m===8 || _m===10 || _m===12) {\n nDays= 31;\n } else if ( _m===4 || _m===6 || _m===9 || _m===11) {\n nDays = 30;\n } else if (_m===2) {\n if((_y%400===0) || (_y%4===0 && _y%100!==0)) {\n nDays = 29;\n } else {\n nDays = 28;\n }\n }\n\n return nDays;\n },\n\n\n\n /**\n * Checks if a date is valid\n *\n * @method _isValidDate\n * @param {Number} year\n * @param {Number} month\n * @param {Number} day\n * @return {Boolean} True if valid\n * @private\n * @static\n * @example\n * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){\n * console.log( InkValidator._isValidDate( 2004, 2, 29 ) ); // Result: true\n * console.log( InkValidator._isValidDate( 2006, 2, 29 ) ); // Result: false\n * });\n */\n _isValidDate: function(year, month, day){\n\n var yearRegExp = /^\\d{4}$/;\n var validOneOrTwo = /^\\d{1,2}$/;\n if(yearRegExp.test(year) && validOneOrTwo.test(month) && validOneOrTwo.test(day)){\n if(month>=1 && month<=12 && day>=1 && this._daysInMonth(month,year)>=day){\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Checks if an email is valid\n *\n * @method mail\n * @param {String} email\n * @return {Boolean} True if it's valid\n * @public\n * @static\n * @sample Ink_Util_Validator_mail.html \n */\n email: function(email)\n {\n var emailValido = new RegExp(\"^[_a-z0-9-]+((\\\\.|\\\\+)[_a-z0-9-]+)*@([\\\\w]*-?[\\\\w]*\\\\.)+[a-z]{2,4}$\", \"i\");\n if(!emailValido.test(email)) {\n return false;\n } else {\n return true;\n }\n },\n\n /**\n * Deprecated. Alias for email(). Use it instead.\n *\n * @method mail\n * @public\n * @static\n * @private\n */\n mail: function (mail) { return Validator.email(mail); },\n\n /**\n * Checks if an url is valid\n *\n * @method url\n * @param {String} url URL to be checked\n * @param {Boolean} [full] If true, validates a full URL (one that should start with 'http')\n * @return {Boolean} True if valid\n * @public\n * @static\n * @sample Ink_Util_Validator_url.html \n */\n url: function(url, full)\n {\n if(typeof full === \"undefined\" || full === false) {\n var reHTTP = new RegExp(\"(^(http\\\\:\\\\/\\\\/|https\\\\:\\\\/\\\\/)(.+))\", \"i\");\n if(reHTTP.test(url) === false) {\n url = 'http://'+url;\n }\n }\n\n var reUrl = new RegExp(\"^(http:\\\\/\\\\/|https:\\\\/\\\\/)([\\\\w]*(-?[\\\\w]*)*\\\\.)+[a-z]{2,4}\", \"i\");\n if(reUrl.test(url) === false) {\n return false;\n } else {\n return true;\n }\n },\n\n /**\n * Checks if a phone is valid in Portugal\n *\n * @method isPTPhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid Portuguese Phone\n * @public\n * @static\n * @sample Ink_Util_Validator_isPTPhone.html\n */\n isPTPhone: function(phone)\n {\n\n phone = phone.toString();\n var aInd = [];\n for(var i in this._indicativosPT) {\n if(typeof(this._indicativosPT[i]) === 'string') {\n aInd.push(i);\n }\n }\n var strInd = aInd.join('|');\n\n var re351 = /^(00351|\\+351)/;\n if(re351.test(phone)) {\n phone = phone.replace(re351, \"\");\n }\n\n var reSpecialChars = /(\\s|\\-|\\.)+/g;\n phone = phone.replace(reSpecialChars, '');\n //var reInt = new RegExp(\"\\\\d\", \"i\");\n var reInt = /[\\d]{9}/i;\n if(phone.length === 9 && reInt.test(phone)) {\n var reValid = new RegExp(\"^(\"+strInd+\")\");\n if(reValid.test(phone)) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Alias function for isPTPhone\n *\n * @method isPortuguesePhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid Portuguese Phone\n * @public\n * @static\n */\n isPortuguesePhone: function(phone)\n {\n return this.isPTPhone(phone);\n },\n\n /**\n * Checks if a phone is valid in Cabo Verde\n *\n * @method isCVPhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid Cape Verdean Phone\n * @public\n * @static\n * @sample Ink_Util_Validator_isCVPhone.html \n */\n isCVPhone: function(phone)\n {\n phone = phone.toString();\n var aInd = [];\n for(var i in this._indicativosCV) {\n if(typeof(this._indicativosCV[i]) === 'string') {\n aInd.push(i);\n }\n }\n var strInd = aInd.join('|');\n\n var re238 = /^(00238|\\+238)/;\n if(re238.test(phone)) {\n phone = phone.replace(re238, \"\");\n }\n\n var reSpecialChars = /(\\s|\\-|\\.)+/g;\n phone = phone.replace(reSpecialChars, '');\n //var reInt = new RegExp(\"\\\\d\", \"i\");\n var reInt = /[\\d]{7}/i;\n if(phone.length === 7 && reInt.test(phone)) {\n var reValid = new RegExp(\"^(\"+strInd+\")\");\n if(reValid.test(phone)) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Checks if a phone is valid in Angola\n *\n * @method isAOPhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid Angolan Phone\n * @public\n * @static\n * @sample Ink_Util_Validator_isAOPhone.html \n */\n isAOPhone: function(phone)\n {\n\n phone = phone.toString();\n var aInd = [];\n for(var i in this._indicativosAO) {\n if(typeof(this._indicativosAO[i]) === 'string') {\n aInd.push(i);\n }\n }\n var strInd = aInd.join('|');\n\n var re244 = /^(00244|\\+244)/;\n if(re244.test(phone)) {\n phone = phone.replace(re244, \"\");\n }\n\n var reSpecialChars = /(\\s|\\-|\\.)+/g;\n phone = phone.replace(reSpecialChars, '');\n //var reInt = new RegExp(\"\\\\d\", \"i\");\n var reInt = /[\\d]{9}/i;\n if(phone.length === 9 && reInt.test(phone)) {\n var reValid = new RegExp(\"^(\"+strInd+\")\");\n if(reValid.test(phone)) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Checks if a phone is valid in Mozambique\n *\n * @method isMZPhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid Mozambican Phone\n * @public\n * @static\n * @sample Ink_Util_Validator_isMZPhone.html \n */\n isMZPhone: function(phone)\n {\n\n phone = phone.toString();\n var aInd = [];\n for(var i in this._indicativosMZ) {\n if(typeof(this._indicativosMZ[i]) === 'string') {\n aInd.push(i);\n }\n }\n var strInd = aInd.join('|');\n var re258 = /^(00258|\\+258)/;\n if(re258.test(phone)) {\n phone = phone.replace(re258, \"\");\n }\n\n var reSpecialChars = /(\\s|\\-|\\.)+/g;\n phone = phone.replace(reSpecialChars, '');\n //var reInt = new RegExp(\"\\\\d\", \"i\");\n var reInt = /[\\d]{8,9}/i;\n if((phone.length === 9 || phone.length === 8) && reInt.test(phone)) {\n var reValid = new RegExp(\"^(\"+strInd+\")\");\n if(reValid.test(phone)) {\n if(phone.indexOf('2') === 0 && phone.length === 8) {\n return true;\n } else if(phone.indexOf('8') === 0 && phone.length === 9) {\n return true;\n }\n }\n }\n\n return false;\n },\n\n /**\n * Checks if a phone is valid in Timor\n *\n * @method isTLPhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid phone from Timor-Leste\n * @public\n * @static\n * @sample Ink_Util_Validator_isTLPhone.html \n */\n isTLPhone: function(phone)\n {\n\n phone = phone.toString();\n var aInd = [];\n for(var i in this._indicativosTL) {\n if(typeof(this._indicativosTL[i]) === 'string') {\n aInd.push(i);\n }\n }\n var strInd = aInd.join('|');\n var re670 = /^(00670|\\+670)/;\n if(re670.test(phone)) {\n phone = phone.replace(re670, \"\");\n }\n\n\n var reSpecialChars = /(\\s|\\-|\\.)+/g;\n phone = phone.replace(reSpecialChars, '');\n //var reInt = new RegExp(\"\\\\d\", \"i\");\n var reInt = /[\\d]{7}/i;\n if(phone.length === 7 && reInt.test(phone)) {\n var reValid = new RegExp(\"^(\"+strInd+\")\");\n if(reValid.test(phone)) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Checks if a number is a phone number.\n * This method validates the number in all country codes available the ones set in the second param\n *\n * @method isPhone\n * @param {String} phone Phone number to validate\n * @param {String|Array} [countryCode] Country code or array of countries to validate\n * @return {Boolean} True if it's a valid phone in any country available\n * @public\n * @static\n * @sample Ink_Util_Validator_isPhone.html\n */\n isPhone: function(){\n var index;\n\n if(arguments.length===0){\n return false;\n }\n\n var phone = arguments[0];\n\n if(arguments.length>1){\n if(arguments[1].constructor === Array){\n var func;\n for(index=0; index= 0 && match[i-1] <= 100){\n valid = true;\n } else {\n return false;\n }\n }\n // check 0 to 255 values\n if(i===1 || i===3 || i===5 && (typeof match[i+1] === \"undefined\" || match[i+1] === \"\")){\n if(typeof match[i] !== \"undefined\" && match[i] >= 0 && match[i] <= 255){\n valid = true;\n } else {\n return false;\n }\n }\n }\n }\n\n // hsl range check\n if((match = hsl.exec(str)) !== null || (match = hsla.exec(str)) !== null){\n i = match.length;\n while(i--){\n // check percentage values\n if(i===3 || i===5){\n if(typeof match[i-1] !== \"undefined\" && typeof match[i] !== \"undefined\" && match[i] !== \"\" &&\n match[i-1] >= 0 && match[i-1] <= 100){\n valid = true;\n } else {\n return false;\n }\n }\n // check 0 to 360 value\n if(i===1){\n if(typeof match[i] !== \"undefined\" && match[i] >= 0 && match[i] <= 360){\n valid = true;\n } else {\n return false;\n }\n }\n }\n }\n\n return valid;\n },\n\n /**\n * Checks if the value is a valid IP. \n *\n * @method isIP\n * @param {String} value Value to be checked\n * @param {String} ipType Type of IP to be validated. The values are: ipv4, ipv6. By default is ipv4.\n * @return {Boolean} True if the value is a valid IP address. False if not.\n * @sample Ink_Util_Validator_isIP.html \n */\n isIP: function( value, ipType ){\n if( typeof value !== 'string' ){\n return false;\n }\n\n ipType = (ipType || 'ipv4').toLowerCase();\n\n switch( ipType ){\n case 'ipv4':\n return (/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/).test(value);\n case 'ipv6':\n return (/^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$/).test(value);\n default:\n return false;\n }\n },\n\n /**\n * Credit Card specifications, to be used in the credit card verification.\n *\n * @property _creditCardSpecs\n * @type {Object}\n * @private\n */\n _creditCardSpecs: {\n 'default': {\n 'length': '13,14,15,16,17,18,19',\n 'prefix': /^.+/,\n 'luhn': true\n },\n\n 'american express': {\n 'length': '15',\n 'prefix': /^3[47]/,\n 'luhn' : true\n },\n\n 'diners club': {\n 'length': '14,16',\n 'prefix': /^36|55|30[0-5]/,\n 'luhn' : true\n },\n\n 'discover': {\n 'length': '16',\n 'prefix': /^6(?:5|011)/,\n 'luhn' : true\n },\n\n 'jcb': {\n 'length': '15,16',\n 'prefix': /^3|1800|2131/,\n 'luhn' : true\n },\n\n 'maestro': {\n 'length': '16,18',\n 'prefix': /^50(?:20|38)|6(?:304|759)/,\n 'luhn' : true\n },\n\n 'mastercard': {\n 'length': '16',\n 'prefix': /^5[1-5]/,\n 'luhn' : true\n },\n\n 'visa': {\n 'length': '13,16',\n 'prefix': /^4/,\n 'luhn' : true\n }\n },\n\n /**\n * Luhn function, to be used when validating credit cards\n *\n */\n _luhn: function (num){\n\n num = parseInt(num,10);\n\n if ( (typeof num !== 'number') && (num % 1 !== 0) ){\n // Luhn can only be used on nums!\n return false;\n }\n\n num = num+'';\n // Check num length\n var length = num.length;\n\n // Checksum of the card num\n var\n i, checksum = 0\n ;\n\n for (i = length - 1; i >= 0; i -= 2)\n {\n // Add up every 2nd digit, starting from the right\n checksum += parseInt(num.substr(i, 1),10);\n }\n\n for (i = length - 2; i >= 0; i -= 2)\n {\n // Add up every 2nd digit doubled, starting from the right\n var dbl = parseInt(num.substr(i, 1) * 2,10);\n\n // Subtract 9 from the dbl where value is greater than 10\n checksum += (dbl >= 10) ? (dbl - 9) : dbl;\n }\n\n // If the checksum is a multiple of 10, the number is valid\n return (checksum % 10 === 0);\n },\n\n /**\n * Checks if a number is of a specific credit card type\n * @method isCreditCard\n * @param {String} num Number to be validates\n * @param {String|Array} creditCardType Credit card type. See _creditCardSpecs for the list of supported values.\n * @return {Boolean}\n * @sample Ink_Util_Validator_isCreditCard.html \n */\n isCreditCard: function(num, creditCardType){\n\n if ( /\\d+/.test(num) === false ){\n return false;\n }\n\n if ( typeof creditCardType === 'undefined' ){\n creditCardType = 'default';\n }\n else if ( creditCardType instanceof Array ){\n var i, ccLength = creditCardType.length;\n for ( i=0; i < ccLength; i++ ){\n // Test each type for validity\n if (this.isCreditCard(num, creditCardType[i]) ){\n return true;\n }\n }\n\n return false;\n }\n\n // Check card type\n creditCardType = creditCardType.toLowerCase();\n\n if ( typeof this._creditCardSpecs[creditCardType] === 'undefined' ){\n return false;\n }\n\n // Check card number length\n var length = num.length+'';\n\n // Validate the card length by the card type\n if ( this._creditCardSpecs[creditCardType]['length'].split(\",\").indexOf(length) === -1 ){\n return false;\n }\n\n // Check card number prefix\n if ( !this._creditCardSpecs[creditCardType]['prefix'].test(num) ){\n return false;\n }\n\n // No Luhn check required\n if (this._creditCardSpecs[creditCardType]['luhn'] === false){\n return true;\n }\n\n return this._luhn(num);\n }\n };\n\n return Validator;\n\n});\n"]} \ No newline at end of file diff --git a/public/js/ink-ui.js b/public/js/ink-ui.js new file mode 100644 index 0000000..0a888d2 --- /dev/null +++ b/public/js/ink-ui.js @@ -0,0 +1,12105 @@ +/** + * Animate.css Utility + * + * This module is a wrapper around animate.css's CSS classes to produce animation. + * It contains options to ease common tasks, like listen to the "animationend" event with all necessary prefixes, remove the necessary class names when the animation finishes, or configure the duration of your animation with the necessary browser prefix. + * + * @module Ink.UI.Animate_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.Animate', 1, ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Css_1'], function (Common, InkEvent, Css) { + 'use strict'; + + var animationPrefix = (function (el) { + return ('animationName' in el.style) ? 'animation' : + ('oAnimationName' in el.style) ? 'oAnimation' : + ('msAnimationName' in el.style) ? 'msAnimation' : + ('webkitAnimationName' in el.style) ? 'webkitAnimation' : null; + }(document.createElement('div'))); + + var animationEndEventName = { + animation: 'animationend', + oAnimation: 'oanimationend', + msAnimation: 'MSAnimationEnd', + webkitAnimation: 'webkitAnimationEnd' + }[animationPrefix]; + + /** + * @class Ink.UI.Animate_1 + * @constructor + * + * @param {DOMElement} element Animated element + * @param {Object} options Options object + * @param {String} options.animation Animation name + * @param {String|Number} [options.duration] Duration name (fast|medium|slow) or duration in milliseconds. Defaults to 'medium'. + * @param {Boolean} [options.removeClass] Flag to remove the CSS class when finished animating. Defaults to false. + * @param {Function} [options.onEnd] Callback for the animation end + * + * @sample Ink_UI_Animate_1.html + * + **/ + function Animate() { + Common.BaseUIComponent.apply(this, arguments); + } + + Animate._name = 'Animate_1'; + + Animate._optionDefinition = { + trigger: ['Element', null], + duration: ['String', 'slow'], // Actually a string with a duration name, or a number of ms + animation: ['String'], + removeClass: ['Boolean', true], + onEnd: ['Function', function () {}] + }; + + Animate.prototype._init = function () { + if (!isNaN(parseInt(this._options.duration, 10))) { + this._options.duration = parseInt(this._options.duration, 10); + } + + if (this._options.trigger) { + InkEvent.observe(this._options.trigger, 'click', Ink.bind(function () { + this.animate(); + }, this)); // later + } else { + this.animate(); + } + }; + + Animate.prototype.animate = function () { + Animate.animate(this._element, this._options.animation, this._options); + }; + + Ink.extendObj(Animate, { + /** + * Browser prefix for the CSS animations. + * + * @property _animationPrefix + * @private + **/ + _animationPrefix: animationPrefix, + + /** + * Boolean which says whether this browser has CSS3 animation support. + * + * @property animationSupported + **/ + animationSupported: !!animationPrefix, + + /** + * Prefixed 'animationend' event name. + * + * @property animationEndEventName + **/ + animationEndEventName: animationEndEventName, + + /** + * Animate an element using one of the animate.css classes + * + * **Note: This is a utility method inside the `Animate` class, which you can access through `Animate.animate()`. Do not mix these up.** + * + * @static + * @method animate + * @param element {DOMElement} animated element + * @param animation {String} animation name + * @param [options] {Object} + * @param [options.onEnd=null] {Function} callback for animation end + * @param [options.removeClass=false] {Boolean} whether to remove the Css class when finished + * @param [options.duration=medium] {String|Number} duration name (fast|medium|slow) or duration in ms + * + * @sample Ink_UI_Animate_1_animate.html + **/ + animate: function (element, animation, options) { + element = Common.elOrSelector(element); + + if (typeof options === 'number' || typeof options === 'string') { + options = { duration: options }; + } else if (!options) { + options = {}; + } + + if (typeof arguments[3] === 'function') { + options.onEnd = arguments[3]; + } + + if (typeof options.duration !== 'number' && typeof options.duration !== 'string') { + options.duration = 400; + } + + if (!Animate.animationSupported) { + if (options.onEnd) { + setTimeout(function () { + options.onEnd(null); + }, 0); + } + return; + } + + if (typeof options.duration === 'number') { + element.style[animationPrefix + 'Duration'] = options.duration + 'ms'; + } else if (typeof options.duration === 'string') { + Css.addClassName(element, options.duration); + } + + Css.addClassName(element, ['animated', animation]); + + function onAnimationEnd(event) { + if (event.target !== element) { return; } + if (event.animationName !== animation) { return; } + if (options.onEnd) { options.onEnd(event); } + if (options.removeClass) { + Css.removeClassName(element, animation); + } + if (typeof options.duration === 'string') { + Css.removeClassName(element, options.duration); + } + element.removeEventListener(animationEndEventName, onAnimationEnd, false); + } + + element.addEventListener(animationEndEventName, onAnimationEnd, false); + } + }); + + Common.createUIComponent(Animate); + + return Animate; +}); + +/** + * Flexible Carousel + * @module Ink.UI.Carousel_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.Carousel', '1', + ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Css_1', 'Ink.Dom.Element_1', 'Ink.UI.Pagination_1', 'Ink.Dom.Browser_1', 'Ink.Dom.Selector_1'], + function(Common, InkEvent, Css, InkElement, Pagination, Browser/*, Selector*/) { + 'use strict'; + + /* + * TODO: + * keyboardSupport + */ + + function limitRange(n, min, max) { + return Math.min(max, Math.max(min, n)); + } + + var requestAnimationFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || + function (cb) {return setTimeout(cb, 1000 / 30); }; + + /** + * @class Ink.UI.Carousel_1 + * @constructor + * + * @param {String|DOMElement} selector DOM element or element id + * @param {Object} [options] Carousel Options + * @param {Integer} [options.autoAdvance] Milliseconds to wait before auto-advancing pages. Set to 0 to disable auto-advance. Defaults to 0. + * @param {String} [options.axis] Axis of the carousel. Set to 'y' for a vertical carousel. Defaults to 'x'. + * @param {Number} [options.initialPage] Initial index page of the carousel. Defaults to 0. + * @param {Boolean} [options.spaceAfterLastSlide=true] If there are not enough slides to fill the full width of the last page, leave white space. Defaults to `true`. + * @param {Boolean} [options.swipe] Enable swipe support if available. Defaults to true. + * @param {Mixed} [options.pagination] Either an ul element to add pagination markup to or an `Ink.UI.Pagination` instance to use. + * @param {Function} [options.onChange] Callback to be called when the page changes. + * + * @sample Ink_UI_Carousel_1.html + */ + function Carousel() { + Common.BaseUIComponent.apply(this, arguments); + } + + Carousel._name = 'Carousel_1'; + + Carousel._optionDefinition = { + autoAdvance: ['Integer', 0], + axis: ['String', 'x'], + initialPage: ['Integer', 0], + spaceAfterLastSlide: ['Boolean', true], + hideLast: ['Boolean', false], + // [3.1.0] Deprecate "center". It is only needed when things are of unknown widths. + center: ['Boolean', false], + keyboardSupport:['Boolean', false], + pagination: ['String', null], + onChange: ['Function', null], + onInit: ['Function', function () {}], + swipe: ['Boolean', true] + // TODO exponential swipe + // TODO specify break point for next page when moving finger + }; + + Carousel.prototype = { + _init: function () { + this._handlers = { + paginationChange: Ink.bindMethod(this, '_onPaginationChange'), + windowResize: InkEvent.throttle(Ink.bindMethod(this, 'refit'), 200) + }; + + InkEvent.observe(window, 'resize', this._handlers.windowResize); + + this._isY = (this._options.axis === 'y'); + + var ulEl = Ink.s('ul.stage', this._element); + this._ulEl = ulEl; + + InkElement.removeTextNodeChildren(ulEl); + + if (this._options.pagination == null) { + this._currentPage = this._options.initialPage; + } + + this.refit(); // recalculate this._numPages + + if (this._isY) { + // Override white-space: no-wrap which is only necessary to make sure horizontal stuff stays horizontal, but breaks stuff intended to be vertical. + this._ulEl.style.whiteSpace = 'normal'; + } + + if (this._options.swipe) { + InkEvent.observe(this._element, 'touchstart', Ink.bindMethod(this, '_onTouchStart')); + InkEvent.observe(this._element, 'touchmove', Ink.bindMethod(this, '_onTouchMove')); + InkEvent.observe(this._element, 'touchend', Ink.bindMethod(this, '_onTouchEnd')); + } + + this._setUpPagination(); + this._setUpAutoAdvance(); + this._setUpHider(); + + this._options.onInit.call(this, this); + }, + + /** + * Repositions elements around. + * Measure the carousel once again, adjusting the involved elements' sizes. This is called automatically when the window resizes, in order to cater for changes from responsive media queries, for instance. + * + * @method refit + * @public + */ + refit: function() { + var _isY = this._isY; + + var size = function (elm, perpendicular) { + if (!elm) { return 0; } + + if (!perpendicular) { + return InkElement.outerDimensions(elm)[_isY ? 1 : 0]; + } else { + return InkElement.outerDimensions(elm)[_isY ? 0 : 1]; + } + }; + + this._liEls = Ink.ss('li.slide', this._ulEl); + var numSlides = this._liEls.length; + + var contRect = this._ulEl.getBoundingClientRect(); + this._ctnLength = _isY ? contRect.bottom - contRect.top : contRect.right - contRect.left; + this._elLength = size(this._liEls[0]); + this._slidesPerPage = Math.floor( this._ctnLength / this._elLength ) || 1; + if (!isFinite(this._slidesPerPage)) { this._slidesPerPage = 1; } + + var numPages = Math.ceil( numSlides / this._slidesPerPage ); + var numPagesChanged = this._numPages !== numPages; + this._numPages = numPages; + this._deltaLength = this._slidesPerPage * this._elLength; + + this._center(); + this._updateHider(); + this._IE7(); + + if (this._pagination && numPagesChanged) { + this._pagination.setSize(this._numPages); + } + this.setPage(limitRange(this.getPage(), 0, this._numPages)); + }, + + _setUpPagination: function () { + if (this._options.pagination) { + if (Common.isDOMElement(this._options.pagination) || + typeof this._options.pagination === 'string') { + // if dom element or css selector string... + this._pagination = new Pagination(this._options.pagination, { + size: this._numPages, + onChange: this._handlers.paginationChange + }); + } else { + // assumes instantiated pagination + this._pagination = this._options.pagination; + this._pagination._options.onChange = this._handlers.paginationChange; + this._pagination.setSize(this._numPages); + } + this._pagination.setCurrent(this._options.initialPage || 0); + } else { + this._currentPage = this._options.initialPage || 0; + } + }, + + _setUpAutoAdvance: function () { + if (!this._options.autoAdvance) { return; } + var self = this; + + setTimeout(function autoAdvance() { + self.nextPage(true /* wrap */); + setTimeout(autoAdvance, self._options.autoAdvance); + }, this._options.autoAdvance); + }, + + _setUpHider: function () { + if (this._options.hideLast) { + var hiderEl = InkElement.create('div', { + className: 'hider', + insertBottom: this._element + }); + hiderEl.style.position = 'absolute'; + hiderEl.style[ this._isY ? 'left' : 'top' ] = '0'; // fix to top.. + hiderEl.style[ this._isY ? 'right' : 'bottom' ] = '0'; // and bottom... + hiderEl.style[ this._isY ? 'bottom' : 'right' ] = '0'; // and move to the end. + this._hiderEl = hiderEl; + } + }, + + // [3.1.0] Deprecate this already + _center: function() { + if (!this._options.center) { return; } + var gap = Math.floor( (this._ctnLength - (this._elLength * this._slidesPerPage) ) / 2 ); + + var pad; + if (this._isY) { + pad = [gap, 'px 0']; + } else { + pad = ['0 ', gap, 'px']; + } + + this._ulEl.style.padding = pad.join(''); + }, + + // [3.1.0] Deprecate this already + _updateHider: function() { + if (!this._hiderEl) { return; } + if (this.getPage() === 0) { + var gap = Math.floor( this._ctnLength - (this._elLength * this._slidesPerPage) ); + if (this._options.center) { + gap /= 2; + } + this._hiderEl.style[ this._isY ? 'height' : 'width' ] = gap + 'px'; + } else { + this._hiderEl.style[ this._isY ? 'height' : 'width' ] = '0px'; + } + }, + + /** + * Refits elements for IE7 because it doesn't support inline-block. + * + * @method _IE7 + * @private + */ + _IE7: function () { + if (Browser.IE && '' + Browser.version.split('.')[0] === '7') { + // var numPages = this._numPages; + var slides = Ink.ss('li.slide', this._ulEl); + var stl = function (prop, val) {slides[i].style[prop] = val; }; + for (var i = 0, len = slides.length; i < len; i++) { + stl('position', 'absolute'); + stl(this._isY ? 'top' : 'left', (i * this._elLength) + 'px'); + } + } + }, + + _onTouchStart: function (event) { + if (event.touches.length > 1) { return; } + + this._swipeData = { + x: InkEvent.pointerX(event), + y: InkEvent.pointerY(event) + }; + + var ulRect = this._ulEl.getBoundingClientRect(); + + this._swipeData.firstUlPos = ulRect[this._isY ? 'top' : 'left']; + + this._swipeData.inUlX = this._swipeData.x - ulRect.left; + this._swipeData.inUlY = this._swipeData.y - ulRect.top; + + setTransitionProperty(this._ulEl, 'none'); + + this._touchMoveIsFirstTouchMove = true; + }, + + _onTouchMove: function (event) { + if (event.touches.length > 1) { return; /* multitouch event, not my problem. */ } + + var pointerX = InkEvent.pointerX(event); + var pointerY = InkEvent.pointerY(event); + + var deltaY = Math.abs(pointerY - this._swipeData.y); + var deltaX = Math.abs(pointerX - this._swipeData.x); + + if (this._touchMoveIsFirstTouchMove) { + this._touchMoveIsFirstTouchMove = undefined; + this._scrolling = this._isY ? + deltaX > deltaY : + deltaY > deltaX ; + + if (!this._scrolling) { + this._onAnimationFrame(); + } + } + + if (!this._scrolling && this._swipeData) { + InkEvent.stopDefault(event); + + this._swipeData.pointerPos = this._isY ? pointerY : pointerX; + } + }, + + _onAnimationFrame: function () { + var swipeData = this._swipeData; + + if (!swipeData || this._scrolling || this._touchMoveIsFirstTouchMove) { return; } + + var elRect = this._element.getBoundingClientRect(); + + var newPos; + + if (!this._isY) { + newPos = swipeData.pointerPos - swipeData.inUlX - elRect.left; + } else { + newPos = swipeData.pointerPos - swipeData.inUlY - elRect.top; + } + + this._ulEl.style[this._isY ? 'top' : 'left'] = newPos + 'px'; + + requestAnimationFrame(Ink.bindMethod(this, '_onAnimationFrame')); + }, + + _onTouchEnd: function (event) { + if (this._swipeData && this._swipeData.pointerPos && !this._scrolling && !this._touchMoveIsFirstTouchMove) { + var snapToNext = 0.1; // swipe 10% of the way to change page + + var relProgress = this._swipeData.firstUlPos - + this._ulEl.getBoundingClientRect()[this._isY ? 'top' : 'left']; + + var curPage = this.getPage(); + + // How many pages were advanced? May be fractional. + var progressInPages = relProgress / this._elLength / this._slidesPerPage; + + // Have we advanced enough to change page? + if (Math.abs(progressInPages) > snapToNext) { + curPage += Math[ relProgress < 0 ? 'floor' : 'ceil' ](progressInPages); + } + + // If something used to calculate progressInPages was zero, we get NaN here. + if (!isNaN(curPage)) { + this.setPage(curPage); + } + + InkEvent.stopDefault(event); + } + + setTransitionProperty(this._ulEl, null /* transition: left, top */); + this._swipeData = null; + this._touchMoveIsFirstTouchMove = undefined; + this._scrolling = undefined; + }, + + _onPaginationChange: function(pgn) { + this._setPage(pgn.getCurrent()); + }, + + /** + * Gets the current page index + * @method getPage + * @return The current page number + **/ + getPage: function () { + if (this._pagination) { + return this._pagination.getCurrent(); + } else { + return this._currentPage || 0; + } + }, + + /** + * Sets the current page index + * @method setPage + * @param {Number} page Index of the destination page. + * @param {Boolean} [wrap] Flag to activate circular counting. + **/ + setPage: function (page, wrap) { + if (wrap) { + // Pages outside the range [0..this._numPages] are wrapped. + page = page % this._numPages; + if (page < 0) { page = this._numPages - page; } + } + page = limitRange(page, 0, this._numPages - 1); + + if (this._pagination) { + this._pagination.setCurrent(page); // _setPage is called by pagination because it listens to its Change event. + } else { + this._setPage(page); + } + }, + + _setPage: function (page) { + var _lengthToGo = page * this._deltaLength; + var isLastPage = page === (this._numPages - 1); + + if (!this._options.spaceAfterLastSlide && isLastPage && page > 0) { + var _itemsInLastPage = this._liEls.length - (page * this._slidesPerPage); + if(_itemsInLastPage < this._slidesPerPage) { + _lengthToGo = ((page - 1) * this._deltaLength) + (_itemsInLastPage * this._elLength); + } + } + + this._ulEl.style[ this._isY ? 'top' : 'left'] = + ['-', _lengthToGo, 'px'].join(''); + + if (this._options.onChange) { + this._options.onChange.call(this, page); + } + + this._currentPage = page; + + this._updateHider(); + }, + + /** + * Goes to the next page + * @method nextPage + * @param {Boolean} [wrap] Flag to loop from last page to first page. + **/ + nextPage: function (wrap) { + this.setPage(this.getPage() + 1, wrap); + }, + + /** + * Goes to the previous page + * @method previousPage + * @param {Boolean} [wrap] Flag to loop from first page to last page. + **/ + previousPage: function (wrap) { this.setPage(this.getPage() - 1, wrap); }, + + /** + * Returns how many slides fit into a page + * @method getSlidesPerPage + * @return {Number} The number of slides per page + * @public + */ + getSlidesPerPage: function() { + return this._slidesPerPage; + }, + + /** + * Get the amount of pages in the carousel. + * @method getTotalPages + * @return {Number} The number of pages + * @public + */ + getTotalPages: function() { + return this._numPages; + }, + + /** + * Get the stage element (your UL with the class ".stage"). + * @method getStageElm + * @public + * @return {DOMElement} Stage element + **/ + getStageElm: function() { + return this._ulEl; + }, + + /** + * Get a list of your slides (elements with the ".slide" class inside your stage) + * @method getSlidesList + * @return {DOMElement[]} Array containing the slides. + * @public + */ + getSlidesList: function() { + return this._liEls; + }, + + /** + * Get the total number of slides + * @method getTotalSlides + * @return {Number} The number of slides + * @public + */ + getTotalSlides: function() { + return this.getSlidesList().length; + } + }; + + function setTransitionProperty(el, newTransition) { + el.style.transitionProperty = + el.style.oTransitionProperty = + el.style.msTransitionProperty = + el.style.mozTransitionProperty = + el.style.webkitTransitionProperty = newTransition; + } + + Common.createUIComponent(Carousel); + + return Carousel; + +}); + +/** + * Closing utilities + * @module Ink.UI.Close_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Close', '1', ['Ink.Dom.Event_1','Ink.Dom.Element_1'], function(InkEvent, InkElement) { + 'use strict'; + + /** + * Subscribes clicks on the document.body. + * Whenever an element with the classes ".ink-close" or ".ink-dismiss" is clicked, this module finds an ancestor ".ink-alert" or ".ink-alert-block" element and removes it from the DOM. + * This module should be created only once per page. + * + * @class Ink.UI.Close + * @constructor + * @example + * + * + * @sample Ink_UI_Close_1.html + */ + var Close = function() { + InkEvent.observe(document.body, 'click', function(ev) { + var el = InkEvent.element(ev); + + el = InkElement.findUpwardsByClass(el, 'ink-close') || + InkElement.findUpwardsByClass(el, 'ink-dismiss'); + + if (!el) { + return; // ink-close or ink-dismiss class not found + } + + var toRemove = InkElement.findUpwardsByClass(el, 'ink-alert') || + InkElement.findUpwardsByClass(el, 'ink-alert-block') || + el; + + if (toRemove) { + InkEvent.stop(ev); + InkElement.remove(toRemove); + } + }); + }; + + Close._name = 'Close_1'; + + return Close; +}); + +/** + * Auxiliar utilities for UI Modules + * @module Ink.UI.Common_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.Common', '1', ['Ink.Dom.Element_1', 'Ink.Net.Ajax_1','Ink.Dom.Css_1','Ink.Dom.Selector_1','Ink.Util.Url_1'], function(InkElement, Ajax,Css,Selector,Url) { + + 'use strict'; + + var nothing = {} /* a marker, for reference comparison. */; + + var keys = Object.keys || function (obj) { + var ret = []; + for (var k in obj) if (obj.hasOwnProperty(k)) { + ret.push(k); + } + return ret; + }; + + var es6WeakMapSupport = 'WeakMap' in window; + var instances = es6WeakMapSupport ? new WeakMap() : null; + + var domRegistry = { + get: function get(el) { + return es6WeakMapSupport ? + instances.get(el) : + el.__InkInstances; + }, + set: function set(el, thing) { + if (es6WeakMapSupport) { + instances.set(el, thing); + } else { + el.__InkInstances = thing; + } + } + }; + + /** + * @namespace Ink.UI.Common_1 + */ + + var Common = { + + /** + * Supported Ink Layouts + * + * @property Layouts + * @type Object + * @readOnly + */ + Layouts: { + TINY: 'tiny', + SMALL: 'small', + MEDIUM: 'medium', + LARGE: 'large', + XLARGE: 'xlarge' + }, + + /** + * Checks if an item is a valid DOM Element. + * + * @method isDOMElement + * @static + * @param {Mixed} o The object to be checked. + * @return {Boolean} True if it's a valid DOM Element. + * @example + * var el = Ink.s('#element'); + * if( Ink.UI.Common.isDOMElement( el ) === true ){ + * // It is a DOM Element. + * } else { + * // It is NOT a DOM Element. + * } + */ + isDOMElement: InkElement.isDOMElement, + + /** + * Checks if an item is a valid integer. + * + * @method isInteger + * @static + * @param {Mixed} n The value to be checked. + * @return {Boolean} True if it's a valid integer. + * @example + * var value = 1; + * if( Ink.UI.Common.isInteger( value ) === true ){ + * // It is an integer. + * } else { + * // It is NOT an integer. + * } + */ + isInteger: function(n) { + return (typeof n === 'number' && n % 1 === 0); + }, + + /** + * Gets a DOM Element. + * + * @method elOrSelector + * @static + * @param {DOMElement|String} elOrSelector DOM Element or CSS Selector + * @param {String} fieldName The name of the field. Commonly used for debugging. + * @return {DOMElement} Returns the DOMElement passed or the first result of the CSS Selector. Otherwise it throws an exception. + * @example + * // In case there are several .myInput, it will retrieve the first found + * var el = Ink.UI.Common.elOrSelector('.myInput','My Input'); + */ + elOrSelector: function(elOrSelector, fieldName) { + if (!this.isDOMElement(elOrSelector)) { + var t = Selector.select(elOrSelector); + if (t.length === 0) { + Ink.warn(fieldName + ' must either be a DOM Element or a selector expression!\nThe script element must also be after the DOM Element itself.'); + return null; + } + return t[0]; + } + return elOrSelector; + }, + + /** + * Alias for `elOrSelector` but returns an array of elements. + * + * @method elsOrSelector + * + * @static + * @param {DOMElement|String} elOrSelector DOM Element or CSS Selector + * @param {String} fieldName The name of the field. Commonly used for debugging. + * @return {DOMElement} Returns the DOMElement passed or the first result of the CSS Selector. Otherwise it throws an exception. + * @param {Boolean} required Flag to accept an empty array as output. + * @return {Array} The selected DOM Elements. + * @example + * var elements = Ink.UI.Common.elsOrSelector('input.my-inputs', 'My Input'); + */ + elsOrSelector: function(elsOrSelector, fieldName, required) { + var ret; + if (typeof elsOrSelector === 'string') { + ret = Selector.select(elsOrSelector); + } else if (Common.isDOMElement(elsOrSelector)) { + ret = [elsOrSelector]; + } else if (elsOrSelector && typeof elsOrSelector === 'object' && typeof elsOrSelector.length === 'number') { + ret = elsOrSelector; + } + + if (ret && ret.length) { + return ret; + } else { + if (required) { + throw new TypeError(fieldName + ' must either be a DOM Element, an Array of elements, or a selector expression!\nThe script element must also be after the DOM Element itself.'); + } else { + return []; + } + } + }, + + /** + * Gets options an object and element's metadata. + * + * The element's data attributes take precedence. Values from the element's data-atrributes are coerced into the required type. + * + * @method options + * + * @param {Object} [fieldId] Name to be used in debugging features. + * @param {Object} defaults Object with the options' types and defaults. + * @param {Object} overrides Options to override the defaults. Usually passed when instantiating an UI module. + * @param {DOMElement} [element] Element with data-attributes + * + * @example + * + * this._options = Ink.UI.Common.options('MyComponent', { + * 'anobject': ['Object', null], // Defaults to null + * 'target': ['Element', null], + * 'stuff': ['Number', 0.1], + * 'stuff2': ['Integer', 0], + * 'doKickFlip': ['Boolean', false], + * 'targets': ['Elements'], // Required option since no default was given + * 'onClick': ['Function', null] + * }, options || {}, elm) + * + * @example + * + * ### Note about booleans + * + * Here is how options are read from the markup + * data-attributes, for several values`data-a-boolean`. + * + * Options considered true: + * + * - `data-a-boolean="true"` + * - (Every other value which is not on the list below.) + * + * Options considered false: + * + * - `data-a-boolean="false"` + * - `data-a-boolean=""` + * - `data-a-boolean` + * + * Options which go to default: + * + * - (no attribute). When `data-a-boolean` is ommitted, the + * option is not considered true nor false, and as such + * defaults to what is in the `defaults` argument. + * + **/ + options: function (fieldId, defaults, overrides, element) { + if (typeof fieldId !== 'string') { + element = overrides; + overrides = defaults; + defaults = fieldId; + fieldId = ''; + } + overrides = overrides || {}; + var out = {}; + var dataAttrs = element ? InkElement.data(element) : {}; + var fromDataAttrs; + var type; + var lType; + var defaultVal; + + var invalidStr = function (str) { + if (fieldId) { str = fieldId + ': "' + ('' + str).replace(/"/, '\\"') + '"'; } + return str; + }; + + var quote = function (str) { + return '"' + ('' + str).replace(/"/, '\\"') + '"'; + }; + + var invalidThrow = function (str) { + throw new Error(invalidStr(str)); + }; + + var invalid = function (str) { + Ink.error(invalidStr(str) + '. Ignoring option.'); + }; + + function optionValue(key) { + type = defaults[key][0]; + lType = type.toLowerCase(); + defaultVal = defaults[key].length === 2 ? defaults[key][1] : nothing; + + if (!type) { + invalidThrow('Ink.UI.Common.options: Always specify a type!'); + } + if (!(lType in Common._coerce_funcs)) { + invalidThrow('Ink.UI.Common.options: ' + defaults[key][0] + ' is not a valid type. Use one of ' + keys(Common._coerce_funcs).join(', ')); + + } + if (!defaults[key].length || defaults[key].length > 2) { + invalidThrow('the "defaults" argument must be an object mapping option names to [typestring, optional] arrays.'); + } + + if (key in dataAttrs) { + fromDataAttrs = Common._coerce_from_string(lType, dataAttrs[key], key, fieldId); + // (above can return `nothing`) + } else { + fromDataAttrs = nothing; + } + + if (fromDataAttrs !== nothing) { + if (!Common._options_validate(fromDataAttrs, lType)) { + invalid('(' + key + ' option) Invalid ' + lType + ' ' + quote(fromDataAttrs)); + return defaultVal; + } else { + return fromDataAttrs; + } + } else if (key in overrides) { + return overrides[key]; + } else if (defaultVal !== nothing) { + return defaultVal; + } else { + invalidThrow('Option ' + key + ' is required!'); + } + } + + for (var key in defaults) { + if (defaults.hasOwnProperty(key)) { + out[key] = optionValue(key); + } + } + + return out; + }, + + _coerce_from_string: function (type, val, paramName, fieldId) { + if (type in Common._coerce_funcs) { + return Common._coerce_funcs[type](val, paramName, fieldId); + } else { + return val; + } + }, + + _options_validate: function (val, type) { + if (type in Common._options_validate_types) { + return Common._options_validate_types[type].call(Common, val); + } else { + // 'object' options cannot be passed through data-attributes. + // Json you say? Not any good to embed in HTML. + return false; + } + }, + + _coerce_funcs: (function () { + var ret = { + element: function (val) { + return Common.elOrSelector(val, ''); + }, + elements: function (val) { + return Common.elsOrSelector(val, '', false /*not required, so don't throw an exception now*/); + }, + object: function (val) { return val; }, + number: function (val) { return parseFloat(val); }, + 'boolean': function (val) { + return !(val === 'false' || val === '' || val === null); + }, + string: function (val) { return val; }, + 'function': function (val, paramName, fieldId) { + Ink.error(fieldId + ': You cannot specify the option "' + paramName + '" through data-attributes because it\'s a function'); + return nothing; + } + }; + ret['float'] = ret.integer = ret.number; + return ret; + }()), + + _options_validate_types: (function () { + var types = { + string: function (val) { + return typeof val === 'string'; + }, + number: function (val) { + return typeof val === 'number' && !isNaN(val) && isFinite(val); + }, + integer: function (val) { + return val === Math.round(val); + }, + element: function (val) { + return Common.isDOMElement(val); + }, + elements: function (val) { + return val && typeof val === 'object' && typeof val.length === 'number' && val.length; + }, + 'boolean': function (val) { + return typeof val === 'boolean'; + }, + object: function () { return true; } + }; + types['float'] = types.number; + return types; + }()), + + /** + * Deep copy (clone) an object. + * Note: The object cannot have referece loops. + * + * @method clone + * @static + * @param {Object} o The object to be cloned/copied. + * @return {Object} Returns the result of the clone/copy. + * @example + * var originalObj = { + * key1: 'value1', + * key2: 'value2', + * key3: 'value3' + * }; + * var cloneObj = Ink.UI.Common.clone( originalObj ); + */ + clone: function(o) { + try { + return JSON.parse( JSON.stringify(o) ); + } catch (ex) { + throw new Error('Given object cannot have loops!'); + } + }, + + + /** + * Gets an element's one-base index relative to its parent. + * + * @method childIndex + * @static + * @param {DOMElement} childEl Valid DOM Element. + * @return {Number} Numerical position of an element relatively to its parent. + * @example + * + *
        + *
      • One
      • + *
      • Two
      • + *
      • Three
      • + *
      • Four
      • + *
      + * + * + */ + childIndex: function(childEl) { + if( Common.isDOMElement(childEl) ){ + var els = Selector.select('> *', childEl.parentNode); + for (var i = 0, f = els.length; i < f; ++i) { + if (els[i] === childEl) { + return i; + } + } + } + throw 'not found!'; + }, + + + /** + * AJAX JSON request shortcut method + * It provides a more convenient way to do an AJAX request and expect a JSON response.It also offers a callback option, as third parameter, for better async handling. + * + * @method ajaxJSON + * @static + * @async + * @param {String} endpoint Valid URL to be used as target by the request. + * @param {Object} params This field is used in the thrown Exception to identify the parameter. + * @param {Function} cb Callback for the request. + * @example + * // In case there are several .myInput, it will retrieve the first found + * var el = Ink.UI.Common.elOrSelector('.myInput','My Input'); + */ + ajaxJSON: function(endpoint, params, cb) { + new Ajax( + endpoint, + { + evalJS: 'force', + method: 'POST', + parameters: params, + + onSuccess: function( r) { + try { + r = r.responseJSON; + if (r.status !== 'ok') { + throw 'server error: ' + r.message; + } + cb(null, r); + } catch (ex) { + cb(ex); + } + }, + + onFailure: function() { + cb('communication failure'); + } + } + ); + }, + + + /** + * Gets the current Ink layout. + * + * @method currentLayout + * @static + * @return {String} A string representation of the current layout name. + * @example + * var inkLayout = Ink.UI.Common.currentLayout(); + * if (inkLayout === 'small') { + * // ... + * } + */ + currentLayout: function() { + var i, f, k, v, el, detectorEl = Selector.select('#ink-layout-detector')[0]; + if (!detectorEl) { + detectorEl = document.createElement('div'); + detectorEl.id = 'ink-layout-detector'; + for (k in this.Layouts) { + if (this.Layouts.hasOwnProperty(k)) { + v = this.Layouts[k]; + el = document.createElement('div'); + el.className = 'show-' + v + ' hide-all'; + el.setAttribute('data-ink-layout', v); + detectorEl.appendChild(el); + } + } + document.body.appendChild(detectorEl); + } + + for (i = 0, f = detectorEl.children.length; i < f; ++i) { + el = detectorEl.children[i]; + if (Css.getStyle(el, 'display') === 'block') { + return el.getAttribute('data-ink-layout'); + } + } + + return 'large'; + }, + + + /** + * Sets the location's hash (window.location.hash). + * + * @method hashSet + * @static + * @param {Object} o Object with the info to be placed in the location's hash. + * @example + * // It will set the location's hash like: #key1=value1&key2=value2&key3=value3 + * Ink.UI.Common.hashSet({ + * key1: 'value1', + * key2: 'value2', + * key3: 'value3' + * }); + */ + hashSet: function(o) { + if (typeof o !== 'object') { throw new TypeError('o should be an object!'); } + var hashParams = Url.getAnchorString(); + hashParams = Ink.extendObj(hashParams, o); + window.location.hash = Url.genQueryString('', hashParams).substring(1); + }, + + /** + * Removes children nodes from a given object. + * This method was initially created to help solve a problem in Internet Explorer(s) that occurred when trying to set the innerHTML of some specific elements like 'table'. + * + * @method cleanChildren + * @static + * @param {DOMElement} parentEl Valid DOM Element + * @example + * + *
        + *
      • One
      • + *
      • Two
      • + *
      • Three
      • + *
      • Four
      • + *
      + * + * + * + * + *
        + */ + cleanChildren: function(parentEl) { + if( !Common.isDOMElement(parentEl) ){ + throw 'Please provide a valid DOMElement'; + } + var prevEl, el = parentEl.lastChild; + while (el) { + prevEl = el.previousSibling; + parentEl.removeChild(el); + el = prevEl; + } + }, + + /** + * Stores the id and/or classes of an element in an object. + * + * @method storeIdAndClasses + * @static + * @param {DOMElement} fromEl Valid DOM Element to get the id and classes from. + * @param {Object} inObj Object where the id and classes will be saved. + * @example + *
        + * + * + */ + storeIdAndClasses: function(fromEl, inObj) { + if( !Common.isDOMElement(fromEl) ){ + throw 'Please provide a valid DOMElement as first parameter'; + } + + var id = fromEl.id; + if (id) { + inObj._id = id; + } + + var classes = fromEl.className; + if (classes) { + inObj._classes = classes; + } + }, + + /** + * Sets the id and className properties of an element based + * + * @method restoreIdAndClasses + * @static + * @param {DOMElement} toEl Valid DOM Element to set the id and classes on. + * @param {Object} inObj Object where the id and classes to be set are. This method uses the same format as the one given in `storeIdAndClasses` + * @example + *
        + * + * + * + * + *
        + */ + restoreIdAndClasses: function(toEl, inObj) { + + if( !Common.isDOMElement(toEl) ){ + throw 'Please provide a valid DOMElement as first parameter'; + } + + if (inObj._id && toEl.id !== inObj._id) { + toEl.id = inObj._id; + } + + if (inObj._classes && toEl.className.indexOf(inObj._classes) === -1) { + if (toEl.className) { toEl.className += ' ' + inObj._classes; } + else { toEl.className = inObj._classes; } + } + + if (inObj._instanceId && !toEl.getAttribute('data-instance')) { + toEl.setAttribute('data-instance', inObj._instanceId); + } + }, + + _warnDoubleInstantiation: function (elm, newInstance) { + var instances = Common.getInstance(elm); + + if (getName(newInstance) === '') { return; } + if (!instances) { return; } + + var nameWithoutVersion = getName(newInstance); + + if (!nameWithoutVersion) { return; } + + for (var i = 0, len = instances.length; i < len; i++) { + if (nameWithoutVersion === getName(instances[i])) { + // Yes, I am using + to concatenate and , to split + // arguments. + // + // Elements can't be concatenated with strings, but if + // they are passed in an argument, modern debuggers will + // pretty-print them and make it easy to find them in the + // element inspector. + // + // On the other hand, if strings are passed as different + // arguments, they get pretty printed. And the pretty + // print of a string has quotes around it. + // + // If some day people find out that strings are not + // just text and they start preserving contextual + // information, then by all means change this to a + // regular concatenation. + // + // But they won't. So don't change this. + Ink.warn('Creating more than one ' + nameWithoutVersion + '.', + '(Was creating a ' + nameWithoutVersion + ' on:', elm, ').'); + return false; + } + } + + function getName(thing) { + return ((thing.constructor && (thing.constructor._name)) || + thing._name || + '').replace(/_.*?$/, ''); + } + + return true; + }, + + /** + * Saves a component's instance reference for later retrieval. + * + * @method registerInstance + * @static + * @param {Object} inst Object that holds the instance. + * @param {DOMElement} el DOM Element to associate with the object. + */ + registerInstance: function(inst, el) { + if (!inst) { return; } + + if (!Common.isDOMElement(el)) { throw new TypeError('Ink.UI.Common.registerInstance: The element passed in is not a DOM element!'); } + + // [todo] this belongs in the BaseUIComponent's initialization + if (Common._warnDoubleInstantiation(el, inst) === false) { + return false; + } + + var instances = domRegistry.get(el); + + if (!instances) { + instances = []; + domRegistry.set(el, instances); + } + + instances.push(inst); + + return true; + }, + + /** + * Deletes an instance with a given id. + * + * @method unregisterInstance + * @static + * @param {String} id Id of the instance to be destroyed. + */ + unregisterInstance: function(inst) { + if (!inst || !inst._element) { return; } + var instances = domRegistry.get(inst._element); + for (var i = 0, len = instances.length; i < len; i++) { + if (instances[i] === inst) { + instances.splice(i, 1); + } + } + }, + + /** + * Gets an UI instance from an element or instance id. + * + * @method getInstance + * @static + * @param {String|DOMElement} el DOM Element from which we want the instances. + * @return {Object|Array} Returns an instance or a collection of instances. + */ + getInstance: function(el, UIComponent) { + el = Common.elOrSelector(el); + var instances = domRegistry.get(el); + + if (!instances) { + instances = []; + } + + if (typeof UIComponent !== 'function') { + return instances; + } + + for (var i = 0, len = instances.length; i < len; i++) { + if (instances[i] instanceof UIComponent) { + return instances[i]; + } + } + + return null; + }, + + /** + * Gets an instance based on a selector. + * + * @method getInstanceFromSelector + * @static + * @param {String} selector CSS selector to get the instances from. + * @return {Object|Array} Returns an instance or a collection of instances. + */ + getInstanceFromSelector: function(selector) { + return Common.getInstance(Common.elOrSelector(selector)); + }, + + /** + * Gets all the instance ids + * + * @method getInstanceIds + * @static + * @return {Array} Collection of instance ids + */ + getInstanceIds: function() { + var res = []; + for (var id in instances) { + if (instances.hasOwnProperty(id)) { + res.push( id ); + } + } + return res; + }, + + /** + * Gets all the instances + * + * @method getInstances + * @static + * @return {Array} Collection of existing instances. + */ + getInstances: function() { + var res = []; + for (var id in instances) { + if (instances.hasOwnProperty(id)) { + res.push( instances[id] ); + } + } + return res; + }, + + /** + * Boilerplate method to destroy a component. + * Components should copy this method as its destroy method and modify it. + * + * @method destroyComponent + * @static + */ + destroyComponent: function() { + Common.unregisterInstance(this); + this._element.parentNode.removeChild(this._element); + } + + }; + + + + + /** + * Ink UI Base Class + **/ + + function warnStub() { + /* jshint validthis: true */ + if (!this || this === window || typeof this.constructor !== 'function') { return; } + Ink.warn('You called a method on an incorrectly instantiated ' + this.constructor._name + ' component. Check the warnings above to see what went wrong.'); + } + + function stub(prototype, obj) { + for (var k in prototype) if (prototype.hasOwnProperty(k)) { + if (k === 'constructor') { continue; } + if (typeof obj[k] === 'function') { + obj[k] = warnStub; + } + } + } + + /** + * Ink UI Base Class + * + * You don't use this class directly, or inherit from it directly. + * + * See createUIComponent() (in this module) for how to create a UI component and inherit from this. It's not plain old JS inheritance, for several reasons. + * + * @class Ink.UI.Common.BaseUIComponent + * @constructor + * + * @param element + * @param options + **/ + function BaseUIComponent(element, options) { + var constructor = this.constructor; + var _name = constructor._name; + + if (!this || this === window) { + throw new Error('Use "new InkComponent()" instead of "InkComponent()"'); + } + + if (this && !(this instanceof BaseUIComponent)) { + throw new Error('You forgot to call Ink.UI.Common.createUIComponent() on this module!'); + } + + if (!element && !constructor._componentOptions.elementIsOptional) { + Ink.error(new Error(_name + ': You need to pass an element or a selector as the first argument to "new ' + _name + '()"')); + return; + } else { + this._element = Common.elsOrSelector(element, + _name + ': An element with the selector "' + element + '" was not found!')[0]; + } + + if (!this._element && !constructor._componentOptions.elementIsOptional) { + isValidInstance = false; + Ink.error(new Error(element + ' does not match an element on the page. You need to pass a valid selector to "new ' + _name + '".')); + } + + // TODO Change Common.options's signature? the below looks better, more manageable + // var options = Common.options({ + // element: this._element, + // modName: constructor._name, + // options: constructor._optionDefinition, + // defaults: constructor._globalDefaults + // }); + + this._options = Common.options(_name, constructor._optionDefinition, options, this._element); + + var isValidInstance = BaseUIComponent._validateInstance(this) === true; + + if (isValidInstance && typeof this._init === 'function') { + try { + this._init.apply(this, arguments); + } catch(e) { + isValidInstance = false; + Ink.error(e); + } + } + + if (!isValidInstance) { + BaseUIComponent._stubInstance(this, constructor, _name); + } else if (this._element) { + Common.registerInstance(this, this._element); + } + } + + /** + * Calls the `instance`'s _validate() method so it can validate itself. + * + * Returns false if the method exists, was called, but no Error was returned or thrown. + * + * @method _validateInstance + * @private + */ + BaseUIComponent._validateInstance = function (instance) { + var err; + + if (typeof instance._validate !== 'function') { return true; } + + try { + err = instance._validate(); + } catch (e) { + err = e; + } + + if (err instanceof Error) { + instance._validationError = err; + return false; + } + + return true; + }; + + + /** + * Replaces every method in the instance with stub functions which just call Ink.warn(). + * + * This avoids breaking the page when there are errors. + * + * @method _stubInstance + * @param instance + * @param constructor + * @param name + * @private + */ + BaseUIComponent._stubInstance = function (instance, constructor, name) { + stub(constructor.prototype, instance); + stub(BaseUIComponent.prototype, instance); + Ink.warn(name + ' was not correctly created. ' + (instance._validationError || '')); + }; + + // TODO BaseUIComponent.setGlobalOptions = function () {} + // TODO BaseUIComponent.createMany = function (selector) {} + BaseUIComponent.getInstance = function (elOrSelector) { + elOrSelector = Common.elOrSelector(elOrSelector); + return Common.getInstance(elOrSelector, this /* get instance by constructor */); + }; + + Ink.extendObj(BaseUIComponent.prototype, { + /** + * Get an UI component's option's value. + * + * @method getOption + * @param name + * + * @return The option value, or undefined if nothing is found. + * + * @example + * + * var myUIComponent = new Modal('#element', { trigger: '#trigger' }); // or anything else inheriting BaseUIComponent + * myUIComponent.getOption('trigger'); // -> The trigger element (not the selector string, mind you) + * + **/ + getOption: function (name) { + if (this.constructor && !(name in this.constructor._optionDefinition)) { + Ink.error('"' + name + '" is not an option for ' + this.constructor._name); + return undefined; + } + + return this._options[name]; + }, + + /** + * Sets an option's value + * + * @method getOption + * @param name + * @param value + * + * @example + * + * var myUIComponent = new Modal(...); + * myUIComponent.setOption('trigger', '#some-element'); + **/ + setOption: function (name, value) { + if (this.constructor && !(name in this.constructor._optionDefinition)) { + Ink.error('"' + name + ' is not an option for ' + this.constructor._name); + return; + } + + this._options[name] = value; + }, + + /** + * Get the element associated with an UI component (IE the one you used in the constructor) + * + * @method getElement + * @return {Element} The component's element. + * + * @example + * var myUIComponent = new Modal('#element'); // or anything else inheriting BaseUIComponent + * myUIComponent.getElement(); // -> The '#element' (not the selector string, mind you). + * + **/ + getElement: function () { + return this._element; + } + }); + + Common.BaseUIComponent = BaseUIComponent; + + /** + * @method createUIComponent + * @param theConstructor UI component constructor. It should have an _init function in its prototype, an _optionDefinition object, and a _name property indicating its name. + * @param options + * @param [options.elementIsOptional=false] Whether the element argument is optional (For example, when the component might work on existing markup or create its own). + **/ + Common.createUIComponent = function createUIComponent(theConstructor, options) { + theConstructor._componentOptions = options || {}; + + function assert(test, msg) { + if (!test) { + throw new Error('Ink.UI_1.createUIComponent: ' + msg); + } + } + + function assertProp(prop, propType, message) { + var propVal = theConstructor[prop]; + // Check that the property was passed + assert(typeof propVal !== 'undefined', + theConstructor + ' doesn\'t have a "' + prop + '" property. ' + message); + // Check that its type is correct + assert(propType && typeof propVal === propType, + 'typeof ' + theConstructor + '.' + prop + ' is not "' + propType + '". ' + message); + } + + assert(typeof theConstructor === 'function', + 'constructor argument is not a function!'); + + assertProp('_name', 'string', 'This property is used for error ' + + 'messages. Set it to the full module path and version (Ink.My.Module_1).'); + assertProp('_optionDefinition', 'object', 'This property contains the ' + + 'option names, types and defaults. See Ink.UI.Common.options() for reference.'); + + // Extend the instance methods and props + var _oldProto = theConstructor.prototype; + + if (typeof Object.create === 'function') { + theConstructor.prototype = Object.create(BaseUIComponent.prototype); + } else { + theConstructor.prototype = (function hideF() { + function F() {} + F.prototype = BaseUIComponent.prototype; + return new F(); + }()); + } + + Ink.extendObj(theConstructor.prototype, _oldProto); + theConstructor.prototype.constructor = theConstructor; + // Extend static methods + Ink.extendObj(theConstructor, BaseUIComponent); + }; + + return Common; + +}); + +/** + * Date selector + * @module Ink.UI.DatePicker_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.DatePicker', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1','Ink.Util.Date_1', 'Ink.Dom.Browser_1'], function(Common, Event, Css, InkElement, Selector, InkArray, InkDate ) { + 'use strict'; + + // Clamp a number into a min/max limit + function clamp(n, min, max) { + if (n > max) { n = max; } + if (n < min) { n = min; } + + return n; + } + + function dateishFromYMDString(YMD) { + var split = YMD.split('-'); + return dateishFromYMD(+split[0], +split[1] - 1, +split[2]); + } + + function dateishFromYMD(year, month, day) { + return {_year: year, _month: month, _day: day}; + } + + function dateishFromDate(date) { + return {_year: date.getFullYear(), _month: date.getMonth(), _day: date.getDate()}; + } + + /** + * @class Ink.UI.DatePicker + * @constructor + * @version 1 + * + * @param {String|DOMElement} selector + * @param {Object} [options] Options + * @param {Boolean} [options.autoOpen] Flag to automatically open the datepicker. + * @param {String} [options.cleanText] Text for the clean button. Defaults to 'Clear'. + * @param {String} [options.closeText] Text for the close button. Defaults to 'Close'. + * @param {String} [options.cssClass] CSS class to be applied on the datepicker + * @param {String|DOMElement} [options.pickerField] (if not using in an input[type="text"]) Element which displays the DatePicker when clicked. Defaults to an "open" link. + * @param {String} [options.dateRange] Enforce limits to year, month and day for the Date, ex: '1990-08-25:2020-11' + * @param {Boolean} [options.displayInSelect] Flag to display the component in a select element. + * @param {String|DOMElement} [options.dayField] (if using options.displayInSelect) `select` field with days. + * @param {String|DOMElement} [options.monthField] (if using options.displayInSelect) `select` field with months. + * @param {String|DOMElement} [options.yearField] (if using options.displayInSelect) `select` field with years. + * @param {String} [options.format] Date format string + * @param {Object} [options.month] Hash of month names. Defaults to portuguese month names. January is 1. + * @param {String} [options.nextLinkText] Text for the previous button. Defaults to '«'. + * @param {String} [options.ofText] Text to show between month and year. Defaults to ' of '. + * @param {Boolean} [options.onFocus] If the datepicker should open when the target element is focused. Defaults to true. + * @param {Function} [options.onMonthSelected] Callback to execute when the month is selected. + * @param {Function} [options.onSetDate] Callback to execute when the date is set. + * @param {Function} [options.onYearSelected] Callback to execute when the year is selected. + * @param {String} [options.position] Position for the datepicker. Either 'right' or 'bottom'. Defaults to 'right'. + * @param {String} [options.prevLinkText] Text for the previous button. Defaults to '«'. + * @param {Boolean} [options.showClean] If the clean button should be visible. Defaults to true. + * @param {Boolean} [options.showClose] If the close button should be visible. Defaults to true. + * @param {Boolean} [options.shy] If the datepicker should start automatically. Defaults to true. + * @param {String} [options.startDate] Date to define initial month. Must be in yyyy-mm-dd format. + * @param {Number} [options.startWeekDay] First day of the week. Sunday is zero. Defaults to 1 (Monday). + * @param {Function} [options.validYearFn] Callback to execute when 'rendering' the month (in the month view) + * @param {Function} [options.validMonthFn] Callback to execute when 'rendering' the month (in the month view) + * @param {Function} [options.validDayFn] Callback to execute when 'rendering' the day (in the month view) + * @param {Function} [options.nextValidDateFn] Function to calculate the next valid date, given the current. Useful when there's invalid dates or time frames. + * @param {Function} [options.prevValidDateFn] Function to calculate the previous valid date, given the current. Useful when there's invalid dates or time frames. + * @param {Object} [options.wDay] Hash of week day names. Sunday is 0. Defaults to { 0:'Sunday', 1:'Monday', etc... + * @param {String} [options.yearRange] Enforce limits to year for the Date, ex: '1990:2020' (deprecated) + * + * @sample Ink_UI_DatePicker_1.html + */ + var DatePicker = function() { + Common.BaseUIComponent.apply(this, arguments); + }; + + DatePicker._name = 'DatePicker_1'; + + DatePicker._optionDefinition = { + autoOpen: ['Boolean', false], + cleanText: ['String', 'Clear'], + closeText: ['String', 'Close'], + pickerField: ['Element', null], + containerElement:['Element', null], + cssClass: ['String', 'ink-calendar bottom'], + dateRange: ['String', null], + + // use this in a + * + * By applying this UI class to the above input, you get a tag field with the tags "initial" and "value". The class preserves the original input element. It remains hidden and is updated with new tag information dynamically, so regular HTML form logic still applies. + * + * Below "input" refers to the current value of the input tag (updated as the user enters text, of course), and "output" refers to the value which this class writes back to said input tag. + * + * @class Ink.UI.TagField + * @version 1 + * @constructor + * @param {String|DOMElement} element Selector or DOM Input Element. + * @param {Object} [options] Options object + * @param {String|Array} [options.tags] Initial tags in the input + * @param {Boolean} [options.allowRepeated] Flag to allow user to input several tags. Defaults to true. + * @param {RegExp} [options.separator] Split the input by this RegExp. Defaults to /[,;(space)]+/g (spaces, commas and semicolons) + * @param {String} [options.outSeparator] Use this string to separate each tag from the next in the output. Defaults to ','. + * @param {Boolean} [options.autoSplit] Flag to activate tag creation when the user types a separator. Defaults to true. + * @param {Integer} [options.maxTags] Maximum number of tags allowed. Set to -1 for no limit. Defaults to -1. + * @example + */ + function TagField() { + Common.BaseUIComponent.apply(this, arguments); + } + + TagField._name = 'TagField_1'; + + TagField._optionDefinition = { + tags: ['String', []], + tagQuery: ['Object', null], + tagQueryAsync: ['Object', null], + allowRepeated: ['Boolean', false], + maxTags: ['Integer', -1], + outSeparator: ['String', ','], + separator: ['String', /[,; ]+/g], + autoSplit: ['Boolean', true] + }; + + TagField.prototype = { + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function() { + var o = this._options; + if (typeof o.separator === 'string') { + o.separator = new RegExp(o.separator, 'g'); + } + + if (typeof o.tags === 'string') { + // coerce to array using the separator + o.tags = this._readInput(o.tags); + } + + Css.addClassName(this._element, 'hide-all'); + + this._viewElm = InkElement.create('div', { + className: 'ink-tagfield', + insertAfter: this._element + }); + + this._input = InkElement.create('input', { + type: 'text', + className: 'new-tag-input', + insertBottom: this._viewElm + }); + + var tags = [].concat(o.tags, this._tagsFromMarkup(this._element)); + + this._tags = []; + + InkArray.each(tags, Ink.bindMethod(this, '_addTag')); + + InkEvent.observe(this._input, 'keyup', Ink.bindEvent(this._onKeyUp, this)); + InkEvent.observe(this._input, 'change', Ink.bindEvent(this._onKeyUp, this)); + InkEvent.observe(this._input, 'keydown', Ink.bindEvent(this._onKeyDown, this)); + InkEvent.observe(this._input, 'blur', Ink.bindEvent(this._onBlur, this)); + InkEvent.observe(this._viewElm, 'click', Ink.bindEvent(this._refocus, this)); + }, + + destroy: function () { + InkElement.remove(this._viewElm); + Css.removeClassName(this._element, 'hide-all'); + }, + + _tagsFromMarkup: function (element) { + var tagname = element.tagName.toLowerCase(); + if (tagname === 'input') { + return this._readInput(element.value); + } else if (tagname === 'select') { + return InkArray.map(element.getElementsByTagName('option'), function (option) { + return InkElement.textContent(option); + }); + } else { + throw new Error('Cannot read tags from a ' + tagname + ' tag. Unknown tag'); + } + }, + + _tagsToMarkup: function (tags, element) { + var tagname = element.tagName.toLowerCase(); + if (tagname === 'input') { + if (this._options.separator) { + element.value = tags.join(this._options.outSeparator); + } + } else if (tagname === 'select') { + element.innerHTML = ''; + InkArray.each(tags, function (tag) { + var opt = InkElement.create('option', {selected: 'selected'}); + InkElement.setTextContent(opt, tag); + element.appendChild(opt); + }); + } else { + throw new Error('TagField: Cannot read tags from a ' + tagname + ' tag. Unknown tag'); + } + }, + + _addTag: function (tag) { + if (this._options.maxTags !== -1 && + this._tags.length >= this._options.maxTags) { + return; + } + if ((!this._options.allowRepeated && + InkArray.inArray(tag, this._tags, tag)) || !tag) { + return false; + } + var elm = InkElement.create('span', { + className: 'ink-tag', + setTextContent: tag + ' ' + }); + + var remove = InkElement.create('span', { + className: 'remove fa fa-times', + insertBottom: elm + }); + InkEvent.observe(remove, 'click', Ink.bindEvent(this._removeTag, this, null)); + + var spc = document.createTextNode(' '); + + this._tags.push(tag); + this._viewElm.insertBefore(elm, this._input); + this._viewElm.insertBefore(spc, this._input); + this._tagsToMarkup(this._tags, this._element); + }, + + _readInput: function (text) { + if (this._options.separator) { + return InkArray.filter(text.split(this._options.separator), isTruthy); + } else { + return [text]; + } + }, + + _onKeyUp: function () { // TODO control input box size + if (!this._options.autoSplit) { + return; + } + var split = this._input.value.split(this._options.separator); + if (split.length <= 1) { + return; + } + var last = split[split.length - 1]; + split = split.splice(0, split.length - 1); + split = InkArray.filter(split, isTruthy); + + InkArray.each(split, Ink.bind(this._addTag, this)); + this._input.value = last; + }, + + _onKeyDown: function (event) { + if (event.which === enterKey) { + return this._onEnterKeyDown(event); + } else if (event.which === backspaceKey) { + return this._onBackspaceKeyDown(); + } else if (this._removeConfirm) { + // user pressed another key, cancel removal from a backspace key + this._unsetRemovingVisual(this._tags.length - 1); + } + }, + + /** + * When the user presses backspace twice on the empty input, we delete the last tag on the field. + * @method onBackspaceKeyDown + * @private + */ + _onBackspaceKeyDown: function () { + if (this._input.value) { return; } + + if (this._removeConfirm) { + this._unsetRemovingVisual(this._tags.length - 1); + this._removeTag(this._tags.length - 1); + this._removeConfirm = null; + } else { + this._setRemovingVisual(this._tags.length - 1); + } + }, + + _onEnterKeyDown: function (event) { + var tag = this._input.value; + if (tag) { + this._addTag(tag); + this._input.value = ''; + } + InkEvent.stopDefault(event); + }, + + _onBlur: function () { + this._addTag(this._input.value); + this._input.value = ''; + }, + + /* For when the user presses backspace. + * Set the style of the tag so that it seems like it's going to be removed + * if they press backspace again. */ + _setRemovingVisual: function (tagIndex) { + var elm = this._viewElm.children[tagIndex]; + if (!elm) { return; } + + Css.addClassName(elm, 'tag-deleting'); + + this._removeRemovingVisualTimeout = setTimeout(Ink.bindMethod(this, '_unsetRemovingVisual', tagIndex), 4000); + InkEvent.observe(this._input, 'blur', Ink.bindMethod(this, '_unsetRemovingVisual', tagIndex)); + this._removeConfirm = true; + }, + _unsetRemovingVisual: function (tagIndex) { + var elm = this._viewElm.children[tagIndex]; + if (elm) { + Css.removeClassName(elm, 'tag-deleting'); + clearTimeout(this._removeRemovingVisualTimeout); + } + this._removeConfirm = null; + }, + + _removeTag: function (event) { + var index; + if (typeof event === 'object') { // click event on close button + var elm = InkEvent.element(event).parentNode; + index = InkElement.parentIndexOf(this._viewElm, elm); + } else if (typeof event === 'number') { // manual removal + index = event; + } + this._tags = InkArray.remove(this._tags, index, 1); + InkElement.remove(this._viewElm.children[index]); + this._tagsToMarkup(this._tags, this._element); + }, + + _refocus: function (event) { + this._input.focus(); + InkEvent.stop(event); + return false; + } + }; + + Common.createUIComponent(TagField); + + return TagField; +}); + +/** + * Toggle the visibility of elements. + * @module Ink.UI.Toggle_1 + * @version 1 + */ + + Ink.createModule('Ink.UI.Toggle', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, InkEvent, Css, InkElement, Selector, InkArray ) { + 'use strict'; + + /** + * + * You need two elements to use Toggle: the `trigger` element, and the `target` element (or elements). The default behaviour is to toggle the `target`(s) when you click the `trigger`. + * + * The toggle has a state. It is either "on" or "off". It works by switching between the CSS classes in `classNameOn` and `classNameOff` according to the current state. + * + * When you initialize the Toggle, it will check if the targets are visible to figure out what the initial state is. You can force the toggle to consider itself turned "on" or "off" by setting the `initialState` option to `true` or `false`, respectively. + * + * You can get the current state of the Toggle by calling `getState`, or by checking if your `trigger` element has the "active" class. + * The state can be changed through JavaScript. Just call `setState(true)` + * to turn the Toggle on (or `setState(false)` to turn it off). + * + * @class Ink.UI.Toggle + * @constructor + * @version 1 + * @param {String|DOMElement} selector Trigger element. By clicking this, the target (or targets) are triggered. + * @param {Object} [options] Options object, containing: + * + * @param {String} options.target CSS Selector that specifies the elements that this component will toggle + * @param {String} [options.classNameOn] CSS class to toggle when on. Defaults to 'show-all'. + * @param {String} [options.classNameOff] CSS class to toggle when off. Defaults to 'hide-all'. + * @param {String} [options.triggerEvent] Event that will trigger the toggling. Defaults to 'click'. + * @param {Boolean} [options.closeOnClick] Flag to toggle the targe off when clicking outside the toggled content. Defaults to true. + * @param {String} [options.closeOnInsideClick] Toggle off when a child element matching this selector is clicked. Set to null to deactivate the check. Defaults to 'a[href]'. + * @param {Boolean} [options.initialState] Flag to define initial state. false: off, true: on, null: markup. Defaults to null. + * @param {Function} [options.onChangeState] Callback when the toggle state changes. Return `false` to cancel the event. + * + * @sample Ink_UI_Toggle_1_constructor.html + */ + function Toggle(){ + Common.BaseUIComponent.apply(this, arguments); + } + + Toggle._name = 'Toggle_1'; + + Toggle._optionDefinition = { + target: ['Elements'], + triggerEvent: ['String', 'click'], + closeOnClick: ['Boolean', true], + isAccordion: ['Boolean', false], + initialState: ['Boolean', null], // May be true, false, or null to be what it is right now + classNameOn: ['String', 'show-all'], + classNameOff: ['String', 'hide-all'], + closeOnInsideClick: ['String', 'a[href]'], // closes the toggle when a target is clicked and it is a link + onChangeState: ['Function', null] + }; + + Toggle.prototype = { + + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function(){ + var i, len; + + this._targets = Common.elsOrSelector(this._options.target); + + // Boolean option handling + this._options.closeOnClick = this._options.closeOnClick.toString() === 'true'; + // Actually a throolean + if (this._options.initialState !== null){ + this._options.initialState = this._options.initialState.toString() === 'true'; + } else { + this._options.initialState = Css.getStyle(this._targets[0], 'display') !== 'none'; + } + + if (this._options.classNameOn !== 'show-all' || this._options.classNameOff !== 'hide-all') { + for (i = 0, len = this._targets.length; i < len; i++) { + Css.removeClassName(this._targets[i], 'show-all'); + Css.removeClassName(this._targets[i], 'hide-all'); + } + } + + this._accordion = ( Css.hasClassName(this._element.parentNode,'accordion') || Css.hasClassName(this._targets[0].parentNode,'accordion') ); + + this._firstTime = true; + + this._bindEvents(); + + if (this._options.initialState !== null) { + this.setState(this._options.initialState, true); + } else { + // Add initial classes matching the current "display" of the object. + var state = Css.getStyle(this._targets[0], 'display') !== 'none'; + this.setState(state, true); + } + // Aditionally, remove any inline "display" style. + for (i = 0, len = this._targets.length; i < len; i++) { + if (this._targets[i].style.display) { + this._targets[i].style.display = ''; // becomes default + } + } + + this._element.setAttribute('data-is-toggle-trigger', 'true'); + }, + + /** + * @method _bindEvents + * @private + */ + _bindEvents: function () { + if ( this._options.triggerEvent ) { + InkEvent.observe( + this._element, + this._options.triggerEvent, + Ink.bind(this._onTriggerEvent, this)); + } + if( this._options.closeOnClick ){ + InkEvent.observe( document, 'click', Ink.bind(this._onOutsideClick, this)); + } + if( this._options.closeOnInsideClick && this._options.closeOnInsideClick !== 'false') { + var sel = this._options.closeOnInsideClick; + if (sel.toString() === 'true') { + sel = '*'; + } + InkEvent.observeMulti(this._targets, 'click', Ink.bind(function (e) { + if ( InkElement.findUpwardsBySelector(InkEvent.element(e), sel) ) { + this.setState(false, true); + } + }, this)); + } + }, + + /** + * Event handler. It's responsible for handling the `triggerEvent` as defined in the options. + * + * This will trigger the toggle. + * + * @method _onTriggerEvent + * @param {Event} event + * @private + */ + _onTriggerEvent: function( event ){ + // When the togglee is a child of the toggler, we get the togglee's events here. We have to check that this event is for us. + var target = InkEvent.element(event); + + var isAncestorOfClickedElement = InkArray.some(this._targets, function (thisOne) { + return thisOne === target || InkElement.isAncestorOf(thisOne, target); + }); + + if (isAncestorOfClickedElement) { + return; + } + + if (this._accordion) { + this._updateAccordion(); + } + + var has = this.getState(); + this.setState(!has, true); + if (!has && this._firstTime) { + this._firstTime = false; + } + + InkEvent.stopDefault(event); + }, + + /** + * Be compatible with accordions + * + * @method _updateAccordion + **/ + _updateAccordion: function () { + var elms, accordionElement; + if( Css.hasClassName(this._targets[0].parentNode,'accordion') ){ + accordionElement = this._targets[0].parentNode; + } else { + accordionElement = this._targets[0].parentNode.parentNode; + } + elms = Selector.select('.toggle, .ink-toggle',accordionElement); + for(var i=0; i 0) && (targetElm[0] !== this._targets[0]) ){ + targetElm[0].style.display = 'none'; + } + } + }, + + /** + * Click handler. Will handle clicks outside the toggle component. + * + * @method _onOutsideClick + * @param {Event} event + * @private + */ + _onOutsideClick: function( event ){ + var tgtEl = InkEvent.element(event), + shades; + + if (InkElement.findUpwardsBySelector(tgtEl, '[data-is-toggle-trigger="true"]')) return; + + var ancestorOfTargets = InkArray.some(this._targets, function (target) { + return InkElement.isAncestorOf(target, tgtEl) || target === tgtEl; + }); + + if( (this._element === tgtEl) || InkElement.isAncestorOf(this._element, tgtEl) || ancestorOfTargets) { + return; + } else if( (shades = Ink.ss('.ink-shade')).length ) { + var shadesLength = shades.length; + + for( var i = 0; i < shadesLength; i++ ){ + if( InkElement.isAncestorOf(shades[i],tgtEl) && InkElement.isAncestorOf(shades[i],this._element) ){ + return; + } + } + } + + this.setState(false, true); // dismiss + }, + + /** + * Sets the state of the toggle. (on/off) + * + * @method setState + * @param newState {Boolean} New state (on/off) + */ + setState: function (on, callHandler) { + if (on === this.getState()) { return; } + if (callHandler && typeof this._options.onChangeState === 'function') { + var ret = this._options.onChangeState(on); + if (ret === false) { return false; } // Canceled by the event handler + } + for (var i = 0, len = this._targets.length; i < len; i++) { + Css.addRemoveClassName(this._targets[i], this._options.classNameOn, on); + Css.addRemoveClassName(this._targets[i], this._options.classNameOff, !on); + } + Css.addRemoveClassName(this._element, 'active', on); + }, + + /** + * Gets the state of the toggle. (on/off) + * + * @method getState + * + * @return {Boolean} whether the toggle is toggled on. + */ + getState: function () { + return Css.hasClassName(this._element, 'active'); + } + }; + + Common.createUIComponent(Toggle); + + return Toggle; +}); + +/** + * Content Tooltips + * @module Ink.UI.Tooltip_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Tooltip', '1', ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Element_1', 'Ink.Dom.Selector_1', 'Ink.Util.Array_1', 'Ink.Dom.Css_1', 'Ink.Dom.Browser_1'], function (Common, InkEvent, InkElement, Selector, InkArray, Css) { + 'use strict'; + + /** + * Tooltips are useful as a means to display information about functionality while avoiding clutter. + * + * Tooltips show up when you hover elements which "have" tooltips. + * + * This class will "give" a tooltip to many elements, selected by its first argument (`target`). This is contrary to the other UI modules in Ink, which are created once per element. + * + * You can define options either through the second argument of the Tooltip constructor, or as data-attributes in each `target` element. Options set through data-attributes all start with "data-tip", and override options passed into the Tooltip constructor. + * + * @class Ink.UI.Tooltip + * @constructor + * + * @param {DOMElement|String} target Target element or selector of elements, to display the tooltips on. + * @param {Object} [options] Options object + * @param {String} [options.text] Text content for the tooltip. + * @param {String} [options.html] HTML for the tooltip. Same as above, but won't escape HTML. + * @param {String} [options.where] Positioning for the tooltip. Options are 'up', 'down', 'left', 'right', 'mousemove' (follows the cursor), and 'mousefix' (stays fixed). Defaults to 'up'. + * + * @param {String} [options.color] Color of the tooltip. Options are red, orange, blue, green and black. Default is white. + * @param {Number} [options.fade] Number of seconds to fade in/out. Defaults to 0.3. + * @param {Boolean} [options.forever] Flag to prevent the tooltip from being erased when the mouse hovers away from the target. + * @param {Number} [options.timeout] Number of seconds the tooltip will stay open. Useful together with options.forever. Defaults to 0. + * @param {Number} [options.delay] Time the tooltip waits until it is displayed. Useful to avoid getting the attention of the user unnecessarily + * @param {DOMElement|Selector} [options.template] Element or selector containing HTML to be cloned into the tooltips. Can be a hidden element, because CSS `display` is set to `block`. + * @param {String} [options.templatefield] Selector within the template element to choose where the text is inserted into the tooltip. Useful when a wrapper DIV is required. + * @param {Number} [options.left] Spacing from the target to the tooltip, when `where` is `mousemove` or `mousefix`. Defaults to 10. + * @param {Number} [options.top] Spacing from the target to the tooltip, when `where` is `mousemove` or `mousefix`. Defaults to 10. + * @param {Number} [options.spacing] Spacing between the tooltip and the target element, when `where` is not `mousemove` or `mousefix`. Defaults to 8. + * + * @sample Ink_UI_Tooltip_1.html + */ + function Tooltip(element, options) { + this._init(element, options || {}); + } + + function EachTooltip(root, elm) { + this._init(root, elm); + } + + var transitionDurationName, + transitionPropertyName, + transitionTimingFunctionName; + (function () { // Feature detection + var test = document.createElement('DIV'); + var names = ['transition', 'oTransition', 'msTransition', 'mozTransition', + 'webkitTransition']; + for (var i = 0; i < names.length; i++) { + if (typeof test.style[names[i] + 'Duration'] !== 'undefined') { + transitionDurationName = names[i] + 'Duration'; + transitionPropertyName = names[i] + 'Property'; + transitionTimingFunctionName = names[i] + 'TimingFunction'; + break; + } + } + }()); + + // Body or documentElement + var bodies = document.getElementsByTagName('body'); + var body = bodies.length ? bodies[0] : document.documentElement; + + Tooltip.prototype = { + _init: function(element, options) { + var elements; + + this.options = Ink.extendObj({ + where: 'up', + zIndex: 10000, + left: 10, + top: 10, + spacing: 8, + forever: 0, + color: '', + timeout: 0, + delay: 0, + template: null, + templatefield: null, + fade: 0.3, + text: '' + }, options || {}); + + if (typeof element === 'string') { + elements = Selector.select(element); + } else if (typeof element === 'object') { + elements = [element]; + } else { + throw 'Element expected'; + } + + this.tooltips = []; + + for (var i = 0, len = elements.length; i < len; i++) { + this.tooltips[i] = new EachTooltip(this, elements[i]); + } + }, + /** + * Destroys the tooltips created by this instance + * + * @method destroy + */ + destroy: function () { + InkArray.each(this.tooltips, function (tooltip) { + tooltip._destroy(); + }); + this.tooltips = null; + this.options = null; + } + }; + + EachTooltip.prototype = { + _oppositeDirections: { + left: 'right', + right: 'left', + up: 'down', + down: 'up' + }, + _init: function(root, elm) { + InkEvent.observe(elm, 'mouseover', Ink.bindEvent(this._onMouseOver, this)); + InkEvent.observe(elm, 'mouseout', Ink.bindEvent(this._onMouseOut, this)); + InkEvent.observe(elm, 'mousemove', Ink.bindEvent(this._onMouseMove, this)); + + this.root = root; + this.element = elm; + this._delayTimeout = null; + this.tooltip = null; + + Common.registerInstance(this, this.element); + }, + _makeTooltip: function (mousePosition) { + if (!this._getOpt('text') && + !this._getOpt('html') && + !InkElement.hasAttribute(this.element, 'title')) { + return false; + } + + var tooltip = this._createTooltipElement(); + + if (this.tooltip) { + this._removeTooltip(); + } + + this.tooltip = tooltip; + + this._fadeInTooltipElement(tooltip); + this._placeTooltipElement(tooltip, mousePosition); + + InkEvent.observe(tooltip, 'mouseover', Ink.bindEvent(this._onTooltipMouseOver, this)); + + var timeout = this._getFloatOpt('timeout'); + if (timeout) { + setTimeout(Ink.bind(function () { + if (this.tooltip === tooltip) { + this._removeTooltip(); + } + }, this), timeout * 1000); + } + }, + _createTooltipElement: function () { + var template = this._getOpt('template'), // User template instead of our HTML + templatefield = this._getOpt('templatefield'), + + tooltip, // The element we float + field; // Element where we write our message. Child or same as the above + + if (template) { // The user told us of a template to use. We copy it. + var temp = document.createElement('DIV'); + temp.innerHTML = Common.elOrSelector(template, 'options.template').outerHTML; + tooltip = temp.firstChild; + + if (templatefield) { + field = Selector.select(templatefield, tooltip); + if (field) { + field = field[0]; + } else { + throw 'options.templatefield must be a valid selector within options.template'; + } + } else { + field = tooltip; // Assume same element if user did not specify a field + } + } else { // We create the default structure + tooltip = document.createElement('DIV'); + Css.addClassName(tooltip, 'ink-tooltip'); + Css.addClassName(tooltip, this._getOpt('color')); + + field = document.createElement('DIV'); + Css.addClassName(field, 'content'); + + tooltip.appendChild(field); + } + + if (this._getOpt('html')) { + field.innerHTML = this._getOpt('html'); + } else if (this._getOpt('text')) { + InkElement.setTextContent(field, this._getOpt('text')); + } else { + InkElement.setTextContent(field, this.element.getAttribute('title')); + } + tooltip.style.display = 'block'; + tooltip.style.position = 'absolute'; + tooltip.style.zIndex = this._getIntOpt('zIndex'); + + return tooltip; + }, + _fadeInTooltipElement: function (tooltip) { + var fadeTime = this._getFloatOpt('fade'); + if (transitionDurationName && fadeTime) { + tooltip.style.opacity = '0'; + tooltip.style[transitionDurationName] = fadeTime + 's'; + tooltip.style[transitionPropertyName] = 'opacity'; + tooltip.style[transitionTimingFunctionName] = 'ease-in-out'; + setTimeout(function () { + tooltip.style.opacity = '1'; + }, 0); // Wait a tick + } + }, + _placeTooltipElement: function (tooltip, mousePosition) { + var where = this._getOpt('where'); + + if (where === 'mousemove' || where === 'mousefix') { + var mPos = mousePosition; + this._setPos(mPos[0], mPos[1]); + body.appendChild(tooltip); + } else if (where.match(/(up|down|left|right)/)) { + body.appendChild(tooltip); + var targetElementPos = InkElement.offset(this.element); + var tleft = targetElementPos[0], + ttop = targetElementPos[1]; + + var centerh = (InkElement.elementWidth(this.element) / 2) - (InkElement.elementWidth(tooltip) / 2), + centerv = (InkElement.elementHeight(this.element) / 2) - (InkElement.elementHeight(tooltip) / 2); + var spacing = this._getIntOpt('spacing'); + + var tooltipDims = InkElement.elementDimensions(tooltip); + var elementDims = InkElement.elementDimensions(this.element); + + var maxX = InkElement.scrollWidth() + InkElement.viewportWidth(); + var maxY = InkElement.scrollHeight() + InkElement.viewportHeight(); + + where = this._getWhereValueInsideViewport(where, { + left: tleft - tooltipDims[0], + right: tleft + tooltipDims[0], + top: ttop + tooltipDims[1], + bottom: ttop + tooltipDims[1] + }, { + right: maxX, + bottom: maxY + }); + + if (where === 'up') { + ttop -= tooltipDims[1]; + ttop -= spacing; + tleft += centerh; + } else if (where === 'down') { + ttop += elementDims[1]; + ttop += spacing; + tleft += centerh; + } else if (where === 'left') { + tleft -= tooltipDims[0]; + tleft -= spacing; + ttop += centerv; + } else if (where === 'right') { + tleft += elementDims[0]; + tleft += spacing; + ttop += centerv; + } + + var arrow = null; + if (where.match(/(up|down|left|right)/)) { + arrow = document.createElement('SPAN'); + Css.addClassName(arrow, 'arrow'); + Css.addClassName(arrow, this._oppositeDirections[where]); + tooltip.appendChild(arrow); + } + + var tooltipLeft = tleft; + var tooltipTop = ttop; + + var toBottom = (tooltipTop + tooltipDims[1]) - maxY; + var toRight = (tooltipLeft + tooltipDims[0]) - maxX; + var toLeft = 0 - tooltipLeft; + var toTop = 0 - tooltipTop; + + if (toBottom > 0) { + if (arrow) { arrow.style.top = (tooltipDims[1] / 2) + toBottom + 'px'; } + tooltipTop -= toBottom; + } else if (toTop > 0) { + if (arrow) { arrow.style.top = (tooltipDims[1] / 2) - toTop + 'px'; } + tooltipTop += toTop; + } else if (toRight > 0) { + if (arrow) { arrow.style.left = (tooltipDims[0] / 2) + toRight + 'px'; } + tooltipLeft -= toRight; + } else if (toLeft > 0) { + if (arrow) { arrow.style.left = (tooltipDims[0] / 2) - toLeft + 'px'; } + tooltipLeft += toLeft; + } + + tooltip.style.left = tooltipLeft + 'px'; + tooltip.style.top = tooltipTop + 'px'; + } + }, + + /** + * Get a value for "where" (left/right/up/down) which doesn't put the + * tooltip off the screen + * + * @method _getWhereValueInsideViewport + * @param where {String} "where" value which was given by the user and we might change + * @param bbox {BoundingBox} A bounding box like what you get from getBoundingClientRect ({top, bottom, left, right}) with pixel positions from the top left corner of the viewport. + * @param viewport {BoundingBox} Bounding box for the viewport. "top" and "left" are omitted because these coordinates are relative to the top-left corner of the viewport so they are zero. + * + * @TODO: we can't use getBoundingClientRect in this case because it returns {0,0,0,0} on our uncreated tooltip. + */ + _getWhereValueInsideViewport: function (where, bbox, viewport) { + if (where === 'left' && bbox.left < 0) { + return 'right'; + } else if (where === 'right' && bbox.right > viewport.right) { + return 'left'; + } else if (where === 'up' && bbox.top < 0) { + return 'down'; + } else if (where === 'down' && bbox.bottom > viewport.bottom) { + return 'up'; + } + + return where; + }, + _removeTooltip: function() { + var tooltip = this.tooltip; + if (!tooltip) {return;} + + var remove = Ink.bind(InkElement.remove, {}, tooltip); + + if (this._getOpt('where') !== 'mousemove' && transitionDurationName) { + tooltip.style.opacity = 0; + // remove() will operate on correct tooltip, although this.tooltip === null then + setTimeout(remove, this._getFloatOpt('fade') * 1000); + } else { + remove(); + } + this.tooltip = null; + }, + _getOpt: function (option) { + var dataAttrVal = InkElement.data(this.element)[InkElement._camelCase('tip-' + option)]; + if (dataAttrVal /* either null or "" may signify the absense of this attribute*/) { + return dataAttrVal; + } + var instanceOption = this.root.options[option]; + if (typeof instanceOption !== 'undefined') { + return instanceOption; + } + }, + _getIntOpt: function (option) { + return parseInt(this._getOpt(option), 10); + }, + _getFloatOpt: function (option) { + return parseFloat(this._getOpt(option), 10); + }, + _destroy: function () { + if (this.tooltip) { + InkElement.remove(this.tooltip); + } + this.root = null; // Cyclic reference = memory leaks + this.element = null; + this.tooltip = null; + }, + _onMouseOver: function(e) { + // on IE < 10 you can't access the mouse event not even a tick after it fired + var mousePosition = this._getMousePosition(e); + var delay = this._getFloatOpt('delay'); + if (delay) { + this._delayTimeout = setTimeout(Ink.bind(function () { + if (!this.tooltip) { + this._makeTooltip(mousePosition); + } + this._delayTimeout = null; + }, this), delay * 1000); + } else { + this._makeTooltip(mousePosition); + } + }, + _onMouseMove: function(e) { + if (this._getOpt('where') === 'mousemove' && this.tooltip) { + var mPos = this._getMousePosition(e); + this._setPos(mPos[0], mPos[1]); + } + }, + _onMouseOut: function () { + if (!this._getIntOpt('forever')) { + this._removeTooltip(); + } + if (this._delayTimeout) { + clearTimeout(this._delayTimeout); + this._delayTimeout = null; + } + }, + _onTooltipMouseOver: function () { + if (this.tooltip) { // If tooltip is already being removed, this has no effect + this._removeTooltip(); + } + }, + _setPos: function(left, top) { + left += this._getIntOpt('left'); + top += this._getIntOpt('top'); + var pageDims = this._getPageXY(); + if (this.tooltip) { + var elmDims = [InkElement.elementWidth(this.tooltip), InkElement.elementHeight(this.tooltip)]; + var scrollDim = this._getScroll(); + + if((elmDims[0] + left - scrollDim[0]) >= (pageDims[0] - 20)) { + left = (left - elmDims[0] - this._getIntOpt('left') - 10); + } + if((elmDims[1] + top - scrollDim[1]) >= (pageDims[1] - 20)) { + top = (top - elmDims[1] - this._getIntOpt('top') - 10); + } + + this.tooltip.style.left = left + 'px'; + this.tooltip.style.top = top + 'px'; + } + }, + _getPageXY: function() { + var cWidth = 0; + var cHeight = 0; + if( typeof( window.innerWidth ) === 'number' ) { + cWidth = window.innerWidth; + cHeight = window.innerHeight; + } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { + cWidth = document.documentElement.clientWidth; + cHeight = document.documentElement.clientHeight; + } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { + cWidth = document.body.clientWidth; + cHeight = document.body.clientHeight; + } + return [parseInt(cWidth, 10), parseInt(cHeight, 10)]; + }, + _getScroll: function() { + var dd = document.documentElement, db = document.body; + if (dd && (dd.scrollLeft || dd.scrollTop)) { + return [dd.scrollLeft, dd.scrollTop]; + } else if (db) { + return [db.scrollLeft, db.scrollTop]; + } else { + return [0, 0]; + } + }, + _getMousePosition: function(e) { + return [parseInt(InkEvent.pointerX(e), 10), parseInt(InkEvent.pointerY(e), 10)]; + } + }; + + return Tooltip; +}); + +/** + * Elements in a tree structure + * @module Ink.UI.TreeView_1 + * @version 1 + */ +Ink.createModule('Ink.UI.TreeView', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, Event, Css, Element, Selector, InkArray ) { + 'use strict'; + + + /** + * Shows elements in a tree structure which can be expanded and contracted. + * A TreeView is built with "node"s and "children". "node"s are `li` tags, and "children" are `ul` tags. + * You can build your TreeView out of a regular UL and LI element structure which you already use to display lists with several levels. + * If you want a node to be open when the TreeView is built, just add the data-open="true" attribute to it. + * + * @class Ink.UI.TreeView + * @constructor + * @version 1 + * @param {String|DOMElement} selector Element or selector. + * @param {String} [options] Options object, containing: + * @param {String} [options.node] Selector for the nodes. Defaults to 'li'. + * @param {String} [options.children] Selector for the children. Defaults to 'ul'. + * @param {String} [options.parentClass] CSS classes to be added to parent nodes. Defaults to 'parent'. + * @param {String} [options.openClass] CSS classes to be added to the icon when a parent is open. Defaults to 'fa fa-minus-circle'. + * @param {String} [options.closedClass] CSS classes to be added to the icon when a parent is closed. Defaults to 'fa fa-plus-circle'. + * @param {String} [options.hideClass] CSS Class to toggle visibility of the children. Defaults to 'hide-all'. + * @param {String} [options.iconTag] The name of icon tag. The component tries to find a tag with that name as a direct child of the node. If it doesn't find it, it creates it. Defaults to 'i'. + * @param {Boolean} [options.stopDefault] Flag to stops the default behavior of the click handler. Defaults to true. + * @example + * + * + * + * @sample Ink_UI_TreeView_1.html + */ + function TreeView() { + Common.BaseUIComponent.apply(this, arguments); + } + + TreeView._name = 'TreeView_1'; + + TreeView._optionDefinition = { + 'node': ['String', 'li'], + // [3.0.1] Deprecate this terrible, terrible name + 'child': ['String',null], + 'children': ['String','ul'], + 'parentClass': ['String','parent'], + 'openNodeClass': ['String', 'open'], + 'openClass': ['String','fa fa-minus-circle'], + 'closedClass': ['String','fa fa-plus-circle'], + 'hideClass': ['String','hide-all'], + 'iconTag': ['String', 'i'], + 'stopDefault' : ['Boolean', true] + }; + + TreeView.prototype = { + /** + * Init function called by the constructor. Sets the necessary event handlers. + * + * @method _init + * @private + */ + _init: function(){ + if (this._options.child) { + Ink.warn('Ink.UI.TreeView: options.child is being renamed to options.children.'); + this._options.children = this._options.child; + } + + this._handlers = { + click: Ink.bindEvent(this._onClick,this) + }; + + Event.on(this._element, 'click', this._options.node, this._handlers.click); + + InkArray.each(Ink.ss(this._options.node, this._element), Ink.bind(function(item){ + if( this.isParent(item) ) { + Css.addClassName(item, this._options.parentClass); + + var isOpen = this.isOpen(item); + if( !this._getIcon(item) ){ + Element.create(this._options.iconTag, { insertTop: item }); + } + + this._setNodeOpen(item, isOpen); + } + },this)); + }, + + _getIcon: function (node) { + return Ink.s('> ' + this._options.iconTag, node); + }, + + /** + * Checks if a node is open. + * + * @method isOpen + * @param {DOMElement} node The tree node to check + **/ + isOpen: function (node) { + if (!this._getChild(node)) { + throw new Error('not a node!'); + } + + return Element.data(node).open === 'true' || + Css.hasClassName(node, this._options.openNodeClass); + }, + + /** + * Checks if a node is a parent. + * + * @method isParent + * @param {DOMElement} node Node to check + **/ + isParent: function (node) { + return Css.hasClassName(node, this._options.parentClass) || + this._getChild(node) != null; + }, + + _setNodeOpen: function (node, beOpen) { + var child = this._getChild(node); + if (child) { + Css.setClassName(child, this._options.hideClass, !beOpen); + var icon = this._getIcon(node); + + node.setAttribute('data-open', beOpen); + + /* + * Don't refactor this to + * + * setClassName(el, className, status); setClassName(el, className, !status); + * + * because it won't work with multiple classes. + * + * Doing: + * setClassName(el, 'fa fa-whatever', true);setClassName(el, 'fa fa-whatever-else', false); + * + * will remove 'fa' although it is a class we want. + */ + + var toAdd = beOpen ? this._options.openClass : this._options.closedClass; + var toRemove = beOpen ? this._options.closedClass : this._options.openClass; + Css.removeClassName(icon, toRemove); + Css.addClassName(icon, toAdd); + + Css.setClassName(node, this._options.openNodeClass, beOpen); + } else { + Ink.error('Ink.UI.TreeView: node', node, 'is not a node!'); + } + }, + + /** + * Opens one of the tree nodes + * + * Make sure you pass the node's DOMElement + * @method open + * @param {DOMElement} node The node you wish to open. + **/ + open: function (node) { + this._setNodeOpen(node, true); + }, + + /** + * Closes one of the tree nodes + * + * Make sure you pass the node's DOMElement + * @method close + * @param {DOMElement} node The node you wish to close. + **/ + close: function (node) { + this._setNodeOpen(node, false); + }, + + /** + * Toggles a node state + * + * @method toggle + * @param {DOMElement} node The node to toggle. + **/ + toggle: function (node) { + if (this.isOpen(node)) { + this.close(node); + } else { + this.open(node); + } + }, + + _getChild: function (node) { + return Selector.select(this._options.children, node)[0] || null; + }, + + /** + * Handles the click event (as specified in the _init function). + * + * @method _onClick + * @param {Event} event + * @private + */ + _onClick: function(ev){ + /** + * Summary: + * If the clicked element is a "node" as defined in the options, will check if it has any "child". + * If so, will toggle its state and stop the event's default behavior if the stopDefault option is true. + **/ + + if (!this.isParent(ev.currentTarget) || + Selector.matchesSelector(ev.target, this._options.node) || + Selector.matchesSelector(ev.target, this._options.children)) { + return; + } + + if (this._options.stopDefault){ + ev.preventDefault(); + } + + this.toggle(ev.currentTarget); + } + }; + + Common.createUIComponent(TreeView); + + return TreeView; +}); + +Ink.createModule('Ink.UI.Upload', '1', [ + 'Ink.Dom.Event_1', + 'Ink.Dom.Element_1', + 'Ink.Dom.Browser_1', + 'Ink.UI.Common_1' +], function(Event, Element, Browser, Common) { + 'use strict'; + + var DirectoryReader = function(options) { + this.init(options); + }; + + DirectoryReader.prototype = { + init: function(options) { + this._options = Ink.extendObj({ + entry: undefined, + maxDepth: 10 + }, options || {}); + + try { + this._read(); + } catch(e) { + Ink.error(e); + } + }, + + + _read: function() { + if(!this._options.entry) { + Ink.error('You must specify the entry!'); + return; + } + + try { + this._readDirectories(); + } catch(e) { + Ink.error(e); + } + }, + + + _readDirectories: function() { + var entries = [], + running = false, + maxDepth = 0; + + /* TODO return as tree because much better well */ + var _readEntries = Ink.bind(function(currentEntry) { + var dir = currentEntry.createReader(); + running = true; + + dir.readEntries(Ink.bind(function(res) { + if(res.length > 0) { + for(var i = 0, len = res.length; i=0; i--) { + if(typeof(arr[i]) === 'undefined' || arr[i] === null || arr[i] === '') { + arr.splice(i, 1); + } + } + return arr; + } + }; + + var Queue = { + lists: [], + items: [], + + + /** + * Create new queue list + * @function create + * @public + * @param {String} list name + * @param {Function} function to iterate on items + * @return {Object} list id + */ + create: function(name) { + var id; + name = String(name); + this.lists.push({name: name}); + id = this.lists.length - 1; + return id; + }, + + + getItems: function(parentId) { + if(!parentId) { + return this.items; + } + var items = []; + for(var i = 0, len = this.items.length; i=0; i--) { + if(this.items[i] && id === this.items[i].parentId) { + this.remove(this.items[i].parentId, this.items[i].pid); + } + } + if(!keepList) { + this.lists.splice(id, 1); + } + return true; + } catch(e) { + Ink.error('Purge: invalid id'); + return false; + } + }, + + + /** + * add an item to a list + * @function add + * @public + * @param {String} name + * @param {Object} item + * @return {Number} pid + */ + add: function(parentId, item, priority) { + if(!this.lists[parentId]) { + return false; + } + if(typeof(item) !== 'object') { + item = String(item); + } + + var pid = parseInt(Math.round(Math.random() * 100000) + "" + Math.round(Math.random() * 100000), 10); + priority = priority || 0; + + this.items.push({parentId: parentId, item: item, priority: priority || 0, pid: pid}); + return pid; + }, + + + /** + * View list + * @function view + * @public + * @param {Number} list id + * @param {Number} process id + * @return {Object} item + */ + view: function(parentId, pid) { + var id = this._searchByPid(parentId, pid); + if(id === false) { + return false; + } + return this.items[id]; + }, + + + /** + * Remove an item + * @function remove + * @public + * @param {Object} item + * @return {Object|Boolean} removed item or false if not found + */ + remove: function(parentId, pid) { + try { + var id = this._searchByPid(parentId, pid); + if(id === false) { + return false; + } + this.items.splice(id, 1); + return true; + } catch(e) { + Ink.error('Remove: invalid id'); + return false; + } + }, + + _searchByPid: function(parentId, pid) { + if(!parentId && typeof(parentId) === 'boolean' || !pid) { + return false; + } + + parentId = parseInt(parentId, 10); + pid = parseInt(pid, 10); + + if(isNaN(parentId) || isNaN(pid)) { + return false; + } + + for(var i = 0, len = this.items.length; i this._options.minSizeToUseChunks; + }, + + + _dropEventHandler: function(ev) { + Event.stop(ev); + + this.publish('DropComplete', ev.dataTransfer); + + var data = ev.dataTransfer; + + if(!data || !data.files || !data.files.length) { + return false; + } + + this._files = data.files; + this._files = Array.prototype.slice.call(this._files || [], 0); + + // check if webkitGetAsEntry exists on first item + if(data.items && data.items[0] && data.items[0].webkitGetAsEntry) { + if(!this._options.foldersEnabled) { + return setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0); + } + var entry, folders = []; + for(var i = ev.dataTransfer.items.length-1; i>=0; i--) { + entry = ev.dataTransfer.items[i].webkitGetAsEntry(); + if(entry && entry.isDirectory) { + folders.push(entry); + this._files[i].isDirectory = true; + this._files.splice(i, 1); + } + } + // starting callback hell + this._addFolderToQueue(folders, Ink.bind(function() { + setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0); + }, this)); + } else { + setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0); + } + + return true; + }, + + + _addFolderToQueue: function(folders, cb) { + var files = [], invalidFolders = {}; + + if(!folders || !folders.length) { + cb(); + return files; + } + + var getFiles = function(entries) { + var files = []; + for(var i = 0, len = entries.length; i this._options.maxFilesize) { + this.publish('MaxSizeFailure', file, this._options.maxFilesize); + continue; + } + + fileID = parseInt(Math.round(Math.random() * 100000) + "" + Math.round(Math.random() * 100000), 10); + o = { id: i, data: file, fileID: fileID, directory: file.isDirectory }; + Queue.add(this._queueId, o); + + this.publish('FileAddedToQueue', o); + } + this._processQueue(true); + this._files = []; + }, + + + _processQueue: function(internalUpload) { + if(this._queueRunning) { + return false; + } + + this.running = 0; + var max = 1, i = 0, items, + queueLen = Queue.items.length; + this._queueRunning = true; + + this.interval = setInterval(Ink.bind(function() { + if(Queue.items.length === i && this.running === 0) { + Queue.purge(this._queueId, true); + this._queueRunning = false; + clearInterval(this.interval); + this.publish('QueueEnd', this._queueId, queueLen); + } + + items = Queue.getItems(this._queueId); + + if(this.running < max && items[i]) { + if(!items[i].canceled) { + _doRequest.call(this, items[i].pid, items[i].item.data, items[i].item.fileID, items[i].item.directory, internalUpload); + this.running++; + i++; + } else { + var j = i; + while(items[j] && items[j].canceled) { + i++; + j++; + } + } + return true; + } + return false; + }, this), 100); + + + var _doRequest = function(pid, data, fileID, directory, internalUpload) { + var o = { + file: data, + fileID: fileID, + cb: Ink.bind(function() { + this.running--; + }, this) + }; + if(internalUpload) { + if(directory) { + // do magic + o.cb(); + } else { + this._upload(o); + } + } + }; + + return true; + }, + + + _upload: function(o) { + var file = o.file, + xhr = new XMLHttpRequest(), + fileID = o.fileID; + + this.publish('BeforeUpload', file, this._options.extraData, fileID, xhr, this._supportChunks(file.size)); + + var forceAbort = function(showError) { + if(o.cb && typeof(o.cb === 'function')) { + o.cb(); + } + + this.publish('OnProgress', { + length: file.size, + lengthComputable: true, + loaded: file.size, + total: file.size + }, file, fileID); + this.publish('EndUpload', file, fileID, (showError ? { error: true } : true)); + this.publish('InvalidFile', file, 'name'); + xhr.abort(); + }; + + if(this._options.INVALID_FILE_NAME && this._options.INVALID_FILE_NAME instanceof RegExp) { + if(this._options.INVALID_FILE_NAME.test(o.file.name)) { + forceAbort.call(this); + return; + } + } + + // If file was renamed, abort it + // FU OPERA: Opera always return lastModified date as null + if(!file.lastModifiedDate && !Ink.Dom.Browser.OPERA) { + forceAbort.call(this, true); + return; + } + + xhr.upload.onprogress = Ink.bind(this.publish, this, 'OnProgress', file, fileID); + + var endpoint, method; + if(this._supportChunks(file.size)) { + if(file.size <= file.chunk_offset) { + endpoint = this._options.endpointChunkCommit; + method = 'POST'; + } else { + endpoint = this._options.endpointChunk; + if(file.chunk_upload_id) { + endpoint += '?upload_id=' + file.chunk_upload_id; + } + if(file.chunk_offset) { + endpoint += '&offset=' + file.chunk_offset; + } + method = 'PUT'; + } + } else { + endpoint = this._options.endpoint; + method = 'POST'; + } + + xhr.open(method, endpoint, true); + xhr.withCredentials = true; + xhr.setRequestHeader("x-requested-with", "XMLHttpRequest"); + if(this._supportChunks(file.size)) { + xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + } + + var fd = new FormData(), + blob; + + if("Blob" in window && typeof Blob === 'function') { + blob = new Blob([file], { type: file.type }); + if(this._supportChunks(file.size)) { + file.chunk_offset = file.chunk_offset || 0; + blob = blob.slice(file.chunk_offset, file.chunk_offset + this._options.chunkSize); + } else { + fd.append(this._options.fileFormName, blob, file.name); + } + } else { + fd.append(this._options.fileFormName, file); + } + + if(!this._supportChunks(file.size)) { + for(var k in this._options.extraData) { + if(this._options.extraData.hasOwnProperty(k)) { + fd.append(k, this._options.extraData[k]); + } + } + } else { + fd.append('upload_id', file.chunk_upload_id); + fd.append('path', file.upload_path); + } + + if(!file.hasParent) { + if(!this._supportChunks(file.size)) { + xhr.send(fd); + } else { + if(file.size <= file.chunk_offset) { + xhr.send('upload_id=' + file.chunk_upload_id + '&path=' + file.upload_path + '/' + file.name); + } else { + xhr.send(blob); + } + } + } else { + this.publish('cbCreateFolder', file.parentID, file.fullPath, this._options.extraData, this._folders, file.rootPath, Ink.bind(function() { + if(!this._supportChunks(file.size)) { + xhr.send(fd); + } else { + if(file.size <= file.chunk_offset) { + xhr.send('upload_id=' + file.chunk_upload_id + '&path=' + file.upload_path + '/' + file.name); + } else { + xhr.send(blob); + } + } + }, this)); + } + + + xhr.onload = Ink.bindEvent(function() { + /* jshint boss:true */ + if(this._supportChunks(file.size) && file.size > file.chunk_offset) { + if(xhr.response) { + var response = JSON.parse(xhr.response); + + // check expected offset + var invalidOffset = file.chunk_offset && response.offset !== (file.chunk_offset + this._options.chunkSize) && file.size !== response.offset; + if(invalidOffset) { + if(o.cb) { + o.cb(); + } + this.publish('ErrorUpload', file, fileID); + } else { + file.chunk_upload_id = response.upload_id; + file.chunk_offset = response.offset; + file.chunk_expires = response.expires; + this._upload(o); + } + } else { + if(o.cb) { + o.cb(); + } + this.publish('ErrorUpload', file, fileID); + } + return (xhr = null); + } + + if(o.cb) { + o.cb(); + } + + if(xhr.responseText && xhr['status'] < 400) { + this.publish('EndUpload', file, fileID, xhr.responseText); + } else { + this.publish('ErrorUpload', file, fileID); + } + return (xhr = null); + }, this); + + + xhr.onerror = Ink.bindEvent(function() { + if(o.cb) { + o.cb(); + } + this.publish('ErrorUpload', file, fileID); + }, this); + + xhr.onabort = Ink.bindEvent(function() { + if(o.cb) { + o.cb(); + } + this.publish('AbortUpload', file, fileID, { + abortAll: Ink.bind(this.abortAll, this), + abortOne: Ink.bind(this.abortOne, this) + }); + }, this); + }, + + + abortAll: function() { + if(!this._queueRunning) { + return false; + } + clearInterval(this.interval); + this._queueRunning = false; + Queue.purge(this._queueId, true); + return true; + }, + + abortOne: function(id, cb) { + var items = Queue.getItems(0), + o; + for(var i = 0, len = items.length; ic;c++)b("position","absolute"),b(this._isY?"top":"left",c*this._elLength+"px")},_onTouchStart:function(a){if(!(a.touches.length>1)){this._swipeData={x:b.pointerX(a),y:b.pointerY(a)};var c=this._ulEl.getBoundingClientRect();this._swipeData.firstUlPos=c[this._isY?"top":"left"],this._swipeData.inUlX=this._swipeData.x-c.left,this._swipeData.inUlY=this._swipeData.y-c.top,i(this._ulEl,"none"),this._touchMoveIsFirstTouchMove=!0}},_onTouchMove:function(a){if(!(a.touches.length>1)){var c=b.pointerX(a),d=b.pointerY(a),e=Math.abs(d-this._swipeData.y),f=Math.abs(c-this._swipeData.x);this._touchMoveIsFirstTouchMove&&(this._touchMoveIsFirstTouchMove=void 0,this._scrolling=this._isY?f>e:e>f,this._scrolling||this._onAnimationFrame()),!this._scrolling&&this._swipeData&&(b.stopDefault(a),this._swipeData.pointerPos=this._isY?d:c)}},_onAnimationFrame:function(){var a=this._swipeData;if(a&&!this._scrolling&&!this._touchMoveIsFirstTouchMove){var b=this._element.getBoundingClientRect(),c;c=this._isY?a.pointerPos-a.inUlY-b.top:a.pointerPos-a.inUlX-b.left,this._ulEl.style[this._isY?"top":"left"]=c+"px",j(Ink.bindMethod(this,"_onAnimationFrame"))}},_onTouchEnd:function(a){if(this._swipeData&&this._swipeData.pointerPos&&!this._scrolling&&!this._touchMoveIsFirstTouchMove){var c=.1,d=this._swipeData.firstUlPos-this._ulEl.getBoundingClientRect()[this._isY?"top":"left"],e=this.getPage(),f=d/this._elLength/this._slidesPerPage;Math.abs(f)>c&&(e+=Math[0>d?"floor":"ceil"](f)),isNaN(e)||this.setPage(e),b.stopDefault(a)}i(this._ulEl,null),this._swipeData=null,this._touchMoveIsFirstTouchMove=void 0,this._scrolling=void 0},_onPaginationChange:function(a){this._setPage(a.getCurrent())},getPage:function(){return this._pagination?this._pagination.getCurrent():this._currentPage||0},setPage:function(a,b){b&&(a%=this._numPages,0>a&&(a=this._numPages-a)),a=g(a,0,this._numPages-1),this._pagination?this._pagination.setCurrent(a):this._setPage(a)},_setPage:function(a){var b=a*this._deltaLength,c=a===this._numPages-1;if(!this._options.spaceAfterLastSlide&&c&&a>0){var d=this._liEls.length-a*this._slidesPerPage;d2)&&r('the "defaults" argument must be an object mapping option names to [typestring, optional] arrays.'),k=a in h?n._coerce_from_string(m,h[a],a,b):i,k!==i?n._options_validate(k,m)?k:(s("("+a+" option) Invalid "+m+" "+q(k)),o):a in d?d[a]:o!==i?o:void r("Option "+a+" is required!")}"string"!=typeof b&&(e=d,d=c,c=b,b=""),d=d||{};var g={},h=e?a.data(e):{},k,l,m,o,p=function(a){return b&&(a=b+': "'+(""+a).replace(/"/,'\\"')+'"'),a},q=function(a){return'"'+(""+a).replace(/"/,'\\"')+'"'},r=function(a){throw new Error(p(a))},s=function(a){Ink.error(p(a)+". Ignoring option.")};for(var t in c)c.hasOwnProperty(t)&&(g[t]=f(t));return g},_coerce_from_string:function(a,b,c,d){return a in n._coerce_funcs?n._coerce_funcs[a](b,c,d):b},_options_validate:function(a,b){return b in n._options_validate_types?n._options_validate_types[b].call(n,a):!1},_coerce_funcs:function(){var a={element:function(a){return n.elOrSelector(a,"")},elements:function(a){return n.elsOrSelector(a,"",!1)},object:function(a){return a},number:function(a){return parseFloat(a)},"boolean":function(a){return!("false"===a||""===a||null===a)},string:function(a){return a},"function":function(a,b,c){return Ink.error(c+': You cannot specify the option "'+b+"\" through data-attributes because it's a function"),i}};return a["float"]=a.integer=a.number,a}(),_options_validate_types:function(){var a={string:function(a){return"string"==typeof a},number:function(a){return"number"==typeof a&&!isNaN(a)&&isFinite(a)},integer:function(a){return a===Math.round(a)},element:function(a){return n.isDOMElement(a)},elements:function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&a.length},"boolean":function(a){return"boolean"==typeof a},object:function(){return!0}};return a["float"]=a.number,a}(),clone:function(a){try{return JSON.parse(JSON.stringify(a))}catch(b){throw new Error("Given object cannot have loops!")}},childIndex:function(a){if(n.isDOMElement(a))for(var b=d.select("> *",a.parentNode),c=0,e=b.length;e>c;++c)if(b[c]===a)return c;throw"not found!"},ajaxJSON:function(a,c,d){new b(a,{evalJS:"force",method:"POST",parameters:c,onSuccess:function(a){try{if(a=a.responseJSON,"ok"!==a.status)throw"server error: "+a.message;d(null,a)}catch(b){d(b)}},onFailure:function(){d("communication failure")}})},currentLayout:function(){var a,b,e,f,g,h=d.select("#ink-layout-detector")[0];if(!h){h=document.createElement("div"),h.id="ink-layout-detector";for(e in this.Layouts)this.Layouts.hasOwnProperty(e)&&(f=this.Layouts[e],g=document.createElement("div"),g.className="show-"+f+" hide-all",g.setAttribute("data-ink-layout",f),h.appendChild(g));document.body.appendChild(h)}for(a=0,b=h.children.length;b>a;++a)if(g=h.children[a],"block"===c.getStyle(g,"display"))return g.getAttribute("data-ink-layout");return"large"},hashSet:function(a){if("object"!=typeof a)throw new TypeError("o should be an object!");var b=e.getAnchorString();b=Ink.extendObj(b,a),window.location.hash=e.genQueryString("",b).substring(1)},cleanChildren:function(a){if(!n.isDOMElement(a))throw"Please provide a valid DOMElement";for(var b,c=a.lastChild;c;)b=c.previousSibling,a.removeChild(c),c=b},storeIdAndClasses:function(a,b){if(!n.isDOMElement(a))throw"Please provide a valid DOMElement as first parameter";var c=a.id;c&&(b._id=c);var d=a.className;d&&(b._classes=d)},restoreIdAndClasses:function(a,b){if(!n.isDOMElement(a))throw"Please provide a valid DOMElement as first parameter";b._id&&a.id!==b._id&&(a.id=b._id),b._classes&&-1===a.className.indexOf(b._classes)&&(a.className?a.className+=" "+b._classes:a.className=b._classes),b._instanceId&&!a.getAttribute("data-instance")&&a.setAttribute("data-instance",b._instanceId)},_warnDoubleInstantiation:function(a,b){function c(a){return(a.constructor&&a.constructor._name||a._name||"").replace(/_.*?$/,"")}var d=n.getInstance(a);if(""!==c(b)&&d){var e=c(b);if(e){for(var f=0,g=d.length;g>f;f++)if(e===c(d[f]))return Ink.warn("Creating more than one "+e+".","(Was creating a "+e+" on:",a,")."),!1;return!0}}},registerInstance:function(a,b){if(a){if(!n.isDOMElement(b))throw new TypeError("Ink.UI.Common.registerInstance: The element passed in is not a DOM element!");if(n._warnDoubleInstantiation(b,a)===!1)return!1;var c=m.get(b);return c||(c=[],m.set(b,c)),c.push(a),!0}},unregisterInstance:function(a){if(a&&a._element)for(var b=m.get(a._element),c=0,d=b.length;d>c;c++)b[c]===a&&b.splice(c,1)},getInstance:function(a,b){a=n.elOrSelector(a);var c=m.get(a);if(c||(c=[]),"function"!=typeof b)return c;for(var d=0,e=c.length;e>d;d++)if(c[d]instanceof b)return c[d];return null},getInstanceFromSelector:function(a){return n.getInstance(n.elOrSelector(a))},getInstanceIds:function(){var a=[];for(var b in l)l.hasOwnProperty(b)&&a.push(b);return a},getInstances:function(){var a=[];for(var b in l)l.hasOwnProperty(b)&&a.push(l[b]);return a},destroyComponent:function(){n.unregisterInstance(this),this._element.parentNode.removeChild(this._element)}};return h._validateInstance=function(a){var b;if("function"!=typeof a._validate)return!0;try{b=a._validate()}catch(c){b=c}return b instanceof Error?(a._validationError=b,!1):!0},h._stubInstance=function(a,b,c){g(b.prototype,a),g(h.prototype,a),Ink.warn(c+" was not correctly created. "+(a._validationError||""))},h.getInstance=function(a){return a=n.elOrSelector(a),n.getInstance(a,this)},Ink.extendObj(h.prototype,{getOption:function(a){return!this.constructor||a in this.constructor._optionDefinition?this._options[a]:void Ink.error('"'+a+'" is not an option for '+this.constructor._name)},setOption:function(a,b){return!this.constructor||a in this.constructor._optionDefinition?void(this._options[a]=b):void Ink.error('"'+a+" is not an option for "+this.constructor._name)},getElement:function(){return this._element}}),n.BaseUIComponent=h,n.createUIComponent=function q(a,b){function c(a,b){if(!a)throw new Error("Ink.UI_1.createUIComponent: "+b)}function d(b,d,e){var f=a[b];c("undefined"!=typeof f,a+" doesn't have a \""+b+'" property. '+e),c(d&&typeof f===d,"typeof "+a+"."+b+' is not "'+d+'". '+e)}a._componentOptions=b||{},c("function"==typeof a,"constructor argument is not a function!"),d("_name","string","This property is used for error messages. Set it to the full module path and version (Ink.My.Module_1)."),d("_optionDefinition","object","This property contains the option names, types and defaults. See Ink.UI.Common.options() for reference.");var e=a.prototype;a.prototype="function"==typeof Object.create?Object.create(h.prototype):function f(){function a(){}return a.prototype=h.prototype,new a}(),Ink.extendObj(a.prototype,e),a.prototype.constructor=a,Ink.extendObj(a,h)},n}),Ink.createModule("Ink.UI.DatePicker","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1","Ink.Util.Date_1","Ink.Dom.Browser_1"],function(a,b,c,d,e,f,g){"use strict";function h(a,b,c){return a>c&&(a=c),b>a&&(a=b),a}function i(a){var b=a.split("-");return j(+b[0],+b[1]-1,+b[2])}function j(a,b,c){return{_year:a,_month:b,_day:c}}function k(a){return{_year:a.getFullYear(),_month:a.getMonth(),_day:a.getDate()}}var l=function(){a.BaseUIComponent.apply(this,arguments)};return l._name="DatePicker_1",l._optionDefinition={autoOpen:["Boolean",!1],cleanText:["String","Clear"],closeText:["String","Close"],pickerField:["Element",null],containerElement:["Element",null],cssClass:["String","ink-calendar bottom"],dateRange:["String",null],displayInSelect:["Boolean",!1],dayField:["Element",null],monthField:["Element",null],yearField:["Element",null],format:["String","yyyy-mm-dd"],nextLinkText:["String","»"],ofText:["String"," of "],onFocus:["Boolean",!0],onMonthSelected:["Function",null],onSetDate:["Function",null],onYearSelected:["Function",null],position:["String","right"],prevLinkText:["String","«"],showClean:["Boolean",!0],showClose:["Boolean",!0],shy:["Boolean",!0],startDate:["String",null],startWeekDay:["Number",1],validDayFn:["Function",null],validMonthFn:["Function",null],validYearFn:["Function",null],nextValidDateFn:["Function",null],prevValidDateFn:["Function",null],yearRange:["String",null],month:["Object",{1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"}],wDay:["Object",{0:"Sunday",1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday"}]},l.prototype={_init:function(){this._options.format=this._dateParsers[this._options.format]||this._options.format,this._hoverPicker=!1,this._picker=this._options.pickerField||null,this._setMinMax(this._options.dateRange||this._options.yearRange),this.setDate(this._options.startDate?this._options.startDate:this._element&&this._element.value?this._element.value:new Date),(this._options.startWeekDay<0||this._options.startWeekDay>6)&&(Ink.warn('Ink.UI.DatePicker_1: option "startWeekDay" must be between 0 (sunday) and 6 (saturday)'),this._options.startWeekDay=h(this._options.startWeekDay,0,6)),Ink.extendObj(this._options,this._lang||{}),this._render(),this._listenToContainerObjectEvents()},_validate:function(){if(this._options.displayInSelect&&!(this._options.dayField&&this._options.monthField&&this._options.yearField))throw new Error("Ink.UI.DatePicker: displayInSelect option enabled.Please specify dayField, monthField and yearField selectors.")},_render:function(){this._containerObject=document.createElement("div"),this._containerObject.className=this._options.cssClass+" ink-datepicker-calendar hide-all",this._renderSuperTopBar();var b=document.createElement("div");b.className="ink-calendar-top",this._monthDescContainer=document.createElement("div"),this._monthDescContainer.className="ink-calendar-month_desc",this._monthPrev=document.createElement("div"),this._monthPrev.className="ink-calendar-prev",this._monthPrev.appendChild(d.create("a",{href:"#prev",className:"change_month_prev",setHTML:this._options.prevLinkText})),this._monthNext=document.createElement("div"),this._monthNext.className="ink-calendar-next",this._monthNext.appendChild(d.create("a",{href:"#next",className:"change_month_next",setHTML:this._options.nextLinkText})),b.appendChild(this._monthPrev),b.appendChild(this._monthDescContainer),b.appendChild(this._monthNext),this._monthContainer=document.createElement("div"),this._monthContainer.className="ink-calendar-month",this._containerObject.appendChild(b),this._containerObject.appendChild(this._monthContainer),this._monthSelector=this._renderMonthSelector(),this._containerObject.appendChild(this._monthSelector),this._yearSelector=document.createElement("ul"),this._yearSelector.className="ink-calendar-year-selector",this._containerObject.appendChild(this._yearSelector),(!this._options.onFocus||this._options.displayInSelect)&&(this._picker=this._options.pickerField?a.elOrSelector(this._options.pickerField,"pickerField"):d.create("a",{href:"#open_cal",setHTML:"open",insertBottom:this._element.parentNode,className:"ink-datepicker-picker-field"})),this._appendDatePickerToDom(),this._renderMonth(),this._monthChanger=d.create("a",{href:"#monthchanger",className:"ink-calendar-link-month",setTextContent:this._options.month[this._month+1]}),this._ofText=d.create("span",{className:"ink-calendar-of-text",setHTML:this._options.ofText}),this._yearChanger=d.create("a",{href:"#yearchanger",className:"ink-calendar-link-year",setTextContent:this._year}),this._monthDescContainer.appendChild(this._monthChanger),this._monthDescContainer.appendChild(this._ofText),this._monthDescContainer.appendChild(this._yearChanger),this._options.inline?this.show():this._addOpenCloseEvents(),this._addDateChangeHandlersToInputs()},_addDateChangeHandlersToInputs:function(){var a=this._element;this._options.displayInSelect&&(a=[this._options.dayField,this._options.monthField,this._options.yearField]),b.observeMulti(a,"change",Ink.bindEvent(function(){this._updateDate(),this._showDefaultView(),this.setDate(),this._inline||this._hoverPicker||this._hide(!0)},this))},show:function(){this._updateDate(),this._renderMonth(),c.removeClassName(this._containerObject,"hide-all")},_addOpenCloseEvents:function(){var a=this._picker||this._element;b.observe(a,"click",Ink.bindEvent(function(a){b.stop(a),this.show()},this)),this._options.autoOpen&&this.show(),this._options.displayInSelect||b.observe(a,"blur",Ink.bindEvent(function(){this._hoverPicker||this._hide(!0)},this)),this._options.shy&&b.observe(document,"click",Ink.bindEvent(function(a){for(var c=b.element(a),e=[this._options.dayField,this._options.monthField,this._options.yearField,this._picker,this._element],f=0,g=e.length;g>f;f++)if(e[f]&&d.descendantOf(e[f],c))return;this._hide(!0)},this))},_renderMonthSelector:function(){var a=document.createElement("ul");a.className="ink-calendar-month-selector";for(var b=document.createElement("ul"),c=1;12>=c;c++)b.appendChild(this._renderMonthButton(c)),c%4===0&&(a.appendChild(b),b=document.createElement("ul"));return a},_renderMonthButton:function(a){var b=document.createElement("li");return b.appendChild(d.create("a",{"data-cal-month":a,setTextContent:this._options.month[a].substring(0,3)})),b},_appendDatePickerToDom:function(){if(this._options.containerElement){var b=a.elOrSelector(this._options.containerElement);b.appendChild(this._containerObject)}var c=e.matchesSelector(this._element.parentNode,".ink-form .control-group .control");c?(this._wrapper=this._element.parentNode,this._wrapperIsControl=!0):(this._wrapper=d.create("div",{className:"ink-datepicker-wrapper"}),d.wrap(this._element,this._wrapper)),d.insertAfter(this._containerObject,this._element)},_renderSuperTopBar:function(){this._options.showClose&&this._options.showClean&&(this._superTopBar=document.createElement("div"),this._superTopBar.className="ink-calendar-top-options",this._options.showClean&&this._superTopBar.appendChild(d.create("a",{className:"clean",setHTML:this._options.cleanText})),this._options.showClose&&this._superTopBar.appendChild(d.create("a",{className:"close",setHTML:this._options.closeText})),this._containerObject.appendChild(this._superTopBar))},_listenToContainerObjectEvents:function(){b.observe(this._containerObject,"mouseover",Ink.bindEvent(function(a){b.stop(a),this._hoverPicker=!0},this)),b.observe(this._containerObject,"mouseout",Ink.bindEvent(function(a){b.stop(a),this._hoverPicker=!1},this)),b.observe(this._containerObject,"click",Ink.bindEvent(this._onClick,this))},_onClick:function(a){var d=b.element(a);return c.hasClassName(d,"ink-calendar-off")?(b.stopDefault(a),null):(b.stop(a),this._onRelativeChangerClick(d),this._onAbsoluteChangerClick(d),c.hasClassName(d,"ink-calendar-link-month")?this._showMonthSelector():c.hasClassName(d,"ink-calendar-link-year")?this._showYearSelector():c.hasClassName(d,"clean")?this._clean():c.hasClassName(d,"close")&&this._hide(!1),void this._updateDescription())},_onRelativeChangerClick:function(a){var b={change_year_next:1,change_year_prev:-1},c={change_month_next:1,change_month_prev:-1};a.className in c?this._updateCal(c[a.className]):a.className in b&&this._showYearSelector(b[a.className])},_onAbsoluteChangerClick:function(a){var b=d.data(a);Number(b.calDay)?(this.setDate(new Date(this._year,this._month,b.calDay)),this._hide()):Number(b.calMonth)?(this._month=Number(b.calMonth)-1,this._showDefaultView(),this._updateCal()):Number(b.calYear)&&this._changeYear(Number(b.calYear))},_changeYear:function(a){a=+a,isNaN(a)||(this._year=a,"function"==typeof this._options.onYearSelected&&this._options.onYearSelected(this,{year:this._year}),this._showMonthSelector())},_clean:function(){this._options.displayInSelect?(this._options.yearField.selectedIndex=0,this._options.monthField.selectedIndex=0,this._options.dayField.selectedIndex=0):this._element.value=""},_hide:function(a){a=void 0===a?!0:a,(a===!1||a&&this._options.shy)&&c.addClassName(this._containerObject,"hide-all")},_setMinMax:function(a){function b(){c._min=d,c._max=e}var c=this,d={_year:-Number.MAX_VALUE,_month:0,_day:1},e={_year:Number.MAX_VALUE,_month:11,_day:31};if(!a)return b();var g=a.split(":"),j=/^(\d{4})((\-)(\d{1,2})((\-)(\d{1,2}))?)?$/;f.each([{name:"_min",date:g[0],noLim:d},{name:"_max",date:g[1],noLim:e}],Ink.bind(function(a){var b=a.noLim;if("NOW"===a.date.toUpperCase()){var c=new Date;b=k(c)}else"EVER"===a.date.toUpperCase()?b=a.noLim:j.test(a.date)&&(b=i(a.date),b._month=h(b._month,0,11),b._day=h(b._day,1,this._daysInMonth(b._year,b._month+1)));this[a.name]=b},this));var l=-1!==this._dateCmp(this._max,this._min);l||b()},_fitDateToRange:function(a){return this._isValidDate(a)||(a=k(new Date)),-1===this._dateCmp(a,this._min)?Ink.extendObj({},this._min):1===this._dateCmp(a,this._max)?Ink.extendObj({},this._max):Ink.extendObj({},a)},_dateWithinRange:function(a){return arguments.length||(a=this),!this._dateAboveMax(a)&&!this._dateBelowMin(a)},_dateAboveMax:function(a){return 1===this._dateCmp(a,this._max)},_dateBelowMin:function(a){return-1===this._dateCmp(a,this._min)},_dateCmp:function(a,b){return this._dateCmpUntil(a,b,"_day")},_dateCmpUntil:function(a,b,c){var d=["_year","_month","_day"],e=-1;do{if(e++,a[d[e]]>b[d[e]])return 1;if(a[d[e]]this._min._year){var f=d.create("li");f.appendChild(d.create("a",{href:"#year_prev",className:"change_year_prev",setHTML:this._options.prevLinkText})),e.appendChild(f)}else e.appendChild(d.create("li",{setHTML:" "}));for(var g=1;11>g;g++)g%4===0&&(e=d.create("ul"),this._yearSelector.appendChild(e)),c=b+g-1,e.appendChild(this._getYearButton(c));if(cthis._max._year||b+9=1&&+a._month+1<=12&&+a._day>=1&&+a._day<=this._daysInMonth(a._year,a._month+1)},_isDate:function(a,b){try{if("undefined"==typeof a)return!1;var c=g.set(a,b);if(c&&this._isValidDate(k(c)))return!0}catch(d){}return!1},_acceptableDay:function(a){return this._acceptableDateComponent(a,"validDayFn")},_acceptableMonth:function(a){return this._acceptableDateComponent(a,"validMonthFn")},_acceptableYear:function(a){return this._acceptableDateComponent(a,"validYearFn")},_acceptableDateComponent:function(a,b){return this._options[b]?this._callUserCallbackBool(this._options[b],a):this._dateWithinRange(a)},_writeDateInFormat:function(){return g.get(this._options.format,this.getDate())},setDate:function(a){if(a&&"function"==typeof a.getDate&&(a=[a.getFullYear(),a.getMonth()+1,a.getDate()].join("-")),/\d{4}-\d{1,2}-\d{1,2}/.test(a)){var b=a.split("-");this._year=+b[0],this._month=+b[1]-1,this._day=+b[2]}this._setDate()},getDate:function(){if(!this._day)throw"Ink.UI.DatePicker: Still picking a date. Cannot getDate now!";return new Date(this._year,this._month,this._day)},_setDate:function(a){if(a){var b=d.data(a);this._day=+b.calDay||this._day}var c=this._fitDateToRange(this);this._year=c._year,this._month=c._month,this._day=c._day,this._options.displayInSelect?(this._options.dayField.value=this._day,this._options.monthField.value=this._month+1,this._options.yearField.value=this._year):this._element.value=this._writeDateInFormat(),this._options.onSetDate&&this._options.onSetDate(this,{date:this.getDate()})},_updateCal:function(a){"function"==typeof this._options.onMonthSelected&&this._options.onMonthSelected(this,{year:this._year,month:this._month}),a&&null===this._updateMonth(a)||this._renderMonth()},_daysInMonth:function(a,b){var c={2:a%400===0||a%4===0&&a%100!==0?29:28,4:30,6:30,9:30,11:30};return c[b]||31},_updateMonth:function(a){var b;return a>0?b=this._getNextMonth():0>a&&(b=this._getPrevMonth()),b?(this._year=b._year,this._month=b._month,void(this._day=b._day)):null},_getNextMonth:function(a){return this._tryLeap(a,"Month","next",function(a){return a._month+=1,a._month>11&&(a._month=0,a._year+=1),a})},_getPrevMonth:function(a){return this._tryLeap(a,"Month","prev",function(a){return a._month-=1,a._month<0&&(a._month=11,a._year-=1),a})},_getPrevYear:function(a){return this._tryLeap(a,"Year","prev",function(a){return a._year-=1,a})},_getNextYear:function(a){return this._tryLeap(a,"Year","next",function(a){return a._year+=1,a})},_tryLeap:function(a,b,c,d){a=a||{_year:this._year,_month:this._month,_day:this._day};var e="prev"===c?"_min":"_max",f=this[e];if(0===this._dateCmpUntil(a,f,b))return null;var g=this._options[c+"ValidDateFn"];return g?this._callUserCallbackDate(g,a):(a=d(a),a=this._fitDateToRange(a),this["_acceptable"+b](a)?a:null)},_getNextDecade:function(a){a=a||{_year:this._year,_month:this._month,_day:this._day};var b=this._getCurrentDecade(a);return b+10>this._max._year?null:b+10},_getPrevDecade:function(a){a=a||{_year:this._year,_month:this._month,_day:this._day};var b=this._getCurrentDecade(a);return b-10e&&(e+=6),e},_getDayButtons:function(a,b){var c=this._daysInMonth(a,b+1),e=document.createDocumentFragment(),f=d.create("ul");e.appendChild(f);for(var g=this._getFirstDayIndex(a,b),h=0;g>h;h++)f.appendChild(d.create("li",{className:"ink-calendar-empty",setHTML:" "}));for(var i=1;c>=i;i++)(i-1+g)%7===0&&(f=d.create("ul"),e.appendChild(f)),f.appendChild(this._getDayButton(a,b,i));return e},_getDayButton:function(a,b,c){var e={},f=j(a,b,c);this._acceptableDay(f)?(e["data-cal-day"]=c,this._day&&0===this._dateCmp(f,this)&&(e.className="ink-calendar-on")):e.className="ink-calendar-off",e.setTextContent=c;var g=d.create("li");return g.appendChild(d.create("a",e)),g},_getMonthCalendarHeader:function(a){for(var b=d.create("ul",{className:"ink-calendar-header"}),c,e=0;7>e;e++)c=(a+e)%7,b.appendChild(d.create("li",{setTextContent:this._options.wDay[c].substring(0,1)}));return b},_addMonthClassNames:function(a){f.forEach((a||this._monthSelector).getElementsByTagName("a"),Ink.bindMethod(this,"_addMonthButtonClassNames"))},_addMonthButtonClassNames:function(a){var b=d.data(a);if(!b.calMonth)throw"not a calendar month button!";var e=+b.calMonth-1;if(e===this._month)c.addClassName(a,"ink-calendar-on"),c.removeClassName(a,"ink-calendar-off");else{c.removeClassName(a,"ink-calendar-on");var f=!this._acceptableMonth({_year:this._year,_month:e});c.addRemoveClassName(a,"ink-calendar-off",f)}},lang:function(a){this._lang=a},showMonth:function(){this._renderMonth()},isMonthRendered:function(){var a=e.select(".ink-calendar-header",this._containerObject)[0];return"none"!==c.getStyle(a.parentNode,"display")&&"none"!==c.getStyle(a.parentNode.parentNode,"display")},destroy:function(){d.unwrap(this._element),d.remove(this._wrapper),d.remove(this._containerObject),a.unregisterInstance.call(this)}},a.createUIComponent(l),l}),Ink.createModule("Ink.UI.Draggable","1",["Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Browser_1","Ink.Dom.Selector_1","Ink.UI.Common_1"],function(a,b,c,d,e,f){"use strict";function g(a,b,c){return a=Math.min(a,c),a=Math.max(a,b)}function h(){f.BaseUIComponent.apply(this,arguments)}var i=0,j=1;return h._name="Draggable_1",h._optionDefinition={constraint:["String",!1],constraintElm:["Element",!1],top:["Number",!1],right:["Number",!1],bottom:["Number",!1],left:["Number",!1],handle:["Element",!1],revert:["Boolean",!1],cursor:["String","move"],zIndex:["Number",9999],fps:["Number",0],droppableProxy:["Element",!1],mouseAnchor:["String",void 0],dragClass:["String","drag"],skipChildren:["Boolean",!0],onStart:["Function",!1],onEnd:["Function",!1],onDrag:["Function",!1],onChange:["Function",!1]},h.prototype={_init:function(){var a=this._options;this.constraintElm=a.constraintElm&&f.elOrSelector(a.constraintElm),this.handle=!1,this.elmStartPosition=!1,this.active=!1,this.dragged=!1,this.prevCoords=!1,this.placeholder=!1,this.position=!1,this.zindex=!1,this.firstDrag=!0,a.fps&&(this.deltaMs=1e3/a.fps,this.lastRunAt=0),this.handlers={},this.handlers.start=Ink.bindEvent(this._onStart,this),this.handlers.dragFacade=Ink.bindEvent(this._onDragFacade,this),this.handlers.drag=Ink.bindEvent(this._onDrag,this),this.handlers.end=Ink.bindEvent(this._onEnd,this),this.handlers.selectStart=function(a){return b.stop(a),!1},this.handle=this._options.handle?f.elOrSelector(this._options.handle):this._element,this.handle.style.cursor=a.cursor,b.observe(this.handle,"touchstart",this.handlers.start),b.observe(this.handle,"mousedown",this.handlers.start),d.IE&&b.observe(this._element,"selectstart",this.handlers.selectStart)},destroy:function(){b.stopObserving(this.handle,"touchstart",this.handlers.start),b.stopObserving(this.handle,"mousedown",this.handlers.start),d.IE&&b.stopObserving(this._element,"selectstart",this.handlers.selectStart)},_getCoords:function(b){var c=[a.scrollWidth(),a.scrollHeight()];return{x:(b.touches?b.touches[0].clientX:b.clientX)+c[i],y:(b.touches?b.touches[0].clientY:b.clientY)+c[j]}},_cloneStyle:function(b,d){d.className=b.className,d.style.borderWidth="0",d.style.padding="0",d.style.position="absolute",d.style.width=a.elementWidth(b)+"px",d.style.height=a.elementHeight(b)+"px",d.style.left=a.elementLeft(b)+"px",d.style.top=a.elementTop(b)+"px",d.style.cssFloat=c.getStyle(b,"float"),d.style.display=c.getStyle(b,"display")},_onStart:function(d){if(!this.active&&b.isLeftClick(d)||"undefined"==typeof d.button){var e=b.element(d);if(this._options.skipChildren&&e!==this.handle)return;b.stop(d),c.addClassName(this._element,this._options.dragClass),this.elmStartPosition=[a.elementLeft(this._element),a.elementTop(this._element)];var f=[parseInt(c.getStyle(this._element,"left"),10),parseInt(c.getStyle(this._element,"top"),10)],g=a.elementDimensions(this._element);this.originalPosition=[f[i]?f[i]:null,f[j]?f[j]:null],this.delta=this._getCoords(d),this.active=!0,this.position=c.getStyle(this._element,"position"),this.zindex=c.getStyle(this._element,"zIndex");var h=document.createElement("div");if(h.style.position=this.position,h.style.width=g[i]+"px",h.style.height=g[j]+"px",h.style.marginTop=c.getStyle(this._element,"margin-top"),h.style.marginBottom=c.getStyle(this._element,"margin-bottom"),h.style.marginLeft=c.getStyle(this._element,"margin-left"),h.style.marginRight=c.getStyle(this._element,"margin-right"),h.style.borderWidth="0",h.style.padding="0",h.style.cssFloat=c.getStyle(this._element,"float"),h.style.display=c.getStyle(this._element,"display"),h.style.visibility="hidden",this.delta2=[this.delta.x-this.elmStartPosition[i],this.delta.y-this.elmStartPosition[j]],this._options.mouseAnchor){var k=this._options.mouseAnchor.split(" "),l=[g[i],g[j]];"left"===k[0]?l[i]=0:"center"===k[0]&&(l[i]=parseInt(l[i]/2,10)),"top"===k[1]?l[j]=0:"center"===k[1]&&(l[j]=parseInt(l[j]/2,10)),this.applyDelta=[this.delta2[i]-l[i],this.delta2[j]-l[j]]}var m=this._options.fps?"dragFacade":"drag";if(this.placeholder=h,this._options.onStart&&this._options.onStart(this._element,d),this._options.droppableProxy){this.proxy=document.createElement("div"),g=[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight];var n=this.proxy.style;n.width=g[i]+"px",n.height=g[j]+"px",n.position="fixed",n.left="0",n.top="0",n.zIndex=this._options.zindex+1,n.backgroundColor="#FF0000",c.setOpacity(this.proxy,0);for(var o=document.body.firstChild;o&&1!==o.nodeType;)o=o.nextSibling;document.body.insertBefore(this.proxy,o),b.observe(this.proxy,"mousemove",this.handlers[m]),b.observe(this.proxy,"touchmove",this.handlers[m])}else b.observe(document,"mousemove",this.handlers[m]);return this._element.style.position="absolute",this._element.style.zIndex=this._options.zindex,this._element.parentNode.insertBefore(this.placeholder,this._element),this._onDrag(d),b.observe(document,"mouseup",this.handlers.end),b.observe(document,"touchend",this.handlers.end),!1}},_onDragFacade:function(a){var b=+new Date;(!this.lastRunAt||b>this.lastRunAt+this.deltaMs)&&(this.lastRunAt=b,this._onDrag(a))},_onDrag:function(c){if(this.active){b.stop(c),this.dragged=!0;var d=this._getCoords(c),e=d.x,f=d.y,h=this._options,k=!1,l=!1;if(this.prevCoords&&e!==this.prevCoords.x||f!==this.prevCoords.y){h.onDrag&&h.onDrag(this._element,c),this.prevCoords=d,k=this.elmStartPosition[i]+e-this.delta.x,l=this.elmStartPosition[j]+f-this.delta.y;var m=a.elementDimensions(this._element);if(this.constraintElm){var n=a.offset(this.constraintElm),o=a.elementDimensions(this.constraintElm),p=n[j]+(h.top||0),q=n[j]+o[j]-(h.bottom||0),r=n[i]+(h.left||0),s=n[i]+o[i]-(h.right||0);l=g(l,p,q-m[j]),k=g(k,r,s-m[i])}else if(h.constraint){var t=h.right===!1?a.pageWidth()-m[i]:h.right,u=h.left===!1?0:h.left,v=h.top===!1?0:h.top,w=h.bottom===!1?a.pageHeight()-m[j]:h.bottom;("horizontal"===h.constraint||"both"===h.constraint)&&(k=g(k,u,t)),("vertical"===h.constraint||"both"===h.constraint)&&(l=g(l,v,w))}var x=Ink.getModule("Ink.UI.Droppable_1");if(this.firstDrag&&(x&&x.updateAll(),this.firstDrag=!1),k&&(this._element.style.left=k+"px"),l&&(this._element.style.top=l+"px"),x){var y=this._options.mouseAnchor?{x:e-this.applyDelta[i],y:f-this.applyDelta[j]}:d;x.action(y,"drag",c,this._element)}h.onChange&&h.onChange(this)}}},_onEnd:function(d){if(b.stopObserving(document,"mousemove",this.handlers.drag),b.stopObserving(document,"touchmove",this.handlers.drag),this._options.fps&&this._onDrag(d),c.removeClassName(this._element,this._options.dragClass),this.active&&this.dragged){this._options.droppableProxy&&document.body.removeChild(this.proxy),this.pt&&(a.remove(this.pt),this.pt=void 0),this.placeholder&&a.remove(this.placeholder),this._options.revert&&(this._element.style.position=this.position,this._element.style.zIndex=null!==this.zindex?this.zindex:"auto",this._element.style.left=this.originalPosition[i]?this.originalPosition[i]+"px":"",this._element.style.top=this.originalPosition[j]?this.originalPosition[j]+"px":""),this._options.onEnd&&this._options.onEnd(this._element,d);var e=Ink.getModule("Ink.UI.Droppable_1");e&&e.action(this._getCoords(d),"drop",d,this._element),this.position=!1,this.zindex=!1,this.firstDrag=!0}this.active=!1,this.dragged=!1}},f.createUIComponent(h),h}),Ink.createModule("Ink.UI.Drawer","1",["Ink.UI.Common_1","Ink.Dom.Loaded_1","Ink.Dom.Selector_1","Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Css_1"],function(a,b,c,d,e,f){"use strict";function g(a){Ink.warn('Ink.UI.Drawer_1: Could not find the "'+a+'" element on this page. Please make sure it exists.')}function h(b){a.BaseUIComponent.apply(this,[document.body,b])}return h._name="Drawer_1",h._optionDefinition={parentSelector:["String",".ink-drawer"],leftDrawer:["String",".left-drawer"],leftTrigger:["String",".left-drawer-trigger"],rightDrawer:["String",".right-drawer"],rightTrigger:["String",".right-drawer-trigger"],contentDrawer:["String",".content-drawer"],closeOnContentClick:["Boolean",!0],closeOnLinkClick:["Boolean",!0],mode:["String","push"],sides:["String","both"]},h.prototype={_init:function(){if(this._contentDrawers=Ink.ss(this._options.contentDrawer),this._leftDrawer=Ink.s(this._options.leftDrawer),this._leftTriggers=Ink.ss(this._options.leftTrigger),this._rightDrawer=Ink.s(this._options.rightDrawer),this._rightTriggers=Ink.ss(this._options.rightTrigger),f.addClassName(document.body,"ink-drawer"),0===this._contentDrawers.length)throw new Error('Ink.UI.Drawer_1: Could not find any "'+this._options.contentDrawer+'" elements on this page. Please make sure you have at least one.');switch(this._options.sides){case"both":this._triggers=this._options.leftTrigger+", "+this._options.rightTrigger+", "+this._options.contentDrawer;break;case"left":this._triggers=this._options.leftTrigger+", "+this._options.contentDrawer;break;case"right":this._triggers=this._options.rightTrigger+", "+this._options.contentDrawer}"left"===this._options.sides||"both"===this._options.sides?(this._leftDrawer||g(this._options.leftDrawer),0===this._leftTriggers.length&&g(this._options.leftTrigger)):(this._rightDrawer||g(this._options.rightDrawer),0===this._rightTriggers.length&&g(this._options.rightTrigger)),this._isOpen=!1,this._direction=void 0,this._handlers={click:Ink.bindEvent(this._onClick,this),afterTransition:Ink.bindEvent(this._afterTransition,this)},this._delay=10,this._addEvents()},_onClick:function(a){var b=Ink.bind(function(b){this._isOpen?this.close():this.open(b),a.preventDefault()},this);d.findUpwardsBySelector(a.currentTarget,this._options.leftTrigger)?b("left"):d.findUpwardsBySelector(a.currentTarget,this._options.rightTrigger)?b("right"):d.findUpwardsBySelector(a.currentTarget,this._options.contentDrawer)?this._options.closeOnContentClick&&this.close():this._options.closeOnLinkClick&&d.isLink(a.target)&&this.close()},_afterTransition:function(){this._isOpen||("left"===this._direction?f.removeClassName(this._leftDrawer,"show"):f.removeClassName(this._rightDrawer,"show"))},_addEvents:function(){e.on(document.body,"click",this._triggers+', a[href*="#"]',this._handlers.click)},open:function(a){this._isOpen=!0,this._direction=a;var b="left"===a?this._leftDrawer:this._rightDrawer;f.addClassName(b,"show"),setTimeout(Ink.bind(function(){f.addClassName(document.body,[this._options.mode,a])},this),this._delay)},close:function(){this._isOpen!==!1&&(this._isOpen=!1,e.one(document.body,"transitionend oTransitionEnd webkitTransitionEnd",this._handlers.afterTransition),f.removeClassName(document.body,[this._options.mode,this._direction]))}},a.createUIComponent(h),h}),Ink.createModule("Ink.UI.Dropdown","1",["Ink.UI.Common_1","Ink.UI.Toggle_1","Ink.Dom.Event_1","Ink.Dom.Element_1"],function(a,b,c,d){"use strict";function e(){a.BaseUIComponent.apply(this,arguments)}return e._name="Dropdown_1",e._optionDefinition={target:["Element"],hoverOpen:["Number",null],dismissOnInsideClick:["Boolean",!1],dismissOnOutsideClick:["Boolean",!0],dismissAfter:["Number",null],onInsideClick:["Function",null],onOutsideClick:["Function",null],onOpen:["Function",null],onDismiss:["Function",null]},e.prototype={_init:function(){this._toggle=new b(this._element,{target:this._options.target,closeOnInsideClick:null,closeOnClick:!1,onChangeState:Ink.bind(function(a){return this._openOrDismiss(a,!0,!0)},this)}),c.observeMulti([this._options.target,this._element],"mouseout",Ink.bindMethod(this,"_onMouseOut")),c.observeMulti([this._options.target,this._element],"mouseover",Ink.bindMethod(this,"_onMouseOver")),c.observe(this._options.target,"click",Ink.bindMethod(this,"_onInsideClick")),c.observe(document,"click",Ink.bindMethod(this,"_onOutsideClick"))},_onMouseOver:function(){"number"==typeof this._options.hoverOpen&&this._toggle.getState()===!1&&(clearTimeout(this._openTimeout),this._openTimeout=setTimeout(Ink.bindMethod(this,"open",!0),1e3*this._options.hoverOpen)),"number"==typeof this._options.dismissAfter&&clearTimeout(this._dismissTimeout)},_onMouseOut:function(){"number"==typeof this._options.dismissAfter&&this._toggle.getState()===!0&&(clearTimeout(this._dismissTimeout),this._dismissTimeout=setTimeout(Ink.bindMethod(this,"dismiss",!0),1e3*this._options.dismissAfter)),"number"==typeof this._options.hoverOpen&&clearTimeout(this._openTimeout)},_onInsideClick:function(a){var b=this._handlerCall("onInsideClick",c.element(a));b!==!1&&this._options.dismissOnInsideClick&&this.dismiss(!0)},_onOutsideClick:function(a){var b=c.element(a),e=d.findUpwardsHaving(b,Ink.bind(function(a){return a===this._element},this)),f=d.findUpwardsHaving(b,Ink.bind(function(a){return a===this._options.target},this));if(!e&&!f){var g=this._handlerCall("onOutsideClick",b);if(g===!1)return;this._options.dismissOnOutsideClick&&this.dismiss(!0)}},dismiss:function(a,b){this._openOrDismiss(!1,a,b)},open:function(a,b){this._openOrDismiss(!0,a,b)},_openOrDismiss:function(a,b,c){if(!this._toggle||this._toggle.getState()!==a){if(b&&this._handlerCall(a?"onOpen":"onDismiss")===!1)return!1;c||this._toggle.setState(a),clearTimeout(this._dismissTimeout),clearTimeout(this._openTimeout)}},_handlerCall:function(a){return this._options[a]?this._options[a].call(this,[].slice.call(arguments,1)):void 0}},a.createUIComponent(e),e}),Ink.createModule("Ink.UI.Droppable","1",["Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.UI.Common_1","Ink.Util.Array_1","Ink.Dom.Selector_1"],function(a,b,c,d,e,f){"use strict";var g=function(a){return function(b){return c.addClassName(a,b)}},h=function(a){return function(b){return c.removeClassName(a,b)}},i={debug:!1,_droppables:[],_draggables:[],add:function(b,c){function e(a){a.style.position="inherit"}b=d.elOrSelector(b,"Droppable.add target element");var f=Ink.extendObj({hoverClass:c.hoverclass||!1,accept:!1,onHover:!1,onDrop:!1,onDropOut:!1},c||{},a.data(b));"string"==typeof f.hoverClass&&(f.hoverClass=f.hoverClass.split(/\s+/));var g=this,h={move:function(a,b){e(a),b.appendChild(a)},copy:function(a,b){e(a),b.appendChild(a.cloneNode(!0))},revert:function(a){g._findDraggable(a).originalParent.appendChild(a),e(a)}},i;if("string"==typeof f.onHover&&(i=f.onHover,f.onHover=h[i],void 0===f.onHover))throw new Error("Unknown hover event handler: "+i);if("string"==typeof f.onDrop&&(i=f.onDrop,f.onDrop=h[i],void 0===f.onDrop))throw new Error("Unknown drop event handler: "+i);if("string"==typeof f.onDropOut&&(i=f.onDropOut,f.onDropOut=h[i],void 0===f.onDropOut))throw new Error("Unknown dropOut event handler: "+i);var j={element:b,data:{},options:f};this._droppables.push(j),this._update(j)},_findData:function(a){for(var b=this._droppables,c=0,d=b.length;d>c;c++)if(b[c].element===a)return b[c]},_findDraggable:function(a){for(var b=this._draggables,c=0,d=b.length;d>c;c++)if(b[c].element===a)return b[c]},updateAll:function(){e.each(this._droppables,i._update)},update:function(a){this._update(this._findData(a))},_update:function(b){var c=b.data,d=b.element;c.left=a.offsetLeft(d),c.top=a.offsetTop(d),c.right=c.left+a.elementWidth(d),c.bottom=c.top+a.elementHeight(d)},remove:function(a){a=d.elOrSelector(a);for(var b=this._droppables.length,c=0;b>c;c++)if(this._droppables[c].element===a){this._droppables.splice(c,1);break}return b!==this._droppables.length},action:function(a,b,c,d){e.each(this._droppables,Ink.bind(function(i){var j=i.data,k=i.options,l=i.element;(!k.accept||f.matches(k.accept,[d]).length)&&("drag"!==b||this._findDraggable(d)||this._draggables.push({element:d,originalParent:d.parentNode}),a.x>=j.left&&a.x<=j.right&&a.y>=j.top&&a.y<=j.bottom?"drag"===b?(k.hoverClass&&e.each(k.hoverClass,g(l)),k.onHover&&k.onHover(d,l)):"drop"===b&&(k.hoverClass&&e.each(k.hoverClass,h(l)),k.onDrop&&k.onDrop(d,l,c)):"drag"===b&&k.hoverClass?e.each(k.hoverClass,h(l)):"drop"===b&&k.onDropOut&&k.onDropOut(d,l,c))},this))}};return i}),Ink.createModule("Ink.UI.FormValidator","1",["Ink.Dom.Element_1","Ink.Dom.Css_1","Ink.Util.Validator_1","Ink.Dom.Selector_1"],function(a,b,c,d){"use strict";function e(a){if(!a.name)return[];if(!a.form)return d.select('name="'+a.name+'"');var b=a.form[a.name];return"undefined"==typeof b.length&&(b=[b]),b}var f={version:"1",_flagMap:{"ink-fv-required":{msg:"Required field"},"ink-fv-email":{msg:"Invalid e-mail address"},"ink-fv-url":{msg:"Invalid URL"},"ink-fv-number":{msg:"Invalid number"},"ink-fv-phone_pt":{msg:"Invalid phone number"},"ink-fv-phone_cv":{msg:"Invalid phone number"},"ink-fv-phone_mz":{msg:"Invalid phone number"},"ink-fv-phone_ao":{msg:"Invalid phone number"},"ink-fv-date":{msg:"Invalid date"},"ink-fv-confirm":{msg:"Confirmation does not match"},"ink-fv-custom":{msg:""}},elements:{},confirmElms:{},hasConfirm:{},_errorClassName:"tip error",_errorValidationClassName:"validaton",_errorTypeWarningClassName:"warning",_errorTypeErrorClassName:"error",validate:function(a,b){if(this._free(),b=Ink.extendObj({onSuccess:!1,onError:!1,customFlag:!1,confirmGroup:[]},b||{}),"string"==typeof a&&(a=document.getElementById(a)),null===a)return!1;this.element=a,("undefined"==typeof this.element.id||null===this.element.id||""===this.element.id)&&(this.element.id="ink-fv_randomid_"+Math.round(99999*Math.random())),this.custom=b.customFlag,this.confirmGroup=b.confirmGroup;var c=this._validateElements();return c.length>0?(b.onError?b.onError(c):this._showError(a,c),!1):(b.onError||this._clearError(a),this._clearCache(),b.onSuccess&&b.onSuccess(),!0)},reset:function(){this._clearError(),this._clearCache()},_free:function(){this.element=null,this.custom=!1,this.confirmGroup=!1},_clearCache:function(){this.element=null,this.elements=[],this.custom=!1,this.confirmGroup=!1},_getElements:function(){var a=this.elements[this.element.id]=[];this.confirmElms[this.element.id]=[];for(var c=d.select(":input",this.element),e=!1,f=0,g=c.length;g>f;f++){e=c[f];var h=(e.getAttribute("type")+"").toLowerCase();if("radio"===h||"checkbox"===h){if(0===a.length||e.getAttribute("type")!==a[a.length-1].getAttribute("type")&&e.getAttribute("name")!==a[a.length-1].getAttribute("name"))for(var i in this._flagMap)if(b.hasClassName(e,i)){a.push(e);break}}else{for(var j in this._flagMap)if(b.hasClassName(e,j)&&"ink-fv-confirm"!==j){a.push(e);break}b.hasClassName(e,"ink-fv-confirm")&&(this.confirmElms[this.element.id].push(e),this.hasConfirm[this.element.id]=!0)}}},_validateElements:function(){var a;this._getElements(),this.hasConfirm[this.element.id]===!0&&(a=this._makeConfirmGroups());for(var c=[],d=!1,e=!1,f,g=0,h=this.elements[this.element.id].length;h>g;g++)if(f=!1,d=this.elements[this.element.id][g],!d.disabled)for(var i in this._flagMap)if(b.hasClassName(d,i))if("ink-fv-custom"!==i&&"ink-fv-confirm"!==i)this._isValid(d,i)||(f?c[c.length-1].errors.push(i):(c.push({elm:d,errors:[i]}),f=!0));else if("ink-fv-confirm"!==i)e=this._isCustomValid(d),e.length>0&&c.push({elm:d,errors:[i],custom:e});else if("ink-fv-confirm"===i)continue;return c=this._validateConfirmGroups(a,c)},_validateConfirmGroups:function(a,b){var c=!1;for(var d in a)a.hasOwnProperty(d)&&(c=a[d],2===c.length&&c[0].value!==c[1].value&&b.push({elm:c[1],errors:["ink-fv-confirm"]}));return b},_makeConfirmGroups:function(){var a;if(this.confirmGroup&&this.confirmGroup.length>0){a={};for(var c=!1,d=!1,e=0,f=this.confirmElms[this.element.id].length;f>e;e++){c=this.confirmElms[this.element.id][e];for(var g=0,h=this.confirmGroup.length;h>g;g++)d=this.confirmGroup[g],b.hasClassName(c,d)&&("undefined"==typeof a[d]?a[d]=[c]:a[d].push(c))}return a}return 2===this.confirmElms[this.element.id].length&&(a={"ink-fv-confirm":[this.confirmElms[this.element.id][0],this.confirmElms[this.element.id][1]]}),a;return!1},_isCustomValid:function(a){for(var c=[],d=!1,e=0,f=this.custom.length;f>e;e++)d=this.custom[e],b.hasClassName(a,d.flag)&&(d.callback(a,d.msg)||c.push({flag:d.flag,msg:d.msg}));return c},_isValid:function(a,d){var f=a.nodeName.toLowerCase(),g=(a.getAttribute("type")||"").toLowerCase(),h=this._trim(a.value);if("ink-fv-required"!==d&&"checkbox"!==g&&"radio"!==g&&""===h)return!b.hasClassName(a,"ink-fv-required");switch(d){case"ink-fv-required":if("select"===f)return a.selectedIndex>0?!0:!1;if("checkbox"!==g&&"radio"!==g&&""!==h)return!0;if("checkbox"===g||"radio"===g){for(var i=e(a),j=!1,k=0,l=i.length;l>k;k++)if(i[k].checked===!0){j=!0;break}return j}return!1;case"ink-fv-email":return c.mail(a.value);case"ink-fv-url":return c.url(a.value);case"ink-fv-number":return!isNaN(Number(a.value))&&isFinite(Number(a.value));case"ink-fv-phone_pt":return c.isPTPhone(a.value);case"ink-fv-phone_cv":return c.isCVPhone(a.value);case"ink-fv-phone_ao":return c.isAOPhone(a.value);case"ink-fv-phone_mz":return c.isMZPhone(a.value);case"ink-fv-date":var m=Ink.getModule("Ink.Dom.Element",1),n=m.data(a),o="yyyy-mm-dd";if(b.hasClassName(a,"ink-datepicker")&&"format"in n?o=n.format:"validFormat"in n&&(o=n.validFormat),!(o in c._dateParsers)){var p=[];for(var q in c._dateParsers)c._dateParsers.hasOwnProperty(q)&&p.push(q);throw new Error("The attribute data-valid-format must be one of the following values: "+p.join(", "))}return c.isDate(o,a.value);case"ink-fv-custom":}return!1},_showError:function(a,b){this._clearError(a);for(var c=!1,d=0,e=b.length;e>d;d++)c=b[d].elm,c&&this._showAnErrorOnElement(c,b[d])},_showAnErrorOnElement:function(c,d){var e=a.findUpwardsByClass(c,"control-group"),f=a.findUpwardsByClass(c,"control"),g=[this._errorClassName,this._errorTypeClassName].join(" "),h=a.create("p",{className:g});h.innerHTML="ink-fv-custom"!==d.errors[0]?this._flagMap[d.errors[0]].msg:d.custom[0].msg;var i=f||e;i?i.appendChild(h):a.insertAfter(h,c),f&&("ink-fv-required"===d.errors[0]?b.addClassName(e,"validation error"):b.addClassName(e,"validation warning"))},_clearError:function(c){for(var d=c.getElementsByTagName("p"),e,f,g=d.length-1;g>=0;g--)e=d[g],b.hasClassName(e,this._errorClassName)&&(f=a.findUpwardsBySelector(e,".control-group"),f&&b.removeClassName(f,["validation","error","warning"]),b.hasClassName(e,this._errorClassName,!0)&&a.remove(e));var h=c.getElementsByTagName("ul");for(g=h.length-1;g>=0;g--)e=h[g],b.hasClassName(e,"control-group")&&b.removeClassName(e,"validation error")},_trim:function(a){return"string"==typeof a?a.replace(/^\s+|\s+$|\n+$/g,""):void 0}};return f}),Ink.createModule("Ink.UI.FormValidator","2",["Ink.UI.Common_1","Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Selector_1","Ink.Dom.Css_1","Ink.Util.Array_1","Ink.Util.I18n_1","Ink.Util.Validator_1"],function(a,b,c,d,e,f,g,h){"use strict";function i(){a.BaseUIComponent.apply(this,arguments)}function j(){a.BaseUIComponent.apply(this,arguments)}var k={required:function(a){return"undefined"!=typeof a&&!/^\s*$/.test(a)},min_length:function(a,b){return"string"==typeof a&&a.length>=parseInt(b,10)},max_length:function(a,b){return"string"==typeof a&&a.length<=parseInt(b,10)},exact_length:function(a,b){return"string"==typeof a&&a.length===parseInt(b,10)},email:function(a){return"string"==typeof a&&h.mail(a)},url:function(a,b){return b=b||!1,"string"==typeof a&&h.url(a,b)},ip:function(a,b){return"string"!=typeof a?!1:h.isIP(a,b)},phone:function(a,b){if("string"!=typeof a)return!1;var c=b?b.toUpperCase():"";return h["is"+c+"Phone"](a)},credit_card:function(a,b){return"string"!=typeof a?!1:h.isCreditCard(a,b||"default")},date:function(a,b){return"string"==typeof a&&h.isDate(b,a)},alpha:function(a,b){return h.ascii(a,{singleLineWhitespace:b})},text:function(a,b,c){return h.unicode(a,{singleLineWhitespace:b,unicodePunctuation:c})},latin:function(a,b,c){return"string"!=typeof a?!1:h.latin1(a,{latin1Punctuation:b,singleLineWhitespace:c})},alpha_numeric:function(a){return h.ascii(a,{numbers:!0})},alpha_dash:function(a){return h.ascii(a,{dash:!0,underscore:!0})},digit:function(a){return"string"==typeof a&&/^[0-9]{1}$/.test(a)},integer:function(a,b){return h.number(a,{negative:!b,decimalPlaces:0})},decimal:function(a,b,c,d){return h.number(a,{decimalSep:b||".",decimalPlaces:+c||null,maxDigits:+d})},numeric:function(a,b,c,d){return b=b||".",-1!==a.indexOf(b)?k.decimal(a,b,c,d):k.integer(a)},range:function(a,b,c,d){return a=+a,b=+b,c=+c,isNaN(a)||isNaN(b)||isNaN(c)?!1:b>a||a>c?!1:d?(a-b)%d===0:!0},color:function(a){return h.isColor(a)},matches:function(a,b){return a===this.getFormElements()[b][0].getValue()}},l=new g({en_US:{"formvalidator.required":"The {field} filling is mandatory","formvalidator.min_length":"The {field} must have a minimum size of {param1} characters","formvalidator.max_length":"The {field} must have a maximum size of {param1} characters","formvalidator.exact_length":"The {field} must have an exact size of {param1} characters","formvalidator.email":"The {field} must have a valid e-mail address","formvalidator.url":"The {field} must have a valid URL","formvalidator.ip":"The {field} does not contain a valid {param1} IP address","formvalidator.phone":"The {field} does not contain a valid {param1} phone number","formvalidator.credit_card":"The {field} does not contain a valid {param1} credit card","formvalidator.date":"The {field} should contain a date in the {param1} format","formvalidator.alpha":"The {field} should only contain letters","formvalidator.text":"The {field} should only contain alphabetic characters","formvalidator.latin":"The {field} should only contain alphabetic characters","formvalidator.alpha_numeric":"The {field} should only contain letters or numbers","formvalidator.alpha_dash":"The {field} should only contain letters or dashes","formvalidator.digit":"The {field} should only contain a digit","formvalidator.integer":"The {field} should only contain an integer","formvalidator.decimal":"The {field} should contain a valid decimal number","formvalidator.numeric":"The {field} should contain a number","formvalidator.range":"The {field} should contain a number between {param1} and {param2}","formvalidator.color":"The {field} should contain a valid color","formvalidator.matches":"The {field} should match the field {param1}","formvalidator.validation_function_not_found":"The rule {rule} has not been defined"},pt_PT:{"formvalidator.required":"Preencher {field} é obrigatório","formvalidator.min_length":"{field} deve ter no mínimo {param1} caracteres","formvalidator.max_length":"{field} tem um tamanho máximo de {param1} caracteres","formvalidator.exact_length":"{field} devia ter exactamente {param1} caracteres","formvalidator.email":"{field} deve ser um e-mail válido","formvalidator.url":"O {field} deve ser um URL válido","formvalidator.ip":"{field} não tem um endereço IP {param1} válido","formvalidator.phone":"{field} deve ser preenchido com um número de telefone {param1} válido.","formvalidator.credit_card":"{field} não tem um cartão de crédito {param1} válido","formvalidator.date":"{field} deve conter uma data no formato {param1}","formvalidator.alpha":"O campo {field} deve conter apenas caracteres alfabéticos","formvalidator.text":"O campo {field} deve conter apenas caracteres alfabéticos","formvalidator.latin":"O campo {field} deve conter apenas caracteres alfabéticos","formvalidator.alpha_numeric":"{field} deve conter apenas letras e números","formvalidator.alpha_dash":"{field} deve conter apenas letras e traços","formvalidator.digit":"{field} destina-se a ser preenchido com apenas um dígito","formvalidator.integer":"{field} deve conter um número inteiro","formvalidator.decimal":"{field} deve conter um número válido","formvalidator.numeric":"{field} deve conter um número válido","formvalidator.range":"{field} deve conter um número entre {param1} e {param2}","formvalidator.color":"{field} deve conter uma cor válida","formvalidator.matches":"{field} deve corresponder ao campo {param1}","formvalidator.validation_function_not_found":"[A regra {rule} não foi definida]"}},"en_US"); +return i._name="FormElement_1",i._optionDefinition={label:["String",null],rules:["String",null],form:["Object"]},i.prototype={_init:function(){this._errors={},this._rules={},this._value=null,null===this._options.label&&(this._options.label=this._getLabel())},_getLabel:function(){var a=b.findUpwardsBySelector(this._element,".control-group label");return a?b.textContent(a):this._element.name||this._element.id||""},_parseRules:function(a){this._rules={},a=a.split("|");var b,c=a.length,d,e,f;if(c>0)for(b=0;c>b;b++)if(d=a[b])if(-1!==(f=d.indexOf("["))){e=d.substr(f+1),e=e.split("]"),e=e[0],e=e.split(",");for(var g=0,h=e.length;h>g;g++)e[g]="true"===e[g]?!0:"false"===e[g]?!1:e[g];e.splice(0,0,this.getValue()),d=d.substr(0,f),this._rules[d]=e}else this._rules[d]=[this.getValue()]},_addError:function(a){for(var b=this._rules[a]||[],c={field:this._options.label,value:this.getValue()},d=1;d"),this._errorMessages.push(f)},this)),!1)}},a.createUIComponent(j),j}),Ink.createModule("Ink.UI.ImageQuery","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Util.Array_1"],function(a,b,c,d){"use strict";function e(){a.BaseUIComponent.apply(this,arguments)}return e._name="ImageQuery_1",e._optionDefinition={src:["String"],retina:["String",void 0],queries:["Object"],onLoad:["Function",null]},e.prototype={_init:function(){var a;if(-1!==(a=this._element.src.lastIndexOf("?"))){var c=this._element.src.substr(a);this._filename=this._element.src.replace(c,"").split("/").pop()+c}else this._filename=this._element.src.split("/").pop();this._options.queries||(this._options.queries=[]),this._options.queries=d.sortMulti(this._options.queries,"width").reverse(),"function"==typeof this._options.onLoad&&b.observe(this._element,"onload",Ink.bindEvent(this._onLoad,this)),this._onResize(),b.observe(window,"resize",b.throttle(Ink.bindMethod(this,"_onResize"),400))},_onResize:function(){if(this._options.queries.length){var a=this._findCurrentQuery(),b=a.src||this._options.src;if(window.devicePixelRatio>1&&void 0!==this._options.retina&&(b=a.retina||this._options.retina),a.file=this._filename,"function"==typeof b&&(b=b.apply(this,[this._element,a]),"string"!=typeof b))throw'[ImageQuery] :: "src" callback does not return a string';b=b.replace(/{:(.*?)}/g,function(b,c){return a[c]}),this._element.src=b,delete a.file}},_findCurrentQuery:function(){for(var a=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,b=this._options.queries,c=b.length-1,d=0;c>d;d+=1)if(b[d].width<=a)return b[d];return b[c]},_onLoad:function(){this._options.onLoad.call(this)}},a.createUIComponent(e),e}),Ink.createModule("Ink.UI.LazyLoad","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1"],function(a,b,c){"use strict";function d(){a.BaseUIComponent.apply(this,arguments)}return d._name="LazyLoad_1",d._optionDefinition={item:["String",".lazyload-item"],placeholder:["String",null],source:["String","data-src"],destination:["String","src"],delay:["Number",100],delta:["Number",0],image:["Boolean",!0],scrollElement:["Element",window],touchEvents:["Boolean",!0],onInsideViewport:["Function",!1],onAfterAttributeChange:["Function",!1],autoInit:["Boolean",!0]},d.prototype={_init:function(){this._rootElm=this._element,this._aData=[],this._hasEvents=!1,this._options.autoInit&&this._activate()},_activate:function(){this._getData(),this._hasEvents||this._addEvents(),this._onScrollThrottled()},_getData:function(){for(var a=Ink.ss(this._options.item),b=null,d=0,e=a.length;e>d;d++)null==this._options.placeholder||c.hasAttribute(a[d],this._options.destination)||a[d].setAttribute(this._options.destination,this._options.placeholder),b=a[d].getAttribute(this._options.source),null===b&&this._options.image||this._aData.push({elm:a[d],original:b})},_addEvents:function(){this._onScrollThrottled=b.throttle(Ink.bindEvent(this._onScroll,this),this._options.delay),"ontouchmove"in document.documentElement&&this._options.touchEvents&&b.observe(document.documentElement,"touchmove",this._onScrollThrottled),b.observe(this._options.scrollElement,"scroll",this._onScrollThrottled),this._hasEvents=!0},_removeEvents:function(){"ontouchmove"in document.documentElement&&this._options.touchEvents&&b.stopObserving(document.documentElement,"touchmove",this._onScrollThrottled),b.stopObserving(this._options.scrollElement,"scroll",this._onScrollThrottled),this._hasEvents=!1},_onScroll:function(){for(var a,b=0;bthis.originalStatus[c]?this._modalDivStyle[h(c)]:Math.round(.9*b[c])+"px")},this)),this._resizeContainer(),this._reposition(),this._resizeTimeout=void 0},_onShadeClick:function(a){var f=b.element(a);if(c.hasClassName(f,"ink-close")||c.hasClassName(f,"ink-dismiss")||d.findUpwardsBySelector(f,".ink-close,.ink-dismiss")||this._options.closeOnClick&&(!d.descendantOf(this._shadeElement,f)||f===this._shadeElement)){for(var g=e.select(".ink-alert",this._shadeElement),h=g.length,i=0;h>i;i++)if(d.descendantOf(g[i],f))return;this.dismiss(),this._wasDismissed&&b.stop(a)}},_onKeyDown:function(a){27!==a.keyCode||this._wasDismissed||"true"===this._options.closeOnEscape.toString()&&k[k.length-1]===this&&(this.dismiss(),this._wasDismissed&&b.stop(a))},_resizeContainer:function(){var a=d.elementHeight(this._modalDiv);this._modalHeader=e.select(".modal-header",this._modalDiv)[0],this._modalHeader&&(a-=d.elementHeight(this._modalHeader)),this._modalFooter=e.select(".modal-footer",this._modalDiv)[0],this._modalFooter&&(a-=d.elementHeight(this._modalFooter)),this._contentContainer.style.height=a+"px",a!==d.elementHeight(this._contentContainer)&&(this._contentContainer.style.height=~~(a-(d.elementHeight(this._contentContainer)-a))+"px"),this._markupMode},open:function(a){a&&b.stop(a);var e="CSS1Compat"===document.compatMode?document.documentElement:document.body;this._resizeTimeout=null,c.addClassName(this._modalShadow,"ink-shade"),this._modalShadowStyle.display=this._modalDivStyle.display="block",setTimeout(Ink.bind(function(){c.addClassName(this._modalShadow,"visible"),c.addClassName(this._modalDiv,"visible")},this),100),this._contentElement=this._modalDiv,this._shadeElement=this._modalShadow,this._markupMode||this.setContentMarkup(this._options.markup);var i={width:-1!==(""+this._options.width).indexOf("%"),height:-1!==(""+this._options.height).indexOf("%")};f.forEach(["width","height"],Ink.bind(function(a){void 0!==this._options[a]?(this._modalDivStyle[a]=this._options[a],i[a]||(this._modalDivStyle[h(a)]=d["element"+g(a)](this._modalDiv)+"px")):this._modalDivStyle[h(a)]=d["element"+g(a)](this._modalDiv)+"px",i[a]&&parseInt(e["client"+h(a)],10)<=parseInt(this._modalDivStyle[a],10)&&(this._modalDivStyle[a]=Math.round(.9*parseInt(e["client"+h(a)],10))+"px")},this)),this.originalStatus={viewportHeight:d.elementHeight(e),viewportWidth:d.elementWidth(e),height:d.elementHeight(this._modalDiv),width:d.elementWidth(this._modalDiv)},"true"===this._options.responsive.toString()?(this._onResize(!0),b.observe(window,"resize",this._handlers.resize)):(this._resizeContainer(),this._reposition()),this._options.onShow&&this._options.onShow(this),b.observe(this._shadeElement,"click",this._handlers.click),"true"===this._options.closeOnEscape.toString()&&b.observe(document,"keydown",this._handlers.keyDown),this._wasDismissed=!1,k.push(this),c.addClassName(document.documentElement,"ink-modal-open")},dismiss:function(){if(!this._wasDismissed){if(this._options.onDismiss){var a=this._options.onDismiss(this);if(a===!1)return}if(this._wasDismissed=!0,this._options.responsive&&b.stopObserving(window,"resize",this._handlers.resize),this._markupMode?(c.removeClassName(this._modalDiv,"visible"),c.removeClassName(this._modalShadow,"visible"),this._waitForFade(this._modalShadow,Ink.bind(function(){this._modalShadowStyle.display="none"},this))):(this._modalShadow.parentNode.removeChild(this._modalShadow),this.destroy()),k=f.remove(k,f.keyValue(this,k),1),0===k.length){var d=document.documentElement;c.removeClassName(d,"ink-modal-open")}}},_waitForFade:function(a,d){if(!j)return d();for(var e=["transitionEnd","oTransitionEnd","webkitTransitionEnd"],f,g,h=0,i=e.length;i>h;h++)if(g=e[h],f="on"+g.toLowerCase(),f in a)return void b.observeOnce(a,g,d);var k=function(){+c.getStyle(a,"opacity")>0?setTimeout(k,250):d()};setTimeout(k,500)},destroy:function(){a.unregisterInstance(this._instanceId)},getContentElement:function(){return this._contentContainer},setContentMarkup:function(a){if(this._markupMode)this._contentContainer.innerHTML=a;else{if(this._modalDiv.innerHTML=[a].join(""),this._contentContainer=e.select(".modal-body",this._modalDiv),!this._contentContainer.length){var b=e.select(".modal-header",this._modalDiv),g=e.select(".modal-footer",this._modalDiv);f.each(b,d.remove),f.each(g,d.remove);var h=document.createElement("div");c.addClassName(h,"modal-body"),h.innerHTML=this._modalDiv.innerHTML,this._modalDiv.innerHTML="";var i=b.concat([h]).concat(g);f.each(i,Ink.bindMethod(this._modalDiv,"appendChild")),this._contentContainer=e.select(".modal-body",this._modalDiv)}this._contentContainer=this._contentContainer[0]}this._contentElement=this._modalDiv,this._resizeContainer()}},a.createUIComponent(i,{elementIsOptional:!0}),i}),Ink.createModule("Ink.UI.Pagination","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1"],function(a,b,c,d,e){"use strict";function f(){a.BaseUIComponent.apply(this,arguments)}var g=function(a,b,c){var d=document.createElement("a");if(d.setAttribute("href","#"),"number"==typeof b&&d.setAttribute("data-index",b),c&&c.wrapText){var e=document.createElement("span");d.appendChild(e),e.innerHTML=a}else d.innerHTML=a;return d};return f._name="Pagination_1",f._optionDefinition={size:["Integer",null],totalItemCount:["Integer",null],itemsPerPage:["Integer",null],maxSize:["Integer",null],start:["Integer",1],sideButtons:["Boolean",1],firstLabel:["String","First"],lastLabel:["String","Last"],previousLabel:["String","Previous"],nextLabel:["String","Next"],previousPageLabel:["String",null],nextPageLabel:["String",null],onChange:["Function",void 0],hashParameter:["String","page"],parentTag:["String","ul"],childTag:["String","li"],wrapperClass:["String","ink-navigation"],paginationClass:["String","pagination"],activeClass:["String","active"],disabledClass:["String","disabled"],hideClass:["String","hide-all"],previousClass:["String","previous"],previousPageClass:["String","previousPage"],nextClass:["String","next"],nextPageClass:["String","nextPage"],numberFormatter:["Function",function(a){return a+1}]},f.prototype={_init:function(){this._options.previousPageLabel||(this._options.previousPageLabel=this._options.previousLabel+" "+this._options.maxSize),this._options.nextPageLabel||(this._options.nextPageLabel=this._options.nextLabel+" "+this._options.maxSize),this._handlers={click:Ink.bindEvent(this._onClick,this)},a.isInteger(this._options.totalItemCount)&&a.isInteger(this._options.itemsPerPage)?this._size=this._calculateSize(this._options.totalItemCount,this._options.itemsPerPage):a.isInteger(this._options.size)?this._size=this._options.size:(Ink.error("Ink.UI.Pagination: Please supply a size option or totalItemCount and itemsPerPage options."),this._size=0),this._current=this._options.start-1,this._itemLiEls=[],this._generateMarkup(this._element),this._updateItems(),this._observe()},_observe:function(){b.observeDelegated(this._element,"click","."+this._options.paginationClass+" > "+this._options.childTag,this._handlers.click)},_calculateSize:function(a,b){return Math.ceil(a/b)},_updateItems:function(){var a=this._itemLiEls,b=this._size===a.length,d,e,f;if(b)for(d=0,e=this._size;e>d;++d)c.setClassName(a[d],this._options.activeClass,d===this._current);else{for(d=a.length-1;d>=0;--d)this._ulEl.removeChild(a[d]);for(a=[],d=0,e=this._size;e>d;++d)f=document.createElement(this._options.childTag),f.appendChild(g(this._options.numberFormatter(d),d)),c.setClassName(f,this._options.activeClass,d===this._current),this._nextEl?this._ulEl.insertBefore(f,this._nextEl):this._ulEl.appendChild(f),a.push(f);this._itemLiEls=a}if(this._options.maxSize){var h=Math.floor(this._current/this._options.maxSize),i=this._options.maxSize*h,j=i+this._options.maxSize-1;for(d=0,e=this._size;e>d;++d)f=a[d],c.setClassName(f,this._options.hideClass,i>d||d>j);this._pageStart=i,this._pageEnd=j,this._page=h,c.setClassName(this._prevPageEl,this._options.disabledClass,!this.hasPreviousPage()),c.setClassName(this._nextPageEl,this._options.disabledClass,!this.hasNextPage()),c.setClassName(this._firstEl,this._options.disabledClass,this.isFirst()),c.setClassName(this._lastEl,this._options.disabledClass,this.isLast())}this._prevEl&&c.setClassName(this._prevEl,this._options.disabledClass,!this.hasPrevious()),this._nextEl&&c.setClassName(this._nextEl,this._options.disabledClass,!this.hasNext())},_generateMarkup:function(a){c.addClassName(a,"ink-navigation");var b=Ink.s("."+this._options.paginationClass,a),d=!1;b?d=!0:(b=document.createElement(this._options.parentTag),c.addClassName(b,this._options.paginationClass));var e=c.hasClassName(b,"chevron"),f=c.hasClassName(b,"dotted"),h=Ink.bind(function(a,d){var e=document.createElement(this._options.childTag),f=g(this._options[a+"Label"],void 0,{wrapText:d&&d.wrapText});return c.addClassName(e,this._options[a+"Class"]),e.appendChild(f),b.appendChild(e),e},this);!f&&this._options.maxSize&&(this._firstEl=h("first"),this._prevPageEl=h("previousPage")),(f&&this._options.sideButtons===!0||!f&&this._options.sideButtons)&&(this._prevEl=h("previous",{wrapText:e}),this._nextEl=h("next",{wrapText:e})),!f&&this._options.maxSize&&(this._nextPageEl=h("nextPage"),this._lastEl=h("last")),d||a.appendChild(b),this._ulEl=b},_onClick:function(a){b.stop(a);var d=b.element(a);if(!c.hasClassName(d,this._options.activeClass)&&!c.hasClassName(d,this._options.disabledClass)){var f=c.hasClassName(d,this._options.previousClass),g=c.hasClassName(d,this._options.nextClass),h=c.hasClassName(d,this._options.previousPageClass),i=c.hasClassName(d,this._options.nextPageClass),j=c.hasClassName(d,this._options.firstClass),k=c.hasClassName(d,this._options.lastClass);if(j)this.setCurrent(0);else if(k)this.setCurrent(this._size-1);else if(h||i)this.setCurrent((h?-1:1)*this._options.maxSize,!0);else if(f||g)this.setCurrent(f?-1:1,!0);else{var l=e.select("[data-index]",d)[0],m=l&&parseInt(l.getAttribute("data-index"),10);this.setCurrent(m)}}},setOnChange:function(a){if(void 0!==a&&"function"!=typeof a)throw new TypeError("onChange option must be a function!");this._options.onChange=a},setSize:function(b){if(!a.isInteger(b))throw new TypeError("1st argument must be an integer number!");this._size=b,this._updateItems(),this._current=0},setSizeInItems:function(a,b){var c=Math.ceil(a/b);this.setSize(c)},setCurrent:function(b,c){if(!a.isInteger(b))throw new TypeError("1st argument must be an integer number!");c&&(b+=this._current),b>this._size-1&&(b=this._size-1),0>b&&(b=0),this._current=b,this._updateItems(),this._options.onChange&&this._options.onChange(this,b)},getSize:function(){return this._size},getCurrent:function(){return this._current},isFirst:function(){return 0===this._current},isLast:function(){return this._current===this._size-1},hasPrevious:function(){return this._current>0},hasNext:function(){return this._currentthis._options.maxSize-1},hasNextPage:function(){return this._options.maxSize&&this._size-this._current>=this._options.maxSize+1},destroy:a.destroyComponent},a.createUIComponent(f),f}),Ink.createModule("Ink.UI.ProgressBar","1",["Ink.UI.Common_1","Ink.Dom.Selector_1"],function(a,b){"use strict";function c(){a.BaseUIComponent.apply(this,arguments)}return c._name="ProgressBar_1",c._optionDefinition={startValue:["Number",0],onStart:["Function",function(){}],onEnd:["Function",function(){}]},c.prototype={_init:function(){if(this._value=this._options.startValue,this._elementBar=b.select(".bar",this._element),this._elementBar.length<1)throw new Error("[Ink.UI.ProgressBar] :: Bar element not found");this._elementBar=this._elementBar[0],this.setValue(this._options.startValue)},setValue:function(a){this._options.onStart.call(this,this._value),a=parseInt(a,10),isNaN(a)||0>a?a=0:a>100&&(a=100),this._value=a,this._elementBar.style.width=this._value+"%",this._options.onEnd.call(this,this._value)}},a.createUIComponent(c),c}),Ink.createModule("Ink.UI.SmoothScroller","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Dom.Css_1"],function(a,b,c,d,e){"use strict";var f=window.requestAnimationFrame||function(a){return setTimeout(a,10)},g=window.cancelAnimationFrame||function(a){clearTimeout(a)},h={speed:10,changeHash:!0,margin:0,scroll:function(a,b){var d=Math.round(c.scrollHeight()),e=Math.round(a-b.margin);d+=e>d?Math.ceil((e-d)/b.speed):(e-d)/b.speed,g(h.interval),d!==e&&h.offsetTop!==d?h.interval=f(Ink.bindMethod(h,"scroll",a,b),document.body):h.onDone(b),window.scrollTo(0,d),h.offsetTop=d},init:function(a){b.on(document,"click",a||"a.scrollableLink, a.ink-smooth-scroll",h.onClick)},render:function(){},onClick:function(b){var d=b.currentTarget,f=(location+"").replace(/#.*?$/,""),g=(d.href+"").replace(/#.*?$/,"");if(g===f){var i=d.getAttribute("data-hash")||(d.getAttribute("href")||"").replace(/^.*?#/,"");if(i){b.preventDefault();var j="ul > li.active > "+k,k='a[name="'+i+'"],#'+i,l=Ink.s(k),m=Ink.s(j);if(m=m&&m.parentNode,l){e.hasClassName(d.parentNode,"active")||(m&&e.removeClassName(m,"active"),e.addClassName(d.parentNode,"active"));var n=a.options("SmoothScroller link options",{margin:["Number",h.margin],speed:["Number",h.speed],changeHash:["Boolean",h.changeHash]},{},d);h.hash=i,h.scroll(c.offsetTop(l),n)}}}},onDone:function(a){a.changeHash===!0&&(window.location.hash=h.hash),h.hash=h.offsetTop=null}};return h}),Ink.createModule("Ink.UI.SortableList","1",["Ink.UI.Common_1","Ink.Dom.Css_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Selector_1"],function(a,b,c,d,e){"use strict";function f(){a.BaseUIComponent.apply(this,arguments)}var g="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;return f._name="SortableList_1",f._optionDefinition={placeholderClass:["String","placeholder"],draggedClass:["String","hide-all"],draggingClass:["String","dragging"],dragSelector:["String","li"],dragObject:["String",null],handleSelector:["String",null],moveSelector:["String",!1],swap:["Boolean",!1],cancelMouseOut:["Boolean",!1],onDrop:["Function",function(){}]},f.prototype={_init:function(){null!=this._options.dragObject&&(Ink.warn("Ink.UI.SortableList: options.dragObject is now deprecated. Please use options.handleSelector instead."),this._options.handleSelector=this._options.handleSelector||this._options.dragObject),this._handlers={down:Ink.bind(this._onDown,this),move:Ink.bind(this._onMove,this),up:Ink.bind(this._onUp,this)},this._isMoving=!1,this._down=g?"touchstart mousedown":"mousedown",this._move=g?"touchmove mousemove":"mousemove",this._up=g?"touchend mouseup":"mouseup",this._observe()},_observe:function(){c.on(this._element,this._down,this._options.dragSelector,this._handlers.down),c.on(this._element,this._move,this._options.dragSelector,this._handlers.move),this._options.cancelMouseOut&&c.on(this._element,"mouseleave",Ink.bind(this.stopMoving,this)),c.on(document.documentElement,this._up,this._handlers.up)},_onDown:function(a){if(!(this._isMoving||this._placeholder||this._options.handleSelector&&!e.matchesSelector(a.target,this._options.handleSelector))){var b=a.currentTarget;return this._isMoving=b,this._placeholder=b.cloneNode(!0),this._movePlaceholder(b),this._addMovingClasses(),!1}},_onMove:function(a){var b=a.currentTarget;if("touchmove"===a.type){var c=a.touches[0];b=document.elementFromPoint(c.clientX,c.clientY),b=d.findUpwardsBySelector(b,this._options.dragSelector)}this.validateMove(b),a.preventDefault()},_onUp:function(a){return this._isMoving&&this._placeholder&&a.currentTarget!==this._isMoving&&a.currentTarget!==this._placeholder?(d.insertBefore(this._isMoving,this._placeholder),this.stopMoving(),this._options.onDrop.call(this,{droppedElement:a.currentTarget}),!1):void 0},_addMovingClasses:function(){b.addClassName(this._placeholder,this._options.placeholderClass),b.addClassName(this._isMoving,this._options.draggedClass),b.addClassName(document.documentElement,this._options.draggingClass)},_removeMovingClasses:function(){this._isMoving&&b.removeClassName(this._isMoving,this._options.draggedClass),this._placeholder&&b.removeClassName(this._placeholder,this._options.placeholderClass),b.removeClassName(document.documentElement,this._options.draggingClass)},_movePlaceholder:function(a){var b=this._placeholder,c,e,f,g;b?this._options.swap?(d.insertAfter(b,a),d.insertBefore(a,this._isMoving),d.insertBefore(this._isMoving,b)):(c=d.offset(a),e=d.offset(this._placeholder),f=c[1]>e[1],g=c[0]>e[0],f&&g||!f&&!g?d.insertBefore(b,a):d.insertAfter(b,a),d.insertBefore(this._isMoving,b)):d.insertAfter(b,a)},destroy:a.destroyComponent,stopMoving:function(){this._removeMovingClasses(),d.remove(this._placeholder),this._placeholder=!1,this._isMoving=!1},validateMove:function(a){a&&this._isMoving&&this._placeholder&&a!==this._placeholder&&a!==this._isMoving&&(!this._options.moveSelector||e.matchesSelector(a,this._options.moveSelector)?this._movePlaceholder(a):this.stopMoving())}},a.createUIComponent(f),f}),Ink.createModule("Ink.UI.Spy","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1"],function(a,b,c,d,e){"use strict";function f(a){for(var b=0,c=m.length;c>b;b++)if(m[b][0]===a)return b;return null}function g(a,b){var c=f(b);null===c?m.push([b,[a]]):m[c][1].push(a)}function h(){n||(n=!0,b.observe(document,"scroll",b.throttle(i,300)))}function i(){for(var a=0,b=m.length;b>a;a++)j(m[a][0],m[a][1])}function j(a,b){for(var f=k(b),g=e.select("li.active",a),h=0,i=g.length;i>h;h++)c.removeClassName(g[h],"active");if(null!==f){var j='a[href$="#'+(f.name||f.id)+'"]',l=e.select(j,a);for(h=0,i=l.length;i>h;h++)c.addClassName(d.findUpwardsByTag(l[h],"li"),"active")}}function k(a){for(var b=-1/0,c,d,e=0,f=a.length;f>e;e++)d=a[e].getBoundingClientRect(),d.top<=0&&d.top>b&&(b=d.top,c=e);return void 0===c?null:a[c]}function l(){a.BaseUIComponent.apply(this,arguments)}var m=[],n=!1;return l._name="Spy_1",l._optionDefinition={target:["Element",void 0],activeClass:["String","active"]},l.prototype={_init:function(){g(this._element,this._options.target),h(),i()}},a.createUIComponent(l),l}),Ink.createModule("Ink.UI.Stacker",1,["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1"],function(a,b,c){"use strict";function d(){a.BaseUIComponent.apply(this,arguments)}return d._name="Stacker_1",d._optionDefinition={column:["String",".stacker-column"],item:["String",".stacker-item"],customBreakPoints:["Object",null],largeMax:["Number",Number.MAX_VALUE],largeMin:["Number",961],mediumMax:["Number",960],mediumMin:["Number",651],smallMax:["Number",650],smallMin:["Number",0],largeCols:["Integer",3],mediumCols:["Integer",2],smallCols:["Integer",1],isOrdered:["Boolean",!0],onRunCallback:["Function",null],onResizeCallback:["Function",null],onAPIReloadCallback:["Function",null]},d.prototype={_init:function(){this._aList=[],this._curLayout="large",this._runFirstTime=!1,this._getPageItemsToList(),(this._canApplyLayoutChange()||!this._runFirstTime)&&(this._runFirstTime=!0,this._applyLayoutChange(),"function"==typeof this._options.onRunCallback&&this._options.onRunCallback(this._curLayout)),this._addEvents()},addItem:function(a){this._aList.push(a)},reloadItems:function(){this._applyLayoutChange(),"function"==typeof this._options.onAPIReloadCallback&&this._options.onAPIReloadCallback(this._curLayout)},_addEvents:function(){b.observe(window,"resize",Ink.bindEvent(this._onResize,this))},_onResize:function(){this._canApplyLayoutChange()&&(this._removeDomItems(),this._applyLayoutChange(),"function"==typeof this._options.onResizeCallback&&this._options.onResizeCallback(this._curLayout))},_setCurLayout:function(){var a=c.viewportWidth();if(this._options.customBreakpoints&&"object"==typeof this._options.customBreakPoints){for(var b in this._options.customBreakPoints)if(this._options.customBreakPoints.hasOwnProperty(b)&&a>=Number(this._options.customBreakPoints[b].min)&&a<=Number(this._options.customBreakPoints[b].max)&&this._curLayout!==b)return void(this._curLayout=b) +}else a<=Number(this._options.largeMax)&&a>=Number(this._options.largeMin)&&"large"!==this._curLayout?this._curLayout="large":a>=Number(this._options.mediumMin)&&a<=Number(this._options.mediumMax)&&"medium"!==this._curLayout?this._curLayout="medium":a>=Number(this._options.smallMin)&&a<=Number(this._options.smallMax)&&"small"!==this._curLayout&&(this._curLayout="small")},_getColumnsToShow:function(){return Number(this._options.customBreakPoints&&"object"==typeof this._options.customBreakPoints?this._options.customBreakPoints[this._curLayout].cols:this._options[this._curLayout+"Cols"])},_canApplyLayoutChange:function(){var a=this._curLayout;return this._setCurLayout(),a!==this._curLayout?!0:!1},_getPageItemsToList:function(){this._aColumn=Ink.ss(this._options.column,this._element);var a=this._aColumn.length,b=0;if(a>0){for(var c=0;c0&&this._options.isOrdered){for(var f=[],g=0;g0)for(var b=0;a>b;b++)for(var c=Ink.ss(this._options.item,this._aColumn[b]),d=c.length-1;d>=0;d--)c[d].parentNode.removeChild(c[d])},_applyLayoutChange:function(){var a=this._getColumnsToShow(),b=this._aList.length,c=0,d=0;if(a>0)for(;a>d;){if(this._aColumn[d].appendChild(this._aList[c]),c++,d++,c===b)return;d===a&&(d=0)}}},a.createUIComponent(d),d}),Ink.createModule("Ink.UI.Sticky","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Css_1"],function(a,b,c,d){"use strict";function e(){a.BaseUIComponent.apply(this,arguments)}return e._name="Sticky_1",e._optionDefinition={offsetBottom:["Integer",0],offsetTop:["Integer",0],topElement:["Element",null],wrapperClass:["String","ink-sticky-wrapper"],stickyClass:["String","ink-sticky-stuck"],inlineDimensions:["Boolean",!0],inlinePosition:["Boolean",!0],bottomElement:["Element",null],activateInLayouts:["String","tiny,small,medium,large,xlarge"]},e.prototype={_init:function(){this._options.activateInLayouts=this._options.activateInLayouts.toString(),this._dims=null,this._options.offsetTop=parseInt(this._options.offsetTop,10)||0,this._options.offsetBottom=parseInt(this._options.offsetBottom,10)||0,this._options.topElement&&(this._options.topElement=a.elOrSelector(this._options.topElement,"Top Element")),this._options.bottomElement&&(this._options.bottomElement=a.elOrSelector(this._options.bottomElement,"Sticky bottom Element")),this._wrapper=c.create("div",{className:this._options.wrapperClass}),c.wrap(this._element,this._wrapper);var d=document.addEventListener?document:window;this._onScroll=Ink.bind(b.throttle(this._onScroll,33),this),b.observe(d,"scroll",this._onScroll),b.observe(window,"resize",Ink.bindEvent(b.throttle(this._onResize,100),this)),this._onScroll()},_isDisabledInLayout:function(){var b=a.currentLayout();return b?-1===this._options.activateInLayouts.indexOf(b):!1},_onScroll:function(){var a=this._getDims(),b=c.scrollHeight(),d=this._isDisabledInLayout()||b<=a.top-this._options.offsetTop||this._options.topElement&&this._options.topElement.getBoundingClientRect().bottom+this._options.offsetTop>0;if(d)return void this._unstick();var e=this._options.offsetTop+a.height+c.scrollHeight(),f=document.body.scrollHeight;this._options.bottomElement&&(f=this._options.bottomElement.getBoundingClientRect().top+c.scrollHeight()),f-=this._options.offsetBottom,this._stickTo(f>e?"screen":"bottom")},_stickTo:function(a){var b=this._element.style,e=this._getDims();if(d.addClassName(this._element,this._options.stickyClass),this._wrapper.style.height=e.height+"px",this._inlineDimensions(e.height+"px",e.width+"px"),this._options.inlinePosition!==!1)if(b.left=e.left+"px","screen"===a)b.bottom=null,b.top=this._options.offsetTop+"px";else if("bottom"===a){var f=this._getBottomOffset(),g=c.scrollHeight()+c.viewportHeight(),h=c.pageHeight()-g;b.bottom=f-h+"px",b.top="auto"}},_unstick:function(){d.removeClassName(this._element,this._options.stickyClass),this._inlineDimensions(null,null),this._options.inlinePosition&&(this._element.style.left=null,this._element.style.top=null,this._element.style.bottom=null),this._wrapper.style.height=null,this._wrapper.style.width=null,this._dims=null},_onResize:function(){this._dims=null,this._onScroll()},_getDims:function(){if(null!==this._dims)return this._dims;var a=this._element.style,b=a.position,d=a.width;a.position="static",a.width=null;var e=c.outerDimensions(this._element),f=this._wrapper.getBoundingClientRect();return this._dims={height:e[1],width:e[0],left:f.left+c.scrollWidth(),top:f.top+c.scrollHeight()},a.position=b,a.width=d,this._dims},_inlineDimensions:function(a,b){this._options.inlineDimensions&&(this._element.style.height=a,this._element.style.width=b)},_getBottomOffset:function(){var a=this._options.offsetBottom;return this._options.bottomElement&&(a+=c.pageHeight()-c.offsetTop(this._options.bottomElement)),a}},a.createUIComponent(e),e}),Ink.createModule("Ink.UI.Swipe","1",["Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.UI.Common_1"],function(a,b,c){"use strict";function d(){"function"==typeof arguments[1]&&(arguments[1]={onEnd:arguments[1]}),c.BaseUIComponent.apply(this,arguments)}return d._name="Swipe_1",d._optionDefinition={onEnd:["Function",void 0],onStart:["Function",void 0],onMove:["Function",void 0],minDist:["Number",void 0],maxDist:["Number",void 0],minDuration:["Number",void 0],maxDuration:["Number",void 0],axis:["String",void 0],storeGesture:["Boolean",!1],stopEvents:["Boolean",!0]},d.prototype={_supported:"ontouchstart"in document.documentElement,_init:function(){this._handlers={down:Ink.bindEvent(this._onDown,this),move:Ink.bindEvent(this._onMove,this),up:Ink.bindEvent(this._onUp,this)};var b=document.body;a.observe(b,"touchstart",this._handlers.down),(this._options.storeGesture||this._options.onMove)&&a.observe(b,"touchmove",this._handlers.move),a.observe(b,"touchend",this._handlers.up),this._isOn=!1},_isMeOrParent:function(a,b){if(a){do{if(a===b)return!0;a=a.parentNode}while(a);return!1}},_pushGesture:function(a,b){this._options.storeGesture&&(this._gesture.push(a),this._time.push(b))},_onDown:function(b){1===b.changedTouches.length&&this._isMeOrParent(b.target,this._element)&&(this._options.stopEvents===!0&&a.stop(b),b=b.changedTouches[0],this._isOn=!0,this._target=b.target,this._t0=+new Date,this._p0=[b.pageX,b.pageY],this._options.storeGesture&&(this._gesture=[],this._time=[]),this._pushGesture(this._p0,0),this._options.onStart&&this._options.onStart({event:b,element:this._element,instance:this,position:this._p0,dt:0}))},_onMove:function(b){if(this._isOn&&1===b.changedTouches.length){this._options.stopEvents===!0&&a.stop(b),b=b.changedTouches[0];var c=+new Date,d=c-this._t0,e=[b.pageX,b.pageY];this._pushGesture(e,d),this._options.onMove&&this._options.onMove({event:b,element:this._element,instance:this,position:e,dt:d})}},_onUp:function(b){if(this._isOn&&1===b.changedTouches.length){this._options.stopEvents===!0&&a.stop(b),b=b.changedTouches[0],this._isOn=!1;var c=+new Date,d=[b.pageX,b.pageY],e=c-this._t0,f=[d[0]-this._p0[0],d[1]-this._p0[1]],g=Math.sqrt(f[0]*f[0]+f[1]*f[1]),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",i=this._options;i.minDist&&gi.maxDist||i.minDuration&&ei.maxDuration||i.axis&&h!==i.axis||this._options.onEnd&&this._options.onEnd({event:b,element:this._element,instance:this,gesture:this._gesture,time:this._time,axis:h,overallMovement:f,overallTime:e})}}},c.createUIComponent(d),d}),Ink.createModule("Ink.UI.Table","1",["Ink.Util.Url_1","Ink.UI.Pagination_1","Ink.Net.Ajax_1","Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1","Ink.Util.String_1","Ink.Util.Json_1"],function(a,b,c,d,e,f,g,h,i,j,k){"use strict";function l(a){return!isNaN(a)&&r.test(a)?parseInt(a,10):isNaN(a)?a:parseFloat(a)}function m(a,b){return a===b?0:a>b?1:-1}function n(a,b){var c=l(g.textContent(a)),d=l(g.textContent(b));return m(c,d)}function o(a){if("undefined"!=typeof Object.keys)return Object.keys(a);var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b}function p(){d.BaseUIComponent.apply(this,arguments)}function q(a){return a}var r=/\d/g;return p._name="Table_1",p._optionDefinition={pageSize:["Integer",null],caretUpClass:["String","fa fa-caret-up"],caretDownClass:["String","fa fa-caret-down"],endpoint:["String",null],createEndpointUrl:["Function",null],getDataFromEndPoint:["Function",null],processJSONRows:["Function",q],processJSONRow:["Function",q],processJSONField:["Function",q],processJSONHeaders:["Function",function(a){return a.fields}],processJSONTotalRows:["Function",function(a){return a.length||a.totalRows}],getSortKey:["Function",null],pagination:["Element",null],allowResetSorting:["Boolean",!1],visibleFields:["String",null],tdClassNames:["Object",{}],paginationOptions:["Object",null]},p.prototype={_validate:function(){if("table"!==this._element.nodeName.toLowerCase())throw new Error("[Ink.UI.Table] :: The element is not a table")},_init:function(){this._markupMode=!this._options.endpoint,this._options.visibleFields&&(this._options.visibleFields=this._options.visibleFields.toString().split(/[, ]+/g)),this._thead=this._element.tHead||this._element.createTHead(),this._headers=h.select("th",this._thead),this._handlers={thClick:null},this._originalFields=[],this._sortableFields={},this._originalData=this._data=[],this._pagination=null,this._totalRows=0,this._handlers.thClick=e.observeDelegated(this._element,"click",'thead th[data-sortable="true"]',Ink.bindMethod(this,"_onThClick")),this._markupMode?(this._resetSortOrder(),this._addHeadersClasses(),this._data=h.select("tbody tr",this._element),this._originalData=this._data.slice(0),this._totalRows=this._data.length,this._setPagination()):this._getData()},_addHeadersClasses:function(){for(var a,b,c=0,d=this._headers.length;d>c;c++)a=g.textContent(this._headers[c]),b=this._options.tdClassNames[a],b&&f.addClassName(this._headers[c],b)},_onThClick:function(a){var b=e.element(a),c=void 0!==this._options.pageSize;e.stop(a);var f=i.keyValue(b,this._headers,!0),g=f!==!1&&void 0!==this._sortableFields[f];if(g)if(!this._markupMode&&c)this._invertSortOrder(f,!1);else{"desc"===this._sortableFields[f]&&this._options.allowResetSorting?(this._setSortOrderOfColumn(f,null),this._data=this._originalData.slice(0)):this._invertSortOrder(f,!0);var j=h.select("tbody",this._element)[0];d.cleanChildren(j),i.each(this._data,Ink.bindMethod(j,"appendChild")),this._pagination&&(this._pagination.setCurrent(0),this._paginate(1))}},_invertSortOrder:function(a,b){for(var c="asc"===this._sortableFields[a],d=0,e=this._headers.length;e>d;d++)this._setSortOrderOfColumn(d,null);b&&(this._sort(a),c&&this._data.reverse()),this._setSortOrderOfColumn(a,!c)},_setSortOrderOfColumn:function(a,b){var c=this._headers[a],d=[""],e="none";b===!0?(d=[''],e="asc"):b===!1&&(d=[''],e="desc"),this._sortableFields[a]=e,c.innerHTML=g.textContent(c)+d.join("")},_paginate:function(a){if(this._pagination){var b=this._options.pageSize,c=(a-1)*b,d=c+b;i.each(this._data,function(a,b){b>=c&&d>b?f.removeClassName(a,"hide-all"):f.addClassName(a,"hide-all")})}},_registerFieldNames:function(a){this._originalFields=[],i.forEach(a,Ink.bind(function(a){this._fieldIsVisible(a)&&this._originalFields.push(a)},this))},_fieldIsVisible:function(a){return!this._options.visibleFields||-1!==this._options.visibleFields.indexOf(a)},_sort:function(a){function b(b){return d.call(e,{columnIndex:a,columnName:c,data:g.textContent(b),element:b})}var c=g.textContent(this._headers[a]),d=this._options.getSortKey;d&&(d="function"==typeof d[c]?d[c]:"function"==typeof d?d:null);var e=this;this._data.sort(function(c,e){var f=Ink.ss("td",c)[a],g=Ink.ss("td",e)[a];return d?m(b(f),b(g)):n(f,g,a)})},_createHeadersFromJson:function(a){if(this._registerFieldNames(o(a)),!this._thead.children.length)for(var b=this._thead.insertRow(0),c,d=0,e=a.length;e>d;d++)this._fieldIsVisible(a[d])&&(c=g.create("th"),c=this._createSingleHeaderFromJson(a[d],c),b.appendChild(c),this._headers.push(c))},_createSingleHeaderFromJson:function(a,b){return a.sortable&&b.setAttribute("data-sortable","true"),a.label&&g.setTextContent(b,a.label),b},_resetSortOrder:function(){for(var a=0,b=this._headers.length;b>a;a++){var c=g.data(this._headers[a]);c.sortable&&"true"===c.sortable.toString()&&(this._sortableFields[a]="none")}},_createRowsFromJSON:function(a){var b=h.select("tbody",this._element)[0];b?g.setHTML(b,""):(b=document.createElement("tbody"),this._element.appendChild(b)),this._data=[];var c;for(var d in a)a.hasOwnProperty(d)&&(c=this._options.processJSONRow(a[d]),this._createSingleRowFromJson(b,c,d));this._originalData=this._data.slice(0)},_createSingleRowFromJson:function(a,b,c){var d=document.createElement("tr");a.appendChild(d);for(var e in b)b.hasOwnProperty(e)&&this._createFieldFromJson(d,b[e],e,c);this._data.push(d)},_createFieldFromJson:function(a,b,c,d){if(this._fieldIsVisible(c)){var e=this._options.processJSONField[c]||this._options.processJSONField,g;g="function"==typeof e?e(b,c,d):b;var h=this._elOrFieldData(g),i=this._options.tdClassNames[c];i&&f.addClassName(h,i),a.appendChild(h)}},_elOrFieldData:function(a){if(d.isDOMElement(a))return a;var b="string"==typeof a,c="number"==typeof a,e=g.create("td");if(b&&/^\s*? li.active",this._menu),g=0,h=f.length;h>g;g++)f[g]!==a&&c.removeClassName(f[g],"active");return this._activeMenuTab&&(c.removeClassName(this._activeMenuTab,"active"),c.removeClassName(this._activeSection,"active"),c.addClassName(this._activeSection,"hide-all")),this._activeMenuLink=a,this._activeMenuTab=this._activeMenuLink.parentNode,this._activeSection=e.select(d.substr(d.indexOf("#")),this._element)[0],this._activeSection?(c.addClassName(this._activeMenuTab,"active"),c.addClassName(this._activeSection,"active"),c.removeClassName(this._activeSection,"hide-all"),void(b&&"undefined"!=typeof this._options.onChange&&this._options.onChange(this))):void(this._activeMenuLink=this._activeMenuTab=this._activeSection=null)},_onTabClickedGeneric:function(a){a.preventDefault(),c.hasClassName(a.currentTarget,"ink-disabled")||this._onTabClicked(a.currentTarget)},_onTabClicked:function(a){var b=a.getAttribute("href");b=b.substr(b.indexOf("#")),b&&null!==Ink.i(this._dehashify(b))&&(this._options.preventUrlChange||(window.location.hash=b),a!==this._activeMenuLink&&this.changeTab(a))},_onResize:function(){var b=a.currentLayout();if(b!==this._lastLayout){var d=b===a.Layouts.TINY||b===a.Layouts.SMALL||b===a.Layouts.MEDIUM;d?(c.removeClassName(this._menu,"menu"),c.removeClassName(this._menu,"horizontal")):(c.addClassName(this._menu,"menu"),c.addClassName(this._menu,"horizontal")),this._lastLayout=b}},_hashify:function(a){return a?0===a.indexOf("#")?a:"#"+a:""},_dehashify:function(a){return a?(""+a).replace(/^#/,""):""},_findLinkByHref:function(a){if(!a)return null;if(1===a.nodeType){if(d.isAncestorOf(a,this._element))return null;for(var b=e.select("a",this._menu),c=a.getAttribute("id"),f=0,g=b.length;g>f;f++){if(b[f]===a||d.isAncestorOf(a,b[f]))return b[f];if(c&&c===this._dehashify(b[f].getAttribute("href")))return b[f]}return null}return a=this._hashify(a),e.select('a[href$="'+a+'"]',this._menu)[0]||null},changeTab:function(a){a=this._findLinkByHref(a),a&&!c.hasClassName(a,"ink-disabled")&&this._changeTab(a,!0)},disable:function(a){c.addClassName(this._findLinkByHref(a),"ink-disabled")},enable:function(a){c.removeClassName(this._findLinkByHref(a),"ink-disabled")},activeTab:function(){return this._activeSection.getAttribute("id")},activeMenuTab:function(){return Ink.warn("Ink.UI.Tabs.activeMenuTab() is deprecated"),this._activeMenuTab},activeMenuLink:function(){return this._activeMenuLink},activeSection:function(){return this._activeSection},activeContentTab:function(){return Ink.warn("Ink.UI.Tabs.activeContentTab() is deprecated. Use activeSection instead."),this._activeSection()},destroy:a.destroyComponent},a.createUIComponent(f),f}),Ink.createModule("Ink.UI.TagField","1",["Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Browser_1","Ink.UI.Droppable_1","Ink.Util.Array_1","Ink.Dom.Selector_1","Ink.UI.Common_1"],function(a,b,c,d,e,f,g,h){"use strict";function i(){h.BaseUIComponent.apply(this,arguments)}var j=13,k=8,l=function(a){return!!a};return i._name="TagField_1",i._optionDefinition={tags:["String",[]],tagQuery:["Object",null],tagQueryAsync:["Object",null],allowRepeated:["Boolean",!1],maxTags:["Integer",-1],outSeparator:["String",","],separator:["String",/[,; ]+/g],autoSplit:["Boolean",!0]},i.prototype={_init:function(){var d=this._options;"string"==typeof d.separator&&(d.separator=new RegExp(d.separator,"g")),"string"==typeof d.tags&&(d.tags=this._readInput(d.tags)),c.addClassName(this._element,"hide-all"),this._viewElm=a.create("div",{className:"ink-tagfield",insertAfter:this._element}),this._input=a.create("input",{type:"text",className:"new-tag-input",insertBottom:this._viewElm});var e=[].concat(d.tags,this._tagsFromMarkup(this._element));this._tags=[],f.each(e,Ink.bindMethod(this,"_addTag")),b.observe(this._input,"keyup",Ink.bindEvent(this._onKeyUp,this)),b.observe(this._input,"change",Ink.bindEvent(this._onKeyUp,this)),b.observe(this._input,"keydown",Ink.bindEvent(this._onKeyDown,this)),b.observe(this._input,"blur",Ink.bindEvent(this._onBlur,this)),b.observe(this._viewElm,"click",Ink.bindEvent(this._refocus,this))},destroy:function(){a.remove(this._viewElm),c.removeClassName(this._element,"hide-all")},_tagsFromMarkup:function(b){var c=b.tagName.toLowerCase();if("input"===c)return this._readInput(b.value);if("select"===c)return f.map(b.getElementsByTagName("option"),function(b){return a.textContent(b)});throw new Error("Cannot read tags from a "+c+" tag. Unknown tag")},_tagsToMarkup:function(b,c){var d=c.tagName.toLowerCase();if("input"===d)this._options.separator&&(c.value=b.join(this._options.outSeparator));else{if("select"!==d)throw new Error("TagField: Cannot read tags from a "+d+" tag. Unknown tag");c.innerHTML="",f.each(b,function(b){var d=a.create("option",{selected:"selected"});a.setTextContent(d,b),c.appendChild(d)})}},_addTag:function(c){if(!(-1!==this._options.maxTags&&this._tags.length>=this._options.maxTags)){if(!this._options.allowRepeated&&f.inArray(c,this._tags,c)||!c)return!1;var d=a.create("span",{className:"ink-tag",setTextContent:c+" "}),e=a.create("span",{className:"remove fa fa-times",insertBottom:d});b.observe(e,"click",Ink.bindEvent(this._removeTag,this,null));var g=document.createTextNode(" ");this._tags.push(c),this._viewElm.insertBefore(d,this._input),this._viewElm.insertBefore(g,this._input),this._tagsToMarkup(this._tags,this._element)}},_readInput:function(a){return this._options.separator?f.filter(a.split(this._options.separator),l):[a]},_onKeyUp:function(){if(this._options.autoSplit){var a=this._input.value.split(this._options.separator);if(!(a.length<=1)){var b=a[a.length-1];a=a.splice(0,a.length-1),a=f.filter(a,l),f.each(a,Ink.bind(this._addTag,this)),this._input.value=b}}},_onKeyDown:function(a){return a.which===j?this._onEnterKeyDown(a):a.which===k?this._onBackspaceKeyDown():void(this._removeConfirm&&this._unsetRemovingVisual(this._tags.length-1))},_onBackspaceKeyDown:function(){this._input.value||(this._removeConfirm?(this._unsetRemovingVisual(this._tags.length-1),this._removeTag(this._tags.length-1),this._removeConfirm=null):this._setRemovingVisual(this._tags.length-1))},_onEnterKeyDown:function(a){var c=this._input.value;c&&(this._addTag(c),this._input.value=""),b.stopDefault(a)},_onBlur:function(){this._addTag(this._input.value),this._input.value=""},_setRemovingVisual:function(a){var d=this._viewElm.children[a];d&&(c.addClassName(d,"tag-deleting"),this._removeRemovingVisualTimeout=setTimeout(Ink.bindMethod(this,"_unsetRemovingVisual",a),4e3),b.observe(this._input,"blur",Ink.bindMethod(this,"_unsetRemovingVisual",a)),this._removeConfirm=!0)},_unsetRemovingVisual:function(a){var b=this._viewElm.children[a];b&&(c.removeClassName(b,"tag-deleting"),clearTimeout(this._removeRemovingVisualTimeout)),this._removeConfirm=null},_removeTag:function(c){var d;if("object"==typeof c){var e=b.element(c).parentNode;d=a.parentIndexOf(this._viewElm,e)}else"number"==typeof c&&(d=c);this._tags=f.remove(this._tags,d,1),a.remove(this._viewElm.children[d]),this._tagsToMarkup(this._tags,this._element)},_refocus:function(a){return this._input.focus(),b.stop(a),!1}},h.createUIComponent(i),i}),Ink.createModule("Ink.UI.Toggle","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(a,b,c,d,e,f){"use strict";function g(){a.BaseUIComponent.apply(this,arguments)}return g._name="Toggle_1",g._optionDefinition={target:["Elements"],triggerEvent:["String","click"],closeOnClick:["Boolean",!0],isAccordion:["Boolean",!1],initialState:["Boolean",null],classNameOn:["String","show-all"],classNameOff:["String","hide-all"],closeOnInsideClick:["String","a[href]"],onChangeState:["Function",null]},g.prototype={_init:function(){var b,d;if(this._targets=a.elsOrSelector(this._options.target),this._options.closeOnClick="true"===this._options.closeOnClick.toString(),this._options.initialState=null!==this._options.initialState?"true"===this._options.initialState.toString():"none"!==c.getStyle(this._targets[0],"display"),"show-all"!==this._options.classNameOn||"hide-all"!==this._options.classNameOff)for(b=0,d=this._targets.length;d>b;b++)c.removeClassName(this._targets[b],"show-all"),c.removeClassName(this._targets[b],"hide-all");if(this._accordion=c.hasClassName(this._element.parentNode,"accordion")||c.hasClassName(this._targets[0].parentNode,"accordion"),this._firstTime=!0,this._bindEvents(),null!==this._options.initialState)this.setState(this._options.initialState,!0);else{var e="none"!==c.getStyle(this._targets[0],"display");this.setState(e,!0)}for(b=0,d=this._targets.length;d>b;b++)this._targets[b].style.display&&(this._targets[b].style.display="");this._element.setAttribute("data-is-toggle-trigger","true")},_bindEvents:function(){if(this._options.triggerEvent&&b.observe(this._element,this._options.triggerEvent,Ink.bind(this._onTriggerEvent,this)),this._options.closeOnClick&&b.observe(document,"click",Ink.bind(this._onOutsideClick,this)),this._options.closeOnInsideClick&&"false"!==this._options.closeOnInsideClick){var a=this._options.closeOnInsideClick;"true"===a.toString()&&(a="*"),b.observeMulti(this._targets,"click",Ink.bind(function(c){d.findUpwardsBySelector(b.element(c),a)&&this.setState(!1,!0)},this))}},_onTriggerEvent:function(a){var c=b.element(a),e=f.some(this._targets,function(a){return a===c||d.isAncestorOf(a,c)});if(!e){this._accordion&&this._updateAccordion();var g=this.getState();this.setState(!g,!0),!g&&this._firstTime&&(this._firstTime=!1),b.stopDefault(a)}},_updateAccordion:function(){var a,b;b=c.hasClassName(this._targets[0].parentNode,"accordion")?this._targets[0].parentNode:this._targets[0].parentNode.parentNode,a=e.select(".toggle, .ink-toggle",b);for(var f=0;f0&&h[0]!==this._targets[0]&&(h[0].style.display="none")}},_onOutsideClick:function(a){var c=b.element(a),e;if(!d.findUpwardsBySelector(c,'[data-is-toggle-trigger="true"]')){var g=f.some(this._targets,function(a){return d.isAncestorOf(a,c)||a===c});if(this._element!==c&&!d.isAncestorOf(this._element,c)&&!g){if((e=Ink.ss(".ink-shade")).length)for(var h=e.length,i=0;h>i;i++)if(d.isAncestorOf(e[i],c)&&d.isAncestorOf(e[i],this._element))return;this.setState(!1,!0)}}},setState:function(a,b){if(a!==this.getState()){if(b&&"function"==typeof this._options.onChangeState){var d=this._options.onChangeState(a);if(d===!1)return!1}for(var e=0,f=this._targets.length;f>e;e++)c.addRemoveClassName(this._targets[e],this._options.classNameOn,a),c.addRemoveClassName(this._targets[e],this._options.classNameOff,!a);c.addRemoveClassName(this._element,"active",a)}},getState:function(){return c.hasClassName(this._element,"active")}},a.createUIComponent(g),g}),Ink.createModule("Ink.UI.Tooltip","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1","Ink.Dom.Css_1","Ink.Dom.Browser_1"],function(a,b,c,d,e,f){"use strict";function g(a,b){this._init(a,b||{})}function h(a,b){this._init(a,b)}var i,j,k;!function(){for(var a=document.createElement("DIV"),b=["transition","oTransition","msTransition","mozTransition","webkitTransition"],c=0;ce;e++)this.tooltips[e]=new h(this,c[e])},destroy:function(){e.each(this.tooltips,function(a){a._destroy()}),this.tooltips=null,this.options=null}},h.prototype={_oppositeDirections:{left:"right",right:"left",up:"down",down:"up"},_init:function(c,d){b.observe(d,"mouseover",Ink.bindEvent(this._onMouseOver,this)),b.observe(d,"mouseout",Ink.bindEvent(this._onMouseOut,this)),b.observe(d,"mousemove",Ink.bindEvent(this._onMouseMove,this)),this.root=c,this.element=d,this._delayTimeout=null,this.tooltip=null,a.registerInstance(this,this.element)},_makeTooltip:function(a){if(!this._getOpt("text")&&!this._getOpt("html")&&!c.hasAttribute(this.element,"title"))return!1;var d=this._createTooltipElement();this.tooltip&&this._removeTooltip(),this.tooltip=d,this._fadeInTooltipElement(d),this._placeTooltipElement(d,a),b.observe(d,"mouseover",Ink.bindEvent(this._onTooltipMouseOver,this));var e=this._getFloatOpt("timeout");e&&setTimeout(Ink.bind(function(){this.tooltip===d&&this._removeTooltip()},this),1e3*e)},_createTooltipElement:function(){var b=this._getOpt("template"),e=this._getOpt("templatefield"),g,h;if(b){var i=document.createElement("DIV");if(i.innerHTML=a.elOrSelector(b,"options.template").outerHTML,g=i.firstChild,e){if(h=d.select(e,g),!h)throw"options.templatefield must be a valid selector within options.template";h=h[0]}else h=g}else g=document.createElement("DIV"),f.addClassName(g,"ink-tooltip"),f.addClassName(g,this._getOpt("color")),h=document.createElement("DIV"),f.addClassName(h,"content"),g.appendChild(h);return this._getOpt("html")?h.innerHTML=this._getOpt("html"):this._getOpt("text")?c.setTextContent(h,this._getOpt("text")):c.setTextContent(h,this.element.getAttribute("title")),g.style.display="block",g.style.position="absolute",g.style.zIndex=this._getIntOpt("zIndex"),g},_fadeInTooltipElement:function(a){var b=this._getFloatOpt("fade");i&&b&&(a.style.opacity="0",a.style[i]=b+"s",a.style[j]="opacity",a.style[k]="ease-in-out",setTimeout(function(){a.style.opacity="1"},0))},_placeTooltipElement:function(a,b){var d=this._getOpt("where");if("mousemove"===d||"mousefix"===d){var e=b;this._setPos(e[0],e[1]),m.appendChild(a)}else if(d.match(/(up|down|left|right)/)){m.appendChild(a);var g=c.offset(this.element),h=g[0],i=g[1],j=c.elementWidth(this.element)/2-c.elementWidth(a)/2,k=c.elementHeight(this.element)/2-c.elementHeight(a)/2,l=this._getIntOpt("spacing"),n=c.elementDimensions(a),o=c.elementDimensions(this.element),p=c.scrollWidth()+c.viewportWidth(),q=c.scrollHeight()+c.viewportHeight(); +d=this._getWhereValueInsideViewport(d,{left:h-n[0],right:h+n[0],top:i+n[1],bottom:i+n[1]},{right:p,bottom:q}),"up"===d?(i-=n[1],i-=l,h+=j):"down"===d?(i+=o[1],i+=l,h+=j):"left"===d?(h-=n[0],h-=l,i+=k):"right"===d&&(h+=o[0],h+=l,i+=k);var r=null;d.match(/(up|down|left|right)/)&&(r=document.createElement("SPAN"),f.addClassName(r,"arrow"),f.addClassName(r,this._oppositeDirections[d]),a.appendChild(r));var s=h,t=i,u=t+n[1]-q,v=s+n[0]-p,w=0-s,x=0-t;u>0?(r&&(r.style.top=n[1]/2+u+"px"),t-=u):x>0?(r&&(r.style.top=n[1]/2-x+"px"),t+=x):v>0?(r&&(r.style.left=n[0]/2+v+"px"),s-=v):w>0&&(r&&(r.style.left=n[0]/2-w+"px"),s+=w),a.style.left=s+"px",a.style.top=t+"px"}},_getWhereValueInsideViewport:function(a,b,c){return"left"===a&&b.left<0?"right":"right"===a&&b.right>c.right?"left":"up"===a&&b.top<0?"down":"down"===a&&b.bottom>c.bottom?"up":a},_removeTooltip:function(){var a=this.tooltip;if(a){var b=Ink.bind(c.remove,{},a);"mousemove"!==this._getOpt("where")&&i?(a.style.opacity=0,setTimeout(b,1e3*this._getFloatOpt("fade"))):b(),this.tooltip=null}},_getOpt:function(a){var b=c.data(this.element)[c._camelCase("tip-"+a)];if(b)return b;var d=this.root.options[a];return"undefined"!=typeof d?d:void 0},_getIntOpt:function(a){return parseInt(this._getOpt(a),10)},_getFloatOpt:function(a){return parseFloat(this._getOpt(a),10)},_destroy:function(){this.tooltip&&c.remove(this.tooltip),this.root=null,this.element=null,this.tooltip=null},_onMouseOver:function(a){var b=this._getMousePosition(a),c=this._getFloatOpt("delay");c?this._delayTimeout=setTimeout(Ink.bind(function(){this.tooltip||this._makeTooltip(b),this._delayTimeout=null},this),1e3*c):this._makeTooltip(b)},_onMouseMove:function(a){if("mousemove"===this._getOpt("where")&&this.tooltip){var b=this._getMousePosition(a);this._setPos(b[0],b[1])}},_onMouseOut:function(){this._getIntOpt("forever")||this._removeTooltip(),this._delayTimeout&&(clearTimeout(this._delayTimeout),this._delayTimeout=null)},_onTooltipMouseOver:function(){this.tooltip&&this._removeTooltip()},_setPos:function(a,b){a+=this._getIntOpt("left"),b+=this._getIntOpt("top");var d=this._getPageXY();if(this.tooltip){var e=[c.elementWidth(this.tooltip),c.elementHeight(this.tooltip)],f=this._getScroll();e[0]+a-f[0]>=d[0]-20&&(a=a-e[0]-this._getIntOpt("left")-10),e[1]+b-f[1]>=d[1]-20&&(b=b-e[1]-this._getIntOpt("top")-10),this.tooltip.style.left=a+"px",this.tooltip.style.top=b+"px"}},_getPageXY:function(){var a=0,b=0;return"number"==typeof window.innerWidth?(a=window.innerWidth,b=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(a=document.documentElement.clientWidth,b=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(a=document.body.clientWidth,b=document.body.clientHeight),[parseInt(a,10),parseInt(b,10)]},_getScroll:function(){var a=document.documentElement,b=document.body;return a&&(a.scrollLeft||a.scrollTop)?[a.scrollLeft,a.scrollTop]:b?[b.scrollLeft,b.scrollTop]:[0,0]},_getMousePosition:function(a){return[parseInt(b.pointerX(a),10),parseInt(b.pointerY(a),10)]}},g}),Ink.createModule("Ink.UI.TreeView","1",["Ink.UI.Common_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(a,b,c,d,e,f){"use strict";function g(){a.BaseUIComponent.apply(this,arguments)}return g._name="TreeView_1",g._optionDefinition={node:["String","li"],child:["String",null],children:["String","ul"],parentClass:["String","parent"],openNodeClass:["String","open"],openClass:["String","fa fa-minus-circle"],closedClass:["String","fa fa-plus-circle"],hideClass:["String","hide-all"],iconTag:["String","i"],stopDefault:["Boolean",!0]},g.prototype={_init:function(){this._options.child&&(Ink.warn("Ink.UI.TreeView: options.child is being renamed to options.children."),this._options.children=this._options.child),this._handlers={click:Ink.bindEvent(this._onClick,this)},b.on(this._element,"click",this._options.node,this._handlers.click),f.each(Ink.ss(this._options.node,this._element),Ink.bind(function(a){if(this.isParent(a)){c.addClassName(a,this._options.parentClass);var b=this.isOpen(a);this._getIcon(a)||d.create(this._options.iconTag,{insertTop:a}),this._setNodeOpen(a,b)}},this))},_getIcon:function(a){return Ink.s("> "+this._options.iconTag,a)},isOpen:function(a){if(!this._getChild(a))throw new Error("not a node!");return"true"===d.data(a).open||c.hasClassName(a,this._options.openNodeClass)},isParent:function(a){return c.hasClassName(a,this._options.parentClass)||null!=this._getChild(a)},_setNodeOpen:function(a,b){var d=this._getChild(a);if(d){c.setClassName(d,this._options.hideClass,!b);var e=this._getIcon(a);a.setAttribute("data-open",b);var f=b?this._options.openClass:this._options.closedClass,g=b?this._options.closedClass:this._options.openClass;c.removeClassName(e,g),c.addClassName(e,f),c.setClassName(a,this._options.openNodeClass,b)}else Ink.error("Ink.UI.TreeView: node",a,"is not a node!")},open:function(a){this._setNodeOpen(a,!0)},close:function(a){this._setNodeOpen(a,!1)},toggle:function(a){this.isOpen(a)?this.close(a):this.open(a)},_getChild:function(a){return e.select(this._options.children,a)[0]||null},_onClick:function(a){!this.isParent(a.currentTarget)||e.matchesSelector(a.target,this._options.node)||e.matchesSelector(a.target,this._options.children)||(this._options.stopDefault&&a.preventDefault(),this.toggle(a.currentTarget))}},a.createUIComponent(g),g}),Ink.createModule("Ink.UI.Upload","1",["Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Browser_1","Ink.UI.Common_1"],function(a,b,c,d){"use strict";var e=function(a){this.init(a)};e.prototype={init:function(a){this._options=Ink.extendObj({entry:void 0,maxDepth:10},a||{});try{this._read()}catch(b){Ink.error(b)}},_read:function(){if(!this._options.entry)return void Ink.error("You must specify the entry!");try{this._readDirectories()}catch(a){Ink.error(a)}},_readDirectories:function(){var a=[],b=!1,c=0,d=Ink.bind(function(e){var f=e.createReader();b=!0,f.readEntries(Ink.bind(function(e){if(e.length>0){for(var f=0,g=e.length;g>f;f++)a.push(e[f]),e[f].isDirectory&&(c=this.clearArray(e[f].fullPath.split("/")),c.shift(),c=c.length,c<=this._options.maxDepth&&d(e[f]));this._stopActivityTimeout&&clearTimeout(this._stopActivityTimeout),this._stopActivityTimeout=setTimeout(function(){b=!1},250)}e.length||(b=!1)},this),Ink.bind(function(a){this._options.readError(a,e)},this))},this);d(this._options.entry);var e,f=function(){return b?!1:(clearInterval(e),this._options.readComplete&&"function"==typeof this._options.readComplete&&this._options.readComplete(a),!0)};e=setInterval(Ink.bind(f,this),250)},clearArray:function(a){for(var b=a.length-1;b>=0;b--)("undefined"==typeof a[b]||null===a[b]||""===a[b])&&a.splice(b,1);return a}};var f={lists:[],items:[],create:function(a){var b;return a=String(a),this.lists.push({name:a}),b=this.lists.length-1},getItems:function(a){if(!a)return this.items;for(var b=[],c=0,d=this.items.length;d>c;c++)this.items[c].parentId===a&&b.push(this.items[c]);return b},purge:function(a,b){if("number"!=typeof a||isNaN(Number(a)))return!1;try{for(var c=this.items.length;c>=0;c--)this.items[c]&&a===this.items[c].parentId&&this.remove(this.items[c].parentId,this.items[c].pid);return b||this.lists.splice(a,1),!0}catch(d){return Ink.error("Purge: invalid id"),!1}},add:function(a,b,c){if(!this.lists[a])return!1;"object"!=typeof b&&(b=String(b));var d=parseInt(Math.round(1e5*Math.random())+""+Math.round(1e5*Math.random()),10);return c=c||0,this.items.push({parentId:a,item:b,priority:c||0,pid:d}),d},view:function(a,b){var c=this._searchByPid(a,b);return c===!1?!1:this.items[c]},remove:function(a,b){try{var c=this._searchByPid(a,b);return c===!1?!1:(this.items.splice(c,1),!0)}catch(d){return Ink.error("Remove: invalid id"),!1}},_searchByPid:function(a,b){if(!a&&"boolean"==typeof a||!b)return!1;if(a=parseInt(a,10),b=parseInt(b,10),isNaN(a)||isNaN(b))return!1;for(var c=0,d=this.items.length;d>c;c++)if(this.items[c].parentId===a&&this.items[c].pid===b)return c;return!1}},g=function(a){this.Upload=a,this.init()};g.prototype={init:function(){this._fileButton=this.Upload._options.fileButton,this._dropzone=this.Upload._options.dropzone,this._setDropEvent(),this._setFileButton()},_setDropEvent:function(){var a=this._dropzone;if(a)for(var b=0,c=a.length;c>b;b++)a[b].ondrop=Ink.bindEvent(this.Upload._dropEventHandler,this.Upload),a[b].ondragleave=Ink.bindEvent(this._onDragLeave,this),a[b].ondragend=Ink.bindEvent(this._onDragEndEventHandler,this),a[b].ondragdrop=Ink.bindEvent(this._onDragEndEventHandler,this),a[b].ondragenter=Ink.bindEvent(this._onDragEnterHandler,this),a[b].ondragover=Ink.bindEvent(this._onDragOverHandler,this)},_onDragEnterHandler:function(a){return a&&a.stopPropagation&&a.stopPropagation(),a&&a.preventDefault&&a.preventDefault(),a&&(a.returnValue=!1),this.Upload.publish("DragEnter",a),!1},_onDragOverHandler:function(a){return a?(a.preventDefault(),a.stopPropagation(),a.returnValue=!1,!0):!1},_onDragLeave:function(a){return this.Upload.publish("DragLeave",a)},_onDragEndEventHandler:function(a){return this.Upload.publish("DragEnd",a)},_setFileButton:function(){var b=this._fileButton;b&&a.observeMulti(b,"change",Ink.bindEvent(this._fileChangeHandler,this))},_fileChangeHandler:function(c){var d=a.element(c),e=d.files,f=b.findUpwardsByTag(d,"form");return e&&window.FormData&&"withCredentials"in new XMLHttpRequest?(this.Upload._addFilesToQueue(e),void(d.value="")):(f.parentNode.submit(),!1)}};var h=function(a){this.Queue=f,this.init(a),this._events={}};return h.prototype={init:function(a){if("string"==typeof a&&(a=b.data(d.elOrSelector(a,"1st argument"))),this._options=Ink.extendObj({dropzone:void 0,fileButton:void 0,fileFormName:"Ink_Filelist",endpoint:"",maxFilesize:300<<20,INVALID_FILE_NAME:void 0,extraData:{},useChunks:!1,chunkSize:4194304,minSizeToUseChunks:20971520,endpointChunk:"",endpointChunkCommit:"",foldersEnabled:!1,directoryMaxDepth:10},a||{}),this._queueId=f.create("Ink_UPLOAD"),this._queueRunning=!1,this._folders={},this._options.dropzone&&(this._options.dropzone=d.elsOrSelector(this._options.dropzone,"Ink.UI.Upload - dropzone")),this._options.fileButton&&(this._options.fileButton=d.elsOrSelector(this._options.fileButton,"Ink.UI.Upload - fileButton")),!this._options.dropzone&&!this._options.fileButton)throw new TypeError("Ink.UI.Upload: Specify a fileButton or a Dropzone!");new g(this)},_supportChunks:function(a){return this._options.useChunks&&"Blob"in window&&(new Blob).slice&&a>this._options.minSizeToUseChunks},_dropEventHandler:function(b){a.stop(b),this.publish("DropComplete",b.dataTransfer);var c=b.dataTransfer;if(!c||!c.files||!c.files.length)return!1;if(this._files=c.files,this._files=Array.prototype.slice.call(this._files||[],0),c.items&&c.items[0]&&c.items[0].webkitGetAsEntry){if(!this._options.foldersEnabled)return setTimeout(Ink.bind(this._addFilesToQueue,this,this._files),0);for(var d,e=[],f=b.dataTransfer.items.length-1;f>=0;f--)d=b.dataTransfer.items[f].webkitGetAsEntry(),d&&d.isDirectory&&(e.push(d),this._files[f].isDirectory=!0,this._files.splice(f,1));this._addFolderToQueue(e,Ink.bind(function(){setTimeout(Ink.bind(this._addFilesToQueue,this,this._files),0)},this))}else setTimeout(Ink.bind(this._addFilesToQueue,this,this._files),0);return!0},_addFolderToQueue:function(a,b){var c=[],d={};if(!a||!a.length)return b(),c;var f=function(a){for(var b=[],c=0,d=a.length;d>c;c++)a[c].isFile&&b.push(a[c]);return b},g=function(a,b){var d;return b=b||0,this._files[b]?"fileentry"!==this._files[b].constructor.name.toLowerCase()?g.apply(this,[a,++b]):void this._files[b].file(Ink.bind(function(c){d=this._files[b].fullPath,this._files[b]=c,this._files[b].hasParent=!0,this._files[b].fullPath||(this._files[b].fullPath=d),g.apply(this,[a,++b])},this),Ink.bind(function(){this._files.splice(b,1),g.apply(this,[a,b])},this)):(a(),c)},h=Ink.bind(function(i){return a[i]?void new e({entry:a[i],maxDepth:this._options.directoryMaxDepth,readComplete:Ink.bind(function(b){if(c=c.concat(f(b)),a[i]&&!(a[i].fullPath in this._folders)){this._folders[a[i].fullPath]={items:b,files:c,length:b.length,created:!1,root:!0};for(var e=0,g=b.length;g>e;e++)b[e].isFile||(b[e].fullPath in d?delete d[b[e].fullPath]:this._folders[b[e].fullPath]={created:!1,root:!1});h(++i)}},this),readError:Ink.bind(function(a,b){d[b.fullPath]={},d[b.fullPath].error=a},this)}):(this._files=this._files.concat(c),g.call(this,b),!1)},this);return h(0),c},_addFilesToQueue:function(a){for(var b,d,e,g=0,h=a.length;h>g;g++)b=a[g],b.isDirectory||null!==b&&(b.type||b.size%4096!==0||c.CHROME&&this._options.foldersEnabled)?b.size>this._options.maxFilesize?this.publish("MaxSizeFailure",b,this._options.maxFilesize):(d=parseInt(Math.round(1e5*Math.random())+""+Math.round(1e5*Math.random()),10),e={id:g,data:b,fileID:d,directory:b.isDirectory},f.add(this._queueId,e),this.publish("FileAddedToQueue",e)):this.publish("InvalidFile",b,"size");this._processQueue(!0),this._files=[]},_processQueue:function(a){if(this._queueRunning)return!1;this.running=0;var b=1,c=0,d,e=f.items.length;this._queueRunning=!0,this.interval=setInterval(Ink.bind(function(){if(f.items.length===c&&0===this.running&&(f.purge(this._queueId,!0),this._queueRunning=!1,clearInterval(this.interval),this.publish("QueueEnd",this._queueId,e)),d=f.getItems(this._queueId),this.runningb.chunk_offset){if(c.response){var e=JSON.parse(c.response),f=b.chunk_offset&&e.offset!==b.chunk_offset+this._options.chunkSize&&b.size!==e.offset;f?(a.cb&&a.cb(),this.publish("ErrorUpload",b,d)):(b.chunk_upload_id=e.upload_id,b.chunk_offset=e.offset,b.chunk_expires=e.expires,this._upload(a))}else a.cb&&a.cb(),this.publish("ErrorUpload",b,d);return c=null}return a.cb&&a.cb(),c.responseText&&c.status<400?this.publish("EndUpload",b,d,c.responseText):this.publish("ErrorUpload",b,d),c=null},this),c.onerror=Ink.bindEvent(function(){a.cb&&a.cb(),this.publish("ErrorUpload",b,d)},this),c.onabort=Ink.bindEvent(function(){a.cb&&a.cb(),this.publish("AbortUpload",b,d,{abortAll:Ink.bind(this.abortAll,this),abortOne:Ink.bind(this.abortOne,this)})},this)},abortAll:function(){return this._queueRunning?(clearInterval(this.interval),this._queueRunning=!1,f.purge(this._queueId,!0),!0):!1},abortOne:function(a,b){for(var c=f.getItems(0),d,e=0,g=c.length;g>e;e++)if(c[e].item.fileID===a)return d={id:c[e].item.fileID,name:c[e].item.data.name,size:c[e].item.data.size,hasParent:c[e].item.data.hasParent},f.remove(0,c[e].pid),b&&b(d),!0;return!1},subscribe:function(a,b){return this._events[a]||(this._events[a]=[]),this._events[a].push(b),this._events[a]},publish:function(a){var b=this._events[a],c=Array.prototype.slice.call(arguments||[],0);if(b)for(var d=0,e=b.length;e>d;d++)try{b[d].apply(this,c.splice(1,c.length))}catch(f){Ink.error(a+": "+f)}}},h}); +//# sourceMappingURL=ink-ui.min.map \ No newline at end of file diff --git a/public/js/ink-ui.min.map b/public/js/ink-ui.min.map new file mode 100644 index 0000000..933b5e4 --- /dev/null +++ b/public/js/ink-ui.min.map @@ -0,0 +1 @@ +{"version":3,"file":"ink-ui.min.js","sources":["../../src/js/Ink/UI/Animate/1/lib.js","../../src/js/Ink/UI/Carousel/1/lib.js","../../src/js/Ink/UI/Close/1/lib.js","../../src/js/Ink/UI/Common/1/lib.js","../../src/js/Ink/UI/DatePicker/1/lib.js","../../src/js/Ink/UI/Draggable/1/lib.js","../../src/js/Ink/UI/Drawer/1/lib.js","../../src/js/Ink/UI/Dropdown/1/lib.js","../../src/js/Ink/UI/Droppable/1/lib.js","../../src/js/Ink/UI/FormValidator/1/lib.js","../../src/js/Ink/UI/FormValidator/2/lib.js","../../src/js/Ink/UI/ImageQuery/1/lib.js","../../src/js/Ink/UI/LazyLoad/1/lib.js","../../src/js/Ink/UI/Modal/1/lib.js","../../src/js/Ink/UI/Pagination/1/lib.js","../../src/js/Ink/UI/ProgressBar/1/lib.js","../../src/js/Ink/UI/SmoothScroller/1/lib.js","../../src/js/Ink/UI/SortableList/1/lib.js","../../src/js/Ink/UI/Spy/1/lib.js","../../src/js/Ink/UI/Stacker/1/lib.js","../../src/js/Ink/UI/Sticky/1/lib.js","../../src/js/Ink/UI/Swipe/1/lib.js","../../src/js/Ink/UI/Table/1/lib.js","../../src/js/Ink/UI/Tabs/1/lib.js","../../src/js/Ink/UI/TagField/1/lib.js","../../src/js/Ink/UI/Toggle/1/lib.js","../../src/js/Ink/UI/Tooltip/1/lib.js","../../src/js/Ink/UI/TreeView/1/lib.js","../../src/js/Ink/UI/Upload/1/lib.js"],"names":["Ink","createModule","Common","InkEvent","Css","Animate","BaseUIComponent","apply","this","arguments","animationPrefix","el","style","document","createElement","animationEndEventName","animation","oAnimation","msAnimation","webkitAnimation","_name","_optionDefinition","trigger","duration","removeClass","onEnd","prototype","_init","isNaN","parseInt","_options","observe","bind","animate","_element","extendObj","_animationPrefix","animationSupported","element","options","onAnimationEnd","event","target","animationName","removeClassName","removeEventListener","elOrSelector","addClassName","addEventListener","setTimeout","createUIComponent","InkElement","Pagination","Browser","limitRange","n","min","max","Math","Carousel","setTransitionProperty","newTransition","transitionProperty","oTransitionProperty","msTransitionProperty","mozTransitionProperty","webkitTransitionProperty","requestAnimationFrame","window","mozRequestAnimationFrame","webkitRequestAnimationFrame","cb","autoAdvance","axis","initialPage","spaceAfterLastSlide","hideLast","center","keyboardSupport","pagination","onChange","onInit","swipe","_handlers","paginationChange","bindMethod","windowResize","throttle","_isY","ulEl","s","_ulEl","removeTextNodeChildren","_currentPage","refit","whiteSpace","_setUpPagination","_setUpAutoAdvance","_setUpHider","call","size","elm","perpendicular","outerDimensions","_liEls","ss","numSlides","length","contRect","getBoundingClientRect","_ctnLength","bottom","top","right","left","_elLength","_slidesPerPage","floor","isFinite","numPages","ceil","numPagesChanged","_numPages","_deltaLength","_center","_updateHider","_IE7","_pagination","setSize","setPage","getPage","isDOMElement","setCurrent","self","nextPage","hiderEl","create","className","insertBottom","position","_hiderEl","gap","pad","padding","join","IE","version","split","slides","stl","prop","val","i","len","_onTouchStart","touches","_swipeData","x","pointerX","y","pointerY","ulRect","firstUlPos","inUlX","inUlY","_touchMoveIsFirstTouchMove","_onTouchMove","deltaY","abs","deltaX","undefined","_scrolling","_onAnimationFrame","stopDefault","pointerPos","swipeData","elRect","newPos","_onTouchEnd","snapToNext","relProgress","curPage","progressInPages","_onPaginationChange","pgn","_setPage","getCurrent","page","wrap","_lengthToGo","isLastPage","_itemsInLastPage","previousPage","getSlidesPerPage","getTotalPages","getStageElm","getSlidesList","getTotalSlides","Close","body","ev","findUpwardsByClass","toRemove","stop","remove","Ajax","Selector","Url","warnStub","constructor","warn","stub","obj","k","hasOwnProperty","Error","_componentOptions","elementIsOptional","error","elsOrSelector","isValidInstance","_validateInstance","e","registerInstance","_stubInstance","nothing","keys","Object","ret","push","es6WeakMapSupport","instances","WeakMap","domRegistry","get","__InkInstances","set","thing","Layouts","TINY","SMALL","MEDIUM","LARGE","XLARGE","isInteger","fieldName","t","select","required","TypeError","fieldId","defaults","overrides","optionValue","key","type","lType","toLowerCase","defaultVal","invalidThrow","_coerce_funcs","fromDataAttrs","dataAttrs","_coerce_from_string","_options_validate","invalid","quote","out","data","invalidStr","str","replace","paramName","_options_validate_types","elements","object","number","parseFloat","boolean","string","function","integer","types","round","clone","o","JSON","parse","stringify","ex","childIndex","childEl","els","parentNode","f","ajaxJSON","endpoint","params","evalJS","method","parameters","onSuccess","r","responseJSON","status","message","onFailure","currentLayout","v","detectorEl","id","setAttribute","appendChild","children","getStyle","getAttribute","hashSet","hashParams","getAnchorString","location","hash","genQueryString","substring","cleanChildren","parentEl","prevEl","lastChild","previousSibling","removeChild","storeIdAndClasses","fromEl","inObj","_id","classes","_classes","restoreIdAndClasses","toEl","indexOf","_instanceId","_warnDoubleInstantiation","newInstance","getName","getInstance","nameWithoutVersion","inst","unregisterInstance","splice","UIComponent","getInstanceFromSelector","selector","getInstanceIds","res","getInstances","destroyComponent","instance","err","_validate","_validationError","name","getOption","setOption","value","getElement","theConstructor","assert","test","msg","assertProp","propType","propVal","_oldProto","hideF","F","Event","InkArray","InkDate","clamp","dateishFromYMDString","YMD","dateishFromYMD","year","month","day","_year","_month","_day","dateishFromDate","date","getFullYear","getMonth","getDate","DatePicker","autoOpen","cleanText","closeText","pickerField","containerElement","cssClass","dateRange","displayInSelect","dayField","monthField","yearField","format","nextLinkText","ofText","onFocus","onMonthSelected","onSetDate","onYearSelected","prevLinkText","showClean","showClose","shy","startDate","startWeekDay","validDayFn","validMonthFn","validYearFn","nextValidDateFn","prevValidDateFn","yearRange",1,2,3,4,5,6,7,8,9,10,11,12,"wDay","_dateParsers","_hoverPicker","_picker","_setMinMax","setDate","Date","_lang","_render","_listenToContainerObjectEvents","_containerObject","_renderSuperTopBar","calendarTop","_monthDescContainer","_monthPrev","href","setHTML","_monthNext","_monthContainer","_monthSelector","_renderMonthSelector","_yearSelector","_appendDatePickerToDom","_renderMonth","_monthChanger","setTextContent","_ofText","_yearChanger","inline","show","_addOpenCloseEvents","_addDateChangeHandlersToInputs","fields","observeMulti","bindEvent","_updateDate","_showDefaultView","_inline","_hide","opener","cannotBe","descendantOf","ulSelector","mon","_renderMonthButton","liMonth","data-cal-month","appendTarget","parentIsControl","matchesSelector","_wrapper","_wrapperIsControl","insertAfter","_superTopBar","_onClick","elem","hasClassName","_onRelativeChangerClick","_onAbsoluteChangerClick","_showMonthSelector","_showYearSelector","_clean","_updateDescription","changeYear","change_year_next","change_year_prev","changeMonth","change_month_next","change_month_prev","_updateCal","elemData","Number","calDay","calMonth","calYear","_changeYear","selectedIndex","blur","noLimits","_min","noMinLimit","_max","noMaxLimit","MAX_VALUE","dates","rDate","each","noLim","lim","toUpperCase","now","_daysInMonth","valid","_dateCmp","_fitDateToRange","_isValidDate","_dateWithinRange","_dateAboveMax","_dateBelowMin","oth","_dateCmpUntil","depth","props","display","childNodes","_getPrevMonth","_getNextMonth","dataParsed","_parseDate","_setDate","inc","_incrementViewingYear","firstYear","thisYear","yearUl","prevYearLi","_getYearButton","nextYearLi","_acceptableYear","li","data-cal-year","_addMonthClassNames","dateStr","yearRegExp","validOneOrTwo","_isDate","_acceptableDay","_acceptableDateComponent","_acceptableMonth","userCb","_callUserCallbackBool","_writeDateInFormat","dateString","auxDate","objClicked","dt","_updateMonth","_y","_m","exceptions","incValue","_tryLeap","d","_getPrevYear","_getNextYear","atomName","directionName","advancer","maxOrMin","boundary","leapUserCb","_callUserCallbackDate","_getNextDecade","decade","_getCurrentDecade","_getPrevDecade","_callUserCallbackBase","yyyy-mm-dd","yyyy/mm/dd","yy-mm-dd","yy/mm/dd","dd-mm-yyyy","dd/mm/yyyy","dd-mm-yy","dd/mm/yy","mm/dd/yyyy","mm-dd-yyyy","_getMonthCalendarHeader","_getDayButtons","_getFirstDayIndex","wDayFirst","getDay","result","daysInMonth","createDocumentFragment","ul","firstDayIndex","_getDayButton","attrs","dayButton","header","parent","forEach","getElementsByTagName","_addMonthButtonClassNames","btn","toDisable","addRemoveClassName","lang","showMonth","isMonthRendered","destroy","unwrap","between","Draggable","constraint","constraintElm","handle","revert","cursor","zIndex","fps","droppableProxy","mouseAnchor","dragClass","skipChildren","onStart","onDrag","elmStartPosition","active","dragged","prevCoords","placeholder","zindex","firstDrag","deltaMs","lastRunAt","handlers","start","_onStart","dragFacade","_onDragFacade","drag","_onDrag","end","_onEnd","selectStart","stopObserving","_getCoords","ps","scrollWidth","scrollHeight","clientX","clientY","_cloneStyle","src","dst","borderWidth","width","elementWidth","height","elementHeight","elementLeft","elementTop","cssFloat","isLeftClick","button","tgtEl","pos","dims","elementDimensions","originalPosition","delta","div","marginTop","marginBottom","marginLeft","marginRight","visibility","delta2","parts","ad","applyDelta","dragHandlerName","proxy","innerWidth","documentElement","clientWidth","innerHeight","clientHeight","fs","backgroundColor","setOpacity","firstEl","firstChild","nodeType","nextSibling","insertBefore","mouseCoords","mPosX","mPosY","newX","newY","draggableSize","offset","constTop","constBottom","constLeft","constRight","pageWidth","pageHeight","Droppable","getModule","updateAll","mouseCoords2","action","pt","Loaded","Element","elNotFound","Drawer","parentSelector","leftDrawer","leftTrigger","rightDrawer","rightTrigger","contentDrawer","closeOnContentClick","closeOnLinkClick","mode","sides","_contentDrawers","_leftDrawer","_leftTriggers","_rightDrawer","_rightTriggers","_triggers","_isOpen","_direction","click","afterTransition","_afterTransition","_delay","_addEvents","triggerClicked","side","close","open","preventDefault","findUpwardsBySelector","currentTarget","isLink","on","direction","one","Toggle","Dropdown","hoverOpen","dismissOnInsideClick","dismissOnOutsideClick","dismissAfter","onInsideClick","onOutsideClick","onOpen","onDismiss","_toggle","closeOnInsideClick","closeOnClick","onChangeState","newState","_openOrDismiss","_onMouseOver","getState","clearTimeout","_openTimeout","_dismissTimeout","_onMouseOut","_onInsideClick","_handlerCall","dismiss","_onOutsideClick","foundElem","findUpwardsHaving","needle","foundTarget","callHandler","doNotInformToggle","_doNotInformToggle","setState","handler","slice","hAddClassName","hRemoveClassName","debug","_droppables","_draggables","add","cleanStyle","draggable","opt","hoverClass","hoverclass","accept","onHover","onDrop","onDropOut","that","namedEventHandlers","move","droppable","copy","cloneNode","_findDraggable","originalParent","elementData","_update","_findData","elms","update","offsetLeft","offsetTop","coords","matches","InkValidator","elementsWithSameName","form","FormValidator","_flagMap","ink-fv-required","ink-fv-email","ink-fv-url","ink-fv-number","ink-fv-phone_pt","ink-fv-phone_cv","ink-fv-phone_mz","ink-fv-phone_ao","ink-fv-date","ink-fv-confirm","ink-fv-custom","confirmElms","hasConfirm","_errorClassName","_errorValidationClassName","_errorTypeWarningClassName","_errorTypeErrorClassName","validate","_free","onError","customFlag","confirmGroup","getElementById","random","custom","fail","_validateElements","_showError","_clearError","_clearCache","reset","_getElements","formElms","curElm","totalElm","flag","flag2","oGroups","_makeConfirmGroups","errors","customErrors","inArray","disabled","_isValid","_isCustomValid","_validateConfirmGroups","curGroup","total","j","totalG","curFlag","tCustom","callback","fieldType","nodeName","inputType","_trim","aFormRadios","isChecked","totalRadio","checked","mail","url","isPTPhone","isCVPhone","isAOPhone","isMZPhone","dataset","validFormat","validValues","isDate","formElm","aFail","tFail","_showAnErrorOnElement","controlGroupElm","controlElm","errorClasses","_errorTypeClassName","errorMsg","innerHTML","aErrorLabel","control","aErrorLabel2","I18n","FormElement","validationFunctions","min_length","minSize","max_length","maxSize","exact_length","exactSize","email","fullCheck","ip","ipType","isIP","phone","phoneType","countryCode","credit_card","cardType","isCreditCard","alpha","supportSpaces","ascii","singleLineWhitespace","text","whitespace","punctuation","unicode","unicodePunctuation","latin","latin1","latin1Punctuation","alpha_numeric","numbers","alpha_dash","dash","underscore","digit","positive","negative","decimalPlaces","decimal","decimalSeparator","leftDigits","decimalSep","maxDigits","numeric","range","minValue","maxValue","multipleOf","color","isColor","fieldToCompare","getFormElements","getValue","validationMessages","en_US","formvalidator.required","formvalidator.min_length","formvalidator.max_length","formvalidator.exact_length","formvalidator.email","formvalidator.url","formvalidator.ip","formvalidator.phone","formvalidator.credit_card","formvalidator.date","formvalidator.alpha","formvalidator.text","formvalidator.latin","formvalidator.alpha_numeric","formvalidator.alpha_dash","formvalidator.digit","formvalidator.integer","formvalidator.decimal","formvalidator.numeric","formvalidator.range","formvalidator.color","formvalidator.matches","formvalidator.validation_function_not_found","pt_PT","label","rules","_errors","_rules","_value","_getLabel","textContent","_parseRules","rulesLength","rule","paramStartPos","substr","p","_addError","paramObj","field","i18nKey","getErrors","_formElements","eventTrigger","neverSubmit","searchFor","beforeValidation","setRule","errorMessage","getKey","langObj","dictObj","append","getI18n","setI18n","i18n","appendI18n","setLanguage","language","getRules","_rootElement","_errorMessages","_markedErrorElements","getElements","formElements","errorElement","errorElements","counter","cancelEventOnSuccess","formElement","controlGroupElement","controlElement","paragraph","errorArr","ImageQuery","retina","queries","onLoad","lastIndexOf","search","_filename","pop","sortMulti","reverse","_onLoad","_onResize","current","_findCurrentQuery","devicePixelRatio","file","_","viewportWidth","last","query","LazyLoad","item","source","destination","delay","image","scrollElement","touchEvents","onInsideViewport","onAfterAttributeChange","autoInit","_rootElm","_aData","_hasEvents","_activate","_getData","_onScrollThrottled","aElms","attr","hasAttribute","original","_onScroll","_removeEvents","inViewport","partial","margin","_elInViewport","_userCallback","removeAttribute","reload","upName","dimension","firstCharacter","match","maxName","Modal","opacitySupported","opacity","openModals","shadeClass","modalClass","triggerEvent","autoDisplay","markup","onShow","closeOnEscape","responsive","_onShadeClick","keyDown","_onKeyDown","resize","_wasDismissed","_markupMode","_modalDiv","_modalDivStyle","_modalShadow","_modalShadowStyle","_contentContainer","setContentMarkup","triggerElements","toString","_reposition","runNow","_timeoutResizeFunction","_resizeTimeout","isPercentage","currentViewport","viewportHeight","originalStatus","_resizeContainer","_shadeElement","alertsInTheModal","alertsLength","keyCode","containerHeight","_modalHeader","_modalFooter","compatMode","_contentElement","_waitForFade","keyValue","htmlEl","transitionEndEventNames","classicName","evName","observeOnce","fadeChecker","getContentElement","contentMarkup","tempHeader","tempFooter","toAdd","concat","genAEl","inner","index","aEl","wrapText","spanEl","totalItemCount","itemsPerPage","sideButtons","firstLabel","lastLabel","previousLabel","nextLabel","previousPageLabel","nextPageLabel","hashParameter","parentTag","childTag","wrapperClass","paginationClass","activeClass","disabledClass","hideClass","previousClass","previousPageClass","nextClass","nextPageClass","numberFormatter","_size","_calculateSize","_current","_itemLiEls","_generateMarkup","_updateItems","_observe","observeDelegated","count","liEls","isSimpleToggle","liEl","setClassName","_nextEl","pi","pf","_pageStart","_pageEnd","_page","_prevPageEl","hasPreviousPage","_nextPageEl","hasNextPage","_firstEl","isFirst","_lastEl","isLast","_prevEl","hasPrevious","hasNext","hasUlAlready","isChevron","isDotted","createLiEl","isPrev","isNext","isPrevPage","isNextPage","firstClass","lastClass","aElem","nr","setOnChange","sz","setSizeInItems","totalItems","pageNumber","isRelative","getSize","ProgressBar","startValue","_elementBar","setValue","newValue","cancelAnimationFrame","SmoothScroller","speed","changeHash","scroll","a","endPos","interval","onDone","scrollTo","init","onClick","render","link","thisDocument","linkedDocument","activeLiSelector","activeLi","Events","SortableList","hasTouch","navigator","maxTouchPoints","msMaxTouchPoints","placeholderClass","draggedClass","draggingClass","dragSelector","dragObject","handleSelector","moveSelector","swap","cancelMouseOut","down","_onDown","_onMove","up","_onUp","_isMoving","_down","_move","_up","stopMoving","_placeholder","_movePlaceholder","_addMovingClasses","touch","elementFromPoint","validateMove","droppedElement","_removeMovingClasses","target_position","placeholder_position","from_top","from_left","targetIndex","spyTargets","addSpied","spied","observeOnScroll","observingOnScroll","onScroll","onScrollForTarget","activeEl","findActiveElement","toDeactivate","menuLinkSelector","toActivate","findUpwardsByTag","closest","Infinity","closestIndex","bBox","Spy","Stacker","column","customBreakPoints","largeMax","largeMin","mediumMax","mediumMin","smallMax","smallMin","largeCols","mediumCols","smallCols","isOrdered","onRunCallback","onResizeCallback","onAPIReloadCallback","_aList","_curLayout","_runFirstTime","_getPageItemsToList","_canApplyLayoutChange","_applyLayoutChange","addItem","reloadItems","_removeDomItems","_setCurLayout","customBreakpoints","_getColumnsToShow","cols","curLayout","_aColumn","totalCols","aItems","aNewList","ii","countCol","Sticky","offsetBottom","topElement","stickyClass","inlineDimensions","inlinePosition","bottomElement","activateInLayouts","_dims","scrollTarget","_isDisabledInLayout","_getDims","unstick","_unstick","bottomOfSticky","maxBottomOfSticky","_stickTo","where","_inlineDimensions","_getBottomOffset","bottomOfViewport","toBottomOfDocument","oldPosition","oldWidth","dimensionsInStatic","rect","Swipe","onMove","minDist","maxDist","minDuration","maxDuration","storeGesture","stopEvents","_supported","db","_isOn","_isMeOrParent","_pushGesture","_gesture","_time","changedTouches","_target","_t0","_p0","pageX","pageY","t1","gesture","p1","dr","dist","sqrt","time","overallMovement","overallTime","InkUrl","InkString","Json","maybeTurnIntoNumber","rNumber","cmp","b","numberishEnabledCmp","aValue","bValue","Table","sameSame","pageSize","caretUpClass","caretDownClass","createEndpointUrl","getDataFromEndPoint","processJSONRows","processJSONRow","processJSONField","processJSONHeaders","processJSONTotalRows","totalRows","getSortKey","allowResetSorting","visibleFields","tdClassNames","paginationOptions","_thead","tHead","createTHead","_headers","thClick","_originalFields","_sortableFields","_originalData","_data","_totalRows","_resetSortOrder","_addHeadersClasses","_setPagination","headerLabel","classNames","_onThClick","paginated","sortable","_invertSortOrder","_setSortOrderOfColumn","tbody","_paginate","sortAndReverse","isAscending","_sort","caretHtml","order","firstIndex","lastIndex","_registerFieldNames","names","_fieldIsVisible","userKey","keyFunction","columnIndex","columnName","sort","trA","trB","elementA","elementB","_createHeadersFromJson","headers","tr","insertRow","th","_createSingleHeaderFromJson","_createRowsFromJSON","rows","row","trIndex","_createSingleRowFromJson","rowIndex","_createFieldFromJson","fieldData","processor","_elOrFieldData","processed","isString","isNumber","setEndpoint","currentPage","paginationEl","pageNo","sortOrder","_getSortOrder","_getDataViaAjax","_getUrl","urlCreator","parseUrl","sortField","endpointUri","success","JSONData","_onAjaxSuccess","getDataFromEndpoint","contentType","sanitizeJSON","response","responseText","jsonResponse","_rowLength","Tabs","preventUrlChange","onBeforeChange","menuSelector","contentSelector","tabSelector","triggerEventsOnLoad","_menu","_initializeDom","_setFirstActive","contentTabs","activeMenuLink","_findLinkByHref","_changeTab","runCallbacks","activeTabs","_activeMenuTab","_activeSection","_activeMenuLink","_onTabClickedGeneric","_onTabClicked","tabElm","_dehashify","changeTab","_lastLayout","smallLayout","_hashify","isAncestorOf","links","disable","enable","activeTab","activeMenuTab","activeSection","activeContentTab","TagField","enterKey","backspaceKey","isTruthy","tags","tagQuery","tagQueryAsync","allowRepeated","maxTags","outSeparator","separator","autoSplit","RegExp","_readInput","_viewElm","_input","_tagsFromMarkup","_tags","_onKeyUp","_onBlur","_refocus","tagname","tagName","map","option","_tagsToMarkup","tag","selected","_addTag","_removeTag","spc","createTextNode","filter","which","_onEnterKeyDown","_onBackspaceKeyDown","_removeConfirm","_unsetRemovingVisual","_setRemovingVisual","tagIndex","_removeRemovingVisualTimeout","parentIndexOf","focus","isAccordion","initialState","classNameOn","classNameOff","_targets","_accordion","_firstTime","_bindEvents","state","_onTriggerEvent","sel","isAncestorOfClickedElement","some","thisOne","_updateAccordion","has","accordionElement","targetElm","shades","ancestorOfTargets","shadesLength","Tooltip","EachTooltip","root","transitionDurationName","transitionPropertyName","transitionTimingFunctionName","bodies","spacing","forever","timeout","template","templatefield","fade","tooltips","tooltip","_destroy","_oppositeDirections","_onMouseMove","_delayTimeout","_makeTooltip","mousePosition","_getOpt","_createTooltipElement","_removeTooltip","_fadeInTooltipElement","_placeTooltipElement","_onTooltipMouseOver","_getFloatOpt","temp","outerHTML","_getIntOpt","fadeTime","mPos","_setPos","targetElementPos","tleft","ttop","centerh","centerv","tooltipDims","elementDims","maxX","maxY","_getWhereValueInsideViewport","arrow","tooltipLeft","tooltipTop","toBottom","toRight","toLeft","toTop","bbox","viewport","dataAttrVal","_camelCase","instanceOption","_getMousePosition","pageDims","_getPageXY","elmDims","scrollDim","_getScroll","cWidth","cHeight","dd","scrollLeft","scrollTop","TreeView","node","child","parentClass","openNodeClass","openClass","closedClass","iconTag","isParent","isOpen","_getIcon","insertTop","_setNodeOpen","_getChild","beOpen","icon","toggle","DirectoryReader","entry","maxDepth","_read","_readDirectories","entries","running","_readEntries","currentEntry","dir","createReader","readEntries","isDirectory","clearArray","fullPath","shift","_stopActivityTimeout","readError","activity","checkActivity","clearInterval","readComplete","setInterval","arr","Queue","lists","items","String","getItems","parentId","purge","keepList","pid","priority","view","_searchByPid","UI","Upload","_fileButton","fileButton","_dropzone","dropzone","_setDropEvent","_setFileButton","dropzones","ondrop","_dropEventHandler","ondragleave","_onDragLeave","ondragend","_onDragEndEventHandler","ondragdrop","ondragenter","_onDragEnterHandler","ondragover","_onDragOverHandler","stopPropagation","returnValue","publish","btns","_fileChangeHandler","files","FormData","XMLHttpRequest","_addFilesToQueue","submit","_events","fileFormName","maxFilesize","INVALID_FILE_NAME","extraData","useChunks","chunkSize","minSizeToUseChunks","endpointChunk","endpointChunkCommit","foldersEnabled","directoryMaxDepth","_queueId","_queueRunning","_folders","_supportChunks","Blob","dataTransfer","_files","Array","webkitGetAsEntry","folders","_addFolderToQueue","invalidFolders","getFiles","isFile","convertToFile","hasParent","getSubDirs","created","fileID","CHROME","directory","_processQueue","internalUpload","queueLen","canceled","_doRequest","_upload","xhr","forceAbort","showError","lengthComputable","loaded","abort","lastModifiedDate","Dom","OPERA","upload","onprogress","chunk_offset","chunk_upload_id","withCredentials","setRequestHeader","fd","blob","upload_path","parentID","rootPath","send","onload","invalidOffset","upload_id","chunk_expires","expires","onerror","onabort","abortAll","abortOne","subscribe","eventName","fn","events","args"],"mappings":"AAUAA,IAAIC,aAAa,iBAAkB,GAAI,kBAAmB,kBAAmB,iBAAkB,SAAUC,EAAQC,EAAUC,GACvH,YA8BA,SAASC,KACLH,EAAOI,gBAAgBC,MAAMC,KAAMC,WA7BvC,GAAIC,GAAmB,SAAUC,GAC7B,MAAQ,iBAAmBA,GAAGC,MAAS,YAC/B,kBAAoBD,GAAGC,MAAS,aAChC,mBAAqBD,GAAGC,MAAS,cACjC,uBAAyBD,GAAGC,MAAS,kBAAoB,MACnEC,SAASC,cAAc,QAErBC,GACAC,UAAW,eACXC,WAAY,gBACZC,YAAa,iBACbC,gBAAiB,sBACnBT,EA4IF,OAxHAL,GAAQe,MAAQ,YAEhBf,EAAQgB,mBACJC,SAAU,UAAW,MACrBC,UAAW,SAAU,QACrBP,WAAY,UACZQ,aAAc,WAAW,GACzBC,OAAQ,WAAY,eAGxBpB,EAAQqB,UAAUC,MAAQ,WACjBC,MAAMC,SAASrB,KAAKsB,SAASP,SAAU,OACxCf,KAAKsB,SAASP,SAAWM,SAASrB,KAAKsB,SAASP,SAAU,KAG1Df,K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qD,EAAOlqD,GAAGjJ,MAAMC,KAAMmzD,EAAKj+C,OAAO,EAAGi+C,EAAKhtD,SAC5C,MAAMwP,GACJnW,IAAI0N,MAAM8lD,EAAY,KAAOr9C,MAMtCk3C","sourcesContent":["/**\n * Animate.css Utility\n *\n * This module is a wrapper around animate.css's CSS classes to produce animation.\n * It contains options to ease common tasks, like listen to the \"animationend\" event with all necessary prefixes, remove the necessary class names when the animation finishes, or configure the duration of your animation with the necessary browser prefix.\n *\n * @module Ink.UI.Animate_1\n * @version 1\n */\n\nInk.createModule('Ink.UI.Animate', 1, ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Css_1'], function (Common, InkEvent, Css) {\n 'use strict';\n\n var animationPrefix = (function (el) {\n return ('animationName' in el.style) ? 'animation' :\n ('oAnimationName' in el.style) ? 'oAnimation' :\n ('msAnimationName' in el.style) ? 'msAnimation' :\n ('webkitAnimationName' in el.style) ? 'webkitAnimation' : null;\n }(document.createElement('div')));\n\n var animationEndEventName = {\n animation: 'animationend',\n oAnimation: 'oanimationend',\n msAnimation: 'MSAnimationEnd',\n webkitAnimation: 'webkitAnimationEnd'\n }[animationPrefix];\n\n /**\n * @class Ink.UI.Animate_1\n * @constructor\n *\n * @param {DOMElement} element Animated element\n * @param {Object} options Options object\n * @param {String} options.animation Animation name\n * @param {String|Number} [options.duration] Duration name (fast|medium|slow) or duration in milliseconds. Defaults to 'medium'.\n * @param {Boolean} [options.removeClass] Flag to remove the CSS class when finished animating. Defaults to false.\n * @param {Function} [options.onEnd] Callback for the animation end\n *\n * @sample Ink_UI_Animate_1.html\n *\n **/\n function Animate() {\n Common.BaseUIComponent.apply(this, arguments);\n }\n\n Animate._name = 'Animate_1';\n\n Animate._optionDefinition = {\n trigger: ['Element', null],\n duration: ['String', 'slow'], // Actually a string with a duration name, or a number of ms\n animation: ['String'],\n removeClass: ['Boolean', true],\n onEnd: ['Function', function () {}]\n };\n\n Animate.prototype._init = function () {\n if (!isNaN(parseInt(this._options.duration, 10))) {\n this._options.duration = parseInt(this._options.duration, 10);\n }\n\n if (this._options.trigger) {\n InkEvent.observe(this._options.trigger, 'click', Ink.bind(function () {\n this.animate();\n }, this)); // later\n } else {\n this.animate();\n }\n };\n\n Animate.prototype.animate = function () {\n Animate.animate(this._element, this._options.animation, this._options);\n };\n\n Ink.extendObj(Animate, {\n /**\n * Browser prefix for the CSS animations.\n *\n * @property _animationPrefix\n * @private\n **/\n _animationPrefix: animationPrefix,\n\n /**\n * Boolean which says whether this browser has CSS3 animation support.\n *\n * @property animationSupported\n **/\n animationSupported: !!animationPrefix,\n\n /**\n * Prefixed 'animationend' event name.\n *\n * @property animationEndEventName\n **/\n animationEndEventName: animationEndEventName,\n\n /**\n * Animate an element using one of the animate.css classes\n *\n * **Note: This is a utility method inside the `Animate` class, which you can access through `Animate.animate()`. Do not mix these up.**\n *\n * @static\n * @method animate\n * @param element {DOMElement} animated element\n * @param animation {String} animation name\n * @param [options] {Object}\n * @param [options.onEnd=null] {Function} callback for animation end\n * @param [options.removeClass=false] {Boolean} whether to remove the Css class when finished\n * @param [options.duration=medium] {String|Number} duration name (fast|medium|slow) or duration in ms\n *\n * @sample Ink_UI_Animate_1_animate.html\n **/\n animate: function (element, animation, options) {\n element = Common.elOrSelector(element);\n\n if (typeof options === 'number' || typeof options === 'string') {\n options = { duration: options };\n } else if (!options) {\n options = {};\n }\n\n if (typeof arguments[3] === 'function') {\n options.onEnd = arguments[3];\n }\n\n if (typeof options.duration !== 'number' && typeof options.duration !== 'string') {\n options.duration = 400;\n }\n\n if (!Animate.animationSupported) {\n if (options.onEnd) {\n setTimeout(function () {\n options.onEnd(null);\n }, 0);\n }\n return;\n }\n\n if (typeof options.duration === 'number') {\n element.style[animationPrefix + 'Duration'] = options.duration + 'ms';\n } else if (typeof options.duration === 'string') {\n Css.addClassName(element, options.duration);\n }\n\n Css.addClassName(element, ['animated', animation]);\n\n function onAnimationEnd(event) {\n if (event.target !== element) { return; }\n if (event.animationName !== animation) { return; }\n if (options.onEnd) { options.onEnd(event); }\n if (options.removeClass) {\n Css.removeClassName(element, animation);\n }\n if (typeof options.duration === 'string') {\n Css.removeClassName(element, options.duration);\n }\n element.removeEventListener(animationEndEventName, onAnimationEnd, false);\n }\n\n element.addEventListener(animationEndEventName, onAnimationEnd, false);\n }\n });\n\n Common.createUIComponent(Animate);\n\n return Animate;\n});\n","/**\n * Flexible Carousel\n * @module Ink.UI.Carousel_1\n * @version 1\n */\n\nInk.createModule('Ink.UI.Carousel', '1',\n ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Css_1', 'Ink.Dom.Element_1', 'Ink.UI.Pagination_1', 'Ink.Dom.Browser_1', 'Ink.Dom.Selector_1'],\n function(Common, InkEvent, Css, InkElement, Pagination, Browser/*, Selector*/) {\n 'use strict';\n\n /*\n * TODO:\n * keyboardSupport\n */\n\n function limitRange(n, min, max) {\n return Math.min(max, Math.max(min, n));\n }\n\n var requestAnimationFrame = window.requestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n function (cb) {return setTimeout(cb, 1000 / 30); };\n\n /**\n * @class Ink.UI.Carousel_1\n * @constructor\n *\n * @param {String|DOMElement} selector DOM element or element id\n * @param {Object} [options] Carousel Options\n * @param {Integer} [options.autoAdvance] Milliseconds to wait before auto-advancing pages. Set to 0 to disable auto-advance. Defaults to 0.\n * @param {String} [options.axis] Axis of the carousel. Set to 'y' for a vertical carousel. Defaults to 'x'.\n * @param {Number} [options.initialPage] Initial index page of the carousel. Defaults to 0.\n * @param {Boolean} [options.spaceAfterLastSlide=true] If there are not enough slides to fill the full width of the last page, leave white space. Defaults to `true`.\n * @param {Boolean} [options.swipe] Enable swipe support if available. Defaults to true.\n * @param {Mixed} [options.pagination] Either an ul element to add pagination markup to or an `Ink.UI.Pagination` instance to use.\n * @param {Function} [options.onChange] Callback to be called when the page changes.\n *\n * @sample Ink_UI_Carousel_1.html\n */\n function Carousel() {\n Common.BaseUIComponent.apply(this, arguments);\n }\n\n Carousel._name = 'Carousel_1';\n\n Carousel._optionDefinition = {\n autoAdvance: ['Integer', 0],\n axis: ['String', 'x'],\n initialPage: ['Integer', 0],\n spaceAfterLastSlide: ['Boolean', true],\n hideLast: ['Boolean', false],\n // [3.1.0] Deprecate \"center\". It is only needed when things are of unknown widths.\n center: ['Boolean', false],\n keyboardSupport:['Boolean', false],\n pagination: ['String', null],\n onChange: ['Function', null],\n onInit: ['Function', function () {}],\n swipe: ['Boolean', true]\n // TODO exponential swipe\n // TODO specify break point for next page when moving finger\n };\n\n Carousel.prototype = {\n _init: function () {\n this._handlers = {\n paginationChange: Ink.bindMethod(this, '_onPaginationChange'),\n windowResize: InkEvent.throttle(Ink.bindMethod(this, 'refit'), 200)\n };\n\n InkEvent.observe(window, 'resize', this._handlers.windowResize);\n\n this._isY = (this._options.axis === 'y');\n\n var ulEl = Ink.s('ul.stage', this._element);\n this._ulEl = ulEl;\n\n InkElement.removeTextNodeChildren(ulEl);\n\n if (this._options.pagination == null) {\n this._currentPage = this._options.initialPage;\n }\n\n this.refit(); // recalculate this._numPages\n\n if (this._isY) {\n // Override white-space: no-wrap which is only necessary to make sure horizontal stuff stays horizontal, but breaks stuff intended to be vertical.\n this._ulEl.style.whiteSpace = 'normal';\n }\n\n if (this._options.swipe) {\n InkEvent.observe(this._element, 'touchstart', Ink.bindMethod(this, '_onTouchStart'));\n InkEvent.observe(this._element, 'touchmove', Ink.bindMethod(this, '_onTouchMove'));\n InkEvent.observe(this._element, 'touchend', Ink.bindMethod(this, '_onTouchEnd'));\n }\n\n this._setUpPagination();\n this._setUpAutoAdvance();\n this._setUpHider();\n\n this._options.onInit.call(this, this);\n },\n\n /**\n * Repositions elements around.\n * Measure the carousel once again, adjusting the involved elements' sizes. This is called automatically when the window resizes, in order to cater for changes from responsive media queries, for instance.\n *\n * @method refit\n * @public\n */\n refit: function() {\n var _isY = this._isY;\n\n var size = function (elm, perpendicular) {\n if (!elm) { return 0; }\n\n if (!perpendicular) {\n return InkElement.outerDimensions(elm)[_isY ? 1 : 0];\n } else {\n return InkElement.outerDimensions(elm)[_isY ? 0 : 1];\n }\n };\n\n this._liEls = Ink.ss('li.slide', this._ulEl);\n var numSlides = this._liEls.length;\n\n var contRect = this._ulEl.getBoundingClientRect();\n this._ctnLength = _isY ? contRect.bottom - contRect.top : contRect.right - contRect.left;\n this._elLength = size(this._liEls[0]);\n this._slidesPerPage = Math.floor( this._ctnLength / this._elLength ) || 1;\n if (!isFinite(this._slidesPerPage)) { this._slidesPerPage = 1; }\n\n var numPages = Math.ceil( numSlides / this._slidesPerPage );\n var numPagesChanged = this._numPages !== numPages;\n this._numPages = numPages;\n this._deltaLength = this._slidesPerPage * this._elLength;\n \n this._center();\n this._updateHider();\n this._IE7();\n\n if (this._pagination && numPagesChanged) {\n this._pagination.setSize(this._numPages);\n }\n this.setPage(limitRange(this.getPage(), 0, this._numPages));\n },\n\n _setUpPagination: function () {\n if (this._options.pagination) {\n if (Common.isDOMElement(this._options.pagination) ||\n typeof this._options.pagination === 'string') {\n // if dom element or css selector string...\n this._pagination = new Pagination(this._options.pagination, {\n size: this._numPages,\n onChange: this._handlers.paginationChange\n });\n } else {\n // assumes instantiated pagination\n this._pagination = this._options.pagination;\n this._pagination._options.onChange = this._handlers.paginationChange;\n this._pagination.setSize(this._numPages);\n }\n this._pagination.setCurrent(this._options.initialPage || 0);\n } else {\n this._currentPage = this._options.initialPage || 0;\n }\n },\n\n _setUpAutoAdvance: function () {\n if (!this._options.autoAdvance) { return; }\n var self = this;\n\n setTimeout(function autoAdvance() {\n self.nextPage(true /* wrap */);\n setTimeout(autoAdvance, self._options.autoAdvance);\n }, this._options.autoAdvance);\n },\n\n _setUpHider: function () {\n if (this._options.hideLast) {\n var hiderEl = InkElement.create('div', {\n className: 'hider',\n insertBottom: this._element\n });\n hiderEl.style.position = 'absolute';\n hiderEl.style[ this._isY ? 'left' : 'top' ] = '0'; // fix to top..\n hiderEl.style[ this._isY ? 'right' : 'bottom' ] = '0'; // and bottom...\n hiderEl.style[ this._isY ? 'bottom' : 'right' ] = '0'; // and move to the end.\n this._hiderEl = hiderEl;\n }\n },\n\n // [3.1.0] Deprecate this already\n _center: function() {\n if (!this._options.center) { return; }\n var gap = Math.floor( (this._ctnLength - (this._elLength * this._slidesPerPage) ) / 2 );\n\n var pad;\n if (this._isY) {\n pad = [gap, 'px 0'];\n } else {\n pad = ['0 ', gap, 'px'];\n }\n\n this._ulEl.style.padding = pad.join('');\n },\n\n // [3.1.0] Deprecate this already\n _updateHider: function() {\n if (!this._hiderEl) { return; }\n if (this.getPage() === 0) {\n var gap = Math.floor( this._ctnLength - (this._elLength * this._slidesPerPage) );\n if (this._options.center) {\n gap /= 2;\n }\n this._hiderEl.style[ this._isY ? 'height' : 'width' ] = gap + 'px';\n } else {\n this._hiderEl.style[ this._isY ? 'height' : 'width' ] = '0px';\n }\n },\n \n /**\n * Refits elements for IE7 because it doesn't support inline-block.\n *\n * @method _IE7\n * @private\n */\n _IE7: function () {\n if (Browser.IE && '' + Browser.version.split('.')[0] === '7') {\n // var numPages = this._numPages;\n var slides = Ink.ss('li.slide', this._ulEl);\n var stl = function (prop, val) {slides[i].style[prop] = val; };\n for (var i = 0, len = slides.length; i < len; i++) {\n stl('position', 'absolute');\n stl(this._isY ? 'top' : 'left', (i * this._elLength) + 'px');\n }\n }\n },\n\n _onTouchStart: function (event) {\n if (event.touches.length > 1) { return; }\n\n this._swipeData = {\n x: InkEvent.pointerX(event),\n y: InkEvent.pointerY(event)\n };\n\n var ulRect = this._ulEl.getBoundingClientRect();\n\n this._swipeData.firstUlPos = ulRect[this._isY ? 'top' : 'left'];\n\n this._swipeData.inUlX = this._swipeData.x - ulRect.left;\n this._swipeData.inUlY = this._swipeData.y - ulRect.top;\n\n setTransitionProperty(this._ulEl, 'none');\n\n this._touchMoveIsFirstTouchMove = true;\n },\n\n _onTouchMove: function (event) {\n if (event.touches.length > 1) { return; /* multitouch event, not my problem. */ }\n\n var pointerX = InkEvent.pointerX(event);\n var pointerY = InkEvent.pointerY(event);\n\n var deltaY = Math.abs(pointerY - this._swipeData.y);\n var deltaX = Math.abs(pointerX - this._swipeData.x);\n\n if (this._touchMoveIsFirstTouchMove) {\n this._touchMoveIsFirstTouchMove = undefined;\n this._scrolling = this._isY ?\n deltaX > deltaY :\n deltaY > deltaX ;\n\n if (!this._scrolling) {\n this._onAnimationFrame();\n }\n }\n\n if (!this._scrolling && this._swipeData) {\n InkEvent.stopDefault(event);\n\n this._swipeData.pointerPos = this._isY ? pointerY : pointerX;\n }\n },\n\n _onAnimationFrame: function () {\n var swipeData = this._swipeData;\n\n if (!swipeData || this._scrolling || this._touchMoveIsFirstTouchMove) { return; }\n\n var elRect = this._element.getBoundingClientRect();\n\n var newPos;\n\n if (!this._isY) {\n newPos = swipeData.pointerPos - swipeData.inUlX - elRect.left;\n } else {\n newPos = swipeData.pointerPos - swipeData.inUlY - elRect.top;\n }\n\n this._ulEl.style[this._isY ? 'top' : 'left'] = newPos + 'px';\n\n requestAnimationFrame(Ink.bindMethod(this, '_onAnimationFrame'));\n },\n\n _onTouchEnd: function (event) {\n if (this._swipeData && this._swipeData.pointerPos && !this._scrolling && !this._touchMoveIsFirstTouchMove) {\n var snapToNext = 0.1; // swipe 10% of the way to change page\n\n var relProgress = this._swipeData.firstUlPos -\n this._ulEl.getBoundingClientRect()[this._isY ? 'top' : 'left'];\n\n var curPage = this.getPage();\n\n // How many pages were advanced? May be fractional.\n var progressInPages = relProgress / this._elLength / this._slidesPerPage;\n\n // Have we advanced enough to change page?\n if (Math.abs(progressInPages) > snapToNext) {\n curPage += Math[ relProgress < 0 ? 'floor' : 'ceil' ](progressInPages);\n }\n\n // If something used to calculate progressInPages was zero, we get NaN here.\n if (!isNaN(curPage)) {\n this.setPage(curPage);\n }\n\n InkEvent.stopDefault(event);\n }\n\n setTransitionProperty(this._ulEl, null /* transition: left, top */);\n this._swipeData = null;\n this._touchMoveIsFirstTouchMove = undefined;\n this._scrolling = undefined;\n },\n\n _onPaginationChange: function(pgn) {\n this._setPage(pgn.getCurrent());\n },\n\n /**\n * Gets the current page index\n * @method getPage\n * @return The current page number\n **/\n getPage: function () {\n if (this._pagination) {\n return this._pagination.getCurrent();\n } else {\n return this._currentPage || 0;\n }\n },\n\n /**\n * Sets the current page index\n * @method setPage\n * @param {Number} page Index of the destination page.\n * @param {Boolean} [wrap] Flag to activate circular counting.\n **/\n setPage: function (page, wrap) {\n if (wrap) {\n // Pages outside the range [0..this._numPages] are wrapped.\n page = page % this._numPages;\n if (page < 0) { page = this._numPages - page; }\n }\n page = limitRange(page, 0, this._numPages - 1);\n\n if (this._pagination) {\n this._pagination.setCurrent(page); // _setPage is called by pagination because it listens to its Change event.\n } else {\n this._setPage(page);\n }\n },\n\n _setPage: function (page) {\n var _lengthToGo = page * this._deltaLength;\n var isLastPage = page === (this._numPages - 1);\n\n if (!this._options.spaceAfterLastSlide && isLastPage && page > 0) { \n var _itemsInLastPage = this._liEls.length - (page * this._slidesPerPage);\n if(_itemsInLastPage < this._slidesPerPage) {\n _lengthToGo = ((page - 1) * this._deltaLength) + (_itemsInLastPage * this._elLength);\n }\n }\n\n this._ulEl.style[ this._isY ? 'top' : 'left'] =\n ['-', _lengthToGo, 'px'].join('');\n\n if (this._options.onChange) {\n this._options.onChange.call(this, page);\n }\n\n this._currentPage = page;\n\n this._updateHider();\n },\n\n /**\n * Goes to the next page\n * @method nextPage\n * @param {Boolean} [wrap] Flag to loop from last page to first page.\n **/\n nextPage: function (wrap) {\n this.setPage(this.getPage() + 1, wrap);\n },\n\n /**\n * Goes to the previous page\n * @method previousPage\n * @param {Boolean} [wrap] Flag to loop from first page to last page.\n **/\n previousPage: function (wrap) { this.setPage(this.getPage() - 1, wrap); },\n\n /**\n * Returns how many slides fit into a page\n * @method getSlidesPerPage\n * @return {Number} The number of slides per page\n * @public\n */\n getSlidesPerPage: function() {\n return this._slidesPerPage;\n },\n\n /**\n * Get the amount of pages in the carousel.\n * @method getTotalPages\n * @return {Number} The number of pages\n * @public\n */\n getTotalPages: function() {\n return this._numPages;\n },\n\n /**\n * Get the stage element (your UL with the class \".stage\").\n * @method getStageElm\n * @public\n * @return {DOMElement} Stage element\n **/\n getStageElm: function() {\n return this._ulEl;\n },\n\n /**\n * Get a list of your slides (elements with the \".slide\" class inside your stage)\n * @method getSlidesList\n * @return {DOMElement[]} Array containing the slides.\n * @public\n */\n getSlidesList: function() {\n return this._liEls;\n },\n\n /**\n * Get the total number of slides\n * @method getTotalSlides\n * @return {Number} The number of slides\n * @public\n */\n getTotalSlides: function() {\n return this.getSlidesList().length;\n }\n };\n\n function setTransitionProperty(el, newTransition) {\n el.style.transitionProperty =\n el.style.oTransitionProperty =\n el.style.msTransitionProperty =\n el.style.mozTransitionProperty =\n el.style.webkitTransitionProperty = newTransition;\n }\n\n Common.createUIComponent(Carousel);\n\n return Carousel;\n\n});\n","/**\n * Closing utilities\n * @module Ink.UI.Close_1\n * @version 1\n */\nInk.createModule('Ink.UI.Close', '1', ['Ink.Dom.Event_1','Ink.Dom.Element_1'], function(InkEvent, InkElement) {\n 'use strict';\n\n /**\n * Subscribes clicks on the document.body.\n * Whenever an element with the classes \".ink-close\" or \".ink-dismiss\" is clicked, this module finds an ancestor \".ink-alert\" or \".ink-alert-block\" element and removes it from the DOM.\n * This module should be created only once per page.\n * \n * @class Ink.UI.Close\n * @constructor\n * @example\n * \n *\n * @sample Ink_UI_Close_1.html\n */\n var Close = function() {\n InkEvent.observe(document.body, 'click', function(ev) {\n var el = InkEvent.element(ev);\n\n el = InkElement.findUpwardsByClass(el, 'ink-close') ||\n InkElement.findUpwardsByClass(el, 'ink-dismiss');\n\n if (!el) {\n return; // ink-close or ink-dismiss class not found\n }\n\n var toRemove = InkElement.findUpwardsByClass(el, 'ink-alert') ||\n InkElement.findUpwardsByClass(el, 'ink-alert-block') ||\n el;\n\n if (toRemove) {\n InkEvent.stop(ev);\n InkElement.remove(toRemove);\n }\n });\n };\n\n Close._name = 'Close_1';\n\n return Close;\n});\n","/**\n * Auxiliar utilities for UI Modules\n * @module Ink.UI.Common_1\n * @version 1\n */\n \nInk.createModule('Ink.UI.Common', '1', ['Ink.Dom.Element_1', 'Ink.Net.Ajax_1','Ink.Dom.Css_1','Ink.Dom.Selector_1','Ink.Util.Url_1'], function(InkElement, Ajax,Css,Selector,Url) {\n\n 'use strict';\n\n var nothing = {} /* a marker, for reference comparison. */;\n\n var keys = Object.keys || function (obj) {\n var ret = [];\n for (var k in obj) if (obj.hasOwnProperty(k)) {\n ret.push(k);\n }\n return ret;\n };\n\n var es6WeakMapSupport = 'WeakMap' in window;\n var instances = es6WeakMapSupport ? new WeakMap() : null;\n\n var domRegistry = {\n get: function get(el) {\n return es6WeakMapSupport ?\n instances.get(el) :\n el.__InkInstances;\n },\n set: function set(el, thing) {\n if (es6WeakMapSupport) {\n instances.set(el, thing);\n } else {\n el.__InkInstances = thing;\n }\n }\n };\n\n /**\n * @namespace Ink.UI.Common_1\n */\n\n var Common = {\n\n /**\n * Supported Ink Layouts\n *\n * @property Layouts\n * @type Object\n * @readOnly\n */\n Layouts: {\n TINY: 'tiny',\n SMALL: 'small',\n MEDIUM: 'medium',\n LARGE: 'large',\n XLARGE: 'xlarge'\n },\n\n /**\n * Checks if an item is a valid DOM Element.\n *\n * @method isDOMElement\n * @static\n * @param {Mixed} o The object to be checked.\n * @return {Boolean} True if it's a valid DOM Element.\n * @example\n * var el = Ink.s('#element');\n * if( Ink.UI.Common.isDOMElement( el ) === true ){\n * // It is a DOM Element.\n * } else {\n * // It is NOT a DOM Element.\n * }\n */\n isDOMElement: InkElement.isDOMElement,\n\n /**\n * Checks if an item is a valid integer.\n *\n * @method isInteger\n * @static\n * @param {Mixed} n The value to be checked.\n * @return {Boolean} True if it's a valid integer.\n * @example\n * var value = 1;\n * if( Ink.UI.Common.isInteger( value ) === true ){\n * // It is an integer.\n * } else {\n * // It is NOT an integer.\n * }\n */\n isInteger: function(n) {\n return (typeof n === 'number' && n % 1 === 0);\n },\n\n /**\n * Gets a DOM Element. \n *\n * @method elOrSelector\n * @static\n * @param {DOMElement|String} elOrSelector DOM Element or CSS Selector\n * @param {String} fieldName The name of the field. Commonly used for debugging.\n * @return {DOMElement} Returns the DOMElement passed or the first result of the CSS Selector. Otherwise it throws an exception.\n * @example\n * // In case there are several .myInput, it will retrieve the first found\n * var el = Ink.UI.Common.elOrSelector('.myInput','My Input');\n */\n elOrSelector: function(elOrSelector, fieldName) {\n if (!this.isDOMElement(elOrSelector)) {\n var t = Selector.select(elOrSelector);\n if (t.length === 0) {\n Ink.warn(fieldName + ' must either be a DOM Element or a selector expression!\\nThe script element must also be after the DOM Element itself.');\n return null;\n }\n return t[0];\n }\n return elOrSelector;\n },\n\n /**\n * Alias for `elOrSelector` but returns an array of elements.\n *\n * @method elsOrSelector\n *\n * @static\n * @param {DOMElement|String} elOrSelector DOM Element or CSS Selector\n * @param {String} fieldName The name of the field. Commonly used for debugging.\n * @return {DOMElement} Returns the DOMElement passed or the first result of the CSS Selector. Otherwise it throws an exception.\n * @param {Boolean} required Flag to accept an empty array as output.\n * @return {Array} The selected DOM Elements.\n * @example\n * var elements = Ink.UI.Common.elsOrSelector('input.my-inputs', 'My Input');\n */\n elsOrSelector: function(elsOrSelector, fieldName, required) {\n var ret;\n if (typeof elsOrSelector === 'string') {\n ret = Selector.select(elsOrSelector);\n } else if (Common.isDOMElement(elsOrSelector)) {\n ret = [elsOrSelector];\n } else if (elsOrSelector && typeof elsOrSelector === 'object' && typeof elsOrSelector.length === 'number') {\n ret = elsOrSelector;\n }\n\n if (ret && ret.length) {\n return ret;\n } else {\n if (required) {\n throw new TypeError(fieldName + ' must either be a DOM Element, an Array of elements, or a selector expression!\\nThe script element must also be after the DOM Element itself.');\n } else {\n return [];\n }\n }\n },\n\n /**\n * Gets options an object and element's metadata.\n *\n * The element's data attributes take precedence. Values from the element's data-atrributes are coerced into the required type.\n *\n * @method options\n *\n * @param {Object} [fieldId] Name to be used in debugging features.\n * @param {Object} defaults Object with the options' types and defaults.\n * @param {Object} overrides Options to override the defaults. Usually passed when instantiating an UI module.\n * @param {DOMElement} [element] Element with data-attributes\n *\n * @example\n *\n * this._options = Ink.UI.Common.options('MyComponent', {\n * 'anobject': ['Object', null], // Defaults to null\n * 'target': ['Element', null],\n * 'stuff': ['Number', 0.1],\n * 'stuff2': ['Integer', 0],\n * 'doKickFlip': ['Boolean', false],\n * 'targets': ['Elements'], // Required option since no default was given\n * 'onClick': ['Function', null]\n * }, options || {}, elm)\n *\n * @example\n *\n * ### Note about booleans\n *\n * Here is how options are read from the markup\n * data-attributes, for several values`data-a-boolean`.\n *\n * Options considered true:\n *\n * - `data-a-boolean=\"true\"`\n * - (Every other value which is not on the list below.)\n * \n * Options considered false:\n *\n * - `data-a-boolean=\"false\"`\n * - `data-a-boolean=\"\"`\n * - `data-a-boolean`\n *\n * Options which go to default:\n *\n * - (no attribute). When `data-a-boolean` is ommitted, the\n * option is not considered true nor false, and as such\n * defaults to what is in the `defaults` argument.\n *\n **/\n options: function (fieldId, defaults, overrides, element) {\n if (typeof fieldId !== 'string') {\n element = overrides;\n overrides = defaults;\n defaults = fieldId;\n fieldId = '';\n }\n overrides = overrides || {};\n var out = {};\n var dataAttrs = element ? InkElement.data(element) : {};\n var fromDataAttrs;\n var type;\n var lType;\n var defaultVal;\n\n var invalidStr = function (str) {\n if (fieldId) { str = fieldId + ': \"' + ('' + str).replace(/\"/, '\\\\\"') + '\"'; }\n return str;\n };\n\n var quote = function (str) {\n return '\"' + ('' + str).replace(/\"/, '\\\\\"') + '\"';\n };\n\n var invalidThrow = function (str) {\n throw new Error(invalidStr(str));\n };\n\n var invalid = function (str) {\n Ink.error(invalidStr(str) + '. Ignoring option.');\n };\n\n function optionValue(key) {\n type = defaults[key][0];\n lType = type.toLowerCase();\n defaultVal = defaults[key].length === 2 ? defaults[key][1] : nothing;\n\n if (!type) {\n invalidThrow('Ink.UI.Common.options: Always specify a type!');\n }\n if (!(lType in Common._coerce_funcs)) {\n invalidThrow('Ink.UI.Common.options: ' + defaults[key][0] + ' is not a valid type. Use one of ' + keys(Common._coerce_funcs).join(', '));\n\n }\n if (!defaults[key].length || defaults[key].length > 2) {\n invalidThrow('the \"defaults\" argument must be an object mapping option names to [typestring, optional] arrays.');\n }\n\n if (key in dataAttrs) {\n fromDataAttrs = Common._coerce_from_string(lType, dataAttrs[key], key, fieldId);\n // (above can return `nothing`)\n } else {\n fromDataAttrs = nothing;\n }\n\n if (fromDataAttrs !== nothing) {\n if (!Common._options_validate(fromDataAttrs, lType)) {\n invalid('(' + key + ' option) Invalid ' + lType + ' ' + quote(fromDataAttrs));\n return defaultVal;\n } else {\n return fromDataAttrs;\n }\n } else if (key in overrides) {\n return overrides[key];\n } else if (defaultVal !== nothing) {\n return defaultVal;\n } else {\n invalidThrow('Option ' + key + ' is required!');\n }\n }\n\n for (var key in defaults) {\n if (defaults.hasOwnProperty(key)) {\n out[key] = optionValue(key);\n }\n }\n\n return out;\n },\n\n _coerce_from_string: function (type, val, paramName, fieldId) {\n if (type in Common._coerce_funcs) {\n return Common._coerce_funcs[type](val, paramName, fieldId);\n } else {\n return val;\n }\n },\n\n _options_validate: function (val, type) {\n if (type in Common._options_validate_types) {\n return Common._options_validate_types[type].call(Common, val);\n } else {\n // 'object' options cannot be passed through data-attributes.\n // Json you say? Not any good to embed in HTML.\n return false;\n }\n },\n\n _coerce_funcs: (function () {\n var ret = {\n element: function (val) {\n return Common.elOrSelector(val, '');\n },\n elements: function (val) {\n return Common.elsOrSelector(val, '', false /*not required, so don't throw an exception now*/);\n },\n object: function (val) { return val; },\n number: function (val) { return parseFloat(val); },\n 'boolean': function (val) {\n return !(val === 'false' || val === '' || val === null);\n },\n string: function (val) { return val; },\n 'function': function (val, paramName, fieldId) {\n Ink.error(fieldId + ': You cannot specify the option \"' + paramName + '\" through data-attributes because it\\'s a function');\n return nothing;\n }\n };\n ret['float'] = ret.integer = ret.number;\n return ret;\n }()),\n\n _options_validate_types: (function () {\n var types = {\n string: function (val) {\n return typeof val === 'string';\n },\n number: function (val) {\n return typeof val === 'number' && !isNaN(val) && isFinite(val);\n },\n integer: function (val) {\n return val === Math.round(val);\n },\n element: function (val) {\n return Common.isDOMElement(val);\n },\n elements: function (val) {\n return val && typeof val === 'object' && typeof val.length === 'number' && val.length;\n },\n 'boolean': function (val) {\n return typeof val === 'boolean';\n },\n object: function () { return true; }\n };\n types['float'] = types.number;\n return types;\n }()),\n\n /**\n * Deep copy (clone) an object.\n * Note: The object cannot have referece loops.\n *\n * @method clone\n * @static\n * @param {Object} o The object to be cloned/copied.\n * @return {Object} Returns the result of the clone/copy.\n * @example\n * var originalObj = {\n * key1: 'value1',\n * key2: 'value2',\n * key3: 'value3'\n * };\n * var cloneObj = Ink.UI.Common.clone( originalObj );\n */\n clone: function(o) {\n try {\n return JSON.parse( JSON.stringify(o) );\n } catch (ex) {\n throw new Error('Given object cannot have loops!');\n }\n },\n\n\n /**\n * Gets an element's one-base index relative to its parent.\n *\n * @method childIndex\n * @static\n * @param {DOMElement} childEl Valid DOM Element.\n * @return {Number} Numerical position of an element relatively to its parent.\n * @example\n * \n *
          \n *
        • One
        • \n *
        • Two
        • \n *
        • Three
        • \n *
        • Four
        • \n *
        \n *\n * \n */\n childIndex: function(childEl) {\n if( Common.isDOMElement(childEl) ){\n var els = Selector.select('> *', childEl.parentNode);\n for (var i = 0, f = els.length; i < f; ++i) {\n if (els[i] === childEl) {\n return i;\n }\n }\n }\n throw 'not found!';\n },\n\n\n /**\n * AJAX JSON request shortcut method\n * It provides a more convenient way to do an AJAX request and expect a JSON response.It also offers a callback option, as third parameter, for better async handling.\n *\n * @method ajaxJSON\n * @static\n * @async\n * @param {String} endpoint Valid URL to be used as target by the request.\n * @param {Object} params This field is used in the thrown Exception to identify the parameter.\n * @param {Function} cb Callback for the request.\n * @example\n * // In case there are several .myInput, it will retrieve the first found\n * var el = Ink.UI.Common.elOrSelector('.myInput','My Input');\n */\n ajaxJSON: function(endpoint, params, cb) {\n new Ajax(\n endpoint,\n {\n evalJS: 'force',\n method: 'POST',\n parameters: params,\n\n onSuccess: function( r) {\n try {\n r = r.responseJSON;\n if (r.status !== 'ok') {\n throw 'server error: ' + r.message;\n }\n cb(null, r);\n } catch (ex) {\n cb(ex);\n }\n },\n\n onFailure: function() {\n cb('communication failure');\n }\n }\n );\n },\n\n\n /**\n * Gets the current Ink layout.\n *\n * @method currentLayout\n * @static\n * @return {String} A string representation of the current layout name.\n * @example\n * var inkLayout = Ink.UI.Common.currentLayout();\n * if (inkLayout === 'small') {\n * // ...\n * }\n */\n currentLayout: function() {\n var i, f, k, v, el, detectorEl = Selector.select('#ink-layout-detector')[0];\n if (!detectorEl) {\n detectorEl = document.createElement('div');\n detectorEl.id = 'ink-layout-detector';\n for (k in this.Layouts) {\n if (this.Layouts.hasOwnProperty(k)) {\n v = this.Layouts[k];\n el = document.createElement('div');\n el.className = 'show-' + v + ' hide-all';\n el.setAttribute('data-ink-layout', v);\n detectorEl.appendChild(el);\n }\n }\n document.body.appendChild(detectorEl);\n }\n\n for (i = 0, f = detectorEl.children.length; i < f; ++i) {\n el = detectorEl.children[i];\n if (Css.getStyle(el, 'display') === 'block') {\n return el.getAttribute('data-ink-layout');\n }\n }\n\n return 'large';\n },\n\n\n /**\n * Sets the location's hash (window.location.hash).\n *\n * @method hashSet\n * @static\n * @param {Object} o Object with the info to be placed in the location's hash.\n * @example\n * // It will set the location's hash like: #key1=value1&key2=value2&key3=value3\n * Ink.UI.Common.hashSet({\n * key1: 'value1',\n * key2: 'value2',\n * key3: 'value3'\n * });\n */\n hashSet: function(o) {\n if (typeof o !== 'object') { throw new TypeError('o should be an object!'); }\n var hashParams = Url.getAnchorString();\n hashParams = Ink.extendObj(hashParams, o);\n window.location.hash = Url.genQueryString('', hashParams).substring(1);\n },\n\n /**\n * Removes children nodes from a given object.\n * This method was initially created to help solve a problem in Internet Explorer(s) that occurred when trying to set the innerHTML of some specific elements like 'table'.\n *\n * @method cleanChildren\n * @static\n * @param {DOMElement} parentEl Valid DOM Element\n * @example\n * \n *
          \n *
        • One
        • \n *
        • Two
        • \n *
        • Three
        • \n *
        • Four
        • \n *
        \n *\n * \n *\n * \n *
          \n */\n cleanChildren: function(parentEl) {\n if( !Common.isDOMElement(parentEl) ){\n throw 'Please provide a valid DOMElement';\n }\n var prevEl, el = parentEl.lastChild;\n while (el) {\n prevEl = el.previousSibling;\n parentEl.removeChild(el);\n el = prevEl;\n }\n },\n\n /**\n * Stores the id and/or classes of an element in an object.\n *\n * @method storeIdAndClasses\n * @static\n * @param {DOMElement} fromEl Valid DOM Element to get the id and classes from.\n * @param {Object} inObj Object where the id and classes will be saved.\n * @example\n *
          \n *\n * \n */\n storeIdAndClasses: function(fromEl, inObj) {\n if( !Common.isDOMElement(fromEl) ){\n throw 'Please provide a valid DOMElement as first parameter';\n }\n\n var id = fromEl.id;\n if (id) {\n inObj._id = id;\n }\n\n var classes = fromEl.className;\n if (classes) {\n inObj._classes = classes;\n }\n },\n\n /**\n * Sets the id and className properties of an element based \n *\n * @method restoreIdAndClasses\n * @static\n * @param {DOMElement} toEl Valid DOM Element to set the id and classes on.\n * @param {Object} inObj Object where the id and classes to be set are. This method uses the same format as the one given in `storeIdAndClasses`\n * @example\n *
          \n *\n * \n *\n * \n *
          \n */\n restoreIdAndClasses: function(toEl, inObj) {\n\n if( !Common.isDOMElement(toEl) ){\n throw 'Please provide a valid DOMElement as first parameter';\n }\n\n if (inObj._id && toEl.id !== inObj._id) {\n toEl.id = inObj._id;\n }\n\n if (inObj._classes && toEl.className.indexOf(inObj._classes) === -1) {\n if (toEl.className) { toEl.className += ' ' + inObj._classes; }\n else { toEl.className = inObj._classes; }\n }\n\n if (inObj._instanceId && !toEl.getAttribute('data-instance')) {\n toEl.setAttribute('data-instance', inObj._instanceId);\n }\n },\n\n _warnDoubleInstantiation: function (elm, newInstance) {\n var instances = Common.getInstance(elm);\n\n if (getName(newInstance) === '') { return; }\n if (!instances) { return; }\n\n var nameWithoutVersion = getName(newInstance);\n\n if (!nameWithoutVersion) { return; }\n\n for (var i = 0, len = instances.length; i < len; i++) {\n if (nameWithoutVersion === getName(instances[i])) {\n // Yes, I am using + to concatenate and , to split\n // arguments.\n //\n // Elements can't be concatenated with strings, but if\n // they are passed in an argument, modern debuggers will\n // pretty-print them and make it easy to find them in the\n // element inspector.\n //\n // On the other hand, if strings are passed as different\n // arguments, they get pretty printed. And the pretty\n // print of a string has quotes around it.\n //\n // If some day people find out that strings are not\n // just text and they start preserving contextual\n // information, then by all means change this to a\n // regular concatenation.\n //\n // But they won't. So don't change this.\n Ink.warn('Creating more than one ' + nameWithoutVersion + '.',\n '(Was creating a ' + nameWithoutVersion + ' on:', elm, ').');\n return false;\n }\n }\n\n function getName(thing) {\n return ((thing.constructor && (thing.constructor._name)) ||\n thing._name ||\n '').replace(/_.*?$/, '');\n }\n\n return true;\n },\n\n /**\n * Saves a component's instance reference for later retrieval.\n *\n * @method registerInstance\n * @static\n * @param {Object} inst Object that holds the instance.\n * @param {DOMElement} el DOM Element to associate with the object.\n */\n registerInstance: function(inst, el) {\n if (!inst) { return; }\n\n if (!Common.isDOMElement(el)) { throw new TypeError('Ink.UI.Common.registerInstance: The element passed in is not a DOM element!'); }\n\n // [todo] this belongs in the BaseUIComponent's initialization\n if (Common._warnDoubleInstantiation(el, inst) === false) {\n return false;\n }\n\n var instances = domRegistry.get(el);\n\n if (!instances) {\n instances = [];\n domRegistry.set(el, instances);\n }\n\n instances.push(inst);\n\n return true;\n },\n\n /**\n * Deletes an instance with a given id.\n *\n * @method unregisterInstance\n * @static\n * @param {String} id Id of the instance to be destroyed.\n */\n unregisterInstance: function(inst) {\n if (!inst || !inst._element) { return; }\n var instances = domRegistry.get(inst._element);\n for (var i = 0, len = instances.length; i < len; i++) {\n if (instances[i] === inst) {\n instances.splice(i, 1);\n }\n }\n },\n\n /**\n * Gets an UI instance from an element or instance id.\n *\n * @method getInstance\n * @static\n * @param {String|DOMElement} el DOM Element from which we want the instances.\n * @return {Object|Array} Returns an instance or a collection of instances.\n */\n getInstance: function(el, UIComponent) {\n el = Common.elOrSelector(el);\n var instances = domRegistry.get(el);\n\n if (!instances) {\n instances = [];\n }\n\n if (typeof UIComponent !== 'function') {\n return instances;\n }\n\n for (var i = 0, len = instances.length; i < len; i++) {\n if (instances[i] instanceof UIComponent) {\n return instances[i];\n }\n }\n\n return null;\n },\n\n /**\n * Gets an instance based on a selector.\n *\n * @method getInstanceFromSelector\n * @static\n * @param {String} selector CSS selector to get the instances from.\n * @return {Object|Array} Returns an instance or a collection of instances.\n */\n getInstanceFromSelector: function(selector) {\n return Common.getInstance(Common.elOrSelector(selector));\n },\n\n /**\n * Gets all the instance ids\n *\n * @method getInstanceIds\n * @static\n * @return {Array} Collection of instance ids\n */\n getInstanceIds: function() {\n var res = [];\n for (var id in instances) {\n if (instances.hasOwnProperty(id)) {\n res.push( id );\n }\n }\n return res;\n },\n\n /**\n * Gets all the instances\n *\n * @method getInstances\n * @static\n * @return {Array} Collection of existing instances.\n */\n getInstances: function() {\n var res = [];\n for (var id in instances) {\n if (instances.hasOwnProperty(id)) {\n res.push( instances[id] );\n }\n }\n return res;\n },\n\n /**\n * Boilerplate method to destroy a component.\n * Components should copy this method as its destroy method and modify it.\n *\n * @method destroyComponent\n * @static\n */\n destroyComponent: function() {\n Common.unregisterInstance(this);\n this._element.parentNode.removeChild(this._element);\n }\n\n };\n\n\n\n\n /**\n * Ink UI Base Class\n **/\n\n function warnStub() {\n /* jshint validthis: true */\n if (!this || this === window || typeof this.constructor !== 'function') { return; }\n Ink.warn('You called a method on an incorrectly instantiated ' + this.constructor._name + ' component. Check the warnings above to see what went wrong.');\n }\n\n function stub(prototype, obj) {\n for (var k in prototype) if (prototype.hasOwnProperty(k)) {\n if (k === 'constructor') { continue; }\n if (typeof obj[k] === 'function') {\n obj[k] = warnStub;\n }\n }\n }\n\n /**\n * Ink UI Base Class\n *\n * You don't use this class directly, or inherit from it directly.\n *\n * See createUIComponent() (in this module) for how to create a UI component and inherit from this. It's not plain old JS inheritance, for several reasons.\n *\n * @class Ink.UI.Common.BaseUIComponent\n * @constructor\n *\n * @param element\n * @param options\n **/\n function BaseUIComponent(element, options) {\n var constructor = this.constructor;\n var _name = constructor._name;\n\n if (!this || this === window) {\n throw new Error('Use \"new InkComponent()\" instead of \"InkComponent()\"');\n }\n\n if (this && !(this instanceof BaseUIComponent)) {\n throw new Error('You forgot to call Ink.UI.Common.createUIComponent() on this module!');\n }\n\n if (!element && !constructor._componentOptions.elementIsOptional) {\n Ink.error(new Error(_name + ': You need to pass an element or a selector as the first argument to \"new ' + _name + '()\"'));\n return;\n } else {\n this._element = Common.elsOrSelector(element,\n _name + ': An element with the selector \"' + element + '\" was not found!')[0];\n }\n\n if (!this._element && !constructor._componentOptions.elementIsOptional) {\n isValidInstance = false;\n Ink.error(new Error(element + ' does not match an element on the page. You need to pass a valid selector to \"new ' + _name + '\".'));\n }\n\n // TODO Change Common.options's signature? the below looks better, more manageable\n // var options = Common.options({\n // element: this._element,\n // modName: constructor._name,\n // options: constructor._optionDefinition,\n // defaults: constructor._globalDefaults\n // });\n\n this._options = Common.options(_name, constructor._optionDefinition, options, this._element);\n\n var isValidInstance = BaseUIComponent._validateInstance(this) === true;\n\n if (isValidInstance && typeof this._init === 'function') {\n try {\n this._init.apply(this, arguments);\n } catch(e) {\n isValidInstance = false;\n Ink.error(e);\n }\n }\n\n if (!isValidInstance) {\n BaseUIComponent._stubInstance(this, constructor, _name);\n } else if (this._element) {\n Common.registerInstance(this, this._element);\n }\n }\n\n /**\n * Calls the `instance`'s _validate() method so it can validate itself.\n *\n * Returns false if the method exists, was called, but no Error was returned or thrown.\n *\n * @method _validateInstance\n * @private\n */\n BaseUIComponent._validateInstance = function (instance) {\n var err;\n\n if (typeof instance._validate !== 'function') { return true; }\n\n try {\n err = instance._validate();\n } catch (e) {\n err = e;\n }\n\n if (err instanceof Error) {\n instance._validationError = err;\n return false;\n }\n\n return true;\n };\n\n\n /**\n * Replaces every method in the instance with stub functions which just call Ink.warn().\n *\n * This avoids breaking the page when there are errors.\n *\n * @method _stubInstance\n * @param instance\n * @param constructor\n * @param name\n * @private\n */\n BaseUIComponent._stubInstance = function (instance, constructor, name) {\n stub(constructor.prototype, instance);\n stub(BaseUIComponent.prototype, instance);\n Ink.warn(name + ' was not correctly created. ' + (instance._validationError || ''));\n };\n\n // TODO BaseUIComponent.setGlobalOptions = function () {}\n // TODO BaseUIComponent.createMany = function (selector) {}\n BaseUIComponent.getInstance = function (elOrSelector) {\n elOrSelector = Common.elOrSelector(elOrSelector);\n return Common.getInstance(elOrSelector, this /* get instance by constructor */);\n };\n\n Ink.extendObj(BaseUIComponent.prototype, {\n /**\n * Get an UI component's option's value.\n *\n * @method getOption\n * @param name\n *\n * @return The option value, or undefined if nothing is found.\n *\n * @example\n *\n * var myUIComponent = new Modal('#element', { trigger: '#trigger' }); // or anything else inheriting BaseUIComponent\n * myUIComponent.getOption('trigger'); // -> The trigger element (not the selector string, mind you)\n *\n **/\n getOption: function (name) {\n if (this.constructor && !(name in this.constructor._optionDefinition)) {\n Ink.error('\"' + name + '\" is not an option for ' + this.constructor._name);\n return undefined;\n }\n\n return this._options[name];\n },\n\n /**\n * Sets an option's value\n *\n * @method getOption\n * @param name\n * @param value\n *\n * @example\n *\n * var myUIComponent = new Modal(...);\n * myUIComponent.setOption('trigger', '#some-element');\n **/\n setOption: function (name, value) {\n if (this.constructor && !(name in this.constructor._optionDefinition)) {\n Ink.error('\"' + name + ' is not an option for ' + this.constructor._name);\n return;\n }\n\n this._options[name] = value;\n },\n\n /**\n * Get the element associated with an UI component (IE the one you used in the constructor)\n *\n * @method getElement\n * @return {Element} The component's element.\n *\n * @example\n * var myUIComponent = new Modal('#element'); // or anything else inheriting BaseUIComponent\n * myUIComponent.getElement(); // -> The '#element' (not the selector string, mind you).\n *\n **/\n getElement: function () {\n return this._element;\n }\n });\n\n Common.BaseUIComponent = BaseUIComponent;\n\n /**\n * @method createUIComponent\n * @param theConstructor UI component constructor. It should have an _init function in its prototype, an _optionDefinition object, and a _name property indicating its name.\n * @param options\n * @param [options.elementIsOptional=false] Whether the element argument is optional (For example, when the component might work on existing markup or create its own).\n **/\n Common.createUIComponent = function createUIComponent(theConstructor, options) {\n theConstructor._componentOptions = options || {};\n\n function assert(test, msg) {\n if (!test) {\n throw new Error('Ink.UI_1.createUIComponent: ' + msg);\n }\n }\n\n function assertProp(prop, propType, message) {\n var propVal = theConstructor[prop];\n // Check that the property was passed\n assert(typeof propVal !== 'undefined',\n theConstructor + ' doesn\\'t have a \"' + prop + '\" property. ' + message);\n // Check that its type is correct\n assert(propType && typeof propVal === propType,\n 'typeof ' + theConstructor + '.' + prop + ' is not \"' + propType + '\". ' + message);\n }\n\n assert(typeof theConstructor === 'function',\n 'constructor argument is not a function!');\n\n assertProp('_name', 'string', 'This property is used for error ' +\n 'messages. Set it to the full module path and version (Ink.My.Module_1).');\n assertProp('_optionDefinition', 'object', 'This property contains the ' +\n 'option names, types and defaults. See Ink.UI.Common.options() for reference.');\n\n // Extend the instance methods and props\n var _oldProto = theConstructor.prototype;\n\n if (typeof Object.create === 'function') {\n theConstructor.prototype = Object.create(BaseUIComponent.prototype);\n } else {\n theConstructor.prototype = (function hideF() {\n function F() {}\n F.prototype = BaseUIComponent.prototype;\n return new F();\n }());\n }\n\n Ink.extendObj(theConstructor.prototype, _oldProto);\n theConstructor.prototype.constructor = theConstructor;\n // Extend static methods\n Ink.extendObj(theConstructor, BaseUIComponent);\n };\n\n return Common;\n\n});\n","/**\n * Date selector\n * @module Ink.UI.DatePicker_1\n * @version 1\n */\n\nInk.createModule('Ink.UI.DatePicker', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1','Ink.Util.Date_1', 'Ink.Dom.Browser_1'], function(Common, Event, Css, InkElement, Selector, InkArray, InkDate ) {\n 'use strict';\n\n // Clamp a number into a min/max limit\n function clamp(n, min, max) {\n if (n > max) { n = max; }\n if (n < min) { n = min; }\n\n return n;\n }\n\n function dateishFromYMDString(YMD) {\n var split = YMD.split('-');\n return dateishFromYMD(+split[0], +split[1] - 1, +split[2]);\n }\n\n function dateishFromYMD(year, month, day) {\n return {_year: year, _month: month, _day: day};\n }\n\n function dateishFromDate(date) {\n return {_year: date.getFullYear(), _month: date.getMonth(), _day: date.getDate()};\n }\n\n /**\n * @class Ink.UI.DatePicker\n * @constructor\n * @version 1\n *\n * @param {String|DOMElement} selector\n * @param {Object} [options] Options\n * @param {Boolean} [options.autoOpen] Flag to automatically open the datepicker.\n * @param {String} [options.cleanText] Text for the clean button. Defaults to 'Clear'.\n * @param {String} [options.closeText] Text for the close button. Defaults to 'Close'.\n * @param {String} [options.cssClass] CSS class to be applied on the datepicker\n * @param {String|DOMElement} [options.pickerField] (if not using in an input[type=\"text\"]) Element which displays the DatePicker when clicked. Defaults to an \"open\" link.\n * @param {String} [options.dateRange] Enforce limits to year, month and day for the Date, ex: '1990-08-25:2020-11'\n * @param {Boolean} [options.displayInSelect] Flag to display the component in a select element.\n * @param {String|DOMElement} [options.dayField] (if using options.displayInSelect) `select` field with days.\n * @param {String|DOMElement} [options.monthField] (if using options.displayInSelect) `select` field with months.\n * @param {String|DOMElement} [options.yearField] (if using options.displayInSelect) `select` field with years.\n * @param {String} [options.format] Date format string\n * @param {Object} [options.month] Hash of month names. Defaults to portuguese month names. January is 1.\n * @param {String} [options.nextLinkText] Text for the previous button. Defaults to '«'.\n * @param {String} [options.ofText] Text to show between month and year. Defaults to ' of '.\n * @param {Boolean} [options.onFocus] If the datepicker should open when the target element is focused. Defaults to true.\n * @param {Function} [options.onMonthSelected] Callback to execute when the month is selected.\n * @param {Function} [options.onSetDate] Callback to execute when the date is set.\n * @param {Function} [options.onYearSelected] Callback to execute when the year is selected.\n * @param {String} [options.position] Position for the datepicker. Either 'right' or 'bottom'. Defaults to 'right'.\n * @param {String} [options.prevLinkText] Text for the previous button. Defaults to '«'.\n * @param {Boolean} [options.showClean] If the clean button should be visible. Defaults to true.\n * @param {Boolean} [options.showClose] If the close button should be visible. Defaults to true.\n * @param {Boolean} [options.shy] If the datepicker should start automatically. Defaults to true.\n * @param {String} [options.startDate] Date to define initial month. Must be in yyyy-mm-dd format.\n * @param {Number} [options.startWeekDay] First day of the week. Sunday is zero. Defaults to 1 (Monday).\n * @param {Function} [options.validYearFn] Callback to execute when 'rendering' the month (in the month view)\n * @param {Function} [options.validMonthFn] Callback to execute when 'rendering' the month (in the month view)\n * @param {Function} [options.validDayFn] Callback to execute when 'rendering' the day (in the month view)\n * @param {Function} [options.nextValidDateFn] Function to calculate the next valid date, given the current. Useful when there's invalid dates or time frames.\n * @param {Function} [options.prevValidDateFn] Function to calculate the previous valid date, given the current. Useful when there's invalid dates or time frames.\n * @param {Object} [options.wDay] Hash of week day names. Sunday is 0. Defaults to { 0:'Sunday', 1:'Monday', etc...\n * @param {String} [options.yearRange] Enforce limits to year for the Date, ex: '1990:2020' (deprecated)\n *\n * @sample Ink_UI_DatePicker_1.html\n */\n var DatePicker = function() {\n Common.BaseUIComponent.apply(this, arguments);\n };\n\n DatePicker._name = 'DatePicker_1';\n\n DatePicker._optionDefinition = {\n autoOpen: ['Boolean', false],\n cleanText: ['String', 'Clear'],\n closeText: ['String', 'Close'],\n pickerField: ['Element', null],\n containerElement:['Element', null],\n cssClass: ['String', 'ink-calendar bottom'],\n dateRange: ['String', null],\n \n // use this in a \n *\n * By applying this UI class to the above input, you get a tag field with the tags \"initial\" and \"value\". The class preserves the original input element. It remains hidden and is updated with new tag information dynamically, so regular HTML form logic still applies.\n *\n * Below \"input\" refers to the current value of the input tag (updated as the user enters text, of course), and \"output\" refers to the value which this class writes back to said input tag.\n *\n * @class Ink.UI.TagField\n * @version 1\n * @constructor\n * @param {String|DOMElement} element Selector or DOM Input Element.\n * @param {Object} [options] Options object\n * @param {String|Array} [options.tags] Initial tags in the input\n * @param {Boolean} [options.allowRepeated] Flag to allow user to input several tags. Defaults to true.\n * @param {RegExp} [options.separator] Split the input by this RegExp. Defaults to /[,;(space)]+/g (spaces, commas and semicolons)\n * @param {String} [options.outSeparator] Use this string to separate each tag from the next in the output. Defaults to ','.\n * @param {Boolean} [options.autoSplit] Flag to activate tag creation when the user types a separator. Defaults to true.\n * @param {Integer} [options.maxTags] Maximum number of tags allowed. Set to -1 for no limit. Defaults to -1.\n * @example\n */\n function TagField() {\n Common.BaseUIComponent.apply(this, arguments);\n }\n\n TagField._name = 'TagField_1';\n\n TagField._optionDefinition = {\n tags: ['String', []],\n tagQuery: ['Object', null],\n tagQueryAsync: ['Object', null],\n allowRepeated: ['Boolean', false],\n maxTags: ['Integer', -1],\n outSeparator: ['String', ','],\n separator: ['String', /[,; ]+/g],\n autoSplit: ['Boolean', true]\n };\n\n TagField.prototype = {\n /**\n * Init function called by the constructor\n * \n * @method _init\n * @private\n */\n _init: function() {\n var o = this._options;\n if (typeof o.separator === 'string') {\n o.separator = new RegExp(o.separator, 'g');\n }\n\n if (typeof o.tags === 'string') {\n // coerce to array using the separator\n o.tags = this._readInput(o.tags);\n }\n\n Css.addClassName(this._element, 'hide-all');\n\n this._viewElm = InkElement.create('div', {\n className: 'ink-tagfield',\n insertAfter: this._element\n });\n\n this._input = InkElement.create('input', {\n type: 'text',\n className: 'new-tag-input',\n insertBottom: this._viewElm\n });\n\n var tags = [].concat(o.tags, this._tagsFromMarkup(this._element));\n\n this._tags = [];\n\n InkArray.each(tags, Ink.bindMethod(this, '_addTag'));\n\n InkEvent.observe(this._input, 'keyup', Ink.bindEvent(this._onKeyUp, this));\n InkEvent.observe(this._input, 'change', Ink.bindEvent(this._onKeyUp, this));\n InkEvent.observe(this._input, 'keydown', Ink.bindEvent(this._onKeyDown, this));\n InkEvent.observe(this._input, 'blur', Ink.bindEvent(this._onBlur, this));\n InkEvent.observe(this._viewElm, 'click', Ink.bindEvent(this._refocus, this));\n },\n\n destroy: function () {\n InkElement.remove(this._viewElm);\n Css.removeClassName(this._element, 'hide-all');\n },\n\n _tagsFromMarkup: function (element) {\n var tagname = element.tagName.toLowerCase();\n if (tagname === 'input') {\n return this._readInput(element.value);\n } else if (tagname === 'select') {\n return InkArray.map(element.getElementsByTagName('option'), function (option) {\n return InkElement.textContent(option);\n });\n } else {\n throw new Error('Cannot read tags from a ' + tagname + ' tag. Unknown tag');\n }\n },\n\n _tagsToMarkup: function (tags, element) {\n var tagname = element.tagName.toLowerCase();\n if (tagname === 'input') {\n if (this._options.separator) {\n element.value = tags.join(this._options.outSeparator);\n }\n } else if (tagname === 'select') {\n element.innerHTML = '';\n InkArray.each(tags, function (tag) {\n var opt = InkElement.create('option', {selected: 'selected'});\n InkElement.setTextContent(opt, tag);\n element.appendChild(opt);\n });\n } else {\n throw new Error('TagField: Cannot read tags from a ' + tagname + ' tag. Unknown tag');\n }\n },\n\n _addTag: function (tag) {\n if (this._options.maxTags !== -1 &&\n this._tags.length >= this._options.maxTags) {\n return;\n }\n if ((!this._options.allowRepeated &&\n InkArray.inArray(tag, this._tags, tag)) || !tag) {\n return false;\n }\n var elm = InkElement.create('span', {\n className: 'ink-tag',\n setTextContent: tag + ' '\n });\n\n var remove = InkElement.create('span', {\n className: 'remove fa fa-times',\n insertBottom: elm\n });\n InkEvent.observe(remove, 'click', Ink.bindEvent(this._removeTag, this, null));\n\n var spc = document.createTextNode(' ');\n\n this._tags.push(tag);\n this._viewElm.insertBefore(elm, this._input);\n this._viewElm.insertBefore(spc, this._input);\n this._tagsToMarkup(this._tags, this._element);\n },\n\n _readInput: function (text) {\n if (this._options.separator) {\n return InkArray.filter(text.split(this._options.separator), isTruthy);\n } else {\n return [text];\n }\n },\n\n _onKeyUp: function () { // TODO control input box size\n if (!this._options.autoSplit) {\n return;\n }\n var split = this._input.value.split(this._options.separator);\n if (split.length <= 1) {\n return;\n }\n var last = split[split.length - 1];\n split = split.splice(0, split.length - 1);\n split = InkArray.filter(split, isTruthy);\n \n InkArray.each(split, Ink.bind(this._addTag, this));\n this._input.value = last;\n },\n\n _onKeyDown: function (event) {\n if (event.which === enterKey) {\n return this._onEnterKeyDown(event);\n } else if (event.which === backspaceKey) {\n return this._onBackspaceKeyDown();\n } else if (this._removeConfirm) {\n // user pressed another key, cancel removal from a backspace key\n this._unsetRemovingVisual(this._tags.length - 1);\n }\n },\n\n /**\n * When the user presses backspace twice on the empty input, we delete the last tag on the field.\n * @method onBackspaceKeyDown\n * @private\n */\n _onBackspaceKeyDown: function () {\n if (this._input.value) { return; }\n\n if (this._removeConfirm) {\n this._unsetRemovingVisual(this._tags.length - 1);\n this._removeTag(this._tags.length - 1);\n this._removeConfirm = null;\n } else {\n this._setRemovingVisual(this._tags.length - 1);\n }\n },\n\n _onEnterKeyDown: function (event) {\n var tag = this._input.value;\n if (tag) {\n this._addTag(tag);\n this._input.value = '';\n }\n InkEvent.stopDefault(event);\n },\n\n _onBlur: function () {\n this._addTag(this._input.value);\n this._input.value = '';\n },\n\n /* For when the user presses backspace.\n * Set the style of the tag so that it seems like it's going to be removed\n * if they press backspace again. */\n _setRemovingVisual: function (tagIndex) {\n var elm = this._viewElm.children[tagIndex];\n if (!elm) { return; }\n\n Css.addClassName(elm, 'tag-deleting');\n\n this._removeRemovingVisualTimeout = setTimeout(Ink.bindMethod(this, '_unsetRemovingVisual', tagIndex), 4000);\n InkEvent.observe(this._input, 'blur', Ink.bindMethod(this, '_unsetRemovingVisual', tagIndex));\n this._removeConfirm = true;\n },\n _unsetRemovingVisual: function (tagIndex) {\n var elm = this._viewElm.children[tagIndex];\n if (elm) {\n Css.removeClassName(elm, 'tag-deleting');\n clearTimeout(this._removeRemovingVisualTimeout);\n }\n this._removeConfirm = null;\n },\n\n _removeTag: function (event) {\n var index;\n if (typeof event === 'object') { // click event on close button\n var elm = InkEvent.element(event).parentNode;\n index = InkElement.parentIndexOf(this._viewElm, elm);\n } else if (typeof event === 'number') { // manual removal\n index = event;\n }\n this._tags = InkArray.remove(this._tags, index, 1);\n InkElement.remove(this._viewElm.children[index]);\n this._tagsToMarkup(this._tags, this._element);\n },\n\n _refocus: function (event) {\n this._input.focus();\n InkEvent.stop(event);\n return false;\n }\n };\n\n Common.createUIComponent(TagField);\n\n return TagField;\n});\n","/**\n * Toggle the visibility of elements.\n * @module Ink.UI.Toggle_1\n * @version 1\n */\n\n Ink.createModule('Ink.UI.Toggle', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, InkEvent, Css, InkElement, Selector, InkArray ) {\n 'use strict';\n\n /**\n *\n * You need two elements to use Toggle: the `trigger` element, and the `target` element (or elements). The default behaviour is to toggle the `target`(s) when you click the `trigger`.\n *\n * The toggle has a state. It is either \"on\" or \"off\". It works by switching between the CSS classes in `classNameOn` and `classNameOff` according to the current state.\n *\n * When you initialize the Toggle, it will check if the targets are visible to figure out what the initial state is. You can force the toggle to consider itself turned \"on\" or \"off\" by setting the `initialState` option to `true` or `false`, respectively.\n *\n * You can get the current state of the Toggle by calling `getState`, or by checking if your `trigger` element has the \"active\" class.\n * The state can be changed through JavaScript. Just call `setState(true)` \n * to turn the Toggle on (or `setState(false)` to turn it off).\n *\n * @class Ink.UI.Toggle\n * @constructor\n * @version 1\n * @param {String|DOMElement} selector Trigger element. By clicking this, the target (or targets) are triggered.\n * @param {Object} [options] Options object, containing:\n *\n * @param {String} options.target CSS Selector that specifies the elements that this component will toggle\n * @param {String} [options.classNameOn] CSS class to toggle when on. Defaults to 'show-all'.\n * @param {String} [options.classNameOff] CSS class to toggle when off. Defaults to 'hide-all'.\n * @param {String} [options.triggerEvent] Event that will trigger the toggling. Defaults to 'click'.\n * @param {Boolean} [options.closeOnClick] Flag to toggle the targe off when clicking outside the toggled content. Defaults to true.\n * @param {String} [options.closeOnInsideClick] Toggle off when a child element matching this selector is clicked. Set to null to deactivate the check. Defaults to 'a[href]'.\n * @param {Boolean} [options.initialState] Flag to define initial state. false: off, true: on, null: markup. Defaults to null.\n * @param {Function} [options.onChangeState] Callback when the toggle state changes. Return `false` to cancel the event.\n *\n * @sample Ink_UI_Toggle_1_constructor.html\n */\n function Toggle(){\n Common.BaseUIComponent.apply(this, arguments);\n }\n\n Toggle._name = 'Toggle_1';\n\n Toggle._optionDefinition = {\n target: ['Elements'],\n triggerEvent: ['String', 'click'],\n closeOnClick: ['Boolean', true],\n isAccordion: ['Boolean', false],\n initialState: ['Boolean', null], // May be true, false, or null to be what it is right now\n classNameOn: ['String', 'show-all'],\n classNameOff: ['String', 'hide-all'],\n closeOnInsideClick: ['String', 'a[href]'], // closes the toggle when a target is clicked and it is a link\n onChangeState: ['Function', null]\n };\n\n Toggle.prototype = {\n\n /**\n * Init function called by the constructor\n * \n * @method _init\n * @private\n */\n _init: function(){\n var i, len;\n\n this._targets = Common.elsOrSelector(this._options.target);\n\n // Boolean option handling\n this._options.closeOnClick = this._options.closeOnClick.toString() === 'true';\n // Actually a throolean\n if (this._options.initialState !== null){\n this._options.initialState = this._options.initialState.toString() === 'true';\n } else {\n this._options.initialState = Css.getStyle(this._targets[0], 'display') !== 'none';\n }\n\n if (this._options.classNameOn !== 'show-all' || this._options.classNameOff !== 'hide-all') {\n for (i = 0, len = this._targets.length; i < len; i++) {\n Css.removeClassName(this._targets[i], 'show-all');\n Css.removeClassName(this._targets[i], 'hide-all');\n }\n }\n\n this._accordion = ( Css.hasClassName(this._element.parentNode,'accordion') || Css.hasClassName(this._targets[0].parentNode,'accordion') );\n\n this._firstTime = true;\n\n this._bindEvents();\n\n if (this._options.initialState !== null) {\n this.setState(this._options.initialState, true);\n } else {\n // Add initial classes matching the current \"display\" of the object.\n var state = Css.getStyle(this._targets[0], 'display') !== 'none';\n this.setState(state, true);\n }\n // Aditionally, remove any inline \"display\" style.\n for (i = 0, len = this._targets.length; i < len; i++) {\n if (this._targets[i].style.display) {\n this._targets[i].style.display = ''; // becomes default\n }\n }\n\n this._element.setAttribute('data-is-toggle-trigger', 'true');\n },\n\n /**\n * @method _bindEvents\n * @private\n */\n _bindEvents: function () {\n if ( this._options.triggerEvent ) {\n InkEvent.observe(\n this._element,\n this._options.triggerEvent,\n Ink.bind(this._onTriggerEvent, this));\n }\n if( this._options.closeOnClick ){\n InkEvent.observe( document, 'click', Ink.bind(this._onOutsideClick, this));\n }\n if( this._options.closeOnInsideClick && this._options.closeOnInsideClick !== 'false') {\n var sel = this._options.closeOnInsideClick;\n if (sel.toString() === 'true') {\n sel = '*';\n }\n InkEvent.observeMulti(this._targets, 'click', Ink.bind(function (e) {\n if ( InkElement.findUpwardsBySelector(InkEvent.element(e), sel) ) {\n this.setState(false, true);\n }\n }, this));\n }\n },\n\n /**\n * Event handler. It's responsible for handling the `triggerEvent` as defined in the options.\n *\n * This will trigger the toggle.\n * \n * @method _onTriggerEvent\n * @param {Event} event\n * @private\n */\n _onTriggerEvent: function( event ){\n // When the togglee is a child of the toggler, we get the togglee's events here. We have to check that this event is for us.\n var target = InkEvent.element(event);\n\n var isAncestorOfClickedElement = InkArray.some(this._targets, function (thisOne) {\n return thisOne === target || InkElement.isAncestorOf(thisOne, target);\n });\n\n if (isAncestorOfClickedElement) {\n return;\n }\n\n if (this._accordion) {\n this._updateAccordion();\n }\n\n var has = this.getState();\n this.setState(!has, true);\n if (!has && this._firstTime) {\n this._firstTime = false;\n }\n\n InkEvent.stopDefault(event);\n },\n\n /**\n * Be compatible with accordions\n *\n * @method _updateAccordion\n **/\n _updateAccordion: function () {\n var elms, accordionElement;\n if( Css.hasClassName(this._targets[0].parentNode,'accordion') ){\n accordionElement = this._targets[0].parentNode;\n } else {\n accordionElement = this._targets[0].parentNode.parentNode;\n }\n elms = Selector.select('.toggle, .ink-toggle',accordionElement);\n for(var i=0; i 0) && (targetElm[0] !== this._targets[0]) ){\n targetElm[0].style.display = 'none';\n }\n }\n },\n\n /**\n * Click handler. Will handle clicks outside the toggle component.\n * \n * @method _onOutsideClick\n * @param {Event} event\n * @private\n */\n _onOutsideClick: function( event ){\n var tgtEl = InkEvent.element(event),\n shades;\n\n if (InkElement.findUpwardsBySelector(tgtEl, '[data-is-toggle-trigger=\"true\"]')) return;\n\n var ancestorOfTargets = InkArray.some(this._targets, function (target) {\n return InkElement.isAncestorOf(target, tgtEl) || target === tgtEl;\n });\n\n if( (this._element === tgtEl) || InkElement.isAncestorOf(this._element, tgtEl) || ancestorOfTargets) {\n return;\n } else if( (shades = Ink.ss('.ink-shade')).length ) {\n var shadesLength = shades.length;\n\n for( var i = 0; i < shadesLength; i++ ){\n if( InkElement.isAncestorOf(shades[i],tgtEl) && InkElement.isAncestorOf(shades[i],this._element) ){\n return;\n }\n }\n }\n\n this.setState(false, true); // dismiss\n },\n\n /**\n * Sets the state of the toggle. (on/off)\n *\n * @method setState\n * @param newState {Boolean} New state (on/off)\n */\n setState: function (on, callHandler) {\n if (on === this.getState()) { return; }\n if (callHandler && typeof this._options.onChangeState === 'function') {\n var ret = this._options.onChangeState(on);\n if (ret === false) { return false; } // Canceled by the event handler\n }\n for (var i = 0, len = this._targets.length; i < len; i++) {\n Css.addRemoveClassName(this._targets[i], this._options.classNameOn, on);\n Css.addRemoveClassName(this._targets[i], this._options.classNameOff, !on);\n }\n Css.addRemoveClassName(this._element, 'active', on);\n },\n\n /**\n * Gets the state of the toggle. (on/off)\n *\n * @method getState\n *\n * @return {Boolean} whether the toggle is toggled on.\n */\n getState: function () {\n return Css.hasClassName(this._element, 'active');\n }\n };\n\n Common.createUIComponent(Toggle);\n\n return Toggle;\n});\n","/**\n * Content Tooltips\n * @module Ink.UI.Tooltip_1\n * @version 1\n */\nInk.createModule('Ink.UI.Tooltip', '1', ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Element_1', 'Ink.Dom.Selector_1', 'Ink.Util.Array_1', 'Ink.Dom.Css_1', 'Ink.Dom.Browser_1'], function (Common, InkEvent, InkElement, Selector, InkArray, Css) {\n 'use strict';\n\n /**\n * Tooltips are useful as a means to display information about functionality while avoiding clutter.\n *\n * Tooltips show up when you hover elements which \"have\" tooltips.\n *\n * This class will \"give\" a tooltip to many elements, selected by its first argument (`target`). This is contrary to the other UI modules in Ink, which are created once per element.\n *\n * You can define options either through the second argument of the Tooltip constructor, or as data-attributes in each `target` element. Options set through data-attributes all start with \"data-tip\", and override options passed into the Tooltip constructor.\n *\n * @class Ink.UI.Tooltip\n * @constructor\n *\n * @param {DOMElement|String} target Target element or selector of elements, to display the tooltips on.\n * @param {Object} [options] Options object\n * @param {String} [options.text] Text content for the tooltip.\n * @param {String} [options.html] HTML for the tooltip. Same as above, but won't escape HTML.\n * @param {String} [options.where] Positioning for the tooltip. Options are 'up', 'down', 'left', 'right', 'mousemove' (follows the cursor), and 'mousefix' (stays fixed). Defaults to 'up'.\n * \n * @param {String} [options.color] Color of the tooltip. Options are red, orange, blue, green and black. Default is white.\n * @param {Number} [options.fade] Number of seconds to fade in/out. Defaults to 0.3.\n * @param {Boolean} [options.forever] Flag to prevent the tooltip from being erased when the mouse hovers away from the target.\n * @param {Number} [options.timeout] Number of seconds the tooltip will stay open. Useful together with options.forever. Defaults to 0.\n * @param {Number} [options.delay] Time the tooltip waits until it is displayed. Useful to avoid getting the attention of the user unnecessarily\n * @param {DOMElement|Selector} [options.template] Element or selector containing HTML to be cloned into the tooltips. Can be a hidden element, because CSS `display` is set to `block`.\n * @param {String} [options.templatefield] Selector within the template element to choose where the text is inserted into the tooltip. Useful when a wrapper DIV is required.\n * @param {Number} [options.left] Spacing from the target to the tooltip, when `where` is `mousemove` or `mousefix`. Defaults to 10.\n * @param {Number} [options.top] Spacing from the target to the tooltip, when `where` is `mousemove` or `mousefix`. Defaults to 10.\n * @param {Number} [options.spacing] Spacing between the tooltip and the target element, when `where` is not `mousemove` or `mousefix`. Defaults to 8.\n * \n * @sample Ink_UI_Tooltip_1.html\n */\n function Tooltip(element, options) {\n this._init(element, options || {});\n }\n\n function EachTooltip(root, elm) {\n this._init(root, elm);\n }\n\n var transitionDurationName,\n transitionPropertyName,\n transitionTimingFunctionName;\n (function () { // Feature detection\n var test = document.createElement('DIV');\n var names = ['transition', 'oTransition', 'msTransition', 'mozTransition',\n 'webkitTransition'];\n for (var i = 0; i < names.length; i++) {\n if (typeof test.style[names[i] + 'Duration'] !== 'undefined') {\n transitionDurationName = names[i] + 'Duration';\n transitionPropertyName = names[i] + 'Property';\n transitionTimingFunctionName = names[i] + 'TimingFunction';\n break;\n }\n }\n }());\n\n // Body or documentElement\n var bodies = document.getElementsByTagName('body');\n var body = bodies.length ? bodies[0] : document.documentElement;\n\n Tooltip.prototype = {\n _init: function(element, options) {\n var elements;\n\n this.options = Ink.extendObj({\n where: 'up',\n zIndex: 10000,\n left: 10,\n top: 10,\n spacing: 8,\n forever: 0,\n color: '',\n timeout: 0,\n delay: 0,\n template: null,\n templatefield: null,\n fade: 0.3,\n text: ''\n }, options || {});\n\n if (typeof element === 'string') {\n elements = Selector.select(element);\n } else if (typeof element === 'object') {\n elements = [element];\n } else {\n throw 'Element expected';\n }\n\n this.tooltips = [];\n\n for (var i = 0, len = elements.length; i < len; i++) {\n this.tooltips[i] = new EachTooltip(this, elements[i]);\n }\n },\n /**\n * Destroys the tooltips created by this instance\n *\n * @method destroy\n */\n destroy: function () {\n InkArray.each(this.tooltips, function (tooltip) {\n tooltip._destroy();\n });\n this.tooltips = null;\n this.options = null;\n }\n };\n\n EachTooltip.prototype = {\n _oppositeDirections: {\n left: 'right',\n right: 'left',\n up: 'down',\n down: 'up'\n },\n _init: function(root, elm) {\n InkEvent.observe(elm, 'mouseover', Ink.bindEvent(this._onMouseOver, this));\n InkEvent.observe(elm, 'mouseout', Ink.bindEvent(this._onMouseOut, this));\n InkEvent.observe(elm, 'mousemove', Ink.bindEvent(this._onMouseMove, this));\n\n this.root = root;\n this.element = elm;\n this._delayTimeout = null;\n this.tooltip = null;\n\n Common.registerInstance(this, this.element);\n },\n _makeTooltip: function (mousePosition) {\n if (!this._getOpt('text') &&\n !this._getOpt('html') &&\n !InkElement.hasAttribute(this.element, 'title')) {\n return false;\n }\n\n var tooltip = this._createTooltipElement();\n\n if (this.tooltip) {\n this._removeTooltip();\n }\n\n this.tooltip = tooltip;\n\n this._fadeInTooltipElement(tooltip);\n this._placeTooltipElement(tooltip, mousePosition);\n\n InkEvent.observe(tooltip, 'mouseover', Ink.bindEvent(this._onTooltipMouseOver, this));\n\n var timeout = this._getFloatOpt('timeout');\n if (timeout) {\n setTimeout(Ink.bind(function () {\n if (this.tooltip === tooltip) {\n this._removeTooltip();\n }\n }, this), timeout * 1000);\n }\n },\n _createTooltipElement: function () {\n var template = this._getOpt('template'), // User template instead of our HTML\n templatefield = this._getOpt('templatefield'),\n \n tooltip, // The element we float\n field; // Element where we write our message. Child or same as the above\n\n if (template) { // The user told us of a template to use. We copy it.\n var temp = document.createElement('DIV');\n temp.innerHTML = Common.elOrSelector(template, 'options.template').outerHTML;\n tooltip = temp.firstChild;\n \n if (templatefield) {\n field = Selector.select(templatefield, tooltip);\n if (field) {\n field = field[0];\n } else {\n throw 'options.templatefield must be a valid selector within options.template';\n }\n } else {\n field = tooltip; // Assume same element if user did not specify a field\n }\n } else { // We create the default structure\n tooltip = document.createElement('DIV');\n Css.addClassName(tooltip, 'ink-tooltip');\n Css.addClassName(tooltip, this._getOpt('color'));\n\n field = document.createElement('DIV');\n Css.addClassName(field, 'content');\n\n tooltip.appendChild(field);\n }\n \n if (this._getOpt('html')) {\n field.innerHTML = this._getOpt('html');\n } else if (this._getOpt('text')) {\n InkElement.setTextContent(field, this._getOpt('text'));\n } else {\n InkElement.setTextContent(field, this.element.getAttribute('title'));\n }\n tooltip.style.display = 'block';\n tooltip.style.position = 'absolute';\n tooltip.style.zIndex = this._getIntOpt('zIndex');\n\n return tooltip;\n },\n _fadeInTooltipElement: function (tooltip) {\n var fadeTime = this._getFloatOpt('fade');\n if (transitionDurationName && fadeTime) {\n tooltip.style.opacity = '0';\n tooltip.style[transitionDurationName] = fadeTime + 's';\n tooltip.style[transitionPropertyName] = 'opacity';\n tooltip.style[transitionTimingFunctionName] = 'ease-in-out';\n setTimeout(function () {\n tooltip.style.opacity = '1';\n }, 0); // Wait a tick\n }\n },\n _placeTooltipElement: function (tooltip, mousePosition) {\n var where = this._getOpt('where');\n\n if (where === 'mousemove' || where === 'mousefix') {\n var mPos = mousePosition;\n this._setPos(mPos[0], mPos[1]);\n body.appendChild(tooltip);\n } else if (where.match(/(up|down|left|right)/)) {\n body.appendChild(tooltip);\n var targetElementPos = InkElement.offset(this.element);\n var tleft = targetElementPos[0],\n ttop = targetElementPos[1];\n\n var centerh = (InkElement.elementWidth(this.element) / 2) - (InkElement.elementWidth(tooltip) / 2),\n centerv = (InkElement.elementHeight(this.element) / 2) - (InkElement.elementHeight(tooltip) / 2);\n var spacing = this._getIntOpt('spacing');\n\n var tooltipDims = InkElement.elementDimensions(tooltip);\n var elementDims = InkElement.elementDimensions(this.element);\n\n var maxX = InkElement.scrollWidth() + InkElement.viewportWidth();\n var maxY = InkElement.scrollHeight() + InkElement.viewportHeight();\n \n where = this._getWhereValueInsideViewport(where, {\n left: tleft - tooltipDims[0],\n right: tleft + tooltipDims[0],\n top: ttop + tooltipDims[1],\n bottom: ttop + tooltipDims[1]\n }, {\n right: maxX,\n bottom: maxY\n });\n \n if (where === 'up') {\n ttop -= tooltipDims[1];\n ttop -= spacing;\n tleft += centerh;\n } else if (where === 'down') {\n ttop += elementDims[1];\n ttop += spacing;\n tleft += centerh;\n } else if (where === 'left') {\n tleft -= tooltipDims[0];\n tleft -= spacing;\n ttop += centerv;\n } else if (where === 'right') {\n tleft += elementDims[0];\n tleft += spacing;\n ttop += centerv;\n }\n \n var arrow = null;\n if (where.match(/(up|down|left|right)/)) {\n arrow = document.createElement('SPAN');\n Css.addClassName(arrow, 'arrow');\n Css.addClassName(arrow, this._oppositeDirections[where]);\n tooltip.appendChild(arrow);\n }\n\n var tooltipLeft = tleft;\n var tooltipTop = ttop;\n\n var toBottom = (tooltipTop + tooltipDims[1]) - maxY;\n var toRight = (tooltipLeft + tooltipDims[0]) - maxX;\n var toLeft = 0 - tooltipLeft;\n var toTop = 0 - tooltipTop;\n\n if (toBottom > 0) {\n if (arrow) { arrow.style.top = (tooltipDims[1] / 2) + toBottom + 'px'; }\n tooltipTop -= toBottom;\n } else if (toTop > 0) {\n if (arrow) { arrow.style.top = (tooltipDims[1] / 2) - toTop + 'px'; }\n tooltipTop += toTop;\n } else if (toRight > 0) {\n if (arrow) { arrow.style.left = (tooltipDims[0] / 2) + toRight + 'px'; }\n tooltipLeft -= toRight;\n } else if (toLeft > 0) {\n if (arrow) { arrow.style.left = (tooltipDims[0] / 2) - toLeft + 'px'; }\n tooltipLeft += toLeft;\n }\n\n tooltip.style.left = tooltipLeft + 'px';\n tooltip.style.top = tooltipTop + 'px';\n }\n },\n\n /**\n * Get a value for \"where\" (left/right/up/down) which doesn't put the\n * tooltip off the screen\n *\n * @method _getWhereValueInsideViewport\n * @param where {String} \"where\" value which was given by the user and we might change\n * @param bbox {BoundingBox} A bounding box like what you get from getBoundingClientRect ({top, bottom, left, right}) with pixel positions from the top left corner of the viewport.\n * @param viewport {BoundingBox} Bounding box for the viewport. \"top\" and \"left\" are omitted because these coordinates are relative to the top-left corner of the viewport so they are zero.\n *\n * @TODO: we can't use getBoundingClientRect in this case because it returns {0,0,0,0} on our uncreated tooltip.\n */\n _getWhereValueInsideViewport: function (where, bbox, viewport) {\n if (where === 'left' && bbox.left < 0) {\n return 'right';\n } else if (where === 'right' && bbox.right > viewport.right) {\n return 'left';\n } else if (where === 'up' && bbox.top < 0) {\n return 'down';\n } else if (where === 'down' && bbox.bottom > viewport.bottom) {\n return 'up';\n }\n\n return where;\n },\n _removeTooltip: function() {\n var tooltip = this.tooltip;\n if (!tooltip) {return;}\n\n var remove = Ink.bind(InkElement.remove, {}, tooltip);\n\n if (this._getOpt('where') !== 'mousemove' && transitionDurationName) {\n tooltip.style.opacity = 0;\n // remove() will operate on correct tooltip, although this.tooltip === null then\n setTimeout(remove, this._getFloatOpt('fade') * 1000);\n } else {\n remove();\n }\n this.tooltip = null;\n },\n _getOpt: function (option) {\n var dataAttrVal = InkElement.data(this.element)[InkElement._camelCase('tip-' + option)];\n if (dataAttrVal /* either null or \"\" may signify the absense of this attribute*/) {\n return dataAttrVal;\n }\n var instanceOption = this.root.options[option];\n if (typeof instanceOption !== 'undefined') {\n return instanceOption;\n }\n },\n _getIntOpt: function (option) {\n return parseInt(this._getOpt(option), 10);\n },\n _getFloatOpt: function (option) {\n return parseFloat(this._getOpt(option), 10);\n },\n _destroy: function () {\n if (this.tooltip) {\n InkElement.remove(this.tooltip);\n }\n this.root = null; // Cyclic reference = memory leaks\n this.element = null;\n this.tooltip = null;\n },\n _onMouseOver: function(e) {\n // on IE < 10 you can't access the mouse event not even a tick after it fired\n var mousePosition = this._getMousePosition(e);\n var delay = this._getFloatOpt('delay');\n if (delay) {\n this._delayTimeout = setTimeout(Ink.bind(function () {\n if (!this.tooltip) {\n this._makeTooltip(mousePosition);\n }\n this._delayTimeout = null;\n }, this), delay * 1000);\n } else {\n this._makeTooltip(mousePosition);\n }\n },\n _onMouseMove: function(e) {\n if (this._getOpt('where') === 'mousemove' && this.tooltip) {\n var mPos = this._getMousePosition(e);\n this._setPos(mPos[0], mPos[1]);\n }\n },\n _onMouseOut: function () {\n if (!this._getIntOpt('forever')) {\n this._removeTooltip();\n }\n if (this._delayTimeout) {\n clearTimeout(this._delayTimeout);\n this._delayTimeout = null;\n }\n },\n _onTooltipMouseOver: function () {\n if (this.tooltip) { // If tooltip is already being removed, this has no effect\n this._removeTooltip();\n }\n },\n _setPos: function(left, top) {\n left += this._getIntOpt('left');\n top += this._getIntOpt('top');\n var pageDims = this._getPageXY();\n if (this.tooltip) {\n var elmDims = [InkElement.elementWidth(this.tooltip), InkElement.elementHeight(this.tooltip)];\n var scrollDim = this._getScroll();\n\n if((elmDims[0] + left - scrollDim[0]) >= (pageDims[0] - 20)) {\n left = (left - elmDims[0] - this._getIntOpt('left') - 10);\n }\n if((elmDims[1] + top - scrollDim[1]) >= (pageDims[1] - 20)) {\n top = (top - elmDims[1] - this._getIntOpt('top') - 10);\n }\n\n this.tooltip.style.left = left + 'px';\n this.tooltip.style.top = top + 'px';\n }\n },\n _getPageXY: function() {\n var cWidth = 0;\n var cHeight = 0;\n if( typeof( window.innerWidth ) === 'number' ) {\n cWidth = window.innerWidth;\n cHeight = window.innerHeight;\n } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {\n cWidth = document.documentElement.clientWidth;\n cHeight = document.documentElement.clientHeight;\n } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {\n cWidth = document.body.clientWidth;\n cHeight = document.body.clientHeight;\n }\n return [parseInt(cWidth, 10), parseInt(cHeight, 10)];\n },\n _getScroll: function() {\n var dd = document.documentElement, db = document.body;\n if (dd && (dd.scrollLeft || dd.scrollTop)) {\n return [dd.scrollLeft, dd.scrollTop];\n } else if (db) {\n return [db.scrollLeft, db.scrollTop];\n } else {\n return [0, 0];\n }\n },\n _getMousePosition: function(e) {\n return [parseInt(InkEvent.pointerX(e), 10), parseInt(InkEvent.pointerY(e), 10)];\n }\n };\n\n return Tooltip;\n});\n","/**\n * Elements in a tree structure\n * @module Ink.UI.TreeView_1\n * @version 1\n */\nInk.createModule('Ink.UI.TreeView', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, Event, Css, Element, Selector, InkArray ) {\n 'use strict';\n\n\n /**\n * Shows elements in a tree structure which can be expanded and contracted.\n * A TreeView is built with \"node\"s and \"children\". \"node\"s are `li` tags, and \"children\" are `ul` tags.\n * You can build your TreeView out of a regular UL and LI element structure which you already use to display lists with several levels.\n * If you want a node to be open when the TreeView is built, just add the data-open=\"true\" attribute to it.\n * \n * @class Ink.UI.TreeView\n * @constructor\n * @version 1\n * @param {String|DOMElement} selector Element or selector.\n * @param {String} [options] Options object, containing:\n * @param {String} [options.node] Selector for the nodes. Defaults to 'li'.\n * @param {String} [options.children] Selector for the children. Defaults to 'ul'.\n * @param {String} [options.parentClass] CSS classes to be added to parent nodes. Defaults to 'parent'.\n * @param {String} [options.openClass] CSS classes to be added to the icon when a parent is open. Defaults to 'fa fa-minus-circle'.\n * @param {String} [options.closedClass] CSS classes to be added to the icon when a parent is closed. Defaults to 'fa fa-plus-circle'.\n * @param {String} [options.hideClass] CSS Class to toggle visibility of the children. Defaults to 'hide-all'.\n * @param {String} [options.iconTag] The name of icon tag. The component tries to find a tag with that name as a direct child of the node. If it doesn't find it, it creates it. Defaults to 'i'.\n * @param {Boolean} [options.stopDefault] Flag to stops the default behavior of the click handler. Defaults to true.\n * @example\n * \n * \n * \n * @sample Ink_UI_TreeView_1.html\n */\n function TreeView() {\n Common.BaseUIComponent.apply(this, arguments);\n }\n\n TreeView._name = 'TreeView_1';\n\n TreeView._optionDefinition = {\n 'node': ['String', 'li'],\n // [3.0.1] Deprecate this terrible, terrible name\n 'child': ['String',null],\n 'children': ['String','ul'],\n 'parentClass': ['String','parent'],\n 'openNodeClass': ['String', 'open'],\n 'openClass': ['String','fa fa-minus-circle'],\n 'closedClass': ['String','fa fa-plus-circle'],\n 'hideClass': ['String','hide-all'],\n 'iconTag': ['String', 'i'],\n 'stopDefault' : ['Boolean', true]\n };\n\n TreeView.prototype = {\n /**\n * Init function called by the constructor. Sets the necessary event handlers.\n * \n * @method _init\n * @private\n */\n _init: function(){\n if (this._options.child) {\n Ink.warn('Ink.UI.TreeView: options.child is being renamed to options.children.');\n this._options.children = this._options.child;\n }\n\n this._handlers = {\n click: Ink.bindEvent(this._onClick,this)\n };\n\n Event.on(this._element, 'click', this._options.node, this._handlers.click);\n\n InkArray.each(Ink.ss(this._options.node, this._element), Ink.bind(function(item){\n if( this.isParent(item) ) {\n Css.addClassName(item, this._options.parentClass);\n\n var isOpen = this.isOpen(item);\n if( !this._getIcon(item) ){\n Element.create(this._options.iconTag, { insertTop: item });\n }\n\n this._setNodeOpen(item, isOpen);\n }\n },this));\n },\n\n _getIcon: function (node) {\n return Ink.s('> ' + this._options.iconTag, node);\n },\n\n /**\n * Checks if a node is open.\n *\n * @method isOpen\n * @param {DOMElement} node The tree node to check\n **/\n isOpen: function (node) {\n if (!this._getChild(node)) {\n throw new Error('not a node!');\n }\n\n return Element.data(node).open === 'true' ||\n Css.hasClassName(node, this._options.openNodeClass);\n },\n\n /**\n * Checks if a node is a parent.\n *\n * @method isParent\n * @param {DOMElement} node Node to check\n **/\n isParent: function (node) {\n return Css.hasClassName(node, this._options.parentClass) ||\n this._getChild(node) != null;\n },\n\n _setNodeOpen: function (node, beOpen) {\n var child = this._getChild(node);\n if (child) {\n Css.setClassName(child, this._options.hideClass, !beOpen);\n var icon = this._getIcon(node);\n\n node.setAttribute('data-open', beOpen);\n\n /*\n * Don't refactor this to\n *\n * setClassName(el, className, status); setClassName(el, className, !status);\n *\n * because it won't work with multiple classes.\n *\n * Doing:\n * setClassName(el, 'fa fa-whatever', true);setClassName(el, 'fa fa-whatever-else', false);\n *\n * will remove 'fa' although it is a class we want.\n */\n\n var toAdd = beOpen ? this._options.openClass : this._options.closedClass;\n var toRemove = beOpen ? this._options.closedClass : this._options.openClass;\n Css.removeClassName(icon, toRemove);\n Css.addClassName(icon, toAdd);\n\n Css.setClassName(node, this._options.openNodeClass, beOpen);\n } else {\n Ink.error('Ink.UI.TreeView: node', node, 'is not a node!');\n }\n },\n\n /**\n * Opens one of the tree nodes\n *\n * Make sure you pass the node's DOMElement\n * @method open\n * @param {DOMElement} node The node you wish to open.\n **/\n open: function (node) {\n this._setNodeOpen(node, true);\n },\n\n /**\n * Closes one of the tree nodes\n *\n * Make sure you pass the node's DOMElement\n * @method close\n * @param {DOMElement} node The node you wish to close.\n **/\n close: function (node) {\n this._setNodeOpen(node, false);\n },\n\n /**\n * Toggles a node state\n *\n * @method toggle\n * @param {DOMElement} node The node to toggle.\n **/\n toggle: function (node) {\n if (this.isOpen(node)) {\n this.close(node);\n } else {\n this.open(node);\n }\n },\n\n _getChild: function (node) {\n return Selector.select(this._options.children, node)[0] || null;\n },\n\n /**\n * Handles the click event (as specified in the _init function).\n * \n * @method _onClick\n * @param {Event} event\n * @private\n */\n _onClick: function(ev){\n /**\n * Summary:\n * If the clicked element is a \"node\" as defined in the options, will check if it has any \"child\".\n * If so, will toggle its state and stop the event's default behavior if the stopDefault option is true.\n **/\n\n if (!this.isParent(ev.currentTarget) ||\n Selector.matchesSelector(ev.target, this._options.node) ||\n Selector.matchesSelector(ev.target, this._options.children)) {\n return;\n }\n\n if (this._options.stopDefault){\n ev.preventDefault();\n }\n\n this.toggle(ev.currentTarget);\n }\n };\n\n Common.createUIComponent(TreeView);\n\n return TreeView;\n});\n","Ink.createModule('Ink.UI.Upload', '1', [\n 'Ink.Dom.Event_1',\n 'Ink.Dom.Element_1',\n 'Ink.Dom.Browser_1',\n 'Ink.UI.Common_1'\n], function(Event, Element, Browser, Common) {\n 'use strict';\n\n var DirectoryReader = function(options) {\n this.init(options);\n };\n\n DirectoryReader.prototype = {\n init: function(options) {\n this._options = Ink.extendObj({\n entry: undefined,\n maxDepth: 10\n }, options || {});\n\n try {\n this._read();\n } catch(e) {\n Ink.error(e);\n }\n },\n\n\n _read: function() {\n if(!this._options.entry) {\n Ink.error('You must specify the entry!');\n return;\n }\n\n try {\n this._readDirectories();\n } catch(e) {\n Ink.error(e);\n }\n },\n\n\n _readDirectories: function() {\n var entries = [],\n running = false,\n maxDepth = 0;\n\n /* TODO return as tree because much better well */\n var _readEntries = Ink.bind(function(currentEntry) {\n var dir = currentEntry.createReader();\n running = true;\n\n dir.readEntries(Ink.bind(function(res) {\n if(res.length > 0) {\n for(var i = 0, len = res.length; i=0; i--) {\n if(typeof(arr[i]) === 'undefined' || arr[i] === null || arr[i] === '') {\n arr.splice(i, 1);\n }\n }\n return arr;\n }\n };\n\n var Queue = {\n lists: [],\n items: [],\n\n\n /**\n * Create new queue list\n * @function create\n * @public\n * @param {String} list name\n * @param {Function} function to iterate on items\n * @return {Object} list id\n */\n create: function(name) {\n var id;\n name = String(name);\n this.lists.push({name: name});\n id = this.lists.length - 1;\n return id;\n },\n\n\n getItems: function(parentId) {\n if(!parentId) {\n return this.items;\n }\n var items = [];\n for(var i = 0, len = this.items.length; i=0; i--) {\n if(this.items[i] && id === this.items[i].parentId) {\n this.remove(this.items[i].parentId, this.items[i].pid);\n }\n }\n if(!keepList) {\n this.lists.splice(id, 1);\n }\n return true;\n } catch(e) {\n Ink.error('Purge: invalid id');\n return false;\n }\n },\n\n\n /**\n * add an item to a list\n * @function add\n * @public\n * @param {String} name\n * @param {Object} item\n * @return {Number} pid\n */\n add: function(parentId, item, priority) {\n if(!this.lists[parentId]) {\n return false;\n }\n if(typeof(item) !== 'object') {\n item = String(item);\n }\n\n var pid = parseInt(Math.round(Math.random() * 100000) + \"\" + Math.round(Math.random() * 100000), 10);\n priority = priority || 0;\n\n this.items.push({parentId: parentId, item: item, priority: priority || 0, pid: pid});\n return pid;\n },\n\n\n /**\n * View list\n * @function view\n * @public\n * @param {Number} list id\n * @param {Number} process id\n * @return {Object} item\n */\n view: function(parentId, pid) {\n var id = this._searchByPid(parentId, pid);\n if(id === false) {\n return false;\n }\n return this.items[id];\n },\n\n\n /**\n * Remove an item\n * @function remove\n * @public\n * @param {Object} item\n * @return {Object|Boolean} removed item or false if not found\n */\n remove: function(parentId, pid) {\n try {\n var id = this._searchByPid(parentId, pid);\n if(id === false) {\n return false;\n }\n this.items.splice(id, 1);\n return true;\n } catch(e) {\n Ink.error('Remove: invalid id');\n return false;\n }\n },\n\n _searchByPid: function(parentId, pid) {\n if(!parentId && typeof(parentId) === 'boolean' || !pid) {\n return false;\n }\n\n parentId = parseInt(parentId, 10);\n pid = parseInt(pid, 10);\n\n if(isNaN(parentId) || isNaN(pid)) {\n return false;\n }\n\n for(var i = 0, len = this.items.length; i this._options.minSizeToUseChunks;\n },\n\n\n _dropEventHandler: function(ev) {\n Event.stop(ev);\n\n this.publish('DropComplete', ev.dataTransfer);\n\n var data = ev.dataTransfer;\n\n if(!data || !data.files || !data.files.length) {\n return false;\n }\n\n this._files = data.files;\n this._files = Array.prototype.slice.call(this._files || [], 0);\n\n // check if webkitGetAsEntry exists on first item\n if(data.items && data.items[0] && data.items[0].webkitGetAsEntry) {\n if(!this._options.foldersEnabled) {\n return setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0);\n }\n var entry, folders = [];\n for(var i = ev.dataTransfer.items.length-1; i>=0; i--) {\n entry = ev.dataTransfer.items[i].webkitGetAsEntry();\n if(entry && entry.isDirectory) {\n folders.push(entry);\n this._files[i].isDirectory = true;\n this._files.splice(i, 1);\n }\n }\n // starting callback hell\n this._addFolderToQueue(folders, Ink.bind(function() {\n setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0);\n }, this));\n } else {\n setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0);\n }\n\n return true;\n },\n\n\n _addFolderToQueue: function(folders, cb) {\n var files = [], invalidFolders = {};\n\n if(!folders || !folders.length) {\n cb();\n return files;\n }\n\n var getFiles = function(entries) {\n var files = [];\n for(var i = 0, len = entries.length; i this._options.maxFilesize) {\n this.publish('MaxSizeFailure', file, this._options.maxFilesize);\n continue;\n }\n\n fileID = parseInt(Math.round(Math.random() * 100000) + \"\" + Math.round(Math.random() * 100000), 10);\n o = { id: i, data: file, fileID: fileID, directory: file.isDirectory };\n Queue.add(this._queueId, o);\n\n this.publish('FileAddedToQueue', o);\n }\n this._processQueue(true);\n this._files = [];\n },\n\n\n _processQueue: function(internalUpload) {\n if(this._queueRunning) {\n return false;\n }\n\n this.running = 0;\n var max = 1, i = 0, items,\n queueLen = Queue.items.length;\n this._queueRunning = true;\n\n this.interval = setInterval(Ink.bind(function() {\n if(Queue.items.length === i && this.running === 0) {\n Queue.purge(this._queueId, true);\n this._queueRunning = false;\n clearInterval(this.interval);\n this.publish('QueueEnd', this._queueId, queueLen);\n }\n\n items = Queue.getItems(this._queueId);\n\n if(this.running < max && items[i]) {\n if(!items[i].canceled) {\n _doRequest.call(this, items[i].pid, items[i].item.data, items[i].item.fileID, items[i].item.directory, internalUpload);\n this.running++;\n i++;\n } else {\n var j = i;\n while(items[j] && items[j].canceled) {\n i++;\n j++;\n }\n }\n return true;\n }\n return false;\n }, this), 100);\n\n\n var _doRequest = function(pid, data, fileID, directory, internalUpload) {\n var o = {\n file: data,\n fileID: fileID,\n cb: Ink.bind(function() {\n this.running--;\n }, this)\n };\n if(internalUpload) {\n if(directory) {\n // do magic\n o.cb();\n } else {\n this._upload(o);\n }\n }\n };\n\n return true;\n },\n\n\n _upload: function(o) {\n var file = o.file,\n xhr = new XMLHttpRequest(),\n fileID = o.fileID;\n\n this.publish('BeforeUpload', file, this._options.extraData, fileID, xhr, this._supportChunks(file.size));\n\n var forceAbort = function(showError) {\n if(o.cb && typeof(o.cb === 'function')) {\n o.cb();\n }\n\n this.publish('OnProgress', {\n length: file.size,\n lengthComputable: true,\n loaded: file.size,\n total: file.size\n }, file, fileID);\n this.publish('EndUpload', file, fileID, (showError ? { error: true } : true));\n this.publish('InvalidFile', file, 'name');\n xhr.abort();\n };\n\n if(this._options.INVALID_FILE_NAME && this._options.INVALID_FILE_NAME instanceof RegExp) {\n if(this._options.INVALID_FILE_NAME.test(o.file.name)) {\n forceAbort.call(this);\n return;\n }\n }\n\n // If file was renamed, abort it\n // FU OPERA: Opera always return lastModified date as null\n if(!file.lastModifiedDate && !Ink.Dom.Browser.OPERA) {\n forceAbort.call(this, true);\n return;\n }\n\n xhr.upload.onprogress = Ink.bind(this.publish, this, 'OnProgress', file, fileID);\n\n var endpoint, method;\n if(this._supportChunks(file.size)) {\n if(file.size <= file.chunk_offset) {\n endpoint = this._options.endpointChunkCommit;\n method = 'POST';\n } else {\n endpoint = this._options.endpointChunk;\n if(file.chunk_upload_id) {\n endpoint += '?upload_id=' + file.chunk_upload_id;\n }\n if(file.chunk_offset) {\n endpoint += '&offset=' + file.chunk_offset;\n }\n method = 'PUT';\n }\n } else {\n endpoint = this._options.endpoint;\n method = 'POST';\n }\n\n xhr.open(method, endpoint, true);\n xhr.withCredentials = true;\n xhr.setRequestHeader(\"x-requested-with\", \"XMLHttpRequest\");\n if(this._supportChunks(file.size)) {\n xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n }\n\n var fd = new FormData(),\n blob;\n\n if(\"Blob\" in window && typeof Blob === 'function') {\n blob = new Blob([file], { type: file.type });\n if(this._supportChunks(file.size)) {\n file.chunk_offset = file.chunk_offset || 0;\n blob = blob.slice(file.chunk_offset, file.chunk_offset + this._options.chunkSize);\n } else {\n fd.append(this._options.fileFormName, blob, file.name);\n }\n } else {\n fd.append(this._options.fileFormName, file);\n }\n\n if(!this._supportChunks(file.size)) {\n for(var k in this._options.extraData) {\n if(this._options.extraData.hasOwnProperty(k)) {\n fd.append(k, this._options.extraData[k]);\n }\n }\n } else {\n fd.append('upload_id', file.chunk_upload_id);\n fd.append('path', file.upload_path);\n }\n\n if(!file.hasParent) {\n if(!this._supportChunks(file.size)) {\n xhr.send(fd);\n } else {\n if(file.size <= file.chunk_offset) {\n xhr.send('upload_id=' + file.chunk_upload_id + '&path=' + file.upload_path + '/' + file.name);\n } else {\n xhr.send(blob);\n }\n }\n } else {\n this.publish('cbCreateFolder', file.parentID, file.fullPath, this._options.extraData, this._folders, file.rootPath, Ink.bind(function() {\n if(!this._supportChunks(file.size)) {\n xhr.send(fd);\n } else {\n if(file.size <= file.chunk_offset) {\n xhr.send('upload_id=' + file.chunk_upload_id + '&path=' + file.upload_path + '/' + file.name);\n } else {\n xhr.send(blob);\n }\n }\n }, this));\n }\n\n\n xhr.onload = Ink.bindEvent(function() {\n /* jshint boss:true */\n if(this._supportChunks(file.size) && file.size > file.chunk_offset) {\n if(xhr.response) {\n var response = JSON.parse(xhr.response);\n\n // check expected offset\n var invalidOffset = file.chunk_offset && response.offset !== (file.chunk_offset + this._options.chunkSize) && file.size !== response.offset;\n if(invalidOffset) {\n if(o.cb) {\n o.cb();\n }\n this.publish('ErrorUpload', file, fileID);\n } else {\n file.chunk_upload_id = response.upload_id;\n file.chunk_offset = response.offset;\n file.chunk_expires = response.expires;\n this._upload(o);\n }\n } else {\n if(o.cb) {\n o.cb();\n }\n this.publish('ErrorUpload', file, fileID);\n }\n return (xhr = null);\n }\n\n if(o.cb) {\n o.cb();\n }\n\n if(xhr.responseText && xhr['status'] < 400) {\n this.publish('EndUpload', file, fileID, xhr.responseText);\n } else {\n this.publish('ErrorUpload', file, fileID);\n }\n return (xhr = null);\n }, this);\n\n\n xhr.onerror = Ink.bindEvent(function() {\n if(o.cb) {\n o.cb();\n }\n this.publish('ErrorUpload', file, fileID);\n }, this);\n\n xhr.onabort = Ink.bindEvent(function() {\n if(o.cb) {\n o.cb();\n }\n this.publish('AbortUpload', file, fileID, {\n abortAll: Ink.bind(this.abortAll, this),\n abortOne: Ink.bind(this.abortOne, this)\n });\n }, this);\n },\n\n\n abortAll: function() {\n if(!this._queueRunning) {\n return false;\n }\n clearInterval(this.interval);\n this._queueRunning = false;\n Queue.purge(this._queueId, true);\n return true;\n },\n\n abortOne: function(id, cb) {\n var items = Queue.getItems(0),\n o;\n for(var i = 0, len = items.length; i 1) { return; } + + this._swipeData = { + x: InkEvent.pointerX(event), + y: InkEvent.pointerY(event) + }; + + var ulRect = this._ulEl.getBoundingClientRect(); + + this._swipeData.firstUlPos = ulRect[this._isY ? 'top' : 'left']; + + this._swipeData.inUlX = this._swipeData.x - ulRect.left; + this._swipeData.inUlY = this._swipeData.y - ulRect.top; + + setTransitionProperty(this._ulEl, 'none'); + + this._touchMoveIsFirstTouchMove = true; + }, + + _onTouchMove: function (event) { + if (event.touches.length > 1) { return; /* multitouch event, not my problem. */ } + + var pointerX = InkEvent.pointerX(event); + var pointerY = InkEvent.pointerY(event); + + var deltaY = Math.abs(pointerY - this._swipeData.y); + var deltaX = Math.abs(pointerX - this._swipeData.x); + + if (this._touchMoveIsFirstTouchMove) { + this._touchMoveIsFirstTouchMove = undefined; + this._scrolling = this._isY ? + deltaX > deltaY : + deltaY > deltaX ; + + if (!this._scrolling) { + this._onAnimationFrame(); + } + } + + if (!this._scrolling && this._swipeData) { + InkEvent.stopDefault(event); + + this._swipeData.pointerPos = this._isY ? pointerY : pointerX; + } + }, + + _onAnimationFrame: function () { + var swipeData = this._swipeData; + + if (!swipeData || this._scrolling || this._touchMoveIsFirstTouchMove) { return; } + + var elRect = this._element.getBoundingClientRect(); + + var newPos; + + if (!this._isY) { + newPos = swipeData.pointerPos - swipeData.inUlX - elRect.left; + } else { + newPos = swipeData.pointerPos - swipeData.inUlY - elRect.top; + } + + this._ulEl.style[this._isY ? 'top' : 'left'] = newPos + 'px'; + + requestAnimationFrame(Ink.bindMethod(this, '_onAnimationFrame')); + }, + + _onTouchEnd: function (event) { + if (this._swipeData && this._swipeData.pointerPos && !this._scrolling && !this._touchMoveIsFirstTouchMove) { + var snapToNext = 0.1; // swipe 10% of the way to change page + + var relProgress = this._swipeData.firstUlPos - + this._ulEl.getBoundingClientRect()[this._isY ? 'top' : 'left']; + + var curPage = this.getPage(); + + // How many pages were advanced? May be fractional. + var progressInPages = relProgress / this._elLength / this._slidesPerPage; + + // Have we advanced enough to change page? + if (Math.abs(progressInPages) > snapToNext) { + curPage += Math[ relProgress < 0 ? 'floor' : 'ceil' ](progressInPages); + } + + // If something used to calculate progressInPages was zero, we get NaN here. + if (!isNaN(curPage)) { + this.setPage(curPage); + } + + InkEvent.stopDefault(event); + } + + setTransitionProperty(this._ulEl, null /* transition: left, top */); + this._swipeData = null; + this._touchMoveIsFirstTouchMove = undefined; + this._scrolling = undefined; + }, + + _onPaginationChange: function(pgn) { + this._setPage(pgn.getCurrent()); + }, + + /** + * Gets the current page index + * @method getPage + * @return The current page number + **/ + getPage: function () { + if (this._pagination) { + return this._pagination.getCurrent(); + } else { + return this._currentPage || 0; + } + }, + + /** + * Sets the current page index + * @method setPage + * @param {Number} page Index of the destination page. + * @param {Boolean} [wrap] Flag to activate circular counting. + **/ + setPage: function (page, wrap) { + if (wrap) { + // Pages outside the range [0..this._numPages] are wrapped. + page = page % this._numPages; + if (page < 0) { page = this._numPages - page; } + } + page = limitRange(page, 0, this._numPages - 1); + + if (this._pagination) { + this._pagination.setCurrent(page); // _setPage is called by pagination because it listens to its Change event. + } else { + this._setPage(page); + } + }, + + _setPage: function (page) { + var _lengthToGo = page * this._deltaLength; + var isLastPage = page === (this._numPages - 1); + + if (!this._options.spaceAfterLastSlide && isLastPage && page > 0) { + var _itemsInLastPage = this._liEls.length - (page * this._slidesPerPage); + if(_itemsInLastPage < this._slidesPerPage) { + _lengthToGo = ((page - 1) * this._deltaLength) + (_itemsInLastPage * this._elLength); + } + } + + this._ulEl.style[ this._isY ? 'top' : 'left'] = + ['-', _lengthToGo, 'px'].join(''); + + if (this._options.onChange) { + this._options.onChange.call(this, page); + } + + this._currentPage = page; + + this._updateHider(); + }, + + /** + * Goes to the next page + * @method nextPage + * @param {Boolean} [wrap] Flag to loop from last page to first page. + **/ + nextPage: function (wrap) { + this.setPage(this.getPage() + 1, wrap); + }, + + /** + * Goes to the previous page + * @method previousPage + * @param {Boolean} [wrap] Flag to loop from first page to last page. + **/ + previousPage: function (wrap) { this.setPage(this.getPage() - 1, wrap); }, + + /** + * Returns how many slides fit into a page + * @method getSlidesPerPage + * @return {Number} The number of slides per page + * @public + */ + getSlidesPerPage: function() { + return this._slidesPerPage; + }, + + /** + * Get the amount of pages in the carousel. + * @method getTotalPages + * @return {Number} The number of pages + * @public + */ + getTotalPages: function() { + return this._numPages; + }, + + /** + * Get the stage element (your UL with the class ".stage"). + * @method getStageElm + * @public + * @return {DOMElement} Stage element + **/ + getStageElm: function() { + return this._ulEl; + }, + + /** + * Get a list of your slides (elements with the ".slide" class inside your stage) + * @method getSlidesList + * @return {DOMElement[]} Array containing the slides. + * @public + */ + getSlidesList: function() { + return this._liEls; + }, + + /** + * Get the total number of slides + * @method getTotalSlides + * @return {Number} The number of slides + * @public + */ + getTotalSlides: function() { + return this.getSlidesList().length; + } + }; + + function setTransitionProperty(el, newTransition) { + el.style.transitionProperty = + el.style.oTransitionProperty = + el.style.msTransitionProperty = + el.style.mozTransitionProperty = + el.style.webkitTransitionProperty = newTransition; + } + + Common.createUIComponent(Carousel); + + return Carousel; + +}); diff --git a/public/js/ink.close.js b/public/js/ink.close.js new file mode 100644 index 0000000..84986a3 --- /dev/null +++ b/public/js/ink.close.js @@ -0,0 +1,50 @@ +/** + * Closing utilities + * @module Ink.UI.Close_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Close', '1', ['Ink.Dom.Event_1','Ink.Dom.Element_1'], function(InkEvent, InkElement) { + 'use strict'; + + /** + * Subscribes clicks on the document.body. + * Whenever an element with the classes ".ink-close" or ".ink-dismiss" is clicked, this module finds an ancestor ".ink-alert" or ".ink-alert-block" element and removes it from the DOM. + * This module should be created only once per page. + * + * @class Ink.UI.Close + * @constructor + * @example + * + * + * @sample Ink_UI_Close_1.html + */ + var Close = function() { + InkEvent.observe(document.body, 'click', function(ev) { + var el = InkEvent.element(ev); + + el = InkElement.findUpwardsByClass(el, 'ink-close') || + InkElement.findUpwardsByClass(el, 'ink-dismiss'); + + if (!el) { + return; // ink-close or ink-dismiss class not found + } + + var toRemove = InkElement.findUpwardsByClass(el, 'ink-alert') || + InkElement.findUpwardsByClass(el, 'ink-alert-block') || + el; + + if (toRemove) { + InkEvent.stop(ev); + InkElement.remove(toRemove); + } + }); + }; + + Close._name = 'Close_1'; + + return Close; +}); diff --git a/public/js/ink.common.js b/public/js/ink.common.js new file mode 100644 index 0000000..cf32875 --- /dev/null +++ b/public/js/ink.common.js @@ -0,0 +1,1064 @@ +/** + * Auxiliar utilities for UI Modules + * @module Ink.UI.Common_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.Common', '1', ['Ink.Dom.Element_1', 'Ink.Net.Ajax_1','Ink.Dom.Css_1','Ink.Dom.Selector_1','Ink.Util.Url_1'], function(InkElement, Ajax,Css,Selector,Url) { + + 'use strict'; + + var nothing = {} /* a marker, for reference comparison. */; + + var keys = Object.keys || function (obj) { + var ret = []; + for (var k in obj) if (obj.hasOwnProperty(k)) { + ret.push(k); + } + return ret; + }; + + var es6WeakMapSupport = 'WeakMap' in window; + var instances = es6WeakMapSupport ? new WeakMap() : null; + + var domRegistry = { + get: function get(el) { + return es6WeakMapSupport ? + instances.get(el) : + el.__InkInstances; + }, + set: function set(el, thing) { + if (es6WeakMapSupport) { + instances.set(el, thing); + } else { + el.__InkInstances = thing; + } + } + }; + + /** + * @namespace Ink.UI.Common_1 + */ + + var Common = { + + /** + * Supported Ink Layouts + * + * @property Layouts + * @type Object + * @readOnly + */ + Layouts: { + TINY: 'tiny', + SMALL: 'small', + MEDIUM: 'medium', + LARGE: 'large', + XLARGE: 'xlarge' + }, + + /** + * Checks if an item is a valid DOM Element. + * + * @method isDOMElement + * @static + * @param {Mixed} o The object to be checked. + * @return {Boolean} True if it's a valid DOM Element. + * @example + * var el = Ink.s('#element'); + * if( Ink.UI.Common.isDOMElement( el ) === true ){ + * // It is a DOM Element. + * } else { + * // It is NOT a DOM Element. + * } + */ + isDOMElement: InkElement.isDOMElement, + + /** + * Checks if an item is a valid integer. + * + * @method isInteger + * @static + * @param {Mixed} n The value to be checked. + * @return {Boolean} True if it's a valid integer. + * @example + * var value = 1; + * if( Ink.UI.Common.isInteger( value ) === true ){ + * // It is an integer. + * } else { + * // It is NOT an integer. + * } + */ + isInteger: function(n) { + return (typeof n === 'number' && n % 1 === 0); + }, + + /** + * Gets a DOM Element. + * + * @method elOrSelector + * @static + * @param {DOMElement|String} elOrSelector DOM Element or CSS Selector + * @param {String} fieldName The name of the field. Commonly used for debugging. + * @return {DOMElement} Returns the DOMElement passed or the first result of the CSS Selector. Otherwise it throws an exception. + * @example + * // In case there are several .myInput, it will retrieve the first found + * var el = Ink.UI.Common.elOrSelector('.myInput','My Input'); + */ + elOrSelector: function(elOrSelector, fieldName) { + if (!this.isDOMElement(elOrSelector)) { + var t = Selector.select(elOrSelector); + if (t.length === 0) { + Ink.warn(fieldName + ' must either be a DOM Element or a selector expression!\nThe script element must also be after the DOM Element itself.'); + return null; + } + return t[0]; + } + return elOrSelector; + }, + + /** + * Alias for `elOrSelector` but returns an array of elements. + * + * @method elsOrSelector + * + * @static + * @param {DOMElement|String} elOrSelector DOM Element or CSS Selector + * @param {String} fieldName The name of the field. Commonly used for debugging. + * @return {DOMElement} Returns the DOMElement passed or the first result of the CSS Selector. Otherwise it throws an exception. + * @param {Boolean} required Flag to accept an empty array as output. + * @return {Array} The selected DOM Elements. + * @example + * var elements = Ink.UI.Common.elsOrSelector('input.my-inputs', 'My Input'); + */ + elsOrSelector: function(elsOrSelector, fieldName, required) { + var ret; + if (typeof elsOrSelector === 'string') { + ret = Selector.select(elsOrSelector); + } else if (Common.isDOMElement(elsOrSelector)) { + ret = [elsOrSelector]; + } else if (elsOrSelector && typeof elsOrSelector === 'object' && typeof elsOrSelector.length === 'number') { + ret = elsOrSelector; + } + + if (ret && ret.length) { + return ret; + } else { + if (required) { + throw new TypeError(fieldName + ' must either be a DOM Element, an Array of elements, or a selector expression!\nThe script element must also be after the DOM Element itself.'); + } else { + return []; + } + } + }, + + /** + * Gets options an object and element's metadata. + * + * The element's data attributes take precedence. Values from the element's data-atrributes are coerced into the required type. + * + * @method options + * + * @param {Object} [fieldId] Name to be used in debugging features. + * @param {Object} defaults Object with the options' types and defaults. + * @param {Object} overrides Options to override the defaults. Usually passed when instantiating an UI module. + * @param {DOMElement} [element] Element with data-attributes + * + * @example + * + * this._options = Ink.UI.Common.options('MyComponent', { + * 'anobject': ['Object', null], // Defaults to null + * 'target': ['Element', null], + * 'stuff': ['Number', 0.1], + * 'stuff2': ['Integer', 0], + * 'doKickFlip': ['Boolean', false], + * 'targets': ['Elements'], // Required option since no default was given + * 'onClick': ['Function', null] + * }, options || {}, elm) + * + * @example + * + * ### Note about booleans + * + * Here is how options are read from the markup + * data-attributes, for several values`data-a-boolean`. + * + * Options considered true: + * + * - `data-a-boolean="true"` + * - (Every other value which is not on the list below.) + * + * Options considered false: + * + * - `data-a-boolean="false"` + * - `data-a-boolean=""` + * - `data-a-boolean` + * + * Options which go to default: + * + * - (no attribute). When `data-a-boolean` is ommitted, the + * option is not considered true nor false, and as such + * defaults to what is in the `defaults` argument. + * + **/ + options: function (fieldId, defaults, overrides, element) { + if (typeof fieldId !== 'string') { + element = overrides; + overrides = defaults; + defaults = fieldId; + fieldId = ''; + } + overrides = overrides || {}; + var out = {}; + var dataAttrs = element ? InkElement.data(element) : {}; + var fromDataAttrs; + var type; + var lType; + var defaultVal; + + var invalidStr = function (str) { + if (fieldId) { str = fieldId + ': "' + ('' + str).replace(/"/, '\\"') + '"'; } + return str; + }; + + var quote = function (str) { + return '"' + ('' + str).replace(/"/, '\\"') + '"'; + }; + + var invalidThrow = function (str) { + throw new Error(invalidStr(str)); + }; + + var invalid = function (str) { + Ink.error(invalidStr(str) + '. Ignoring option.'); + }; + + function optionValue(key) { + type = defaults[key][0]; + lType = type.toLowerCase(); + defaultVal = defaults[key].length === 2 ? defaults[key][1] : nothing; + + if (!type) { + invalidThrow('Ink.UI.Common.options: Always specify a type!'); + } + if (!(lType in Common._coerce_funcs)) { + invalidThrow('Ink.UI.Common.options: ' + defaults[key][0] + ' is not a valid type. Use one of ' + keys(Common._coerce_funcs).join(', ')); + + } + if (!defaults[key].length || defaults[key].length > 2) { + invalidThrow('the "defaults" argument must be an object mapping option names to [typestring, optional] arrays.'); + } + + if (key in dataAttrs) { + fromDataAttrs = Common._coerce_from_string(lType, dataAttrs[key], key, fieldId); + // (above can return `nothing`) + } else { + fromDataAttrs = nothing; + } + + if (fromDataAttrs !== nothing) { + if (!Common._options_validate(fromDataAttrs, lType)) { + invalid('(' + key + ' option) Invalid ' + lType + ' ' + quote(fromDataAttrs)); + return defaultVal; + } else { + return fromDataAttrs; + } + } else if (key in overrides) { + return overrides[key]; + } else if (defaultVal !== nothing) { + return defaultVal; + } else { + invalidThrow('Option ' + key + ' is required!'); + } + } + + for (var key in defaults) { + if (defaults.hasOwnProperty(key)) { + out[key] = optionValue(key); + } + } + + return out; + }, + + _coerce_from_string: function (type, val, paramName, fieldId) { + if (type in Common._coerce_funcs) { + return Common._coerce_funcs[type](val, paramName, fieldId); + } else { + return val; + } + }, + + _options_validate: function (val, type) { + if (type in Common._options_validate_types) { + return Common._options_validate_types[type].call(Common, val); + } else { + // 'object' options cannot be passed through data-attributes. + // Json you say? Not any good to embed in HTML. + return false; + } + }, + + _coerce_funcs: (function () { + var ret = { + element: function (val) { + return Common.elOrSelector(val, ''); + }, + elements: function (val) { + return Common.elsOrSelector(val, '', false /*not required, so don't throw an exception now*/); + }, + object: function (val) { return val; }, + number: function (val) { return parseFloat(val); }, + 'boolean': function (val) { + return !(val === 'false' || val === '' || val === null); + }, + string: function (val) { return val; }, + 'function': function (val, paramName, fieldId) { + Ink.error(fieldId + ': You cannot specify the option "' + paramName + '" through data-attributes because it\'s a function'); + return nothing; + } + }; + ret['float'] = ret.integer = ret.number; + return ret; + }()), + + _options_validate_types: (function () { + var types = { + string: function (val) { + return typeof val === 'string'; + }, + number: function (val) { + return typeof val === 'number' && !isNaN(val) && isFinite(val); + }, + integer: function (val) { + return val === Math.round(val); + }, + element: function (val) { + return Common.isDOMElement(val); + }, + elements: function (val) { + return val && typeof val === 'object' && typeof val.length === 'number' && val.length; + }, + 'boolean': function (val) { + return typeof val === 'boolean'; + }, + object: function () { return true; } + }; + types['float'] = types.number; + return types; + }()), + + /** + * Deep copy (clone) an object. + * Note: The object cannot have referece loops. + * + * @method clone + * @static + * @param {Object} o The object to be cloned/copied. + * @return {Object} Returns the result of the clone/copy. + * @example + * var originalObj = { + * key1: 'value1', + * key2: 'value2', + * key3: 'value3' + * }; + * var cloneObj = Ink.UI.Common.clone( originalObj ); + */ + clone: function(o) { + try { + return JSON.parse( JSON.stringify(o) ); + } catch (ex) { + throw new Error('Given object cannot have loops!'); + } + }, + + + /** + * Gets an element's one-base index relative to its parent. + * + * @method childIndex + * @static + * @param {DOMElement} childEl Valid DOM Element. + * @return {Number} Numerical position of an element relatively to its parent. + * @example + * + *
            + *
          • One
          • + *
          • Two
          • + *
          • Three
          • + *
          • Four
          • + *
          + * + * + */ + childIndex: function(childEl) { + if( Common.isDOMElement(childEl) ){ + var els = Selector.select('> *', childEl.parentNode); + for (var i = 0, f = els.length; i < f; ++i) { + if (els[i] === childEl) { + return i; + } + } + } + throw 'not found!'; + }, + + + /** + * AJAX JSON request shortcut method + * It provides a more convenient way to do an AJAX request and expect a JSON response.It also offers a callback option, as third parameter, for better async handling. + * + * @method ajaxJSON + * @static + * @async + * @param {String} endpoint Valid URL to be used as target by the request. + * @param {Object} params This field is used in the thrown Exception to identify the parameter. + * @param {Function} cb Callback for the request. + * @example + * // In case there are several .myInput, it will retrieve the first found + * var el = Ink.UI.Common.elOrSelector('.myInput','My Input'); + */ + ajaxJSON: function(endpoint, params, cb) { + new Ajax( + endpoint, + { + evalJS: 'force', + method: 'POST', + parameters: params, + + onSuccess: function( r) { + try { + r = r.responseJSON; + if (r.status !== 'ok') { + throw 'server error: ' + r.message; + } + cb(null, r); + } catch (ex) { + cb(ex); + } + }, + + onFailure: function() { + cb('communication failure'); + } + } + ); + }, + + + /** + * Gets the current Ink layout. + * + * @method currentLayout + * @static + * @return {String} A string representation of the current layout name. + * @example + * var inkLayout = Ink.UI.Common.currentLayout(); + * if (inkLayout === 'small') { + * // ... + * } + */ + currentLayout: function() { + var i, f, k, v, el, detectorEl = Selector.select('#ink-layout-detector')[0]; + if (!detectorEl) { + detectorEl = document.createElement('div'); + detectorEl.id = 'ink-layout-detector'; + for (k in this.Layouts) { + if (this.Layouts.hasOwnProperty(k)) { + v = this.Layouts[k]; + el = document.createElement('div'); + el.className = 'show-' + v + ' hide-all'; + el.setAttribute('data-ink-layout', v); + detectorEl.appendChild(el); + } + } + document.body.appendChild(detectorEl); + } + + for (i = 0, f = detectorEl.children.length; i < f; ++i) { + el = detectorEl.children[i]; + if (Css.getStyle(el, 'display') === 'block') { + return el.getAttribute('data-ink-layout'); + } + } + + return 'large'; + }, + + + /** + * Sets the location's hash (window.location.hash). + * + * @method hashSet + * @static + * @param {Object} o Object with the info to be placed in the location's hash. + * @example + * // It will set the location's hash like: #key1=value1&key2=value2&key3=value3 + * Ink.UI.Common.hashSet({ + * key1: 'value1', + * key2: 'value2', + * key3: 'value3' + * }); + */ + hashSet: function(o) { + if (typeof o !== 'object') { throw new TypeError('o should be an object!'); } + var hashParams = Url.getAnchorString(); + hashParams = Ink.extendObj(hashParams, o); + window.location.hash = Url.genQueryString('', hashParams).substring(1); + }, + + /** + * Removes children nodes from a given object. + * This method was initially created to help solve a problem in Internet Explorer(s) that occurred when trying to set the innerHTML of some specific elements like 'table'. + * + * @method cleanChildren + * @static + * @param {DOMElement} parentEl Valid DOM Element + * @example + * + *
            + *
          • One
          • + *
          • Two
          • + *
          • Three
          • + *
          • Four
          • + *
          + * + * + * + * + *
            + */ + cleanChildren: function(parentEl) { + if( !Common.isDOMElement(parentEl) ){ + throw 'Please provide a valid DOMElement'; + } + var prevEl, el = parentEl.lastChild; + while (el) { + prevEl = el.previousSibling; + parentEl.removeChild(el); + el = prevEl; + } + }, + + /** + * Stores the id and/or classes of an element in an object. + * + * @method storeIdAndClasses + * @static + * @param {DOMElement} fromEl Valid DOM Element to get the id and classes from. + * @param {Object} inObj Object where the id and classes will be saved. + * @example + *
            + * + * + */ + storeIdAndClasses: function(fromEl, inObj) { + if( !Common.isDOMElement(fromEl) ){ + throw 'Please provide a valid DOMElement as first parameter'; + } + + var id = fromEl.id; + if (id) { + inObj._id = id; + } + + var classes = fromEl.className; + if (classes) { + inObj._classes = classes; + } + }, + + /** + * Sets the id and className properties of an element based + * + * @method restoreIdAndClasses + * @static + * @param {DOMElement} toEl Valid DOM Element to set the id and classes on. + * @param {Object} inObj Object where the id and classes to be set are. This method uses the same format as the one given in `storeIdAndClasses` + * @example + *
            + * + * + * + * + *
            + */ + restoreIdAndClasses: function(toEl, inObj) { + + if( !Common.isDOMElement(toEl) ){ + throw 'Please provide a valid DOMElement as first parameter'; + } + + if (inObj._id && toEl.id !== inObj._id) { + toEl.id = inObj._id; + } + + if (inObj._classes && toEl.className.indexOf(inObj._classes) === -1) { + if (toEl.className) { toEl.className += ' ' + inObj._classes; } + else { toEl.className = inObj._classes; } + } + + if (inObj._instanceId && !toEl.getAttribute('data-instance')) { + toEl.setAttribute('data-instance', inObj._instanceId); + } + }, + + _warnDoubleInstantiation: function (elm, newInstance) { + var instances = Common.getInstance(elm); + + if (getName(newInstance) === '') { return; } + if (!instances) { return; } + + var nameWithoutVersion = getName(newInstance); + + if (!nameWithoutVersion) { return; } + + for (var i = 0, len = instances.length; i < len; i++) { + if (nameWithoutVersion === getName(instances[i])) { + // Yes, I am using + to concatenate and , to split + // arguments. + // + // Elements can't be concatenated with strings, but if + // they are passed in an argument, modern debuggers will + // pretty-print them and make it easy to find them in the + // element inspector. + // + // On the other hand, if strings are passed as different + // arguments, they get pretty printed. And the pretty + // print of a string has quotes around it. + // + // If some day people find out that strings are not + // just text and they start preserving contextual + // information, then by all means change this to a + // regular concatenation. + // + // But they won't. So don't change this. + Ink.warn('Creating more than one ' + nameWithoutVersion + '.', + '(Was creating a ' + nameWithoutVersion + ' on:', elm, ').'); + return false; + } + } + + function getName(thing) { + return ((thing.constructor && (thing.constructor._name)) || + thing._name || + '').replace(/_.*?$/, ''); + } + + return true; + }, + + /** + * Saves a component's instance reference for later retrieval. + * + * @method registerInstance + * @static + * @param {Object} inst Object that holds the instance. + * @param {DOMElement} el DOM Element to associate with the object. + */ + registerInstance: function(inst, el) { + if (!inst) { return; } + + if (!Common.isDOMElement(el)) { throw new TypeError('Ink.UI.Common.registerInstance: The element passed in is not a DOM element!'); } + + // [todo] this belongs in the BaseUIComponent's initialization + if (Common._warnDoubleInstantiation(el, inst) === false) { + return false; + } + + var instances = domRegistry.get(el); + + if (!instances) { + instances = []; + domRegistry.set(el, instances); + } + + instances.push(inst); + + return true; + }, + + /** + * Deletes an instance with a given id. + * + * @method unregisterInstance + * @static + * @param {String} id Id of the instance to be destroyed. + */ + unregisterInstance: function(inst) { + if (!inst || !inst._element) { return; } + var instances = domRegistry.get(inst._element); + for (var i = 0, len = instances.length; i < len; i++) { + if (instances[i] === inst) { + instances.splice(i, 1); + } + } + }, + + /** + * Gets an UI instance from an element or instance id. + * + * @method getInstance + * @static + * @param {String|DOMElement} el DOM Element from which we want the instances. + * @return {Object|Array} Returns an instance or a collection of instances. + */ + getInstance: function(el, UIComponent) { + el = Common.elOrSelector(el); + var instances = domRegistry.get(el); + + if (!instances) { + instances = []; + } + + if (typeof UIComponent !== 'function') { + return instances; + } + + for (var i = 0, len = instances.length; i < len; i++) { + if (instances[i] instanceof UIComponent) { + return instances[i]; + } + } + + return null; + }, + + /** + * Gets an instance based on a selector. + * + * @method getInstanceFromSelector + * @static + * @param {String} selector CSS selector to get the instances from. + * @return {Object|Array} Returns an instance or a collection of instances. + */ + getInstanceFromSelector: function(selector) { + return Common.getInstance(Common.elOrSelector(selector)); + }, + + /** + * Gets all the instance ids + * + * @method getInstanceIds + * @static + * @return {Array} Collection of instance ids + */ + getInstanceIds: function() { + var res = []; + for (var id in instances) { + if (instances.hasOwnProperty(id)) { + res.push( id ); + } + } + return res; + }, + + /** + * Gets all the instances + * + * @method getInstances + * @static + * @return {Array} Collection of existing instances. + */ + getInstances: function() { + var res = []; + for (var id in instances) { + if (instances.hasOwnProperty(id)) { + res.push( instances[id] ); + } + } + return res; + }, + + /** + * Boilerplate method to destroy a component. + * Components should copy this method as its destroy method and modify it. + * + * @method destroyComponent + * @static + */ + destroyComponent: function() { + Common.unregisterInstance(this); + this._element.parentNode.removeChild(this._element); + } + + }; + + + + + /** + * Ink UI Base Class + **/ + + function warnStub() { + /* jshint validthis: true */ + if (!this || this === window || typeof this.constructor !== 'function') { return; } + Ink.warn('You called a method on an incorrectly instantiated ' + this.constructor._name + ' component. Check the warnings above to see what went wrong.'); + } + + function stub(prototype, obj) { + for (var k in prototype) if (prototype.hasOwnProperty(k)) { + if (k === 'constructor') { continue; } + if (typeof obj[k] === 'function') { + obj[k] = warnStub; + } + } + } + + /** + * Ink UI Base Class + * + * You don't use this class directly, or inherit from it directly. + * + * See createUIComponent() (in this module) for how to create a UI component and inherit from this. It's not plain old JS inheritance, for several reasons. + * + * @class Ink.UI.Common.BaseUIComponent + * @constructor + * + * @param element + * @param options + **/ + function BaseUIComponent(element, options) { + var constructor = this.constructor; + var _name = constructor._name; + + if (!this || this === window) { + throw new Error('Use "new InkComponent()" instead of "InkComponent()"'); + } + + if (this && !(this instanceof BaseUIComponent)) { + throw new Error('You forgot to call Ink.UI.Common.createUIComponent() on this module!'); + } + + if (!element && !constructor._componentOptions.elementIsOptional) { + Ink.error(new Error(_name + ': You need to pass an element or a selector as the first argument to "new ' + _name + '()"')); + return; + } else { + this._element = Common.elsOrSelector(element, + _name + ': An element with the selector "' + element + '" was not found!')[0]; + } + + if (!this._element && !constructor._componentOptions.elementIsOptional) { + isValidInstance = false; + Ink.error(new Error(element + ' does not match an element on the page. You need to pass a valid selector to "new ' + _name + '".')); + } + + // TODO Change Common.options's signature? the below looks better, more manageable + // var options = Common.options({ + // element: this._element, + // modName: constructor._name, + // options: constructor._optionDefinition, + // defaults: constructor._globalDefaults + // }); + + this._options = Common.options(_name, constructor._optionDefinition, options, this._element); + + var isValidInstance = BaseUIComponent._validateInstance(this) === true; + + if (isValidInstance && typeof this._init === 'function') { + try { + this._init.apply(this, arguments); + } catch(e) { + isValidInstance = false; + Ink.error(e); + } + } + + if (!isValidInstance) { + BaseUIComponent._stubInstance(this, constructor, _name); + } else if (this._element) { + Common.registerInstance(this, this._element); + } + } + + /** + * Calls the `instance`'s _validate() method so it can validate itself. + * + * Returns false if the method exists, was called, but no Error was returned or thrown. + * + * @method _validateInstance + * @private + */ + BaseUIComponent._validateInstance = function (instance) { + var err; + + if (typeof instance._validate !== 'function') { return true; } + + try { + err = instance._validate(); + } catch (e) { + err = e; + } + + if (err instanceof Error) { + instance._validationError = err; + return false; + } + + return true; + }; + + + /** + * Replaces every method in the instance with stub functions which just call Ink.warn(). + * + * This avoids breaking the page when there are errors. + * + * @method _stubInstance + * @param instance + * @param constructor + * @param name + * @private + */ + BaseUIComponent._stubInstance = function (instance, constructor, name) { + stub(constructor.prototype, instance); + stub(BaseUIComponent.prototype, instance); + Ink.warn(name + ' was not correctly created. ' + (instance._validationError || '')); + }; + + // TODO BaseUIComponent.setGlobalOptions = function () {} + // TODO BaseUIComponent.createMany = function (selector) {} + BaseUIComponent.getInstance = function (elOrSelector) { + elOrSelector = Common.elOrSelector(elOrSelector); + return Common.getInstance(elOrSelector, this /* get instance by constructor */); + }; + + Ink.extendObj(BaseUIComponent.prototype, { + /** + * Get an UI component's option's value. + * + * @method getOption + * @param name + * + * @return The option value, or undefined if nothing is found. + * + * @example + * + * var myUIComponent = new Modal('#element', { trigger: '#trigger' }); // or anything else inheriting BaseUIComponent + * myUIComponent.getOption('trigger'); // -> The trigger element (not the selector string, mind you) + * + **/ + getOption: function (name) { + if (this.constructor && !(name in this.constructor._optionDefinition)) { + Ink.error('"' + name + '" is not an option for ' + this.constructor._name); + return undefined; + } + + return this._options[name]; + }, + + /** + * Sets an option's value + * + * @method getOption + * @param name + * @param value + * + * @example + * + * var myUIComponent = new Modal(...); + * myUIComponent.setOption('trigger', '#some-element'); + **/ + setOption: function (name, value) { + if (this.constructor && !(name in this.constructor._optionDefinition)) { + Ink.error('"' + name + ' is not an option for ' + this.constructor._name); + return; + } + + this._options[name] = value; + }, + + /** + * Get the element associated with an UI component (IE the one you used in the constructor) + * + * @method getElement + * @return {Element} The component's element. + * + * @example + * var myUIComponent = new Modal('#element'); // or anything else inheriting BaseUIComponent + * myUIComponent.getElement(); // -> The '#element' (not the selector string, mind you). + * + **/ + getElement: function () { + return this._element; + } + }); + + Common.BaseUIComponent = BaseUIComponent; + + /** + * @method createUIComponent + * @param theConstructor UI component constructor. It should have an _init function in its prototype, an _optionDefinition object, and a _name property indicating its name. + * @param options + * @param [options.elementIsOptional=false] Whether the element argument is optional (For example, when the component might work on existing markup or create its own). + **/ + Common.createUIComponent = function createUIComponent(theConstructor, options) { + theConstructor._componentOptions = options || {}; + + function assert(test, msg) { + if (!test) { + throw new Error('Ink.UI_1.createUIComponent: ' + msg); + } + } + + function assertProp(prop, propType, message) { + var propVal = theConstructor[prop]; + // Check that the property was passed + assert(typeof propVal !== 'undefined', + theConstructor + ' doesn\'t have a "' + prop + '" property. ' + message); + // Check that its type is correct + assert(propType && typeof propVal === propType, + 'typeof ' + theConstructor + '.' + prop + ' is not "' + propType + '". ' + message); + } + + assert(typeof theConstructor === 'function', + 'constructor argument is not a function!'); + + assertProp('_name', 'string', 'This property is used for error ' + + 'messages. Set it to the full module path and version (Ink.My.Module_1).'); + assertProp('_optionDefinition', 'object', 'This property contains the ' + + 'option names, types and defaults. See Ink.UI.Common.options() for reference.'); + + // Extend the instance methods and props + var _oldProto = theConstructor.prototype; + + if (typeof Object.create === 'function') { + theConstructor.prototype = Object.create(BaseUIComponent.prototype); + } else { + theConstructor.prototype = (function hideF() { + function F() {} + F.prototype = BaseUIComponent.prototype; + return new F(); + }()); + } + + Ink.extendObj(theConstructor.prototype, _oldProto); + theConstructor.prototype.constructor = theConstructor; + // Extend static methods + Ink.extendObj(theConstructor, BaseUIComponent); + }; + + return Common; + +}); diff --git a/public/js/ink.datepicker.js b/public/js/ink.datepicker.js new file mode 100644 index 0000000..595be5d --- /dev/null +++ b/public/js/ink.datepicker.js @@ -0,0 +1,1453 @@ +/** + * Date selector + * @module Ink.UI.DatePicker_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.DatePicker', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1','Ink.Util.Date_1', 'Ink.Dom.Browser_1'], function(Common, Event, Css, InkElement, Selector, InkArray, InkDate ) { + 'use strict'; + + // Clamp a number into a min/max limit + function clamp(n, min, max) { + if (n > max) { n = max; } + if (n < min) { n = min; } + + return n; + } + + function dateishFromYMDString(YMD) { + var split = YMD.split('-'); + return dateishFromYMD(+split[0], +split[1] - 1, +split[2]); + } + + function dateishFromYMD(year, month, day) { + return {_year: year, _month: month, _day: day}; + } + + function dateishFromDate(date) { + return {_year: date.getFullYear(), _month: date.getMonth(), _day: date.getDate()}; + } + + /** + * @class Ink.UI.DatePicker + * @constructor + * @version 1 + * + * @param {String|DOMElement} selector + * @param {Object} [options] Options + * @param {Boolean} [options.autoOpen] Flag to automatically open the datepicker. + * @param {String} [options.cleanText] Text for the clean button. Defaults to 'Clear'. + * @param {String} [options.closeText] Text for the close button. Defaults to 'Close'. + * @param {String} [options.cssClass] CSS class to be applied on the datepicker + * @param {String|DOMElement} [options.pickerField] (if not using in an input[type="text"]) Element which displays the DatePicker when clicked. Defaults to an "open" link. + * @param {String} [options.dateRange] Enforce limits to year, month and day for the Date, ex: '1990-08-25:2020-11' + * @param {Boolean} [options.displayInSelect] Flag to display the component in a select element. + * @param {String|DOMElement} [options.dayField] (if using options.displayInSelect) `select` field with days. + * @param {String|DOMElement} [options.monthField] (if using options.displayInSelect) `select` field with months. + * @param {String|DOMElement} [options.yearField] (if using options.displayInSelect) `select` field with years. + * @param {String} [options.format] Date format string + * @param {Object} [options.month] Hash of month names. Defaults to portuguese month names. January is 1. + * @param {String} [options.nextLinkText] Text for the previous button. Defaults to '«'. + * @param {String} [options.ofText] Text to show between month and year. Defaults to ' of '. + * @param {Boolean} [options.onFocus] If the datepicker should open when the target element is focused. Defaults to true. + * @param {Function} [options.onMonthSelected] Callback to execute when the month is selected. + * @param {Function} [options.onSetDate] Callback to execute when the date is set. + * @param {Function} [options.onYearSelected] Callback to execute when the year is selected. + * @param {String} [options.position] Position for the datepicker. Either 'right' or 'bottom'. Defaults to 'right'. + * @param {String} [options.prevLinkText] Text for the previous button. Defaults to '«'. + * @param {Boolean} [options.showClean] If the clean button should be visible. Defaults to true. + * @param {Boolean} [options.showClose] If the close button should be visible. Defaults to true. + * @param {Boolean} [options.shy] If the datepicker should start automatically. Defaults to true. + * @param {String} [options.startDate] Date to define initial month. Must be in yyyy-mm-dd format. + * @param {Number} [options.startWeekDay] First day of the week. Sunday is zero. Defaults to 1 (Monday). + * @param {Function} [options.validYearFn] Callback to execute when 'rendering' the month (in the month view) + * @param {Function} [options.validMonthFn] Callback to execute when 'rendering' the month (in the month view) + * @param {Function} [options.validDayFn] Callback to execute when 'rendering' the day (in the month view) + * @param {Function} [options.nextValidDateFn] Function to calculate the next valid date, given the current. Useful when there's invalid dates or time frames. + * @param {Function} [options.prevValidDateFn] Function to calculate the previous valid date, given the current. Useful when there's invalid dates or time frames. + * @param {Object} [options.wDay] Hash of week day names. Sunday is 0. Defaults to { 0:'Sunday', 1:'Monday', etc... + * @param {String} [options.yearRange] Enforce limits to year for the Date, ex: '1990:2020' (deprecated) + * + * @sample Ink_UI_DatePicker_1.html + */ + var DatePicker = function() { + Common.BaseUIComponent.apply(this, arguments); + }; + + DatePicker._name = 'DatePicker_1'; + + DatePicker._optionDefinition = { + autoOpen: ['Boolean', false], + cleanText: ['String', 'Clear'], + closeText: ['String', 'Close'], + pickerField: ['Element', null], + containerElement:['Element', null], + cssClass: ['String', 'ink-calendar bottom'], + dateRange: ['String', null], + + // use this in a "; + var type = typeof div.lastChild.getAttribute("multiple"); + // IE8 returns a string for some attributes even when not present + return type !== "boolean" && type !== "string"; + }); + + // Check if getElementsByClassName can be trusted + support.getElementsByClassName = assert(function( div ) { + // Opera can't find a second classname (in 9.6) + div.innerHTML = ""; + if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { + return false; + } + + // Safari 3.2 caches class attributes and doesn't catch changes + div.lastChild.className = "e"; + return div.getElementsByClassName("e").length === 2; + }); + + // Check if getElementsByName privileges form controls or returns elements by ID + // If so, assume (for broader support) that getElementById returns elements by name + support.getByName = assert(function( div ) { + // Inject content + div.id = expando + 0; + // Support: Windows 8 Native Apps + // Assigning innerHTML with "name" attributes throws uncatchable exceptions + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx + div.appendChild( document.createElement("a") ).setAttribute( "name", expando ); + div.appendChild( document.createElement("i") ).setAttribute( "name", expando ); + docElem.appendChild( div ); + + // Test + var pass = doc.getElementsByName && + // buggy browsers will return fewer than the correct 2 + doc.getElementsByName( expando ).length === 2 + + // buggy browsers will return more than the correct 0 + doc.getElementsByName( expando + 0 ).length; + + // Cleanup + docElem.removeChild( div ); + + return pass; + }); + + // Support: Webkit<537.32 + // Detached nodes confoundingly follow *each other* + support.sortDetached = assert(function( div1 ) { + return div1.compareDocumentPosition && + // Should return 1, but Webkit returns 4 (following) + (div1.compareDocumentPosition( document.createElement("div") ) & 1); + }); + + // IE6/7 return modified attributes + Expr.attrHandle = assert(function( div ) { + div.innerHTML = ""; + return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && + div.firstChild.getAttribute("href") === "#"; + }) ? + {} : + { + "href": function( elem ) { + return elem.getAttribute( "href", 2 ); + }, + "type": function( elem ) { + return elem.getAttribute("type"); + } + }; + + // ID find and filter + if ( support.getByName ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && documentIsHTML ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && documentIsHTML ) { + var m = context.getElementById( id ); + + return m ? + m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? + [m] : + undefined : + []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== strundefined ) { + return context.getElementsByTagName( tag ); + } + } : + function( tag, context ) { + var elem, + tmp = [], + i = 0, + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Name + Expr.find["NAME"] = support.getByName && function( tag, context ) { + if ( typeof context.getElementsByName !== strundefined ) { + return context.getElementsByName( name ); + } + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21), + // no need to also add to buggyMatches since matches checks buggyQSA + // A support test would require too much code (would include document ready) + rbuggyQSA = [ ":focus" ]; + + if ( (support.qsa = isNative(doc.querySelectorAll)) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + div.innerHTML = ""; + + // IE8 - Some boolean attributes are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + }); + + assert(function( div ) { + + // Opera 10-12/IE8 - ^= $= *= and empty values + // Should not select anything + div.innerHTML = ""; + if ( div.querySelectorAll("[i^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || + docElem.mozMatchesSelector || + docElem.webkitMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + // Element contains another + // Purposefully does not implement inclusive descendent + // As in, an element does not contain itself + contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + // Document order sorting + sortOrder = docElem.compareDocumentPosition ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); + + if ( compare ) { + // Disconnected nodes + if ( compare & 1 || + (recompare && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === doc || contains(preferredDoc, a) ) { + return -1; + } + if ( b === doc || contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } + + // Not directly comparable, sort on existence of method + return a.compareDocumentPosition ? -1 : 1; + } : + function( a, b ) { + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Parentless nodes are either documents or disconnected + } else if ( !aup || !bup ) { + return a === doc ? -1 : + b === doc ? 1 : + aup ? -1 : + bup ? 1 : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + // rbuggyQSA always contains :focus, so no need for an existence check + if ( support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch(e) {} + } + + return Sizzle( expr, document, null, [elem] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + var val; + + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + if ( documentIsHTML ) { + name = name.toLowerCase(); + } + if ( (val = Expr.attrHandle[ name ]) ) { + return val( elem ); + } + if ( !documentIsHTML || support.attributes ) { + return elem.getAttribute( name ); + } + return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? + name : + val && val.specified ? val.value : null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +// Document sorting and removing duplicates +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + // Compensate for sort limitations + recompare = !support.sortDetached; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + return results; +}; + +/* + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns Returns -1 if a precedes b, 1 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +// Returns a function to use in pseudos for input types +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +// Returns a function to use in pseudos for buttons +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +// Returns a function to use in pseudos for positionals +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/* + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + for ( ; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (see #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[5] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[4] ) { + match[2] = match[4]; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeName ) { + if ( nodeName === "*" ) { + return function() { return true; }; + } + + nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, outerCache, node, diff, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + // Seek `elem` from a previously-cached index + outerCache = parent[ expando ] || (parent[ expando ] = {}); + cache = outerCache[ type ] || []; + nodeIndex = cache[0] === dirruns && cache[1]; + diff = cache[0] === dirruns && cache[2]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + // Use previously-cached element index if available + } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { + diff = cache[1]; + + // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) + } else { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { + // Cache the index of each encountered element + if ( useCache ) { + (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf.call( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), + // not comment, processing instructions, or others + // Thanks to Diego Perini for the nodeName shortcut + // Greater than "@" means alpha characters (specifically not starting with "#" or "?") + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +function tokenize( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( tokens = [] ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push( { + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + } ); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push( { + value: matched, + type: type, + matches: match + } ); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +} + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var data, cache, outerCache, + dirkey = dirruns + " " + doneName; + + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { + if ( (data = cache[1]) === true || data === cachedruns ) { + return data === true; + } + } else { + cache = outerCache[ dir ] = [ dirkey ]; + cache[1] = matcher( elem, context, xml ) || cachedruns; + if ( cache[1] === true ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf.call( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + // A counter to specify which element is currently being matched + var matcherCachedRuns = 0, + bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, expandContext ) { + var elem, j, matcher, + setMatched = [], + matchedCount = 0, + i = "0", + unmatched = seed && [], + outermost = expandContext != null, + contextBackup = outermostContext, + // We must always have either seed elements or context + elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); + + if ( outermost ) { + outermostContext = context !== document && context; + cachedruns = matcherCachedRuns; + } + + // Add elements passing elementMatchers directly to results + // Keep `i` a string if there are no elements so `matchedCount` will be "00" below + for ( ; (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + cachedruns = ++matcherCachedRuns; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !group ) { + group = tokenize( selector ); + } + i = group.length; + while ( i-- ) { + cached = matcherFromTokens( group[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + } + return cached; +}; + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function select( selector, context, results, seed ) { + var i, tokens, token, type, find, + match = tokenize( selector ); + + if ( !seed ) { + // Try to minimize operations if there is only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && context.parentNode || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + } + + // Compile and execute a filtering function + // Provide `match` to avoid retokenization if we modified the selector above + compile( selector, match )( + seed, + context, + !documentIsHTML, + results, + rsibling.test( selector ) + ); + return results; +} + +// Deprecated +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +// Check sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Initialize with the default document +setDocument(); + +// Always assume the presence of duplicates if sort doesn't +// pass them to our comparison function (as in Google Chrome). +[0, 0].sort( sortOrder ); +support.detectDuplicates = hasDuplicate; + +// EXPOSE +/*if ( typeof define === "function" && define.amd ) { + define(function() { return Sizzle; }); +} else { + window.Sizzle = Sizzle; +}*/ +// EXPOSE + +/** + * @namespace Ink.Dom.Selector + * @static + */ + +/** + * Alias for the Sizzle selector engine + * + * @method select + * @param {String} selector CSS selector to search for elements + * @param {DOMElement} [context] By default the search is done in the document element. However, you can specify an element as search context + * @param {Array} [results] By default this is considered an empty array. But if you want to merge it with other searches you did, pass their result array through here. + * @return {Array} Array of resulting DOM Elements + * @sample Ink_Dom_Selector_select.html + */ + +/** + * Filters elements that match a CSS selector. + * + * @method matches + * @param {String} selector CSS selector to search for elements + * @param {Array} matches Elements to be 'matched' with + * @return {Array} Elements that matched + * @sample Ink_Dom_Selector_matches.html + */ + +/** + * Checks if an element matches a given selector + * + * @method matchesSelector + * @param {DOMElement} element Element to test + * @param {String} selector CSS selector to test the element with + * @return {Boolean} True if element matches the CSS selector + * @sample Ink_Dom_Selector_matchesSelector.html + */ + +return { + select: Sizzle, + matches: Sizzle.matches, + matchesSelector: Sizzle.matchesSelector +}; + + +}); //( window ); + +/** + * Array Utilities + * @module Ink.Util.Array_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Array', '1', [], function() { + + 'use strict'; + + var arrayProto = Array.prototype; + + /** + * @namespace Ink.Util.Array_1 + */ + + var InkArray = { + + /** + * Checks if a value is an array + * + * @method isArray + * @param testedObject {Mixed} The object we want to check + **/ + isArray: Array.isArray || function (testedObject) { + return {}.toString.call(testedObject) === '[object Array]'; + }, + + /** + * Loops through an array, grouping similar items together. + * @method groupBy + * @param arr {Array} The input array. + * @param [options] {Object} options object, containing: + * @param [options.key] {Function} A function which computes the group key by which the items are grouped. + * @param [options.pairs] {Boolean} Set to `true` if you want to output an array of `[key, [group...]]` pairs instead of an array of groups. + * @return {Array} An array of arrays of chunks. + * + * @example + * + * InkArray.groupBy([1, 1, 2, 2, 3, 1]) // -> [ [1, 1], [2, 2], [3], [1] ] + * InkArray.groupBy([1.1, 1.2, 2.1], { key: Math.floor }) // -> [ [1.1, 1.2], [2.1] ] + * InkArray.groupBy([1.1, 1.2, 2.1], { key: Math.floor, pairs: true }) // -> [ [1, [1.1, 1.2]], [2, [2.1]] ] + * + **/ + groupBy: function (arr, options) { + options = options || {}; + var ret = []; + var latestGroup; + function eq(a, b) { + return outKey(a) === outKey(b); + } + function outKey(item) { + if (typeof options.key === 'function') { + return options.key(item); + } else { + return item; + } + } + + for (var i = 0, len = arr.length; i < len; i++) { + latestGroup = [arr[i]]; + + // Chunkin' + while ((i + 1 < len) && eq(arr[i], arr[i + 1])) { + latestGroup.push(arr[i + 1]); + i++; + } + + if (options.pairs) { + ret.push([outKey(arr[i]), latestGroup]); + } else { + ret.push(latestGroup); + } + } + return ret; + }, + + /** + * Replacement for Array.prototype.reduce. + * + * Produces a single result from a list of values by calling an "aggregator" function. + * + * Falls back to Array.prototype.reduce if available. + * + * @method reduce + * @param array {Array} Input array to be reduced. + * @param callback {Function} `function (previousValue, currentValue, index, all) { return {Mixed} }` to execute for each value. + * @param initial {Mixed} Object used as the first argument to the first call of `callback` + * + * @example + * var sum = InkArray.reduce([1, 2, 3], function (a, b) { return a + b; }); // -> 6 + */ + reduce: function (array, callback, initial) { + if (arrayProto.reduce) { + return arrayProto.reduce.apply(array, [].slice.call(arguments, 1)); + } + + // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Polyfill + var t = Object( array ), len = t.length >>> 0, k = 0, value; + if ( arguments.length >= 3 ) { + value = initial; + } else { + while ( k < len && !(k in t) ) k++; + if ( k >= len ) + throw new TypeError('Reduce of empty array with no initial value'); + value = t[ k++ ]; + } + for ( ; k < len ; k++ ) { + if ( k in t ) { + value = callback( value, t[k], k, t ); + } + } + return value; + }, + + /** + * Checks if a value exists in array + * + * @method inArray + * @public + * @static + * @param {Mixed} value Value to check + * @param {Array} arr Array to search in + * @return {Boolean} True if value exists in the array + * @sample Ink_Util_Array_inArray.html + */ + inArray: function(value, arr) { + if (typeof arr === 'object') { + for (var i = 0, f = arr.length; i < f; ++i) { + if (arr[i] === value) { + return true; + } + } + } + return false; + }, + + /** + * Sorts an array of objects by an object property + * + * @method sortMulti + * @param {Array} arr Array of objects to sort + * @param {String} key Property to sort by + * @return {Array|Boolean} False if it's not an array, returns a sorted array if it's an array. + * @public + * @static + * @sample Ink_Util_Array_sortMulti.html + */ + sortMulti: function(arr, key) { + if (typeof arr === 'undefined' || arr.constructor !== Array) { return false; } + if (typeof key !== 'string') { return arr.sort(); } + if (arr.length > 0) { + if (typeof(arr[0][key]) === 'undefined') { return false; } + arr.sort(function(a, b){ + var x = a[key]; + var y = b[key]; + return ((x < y) ? -1 : ((x > y) ? 1 : 0)); + }); + } + return arr; + }, + + /** + * Gets the indexes of a value in an array + * + * @method keyValue + * @param {String} value Value to search for. + * @param {Array} arr Array to run the search in. + * @param {Boolean} [first] Flag to stop the search at the first match. It also returns an index number instead of an array of indexes. + * @return {Boolean|Number|Array} False for no matches. Array of matches or first match index. + * @public + * @static + * @sample Ink_Util_Array_keyValue.html + */ + keyValue: function(value, arr, first) { + if (typeof value !== 'undefined' && typeof arr === 'object' && this.inArray(value, arr)) { + var aKeys = []; + for (var i = 0, f = arr.length; i < f; ++i) { + if (arr[i] === value) { + if (typeof first !== 'undefined' && first === true) { + return i; + } else { + aKeys.push(i); + } + } + } + return aKeys; + } + return false; + }, + + /** + * Shuffles an array. + * + * @method shuffle + * @param {Array} arr Array to shuffle + * @return {Array|Boolean} Shuffled Array or false if not an array. + * @public + * @static + * @sample Ink_Util_Array_shuffle.html + */ + shuffle: function(arr) { + if (typeof(arr) !== 'undefined' && arr.constructor !== Array) { return false; } + var total = arr.length, + tmp1 = false, + rnd = false; + + while (total--) { + rnd = Math.floor(Math.random() * (total + 1)); + tmp1 = arr[total]; + arr[total] = arr[rnd]; + arr[rnd] = tmp1; + } + return arr; + }, + + /** + * Runs a function through each of the elements of an array + * + * @method forEach + * @param {Array} arr The array to be cycled/iterated + * @param {Function} cb The function receives as arguments the value, index and array. + * @return {Array} Iterated array. + * @public + * @static + * @sample Ink_Util_Array_forEach.html + */ + forEach: function(array, callback, context) { + if (arrayProto.forEach) { + return arrayProto.forEach.call(array, callback, context); + } + for (var i = 0, len = array.length >>> 0; i < len; i++) { + callback.call(context, array[i], i, array); + } + }, + + /** + * Alias for backwards compatibility. See forEach + * + * @method each + */ + each: function () { + InkArray.forEach.apply(InkArray, [].slice.call(arguments)); + }, + + /** + * Runs a function for each item in the array. + * That function will receive each item as an argument and its return value will change the corresponding array item. + * @method map + * @param {Array} array The array to map over + * @param {Function} map The map function. Will take `(item, index, array)` as arguments and `this` will be the `context` argument. + * @param {Object} [context] Object to be `this` in the map function. + * + * @sample Ink_Util_Array_map.html + */ + map: function (array, callback, context) { + if (arrayProto.map) { + return arrayProto.map.call(array, callback, context); + } + var mapped = new Array(len); + for (var i = 0, len = array.length >>> 0; i < len; i++) { + mapped[i] = callback.call(context, array[i], i, array); + } + return mapped; + }, + + /** + * Filters an array based on a truth test. + * This method runs a test function on all the array values and returns a new array with all the values that pass the test. + * @method filter + * @param {Array} array The array to filter + * @param {Function} test A test function taking `(item, index, array)` + * @param {Object} [context] Object to be `this` in the test function. + * @return {Array} Returns the filtered array + * + * @sample Ink_Util_Array_filter.html + */ + filter: function (array, test, context) { + if (arrayProto.filter) { + return arrayProto.filter.call(array, test, context); + } + var filtered = [], + val = null; + for (var i = 0, len = array.length; i < len; i++) { + val = array[i]; // it might be mutated + if (test.call(context, val, i, array)) { + filtered.push(val); + } + } + return filtered; + }, + + /** + * Checks if some element in the array passes a truth test + * + * @method some + * @param {Array} arr The array to iterate through + * @param {Function} cb The callback to be called on the array's elements. It receives the value, the index and the array as arguments. + * @param {Object} context Object of the callback function + * @return {Boolean} True if the callback returns true at any point, false otherwise + * @public + * @static + * @sample Ink_Util_Array_some.html + */ + some: function(arr, cb, context){ + + if (arr === null){ + throw new TypeError('First argument is invalid.'); + } + + var t = Object(arr); + var len = t.length >>> 0; + if (typeof cb !== "function"){ throw new TypeError('Second argument must be a function.'); } + + for (var i = 0; i < len; i++) { + if (i in t && cb.call(context, t[i], i, t)){ return true; } + } + + return false; + }, + + /** + * Compares the values of two arrays and return the matches + * + * @method intersect + * @param {Array} arr1 First array + * @param {Array} arr2 Second array + * @return {Array} Empty array if one of the arrays is false (or do not intersect) | Array with the intersected values + * @public + * @static + * @sample Ink_Util_Array_intersect.html + */ + intersect: function(arr1, arr2) { + if (!arr1 || !arr2 || arr1 instanceof Array === false || arr2 instanceof Array === false) { + return []; + } + + var shared = []; + for (var i = 0, I = arr1.length; i 0) { + for (x = a; x < b; x += step) { + r.push(x); + } + } else { + for (x = a; x > b; x += step) { + r.push(x); + } + } + + return r; + }, + + /** + * Inserts a value on a specified index + * + * @method insert + * @param {Array} arr Array where the value will be inserted + * @param {Number} idx Index of the array where the value should be inserted + * @param {Mixed} value Value to be inserted + * @public + * @static + * @sample Ink_Util_Array_insert.html + */ + insert: function(arr, idx, value) { + arr.splice(idx, 0, value); + }, + + /** + * Removes a range of values from the array + * + * @method remove + * @param {Array} arr Array where the value will be removed + * @param {Number} from Index of the array where the removal will start removing. + * @param {Number} rLen Number of items to be removed from the index onwards. + * @return {Array} An array with the remaining values + * @public + * @static + * @sample Ink_Util_Array_remove.html + */ + remove: function(arr, from, rLen){ + var output = []; + + for(var i = 0, iLen = arr.length; i < iLen; i++){ + if(i >= from && i < from + rLen){ + continue; + } + + output.push(arr[i]); + } + + return output; + } + }; + + return InkArray; + +}); + +/** + * Binary Packing algorithm implementation + * @module Ink.Util.BinPack_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.BinPack', '1', [], function() { + + 'use strict'; + + /*jshint boss:true */ + + // https://github.com/jakesgordon/bin-packing/ + + /* + Copyright (c) 2011, 2012, 2013 Jake Gordon and contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + + + + var Packer = function(w, h) { + this.init(w, h); + }; + + Packer.prototype = { + + init: function(w, h) { + this.root = { x: 0, y: 0, w: w, h: h }; + }, + + fit: function(blocks) { + var n, node, block; + for (n = 0; n < blocks.length; ++n) { + block = blocks[n]; + if (node = this.findNode(this.root, block.w, block.h)) { + block.fit = this.splitNode(node, block.w, block.h); + } + } + }, + + findNode: function(root, w, h) { + if (root.used) { + return this.findNode(root.right, w, h) || this.findNode(root.down, w, h); + } + else if ((w <= root.w) && (h <= root.h)) { + return root; + } + else { + return null; + } + }, + + splitNode: function(node, w, h) { + node.used = true; + node.down = { x: node.x, y: node.y + h, w: node.w, h: node.h - h }; + node.right = { x: node.x + w, y: node.y, w: node.w - w, h: h }; + return node; + } + + }; + + + + var GrowingPacker = function() {}; + + GrowingPacker.prototype = { + + fit: function(blocks) { + var n, node, block, len = blocks.length; + var w = len > 0 ? blocks[0].w : 0; + var h = len > 0 ? blocks[0].h : 0; + this.root = { x: 0, y: 0, w: w, h: h }; + for (n = 0; n < len ; n++) { + block = blocks[n]; + if (node = this.findNode(this.root, block.w, block.h)) { + block.fit = this.splitNode(node, block.w, block.h); + } + else { + block.fit = this.growNode(block.w, block.h); + } + } + }, + + findNode: function(root, w, h) { + if (root.used) { + return this.findNode(root.right, w, h) || this.findNode(root.down, w, h); + } + else if ((w <= root.w) && (h <= root.h)) { + return root; + } + else { + return null; + } + }, + + splitNode: function(node, w, h) { + node.used = true; + node.down = { x: node.x, y: node.y + h, w: node.w, h: node.h - h }; + node.right = { x: node.x + w, y: node.y, w: node.w - w, h: h }; + return node; + }, + + growNode: function(w, h) { + var canGrowDown = (w <= this.root.w); + var canGrowRight = (h <= this.root.h); + + var shouldGrowRight = canGrowRight && (this.root.h >= (this.root.w + w)); // attempt to keep square-ish by growing right when height is much greater than width + var shouldGrowDown = canGrowDown && (this.root.w >= (this.root.h + h)); // attempt to keep square-ish by growing down when width is much greater than height + + if (shouldGrowRight) { + return this.growRight(w, h); + } + else if (shouldGrowDown) { + return this.growDown(w, h); + } + else if (canGrowRight) { + return this.growRight(w, h); + } + else if (canGrowDown) { + return this.growDown(w, h); + } + else { + return null; // need to ensure sensible root starting size to avoid this happening + } + }, + + growRight: function(w, h) { + this.root = { + used: true, + x: 0, + y: 0, + w: this.root.w + w, + h: this.root.h, + down: this.root, + right: { x: this.root.w, y: 0, w: w, h: this.root.h } + }; + var node; + if (node = this.findNode(this.root, w, h)) { + return this.splitNode(node, w, h); + } + else { + return null; + } + }, + + growDown: function(w, h) { + this.root = { + used: true, + x: 0, + y: 0, + w: this.root.w, + h: this.root.h + h, + down: { x: 0, y: this.root.h, w: this.root.w, h: h }, + right: this.root + }; + var node; + if (node = this.findNode(this.root, w, h)) { + return this.splitNode(node, w, h); + } + else { + return null; + } + } + + }; + + + + var sorts = { + random: function() { return Math.random() - 0.5; }, + w: function(a, b) { return b.w - a.w; }, + h: function(a, b) { return b.h - a.h; }, + a: function(a, b) { return b.area - a.area; }, + max: function(a, b) { return Math.max(b.w, b.h) - Math.max(a.w, a.h); }, + min: function(a, b) { return Math.min(b.w, b.h) - Math.min(a.w, a.h); }, + height: function(a, b) { return sorts.msort(a, b, ['h', 'w']); }, + width: function(a, b) { return sorts.msort(a, b, ['w', 'h']); }, + area: function(a, b) { return sorts.msort(a, b, ['a', 'h', 'w']); }, + maxside: function(a, b) { return sorts.msort(a, b, ['max', 'min', 'h', 'w']); }, + msort: function(a, b, criteria) { /* sort by multiple criteria */ + var diff, n; + for (n = 0; n < criteria.length; ++n) { + diff = sorts[ criteria[n] ](a, b); + if (diff !== 0) { + return diff; + } + } + return 0; + } + }; + + + + // end of Jake's code + + + + // aux, used to display blocks in unfitted property + var toString = function() { + return [this.w, ' x ', this.h].join(''); + }; + + + + /** + * Binary Packing algorithm implementation + * + * Based on the work of Jake Gordon + * + * see https://github.com/jakesgordon/bin-packing/ + * + * @namespace Ink.Util.BinPack + * @version 1 + * @static + */ + var BinPack = { + + /** + * @method binPack + * @param {Object} o Options + * @param {Array} o.blocks Array of items with width and height integer attributes. + * @param {Array} [o.dimensions] Flag to fix container dimensions + * @param {String} [o.sorter] Sorting function. One of: random, height, width, area, maxside + * @return {Object} Returns an object containing container dimensions, filled ratio, fitted blocks, unfitted blocks and all blocks + * @static + */ + binPack: function(o) { + var i, f, bl; + + + + // calculate area if not there already + for (i = 0, f = o.blocks.length; i < f; ++i) { + bl = o.blocks[i]; + if (! ('area' in bl) ) { + bl.area = bl.w * bl.h; + } + } + + + + // apply algorithm + var packer = o.dimensions ? new Packer(o.dimensions[0], o.dimensions[1]) : new GrowingPacker(); + + if (!o.sorter) { o.sorter = 'maxside'; } + + o.blocks.sort( sorts[ o.sorter ] ); + + packer.fit(o.blocks); + + var dims2 = [packer.root.w, packer.root.h]; + + + + // layout is done here, generating report data... + var fitted = []; + var unfitted = []; + + for (i = 0, f = o.blocks.length; i < f; ++i) { + bl = o.blocks[i]; + if (bl.fit) { + fitted.push(bl); + } + else { + bl.toString = toString; // TO AID SERIALIZATION + unfitted.push(bl); + } + } + + var area = dims2[0] * dims2[1]; + var fit = 0; + for (i = 0, f = fitted.length; i < f; ++i) { + bl = fitted[i]; + fit += bl.area; + } + + return { + dimensions: dims2, + filled: fit / area, + blocks: o.blocks, + fitted: fitted, + unfitted: unfitted + }; + } + }; + + + + return BinPack; + +}); +/** + * Cookie Utilities + * @module Ink.Util.Cookie_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Cookie', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.Cookie_1 + */ + var Cookie = { + + /** + * Gets an object with the current page cookies. + * + * @method get + * @param {String} name The cookie name. + * @return {String|Object} If the name is specified, it returns the value of that key. Otherwise it returns the full cookie object + * @public + * @static + * @sample Ink_Util_Cookie_get.html + */ + get: function(name) + { + var cookie = document.cookie || false; + + var _Cookie = {}; + if(cookie) { + cookie = cookie.replace(new RegExp("; ", "g"), ';'); + var aCookie = cookie.split(';'); + var aItem = []; + if(aCookie.length > 0) { + for(var i=0; i < aCookie.length; i++) { + aItem = aCookie[i].split('='); + if(aItem.length === 2) { + _Cookie[aItem[0]] = decodeURIComponent(aItem[1]); + } + aItem = []; + } + } + } + if(name) { + if(typeof(_Cookie[name]) !== 'undefined') { + return _Cookie[name]; + } else { + return null; + } + } + return _Cookie; + }, + + /** + * Sets a cookie. + * + * @method set + * @param {String} name Cookie name. + * @param {String} value Cookie value. + * @param {Number} [expires] Number of seconds the cookie will be valid for. + * @param {String} [path] Path for the cookie. Defaults to '/'. + * @param {String} [domain] Domain for the cookie. Defaults to current hostname. + * @param {Boolean} [secure] Flag for secure. Default 'false'. + * @public + * @static + * @sample Ink_Util_Cookie_set.html + */ + set: function(name, value, expires, path, domain, secure) + { + var sName; + if(!name || value===false || typeof(name) === 'undefined' || typeof(value) === 'undefined') { + return false; + } else { + sName = name+'='+encodeURIComponent(value); + } + var sExpires = false; + var sPath = false; + var sDomain = false; + var sSecure = false; + + if(expires && typeof(expires) !== 'undefined' && !isNaN(expires)) { + var oDate = new Date(); + var sDate = (parseInt(Number(oDate.valueOf()), 10) + (Number(parseInt(expires, 10)) * 1000)); + + var nDate = new Date(sDate); + var expiresString = nDate.toGMTString(); + + var re = new RegExp("([^\\s]+)(\\s\\d\\d)\\s(\\w\\w\\w)\\s(.*)"); + expiresString = expiresString.replace(re, "$1$2-$3-$4"); + + sExpires = 'expires='+expiresString; + } else { + if(typeof(expires) !== 'undefined' && !isNaN(expires) && Number(parseInt(expires, 10))===0) { + sExpires = ''; + } else { + sExpires = 'expires=Thu, 01-Jan-2037 00:00:01 GMT'; + } + } + + if(path && typeof(path) !== 'undefined') { + sPath = 'path='+path; + } else { + sPath = 'path=/'; + } + + if(domain && typeof(domain) !== 'undefined') { + sDomain = 'domain='+domain; + } else { + var portClean = new RegExp(":(.*)"); + sDomain = 'domain='+window.location.host; + sDomain = sDomain.replace(portClean,""); + } + + if(secure && typeof(secure) !== 'undefined') { + sSecure = secure; + } else { + sSecure = false; + } + + document.cookie = sName+'; '+sExpires+'; '+sPath+'; '+sDomain+'; '+sSecure; + }, + + /** + * Deletes a cookie. + * + * @method remove + * @param {String} cookieName Cookie name. + * @param {String} [path] Path of the cookie. Defaults to '/'. + * @param {String} [domain] Domain of the cookie. Defaults to current hostname. + * @public + * @static + * @sample Ink_Util_Cookie_remove.html + */ + remove: function(cookieName, path, domain) + { + //var expiresDate = 'Thu, 01-Jan-1970 00:00:01 GMT'; + var sPath = false; + var sDomain = false; + var expiresDate = -999999999; + + if(path && typeof(path) !== 'undefined') { + sPath = path; + } else { + sPath = '/'; + } + + if(domain && typeof(domain) !== 'undefined') { + sDomain = domain; + } else { + sDomain = window.location.host; + } + + this.set(cookieName, 'deleted', expiresDate, sPath, sDomain); + } + }; + + return Cookie; + +}); + +/** + * Date utility functions + * @module Ink.Util.Date_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Date', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.Date_1 + */ + var InkDate = { + + /** + * Function that returns the string representation of the month [PT only] + * + * @method _months + * @param {Number} index Month javascript (0 to 11) + * @return {String} The month's name + * @private + * @static + * @example + * console.log( InkDate._months(0) ); // Result: Janeiro + */ + _months: function(index){ + var _m = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro']; + return _m[index]; + }, + + /** + * Function that returns the month [PT only] ( 0 to 11 ) + * + * @method _iMonth + * @param {String} month Month javascript (0 to 11) + * @return {Number} The month's number + * @private + * @static + * @example + * console.log( InkDate._iMonth('maio') ); // Result: 4 + */ + _iMonth : function( month ) + { + if ( Number( month ) ) { return +month - 1; } + return { + 'janeiro' : 0 , + 'jan' : 0 , + 'fevereiro' : 1 , + 'fev' : 1 , + 'março' : 2 , + 'mar' : 2 , + 'abril' : 3 , + 'abr' : 3 , + 'maio' : 4 , + 'mai' : 4 , + 'junho' : 5 , + 'jun' : 5 , + 'julho' : 6 , + 'jul' : 6 , + 'agosto' : 7 , + 'ago' : 7 , + 'setembro' : 8 , + 'set' : 8 , + 'outubro' : 9 , + 'out' : 9 , + 'novembro' : 10 , + 'nov' : 10 , + 'dezembro' : 11 , + 'dez' : 11 + }[ month.toLowerCase( ) ]; + } , + + /** + * Function that returns the representation the day of the week [PT Only] + * + * @method _wDays + * @param {Number} index Week's day index + * @return {String} The week's day name + * @private + * @static + * @example + * console.log( InkDate._wDays(0) ); // Result: Domingo + */ + _wDays: function(index){ + var _d = ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado']; + return _d[index]; + }, + + /** + * Function that returns day of the week in javascript 1 to 7 + * + * @method _iWeek + * @param {String} week Week's day name + * @return {Number} The week's day index + * @private + * @static + * @example + * console.log( InkDate._iWeek('quarta') ); // Result: 3 + */ + _iWeek: function( week ) + { + if ( Number( week ) ) { return +week || 7; } + return { + 'segunda' : 1 , + 'seg' : 1 , + 'terça' : 2 , + 'ter' : 2 , + 'quarta' : 3 , + 'qua' : 3 , + 'quinta' : 4 , + 'qui' : 4 , + 'sexta' : 5 , + 'sex' : 5 , + 'sábado' : 6 , + 'sáb' : 6 , + 'domingo' : 7 , + 'dom' : 7 + }[ week.toLowerCase( ) ]; + }, + + /** + * Function that returns the number of days of a given month (m) on a given year (y) + * + * @method _daysInMonth + * @param {Number} _m Month + * @param {Number} _y Year + * @return {Number} Number of days of a give month on a given year + * @private + * @static + * @example + * console.log( InkDate._daysInMonth(2,2013) ); // Result: 28 + */ + _daysInMonth: function(_m,_y){ + var nDays; + + if(_m===1 || _m===3 || _m===5 || _m===7 || _m===8 || _m===10 || _m===12) + { + nDays= 31; + } + else if ( _m===4 || _m===6 || _m===9 || _m===11) + { + nDays = 30; + } + else + { + if((_y%400===0) || (_y%4===0 && _y%100!==0)) + { + nDays = 29; + } + else + { + nDays = 28; + } + } + return nDays; + }, + + /** + * Formats a date object. + * This works exactly as php date() function. http://php.net/manual/en/function.date.php + * + * @method get + * @param {String} format The format in which the date it will be formatted. + * @param {Date} [_date] The date to format. Can receive unix timestamp or a date object. Defaults to current time. + * @return {String} Formatted date + * @public + * @static + * @sample Ink_Util_Date_get.html + */ + get: function(format, _date){ + /*jshint maxcomplexity:65 */ + if(typeof(format) === 'undefined' || format === ''){ + format = "Y-m-d"; + } + + + var iFormat = format.split(""); + var result = new Array(iFormat.length); + var escapeChar = "\\"; + var jsDate; + + if (typeof(_date) === 'undefined'){ + jsDate = new Date(); + } else if (typeof(_date)==='number'){ + jsDate = new Date(_date*1000); + } else { + jsDate = new Date(_date); + } + + var jsFirstDay, jsThisDay, jsHour; + /* This switch is presented in the same order as in php date function (PHP 5.2.2) */ + for (var i = 0; i < iFormat.length; i++) { + switch(iFormat[i]) { + case escapeChar: + result[i] = iFormat[i+1]; + i++; + break; + + + /* DAY */ + case "d": /* Day of the month, 2 digits with leading zeros; ex: 01 to 31 */ + var jsDay = jsDate.getDate(); + result[i] = (String(jsDay).length > 1) ? jsDay : "0" + jsDay; + break; + + case "D": /* A textual representation of a day, three letters; Seg to Dom */ + result[i] = this._wDays(jsDate.getDay()).substring(0, 3); + break; + + case "j": /* Day of the month without leading zeros; ex: 1 to 31 */ + result[i] = jsDate.getDate(); + break; + + case "l": /* A full textual representation of the day of the week; Domingo to Sabado */ + result[i] = this._wDays(jsDate.getDay()); + break; + + case "N": /* ISO-8601 numeric representation of the day of the week; 1 (Segunda) to 7 (Domingo) */ + result[i] = jsDate.getDay() || 7; + break; + + case "S": /* English ordinal suffix for the day of the month, 2 characters; st, nd, rd or th. Works well with j */ + var temp = jsDate.getDate(); + var suffixes = ["st", "nd", "rd"]; + var suffix = ""; + + if (temp >= 11 && temp <= 13) { + result[i] = "th"; + } else { + result[i] = (suffix = suffixes[String(temp).substr(-1) - 1]) ? (suffix) : ("th"); + } + break; + + case "w": /* Numeric representation of the day of the week; 0 (for Sunday) through 6 (for Saturday) */ + result[i] = jsDate.getDay(); + break; + + case "z": /* The day of the year (starting from 0); 0 to 365 */ + jsFirstDay = Date.UTC(jsDate.getFullYear(), 0, 0); + jsThisDay = Date.UTC(jsDate.getFullYear(), jsDate.getMonth(), jsDate.getDate()); + result[i] = Math.floor((jsThisDay - jsFirstDay) / (1000 * 60 * 60 * 24)); + break; + + /* WEEK */ + case "W": /* ISO-8601 week number of year, weeks starting on Monday; ex: 42 (the 42nd week in the year) */ + var jsYearStart = new Date( jsDate.getFullYear( ) , 0 , 1 ); + jsFirstDay = jsYearStart.getDay() || 7; + + var days = Math.floor( ( jsDate - jsYearStart ) / ( 24 * 60 * 60 * 1000 ) + 1 ); + + result[ i ] = Math.ceil( ( days - ( 8 - jsFirstDay ) ) / 7 ) + 1; + break; + + + /* MONTH */ + case "F": /* A full textual representation of a month, such as Janeiro or Marco; Janeiro a Dezembro */ + result[i] = this._months(jsDate.getMonth()); + break; + + case "m": /* Numeric representation of a month, with leading zeros; 01 to 12 */ + var jsMonth = String(jsDate.getMonth() + 1); + result[i] = (jsMonth.length > 1) ? jsMonth : "0" + jsMonth; + break; + + case "M": /* A short textual representation of a month, three letters; Jan a Dez */ + result[i] = this._months(jsDate.getMonth()).substring(0,3); + break; + + case "n": /* Numeric representation of a month, without leading zeros; 1 a 12 */ + result[i] = jsDate.getMonth() + 1; + break; + + case "t": /* Number of days in the given month; ex: 28 */ + result[i] = this._daysInMonth(jsDate.getMonth()+1,jsDate.getYear()); + break; + + /* YEAR */ + case "L": /* Whether it's a leap year; 1 if it is a leap year, 0 otherwise. */ + var jsYear = jsDate.getFullYear(); + result[i] = (jsYear % 4) ? false : ( (jsYear % 100) ? true : ( (jsYear % 400) ? false : true ) ); + break; + + case "o": /* ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. */ + throw '"o" not implemented!'; + + case "Y": /* A full numeric representation of a year, 4 digits; 1999 */ + result[i] = jsDate.getFullYear(); + break; + + case "y": /* A two digit representation of a year; 99 */ + result[i] = String(jsDate.getFullYear()).substring(2); + break; + + /* TIME */ + case "a": /* Lowercase Ante meridiem and Post meridiem; am or pm */ + result[i] = (jsDate.getHours() < 12) ? "am" : "pm"; + break; + + case "A": /* Uppercase Ante meridiem and Post meridiem; AM or PM */ + result[i] = (jsDate.getHours < 12) ? "AM" : "PM"; + break; + + case "B": /* Swatch Internet time; 000 through 999 */ + throw '"B" not implemented!'; + + case "g": /* 12-hour format of an hour without leading zeros; 1 to 12 */ + jsHour = jsDate.getHours(); + result[i] = (jsHour <= 12) ? jsHour : (jsHour - 12); + break; + + case "G": /* 24-hour format of an hour without leading zeros; 1 to 23 */ + result[i] = String(jsDate.getHours()); + break; + + case "h": /* 12-hour format of an hour with leading zeros; 01 to 12 */ + jsHour = String(jsDate.getHours()); + jsHour = (jsHour <= 12) ? jsHour : (jsHour - 12); + result[i] = (jsHour.length > 1) ? jsHour : "0" + jsHour; + break; + + case "H": /* 24-hour format of an hour with leading zeros; 01 to 24 */ + jsHour = String(jsDate.getHours()); + result[i] = (jsHour.length > 1) ? jsHour : "0" + jsHour; + break; + + case "i": /* Minutes with leading zeros; 00 to 59 */ + var jsMinute = String(jsDate.getMinutes()); + result[i] = (jsMinute.length > 1) ? jsMinute : "0" + jsMinute; + break; + + case "s": /* Seconds with leading zeros; 00 to 59; */ + var jsSecond = String(jsDate.getSeconds()); + result[i] = (jsSecond.length > 1) ? jsSecond : "0" + jsSecond; + break; + + case "u": /* Microseconds */ + throw '"u" not implemented!'; + + + /* TIMEZONE */ + + case "e": /* Timezone identifier */ + throw '"e" not implemented!'; + + case "I": /* "1" if Daylight Savings Time, "0" otherwise. Works only on the northern hemisphere */ + jsFirstDay = new Date(jsDate.getFullYear(), 0, 1); + result[i] = (jsDate.getTimezoneOffset() !== jsFirstDay.getTimezoneOffset()) ? (1) : (0); + break; + + case "O": /* Difference to Greenwich time (GMT) in hours */ + var jsMinZone = jsDate.getTimezoneOffset(); + var jsMinutes = jsMinZone % 60; + jsHour = String(((jsMinZone - jsMinutes) / 60) * -1); + + if (jsHour.charAt(0) !== "-") { + jsHour = "+" + jsHour; + } + + jsHour = (jsHour.length === 3) ? (jsHour) : (jsHour.replace(/([+\-])(\d)/, "$1" + 0 + "$2")); + result[i] = jsHour + jsMinutes + "0"; + break; + + case "P": /* Difference to Greenwich time (GMT) with colon between hours and minutes */ + throw '"P" not implemented!'; + + case "T": /* Timezone abbreviation */ + throw '"T" not implemented!'; + + case "Z": /* Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. */ + result[i] = jsDate.getTimezoneOffset() * 60; + break; + + + /* FULL DATE/TIME */ + + case "c": /* ISO 8601 date */ + throw '"c" not implemented!'; + + case "r": /* RFC 2822 formatted date */ + var jsDayName = this._wDays(jsDate.getDay()).substr(0, 3); + var jsMonthName = this._months(jsDate.getMonth()).substr(0, 3); + result[i] = jsDayName + ", " + jsDate.getDate() + " " + jsMonthName + this.get(" Y H:i:s O",jsDate); + break; + + case "U": /* Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) */ + result[i] = Math.floor(jsDate.getTime() / 1000); + break; + + default: + result[i] = iFormat[i]; + } + } + + return result.join(''); + + }, + + /** + * Creates a date object based on a format string. + * This works exactly as php date() function. http://php.net/manual/en/function.date.php + * + * @method set + * @param {String} [format] The format in which the date will be formatted. Defaults to 'Y-m-d' + * @param {String} str_date The date formatted. + * @return {Date} Date object based on the formatted date and format + * @public + * @static + * @sample Ink_Util_Date_set.html + */ + set : function( format , str_date ) { + if ( typeof str_date === 'undefined' ) { return ; } + if ( typeof format === 'undefined' || format === '' ) { format = "Y-m-d"; } + + var iFormat = format.split(""); + var result = new Array( iFormat.length ); + var escapeChar = "\\"; + var mList; + + var objIndex = { + year : undefined , + month : undefined , + day : undefined , + dayY : undefined , + dayW : undefined , + week : undefined , + hour : undefined , + hourD : undefined , + min : undefined , + sec : undefined , + msec : undefined , + ampm : undefined , + diffM : undefined , + diffH : undefined , + date : undefined + }; + + var matches = 0; + + /* This switch is presented in the same order as in php date function (PHP 5.2.2) */ + for ( var i = 0; i < iFormat.length; i++) { + switch( iFormat[ i ] ) { + case escapeChar: + result[i] = iFormat[ i + 1 ]; + i++; + break; + + /* DAY */ + case "d": /* Day of the month, 2 digits with leading zeros; ex: 01 to 31 */ + result[ i ] = '(\\d{2})'; + objIndex.day = { original : i , match : matches++ }; + break; + + case "j": /* Day of the month without leading zeros; ex: 1 to 31 */ + result[ i ] = '(\\d{1,2})'; + objIndex.day = { original : i , match : matches++ }; + break; + + case "D": /* A textual representation of a day, three letters; Seg to Dom */ + result[ i ] = '([\\wá]{3})'; + objIndex.dayW = { original : i , match : matches++ }; + break; + + case "l": /* A full textual representation of the day of the week; Domingo to Sabado */ + result[i] = '([\\wá]{5,7})'; + objIndex.dayW = { original : i , match : matches++ }; + break; + + case "N": /* ISO-8601 numeric representation of the day of the week; 1 (Segunda) to 7 (Domingo) */ + result[ i ] = '(\\d)'; + objIndex.dayW = { original : i , match : matches++ }; + break; + + case "w": /* Numeric representation of the day of the week; 0 (for Sunday) through 6 (for Saturday) */ + result[ i ] = '(\\d)'; + objIndex.dayW = { original : i , match : matches++ }; + break; + + case "S": /* English ordinal suffix for the day of the month, 2 characters; st, nd, rd or th. Works well with j */ + result[ i ] = '\\w{2}'; + break; + + case "z": /* The day of the year (starting from 0); 0 to 365 */ + result[ i ] = '(\\d{1,3})'; + objIndex.dayY = { original : i , match : matches++ }; + break; + + /* WEEK */ + case "W": /* ISO-8601 week number of year, weeks starting on Monday; ex: 42 (the 42nd week in the year) */ + result[ i ] = '(\\d{1,2})'; + objIndex.week = { original : i , match : matches++ }; + break; + + /* MONTH */ + case "F": /* A full textual representation of a month, such as Janeiro or Marco; Janeiro a Dezembro */ + result[ i ] = '([\\wç]{4,9})'; + objIndex.month = { original : i , match : matches++ }; + break; + + case "M": /* A short textual representation of a month, three letters; Jan a Dez */ + result[ i ] = '(\\w{3})'; + objIndex.month = { original : i , match : matches++ }; + break; + + case "m": /* Numeric representation of a month, with leading zeros; 01 to 12 */ + result[ i ] = '(\\d{2})'; + objIndex.month = { original : i , match : matches++ }; + break; + + case "n": /* Numeric representation of a month, without leading zeros; 1 a 12 */ + result[ i ] = '(\\d{1,2})'; + objIndex.month = { original : i , match : matches++ }; + break; + + case "t": /* Number of days in the given month; ex: 28 */ + result[ i ] = '\\d{2}'; + break; + + /* YEAR */ + case "L": /* Whether it's a leap year; 1 if it is a leap year, 0 otherwise. */ + result[ i ] = '\\w{4,5}'; + break; + + case "o": /* ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. */ + throw '"o" not implemented!'; + + case "Y": /* A full numeric representation of a year, 4 digits; 1999 */ + result[ i ] = '(\\d{4})'; + objIndex.year = { original : i , match : matches++ }; + break; + + case "y": /* A two digit representation of a year; 99 */ + result[ i ] = '(\\d{2})'; + if ( typeof objIndex.year === 'undefined' || iFormat[ objIndex.year.original ] !== 'Y' ) { + objIndex.year = { original : i , match : matches++ }; + } + break; + + /* TIME */ + case "a": /* Lowercase Ante meridiem and Post meridiem; am or pm */ + result[ i ] = '(am|pm)'; + objIndex.ampm = { original : i , match : matches++ }; + break; + + case "A": /* Uppercase Ante meridiem and Post meridiem; AM or PM */ + result[ i ] = '(AM|PM)'; + objIndex.ampm = { original : i , match : matches++ }; + break; + + case "B": /* Swatch Internet time; 000 through 999 */ + throw '"B" not implemented!'; + + case "g": /* 12-hour format of an hour without leading zeros; 1 to 12 */ + result[ i ] = '(\\d{1,2})'; + objIndex.hourD = { original : i , match : matches++ }; + break; + + case "G": /* 24-hour format of an hour without leading zeros; 1 to 23 */ + result[ i ] = '(\\d{1,2})'; + objIndex.hour = { original : i , match : matches++ }; + break; + + case "h": /* 12-hour format of an hour with leading zeros; 01 to 12 */ + result[ i ] = '(\\d{2})'; + objIndex.hourD = { original : i , match : matches++ }; + break; + + case "H": /* 24-hour format of an hour with leading zeros; 01 to 24 */ + result[ i ] = '(\\d{2})'; + objIndex.hour = { original : i , match : matches++ }; + break; + + case "i": /* Minutes with leading zeros; 00 to 59 */ + result[ i ] = '(\\d{2})'; + objIndex.min = { original : i , match : matches++ }; + break; + + case "s": /* Seconds with leading zeros; 00 to 59; */ + result[ i ] = '(\\d{2})'; + objIndex.sec = { original : i , match : matches++ }; + break; + + case "u": /* Microseconds */ + throw '"u" not implemented!'; + + /* TIMEZONE */ + case "e": /* Timezone identifier */ + throw '"e" not implemented!'; + + case "I": /* "1" if Daylight Savings Time, "0" otherwise. Works only on the northern hemisphere */ + result[i] = '\\d'; + break; + + case "O": /* Difference to Greenwich time (GMT) in hours */ + result[ i ] = '([-+]\\d{4})'; + objIndex.diffH = { original : i , match : matches++ }; + break; + + case "P": /* Difference to Greenwich time (GMT) with colon between hours and minutes */ + throw '"P" not implemented!'; + + case "T": /* Timezone abbreviation */ + throw '"T" not implemented!'; + + case "Z": /* Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. */ + result[ i ] = '(\\-?\\d{1,5})'; + objIndex.diffM = { original : i , match : matches++ }; + break; + + /* FULL DATE/TIME */ + case "c": /* ISO 8601 date */ + throw '"c" not implemented!'; + + case "r": /* RFC 2822 formatted date */ + result[ i ] = '([\\wá]{3}, \\d{1,2} \\w{3} \\d{4} \\d{2}:\\d{2}:\\d{2} [+\\-]\\d{4})'; + objIndex.date = { original : i , match : matches++ }; + break; + + case "U": /* Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) */ + result[ i ] = '(\\d{1,13})'; + objIndex.date = { original : i , match : matches++ }; + break; + + default: + result[ i ] = iFormat[ i ]; + } + } + + var pattr = new RegExp( result.join('') ); + + try { + mList = str_date.match( pattr ); + if ( !mList ) { return; } + } + catch ( e ) { return ; } + + var _haveDatetime = typeof objIndex.date !== 'undefined'; + + var _haveYear = typeof objIndex.year !== 'undefined'; + + var _haveYDay = typeof objIndex.dayY !== 'undefined'; + + var _haveDay = typeof objIndex.day !== 'undefined'; + var _haveMonth = typeof objIndex.month !== 'undefined'; + var _haveMonthDay = _haveMonth && _haveDay; + var _haveOnlyDay = !_haveMonth && _haveDay; + + var _haveWDay = typeof objIndex.dayW !== 'undefined'; + var _haveWeek = typeof objIndex.week !== 'undefined'; + var _haveWeekWDay = _haveWeek && _haveWDay; + var _haveOnlyWDay = !_haveWeek && _haveWDay; + + var _validDate = _haveYDay || _haveMonthDay || !_haveYear && _haveOnlyDay || _haveWeekWDay || !_haveYear && _haveOnlyWDay; + var _noDate = !_haveYear && !_haveYDay && !_haveDay && !_haveMonth && !_haveWDay && !_haveWeek; + + var _haveHour12 = typeof objIndex.hourD !== 'undefined' && typeof objIndex.ampm !== 'undefined'; + var _haveHour24 = typeof objIndex.hour !== 'undefined'; + var _haveHour = _haveHour12 || _haveHour24; + + var _haveMin = typeof objIndex.min !== 'undefined'; + var _haveSec = typeof objIndex.sec !== 'undefined'; + var _haveMSec = typeof objIndex.msec !== 'undefined'; + + var _haveMoreM = !_noDate || _haveHour; + var _haveMoreS = _haveMoreM || _haveMin; + + var _haveDiffM = typeof objIndex.diffM !== 'undefined'; + var _haveDiffH = typeof objIndex.diffH !== 'undefined'; + //var _haveGMT = _haveDiffM || _haveDiffH; + var hour; + var min; + + if ( _haveDatetime ) { + if ( iFormat[ objIndex.date.original ] === 'U' ) { + return new Date( +mList[ objIndex.date.match + 1 ] * 1000 ); + } + + var dList = mList[ objIndex.date.match + 1 ].match( /\w{3}, (\d{1,2}) (\w{3}) (\d{4}) (\d{2}):(\d{2}):(\d{2}) ([+\-]\d{4})/ ); + hour = +dList[ 4 ] + ( +dList[ 7 ].slice( 0 , 3 ) ); + min = +dList[ 5 ] + ( dList[ 7 ].slice( 0 , 1 ) + dList[ 7 ].slice( 3 ) ) / 100 * 60; + + return new Date( dList[ 3 ] , this._iMonth( dList[ 2 ] ) , dList[ 1 ] , hour , min , dList[ 6 ] ); + } + + var _d = new Date( ); + var year; + var month; + var day; + var sec; + var msec; + var gmt; + + if ( !_validDate && !_noDate ) { return ; } + + if ( _validDate ) { + if ( _haveYear ) { + var _y = _d.getFullYear( ) - 50 + ''; + year = mList[ objIndex.year.match + 1 ]; + if ( iFormat[ objIndex.year.original ] === 'y' ) { + year = +_y.slice( 0 , 2 ) + ( year >= ( _y ).slice( 2 ) ? 0 : 1 ) + year; + } + } else { + year = _d.getFullYear(); + } + + if ( _haveYDay ) { + month = 0; + day = mList[ objIndex.dayY.match + 1 ]; + } else if ( _haveDay ) { + if ( _haveMonth ) { + month = this._iMonth( mList[ objIndex.month.match + 1 ] ); + } else { + month = _d.getMonth( ); + } + + day = mList[ objIndex.day.match + 1 ]; + } else { + month = 0; + + var week; + if ( _haveWeek ) { + week = mList[ objIndex.week.match + 1 ]; + } else { + week = this.get( 'W' , _d ); + } + + day = ( week - 2 ) * 7 + ( 8 - ( ( new Date( year , 0 , 1 ) ).getDay( ) || 7 ) ) + this._iWeek( mList[ objIndex.week.match + 1 ] ); + } + + if ( month === 0 && day > 31 ) { + var aux = new Date( year , month , day ); + month = aux.getMonth( ); + day = aux.getDate( ); + } + } + else { + year = _d.getFullYear( ); + month = _d.getMonth( ); + day = _d.getDate( ); + } + + if ( _haveHour12 ) { hour = +mList[ objIndex.hourD.match + 1 ] + ( mList[ objIndex.ampm.match + 1 ] === 'pm' ? 12 : 0 ); } + else if ( _haveHour24 ) { hour = mList[ objIndex.hour.match + 1 ]; } + else if ( _noDate ) { hour = _d.getHours( ); } + else { hour = '00'; } + + if ( _haveMin ) { min = mList[ objIndex.min.match + 1 ]; } + else if ( !_haveMoreM ) { min = _d.getMinutes( ); } + else { min = '00'; } + + if ( _haveSec ) { sec = mList[ objIndex.sec.match + 1 ]; } + else if ( !_haveMoreS ) { sec = _d.getSeconds( ); } + else { sec = '00'; } + + if ( _haveMSec ) { msec = mList[ objIndex.msec.match + 1 ]; } + else { msec = '000'; } + + if ( _haveDiffH ) { gmt = mList[ objIndex.diffH.match + 1 ]; } + else if ( _haveDiffM ) { gmt = String( -1 * mList[ objIndex.diffM.match + 1 ] / 60 * 100 ).replace( /^(\d)/ , '+$1' ).replace( /(^[\-+])(\d{3}$)/ , '$10$2' ); } + else { gmt = '+0000'; } + + return new Date( year, month, day, hour, min, sec ); + } + }; + + + return InkDate; + +}); + +/** + * Dump/Profiling Utilities + * @module Ink.Util.Dumper_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Dumper', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.Dumper_1 + */ + + var Dumper = { + + /** + * Hex code for the 'tab' + * + * @property _tab + * @type {String} + * @private + * @readOnly + * @static + * + */ + _tab: '\xA0\xA0\xA0\xA0', + + /** + * Function that returns the argument passed formatted + * + * @method _formatParam + * @param {Mixed} param + * @return {String} The argument passed formatted + * @private + * @static + */ + _formatParam: function(param) + { + var formated = ''; + + switch(typeof(param)) { + case 'string': + formated = '(string) '+param; + break; + case 'number': + formated = '(number) '+param; + break; + case 'boolean': + formated = '(boolean) '+param; + break; + case 'object': + if(param !== null) { + if(param.constructor === Array) { + formated = 'Array \n{\n' + this._outputFormat(param, 0) + '\n}'; + } else { + formated = 'Object \n{\n' + this._outputFormat(param, 0) + '\n}'; + } + } else { + formated = 'null'; + } + break; + default: + formated = false; + } + + return formated; + }, + + /** + * Function that returns the tabs concatenated + * + * @method _getTabs + * @param {Number} numberOfTabs Number of Tabs + * @return {String} Tabs concatenated + * @private + * @static + */ + _getTabs: function(numberOfTabs) + { + var tabs = ''; + for(var _i = 0; _i < numberOfTabs; _i++) { + tabs += this._tab; + } + return tabs; + }, + + /** + * Function that formats the parameter to display. + * + * @method _outputFormat + * @param {Any} param + * @param {Number} dim + * @return {String} The parameter passed formatted to displat + * @private + * @static + */ + _outputFormat: function(param, dim) + { + var formated = ''; + //var _strVal = false; + var _typeof = false; + for(var key in param) { + if(param[key] !== null) { + if(typeof(param[key]) === 'object' && (param[key].constructor === Array || param[key].constructor === Object)) { + if(param[key].constructor === Array) { + _typeof = 'Array'; + } else if(param[key].constructor === Object) { + _typeof = 'Object'; + } + formated += this._tab + this._getTabs(dim) + '[' + key + '] => '+_typeof+'\n'; + formated += this._tab + this._getTabs(dim) + '{\n'; + formated += this._outputFormat(param[key], dim + 1) + this._tab + this._getTabs(dim) + '}\n'; + } else if(param[key].constructor === Function) { + continue; + } else { + formated = formated + this._tab + this._getTabs(dim) + '[' + key + '] => ' + param[key] + '\n'; + } + } else { + formated = formated + this._tab + this._getTabs(dim) + '[' + key + '] => null \n'; + } + } + return formated; + }, + + /** + * Prints variable structure. + * + * @method printDump + * @param {Any} param Variable to be dumped. + * @param {DOMElement|String} [target] Element to print the dump on. + * @public + * @static + * @sample Ink_Util_Dumper_printDump.html + */ + printDump: function(param, target) + { + /*jshint evil:true */ + if(!target || typeof(target) === 'undefined') { + document.write('
            '+this._formatParam(param)+'
            '); + } else { + if(typeof(target) === 'string') { + document.getElementById(target).innerHTML = '
            ' + this._formatParam(param) + '
            '; + } else if(typeof(target) === 'object') { + target.innerHTML = '
            '+this._formatParam(param)+'
            '; + } else { + throw "TARGET must be an element or an element ID"; + } + } + }, + + /** + * Get a variable's structure. + * + * @method returnDump + * @param {Any} param Variable to get the structure. + * @return {String} The variable's structure. + * @public + * @static + * @sample Ink_Util_Dumper_returnDump.html + */ + returnDump: function(param) + { + return this._formatParam(param); + }, + + /** + * Alert a variable's structure. + * + * @method alertDump + * @param {Any} param Variable to be dumped. + * @public + * @static + * @sample Ink_Util_Dumper_alertDump.html + */ + alertDump: function(param) + { + window.alert(this._formatParam(param).replace(/()(Array|Object)(<\/b>)/g, "$2")); + }, + + /** + * Prints the variable structure to a new window. + * + * @method windowDump + * @param {Any} param Variable to be dumped. + * @public + * @static + * @sample Ink_Util_Dumper_windowDump.html + */ + windowDump: function(param) + { + var dumperwindow = 'dumperwindow_'+(Math.random() * 10000); + var win = window.open('', + dumperwindow, + 'width=400,height=300,left=50,top=50,status,menubar,scrollbars,resizable' + ); + win.document.open(); + win.document.write('
            '+this._formatParam(param)+'
            '); + win.document.close(); + win.focus(); + } + + }; + + return Dumper; + +}); + +/** + * Internationalization Utilities + * @module Ink.Util.I18n_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.I18n', '1', [], function () { + 'use strict'; + + var pattrText = /\{(?:(\{.*?})|(?:%s:)?(\d+)|(?:%s)?|([\w-]+))}/g; + + var funcOrVal = function( ret , args ) { + if ( typeof ret === 'function' ) { + return ret.apply(this, args); + } else if (typeof ret !== undefined) { + return ret; + } else { + return ''; + } + }; + + /** + * You can use this module to internationalize your applications. It roughly emulates GNU gettext's API. + * + * @class Ink.Util.I18n + * @constructor + * + * @param {Object} dict Object mapping language codes (in the form of `pt_PT`, `pt_BR`, `fr`, `en_US`, etc.) to their `dictionaries` + * @param {String} [lang='pt_PT'] language code of the target language + * + * @sample Ink_Util_I18n_1.html + */ + var I18n = function( dict , lang , testMode ) { + if ( !( this instanceof I18n ) ) { return new I18n( dict , lang , testMode ); } + + this.reset( ) + .lang( lang ) + .testMode( testMode ) + .append( dict || { } , lang ); + }; + + I18n.prototype = { + reset: function( ) { + this._dicts = [ ]; + this._dict = { }; + this._testMode = false; + this._lang = this._gLang; + + return this; + }, + /** + * Adds translation strings for the helper to use. + * + * @method append + * @param {Object} dict Object containing language objects identified by their language code + * + * @sample Ink_Util_I18n_1_append.html + */ + append: function( dict ) { + this._dicts.push( dict ); + + this._dict = Ink.extendObj(this._dict , dict[ this._lang ] ); + + return this; + }, + /** + * Gets or sets the language. + * If there are more dictionaries available in cache, they will be loaded. + * + * @method lang + * @param {String} lang Language code to set this instance to. + */ + lang: function( lang ) { + if ( !arguments.length ) { return this._lang; } + + if ( lang && this._lang !== lang ) { + this._lang = lang; + + this._dict = { }; + + for ( var i = 0, l = this._dicts.length; i < l; i++ ) { + this._dict = Ink.extendObj( this._dict , this._dicts[ i ][ lang ] || { } ); + } + } + + return this; + }, + /** + * Sets or unsets test mode. + * In test mode, unknown strings are wrapped in `[ ... ]`. This is useful for debugging your application and to make sure all your translation keys are in place. + * + * @method testMode + * @param {Boolean} bool Flag to set the test mode state + */ + testMode: function( bool ) { + if ( !arguments.length ) { return !!this._testMode; } + + if ( bool !== undefined ) { this._testMode = !!bool; } + + return this; + }, + + /** + * Gest a key from the current dictionary + * + * @method getKey + * @param {String} key + * @return {Mixed} The object which happened to be in the current language dictionary on the given key. + * + * @sample Ink_Util_I18n_1_getKey.html + */ + getKey: function( key ) { + var ret; + var gLang = this._gLang; + var lang = this._lang; + + if ( key in this._dict ) { + ret = this._dict[ key ]; + } else { + I18n.langGlobal( lang ); + + ret = this._gDict[ key ]; + + I18n.langGlobal( gLang ); + } + + return ret; + }, + + /** + * Translates a string. + * Given a translation key, return a translated string, with replaced parameters. + * When a translated string is not available, the original string is returned unchanged. + * + * @method text + * @param {String} str Key to look for in i18n dictionary (which is returned verbatim if unknown) + * @param {Object} [namedParms] Named replacements. Replaces {named} with values in this object. + * @param {String} [args] Replacement #1 (replaces first {} and all {1}) + * @param {String} [arg2] Replacement #2 (replaces second {} and all {2}) + * @param {String} [argn*] Replacement #n (replaces nth {} and all {n}) + * + * @sample Ink_Util_I18n_1_text.html + */ + text: function( str /*, replacements...*/ ) { + if ( typeof str !== 'string' ) { return; } // Backwards-compat + + var pars = Array.prototype.slice.call( arguments , 1 ); + var idx = 0; + var isObj = typeof pars[ 0 ] === 'object'; + + var original = this.getKey( str ); + if ( original === undefined ) { original = this._testMode ? '[' + str + ']' : str; } + if ( typeof original === 'number' ) { original += ''; } + + if (typeof original === 'string') { + original = original.replace( pattrText , function( m , $1 , $2 , $3 ) { + var ret = + $1 ? $1 : + $2 ? pars[ $2 - ( isObj ? 0 : 1 ) ] : + $3 ? pars[ 0 ][ $3 ] || '' : + pars[ (idx++) + ( isObj ? 1 : 0 ) ]; + return funcOrVal( ret , [idx].concat(pars) ); + }); + return original; + } + + return ( + typeof original === 'function' ? original.apply( this , pars ) : + original instanceof Array ? funcOrVal( original[ pars[ 0 ] ] , pars ) : + typeof original === 'object' ? funcOrVal( original[ pars[ 0 ] ] , pars ) : + ''); + }, + + /** + * Translates and pluralizes text. + * Given a singular string, a plural string and a number, translates either the singular or plural string. + * + * @method ntext + * @return {String} + * + * @param {String} strSin Word to use when count is 1 + * @param {String} strPlur Word to use otherwise + * @param {Number} count Number which defines which word to use + * @param [args*] Extra arguments, to be passed to `text()` + * + * @sample Ink_Util_I18n_1_ntext.html + */ + ntext: function( strSin , strPlur , count ) { + var pars = Array.prototype.slice.apply( arguments ); + var original; + + if ( pars.length === 2 && typeof strPlur === 'number' ) { + original = this.getKey( strSin ); + if ( !( original instanceof Array ) ) { return ''; } + + pars.splice( 0 , 1 ); + original = original[ strPlur === 1 ? 0 : 1 ]; + } else { + pars.splice( 0 , 2 ); + original = count === 1 ? strSin : strPlur; + } + + return this.text.apply( this , [ original ].concat( pars ) ); + }, + + /** + * Gets the ordinal suffix of a number. + * + * This works by using transforms (in the form of Objects or Functions) passed into the function or found in the special key `_ordinals` in the active language dictionary. + * + * @method ordinal + * + * @param {Number} num Input number + * @param {Object|Function} [options]={} Dictionaries for translating. Each of these options' fallback is found in the current language's dictionary. The lookup order is the following: `exceptions`, `byLastDigit`, `default`. Each of these may be either an `Object` or a `Function`. If it's a function, it is called (with `number` and `digit` for any function except for byLastDigit, which is called with the `lastDigit` of the number in question), and if the function returns a string, that is used. If it's an object, the property is looked up using `obj[prop]`. If what is found is a string, it is used directly. + * @param {Object|Function} [options.byLastDigit]={} If the language requires the last digit to be considered, mappings of last digits to ordinal suffixes can be created here. + * @param {Object|Function} [options.exceptions]={} Map unique, special cases to their ordinal suffixes. + * + * @returns {String} Ordinal suffix for `num`. + * + * @sample Ink_Util_I18n_1_ordinal.html + **/ + ordinal: function( num ) { + if ( num === undefined ) { return ''; } + + var lastDig = +num.toString( ).slice( -1 ); + + var ordDict = this.getKey( '_ordinals' ); + if ( ordDict === undefined ) { return ''; } + + if ( typeof ordDict === 'string' ) { return ordDict; } + + var ret; + + if ( typeof ordDict === 'function' ) { + ret = ordDict( num , lastDig ); + + if ( typeof ret === 'string' ) { return ret; } + } + + if ( 'exceptions' in ordDict ) { + ret = typeof ordDict.exceptions === 'function' ? ordDict.exceptions( num , lastDig ) : + num in ordDict.exceptions ? funcOrVal( ordDict.exceptions[ num ] , [num , lastDig] ) : + undefined; + + if ( typeof ret === 'string' ) { return ret; } + } + + if ( 'byLastDigit' in ordDict ) { + ret = typeof ordDict.byLastDigit === 'function' ? ordDict.byLastDigit( lastDig , num ) : + lastDig in ordDict.byLastDigit ? funcOrVal( ordDict.byLastDigit[ lastDig ] , [lastDig , num] ) : + undefined; + + if ( typeof ret === 'string' ) { return ret; } + } + + if ( 'default' in ordDict ) { + ret = funcOrVal( ordDict['default'] , [ num , lastDig ] ); + + if ( typeof ret === 'string' ) { return ret; } + } + + return ''; + }, + + /** + * Create an alias. + * + * Returns an alias to this I18n instance. It contains the I18n methods documented here, but is also a function. If you call it, it just calls `text()`. This is commonly assigned to "_". + * + * @method alias + * @returns {Function} an alias to `text()` on this instance. You can also access the rest of the translation API through this alias. + * + * @sample Ink_Util_I18n_1_alias.html + */ + alias: function( ) { + var ret = Ink.bind( I18n.prototype.text , this ); + ret.ntext = Ink.bind( I18n.prototype.ntext , this ); + ret.append = Ink.bind( I18n.prototype.append , this ); + ret.ordinal = Ink.bind( I18n.prototype.ordinal , this ); + ret.testMode = Ink.bind( I18n.prototype.testMode , this ); + + return ret; + } + }; + + /** + * Resets I18n global state (global dictionaries, and default language for instances) + * + * @method reset + * @static + * + **/ + I18n.reset = function( ) { + I18n.prototype._gDicts = [ ]; + I18n.prototype._gDict = { }; + I18n.prototype._gLang = 'pt_PT'; + }; + I18n.reset( ); + + /** + * Adds a dictionary to be used in all I18n instances for the corresponding language. + * + * @method appendGlobal + * @static + * + * @param dict {Object} Dictionary to be added + * @param lang {String} Language fo the dictionary being added + * + */ + I18n.appendGlobal = function( dict , lang ) { + if ( lang ) { + if ( !( lang in dict ) ) { + var obj = { }; + + obj[ lang ] = dict; + + dict = obj; + } + + if ( lang !== I18n.prototype._gLang ) { I18n.langGlobal( lang ); } + } + + I18n.prototype._gDicts.push( dict ); + + Ink.extendObj( I18n.prototype._gDict , dict[ I18n.prototype._gLang ] ); + }; + + I18n.append = function () { + // [3.1.0] remove this alias + Ink.warn('Ink.Util.I18n.append() was renamed to appendGlobal().'); + return I18n.appendGlobal.apply(I18n, [].slice.call(arguments)); + }; + + /** + * Gets or sets the current default language of I18n instances. + * + * @method langGlobal + * @param lang the new language for all I18n instances + * + * @static + * + * @return {String} language code + */ + I18n.langGlobal = function( lang ) { + if ( !arguments.length ) { return I18n.prototype._gLang; } + + if ( lang && I18n.prototype._gLang !== lang ) { + I18n.prototype._gLang = lang; + + I18n.prototype._gDict = { }; + + for ( var i = 0, l = I18n.prototype._gDicts.length; i < l; i++ ) { + Ink.extendObj( I18n.prototype._gDict , I18n.prototype._gDicts[ i ][ lang ] || { } ); + } + } + }; + + I18n.lang = function () { + // [3.1.0] remove this alias + Ink.warn('Ink.Util.I18n.lang() was renamed to langGlobal().'); + return I18n.langGlobal.apply(I18n, [].slice.call(arguments)); + }; + + return I18n; +}); +/** + * JSON Utilities + * @module Ink.Util.Json_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Json', '1', [], function() { + 'use strict'; + + var function_call = Function.prototype.call; + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; + + function twoDigits(n) { + var r = '' + n; + if (r.length === 1) { + return '0' + r; + } else { + return r; + } + } + + var dateToISOString = Date.prototype.toISOString ? + Ink.bind(function_call, Date.prototype.toISOString) : + function(date) { + // Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString + return date.getUTCFullYear() + + '-' + twoDigits( date.getUTCMonth() + 1 ) + + '-' + twoDigits( date.getUTCDate() ) + + 'T' + twoDigits( date.getUTCHours() ) + + ':' + twoDigits( date.getUTCMinutes() ) + + ':' + twoDigits( date.getUTCSeconds() ) + + '.' + String( (date.getUTCMilliseconds()/1000).toFixed(3) ).slice( 2, 5 ) + + 'Z'; + }; + + /** + * Use this class to convert JSON strings to JavaScript objects + * `.parse()` and also to do the opposite operation `.stringify()`. + * Internally, the standard JSON implementation is used if available + * Otherwise, the functions mimic the standard implementation. + * + * Here's how to produce JSON from an existing object: + * + * Ink.requireModules(['Ink.Util.Json_1'], function (Json) { + * var obj = { + * key1: 'value1', + * key2: 'value2', + * keyArray: ['arrayValue1', 'arrayValue2', 'arrayValue3'] + * }; + * Json.stringify(obj); // The above object as a JSON string + * }); + * + * And here is how to parse JSON: + * + * Ink.requireModules(['Ink.Util.Json_1'], function (Json) { + * var source = '{"key": "value", "array": [true, null, false]}'; + * Json.parse(source); // The above JSON string as an object + * }); + * + * @namespace Ink.Util.Json_1 + * @static + * + */ + var InkJson = { + _nativeJSON: window.JSON || null, + + _convertToUnicode: false, + + // Escape characters so as to embed them in JSON strings + _escape: function (theString) { + var _m = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\' }; + + if (/["\\\x00-\x1f]/.test(theString)) { + theString = theString.replace(/([\x00-\x1f\\"])/g, function(a, b) { + var c = _m[b]; + if (c) { + return c; + } + c = b.charCodeAt(); + return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16); + }); + } + + return theString; + }, + + // A character conversion map + _toUnicode: function (theString) + { + if(!this._convertToUnicode) { + return this._escape(theString); + } else { + var unicodeString = ''; + var inInt = false; + var theUnicode = false; + var i = 0; + var total = theString.length; + while(i < total) { + inInt = theString.charCodeAt(i); + if( (inInt >= 32 && inInt <= 126) || + //(inInt >= 48 && inInt <= 57) || + //(inInt >= 65 && inInt <= 90) || + //(inInt >= 97 && inInt <= 122) || + inInt === 8 || + inInt === 9 || + inInt === 10 || + inInt === 12 || + inInt === 13 || + inInt === 32 || + inInt === 34 || + inInt === 47 || + inInt === 58 || + inInt === 92) { + + if(inInt === 34 || inInt === 92 || inInt === 47) { + theUnicode = '\\'+theString.charAt(i); + } else if(inInt === 8) { + theUnicode = '\\b'; + } else if(inInt === 9) { + theUnicode = '\\t'; + } else if(inInt === 10) { + theUnicode = '\\n'; + } else if(inInt === 12) { + theUnicode = '\\f'; + } else if(inInt === 13) { + theUnicode = '\\r'; + } else { + theUnicode = theString.charAt(i); + } + } else { + if(this._convertToUnicode) { + theUnicode = theString.charCodeAt(i).toString(16)+''.toUpperCase(); + while (theUnicode.length < 4) { + theUnicode = '0' + theUnicode; + } + theUnicode = '\\u' + theUnicode; + } else { + theUnicode = theString.charAt(i); + } + } + unicodeString += theUnicode; + + i++; + } + + return unicodeString; + } + + }, + + _stringifyValue: function(param) { + if (typeof param === 'string') { + return '"' + this._toUnicode(param) + '"'; + } else if (typeof param === 'number' && (isNaN(param) || !isFinite(param))) { // Unusable numbers go null + return 'null'; + } else if (typeof param === 'undefined' || param === null) { // And so does undefined + return 'null'; + } else if (typeof param.toJSON === 'function') { + var t = param.toJSON(); + if (typeof t === 'string') { + return '"' + this._escape(t) + '"'; + } else { + return this._escape(t.toString()); + } + } else if (typeof param === 'number' || typeof param === 'boolean') { // These ones' toString methods return valid JSON. + return '' + param; + } else if (typeof param === 'function') { + return 'null'; // match JSON.stringify + } else if (param.constructor === Date) { + return '"' + this._escape(dateToISOString(param)) + '"'; + } else if (param.constructor === Array) { + var arrayString = ''; + for (var i = 0, len = param.length; i < len; i++) { + if (i > 0) { + arrayString += ','; + } + arrayString += this._stringifyValue(param[i]); + } + return '[' + arrayString + ']'; + } else { // Object + var objectString = ''; + for (var k in param) { + if ({}.hasOwnProperty.call(param, k)) { + if (objectString !== '') { + objectString += ','; + } + objectString += '"' + this._escape(k) + '": ' + this._stringifyValue(param[k]); + } + } + return '{' + objectString + '}'; + } + }, + + /** + * Serializes a JSON object into a string. + * + * @method stringify + * @param {Object} input Data to be serialized into JSON + * @param {Boolean} convertToUnicode When `true`, converts string contents to unicode \uXXXX + * @return {String} Serialized string + * + * @sample Ink_Util_Json_stringify.html + */ + stringify: function(input, convertToUnicode) { + this._convertToUnicode = !!convertToUnicode; + if(!this._convertToUnicode && this._nativeJSON) { + return this._nativeJSON.stringify(input); + } + return this._stringifyValue(input); // And recurse. + }, + + /** + * Parses a JSON text through a function + * + * @method parse + * @param text {String} Input string + * @param reviver {Function} Function receiving `(key, value)`, and `this`=(containing object), used to walk objects. + * + * @return {Object} JSON object + * + * @sample Ink_Util_Json_parse.html + */ + /* From https://github.com/douglascrockford/JSON-js/blob/master/json.js */ + parse: function (text, reviver) { + /*jshint evil:true*/ + +// The parse method takes a text and an optional reviver function, and returns +// a JavaScript value if the text is a valid JSON text. + + var j; + + function walk(holder, key) { + +// The walk method is used to recursively walk the resulting structure so +// that modifications can be made. + + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + + +// Parsing happens in four stages. In the first stage, we replace certain +// Unicode characters with escape sequences. JavaScript handles many characters +// incorrectly, either silently deleting them, or treating them as line endings. + + text = String(text); + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + +// In the second stage, we run the text against regular expressions that look +// for non-JSON patterns. We are especially concerned with '()' and 'new' +// because they can cause invocation, and '=' because it can cause mutation. +// But just to be safe, we want to reject all unexpected forms. + +// We split the second stage into 4 regexp operations in order to work around +// crippling inefficiencies in IE's and Safari's regexp engines. First we +// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we +// replace all simple value tokens with ']' characters. Third, we delete all +// open brackets that follow a colon or comma or that begin the text. Finally, +// we look to see that the remaining characters are only whitespace or ']' or +// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. + + if (/^[\],:{}\s]*$/ + .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') + .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + +// In the third stage we use the eval function to compile the text into a +// JavaScript structure. The '{' operator is subject to a syntactic ambiguity +// in JavaScript: it can begin a block or an object literal. We wrap the text +// in parens to eliminate the ambiguity. + + j = eval('(' + text + ')'); + +// In the optional fourth stage, we recursively walk the new structure, passing +// each name/value pair to a reviver function for possible transformation. + + return typeof reviver === 'function' ? + walk({'': j}, '') : + j; + } + +// If the text is not JSON parseable, then a SyntaxError is thrown. + + throw new SyntaxError('JSON.parse'); + } + }; + + return InkJson; +}); + +/** + * String Utilities + * @module Ink.Util.String_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.String', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.String_1 + */ + var InkUtilString = { + + /** + * List of special chars + * + * @property _chars + * @type {Array} + * @private + * @readOnly + * @static + */ + _chars: ['&','à','á','â','ã','ä','å','æ','ç','è','é', + 'ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô', + 'õ','ö','ø','ù','ú','û','ü','ý','þ','ÿ','À', + 'Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë', + 'Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö', + 'Ø','Ù','Ú','Û','Ü','Ý','Þ','€','\"','ß','<', + '>','¢','£','¤','¥','¦','§','¨','©','ª','«', + '¬','\xad','®','¯','°','±','²','³','´','µ','¶', + '·','¸','¹','º','»','¼','½','¾'], + + /** + * List of the special characters' html entities + * + * @property _entities + * @type {Array} + * @private + * @readOnly + * @static + */ + _entities: ['amp','agrave','aacute','acirc','atilde','auml','aring', + 'aelig','ccedil','egrave','eacute','ecirc','euml','igrave', + 'iacute','icirc','iuml','eth','ntilde','ograve','oacute', + 'ocirc','otilde','ouml','oslash','ugrave','uacute','ucirc', + 'uuml','yacute','thorn','yuml','Agrave','Aacute','Acirc', + 'Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute', + 'Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde', + 'Ograve','Oacute','Ocirc','Otilde','Ouml','Oslash','Ugrave', + 'Uacute','Ucirc','Uuml','Yacute','THORN','euro','quot','szlig', + 'lt','gt','cent','pound','curren','yen','brvbar','sect','uml', + 'copy','ordf','laquo','not','shy','reg','macr','deg','plusmn', + 'sup2','sup3','acute','micro','para','middot','cedil','sup1', + 'ordm','raquo','frac14','frac12','frac34'], + + /** + * List of accented chars + * + * @property _accentedChars + * @type {Array} + * @private + * @readOnly + * @static + */ + _accentedChars:['à','á','â','ã','ä','å', + 'è','é','ê','ë', + 'ì','í','î','ï', + 'ò','ó','ô','õ','ö', + 'ù','ú','û','ü', + 'ç','ñ', + 'À','Á','Â','Ã','Ä','Å', + 'È','É','Ê','Ë', + 'Ì','Í','Î','Ï', + 'Ò','Ó','Ô','Õ','Ö', + 'Ù','Ú','Û','Ü', + 'Ç','Ñ'], + + /** + * List of the accented chars (above), but without the accents + * + * @property _accentedRemovedChars + * @type {Array} + * @private + * @readOnly + * @static + */ + _accentedRemovedChars:['a','a','a','a','a','a', + 'e','e','e','e', + 'i','i','i','i', + 'o','o','o','o','o', + 'u','u','u','u', + 'c','n', + 'A','A','A','A','A','A', + 'E','E','E','E', + 'I','I','I','I', + 'O','O','O','O','O', + 'U','U','U','U', + 'C','N'], + /** + * Object that contains the basic HTML unsafe chars, as keys, and their HTML entities as values + * + * @property _htmlUnsafeChars + * @type {Object} + * @private + * @readOnly + * @static + */ + _htmlUnsafeChars:{'<':'<','>':'>','&':'&','"':'"',"'":'''}, + + /** + * Capitalizes a word. + * If param as more than one word, it converts first letter of all words that have more than 2 letters + * + * @method ucFirst + * @param {String} string String to capitalize. + * @param {Boolean} [firstWordOnly]=false Flag to capitalize only the first word. + * @return {String} Camel cased string. + * @public + * @static + * @sample Ink_Util_String_ucFirst.html + */ + ucFirst: function(string, firstWordOnly) { + var replacer = firstWordOnly ? /(^|\s)(\w)(\S{2,})/ : /(^|\s)(\w)(\S{2,})/g; + return string ? String(string).replace(replacer, function(_, $1, $2, $3){ + return $1 + $2.toUpperCase() + $3.toLowerCase(); + }) : string; + }, + + /** + * Trims whitespace from strings + * + * @method trim + * @param {String} string String to be trimmed + * @return {String} Trimmed string + * @public + * @static + * @sample Ink_Util_String_trim.html + */ + trim: function(string) + { + if (typeof string === 'string') { + return string.replace(/^\s+|\s+$|\n+$/g, ''); + } + return string; + }, + + /** + * Strips HTML tags from strings + * + * @method stripTags + * @param {String} string String to strip tags from. + * @param {String} allowed Comma separated list of allowed tags. + * @return {String} Stripped string + * @public + * @static + * @sample Ink_Util_String_stripTags.html + */ + stripTags: function(string, allowed) + { + if (allowed && typeof allowed === 'string') { + var aAllowed = InkUtilString.trim(allowed).split(','); + var aNewAllowed = []; + var cleanedTag = false; + for(var i=0; i < aAllowed.length; i++) { + if(InkUtilString.trim(aAllowed[i]) !== '') { + cleanedTag = InkUtilString.trim(aAllowed[i].replace(/(<|\>)/g, '').replace(/\s/, '')); + aNewAllowed.push('(<'+cleanedTag+'\\s[^>]+>|<(\\s|\\/)?(\\s|\\/)?'+cleanedTag+'>)'); + } + } + var strAllowed = aNewAllowed.join('|'); + var reAllowed = new RegExp(strAllowed, "i"); + + var aFoundTags = string.match(new RegExp("<[^>]*>", "g")); + + for(var j=0; j < aFoundTags.length; j++) { + if(!aFoundTags[j].match(reAllowed)) { + string = string.replace((new RegExp(aFoundTags[j], "gm")), ''); + } + } + return string; + } else { + return string.replace(/<[^\>]+\>/g, ''); + } + }, + + /** + * Encodes string into HTML entities. + * + * @method htmlEntitiesEncode + * @param {String} string + * @return {String} string encoded + * @public + * @static + * @sample Ink_Util_String_htmlEntitiesEncode.html + */ + htmlEntitiesEncode: function(string) + { + if (string && string.replace) { + var re = false; + for (var i = 0; i < InkUtilString._chars.length; i++) { + re = new RegExp(InkUtilString._chars[i], "gm"); + string = string.replace(re, '&' + InkUtilString._entities[i] + ';'); + } + } + return string; + }, + + /** + * Decodes string from HTML entities. + * + * @method htmlEntitiesDecode + * @param {String} string String to be decoded + * @return {String} Decoded string + * @public + * @static + * @sample Ink_Util_String_htmlEntitiesDecode.html + */ + htmlEntitiesDecode: function(string) + { + if (string && string.replace) { + var re = false; + for (var i = 0; i < InkUtilString._entities.length; i++) { + re = new RegExp("&"+InkUtilString._entities[i]+";", "gm"); + string = string.replace(re, InkUtilString._chars[i]); + } + string = string.replace(/&#[^;]+;?/g, function($0){ + if ($0.charAt(2) === 'x') { + return String.fromCharCode(parseInt($0.substring(3), 16)); + } + else { + return String.fromCharCode(parseInt($0.substring(2), 10)); + } + }); + } + return string; + }, + + /** + * Encode a string to UTF-8. + * + * @method utf8Encode + * @param {String} string String to be encoded + * @return {String} string UTF-8 encoded string + * @public + * @static + */ + utf8Encode: function(string) { + /*jshint bitwise:false*/ + string = string.replace(/\r\n/g,"\n"); + var utfstring = ""; + + for (var n = 0; n < string.length; n++) { + + var c = string.charCodeAt(n); + + if (c < 128) { + utfstring += String.fromCharCode(c); + } + else if((c > 127) && (c < 2048)) { + utfstring += String.fromCharCode((c >> 6) | 192); + utfstring += String.fromCharCode((c & 63) | 128); + } + else { + utfstring += String.fromCharCode((c >> 12) | 224); + utfstring += String.fromCharCode(((c >> 6) & 63) | 128); + utfstring += String.fromCharCode((c & 63) | 128); + } + + } + return utfstring; + }, + + /** + * Truncates a string without breaking words. + * + * @method shortString + * @param {String} str String to truncate + * @param {Number} n Number of chars of the short string + * @return {String} + * @public + * @static + * @sample Ink_Util_String_shortString.html + */ + shortString: function(str,n) { + var words = str.split(' '); + var resultstr = ''; + for(var i = 0; i < words.length; i++ ){ + if((resultstr + words[i] + ' ').length>=n){ + resultstr += '…'; + break; + } + resultstr += words[i] + ' '; + } + return resultstr; + }, + + /** + * Truncates a string, breaking words and adding ... at the end. + * + * @method truncateString + * @param {String} str String to truncate + * @param {Number} length Limit for the returned string, ellipsis included. + * @return {String} Truncated String + * @public + * @static + * @sample Ink_Util_String_truncateString.html + */ + truncateString: function(str, length) { + if(str.length - 1 > length) { + return str.substr(0, length - 1) + "\u2026"; + } else { + return str; + } + }, + + /** + * Decodes a string from UTF-8. + * + * @method utf8Decode + * @param {String} string String to be decoded + * @return {String} Decoded string + * @public + * @static + */ + utf8Decode: function(utfstring) { + /*jshint bitwise:false*/ + var string = ""; + var i = 0, c = 0, c2 = 0, c3 = 0; + + while ( i < utfstring.length ) { + + c = utfstring.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } + else if((c > 191) && (c < 224)) { + c2 = utfstring.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + c2 = utfstring.charCodeAt(i+1); + c3 = utfstring.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + + } + return string; + }, + + /** + * Removes all accented characters from a string. + * + * @method removeAccentedChars + * @param {String} string String to remove accents from + * @return {String} String without accented chars + * @public + * @static + * @sample Ink_Util_String_removeAccentedChars.html + */ + removeAccentedChars: function(string) + { + var newString = string; + var re = false; + for (var i = 0; i < InkUtilString._accentedChars.length; i++) { + re = new RegExp(InkUtilString._accentedChars[i], "gm"); + newString = newString.replace(re, '' + InkUtilString._accentedRemovedChars[i] + ''); + } + return newString; + }, + + /** + * Count the number of occurrences of a specific needle in a haystack + * + * @method substrCount + * @param {String} haystack String to search in + * @param {String} needle String to search for + * @return {Number} Number of occurrences + * @public + * @static + * @sample Ink_Util_String_substrCount.html + */ + substrCount: function(haystack,needle) + { + return haystack ? haystack.split(needle).length - 1 : 0; + }, + + /** + * Eval a JSON - We recommend you Ink.Util.Json + * + * @method evalJSON + * @param {String} strJSON JSON string to eval + * @param {Boolean} sanitize Flag to sanitize input + * @return {Object} JS Object + * @public + * @static + */ + evalJSON: function(strJSON, sanitize) { + /* jshint evil:true */ + if( (typeof sanitize === 'undefined' || sanitize === null) || InkUtilString.isJSON(strJSON)) { + try { + if(typeof(JSON) !== "undefined" && typeof(JSON.parse) !== 'undefined'){ + return JSON.parse(strJSON); + } + return eval('('+strJSON+')'); + } catch(e) { + throw new Error('ERROR: Bad JSON string...'); + } + } + }, + + /** + * Checks if a string is a valid JSON object (string encoded) + * + * @method isJSON + * @param {String} str String to check + * @return {Boolean} + * @public + * @static + */ + isJSON: function(str) + { + str = str.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); + return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); + }, + + /** + * Escapes unsafe html chars as HTML entities + * + * @method htmlEscapeUnsafe + * @param {String} str String to escape + * @return {String} Escaped string + * @public + * @static + * @sample Ink_Util_String_htmlEscapeUnsafe.html + */ + htmlEscapeUnsafe: function(str){ + var chars = InkUtilString._htmlUnsafeChars; + return str !== null ? String(str).replace(/[<>&'"]/g,function(c){return chars[c];}) : str; + }, + + /** + * Normalizes whitespace in string. + * String is trimmed and sequences of whitespaces are collapsed. + * + * @method normalizeWhitespace + * @param {String} str String to normalize + * @return {String} Normalized string + * @public + * @static + * @sample Ink_Util_String_normalizeWhitespace.html + */ + normalizeWhitespace: function(str){ + return str !== null ? InkUtilString.trim(String(str).replace(/\s+/g,' ')) : str; + }, + + /** + * Converts string to unicode. + * + * @method toUnicode + * @param {String} str String to convert + * @return {String} Unicoded String + * @public + * @static + * @sample Ink_Util_String_toUnicode.html + */ + toUnicode: function(str) { + if (typeof str === 'string') { + var unicodeString = ''; + var inInt = false; + var theUnicode = false; + var total = str.length; + var i=0; + + while(i < total) + { + inInt = str.charCodeAt(i); + if( (inInt >= 32 && inInt <= 126) || + inInt === 8 || + inInt === 9 || + inInt === 10 || + inInt === 12 || + inInt === 13 || + inInt === 32 || + inInt === 34 || + inInt === 47 || + inInt === 58 || + inInt === 92) { + + /* + if(inInt == 34 || inInt == 92 || inInt == 47) { + theUnicode = '\\'+str.charAt(i); + } else { + } + */ + if(inInt === 8) { + theUnicode = '\\b'; + } else if(inInt === 9) { + theUnicode = '\\t'; + } else if(inInt === 10) { + theUnicode = '\\n'; + } else if(inInt === 12) { + theUnicode = '\\f'; + } else if(inInt === 13) { + theUnicode = '\\r'; + } else { + theUnicode = str.charAt(i); + } + } else { + theUnicode = str.charCodeAt(i).toString(16)+''.toUpperCase(); + while (theUnicode.length < 4) { + theUnicode = '0' + theUnicode; + } + theUnicode = '\\u' + theUnicode; + } + unicodeString += theUnicode; + + i++; + } + return unicodeString; + } + }, + + /** + * Escapes a unicode character. + * + * @method escape + * @param {String} c Character to escape + * @return {String} Escaped character. Returns \xXX if hex smaller than 0x100, otherwise \uXXXX + * @public + * @static + * @sample Ink_Util_String_escape.html + */ + escape: function(c) { + var hex = (c).charCodeAt(0).toString(16).split(''); + if (hex.length < 3) { + while (hex.length < 2) { hex.unshift('0'); } + hex.unshift('x'); + } + else { + while (hex.length < 4) { hex.unshift('0'); } + hex.unshift('u'); + } + + hex.unshift('\\'); + return hex.join(''); + }, + + /** + * Unescapes a unicode character escape sequence + * + * @method unescape + * @param {String} es Escape sequence + * @return {String} String un-unicoded + * @public + * @static + * @sample Ink_Util_String_unescape.html + */ + unescape: function(es) { + var idx = es.lastIndexOf('0'); + idx = idx === -1 ? 2 : Math.min(idx, 2); + //console.log(idx); + var hexNum = es.substring(idx); + //console.log(hexNum); + var num = parseInt(hexNum, 16); + return String.fromCharCode(num); + }, + + /** + * Escapes a string to unicode characters + * + * @method escapeText + * @param {String} txt + * @param {Array} [whiteList] Whitelist of characters + * @return {String} String escaped to Unicode + * @public + * @static + * @sample Ink_Util_String_escapeText.html + */ + escapeText: function(txt, whiteList) { + if (whiteList === undefined) { + whiteList = ['[', ']', '\'', ',']; + } + var txt2 = []; + var c, C; + for (var i = 0, f = txt.length; i < f; ++i) { + c = txt[i]; + C = c.charCodeAt(0); + if (C < 32 || C > 126 && whiteList.indexOf(c) === -1) { + c = InkUtilString.escape(c); + } + txt2.push(c); + } + return txt2.join(''); + }, + + /** + * Regex to check escaped strings + * + * @property escapedCharRegex + * @type {Regex} + * @public + * @readOnly + * @static + */ + escapedCharRegex: /(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4})/g, + + /** + * Unescapes a string + * + * @method unescapeText + * @param {String} txt + * @return {String} Unescaped string + * @public + * @static + * @sample Ink_Util_String_unescapeText.html + */ + unescapeText: function(txt) { + /*jshint boss:true */ + var m; + while (m = InkUtilString.escapedCharRegex.exec(txt)) { + m = m[0]; + txt = txt.replace(m, InkUtilString.unescape(m)); + InkUtilString.escapedCharRegex.lastIndex = 0; + } + return txt; + }, + + /** + * Compares two strings. + * + * @method strcmp + * @param {String} str1 First String + * @param {String} str2 Second String + * @return {Number} + * @public + * @static + * @sample Ink_Util_String_strcmp.html + */ + strcmp: function(str1, str2) { + return ((str1 === str2) ? 0 : ((str1 > str2) ? 1 : -1)); + }, + + /** + * Splits a string into smaller chunks + * + * @method packetize + * @param {String} str String to divide + * @param {Number} maxLen Maximum chunk size (in characters) + * @return {Array} Chunks of the original string + * @public + * @static + * @sample Ink_Util_String_packetize.html + */ + packetize: function(str, maxLen) { + var len = str.length; + var parts = new Array( Math.ceil(len / maxLen) ); + var chars = str.split(''); + var sz, i = 0; + while (len) { + sz = Math.min(maxLen, len); + parts[i++] = chars.splice(0, sz).join(''); + len -= sz; + } + return parts; + } + }; + + return InkUtilString; + +}); + +/** + * URL Utilities + * @module Ink.Util.Url_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Url', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.Url_1 + */ + var Url = { + + /** + * Auxiliary string for encoding + * + * @property _keyStr + * @type {String} + * @readOnly + * @private + */ + _keyStr : 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + + + /** + * Gets URL of current page + * + * @method getUrl + * @return Current URL + * @public + * @static + * @sample Ink_Util_Url_getUrl.html + */ + getUrl: function() + { + return window.location.href; + }, + + /** + * Generates an URL string. + * + * @method genQueryString + * @param {String} uri Base URL + * @param {Object} params Object to transform to query string + * @return {String} URI with query string set + * @public + * @static + * @sample Ink_Util_Url_genQueryString.html + */ + genQueryString: function(uri, params) { + var hasQuestionMark = uri.indexOf('?') !== -1; + var sep, pKey, pValue, parts = [uri]; + + for (pKey in params) { + if (params.hasOwnProperty(pKey)) { + if (!hasQuestionMark) { + sep = '?'; + hasQuestionMark = true; + } else { + sep = '&'; + } + pValue = params[pKey]; + if (typeof pValue !== 'number' && !pValue) { + pValue = ''; + } + parts = parts.concat([sep, encodeURIComponent(pKey), '=', encodeURIComponent(pValue)]); + } + } + + return parts.join(''); + }, + + /** + * Gets an object from an URL encoded string. + * + * @method getQueryString + * @param {String} [str] URL String. When not specified it uses the current URL. + * @return {Object} Key-Value pair object + * @public + * @static + * @sample Ink_Util_Url_getQueryString.html + */ + getQueryString: function(str) + { + var url; + if(str && typeof(str) !== 'undefined') { + url = str; + } else { + url = this.getUrl(); + } + var aParams = {}; + if(url.match(/\?(.+)/i)) { + var queryStr = url.replace(/^(.*)\?([^\#]+)(\#(.*))?/g, "$2"); + if(queryStr.length > 0) { + var aQueryStr = queryStr.split(/[;&]/); + for(var i=0; i < aQueryStr.length; i++) { + var pairVar = aQueryStr[i].split('='); + aParams[decodeURIComponent(pairVar[0])] = (typeof(pairVar[1]) !== 'undefined' && pairVar[1]) ? decodeURIComponent(pairVar[1]) : false; + } + } + } + return aParams; + }, + + /** + * Gets the URL hash value + * + * @method getAnchor + * @param {String} [str] URL String. Defaults to current page URL. + * @return {String|Boolean} Hash in the URL. If there's no hash, returns false. + * @public + * @static + * @sample Ink_Util_Url_getAnchor.html + */ + getAnchor: function(str) + { + var url; + if(str && typeof(str) !== 'undefined') { + url = str; + } else { + url = this.getUrl(); + } + var anchor = false; + if(url.match(/#(.+)/)) { + anchor = url.replace(/([^#]+)#(.*)/, "$2"); + } + return anchor; + }, + + /** + * Gets the anchor string of an URL + * + * @method getAnchorString + * @param {String} [string] URL to parse. Defaults to current URL. + * @return {Object} Key-value pair object of the URL's hashtag 'variables' + * @public + * @static + * @sample Ink_Util_Url_getAnchorString.html + */ + getAnchorString: function(string) + { + var url; + if(string && typeof(string) !== 'undefined') { + url = string; + } else { + url = this.getUrl(); + } + var aParams = {}; + if(url.match(/#(.+)/i)) { + var anchorStr = url.replace(/^([^#]+)#(.*)?/g, "$2"); + if(anchorStr.length > 0) { + var aAnchorStr = anchorStr.split(/[;&]/); + for(var i=0; i < aAnchorStr.length; i++) { + var pairVar = aAnchorStr[i].split('='); + aParams[decodeURIComponent(pairVar[0])] = (typeof(pairVar[1]) !== 'undefined' && pairVar[1]) ? decodeURIComponent(pairVar[1]) : false; + } + } + } + return aParams; + }, + + + /** + * Parses URL string into URL parts + * + * @method parseUrl + * @param {String} url URL to be parsed + * @return {Object} Parsed URL as a key-value object. + * @public + * @static + * @sample Ink_Util_Url_parseUrl.html + */ + parseUrl: function(url) { + var aURL = {}; + if(url && typeof url === 'string') { + if(url.match(/^([^:]+):\/\//i)) { + var re = /^([^:]+):\/\/([^\/]*)\/?([^\?#]*)\??([^#]*)#?(.*)/i; + if(url.match(re)) { + aURL.scheme = url.replace(re, "$1"); + aURL.host = url.replace(re, "$2"); + aURL.path = '/'+url.replace(re, "$3"); + aURL.query = url.replace(re, "$4") || false; + aURL.fragment = url.replace(re, "$5") || false; + } + } else { + var re1 = new RegExp("^([^\\?]+)\\?([^#]+)#(.*)", "i"); + var re2 = new RegExp("^([^\\?]+)\\?([^#]+)#?", "i"); + var re3 = new RegExp("^([^\\?]+)\\??", "i"); + if(url.match(re1)) { + aURL.scheme = false; + aURL.host = false; + aURL.path = url.replace(re1, "$1"); + aURL.query = url.replace(re1, "$2"); + aURL.fragment = url.replace(re1, "$3"); + } else if(url.match(re2)) { + aURL.scheme = false; + aURL.host = false; + aURL.path = url.replace(re2, "$1"); + aURL.query = url.replace(re2, "$2"); + aURL.fragment = false; + } else if(url.match(re3)) { + aURL.scheme = false; + aURL.host = false; + aURL.path = url.replace(re3, "$1"); + aURL.query = false; + aURL.fragment = false; + } + } + if(aURL.host) { + var regPort = /^(.*?)\\:(\\d+)$/i; + // check for port + if(aURL.host.match(regPort)) { + var tmpHost1 = aURL.host; + aURL.host = tmpHost1.replace(regPort, "$1"); + aURL.port = tmpHost1.replace(regPort, "$2"); + } else { + aURL.port = false; + } + // check for user and pass + if(aURL.host.match(/@/i)) { + var tmpHost2 = aURL.host; + aURL.host = tmpHost2.split('@')[1]; + var tmpUserPass = tmpHost2.split('@')[0]; + if(tmpUserPass.match(/\:/)) { + aURL.user = tmpUserPass.split(':')[0]; + aURL.pass = tmpUserPass.split(':')[1]; + } else { + aURL.user = tmpUserPass; + aURL.pass = false; + } + } + } + } + return aURL; + }, + + /** + * Formats an URL object into an URL string. + * + * @method format + * @param urlObj Window.location, a.href, or parseUrl object to format + * @return {String} Full URL. + */ + format: function (urlObj) { + var protocol = ''; + var host = ''; + var path = ''; + var frag = ''; + var query = ''; + + if (typeof urlObj.protocol === 'string') { + protocol = urlObj.protocol + '//'; // here it comes with the colon + } else if (typeof urlObj.scheme === 'string') { + protocol = urlObj.scheme + '://'; + } + + host = urlObj.host || urlObj.hostname || ''; + path = urlObj.path || ''; + + if (typeof urlObj.query === 'string') { + query = urlObj.query; + } else if (typeof urlObj.search === 'string') { + query = urlObj.search.replace(/^\?/, ''); + } + if (typeof urlObj.fragment === 'string') { + frag = urlObj.fragment; + } else if (typeof urlObj.hash === 'string') { + frag = urlObj.hash.replace(/#$/, ''); + } + + return [ + protocol, + host, + path, + query && '?' + query, + frag && '#' + frag + ].join(''); + }, + + /** + * Gets the last loaded script element + * + * @method currentScriptElement + * @param {String} [match] String to match against the script src attribute + * @return {DOMElement|Boolean} Returns the `script` DOM Element or false if unable to find it. + * @public + * @static + * @sample Ink_Util_Url_currentScriptElement.html + */ + currentScriptElement: function(match) + { + var aScripts = document.getElementsByTagName('script'); + if(typeof(match) === 'undefined') { + if(aScripts.length > 0) { + return aScripts[(aScripts.length - 1)]; + } else { + return false; + } + } else { + var curScript = false; + var re = new RegExp(""+match+"", "i"); + for(var i=0, total = aScripts.length; i < total; i++) { + curScript = aScripts[i]; + if(re.test(curScript.src)) { + return curScript; + } + } + return false; + } + }, + + + /* + base64Encode: function(string) + { + /** + * --function {String} ? + * --Convert a string to BASE 64 + * @param {String} string - string to convert + * @return base64 encoded string + * + * + if(!SAPO.Utility.String || typeof(SAPO.Utility.String) === 'undefined') { + throw "SAPO.Utility.Url.base64Encode depends of SAPO.Utility.String, which has not been referred."; + } + + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + + var input = SAPO.Utility.String.utf8Encode(string); + + while (i < input.length) { + + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); + } + return output; + }, + base64Decode: function(string) + { + * --function {String} ? + * Decode a BASE 64 encoded string + * --param {String} string base64 encoded string + * --return string decoded + if(!SAPO.Utility.String || typeof(SAPO.Utility.String) === 'undefined') { + throw "SAPO.Utility.Url.base64Decode depends of SAPO.Utility.String, which has not been referred."; + } + + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + + var input = string.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + while (i < input.length) { + + enc1 = this._keyStr.indexOf(input.charAt(i++)); + enc2 = this._keyStr.indexOf(input.charAt(i++)); + enc3 = this._keyStr.indexOf(input.charAt(i++)); + enc4 = this._keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output = output + String.fromCharCode(chr1); + + if (enc3 !== 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 !== 64) { + output = output + String.fromCharCode(chr3); + } + } + output = SAPO.Utility.String.utf8Decode(output); + return output; + }, + */ + + + /** + * Debug function ? + * + * @method _debug + * @private + * @static + */ + _debug: function() {} + + }; + + return Url; + +}); + +/** + * Validation Utilities + * @module Ink.Util.Validator_1 + * @version 1 + */ + +Ink.createModule('Ink.Util.Validator', '1', [], function() { + + 'use strict'; + + /** + * @namespace Ink.Util.Validator_1 + */ + var Validator = { + + /** + * List of country codes avaible for the isPhone method + * + * @property _countryCodes + * @type {Array} + * @private + * @static + * @readOnly + */ + _countryCodes : [ + 'AO', + 'CV', + 'MZ', + 'PT' + ], + + /** + * International number for portugal + * + * @property _internacionalPT + * @type {Number} + * @private + * @static + * @readOnly + * + */ + _internacionalPT: 351, + + /** + * List of all portuguese number prefixes + * + * @property _indicativosPT + * @type {Object} + * @private + * @static + * @readOnly + * + */ + _indicativosPT: { + 21: 'lisboa', + 22: 'porto', + 231: 'mealhada', + 232: 'viseu', + 233: 'figueira da foz', + 234: 'aveiro', + 235: 'arganil', + 236: 'pombal', + 238: 'seia', + 239: 'coimbra', + 241: 'abrantes', + 242: 'ponte de sôr', + 243: 'santarém', + 244: 'leiria', + 245: 'portalegre', + 249: 'torres novas', + 251: 'valença', + 252: 'vila nova de famalicão', + 253: 'braga', + 254: 'peso da régua', + 255: 'penafiel', + 256: 'são joão da madeira', + 258: 'viana do castelo', + 259: 'vila real', + 261: 'torres vedras', + 262: 'caldas da raínha', + 263: 'vila franca de xira', + 265: 'setúbal', + 266: 'évora', + 268: 'estremoz', + 269: 'santiago do cacém', + 271: 'guarda', + 272: 'castelo branco', + 273: 'bragança', + 274: 'proença-a-nova', + 275: 'covilhã', + 276: 'chaves', + 277: 'idanha-a-nova', + 278: 'mirandela', + 279: 'moncorvo', + 281: 'tavira', + 282: 'portimão', + 283: 'odemira', + 284: 'beja', + 285: 'moura', + 286: 'castro verde', + 289: 'faro', + 291: 'funchal, porto santo', + 292: 'corvo, faial, flores, horta, pico', + 295: 'angra do heroísmo, graciosa, são jorge, terceira', + 296: 'ponta delgada, são miguel, santa maria', + + 91 : 'rede móvel 91 (Vodafone / Yorn)', + 93 : 'rede móvel 93 (Optimus)', + 96 : 'rede móvel 96 (TMN)', + 92 : 'rede móvel 92 (TODOS)', + //925 : 'rede móvel 925 (TMN 925)', + //926 : 'rede móvel 926 (TMN 926)', + //927 : 'rede móvel 927 (TMN 927)', + //922 : 'rede móvel 922 (Phone-ix)', + + 707: 'número único', + 760: 'número único', + 800: 'número grátis', + 808: 'chamada local', + 30: 'voip' + }, + /** + * International number for Cabo Verde + * + * @property _internacionalCV + * @type {Number} + * @private + * @static + * @readOnly + */ + _internacionalCV: 238, + + /** + * List of all Cabo Verde number prefixes + * + * @property _indicativosCV + * @type {Object} + * @private + * @static + * @readOnly + */ + _indicativosCV: { + 2: 'fixo', + 91: 'móvel 91', + 95: 'móvel 95', + 97: 'móvel 97', + 98: 'móvel 98', + 99: 'móvel 99' + }, + /** + * International number for Angola + * + * @property _internacionalAO + * @type {Number} + * @private + * @static + * @readOnly + */ + _internacionalAO: 244, + + /** + * List of all Angola number prefixes + * + * @property _indicativosAO + * @type {Object} + * @private + * @static + * @readOnly + */ + _indicativosAO: { + 2: 'fixo', + 91: 'móvel 91', + 92: 'móvel 92' + }, + /** + * International number for Mozambique + * + * @property _internacionalMZ + * @type {Number} + * @private + * @static + * @readOnly + */ + _internacionalMZ: 258, + + /** + * List of all Mozambique number prefixes + * + * @property _indicativosMZ + * @type {Object} + * @private + * @static + * @readOnly + */ + _indicativosMZ: { + 2: 'fixo', + 82: 'móvel 82', + 84: 'móvel 84' + }, + + /** + * International number for Timor + * + * @property _internacionalTL + * @type {Number} + * @private + * @static + * @readOnly + */ + _internacionalTL: 670, + + /** + * List of all Timor number prefixes + * + * @property _indicativosTL + * @type {Object} + * @private + * @static + * @readOnly + */ + _indicativosTL: { + 3: 'fixo', + 7: 'móvel 7' + }, + + /** + * Regular expression groups for several groups of characters + * + * http://en.wikipedia.org/wiki/C0_Controls_and_Basic_Latin + * http://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane + * http://en.wikipedia.org/wiki/ISO_8859-1 + * + * @property _characterGroups + * @type {Object} + * @private + * @static + * @readOnly + */ + _characterGroups: { + numbers: ['0-9'], + asciiAlpha: ['a-zA-Z'], + latin1Alpha: ['a-zA-Z', '\u00C0-\u00FF'], + unicodeAlpha: ['a-zA-Z', '\u00C0-\u00FF', '\u0100-\u1FFF', '\u2C00-\uD7FF'], + /* whitespace characters */ + space: [' '], + dash: ['-'], + underscore: ['_'], + nicknamePunctuation: ['_.-'], + + singleLineWhitespace: ['\t '], + newline: ['\n'], + whitespace: ['\t\n\u000B\f\r\u00A0 '], + + asciiPunctuation: ['\u0021-\u002F', '\u003A-\u0040', '\u005B-\u0060', '\u007B-\u007E'], + latin1Punctuation: ['\u0021-\u002F', '\u003A-\u0040', '\u005B-\u0060', '\u007B-\u007E', '\u00A1-\u00BF', '\u00D7', '\u00F7'], + unicodePunctuation: ['\u0021-\u002F', '\u003A-\u0040', '\u005B-\u0060', '\u007B-\u007E', '\u00A1-\u00BF', '\u00D7', '\u00F7', '\u2000-\u206F', '\u2E00-\u2E7F', '\u3000-\u303F'] + }, + + /** + * Creates a regular expression for several character groups. + * + * @method createRegExp + * + * @param Groups* {Object} + * Groups to build regular expressions for. Possible keys are: + * + * - **numbers**: 0-9 + * - **asciiAlpha**: a-z, A-Z + * - **latin1Alpha**: asciiAlpha, plus printable characters in latin-1 + * - **unicodeAlpha**: unicode alphanumeric characters. + * - **space**: ' ', the space character. + * - **dash**: dash character. + * - **underscore**: underscore character. + * - **nicknamePunctuation**: dash, dot, underscore + * - **singleLineWhitespace**: space and tab (whitespace which only spans one line). + * - **newline**: newline character ('\n') + * - **whitespace**: whitespace characters in the ASCII character set. + * - **asciiPunctuation**: punctuation characters in the ASCII character set. + * - **latin1Punctuation**: punctuation characters in latin-1. + * - **unicodePunctuation**: punctuation characters in unicode. + * + */ + createRegExp: function (groups) { + var re = '^['; + for (var key in groups) if (groups.hasOwnProperty(key)) { + if (!(key in Validator._characterGroups)) { + throw new Error('group ' + key + ' is not a valid character group'); + } else if (groups[key]) { + re += Validator._characterGroups[key].join(''); + } + } + if (re === '^[') { + // No changes + return new RegExp('$^'); // match nothing + } + return new RegExp(re + ']*?$'); + }, + + /** + * Checks if a field has the required groups. + * + * @method checkCharacterGroups + * @param {String} s The validation string + * @param {Object} [groups]={} What groups are included. See createRegexp + * @sample Ink_Util_Validator_checkCharacterGroups.html + */ + checkCharacterGroups: function (s, groups) { + return Validator.createRegExp(groups).test(s); + }, + + /** + * Checks if a field contains unicode printable characters. + * + * @method unicode + * @param {String} s The validation string + * @param {Object} [options]={} Optional configuration object. See createRegexp + */ + unicode: function (s, options) { + return Validator.checkCharacterGroups(s, Ink.extendObj({ + unicodeAlpha: true}, options)); + }, + + /** + * Checks if a field only contains latin-1 alphanumeric characters. + * Takes options for allowing singleline whitespace, cross-line whitespace and punctuation. + * + * @method latin1 + * + * @param {String} s The validation string + * @param {Object} [options]={} Optional configuration object. See createRegexp + * @sample Ink_Util_Validator_latin1.html + */ + latin1: function (s, options) { + return Validator.checkCharacterGroups(s, Ink.extendObj({ + latin1Alpha: true}, options)); + }, + + /** + * Checks if a field only contains only ASCII alphanumeric characters. + * Takes options for allowing singleline whitespace, cross-line whitespace and punctuation. + * + * @method ascii + * + * @param {String} s The validation string + * @param {Object} [options]={} Optional configuration object. See createRegexp + * @sample Ink_Util_Validator_ascii.html + */ + ascii: function (s, options) { + return Validator.checkCharacterGroups(s, Ink.extendObj({ + asciiAlpha: true}, options)); + }, + + /** + * Checks if a number is a valid + * + * @method number + * @param {String} numb The number + * @param {Object} [options] Further options + * @param [options.decimalSep]='.' Allow decimal separator. + * @param [options.thousandSep]="," Strip this character from the number. + * @param [options.negative]=false Allow negative numbers. + * @param [options.decimalPlaces]=null Maximum number of decimal places. Use `0` for an integer number. + * @param [options.max]=null Maximum number + * @param [options.min]=null Minimum number + * @param [options.returnNumber]=false When this option is true, return the number itself when the value is valid. + * @sample Ink_Util_Validator_number.html + */ + number: function (numb, inOptions) { + numb = numb + ''; + var options = Ink.extendObj({ + decimalSep: '.', + thousandSep: '', + negative: true, + decimalPlaces: null, + maxDigits: null, + max: null, + min: null, + returnNumber: false + }, inOptions || {}); + // smart recursion thing sets up aliases for options. + if (options.thousandSep) { + numb = numb.replace(new RegExp('\\' + options.thousandSep, 'g'), ''); + options.thousandSep = ''; + return Validator.number(numb, options); + } + if (options.negative === false) { + options.min = 0; + options.negative = true; + return Validator.number(numb, options); + } + if (options.decimalSep !== '.') { + numb = numb.replace(new RegExp('\\' + options.decimalSep, 'g'), '.'); + } + + if (!/^(-)?(\d+)?(\.\d+)?$/.test(numb) || numb === '') { + return false; // forbidden character found + } + + var split; + if (options.decimalSep && numb.indexOf(options.decimalSep) !== -1) { + split = numb.split(options.decimalSep); + if (options.decimalPlaces !== null && + split[1].length > options.decimalPlaces) { + return false; + } + } else { + split = ['' + numb, '']; + } + + if (options.maxDigits!== null) { + if (split[0].replace(/-/g, '').length > options.maxDigits) { + return split; + } + } + + // Now look at the actual float + var ret = parseFloat(numb); + + if (options.maxExcl !== null && ret >= options.maxExcl || + options.minExcl !== null && ret <= options.minExcl) { + return false; + } + if (options.max !== null && ret > options.max || + options.min !== null && ret < options.min) { + return false; + } + + if (options.returnNumber) { + return ret; + } else { + return true; + } + }, + + /** + * Checks if a year is Leap "Bissexto" + * + * @method _isLeapYear + * @param {Number} year Year to be checked + * @return {Boolean} True if it is a leap year. + * @private + * @static + * @example + * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){ + * console.log( InkValidator._isLeapYear( 2004 ) ); // Result: true + * console.log( InkValidator._isLeapYear( 2006 ) ); // Result: false + * }); + */ + _isLeapYear: function(year){ + + var yearRegExp = /^\d{4}$/; + + if(yearRegExp.test(year)){ + return ((year%4) ? false: ((year%100) ? true : ((year%400)? false : true)) ); + } + + return false; + }, + + /** + * Object with the date formats available for validation + * + * @property _dateParsers + * @type {Object} + * @private + * @static + * @readOnly + */ + _dateParsers: { + 'yyyy-mm-dd': {day:5, month:3, year:1, sep: '-', parser: /^(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/}, + 'yyyy/mm/dd': {day:5, month:3, year:1, sep: '/', parser: /^(\d{4})(\/)(\d{1,2})(\/)(\d{1,2})$/}, + 'yy-mm-dd': {day:5, month:3, year:1, sep: '-', parser: /^(\d{2})(\-)(\d{1,2})(\-)(\d{1,2})$/}, + 'yy/mm/dd': {day:5, month:3, year:1, sep: '/', parser: /^(\d{2})(\/)(\d{1,2})(\/)(\d{1,2})$/}, + 'dd-mm-yyyy': {day:1, month:3, year:5, sep: '-', parser: /^(\d{1,2})(\-)(\d{1,2})(\-)(\d{4})$/}, + 'dd/mm/yyyy': {day:1, month:3, year:5, sep: '/', parser: /^(\d{1,2})(\/)(\d{1,2})(\/)(\d{4})$/}, + 'dd-mm-yy': {day:1, month:3, year:5, sep: '-', parser: /^(\d{1,2})(\-)(\d{1,2})(\-)(\d{2})$/}, + 'dd/mm/yy': {day:1, month:3, year:5, sep: '/', parser: /^(\d{1,2})(\/)(\d{1,2})(\/)(\d{2})$/} + }, + + /** + * Gets the number of days in a given month of a given year + * + * @method _daysInMonth + * @param {Number} _m Month (1 to 12) + * @param {Number} _y Year + * @return {Number} Returns the number of days in a given month of a given year + * @private + * @static + * @example + * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){ + * console.log( InkValidator._daysInMonth( 2, 2004 ) ); // Result: 29 + * console.log( InkValidator._daysInMonth( 2, 2006 ) ); // Result: 28 + * }); + */ + _daysInMonth: function(_m,_y){ + var nDays=0; + + _m = parseInt(_m, 10); + _y = parseInt(_y, 10); + + if(_m===1 || _m===3 || _m===5 || _m===7 || _m===8 || _m===10 || _m===12) { + nDays= 31; + } else if ( _m===4 || _m===6 || _m===9 || _m===11) { + nDays = 30; + } else if (_m===2) { + if((_y%400===0) || (_y%4===0 && _y%100!==0)) { + nDays = 29; + } else { + nDays = 28; + } + } + + return nDays; + }, + + + + /** + * Checks if a date is valid + * + * @method _isValidDate + * @param {Number} year + * @param {Number} month + * @param {Number} day + * @return {Boolean} True if valid + * @private + * @static + * @example + * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){ + * console.log( InkValidator._isValidDate( 2004, 2, 29 ) ); // Result: true + * console.log( InkValidator._isValidDate( 2006, 2, 29 ) ); // Result: false + * }); + */ + _isValidDate: function(year, month, day){ + + var yearRegExp = /^\d{4}$/; + var validOneOrTwo = /^\d{1,2}$/; + if(yearRegExp.test(year) && validOneOrTwo.test(month) && validOneOrTwo.test(day)){ + if(month>=1 && month<=12 && day>=1 && this._daysInMonth(month,year)>=day){ + return true; + } + } + + return false; + }, + + /** + * Checks if an email is valid + * + * @method mail + * @param {String} email + * @return {Boolean} True if it's valid + * @public + * @static + * @sample Ink_Util_Validator_mail.html + */ + email: function(email) + { + var emailValido = new RegExp("^[_a-z0-9-]+((\\.|\\+)[_a-z0-9-]+)*@([\\w]*-?[\\w]*\\.)+[a-z]{2,4}$", "i"); + if(!emailValido.test(email)) { + return false; + } else { + return true; + } + }, + + /** + * Deprecated. Alias for email(). Use it instead. + * + * @method mail + * @public + * @static + * @private + */ + mail: function (mail) { return Validator.email(mail); }, + + /** + * Checks if an url is valid + * + * @method url + * @param {String} url URL to be checked + * @param {Boolean} [full] If true, validates a full URL (one that should start with 'http') + * @return {Boolean} True if valid + * @public + * @static + * @sample Ink_Util_Validator_url.html + */ + url: function(url, full) + { + if(typeof full === "undefined" || full === false) { + var reHTTP = new RegExp("(^(http\\:\\/\\/|https\\:\\/\\/)(.+))", "i"); + if(reHTTP.test(url) === false) { + url = 'http://'+url; + } + } + + var reUrl = new RegExp("^(http:\\/\\/|https:\\/\\/)([\\w]*(-?[\\w]*)*\\.)+[a-z]{2,4}", "i"); + if(reUrl.test(url) === false) { + return false; + } else { + return true; + } + }, + + /** + * Checks if a phone is valid in Portugal + * + * @method isPTPhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid Portuguese Phone + * @public + * @static + * @sample Ink_Util_Validator_isPTPhone.html + */ + isPTPhone: function(phone) + { + + phone = phone.toString(); + var aInd = []; + for(var i in this._indicativosPT) { + if(typeof(this._indicativosPT[i]) === 'string') { + aInd.push(i); + } + } + var strInd = aInd.join('|'); + + var re351 = /^(00351|\+351)/; + if(re351.test(phone)) { + phone = phone.replace(re351, ""); + } + + var reSpecialChars = /(\s|\-|\.)+/g; + phone = phone.replace(reSpecialChars, ''); + //var reInt = new RegExp("\\d", "i"); + var reInt = /[\d]{9}/i; + if(phone.length === 9 && reInt.test(phone)) { + var reValid = new RegExp("^("+strInd+")"); + if(reValid.test(phone)) { + return true; + } + } + + return false; + }, + + /** + * Alias function for isPTPhone + * + * @method isPortuguesePhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid Portuguese Phone + * @public + * @static + */ + isPortuguesePhone: function(phone) + { + return this.isPTPhone(phone); + }, + + /** + * Checks if a phone is valid in Cabo Verde + * + * @method isCVPhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid Cape Verdean Phone + * @public + * @static + * @sample Ink_Util_Validator_isCVPhone.html + */ + isCVPhone: function(phone) + { + phone = phone.toString(); + var aInd = []; + for(var i in this._indicativosCV) { + if(typeof(this._indicativosCV[i]) === 'string') { + aInd.push(i); + } + } + var strInd = aInd.join('|'); + + var re238 = /^(00238|\+238)/; + if(re238.test(phone)) { + phone = phone.replace(re238, ""); + } + + var reSpecialChars = /(\s|\-|\.)+/g; + phone = phone.replace(reSpecialChars, ''); + //var reInt = new RegExp("\\d", "i"); + var reInt = /[\d]{7}/i; + if(phone.length === 7 && reInt.test(phone)) { + var reValid = new RegExp("^("+strInd+")"); + if(reValid.test(phone)) { + return true; + } + } + + return false; + }, + + /** + * Checks if a phone is valid in Angola + * + * @method isAOPhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid Angolan Phone + * @public + * @static + * @sample Ink_Util_Validator_isAOPhone.html + */ + isAOPhone: function(phone) + { + + phone = phone.toString(); + var aInd = []; + for(var i in this._indicativosAO) { + if(typeof(this._indicativosAO[i]) === 'string') { + aInd.push(i); + } + } + var strInd = aInd.join('|'); + + var re244 = /^(00244|\+244)/; + if(re244.test(phone)) { + phone = phone.replace(re244, ""); + } + + var reSpecialChars = /(\s|\-|\.)+/g; + phone = phone.replace(reSpecialChars, ''); + //var reInt = new RegExp("\\d", "i"); + var reInt = /[\d]{9}/i; + if(phone.length === 9 && reInt.test(phone)) { + var reValid = new RegExp("^("+strInd+")"); + if(reValid.test(phone)) { + return true; + } + } + + return false; + }, + + /** + * Checks if a phone is valid in Mozambique + * + * @method isMZPhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid Mozambican Phone + * @public + * @static + * @sample Ink_Util_Validator_isMZPhone.html + */ + isMZPhone: function(phone) + { + + phone = phone.toString(); + var aInd = []; + for(var i in this._indicativosMZ) { + if(typeof(this._indicativosMZ[i]) === 'string') { + aInd.push(i); + } + } + var strInd = aInd.join('|'); + var re258 = /^(00258|\+258)/; + if(re258.test(phone)) { + phone = phone.replace(re258, ""); + } + + var reSpecialChars = /(\s|\-|\.)+/g; + phone = phone.replace(reSpecialChars, ''); + //var reInt = new RegExp("\\d", "i"); + var reInt = /[\d]{8,9}/i; + if((phone.length === 9 || phone.length === 8) && reInt.test(phone)) { + var reValid = new RegExp("^("+strInd+")"); + if(reValid.test(phone)) { + if(phone.indexOf('2') === 0 && phone.length === 8) { + return true; + } else if(phone.indexOf('8') === 0 && phone.length === 9) { + return true; + } + } + } + + return false; + }, + + /** + * Checks if a phone is valid in Timor + * + * @method isTLPhone + * @param {Number} phone Phone number to be checked + * @return {Boolean} True if it's a valid phone from Timor-Leste + * @public + * @static + * @sample Ink_Util_Validator_isTLPhone.html + */ + isTLPhone: function(phone) + { + + phone = phone.toString(); + var aInd = []; + for(var i in this._indicativosTL) { + if(typeof(this._indicativosTL[i]) === 'string') { + aInd.push(i); + } + } + var strInd = aInd.join('|'); + var re670 = /^(00670|\+670)/; + if(re670.test(phone)) { + phone = phone.replace(re670, ""); + } + + + var reSpecialChars = /(\s|\-|\.)+/g; + phone = phone.replace(reSpecialChars, ''); + //var reInt = new RegExp("\\d", "i"); + var reInt = /[\d]{7}/i; + if(phone.length === 7 && reInt.test(phone)) { + var reValid = new RegExp("^("+strInd+")"); + if(reValid.test(phone)) { + return true; + } + } + + return false; + }, + + /** + * Checks if a number is a phone number. + * This method validates the number in all country codes available the ones set in the second param + * + * @method isPhone + * @param {String} phone Phone number to validate + * @param {String|Array} [countryCode] Country code or array of countries to validate + * @return {Boolean} True if it's a valid phone in any country available + * @public + * @static + * @sample Ink_Util_Validator_isPhone.html + */ + isPhone: function(){ + var index; + + if(arguments.length===0){ + return false; + } + + var phone = arguments[0]; + + if(arguments.length>1){ + if(arguments[1].constructor === Array){ + var func; + for(index=0; index= 0 && match[i-1] <= 100){ + valid = true; + } else { + return false; + } + } + // check 0 to 255 values + if(i===1 || i===3 || i===5 && (typeof match[i+1] === "undefined" || match[i+1] === "")){ + if(typeof match[i] !== "undefined" && match[i] >= 0 && match[i] <= 255){ + valid = true; + } else { + return false; + } + } + } + } + + // hsl range check + if((match = hsl.exec(str)) !== null || (match = hsla.exec(str)) !== null){ + i = match.length; + while(i--){ + // check percentage values + if(i===3 || i===5){ + if(typeof match[i-1] !== "undefined" && typeof match[i] !== "undefined" && match[i] !== "" && + match[i-1] >= 0 && match[i-1] <= 100){ + valid = true; + } else { + return false; + } + } + // check 0 to 360 value + if(i===1){ + if(typeof match[i] !== "undefined" && match[i] >= 0 && match[i] <= 360){ + valid = true; + } else { + return false; + } + } + } + } + + return valid; + }, + + /** + * Checks if the value is a valid IP. + * + * @method isIP + * @param {String} value Value to be checked + * @param {String} ipType Type of IP to be validated. The values are: ipv4, ipv6. By default is ipv4. + * @return {Boolean} True if the value is a valid IP address. False if not. + * @sample Ink_Util_Validator_isIP.html + */ + isIP: function( value, ipType ){ + if( typeof value !== 'string' ){ + return false; + } + + ipType = (ipType || 'ipv4').toLowerCase(); + + switch( ipType ){ + case 'ipv4': + return (/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/).test(value); + case 'ipv6': + return (/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/).test(value); + default: + return false; + } + }, + + /** + * Credit Card specifications, to be used in the credit card verification. + * + * @property _creditCardSpecs + * @type {Object} + * @private + */ + _creditCardSpecs: { + 'default': { + 'length': '13,14,15,16,17,18,19', + 'prefix': /^.+/, + 'luhn': true + }, + + 'american express': { + 'length': '15', + 'prefix': /^3[47]/, + 'luhn' : true + }, + + 'diners club': { + 'length': '14,16', + 'prefix': /^36|55|30[0-5]/, + 'luhn' : true + }, + + 'discover': { + 'length': '16', + 'prefix': /^6(?:5|011)/, + 'luhn' : true + }, + + 'jcb': { + 'length': '15,16', + 'prefix': /^3|1800|2131/, + 'luhn' : true + }, + + 'maestro': { + 'length': '16,18', + 'prefix': /^50(?:20|38)|6(?:304|759)/, + 'luhn' : true + }, + + 'mastercard': { + 'length': '16', + 'prefix': /^5[1-5]/, + 'luhn' : true + }, + + 'visa': { + 'length': '13,16', + 'prefix': /^4/, + 'luhn' : true + } + }, + + /** + * Luhn function, to be used when validating credit cards + * + */ + _luhn: function (num){ + + num = parseInt(num,10); + + if ( (typeof num !== 'number') && (num % 1 !== 0) ){ + // Luhn can only be used on nums! + return false; + } + + num = num+''; + // Check num length + var length = num.length; + + // Checksum of the card num + var + i, checksum = 0 + ; + + for (i = length - 1; i >= 0; i -= 2) + { + // Add up every 2nd digit, starting from the right + checksum += parseInt(num.substr(i, 1),10); + } + + for (i = length - 2; i >= 0; i -= 2) + { + // Add up every 2nd digit doubled, starting from the right + var dbl = parseInt(num.substr(i, 1) * 2,10); + + // Subtract 9 from the dbl where value is greater than 10 + checksum += (dbl >= 10) ? (dbl - 9) : dbl; + } + + // If the checksum is a multiple of 10, the number is valid + return (checksum % 10 === 0); + }, + + /** + * Checks if a number is of a specific credit card type + * @method isCreditCard + * @param {String} num Number to be validates + * @param {String|Array} creditCardType Credit card type. See _creditCardSpecs for the list of supported values. + * @return {Boolean} + * @sample Ink_Util_Validator_isCreditCard.html + */ + isCreditCard: function(num, creditCardType){ + + if ( /\d+/.test(num) === false ){ + return false; + } + + if ( typeof creditCardType === 'undefined' ){ + creditCardType = 'default'; + } + else if ( creditCardType instanceof Array ){ + var i, ccLength = creditCardType.length; + for ( i=0; i < ccLength; i++ ){ + // Test each type for validity + if (this.isCreditCard(num, creditCardType[i]) ){ + return true; + } + } + + return false; + } + + // Check card type + creditCardType = creditCardType.toLowerCase(); + + if ( typeof this._creditCardSpecs[creditCardType] === 'undefined' ){ + return false; + } + + // Check card number length + var length = num.length+''; + + // Validate the card length by the card type + if ( this._creditCardSpecs[creditCardType]['length'].split(",").indexOf(length) === -1 ){ + return false; + } + + // Check card number prefix + if ( !this._creditCardSpecs[creditCardType]['prefix'].test(num) ){ + return false; + } + + // No Luhn check required + if (this._creditCardSpecs[creditCardType]['luhn'] === false){ + return true; + } + + return this._luhn(num); + } + }; + + return Validator; + +}); diff --git a/public/js/ink.lazyload.js b/public/js/ink.lazyload.js new file mode 100644 index 0000000..7687b72 --- /dev/null +++ b/public/js/ink.lazyload.js @@ -0,0 +1,196 @@ +/** + * Delays content loading + * @module Ink.UI.LazyLoad_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.LazyLoad', '1', ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Element_1'], function(Common, InkEvent, InkElement) { +'use strict'; + +function LazyLoad() { + Common.BaseUIComponent.apply(this, arguments); +} + +LazyLoad._name = 'LazyLoad_1'; + +LazyLoad._optionDefinition = { + item: ['String', '.lazyload-item'], + placeholder: ['String', null], + source: ['String', 'data-src'], + destination: ['String', 'src'], + delay: ['Number', 100], + delta: ['Number', 0], + image: ['Boolean', true], + scrollElement: ['Element', window], + touchEvents: ['Boolean', true], + onInsideViewport: ['Function', false], + onAfterAttributeChange: ['Function', false], + autoInit: ['Boolean', true] +}; + +LazyLoad.prototype = { + /** + * Stops the browser from loading a barrage of content at once. + * + * This delays the loading of images and other content until the corresponding elements are visible in the browser viewport. + * This was created to load images later, but can be also used for widgets which are slow to load and are only useful when on screen. + * + * This works through copying the `src` attribute into `data-src`, and placing a `placeholder` string in the `src` attribute. Then, when the element is on screen, the `data-src` attribute is copied back to `src` and the content starts loading. You can use the options below to change what attributes are involved in the exchange. + * + * You can also provide your `onInsideViewport` callback and use it to start widgets which need javascript, such as an interactive map or an animation. + * + * @class Ink.UI.LazyLoad_1 + * @constructor + * + * @param rootElement {String|DOMElement} The element which contains the lazily-loaded items. + * @param {Object} [options] Options object, containing: + * @param {String} [options.item] Item selector. Defaults to '.lazyload-item'. + * @param {String} [options.placeholder] Placeholder value for items which are not 'visible', in case they don't already have a value set. + * @param {String} [options.source] Source attribute. When an item is 'visible', use this attribute's value to set its destination attribute. Defaults to 'data-src'. + * @param {String} [options.destination] Destination attribute. Attribute to change when the element is 'visible'. Defaults to 'src'. + * @param {Number} [options.delay] Milliseconds to wait before trying to load items. Defaults to 100. + * @param {Number} [options.delta] Offset distance in pixels. Determines how far the top of an item must be from the viewport be considered 'visible'. Negative values shrink the considered 'visible' viewport while positive values enlarge it. Defaults to 0. + * @param {Boolean} [options.image] Set to false to make this component do nothing to any elements and just give you the onInsideViewport callback. + * @param {DOMElement} [options.scrollElement] (advanced) What element is to be listened for the scroll event. Defaults to document.window. + * @param {Boolean} [options.touchEvents] Subscribe to touch events in addition to scroll events. Useful in mobile safari because 'scroll' events aren't frequent enough. Defaults to true. + * @param {Function} [options.onInsideViewport] Callback function for when an `item` is 'visible'. Receives an object containing the item's element as an argument. + * @param {Function} [options.onAfterAttributeChange] (advanced) Callback function when an item's attribute changes. Receives an object containing the item's element as an argument. + * @param {Boolean} [options.autoInit] (advanced) Set to false if you want to start LazyLoad yourself with `reload()`. Defaults to true. + * + * @sample Ink_UI_LazyLoad_1.html + */ + _init: function() { + this._rootElm = this._element; + + this._aData = []; + this._hasEvents = false; + + if(this._options.autoInit) { + this._activate(); + } + }, + + _activate: function() + { + this._getData(); + if(!this._hasEvents) { + this._addEvents(); + } + this._onScrollThrottled(); + }, + + _getData: function() + { + var aElms = Ink.ss(this._options.item); + var attr = null; + for(var i=0, t=aElms.length; i < t; i++) { + if (this._options.placeholder != null && !InkElement.hasAttribute(aElms[i], this._options.destination)) { + aElms[i].setAttribute(this._options.destination, this._options.placeholder); + } + attr = aElms[i].getAttribute(this._options.source); + if(attr !== null || !this._options.image) { + this._aData.push({elm: aElms[i], original: attr}); + } + } + }, + + _addEvents: function() + { + this._onScrollThrottled = InkEvent.throttle(Ink.bindEvent(this._onScroll, this), this._options.delay); + if('ontouchmove' in document.documentElement && this._options.touchEvents) { + InkEvent.observe(document.documentElement, 'touchmove', this._onScrollThrottled); + } + InkEvent.observe(this._options.scrollElement, 'scroll', this._onScrollThrottled); + this._hasEvents = true; + }, + + _removeEvents: function() { + if('ontouchmove' in document.documentElement && this._options.touchEvents) { + InkEvent.stopObserving(document.documentElement, 'touchmove', this._onScrollThrottled); + } + InkEvent.stopObserving(this._options.scrollElement, 'scroll', this._onScrollThrottled); + this._hasEvents = false; + }, + + _onScroll: function() { + var curElm; + + for(var i=0; i < this._aData.length; i++) { + curElm = this._aData[i]; + + if(InkElement.inViewport(curElm.elm, { partial: true, margin: this._options.delta })) { + this._elInViewport(curElm); + if (this._options.image) { + /* [todo] a seemingly unrelated option creates a branch? Some of this belongs in another module. */ + this._aData.splice(i, 1); + i -= 1; + } + } + } + + if (this._aData.length === 0) { + this._removeEvents(); + } + }, + + /** + * Called when an element is detected inside the viewport + * + * @method _elInViewport + * @param {LazyLoadInternalElementData} curElm + * @private + **/ + _elInViewport: function (curElm) { + this._userCallback('onInsideViewport', { element: curElm.elm }); + + if(this._options.image) { + curElm.elm.setAttribute(this._options.destination, curElm.original); + curElm.elm.removeAttribute(this._options.source); + } + + this._userCallback('onAfterAttributeChange', { element: curElm.elm }); + }, + + /** + * Call a callback if it exists and its `typeof` is `"function"`. + * @method _userCallback + * @param name {String} Callback name in this._options. + * @private + **/ + _userCallback: function (name) { + if (typeof this._options[name] === 'function') { + this._options[name].apply(this, [].slice.call(arguments, 1)); + } + }, + + /** + * Load or reload the component. + * Adding the 'scroll' event listener if necessary and checks if anything needs to be loaded now. + * + * You can use this to manually invoke the loading logic without user action. + * + * @method reload + * @public + */ + reload: function() { + this._activate(); + }, + + /** + * Destroy this component + * @method destroy + * @public + **/ + destroy: function() { + if(this._hasEvents) { + this._removeEvents(); + } + Common.destroyComponent.call(this); + } +}; + +Common.createUIComponent(LazyLoad); + +return LazyLoad; + +}); diff --git a/public/js/ink.min.js b/public/js/ink.min.js new file mode 100644 index 0000000..71613c4 --- /dev/null +++ b/public/js/ink.min.js @@ -0,0 +1,5 @@ +!function(a,b){"use strict";if(!("Ink"in a)){var c={},d={},e=[],f={},g=[],h={},i=Function.prototype.apply,j=function(a){if("object"!=typeof a)return!1;for(var b in a)if(a.hasOwnProperty(b))return!1;return!0};a.Ink={VERSION:"3.0.5",_checkPendingRequireModules:function(){var a,b,c,e,f,h,i=[];for(a=0,b=g.length;b>a;++a)if(c=g[a]){for(e in c.left)c.left.hasOwnProperty(e)&&(f=d[e],f&&(c.args[c.left[e]]=f,delete c.left[e],--c.remaining));if(c.remaining>0)i.push(c);else{if(h=c.cb,!h)continue;delete c.cb,h.apply(!1,c.args)}}g=i,g.length>0&&setTimeout(function(){Ink._checkPendingRequireModules()},0)},getPath:function(a,b){var d=a.split(/[._]/g),e,f,g,h;for(f=d.length;f>=0;f-=1)if(e=d.slice(0,f+1).join("."),c[e]){g=e;break}return g in c?(h=c[g],/\/$/.test(h)||(h+="/"),f0&&g[0].appendChild(f)},_loadLater:function(a){setTimeout(function(){d[a]||f[a]||h[a]||(f[a]=!0,Ink.loadScript(a))},0)},namespace:function(b,c){if(!b||!b.length)return null;for(var d=b.split("."),e=a,f,g=0,h=d.length;h>g;++g)e[d[g]]=e[d[g]]||{},f=e,e=e[d[g]];return c?[f,d[g-1]]:e},getModule:function(a,b){var c=b?[a,"_",b].join(""):a;return d[c]},createModule:function(b,c,g,i){if("string"!=typeof b)throw new Error("module name must be a string!");if(!("number"==typeof c||"string"==typeof c&&c.length>0))throw new Error("version number missing!");var k=[b,"_",c].join("");h[k]=!0;var l=function(){if(!d[k]){delete f[k],delete f[b];var g=Array.prototype.slice.call(arguments),l=i.apply(a,g);e.push(k),"object"==typeof l?l._version=c:"function"==typeof l&&(l.prototype._version=c,l._version=c);var m=0===b.indexOf("Ink."),n;m&&(n=Ink.namespace(b,!0)),d[k]=l,delete h[k],m&&(n[0][n[1]+"_"+c]=l),d[b]=l,m&&j(n[0][n[1]])&&(n[0][n[1]]=l),this&&Ink._checkPendingRequireModules()}};this.requireModules(g,l)},requireModules:function(a,b){var c,e,h,i,j;if(e=a&&a.length,h={args:new Array(e),left:{},remaining:e,cb:b},"object"!=typeof a||void 0===a.length)throw new Error("Dependency list should be an array!");if("function"!=typeof b)throw new Error("Callback should be a function!");for(c=0;e>c;++c)Ink._moduleRenames[a[c]]?(Ink.warn(a[c]+" was renamed to "+Ink._moduleRenames[a[c]]),i=Ink._moduleRenames[a[c]]):i=a[c],i?(j=d[i],j?(h.args[c]=j,--h.remaining):(f[i]||Ink._loadLater(i),h.left[i]=c)):--h.remaining;h.remaining>0?g.push(h):b.apply(!0,h.args)},_moduleRenames:{"Ink.UI.Aux_1":"Ink.UI.Common_1"},getModulesLoadOrder:function(){return e.slice()},getModuleScripts:function(){var a=this.getModulesLoadOrder();return a.unshift("Ink_1"),a=a.map(function(a){return[""].join("")}),a.join("\n")},createExt:function(a,b,c,d){return Ink.createModule("Ink.Ext."+a,b,c,d)},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=Array.prototype.slice.call(arguments),e=c.concat(d);return a.apply(b===!1?this:b,e)}},bindMethod:function(a,b){return Ink.bind.apply(Ink,[a[b],a].concat([].slice.call(arguments,2)))},bindEvent:function(b,c){var d=Array.prototype.slice.call(arguments,2);return function(e){var f=d.slice();return f.unshift(e||a.event),b.apply(c===!1?this:c,f)}},i:function(a){if(!a)throw new Error("Ink.i => id or element must be passed");return"string"==typeof a?b.getElementById(a):a},ss:function(a,c){if("undefined"==typeof Ink.Dom||"undefined"==typeof Ink.Dom.Selector)throw new Error("This method requires Ink.Dom.Selector");return Ink.Dom.Selector.select(a,c||b)},s:function(a,c){if("undefined"==typeof Ink.Dom||"undefined"==typeof Ink.Dom.Selector)throw new Error("This method requires Ink.Dom.Selector");return Ink.Dom.Selector.select(a,c||b)[0]||null},extendObj:function(a){for(var b=[].slice.call(arguments,1),c=0,d=b.length;d>c;c++)if(b[c])for(var e in b[c])Object.prototype.hasOwnProperty.call(b[c],e)&&(a[e]=b[c][e]);return a},log:function(){var b=a.console;b&&b.log&&i.call(b.log,b,arguments)},warn:function(){var b=a.console;b&&b.warn&&i.call(b.warn,b,arguments)},error:function(){var b=a.console;b&&b.error&&i.call(b.error,b,arguments)}}}}(window,document),Ink.createModule("Ink.Net.Ajax","1",[],function(){"use strict";var Ajax=function(a,b){this.init(a,b)};Ajax.globalOptions={parameters:{},requestHeaders:{}};var xMLHttpRequestWithCredentials="XMLHttpRequest"in window&&"withCredentials"in new XMLHttpRequest;return Ajax.prototype={init:function(a,b){if(!a)throw new Error("WRONG_ARGUMENTS_ERR");var c=Ink.extendObj({asynchronous:!0,method:"POST",parameters:null,timeout:0,delay:0,postBody:"",contentType:"application/x-www-form-urlencoded",requestHeaders:null,onComplete:null,onSuccess:null,onFailure:null,onException:null,onHeaders:null,onCreate:null,onInit:null,onTimeout:null,sanitizeJSON:!1,evalJS:!0,xhrProxy:"",cors:!1,debug:!1,useCredentials:!1,signRequest:!1},Ajax.globalOptions);if(b&&"object"==typeof b){if(c=Ink.extendObj(c,b),"object"==typeof b.parameters)c.parameters=Ink.extendObj(Ink.extendObj({},Ajax.globalOptions.parameters),b.parameters);else if(null!==b.parameters){var d=this.paramsObjToStr(Ajax.globalOptions.parameters);d&&(c.parameters=b.parameters+"&"+d)}c.requestHeaders=Ink.extendObj({},Ajax.globalOptions.requestHeaders),c.requestHeaders=Ink.extendObj(c.requestHeaders,b.requestHeaders)}this.options=c,this.safeCall("onInit"),this.url=a;var e=this._locationFromURL(a);this.isHTTP=this._locationIsHTTP(e),this.isCrossDomain=this._locationIsCrossDomain(e,location),this.requestHasBody=c.method.search(/^get|head$/i)<0,this.options.cors&&(this.isCrossDomain=!1),this.transport=this.getTransport(),this.request()},_locationFromURL:function(a){var b=document.createElementNS?document.createElementNS("http://www.w3.org/1999/xhtml","a"):document.createElement("a");return b.href=a,b},_locationIsHTTP:function(a){return a.protocol.match(/^https?:/i)?!0:!1},_locationIsCrossDomain:function(a,b){return b=b||window.location,Ajax.prototype._locationIsHTTP(a)&&"widget:"!==b.protocol&&"object"!=typeof window.widget?b.protocol!==a.protocol||b.host.split(":")[0]!==a.host.split(":")[0]:!1},getTransport:function(){if(!xMLHttpRequestWithCredentials&&this.options.cors&&"XDomainRequest"in window)return this.usingXDomainReq=!0,new XDomainRequest;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"==typeof ActiveXObject)return null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){return new ActiveXObject("Microsoft.XMLHTTP")}},setHeaders:function(){if(this.transport)try{var a={Accept:"text/javascript,text/xml,application/xml,application/xhtml+xml,text/html,application/json;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1","Accept-Language":navigator.language,"X-Requested-With":"XMLHttpRequest","X-Ink-Version":"2"};if(this.options.cors&&(this.options.signRequest||delete a["X-Requested-With"],delete a["X-Ink-Version"]),this.options.requestHeaders&&"object"==typeof this.options.requestHeaders)for(var b in this.options.requestHeaders)this.options.requestHeaders.hasOwnProperty(b)&&(a[b]=this.options.requestHeaders[b]);this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005&&(a.Connection="close");for(var c in a)a.hasOwnProperty(c)&&this.transport.setRequestHeader(c,a[c])}catch(d){}},paramsObjToStr:function(a){var b,c,d,e,f=[];if("object"!=typeof a)return a;for(d in a)if(a.hasOwnProperty(d))if(e=a[d],"[object Array]"!==Object.prototype.toString.call(e)||isNaN(e.length))f=f.concat([encodeURIComponent(d),"=",encodeURIComponent(e),"&"]);else for(b=0,c=e.length;c>b;b++)f=f.concat([encodeURIComponent(d),"[]","=",encodeURIComponent(e[b]),"&"]);return f.length>0&&f.pop(),f.join("")},setParams:function(){var a=null,b=this.options.parameters;a="object"==typeof b?this.paramsObjToStr(b):""+b,a&&(this.url=this.url.indexOf("?")>-1?this.url.split("#")[0]+"&"+a:this.url.split("#")[0]+"?"+a)},getHeader:function(a){if(this.usingXDomainReq&&"Content-Type"===a)return this.transport.contentType;try{return this.transport.getResponseHeader(a)}catch(b){return null}},getAllHeaders:function(){try{return this.transport.getAllResponseHeaders()}catch(a){return null}},getResponse:function(){var a=this.transport,b={headerJSON:null,responseJSON:null,getHeader:this.getHeader,getAllHeaders:this.getAllHeaders,request:this,transport:a,timeTaken:new Date-this.startTime,requestedUrl:this.url};b.readyState=a.readyState;try{b.responseText=a.responseText}catch(c){}try{b.responseXML=a.responseXML}catch(c){}try{b.status=a.status}catch(c){b.status=0}try{b.statusText=a.statusText}catch(c){b.statusText=""}return b},abort:function(){if(this.transport){clearTimeout(this.delayTimeout),clearTimeout(this.stoTimeout);try{this.transport.abort()}catch(a){}this.finish()}},runStateChange:function(){var a=this.transport.readyState;if(3===a)this.isHTTP&&this.safeCall("onHeaders");else if(4===a||this.usingXDomainReq){if(this.options.asynchronous&&this.options.delay&&this.startTime+this.options.delay>(new Date).getTime())return void(this.delayTimeout=setTimeout(Ink.bind(this.runStateChange,this),this.options.delay+this.startTime-(new Date).getTime()));var b,c=this.transport.responseText,d=this.getResponse(),e=this.transport.status;this.isHTTP&&!this.options.asynchronous&&this.safeCall("onHeaders"),clearTimeout(this.stoTimeout),0===e?this.isHTTP?this.safeCall("onException",this.makeError(18,"NETWORK_ERR")):e=c?200:404:304===e&&(e=200);var f=this.usingXDomainReq||e>=200&&300>e,g=this.getHeader("Content-Type")||"";if(this.options.evalJS&&(g.indexOf("application/json")>=0||"force"===this.options.evalJS))try{b=this.evalJSON(c,this.sanitizeJSON),b&&(c=d.responseJSON=b)}catch(h){f&&this.safeCall("onException",h)}if(this.usingXDomainReq&&-1!==g.indexOf("xml")&&"DOMParser"in window){var i;switch(g){case"application/xml":case"application/xhtml+xml":case"image/svg+xml":i=g;break;default:i="text/xml"}var j=(new DOMParser).parseFromString(this.transport.responseText,i);this.transport.responseXML=j,d.responseXML=j}null!==this.transport.responseXML&&null===d.responseJSON&&""!==this.transport.responseXML.xml&&(c=this.transport.responseXML),(e||this.usingXDomainReq)&&(f?this.safeCall("onSuccess",d,c):this.safeCall("onFailure",d,c),this.safeCall("on"+e,d,c)),this.finish(d,c)}},finish:function(a,b){if(a&&this.safeCall("onComplete",a,b),clearTimeout(this.stoTimeout),this.transport){try{this.transport.onreadystatechange=null}catch(c){}"function"==typeof this.transport.destroy&&this.transport.destroy(),this.transport=null}},safeCall:function(a,b){function c(a){setTimeout(function(){throw a.message&&(a.message+="\n"+(a.stacktrace||a.stack||"")),a},1)}if("function"==typeof this.options[a])try{this.options[a].apply(this,[].slice.call(arguments,1))}catch(d){c(d)}else b&&window.Error&&b instanceof Error&&c(b)},setRequestHeader:function(a,b){this.options.requestHeaders||(this.options.requestHeaders={}),this.options.requestHeaders[a]=b},request:function(){if(this.transport){var a=null;this.requestHasBody?(null!==this.options.postBody&&""!==this.options.postBody?(a=this.options.postBody,this.setParams()):null!==this.options.parameters&&""!==this.options.parameters&&(a=this.options.parameters),"object"!=typeof a||a.nodeType?"object"!=typeof a&&null!==a&&(a=""+a):a=this.paramsObjToStr(a),this.options.contentType&&this.setRequestHeader("Content-Type",this.options.contentType)):this.setParams();var b=this.url,c=this.options.method,d=this.isCrossDomain;d&&this.options.xhrProxy&&(this.setRequestHeader("X-Url",b),b=this.options.xhrProxy+encodeURIComponent(b),d=!1);try{this.transport.open(c,b,this.options.asynchronous)}catch(e){return this.safeCall("onException",e),this.finish(this.getResponse(),null)}this.setHeaders(),this.safeCall("onCreate"),this.options.timeout&&!isNaN(this.options.timeout)&&(this.stoTimeout=setTimeout(Ink.bind(function(){this.options.onTimeout&&(this.safeCall("onTimeout"),this.abort())},this),1e3*this.options.timeout)),this.options.useCredentials&&!this.usingXDomainReq&&(this.transport.withCredentials=!0),this.options.asynchronous&&!this.usingXDomainReq?this.transport.onreadystatechange=Ink.bind(this.runStateChange,this):this.usingXDomainReq&&(this.transport.onload=Ink.bind(this.runStateChange,this));try{if(d)throw this.makeError(18,"NETWORK_ERR");this.startTime=(new Date).getTime(),this.transport.send(a)}catch(e){return this.safeCall("onException",e),this.finish(this.getResponse(),null)}this.options.asynchronous||this.runStateChange()}},makeError:function(a,b){if("function"!=typeof Error)return{code:a,message:b};var c=new Error(b);return c.code=a,c},isJSON:function(a){return"string"==typeof a&&a?(a=a.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""),/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(a)):!1},evalJSON:function(strJSON,sanitize){if(strJSON&&(!sanitize||this.isJSON(strJSON)))try{return"undefined"!=typeof JSON&&"undefined"!=typeof JSON.parse?JSON.parse(strJSON):eval("("+strJSON+")")}catch(e){throw new Error("ERROR: Bad JSON string...")}return null}},Ajax.load=function(a,b){return new Ajax(a,{method:"GET",onSuccess:function(a){b(a.responseJSON||a.responseText,a)}})},Ajax.ping=function(a,b){return new Ajax(a,{method:"HEAD",onSuccess:function(a){"function"==typeof b&&b(a)}})},Ajax}),Ink.createModule("Ink.Net.JsonP","1",[],function(){"use strict";var a=function(a,b){this.init(a,b)};return a.prototype={init:function(a,b){if(this.options=Ink.extendObj({onSuccess:void 0,onFailure:void 0,failureObj:{},timeout:10,params:{},callbackParam:"jsoncallback",internalCallback:"_cb",randVar:!1},b||{}),this.randVar=this.options.randVar!==!1?this.options.randVar:parseInt(1e5*Math.random(),10),this.options.internalCallback+=this.randVar,this.uri=a,"function"==typeof this.options.onComplete&&(this.options.onSuccess=this.options.onComplete),"string"!=typeof this.uri)throw"Please define an URI";if("function"!=typeof this.options.onSuccess)throw"please define a callback function on option onSuccess!";Ink.Net.JsonP[this.options.internalCallback]=Ink.bind(function(){window.clearTimeout(this.timeout),delete window.Ink.Net.JsonP[this.options.internalCallback],this._removeScriptTag(),this.options.onSuccess(arguments[0])},this),this._addScriptTag()},_addParamsToGet:function(a,b){var c=-1!==a.indexOf("?"),d,e,f,g=[a];for(e in b)b.hasOwnProperty(e)&&(c?d="&":(d="?",c=!0),f=b[e],"number"==typeof f||f||(f=""),g=g.concat([d,e,"=",encodeURIComponent(f)]));return g.join("")},_getScriptContainer:function(){var a=document.getElementsByTagName("head");if(0===a.length){var b=document.getElementsByTagName("script");return b[0]}return a[0]},_addScriptTag:function(){this.options.params[this.options.callbackParam]="Ink.Net.JsonP."+this.options.internalCallback,this.options.params.rnd_seed=this.randVar,this.uri=this._addParamsToGet(this.uri,this.options.params);var a=document.createElement("script");a.type="text/javascript",a.src=this.uri;var b=this._getScriptContainer();b.appendChild(a),this.timeout=setTimeout(Ink.bind(this._requestFailed,this),1e3*this.options.timeout)},_requestFailed:function(){delete Ink.Net.JsonP[this.options.internalCallback],this._removeScriptTag(),"function"==typeof this.options.onFailure&&this.options.onFailure(this.options.failureObj)},_removeScriptTag:function(){for(var a,b=document.getElementsByTagName("script"),c,d=0,e=b.length;e>d;++d)if(a=b[d],c=a.getAttribute("src")||a.src,null!==c&&c===this.uri)return void a.parentNode.removeChild(a)}},a}),Ink.createModule("Ink.Dom.Browser","1",[],function(){"use strict";var a={IE:!1,GECKO:!1,OPERA:!1,SAFARI:!1,KONQUEROR:!1,CHROME:!1,model:!1,version:!1,userAgent:!1,cssPrefix:!1,domPrefix:!1,init:function(){this.detectBrowser(),this.setDimensions(),this.setReferrer()},setDimensions:function(){var a=0,b=0;"number"==typeof window.innerWidth?(a=window.innerWidth,b=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(a=document.documentElement.clientWidth,b=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(a=document.body.clientWidth,b=document.body.clientHeight),this.windowWidth=a,this.windowHeight=b},setReferrer:function(){this.referrer=document.referrer&&document.referrer.length?window.escape(document.referrer):!1},detectBrowser:function(){this._sniffUserAgent(navigator.userAgent)},_sniffUserAgent:function(a){if(this.userAgent=a,a=a.toLowerCase(),/applewebkit\//.test(a))if(this.cssPrefix="-webkit-",this.domPrefix="Webkit",/(chrome|crios)\//.test(a))this.CHROME=!0,this.model="chrome",this.version=a.replace(/(.*)chrome\/([^\s]+)(.*)/,"$2");else{this.SAFARI=!0,this.model="safari";var b=/version\/([^) ]+)/;this.version=b.test(a)?a.match(b)[1]:a.replace(/(.*)applewebkit\/([^\s]+)(.*)/,"$2")}else if(/opera/.test(a))this.OPERA=!0,this.model="opera",this.version=a.replace(/(.*)opera.([^\s$]+)(.*)/,"$2"),this.cssPrefix="-o-",this.domPrefix="O";else if(/konqueror/.test(a))this.KONQUEROR=!0,this.model="konqueror",this.version=a.replace(/(.*)konqueror\/([^;]+);(.*)/,"$2"),this.cssPrefix="-khtml-",this.domPrefix="Khtml";else if(/(msie|trident)/i.test(a))this.IE=!0,this.model="ie",this.version=/rv:((?:\d|\.)+)/.test(a)?a.match(/rv:((?:\d|\.)+)/)[1]:a.replace(/(.*)\smsie\s([^;]+);(.*)/,"$2"),this.cssPrefix="-ms-",this.domPrefix="ms";else if(/gecko/.test(a)){this.cssPrefix="-moz-",this.domPrefix="Moz",this.GECKO=!0;var c=/(camino|chimera|epiphany|minefield|firefox|firebird|phoenix|galeon|iceweasel|k\-meleon|seamonkey|netscape|songbird|sylera)/;if(c.test(a))this.model=a.match(c)[1],this.version=a.replace(new RegExp("(.*)"+this.model+"/([^;\\s$]+)(.*)"),"$2");else{this.model="mozilla";var d=/(.*)rv:([^)]+)(.*)/;d.test(a)&&(this.version=a.replace(d,"$2"))}}},debug:function(){var a="known browsers: (ie, gecko, opera, safari, konqueror) \n";a+=[this.IE,this.GECKO,this.OPERA,this.SAFARI,this.KONQUEROR]+"\n",a+="cssPrefix -> "+this.cssPrefix+"\n",a+="domPrefix -> "+this.domPrefix+"\n",a+="model -> "+this.model+"\n",a+="version -> "+this.version+"\n",a+="\n",a+="original UA -> "+this.userAgent,alert(a)}};return a.init(),a}),Ink.createModule("Ink.Dom.Css",1,[],function(){"use strict";var a="defaultView"in document&&"getComputedStyle"in document.defaultView?document.defaultView.getComputedStyle:window.getComputedStyle,b={addRemoveClassName:function(a,b,c){return c?this.addClassName(a,b):void this.removeClassName(a,b)},addClassName:function(a,c){if(a=Ink.i(a),!a||!c)return null;c=(""+c).split(/[, ]+/);for(var d=0,e=c.length;e>d;d++)c[d].replace(/^\s+|\s+$/g,"")&&("undefined"!=typeof a.classList?a.classList.add(c[d]):b.hasClassName(a,c[d])||(a.className+=(a.className?" ":"")+c[d]))},removeClassName:function(a,b){if(a=Ink.i(a),!a||!b)return null;b=(""+b).split(/[, ]+/);var c=0,d=b.length;if("undefined"!=typeof a.classList)for(;d>c;c++)a.classList.remove(b[c]);else{for(var e=a.className||"",f;d>c;c++)f=new RegExp("(^|\\s+)"+b[c]+"(\\s+|$)"),e=e.replace(f," ");a.className=e.replace(/^\s+/,"").replace(/\s+$/,"")}},setClassName:function(a,b,c){this.addRemoveClassName(a,b,c||!1)},hasClassName:function(a,b,c){if(a=Ink.i(a),!a||!b)return!1;b=(""+b).split(/[, ]+/);for(var d=0,e=b.length,f,g;e>d;d++){if("undefined"!=typeof a.classList)f=a.classList.contains(b[d]);else{var h=a.className;h===b[d]?f=!0:(g=new RegExp("(^|\\s)"+b[d]+"(\\s|$)"),f=g.test(h))}if(f&&!c)return!0;if(!f&&c)return!1}return c?!0:!1},blinkClass:function(a,c,d,e){a=Ink.i(a),b.addRemoveClassName(a,c,!e),setTimeout(function(){b.addRemoveClassName(a,c,e)},Number(d)||100)},toggleClassName:function(a,c,d){return a&&c&&"undefined"!=typeof a.classList&&!/[, ]/.test(c)?(a=Ink.i(a),null!==a&&a.classList.toggle(c),!0):void("undefined"!=typeof d?d===!0?b.addClassName(a,c):d===!1&&b.removeClassName(a,c):b.hasClassName(a,c)?b.removeClassName(a,c):b.addClassName(a,c))},setOpacity:function(a,b){if(a=Ink.i(a),null!==a){var c=1;isNaN(Number(b))||(c=0>=b?0:1>=b?b:100>=b?b/100:1),"undefined"!=typeof a.style.opacity?a.style.opacity=c:a.style.filter="alpha(opacity:"+(100*c|0)+")"}},_camelCase:function(a){return a?a.replace(/-(\w)/g,function(a,b){return b.toUpperCase()}):a},getStyle:function(b,c){if(b=Ink.i(b),null!==b&&b.style){c="float"===c?"cssFloat":this._camelCase(c);var d=b.style[c];if(!a||d&&"auto"!==d)!d&&b.currentStyle&&(d=b.currentStyle[c],"auto"!==d||"width"!==c&&"height"!==c||(d=b["offset"+c.charAt(0).toUpperCase()+c.slice(1)]+"px"));else{var e=a(b,null);d=e?e[c]:null}if("opacity"===c)return d?parseFloat(d,10):1;if("borderTopWidth"===c||"borderBottomWidth"===c||"borderRightWidth"===c||"borderLeftWidth"===c){if("thin"===d)return"1px";if("medium"===d)return"3px";if("thick"===d)return"5px"}return"auto"===d?null:d}},setStyle:function(a,b){if(a=Ink.i(a),null!==a)if("string"==typeof b)a.style.cssText+="; "+b,-1!==b.indexOf("opacity")&&this.setOpacity(a,b.match(/opacity:\s*(\d?\.?\d*)/)[1]);else for(var c in b)b.hasOwnProperty(c)&&("opacity"===c?this.setOpacity(a,b[c]):"float"===c||"cssFloat"===c?"undefined"==typeof a.style.styleFloat?a.style.cssFloat=b[c]:a.style.styleFloat=b[c]:a.style[c]=b[c])},show:function(a,b){a=Ink.i(a),null!==a&&(a.style.display=b?b:"")},hide:function(a){a=Ink.i(a),null!==a&&(a.style.display="none")},showHide:function(a,b){a=Ink.i(a),a&&(a.style.display=b?"":"none")},toggle:function(a,b){a=Ink.i(a),null!==a&&("undefined"!=typeof b?b===!0?this.show(a):this.hide(a):"none"===this.getStyle(a,"display").toLowerCase()?this.show(a):this.hide(a))},_getRefTag:function(a){if(a.firstElementChild)return a.firstElementChild;for(var b=a.firstChild;b;b=b.nextSibling)if(1===b.nodeType)return b;return null},appendStyleTag:function(a,b,c){c=Ink.extendObj({type:"text/css",force:!1},c||{});var d=document.getElementsByTagName("style"),e=!1,f=!0,g,h;for(g=0,h=d.length;h>g;g++)e=d[g].innerHTML,e.indexOf(a)>=0&&(f=!1);if(f){var i=document.createElement("style"),j=document.getElementsByTagName("head")[0],k=!1,l="";i.type=c.type,l+=a+" {",l+=b,l+="} ","undefined"!=typeof i.styleSheet?i.styleSheet.cssText=l:i.appendChild(document.createTextNode(l)),c.force?j.appendChild(i):(k=this._getRefTag(j),k&&j.insertBefore(i,k))}},appendStylesheet:function(a,b){b=Ink.extendObj({media:"screen",type:"text/css",force:!1},b||{});var c,d=document.createElement("link"),e=document.getElementsByTagName("head")[0];d.media=b.media,d.type=b.type,d.href=a,d.rel="Stylesheet",b.force?e.appendChild(d):(c=this._getRefTag(e),c&&e.insertBefore(d,c))},_loadingCSSFiles:{},_loadedCSSFiles:{},appendStylesheetCb:function(a,b){if(!a)return b(a);if(this._loadedCSSFiles[a])return b(a);var c=this._loadingCSSFiles[a];if(c)return c.push(b);this._loadingCSSFiles[a]=[b];var d=document.createElement("link");d.type="text/css",d.rel="stylesheet",d.href=a;var e=document.getElementsByTagName("head")[0];e.appendChild(d);var f=document.createElement("img");f.onerror=Ink.bindEvent(function(a,b){var c=b;this._loadedCSSFiles[c]=!0;for(var d=this._loadingCSSFiles[c],e=0,f=d.length;f>e;++e)d[e](c);delete this._loadingCSSFiles[c]},this,a),f.src=a},decToHex:function(a){var b=function(a){return 1===a.length&&(a="0"+a),a=a.toUpperCase()};if("object"==typeof a){var c=b(parseInt(a.r,10).toString(16)),d=b(parseInt(a.g,10).toString(16)),e=b(parseInt(a.b,10).toString(16));return c+d+e}a+="";var f=a.match(/\((\d+),\s?(\d+),\s?(\d+)\)/);return null!==f?b(parseInt(f[1],10).toString(16))+b(parseInt(f[2],10).toString(16))+b(parseInt(f[3],10).toString(16)):b(parseInt(a,10).toString(16))},hexToDec:function(a){return 0===a.indexOf("#")&&(a=a.substr(1)),6===a.length?{r:parseInt(a.substr(0,2),16),g:parseInt(a.substr(2,2),16),b:parseInt(a.substr(4,2),16)}:3===a.length?{r:parseInt(a.charAt(0)+a.charAt(0),16),g:parseInt(a.charAt(1)+a.charAt(1),16),b:parseInt(a.charAt(2)+a.charAt(2),16)}:a.length<=2?parseInt(a,16):void 0},getPropertyFromStylesheet:function(a,b){var c=this.getRuleFromStylesheet(a);return c?c.style[b]:null},getPropertyFromStylesheet2:function(a,b){for(var c=this.getRulesFromStylesheet(a),d,e=0,f=c.length;f>e;e++)if(d=c[e].style[b],null!==d&&void 0!==d)return d;return null},getRuleFromStylesheet:function(a){var b,c,d,e,f,g=document.styleSheets;if(!g)return null;for(var h=0,i=document.styleSheets.length;i>h;++h){if(b=document.styleSheets[h],c=b.rules?b.rules:b.cssRules,!c)return null;for(d=0,e=c.length;e>d;++d)if(f=c[d],f.selectorText&&f.selectorText===a)return f}return null},getRulesFromStylesheet:function(a){var b=[],c,d,e,f,g,h=document.styleSheets;if(!h)return b;for(var i=0,j=document.styleSheets.length;j>i;++i){if(c=document.styleSheets[i],d=c.rules?c.rules:c.cssRules,!d)return null;for(e=0,f=d.length;f>e;++e)g=d[e],g.selectorText&&g.selectorText===a&&b.push(g)}return b},getPropertiesFromRule:function(a){var b=this.getRuleFromStylesheet(a),c={},d,e,f;b=b.style.cssText;var g=b.split(";"),h,i,j,k;for(e=0,f=g.length;f>e;++e)" "===g[e].charAt(0)&&(g[e]=g[e].substring(1)),h=g[e].split(":"),d=this._camelCase(h[0].toLowerCase()),i=h[1],i&&(i=i.substring(1),"padding"===d||"margin"===d||"borderWidth"===d?("borderWidth"===d?(j="border",k="Width"):(j=d,k=""),-1!==i.indexOf(" ")?(i=i.split(" "),c[j+"Top"+k]=i[0],c[j+"Bottom"+k]=i[0],c[j+"Left"+k]=i[1],c[j+"Right"+k]=i[1]):(c[j+"Top"+k]=i,c[j+"Bottom"+k]=i,c[j+"Left"+k]=i,c[j+"Right"+k]=i)):"borderRadius"===d?-1!==i.indexOf(" ")?(i=i.split(" "),c.borderTopLeftRadius=i[0],c.borderBottomRightRadius=i[0],c.borderTopRightRadius=i[1],c.borderBottomLeftRadius=i[1]):(c.borderTopLeftRadius=i,c.borderTopRightRadius=i,c.borderBottomLeftRadius=i,c.borderBottomRightRadius=i):c[d]=i);return c},changeFontSize:function(a,b,c,d,e){var f=this;Ink.requireModules(["Ink.Dom.Selector_1"],function(g){var h;if("string"!=typeof a?h="1st argument must be a CSS selector rule.":"number"!=typeof b?h="2nd argument must be a number.":void 0!==c&&"+"!==c&&"*"!==c?h='3rd argument must be one of "+", "*".':void 0!==d&&("number"!=typeof d||0>=d)?h="4th argument must be a positive number.":void 0!==e&&("number"!=typeof e||e>e)&&(h="5th argument must be a positive number greater than minValue."),h)throw new TypeError(h);var i,j,k=g.select(a);void 0===d&&(d=1),c="*"===c?function(a,b){return a*b}:function(a,b){return a+b};for(var l=0,m=k.length;m>l;++l)j=k[l],i=parseFloat(f.getStyle(j,"fontSize")),i=c(i,b),d>i||"number"==typeof e&&i>e||(j.style.fontSize=i+"px")})}};return b}),Ink.createModule("Ink.Dom.Element",1,[],function(){"use strict";function a(a){var b={};try{b=a.getBoundingClientRect()}catch(c){b={top:a.offsetTop,left:a.offsetLeft}}return b}var b="function"==typeof document.createRange&&"function"==typeof window.Range.prototype.createContextualFragment,c="Ink.Dom.Element tbody: "+Math.random(),d=function(){var a=document.createElement("div");return a.innerHTML="",0!==a.getElementsByTagName("tbody").length}(),e={isDOMElement:function(a){return null!==a&&"object"==typeof a&&"nodeType"in a&&1===a.nodeType},get:function(a){return"undefined"!=typeof a?"string"==typeof a?document.getElementById(a):a:null},create:function(a,b){var c=document.createElement(a);for(var d in b)b.hasOwnProperty(d)&&(d in e?e[d](c,b[d]):"className"===d||"class"===d?c.className=b.className||b["class"]:c.setAttribute(d,b[d]));return c},remove:function(a){a=Ink.i(a);var b;a&&(b=a.parentNode)&&b.removeChild(a)},scrollTo:function(a){if(a=e.get(a)){if(a.scrollIntoView)return a.scrollIntoView();var b={},c=0,d=0;do c+=a.offsetTop||0,d+=a.offsetLeft||0,a=a.offsetParent;while(a);b={x:d,y:c},window.scrollTo(b.x,b.y)}},offsetTop:function(a){return e.offset(a)[1]},offsetLeft:function(a){return e.offset(a)[0]},positionedOffset:function(a){var b=0,c=0;a=e.get(a);do if(b+=a.offsetTop||0,c+=a.offsetLeft||0,a=a.offsetParent){if("body"===a.tagName.toLowerCase())break;var d=a.style.position;if(!d&&a.currentStyle&&(d=a.currentStyle.position),(!d||"auto"===d)&&"undefined"!=typeof getComputedStyle){var f=getComputedStyle(a,null);d=f?f.position:null}if("relative"===d||"absolute"===d)break}while(a);return[c,b]},offset:function(b){b=Ink.i(b);var c=[0,0],d=b.ownerDocument,e=d.documentElement,f=a(b),g=d.body,h=e.clientTop||g.clientTop||0,i=e.clientLeft||g.clientLeft||0,j=d.pageYOffset||e.scrollTop||g.scrollTop,k=d.pageXOffset||e.scrollLeft||g.scrollLeft,l=f.top+j-h,m=f.left+k-i;return c=[m,l]},scroll:function(a){return a=a?Ink.i(a):document.body,[window.pageXOffset?window.pageXOffset:a.scrollLeft,window.pageYOffset?window.pageYOffset:a.scrollTop]},_getPropPx:function(a,b){var c,d,e=a.getPropertyValue?a.getPropertyValue(b):a[b];return e?(d=e.indexOf("px"),c=-1===d?0:parseFloat(e,10)):c=0,c},offset2:function(a){return e.offset(a)},hasAttribute:function(a,b){return a=Ink.i(a),a.hasAttribute?a.hasAttribute(b):!!a.getAttribute(b)},insertAfter:function(a,b){(b=e.get(b))&&(null!==b.nextSibling?b.parentNode.insertBefore(a,b.nextSibling):b.parentNode.appendChild(a))},insertBefore:function(a,b){(b=e.get(b))&&b.parentNode.insertBefore(a,b)},insertTop:function(a,b){(b=e.get(b))&&(b.firstChild?b.insertBefore(a,b.firstChild):b.appendChild(a))},insertBottom:function(a,b){b=Ink.i(b),b.appendChild(a)},textContent:function(a){a=Ink.i(a);var b,c,d,f;switch(a&&a.nodeType){case 9:return e.textContent(a.documentElement||a.body&&a.body.parentNode||a.body);case 1:if(b=a.innerText,"undefined"!=typeof b)return b;case 11:if(b=a.textContent,"undefined"!=typeof b)return b;if(a.firstChild===a.lastChild)return e.textContent(a.firstChild);for(b=[],d=a.childNodes,c=0,f=d.length;f>c;++c)b.push(e.textContent(d[c]));return b.join("");case 3:case 4:return a.nodeValue}return""},setTextContent:function(a,b){switch(a=Ink.i(a),a&&a.nodeType){case 1:if("innerText"in a){a.innerText=b;break}case 11:if("textContent"in a){a.textContent=b;break}case 9:for(;a.firstChild;)a.removeChild(a.firstChild);if(""!==b){var c=a.ownerDocument||a;a.appendChild(c.createTextNode(b))}break;case 3:case 4:a.nodeValue=b}},isLink:function(a){var b=a&&1===a.nodeType&&(/^a|area$/i.test(a.tagName)||a.hasAttributeNS&&a.hasAttributeNS("http://www.w3.org/1999/xlink","href"));return!!b},isAncestorOf:function(a,b){if(!b||!a)return!1;if(b.compareDocumentPosition)return 0!==(16&a.compareDocumentPosition(b));for(;b=b.parentNode;)if(b===a)return!0;return!1},descendantOf:function(a,b){return a!==b&&e.isAncestorOf(a,b)},firstElementChild:function(a){if(!a)return null;if("firstElementChild"in a)return a.firstElementChild;for(var b=a.firstChild;b&&1!==b.nodeType;)b=b.nextSibling;return b},lastElementChild:function(a){if(!a)return null;if("lastElementChild"in a)return a.lastElementChild;for(var b=a.lastChild;b&&1!==b.nodeType;)b=b.previousSibling;return b},nextElementSibling:function(a){var b=null;if(!a)return b;if("nextElementSibling"in a)return a.nextElementSibling;for(b=a.nextSibling;b&&1!==b.nodeType;)b=b.nextSibling;return b},previousElementSibling:function(a){var b=null;if(!a)return b;if("previousElementSibling"in a)return a.previousElementSibling;for(b=a.previousSibling;b&&1!==b.nodeType;)b=b.previousSibling;return b},elementWidth:function(a){return"string"==typeof a&&(a=document.getElementById(a)),a.offsetWidth},elementHeight:function(a){return"string"==typeof a&&(a=document.getElementById(a)),a.offsetHeight},elementLeft:function(a){return e.offsetLeft(a)},elementTop:function(a){return e.offsetTop(a)},elementDimensions:function(a){return a=Ink.i(a),[a.offsetWidth,a.offsetHeight]},outerDimensions:function(b){var c=a(b),d=Ink.getModule("Ink.Dom.Css_1"),e=Ink.bindMethod(d,"getStyle",b);return[c.right-c.left+parseFloat(e("marginLeft")||0)+parseFloat(e("marginRight")||0),c.bottom-c.top+parseFloat(e("marginTop")||0)+parseFloat(e("marginBottom")||0)] +},inViewport:function(b,c){var d=a(Ink.i(b));return"boolean"==typeof c&&(c={partial:c,margin:0}),c=Ink.extendObj({partial:!1,margin:0},c||{}),c.partial?d.bottom+c.margin>0&&d.left-c.margin0:d.top+c.margin>0&&d.right-c.margin0},isHidden:function(a){var b=a.offsetWidth,c=a.offsetHeight,d="tr"===a.tagName.toLowerCase(),e=Ink.getModule("Ink.Dom.Css_1");return 0!==b||0!==c||d?0===b||0===c||d?"none"===e.getStyle(a,"display").toLowerCase():!1:!0},isVisible:function(a){return!this.isHidden(a)},clonePosition:function(a,b){var c=e.offset(b);return a.style.left=c[0]+"px",a.style.top=c[1]+"px",a},ellipsizeText:function(a){(a=Ink.i(a))&&(a.style.overflow="hidden",a.style.whiteSpace="nowrap",a.style.textOverflow="ellipsis")},findUpwardsHaving:function(a,b){for(;a&&1===a.nodeType;){if(b(a))return a;a=a.parentNode}return!1},findUpwardsByClass:function(a,b){var c=new RegExp("(^|\\s)"+b+"(\\s|$)"),d=function(a){var b=a.className;return b&&c.test(b)};return e.findUpwardsHaving(a,d)},findUpwardsByTag:function(a,b){b=b.toUpperCase();var c=function(a){return a.nodeName&&a.nodeName.toUpperCase()===b};return e.findUpwardsHaving(a,c)},findUpwardsById:function(a,b){var c=function(a){return a.id===b};return e.findUpwardsHaving(a,c)},findUpwardsBySelector:function(a,b){var c=Ink.getModule("Ink.Dom.Selector","1");if(!c)throw new Error("This method requires Ink.Dom.Selector");var d=function(a){return c.matchesSelector(a,b)};return e.findUpwardsHaving(a,d)},getChildrenText:function(a,b){var c,d,f,g=a.childNodes,h=g.length,i="";if(!a)return i;for(d=0;h>d;++d)c=g[d],c&&3===c.nodeType&&(f=e._trimString(String(c.data)),f.length>0?(i+=f,b&&a.removeChild(c)):a.removeChild(c));return i},_trimString:function(a){return String.prototype.trim?a.trim():a.replace(/^\s*/,"").replace(/\s*$/,"")},getSelectValues:function(a){for(var b=Ink.i(a),c=[],d=0;dd;++d)b=a[d],b instanceof Array?1===b.length&&b.push(b[0]):b=[b,b],c.push(b);return c},fillSelect:function(a,b,c,d){var f=Ink.i(a);if(f){f.innerHTML="";var g,h;c||(h=document.createElement("option"),h.setAttribute("value",""),f.appendChild(h)),b=e._normalizeData(b);for(var i=0,j=b.length;j>i;++i)g=b[i],h=document.createElement("option"),h.setAttribute("value",g[0]),g.length>2&&h.setAttribute("extra",g[2]),h.appendChild(document.createTextNode(g[1])),g[0]===d&&h.setAttribute("selected","selected"),f.appendChild(h)}},fillRadios:function(a,b,c,d,f,g){a=Ink.i(a);var h=document.createElement("span");e.insertAfter(h,a),c=e._normalizeData(c);var i,j;d||(j=document.createElement("input"),j.setAttribute("type","radio"),j.setAttribute("name",b),j.setAttribute("value",""),h.appendChild(j),g&&h.appendChild(document.createElement(g)));for(var k=0;ke;++e)if(c=a.childNodes[e],1===c.nodeType){if(c===b)return d;++d}return-1},nextSiblings:function(a){if(a=Ink.i(a),"object"==typeof a&&null!==a&&a.nodeType&&1===a.nodeType){for(var b=[],c=a.parentNode.children,d=e.parentIndexOf(a.parentNode,a),f=++d,g=c.length;g>f;f++)b.push(c[f]);return b}return[]},previousSiblings:function(a){if(a=Ink.i(a),"object"==typeof a&&null!==a&&a.nodeType&&1===a.nodeType){for(var b=[],c=a.parentNode.children,d=e.parentIndexOf(a.parentNode,a),f=0,g=d;g>f;f++)b.push(c[f]);return b}return[]},siblings:function(a){if(a=Ink.i(a),"object"==typeof a&&null!==a&&a.nodeType&&1===a.nodeType){for(var b=[],c=a.parentNode.children,d=0,e=c.length;e>d;d++)a!==c[d]&&b.push(c[d]);return b}return[]},childElementCount:function(a){return a=Ink.i(a),"childElementCount"in a?a.childElementCount:a?e.siblings(a).length+1:0},_wrapElements:{TABLE:function(a,b){return a.innerHTML=d?"
            "+b+"
            "+c+"
            ":""+b+"
            ",a.firstChild},TBODY:function(a,b){return a.innerHTML=""+b+"
            ",a.firstChild.getElementsByTagName("tbody")[0]},THEAD:function(a,b){return a.innerHTML=""+b+"
            ",a.firstChild.getElementsByTagName("thead")[0]},TFOOT:function(a,b){return a.innerHTML=""+b+"
            ",a.firstChild.getElementsByTagName("tfoot")[0]},TR:function(a,b){return a.innerHTML=""+b+"
            ",a.firstChild.firstChild.firstChild}},_getWrapper:function(a,b){var f=a.nodeName&&a.nodeName.toUpperCase(),g=document.createElement("div"),h=e._wrapElements[f];if(!h)return g.innerHTML=b,g;if(g=h(g,b),d&&"TABLE"===f)for(var i=g.getElementsByTagName("td"),j=0,k=i.length;k>j;j++)if(i[j].innerHTML===c){var l=i[j].parentNode.parentNode;l.parentNode.removeChild(l)}return g},appendHTML:function(a,b){if(a=Ink.i(a),null!==a)for(var c=e._getWrapper(a,b);c.firstChild;)a.appendChild(c.firstChild)},prependHTML:function(a,b){if(a=Ink.i(a),null!==a)for(var c=e._getWrapper(a,b);c.lastChild;)a.insertBefore(c.lastChild,a.firstChild)},setHTML:function(a,b){if(a=Ink.i(a),null!==a)try{a.innerHTML=b}catch(c){for(;a.firstChild;)a.removeChild(a.firstChild);e.appendHTML(a,b)}},wrap:function(a,b){a=Ink.i(a),b=Ink.i(b);var c=a.nextSibling,d=a.parentNode;return b.appendChild(a),null!==c?d.insertBefore(b,c):d.appendChild(b),b},unwrap:function(a,b){a=Ink.i(a);var c;c="string"==typeof b?e.findUpwardsBySelector(a,b):"object"==typeof b&&b.tagName?e.findUpwardsHaving(a,function(a){return a===b}):a.parentNode,c&&c.parentNode&&e.insertBefore(a,c)},replace:function(a,b){a=Ink.i(a),null!==a&&a.parentNode.replaceChild(b,a)},removeTextNodeChildren:function(a){if(a=Ink.i(a),null!==a){var b,c,d=a;for(a=a.firstChild;a;)c=3===a.nodeType,b=a,a=a.nextSibling,c&&d.removeChild(b)}},htmlToFragment:b?function(a){var b;return"string"!=typeof a?document.createDocumentFragment():(b=document.createRange(),b.selectNode(document.body),b.createContextualFragment(a))}:function(a){var b=document.createDocumentFragment(),c,d;if("string"!=typeof a)return b;for(c=document.createElement("div"),c.innerHTML=a;d=c.firstChild;)b.appendChild(d);return b},_camelCase:function(a){return a?a.replace(/-(\w)/g,function(a,b){return b.toUpperCase()}):a},data:function(a){var b;if("object"!=typeof a&&"string"!=typeof a)throw"[Ink.Dom.Element.data] :: Invalid selector defined";if("object"==typeof a)b=a;else{var c=Ink.getModule("Ink.Dom.Selector",1);if(!c)throw"[Ink.Dom.Element.data] :: this method requires Ink.Dom.Selector - v1";if(b=c.select(a),b.length<=0)throw"[Ink.Dom.Element.data] :: Can't find any element with the specified selector";b=b[0]}var d={},f=b.attributes||[],g,h,i;if(f)for(var j=0,k=f.length;k>j;++j)g=f[j],h=g.name,i=g.value,h&&0===h.indexOf("data-")&&(d[e._camelCase(h.replace("data-",""))]=i);return d},moveCursorTo:function(a,b){if(a=Ink.i(a),null!==a)if(a.setSelectionRange)a.setSelectionRange(b,b);else{var c=a.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",b),c.select()}},pageWidth:function(){var a;a=window.innerWidth&&window.scrollMaxX?window.innerWidth+window.scrollMaxX:document.body.scrollWidth>document.body.offsetWidth?document.body.scrollWidth:document.body.offsetWidth;var b;return window.self.innerWidth?b=document.documentElement.clientWidth?document.documentElement.clientWidth:window.self.innerWidth:document.documentElement&&document.documentElement.clientWidth?b=document.documentElement.clientWidth:document.body&&(b=document.body.clientWidth),b>a?a:b},pageHeight:function(){var a;a=window.innerHeight&&window.scrollMaxY?window.innerHeight+window.scrollMaxY:document.body.scrollHeight>document.body.offsetHeight?document.body.scrollHeight:document.body.offsetHeight;var b;return window.self.innerHeight?b=window.self.innerHeight:document.documentElement&&document.documentElement.clientHeight?b=document.documentElement.clientHeight:document.body&&(b=document.body.clientHeight),b>a?b:a},viewportWidth:function(){return"undefined"!=typeof window.innerWidth?window.innerWidth:document.documentElement&&"undefined"!=typeof document.documentElement.offsetWidth?document.documentElement.offsetWidth:void 0},viewportHeight:function(){return"undefined"!=typeof window.innerHeight?window.innerHeight:document.documentElement&&"undefined"!=typeof document.documentElement.offsetHeight?document.documentElement.offsetHeight:void 0},scrollWidth:function(){return"undefined"!=typeof window.self.pageXOffset?window.self.pageXOffset:"undefined"!=typeof document.documentElement&&"undefined"!=typeof document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft},scrollHeight:function(){return"undefined"!=typeof window.self.pageYOffset?window.self.pageYOffset:"undefined"!=typeof document.documentElement&&"undefined"!=typeof document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop}};return e}),Ink.createModule("Ink.Dom.Event",1,[],function(){var a=function(a,b,c){return c()}("bean",this,function(a,b){a=a||"bean",b=b||this;var c=window,d=b[a],e=/[^\.]*(?=\..*)\.|.*/,f=/\..*/,g="addEventListener",h="removeEventListener",i=document||{},j=i.documentElement||{},k=j[g],l=k?g:"attachEvent",m={},n=Array.prototype.slice,o=function(a,b){return a.split(b||" ")},p=function(a){return"string"==typeof a},q=function(a){return"function"==typeof a},r="click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll ",s="show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinputreadystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ",t=function(a,b,c){for(c=0;cg;g++)if(m[g].reg.test(e)){n[e]=k=m[g].fix;break}for(j=k(a,this,e),g=j.length;g--;)!((i=j[g])in this)&&i in a&&(this[i]=a[i])}}};return p.prototype.preventDefault=function(){this.originalEvent.preventDefault?this.originalEvent.preventDefault():this.originalEvent.returnValue=!1},p.prototype.stopPropagation=function(){this.originalEvent.stopPropagation?this.originalEvent.stopPropagation():this.originalEvent.cancelBubble=!0},p.prototype.stop=function(){this.preventDefault(),this.stopPropagation(),this.stopped=!0},p.prototype.stopImmediatePropagation=function(){this.originalEvent.stopImmediatePropagation&&this.originalEvent.stopImmediatePropagation(),this.isImmediatePropagationStopped=function(){return!0}},p.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()},p.prototype.clone=function(a){var b=new p(this,this.element,this.isNative);return b.currentTarget=a,b},p}(),w=function(a,b){return k||b||a!==i&&a!==c?a:j},x=function(){var a=function(a,b,c,d){var e=function(c,e){return b.apply(a,d?n.call(e,c?0:1).concat(d):e)},f=function(c,d){return b.__beanDel?b.__beanDel.ft(c.target,a):d},g=c?function(a){var b=f(a,this);return c.apply(b,arguments)?(a&&(a.currentTarget=b),e(a,arguments)):void 0}:function(a){return b.__beanDel&&(a=a.clone(f(a))),e(a,arguments)};return g.__beanDel=b.__beanDel,g},b=function(b,c,d,e,f,g,h){var i=u[c],j;"unload"==c&&(d=D(E,b,c,d,e)),i&&(i.condition&&(d=a(b,d,i.condition,g)),c=i.base||c),this.isNative=j=t[c]&&!!b[l],this.customType=!k&&!j&&c,this.element=b,this.type=c,this.original=e,this.namespaces=f,this.eventType=k||j?c:"propertychange",this.target=w(b,j),this[l]=!!this.target[l],this.root=h,this.handler=a(b,d,null,g)};return b.prototype.inNamespaces=function(a){var b,c,d=0;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)a[b]==this.namespaces[c]&&d++;return a.length===d},b.prototype.matches=function(a,b,c){return!(this.element!==a||b&&this.original!==b||c&&this.handler!==c)},b}(),y=function(){var a={},b=function(c,d,e,f,g,h){var i=g?"r":"$";if(d&&"*"!=d){var j=0,k,l=a[i+d],m="*"==c;if(!l)return;for(k=l.length;k>j;j++)if((m||l[j].matches(c,e,f))&&!h(l[j],l,j,d))return}else for(var n in a)n.charAt(0)==i&&b(c,n.substr(1),e,f,g,h)},c=function(b,c,d,e){var f,g=a[(e?"r":"$")+c];if(g)for(f=g.length;f--;)if(!g[f].root&&g[f].matches(b,d,null))return!0;return!1},d=function(a,c,d,e){var f=[];return b(a,c,d,null,e,function(a){return f.push(a)}),f},e=function(b){var c=!b.root&&!this.has(b.element,b.type,null,!1),d=(b.root?"r":"$")+b.type;return(a[d]||(a[d]=[])).push(b),c},f=function(c){b(c.element,c.type,null,c.handler,c.root,function(b,c,d){return c.splice(d,1),b.removed=!0,0===c.length&&delete a[(b.root?"r":"$")+b.type],!1})},g=function(){var b,c=[];for(b in a)"$"==b.charAt(0)&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),z,A=function(a){z=arguments.length?a:i.querySelectorAll?function(a,b){return b.querySelectorAll(a)}:function(){throw new Error("Bean: No selector engine installed")}},B=function(a,b){if(k||!b||!a||a.propertyName=="_on"+b){var c=y.get(this,b||a.type,null,!1),d=c.length,e=0;for(a=new v(a,this,!0),b&&(a.type=b);d>e&&!a.isImmediatePropagationStopped();e++)c[e].removed||c[e].handler.call(this,a)}},C=k?function(a,b,c){a[c?g:h](b,B,!1)}:function(a,b,c,d){var e;c?(y.put(e=new x(a,d||b,function(b){B.call(a,b,d)},B,null,null,!0)),d&&null==a["_on"+d]&&(a["_on"+d]=0),e.target.attachEvent("on"+e.eventType,e.handler)):(e=y.get(a,d||b,B,!0)[0],e&&(e.target.detachEvent("on"+e.eventType,e.handler),y.del(e)))},D=function(a,b,c,d,e){return function(){d.apply(this,arguments),a(b,c,e)}},E=function(a,b,c,d){var e=b&&b.replace(f,""),g=y.get(a,e,null,!1),h={},i,j;for(i=0,j=g.length;j>i;i++)c&&g[i].original!==c||!g[i].inNamespaces(d)||(y.del(g[i]),!h[g[i].eventType]&&g[i][l]&&(h[g[i].eventType]={t:g[i].eventType,c:g[i].type}));for(i in h)y.has(a,h[i].t,null,!1)||C(a,h[i].t,!1,h[i].c)},F=function(a,b){var c=function(b,c){for(var d,e=p(a)?z(a,c):a;b&&b!==c;b=b.parentNode)for(d=e.length;d--;)if(e[d]===b)return b},d=function(a){var d=c(a.target,this);d&&b.apply(d,arguments)};return d.__beanDel={ft:c,selector:a},d},G=k?function(a,b,d){var e=i.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=w(c,a),a?c.fireEvent("on"+b,i.createEventObject()):c["_on"+b]++},H=function(a,b,c){var d=p(b),g,h,i,j;if(d&&b.indexOf(" ")>0){for(b=o(b),j=b.length;j--;)H(a,b[j],c);return a}if(h=d&&b.replace(f,""),h&&u[h]&&(h=u[h].base),!b||d)(i=d&&b.replace(e,""))&&(i=o(i,".")),E(a,h,c,i);else if(q(b))E(a,null,b);else for(g in b)b.hasOwnProperty(g)&&H(a,g,b[g]);return a},I=function(a,b,c,d){var g,h,i,j,k,p,r;{if(void 0!==c||"object"!=typeof b){for(q(c)?(k=n.call(arguments,3),d=g=c):(g=d,k=n.call(arguments,4),d=F(c,g,z)),i=o(b),this===m&&(d=D(H,a,b,d,g)),j=i.length;j--;)r=y.put(p=new x(a,i[j].replace(f,""),d,g,o(i[j].replace(e,""),"."),k,!1)),p[l]&&r&&C(a,p.eventType,!0,p.customType);return a}for(h in b)b.hasOwnProperty(h)&&I.call(this,a,h,b[h])}},J=function(a,b,c,d){return I.apply(null,p(c)?[a,c,b,d].concat(arguments.length>3?n.call(arguments,5):[]):n.call(arguments))},K=function(){return I.apply(m,arguments)},L=function(a,b,c){var d=o(b),g,h,i,j,k;for(g=d.length;g--;)if(b=d[g].replace(f,""),(j=d[g].replace(e,""))&&(j=o(j,".")),j||c||!a[l])for(k=y.get(a,b,null,!1),c=[!1].concat(c),h=0,i=k.length;i>h;h++)k[h].inNamespaces(j)&&k[h].handler.apply(a,c);else G(t[b],b,a);return a},M=function(a,b,c){for(var d=y.get(b,c,null,!1),e=d.length,f=0,g,h;e>f;f++)d[f].original&&(g=[a,d[f].type],(h=d[f].handler.__beanDel)&&g.push(h.selector),g.push(d[f].original),I.apply(null,g));return a},N={on:I,add:J,one:K,off:H,remove:H,clone:M,fire:L,Event:v,setSelectorEngine:A,noConflict:function(){return b[a]=d,this}};if(c.attachEvent){var O=function(){var a,b=y.entries();for(a in b)b[a].type&&"unload"!==b[a].type&&H(b[a].element,b[a].type);c.detachEvent("onunload",O),c.CollectGarbage&&c.CollectGarbage()};c.attachEvent("onunload",O)}return A(Ink.ss),N}),b={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_SPACE:32,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,throttle:function(a,b){b=b||0;var c=0,d,e=function(){var f=+new Date,g=f-c;if(g>=b)return c=f,a.apply(this,[].slice.call(arguments));var h=this,i=[].slice.call(arguments);d||(d=setTimeout(function(){return d=null,e.apply(h,i)},b-g))};return e},element:function(a){var b=a.delegationTarget||a.target||"mouseout"===a.type&&a.fromElement||"mouseleave"===a.type&&a.fromElement||"mouseover"===a.type&&a.toElement||"mouseenter"===a.type&&a.toElement||a.srcElement||null;return!b||3!==b.nodeType&&4!==b.nodeType?b:b.parentNode},relatedTarget:function(a){var b=a.relatedTarget||"mouseout"===a.type&&a.toElement||"mouseleave"===a.type&&a.toElement||"mouseover"===a.type&&a.fromElement||"mouseenter"===a.type&&a.fromElement||null;return!b||3!==b.nodeType&&4!==b.nodeType?b:b.parentNode},findElement:function(a,b,c){for(var d=this.element(a);;){if(d.nodeName.toLowerCase()===b.toLowerCase())return d;if(d=d.parentNode,!d)return c?!1:document;if(!d.parentNode)return c?!1:document}},observe:function(a,b,c,d){return a=Ink.i(a),a?(a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent("on"+b,c=Ink.bind(c,a)),c):void 0},observeOnce:function(a,c,d,e){var f=function(){return b.stopObserving(a,c,f),d()};return b.observe(a,c,f,e)},observeMulti:function(a,b,c,d){if("string"==typeof a?a=Ink.ss(a):a&&1===a.nodeType&&(a=[a]),!a[0])return!1;for(var e=0,f=a.length;f>e;e++)this.observe(a[e],b,c,d);return c},observeDelegated:function(a,c,d,e){return b.observe(a,c,function(c){var f=b.element(c);if(f&&f!==a)for(var g=f;g!==a&&g!==document&&g;){if(Ink.Dom.Selector_1.matchesSelector(g,d))return c.delegationTarget=g,e(c);g=g.parentNode}})},stopObserving:function(a,b,c,d){a=Ink.i(a),a&&(a.removeEventListener?a.removeEventListener(b,c,!!d):a.detachEvent("on"+b,c))},stop:function(a){null!==a.cancelBubble&&(a.cancelBubble=!0),a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),window.attachEvent&&(a.returnValue=!1),null!==a.cancel&&(a.cancel=!0)},stopPropagation:function(a){null!==a.cancelBubble&&(a.cancelBubble=!0),a.stopPropagation&&a.stopPropagation()},stopDefault:function(a){a.preventDefault&&a.preventDefault(),window.attachEvent&&(a.returnValue=!1),null!==a.cancel&&(a.cancel=!0)},pointer:function(a){return{x:this.pointerX(a),y:this.pointerY(a)}},pointerX:function(a){return a.touches&&a.touches[0]&&a.touches[0].clientX||a.pageX||a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)},pointerY:function(a){return a.touches&&a.touches[0]&&a.touches[0].clientY||a.pageY||a.clientY+(document.documentElement.scrollTop||document.body.scrollTop)},isLeftClick:function(a){if(window.addEventListener){if(0===a.button)return!0;if("touchend"===a.type&&null===a.button)return!0}else if(1===a.button)return!0;return!1},isRightClick:function(a){return 2===a.button},isMiddleClick:function(a){return window.addEventListener?1===a.button:4===a.button;return!1},getCharFromKeyboardEvent:function(a,b){var c=a.keyCode,d=String.fromCharCode(c),e=a.shiftKey;if(c>=65&&90>=c)return"boolean"==typeof b&&(e=b),e?d:d.toLowerCase();if(c>=96&&105>=c)return String.fromCharCode(48+(c-96));switch(c){case 109:case 189:return"-";case 107:case 187:return"+"}return d},debug:function(){}};return Ink.extendObj(b,a)}),Ink.createModule("Ink.Dom.FormSerialize",1,["Ink.Util.Array_1","Ink.Dom.Element_1","Ink.Dom.Selector_1"],function(a,b,c){"use strict";function d(c){return null!=c&&!b.isDOMElement(c)&&(a.isArray(c)||"string"!=typeof c&&"number"==typeof c.length)}function e(a){return d(a)?a:[a]}var f={serialize:function(b){var c={},d={},e=this.asPairs(b,{elements:!0,emptyArray:d});return null==e?e:(a.forEach(e,function(a){var b=a[0].replace(/\[\]$/,""),e=a[1],g=a[2];e===d?c[b]=[]:f._resultsInArray(g)||/\[\]$/.test(a[0])?(c[b]=c[b]||[],c[b].push(e)):c[b]=e}),c)},asPairs:function(b,d){function e(a,b,c){h.push(d.elements?[a,b,c]:[a,b])}function g(b){if("select"===b.nodeName.toLowerCase()&&b.multiple){var f=!1;a.forEach(c.select("option:checked",b),function(a){e(b.name,a.value,b),f=!0}),!f&&"emptyArray"in d&&e(b.name,d.emptyArray,b)}else e(b.name,b.value,b)}var h=[];if(d=d||{},b=Ink.i(b)){for(var i=a.filter(b.elements,f._isSerialized),j=0,k=i.length;k>j;j++)g(i[j]);return h}return null},fillIn:function(a,b){if(!(a=Ink.i(a)))return null;var c;if("object"!=typeof b||d(b)){if(!d(b))return null;c=b}else c=f._objToPairs(b);return f._fillInPairs(a,c)},_objToPairs:function(a){var b=[],c;for(var d in a)if(a.hasOwnProperty(d)){c=e(a[d]);for(var f=0,g=c.length;g>f;f++)b.push([d,c[f]]);0===g&&b.push([d,[]])}return b},_fillInPairs:function(b,c){c=a.groupBy(c,{key:function(a){return a[0].replace(/\[\]$/,"")}}),c=a.map(c,function(b){var c=a.reduce(b,function(a,b){return[null,a[1].concat([b[1]])]},[null,[]])[1];return[b[0][0],c]});for(var d,g,h,i=0,j=c.length;j>i;i++){if(d=c[i][0],d in b)g=b[d];else{if(!(d+"[]"in b))continue;g=b[d+"[]"],d+="[]"}g=e(g),h=c[i][1],f._fillInOne(d,g,h)}},_fillInOne:function(a,c,d){var e=c[0],g=e.nodeName.toLowerCase(),h=e.getAttribute("type");h=h&&h.toLowerCase();var i="select"===g&&b.hasAttribute(e,"multiple");if("checkbox"===h||"radio"===h)f._fillInBoolean(c,d,"checked");else if(i)f._fillInBoolean(c[0].options,d,"selected");else{c.length!==d.length&&Ink.warn("Form had "+c.length+' inputs named "'+a+'", but received '+d.length+" values.");for(var j=0,k=Math.min(c.length,d.length);k>j;j+=1)c[j].value=d[j]}},_fillInBoolean:function(b,c,d){a.forEach(b,function(b){var e=a.inArray(b.value,c);b[d]=e})},_resultsInArray:function(a){var c=a.getAttribute("type"),d=a.nodeName.toLowerCase();return"checkbox"===c||"select"===d&&b.hasAttribute(a,"multiple")},_isSerialized:function(a){if(!b.isDOMElement(a))return!1;if(!b.hasAttribute(a,"name"))return!1;var c=a.nodeName.toLowerCase();return c&&"fieldset"!==c?"checkbox"===a.type||"radio"===a.type?!!a.checked:!0:!1}};return f}),Ink.createModule("Ink.Dom.Loaded",1,[],function(){"use strict";var a={_contexts:[],run:function(a,b){b||(b=a,a=window);for(var c,d=0,e=this._contexts.length;e>d;d++)if(this._contexts[d][0]===a){c=this._contexts[d][1];break}c||(c={cbQueue:[],win:a,doc:a.document,root:a.document.documentElement,done:!1,top:!0},c.handlers={checkState:Ink.bindEvent(this._checkState,this,c),poll:Ink.bind(this._poll,this,c)},this._contexts.push([a,c]));var f=c.doc.addEventListener;c.add=f?"addEventListener":"attachEvent",c.rem=f?"removeEventListener":"detachEvent",c.pre=f?"":"on",c.det=f?"DOMContentLoaded":"onreadystatechange",c.wet=c.pre+"load";var g=c.handlers.checkState,h=/complete|interactive|loaded/.test(c.doc.readyState)&&"about:blank"!==c.win.location.toString();if(h)setTimeout(Ink.bind(function(){b.call(c.win,"lazy")},this),0);else{c.cbQueue.push(b),c.doc[c.add](c.det,g),c.win[c.add](c.wet,g);var i=1;try{i=c.win.frameElement}catch(j){}if(!f&&c.root&&c.root.doScroll){try{c.top=!i}catch(j){}c.top&&this._poll(c)}}},_checkState:function(a,b){if(a&&("readystatechange"!==a.type||"complete"===b.doc.readyState)){var c="load"===a.type?b.win:b.doc;c[b.rem](b.pre+a.type,b.handlers.checkState,!1),this._ready(b)}},_poll:function(a){try{a.root.doScroll("left")}catch(b){return setTimeout(a.handlers.poll,50)}this._ready(a)},_ready:function(a){if(!a.done){a.done=!0;for(var b=0;bw.cacheLength&&delete a[b.shift()],a[c]=d}}function c(a){return a[L]=!0,a}function d(a){var b=E.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b=null}}function e(a,b,c,d){var e,f,g,h,i,l,m,n,o,p;if((b?b.ownerDocument||b:M)!==E&&D(b),b=b||E,c=c||[],!a||"string"!=typeof a)return c;if(1!==(h=b.nodeType)&&9!==h)return[];if(G&&!d){if(e=pb.exec(a))if(g=e[1]){if(9===h){if(f=b.getElementById(g),!f||!f.parentNode)return c;if(f.id===g)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(g))&&K(b,f)&&f.id===g)return c.push(f),c}else{if(e[2])return $.apply(c,b.getElementsByTagName(a)),c;if((g=e[3])&&N.getElementsByClassName&&b.getElementsByClassName)return $.apply(c,b.getElementsByClassName(g)),c}if(N.qsa&&!H.test(a)){if(m=!0,n=L,o=b,p=9===h&&a,1===h&&"object"!==b.nodeName.toLowerCase()){for(l=j(a),(m=b.getAttribute("id"))?n=m.replace(sb,"\\$&"):b.setAttribute("id",n),n="[id='"+n+"'] ",i=l.length;i--;)l[i]=n+k(l[i]);o=nb.test(a)&&b.parentNode||b,p=l.join(",")}if(p)try{return $.apply(c,o.querySelectorAll(p)),c}catch(q){}finally{m||b.removeAttribute("id")}}}return s(a.replace(hb,"$1"),b,c,d)}function f(a,b){var c=b&&a,d=c&&(~b.sourceIndex||W)-(~a.sourceIndex||W);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function g(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function h(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function i(a){return c(function(b){return b=+b,c(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function j(a,b){var c,d,f,g,h,i,j,k=R[a+" "];if(k)return b?0:k.slice(0);for(h=a,i=[],j=w.preFilter;h;){(!c||(d=ib.exec(h)))&&(d&&(h=h.slice(d[0].length)||h),i.push(f=[])),c=!1,(d=jb.exec(h))&&(c=d.shift(),f.push({value:c,type:d[0].replace(hb," ")}),h=h.slice(c.length));for(g in w.filter)!(d=mb[g].exec(h))||j[g]&&!(d=j[g](d))||(c=d.shift(),f.push({value:c,type:g,matches:d}),h=h.slice(c.length));if(!c)break}return b?h.length:h?e.error(a):R(a,i).slice(0)}function k(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function l(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=P++;return b.first?function(b,c,f){for(;b=b[d];)if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=O+" "+f;if(g){for(;b=b[d];)if((1===b.nodeType||e)&&a(b,c,g))return!0}else for(;b=b[d];)if(1===b.nodeType||e)if(j=b[L]||(b[L]={}),(i=j[d])&&i[0]===k){if((h=i[1])===!0||h===v)return h===!0}else if(i=j[d]=[k],i[1]=a(b,c,g)||v,i[1]===!0)return!0}}function m(a){return a.length>1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function n(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function o(a,b,d,e,f,g){return e&&!e[L]&&(e=o(e)),f&&!f[L]&&(f=o(f,g)),c(function(c,g,h,i){var j,k,l,m=[],o=[],p=g.length,q=c||r(b||"*",h.nodeType?[h]:h,[]),s=!a||!c&&b?q:n(q,m,a,h,i),t=d?f||(c?a:p||e)?[]:g:s;if(d&&d(s,t,h,i),e)for(j=n(t,o),e(j,[],h,i),k=j.length;k--;)(l=j[k])&&(t[o[k]]=!(s[o[k]]=l));if(c){if(f||a){if(f){for(j=[],k=t.length;k--;)(l=t[k])&&j.push(s[k]=l);f(null,t=[],j,i)}for(k=t.length;k--;)(l=t[k])&&(j=f?ab.call(c,l):m[k])>-1&&(c[j]=!(g[j]=l))}}else t=n(t===g?t.splice(p,t.length):t),f?f(null,g,t,i):$.apply(g,t)})}function p(a){for(var b,c,d,e=a.length,f=w.relative[a[0].type],g=f||w.relative[" "],h=f?1:0,i=l(function(a){return a===b},g,!0),j=l(function(a){return ab.call(b,a)>-1},g,!0),n=[function(a,c,d){return!f&&(d||c!==A)||((b=c).nodeType?i(a,c,d):j(a,c,d))}];e>h;h++)if(c=w.relative[a[h].type])n=[l(m(n),c)];else{if(c=w.filter[a[h].type].apply(null,a[h].matches),c[L]){for(d=++h;e>d&&!w.relative[a[d].type];d++);return o(h>1&&m(n),h>1&&k(a.slice(0,h-1)).replace(hb,"$1"),c,d>h&&p(a.slice(h,d)),e>d&&p(a=a.slice(d)),e>d&&k(a))}n.push(c)}return m(n)}function q(a,b){var d=0,f=b.length>0,g=a.length>0,h=function(c,h,i,j,k){var l,m,o,p=[],q=0,r="0",s=c&&[],t=null!=k,u=A,x=c||g&&w.find.TAG("*",k&&h.parentNode||h),y=O+=null==u?1:Math.random()||.1;for(t&&(A=h!==E&&h,v=d);null!=(l=x[r]);r++){if(g&&l){for(m=0;o=a[m++];)if(o(l,h,i)){j.push(l);break}t&&(O=y,v=++d)}f&&((l=!o&&l)&&q--,c&&s.push(l))}if(q+=r,f&&r!==q){for(m=0;o=b[m++];)o(s,p,h,i);if(c){if(q>0)for(;r--;)s[r]||p[r]||(p[r]=Y.call(j));p=n(p)}$.apply(j,p),t&&!c&&p.length>0&&q+b.length>1&&e.uniqueSort(j)}return t&&(O=y,A=u),s};return f?c(h):h}function r(a,b,c){for(var d=0,f=b.length;f>d;d++)e(a,b[d],c);return c}function s(a,b,c,d){var e,f,g,h,i,l=j(a);if(!d&&1===l.length){if(f=l[0]=l[0].slice(0),f.length>2&&"ID"===(g=f[0]).type&&9===b.nodeType&&G&&w.relative[f[1].type]){if(b=(w.find.ID(g.matches[0].replace(ub,vb),b)||[])[0],!b)return c;a=a.slice(f.shift().value.length)}for(e=mb.needsContext.test(a)?0:f.length;e--&&(g=f[e],!w.relative[h=g.type]);)if((i=w.find[h])&&(d=i(g.matches[0].replace(ub,vb),nb.test(f[0].type)&&b.parentNode||b))){if(f.splice(e,1),a=d.length&&k(f),!a)return $.apply(c,d),c; +break}}return z(a,l)(d,b,!G,c,nb.test(a)),c}function t(){}var u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L="sizzle"+-new Date,M=window.document,N={},O=0,P=0,Q=b(),R=b(),S=b(),T=!1,U=function(){return 0},V="undefined",W=1<<31,X=[],Y=X.pop,Z=X.push,$=X.push,_=X.slice,ab=X.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},bb="[\\x20\\t\\r\\n\\f]",cb="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",db=cb.replace("w","w#"),eb="([*^$|!~]?=)",fb="\\["+bb+"*("+cb+")"+bb+"*(?:"+eb+bb+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+db+")|)|)"+bb+"*\\]",gb=":("+cb+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+fb.replace(3,8)+")*)|.*)\\)|)",hb=new RegExp("^"+bb+"+|((?:^|[^\\\\])(?:\\\\.)*)"+bb+"+$","g"),ib=new RegExp("^"+bb+"*,"+bb+"*"),jb=new RegExp("^"+bb+"*([\\x20\\t\\r\\n\\f>+~])"+bb+"*"),kb=new RegExp(gb),lb=new RegExp("^"+db+"$"),mb={ID:new RegExp("^#("+cb+")"),CLASS:new RegExp("^\\.("+cb+")"),NAME:new RegExp("^\\[name=['\"]?("+cb+")['\"]?\\]"),TAG:new RegExp("^("+cb.replace("w","w*")+")"),ATTR:new RegExp("^"+fb),PSEUDO:new RegExp("^"+gb),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+bb+"*(even|odd|(([+-]|)(\\d*)n|)"+bb+"*(?:([+-]|)"+bb+"*(\\d+)|))"+bb+"*\\)|)","i"),needsContext:new RegExp("^"+bb+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+bb+"*((?:-\\d)?\\d*)"+bb+"*\\)|)(?=[^-]|$)","i")},nb=/[\x20\t\r\n\f]*[+~]/,ob=/^[^{]+\{\s*\[native code/,pb=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,qb=/^(?:input|select|textarea|button)$/i,rb=/^h\d$/i,sb=/'|\\/g,tb=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,ub=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,vb=function(a,b){var c="0x"+b-65536;return c!==c?b:0>c?String.fromCharCode(c+65536):String.fromCharCode(c>>10|55296,1023&c|56320)};try{$.apply(X=_.call(M.childNodes),M.childNodes),X[M.childNodes.length].nodeType}catch(wb){$={apply:X.length?function(a,b){Z.apply(a,_.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}y=e.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},D=e.setDocument=function(b){var c=b?b.ownerDocument||b:M;return c!==E&&9===c.nodeType&&c.documentElement?(E=c,F=c.documentElement,G=!y(c),N.getElementsByTagName=d(function(a){return a.appendChild(c.createComment("")),!a.getElementsByTagName("*").length}),N.attributes=d(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return"boolean"!==b&&"string"!==b}),N.getElementsByClassName=d(function(a){return a.innerHTML="",a.getElementsByClassName&&a.getElementsByClassName("e").length?(a.lastChild.className="e",2===a.getElementsByClassName("e").length):!1}),N.getByName=d(function(a){a.id=L+0,a.appendChild(E.createElement("a")).setAttribute("name",L),a.appendChild(E.createElement("i")).setAttribute("name",L),F.appendChild(a);var b=c.getElementsByName&&c.getElementsByName(L).length===2+c.getElementsByName(L+0).length;return F.removeChild(a),b}),N.sortDetached=d(function(a){return a.compareDocumentPosition&&1&a.compareDocumentPosition(E.createElement("div"))}),w.attrHandle=d(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==V&&"#"===a.firstChild.getAttribute("href")})?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},N.getByName?(w.find.ID=function(a,b){if(typeof b.getElementById!==V&&G){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},w.filter.ID=function(a){var b=a.replace(ub,vb);return function(a){return a.getAttribute("id")===b}}):(w.find.ID=function(a,b){if(typeof b.getElementById!==V&&G){var c=b.getElementById(a);return c?c.id===a||typeof c.getAttributeNode!==V&&c.getAttributeNode("id").value===a?[c]:void 0:[]}},w.filter.ID=function(a){var b=a.replace(ub,vb);return function(a){var c=typeof a.getAttributeNode!==V&&a.getAttributeNode("id");return c&&c.value===b}}),w.find.TAG=N.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==V?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},w.find.NAME=N.getByName&&function(a,b){return typeof b.getElementsByName!==V?b.getElementsByName(name):void 0},w.find.CLASS=N.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==V&&G?b.getElementsByClassName(a):void 0},I=[],H=[":focus"],(N.qsa=a(c.querySelectorAll))&&(d(function(a){a.innerHTML="",a.querySelectorAll("[selected]").length||H.push("\\["+bb+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||H.push(":checked")}),d(function(a){a.innerHTML="",a.querySelectorAll("[i^='']").length&&H.push("[*^$]="+bb+"*(?:\"\"|'')"),a.querySelectorAll(":enabled").length||H.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),H.push(",.*:")})),(N.matchesSelector=a(J=F.matchesSelector||F.mozMatchesSelector||F.webkitMatchesSelector||F.oMatchesSelector||F.msMatchesSelector))&&d(function(a){N.disconnectedMatch=J.call(a,"div"),J.call(a,"[s!='']:x"),I.push("!=",gb)}),H=new RegExp(H.join("|")),I=I.length&&new RegExp(I.join("|")),K=a(F.contains)||F.compareDocumentPosition?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},U=F.compareDocumentPosition?function(a,b){if(a===b)return T=!0,0;var d=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b);return d?1&d||B&&b.compareDocumentPosition(a)===d?a===c||K(M,a)?-1:b===c||K(M,b)?1:C?ab.call(C,a)-ab.call(C,b):0:4&d?-1:1:a.compareDocumentPosition?-1:1}:function(a,b){var d,e=0,g=a.parentNode,h=b.parentNode,i=[a],j=[b];if(a===b)return T=!0,0;if(!g||!h)return a===c?-1:b===c?1:g?-1:h?1:0;if(g===h)return f(a,b);for(d=a;d=d.parentNode;)i.unshift(d);for(d=b;d=d.parentNode;)j.unshift(d);for(;i[e]===j[e];)e++;return e?f(i[e],j[e]):i[e]===M?-1:j[e]===M?1:0},E):E},e.matches=function(a,b){return e(a,null,null,b)},e.matchesSelector=function(a,b){if((a.ownerDocument||a)!==E&&D(a),b=b.replace(tb,"='$1']"),N.matchesSelector&&G&&(!I||!I.test(b))&&!H.test(b))try{var c=J.call(a,b);if(c||N.disconnectedMatch||a.document&&11!==a.document.nodeType)return c}catch(d){}return e(b,E,null,[a]).length>0},e.contains=function(a,b){return(a.ownerDocument||a)!==E&&D(a),K(a,b)},e.attr=function(a,b){var c;return(a.ownerDocument||a)!==E&&D(a),G&&(b=b.toLowerCase()),(c=w.attrHandle[b])?c(a):!G||N.attributes?a.getAttribute(b):((c=a.getAttributeNode(b))||a.getAttribute(b))&&a[b]===!0?b:c&&c.specified?c.value:null},e.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},e.uniqueSort=function(a){var b,c=[],d=0,e=0;if(T=!N.detectDuplicates,B=!N.sortDetached,C=!N.sortStable&&a.slice(0),a.sort(U),T){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return a},x=e.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=x(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d];d++)c+=x(b);return c},w=e.selectors={cacheLength:50,createPseudo:c,match:mb,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ub,vb),a[3]=(a[4]||a[5]||"").replace(ub,vb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||e.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&e.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return mb.CHILD.test(a[0])?null:(a[4]?a[2]=a[4]:c&&kb.test(c)&&(b=j(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){return"*"===a?function(){return!0}:(a=a.replace(ub,vb).toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=Q[a+" "];return b||(b=new RegExp("(^|"+bb+")"+a+"("+bb+"|$)"))&&Q(a,function(a){return b.test(a.className||typeof a.getAttribute!==V&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var f=e.attr(d,a);return null==f?"!="===b:b?(f+="","="===b?f===c:"!="===b?f!==c:"^="===b?c&&0===f.indexOf(c):"*="===b?c&&f.indexOf(c)>-1:"$="===b?c&&f.slice(-c.length)===c:"~="===b?(" "+f+" ").indexOf(c)>-1:"|="===b?f===c||f.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){for(;p;){for(l=b;l=l[p];)if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(k=q[L]||(q[L]={}),j=k[a]||[],n=j[0]===O&&j[1],m=j[0]===O&&j[2],l=n&&q.childNodes[n];l=++n&&l&&l[p]||(m=n=0)||o.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[O,n,m];break}}else if(s&&(j=(b[L]||(b[L]={}))[a])&&j[0]===O)m=j[1];else for(;(l=++n&&l&&l[p]||(m=n=0)||o.pop())&&((h?l.nodeName.toLowerCase()!==r:1!==l.nodeType)||!++m||(s&&((l[L]||(l[L]={}))[a]=[O,m]),l!==b)););return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var d,f=w.pseudos[a]||w.setFilters[a.toLowerCase()]||e.error("unsupported pseudo: "+a);return f[L]?f(b):f.length>1?(d=[a,a,"",b],w.setFilters.hasOwnProperty(a.toLowerCase())?c(function(a,c){for(var d,e=f(a,b),g=e.length;g--;)d=ab.call(a,e[g]),a[d]=!(c[d]=e[g])}):function(a){return f(a,0,d)}):f}},pseudos:{not:c(function(a){var b=[],d=[],e=z(a.replace(hb,"$1"));return e[L]?c(function(a,b,c,d){for(var f,g=e(a,null,d,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,c,f){return b[0]=a,e(b,null,f,d),!d.pop()}}),has:c(function(a){return function(b){return e(a,b).length>0}}),contains:c(function(a){return function(b){return(b.textContent||b.innerText||x(b)).indexOf(a)>-1}}),lang:c(function(a){return lb.test(a||"")||e.error("unsupported lang: "+a),a=a.replace(ub,vb).toLowerCase(),function(b){var c;do if(c=G?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(a){var b=window.location&&window.location.hash;return b&&b.slice(1)===a.id},root:function(a){return a===F},focus:function(a){return a===E.activeElement&&(!E.hasFocus||E.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeName>"@"||3===a.nodeType||4===a.nodeType)return!1;return!0},parent:function(a){return!w.pseudos.empty(a)},header:function(a){return rb.test(a.nodeName)},input:function(a){return qb.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||b.toLowerCase()===a.type)},first:i(function(){return[0]}),last:i(function(a,b){return[b-1]}),eq:i(function(a,b,c){return[0>c?c+b:c]}),even:i(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:i(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:i(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:i(function(a,b,c){for(var d=0>c?c+b:c;++dg;g++){for(f=[a[g]];h>g+1&&c(a[g],a[g+1]);)f.push(a[g+1]),g++;e.push(b.pairs?[d(a[g]),f]:f)}return e},reduce:function(b,c,d){if(a.reduce)return a.reduce.apply(b,[].slice.call(arguments,1));var e=Object(b),f=e.length>>>0,g=0,h;if(arguments.length>=3)h=d;else{for(;f>g&&!(g in e);)g++;if(g>=f)throw new TypeError("Reduce of empty array with no initial value");h=e[g++]}for(;f>g;g++)g in e&&(h=c(h,e[g],g,e));return h},inArray:function(a,b){if("object"==typeof b)for(var c=0,d=b.length;d>c;++c)if(b[c]===a)return!0;return!1},sortMulti:function(a,b){if("undefined"==typeof a||a.constructor!==Array)return!1;if("string"!=typeof b)return a.sort();if(a.length>0){if("undefined"==typeof a[0][b])return!1;a.sort(function(a,c){var d=a[b],e=c[b];return e>d?-1:d>e?1:0})}return a},keyValue:function(a,b,c){if("undefined"!=typeof a&&"object"==typeof b&&this.inArray(a,b)){for(var d=[],e=0,f=b.length;f>e;++e)if(b[e]===a){if("undefined"!=typeof c&&c===!0)return e;d.push(e)}return d}return!1},shuffle:function(a){if("undefined"!=typeof a&&a.constructor!==Array)return!1;for(var b=a.length,c=!1,d=!1;b--;)d=Math.floor(Math.random()*(b+1)),c=a[b],a[b]=a[d],a[d]=c;return a},forEach:function(b,c,d){if(a.forEach)return a.forEach.call(b,c,d);for(var e=0,f=b.length>>>0;f>e;e++)c.call(d,b[e],e,b)},each:function(){b.forEach.apply(b,[].slice.call(arguments))},map:function(b,c,d){if(a.map)return a.map.call(b,c,d);for(var e=new Array(g),f=0,g=b.length>>>0;g>f;f++)e[f]=c.call(d,b[f],f,b);return e},filter:function(b,c,d){if(a.filter)return a.filter.call(b,c,d);for(var e=[],f=null,g=0,h=b.length;h>g;g++)f=b[g],c.call(d,f,g,b)&&e.push(f);return e},some:function(a,b,c){if(null===a)throw new TypeError("First argument is invalid.");var d=Object(a),e=d.length>>>0;if("function"!=typeof b)throw new TypeError("Second argument must be a function.");for(var f=0;e>f;f++)if(f in d&&b.call(c,d[f],f,d))return!0;return!1},intersect:function(a,b){if(!a||!b||a instanceof Array==!1||b instanceof Array==!1)return[];for(var c=[],d=0,e=a.length;e>d;++d)for(var f=0,g=b.length;g>f;++f)a[d]===b[f]&&c.push(a[d]);return c},convert:function(b){return a.slice.call(b||[],0)},unique:function(a){if(!Array.prototype.lastIndexOf){var c=[];return b.forEach(b.convert(a),function(a){b.inArray(a,c)||c.push(a)}),c}return b.filter(b.convert(a),function(a,b,c){return c.lastIndexOf(a)===b})},range:function c(a,b,d){d||(d=1);var e=[],f;if(d>0)for(f=a;b>f;f+=d)e.push(f);else for(f=a;f>b;f+=d)e.push(f);return e},insert:function(a,b,c){a.splice(b,0,c)},remove:function(a,b,c){for(var d=[],e=0,f=a.length;f>e;e++)e>=b&&b+c>e||d.push(a[e]);return d}};return b}),Ink.createModule("Ink.Util.BinPack","1",[],function(){"use strict";var a=function(a,b){this.init(a,b)};a.prototype={init:function(a,b){this.root={x:0,y:0,w:a,h:b}},fit:function(a){var b,c,d;for(b=0;b0?a[0].w:0,g=e>0?a[0].h:0;for(this.root={x:0,y:0,w:f,h:g},b=0;e>b;b++)d=a[b],d.fit=(c=this.findNode(this.root,d.w,d.h))?this.splitNode(c,d.w,d.h):this.growNode(d.w,d.h)},findNode:function(a,b,c){return a.used?this.findNode(a.right,b,c)||this.findNode(a.down,b,c):b<=a.w&&c<=a.h?a:null},splitNode:function(a,b,c){return a.used=!0,a.down={x:a.x,y:a.y+c,w:a.w,h:a.h-c},a.right={x:a.x+b,y:a.y,w:a.w-b,h:c},a},growNode:function(a,b){var c=a<=this.root.w,d=b<=this.root.h,e=d&&this.root.h>=this.root.w+a,f=c&&this.root.w>=this.root.h+b;return e?this.growRight(a,b):f?this.growDown(a,b):d?this.growRight(a,b):c?this.growDown(a,b):null},growRight:function(a,b){this.root={used:!0,x:0,y:0,w:this.root.w+a,h:this.root.h,down:this.root,right:{x:this.root.w,y:0,w:a,h:this.root.h}};var c;return(c=this.findNode(this.root,a,b))?this.splitNode(c,a,b):null},growDown:function(a,b){this.root={used:!0,x:0,y:0,w:this.root.w,h:this.root.h+b,down:{x:0,y:this.root.h,w:this.root.w,h:b},right:this.root};var c;return(c=this.findNode(this.root,a,b))?this.splitNode(c,a,b):null}};var c={random:function(){return Math.random()-.5},w:function(a,b){return b.w-a.w},h:function(a,b){return b.h-a.h},a:function(a,b){return b.area-a.area},max:function(a,b){return Math.max(b.w,b.h)-Math.max(a.w,a.h)},min:function(a,b){return Math.min(b.w,b.h)-Math.min(a.w,a.h)},height:function(a,b){return c.msort(a,b,["h","w"])},width:function(a,b){return c.msort(a,b,["w","h"])},area:function(a,b){return c.msort(a,b,["a","h","w"])},maxside:function(a,b){return c.msort(a,b,["max","min","h","w"])},msort:function(a,b,d){var e,f;for(f=0;ff;++f)h=e.blocks[f],"area"in h||(h.area=h.w*h.h);var i=e.dimensions?new a(e.dimensions[0],e.dimensions[1]):new b;e.sorter||(e.sorter="maxside"),e.blocks.sort(c[e.sorter]),i.fit(e.blocks);var j=[i.root.w,i.root.h],k=[],l=[];for(f=0,g=e.blocks.length;g>f;++f)h=e.blocks[f],h.fit?k.push(h):(h.toString=d,l.push(h));var m=j[0]*j[1],n=0;for(f=0,g=k.length;g>f;++f)h=k[f],n+=h.area;return{dimensions:j,filled:n/m,blocks:e.blocks,fitted:k,unfitted:l}}};return e}),Ink.createModule("Ink.Util.Cookie","1",[],function(){"use strict";var a={get:function(a){var b=document.cookie||!1,c={};if(b){b=b.replace(new RegExp("; ","g"),";");var d=b.split(";"),e=[];if(d.length>0)for(var f=0;f1?k:"0"+k;break;case"D":d[j]=this._wDays(f.getDay()).substring(0,3);break;case"j":d[j]=f.getDate();break;case"l":d[j]=this._wDays(f.getDay());break;case"N":d[j]=f.getDay()||7;break;case"S":var l=f.getDate(),m=["st","nd","rd"],n="";d[j]=l>=11&&13>=l?"th":(n=m[String(l).substr(-1)-1])?n:"th";break;case"w":d[j]=f.getDay();break;case"z":g=Date.UTC(f.getFullYear(),0,0),h=Date.UTC(f.getFullYear(),f.getMonth(),f.getDate()),d[j]=Math.floor((h-g)/864e5);break;case"W":var o=new Date(f.getFullYear(),0,1);g=o.getDay()||7;var p=Math.floor((f-o)/864e5+1);d[j]=Math.ceil((p-(8-g))/7)+1;break;case"F":d[j]=this._months(f.getMonth());break;case"m":var q=String(f.getMonth()+1);d[j]=q.length>1?q:"0"+q;break;case"M":d[j]=this._months(f.getMonth()).substring(0,3);break;case"n":d[j]=f.getMonth()+1;break;case"t":d[j]=this._daysInMonth(f.getMonth()+1,f.getYear());break;case"L":var r=f.getFullYear();d[j]=r%4?!1:r%100?!0:r%400?!1:!0;break;case"o":throw'"o" not implemented!';case"Y":d[j]=f.getFullYear();break;case"y":d[j]=String(f.getFullYear()).substring(2);break;case"a":d[j]=f.getHours()<12?"am":"pm";break;case"A":d[j]=f.getHours<12?"AM":"PM";break;case"B":throw'"B" not implemented!';case"g":i=f.getHours(),d[j]=12>=i?i:i-12;break;case"G":d[j]=String(f.getHours());break;case"h":i=String(f.getHours()),i=12>=i?i:i-12,d[j]=i.length>1?i:"0"+i;break;case"H":i=String(f.getHours()),d[j]=i.length>1?i:"0"+i;break;case"i":var s=String(f.getMinutes());d[j]=s.length>1?s:"0"+s;break;case"s":var t=String(f.getSeconds());d[j]=t.length>1?t:"0"+t;break;case"u":throw'"u" not implemented!';case"e":throw'"e" not implemented!';case"I":g=new Date(f.getFullYear(),0,1),d[j]=f.getTimezoneOffset()!==g.getTimezoneOffset()?1:0;break;case"O":var u=f.getTimezoneOffset(),v=u%60;i=String((u-v)/60*-1),"-"!==i.charAt(0)&&(i="+"+i),i=3===i.length?i:i.replace(/([+\-])(\d)/,"$10$2"),d[j]=i+v+"0";break;case"P":throw'"P" not implemented!';case"T":throw'"T" not implemented!';case"Z":d[j]=60*f.getTimezoneOffset();break;case"c":throw'"c" not implemented!';case"r":var w=this._wDays(f.getDay()).substr(0,3),x=this._months(f.getMonth()).substr(0,3);d[j]=w+", "+f.getDate()+" "+x+this.get(" Y H:i:s O",f);break;case"U":d[j]=Math.floor(f.getTime()/1e3);break;default:d[j]=c[j]}return d.join("")},set:function(a,b){if("undefined"!=typeof b){("undefined"==typeof a||""===a)&&(a="Y-m-d");for(var c=a.split(""),d=new Array(c.length),e="\\",f,g={year:void 0,month:void 0,day:void 0,dayY:void 0,dayW:void 0,week:void 0,hour:void 0,hourD:void 0,min:void 0,sec:void 0,msec:void 0,ampm:void 0,diffM:void 0,diffH:void 0,date:void 0},h=0,i=0;i=S.slice(2)?0:1)+M)}else M=L.getFullYear();if(n)N=0,O=f[g.dayY.match+1];else if(o)N=p?this._iMonth(f[g.month.match+1]):L.getMonth(),O=f[g.day.match+1];else{N=0;var T;T=t?f[g.week.match+1]:this.get("W",L),O=7*(T-2)+(8-(new Date(M,0,1).getDay()||7))+this._iWeek(f[g.week.match+1])}if(0===N&&O>31){var U=new Date(M,N,O);N=U.getMonth(),O=U.getDate()}}else M=L.getFullYear(),N=L.getMonth(),O=L.getDate();return I=y?+f[g.hourD.match+1]+("pm"===f[g.ampm.match+1]?12:0):z?f[g.hour.match+1]:x?L.getHours():"00",J=B?f[g.min.match+1]:E?"00":L.getMinutes(),P=C?f[g.sec.match+1]:F?"00":L.getSeconds(),Q=D?f[g.msec.match+1]:"000",R=H?f[g.diffH.match+1]:G?String(-1*f[g.diffM.match+1]/60*100).replace(/^(\d)/,"+$1").replace(/(^[\-+])(\d{3}$)/,"$10$2"):"+0000",new Date(M,N,O,I,J,P)}}}};return a}),Ink.createModule("Ink.Util.Dumper","1",[],function(){"use strict";var a={_tab:"    ",_formatParam:function(a){var b="";switch(typeof a){case"string":b="(string) "+a;break;case"number":b="(number) "+a;break;case"boolean":b="(boolean) "+a;break;case"object":b=null!==a?a.constructor===Array?"Array \n{\n"+this._outputFormat(a,0)+"\n}":"Object \n{\n"+this._outputFormat(a,0)+"\n}":"null";break;default:b=!1}return b},_getTabs:function(a){for(var b="",c=0;a>c;c++)b+=this._tab;return b},_outputFormat:function(a,b){var c="",d=!1;for(var e in a)if(null!==a[e])if("object"!=typeof a[e]||a[e].constructor!==Array&&a[e].constructor!==Object){if(a[e].constructor===Function)continue;c=c+this._tab+this._getTabs(b)+"["+e+"] => "+a[e]+"\n"}else a[e].constructor===Array?d="Array":a[e].constructor===Object&&(d="Object"),c+=this._tab+this._getTabs(b)+"["+e+"] => "+d+"\n",c+=this._tab+this._getTabs(b)+"{\n",c+=this._outputFormat(a[e],b+1)+this._tab+this._getTabs(b)+"}\n";else c=c+this._tab+this._getTabs(b)+"["+e+"] => null \n";return c},printDump:function(a,b){if(b&&"undefined"!=typeof b)if("string"==typeof b)document.getElementById(b).innerHTML="
            "+this._formatParam(a)+"
            ";else{if("object"!=typeof b)throw"TARGET must be an element or an element ID";b.innerHTML="
            "+this._formatParam(a)+"
            "}else document.write("
            "+this._formatParam(a)+"
            ")},returnDump:function(a){return this._formatParam(a)},alertDump:function(a){window.alert(this._formatParam(a).replace(/()(Array|Object)(<\/b>)/g,"$2"))},windowDump:function(a){var b="dumperwindow_"+1e4*Math.random(),c=window.open("",b,"width=400,height=300,left=50,top=50,status,menubar,scrollbars,resizable");c.document.open(),c.document.write("
            "+this._formatParam(a)+"
            "),c.document.close(),c.focus()}};return a}),Ink.createModule("Ink.Util.I18n","1",[],function(){"use strict";var a=/\{(?:(\{.*?})|(?:%s:)?(\d+)|(?:%s)?|([\w-]+))}/g,b=function(a,b){return"function"==typeof a?a.apply(this,b):void 0!==typeof a?a:""},c=function(a,b,d){return this instanceof c?void this.reset().lang(b).testMode(d).append(a||{},b):new c(a,b,d)};return c.prototype={reset:function(){return this._dicts=[],this._dict={},this._testMode=!1,this._lang=this._gLang,this},append:function(a){return this._dicts.push(a),this._dict=Ink.extendObj(this._dict,a[this._lang]),this},lang:function(a){if(!arguments.length)return this._lang;if(a&&this._lang!==a){this._lang=a,this._dict={};for(var b=0,c=this._dicts.length;c>b;b++)this._dict=Ink.extendObj(this._dict,this._dicts[b][a]||{})}return this},testMode:function(a){return arguments.length?(void 0!==a&&(this._testMode=!!a),this):!!this._testMode},getKey:function(a){var b,d=this._gLang,e=this._lang;return a in this._dict?b=this._dict[a]:(c.langGlobal(e),b=this._gDict[a],c.langGlobal(d)),b},text:function(c){if("string"==typeof c){var d=Array.prototype.slice.call(arguments,1),e=0,f="object"==typeof d[0],g=this.getKey(c);return void 0===g&&(g=this._testMode?"["+c+"]":c),"number"==typeof g&&(g+=""),"string"==typeof g?g=g.replace(a,function(a,c,g,h){var i=c?c:g?d[g-(f?0:1)]:h?d[0][h]||"":d[e++ +(f?1:0)];return b(i,[e].concat(d))}):"function"==typeof g?g.apply(this,d):g instanceof Array?b(g[d[0]],d):"object"==typeof g?b(g[d[0]],d):""}},ntext:function(a,b,c){var d=Array.prototype.slice.apply(arguments),e;if(2===d.length&&"number"==typeof b){if(e=this.getKey(a),!(e instanceof Array))return"";d.splice(0,1),e=e[1===b?0:1]}else d.splice(0,2),e=1===c?a:b;return this.text.apply(this,[e].concat(d))},ordinal:function(a){if(void 0===a)return"";var c=+a.toString().slice(-1),d=this.getKey("_ordinals");if(void 0===d)return"";if("string"==typeof d)return d;var e;return"function"==typeof d&&(e=d(a,c),"string"==typeof e)?e:"exceptions"in d&&(e="function"==typeof d.exceptions?d.exceptions(a,c):a in d.exceptions?b(d.exceptions[a],[a,c]):void 0,"string"==typeof e)?e:"byLastDigit"in d&&(e="function"==typeof d.byLastDigit?d.byLastDigit(c,a):c in d.byLastDigit?b(d.byLastDigit[c],[c,a]):void 0,"string"==typeof e)?e:"default"in d&&(e=b(d["default"],[a,c]),"string"==typeof e)?e:""},alias:function(){var a=Ink.bind(c.prototype.text,this);return a.ntext=Ink.bind(c.prototype.ntext,this),a.append=Ink.bind(c.prototype.append,this),a.ordinal=Ink.bind(c.prototype.ordinal,this),a.testMode=Ink.bind(c.prototype.testMode,this),a}},c.reset=function(){c.prototype._gDicts=[],c.prototype._gDict={},c.prototype._gLang="pt_PT"},c.reset(),c.appendGlobal=function(a,b){if(b){if(!(b in a)){var d={};d[b]=a,a=d}b!==c.prototype._gLang&&c.langGlobal(b)}c.prototype._gDicts.push(a),Ink.extendObj(c.prototype._gDict,a[c.prototype._gLang]) +},c.append=function(){return Ink.warn("Ink.Util.I18n.append() was renamed to appendGlobal()."),c.appendGlobal.apply(c,[].slice.call(arguments))},c.langGlobal=function(a){if(!arguments.length)return c.prototype._gLang;if(a&&c.prototype._gLang!==a){c.prototype._gLang=a,c.prototype._gDict={};for(var b=0,d=c.prototype._gDicts.length;d>b;b++)Ink.extendObj(c.prototype._gDict,c.prototype._gDicts[b][a]||{})}},c.lang=function(){return Ink.warn("Ink.Util.I18n.lang() was renamed to langGlobal()."),c.langGlobal.apply(c,[].slice.call(arguments))},c}),Ink.createModule("Ink.Util.Json","1",[],function(){"use strict";function twoDigits(a){var b=""+a;return 1===b.length?"0"+b:b}var function_call=Function.prototype.call,cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,dateToISOString=Date.prototype.toISOString?Ink.bind(function_call,Date.prototype.toISOString):function(a){return a.getUTCFullYear()+"-"+twoDigits(a.getUTCMonth()+1)+"-"+twoDigits(a.getUTCDate())+"T"+twoDigits(a.getUTCHours())+":"+twoDigits(a.getUTCMinutes())+":"+twoDigits(a.getUTCSeconds())+"."+String((a.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"},InkJson={_nativeJSON:window.JSON||null,_convertToUnicode:!1,_escape:function(a){var b={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(a)&&(a=a.replace(/([\x00-\x1f\\"])/g,function(a,c){var d=b[c];return d?d:(d=c.charCodeAt(),"\\u00"+Math.floor(d/16).toString(16)+(d%16).toString(16))})),a},_toUnicode:function(a){if(this._convertToUnicode){for(var b="",c=!1,d=!1,e=0,f=a.length;f>e;){if(c=a.charCodeAt(e),c>=32&&126>=c||8===c||9===c||10===c||12===c||13===c||32===c||34===c||47===c||58===c||92===c)d=34===c||92===c||47===c?"\\"+a.charAt(e):8===c?"\\b":9===c?"\\t":10===c?"\\n":12===c?"\\f":13===c?"\\r":a.charAt(e);else if(this._convertToUnicode){for(d=a.charCodeAt(e).toString(16)+"".toUpperCase();d.length<4;)d="0"+d;d="\\u"+d}else d=a.charAt(e);b+=d,e++}return b}return this._escape(a)},_stringifyValue:function(a){if("string"==typeof a)return'"'+this._toUnicode(a)+'"';if("number"!=typeof a||!isNaN(a)&&isFinite(a)){if("undefined"==typeof a||null===a)return"null";if("function"==typeof a.toJSON){var b=a.toJSON();return"string"==typeof b?'"'+this._escape(b)+'"':this._escape(b.toString())}if("number"==typeof a||"boolean"==typeof a)return""+a;if("function"==typeof a)return"null";if(a.constructor===Date)return'"'+this._escape(dateToISOString(a))+'"';if(a.constructor===Array){for(var c="",d=0,e=a.length;e>d;d++)d>0&&(c+=","),c+=this._stringifyValue(a[d]);return"["+c+"]"}var f="";for(var g in a)({}).hasOwnProperty.call(a,g)&&(""!==f&&(f+=","),f+='"'+this._escape(g)+'": '+this._stringifyValue(a[g]));return"{"+f+"}"}return"null"},stringify:function(a,b){return this._convertToUnicode=!!b,!this._convertToUnicode&&this._nativeJSON?this._nativeJSON.stringify(a):this._stringifyValue(a)},parse:function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&"object"==typeof e)for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),void 0!==d?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")}};return InkJson}),Ink.createModule("Ink.Util.String","1",[],function(){"use strict";var InkUtilString={_chars:["&","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","ø","ù","ú","û","ü","ý","þ","ÿ","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","Ø","Ù","Ú","Û","Ü","Ý","Þ","€",'"',"ß","<",">","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾"],_entities:["amp","agrave","aacute","acirc","atilde","auml","aring","aelig","ccedil","egrave","eacute","ecirc","euml","igrave","iacute","icirc","iuml","eth","ntilde","ograve","oacute","ocirc","otilde","ouml","oslash","ugrave","uacute","ucirc","uuml","yacute","thorn","yuml","Agrave","Aacute","Acirc","Atilde","Auml","Aring","AElig","Ccedil","Egrave","Eacute","Ecirc","Euml","Igrave","Iacute","Icirc","Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde","Ouml","Oslash","Ugrave","Uacute","Ucirc","Uuml","Yacute","THORN","euro","quot","szlig","lt","gt","cent","pound","curren","yen","brvbar","sect","uml","copy","ordf","laquo","not","shy","reg","macr","deg","plusmn","sup2","sup3","acute","micro","para","middot","cedil","sup1","ordm","raquo","frac14","frac12","frac34"],_accentedChars:["à","á","â","ã","ä","å","è","é","ê","ë","ì","í","î","ï","ò","ó","ô","õ","ö","ù","ú","û","ü","ç","ñ","À","Á","Â","Ã","Ä","Å","È","É","Ê","Ë","Ì","Í","Î","Ï","Ò","Ó","Ô","Õ","Ö","Ù","Ú","Û","Ü","Ç","Ñ"],_accentedRemovedChars:["a","a","a","a","a","a","e","e","e","e","i","i","i","i","o","o","o","o","o","u","u","u","u","c","n","A","A","A","A","A","A","E","E","E","E","I","I","I","I","O","O","O","O","O","U","U","U","U","C","N"],_htmlUnsafeChars:{"<":"<",">":">","&":"&",'"':""","'":"'"},ucFirst:function(a,b){var c=b?/(^|\s)(\w)(\S{2,})/:/(^|\s)(\w)(\S{2,})/g;return a?String(a).replace(c,function(a,b,c,d){return b+c.toUpperCase()+d.toLowerCase()}):a},trim:function(a){return"string"==typeof a?a.replace(/^\s+|\s+$|\n+$/g,""):a},stripTags:function(a,b){if(b&&"string"==typeof b){for(var c=InkUtilString.trim(b).split(","),d=[],e=!1,f=0;f)/g,"").replace(/\s/,"")),d.push("(<"+e+"\\s[^>]+>|<(\\s|\\/)?(\\s|\\/)?"+e+">)"));for(var g=d.join("|"),h=new RegExp(g,"i"),i=a.match(new RegExp("<[^>]*>","g")),j=0;j]+\>/g,"")},htmlEntitiesEncode:function(a){if(a&&a.replace)for(var b=!1,c=0;cd?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},shortString:function(a,b){for(var c=a.split(" "),d="",e=0;e=b){d+="…";break}d+=c[e]+" "}return d},truncateString:function(a,b){return a.length-1>b?a.substr(0,b-1)+"…":a},utf8Decode:function(a){for(var b="",c=0,d=0,e=0,f=0;cd?(b+=String.fromCharCode(d),c++):d>191&&224>d?(e=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&e),c+=2):(e=a.charCodeAt(c+1),f=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&e)<<6|63&f),c+=3);return b},removeAccentedChars:function(a){for(var b=a,c=!1,d=0;d&'"]/g,function(a){return b[a]}):a},normalizeWhitespace:function(a){return null!==a?InkUtilString.trim(String(a).replace(/\s+/g," ")):a},toUnicode:function(a){if("string"==typeof a){for(var b="",c=!1,d=!1,e=a.length,f=0;e>f;){if(c=a.charCodeAt(f),c>=32&&126>=c||8===c||9===c||10===c||12===c||13===c||32===c||34===c||47===c||58===c||92===c)d=8===c?"\\b":9===c?"\\t":10===c?"\\n":12===c?"\\f":13===c?"\\r":a.charAt(f);else{for(d=a.charCodeAt(f).toString(16)+"".toUpperCase();d.length<4;)d="0"+d;d="\\u"+d}b+=d,f++}return b}},escape:function(a){var b=a.charCodeAt(0).toString(16).split("");if(b.length<3){for(;b.length<2;)b.unshift("0");b.unshift("x")}else{for(;b.length<4;)b.unshift("0");b.unshift("u")}return b.unshift("\\"),b.join("")},unescape:function(a){var b=a.lastIndexOf("0");b=-1===b?2:Math.min(b,2);var c=a.substring(b),d=parseInt(c,16);return String.fromCharCode(d)},escapeText:function(a,b){void 0===b&&(b=["[","]","'",","]);for(var c=[],d,e,f=0,g=a.length;g>f;++f)d=a[f],e=d.charCodeAt(0),(32>e||e>126&&-1===b.indexOf(d))&&(d=InkUtilString.escape(d)),c.push(d);return c.join("")},escapedCharRegex:/(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4})/g,unescapeText:function(a){for(var b;b=InkUtilString.escapedCharRegex.exec(a);)b=b[0],a=a.replace(b,InkUtilString.unescape(b)),InkUtilString.escapedCharRegex.lastIndex=0;return a},strcmp:function(a,b){return a===b?0:a>b?1:-1},packetize:function(a,b){for(var c=a.length,d=new Array(Math.ceil(c/b)),e=a.split(""),f,g=0;c;)f=Math.min(b,c),d[g++]=e.splice(0,f).join(""),c-=f;return d}};return InkUtilString}),Ink.createModule("Ink.Util.Url","1",[],function(){"use strict";var a={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",getUrl:function(){return window.location.href},genQueryString:function(a,b){var c=-1!==a.indexOf("?"),d,e,f,g=[a];for(e in b)b.hasOwnProperty(e)&&(c?d="&":(d="?",c=!0),f=b[e],"number"==typeof f||f||(f=""),g=g.concat([d,encodeURIComponent(e),"=",encodeURIComponent(f)]));return g.join("")},getQueryString:function(a){var b;b=a&&"undefined"!=typeof a?a:this.getUrl();var c={};if(b.match(/\?(.+)/i)){var d=b.replace(/^(.*)\?([^\#]+)(\#(.*))?/g,"$2");if(d.length>0)for(var e=d.split(/[;&]/),f=0;f0)for(var e=d.split(/[;&]/),f=0;f0?b[b.length-1]:!1;for(var c=!1,d=new RegExp(""+a,"i"),e=0,f=b.length;f>e;e++)if(c=b[e],d.test(c.src))return c;return!1},_debug:function(){}};return a}),Ink.createModule("Ink.Util.Validator","1",[],function(){"use strict";var a={_countryCodes:["AO","CV","MZ","PT"],_internacionalPT:351,_indicativosPT:{21:"lisboa",22:"porto",231:"mealhada",232:"viseu",233:"figueira da foz",234:"aveiro",235:"arganil",236:"pombal",238:"seia",239:"coimbra",241:"abrantes",242:"ponte de sôr",243:"santarém",244:"leiria",245:"portalegre",249:"torres novas",251:"valença",252:"vila nova de famalicão",253:"braga",254:"peso da régua",255:"penafiel",256:"são joão da madeira",258:"viana do castelo",259:"vila real",261:"torres vedras",262:"caldas da raínha",263:"vila franca de xira",265:"setúbal",266:"évora",268:"estremoz",269:"santiago do cacém",271:"guarda",272:"castelo branco",273:"bragança",274:"proença-a-nova",275:"covilhã",276:"chaves",277:"idanha-a-nova",278:"mirandela",279:"moncorvo",281:"tavira",282:"portimão",283:"odemira",284:"beja",285:"moura",286:"castro verde",289:"faro",291:"funchal, porto santo",292:"corvo, faial, flores, horta, pico",295:"angra do heroísmo, graciosa, são jorge, terceira",296:"ponta delgada, são miguel, santa maria",91:"rede móvel 91 (Vodafone / Yorn)",93:"rede móvel 93 (Optimus)",96:"rede móvel 96 (TMN)",92:"rede móvel 92 (TODOS)",707:"número único",760:"número único",800:"número grátis",808:"chamada local",30:"voip"},_internacionalCV:238,_indicativosCV:{2:"fixo",91:"móvel 91",95:"móvel 95",97:"móvel 97",98:"móvel 98",99:"móvel 99"},_internacionalAO:244,_indicativosAO:{2:"fixo",91:"móvel 91",92:"móvel 92"},_internacionalMZ:258,_indicativosMZ:{2:"fixo",82:"móvel 82",84:"móvel 84"},_internacionalTL:670,_indicativosTL:{3:"fixo",7:"móvel 7"},_characterGroups:{numbers:["0-9"],asciiAlpha:["a-zA-Z"],latin1Alpha:["a-zA-Z","À-ÿ"],unicodeAlpha:["a-zA-Z","À-ÿ","Ā-῿","Ⰰ-퟿"],space:[" "],dash:["-"],underscore:["_"],nicknamePunctuation:["_.-"],singleLineWhitespace:[" "],newline:["\n"],whitespace:[" \n \f\r  "],asciiPunctuation:["!-/",":-@","[-`","{-~"],latin1Punctuation:["!-/",":-@","[-`","{-~","¡-¿","×","÷"],unicodePunctuation:["!-/",":-@","[-`","{-~","¡-¿","×","÷"," -","⸀-⹿"," -〿"]},createRegExp:function(b){var c="^[";for(var d in b)if(b.hasOwnProperty(d)){if(!(d in a._characterGroups))throw new Error("group "+d+" is not a valid character group");b[d]&&(c+=a._characterGroups[d].join(""))}return new RegExp("^["===c?"$^":c+"]*?$")},checkCharacterGroups:function(b,c){return a.createRegExp(c).test(b)},unicode:function(b,c){return a.checkCharacterGroups(b,Ink.extendObj({unicodeAlpha:!0},c))},latin1:function(b,c){return a.checkCharacterGroups(b,Ink.extendObj({latin1Alpha:!0},c))},ascii:function(b,c){return a.checkCharacterGroups(b,Ink.extendObj({asciiAlpha:!0},c))},number:function(b,c){b+="";var d=Ink.extendObj({decimalSep:".",thousandSep:"",negative:!0,decimalPlaces:null,maxDigits:null,max:null,min:null,returnNumber:!1},c||{});if(d.thousandSep)return b=b.replace(new RegExp("\\"+d.thousandSep,"g"),""),d.thousandSep="",a.number(b,d);if(d.negative===!1)return d.min=0,d.negative=!0,a.number(b,d);if("."!==d.decimalSep&&(b=b.replace(new RegExp("\\"+d.decimalSep,"g"),".")),!/^(-)?(\d+)?(\.\d+)?$/.test(b)||""===b)return!1;var e;if(d.decimalSep&&-1!==b.indexOf(d.decimalSep)){if(e=b.split(d.decimalSep),null!==d.decimalPlaces&&e[1].length>d.decimalPlaces)return!1}else e=[""+b,""];if(null!==d.maxDigits&&e[0].replace(/-/g,"").length>d.maxDigits)return e;var f=parseFloat(b);return null!==d.maxExcl&&f>=d.maxExcl||null!==d.minExcl&&f<=d.minExcl?!1:null!==d.max&&f>d.max||null!==d.min&&f=1&&12>=b&&c>=1&&this._daysInMonth(b,a)>=c?!0:!1},email:function(a){var b=new RegExp("^[_a-z0-9-]+((\\.|\\+)[_a-z0-9-]+)*@([\\w]*-?[\\w]*\\.)+[a-z]{2,4}$","i");return b.test(a)?!0:!1},mail:function(b){return a.email(b)},url:function(a,b){if("undefined"==typeof b||b===!1){var c=new RegExp("(^(http\\:\\/\\/|https\\:\\/\\/)(.+))","i");c.test(a)===!1&&(a="http://"+a)}var d=new RegExp("^(http:\\/\\/|https:\\/\\/)([\\w]*(-?[\\w]*)*\\.)+[a-z]{2,4}","i");return d.test(a)===!1?!1:!0},isPTPhone:function(a){a=a.toString();var b=[];for(var c in this._indicativosPT)"string"==typeof this._indicativosPT[c]&&b.push(c);var d=b.join("|"),e=/^(00351|\+351)/;e.test(a)&&(a=a.replace(e,""));var f=/(\s|\-|\.)+/g;a=a.replace(f,"");var g=/[\d]{9}/i;if(9===a.length&&g.test(a)){var h=new RegExp("^("+d+")");if(h.test(a))return!0}return!1},isPortuguesePhone:function(a){return this.isPTPhone(a)},isCVPhone:function(a){a=a.toString();var b=[];for(var c in this._indicativosCV)"string"==typeof this._indicativosCV[c]&&b.push(c);var d=b.join("|"),e=/^(00238|\+238)/;e.test(a)&&(a=a.replace(e,""));var f=/(\s|\-|\.)+/g;a=a.replace(f,"");var g=/[\d]{7}/i;if(7===a.length&&g.test(a)){var h=new RegExp("^("+d+")");if(h.test(a))return!0}return!1},isAOPhone:function(a){a=a.toString();var b=[];for(var c in this._indicativosAO)"string"==typeof this._indicativosAO[c]&&b.push(c);var d=b.join("|"),e=/^(00244|\+244)/;e.test(a)&&(a=a.replace(e,""));var f=/(\s|\-|\.)+/g;a=a.replace(f,"");var g=/[\d]{9}/i;if(9===a.length&&g.test(a)){var h=new RegExp("^("+d+")");if(h.test(a))return!0}return!1},isMZPhone:function(a){a=a.toString();var b=[];for(var c in this._indicativosMZ)"string"==typeof this._indicativosMZ[c]&&b.push(c);var d=b.join("|"),e=/^(00258|\+258)/;e.test(a)&&(a=a.replace(e,""));var f=/(\s|\-|\.)+/g;a=a.replace(f,"");var g=/[\d]{8,9}/i;if((9===a.length||8===a.length)&&g.test(a)){var h=new RegExp("^("+d+")");if(h.test(a)){if(0===a.indexOf("2")&&8===a.length)return!0;if(0===a.indexOf("8")&&9===a.length)return!0}}return!1},isTLPhone:function(a){a=a.toString();var b=[];for(var c in this._indicativosTL)"string"==typeof this._indicativosTL[c]&&b.push(c);var d=b.join("|"),e=/^(00670|\+670)/;e.test(a)&&(a=a.replace(e,""));var f=/(\s|\-|\.)+/g;a=a.replace(f,"");var g=/[\d]{7}/i;if(7===a.length&&g.test(a)){var h=new RegExp("^("+d+")");if(h.test(a))return!0}return!1},isPhone:function(){var a;if(0===arguments.length)return!1;var b=arguments[0];if(arguments.length>1){if(arguments[1].constructor!==Array){if("function"==typeof this["is"+arguments[1].toUpperCase()+"Phone"])return this["is"+arguments[1].toUpperCase()+"Phone"](b);throw"Invalid Country Code!"}var c;for(a=0;a=0&&b[j-1]<=100))return!1;c=!0}if(1===j||3===j||5===j&&("undefined"==typeof b[j+1]||""===b[j+1])){if(!("undefined"!=typeof b[j]&&b[j]>=0&&b[j]<=255))return!1;c=!0}}if(null!==(b=h.exec(a))||null!==(b=i.exec(a)))for(j=b.length;j--;){if(3===j||5===j){if(!("undefined"!=typeof b[j-1]&&"undefined"!=typeof b[j]&&""!==b[j]&&b[j-1]>=0&&b[j-1]<=100))return!1;c=!0}if(1===j){if(!("undefined"!=typeof b[j]&&b[j]>=0&&b[j]<=360))return!1;c=!0}}return c},isIP:function(a,b){if("string"!=typeof a)return!1;switch(b=(b||"ipv4").toLowerCase()){case"ipv4":return/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(a);case"ipv6":return/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/.test(a);default:return!1}},_creditCardSpecs:{"default":{length:"13,14,15,16,17,18,19",prefix:/^.+/,luhn:!0},"american express":{length:"15",prefix:/^3[47]/,luhn:!0},"diners club":{length:"14,16",prefix:/^36|55|30[0-5]/,luhn:!0},discover:{length:"16",prefix:/^6(?:5|011)/,luhn:!0},jcb:{length:"15,16",prefix:/^3|1800|2131/,luhn:!0},maestro:{length:"16,18",prefix:/^50(?:20|38)|6(?:304|759)/,luhn:!0},mastercard:{length:"16",prefix:/^5[1-5]/,luhn:!0},visa:{length:"13,16",prefix:/^4/,luhn:!0}},_luhn:function(a){if(a=parseInt(a,10),"number"!=typeof a&&a%1!==0)return!1;a+="";var b=a.length,c,d=0;for(c=b-1;c>=0;c-=2)d+=parseInt(a.substr(c,1),10);for(c=b-2;c>=0;c-=2){var e=parseInt(2*a.substr(c,1),10);d+=e>=10?e-9:e}return d%10===0},isCreditCard:function(a,b){if(/\d+/.test(a)===!1)return!1;if("undefined"==typeof b)b="default";else if(b instanceof Array){var c,d=b.length;for(c=0;d>c;c++)if(this.isCreditCard(a,b[c]))return!0;return!1}if(b=b.toLowerCase(),"undefined"==typeof this._creditCardSpecs[b])return!1;var e=a.length+"";return-1===this._creditCardSpecs[b].length.split(",").indexOf(e)?!1:this._creditCardSpecs[b].prefix.test(a)?this._creditCardSpecs[b].luhn===!1?!0:this._luhn(a):!1}};return a}); +//# sourceMappingURL=ink.min.map \ No newline at end of file diff --git a/public/js/ink.min.map b/public/js/ink.min.map new file mode 100644 index 0000000..68e5ceb --- /dev/null +++ b/public/js/ink.min.map @@ -0,0 +1 @@ +{"version":3,"file":"ink.min.js","sources":["../../src/js/Ink/1/lib.js","../../src/js/Ink/Net/Ajax/1/lib.js","../../src/js/Ink/Net/JsonP/1/lib.js","../../src/js/Ink/Dom/Browser/1/lib.js","../../src/js/Ink/Dom/Css/1/lib.js","../../src/js/Ink/Dom/Element/1/lib.js","../../src/js/Ink/Dom/Event/1/lib.js","../../src/js/Ink/Dom/FormSerialize/1/lib.js","../../src/js/Ink/Dom/Loaded/1/lib.js","../../src/js/Ink/Dom/Selector/1/lib.js","../../src/js/Ink/Util/Array/1/lib.js","../../src/js/Ink/Util/BinPack/1/lib.js","../../src/js/Ink/Util/Cookie/1/lib.js","../../src/js/Ink/Util/Date/1/lib.js","../../src/js/Ink/Util/Dumper/1/lib.js","../../src/js/Ink/Util/I18n/1/lib.js","../../src/js/Ink/Util/Json/1/lib.js","../../src/js/Ink/Util/String/1/lib.js","../../src/js/Ink/Util/Url/1/lib.js","../../src/js/Ink/Util/Validator/1/lib.js"],"names":["window","document","paths","modules","modulesLoadOrder","modulesRequested","pendingRMs","modulesWaitingForDeps","apply","Function","prototype","isEmptyObject","o","k","hasOwnProperty","Ink","VERSION","_checkPendingRequireModules","I","F","dep","mod","cb","pRMs","length","left","args","remaining","push","setTimeout","getPath","key","noLib","split","curKey","i","root","path","slice","join","test","setPath","rootURI","replace","loadScript","uri","contentType","indexOf","givenUri","this","Error","scriptEl","createElement","setAttribute","onerror","onreadystatechange","ev","event","type","readyState","error","aHead","getElementsByTagName","appendChild","_loadLater","namespace","ns","returnParentAndKey","levels","nsobj","parent","f","getModule","version","createModule","ver","deps","modFn","modAll","Array","call","arguments","moduleContent","_version","isInkModule","t","requireModules","cbFn","undefined","_moduleRenames","warn","Ink.UI.Aux_1","getModulesLoadOrder","getModuleScripts","mlo","unshift","map","m","getModuleURL","createExt","moduleName","dependencies","bind","fn","context","innerArgs","finalArgs","concat","bindMethod","object","methodName","bindEvent","id","getElementById","ss","rule","from","Dom","Selector","select","s","extendObj","destination","sources","len","property","Object","log","console","Ajax","url","options","init","globalOptions","parameters","requestHeaders","xMLHttpRequestWithCredentials","XMLHttpRequest","userOptions","asynchronous","method","timeout","delay","postBody","onComplete","onSuccess","onFailure","onException","onHeaders","onCreate","onInit","onTimeout","sanitizeJSON","evalJS","xhrProxy","cors","debug","useCredentials","signRequest","globalParameters","paramsObjToStr","safeCall","urlLocation","_locationFromURL","isHTTP","_locationIsHTTP","isCrossDomain","_locationIsCrossDomain","location","requestHasBody","search","transport","getTransport","request","createElementNS","href","protocol","match","widget","host","usingXDomainReq","XDomainRequest","ActiveXObject","e","setHeaders","headers","Accept","Accept-Language","navigator","language","X-Requested-With","X-Ink-Version","headerReqName","overrideMimeType","userAgent","Connection","headerName","setRequestHeader","optParams","p","a","params","toString","isNaN","encodeURIComponent","pop","setParams","getHeader","name","getResponseHeader","getAllHeaders","getAllResponseHeaders","getResponse","r","headerJSON","responseJSON","timeTaken","Date","startTime","requestedUrl","responseText","responseXML","status","statusText","abort","clearTimeout","delayTimeout","stoTimeout","ex","finish","runStateChange","rs","getTime","responseContent","response","curStatus","makeError","isSuccess","headerContentType","evalJSON","mimeType","xmlDoc","DOMParser","parseFromString","xml","destroy","listener","first","rethrow","exception","message","stacktrace","stack","value","nodeType","crossDomain","open","withCredentials","onload","send","code","isJSON","str","strJSON","sanitize","JSON","parse","eval","load","callback","ping","JsonP","failureObj","callbackParam","internalCallback","randVar","parseInt","Math","random","Net","_removeScriptTag","_addScriptTag","_addParamsToGet","hasQuestionMark","sep","pKey","pValue","parts","_getScriptContainer","headEls","scriptEls","rnd_seed","src","scriptCtn","_requestFailed","scriptUri","getAttribute","parentNode","removeChild","Browser","IE","GECKO","OPERA","SAFARI","KONQUEROR","CHROME","model","cssPrefix","domPrefix","detectBrowser","setDimensions","setReferrer","myWidth","myHeight","innerWidth","innerHeight","documentElement","clientWidth","clientHeight","body","windowWidth","windowHeight","referrer","escape","_sniffUserAgent","sAgent","toLowerCase","rVersion","re","RegExp","reVersion","alert","getCs","defaultView","getComputedStyle","Css","addRemoveClassName","elm","className","addRemState","addClassName","removeClassName","classList","add","hasClassName","remove","elmClassName","setClassName","all","has","contains","blinkClass","element","negate","Number","toggleClassName","forceAdd","toggle","setOpacity","val","style","opacity","filter","_camelCase","_","$1","toUpperCase","getStyle","currentStyle","charAt","css","parseFloat","setStyle","cssText","prop","styleFloat","cssFloat","show","forceDisplayProperty","display","hide","showHide","forceShow","_getRefTag","head","firstElementChild","child","firstChild","nextSibling","appendStyleTag","selector","force","styles","oldStyle","l","innerHTML","defStyle","refTag","styleStr","styleSheet","createTextNode","insertBefore","appendStylesheet","media","rel","_loadingCSSFiles","_loadedCSSFiles","appendStylesheetCb","cbs","linkEl","headEl","imgEl","_url","callbacks","decToHex","dec","normalizeTo2","rDec","gDec","g","bDec","b","rgb","hexToDec","hex","substr","getPropertyFromStylesheet","getRuleFromStylesheet","getPropertyFromStylesheet2","rules","getRulesFromStylesheet","x","sheet","ri","rf","styleSheets","si","sf","cssRules","selectorText","res","getPropertiesFromRule","props","steps","pre","pos","substring","borderTopLeftRadius","borderBottomRightRadius","borderTopRightRadius","borderBottomLeftRadius","changeFontSize","delta","op","minVal","maxVal","that","TypeError","el","els","fontSize","rect","elem","dimensions","getBoundingClientRect","top","offsetTop","offsetLeft","createContextualFragmentSupport","createRange","Range","createContextualFragment","deleteThisTbodyToken","browserCreatesTbodies","div","InkElement","isDOMElement","get","create","tag","properties","parEl","scrollTo","scrollIntoView","elmOffset","elmTop","elmLeft","offsetParent","y","offset","positionedOffset","valueTop","valueLeft","tagName","position","doc","ownerDocument","docElem","box","clientTop","clientLeft","scrollTop","pageYOffset","scrollLeft","pageXOffset","scroll","_getPropPx","cs","n","c","getPropertyValue","offset2","hasAttribute","attr","insertAfter","newElm","targetElm","insertTop","insertBottom","textContent","node","text","innerText","lastChild","childNodes","nodeValue","setTextContent","isLink","hasAttributeNS","isAncestorOf","ancestor","compareDocumentPosition","descendantOf","descendant","lastElementChild","previousSibling","nextElementSibling","sibling","previousElementSibling","elementWidth","offsetWidth","elementHeight","offsetHeight","elementLeft","elementTop","elementDimensions","outerDimensions","bbox","right","bottom","inViewport","opts","dims","partial","margin","viewportWidth","viewportHeight","isHidden","w","h","isVisible","clonePosition","cloneTo","cloneFrom","ellipsizeText","overflow","whiteSpace","textOverflow","findUpwardsHaving","boolTest","findUpwardsByClass","tst","cls","findUpwardsByTag","nodeName","findUpwardsById","findUpwardsBySelector","sel","matchesSelector","getChildrenText","removeIt","j","part","nodes","jLen","_trimString","String","data","trim","getSelectValues","selectEl","values","_normalizeData","d","data2","fillSelect","container","skipEmpty","defaultValue","containerEl","optionEl","fillRadios","insertAfterEl","splitEl","inputEl","checked","fillChecks","parentIndexOf","parentEl","childEl","idx","nextSiblings","elements","siblings","children","index","previousSiblings","childElementCount","_wrapElements","TABLE","html","TBODY","THEAD","TFOOT","TR","_getWrapper","wrapper","wrapFunc","tds","tbody","appendHTML","prependHTML","setHTML","wrap","target","nextNode","unwrap","wrapperSelector","replacement","replaceChild","removeTextNodeChildren","prevEl","toRemove","htmlToFragment","range","createDocumentFragment","selectNode","fragment","tempElement","current","InkDomSelector","dataset","attrs","attributes","curAttr","curAttrName","curAttrValue","total","moveCursorTo","setSelectionRange","createTextRange","collapse","moveEnd","moveStart","pageWidth","xScroll","scrollMaxX","scrollWidth","self","pageHeight","yScroll","scrollMaxY","scrollHeight","bean","definition","win","old","namespaceRegex","nameRegex","addEvent","removeEvent","W3C_MODEL","eventSupport","ONE","str2arr","isString","isFunction","standardNativeEvents","w3cNativeEvents","nativeEvents","hash","events","customEvents","isAncestor","check","related","relatedTarget","prefix","mouseenter","base","condition","mouseleave","mousewheel","Event","commonProps","mouseProps","mouseWheelProps","keyProps","textProps","touchProps","messageProps","stateProps","overOutRegex","typeFixers","reg","fix","newEvent","keyCode","which","rightClick","button","pageX","pageY","clientX","clientY","typeFixerMap","isNative","parentWindow","originalEvent","isBean","srcElement","fixer","preventDefault","returnValue","stopPropagation","cancelBubble","stop","stopped","stopImmediatePropagation","isImmediatePropagationStopped","clone","currentTarget","ne","targetElement","RegEntry","wrappedHandler","eargs","findTarget","eventElement","__beanDel","ft","handler","original","namespaces","customType","once","removeListener","eventType","inNamespaces","checkNamespaces","matches","checkElement","checkOriginal","checkHandler","registry","forAll","pfx","list","entries","entry","put","del","splice","removed","selectorEngine","setSelectorEngine","querySelectorAll","rootListener","propertyName","listeners","custom","attachEvent","detachEvent","rm","originalFn","orgType","handlers","delegate","array","fireListener","evt","createEvent","dispatchEvent","fireEvent","createEventObject","off","typeSpec","isTypeStr","on","types","delfn","one","fire","names","beanDel","noConflict","cleanup","CollectGarbage","InkEvent","KEY_BACKSPACE","KEY_TAB","KEY_RETURN","KEY_ESC","KEY_SPACE","KEY_LEFT","KEY_UP","KEY_RIGHT","KEY_DOWN","KEY_DELETE","KEY_HOME","KEY_END","KEY_PAGEUP","KEY_PAGEDOWN","KEY_INSERT","throttle","func","wait","lastCall","throttled","now","timeDiff","delegationTarget","fromElement","toElement","findElement","elmTagName","observe","eventName","callBack","useCapture","addEventListener","observeOnce","onceBack","stopObserving","observeMulti","observeDelegated","cursor","Selector_1","removeEventListener","cancel","stopDefault","pointer","pointerX","pointerY","touches","isLeftClick","isRightClick","isMiddleClick","getCharFromKeyboardEvent","changeCasing","fromCharCode","shiftOn","shiftKey","InkArray","isArrayIsh","obj","isArray","toArray","FormSerialize","serialize","form","out","emptyArrayToken","pairs","asPairs","emptyArray","forEach","pair","_resultsInArray","emit","serializeEl","multiple","didEmit","thisOption","inputs","_isSerialized","fillIn","map2","_objToPairs","_fillInPairs","groupBy","reduce","_fillInOne","firstOne","firstNodeName","firstType","isSelectMulti","_fillInBoolean","min","checkAttr","input","isChecked","inArray","Loaded","_contexts","run","cbQueue","done","checkState","_checkState","poll","_poll","ael","rem","det","wet","csf","alreadyLoaded","frameElement","doScroll","where","_ready","rnative","createCache","cache","keys","Expr","cacheLength","shift","markFunction","expando","assert","Sizzle","results","seed","groups","nid","newContext","newSelector","preferredDoc","setDocument","documentIsHTML","rquickExpr","exec","support","getElementsByClassName","qsa","rbuggyQSA","tokenize","rescape","toSelector","rsibling","qsaError","removeAttribute","rtrim","siblingCheck","cur","diff","sourceIndex","MAX_NEGATIVE","createInputPseudo","createButtonPseudo","createPositionalPseudo","argument","matchIndexes","parseOnly","matched","tokens","soFar","preFilters","cached","tokenCache","preFilter","rcomma","rcombinators","matchExpr","addCombinator","matcher","combinator","dir","checkNonElements","doneName","outerCache","dirkey","dirruns","cachedruns","elementMatcher","matchers","condense","unmatched","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","elems","multipleContexts","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","relative","implicitRelative","matchContext","matchAnyContext","outermostContext","matcherFromGroupMatchers","elementMatchers","setMatchers","matcherCachedRuns","bySet","byElement","superMatcher","expandContext","setMatched","matchedCount","outermost","contextBackup","find","dirrunsUnique","uniqueSort","contexts","token","runescape","funescape","compile","setFilters","getText","isXML","recompare","sortInput","rbuggyMatches","classCache","compilerCache","hasDuplicate","sortOrder","strundefined","arr","push_native","whitespace","characterEncoding","identifier","operators","pseudos","rpseudo","ridentifier","ID","CLASS","NAME","TAG","ATTR","PSEUDO","CHILD","needsContext","rinputs","rheader","rattributeQuotes","escaped","high","createComment","getByName","pass","getElementsByName","sortDetached","div1","attrHandle","attrId","getAttributeNode","tmp","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","adown","bup","compare","aup","ap","bp","expr","ret","specified","msg","duplicates","detectDuplicates","sortStable","sort","selectors","createPseudo",">"," ","+","~","excess","unquoted","pattern","operator","result","what","last","simple","forward","ofType","nodeIndex","start","useCache","pseudo","not","lang","elemLang","focus","activeElement","hasFocus","tabIndex","enabled","disabled","selected","selectedIndex","empty","header","eq","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","group","filters","arrayProto","testedObject","outKey","item","latestGroup","initial","sortMulti","constructor","keyValue","aKeys","shuffle","tmp1","rnd","floor","each","filtered","some","intersect","arr1","arr2","shared","J","convert","unique","lastIndexOf","newArr","step","insert","rLen","output","iLen","Packer","fit","blocks","block","findNode","splitNode","used","down","GrowingPacker","growNode","canGrowDown","canGrowRight","shouldGrowRight","shouldGrowDown","growRight","growDown","sorts","area","max","height","msort","width","maxside","criteria","BinPack","binPack","bl","packer","sorter","dims2","fitted","unfitted","filled","Cookie","cookie","_Cookie","aCookie","aItem","decodeURIComponent","set","expires","domain","secure","sName","sExpires","sPath","sDomain","sSecure","oDate","sDate","valueOf","nDate","expiresString","toGMTString","portClean","cookieName","expiresDate","InkDate","_months","_m","_iMonth","month","janeiro","jan","fevereiro","fev","março","mar","abril","abr","maio","mai","junho","jun","julho","jul","agosto","ago","setembro","outubro","novembro","nov","dezembro","dez","_wDays","_d","_iWeek","week","segunda","seg","terça","ter","quarta","qua","quinta","qui","sexta","sex","sábado","sáb","domingo","dom","_daysInMonth","_y","nDays","format","_date","iFormat","escapeChar","jsDate","jsFirstDay","jsThisDay","jsHour","jsDay","getDate","getDay","suffixes","suffix","UTC","getFullYear","getMonth","jsYearStart","days","ceil","jsMonth","getYear","jsYear","getHours","jsMinute","getMinutes","jsSecond","getSeconds","getTimezoneOffset","jsMinZone","jsMinutes","jsDayName","jsMonthName","str_date","mList","objIndex","year","day","dayY","dayW","hour","hourD","sec","msec","ampm","diffM","diffH","date","pattr","_haveDatetime","_haveYear","_haveYDay","_haveDay","_haveMonth","_haveMonthDay","_haveOnlyDay","_haveWDay","_haveWeek","_haveWeekWDay","_haveOnlyWDay","_validDate","_noDate","_haveHour12","_haveHour24","_haveHour","_haveMin","_haveSec","_haveMSec","_haveMoreM","_haveMoreS","_haveDiffM","_haveDiffH","dList","gmt","aux","Dumper","_tab","_formatParam","param","formated","_outputFormat","_getTabs","numberOfTabs","tabs","_i","dim","_typeof","printDump","write","returnDump","alertDump","windowDump","dumperwindow","close","pattrText","funcOrVal","I18n","dict","testMode","append","_dicts","_dict","_testMode","_lang","_gLang","bool","getKey","gLang","langGlobal","_gDict","pars","isObj","$2","$3","ntext","strSin","strPlur","count","ordinal","num","lastDig","ordDict","exceptions","byLastDigit","alias","_gDicts","appendGlobal","twoDigits","function_call","cx","dateToISOString","toISOString","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","toFixed","InkJson","_nativeJSON","_convertToUnicode","_escape","theString","\b","\t","\n","\f","\r","\"","\\","charCodeAt","_toUnicode","unicodeString","inInt","theUnicode","_stringifyValue","isFinite","toJSON","arrayString","objectString","stringify","convertToUnicode","reviver","walk","holder","v","lastIndex","SyntaxError","InkUtilString","_chars","_entities","_accentedChars","_accentedRemovedChars","_htmlUnsafeChars","<","&","'","ucFirst","string","firstWordOnly","replacer","stripTags","allowed","aAllowed","aNewAllowed","cleanedTag","strAllowed","reAllowed","aFoundTags","htmlEntitiesEncode","htmlEntitiesDecode","$0","utf8Encode","utfstring","shortString","words","resultstr","truncateString","utf8Decode","c2","c3","removeAccentedChars","newString","substrCount","haystack","needle","htmlEscapeUnsafe","chars","normalizeWhitespace","toUnicode","unescape","es","hexNum","escapeText","txt","whiteList","txt2","C","escapedCharRegex","unescapeText","strcmp","str1","str2","packetize","maxLen","sz","Url","_keyStr","getUrl","genQueryString","getQueryString","aParams","queryStr","aQueryStr","pairVar","getAnchor","anchor","getAnchorString","anchorStr","aAnchorStr","parseUrl","aURL","scheme","query","re1","re2","re3","regPort","tmpHost1","port","tmpHost2","tmpUserPass","user","urlObj","frag","hostname","currentScriptElement","aScripts","curScript","_debug","Validator","_countryCodes","_internacionalPT","_indicativosPT",21,22,231,232,233,234,235,236,238,239,241,242,243,244,245,249,251,252,253,254,255,256,258,259,261,262,263,265,266,268,269,271,272,273,274,275,276,277,278,279,281,282,283,284,285,286,289,291,292,295,296,91,93,96,92,707,760,800,808,30,"_internacionalCV","_indicativosCV",2,95,97,98,99,"_internacionalAO","_indicativosAO","_internacionalMZ","_indicativosMZ",82,84,"_internacionalTL","_indicativosTL",3,7,"_characterGroups","numbers","asciiAlpha","latin1Alpha","unicodeAlpha","space","dash","underscore","nicknamePunctuation","singleLineWhitespace","newline","asciiPunctuation","latin1Punctuation","unicodePunctuation","createRegExp","checkCharacterGroups","unicode","latin1","ascii","number","numb","inOptions","decimalSep","thousandSep","negative","decimalPlaces","maxDigits","returnNumber","maxExcl","minExcl","_isLeapYear","yearRegExp","_dateParsers","yyyy-mm-dd","parser","yyyy/mm/dd","yy-mm-dd","yy/mm/dd","dd-mm-yyyy","dd/mm/yyyy","dd-mm-yy","dd/mm/yy","_isValidDate","validOneOrTwo","email","emailValido","mail","full","reHTTP","reUrl","isPTPhone","phone","aInd","strInd","re351","reSpecialChars","reInt","reValid","isPortuguesePhone","isCVPhone","re238","isAOPhone","re244","isMZPhone","re258","isTLPhone","re670","isPhone","codPostal","cp1","cp2","returnBothResults","cPostalSep","cPostal4","cPostal3","parserCPostal","cPostal","isDate","dateStr","yearIndex","monthIndex","dayIndex","dateParser","separator","isColor","valid","keyword","hexa","rgba","hsl","hsla","isIP","ipType","_creditCardSpecs","default","luhn","american express","diners club","discover","jcb","maestro","mastercard","visa","_luhn","checksum","dbl","isCreditCard","creditCardType","ccLength"],"mappings":"CAME,SAASA,EAAQC,GAEf,YAGA,MAAI,OAASD,IAAb,CASA,GAAIE,MACAC,KACAC,KACAC,KACAC,KACAC,KAEAC,EAAQC,SAASC,UAAUF,MAG3BG,EAAgB,SAASC,GAEzB,GAAiB,gBAANA,GAAkB,OAAO,CACpC,KAAK,GAAIC,KAAKD,GACV,GAAIA,EAAEE,eAAeD,GACjB,OAAO,CAGf,QAAO,EAOXb,GAAOe,KACHC,QAAS,QACTC,4BAA6B,WACzB,GAAIC,GAAGC,EAAGP,EAAGQ,EAAKC,EAAKC,EAAIC,IAC3B,KAAKL,EAAI,EAAGC,EAAIb,EAAWkB,OAAYL,EAAJD,IAASA,EAGxC,GAFAN,EAAIN,EAAWY,GAEf,CAEA,IAAKE,IAAOR,GAAEa,KACNb,EAAEa,KAAKX,eAAeM,KACtBC,EAAMlB,EAAQiB,GACVC,IACAT,EAAEc,KAAKd,EAAEa,KAAKL,IAASC,QAChBT,GAAEa,KAAKL,KACZR,EAAEe,WAKhB,IAAIf,EAAEe,UAAY,EACdJ,EAAKK,KAAKhB,OAET,CAED,GADAU,EAAKV,EAAEU,IACFA,EAAM,eACJV,GAAEU,GACTA,EAAGd,OAAM,EAAOI,EAAEc,OAI1BpB,EAAa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AAO,GAAOA,EAAM,EAAKA,EAI1C,MAAQD,GAAW,KAAO,GAW9BE,aAAc,SAAS1U,EAAK2U,GAExB,GAAK,MAAMtpD,KAAK20C,MAAS,EACrB,OAAO,CAGX,IAA+B,mBAAnB2U,GACRA,EAAiB,cAEhB,IAAKA,YAA0B/mD,OAAO,CACvC,GAAI5C,GAAG4pD,EAAWD,EAAetqD,MACjC,KAAMW,EAAE,EAAO4pD,EAAJ5pD,EAAcA,IAErB,GAAIc,KAAK4oD,aAAa1U,EAAK2U,EAAe3pD,IACtC,OAAO,CAIf,QAAO,EAMX,GAFA2pD,EAAiBA,EAAex3C,cAEsB,mBAA1CrR,MAAK+nD,iBAAiBc,GAC9B,OAAO,CAIX,IAAItqD,GAAS21C,EAAI31C,OAAO,EAGxB,OAAoF,KAA/EyB,KAAK+nD,iBAAiBc,GAAwB,OAAE7pD,MAAM,KAAKc,QAAQvB,IAC7D,EAILyB,KAAK+nD,iBAAiBc,GAAwB,OAAEtpD,KAAK20C,GAKvDl0C,KAAK+nD,iBAAiBc,GAAsB,QAAM,GAC3C,EAGJ7oD,KAAKyoD,MAAMvU,IARP,GAYnB,OAAO+I","sourcesContent":["/**\n * Ink Core.\n * @module Ink_1\n * This module provides the necessary methods to create and load the modules using Ink.\n */\n\n;(function(window, document) {\n\n 'use strict';\n\n // skip redefinition of Ink core\n if ('Ink' in window) { return; }\n\n\n // internal data\n\n /*\n * NOTE:\n * invoke Ink.setPath('Ink', '/Ink/'); before requiring local modules\n */\n var paths = {};\n var modules = {};\n var modulesLoadOrder = [];\n var modulesRequested = {};\n var pendingRMs = [];\n var modulesWaitingForDeps = {};\n\n var apply = Function.prototype.apply;\n\n // auxiliary fns\n var isEmptyObject = function(o) {\n /*jshint unused:false */\n if (typeof o !== 'object') { return false; }\n for (var k in o) {\n if (o.hasOwnProperty(k)) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * @namespace Ink_1\n */\n\n window.Ink = {\n VERSION: '3.0.5',\n _checkPendingRequireModules: function() {\n var I, F, o, dep, mod, cb, pRMs = [];\n for (I = 0, F = pendingRMs.length; I < F; ++I) {\n o = pendingRMs[I];\n\n if (!o) { continue; }\n\n for (dep in o.left) {\n if (o.left.hasOwnProperty(dep)) {\n mod = modules[dep];\n if (mod) {\n o.args[o.left[dep] ] = mod;\n delete o.left[dep];\n --o.remaining;\n }\n }\n }\n\n if (o.remaining > 0) {\n pRMs.push(o);\n }\n else {\n cb = o.cb;\n if (!cb) { continue; }\n delete o.cb; // to make sure I won't call this more than once!\n cb.apply(false, o.args);\n }\n }\n\n pendingRMs = pRMs;\n\n if (pendingRMs.length > 0) {\n setTimeout( function() { Ink._checkPendingRequireModules(); }, 0 );\n }\n },\n\n /**\n * Get the full path of a module.\n * This method looks up the paths given in setPath (and ultimately the default Ink's path).\n *\n * @method getPath\n * @param {String} key Name of the module you want to get the path\n * @param {Boolean} [noLib] Flag to skip appending 'lib.js' to the returned path.\n */\n getPath: function(key, noLib) {\n var split = key.split(/[._]/g);\n var curKey;\n var i;\n var root;\n var path;\n\n // Look for Ink.Dom.Element.1, Ink.Dom.Element, Ink.Dom, Ink in this order.\n for (i = split.length; i >= 0; i -= 1) {\n curKey = split.slice(0, i + 1).join('.'); // See comment in setPath\n if (paths[curKey]) {\n root = curKey;\n break;\n }\n }\n\n if (root in paths) {\n path = paths[root];\n } else {\n return null;\n }\n\n if (!/\\/$/.test(path)) {\n path += '/';\n }\n if (i < split.length) {\n // Add the rest of the path. For example, if we found\n // paths['Ink.Dom'] to be 'http://example.com/Ink/Dom/',\n // we now add '/Element/' to get the full path.\n path += split.slice(i + 1).join('/') + '/';\n }\n if (!noLib) {\n path += 'lib.js';\n }\n return path;\n },\n \n /**\n * Sets the URL path for a namespace.\n * Use this to customize where requireModules and createModule will load dependencies from.\n * This can be useful to set your own CDN for dynamic module loading or simply to change your module folder structure\n * \n * @method setPath\n *\n * @param {String} key Module or namespace\n * @param {String} rootURI Base URL path and schema to be appended to the module or namespace\n *\n * @example\n * Ink.setPath('Ink', 'http://my-cdn/Ink/');\n * Ink.setPath('Lol', 'http://my-cdn/Lol/');\n *\n * // Loads from http://my-cdn/Ink/Dom/Whatever/lib.js\n * Ink.requireModules(['Ink.Dom.Whatever'], function () { ... });\n * // Loads from http://my-cdn/Lol/Whatever/lib.js\n * Ink.requireModules(['Lol.Whatever'], function () { ... });\n */\n setPath: function(key, rootURI) {\n // Replacing version separator with dot because the difference\n // between a submodule and a version doesn't matter here.\n // It would also overcomplicate the implementation of getPath\n paths[key.replace(/_/, '.')] = rootURI;\n },\n\n /**\n * Loads a script URL.\n * This creates a `script` tag in the `head` of the document.\n * Reports errors by listening to 'error' and 'readystatechange' events.\n *\n * @method loadScript\n * @param {String} uri Can be an external URL or a module name\n * @param {String} [contentType]='text/javascript' The `type` attribute of the new script tag.\n */\n loadScript: function(uri, contentType) {\n /*jshint evil:true */\n\n if (uri.indexOf('/') === -1) {\n var givenUri = uri; // For the error message\n uri = this.getPath(uri);\n if (uri === null) {\n throw new Error('Could not load script \"' + givenUri + '\". ' +\n 'Path not found in the registry. Did you misspell ' +\n 'the name, or forgot to call setPath()?');\n }\n }\n\n var scriptEl = document.createElement('script');\n scriptEl.setAttribute('type', contentType || 'text/javascript');\n scriptEl.setAttribute('src', uri);\n\n scriptEl.onerror = scriptEl.onreadystatechange = function (ev) {\n ev = ev || window.event;\n if (ev.type === 'readystatechange' && scriptEl.readyState !== 'loaded') {\n // if not readyState == 'loaded' it's not an error.\n return;\n }\n Ink.error(['Failed to load script from ', uri, '.'].join(''));\n };\n // CHECK ON ALL BROWSERS\n /*if (document.readyState !== 'complete' && !document.body) {\n document.write( scriptEl.outerHTML );\n }\n else {*/\n var aHead = document.getElementsByTagName('head');\n if(aHead.length > 0) {\n aHead[0].appendChild(scriptEl);\n }\n //}\n },\n\n _loadLater: function (dep) {\n setTimeout(function () {\n if (modules[dep] || modulesRequested[dep] ||\n modulesWaitingForDeps[dep]) {\n return;\n }\n modulesRequested[dep] = true;\n Ink.loadScript(dep);\n }, 0);\n },\n\n /**\n * Defines a module namespace.\n *\n * @method namespace\n * @param {String} ns Namespace to define.\n * @param {Boolean} [returnParentAndKey] Flag to change the return value to an array containing the namespace parent and the namespace key\n * @return {Object|Array} Returns the created namespace object\n */\n namespace: function(ns, returnParentAndKey) {\n if (!ns || !ns.length) { return null; }\n\n var levels = ns.split('.');\n var nsobj = window;\n var parent;\n\n for (var i = 0, f = levels.length; i < f; ++i) {\n nsobj[ levels[i] ] = nsobj[ levels[i] ] || {};\n parent = nsobj;\n nsobj = nsobj[ levels[i] ];\n }\n\n if (returnParentAndKey) {\n return [\n parent,\n levels[i-1]\n ];\n }\n\n return nsobj;\n },\n\n /**\n * Loads a module.\n * A synchronous method to get the module from the internal registry.\n * It assumes the module is defined and loaded already!\n *\n * @method getModule\n * @param {String} mod Module name\n * @param {Number} [version] Version number of the module\n * @return {Object|Function} Module object or function, depending how the module is defined\n */\n getModule: function(mod, version) {\n var key = version ? [mod, '_', version].join('') : mod;\n return modules[key];\n },\n\n /**\n * Creates a new module. \n * Use this to wrap your code and benefit from the module loading used throughout the Ink library\n *\n * @method createModule\n * @param {String} mod Module name, separated by dots. Like Ink.Dom.Selector, Ink.UI.Modal\n * @param {Number} version Version number\n * @param {Array} deps Array of module names which are dependencies of the module being created. The order in which they are passed here will define the order they will be passed to the callback function.\n * @param {Function} modFn The callback function to be executed when all the dependencies are resolved. The dependencies are passed as arguments, in the same order they were declared. The function itself should return the module.\n * @sample Ink_1_createModule.html \n *\n */\n createModule: function(mod, ver, deps, modFn) { // define\n if (typeof mod !== 'string') {\n throw new Error('module name must be a string!');\n }\n\n // validate version correctness\n if (!(typeof ver === 'number' || (typeof ver === 'string' && ver.length > 0))) {\n throw new Error('version number missing!');\n }\n\n var modAll = [mod, '_', ver].join('');\n\n modulesWaitingForDeps[modAll] = true;\n\n var cb = function() {\n //console.log(['createModule(', mod, ', ', ver, ', [', deps.join(', '), '], ', !!modFn, ')'].join(''));\n\n // make sure module in not loaded twice\n if (modules[modAll]) {\n //console.warn(['Ink.createModule ', modAll, ': module has been defined already.'].join(''));\n return;\n }\n\n\n // delete related pending tasks\n delete modulesRequested[modAll];\n delete modulesRequested[mod];\n\n\n // run module's supplied factory\n var args = Array.prototype.slice.call(arguments);\n var moduleContent = modFn.apply(window, args);\n modulesLoadOrder.push(modAll);\n // console.log('** loaded module ' + modAll + '**');\n\n\n // set version\n if (typeof moduleContent === 'object') { // Dom.Css Dom.Event\n moduleContent._version = ver;\n }\n else if (typeof moduleContent === 'function') {\n moduleContent.prototype._version = ver; // if constructor\n moduleContent._version = ver; // if regular function\n }\n\n\n // add to global namespace...\n var isInkModule = mod.indexOf('Ink.') === 0;\n var t;\n if (isInkModule) {\n t = Ink.namespace(mod, true); // for mod 'Ink.Dom.Css', t[0] gets 'Ink.Dom' object and t[1] 'Css'\n }\n\n\n // versioned\n modules[ modAll ] = moduleContent; // in modules\n delete modulesWaitingForDeps[ modAll ];\n\n if (isInkModule) {\n t[0][ t[1] + '_' + ver ] = moduleContent; // in namespace\n }\n\n\n // unversioned\n modules[ mod ] = moduleContent; // in modules\n\n if (isInkModule) {\n if (isEmptyObject( t[0][ t[1] ] )) {\n t[0][ t[1] ] = moduleContent; // in namespace\n }\n // else {\n // console.warn(['Ink.createModule ', modAll, ': module has been defined already with a different version!'].join(''));\n // }\n }\n\n\n if (this) { // there may be pending requires expecting this module, check...\n Ink._checkPendingRequireModules();\n }\n };\n\n this.requireModules(deps, cb);\n },\n\n /**\n * Requires modules asynchronously \n * Use this to get modules, even if they're not loaded yet\n *\n * @method requireModules\n * @param {Array} deps Array of module names. The order in which they are passed here will define the order they will be passed to the callback function. \n * @param {Function} cbFn The callback function to be executed when all the dependencies are resolved. The dependencies are passed as arguments, in the same order they were declared.\n * @sample Ink_1_requireModules.html \n */\n requireModules: function(deps, cbFn) { // require\n //console.log(['requireModules([', deps.join(', '), '], ', !!cbFn, ')'].join(''));\n var i, f, o, dep, mod;\n f = deps && deps.length;\n o = {\n args: new Array(f),\n left: {},\n remaining: f,\n cb: cbFn\n };\n\n if (!(typeof deps === 'object' && deps.length !== undefined)) {\n throw new Error('Dependency list should be an array!');\n }\n if (typeof cbFn !== 'function') {\n throw new Error('Callback should be a function!');\n }\n\n for (i = 0; i < f; ++i) {\n if (Ink._moduleRenames[deps[i]]) {\n Ink.warn(deps[i] + ' was renamed to ' + Ink._moduleRenames[deps[i]]);\n dep = Ink._moduleRenames[deps[i]];\n } else {\n dep = deps[i];\n }\n\n // Because trailing commas in oldIE bring us undefined values here\n if (!dep) {\n --o.remaining;\n continue;\n }\n\n mod = modules[dep];\n if (mod) {\n o.args[i] = mod;\n --o.remaining;\n continue;\n }\n else if (!modulesRequested[dep]) {\n Ink._loadLater(dep);\n }\n o.left[dep] = i;\n }\n\n if (o.remaining > 0) {\n pendingRMs.push(o);\n }\n else {\n cbFn.apply(true, o.args);\n }\n },\n\n _moduleRenames: {\n 'Ink.UI.Aux_1': 'Ink.UI.Common_1'\n },\n\n /**\n * Lists loaded module names.\n * The list is ordered by loaded time (oldest module comes first)\n *\n * @method getModulesLoadOrder\n * @return {Array} returns the order in which modules were resolved and correctly loaded\n */\n getModulesLoadOrder: function() {\n return modulesLoadOrder.slice();\n },\n\n /**\n * Builds the markup needed to load the modules.\n * This method builds the script tags needed to load the currently used modules\n * \n * @method getModuleScripts\n * @uses getModulesLoadOrder\n * @return {String} The script markup\n */\n getModuleScripts: function() {\n var mlo = this.getModulesLoadOrder();\n mlo.unshift('Ink_1');\n mlo = mlo.map(function(m) {\n return [''].join('');\n });\n\n return mlo.join('\\n');\n },\n \n /**\n * Creates an Ink.Ext module\n *\n * Does exactly the same as createModule but creates the module in the Ink.Ext namespace\n *\n * @method createExt\n * @uses createModule\n * @param {String} moduleName Extension name\n * @param {String} version Extension version\n * @param {Array} dependencies Extension dependencies\n * @param {Function} modFn Function returning the extension\n * @sample Ink_1_createExt.html \n */\n createExt: function (moduleName, version, dependencies, modFn) {\n return Ink.createModule('Ink.Ext.' + moduleName, version, dependencies, modFn);\n },\n\n /**\n * Function.prototype.bind alternative.\n * Creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.\n *\n * @method bind\n * @param {Function} fn The function \n * @param {Object} context The value to be passed as the this parameter to the target function when the bound function is called. If used as false, it preserves the original context and just binds the arguments.\n * @param {Any} [args*] Additional arguments will be sent to the original function as prefix arguments.\n * @return {Function}\n * @sample Ink_1_bind.html \n */\n bind: function(fn, context) {\n var args = Array.prototype.slice.call(arguments, 2);\n return function() {\n var innerArgs = Array.prototype.slice.call(arguments);\n var finalArgs = args.concat(innerArgs);\n return fn.apply(context === false ? this : context, finalArgs);\n };\n },\n\n /**\n * Function.prototype.bind alternative for class methods\n * Creates a new function that, when called, has this k\n * @method bindMethod\n * @uses bind\n * @param {Object} object The object that contains the method to bind\n * @param {String} methodName The name of the method that will be bound\n * @param {Any} [args*] Additional arguments will be sent to the new method as prefix arguments.\n * @return {Function}\n * @sample Ink_1_bindMethod.html \n */\n bindMethod: function (object, methodName) {\n return Ink.bind.apply(Ink,\n [object[methodName], object].concat([].slice.call(arguments, 2)));\n },\n\n /**\n * Function.prototype.bind alternative for event handlers.\n * Same as bind but keeps first argument of the call the original event.\n * Set \"context\" to `false` to preserve the original context of the function and just bind the arguments.\n *\n * @method bindEvent\n * @param {Function} fn The function \n * @param {Object} context The value to be passed as the this parameter to the target \n * @param {Any} [args*] Additional arguments will be sent to the original function as prefix arguments\n * @return {Function}\n * @sample Ink_1_bindEvent.html \n */\n bindEvent: function(fn, context) {\n var args = Array.prototype.slice.call(arguments, 2);\n return function(event) {\n var finalArgs = args.slice();\n finalArgs.unshift(event || window.event);\n return fn.apply(context === false ? this : context, finalArgs);\n };\n },\n\n /**\n * Alias to document.getElementById\n *\n * @method i\n * @param {String} id Element ID\n * @return {DOMElement}\n * @sample Ink_1_i.html \n */\n i: function(id) {\n if(!id) {\n throw new Error('Ink.i => id or element must be passed');\n }\n if(typeof(id) === 'string') {\n return document.getElementById(id);\n }\n return id;\n },\n\n /**\n * Alias for Ink.Dom.Selector\n *\n * @method ss\n * @uses Ink.Dom.Selector.select\n * @param {String} rule\n * @param {DOMElement} [from]\n * @return {Array} array of DOMElements\n * @sample Ink_1_ss.html \n */\n ss: function(rule, from)\n {\n if(typeof(Ink.Dom) === 'undefined' || typeof(Ink.Dom.Selector) === 'undefined') {\n throw new Error('This method requires Ink.Dom.Selector');\n }\n return Ink.Dom.Selector.select(rule, (from || document));\n },\n\n /**\n * Alias for Ink.Dom.Selector first result\n *\n * @method s\n * @uses Ink.Dom.Selector.select\n * @param {String} rule Selector string\n * @param {DOMElement} [from] Context element. If set to a DOM element, the rule will only look for descendants of this DOM Element.\n * @return {DOMElement}\n * @sample Ink_1_s.html \n */\n s: function(rule, from)\n {\n if(typeof(Ink.Dom) === 'undefined' || typeof(Ink.Dom.Selector) === 'undefined') {\n throw new Error('This method requires Ink.Dom.Selector');\n }\n return Ink.Dom.Selector.select(rule, (from || document))[0] || null;\n },\n\n /**\n * Extends an object with another\n * Copy all of the properties in one or more source objects over to the destination object, and return the destination object. It's in-order, so the last source will override properties of the same name in previous arguments.\n *\n * @method extendObj\n * @param {Object} destination The object that will receive the new/updated properties\n * @param {Object} source The object whose properties will be copied over to the destination object\n * @param {Object} [args*] Additional source objects. The last source will override properties of the same name in the previous defined sources\n * @return destination object, enriched with defaults from the sources\n * @sample Ink_1_extendObj.html \n */\n extendObj: function(destination/*, source... */) {\n var sources = [].slice.call(arguments, 1);\n\n for (var i = 0, len = sources.length; i < len; i++) {\n if (!sources[i]) { continue; }\n for (var property in sources[i]) {\n if(Object.prototype.hasOwnProperty.call(sources[i], property)) {\n destination[property] = sources[i][property];\n }\n }\n }\n\n return destination;\n },\n\n /**\n * Calls native console.log if available.\n *\n * @method log\n * @param {Any} [args*] Arguments to be evaluated\n * @sample Ink_1_log.html \n **/\n log: function () {\n // IE does not have console.log.apply in IE10 emulated mode\n var console = window.console;\n if (console && console.log) {\n apply.call(console.log, console, arguments);\n }\n },\n\n /**\n * Calls native console.warn if available.\n *\n * @method warn\n * @param {Any} [args*] Arguments to be evaluated\n * @sample Ink_1_warn.html \n **/\n warn: function () {\n // IE does not have console.log.apply in IE10 emulated mode\n var console = window.console;\n if (console && console.warn) {\n apply.call(console.warn, console, arguments);\n }\n },\n\n /**\n * Calls native console.error if available.\n *\n * @method error\n * @param {Any} [args*] Arguments to be evaluated\n * @sample Ink_1_error.html \n **/\n error: function () {\n // IE does not have console.log.apply in IE10 emulated mode\n var console = window.console;\n if (console && console.error) {\n apply.call(console.error, console, arguments);\n }\n }\n };\n\n\n // TODO for debug - to detect pending stuff\n /*\n var failCount = {}; // fail count per module name\n var maxFails = 3; // times\n var checkDelta = 0.5; //seconds\n\n var tmpTmr = setInterval(function() {\n var mk = Object.keys(modulesRequested);\n var l = mk.length;\n\n if (l > 0) {\n // console.log('** waiting for modules: ' + mk.join(', ') + ' **');\n\n for (var i = 0, f = mk.length, k, v; i < f; ++i) {\n k = mk[i];\n v = failCount[k];\n failCount[k] = (v === undefined) ? 1 : ++v;\n\n if (v >= maxFails) {\n console.error('** Loading of module ' + k + ' failed! **');\n delete modulesRequested[k];\n }\n }\n }\n else {\n // console.log('** Module loads complete. **');\n clearInterval(tmpTmr);\n }\n }, checkDelta*1000);\n */\n}(window, document));\n","/**\n * Cross Browser Ajax requests\n * @module Ink.Net.Ajax_1\n * @version 1\n */\n\nInk.createModule('Ink.Net.Ajax', '1', [], function() {\n\n 'use strict';\n\n /**\n * Creates a new XMLHttpRequest object\n *\n * @class Ink.Net.Ajax\n * @constructor\n *\n * @param {String} url Request URL\n * @param {Object} options Request options\n * @param {Boolean} [options.asynchronous]=true If false, the request synchronous.\n * @param {Boolean} [options.cors] Flag to activate CORS. Set this to true if you're doing a cross-origin request\n * @param {String} [options.method]='POST' HTTP request method. POST by default.\n * @param {Object|String} [options.parameters] Request parameters to be sent with the request\n * @param {Number} [options.timeout] Request timeout in seconds\n * @param {Number} [options.delay] Artificial delay. If the request is completed faster than this delay, wait the remaining time before executing the callbacks\n * @param {String} [options.postBody] POST request body. If not specified, it's filled with the contents from parameters\n * @param {String} [options.contentType] Content-type header to be sent. Defaults to 'application/x-www-form-urlencoded'\n * @param {Object} [options.requestHeaders] Key-value pairs for additional request headers\n * @param {Function} [options.onComplete] Callback executed after the request is completed, regardless of what happened during the request.\n * @param {Function} [options.onSuccess] Callback executed if the request is successful (requests with 2xx status codes)\n * @param {Function} [options.onFailure] Callback executed if the request fails (requests with status codes different from 2xx)\n * @param {Function} [options.onException] Callback executed if an exception occurs. Receives the exception as a parameter.\n * @param {Function} [options.onCreate] Callback executed after object initialization but before the request is made\n * @param {Function} [options.onInit] Callback executed before any initialization\n * @param {Function} [options.onTimeout] Callback executed if the request times out\n * @param {Boolean|String} [options.evalJS]=true If the request Content-type header is application/json, evaluates the response and populates responseJSON. Use 'force' if you want to force the response evaluation, no matter what Content-type it's using.\n * @param {Boolean} [options.sanitizeJSON] Flag to sanitize the content of responseText before evaluation\n * @param {String} [options.xhrProxy] URI for proxy service hosted on the same server as the web app, that can fetch documents from other domains. The service must pipe all input and output untouched (some input sanitization is allowed, like clearing cookies). e.g., requesting http://example.org/doc can become /proxy/http%3A%2F%2Fexample.org%2Fdoc The proxy service will be used for cross-domain requests, if set, else a network error is returned as exception.\n *\n * @sample Ink_Net_Ajax_1.html \n */\n var Ajax = function(url, options){\n\n // start of AjaxMock patch - uncomment to enable it\n /*var AM = SAPO.Communication.AjaxMock;\n if (AM && !options.inMock) {\n if (AM.autoRecordThisUrl && AM.autoRecordThisUrl(url)) {\n return new AM.Record(url, options);\n }\n if (AM.mockThisUrl && AM.mockThisUrl(url)) {\n return new AM.Play(url, options, true);\n }\n }*/\n // end of AjaxMock patch\n\n this.init(url, options);\n };\n\n /**\n * Options for all requests. These can then be overriden for individual ones.\n */\n Ajax.globalOptions = {\n parameters: {},\n requestHeaders: {}\n };\n\n\n // IE10 does not need XDomainRequest\n var xMLHttpRequestWithCredentials = 'XMLHttpRequest' in window && 'withCredentials' in (new XMLHttpRequest());\n\n\n\n Ajax.prototype = {\n\n init: function(url, userOptions) {\n if (!url) {\n throw new Error(\"WRONG_ARGUMENTS_ERR\");\n }\n var options = Ink.extendObj({\n asynchronous: true,\n method: 'POST',\n parameters: null,\n timeout: 0,\n delay: 0,\n postBody: '',\n contentType: 'application/x-www-form-urlencoded',\n requestHeaders: null,\n onComplete: null,\n onSuccess: null,\n onFailure: null,\n onException: null,\n onHeaders: null,\n onCreate: null,\n onInit: null,\n onTimeout: null,\n sanitizeJSON: false,\n evalJS: true,\n xhrProxy: '',\n cors: false,\n debug: false,\n useCredentials: false,\n signRequest: false\n }, Ajax.globalOptions);\n\n if (userOptions && typeof userOptions === 'object') {\n options = Ink.extendObj(options, userOptions);\n\n\n if (typeof userOptions.parameters === 'object') {\n options.parameters = Ink.extendObj(Ink.extendObj({}, Ajax.globalOptions.parameters), userOptions.parameters);\n } else if (userOptions.parameters !== null) {\n var globalParameters = this.paramsObjToStr(Ajax.globalOptions.parameters);\n if (globalParameters) {\n options.parameters = userOptions.parameters + '&' + globalParameters;\n }\n }\n\n options.requestHeaders = Ink.extendObj({}, Ajax.globalOptions.requestHeaders);\n options.requestHeaders = Ink.extendObj(options.requestHeaders, userOptions.requestHeaders);\n }\n\n this.options = options;\n\n this.safeCall('onInit');\n\n this.url = url;\n\n var urlLocation = this._locationFromURL(url);\n this.isHTTP = this._locationIsHTTP(urlLocation);\n this.isCrossDomain = this._locationIsCrossDomain(urlLocation, location);\n\n this.requestHasBody = options.method.search(/^get|head$/i) < 0;\n\n if(this.options.cors) {\n this.isCrossDomain = false;\n }\n\n this.transport = this.getTransport();\n\n this.request();\n },\n\n /**\n * Returns a location object from an URL\n *\n * @method _locationFromUrl\n * @param url\n * @private\n **/\n _locationFromURL: function (url) {\n var urlLocation = document.createElementNS ?\n document.createElementNS('http://www.w3.org/1999/xhtml', 'a') :\n document.createElement('a');\n urlLocation.href = url;\n return urlLocation;\n },\n\n /**\n * Checks whether a location is HTTP or HTTPS\n *\n * @method locationIsHttp\n * @param urlLocation\n * @private\n */\n _locationIsHTTP: function (urlLocation) {\n return urlLocation.protocol.match(/^https?:/i) ? true : false;\n },\n\n /**\n * Checks whether a location is cross-domain from another\n *\n * @method _locationIsCrossDomain\n * @param urlLocation {Location}\n * @param otherLocation {Location}\n */\n _locationIsCrossDomain: function (urlLocation, location) {\n location = location || window.location;\n if (!Ajax.prototype._locationIsHTTP(urlLocation) || location.protocol === 'widget:' || typeof window.widget === 'object') {\n return false;\n } else {\n return location.protocol !== urlLocation.protocol ||\n location.host.split(':')[0] !== urlLocation.host.split(':')[0];\n }\n },\n\n /**\n * Creates the appropriate XMLHttpRequest object\n *\n * @method getTransport\n * @return {Object} XMLHttpRequest object\n */\n getTransport: function()\n {\n /*global XDomainRequest:false, ActiveXObject:false */\n if (!xMLHttpRequestWithCredentials && this.options.cors && 'XDomainRequest' in window) {\n this.usingXDomainReq = true;\n return new XDomainRequest();\n }\n else if (typeof XMLHttpRequest !== 'undefined') {\n return new XMLHttpRequest();\n }\n else if (typeof ActiveXObject !== 'undefined') {\n try {\n return new ActiveXObject('Msxml2.XMLHTTP');\n } catch (e) {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n } else {\n return null;\n }\n },\n\n /**\n * Set the necessary headers for an ajax request\n *\n * @method setHeaders\n * @param {String} url The url for the request\n */\n setHeaders: function()\n {\n if (this.transport) {\n try {\n var headers = {\n \"Accept\": \"text/javascript,text/xml,application/xml,application/xhtml+xml,text/html,application/json;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1\",\n \"Accept-Language\": navigator.language,\n \"X-Requested-With\": \"XMLHttpRequest\",\n \"X-Ink-Version\": \"2\"\n };\n if (this.options.cors) {\n if (!this.options.signRequest) {\n delete headers['X-Requested-With'];\n }\n delete headers['X-Ink-Version'];\n }\n\n if (this.options.requestHeaders && typeof this.options.requestHeaders === 'object') {\n for(var headerReqName in this.options.requestHeaders) {\n if (this.options.requestHeaders.hasOwnProperty(headerReqName)) {\n headers[headerReqName] = this.options.requestHeaders[headerReqName];\n }\n }\n }\n\n if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\\/(\\d{4})/) || [0,2005])[1] < 2005) {\n headers.Connection = 'close';\n }\n\n for (var headerName in headers) {\n if(headers.hasOwnProperty(headerName)) {\n this.transport.setRequestHeader(headerName, headers[headerName]);\n }\n }\n } catch(e) {}\n }\n },\n\n /**\n * Converts an object with parameters to a querystring\n *\n * @method paramsObjToStr\n * @param {Object|String} optParams parameters object\n * @return {String} querystring\n */\n paramsObjToStr: function(optParams) {\n var k, m, p, a, params = [];\n if (typeof optParams === 'object') {\n for (p in optParams){\n if (optParams.hasOwnProperty(p)) {\n a = optParams[p];\n if (Object.prototype.toString.call(a) === '[object Array]' && !isNaN(a.length)) {\n for (k = 0, m = a.length; k < m; k++) {\n params = params.concat([\n encodeURIComponent(p), '[]', '=',\n encodeURIComponent(a[k]), '&'\n ]);\n }\n }\n else {\n params = params.concat([\n encodeURIComponent(p), '=',\n encodeURIComponent(a), '&'\n ]);\n }\n }\n }\n if (params.length > 0) {\n params.pop();\n }\n }\n else\n {\n return optParams;\n }\n return params.join('');\n },\n\n /**\n * Set the url parameters for a GET request\n *\n * @method setParams\n */\n setParams: function()\n {\n var params = null, optParams = this.options.parameters;\n\n if(typeof optParams === \"object\"){\n params = this.paramsObjToStr(optParams);\n } else {\n params = '' + optParams;\n }\n\n if(params){\n if(this.url.indexOf('?') > -1) {\n this.url = this.url.split('#')[0] + '&' + params;\n } else {\n this.url = this.url.split('#')[0] + '?' + params;\n }\n }\n },\n\n /**\n * Gets an HTTP header from the response\n *\n * @method getHeader\n * @param {String} name Header name\n * @return {String} header Content\n */\n getHeader: function(name)\n {\n if (this.usingXDomainReq && name === 'Content-Type') {\n return this.transport.contentType;\n }\n try{\n return this.transport.getResponseHeader(name);\n } catch(e) {\n return null;\n }\n },\n\n /**\n * Gets all the HTTP headers from the response\n *\n * @method getAllHeaders\n * @return {String} The headers, each separated by a newline\n */\n getAllHeaders: function()\n {\n try {\n return this.transport.getAllResponseHeaders();\n } catch(e) {\n return null;\n }\n },\n\n /**\n * Sets the response object\n *\n * @method getResponse\n * @return {Object} the response object\n */\n getResponse: function(){\n // setup our own stuff\n var t = this.transport,\n r = {\n headerJSON: null,\n responseJSON: null,\n getHeader: this.getHeader,\n getAllHeaders: this.getAllHeaders,\n request: this,\n transport: t,\n timeTaken: new Date() - this.startTime,\n requestedUrl: this.url\n };\n\n // setup things expected from the native object\n r.readyState = t.readyState;\n try { r.responseText = t.responseText; } catch(e) {}\n try { r.responseXML = t.responseXML; } catch(e) {}\n try { r.status = t.status; } catch(e) { r.status = 0; }\n try { r.statusText = t.statusText; } catch(e) { r.statusText = ''; }\n\n return r;\n },\n\n /**\n * Aborts the request if still running. No callbacks are called\n *\n * @method abort\n */\n abort: function(){\n if (this.transport) {\n clearTimeout(this.delayTimeout);\n clearTimeout(this.stoTimeout);\n try { this.transport.abort(); } catch(ex) {}\n this.finish();\n }\n },\n\n /**\n * Executes the state changing phase of an ajax request\n *\n * @method runStateChange\n */\n runStateChange: function()\n {\n var rs = this.transport.readyState;\n if (rs === 3) {\n if (this.isHTTP) {\n this.safeCall('onHeaders');\n }\n } else if (rs === 4 || this.usingXDomainReq) {\n\n if (this.options.asynchronous && this.options.delay && (this.startTime + this.options.delay > new Date().getTime())) {\n this.delayTimeout = setTimeout(Ink.bind(this.runStateChange, this), this.options.delay + this.startTime - new Date().getTime());\n return;\n }\n\n var responseJSON,\n responseContent = this.transport.responseText,\n response = this.getResponse(),\n curStatus = this.transport.status;\n\n if (this.isHTTP && !this.options.asynchronous) {\n this.safeCall('onHeaders');\n }\n\n clearTimeout(this.stoTimeout);\n\n if (curStatus === 0) {\n // Status 0 indicates network error for http requests.\n // For http less requests, 0 is always returned.\n if (this.isHTTP) {\n this.safeCall('onException', this.makeError(18, 'NETWORK_ERR'));\n } else {\n curStatus = responseContent ? 200 : 404;\n }\n }\n else if (curStatus === 304) {\n curStatus = 200;\n }\n var isSuccess = this.usingXDomainReq || 200 <= curStatus && curStatus < 300;\n\n var headerContentType = this.getHeader('Content-Type') || '';\n if (this.options.evalJS &&\n (headerContentType.indexOf(\"application/json\") >= 0 || this.options.evalJS === 'force')){\n try {\n responseJSON = this.evalJSON(responseContent, this.sanitizeJSON);\n if(responseJSON){\n responseContent = response.responseJSON = responseJSON;\n }\n } catch(e){\n if (isSuccess) {\n // If the request failed, then this is perhaps an error page\n // so don't notify error.\n this.safeCall('onException', e);\n }\n }\n }\n\n if (this.usingXDomainReq && headerContentType.indexOf('xml') !== -1 && 'DOMParser' in window) {\n // http://msdn.microsoft.com/en-us/library/ie/ff975278(v=vs.85).aspx\n var mimeType;\n switch (headerContentType) {\n case 'application/xml':\n case 'application/xhtml+xml':\n case 'image/svg+xml':\n mimeType = headerContentType;\n break;\n default:\n mimeType = 'text/xml';\n }\n var xmlDoc = (new DOMParser()).parseFromString( this.transport.responseText, mimeType);\n this.transport.responseXML = xmlDoc;\n response.responseXML = xmlDoc;\n }\n\n if (this.transport.responseXML !== null && response.responseJSON === null && this.transport.responseXML.xml !== \"\"){\n responseContent = this.transport.responseXML;\n }\n\n if (curStatus || this.usingXDomainReq) {\n if (isSuccess) {\n this.safeCall('onSuccess', response, responseContent);\n } else {\n this.safeCall('onFailure', response, responseContent);\n }\n this.safeCall('on'+curStatus, response, responseContent);\n }\n this.finish(response, responseContent);\n }\n },\n\n /**\n * Last step after XHR is complete. Call onComplete and cleanup object\n *\n * @method finish\n * @param {Any} response\n * @param {Any} responseContent\n */\n finish: function(response, responseContent){\n if (response) {\n this.safeCall('onComplete', response, responseContent);\n }\n clearTimeout(this.stoTimeout);\n\n if (this.transport) {\n // IE6 sometimes barfs on this one\n try{ this.transport.onreadystatechange = null; } catch(e){}\n\n if (typeof this.transport.destroy === 'function') {\n // Stuff for Samsung.\n this.transport.destroy();\n }\n\n // Let XHR be collected.\n this.transport = null;\n }\n },\n\n /**\n * Safely calls a callback function.\n * Verifies that the callback is well defined and traps errors\n *\n * @method safeCall\n * @param {Function} listener\n */\n safeCall: function(listener, first/*, second*/) {\n function rethrow(exception){\n setTimeout(function() {\n // Rethrow exception so it'll land in\n // the error console, firebug, whatever.\n if (exception.message) {\n exception.message += '\\n'+(exception.stacktrace || exception.stack || '');\n }\n throw exception;\n }, 1);\n }\n if (typeof this.options[listener] === 'function') {\n //SAPO.safeCall(this, this.options[listener], first, second);\n //return object[listener].apply(object, [].slice.call(arguments, 2));\n try {\n this.options[listener].apply(this, [].slice.call(arguments, 1));\n } catch(ex) {\n rethrow(ex);\n }\n } else if (first && window.Error && (first instanceof Error)) {\n rethrow(first);\n }\n },\n\n /**\n * Sets a new request header for the next http request\n *\n * @method setRequestHeader\n * @param {String} name\n * @param {String} value\n */\n setRequestHeader: function(name, value){\n if (!this.options.requestHeaders) {\n this.options.requestHeaders = {};\n }\n this.options.requestHeaders[name] = value;\n },\n\n /**\n * Executes the request\n *\n * @method request\n */\n request: function()\n {\n if(this.transport) {\n var params = null;\n if(this.requestHasBody) {\n if(this.options.postBody !== null && this.options.postBody !== '') {\n params = this.options.postBody;\n this.setParams();\n } else if (this.options.parameters !== null && this.options.parameters !== ''){\n params = this.options.parameters;\n }\n\n if (typeof params === \"object\" && !params.nodeType) {\n params = this.paramsObjToStr(params);\n } else if (typeof params !== \"object\" && params !== null){\n params = '' + params;\n }\n\n if(this.options.contentType) {\n this.setRequestHeader('Content-Type', this.options.contentType);\n }\n } else {\n this.setParams();\n }\n\n var url = this.url;\n var method = this.options.method;\n var crossDomain = this.isCrossDomain;\n\n if (crossDomain && this.options.xhrProxy) {\n this.setRequestHeader('X-Url', url);\n url = this.options.xhrProxy + encodeURIComponent(url);\n crossDomain = false;\n }\n\n try {\n this.transport.open(method, url, this.options.asynchronous);\n } catch(e) {\n this.safeCall('onException', e);\n return this.finish(this.getResponse(), null);\n }\n\n this.setHeaders();\n\n this.safeCall('onCreate');\n\n if(this.options.timeout && !isNaN(this.options.timeout)) {\n this.stoTimeout = setTimeout(Ink.bind(function() {\n if(this.options.onTimeout) {\n this.safeCall('onTimeout');\n this.abort();\n }\n }, this), (this.options.timeout * 1000));\n }\n\n if(this.options.useCredentials && !this.usingXDomainReq) {\n this.transport.withCredentials = true;\n }\n\n if(this.options.asynchronous && !this.usingXDomainReq) {\n this.transport.onreadystatechange = Ink.bind(this.runStateChange, this);\n }\n else if (this.usingXDomainReq) {\n this.transport.onload = Ink.bind(this.runStateChange, this);\n }\n\n try {\n if (crossDomain) {\n // Need explicit handling because Mozila aborts\n // the script and Chrome fails silently.per the spec\n throw this.makeError(18, 'NETWORK_ERR');\n } else {\n this.startTime = new Date().getTime();\n this.transport.send(params);\n }\n } catch(e) {\n this.safeCall('onException', e);\n return this.finish(this.getResponse(), null);\n }\n\n if(!this.options.asynchronous) {\n this.runStateChange();\n }\n }\n },\n\n /**\n * Returns a new exception object that can be thrown\n *\n * @method makeError\n * @param code Error Code\n * @param message Message\n * @returns {Object}\n */\n makeError: function(code, message){\n if (typeof Error !== 'function') {\n return {code: code, message: message};\n }\n var e = new Error(message);\n e.code = code;\n return e;\n },\n\n /**\n * Checks if a given string is valid JSON\n *\n * @method isJSON\n * @param {String} str String to be evaluated\n * @return {Boolean} True if the string is valid JSON\n */\n isJSON: function(str)\n {\n if (typeof str !== \"string\" || !str){ return false; }\n str = str.replace(/\\\\./g, '@').replace(/\"[^\"\\\\\\n\\r]*\"/g, '');\n return (/^[,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]*$/).test(str);\n },\n\n /**\n * Evaluates a given string as JSON\n *\n * @method evalJSON\n * @param {String} str String to be evaluated\n * @param {Boolean} sanitize Flag to sanitize the content\n * @return {Object} JSON content as an object\n */\n evalJSON: function(strJSON, sanitize)\n {\n if (strJSON && (!sanitize || this.isJSON(strJSON))) {\n try {\n if (typeof JSON !== \"undefined\" && typeof JSON.parse !== 'undefined'){\n return JSON.parse(strJSON);\n }\n /*jshint evil:true */\n return eval('(' + strJSON + ')');\n } catch(e) {\n throw new Error('ERROR: Bad JSON string...');\n }\n }\n return null;\n }\n };\n\n /**\n * Loads content from a given url through an XMLHttpRequest.\n *\n * Shortcut function for simple AJAX use cases. Works with JSON, XML and plain text.\n *\n * @method load\n * @param {String} url Request URL\n * @param {Function} callback Callback to be executed if the request is successful\n * @return {Object} XMLHttpRequest object\n *\n * @sample Ink_Net_Ajax_load.html \n */\n Ajax.load = function(url, callback){\n return new Ajax(url, {\n method: 'GET',\n onSuccess: function(response){\n callback(response.responseJSON || response.responseText, response);\n }\n });\n };\n\n /**\n * Loads content from a given url through an XMLHttpRequest.\n * Shortcut function for simple AJAX use cases.\n *\n * @method ping\n * @param {String} url Request url\n * @param {Function} callback Callback to be executed if the request is successful\n * @return {Object} XMLHttpRequest object\n */\n Ajax.ping = function(url, callback){\n return new Ajax(url, {\n method: 'HEAD',\n onSuccess: function(response){\n if (typeof callback === 'function'){\n callback(response);\n }\n }\n });\n };\n\n\n return Ajax;\n});\n","/**\n * Cross Browser JsonP requests\n * @module Ink.Net.JsonP_1\n * @version 1\n */\n\nInk.createModule('Ink.Net.JsonP', '1', [], function() {\n\n 'use strict';\n\n /**\n * Executes a JSONP request\n *\n * @class Ink.Net.JsonP\n * @constructor\n *\n * @param {String} uri Request URL\n * @param {Object} options Request options\n * @param {Function} options.onSuccess Success callback\n * @param {Function} [options.onFailure] Failure callback\n * @param {Object} [options.failureObj] Object to be passed as argument to failure callback\n * @param {Number} [options.timeout] Timeout for request fail, in seconds. defaults to 10\n * @param {Object} [options.params] Object with the parameters and respective values to unfold\n * @param {String} [options.callbackParam] Parameter to use as callback. defaults to 'jsoncallback'\n * @param {String} [options.internalCallback] Name of the callback function stored in the Ink.Net.JsonP object.\n * @param {String} [options.randVar] (Advanced, not recommended unless you know what you're doing) A string to append to the callback name. By default, generate a random number. Use an empty string if you already passed the correct name in the internalCallback option.\n *\n * @sample Ink_Net_JsonP_1.html \n */\n var JsonP = function(uri, options) {\n this.init(uri, options);\n };\n\n JsonP.prototype = {\n\n init: function(uri, options) {\n this.options = Ink.extendObj( {\n onSuccess: undefined,\n onFailure: undefined,\n failureObj: {},\n timeout: 10,\n params: {},\n callbackParam: 'jsoncallback',\n internalCallback: '_cb',\n randVar: false\n }, options || {});\n\n if(this.options.randVar !== false) {\n this.randVar = this.options.randVar;\n } else {\n this.randVar = parseInt(Math.random() * 100000, 10);\n }\n\n this.options.internalCallback += this.randVar;\n\n this.uri = uri;\n\n // prevent SAPO legacy onComplete - make it onSuccess\n if(typeof(this.options.onComplete) === 'function') {\n this.options.onSuccess = this.options.onComplete;\n }\n\n if (typeof this.uri !== 'string') {\n throw 'Please define an URI';\n }\n\n if (typeof this.options.onSuccess !== 'function') {\n throw 'please define a callback function on option onSuccess!';\n }\n\n Ink.Net.JsonP[this.options.internalCallback] = Ink.bind(function() {\n window.clearTimeout(this.timeout);\n delete window.Ink.Net.JsonP[this.options.internalCallback];\n this._removeScriptTag();\n this.options.onSuccess(arguments[0]);\n }, this);\n\n this._addScriptTag();\n },\n\n _addParamsToGet: function(uri, params) {\n var hasQuestionMark = uri.indexOf('?') !== -1;\n var sep, pKey, pValue, parts = [uri];\n\n for (pKey in params) {\n if (params.hasOwnProperty(pKey)) {\n if (!hasQuestionMark) { sep = '?'; hasQuestionMark = true; }\n else { sep = '&'; }\n pValue = params[pKey];\n if (typeof pValue !== 'number' && !pValue) { pValue = ''; }\n parts = parts.concat([sep, pKey, '=', encodeURIComponent(pValue)]);\n }\n }\n\n return parts.join('');\n },\n\n _getScriptContainer: function() {\n var headEls = document.getElementsByTagName('head');\n if (headEls.length === 0) {\n var scriptEls = document.getElementsByTagName('script');\n return scriptEls[0];\n }\n return headEls[0];\n },\n\n _addScriptTag: function() {\n // enrich options will callback and random seed\n this.options.params[this.options.callbackParam] = 'Ink.Net.JsonP.' + this.options.internalCallback;\n this.options.params.rnd_seed = this.randVar;\n this.uri = this._addParamsToGet(this.uri, this.options.params);\n // create script tag\n var scriptEl = document.createElement('script');\n scriptEl.type = 'text/javascript';\n scriptEl.src = this.uri;\n var scriptCtn = this._getScriptContainer();\n scriptCtn.appendChild(scriptEl);\n this.timeout = setTimeout(Ink.bind(this._requestFailed, this), (this.options.timeout * 1000));\n },\n\n _requestFailed : function () {\n delete Ink.Net.JsonP[this.options.internalCallback];\n this._removeScriptTag();\n if(typeof this.options.onFailure === 'function'){\n this.options.onFailure(this.options.failureObj);\n }\n },\n\n _removeScriptTag: function() {\n var scriptEl;\n var scriptEls = document.getElementsByTagName('script');\n var scriptUri;\n for (var i = 0, f = scriptEls.length; i < f; ++i) {\n scriptEl = scriptEls[i];\n scriptUri = scriptEl.getAttribute('src') || scriptEl.src;\n if (scriptUri !== null && scriptUri === this.uri) {\n scriptEl.parentNode.removeChild(scriptEl);\n return;\n }\n }\n }\n\n };\n\n return JsonP;\n\n});\n","/**\n * Browser Detection and User Agent sniffing\n * @module Ink.Dom.Browser_1\n * @version 1\n */\nInk.createModule('Ink.Dom.Browser', '1', [], function() {\n 'use strict'; \n\n /**\n * @namespace Ink.Dom.Browser\n * @version 1\n * @static\n * @example\n * \n */\n var Browser = {\n /**\n * True if the browser is Internet Explorer\n *\n * @property IE\n * @type {Boolean}\n * @public\n * @static\n */\n IE: false,\n\n /**\n * True if the browser is Gecko based\n *\n * @property GECKO\n * @type {Boolean}\n * @public\n * @static\n */\n GECKO: false,\n\n /**\n * True if the browser is Opera\n *\n * @property OPERA\n * @type {Boolean}\n * @public\n * @static\n */\n OPERA: false,\n\n /**\n * True if the browser is Safari\n *\n * @property SAFARI\n * @type {Boolean}\n * @public\n * @static\n */\n SAFARI: false,\n\n /**\n * True if the browser is Konqueror\n *\n * @property KONQUEROR\n * @type {Boolean}\n * @public\n * @static\n */\n KONQUEROR: false,\n\n /**\n * True if browser is Chrome\n *\n * @property CHROME\n * @type {Boolean}\n * @public\n * @static\n */\n CHROME: false,\n\n /**\n * The specific browser model.\n * False if it is unavailable.\n *\n * @property model\n * @type {Boolean|String}\n * @public\n * @static\n */\n model: false,\n\n /**\n * The browser version.\n * False if it is unavailable.\n *\n * @property version\n * @type {Boolean|String}\n * @public\n * @static\n */\n version: false,\n\n /**\n * The user agent string.\n * False if it is unavailable.\n *\n * @property userAgent\n * @type {Boolean|String}\n * @public\n * @static\n */\n userAgent: false,\n\n /**\n * The CSS prefix (-moz-, -webkit-, -ms-, ...)\n * False if it is unavailable \n *\n * @property cssPrefix \n * @type {Boolean|String}\n * @public \n * @static \n */\n cssPrefix: false, \n\n /**\n * The DOM prefix (Moz, Webkit, ms, ...)\n * False if it is unavailable \n * @property domPrefix \n * @type {Boolean|String}\n * @public \n * @static \n */\n domPrefix: false,\n\n /**\n * Initialization function for the Browser object.\n *\n * Is called automatically when this module is loaded, and calls setDimensions, setBrowser and setReferrer.\n *\n * @method init\n * @public\n */\n init: function() {\n this.detectBrowser();\n this.setDimensions();\n this.setReferrer();\n },\n\n /**\n * Retrieves and stores window dimensions in this object. Called automatically when this module is loaded.\n *\n * @method setDimensions\n * @public\n */\n setDimensions: function() {\n //this.windowWidth=window.innerWidth !== null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body !== null ? document.body.clientWidth : null;\n //this.windowHeight=window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;\n var myWidth = 0, myHeight = 0;\n if ( typeof window.innerWidth=== 'number' ) {\n myWidth = window.innerWidth;\n myHeight = window.innerHeight;\n } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {\n myWidth = document.documentElement.clientWidth;\n myHeight = document.documentElement.clientHeight;\n } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {\n myWidth = document.body.clientWidth;\n myHeight = document.body.clientHeight;\n }\n this.windowWidth = myWidth;\n this.windowHeight = myHeight;\n },\n\n /**\n * Stores the referrer. Called automatically when this module is loaded.\n *\n * @method setReferrer\n * @public\n */\n setReferrer: function() {\n if (document.referrer && document.referrer.length) {\n this.referrer = window.escape(document.referrer);\n } else {\n this.referrer = false;\n }\n },\n\n /**\n * Detects the browser and stores the found properties. Called automatically when this module is loaded.\n *\n * @method detectBrowser\n * @public\n */\n detectBrowser: function() {\n this._sniffUserAgent(navigator.userAgent);\n },\n\n _sniffUserAgent: function (sAgent) {\n this.userAgent = sAgent;\n\n sAgent = sAgent.toLowerCase();\n\n if (/applewebkit\\//.test(sAgent)) {\n this.cssPrefix = '-webkit-';\n this.domPrefix = 'Webkit';\n if(/(chrome|crios)\\//.test(sAgent)) {\n // Chrome\n this.CHROME = true;\n this.model = 'chrome';\n this.version = sAgent.replace(/(.*)chrome\\/([^\\s]+)(.*)/, \"$2\");\n } else {\n // Safari\n this.SAFARI = true;\n this.model = 'safari';\n var rVersion = /version\\/([^) ]+)/;\n if (rVersion.test(sAgent)) {\n this.version = sAgent.match(rVersion)[1];\n } else {\n this.version = sAgent.replace(/(.*)applewebkit\\/([^\\s]+)(.*)/, \"$2\");\n }\n }\n } else if (/opera/.test(sAgent)) {\n // Opera\n this.OPERA = true;\n this.model = 'opera';\n this.version = sAgent.replace(/(.*)opera.([^\\s$]+)(.*)/, \"$2\");\n this.cssPrefix = '-o-';\n this.domPrefix = 'O';\n } else if (/konqueror/.test(sAgent)) {\n // Konqueroh\n this.KONQUEROR = true;\n this.model = 'konqueror';\n this.version = sAgent.replace(/(.*)konqueror\\/([^;]+);(.*)/, \"$2\");\n this.cssPrefix = '-khtml-';\n this.domPrefix = 'Khtml';\n } else if (/(msie|trident)/i.test(sAgent)) {\n // MSIE\n this.IE = true;\n this.model = 'ie';\n if (/rv:((?:\\d|\\.)+)/.test(sAgent)) { // IE 11\n this.version = sAgent.match(/rv:((?:\\d|\\.)+)/)[1];\n } else {\n this.version = sAgent.replace(/(.*)\\smsie\\s([^;]+);(.*)/, \"$2\");\n }\n this.cssPrefix = '-ms-';\n this.domPrefix = 'ms';\n } else if (/gecko/.test(sAgent)) {\n // GECKO\n // Supports only:\n // Camino, Chimera, Epiphany, Minefield (firefox 3), Firefox, Firebird, Phoenix, Galeon,\n // Iceweasel, K-Meleon, SeaMonkey, Netscape, Songbird, Sylera,\n this.cssPrefix = '-moz-';\n this.domPrefix = 'Moz';\n\n this.GECKO = true;\n\n var re = /(camino|chimera|epiphany|minefield|firefox|firebird|phoenix|galeon|iceweasel|k\\-meleon|seamonkey|netscape|songbird|sylera)/;\n if(re.test(sAgent)) {\n this.model = sAgent.match(re)[1];\n this.version = sAgent.replace(new RegExp(\"(.*)\"+this.model+\"\\/([^;\\\\s$]+)(.*)\"), \"$2\");\n } else {\n // probably is mozilla\n this.model = 'mozilla';\n var reVersion = /(.*)rv:([^)]+)(.*)/;\n if(reVersion.test(sAgent)) {\n this.version = sAgent.replace(reVersion, \"$2\");\n }\n }\n }\n },\n\n /**\n * Debug function which displays browser (and Ink.Dom.Browser) information as an alert message.\n *\n * @method debug\n * @public\n * @sample Ink_Dom_Browser_1_debug.html\n */\n debug: function() {\n /*global alert:false */\n var str = \"known browsers: (ie, gecko, opera, safari, konqueror) \\n\";\n str += [this.IE, this.GECKO, this.OPERA, this.SAFARI, this.KONQUEROR] +\"\\n\";\n str += \"cssPrefix -> \"+this.cssPrefix+\"\\n\";\n str += \"domPrefix -> \"+this.domPrefix+\"\\n\";\n str += \"model -> \"+this.model+\"\\n\";\n str += \"version -> \"+this.version+\"\\n\";\n str += \"\\n\";\n str += \"original UA -> \"+this.userAgent;\n\n alert(str);\n }\n };\n\n Browser.init();\n\n return Browser;\n});\n","/**\n * CSS Utilities and toolbox\n * @module Ink.Dom.Css_1\n * @version 1\n */\n\nInk.createModule( 'Ink.Dom.Css', 1, [], function() {\n\n 'use strict';\n\n // getComputedStyle feature detection.\n var getCs = (\"defaultView\" in document) && (\"getComputedStyle\" in document.defaultView) ? document.defaultView.getComputedStyle : window.getComputedStyle;\n\n /**\n * @namespace Ink.Dom.Css\n * @static\n */\n\n var Css = {\n /**\n * Adds of removes a class.\n * Depending on addRemState, this method either adds a class if it's true or removes if if false.\n *\n * @method addRemoveClassName\n * @param {DOMElement|string} elm DOM element or element id\n * @param {string} className class name to add or remove.\n * @param {boolean} addRemState Whether to add or remove. `true` to add, `false` to remove.\n * @sample Ink_Dom_Css_addRemoveClassName.html \n */\n addRemoveClassName: function(elm, className, addRemState) {\n if (addRemState) {\n return this.addClassName(elm, className);\n }\n this.removeClassName(elm, className);\n },\n\n /**\n * Adds a class to a given element\n *\n * @method addClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String|Array} className Classes \n * @sample Ink_Dom_Css_addClassName.html\n */\n addClassName: function(elm, className) {\n elm = Ink.i(elm);\n if (!elm || !className) { return null; }\n className = ('' + className).split(/[, ]+/);\n var i = 0;\n var len = className.length;\n\n for (; i < len; i++) {\n // remove whitespace and ignore on empty string\n if (className[i].replace(/^\\s+|\\s+$/g, '')) {\n if (typeof elm.classList !== \"undefined\") {\n elm.classList.add(className[i]);\n } else if (!Css.hasClassName(elm, className[i])) {\n elm.className += (elm.className ? ' ' : '') + className[i];\n }\n }\n }\n },\n\n /**\n * Removes a class from a given element\n *\n * @method removeClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String|Array} className Class names to remove. You can either use a space separated string of classnames, comma-separated list or an array\n * @sample Ink_Dom_Css_removeClassName.html \n */\n removeClassName: function(elm, className) {\n elm = Ink.i(elm);\n if (!elm || !className) { return null; }\n \n className = ('' + className).split(/[, ]+/);\n var i = 0;\n var len = className.length;\n\n if (typeof elm.classList !== \"undefined\"){\n for (; i < len; i++) {\n elm.classList.remove(className[i]);\n }\n } else {\n var elmClassName = elm.className || '';\n var re;\n for (; i < len; i++) {\n re = new RegExp(\"(^|\\\\s+)\" + className[i] + \"(\\\\s+|$)\");\n elmClassName = elmClassName.replace(re, ' ');\n }\n elm.className = (elmClassName\n .replace(/^\\s+/, '')\n .replace(/\\s+$/, ''));\n }\n },\n\n /**\n * Alias to addRemoveClassName. \n * Utility function, saves many if/elses.\n *\n * @method setClassName\n * @uses addRemoveClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String|Array} className Class names to add\\remove. Comma separated, space separated or simply an Array\n * @param {Boolean} [add]=false Flag to switch behavior from removal to addition. true to add, false to remove\n */\n setClassName: function(elm, className, add) {\n this.addRemoveClassName(elm, className, add || false);\n },\n\n /**\n * Checks if an element has a class.\n * This method verifies if an element has ONE of a list of classes. If the last argument is flagged as true, instead checks if the element has ALL the classes\n * \n * @method hasClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String|Array} className Class names to test\n * @param {Boolean} [all]=false If flagged as true, it will check if the element contains ALL the CSS classes\n * @return {Boolean} true if a given class is applied to a given element\n * @sample Ink_Dom_Css_hasClassName.html \n */\n hasClassName: function(elm, className, all) {\n elm = Ink.i(elm);\n if (!elm || !className) { return false; }\n\n className = ('' + className).split(/[, ]+/);\n var i = 0;\n var len = className.length;\n var has;\n var re;\n\n for ( ; i < len; i++) {\n if (typeof elm.classList !== \"undefined\"){\n has = elm.classList.contains(className[i]);\n } else {\n var elmClassName = elm.className;\n if (elmClassName === className[i]) {\n has = true;\n } else {\n re = new RegExp(\"(^|\\\\s)\" + className[i] + \"(\\\\s|$)\");\n has = re.test(elmClassName);\n }\n }\n if (has && !all) { return true; } // return if looking for any class\n if (!has && all) { return false; } // return if looking for all classes\n }\n\n if (all) {\n // if we got here, all classes were found so far\n return true;\n } else {\n // if we got here with all == false, no class was found\n return false;\n }\n },\n\n /**\n * Blinks a class from an element\n * Add and removes the class from the element with a timeout, so it blinks\n *\n * @method blinkClass\n * @uses addRemoveClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String|Array} className Class name(s) to blink\n * @param {Number} timeout timeout in ms between adding and removing, default 100 ms\n * @param {Boolean} negate is true, class is removed then added\n * @sample Ink_Dom_Css_blinkClass.html \n */\n blinkClass: function(element, className, timeout, negate){\n element = Ink.i(element);\n Css.addRemoveClassName(element, className, !negate);\n setTimeout(function() {\n Css.addRemoveClassName(element, className, negate);\n }, Number(timeout) || 100);\n },\n\n /**\n * Toggles a class name from a given element\n *\n * @method toggleClassName\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String} className Class name\n * @param {Boolean} [forceAdd] Flag to force adding the the classe names if they don't exist yet.\n * @sample Ink_Dom_Css_toggleClassName.html \n */\n toggleClassName: function(elm, className, forceAdd) {\n if (elm && className){\n if (typeof elm.classList !== \"undefined\" && !/[, ]/.test(className)){\n elm = Ink.i(elm);\n if (elm !== null){\n elm.classList.toggle(className);\n }\n return true;\n }\n }\n\n if (typeof forceAdd !== 'undefined') {\n if (forceAdd === true) {\n Css.addClassName(elm, className);\n }\n else if (forceAdd === false) {\n Css.removeClassName(elm, className);\n }\n } else {\n if (Css.hasClassName(elm, className)) {\n Css.removeClassName(elm, className);\n } else {\n Css.addClassName(elm, className);\n }\n }\n },\n\n /**\n * Sets the opacity of given element \n *\n * @method setOpacity\n * @param {DOMElement|String} elm DOM element or element id\n * @param {Number} value allows 0 to 1(default mode decimal) or percentage (warning using 0 or 1 will reset to default mode)\n * @sample Ink_Dom_Css_setOpacity.html \n */\n setOpacity: function(elm, value) {\n elm = Ink.i(elm);\n if (elm !== null){\n var val = 1;\n\n if (!isNaN(Number(value))){\n if (value <= 0) { val = 0; }\n else if (value <= 1) { val = value; }\n else if (value <= 100) { val = value / 100; }\n else { val = 1; }\n }\n\n if (typeof elm.style.opacity !== 'undefined') {\n elm.style.opacity = val;\n }\n else {\n elm.style.filter = \"alpha(opacity:\"+(val*100|0)+\")\";\n }\n }\n },\n\n /**\n * Converts a css property name to a string in camelcase to be used with CSSStyleDeclaration.\n * @method _camelCase\n * @private\n * @param {String} str String to convert\n * @return {String} Converted string\n */\n _camelCase: function(str) {\n return str ? str.replace(/-(\\w)/g, function (_, $1) {\n return $1.toUpperCase();\n }) : str;\n },\n\n\n /**\n * Gets the value for an element's style attribute\n *\n * @method getStyle\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String} style Which css attribute to fetch\n * @return Style value\n * @sample Ink_Dom_Css_getStyle.html \n */\n getStyle: function(elm, style) {\n elm = Ink.i(elm);\n if (elm !== null && elm.style) {\n style = style === 'float' ? 'cssFloat': this._camelCase(style);\n\n var value = elm.style[style];\n\n if (getCs && (!value || value === 'auto')) {\n var css = getCs(elm, null);\n value = css ? css[style] : null;\n }\n else if (!value && elm.currentStyle) {\n value = elm.currentStyle[style];\n if (value === 'auto' && (style === 'width' || style === 'height')) {\n value = elm[\"offset\" + style.charAt(0).toUpperCase() + style.slice(1)] + \"px\";\n }\n }\n\n if (style === 'opacity') {\n return value ? parseFloat(value, 10) : 1.0;\n }\n else if (style === 'borderTopWidth' || style === 'borderBottomWidth' ||\n style === 'borderRightWidth' || style === 'borderLeftWidth' ) {\n if (value === 'thin') { return '1px'; }\n else if (value === 'medium') { return '3px'; }\n else if (value === 'thick') { return '5px'; }\n }\n\n return value === 'auto' ? null : value;\n }\n },\n\n\n /**\n * Adds CSS rules to an element's style attribute.\n *\n * @method setStyle\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String} style Which css attribute to set\n * @sample Ink_Dom_Css_setStyle.html \n */\n setStyle: function(elm, style) {\n elm = Ink.i(elm);\n if (elm === null) { return; }\n if (typeof style === 'string') {\n elm.style.cssText += '; '+style;\n\n if (style.indexOf('opacity') !== -1) {\n this.setOpacity(elm, style.match(/opacity:\\s*(\\d?\\.?\\d*)/)[1]);\n }\n }\n else {\n for (var prop in style) {\n if (style.hasOwnProperty(prop)){\n if (prop === 'opacity') {\n this.setOpacity(elm, style[prop]);\n }\n else if (prop === 'float' || prop === 'cssFloat') {\n if (typeof elm.style.styleFloat === 'undefined') {\n elm.style.cssFloat = style[prop];\n }\n else {\n elm.style.styleFloat = style[prop];\n }\n } else {\n elm.style[prop] = style[prop];\n }\n }\n }\n }\n },\n\n\n /**\n * Shows an element.\n * Internally it unsets the display property of an element. You can force a specific display property using forceDisplayProperty\n *\n * @method show\n * @param {DOMElement|String} elm DOM element or element id\n * @param {String} [forceDisplayProperty] Css display property to apply on show\n * @sample Ink_Dom_Css_show.html \n */\n show: function(elm, forceDisplayProperty) {\n elm = Ink.i(elm);\n if (elm !== null) {\n elm.style.display = (forceDisplayProperty) ? forceDisplayProperty : '';\n }\n },\n\n /**\n * Hides an element.\n *\n * @method hide\n * @param {DOMElement|String} elm DOM element or element id\n * @sample Ink_Dom_Css_hide.html \n */\n hide: function(elm) {\n elm = Ink.i(elm);\n if (elm !== null) {\n elm.style.display = 'none';\n }\n },\n\n /**\n * Shows or hides an element.\n * If the show parameter is true, it shows the element. Otherwise, hides it.\n *\n * @method showHide\n * @param {DOMElement|String} elm DOM element or element id\n * @param {boolean} [show]=false Whether to show or hide `elm`.\n * @sample Ink_Dom_Css_showHide.html \n */\n showHide: function(elm, show) {\n elm = Ink.i(elm);\n if (elm) {\n elm.style.display = show ? '' : 'none';\n }\n },\n\n /**\n * Toggles an element visibility.\n * \n * @method toggle\n * @param {DOMElement|String} elm DOM element or element id\n * @param {Boolean} forceShow Forces showing if element is hidden\n * @sample Ink_Dom_Css_toggle.html \n */\n toggle: function(elm, forceShow) {\n elm = Ink.i(elm);\n if (elm !== null) {\n if (typeof forceShow !== 'undefined') {\n if (forceShow === true) {\n this.show(elm);\n } else {\n this.hide(elm);\n }\n } else {\n if (this.getStyle(elm,'display').toLowerCase() === 'none') {\n this.show(elm);\n }\n else {\n this.hide(elm);\n }\n }\n }\n },\n\n _getRefTag: function(head){\n if (head.firstElementChild) {\n return head.firstElementChild;\n }\n\n for (var child = head.firstChild; child; child = child.nextSibling){\n if (child.nodeType === 1){\n return child;\n }\n }\n return null;\n },\n\n /**\n * Injects style tags with rules to the page.\n *\n * @method appendStyleTag\n * @param {String} selector The css selector for the rule\n * @param {String} style The content of the style rule\n * @param {Object} options Options for the tag\n * @param {String} [options.type]='text/css' File type\n * @param {Boolean} [options.force]=false If true, the style tag will be appended to end of head\n * \n * @sample Ink_Dom_Css_appendStyleTag.html \n */\n appendStyleTag: function(selector, style, options){\n options = Ink.extendObj({\n type: 'text/css',\n force: false\n }, options || {});\n\n var styles = document.getElementsByTagName(\"style\"),\n oldStyle = false, setStyle = true, i, l;\n\n for (i=0, l=styles.length; i= 0) {\n setStyle = false;\n }\n }\n\n if (setStyle) {\n var defStyle = document.createElement(\"style\"),\n head = document.getElementsByTagName(\"head\")[0],\n refTag = false, styleStr = '';\n\n defStyle.type = options.type;\n\n styleStr += selector +\" {\";\n styleStr += style;\n styleStr += \"} \";\n\n if (typeof defStyle.styleSheet !== \"undefined\") {\n defStyle.styleSheet.cssText = styleStr;\n } else {\n defStyle.appendChild(document.createTextNode(styleStr));\n }\n\n if (options.force){\n head.appendChild(defStyle);\n } else {\n refTag = this._getRefTag(head);\n if (refTag){\n head.insertBefore(defStyle, refTag);\n }\n }\n }\n },\n\n /**\n * Injects an external link tag.\n * This method add a stylesheet to the head of a page\n *\n * @method appendStylesheet\n * @param {String} path File path\n * @param {Object} options Options for the tag\n * @param {String} [options.media]='screen' Media type\n * @param {String} [options.type]='text/css' File type\n * @param {Boolean} [options.force]=false If true, tag will be appended to end of head\n * @sample Ink_Dom_Css_appendStylesheet.html \n */\n appendStylesheet: function(path, options){\n options = Ink.extendObj({\n media: 'screen',\n type: 'text/css',\n force: false\n }, options || {});\n\n var refTag,\n style = document.createElement(\"link\"),\n head = document.getElementsByTagName(\"head\")[0];\n\n style.media = options.media;\n style.type = options.type;\n style.href = path;\n style.rel = \"Stylesheet\";\n\n if (options.force){\n head.appendChild(style);\n }\n else {\n refTag = this._getRefTag(head);\n if (refTag){\n head.insertBefore(style, refTag);\n }\n }\n },\n\n /**\n * Injects an external link tag.\n * Loads CSS via LINK element inclusion in HEAD (skips append if already there)\n *\n * Works similarly to appendStylesheet but:\n * supports optional callback which gets invoked once the CSS has been applied\n *\n * @method appendStylesheetCb\n * @param {String} cssURI URI of the CSS to load, if empty ignores and just calls back directly\n * @param {Function(cssURI)} [callback] optional callback which will be called once the CSS is loaded\n * @sample Ink_Dom_Css_appendStylesheetCb.html \n */\n _loadingCSSFiles: {},\n _loadedCSSFiles: {},\n appendStylesheetCb: function(url, callback) {\n if (!url) {\n return callback(url);\n }\n\n if (this._loadedCSSFiles[url]) {\n return callback(url);\n }\n\n var cbs = this._loadingCSSFiles[url];\n if (cbs) {\n return cbs.push(callback);\n }\n\n this._loadingCSSFiles[url] = [callback];\n\n var linkEl = document.createElement('link');\n linkEl.type = 'text/css';\n linkEl.rel = 'stylesheet';\n linkEl.href = url;\n\n var headEl = document.getElementsByTagName('head')[0];\n headEl.appendChild(linkEl);\n\n var imgEl = document.createElement('img');\n /*\n var _self = this;\n (function(_url) {\n imgEl.onerror = function() {\n //var url = this;\n var url = _url;\n _self._loadedCSSFiles[url] = true;\n var callbacks = _self._loadingCSSFiles[url];\n for (var i = 0, f = callbacks.length; i < f; ++i) {\n callbacks[i](url);\n }\n delete _self._loadingCSSFiles[url];\n };\n })(url);\n */\n imgEl.onerror = Ink.bindEvent(function(event, _url) {\n //var url = this;\n var url = _url;\n this._loadedCSSFiles[url] = true;\n var callbacks = this._loadingCSSFiles[url];\n for (var i = 0, f = callbacks.length; i < f; ++i) {\n callbacks[i](url);\n }\n delete this._loadingCSSFiles[url];\n }, this, url);\n imgEl.src = url;\n },\n\n /**\n * Converts decimal to hexadecimal values\n * Useful to convert colors to their hexadecimal representation.\n *\n * @method decToHex\n * @param {String} dec Either a single decimal value, an rgb(r, g, b) string or an Object with r, g and b properties\n * @return {String} Hexadecimal value\n * @sample Ink_Dom_Css_decToHex.html \n */\n decToHex: function(dec) {\n var normalizeTo2 = function(val) {\n if (val.length === 1) {\n val = '0' + val;\n }\n val = val.toUpperCase();\n return val;\n };\n\n if (typeof dec === 'object') {\n var rDec = normalizeTo2(parseInt(dec.r, 10).toString(16));\n var gDec = normalizeTo2(parseInt(dec.g, 10).toString(16));\n var bDec = normalizeTo2(parseInt(dec.b, 10).toString(16));\n return rDec+gDec+bDec;\n }\n else {\n dec += '';\n var rgb = dec.match(/\\((\\d+),\\s?(\\d+),\\s?(\\d+)\\)/);\n if (rgb !== null) {\n return normalizeTo2(parseInt(rgb[1], 10).toString(16)) +\n normalizeTo2(parseInt(rgb[2], 10).toString(16)) +\n normalizeTo2(parseInt(rgb[3], 10).toString(16));\n }\n else {\n return normalizeTo2(parseInt(dec, 10).toString(16));\n }\n }\n },\n\n /**\n * Converts hexadecimal values to decimal\n * Useful to use with CSS colors\n *\n * @method hexToDec\n * @param {String} hex hexadecimal Value with 6, 3, 2 or 1 characters\n * @return {Number} Object with properties r, g, b if length of number is >= 3 or decimal value instead.\n * @sample Ink_Dom_Css_hexToDec.html \n */\n hexToDec: function(hex){\n if (hex.indexOf('#') === 0) {\n hex = hex.substr(1);\n }\n if (hex.length === 6) { // will return object RGB\n return {\n r: parseInt(hex.substr(0,2), 16),\n g: parseInt(hex.substr(2,2), 16),\n b: parseInt(hex.substr(4,2), 16)\n };\n }\n else if (hex.length === 3) { // will return object RGB\n return {\n r: parseInt(hex.charAt(0) + hex.charAt(0), 16),\n g: parseInt(hex.charAt(1) + hex.charAt(1), 16),\n b: parseInt(hex.charAt(2) + hex.charAt(2), 16)\n };\n }\n else if (hex.length <= 2) { // will return int\n return parseInt(hex, 16);\n }\n },\n\n /**\n * Get a single property from a stylesheet.\n * Use this to obtain the value of a CSS property (searched from loaded CSS documents)\n *\n * @method getPropertyFromStylesheet\n * @param {String} selector a CSS rule. must be an exact match\n * @param {String} property a CSS property\n * @return {String} value of the found property, or null if it wasn't matched\n */\n getPropertyFromStylesheet: function(selector, property) {\n var rule = this.getRuleFromStylesheet(selector);\n if (rule) {\n return rule.style[property];\n }\n return null;\n },\n\n getPropertyFromStylesheet2: function(selector, property) {\n var rules = this.getRulesFromStylesheet(selector);\n /*\n rules.forEach(function(rule) {\n var x = rule.style[property];\n if (x !== null && x !== undefined) {\n return x;\n }\n });\n */\n var x;\n for(var i=0, t=rules.length; i < t; i++) {\n x = rules[i].style[property];\n if (x !== null && x !== undefined) {\n return x;\n }\n }\n return null;\n },\n\n getRuleFromStylesheet: function(selector) {\n var sheet, rules, ri, rf, rule;\n var s = document.styleSheets;\n if (!s) {\n return null;\n }\n\n for (var si = 0, sf = document.styleSheets.length; si < sf; ++si) {\n sheet = document.styleSheets[si];\n rules = sheet.rules ? sheet.rules : sheet.cssRules;\n if (!rules) { return null; }\n\n for (ri = 0, rf = rules.length; ri < rf; ++ri) {\n rule = rules[ri];\n if (!rule.selectorText) { continue; }\n if (rule.selectorText === selector) {\n return rule;\n }\n }\n }\n\n return null;\n },\n\n getRulesFromStylesheet: function(selector) {\n var res = [];\n var sheet, rules, ri, rf, rule;\n var s = document.styleSheets;\n if (!s) { return res; }\n\n for (var si = 0, sf = document.styleSheets.length; si < sf; ++si) {\n sheet = document.styleSheets[si];\n rules = sheet.rules ? sheet.rules : sheet.cssRules;\n if (!rules) {\n return null;\n }\n\n for (ri = 0, rf = rules.length; ri < rf; ++ri) {\n rule = rules[ri];\n if (!rule.selectorText) { continue; }\n if (rule.selectorText === selector) {\n res.push(rule);\n }\n }\n }\n\n return res;\n },\n\n getPropertiesFromRule: function(selector) {\n var rule = this.getRuleFromStylesheet(selector);\n var props = {};\n var prop, i, f;\n\n /*if (typeof rule.style.length === 'snumber') {\n for (i = 0, f = rule.style.length; i < f; ++i) {\n prop = this._camelCase( rule.style[i] );\n props[prop] = rule.style[prop];\n }\n }\n else { // HANDLES IE 8, FIREFOX RULE JOINING... */\n rule = rule.style.cssText;\n var parts = rule.split(';');\n var steps, val, pre, pos;\n for (i = 0, f = parts.length; i < f; ++i) {\n if (parts[i].charAt(0) === ' ') {\n parts[i] = parts[i].substring(1);\n }\n steps = parts[i].split(':');\n prop = this._camelCase( steps[0].toLowerCase() );\n val = steps[1];\n if (val) {\n val = val.substring(1);\n\n if (prop === 'padding' || prop === 'margin' || prop === 'borderWidth') {\n\n if (prop === 'borderWidth') { pre = 'border'; pos = 'Width'; }\n else { pre = prop; pos = ''; }\n\n if (val.indexOf(' ') !== -1) {\n val = val.split(' ');\n props[pre + 'Top' + pos] = val[0];\n props[pre + 'Bottom'+ pos] = val[0];\n props[pre + 'Left' + pos] = val[1];\n props[pre + 'Right' + pos] = val[1];\n }\n else {\n props[pre + 'Top' + pos] = val;\n props[pre + 'Bottom'+ pos] = val;\n props[pre + 'Left' + pos] = val;\n props[pre + 'Right' + pos] = val;\n }\n }\n else if (prop === 'borderRadius') {\n if (val.indexOf(' ') !== -1) {\n val = val.split(' ');\n props.borderTopLeftRadius = val[0];\n props.borderBottomRightRadius = val[0];\n props.borderTopRightRadius = val[1];\n props.borderBottomLeftRadius = val[1];\n }\n else {\n props.borderTopLeftRadius = val;\n props.borderTopRightRadius = val;\n props.borderBottomLeftRadius = val;\n props.borderBottomRightRadius = val;\n }\n }\n else {\n props[prop] = val;\n }\n }\n }\n //}\n //console.log(props);\n\n return props;\n },\n\n /**\n * Change the font size of elements.\n * Changes the font size of the elements which match the given CSS rule\n * For this function to work, the CSS file must be in the same domain than the host page, otherwise JS can't access it.\n *\n * @method changeFontSize\n * @param {String} selector CSS selector rule\n * @param {Number} delta Number of pixels to change on font-size\n * @param {String} [op] Supported operations are '+' and '*'. defaults to '+'\n * @param {Number} [minVal] If result gets smaller than minVal, change does not occurr\n * @param {Number} [maxVal] If result gets bigger than maxVal, change does not occurr\n */\n changeFontSize: function(selector, delta, op, minVal, maxVal) {\n var that = this;\n Ink.requireModules(['Ink.Dom.Selector_1'], function(Selector) {\n var e;\n if (typeof selector !== 'string') { e = '1st argument must be a CSS selector rule.'; }\n else if (typeof delta !== 'number') { e = '2nd argument must be a number.'; }\n else if (op !== undefined && op !== '+' && op !== '*') { e = '3rd argument must be one of \"+\", \"*\".'; }\n else if (minVal !== undefined && (typeof minVal !== 'number' || minVal <= 0)) { e = '4th argument must be a positive number.'; }\n else if (maxVal !== undefined && (typeof maxVal !== 'number' || maxVal < maxVal)) { e = '5th argument must be a positive number greater than minValue.'; }\n if (e) { throw new TypeError(e); }\n\n var val, el, els = Selector.select(selector);\n if (minVal === undefined) { minVal = 1; }\n op = (op === '*') ? function(a,b){return a*b;} : function(a,b){return a+b;};\n for (var i = 0, f = els.length; i < f; ++i) {\n el = els[i];\n val = parseFloat( that.getStyle(el, 'fontSize'));\n val = op(val, delta);\n if (val < minVal) { continue; }\n if (typeof maxVal === 'number' && val > maxVal) { continue; }\n el.style.fontSize = val + 'px';\n }\n });\n }\n\n };\n\n return Css;\n\n});\n","/**\n * DOM Traversal and manipulation\n * @module Ink.Dom.Element_1\n * @version 1\n */\n\nInk.createModule('Ink.Dom.Element', 1, [], function() {\n\n 'use strict';\n\n var createContextualFragmentSupport = (\n typeof document.createRange === 'function' &&\n typeof window.Range.prototype.createContextualFragment === 'function');\n\n var deleteThisTbodyToken = 'Ink.Dom.Element tbody: ' + Math.random();\n var browserCreatesTbodies = (function () {\n var div = document.createElement('div');\n div.innerHTML = '';\n return div.getElementsByTagName('tbody').length !== 0;\n }());\n\n function rect(elem){\n var dimensions = {};\n try {\n dimensions = elem.getBoundingClientRect();\n } catch(e){\n dimensions = { top: elem.offsetTop, left: elem.offsetLeft };\n }\n return dimensions;\n }\n\n /**\n * @namespace Ink.Dom.Element_1\n */\n\n var InkElement = {\n\n /**\n * Checks if something is a DOM Element.\n *\n * @method isDOMElement\n * @static\n * @param {Mixed} o The object to be checked.\n * @return {Boolean} True if it's a valid DOM Element.\n * @example\n * var el = Ink.s('#element');\n * if( InkElement.isDOMElement( el ) === true ){\n * // It is a DOM Element.\n * } else {\n * // It is NOT a DOM Element.\n * }\n */\n isDOMElement: function(o) {\n return o !== null && typeof o === 'object' && 'nodeType' in o && o.nodeType === 1;\n },\n\n /**\n * Shortcut for `document.getElementById`\n *\n * @method get\n * @param {String|DOMElement} elm Either an ID of an element, or an element.\n * @return {DOMElement|null} The DOM element with the given id or null when it was not found\n * @sample Ink_Dom_Element_1_get.html\n */\n get: function(elm) {\n if(typeof elm !== 'undefined') {\n if(typeof elm === 'string') {\n return document.getElementById(elm);\n }\n return elm;\n }\n return null;\n },\n\n /**\n * Creates a DOM element\n *\n * @method create\n * @param {String} tag tag name\n * @param {Object} properties object with properties to be set on the element. You can also call other functions in Ink.Dom.Element like this\n * @sample Ink_Dom_Element_1_create.html\n */\n create: function(tag, properties) {\n var el = document.createElement(tag);\n //Ink.extendObj(el, properties);\n for(var property in properties) {\n if(properties.hasOwnProperty(property)) {\n if (property in InkElement) {\n InkElement[property](el, properties[property]);\n } else {\n if(property === 'className' || property === 'class') {\n el.className = properties.className || properties['class'];\n } else {\n el.setAttribute(property, properties[property]);\n }\n }\n }\n }\n return el;\n },\n\n /**\n * Removes a DOM Element\n *\n * @method remove\n * @param {DOMElement} elm The element to remove\n * @sample Ink_Dom_Element_1_remove.html\n */\n remove: function(el) {\n el = Ink.i(el);\n var parEl;\n if (el && (parEl = el.parentNode)) {\n parEl.removeChild(el);\n }\n },\n\n /**\n * Scrolls the window to an element\n *\n * @method scrollTo\n * @param {DOMElement|String} elm Element where to scroll\n * @sample Ink_Dom_Element_1_scrollTo.html\n */\n scrollTo: function(elm) {\n elm = InkElement.get(elm);\n if(elm) {\n if (elm.scrollIntoView) {\n return elm.scrollIntoView();\n }\n\n var elmOffset = {},\n elmTop = 0, elmLeft = 0;\n\n do {\n elmTop += elm.offsetTop || 0;\n elmLeft += elm.offsetLeft || 0;\n\n elm = elm.offsetParent;\n } while(elm);\n\n elmOffset = {x: elmLeft, y: elmTop};\n\n window.scrollTo(elmOffset.x, elmOffset.y);\n }\n },\n\n /**\n * Gets the top offset of an element\n *\n * @method offsetTop\n * @uses Ink.Dom.Browser\n *\n * @param {DOMElement|String} elm Target element\n * @return {Number} Offset from the target element to the top of the document\n * @sample Ink_Dom_Element_1_offsetTop.html\n */\n offsetTop: function(elm) {\n return InkElement.offset(elm)[1];\n },\n\n /**\n * Gets the left offset of an element\n *\n * @method offsetLeft\n * @uses Ink.Dom.Browser\n *\n * @param {DOMElement|String} elm Target element\n * @return {Number} Offset from the target element to the left of the document\n * @sample Ink_Dom_Element_1_offsetLeft.html\n */\n offsetLeft: function(elm) {\n return InkElement.offset(elm)[0];\n },\n\n /**\n * Gets the relative offset of an element\n *\n * @method positionedOffset\n * @param {DOMElement|String} elm Target element\n * @return {Array} Array with the element offsetleft and offsettop relative to the closest positioned ancestor\n * @sample Ink_Dom_Element_1_positionedOffset.html\n */\n positionedOffset: function(element) {\n var valueTop = 0, valueLeft = 0;\n element = InkElement.get(element);\n do {\n valueTop += element.offsetTop || 0;\n valueLeft += element.offsetLeft || 0;\n element = element.offsetParent;\n if (element) {\n if (element.tagName.toLowerCase() === 'body') { break; }\n\n var value = element.style.position;\n if (!value && element.currentStyle) {\n value = element.currentStyle.position;\n }\n if ((!value || value === 'auto') && typeof getComputedStyle !== 'undefined') {\n var css = getComputedStyle(element, null);\n value = css ? css.position : null;\n }\n if (value === 'relative' || value === 'absolute') { break; }\n }\n } while (element);\n return [valueLeft, valueTop];\n },\n\n /**\n * Gets the cumulative offset for an element\n *\n * Returns the top left position of the element on the page\n *\n * @method offset\n * @uses Ink.Dom.Browser\n *\n * @method offset\n * @param {DOMElement|String} elm Target element\n * @return {[Number, Number]} Array with pixel distance from the target element to the top left corner of the document\n * @sample Ink_Dom_Element_1_offset.html\n */\n offset: function(el) {\n /*jshint boss:true */\n el = Ink.i(el);\n var res = [0, 0];\n var doc = el.ownerDocument,\n docElem = doc.documentElement,\n box = rect(el),\n body = doc.body,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n scrollTop = doc.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = doc.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n top = box.top + scrollTop - clientTop,\n left = box.left + scrollLeft - clientLeft;\n res = [left, top];\n return res;\n },\n\n /**\n * Gets the scroll of the element\n *\n * @method scroll\n * @param {DOMElement|String} [elm] Target element or document.body\n * @returns {Array} offset values for x and y scroll\n * @sample Ink_Dom_Element_1_scroll.html\n */\n scroll: function(elm) {\n elm = elm ? Ink.i(elm) : document.body;\n return [\n ( ( !window.pageXOffset ) ? elm.scrollLeft : window.pageXOffset ),\n ( ( !window.pageYOffset ) ? elm.scrollTop : window.pageYOffset )\n ];\n },\n\n _getPropPx: function(cs, prop) {\n var n, c;\n var val = cs.getPropertyValue ? cs.getPropertyValue(prop) : cs[prop];\n if (!val) { n = 0; }\n else {\n c = val.indexOf('px');\n if (c === -1) { n = 0; }\n else {\n n = parseFloat(val, 10);\n }\n }\n\n //console.log([prop, ' \"', val, '\" ', n].join(''));\n\n return n;\n },\n\n /**\n * Alias for offset()\n *\n * @method offset2\n * @deprecated Kept for historic reasons. Use offset() instead.\n */\n offset2: function(el) {\n return InkElement.offset(el);\n },\n\n /**\n * Checks if an element has an attribute\n *\n * @method hasAttribute\n * @param {Object} elm Target element\n * @param {String} attr Attribute name\n * @return {Boolean} Boolean based on existance of attribute\n * @sample Ink_Dom_Element_1_hasAttribute.html\n */\n hasAttribute: function(elm, attr){\n elm = Ink.i(elm);\n return elm.hasAttribute ? elm.hasAttribute(attr) : !!elm.getAttribute(attr);\n },\n /**\n * Inserts an element right after another\n *\n * @method insertAfter\n * @param {DOMElement} newElm Element to be inserted\n * @param {DOMElement|String} targetElm Key element\n * @sample Ink_Dom_Element_1_insertAfter.html\n */\n insertAfter: function(newElm, targetElm) {\n /*jshint boss:true */\n if (targetElm = InkElement.get(targetElm)) {\n if (targetElm.nextSibling !== null) {\n targetElm.parentNode.insertBefore(newElm, targetElm.nextSibling);\n } else {\n targetElm.parentNode.appendChild(newElm);\n }\n }\n },\n\n /**\n * Inserts an element before another\n *\n * @method insertBefore\n * @param {DOMElement} newElm Element to be inserted\n * @param {DOMElement|String} targetElm Key element\n * @sample Ink_Dom_Element_1_insertBefore.html\n */\n insertBefore: function (newElm, targetElm) {\n /*jshint boss:true */\n if ( (targetElm = InkElement.get(targetElm)) ) {\n targetElm.parentNode.insertBefore(newElm, targetElm);\n }\n },\n\n /**\n * Inserts an element as the first child of another\n *\n * @method insertTop\n * @param {DOMElement} newElm Element to be inserted\n * @param {DOMElement|String} targetElm Key element\n * @sample Ink_Dom_Element_1_insertTop.html\n */\n insertTop: function(newElm,targetElm) {\n /*jshint boss:true */\n if (targetElm = InkElement.get(targetElm)) {\n if (targetElm.firstChild) {\n targetElm.insertBefore(newElm, targetElm.firstChild);\n } else {\n targetElm.appendChild(newElm);\n }\n }\n },\n\n /**\n * Inserts an element as the last child of another\n *\n * @method insertBottom\n * @param {DOMElement} newElm Element to be inserted\n * @param {DOMElement|String} targetElm Key element\n * @sample Ink_Dom_Element_1_insertBottom.html\n */\n insertBottom: function(newElm, targetElm) {\n /*jshint boss:true */\n targetElm = Ink.i(targetElm);\n targetElm.appendChild(newElm);\n },\n\n /**\n * Retrieves textContent from node\n *\n * @method textContent\n * @param {DOMNode} node Where to retreive text from. Can be any node type.\n * @return {String} the text\n * @sample Ink_Dom_Element_1_textContent.html\n */\n textContent: function(node){\n node = Ink.i(node);\n var text, k, cs, m;\n\n switch(node && node.nodeType) {\n case 9: /*DOCUMENT_NODE*/\n // IE quirks mode does not have documentElement\n return InkElement.textContent(node.documentElement || node.body && node.body.parentNode || node.body);\n\n case 1: /*ELEMENT_NODE*/\n text = node.innerText;\n if (typeof text !== 'undefined') {\n return text;\n }\n /* falls through */\n case 11: /*DOCUMENT_FRAGMENT_NODE*/\n text = node.textContent;\n if (typeof text !== 'undefined') {\n return text;\n }\n\n if (node.firstChild === node.lastChild) {\n // Common case: 0 or 1 children\n return InkElement.textContent(node.firstChild);\n }\n\n text = [];\n cs = node.childNodes;\n for (k = 0, m = cs.length; k < m; ++k) {\n text.push( InkElement.textContent( cs[k] ) );\n }\n return text.join('');\n\n case 3: /*TEXT_NODE*/\n case 4: /*CDATA_SECTION_NODE*/\n return node.nodeValue;\n }\n return '';\n },\n\n /**\n * Replaces text content of a DOM Node\n * This method removes any child node previously present\n *\n * @method setTextContent\n * @param {DOMNode} node node Target node where the text will be added.\n * @param {String} text text Text to be added on the node.\n * @sample Ink_Dom_Element_1_setTextContent.html\n */\n setTextContent: function(node, text){\n node = Ink.i(node);\n switch(node && node.nodeType)\n {\n case 1: /*ELEMENT_NODE*/\n if ('innerText' in node) {\n node.innerText = text;\n break;\n }\n /* falls through */\n case 11: /*DOCUMENT_FRAGMENT_NODE*/\n if ('textContent' in node) {\n node.textContent = text;\n break;\n }\n /* falls through */\n case 9: /*DOCUMENT_NODE*/\n while(node.firstChild) {\n node.removeChild(node.firstChild);\n }\n if (text !== '') {\n var doc = node.ownerDocument || node;\n node.appendChild(doc.createTextNode(text));\n }\n break;\n\n case 3: /*TEXT_NODE*/\n case 4: /*CDATA_SECTION_NODE*/\n node.nodeValue = text;\n break;\n }\n },\n\n /**\n * Checks if an element is a link\n *\n * @method isLink\n * @param {DOMNode} node Node to check if it's link\n * @return {Boolean}\n * @sample Ink_Dom_Element_1_isLink.html\n */\n isLink: function(element){\n var b = element && element.nodeType === 1 && ((/^a|area$/i).test(element.tagName) ||\n element.hasAttributeNS && element.hasAttributeNS('http://www.w3.org/1999/xlink','href'));\n return !!b;\n },\n\n /**\n * Checks if a node is an ancestor of another\n *\n * @method isAncestorOf\n * @param {DOMNode} ancestor Ancestor node\n * @param {DOMNode} node Descendant node\n * @return {Boolean}\n * @sample Ink_Dom_Element_1_isAncestorOf.html\n */\n isAncestorOf: function(ancestor, node){\n /*jshint boss:true */\n if (!node || !ancestor) {\n return false;\n }\n if (node.compareDocumentPosition) {\n return (ancestor.compareDocumentPosition(node) & 0x10) !== 0;/*Node.DOCUMENT_POSITION_CONTAINED_BY*/\n }\n while (node = node.parentNode){\n if (node === ancestor){\n return true;\n }\n }\n return false;\n },\n\n /**\n * Checks if a node is descendant of another\n *\n * @method descendantOf\n * @param {DOMNode} node The ancestor\n * @param {DOMNode} descendant The descendant\n * @return {Boolean} true if 'descendant' is descendant of 'node'\n * @sample Ink_Dom_Element_1_descendantOf.html\n */\n descendantOf: function(node, descendant){\n return node !== descendant && InkElement.isAncestorOf(node, descendant);\n },\n\n /**\n * Get first child element of another\n * @method firstElementChild\n * @param {DOMElement} elm Parent node\n * @return {DOMElement} the Element child\n * @sample Ink_Dom_Element_1_firstElementChild.html\n */\n firstElementChild: function(elm){\n if(!elm) {\n return null;\n }\n if ('firstElementChild' in elm) {\n return elm.firstElementChild;\n }\n var child = elm.firstChild;\n while(child && child.nodeType !== 1) {\n child = child.nextSibling;\n }\n return child;\n },\n\n /**\n * Get the last child element of another\n * @method lastElementChild\n * @param {DOMElement} elm Parent node\n * @return {DOMElement} the Element child\n * @sample Ink_Dom_Element_1_lastElementChild.html\n */\n lastElementChild: function(elm){\n if(!elm) {\n return null;\n }\n if ('lastElementChild' in elm) {\n return elm.lastElementChild;\n }\n var child = elm.lastChild;\n while(child && child.nodeType !== 1) {\n child = child.previousSibling;\n }\n return child;\n },\n\n /**\n * Get the first sibling element after the node\n *\n * @method nextElementSibling\n * @param {DOMNode} node The current node\n * @return {DOMElement|Null} The first sibling element after node or null if none is found\n * @sample Ink_Dom_Element_1_nextElementSibling.html \n */\n nextElementSibling: function(node){\n var sibling = null;\n\n if(!node){ return sibling; }\n\n if(\"nextElementSibling\" in node){\n return node.nextElementSibling;\n } else {\n sibling = node.nextSibling;\n\n // 1 === Node.ELEMENT_NODE\n while(sibling && sibling.nodeType !== 1){\n sibling = sibling.nextSibling;\n }\n\n return sibling;\n }\n },\n\n /**\n * Get the first sibling element before the node\n *\n * @method previousElementSibling\n * @param {DOMNode} node The current node\n * @return {DOMElement|Null} The first element sibling before node or null if none is found\n * @sample Ink_Dom_Element_1_previousElementSibling.html \n */\n previousElementSibling: function(node){\n var sibling = null;\n\n if(!node){ return sibling; }\n\n if(\"previousElementSibling\" in node){\n return node.previousElementSibling;\n } else {\n sibling = node.previousSibling;\n\n // 1 === Node.ELEMENT_NODE\n while(sibling && sibling.nodeType !== 1){\n sibling = sibling.previousSibling;\n }\n\n return sibling;\n }\n },\n\n /**\n * Get an element's width in pixels.\n *\n * @method elementWidth\n * @param {DOMElement|String} element Target DOM element or target ID\n * @return {Number} The element's width\n * @sample Ink_Dom_Element_1_elementWidth.html \n */\n elementWidth: function(element) {\n if(typeof element === \"string\") {\n element = document.getElementById(element);\n }\n return element.offsetWidth;\n },\n\n /**\n * Get an element's height in pixels.\n *\n * @method elementHeight\n * @param {DOMElement|String} element DOM element or target ID\n * @return {Number} The element's height\n * @sample Ink_Dom_Element_1_elementHeight.html \n */\n elementHeight: function(element) {\n if(typeof element === \"string\") {\n element = document.getElementById(element);\n }\n return element.offsetHeight;\n },\n\n /**\n * Deprecated. Alias for offsetLeft()\n *\n * @method elementLeft\n * @param {DOMElement|String} element DOM element or target ID\n * @return {Number} Element's left position\n */\n elementLeft: function(element) {\n return InkElement.offsetLeft(element);\n },\n\n /**\n * Deprecated. Alias for offsetTop()\n *\n * @method elementTop\n * @param {DOMElement|string} element Target DOM element or target ID\n * @return {Number} element's top position\n */\n elementTop: function(element) {\n return InkElement.offsetTop(element);\n },\n\n /**\n * Get an element's dimensions in pixels.\n *\n * @method elementDimensions\n * @param {DOMElement|string} element DOM element or target ID\n * @return {Array} Array with element's width and height\n * @sample Ink_Dom_Element_1_elementDimensions.html \n */\n elementDimensions: function(element) {\n element = Ink.i(element);\n return [element.offsetWidth, element.offsetHeight];\n },\n\n /**\n * Get the outer dimensions of an element in pixels.\n *\n * @method outerDimensions\n * @uses Ink.Dom.Css\n *\n * @param {DOMElement} element Target element\n * @return {Array} Array with element width and height.\n * @sample Ink_Dom_Element_1_outerDimensions.html \n */\n outerDimensions: function (element) {\n var bbox = rect(element);\n\n var Css = Ink.getModule('Ink.Dom.Css_1');\n var getStyle = Ink.bindMethod(Css, 'getStyle', element);\n\n return [\n bbox.right - bbox.left + parseFloat(getStyle('marginLeft') || 0) + parseFloat(getStyle('marginRight') || 0), // w\n bbox.bottom - bbox.top + parseFloat(getStyle('marginTop') || 0) + parseFloat(getStyle('marginBottom') || 0) // h\n ];\n },\n\n /**\n * Check if an element is inside the viewport\n *\n * @method inViewport\n * @param {DOMElement} element DOM Element\n * @param {Object} [options] Options object. If you pass a Boolean value here, it is interpreted as `options.partial`\n * @param {Boolean} [options.partial]=false Return `true` even if it is only partially visible.\n * @param {Number} [options.margin]=0 Consider a margin all around the viewport with `opts.margin` width a dead zone.\n * @return {Boolean}\n * @sample Ink_Dom_Element_1_inViewport.html \n */\n inViewport: function (element, opts) {\n var dims = rect(Ink.i(element));\n if (typeof opts === 'boolean') {\n opts = {partial: opts, margin: 0};\n }\n opts = Ink.extendObj({ partial: false, margin: 0}, opts || {});\n if (opts.partial) {\n return dims.bottom + opts.margin > 0 && // from the top\n dims.left - opts.margin < InkElement.viewportWidth() && // from the right\n dims.top - opts.margin < InkElement.viewportHeight() && // from the bottom\n dims.right + opts.margin > 0; // from the left\n } else {\n return dims.top + opts.margin > 0 && // from the top\n dims.right - opts.margin < InkElement.viewportWidth() && // from the right\n dims.bottom - opts.margin < InkElement.viewportHeight() && // from the bottom\n dims.left + opts.margin > 0; // from the left\n }\n },\n\n /**\n * Check if an element is hidden.\n * Taken from Mootools Element extras ( https://gist.github.com/cheeaun/73342 )\n * Does not take into account visibility:hidden\n * @method isHidden\n * @param {DOMElement} element Element to check\n * @return {Boolean}\n * @sample Ink_Dom_Element_1_isHidden.html \n */\n\n isHidden: function (element) {\n var w = element.offsetWidth, \n h = element.offsetHeight,\n force = (element.tagName.toLowerCase() === 'tr');\n\n var Css = Ink.getModule('Ink.Dom.Css_1');\n\n return (w===0 && h===0 && !force) ? true :\n (w!==0 && h!==0 && !force) ? false :\n Css.getStyle(element, 'display').toLowerCase() === 'none';\n },\n\n /**\n * Check if an element is visible \n *\n * @method isVisible\n * @uses isHidden\n * @param {DOMElement} element Element to check\n * @return {Boolean}\n * @sample Ink_Dom_Element_1_isVisible.html \n */\n\n isVisible: function (element) {\n return !this.isHidden(element);\n },\n\n /**\n * Clones an element's position to another\n *\n * @method clonePosition\n * @param {DOMElement} cloneTo element to be position cloned\n * @param {DOMElement} cloneFrom element to get the cloned position\n * @return {DOMElement} The element with positionClone\n * @sample Ink_Dom_Element_1_clonePosition.html \n */\n clonePosition: function(cloneTo, cloneFrom){\n var pos = InkElement.offset(cloneFrom);\n cloneTo.style.left = pos[0]+'px';\n cloneTo.style.top = pos[1]+'px';\n\n return cloneTo;\n },\n\n /**\n * Text-overflow: ellipsis emulation\n * Slices off a piece of text at the end of the element and adds the ellipsis so all text fits inside.\n *\n * @method ellipsizeText\n * @param {DOMElement} element Element to modify text content\n * @param {String} [ellipsis]='\\u2026' String to append to the chopped text\n */\n ellipsizeText: function(element/*, ellipsis*/){\n if ((element = Ink.i(element))) {\n element.style.overflow = 'hidden';\n element.style.whiteSpace = 'nowrap';\n element.style.textOverflow = 'ellipsis';\n }\n },\n\n /**\n * Finds the closest ancestor element matching your test function\n * \n *\n * @method findUpwardsHaving\n * @param {DOMElement} element Element to base the search from\n * @param {Function} boolTest Testing function\n * @return {DOMElement|false} The matched element or false if did not match\n * @sample Ink_Dom_Element_1_findUpwardsHaving.html \n */\n findUpwardsHaving: function(element, boolTest) {\n while (element && element.nodeType === 1) {\n if (boolTest(element)) {\n return element;\n }\n element = element.parentNode;\n }\n return false;\n },\n\n /**\n * Finds the closest ancestor by class name\n *\n * @method findUpwardsByClass\n * @uses findUpwardsHaving\n * @param {DOMElement} element Element to base the search from\n * @param {String} className Class name to search\n * @returns {DOMElement|false} The matched element or false if did not match\n * @sample Ink_Dom_Element_1_findUpwardsByClass.html \n */\n findUpwardsByClass: function(element, className) {\n var re = new RegExp(\"(^|\\\\s)\" + className + \"(\\\\s|$)\");\n var tst = function(el) {\n var cls = el.className;\n return cls && re.test(cls);\n };\n return InkElement.findUpwardsHaving(element, tst);\n },\n\n /**\n * Finds the closest ancestor by tag name\n *\n * @method findUpwardsByTag\n * @param {DOMElement} element Element to base the search from\n * @param {String} tag Tag to search\n * @returns {DOMElement|false} the matched element or false if did not match\n * @sample Ink_Dom_Element_1_findUpwardsByTag.html \n */\n findUpwardsByTag: function(element, tag) {\n tag = tag.toUpperCase();\n var tst = function(el) {\n return el.nodeName && el.nodeName.toUpperCase() === tag;\n };\n return InkElement.findUpwardsHaving(element, tst);\n },\n\n /**\n * Finds the closest ancestor by id\n *\n * @method findUpwardsById\n * @param {HtmlElement} element Element to base the search from\n * @param {String} id ID to search\n * @returns {HtmlElement|false} The matched element or false if did not match\n * @sample Ink_Dom_Element_1_findUpwardsById.html \n */\n findUpwardsById: function(element, id) {\n var tst = function(el) {\n return el.id === id;\n };\n return InkElement.findUpwardsHaving(element, tst);\n },\n\n /**\n * Finds the closest ancestor by CSS selector\n *\n * @method findUpwardsBySelector\n * @param {HtmlElement} element Element to base the search from\n * @param {String} sel CSS selector\n * @returns {HtmlElement|false} The matched element or false if did not match\n * @sample Ink_Dom_Element_1_findUpwardsBySelector.html \n */\n findUpwardsBySelector: function(element, sel) {\n var Selector = Ink.getModule('Ink.Dom.Selector', '1');\n if (!Selector) {\n throw new Error('This method requires Ink.Dom.Selector');\n }\n var tst = function(el) {\n return Selector.matchesSelector(el, sel);\n };\n return InkElement.findUpwardsHaving(element, tst);\n },\n\n /**\n * Gets the trimmed text of an element\n *\n * @method getChildrenText\n * @param {DOMElement} el Element to base the search from\n * @param {Boolean} [removeIt] Flag to remove the text from the element\n * @return {String} Text found\n * @sample Ink_Dom_Element_1_getChildrenText.html \n */\n getChildrenText: function(el, removeIt) {\n var node,\n j,\n part,\n nodes = el.childNodes,\n jLen = nodes.length,\n text = '';\n\n if (!el) {\n return text;\n }\n\n for (j = 0; j < jLen; ++j) {\n node = nodes[j];\n if (!node) { continue; }\n if (node.nodeType === 3) { // TEXT NODE\n part = InkElement._trimString( String(node.data) );\n if (part.length > 0) {\n text += part;\n if (removeIt) { el.removeChild(node); }\n }\n else { el.removeChild(node); }\n }\n }\n\n return text;\n },\n\n /**\n * String trim implementation\n * Used by getChildrenText\n *\n * function _trimString\n * param {String} text\n * return {String} trimmed text\n */\n _trimString: function(text) {\n return (String.prototype.trim) ? text.trim() : text.replace(/^\\s*/, '').replace(/\\s*$/, '');\n },\n\n /**\n * Gets value of a select element\n *\n * @method getSelectValues\n * @param {DOMElement|String} select element\n * @return {Array} The selected values\n * @sample Ink_Dom_Element_1_getSelectValues.html \n */\n getSelectValues: function (select) {\n var selectEl = Ink.i(select);\n var values = [];\n for (var i = 0; i < selectEl.options.length; ++i) {\n values.push( selectEl.options[i].value );\n }\n return values;\n },\n\n\n /* used by fills */\n _normalizeData: function(data) {\n var d, data2 = [];\n for (var i = 0, f = data.length; i < f; ++i) {\n d = data[i];\n\n if (!(d instanceof Array)) { // if not array, wraps primitive twice: val -> [val, val]\n d = [d, d];\n }\n else if (d.length === 1) { // if 1 element array: [val] -> [val, val]\n d.push(d[0]);\n }\n data2.push(d);\n }\n return data2;\n },\n\n\n /**\n * Fills a select element with options\n *\n * @method fillSelect\n * @param {DOMElement|String} container Select element which will get filled\n * @param {Array} data Data to populate the component\n * @param {Boolean} [skipEmpty] Flag to skip empty option\n * @param {String|Number} [defaultValue] Initial selected value\n *\n * @sample Ink_Dom_Element_1_fillSelect.html \n */\n fillSelect: function(container, data, skipEmpty, defaultValue) {\n var containerEl = Ink.i(container);\n if (!containerEl) { return; }\n\n containerEl.innerHTML = '';\n var d, optionEl;\n\n if (!skipEmpty) {\n // add initial empty option\n optionEl = document.createElement('option');\n optionEl.setAttribute('value', '');\n containerEl.appendChild(optionEl);\n }\n\n data = InkElement._normalizeData(data);\n\n for (var i = 0, f = data.length; i < f; ++i) {\n d = data[i];\n\n optionEl = document.createElement('option');\n optionEl.setAttribute('value', d[0]);\n if (d.length > 2) {\n optionEl.setAttribute('extra', d[2]);\n }\n optionEl.appendChild( document.createTextNode(d[1]) );\n\n if (d[0] === defaultValue) {\n optionEl.setAttribute('selected', 'selected');\n }\n\n containerEl.appendChild(optionEl);\n }\n },\n\n\n /**\n * Creates a set of radio buttons from an array of data\n *\n * @method fillRadios\n * @param {DOMElement|String} insertAfterEl Element after which the input elements will be created\n * @param {String} name Name for the form field ([] is added if not present as a suffix)\n * @param {Array} data Data to populate the component\n * @param {Boolean} [skipEmpty] Flag to skip creation of empty options\n * @param {String|Number} [defaultValue] Initial selected value\n * @param {String} [splitEl] Name of element to add after each input element (example: 'br')\n * @return {DOMElement} Wrapper element around the radio buttons\n */\n fillRadios: function(insertAfterEl, name, data, skipEmpty, defaultValue, splitEl) {\n insertAfterEl = Ink.i(insertAfterEl);\n var containerEl = document.createElement('span');\n InkElement.insertAfter(containerEl, insertAfterEl);\n\n data = InkElement._normalizeData(data);\n\n /*\n if (name.substring(name.length - 1) !== ']') {\n name += '[]';\n }\n */\n\n var d, inputEl;\n\n if (!skipEmpty) {\n // add initial empty option\n inputEl = document.createElement('input');\n inputEl.setAttribute('type', 'radio');\n inputEl.setAttribute('name', name);\n inputEl.setAttribute('value', '');\n containerEl.appendChild(inputEl);\n if (splitEl) { containerEl.appendChild( document.createElement(splitEl) ); }\n }\n\n for (var i = 0; i < data.length; ++i) {\n d = data[i];\n\n inputEl = document.createElement('input');\n inputEl.setAttribute('type', 'radio');\n inputEl.setAttribute('name', name);\n inputEl.setAttribute('value', d[0]);\n containerEl.appendChild(inputEl);\n containerEl.appendChild( document.createTextNode(d[1]) );\n if (splitEl) { containerEl.appendChild( document.createElement(splitEl) ); }\n\n if (d[0] === defaultValue) {\n inputEl.checked = true;\n }\n }\n\n return containerEl;\n },\n\n\n /**\n * Creates set of checkbox buttons\n *\n * @method fillChecks\n * @param {DOMElement|String} insertAfterEl Element after which the input elements will be created\n * @param {String} name Name for the form field ([] is added if not present as a suffix)\n * @param {Array} data Data to populate the component\n * @param {Boolean} [skipEmpty] Flag to skip creation of empty options\n * @param {String|Number} [defaultValue] Initial selected value\n * @param {String} [splitEl] Name of element to add after each input element (example: 'br')\n * @return {DOMElement} Wrapper element around the checkboxes\n */\n fillChecks: function(insertAfterEl, name, data, defaultValue, splitEl) {\n insertAfterEl = Ink.i(insertAfterEl);\n var containerEl = document.createElement('span');\n InkElement.insertAfter(containerEl, insertAfterEl);\n\n data = InkElement._normalizeData(data);\n\n if (name.substring(name.length - 1) !== ']') {\n name += '[]';\n }\n\n var d, inputEl;\n\n for (var i = 0; i < data.length; ++i) {\n d = data[i];\n\n inputEl = document.createElement('input');\n inputEl.setAttribute('type', 'checkbox');\n inputEl.setAttribute('name', name);\n inputEl.setAttribute('value', d[0]);\n containerEl.appendChild(inputEl);\n containerEl.appendChild( document.createTextNode(d[1]) );\n if (splitEl) { containerEl.appendChild( document.createElement(splitEl) ); }\n\n if (d[0] === defaultValue) {\n inputEl.checked = true;\n }\n }\n\n return containerEl;\n },\n\n\n /**\n * Gets the index of an element relative to a parent\n *\n * @method parentIndexOf\n * @param {DOMElement} parentEl Element to parse\n * @param {DOMElement} childEl Child Element to look for\n * @return {Number} The index of the childEl inside parentEl. Returns -1 if it's not a direct child\n * @sample Ink_Dom_Element_1_parentIndexOf.html \n */\n parentIndexOf: function(parentEl, childEl) {\n var node, idx = 0;\n for (var i = 0, f = parentEl.childNodes.length; i < f; ++i) {\n node = parentEl.childNodes[i];\n if (node.nodeType === 1) { // ELEMENT\n if (node === childEl) { return idx; }\n ++idx;\n }\n }\n return -1;\n },\n\n\n /**\n * Gets the next siblings of an element\n *\n * @method nextSiblings\n * @param {String|DOMElement} elm Element\n * @return {Array} Array of next sibling elements\n * @sample Ink_Dom_Element_1_nextSiblings.html \n */\n nextSiblings: function(elm) {\n elm = Ink.i(elm);\n if(typeof(elm) === 'object' && elm !== null && elm.nodeType && elm.nodeType === 1) {\n var elements = [],\n siblings = elm.parentNode.children,\n index = InkElement.parentIndexOf(elm.parentNode, elm);\n\n for(var i = ++index, len = siblings.length; i\" + html + \"
            \" + deleteThisTbodyToken + \"
            \";\n } else {\n div.innerHTML = \"\" + html + \"
            \";\n }\n return div.firstChild;\n },\n TBODY: function (div, html) {\n div.innerHTML = '' + html + '
            ';\n return div.firstChild.getElementsByTagName('tbody')[0];\n },\n THEAD: function (div, html) {\n div.innerHTML = '' + html + '
            ';\n return div.firstChild.getElementsByTagName('thead')[0];\n },\n TFOOT: function (div, html) {\n div.innerHTML = '' + html + '
            ';\n return div.firstChild.getElementsByTagName('tfoot')[0];\n },\n TR: function (div, html) {\n div.innerHTML = '' + html + '
            ';\n return div.firstChild.firstChild.firstChild;\n }\n },\n\n /**\n * Gets a wrapper DIV with a certain HTML content to be inserted inside another element.\n * This is necessary for appendHTML,prependHTML functions, because they need a container element to copy the children from.\n *\n * Works around IE table quirks\n * @method _getWrapper\n * @private\n * @param elm\n * @param html\n */\n _getWrapper: function (elm, html) {\n var nodeName = elm.nodeName && elm.nodeName.toUpperCase();\n var wrapper = document.createElement('div');\n var wrapFunc = InkElement._wrapElements[nodeName];\n\n if ( !wrapFunc ) {\n wrapper.innerHTML = html;\n return wrapper;\n }\n // special cases\n wrapper = wrapFunc(wrapper, html);\n // worst case: tbody auto-creation even when our HTML has a tbody.\n if (browserCreatesTbodies && nodeName === 'TABLE') {\n // terrible case. Deal with tbody creation too.\n var tds = wrapper.getElementsByTagName('td');\n for (var i = 0, len = tds.length; i < len; i++) {\n if (tds[i].innerHTML === deleteThisTbodyToken) {\n var tbody = tds[i].parentNode.parentNode;\n tbody.parentNode.removeChild(tbody);\n }\n }\n }\n return wrapper;\n },\n\n /**\n * Appends HTML to an element.\n * This method parses the html string and doesn't modify its contents\n *\n * @method appendHTML\n * @param {String|DOMElement} elm Element\n * @param {String} html Markup string\n * @sample Ink_Dom_Element_1_appendHTML.html \n */\n appendHTML: function(elm, html){\n elm = Ink.i(elm);\n if(elm !== null) {\n var wrapper = InkElement._getWrapper(elm, html);\n while (wrapper.firstChild) {\n elm.appendChild(wrapper.firstChild);\n }\n }\n },\n\n /**\n * Prepends HTML to an element.\n * This method parses the html string and doesn't modify its contents\n *\n * @method prependHTML\n * @param {String|DOMElement} elm Element\n * @param {String} html Markup string\n * @sample Ink_Dom_Element_1_prependHTML.html \n */\n prependHTML: function(elm, html){\n elm = Ink.i(elm);\n if(elm !== null) {\n var wrapper = InkElement._getWrapper(elm, html);\n while (wrapper.lastChild) {\n elm.insertBefore(wrapper.lastChild, elm.firstChild);\n }\n }\n },\n\n /**\n * Sets the inner HTML of an element.\n *\n * @method setHTML\n * @param {String|DOMElement} elm Element\n * @param {String} html Markup string\n * @sample Ink_Dom_Element_1_setHTML.html \n */\n setHTML: function (elm, html) {\n elm = Ink.i(elm);\n if(elm !== null) {\n try {\n elm.innerHTML = html;\n } catch (e) {\n // Tables in IE7\n while (elm.firstChild) {\n elm.removeChild(elm.firstChild);\n }\n InkElement.appendHTML(elm, html);\n }\n }\n },\n\n /**\n * Wraps an element inside a container.\n *\n * The container may or may not be in the document yet.\n *\n * @method wrap\n * @param {String|DOMElement} target Element to be wrapped\n * @param {String|DOMElement} container Element to wrap the target\n * @return Container element\n * @sample Ink_Dom_Element_1_wrap.html \n *\n * @example\n * before:\n *\n *
            \n *\n * call this function to wrap #target with a wrapper div.\n *\n * InkElement.wrap('target', InkElement.create('div', {id: 'container'});\n * \n * after: \n *\n *
            \n */\n wrap: function (target, container) {\n target = Ink.i(target);\n container = Ink.i(container);\n \n var nextNode = target.nextSibling;\n var parent = target.parentNode;\n\n container.appendChild(target);\n\n if (nextNode !== null) {\n parent.insertBefore(container, nextNode);\n } else {\n parent.appendChild(container);\n }\n\n return container;\n },\n\n /**\n * Places an element outside a wrapper.\n *\n * @method unwrap\n * @param {DOMElement} elem The element you're trying to unwrap. This should be an ancestor of the wrapper.\n * @param {String} [wrapperSelector] CSS Selector for the ancestor. Use this if your wrapper is not the direct parent of elem.\n * @sample Ink_Dom_Element_1_unwrap.html \n *\n * @example\n *\n * When you have this:\n *\n *
            \n *
            \n *
            \n *\n * If you do this:\n *\n * InkElement.unwrap('unwrapMe');\n *\n * You get this:\n *\n *
            \n *
            \n * \n **/\n unwrap: function (elem, wrapperSelector) {\n elem = Ink.i(elem);\n var wrapper;\n if (typeof wrapperSelector === 'string') {\n wrapper = InkElement.findUpwardsBySelector(elem, wrapperSelector);\n } else if (typeof wrapperSelector === 'object' && wrapperSelector.tagName) {\n wrapper = InkElement.findUpwardsHaving(elem, function (ancestor) {\n return ancestor === wrapperSelector;\n });\n } else {\n wrapper = elem.parentNode;\n }\n if (!wrapper || !wrapper.parentNode) { return; }\n\n InkElement.insertBefore(elem, wrapper);\n },\n\n /**\n * Replaces an element with another.\n *\n * @method replace\n * @param element The element to be replaced.\n * @param replacement The new element.\n * @sample Ink_Dom_Element_1_replace.html \n *\n * @example\n * var newelement1 = InkElement.create('div');\n * // ...\n * replace(Ink.i('element1'), newelement1);\n */\n replace: function (element, replacement) {\n element = Ink.i(element);\n if(element !== null) {\n element.parentNode.replaceChild(replacement, element);\n }\n },\n\n /**\n * Removes direct text children.\n * Useful to remove nasty layout gaps generated by whitespace on the markup.\n *\n * @method removeTextNodeChildren\n * @param {DOMElement} el Element to remove text from\n * @sample Ink_Dom_Element_1_removeTextNodeChildren.html \n */\n removeTextNodeChildren: function(el) {\n el = Ink.i(el);\n if(el !== null) {\n var prevEl, toRemove, parent = el;\n el = el.firstChild;\n while (el) {\n toRemove = (el.nodeType === 3);\n prevEl = el;\n el = el.nextSibling;\n if (toRemove) {\n parent.removeChild(prevEl);\n }\n }\n }\n },\n\n /**\n * Creates a documentFragment from an HTML string.\n *\n * @method htmlToFragment\n * @param {String} html HTML string\n * @return {DocumentFragment} DocumentFragment containing all of the elements from the html string\n * @sample Ink_Dom_Element_1_htmlToFragment.html \n */\n htmlToFragment: (createContextualFragmentSupport ?\n function(html){\n var range;\n\n if(typeof html !== 'string'){ return document.createDocumentFragment(); }\n\n range = document.createRange();\n\n // set the context to document.body (firefox does this already, webkit doesn't)\n range.selectNode(document.body);\n\n return range.createContextualFragment(html);\n } : function (html) {\n var fragment = document.createDocumentFragment(),\n tempElement,\n current;\n\n if(typeof html !== 'string'){ return fragment; }\n\n tempElement = document.createElement('div');\n tempElement.innerHTML = html;\n\n // append child removes elements from the original parent\n while( (current = tempElement.firstChild) ){ // intentional assignment\n fragment.appendChild(current);\n }\n\n return fragment;\n }),\n\n _camelCase: function(str)\n {\n return str ? str.replace(/-(\\w)/g, function (_, $1){\n return $1.toUpperCase();\n }) : str;\n },\n\n /**\n * Gets data attributes from an element\n *\n * @method data\n * @param {String|DOMElement} selector Element or CSS selector\n * @return {Object} Object with the data-* properties. If no data-attributes are present, an empty object is returned.\n * @sample Ink_Dom_Element_1_data.html \n */\n data: function(selector) {\n var el;\n if (typeof selector !== 'object' && typeof selector !== 'string') {\n throw '[Ink.Dom.Element.data] :: Invalid selector defined';\n }\n\n if (typeof selector === 'object') {\n el = selector;\n }\n else {\n var InkDomSelector = Ink.getModule('Ink.Dom.Selector', 1);\n if (!InkDomSelector) {\n throw \"[Ink.Dom.Element.data] :: this method requires Ink.Dom.Selector - v1\";\n }\n el = InkDomSelector.select(selector);\n if (el.length <= 0) {\n throw \"[Ink.Dom.Element.data] :: Can't find any element with the specified selector\";\n }\n el = el[0];\n }\n\n var dataset = {};\n var attrs = el.attributes || [];\n\n var curAttr, curAttrName, curAttrValue;\n if (attrs) {\n for (var i = 0, total = attrs.length; i < total; ++i) {\n curAttr = attrs[i];\n curAttrName = curAttr.name;\n curAttrValue = curAttr.value;\n if (curAttrName && curAttrName.indexOf('data-') === 0) {\n dataset[InkElement._camelCase(curAttrName.replace('data-', ''))] = curAttrValue;\n }\n }\n }\n\n return dataset;\n },\n\n /**\n * Move the cursor on an input or textarea element.\n * @method moveCursorTo\n * @param {DOMElement} el Input or Textarea element\n * @param {Number} t Index of the character to move the cursor to\n * @sample Ink_Dom_Element_1_moveCursorTo.html \n */\n moveCursorTo: function(el, t) {\n el = Ink.i(el);\n if(el !== null) {\n if (el.setSelectionRange) {\n el.setSelectionRange(t, t);\n //el.focus();\n }\n else {\n var range = el.createTextRange();\n range.collapse(true);\n range.moveEnd( 'character', t);\n range.moveStart('character', t);\n range.select();\n }\n }\n },\n\n /**\n * Get the page's width.\n * @method pageWidth\n * @return {Number} Page width in pixels\n * @sample Ink_Dom_Element_1_pageWidth.html \n */\n pageWidth: function() {\n var xScroll;\n\n if (window.innerWidth && window.scrollMaxX) {\n xScroll = window.innerWidth + window.scrollMaxX;\n } else if (document.body.scrollWidth > document.body.offsetWidth){\n xScroll = document.body.scrollWidth;\n } else {\n xScroll = document.body.offsetWidth;\n }\n\n var windowWidth;\n\n if (window.self.innerWidth) {\n if(document.documentElement.clientWidth){\n windowWidth = document.documentElement.clientWidth;\n } else {\n windowWidth = window.self.innerWidth;\n }\n } else if (document.documentElement && document.documentElement.clientWidth) {\n windowWidth = document.documentElement.clientWidth;\n } else if (document.body) {\n windowWidth = document.body.clientWidth;\n }\n\n if(xScroll < windowWidth){\n return xScroll;\n } else {\n return windowWidth;\n }\n },\n\n /**\n * Get the page's height.\n * @method pageHeight\n * @return {Number} Page height in pixels\n * @sample Ink_Dom_Element_1_pageHeight.html \n */\n pageHeight: function() {\n var yScroll;\n\n if (window.innerHeight && window.scrollMaxY) {\n yScroll = window.innerHeight + window.scrollMaxY;\n } else if (document.body.scrollHeight > document.body.offsetHeight){\n yScroll = document.body.scrollHeight;\n } else {\n yScroll = document.body.offsetHeight;\n }\n\n var windowHeight;\n\n if (window.self.innerHeight) {\n windowHeight = window.self.innerHeight;\n } else if (document.documentElement && document.documentElement.clientHeight) {\n windowHeight = document.documentElement.clientHeight;\n } else if (document.body) {\n windowHeight = document.body.clientHeight;\n }\n\n if(yScroll < windowHeight){\n return windowHeight;\n } else {\n return yScroll;\n }\n },\n\n /**\n * Get the viewport's width.\n * @method viewportWidth\n * @return {Number} Viewport width in pixels\n * @sample Ink_Dom_Element_1_viewportWidth.html \n */\n viewportWidth: function() {\n if(typeof window.innerWidth !== \"undefined\") {\n return window.innerWidth;\n }\n if (document.documentElement && typeof document.documentElement.offsetWidth !== \"undefined\") {\n return document.documentElement.offsetWidth;\n }\n },\n\n /**\n * Get the viewport's height.\n * @method viewportHeight\n * @return {Number} Viewport height in pixels\n * @sample Ink_Dom_Element_1_viewportHeight.html \n */\n viewportHeight: function() {\n if (typeof window.innerHeight !== \"undefined\") {\n return window.innerHeight;\n }\n if (document.documentElement && typeof document.documentElement.offsetHeight !== \"undefined\") {\n return document.documentElement.offsetHeight;\n }\n },\n\n /**\n * Get the scroll's width.\n * @method scrollWidth\n * @return {Number} Scroll width\n */\n scrollWidth: function() {\n if (typeof window.self.pageXOffset !== 'undefined') {\n return window.self.pageXOffset;\n }\n if (typeof document.documentElement !== 'undefined' && typeof document.documentElement.scrollLeft !== 'undefined') {\n return document.documentElement.scrollLeft;\n }\n return document.body.scrollLeft;\n },\n\n /**\n * Get the scroll's height.\n * @method scrollHeight\n * @return {Number} Scroll height\n */\n scrollHeight: function() {\n if (typeof window.self.pageYOffset !== 'undefined') {\n return window.self.pageYOffset;\n }\n if (typeof document.documentElement !== 'undefined' && typeof document.documentElement.scrollTop !== 'undefined') {\n return document.documentElement.scrollTop;\n }\n return document.body.scrollTop;\n }\n };\n\n return InkElement;\n\n});\n","/**\n * Event management\n * @module Ink.Dom.Event_1\n * @version 1\n */\n\nInk.createModule('Ink.Dom.Event', 1, [], function() {\n /* jshint\n asi:true,\n strict:false,\n laxcomma:true,\n eqeqeq:false,\n laxbreak:true,\n boss:true,\n curly:false,\n expr:true\n */\n\n /**\n * @namespace Ink.Dom.Event_1\n * @static\n */\n\n /*!\n * Bean - copyright (c) Jacob Thornton 2011-2012\n * https://github.com/fat/bean\n * MIT license\n */\n var bean = (function (name, context, definition) {\n return definition()\n })('bean', this, function (name, context) {\n name = name || 'bean'\n context = context || this\n\n var win = window\n , old = context[name]\n , namespaceRegex = /[^\\.]*(?=\\..*)\\.|.*/\n , nameRegex = /\\..*/\n , addEvent = 'addEventListener'\n , removeEvent = 'removeEventListener'\n , doc = document || {}\n , root = doc.documentElement || {}\n , W3C_MODEL = root[addEvent]\n , eventSupport = W3C_MODEL ? addEvent : 'attachEvent'\n , ONE = {} // singleton for quick matching making add() do one()\n\n , slice = Array.prototype.slice\n , str2arr = function (s, d) { return s.split(d || ' ') }\n , isString = function (o) { return typeof o == 'string' }\n , isFunction = function (o) { return typeof o == 'function' }\n\n // events that we consider to be 'native', anything not in this list will\n // be treated as a custom event\n , standardNativeEvents =\n 'click dblclick mouseup mousedown contextmenu ' + // mouse buttons\n 'mousewheel mousemultiwheel DOMMouseScroll ' + // mouse wheel\n 'mouseover mouseout mousemove selectstart selectend ' + // mouse movement\n 'keydown keypress keyup ' + // keyboard\n 'orientationchange ' + // mobile\n 'focus blur change reset select submit ' + // form elements\n 'load unload beforeunload resize move DOMContentLoaded ' + // window\n 'readystatechange message ' + // window\n 'error abort scroll ' // misc\n // element.fireEvent('onXYZ'... is not forgiving if we try to fire an event\n // that doesn't actually exist, so make sure we only do these on newer browsers\n , w3cNativeEvents =\n 'show ' + // mouse buttons\n 'input invalid ' + // form elements\n 'touchstart touchmove touchend touchcancel ' + // touch\n 'gesturestart gesturechange gestureend ' + // gesture\n 'textinput' + // TextEvent\n 'readystatechange pageshow pagehide popstate ' + // window\n 'hashchange offline online ' + // window\n 'afterprint beforeprint ' + // printing\n 'dragstart dragenter dragover dragleave drag drop dragend ' + // dnd\n 'loadstart progress suspend emptied stalled loadmetadata ' + // media\n 'loadeddata canplay canplaythrough playing waiting seeking ' + // media\n 'seeked ended durationchange timeupdate play pause ratechange ' + // media\n 'volumechange cuechange ' + // media\n 'checking noupdate downloading cached updateready obsolete ' // appcache\n\n // convert to a hash for quick lookups\n , nativeEvents = (function (hash, events, i) {\n for (i = 0; i < events.length; i++) events[i] && (hash[events[i]] = 1)\n return hash\n }({}, str2arr(standardNativeEvents + (W3C_MODEL ? w3cNativeEvents : ''))))\n\n // custom events are events that we *fake*, they are not provided natively but\n // we can use native events to generate them\n , customEvents = (function () {\n var isAncestor = 'compareDocumentPosition' in root\n ? function (element, container) {\n return container.compareDocumentPosition && (container.compareDocumentPosition(element) & 16) === 16\n }\n : 'contains' in root\n ? function (element, container) {\n container = container.nodeType === 9 || container === window ? root : container\n return container !== element && container.contains(element)\n }\n : function (element, container) {\n while (element = element.parentNode) if (element === container) return 1\n return 0\n }\n , check = function (event) {\n var related = event.relatedTarget\n return !related\n ? related == null\n : (related !== this && related.prefix !== 'xul' && !/document/.test(this.toString())\n && !isAncestor(related, this))\n }\n\n return {\n mouseenter: { base: 'mouseover', condition: check }\n , mouseleave: { base: 'mouseout', condition: check }\n , mousewheel: { base: /Firefox/.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel' }\n }\n }())\n\n // we provide a consistent Event object across browsers by taking the actual DOM\n // event object and generating a new one from its properties.\n , Event = (function () {\n // a whitelist of properties (for different event types) tells us what to check for and copy\n var commonProps = str2arr('altKey attrChange attrName bubbles cancelable ctrlKey currentTarget ' +\n 'detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey ' +\n 'srcElement target timeStamp type view which propertyName')\n , mouseProps = commonProps.concat(str2arr('button buttons clientX clientY dataTransfer ' +\n 'fromElement offsetX offsetY pageX pageY screenX screenY toElement'))\n , mouseWheelProps = mouseProps.concat(str2arr('wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ ' +\n 'axis')) // 'axis' is FF specific\n , keyProps = commonProps.concat(str2arr('char charCode key keyCode keyIdentifier ' +\n 'keyLocation location'))\n , textProps = commonProps.concat(str2arr('data'))\n , touchProps = commonProps.concat(str2arr('touches targetTouches changedTouches scale rotation'))\n , messageProps = commonProps.concat(str2arr('data origin source'))\n , stateProps = commonProps.concat(str2arr('state'))\n , overOutRegex = /over|out/\n // some event types need special handling and some need special properties, do that all here\n , typeFixers = [\n { // key events\n reg: /key/i\n , fix: function (event, newEvent) {\n newEvent.keyCode = event.keyCode || event.which\n return keyProps\n }\n }\n , { // mouse events\n reg: /click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i\n , fix: function (event, newEvent, type) {\n newEvent.rightClick = event.which === 3 || event.button === 2\n newEvent.pos = { x: 0, y: 0 }\n if (event.pageX || event.pageY) {\n newEvent.clientX = event.pageX\n newEvent.clientY = event.pageY\n } else if (event.clientX || event.clientY) {\n newEvent.clientX = event.clientX + doc.body.scrollLeft + root.scrollLeft\n newEvent.clientY = event.clientY + doc.body.scrollTop + root.scrollTop\n }\n if (overOutRegex.test(type)) {\n newEvent.relatedTarget = event.relatedTarget\n || event[(type == 'mouseover' ? 'from' : 'to') + 'Element']\n }\n return mouseProps\n }\n }\n , { // mouse wheel events\n reg: /mouse.*(wheel|scroll)/i\n , fix: function () { return mouseWheelProps }\n }\n , { // TextEvent\n reg: /^text/i\n , fix: function () { return textProps }\n }\n , { // touch and gesture events\n reg: /^touch|^gesture/i\n , fix: function () { return touchProps }\n }\n , { // message events\n reg: /^message$/i\n , fix: function () { return messageProps }\n }\n , { // popstate events\n reg: /^popstate$/i\n , fix: function () { return stateProps }\n }\n , { // everything else\n reg: /.*/\n , fix: function () { return commonProps }\n }\n ]\n , typeFixerMap = {} // used to map event types to fixer functions (above), a basic cache mechanism\n\n , Event = function (event, element, isNative) {\n if (!arguments.length) return\n event = event || ((element.ownerDocument || element.document || element).parentWindow || win).event\n this.originalEvent = event\n this.isNative = isNative\n this.isBean = true\n\n if (!event) return\n\n var type = event.type\n , target = event.target || event.srcElement\n , i, l, p, props, fixer\n\n this.target = target && target.nodeType === 3 ? target.parentNode : target\n\n if (isNative) { // we only need basic augmentation on custom events, the rest expensive & pointless\n fixer = typeFixerMap[type]\n if (!fixer) { // haven't encountered this event type before, map a fixer function for it\n for (i = 0, l = typeFixers.length; i < l; i++) {\n if (typeFixers[i].reg.test(type)) { // guaranteed to match at least one, last is .*\n typeFixerMap[type] = fixer = typeFixers[i].fix\n break\n }\n }\n }\n\n props = fixer(event, this, type)\n for (i = props.length; i--;) {\n if (!((p = props[i]) in this) && p in event) this[p] = event[p]\n }\n }\n }\n\n // preventDefault() and stopPropagation() are a consistent interface to those functions\n // on the DOM, stop() is an alias for both of them together\n Event.prototype.preventDefault = function () {\n if (this.originalEvent.preventDefault) this.originalEvent.preventDefault()\n else this.originalEvent.returnValue = false\n }\n Event.prototype.stopPropagation = function () {\n if (this.originalEvent.stopPropagation) this.originalEvent.stopPropagation()\n else this.originalEvent.cancelBubble = true\n }\n Event.prototype.stop = function () {\n this.preventDefault()\n this.stopPropagation()\n this.stopped = true\n }\n // stopImmediatePropagation() has to be handled internally because we manage the event list for\n // each element\n // note that originalElement may be a Bean#Event object in some situations\n Event.prototype.stopImmediatePropagation = function () {\n if (this.originalEvent.stopImmediatePropagation) this.originalEvent.stopImmediatePropagation()\n this.isImmediatePropagationStopped = function () { return true }\n }\n Event.prototype.isImmediatePropagationStopped = function () {\n return this.originalEvent.isImmediatePropagationStopped && this.originalEvent.isImmediatePropagationStopped()\n }\n Event.prototype.clone = function (currentTarget) {\n //TODO: this is ripe for optimisation, new events are *expensive*\n // improving this will speed up delegated events\n var ne = new Event(this, this.element, this.isNative)\n ne.currentTarget = currentTarget\n return ne\n }\n\n return Event\n }())\n\n // if we're in old IE we can't do onpropertychange on doc or win so we use doc.documentElement for both\n , targetElement = function (element, isNative) {\n return !W3C_MODEL && !isNative && (element === doc || element === win) ? root : element\n }\n\n /**\n * Bean maintains an internal registry for event listeners. We don't touch elements, objects\n * or functions to identify them, instead we store everything in the registry.\n * Each event listener has a RegEntry object, we have one 'registry' for the whole instance.\n */\n , RegEntry = (function () {\n // each handler is wrapped so we can handle delegation and custom events\n var wrappedHandler = function (element, fn, condition, args) {\n var call = function (event, eargs) {\n return fn.apply(element, args ? slice.call(eargs, event ? 0 : 1).concat(args) : eargs)\n }\n , findTarget = function (event, eventElement) {\n return fn.__beanDel ? fn.__beanDel.ft(event.target, element) : eventElement\n }\n , handler = condition\n ? function (event) {\n var target = findTarget(event, this) // deleated event\n if (condition.apply(target, arguments)) {\n if (event) event.currentTarget = target\n return call(event, arguments)\n }\n }\n : function (event) {\n if (fn.__beanDel) event = event.clone(findTarget(event)) // delegated event, fix the fix\n return call(event, arguments)\n }\n handler.__beanDel = fn.__beanDel\n return handler\n }\n\n , RegEntry = function (element, type, handler, original, namespaces, args, root) {\n var customType = customEvents[type]\n , isNative\n\n if (type == 'unload') {\n // self clean-up\n handler = once(removeListener, element, type, handler, original)\n }\n\n if (customType) {\n if (customType.condition) {\n handler = wrappedHandler(element, handler, customType.condition, args)\n }\n type = customType.base || type\n }\n\n this.isNative = isNative = nativeEvents[type] && !!element[eventSupport]\n this.customType = !W3C_MODEL && !isNative && type\n this.element = element\n this.type = type\n this.original = original\n this.namespaces = namespaces\n this.eventType = W3C_MODEL || isNative ? type : 'propertychange'\n this.target = targetElement(element, isNative)\n this[eventSupport] = !!this.target[eventSupport]\n this.root = root\n this.handler = wrappedHandler(element, handler, null, args)\n }\n\n // given a list of namespaces, is our entry in any of them?\n RegEntry.prototype.inNamespaces = function (checkNamespaces) {\n var i, j, c = 0\n if (!checkNamespaces) return true\n if (!this.namespaces) return false\n for (i = checkNamespaces.length; i--;) {\n for (j = this.namespaces.length; j--;) {\n if (checkNamespaces[i] == this.namespaces[j]) c++\n }\n }\n return checkNamespaces.length === c\n }\n\n // match by element, original fn (opt), handler fn (opt)\n RegEntry.prototype.matches = function (checkElement, checkOriginal, checkHandler) {\n return this.element === checkElement &&\n (!checkOriginal || this.original === checkOriginal) &&\n (!checkHandler || this.handler === checkHandler)\n }\n\n return RegEntry\n }())\n\n , registry = (function () {\n // our map stores arrays by event type, just because it's better than storing\n // everything in a single array.\n // uses '$' as a prefix for the keys for safety and 'r' as a special prefix for\n // rootListeners so we can look them up fast\n var map = {}\n\n // generic functional search of our registry for matching listeners,\n // `fn` returns false to break out of the loop\n , forAll = function (element, type, original, handler, root, fn) {\n var pfx = root ? 'r' : '$'\n if (!type || type == '*') {\n // search the whole registry\n for (var t in map) {\n if (t.charAt(0) == pfx) {\n forAll(element, t.substr(1), original, handler, root, fn)\n }\n }\n } else {\n var i = 0, l, list = map[pfx + type], all = element == '*'\n if (!list) return\n for (l = list.length; i < l; i++) {\n if ((all || list[i].matches(element, original, handler)) && !fn(list[i], list, i, type)) return\n }\n }\n }\n\n , has = function (element, type, original, root) {\n // we're not using forAll here simply because it's a bit slower and this\n // needs to be fast\n var i, list = map[(root ? 'r' : '$') + type]\n if (list) {\n for (i = list.length; i--;) {\n if (!list[i].root && list[i].matches(element, original, null)) return true\n }\n }\n return false\n }\n\n , get = function (element, type, original, root) {\n var entries = []\n forAll(element, type, original, null, root, function (entry) {\n return entries.push(entry)\n })\n return entries\n }\n\n , put = function (entry) {\n var has = !entry.root && !this.has(entry.element, entry.type, null, false)\n , key = (entry.root ? 'r' : '$') + entry.type\n ;(map[key] || (map[key] = [])).push(entry)\n return has\n }\n\n , del = function (entry) {\n forAll(entry.element, entry.type, null, entry.handler, entry.root, function (entry, list, i) {\n list.splice(i, 1)\n entry.removed = true\n if (list.length === 0) delete map[(entry.root ? 'r' : '$') + entry.type]\n return false\n })\n }\n\n // dump all entries, used for onunload\n , entries = function () {\n var t, entries = []\n for (t in map) {\n if (t.charAt(0) == '$') entries = entries.concat(map[t])\n }\n return entries\n }\n\n return { has: has, get: get, put: put, del: del, entries: entries }\n }())\n\n // we need a selector engine for delegated events, use querySelectorAll if it exists\n // but for older browsers we need Qwery, Sizzle or similar\n , selectorEngine\n , setSelectorEngine = function (e) {\n if (!arguments.length) {\n selectorEngine = doc.querySelectorAll\n ? function (s, r) {\n return r.querySelectorAll(s)\n }\n : function () {\n throw new Error('Bean: No selector engine installed') // eeek\n }\n } else {\n selectorEngine = e\n }\n }\n\n // we attach this listener to each DOM event that we need to listen to, only once\n // per event type per DOM element\n , rootListener = function (event, type) {\n if (!W3C_MODEL && type && event && event.propertyName != '_on' + type) return\n\n var listeners = registry.get(this, type || event.type, null, false)\n , l = listeners.length\n , i = 0\n\n event = new Event(event, this, true)\n if (type) event.type = type\n\n // iterate through all handlers registered for this type, calling them unless they have\n // been removed by a previous handler or stopImmediatePropagation() has been called\n for (; i < l && !event.isImmediatePropagationStopped(); i++) {\n if (!listeners[i].removed) listeners[i].handler.call(this, event)\n }\n }\n\n // add and remove listeners to DOM elements\n , listener = W3C_MODEL\n ? function (element, type, add) {\n // new browsers\n element[add ? addEvent : removeEvent](type, rootListener, false)\n }\n : function (element, type, add, custom) {\n // IE8 and below, use attachEvent/detachEvent and we have to piggy-back propertychange events\n // to simulate event bubbling etc.\n var entry\n if (add) {\n registry.put(entry = new RegEntry(\n element\n , custom || type\n , function (event) { // handler\n rootListener.call(element, event, custom)\n }\n , rootListener\n , null\n , null\n , true // is root\n ))\n if (custom && element['_on' + custom] == null) element['_on' + custom] = 0\n entry.target.attachEvent('on' + entry.eventType, entry.handler)\n } else {\n entry = registry.get(element, custom || type, rootListener, true)[0]\n if (entry) {\n entry.target.detachEvent('on' + entry.eventType, entry.handler)\n registry.del(entry)\n }\n }\n }\n\n , once = function (rm, element, type, fn, originalFn) {\n // wrap the handler in a handler that does a remove as well\n return function () {\n fn.apply(this, arguments)\n rm(element, type, originalFn)\n }\n }\n\n , removeListener = function (element, orgType, handler, namespaces) {\n var type = orgType && orgType.replace(nameRegex, '')\n , handlers = registry.get(element, type, null, false)\n , removed = {}\n , i, l\n\n for (i = 0, l = handlers.length; i < l; i++) {\n if ((!handler || handlers[i].original === handler) && handlers[i].inNamespaces(namespaces)) {\n // TODO: this is problematic, we have a registry.get() and registry.del() that\n // both do registry searches so we waste cycles doing this. Needs to be rolled into\n // a single registry.forAll(fn) that removes while finding, but the catch is that\n // we'll be splicing the arrays that we're iterating over. Needs extra tests to\n // make sure we don't screw it up. @rvagg\n registry.del(handlers[i])\n if (!removed[handlers[i].eventType] && handlers[i][eventSupport])\n removed[handlers[i].eventType] = { t: handlers[i].eventType, c: handlers[i].type }\n }\n }\n // check each type/element for removed listeners and remove the rootListener where it's no longer needed\n for (i in removed) {\n if (!registry.has(element, removed[i].t, null, false)) {\n // last listener of this type, remove the rootListener\n listener(element, removed[i].t, false, removed[i].c)\n }\n }\n }\n\n // set up a delegate helper using the given selector, wrap the handler function\n , delegate = function (selector, fn) {\n //TODO: findTarget (therefore $) is called twice, once for match and once for\n // setting e.currentTarget, fix this so it's only needed once\n var findTarget = function (target, root) {\n var i, array = isString(selector) ? selectorEngine(selector, root) : selector\n for (; target && target !== root; target = target.parentNode) {\n for (i = array.length; i--;) {\n if (array[i] === target) return target\n }\n }\n }\n , handler = function (e) {\n var match = findTarget(e.target, this)\n if (match) fn.apply(match, arguments)\n }\n\n // __beanDel isn't pleasant but it's a private function, not exposed outside of Bean\n handler.__beanDel = {\n ft : findTarget // attach it here for customEvents to use too\n , selector : selector\n }\n return handler\n }\n\n , fireListener = W3C_MODEL ? function (isNative, type, element) {\n // modern browsers, do a proper dispatchEvent()\n var evt = doc.createEvent(isNative ? 'HTMLEvents' : 'UIEvents')\n evt[isNative ? 'initEvent' : 'initUIEvent'](type, true, true, win, 1)\n element.dispatchEvent(evt)\n } : function (isNative, type, element) {\n // old browser use onpropertychange, just increment a custom property to trigger the event\n element = targetElement(element, isNative)\n isNative ? element.fireEvent('on' + type, doc.createEventObject()) : element['_on' + type]++\n }\n\n /**\n * Public API: off(), on(), add(), (remove()), one(), fire(), clone()\n */\n\n /**\n * off(element[, eventType(s)[, handler ]])\n */\n , off = function (element, typeSpec, fn) {\n var isTypeStr = isString(typeSpec)\n , k, type, namespaces, i\n\n if (isTypeStr && typeSpec.indexOf(' ') > 0) {\n // off(el, 't1 t2 t3', fn) or off(el, 't1 t2 t3')\n typeSpec = str2arr(typeSpec)\n for (i = typeSpec.length; i--;)\n off(element, typeSpec[i], fn)\n return element\n }\n\n type = isTypeStr && typeSpec.replace(nameRegex, '')\n if (type && customEvents[type]) type = customEvents[type].base\n\n if (!typeSpec || isTypeStr) {\n // off(el) or off(el, t1.ns) or off(el, .ns) or off(el, .ns1.ns2.ns3)\n if (namespaces = isTypeStr && typeSpec.replace(namespaceRegex, '')) namespaces = str2arr(namespaces, '.')\n removeListener(element, type, fn, namespaces)\n } else if (isFunction(typeSpec)) {\n // off(el, fn)\n removeListener(element, null, typeSpec)\n } else {\n // off(el, { t1: fn1, t2, fn2 })\n for (k in typeSpec) {\n if (typeSpec.hasOwnProperty(k)) off(element, k, typeSpec[k])\n }\n }\n\n return element\n }\n\n /**\n * on(element, eventType(s)[, selector], handler[, args ])\n */\n , on = function(element, events, selector, fn) {\n var originalFn, type, types, i, args, entry, first\n\n //TODO: the undefined check means you can't pass an 'args' argument, fix this perhaps?\n if (selector === undefined && typeof events == 'object') {\n //TODO: this can't handle delegated events\n for (type in events) {\n if (events.hasOwnProperty(type)) {\n on.call(this, element, type, events[type])\n }\n }\n return\n }\n\n if (!isFunction(selector)) {\n // delegated event\n originalFn = fn\n args = slice.call(arguments, 4)\n fn = delegate(selector, originalFn, selectorEngine)\n } else {\n args = slice.call(arguments, 3)\n fn = originalFn = selector\n }\n\n types = str2arr(events)\n\n // special case for one(), wrap in a self-removing handler\n if (this === ONE) {\n fn = once(off, element, events, fn, originalFn)\n }\n\n for (i = types.length; i--;) {\n // add new handler to the registry and check if it's the first for this element/type\n first = registry.put(entry = new RegEntry(\n element\n , types[i].replace(nameRegex, '') // event type\n , fn\n , originalFn\n , str2arr(types[i].replace(namespaceRegex, ''), '.') // namespaces\n , args\n , false // not root\n ))\n if (entry[eventSupport] && first) {\n // first event of this type on this element, add root listener\n listener(element, entry.eventType, true, entry.customType)\n }\n }\n\n return element\n }\n\n /**\n * add(element[, selector], eventType(s), handler[, args ])\n *\n * Deprecated: kept (for now) for backward-compatibility\n */\n , add = function (element, events, fn, delfn) {\n return on.apply(\n null\n , !isString(fn)\n ? slice.call(arguments)\n : [ element, fn, events, delfn ].concat(arguments.length > 3 ? slice.call(arguments, 5) : [])\n )\n }\n\n /**\n * one(element, eventType(s)[, selector], handler[, args ])\n */\n , one = function () {\n return on.apply(ONE, arguments)\n }\n\n /**\n * fire(element, eventType(s)[, args ])\n *\n * The optional 'args' argument must be an array, if no 'args' argument is provided\n * then we can use the browser's DOM event system, otherwise we trigger handlers manually\n */\n , fire = function (element, type, args) {\n var types = str2arr(type)\n , i, j, l, names, handlers\n\n for (i = types.length; i--;) {\n type = types[i].replace(nameRegex, '')\n if (names = types[i].replace(namespaceRegex, '')) names = str2arr(names, '.')\n if (!names && !args && element[eventSupport]) {\n fireListener(nativeEvents[type], type, element)\n } else {\n // non-native event, either because of a namespace, arguments or a non DOM element\n // iterate over all listeners and manually 'fire'\n handlers = registry.get(element, type, null, false)\n args = [false].concat(args)\n for (j = 0, l = handlers.length; j < l; j++) {\n if (handlers[j].inNamespaces(names)) {\n handlers[j].handler.apply(element, args)\n }\n }\n }\n }\n return element\n }\n\n /**\n * clone(dstElement, srcElement[, eventType ])\n *\n * TODO: perhaps for consistency we should allow the same flexibility in type specifiers?\n */\n , clone = function (element, from, type) {\n var handlers = registry.get(from, type, null, false)\n , l = handlers.length\n , i = 0\n , args, beanDel\n\n for (; i < l; i++) {\n if (handlers[i].original) {\n args = [ element, handlers[i].type ]\n if (beanDel = handlers[i].handler.__beanDel) args.push(beanDel.selector)\n args.push(handlers[i].original)\n on.apply(null, args)\n }\n }\n return element\n }\n\n , bean = {\n 'on' : on\n , 'add' : add\n , 'one' : one\n , 'off' : off\n , 'remove' : off\n , 'clone' : clone\n , 'fire' : fire\n , 'Event' : Event\n , 'setSelectorEngine' : setSelectorEngine\n , 'noConflict' : function () {\n context[name] = old\n return this\n }\n }\n\n // for IE, clean up on unload to avoid leaks\n if (win.attachEvent) {\n var cleanup = function () {\n var i, entries = registry.entries()\n for (i in entries) {\n if (entries[i].type && entries[i].type !== 'unload') off(entries[i].element, entries[i].type)\n }\n win.detachEvent('onunload', cleanup)\n win.CollectGarbage && win.CollectGarbage()\n }\n win.attachEvent('onunload', cleanup)\n }\n\n // initialize selector engine to internal default (qSA or throw Error)\n setSelectorEngine(Ink.ss)\n\n return bean\n });\n\n /**\n * Keep this declaration here and off Bean as it extends the Event\n * object and some properties are readonly in strict mode\n */\n 'use strict';\n\n var InkEvent = {\n\n KEY_BACKSPACE: 8,\n KEY_TAB: 9,\n KEY_RETURN: 13,\n KEY_ESC: 27,\n KEY_SPACE: 32,\n KEY_LEFT: 37,\n KEY_UP: 38,\n KEY_RIGHT: 39,\n KEY_DOWN: 40,\n KEY_DELETE: 46,\n KEY_HOME: 36,\n KEY_END: 35,\n KEY_PAGEUP: 33,\n KEY_PAGEDOWN: 34,\n KEY_INSERT: 45,\n \n /**\n * Creates a debounced version of a function.\n * Returns a function which calls `func`, waiting at least `wait` milliseconds between calls. This is useful for events such as `scroll` or `resize`, which can be triggered too many times per second, slowing down the browser with needless function calls.\n *\n * *note:* This does not delay the first function call to the function.\n *\n * @method throttle\n * @param {Function} func Function to call. Arguments and context are both passed.\n * @param {Number} [wait]=0 Milliseconds to wait between calls.\n * @sample Ink_Dom_Event_1_throttle.html \n **/\n throttle: function (func, wait) {\n wait = wait || 0;\n var lastCall = 0; // Warning: This breaks on Jan 1st 1970 0:00\n var timeout;\n var throttled = function () {\n var now = +new Date();\n var timeDiff = now - lastCall;\n if (timeDiff >= wait) {\n lastCall = now;\n return func.apply(this, [].slice.call(arguments));\n } else {\n var that = this;\n var args = [].slice.call(arguments);\n if (!timeout) {\n timeout = setTimeout(function () {\n timeout = null;\n return throttled.apply(that, args);\n }, wait - timeDiff);\n }\n }\n };\n return throttled;\n },\n\n /**\n * Gets the event's target element.\n *\n * @method element\n * @param {Object} ev Event object\n * @return {DOMNode} The target\n * @sample Ink_Dom_Event_1_element.html \n */\n element: function(ev) {\n var node = ev.delegationTarget ||\n ev.target ||\n // IE stuff\n (ev.type === 'mouseout' && ev.fromElement) ||\n (ev.type === 'mouseleave' && ev.fromElement) ||\n (ev.type === 'mouseover' && ev.toElement) ||\n (ev.type === 'mouseenter' && ev.toElement) ||\n ev.srcElement ||\n null;\n return node && (node.nodeType === 3 || node.nodeType === 4) ? node.parentNode : node;\n },\n\n /**\n * Gets the event's related target element.\n *\n * @method relatedTarget\n * @param {Object} ev event object\n * @return {DOMNode} The related target\n * @sample Ink_Dom_Event_1_relatedTarget.html \n */\n relatedTarget: function(ev){\n var node = ev.relatedTarget ||\n // IE stuff\n (ev.type === 'mouseout' && ev.toElement) ||\n (ev.type === 'mouseleave' && ev.toElement) ||\n (ev.type === 'mouseover' && ev.fromElement) ||\n (ev.type === 'mouseenter' && ev.fromElement) ||\n null;\n return node && (node.nodeType === 3 || node.nodeType === 4) ? node.parentNode : node;\n },\n\n /**\n * Find closest ancestor element by tag name related to the event target.\n * Navigate up the DOM tree, looking for a tag with the name `elmTagName`.\n *\n * If such tag is not found, `document` is returned.\n *\n * @method findElement\n * @param {Object} ev Event object\n * @param {String} elmTagName Tag name to find\n * @param {Boolean} [force]=false Flag to skip returning `document` and to return `false` instead.\n * @return {DOMElement} the first element which matches given tag name or the document element if the wanted tag is not found\n * @sample Ink_Dom_Event_1_findElement.html \n */\n findElement: function(ev, elmTagName, force)\n {\n var node = this.element(ev);\n while(true) {\n if(node.nodeName.toLowerCase() === elmTagName.toLowerCase()) {\n return node;\n } else {\n node = node.parentNode;\n if(!node) {\n if(force) {\n return false;\n }\n return document;\n }\n if(!node.parentNode){\n if(force){ return false; }\n return document;\n }\n }\n }\n },\n\n /**\n * Attaches an event to element\n *\n * @method observe\n * @param {DOMElement|String} element Element id or element\n * @param {String} eventName Event name\n * @param {Function} callBack Receives the event object as a parameter. If you're manually firing custom events, check it's eventName property to make sure you're handling the right event.\n * @param {Boolean} [useCapture] Flag to change event listening from bubbling to capture.\n * @return {Function} The event handler used. Hang on to this if you want to `stopObserving` later.\n * @sample Ink_Dom_Event_1_observe.html \n */\n observe: function(element, eventName, callBack, useCapture) {\n element = Ink.i(element);\n if(element) {\n if(element.addEventListener) {\n element.addEventListener(eventName, callBack, !!useCapture);\n } else {\n element.attachEvent('on' + eventName, (callBack = Ink.bind(callBack, element)));\n }\n return callBack;\n }\n },\n\n /**\n * Like observe, but listen to the event only once.\n *\n * @method observeOnce\n * @param {DOMElement|String} element Element id or element\n * @param {String} eventName Event name\n * @param {Function} callBack Receives the event object as a parameter. If you're manually firing custom events, check it's eventName property to make sure you're handling the right event.\n * @param {Boolean} [useCapture] Flag to change event listening from bubbling to capture.\n * @return {Function} The event handler used. Hang on to this if you want to `stopObserving` later.\n * @sample Ink_Dom_Event_1_observeOnce.html \n */\n observeOnce: function (element, eventName, callBack, useCapture) {\n var onceBack = function () {\n InkEvent.stopObserving(element, eventName, onceBack);\n return callBack();\n };\n return InkEvent.observe(element, eventName, onceBack, useCapture);\n },\n\n /**\n * Attaches an event to a selector or array of elements.\n *\n * @method observeMulti\n * @param {Array|String} elements \n * @param {String} eventName Event name\n * @param {Function} callBack Receives the event object as a parameter. If you're manually firing custom events, check it's eventName property to make sure you're handling the right event.\n * @param {Boolean} [useCapture] Flag change event listening from bubbling to capture.\n * @return {Function} The used callback.\n * @sample Ink_Dom_Event_1_observeMulti.html \n */\n observeMulti: function (elements, eventName, callBack, useCapture) {\n if (typeof elements === 'string') {\n elements = Ink.ss(elements);\n } else if ( /* is an element */ elements && elements.nodeType === 1) {\n elements = [elements];\n }\n if (!elements[0]) { return false; }\n\n for (var i = 0, len = elements.length; i < len; i++) {\n this.observe(elements[i], eventName, callBack, useCapture);\n }\n return callBack;\n },\n\n /**\n * Observes an event on an element and its descendants matching the selector.\n *\n * Requires Ink.Dom.Selector if you need to use a selector.\n *\n * @method observeDelegated\n * @param {DOMElement|String} element Element to observe.\n * @param {String} eventName Event name to observe.\n * @param {String} selector Child element selector. When null, finds any element.\n * @param {Function} callback Callback to be called when the event is fired\n * @return {Function} The used callback, for ceasing to listen to the event later.\n * @sample Ink_Dom_Event_1_observeDelegated.html \n **/\n observeDelegated: function (element, eventName, selector, callback) {\n return InkEvent.observe(element, eventName, function (event) {\n var fromElement = InkEvent.element(event);\n if (!fromElement || fromElement === element) { return; }\n\n var cursor = fromElement;\n\n // Go up the document tree until we hit the element itself.\n while (cursor !== element && cursor !== document && cursor) {\n if (Ink.Dom.Selector_1.matchesSelector(cursor, selector)) {\n event.delegationTarget = cursor;\n return callback(event);\n }\n cursor = cursor.parentNode;\n }\n });\n },\n\n /**\n * Removes an event attached to an element.\n *\n * @method stopObserving\n * @param {DOMElement|String} element Element id or element\n * @param {String} eventName Event name\n * @param {Function} callBack Callback function\n * @param {Boolean} [useCapture] Set to true if the event was being observed with useCapture set to true as well.\n * @sample Ink_Dom_Event_1_stopObserving.html \n */\n stopObserving: function(element, eventName, callBack, useCapture) {\n element = Ink.i(element);\n\n if(element) {\n if(element.removeEventListener) {\n element.removeEventListener(eventName, callBack, !!useCapture);\n } else {\n element.detachEvent('on' + eventName, callBack);\n }\n }\n },\n\n /**\n * Stops event propagation and bubbling.\n *\n * @method stop\n * @param {Object} event Event handle\n * @sample Ink_Dom_Event_1_stop.html \n */\n stop: function(event)\n {\n if(event.cancelBubble !== null) {\n event.cancelBubble = true;\n }\n if(event.stopPropagation) {\n event.stopPropagation();\n }\n if(event.preventDefault) {\n event.preventDefault();\n }\n if(window.attachEvent) {\n event.returnValue = false;\n }\n if(event.cancel !== null) {\n event.cancel = true;\n }\n },\n\n /**\n * Stops event propagation.\n *\n * @method stopPropagation\n * @param {Object} event Event handle\n * @sample Ink_Dom_Event_1_stopPropagation.html \n */\n stopPropagation: function(event) {\n if(event.cancelBubble !== null) {\n event.cancelBubble = true;\n }\n if(event.stopPropagation) {\n event.stopPropagation();\n }\n },\n\n /**\n * Stops event default behaviour.\n *\n * @method stopDefault\n * @param {Object} event Event handle\n * @sample Ink_Dom_Event_1_stopDefault.html \n */\n stopDefault: function(event)\n {\n if(event.preventDefault) {\n event.preventDefault();\n }\n if(window.attachEvent) {\n event.returnValue = false;\n }\n if(event.cancel !== null) {\n event.cancel = true;\n }\n },\n\n /**\n * Gets the pointer's coordinates from the event object.\n *\n * @method pointer\n * @param {Object} ev Event object\n * @return {Object} An object with the mouse X and Y position\n * @sample Ink_Dom_Event_1_pointer.html \n */\n pointer: function(ev)\n {\n return {\n x: this.pointerX(ev),\n y: this.pointerY(ev)\n };\n },\n\n /**\n * Gets the pointer's X coordinate.\n *\n * @method pointerX\n * @param {Object} ev Event object\n * @return {Number} Mouse X position\n */\n pointerX: function(ev)\n {\n return (ev.touches && ev.touches[0] && ev.touches[0].clientX) ||\n (ev.pageX) ||\n (ev.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft));\n },\n\n /**\n * Gets the pointer's Y coordinate.\n *\n * @method pointerY\n * @param {Object} ev Event object\n * @return {Number} Mouse Y position\n */\n pointerY: function(ev)\n {\n return (ev.touches && ev.touches[0] && ev.touches[0].clientY) ||\n (ev.pageY) ||\n (ev.clientY + (document.documentElement.scrollTop || document.body.scrollTop));\n },\n\n /**\n * Checks if an event is a left click.\n *\n * @method isLeftClick\n * @param {Object} ev Event object\n * @return {Boolean} True if the event is a left click\n * @sample Ink_Dom_Event_1_isLeftClick.html \n */\n isLeftClick: function(ev) {\n if (window.addEventListener) {\n if(ev.button === 0){\n return true;\n } else if(ev.type === 'touchend' && ev.button === null){\n // [todo] do the above check for pointerEvents too\n return true;\n }\n }\n else {\n if(ev.button === 1){ return true; }\n }\n return false;\n },\n\n /**\n * Checks if an event is a right click.\n *\n * @method isRightClick\n * @param {Object} ev Event object\n * @return {Boolean} True if the event is a right click\n * @sample Ink_Dom_Event_1_isRightClick.html \n */\n isRightClick: function(ev) {\n return (ev.button === 2);\n },\n\n /**\n * Checks if an event is a middle click.\n *\n * @method isMiddleClick\n * @param {Object} ev Event object\n * @return {Boolean} True if the event is a middle click\n * @sample Ink_Dom_Event_1_isMiddleClick.html \n */\n isMiddleClick: function(ev) {\n if (window.addEventListener) {\n return (ev.button === 1);\n }\n else {\n return (ev.button === 4);\n }\n return false;\n },\n\n /**\n * Gets character from an event.\n *\n * @method getCharFromKeyboardEvent\n * @param {Object} event Keyboard event\n * @param {Boolean} [changeCasing] If true uppercases, if false lowercases, otherwise keeps casing\n * @return {String} Character representation of pressed key combination\n * @sample Ink_Dom_Event_1_getCharFromKeyboardEvent.html \n */\n getCharFromKeyboardEvent: function(event, changeCasing) {\n var k = event.keyCode;\n var c = String.fromCharCode(k);\n\n var shiftOn = event.shiftKey;\n if (k >= 65 && k <= 90) { // A-Z\n if (typeof changeCasing === 'boolean') {\n shiftOn = changeCasing;\n }\n return (shiftOn) ? c : c.toLowerCase();\n }\n else if (k >= 96 && k <= 105) { // numpad digits\n return String.fromCharCode( 48 + (k-96) );\n }\n switch (k) {\n case 109: case 189: return '-';\n case 107: case 187: return '+';\n }\n return c;\n },\n\n debug: function(){}\n};\n\n/**\n * Lets you attach event listeners to both elements and objects.\n * http://github.com/fat/bean#on\n *\n * @method on\n * @param {DOMElement|Object} element An HTML DOM element or any JavaScript Object\n * @param {String} eventType An Event (or multiple events, space separated) to listen to\n * @param {String} [selector] A CSS DOM Element selector string to bind the listener to child elements matching the selector\n * @param {Function} [handler] The callback function\n * @param {Object} [args...] Additional arguments to pass to the callback function when triggered\n * \n * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object\n * @sample Ink_Dom_Event_1_on.html \n */\n\n/**\n * Alias for `on` but will only be executed once.\n * bean.one() is an alias for bean.on() except that the handler will only be executed once and then removed for the event type(s).\n * http://github.com/fat/bean#one\n *\n * @method one\n * @param {DOMElement|Object} element An HTML DOM element or any JavaScript Object\n * @param {String} eventType An Event (or multiple events, space separated) to listen to\n * @param {String} [selector] A CSS DOM Element selector string to bind the listener to child elements matching the selector\n * @param {Function} [handler] The callback function\n * @param [args...] Additional arguments to pass to the callback function when triggered\n * \n * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object\n * @sample Ink_Dom_Event_1_one.html \n */\n\n/**\n * Removes event handlers.\n * bean.off() is how you get rid of handlers once you no longer want them active. It's also a good idea to call off on elements before you remove them from your DOM; this gives Bean a chance to clean up some things and prevents memory leaks.\n * http://github.com/fat/bean#off\n *\n * @method off\n * @param {DOMElement|Object} element An HTML DOM element or any JavaScript Object\n * @param {String} eventType An Event (or multiple events, space separated) to remove\n * @param {Function} [handler] The specific callback function to remove\n * \n * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object\n * @sample Ink_Dom_Event_1_off.html \n */\n\n/**\n * Clones events from one object to another\n * bean.clone() is a method for cloning events from one DOM element or object to another.\n * http://github.com/fat/bean#clone\n *\n * @method clone\n * @param {DOMElement|Object} destElement An HTML DOM element or any JavaScript Object to copy events to\n * @param {String} srcElement An HTML DOM element or any JavaScript Object to copy events from\n * @param {String} [eventType] An Event (or multiple events, space separated) to clone\n * \n * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object\n * @sample Ink_Dom_Event_1_clone.html \n */\n\n/**\n * Triggers events.\n * http://github.com/fat/bean#fire\n *\n * @method fire\n * @param {DOMElement|Object} destElement An HTML DOM element or any JavaScript Object fire the event on\n * @param {String} eventType An Event (or multiple events, space separated) to fire\n * @param [args...] Additional arguments to pass to the callback function when triggered\n *\n * @return {DOMElement|Object} Returns the original DOM Element or Javascript Object\n * @sample Ink_Dom_Event_1_fire.html \n */\n\nreturn Ink.extendObj(InkEvent, bean);\n\n});\n","/**\n * @module Ink.Dom.FormSerialize_1\n * Two way serialization of form data and javascript objects.\n * Valid applications are ad hoc AJAX/syndicated submission of forms, restoring form values from server side state, etc.\n */\n\nInk.createModule('Ink.Dom.FormSerialize', 1, ['Ink.Util.Array_1', 'Ink.Dom.Element_1', 'Ink.Dom.Selector_1'], function (InkArray, InkElement, Selector) {\n 'use strict';\n\n // Check whether something is not a string or a DOM element, but still has length.\n function isArrayIsh(obj) {\n return obj != null &&\n (!InkElement.isDOMElement(obj)) &&\n (InkArray.isArray(obj) || (typeof obj !== 'string' && typeof obj.length === 'number'));\n }\n\n function toArray(obj) {\n if (isArrayIsh(obj)) { return obj; }\n else { return [obj]; }\n }\n\n /**\n * @namespace Ink.Dom.FormSerialize\n * @static\n **/\n var FormSerialize = {\n\n /**\n * Serializes a form element into a JS object\n * It turns field names into keys and field values into values.\n *\n * note: Multi-select and checkboxes with multiple values will result in arrays\n *\n * @method serialize\n * @param {DOMElement|String} form Form element to extract data\n * @return {Object} Map of fieldName -> String|String[]|Boolean\n * @sample Ink_Dom_FormSerialize_serialize.html \n */\n serialize: function(form) {\n var out = {};\n var emptyArrayToken = {}; // A hack so that empty select[multiple] elements appear although empty.\n\n var pairs = this.asPairs(form, { elements: true, emptyArray: emptyArrayToken });\n if (pairs == null) { return pairs; }\n InkArray.forEach(pairs, function (pair) {\n var name = pair[0].replace(/\\[\\]$/, '');\n var value = pair[1];\n var el = pair[2];\n\n if (value === emptyArrayToken) {\n out[name] = []; // It's an empty select[multiple]\n } else if (!(FormSerialize._resultsInArray(el) || /\\[\\]$/.test(pair[0]))) {\n out[name] = value;\n } else {\n out[name] = out[name] || [];\n out[name].push(value);\n }\n });\n\n return out;\n },\n\n /**\n * Like `serialize`, but returns an array of [fieldName, value] pairs.\n *\n * @method asPairs\n * @param {DOMElement|String} form Form element\n * @param {Object} [options] Options object, containing:\n * @param {Boolean} [options.elements] Instead of returning an array of [fieldName, value] pairs, return an array of [fieldName, value, fieldElement] triples.\n * @param {Boolean} [options.emptyArray] What to emit as the value of an empty select[multiple]. If you don't pass this option, nothing comes out.\n *\n * @return Array of [fieldName, value] pairs.\n **/\n asPairs: function (form, options) {\n var out = [];\n options = options || {};\n\n function emit(name, val, el) {\n if (options.elements) {\n out.push([name, val, el]);\n } else {\n out.push([name, val]);\n }\n }\n\n function serializeEl(el) {\n if (el.nodeName.toLowerCase() === 'select' && el.multiple) {\n var didEmit = false;\n InkArray.forEach(Selector.select('option:checked', el), function (thisOption) {\n emit(el.name, thisOption.value, el);\n didEmit = true;\n });\n if (!didEmit && 'emptyArray' in options) {\n emit(el.name, options.emptyArray, el);\n }\n } else {\n emit(el.name, el.value, el);\n }\n }\n\n if ((form = Ink.i(form))) {\n var inputs = InkArray.filter(form.elements, FormSerialize._isSerialized);\n for (var i = 0, len = inputs.length; i < len; i++) {\n serializeEl(inputs[i]);\n }\n return out;\n }\n\n return null;\n },\n\n /**\n * Sets form elements' values with values from an object\n *\n * Note: You can't set the values of an input with `type=\"file\"` (browser prohibits it)\n *\n * @method fillIn \n * @param {DOMElement|String} form Form element to be populated\n * @param {Object|Array} map2 mapping of fields to values contained in fields. Can be a hash (keys as names, strings or arrays for values), or an array of [name, value] pairs.\n * @sample Ink_Dom_FormSerialize_fillIn.html \n */\n fillIn: function(form, map2) {\n if (!(form = Ink.i(form))) { return null; }\n\n var pairs;\n\n if (typeof map2 === 'object' && !isArrayIsh(map2)) {\n pairs = FormSerialize._objToPairs(map2);\n } else if (isArrayIsh(map2)) {\n pairs = map2;\n } else {\n return null;\n }\n\n return FormSerialize._fillInPairs(form, pairs);\n },\n\n _objToPairs: function (obj) {\n var pairs = [];\n var val;\n for (var name in obj) if (obj.hasOwnProperty(name)) {\n val = toArray(obj[name]);\n for (var i = 0, len = val.length; i < len; i++) {\n pairs.push([name, val[i]]);\n }\n if (len === 0) {\n pairs.push([name, []]);\n }\n }\n return pairs;\n },\n\n _fillInPairs: function (form, pairs) {\n pairs = InkArray.groupBy(pairs, {\n key: function (pair) { return pair[0].replace(/\\[\\]$/, ''); }\n });\n\n // For each chunk...\n pairs = InkArray.map(pairs, function (pair) {\n // Join the items in the chunk by concatenating the values together and leaving the names alone\n var values = InkArray.reduce(pair, function (left, right) {\n return [null, left[1].concat([right[1]])];\n }, [null, []])[1];\n return [pair[0][0], values];\n });\n\n var name;\n var inputs;\n var values;\n for (var i = 0, len = pairs.length; i < len; i++) {\n name = pairs[i][0];\n\n if (name in form) {\n inputs = form[name];\n } else if ((name + '[]') in form) {\n inputs = form[name + '[]'];\n name = name + '[]';\n } else {\n continue;\n }\n\n inputs = toArray(inputs);\n values = pairs[i][1];\n\n FormSerialize._fillInOne(name, inputs, values);\n }\n },\n\n _fillInOne: function (name, inputs, values) {\n var firstOne = inputs[0];\n var firstNodeName = firstOne.nodeName.toLowerCase();\n var firstType = firstOne.getAttribute('type');\n firstType = firstType && firstType.toLowerCase();\n var isSelectMulti = firstNodeName === 'select' && InkElement.hasAttribute(firstOne, 'multiple');\n\n if (firstType === 'checkbox' || firstType === 'radio') {\n FormSerialize._fillInBoolean(inputs, values, 'checked');\n } else if (isSelectMulti) {\n FormSerialize._fillInBoolean(inputs[0].options, values, 'selected');\n } else {\n if (inputs.length !== values.length) {\n Ink.warn('Form had ' + inputs.length + ' inputs named \"' + name + '\", but received ' + values.length + ' values.');\n }\n\n for (var i = 0, len = Math.min(inputs.length, values.length); i < len; i += 1) {\n inputs[i].value = values[i];\n }\n }\n },\n\n _fillInBoolean: function (inputs, values, checkAttr /* 'selected' or 'checked' */) {\n InkArray.forEach(inputs, function (input) {\n var isChecked = InkArray.inArray(input.value, values);\n input[checkAttr] = isChecked;\n });\n },\n\n /**\n * Whether FormSerialize.serialize() should produce an array when looking at this element.\n * @method _resultsInArray\n * @private\n * @param element\n **/\n _resultsInArray: function (element) {\n var type = element.getAttribute('type');\n var nodeName = element.nodeName.toLowerCase();\n\n return type === 'checkbox' ||\n (nodeName === 'select' && InkElement.hasAttribute(element, 'multiple'));\n },\n\n _isSerialized: function (element) {\n if (!InkElement.isDOMElement(element)) { return false; }\n if (!InkElement.hasAttribute(element, 'name')) { return false; }\n\n var nodeName = element.nodeName.toLowerCase();\n\n if (!nodeName || nodeName === 'fieldset') { return false; }\n\n if (element.type === 'checkbox' || element.type === 'radio') {\n return !!element.checked;\n }\n\n return true;\n }\n };\n\n return FormSerialize;\n});\n","/**\n * Execute code only when the DOM is loaded.\n * @module Ink.Dom.Loaded_1\n * @version 1\n */\n \nInk.createModule('Ink.Dom.Loaded', 1, [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Dom.Loaded_1\n **/\n var Loaded = {\n\n /**\n * Callbacks and their contexts. Array of 2-arrays.\n *\n * []\n *\n * @attribute _contexts Array\n * @private\n * \n */\n _contexts: [], // Callbacks' queue\n\n /**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @method run\n * @param {Object} [win]=window Window object to attach/add the event\n * @param {Function} fn Callback function to be executed after the DOM is ready\n * @public\n * @sample Ink_Dom_Loaded_run.html \n */\n run: function(win, fn) {\n if (!fn) {\n fn = win;\n win = window;\n }\n\n var context;\n\n for (var i = 0, len = this._contexts.length; i < len; i++) {\n if (this._contexts[i][0] === win) {\n context = this._contexts[i][1];\n break;\n }\n }\n if (!context) {\n context = {\n cbQueue: [],\n win: win,\n doc: win.document,\n root: win.document.documentElement,\n done: false,\n top: true\n };\n context.handlers = {\n checkState: Ink.bindEvent(this._checkState, this, context),\n poll: Ink.bind(this._poll, this, context)\n };\n this._contexts.push(\n [win, context] // Javascript Objects cannot map different windows to\n // different values.\n );\n }\n\n var ael = context.doc.addEventListener;\n context.add = ael ? 'addEventListener' : 'attachEvent';\n context.rem = ael ? 'removeEventListener' : 'detachEvent';\n context.pre = ael ? '' : 'on';\n context.det = ael ? 'DOMContentLoaded' : 'onreadystatechange';\n context.wet = context.pre + 'load';\n\n var csf = context.handlers.checkState;\n var alreadyLoaded = (\n /complete|interactive|loaded/.test(context.doc.readyState) &&\n context.win.location.toString() !== 'about:blank'); // https://code.google.com/p/chromium/issues/detail?id=32357\n\n if (alreadyLoaded){\n setTimeout(Ink.bind(function () {\n fn.call(context.win, 'lazy');\n }, this), 0);\n } else {\n context.cbQueue.push(fn);\n\n context.doc[context.add]( context.det , csf );\n context.win[context.add]( context.wet , csf );\n\n var frameElement = 1;\n try{\n frameElement = context.win.frameElement;\n } catch(e) {}\n if ( !ael && context.root && context.root.doScroll ) { // IE HACK\n try {\n context.top = !frameElement;\n } catch(e) { }\n if (context.top) {\n this._poll(context);\n }\n }\n }\n },\n\n /**\n * Function that will be running the callbacks after the page is loaded\n *\n * @method _checkState\n * @param {Event} event Triggered event\n * @private\n */\n _checkState: function(event, context) {\n if ( !event || (event.type === 'readystatechange' && context.doc.readyState !== 'complete')) {\n return;\n }\n var where = (event.type === 'load') ? context.win : context.doc;\n where[context.rem](context.pre+event.type, context.handlers.checkState, false);\n this._ready(context);\n },\n\n /**\n * Polls the load progress of the page to see if it has already loaded or not\n *\n * @method _poll\n * @private\n */\n\n /**\n *\n * function _poll\n */\n _poll: function(context) {\n try {\n context.root.doScroll('left');\n } catch(e) {\n return setTimeout(context.handlers.poll, 50);\n }\n this._ready(context);\n },\n\n /**\n * Function that runs the callbacks from the queue when the document is ready.\n *\n * @method _ready\n * @private\n */\n _ready: function(context) {\n if (!context.done) {\n context.done = true;\n for (var i = 0; i < context.cbQueue.length; ++i) {\n context.cbQueue[i].call(context.win);\n }\n context.cbQueue = [];\n }\n }\n };\n\n return Loaded;\n\n});\n","/**\n * CSS selector engine\n * @module Ink.Dom.Selector_1\n * @version 1\n */\n \nInk.createModule('Ink.Dom.Selector', 1, [], function() {\n /*jshint forin:false, eqnull:true, noempty:false, expr:true, boss:true, maxdepth:false*/\n\t'use strict';\n\n/*!\n * Sizzle CSS Selector Engine\n * Copyright 2013 jQuery Foundation and other contributors\n * Released under the MIT license\n * http://sizzlejs.com/\n */\n\nvar i,\n\tcachedruns,\n\tExpr,\n\tgetText,\n\tisXML,\n\tcompile,\n\toutermostContext,\n\trecompare,\n\tsortInput,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + -(new Date()),\n\tpreferredDoc = window.document,\n\tsupport = {},\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\thasDuplicate = false,\n\tsortOrder = function() { return 0; },\n\n\t// General-purpose constants\n\tstrundefined = typeof undefined,\n\tMAX_NEGATIVE = 1 << 31,\n\n\t// Array methods\n\tarr = [],\n\tpop = arr.pop,\n\tpush_native = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\t// Use a stripped-down indexOf if we can't use a native one\n\tindexOf = arr.indexOf || function( elem ) {\n\t\tvar i = 0,\n\t\t\tlen = this.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( this[i] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\n\t// Regular expressions\n\n\t// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\t// http://www.w3.org/TR/css3-syntax/#characters\n\tcharacterEncoding = \"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",\n\n\t// Loosely modeled on CSS identifier characters\n\t// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors\n\t// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = characterEncoding.replace( \"w\", \"w#\" ),\n\n\t// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors\n\toperators = \"([*^$|!~]?=)\",\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + characterEncoding + \")\" + whitespace +\n\t\t\"*(?:\" + operators + whitespace + \"*(?:(['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|(\" + identifier + \")|)|)\" + whitespace + \"*\\\\]\",\n\n\t// Prefer arguments quoted,\n\t// then not containing pseudos/brackets,\n\t// then attribute selectors/non-parenthetical expressions,\n\t// then anything else\n\t// These preferences are here to reduce the number of selectors\n\t// needing tokenize in the PSEUDO preFilter\n\tpseudos = \":(\" + characterEncoding + \")(?:\\\\(((['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes.replace( 3, 8 ) + \")*)|.*)\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([\\\\x20\\\\t\\\\r\\\\n\\\\f>+~])\" + whitespace + \"*\" ),\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + characterEncoding + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + characterEncoding + \")\" ),\n\t\t\"NAME\": new RegExp( \"^\\\\[name=['\\\"]?(\" + characterEncoding + \")['\\\"]?\\\\]\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + characterEncoding.replace( \"w\", \"w*\" ) + \")\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n\t\t\t\"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n\t\t\t\"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n\t\t\twhitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trsibling = /[\\x20\\t\\r\\n\\f]*[+~]/,\n\n\trnative = /^[^{]+\\{\\s*\\[native code/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trescape = /'|\\\\/g,\n\trattributeQuotes = /\\=[\\x20\\t\\r\\n\\f]*([^'\"\\]]*)[\\x20\\t\\r\\n\\f]*\\]/g,\n\n\t// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = /\\\\([\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|.)/g,\n\tfunescape = function( _, escaped ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\treturn high !== high ?\n\t\t\tescaped :\n\t\t\t// BMP codepoint\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t};\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t(arr = slice.call( preferredDoc.childNodes )),\n\t\tpreferredDoc.childNodes\n\t);\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpush_native.apply( target, slice.call(els) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( (target[j++] = els[i++]) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\n/*\n * For feature detection\n * @param {Function} fn The function to test for native support\n */\nfunction isNative( fn ) {\n\treturn rnative.test( fn + \"\" );\n}\n\n/*\n * Create key-value caches of limited size\n * @returns {Function(string, Object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar cache,\n\t\tkeys = [];\n\n\treturn (cache = function( key, value ) {\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key += \" \" ) > Expr.cacheLength ) {\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn (cache[ key ] = value);\n\t});\n}\n\n/*\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/*\n * Support testing using an element\n * @param {Function} fn Passed the created div and expects a boolean result\n */\nfunction assert( fn ) {\n\tvar div = document.createElement(\"div\");\n\n\ttry {\n\t\treturn !!fn( div );\n\t} catch (e) {\n\t\treturn false;\n\t} finally {\n\t\t// release memory in IE\n\t\tdiv = null;\n\t}\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar match, elem, m, nodeType,\n\t\t// QSA vars\n\t\ti, groups, old, nid, newContext, newSelector;\n\n\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\n\tcontext = context || document;\n\tresults = results || [];\n\n\tif ( !selector || typeof selector !== \"string\" ) {\n\t\treturn results;\n\t}\n\n\tif ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {\n\t\treturn [];\n\t}\n\n\tif ( documentIsHTML && !seed ) {\n\n\t\t// Shortcuts\n\t\tif ( (match = rquickExpr.exec( selector )) ) {\n\t\t\t// Speed-up: Sizzle(\"#ID\")\n\t\t\tif ( (m = match[1]) ) {\n\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\telem = context.getElementById( m );\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Handle the case where IE, Opera, and Webkit return items\n\t\t\t\t\t\t// by name instead of ID\n\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Context is not a document\n\t\t\t\t\tif ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\n\t\t\t\t\t\tcontains( context, elem ) && elem.id === m ) {\n\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Speed-up: Sizzle(\"TAG\")\n\t\t\t} else if ( match[2] ) {\n\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\treturn results;\n\n\t\t\t// Speed-up: Sizzle(\".CLASS\")\n\t\t\t} else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {\n\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\treturn results;\n\t\t\t}\n\t\t}\n\n\t\t// QSA path\n\t\tif ( support.qsa && !rbuggyQSA.test(selector) ) {\n\t\t\told = true;\n\t\t\tnid = expando;\n\t\t\tnewContext = context;\n\t\t\tnewSelector = nodeType === 9 && selector;\n\n\t\t\t// qSA works strangely on Element-rooted queries\n\t\t\t// We can work around this by specifying an extra ID on the root\n\t\t\t// and working up from there (Thanks to Andrew Dupont for the technique)\n\t\t\t// IE 8 doesn't work on object elements\n\t\t\tif ( nodeType === 1 && context.nodeName.toLowerCase() !== \"object\" ) {\n\t\t\t\tgroups = tokenize( selector );\n\n\t\t\t\tif ( (old = context.getAttribute(\"id\")) ) {\n\t\t\t\t\tnid = old.replace( rescape, \"\\\\$&\" );\n\t\t\t\t} else {\n\t\t\t\t\tcontext.setAttribute( \"id\", nid );\n\t\t\t\t}\n\t\t\t\tnid = \"[id='\" + nid + \"'] \";\n\n\t\t\t\ti = groups.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tgroups[i] = nid + toSelector( groups[i] );\n\t\t\t\t}\n\t\t\t\tnewContext = rsibling.test( selector ) && context.parentNode || context;\n\t\t\t\tnewSelector = groups.join(\",\");\n\t\t\t}\n\n\t\t\tif ( newSelector ) {\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch(qsaError) {\n\t\t\t\t} finally {\n\t\t\t\t\tif ( !old ) {\n\t\t\t\t\t\tcontext.removeAttribute(\"id\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/*\n * Detect xml\n * @param {Element|Object} elem An element or a document\n */\nisXML = Sizzle.isXML = function( elem ) {\n\t// documentElement is verified for cases where it doesn't yet exist\n\t// (such as loading iframes in IE - #4833)\n\tvar documentElement = elem && (elem.ownerDocument || elem).documentElement;\n\treturn documentElement ? documentElement.nodeName !== \"HTML\" : false;\n};\n\n/*\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar doc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// If no document and documentElement is available, return\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Set our document\n\tdocument = doc;\n\tdocElem = doc.documentElement;\n\n\t// Support tests\n\tdocumentIsHTML = !isXML( doc );\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert(function( div ) {\n\t\tdiv.appendChild( doc.createComment(\"\") );\n\t\treturn !div.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Check if attributes should be retrieved by attribute nodes\n\tsupport.attributes = assert(function( div ) {\n\t\tdiv.innerHTML = \"\";\n\t\tvar type = typeof div.lastChild.getAttribute(\"multiple\");\n\t\t// IE8 returns a string for some attributes even when not present\n\t\treturn type !== \"boolean\" && type !== \"string\";\n\t});\n\n\t// Check if getElementsByClassName can be trusted\n\tsupport.getElementsByClassName = assert(function( div ) {\n\t\t// Opera can't find a second classname (in 9.6)\n\t\tdiv.innerHTML = \"\";\n\t\tif ( !div.getElementsByClassName || !div.getElementsByClassName(\"e\").length ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Safari 3.2 caches class attributes and doesn't catch changes\n\t\tdiv.lastChild.className = \"e\";\n\t\treturn div.getElementsByClassName(\"e\").length === 2;\n\t});\n\n\t// Check if getElementsByName privileges form controls or returns elements by ID\n\t// If so, assume (for broader support) that getElementById returns elements by name\n\tsupport.getByName = assert(function( div ) {\n\t\t// Inject content\n\t\tdiv.id = expando + 0;\n\t\t// Support: Windows 8 Native Apps\n\t\t// Assigning innerHTML with \"name\" attributes throws uncatchable exceptions\n\t\t// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx\n\t\tdiv.appendChild( document.createElement(\"a\") ).setAttribute( \"name\", expando );\n\t\tdiv.appendChild( document.createElement(\"i\") ).setAttribute( \"name\", expando );\n\t\tdocElem.appendChild( div );\n\n\t\t// Test\n\t\tvar pass = doc.getElementsByName &&\n\t\t\t// buggy browsers will return fewer than the correct 2\n\t\t\tdoc.getElementsByName( expando ).length === 2 +\n\t\t\t// buggy browsers will return more than the correct 0\n\t\t\tdoc.getElementsByName( expando + 0 ).length;\n\n\t\t// Cleanup\n\t\tdocElem.removeChild( div );\n\n\t\treturn pass;\n\t});\n\n\t// Support: Webkit<537.32\n\t// Detached nodes confoundingly follow *each other*\n\tsupport.sortDetached = assert(function( div1 ) {\n\t\treturn div1.compareDocumentPosition &&\n\t\t\t// Should return 1, but Webkit returns 4 (following)\n\t\t\t(div1.compareDocumentPosition( document.createElement(\"div\") ) & 1);\n\t});\n\n\t// IE6/7 return modified attributes\n\tExpr.attrHandle = assert(function( div ) {\n\t\tdiv.innerHTML = \"\";\n\t\treturn div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&\n\t\t\tdiv.firstChild.getAttribute(\"href\") === \"#\";\n\t}) ?\n\t\t{} :\n\t\t{\n\t\t\t\"href\": function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"href\", 2 );\n\t\t\t},\n\t\t\t\"type\": function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"type\");\n\t\t\t}\n\t\t};\n\n\t// ID find and filter\n\tif ( support.getByName ) {\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== strundefined && documentIsHTML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\treturn m && m.parentNode ? [m] : [];\n\t\t\t}\n\t\t};\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"id\") === attrId;\n\t\t\t};\n\t\t};\n\t} else {\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== strundefined && documentIsHTML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\n\t\t\t\treturn m ?\n\t\t\t\t\tm.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode(\"id\").value === id ?\n\t\t\t\t\t\t[m] :\n\t\t\t\t\t\tundefined :\n\t\t\t\t\t[];\n\t\t\t}\n\t\t};\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode(\"id\");\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[\"TAG\"] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== strundefined ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\t\t\t}\n\t\t} :\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( (elem = results[i++]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Name\n\tExpr.find[\"NAME\"] = support.getByName && function( tag, context ) {\n\t\tif ( typeof context.getElementsByName !== strundefined ) {\n\t\t\treturn context.getElementsByName( name );\n\t\t}\n\t};\n\n\t// Class\n\tExpr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21),\n\t// no need to also add to buggyMatches since matches checks buggyQSA\n\t// A support test would require too much code (would include document ready)\n\trbuggyQSA = [ \":focus\" ];\n\n\tif ( (support.qsa = isNative(doc.querySelectorAll)) ) {\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert(function( div ) {\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// http://bugs.jquery.com/ticket/12359\n\t\t\tdiv.innerHTML = \"\";\n\n\t\t\t// IE8 - Some boolean attributes are not treated correctly\n\t\t\tif ( !div.querySelectorAll(\"[selected]\").length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:checked|disabled|ismap|multiple|readonly|selected|value)\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":checked\").length ) {\n\t\t\t\trbuggyQSA.push(\":checked\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( div ) {\n\n\t\t\t// Opera 10-12/IE8 - ^= $= *= and empty values\n\t\t\t// Should not select anything\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tif ( div.querySelectorAll(\"[i^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:\\\"\\\"|'')\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":enabled\").length ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tdiv.querySelectorAll(\"*,:x\");\n\t\t\trbuggyQSA.push(\",.*:\");\n\t\t});\n\t}\n\n\tif ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector) )) ) {\n\n\t\tassert(function( div ) {\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( div, \"div\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( div, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t});\n\t}\n\n\trbuggyQSA = new RegExp( rbuggyQSA.join(\"|\") );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n\t// Element contains another\n\t// Purposefully does not implement inclusive descendent\n\t// As in, an element does not contain itself\n\tcontains = isNative(docElem.contains) || docElem.compareDocumentPosition ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t));\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( (b = b.parentNode) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t// Document order sorting\n\tsortOrder = docElem.compareDocumentPosition ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );\n\n\t\tif ( compare ) {\n\t\t\t// Disconnected nodes\n\t\t\tif ( compare & 1 ||\n\t\t\t\t(recompare && b.compareDocumentPosition( a ) === compare) ) {\n\n\t\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t\tif ( a === doc || contains(preferredDoc, a) ) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif ( b === doc || contains(preferredDoc, b) ) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\t// Maintain original order\n\t\t\t\treturn sortInput ?\n\t\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t\t0;\n\t\t\t}\n\n\t\t\treturn compare & 4 ? -1 : 1;\n\t\t}\n\n\t\t// Not directly comparable, sort on existence of method\n\t\treturn a.compareDocumentPosition ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\t} else if ( !aup || !bup ) {\n\t\t\treturn a === doc ? -1 :\n\t\t\t\tb === doc ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[i] === bp[i] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[i], bp[i] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\tap[i] === preferredDoc ? -1 :\n\t\t\tbp[i] === preferredDoc ? 1 :\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\t// Make sure that attribute selectors are quoted\n\texpr = expr.replace( rattributeQuotes, \"='$1']\" );\n\n\t// rbuggyQSA always contains :focus, so no need for an existence check\n\tif ( support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch(e) {}\n\t}\n\n\treturn Sizzle( expr, document, null, [elem] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\t// Set document vars if needed\n\tif ( ( context.ownerDocument || context ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\tvar val;\n\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tif ( documentIsHTML ) {\n\t\tname = name.toLowerCase();\n\t}\n\tif ( (val = Expr.attrHandle[ name ]) ) {\n\t\treturn val( elem );\n\t}\n\tif ( !documentIsHTML || support.attributes ) {\n\t\treturn elem.getAttribute( name );\n\t}\n\treturn ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?\n\t\tname :\n\t\tval && val.specified ? val.value : null;\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n// Document sorting and removing duplicates\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\t// Compensate for sort limitations\n\trecompare = !support.sortDetached;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( (elem = results[i++]) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\treturn results;\n};\n\n/*\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns Returns -1 if a precedes b, 1 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( (cur = cur.nextSibling) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n// Returns a function to use in pseudos for input types\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n// Returns a function to use in pseudos for buttons\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}\n\n// Returns a function to use in pseudos for positionals\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n/*\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\t\t// If no nodeType, this is expected to be an array\n\t\tfor ( ; (node = elem[i]); i++ ) {\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (see #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[1] = match[1].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[3] = ( match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[2] === \"~=\" ) {\n\t\t\t\tmatch[3] = \" \" + match[3] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[1] = match[1].toLowerCase();\n\n\t\t\tif ( match[1].slice( 0, 3 ) === \"nth\" ) {\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[3] ) {\n\t\t\t\t\tSizzle.error( match[0] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n\t\t\t\tmatch[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[3] ) {\n\t\t\t\tSizzle.error( match[0] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[5] && match[2];\n\n\t\t\tif ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[4] ) {\n\t\t\t\tmatch[2] = match[4];\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t(excess = tokenize( unquoted, true )) &&\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t(excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[0] = match[0].slice( 0, excess );\n\t\t\t\tmatch[2] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeName ) {\n\t\t\tif ( nodeName === \"*\" ) {\n\t\t\t\treturn function() { return true; };\n\t\t\t}\n\n\t\t\tnodeName = nodeName.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t(pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute(\"class\")) || \"\" );\n\t\t\t\t});\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tvar cache, outerCache, node, diff, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( (node = node[ dir ]) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\t\t\t\t\t\t\touterCache = parent[ expando ] || (parent[ expando ] = {});\n\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[0] === dirruns && cache[1];\n\t\t\t\t\t\t\tdiff = cache[0] === dirruns && cache[2];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {\n\t\t\t\t\t\t\tdiff = cache[1];\n\n\t\t\t\t\t\t// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\tif ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {\n\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction(function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf.call( seed, matched[i] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction(function( selector ) {\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction(function( seed, matches, context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = unmatched[i]) ) {\n\t\t\t\t\t\t\tseed[i] = !(matches[i] = elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}) :\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tinput[0] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t}),\n\n\t\t\"has\": markFunction(function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t}),\n\n\t\t\"contains\": markFunction(function( text ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t}),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test(lang || \"\") ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( (elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": function( elem ) {\n\t\t\treturn elem.disabled === false;\n\t\t},\n\n\t\t\"disabled\": function( elem ) {\n\t\t\treturn elem.disabled === true;\n\t\t},\n\n\t\t\"checked\": function( elem ) {\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),\n\t\t\t// not comment, processing instructions, or others\n\t\t\t// Thanks to Diego Perini for the nodeName shortcut\n\t\t\t// Greater than \"@\" means alpha characters (specifically not starting with \"#\" or \"?\")\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeName > \"@\" || elem.nodeType === 3 || elem.nodeType === 4 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[\"empty\"]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\t// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\n\t\t\t// use getAttribute instead to test this case\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === elem.type );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo(function() {\n\t\t\treturn [ 0 ];\n\t\t}),\n\n\t\t\"last\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t}),\n\n\t\t\"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t}),\n\n\t\t\"even\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t})\n\t}\n};\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\nfunction tokenize( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || (match = rcomma.exec( soFar )) ) {\n\t\t\tif ( match ) {\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[0].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( tokens = [] );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( (match = rcombinators.exec( soFar )) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[0].replace( rtrim, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n\t\t\t\t(match = preFilters[ type ]( match ))) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n}\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[i].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tcheckNonElements = base && dir === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar data, cache, outerCache,\n\t\t\t\tdirkey = dirruns + \" \" + doneName;\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || (elem[ expando ] = {});\n\t\t\t\t\t\tif ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {\n\t\t\t\t\t\t\tif ( (data = cache[1]) === true || data === cachedruns ) {\n\t\t\t\t\t\t\t\treturn data === true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcache = outerCache[ dir ] = [ dirkey ];\n\t\t\t\t\t\t\tcache[1] = matcher( elem, context, xml ) || cachedruns;\n\t\t\t\t\t\t\tif ( cache[1] === true ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[i]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[0];\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (elem = unmatched[i]) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction(function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( (elem = temp[i]) ) {\n\t\t\t\t\tmatcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = matcherOut[i]) ) {\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( (matcherIn[i] = elem) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, (matcherOut = []), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( (elem = matcherOut[i]) &&\n\t\t\t\t\t\t(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {\n\n\t\t\t\t\t\tseed[temp] = !(results[temp] = elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[0].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[\" \"],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf.call( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\treturn ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t(checkContext = context).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n\t\t\tmatchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[j].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\t// A counter to specify which element is currently being matched\n\tvar matcherCachedRuns = 0,\n\t\tbySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, expandContext ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tsetMatched = [],\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\toutermost = expandContext != null,\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", expandContext && context.parentNode || context ),\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context !== document && context;\n\t\t\t\tcachedruns = matcherCachedRuns;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Keep `i` a string if there are no elements so `matchedCount` will be \"00\" below\n\t\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t\tcachedruns = ++matcherCachedRuns;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( (elem = !matcher && elem) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\tmatchedCount += i;\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (matcher = setMatchers[j++]) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !(unmatched[i] || setMatched[i]) ) {\n\t\t\t\t\t\t\t\tsetMatched[i] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !group ) {\n\t\t\tgroup = tokenize( selector );\n\t\t}\n\t\ti = group.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( group[i] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\t}\n\treturn cached;\n};\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[i], results );\n\t}\n\treturn results;\n}\n\nfunction select( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tmatch = tokenize( selector );\n\n\tif ( !seed ) {\n\t\t// Try to minimize operations if there is only one group\n\t\tif ( match.length === 1 ) {\n\n\t\t\t// Take a shortcut and set the context if the root selector is an ID\n\t\t\ttokens = match[0] = match[0].slice( 0 );\n\t\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\t\tcontext.nodeType === 9 && documentIsHTML &&\n\t\t\t\t\tExpr.relative[ tokens[1].type ] ) {\n\n\t\t\t\tcontext = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n\t\t\t\tif ( !context ) {\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\n\t\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t\t}\n\n\t\t\t// Fetch a seed set for right-to-left matching\n\t\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\ttoken = tokens[i];\n\n\t\t\t\t// Abort if we hit a combinator\n\t\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\t\tif ( (seed = find(\n\t\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\t\trsibling.test( tokens[0].type ) && context.parentNode || context\n\t\t\t\t\t)) ) {\n\n\t\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\tcompile( selector, match )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\trsibling.test( selector )\n\t);\n\treturn results;\n}\n\n// Deprecated\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\n// Check sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Initialize with the default document\nsetDocument();\n\n// Always assume the presence of duplicates if sort doesn't\n// pass them to our comparison function (as in Google Chrome).\n[0, 0].sort( sortOrder );\nsupport.detectDuplicates = hasDuplicate;\n\n// EXPOSE\n/*if ( typeof define === \"function\" && define.amd ) {\n\tdefine(function() { return Sizzle; });\n} else {\n\twindow.Sizzle = Sizzle;\n}*/\n// EXPOSE\n\n/**\n * @namespace Ink.Dom.Selector\n * @static\n */\n\n/**\n * Alias for the Sizzle selector engine\n *\n * @method select\n * @param {String} selector CSS selector to search for elements\n * @param {DOMElement} [context] By default the search is done in the document element. However, you can specify an element as search context\n * @param {Array} [results] By default this is considered an empty array. But if you want to merge it with other searches you did, pass their result array through here.\n * @return {Array} Array of resulting DOM Elements\n * @sample Ink_Dom_Selector_select.html\n */\n\n/**\n * Filters elements that match a CSS selector.\n *\n * @method matches\n * @param {String} selector CSS selector to search for elements\n * @param {Array} matches Elements to be 'matched' with\n * @return {Array} Elements that matched\n * @sample Ink_Dom_Selector_matches.html\n */\n\n/**\n * Checks if an element matches a given selector\n *\n * @method matchesSelector\n * @param {DOMElement} element Element to test\n * @param {String} selector CSS selector to test the element with\n * @return {Boolean} True if element matches the CSS selector\n * @sample Ink_Dom_Selector_matchesSelector.html \n */\n\nreturn {\n select: Sizzle,\n matches: Sizzle.matches,\n matchesSelector: Sizzle.matchesSelector\n};\n\n\n}); //( window );\n","/**\n * Array Utilities\n * @module Ink.Util.Array_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Array', '1', [], function() {\n\n 'use strict';\n\n var arrayProto = Array.prototype;\n\n /**\n * @namespace Ink.Util.Array_1\n */\n\n var InkArray = {\n\n /**\n * Checks if a value is an array\n *\n * @method isArray\n * @param testedObject {Mixed} The object we want to check\n **/\n isArray: Array.isArray || function (testedObject) {\n return {}.toString.call(testedObject) === '[object Array]';\n },\n\n /**\n * Loops through an array, grouping similar items together.\n * @method groupBy\n * @param arr {Array} The input array.\n * @param [options] {Object} options object, containing:\n * @param [options.key] {Function} A function which computes the group key by which the items are grouped.\n * @param [options.pairs] {Boolean} Set to `true` if you want to output an array of `[key, [group...]]` pairs instead of an array of groups.\n * @return {Array} An array of arrays of chunks.\n *\n * @example\n *\n * InkArray.groupBy([1, 1, 2, 2, 3, 1]) // -> [ [1, 1], [2, 2], [3], [1] ]\n * InkArray.groupBy([1.1, 1.2, 2.1], { key: Math.floor }) // -> [ [1.1, 1.2], [2.1] ]\n * InkArray.groupBy([1.1, 1.2, 2.1], { key: Math.floor, pairs: true }) // -> [ [1, [1.1, 1.2]], [2, [2.1]] ]\n *\n **/\n groupBy: function (arr, options) {\n options = options || {};\n var ret = [];\n var latestGroup;\n function eq(a, b) {\n return outKey(a) === outKey(b);\n }\n function outKey(item) {\n if (typeof options.key === 'function') {\n return options.key(item);\n } else {\n return item;\n }\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n latestGroup = [arr[i]];\n\n // Chunkin'\n while ((i + 1 < len) && eq(arr[i], arr[i + 1])) {\n latestGroup.push(arr[i + 1]);\n i++;\n }\n\n if (options.pairs) {\n ret.push([outKey(arr[i]), latestGroup]);\n } else {\n ret.push(latestGroup);\n }\n }\n return ret;\n },\n\n /**\n * Replacement for Array.prototype.reduce.\n *\n * Produces a single result from a list of values by calling an \"aggregator\" function.\n *\n * Falls back to Array.prototype.reduce if available.\n *\n * @method reduce\n * @param array {Array} Input array to be reduced.\n * @param callback {Function} `function (previousValue, currentValue, index, all) { return {Mixed} }` to execute for each value.\n * @param initial {Mixed} Object used as the first argument to the first call of `callback`\n *\n * @example\n * var sum = InkArray.reduce([1, 2, 3], function (a, b) { return a + b; }); // -> 6\n */\n reduce: function (array, callback, initial) {\n if (arrayProto.reduce) {\n return arrayProto.reduce.apply(array, [].slice.call(arguments, 1));\n }\n\n // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Polyfill\n var t = Object( array ), len = t.length >>> 0, k = 0, value;\n if ( arguments.length >= 3 ) {\n value = initial;\n } else {\n while ( k < len && !(k in t) ) k++;\n if ( k >= len )\n throw new TypeError('Reduce of empty array with no initial value');\n value = t[ k++ ];\n }\n for ( ; k < len ; k++ ) {\n if ( k in t ) {\n value = callback( value, t[k], k, t );\n }\n }\n return value;\n },\n\n /**\n * Checks if a value exists in array\n *\n * @method inArray\n * @public\n * @static\n * @param {Mixed} value Value to check\n * @param {Array} arr Array to search in\n * @return {Boolean} True if value exists in the array\n * @sample Ink_Util_Array_inArray.html\n */\n inArray: function(value, arr) {\n if (typeof arr === 'object') {\n for (var i = 0, f = arr.length; i < f; ++i) {\n if (arr[i] === value) {\n return true;\n }\n }\n }\n return false;\n },\n\n /**\n * Sorts an array of objects by an object property\n *\n * @method sortMulti\n * @param {Array} arr Array of objects to sort\n * @param {String} key Property to sort by\n * @return {Array|Boolean} False if it's not an array, returns a sorted array if it's an array.\n * @public\n * @static\n * @sample Ink_Util_Array_sortMulti.html\n */\n sortMulti: function(arr, key) {\n if (typeof arr === 'undefined' || arr.constructor !== Array) { return false; }\n if (typeof key !== 'string') { return arr.sort(); }\n if (arr.length > 0) {\n if (typeof(arr[0][key]) === 'undefined') { return false; }\n arr.sort(function(a, b){\n var x = a[key];\n var y = b[key];\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\n });\n }\n return arr;\n },\n\n /**\n * Gets the indexes of a value in an array\n *\n * @method keyValue\n * @param {String} value Value to search for.\n * @param {Array} arr Array to run the search in.\n * @param {Boolean} [first] Flag to stop the search at the first match. It also returns an index number instead of an array of indexes.\n * @return {Boolean|Number|Array} False for no matches. Array of matches or first match index.\n * @public\n * @static\n * @sample Ink_Util_Array_keyValue.html\n */\n keyValue: function(value, arr, first) {\n if (typeof value !== 'undefined' && typeof arr === 'object' && this.inArray(value, arr)) {\n var aKeys = [];\n for (var i = 0, f = arr.length; i < f; ++i) {\n if (arr[i] === value) {\n if (typeof first !== 'undefined' && first === true) {\n return i;\n } else {\n aKeys.push(i);\n }\n }\n }\n return aKeys;\n }\n return false;\n },\n\n /**\n * Shuffles an array.\n *\n * @method shuffle\n * @param {Array} arr Array to shuffle\n * @return {Array|Boolean} Shuffled Array or false if not an array.\n * @public\n * @static\n * @sample Ink_Util_Array_shuffle.html\n */\n shuffle: function(arr) {\n if (typeof(arr) !== 'undefined' && arr.constructor !== Array) { return false; }\n var total = arr.length,\n tmp1 = false,\n rnd = false;\n\n while (total--) {\n rnd = Math.floor(Math.random() * (total + 1));\n tmp1 = arr[total];\n arr[total] = arr[rnd];\n arr[rnd] = tmp1;\n }\n return arr;\n },\n\n /**\n * Runs a function through each of the elements of an array\n *\n * @method forEach\n * @param {Array} arr The array to be cycled/iterated\n * @param {Function} cb The function receives as arguments the value, index and array.\n * @return {Array} Iterated array.\n * @public\n * @static\n * @sample Ink_Util_Array_forEach.html\n */\n forEach: function(array, callback, context) {\n if (arrayProto.forEach) {\n return arrayProto.forEach.call(array, callback, context);\n }\n for (var i = 0, len = array.length >>> 0; i < len; i++) {\n callback.call(context, array[i], i, array);\n }\n },\n\n /**\n * Alias for backwards compatibility. See forEach\n *\n * @method each\n */\n each: function () {\n InkArray.forEach.apply(InkArray, [].slice.call(arguments));\n },\n\n /**\n * Runs a function for each item in the array.\n * That function will receive each item as an argument and its return value will change the corresponding array item.\n * @method map\n * @param {Array} array The array to map over\n * @param {Function} map The map function. Will take `(item, index, array)` as arguments and `this` will be the `context` argument.\n * @param {Object} [context] Object to be `this` in the map function.\n *\n * @sample Ink_Util_Array_map.html\n */\n map: function (array, callback, context) {\n if (arrayProto.map) {\n return arrayProto.map.call(array, callback, context);\n }\n var mapped = new Array(len);\n for (var i = 0, len = array.length >>> 0; i < len; i++) {\n mapped[i] = callback.call(context, array[i], i, array);\n }\n return mapped;\n },\n\n /**\n * Filters an array based on a truth test.\n * This method runs a test function on all the array values and returns a new array with all the values that pass the test.\n * @method filter\n * @param {Array} array The array to filter\n * @param {Function} test A test function taking `(item, index, array)`\n * @param {Object} [context] Object to be `this` in the test function.\n * @return {Array} Returns the filtered array\n *\n * @sample Ink_Util_Array_filter.html\n */\n filter: function (array, test, context) {\n if (arrayProto.filter) {\n return arrayProto.filter.call(array, test, context);\n }\n var filtered = [],\n val = null;\n for (var i = 0, len = array.length; i < len; i++) {\n val = array[i]; // it might be mutated\n if (test.call(context, val, i, array)) {\n filtered.push(val);\n }\n }\n return filtered;\n },\n\n /**\n * Checks if some element in the array passes a truth test\n *\n * @method some\n * @param {Array} arr The array to iterate through\n * @param {Function} cb The callback to be called on the array's elements. It receives the value, the index and the array as arguments.\n * @param {Object} context Object of the callback function\n * @return {Boolean} True if the callback returns true at any point, false otherwise\n * @public\n * @static\n * @sample Ink_Util_Array_some.html\n */\n some: function(arr, cb, context){\n\n if (arr === null){\n throw new TypeError('First argument is invalid.');\n }\n\n var t = Object(arr);\n var len = t.length >>> 0;\n if (typeof cb !== \"function\"){ throw new TypeError('Second argument must be a function.'); }\n\n for (var i = 0; i < len; i++) {\n if (i in t && cb.call(context, t[i], i, t)){ return true; }\n }\n\n return false;\n },\n\n /**\n * Compares the values of two arrays and return the matches\n *\n * @method intersect\n * @param {Array} arr1 First array\n * @param {Array} arr2 Second array\n * @return {Array} Empty array if one of the arrays is false (or do not intersect) | Array with the intersected values\n * @public\n * @static\n * @sample Ink_Util_Array_intersect.html\n */\n intersect: function(arr1, arr2) {\n if (!arr1 || !arr2 || arr1 instanceof Array === false || arr2 instanceof Array === false) {\n return [];\n }\n\n var shared = [];\n for (var i = 0, I = arr1.length; i 0) {\n for (x = a; x < b; x += step) {\n r.push(x);\n }\n } else {\n for (x = a; x > b; x += step) {\n r.push(x);\n }\n }\n\n return r;\n },\n\n /**\n * Inserts a value on a specified index\n *\n * @method insert\n * @param {Array} arr Array where the value will be inserted\n * @param {Number} idx Index of the array where the value should be inserted\n * @param {Mixed} value Value to be inserted\n * @public\n * @static\n * @sample Ink_Util_Array_insert.html\n */\n insert: function(arr, idx, value) {\n arr.splice(idx, 0, value);\n },\n\n /**\n * Removes a range of values from the array\n *\n * @method remove\n * @param {Array} arr Array where the value will be removed\n * @param {Number} from Index of the array where the removal will start removing.\n * @param {Number} rLen Number of items to be removed from the index onwards.\n * @return {Array} An array with the remaining values\n * @public\n * @static\n * @sample Ink_Util_Array_remove.html\n */\n remove: function(arr, from, rLen){\n var output = [];\n\n for(var i = 0, iLen = arr.length; i < iLen; i++){\n if(i >= from && i < from + rLen){\n continue;\n }\n\n output.push(arr[i]);\n }\n\n return output;\n }\n };\n\n return InkArray;\n\n});\n","/**\n * Binary Packing algorithm implementation\n * @module Ink.Util.BinPack_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.BinPack', '1', [], function() {\n\n 'use strict';\n\n /*jshint boss:true */\n\n // https://github.com/jakesgordon/bin-packing/\n\n /*\n Copyright (c) 2011, 2012, 2013 Jake Gordon and contributors\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n\n\n var Packer = function(w, h) {\n this.init(w, h);\n };\n\n Packer.prototype = {\n\n init: function(w, h) {\n this.root = { x: 0, y: 0, w: w, h: h };\n },\n\n fit: function(blocks) {\n var n, node, block;\n for (n = 0; n < blocks.length; ++n) {\n block = blocks[n];\n if (node = this.findNode(this.root, block.w, block.h)) {\n block.fit = this.splitNode(node, block.w, block.h);\n }\n }\n },\n\n findNode: function(root, w, h) {\n if (root.used) {\n return this.findNode(root.right, w, h) || this.findNode(root.down, w, h);\n }\n else if ((w <= root.w) && (h <= root.h)) {\n return root;\n }\n else {\n return null;\n }\n },\n\n splitNode: function(node, w, h) {\n node.used = true;\n node.down = { x: node.x, y: node.y + h, w: node.w, h: node.h - h };\n node.right = { x: node.x + w, y: node.y, w: node.w - w, h: h };\n return node;\n }\n\n };\n\n\n\n var GrowingPacker = function() {};\n\n GrowingPacker.prototype = {\n\n fit: function(blocks) {\n var n, node, block, len = blocks.length;\n var w = len > 0 ? blocks[0].w : 0;\n var h = len > 0 ? blocks[0].h : 0;\n this.root = { x: 0, y: 0, w: w, h: h };\n for (n = 0; n < len ; n++) {\n block = blocks[n];\n if (node = this.findNode(this.root, block.w, block.h)) {\n block.fit = this.splitNode(node, block.w, block.h);\n }\n else {\n block.fit = this.growNode(block.w, block.h);\n }\n }\n },\n\n findNode: function(root, w, h) {\n if (root.used) {\n return this.findNode(root.right, w, h) || this.findNode(root.down, w, h);\n }\n else if ((w <= root.w) && (h <= root.h)) {\n return root;\n }\n else {\n return null;\n }\n },\n\n splitNode: function(node, w, h) {\n node.used = true;\n node.down = { x: node.x, y: node.y + h, w: node.w, h: node.h - h };\n node.right = { x: node.x + w, y: node.y, w: node.w - w, h: h };\n return node;\n },\n\n growNode: function(w, h) {\n var canGrowDown = (w <= this.root.w);\n var canGrowRight = (h <= this.root.h);\n\n var shouldGrowRight = canGrowRight && (this.root.h >= (this.root.w + w)); // attempt to keep square-ish by growing right when height is much greater than width\n var shouldGrowDown = canGrowDown && (this.root.w >= (this.root.h + h)); // attempt to keep square-ish by growing down when width is much greater than height\n\n if (shouldGrowRight) {\n return this.growRight(w, h);\n }\n else if (shouldGrowDown) {\n return this.growDown(w, h);\n }\n else if (canGrowRight) {\n return this.growRight(w, h);\n }\n else if (canGrowDown) {\n return this.growDown(w, h);\n }\n else {\n return null; // need to ensure sensible root starting size to avoid this happening\n }\n },\n\n growRight: function(w, h) {\n this.root = {\n used: true,\n x: 0,\n y: 0,\n w: this.root.w + w,\n h: this.root.h,\n down: this.root,\n right: { x: this.root.w, y: 0, w: w, h: this.root.h }\n };\n var node;\n if (node = this.findNode(this.root, w, h)) {\n return this.splitNode(node, w, h);\n }\n else {\n return null;\n }\n },\n\n growDown: function(w, h) {\n this.root = {\n used: true,\n x: 0,\n y: 0,\n w: this.root.w,\n h: this.root.h + h,\n down: { x: 0, y: this.root.h, w: this.root.w, h: h },\n right: this.root\n };\n var node;\n if (node = this.findNode(this.root, w, h)) {\n return this.splitNode(node, w, h);\n }\n else {\n return null;\n }\n }\n\n };\n\n\n\n var sorts = {\n random: function() { return Math.random() - 0.5; },\n w: function(a, b) { return b.w - a.w; },\n h: function(a, b) { return b.h - a.h; },\n a: function(a, b) { return b.area - a.area; },\n max: function(a, b) { return Math.max(b.w, b.h) - Math.max(a.w, a.h); },\n min: function(a, b) { return Math.min(b.w, b.h) - Math.min(a.w, a.h); },\n height: function(a, b) { return sorts.msort(a, b, ['h', 'w']); },\n width: function(a, b) { return sorts.msort(a, b, ['w', 'h']); },\n area: function(a, b) { return sorts.msort(a, b, ['a', 'h', 'w']); },\n maxside: function(a, b) { return sorts.msort(a, b, ['max', 'min', 'h', 'w']); },\n msort: function(a, b, criteria) { /* sort by multiple criteria */\n var diff, n;\n for (n = 0; n < criteria.length; ++n) {\n diff = sorts[ criteria[n] ](a, b);\n if (diff !== 0) {\n return diff;\n }\n }\n return 0;\n }\n };\n\n\n\n // end of Jake's code\n\n\n\n // aux, used to display blocks in unfitted property\n var toString = function() {\n return [this.w, ' x ', this.h].join('');\n };\n\n\n\n /**\n * Binary Packing algorithm implementation\n *\n * Based on the work of Jake Gordon\n *\n * see https://github.com/jakesgordon/bin-packing/\n *\n * @namespace Ink.Util.BinPack\n * @version 1\n * @static\n */\n var BinPack = {\n\n /**\n * @method binPack\n * @param {Object} o Options\n * @param {Array} o.blocks Array of items with width and height integer attributes.\n * @param {Array} [o.dimensions] Flag to fix container dimensions\n * @param {String} [o.sorter] Sorting function. One of: random, height, width, area, maxside\n * @return {Object} Returns an object containing container dimensions, filled ratio, fitted blocks, unfitted blocks and all blocks\n * @static\n */\n binPack: function(o) {\n var i, f, bl;\n\n\n\n // calculate area if not there already\n for (i = 0, f = o.blocks.length; i < f; ++i) {\n bl = o.blocks[i];\n if (! ('area' in bl) ) {\n bl.area = bl.w * bl.h;\n }\n }\n\n\n\n // apply algorithm\n var packer = o.dimensions ? new Packer(o.dimensions[0], o.dimensions[1]) : new GrowingPacker();\n\n if (!o.sorter) { o.sorter = 'maxside'; }\n\n o.blocks.sort( sorts[ o.sorter ] );\n\n packer.fit(o.blocks);\n\n var dims2 = [packer.root.w, packer.root.h];\n\n\n\n // layout is done here, generating report data...\n var fitted = [];\n var unfitted = [];\n\n for (i = 0, f = o.blocks.length; i < f; ++i) {\n bl = o.blocks[i];\n if (bl.fit) {\n fitted.push(bl);\n }\n else {\n bl.toString = toString; // TO AID SERIALIZATION\n unfitted.push(bl);\n }\n }\n\n var area = dims2[0] * dims2[1];\n var fit = 0;\n for (i = 0, f = fitted.length; i < f; ++i) {\n bl = fitted[i];\n fit += bl.area;\n }\n\n return {\n dimensions: dims2,\n filled: fit / area,\n blocks: o.blocks,\n fitted: fitted,\n unfitted: unfitted\n };\n }\n };\n\n\n\n return BinPack;\n\n});","/**\n * Cookie Utilities\n * @module Ink.Util.Cookie_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Cookie', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.Cookie_1\n */\n var Cookie = {\n\n /**\n * Gets an object with the current page cookies.\n *\n * @method get\n * @param {String} name The cookie name.\n * @return {String|Object} If the name is specified, it returns the value of that key. Otherwise it returns the full cookie object\n * @public\n * @static\n * @sample Ink_Util_Cookie_get.html\n */\n get: function(name)\n {\n var cookie = document.cookie || false;\n\n var _Cookie = {};\n if(cookie) {\n cookie = cookie.replace(new RegExp(\"; \", \"g\"), ';');\n var aCookie = cookie.split(';');\n var aItem = [];\n if(aCookie.length > 0) {\n for(var i=0; i < aCookie.length; i++) {\n aItem = aCookie[i].split('=');\n if(aItem.length === 2) {\n _Cookie[aItem[0]] = decodeURIComponent(aItem[1]);\n }\n aItem = [];\n }\n }\n }\n if(name) {\n if(typeof(_Cookie[name]) !== 'undefined') {\n return _Cookie[name];\n } else {\n return null;\n }\n }\n return _Cookie;\n },\n\n /**\n * Sets a cookie.\n *\n * @method set\n * @param {String} name Cookie name.\n * @param {String} value Cookie value.\n * @param {Number} [expires] Number of seconds the cookie will be valid for.\n * @param {String} [path] Path for the cookie. Defaults to '/'.\n * @param {String} [domain] Domain for the cookie. Defaults to current hostname.\n * @param {Boolean} [secure] Flag for secure. Default 'false'.\n * @public\n * @static\n * @sample Ink_Util_Cookie_set.html\n */\n set: function(name, value, expires, path, domain, secure)\n {\n var sName;\n if(!name || value===false || typeof(name) === 'undefined' || typeof(value) === 'undefined') {\n return false;\n } else {\n sName = name+'='+encodeURIComponent(value);\n }\n var sExpires = false;\n var sPath = false;\n var sDomain = false;\n var sSecure = false;\n\n if(expires && typeof(expires) !== 'undefined' && !isNaN(expires)) {\n var oDate = new Date();\n var sDate = (parseInt(Number(oDate.valueOf()), 10) + (Number(parseInt(expires, 10)) * 1000));\n\n var nDate = new Date(sDate);\n var expiresString = nDate.toGMTString();\n\n var re = new RegExp(\"([^\\\\s]+)(\\\\s\\\\d\\\\d)\\\\s(\\\\w\\\\w\\\\w)\\\\s(.*)\");\n expiresString = expiresString.replace(re, \"$1$2-$3-$4\");\n\n sExpires = 'expires='+expiresString;\n } else {\n if(typeof(expires) !== 'undefined' && !isNaN(expires) && Number(parseInt(expires, 10))===0) {\n sExpires = '';\n } else {\n sExpires = 'expires=Thu, 01-Jan-2037 00:00:01 GMT';\n }\n }\n\n if(path && typeof(path) !== 'undefined') {\n sPath = 'path='+path;\n } else {\n sPath = 'path=/';\n }\n\n if(domain && typeof(domain) !== 'undefined') {\n sDomain = 'domain='+domain;\n } else {\n var portClean = new RegExp(\":(.*)\");\n sDomain = 'domain='+window.location.host;\n sDomain = sDomain.replace(portClean,\"\");\n }\n\n if(secure && typeof(secure) !== 'undefined') {\n sSecure = secure;\n } else {\n sSecure = false;\n }\n\n document.cookie = sName+'; '+sExpires+'; '+sPath+'; '+sDomain+'; '+sSecure;\n },\n\n /**\n * Deletes a cookie.\n *\n * @method remove\n * @param {String} cookieName Cookie name.\n * @param {String} [path] Path of the cookie. Defaults to '/'.\n * @param {String} [domain] Domain of the cookie. Defaults to current hostname.\n * @public\n * @static\n * @sample Ink_Util_Cookie_remove.html\n */\n remove: function(cookieName, path, domain)\n {\n //var expiresDate = 'Thu, 01-Jan-1970 00:00:01 GMT';\n var sPath = false;\n var sDomain = false;\n var expiresDate = -999999999;\n\n if(path && typeof(path) !== 'undefined') {\n sPath = path;\n } else {\n sPath = '/';\n }\n\n if(domain && typeof(domain) !== 'undefined') {\n sDomain = domain;\n } else {\n sDomain = window.location.host;\n }\n\n this.set(cookieName, 'deleted', expiresDate, sPath, sDomain);\n }\n };\n\n return Cookie;\n\n});\n","/**\n * Date utility functions\n * @module Ink.Util.Date_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Date', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.Date_1 \n */\n var InkDate = {\n\n /**\n * Function that returns the string representation of the month [PT only]\n *\n * @method _months\n * @param {Number} index Month javascript (0 to 11)\n * @return {String} The month's name\n * @private\n * @static\n * @example\n * console.log( InkDate._months(0) ); // Result: Janeiro\n */\n _months: function(index){\n var _m = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];\n return _m[index];\n },\n\n /**\n * Function that returns the month [PT only] ( 0 to 11 )\n *\n * @method _iMonth\n * @param {String} month Month javascript (0 to 11)\n * @return {Number} The month's number\n * @private\n * @static\n * @example\n * console.log( InkDate._iMonth('maio') ); // Result: 4\n */\n _iMonth : function( month )\n {\n if ( Number( month ) ) { return +month - 1; }\n return {\n 'janeiro' : 0 ,\n 'jan' : 0 ,\n 'fevereiro' : 1 ,\n 'fev' : 1 ,\n 'março' : 2 ,\n 'mar' : 2 ,\n 'abril' : 3 ,\n 'abr' : 3 ,\n 'maio' : 4 ,\n 'mai' : 4 ,\n 'junho' : 5 ,\n 'jun' : 5 ,\n 'julho' : 6 ,\n 'jul' : 6 ,\n 'agosto' : 7 ,\n 'ago' : 7 ,\n 'setembro' : 8 ,\n 'set' : 8 ,\n 'outubro' : 9 ,\n 'out' : 9 ,\n 'novembro' : 10 ,\n 'nov' : 10 ,\n 'dezembro' : 11 ,\n 'dez' : 11\n }[ month.toLowerCase( ) ];\n } ,\n\n /**\n * Function that returns the representation the day of the week [PT Only]\n *\n * @method _wDays\n * @param {Number} index Week's day index\n * @return {String} The week's day name\n * @private\n * @static\n * @example\n * console.log( InkDate._wDays(0) ); // Result: Domingo\n */\n _wDays: function(index){\n var _d = ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'];\n return _d[index];\n },\n\n /**\n * Function that returns day of the week in javascript 1 to 7\n *\n * @method _iWeek\n * @param {String} week Week's day name\n * @return {Number} The week's day index\n * @private\n * @static\n * @example\n * console.log( InkDate._iWeek('quarta') ); // Result: 3\n */\n _iWeek: function( week )\n {\n if ( Number( week ) ) { return +week || 7; }\n return {\n 'segunda' : 1 ,\n 'seg' : 1 ,\n 'terça' : 2 ,\n 'ter' : 2 ,\n 'quarta' : 3 ,\n 'qua' : 3 ,\n 'quinta' : 4 ,\n 'qui' : 4 ,\n 'sexta' : 5 ,\n 'sex' : 5 ,\n 'sábado' : 6 ,\n 'sáb' : 6 ,\n 'domingo' : 7 ,\n 'dom' : 7\n }[ week.toLowerCase( ) ];\n },\n\n /**\n * Function that returns the number of days of a given month (m) on a given year (y)\n *\n * @method _daysInMonth\n * @param {Number} _m Month\n * @param {Number} _y Year\n * @return {Number} Number of days of a give month on a given year\n * @private\n * @static\n * @example\n * console.log( InkDate._daysInMonth(2,2013) ); // Result: 28\n */\n _daysInMonth: function(_m,_y){\n var nDays;\n\n if(_m===1 || _m===3 || _m===5 || _m===7 || _m===8 || _m===10 || _m===12)\n {\n nDays= 31;\n }\n else if ( _m===4 || _m===6 || _m===9 || _m===11)\n {\n nDays = 30;\n }\n else\n {\n if((_y%400===0) || (_y%4===0 && _y%100!==0))\n {\n nDays = 29;\n }\n else\n {\n nDays = 28;\n }\n }\n return nDays;\n },\n\n /**\n * Formats a date object.\n * This works exactly as php date() function. http://php.net/manual/en/function.date.php\n *\n * @method get\n * @param {String} format The format in which the date it will be formatted.\n * @param {Date} [_date] The date to format. Can receive unix timestamp or a date object. Defaults to current time.\n * @return {String} Formatted date\n * @public\n * @static\n * @sample Ink_Util_Date_get.html \n */\n get: function(format, _date){\n /*jshint maxcomplexity:65 */\n if(typeof(format) === 'undefined' || format === ''){\n format = \"Y-m-d\";\n }\n\n\n var iFormat = format.split(\"\");\n var result = new Array(iFormat.length);\n var escapeChar = \"\\\\\";\n var jsDate;\n\n if (typeof(_date) === 'undefined'){\n jsDate = new Date();\n } else if (typeof(_date)==='number'){\n jsDate = new Date(_date*1000);\n } else {\n jsDate = new Date(_date);\n }\n\n var jsFirstDay, jsThisDay, jsHour;\n /* This switch is presented in the same order as in php date function (PHP 5.2.2) */\n for (var i = 0; i < iFormat.length; i++) {\n switch(iFormat[i]) {\n case escapeChar:\n result[i] = iFormat[i+1];\n i++;\n break;\n\n\n /* DAY */\n case \"d\": /* Day of the month, 2 digits with leading zeros; ex: 01 to 31 */\n var jsDay = jsDate.getDate();\n result[i] = (String(jsDay).length > 1) ? jsDay : \"0\" + jsDay;\n break;\n\n case \"D\": /* A textual representation of a day, three letters; Seg to Dom */\n result[i] = this._wDays(jsDate.getDay()).substring(0, 3);\n break;\n\n case \"j\": /* Day of the month without leading zeros; ex: 1 to 31 */\n result[i] = jsDate.getDate();\n break;\n\n case \"l\": /* A full textual representation of the day of the week; Domingo to Sabado */\n result[i] = this._wDays(jsDate.getDay());\n break;\n\n case \"N\": /* ISO-8601 numeric representation of the day of the week; 1 (Segunda) to 7 (Domingo) */\n result[i] = jsDate.getDay() || 7;\n break;\n\n case \"S\": /* English ordinal suffix for the day of the month, 2 characters; st, nd, rd or th. Works well with j */\n var temp = jsDate.getDate();\n var suffixes = [\"st\", \"nd\", \"rd\"];\n var suffix = \"\";\n\n if (temp >= 11 && temp <= 13) {\n result[i] = \"th\";\n } else {\n result[i] = (suffix = suffixes[String(temp).substr(-1) - 1]) ? (suffix) : (\"th\");\n }\n break;\n\n case \"w\": /* Numeric representation of the day of the week; 0 (for Sunday) through 6 (for Saturday) */\n result[i] = jsDate.getDay();\n break;\n\n case \"z\": /* The day of the year (starting from 0); 0 to 365 */\n jsFirstDay = Date.UTC(jsDate.getFullYear(), 0, 0);\n jsThisDay = Date.UTC(jsDate.getFullYear(), jsDate.getMonth(), jsDate.getDate());\n result[i] = Math.floor((jsThisDay - jsFirstDay) / (1000 * 60 * 60 * 24));\n break;\n\n /* WEEK */\n case \"W\": /* ISO-8601 week number of year, weeks starting on Monday; ex: 42 (the 42nd week in the year) */\n var jsYearStart = new Date( jsDate.getFullYear( ) , 0 , 1 );\n jsFirstDay = jsYearStart.getDay() || 7;\n\n var days = Math.floor( ( jsDate - jsYearStart ) / ( 24 * 60 * 60 * 1000 ) + 1 );\n\n result[ i ] = Math.ceil( ( days - ( 8 - jsFirstDay ) ) / 7 ) + 1;\n break;\n\n\n /* MONTH */\n case \"F\": /* A full textual representation of a month, such as Janeiro or Marco; Janeiro a Dezembro */\n result[i] = this._months(jsDate.getMonth());\n break;\n\n case \"m\": /* Numeric representation of a month, with leading zeros; 01 to 12 */\n var jsMonth = String(jsDate.getMonth() + 1);\n result[i] = (jsMonth.length > 1) ? jsMonth : \"0\" + jsMonth;\n break;\n\n case \"M\": /* A short textual representation of a month, three letters; Jan a Dez */\n result[i] = this._months(jsDate.getMonth()).substring(0,3);\n break;\n\n case \"n\": /* Numeric representation of a month, without leading zeros; 1 a 12 */\n result[i] = jsDate.getMonth() + 1;\n break;\n\n case \"t\": /* Number of days in the given month; ex: 28 */\n result[i] = this._daysInMonth(jsDate.getMonth()+1,jsDate.getYear());\n break;\n\n /* YEAR */\n case \"L\": /* Whether it's a leap year; 1 if it is a leap year, 0 otherwise. */\n var jsYear = jsDate.getFullYear();\n result[i] = (jsYear % 4) ? false : ( (jsYear % 100) ? true : ( (jsYear % 400) ? false : true ) );\n break;\n\n case \"o\": /* ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. */\n throw '\"o\" not implemented!';\n\n case \"Y\": /* A full numeric representation of a year, 4 digits; 1999 */\n result[i] = jsDate.getFullYear();\n break;\n\n case \"y\": /* A two digit representation of a year; 99 */\n result[i] = String(jsDate.getFullYear()).substring(2);\n break;\n\n /* TIME */\n case \"a\": /* Lowercase Ante meridiem and Post meridiem; am or pm */\n result[i] = (jsDate.getHours() < 12) ? \"am\" : \"pm\";\n break;\n\n case \"A\": /* Uppercase Ante meridiem and Post meridiem; AM or PM */\n result[i] = (jsDate.getHours < 12) ? \"AM\" : \"PM\";\n break;\n\n case \"B\": /* Swatch Internet time; 000 through 999 */\n throw '\"B\" not implemented!';\n\n case \"g\": /* 12-hour format of an hour without leading zeros; 1 to 12 */\n jsHour = jsDate.getHours();\n result[i] = (jsHour <= 12) ? jsHour : (jsHour - 12);\n break;\n\n case \"G\": /* 24-hour format of an hour without leading zeros; 1 to 23 */\n result[i] = String(jsDate.getHours());\n break;\n\n case \"h\": /* 12-hour format of an hour with leading zeros; 01 to 12 */\n jsHour = String(jsDate.getHours());\n jsHour = (jsHour <= 12) ? jsHour : (jsHour - 12);\n result[i] = (jsHour.length > 1) ? jsHour : \"0\" + jsHour;\n break;\n\n case \"H\": /* 24-hour format of an hour with leading zeros; 01 to 24 */\n jsHour = String(jsDate.getHours());\n result[i] = (jsHour.length > 1) ? jsHour : \"0\" + jsHour;\n break;\n\n case \"i\": /* Minutes with leading zeros; 00 to 59 */\n var jsMinute = String(jsDate.getMinutes());\n result[i] = (jsMinute.length > 1) ? jsMinute : \"0\" + jsMinute;\n break;\n\n case \"s\": /* Seconds with leading zeros; 00 to 59; */\n var jsSecond = String(jsDate.getSeconds());\n result[i] = (jsSecond.length > 1) ? jsSecond : \"0\" + jsSecond;\n break;\n\n case \"u\": /* Microseconds */\n throw '\"u\" not implemented!';\n\n\n /* TIMEZONE */\n\n case \"e\": /* Timezone identifier */\n throw '\"e\" not implemented!';\n\n case \"I\": /* \"1\" if Daylight Savings Time, \"0\" otherwise. Works only on the northern hemisphere */\n jsFirstDay = new Date(jsDate.getFullYear(), 0, 1);\n result[i] = (jsDate.getTimezoneOffset() !== jsFirstDay.getTimezoneOffset()) ? (1) : (0);\n break;\n\n case \"O\": /* Difference to Greenwich time (GMT) in hours */\n var jsMinZone = jsDate.getTimezoneOffset();\n var jsMinutes = jsMinZone % 60;\n jsHour = String(((jsMinZone - jsMinutes) / 60) * -1);\n\n if (jsHour.charAt(0) !== \"-\") {\n jsHour = \"+\" + jsHour;\n }\n\n jsHour = (jsHour.length === 3) ? (jsHour) : (jsHour.replace(/([+\\-])(\\d)/, \"$1\" + 0 + \"$2\"));\n result[i] = jsHour + jsMinutes + \"0\";\n break;\n\n case \"P\": /* Difference to Greenwich time (GMT) with colon between hours and minutes */\n throw '\"P\" not implemented!';\n\n case \"T\": /* Timezone abbreviation */\n throw '\"T\" not implemented!';\n\n case \"Z\": /* Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. */\n result[i] = jsDate.getTimezoneOffset() * 60;\n break;\n\n\n /* FULL DATE/TIME */\n\n case \"c\": /* ISO 8601 date */\n throw '\"c\" not implemented!';\n\n case \"r\": /* RFC 2822 formatted date */\n var jsDayName = this._wDays(jsDate.getDay()).substr(0, 3);\n var jsMonthName = this._months(jsDate.getMonth()).substr(0, 3);\n result[i] = jsDayName + \", \" + jsDate.getDate() + \" \" + jsMonthName + this.get(\" Y H:i:s O\",jsDate);\n break;\n\n case \"U\": /* Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) */\n result[i] = Math.floor(jsDate.getTime() / 1000);\n break;\n\n default:\n result[i] = iFormat[i];\n }\n }\n\n return result.join('');\n\n },\n\n /**\n * Creates a date object based on a format string.\n * This works exactly as php date() function. http://php.net/manual/en/function.date.php\n *\n * @method set\n * @param {String} [format] The format in which the date will be formatted. Defaults to 'Y-m-d'\n * @param {String} str_date The date formatted.\n * @return {Date} Date object based on the formatted date and format\n * @public\n * @static\n * @sample Ink_Util_Date_set.html \n */\n set : function( format , str_date ) {\n if ( typeof str_date === 'undefined' ) { return ; }\n if ( typeof format === 'undefined' || format === '' ) { format = \"Y-m-d\"; }\n\n var iFormat = format.split(\"\");\n var result = new Array( iFormat.length );\n var escapeChar = \"\\\\\";\n var mList;\n\n var objIndex = {\n year : undefined ,\n month : undefined ,\n day : undefined ,\n dayY : undefined ,\n dayW : undefined ,\n week : undefined ,\n hour : undefined ,\n hourD : undefined ,\n min : undefined ,\n sec : undefined ,\n msec : undefined ,\n ampm : undefined ,\n diffM : undefined ,\n diffH : undefined ,\n date : undefined\n };\n\n var matches = 0;\n\n /* This switch is presented in the same order as in php date function (PHP 5.2.2) */\n for ( var i = 0; i < iFormat.length; i++) {\n switch( iFormat[ i ] ) {\n case escapeChar:\n result[i] = iFormat[ i + 1 ];\n i++;\n break;\n\n /* DAY */\n case \"d\": /* Day of the month, 2 digits with leading zeros; ex: 01 to 31 */\n result[ i ] = '(\\\\d{2})';\n objIndex.day = { original : i , match : matches++ };\n break;\n\n case \"j\": /* Day of the month without leading zeros; ex: 1 to 31 */\n result[ i ] = '(\\\\d{1,2})';\n objIndex.day = { original : i , match : matches++ };\n break;\n\n case \"D\": /* A textual representation of a day, three letters; Seg to Dom */\n result[ i ] = '([\\\\wá]{3})';\n objIndex.dayW = { original : i , match : matches++ };\n break;\n\n case \"l\": /* A full textual representation of the day of the week; Domingo to Sabado */\n result[i] = '([\\\\wá]{5,7})';\n objIndex.dayW = { original : i , match : matches++ };\n break;\n\n case \"N\": /* ISO-8601 numeric representation of the day of the week; 1 (Segunda) to 7 (Domingo) */\n result[ i ] = '(\\\\d)';\n objIndex.dayW = { original : i , match : matches++ };\n break;\n\n case \"w\": /* Numeric representation of the day of the week; 0 (for Sunday) through 6 (for Saturday) */\n result[ i ] = '(\\\\d)';\n objIndex.dayW = { original : i , match : matches++ };\n break;\n\n case \"S\": /* English ordinal suffix for the day of the month, 2 characters; st, nd, rd or th. Works well with j */\n result[ i ] = '\\\\w{2}';\n break;\n\n case \"z\": /* The day of the year (starting from 0); 0 to 365 */\n result[ i ] = '(\\\\d{1,3})';\n objIndex.dayY = { original : i , match : matches++ };\n break;\n\n /* WEEK */\n case \"W\": /* ISO-8601 week number of year, weeks starting on Monday; ex: 42 (the 42nd week in the year) */\n result[ i ] = '(\\\\d{1,2})';\n objIndex.week = { original : i , match : matches++ };\n break;\n\n /* MONTH */\n case \"F\": /* A full textual representation of a month, such as Janeiro or Marco; Janeiro a Dezembro */\n result[ i ] = '([\\\\wç]{4,9})';\n objIndex.month = { original : i , match : matches++ };\n break;\n\n case \"M\": /* A short textual representation of a month, three letters; Jan a Dez */\n result[ i ] = '(\\\\w{3})';\n objIndex.month = { original : i , match : matches++ };\n break;\n\n case \"m\": /* Numeric representation of a month, with leading zeros; 01 to 12 */\n result[ i ] = '(\\\\d{2})';\n objIndex.month = { original : i , match : matches++ };\n break;\n\n case \"n\": /* Numeric representation of a month, without leading zeros; 1 a 12 */\n result[ i ] = '(\\\\d{1,2})';\n objIndex.month = { original : i , match : matches++ };\n break;\n\n case \"t\": /* Number of days in the given month; ex: 28 */\n result[ i ] = '\\\\d{2}';\n break;\n\n /* YEAR */\n case \"L\": /* Whether it's a leap year; 1 if it is a leap year, 0 otherwise. */\n result[ i ] = '\\\\w{4,5}';\n break;\n\n case \"o\": /* ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. */\n throw '\"o\" not implemented!';\n\n case \"Y\": /* A full numeric representation of a year, 4 digits; 1999 */\n result[ i ] = '(\\\\d{4})';\n objIndex.year = { original : i , match : matches++ };\n break;\n\n case \"y\": /* A two digit representation of a year; 99 */\n result[ i ] = '(\\\\d{2})';\n if ( typeof objIndex.year === 'undefined' || iFormat[ objIndex.year.original ] !== 'Y' ) {\n objIndex.year = { original : i , match : matches++ };\n }\n break;\n\n /* TIME */\n case \"a\": /* Lowercase Ante meridiem and Post meridiem; am or pm */\n result[ i ] = '(am|pm)';\n objIndex.ampm = { original : i , match : matches++ };\n break;\n\n case \"A\": /* Uppercase Ante meridiem and Post meridiem; AM or PM */\n result[ i ] = '(AM|PM)';\n objIndex.ampm = { original : i , match : matches++ };\n break;\n\n case \"B\": /* Swatch Internet time; 000 through 999 */\n throw '\"B\" not implemented!';\n\n case \"g\": /* 12-hour format of an hour without leading zeros; 1 to 12 */\n result[ i ] = '(\\\\d{1,2})';\n objIndex.hourD = { original : i , match : matches++ };\n break;\n\n case \"G\": /* 24-hour format of an hour without leading zeros; 1 to 23 */\n result[ i ] = '(\\\\d{1,2})';\n objIndex.hour = { original : i , match : matches++ };\n break;\n\n case \"h\": /* 12-hour format of an hour with leading zeros; 01 to 12 */\n result[ i ] = '(\\\\d{2})';\n objIndex.hourD = { original : i , match : matches++ };\n break;\n\n case \"H\": /* 24-hour format of an hour with leading zeros; 01 to 24 */\n result[ i ] = '(\\\\d{2})';\n objIndex.hour = { original : i , match : matches++ };\n break;\n\n case \"i\": /* Minutes with leading zeros; 00 to 59 */\n result[ i ] = '(\\\\d{2})';\n objIndex.min = { original : i , match : matches++ };\n break;\n\n case \"s\": /* Seconds with leading zeros; 00 to 59; */\n result[ i ] = '(\\\\d{2})';\n objIndex.sec = { original : i , match : matches++ };\n break;\n\n case \"u\": /* Microseconds */\n throw '\"u\" not implemented!';\n\n /* TIMEZONE */\n case \"e\": /* Timezone identifier */\n throw '\"e\" not implemented!';\n\n case \"I\": /* \"1\" if Daylight Savings Time, \"0\" otherwise. Works only on the northern hemisphere */\n result[i] = '\\\\d';\n break;\n\n case \"O\": /* Difference to Greenwich time (GMT) in hours */\n result[ i ] = '([-+]\\\\d{4})';\n objIndex.diffH = { original : i , match : matches++ };\n break;\n\n case \"P\": /* Difference to Greenwich time (GMT) with colon between hours and minutes */\n throw '\"P\" not implemented!';\n\n case \"T\": /* Timezone abbreviation */\n throw '\"T\" not implemented!';\n\n case \"Z\": /* Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. */\n result[ i ] = '(\\\\-?\\\\d{1,5})';\n objIndex.diffM = { original : i , match : matches++ };\n break;\n\n /* FULL DATE/TIME */\n case \"c\": /* ISO 8601 date */\n throw '\"c\" not implemented!';\n\n case \"r\": /* RFC 2822 formatted date */\n result[ i ] = '([\\\\wá]{3}, \\\\d{1,2} \\\\w{3} \\\\d{4} \\\\d{2}:\\\\d{2}:\\\\d{2} [+\\\\-]\\\\d{4})';\n objIndex.date = { original : i , match : matches++ };\n break;\n\n case \"U\": /* Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) */\n result[ i ] = '(\\\\d{1,13})';\n objIndex.date = { original : i , match : matches++ };\n break;\n\n default:\n result[ i ] = iFormat[ i ];\n }\n }\n\n var pattr = new RegExp( result.join('') );\n\n try {\n mList = str_date.match( pattr );\n if ( !mList ) { return; }\n }\n catch ( e ) { return ; }\n\n var _haveDatetime = typeof objIndex.date !== 'undefined';\n\n var _haveYear = typeof objIndex.year !== 'undefined';\n\n var _haveYDay = typeof objIndex.dayY !== 'undefined';\n\n var _haveDay = typeof objIndex.day !== 'undefined';\n var _haveMonth = typeof objIndex.month !== 'undefined';\n var _haveMonthDay = _haveMonth && _haveDay;\n var _haveOnlyDay = !_haveMonth && _haveDay;\n\n var _haveWDay = typeof objIndex.dayW !== 'undefined';\n var _haveWeek = typeof objIndex.week !== 'undefined';\n var _haveWeekWDay = _haveWeek && _haveWDay;\n var _haveOnlyWDay = !_haveWeek && _haveWDay;\n\n var _validDate = _haveYDay || _haveMonthDay || !_haveYear && _haveOnlyDay || _haveWeekWDay || !_haveYear && _haveOnlyWDay;\n var _noDate = !_haveYear && !_haveYDay && !_haveDay && !_haveMonth && !_haveWDay && !_haveWeek;\n\n var _haveHour12 = typeof objIndex.hourD !== 'undefined' && typeof objIndex.ampm !== 'undefined';\n var _haveHour24 = typeof objIndex.hour !== 'undefined';\n var _haveHour = _haveHour12 || _haveHour24;\n\n var _haveMin = typeof objIndex.min !== 'undefined';\n var _haveSec = typeof objIndex.sec !== 'undefined';\n var _haveMSec = typeof objIndex.msec !== 'undefined';\n\n var _haveMoreM = !_noDate || _haveHour;\n var _haveMoreS = _haveMoreM || _haveMin;\n\n var _haveDiffM = typeof objIndex.diffM !== 'undefined';\n var _haveDiffH = typeof objIndex.diffH !== 'undefined';\n //var _haveGMT = _haveDiffM || _haveDiffH;\n var hour;\n var min;\n\n if ( _haveDatetime ) {\n if ( iFormat[ objIndex.date.original ] === 'U' ) {\n return new Date( +mList[ objIndex.date.match + 1 ] * 1000 );\n }\n\n var dList = mList[ objIndex.date.match + 1 ].match( /\\w{3}, (\\d{1,2}) (\\w{3}) (\\d{4}) (\\d{2}):(\\d{2}):(\\d{2}) ([+\\-]\\d{4})/ );\n hour = +dList[ 4 ] + ( +dList[ 7 ].slice( 0 , 3 ) );\n min = +dList[ 5 ] + ( dList[ 7 ].slice( 0 , 1 ) + dList[ 7 ].slice( 3 ) ) / 100 * 60;\n\n return new Date( dList[ 3 ] , this._iMonth( dList[ 2 ] ) , dList[ 1 ] , hour , min , dList[ 6 ] );\n }\n\n var _d = new Date( );\n var year;\n var month;\n var day;\n var sec;\n var msec;\n var gmt;\n\n if ( !_validDate && !_noDate ) { return ; }\n\n if ( _validDate ) {\n if ( _haveYear ) {\n var _y = _d.getFullYear( ) - 50 + '';\n year = mList[ objIndex.year.match + 1 ];\n if ( iFormat[ objIndex.year.original ] === 'y' ) {\n year = +_y.slice( 0 , 2 ) + ( year >= ( _y ).slice( 2 ) ? 0 : 1 ) + year;\n }\n } else {\n year = _d.getFullYear();\n }\n\n if ( _haveYDay ) {\n month = 0;\n day = mList[ objIndex.dayY.match + 1 ];\n } else if ( _haveDay ) {\n if ( _haveMonth ) {\n month = this._iMonth( mList[ objIndex.month.match + 1 ] );\n } else {\n month = _d.getMonth( );\n }\n\n day = mList[ objIndex.day.match + 1 ];\n } else {\n month = 0;\n\n var week;\n if ( _haveWeek ) {\n week = mList[ objIndex.week.match + 1 ];\n } else {\n week = this.get( 'W' , _d );\n }\n\n day = ( week - 2 ) * 7 + ( 8 - ( ( new Date( year , 0 , 1 ) ).getDay( ) || 7 ) ) + this._iWeek( mList[ objIndex.week.match + 1 ] );\n }\n\n if ( month === 0 && day > 31 ) {\n var aux = new Date( year , month , day );\n month = aux.getMonth( );\n day = aux.getDate( );\n }\n }\n else {\n year = _d.getFullYear( );\n month = _d.getMonth( );\n day = _d.getDate( );\n }\n\n if ( _haveHour12 ) { hour = +mList[ objIndex.hourD.match + 1 ] + ( mList[ objIndex.ampm.match + 1 ] === 'pm' ? 12 : 0 ); }\n else if ( _haveHour24 ) { hour = mList[ objIndex.hour.match + 1 ]; }\n else if ( _noDate ) { hour = _d.getHours( ); }\n else { hour = '00'; }\n\n if ( _haveMin ) { min = mList[ objIndex.min.match + 1 ]; }\n else if ( !_haveMoreM ) { min = _d.getMinutes( ); }\n else { min = '00'; }\n\n if ( _haveSec ) { sec = mList[ objIndex.sec.match + 1 ]; }\n else if ( !_haveMoreS ) { sec = _d.getSeconds( ); }\n else { sec = '00'; }\n\n if ( _haveMSec ) { msec = mList[ objIndex.msec.match + 1 ]; }\n else { msec = '000'; }\n\n if ( _haveDiffH ) { gmt = mList[ objIndex.diffH.match + 1 ]; }\n else if ( _haveDiffM ) { gmt = String( -1 * mList[ objIndex.diffM.match + 1 ] / 60 * 100 ).replace( /^(\\d)/ , '+$1' ).replace( /(^[\\-+])(\\d{3}$)/ , '$10$2' ); }\n else { gmt = '+0000'; }\n\n return new Date( year, month, day, hour, min, sec );\n }\n };\n\n\n return InkDate;\n\n});\n","/**\n * Dump/Profiling Utilities\n * @module Ink.Util.Dumper_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Dumper', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.Dumper_1 \n */\n\n var Dumper = {\n\n /**\n * Hex code for the 'tab'\n * \n * @property _tab\n * @type {String}\n * @private\n * @readOnly\n * @static\n *\n */\n _tab: '\\xA0\\xA0\\xA0\\xA0',\n\n /**\n * Function that returns the argument passed formatted\n *\n * @method _formatParam\n * @param {Mixed} param\n * @return {String} The argument passed formatted\n * @private\n * @static\n */\n _formatParam: function(param)\n {\n var formated = '';\n\n switch(typeof(param)) {\n case 'string':\n formated = '(string) '+param;\n break;\n case 'number':\n formated = '(number) '+param;\n break;\n case 'boolean':\n formated = '(boolean) '+param;\n break;\n case 'object':\n if(param !== null) {\n if(param.constructor === Array) {\n formated = 'Array \\n{\\n' + this._outputFormat(param, 0) + '\\n}';\n } else {\n formated = 'Object \\n{\\n' + this._outputFormat(param, 0) + '\\n}';\n }\n } else {\n formated = 'null';\n }\n break;\n default:\n formated = false;\n }\n\n return formated;\n },\n\n /**\n * Function that returns the tabs concatenated\n *\n * @method _getTabs\n * @param {Number} numberOfTabs Number of Tabs\n * @return {String} Tabs concatenated\n * @private\n * @static\n */\n _getTabs: function(numberOfTabs)\n {\n var tabs = '';\n for(var _i = 0; _i < numberOfTabs; _i++) {\n tabs += this._tab;\n }\n return tabs;\n },\n\n /**\n * Function that formats the parameter to display.\n *\n * @method _outputFormat\n * @param {Any} param\n * @param {Number} dim\n * @return {String} The parameter passed formatted to displat\n * @private\n * @static\n */\n _outputFormat: function(param, dim)\n {\n var formated = '';\n //var _strVal = false;\n var _typeof = false;\n for(var key in param) {\n if(param[key] !== null) {\n if(typeof(param[key]) === 'object' && (param[key].constructor === Array || param[key].constructor === Object)) {\n if(param[key].constructor === Array) {\n _typeof = 'Array';\n } else if(param[key].constructor === Object) {\n _typeof = 'Object';\n }\n formated += this._tab + this._getTabs(dim) + '[' + key + '] => '+_typeof+'\\n';\n formated += this._tab + this._getTabs(dim) + '{\\n';\n formated += this._outputFormat(param[key], dim + 1) + this._tab + this._getTabs(dim) + '}\\n';\n } else if(param[key].constructor === Function) {\n continue;\n } else {\n formated = formated + this._tab + this._getTabs(dim) + '[' + key + '] => ' + param[key] + '\\n';\n }\n } else {\n formated = formated + this._tab + this._getTabs(dim) + '[' + key + '] => null \\n';\n }\n }\n return formated;\n },\n\n /**\n * Prints variable structure.\n *\n * @method printDump\n * @param {Any} param Variable to be dumped.\n * @param {DOMElement|String} [target] Element to print the dump on.\n * @public\n * @static\n * @sample Ink_Util_Dumper_printDump.html \n */\n printDump: function(param, target)\n {\n /*jshint evil:true */\n if(!target || typeof(target) === 'undefined') {\n document.write('
            '+this._formatParam(param)+'
            ');\n } else {\n if(typeof(target) === 'string') {\n document.getElementById(target).innerHTML = '
            ' + this._formatParam(param) + '
            ';\n } else if(typeof(target) === 'object') {\n target.innerHTML = '
            '+this._formatParam(param)+'
            ';\n } else {\n throw \"TARGET must be an element or an element ID\";\n }\n }\n },\n\n /**\n * Get a variable's structure.\n *\n * @method returnDump\n * @param {Any} param Variable to get the structure.\n * @return {String} The variable's structure.\n * @public\n * @static\n * @sample Ink_Util_Dumper_returnDump.html \n */\n returnDump: function(param)\n {\n return this._formatParam(param);\n },\n\n /**\n * Alert a variable's structure.\n *\n * @method alertDump\n * @param {Any} param Variable to be dumped.\n * @public\n * @static\n * @sample Ink_Util_Dumper_alertDump.html \n */\n alertDump: function(param)\n {\n window.alert(this._formatParam(param).replace(/()(Array|Object)(<\\/b>)/g, \"$2\"));\n },\n\n /**\n * Prints the variable structure to a new window.\n *\n * @method windowDump\n * @param {Any} param Variable to be dumped.\n * @public\n * @static\n * @sample Ink_Util_Dumper_windowDump.html \n */\n windowDump: function(param)\n {\n var dumperwindow = 'dumperwindow_'+(Math.random() * 10000);\n var win = window.open('',\n dumperwindow,\n 'width=400,height=300,left=50,top=50,status,menubar,scrollbars,resizable'\n );\n win.document.open();\n win.document.write('
            '+this._formatParam(param)+'
            ');\n win.document.close();\n win.focus();\n }\n\n };\n\n return Dumper;\n\n});\n","/**\n * Internationalization Utilities \n * @module Ink.Util.I18n_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.I18n', '1', [], function () {\n 'use strict';\n\n var pattrText = /\\{(?:(\\{.*?})|(?:%s:)?(\\d+)|(?:%s)?|([\\w-]+))}/g;\n\n var funcOrVal = function( ret , args ) {\n if ( typeof ret === 'function' ) {\n return ret.apply(this, args);\n } else if (typeof ret !== undefined) {\n return ret;\n } else {\n return '';\n }\n };\n\n /**\n * You can use this module to internationalize your applications. It roughly emulates GNU gettext's API.\n *\n * @class Ink.Util.I18n\n * @constructor\n *\n * @param {Object} dict Object mapping language codes (in the form of `pt_PT`, `pt_BR`, `fr`, `en_US`, etc.) to their `dictionaries`\n * @param {String} [lang='pt_PT'] language code of the target language\n *\n * @sample Ink_Util_I18n_1.html\n */\n var I18n = function( dict , lang , testMode ) {\n if ( !( this instanceof I18n ) ) { return new I18n( dict , lang , testMode ); }\n\n this.reset( )\n .lang( lang )\n .testMode( testMode )\n .append( dict || { } , lang );\n };\n\n I18n.prototype = {\n reset: function( ) {\n this._dicts = [ ];\n this._dict = { };\n this._testMode = false;\n this._lang = this._gLang;\n\n return this;\n },\n /**\n * Adds translation strings for the helper to use.\n *\n * @method append\n * @param {Object} dict Object containing language objects identified by their language code\n *\n * @sample Ink_Util_I18n_1_append.html\n */\n append: function( dict ) {\n this._dicts.push( dict );\n\n this._dict = Ink.extendObj(this._dict , dict[ this._lang ] );\n\n return this;\n },\n /**\n * Gets or sets the language.\n * If there are more dictionaries available in cache, they will be loaded.\n *\n * @method lang\n * @param {String} lang Language code to set this instance to.\n */\n lang: function( lang ) {\n if ( !arguments.length ) { return this._lang; }\n\n if ( lang && this._lang !== lang ) {\n this._lang = lang;\n\n this._dict = { };\n\n for ( var i = 0, l = this._dicts.length; i < l; i++ ) {\n this._dict = Ink.extendObj( this._dict , this._dicts[ i ][ lang ] || { } );\n }\n }\n\n return this;\n },\n /**\n * Sets or unsets test mode.\n * In test mode, unknown strings are wrapped in `[ ... ]`. This is useful for debugging your application and to make sure all your translation keys are in place.\n *\n * @method testMode\n * @param {Boolean} bool Flag to set the test mode state\n */\n testMode: function( bool ) {\n if ( !arguments.length ) { return !!this._testMode; }\n\n if ( bool !== undefined ) { this._testMode = !!bool; }\n\n return this;\n },\n\n /**\n * Gest a key from the current dictionary\n *\n * @method getKey\n * @param {String} key\n * @return {Mixed} The object which happened to be in the current language dictionary on the given key.\n *\n * @sample Ink_Util_I18n_1_getKey.html\n */\n getKey: function( key ) {\n var ret;\n var gLang = this._gLang;\n var lang = this._lang;\n \n if ( key in this._dict ) {\n ret = this._dict[ key ];\n } else {\n I18n.langGlobal( lang );\n \n ret = this._gDict[ key ];\n \n I18n.langGlobal( gLang );\n }\n \n return ret;\n },\n\n /**\n * Translates a string.\n * Given a translation key, return a translated string, with replaced parameters.\n * When a translated string is not available, the original string is returned unchanged.\n *\n * @method text\n * @param {String} str Key to look for in i18n dictionary (which is returned verbatim if unknown)\n * @param {Object} [namedParms] Named replacements. Replaces {named} with values in this object.\n * @param {String} [args] Replacement #1 (replaces first {} and all {1})\n * @param {String} [arg2] Replacement #2 (replaces second {} and all {2})\n * @param {String} [argn*] Replacement #n (replaces nth {} and all {n})\n *\n * @sample Ink_Util_I18n_1_text.html\n */\n text: function( str /*, replacements...*/ ) {\n if ( typeof str !== 'string' ) { return; } // Backwards-compat\n\n var pars = Array.prototype.slice.call( arguments , 1 );\n var idx = 0;\n var isObj = typeof pars[ 0 ] === 'object';\n\n var original = this.getKey( str );\n if ( original === undefined ) { original = this._testMode ? '[' + str + ']' : str; }\n if ( typeof original === 'number' ) { original += ''; }\n\n if (typeof original === 'string') {\n original = original.replace( pattrText , function( m , $1 , $2 , $3 ) {\n var ret =\n $1 ? $1 :\n $2 ? pars[ $2 - ( isObj ? 0 : 1 ) ] :\n $3 ? pars[ 0 ][ $3 ] || '' :\n pars[ (idx++) + ( isObj ? 1 : 0 ) ];\n return funcOrVal( ret , [idx].concat(pars) );\n });\n return original;\n }\n \n return (\n typeof original === 'function' ? original.apply( this , pars ) :\n original instanceof Array ? funcOrVal( original[ pars[ 0 ] ] , pars ) :\n typeof original === 'object' ? funcOrVal( original[ pars[ 0 ] ] , pars ) :\n '');\n },\n\n /**\n * Translates and pluralizes text.\n * Given a singular string, a plural string and a number, translates either the singular or plural string.\n *\n * @method ntext\n * @return {String}\n *\n * @param {String} strSin Word to use when count is 1\n * @param {String} strPlur Word to use otherwise\n * @param {Number} count Number which defines which word to use\n * @param [args*] Extra arguments, to be passed to `text()`\n *\n * @sample Ink_Util_I18n_1_ntext.html\n */\n ntext: function( strSin , strPlur , count ) {\n var pars = Array.prototype.slice.apply( arguments );\n var original;\n\n if ( pars.length === 2 && typeof strPlur === 'number' ) {\n original = this.getKey( strSin );\n if ( !( original instanceof Array ) ) { return ''; }\n\n pars.splice( 0 , 1 );\n original = original[ strPlur === 1 ? 0 : 1 ];\n } else {\n pars.splice( 0 , 2 );\n original = count === 1 ? strSin : strPlur;\n }\n\n return this.text.apply( this , [ original ].concat( pars ) );\n },\n\n /**\n * Gets the ordinal suffix of a number.\n *\n * This works by using transforms (in the form of Objects or Functions) passed into the function or found in the special key `_ordinals` in the active language dictionary.\n *\n * @method ordinal\n *\n * @param {Number} num Input number\n * @param {Object|Function} [options]={} Dictionaries for translating. Each of these options' fallback is found in the current language's dictionary. The lookup order is the following: `exceptions`, `byLastDigit`, `default`. Each of these may be either an `Object` or a `Function`. If it's a function, it is called (with `number` and `digit` for any function except for byLastDigit, which is called with the `lastDigit` of the number in question), and if the function returns a string, that is used. If it's an object, the property is looked up using `obj[prop]`. If what is found is a string, it is used directly.\n * @param {Object|Function} [options.byLastDigit]={} If the language requires the last digit to be considered, mappings of last digits to ordinal suffixes can be created here.\n * @param {Object|Function} [options.exceptions]={} Map unique, special cases to their ordinal suffixes.\n *\n * @returns {String} Ordinal suffix for `num`.\n *\n * @sample Ink_Util_I18n_1_ordinal.html\n **/\n ordinal: function( num ) {\n if ( num === undefined ) { return ''; }\n\n var lastDig = +num.toString( ).slice( -1 );\n\n var ordDict = this.getKey( '_ordinals' );\n if ( ordDict === undefined ) { return ''; }\n\n if ( typeof ordDict === 'string' ) { return ordDict; }\n\n var ret;\n\n if ( typeof ordDict === 'function' ) {\n ret = ordDict( num , lastDig );\n\n if ( typeof ret === 'string' ) { return ret; }\n }\n\n if ( 'exceptions' in ordDict ) {\n ret = typeof ordDict.exceptions === 'function' ? ordDict.exceptions( num , lastDig ) :\n num in ordDict.exceptions ? funcOrVal( ordDict.exceptions[ num ] , [num , lastDig] ) :\n undefined;\n\n if ( typeof ret === 'string' ) { return ret; }\n }\n\n if ( 'byLastDigit' in ordDict ) {\n ret = typeof ordDict.byLastDigit === 'function' ? ordDict.byLastDigit( lastDig , num ) :\n lastDig in ordDict.byLastDigit ? funcOrVal( ordDict.byLastDigit[ lastDig ] , [lastDig , num] ) :\n undefined;\n\n if ( typeof ret === 'string' ) { return ret; }\n }\n\n if ( 'default' in ordDict ) {\n ret = funcOrVal( ordDict['default'] , [ num , lastDig ] );\n\n if ( typeof ret === 'string' ) { return ret; }\n }\n\n return '';\n },\n\n /**\n * Create an alias.\n *\n * Returns an alias to this I18n instance. It contains the I18n methods documented here, but is also a function. If you call it, it just calls `text()`. This is commonly assigned to \"_\".\n *\n * @method alias\n * @returns {Function} an alias to `text()` on this instance. You can also access the rest of the translation API through this alias.\n *\n * @sample Ink_Util_I18n_1_alias.html\n */\n alias: function( ) {\n var ret = Ink.bind( I18n.prototype.text , this );\n ret.ntext = Ink.bind( I18n.prototype.ntext , this );\n ret.append = Ink.bind( I18n.prototype.append , this );\n ret.ordinal = Ink.bind( I18n.prototype.ordinal , this );\n ret.testMode = Ink.bind( I18n.prototype.testMode , this );\n\n return ret;\n }\n };\n\n /**\n * Resets I18n global state (global dictionaries, and default language for instances)\n *\n * @method reset\n * @static\n *\n **/\n I18n.reset = function( ) {\n I18n.prototype._gDicts = [ ];\n I18n.prototype._gDict = { };\n I18n.prototype._gLang = 'pt_PT';\n };\n I18n.reset( );\n\n /**\n * Adds a dictionary to be used in all I18n instances for the corresponding language.\n *\n * @method appendGlobal\n * @static\n *\n * @param dict {Object} Dictionary to be added\n * @param lang {String} Language fo the dictionary being added\n *\n */\n I18n.appendGlobal = function( dict , lang ) {\n if ( lang ) {\n if ( !( lang in dict ) ) {\n var obj = { };\n\n obj[ lang ] = dict;\n\n dict = obj;\n }\n\n if ( lang !== I18n.prototype._gLang ) { I18n.langGlobal( lang ); }\n }\n\n I18n.prototype._gDicts.push( dict );\n\n Ink.extendObj( I18n.prototype._gDict , dict[ I18n.prototype._gLang ] );\n };\n\n I18n.append = function () {\n // [3.1.0] remove this alias\n Ink.warn('Ink.Util.I18n.append() was renamed to appendGlobal().');\n return I18n.appendGlobal.apply(I18n, [].slice.call(arguments));\n };\n\n /**\n * Gets or sets the current default language of I18n instances.\n *\n * @method langGlobal\n * @param lang the new language for all I18n instances\n *\n * @static\n *\n * @return {String} language code\n */\n I18n.langGlobal = function( lang ) {\n if ( !arguments.length ) { return I18n.prototype._gLang; }\n\n if ( lang && I18n.prototype._gLang !== lang ) {\n I18n.prototype._gLang = lang;\n\n I18n.prototype._gDict = { };\n\n for ( var i = 0, l = I18n.prototype._gDicts.length; i < l; i++ ) {\n Ink.extendObj( I18n.prototype._gDict , I18n.prototype._gDicts[ i ][ lang ] || { } );\n }\n }\n };\n\n I18n.lang = function () {\n // [3.1.0] remove this alias\n Ink.warn('Ink.Util.I18n.lang() was renamed to langGlobal().');\n return I18n.langGlobal.apply(I18n, [].slice.call(arguments));\n };\n \n return I18n;\n});","/**\n * JSON Utilities\n * @module Ink.Util.Json_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Json', '1', [], function() {\n 'use strict';\n\n var function_call = Function.prototype.call;\n var cx = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function twoDigits(n) {\n var r = '' + n;\n if (r.length === 1) {\n return '0' + r;\n } else {\n return r;\n }\n }\n\n var dateToISOString = Date.prototype.toISOString ?\n Ink.bind(function_call, Date.prototype.toISOString) :\n function(date) {\n // Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString\n return date.getUTCFullYear() +\n '-' + twoDigits( date.getUTCMonth() + 1 ) +\n '-' + twoDigits( date.getUTCDate() ) +\n 'T' + twoDigits( date.getUTCHours() ) +\n ':' + twoDigits( date.getUTCMinutes() ) +\n ':' + twoDigits( date.getUTCSeconds() ) +\n '.' + String( (date.getUTCMilliseconds()/1000).toFixed(3) ).slice( 2, 5 ) +\n 'Z';\n };\n\n /**\n * Use this class to convert JSON strings to JavaScript objects\n * `.parse()` and also to do the opposite operation `.stringify()`.\n * Internally, the standard JSON implementation is used if available\n * Otherwise, the functions mimic the standard implementation.\n *\n * Here's how to produce JSON from an existing object:\n * \n * Ink.requireModules(['Ink.Util.Json_1'], function (Json) {\n * var obj = {\n * key1: 'value1',\n * key2: 'value2',\n * keyArray: ['arrayValue1', 'arrayValue2', 'arrayValue3']\n * };\n * Json.stringify(obj); // The above object as a JSON string\n * });\n *\n * And here is how to parse JSON:\n *\n * Ink.requireModules(['Ink.Util.Json_1'], function (Json) {\n * var source = '{\"key\": \"value\", \"array\": [true, null, false]}';\n * Json.parse(source); // The above JSON string as an object\n * });\n *\n * @namespace Ink.Util.Json_1 \n * @static\n * \n */\n var InkJson = {\n _nativeJSON: window.JSON || null,\n\n _convertToUnicode: false,\n\n // Escape characters so as to embed them in JSON strings\n _escape: function (theString) {\n var _m = { '\\b': '\\\\b', '\\t': '\\\\t', '\\n': '\\\\n', '\\f': '\\\\f', '\\r': '\\\\r', '\"': '\\\\\"', '\\\\': '\\\\\\\\' };\n\n if (/[\"\\\\\\x00-\\x1f]/.test(theString)) {\n theString = theString.replace(/([\\x00-\\x1f\\\\\"])/g, function(a, b) {\n var c = _m[b];\n if (c) {\n return c;\n }\n c = b.charCodeAt();\n return '\\\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);\n });\n }\n\n return theString;\n },\n\n // A character conversion map\n _toUnicode: function (theString)\n {\n if(!this._convertToUnicode) {\n return this._escape(theString);\n } else {\n var unicodeString = '';\n var inInt = false;\n var theUnicode = false;\n var i = 0;\n var total = theString.length;\n while(i < total) {\n inInt = theString.charCodeAt(i);\n if( (inInt >= 32 && inInt <= 126) ||\n //(inInt >= 48 && inInt <= 57) ||\n //(inInt >= 65 && inInt <= 90) ||\n //(inInt >= 97 && inInt <= 122) ||\n inInt === 8 ||\n inInt === 9 ||\n inInt === 10 ||\n inInt === 12 ||\n inInt === 13 ||\n inInt === 32 ||\n inInt === 34 ||\n inInt === 47 ||\n inInt === 58 ||\n inInt === 92) {\n\n if(inInt === 34 || inInt === 92 || inInt === 47) {\n theUnicode = '\\\\'+theString.charAt(i);\n } else if(inInt === 8) {\n theUnicode = '\\\\b';\n } else if(inInt === 9) {\n theUnicode = '\\\\t';\n } else if(inInt === 10) {\n theUnicode = '\\\\n';\n } else if(inInt === 12) {\n theUnicode = '\\\\f';\n } else if(inInt === 13) {\n theUnicode = '\\\\r';\n } else {\n theUnicode = theString.charAt(i);\n }\n } else {\n if(this._convertToUnicode) {\n theUnicode = theString.charCodeAt(i).toString(16)+''.toUpperCase();\n while (theUnicode.length < 4) {\n theUnicode = '0' + theUnicode;\n }\n theUnicode = '\\\\u' + theUnicode;\n } else {\n theUnicode = theString.charAt(i);\n }\n }\n unicodeString += theUnicode;\n\n i++;\n }\n\n return unicodeString;\n }\n\n },\n\n _stringifyValue: function(param) {\n if (typeof param === 'string') {\n return '\"' + this._toUnicode(param) + '\"';\n } else if (typeof param === 'number' && (isNaN(param) || !isFinite(param))) { // Unusable numbers go null\n return 'null';\n } else if (typeof param === 'undefined' || param === null) { // And so does undefined\n return 'null';\n } else if (typeof param.toJSON === 'function') {\n var t = param.toJSON();\n if (typeof t === 'string') {\n return '\"' + this._escape(t) + '\"';\n } else {\n return this._escape(t.toString());\n }\n } else if (typeof param === 'number' || typeof param === 'boolean') { // These ones' toString methods return valid JSON.\n return '' + param;\n } else if (typeof param === 'function') {\n return 'null'; // match JSON.stringify\n } else if (param.constructor === Date) {\n return '\"' + this._escape(dateToISOString(param)) + '\"';\n } else if (param.constructor === Array) {\n var arrayString = '';\n for (var i = 0, len = param.length; i < len; i++) {\n if (i > 0) {\n arrayString += ',';\n }\n arrayString += this._stringifyValue(param[i]);\n }\n return '[' + arrayString + ']';\n } else { // Object\n var objectString = '';\n for (var k in param) {\n if ({}.hasOwnProperty.call(param, k)) {\n if (objectString !== '') {\n objectString += ',';\n }\n objectString += '\"' + this._escape(k) + '\": ' + this._stringifyValue(param[k]);\n }\n }\n return '{' + objectString + '}';\n }\n },\n\n /**\n * Serializes a JSON object into a string.\n *\n * @method stringify\n * @param {Object} input Data to be serialized into JSON\n * @param {Boolean} convertToUnicode When `true`, converts string contents to unicode \\uXXXX\n * @return {String} Serialized string\n *\n * @sample Ink_Util_Json_stringify.html \n */\n stringify: function(input, convertToUnicode) {\n this._convertToUnicode = !!convertToUnicode;\n if(!this._convertToUnicode && this._nativeJSON) {\n return this._nativeJSON.stringify(input);\n }\n return this._stringifyValue(input); // And recurse.\n },\n \n /**\n * Parses a JSON text through a function\n * \n * @method parse\n * @param text {String} Input string\n * @param reviver {Function} Function receiving `(key, value)`, and `this`=(containing object), used to walk objects.\n * \n * @return {Object} JSON object\n *\n * @sample Ink_Util_Json_parse.html \n */\n /* From https://github.com/douglascrockford/JSON-js/blob/master/json.js */\n parse: function (text, reviver) {\n /*jshint evil:true*/\n\n// The parse method takes a text and an optional reviver function, and returns\n// a JavaScript value if the text is a valid JSON text.\n\n var j;\n\n function walk(holder, key) {\n\n// The walk method is used to recursively walk the resulting structure so\n// that modifications can be made.\n\n var k, v, value = holder[key];\n if (value && typeof value === 'object') {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = walk(value, k);\n if (v !== undefined) {\n value[k] = v;\n } else {\n delete value[k];\n }\n }\n }\n }\n return reviver.call(holder, key, value);\n }\n\n\n// Parsing happens in four stages. In the first stage, we replace certain\n// Unicode characters with escape sequences. JavaScript handles many characters\n// incorrectly, either silently deleting them, or treating them as line endings.\n\n text = String(text);\n cx.lastIndex = 0;\n if (cx.test(text)) {\n text = text.replace(cx, function (a) {\n return '\\\\u' +\n ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n });\n }\n\n// In the second stage, we run the text against regular expressions that look\n// for non-JSON patterns. We are especially concerned with '()' and 'new'\n// because they can cause invocation, and '=' because it can cause mutation.\n// But just to be safe, we want to reject all unexpected forms.\n\n// We split the second stage into 4 regexp operations in order to work around\n// crippling inefficiencies in IE's and Safari's regexp engines. First we\n// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we\n// replace all simple value tokens with ']' characters. Third, we delete all\n// open brackets that follow a colon or comma or that begin the text. Finally,\n// we look to see that the remaining characters are only whitespace or ']' or\n// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.\n\n if (/^[\\],:{}\\s]*$/\n .test(text.replace(/\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')\n .replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g, ']')\n .replace(/(?:^|:|,)(?:\\s*\\[)+/g, ''))) {\n\n// In the third stage we use the eval function to compile the text into a\n// JavaScript structure. The '{' operator is subject to a syntactic ambiguity\n// in JavaScript: it can begin a block or an object literal. We wrap the text\n// in parens to eliminate the ambiguity.\n\n j = eval('(' + text + ')');\n\n// In the optional fourth stage, we recursively walk the new structure, passing\n// each name/value pair to a reviver function for possible transformation.\n\n return typeof reviver === 'function' ?\n walk({'': j}, '') :\n j;\n }\n\n// If the text is not JSON parseable, then a SyntaxError is thrown.\n\n throw new SyntaxError('JSON.parse');\n }\n };\n\n return InkJson;\n});\n","/**\n * String Utilities\n * @module Ink.Util.String_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.String', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.String_1 \n */\n var InkUtilString = {\n\n /**\n * List of special chars\n * \n * @property _chars\n * @type {Array}\n * @private\n * @readOnly\n * @static\n */\n _chars: ['&','à','á','â','ã','ä','å','æ','ç','è','é',\n 'ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô',\n 'õ','ö','ø','ù','ú','û','ü','ý','þ','ÿ','À',\n 'Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë',\n 'Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö',\n 'Ø','Ù','Ú','Û','Ü','Ý','Þ','€','\\\"','ß','<',\n '>','¢','£','¤','¥','¦','§','¨','©','ª','«',\n '¬','\\xad','®','¯','°','±','²','³','´','µ','¶',\n '·','¸','¹','º','»','¼','½','¾'],\n\n /**\n * List of the special characters' html entities\n * \n * @property _entities\n * @type {Array}\n * @private\n * @readOnly\n * @static\n */\n _entities: ['amp','agrave','aacute','acirc','atilde','auml','aring',\n 'aelig','ccedil','egrave','eacute','ecirc','euml','igrave',\n 'iacute','icirc','iuml','eth','ntilde','ograve','oacute',\n 'ocirc','otilde','ouml','oslash','ugrave','uacute','ucirc',\n 'uuml','yacute','thorn','yuml','Agrave','Aacute','Acirc',\n 'Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute',\n 'Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde',\n 'Ograve','Oacute','Ocirc','Otilde','Ouml','Oslash','Ugrave',\n 'Uacute','Ucirc','Uuml','Yacute','THORN','euro','quot','szlig',\n 'lt','gt','cent','pound','curren','yen','brvbar','sect','uml',\n 'copy','ordf','laquo','not','shy','reg','macr','deg','plusmn',\n 'sup2','sup3','acute','micro','para','middot','cedil','sup1',\n 'ordm','raquo','frac14','frac12','frac34'],\n\n /**\n * List of accented chars\n * \n * @property _accentedChars\n * @type {Array}\n * @private\n * @readOnly\n * @static\n */\n _accentedChars:['à','á','â','ã','ä','å',\n 'è','é','ê','ë',\n 'ì','í','î','ï',\n 'ò','ó','ô','õ','ö',\n 'ù','ú','û','ü',\n 'ç','ñ',\n 'À','Á','Â','Ã','Ä','Å',\n 'È','É','Ê','Ë',\n 'Ì','Í','Î','Ï',\n 'Ò','Ó','Ô','Õ','Ö',\n 'Ù','Ú','Û','Ü',\n 'Ç','Ñ'],\n\n /**\n * List of the accented chars (above), but without the accents\n * \n * @property _accentedRemovedChars\n * @type {Array}\n * @private\n * @readOnly\n * @static\n */\n _accentedRemovedChars:['a','a','a','a','a','a',\n 'e','e','e','e',\n 'i','i','i','i',\n 'o','o','o','o','o',\n 'u','u','u','u',\n 'c','n',\n 'A','A','A','A','A','A',\n 'E','E','E','E',\n 'I','I','I','I',\n 'O','O','O','O','O',\n 'U','U','U','U',\n 'C','N'],\n /**\n * Object that contains the basic HTML unsafe chars, as keys, and their HTML entities as values\n * \n * @property _htmlUnsafeChars\n * @type {Object}\n * @private\n * @readOnly\n * @static\n */\n _htmlUnsafeChars:{'<':'<','>':'>','&':'&','\"':'"',\"'\":'''},\n\n /**\n * Capitalizes a word.\n * If param as more than one word, it converts first letter of all words that have more than 2 letters\n *\n * @method ucFirst\n * @param {String} string String to capitalize.\n * @param {Boolean} [firstWordOnly]=false Flag to capitalize only the first word.\n * @return {String} Camel cased string.\n * @public\n * @static\n * @sample Ink_Util_String_ucFirst.html \n */\n ucFirst: function(string, firstWordOnly) {\n var replacer = firstWordOnly ? /(^|\\s)(\\w)(\\S{2,})/ : /(^|\\s)(\\w)(\\S{2,})/g;\n return string ? String(string).replace(replacer, function(_, $1, $2, $3){\n return $1 + $2.toUpperCase() + $3.toLowerCase();\n }) : string;\n },\n\n /**\n * Trims whitespace from strings\n *\n * @method trim\n * @param {String} string String to be trimmed\n * @return {String} Trimmed string\n * @public\n * @static\n * @sample Ink_Util_String_trim.html \n */\n trim: function(string)\n {\n if (typeof string === 'string') {\n return string.replace(/^\\s+|\\s+$|\\n+$/g, '');\n }\n return string;\n },\n\n /**\n * Strips HTML tags from strings\n *\n * @method stripTags\n * @param {String} string String to strip tags from.\n * @param {String} allowed Comma separated list of allowed tags.\n * @return {String} Stripped string\n * @public\n * @static\n * @sample Ink_Util_String_stripTags.html \n */\n stripTags: function(string, allowed)\n {\n if (allowed && typeof allowed === 'string') {\n var aAllowed = InkUtilString.trim(allowed).split(',');\n var aNewAllowed = [];\n var cleanedTag = false;\n for(var i=0; i < aAllowed.length; i++) {\n if(InkUtilString.trim(aAllowed[i]) !== '') {\n cleanedTag = InkUtilString.trim(aAllowed[i].replace(/(<|\\>)/g, '').replace(/\\s/, ''));\n aNewAllowed.push('(<'+cleanedTag+'\\\\s[^>]+>|<(\\\\s|\\\\/)?(\\\\s|\\\\/)?'+cleanedTag+'>)');\n }\n }\n var strAllowed = aNewAllowed.join('|');\n var reAllowed = new RegExp(strAllowed, \"i\");\n\n var aFoundTags = string.match(new RegExp(\"<[^>]*>\", \"g\"));\n\n for(var j=0; j < aFoundTags.length; j++) {\n if(!aFoundTags[j].match(reAllowed)) {\n string = string.replace((new RegExp(aFoundTags[j], \"gm\")), '');\n }\n }\n return string;\n } else {\n return string.replace(/<[^\\>]+\\>/g, '');\n }\n },\n\n /**\n * Encodes string into HTML entities.\n *\n * @method htmlEntitiesEncode\n * @param {String} string\n * @return {String} string encoded\n * @public\n * @static\n * @sample Ink_Util_String_htmlEntitiesEncode.html \n */\n htmlEntitiesEncode: function(string)\n {\n if (string && string.replace) {\n var re = false;\n for (var i = 0; i < InkUtilString._chars.length; i++) {\n re = new RegExp(InkUtilString._chars[i], \"gm\");\n string = string.replace(re, '&' + InkUtilString._entities[i] + ';');\n }\n }\n return string;\n },\n\n /**\n * Decodes string from HTML entities.\n *\n * @method htmlEntitiesDecode\n * @param {String} string String to be decoded\n * @return {String} Decoded string\n * @public\n * @static\n * @sample Ink_Util_String_htmlEntitiesDecode.html \n */\n htmlEntitiesDecode: function(string)\n {\n if (string && string.replace) {\n var re = false;\n for (var i = 0; i < InkUtilString._entities.length; i++) {\n re = new RegExp(\"&\"+InkUtilString._entities[i]+\";\", \"gm\");\n string = string.replace(re, InkUtilString._chars[i]);\n }\n string = string.replace(/&#[^;]+;?/g, function($0){\n if ($0.charAt(2) === 'x') {\n return String.fromCharCode(parseInt($0.substring(3), 16));\n }\n else {\n return String.fromCharCode(parseInt($0.substring(2), 10));\n }\n });\n }\n return string;\n },\n\n /**\n * Encode a string to UTF-8.\n *\n * @method utf8Encode\n * @param {String} string String to be encoded\n * @return {String} string UTF-8 encoded string\n * @public\n * @static\n */\n utf8Encode: function(string) {\n /*jshint bitwise:false*/\n string = string.replace(/\\r\\n/g,\"\\n\");\n var utfstring = \"\";\n\n for (var n = 0; n < string.length; n++) {\n\n var c = string.charCodeAt(n);\n\n if (c < 128) {\n utfstring += String.fromCharCode(c);\n }\n else if((c > 127) && (c < 2048)) {\n utfstring += String.fromCharCode((c >> 6) | 192);\n utfstring += String.fromCharCode((c & 63) | 128);\n }\n else {\n utfstring += String.fromCharCode((c >> 12) | 224);\n utfstring += String.fromCharCode(((c >> 6) & 63) | 128);\n utfstring += String.fromCharCode((c & 63) | 128);\n }\n\n }\n return utfstring;\n },\n\n /**\n * Truncates a string without breaking words.\n *\n * @method shortString\n * @param {String} str String to truncate\n * @param {Number} n Number of chars of the short string\n * @return {String} \n * @public\n * @static\n * @sample Ink_Util_String_shortString.html \n */\n shortString: function(str,n) {\n var words = str.split(' ');\n var resultstr = '';\n for(var i = 0; i < words.length; i++ ){\n if((resultstr + words[i] + ' ').length>=n){\n resultstr += '…';\n break;\n }\n resultstr += words[i] + ' ';\n }\n return resultstr;\n },\n\n /**\n * Truncates a string, breaking words and adding ... at the end.\n *\n * @method truncateString\n * @param {String} str String to truncate\n * @param {Number} length Limit for the returned string, ellipsis included.\n * @return {String} Truncated String\n * @public\n * @static\n * @sample Ink_Util_String_truncateString.html \n */\n truncateString: function(str, length) {\n if(str.length - 1 > length) {\n return str.substr(0, length - 1) + \"\\u2026\";\n } else {\n return str;\n }\n },\n\n /**\n * Decodes a string from UTF-8.\n *\n * @method utf8Decode\n * @param {String} string String to be decoded\n * @return {String} Decoded string\n * @public\n * @static\n */\n utf8Decode: function(utfstring) {\n /*jshint bitwise:false*/\n var string = \"\";\n var i = 0, c = 0, c2 = 0, c3 = 0;\n\n while ( i < utfstring.length ) {\n\n c = utfstring.charCodeAt(i);\n\n if (c < 128) {\n string += String.fromCharCode(c);\n i++;\n }\n else if((c > 191) && (c < 224)) {\n c2 = utfstring.charCodeAt(i+1);\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n i += 2;\n }\n else {\n c2 = utfstring.charCodeAt(i+1);\n c3 = utfstring.charCodeAt(i+2);\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n i += 3;\n }\n\n }\n return string;\n },\n\n /**\n * Removes all accented characters from a string.\n *\n * @method removeAccentedChars\n * @param {String} string String to remove accents from\n * @return {String} String without accented chars\n * @public\n * @static\n * @sample Ink_Util_String_removeAccentedChars.html \n */\n removeAccentedChars: function(string)\n {\n var newString = string;\n var re = false;\n for (var i = 0; i < InkUtilString._accentedChars.length; i++) {\n re = new RegExp(InkUtilString._accentedChars[i], \"gm\");\n newString = newString.replace(re, '' + InkUtilString._accentedRemovedChars[i] + '');\n }\n return newString;\n },\n\n /**\n * Count the number of occurrences of a specific needle in a haystack\n *\n * @method substrCount\n * @param {String} haystack String to search in\n * @param {String} needle String to search for\n * @return {Number} Number of occurrences\n * @public\n * @static\n * @sample Ink_Util_String_substrCount.html \n */\n substrCount: function(haystack,needle)\n {\n return haystack ? haystack.split(needle).length - 1 : 0;\n },\n\n /**\n * Eval a JSON - We recommend you Ink.Util.Json\n *\n * @method evalJSON\n * @param {String} strJSON JSON string to eval\n * @param {Boolean} sanitize Flag to sanitize input\n * @return {Object} JS Object\n * @public\n * @static\n */\n evalJSON: function(strJSON, sanitize) {\n /* jshint evil:true */\n if( (typeof sanitize === 'undefined' || sanitize === null) || InkUtilString.isJSON(strJSON)) {\n try {\n if(typeof(JSON) !== \"undefined\" && typeof(JSON.parse) !== 'undefined'){\n return JSON.parse(strJSON);\n }\n return eval('('+strJSON+')');\n } catch(e) {\n throw new Error('ERROR: Bad JSON string...');\n }\n }\n },\n\n /**\n * Checks if a string is a valid JSON object (string encoded)\n *\n * @method isJSON \n * @param {String} str String to check\n * @return {Boolean}\n * @public\n * @static\n */\n isJSON: function(str)\n {\n str = str.replace(/\\\\./g, '@').replace(/\"[^\"\\\\\\n\\r]*\"/g, '');\n return (/^[,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]*$/).test(str);\n },\n\n /**\n * Escapes unsafe html chars as HTML entities\n *\n * @method htmlEscapeUnsafe\n * @param {String} str String to escape\n * @return {String} Escaped string\n * @public\n * @static\n * @sample Ink_Util_String_htmlEscapeUnsafe.html \n */\n htmlEscapeUnsafe: function(str){\n var chars = InkUtilString._htmlUnsafeChars;\n return str !== null ? String(str).replace(/[<>&'\"]/g,function(c){return chars[c];}) : str;\n },\n\n /**\n * Normalizes whitespace in string.\n * String is trimmed and sequences of whitespaces are collapsed.\n *\n * @method normalizeWhitespace\n * @param {String} str String to normalize\n * @return {String} Normalized string\n * @public\n * @static\n * @sample Ink_Util_String_normalizeWhitespace.html \n */\n normalizeWhitespace: function(str){\n return str !== null ? InkUtilString.trim(String(str).replace(/\\s+/g,' ')) : str;\n },\n\n /**\n * Converts string to unicode.\n *\n * @method toUnicode\n * @param {String} str String to convert\n * @return {String} Unicoded String\n * @public\n * @static\n * @sample Ink_Util_String_toUnicode.html \n */\n toUnicode: function(str) {\n if (typeof str === 'string') {\n var unicodeString = '';\n var inInt = false;\n var theUnicode = false;\n var total = str.length;\n var i=0;\n\n while(i < total)\n {\n inInt = str.charCodeAt(i);\n if( (inInt >= 32 && inInt <= 126) ||\n inInt === 8 ||\n inInt === 9 ||\n inInt === 10 ||\n inInt === 12 ||\n inInt === 13 ||\n inInt === 32 ||\n inInt === 34 ||\n inInt === 47 ||\n inInt === 58 ||\n inInt === 92) {\n\n /*\n if(inInt == 34 || inInt == 92 || inInt == 47) {\n theUnicode = '\\\\'+str.charAt(i);\n } else {\n }\n */\n if(inInt === 8) {\n theUnicode = '\\\\b';\n } else if(inInt === 9) {\n theUnicode = '\\\\t';\n } else if(inInt === 10) {\n theUnicode = '\\\\n';\n } else if(inInt === 12) {\n theUnicode = '\\\\f';\n } else if(inInt === 13) {\n theUnicode = '\\\\r';\n } else {\n theUnicode = str.charAt(i);\n }\n } else {\n theUnicode = str.charCodeAt(i).toString(16)+''.toUpperCase();\n while (theUnicode.length < 4) {\n theUnicode = '0' + theUnicode;\n }\n theUnicode = '\\\\u' + theUnicode;\n }\n unicodeString += theUnicode;\n\n i++;\n }\n return unicodeString;\n }\n },\n\n /**\n * Escapes a unicode character.\n *\n * @method escape\n * @param {String} c Character to escape\n * @return {String} Escaped character. Returns \\xXX if hex smaller than 0x100, otherwise \\uXXXX\n * @public\n * @static\n * @sample Ink_Util_String_escape.html \n */\n escape: function(c) {\n var hex = (c).charCodeAt(0).toString(16).split('');\n if (hex.length < 3) {\n while (hex.length < 2) { hex.unshift('0'); }\n hex.unshift('x');\n }\n else {\n while (hex.length < 4) { hex.unshift('0'); }\n hex.unshift('u');\n }\n\n hex.unshift('\\\\');\n return hex.join('');\n },\n\n /**\n * Unescapes a unicode character escape sequence\n *\n * @method unescape\n * @param {String} es Escape sequence\n * @return {String} String un-unicoded\n * @public\n * @static\n * @sample Ink_Util_String_unescape.html \n */\n unescape: function(es) {\n var idx = es.lastIndexOf('0');\n idx = idx === -1 ? 2 : Math.min(idx, 2);\n //console.log(idx);\n var hexNum = es.substring(idx);\n //console.log(hexNum);\n var num = parseInt(hexNum, 16);\n return String.fromCharCode(num);\n },\n\n /**\n * Escapes a string to unicode characters\n *\n * @method escapeText\n * @param {String} txt \n * @param {Array} [whiteList] Whitelist of characters\n * @return {String} String escaped to Unicode\n * @public\n * @static\n * @sample Ink_Util_String_escapeText.html \n */\n escapeText: function(txt, whiteList) {\n if (whiteList === undefined) {\n whiteList = ['[', ']', '\\'', ','];\n }\n var txt2 = [];\n var c, C;\n for (var i = 0, f = txt.length; i < f; ++i) {\n c = txt[i];\n C = c.charCodeAt(0);\n if (C < 32 || C > 126 && whiteList.indexOf(c) === -1) {\n c = InkUtilString.escape(c);\n }\n txt2.push(c);\n }\n return txt2.join('');\n },\n\n /**\n * Regex to check escaped strings\n *\n * @property escapedCharRegex\n * @type {Regex}\n * @public\n * @readOnly\n * @static\n */\n escapedCharRegex: /(\\\\x[0-9a-fA-F]{2})|(\\\\u[0-9a-fA-F]{4})/g,\n\n /**\n * Unescapes a string\n *\n * @method unescapeText\n * @param {String} txt\n * @return {String} Unescaped string\n * @public\n * @static\n * @sample Ink_Util_String_unescapeText.html \n */\n unescapeText: function(txt) {\n /*jshint boss:true */\n var m;\n while (m = InkUtilString.escapedCharRegex.exec(txt)) {\n m = m[0];\n txt = txt.replace(m, InkUtilString.unescape(m));\n InkUtilString.escapedCharRegex.lastIndex = 0;\n }\n return txt;\n },\n\n /**\n * Compares two strings.\n *\n * @method strcmp\n * @param {String} str1 First String\n * @param {String} str2 Second String\n * @return {Number}\n * @public\n * @static\n * @sample Ink_Util_String_strcmp.html \n */\n strcmp: function(str1, str2) {\n return ((str1 === str2) ? 0 : ((str1 > str2) ? 1 : -1));\n },\n\n /**\n * Splits a string into smaller chunks\n *\n * @method packetize\n * @param {String} str String to divide\n * @param {Number} maxLen Maximum chunk size (in characters)\n * @return {Array} Chunks of the original string\n * @public\n * @static\n * @sample Ink_Util_String_packetize.html \n */\n packetize: function(str, maxLen) {\n var len = str.length;\n var parts = new Array( Math.ceil(len / maxLen) );\n var chars = str.split('');\n var sz, i = 0;\n while (len) {\n sz = Math.min(maxLen, len);\n parts[i++] = chars.splice(0, sz).join('');\n len -= sz;\n }\n return parts;\n }\n };\n\n return InkUtilString;\n\n});\n","/**\n * URL Utilities\n * @module Ink.Util.Url_1\n * @version 1\n */\n\nInk.createModule('Ink.Util.Url', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.Url_1\n */\n var Url = {\n\n /**\n * Auxiliary string for encoding\n *\n * @property _keyStr\n * @type {String}\n * @readOnly\n * @private\n */\n _keyStr : 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n\n\n /**\n * Gets URL of current page\n *\n * @method getUrl\n * @return Current URL\n * @public\n * @static\n * @sample Ink_Util_Url_getUrl.html \n */\n getUrl: function()\n {\n return window.location.href;\n },\n\n /**\n * Generates an URL string.\n *\n * @method genQueryString\n * @param {String} uri Base URL\n * @param {Object} params Object to transform to query string\n * @return {String} URI with query string set\n * @public\n * @static\n * @sample Ink_Util_Url_genQueryString.html \n */\n genQueryString: function(uri, params) {\n var hasQuestionMark = uri.indexOf('?') !== -1;\n var sep, pKey, pValue, parts = [uri];\n\n for (pKey in params) {\n if (params.hasOwnProperty(pKey)) {\n if (!hasQuestionMark) {\n sep = '?';\n hasQuestionMark = true;\n } else {\n sep = '&';\n }\n pValue = params[pKey];\n if (typeof pValue !== 'number' && !pValue) {\n pValue = '';\n }\n parts = parts.concat([sep, encodeURIComponent(pKey), '=', encodeURIComponent(pValue)]);\n }\n }\n\n return parts.join('');\n },\n\n /**\n * Gets an object from an URL encoded string.\n *\n * @method getQueryString\n * @param {String} [str] URL String. When not specified it uses the current URL.\n * @return {Object} Key-Value pair object\n * @public\n * @static\n * @sample Ink_Util_Url_getQueryString.html \n */\n getQueryString: function(str)\n {\n var url;\n if(str && typeof(str) !== 'undefined') {\n url = str;\n } else {\n url = this.getUrl();\n }\n var aParams = {};\n if(url.match(/\\?(.+)/i)) {\n var queryStr = url.replace(/^(.*)\\?([^\\#]+)(\\#(.*))?/g, \"$2\");\n if(queryStr.length > 0) {\n var aQueryStr = queryStr.split(/[;&]/);\n for(var i=0; i < aQueryStr.length; i++) {\n var pairVar = aQueryStr[i].split('=');\n aParams[decodeURIComponent(pairVar[0])] = (typeof(pairVar[1]) !== 'undefined' && pairVar[1]) ? decodeURIComponent(pairVar[1]) : false;\n }\n }\n }\n return aParams;\n },\n\n /**\n * Gets the URL hash value\n *\n * @method getAnchor\n * @param {String} [str] URL String. Defaults to current page URL.\n * @return {String|Boolean} Hash in the URL. If there's no hash, returns false.\n * @public\n * @static\n * @sample Ink_Util_Url_getAnchor.html \n */\n getAnchor: function(str)\n {\n var url;\n if(str && typeof(str) !== 'undefined') {\n url = str;\n } else {\n url = this.getUrl();\n }\n var anchor = false;\n if(url.match(/#(.+)/)) {\n anchor = url.replace(/([^#]+)#(.*)/, \"$2\");\n }\n return anchor;\n },\n\n /**\n * Gets the anchor string of an URL\n *\n * @method getAnchorString\n * @param {String} [string] URL to parse. Defaults to current URL.\n * @return {Object} Key-value pair object of the URL's hashtag 'variables'\n * @public\n * @static\n * @sample Ink_Util_Url_getAnchorString.html \n */\n getAnchorString: function(string)\n {\n var url;\n if(string && typeof(string) !== 'undefined') {\n url = string;\n } else {\n url = this.getUrl();\n }\n var aParams = {};\n if(url.match(/#(.+)/i)) {\n var anchorStr = url.replace(/^([^#]+)#(.*)?/g, \"$2\");\n if(anchorStr.length > 0) {\n var aAnchorStr = anchorStr.split(/[;&]/);\n for(var i=0; i < aAnchorStr.length; i++) {\n var pairVar = aAnchorStr[i].split('=');\n aParams[decodeURIComponent(pairVar[0])] = (typeof(pairVar[1]) !== 'undefined' && pairVar[1]) ? decodeURIComponent(pairVar[1]) : false;\n }\n }\n }\n return aParams;\n },\n\n\n /**\n * Parses URL string into URL parts\n *\n * @method parseUrl\n * @param {String} url URL to be parsed\n * @return {Object} Parsed URL as a key-value object.\n * @public\n * @static\n * @sample Ink_Util_Url_parseUrl.html \n */\n parseUrl: function(url) {\n var aURL = {};\n if(url && typeof url === 'string') {\n if(url.match(/^([^:]+):\\/\\//i)) {\n var re = /^([^:]+):\\/\\/([^\\/]*)\\/?([^\\?#]*)\\??([^#]*)#?(.*)/i;\n if(url.match(re)) {\n aURL.scheme = url.replace(re, \"$1\");\n aURL.host = url.replace(re, \"$2\");\n aURL.path = '/'+url.replace(re, \"$3\");\n aURL.query = url.replace(re, \"$4\") || false;\n aURL.fragment = url.replace(re, \"$5\") || false;\n }\n } else {\n var re1 = new RegExp(\"^([^\\\\?]+)\\\\?([^#]+)#(.*)\", \"i\");\n var re2 = new RegExp(\"^([^\\\\?]+)\\\\?([^#]+)#?\", \"i\");\n var re3 = new RegExp(\"^([^\\\\?]+)\\\\??\", \"i\");\n if(url.match(re1)) {\n aURL.scheme = false;\n aURL.host = false;\n aURL.path = url.replace(re1, \"$1\");\n aURL.query = url.replace(re1, \"$2\");\n aURL.fragment = url.replace(re1, \"$3\");\n } else if(url.match(re2)) {\n aURL.scheme = false;\n aURL.host = false;\n aURL.path = url.replace(re2, \"$1\");\n aURL.query = url.replace(re2, \"$2\");\n aURL.fragment = false;\n } else if(url.match(re3)) {\n aURL.scheme = false;\n aURL.host = false;\n aURL.path = url.replace(re3, \"$1\");\n aURL.query = false;\n aURL.fragment = false;\n }\n }\n if(aURL.host) {\n var regPort = /^(.*?)\\\\:(\\\\d+)$/i;\n // check for port\n if(aURL.host.match(regPort)) {\n var tmpHost1 = aURL.host;\n aURL.host = tmpHost1.replace(regPort, \"$1\");\n aURL.port = tmpHost1.replace(regPort, \"$2\");\n } else {\n aURL.port = false;\n }\n // check for user and pass\n if(aURL.host.match(/@/i)) {\n var tmpHost2 = aURL.host;\n aURL.host = tmpHost2.split('@')[1];\n var tmpUserPass = tmpHost2.split('@')[0];\n if(tmpUserPass.match(/\\:/)) {\n aURL.user = tmpUserPass.split(':')[0];\n aURL.pass = tmpUserPass.split(':')[1];\n } else {\n aURL.user = tmpUserPass;\n aURL.pass = false;\n }\n }\n }\n }\n return aURL;\n },\n\n /**\n * Formats an URL object into an URL string.\n *\n * @method format\n * @param urlObj Window.location, a.href, or parseUrl object to format\n * @return {String} Full URL.\n */\n format: function (urlObj) {\n var protocol = '';\n var host = '';\n var path = '';\n var frag = '';\n var query = '';\n\n if (typeof urlObj.protocol === 'string') {\n protocol = urlObj.protocol + '//'; // here it comes with the colon\n } else if (typeof urlObj.scheme === 'string') {\n protocol = urlObj.scheme + '://';\n }\n\n host = urlObj.host || urlObj.hostname || '';\n path = urlObj.path || '';\n\n if (typeof urlObj.query === 'string') {\n query = urlObj.query;\n } else if (typeof urlObj.search === 'string') {\n query = urlObj.search.replace(/^\\?/, '');\n }\n if (typeof urlObj.fragment === 'string') {\n frag = urlObj.fragment;\n } else if (typeof urlObj.hash === 'string') {\n frag = urlObj.hash.replace(/#$/, '');\n }\n\n return [\n protocol,\n host,\n path,\n query && '?' + query,\n frag && '#' + frag\n ].join('');\n },\n\n /**\n * Gets the last loaded script element\n *\n * @method currentScriptElement\n * @param {String} [match] String to match against the script src attribute\n * @return {DOMElement|Boolean} Returns the `script` DOM Element or false if unable to find it.\n * @public\n * @static\n * @sample Ink_Util_Url_currentScriptElement.html \n */\n currentScriptElement: function(match)\n {\n var aScripts = document.getElementsByTagName('script');\n if(typeof(match) === 'undefined') {\n if(aScripts.length > 0) {\n return aScripts[(aScripts.length - 1)];\n } else {\n return false;\n }\n } else {\n var curScript = false;\n var re = new RegExp(\"\"+match+\"\", \"i\");\n for(var i=0, total = aScripts.length; i < total; i++) {\n curScript = aScripts[i];\n if(re.test(curScript.src)) {\n return curScript;\n }\n }\n return false;\n }\n },\n\n \n /*\n base64Encode: function(string)\n {\n /**\n * --function {String} ?\n * --Convert a string to BASE 64\n * @param {String} string - string to convert\n * @return base64 encoded string\n *\n * \n if(!SAPO.Utility.String || typeof(SAPO.Utility.String) === 'undefined') {\n throw \"SAPO.Utility.Url.base64Encode depends of SAPO.Utility.String, which has not been referred.\";\n }\n\n var output = \"\";\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n\n var input = SAPO.Utility.String.utf8Encode(string);\n\n while (i < input.length) {\n\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +\n this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);\n }\n return output;\n },\n base64Decode: function(string)\n {\n * --function {String} ?\n * Decode a BASE 64 encoded string\n * --param {String} string base64 encoded string\n * --return string decoded\n if(!SAPO.Utility.String || typeof(SAPO.Utility.String) === 'undefined') {\n throw \"SAPO.Utility.Url.base64Decode depends of SAPO.Utility.String, which has not been referred.\";\n }\n\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n\n var input = string.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n while (i < input.length) {\n\n enc1 = this._keyStr.indexOf(input.charAt(i++));\n enc2 = this._keyStr.indexOf(input.charAt(i++));\n enc3 = this._keyStr.indexOf(input.charAt(i++));\n enc4 = this._keyStr.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output = output + String.fromCharCode(chr1);\n\n if (enc3 !== 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 !== 64) {\n output = output + String.fromCharCode(chr3);\n }\n }\n output = SAPO.Utility.String.utf8Decode(output);\n return output;\n },\n */\n\n\n /**\n * Debug function ?\n *\n * @method _debug\n * @private\n * @static\n */\n _debug: function() {}\n\n };\n\n return Url;\n\n});\n","/**\n * Validation Utilities\n * @module Ink.Util.Validator_1\n * @version 1\n */\n \nInk.createModule('Ink.Util.Validator', '1', [], function() {\n\n 'use strict';\n\n /**\n * @namespace Ink.Util.Validator_1 \n */\n var Validator = {\n\n /**\n * List of country codes avaible for the isPhone method\n *\n * @property _countryCodes\n * @type {Array}\n * @private\n * @static\n * @readOnly\n */\n _countryCodes : [\n 'AO',\n 'CV',\n 'MZ',\n 'PT'\n ],\n\n /**\n * International number for portugal\n *\n * @property _internacionalPT\n * @type {Number}\n * @private\n * @static\n * @readOnly\n *\n */\n _internacionalPT: 351,\n\n /**\n * List of all portuguese number prefixes\n *\n * @property _indicativosPT\n * @type {Object}\n * @private\n * @static\n * @readOnly\n *\n */\n _indicativosPT: {\n 21: 'lisboa',\n 22: 'porto',\n 231: 'mealhada',\n 232: 'viseu',\n 233: 'figueira da foz',\n 234: 'aveiro',\n 235: 'arganil',\n 236: 'pombal',\n 238: 'seia',\n 239: 'coimbra',\n 241: 'abrantes',\n 242: 'ponte de sôr',\n 243: 'santarém',\n 244: 'leiria',\n 245: 'portalegre',\n 249: 'torres novas',\n 251: 'valença',\n 252: 'vila nova de famalicão',\n 253: 'braga',\n 254: 'peso da régua',\n 255: 'penafiel',\n 256: 'são joão da madeira',\n 258: 'viana do castelo',\n 259: 'vila real',\n 261: 'torres vedras',\n 262: 'caldas da raínha',\n 263: 'vila franca de xira',\n 265: 'setúbal',\n 266: 'évora',\n 268: 'estremoz',\n 269: 'santiago do cacém',\n 271: 'guarda',\n 272: 'castelo branco',\n 273: 'bragança',\n 274: 'proença-a-nova',\n 275: 'covilhã',\n 276: 'chaves',\n 277: 'idanha-a-nova',\n 278: 'mirandela',\n 279: 'moncorvo',\n 281: 'tavira',\n 282: 'portimão',\n 283: 'odemira',\n 284: 'beja',\n 285: 'moura',\n 286: 'castro verde',\n 289: 'faro',\n 291: 'funchal, porto santo',\n 292: 'corvo, faial, flores, horta, pico',\n 295: 'angra do heroísmo, graciosa, são jorge, terceira',\n 296: 'ponta delgada, são miguel, santa maria',\n\n 91 : 'rede móvel 91 (Vodafone / Yorn)',\n 93 : 'rede móvel 93 (Optimus)',\n 96 : 'rede móvel 96 (TMN)',\n 92 : 'rede móvel 92 (TODOS)',\n //925 : 'rede móvel 925 (TMN 925)',\n //926 : 'rede móvel 926 (TMN 926)',\n //927 : 'rede móvel 927 (TMN 927)',\n //922 : 'rede móvel 922 (Phone-ix)',\n\n 707: 'número único',\n 760: 'número único',\n 800: 'número grátis',\n 808: 'chamada local',\n 30: 'voip'\n },\n /**\n * International number for Cabo Verde\n *\n * @property _internacionalCV\n * @type {Number}\n * @private\n * @static\n * @readOnly\n */\n _internacionalCV: 238,\n\n /**\n * List of all Cabo Verde number prefixes\n *\n * @property _indicativosCV\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _indicativosCV: {\n 2: 'fixo',\n 91: 'móvel 91',\n 95: 'móvel 95',\n 97: 'móvel 97',\n 98: 'móvel 98',\n 99: 'móvel 99'\n },\n /**\n * International number for Angola\n *\n * @property _internacionalAO\n * @type {Number}\n * @private\n * @static\n * @readOnly\n */\n _internacionalAO: 244,\n\n /**\n * List of all Angola number prefixes\n *\n * @property _indicativosAO\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _indicativosAO: {\n 2: 'fixo',\n 91: 'móvel 91',\n 92: 'móvel 92'\n },\n /**\n * International number for Mozambique\n *\n * @property _internacionalMZ\n * @type {Number}\n * @private\n * @static\n * @readOnly\n */\n _internacionalMZ: 258,\n\n /**\n * List of all Mozambique number prefixes\n *\n * @property _indicativosMZ\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _indicativosMZ: {\n 2: 'fixo',\n 82: 'móvel 82',\n 84: 'móvel 84'\n },\n\n /**\n * International number for Timor\n *\n * @property _internacionalTL\n * @type {Number}\n * @private\n * @static\n * @readOnly\n */\n _internacionalTL: 670,\n\n /**\n * List of all Timor number prefixes\n *\n * @property _indicativosTL\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _indicativosTL: {\n 3: 'fixo',\n 7: 'móvel 7'\n },\n\n /**\n * Regular expression groups for several groups of characters\n *\n * http://en.wikipedia.org/wiki/C0_Controls_and_Basic_Latin\n * http://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane\n * http://en.wikipedia.org/wiki/ISO_8859-1\n *\n * @property _characterGroups\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _characterGroups: {\n numbers: ['0-9'],\n asciiAlpha: ['a-zA-Z'],\n latin1Alpha: ['a-zA-Z', '\\u00C0-\\u00FF'],\n unicodeAlpha: ['a-zA-Z', '\\u00C0-\\u00FF', '\\u0100-\\u1FFF', '\\u2C00-\\uD7FF'],\n /* whitespace characters */\n space: [' '],\n dash: ['-'],\n underscore: ['_'],\n nicknamePunctuation: ['_.-'],\n\n singleLineWhitespace: ['\\t '],\n newline: ['\\n'],\n whitespace: ['\\t\\n\\u000B\\f\\r\\u00A0 '],\n\n asciiPunctuation: ['\\u0021-\\u002F', '\\u003A-\\u0040', '\\u005B-\\u0060', '\\u007B-\\u007E'],\n latin1Punctuation: ['\\u0021-\\u002F', '\\u003A-\\u0040', '\\u005B-\\u0060', '\\u007B-\\u007E', '\\u00A1-\\u00BF', '\\u00D7', '\\u00F7'],\n unicodePunctuation: ['\\u0021-\\u002F', '\\u003A-\\u0040', '\\u005B-\\u0060', '\\u007B-\\u007E', '\\u00A1-\\u00BF', '\\u00D7', '\\u00F7', '\\u2000-\\u206F', '\\u2E00-\\u2E7F', '\\u3000-\\u303F']\n },\n\n /**\n * Creates a regular expression for several character groups.\n *\n * @method createRegExp\n *\n * @param Groups* {Object}\n * Groups to build regular expressions for. Possible keys are:\n *\n * - **numbers**: 0-9\n * - **asciiAlpha**: a-z, A-Z\n * - **latin1Alpha**: asciiAlpha, plus printable characters in latin-1\n * - **unicodeAlpha**: unicode alphanumeric characters.\n * - **space**: ' ', the space character.\n * - **dash**: dash character.\n * - **underscore**: underscore character.\n * - **nicknamePunctuation**: dash, dot, underscore\n * - **singleLineWhitespace**: space and tab (whitespace which only spans one line).\n * - **newline**: newline character ('\\n')\n * - **whitespace**: whitespace characters in the ASCII character set.\n * - **asciiPunctuation**: punctuation characters in the ASCII character set.\n * - **latin1Punctuation**: punctuation characters in latin-1.\n * - **unicodePunctuation**: punctuation characters in unicode.\n *\n */\n createRegExp: function (groups) {\n var re = '^[';\n for (var key in groups) if (groups.hasOwnProperty(key)) {\n if (!(key in Validator._characterGroups)) {\n throw new Error('group ' + key + ' is not a valid character group');\n } else if (groups[key]) {\n re += Validator._characterGroups[key].join('');\n }\n }\n if (re === '^[') {\n // No changes\n return new RegExp('$^'); // match nothing\n }\n return new RegExp(re + ']*?$');\n },\n\n /**\n * Checks if a field has the required groups.\n *\n * @method checkCharacterGroups\n * @param {String} s The validation string\n * @param {Object} [groups]={} What groups are included. See createRegexp\n * @sample Ink_Util_Validator_checkCharacterGroups.html \n */\n checkCharacterGroups: function (s, groups) {\n return Validator.createRegExp(groups).test(s);\n },\n\n /**\n * Checks if a field contains unicode printable characters.\n *\n * @method unicode\n * @param {String} s The validation string\n * @param {Object} [options]={} Optional configuration object. See createRegexp\n */\n unicode: function (s, options) {\n return Validator.checkCharacterGroups(s, Ink.extendObj({\n unicodeAlpha: true}, options));\n },\n\n /**\n * Checks if a field only contains latin-1 alphanumeric characters. \n * Takes options for allowing singleline whitespace, cross-line whitespace and punctuation.\n *\n * @method latin1\n *\n * @param {String} s The validation string\n * @param {Object} [options]={} Optional configuration object. See createRegexp\n * @sample Ink_Util_Validator_latin1.html \n */\n latin1: function (s, options) {\n return Validator.checkCharacterGroups(s, Ink.extendObj({\n latin1Alpha: true}, options));\n },\n\n /**\n * Checks if a field only contains only ASCII alphanumeric characters. \n * Takes options for allowing singleline whitespace, cross-line whitespace and punctuation.\n *\n * @method ascii\n *\n * @param {String} s The validation string\n * @param {Object} [options]={} Optional configuration object. See createRegexp\n * @sample Ink_Util_Validator_ascii.html \n */\n ascii: function (s, options) {\n return Validator.checkCharacterGroups(s, Ink.extendObj({\n asciiAlpha: true}, options));\n },\n\n /**\n * Checks if a number is a valid\n *\n * @method number\n * @param {String} numb The number\n * @param {Object} [options] Further options\n * @param [options.decimalSep]='.' Allow decimal separator.\n * @param [options.thousandSep]=\",\" Strip this character from the number.\n * @param [options.negative]=false Allow negative numbers.\n * @param [options.decimalPlaces]=null Maximum number of decimal places. Use `0` for an integer number.\n * @param [options.max]=null Maximum number\n * @param [options.min]=null Minimum number\n * @param [options.returnNumber]=false When this option is true, return the number itself when the value is valid.\n * @sample Ink_Util_Validator_number.html \n */\n number: function (numb, inOptions) {\n numb = numb + '';\n var options = Ink.extendObj({\n decimalSep: '.',\n thousandSep: '',\n negative: true,\n decimalPlaces: null,\n maxDigits: null,\n max: null,\n min: null,\n returnNumber: false\n }, inOptions || {});\n // smart recursion thing sets up aliases for options.\n if (options.thousandSep) {\n numb = numb.replace(new RegExp('\\\\' + options.thousandSep, 'g'), '');\n options.thousandSep = '';\n return Validator.number(numb, options);\n }\n if (options.negative === false) {\n options.min = 0;\n options.negative = true;\n return Validator.number(numb, options);\n }\n if (options.decimalSep !== '.') {\n numb = numb.replace(new RegExp('\\\\' + options.decimalSep, 'g'), '.');\n }\n\n if (!/^(-)?(\\d+)?(\\.\\d+)?$/.test(numb) || numb === '') {\n return false; // forbidden character found\n }\n \n var split;\n if (options.decimalSep && numb.indexOf(options.decimalSep) !== -1) {\n split = numb.split(options.decimalSep);\n if (options.decimalPlaces !== null &&\n split[1].length > options.decimalPlaces) {\n return false;\n }\n } else {\n split = ['' + numb, ''];\n }\n \n if (options.maxDigits!== null) {\n if (split[0].replace(/-/g, '').length > options.maxDigits) {\n return split;\n }\n }\n \n // Now look at the actual float\n var ret = parseFloat(numb);\n \n if (options.maxExcl !== null && ret >= options.maxExcl ||\n options.minExcl !== null && ret <= options.minExcl) {\n return false;\n }\n if (options.max !== null && ret > options.max ||\n options.min !== null && ret < options.min) {\n return false;\n }\n \n if (options.returnNumber) {\n return ret;\n } else {\n return true;\n }\n },\n\n /**\n * Checks if a year is Leap \"Bissexto\"\n *\n * @method _isLeapYear\n * @param {Number} year Year to be checked\n * @return {Boolean} True if it is a leap year.\n * @private\n * @static\n * @example\n * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){\n * console.log( InkValidator._isLeapYear( 2004 ) ); // Result: true\n * console.log( InkValidator._isLeapYear( 2006 ) ); // Result: false\n * });\n */\n _isLeapYear: function(year){\n\n var yearRegExp = /^\\d{4}$/;\n\n if(yearRegExp.test(year)){\n return ((year%4) ? false: ((year%100) ? true : ((year%400)? false : true)) );\n }\n\n return false;\n },\n\n /**\n * Object with the date formats available for validation\n *\n * @property _dateParsers\n * @type {Object}\n * @private\n * @static\n * @readOnly\n */\n _dateParsers: {\n 'yyyy-mm-dd': {day:5, month:3, year:1, sep: '-', parser: /^(\\d{4})(\\-)(\\d{1,2})(\\-)(\\d{1,2})$/},\n 'yyyy/mm/dd': {day:5, month:3, year:1, sep: '/', parser: /^(\\d{4})(\\/)(\\d{1,2})(\\/)(\\d{1,2})$/},\n 'yy-mm-dd': {day:5, month:3, year:1, sep: '-', parser: /^(\\d{2})(\\-)(\\d{1,2})(\\-)(\\d{1,2})$/},\n 'yy/mm/dd': {day:5, month:3, year:1, sep: '/', parser: /^(\\d{2})(\\/)(\\d{1,2})(\\/)(\\d{1,2})$/},\n 'dd-mm-yyyy': {day:1, month:3, year:5, sep: '-', parser: /^(\\d{1,2})(\\-)(\\d{1,2})(\\-)(\\d{4})$/},\n 'dd/mm/yyyy': {day:1, month:3, year:5, sep: '/', parser: /^(\\d{1,2})(\\/)(\\d{1,2})(\\/)(\\d{4})$/},\n 'dd-mm-yy': {day:1, month:3, year:5, sep: '-', parser: /^(\\d{1,2})(\\-)(\\d{1,2})(\\-)(\\d{2})$/},\n 'dd/mm/yy': {day:1, month:3, year:5, sep: '/', parser: /^(\\d{1,2})(\\/)(\\d{1,2})(\\/)(\\d{2})$/}\n },\n\n /**\n * Gets the number of days in a given month of a given year\n *\n * @method _daysInMonth\n * @param {Number} _m Month (1 to 12)\n * @param {Number} _y Year\n * @return {Number} Returns the number of days in a given month of a given year\n * @private\n * @static\n * @example\n * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){\n * console.log( InkValidator._daysInMonth( 2, 2004 ) ); // Result: 29\n * console.log( InkValidator._daysInMonth( 2, 2006 ) ); // Result: 28\n * });\n */\n _daysInMonth: function(_m,_y){\n var nDays=0;\n\n _m = parseInt(_m, 10);\n _y = parseInt(_y, 10);\n\n if(_m===1 || _m===3 || _m===5 || _m===7 || _m===8 || _m===10 || _m===12) {\n nDays= 31;\n } else if ( _m===4 || _m===6 || _m===9 || _m===11) {\n nDays = 30;\n } else if (_m===2) {\n if((_y%400===0) || (_y%4===0 && _y%100!==0)) {\n nDays = 29;\n } else {\n nDays = 28;\n }\n }\n\n return nDays;\n },\n\n\n\n /**\n * Checks if a date is valid\n *\n * @method _isValidDate\n * @param {Number} year\n * @param {Number} month\n * @param {Number} day\n * @return {Boolean} True if valid\n * @private\n * @static\n * @example\n * Ink.requireModules(['Ink.Util.Validator_1'], function( InkValidator ){\n * console.log( InkValidator._isValidDate( 2004, 2, 29 ) ); // Result: true\n * console.log( InkValidator._isValidDate( 2006, 2, 29 ) ); // Result: false\n * });\n */\n _isValidDate: function(year, month, day){\n\n var yearRegExp = /^\\d{4}$/;\n var validOneOrTwo = /^\\d{1,2}$/;\n if(yearRegExp.test(year) && validOneOrTwo.test(month) && validOneOrTwo.test(day)){\n if(month>=1 && month<=12 && day>=1 && this._daysInMonth(month,year)>=day){\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Checks if an email is valid\n *\n * @method mail\n * @param {String} email\n * @return {Boolean} True if it's valid\n * @public\n * @static\n * @sample Ink_Util_Validator_mail.html \n */\n email: function(email)\n {\n var emailValido = new RegExp(\"^[_a-z0-9-]+((\\\\.|\\\\+)[_a-z0-9-]+)*@([\\\\w]*-?[\\\\w]*\\\\.)+[a-z]{2,4}$\", \"i\");\n if(!emailValido.test(email)) {\n return false;\n } else {\n return true;\n }\n },\n\n /**\n * Deprecated. Alias for email(). Use it instead.\n *\n * @method mail\n * @public\n * @static\n * @private\n */\n mail: function (mail) { return Validator.email(mail); },\n\n /**\n * Checks if an url is valid\n *\n * @method url\n * @param {String} url URL to be checked\n * @param {Boolean} [full] If true, validates a full URL (one that should start with 'http')\n * @return {Boolean} True if valid\n * @public\n * @static\n * @sample Ink_Util_Validator_url.html \n */\n url: function(url, full)\n {\n if(typeof full === \"undefined\" || full === false) {\n var reHTTP = new RegExp(\"(^(http\\\\:\\\\/\\\\/|https\\\\:\\\\/\\\\/)(.+))\", \"i\");\n if(reHTTP.test(url) === false) {\n url = 'http://'+url;\n }\n }\n\n var reUrl = new RegExp(\"^(http:\\\\/\\\\/|https:\\\\/\\\\/)([\\\\w]*(-?[\\\\w]*)*\\\\.)+[a-z]{2,4}\", \"i\");\n if(reUrl.test(url) === false) {\n return false;\n } else {\n return true;\n }\n },\n\n /**\n * Checks if a phone is valid in Portugal\n *\n * @method isPTPhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid Portuguese Phone\n * @public\n * @static\n * @sample Ink_Util_Validator_isPTPhone.html\n */\n isPTPhone: function(phone)\n {\n\n phone = phone.toString();\n var aInd = [];\n for(var i in this._indicativosPT) {\n if(typeof(this._indicativosPT[i]) === 'string') {\n aInd.push(i);\n }\n }\n var strInd = aInd.join('|');\n\n var re351 = /^(00351|\\+351)/;\n if(re351.test(phone)) {\n phone = phone.replace(re351, \"\");\n }\n\n var reSpecialChars = /(\\s|\\-|\\.)+/g;\n phone = phone.replace(reSpecialChars, '');\n //var reInt = new RegExp(\"\\\\d\", \"i\");\n var reInt = /[\\d]{9}/i;\n if(phone.length === 9 && reInt.test(phone)) {\n var reValid = new RegExp(\"^(\"+strInd+\")\");\n if(reValid.test(phone)) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Alias function for isPTPhone\n *\n * @method isPortuguesePhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid Portuguese Phone\n * @public\n * @static\n */\n isPortuguesePhone: function(phone)\n {\n return this.isPTPhone(phone);\n },\n\n /**\n * Checks if a phone is valid in Cabo Verde\n *\n * @method isCVPhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid Cape Verdean Phone\n * @public\n * @static\n * @sample Ink_Util_Validator_isCVPhone.html \n */\n isCVPhone: function(phone)\n {\n phone = phone.toString();\n var aInd = [];\n for(var i in this._indicativosCV) {\n if(typeof(this._indicativosCV[i]) === 'string') {\n aInd.push(i);\n }\n }\n var strInd = aInd.join('|');\n\n var re238 = /^(00238|\\+238)/;\n if(re238.test(phone)) {\n phone = phone.replace(re238, \"\");\n }\n\n var reSpecialChars = /(\\s|\\-|\\.)+/g;\n phone = phone.replace(reSpecialChars, '');\n //var reInt = new RegExp(\"\\\\d\", \"i\");\n var reInt = /[\\d]{7}/i;\n if(phone.length === 7 && reInt.test(phone)) {\n var reValid = new RegExp(\"^(\"+strInd+\")\");\n if(reValid.test(phone)) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Checks if a phone is valid in Angola\n *\n * @method isAOPhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid Angolan Phone\n * @public\n * @static\n * @sample Ink_Util_Validator_isAOPhone.html \n */\n isAOPhone: function(phone)\n {\n\n phone = phone.toString();\n var aInd = [];\n for(var i in this._indicativosAO) {\n if(typeof(this._indicativosAO[i]) === 'string') {\n aInd.push(i);\n }\n }\n var strInd = aInd.join('|');\n\n var re244 = /^(00244|\\+244)/;\n if(re244.test(phone)) {\n phone = phone.replace(re244, \"\");\n }\n\n var reSpecialChars = /(\\s|\\-|\\.)+/g;\n phone = phone.replace(reSpecialChars, '');\n //var reInt = new RegExp(\"\\\\d\", \"i\");\n var reInt = /[\\d]{9}/i;\n if(phone.length === 9 && reInt.test(phone)) {\n var reValid = new RegExp(\"^(\"+strInd+\")\");\n if(reValid.test(phone)) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Checks if a phone is valid in Mozambique\n *\n * @method isMZPhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid Mozambican Phone\n * @public\n * @static\n * @sample Ink_Util_Validator_isMZPhone.html \n */\n isMZPhone: function(phone)\n {\n\n phone = phone.toString();\n var aInd = [];\n for(var i in this._indicativosMZ) {\n if(typeof(this._indicativosMZ[i]) === 'string') {\n aInd.push(i);\n }\n }\n var strInd = aInd.join('|');\n var re258 = /^(00258|\\+258)/;\n if(re258.test(phone)) {\n phone = phone.replace(re258, \"\");\n }\n\n var reSpecialChars = /(\\s|\\-|\\.)+/g;\n phone = phone.replace(reSpecialChars, '');\n //var reInt = new RegExp(\"\\\\d\", \"i\");\n var reInt = /[\\d]{8,9}/i;\n if((phone.length === 9 || phone.length === 8) && reInt.test(phone)) {\n var reValid = new RegExp(\"^(\"+strInd+\")\");\n if(reValid.test(phone)) {\n if(phone.indexOf('2') === 0 && phone.length === 8) {\n return true;\n } else if(phone.indexOf('8') === 0 && phone.length === 9) {\n return true;\n }\n }\n }\n\n return false;\n },\n\n /**\n * Checks if a phone is valid in Timor\n *\n * @method isTLPhone\n * @param {Number} phone Phone number to be checked\n * @return {Boolean} True if it's a valid phone from Timor-Leste\n * @public\n * @static\n * @sample Ink_Util_Validator_isTLPhone.html \n */\n isTLPhone: function(phone)\n {\n\n phone = phone.toString();\n var aInd = [];\n for(var i in this._indicativosTL) {\n if(typeof(this._indicativosTL[i]) === 'string') {\n aInd.push(i);\n }\n }\n var strInd = aInd.join('|');\n var re670 = /^(00670|\\+670)/;\n if(re670.test(phone)) {\n phone = phone.replace(re670, \"\");\n }\n\n\n var reSpecialChars = /(\\s|\\-|\\.)+/g;\n phone = phone.replace(reSpecialChars, '');\n //var reInt = new RegExp(\"\\\\d\", \"i\");\n var reInt = /[\\d]{7}/i;\n if(phone.length === 7 && reInt.test(phone)) {\n var reValid = new RegExp(\"^(\"+strInd+\")\");\n if(reValid.test(phone)) {\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Checks if a number is a phone number.\n * This method validates the number in all country codes available the ones set in the second param\n *\n * @method isPhone\n * @param {String} phone Phone number to validate\n * @param {String|Array} [countryCode] Country code or array of countries to validate\n * @return {Boolean} True if it's a valid phone in any country available\n * @public\n * @static\n * @sample Ink_Util_Validator_isPhone.html\n */\n isPhone: function(){\n var index;\n\n if(arguments.length===0){\n return false;\n }\n\n var phone = arguments[0];\n\n if(arguments.length>1){\n if(arguments[1].constructor === Array){\n var func;\n for(index=0; index= 0 && match[i-1] <= 100){\n valid = true;\n } else {\n return false;\n }\n }\n // check 0 to 255 values\n if(i===1 || i===3 || i===5 && (typeof match[i+1] === \"undefined\" || match[i+1] === \"\")){\n if(typeof match[i] !== \"undefined\" && match[i] >= 0 && match[i] <= 255){\n valid = true;\n } else {\n return false;\n }\n }\n }\n }\n\n // hsl range check\n if((match = hsl.exec(str)) !== null || (match = hsla.exec(str)) !== null){\n i = match.length;\n while(i--){\n // check percentage values\n if(i===3 || i===5){\n if(typeof match[i-1] !== \"undefined\" && typeof match[i] !== \"undefined\" && match[i] !== \"\" &&\n match[i-1] >= 0 && match[i-1] <= 100){\n valid = true;\n } else {\n return false;\n }\n }\n // check 0 to 360 value\n if(i===1){\n if(typeof match[i] !== \"undefined\" && match[i] >= 0 && match[i] <= 360){\n valid = true;\n } else {\n return false;\n }\n }\n }\n }\n\n return valid;\n },\n\n /**\n * Checks if the value is a valid IP. \n *\n * @method isIP\n * @param {String} value Value to be checked\n * @param {String} ipType Type of IP to be validated. The values are: ipv4, ipv6. By default is ipv4.\n * @return {Boolean} True if the value is a valid IP address. False if not.\n * @sample Ink_Util_Validator_isIP.html \n */\n isIP: function( value, ipType ){\n if( typeof value !== 'string' ){\n return false;\n }\n\n ipType = (ipType || 'ipv4').toLowerCase();\n\n switch( ipType ){\n case 'ipv4':\n return (/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/).test(value);\n case 'ipv6':\n return (/^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa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}))|:)))(%.+)?\\s*$/).test(value);\n default:\n return false;\n }\n },\n\n /**\n * Credit Card specifications, to be used in the credit card verification.\n *\n * @property _creditCardSpecs\n * @type {Object}\n * @private\n */\n _creditCardSpecs: {\n 'default': {\n 'length': '13,14,15,16,17,18,19',\n 'prefix': /^.+/,\n 'luhn': true\n },\n\n 'american express': {\n 'length': '15',\n 'prefix': /^3[47]/,\n 'luhn' : true\n },\n\n 'diners club': {\n 'length': '14,16',\n 'prefix': /^36|55|30[0-5]/,\n 'luhn' : true\n },\n\n 'discover': {\n 'length': '16',\n 'prefix': /^6(?:5|011)/,\n 'luhn' : true\n },\n\n 'jcb': {\n 'length': '15,16',\n 'prefix': /^3|1800|2131/,\n 'luhn' : true\n },\n\n 'maestro': {\n 'length': '16,18',\n 'prefix': /^50(?:20|38)|6(?:304|759)/,\n 'luhn' : true\n },\n\n 'mastercard': {\n 'length': '16',\n 'prefix': /^5[1-5]/,\n 'luhn' : true\n },\n\n 'visa': {\n 'length': '13,16',\n 'prefix': /^4/,\n 'luhn' : true\n }\n },\n\n /**\n * Luhn function, to be used when validating credit cards\n *\n */\n _luhn: function (num){\n\n num = parseInt(num,10);\n\n if ( (typeof num !== 'number') && (num % 1 !== 0) ){\n // Luhn can only be used on nums!\n return false;\n }\n\n num = num+'';\n // Check num length\n var length = num.length;\n\n // Checksum of the card num\n var\n i, checksum = 0\n ;\n\n for (i = length - 1; i >= 0; i -= 2)\n {\n // Add up every 2nd digit, starting from the right\n checksum += parseInt(num.substr(i, 1),10);\n }\n\n for (i = length - 2; i >= 0; i -= 2)\n {\n // Add up every 2nd digit doubled, starting from the right\n var dbl = parseInt(num.substr(i, 1) * 2,10);\n\n // Subtract 9 from the dbl where value is greater than 10\n checksum += (dbl >= 10) ? (dbl - 9) : dbl;\n }\n\n // If the checksum is a multiple of 10, the number is valid\n return (checksum % 10 === 0);\n },\n\n /**\n * Checks if a number is of a specific credit card type\n * @method isCreditCard\n * @param {String} num Number to be validates\n * @param {String|Array} creditCardType Credit card type. See _creditCardSpecs for the list of supported values.\n * @return {Boolean}\n * @sample Ink_Util_Validator_isCreditCard.html \n */\n isCreditCard: function(num, creditCardType){\n\n if ( /\\d+/.test(num) === false ){\n return false;\n }\n\n if ( typeof creditCardType === 'undefined' ){\n creditCardType = 'default';\n }\n else if ( creditCardType instanceof Array ){\n var i, ccLength = creditCardType.length;\n for ( i=0; i < ccLength; i++ ){\n // Test each type for validity\n if (this.isCreditCard(num, creditCardType[i]) ){\n return true;\n }\n }\n\n return false;\n }\n\n // Check card type\n creditCardType = creditCardType.toLowerCase();\n\n if ( typeof this._creditCardSpecs[creditCardType] === 'undefined' ){\n return false;\n }\n\n // Check card number length\n var length = num.length+'';\n\n // Validate the card length by the card type\n if ( this._creditCardSpecs[creditCardType]['length'].split(\",\").indexOf(length) === -1 ){\n return false;\n }\n\n // Check card number prefix\n if ( !this._creditCardSpecs[creditCardType]['prefix'].test(num) ){\n return false;\n }\n\n // No Luhn check required\n if (this._creditCardSpecs[creditCardType]['luhn'] === false){\n return true;\n }\n\n return this._luhn(num);\n }\n };\n\n return Validator;\n\n});\n"]} \ No newline at end of file diff --git a/public/js/ink.modal.js b/public/js/ink.modal.js new file mode 100644 index 0000000..18debf8 --- /dev/null +++ b/public/js/ink.modal.js @@ -0,0 +1,537 @@ +/** + * Modal dialog prompts + * @module Ink.UI.Modal_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Modal', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, Event, Css, InkElement, Selector, InkArray ) { + 'use strict'; + + var opacitySupported = (function (div) { + div.style.opacity = 'invalid'; + return div.style.opacity !== 'invalid'; + }(InkElement.create('div', {style: 'opacity: 1'}))); + + /** + * @class Ink.UI.Modal + * @constructor + * @version 1 + * @param {String|DOMElement} selector Element or ID + * @param {Object} [options] Options object, containing: + * @param {String} [options.width] Default/Initial width. Ex: '600px' + * @param {String} [options.height] Default/Initial height. Ex: '400px' + * @param {String} [options.shadeClass] Custom class to be added to the div.ink-shade + * @param {String} [options.modalClass] Custom class to be added to the div.ink-modal + * @param {String} [options.trigger] CSS Selector for target elements that will trigger the Modal. + * @param {Boolean} [options.autoDisplay] Displays the Modal automatically when constructed. + * @param {String} [options.markup] Markup to be placed in the Modal when created + * @param {Function} [options.onShow] Callback function to run when the Modal is opened. + * @param {Function} [options.onDismiss] Callback function to run when the Modal is closed. Return `false` to cancel dismissing the Modal. + * @param {Boolean} [options.closeOnClick] Flag to close the modal when clicking outside of it. + * @param {Boolean} [options.closeOnEscape] Determines if the Modal should close when "Esc" key is pressed. Defaults to true. + * @param {Boolean} [options.responsive] Determines if the Modal should behave responsively (adapt to smaller viewports). + * @param {String} [options.triggerEvent] (advanced) Trigger's event to be listened. Defaults to 'click'. + * + * @sample Ink_UI_Modal_1.html + */ + + function upName(dimension) { + // omg IE + var firstCharacter = dimension.match(/^./)[0]; + return firstCharacter.toUpperCase() + dimension.replace(/^./, ''); + } + function maxName(dimension) { + return 'max' + upName(dimension); + } + + var openModals = []; + + function Modal() { + Common.BaseUIComponent.apply(this, arguments); + } + + Modal._name = 'Modal_1'; + + Modal._optionDefinition = { + /** + * Width, height and markup really optional, as they can be obtained by the element + */ + width: ['String', undefined], + height: ['String', undefined], + + /** + * To add extra classes + */ + shadeClass: ['String', undefined], + modalClass: ['String', undefined], + + /** + * Optional trigger properties + */ + trigger: ['String', undefined], + triggerEvent: ['String', 'click'], + autoDisplay: ['Boolean', true], + + /** + * Remaining options + */ + markup: ['String', undefined], + onShow: ['Function', undefined], + onDismiss: ['Function', undefined], + closeOnClick: ['Boolean', false], + closeOnEscape: ['Boolean', true], + responsive: ['Boolean', true] + }; + + Modal.prototype = { + _init: function () { + this._handlers = { + click: Ink.bindEvent(this._onShadeClick, this), + keyDown: Ink.bindEvent(this._onKeyDown, this), + resize: Ink.bindEvent(this._onResize, this) + }; + + this._wasDismissed = false; + + /** + * Modal Markup + */ + if( this._element ){ + this._markupMode = Css.hasClassName(this._element,'ink-modal'); // Check if the full modal comes from the markup + } else { + this._markupMode = false; + } + + if( !this._markupMode ){ + this._modalShadow = document.createElement('div'); + this._modalShadowStyle = this._modalShadow.style; + + this._modalDiv = document.createElement('div'); + this._modalDivStyle = this._modalDiv.style; + + if( !!this._element ){ + this._options.markup = this._element.innerHTML; + } + + /** + * Not in full markup mode, let's set the classes and css configurations + */ + Css.addClassName( this._modalShadow,'ink-shade' ); + Css.addClassName( this._modalDiv,'ink-modal ink-space' ); + + /** + * Applying the main css styles + */ + // this._modalDivStyle.position = 'absolute'; + this._modalShadow.appendChild( this._modalDiv); + document.body.appendChild( this._modalShadow ); + } else { + this._modalDiv = this._element; + this._modalDivStyle = this._modalDiv.style; + this._modalShadow = this._modalDiv.parentNode; + this._modalShadowStyle = this._modalShadow.style; + + this._contentContainer = Selector.select(".modal-body", this._modalDiv)[0]; + if( !this._contentContainer){ + throw new Error('Ink.UI.Modal: Missing div with class "modal-body"'); + } + + this._options.markup = this._contentContainer.innerHTML; + } + + if( !this._markupMode ){ + this.setContentMarkup(this._options.markup); + } + + if( typeof this._options.shadeClass === 'string' ){ + Css.addClassName(this._modalShadow, this._options.shadeClass); + } + + if( typeof this._options.modalClass === 'string' ){ + Css.addClassName(this._modalDiv, this._options.modalClass); + } + + if( this._options.trigger ) { + var triggerElements = Common.elsOrSelector(this._options.trigger, ''); + Event.observeMulti(triggerElements, this._options.triggerEvent, Ink.bindEvent(this.open, this)); + } else if ( this._options.autoDisplay.toString() === "true" ) { + this.open(); + } + }, + + /** + * Responsible for repositioning the modal + * + * @method _reposition + * @private + */ + _reposition: function(){ + this._modalDivStyle.marginTop = (-InkElement.elementHeight(this._modalDiv)/2) + 'px'; + this._modalDivStyle.marginLeft = (-InkElement.elementWidth(this._modalDiv)/2) + 'px'; + }, + + /** + * Responsible for resizing the modal + * + * @method _onResize + * @param {Boolean|Event} runNow Its executed in the begining to resize/reposition accordingly to the viewport. But usually it's an event object. + * @private + */ + _onResize: function( runNow ){ + if( typeof runNow === 'boolean' ){ + this._timeoutResizeFunction.call(this); + } else if( !this._resizeTimeout && (runNow && typeof runNow === 'object') ){ + this._resizeTimeout = setTimeout(Ink.bind(this._timeoutResizeFunction, this),250); + } + }, + + /** + * Timeout Resize Function + * + * @method _timeoutResizeFunction + * @private + */ + _timeoutResizeFunction: function(){ + /** + * Getting the current viewport size + */ + var isPercentage = { + width: ('' + this._options.width).indexOf('%') !== -1, + height: ('' + this._options.height).indexOf('%') !== -1 + }; + var currentViewport = { + height: InkElement.viewportHeight(), + width: InkElement.viewportWidth() + }; + + InkArray.forEach(['height', 'width'], Ink.bind(function (dimension) { + // Not used for percentage measurements + if (isPercentage[dimension]) { return; } + + if (currentViewport[dimension] > this.originalStatus[dimension]) { + this._modalDivStyle[dimension] = this._modalDivStyle[maxName(dimension)]; + } else { + this._modalDivStyle[dimension] = Math.round(currentViewport[dimension] * 0.9) + 'px'; + } + }, this)); + + this._resizeContainer(); + this._reposition(); + this._resizeTimeout = undefined; + }, + + /** + * Handle clicks on the shade element. + * + * @method _onShadeClick + * @param {Event} ev + * @private + */ + _onShadeClick: function(ev) { + var tgtEl = Event.element(ev); + + if (Css.hasClassName(tgtEl, 'ink-close') || Css.hasClassName(tgtEl, 'ink-dismiss') || + InkElement.findUpwardsBySelector(tgtEl, '.ink-close,.ink-dismiss') || + ( + this._options.closeOnClick && + (!InkElement.descendantOf(this._shadeElement, tgtEl) || (tgtEl === this._shadeElement)) + ) + ) { + var alertsInTheModal = Selector.select('.ink-alert', this._shadeElement), + alertsLength = alertsInTheModal.length; + for( var i = 0; i < alertsLength; i++ ){ + if( InkElement.descendantOf(alertsInTheModal[i], tgtEl) ){ + return; + } + } + + this.dismiss(); + + // Only stop the event if this dismisses this modal + if (this._wasDismissed) { + Event.stop(ev); + } + } + }, + + /** + * Responsible for handling the escape key pressing. + * + * @method _onKeyDown + * @param {Event} ev + * @private + */ + _onKeyDown: function(ev) { + if (ev.keyCode !== 27 || this._wasDismissed) { return; } + if (this._options.closeOnEscape.toString() === 'true' && + openModals[openModals.length - 1] === this) { + this.dismiss(); + if (this._wasDismissed) { + Event.stop(ev); + } + } + }, + + /** + * Responsible for setting the size of the modal (and position) based on the viewport. + * + * @method _resizeContainer + * @private + */ + _resizeContainer: function() { + var containerHeight = InkElement.elementHeight(this._modalDiv); + + this._modalHeader = Selector.select('.modal-header',this._modalDiv)[0]; + if( this._modalHeader ){ + containerHeight -= InkElement.elementHeight(this._modalHeader); + } + + this._modalFooter = Selector.select('.modal-footer',this._modalDiv)[0]; + if( this._modalFooter ){ + containerHeight -= InkElement.elementHeight(this._modalFooter); + } + + this._contentContainer.style.height = containerHeight + 'px'; + if( containerHeight !== InkElement.elementHeight(this._contentContainer) ){ + this._contentContainer.style.height = ~~(containerHeight - (InkElement.elementHeight(this._contentContainer) - containerHeight)) + 'px'; + } + + if( this._markupMode ){ return; } + }, + + /************** + * PUBLIC API * + **************/ + + /** + * Opens this Modal. + * Use this if you created the modal with `autoOpen: false` + * to open the modal when you want to. + * @method open + * @param {Event} [event] (internal) In case its fired by the internal trigger. + */ + open: function(event) { + + if( event ){ Event.stop(event); } + + var elem = (document.compatMode === "CSS1Compat") ? document.documentElement : document.body; + + this._resizeTimeout = null; + + Css.addClassName( this._modalShadow,'ink-shade' ); + this._modalShadowStyle.display = this._modalDivStyle.display = 'block'; + setTimeout(Ink.bind(function() { + Css.addClassName( this._modalShadow, 'visible' ); + Css.addClassName( this._modalDiv, 'visible' ); + }, this), 100); + + /** + * Fallback to the old one + */ + this._contentElement = this._modalDiv; + this._shadeElement = this._modalShadow; + + if( !this._markupMode ){ + /** + * Setting the content of the modal + */ + this.setContentMarkup( this._options.markup ); + } + + /** + * If any size has been user-defined, let's set them as max-width and max-height + */ + + var isPercentage = { + width: ('' + this._options.width).indexOf('%') !== -1, + height: ('' + this._options.height).indexOf('%') !== -1 + }; + + InkArray.forEach(['width', 'height'], Ink.bind(function (dimension) { + if (this._options[dimension] !== undefined) { + this._modalDivStyle[dimension] = this._options[dimension]; + if (!isPercentage[dimension]) { + this._modalDivStyle[maxName(dimension)] = + InkElement['element' + upName(dimension)](this._modalDiv) + 'px'; + } + } else { + this._modalDivStyle[maxName(dimension)] = InkElement['element' + upName(dimension)](this._modalDiv) + 'px'; + } + + if (isPercentage[dimension] && parseInt(elem['client' + maxName(dimension)], 10) <= parseInt(this._modalDivStyle[dimension], 10) ) { + this._modalDivStyle[dimension] = Math.round(parseInt(elem['client' + maxName(dimension)], 10) * 0.9) + 'px'; + } + }, this)); + + this.originalStatus = { + viewportHeight: InkElement.elementHeight(elem), + viewportWidth: InkElement.elementWidth(elem), + height: InkElement.elementHeight(this._modalDiv), + width: InkElement.elementWidth(this._modalDiv) + }; + + /** + * Let's 'resize' it: + */ + if( this._options.responsive.toString() === 'true' ) { + this._onResize(true); + Event.observe( window,'resize',this._handlers.resize ); + } else { + this._resizeContainer(); + this._reposition(); + } + + if (this._options.onShow) { + this._options.onShow(this); + } + + // subscribe events + Event.observe(this._shadeElement, 'click', this._handlers.click); + if (this._options.closeOnEscape.toString() === 'true') { + Event.observe(document, 'keydown', this._handlers.keyDown); + } + + this._wasDismissed = false; + openModals.push(this); + + Css.addClassName(document.documentElement, 'ink-modal-open'); + }, + + /** + * Closes the modal + * + * @method dismiss + * @public + */ + dismiss: function() { + if (this._wasDismissed) { /* Already dismissed. WTF IE. */ return; } + + if (this._options.onDismiss) { + var ret = this._options.onDismiss(this); + if (ret === false) { return; } + } + + this._wasDismissed = true; + + if( this._options.responsive ){ + Event.stopObserving(window, 'resize', this._handlers.resize); + } + + // this._modalShadow.parentNode.removeChild(this._modalShadow); + + if( !this._markupMode ){ + this._modalShadow.parentNode.removeChild(this._modalShadow); + this.destroy(); + } else { + Css.removeClassName( this._modalDiv, 'visible' ); + Css.removeClassName( this._modalShadow, 'visible' ); + + this._waitForFade(this._modalShadow, Ink.bind(function () { + this._modalShadowStyle.display = 'none'; + }, this)); + } + + openModals = InkArray.remove(openModals, InkArray.keyValue(this, openModals), 1); + + if (openModals.length === 0) { // Document level stuff now there are no modals in play. + var htmlEl = document.documentElement; + + // Remove the class from the HTML element. + Css.removeClassName(htmlEl, 'ink-modal-open'); + } + }, + + /** + * Utility function to listen to the onTransmissionEnd event, or wait using setTimeouts + * + * Specific to this._element + */ + _waitForFade: function (elem, callback) { + if (!opacitySupported) { return callback(); } + + var transitionEndEventNames = [ + 'transitionEnd', 'oTransitionEnd', 'webkitTransitionEnd']; + var classicName; + var evName; + for (var i = 0, len = transitionEndEventNames.length; i < len; i++) { + evName = transitionEndEventNames[i]; + classicName = 'on' + evName.toLowerCase(); + if (classicName in elem) { + Event.observeOnce(elem, evName, callback); + return; + } + } + var fadeChecker = function () { + if( +Css.getStyle(elem, 'opacity') > 0 ){ + setTimeout(fadeChecker, 250); + } else { + callback(); + } + }; + setTimeout(fadeChecker, 500); + }, + + /** + * Removes the modal from the DOM + * + * @method destroy + * @public + */ + destroy: function() { + Common.unregisterInstance(this._instanceId); + }, + + /** + * Returns the content DOM element + * + * @method getContentElement + * @return {DOMElement} Modal main cointainer. + * @public + */ + getContentElement: function() { + return this._contentContainer; + }, + + /** + * Replaces the content markup + * + * @method setContentMarkup + * @param {String} contentMarkup + * @public + */ + setContentMarkup: function(contentMarkup) { + if( !this._markupMode ){ + this._modalDiv.innerHTML = [contentMarkup].join(''); + this._contentContainer = Selector.select(".modal-body",this._modalDiv); + if( !this._contentContainer.length ){ + // throw 'Missing div with class "modal-body"'; + var tempHeader = Selector.select(".modal-header",this._modalDiv); + var tempFooter = Selector.select(".modal-footer",this._modalDiv); + + InkArray.each(tempHeader, InkElement.remove); + InkArray.each(tempFooter, InkElement.remove); + + var body = document.createElement('div'); + Css.addClassName(body,'modal-body'); + body.innerHTML = this._modalDiv.innerHTML; + this._modalDiv.innerHTML = ''; + + var toAdd = tempHeader.concat([body]).concat(tempFooter); + InkArray.each(toAdd, Ink.bindMethod(this._modalDiv, 'appendChild')); + + this._contentContainer = Selector.select(".modal-body",this._modalDiv); + } + this._contentContainer = this._contentContainer[0]; + } else { + this._contentContainer.innerHTML = contentMarkup; + } + this._contentElement = this._modalDiv; + this._resizeContainer(); + } + + }; + + Common.createUIComponent(Modal, { elementIsOptional: true }); + + return Modal; + +}); diff --git a/public/js/ink.pagination.js b/public/js/ink.pagination.js new file mode 100644 index 0000000..bc5a93c --- /dev/null +++ b/public/js/ink.pagination.js @@ -0,0 +1,528 @@ +/** + * Pagination elements + * @module Ink.UI.Pagination_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.Pagination', '1', + ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1'], + function(Common, Event, Css, Element, Selector ) { + 'use strict'; + + /** + * Function to create the pagination anchors + * + * @method genAel + * @private + * @param {String} inner HTML to be placed inside the anchor. + * @return {DOMElement} Anchor created + */ + var genAEl = function(inner, index, options) { + var aEl = document.createElement('a'); + aEl.setAttribute('href', '#'); + if (typeof index === 'number') { + aEl.setAttribute('data-index', index); + } + if(options && options.wrapText) { + var spanEl = document.createElement('span'); + aEl.appendChild(spanEl); + spanEl.innerHTML = inner; + } else { + aEl.innerHTML = inner; + } + return aEl; + }; + + /** + * @class Ink.UI.Pagination + * @constructor + * @version 1 + * @param {String|DOMElement} selector Selector or element + * @param {Object} options Options + * @param {Number} [options.size] Number of pages. + * @param {Number} [options.totalItemCount] Total numeber of items to display + * @param {Number} [options.itemsPerPage] Number of items per page. + * @param {Number} [options.maxSize] If passed, only shows at most maxSize items. displays also first|prev page and next page|last buttons + * @param {Number} [options.start] Start page. defaults to 1 + * @param {Boolean} [options.sideButtons=true] Whether to show the first, last, previous, next, previousPage and lastPage buttons. Do not use together with maxSize. + * @param {String} [options.firstLabel] Text for the first page button. Defaults to 'First'. + * @param {String} [options.lastLabel] Text for the last page button. Defaults to 'Last'. + * @param {String} [options.previousLabel] Text for the previous button. Defaults to 'Previous'- + * @param {String} [options.nextLabel] Text for the next button. Defaults to 'Next' + * @param {String} [options.previousPageLabel] Text for the previous page button. Defaults to 'Previous {Items per page}'. + * @param {String} [options.nextPageLabel] Text for the next page button. Defaults to 'Next {Items per page}'. + * @param {Function} [options.onChange] Callback to be called when a page changes. Called with `(thisPaginator, newPageNumber)`. + * @param {String} [options.hashParameter] Parameter to use on setHash. Defaults to 'page'. + * @param {String} [options.parentTag] HTML Tag used as the parent node. + * @param {String} [options.childTag] HTML Tag used as the child nodes. + * @param {String} [options.wrapperClass] CSS Class used in the wrapper element + * @param {String} [options.paginationClass] CSS Class used in the pagination element + * @param {String} [options.activeClass] CSS Class used to mark page as active + * @param {String} [options.disabledClass] CSS Class used to mark page as disabled + * @param {String} [options.hideClass] CSS Class used to hide elements + * @param {String} [options.previousClass] CSS Class used in the previous element + * @param {String} [options.previousPageClass] CSS Class used in the previous page element + * @param {String} [options.nextClass] CSS Class used in the next element + * @param {String} [options.nextPageClass] CSS Class used in the next page element + * @param {Function} [options.numberFormatter] Number formatter function. Receives a 0-indexed number and returns the text for the numbered page button. + * + * @sample Ink_UI_Pagination_1.html + */ + function Pagination() { + Common.BaseUIComponent.apply(this, arguments); + } + + Pagination._name = 'Pagination_1'; + + Pagination._optionDefinition = { + size: ['Integer', null], + totalItemCount: ['Integer', null], + itemsPerPage: ['Integer', null], + maxSize: ['Integer', null], + start: ['Integer', 1], + sideButtons: ['Boolean', 1 /* actually `true` but we want to see if user is using the default or not. */], + // TODO add pagination-type which accepts color strings, "chevron" and "dotted". Basically classes to add to the UL. + firstLabel: ['String', 'First'], + lastLabel: ['String', 'Last'], + previousLabel: ['String', 'Previous'], + nextLabel: ['String', 'Next'], + previousPageLabel: ['String', null], + nextPageLabel: ['String', null], + onChange: ['Function', undefined], + hashParameter: ['String', 'page'], + parentTag: ['String', 'ul'], + childTag: ['String', 'li'], + wrapperClass: ['String', 'ink-navigation'], + paginationClass: ['String', 'pagination'], + activeClass: ['String', 'active'], + disabledClass: ['String', 'disabled'], + hideClass: ['String', 'hide-all'], + previousClass: ['String', 'previous'], + previousPageClass: ['String', 'previousPage'], + nextClass: ['String', 'next'], + nextPageClass: ['String', 'nextPage'], + + numberFormatter: ['Function', function(i) { return i + 1; }] + }; + + Pagination.prototype = { + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function() { + if (!this._options.previousPageLabel) { + this._options.previousPageLabel = this._options.previousLabel + ' ' + this._options.maxSize; + } + + if (!this._options.nextPageLabel) { + this._options.nextPageLabel = this._options.nextLabel + ' ' + this._options.maxSize; + } + + this._handlers = { + click: Ink.bindEvent(this._onClick,this) + }; + + if (Common.isInteger(this._options.totalItemCount) && Common.isInteger(this._options.itemsPerPage)) { + this._size = this._calculateSize(this._options.totalItemCount, this._options.itemsPerPage); + } else if (Common.isInteger(this._options.size)) { + this._size = this._options.size; + } else { + Ink.error('Ink.UI.Pagination: Please supply a size option or totalItemCount and itemsPerPage options.'); + this._size = 0; + } + + this._current = this._options.start - 1; + this._itemLiEls = []; + + // generate and apply DOM + this._generateMarkup(this._element); + + this._updateItems(); + + // subscribe events + this._observe(); + }, + + /** + * Responsible for setting listener in the 'click' event of the Pagination element. + * + * @method _observe + * @private + */ + _observe: function() { + Event.observeDelegated(this._element, 'click', '.' + this._options.paginationClass + ' > ' + this._options.childTag, this._handlers.click); + }, + + /** + * Calculate how many pages are necessary for `count` items, and `itemsPerPage` items per page. + * + * @method _calculateSize + * @param count + * @param itemsPerPage + * @private + **/ + _calculateSize: function (count, itemsPerPage) { + return Math.ceil(count / itemsPerPage); + }, + /** + * Updates the markup everytime there's a change in the Pagination object. + * + * @method _updateItems + * @private + */ + _updateItems: function() { + var liEls = this._itemLiEls; + + var isSimpleToggle = this._size === liEls.length; + + var i, f, liEl; + + if (isSimpleToggle) { + // just toggle active class + for (i = 0, f = this._size; i < f; ++i) { + Css.setClassName(liEls[i], this._options.activeClass, i === this._current); + } + } + else { + // remove old items + for (i = liEls.length - 1; i >= 0; --i) { + this._ulEl.removeChild(liEls[i]); + } + + // add new items + liEls = []; + for (i = 0, f = this._size; i < f; ++i) { + liEl = document.createElement(this._options.childTag); + liEl.appendChild( genAEl( this._options.numberFormatter(i), i) ); + // add "active" class if this is the active element. + Css.setClassName(liEl, this._options.activeClass, i === this._current); + if (this._nextEl) { + this._ulEl.insertBefore(liEl, this._nextEl); + } else { + this._ulEl.appendChild(liEl); + } + + liEls.push(liEl); + } + this._itemLiEls = liEls; + } + + if (this._options.maxSize) { + // toggle visible items + var page = Math.floor( this._current / this._options.maxSize ); + var pi = this._options.maxSize * page; + var pf = pi + this._options.maxSize - 1; + + for (i = 0, f = this._size; i < f; ++i) { + liEl = liEls[i]; + Css.setClassName(liEl, this._options.hideClass, i < pi || i > pf); + } + + this._pageStart = pi; + this._pageEnd = pf; + this._page = page; + + Css.setClassName(this._prevPageEl, this._options.disabledClass, !this.hasPreviousPage()); + Css.setClassName(this._nextPageEl, this._options.disabledClass, !this.hasNextPage()); + + Css.setClassName(this._firstEl, this._options.disabledClass, this.isFirst()); + Css.setClassName(this._lastEl, this._options.disabledClass, this.isLast()); + } + + // update prev and next + if (this._prevEl) { + Css.setClassName(this._prevEl, this._options.disabledClass, !this.hasPrevious()); + } + if (this._nextEl) { + Css.setClassName(this._nextEl, this._options.disabledClass, !this.hasNext()); + } + }, + + /** + * Returns the top element for the gallery DOM representation + * + * @method _generateMarkup + * @param {DOMElement} el + * @private + */ + _generateMarkup: function(el) { + Css.addClassName(el, 'ink-navigation'); + + var ulEl = Ink.s('.' + this._options.paginationClass, el); + var hasUlAlready = false; + + if( !ulEl ){ + ulEl = document.createElement(this._options.parentTag); + Css.addClassName(ulEl, this._options.paginationClass); + } else { + hasUlAlready = true; + } + + var isChevron = Css.hasClassName(ulEl, 'chevron'); + var isDotted = Css.hasClassName(ulEl, 'dotted'); + + // Creates
          • elements for firstPage, nextPage, first, last, etc. + var createLiEl = Ink.bind(function (name, options) { + var liEl = document.createElement(this._options.childTag); + var aEl = genAEl(this._options[name + 'Label'], undefined, { wrapText: options && options.wrapText }); + Css.addClassName(liEl, this._options[name + 'Class']); + liEl.appendChild(aEl); + ulEl.appendChild(liEl); + return liEl; + }, this); + + if (!isDotted && this._options.maxSize) { + this._firstEl = createLiEl('first'); + this._prevPageEl = createLiEl('previousPage'); + } + + // When we're dotted, the default for sideButtons is `false`. When we're note, it's `true`. + // Since the default is actually "1", we do a === true check when we're dotted, and a truthish check when we're not. + if ((isDotted && this._options.sideButtons === true) || (!isDotted && this._options.sideButtons)) { + this._prevEl = createLiEl('previous', { wrapText: isChevron }); + this._nextEl = createLiEl('next', { wrapText: isChevron }); + } + + if (!isDotted && this._options.maxSize) { + this._nextPageEl = createLiEl('nextPage'); + this._lastEl = createLiEl('last'); + } + + if( !hasUlAlready ){ + el.appendChild(ulEl); + } + + this._ulEl = ulEl; + }, + + /** + * Click handler + * + * @method _onClick + * @param {Event} ev + * @private + */ + _onClick: function(ev) { + Event.stop(ev); + + var liEl = Event.element(ev); + if ( Css.hasClassName(liEl, this._options.activeClass) || + Css.hasClassName(liEl, this._options.disabledClass) ) { return; } + + var isPrev = Css.hasClassName(liEl, this._options.previousClass); + var isNext = Css.hasClassName(liEl, this._options.nextClass); + var isPrevPage = Css.hasClassName(liEl, this._options.previousPageClass); + var isNextPage = Css.hasClassName(liEl, this._options.nextPageClass); + var isFirst = Css.hasClassName(liEl, this._options.firstClass); + var isLast = Css.hasClassName(liEl, this._options.lastClass); + + if (isFirst) { + this.setCurrent(0); + } + else if (isLast) { + this.setCurrent(this._size - 1); + } + else if (isPrevPage || isNextPage) { + this.setCurrent( (isPrevPage ? -1 : 1) * this._options.maxSize, true /* relative */); + } + else if (isPrev || isNext) { + this.setCurrent(isPrev ? -1 : 1, true /* relative */); + } + else { + var aElem = Selector.select('[data-index]', liEl)[0]; + var nr = aElem && parseInt( aElem.getAttribute('data-index'), 10); + this.setCurrent(nr); + } + }, + + + /** + * Allows you to subscribe to the onChange event + * + * @method setOnChange + * @param cb {Function} Callback called with `(thisPaginator, newPageNumber)`. + */ + setOnChange: function (onChange) { + if (onChange !== undefined && typeof onChange !== 'function') { + throw new TypeError('onChange option must be a function!'); + } + this._options.onChange = onChange; + }, + + /************** + * PUBLIC API * + **************/ + + /** + * Sets the number of pages + * + * @method setSize + * @param {Number} sz number of pages + * @public + */ + setSize: function(sz) { + if (!Common.isInteger(sz)) { + throw new TypeError('1st argument must be an integer number!'); + } + + this._size = sz; + this._updateItems(); + this._current = 0; + }, + + /** + * Sets the number of pages, then call setSize(). + * + * @param setSizeInItems + * @param {Number} totalItems Total number of items + * @param {Number} itemsPerPage Items per page + */ + setSizeInItems: function (totalItems, itemsPerPage) { + var pageNumber = Math.ceil(totalItems / itemsPerPage); + this.setSize(pageNumber); + }, + + /** + * Sets the current page. + * + * @method setCurrent + * @param {Number} nr Sets the current page to given number. + * @param {Boolean} isRelative Flag to change the position from absolute to relative. + * @public + */ + setCurrent: function(nr, isRelative) { + if (!Common.isInteger(nr)) { + throw new TypeError('1st argument must be an integer number!'); + } + + if (isRelative) { + nr += this._current; + } + + if (nr > this._size - 1) { + nr = this._size - 1; + } + + if (nr < 0) { + nr = 0; + } + + this._current = nr; + this._updateItems(); + + if (this._options.onChange) { + this._options.onChange(this, nr); + } + + /*if (this._options.setHash) { + var o = {}; + o[this._options.hashParameter] = nr; + Common.setHash(o); + }*/ // undocumented option, removing + }, + + /** + * Gets the number of pages + * + * @method getSize + * @return {Number} Number of pages + * @public + */ + getSize: function() { + return this._size; + }, + + /** + * Gets the current page index + * + * @method getCurrent + * @return {Number} Current page + * @public + */ + getCurrent: function() { + return this._current; + }, + + /** + * Checks if it's at the first page + * + * @method isFirst + * @return {Boolean} True if at first page + * @public + */ + isFirst: function() { + return this._current === 0; + }, + + /** + * Checks if it's on the last page + * + * @method isLast + * @return {Boolean} True if at last page + * @public + */ + isLast: function() { + return this._current === this._size - 1; + }, + + /** + * Checks if it has previous pages + * + * @method hasPrevious + * @return {Boolean} True if has prior pages + * @public + */ + hasPrevious: function() { + return this._current > 0; + }, + + /** + * Checks if it has next pages + * + * @method hasNext + * @return {Boolean} True if has pages ahead + * @public + */ + hasNext: function() { + return this._current < this._size - 1; + }, + + /** + * Checks if it has a previous set of pages + * + * @method hasPreviousPage + * @return {Boolean} Returns true iif has prior set of page(s) + * @public + */ + hasPreviousPage: function() { + return this._options.maxSize && this._current > this._options.maxSize - 1; + }, + + /** + * Checks if it has a next set of pages + * + * @method hasNextPage + * @return {Boolean} Returns true iif has set of page(s) ahead + * @public + */ + hasNextPage: function() { + return this._options.maxSize && this._size - this._current >= this._options.maxSize + 1; + }, + + /** + * Unregisters the component and removes its markup + * + * @method destroy + * @public + */ + destroy: Common.destroyComponent + }; + + Common.createUIComponent(Pagination); + + return Pagination; + +}); \ No newline at end of file diff --git a/public/js/ink.progressbar.js b/public/js/ink.progressbar.js new file mode 100644 index 0000000..5218b4c --- /dev/null +++ b/public/js/ink.progressbar.js @@ -0,0 +1,81 @@ +/** + * Animated progress bars + * @module Ink.UI.ProgressBar_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.ProgressBar', '1', ['Ink.UI.Common_1', 'Ink.Dom.Selector_1'], function( Common, Selector ) { + 'use strict'; + + /** + * Associated to a .ink-progress-bar element, it provides a setValue() method to change the element's value. + * + * @class Ink.UI.ProgressBar + * @constructor + * @version 1 + * @param {String|DOMElement} selector Element or selector + * @param {Object} [options] Options object + * @param {Number} [options.startValue] Percentage of the bar that is filled. Ranges between 0 and 100. Default: 0 + * @param {Function} [options.onStart] Callback called when a change of value is started + * @param {Function} [options.onEnd] Callback called when a change of value ends + * + * @sample Ink_UI_ProgressBar_1.html + */ + function ProgressBar(){ + Common.BaseUIComponent.apply(this, arguments); + } + + ProgressBar._name = 'ProgressBar_1'; + + ProgressBar._optionDefinition = { + startValue: ['Number', 0], + onStart: ['Function', function () {}], + onEnd: ['Function', function () {}] + }; + + ProgressBar.prototype = { + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function(){ + this._value = this._options.startValue; + this._elementBar = Selector.select('.bar',this._element); + if( this._elementBar.length < 1 ){ + throw new Error('[Ink.UI.ProgressBar] :: Bar element not found'); + } + this._elementBar = this._elementBar[0]; + + this.setValue( this._options.startValue ); + }, + + /** + * Sets the value of the Progressbar + * + * @method setValue + * @param {Number} newValue Numeric value, between 0 and 100, that represents the percentage of the bar. + * @public + */ + setValue: function( newValue ){ + this._options.onStart.call(this, this._value); + + newValue = parseInt(newValue,10); + if( isNaN(newValue) || (newValue < 0) ){ + newValue = 0; + } else if( newValue>100 ){ + newValue = 100; + } + this._value = newValue; + this._elementBar.style.width = this._value + '%'; + + this._options.onEnd.call(this, this._value); + } + }; + + Common.createUIComponent(ProgressBar); + + return ProgressBar; + +}); diff --git a/public/js/ink.smoothscroller.js b/public/js/ink.smoothscroller.js new file mode 100644 index 0000000..19d001f --- /dev/null +++ b/public/js/ink.smoothscroller.js @@ -0,0 +1,199 @@ +/** + * Scroll to content + * @module Ink.UI.SmoothScroller_1 + * @version 1 + */ +Ink.createModule('Ink.UI.SmoothScroller', '1', ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Element_1', 'Ink.Dom.Selector_1','Ink.Dom.Css_1'], function(Common, Event, InkElement, Selector, Css) { + 'use strict'; + + var requestAnimationFrame = + window.requestAnimationFrame || + function (cb) { return setTimeout(cb, 10); }; + + var cancelAnimationFrame = + window.cancelAnimationFrame || + function (id) { clearTimeout(id); }; + + /** + * @namespace SmoothScroller + * @version 1 + * @static + * + * SmoothScroller is a component which replaces the default scroll-to behaviour of `` tags which refer to IDs on the page. + * + * For example, when you have this: + * + * Todo + * [...] + *
            + * [...] + * + * You can click the `` and the page will scroll until the section you pointed to. + * + * When you use SmoothScroller, instead of immediately scrolling to the element, you get a smooth motion. + * + * Also, you can define the data-margin option if you have a `position:fixed` top menu ruining the behaviour. + * + * @example + * + */ + var SmoothScroller = { + + /** + * The default scrolling speed. Higher is slower. Defaults to 10. + * + * @property speed + * @type {Number} + * @default 10 + * @static + */ + speed: 10, + + /** + * Change the URL hash (location.hash) when done scrolling? Defaults to true. + * + * @property changeHash + * @default true + * @type {Boolean} + * @static + */ + changeHash: true, + + /** + * The default top margin. + * Use this when you want the scroll motion to stop before it reaches its destination, for example when you want to add some breathing space or have a position:fixed top bar in front of your content. + * + * @property margin + * @default 0 + * @type {Number} + * @static + */ + margin: 0, + + + /** + * Moves the scrollbar to the target element. This is the function + * which animates the scroll position bit by bit. It calls itself in + * the end through requestAnimationFrame + * + * @method scroll + * @param {Number} d Y coordinate value to stop + * @private + * @static + */ + scroll: function(d, options) { + var a = Math.round(InkElement.scrollHeight()); + + var endPos = Math.round(d - options.margin); + + if (endPos > a) { + a += Math.ceil((endPos - a) / options.speed); + } else { + a = a + (endPos - a) / options.speed; + } + + cancelAnimationFrame(SmoothScroller.interval); + + if (!((a) === endPos || SmoothScroller.offsetTop === a)) { + SmoothScroller.interval = requestAnimationFrame( + Ink.bindMethod(SmoothScroller, 'scroll', d, options), document.body); + } else { + SmoothScroller.onDone(options); + } + + window.scrollTo(0, a); + SmoothScroller.offsetTop = a; + }, + + + /** + * Has smooth scrolling applied to relevant elements upon page load. + * Listens to the click event on the document. + * Anything which matches the selector will be considered a "link" by SmoothScroller and handled as such. + * + * When a link is clicked, it is checked for several options: + * - `data-margin="0"` - A margin in pixels -- useful when you have a position:fixed top bar. + * - `data-speed="10"` - Inverse speed of the scrolling motion. Smaller is faster. + * - `data-change-hash="true"` - Change the URL hash (location.hash) when done scrolling. + * + * @method init + * @param [selector='a.scrollableLink,a.ink-smooth-scroll'] {String} Selector string for finding links with smooth scrolling enabled. + * @static + * @sample Ink_UI_SmoothScroller_1.html + */ + init: function(selector) { + Event.on(document, 'click', selector || 'a.scrollableLink, a.ink-smooth-scroll', SmoothScroller.onClick); + }, + + // Deprecated. Kept around just in case someone is still calling this. + render: function() {}, + + /** + * Handles clicks on link elements + * + * @method onClick + * @private + * @static + */ + onClick: function(event) { + var link = event.currentTarget; + + var thisDocument = (location + '').replace(/#.*?$/, ''); + var linkedDocument = (link.href + '').replace(/#.*?$/, ''); + + if (linkedDocument !== thisDocument) { + return; // It's an external link. + } + + var hash = link.getAttribute('data-hash') || (link.getAttribute('href') || '') + .replace(/^.*?#/, ''); + + if(hash) { + event.preventDefault(); + var activeLiSelector = 'ul > li.active > ' + selector; + + var selector = 'a[name="' + hash + '"],#' + hash; + var elm = Ink.s(selector); + var activeLi = Ink.s(activeLiSelector); + activeLi = activeLi && activeLi.parentNode; + + if (elm) { + if (!Css.hasClassName(link.parentNode, 'active')) { + if (activeLi) { + Css.removeClassName(activeLi, 'active'); + } + Css.addClassName(link.parentNode, 'active'); + } + + var options = Common.options('SmoothScroller link options', { + margin: ['Number', SmoothScroller.margin], + speed: ['Number', SmoothScroller.speed], + changeHash: ['Boolean', SmoothScroller.changeHash] + }, {}, link); + + SmoothScroller.hash = hash; + + SmoothScroller.scroll(InkElement.offsetTop(elm), options); + } + } + }, + + /** + * Called when the scroll movement is done. Updates browser address. + * + * @method onDone + * @param {Object} options Options object from the element. + * @private + */ + onDone: function (options) { + if (options.changeHash === true) { + window.location.hash = SmoothScroller.hash; + } + + SmoothScroller.hash = SmoothScroller.offsetTop = null; + } + }; + + return SmoothScroller; + +}); diff --git a/public/js/ink.sortablelist.js b/public/js/ink.sortablelist.js new file mode 100644 index 0000000..a54bb8b --- /dev/null +++ b/public/js/ink.sortablelist.js @@ -0,0 +1,261 @@ +/** + * Sortable lists + * @module Ink.UI.SortableList_1 + * @version 1 + */ + +Ink.createModule('Ink.UI.SortableList', '1', ['Ink.UI.Common_1','Ink.Dom.Css_1','Ink.Dom.Event_1','Ink.Dom.Element_1','Ink.Dom.Selector_1'], function( Common, Css, Events, Element, Selector ) { + 'use strict'; + var hasTouch = (('ontouchstart' in window) || // html5 browsers + (navigator.maxTouchPoints > 0) || // future IE + (navigator.msMaxTouchPoints > 0)); + + /** + * Adds sortable behaviour to any list. + * + * @class Ink.UI.SortableList + * @constructor + * @version 1 + * @param {String|DOMElement} selector + * @param {String} [options.placeholderClass] CSS class added to the "ghost" element being dragged around. Defaults to 'placeholder'. + * @param {String} [options.draggedClass] CSS class added to the original element being dragged around. Defaults to 'hide-all'. + * @param {String} [options.draggingClass] CSS class added to the html element when the user is dragging. Defaults to 'dragging'. + * @param {String} [options.dragSelector] CSS selector for the drag enabled nodes. Defaults to 'li'. + * @param {String} [options.handleSelector] CSS selector for the drag handle. If present, you can only drag nodes by this selector. + * @param {String} [options.moveSelector] CSS selector to validate a node move. If present, you can only move nodes inside this selector. + * @param {Boolean} [options.swap] Flag to swap dragged element and target element instead of reordering it. + * @param {Boolean} [options.cancelMouseOut] Flag to cancel draggin if mouse leaves the container element. + * @param {Function} [options.onDrop] Callback to be executed after dropping an element. Receives { droppedElement: DOMElement } as an argument. + * + * @sample Ink_UI_SortableList_1.html + */ + function SortableList() { + Common.BaseUIComponent.apply(this, arguments); + } + + SortableList._name = 'SortableList_1'; + + SortableList._optionDefinition = { + 'placeholderClass': ['String', 'placeholder'], + 'draggedClass': ['String', 'hide-all'], + 'draggingClass': ['String', 'dragging'], + 'dragSelector': ['String', 'li'], + 'dragObject': ['String', null], // Deprecated. Use handleSelector instead. + 'handleSelector': ['String', null], + 'moveSelector': ['String', false], + 'swap': ['Boolean', false], + 'cancelMouseOut': ['Boolean', false], + 'onDrop': ['Function', function(){}] + }; + + SortableList.prototype = { + /** + * Init function called by the constructor. + * + * @method _init + * @private + */ + _init: function() { + if (this._options.dragObject != null) { + // [3.0.0] Remove this deprecation notice and stop providing backwards compatibility + Ink.warn('Ink.UI.SortableList: options.dragObject is now deprecated. ' + + 'Please use options.handleSelector instead.'); + this._options.handleSelector = + this._options.handleSelector || this._options.dragObject; + } + + this._handlers = { + down: Ink.bind(this._onDown, this), + move: Ink.bind(this._onMove, this), + up: Ink.bind(this._onUp, this) + }; + + this._isMoving = false; + + this._down = hasTouch ? 'touchstart mousedown' : 'mousedown'; + this._move = hasTouch ? 'touchmove mousemove' : 'mousemove'; + this._up = hasTouch ? 'touchend mouseup' : 'mouseup'; + + this._observe(); + }, + + /** + * Sets the event handlers. + * + * @method _observe + * @private + */ + _observe: function() { + Events.on(this._element, this._down, this._options.dragSelector, this._handlers.down); + Events.on(this._element, this._move, this._options.dragSelector, this._handlers.move); + if(this._options.cancelMouseOut) { + Events.on(this._element, 'mouseleave', Ink.bind(this.stopMoving, this)); + } + Events.on(document.documentElement, this._up, this._handlers.up); + }, + + /** + * Mousedown or touchstart handler + * + * @method _onDown + * @param {Event} ev + * @private + */ + _onDown: function(ev) { + if (this._isMoving || this._placeholder) { return; } + if(this._options.handleSelector && !Selector.matchesSelector(ev.target, this._options.handleSelector)) { return; } + var tgtEl = ev.currentTarget; + this._isMoving = tgtEl; + this._placeholder = tgtEl.cloneNode(true); + this._movePlaceholder(tgtEl); + this._addMovingClasses(); + return false; + }, + + /** + * Mousemove or touchmove handler + * + * @method _onMove + * @param {Event} ev + * @private + */ + _onMove: function(ev) { + var target = ev.currentTarget; + + // Touch events give you the element where the finger touched first, + // not the element under it like mouse events. + if (ev.type === 'touchmove') { + var touch = ev.touches[0]; + target = document.elementFromPoint(touch.clientX, touch.clientY); + target = Element.findUpwardsBySelector(target, this._options.dragSelector); + } + + this.validateMove(target); + ev.preventDefault(); + }, + + /** + * Mouseup or touchend handler + * + * @method _onUp + * @param {Event} ev + * @private + */ + _onUp: function(ev) { + if (!this._isMoving || !this._placeholder) { return; } + if (ev.currentTarget === this._isMoving) { return; } + if (ev.currentTarget === this._placeholder) { return; } + Element.insertBefore(this._isMoving, this._placeholder); + this.stopMoving(); + this._options.onDrop.call(this, { droppedElement: ev.currentTarget }); + return false; + }, + + /** + * Adds the CSS classes to interactive elements + * + * @method _addMovingClasses + * @private + */ + _addMovingClasses: function(){ + Css.addClassName(this._placeholder, this._options.placeholderClass); + Css.addClassName(this._isMoving, this._options.draggedClass); + Css.addClassName(document.documentElement, this._options.draggingClass); + }, + + /** + * Removes the CSS classes from interactive elements + * + * @method _removeMovingClasses + * @private + */ + _removeMovingClasses: function(){ + if(this._isMoving) { Css.removeClassName(this._isMoving, this._options.draggedClass); } + if(this._placeholder) { Css.removeClassName(this._placeholder, this._options.placeholderClass); } + Css.removeClassName(document.documentElement, this._options.draggingClass); + }, + + /** + * Moves the placeholder element relative to the target element + * + * @method _movePlaceholder + * @param {Element} target_position + * @private + */ + _movePlaceholder: function(target){ + var placeholder = this._placeholder, + target_position, + placeholder_position, + from_top, + from_left; + if(!placeholder) { + Element.insertAfter(placeholder, target); + } else if(this._options.swap){ + Element.insertAfter(placeholder, target); + Element.insertBefore(target, this._isMoving); + Element.insertBefore(this._isMoving, placeholder); + } else { + target_position = Element.offset(target); + placeholder_position = Element.offset(this._placeholder); + from_top = target_position[1] > placeholder_position[1]; + from_left = target_position[0] > placeholder_position[0]; + if( ( from_top && from_left ) || ( !from_top && !from_left ) ) { + Element.insertBefore(placeholder, target); + } else { + Element.insertAfter(placeholder, target); + } + Element.insertBefore(this._isMoving, placeholder); + } + }, + + /************** + * PUBLIC API * + **************/ + + /** + * Unregisters the component and removes its markup + * + * @method destroy + * @public + */ + destroy: Common.destroyComponent, + + /** + * Visually stops moving. + * Removes the placeholder as well as the styling classes. + * + * @method _movePlaceholder + * @public + */ + stopMoving: function(){ + this._removeMovingClasses(); + Element.remove(this._placeholder); + this._placeholder = false; + this._isMoving = false; + }, + + /** + * Validate a move. + * This method is used by the move handler + * + * @method _movePlaceholder + * @param {Element} elem + * @public + */ + validateMove: function(elem){ + if (!elem || !this._isMoving || !this._placeholder) { return; } + if (elem === this._placeholder) { return; } + if (elem === this._isMoving) { return; } + if(!this._options.moveSelector || Selector.matchesSelector(elem, this._options.moveSelector)){ + this._movePlaceholder(elem); + } else { + this.stopMoving(); + } + } + + }; + + Common.createUIComponent(SortableList); + + return SortableList; +}); \ No newline at end of file diff --git a/public/js/ink.spy.js b/public/js/ink.spy.js new file mode 100644 index 0000000..0bc4707 --- /dev/null +++ b/public/js/ink.spy.js @@ -0,0 +1,151 @@ +/** + * Highlight elements as you scroll + * @module Ink.UI.Spy_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Spy', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1'], function(Common, Event, Css, Element, Selector ) { + 'use strict'; + + // Maps a spy target (EG a menu with links inside) to spied instances. + var spyTargets = [ + // [target, [spied, spied, spied...]], ... + ]; + + function targetIndex(target) { + for (var i = 0, len = spyTargets.length; i < len; i++) { + if (spyTargets[i][0] === target) { + return i; + } + } + return null; + } + + function addSpied(spied, target) { + var index = targetIndex(target); + + if (index === null) { + spyTargets.push([target, [spied]]); + } else { + spyTargets[index][1].push(spied); + } + } + + var observingOnScroll = false; + function observeOnScroll() { + if (!observingOnScroll) { + observingOnScroll = true; + Event.observe(document, 'scroll', Event.throttle(onScroll, 300)); + } + } + + function onScroll() { + for (var i = 0, len = spyTargets.length; i < len; i++) { + onScrollForTarget(spyTargets[i][0], spyTargets[i][1]); + } + } + + function onScrollForTarget(target, spied) { + var activeEl = findActiveElement(spied); + + // This selector finds li's to deactivate + var toDeactivate = Selector.select('li.active', target); + for (var i = 0, total = toDeactivate.length; i < total; i++) { + Css.removeClassName(toDeactivate[i], 'active'); + } + + if (activeEl === null) { + return; + } + + // The link which should be activated has a "href" ending with "#" + name or id of the element + var menuLinkSelector = 'a[href$="#' + (activeEl.name || activeEl.id) + '"]'; + + var toActivate = Selector.select(menuLinkSelector, target); + for (i = 0, total = toActivate.length; i < total; i++) { + Css.addClassName(Element.findUpwardsByTag(toActivate[i], 'li'), 'active'); + } + } + + function findActiveElement(spied) { + /* + * Find the element above the top of the screen, but closest to it. + * _____ + * |_____| element 1 (active element) + * + * ------------------------ + * | _____ | + * | | | element 2 | + * | | | | + * | |_____| | + * ------- Viewport ------- + */ + + // Remember that getBoundingClientRect returns coordinates + // relative to the top left corner of the screen. + // + // So checking if it's < 0 is used to tell if + // the element is above the top of the screen. + var closest = -Infinity; + var closestIndex; + var bBox; + for( var i = 0, total = spied.length; i < total; i++ ){ + bBox = spied[i].getBoundingClientRect(); + if (bBox.top <= 0 && bBox.top > closest) { + closest = bBox.top; + closestIndex = i; + } + } + if (closestIndex === undefined) { + return null; + } else { + return spied[closestIndex]; + } + } + + /** + * Spy is an UI component which tells the user which section is currently visible. + * Spy can be used to highlight a menu item for the section which is visible to the user. + * You need two things: A menu element (which contains your links inside `li` tags), and an element containing your section's content. + * The links must be inside `li` tags. These will get the 'active' class, to signal which item is currently visible. In your CSS you need to add styling for this class. + * To use Ink.UI.Spy for more than one section, loop through your sections (as you see in the sample below), or just load `autoload.js` and set add the `data-spy="true"` attribute to your sections. + * The currently visible element's corresponding link in the menu gets the 'visible' class added to it. + * + * @class Ink.UI.Spy + * @constructor + * @version 1 + * @param {String|DOMElement} selector + * @param {Object} [options] Options + * @param {DOMElement|String} options.target Target menu where the spy will highlight the right option. + * + * @sample Ink_UI_Spy_1.html + */ + function Spy(){ + Common.BaseUIComponent.apply(this, arguments); + } + + Spy._name = 'Spy_1'; + + Spy._optionDefinition = { + target: ['Element', undefined], + activeClass: ['String', 'active'] // [todo] Spy#_options.activeClass + }; + + Spy.prototype = { + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function() { + addSpied(this._element, this._options.target); + observeOnScroll(); + onScroll(); + } + }; + + Common.createUIComponent(Spy); + + return Spy; + +}); diff --git a/public/js/ink.stacker.js b/public/js/ink.stacker.js new file mode 100644 index 0000000..83be1ae --- /dev/null +++ b/public/js/ink.stacker.js @@ -0,0 +1,252 @@ +/** + * Stacking items in columns + * @module Ink.UI.Stacker_1 + * @version 1 + **/ + +Ink.createModule('Ink.UI.Stacker', 1, ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Element_1'], function(Common, InkEvent, InkElement) { + 'use strict'; + +function Stacker() { + Common.BaseUIComponent.apply(this, arguments); +} + +Stacker._name = 'Stacker_1'; + +Stacker._optionDefinition = { + column: ['String', '.stacker-column'], + item: ['String', '.stacker-item'], + + // [3.0.0] review this when we have info about our breakpoints from the CSS + customBreakPoints: ['Object', null], // Must be: {xlarge: {max: 9999, min: 1281, cols: 5}, large:{max:1280, min:1001, cols:4} medium:{max:1000, min:801,cols:3}, ...etc..} + largeMax: ['Number', Number.MAX_VALUE], + largeMin: ['Number', 961], + mediumMax: ['Number', 960], + mediumMin: ['Number', 651], + smallMax: ['Number', 650], + smallMin: ['Number', 0], + + largeCols: ['Integer', 3], + mediumCols: ['Integer', 2], + smallCols: ['Integer', 1], + + isOrdered: ['Boolean', true], + onRunCallback: ['Function', null], + onResizeCallback: ['Function', null], + onAPIReloadCallback: ['Function', null] +}; + +Stacker.prototype = { + /** + * This module combines several stacks of items together, in smaller screen sizes. + * + * The purpose is to have several stacks of items which may have different heights and as such cannot be used because of `float: left` quirks. + * + * For example, when you have three different columns of information: + * + * [col. A: 1] [col. B: 1] [col. C: 1] + * [col. B: 2] [col. C: 2] [col. C: 2] + * + * and the screen resizes and you need a layout of 2 columns, Stacker reorders the stacks so that you get: + * + * [col. A: 1] [col. B: 1] + * [col. C: 1] [col. A: 2] + * [col. B: 2] [col. C: 2] + * + * Note: If you just want to use a different amount of columns for your items in several viewports, but these items are guaranteed to have a fixed height, don't use this module. Use the `small-*`, `medium-*` and `large-*` classes instead. + * + * @class Ink.UI.Stacker_1 + * + * @constructor + * @param {DOMElement|String} [container] Element which contains the stacks (identified by the options.column selector) + * @param {Object} [options] Options object. + * @param {String} [options.column] Selector for the the columns inside the container element. Defaults to '.stacker-column'. + * @param {String} [options.item] Selector for the items in your stack. Defaults to '.stacker-item'. + * @param {Object} [options.customBreakPoints] Options for each breakpoint name. Use this if you have more breakpoints than Ink by default (`large`, `medium`, `small`) + * @param {Object} [options.customBreakpoints.BREAKPOINT_NAME] Custom breakpoints object. + * @param {String} options.customBreakpoints.BREAKPOINT_NAME.max Maximum screen size as seen in your media query + * @param {String} options.customBreakpoints.BREAKPOINT_NAME.min Minimum screen size as seen in your media query + * @param {String} options.customBreakpoints.BREAKPOINT_NAME.cols Column count for this size. + * @param {Number} [options.largeMax] Upper bound of `large` breakpoint + * @param {Number} [options.largeMin] Lower bound of `large` breakpoint. Defaults to 961. + * @param {Number} [options.mediumMax] Upper bound of `medium` breakpoint. Defaults to 960. + * @param {Number} [options.mediumMin] Lower bound of `medium` breakpoint. Defaults to 651. + * @param {Number} [options.smallMax] Upper bound of `small` breakpoint. Defaults to 650. + * @param {Number} [options.smallMin] Lower bound of `small` breakpoint + * + * @param {Integer} [options.largeCols] Number of columns in the `large` viewport. Defaults to 3. + * @param {Integer} [options.mediumCols] Number of columns in the `medium` viewport. Defaults to 2. + * @param {Integer} [options.smallCols] Number of columns in the `small` viewport. Defaults to 1. + * + * @param {Boolean} [options.isOrdered] When false, doesn't reorder stacks when combining them. + * @param {Function} [options.onRunCallback] Called when instantiated. + * @param {Function} [options.onResizeCallback] Called when the window resizes. + * @param {Function} [options.onAPIReloadCallback] Called when the reload function executes. + * + * @sample Ink_UI_Stacker_1.html + **/ + _init: function() { + this._aList = []; + + this._curLayout = 'large'; + + // [todo] is this needed? + this._runFirstTime = false; + + this._getPageItemsToList(); + + if(this._canApplyLayoutChange() || !this._runFirstTime) { + this._runFirstTime = true; + this._applyLayoutChange(); + if(typeof(this._options.onRunCallback) === 'function') { + this._options.onRunCallback(this._curLayout); + } + } + this._addEvents(); + }, + + /** + * Adds an item to the end of your stacks. + * Call `reloadItems()` when you are done adding items. + * @method addItem + * @param {DOMElement} item Element + **/ + addItem: function(item) { + this._aList.push(item); + }, + + /** + * Updates the layout of your items. + * Call this method after adding items or changing their dimensions. This method is automatically called when the window resizes. + * + * @method reloadItems + **/ + reloadItems: function() { + this._applyLayoutChange(); + if(typeof(this._options.onAPIReloadCallback) === 'function') { + this._options.onAPIReloadCallback(this._curLayout); + } + }, + + _addEvents: function() { + InkEvent.observe(window, 'resize', Ink.bindEvent(this._onResize, this)); + }, + + _onResize: function() { + if(this._canApplyLayoutChange()) { + this._removeDomItems(); + this._applyLayoutChange(); + if(typeof(this._options.onResizeCallback) === 'function') { + this._options.onResizeCallback(this._curLayout); + } + } + }, + + _setCurLayout: function() { + var viewportWidth = InkElement.viewportWidth(); + if(this._options.customBreakpoints && typeof(this._options.customBreakPoints) === 'object') { + for(var prop in this._options.customBreakPoints) { + if(this._options.customBreakPoints.hasOwnProperty(prop)) { + if(viewportWidth >= Number(this._options.customBreakPoints[prop].min) && viewportWidth <= Number(this._options.customBreakPoints[prop].max) && this._curLayout !== prop) { + this._curLayout = prop; + return; + } + } + } + } else { + if(viewportWidth <= Number(this._options.largeMax) && viewportWidth >= Number(this._options.largeMin) && this._curLayout !== 'large') { + this._curLayout = 'large'; + } else if(viewportWidth >= Number(this._options.mediumMin) && viewportWidth <= Number(this._options.mediumMax) && this._curLayout !== 'medium') { + this._curLayout = 'medium'; + } else if(viewportWidth >= Number(this._options.smallMin) && viewportWidth <= Number(this._options.smallMax) && this._curLayout !== 'small') { + this._curLayout = 'small'; + } + } + }, + + _getColumnsToShow: function() { + if(this._options.customBreakPoints && typeof(this._options.customBreakPoints) === 'object') { + return Number(this._options.customBreakPoints[this._curLayout].cols); + } else { + return Number(this._options[this._curLayout+'Cols']); + } + }, + + _canApplyLayoutChange: function() { + var curLayout = this._curLayout; + this._setCurLayout(); + if(curLayout !== this._curLayout) { + return true; + } + return false; + }, + + _getPageItemsToList: function() { + this._aColumn = Ink.ss(this._options.column, this._element); + var totalCols = this._aColumn.length; + var index = 0; + if(totalCols > 0) { + for(var i=0; i < this._aColumn.length; i++) { + var aItems = Ink.ss(this._options.item, this._aColumn[i]); + for(var j=0; j < aItems.length; j++) { + if(this._options.isOrdered) { + index = i + (j * totalCols); + } + this._aList[index] = aItems[j]; + if(!this._options.isOrdered) { + index++; + } + //aItems[j].style.height = (100 + (Math.random() * 100))+'px'; + aItems[j].parentNode.removeChild(aItems[j]); + } + } + if(this._aList.length > 0 && this._options.isOrdered) { + var aNewList = []; + for(var ii=0; ii < this._aList.length; ii++) { + if(typeof(this._aList[ii]) !== 'undefined') { + aNewList.push(this._aList[ii]); + } + } + this._aList = aNewList; + } + } + }, + + _removeDomItems: function() { + var totalCols = this._aColumn.length; + if(totalCols > 0) { + for(var i=0; i < totalCols; i++) { + var aItems = Ink.ss(this._options.item, this._aColumn[i]); + for(var j=aItems.length - 1; j >= 0; j--) { + aItems[j].parentNode.removeChild(aItems[j]); + } + } + } + }, + + _applyLayoutChange: function() { + var totalCols = this._getColumnsToShow(); + var totalItems = this._aList.length; + var index = 0; + var countCol = 0; + if(totalCols > 0) { + while(countCol < totalCols) { + this._aColumn[countCol].appendChild(this._aList[index]); + index++; + countCol++; + if(index === totalItems) { + return; + } + if(countCol === totalCols) { + countCol = 0; + } + } + } + } +}; + +Common.createUIComponent(Stacker); + +return Stacker; + +}); diff --git a/public/js/ink.sticky.js b/public/js/ink.sticky.js new file mode 100644 index 0000000..fd0143a --- /dev/null +++ b/public/js/ink.sticky.js @@ -0,0 +1,276 @@ +/** + * Stick elements to the viewport + * @module Ink.UI.Sticky_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Sticky', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Element_1','Ink.Dom.Css_1'], function(Common, Event, Element, Css) { + 'use strict'; + + /** + * Ink.UI.Sticky makes an element "stick" to the screen and stay in the same place as the user scrolls. To use it, just select an element as you create the Sticky. As you scroll past it, it will stick to the top of the screen. + * The `activateInLayouts` option controls in what layouts this behaviour happens. By default, it is disabled for the `small` and `tiny` layouts. Pass a comma-separated string to choose just the layouts you need. You can use the `offsetTop` option if you want it to keep some distance from the top of the screen. To avoid it going under the footer of your page, pass a selector to your footer as the `bottomElement` option. + * + * @class Ink.UI.Sticky + * @constructor + * @version 1 + * @param {String|DOMElement} selector Element or selector + * @param {Object} [options] Options Options object. + * @param {Number} [options.offsetBottom] Number of pixels of distance from the bottomElement. Defaults to 0. + * @param {Number} [options.offsetTop] Number of pixels of distance from the topElement. Defaults to 0. + * @param {Boolean} [options.inlineDimensions] Set to false to disable setting inline CSS dimensions. Use this if you want to use CSS to define your own dimensions. Defaults to true. + * @param {Boolean} [options.inlinePosition] Set to false to disable setting inline CSS positions. Use this if you want to use CSS to define your own positioning. Defaults to true. + * @param {String} [options.wrapperClass] CSS class for the wrapper element. Defaults to 'ink-sticky-wrapper'. + * @param {String} [options.stickyClass] CSS class to stick the element to the screen. Defaults to 'ink-sticky-stuck'. + * @param {String} [options.topElement] CSS Selector that specifies a top element with which the component could collide. + * @param {String} [options.bottomElement] CSS Selector that specifies a bottom element with which the component could collide. + * @param {Array|String} [options.activateInLayouts] Layouts in which the sticky behaviour is present. Pass an array or comma-separated string. Defaults to 'tiny,small,medium,large,xlarge'. + * + * @sample Ink_UI_Sticky_1.html + */ + function Sticky(){ + Common.BaseUIComponent.apply(this, arguments); + } + + Sticky._name = 'Sticky_1'; + + Sticky._optionDefinition = { + offsetBottom: ['Integer', 0], + offsetTop: ['Integer', 0], + topElement: ['Element', null], + wrapperClass: ['String', 'ink-sticky-wrapper'], + stickyClass: ['String', 'ink-sticky-stuck'], + inlineDimensions: ['Boolean', true], + inlinePosition: ['Boolean', true], + bottomElement: ['Element', null], + activateInLayouts: ['String', 'tiny,small,medium,large,xlarge'] + }; + + Sticky.prototype = { + + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function() { + // Because String#indexOf is compatible with lt IE8 but not Array#indexOf + this._options.activateInLayouts = this._options.activateInLayouts.toString(); + + this._dims = null; // force a recalculation of the dimensions later + + this._options.offsetTop = parseInt(this._options.offsetTop, 10) || 0; + this._options.offsetBottom = parseInt(this._options.offsetBottom, 10) || 0; + + if (this._options.topElement) { + this._options.topElement = Common.elOrSelector(this._options.topElement, 'Top Element'); + } + if (this._options.bottomElement) { + this._options.bottomElement = Common.elOrSelector(this._options.bottomElement, 'Sticky bottom Element'); + } + + this._wrapper = Element.create('div', { className: this._options.wrapperClass }); + Element.wrap(this._element, this._wrapper); + + var scrollTarget = document.addEventListener ? document : window; + this._onScroll = Ink.bind(Event.throttle(this._onScroll, 33), this); // Because this is called directly. + Event.observe( scrollTarget, 'scroll', this._onScroll ); + Event.observe( window, 'resize', Ink.bindEvent(Event.throttle(this._onResize, 100), this) ); + this._onScroll(); + }, + + /** + * Returns whether the sticky is disabled in the current view + * + * @method isDisabledInLayout + * @private + */ + _isDisabledInLayout: function () { + var currentLayout = Common.currentLayout(); + if (!currentLayout) { return false; } + return this._options.activateInLayouts.indexOf(currentLayout) === -1; + }, + + /** + * Scroll handler. + * + * @method _onScroll + * @private + */ + _onScroll: function(){ + var dims = this._getDims(); + var scrollHeight = Element.scrollHeight(); + + var unstick = this._isDisabledInLayout() || + scrollHeight <= dims.top - this._options.offsetTop || + (this._options.topElement && this._options.topElement.getBoundingClientRect().bottom + this._options.offsetTop > 0); + + if( unstick ) { + // We're on top, no sticking. position:static is the "normal" position. + this._unstick(); + return; + } + + // If we stick it now, what will be its boundingClientRect.bottom ? + var bottomOfSticky = this._options.offsetTop + dims.height + Element.scrollHeight(); + var maxBottomOfSticky = document.body.scrollHeight; + + if (this._options.bottomElement) { + maxBottomOfSticky = + this._options.bottomElement.getBoundingClientRect().top + + Element.scrollHeight(); + } + + maxBottomOfSticky -= this._options.offsetBottom; + + if ( bottomOfSticky < maxBottomOfSticky ) { + // Stick to screen! + this._stickTo('screen'); + } else { + // Stick to bottom + this._stickTo('bottom'); + } + }, + + /** + * Have the sticky stick nowhere, to the screen, or to the bottom. + * + * @method _stickTo + * @private + */ + _stickTo: function (where) { + var style = this._element.style; + var dims = this._getDims(); + + Css.addClassName(this._element, this._options.stickyClass); + this._wrapper.style.height = dims.height + 'px'; + + this._inlineDimensions(dims.height + 'px', dims.width + 'px'); + + if (this._options.inlinePosition === false) { + return; + } + + style.left = dims.left + 'px'; + + if (where === 'screen') { + style.bottom = null; + style.top = this._options.offsetTop + 'px'; + } else if (where === 'bottom') { + // Distance between bottom of sticky and bottom of document + var bottom = this._getBottomOffset(); + + // Distance between bottom of viewport and bottom of document + var bottomOfViewport = Element.scrollHeight() + Element.viewportHeight(); + var toBottomOfDocument = Element.pageHeight() - bottomOfViewport; + + style.bottom = bottom - toBottomOfDocument + 'px'; + style.top = 'auto'; + } + }, + + /** + * "unstick" the sticky from the screen or bottom of the document + * @method _unstick + * @private + */ + _unstick: function () { + Css.removeClassName(this._element, this._options.stickyClass); + // deinline dimensions of our root element + this._inlineDimensions(null, null); + + // deinline the position of our root element + if (this._options.inlinePosition) { + this._element.style.left = null; + this._element.style.top = null; + this._element.style.bottom = null; + } + + // deinline dimensions of wrapper + this._wrapper.style.height = null; + this._wrapper.style.width = null; + + // Break the "getDims" cache + this._dims = null; + }, + + /** + * Resize handler + * + * @method _onResize + * @private + */ + _onResize: function(){ + this._dims = null; // Blow the cache so _getDims recalculates + this._onScroll(); + }, + + /** + * Recalculate the "dims" cache, or get it. + * + * The "dims" cache is to be set to null when the element is liable to have changed dimensions + * + * (eg: on resize) + * + **/ + _getDims: function () { + if (this._dims !== null) { return this._dims; } + + var style = this._element.style; + + // We unstick the sticky so we can measure. + var oldPosition = style.position; + var oldWidth = style.width; + + style.position = 'static'; // [todo] this should be a class toggle + style.width = null; + + var dimensionsInStatic = Element.outerDimensions(this._element); + var rect = this._wrapper.getBoundingClientRect(); + this._dims = { + height: dimensionsInStatic[1], + width: dimensionsInStatic[0], + left: rect.left + Element.scrollWidth(), + top: rect.top + Element.scrollHeight() + }; + + style.position = oldPosition; + style.width = oldWidth; + + return this._dims; + }, + + /** + * Set style.height and style.width, but not if options.inlineDimensions === false + * + * @method _inlineDimensions + * @private + */ + _inlineDimensions: function (height, width) { + if (this._options.inlineDimensions) { + this._element.style.height = height; + this._element.style.width = width; + } + }, + + /** + * Get the distance between the bottom of the element and the bottom of the page + * + * @method _getBottomOffset + * @private + */ + _getBottomOffset: function () { + var bottom = this._options.offsetBottom; + if (this._options.bottomElement) { + bottom += Element.pageHeight() - + Element.offsetTop(this._options.bottomElement); + } + return bottom; + } + }; + + Common.createUIComponent(Sticky); + + return Sticky; + +}); diff --git a/public/js/ink.swipe.js b/public/js/ink.swipe.js new file mode 100644 index 0000000..4e39802 --- /dev/null +++ b/public/js/ink.swipe.js @@ -0,0 +1,208 @@ +/** + * Swipe gestures + * @module Ink.UI.Swipe_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Swipe', '1', ['Ink.Dom.Event_1', 'Ink.Dom.Element_1', 'Ink.UI.Common_1'], function(InkEvent, InkElement, Common) { + 'use strict'; + + /** + * Subscribe swipe gestures. + * + * Supports filtering swipes be any combination of the criteria supported in the options. + * + * ----- + * + * Arguments received by the callbacks + * ----------------------------------- + * + * The `onStart`, `onMove`, and `onEnd` options receive as argument an object containing: + * + * - `event`: the DOMEvent object + * - `element`: the target element + * - `Instance`: the `Ink.UI.Swipe_1` instance + * - `position`: `Array` with `[x, y]` coordinates of current position + * - `dt`: Time passed between now and the first event (onMove only) + * - `gesture`: an Array containing [x,y] coordinates of every touchmove event received (only if options.storeGesture is enabled) (onEnd only) + * - `time`: an Array containing all the `dt` values for every touchmove event (onEnd only) + * - `overallMovement`: X and Y distance traveled by the touch movement (`[x, y]`) (onEnd only) + * - `overallTime`: total time passed (onEnd only) + * + * @class Ink.UI.Swipe + * @constructor + * @param {String|DOMElement} el Element or Selector + * @param {Object} options Options Object + * @param {Function} [options.onEnd] Callback function for the `touchend` event. Gets all the gesture information, and is filtered by min/max Dist and Duration options (see below) + * @param {Function} [options.onStart] Callback function for `touchstart` event. + * @param {Function} [options.onMove] Callback function for every `touchmove` event. Gets current gesture information. + * @param {Number} [options.minDist] Minimum allowed distance, in pixels. + * @param {Number} [options.maxDist] Maximum allowed distance, in pixels. + * @param {Number} [options.minDuration] Minimum allowed duration, in seconds. + * @param {Number} [options.maxDuration] Maximum allowed duration, in seconds. + * @param {String} [options.axis] If either 'x' or 'y' is passed, only swipes where the dominant axis is the given one trigger the callback + * @param {String} [options.storeGesture] If to store gesture information and provide it to the callback. Defaults to true. + * @param {String} [options.stopEvents] Flag to stop (default and propagation) of the received events. Defaults to true. + * + * + * @sample Ink_UI_Swipe_1.html + */ + function Swipe() { + if (typeof arguments[1] === 'function') { + arguments[1] = { onEnd: arguments[1] }; + } + + Common.BaseUIComponent.apply(this, arguments); + } + + Swipe._name = 'Swipe_1'; + + Swipe._optionDefinition = { + onEnd: ['Function', undefined], + onStart: ['Function', undefined], + onMove: ['Function', undefined], + minDist: ['Number', undefined], // in pixels + maxDist: ['Number', undefined], + minDuration: ['Number', undefined], // in seconds + maxDuration: ['Number', undefined], + axis: ['String', undefined], // x | y + storeGesture: ['Boolean', false], + stopEvents: ['Boolean', true] + }; + + Swipe.prototype = { + _supported: ('ontouchstart' in document.documentElement), + + _init: function() { + this._handlers = { + down: Ink.bindEvent(this._onDown, this), + move: Ink.bindEvent(this._onMove, this), + up: Ink.bindEvent(this._onUp, this) + }; + + var db = document.body; + InkEvent.observe(db, 'touchstart', this._handlers.down); + if (this._options.storeGesture || this._options.onMove) { + InkEvent.observe(db, 'touchmove', this._handlers.move); + } + InkEvent.observe(db, 'touchend', this._handlers.up); + this._isOn = false; + }, + + _isMeOrParent: function(el, parentEl) { + if (!el) {return;} + do { + if (el === parentEl) { return true; } + el = el.parentNode; + } while (el); + return false; + }, + + _pushGesture: function (coords, dt) { + if (this._options.storeGesture) { + this._gesture.push(coords); + this._time.push(dt); + } + }, + + _onDown: function(event) { + if (event.changedTouches.length !== 1) { return; } + if (!this._isMeOrParent(event.target, this._element)) { return; } + + if( this._options.stopEvents === true ){ + InkEvent.stop(event); + } + event = event.changedTouches[0]; + this._isOn = true; + this._target = event.target; + + this._t0 = +new Date(); + this._p0 = [event.pageX, event.pageY]; + + if (this._options.storeGesture) { + this._gesture = []; + this._time = []; + } + + this._pushGesture(this._p0, 0); + + if (this._options.onStart) { + this._options.onStart({ + event: event, + element: this._element, + instance: this, + position: this._p0, + dt: 0 + }); + } + }, + + _onMove: function(event) { + if (!this._isOn || event.changedTouches.length !== 1) { return; } + if( this._options.stopEvents === true ) { + InkEvent.stop(event); + } + + event = event.changedTouches[0]; + var t1 = +new Date(); + var dt = (t1 - this._t0); + + var gesture = [event.pageX, event.pageY]; + + this._pushGesture(gesture, dt); + + if (this._options.onMove) { + this._options.onMove({ + event: event, + element: this._element, + instance: this, + position: gesture, + dt: dt + }); + } + }, + + _onUp: function(event) { + if (!this._isOn || event.changedTouches.length !== 1) { return; } + + if( this._options.stopEvents === true ){ + InkEvent.stop(event); + } + event = event.changedTouches[0]; // TODO SHOULD CHECK IT IS THE SAME TOUCH + this._isOn = false; + + var t1 = +new Date(); + var p1 = [event.pageX, event.pageY]; + var dt = (t1 - this._t0); + var dr = [ + p1[0] - this._p0[0], + p1[1] - this._p0[1] + ]; + var dist = Math.sqrt(dr[0]*dr[0] + dr[1]*dr[1]); + var axis = Math.abs(dr[0]) > Math.abs(dr[1]) ? 'x' : 'y'; + + var o = this._options; + if (o.minDist && dist < o.minDist) { return; } + if (o.maxDist && dist > o.maxDist) { return; } + if (o.minDuration && dt < o.minDuration) { return; } + if (o.maxDuration && dt > o.maxDuration) { return; } + if (o.axis && axis !== o.axis) { return; } + + if (this._options.onEnd) { + this._options.onEnd({ + event: event, + element: this._element, + instance: this, + gesture: this._gesture, + time: this._time, + axis: axis, + overallMovement: dr, + overallTime: dt + }); + } + } + }; + + Common.createUIComponent(Swipe); + + return Swipe; +}); diff --git a/public/js/ink.table.js b/public/js/ink.table.js new file mode 100644 index 0000000..94e8ec4 --- /dev/null +++ b/public/js/ink.table.js @@ -0,0 +1,695 @@ +/** + * Sort and paginate tabular data + * @module Ink.UI.Table_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Table', '1', ['Ink.Util.Url_1','Ink.UI.Pagination_1','Ink.Net.Ajax_1','Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1','Ink.Util.String_1', 'Ink.Util.Json_1'], function(InkUrl,Pagination, Ajax, Common, Event, Css, Element, Selector, InkArray, InkString, Json) { + 'use strict'; + + var rNumber = /\d/g; + // Turn into a number, if we can. For sorting data which could be numeric or not. + function maybeTurnIntoNumber(value) { + if( !isNaN(value) && rNumber.test(value) ){ + return parseInt(value, 10); + } else if( !isNaN(value) ){ + return parseFloat(value); + } + return value; + } + function cmp (a, b) { + if( a === b ){ + return 0; + } + return ( ( a > b ) ? 1 : -1 ); + } + // cmp function for comparing data which might be a number. + function numberishEnabledCmp (a, b) { + var aValue = maybeTurnIntoNumber(Element.textContent(a)); + var bValue = maybeTurnIntoNumber(Element.textContent(b)); + + return cmp(aValue, bValue); + } + // Object.keys polyfill + function keys(obj) { + if (typeof Object.keys !== 'undefined') { + return Object.keys(obj); + } + var ret = []; + for (var k in obj) if (obj.hasOwnProperty(k)) { + ret.push(k); + } + return ret; + } + + /** + * The Table component transforms the native/DOM table element into a sortable, paginated component. + * You can use this component to display data from a JSON endpoint, or from table rows in the DOM. Displaying from the DOM is more practical, but sometimes you don't want to load everything at once (if you have a HUGE table). In those cases, you should configure Ink.UI.Table to get data from JSON endpoint. + * To enable sorting, just set the `data-sortable` attribute of your table headers (they must be in the `thead` of the table) to "true". To enable pagination, you should pass either an `Ink.UI.Pagination` instance or a selector to create the Ink.UI.Pagination element on. + * + * @class Ink.UI.Table + * @constructor + * @version 1 + * @param {String|DOMElement} selector + * @param {Object} [options] Options + * @param {Number} [options.pageSize] Number of rows per page. Omit to avoid paginating. + * @param {String} [options.endpoint] Endpoint to get the records via AJAX. Omit if you don't want to do AJAX + * @param {Function} [options.createEndpointUrl] Callback to customise what URL the AJAX endpoint is at. Receives three arguments: base (the "endpoint" option), sort (`{ order: 'asc' or 'desc', field: fieldname }`) and page ({ page: page number, size: items per page }) + * @param {Function} [options.getDataFromEndPoint] Callback to allow the user to retrieve the data himself given an URL. Must accept two arguments: `url` and `callback`. This `callback` will take as a single argument a JavaScript object. + * @param {Function} [options.processJSONRows] Retrieve an array of rows from the data which came from AJAX. + * @param {Function} [options.processJSONHeaders] Get an object with all the headers' names as keys, and a { label, sortable } object as value. Example: `{col1: {label: "Column 1"}, col2: {label: "Column 2", sortable: true}`. Takes a single argument, the JSON response. + * @param {Function} [options.processJSONRow] Process a row object before it gets on the table. + * @param {Function} [options.processJSONField] Process the field data before putting it on the table. You can return HTML, a DOM element, or a string here. Arguments you receive: `(column, fieldData, rowIndex)`. + * @param {Function} [options.processJSONField.FIELD_NAME] The same as processJSONField, but for a particular field. + * @param {Function} [options.processJSONTotalRows] A callback where you have a chance to say how many rows are in the dataset (not only on this page) you have on the collection. You get as an argument the JSON response. + * @param {Function} [options.getSortKey] A function taking a `{ columnIndex, columnName, data, element }` object and returning a value which serves as a sort key for the sorting operation. For example, if you want to sort by a `data-sort-key` atribute, set `getSortKey` to: function (cell) { return cell.element.getAttribute('data-sort-key'); } + * @param {Function} [options.getSortKey.FIELD_NAME] Same as `options.getSortKey`, but for a particular field. + * @param {Object} [options.tdClassNames] An object mapping each field to what classes it gets. Example: `{ name: "large-10", isBoss: "hide-small" }` + * @param {Mixed} [options.pagination] Pagination instance, element or selector. + * @param {Object} [options.paginationOptions] Override the options with which we instantiate the Ink.UI.Pagination. + * @param {Boolean} [options.allowResetSorting] Allow sort order to be set to "none" in addition to "ascending" and "descending" + * @param {String|Array} [options.visibleFields] Set of fields which get shown on the table + * + * @sample Ink_UI_Table_1.html + */ + function Table(){ + Common.BaseUIComponent.apply(this, arguments); + } + + Table._name = 'Table_1'; + + // Most processJSON* functions can just default to this. + function sameSame(obj) { return obj; } + + Table._optionDefinition = { + pageSize: ['Integer', null], + caretUpClass: ['String', 'fa fa-caret-up'], + caretDownClass: ['String', 'fa fa-caret-down'], + endpoint: ['String', null], + createEndpointUrl: ['Function', null /* default func uses above option */], + getDataFromEndPoint: ['Function', null /* by default use plain ajax for JSON */], + processJSONRows: ['Function', sameSame], + processJSONRow: ['Function', sameSame], + processJSONField: ['Function', sameSame], + processJSONHeaders: ['Function', function (dt) { return dt.fields; }], + processJSONTotalRows: ['Function', function (dt) { return dt.length || dt.totalRows; }], + getSortKey: ['Function', null], + pagination: ['Element', null], + allowResetSorting: ['Boolean', false], + visibleFields: ['String', null], + tdClassNames: ['Object', {}], + paginationOptions: ['Object', null] + }; + + Table.prototype = { + _validate: function () { + if( this._element.nodeName.toLowerCase() !== 'table' ){ + throw new Error('[Ink.UI.Table] :: The element is not a table'); + } + }, + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function(){ + /** + * Checking if it's in markup mode or endpoint mode + */ + this._markupMode = !this._options.endpoint; + + if( this._options.visibleFields ){ + this._options.visibleFields = this._options.visibleFields.toString().split(/[, ]+/g); + } + + this._thead = this._element.tHead || this._element.createTHead(); + this._headers = Selector.select('th', this._thead); + + /** + * Initializing variables + */ + this._handlers = { + thClick: null + }; + this._originalFields = [ + // field headers from the DOM + ]; + this._sortableFields = { + // Identifies which columns are sorted and how. + // columnIndex: 'none'|'asc'|'desc' + }; + this._originalData = this._data = []; + this._pagination = null; + this._totalRows = 0; + + this._handlers.thClick = Event.observeDelegated(this._element, 'click', + 'thead th[data-sortable="true"]', + Ink.bindMethod(this, '_onThClick')); + + /** + * If not is in markup mode, we have to do the initial request + * to get the first data and the headers + */ + if( !this._markupMode ) { + /* Endpoint mode */ + this._getData( ); + } else /* Markup mode */ { + this._resetSortOrder(); + this._addHeadersClasses(); + + /** + * Getting the table's data + */ + this._data = Selector.select('tbody tr', this._element); + this._originalData = this._data.slice(0); + + this._totalRows = this._data.length; + + /** + * Set pagination if options tell us to + */ + this._setPagination(); + } + }, + + /** + * Add the classes in this._options.tdClassNames to our table headers. + * @method _addHeadersClasses + * @private + */ + _addHeadersClasses: function () { + var headerLabel; + var classNames; + for (var i = 0, len = this._headers.length; i < len; i++) { + headerLabel = Element.textContent(this._headers[i]); + classNames = this._options.tdClassNames[headerLabel]; + // TODO do not find header labels this way. But how? + if (classNames) { + Css.addClassName(this._headers[i], classNames); + } + } + }, + + /** + * Click handler. This will mainly handle the sorting (when you click in the headers) + * + * @method _onThClick + * @param {Event} event Event obj + * @private + */ + _onThClick: function( event ){ + var tgtEl = Event.element(event), + paginated = this._options.pageSize !== undefined; + + Event.stop(event); + + var index = InkArray.keyValue(tgtEl, this._headers, true); + var sortable = index !== false && this._sortableFields[index] !== undefined; + + if( !sortable ){ + return; + } + + if( !this._markupMode && paginated ){ + this._invertSortOrder(index, false); + } else { + if ( (this._sortableFields[index] === 'desc') && this._options.allowResetSorting ) { + this._setSortOrderOfColumn(index, null); + this._data = this._originalData.slice(0); + } else { + this._invertSortOrder(index, true); + } + + var tbody = Selector.select('tbody',this._element)[0]; + Common.cleanChildren(tbody); + InkArray.each(this._data, Ink.bindMethod(tbody, 'appendChild')); + + if (this._pagination) { + this._pagination.setCurrent(0); + this._paginate(1); + } + } + }, + + _invertSortOrder: function (index, sortAndReverse) { + var isAscending = this._sortableFields[index] === 'asc'; + + for (var i = 0, len = this._headers.length; i < len; i++) { + this._setSortOrderOfColumn(i, null); + } + + if (sortAndReverse) { + this._sort(index); + if (isAscending) { + this._data.reverse(); + } + } + + this._setSortOrderOfColumn(index, !isAscending); + }, + + _setSortOrderOfColumn: function(index, up) { + var header = this._headers[index]; + var caretHtml = ['']; + var order = 'none'; + + if (up === true) { + caretHtml = ['']; + order = 'asc'; + } else if (up === false) { + caretHtml = ['']; + order = 'desc'; + } + + this._sortableFields[index] = order; + header.innerHTML = Element.textContent(header) + caretHtml.join(''); + }, + + /** + * Applies and/or changes the CSS classes in order to show the right columns + * + * @method _paginate + * @param {Number} page Current page + * @private + */ + _paginate: function( page ){ + if (!this._pagination) { return; } + + var pageSize = this._options.pageSize; + + // Hide everything except the items between these indices + var firstIndex = (page - 1) * pageSize; + var lastIndex = firstIndex + pageSize; + + InkArray.each(this._data, function(item, index){ + if (index >= firstIndex && index < lastIndex) { + Css.removeClassName(item,'hide-all'); + } else { + Css.addClassName(item,'hide-all'); + } + }); + + }, + + /* register fields into this._originalFields, whether they come from JSON or a table. + * @method _registerFieldNames + * @private + * @param [names] The field names in an array + **/ + _registerFieldNames: function (names) { + this._originalFields = []; + + InkArray.forEach(names, Ink.bind(function (field) { + if( !this._fieldIsVisible(field) ){ + return; // The user deems this not to be necessary to see. + } + this._originalFields.push(field); + }, this)); + }, + + _fieldIsVisible: function (field) { + return !this._options.visibleFields || + (this._options.visibleFields.indexOf(field) !== -1); + }, + + /** + * Sorts by a specific column. + * + * @method _sort + * @param {Number} index Column number (starting at 0) + * @private + */ + _sort: function( index ){ + // TODO this is THE worst way to declare field names. Incompatible with i18n and a lot of other things. + var fieldName = Element.textContent(this._headers[index]); + var keyFunction = this._options.getSortKey; + + if (keyFunction) { + keyFunction = + typeof keyFunction[fieldName] === 'function' ? + keyFunction[fieldName] : + typeof keyFunction === 'function' ? + keyFunction : + null; + } + + var self = this; + + this._data.sort(function (trA, trB) { + var elementA = Ink.ss('td', trA)[index]; + var elementB = Ink.ss('td', trB)[index]; + if (keyFunction) { + return cmp(userKey(elementA), userKey(elementB)); + } else { + return numberishEnabledCmp(elementA, elementB, index); + } + }); + + function userKey(element) { + return keyFunction.call(self, { + columnIndex: index, + columnName: fieldName, + data: Element.textContent(element), + element: element + }); + } + }, + + /** + * Assembles the headers markup + * + * @method _createHeadersFromJson + * @param {Object} headers Key-value object that contains the fields as keys, their configuration (label and sorting ability) as value + * @private + */ + _createHeadersFromJson: function( headers ){ + this._registerFieldNames(keys(headers)); + + if (this._thead.children.length) { return; } + + var tr = this._thead.insertRow(0); + var th; + + for (var i = 0, len = headers.length; i < len; i++) { + if (this._fieldIsVisible(headers[i])) { + th = Element.create('th'); + th = this._createSingleHeaderFromJson(headers[i], th); + tr.appendChild(th); + this._headers.push(th); + } + } + }, + + _createSingleHeaderFromJson: function (header, th) { + if (header.sortable) { + th.setAttribute('data-sortable','true'); + } + + if (header.label){ + Element.setTextContent(th, header.label); + } + + return th; + }, + + /** + * Reset the sort order as marked on the table headers to "none" + * + * @method _resetSortOrder + * @private + */ + _resetSortOrder: function(){ + /** + * Setting the sortable columns and its event listeners + */ + for (var i = 0, len = this._headers.length; i < len; i++) { + var dataset = Element.data( this._headers[i] ); + if (dataset.sortable && dataset.sortable.toString() === 'true') { + this._sortableFields[i] = 'none'; + } + } + }, + + /** + * This method gets the rows from AJAX and places them as and + * + * @method _createRowsFromJSON + * @param {Object} rows Array of objects with the data to be showed + * @private + */ + _createRowsFromJSON: function( rows ){ + var tbody = Selector.select('tbody',this._element)[0]; + + if( !tbody ){ + tbody = document.createElement('tbody'); + this._element.appendChild( tbody ); + } else { + Element.setHTML(tbody, ''); + } + + this._data = []; + var row; + + for (var trIndex in rows) { + if (rows.hasOwnProperty(trIndex)) { + row = this._options.processJSONRow(rows[trIndex]); + this._createSingleRowFromJson(tbody, row, trIndex); + } + } + + this._originalData = this._data.slice(0); + }, + + _createSingleRowFromJson: function (tbody, row, rowIndex) { + var tr = document.createElement('tr'); + tbody.appendChild( tr ); + for( var field in row ){ + if (row.hasOwnProperty(field)) { + this._createFieldFromJson(tr, row[field], field, rowIndex); + } + } + this._data.push(tr); + }, + + _createFieldFromJson: function (tr, fieldData, fieldName, rowIndex) { + if (!this._fieldIsVisible(fieldName)) { return; } + + var processor = + this._options.processJSONField[fieldName] || // per-field callback + this._options.processJSONField; // generic callback + + var result; + if (typeof processor === 'function') { + result = processor(fieldData, fieldName, rowIndex); + } else { + result = fieldData; + } + var elm = this._elOrFieldData(result); + + var className = this._options.tdClassNames[fieldName]; + if (className) { + Css.addClassName(elm, className); + } + + tr.appendChild(elm); + }, + + _elOrFieldData: function (processed) { + if (Common.isDOMElement(processed)) { + return processed; + } + + var isString = typeof processed === 'string'; + var isNumber = typeof processed === 'number'; + var elm = Element.create('td'); + + if (isString && /^\s*? li.active', this._menu); + + for (var i = 0, len = activeTabs.length; i < len; i++) { + if (activeTabs[i] !== link) { + Css.removeClassName(activeTabs[i], 'active'); + } + } + + if (this._activeMenuTab) { + Css.removeClassName(this._activeMenuTab, 'active'); + Css.removeClassName(this._activeSection, 'active'); + Css.addClassName(this._activeSection, 'hide-all'); + } + + this._activeMenuLink = link; + this._activeMenuTab = this._activeMenuLink.parentNode; + this._activeSection = Selector.select(selector.substr(selector.indexOf('#')), this._element)[0]; + + if (!this._activeSection) { + this._activeMenuLink = this._activeMenuTab = this._activeSection = null; + return; + } + + Css.addClassName(this._activeMenuTab, 'active'); + Css.addClassName(this._activeSection, 'active'); + Css.removeClassName(this._activeSection, 'hide-all'); + + if(runCallbacks && typeof(this._options.onChange) !== 'undefined'){ + this._options.onChange(this); + } + }, + + /** + * Generic Tab clicked handler. + * Just calls _onTabClicked or _onDisabledTabClicked + * + * @private + **/ + _onTabClickedGeneric: function (event) { + event.preventDefault(); + if (!Css.hasClassName(event.currentTarget, 'ink-disabled')) { + this._onTabClicked(event.currentTarget); + } + }, + + /** + * Tab clicked handler + * + * @method _onTabClicked + * @param {Event} ev + * @private + */ + _onTabClicked: function(tabElm) { + var href = tabElm.getAttribute('href'); + href = href.substr(href.indexOf('#')); + + if (!href || Ink.i(this._dehashify(href)) === null) { + return; + } + + if (!this._options.preventUrlChange) { + window.location.hash = href; + } + + if (tabElm === this._activeMenuLink) { + return; + } + this.changeTab(tabElm); + }, + + /** + * Resize handler + * + * @method _onResize + * @private + */ + _onResize: function(){ + var currentLayout = Common.currentLayout(); + if(currentLayout === this._lastLayout){ + return; + } + + // wtf + var smallLayout = + currentLayout === Common.Layouts.TINY || + currentLayout === Common.Layouts.SMALL || + currentLayout === Common.Layouts.MEDIUM; + + if(smallLayout){ + Css.removeClassName(this._menu, 'menu'); + Css.removeClassName(this._menu, 'horizontal'); + // Css.addClassName(this._menu, 'pills'); + } else { + Css.addClassName(this._menu, 'menu'); + Css.addClassName(this._menu, 'horizontal'); + // Css.removeClassName(this._menu, 'pills'); + } + this._lastLayout = currentLayout; + }, + + /***************** + * Aux Functions * + *****************/ + + /** + * Allows the hash to be passed with or without the cardinal sign + * + * @method _hashify + * @param {String} hash the string to be hashified + * @return {String} Resulting hash + * @private + */ + _hashify: function(hash){ + if(!hash){ + return ""; + } + return hash.indexOf('#') === 0? hash : '#' + hash; + }, + + /** + * Removes the cardinal sign from the beginning of a string + **/ + _dehashify: function(hash) { + if (!hash) { return ''; } + return ('' + hash).replace(/^#/, ''); + }, + + /** + * Returns the anchor with the desired href + * + * @method _findLinkBuHref + * @param {String} href the href to be found on the returned link + * @return {String|undefined} [description] + * @private + */ + _findLinkByHref: function(href){ + // If it's null or undefined, the following checks fail. + if (!href) { return null; } + + // If it's a node, it could be a link or a section. + if (href.nodeType === 1) { + if (Element.isAncestorOf(href, this._element)) { return null; } // Element is outside the tabs element. + + var links = Selector.select('a', this._menu); + var id = href.getAttribute('id'); + + for (var i = 0, len = links.length; i < len; i++) { + if (links[i] === href || Element.isAncestorOf(href, links[i])) { + return links[i]; // We got a link + } else if (id && id === this._dehashify(links[i].getAttribute('href'))) { + return links[i]; // We got a section + } + } + + return null; + } + + // Else, it's a string. It could start with "#" or without it. + href = this._hashify(href); + // Find a link which has a href ending with... + return Selector.select('a[href$="' + href + '"]', this._menu)[0] || null; + }, + + /************** + * PUBLIC API * + **************/ + + /** + * Changes the active tab + * + * Pass a selector/element identifying what tab you want + * + * @method changeTab + * @param {String|DOMElement} selector Selector of the desired tab or the link that links to it + * @public + */ + changeTab: function(selector) { + selector = this._findLinkByHref(selector); + + if(!selector || Css.hasClassName(selector, 'ink-disabled')){ + return; + } + + this._changeTab(selector, true); + }, + + /** + * Disables the desired tag + * + * @method disable + * @param {String|DOMElement} selector the id of the desired tab or the link that links to it + * @public + */ + disable: function(selector){ + Css.addClassName(this._findLinkByHref(selector), 'ink-disabled'); + }, + + /** + * Enables the desired tag + * + * @method enable + * @param {String|DOMElement} selector The id of the desired tab or the link that links to it + * @public + */ + enable: function(selector){ + Css.removeClassName(this._findLinkByHref(selector), 'ink-disabled'); + }, + + /*********** + * Getters * + ***********/ + + /** + * Returns the active tab id + * + * @method activeTab + * @return {String} ID of the active section (use activeSection() instead to get the element). + * @public + */ + activeTab: function(){ + return this._activeSection.getAttribute('id'); + }, + + /** + * + * Returns the parent of the currently active menu link. + * + * This is useful if you want to have `li` elements wrapping your links + * and want to access the currently visible one. + * + * (This method is deprecated) + * @method activeMenuTab + * @deprecated + * @return {DOMElement|null} Active menu LI, or `null` if there is none. + * @public + */ + activeMenuTab: function(){ + // [3.1.0] remove this + Ink.warn('Ink.UI.Tabs.activeMenuTab() is deprecated'); + return this._activeMenuTab; + }, + + /** + * Gets the currently active Menu link (the links which the user clicks on to change tabs) + * + * @method activeMenuLink + * @return {DOMElement|null} Active menu link, or `null` if there is none. + * @public + */ + activeMenuLink: function(){ + return this._activeMenuLink; + }, + + /** + * Gets the currently active section + * + * (Each section contains content for a tab, and must have an `id` attribute) + * + * @method activeContentTab + * @return {DOMElement|null} Active section, or `null` if there is none. + * @public + */ + activeSection: function(){ + return this._activeSection; + }, + + activeContentTab: function () { + // [3.1.0] remove this + Ink.warn('Ink.UI.Tabs.activeContentTab() is deprecated. Use activeSection instead.'); + return this._activeSection(); + }, + + /** + * Unregisters the component and removes its markup + * + * @method destroy + * @public + */ + destroy: Common.destroyComponent + }; + + Common.createUIComponent(Tabs); + + return Tabs; + +}); diff --git a/public/js/ink.tagfield.js b/public/js/ink.tagfield.js new file mode 100644 index 0000000..650ba08 --- /dev/null +++ b/public/js/ink.tagfield.js @@ -0,0 +1,273 @@ +/* + * Tagging input element + * @module Ink.UI.TagField_1 + * @version 1 + */ +Ink.createModule("Ink.UI.TagField","1",["Ink.Dom.Element_1", "Ink.Dom.Event_1", "Ink.Dom.Css_1", "Ink.Dom.Browser_1", "Ink.UI.Droppable_1", "Ink.Util.Array_1", "Ink.Dom.Selector_1", "Ink.UI.Common_1"],function( InkElement, InkEvent, Css, Browser, Droppable, InkArray, Selector, Common) { + 'use strict'; + + var enterKey = 13; + var backspaceKey = 8; + var isTruthy = function (val) {return !!val;}; + + /** + * Use this class to have a field where a user can input several tags into a single text field. A good example is allowing the user to describe a blog post or a picture through tags, for later searching. + * + * The markup is as follows: + * + * + * + * By applying this UI class to the above input, you get a tag field with the tags "initial" and "value". The class preserves the original input element. It remains hidden and is updated with new tag information dynamically, so regular HTML form logic still applies. + * + * Below "input" refers to the current value of the input tag (updated as the user enters text, of course), and "output" refers to the value which this class writes back to said input tag. + * + * @class Ink.UI.TagField + * @version 1 + * @constructor + * @param {String|DOMElement} element Selector or DOM Input Element. + * @param {Object} [options] Options object + * @param {String|Array} [options.tags] Initial tags in the input + * @param {Boolean} [options.allowRepeated] Flag to allow user to input several tags. Defaults to true. + * @param {RegExp} [options.separator] Split the input by this RegExp. Defaults to /[,;(space)]+/g (spaces, commas and semicolons) + * @param {String} [options.outSeparator] Use this string to separate each tag from the next in the output. Defaults to ','. + * @param {Boolean} [options.autoSplit] Flag to activate tag creation when the user types a separator. Defaults to true. + * @param {Integer} [options.maxTags] Maximum number of tags allowed. Set to -1 for no limit. Defaults to -1. + * @example + */ + function TagField() { + Common.BaseUIComponent.apply(this, arguments); + } + + TagField._name = 'TagField_1'; + + TagField._optionDefinition = { + tags: ['String', []], + tagQuery: ['Object', null], + tagQueryAsync: ['Object', null], + allowRepeated: ['Boolean', false], + maxTags: ['Integer', -1], + outSeparator: ['String', ','], + separator: ['String', /[,; ]+/g], + autoSplit: ['Boolean', true] + }; + + TagField.prototype = { + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function() { + var o = this._options; + if (typeof o.separator === 'string') { + o.separator = new RegExp(o.separator, 'g'); + } + + if (typeof o.tags === 'string') { + // coerce to array using the separator + o.tags = this._readInput(o.tags); + } + + Css.addClassName(this._element, 'hide-all'); + + this._viewElm = InkElement.create('div', { + className: 'ink-tagfield', + insertAfter: this._element + }); + + this._input = InkElement.create('input', { + type: 'text', + className: 'new-tag-input', + insertBottom: this._viewElm + }); + + var tags = [].concat(o.tags, this._tagsFromMarkup(this._element)); + + this._tags = []; + + InkArray.each(tags, Ink.bindMethod(this, '_addTag')); + + InkEvent.observe(this._input, 'keyup', Ink.bindEvent(this._onKeyUp, this)); + InkEvent.observe(this._input, 'change', Ink.bindEvent(this._onKeyUp, this)); + InkEvent.observe(this._input, 'keydown', Ink.bindEvent(this._onKeyDown, this)); + InkEvent.observe(this._input, 'blur', Ink.bindEvent(this._onBlur, this)); + InkEvent.observe(this._viewElm, 'click', Ink.bindEvent(this._refocus, this)); + }, + + destroy: function () { + InkElement.remove(this._viewElm); + Css.removeClassName(this._element, 'hide-all'); + }, + + _tagsFromMarkup: function (element) { + var tagname = element.tagName.toLowerCase(); + if (tagname === 'input') { + return this._readInput(element.value); + } else if (tagname === 'select') { + return InkArray.map(element.getElementsByTagName('option'), function (option) { + return InkElement.textContent(option); + }); + } else { + throw new Error('Cannot read tags from a ' + tagname + ' tag. Unknown tag'); + } + }, + + _tagsToMarkup: function (tags, element) { + var tagname = element.tagName.toLowerCase(); + if (tagname === 'input') { + if (this._options.separator) { + element.value = tags.join(this._options.outSeparator); + } + } else if (tagname === 'select') { + element.innerHTML = ''; + InkArray.each(tags, function (tag) { + var opt = InkElement.create('option', {selected: 'selected'}); + InkElement.setTextContent(opt, tag); + element.appendChild(opt); + }); + } else { + throw new Error('TagField: Cannot read tags from a ' + tagname + ' tag. Unknown tag'); + } + }, + + _addTag: function (tag) { + if (this._options.maxTags !== -1 && + this._tags.length >= this._options.maxTags) { + return; + } + if ((!this._options.allowRepeated && + InkArray.inArray(tag, this._tags, tag)) || !tag) { + return false; + } + var elm = InkElement.create('span', { + className: 'ink-tag', + setTextContent: tag + ' ' + }); + + var remove = InkElement.create('span', { + className: 'remove fa fa-times', + insertBottom: elm + }); + InkEvent.observe(remove, 'click', Ink.bindEvent(this._removeTag, this, null)); + + var spc = document.createTextNode(' '); + + this._tags.push(tag); + this._viewElm.insertBefore(elm, this._input); + this._viewElm.insertBefore(spc, this._input); + this._tagsToMarkup(this._tags, this._element); + }, + + _readInput: function (text) { + if (this._options.separator) { + return InkArray.filter(text.split(this._options.separator), isTruthy); + } else { + return [text]; + } + }, + + _onKeyUp: function () { // TODO control input box size + if (!this._options.autoSplit) { + return; + } + var split = this._input.value.split(this._options.separator); + if (split.length <= 1) { + return; + } + var last = split[split.length - 1]; + split = split.splice(0, split.length - 1); + split = InkArray.filter(split, isTruthy); + + InkArray.each(split, Ink.bind(this._addTag, this)); + this._input.value = last; + }, + + _onKeyDown: function (event) { + if (event.which === enterKey) { + return this._onEnterKeyDown(event); + } else if (event.which === backspaceKey) { + return this._onBackspaceKeyDown(); + } else if (this._removeConfirm) { + // user pressed another key, cancel removal from a backspace key + this._unsetRemovingVisual(this._tags.length - 1); + } + }, + + /** + * When the user presses backspace twice on the empty input, we delete the last tag on the field. + * @method onBackspaceKeyDown + * @private + */ + _onBackspaceKeyDown: function () { + if (this._input.value) { return; } + + if (this._removeConfirm) { + this._unsetRemovingVisual(this._tags.length - 1); + this._removeTag(this._tags.length - 1); + this._removeConfirm = null; + } else { + this._setRemovingVisual(this._tags.length - 1); + } + }, + + _onEnterKeyDown: function (event) { + var tag = this._input.value; + if (tag) { + this._addTag(tag); + this._input.value = ''; + } + InkEvent.stopDefault(event); + }, + + _onBlur: function () { + this._addTag(this._input.value); + this._input.value = ''; + }, + + /* For when the user presses backspace. + * Set the style of the tag so that it seems like it's going to be removed + * if they press backspace again. */ + _setRemovingVisual: function (tagIndex) { + var elm = this._viewElm.children[tagIndex]; + if (!elm) { return; } + + Css.addClassName(elm, 'tag-deleting'); + + this._removeRemovingVisualTimeout = setTimeout(Ink.bindMethod(this, '_unsetRemovingVisual', tagIndex), 4000); + InkEvent.observe(this._input, 'blur', Ink.bindMethod(this, '_unsetRemovingVisual', tagIndex)); + this._removeConfirm = true; + }, + _unsetRemovingVisual: function (tagIndex) { + var elm = this._viewElm.children[tagIndex]; + if (elm) { + Css.removeClassName(elm, 'tag-deleting'); + clearTimeout(this._removeRemovingVisualTimeout); + } + this._removeConfirm = null; + }, + + _removeTag: function (event) { + var index; + if (typeof event === 'object') { // click event on close button + var elm = InkEvent.element(event).parentNode; + index = InkElement.parentIndexOf(this._viewElm, elm); + } else if (typeof event === 'number') { // manual removal + index = event; + } + this._tags = InkArray.remove(this._tags, index, 1); + InkElement.remove(this._viewElm.children[index]); + this._tagsToMarkup(this._tags, this._element); + }, + + _refocus: function (event) { + this._input.focus(); + InkEvent.stop(event); + return false; + } + }; + + Common.createUIComponent(TagField); + + return TagField; +}); diff --git a/public/js/ink.toggle.js b/public/js/ink.toggle.js new file mode 100644 index 0000000..32efc4b --- /dev/null +++ b/public/js/ink.toggle.js @@ -0,0 +1,259 @@ +/** + * Toggle the visibility of elements. + * @module Ink.UI.Toggle_1 + * @version 1 + */ + + Ink.createModule('Ink.UI.Toggle', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, InkEvent, Css, InkElement, Selector, InkArray ) { + 'use strict'; + + /** + * + * You need two elements to use Toggle: the `trigger` element, and the `target` element (or elements). The default behaviour is to toggle the `target`(s) when you click the `trigger`. + * + * The toggle has a state. It is either "on" or "off". It works by switching between the CSS classes in `classNameOn` and `classNameOff` according to the current state. + * + * When you initialize the Toggle, it will check if the targets are visible to figure out what the initial state is. You can force the toggle to consider itself turned "on" or "off" by setting the `initialState` option to `true` or `false`, respectively. + * + * You can get the current state of the Toggle by calling `getState`, or by checking if your `trigger` element has the "active" class. + * The state can be changed through JavaScript. Just call `setState(true)` + * to turn the Toggle on (or `setState(false)` to turn it off). + * + * @class Ink.UI.Toggle + * @constructor + * @version 1 + * @param {String|DOMElement} selector Trigger element. By clicking this, the target (or targets) are triggered. + * @param {Object} [options] Options object, containing: + * + * @param {String} options.target CSS Selector that specifies the elements that this component will toggle + * @param {String} [options.classNameOn] CSS class to toggle when on. Defaults to 'show-all'. + * @param {String} [options.classNameOff] CSS class to toggle when off. Defaults to 'hide-all'. + * @param {String} [options.triggerEvent] Event that will trigger the toggling. Defaults to 'click'. + * @param {Boolean} [options.closeOnClick] Flag to toggle the targe off when clicking outside the toggled content. Defaults to true. + * @param {String} [options.closeOnInsideClick] Toggle off when a child element matching this selector is clicked. Set to null to deactivate the check. Defaults to 'a[href]'. + * @param {Boolean} [options.initialState] Flag to define initial state. false: off, true: on, null: markup. Defaults to null. + * @param {Function} [options.onChangeState] Callback when the toggle state changes. Return `false` to cancel the event. + * + * @sample Ink_UI_Toggle_1_constructor.html + */ + function Toggle(){ + Common.BaseUIComponent.apply(this, arguments); + } + + Toggle._name = 'Toggle_1'; + + Toggle._optionDefinition = { + target: ['Elements'], + triggerEvent: ['String', 'click'], + closeOnClick: ['Boolean', true], + isAccordion: ['Boolean', false], + initialState: ['Boolean', null], // May be true, false, or null to be what it is right now + classNameOn: ['String', 'show-all'], + classNameOff: ['String', 'hide-all'], + closeOnInsideClick: ['String', 'a[href]'], // closes the toggle when a target is clicked and it is a link + onChangeState: ['Function', null] + }; + + Toggle.prototype = { + + /** + * Init function called by the constructor + * + * @method _init + * @private + */ + _init: function(){ + var i, len; + + this._targets = Common.elsOrSelector(this._options.target); + + // Boolean option handling + this._options.closeOnClick = this._options.closeOnClick.toString() === 'true'; + // Actually a throolean + if (this._options.initialState !== null){ + this._options.initialState = this._options.initialState.toString() === 'true'; + } else { + this._options.initialState = Css.getStyle(this._targets[0], 'display') !== 'none'; + } + + if (this._options.classNameOn !== 'show-all' || this._options.classNameOff !== 'hide-all') { + for (i = 0, len = this._targets.length; i < len; i++) { + Css.removeClassName(this._targets[i], 'show-all'); + Css.removeClassName(this._targets[i], 'hide-all'); + } + } + + this._accordion = ( Css.hasClassName(this._element.parentNode,'accordion') || Css.hasClassName(this._targets[0].parentNode,'accordion') ); + + this._firstTime = true; + + this._bindEvents(); + + if (this._options.initialState !== null) { + this.setState(this._options.initialState, true); + } else { + // Add initial classes matching the current "display" of the object. + var state = Css.getStyle(this._targets[0], 'display') !== 'none'; + this.setState(state, true); + } + // Aditionally, remove any inline "display" style. + for (i = 0, len = this._targets.length; i < len; i++) { + if (this._targets[i].style.display) { + this._targets[i].style.display = ''; // becomes default + } + } + + this._element.setAttribute('data-is-toggle-trigger', 'true'); + }, + + /** + * @method _bindEvents + * @private + */ + _bindEvents: function () { + if ( this._options.triggerEvent ) { + InkEvent.observe( + this._element, + this._options.triggerEvent, + Ink.bind(this._onTriggerEvent, this)); + } + if( this._options.closeOnClick ){ + InkEvent.observe( document, 'click', Ink.bind(this._onOutsideClick, this)); + } + if( this._options.closeOnInsideClick && this._options.closeOnInsideClick !== 'false') { + var sel = this._options.closeOnInsideClick; + if (sel.toString() === 'true') { + sel = '*'; + } + InkEvent.observeMulti(this._targets, 'click', Ink.bind(function (e) { + if ( InkElement.findUpwardsBySelector(InkEvent.element(e), sel) ) { + this.setState(false, true); + } + }, this)); + } + }, + + /** + * Event handler. It's responsible for handling the `triggerEvent` as defined in the options. + * + * This will trigger the toggle. + * + * @method _onTriggerEvent + * @param {Event} event + * @private + */ + _onTriggerEvent: function( event ){ + // When the togglee is a child of the toggler, we get the togglee's events here. We have to check that this event is for us. + var target = InkEvent.element(event); + + var isAncestorOfClickedElement = InkArray.some(this._targets, function (thisOne) { + return thisOne === target || InkElement.isAncestorOf(thisOne, target); + }); + + if (isAncestorOfClickedElement) { + return; + } + + if (this._accordion) { + this._updateAccordion(); + } + + var has = this.getState(); + this.setState(!has, true); + if (!has && this._firstTime) { + this._firstTime = false; + } + + InkEvent.stopDefault(event); + }, + + /** + * Be compatible with accordions + * + * @method _updateAccordion + **/ + _updateAccordion: function () { + var elms, accordionElement; + if( Css.hasClassName(this._targets[0].parentNode,'accordion') ){ + accordionElement = this._targets[0].parentNode; + } else { + accordionElement = this._targets[0].parentNode.parentNode; + } + elms = Selector.select('.toggle, .ink-toggle',accordionElement); + for(var i=0; i 0) && (targetElm[0] !== this._targets[0]) ){ + targetElm[0].style.display = 'none'; + } + } + }, + + /** + * Click handler. Will handle clicks outside the toggle component. + * + * @method _onOutsideClick + * @param {Event} event + * @private + */ + _onOutsideClick: function( event ){ + var tgtEl = InkEvent.element(event), + shades; + + if (InkElement.findUpwardsBySelector(tgtEl, '[data-is-toggle-trigger="true"]')) return; + + var ancestorOfTargets = InkArray.some(this._targets, function (target) { + return InkElement.isAncestorOf(target, tgtEl) || target === tgtEl; + }); + + if( (this._element === tgtEl) || InkElement.isAncestorOf(this._element, tgtEl) || ancestorOfTargets) { + return; + } else if( (shades = Ink.ss('.ink-shade')).length ) { + var shadesLength = shades.length; + + for( var i = 0; i < shadesLength; i++ ){ + if( InkElement.isAncestorOf(shades[i],tgtEl) && InkElement.isAncestorOf(shades[i],this._element) ){ + return; + } + } + } + + this.setState(false, true); // dismiss + }, + + /** + * Sets the state of the toggle. (on/off) + * + * @method setState + * @param newState {Boolean} New state (on/off) + */ + setState: function (on, callHandler) { + if (on === this.getState()) { return; } + if (callHandler && typeof this._options.onChangeState === 'function') { + var ret = this._options.onChangeState(on); + if (ret === false) { return false; } // Canceled by the event handler + } + for (var i = 0, len = this._targets.length; i < len; i++) { + Css.addRemoveClassName(this._targets[i], this._options.classNameOn, on); + Css.addRemoveClassName(this._targets[i], this._options.classNameOff, !on); + } + Css.addRemoveClassName(this._element, 'active', on); + }, + + /** + * Gets the state of the toggle. (on/off) + * + * @method getState + * + * @return {Boolean} whether the toggle is toggled on. + */ + getState: function () { + return Css.hasClassName(this._element, 'active'); + } + }; + + Common.createUIComponent(Toggle); + + return Toggle; +}); diff --git a/public/js/ink.tooltip.js b/public/js/ink.tooltip.js new file mode 100644 index 0000000..2fea420 --- /dev/null +++ b/public/js/ink.tooltip.js @@ -0,0 +1,457 @@ +/** + * Content Tooltips + * @module Ink.UI.Tooltip_1 + * @version 1 + */ +Ink.createModule('Ink.UI.Tooltip', '1', ['Ink.UI.Common_1', 'Ink.Dom.Event_1', 'Ink.Dom.Element_1', 'Ink.Dom.Selector_1', 'Ink.Util.Array_1', 'Ink.Dom.Css_1', 'Ink.Dom.Browser_1'], function (Common, InkEvent, InkElement, Selector, InkArray, Css) { + 'use strict'; + + /** + * Tooltips are useful as a means to display information about functionality while avoiding clutter. + * + * Tooltips show up when you hover elements which "have" tooltips. + * + * This class will "give" a tooltip to many elements, selected by its first argument (`target`). This is contrary to the other UI modules in Ink, which are created once per element. + * + * You can define options either through the second argument of the Tooltip constructor, or as data-attributes in each `target` element. Options set through data-attributes all start with "data-tip", and override options passed into the Tooltip constructor. + * + * @class Ink.UI.Tooltip + * @constructor + * + * @param {DOMElement|String} target Target element or selector of elements, to display the tooltips on. + * @param {Object} [options] Options object + * @param {String} [options.text] Text content for the tooltip. + * @param {String} [options.html] HTML for the tooltip. Same as above, but won't escape HTML. + * @param {String} [options.where] Positioning for the tooltip. Options are 'up', 'down', 'left', 'right', 'mousemove' (follows the cursor), and 'mousefix' (stays fixed). Defaults to 'up'. + * + * @param {String} [options.color] Color of the tooltip. Options are red, orange, blue, green and black. Default is white. + * @param {Number} [options.fade] Number of seconds to fade in/out. Defaults to 0.3. + * @param {Boolean} [options.forever] Flag to prevent the tooltip from being erased when the mouse hovers away from the target. + * @param {Number} [options.timeout] Number of seconds the tooltip will stay open. Useful together with options.forever. Defaults to 0. + * @param {Number} [options.delay] Time the tooltip waits until it is displayed. Useful to avoid getting the attention of the user unnecessarily + * @param {DOMElement|Selector} [options.template] Element or selector containing HTML to be cloned into the tooltips. Can be a hidden element, because CSS `display` is set to `block`. + * @param {String} [options.templatefield] Selector within the template element to choose where the text is inserted into the tooltip. Useful when a wrapper DIV is required. + * @param {Number} [options.left] Spacing from the target to the tooltip, when `where` is `mousemove` or `mousefix`. Defaults to 10. + * @param {Number} [options.top] Spacing from the target to the tooltip, when `where` is `mousemove` or `mousefix`. Defaults to 10. + * @param {Number} [options.spacing] Spacing between the tooltip and the target element, when `where` is not `mousemove` or `mousefix`. Defaults to 8. + * + * @sample Ink_UI_Tooltip_1.html + */ + function Tooltip(element, options) { + this._init(element, options || {}); + } + + function EachTooltip(root, elm) { + this._init(root, elm); + } + + var transitionDurationName, + transitionPropertyName, + transitionTimingFunctionName; + (function () { // Feature detection + var test = document.createElement('DIV'); + var names = ['transition', 'oTransition', 'msTransition', 'mozTransition', + 'webkitTransition']; + for (var i = 0; i < names.length; i++) { + if (typeof test.style[names[i] + 'Duration'] !== 'undefined') { + transitionDurationName = names[i] + 'Duration'; + transitionPropertyName = names[i] + 'Property'; + transitionTimingFunctionName = names[i] + 'TimingFunction'; + break; + } + } + }()); + + // Body or documentElement + var bodies = document.getElementsByTagName('body'); + var body = bodies.length ? bodies[0] : document.documentElement; + + Tooltip.prototype = { + _init: function(element, options) { + var elements; + + this.options = Ink.extendObj({ + where: 'up', + zIndex: 10000, + left: 10, + top: 10, + spacing: 8, + forever: 0, + color: '', + timeout: 0, + delay: 0, + template: null, + templatefield: null, + fade: 0.3, + text: '' + }, options || {}); + + if (typeof element === 'string') { + elements = Selector.select(element); + } else if (typeof element === 'object') { + elements = [element]; + } else { + throw 'Element expected'; + } + + this.tooltips = []; + + for (var i = 0, len = elements.length; i < len; i++) { + this.tooltips[i] = new EachTooltip(this, elements[i]); + } + }, + /** + * Destroys the tooltips created by this instance + * + * @method destroy + */ + destroy: function () { + InkArray.each(this.tooltips, function (tooltip) { + tooltip._destroy(); + }); + this.tooltips = null; + this.options = null; + } + }; + + EachTooltip.prototype = { + _oppositeDirections: { + left: 'right', + right: 'left', + up: 'down', + down: 'up' + }, + _init: function(root, elm) { + InkEvent.observe(elm, 'mouseover', Ink.bindEvent(this._onMouseOver, this)); + InkEvent.observe(elm, 'mouseout', Ink.bindEvent(this._onMouseOut, this)); + InkEvent.observe(elm, 'mousemove', Ink.bindEvent(this._onMouseMove, this)); + + this.root = root; + this.element = elm; + this._delayTimeout = null; + this.tooltip = null; + + Common.registerInstance(this, this.element); + }, + _makeTooltip: function (mousePosition) { + if (!this._getOpt('text') && + !this._getOpt('html') && + !InkElement.hasAttribute(this.element, 'title')) { + return false; + } + + var tooltip = this._createTooltipElement(); + + if (this.tooltip) { + this._removeTooltip(); + } + + this.tooltip = tooltip; + + this._fadeInTooltipElement(tooltip); + this._placeTooltipElement(tooltip, mousePosition); + + InkEvent.observe(tooltip, 'mouseover', Ink.bindEvent(this._onTooltipMouseOver, this)); + + var timeout = this._getFloatOpt('timeout'); + if (timeout) { + setTimeout(Ink.bind(function () { + if (this.tooltip === tooltip) { + this._removeTooltip(); + } + }, this), timeout * 1000); + } + }, + _createTooltipElement: function () { + var template = this._getOpt('template'), // User template instead of our HTML + templatefield = this._getOpt('templatefield'), + + tooltip, // The element we float + field; // Element where we write our message. Child or same as the above + + if (template) { // The user told us of a template to use. We copy it. + var temp = document.createElement('DIV'); + temp.innerHTML = Common.elOrSelector(template, 'options.template').outerHTML; + tooltip = temp.firstChild; + + if (templatefield) { + field = Selector.select(templatefield, tooltip); + if (field) { + field = field[0]; + } else { + throw 'options.templatefield must be a valid selector within options.template'; + } + } else { + field = tooltip; // Assume same element if user did not specify a field + } + } else { // We create the default structure + tooltip = document.createElement('DIV'); + Css.addClassName(tooltip, 'ink-tooltip'); + Css.addClassName(tooltip, this._getOpt('color')); + + field = document.createElement('DIV'); + Css.addClassName(field, 'content'); + + tooltip.appendChild(field); + } + + if (this._getOpt('html')) { + field.innerHTML = this._getOpt('html'); + } else if (this._getOpt('text')) { + InkElement.setTextContent(field, this._getOpt('text')); + } else { + InkElement.setTextContent(field, this.element.getAttribute('title')); + } + tooltip.style.display = 'block'; + tooltip.style.position = 'absolute'; + tooltip.style.zIndex = this._getIntOpt('zIndex'); + + return tooltip; + }, + _fadeInTooltipElement: function (tooltip) { + var fadeTime = this._getFloatOpt('fade'); + if (transitionDurationName && fadeTime) { + tooltip.style.opacity = '0'; + tooltip.style[transitionDurationName] = fadeTime + 's'; + tooltip.style[transitionPropertyName] = 'opacity'; + tooltip.style[transitionTimingFunctionName] = 'ease-in-out'; + setTimeout(function () { + tooltip.style.opacity = '1'; + }, 0); // Wait a tick + } + }, + _placeTooltipElement: function (tooltip, mousePosition) { + var where = this._getOpt('where'); + + if (where === 'mousemove' || where === 'mousefix') { + var mPos = mousePosition; + this._setPos(mPos[0], mPos[1]); + body.appendChild(tooltip); + } else if (where.match(/(up|down|left|right)/)) { + body.appendChild(tooltip); + var targetElementPos = InkElement.offset(this.element); + var tleft = targetElementPos[0], + ttop = targetElementPos[1]; + + var centerh = (InkElement.elementWidth(this.element) / 2) - (InkElement.elementWidth(tooltip) / 2), + centerv = (InkElement.elementHeight(this.element) / 2) - (InkElement.elementHeight(tooltip) / 2); + var spacing = this._getIntOpt('spacing'); + + var tooltipDims = InkElement.elementDimensions(tooltip); + var elementDims = InkElement.elementDimensions(this.element); + + var maxX = InkElement.scrollWidth() + InkElement.viewportWidth(); + var maxY = InkElement.scrollHeight() + InkElement.viewportHeight(); + + where = this._getWhereValueInsideViewport(where, { + left: tleft - tooltipDims[0], + right: tleft + tooltipDims[0], + top: ttop + tooltipDims[1], + bottom: ttop + tooltipDims[1] + }, { + right: maxX, + bottom: maxY + }); + + if (where === 'up') { + ttop -= tooltipDims[1]; + ttop -= spacing; + tleft += centerh; + } else if (where === 'down') { + ttop += elementDims[1]; + ttop += spacing; + tleft += centerh; + } else if (where === 'left') { + tleft -= tooltipDims[0]; + tleft -= spacing; + ttop += centerv; + } else if (where === 'right') { + tleft += elementDims[0]; + tleft += spacing; + ttop += centerv; + } + + var arrow = null; + if (where.match(/(up|down|left|right)/)) { + arrow = document.createElement('SPAN'); + Css.addClassName(arrow, 'arrow'); + Css.addClassName(arrow, this._oppositeDirections[where]); + tooltip.appendChild(arrow); + } + + var tooltipLeft = tleft; + var tooltipTop = ttop; + + var toBottom = (tooltipTop + tooltipDims[1]) - maxY; + var toRight = (tooltipLeft + tooltipDims[0]) - maxX; + var toLeft = 0 - tooltipLeft; + var toTop = 0 - tooltipTop; + + if (toBottom > 0) { + if (arrow) { arrow.style.top = (tooltipDims[1] / 2) + toBottom + 'px'; } + tooltipTop -= toBottom; + } else if (toTop > 0) { + if (arrow) { arrow.style.top = (tooltipDims[1] / 2) - toTop + 'px'; } + tooltipTop += toTop; + } else if (toRight > 0) { + if (arrow) { arrow.style.left = (tooltipDims[0] / 2) + toRight + 'px'; } + tooltipLeft -= toRight; + } else if (toLeft > 0) { + if (arrow) { arrow.style.left = (tooltipDims[0] / 2) - toLeft + 'px'; } + tooltipLeft += toLeft; + } + + tooltip.style.left = tooltipLeft + 'px'; + tooltip.style.top = tooltipTop + 'px'; + } + }, + + /** + * Get a value for "where" (left/right/up/down) which doesn't put the + * tooltip off the screen + * + * @method _getWhereValueInsideViewport + * @param where {String} "where" value which was given by the user and we might change + * @param bbox {BoundingBox} A bounding box like what you get from getBoundingClientRect ({top, bottom, left, right}) with pixel positions from the top left corner of the viewport. + * @param viewport {BoundingBox} Bounding box for the viewport. "top" and "left" are omitted because these coordinates are relative to the top-left corner of the viewport so they are zero. + * + * @TODO: we can't use getBoundingClientRect in this case because it returns {0,0,0,0} on our uncreated tooltip. + */ + _getWhereValueInsideViewport: function (where, bbox, viewport) { + if (where === 'left' && bbox.left < 0) { + return 'right'; + } else if (where === 'right' && bbox.right > viewport.right) { + return 'left'; + } else if (where === 'up' && bbox.top < 0) { + return 'down'; + } else if (where === 'down' && bbox.bottom > viewport.bottom) { + return 'up'; + } + + return where; + }, + _removeTooltip: function() { + var tooltip = this.tooltip; + if (!tooltip) {return;} + + var remove = Ink.bind(InkElement.remove, {}, tooltip); + + if (this._getOpt('where') !== 'mousemove' && transitionDurationName) { + tooltip.style.opacity = 0; + // remove() will operate on correct tooltip, although this.tooltip === null then + setTimeout(remove, this._getFloatOpt('fade') * 1000); + } else { + remove(); + } + this.tooltip = null; + }, + _getOpt: function (option) { + var dataAttrVal = InkElement.data(this.element)[InkElement._camelCase('tip-' + option)]; + if (dataAttrVal /* either null or "" may signify the absense of this attribute*/) { + return dataAttrVal; + } + var instanceOption = this.root.options[option]; + if (typeof instanceOption !== 'undefined') { + return instanceOption; + } + }, + _getIntOpt: function (option) { + return parseInt(this._getOpt(option), 10); + }, + _getFloatOpt: function (option) { + return parseFloat(this._getOpt(option), 10); + }, + _destroy: function () { + if (this.tooltip) { + InkElement.remove(this.tooltip); + } + this.root = null; // Cyclic reference = memory leaks + this.element = null; + this.tooltip = null; + }, + _onMouseOver: function(e) { + // on IE < 10 you can't access the mouse event not even a tick after it fired + var mousePosition = this._getMousePosition(e); + var delay = this._getFloatOpt('delay'); + if (delay) { + this._delayTimeout = setTimeout(Ink.bind(function () { + if (!this.tooltip) { + this._makeTooltip(mousePosition); + } + this._delayTimeout = null; + }, this), delay * 1000); + } else { + this._makeTooltip(mousePosition); + } + }, + _onMouseMove: function(e) { + if (this._getOpt('where') === 'mousemove' && this.tooltip) { + var mPos = this._getMousePosition(e); + this._setPos(mPos[0], mPos[1]); + } + }, + _onMouseOut: function () { + if (!this._getIntOpt('forever')) { + this._removeTooltip(); + } + if (this._delayTimeout) { + clearTimeout(this._delayTimeout); + this._delayTimeout = null; + } + }, + _onTooltipMouseOver: function () { + if (this.tooltip) { // If tooltip is already being removed, this has no effect + this._removeTooltip(); + } + }, + _setPos: function(left, top) { + left += this._getIntOpt('left'); + top += this._getIntOpt('top'); + var pageDims = this._getPageXY(); + if (this.tooltip) { + var elmDims = [InkElement.elementWidth(this.tooltip), InkElement.elementHeight(this.tooltip)]; + var scrollDim = this._getScroll(); + + if((elmDims[0] + left - scrollDim[0]) >= (pageDims[0] - 20)) { + left = (left - elmDims[0] - this._getIntOpt('left') - 10); + } + if((elmDims[1] + top - scrollDim[1]) >= (pageDims[1] - 20)) { + top = (top - elmDims[1] - this._getIntOpt('top') - 10); + } + + this.tooltip.style.left = left + 'px'; + this.tooltip.style.top = top + 'px'; + } + }, + _getPageXY: function() { + var cWidth = 0; + var cHeight = 0; + if( typeof( window.innerWidth ) === 'number' ) { + cWidth = window.innerWidth; + cHeight = window.innerHeight; + } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { + cWidth = document.documentElement.clientWidth; + cHeight = document.documentElement.clientHeight; + } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { + cWidth = document.body.clientWidth; + cHeight = document.body.clientHeight; + } + return [parseInt(cWidth, 10), parseInt(cHeight, 10)]; + }, + _getScroll: function() { + var dd = document.documentElement, db = document.body; + if (dd && (dd.scrollLeft || dd.scrollTop)) { + return [dd.scrollLeft, dd.scrollTop]; + } else if (db) { + return [db.scrollLeft, db.scrollTop]; + } else { + return [0, 0]; + } + }, + _getMousePosition: function(e) { + return [parseInt(InkEvent.pointerX(e), 10), parseInt(InkEvent.pointerY(e), 10)]; + } + }; + + return Tooltip; +}); diff --git a/public/js/ink.treeview.js b/public/js/ink.treeview.js new file mode 100644 index 0000000..0df8988 --- /dev/null +++ b/public/js/ink.treeview.js @@ -0,0 +1,244 @@ +/** + * Elements in a tree structure + * @module Ink.UI.TreeView_1 + * @version 1 + */ +Ink.createModule('Ink.UI.TreeView', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1'], function(Common, Event, Css, Element, Selector, InkArray ) { + 'use strict'; + + + /** + * Shows elements in a tree structure which can be expanded and contracted. + * A TreeView is built with "node"s and "children". "node"s are `li` tags, and "children" are `ul` tags. + * You can build your TreeView out of a regular UL and LI element structure which you already use to display lists with several levels. + * If you want a node to be open when the TreeView is built, just add the data-open="true" attribute to it. + * + * @class Ink.UI.TreeView + * @constructor + * @version 1 + * @param {String|DOMElement} selector Element or selector. + * @param {String} [options] Options object, containing: + * @param {String} [options.node] Selector for the nodes. Defaults to 'li'. + * @param {String} [options.children] Selector for the children. Defaults to 'ul'. + * @param {String} [options.parentClass] CSS classes to be added to parent nodes. Defaults to 'parent'. + * @param {String} [options.openClass] CSS classes to be added to the icon when a parent is open. Defaults to 'fa fa-minus-circle'. + * @param {String} [options.closedClass] CSS classes to be added to the icon when a parent is closed. Defaults to 'fa fa-plus-circle'. + * @param {String} [options.hideClass] CSS Class to toggle visibility of the children. Defaults to 'hide-all'. + * @param {String} [options.iconTag] The name of icon tag. The component tries to find a tag with that name as a direct child of the node. If it doesn't find it, it creates it. Defaults to 'i'. + * @param {Boolean} [options.stopDefault] Flag to stops the default behavior of the click handler. Defaults to true. + * @example + * + * + * + * @sample Ink_UI_TreeView_1.html + */ + function TreeView() { + Common.BaseUIComponent.apply(this, arguments); + } + + TreeView._name = 'TreeView_1'; + + TreeView._optionDefinition = { + 'node': ['String', 'li'], + // [3.0.1] Deprecate this terrible, terrible name + 'child': ['String',null], + 'children': ['String','ul'], + 'parentClass': ['String','parent'], + 'openNodeClass': ['String', 'open'], + 'openClass': ['String','fa fa-minus-circle'], + 'closedClass': ['String','fa fa-plus-circle'], + 'hideClass': ['String','hide-all'], + 'iconTag': ['String', 'i'], + 'stopDefault' : ['Boolean', true] + }; + + TreeView.prototype = { + /** + * Init function called by the constructor. Sets the necessary event handlers. + * + * @method _init + * @private + */ + _init: function(){ + if (this._options.child) { + Ink.warn('Ink.UI.TreeView: options.child is being renamed to options.children.'); + this._options.children = this._options.child; + } + + this._handlers = { + click: Ink.bindEvent(this._onClick,this) + }; + + Event.on(this._element, 'click', this._options.node, this._handlers.click); + + InkArray.each(Ink.ss(this._options.node, this._element), Ink.bind(function(item){ + if( this.isParent(item) ) { + Css.addClassName(item, this._options.parentClass); + + var isOpen = this.isOpen(item); + if( !this._getIcon(item) ){ + Element.create(this._options.iconTag, { insertTop: item }); + } + + this._setNodeOpen(item, isOpen); + } + },this)); + }, + + _getIcon: function (node) { + return Ink.s('> ' + this._options.iconTag, node); + }, + + /** + * Checks if a node is open. + * + * @method isOpen + * @param {DOMElement} node The tree node to check + **/ + isOpen: function (node) { + if (!this._getChild(node)) { + throw new Error('not a node!'); + } + + return Element.data(node).open === 'true' || + Css.hasClassName(node, this._options.openNodeClass); + }, + + /** + * Checks if a node is a parent. + * + * @method isParent + * @param {DOMElement} node Node to check + **/ + isParent: function (node) { + return Css.hasClassName(node, this._options.parentClass) || + this._getChild(node) != null; + }, + + _setNodeOpen: function (node, beOpen) { + var child = this._getChild(node); + if (child) { + Css.setClassName(child, this._options.hideClass, !beOpen); + var icon = this._getIcon(node); + + node.setAttribute('data-open', beOpen); + + /* + * Don't refactor this to + * + * setClassName(el, className, status); setClassName(el, className, !status); + * + * because it won't work with multiple classes. + * + * Doing: + * setClassName(el, 'fa fa-whatever', true);setClassName(el, 'fa fa-whatever-else', false); + * + * will remove 'fa' although it is a class we want. + */ + + var toAdd = beOpen ? this._options.openClass : this._options.closedClass; + var toRemove = beOpen ? this._options.closedClass : this._options.openClass; + Css.removeClassName(icon, toRemove); + Css.addClassName(icon, toAdd); + + Css.setClassName(node, this._options.openNodeClass, beOpen); + } else { + Ink.error('Ink.UI.TreeView: node', node, 'is not a node!'); + } + }, + + /** + * Opens one of the tree nodes + * + * Make sure you pass the node's DOMElement + * @method open + * @param {DOMElement} node The node you wish to open. + **/ + open: function (node) { + this._setNodeOpen(node, true); + }, + + /** + * Closes one of the tree nodes + * + * Make sure you pass the node's DOMElement + * @method close + * @param {DOMElement} node The node you wish to close. + **/ + close: function (node) { + this._setNodeOpen(node, false); + }, + + /** + * Toggles a node state + * + * @method toggle + * @param {DOMElement} node The node to toggle. + **/ + toggle: function (node) { + if (this.isOpen(node)) { + this.close(node); + } else { + this.open(node); + } + }, + + _getChild: function (node) { + return Selector.select(this._options.children, node)[0] || null; + }, + + /** + * Handles the click event (as specified in the _init function). + * + * @method _onClick + * @param {Event} event + * @private + */ + _onClick: function(ev){ + /** + * Summary: + * If the clicked element is a "node" as defined in the options, will check if it has any "child". + * If so, will toggle its state and stop the event's default behavior if the stopDefault option is true. + **/ + + if (!this.isParent(ev.currentTarget) || + Selector.matchesSelector(ev.target, this._options.node) || + Selector.matchesSelector(ev.target, this._options.children)) { + return; + } + + if (this._options.stopDefault){ + ev.preventDefault(); + } + + this.toggle(ev.currentTarget); + } + }; + + Common.createUIComponent(TreeView); + + return TreeView; +}); diff --git a/public/js/ink.upload.js b/public/js/ink.upload.js new file mode 100644 index 0000000..1b597fa --- /dev/null +++ b/public/js/ink.upload.js @@ -0,0 +1,906 @@ +Ink.createModule('Ink.UI.Upload', '1', [ + 'Ink.Dom.Event_1', + 'Ink.Dom.Element_1', + 'Ink.Dom.Browser_1', + 'Ink.UI.Common_1' +], function(Event, Element, Browser, Common) { + 'use strict'; + + var DirectoryReader = function(options) { + this.init(options); + }; + + DirectoryReader.prototype = { + init: function(options) { + this._options = Ink.extendObj({ + entry: undefined, + maxDepth: 10 + }, options || {}); + + try { + this._read(); + } catch(e) { + Ink.error(e); + } + }, + + + _read: function() { + if(!this._options.entry) { + Ink.error('You must specify the entry!'); + return; + } + + try { + this._readDirectories(); + } catch(e) { + Ink.error(e); + } + }, + + + _readDirectories: function() { + var entries = [], + running = false, + maxDepth = 0; + + /* TODO return as tree because much better well */ + var _readEntries = Ink.bind(function(currentEntry) { + var dir = currentEntry.createReader(); + running = true; + + dir.readEntries(Ink.bind(function(res) { + if(res.length > 0) { + for(var i = 0, len = res.length; i=0; i--) { + if(typeof(arr[i]) === 'undefined' || arr[i] === null || arr[i] === '') { + arr.splice(i, 1); + } + } + return arr; + } + }; + + var Queue = { + lists: [], + items: [], + + + /** + * Create new queue list + * @function create + * @public + * @param {String} list name + * @param {Function} function to iterate on items + * @return {Object} list id + */ + create: function(name) { + var id; + name = String(name); + this.lists.push({name: name}); + id = this.lists.length - 1; + return id; + }, + + + getItems: function(parentId) { + if(!parentId) { + return this.items; + } + var items = []; + for(var i = 0, len = this.items.length; i=0; i--) { + if(this.items[i] && id === this.items[i].parentId) { + this.remove(this.items[i].parentId, this.items[i].pid); + } + } + if(!keepList) { + this.lists.splice(id, 1); + } + return true; + } catch(e) { + Ink.error('Purge: invalid id'); + return false; + } + }, + + + /** + * add an item to a list + * @function add + * @public + * @param {String} name + * @param {Object} item + * @return {Number} pid + */ + add: function(parentId, item, priority) { + if(!this.lists[parentId]) { + return false; + } + if(typeof(item) !== 'object') { + item = String(item); + } + + var pid = parseInt(Math.round(Math.random() * 100000) + "" + Math.round(Math.random() * 100000), 10); + priority = priority || 0; + + this.items.push({parentId: parentId, item: item, priority: priority || 0, pid: pid}); + return pid; + }, + + + /** + * View list + * @function view + * @public + * @param {Number} list id + * @param {Number} process id + * @return {Object} item + */ + view: function(parentId, pid) { + var id = this._searchByPid(parentId, pid); + if(id === false) { + return false; + } + return this.items[id]; + }, + + + /** + * Remove an item + * @function remove + * @public + * @param {Object} item + * @return {Object|Boolean} removed item or false if not found + */ + remove: function(parentId, pid) { + try { + var id = this._searchByPid(parentId, pid); + if(id === false) { + return false; + } + this.items.splice(id, 1); + return true; + } catch(e) { + Ink.error('Remove: invalid id'); + return false; + } + }, + + _searchByPid: function(parentId, pid) { + if(!parentId && typeof(parentId) === 'boolean' || !pid) { + return false; + } + + parentId = parseInt(parentId, 10); + pid = parseInt(pid, 10); + + if(isNaN(parentId) || isNaN(pid)) { + return false; + } + + for(var i = 0, len = this.items.length; i this._options.minSizeToUseChunks; + }, + + + _dropEventHandler: function(ev) { + Event.stop(ev); + + this.publish('DropComplete', ev.dataTransfer); + + var data = ev.dataTransfer; + + if(!data || !data.files || !data.files.length) { + return false; + } + + this._files = data.files; + this._files = Array.prototype.slice.call(this._files || [], 0); + + // check if webkitGetAsEntry exists on first item + if(data.items && data.items[0] && data.items[0].webkitGetAsEntry) { + if(!this._options.foldersEnabled) { + return setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0); + } + var entry, folders = []; + for(var i = ev.dataTransfer.items.length-1; i>=0; i--) { + entry = ev.dataTransfer.items[i].webkitGetAsEntry(); + if(entry && entry.isDirectory) { + folders.push(entry); + this._files[i].isDirectory = true; + this._files.splice(i, 1); + } + } + // starting callback hell + this._addFolderToQueue(folders, Ink.bind(function() { + setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0); + }, this)); + } else { + setTimeout(Ink.bind(this._addFilesToQueue, this, this._files), 0); + } + + return true; + }, + + + _addFolderToQueue: function(folders, cb) { + var files = [], invalidFolders = {}; + + if(!folders || !folders.length) { + cb(); + return files; + } + + var getFiles = function(entries) { + var files = []; + for(var i = 0, len = entries.length; i this._options.maxFilesize) { + this.publish('MaxSizeFailure', file, this._options.maxFilesize); + continue; + } + + fileID = parseInt(Math.round(Math.random() * 100000) + "" + Math.round(Math.random() * 100000), 10); + o = { id: i, data: file, fileID: fileID, directory: file.isDirectory }; + Queue.add(this._queueId, o); + + this.publish('FileAddedToQueue', o); + } + this._processQueue(true); + this._files = []; + }, + + + _processQueue: function(internalUpload) { + if(this._queueRunning) { + return false; + } + + this.running = 0; + var max = 1, i = 0, items, + queueLen = Queue.items.length; + this._queueRunning = true; + + this.interval = setInterval(Ink.bind(function() { + if(Queue.items.length === i && this.running === 0) { + Queue.purge(this._queueId, true); + this._queueRunning = false; + clearInterval(this.interval); + this.publish('QueueEnd', this._queueId, queueLen); + } + + items = Queue.getItems(this._queueId); + + if(this.running < max && items[i]) { + if(!items[i].canceled) { + _doRequest.call(this, items[i].pid, items[i].item.data, items[i].item.fileID, items[i].item.directory, internalUpload); + this.running++; + i++; + } else { + var j = i; + while(items[j] && items[j].canceled) { + i++; + j++; + } + } + return true; + } + return false; + }, this), 100); + + + var _doRequest = function(pid, data, fileID, directory, internalUpload) { + var o = { + file: data, + fileID: fileID, + cb: Ink.bind(function() { + this.running--; + }, this) + }; + if(internalUpload) { + if(directory) { + // do magic + o.cb(); + } else { + this._upload(o); + } + } + }; + + return true; + }, + + + _upload: function(o) { + var file = o.file, + xhr = new XMLHttpRequest(), + fileID = o.fileID; + + this.publish('BeforeUpload', file, this._options.extraData, fileID, xhr, this._supportChunks(file.size)); + + var forceAbort = function(showError) { + if(o.cb && typeof(o.cb === 'function')) { + o.cb(); + } + + this.publish('OnProgress', { + length: file.size, + lengthComputable: true, + loaded: file.size, + total: file.size + }, file, fileID); + this.publish('EndUpload', file, fileID, (showError ? { error: true } : true)); + this.publish('InvalidFile', file, 'name'); + xhr.abort(); + }; + + if(this._options.INVALID_FILE_NAME && this._options.INVALID_FILE_NAME instanceof RegExp) { + if(this._options.INVALID_FILE_NAME.test(o.file.name)) { + forceAbort.call(this); + return; + } + } + + // If file was renamed, abort it + // FU OPERA: Opera always return lastModified date as null + if(!file.lastModifiedDate && !Ink.Dom.Browser.OPERA) { + forceAbort.call(this, true); + return; + } + + xhr.upload.onprogress = Ink.bind(this.publish, this, 'OnProgress', file, fileID); + + var endpoint, method; + if(this._supportChunks(file.size)) { + if(file.size <= file.chunk_offset) { + endpoint = this._options.endpointChunkCommit; + method = 'POST'; + } else { + endpoint = this._options.endpointChunk; + if(file.chunk_upload_id) { + endpoint += '?upload_id=' + file.chunk_upload_id; + } + if(file.chunk_offset) { + endpoint += '&offset=' + file.chunk_offset; + } + method = 'PUT'; + } + } else { + endpoint = this._options.endpoint; + method = 'POST'; + } + + xhr.open(method, endpoint, true); + xhr.withCredentials = true; + xhr.setRequestHeader("x-requested-with", "XMLHttpRequest"); + if(this._supportChunks(file.size)) { + xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + } + + var fd = new FormData(), + blob; + + if("Blob" in window && typeof Blob === 'function') { + blob = new Blob([file], { type: file.type }); + if(this._supportChunks(file.size)) { + file.chunk_offset = file.chunk_offset || 0; + blob = blob.slice(file.chunk_offset, file.chunk_offset + this._options.chunkSize); + } else { + fd.append(this._options.fileFormName, blob, file.name); + } + } else { + fd.append(this._options.fileFormName, file); + } + + if(!this._supportChunks(file.size)) { + for(var k in this._options.extraData) { + if(this._options.extraData.hasOwnProperty(k)) { + fd.append(k, this._options.extraData[k]); + } + } + } else { + fd.append('upload_id', file.chunk_upload_id); + fd.append('path', file.upload_path); + } + + if(!file.hasParent) { + if(!this._supportChunks(file.size)) { + xhr.send(fd); + } else { + if(file.size <= file.chunk_offset) { + xhr.send('upload_id=' + file.chunk_upload_id + '&path=' + file.upload_path + '/' + file.name); + } else { + xhr.send(blob); + } + } + } else { + this.publish('cbCreateFolder', file.parentID, file.fullPath, this._options.extraData, this._folders, file.rootPath, Ink.bind(function() { + if(!this._supportChunks(file.size)) { + xhr.send(fd); + } else { + if(file.size <= file.chunk_offset) { + xhr.send('upload_id=' + file.chunk_upload_id + '&path=' + file.upload_path + '/' + file.name); + } else { + xhr.send(blob); + } + } + }, this)); + } + + + xhr.onload = Ink.bindEvent(function() { + /* jshint boss:true */ + if(this._supportChunks(file.size) && file.size > file.chunk_offset) { + if(xhr.response) { + var response = JSON.parse(xhr.response); + + // check expected offset + var invalidOffset = file.chunk_offset && response.offset !== (file.chunk_offset + this._options.chunkSize) && file.size !== response.offset; + if(invalidOffset) { + if(o.cb) { + o.cb(); + } + this.publish('ErrorUpload', file, fileID); + } else { + file.chunk_upload_id = response.upload_id; + file.chunk_offset = response.offset; + file.chunk_expires = response.expires; + this._upload(o); + } + } else { + if(o.cb) { + o.cb(); + } + this.publish('ErrorUpload', file, fileID); + } + return (xhr = null); + } + + if(o.cb) { + o.cb(); + } + + if(xhr.responseText && xhr['status'] < 400) { + this.publish('EndUpload', file, fileID, xhr.responseText); + } else { + this.publish('ErrorUpload', file, fileID); + } + return (xhr = null); + }, this); + + + xhr.onerror = Ink.bindEvent(function() { + if(o.cb) { + o.cb(); + } + this.publish('ErrorUpload', file, fileID); + }, this); + + xhr.onabort = Ink.bindEvent(function() { + if(o.cb) { + o.cb(); + } + this.publish('AbortUpload', file, fileID, { + abortAll: Ink.bind(this.abortAll, this), + abortOne: Ink.bind(this.abortOne, this) + }); + }, this); + }, + + + abortAll: function() { + if(!this._queueRunning) { + return false; + } + clearInterval(this.interval); + this._queueRunning = false; + Queue.purge(this._queueId, true); + return true; + }, + + abortOne: function(id, cb) { + var items = Queue.getItems(0), + o; + for(var i = 0, len = items.length; i element. This information allows you to progressively enhance + * your pages with a granular level of control over the experience. + * + * Modernizr has an optional (not included) conditional resource loader + * called Modernizr.load(), based on Yepnope.js (yepnopejs.com). + * To get a build that includes Modernizr.load(), as well as choosing + * which tests to include, go to www.modernizr.com/download/ + * + * Authors Faruk Ates, Paul Irish, Alex Sexton + * Contributors Ryan Seddon, Ben Alman + */ + +window.Modernizr = (function( window, document, undefined ) { + + var version = '2.6.3', + + Modernizr = {}, + + /*>>cssclasses*/ + // option for enabling the HTML classes to be added + enableClasses = true, + /*>>cssclasses*/ + + docElement = document.documentElement, + + /** + * Create our "modernizr" element that we do most feature tests on. + */ + mod = 'modernizr', + modElem = document.createElement(mod), + mStyle = modElem.style, + + /** + * Create the input element for various Web Forms feature tests. + */ + inputElem /*>>inputelem*/ = document.createElement('input') /*>>inputelem*/ , + + /*>>smile*/ + smile = ':)', + /*>>smile*/ + + toString = {}.toString, + + // TODO :: make the prefixes more granular + /*>>prefixes*/ + // List of property values to set for css tests. See ticket #21 + prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), + /*>>prefixes*/ + + /*>>domprefixes*/ + // Following spec is to expose vendor-specific style properties as: + // elem.style.WebkitBorderRadius + // and the following would be incorrect: + // elem.style.webkitBorderRadius + + // Webkit ghosts their properties in lowercase but Opera & Moz do not. + // Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+ + // erik.eae.net/archives/2008/03/10/21.48.10/ + + // More here: github.com/Modernizr/Modernizr/issues/issue/21 + omPrefixes = 'Webkit Moz O ms', + + cssomPrefixes = omPrefixes.split(' '), + + domPrefixes = omPrefixes.toLowerCase().split(' '), + /*>>domprefixes*/ + + /*>>ns*/ + ns = {'svg': 'http://www.w3.org/2000/svg'}, + /*>>ns*/ + + tests = {}, + inputs = {}, + attrs = {}, + + classes = [], + + slice = classes.slice, + + featureName, // used in testing loop + + + /*>>teststyles*/ + // Inject element with style element and some CSS rules + injectElementWithStyles = function( rule, callback, nodes, testnames ) { + + var style, ret, node, docOverflow, + div = document.createElement('div'), + // After page load injecting a fake body doesn't work so check if body exists + body = document.body, + // IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it. + fakeBody = body || document.createElement('body'); + + if ( parseInt(nodes, 10) ) { + // In order not to give false positives we create a node for each test + // This also allows the method to scale for unspecified uses + while ( nodes-- ) { + node = document.createElement('div'); + node.id = testnames ? testnames[nodes] : mod + (nodes + 1); + div.appendChild(node); + } + } + + // '].join(''); + div.id = mod; + // IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody. + // Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270 + (body ? div : fakeBody).innerHTML += style; + fakeBody.appendChild(div); + if ( !body ) { + //avoid crashing IE8, if background image is used + fakeBody.style.background = ''; + //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible + fakeBody.style.overflow = 'hidden'; + docOverflow = docElement.style.overflow; + docElement.style.overflow = 'hidden'; + docElement.appendChild(fakeBody); + } + + ret = callback(div, rule); + // If this is done after page load we don't want to remove the body so check if body exists + if ( !body ) { + fakeBody.parentNode.removeChild(fakeBody); + docElement.style.overflow = docOverflow; + } else { + div.parentNode.removeChild(div); + } + + return !!ret; + + }, + /*>>teststyles*/ + + /*>>mq*/ + // adapted from matchMedia polyfill + // by Scott Jehl and Paul Irish + // gist.github.com/786768 + testMediaQuery = function( mq ) { + + var matchMedia = window.matchMedia || window.msMatchMedia; + if ( matchMedia ) { + return matchMedia(mq).matches; + } + + var bool; + + injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) { + bool = (window.getComputedStyle ? + getComputedStyle(node, null) : + node.currentStyle)['position'] == 'absolute'; + }); + + return bool; + + }, + /*>>mq*/ + + + /*>>hasevent*/ + // + // isEventSupported determines if a given element supports the given event + // kangax.github.com/iseventsupported/ + // + // The following results are known incorrects: + // Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative + // Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333 + // ... + isEventSupported = (function() { + + var TAGNAMES = { + 'select': 'input', 'change': 'input', + 'submit': 'form', 'reset': 'form', + 'error': 'img', 'load': 'img', 'abort': 'img' + }; + + function isEventSupported( eventName, element ) { + + element = element || document.createElement(TAGNAMES[eventName] || 'div'); + eventName = 'on' + eventName; + + // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those + var isSupported = eventName in element; + + if ( !isSupported ) { + // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element + if ( !element.setAttribute ) { + element = document.createElement('div'); + } + if ( element.setAttribute && element.removeAttribute ) { + element.setAttribute(eventName, ''); + isSupported = is(element[eventName], 'function'); + + // If property was created, "remove it" (by setting value to `undefined`) + if ( !is(element[eventName], 'undefined') ) { + element[eventName] = undefined; + } + element.removeAttribute(eventName); + } + } + + element = null; + return isSupported; + } + return isEventSupported; + })(), + /*>>hasevent*/ + + // TODO :: Add flag for hasownprop ? didn't last time + + // hasOwnProperty shim by kangax needed for Safari 2.0 support + _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp; + + if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) { + hasOwnProp = function (object, property) { + return _hasOwnProperty.call(object, property); + }; + } + else { + hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ + return ((property in object) && is(object.constructor.prototype[property], 'undefined')); + }; + } + + // Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js + // es5.github.com/#x15.3.4.5 + + if (!Function.prototype.bind) { + Function.prototype.bind = function bind(that) { + + var target = this; + + if (typeof target != "function") { + throw new TypeError(); + } + + var args = slice.call(arguments, 1), + bound = function () { + + if (this instanceof bound) { + + var F = function(){}; + F.prototype = target.prototype; + var self = new F(); + + var result = target.apply( + self, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return self; + + } else { + + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + + } + + }; + + return bound; + }; + } + + /** + * setCss applies given styles to the Modernizr DOM node. + */ + function setCss( str ) { + mStyle.cssText = str; + } + + /** + * setCssAll extrapolates all vendor-specific css strings. + */ + function setCssAll( str1, str2 ) { + return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); + } + + /** + * is returns a boolean for if typeof obj is exactly type. + */ + function is( obj, type ) { + return typeof obj === type; + } + + /** + * contains returns a boolean for if substr is found within str. + */ + function contains( str, substr ) { + return !!~('' + str).indexOf(substr); + } + + /*>>testprop*/ + + // testProps is a generic CSS / DOM property test. + + // In testing support for a given CSS property, it's legit to test: + // `elem.style[styleName] !== undefined` + // If the property is supported it will return an empty string, + // if unsupported it will return undefined. + + // We'll take advantage of this quick test and skip setting a style + // on our modernizr element, but instead just testing undefined vs + // empty string. + + // Because the testing of the CSS property names (with "-", as + // opposed to the camelCase DOM properties) is non-portable and + // non-standard but works in WebKit and IE (but not Gecko or Opera), + // we explicitly reject properties with dashes so that authors + // developing in WebKit or IE first don't end up with + // browser-specific content by accident. + + function testProps( props, prefixed ) { + for ( var i in props ) { + var prop = props[i]; + if ( !contains(prop, "-") && mStyle[prop] !== undefined ) { + return prefixed == 'pfx' ? prop : true; + } + } + return false; + } + /*>>testprop*/ + + // TODO :: add testDOMProps + /** + * testDOMProps is a generic DOM property test; if a browser supports + * a certain property, it won't return undefined for it. + */ + function testDOMProps( props, obj, elem ) { + for ( var i in props ) { + var item = obj[props[i]]; + if ( item !== undefined) { + + // return the property name as a string + if (elem === false) return props[i]; + + // let's bind a function + if (is(item, 'function')){ + // default to autobind unless override + return item.bind(elem || obj); + } + + // return the unbound function or obj or value + return item; + } + } + return false; + } + + /*>>testallprops*/ + /** + * testPropsAll tests a list of DOM properties we want to check against. + * We specify literally ALL possible (known and/or likely) properties on + * the element including the non-vendor prefixed one, for forward- + * compatibility. + */ + function testPropsAll( prop, prefixed, elem ) { + + var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), + props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); + + // did they call .prefixed('boxSizing') or are we just testing a prop? + if(is(prefixed, "string") || is(prefixed, "undefined")) { + return testProps(props, prefixed); + + // otherwise, they called .prefixed('requestAnimationFrame', window[, elem]) + } else { + props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); + return testDOMProps(props, prefixed, elem); + } + } + /*>>testallprops*/ + + + /** + * Tests + * ----- + */ + + // The *new* flexbox + // dev.w3.org/csswg/css3-flexbox + + tests['flexbox'] = function() { + return testPropsAll('flexWrap'); + }; + + // The *old* flexbox + // www.w3.org/TR/2009/WD-css3-flexbox-20090723/ + + tests['flexboxlegacy'] = function() { + return testPropsAll('boxDirection'); + }; + + // On the S60 and BB Storm, getContext exists, but always returns undefined + // so we actually have to call getContext() to verify + // github.com/Modernizr/Modernizr/issues/issue/97/ + + tests['canvas'] = function() { + var elem = document.createElement('canvas'); + return !!(elem.getContext && elem.getContext('2d')); + }; + + tests['canvastext'] = function() { + return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function')); + }; + + // webk.it/70117 is tracking a legit WebGL feature detect proposal + + // We do a soft detect which may false positive in order to avoid + // an expensive context creation: bugzil.la/732441 + + tests['webgl'] = function() { + return !!window.WebGLRenderingContext; + }; + + /* + * The Modernizr.touch test only indicates if the browser supports + * touch events, which does not necessarily reflect a touchscreen + * device, as evidenced by tablets running Windows 7 or, alas, + * the Palm Pre / WebOS (touch) phones. + * + * Additionally, Chrome (desktop) used to lie about its support on this, + * but that has since been rectified: crbug.com/36415 + * + * We also test for Firefox 4 Multitouch Support. + * + * For more info, see: modernizr.github.com/Modernizr/touch.html + */ + + tests['touch'] = function() { + var bool; + + if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { + bool = true; + } else { + injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) { + bool = node.offsetTop === 9; + }); + } + + return bool; + }; + + + // geolocation is often considered a trivial feature detect... + // Turns out, it's quite tricky to get right: + // + // Using !!navigator.geolocation does two things we don't want. It: + // 1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513 + // 2. Disables page caching in WebKit: webk.it/43956 + // + // Meanwhile, in Firefox < 8, an about:config setting could expose + // a false positive that would throw an exception: bugzil.la/688158 + + tests['geolocation'] = function() { + return 'geolocation' in navigator; + }; + + + tests['postmessage'] = function() { + return !!window.postMessage; + }; + + + // Chrome incognito mode used to throw an exception when using openDatabase + // It doesn't anymore. + tests['websqldatabase'] = function() { + return !!window.openDatabase; + }; + + // Vendors had inconsistent prefixing with the experimental Indexed DB: + // - Webkit's implementation is accessible through webkitIndexedDB + // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB + // For speed, we don't test the legacy (and beta-only) indexedDB + tests['indexedDB'] = function() { + return !!testPropsAll("indexedDB", window); + }; + + // documentMode logic from YUI to filter out IE8 Compat Mode + // which false positives. + tests['hashchange'] = function() { + return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7); + }; + + // Per 1.6: + // This used to be Modernizr.historymanagement but the longer + // name has been deprecated in favor of a shorter and property-matching one. + // The old API is still available in 1.6, but as of 2.0 will throw a warning, + // and in the first release thereafter disappear entirely. + tests['history'] = function() { + return !!(window.history && history.pushState); + }; + + tests['draganddrop'] = function() { + var div = document.createElement('div'); + return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div); + }; + + // FF3.6 was EOL'ed on 4/24/12, but the ESR version of FF10 + // will be supported until FF19 (2/12/13), at which time, ESR becomes FF17. + // FF10 still uses prefixes, so check for it until then. + // for more ESR info, see: mozilla.org/en-US/firefox/organizations/faq/ + tests['websockets'] = function() { + return 'WebSocket' in window || 'MozWebSocket' in window; + }; + + + // css-tricks.com/rgba-browser-support/ + tests['rgba'] = function() { + // Set an rgba() color and check the returned value + + setCss('background-color:rgba(150,255,150,.5)'); + + return contains(mStyle.backgroundColor, 'rgba'); + }; + + tests['hsla'] = function() { + // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally, + // except IE9 who retains it as hsla + + setCss('background-color:hsla(120,40%,100%,.5)'); + + return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla'); + }; + + tests['multiplebgs'] = function() { + // Setting multiple images AND a color on the background shorthand property + // and then querying the style.background property value for the number of + // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! + + setCss('background:url(https://),url(https://),red url(https://)'); + + // If the UA supports multiple backgrounds, there should be three occurrences + // of the string "url(" in the return value for elemStyle.background + + return (/(url\s*\(.*?){3}/).test(mStyle.background); + }; + + + + // this will false positive in Opera Mini + // github.com/Modernizr/Modernizr/issues/396 + + tests['backgroundsize'] = function() { + return testPropsAll('backgroundSize'); + }; + + tests['borderimage'] = function() { + return testPropsAll('borderImage'); + }; + + + // Super comprehensive table about all the unique implementations of + // border-radius: muddledramblings.com/table-of-css3-border-radius-compliance + + tests['borderradius'] = function() { + return testPropsAll('borderRadius'); + }; + + // WebOS unfortunately false positives on this test. + tests['boxshadow'] = function() { + return testPropsAll('boxShadow'); + }; + + // FF3.0 will false positive on this test + tests['textshadow'] = function() { + return document.createElement('div').style.textShadow === ''; + }; + + + tests['opacity'] = function() { + // Browsers that actually have CSS Opacity implemented have done so + // according to spec, which means their return values are within the + // range of [0.0,1.0] - including the leading zero. + + setCssAll('opacity:.55'); + + // The non-literal . in this regex is intentional: + // German Chrome returns this value as 0,55 + // github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632 + return (/^0.55$/).test(mStyle.opacity); + }; + + + // Note, Android < 4 will pass this test, but can only animate + // a single property at a time + // daneden.me/2011/12/putting-up-with-androids-bullshit/ + tests['cssanimations'] = function() { + return testPropsAll('animationName'); + }; + + + tests['csscolumns'] = function() { + return testPropsAll('columnCount'); + }; + + + tests['cssgradients'] = function() { + /** + * For CSS Gradients syntax, please see: + * webkit.org/blog/175/introducing-css-gradients/ + * developer.mozilla.org/en/CSS/-moz-linear-gradient + * developer.mozilla.org/en/CSS/-moz-radial-gradient + * dev.w3.org/csswg/css3-images/#gradients- + */ + + var str1 = 'background-image:', + str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', + str3 = 'linear-gradient(left top,#9f9, white);'; + + setCss( + // legacy webkit syntax (FIXME: remove when syntax not in use anymore) + (str1 + '-webkit- '.split(' ').join(str2 + str1) + + // standard syntax // trailing 'background-image:' + prefixes.join(str3 + str1)).slice(0, -str1.length) + ); + + return contains(mStyle.backgroundImage, 'gradient'); + }; + + + tests['cssreflections'] = function() { + return testPropsAll('boxReflect'); + }; + + + tests['csstransforms'] = function() { + return !!testPropsAll('transform'); + }; + + + tests['csstransforms3d'] = function() { + + var ret = !!testPropsAll('perspective'); + + // Webkit's 3D transforms are passed off to the browser's own graphics renderer. + // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in + // some conditions. As a result, Webkit typically recognizes the syntax but + // will sometimes throw a false positive, thus we must do a more thorough check: + if ( ret && 'webkitPerspective' in docElement.style ) { + + // Webkit allows this media query to succeed only if the feature is enabled. + // `@media (transform-3d),(-webkit-transform-3d){ ... }` + injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) { + ret = node.offsetLeft === 9 && node.offsetHeight === 3; + }); + } + return ret; + }; + + + tests['csstransitions'] = function() { + return testPropsAll('transition'); + }; + + + /*>>fontface*/ + // @font-face detection routine by Diego Perini + // javascript.nwbox.com/CSSSupport/ + + // false positives: + // WebOS github.com/Modernizr/Modernizr/issues/342 + // WP7 github.com/Modernizr/Modernizr/issues/538 + tests['fontface'] = function() { + var bool; + + injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) { + var style = document.getElementById('smodernizr'), + sheet = style.sheet || style.styleSheet, + cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : ''; + + bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0; + }); + + return bool; + }; + /*>>fontface*/ + + // CSS generated content detection + tests['generatedcontent'] = function() { + var bool; + + injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) { + bool = node.offsetHeight >= 3; + }); + + return bool; + }; + + + + // These tests evaluate support of the video/audio elements, as well as + // testing what types of content they support. + // + // We're using the Boolean constructor here, so that we can extend the value + // e.g. Modernizr.video // true + // Modernizr.video.ogg // 'probably' + // + // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845 + // thx to NielsLeenheer and zcorpan + + // Note: in some older browsers, "no" was a return value instead of empty string. + // It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2 + // It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5 + + tests['video'] = function() { + var elem = document.createElement('video'), + bool = false; + + // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224 + try { + if ( bool = !!elem.canPlayType ) { + bool = new Boolean(bool); + bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,''); + + // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 + bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,''); + + bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,''); + } + + } catch(e) { } + + return bool; + }; + + tests['audio'] = function() { + var elem = document.createElement('audio'), + bool = false; + + try { + if ( bool = !!elem.canPlayType ) { + bool = new Boolean(bool); + bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,''); + bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,''); + + // Mimetypes accepted: + // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements + // bit.ly/iphoneoscodecs + bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,''); + bool.m4a = ( elem.canPlayType('audio/x-m4a;') || + elem.canPlayType('audio/aac;')) .replace(/^no$/,''); + } + } catch(e) { } + + return bool; + }; + + + // In FF4, if disabled, window.localStorage should === null. + + // Normally, we could not test that directly and need to do a + // `('localStorage' in window) && ` test first because otherwise Firefox will + // throw bugzil.la/365772 if cookies are disabled + + // Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem + // will throw the exception: + // QUOTA_EXCEEDED_ERRROR DOM Exception 22. + // Peculiarly, getItem and removeItem calls do not throw. + + // Because we are forced to try/catch this, we'll go aggressive. + + // Just FWIW: IE8 Compat mode supports these features completely: + // www.quirksmode.org/dom/html5.html + // But IE8 doesn't support either with local files + + tests['localstorage'] = function() { + try { + localStorage.setItem(mod, mod); + localStorage.removeItem(mod); + return true; + } catch(e) { + return false; + } + }; + + tests['sessionstorage'] = function() { + try { + sessionStorage.setItem(mod, mod); + sessionStorage.removeItem(mod); + return true; + } catch(e) { + return false; + } + }; + + + tests['webworkers'] = function() { + return !!window.Worker; + }; + + + tests['applicationcache'] = function() { + return !!window.applicationCache; + }; + + + // Thanks to Erik Dahlstrom + tests['svg'] = function() { + return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; + }; + + // specifically for SVG inline in HTML, not within XHTML + // test page: paulirish.com/demo/inline-svg + tests['inlinesvg'] = function() { + var div = document.createElement('div'); + div.innerHTML = ''; + return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; + }; + + // SVG SMIL animation + tests['smil'] = function() { + return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate'))); + }; + + // This test is only for clip paths in SVG proper, not clip paths on HTML content + // demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg + + // However read the comments to dig into applying SVG clippaths to HTML content here: + // github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491 + tests['svgclippaths'] = function() { + return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); + }; + + /*>>webforms*/ + // input features and input types go directly onto the ret object, bypassing the tests loop. + // Hold this guy to execute in a moment. + function webforms() { + /*>>input*/ + // Run through HTML5's new input attributes to see if the UA understands any. + // We're using f which is the element created early on + // Mike Taylr has created a comprehensive resource for testing these attributes + // when applied to all input types: + // miketaylr.com/code/input-type-attr.html + // spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary + + // Only input placeholder is tested while textarea's placeholder is not. + // Currently Safari 4 and Opera 11 have support only for the input placeholder + // Both tests are available in feature-detects/forms-placeholder.js + Modernizr['input'] = (function( props ) { + for ( var i = 0, len = props.length; i < len; i++ ) { + attrs[ props[i] ] = !!(props[i] in inputElem); + } + if (attrs.list){ + // safari false positive's on datalist: webk.it/74252 + // see also github.com/Modernizr/Modernizr/issues/146 + attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement); + } + return attrs; + })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); + /*>>input*/ + + /*>>inputtypes*/ + // Run through HTML5's new input types to see if the UA understands any. + // This is put behind the tests runloop because it doesn't return a + // true/false like all the other tests; instead, it returns an object + // containing each input type with its corresponding true/false value + + // Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/ + Modernizr['inputtypes'] = (function(props) { + + for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) { + + inputElem.setAttribute('type', inputElemType = props[i]); + bool = inputElem.type !== 'text'; + + // We first check to see if the type we give it sticks.. + // If the type does, we feed it a textual value, which shouldn't be valid. + // If the value doesn't stick, we know there's input sanitization which infers a custom UI + if ( bool ) { + + inputElem.value = smile; + inputElem.style.cssText = 'position:absolute;visibility:hidden;'; + + if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) { + + docElement.appendChild(inputElem); + defaultView = document.defaultView; + + // Safari 2-4 allows the smiley as a value, despite making a slider + bool = defaultView.getComputedStyle && + defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' && + // Mobile android web browser has false positive, so must + // check the height to see if the widget is actually there. + (inputElem.offsetHeight !== 0); + + docElement.removeChild(inputElem); + + } else if ( /^(search|tel)$/.test(inputElemType) ){ + // Spec doesn't define any special parsing or detectable UI + // behaviors so we pass these through as true + + // Interestingly, opera fails the earlier test, so it doesn't + // even make it here. + + } else if ( /^(url|email)$/.test(inputElemType) ) { + // Real url and email support comes with prebaked validation. + bool = inputElem.checkValidity && inputElem.checkValidity() === false; + + } else { + // If the upgraded input compontent rejects the :) text, we got a winner + bool = inputElem.value != smile; + } + } + + inputs[ props[i] ] = !!bool; + } + return inputs; + })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); + /*>>inputtypes*/ + } + /*>>webforms*/ + + + // End of test definitions + // ----------------------- + + + + // Run through all tests and detect their support in the current UA. + // todo: hypothetically we could be doing an array of tests and use a basic loop here. + for ( var feature in tests ) { + if ( hasOwnProp(tests, feature) ) { + // run the test, throw the return value into the Modernizr, + // then based on that boolean, define an appropriate className + // and push it into an array of classes we'll join later. + featureName = feature.toLowerCase(); + Modernizr[featureName] = tests[feature](); + + classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); + } + } + + /*>>webforms*/ + // input tests need to run. + Modernizr.input || webforms(); + /*>>webforms*/ + + + /** + * addTest allows the user to define their own feature tests + * the result will be added onto the Modernizr object, + * as well as an appropriate className set on the html element + * + * @param feature - String naming the feature + * @param test - Function returning true if feature is supported, false if not + */ + Modernizr.addTest = function ( feature, test ) { + if ( typeof feature == 'object' ) { + for ( var key in feature ) { + if ( hasOwnProp( feature, key ) ) { + Modernizr.addTest( key, feature[ key ] ); + } + } + } else { + + feature = feature.toLowerCase(); + + if ( Modernizr[feature] !== undefined ) { + // we're going to quit if you're trying to overwrite an existing test + // if we were to allow it, we'd do this: + // var re = new RegExp("\\b(no-)?" + feature + "\\b"); + // docElement.className = docElement.className.replace( re, '' ); + // but, no rly, stuff 'em. + return Modernizr; + } + + test = typeof test == 'function' ? test() : test; + + if (typeof enableClasses !== "undefined" && enableClasses) { + docElement.className += ' ' + (test ? '' : 'no-') + feature; + } + Modernizr[feature] = test; + + } + + return Modernizr; // allow chaining. + }; + + + // Reset modElem.cssText to nothing to reduce memory footprint. + setCss(''); + modElem = inputElem = null; + + /*>>shiv*/ + /*! HTML5 Shiv v3.6.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */ + ;(function(window, document) { + /*jshint evil:true */ + /** Preset options */ + var options = window.html5 || {}; + + /** Used to skip problem elements */ + var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; + + /** Not all elements can be cloned in IE **/ + var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; + + /** Detect whether the browser supports default html5 styles */ + var supportsHtml5Styles; + + /** Name of the expando, to work with multiple documents or to re-shiv one document */ + var expando = '_html5shiv'; + + /** The id for the the documents expando */ + var expanID = 0; + + /** Cached data for each document */ + var expandoData = {}; + + /** Detect whether the browser supports unknown elements */ + var supportsUnknownElements; + + (function() { + try { + var a = document.createElement('a'); + a.innerHTML = ''; + //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles + supportsHtml5Styles = ('hidden' in a); + + supportsUnknownElements = a.childNodes.length == 1 || (function() { + // assign a false positive if unable to shiv + (document.createElement)('a'); + var frag = document.createDocumentFragment(); + return ( + typeof frag.cloneNode == 'undefined' || + typeof frag.createDocumentFragment == 'undefined' || + typeof frag.createElement == 'undefined' + ); + }()); + } catch(e) { + supportsHtml5Styles = true; + supportsUnknownElements = true; + } + + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a style sheet with the given CSS text and adds it to the document. + * @private + * @param {Document} ownerDocument The document. + * @param {String} cssText The CSS text. + * @returns {StyleSheet} The style element. + */ + function addStyleSheet(ownerDocument, cssText) { + var p = ownerDocument.createElement('p'), + parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; + + p.innerHTML = 'x'; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + /** + * Returns the value of `html5.elements` as an array. + * @private + * @returns {Array} An array of shived element node names. + */ + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + /** + * Returns the data associated to the given document + * @private + * @param {Document} ownerDocument The document. + * @returns {Object} An object of data. + */ + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + /** + * returns a shived element for the given nodeName and document + * @memberOf html5 + * @param {String} nodeName name of the element + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived element. + */ + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + // Avoid adding some elements to fragments in IE < 9 because + // * Attributes like `name` or `type` cannot be set/changed once an element + // is inserted into a document/fragment + // * Link elements with `src` attributes that are inaccessible, as with + // a 403 response, will cause the tab/window to crash + // * Script elements appended to fragments will execute when their `src` + // or `text` property is set + return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node; + } + + /** + * returns a shived DocumentFragment for the given document + * @memberOf html5 + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived DocumentFragment. + */ + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;i>shiv*/ + + // Assign private properties to the return object with prefix + Modernizr._version = version; + + // expose these for the plugin API. Look in the source for how to join() them against your input + /*>>prefixes*/ + Modernizr._prefixes = prefixes; + /*>>prefixes*/ + /*>>domprefixes*/ + Modernizr._domPrefixes = domPrefixes; + Modernizr._cssomPrefixes = cssomPrefixes; + /*>>domprefixes*/ + + /*>>mq*/ + // Modernizr.mq tests a given media query, live against the current state of the window + // A few important notes: + // * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false + // * A max-width or orientation query will be evaluated against the current state, which may change later. + // * You must specify values. Eg. If you are testing support for the min-width media query use: + // Modernizr.mq('(min-width:0)') + // usage: + // Modernizr.mq('only screen and (max-width:768)') + Modernizr.mq = testMediaQuery; + /*>>mq*/ + + /*>>hasevent*/ + // Modernizr.hasEvent() detects support for a given event, with an optional element to test on + // Modernizr.hasEvent('gesturestart', elem) + Modernizr.hasEvent = isEventSupported; + /*>>hasevent*/ + + /*>>testprop*/ + // Modernizr.testProp() investigates whether a given style property is recognized + // Note that the property names must be provided in the camelCase variant. + // Modernizr.testProp('pointerEvents') + Modernizr.testProp = function(prop){ + return testProps([prop]); + }; + /*>>testprop*/ + + /*>>testallprops*/ + // Modernizr.testAllProps() investigates whether a given style property, + // or any of its vendor-prefixed variants, is recognized + // Note that the property names must be provided in the camelCase variant. + // Modernizr.testAllProps('boxSizing') + Modernizr.testAllProps = testPropsAll; + /*>>testallprops*/ + + + /*>>teststyles*/ + // Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards + // Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... }) + Modernizr.testStyles = injectElementWithStyles; + /*>>teststyles*/ + + + /*>>prefixed*/ + // Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input + // Modernizr.prefixed('boxSizing') // 'MozBoxSizing' + + // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style. + // Return values will also be the camelCase variant, if you need to translate that to hypenated style use: + // + // str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-'); + + // If you're trying to ascertain which transition end event to bind to, you might do something like... + // + // var transEndEventNames = { + // 'WebkitTransition' : 'webkitTransitionEnd', + // 'MozTransition' : 'transitionend', + // 'OTransition' : 'oTransitionEnd', + // 'msTransition' : 'MSTransitionEnd', + // 'transition' : 'transitionend' + // }, + // transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; + + Modernizr.prefixed = function(prop, obj, elem){ + if(!obj) { + return testPropsAll(prop, 'pfx'); + } else { + // Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame' + return testPropsAll(prop, obj, elem); + } + }; + /*>>prefixed*/ + + + /*>>cssclasses*/ + // Remove "no-js" class from element, if it exists: + docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') + + + // Add the new classes to the element. + (enableClasses ? ' js ' + classes.join(' ') : ''); + /*>>cssclasses*/ + + return Modernizr; + +})(this, this.document); diff --git a/public/js/modernizr.js b/public/js/modernizr.js new file mode 100644 index 0000000..f2e4bba --- /dev/null +++ b/public/js/modernizr.js @@ -0,0 +1,4 @@ +/* Modernizr 2.7.1 (Custom Build) | MIT & BSD + * Build: http://modernizr.com/download/#-flexbox-flexboxlegacy-printshiv-cssclasses-testprop-testallprops-domprefixes-load + */ +;window.Modernizr=function(a,b,c){function x(a){j.cssText=a}function y(a,b){return x(prefixes.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function A(a,b){return!!~(""+a).indexOf(b)}function B(a,b){for(var d in a){var e=a[d];if(!A(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}function D(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+n.join(d+" ")+d).split(" ");return z(b,"string")||z(b,"undefined")?B(e,b):(e=(a+" "+o.join(d+" ")+d).split(" "),C(e,b,c))}var d="2.7.1",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m="Webkit Moz O ms",n=m.split(" "),o=m.toLowerCase().split(" "),p={},q={},r={},s=[],t=s.slice,u,v={}.hasOwnProperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=t.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(t.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(t.call(arguments)))};return e}),p.flexbox=function(){return D("flexWrap")},p.flexboxlegacy=function(){return D("boxDirection")};for(var E in p)w(p,E)&&(u=E.toLowerCase(),e[u]=p[E](),s.push((e[u]?"":"no-")+u));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)w(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},x(""),i=k=null,e._version=d,e._domPrefixes=o,e._cssomPrefixes=n,e.testProp=function(a){return B([a])},e.testAllProps=D,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+s.join(" "):""),e}(this,this.document),function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e+~])("+m().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),f="$1"+u+"\\:$2";while(d--)b=c[d]=c[d].split("}"),b[b.length-1]=b[b.length-1].replace(e,f),c[d]=b.join("}");return c.join("{")}function z(a){var b=a.length;while(b--)a[b].removeNode()}function A(a){function g(){clearTimeout(d._removeSheetTimer),b&&b.removeNode(!0),b=null}var b,c,d=n(a),e=a.namespaces,f=a.parentWindow;return!v||a.printShived?a:(typeof e[u]=="undefined"&&e.add(u),f.attachEvent("onbeforeprint",function(){g();var d,e,f,h=a.styleSheets,i=[],j=h.length,k=Array(j);while(j--)k[j]=h[j];while(f=k.pop())if(!f.disabled&&t.test(f.media)){try{d=f.imports,e=d.length}catch(m){e=0}for(j=0;j",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b);var t=/^$|\b(?:all|print)\b/,u="html5shiv",v=!k&&function(){var c=b.documentElement;return typeof b.namespaces!="undefined"&&typeof b.parentWindow!="undefined"&&typeof c.applyElement!="undefined"&&typeof c.removeNode!="undefined"&&typeof a.attachEvent!="undefined"}();s.type+=" print",s.shivPrint=A,A(b)}(this,document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p