diff --git a/src/main/webapp/content/css/demo.css b/src/main/webapp/content/css/demo.css new file mode 100644 index 0000000..a9b0bdd --- /dev/null +++ b/src/main/webapp/content/css/demo.css @@ -0,0 +1,194 @@ +/*! + + ========================================================= + * Paper Dashboard Pro Angular - v1.3.0 + ========================================================= + + * Product Page: https://www.creative-tim.com/product/paper-dashboard-pro-angular + * Copyright 2018 Creative Tim (http://www.creative-tim.com) + + ========================================================= + + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + */ +.tim-row { + margin-bottom: 20px; +} + +.tim-white-buttons { + background-color: #777777; +} + +.typography-line { + padding-left: 25%; + margin-bottom: 35px; + position: relative; + display: block; + width: 100%; +} + +.typography-line span { + bottom: 10px; + color: #c0c1c2; + display: block; + font-weight: 400; + font-size: 13px; + line-height: 13px; + left: 0; + position: absolute; + width: 260px; + text-transform: none; +} + +.tim-row { + padding-top: 60px; +} + +.tim-row h3 { + margin-top: 0; +} + +.offline-doc .page-header { + display: flex; + align-items: center; +} + +.offline-doc .footer { + position: absolute; + width: 100%; + background: transparent; + bottom: 0; + color: #fff; + z-index: 1; +} + +#map { + position: relative; + width: 100%; + height: 100vh; +} + +.demo-iconshtml { + font-size: 62.5%; +} + +.demo-icons body { + font-size: 1.6rem; + font-family: sans-serif; + color: #333333; + background: white; +} + +.demo-icons a { + color: #608cee; + text-decoration: none; +} + +.demo-icons header { + text-align: center; + padding: 100px 0 0; +} + +.demo-icons header h1 { + font-size: 2.8rem; +} + +.demo-icons header p { + font-size: 1.4rem; + margin-top: 1em; +} + +.demo-icons header a:hover { + text-decoration: underline; +} + +.demo-icons .nc-icon { + font-size: 34px; +} + +.demo-icons section h2 { + border-bottom: 1px solid #e2e2e2; + padding: 0 0 1em 0.2em; + margin-bottom: 1em; +} + +.demo-icons ul { + padding-left: 0; +} + +.demo-icons ul::after { + clear: both; + content: ''; + display: table; +} + +.demo-icons ul li { + width: 20%; + float: left; + padding: 16px 0; + text-align: center; + border-radius: 0.25em; + -webkit-transition: background 0.2s; + -moz-transition: background 0.2s; + transition: background 0.2s; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + overflow: hidden; +} + +.demo-icons ul li:hover { + background: #f4f4f4; +} + +.demo-icons ul p, +.demo-icons ul em, +.demo-icons ul input { + display: inline-block; + font-size: 1rem; + color: #999999; + -webkit-user-select: auto; + -moz-user-select: auto; + -ms-user-select: auto; + user-select: auto; + white-space: nowrap; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + cursor: pointer; +} + +.demo-icons ul p { + padding: 20px 0 0; + font-size: 12px; + margin: 0; +} + +.demo-icons ul p::selection, +.demo-icons ul em::selection { + background: #608cee; + color: #efefef; +} + +.demo-icons ul em { + font-size: 12px; +} + +.demo-icons ul em::before { + content: '['; +} + +.demo-icons ul em::after { + content: ']'; +} + +.demo-icons ul input { + text-align: center; + background: transparent; + border: none; + box-shadow: none; + outline: none; + display: none; +} diff --git a/src/main/webapp/content/fonts/nucleo-icons.eot b/src/main/webapp/content/fonts/nucleo-icons.eot new file mode 100644 index 0000000..390eb0c Binary files /dev/null and b/src/main/webapp/content/fonts/nucleo-icons.eot differ diff --git a/src/main/webapp/content/fonts/nucleo-icons.ttf b/src/main/webapp/content/fonts/nucleo-icons.ttf new file mode 100644 index 0000000..2064524 Binary files /dev/null and b/src/main/webapp/content/fonts/nucleo-icons.ttf differ diff --git a/src/main/webapp/content/fonts/nucleo-icons.woff b/src/main/webapp/content/fonts/nucleo-icons.woff new file mode 100644 index 0000000..e9e2e51 Binary files /dev/null and b/src/main/webapp/content/fonts/nucleo-icons.woff differ diff --git a/src/main/webapp/content/fonts/nucleo-icons.woff2 b/src/main/webapp/content/fonts/nucleo-icons.woff2 new file mode 100644 index 0000000..b69037c Binary files /dev/null and b/src/main/webapp/content/fonts/nucleo-icons.woff2 differ diff --git a/src/main/webapp/content/img/AU.png b/src/main/webapp/content/img/AU.png new file mode 100644 index 0000000..8e63f7f Binary files /dev/null and b/src/main/webapp/content/img/AU.png differ diff --git a/src/main/webapp/content/img/BR.png b/src/main/webapp/content/img/BR.png new file mode 100644 index 0000000..0447540 Binary files /dev/null and b/src/main/webapp/content/img/BR.png differ diff --git a/src/main/webapp/content/img/DE.png b/src/main/webapp/content/img/DE.png new file mode 100644 index 0000000..23a407b Binary files /dev/null and b/src/main/webapp/content/img/DE.png differ diff --git a/src/main/webapp/content/img/GB.png b/src/main/webapp/content/img/GB.png new file mode 100644 index 0000000..04019f5 Binary files /dev/null and b/src/main/webapp/content/img/GB.png differ diff --git a/src/main/webapp/content/img/RO.png b/src/main/webapp/content/img/RO.png new file mode 100644 index 0000000..f113b90 Binary files /dev/null and b/src/main/webapp/content/img/RO.png differ diff --git a/src/main/webapp/content/img/US.png b/src/main/webapp/content/img/US.png new file mode 100644 index 0000000..73f0c7a Binary files /dev/null and b/src/main/webapp/content/img/US.png differ diff --git a/src/main/webapp/content/img/agenda.png b/src/main/webapp/content/img/agenda.png new file mode 100644 index 0000000..123eb97 Binary files /dev/null and b/src/main/webapp/content/img/agenda.png differ diff --git a/src/main/webapp/content/img/angular.png b/src/main/webapp/content/img/angular.png new file mode 100644 index 0000000..c510293 Binary files /dev/null and b/src/main/webapp/content/img/angular.png differ diff --git a/src/main/webapp/content/img/angular2-logo-white.png b/src/main/webapp/content/img/angular2-logo-white.png new file mode 100644 index 0000000..f1485e0 Binary files /dev/null and b/src/main/webapp/content/img/angular2-logo-white.png differ diff --git a/src/main/webapp/content/img/apple-icon.png b/src/main/webapp/content/img/apple-icon.png new file mode 100644 index 0000000..a20470f Binary files /dev/null and b/src/main/webapp/content/img/apple-icon.png differ diff --git a/src/main/webapp/content/img/bg/ana-bernardo.jpg b/src/main/webapp/content/img/bg/ana-bernardo.jpg new file mode 100644 index 0000000..89c646a Binary files /dev/null and b/src/main/webapp/content/img/bg/ana-bernardo.jpg differ diff --git a/src/main/webapp/content/img/bg/anders-jilden.jpg b/src/main/webapp/content/img/bg/anders-jilden.jpg new file mode 100644 index 0000000..6089455 Binary files /dev/null and b/src/main/webapp/content/img/bg/anders-jilden.jpg differ diff --git a/src/main/webapp/content/img/bg/angelo-pantazis.jpg b/src/main/webapp/content/img/bg/angelo-pantazis.jpg new file mode 100644 index 0000000..450f393 Binary files /dev/null and b/src/main/webapp/content/img/bg/angelo-pantazis.jpg differ diff --git a/src/main/webapp/content/img/bg/ben-white.jpg b/src/main/webapp/content/img/bg/ben-white.jpg new file mode 100644 index 0000000..d043c2c Binary files /dev/null and b/src/main/webapp/content/img/bg/ben-white.jpg differ diff --git a/src/main/webapp/content/img/bg/bruno-abatti.jpg b/src/main/webapp/content/img/bg/bruno-abatti.jpg new file mode 100644 index 0000000..364f898 Binary files /dev/null and b/src/main/webapp/content/img/bg/bruno-abatti.jpg differ diff --git a/src/main/webapp/content/img/bg/chris-karidisz.jpg b/src/main/webapp/content/img/bg/chris-karidisz.jpg new file mode 100644 index 0000000..bf562e2 Binary files /dev/null and b/src/main/webapp/content/img/bg/chris-karidisz.jpg differ diff --git a/src/main/webapp/content/img/bg/clark-street-mercantile.jpg b/src/main/webapp/content/img/bg/clark-street-mercantile.jpg new file mode 100644 index 0000000..761ff82 Binary files /dev/null and b/src/main/webapp/content/img/bg/clark-street-mercantile.jpg differ diff --git a/src/main/webapp/content/img/bg/damir-bosnjak.jpg b/src/main/webapp/content/img/bg/damir-bosnjak.jpg new file mode 100644 index 0000000..529f7dc Binary files /dev/null and b/src/main/webapp/content/img/bg/damir-bosnjak.jpg differ diff --git a/src/main/webapp/content/img/bg/daniel-olahh.jpg b/src/main/webapp/content/img/bg/daniel-olahh.jpg new file mode 100644 index 0000000..7559d94 Binary files /dev/null and b/src/main/webapp/content/img/bg/daniel-olahh.jpg differ diff --git a/src/main/webapp/content/img/bg/daniel-olahs.jpg b/src/main/webapp/content/img/bg/daniel-olahs.jpg new file mode 100644 index 0000000..413253c Binary files /dev/null and b/src/main/webapp/content/img/bg/daniel-olahs.jpg differ diff --git a/src/main/webapp/content/img/bg/david-marcu.jpg b/src/main/webapp/content/img/bg/david-marcu.jpg new file mode 100644 index 0000000..e912e45 Binary files /dev/null and b/src/main/webapp/content/img/bg/david-marcu.jpg differ diff --git a/src/main/webapp/content/img/bg/fabio-mangione.jpg b/src/main/webapp/content/img/bg/fabio-mangione.jpg new file mode 100644 index 0000000..bd423e5 Binary files /dev/null and b/src/main/webapp/content/img/bg/fabio-mangione.jpg differ diff --git a/src/main/webapp/content/img/bg/federico-beccari.jpg b/src/main/webapp/content/img/bg/federico-beccari.jpg new file mode 100644 index 0000000..0ed96e2 Binary files /dev/null and b/src/main/webapp/content/img/bg/federico-beccari.jpg differ diff --git a/src/main/webapp/content/img/bg/fog-low.png b/src/main/webapp/content/img/bg/fog-low.png new file mode 100644 index 0000000..9ffb917 Binary files /dev/null and b/src/main/webapp/content/img/bg/fog-low.png differ diff --git a/src/main/webapp/content/img/bg/forest-bg.jpg b/src/main/webapp/content/img/bg/forest-bg.jpg new file mode 100644 index 0000000..721f306 Binary files /dev/null and b/src/main/webapp/content/img/bg/forest-bg.jpg differ diff --git a/src/main/webapp/content/img/bg/galen-crout.jpg b/src/main/webapp/content/img/bg/galen-crout.jpg new file mode 100644 index 0000000..8c67570 Binary files /dev/null and b/src/main/webapp/content/img/bg/galen-crout.jpg differ diff --git a/src/main/webapp/content/img/bg/gerrit-vermeulen.jpg b/src/main/webapp/content/img/bg/gerrit-vermeulen.jpg new file mode 100644 index 0000000..74702ae Binary files /dev/null and b/src/main/webapp/content/img/bg/gerrit-vermeulen.jpg differ diff --git a/src/main/webapp/content/img/bg/gukhwa-jang.jpg b/src/main/webapp/content/img/bg/gukhwa-jang.jpg new file mode 100644 index 0000000..abaca05 Binary files /dev/null and b/src/main/webapp/content/img/bg/gukhwa-jang.jpg differ diff --git a/src/main/webapp/content/img/bg/gukhwa-jangs.jpg b/src/main/webapp/content/img/bg/gukhwa-jangs.jpg new file mode 100644 index 0000000..8ccf86d Binary files /dev/null and b/src/main/webapp/content/img/bg/gukhwa-jangs.jpg differ diff --git a/src/main/webapp/content/img/bg/ilya-yakover.jpg b/src/main/webapp/content/img/bg/ilya-yakover.jpg new file mode 100644 index 0000000..0c27c7f Binary files /dev/null and b/src/main/webapp/content/img/bg/ilya-yakover.jpg differ diff --git a/src/main/webapp/content/img/bg/ipad.png b/src/main/webapp/content/img/bg/ipad.png new file mode 100644 index 0000000..452857e Binary files /dev/null and b/src/main/webapp/content/img/bg/ipad.png differ diff --git a/src/main/webapp/content/img/bg/iphone.png b/src/main/webapp/content/img/bg/iphone.png new file mode 100644 index 0000000..07ddb0c Binary files /dev/null and b/src/main/webapp/content/img/bg/iphone.png differ diff --git a/src/main/webapp/content/img/bg/jan-sendereks.jpg b/src/main/webapp/content/img/bg/jan-sendereks.jpg new file mode 100644 index 0000000..5bb7386 Binary files /dev/null and b/src/main/webapp/content/img/bg/jan-sendereks.jpg differ diff --git a/src/main/webapp/content/img/bg/jeff-sheldon.jpg b/src/main/webapp/content/img/bg/jeff-sheldon.jpg new file mode 100644 index 0000000..8a7afd5 Binary files /dev/null and b/src/main/webapp/content/img/bg/jeff-sheldon.jpg differ diff --git a/src/main/webapp/content/img/bg/jeremy-yap.jpg b/src/main/webapp/content/img/bg/jeremy-yap.jpg new file mode 100644 index 0000000..b981475 Binary files /dev/null and b/src/main/webapp/content/img/bg/jeremy-yap.jpg differ diff --git a/src/main/webapp/content/img/bg/john-towner.jpg b/src/main/webapp/content/img/bg/john-towner.jpg new file mode 100644 index 0000000..5726f16 Binary files /dev/null and b/src/main/webapp/content/img/bg/john-towner.jpg differ diff --git a/src/main/webapp/content/img/bg/joshua-earles.jpg b/src/main/webapp/content/img/bg/joshua-earles.jpg new file mode 100644 index 0000000..02436f0 Binary files /dev/null and b/src/main/webapp/content/img/bg/joshua-earles.jpg differ diff --git a/src/main/webapp/content/img/bg/joshua-earlesz.jpg b/src/main/webapp/content/img/bg/joshua-earlesz.jpg new file mode 100644 index 0000000..ffbb199 Binary files /dev/null and b/src/main/webapp/content/img/bg/joshua-earlesz.jpg differ diff --git a/src/main/webapp/content/img/bg/joshua-earlez.jpg b/src/main/webapp/content/img/bg/joshua-earlez.jpg new file mode 100644 index 0000000..0e21514 Binary files /dev/null and b/src/main/webapp/content/img/bg/joshua-earlez.jpg differ diff --git a/src/main/webapp/content/img/bg/joshua-stannard.jpg b/src/main/webapp/content/img/bg/joshua-stannard.jpg new file mode 100644 index 0000000..200f5ff Binary files /dev/null and b/src/main/webapp/content/img/bg/joshua-stannard.jpg differ diff --git a/src/main/webapp/content/img/bg/leonard-cotte.jpg b/src/main/webapp/content/img/bg/leonard-cotte.jpg new file mode 100644 index 0000000..7a9982c Binary files /dev/null and b/src/main/webapp/content/img/bg/leonard-cotte.jpg differ diff --git a/src/main/webapp/content/img/bg/luke-chesser.jpg b/src/main/webapp/content/img/bg/luke-chesser.jpg new file mode 100644 index 0000000..aaaa3fd Binary files /dev/null and b/src/main/webapp/content/img/bg/luke-chesser.jpg differ diff --git a/src/main/webapp/content/img/bg/markus-spiske-187777.jpg b/src/main/webapp/content/img/bg/markus-spiske-187777.jpg new file mode 100644 index 0000000..4fb56b6 Binary files /dev/null and b/src/main/webapp/content/img/bg/markus-spiske-187777.jpg differ diff --git a/src/main/webapp/content/img/bg/martin-knize.jpg b/src/main/webapp/content/img/bg/martin-knize.jpg new file mode 100644 index 0000000..ba49f5a Binary files /dev/null and b/src/main/webapp/content/img/bg/martin-knize.jpg differ diff --git a/src/main/webapp/content/img/bg/miguel-perales.jpg b/src/main/webapp/content/img/bg/miguel-perales.jpg new file mode 100644 index 0000000..a321a66 Binary files /dev/null and b/src/main/webapp/content/img/bg/miguel-perales.jpg differ diff --git a/src/main/webapp/content/img/bg/mika-matin.jpg b/src/main/webapp/content/img/bg/mika-matin.jpg new file mode 100644 index 0000000..4cc8d46 Binary files /dev/null and b/src/main/webapp/content/img/bg/mika-matin.jpg differ diff --git a/src/main/webapp/content/img/bg/neill-kumar.jpg b/src/main/webapp/content/img/bg/neill-kumar.jpg new file mode 100644 index 0000000..024f3ae Binary files /dev/null and b/src/main/webapp/content/img/bg/neill-kumar.jpg differ diff --git a/src/main/webapp/content/img/bg/noah-rosenfield.jpg b/src/main/webapp/content/img/bg/noah-rosenfield.jpg new file mode 100644 index 0000000..69487ab Binary files /dev/null and b/src/main/webapp/content/img/bg/noah-rosenfield.jpg differ diff --git a/src/main/webapp/content/img/bg/opt_gsdk_new_thumbnail.jpg b/src/main/webapp/content/img/bg/opt_gsdk_new_thumbnail.jpg new file mode 100644 index 0000000..a394b0a Binary files /dev/null and b/src/main/webapp/content/img/bg/opt_gsdk_new_thumbnail.jpg differ diff --git a/src/main/webapp/content/img/bg/opt_lbd_pro_new_thumbnail.jpg b/src/main/webapp/content/img/bg/opt_lbd_pro_new_thumbnail.jpg new file mode 100644 index 0000000..805f093 Binary files /dev/null and b/src/main/webapp/content/img/bg/opt_lbd_pro_new_thumbnail.jpg differ diff --git a/src/main/webapp/content/img/bg/opt_pk_thumbnail.jpg b/src/main/webapp/content/img/bg/opt_pk_thumbnail.jpg new file mode 100644 index 0000000..0530e1d Binary files /dev/null and b/src/main/webapp/content/img/bg/opt_pk_thumbnail.jpg differ diff --git a/src/main/webapp/content/img/bg/patrick-tomasso.jpg b/src/main/webapp/content/img/bg/patrick-tomasso.jpg new file mode 100644 index 0000000..dc3afed Binary files /dev/null and b/src/main/webapp/content/img/bg/patrick-tomasso.jpg differ diff --git a/src/main/webapp/content/img/bg/pavel-kosov.jpg b/src/main/webapp/content/img/bg/pavel-kosov.jpg new file mode 100644 index 0000000..187f0af Binary files /dev/null and b/src/main/webapp/content/img/bg/pavel-kosov.jpg differ diff --git a/src/main/webapp/content/img/bg/pedro-lastra.jpg b/src/main/webapp/content/img/bg/pedro-lastra.jpg new file mode 100644 index 0000000..05b13bf Binary files /dev/null and b/src/main/webapp/content/img/bg/pedro-lastra.jpg differ diff --git a/src/main/webapp/content/img/bg/pk-pro-cover.jpg b/src/main/webapp/content/img/bg/pk-pro-cover.jpg new file mode 100644 index 0000000..3251d02 Binary files /dev/null and b/src/main/webapp/content/img/bg/pk-pro-cover.jpg differ diff --git a/src/main/webapp/content/img/bg/por7o.jpg b/src/main/webapp/content/img/bg/por7o.jpg new file mode 100644 index 0000000..daa138d Binary files /dev/null and b/src/main/webapp/content/img/bg/por7o.jpg differ diff --git a/src/main/webapp/content/img/bg/rawpixel-com-2.jpg b/src/main/webapp/content/img/bg/rawpixel-com-2.jpg new file mode 100644 index 0000000..bdd44ed Binary files /dev/null and b/src/main/webapp/content/img/bg/rawpixel-com-2.jpg differ diff --git a/src/main/webapp/content/img/bg/rawpixel-com.jpg b/src/main/webapp/content/img/bg/rawpixel-com.jpg new file mode 100644 index 0000000..459e336 Binary files /dev/null and b/src/main/webapp/content/img/bg/rawpixel-com.jpg differ diff --git a/src/main/webapp/content/img/bg/rawpixel-comm.jpg b/src/main/webapp/content/img/bg/rawpixel-comm.jpg new file mode 100644 index 0000000..c96d28d Binary files /dev/null and b/src/main/webapp/content/img/bg/rawpixel-comm.jpg differ diff --git a/src/main/webapp/content/img/bg/rawpixel-coms.jpg b/src/main/webapp/content/img/bg/rawpixel-coms.jpg new file mode 100644 index 0000000..39e9303 Binary files /dev/null and b/src/main/webapp/content/img/bg/rawpixel-coms.jpg differ diff --git a/src/main/webapp/content/img/bg/rodrigo-ardilha.jpg b/src/main/webapp/content/img/bg/rodrigo-ardilha.jpg new file mode 100644 index 0000000..b74bcf1 Binary files /dev/null and b/src/main/webapp/content/img/bg/rodrigo-ardilha.jpg differ diff --git a/src/main/webapp/content/img/bg/roger-keller.jpg b/src/main/webapp/content/img/bg/roger-keller.jpg new file mode 100644 index 0000000..4dc707c Binary files /dev/null and b/src/main/webapp/content/img/bg/roger-keller.jpg differ diff --git a/src/main/webapp/content/img/bg/sebastien-gabrieles.jpg b/src/main/webapp/content/img/bg/sebastien-gabrieles.jpg new file mode 100644 index 0000000..d87c34a Binary files /dev/null and b/src/main/webapp/content/img/bg/sebastien-gabrieles.jpg differ diff --git a/src/main/webapp/content/img/bg/soroush-karimi.jpg b/src/main/webapp/content/img/bg/soroush-karimi.jpg new file mode 100644 index 0000000..5d7a564 Binary files /dev/null and b/src/main/webapp/content/img/bg/soroush-karimi.jpg differ diff --git a/src/main/webapp/content/img/bg/stephanie-krist.jpg b/src/main/webapp/content/img/bg/stephanie-krist.jpg new file mode 100644 index 0000000..b01f3da Binary files /dev/null and b/src/main/webapp/content/img/bg/stephanie-krist.jpg differ diff --git a/src/main/webapp/content/img/bg/takahiro-sakamoto.jpg b/src/main/webapp/content/img/bg/takahiro-sakamoto.jpg new file mode 100644 index 0000000..90a1f09 Binary files /dev/null and b/src/main/webapp/content/img/bg/takahiro-sakamoto.jpg differ diff --git a/src/main/webapp/content/img/bg/the-how-photographer.jpg b/src/main/webapp/content/img/bg/the-how-photographer.jpg new file mode 100644 index 0000000..531899c Binary files /dev/null and b/src/main/webapp/content/img/bg/the-how-photographer.jpg differ diff --git a/src/main/webapp/content/img/bg/uriel-soberanes.jpg b/src/main/webapp/content/img/bg/uriel-soberanes.jpg new file mode 100644 index 0000000..206e17e Binary files /dev/null and b/src/main/webapp/content/img/bg/uriel-soberanes.jpg differ diff --git a/src/main/webapp/content/img/bg/val-vesa.jpg b/src/main/webapp/content/img/bg/val-vesa.jpg new file mode 100644 index 0000000..c1f5f6b Binary files /dev/null and b/src/main/webapp/content/img/bg/val-vesa.jpg differ diff --git a/src/main/webapp/content/img/bg/vincent-versluis.jpg b/src/main/webapp/content/img/bg/vincent-versluis.jpg new file mode 100644 index 0000000..72534a9 Binary files /dev/null and b/src/main/webapp/content/img/bg/vincent-versluis.jpg differ diff --git a/src/main/webapp/content/img/bg/zachary-staines.jpg b/src/main/webapp/content/img/bg/zachary-staines.jpg new file mode 100644 index 0000000..eeb6de0 Binary files /dev/null and b/src/main/webapp/content/img/bg/zachary-staines.jpg differ diff --git a/src/main/webapp/content/img/default-avatar.png b/src/main/webapp/content/img/default-avatar.png new file mode 100644 index 0000000..ca9fa88 Binary files /dev/null and b/src/main/webapp/content/img/default-avatar.png differ diff --git a/src/main/webapp/content/img/emilyz.jpg b/src/main/webapp/content/img/emilyz.jpg new file mode 100644 index 0000000..8a6fad2 Binary files /dev/null and b/src/main/webapp/content/img/emilyz.jpg differ diff --git a/src/main/webapp/content/img/evernote.png b/src/main/webapp/content/img/evernote.png new file mode 100644 index 0000000..6bdfe11 Binary files /dev/null and b/src/main/webapp/content/img/evernote.png differ diff --git a/src/main/webapp/content/img/face-2.jpg b/src/main/webapp/content/img/face-2.jpg new file mode 100644 index 0000000..7e7055c Binary files /dev/null and b/src/main/webapp/content/img/face-2.jpg differ diff --git a/src/main/webapp/content/img/face-3.jpg b/src/main/webapp/content/img/face-3.jpg new file mode 100644 index 0000000..3e470d6 Binary files /dev/null and b/src/main/webapp/content/img/face-3.jpg differ diff --git a/src/main/webapp/content/img/faces/ayo-ogunseinde-1.jpg b/src/main/webapp/content/img/faces/ayo-ogunseinde-1.jpg new file mode 100644 index 0000000..318ca16 Binary files /dev/null and b/src/main/webapp/content/img/faces/ayo-ogunseinde-1.jpg differ diff --git a/src/main/webapp/content/img/faces/ayo-ogunseinde-2.jpg b/src/main/webapp/content/img/faces/ayo-ogunseinde-2.jpg new file mode 100644 index 0000000..6a599df Binary files /dev/null and b/src/main/webapp/content/img/faces/ayo-ogunseinde-2.jpg differ diff --git a/src/main/webapp/content/img/faces/clem-onojeghuo-1.jpg b/src/main/webapp/content/img/faces/clem-onojeghuo-1.jpg new file mode 100644 index 0000000..8c94935 Binary files /dev/null and b/src/main/webapp/content/img/faces/clem-onojeghuo-1.jpg differ diff --git a/src/main/webapp/content/img/faces/clem-onojeghuo-2.jpg b/src/main/webapp/content/img/faces/clem-onojeghuo-2.jpg new file mode 100644 index 0000000..fe6dde7 Binary files /dev/null and b/src/main/webapp/content/img/faces/clem-onojeghuo-2.jpg differ diff --git a/src/main/webapp/content/img/faces/clem-onojeghuo-3.jpg b/src/main/webapp/content/img/faces/clem-onojeghuo-3.jpg new file mode 100644 index 0000000..2694043 Binary files /dev/null and b/src/main/webapp/content/img/faces/clem-onojeghuo-3.jpg differ diff --git a/src/main/webapp/content/img/faces/clem-onojeghuo-4.jpg b/src/main/webapp/content/img/faces/clem-onojeghuo-4.jpg new file mode 100644 index 0000000..b9c80dc Binary files /dev/null and b/src/main/webapp/content/img/faces/clem-onojeghuo-4.jpg differ diff --git a/src/main/webapp/content/img/faces/erik-lucatero-1.jpg b/src/main/webapp/content/img/faces/erik-lucatero-1.jpg new file mode 100644 index 0000000..e5316a1 Binary files /dev/null and b/src/main/webapp/content/img/faces/erik-lucatero-1.jpg differ diff --git a/src/main/webapp/content/img/faces/erik-lucatero-2.jpg b/src/main/webapp/content/img/faces/erik-lucatero-2.jpg new file mode 100644 index 0000000..41c2978 Binary files /dev/null and b/src/main/webapp/content/img/faces/erik-lucatero-2.jpg differ diff --git a/src/main/webapp/content/img/faces/joe-gardner-1.jpg b/src/main/webapp/content/img/faces/joe-gardner-1.jpg new file mode 100644 index 0000000..71d8406 Binary files /dev/null and b/src/main/webapp/content/img/faces/joe-gardner-1.jpg differ diff --git a/src/main/webapp/content/img/faces/joe-gardner-2.jpg b/src/main/webapp/content/img/faces/joe-gardner-2.jpg new file mode 100644 index 0000000..433f498 Binary files /dev/null and b/src/main/webapp/content/img/faces/joe-gardner-2.jpg differ diff --git a/src/main/webapp/content/img/faces/kaci-baum-1.jpg b/src/main/webapp/content/img/faces/kaci-baum-1.jpg new file mode 100644 index 0000000..2f7171f Binary files /dev/null and b/src/main/webapp/content/img/faces/kaci-baum-1.jpg differ diff --git a/src/main/webapp/content/img/faces/kaci-baum-2.jpg b/src/main/webapp/content/img/faces/kaci-baum-2.jpg new file mode 100644 index 0000000..e7a8797 Binary files /dev/null and b/src/main/webapp/content/img/faces/kaci-baum-2.jpg differ diff --git a/src/main/webapp/content/img/favicon.png b/src/main/webapp/content/img/favicon.png new file mode 100644 index 0000000..7d8b7d0 Binary files /dev/null and b/src/main/webapp/content/img/favicon.png differ diff --git a/src/main/webapp/content/img/flags/AD.png b/src/main/webapp/content/img/flags/AD.png new file mode 100644 index 0000000..df49c85 Binary files /dev/null and b/src/main/webapp/content/img/flags/AD.png differ diff --git a/src/main/webapp/content/img/flags/AE.png b/src/main/webapp/content/img/flags/AE.png new file mode 100644 index 0000000..7fa1c7a Binary files /dev/null and b/src/main/webapp/content/img/flags/AE.png differ diff --git a/src/main/webapp/content/img/flags/AG.png b/src/main/webapp/content/img/flags/AG.png new file mode 100644 index 0000000..23196fa Binary files /dev/null and b/src/main/webapp/content/img/flags/AG.png differ diff --git a/src/main/webapp/content/img/flags/AM.png b/src/main/webapp/content/img/flags/AM.png new file mode 100644 index 0000000..1a0e61d Binary files /dev/null and b/src/main/webapp/content/img/flags/AM.png differ diff --git a/src/main/webapp/content/img/flags/AR.png b/src/main/webapp/content/img/flags/AR.png new file mode 100644 index 0000000..7c258a5 Binary files /dev/null and b/src/main/webapp/content/img/flags/AR.png differ diff --git a/src/main/webapp/content/img/flags/AT.png b/src/main/webapp/content/img/flags/AT.png new file mode 100644 index 0000000..d13a8e1 Binary files /dev/null and b/src/main/webapp/content/img/flags/AT.png differ diff --git a/src/main/webapp/content/img/flags/AU.png b/src/main/webapp/content/img/flags/AU.png new file mode 100644 index 0000000..8e63f7f Binary files /dev/null and b/src/main/webapp/content/img/flags/AU.png differ diff --git a/src/main/webapp/content/img/flags/BE.png b/src/main/webapp/content/img/flags/BE.png new file mode 100644 index 0000000..8762072 Binary files /dev/null and b/src/main/webapp/content/img/flags/BE.png differ diff --git a/src/main/webapp/content/img/flags/BF.png b/src/main/webapp/content/img/flags/BF.png new file mode 100644 index 0000000..0a9c236 Binary files /dev/null and b/src/main/webapp/content/img/flags/BF.png differ diff --git a/src/main/webapp/content/img/flags/BG.png b/src/main/webapp/content/img/flags/BG.png new file mode 100644 index 0000000..eb6c13c Binary files /dev/null and b/src/main/webapp/content/img/flags/BG.png differ diff --git a/src/main/webapp/content/img/flags/BO.png b/src/main/webapp/content/img/flags/BO.png new file mode 100644 index 0000000..a2dbfbc Binary files /dev/null and b/src/main/webapp/content/img/flags/BO.png differ diff --git a/src/main/webapp/content/img/flags/BR.png b/src/main/webapp/content/img/flags/BR.png new file mode 100644 index 0000000..0447540 Binary files /dev/null and b/src/main/webapp/content/img/flags/BR.png differ diff --git a/src/main/webapp/content/img/flags/CA.png b/src/main/webapp/content/img/flags/CA.png new file mode 100644 index 0000000..273cf7a Binary files /dev/null and b/src/main/webapp/content/img/flags/CA.png differ diff --git a/src/main/webapp/content/img/flags/CD.png b/src/main/webapp/content/img/flags/CD.png new file mode 100644 index 0000000..43d4b86 Binary files /dev/null and b/src/main/webapp/content/img/flags/CD.png differ diff --git a/src/main/webapp/content/img/flags/CG.png b/src/main/webapp/content/img/flags/CG.png new file mode 100644 index 0000000..ec2ce3a Binary files /dev/null and b/src/main/webapp/content/img/flags/CG.png differ diff --git a/src/main/webapp/content/img/flags/CH.png b/src/main/webapp/content/img/flags/CH.png new file mode 100644 index 0000000..eb92344 Binary files /dev/null and b/src/main/webapp/content/img/flags/CH.png differ diff --git a/src/main/webapp/content/img/flags/CL.png b/src/main/webapp/content/img/flags/CL.png new file mode 100644 index 0000000..fe3733d Binary files /dev/null and b/src/main/webapp/content/img/flags/CL.png differ diff --git a/src/main/webapp/content/img/flags/CM.png b/src/main/webapp/content/img/flags/CM.png new file mode 100644 index 0000000..9be54c1 Binary files /dev/null and b/src/main/webapp/content/img/flags/CM.png differ diff --git a/src/main/webapp/content/img/flags/CN.png b/src/main/webapp/content/img/flags/CN.png new file mode 100644 index 0000000..3e420a7 Binary files /dev/null and b/src/main/webapp/content/img/flags/CN.png differ diff --git a/src/main/webapp/content/img/flags/CO.png b/src/main/webapp/content/img/flags/CO.png new file mode 100644 index 0000000..2860e60 Binary files /dev/null and b/src/main/webapp/content/img/flags/CO.png differ diff --git a/src/main/webapp/content/img/flags/CZ.png b/src/main/webapp/content/img/flags/CZ.png new file mode 100644 index 0000000..4ba7b9e Binary files /dev/null and b/src/main/webapp/content/img/flags/CZ.png differ diff --git a/src/main/webapp/content/img/flags/DE.png b/src/main/webapp/content/img/flags/DE.png new file mode 100644 index 0000000..23a407b Binary files /dev/null and b/src/main/webapp/content/img/flags/DE.png differ diff --git a/src/main/webapp/content/img/flags/DJ.png b/src/main/webapp/content/img/flags/DJ.png new file mode 100644 index 0000000..f1d3b3a Binary files /dev/null and b/src/main/webapp/content/img/flags/DJ.png differ diff --git a/src/main/webapp/content/img/flags/DK.png b/src/main/webapp/content/img/flags/DK.png new file mode 100644 index 0000000..0e35509 Binary files /dev/null and b/src/main/webapp/content/img/flags/DK.png differ diff --git a/src/main/webapp/content/img/flags/DZ.png b/src/main/webapp/content/img/flags/DZ.png new file mode 100644 index 0000000..32b377b Binary files /dev/null and b/src/main/webapp/content/img/flags/DZ.png differ diff --git a/src/main/webapp/content/img/flags/EE.png b/src/main/webapp/content/img/flags/EE.png new file mode 100644 index 0000000..d8d2fd0 Binary files /dev/null and b/src/main/webapp/content/img/flags/EE.png differ diff --git a/src/main/webapp/content/img/flags/EG.png b/src/main/webapp/content/img/flags/EG.png new file mode 100644 index 0000000..073520a Binary files /dev/null and b/src/main/webapp/content/img/flags/EG.png differ diff --git a/src/main/webapp/content/img/flags/ES.png b/src/main/webapp/content/img/flags/ES.png new file mode 100644 index 0000000..4e456a2 Binary files /dev/null and b/src/main/webapp/content/img/flags/ES.png differ diff --git a/src/main/webapp/content/img/flags/FI.png b/src/main/webapp/content/img/flags/FI.png new file mode 100644 index 0000000..7a623b0 Binary files /dev/null and b/src/main/webapp/content/img/flags/FI.png differ diff --git a/src/main/webapp/content/img/flags/FR.png b/src/main/webapp/content/img/flags/FR.png new file mode 100644 index 0000000..cb92d12 Binary files /dev/null and b/src/main/webapp/content/img/flags/FR.png differ diff --git a/src/main/webapp/content/img/flags/GA.png b/src/main/webapp/content/img/flags/GA.png new file mode 100644 index 0000000..743fa94 Binary files /dev/null and b/src/main/webapp/content/img/flags/GA.png differ diff --git a/src/main/webapp/content/img/flags/GB.png b/src/main/webapp/content/img/flags/GB.png new file mode 100644 index 0000000..04019f5 Binary files /dev/null and b/src/main/webapp/content/img/flags/GB.png differ diff --git a/src/main/webapp/content/img/flags/GM.png b/src/main/webapp/content/img/flags/GM.png new file mode 100644 index 0000000..88335ad Binary files /dev/null and b/src/main/webapp/content/img/flags/GM.png differ diff --git a/src/main/webapp/content/img/flags/GT.png b/src/main/webapp/content/img/flags/GT.png new file mode 100644 index 0000000..2421118 Binary files /dev/null and b/src/main/webapp/content/img/flags/GT.png differ diff --git a/src/main/webapp/content/img/flags/HN.png b/src/main/webapp/content/img/flags/HN.png new file mode 100644 index 0000000..99a5f47 Binary files /dev/null and b/src/main/webapp/content/img/flags/HN.png differ diff --git a/src/main/webapp/content/img/flags/HT.png b/src/main/webapp/content/img/flags/HT.png new file mode 100644 index 0000000..be491ac Binary files /dev/null and b/src/main/webapp/content/img/flags/HT.png differ diff --git a/src/main/webapp/content/img/flags/HU.png b/src/main/webapp/content/img/flags/HU.png new file mode 100644 index 0000000..6272c8e Binary files /dev/null and b/src/main/webapp/content/img/flags/HU.png differ diff --git a/src/main/webapp/content/img/flags/ID.png b/src/main/webapp/content/img/flags/ID.png new file mode 100644 index 0000000..3c7045d Binary files /dev/null and b/src/main/webapp/content/img/flags/ID.png differ diff --git a/src/main/webapp/content/img/flags/IE.png b/src/main/webapp/content/img/flags/IE.png new file mode 100644 index 0000000..c778368 Binary files /dev/null and b/src/main/webapp/content/img/flags/IE.png differ diff --git a/src/main/webapp/content/img/flags/IL.png b/src/main/webapp/content/img/flags/IL.png new file mode 100644 index 0000000..72ae59d Binary files /dev/null and b/src/main/webapp/content/img/flags/IL.png differ diff --git a/src/main/webapp/content/img/flags/IN.png b/src/main/webapp/content/img/flags/IN.png new file mode 100644 index 0000000..c2f3d71 Binary files /dev/null and b/src/main/webapp/content/img/flags/IN.png differ diff --git a/src/main/webapp/content/img/flags/IQ.png b/src/main/webapp/content/img/flags/IQ.png new file mode 100644 index 0000000..82f4d88 Binary files /dev/null and b/src/main/webapp/content/img/flags/IQ.png differ diff --git a/src/main/webapp/content/img/flags/IR.png b/src/main/webapp/content/img/flags/IR.png new file mode 100644 index 0000000..0f662ad Binary files /dev/null and b/src/main/webapp/content/img/flags/IR.png differ diff --git a/src/main/webapp/content/img/flags/IT.png b/src/main/webapp/content/img/flags/IT.png new file mode 100644 index 0000000..c111bc1 Binary files /dev/null and b/src/main/webapp/content/img/flags/IT.png differ diff --git a/src/main/webapp/content/img/flags/JM.png b/src/main/webapp/content/img/flags/JM.png new file mode 100644 index 0000000..c034b85 Binary files /dev/null and b/src/main/webapp/content/img/flags/JM.png differ diff --git a/src/main/webapp/content/img/flags/JO.png b/src/main/webapp/content/img/flags/JO.png new file mode 100644 index 0000000..0510163 Binary files /dev/null and b/src/main/webapp/content/img/flags/JO.png differ diff --git a/src/main/webapp/content/img/flags/JP.png b/src/main/webapp/content/img/flags/JP.png new file mode 100644 index 0000000..9786df2 Binary files /dev/null and b/src/main/webapp/content/img/flags/JP.png differ diff --git a/src/main/webapp/content/img/flags/KG.png b/src/main/webapp/content/img/flags/KG.png new file mode 100644 index 0000000..2db2d50 Binary files /dev/null and b/src/main/webapp/content/img/flags/KG.png differ diff --git a/src/main/webapp/content/img/flags/KN.png b/src/main/webapp/content/img/flags/KN.png new file mode 100644 index 0000000..1b19a8c Binary files /dev/null and b/src/main/webapp/content/img/flags/KN.png differ diff --git a/src/main/webapp/content/img/flags/KP.png b/src/main/webapp/content/img/flags/KP.png new file mode 100644 index 0000000..6cfebc5 Binary files /dev/null and b/src/main/webapp/content/img/flags/KP.png differ diff --git a/src/main/webapp/content/img/flags/KR.png b/src/main/webapp/content/img/flags/KR.png new file mode 100644 index 0000000..736cfa8 Binary files /dev/null and b/src/main/webapp/content/img/flags/KR.png differ diff --git a/src/main/webapp/content/img/flags/KW.png b/src/main/webapp/content/img/flags/KW.png new file mode 100644 index 0000000..a13126e Binary files /dev/null and b/src/main/webapp/content/img/flags/KW.png differ diff --git a/src/main/webapp/content/img/flags/KZ.png b/src/main/webapp/content/img/flags/KZ.png new file mode 100644 index 0000000..a3274ad Binary files /dev/null and b/src/main/webapp/content/img/flags/KZ.png differ diff --git a/src/main/webapp/content/img/flags/LA.png b/src/main/webapp/content/img/flags/LA.png new file mode 100644 index 0000000..7e202b4 Binary files /dev/null and b/src/main/webapp/content/img/flags/LA.png differ diff --git a/src/main/webapp/content/img/flags/LB.png b/src/main/webapp/content/img/flags/LB.png new file mode 100644 index 0000000..f203af8 Binary files /dev/null and b/src/main/webapp/content/img/flags/LB.png differ diff --git a/src/main/webapp/content/img/flags/LC.png b/src/main/webapp/content/img/flags/LC.png new file mode 100644 index 0000000..c0758a1 Binary files /dev/null and b/src/main/webapp/content/img/flags/LC.png differ diff --git a/src/main/webapp/content/img/flags/LS.png b/src/main/webapp/content/img/flags/LS.png new file mode 100644 index 0000000..e69a97b Binary files /dev/null and b/src/main/webapp/content/img/flags/LS.png differ diff --git a/src/main/webapp/content/img/flags/LU.png b/src/main/webapp/content/img/flags/LU.png new file mode 100644 index 0000000..0f98055 Binary files /dev/null and b/src/main/webapp/content/img/flags/LU.png differ diff --git a/src/main/webapp/content/img/flags/LV.png b/src/main/webapp/content/img/flags/LV.png new file mode 100644 index 0000000..6169eb4 Binary files /dev/null and b/src/main/webapp/content/img/flags/LV.png differ diff --git a/src/main/webapp/content/img/flags/MG.png b/src/main/webapp/content/img/flags/MG.png new file mode 100644 index 0000000..55412d5 Binary files /dev/null and b/src/main/webapp/content/img/flags/MG.png differ diff --git a/src/main/webapp/content/img/flags/MK.png b/src/main/webapp/content/img/flags/MK.png new file mode 100644 index 0000000..29a1ed4 Binary files /dev/null and b/src/main/webapp/content/img/flags/MK.png differ diff --git a/src/main/webapp/content/img/flags/ML.png b/src/main/webapp/content/img/flags/ML.png new file mode 100644 index 0000000..6fb3d6a Binary files /dev/null and b/src/main/webapp/content/img/flags/ML.png differ diff --git a/src/main/webapp/content/img/flags/MM.png b/src/main/webapp/content/img/flags/MM.png new file mode 100644 index 0000000..09a0a15 Binary files /dev/null and b/src/main/webapp/content/img/flags/MM.png differ diff --git a/src/main/webapp/content/img/flags/MT.png b/src/main/webapp/content/img/flags/MT.png new file mode 100644 index 0000000..5d694ec Binary files /dev/null and b/src/main/webapp/content/img/flags/MT.png differ diff --git a/src/main/webapp/content/img/flags/MX.png b/src/main/webapp/content/img/flags/MX.png new file mode 100644 index 0000000..4fac84a Binary files /dev/null and b/src/main/webapp/content/img/flags/MX.png differ diff --git a/src/main/webapp/content/img/flags/NA.png b/src/main/webapp/content/img/flags/NA.png new file mode 100644 index 0000000..33aa1a1 Binary files /dev/null and b/src/main/webapp/content/img/flags/NA.png differ diff --git a/src/main/webapp/content/img/flags/NE.png b/src/main/webapp/content/img/flags/NE.png new file mode 100644 index 0000000..fb6fc62 Binary files /dev/null and b/src/main/webapp/content/img/flags/NE.png differ diff --git a/src/main/webapp/content/img/flags/NG.png b/src/main/webapp/content/img/flags/NG.png new file mode 100644 index 0000000..d3c626b Binary files /dev/null and b/src/main/webapp/content/img/flags/NG.png differ diff --git a/src/main/webapp/content/img/flags/NI.png b/src/main/webapp/content/img/flags/NI.png new file mode 100644 index 0000000..fbd68d1 Binary files /dev/null and b/src/main/webapp/content/img/flags/NI.png differ diff --git a/src/main/webapp/content/img/flags/NL.png b/src/main/webapp/content/img/flags/NL.png new file mode 100644 index 0000000..3900749 Binary files /dev/null and b/src/main/webapp/content/img/flags/NL.png differ diff --git a/src/main/webapp/content/img/flags/NO.png b/src/main/webapp/content/img/flags/NO.png new file mode 100644 index 0000000..1068ff8 Binary files /dev/null and b/src/main/webapp/content/img/flags/NO.png differ diff --git a/src/main/webapp/content/img/flags/OM.png b/src/main/webapp/content/img/flags/OM.png new file mode 100644 index 0000000..c783397 Binary files /dev/null and b/src/main/webapp/content/img/flags/OM.png differ diff --git a/src/main/webapp/content/img/flags/PA.png b/src/main/webapp/content/img/flags/PA.png new file mode 100644 index 0000000..b8919ea Binary files /dev/null and b/src/main/webapp/content/img/flags/PA.png differ diff --git a/src/main/webapp/content/img/flags/PE.png b/src/main/webapp/content/img/flags/PE.png new file mode 100644 index 0000000..934198d Binary files /dev/null and b/src/main/webapp/content/img/flags/PE.png differ diff --git a/src/main/webapp/content/img/flags/PG.png b/src/main/webapp/content/img/flags/PG.png new file mode 100644 index 0000000..9fb82cc Binary files /dev/null and b/src/main/webapp/content/img/flags/PG.png differ diff --git a/src/main/webapp/content/img/flags/PK.png b/src/main/webapp/content/img/flags/PK.png new file mode 100644 index 0000000..9214a81 Binary files /dev/null and b/src/main/webapp/content/img/flags/PK.png differ diff --git a/src/main/webapp/content/img/flags/PL.png b/src/main/webapp/content/img/flags/PL.png new file mode 100644 index 0000000..c9dc74d Binary files /dev/null and b/src/main/webapp/content/img/flags/PL.png differ diff --git a/src/main/webapp/content/img/flags/PT.png b/src/main/webapp/content/img/flags/PT.png new file mode 100644 index 0000000..33a3de2 Binary files /dev/null and b/src/main/webapp/content/img/flags/PT.png differ diff --git a/src/main/webapp/content/img/flags/PY.png b/src/main/webapp/content/img/flags/PY.png new file mode 100644 index 0000000..967ec18 Binary files /dev/null and b/src/main/webapp/content/img/flags/PY.png differ diff --git a/src/main/webapp/content/img/flags/QA.png b/src/main/webapp/content/img/flags/QA.png new file mode 100644 index 0000000..c90e17b Binary files /dev/null and b/src/main/webapp/content/img/flags/QA.png differ diff --git a/src/main/webapp/content/img/flags/RO.png b/src/main/webapp/content/img/flags/RO.png new file mode 100644 index 0000000..f113b90 Binary files /dev/null and b/src/main/webapp/content/img/flags/RO.png differ diff --git a/src/main/webapp/content/img/flags/RU.png b/src/main/webapp/content/img/flags/RU.png new file mode 100644 index 0000000..1876d6b Binary files /dev/null and b/src/main/webapp/content/img/flags/RU.png differ diff --git a/src/main/webapp/content/img/flags/RW.png b/src/main/webapp/content/img/flags/RW.png new file mode 100644 index 0000000..fee04a2 Binary files /dev/null and b/src/main/webapp/content/img/flags/RW.png differ diff --git a/src/main/webapp/content/img/flags/SA.png b/src/main/webapp/content/img/flags/SA.png new file mode 100644 index 0000000..bdf39a4 Binary files /dev/null and b/src/main/webapp/content/img/flags/SA.png differ diff --git a/src/main/webapp/content/img/flags/SE.png b/src/main/webapp/content/img/flags/SE.png new file mode 100644 index 0000000..08dc290 Binary files /dev/null and b/src/main/webapp/content/img/flags/SE.png differ diff --git a/src/main/webapp/content/img/flags/SG.png b/src/main/webapp/content/img/flags/SG.png new file mode 100644 index 0000000..9abd1a6 Binary files /dev/null and b/src/main/webapp/content/img/flags/SG.png differ diff --git a/src/main/webapp/content/img/flags/SL.png b/src/main/webapp/content/img/flags/SL.png new file mode 100644 index 0000000..c1b09d7 Binary files /dev/null and b/src/main/webapp/content/img/flags/SL.png differ diff --git a/src/main/webapp/content/img/flags/SN.png b/src/main/webapp/content/img/flags/SN.png new file mode 100644 index 0000000..b28977f Binary files /dev/null and b/src/main/webapp/content/img/flags/SN.png differ diff --git a/src/main/webapp/content/img/flags/SO.png b/src/main/webapp/content/img/flags/SO.png new file mode 100644 index 0000000..f61b0e4 Binary files /dev/null and b/src/main/webapp/content/img/flags/SO.png differ diff --git a/src/main/webapp/content/img/flags/SV.png b/src/main/webapp/content/img/flags/SV.png new file mode 100644 index 0000000..72835ea Binary files /dev/null and b/src/main/webapp/content/img/flags/SV.png differ diff --git a/src/main/webapp/content/img/flags/TD.png b/src/main/webapp/content/img/flags/TD.png new file mode 100644 index 0000000..93b7f9d Binary files /dev/null and b/src/main/webapp/content/img/flags/TD.png differ diff --git a/src/main/webapp/content/img/flags/TJ.png b/src/main/webapp/content/img/flags/TJ.png new file mode 100644 index 0000000..8c7d70e Binary files /dev/null and b/src/main/webapp/content/img/flags/TJ.png differ diff --git a/src/main/webapp/content/img/flags/TL.png b/src/main/webapp/content/img/flags/TL.png new file mode 100644 index 0000000..59acf14 Binary files /dev/null and b/src/main/webapp/content/img/flags/TL.png differ diff --git a/src/main/webapp/content/img/flags/TR.png b/src/main/webapp/content/img/flags/TR.png new file mode 100644 index 0000000..9443f0b Binary files /dev/null and b/src/main/webapp/content/img/flags/TR.png differ diff --git a/src/main/webapp/content/img/flags/TZ.png b/src/main/webapp/content/img/flags/TZ.png new file mode 100644 index 0000000..a848f73 Binary files /dev/null and b/src/main/webapp/content/img/flags/TZ.png differ diff --git a/src/main/webapp/content/img/flags/UA.png b/src/main/webapp/content/img/flags/UA.png new file mode 100644 index 0000000..5526a55 Binary files /dev/null and b/src/main/webapp/content/img/flags/UA.png differ diff --git a/src/main/webapp/content/img/flags/US.png b/src/main/webapp/content/img/flags/US.png new file mode 100644 index 0000000..73f0c7a Binary files /dev/null and b/src/main/webapp/content/img/flags/US.png differ diff --git a/src/main/webapp/content/img/flags/VE.png b/src/main/webapp/content/img/flags/VE.png new file mode 100644 index 0000000..11a43d0 Binary files /dev/null and b/src/main/webapp/content/img/flags/VE.png differ diff --git a/src/main/webapp/content/img/flags/VN.png b/src/main/webapp/content/img/flags/VN.png new file mode 100644 index 0000000..8930265 Binary files /dev/null and b/src/main/webapp/content/img/flags/VN.png differ diff --git a/src/main/webapp/content/img/flags/YE.png b/src/main/webapp/content/img/flags/YE.png new file mode 100644 index 0000000..37ac4f3 Binary files /dev/null and b/src/main/webapp/content/img/flags/YE.png differ diff --git a/src/main/webapp/content/img/header.jpg b/src/main/webapp/content/img/header.jpg new file mode 100644 index 0000000..f98e238 Binary files /dev/null and b/src/main/webapp/content/img/header.jpg differ diff --git a/src/main/webapp/content/img/image_placeholder.jpg b/src/main/webapp/content/img/image_placeholder.jpg new file mode 100644 index 0000000..ffdb0aa Binary files /dev/null and b/src/main/webapp/content/img/image_placeholder.jpg differ diff --git a/src/main/webapp/content/img/james.jpg b/src/main/webapp/content/img/james.jpg new file mode 100644 index 0000000..5f8bbf1 Binary files /dev/null and b/src/main/webapp/content/img/james.jpg differ diff --git a/src/main/webapp/content/img/logo-small.png b/src/main/webapp/content/img/logo-small.png new file mode 100644 index 0000000..1860ee4 Binary files /dev/null and b/src/main/webapp/content/img/logo-small.png differ diff --git a/src/main/webapp/content/img/mike.jpg b/src/main/webapp/content/img/mike.jpg new file mode 100644 index 0000000..cac7d3a Binary files /dev/null and b/src/main/webapp/content/img/mike.jpg differ diff --git a/src/main/webapp/content/img/now-logo.png b/src/main/webapp/content/img/now-logo.png new file mode 100644 index 0000000..d60eccf Binary files /dev/null and b/src/main/webapp/content/img/now-logo.png differ diff --git a/src/main/webapp/content/img/placeholder.jpg b/src/main/webapp/content/img/placeholder.jpg new file mode 100644 index 0000000..0050bc8 Binary files /dev/null and b/src/main/webapp/content/img/placeholder.jpg differ diff --git a/src/main/webapp/content/img/stylus.jpg b/src/main/webapp/content/img/stylus.jpg new file mode 100644 index 0000000..bf59c74 Binary files /dev/null and b/src/main/webapp/content/img/stylus.jpg differ diff --git a/src/main/webapp/content/img_datasurvey/datasurvey-logo-text-black.svg b/src/main/webapp/content/img_datasurvey/datasurvey-logo-text-black.svg new file mode 100644 index 0000000..4ae0c82 --- /dev/null +++ b/src/main/webapp/content/img_datasurvey/datasurvey-logo-text-black.svg @@ -0,0 +1 @@ +Asset 5DATASURVEY \ No newline at end of file diff --git a/src/main/webapp/content/img_datasurvey/datasurvey-logo-text.svg b/src/main/webapp/content/img_datasurvey/datasurvey-logo-text.svg new file mode 100644 index 0000000..d5669cc --- /dev/null +++ b/src/main/webapp/content/img_datasurvey/datasurvey-logo-text.svg @@ -0,0 +1 @@ +Asset 4DATASURVEY \ No newline at end of file diff --git a/src/main/webapp/content/js/bootstrap-datetimepicker.js b/src/main/webapp/content/js/bootstrap-datetimepicker.js new file mode 100644 index 0000000..b693794 --- /dev/null +++ b/src/main/webapp/content/js/bootstrap-datetimepicker.js @@ -0,0 +1,2748 @@ +/*! version : 4.17.45 + ========================================================= + bootstrap-datetimejs + https://github.com/Eonasdan/bootstrap-datetimepicker + Copyright (c) 2015 Jonathan Peterson + ========================================================= + */ +/* + The MIT License (MIT) + + Copyright (c) 2015 Jonathan Peterson + + 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. + */ +/*global define:false */ +/*global exports:false */ +/*global require:false */ +/*global jQuery:false */ +/*global moment:false */ +(function (factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + // AMD is used - Register as an anonymous module. + define(['jquery', 'moment'], factory); + } else if (typeof exports === 'object') { + module.exports = factory(require('jquery'), require('moment')); + } else { + // Neither AMD nor CommonJS used. Use global variables. + if (typeof jQuery === 'undefined') { + throw 'bootstrap-datetimepicker requires jQuery to be loaded first'; + } + if (typeof moment === 'undefined') { + throw 'bootstrap-datetimepicker requires Moment.js to be loaded first'; + } + factory(jQuery, moment); + } +})(function ($, moment) { + 'use strict'; + if (!moment) { + throw new Error('bootstrap-datetimepicker requires Moment.js to be loaded first'); + } + + var dateTimePicker = function (element, options) { + var picker = {}, + date, + viewDate, + unset = true, + input, + component = false, + widget = false, + use24Hours, + minViewModeNumber = 0, + actualFormat, + parseFormats, + currentViewMode, + datePickerModes = [ + { + clsName: 'days', + navFnc: 'M', + navStep: 1, + }, + { + clsName: 'months', + navFnc: 'y', + navStep: 1, + }, + { + clsName: 'years', + navFnc: 'y', + navStep: 10, + }, + { + clsName: 'decades', + navFnc: 'y', + navStep: 100, + }, + ], + viewModes = ['days', 'months', 'years', 'decades'], + verticalModes = ['top', 'bottom', 'auto'], + horizontalModes = ['left', 'right', 'auto'], + toolbarPlacements = ['default', 'top', 'bottom'], + keyMap = { + up: 38, + 38: 'up', + down: 40, + 40: 'down', + left: 37, + 37: 'left', + right: 39, + 39: 'right', + tab: 9, + 9: 'tab', + escape: 27, + 27: 'escape', + enter: 13, + 13: 'enter', + pageUp: 33, + 33: 'pageUp', + pageDown: 34, + 34: 'pageDown', + shift: 16, + 16: 'shift', + control: 17, + 17: 'control', + space: 32, + 32: 'space', + t: 84, + 84: 't', + delete: 46, + 46: 'delete', + }, + keyState = {}, + /******************************************************************************** + * + * Private functions + * + ********************************************************************************/ + + hasTimeZone = function () { + return moment.tz !== undefined && options.timeZone !== undefined && options.timeZone !== null && options.timeZone !== ''; + }, + getMoment = function (d) { + var returnMoment; + + if (d === undefined || d === null) { + returnMoment = moment(); //TODO should this use format? and locale? + } else if (moment.isDate(d) || moment.isMoment(d)) { + // If the date that is passed in is already a Date() or moment() object, + // pass it directly to moment. + returnMoment = moment(d); + } else if (hasTimeZone()) { + // There is a string to parse and a default time zone + // parse with the tz function which takes a default time zone if it is not in the format string + returnMoment = moment.tz(d, parseFormats, options.useStrict, options.timeZone); + } else { + returnMoment = moment(d, parseFormats, options.useStrict); + } + + if (hasTimeZone()) { + returnMoment.tz(options.timeZone); + } + + return returnMoment; + }, + isEnabled = function (granularity) { + if (typeof granularity !== 'string' || granularity.length > 1) { + throw new TypeError('isEnabled expects a single character string parameter'); + } + switch (granularity) { + case 'y': + return actualFormat.indexOf('Y') !== -1; + case 'M': + return actualFormat.indexOf('M') !== -1; + case 'd': + return actualFormat.toLowerCase().indexOf('d') !== -1; + case 'h': + case 'H': + return actualFormat.toLowerCase().indexOf('h') !== -1; + case 'm': + return actualFormat.indexOf('m') !== -1; + case 's': + return actualFormat.indexOf('s') !== -1; + default: + return false; + } + }, + hasTime = function () { + return isEnabled('h') || isEnabled('m') || isEnabled('s'); + }, + hasDate = function () { + return isEnabled('y') || isEnabled('M') || isEnabled('d'); + }, + getDatePickerTemplate = function () { + var headTemplate = $('').append( + $('') + .append($('').addClass('prev').attr('data-action', 'previous').append($('').addClass(options.icons.previous))) + .append( + $('') + .addClass('picker-switch') + .attr('data-action', 'pickerSwitch') + .attr('colspan', options.calendarWeeks ? '6' : '5') + ) + .append($('').addClass('next').attr('data-action', 'next').append($('').addClass(options.icons.next))) + ), + contTemplate = $('').append($('').append($('').attr('colspan', options.calendarWeeks ? '8' : '7'))); + + return [ + $('
') + .addClass('datepicker-days') + .append($('').addClass('table-condensed').append(headTemplate).append($(''))), + $('
') + .addClass('datepicker-months') + .append($('
').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone())), + $('
') + .addClass('datepicker-years') + .append($('
').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone())), + $('
') + .addClass('datepicker-decades') + .append($('
').addClass('table-condensed').append(headTemplate.clone()).append(contTemplate.clone())), + ]; + }, + getTimePickerMainTemplate = function () { + var topRow = $(''), + middleRow = $(''), + bottomRow = $(''); + + if (isEnabled('h')) { + topRow.append( + $('' + + (this.isRTL ? '' : this.renderHeadIntroHtml()) + + this.renderHeadDateCellsHtml() + + (this.isRTL ? this.renderHeadIntroHtml() : '') + + '' + ); + }, + renderHeadDateCellsHtml: function () { + var t, + e, + n = []; + for (t = 0; t < this.colCnt; t++) (e = this.getCellDate(0, t)), n.push(this.renderHeadDateCellHtml(e)); + return n.join(''); + }, + renderHeadDateCellHtml: function (t, e, n) { + var i = this.view, + r = ['fc-day-header', i.widgetHeaderClass]; + return ( + 1 === this.rowCnt ? (r = r.concat(this.getDayClasses(t, !0))) : r.push('fc-' + Xt[t.day()]), + '' + ); + }, + renderBgTrHtml: function (t) { + return ( + '' + + (this.isRTL ? '' : this.renderBgIntroHtml(t)) + + this.renderBgCellsHtml(t) + + (this.isRTL ? this.renderBgIntroHtml(t) : '') + + '' + ); + }, + renderBgIntroHtml: function (t) { + return this.renderIntroHtml(); + }, + renderBgCellsHtml: function (t) { + var e, + n, + i = []; + for (e = 0; e < this.colCnt; e++) (n = this.getCellDate(t, e)), i.push(this.renderBgCellHtml(n)); + return i.join(''); + }, + renderBgCellHtml: function (t, e) { + var n = this.view, + i = this.getDayClasses(t); + return ( + i.unshift('fc-day', n.widgetContentClass), + '' + ); + }, + renderIntroHtml: function () {}, + bookendCells: function (t) { + var e = this.renderIntroHtml(); + e && (this.isRTL ? t.append(e) : t.prepend(e)); + }, + }), + Se = (qt.DayGrid = me.extend(ye, { + numbersVisible: !1, + bottomCoordPadding: 0, + rowEls: null, + cellEls: null, + helperEls: null, + rowCoordCache: null, + colCoordCache: null, + renderDates: function (t) { + var e, + n, + i = this.view, + r = this.rowCnt, + s = this.colCnt, + o = ''; + for (e = 0; e < r; e++) o += this.renderDayRowHtml(e, t); + for ( + this.el.html(o), + this.rowEls = this.el.find('.fc-row'), + this.cellEls = this.el.find('.fc-day'), + this.rowCoordCache = new fe({ els: this.rowEls, isVertical: !0 }), + this.colCoordCache = new fe({ els: this.cellEls.slice(0, this.colCnt), isHorizontal: !0 }), + e = 0; + e < r; + e++ + ) + for (n = 0; n < s; n++) i.publiclyTrigger('dayRender', null, this.getCellDate(e, n), this.getCellEl(e, n)); + }, + unrenderDates: function () { + this.removeSegPopover(); + }, + renderBusinessHours: function () { + var t = this.buildBusinessHourSegs(!0); + this.renderFill('businessHours', t, 'bgevent'); + }, + unrenderBusinessHours: function () { + this.unrenderFill('businessHours'); + }, + renderDayRowHtml: function (t, e) { + var n = this.view, + i = ['fc-row', 'fc-week', n.widgetContentClass]; + return ( + e && i.push('fc-rigid'), + '
').append( + $('') + .attr({ href: '#', tabindex: '-1', title: options.tooltips.incrementHour }) + .addClass('btn') + .attr('data-action', 'incrementHours') + .append($('').addClass(options.icons.up)) + ) + ); + middleRow.append( + $('').append( + $('') + .addClass('timepicker-hour') + .attr({ 'data-time-component': 'hours', title: options.tooltips.pickHour }) + .attr('data-action', 'showHours') + ) + ); + bottomRow.append( + $('').append( + $('') + .attr({ href: '#', tabindex: '-1', title: options.tooltips.decrementHour }) + .addClass('btn') + .attr('data-action', 'decrementHours') + .append($('').addClass(options.icons.down)) + ) + ); + } + if (isEnabled('m')) { + if (isEnabled('h')) { + topRow.append($('').addClass('separator')); + middleRow.append($('').addClass('separator').html(':')); + bottomRow.append($('').addClass('separator')); + } + topRow.append( + $('').append( + $('') + .attr({ href: '#', tabindex: '-1', title: options.tooltips.incrementMinute }) + .addClass('btn') + .attr('data-action', 'incrementMinutes') + .append($('').addClass(options.icons.up)) + ) + ); + middleRow.append( + $('').append( + $('') + .addClass('timepicker-minute') + .attr({ 'data-time-component': 'minutes', title: options.tooltips.pickMinute }) + .attr('data-action', 'showMinutes') + ) + ); + bottomRow.append( + $('').append( + $('') + .attr({ href: '#', tabindex: '-1', title: options.tooltips.decrementMinute }) + .addClass('btn') + .attr('data-action', 'decrementMinutes') + .append($('').addClass(options.icons.down)) + ) + ); + } + if (isEnabled('s')) { + if (isEnabled('m')) { + topRow.append($('').addClass('separator')); + middleRow.append($('').addClass('separator').html(':')); + bottomRow.append($('').addClass('separator')); + } + topRow.append( + $('').append( + $('') + .attr({ href: '#', tabindex: '-1', title: options.tooltips.incrementSecond }) + .addClass('btn') + .attr('data-action', 'incrementSeconds') + .append($('').addClass(options.icons.up)) + ) + ); + middleRow.append( + $('').append( + $('') + .addClass('timepicker-second') + .attr({ 'data-time-component': 'seconds', title: options.tooltips.pickSecond }) + .attr('data-action', 'showSeconds') + ) + ); + bottomRow.append( + $('').append( + $('') + .attr({ href: '#', tabindex: '-1', title: options.tooltips.decrementSecond }) + .addClass('btn') + .attr('data-action', 'decrementSeconds') + .append($('').addClass(options.icons.down)) + ) + ); + } + + if (!use24Hours) { + topRow.append($('').addClass('separator')); + middleRow.append( + $('').append( + $('').addClass('separator')); + } + + return $('
') + .addClass('timepicker-picker') + .append($('').addClass('table-condensed').append([topRow, middleRow, bottomRow])); + }, + getTimePickerTemplate = function () { + var hoursView = $('
').addClass('timepicker-hours').append($('
').addClass('table-condensed')), + minutesView = $('
').addClass('timepicker-minutes').append($('
').addClass('table-condensed')), + secondsView = $('
').addClass('timepicker-seconds').append($('
').addClass('table-condensed')), + ret = [getTimePickerMainTemplate()]; + + if (isEnabled('h')) { + ret.push(hoursView); + } + if (isEnabled('m')) { + ret.push(minutesView); + } + if (isEnabled('s')) { + ret.push(secondsView); + } + + return ret; + }, + getToolbar = function () { + var row = []; + if (options.showTodayButton) { + row.push( + $('').appendTo(this.$el); + } + this.$header.find('tr').each(function () { + var column = []; + + $(this) + .find('th') + .each(function () { + column.push( + $.extend( + {}, + { + title: $(this).html(), + class: $(this).attr('class'), + titleTooltip: $(this).attr('title'), + rowspan: $(this).attr('rowspan') ? +$(this).attr('rowspan') : undefined, + colspan: $(this).attr('colspan') ? +$(this).attr('colspan') : undefined, + }, + $(this).data() + ) + ); + }); + columns.push(column); + }); + if (!$.isArray(this.options.columns[0])) { + this.options.columns = [this.options.columns]; + } + this.options.columns = $.extend(true, [], columns, this.options.columns); + this.columns = []; + + setFieldIndex(this.options.columns); + $.each(this.options.columns, function (i, columns) { + $.each(columns, function (j, column) { + column = $.extend({}, BootstrapTable.COLUMN_DEFAULTS, column); + + if (typeof column.fieldIndex !== 'undefined') { + that.columns[column.fieldIndex] = column; + } + + that.options.columns[i][j] = column; + }); + }); + + // if options.data is setting, do not process tbody data + if (this.options.data.length) { + return; + } + + this.$el.find('tbody tr').each(function () { + var row = {}; + + // save tr's id, class and data-* attributes + row._id = $(this).attr('id'); + row._class = $(this).attr('class'); + row._data = getRealDataAttr($(this).data()); + + $(this) + .find('td') + .each(function (i) { + var field = that.columns[i].field; + + row[field] = $(this).html(); + // save td's id, class and data-* attributes + row['_' + field + '_id'] = $(this).attr('id'); + row['_' + field + '_class'] = $(this).attr('class'); + row['_' + field + '_rowspan'] = $(this).attr('rowspan'); + row['_' + field + '_title'] = $(this).attr('title'); + row['_' + field + '_data'] = getRealDataAttr($(this).data()); + }); + data.push(row); + }); + this.options.data = data; + }; + + BootstrapTable.prototype.initHeader = function () { + var that = this, + visibleColumns = {}, + html = []; + + this.header = { + fields: [], + styles: [], + classes: [], + formatters: [], + events: [], + sorters: [], + sortNames: [], + cellStyles: [], + clickToSelects: [], + searchables: [], + }; + + $.each(this.options.columns, function (i, columns) { + html.push(''); + + if (i == 0 && !that.options.cardView && that.options.detailView) { + html.push(sprintf('', that.options.columns.length)); + } + + $.each(columns, function (j, column) { + var text = '', + halign = '', // header align style + align = '', // body align style + style = '', + class_ = sprintf(' class="%s"', column['class']), + order = that.options.sortOrder || column.order, + unitWidth = 'px', + width = column.width; + + if (column.width !== undefined && !that.options.cardView) { + if (typeof column.width === 'string') { + if (column.width.indexOf('%') !== -1) { + unitWidth = '%'; + } + } + } + if (column.width && typeof column.width === 'string') { + width = column.width.replace('%', '').replace('px', ''); + } + + halign = sprintf('text-align: %s; ', column.halign ? column.halign : column.align); + align = sprintf('text-align: %s; ', column.align); + style = sprintf('vertical-align: %s; ', column.valign); + style += sprintf('width: %s%s; ', column.checkbox || column.radio ? 36 : width, unitWidth); + + if (typeof column.fieldIndex !== 'undefined') { + that.header.fields[column.fieldIndex] = column.field; + that.header.styles[column.fieldIndex] = align + style; + that.header.classes[column.fieldIndex] = class_; + that.header.formatters[column.fieldIndex] = column.formatter; + that.header.events[column.fieldIndex] = column.events; + that.header.sorters[column.fieldIndex] = column.sorter; + that.header.sortNames[column.fieldIndex] = column.sortName; + that.header.cellStyles[column.fieldIndex] = column.cellStyle; + that.header.clickToSelects[column.fieldIndex] = column.clickToSelect; + that.header.searchables[column.fieldIndex] = column.searchable; + + if (!column.visible) { + return; + } + + if (that.options.cardView && !column.cardVisible) { + return; + } + + visibleColumns[column.field] = column; + } + + html.push( + '' + ); + + html.push(sprintf('
', that.options.sortable && column.sortable ? 'sortable both' : '')); + + text = column.title; + + if (column.checkbox) { + if (!that.options.singleSelect && that.options.checkboxHeader) { + text = ''; + } + that.header.stateField = column.field; + } + if (column.radio) { + text = ''; + that.header.stateField = column.field; + that.options.singleSelect = true; + } + + html.push(text); + html.push('
'); + html.push('
'); + html.push(''); + html.push(''); + }); + html.push('
'); + }); + + this.$header.html(html.join('')); + this.$header.find('th[data-field]').each(function (i) { + $(this).data(visibleColumns[$(this).data('field')]); + }); + this.$container.off('click', '.th-inner').on('click', '.th-inner', function (event) { + if (that.options.sortable && $(this).parent().data().sortable) { + that.onSort(event); + } + }); + + if (!this.options.showHeader || this.options.cardView) { + this.$header.hide(); + this.$tableHeader.hide(); + this.$tableLoading.css('top', 0); + } else { + this.$header.show(); + this.$tableHeader.show(); + this.$tableLoading.css('top', this.$header.outerHeight() + 1); + // Assign the correct sortable arrow + this.getCaret(); + } + + this.$selectAll = this.$header.find('[name="btSelectAll"]'); + this.$container.off('click', '[name="btSelectAll"]').on('click', '[name="btSelectAll"]', function () { + var checked = $(this).prop('checked'); + that[checked ? 'checkAll' : 'uncheckAll'](); + }); + }; + + BootstrapTable.prototype.initFooter = function () { + if (!this.options.showFooter || this.options.cardView) { + this.$tableFooter.hide(); + } else { + this.$tableFooter.show(); + } + }; + + /** + * @param data + * @param type: append / prepend + */ + BootstrapTable.prototype.initData = function (data, type) { + if (type === 'append') { + this.data = this.data.concat(data); + } else if (type === 'prepend') { + this.data = [].concat(data).concat(this.data); + } else { + this.data = data || this.options.data; + } + + // Fix #839 Records deleted when adding new row on filtered table + if (type === 'append') { + this.options.data = this.options.data.concat(data); + } else if (type === 'prepend') { + this.options.data = [].concat(data).concat(this.options.data); + } else { + this.options.data = this.data; + } + + if (this.options.sidePagination === 'server') { + return; + } + this.initSort(); + }; + + BootstrapTable.prototype.initSort = function () { + var that = this, + name = this.options.sortName, + order = this.options.sortOrder === 'desc' ? -1 : 1, + index = $.inArray(this.options.sortName, this.header.fields); + + if (index !== -1) { + this.data.sort(function (a, b) { + if (that.header.sortNames[index]) { + name = that.header.sortNames[index]; + } + var aa = a[name], + bb = b[name], + value = calculateObjectValue(that.header, that.header.sorters[index], [aa, bb]); + + if (value !== undefined) { + return order * value; + } + + // Fix #161: undefined or null string sort bug. + if (aa === undefined || aa === null) { + aa = ''; + } + if (bb === undefined || bb === null) { + bb = ''; + } + + // IF both values are numeric, do a numeric comparison + if ($.isNumeric(aa) && $.isNumeric(bb)) { + // Convert numerical values form string to float. + aa = parseFloat(aa); + bb = parseFloat(bb); + if (aa < bb) { + return order * -1; + } + return order; + } + + if (aa === bb) { + return 0; + } + + // If value is not a string, convert to string + if (typeof aa !== 'string') { + aa = aa.toString(); + } + + if (aa.localeCompare(bb) === -1) { + return order * -1; + } + + return order; + }); + } + }; + + BootstrapTable.prototype.onSort = function (event) { + var $this = $(event.currentTarget).parent(), + $this_ = this.$header.find('th').eq($this.index()); + + this.$header.add(this.$header_).find('span.order').remove(); + + if (this.options.sortName === $this.data('field')) { + this.options.sortOrder = this.options.sortOrder === 'asc' ? 'desc' : 'asc'; + } else { + this.options.sortName = $this.data('field'); + this.options.sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc'; + } + this.trigger('sort', this.options.sortName, this.options.sortOrder); + + $this.add($this_).data('order', this.options.sortOrder); + + // Assign the correct sortable arrow + this.getCaret(); + + if (this.options.sidePagination === 'server') { + this.initServer(); + return; + } + + this.initSort(); + this.initBody(); + }; + + BootstrapTable.prototype.initToolbar = function () { + var that = this, + html = [], + timeoutId = 0, + $keepOpen, + $search, + switchableCount = 0; + + this.$toolbar.html(''); + + if (typeof this.options.toolbar === 'string') { + $(sprintf('
', this.options.toolbarAlign)).appendTo(this.$toolbar).append($(this.options.toolbar)); + } + + // showColumns, showToggle, showRefresh + html = [sprintf('
', this.options.buttonsAlign, this.options.buttonsAlign)]; + + if (typeof this.options.icons === 'string') { + this.options.icons = calculateObjectValue(null, this.options.icons); + } + + if (this.options.showPaginationSwitch) { + html.push( + sprintf('' + ); + } + + if (this.options.showRefresh) { + html.push( + sprintf( + '' + ); + } + + if (this.options.showToggle) { + html.push( + sprintf( + '' + ); + } + + if (this.options.showColumns) { + html.push( + sprintf('
', this.options.formatColumns()), + '', + '', '
'); + } + + html.push('
'); + + // Fix #188: this.showToolbar is for extentions + if (this.showToolbar || html.length > 2) { + this.$toolbar.append(html.join('')); + } + + if (this.options.showPaginationSwitch) { + this.$toolbar.find('button[name="paginationSwitch"]').off('click').on('click', $.proxy(this.togglePagination, this)); + } + + if (this.options.showRefresh) { + this.$toolbar.find('button[name="refresh"]').off('click').on('click', $.proxy(this.refresh, this)); + } + + if (this.options.showToggle) { + this.$toolbar + .find('button[name="toggle"]') + .off('click') + .on('click', function () { + that.toggleView(); + }); + } + + if (this.options.showColumns) { + $keepOpen = this.$toolbar.find('.keep-open'); + + if (switchableCount <= this.options.minimumCountColumns) { + $keepOpen.find('input').prop('disabled', true); + } + + $keepOpen + .find('li') + .off('click') + .on('click', function (event) { + event.stopImmediatePropagation(); + }); + $keepOpen + .find('input') + .off('click') + .on('click', function () { + var $this = $(this); + + that.toggleColumn(getFieldIndex(that.columns, $(this).data('field')), $this.prop('checked'), false); + that.trigger('column-switch', $(this).data('field'), $this.prop('checked')); + }); + } + + if (this.options.search) { + html = []; + html.push( + '' + ); + + this.$toolbar.append(html.join('')); + $search = this.$toolbar.find('.search input'); + $search.off('keyup drop').on('keyup drop', function (event) { + clearTimeout(timeoutId); // doesn't matter if it's 0 + timeoutId = setTimeout(function () { + that.onSearch(event); + }, that.options.searchTimeOut); + }); + + if (this.options.searchText !== '') { + $search.val(this.options.searchText); + clearTimeout(timeoutId); // doesn't matter if it's 0 + timeoutId = setTimeout(function () { + $search.trigger('keyup'); + }, that.options.searchTimeOut); + } + } + }; + + BootstrapTable.prototype.onSearch = function (event) { + var text = $.trim($(event.currentTarget).val()); + + // trim search input + if (this.options.trimOnSearch && $(event.currentTarget).val() !== text) { + $(event.currentTarget).val(text); + } + + if (text === this.searchText) { + return; + } + this.searchText = text; + + this.options.pageNumber = 1; + this.initSearch(); + this.updatePagination(); + this.trigger('search', text); + }; + + BootstrapTable.prototype.initSearch = function () { + var that = this; + + if (this.options.sidePagination !== 'server') { + var s = this.searchText && this.searchText.toLowerCase(); + var f = $.isEmptyObject(this.filterColumns) ? null : this.filterColumns; + + // Check filter + this.data = f + ? $.grep(this.options.data, function (item, i) { + for (var key in f) { + if (item[key] !== f[key]) { + return false; + } + } + return true; + }) + : this.options.data; + + this.data = s + ? $.grep(this.data, function (item, i) { + for (var key in item) { + key = $.isNumeric(key) ? parseInt(key, 10) : key; + var value = item[key], + column = that.columns[getFieldIndex(that.columns, key)], + j = $.inArray(key, that.header.fields); + + // Fix #142: search use formated data + value = calculateObjectValue(column, that.header.formatters[j], [value, item, i], value); + + var index = $.inArray(key, that.header.fields); + if (index !== -1 && that.header.searchables[index] && (typeof value === 'string' || typeof value === 'number')) { + if (that.options.strictSearch) { + if ((value + '').toLowerCase() === s) { + return true; + } + } else { + if ((value + '').toLowerCase().indexOf(s) !== -1) { + return true; + } + } + } + } + return false; + }) + : this.data; + } + }; + + BootstrapTable.prototype.initPagination = function () { + if (!this.options.pagination) { + this.$pagination.hide(); + return; + } else { + this.$pagination.show(); + } + + var that = this, + html = [], + $allSelected = false, + i, + from, + to, + $pageList, + $first, + $pre, + $next, + $last, + $number, + data = this.getData(); + + if (this.options.sidePagination !== 'server') { + this.options.totalRows = data.length; + } + + this.totalPages = 0; + if (this.options.totalRows) { + if (this.options.pageSize === this.options.formatAllRows()) { + this.options.pageSize = this.options.totalRows; + $allSelected = true; + } else if (this.options.pageSize === this.options.totalRows) { + // Fix #667 Table with pagination, + // multiple pages and a search that matches to one page throws exception + var pageLst = + typeof this.options.pageList === 'string' + ? this.options.pageList.replace('[', '').replace(']', '').replace(/ /g, '').toLowerCase().split(',') + : this.options.pageList; + if (pageLst.indexOf(this.options.formatAllRows().toLowerCase()) > -1) { + $allSelected = true; + } + } + + this.totalPages = ~~((this.options.totalRows - 1) / this.options.pageSize) + 1; + + this.options.totalPages = this.totalPages; + } + if (this.totalPages > 0 && this.options.pageNumber > this.totalPages) { + this.options.pageNumber = this.totalPages; + } + + this.pageFrom = (this.options.pageNumber - 1) * this.options.pageSize + 1; + this.pageTo = this.options.pageNumber * this.options.pageSize; + if (this.pageTo > this.options.totalRows) { + this.pageTo = this.options.totalRows; + } + + html.push( + '
', + '', + this.options.formatShowingRows(this.pageFrom, this.pageTo, this.options.totalRows), + '' + ); + + html.push(''); + + var pageNumber = [ + sprintf( + '', + this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ? 'dropdown' : 'dropup' + ), + '', + ''); + + html.push(this.options.formatRecordsPerPage(pageNumber.join(''))); + html.push(''); + + html.push( + '
', + '' + ); + + this.$pagination.html(html.join('')); + + $pageList = this.$pagination.find('.page-list a'); + $first = this.$pagination.find('.page-first'); + $pre = this.$pagination.find('.page-pre'); + $next = this.$pagination.find('.page-next'); + $last = this.$pagination.find('.page-last'); + $number = this.$pagination.find('.page-number'); + + if (this.options.pageNumber <= 1) { + $first.addClass('disabled'); + $pre.addClass('disabled'); + } + if (this.options.pageNumber >= this.totalPages) { + $next.addClass('disabled'); + $last.addClass('disabled'); + } + if (this.options.smartDisplay) { + if (this.totalPages <= 1) { + this.$pagination.find('div.pagination').hide(); + } + if (pageList.length < 2 || this.options.totalRows <= pageList[0]) { + this.$pagination.find('span.page-list').hide(); + } + + // when data is empty, hide the pagination + this.$pagination[this.getData().length ? 'show' : 'hide'](); + } + if ($allSelected) { + this.options.pageSize = this.options.formatAllRows(); + } + $pageList.off('click').on('click', $.proxy(this.onPageListChange, this)); + $first.off('click').on('click', $.proxy(this.onPageFirst, this)); + $pre.off('click').on('click', $.proxy(this.onPagePre, this)); + $next.off('click').on('click', $.proxy(this.onPageNext, this)); + $last.off('click').on('click', $.proxy(this.onPageLast, this)); + $number.off('click').on('click', $.proxy(this.onPageNumber, this)); + }; + + BootstrapTable.prototype.updatePagination = function (event) { + // Fix #171: IE disabled button can be clicked bug. + if (event && $(event.currentTarget).hasClass('disabled')) { + return; + } + + if (!this.options.maintainSelected) { + this.resetRows(); + } + + this.initPagination(); + if (this.options.sidePagination === 'server') { + this.initServer(); + } else { + this.initBody(); + } + + this.trigger('page-change', this.options.pageNumber, this.options.pageSize); + }; + + BootstrapTable.prototype.onPageListChange = function (event) { + var $this = $(event.currentTarget); + + $this.parent().addClass('active').siblings().removeClass('active'); + this.options.pageSize = + $this.text().toUpperCase() === this.options.formatAllRows().toUpperCase() ? this.options.formatAllRows() : +$this.text(); + this.$toolbar.find('.page-size').text(this.options.pageSize); + + this.updatePagination(event); + }; + + BootstrapTable.prototype.onPageFirst = function (event) { + this.options.pageNumber = 1; + this.updatePagination(event); + }; + + BootstrapTable.prototype.onPagePre = function (event) { + this.options.pageNumber--; + this.updatePagination(event); + }; + + BootstrapTable.prototype.onPageNext = function (event) { + this.options.pageNumber++; + this.updatePagination(event); + }; + + BootstrapTable.prototype.onPageLast = function (event) { + this.options.pageNumber = this.totalPages; + this.updatePagination(event); + }; + + BootstrapTable.prototype.onPageNumber = function (event) { + if (this.options.pageNumber === +$(event.currentTarget).text()) { + return; + } + this.options.pageNumber = +$(event.currentTarget).text(); + this.updatePagination(event); + }; + + BootstrapTable.prototype.initBody = function (fixedScroll) { + var that = this, + html = [], + data = this.getData(); + + this.trigger('pre-body', data); + + this.$body = this.$el.find('tbody'); + if (!this.$body.length) { + this.$body = $('').appendTo(this.$el); + } + + //Fix #389 Bootstrap-table-flatJSON is not working + + if (!this.options.pagination || this.options.sidePagination === 'server') { + this.pageFrom = 1; + this.pageTo = data.length; + } + + for (var i = this.pageFrom - 1; i < this.pageTo; i++) { + var key, + item = data[i], + style = {}, + csses = [], + data_ = '', + attributes = {}, + htmlAttributes = []; + + style = calculateObjectValue(this.options, this.options.rowStyle, [item, i], style); + + if (style && style.css) { + for (key in style.css) { + csses.push(key + ': ' + style.css[key]); + } + } + + attributes = calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes); + + if (attributes) { + for (key in attributes) { + htmlAttributes.push(sprintf('%s="%s"', key, escapeHTML(attributes[key]))); + } + } + + if (item._data && !$.isEmptyObject(item._data)) { + $.each(item._data, function (k, v) { + // ignore data-index + if (k === 'index') { + return; + } + data_ += sprintf(' data-%s="%s"', k, v); + }); + } + + html.push( + '' + ); + + if (this.options.cardView) { + html.push(sprintf('' + ); + } + + $.each(this.header.fields, function (j, field) { + var text = '', + value = item[field], + type = '', + cellStyle = {}, + id_ = '', + class_ = that.header.classes[j], + data_ = '', + rowspan_ = '', + title_ = '', + column = that.columns[getFieldIndex(that.columns, field)]; + + if (!column.visible) { + return; + } + + style = sprintf('style="%s"', csses.concat(that.header.styles[j]).join('; ')); + + value = calculateObjectValue(column, that.header.formatters[j], [value, item, i], value); + + // handle td's id and class + if (item['_' + field + '_id']) { + id_ = sprintf(' id="%s"', item['_' + field + '_id']); + } + if (item['_' + field + '_class']) { + class_ = sprintf(' class="%s"', item['_' + field + '_class']); + } + if (item['_' + field + '_rowspan']) { + rowspan_ = sprintf(' rowspan="%s"', item['_' + field + '_rowspan']); + } + if (item['_' + field + '_title']) { + title_ = sprintf(' title="%s"', item['_' + field + '_title']); + } + cellStyle = calculateObjectValue(that.header, that.header.cellStyles[j], [value, item, i], cellStyle); + if (cellStyle.classes) { + class_ = sprintf(' class="%s"', cellStyle.classes); + } + if (cellStyle.css) { + var csses_ = []; + for (var key in cellStyle.css) { + csses_.push(key + ': ' + cellStyle.css[key]); + } + style = sprintf('style="%s"', csses_.concat(that.header.styles[j]).join('; ')); + } + + if (item['_' + field + '_data'] && !$.isEmptyObject(item['_' + field + '_data'])) { + $.each(item['_' + field + '_data'], function (k, v) { + // ignore data-index + if (k === 'index') { + return; + } + data_ += sprintf(' data-%s="%s"', k, v); + }); + } + + if (column.checkbox || column.radio) { + type = column.checkbox ? 'checkbox' : type; + type = column.radio ? 'radio' : type; + + text = [ + that.options.cardView ? '
' : '
', + ].join(''); + + item[that.header.stateField] = value === true || (value && value.checked); + } else { + value = typeof value === 'undefined' || value === null ? that.options.undefinedText : value; + + text = that.options.cardView + ? [ + '
', + that.options.showHeader + ? sprintf('%s', style, getPropertyFromOther(that.columns, 'field', 'title', field)) + : '', + sprintf('%s', value), + '
', + ].join('') + : [sprintf('', id_, class_, style, data_, rowspan_, title_), value, ''].join(''); + + // Hide empty data on Card view when smartDisplay is set to true. + if (that.options.cardView && that.options.smartDisplay && value === '') { + text = ''; + } + } + + html.push(text); + }); + + if (this.options.cardView) { + html.push(''); + } + + html.push(''); + } + + // show no records + if (!html.length) { + html.push( + '', + sprintf('', this.$header.find('th').length, this.options.formatNoMatches()), + '' + ); + } + + this.$body.html(html.join('')); + + if (!fixedScroll) { + this.scrollTo(0); + } + + // click to select by column + this.$body + .find('> tr[data-index] > td') + .off('click dblclick') + .on('click dblclick', function (e) { + var $td = $(this), + $tr = $td.parent(), + item = that.data[$tr.data('index')], + cellIndex = $td[0].cellIndex, + $headerCell = that.$header.find('th:eq(' + cellIndex + ')'), + field = $headerCell.data('field'), + value = item[field]; + + that.trigger(e.type === 'click' ? 'click-cell' : 'dbl-click-cell', field, value, item, $td); + that.trigger(e.type === 'click' ? 'click-row' : 'dbl-click-row', item, $tr); + // if click to select - then trigger the checkbox/radio click + if (e.type === 'click' && that.options.clickToSelect) { + if (that.header.clickToSelects[$tr.children().index($(this))]) { + var $selectItem = $tr.find(sprintf('[name="%s"]', that.options.selectItemName)); + if ($selectItem.length) { + $selectItem[0].click(); // #144: .trigger('click') bug + } + } + } + }); + + this.$body + .find('> tr[data-index] > td > .detail-icon') + .off('click') + .on('click', function () { + var $this = $(this), + $tr = $this.parent().parent(), + index = $tr.data('index'), + row = data[index]; // Fix #980 Detail view, when searching, returns wrong row + + // remove and update + if ($tr.next().is('tr.detail-view')) { + $this.find('i').attr('class', sprintf('%s %s', that.options.iconsPrefix, that.options.icons.detailOpen)); + $tr.next().remove(); + that.trigger('collapse-row', index, row); + } else { + $this.find('i').attr('class', sprintf('%s %s', that.options.iconsPrefix, that.options.icons.detailClose)); + $tr.after( + sprintf( + '', + $tr.find('td').length, + calculateObjectValue(that.options, that.options.detailFormatter, [index, row], '') + ) + ); + that.trigger('expand-row', index, row, $tr.next().find('td')); + } + that.resetView(); + }); + + this.$selectItem = this.$body.find(sprintf('[name="%s"]', this.options.selectItemName)); + this.$selectItem.off('click').on('click', function (event) { + event.stopImmediatePropagation(); + + var checked = $(this).prop('checked'), + row = that.data[$(this).data('index')]; + + row[that.header.stateField] = checked; + + if (that.options.singleSelect) { + that.$selectItem.not(this).each(function () { + that.data[$(this).data('index')][that.header.stateField] = false; + }); + that.$selectItem.filter(':checked').not(this).prop('checked', false); + } + + that.updateSelected(); + that.trigger(checked ? 'check' : 'uncheck', row); + }); + + $.each(this.header.events, function (i, events) { + if (!events) { + return; + } + // fix bug, if events is defined with namespace + if (typeof events === 'string') { + events = calculateObjectValue(null, events); + } + + var field = that.header.fields[i], + fieldIndex = $.inArray(field, that.getVisibleFields()); + + if (that.options.detailView && !that.options.cardView) { + fieldIndex += 1; + } + + for (var key in events) { + that.$body.find('tr').each(function () { + var $tr = $(this), + $td = $tr.find(that.options.cardView ? '.card-view' : 'td').eq(fieldIndex), + index = key.indexOf(' '), + name = key.substring(0, index), + el = key.substring(index + 1), + func = events[key]; + + $td + .find(el) + .off(name) + .on(name, function (e) { + var index = $tr.data('index'), + row = that.data[index], + value = row[field]; + + func.apply(this, [e, value, row, index]); + }); + }); + } + }); + + this.updateSelected(); + this.resetView(); + + this.trigger('post-body'); + }; + + BootstrapTable.prototype.initServer = function (silent, query) { + var that = this, + data = {}, + params = { + pageSize: this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize, + pageNumber: this.options.pageNumber, + searchText: this.searchText, + sortName: this.options.sortName, + sortOrder: this.options.sortOrder, + }, + request; + + if (!this.options.url && !this.options.ajax) { + return; + } + + if (this.options.queryParamsType === 'limit') { + params = { + search: params.searchText, + sort: params.sortName, + order: params.sortOrder, + }; + if (this.options.pagination) { + params.limit = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize; + params.offset = this.options.pageSize === this.options.formatAllRows() ? 0 : this.options.pageSize * (this.options.pageNumber - 1); + } + } + + if (!$.isEmptyObject(this.filterColumnsPartial)) { + params['filter'] = JSON.stringify(this.filterColumnsPartial, null); + } + + data = calculateObjectValue(this.options, this.options.queryParams, [params], data); + + $.extend(data, query || {}); + + // false to stop request + if (data === false) { + return; + } + + if (!silent) { + this.$tableLoading.show(); + } + request = $.extend({}, calculateObjectValue(null, this.options.ajaxOptions), { + type: this.options.method, + url: this.options.url, + data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data, + cache: this.options.cache, + contentType: this.options.contentType, + dataType: this.options.dataType, + success: function (res) { + res = calculateObjectValue(that.options, that.options.responseHandler, [res], res); + + that.load(res); + that.trigger('load-success', res); + }, + error: function (res) { + that.trigger('load-error', res.status); + }, + complete: function () { + if (!silent) { + that.$tableLoading.hide(); + } + }, + }); + + if (this.options.ajax) { + calculateObjectValue(this, this.options.ajax, [request], null); + } else { + $.ajax(request); + } + }; + + BootstrapTable.prototype.getCaret = function () { + var that = this; + + $.each(this.$header.find('th'), function (i, th) { + $(th) + .find('.sortable') + .removeClass('desc asc') + .addClass($(th).data('field') === that.options.sortName ? that.options.sortOrder : 'both'); + }); + }; + + BootstrapTable.prototype.updateSelected = function () { + var checkAll = this.$selectItem.filter(':enabled').length === this.$selectItem.filter(':enabled').filter(':checked').length; + + this.$selectAll.add(this.$selectAll_).prop('checked', checkAll); + + this.$selectItem.each(function () { + $(this).parents('tr')[$(this).prop('checked') ? 'addClass' : 'removeClass']('selected'); + }); + }; + + BootstrapTable.prototype.updateRows = function () { + var that = this; + + this.$selectItem.each(function () { + that.data[$(this).data('index')][that.header.stateField] = $(this).prop('checked'); + }); + }; + + BootstrapTable.prototype.resetRows = function () { + var that = this; + + $.each(this.data, function (i, row) { + that.$selectAll.prop('checked', false); + that.$selectItem.prop('checked', false); + row[that.header.stateField] = false; + }); + }; + + BootstrapTable.prototype.trigger = function (name) { + var args = Array.prototype.slice.call(arguments, 1); + + name += '.bs.table'; + this.options[BootstrapTable.EVENTS[name]].apply(this.options, args); + this.$el.trigger($.Event(name), args); + + this.options.onAll(name, args); + this.$el.trigger($.Event('all.bs.table'), [name, args]); + }; + + BootstrapTable.prototype.resetHeader = function () { + // fix #61: the hidden table reset header bug. + // fix bug: get $el.css('width') error sometime (height = 500) + clearTimeout(this.timeoutId_); + this.timeoutId_ = setTimeout($.proxy(this.fitHeader, this), this.$el.is(':hidden') ? 100 : 0); + }; + + BootstrapTable.prototype.fitHeader = function () { + var that = this, + fixedBody, + scrollWidth; + + if (that.$el.is(':hidden')) { + that.timeoutId_ = setTimeout($.proxy(that.fitHeader, that), 100); + return; + } + fixedBody = this.$tableBody.get(0); + + scrollWidth = + fixedBody.scrollWidth > fixedBody.clientWidth && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() + ? getScrollBarWidth() + : 0; + + this.$el.css('margin-top', -this.$header.outerHeight()); + this.$header_ = this.$header.clone(true, true); + this.$selectAll_ = this.$header_.find('[name="btSelectAll"]'); + this.$tableHeader + .css({ + 'margin-right': scrollWidth, + }) + .find('table') + .css('width', this.$el.outerWidth()) + .html('') + .attr('class', this.$el.attr('class')) + .append(this.$header_); + + // fix bug: $.data() is not working as expected after $.append() + this.$header.find('th[data-field]').each(function (i) { + that.$header_.find(sprintf('th[data-field="%s"]', $(this).data('field'))).data($(this).data()); + }); + + var visibleFields = this.getVisibleFields(); + + this.$body.find('tr:first-child:not(.no-records-found) > *').each(function (i) { + var $this = $(this), + index = i; + + if (that.options.detailView && !that.options.cardView) { + if (i === 0) { + that.$header_.find('th.detail').find('.fht-cell').width($this.innerWidth()); + } + index = i - 1; + } + + that.$header_.find(sprintf('th[data-field="%s"]', visibleFields[index])).find('.fht-cell').width($this.innerWidth()); + }); + // horizontal scroll event + // TODO: it's probably better improving the layout than binding to scroll event + this.$tableBody.off('scroll').on('scroll', function () { + that.$tableHeader.scrollLeft($(this).scrollLeft()); + }); + that.trigger('post-header'); + }; + + BootstrapTable.prototype.resetFooter = function () { + var that = this, + data = that.getData(), + html = []; + + if (!this.options.showFooter || this.options.cardView) { + //do nothing + return; + } + + if (!this.options.cardView && this.options.detailView) { + html.push(''); + } + + $.each(this.columns, function (i, column) { + var falign = '', // footer align style + style = '', + class_ = sprintf(' class="%s"', column['class']); + + if (!column.visible) { + return; + } + + if (that.options.cardView && !column.cardVisible) { + return; + } + + falign = sprintf('text-align: %s; ', column.falign ? column.falign : column.align); + style = sprintf('vertical-align: %s; ', column.valign); + + html.push(''); + + html.push(calculateObjectValue(column, column.footerFormatter, [data], ' ') || ' '); + html.push(''); + }); + + this.$tableFooter.find('tr').html(html.join('')); + clearTimeout(this.timeoutFooter_); + this.timeoutFooter_ = setTimeout($.proxy(this.fitFooter, this), this.$el.is(':hidden') ? 100 : 0); + }; + + BootstrapTable.prototype.fitFooter = function () { + var that = this, + $footerTd, + elWidth, + scrollWidth; + + clearTimeout(this.timeoutFooter_); + if (this.$el.is(':hidden')) { + this.timeoutFooter_ = setTimeout($.proxy(this.fitFooter, this), 100); + return; + } + + elWidth = this.$el.css('width'); + scrollWidth = elWidth > this.$tableBody.width() ? getScrollBarWidth() : 0; + + this.$tableFooter + .css({ + 'margin-right': scrollWidth, + }) + .find('table') + .css('width', elWidth) + .attr('class', this.$el.attr('class')); + + $footerTd = this.$tableFooter.find('td'); + + this.$tableBody.find('tbody tr:first-child:not(.no-records-found) > td').each(function (i) { + $footerTd.eq(i).outerWidth($(this).outerWidth()); + }); + }; + + BootstrapTable.prototype.toggleColumn = function (index, checked, needUpdate) { + if (index === -1) { + return; + } + this.columns[index].visible = checked; + this.initHeader(); + this.initSearch(); + this.initPagination(); + this.initBody(); + + if (this.options.showColumns) { + var $items = this.$toolbar.find('.keep-open input').prop('disabled', false); + + if (needUpdate) { + $items.filter(sprintf('[value="%s"]', index)).prop('checked', checked); + } + + if ($items.filter(':checked').length <= this.options.minimumCountColumns) { + $items.filter(':checked').prop('disabled', true); + } + } + }; + + BootstrapTable.prototype.toggleRow = function (index, isIdField, visible) { + if (index === -1) { + return; + } + + $(this.$body[0]) + .children() + .filter(sprintf(isIdField ? '[data-uniqueid="%s"]' : '[data-index="%s"]', index)) + [visible ? 'show' : 'hide'](); + }; + + BootstrapTable.prototype.getVisibleFields = function () { + var that = this, + visibleFields = []; + + $.each(this.header.fields, function (j, field) { + var column = that.columns[getFieldIndex(that.columns, field)]; + + if (!column.visible) { + return; + } + visibleFields.push(field); + }); + return visibleFields; + }; + + // PUBLIC FUNCTION DEFINITION + // ======================= + + BootstrapTable.prototype.resetView = function (params) { + var padding = 0; + + if (params && params.height) { + this.options.height = params.height; + } + + this.$selectAll.prop('checked', this.$selectItem.length > 0 && this.$selectItem.length === this.$selectItem.filter(':checked').length); + + if (this.options.height) { + var toolbarHeight = getRealHeight(this.$toolbar), + paginationHeight = getRealHeight(this.$pagination), + height = this.options.height - toolbarHeight - paginationHeight; + + this.$tableContainer.css('height', height + 'px'); + } + + if (this.options.cardView) { + // remove the element css + this.$el.css('margin-top', '0'); + this.$tableContainer.css('padding-bottom', '0'); + return; + } + + if (this.options.showHeader && this.options.height) { + this.$tableHeader.show(); + this.resetHeader(); + padding += this.$header.outerHeight(); + } else { + this.$tableHeader.hide(); + this.trigger('post-header'); + } + + if (this.options.showFooter) { + this.resetFooter(); + if (this.options.height) { + padding += this.$tableFooter.outerHeight(); + } + } + + // Assign the correct sortable arrow + this.getCaret(); + this.$tableContainer.css('padding-bottom', padding + 'px'); + this.trigger('reset-view'); + }; + + BootstrapTable.prototype.getData = function (useCurrentPage) { + return this.searchText || !$.isEmptyObject(this.filterColumns) || !$.isEmptyObject(this.filterColumnsPartial) + ? useCurrentPage + ? this.data.slice(this.pageFrom - 1, this.pageTo) + : this.data + : useCurrentPage + ? this.options.data.slice(this.pageFrom - 1, this.pageTo) + : this.options.data; + }; + + BootstrapTable.prototype.load = function (data) { + var fixedScroll = false; + + // #431: support pagination + if (this.options.sidePagination === 'server') { + this.options.totalRows = data.total; + fixedScroll = data.fixedScroll; + data = data.rows; + } else if (!$.isArray(data)) { + // support fixedScroll + fixedScroll = data.fixedScroll; + data = data.data; + } + + this.initData(data); + this.initSearch(); + this.initPagination(); + this.initBody(fixedScroll); + }; + + BootstrapTable.prototype.append = function (data) { + this.initData(data, 'append'); + this.initSearch(); + this.initPagination(); + this.initBody(true); + }; + + BootstrapTable.prototype.prepend = function (data) { + this.initData(data, 'prepend'); + this.initSearch(); + this.initPagination(); + this.initBody(true); + }; + + BootstrapTable.prototype.remove = function (params) { + var len = this.options.data.length, + i, + row; + + if (!params.hasOwnProperty('field') || !params.hasOwnProperty('values')) { + return; + } + + for (i = len - 1; i >= 0; i--) { + row = this.options.data[i]; + + if (!row.hasOwnProperty(params.field)) { + continue; + } + if ($.inArray(row[params.field], params.values) !== -1) { + this.options.data.splice(i, 1); + } + } + + if (len === this.options.data.length) { + return; + } + + this.initSearch(); + this.initPagination(); + this.initBody(true); + }; + + BootstrapTable.prototype.removeAll = function () { + if (this.options.data.length > 0) { + this.options.data.splice(0, this.options.data.length); + this.initSearch(); + this.initPagination(); + this.initBody(true); + } + }; + + BootstrapTable.prototype.getRowByUniqueId = function (id) { + var uniqueId = this.options.uniqueId, + len = this.options.data.length, + dataRow = undefined, + i, + row; + + for (i = len - 1; i >= 0; i--) { + row = this.options.data[i]; + + if (!row.hasOwnProperty(uniqueId)) { + continue; + } + + if (typeof row[uniqueId] === 'string') { + id = id.toString(); + } else if (typeof row[uniqueId] === 'number') { + if (Number(row[uniqueId]) === row[uniqueId] && row[uniqueId] % 1 === 0) { + id = parseInt(id); + } else if (row[uniqueId] === Number(row[uniqueId]) && row[uniqueId] !== 0) { + id = parseFloat(id); + } + } + + if (row[uniqueId] === id) { + dataRow = row; + break; + } + } + + return dataRow; + }; + + BootstrapTable.prototype.removeByUniqueId = function (id) { + var len = this.options.data.length, + row = this.getRowByUniqueId(id); + + if (row) { + this.options.data.splice(this.options.data.indexOf(row), 1); + } + + if (len === this.options.data.length) { + return; + } + + this.initSearch(); + this.initPagination(); + this.initBody(true); + }; + + BootstrapTable.prototype.insertRow = function (params) { + if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) { + return; + } + this.data.splice(params.index, 0, params.row); + this.initSearch(); + this.initPagination(); + this.initSort(); + this.initBody(true); + }; + + BootstrapTable.prototype.updateRow = function (params) { + if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) { + return; + } + $.extend(this.data[params.index], params.row); + this.initSort(); + this.initBody(true); + }; + + BootstrapTable.prototype.showRow = function (params) { + if (!params.hasOwnProperty('index')) { + return; + } + + this.toggleRow(params.index, params.isIdField === undefined ? false : true, true); + }; + + BootstrapTable.prototype.hideRow = function (params) { + if (!params.hasOwnProperty('index')) { + return; + } + + this.toggleRow(params.index, params.isIdField === undefined ? false : true, false); + }; + + BootstrapTable.prototype.getRowsHidden = function (show) { + var rows = $(this.$body[0]).children().filter(':hidden'), + i = 0; + if (show) { + for (; i < rows.length; i++) { + $(rows[i]).show(); + } + } + return rows; + }; + + BootstrapTable.prototype.mergeCells = function (options) { + var row = options.index, + col = $.inArray(options.field, this.getVisibleFields()), + rowspan = options.rowspan || 1, + colspan = options.colspan || 1, + i, + j, + $tr = this.$body.find('tr'), + $td; + + if (this.options.detailView && !this.options.cardView) { + col += 1; + } + + $td = $tr.eq(row).find('td').eq(col); + + if (row < 0 || col < 0 || row >= this.data.length) { + return; + } + + for (i = row; i < row + rowspan; i++) { + for (j = col; j < col + colspan; j++) { + $tr.eq(i).find('td').eq(j).hide(); + } + } + + $td.attr('rowspan', rowspan).attr('colspan', colspan).show(); + }; + + BootstrapTable.prototype.updateCell = function (params) { + if (!params.hasOwnProperty('rowIndex') || !params.hasOwnProperty('fieldName') || !params.hasOwnProperty('fieldValue')) { + return; + } + this.data[params.rowIndex][params.fieldName] = params.fieldValue; + this.initSort(); + this.initBody(true); + }; + + BootstrapTable.prototype.getOptions = function () { + return this.options; + }; + + BootstrapTable.prototype.getSelections = function () { + var that = this; + + return $.grep(this.data, function (row) { + return row[that.header.stateField]; + }); + }; + + BootstrapTable.prototype.getAllSelections = function () { + var that = this; + + return $.grep(this.options.data, function (row) { + return row[that.header.stateField]; + }); + }; + + BootstrapTable.prototype.checkAll = function () { + this.checkAll_(true); + }; + + BootstrapTable.prototype.uncheckAll = function () { + this.checkAll_(false); + }; + + BootstrapTable.prototype.checkAll_ = function (checked) { + var rows; + if (!checked) { + rows = this.getSelections(); + } + this.$selectItem.filter(':enabled').prop('checked', checked); + this.updateRows(); + this.updateSelected(); + if (checked) { + rows = this.getSelections(); + } + this.trigger(checked ? 'check-all' : 'uncheck-all', rows); + }; + + BootstrapTable.prototype.check = function (index) { + this.check_(true, index); + }; + + BootstrapTable.prototype.uncheck = function (index) { + this.check_(false, index); + }; + + BootstrapTable.prototype.check_ = function (checked, index) { + this.$selectItem.filter(sprintf('[data-index="%s"]', index)).prop('checked', checked); + this.data[index][this.header.stateField] = checked; + this.updateSelected(); + this.trigger(checked ? 'check' : 'uncheck', this.data[index]); + }; + + BootstrapTable.prototype.checkBy = function (obj) { + this.checkBy_(true, obj); + }; + + BootstrapTable.prototype.uncheckBy = function (obj) { + this.checkBy_(false, obj); + }; + + BootstrapTable.prototype.checkBy_ = function (checked, obj) { + if (!obj.hasOwnProperty('field') || !obj.hasOwnProperty('values')) { + return; + } + + var that = this, + rows = []; + $.each(this.options.data, function (index, row) { + if (!row.hasOwnProperty(obj.field)) { + return false; + } + if ($.inArray(row[obj.field], obj.values) !== -1) { + that.$selectItem.filter(sprintf('[data-index="%s"]', index)).prop('checked', checked); + row[that.header.stateField] = checked; + rows.push(row); + that.trigger(checked ? 'check' : 'uncheck', row); + } + }); + this.updateSelected(); + this.trigger(checked ? 'check-some' : 'uncheck-some', rows); + }; + + BootstrapTable.prototype.destroy = function () { + this.$el.insertBefore(this.$container); + $(this.options.toolbar).insertBefore(this.$el); + this.$container.next().remove(); + this.$container.remove(); + this.$el + .html(this.$el_.html()) + .css('margin-top', '0') + .attr('class', this.$el_.attr('class') || ''); // reset the class + }; + + BootstrapTable.prototype.showLoading = function () { + this.$tableLoading.show(); + }; + + BootstrapTable.prototype.hideLoading = function () { + this.$tableLoading.hide(); + }; + + BootstrapTable.prototype.togglePagination = function () { + this.options.pagination = !this.options.pagination; + var button = this.$toolbar.find('button[name="paginationSwitch"] i'); + if (this.options.pagination) { + button.attr('class', this.options.iconsPrefix + ' ' + this.options.icons.paginationSwitchDown); + } else { + button.attr('class', this.options.iconsPrefix + ' ' + this.options.icons.paginationSwitchUp); + } + this.updatePagination(); + }; + + BootstrapTable.prototype.refresh = function (params) { + if (params && params.url) { + this.options.url = params.url; + this.options.pageNumber = 1; + } + this.initServer(params && params.silent, params && params.query); + }; + + BootstrapTable.prototype.resetWidth = function () { + if (this.options.showHeader && this.options.height) { + this.fitHeader(); + } + if (this.options.showFooter) { + this.fitFooter(); + } + }; + + BootstrapTable.prototype.showColumn = function (field) { + this.toggleColumn(getFieldIndex(this.columns, field), true, true); + }; + + BootstrapTable.prototype.hideColumn = function (field) { + this.toggleColumn(getFieldIndex(this.columns, field), false, true); + }; + + BootstrapTable.prototype.getHiddenColumns = function () { + return $.grep(this.columns, function (column) { + return !column.visible; + }); + }; + + BootstrapTable.prototype.filterBy = function (columns) { + this.filterColumns = $.isEmptyObject(columns) ? {} : columns; + this.options.pageNumber = 1; + this.initSearch(); + this.updatePagination(); + }; + + BootstrapTable.prototype.scrollTo = function (value) { + if (typeof value === 'string') { + value = value === 'bottom' ? this.$tableBody[0].scrollHeight : 0; + } + if (typeof value === 'number') { + this.$tableBody.scrollTop(value); + } + if (typeof value === 'undefined') { + return this.$tableBody.scrollTop(); + } + }; + + BootstrapTable.prototype.getScrollPosition = function () { + return this.scrollTo(); + }; + + BootstrapTable.prototype.selectPage = function (page) { + if (page > 0 && page <= this.options.totalPages) { + this.options.pageNumber = page; + this.updatePagination(); + } + }; + + BootstrapTable.prototype.prevPage = function () { + if (this.options.pageNumber > 1) { + this.options.pageNumber--; + this.updatePagination(); + } + }; + + BootstrapTable.prototype.nextPage = function () { + if (this.options.pageNumber < this.options.totalPages) { + this.options.pageNumber++; + this.updatePagination(); + } + }; + + BootstrapTable.prototype.toggleView = function () { + this.options.cardView = !this.options.cardView; + this.initHeader(); + // Fixed remove toolbar when click cardView button. + //that.initToolbar(); + this.initBody(); + this.trigger('toggle', this.options.cardView); + }; + + BootstrapTable.prototype.refreshOptions = function (options) { + //If the objects are equivalent then avoid the call of destroy / init methods + if (compareObjects(this.options, options, false)) { + return; + } + this.options = $.extend(this.options, options); + this.trigger('refresh-options', this.options); + this.destroy(); + this.init(); + }; + + // BOOTSTRAP TABLE PLUGIN DEFINITION + // ======================= + + var allowedMethods = [ + 'getOptions', + 'getSelections', + 'getAllSelections', + 'getData', + 'load', + 'append', + 'prepend', + 'remove', + 'removeAll', + 'insertRow', + 'updateRow', + 'updateCell', + 'removeByUniqueId', + 'getRowByUniqueId', + 'showRow', + 'hideRow', + 'getRowsHidden', + 'mergeCells', + 'checkAll', + 'uncheckAll', + 'check', + 'uncheck', + 'checkBy', + 'uncheckBy', + 'refresh', + 'resetView', + 'resetWidth', + 'destroy', + 'showLoading', + 'hideLoading', + 'showColumn', + 'hideColumn', + 'getHiddenColumns', + 'filterBy', + 'scrollTo', + 'getScrollPosition', + 'selectPage', + 'prevPage', + 'nextPage', + 'togglePagination', + 'toggleView', + 'refreshOptions', + ]; + + $.fn.bootstrapTable = function (option) { + var value, + args = Array.prototype.slice.call(arguments, 1); + + this.each(function () { + var $this = $(this), + data = $this.data('bootstrap.table'), + options = $.extend({}, BootstrapTable.DEFAULTS, $this.data(), typeof option === 'object' && option); + + if (typeof option === 'string') { + if ($.inArray(option, allowedMethods) < 0) { + throw new Error('Unknown method: ' + option); + } + + if (!data) { + return; + } + + value = data[option].apply(data, args); + + if (option === 'destroy') { + $this.removeData('bootstrap.table'); + } + } + + if (!data) { + $this.data('bootstrap.table', (data = new BootstrapTable(this, options))); + } + }); + + return typeof value === 'undefined' ? this : value; + }; + + $.fn.bootstrapTable.Constructor = BootstrapTable; + $.fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS; + $.fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS; + $.fn.bootstrapTable.locales = BootstrapTable.LOCALES; + $.fn.bootstrapTable.methods = allowedMethods; + + // BOOTSTRAP TABLE INIT + // ======================= + + $(function () { + $('[data-toggle="table"]').bootstrapTable(); + }); +})(jQuery); diff --git a/src/main/webapp/content/js/bootstrap.min.js b/src/main/webapp/content/js/bootstrap.min.js new file mode 100644 index 0000000..3a3d346 --- /dev/null +++ b/src/main/webapp/content/js/bootstrap.min.js @@ -0,0 +1,1329 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under the MIT license + */ +if ('undefined' == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery"); ++(function (a) { + 'use strict'; + var b = a.fn.jquery.split(' ')[0].split('.'); + if ((b[0] < 2 && b[1] < 9) || (1 == b[0] && 9 == b[1] && b[2] < 1) || b[0] > 3) + throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4"); +})(jQuery), + +(function (a) { + 'use strict'; + function b() { + var a = document.createElement('bootstrap'), + b = { + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'transitionend', + OTransition: 'oTransitionEnd otransitionend', + transition: 'transitionend', + }; + for (var c in b) if (void 0 !== a.style[c]) return { end: b[c] }; + return !1; + } + (a.fn.emulateTransitionEnd = function (b) { + var c = !1, + d = this; + a(this).one('bsTransitionEnd', function () { + c = !0; + }); + var e = function () { + c || a(d).trigger(a.support.transition.end); + }; + return setTimeout(e, b), this; + }), + a(function () { + (a.support.transition = b()), + a.support.transition && + (a.event.special.bsTransitionEnd = { + bindType: a.support.transition.end, + delegateType: a.support.transition.end, + handle: function (b) { + if (a(b.target).is(this)) return b.handleObj.handler.apply(this, arguments); + }, + }); + }); + })(jQuery), + +(function (a) { + 'use strict'; + function b(b) { + return this.each(function () { + var c = a(this), + e = c.data('bs.alert'); + e || c.data('bs.alert', (e = new d(this))), 'string' == typeof b && e[b].call(c); + }); + } + var c = '[data-dismiss="alert"]', + d = function (b) { + a(b).on('click', c, this.close); + }; + (d.VERSION = '3.3.7'), + (d.TRANSITION_DURATION = 150), + (d.prototype.close = function (b) { + function c() { + g.detach().trigger('closed.bs.alert').remove(); + } + var e = a(this), + f = e.attr('data-target'); + f || ((f = e.attr('href')), (f = f && f.replace(/.*(?=#[^\s]*$)/, ''))); + var g = a('#' === f ? [] : f); + b && b.preventDefault(), + g.length || (g = e.closest('.alert')), + g.trigger((b = a.Event('close.bs.alert'))), + b.isDefaultPrevented() || + (g.removeClass('in'), + a.support.transition && g.hasClass('fade') ? g.one('bsTransitionEnd', c).emulateTransitionEnd(d.TRANSITION_DURATION) : c()); + }); + var e = a.fn.alert; + (a.fn.alert = b), + (a.fn.alert.Constructor = d), + (a.fn.alert.noConflict = function () { + return (a.fn.alert = e), this; + }), + a(document).on('click.bs.alert.data-api', c, d.prototype.close); + })(jQuery), + +(function (a) { + 'use strict'; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data('bs.button'), + f = 'object' == typeof b && b; + e || d.data('bs.button', (e = new c(this, f))), 'toggle' == b ? e.toggle() : b && e.setState(b); + }); + } + var c = function (b, d) { + (this.$element = a(b)), (this.options = a.extend({}, c.DEFAULTS, d)), (this.isLoading = !1); + }; + (c.VERSION = '3.3.7'), + (c.DEFAULTS = { loadingText: 'loading...' }), + (c.prototype.setState = function (b) { + var c = 'disabled', + d = this.$element, + e = d.is('input') ? 'val' : 'html', + f = d.data(); + (b += 'Text'), + null == f.resetText && d.data('resetText', d[e]()), + setTimeout( + a.proxy(function () { + d[e](null == f[b] ? this.options[b] : f[b]), + 'loadingText' == b + ? ((this.isLoading = !0), d.addClass(c).attr(c, c).prop(c, !0)) + : this.isLoading && ((this.isLoading = !1), d.removeClass(c).removeAttr(c).prop(c, !1)); + }, this), + 0 + ); + }), + (c.prototype.toggle = function () { + var a = !0, + b = this.$element.closest('[data-toggle="buttons"]'); + if (b.length) { + var c = this.$element.find('input'); + 'radio' == c.prop('type') + ? (c.prop('checked') && (a = !1), b.find('.active').removeClass('active'), this.$element.addClass('active')) + : 'checkbox' == c.prop('type') && + (c.prop('checked') !== this.$element.hasClass('active') && (a = !1), this.$element.toggleClass('active')), + c.prop('checked', this.$element.hasClass('active')), + a && c.trigger('change'); + } else this.$element.attr('aria-pressed', !this.$element.hasClass('active')), this.$element.toggleClass('active'); + }); + var d = a.fn.button; + (a.fn.button = b), + (a.fn.button.Constructor = c), + (a.fn.button.noConflict = function () { + return (a.fn.button = d), this; + }), + a(document) + .on('click.bs.button.data-api', '[data-toggle^="button"]', function (c) { + var d = a(c.target).closest('.btn'); + b.call(d, 'toggle'), + a(c.target).is('input[type="radio"], input[type="checkbox"]') || + (c.preventDefault(), + d.is('input,button') ? d.trigger('focus') : d.find('input:visible,button:visible').first().trigger('focus')); + }) + .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (b) { + a(b.target) + .closest('.btn') + .toggleClass('focus', /^focus(in)?$/.test(b.type)); + }); + })(jQuery), + +(function (a) { + 'use strict'; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data('bs.carousel'), + f = a.extend({}, c.DEFAULTS, d.data(), 'object' == typeof b && b), + g = 'string' == typeof b ? b : f.slide; + e || d.data('bs.carousel', (e = new c(this, f))), 'number' == typeof b ? e.to(b) : g ? e[g]() : f.interval && e.pause().cycle(); + }); + } + var c = function (b, c) { + (this.$element = a(b)), + (this.$indicators = this.$element.find('.carousel-indicators')), + (this.options = c), + (this.paused = null), + (this.sliding = null), + (this.interval = null), + (this.$active = null), + (this.$items = null), + this.options.keyboard && this.$element.on('keydown.bs.carousel', a.proxy(this.keydown, this)), + 'hover' == this.options.pause && + !('ontouchstart' in document.documentElement) && + this.$element.on('mouseenter.bs.carousel', a.proxy(this.pause, this)).on('mouseleave.bs.carousel', a.proxy(this.cycle, this)); + }; + (c.VERSION = '3.3.7'), + (c.TRANSITION_DURATION = 600), + (c.DEFAULTS = { interval: 5e3, pause: 'hover', wrap: !0, keyboard: !0 }), + (c.prototype.keydown = function (a) { + if (!/input|textarea/i.test(a.target.tagName)) { + switch (a.which) { + case 37: + this.prev(); + break; + case 39: + this.next(); + break; + default: + return; + } + a.preventDefault(); + } + }), + (c.prototype.cycle = function (b) { + return ( + b || (this.paused = !1), + this.interval && clearInterval(this.interval), + this.options.interval && !this.paused && (this.interval = setInterval(a.proxy(this.next, this), this.options.interval)), + this + ); + }), + (c.prototype.getItemIndex = function (a) { + return (this.$items = a.parent().children('.item')), this.$items.index(a || this.$active); + }), + (c.prototype.getItemForDirection = function (a, b) { + var c = this.getItemIndex(b), + d = ('prev' == a && 0 === c) || ('next' == a && c == this.$items.length - 1); + if (d && !this.options.wrap) return b; + var e = 'prev' == a ? -1 : 1, + f = (c + e) % this.$items.length; + return this.$items.eq(f); + }), + (c.prototype.to = function (a) { + var b = this, + c = this.getItemIndex((this.$active = this.$element.find('.item.active'))); + if (!(a > this.$items.length - 1 || a < 0)) + return this.sliding + ? this.$element.one('slid.bs.carousel', function () { + b.to(a); + }) + : c == a + ? this.pause().cycle() + : this.slide(a > c ? 'next' : 'prev', this.$items.eq(a)); + }), + (c.prototype.pause = function (b) { + return ( + b || (this.paused = !0), + this.$element.find('.next, .prev').length && + a.support.transition && + (this.$element.trigger(a.support.transition.end), this.cycle(!0)), + (this.interval = clearInterval(this.interval)), + this + ); + }), + (c.prototype.next = function () { + if (!this.sliding) return this.slide('next'); + }), + (c.prototype.prev = function () { + if (!this.sliding) return this.slide('prev'); + }), + (c.prototype.slide = function (b, d) { + var e = this.$element.find('.item.active'), + f = d || this.getItemForDirection(b, e), + g = this.interval, + h = 'next' == b ? 'left' : 'right', + i = this; + if (f.hasClass('active')) return (this.sliding = !1); + var j = f[0], + k = a.Event('slide.bs.carousel', { relatedTarget: j, direction: h }); + if ((this.$element.trigger(k), !k.isDefaultPrevented())) { + if (((this.sliding = !0), g && this.pause(), this.$indicators.length)) { + this.$indicators.find('.active').removeClass('active'); + var l = a(this.$indicators.children()[this.getItemIndex(f)]); + l && l.addClass('active'); + } + var m = a.Event('slid.bs.carousel', { relatedTarget: j, direction: h }); + return ( + a.support.transition && this.$element.hasClass('slide') + ? (f.addClass(b), + f[0].offsetWidth, + e.addClass(h), + f.addClass(h), + e + .one('bsTransitionEnd', function () { + f.removeClass([b, h].join(' ')).addClass('active'), + e.removeClass(['active', h].join(' ')), + (i.sliding = !1), + setTimeout(function () { + i.$element.trigger(m); + }, 0); + }) + .emulateTransitionEnd(c.TRANSITION_DURATION)) + : (e.removeClass('active'), f.addClass('active'), (this.sliding = !1), this.$element.trigger(m)), + g && this.cycle(), + this + ); + } + }); + var d = a.fn.carousel; + (a.fn.carousel = b), + (a.fn.carousel.Constructor = c), + (a.fn.carousel.noConflict = function () { + return (a.fn.carousel = d), this; + }); + var e = function (c) { + var d, + e = a(this), + f = a(e.attr('data-target') || ((d = e.attr('href')) && d.replace(/.*(?=#[^\s]+$)/, ''))); + if (f.hasClass('carousel')) { + var g = a.extend({}, f.data(), e.data()), + h = e.attr('data-slide-to'); + h && (g.interval = !1), b.call(f, g), h && f.data('bs.carousel').to(h), c.preventDefault(); + } + }; + a(document).on('click.bs.carousel.data-api', '[data-slide]', e).on('click.bs.carousel.data-api', '[data-slide-to]', e), + a(window).on('load', function () { + a('[data-ride="carousel"]').each(function () { + var c = a(this); + b.call(c, c.data()); + }); + }); + })(jQuery), + +(function (a) { + 'use strict'; + function b(b) { + var c, + d = b.attr('data-target') || ((c = b.attr('href')) && c.replace(/.*(?=#[^\s]+$)/, '')); + return a(d); + } + function c(b) { + return this.each(function () { + var c = a(this), + e = c.data('bs.collapse'), + f = a.extend({}, d.DEFAULTS, c.data(), 'object' == typeof b && b); + !e && f.toggle && /show|hide/.test(b) && (f.toggle = !1), + e || c.data('bs.collapse', (e = new d(this, f))), + 'string' == typeof b && e[b](); + }); + } + var d = function (b, c) { + (this.$element = a(b)), + (this.options = a.extend({}, d.DEFAULTS, c)), + (this.$trigger = a('[data-toggle="collapse"][href="#' + b.id + '"],[data-toggle="collapse"][data-target="#' + b.id + '"]')), + (this.transitioning = null), + this.options.parent ? (this.$parent = this.getParent()) : this.addAriaAndCollapsedClass(this.$element, this.$trigger), + this.options.toggle && this.toggle(); + }; + (d.VERSION = '3.3.7'), + (d.TRANSITION_DURATION = 350), + (d.DEFAULTS = { toggle: !0 }), + (d.prototype.dimension = function () { + var a = this.$element.hasClass('width'); + return a ? 'width' : 'height'; + }), + (d.prototype.show = function () { + if (!this.transitioning && !this.$element.hasClass('in')) { + var b, + e = this.$parent && this.$parent.children('.panel').children('.in, .collapsing'); + if (!(e && e.length && ((b = e.data('bs.collapse')), b && b.transitioning))) { + var f = a.Event('show.bs.collapse'); + if ((this.$element.trigger(f), !f.isDefaultPrevented())) { + e && e.length && (c.call(e, 'hide'), b || e.data('bs.collapse', null)); + var g = this.dimension(); + this.$element.removeClass('collapse').addClass('collapsing')[g](0).attr('aria-expanded', !0), + this.$trigger.removeClass('collapsed').attr('aria-expanded', !0), + (this.transitioning = 1); + var h = function () { + this.$element.removeClass('collapsing').addClass('collapse in')[g](''), + (this.transitioning = 0), + this.$element.trigger('shown.bs.collapse'); + }; + if (!a.support.transition) return h.call(this); + var i = a.camelCase(['scroll', g].join('-')); + this.$element.one('bsTransitionEnd', a.proxy(h, this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i]); + } + } + } + }), + (d.prototype.hide = function () { + if (!this.transitioning && this.$element.hasClass('in')) { + var b = a.Event('hide.bs.collapse'); + if ((this.$element.trigger(b), !b.isDefaultPrevented())) { + var c = this.dimension(); + this.$element[c](this.$element[c]())[0].offsetHeight, + this.$element.addClass('collapsing').removeClass('collapse in').attr('aria-expanded', !1), + this.$trigger.addClass('collapsed').attr('aria-expanded', !1), + (this.transitioning = 1); + var e = function () { + (this.transitioning = 0), this.$element.removeClass('collapsing').addClass('collapse').trigger('hidden.bs.collapse'); + }; + return a.support.transition + ? void this.$element[c](0).one('bsTransitionEnd', a.proxy(e, this)).emulateTransitionEnd(d.TRANSITION_DURATION) + : e.call(this); + } + } + }), + (d.prototype.toggle = function () { + this[this.$element.hasClass('in') ? 'hide' : 'show'](); + }), + (d.prototype.getParent = function () { + return a(this.options.parent) + .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') + .each( + a.proxy(function (c, d) { + var e = a(d); + this.addAriaAndCollapsedClass(b(e), e); + }, this) + ) + .end(); + }), + (d.prototype.addAriaAndCollapsedClass = function (a, b) { + var c = a.hasClass('in'); + a.attr('aria-expanded', c), b.toggleClass('collapsed', !c).attr('aria-expanded', c); + }); + var e = a.fn.collapse; + (a.fn.collapse = c), + (a.fn.collapse.Constructor = d), + (a.fn.collapse.noConflict = function () { + return (a.fn.collapse = e), this; + }), + a(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (d) { + var e = a(this); + e.attr('data-target') || d.preventDefault(); + var f = b(e), + g = f.data('bs.collapse'), + h = g ? 'toggle' : e.data(); + c.call(f, h); + }); + })(jQuery), + +(function (a) { + 'use strict'; + function b(b) { + var c = b.attr('data-target'); + c || ((c = b.attr('href')), (c = c && /#[A-Za-z]/.test(c) && c.replace(/.*(?=#[^\s]*$)/, ''))); + var d = c && a(c); + return d && d.length ? d : b.parent(); + } + function c(c) { + (c && 3 === c.which) || + (a(e).remove(), + a(f).each(function () { + var d = a(this), + e = b(d), + f = { relatedTarget: this }; + e.hasClass('open') && + ((c && 'click' == c.type && /input|textarea/i.test(c.target.tagName) && a.contains(e[0], c.target)) || + (e.trigger((c = a.Event('hide.bs.dropdown', f))), + c.isDefaultPrevented() || + (d.attr('aria-expanded', 'false'), e.removeClass('open').trigger(a.Event('hidden.bs.dropdown', f))))); + })); + } + function d(b) { + return this.each(function () { + var c = a(this), + d = c.data('bs.dropdown'); + d || c.data('bs.dropdown', (d = new g(this))), 'string' == typeof b && d[b].call(c); + }); + } + var e = '.dropdown-backdrop', + f = '[data-toggle="dropdown"]', + g = function (b) { + a(b).on('click.bs.dropdown', this.toggle); + }; + (g.VERSION = '3.3.7'), + (g.prototype.toggle = function (d) { + var e = a(this); + if (!e.is('.disabled, :disabled')) { + var f = b(e), + g = f.hasClass('open'); + if ((c(), !g)) { + 'ontouchstart' in document.documentElement && + !f.closest('.navbar-nav').length && + a(document.createElement('div')).addClass('dropdown-backdrop').insertAfter(a(this)).on('click', c); + var h = { relatedTarget: this }; + if ((f.trigger((d = a.Event('show.bs.dropdown', h))), d.isDefaultPrevented())) return; + e.trigger('focus').attr('aria-expanded', 'true'), f.toggleClass('open').trigger(a.Event('shown.bs.dropdown', h)); + } + return !1; + } + }), + (g.prototype.keydown = function (c) { + if (/(38|40|27|32)/.test(c.which) && !/input|textarea/i.test(c.target.tagName)) { + var d = a(this); + if ((c.preventDefault(), c.stopPropagation(), !d.is('.disabled, :disabled'))) { + var e = b(d), + g = e.hasClass('open'); + if ((!g && 27 != c.which) || (g && 27 == c.which)) return 27 == c.which && e.find(f).trigger('focus'), d.trigger('click'); + var h = ' li:not(.disabled):visible a', + i = e.find('.dropdown-menu' + h); + if (i.length) { + var j = i.index(c.target); + 38 == c.which && j > 0 && j--, 40 == c.which && j < i.length - 1 && j++, ~j || (j = 0), i.eq(j).trigger('focus'); + } + } + } + }); + var h = a.fn.dropdown; + (a.fn.dropdown = d), + (a.fn.dropdown.Constructor = g), + (a.fn.dropdown.noConflict = function () { + return (a.fn.dropdown = h), this; + }), + a(document) + .on('click.bs.dropdown.data-api', c) + .on('click.bs.dropdown.data-api', '.dropdown form', function (a) { + a.stopPropagation(); + }) + .on('click.bs.dropdown.data-api', f, g.prototype.toggle) + .on('keydown.bs.dropdown.data-api', f, g.prototype.keydown) + .on('keydown.bs.dropdown.data-api', '.dropdown-menu', g.prototype.keydown); + })(jQuery), + +(function (a) { + 'use strict'; + function b(b, d) { + return this.each(function () { + var e = a(this), + f = e.data('bs.modal'), + g = a.extend({}, c.DEFAULTS, e.data(), 'object' == typeof b && b); + f || e.data('bs.modal', (f = new c(this, g))), 'string' == typeof b ? f[b](d) : g.show && f.show(d); + }); + } + var c = function (b, c) { + (this.options = c), + (this.$body = a(document.body)), + (this.$element = a(b)), + (this.$dialog = this.$element.find('.modal-dialog')), + (this.$backdrop = null), + (this.isShown = null), + (this.originalBodyPad = null), + (this.scrollbarWidth = 0), + (this.ignoreBackdropClick = !1), + this.options.remote && + this.$element.find('.modal-content').load( + this.options.remote, + a.proxy(function () { + this.$element.trigger('loaded.bs.modal'); + }, this) + ); + }; + (c.VERSION = '3.3.7'), + (c.TRANSITION_DURATION = 300), + (c.BACKDROP_TRANSITION_DURATION = 150), + (c.DEFAULTS = { backdrop: !0, keyboard: !0, show: !0 }), + (c.prototype.toggle = function (a) { + return this.isShown ? this.hide() : this.show(a); + }), + (c.prototype.show = function (b) { + var d = this, + e = a.Event('show.bs.modal', { relatedTarget: b }); + this.$element.trigger(e), + this.isShown || + e.isDefaultPrevented() || + ((this.isShown = !0), + this.checkScrollbar(), + this.setScrollbar(), + this.$body.addClass('modal-open'), + this.escape(), + this.resize(), + this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', a.proxy(this.hide, this)), + this.$dialog.on('mousedown.dismiss.bs.modal', function () { + d.$element.one('mouseup.dismiss.bs.modal', function (b) { + a(b.target).is(d.$element) && (d.ignoreBackdropClick = !0); + }); + }), + this.backdrop(function () { + var e = a.support.transition && d.$element.hasClass('fade'); + d.$element.parent().length || d.$element.appendTo(d.$body), + d.$element.show().scrollTop(0), + d.adjustDialog(), + e && d.$element[0].offsetWidth, + d.$element.addClass('in'), + d.enforceFocus(); + var f = a.Event('shown.bs.modal', { relatedTarget: b }); + e + ? d.$dialog + .one('bsTransitionEnd', function () { + d.$element.trigger('focus').trigger(f); + }) + .emulateTransitionEnd(c.TRANSITION_DURATION) + : d.$element.trigger('focus').trigger(f); + })); + }), + (c.prototype.hide = function (b) { + b && b.preventDefault(), + (b = a.Event('hide.bs.modal')), + this.$element.trigger(b), + this.isShown && + !b.isDefaultPrevented() && + ((this.isShown = !1), + this.escape(), + this.resize(), + a(document).off('focusin.bs.modal'), + this.$element.removeClass('in').off('click.dismiss.bs.modal').off('mouseup.dismiss.bs.modal'), + this.$dialog.off('mousedown.dismiss.bs.modal'), + a.support.transition && this.$element.hasClass('fade') + ? this.$element.one('bsTransitionEnd', a.proxy(this.hideModal, this)).emulateTransitionEnd(c.TRANSITION_DURATION) + : this.hideModal()); + }), + (c.prototype.enforceFocus = function () { + a(document) + .off('focusin.bs.modal') + .on( + 'focusin.bs.modal', + a.proxy(function (a) { + document === a.target || + this.$element[0] === a.target || + this.$element.has(a.target).length || + this.$element.trigger('focus'); + }, this) + ); + }), + (c.prototype.escape = function () { + this.isShown && this.options.keyboard + ? this.$element.on( + 'keydown.dismiss.bs.modal', + a.proxy(function (a) { + 27 == a.which && this.hide(); + }, this) + ) + : this.isShown || this.$element.off('keydown.dismiss.bs.modal'); + }), + (c.prototype.resize = function () { + this.isShown ? a(window).on('resize.bs.modal', a.proxy(this.handleUpdate, this)) : a(window).off('resize.bs.modal'); + }), + (c.prototype.hideModal = function () { + var a = this; + this.$element.hide(), + this.backdrop(function () { + a.$body.removeClass('modal-open'), a.resetAdjustments(), a.resetScrollbar(), a.$element.trigger('hidden.bs.modal'); + }); + }), + (c.prototype.removeBackdrop = function () { + this.$backdrop && this.$backdrop.remove(), (this.$backdrop = null); + }), + (c.prototype.backdrop = function (b) { + var d = this, + e = this.$element.hasClass('fade') ? 'fade' : ''; + if (this.isShown && this.options.backdrop) { + var f = a.support.transition && e; + if ( + ((this.$backdrop = a(document.createElement('div')) + .addClass('modal-backdrop ' + e) + .appendTo(this.$body)), + this.$element.on( + 'click.dismiss.bs.modal', + a.proxy(function (a) { + return this.ignoreBackdropClick + ? void (this.ignoreBackdropClick = !1) + : void (a.target === a.currentTarget && ('static' == this.options.backdrop ? this.$element[0].focus() : this.hide())); + }, this) + ), + f && this.$backdrop[0].offsetWidth, + this.$backdrop.addClass('in'), + !b) + ) + return; + f ? this.$backdrop.one('bsTransitionEnd', b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION) : b(); + } else if (!this.isShown && this.$backdrop) { + this.$backdrop.removeClass('in'); + var g = function () { + d.removeBackdrop(), b && b(); + }; + a.support.transition && this.$element.hasClass('fade') + ? this.$backdrop.one('bsTransitionEnd', g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION) + : g(); + } else b && b(); + }), + (c.prototype.handleUpdate = function () { + this.adjustDialog(); + }), + (c.prototype.adjustDialog = function () { + var a = this.$element[0].scrollHeight > document.documentElement.clientHeight; + this.$element.css({ + paddingLeft: !this.bodyIsOverflowing && a ? this.scrollbarWidth : '', + paddingRight: this.bodyIsOverflowing && !a ? this.scrollbarWidth : '', + }); + }), + (c.prototype.resetAdjustments = function () { + this.$element.css({ paddingLeft: '', paddingRight: '' }); + }), + (c.prototype.checkScrollbar = function () { + var a = window.innerWidth; + if (!a) { + var b = document.documentElement.getBoundingClientRect(); + a = b.right - Math.abs(b.left); + } + (this.bodyIsOverflowing = document.body.clientWidth < a), (this.scrollbarWidth = this.measureScrollbar()); + }), + (c.prototype.setScrollbar = function () { + var a = parseInt(this.$body.css('padding-right') || 0, 10); + (this.originalBodyPad = document.body.style.paddingRight || ''), + this.bodyIsOverflowing && this.$body.css('padding-right', a + this.scrollbarWidth); + }), + (c.prototype.resetScrollbar = function () { + this.$body.css('padding-right', this.originalBodyPad); + }), + (c.prototype.measureScrollbar = function () { + var a = document.createElement('div'); + (a.className = 'modal-scrollbar-measure'), this.$body.append(a); + var b = a.offsetWidth - a.clientWidth; + return this.$body[0].removeChild(a), b; + }); + var d = a.fn.modal; + (a.fn.modal = b), + (a.fn.modal.Constructor = c), + (a.fn.modal.noConflict = function () { + return (a.fn.modal = d), this; + }), + a(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (c) { + var d = a(this), + e = d.attr('href'), + f = a(d.attr('data-target') || (e && e.replace(/.*(?=#[^\s]+$)/, ''))), + g = f.data('bs.modal') ? 'toggle' : a.extend({ remote: !/#/.test(e) && e }, f.data(), d.data()); + d.is('a') && c.preventDefault(), + f.one('show.bs.modal', function (a) { + a.isDefaultPrevented() || + f.one('hidden.bs.modal', function () { + d.is(':visible') && d.trigger('focus'); + }); + }), + b.call(f, g, this); + }); + })(jQuery), + +(function (a) { + 'use strict'; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data('bs.tooltip'), + f = 'object' == typeof b && b; + (!e && /destroy|hide/.test(b)) || (e || d.data('bs.tooltip', (e = new c(this, f))), 'string' == typeof b && e[b]()); + }); + } + var c = function (a, b) { + (this.type = null), + (this.options = null), + (this.enabled = null), + (this.timeout = null), + (this.hoverState = null), + (this.$element = null), + (this.inState = null), + this.init('tooltip', a, b); + }; + (c.VERSION = '3.3.7'), + (c.TRANSITION_DURATION = 150), + (c.DEFAULTS = { + animation: !0, + placement: 'top', + selector: !1, + template: '', + trigger: 'hover focus', + title: '', + delay: 0, + html: !1, + container: !1, + viewport: { selector: 'body', padding: 0 }, + }), + (c.prototype.init = function (b, c, d) { + if ( + ((this.enabled = !0), + (this.type = b), + (this.$element = a(c)), + (this.options = this.getOptions(d)), + (this.$viewport = + this.options.viewport && + a( + a.isFunction(this.options.viewport) + ? this.options.viewport.call(this, this.$element) + : this.options.viewport.selector || this.options.viewport + )), + (this.inState = { click: !1, hover: !1, focus: !1 }), + this.$element[0] instanceof document.constructor && !this.options.selector) + ) + throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!'); + for (var e = this.options.trigger.split(' '), f = e.length; f--; ) { + var g = e[f]; + if ('click' == g) this.$element.on('click.' + this.type, this.options.selector, a.proxy(this.toggle, this)); + else if ('manual' != g) { + var h = 'hover' == g ? 'mouseenter' : 'focusin', + i = 'hover' == g ? 'mouseleave' : 'focusout'; + this.$element.on(h + '.' + this.type, this.options.selector, a.proxy(this.enter, this)), + this.$element.on(i + '.' + this.type, this.options.selector, a.proxy(this.leave, this)); + } + } + this.options.selector ? (this._options = a.extend({}, this.options, { trigger: 'manual', selector: '' })) : this.fixTitle(); + }), + (c.prototype.getDefaults = function () { + return c.DEFAULTS; + }), + (c.prototype.getOptions = function (b) { + return ( + (b = a.extend({}, this.getDefaults(), this.$element.data(), b)), + b.delay && 'number' == typeof b.delay && (b.delay = { show: b.delay, hide: b.delay }), + b + ); + }), + (c.prototype.getDelegateOptions = function () { + var b = {}, + c = this.getDefaults(); + return ( + this._options && + a.each(this._options, function (a, d) { + c[a] != d && (b[a] = d); + }), + b + ); + }), + (c.prototype.enter = function (b) { + var c = b instanceof this.constructor ? b : a(b.currentTarget).data('bs.' + this.type); + return ( + c || ((c = new this.constructor(b.currentTarget, this.getDelegateOptions())), a(b.currentTarget).data('bs.' + this.type, c)), + b instanceof a.Event && (c.inState['focusin' == b.type ? 'focus' : 'hover'] = !0), + c.tip().hasClass('in') || 'in' == c.hoverState + ? void (c.hoverState = 'in') + : (clearTimeout(c.timeout), + (c.hoverState = 'in'), + c.options.delay && c.options.delay.show + ? void (c.timeout = setTimeout(function () { + 'in' == c.hoverState && c.show(); + }, c.options.delay.show)) + : c.show()) + ); + }), + (c.prototype.isInStateTrue = function () { + for (var a in this.inState) if (this.inState[a]) return !0; + return !1; + }), + (c.prototype.leave = function (b) { + var c = b instanceof this.constructor ? b : a(b.currentTarget).data('bs.' + this.type); + if ( + (c || ((c = new this.constructor(b.currentTarget, this.getDelegateOptions())), a(b.currentTarget).data('bs.' + this.type, c)), + b instanceof a.Event && (c.inState['focusout' == b.type ? 'focus' : 'hover'] = !1), + !c.isInStateTrue()) + ) + return ( + clearTimeout(c.timeout), + (c.hoverState = 'out'), + c.options.delay && c.options.delay.hide + ? void (c.timeout = setTimeout(function () { + 'out' == c.hoverState && c.hide(); + }, c.options.delay.hide)) + : c.hide() + ); + }), + (c.prototype.show = function () { + var b = a.Event('show.bs.' + this.type); + if (this.hasContent() && this.enabled) { + this.$element.trigger(b); + var d = a.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]); + if (b.isDefaultPrevented() || !d) return; + var e = this, + f = this.tip(), + g = this.getUID(this.type); + this.setContent(), f.attr('id', g), this.$element.attr('aria-describedby', g), this.options.animation && f.addClass('fade'); + var h = + 'function' == typeof this.options.placement + ? this.options.placement.call(this, f[0], this.$element[0]) + : this.options.placement, + i = /\s?auto?\s?/i, + j = i.test(h); + j && (h = h.replace(i, '') || 'top'), + f + .detach() + .css({ top: 0, left: 0, display: 'block' }) + .addClass(h) + .data('bs.' + this.type, this), + this.options.container ? f.appendTo(this.options.container) : f.insertAfter(this.$element), + this.$element.trigger('inserted.bs.' + this.type); + var k = this.getPosition(), + l = f[0].offsetWidth, + m = f[0].offsetHeight; + if (j) { + var n = h, + o = this.getPosition(this.$viewport); + (h = + 'bottom' == h && k.bottom + m > o.bottom + ? 'top' + : 'top' == h && k.top - m < o.top + ? 'bottom' + : 'right' == h && k.right + l > o.width + ? 'left' + : 'left' == h && k.left - l < o.left + ? 'right' + : h), + f.removeClass(n).addClass(h); + } + var p = this.getCalculatedOffset(h, k, l, m); + this.applyPlacement(p, h); + var q = function () { + var a = e.hoverState; + e.$element.trigger('shown.bs.' + e.type), (e.hoverState = null), 'out' == a && e.leave(e); + }; + a.support.transition && this.$tip.hasClass('fade') + ? f.one('bsTransitionEnd', q).emulateTransitionEnd(c.TRANSITION_DURATION) + : q(); + } + }), + (c.prototype.applyPlacement = function (b, c) { + var d = this.tip(), + e = d[0].offsetWidth, + f = d[0].offsetHeight, + g = parseInt(d.css('margin-top'), 10), + h = parseInt(d.css('margin-left'), 10); + isNaN(g) && (g = 0), + isNaN(h) && (h = 0), + (b.top += g), + (b.left += h), + a.offset.setOffset( + d[0], + a.extend( + { + using: function (a) { + d.css({ top: Math.round(a.top), left: Math.round(a.left) }); + }, + }, + b + ), + 0 + ), + d.addClass('in'); + var i = d[0].offsetWidth, + j = d[0].offsetHeight; + 'top' == c && j != f && (b.top = b.top + f - j); + var k = this.getViewportAdjustedDelta(c, b, i, j); + k.left ? (b.left += k.left) : (b.top += k.top); + var l = /top|bottom/.test(c), + m = l ? 2 * k.left - e + i : 2 * k.top - f + j, + n = l ? 'offsetWidth' : 'offsetHeight'; + d.offset(b), this.replaceArrow(m, d[0][n], l); + }), + (c.prototype.replaceArrow = function (a, b, c) { + this.arrow() + .css(c ? 'left' : 'top', 50 * (1 - a / b) + '%') + .css(c ? 'top' : 'left', ''); + }), + (c.prototype.setContent = function () { + var a = this.tip(), + b = this.getTitle(); + a.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](b), a.removeClass('fade in top bottom left right'); + }), + (c.prototype.hide = function (b) { + function d() { + 'in' != e.hoverState && f.detach(), + e.$element && e.$element.removeAttr('aria-describedby').trigger('hidden.bs.' + e.type), + b && b(); + } + var e = this, + f = a(this.$tip), + g = a.Event('hide.bs.' + this.type); + if ((this.$element.trigger(g), !g.isDefaultPrevented())) + return ( + f.removeClass('in'), + a.support.transition && f.hasClass('fade') ? f.one('bsTransitionEnd', d).emulateTransitionEnd(c.TRANSITION_DURATION) : d(), + (this.hoverState = null), + this + ); + }), + (c.prototype.fixTitle = function () { + var a = this.$element; + (a.attr('title') || 'string' != typeof a.attr('data-original-title')) && + a.attr('data-original-title', a.attr('title') || '').attr('title', ''); + }), + (c.prototype.hasContent = function () { + return this.getTitle(); + }), + (c.prototype.getPosition = function (b) { + b = b || this.$element; + var c = b[0], + d = 'BODY' == c.tagName, + e = c.getBoundingClientRect(); + null == e.width && (e = a.extend({}, e, { width: e.right - e.left, height: e.bottom - e.top })); + var f = window.SVGElement && c instanceof window.SVGElement, + g = d ? { top: 0, left: 0 } : f ? null : b.offset(), + h = { scroll: d ? document.documentElement.scrollTop || document.body.scrollTop : b.scrollTop() }, + i = d ? { width: a(window).width(), height: a(window).height() } : null; + return a.extend({}, e, h, i, g); + }), + (c.prototype.getCalculatedOffset = function (a, b, c, d) { + return 'bottom' == a + ? { top: b.top + b.height, left: b.left + b.width / 2 - c / 2 } + : 'top' == a + ? { top: b.top - d, left: b.left + b.width / 2 - c / 2 } + : 'left' == a + ? { top: b.top + b.height / 2 - d / 2, left: b.left - c } + : { top: b.top + b.height / 2 - d / 2, left: b.left + b.width }; + }), + (c.prototype.getViewportAdjustedDelta = function (a, b, c, d) { + var e = { top: 0, left: 0 }; + if (!this.$viewport) return e; + var f = (this.options.viewport && this.options.viewport.padding) || 0, + g = this.getPosition(this.$viewport); + if (/right|left/.test(a)) { + var h = b.top - f - g.scroll, + i = b.top + f - g.scroll + d; + h < g.top ? (e.top = g.top - h) : i > g.top + g.height && (e.top = g.top + g.height - i); + } else { + var j = b.left - f, + k = b.left + f + c; + j < g.left ? (e.left = g.left - j) : k > g.right && (e.left = g.left + g.width - k); + } + return e; + }), + (c.prototype.getTitle = function () { + var a, + b = this.$element, + c = this.options; + return (a = b.attr('data-original-title') || ('function' == typeof c.title ? c.title.call(b[0]) : c.title)); + }), + (c.prototype.getUID = function (a) { + do a += ~~(1e6 * Math.random()); + while (document.getElementById(a)); + return a; + }), + (c.prototype.tip = function () { + if (!this.$tip && ((this.$tip = a(this.options.template)), 1 != this.$tip.length)) + throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!'); + return this.$tip; + }), + (c.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')); + }), + (c.prototype.enable = function () { + this.enabled = !0; + }), + (c.prototype.disable = function () { + this.enabled = !1; + }), + (c.prototype.toggleEnabled = function () { + this.enabled = !this.enabled; + }), + (c.prototype.toggle = function (b) { + var c = this; + b && + ((c = a(b.currentTarget).data('bs.' + this.type)), + c || ((c = new this.constructor(b.currentTarget, this.getDelegateOptions())), a(b.currentTarget).data('bs.' + this.type, c))), + b + ? ((c.inState.click = !c.inState.click), c.isInStateTrue() ? c.enter(c) : c.leave(c)) + : c.tip().hasClass('in') + ? c.leave(c) + : c.enter(c); + }), + (c.prototype.destroy = function () { + var a = this; + clearTimeout(this.timeout), + this.hide(function () { + a.$element.off('.' + a.type).removeData('bs.' + a.type), + a.$tip && a.$tip.detach(), + (a.$tip = null), + (a.$arrow = null), + (a.$viewport = null), + (a.$element = null); + }); + }); + var d = a.fn.tooltip; + (a.fn.tooltip = b), + (a.fn.tooltip.Constructor = c), + (a.fn.tooltip.noConflict = function () { + return (a.fn.tooltip = d), this; + }); + })(jQuery), + +(function (a) { + 'use strict'; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data('bs.popover'), + f = 'object' == typeof b && b; + (!e && /destroy|hide/.test(b)) || (e || d.data('bs.popover', (e = new c(this, f))), 'string' == typeof b && e[b]()); + }); + } + var c = function (a, b) { + this.init('popover', a, b); + }; + if (!a.fn.tooltip) throw new Error('Popover requires tooltip.js'); + (c.VERSION = '3.3.7'), + (c.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, { + placement: 'right', + trigger: 'click', + content: '', + template: + '', + })), + (c.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype)), + (c.prototype.constructor = c), + (c.prototype.getDefaults = function () { + return c.DEFAULTS; + }), + (c.prototype.setContent = function () { + var a = this.tip(), + b = this.getTitle(), + c = this.getContent(); + a.find('.popover-title')[this.options.html ? 'html' : 'text'](b), + a.find('.popover-content').children().detach().end()[this.options.html ? ('string' == typeof c ? 'html' : 'append') : 'text'](c), + a.removeClass('fade top bottom left right in'), + a.find('.popover-title').html() || a.find('.popover-title').hide(); + }), + (c.prototype.hasContent = function () { + return this.getTitle() || this.getContent(); + }), + (c.prototype.getContent = function () { + var a = this.$element, + b = this.options; + return a.attr('data-content') || ('function' == typeof b.content ? b.content.call(a[0]) : b.content); + }), + (c.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find('.arrow')); + }); + var d = a.fn.popover; + (a.fn.popover = b), + (a.fn.popover.Constructor = c), + (a.fn.popover.noConflict = function () { + return (a.fn.popover = d), this; + }); + })(jQuery), + +(function (a) { + 'use strict'; + function b(c, d) { + (this.$body = a(document.body)), + (this.$scrollElement = a(a(c).is(document.body) ? window : c)), + (this.options = a.extend({}, b.DEFAULTS, d)), + (this.selector = (this.options.target || '') + ' .nav li > a'), + (this.offsets = []), + (this.targets = []), + (this.activeTarget = null), + (this.scrollHeight = 0), + this.$scrollElement.on('scroll.bs.scrollspy', a.proxy(this.process, this)), + this.refresh(), + this.process(); + } + function c(c) { + return this.each(function () { + var d = a(this), + e = d.data('bs.scrollspy'), + f = 'object' == typeof c && c; + e || d.data('bs.scrollspy', (e = new b(this, f))), 'string' == typeof c && e[c](); + }); + } + (b.VERSION = '3.3.7'), + (b.DEFAULTS = { offset: 10 }), + (b.prototype.getScrollHeight = function () { + return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight); + }), + (b.prototype.refresh = function () { + var b = this, + c = 'offset', + d = 0; + (this.offsets = []), + (this.targets = []), + (this.scrollHeight = this.getScrollHeight()), + a.isWindow(this.$scrollElement[0]) || ((c = 'position'), (d = this.$scrollElement.scrollTop())), + this.$body + .find(this.selector) + .map(function () { + var b = a(this), + e = b.data('target') || b.attr('href'), + f = /^#./.test(e) && a(e); + return (f && f.length && f.is(':visible') && [[f[c]().top + d, e]]) || null; + }) + .sort(function (a, b) { + return a[0] - b[0]; + }) + .each(function () { + b.offsets.push(this[0]), b.targets.push(this[1]); + }); + }), + (b.prototype.process = function () { + var a, + b = this.$scrollElement.scrollTop() + this.options.offset, + c = this.getScrollHeight(), + d = this.options.offset + c - this.$scrollElement.height(), + e = this.offsets, + f = this.targets, + g = this.activeTarget; + if ((this.scrollHeight != c && this.refresh(), b >= d)) return g != (a = f[f.length - 1]) && this.activate(a); + if (g && b < e[0]) return (this.activeTarget = null), this.clear(); + for (a = e.length; a--; ) g != f[a] && b >= e[a] && (void 0 === e[a + 1] || b < e[a + 1]) && this.activate(f[a]); + }), + (b.prototype.activate = function (b) { + (this.activeTarget = b), this.clear(); + var c = this.selector + '[data-target="' + b + '"],' + this.selector + '[href="' + b + '"]', + d = a(c).parents('li').addClass('active'); + d.parent('.dropdown-menu').length && (d = d.closest('li.dropdown').addClass('active')), d.trigger('activate.bs.scrollspy'); + }), + (b.prototype.clear = function () { + a(this.selector).parentsUntil(this.options.target, '.active').removeClass('active'); + }); + var d = a.fn.scrollspy; + (a.fn.scrollspy = c), + (a.fn.scrollspy.Constructor = b), + (a.fn.scrollspy.noConflict = function () { + return (a.fn.scrollspy = d), this; + }), + a(window).on('load.bs.scrollspy.data-api', function () { + a('[data-spy="scroll"]').each(function () { + var b = a(this); + c.call(b, b.data()); + }); + }); + })(jQuery), + +(function (a) { + 'use strict'; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data('bs.tab'); + e || d.data('bs.tab', (e = new c(this))), 'string' == typeof b && e[b](); + }); + } + var c = function (b) { + this.element = a(b); + }; + (c.VERSION = '3.3.7'), + (c.TRANSITION_DURATION = 150), + (c.prototype.show = function () { + var b = this.element, + c = b.closest('ul:not(.dropdown-menu)'), + d = b.data('target'); + if ((d || ((d = b.attr('href')), (d = d && d.replace(/.*(?=#[^\s]*$)/, ''))), !b.parent('li').hasClass('active'))) { + var e = c.find('.active:last a'), + f = a.Event('hide.bs.tab', { relatedTarget: b[0] }), + g = a.Event('show.bs.tab', { relatedTarget: e[0] }); + if ((e.trigger(f), b.trigger(g), !g.isDefaultPrevented() && !f.isDefaultPrevented())) { + var h = a(d); + this.activate(b.closest('li'), c), + this.activate(h, h.parent(), function () { + e.trigger({ type: 'hidden.bs.tab', relatedTarget: b[0] }), b.trigger({ type: 'shown.bs.tab', relatedTarget: e[0] }); + }); + } + } + }), + (c.prototype.activate = function (b, d, e) { + function f() { + g + .removeClass('active') + .find('> .dropdown-menu > .active') + .removeClass('active') + .end() + .find('[data-toggle="tab"]') + .attr('aria-expanded', !1), + b.addClass('active').find('[data-toggle="tab"]').attr('aria-expanded', !0), + h ? (b[0].offsetWidth, b.addClass('in')) : b.removeClass('fade'), + b.parent('.dropdown-menu').length && + b.closest('li.dropdown').addClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded', !0), + e && e(); + } + var g = d.find('> .active'), + h = e && a.support.transition && ((g.length && g.hasClass('fade')) || !!d.find('> .fade').length); + g.length && h ? g.one('bsTransitionEnd', f).emulateTransitionEnd(c.TRANSITION_DURATION) : f(), g.removeClass('in'); + }); + var d = a.fn.tab; + (a.fn.tab = b), + (a.fn.tab.Constructor = c), + (a.fn.tab.noConflict = function () { + return (a.fn.tab = d), this; + }); + var e = function (c) { + c.preventDefault(), b.call(a(this), 'show'); + }; + a(document).on('click.bs.tab.data-api', '[data-toggle="tab"]', e).on('click.bs.tab.data-api', '[data-toggle="pill"]', e); + })(jQuery), + +(function (a) { + 'use strict'; + function b(b) { + return this.each(function () { + var d = a(this), + e = d.data('bs.affix'), + f = 'object' == typeof b && b; + e || d.data('bs.affix', (e = new c(this, f))), 'string' == typeof b && e[b](); + }); + } + var c = function (b, d) { + (this.options = a.extend({}, c.DEFAULTS, d)), + (this.$target = a(this.options.target) + .on('scroll.bs.affix.data-api', a.proxy(this.checkPosition, this)) + .on('click.bs.affix.data-api', a.proxy(this.checkPositionWithEventLoop, this))), + (this.$element = a(b)), + (this.affixed = null), + (this.unpin = null), + (this.pinnedOffset = null), + this.checkPosition(); + }; + (c.VERSION = '3.3.7'), + (c.RESET = 'affix affix-top affix-bottom'), + (c.DEFAULTS = { offset: 0, target: window }), + (c.prototype.getState = function (a, b, c, d) { + var e = this.$target.scrollTop(), + f = this.$element.offset(), + g = this.$target.height(); + if (null != c && 'top' == this.affixed) return e < c && 'top'; + if ('bottom' == this.affixed) return null != c ? !(e + this.unpin <= f.top) && 'bottom' : !(e + g <= a - d) && 'bottom'; + var h = null == this.affixed, + i = h ? e : f.top, + j = h ? g : b; + return null != c && e <= c ? 'top' : null != d && i + j >= a - d && 'bottom'; + }), + (c.prototype.getPinnedOffset = function () { + if (this.pinnedOffset) return this.pinnedOffset; + this.$element.removeClass(c.RESET).addClass('affix'); + var a = this.$target.scrollTop(), + b = this.$element.offset(); + return (this.pinnedOffset = b.top - a); + }), + (c.prototype.checkPositionWithEventLoop = function () { + setTimeout(a.proxy(this.checkPosition, this), 1); + }), + (c.prototype.checkPosition = function () { + if (this.$element.is(':visible')) { + var b = this.$element.height(), + d = this.options.offset, + e = d.top, + f = d.bottom, + g = Math.max(a(document).height(), a(document.body).height()); + 'object' != typeof d && (f = e = d), + 'function' == typeof e && (e = d.top(this.$element)), + 'function' == typeof f && (f = d.bottom(this.$element)); + var h = this.getState(g, b, e, f); + if (this.affixed != h) { + null != this.unpin && this.$element.css('top', ''); + var i = 'affix' + (h ? '-' + h : ''), + j = a.Event(i + '.bs.affix'); + if ((this.$element.trigger(j), j.isDefaultPrevented())) return; + (this.affixed = h), + (this.unpin = 'bottom' == h ? this.getPinnedOffset() : null), + this.$element + .removeClass(c.RESET) + .addClass(i) + .trigger(i.replace('affix', 'affixed') + '.bs.affix'); + } + 'bottom' == h && this.$element.offset({ top: g - b - f }); + } + }); + var d = a.fn.affix; + (a.fn.affix = b), + (a.fn.affix.Constructor = c), + (a.fn.affix.noConflict = function () { + return (a.fn.affix = d), this; + }), + a(window).on('load', function () { + a('[data-spy="affix"]').each(function () { + var c = a(this), + d = c.data(); + (d.offset = d.offset || {}), + null != d.offsetBottom && (d.offset.bottom = d.offsetBottom), + null != d.offsetTop && (d.offset.top = d.offsetTop), + b.call(c, d); + }); + }); + })(jQuery); diff --git a/src/main/webapp/content/js/chartist.min.js b/src/main/webapp/content/js/chartist.min.js new file mode 100644 index 0000000..037fcf8 --- /dev/null +++ b/src/main/webapp/content/js/chartist.min.js @@ -0,0 +1,1660 @@ +/* Chartist.js 0.9.7 + * Copyright © 2016 Gion Kunz + * Free to use under either the WTFPL license or the MIT license. + * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL + * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT + */ + +!(function (a, b) { + 'function' == typeof define && define.amd + ? define([], function () { + return (a.Chartist = b()); + }) + : 'object' == typeof exports + ? (module.exports = b()) + : (a.Chartist = b()); +})(this, function () { + var a = { version: '0.9.7' }; + return ( + (function (a, b, c) { + 'use strict'; + (c.namespaces = { + svg: 'http://www.w3.org/2000/svg', + xmlns: 'http://www.w3.org/2000/xmlns/', + xhtml: 'http://www.w3.org/1999/xhtml', + xlink: 'http://www.w3.org/1999/xlink', + ct: 'http://gionkunz.github.com/chartist-js/ct', + }), + (c.noop = function (a) { + return a; + }), + (c.alphaNumerate = function (a) { + return String.fromCharCode(97 + (a % 26)); + }), + (c.extend = function (a) { + a = a || {}; + var b = Array.prototype.slice.call(arguments, 1); + return ( + b.forEach(function (b) { + for (var d in b) + 'object' != typeof b[d] || null === b[d] || b[d] instanceof Array ? (a[d] = b[d]) : (a[d] = c.extend({}, a[d], b[d])); + }), + a + ); + }), + (c.replaceAll = function (a, b, c) { + return a.replace(new RegExp(b, 'g'), c); + }), + (c.ensureUnit = function (a, b) { + return 'number' == typeof a && (a += b), a; + }), + (c.quantity = function (a) { + if ('string' == typeof a) { + var b = /^(\d+)\s*(.*)$/g.exec(a); + return { value: +b[1], unit: b[2] || void 0 }; + } + return { value: a }; + }), + (c.querySelector = function (a) { + return a instanceof Node ? a : b.querySelector(a); + }), + (c.times = function (a) { + return Array.apply(null, new Array(a)); + }), + (c.sum = function (a, b) { + return a + (b ? b : 0); + }), + (c.mapMultiply = function (a) { + return function (b) { + return b * a; + }; + }), + (c.mapAdd = function (a) { + return function (b) { + return b + a; + }; + }), + (c.serialMap = function (a, b) { + var d = [], + e = Math.max.apply( + null, + a.map(function (a) { + return a.length; + }) + ); + return ( + c.times(e).forEach(function (c, e) { + var f = a.map(function (a) { + return a[e]; + }); + d[e] = b.apply(null, f); + }), + d + ); + }), + (c.roundWithPrecision = function (a, b) { + var d = Math.pow(10, b || c.precision); + return Math.round(a * d) / d; + }), + (c.precision = 8), + (c.escapingMap = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }), + (c.serialize = function (a) { + return null === a || void 0 === a + ? a + : ('number' == typeof a ? (a = '' + a) : 'object' == typeof a && (a = JSON.stringify({ data: a })), + Object.keys(c.escapingMap).reduce(function (a, b) { + return c.replaceAll(a, b, c.escapingMap[b]); + }, a)); + }), + (c.deserialize = function (a) { + if ('string' != typeof a) return a; + a = Object.keys(c.escapingMap).reduce(function (a, b) { + return c.replaceAll(a, c.escapingMap[b], b); + }, a); + try { + (a = JSON.parse(a)), (a = void 0 !== a.data ? a.data : a); + } catch (b) {} + return a; + }), + (c.createSvg = function (a, b, d, e) { + var f; + return ( + (b = b || '100%'), + (d = d || '100%'), + Array.prototype.slice + .call(a.querySelectorAll('svg')) + .filter(function (a) { + return a.getAttributeNS(c.namespaces.xmlns, 'ct'); + }) + .forEach(function (b) { + a.removeChild(b); + }), + (f = new c.Svg('svg') + .attr({ width: b, height: d }) + .addClass(e) + .attr({ style: 'width: ' + b + '; height: ' + d + ';' })), + a.appendChild(f._node), + f + ); + }), + (c.normalizeData = function (a) { + if ( + ((a = a || { series: [], labels: [] }), + (a.series = a.series || []), + (a.labels = a.labels || []), + a.series.length > 0 && 0 === a.labels.length) + ) { + var b, + d = c.getDataArray(a); + (b = d.every(function (a) { + return a instanceof Array; + }) + ? Math.max.apply( + null, + d.map(function (a) { + return a.length; + }) + ) + : d.length), + (a.labels = c.times(b).map(function () { + return ''; + })); + } + return a; + }), + (c.reverseData = function (a) { + a.labels.reverse(), a.series.reverse(); + for (var b = 0; b < a.series.length; b++) + 'object' == typeof a.series[b] && void 0 !== a.series[b].data + ? a.series[b].data.reverse() + : a.series[b] instanceof Array && a.series[b].reverse(); + }), + (c.getDataArray = function (a, b, d) { + function e(a) { + if (!c.isFalseyButZero(a)) { + if ((a.data || a) instanceof Array) return (a.data || a).map(e); + if (a.hasOwnProperty('value')) return e(a.value); + if (d) { + var b = {}; + return ( + 'string' == typeof d ? (b[d] = c.getNumberOrUndefined(a)) : (b.y = c.getNumberOrUndefined(a)), + (b.x = a.hasOwnProperty('x') ? c.getNumberOrUndefined(a.x) : b.x), + (b.y = a.hasOwnProperty('y') ? c.getNumberOrUndefined(a.y) : b.y), + b + ); + } + return c.getNumberOrUndefined(a); + } + } + return ((b && !a.reversed) || (!b && a.reversed)) && (c.reverseData(a), (a.reversed = !a.reversed)), a.series.map(e); + }), + (c.normalizePadding = function (a, b) { + return ( + (b = b || 0), + 'number' == typeof a + ? { top: a, right: a, bottom: a, left: a } + : { + top: 'number' == typeof a.top ? a.top : b, + right: 'number' == typeof a.right ? a.right : b, + bottom: 'number' == typeof a.bottom ? a.bottom : b, + left: 'number' == typeof a.left ? a.left : b, + } + ); + }), + (c.getMetaData = function (a, b) { + var d = a.data ? a.data[b] : a[b]; + return d ? c.serialize(d.meta) : void 0; + }), + (c.orderOfMagnitude = function (a) { + return Math.floor(Math.log(Math.abs(a)) / Math.LN10); + }), + (c.projectLength = function (a, b, c) { + return (b / c.range) * a; + }), + (c.getAvailableHeight = function (a, b) { + return Math.max((c.quantity(b.height).value || a.height()) - (b.chartPadding.top + b.chartPadding.bottom) - b.axisX.offset, 0); + }), + (c.getHighLow = function (a, b, d) { + function e(a) { + if (void 0 !== a) + if (a instanceof Array) for (var b = 0; b < a.length; b++) e(a[b]); + else { + var c = d ? +a[d] : +a; + g && c > f.high && (f.high = c), h && c < f.low && (f.low = c); + } + } + b = c.extend({}, b, d ? b['axis' + d.toUpperCase()] : {}); + var f = { high: void 0 === b.high ? -Number.MAX_VALUE : +b.high, low: void 0 === b.low ? Number.MAX_VALUE : +b.low }, + g = void 0 === b.high, + h = void 0 === b.low; + return ( + (g || h) && e(a), + (b.referenceValue || 0 === b.referenceValue) && + ((f.high = Math.max(b.referenceValue, f.high)), (f.low = Math.min(b.referenceValue, f.low))), + f.high <= f.low && + (0 === f.low ? (f.high = 1) : f.low < 0 ? (f.high = 0) : f.high > 0 ? (f.low = 0) : ((f.high = 1), (f.low = 0))), + f + ); + }), + (c.isNum = function (a) { + return !isNaN(a) && isFinite(a); + }), + (c.isFalseyButZero = function (a) { + return !a && 0 !== a; + }), + (c.getNumberOrUndefined = function (a) { + return isNaN(+a) ? void 0 : +a; + }), + (c.getMultiValue = function (a, b) { + return c.isNum(a) ? +a : a ? a[b || 'y'] || 0 : 0; + }), + (c.rho = function (a) { + function b(a, c) { + return a % c === 0 ? c : b(c, a % c); + } + function c(a) { + return a * a + 1; + } + if (1 === a) return a; + var d, + e = 2, + f = 2; + if (a % 2 === 0) return 2; + do (e = c(e) % a), (f = c(c(f)) % a), (d = b(Math.abs(e - f), a)); + while (1 === d); + return d; + }), + (c.getBounds = function (a, b, d, e) { + var f, + g, + h, + i = 0, + j = { high: b.high, low: b.low }; + (j.valueRange = j.high - j.low), + (j.oom = c.orderOfMagnitude(j.valueRange)), + (j.step = Math.pow(10, j.oom)), + (j.min = Math.floor(j.low / j.step) * j.step), + (j.max = Math.ceil(j.high / j.step) * j.step), + (j.range = j.max - j.min), + (j.numberOfSteps = Math.round(j.range / j.step)); + var k = c.projectLength(a, j.step, j), + l = d > k, + m = e ? c.rho(j.range) : 0; + if (e && c.projectLength(a, 1, j) >= d) j.step = 1; + else if (e && m < j.step && c.projectLength(a, m, j) >= d) j.step = m; + else + for (;;) { + if (l && c.projectLength(a, j.step, j) <= d) j.step *= 2; + else { + if (l || !(c.projectLength(a, j.step / 2, j) >= d)) break; + if (((j.step /= 2), e && j.step % 1 !== 0)) { + j.step *= 2; + break; + } + } + if (i++ > 1e3) throw new Error('Exceeded maximum number of iterations while optimizing scale step!'); + } + for (g = j.min, h = j.max; g + j.step <= j.low; ) g += j.step; + for (; h - j.step >= j.high; ) h -= j.step; + for (j.min = g, j.max = h, j.range = j.max - j.min, j.values = [], f = j.min; f <= j.max; f += j.step) + j.values.push(c.roundWithPrecision(f)); + return j; + }), + (c.polarToCartesian = function (a, b, c, d) { + var e = ((d - 90) * Math.PI) / 180; + return { x: a + c * Math.cos(e), y: b + c * Math.sin(e) }; + }), + (c.createChartRect = function (a, b, d) { + var e = !(!b.axisX && !b.axisY), + f = e ? b.axisY.offset : 0, + g = e ? b.axisX.offset : 0, + h = a.width() || c.quantity(b.width).value || 0, + i = a.height() || c.quantity(b.height).value || 0, + j = c.normalizePadding(b.chartPadding, d); + (h = Math.max(h, f + j.left + j.right)), (i = Math.max(i, g + j.top + j.bottom)); + var k = { + padding: j, + width: function () { + return this.x2 - this.x1; + }, + height: function () { + return this.y1 - this.y2; + }, + }; + return ( + e + ? ('start' === b.axisX.position + ? ((k.y2 = j.top + g), (k.y1 = Math.max(i - j.bottom, k.y2 + 1))) + : ((k.y2 = j.top), (k.y1 = Math.max(i - j.bottom - g, k.y2 + 1))), + 'start' === b.axisY.position + ? ((k.x1 = j.left + f), (k.x2 = Math.max(h - j.right, k.x1 + 1))) + : ((k.x1 = j.left), (k.x2 = Math.max(h - j.right - f, k.x1 + 1)))) + : ((k.x1 = j.left), (k.x2 = Math.max(h - j.right, k.x1 + 1)), (k.y2 = j.top), (k.y1 = Math.max(i - j.bottom, k.y2 + 1))), + k + ); + }), + (c.createGrid = function (a, b, d, e, f, g, h, i) { + var j = {}; + (j[d.units.pos + '1'] = a), (j[d.units.pos + '2'] = a), (j[d.counterUnits.pos + '1'] = e), (j[d.counterUnits.pos + '2'] = e + f); + var k = g.elem('line', j, h.join(' ')); + i.emit('draw', c.extend({ type: 'grid', axis: d, index: b, group: g, element: k }, j)); + }), + (c.createLabel = function (a, b, d, e, f, g, h, i, j, k, l) { + var m, + n = {}; + if ( + ((n[f.units.pos] = a + h[f.units.pos]), + (n[f.counterUnits.pos] = h[f.counterUnits.pos]), + (n[f.units.len] = b), + (n[f.counterUnits.len] = g - 10), + k) + ) { + var o = + '' + + e[d] + + ''; + m = i.foreignObject(o, c.extend({ style: 'overflow: visible;' }, n)); + } else m = i.elem('text', n, j.join(' ')).text(e[d]); + l.emit('draw', c.extend({ type: 'label', axis: f, index: d, group: i, element: m, text: e[d] }, n)); + }), + (c.getSeriesOption = function (a, b, c) { + if (a.name && b.series && b.series[a.name]) { + var d = b.series[a.name]; + return d.hasOwnProperty(c) ? d[c] : b[c]; + } + return b[c]; + }), + (c.optionsProvider = function (b, d, e) { + function f(b) { + var f = h; + if (((h = c.extend({}, j)), d)) + for (i = 0; i < d.length; i++) { + var g = a.matchMedia(d[i][0]); + g.matches && (h = c.extend(h, d[i][1])); + } + e && !b && e.emit('optionsChanged', { previousOptions: f, currentOptions: h }); + } + function g() { + k.forEach(function (a) { + a.removeListener(f); + }); + } + var h, + i, + j = c.extend({}, b), + k = []; + if (!a.matchMedia) throw "window.matchMedia not found! Make sure you're using a polyfill."; + if (d) + for (i = 0; i < d.length; i++) { + var l = a.matchMedia(d[i][0]); + l.addListener(f), k.push(l); + } + return ( + f(!0), + { + removeMediaQueryListeners: g, + getCurrentOptions: function () { + return c.extend({}, h); + }, + } + ); + }); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + (c.Interpolation = {}), + (c.Interpolation.none = function (a) { + var b = { fillHoles: !1 }; + return ( + (a = c.extend({}, b, a)), + function (b, d) { + for (var e = new c.Svg.Path(), f = !0, g = 0; g < b.length; g += 2) { + var h = b[g], + i = b[g + 1], + j = d[g / 2]; + void 0 !== j.value ? (f ? e.move(h, i, !1, j) : e.line(h, i, !1, j), (f = !1)) : a.fillHoles || (f = !0); + } + return e; + } + ); + }), + (c.Interpolation.simple = function (a) { + var b = { divisor: 2, fillHoles: !1 }; + a = c.extend({}, b, a); + var d = 1 / Math.max(1, a.divisor); + return function (b, e) { + for (var f, g, h, i = new c.Svg.Path(), j = 0; j < b.length; j += 2) { + var k = b[j], + l = b[j + 1], + m = (k - f) * d, + n = e[j / 2]; + void 0 !== n.value + ? (void 0 === h ? i.move(k, l, !1, n) : i.curve(f + m, g, k - m, l, k, l, !1, n), (f = k), (g = l), (h = n)) + : a.fillHoles || (f = k = h = void 0); + } + return i; + }; + }), + (c.Interpolation.cardinal = function (a) { + function b(b, c) { + for (var d = [], e = !0, f = 0; f < b.length; f += 2) + void 0 === c[f / 2].value + ? a.fillHoles || (e = !0) + : (e && (d.push({ pathCoordinates: [], valueData: [] }), (e = !1)), + d[d.length - 1].pathCoordinates.push(b[f], b[f + 1]), + d[d.length - 1].valueData.push(c[f / 2])); + return d; + } + var d = { tension: 1, fillHoles: !1 }; + a = c.extend({}, d, a); + var e = Math.min(1, Math.max(0, a.tension)), + f = 1 - e; + return function g(a, d) { + var h = b(a, d); + if (h.length) { + if (h.length > 1) { + var i = []; + return ( + h.forEach(function (a) { + i.push(g(a.pathCoordinates, a.valueData)); + }), + c.Svg.Path.join(i) + ); + } + if (((a = h[0].pathCoordinates), (d = h[0].valueData), a.length <= 4)) return c.Interpolation.none()(a, d); + for (var j, k = new c.Svg.Path().move(a[0], a[1], !1, d[0]), l = 0, m = a.length; m - 2 * !j > l; l += 2) { + var n = [ + { x: +a[l - 2], y: +a[l - 1] }, + { x: +a[l], y: +a[l + 1] }, + { x: +a[l + 2], y: +a[l + 3] }, + { x: +a[l + 4], y: +a[l + 5] }, + ]; + j + ? l + ? m - 4 === l + ? (n[3] = { x: +a[0], y: +a[1] }) + : m - 2 === l && ((n[2] = { x: +a[0], y: +a[1] }), (n[3] = { x: +a[2], y: +a[3] })) + : (n[0] = { x: +a[m - 2], y: +a[m - 1] }) + : m - 4 === l + ? (n[3] = n[2]) + : l || (n[0] = { x: +a[l], y: +a[l + 1] }), + k.curve( + (e * (-n[0].x + 6 * n[1].x + n[2].x)) / 6 + f * n[2].x, + (e * (-n[0].y + 6 * n[1].y + n[2].y)) / 6 + f * n[2].y, + (e * (n[1].x + 6 * n[2].x - n[3].x)) / 6 + f * n[2].x, + (e * (n[1].y + 6 * n[2].y - n[3].y)) / 6 + f * n[2].y, + n[2].x, + n[2].y, + !1, + d[(l + 2) / 2] + ); + } + return k; + } + return c.Interpolation.none()([]); + }; + }), + (c.Interpolation.step = function (a) { + var b = { postpone: !0, fillHoles: !1 }; + return ( + (a = c.extend({}, b, a)), + function (b, d) { + for (var e, f, g, h = new c.Svg.Path(), i = 0; i < b.length; i += 2) { + var j = b[i], + k = b[i + 1], + l = d[i / 2]; + void 0 !== l.value + ? (void 0 === g ? h.move(j, k, !1, l) : (a.postpone ? h.line(j, f, !1, g) : h.line(e, k, !1, l), h.line(j, k, !1, l)), + (e = j), + (f = k), + (g = l)) + : a.fillHoles || (e = f = g = void 0); + } + return h; + } + ); + }); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + c.EventEmitter = function () { + function a(a, b) { + (d[a] = d[a] || []), d[a].push(b); + } + function b(a, b) { + d[a] && (b ? (d[a].splice(d[a].indexOf(b), 1), 0 === d[a].length && delete d[a]) : delete d[a]); + } + function c(a, b) { + d[a] && + d[a].forEach(function (a) { + a(b); + }), + d['*'] && + d['*'].forEach(function (c) { + c(a, b); + }); + } + var d = []; + return { addEventHandler: a, removeEventHandler: b, emit: c }; + }; + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a) { + var b = []; + if (a.length) for (var c = 0; c < a.length; c++) b.push(a[c]); + return b; + } + function e(a, b) { + var d = b || this.prototype || c.Class, + e = Object.create(d); + c.Class.cloneDefinitions(e, a); + var f = function () { + var a, + b = e.constructor || function () {}; + return (a = this === c ? Object.create(e) : this), b.apply(a, Array.prototype.slice.call(arguments, 0)), a; + }; + return (f.prototype = e), (f['super'] = d), (f.extend = this.extend), f; + } + function f() { + var a = d(arguments), + b = a[0]; + return ( + a.splice(1, a.length - 1).forEach(function (a) { + Object.getOwnPropertyNames(a).forEach(function (c) { + delete b[c], Object.defineProperty(b, c, Object.getOwnPropertyDescriptor(a, c)); + }); + }), + b + ); + } + c.Class = { extend: e, cloneDefinitions: f }; + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a, b, d) { + return ( + a && ((this.data = a), this.eventEmitter.emit('data', { type: 'update', data: this.data })), + b && + ((this.options = c.extend({}, d ? this.options : this.defaultOptions, b)), + this.initializeTimeoutId || + (this.optionsProvider.removeMediaQueryListeners(), + (this.optionsProvider = c.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter)))), + this.initializeTimeoutId || this.createChart(this.optionsProvider.getCurrentOptions()), + this + ); + } + function e() { + return ( + this.initializeTimeoutId + ? a.clearTimeout(this.initializeTimeoutId) + : (a.removeEventListener('resize', this.resizeListener), this.optionsProvider.removeMediaQueryListeners()), + this + ); + } + function f(a, b) { + return this.eventEmitter.addEventHandler(a, b), this; + } + function g(a, b) { + return this.eventEmitter.removeEventHandler(a, b), this; + } + function h() { + a.addEventListener('resize', this.resizeListener), + (this.optionsProvider = c.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter)), + this.eventEmitter.addEventHandler( + 'optionsChanged', + function () { + this.update(); + }.bind(this) + ), + this.options.plugins && + this.options.plugins.forEach( + function (a) { + a instanceof Array ? a[0](this, a[1]) : a(this); + }.bind(this) + ), + this.eventEmitter.emit('data', { type: 'initial', data: this.data }), + this.createChart(this.optionsProvider.getCurrentOptions()), + (this.initializeTimeoutId = void 0); + } + function i(a, b, d, e, f) { + (this.container = c.querySelector(a)), + (this.data = b), + (this.defaultOptions = d), + (this.options = e), + (this.responsiveOptions = f), + (this.eventEmitter = c.EventEmitter()), + (this.supportsForeignObject = c.Svg.isSupported('Extensibility')), + (this.supportsAnimations = c.Svg.isSupported('AnimationEventsAttribute')), + (this.resizeListener = function () { + this.update(); + }.bind(this)), + this.container && (this.container.__chartist__ && this.container.__chartist__.detach(), (this.container.__chartist__ = this)), + (this.initializeTimeoutId = setTimeout(h.bind(this), 0)); + } + c.Base = c.Class.extend({ + constructor: i, + optionsProvider: void 0, + container: void 0, + svg: void 0, + eventEmitter: void 0, + createChart: function () { + throw new Error("Base chart type can't be instantiated!"); + }, + update: d, + detach: e, + on: f, + off: g, + version: c.version, + supportsForeignObject: !1, + }); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a, d, e, f, g) { + a instanceof Element + ? (this._node = a) + : ((this._node = b.createElementNS(c.namespaces.svg, a)), 'svg' === a && this.attr({ 'xmlns:ct': c.namespaces.ct })), + d && this.attr(d), + e && this.addClass(e), + f && (g && f._node.firstChild ? f._node.insertBefore(this._node, f._node.firstChild) : f._node.appendChild(this._node)); + } + function e(a, b) { + return 'string' == typeof a + ? b + ? this._node.getAttributeNS(b, a) + : this._node.getAttribute(a) + : (Object.keys(a).forEach( + function (b) { + if (void 0 !== a[b]) + if (-1 !== b.indexOf(':')) { + var d = b.split(':'); + this._node.setAttributeNS(c.namespaces[d[0]], b, a[b]); + } else this._node.setAttribute(b, a[b]); + }.bind(this) + ), + this); + } + function f(a, b, d, e) { + return new c.Svg(a, b, d, this, e); + } + function g() { + return this._node.parentNode instanceof SVGElement ? new c.Svg(this._node.parentNode) : null; + } + function h() { + for (var a = this._node; 'svg' !== a.nodeName; ) a = a.parentNode; + return new c.Svg(a); + } + function i(a) { + var b = this._node.querySelector(a); + return b ? new c.Svg(b) : null; + } + function j(a) { + var b = this._node.querySelectorAll(a); + return b.length ? new c.Svg.List(b) : null; + } + function k(a, d, e, f) { + if ('string' == typeof a) { + var g = b.createElement('div'); + (g.innerHTML = a), (a = g.firstChild); + } + a.setAttribute('xmlns', c.namespaces.xmlns); + var h = this.elem('foreignObject', d, e, f); + return h._node.appendChild(a), h; + } + function l(a) { + return this._node.appendChild(b.createTextNode(a)), this; + } + function m() { + for (; this._node.firstChild; ) this._node.removeChild(this._node.firstChild); + return this; + } + function n() { + return this._node.parentNode.removeChild(this._node), this.parent(); + } + function o(a) { + return this._node.parentNode.replaceChild(a._node, this._node), a; + } + function p(a, b) { + return b && this._node.firstChild ? this._node.insertBefore(a._node, this._node.firstChild) : this._node.appendChild(a._node), this; + } + function q() { + return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\s+/) : []; + } + function r(a) { + return ( + this._node.setAttribute( + 'class', + this.classes(this._node) + .concat(a.trim().split(/\s+/)) + .filter(function (a, b, c) { + return c.indexOf(a) === b; + }) + .join(' ') + ), + this + ); + } + function s(a) { + var b = a.trim().split(/\s+/); + return ( + this._node.setAttribute( + 'class', + this.classes(this._node) + .filter(function (a) { + return -1 === b.indexOf(a); + }) + .join(' ') + ), + this + ); + } + function t() { + return this._node.setAttribute('class', ''), this; + } + function u() { + return this._node.getBoundingClientRect().height; + } + function v() { + return this._node.getBoundingClientRect().width; + } + function w(a, b, d) { + return ( + void 0 === b && (b = !0), + Object.keys(a).forEach( + function (e) { + function f(a, b) { + var f, + g, + h, + i = {}; + a.easing && ((h = a.easing instanceof Array ? a.easing : c.Svg.Easing[a.easing]), delete a.easing), + (a.begin = c.ensureUnit(a.begin, 'ms')), + (a.dur = c.ensureUnit(a.dur, 'ms')), + h && ((a.calcMode = 'spline'), (a.keySplines = h.join(' ')), (a.keyTimes = '0;1')), + b && ((a.fill = 'freeze'), (i[e] = a.from), this.attr(i), (g = c.quantity(a.begin || 0).value), (a.begin = 'indefinite')), + (f = this.elem('animate', c.extend({ attributeName: e }, a))), + b && + setTimeout( + function () { + try { + f._node.beginElement(); + } catch (b) { + (i[e] = a.to), this.attr(i), f.remove(); + } + }.bind(this), + g + ), + d && + f._node.addEventListener( + 'beginEvent', + function () { + d.emit('animationBegin', { element: this, animate: f._node, params: a }); + }.bind(this) + ), + f._node.addEventListener( + 'endEvent', + function () { + d && d.emit('animationEnd', { element: this, animate: f._node, params: a }), + b && ((i[e] = a.to), this.attr(i), f.remove()); + }.bind(this) + ); + } + a[e] instanceof Array + ? a[e].forEach( + function (a) { + f.bind(this)(a, !1); + }.bind(this) + ) + : f.bind(this)(a[e], b); + }.bind(this) + ), + this + ); + } + function x(a) { + var b = this; + this.svgElements = []; + for (var d = 0; d < a.length; d++) this.svgElements.push(new c.Svg(a[d])); + Object.keys(c.Svg.prototype) + .filter(function (a) { + return ( + -1 === + ['constructor', 'parent', 'querySelector', 'querySelectorAll', 'replace', 'append', 'classes', 'height', 'width'].indexOf(a) + ); + }) + .forEach(function (a) { + b[a] = function () { + var d = Array.prototype.slice.call(arguments, 0); + return ( + b.svgElements.forEach(function (b) { + c.Svg.prototype[a].apply(b, d); + }), + b + ); + }; + }); + } + (c.Svg = c.Class.extend({ + constructor: d, + attr: e, + elem: f, + parent: g, + root: h, + querySelector: i, + querySelectorAll: j, + foreignObject: k, + text: l, + empty: m, + remove: n, + replace: o, + append: p, + classes: q, + addClass: r, + removeClass: s, + removeAllClasses: t, + height: u, + width: v, + animate: w, + })), + (c.Svg.isSupported = function (a) { + return b.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + a, '1.1'); + }); + var y = { + easeInSine: [0.47, 0, 0.745, 0.715], + easeOutSine: [0.39, 0.575, 0.565, 1], + easeInOutSine: [0.445, 0.05, 0.55, 0.95], + easeInQuad: [0.55, 0.085, 0.68, 0.53], + easeOutQuad: [0.25, 0.46, 0.45, 0.94], + easeInOutQuad: [0.455, 0.03, 0.515, 0.955], + easeInCubic: [0.55, 0.055, 0.675, 0.19], + easeOutCubic: [0.215, 0.61, 0.355, 1], + easeInOutCubic: [0.645, 0.045, 0.355, 1], + easeInQuart: [0.895, 0.03, 0.685, 0.22], + easeOutQuart: [0.165, 0.84, 0.44, 1], + easeInOutQuart: [0.77, 0, 0.175, 1], + easeInQuint: [0.755, 0.05, 0.855, 0.06], + easeOutQuint: [0.23, 1, 0.32, 1], + easeInOutQuint: [0.86, 0, 0.07, 1], + easeInExpo: [0.95, 0.05, 0.795, 0.035], + easeOutExpo: [0.19, 1, 0.22, 1], + easeInOutExpo: [1, 0, 0, 1], + easeInCirc: [0.6, 0.04, 0.98, 0.335], + easeOutCirc: [0.075, 0.82, 0.165, 1], + easeInOutCirc: [0.785, 0.135, 0.15, 0.86], + easeInBack: [0.6, -0.28, 0.735, 0.045], + easeOutBack: [0.175, 0.885, 0.32, 1.275], + easeInOutBack: [0.68, -0.55, 0.265, 1.55], + }; + (c.Svg.Easing = y), (c.Svg.List = c.Class.extend({ constructor: x })); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a, b, d, e, f, g) { + var h = c.extend({ command: f ? a.toLowerCase() : a.toUpperCase() }, b, g ? { data: g } : {}); + d.splice(e, 0, h); + } + function e(a, b) { + a.forEach(function (c, d) { + u[c.command.toLowerCase()].forEach(function (e, f) { + b(c, e, d, f, a); + }); + }); + } + function f(a, b) { + (this.pathElements = []), (this.pos = 0), (this.close = a), (this.options = c.extend({}, v, b)); + } + function g(a) { + return void 0 !== a ? ((this.pos = Math.max(0, Math.min(this.pathElements.length, a))), this) : this.pos; + } + function h(a) { + return this.pathElements.splice(this.pos, a), this; + } + function i(a, b, c, e) { + return d('M', { x: +a, y: +b }, this.pathElements, this.pos++, c, e), this; + } + function j(a, b, c, e) { + return d('L', { x: +a, y: +b }, this.pathElements, this.pos++, c, e), this; + } + function k(a, b, c, e, f, g, h, i) { + return d('C', { x1: +a, y1: +b, x2: +c, y2: +e, x: +f, y: +g }, this.pathElements, this.pos++, h, i), this; + } + function l(a, b, c, e, f, g, h, i, j) { + return d('A', { rx: +a, ry: +b, xAr: +c, lAf: +e, sf: +f, x: +g, y: +h }, this.pathElements, this.pos++, i, j), this; + } + function m(a) { + var b = a + .replace(/([A-Za-z])([0-9])/g, '$1 $2') + .replace(/([0-9])([A-Za-z])/g, '$1 $2') + .split(/[\s,]+/) + .reduce(function (a, b) { + return b.match(/[A-Za-z]/) && a.push([]), a[a.length - 1].push(b), a; + }, []); + 'Z' === b[b.length - 1][0].toUpperCase() && b.pop(); + var d = b.map(function (a) { + var b = a.shift(), + d = u[b.toLowerCase()]; + return c.extend( + { command: b }, + d.reduce(function (b, c, d) { + return (b[c] = +a[d]), b; + }, {}) + ); + }), + e = [this.pos, 0]; + return Array.prototype.push.apply(e, d), Array.prototype.splice.apply(this.pathElements, e), (this.pos += d.length), this; + } + function n() { + var a = Math.pow(10, this.options.accuracy); + return ( + this.pathElements.reduce( + function (b, c) { + var d = u[c.command.toLowerCase()].map( + function (b) { + return this.options.accuracy ? Math.round(c[b] * a) / a : c[b]; + }.bind(this) + ); + return b + c.command + d.join(','); + }.bind(this), + '' + ) + (this.close ? 'Z' : '') + ); + } + function o(a, b) { + return ( + e(this.pathElements, function (c, d) { + c[d] *= 'x' === d[0] ? a : b; + }), + this + ); + } + function p(a, b) { + return ( + e(this.pathElements, function (c, d) { + c[d] += 'x' === d[0] ? a : b; + }), + this + ); + } + function q(a) { + return ( + e(this.pathElements, function (b, c, d, e, f) { + var g = a(b, c, d, e, f); + (g || 0 === g) && (b[c] = g); + }), + this + ); + } + function r(a) { + var b = new c.Svg.Path(a || this.close); + return ( + (b.pos = this.pos), + (b.pathElements = this.pathElements.slice().map(function (a) { + return c.extend({}, a); + })), + (b.options = c.extend({}, this.options)), + b + ); + } + function s(a) { + var b = [new c.Svg.Path()]; + return ( + this.pathElements.forEach(function (d) { + d.command === a.toUpperCase() && 0 !== b[b.length - 1].pathElements.length && b.push(new c.Svg.Path()), + b[b.length - 1].pathElements.push(d); + }), + b + ); + } + function t(a, b, d) { + for (var e = new c.Svg.Path(b, d), f = 0; f < a.length; f++) + for (var g = a[f], h = 0; h < g.pathElements.length; h++) e.pathElements.push(g.pathElements[h]); + return e; + } + var u = { m: ['x', 'y'], l: ['x', 'y'], c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'], a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y'] }, + v = { accuracy: 3 }; + (c.Svg.Path = c.Class.extend({ + constructor: f, + position: g, + remove: h, + move: i, + line: j, + curve: k, + arc: l, + scale: o, + translate: p, + transform: q, + parse: m, + stringify: n, + clone: r, + splitByCommand: s, + })), + (c.Svg.Path.elementDescriptions = u), + (c.Svg.Path.join = t); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a, b, c, d) { + (this.units = a), + (this.counterUnits = a === f.x ? f.y : f.x), + (this.chartRect = b), + (this.axisLength = b[a.rectEnd] - b[a.rectStart]), + (this.gridOffset = b[a.rectOffset]), + (this.ticks = c), + (this.options = d); + } + function e(a, b, d, e, f) { + var g = e['axis' + this.units.pos.toUpperCase()], + h = this.ticks.map(this.projectValue.bind(this)), + i = this.ticks.map(g.labelInterpolationFnc); + h.forEach( + function (j, k) { + var l, + m = { x: 0, y: 0 }; + (l = h[k + 1] ? h[k + 1] - j : Math.max(this.axisLength - j, 30)), + (c.isFalseyButZero(i[k]) && '' !== i[k]) || + ('x' === this.units.pos + ? ((j = this.chartRect.x1 + j), + (m.x = e.axisX.labelOffset.x), + 'start' === e.axisX.position + ? (m.y = this.chartRect.padding.top + e.axisX.labelOffset.y + (d ? 5 : 20)) + : (m.y = this.chartRect.y1 + e.axisX.labelOffset.y + (d ? 5 : 20))) + : ((j = this.chartRect.y1 - j), + (m.y = e.axisY.labelOffset.y - (d ? l : 0)), + 'start' === e.axisY.position + ? (m.x = d ? this.chartRect.padding.left + e.axisY.labelOffset.x : this.chartRect.x1 - 10) + : (m.x = this.chartRect.x2 + e.axisY.labelOffset.x + 10)), + g.showGrid && + c.createGrid( + j, + k, + this, + this.gridOffset, + this.chartRect[this.counterUnits.len](), + a, + [e.classNames.grid, e.classNames[this.units.dir]], + f + ), + g.showLabel && + c.createLabel( + j, + l, + k, + i, + this, + g.offset, + m, + b, + [e.classNames.label, e.classNames[this.units.dir], e.classNames[g.position]], + d, + f + )); + }.bind(this) + ); + } + var f = { + x: { pos: 'x', len: 'width', dir: 'horizontal', rectStart: 'x1', rectEnd: 'x2', rectOffset: 'y2' }, + y: { pos: 'y', len: 'height', dir: 'vertical', rectStart: 'y2', rectEnd: 'y1', rectOffset: 'x1' }, + }; + (c.Axis = c.Class.extend({ + constructor: d, + createGridAndLabels: e, + projectValue: function (a, b, c) { + throw new Error("Base axis can't be instantiated!"); + }, + })), + (c.Axis.units = f); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a, b, d, e) { + var f = e.highLow || c.getHighLow(b.normalized, e, a.pos); + (this.bounds = c.getBounds(d[a.rectEnd] - d[a.rectStart], f, e.scaleMinSpace || 20, e.onlyInteger)), + (this.range = { min: this.bounds.min, max: this.bounds.max }), + c.AutoScaleAxis['super'].constructor.call(this, a, d, this.bounds.values, e); + } + function e(a) { + return (this.axisLength * (+c.getMultiValue(a, this.units.pos) - this.bounds.min)) / this.bounds.range; + } + c.AutoScaleAxis = c.Axis.extend({ constructor: d, projectValue: e }); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a, b, d, e) { + var f = e.highLow || c.getHighLow(b.normalized, e, a.pos); + (this.divisor = e.divisor || 1), + (this.ticks = + e.ticks || + c.times(this.divisor).map( + function (a, b) { + return f.low + ((f.high - f.low) / this.divisor) * b; + }.bind(this) + )), + this.ticks.sort(function (a, b) { + return a - b; + }), + (this.range = { min: f.low, max: f.high }), + c.FixedScaleAxis['super'].constructor.call(this, a, d, this.ticks, e), + (this.stepLength = this.axisLength / this.divisor); + } + function e(a) { + return (this.axisLength * (+c.getMultiValue(a, this.units.pos) - this.range.min)) / (this.range.max - this.range.min); + } + c.FixedScaleAxis = c.Axis.extend({ constructor: d, projectValue: e }); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a, b, d, e) { + c.StepAxis['super'].constructor.call(this, a, d, e.ticks, e), + (this.stepLength = this.axisLength / (e.ticks.length - (e.stretch ? 1 : 0))); + } + function e(a, b) { + return this.stepLength * b; + } + c.StepAxis = c.Axis.extend({ constructor: d, projectValue: e }); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a) { + this.data = c.normalizeData(this.data); + var b = { raw: this.data, normalized: c.getDataArray(this.data, a.reverseData, !0) }; + this.svg = c.createSvg(this.container, a.width, a.height, a.classNames.chart); + var d, + e, + g = this.svg.elem('g').addClass(a.classNames.gridGroup), + h = this.svg.elem('g'), + i = this.svg.elem('g').addClass(a.classNames.labelGroup), + j = c.createChartRect(this.svg, a, f.padding); + (d = + void 0 === a.axisX.type + ? new c.StepAxis(c.Axis.units.x, b, j, c.extend({}, a.axisX, { ticks: b.raw.labels, stretch: a.fullWidth })) + : a.axisX.type.call(c, c.Axis.units.x, b, j, a.axisX)), + (e = + void 0 === a.axisY.type + ? new c.AutoScaleAxis( + c.Axis.units.y, + b, + j, + c.extend({}, a.axisY, { high: c.isNum(a.high) ? a.high : a.axisY.high, low: c.isNum(a.low) ? a.low : a.axisY.low }) + ) + : a.axisY.type.call(c, c.Axis.units.y, b, j, a.axisY)), + d.createGridAndLabels(g, i, this.supportsForeignObject, a, this.eventEmitter), + e.createGridAndLabels(g, i, this.supportsForeignObject, a, this.eventEmitter), + b.raw.series.forEach( + function (f, g) { + var i = h.elem('g'); + i.attr({ 'ct:series-name': f.name, 'ct:meta': c.serialize(f.meta) }), + i.addClass([a.classNames.series, f.className || a.classNames.series + '-' + c.alphaNumerate(g)].join(' ')); + var k = [], + l = []; + b.normalized[g].forEach( + function (a, h) { + var i = { x: j.x1 + d.projectValue(a, h, b.normalized[g]), y: j.y1 - e.projectValue(a, h, b.normalized[g]) }; + k.push(i.x, i.y), l.push({ value: a, valueIndex: h, meta: c.getMetaData(f, h) }); + }.bind(this) + ); + var m = { + lineSmooth: c.getSeriesOption(f, a, 'lineSmooth'), + showPoint: c.getSeriesOption(f, a, 'showPoint'), + showLine: c.getSeriesOption(f, a, 'showLine'), + showArea: c.getSeriesOption(f, a, 'showArea'), + areaBase: c.getSeriesOption(f, a, 'areaBase'), + }, + n = 'function' == typeof m.lineSmooth ? m.lineSmooth : m.lineSmooth ? c.Interpolation.cardinal() : c.Interpolation.none(), + o = n(k, l); + if ( + (m.showPoint && + o.pathElements.forEach( + function (b) { + var h = i + .elem('line', { x1: b.x, y1: b.y, x2: b.x + 0.01, y2: b.y }, a.classNames.point) + .attr({ 'ct:value': [b.data.value.x, b.data.value.y].filter(c.isNum).join(','), 'ct:meta': b.data.meta }); + this.eventEmitter.emit('draw', { + type: 'point', + value: b.data.value, + index: b.data.valueIndex, + meta: b.data.meta, + series: f, + seriesIndex: g, + axisX: d, + axisY: e, + group: i, + element: h, + x: b.x, + y: b.y, + }); + }.bind(this) + ), + m.showLine) + ) { + var p = i.elem('path', { d: o.stringify() }, a.classNames.line, !0); + this.eventEmitter.emit('draw', { + type: 'line', + values: b.normalized[g], + path: o.clone(), + chartRect: j, + index: g, + series: f, + seriesIndex: g, + axisX: d, + axisY: e, + group: i, + element: p, + }); + } + if (m.showArea && e.range) { + var q = Math.max(Math.min(m.areaBase, e.range.max), e.range.min), + r = j.y1 - e.projectValue(q); + o.splitByCommand('M') + .filter(function (a) { + return a.pathElements.length > 1; + }) + .map(function (a) { + var b = a.pathElements[0], + c = a.pathElements[a.pathElements.length - 1]; + return a + .clone(!0) + .position(0) + .remove(1) + .move(b.x, r) + .line(b.x, b.y) + .position(a.pathElements.length + 1) + .line(c.x, r); + }) + .forEach( + function (c) { + var h = i.elem('path', { d: c.stringify() }, a.classNames.area, !0); + this.eventEmitter.emit('draw', { + type: 'area', + values: b.normalized[g], + path: c.clone(), + series: f, + seriesIndex: g, + axisX: d, + axisY: e, + chartRect: j, + index: g, + group: i, + element: h, + }); + }.bind(this) + ); + } + }.bind(this) + ), + this.eventEmitter.emit('created', { bounds: e.bounds, chartRect: j, axisX: d, axisY: e, svg: this.svg, options: a }); + } + function e(a, b, d, e) { + c.Line['super'].constructor.call(this, a, b, f, c.extend({}, f, d), e); + } + var f = { + axisX: { + offset: 30, + position: 'end', + labelOffset: { x: 0, y: 0 }, + showLabel: !0, + showGrid: !0, + labelInterpolationFnc: c.noop, + type: void 0, + }, + axisY: { + offset: 40, + position: 'start', + labelOffset: { x: 0, y: 0 }, + showLabel: !0, + showGrid: !0, + labelInterpolationFnc: c.noop, + type: void 0, + scaleMinSpace: 20, + onlyInteger: !1, + }, + width: void 0, + height: void 0, + showLine: !0, + showPoint: !0, + showArea: !1, + areaBase: 0, + lineSmooth: !0, + low: void 0, + high: void 0, + chartPadding: { top: 15, right: 15, bottom: 5, left: 10 }, + fullWidth: !1, + reverseData: !1, + classNames: { + chart: 'ct-chart-line', + label: 'ct-label', + labelGroup: 'ct-labels', + series: 'ct-series', + line: 'ct-line', + point: 'ct-point', + area: 'ct-area', + grid: 'ct-grid', + gridGroup: 'ct-grids', + vertical: 'ct-vertical', + horizontal: 'ct-horizontal', + start: 'ct-start', + end: 'ct-end', + }, + }; + c.Line = c.Base.extend({ constructor: e, createChart: d }); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a) { + this.data = c.normalizeData(this.data); + var b, + d = { + raw: this.data, + normalized: a.distributeSeries + ? c.getDataArray(this.data, a.reverseData, a.horizontalBars ? 'x' : 'y').map(function (a) { + return [a]; + }) + : c.getDataArray(this.data, a.reverseData, a.horizontalBars ? 'x' : 'y'), + }; + this.svg = c.createSvg( + this.container, + a.width, + a.height, + a.classNames.chart + (a.horizontalBars ? ' ' + a.classNames.horizontalBars : '') + ); + var e = this.svg.elem('g').addClass(a.classNames.gridGroup), + g = this.svg.elem('g'), + h = this.svg.elem('g').addClass(a.classNames.labelGroup); + if (a.stackBars && 0 !== d.normalized.length) { + var i = c.serialMap(d.normalized, function () { + return Array.prototype.slice + .call(arguments) + .map(function (a) { + return a; + }) + .reduce( + function (a, b) { + return { x: a.x + (b && b.x) || 0, y: a.y + (b && b.y) || 0 }; + }, + { x: 0, y: 0 } + ); + }); + b = c.getHighLow([i], c.extend({}, a, { referenceValue: 0 }), a.horizontalBars ? 'x' : 'y'); + } else b = c.getHighLow(d.normalized, c.extend({}, a, { referenceValue: 0 }), a.horizontalBars ? 'x' : 'y'); + (b.high = +a.high || (0 === a.high ? 0 : b.high)), (b.low = +a.low || (0 === a.low ? 0 : b.low)); + var j, + k, + l, + m, + n, + o = c.createChartRect(this.svg, a, f.padding); + (k = a.distributeSeries && a.stackBars ? d.raw.labels.slice(0, 1) : d.raw.labels), + a.horizontalBars + ? ((j = m = + void 0 === a.axisX.type + ? new c.AutoScaleAxis(c.Axis.units.x, d, o, c.extend({}, a.axisX, { highLow: b, referenceValue: 0 })) + : a.axisX.type.call(c, c.Axis.units.x, d, o, c.extend({}, a.axisX, { highLow: b, referenceValue: 0 }))), + (l = n = + void 0 === a.axisY.type + ? new c.StepAxis(c.Axis.units.y, d, o, { ticks: k }) + : a.axisY.type.call(c, c.Axis.units.y, d, o, a.axisY))) + : ((l = m = + void 0 === a.axisX.type + ? new c.StepAxis(c.Axis.units.x, d, o, { ticks: k }) + : a.axisX.type.call(c, c.Axis.units.x, d, o, a.axisX)), + (j = n = + void 0 === a.axisY.type + ? new c.AutoScaleAxis(c.Axis.units.y, d, o, c.extend({}, a.axisY, { highLow: b, referenceValue: 0 })) + : a.axisY.type.call(c, c.Axis.units.y, d, o, c.extend({}, a.axisY, { highLow: b, referenceValue: 0 })))); + var p = a.horizontalBars ? o.x1 + j.projectValue(0) : o.y1 - j.projectValue(0), + q = []; + l.createGridAndLabels(e, h, this.supportsForeignObject, a, this.eventEmitter), + j.createGridAndLabels(e, h, this.supportsForeignObject, a, this.eventEmitter), + d.raw.series.forEach( + function (b, e) { + var f, + h, + i = e - (d.raw.series.length - 1) / 2; + (f = + a.distributeSeries && !a.stackBars + ? l.axisLength / d.normalized.length / 2 + : a.distributeSeries && a.stackBars + ? l.axisLength / 2 + : l.axisLength / d.normalized[e].length / 2), + (h = g.elem('g')), + h.attr({ 'ct:series-name': b.name, 'ct:meta': c.serialize(b.meta) }), + h.addClass([a.classNames.series, b.className || a.classNames.series + '-' + c.alphaNumerate(e)].join(' ')), + d.normalized[e].forEach( + function (g, k) { + var r, s, t, u; + if ( + ((u = a.distributeSeries && !a.stackBars ? e : a.distributeSeries && a.stackBars ? 0 : k), + (r = a.horizontalBars + ? { + x: o.x1 + j.projectValue(g && g.x ? g.x : 0, k, d.normalized[e]), + y: o.y1 - l.projectValue(g && g.y ? g.y : 0, u, d.normalized[e]), + } + : { + x: o.x1 + l.projectValue(g && g.x ? g.x : 0, u, d.normalized[e]), + y: o.y1 - j.projectValue(g && g.y ? g.y : 0, k, d.normalized[e]), + }), + l instanceof c.StepAxis && + (l.options.stretch || (r[l.units.pos] += f * (a.horizontalBars ? -1 : 1)), + (r[l.units.pos] += a.stackBars || a.distributeSeries ? 0 : i * a.seriesBarDistance * (a.horizontalBars ? -1 : 1))), + (t = q[k] || p), + (q[k] = t - (p - r[l.counterUnits.pos])), + void 0 !== g) + ) { + var v = {}; + (v[l.units.pos + '1'] = r[l.units.pos]), + (v[l.units.pos + '2'] = r[l.units.pos]), + !a.stackBars || ('accumulate' !== a.stackMode && a.stackMode) + ? ((v[l.counterUnits.pos + '1'] = p), (v[l.counterUnits.pos + '2'] = r[l.counterUnits.pos])) + : ((v[l.counterUnits.pos + '1'] = t), (v[l.counterUnits.pos + '2'] = q[k])), + (v.x1 = Math.min(Math.max(v.x1, o.x1), o.x2)), + (v.x2 = Math.min(Math.max(v.x2, o.x1), o.x2)), + (v.y1 = Math.min(Math.max(v.y1, o.y2), o.y1)), + (v.y2 = Math.min(Math.max(v.y2, o.y2), o.y1)), + (s = h + .elem('line', v, a.classNames.bar) + .attr({ 'ct:value': [g.x, g.y].filter(c.isNum).join(','), 'ct:meta': c.getMetaData(b, k) })), + this.eventEmitter.emit( + 'draw', + c.extend( + { + type: 'bar', + value: g, + index: k, + meta: c.getMetaData(b, k), + series: b, + seriesIndex: e, + axisX: m, + axisY: n, + chartRect: o, + group: h, + element: s, + }, + v + ) + ); + } + }.bind(this) + ); + }.bind(this) + ), + this.eventEmitter.emit('created', { bounds: j.bounds, chartRect: o, axisX: m, axisY: n, svg: this.svg, options: a }); + } + function e(a, b, d, e) { + c.Bar['super'].constructor.call(this, a, b, f, c.extend({}, f, d), e); + } + var f = { + axisX: { + offset: 30, + position: 'end', + labelOffset: { x: 0, y: 0 }, + showLabel: !0, + showGrid: !0, + labelInterpolationFnc: c.noop, + scaleMinSpace: 30, + onlyInteger: !1, + }, + axisY: { + offset: 40, + position: 'start', + labelOffset: { x: 0, y: 0 }, + showLabel: !0, + showGrid: !0, + labelInterpolationFnc: c.noop, + scaleMinSpace: 20, + onlyInteger: !1, + }, + width: void 0, + height: void 0, + high: void 0, + low: void 0, + chartPadding: { top: 15, right: 15, bottom: 5, left: 10 }, + seriesBarDistance: 15, + stackBars: !1, + stackMode: 'accumulate', + horizontalBars: !1, + distributeSeries: !1, + reverseData: !1, + classNames: { + chart: 'ct-chart-bar', + horizontalBars: 'ct-horizontal-bars', + label: 'ct-label', + labelGroup: 'ct-labels', + series: 'ct-series', + bar: 'ct-bar', + grid: 'ct-grid', + gridGroup: 'ct-grids', + vertical: 'ct-vertical', + horizontal: 'ct-horizontal', + start: 'ct-start', + end: 'ct-end', + }, + }; + c.Bar = c.Base.extend({ constructor: e, createChart: d }); + })(window, document, a), + (function (a, b, c) { + 'use strict'; + function d(a, b, c) { + var d = b.x > a.x; + return (d && 'explode' === c) || (!d && 'implode' === c) + ? 'start' + : (d && 'implode' === c) || (!d && 'explode' === c) + ? 'end' + : 'middle'; + } + function e(a) { + this.data = c.normalizeData(this.data); + var b, + e, + f, + h, + i, + j = [], + k = a.startAngle, + l = c.getDataArray(this.data, a.reverseData); + (this.svg = c.createSvg(this.container, a.width, a.height, a.donut ? a.classNames.chartDonut : a.classNames.chartPie)), + (e = c.createChartRect(this.svg, a, g.padding)), + (f = Math.min(e.width() / 2, e.height() / 2)), + (i = + a.total || + l.reduce(function (a, b) { + return a + b; + }, 0)); + var m = c.quantity(a.donutWidth); + '%' === m.unit && (m.value *= f / 100), + (f -= a.donut ? m.value / 2 : 0), + (h = 'outside' === a.labelPosition || a.donut ? f : 'center' === a.labelPosition ? 0 : f / 2), + (h += a.labelOffset); + var n = { x: e.x1 + e.width() / 2, y: e.y2 + e.height() / 2 }, + o = + 1 === + this.data.series.filter(function (a) { + return a.hasOwnProperty('value') ? 0 !== a.value : 0 !== a; + }).length; + a.showLabel && (b = this.svg.elem('g', null, null, !0)); + for (var p = 0; p < this.data.series.length; p++) + if (0 !== l[p] || !a.ignoreEmptyValues) { + var q = this.data.series[p]; + (j[p] = this.svg.elem('g', null, null, !0)), + j[p].attr({ 'ct:series-name': q.name }), + j[p].addClass([a.classNames.series, q.className || a.classNames.series + '-' + c.alphaNumerate(p)].join(' ')); + var r = k + (l[p] / i) * 360, + s = Math.max(0, k - (0 === p || o ? 0 : 0.2)); + r - s >= 359.99 && (r = s + 359.99); + var t = c.polarToCartesian(n.x, n.y, f, s), + u = c.polarToCartesian(n.x, n.y, f, r), + v = new c.Svg.Path(!a.donut).move(u.x, u.y).arc(f, f, 0, r - k > 180, 0, t.x, t.y); + a.donut || v.line(n.x, n.y); + var w = j[p].elem('path', { d: v.stringify() }, a.donut ? a.classNames.sliceDonut : a.classNames.slicePie); + if ( + (w.attr({ 'ct:value': l[p], 'ct:meta': c.serialize(q.meta) }), + a.donut && w.attr({ style: 'stroke-width: ' + m.value + 'px' }), + this.eventEmitter.emit('draw', { + type: 'slice', + value: l[p], + totalDataSum: i, + index: p, + meta: q.meta, + series: q, + group: j[p], + element: w, + path: v.clone(), + center: n, + radius: f, + startAngle: k, + endAngle: r, + }), + a.showLabel) + ) { + var x = c.polarToCartesian(n.x, n.y, h, k + (r - k) / 2), + y = a.labelInterpolationFnc(this.data.labels && !c.isFalseyButZero(this.data.labels[p]) ? this.data.labels[p] : l[p], p); + if (y || 0 === y) { + var z = b.elem('text', { dx: x.x, dy: x.y, 'text-anchor': d(n, x, a.labelDirection) }, a.classNames.label).text('' + y); + this.eventEmitter.emit('draw', { type: 'label', index: p, group: b, element: z, text: '' + y, x: x.x, y: x.y }); + } + } + k = r; + } + this.eventEmitter.emit('created', { chartRect: e, svg: this.svg, options: a }); + } + function f(a, b, d, e) { + c.Pie['super'].constructor.call(this, a, b, g, c.extend({}, g, d), e); + } + var g = { + width: void 0, + height: void 0, + chartPadding: 5, + classNames: { + chartPie: 'ct-chart-pie', + chartDonut: 'ct-chart-donut', + series: 'ct-series', + slicePie: 'ct-slice-pie', + sliceDonut: 'ct-slice-donut', + label: 'ct-label', + }, + startAngle: 0, + total: void 0, + donut: !1, + donutWidth: 60, + showLabel: !0, + labelOffset: 0, + labelPosition: 'inside', + labelInterpolationFnc: c.noop, + labelDirection: 'neutral', + reverseData: !1, + ignoreEmptyValues: !1, + }; + c.Pie = c.Base.extend({ constructor: f, createChart: e, determineAnchorPosition: d }); + })(window, document, a), + a + ); +}); diff --git a/src/main/webapp/content/js/demo.js b/src/main/webapp/content/js/demo.js new file mode 100644 index 0000000..28c389a --- /dev/null +++ b/src/main/webapp/content/js/demo.js @@ -0,0 +1,1100 @@ +type = ['', 'info', 'success', 'warning', 'danger']; + +demo = { + initCirclePercentage: function () { + $('#chartDashboard, #chartOrders, #chartNewVisitors, #chartSubscriptions, #chartDashboardDoc, #chartOrdersDoc').easyPieChart({ + lineWidth: 6, + size: 160, + scaleColor: false, + trackColor: 'rgba(255,255,255,.25)', + barColor: '#FFFFFF', + animate: { duration: 5000, enabled: true }, + }); + }, + + initGoogleMaps: function () { + // Satellite Map + var myLatlng = new google.maps.LatLng(40.748817, -73.985428); + var mapOptions = { + zoom: 3, + scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page + center: myLatlng, + mapTypeId: google.maps.MapTypeId.SATELLITE, + }; + + var map = new google.maps.Map(document.getElementById('satelliteMap'), mapOptions); + + var marker = new google.maps.Marker({ + position: myLatlng, + title: 'Satellite Map!', + }); + + marker.setMap(map); + }, + + initSmallGoogleMaps: function () { + // Regular Map + var myLatlng = new google.maps.LatLng(40.748817, -73.985428); + var mapOptions = { + zoom: 8, + center: myLatlng, + scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page + }; + + var map = new google.maps.Map(document.getElementById('regularMap'), mapOptions); + + var marker = new google.maps.Marker({ + position: myLatlng, + title: 'Regular Map!', + }); + + marker.setMap(map); + + // Custom Skin & Settings Map + var myLatlng = new google.maps.LatLng(40.748817, -73.985428); + var mapOptions = { + zoom: 13, + center: myLatlng, + scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page + disableDefaultUI: true, // a way to quickly hide all controls + zoomControl: true, + styles: [ + { featureType: 'water', stylers: [{ saturation: 43 }, { lightness: -11 }, { hue: '#0088ff' }] }, + { featureType: 'road', elementType: 'geometry.fill', stylers: [{ hue: '#ff0000' }, { saturation: -100 }, { lightness: 99 }] }, + { featureType: 'road', elementType: 'geometry.stroke', stylers: [{ color: '#808080' }, { lightness: 54 }] }, + { featureType: 'landscape.man_made', elementType: 'geometry.fill', stylers: [{ color: '#ece2d9' }] }, + { featureType: 'poi.park', elementType: 'geometry.fill', stylers: [{ color: '#ccdca1' }] }, + { featureType: 'road', elementType: 'labels.text.fill', stylers: [{ color: '#767676' }] }, + { featureType: 'road', elementType: 'labels.text.stroke', stylers: [{ color: '#ffffff' }] }, + { featureType: 'poi', stylers: [{ visibility: 'off' }] }, + { featureType: 'landscape.natural', elementType: 'geometry.fill', stylers: [{ visibility: 'on' }, { color: '#b8cb93' }] }, + { featureType: 'poi.park', stylers: [{ visibility: 'on' }] }, + { featureType: 'poi.sports_complex', stylers: [{ visibility: 'on' }] }, + { featureType: 'poi.medical', stylers: [{ visibility: 'on' }] }, + { featureType: 'poi.business', stylers: [{ visibility: 'simplified' }] }, + ], + }; + + var map = new google.maps.Map(document.getElementById('customSkinMap'), mapOptions); + + var marker = new google.maps.Marker({ + position: myLatlng, + title: 'Custom Skin & Settings Map!', + }); + + marker.setMap(map); + }, + + initVectorMap: function () { + var mapData = { + AU: 760, + BR: 550, + CA: 120, + DE: 1300, + FR: 540, + GB: 690, + GE: 200, + IN: 200, + RO: 600, + RU: 300, + US: 2920, + }; + + $('#worldMap').vectorMap({ + map: 'world_mill_en', + backgroundColor: 'transparent', + zoomOnScroll: false, + regionStyle: { + initial: { + fill: '#e4e4e4', + 'fill-opacity': 0.9, + stroke: 'none', + 'stroke-width': 0, + 'stroke-opacity': 0, + }, + }, + + series: { + regions: [ + { + values: mapData, + scale: ['#AAAAAA', '#444444'], + normalizeFunction: 'polynomial', + }, + ], + }, + }); + }, + + initFullScreenGoogleMap: function () { + var myLatlng = new google.maps.LatLng(40.748817, -73.985428); + var mapOptions = { + zoom: 13, + center: myLatlng, + scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page + styles: [ + { featureType: 'water', stylers: [{ saturation: 43 }, { lightness: -11 }, { hue: '#0088ff' }] }, + { featureType: 'road', elementType: 'geometry.fill', stylers: [{ hue: '#ff0000' }, { saturation: -100 }, { lightness: 99 }] }, + { featureType: 'road', elementType: 'geometry.stroke', stylers: [{ color: '#808080' }, { lightness: 54 }] }, + { featureType: 'landscape.man_made', elementType: 'geometry.fill', stylers: [{ color: '#ece2d9' }] }, + { featureType: 'poi.park', elementType: 'geometry.fill', stylers: [{ color: '#ccdca1' }] }, + { featureType: 'road', elementType: 'labels.text.fill', stylers: [{ color: '#767676' }] }, + { featureType: 'road', elementType: 'labels.text.stroke', stylers: [{ color: '#ffffff' }] }, + { featureType: 'poi', stylers: [{ visibility: 'off' }] }, + { featureType: 'landscape.natural', elementType: 'geometry.fill', stylers: [{ visibility: 'on' }, { color: '#b8cb93' }] }, + { featureType: 'poi.park', stylers: [{ visibility: 'on' }] }, + { featureType: 'poi.sports_complex', stylers: [{ visibility: 'on' }] }, + { featureType: 'poi.medical', stylers: [{ visibility: 'on' }] }, + { featureType: 'poi.business', stylers: [{ visibility: 'simplified' }] }, + ], + }; + var map = new google.maps.Map(document.getElementById('map'), mapOptions); + + var marker = new google.maps.Marker({ + position: myLatlng, + title: 'Hello World!', + }); + + // To add the marker to the map, call setMap(); + marker.setMap(map); + }, + + initOverviewDashboardDoc: function () { + /* **************** Chart Total Earnings - single line ******************** */ + + var dataPrice = { + labels: ['Jan', 'Feb', 'Mar', 'April', 'May', 'June'], + series: [[230, 340, 400, 300, 570, 500, 800]], + }; + + var optionsPrice = { + showPoint: false, + lineSmooth: true, + height: '210px', + axisX: { + showGrid: false, + showLabel: true, + }, + axisY: { + offset: 40, + showGrid: false, + }, + low: 0, + high: 'auto', + classNames: { + line: 'ct-line ct-green', + }, + }; + + Chartist.Line('#chartTotalEarningsDoc', dataPrice, optionsPrice); + + /* **************** Chart Subscriptions - single line ******************** */ + + var dataDays = { + labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'], + series: [[60, 50, 30, 50, 70, 60, 90, 100]], + }; + + var optionsDays = { + showPoint: false, + lineSmooth: true, + height: '210px', + axisX: { + showGrid: false, + showLabel: true, + }, + axisY: { + offset: 40, + showGrid: false, + }, + low: 0, + high: 'auto', + classNames: { + line: 'ct-line ct-red', + }, + }; + + Chartist.Line('#chartTotalSubscriptionsDoc', dataDays, optionsDays); + }, + + initOverviewDashboard: function () { + /* **************** Chart Total Earnings - single line ******************** */ + + var dataPrice = { + labels: ['Jan', 'Feb', 'Mar', 'April', 'May', 'June'], + series: [[230, 340, 400, 300, 570, 500, 800]], + }; + + var optionsPrice = { + showPoint: false, + lineSmooth: true, + height: '210px', + axisX: { + showGrid: false, + showLabel: true, + }, + axisY: { + offset: 40, + showGrid: false, + }, + low: 0, + high: 'auto', + classNames: { + line: 'ct-line ct-green', + }, + }; + + Chartist.Line('#chartTotalEarnings', dataPrice, optionsPrice); + + /* **************** Chart Subscriptions - single line ******************** */ + + var dataDays = { + labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'], + series: [[60, 50, 30, 50, 70, 60, 90, 100]], + }; + + var optionsDays = { + showPoint: false, + lineSmooth: true, + height: '210px', + axisX: { + showGrid: false, + showLabel: true, + }, + axisY: { + offset: 40, + showGrid: false, + }, + low: 0, + high: 'auto', + classNames: { + line: 'ct-line ct-red', + }, + }; + + Chartist.Line('#chartTotalSubscriptions', dataDays, optionsDays); + + /* **************** Chart Total Downloads - single line ******************** */ + + var dataDownloads = { + labels: ['2009', '2010', '2011', '2012', '2013', '2014'], + series: [[1200, 1000, 3490, 8345, 3256, 2566]], + }; + + var optionsDownloads = { + showPoint: false, + lineSmooth: true, + height: '210px', + axisX: { + showGrid: false, + showLabel: true, + }, + axisY: { + offset: 40, + showGrid: false, + }, + low: 0, + high: 'auto', + classNames: { + line: 'ct-line ct-orange', + }, + }; + + Chartist.Line('#chartTotalDownloads', dataDownloads, optionsDownloads); + }, + + initStatsDashboard: function () { + var dataSales = { + labels: ['9:00AM', '12:00AM', '3:00PM', '6:00PM', '9:00PM', '12:00PM', '3:00AM', '6:00AM'], + series: [ + [287, 385, 490, 562, 594, 626, 698, 895, 952], + [67, 152, 193, 240, 387, 435, 535, 642, 744], + [23, 113, 67, 108, 190, 239, 307, 410, 410], + ], + }; + + var optionsSales = { + lineSmooth: false, + low: 0, + high: 1000, + showArea: true, + height: '245px', + axisX: { + showGrid: false, + }, + lineSmooth: Chartist.Interpolation.simple({ + divisor: 3, + }), + showLine: true, + showPoint: false, + }; + + var responsiveSales = [ + [ + 'screen and (max-width: 640px)', + { + axisX: { + labelInterpolationFnc: function (value) { + return value[0]; + }, + }, + }, + ], + ]; + + Chartist.Line('#chartHours', dataSales, optionsSales, responsiveSales); + + var data = { + labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + series: [ + [542, 543, 520, 680, 653, 753, 326, 434, 568, 610, 756, 895], + [230, 293, 380, 480, 503, 553, 600, 664, 698, 710, 736, 795], + ], + }; + + var options = { + seriesBarDistance: 10, + axisX: { + showGrid: false, + }, + height: '245px', + }; + + var responsiveOptions = [ + [ + 'screen and (max-width: 640px)', + { + seriesBarDistance: 5, + axisX: { + labelInterpolationFnc: function (value) { + return value[0]; + }, + }, + }, + ], + ]; + + Chartist.Line('#chartActivity', data, options, responsiveOptions); + + Chartist.Pie('#chartPreferences', { + labels: ['62%', '32%', '6%'], + series: [62, 32, 6], + }); + }, + + initChartsPage: function () { + /* **************** 24 Hours Performance - single line ******************** */ + + var dataPerformance = { + labels: ['6pm', '9pm', '11pm', '2am', '4am', '8am', '2pm', '5pm', '8pm', '11pm', '4am'], + series: [[1, 6, 8, 7, 4, 7, 8, 12, 16, 17, 14, 13]], + }; + + var optionsPerformance = { + showPoint: false, + lineSmooth: true, + height: '200px', + axisX: { + showGrid: false, + showLabel: true, + }, + axisY: { + offset: 40, + }, + low: 0, + high: 16, + height: '250px', + }; + + Chartist.Line('#chartPerformance', dataPerformance, optionsPerformance); + + /* **************** 2014 Sales - Bar Chart ******************** */ + + var data = { + labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + series: [ + [542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895], + [412, 243, 280, 580, 453, 353, 300, 364, 368, 410, 636, 695], + ], + }; + + var options = { + seriesBarDistance: 10, + axisX: { + showGrid: false, + }, + height: '250px', + }; + + var responsiveOptions = [ + [ + 'screen and (max-width: 640px)', + { + seriesBarDistance: 5, + axisX: { + labelInterpolationFnc: function (value) { + return value[0]; + }, + }, + }, + ], + ]; + + Chartist.Bar('#chartActivity', data, options, responsiveOptions); + + /* **************** NASDAQ: AAPL - single line with points ******************** */ + + var dataStock = { + labels: ["'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15"], + series: [[22.2, 34.9, 42.28, 51.93, 62.21, 80.23, 62.21, 82.12, 102.5, 107.23]], + }; + + var optionsStock = { + lineSmooth: false, + height: '200px', + axisY: { + offset: 40, + labelInterpolationFnc: function (value) { + return '$' + value; + }, + }, + low: 10, + height: '250px', + high: 110, + classNames: { + point: 'ct-point ct-green', + line: 'ct-line ct-green', + }, + }; + + Chartist.Line('#chartStock', dataStock, optionsStock); + + /* **************** Views - barchart ******************** */ + + var dataViews = { + labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + series: [[542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895]], + }; + + var optionsViews = { + seriesBarDistance: 10, + classNames: { + bar: 'ct-bar', + }, + axisX: { + showGrid: false, + }, + height: '250px', + }; + + var responsiveOptionsViews = [ + [ + 'screen and (max-width: 640px)', + { + seriesBarDistance: 5, + axisX: { + labelInterpolationFnc: function (value) { + return value[0]; + }, + }, + }, + ], + ]; + + Chartist.Bar('#chartViews', dataViews, optionsViews, responsiveOptionsViews); + }, + + showSwal: function (type) { + if (type == 'basic') { + swal({ + title: "Here's a message!", + buttonsStyling: false, + confirmButtonClass: 'btn btn-success btn-fill', + }); + } else if (type == 'title-and-text') { + swal({ + title: "Here's a message!", + text: "It's pretty, isn't it?", + buttonsStyling: false, + confirmButtonClass: 'btn btn-info btn-fill', + }); + } else if (type == 'success-message') { + swal({ + title: 'Good job!', + text: 'You clicked the button!', + buttonsStyling: false, + confirmButtonClass: 'btn btn-success btn-fill', + type: 'success', + }); + } else if (type == 'warning-message-and-confirmation') { + swal({ + title: 'Are you sure?', + text: "You won't be able to revert this!", + type: 'warning', + showCancelButton: true, + confirmButtonClass: 'btn btn-success btn-fill', + cancelButtonClass: 'btn btn-danger btn-fill', + confirmButtonText: 'Yes, delete it!', + buttonsStyling: false, + }).then(function () { + swal({ + title: 'Deleted!', + text: 'Your file has been deleted.', + type: 'success', + confirmButtonClass: 'btn btn-success btn-fill', + buttonsStyling: false, + }); + }); + } else if (type == 'warning-message-and-cancel') { + swal({ + title: 'Are you sure?', + text: 'You will not be able to recover this imaginary file!', + type: 'warning', + showCancelButton: true, + confirmButtonText: 'Yes, delete it!', + cancelButtonText: 'No, keep it', + confirmButtonClass: 'btn btn-success btn-fill', + cancelButtonClass: 'btn btn-danger btn-fill', + buttonsStyling: false, + }).then( + function () { + swal({ + title: 'Deleted!', + text: 'Your imaginary file has been deleted.', + type: 'success', + confirmButtonClass: 'btn btn-success btn-fill', + buttonsStyling: false, + }); + }, + function (dismiss) { + // dismiss can be 'overlay', 'cancel', 'close', 'esc', 'timer' + if (dismiss === 'cancel') { + swal({ + title: 'Cancelled', + text: 'Your imaginary file is safe :)', + type: 'error', + confirmButtonClass: 'btn btn-info btn-fill', + buttonsStyling: false, + }); + } + } + ); + } else if (type == 'custom-html') { + swal({ + title: 'HTML example', + buttonsStyling: false, + confirmButtonClass: 'btn btn-success btn-fill', + html: 'You can use bold text, ' + 'links ' + 'and other HTML tags', + }); + } else if (type == 'auto-close') { + swal({ title: 'Auto close alert!', text: 'I will close in 2 seconds.', timer: 2000, showConfirmButton: false }); + } else if (type == 'input-field') { + swal({ + title: 'Input something', + html: '
' + '' + '
', + showCancelButton: true, + confirmButtonClass: 'btn btn-success btn-fill', + cancelButtonClass: 'btn btn-danger btn-fill', + buttonsStyling: false, + }) + .then(function (result) { + swal({ + type: 'success', + html: 'You entered: ' + $('#input-field').val() + '', + confirmButtonClass: 'btn btn-success btn-fill', + buttonsStyling: false, + }); + }) + .catch(swal.noop); + } + }, + + checkFullPageBackgroundImage: function () { + $page = $('.full-page'); + image_src = $page.data('image'); + + if (image_src !== undefined) { + image_container = '
'; + $page.append(image_container); + } + }, + + initWizard: function () { + $(document).ready(function () { + var $validator = $('#wizardForm').validate({ + rules: { + email: { + required: true, + email: true, + minlength: 5, + }, + first_name: { + required: false, + minlength: 5, + }, + last_name: { + required: false, + minlength: 5, + }, + website: { + required: true, + minlength: 5, + url: true, + }, + framework: { + required: false, + minlength: 4, + }, + cities: { + required: true, + }, + price: { + number: true, + }, + }, + }); + + // you can also use the nav-pills-[blue | azure | green | orange | red] for a different color of wizard + $('#wizardCard').bootstrapWizard({ + tabClass: 'nav nav-pills', + nextSelector: '.btn-next', + previousSelector: '.btn-back', + onNext: function (tab, navigation, index) { + var $valid = $('#wizardForm').valid(); + + if (!$valid) { + $validator.focusInvalid(); + return false; + } + }, + onInit: function (tab, navigation, index) { + //check number of tabs and fill the entire row + var $total = navigation.find('li').length; + $width = 100 / $total; + + $display_width = $(document).width(); + + if ($display_width < 600 && $total > 3) { + $width = 50; + } + + navigation.find('li').css('width', $width + '%'); + }, + onTabClick: function (tab, navigation, index) { + // Disable the posibility to click on tabs + return false; + }, + onTabShow: function (tab, navigation, index) { + var $total = navigation.find('li').length; + var $current = index + 1; + + var wizard = navigation.closest('.card-wizard'); + + // If it's the last tab then hide the last button and show the finish instead + if ($current >= $total) { + $(wizard).find('.btn-next').hide(); + $(wizard).find('.btn-finish').show(); + } else if ($current == 1) { + $(wizard).find('.btn-back').hide(); + } else { + $(wizard).find('.btn-back').show(); + $(wizard).find('.btn-next').show(); + $(wizard).find('.btn-finish').hide(); + } + }, + }); + }); + + function onFinishWizard() { + //here you can do something, sent the form to server via ajax and show a success message with swal + + swal('Good job!', 'You clicked the finish button!', 'success'); + } + }, + + initFormExtendedSliders: function () { + // Sliders for demo purpose in refine cards section + var slider = document.getElementById('sliderRegular'); + + noUiSlider.create(slider, { + start: 40, + connect: [true, false], + range: { + min: 0, + max: 100, + }, + }); + + var slider2 = document.getElementById('sliderDouble'); + + noUiSlider.create(slider2, { + start: [20, 60], + connect: true, + range: { + min: 0, + max: 100, + }, + }); + }, + + initFormExtendedDatetimepickers: function () { + $('.datetimepicker').datetimepicker({ + icons: { + time: 'fa fa-clock-o', + date: 'fa fa-calendar', + up: 'fa fa-chevron-up', + down: 'fa fa-chevron-down', + previous: 'fa fa-chevron-left', + next: 'fa fa-chevron-right', + today: 'fa fa-screenshot', + clear: 'fa fa-trash', + close: 'fa fa-remove', + }, + }); + + $('.datepicker').datetimepicker({ + format: 'MM/DD/YYYY', //use this format if you want the 12hours timpiecker with AM/PM toggle + icons: { + time: 'fa fa-clock-o', + date: 'fa fa-calendar', + up: 'fa fa-chevron-up', + down: 'fa fa-chevron-down', + previous: 'fa fa-chevron-left', + next: 'fa fa-chevron-right', + today: 'fa fa-screenshot', + clear: 'fa fa-trash', + close: 'fa fa-remove', + }, + }); + + $('.timepicker').datetimepicker({ + // format: 'H:mm', // use this format if you want the 24hours timepicker + format: 'h:mm A', //use this format if you want the 12hours timpiecker with AM/PM toggle + icons: { + time: 'fa fa-clock-o', + date: 'fa fa-calendar', + up: 'fa fa-chevron-up', + down: 'fa fa-chevron-down', + previous: 'fa fa-chevron-left', + next: 'fa fa-chevron-right', + today: 'fa fa-screenshot', + clear: 'fa fa-trash', + close: 'fa fa-remove', + }, + }); + }, + + initFullCalendar: function () { + $calendar = $('#fullCalendar'); + + today = new Date(); + y = today.getFullYear(); + m = today.getMonth(); + d = today.getDate(); + + $calendar.fullCalendar({ + viewRender: function (view, element) { + // We make sure that we activate the perfect scrollbar when the view isn't on Month + if (view.name != 'month') { + $(element).find('.fc-scroller').perfectScrollbar(); + } + }, + header: { + left: 'title', + center: 'month,agendaWeek,agendaDay', + right: 'prev,next,today', + }, + defaultDate: today, + selectable: true, + selectHelper: true, + views: { + month: { + // name of view + titleFormat: 'MMMM YYYY', + // other view-specific options here + }, + week: { + titleFormat: ' MMMM D YYYY', + }, + day: { + titleFormat: 'D MMM, YYYY', + }, + }, + + select: function (start, end) { + // on select we show the Sweet Alert modal with an input + swal({ + title: 'Create an Event', + html: '
' + '' + '
', + showCancelButton: true, + confirmButtonClass: 'btn btn-success', + cancelButtonClass: 'btn btn-danger', + buttonsStyling: false, + }).then(function (result) { + var eventData; + event_title = $('#input-field').val(); + + if (event_title) { + eventData = { + title: event_title, + start: start, + end: end, + }; + $calendar.fullCalendar('renderEvent', eventData, true); // stick? = true + } + + $calendar.fullCalendar('unselect'); + }); + }, + editable: true, + eventLimit: true, // allow "more" link when too many events + + // color classes: [ event-blue | event-azure | event-green | event-orange | event-red ] + events: [ + { + title: 'All Day Event', + start: new Date(y, m, 1), + className: 'event-default', + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d - 4, 6, 0), + allDay: false, + className: 'event-rose', + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d + 3, 6, 0), + allDay: false, + className: 'event-rose', + }, + { + title: 'Meeting', + start: new Date(y, m, d - 1, 10, 30), + allDay: false, + className: 'event-green', + }, + { + title: 'Lunch', + start: new Date(y, m, d + 7, 12, 0), + end: new Date(y, m, d + 7, 14, 0), + allDay: false, + className: 'event-red', + }, + { + title: 'Md-pro Launch', + start: new Date(y, m, d - 2, 12, 0), + allDay: true, + className: 'event-azure', + }, + { + title: 'Birthday Party', + start: new Date(y, m, d + 1, 19, 0), + end: new Date(y, m, d + 1, 22, 30), + allDay: false, + className: 'event-azure', + }, + { + title: 'Click for Creative Tim', + start: new Date(y, m, 21), + end: new Date(y, m, 22), + url: 'http://www.creative-tim.com/', + className: 'event-orange', + }, + { + title: 'Click for Google', + start: new Date(y, m, 21), + end: new Date(y, m, 22), + url: 'http://www.creative-tim.com/', + className: 'event-orange', + }, + ], + }); + }, + + showNotification: function (from, align) { + color = Math.floor(Math.random() * 4 + 1); + + $.notify( + { + icon: 'ti-gift', + message: 'Welcome to Paper Dashboard - a beautiful dashboard for every web developer.', + }, + { + type: type[color], + timer: 4000, + placement: { + from: from, + align: align, + }, + } + ); + }, + + initDocumentationCharts: function () { + // init single simple line chart + var dataPerformance = { + labels: ['6pm', '9pm', '11pm', '2am', '4am', '8am', '2pm', '5pm', '8pm', '11pm', '4am'], + series: [[1, 6, 8, 7, 4, 7, 8, 12, 16, 17, 14, 13]], + }; + + var optionsPerformance = { + showPoint: false, + lineSmooth: true, + height: '200px', + axisX: { + showGrid: false, + showLabel: true, + }, + axisY: { + offset: 40, + }, + low: 0, + high: 16, + height: '250px', + }; + + Chartist.Line('#chartPerformance', dataPerformance, optionsPerformance); + + // init single line with points chart + var dataStock = { + labels: ["'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15"], + series: [[22.2, 34.9, 42.28, 51.93, 62.21, 80.23, 62.21, 82.12, 102.5, 107.23]], + }; + + var optionsStock = { + lineSmooth: false, + height: '200px', + axisY: { + offset: 40, + labelInterpolationFnc: function (value) { + return '$' + value; + }, + }, + low: 10, + height: '250px', + high: 110, + classNames: { + point: 'ct-point ct-green', + line: 'ct-line ct-green', + }, + }; + + Chartist.Line('#chartStock', dataStock, optionsStock); + + // init multiple lines chart + var dataSales = { + labels: ['9:00AM', '12:00AM', '3:00PM', '6:00PM', '9:00PM', '12:00PM', '3:00AM', '6:00AM'], + series: [ + [287, 385, 490, 562, 594, 626, 698, 895, 952], + [67, 152, 193, 240, 387, 435, 535, 642, 744], + [23, 113, 67, 108, 190, 239, 307, 410, 410], + ], + }; + + var optionsSales = { + lineSmooth: false, + low: 0, + high: 1000, + showArea: true, + height: '245px', + axisX: { + showGrid: false, + }, + lineSmooth: Chartist.Interpolation.simple({ + divisor: 3, + }), + showLine: true, + showPoint: false, + }; + + var responsiveSales = [ + [ + 'screen and (max-width: 640px)', + { + axisX: { + labelInterpolationFnc: function (value) { + return value[0]; + }, + }, + }, + ], + ]; + + Chartist.Line('#chartHours', dataSales, optionsSales, responsiveSales); + + // pie chart + Chartist.Pie('#chartPreferences', { + labels: ['62%', '32%', '6%'], + series: [62, 32, 6], + }); + + // bar chart + var dataViews = { + labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + series: [[542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895]], + }; + + var optionsViews = { + seriesBarDistance: 10, + classNames: { + bar: 'ct-bar', + }, + axisX: { + showGrid: false, + }, + height: '250px', + }; + + var responsiveOptionsViews = [ + [ + 'screen and (max-width: 640px)', + { + seriesBarDistance: 5, + axisX: { + labelInterpolationFnc: function (value) { + return value[0]; + }, + }, + }, + ], + ]; + + Chartist.Bar('#chartViews', dataViews, optionsViews, responsiveOptionsViews); + + // multiple bars chart + var data = { + labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + series: [ + [542, 543, 520, 680, 653, 753, 326, 434, 568, 610, 756, 895], + [230, 293, 380, 480, 503, 553, 600, 664, 698, 710, 736, 795], + ], + }; + + var options = { + seriesBarDistance: 10, + axisX: { + showGrid: false, + }, + height: '245px', + }; + + var responsiveOptions = [ + [ + 'screen and (max-width: 640px)', + { + seriesBarDistance: 5, + axisX: { + labelInterpolationFnc: function (value) { + return value[0]; + }, + }, + }, + ], + ]; + + Chartist.Line('#chartActivity', data, options, responsiveOptions); + }, +}; diff --git a/src/main/webapp/content/js/es6-promise-auto.min.js b/src/main/webapp/content/js/es6-promise-auto.min.js new file mode 100644 index 0000000..8bc4cef --- /dev/null +++ b/src/main/webapp/content/js/es6-promise-auto.min.js @@ -0,0 +1,389 @@ +!(function (t, e) { + 'object' == typeof exports && 'undefined' != typeof module + ? (module.exports = e()) + : 'function' == typeof define && define.amd + ? define(e) + : (t.ES6Promise = e()); +})(this, function () { + 'use strict'; + function t(t) { + return 'function' == typeof t || ('object' == typeof t && null !== t); + } + function e(t) { + return 'function' == typeof t; + } + function n(t) { + I = t; + } + function r(t) { + J = t; + } + function o() { + return function () { + return process.nextTick(a); + }; + } + function i() { + return 'undefined' != typeof H + ? function () { + H(a); + } + : c(); + } + function s() { + var t = 0, + e = new V(a), + n = document.createTextNode(''); + return ( + e.observe(n, { characterData: !0 }), + function () { + n.data = t = ++t % 2; + } + ); + } + function u() { + var t = new MessageChannel(); + return ( + (t.port1.onmessage = a), + function () { + return t.port2.postMessage(0); + } + ); + } + function c() { + var t = setTimeout; + return function () { + return t(a, 1); + }; + } + function a() { + for (var t = 0; t < G; t += 2) { + var e = $[t], + n = $[t + 1]; + e(n), ($[t] = void 0), ($[t + 1] = void 0); + } + G = 0; + } + function f() { + try { + var t = require, + e = t('vertx'); + return (H = e.runOnLoop || e.runOnContext), i(); + } catch (n) { + return c(); + } + } + function l(t, e) { + var n = arguments, + r = this, + o = new this.constructor(p); + void 0 === o[et] && k(o); + var i = r._state; + return ( + i + ? !(function () { + var t = n[i - 1]; + J(function () { + return x(i, o, t, r._result); + }); + })() + : E(r, o, t, e), + o + ); + } + function h(t) { + var e = this; + if (t && 'object' == typeof t && t.constructor === e) return t; + var n = new e(p); + return g(n, t), n; + } + function p() {} + function v() { + return new TypeError('You cannot resolve a promise with itself'); + } + function d() { + return new TypeError('A promises callback cannot return that same promise.'); + } + function _(t) { + try { + return t.then; + } catch (e) { + return (it.error = e), it; + } + } + function y(t, e, n, r) { + try { + t.call(e, n, r); + } catch (o) { + return o; + } + } + function m(t, e, n) { + J(function (t) { + var r = !1, + o = y( + n, + e, + function (n) { + r || ((r = !0), e !== n ? g(t, n) : S(t, n)); + }, + function (e) { + r || ((r = !0), j(t, e)); + }, + 'Settle: ' + (t._label || ' unknown promise') + ); + !r && o && ((r = !0), j(t, o)); + }, t); + } + function b(t, e) { + e._state === rt + ? S(t, e._result) + : e._state === ot + ? j(t, e._result) + : E( + e, + void 0, + function (e) { + return g(t, e); + }, + function (e) { + return j(t, e); + } + ); + } + function w(t, n, r) { + n.constructor === t.constructor && r === l && n.constructor.resolve === h + ? b(t, n) + : r === it + ? j(t, it.error) + : void 0 === r + ? S(t, n) + : e(r) + ? m(t, n, r) + : S(t, n); + } + function g(e, n) { + e === n ? j(e, v()) : t(n) ? w(e, n, _(n)) : S(e, n); + } + function A(t) { + t._onerror && t._onerror(t._result), P(t); + } + function S(t, e) { + t._state === nt && ((t._result = e), (t._state = rt), 0 !== t._subscribers.length && J(P, t)); + } + function j(t, e) { + t._state === nt && ((t._state = ot), (t._result = e), J(A, t)); + } + function E(t, e, n, r) { + var o = t._subscribers, + i = o.length; + (t._onerror = null), (o[i] = e), (o[i + rt] = n), (o[i + ot] = r), 0 === i && t._state && J(P, t); + } + function P(t) { + var e = t._subscribers, + n = t._state; + if (0 !== e.length) { + for (var r = void 0, o = void 0, i = t._result, s = 0; s < e.length; s += 3) (r = e[s]), (o = e[s + n]), r ? x(n, r, o, i) : o(i); + t._subscribers.length = 0; + } + } + function T() { + this.error = null; + } + function M(t, e) { + try { + return t(e); + } catch (n) { + return (st.error = n), st; + } + } + function x(t, n, r, o) { + var i = e(r), + s = void 0, + u = void 0, + c = void 0, + a = void 0; + if (i) { + if (((s = M(r, o)), s === st ? ((a = !0), (u = s.error), (s = null)) : (c = !0), n === s)) return void j(n, d()); + } else (s = o), (c = !0); + n._state !== nt || (i && c ? g(n, s) : a ? j(n, u) : t === rt ? S(n, s) : t === ot && j(n, s)); + } + function C(t, e) { + try { + e( + function (e) { + g(t, e); + }, + function (e) { + j(t, e); + } + ); + } catch (n) { + j(t, n); + } + } + function O() { + return ut++; + } + function k(t) { + (t[et] = ut++), (t._state = void 0), (t._result = void 0), (t._subscribers = []); + } + function Y(t, e) { + (this._instanceConstructor = t), + (this.promise = new t(p)), + this.promise[et] || k(this.promise), + B(e) + ? ((this._input = e), + (this.length = e.length), + (this._remaining = e.length), + (this._result = new Array(this.length)), + 0 === this.length + ? S(this.promise, this._result) + : ((this.length = this.length || 0), this._enumerate(), 0 === this._remaining && S(this.promise, this._result))) + : j(this.promise, q()); + } + function q() { + return new Error('Array Methods must be provided an Array'); + } + function F(t) { + return new Y(this, t).promise; + } + function D(t) { + var e = this; + return new e( + B(t) + ? function (n, r) { + for (var o = t.length, i = 0; i < o; i++) e.resolve(t[i]).then(n, r); + } + : function (t, e) { + return e(new TypeError('You must pass an array to race.')); + } + ); + } + function K(t) { + var e = this, + n = new e(p); + return j(n, t), n; + } + function L() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } + function N() { + throw new TypeError( + "Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function." + ); + } + function U(t) { + (this[et] = O()), + (this._result = this._state = void 0), + (this._subscribers = []), + p !== t && ('function' != typeof t && L(), this instanceof U ? C(this, t) : N()); + } + function W() { + var t = void 0; + if ('undefined' != typeof global) t = global; + else if ('undefined' != typeof self) t = self; + else + try { + t = Function('return this')(); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + var n = t.Promise; + if (n) { + var r = null; + try { + r = Object.prototype.toString.call(n.resolve()); + } catch (e) {} + if ('[object Promise]' === r && !n.cast) return; + } + t.Promise = U; + } + var z = void 0; + z = Array.isArray + ? Array.isArray + : function (t) { + return '[object Array]' === Object.prototype.toString.call(t); + }; + var B = z, + G = 0, + H = void 0, + I = void 0, + J = function (t, e) { + ($[G] = t), ($[G + 1] = e), (G += 2), 2 === G && (I ? I(a) : tt()); + }, + Q = 'undefined' != typeof window ? window : void 0, + R = Q || {}, + V = R.MutationObserver || R.WebKitMutationObserver, + X = 'undefined' == typeof self && 'undefined' != typeof process && '[object process]' === {}.toString.call(process), + Z = 'undefined' != typeof Uint8ClampedArray && 'undefined' != typeof importScripts && 'undefined' != typeof MessageChannel, + $ = new Array(1e3), + tt = void 0; + tt = X ? o() : V ? s() : Z ? u() : void 0 === Q && 'function' == typeof require ? f() : c(); + var et = Math.random().toString(36).substring(16), + nt = void 0, + rt = 1, + ot = 2, + it = new T(), + st = new T(), + ut = 0; + return ( + (Y.prototype._enumerate = function () { + for (var t = this.length, e = this._input, n = 0; this._state === nt && n < t; n++) this._eachEntry(e[n], n); + }), + (Y.prototype._eachEntry = function (t, e) { + var n = this._instanceConstructor, + r = n.resolve; + if (r === h) { + var o = _(t); + if (o === l && t._state !== nt) this._settledAt(t._state, e, t._result); + else if ('function' != typeof o) this._remaining--, (this._result[e] = t); + else if (n === U) { + var i = new n(p); + w(i, t, o), this._willSettleAt(i, e); + } else + this._willSettleAt( + new n(function (e) { + return e(t); + }), + e + ); + } else this._willSettleAt(r(t), e); + }), + (Y.prototype._settledAt = function (t, e, n) { + var r = this.promise; + r._state === nt && (this._remaining--, t === ot ? j(r, n) : (this._result[e] = n)), 0 === this._remaining && S(r, this._result); + }), + (Y.prototype._willSettleAt = function (t, e) { + var n = this; + E( + t, + void 0, + function (t) { + return n._settledAt(rt, e, t); + }, + function (t) { + return n._settledAt(ot, e, t); + } + ); + }), + (U.all = F), + (U.race = D), + (U.resolve = h), + (U.reject = K), + (U._setScheduler = n), + (U._setAsap = r), + (U._asap = J), + (U.prototype = { + constructor: U, + then: l, + catch: function (t) { + return this.then(null, t); + }, + }), + (U.polyfill = W), + (U.Promise = U), + U + ); +}), + ES6Promise.polyfill(); diff --git a/src/main/webapp/content/js/fullcalendar.min.js b/src/main/webapp/content/js/fullcalendar.min.js new file mode 100644 index 0000000..9dda3e8 --- /dev/null +++ b/src/main/webapp/content/js/fullcalendar.min.js @@ -0,0 +1,5687 @@ +/*! + * FullCalendar v3.1.0 + * Docs & License: http://fullcalendar.io/ + * (c) 2016 Adam Shaw + */ +!(function (t) { + 'function' == typeof define && define.amd + ? define(['jquery', 'moment'], t) + : 'object' == typeof exports + ? (module.exports = t(require('jquery'), require('moment'))) + : t(jQuery, moment); +})(function (t, e) { + function n(t) { + return q(t, $t); + } + function i(t, e) { + e.left && t.css({ 'border-left-width': 1, 'margin-left': e.left - 1 }), + e.right && t.css({ 'border-right-width': 1, 'margin-right': e.right - 1 }); + } + function r(t) { + t.css({ 'margin-left': '', 'margin-right': '', 'border-left-width': '', 'border-right-width': '' }); + } + function s() { + t('body').addClass('fc-not-allowed'); + } + function o() { + t('body').removeClass('fc-not-allowed'); + } + function l(e, n, i) { + var r = Math.floor(n / e.length), + s = Math.floor(n - r * (e.length - 1)), + o = [], + l = [], + u = [], + c = 0; + a(e), + e.each(function (n, i) { + var a = n === e.length - 1 ? s : r, + d = t(i).outerHeight(!0); + d < a ? (o.push(i), l.push(d), u.push(t(i).height())) : (c += d); + }), + i && ((n -= c), (r = Math.floor(n / o.length)), (s = Math.floor(n - r * (o.length - 1)))), + t(o).each(function (e, n) { + var i = e === o.length - 1 ? s : r, + a = l[e], + c = u[e], + d = i - (a - c); + a < i && t(n).height(d); + }); + } + function a(t) { + t.height(''); + } + function u(e) { + var n = 0; + return ( + e.find('> *').each(function (e, i) { + var r = t(i).outerWidth(); + r > n && (n = r); + }), + n++, + e.width(n), + n + ); + } + function c(t, e) { + var n, + i = t.add(e); + return i.css({ position: 'relative', left: -1 }), (n = t.outerHeight() - e.outerHeight()), i.css({ position: '', left: '' }), n; + } + function d(e) { + var n = e.css('position'), + i = e + .parents() + .filter(function () { + var e = t(this); + return /(auto|scroll)/.test(e.css('overflow') + e.css('overflow-y') + e.css('overflow-x')); + }) + .eq(0); + return 'fixed' !== n && i.length ? i : t(e[0].ownerDocument || document); + } + function h(t, e) { + var n = t.offset(), + i = n.left - (e ? e.left : 0), + r = n.top - (e ? e.top : 0); + return { left: i, right: i + t.outerWidth(), top: r, bottom: r + t.outerHeight() }; + } + function f(t, e) { + var n = t.offset(), + i = p(t), + r = n.left + y(t, 'border-left-width') + i.left - (e ? e.left : 0), + s = n.top + y(t, 'border-top-width') + i.top - (e ? e.top : 0); + return { left: r, right: r + t[0].clientWidth, top: s, bottom: s + t[0].clientHeight }; + } + function g(t, e) { + var n = t.offset(), + i = n.left + y(t, 'border-left-width') + y(t, 'padding-left') - (e ? e.left : 0), + r = n.top + y(t, 'border-top-width') + y(t, 'padding-top') - (e ? e.top : 0); + return { left: i, right: i + t.width(), top: r, bottom: r + t.height() }; + } + function p(t) { + var e = t.innerWidth() - t[0].clientWidth, + n = { left: 0, right: 0, top: 0, bottom: t.innerHeight() - t[0].clientHeight }; + return v() && 'rtl' == t.css('direction') ? (n.left = e) : (n.right = e), n; + } + function v() { + return null === Qt && (Qt = m()), Qt; + } + function m() { + var e = t('
') + .css({ position: 'absolute', top: -1e3, left: 0, border: 0, padding: 0, overflow: 'scroll', direction: 'rtl' }) + .appendTo('body'), + n = e.children(), + i = n.offset().left > e.offset().left; + return e.remove(), i; + } + function y(t, e) { + return parseFloat(t.css(e)) || 0; + } + function S(t) { + return 1 == t.which && !t.ctrlKey; + } + function w(t) { + if (void 0 !== t.pageX) return t.pageX; + var e = t.originalEvent.touches; + return e ? e[0].pageX : void 0; + } + function E(t) { + if (void 0 !== t.pageY) return t.pageY; + var e = t.originalEvent.touches; + return e ? e[0].pageY : void 0; + } + function b(t) { + return /^touch/.test(t.type); + } + function D(t) { + t.addClass('fc-unselectable').on('selectstart', T); + } + function T(t) { + t.preventDefault(); + } + function C(t) { + return !!window.addEventListener && (window.addEventListener('scroll', t, !0), !0); + } + function H(t) { + return !!window.removeEventListener && (window.removeEventListener('scroll', t, !0), !0); + } + function R(t, e) { + var n = { + left: Math.max(t.left, e.left), + right: Math.min(t.right, e.right), + top: Math.max(t.top, e.top), + bottom: Math.min(t.bottom, e.bottom), + }; + return n.left < n.right && n.top < n.bottom && n; + } + function x(t, e) { + return { left: Math.min(Math.max(t.left, e.left), e.right), top: Math.min(Math.max(t.top, e.top), e.bottom) }; + } + function I(t) { + return { left: (t.left + t.right) / 2, top: (t.top + t.bottom) / 2 }; + } + function k(t, e) { + return { left: t.left - e.left, top: t.top - e.top }; + } + function L(e) { + var n, + i, + r = [], + s = []; + for ( + 'string' == typeof e ? (s = e.split(/\s*,\s*/)) : 'function' == typeof e ? (s = [e]) : t.isArray(e) && (s = e), n = 0; + n < s.length; + n++ + ) + (i = s[n]), + 'string' == typeof i + ? r.push('-' == i.charAt(0) ? { field: i.substring(1), order: -1 } : { field: i, order: 1 }) + : 'function' == typeof i && r.push({ func: i }); + return r; + } + function M(t, e, n) { + var i, r; + for (i = 0; i < n.length; i++) if ((r = B(t, e, n[i]))) return r; + return 0; + } + function B(t, e, n) { + return n.func ? n.func(t, e) : z(t[n.field], e[n.field]) * (n.order || 1); + } + function z(e, n) { + return e || n + ? null == n + ? -1 + : null == e + ? 1 + : 'string' === t.type(e) || 'string' === t.type(n) + ? String(e).localeCompare(String(n)) + : e - n + : 0; + } + function F(t, e) { + var n, + i, + r, + s, + o = t.start, + l = t.end, + a = e.start, + u = e.end; + if (l > a && o < u) + return ( + o >= a ? ((n = o.clone()), (r = !0)) : ((n = a.clone()), (r = !1)), + l <= u ? ((i = l.clone()), (s = !0)) : ((i = u.clone()), (s = !1)), + { start: n, end: i, isStart: r, isEnd: s } + ); + } + function N(t, n) { + return e.duration({ days: t.clone().stripTime().diff(n.clone().stripTime(), 'days'), ms: t.time() - n.time() }); + } + function G(t, n) { + return e.duration({ days: t.clone().stripTime().diff(n.clone().stripTime(), 'days') }); + } + function O(t, n, i) { + return e.duration(Math.round(t.diff(n, i, !0)), i); + } + function A(t, e) { + var n, i, r; + for (n = 0; n < Kt.length && ((i = Kt[n]), (r = V(i, t, e)), !(r >= 1 && ot(r))); n++); + return i; + } + function V(t, n, i) { + return null != i ? i.diff(n, t, !0) : e.isDuration(n) ? n.as(t) : n.end.diff(n.start, t, !0); + } + function P(t, e, n) { + var i; + return W(n) + ? (e - t) / n + : ((i = n.asMonths()), Math.abs(i) >= 1 && ot(i) ? e.diff(t, 'months', !0) / i : e.diff(t, 'days', !0) / n.asDays()); + } + function _(t, e) { + var n, i; + return W(t) || W(e) + ? t / e + : ((n = t.asMonths()), (i = e.asMonths()), Math.abs(n) >= 1 && ot(n) && Math.abs(i) >= 1 && ot(i) ? n / i : t.asDays() / e.asDays()); + } + function Y(t, n) { + var i; + return W(t) + ? e.duration(t * n) + : ((i = t.asMonths()), Math.abs(i) >= 1 && ot(i) ? e.duration({ months: i * n }) : e.duration({ days: t.asDays() * n })); + } + function W(t) { + return Boolean(t.hours() || t.minutes() || t.seconds() || t.milliseconds()); + } + function U(t) { + return '[object Date]' === Object.prototype.toString.call(t) || t instanceof Date; + } + function j(t) { + return /^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(t); + } + function q(t, e) { + var n, + i, + r, + s, + o, + l, + a = {}; + if (e) + for (n = 0; n < e.length; n++) { + for (i = e[n], r = [], s = t.length - 1; s >= 0; s--) + if (((o = t[s][i]), 'object' == typeof o)) r.unshift(o); + else if (void 0 !== o) { + a[i] = o; + break; + } + r.length && (a[i] = q(r)); + } + for (n = t.length - 1; n >= 0; n--) { + l = t[n]; + for (i in l) i in a || (a[i] = l[i]); + } + return a; + } + function Z(t) { + var e = function () {}; + return (e.prototype = t), new e(); + } + function $(t, e) { + for (var n in t) Q(t, n) && (e[n] = t[n]); + } + function Q(t, e) { + return Jt.call(t, e); + } + function X(e) { + return /undefined|null|boolean|number|string/.test(t.type(e)); + } + function K(e, n, i) { + if ((t.isFunction(e) && (e = [e]), e)) { + var r, s; + for (r = 0; r < e.length; r++) s = e[r].apply(n, i) || s; + return s; + } + } + function J() { + for (var t = 0; t < arguments.length; t++) if (void 0 !== arguments[t]) return arguments[t]; + } + function tt(t) { + return (t + '') + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/'/g, ''') + .replace(/"/g, '"') + .replace(/\n/g, '
'); + } + function et(t) { + return t.replace(/&.*?;/g, ''); + } + function nt(e) { + var n = []; + return ( + t.each(e, function (t, e) { + null != e && n.push(t + ':' + e); + }), + n.join(';') + ); + } + function it(e) { + var n = []; + return ( + t.each(e, function (t, e) { + null != e && n.push(t + '="' + tt(e) + '"'); + }), + n.join(' ') + ); + } + function rt(t) { + return t.charAt(0).toUpperCase() + t.slice(1); + } + function st(t, e) { + return t - e; + } + function ot(t) { + return t % 1 === 0; + } + function lt(t, e) { + var n = t[e]; + return function () { + return n.apply(t, arguments); + }; + } + function at(t, e, n) { + var i, + r, + s, + o, + l, + a = function () { + var u = +new Date() - o; + u < e ? (i = setTimeout(a, e - u)) : ((i = null), n || ((l = t.apply(s, r)), (s = r = null))); + }; + return function () { + (s = this), (r = arguments), (o = +new Date()); + var u = n && !i; + return i || (i = setTimeout(a, e)), u && ((l = t.apply(s, r)), (s = r = null)), l; + }; + } + function ut(n, i, r) { + var s, + o, + l, + a, + u = n[0], + c = 1 == n.length && 'string' == typeof u; + return ( + e.isMoment(u) || U(u) || void 0 === u + ? (a = e.apply(null, n)) + : ((s = !1), + (o = !1), + c + ? te.test(u) + ? ((u += '-01'), (n = [u]), (s = !0), (o = !0)) + : (l = ee.exec(u)) && ((s = !l[5]), (o = !0)) + : t.isArray(u) && (o = !0), + (a = i || s ? e.utc.apply(e, n) : e.apply(null, n)), + s ? ((a._ambigTime = !0), (a._ambigZone = !0)) : r && (o ? (a._ambigZone = !0) : c && a.utcOffset(u))), + (a._fullCalendar = !0), + a + ); + } + function ct(t, e) { + return ie.format.call(t, e); + } + function dt(t, e) { + return ht(t, mt(e)); + } + function ht(t, e) { + var n, + i = ''; + for (n = 0; n < e.length; n++) i += ft(t, e[n]); + return i; + } + function ft(t, e) { + var n, i; + return 'string' == typeof e + ? e + : (n = e.token) + ? se[n] + ? se[n](t) + : ct(t, n) + : e.maybe && ((i = ht(t, e.maybe)), i.match(/[1-9]/)) + ? i + : ''; + } + function gt(t, e, n, i, r) { + var s; + return ( + (t = qt.moment.parseZone(t)), + (e = qt.moment.parseZone(e)), + (s = t.localeData()), + (n = s.longDateFormat(n) || n), + (i = i || ' - '), + pt(t, e, mt(n), i, r) + ); + } + function pt(t, e, n, i, r) { + var s, + o, + l, + a, + u = t.clone().stripZone(), + c = e.clone().stripZone(), + d = '', + h = '', + f = '', + g = '', + p = ''; + for (o = 0; o < n.length && ((s = vt(t, e, u, c, n[o])), s !== !1); o++) d += s; + for (l = n.length - 1; l > o && ((s = vt(t, e, u, c, n[l])), s !== !1); l--) h = s + h; + for (a = o; a <= l; a++) (f += ft(t, n[a])), (g += ft(e, n[a])); + return (f || g) && (p = r ? g + i + f : f + i + g), d + p + h; + } + function vt(t, e, n, i, r) { + var s, o; + return 'string' == typeof r ? r : !!((s = r.token) && ((o = oe[s.charAt(0)]), o && n.isSame(i, o))) && ct(t, s); + } + function mt(t) { + return t in le ? le[t] : (le[t] = yt(t)); + } + function yt(t) { + for (var e, n = [], i = /\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g; (e = i.exec(t)); ) + e[1] ? n.push(e[1]) : e[2] ? n.push({ maybe: yt(e[2]) }) : e[3] ? n.push({ token: e[3] }) : e[5] && n.push(e[5]); + return n; + } + function St() {} + function wt(t, e) { + var n; + return ( + Q(e, 'constructor') && (n = e.constructor), + 'function' != typeof n && + (n = e.constructor = + function () { + t.apply(this, arguments); + }), + (n.prototype = Z(t.prototype)), + $(e, n.prototype), + $(t, n), + n + ); + } + function Et(t, e) { + $(e, t.prototype); + } + function bt(e) { + var n = t.Deferred(), + i = n.promise(); + if ( + ('function' == typeof e && + e( + function (t) { + bt.immediate && (i._value = t), n.resolve(t); + }, + function () { + n.reject(); + } + ), + bt.immediate) + ) { + var r = i.then; + i.then = function (t, e) { + var n = i.state(); + if ('resolved' === n) { + if ('function' == typeof t) return bt.resolve(t(i._value)); + } else if ('rejected' === n && 'function' == typeof e) return e(), i; + return r.call(i, t, e); + }; + } + return i; + } + function Dt(t) { + function e(t) { + return new bt(function (e) { + var i = function () { + bt.resolve(t()) + .then(e) + .then(function () { + n.shift(), n.length && n[0](); + }); + }; + n.push(i), 1 === n.length && i(); + }); + } + var n = []; + (this.add = 'number' == typeof t ? at(e, t) : e), (this.addQuickly = e); + } + function Tt(t, e) { + return (!t && !e) || (!(!t || !e) && t.component === e.component && Ct(t, e) && Ct(e, t)); + } + function Ct(t, e) { + for (var n in t) if (!/^(component|left|right|top|bottom)$/.test(n) && t[n] !== e[n]) return !1; + return !0; + } + function Ht(t) { + return { start: t.start.clone(), end: t.end ? t.end.clone() : null, allDay: t.allDay }; + } + function Rt(t) { + var e = It(t); + return 'background' === e || 'inverse-background' === e; + } + function xt(t) { + return 'inverse-background' === It(t); + } + function It(t) { + return J((t.source || {}).rendering, t.rendering); + } + function kt(t) { + var e, + n, + i = {}; + for (e = 0; e < t.length; e++) (n = t[e]), (i[n._id] || (i[n._id] = [])).push(n); + return i; + } + function Lt(t, e) { + return t.start - e.start; + } + function Mt(n) { + var i, + r, + s, + o, + l = qt.dataAttrPrefix; + return ( + l && (l += '-'), + (i = n.data(l + 'event') || null), + i && + ((i = 'object' == typeof i ? t.extend({}, i) : {}), + (r = i.start), + null == r && (r = i.time), + (s = i.duration), + (o = i.stick), + delete i.start, + delete i.time, + delete i.duration, + delete i.stick), + null == r && (r = n.data(l + 'start')), + null == r && (r = n.data(l + 'time')), + null == s && (s = n.data(l + 'duration')), + null == o && (o = n.data(l + 'stick')), + (r = null != r ? e.duration(r) : null), + (s = null != s ? e.duration(s) : null), + (o = Boolean(o)), + { eventProps: i, startTime: r, duration: s, stick: o } + ); + } + function Bt(t, e) { + var n, i; + for (n = 0; n < e.length; n++) if (((i = e[n]), i.leftCol <= t.rightCol && i.rightCol >= t.leftCol)) return !0; + return !1; + } + function zt(t, e) { + return t.leftCol - e.leftCol; + } + function Ft(t) { + var e, + n, + i, + r = []; + for (e = 0; e < t.length; e++) { + for (n = t[e], i = 0; i < r.length && Ot(n, r[i]).length; i++); + (n.level = i), (r[i] || (r[i] = [])).push(n); + } + return r; + } + function Nt(t) { + var e, n, i, r, s; + for (e = 0; e < t.length; e++) + for (n = t[e], i = 0; i < n.length; i++) for (r = n[i], r.forwardSegs = [], s = e + 1; s < t.length; s++) Ot(r, t[s], r.forwardSegs); + } + function Gt(t) { + var e, + n, + i = t.forwardSegs, + r = 0; + if (void 0 === t.forwardPressure) { + for (e = 0; e < i.length; e++) (n = i[e]), Gt(n), (r = Math.max(r, 1 + n.forwardPressure)); + t.forwardPressure = r; + } + } + function Ot(t, e, n) { + n = n || []; + for (var i = 0; i < e.length; i++) At(t, e[i]) && n.push(e[i]); + return n; + } + function At(t, e) { + return t.bottom > e.top && t.top < e.bottom; + } + function Vt(t) { + this.items = t || []; + } + function Pt(e, n) { + function i(t) { + n = t; + } + function r() { + var i = n.layout; + (p = e.options.theme ? 'ui' : 'fc'), + i + ? (g ? g.empty() : (g = this.el = t("
")), + g.append(o('left')).append(o('right')).append(o('center')).append('
')) + : s(); + } + function s() { + g && (g.remove(), (g = f.el = null)); + } + function o(i) { + var r = t('
'), + s = n.layout[i]; + return ( + s && + t.each(s.split(' '), function (n) { + var i, + s = t(), + o = !0; + t.each(this.split(','), function (n, i) { + var r, l, a, u, c, d, h, f, g, m; + 'title' == i + ? ((s = s.add(t('

 

'))), (o = !1)) + : ((r = (e.options.customButtons || {})[i]) + ? ((a = function (t) { + r.click && r.click.call(m[0], t); + }), + (u = ''), + (c = r.text)) + : (l = e.getViewSpec(i)) + ? ((a = function () { + e.changeView(i); + }), + v.push(i), + (u = l.buttonTextOverride), + (c = l.buttonTextDefault)) + : e[i] && + ((a = function () { + e[i](); + }), + (u = (e.overrides.buttonText || {})[i]), + (c = e.options.buttonText[i])), + a && + ((d = r ? r.themeIcon : e.options.themeButtonIcons[i]), + (h = r ? r.icon : e.options.buttonIcons[i]), + (f = u + ? tt(u) + : d && e.options.theme + ? "" + : h && !e.options.theme + ? "" + : tt(c)), + (g = ['fc-' + i + '-button', p + '-button', p + '-state-default']), + (m = t('') + .click(function (t) { + m.hasClass(p + '-state-disabled') || + (a(t), + (m.hasClass(p + '-state-active') || m.hasClass(p + '-state-disabled')) && m.removeClass(p + '-state-hover')); + }) + .mousedown(function () { + m.not('.' + p + '-state-active') + .not('.' + p + '-state-disabled') + .addClass(p + '-state-down'); + }) + .mouseup(function () { + m.removeClass(p + '-state-down'); + }) + .hover( + function () { + m.not('.' + p + '-state-active') + .not('.' + p + '-state-disabled') + .addClass(p + '-state-hover'); + }, + function () { + m.removeClass(p + '-state-hover').removeClass(p + '-state-down'); + } + )), + (s = s.add(m)))); + }), + o && + s + .first() + .addClass(p + '-corner-left') + .end() + .last() + .addClass(p + '-corner-right') + .end(), + s.length > 1 ? ((i = t('
')), o && i.addClass('fc-button-group'), i.append(s), r.append(i)) : r.append(s); + }), + r + ); + } + function l(t) { + g && g.find('h2').text(t); + } + function a(t) { + g && g.find('.fc-' + t + '-button').addClass(p + '-state-active'); + } + function u(t) { + g && g.find('.fc-' + t + '-button').removeClass(p + '-state-active'); + } + function c(t) { + g && + g + .find('.fc-' + t + '-button') + .prop('disabled', !0) + .addClass(p + '-state-disabled'); + } + function d(t) { + g && + g + .find('.fc-' + t + '-button') + .prop('disabled', !1) + .removeClass(p + '-state-disabled'); + } + function h() { + return v; + } + var f = this; + (f.setToolbarOptions = i), + (f.render = r), + (f.removeElement = s), + (f.updateTitle = l), + (f.activateButton = a), + (f.deactivateButton = u), + (f.disableButton = c), + (f.enableButton = d), + (f.getViewsWithButtons = h), + (f.el = null); + var g, + p, + v = []; + } + function _t(n, i) { + function r(t) { + t._locale = Y; + } + function s() { + q ? a() && (f(), u()) : o(); + } + function o() { + n.addClass('fc'), + n.on('click.fc', 'a[data-goto]', function (e) { + var n = t(this), + i = n.data('goto'), + r = _.moment(i.date), + s = i.type, + o = Q.opt('navLink' + rt(s) + 'Click'); + 'function' == typeof o ? o(r, e) : ('string' == typeof o && (s = o), B(r, s)); + }), + _.bindOption('theme', function (t) { + ($ = t ? 'ui' : 'fc'), n.toggleClass('ui-widget', t), n.toggleClass('fc-unthemed', !t); + }), + _.bindOptions(['isRTL', 'locale'], function (t) { + n.toggleClass('fc-ltr', !t), n.toggleClass('fc-rtl', t); + }), + (q = t("
").prependTo(n)); + var e = y(); + (W = new Vt(e)), + (U = _.header = e[0]), + (j = _.footer = e[1]), + E(), + b(), + u(_.options.defaultView), + _.options.handleWindowResize && ((K = at(v, _.options.windowResizeDelay)), t(window).resize(K)); + } + function l() { + Q && Q.removeElement(), + W.proxyCall('removeElement'), + q.remove(), + n.removeClass('fc fc-ltr fc-rtl fc-unthemed ui-widget'), + n.off('.fc'), + K && t(window).unbind('resize', K); + } + function a() { + return n.is(':visible'); + } + function u(e, n) { + nt++; + var i = Q && e && Q.type !== e; + i && (F(), c()), + !Q && + e && + ((Q = _.view = et[e] || (et[e] = _.instantiateView(e))), + Q.setElement(t("
").appendTo(q)), + W.proxyCall('activateButton', e)), + Q && + ((J = Q.massageCurrentDate(J)), + (Q.isDateSet && J >= Q.intervalStart && J < Q.intervalEnd) || + (a() && (n && Q.captureInitialScroll(n), Q.setDate(J, n), n && Q.releaseScroll(), D()))), + i && N(), + nt--; + } + function c() { + W.proxyCall('deactivateButton', Q.type), Q.removeElement(), (Q = _.view = null); + } + function d() { + nt++, F(); + var t = Q.type, + e = Q.queryScroll(); + c(), f(), u(t, e), N(), nt--; + } + function h(t) { + if (a()) return t && g(), nt++, Q.updateSize(!0), nt--, !0; + } + function f() { + a() && g(); + } + function g() { + var t = _.options.contentHeight, + e = _.options.height; + X = + 'number' == typeof t + ? t + : 'function' == typeof t + ? t() + : 'number' == typeof e + ? e - p() + : 'function' == typeof e + ? e() - p() + : 'parent' === e + ? n.parent().height() - p() + : Math.round(q.width() / Math.max(_.options.aspectRatio, 0.5)); + } + function p() { + return W.items.reduce(function (t, e) { + var n = e.el ? e.el.outerHeight(!0) : 0; + return t + n; + }, 0); + } + function v(t) { + !nt && t.target === window && Q.start && h(!0) && Q.publiclyTrigger('windowResize', tt); + } + function m() { + a() && _.reportEventChange(); + } + function y() { + return [new Pt(_, S()), new Pt(_, w())]; + } + function S() { + return { extraClasses: 'fc-header-toolbar', layout: _.options.header }; + } + function w() { + return { extraClasses: 'fc-footer-toolbar', layout: _.options.footer }; + } + function E() { + U.setToolbarOptions(S()), U.render(), U.el && n.prepend(U.el); + } + function b() { + j.setToolbarOptions(w()), j.render(), j.el && n.append(j.el); + } + function D() { + var t = _.getNow(); + t >= Q.intervalStart && t < Q.intervalEnd ? W.proxyCall('disableButton', 'today') : W.proxyCall('enableButton', 'today'); + } + function T(t, e) { + Q.select(_.buildSelectSpan.apply(_, arguments)); + } + function C() { + Q && Q.unselect(); + } + function H() { + (J = Q.computePrevDate(J)), u(); + } + function R() { + (J = Q.computeNextDate(J)), u(); + } + function x() { + J.add(-1, 'years'), u(); + } + function I() { + J.add(1, 'years'), u(); + } + function k() { + (J = _.getNow()), u(); + } + function L(t) { + (J = _.moment(t).stripZone()), u(); + } + function M(t) { + J.add(e.duration(t)), u(); + } + function B(t, e) { + var n; + (e = e || 'day'), (n = _.getViewSpec(e) || _.getUnitViewSpec(e)), (J = t.clone()), u(n ? n.type : null); + } + function z() { + return _.applyTimezone(J); + } + function F() { + it++ || q.css({ width: '100%', height: q.height(), overflow: 'hidden' }); + } + function N() { + --it || q.css({ width: '', height: '', overflow: '' }); + } + function G() { + return _; + } + function O() { + return Q; + } + function A(t, e) { + var n; + if ('string' == typeof t) { + if (void 0 === e) return _.options[t]; + (n = {}), (n[t] = e), V(n); + } else 'object' == typeof t && V(t); + } + function V(t) { + var e, + n = 0; + for (e in t) _.dynamicOverrides[e] = t[e]; + (_.viewSpecCache = {}), _.populateOptionsHash(); + for (e in t) _.triggerOptionHandlers(e), n++; + if (1 === n) { + if ('height' === e || 'contentHeight' === e || 'aspectRatio' === e) return void h(!0); + if ('defaultDate' === e) return; + if ('businessHours' === e) return void (Q && (Q.unrenderBusinessHours(), Q.renderBusinessHours())); + if ('timezone' === e) return _.rezoneArrayEventSources(), void _.refetchEvents(); + } + E(), b(), (et = {}), d(); + } + function P(t, e) { + var n = Array.prototype.slice.call(arguments, 2); + if (((e = e || tt), this.triggerWith(t, e, n), _.options[t])) return _.options[t].apply(e, n); + } + var _ = this; + (_.render = s), + (_.destroy = l), + (_.rerenderEvents = m), + (_.changeView = u), + (_.select = T), + (_.unselect = C), + (_.prev = H), + (_.next = R), + (_.prevYear = x), + (_.nextYear = I), + (_.today = k), + (_.gotoDate = L), + (_.incrementDate = M), + (_.zoomTo = B), + (_.getDate = z), + (_.getCalendar = G), + (_.getView = O), + (_.option = A), + (_.publiclyTrigger = P), + (_.dynamicOverrides = {}), + (_.viewSpecCache = {}), + (_.optionHandlers = {}), + (_.overrides = t.extend({}, i)), + _.populateOptionsHash(); + var Y; + _.bindOptions( + ['locale', 'monthNames', 'monthNamesShort', 'dayNames', 'dayNamesShort', 'firstDay', 'weekNumberCalculation'], + function (t, e, n, i, s, o, l) { + if ( + ('iso' === l && (l = 'ISO'), + (Y = Z(Wt(t))), + e && (Y._months = e), + n && (Y._monthsShort = n), + i && (Y._weekdays = i), + s && (Y._weekdaysShort = s), + null == o && 'ISO' === l && (o = 1), + null != o) + ) { + var a = Z(Y._week); + (a.dow = o), (Y._week = a); + } + ('ISO' !== l && 'local' !== l && 'function' != typeof l) || (Y._fullCalendar_weekCalc = l), J && r(J); + } + ), + (_.defaultAllDayEventDuration = e.duration(_.options.defaultAllDayEventDuration)), + (_.defaultTimedEventDuration = e.duration(_.options.defaultTimedEventDuration)), + (_.moment = function () { + var t; + return ( + 'local' === _.options.timezone + ? ((t = qt.moment.apply(null, arguments)), t.hasTime() && t.local()) + : (t = 'UTC' === _.options.timezone ? qt.moment.utc.apply(null, arguments) : qt.moment.parseZone.apply(null, arguments)), + r(t), + t + ); + }), + (_.localizeMoment = r), + (_.getIsAmbigTimezone = function () { + return 'local' !== _.options.timezone && 'UTC' !== _.options.timezone; + }), + (_.applyTimezone = function (t) { + if (!t.hasTime()) return t.clone(); + var e, + n = _.moment(t.toArray()), + i = t.time() - n.time(); + return i && ((e = n.clone().add(i)), t.time() - e.time() === 0 && (n = e)), n; + }), + (_.getNow = function () { + var t = _.options.now; + return 'function' == typeof t && (t = t()), _.moment(t).stripZone(); + }), + (_.getEventEnd = function (t) { + return t.end ? t.end.clone() : _.getDefaultEventEnd(t.allDay, t.start); + }), + (_.getDefaultEventEnd = function (t, e) { + var n = e.clone(); + return ( + t ? n.stripTime().add(_.defaultAllDayEventDuration) : n.add(_.defaultTimedEventDuration), + _.getIsAmbigTimezone() && n.stripZone(), + n + ); + }), + (_.humanizeDuration = function (t) { + return t.locale(_.options.locale).humanize(); + }), + Ut.call(_); + var W, + U, + j, + q, + $, + Q, + X, + K, + J, + tt = n[0], + et = {}, + nt = 0; + (J = null != _.options.defaultDate ? _.moment(_.options.defaultDate).stripZone() : _.getNow()), + (_.getSuggestedViewHeight = function () { + return void 0 === X && f(), X; + }), + (_.isHeightAuto = function () { + return 'auto' === _.options.contentHeight || 'auto' === _.options.height; + }), + (_.setToolbarsTitle = function (t) { + W.proxyCall('updateTitle', t); + }), + (_.freezeContentHeight = F), + (_.thawContentHeight = N); + var it = 0; + _.initialize(); + } + function Yt(e) { + t.each(Re, function (t, n) { + null == e[t] && (e[t] = n(e)); + }); + } + function Wt(t) { + return e.localeData(t) || e.localeData('en'); + } + function Ut() { + function n(t, e) { + return !U.options.lazyFetching || s(t, e) ? o(t, e) : bt.resolve($); + } + function i() { + ($ = r(nt)), U.trigger('eventsReset', $); + } + function r(t) { + var e, + n, + i = []; + for (e = 0; e < t.length; e++) (n = t[e]), n.start.clone().stripZone() < Z && U.getEventEnd(n).stripZone() > q && i.push(n); + return i; + } + function s(t, e) { + return !q || t < q || e > Z; + } + function o(t, e) { + return (q = t), (Z = e), l(); + } + function l() { + return u(tt, 'reset'); + } + function a(t) { + return u(E(t)); + } + function u(t, e) { + var n, i; + for ('reset' === e ? (nt = []) : 'add' !== e && (nt = C(nt, t)), n = 0; n < t.length; n++) + (i = t[n]), 'pending' !== i._status && et++, (i._fetchId = (i._fetchId || 0) + 1), (i._status = 'pending'); + for (n = 0; n < t.length; n++) (i = t[n]), c(i, i._fetchId); + return et + ? new bt(function (t) { + U.one('eventsReceived', t); + }) + : bt.resolve($); + } + function c(e, n) { + f(e, function (i) { + var r, + s, + o, + l = t.isArray(e.events); + if (n === e._fetchId && 'rejected' !== e._status) { + if (((e._status = 'resolved'), i)) for (r = 0; r < i.length; r++) (s = i[r]), (o = l ? s : F(s, e)), o && nt.push.apply(nt, _(o)); + h(); + } + }); + } + function d(t) { + var e = 'pending' === t._status; + (t._status = 'rejected'), e && h(); + } + function h() { + et--, et || (i(nt), U.trigger('eventsReceived', $)); + } + function f(e, n) { + var i, + r, + s = qt.sourceFetchers; + for (i = 0; i < s.length; i++) { + if (((r = s[i].call(U, e, q.clone(), Z.clone(), U.options.timezone, n)), r === !0)) return; + if ('object' == typeof r) return void f(r, n); + } + var o = e.events; + if (o) + t.isFunction(o) + ? (U.pushLoading(), + o.call(U, q.clone(), Z.clone(), U.options.timezone, function (t) { + n(t), U.popLoading(); + })) + : t.isArray(o) + ? n(o) + : n(); + else { + var l = e.url; + if (l) { + var a, + u = e.success, + c = e.error, + d = e.complete; + a = t.isFunction(e.data) ? e.data() : e.data; + var h = t.extend({}, a || {}), + g = J(e.startParam, U.options.startParam), + p = J(e.endParam, U.options.endParam), + v = J(e.timezoneParam, U.options.timezoneParam); + g && (h[g] = q.format()), + p && (h[p] = Z.format()), + U.options.timezone && 'local' != U.options.timezone && (h[v] = U.options.timezone), + U.pushLoading(), + t.ajax( + t.extend({}, xe, e, { + data: h, + success: function (e) { + e = e || []; + var i = K(u, this, arguments); + t.isArray(i) && (e = i), n(e); + }, + error: function () { + K(c, this, arguments), n(); + }, + complete: function () { + K(d, this, arguments), U.popLoading(); + }, + }) + ); + } else n(); + } + } + function g(t) { + var e = p(t); + e && (tt.push(e), u([e], 'add')); + } + function p(e) { + var n, + i, + r = qt.sourceNormalizers; + if ( + (t.isFunction(e) || t.isArray(e) + ? (n = { events: e }) + : 'string' == typeof e + ? (n = { url: e }) + : 'object' == typeof e && (n = t.extend({}, e)), + n) + ) { + for ( + n.className ? 'string' == typeof n.className && (n.className = n.className.split(/\s+/)) : (n.className = []), + t.isArray(n.events) && + ((n.origArray = n.events), + (n.events = t.map(n.events, function (t) { + return F(t, n); + }))), + i = 0; + i < r.length; + i++ + ) + r[i].call(U, n); + return n; + } + } + function v(t) { + y(b(t)); + } + function m(t) { + null == t ? y(tt, !0) : y(E(t)); + } + function y(e, n) { + var r; + for (r = 0; r < e.length; r++) d(e[r]); + n + ? ((tt = []), (nt = [])) + : ((tt = t.grep(tt, function (t) { + for (r = 0; r < e.length; r++) if (t === e[r]) return !1; + return !0; + })), + (nt = C(nt, e))), + i(); + } + function S() { + return tt.slice(1); + } + function w(e) { + return t.grep(tt, function (t) { + return t.id && t.id === e; + })[0]; + } + function E(e) { + e ? t.isArray(e) || (e = [e]) : (e = []); + var n, + i = []; + for (n = 0; n < e.length; n++) i.push.apply(i, b(e[n])); + return i; + } + function b(e) { + var n, i; + for (n = 0; n < tt.length; n++) if (((i = tt[n]), i === e)) return [i]; + return ( + (i = w(e)), + i + ? [i] + : t.grep(tt, function (t) { + return D(e, t); + }) + ); + } + function D(t, e) { + return t && e && T(t) == T(e); + } + function T(t) { + return ('object' == typeof t ? t.origArray || t.googleCalendarId || t.url || t.events : null) || t; + } + function C(e, n) { + return t.grep(e, function (t) { + for (var e = 0; e < n.length; e++) if (t.source === n[e]) return !1; + return !0; + }); + } + function H(t) { + R([t]); + } + function R(t) { + var e, n; + for (e = 0; e < t.length; e++) + (n = t[e]), (n.start = U.moment(n.start)), n.end ? (n.end = U.moment(n.end)) : (n.end = null), Y(n, x(n)); + i(); + } + function x(e) { + var n = {}; + return ( + t.each(e, function (t, e) { + I(t) && void 0 !== e && X(e) && (n[t] = e); + }), + n + ); + } + function I(t) { + return !/^_|^(id|allDay|start|end)$/.test(t); + } + function k(t, e) { + return L([t], e); + } + function L(t, e) { + var n, + r, + s, + o, + l, + a = []; + for (s = 0; s < t.length; s++) + if ((r = F(t[s]))) { + for (n = _(r), o = 0; o < n.length; o++) (l = n[o]), l.source || (e && (Q.events.push(l), (l.source = Q)), nt.push(l)); + a = a.concat(n); + } + return a.length && i(), a; + } + function M(e) { + var n, r; + for ( + null == e + ? (e = function () { + return !0; + }) + : t.isFunction(e) || + ((n = e + ''), + (e = function (t) { + return t._id == n; + })), + nt = t.grep(nt, e, !0), + r = 0; + r < tt.length; + r++ + ) + t.isArray(tt[r].events) && (tt[r].events = t.grep(tt[r].events, e, !0)); + i(); + } + function B(e) { + return t.isFunction(e) + ? t.grep(nt, e) + : null != e + ? ((e += ''), + t.grep(nt, function (t) { + return t._id == e; + })) + : nt; + } + function z(t) { + (t.start = U.moment(t.start)), t.end && (t.end = U.moment(t.end)), jt(t); + } + function F(n, i) { + var r, + s, + o, + l = {}; + if ( + (U.options.eventDataTransform && (n = U.options.eventDataTransform(n)), + i && i.eventDataTransform && (n = i.eventDataTransform(n)), + t.extend(l, n), + i && (l.source = i), + (l._id = n._id || (void 0 === n.id ? '_fc' + Ie++ : n.id + '')), + n.className + ? 'string' == typeof n.className + ? (l.className = n.className.split(/\s+/)) + : (l.className = n.className) + : (l.className = []), + (r = n.start || n.date), + (s = n.end), + j(r) && (r = e.duration(r)), + j(s) && (s = e.duration(s)), + n.dow || e.isDuration(r) || e.isDuration(s)) + ) + (l.start = r ? e.duration(r) : null), (l.end = s ? e.duration(s) : null), (l._recurring = !0); + else { + if (r && ((r = U.moment(r)), !r.isValid())) return !1; + s && ((s = U.moment(s)), s.isValid() || (s = null)), + (o = n.allDay), + void 0 === o && (o = J(i ? i.allDayDefault : void 0, U.options.allDayDefault)), + A(r, s, o, l); + } + return U.normalizeEvent(l), l; + } + function A(t, e, n, i) { + (i.start = t), (i.end = e), (i.allDay = n), V(i), jt(i); + } + function V(t) { + P(t), + t.end && !t.end.isAfter(t.start) && (t.end = null), + t.end || (U.options.forceEventDuration ? (t.end = U.getDefaultEventEnd(t.allDay, t.start)) : (t.end = null)); + } + function P(t) { + null == t.allDay && (t.allDay = !(t.start.hasTime() || (t.end && t.end.hasTime()))), + t.allDay + ? (t.start.stripTime(), t.end && t.end.stripTime()) + : (t.start.hasTime() || (t.start = U.applyTimezone(t.start.time(0))), + t.end && !t.end.hasTime() && (t.end = U.applyTimezone(t.end.time(0)))); + } + function _(e, n, i) { + var r, + s, + o, + l, + a, + u, + c, + d, + h, + f = []; + if (((n = n || q), (i = i || Z), e)) + if (e._recurring) { + if ((s = e.dow)) for (r = {}, o = 0; o < s.length; o++) r[s[o]] = !0; + for (l = n.clone().stripTime(); l.isBefore(i); ) + (r && !r[l.day()]) || + ((a = e.start), + (u = e.end), + (c = l.clone()), + (d = null), + a && (c = c.time(a)), + u && (d = l.clone().time(u)), + (h = t.extend({}, e)), + A(c, d, !a && !u, h), + f.push(h)), + l.add(1, 'days'); + } else f.push(e); + return f; + } + function Y(e, n, i) { + function r(t, e) { + return i ? O(t, e, i) : n.allDay ? G(t, e) : N(t, e); + } + var s, + o, + l, + a, + u, + c, + d = {}; + return ( + (n = n || {}), + n.start || (n.start = e.start.clone()), + void 0 === n.end && (n.end = e.end ? e.end.clone() : null), + null == n.allDay && (n.allDay = e.allDay), + V(n), + (s = { start: e._start.clone(), end: e._end ? e._end.clone() : U.getDefaultEventEnd(e._allDay, e._start), allDay: n.allDay }), + V(s), + (o = null !== e._end && null === n.end), + (l = r(n.start, s.start)), + n.end ? ((a = r(n.end, s.end)), (u = a.subtract(l))) : (u = null), + t.each(n, function (t, e) { + I(t) && void 0 !== e && (d[t] = e); + }), + (c = W(B(e._id), o, n.allDay, l, u, d)), + { dateDelta: l, durationDelta: u, undo: c } + ); + } + function W(e, n, i, r, s, o) { + var l = U.getIsAmbigTimezone(), + a = []; + return ( + r && !r.valueOf() && (r = null), + s && !s.valueOf() && (s = null), + t.each(e, function (e, u) { + var c, d; + (c = { start: u.start.clone(), end: u.end ? u.end.clone() : null, allDay: u.allDay }), + t.each(o, function (t) { + c[t] = u[t]; + }), + (d = { start: u._start, end: u._end, allDay: i }), + V(d), + n ? (d.end = null) : s && !d.end && (d.end = U.getDefaultEventEnd(d.allDay, d.start)), + r && (d.start.add(r), d.end && d.end.add(r)), + s && d.end.add(s), + l && !d.allDay && (r || s) && (d.start.stripZone(), d.end && d.end.stripZone()), + t.extend(u, o, d), + jt(u), + a.push(function () { + t.extend(u, c), jt(u); + }); + }), + function () { + for (var t = 0; t < a.length; t++) a[t](); + } + ); + } + var U = this; + (U.requestEvents = n), + (U.reportEventChange = i), + (U.isFetchNeeded = s), + (U.fetchEvents = o), + (U.fetchEventSources = u), + (U.refetchEvents = l), + (U.refetchEventSources = a), + (U.getEventSources = S), + (U.getEventSourceById = w), + (U.addEventSource = g), + (U.removeEventSource = v), + (U.removeEventSources = m), + (U.updateEvent = H), + (U.updateEvents = R), + (U.renderEvent = k), + (U.renderEvents = L), + (U.removeEvents = M), + (U.clientEvents = B), + (U.mutateEvent = Y), + (U.normalizeEventDates = V), + (U.normalizeEventTimes = P); + var q, + Z, + $, + Q = { events: [] }, + tt = [Q], + et = 0, + nt = []; + t.each((U.options.events ? [U.options.events] : []).concat(U.options.eventSources || []), function (t, e) { + var n = p(e); + n && tt.push(n); + }), + (U.getEventCache = function () { + return nt; + }), + (U.getPrunedEventCache = function () { + return $; + }), + (U.rezoneArrayEventSources = function () { + var e, n, i; + for (e = 0; e < tt.length; e++) if (((n = tt[e].events), t.isArray(n))) for (i = 0; i < n.length; i++) z(n[i]); + }), + (U.buildEventFromInput = F), + (U.expandEvent = _); + } + function jt(t) { + (t._allDay = t.allDay), (t._start = t.start.clone()), (t._end = t.end ? t.end.clone() : null); + } + var qt = (t.fullCalendar = { version: '3.1.0', internalApiVersion: 7 }), + Zt = (qt.views = {}); + t.fn.fullCalendar = function (e) { + var n = Array.prototype.slice.call(arguments, 1), + i = this; + return ( + this.each(function (r, s) { + var o, + l = t(s), + a = l.data('fullCalendar'); + 'string' == typeof e + ? a && t.isFunction(a[e]) && ((o = a[e].apply(a, n)), r || (i = o), 'destroy' === e && l.removeData('fullCalendar')) + : a || ((a = new De(l, e)), l.data('fullCalendar', a), a.render()); + }), + i + ); + }; + var $t = ['header', 'footer', 'buttonText', 'buttonIcons', 'themeButtonIcons']; + (qt.intersectRanges = F), + (qt.applyAll = K), + (qt.debounce = at), + (qt.isInt = ot), + (qt.htmlEscape = tt), + (qt.cssToStr = nt), + (qt.proxy = lt), + (qt.capitaliseFirstLetter = rt), + (qt.getOuterRect = h), + (qt.getClientRect = f), + (qt.getContentRect = g), + (qt.getScrollbarWidths = p); + var Qt = null; + (qt.preventDefault = T), + (qt.intersectRects = R), + (qt.parseFieldSpecs = L), + (qt.compareByFieldSpecs = M), + (qt.compareByFieldSpec = B), + (qt.flexibleCompare = z), + (qt.computeIntervalUnit = A), + (qt.divideRangeByDuration = P), + (qt.divideDurationByDuration = _), + (qt.multiplyDuration = Y), + (qt.durationHasTime = W); + var Xt = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'], + Kt = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; + (qt.log = function () { + var t = window.console; + if (t && t.log) return t.log.apply(t, arguments); + }), + (qt.warn = function () { + var t = window.console; + return t && t.warn ? t.warn.apply(t, arguments) : qt.log.apply(qt, arguments); + }); + var Jt = {}.hasOwnProperty; + qt.createObject = Z; + var te = /^\s*\d{4}-\d\d$/, + ee = /^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/, + ne = e.fn, + ie = t.extend({}, ne), + re = e.momentProperties; + re.push('_fullCalendar'), + re.push('_ambigTime'), + re.push('_ambigZone'), + (qt.moment = function () { + return ut(arguments); + }), + (qt.moment.utc = function () { + var t = ut(arguments, !0); + return t.hasTime() && t.utc(), t; + }), + (qt.moment.parseZone = function () { + return ut(arguments, !0, !0); + }), + (ne.week = ne.weeks = + function (t) { + var e = this._locale._fullCalendar_weekCalc; + return null == t && 'function' == typeof e + ? e(this) + : 'ISO' === e + ? ie.isoWeek.apply(this, arguments) + : ie.week.apply(this, arguments); + }), + (ne.time = function (t) { + if (!this._fullCalendar) return ie.time.apply(this, arguments); + if (null == t) + return e.duration({ hours: this.hours(), minutes: this.minutes(), seconds: this.seconds(), milliseconds: this.milliseconds() }); + (this._ambigTime = !1), e.isDuration(t) || e.isMoment(t) || (t = e.duration(t)); + var n = 0; + return ( + e.isDuration(t) && (n = 24 * Math.floor(t.asDays())), + this.hours(n + t.hours()) + .minutes(t.minutes()) + .seconds(t.seconds()) + .milliseconds(t.milliseconds()) + ); + }), + (ne.stripTime = function () { + return ( + this._ambigTime || + (this.utc(!0), this.set({ hours: 0, minutes: 0, seconds: 0, ms: 0 }), (this._ambigTime = !0), (this._ambigZone = !0)), + this + ); + }), + (ne.hasTime = function () { + return !this._ambigTime; + }), + (ne.stripZone = function () { + var t; + return this._ambigZone || ((t = this._ambigTime), this.utc(!0), (this._ambigTime = t || !1), (this._ambigZone = !0)), this; + }), + (ne.hasZone = function () { + return !this._ambigZone; + }), + (ne.local = function (t) { + return ie.local.call(this, this._ambigZone || t), (this._ambigTime = !1), (this._ambigZone = !1), this; + }), + (ne.utc = function (t) { + return ie.utc.call(this, t), (this._ambigTime = !1), (this._ambigZone = !1), this; + }), + (ne.utcOffset = function (t) { + return null != t && ((this._ambigTime = !1), (this._ambigZone = !1)), ie.utcOffset.apply(this, arguments); + }), + (ne.format = function () { + return this._fullCalendar && arguments[0] + ? dt(this, arguments[0]) + : this._ambigTime + ? ct(this, 'YYYY-MM-DD') + : this._ambigZone + ? ct(this, 'YYYY-MM-DD[T]HH:mm:ss') + : ie.format.apply(this, arguments); + }), + (ne.toISOString = function () { + return this._ambigTime + ? ct(this, 'YYYY-MM-DD') + : this._ambigZone + ? ct(this, 'YYYY-MM-DD[T]HH:mm:ss') + : ie.toISOString.apply(this, arguments); + }); + var se = { + t: function (t) { + return ct(t, 'a').charAt(0); + }, + T: function (t) { + return ct(t, 'A').charAt(0); + }, + }; + qt.formatRange = gt; + var oe = { + Y: 'year', + M: 'month', + D: 'day', + d: 'day', + A: 'second', + a: 'second', + T: 'second', + t: 'second', + H: 'second', + h: 'second', + m: 'second', + s: 'second', + }, + le = {}, + ae = { + Y: { value: 1, unit: 'year' }, + M: { value: 2, unit: 'month' }, + W: { value: 3, unit: 'week' }, + w: { value: 3, unit: 'week' }, + D: { value: 4, unit: 'day' }, + d: { value: 4, unit: 'day' }, + }; + (qt.queryMostGranularFormatUnit = function (t) { + var e, + n, + i, + r, + s = mt(t); + for (e = 0; e < s.length; e++) (n = s[e]), n.token && ((i = ae[n.token.charAt(0)]), i && (!r || i.value > r.value) && (r = i)); + return r ? r.unit : null; + }), + (qt.Class = St), + (St.extend = function () { + var t, + e, + n = arguments.length; + for (t = 0; t < n; t++) (e = arguments[t]), t < n - 1 && Et(this, e); + return wt(this, e || {}); + }), + (St.mixin = function (t) { + Et(this, t); + }), + (qt.Promise = bt), + (bt.immediate = !0), + (bt.resolve = function (e) { + if (e && 'function' == typeof e.resolve) return e.promise(); + if (e && 'function' == typeof e.then) return e; + var n = t.Deferred().resolve(e), + i = n.promise(); + if (bt.immediate) { + var r = i.then; + (i._value = e), + (i.then = function (t, n) { + return 'function' == typeof t ? bt.resolve(t(e)) : r.call(i, t, n); + }); + } + return i; + }), + (bt.reject = function () { + return t.Deferred().reject().promise(); + }), + (bt.all = function (e) { + var n, + i, + r, + s = !1; + if (bt.immediate) + for (s = !0, n = [], i = 0; i < e.length; i++) + if (((r = e[i]), r && 'function' == typeof r.state && 'resolved' === r.state() && '_value' in r)) n.push(r._value); + else { + if (r && 'function' == typeof r.then) { + s = !1; + break; + } + n.push(r); + } + return s + ? bt.resolve(n) + : t.when.apply(t.when, e).then(function () { + return t.when(t.makeArray(arguments)); + }); + }), + (qt.TaskQueue = Dt); + var ue = (qt.EmitterMixin = { + on: function (e, n) { + return t(this).on(e, this._prepareIntercept(n)), this; + }, + one: function (e, n) { + return t(this).one(e, this._prepareIntercept(n)), this; + }, + _prepareIntercept: function (e) { + var n = function (t, n) { + return e.apply(n.context || this, n.args || []); + }; + return e.guid || (e.guid = t.guid++), (n.guid = e.guid), n; + }, + off: function (e, n) { + return t(this).off(e, n), this; + }, + trigger: function (e) { + var n = Array.prototype.slice.call(arguments, 1); + return t(this).triggerHandler(e, { args: n }), this; + }, + triggerWith: function (e, n, i) { + return t(this).triggerHandler(e, { context: n, args: i }), this; + }, + }), + ce = (qt.ListenerMixin = (function () { + var e = 0, + n = { + listenerId: null, + listenTo: function (e, n, i) { + if ('object' == typeof n) for (var r in n) n.hasOwnProperty(r) && this.listenTo(e, r, n[r]); + else 'string' == typeof n && e.on(n + '.' + this.getListenerNamespace(), t.proxy(i, this)); + }, + stopListeningTo: function (t, e) { + t.off((e || '') + '.' + this.getListenerNamespace()); + }, + getListenerNamespace: function () { + return null == this.listenerId && (this.listenerId = e++), '_listener' + this.listenerId; + }, + }; + return n; + })()), + de = { + isIgnoringMouse: !1, + delayUnignoreMouse: null, + initMouseIgnoring: function (t) { + this.delayUnignoreMouse = at(lt(this, 'unignoreMouse'), t || 1e3); + }, + tempIgnoreMouse: function () { + (this.isIgnoringMouse = !0), this.delayUnignoreMouse(); + }, + unignoreMouse: function () { + this.isIgnoringMouse = !1; + }, + }, + he = St.extend(ce, { + isHidden: !0, + options: null, + el: null, + margin: 10, + constructor: function (t) { + this.options = t || {}; + }, + show: function () { + this.isHidden && (this.el || this.render(), this.el.show(), this.position(), (this.isHidden = !1), this.trigger('show')); + }, + hide: function () { + this.isHidden || (this.el.hide(), (this.isHidden = !0), this.trigger('hide')); + }, + render: function () { + var e = this, + n = this.options; + (this.el = t('
') + .addClass(n.className || '') + .css({ top: 0, left: 0 }) + .append(n.content) + .appendTo(n.parentEl)), + this.el.on('click', '.fc-close', function () { + e.hide(); + }), + n.autoHide && this.listenTo(t(document), 'mousedown', this.documentMousedown); + }, + documentMousedown: function (e) { + this.el && !t(e.target).closest(this.el).length && this.hide(); + }, + removeElement: function () { + this.hide(), this.el && (this.el.remove(), (this.el = null)), this.stopListeningTo(t(document), 'mousedown'); + }, + position: function () { + var e, + n, + i, + r, + s, + o = this.options, + l = this.el.offsetParent().offset(), + a = this.el.outerWidth(), + u = this.el.outerHeight(), + c = t(window), + h = d(this.el); + (r = o.top || 0), + (s = void 0 !== o.left ? o.left : void 0 !== o.right ? o.right - a : 0), + h.is(window) || h.is(document) ? ((h = c), (e = 0), (n = 0)) : ((i = h.offset()), (e = i.top), (n = i.left)), + (e += c.scrollTop()), + (n += c.scrollLeft()), + o.viewportConstrain !== !1 && + ((r = Math.min(r, e + h.outerHeight() - u - this.margin)), + (r = Math.max(r, e + this.margin)), + (s = Math.min(s, n + h.outerWidth() - a - this.margin)), + (s = Math.max(s, n + this.margin))), + this.el.css({ top: r - l.top, left: s - l.left }); + }, + trigger: function (t) { + this.options[t] && this.options[t].apply(this, Array.prototype.slice.call(arguments, 1)); + }, + }), + fe = (qt.CoordCache = St.extend({ + els: null, + forcedOffsetParentEl: null, + origin: null, + boundingRect: null, + isHorizontal: !1, + isVertical: !1, + lefts: null, + rights: null, + tops: null, + bottoms: null, + constructor: function (e) { + (this.els = t(e.els)), + (this.isHorizontal = e.isHorizontal), + (this.isVertical = e.isVertical), + (this.forcedOffsetParentEl = e.offsetParent ? t(e.offsetParent) : null); + }, + build: function () { + var t = this.forcedOffsetParentEl; + !t && this.els.length > 0 && (t = this.els.eq(0).offsetParent()), + (this.origin = t ? t.offset() : null), + (this.boundingRect = this.queryBoundingRect()), + this.isHorizontal && this.buildElHorizontals(), + this.isVertical && this.buildElVerticals(); + }, + clear: function () { + (this.origin = null), + (this.boundingRect = null), + (this.lefts = null), + (this.rights = null), + (this.tops = null), + (this.bottoms = null); + }, + ensureBuilt: function () { + this.origin || this.build(); + }, + buildElHorizontals: function () { + var e = [], + n = []; + this.els.each(function (i, r) { + var s = t(r), + o = s.offset().left, + l = s.outerWidth(); + e.push(o), n.push(o + l); + }), + (this.lefts = e), + (this.rights = n); + }, + buildElVerticals: function () { + var e = [], + n = []; + this.els.each(function (i, r) { + var s = t(r), + o = s.offset().top, + l = s.outerHeight(); + e.push(o), n.push(o + l); + }), + (this.tops = e), + (this.bottoms = n); + }, + getHorizontalIndex: function (t) { + this.ensureBuilt(); + var e, + n = this.lefts, + i = this.rights, + r = n.length; + for (e = 0; e < r; e++) if (t >= n[e] && t < i[e]) return e; + }, + getVerticalIndex: function (t) { + this.ensureBuilt(); + var e, + n = this.tops, + i = this.bottoms, + r = n.length; + for (e = 0; e < r; e++) if (t >= n[e] && t < i[e]) return e; + }, + getLeftOffset: function (t) { + return this.ensureBuilt(), this.lefts[t]; + }, + getLeftPosition: function (t) { + return this.ensureBuilt(), this.lefts[t] - this.origin.left; + }, + getRightOffset: function (t) { + return this.ensureBuilt(), this.rights[t]; + }, + getRightPosition: function (t) { + return this.ensureBuilt(), this.rights[t] - this.origin.left; + }, + getWidth: function (t) { + return this.ensureBuilt(), this.rights[t] - this.lefts[t]; + }, + getTopOffset: function (t) { + return this.ensureBuilt(), this.tops[t]; + }, + getTopPosition: function (t) { + return this.ensureBuilt(), this.tops[t] - this.origin.top; + }, + getBottomOffset: function (t) { + return this.ensureBuilt(), this.bottoms[t]; + }, + getBottomPosition: function (t) { + return this.ensureBuilt(), this.bottoms[t] - this.origin.top; + }, + getHeight: function (t) { + return this.ensureBuilt(), this.bottoms[t] - this.tops[t]; + }, + queryBoundingRect: function () { + var t; + return this.els.length > 0 && ((t = d(this.els.eq(0))), !t.is(document)) ? f(t) : null; + }, + isPointInBounds: function (t, e) { + return this.isLeftInBounds(t) && this.isTopInBounds(e); + }, + isLeftInBounds: function (t) { + return !this.boundingRect || (t >= this.boundingRect.left && t < this.boundingRect.right); + }, + isTopInBounds: function (t) { + return !this.boundingRect || (t >= this.boundingRect.top && t < this.boundingRect.bottom); + }, + })), + ge = (qt.DragListener = St.extend(ce, de, { + options: null, + subjectEl: null, + originX: null, + originY: null, + scrollEl: null, + isInteracting: !1, + isDistanceSurpassed: !1, + isDelayEnded: !1, + isDragging: !1, + isTouch: !1, + delay: null, + delayTimeoutId: null, + minDistance: null, + handleTouchScrollProxy: null, + constructor: function (t) { + (this.options = t || {}), (this.handleTouchScrollProxy = lt(this, 'handleTouchScroll')), this.initMouseIgnoring(500); + }, + startInteraction: function (e, n) { + var i = b(e); + if ('mousedown' === e.type) { + if (this.isIgnoringMouse) return; + if (!S(e)) return; + e.preventDefault(); + } + this.isInteracting || + ((n = n || {}), + (this.delay = J(n.delay, this.options.delay, 0)), + (this.minDistance = J(n.distance, this.options.distance, 0)), + (this.subjectEl = this.options.subjectEl), + (this.isInteracting = !0), + (this.isTouch = i), + (this.isDelayEnded = !1), + (this.isDistanceSurpassed = !1), + (this.originX = w(e)), + (this.originY = E(e)), + (this.scrollEl = d(t(e.target))), + this.bindHandlers(), + this.initAutoScroll(), + this.handleInteractionStart(e), + this.startDelay(e), + this.minDistance || this.handleDistanceSurpassed(e)); + }, + handleInteractionStart: function (t) { + this.trigger('interactionStart', t); + }, + endInteraction: function (t, e) { + this.isInteracting && + (this.endDrag(t), + this.delayTimeoutId && (clearTimeout(this.delayTimeoutId), (this.delayTimeoutId = null)), + this.destroyAutoScroll(), + this.unbindHandlers(), + (this.isInteracting = !1), + this.handleInteractionEnd(t, e), + this.isTouch && this.tempIgnoreMouse()); + }, + handleInteractionEnd: function (t, e) { + this.trigger('interactionEnd', t, e || !1); + }, + bindHandlers: function () { + var e = this, + n = 1; + this.isTouch + ? (this.listenTo(t(document), { + touchmove: this.handleTouchMove, + touchend: this.endInteraction, + touchcancel: this.endInteraction, + touchstart: function (t) { + n ? n-- : e.endInteraction(t, !0); + }, + }), + !C(this.handleTouchScrollProxy) && this.scrollEl && this.listenTo(this.scrollEl, 'scroll', this.handleTouchScroll)) + : this.listenTo(t(document), { mousemove: this.handleMouseMove, mouseup: this.endInteraction }), + this.listenTo(t(document), { selectstart: T, contextmenu: T }); + }, + unbindHandlers: function () { + this.stopListeningTo(t(document)), H(this.handleTouchScrollProxy), this.scrollEl && this.stopListeningTo(this.scrollEl, 'scroll'); + }, + startDrag: function (t, e) { + this.startInteraction(t, e), this.isDragging || ((this.isDragging = !0), this.handleDragStart(t)); + }, + handleDragStart: function (t) { + this.trigger('dragStart', t); + }, + handleMove: function (t) { + var e, + n = w(t) - this.originX, + i = E(t) - this.originY, + r = this.minDistance; + this.isDistanceSurpassed || ((e = n * n + i * i), e >= r * r && this.handleDistanceSurpassed(t)), + this.isDragging && this.handleDrag(n, i, t); + }, + handleDrag: function (t, e, n) { + this.trigger('drag', t, e, n), this.updateAutoScroll(n); + }, + endDrag: function (t) { + this.isDragging && ((this.isDragging = !1), this.handleDragEnd(t)); + }, + handleDragEnd: function (t) { + this.trigger('dragEnd', t); + }, + startDelay: function (t) { + var e = this; + this.delay + ? (this.delayTimeoutId = setTimeout(function () { + e.handleDelayEnd(t); + }, this.delay)) + : this.handleDelayEnd(t); + }, + handleDelayEnd: function (t) { + (this.isDelayEnded = !0), this.isDistanceSurpassed && this.startDrag(t); + }, + handleDistanceSurpassed: function (t) { + (this.isDistanceSurpassed = !0), this.isDelayEnded && this.startDrag(t); + }, + handleTouchMove: function (t) { + this.isDragging && t.preventDefault(), this.handleMove(t); + }, + handleMouseMove: function (t) { + this.handleMove(t); + }, + handleTouchScroll: function (t) { + this.isDragging || this.endInteraction(t, !0); + }, + trigger: function (t) { + this.options[t] && this.options[t].apply(this, Array.prototype.slice.call(arguments, 1)), + this['_' + t] && this['_' + t].apply(this, Array.prototype.slice.call(arguments, 1)); + }, + })); + ge.mixin({ + isAutoScroll: !1, + scrollBounds: null, + scrollTopVel: null, + scrollLeftVel: null, + scrollIntervalId: null, + scrollSensitivity: 30, + scrollSpeed: 200, + scrollIntervalMs: 50, + initAutoScroll: function () { + var t = this.scrollEl; + (this.isAutoScroll = this.options.scroll && t && !t.is(window) && !t.is(document)), + this.isAutoScroll && this.listenTo(t, 'scroll', at(this.handleDebouncedScroll, 100)); + }, + destroyAutoScroll: function () { + this.endAutoScroll(), this.isAutoScroll && this.stopListeningTo(this.scrollEl, 'scroll'); + }, + computeScrollBounds: function () { + this.isAutoScroll && (this.scrollBounds = h(this.scrollEl)); + }, + updateAutoScroll: function (t) { + var e, + n, + i, + r, + s = this.scrollSensitivity, + o = this.scrollBounds, + l = 0, + a = 0; + o && + ((e = (s - (E(t) - o.top)) / s), + (n = (s - (o.bottom - E(t))) / s), + (i = (s - (w(t) - o.left)) / s), + (r = (s - (o.right - w(t))) / s), + e >= 0 && e <= 1 ? (l = e * this.scrollSpeed * -1) : n >= 0 && n <= 1 && (l = n * this.scrollSpeed), + i >= 0 && i <= 1 ? (a = i * this.scrollSpeed * -1) : r >= 0 && r <= 1 && (a = r * this.scrollSpeed)), + this.setScrollVel(l, a); + }, + setScrollVel: function (t, e) { + (this.scrollTopVel = t), + (this.scrollLeftVel = e), + this.constrainScrollVel(), + (!this.scrollTopVel && !this.scrollLeftVel) || + this.scrollIntervalId || + (this.scrollIntervalId = setInterval(lt(this, 'scrollIntervalFunc'), this.scrollIntervalMs)); + }, + constrainScrollVel: function () { + var t = this.scrollEl; + this.scrollTopVel < 0 + ? t.scrollTop() <= 0 && (this.scrollTopVel = 0) + : this.scrollTopVel > 0 && t.scrollTop() + t[0].clientHeight >= t[0].scrollHeight && (this.scrollTopVel = 0), + this.scrollLeftVel < 0 + ? t.scrollLeft() <= 0 && (this.scrollLeftVel = 0) + : this.scrollLeftVel > 0 && t.scrollLeft() + t[0].clientWidth >= t[0].scrollWidth && (this.scrollLeftVel = 0); + }, + scrollIntervalFunc: function () { + var t = this.scrollEl, + e = this.scrollIntervalMs / 1e3; + this.scrollTopVel && t.scrollTop(t.scrollTop() + this.scrollTopVel * e), + this.scrollLeftVel && t.scrollLeft(t.scrollLeft() + this.scrollLeftVel * e), + this.constrainScrollVel(), + this.scrollTopVel || this.scrollLeftVel || this.endAutoScroll(); + }, + endAutoScroll: function () { + this.scrollIntervalId && (clearInterval(this.scrollIntervalId), (this.scrollIntervalId = null), this.handleScrollEnd()); + }, + handleDebouncedScroll: function () { + this.scrollIntervalId || this.handleScrollEnd(); + }, + handleScrollEnd: function () {}, + }); + var pe = ge.extend({ + component: null, + origHit: null, + hit: null, + coordAdjust: null, + constructor: function (t, e) { + ge.call(this, e), (this.component = t); + }, + handleInteractionStart: function (t) { + var e, + n, + i, + r = this.subjectEl; + this.computeCoords(), + t + ? ((n = { left: w(t), top: E(t) }), + (i = n), + r && ((e = h(r)), (i = x(i, e))), + (this.origHit = this.queryHit(i.left, i.top)), + r && this.options.subjectCenter && (this.origHit && (e = R(this.origHit, e) || e), (i = I(e))), + (this.coordAdjust = k(i, n))) + : ((this.origHit = null), (this.coordAdjust = null)), + ge.prototype.handleInteractionStart.apply(this, arguments); + }, + computeCoords: function () { + this.component.prepareHits(), this.computeScrollBounds(); + }, + handleDragStart: function (t) { + var e; + ge.prototype.handleDragStart.apply(this, arguments), (e = this.queryHit(w(t), E(t))), e && this.handleHitOver(e); + }, + handleDrag: function (t, e, n) { + var i; + ge.prototype.handleDrag.apply(this, arguments), + (i = this.queryHit(w(n), E(n))), + Tt(i, this.hit) || (this.hit && this.handleHitOut(), i && this.handleHitOver(i)); + }, + handleDragEnd: function () { + this.handleHitDone(), ge.prototype.handleDragEnd.apply(this, arguments); + }, + handleHitOver: function (t) { + var e = Tt(t, this.origHit); + (this.hit = t), this.trigger('hitOver', this.hit, e, this.origHit); + }, + handleHitOut: function () { + this.hit && (this.trigger('hitOut', this.hit), this.handleHitDone(), (this.hit = null)); + }, + handleHitDone: function () { + this.hit && this.trigger('hitDone', this.hit); + }, + handleInteractionEnd: function () { + ge.prototype.handleInteractionEnd.apply(this, arguments), (this.origHit = null), (this.hit = null), this.component.releaseHits(); + }, + handleScrollEnd: function () { + ge.prototype.handleScrollEnd.apply(this, arguments), this.computeCoords(); + }, + queryHit: function (t, e) { + return this.coordAdjust && ((t += this.coordAdjust.left), (e += this.coordAdjust.top)), this.component.queryHit(t, e); + }, + }), + ve = St.extend(ce, { + options: null, + sourceEl: null, + el: null, + parentEl: null, + top0: null, + left0: null, + y0: null, + x0: null, + topDelta: null, + leftDelta: null, + isFollowing: !1, + isHidden: !1, + isAnimating: !1, + constructor: function (e, n) { + (this.options = n = n || {}), (this.sourceEl = e), (this.parentEl = n.parentEl ? t(n.parentEl) : e.parent()); + }, + start: function (e) { + this.isFollowing || + ((this.isFollowing = !0), + (this.y0 = E(e)), + (this.x0 = w(e)), + (this.topDelta = 0), + (this.leftDelta = 0), + this.isHidden || this.updatePosition(), + b(e) ? this.listenTo(t(document), 'touchmove', this.handleMove) : this.listenTo(t(document), 'mousemove', this.handleMove)); + }, + stop: function (e, n) { + function i() { + (r.isAnimating = !1), r.removeElement(), (r.top0 = r.left0 = null), n && n(); + } + var r = this, + s = this.options.revertDuration; + this.isFollowing && + !this.isAnimating && + ((this.isFollowing = !1), + this.stopListeningTo(t(document)), + e && s && !this.isHidden + ? ((this.isAnimating = !0), this.el.animate({ top: this.top0, left: this.left0 }, { duration: s, complete: i })) + : i()); + }, + getEl: function () { + var t = this.el; + return ( + t || + ((t = this.el = + this.sourceEl + .clone() + .addClass(this.options.additionalClass || '') + .css({ + position: 'absolute', + visibility: '', + display: this.isHidden ? 'none' : '', + margin: 0, + right: 'auto', + bottom: 'auto', + width: this.sourceEl.width(), + height: this.sourceEl.height(), + opacity: this.options.opacity || '', + zIndex: this.options.zIndex, + })), + t.addClass('fc-unselectable'), + t.appendTo(this.parentEl)), + t + ); + }, + removeElement: function () { + this.el && (this.el.remove(), (this.el = null)); + }, + updatePosition: function () { + var t, e; + this.getEl(), + null === this.top0 && + ((t = this.sourceEl.offset()), + (e = this.el.offsetParent().offset()), + (this.top0 = t.top - e.top), + (this.left0 = t.left - e.left)), + this.el.css({ top: this.top0 + this.topDelta, left: this.left0 + this.leftDelta }); + }, + handleMove: function (t) { + (this.topDelta = E(t) - this.y0), (this.leftDelta = w(t) - this.x0), this.isHidden || this.updatePosition(); + }, + hide: function () { + this.isHidden || ((this.isHidden = !0), this.el && this.el.hide()); + }, + show: function () { + this.isHidden && ((this.isHidden = !1), this.updatePosition(), this.getEl().show()); + }, + }), + me = (qt.Grid = St.extend(ce, de, { + hasDayInteractions: !0, + view: null, + isRTL: null, + start: null, + end: null, + el: null, + elsByFill: null, + eventTimeFormat: null, + displayEventTime: null, + displayEventEnd: null, + minResizeDuration: null, + largeUnit: null, + dayDragListener: null, + segDragListener: null, + segResizeListener: null, + externalDragListener: null, + constructor: function (t) { + (this.view = t), + (this.isRTL = t.opt('isRTL')), + (this.elsByFill = {}), + (this.dayDragListener = this.buildDayDragListener()), + this.initMouseIgnoring(); + }, + computeEventTimeFormat: function () { + return this.view.opt('smallTimeFormat'); + }, + computeDisplayEventTime: function () { + return !0; + }, + computeDisplayEventEnd: function () { + return !0; + }, + setRange: function (t) { + (this.start = t.start.clone()), (this.end = t.end.clone()), this.rangeUpdated(), this.processRangeOptions(); + }, + rangeUpdated: function () {}, + processRangeOptions: function () { + var t, + e, + n = this.view; + (this.eventTimeFormat = n.opt('eventTimeFormat') || n.opt('timeFormat') || this.computeEventTimeFormat()), + (t = n.opt('displayEventTime')), + null == t && (t = this.computeDisplayEventTime()), + (e = n.opt('displayEventEnd')), + null == e && (e = this.computeDisplayEventEnd()), + (this.displayEventTime = t), + (this.displayEventEnd = e); + }, + spanToSegs: function (t) {}, + diffDates: function (t, e) { + return this.largeUnit ? O(t, e, this.largeUnit) : N(t, e); + }, + prepareHits: function () {}, + releaseHits: function () {}, + queryHit: function (t, e) {}, + getHitSpan: function (t) {}, + getHitEl: function (t) {}, + setElement: function (t) { + (this.el = t), + this.hasDayInteractions && + (D(t), this.bindDayHandler('touchstart', this.dayTouchStart), this.bindDayHandler('mousedown', this.dayMousedown)), + this.bindSegHandlers(), + this.bindGlobalHandlers(); + }, + bindDayHandler: function (e, n) { + var i = this; + this.el.on(e, function (e) { + if (!t(e.target).is(i.segSelector + ',' + i.segSelector + ' *,.fc-more,a[data-goto]')) return n.call(i, e); + }); + }, + removeElement: function () { + this.unbindGlobalHandlers(), this.clearDragListeners(), this.el.remove(); + }, + renderSkeleton: function () {}, + renderDates: function () {}, + unrenderDates: function () {}, + bindGlobalHandlers: function () { + this.listenTo(t(document), { dragstart: this.externalDragStart, sortstart: this.externalDragStart }); + }, + unbindGlobalHandlers: function () { + this.stopListeningTo(t(document)); + }, + dayMousedown: function (t) { + this.isIgnoringMouse || this.dayDragListener.startInteraction(t, {}); + }, + dayTouchStart: function (t) { + var e = this.view, + n = e.opt('selectLongPressDelay'); + (e.isSelected || e.selectedEvent) && this.tempIgnoreMouse(), + null == n && (n = e.opt('longPressDelay')), + this.dayDragListener.startInteraction(t, { delay: n }); + }, + buildDayDragListener: function () { + var t, + e, + n = this, + i = this.view, + r = i.opt('selectable'), + l = new pe(this, { + scroll: i.opt('dragScroll'), + interactionStart: function () { + (t = l.origHit), (e = null); + }, + dragStart: function () { + i.unselect(); + }, + hitOver: function (i, o, l) { + l && + (o || (t = null), + r && ((e = n.computeSelection(n.getHitSpan(l), n.getHitSpan(i))), e ? n.renderSelection(e) : e === !1 && s())); + }, + hitOut: function () { + (t = null), (e = null), n.unrenderSelection(); + }, + hitDone: function () { + o(); + }, + interactionEnd: function (r, s) { + s || (t && !n.isIgnoringMouse && i.triggerDayClick(n.getHitSpan(t), n.getHitEl(t), r), e && i.reportSelection(e, r)); + }, + }); + return l; + }, + clearDragListeners: function () { + this.dayDragListener.endInteraction(), + this.segDragListener && this.segDragListener.endInteraction(), + this.segResizeListener && this.segResizeListener.endInteraction(), + this.externalDragListener && this.externalDragListener.endInteraction(); + }, + renderEventLocationHelper: function (t, e) { + var n = this.fabricateHelperEvent(t, e); + return this.renderHelper(n, e); + }, + fabricateHelperEvent: function (t, e) { + var n = e ? Z(e.event) : {}; + return ( + (n.start = t.start.clone()), + (n.end = t.end ? t.end.clone() : null), + (n.allDay = null), + this.view.calendar.normalizeEventDates(n), + (n.className = (n.className || []).concat('fc-helper')), + e || (n.editable = !1), + n + ); + }, + renderHelper: function (t, e) {}, + unrenderHelper: function () {}, + renderSelection: function (t) { + this.renderHighlight(t); + }, + unrenderSelection: function () { + this.unrenderHighlight(); + }, + computeSelection: function (t, e) { + var n = this.computeSelectionSpan(t, e); + return !(n && !this.view.calendar.isSelectionSpanAllowed(n)) && n; + }, + computeSelectionSpan: function (t, e) { + var n = [t.start, t.end, e.start, e.end]; + return n.sort(st), { start: n[0].clone(), end: n[3].clone() }; + }, + renderHighlight: function (t) { + this.renderFill('highlight', this.spanToSegs(t)); + }, + unrenderHighlight: function () { + this.unrenderFill('highlight'); + }, + highlightSegClasses: function () { + return ['fc-highlight']; + }, + renderBusinessHours: function () {}, + unrenderBusinessHours: function () {}, + getNowIndicatorUnit: function () {}, + renderNowIndicator: function (t) {}, + unrenderNowIndicator: function () {}, + renderFill: function (t, e) {}, + unrenderFill: function (t) { + var e = this.elsByFill[t]; + e && (e.remove(), delete this.elsByFill[t]); + }, + renderFillSegEls: function (e, n) { + var i, + r = this, + s = this[e + 'SegEl'], + o = '', + l = []; + if (n.length) { + for (i = 0; i < n.length; i++) o += this.fillSegHtml(e, n[i]); + t(o).each(function (e, i) { + var o = n[e], + a = t(i); + s && (a = s.call(r, o, a)), a && ((a = t(a)), a.is(r.fillSegTag) && ((o.el = a), l.push(o))); + }); + } + return l; + }, + fillSegTag: 'div', + fillSegHtml: function (t, e) { + var n = this[t + 'SegClasses'], + i = this[t + 'SegCss'], + r = n ? n.call(this, e) : [], + s = nt(i ? i.call(this, e) : {}); + return '<' + this.fillSegTag + (r.length ? ' class="' + r.join(' ') + '"' : '') + (s ? ' style="' + s + '"' : '') + ' />'; + }, + getDayClasses: function (t, e) { + var n = this.view, + i = n.calendar.getNow(), + r = ['fc-' + Xt[t.day()]]; + return ( + 1 == n.intervalDuration.as('months') && t.month() != n.intervalStart.month() && r.push('fc-other-month'), + t.isSame(i, 'day') + ? (r.push('fc-today'), e !== !0 && r.push(n.highlightStateClass)) + : t < i + ? r.push('fc-past') + : r.push('fc-future'), + r + ); + }, + })); + me.mixin({ + segSelector: '.fc-event-container > *', + mousedOverSeg: null, + isDraggingSeg: !1, + isResizingSeg: !1, + isDraggingExternal: !1, + segs: null, + renderEvents: function (t) { + var e, + n = [], + i = []; + for (e = 0; e < t.length; e++) (Rt(t[e]) ? n : i).push(t[e]); + this.segs = [].concat(this.renderBgEvents(n), this.renderFgEvents(i)); + }, + renderBgEvents: function (t) { + var e = this.eventsToSegs(t); + return this.renderBgSegs(e) || e; + }, + renderFgEvents: function (t) { + var e = this.eventsToSegs(t); + return this.renderFgSegs(e) || e; + }, + unrenderEvents: function () { + this.handleSegMouseout(), this.clearDragListeners(), this.unrenderFgSegs(), this.unrenderBgSegs(), (this.segs = null); + }, + getEventSegs: function () { + return this.segs || []; + }, + renderFgSegs: function (t) {}, + unrenderFgSegs: function () {}, + renderFgSegEls: function (e, n) { + var i, + r = this.view, + s = '', + o = []; + if (e.length) { + for (i = 0; i < e.length; i++) s += this.fgSegHtml(e[i], n); + t(s).each(function (n, i) { + var s = e[n], + l = r.resolveEventEl(s.event, t(i)); + l && (l.data('fc-seg', s), (s.el = l), o.push(s)); + }); + } + return o; + }, + fgSegHtml: function (t, e) {}, + renderBgSegs: function (t) { + return this.renderFill('bgEvent', t); + }, + unrenderBgSegs: function () { + this.unrenderFill('bgEvent'); + }, + bgEventSegEl: function (t, e) { + return this.view.resolveEventEl(t.event, e); + }, + bgEventSegClasses: function (t) { + var e = t.event, + n = e.source || {}; + return ['fc-bgevent'].concat(e.className, n.className || []); + }, + bgEventSegCss: function (t) { + return { 'background-color': this.getSegSkinCss(t)['background-color'] }; + }, + businessHoursSegClasses: function (t) { + return ['fc-nonbusiness', 'fc-bgevent']; + }, + buildBusinessHourSegs: function (t, e) { + return this.eventsToSegs(this.buildBusinessHourEvents(t, e)); + }, + buildBusinessHourEvents: function (e, n) { + var i, + r = this.view.calendar; + return ( + null == n && (n = r.options.businessHours), + (i = r.computeBusinessHourEvents(e, n)), + !i.length && n && (i = [t.extend({}, ke, { start: this.view.end, end: this.view.end, dow: null })]), + i + ); + }, + bindSegHandlers: function () { + this.bindSegHandlersToEl(this.el); + }, + bindSegHandlersToEl: function (t) { + this.bindSegHandlerToEl(t, 'touchstart', this.handleSegTouchStart), + this.bindSegHandlerToEl(t, 'touchend', this.handleSegTouchEnd), + this.bindSegHandlerToEl(t, 'mouseenter', this.handleSegMouseover), + this.bindSegHandlerToEl(t, 'mouseleave', this.handleSegMouseout), + this.bindSegHandlerToEl(t, 'mousedown', this.handleSegMousedown), + this.bindSegHandlerToEl(t, 'click', this.handleSegClick); + }, + bindSegHandlerToEl: function (e, n, i) { + var r = this; + e.on(n, this.segSelector, function (e) { + var n = t(this).data('fc-seg'); + if (n && !r.isDraggingSeg && !r.isResizingSeg) return i.call(r, n, e); + }); + }, + handleSegClick: function (t, e) { + var n = this.view.publiclyTrigger('eventClick', t.el[0], t.event, e); + n === !1 && e.preventDefault(); + }, + handleSegMouseover: function (t, e) { + this.isIgnoringMouse || + this.mousedOverSeg || + ((this.mousedOverSeg = t), + this.view.isEventResizable(t.event) && t.el.addClass('fc-allow-mouse-resize'), + this.view.publiclyTrigger('eventMouseover', t.el[0], t.event, e)); + }, + handleSegMouseout: function (t, e) { + (e = e || {}), + this.mousedOverSeg && + ((t = t || this.mousedOverSeg), + (this.mousedOverSeg = null), + this.view.isEventResizable(t.event) && t.el.removeClass('fc-allow-mouse-resize'), + this.view.publiclyTrigger('eventMouseout', t.el[0], t.event, e)); + }, + handleSegMousedown: function (t, e) { + var n = this.startSegResize(t, e, { distance: 5 }); + !n && this.view.isEventDraggable(t.event) && this.buildSegDragListener(t).startInteraction(e, { distance: 5 }); + }, + handleSegTouchStart: function (t, e) { + var n, + i, + r = this.view, + s = t.event, + o = r.isEventSelected(s), + l = r.isEventDraggable(s), + a = r.isEventResizable(s), + u = !1; + o && a && (u = this.startSegResize(t, e)), + u || + (!l && !a) || + ((i = r.opt('eventLongPressDelay')), + null == i && (i = r.opt('longPressDelay')), + (n = l ? this.buildSegDragListener(t) : this.buildSegSelectListener(t)), + n.startInteraction(e, { delay: o ? 0 : i })), + this.tempIgnoreMouse(); + }, + handleSegTouchEnd: function (t, e) { + this.tempIgnoreMouse(); + }, + startSegResize: function (e, n, i) { + return ( + !!t(n.target).is('.fc-resizer') && (this.buildSegResizeListener(e, t(n.target).is('.fc-start-resizer')).startInteraction(n, i), !0) + ); + }, + buildSegDragListener: function (t) { + var e, + n, + i, + r = this, + l = this.view, + a = l.calendar, + u = t.el, + c = t.event; + if (this.segDragListener) return this.segDragListener; + var d = (this.segDragListener = new pe(l, { + scroll: l.opt('dragScroll'), + subjectEl: u, + subjectCenter: !0, + interactionStart: function (i) { + (t.component = r), + (e = !1), + (n = new ve(t.el, { + additionalClass: 'fc-dragging', + parentEl: l.el, + opacity: d.isTouch ? null : l.opt('dragOpacity'), + revertDuration: l.opt('dragRevertDuration'), + zIndex: 2, + })), + n.hide(), + n.start(i); + }, + dragStart: function (n) { + d.isTouch && !l.isEventSelected(c) && l.selectEvent(c), (e = !0), r.handleSegMouseout(t, n), r.segDragStart(t, n), l.hideEvent(c); + }, + hitOver: function (e, o, u) { + var h; + t.hit && (u = t.hit), + (i = r.computeEventDrop(u.component.getHitSpan(u), e.component.getHitSpan(e), c)), + i && !a.isEventSpanAllowed(r.eventToSpan(i), c) && (s(), (i = null)), + i && (h = l.renderDrag(i, t)) ? (h.addClass('fc-dragging'), d.isTouch || r.applyDragOpacity(h), n.hide()) : n.show(), + o && (i = null); + }, + hitOut: function () { + l.unrenderDrag(), n.show(), (i = null); + }, + hitDone: function () { + o(); + }, + interactionEnd: function (s) { + delete t.component, + n.stop(!i, function () { + e && (l.unrenderDrag(), r.segDragStop(t, s)), i ? l.reportEventDrop(c, i, r.largeUnit, u, s) : l.showEvent(c); + }), + (r.segDragListener = null); + }, + })); + return d; + }, + buildSegSelectListener: function (t) { + var e = this, + n = this.view, + i = t.event; + if (this.segDragListener) return this.segDragListener; + var r = (this.segDragListener = new ge({ + dragStart: function (t) { + r.isTouch && !n.isEventSelected(i) && n.selectEvent(i); + }, + interactionEnd: function (t) { + e.segDragListener = null; + }, + })); + return r; + }, + segDragStart: function (t, e) { + (this.isDraggingSeg = !0), this.view.publiclyTrigger('eventDragStart', t.el[0], t.event, e, {}); + }, + segDragStop: function (t, e) { + (this.isDraggingSeg = !1), this.view.publiclyTrigger('eventDragStop', t.el[0], t.event, e, {}); + }, + computeEventDrop: function (t, e, n) { + var i, + r, + s = this.view.calendar, + o = t.start, + l = e.start; + return ( + o.hasTime() === l.hasTime() + ? ((i = this.diffDates(l, o)), + n.allDay && W(i) + ? ((r = { start: n.start.clone(), end: s.getEventEnd(n), allDay: !1 }), s.normalizeEventTimes(r)) + : (r = Ht(n)), + r.start.add(i), + r.end && r.end.add(i)) + : (r = { start: l.clone(), end: null, allDay: !l.hasTime() }), + r + ); + }, + applyDragOpacity: function (t) { + var e = this.view.opt('dragOpacity'); + null != e && t.css('opacity', e); + }, + externalDragStart: function (e, n) { + var i, + r, + s = this.view; + s.opt('droppable') && + ((i = t((n ? n.item : null) || e.target)), + (r = s.opt('dropAccept')), + (t.isFunction(r) ? r.call(i[0], i) : i.is(r)) && (this.isDraggingExternal || this.listenToExternalDrag(i, e, n))); + }, + listenToExternalDrag: function (t, e, n) { + var i, + r = this, + l = this.view.calendar, + a = Mt(t), + u = (r.externalDragListener = new pe(this, { + interactionStart: function () { + r.isDraggingExternal = !0; + }, + hitOver: function (t) { + (i = r.computeExternalDrop(t.component.getHitSpan(t), a)), + i && !l.isExternalSpanAllowed(r.eventToSpan(i), i, a.eventProps) && (s(), (i = null)), + i && r.renderDrag(i); + }, + hitOut: function () { + i = null; + }, + hitDone: function () { + o(), r.unrenderDrag(); + }, + interactionEnd: function (e) { + i && r.view.reportExternalDrop(a, i, t, e, n), (r.isDraggingExternal = !1), (r.externalDragListener = null); + }, + })); + u.startDrag(e); + }, + computeExternalDrop: function (t, e) { + var n = this.view.calendar, + i = { start: n.applyTimezone(t.start), end: null }; + return e.startTime && !i.start.hasTime() && i.start.time(e.startTime), e.duration && (i.end = i.start.clone().add(e.duration)), i; + }, + renderDrag: function (t, e) {}, + unrenderDrag: function () {}, + buildSegResizeListener: function (t, e) { + var n, + i, + r = this, + l = this.view, + a = l.calendar, + u = t.el, + c = t.event, + d = a.getEventEnd(c), + h = (this.segResizeListener = new pe(this, { + scroll: l.opt('dragScroll'), + subjectEl: u, + interactionStart: function () { + n = !1; + }, + dragStart: function (e) { + (n = !0), r.handleSegMouseout(t, e), r.segResizeStart(t, e); + }, + hitOver: function (n, o, u) { + var h = r.getHitSpan(u), + f = r.getHitSpan(n); + (i = e ? r.computeEventStartResize(h, f, c) : r.computeEventEndResize(h, f, c)), + i && + (a.isEventSpanAllowed(r.eventToSpan(i), c) + ? i.start.isSame(c.start.clone().stripZone()) && i.end.isSame(d.clone().stripZone()) && (i = null) + : (s(), (i = null))), + i && (l.hideEvent(c), r.renderEventResize(i, t)); + }, + hitOut: function () { + (i = null), l.showEvent(c); + }, + hitDone: function () { + r.unrenderEventResize(), o(); + }, + interactionEnd: function (e) { + n && r.segResizeStop(t, e), i ? l.reportEventResize(c, i, r.largeUnit, u, e) : l.showEvent(c), (r.segResizeListener = null); + }, + })); + return h; + }, + segResizeStart: function (t, e) { + (this.isResizingSeg = !0), this.view.publiclyTrigger('eventResizeStart', t.el[0], t.event, e, {}); + }, + segResizeStop: function (t, e) { + (this.isResizingSeg = !1), this.view.publiclyTrigger('eventResizeStop', t.el[0], t.event, e, {}); + }, + computeEventStartResize: function (t, e, n) { + return this.computeEventResize('start', t, e, n); + }, + computeEventEndResize: function (t, e, n) { + return this.computeEventResize('end', t, e, n); + }, + computeEventResize: function (t, e, n, i) { + var r, + s, + o = this.view.calendar, + l = this.diffDates(n[t], e[t]); + return ( + (r = { start: i.start.clone(), end: o.getEventEnd(i), allDay: i.allDay }), + r.allDay && W(l) && ((r.allDay = !1), o.normalizeEventTimes(r)), + r[t].add(l), + r.start.isBefore(r.end) || + ((s = this.minResizeDuration || (i.allDay ? o.defaultAllDayEventDuration : o.defaultTimedEventDuration)), + 'start' == t ? (r.start = r.end.clone().subtract(s)) : (r.end = r.start.clone().add(s))), + r + ); + }, + renderEventResize: function (t, e) {}, + unrenderEventResize: function () {}, + getEventTimeText: function (t, e, n) { + return ( + null == e && (e = this.eventTimeFormat), + null == n && (n = this.displayEventEnd), + this.displayEventTime && t.start.hasTime() ? (n && t.end ? this.view.formatRange(t, e) : t.start.format(e)) : '' + ); + }, + getSegClasses: function (t, e, n) { + var i = this.view, + r = ['fc-event', t.isStart ? 'fc-start' : 'fc-not-start', t.isEnd ? 'fc-end' : 'fc-not-end'].concat(this.getSegCustomClasses(t)); + return e && r.push('fc-draggable'), n && r.push('fc-resizable'), i.isEventSelected(t.event) && r.push('fc-selected'), r; + }, + getSegCustomClasses: function (t) { + var e = t.event; + return [].concat(e.className, e.source ? e.source.className : []); + }, + getSegSkinCss: function (t) { + return { + 'background-color': this.getSegBackgroundColor(t), + 'border-color': this.getSegBorderColor(t), + color: this.getSegTextColor(t), + }; + }, + getSegBackgroundColor: function (t) { + return t.event.backgroundColor || t.event.color || this.getSegDefaultBackgroundColor(t); + }, + getSegDefaultBackgroundColor: function (t) { + var e = t.event.source || {}; + return e.backgroundColor || e.color || this.view.opt('eventBackgroundColor') || this.view.opt('eventColor'); + }, + getSegBorderColor: function (t) { + return t.event.borderColor || t.event.color || this.getSegDefaultBorderColor(t); + }, + getSegDefaultBorderColor: function (t) { + var e = t.event.source || {}; + return e.borderColor || e.color || this.view.opt('eventBorderColor') || this.view.opt('eventColor'); + }, + getSegTextColor: function (t) { + return t.event.textColor || this.getSegDefaultTextColor(t); + }, + getSegDefaultTextColor: function (t) { + var e = t.event.source || {}; + return e.textColor || this.view.opt('eventTextColor'); + }, + eventToSegs: function (t) { + return this.eventsToSegs([t]); + }, + eventToSpan: function (t) { + return this.eventToSpans(t)[0]; + }, + eventToSpans: function (t) { + var e = this.eventToRange(t); + return this.eventRangeToSpans(e, t); + }, + eventsToSegs: function (e, n) { + var i = this, + r = kt(e), + s = []; + return ( + t.each(r, function (t, e) { + var r, + o = []; + for (r = 0; r < e.length; r++) o.push(i.eventToRange(e[r])); + if (xt(e[0])) for (o = i.invertRanges(o), r = 0; r < o.length; r++) s.push.apply(s, i.eventRangeToSegs(o[r], e[0], n)); + else for (r = 0; r < o.length; r++) s.push.apply(s, i.eventRangeToSegs(o[r], e[r], n)); + }), + s + ); + }, + eventToRange: function (t) { + var e = this.view.calendar, + n = t.start.clone().stripZone(), + i = (t.end ? t.end.clone() : e.getDefaultEventEnd(null != t.allDay ? t.allDay : !t.start.hasTime(), t.start)).stripZone(); + return e.localizeMoment(n), e.localizeMoment(i), { start: n, end: i }; + }, + eventRangeToSegs: function (t, e, n) { + var i, + r = this.eventRangeToSpans(t, e), + s = []; + for (i = 0; i < r.length; i++) s.push.apply(s, this.eventSpanToSegs(r[i], e, n)); + return s; + }, + eventRangeToSpans: function (e, n) { + return [t.extend({}, e)]; + }, + eventSpanToSegs: function (t, e, n) { + var i, + r, + s = n ? n(t) : this.spanToSegs(t); + for (i = 0; i < s.length; i++) (r = s[i]), (r.event = e), (r.eventStartMS = +t.start), (r.eventDurationMS = t.end - t.start); + return s; + }, + invertRanges: function (t) { + var e, + n, + i = this.view, + r = i.start.clone(), + s = i.end.clone(), + o = [], + l = r; + for (t.sort(Lt), e = 0; e < t.length; e++) (n = t[e]), n.start > l && o.push({ start: l, end: n.start }), (l = n.end); + return l < s && o.push({ start: l, end: s }), o; + }, + sortEventSegs: function (t) { + t.sort(lt(this, 'compareEventSegs')); + }, + compareEventSegs: function (t, e) { + return ( + t.eventStartMS - e.eventStartMS || + e.eventDurationMS - t.eventDurationMS || + e.event.allDay - t.event.allDay || + M(t.event, e.event, this.view.eventOrderSpecs) + ); + }, + }), + (qt.pluckEventDateProps = Ht), + (qt.isBgEvent = Rt), + (qt.dataAttrPrefix = ''); + var ye = (qt.DayTableMixin = { + breakOnWeeks: !1, + dayDates: null, + dayIndices: null, + daysPerRow: null, + rowCnt: null, + colCnt: null, + colHeadFormat: null, + updateDayTable: function () { + for (var t, e, n, i = this.view, r = this.start.clone(), s = -1, o = [], l = []; r.isBefore(this.end); ) + i.isHiddenDay(r) ? o.push(s + 0.5) : (s++, o.push(s), l.push(r.clone())), r.add(1, 'days'); + if (this.breakOnWeeks) { + for (e = l[0].day(), t = 1; t < l.length && l[t].day() != e; t++); + n = Math.ceil(l.length / t); + } else (n = 1), (t = l.length); + (this.dayDates = l), (this.dayIndices = o), (this.daysPerRow = t), (this.rowCnt = n), this.updateDayTableCols(); + }, + updateDayTableCols: function () { + (this.colCnt = this.computeColCnt()), (this.colHeadFormat = this.view.opt('columnFormat') || this.computeColHeadFormat()); + }, + computeColCnt: function () { + return this.daysPerRow; + }, + getCellDate: function (t, e) { + return this.dayDates[this.getCellDayIndex(t, e)].clone(); + }, + getCellRange: function (t, e) { + var n = this.getCellDate(t, e), + i = n.clone().add(1, 'days'); + return { start: n, end: i }; + }, + getCellDayIndex: function (t, e) { + return t * this.daysPerRow + this.getColDayIndex(e); + }, + getColDayIndex: function (t) { + return this.isRTL ? this.colCnt - 1 - t : t; + }, + getDateDayIndex: function (t) { + var e = this.dayIndices, + n = t.diff(this.start, 'days'); + return n < 0 ? e[0] - 1 : n >= e.length ? e[e.length - 1] + 1 : e[n]; + }, + computeColHeadFormat: function () { + return this.rowCnt > 1 || this.colCnt > 10 ? 'ddd' : this.colCnt > 1 ? this.view.opt('dayOfMonthFormat') : 'dddd'; + }, + sliceRangeByRow: function (t) { + var e, + n, + i, + r, + s, + o = this.daysPerRow, + l = this.view.computeDayRange(t), + a = this.getDateDayIndex(l.start), + u = this.getDateDayIndex(l.end.clone().subtract(1, 'days')), + c = []; + for (e = 0; e < this.rowCnt; e++) + (n = e * o), + (i = n + o - 1), + (r = Math.max(a, n)), + (s = Math.min(u, i)), + (r = Math.ceil(r)), + (s = Math.floor(s)), + r <= s && c.push({ row: e, firstRowDayIndex: r - n, lastRowDayIndex: s - n, isStart: r === a, isEnd: s === u }); + return c; + }, + sliceRangeByDay: function (t) { + var e, + n, + i, + r, + s, + o, + l = this.daysPerRow, + a = this.view.computeDayRange(t), + u = this.getDateDayIndex(a.start), + c = this.getDateDayIndex(a.end.clone().subtract(1, 'days')), + d = []; + for (e = 0; e < this.rowCnt; e++) + for (n = e * l, i = n + l - 1, r = n; r <= i; r++) + (s = Math.max(u, r)), + (o = Math.min(c, r)), + (s = Math.ceil(s)), + (o = Math.floor(o)), + s <= o && d.push({ row: e, firstRowDayIndex: s - n, lastRowDayIndex: o - n, isStart: s === u, isEnd: o === c }); + return d; + }, + renderHeadHtml: function () { + var t = this.view; + return '
').append( + $('').attr({ 'data-action': 'today', title: options.tooltips.today }).append($('').addClass(options.icons.today)) + ) + ); + } + if (!options.sideBySide && hasDate() && hasTime()) { + row.push( + $('').append( + $('') + .attr({ 'data-action': 'togglePicker', title: options.tooltips.selectTime }) + .append($('').addClass(options.icons.time)) + ) + ); + } + if (options.showClear) { + row.push( + $('').append( + $('').attr({ 'data-action': 'clear', title: options.tooltips.clear }).append($('').addClass(options.icons.clear)) + ) + ); + } + if (options.showClose) { + row.push( + $('').append( + $('').attr({ 'data-action': 'close', title: options.tooltips.close }).append($('').addClass(options.icons.close)) + ) + ); + } + return $('') + .addClass('table-condensed') + .append($('').append($('').append(row))); + }, + getTemplate = function () { + var template = $('
').addClass('bootstrap-datetimepicker-widget dropdown-menu'), + dateView = $('
').addClass('datepicker').append(getDatePickerTemplate()), + timeView = $('
').addClass('timepicker').append(getTimePickerTemplate()), + content = $('
    ').addClass('list-unstyled'), + toolbar = $('
  • ') + .addClass('picker-switch' + (options.collapse ? ' accordion-toggle' : '')) + .append(getToolbar()); + + if (options.inline) { + template.removeClass('dropdown-menu'); + } + + if (use24Hours) { + template.addClass('usetwentyfour'); + } + + if (isEnabled('s') && !use24Hours) { + template.addClass('wider'); + } + + if (options.sideBySide && hasDate() && hasTime()) { + template.addClass('timepicker-sbs'); + if (options.toolbarPlacement === 'top') { + template.append(toolbar); + } + template.append($('
    ').addClass('row').append(dateView.addClass('col-md-6')).append(timeView.addClass('col-md-6'))); + if (options.toolbarPlacement === 'bottom') { + template.append(toolbar); + } + return template; + } + + if (options.toolbarPlacement === 'top') { + content.append(toolbar); + } + if (hasDate()) { + content.append( + $('
  • ') + .addClass(options.collapse && hasTime() ? 'collapse in' : '') + .append(dateView) + ); + } + if (options.toolbarPlacement === 'default') { + content.append(toolbar); + } + if (hasTime()) { + content.append( + $('
  • ') + .addClass(options.collapse && hasDate() ? 'collapse' : '') + .append(timeView) + ); + } + if (options.toolbarPlacement === 'bottom') { + content.append(toolbar); + } + return template.append(content); + }, + dataToOptions = function () { + var eData, + dataOptions = {}; + + if (element.is('input') || options.inline) { + eData = element.data(); + } else { + eData = element.find('input').data(); + } + + if (eData.dateOptions && eData.dateOptions instanceof Object) { + dataOptions = $.extend(true, dataOptions, eData.dateOptions); + } + + $.each(options, function (key) { + var attributeName = 'date' + key.charAt(0).toUpperCase() + key.slice(1); + if (eData[attributeName] !== undefined) { + dataOptions[key] = eData[attributeName]; + } + }); + return dataOptions; + }, + place = function () { + var position = (component || element).position(), + offset = (component || element).offset(), + vertical = options.widgetPositioning.vertical, + horizontal = options.widgetPositioning.horizontal, + parent; + + if (options.widgetParent) { + parent = options.widgetParent.append(widget); + } else if (element.is('input')) { + parent = element.after(widget).parent(); + } else if (options.inline) { + parent = element.append(widget); + return; + } else { + parent = element; + element.children().first().after(widget); + } + + // Top and bottom logic + if (vertical === 'auto') { + if ( + offset.top + widget.height() * 1.5 >= $(window).height() + $(window).scrollTop() && + widget.height() + element.outerHeight() < offset.top + ) { + vertical = 'top'; + } else { + vertical = 'bottom'; + } + } + + // Left and right logic + if (horizontal === 'auto') { + if (parent.width() < offset.left + widget.outerWidth() / 2 && offset.left + widget.outerWidth() > $(window).width()) { + horizontal = 'right'; + } else { + horizontal = 'left'; + } + } + + if (vertical === 'top') { + widget.addClass('top').removeClass('bottom'); + } else { + widget.addClass('bottom').removeClass('top'); + } + + if (horizontal === 'right') { + widget.addClass('pull-right'); + } else { + widget.removeClass('pull-right'); + } + + // find the first parent element that has a non-static css positioning + if (parent.css('position') === 'static') { + parent = parent + .parents() + .filter(function () { + return $(this).css('position') !== 'static'; + }) + .first(); + } + + if (parent.length === 0) { + throw new Error('datetimepicker component should be placed within a non-static positioned container'); + } + + widget.css({ + top: vertical === 'top' ? 'auto' : position.top + element.outerHeight(), + bottom: vertical === 'top' ? parent.outerHeight() - (parent === element ? 0 : position.top) : 'auto', + left: horizontal === 'left' ? (parent === element ? 0 : position.left) : 'auto', + right: horizontal === 'left' ? 'auto' : parent.outerWidth() - element.outerWidth() - (parent === element ? 0 : position.left), + }); + + // Creative Tim Changes - we add after 180 ms the ".open" class, in this way the animations will be the same with the other dropdowns from the + setTimeout(function () { + widget.addClass('open'); + }, 180); + }, + notifyEvent = function (e) { + if (e.type === 'dp.change' && ((e.date && e.date.isSame(e.oldDate)) || (!e.date && !e.oldDate))) { + return; + } + element.trigger(e); + }, + viewUpdate = function (e) { + if (e === 'y') { + e = 'YYYY'; + } + notifyEvent({ + type: 'dp.update', + change: e, + viewDate: viewDate.clone(), + }); + }, + showMode = function (dir) { + if (!widget) { + return; + } + if (dir) { + currentViewMode = Math.max(minViewModeNumber, Math.min(3, currentViewMode + dir)); + } + widget + .find('.datepicker > div') + .hide() + .filter('.datepicker-' + datePickerModes[currentViewMode].clsName) + .show(); + }, + fillDow = function () { + var row = $('
'), + currentDate = viewDate.clone().startOf('w').startOf('d'); + + if (options.calendarWeeks === true) { + row.append($(''); + if (options.calendarWeeks) { + row.append(''); + } + html.push(row); + } + clsNames = ['day']; + if (currentDate.isBefore(viewDate, 'M')) { + clsNames.push('old'); + } + if (currentDate.isAfter(viewDate, 'M')) { + clsNames.push('new'); + } + if (currentDate.isSame(date, 'd') && !unset) { + clsNames.push('active'); + } + if (!isValid(currentDate, 'd')) { + clsNames.push('disabled'); + } + if (currentDate.isSame(getMoment(), 'd')) { + clsNames.push('today'); + } + if (currentDate.day() === 0 || currentDate.day() === 6) { + clsNames.push('weekend'); + } + notifyEvent({ + type: 'dp.classify', + date: currentDate, + classNames: clsNames, + }); + + // Creative Tim - we added a div inside each td for design purposes + row.append( + '' + ); + currentDate.add(1, 'd'); + } + + daysView.find('tbody').empty().append(html); + + updateMonths(); + + updateYears(); + + updateDecades(); + }, + fillHours = function () { + var table = widget.find('.timepicker-hours table'), + currentHour = viewDate.clone().startOf('d'), + html = [], + row = $(''); + + if (viewDate.hour() > 11 && !use24Hours) { + currentHour.hour(12); + } + while ( + currentHour.isSame(viewDate, 'd') && + (use24Hours || (viewDate.hour() < 12 && currentHour.hour() < 12) || viewDate.hour() > 11) + ) { + if (currentHour.hour() % 4 === 0) { + row = $(''); + html.push(row); + } + // Creative Tim - we added a div inside each class hour for design purposes + row.append( + '' + ); + currentHour.add(1, 'h'); + } + table.empty().append(html); + }, + fillMinutes = function () { + var table = widget.find('.timepicker-minutes table'), + currentMinute = viewDate.clone().startOf('h'), + html = [], + row = $(''), + step = options.stepping === 1 ? 5 : options.stepping; + + while (viewDate.isSame(currentMinute, 'h')) { + if (currentMinute.minute() % (step * 4) === 0) { + row = $(''); + html.push(row); + } + // Creative Tim - we added a div inside each class minute for design purposes + row.append( + '' + ); + currentMinute.add(step, 'm'); + } + table.empty().append(html); + }, + fillSeconds = function () { + var table = widget.find('.timepicker-seconds table'), + currentSecond = viewDate.clone().startOf('m'), + html = [], + row = $(''); + + while (viewDate.isSame(currentSecond, 'm')) { + if (currentSecond.second() % 20 === 0) { + row = $(''); + html.push(row); + } + // Creative Tim - we added a div inside each class seconds for design purposes + row.append( + '' + ); + currentSecond.add(5, 's'); + } + + table.empty().append(html); + }, + fillTime = function () { + var toggle, + newDate, + timeComponents = widget.find('.timepicker span[data-time-component]'); + + if (!use24Hours) { + toggle = widget.find('.timepicker [data-action=togglePeriod]'); + newDate = date.clone().add(date.hours() >= 12 ? -12 : 12, 'h'); + + toggle.text(date.format('A')); + + if (isValid(newDate, 'h')) { + toggle.removeClass('disabled'); + } else { + toggle.addClass('disabled'); + } + } + timeComponents.filter('[data-time-component=hours]').text(date.format(use24Hours ? 'HH' : 'hh')); + timeComponents.filter('[data-time-component=minutes]').text(date.format('mm')); + timeComponents.filter('[data-time-component=seconds]').text(date.format('ss')); + + fillHours(); + fillMinutes(); + fillSeconds(); + }, + update = function () { + if (!widget) { + return; + } + fillDate(); + fillTime(); + }, + setValue = function (targetMoment) { + var oldDate = unset ? null : date; + + // case of calling setValue(null or false) + if (!targetMoment) { + unset = true; + input.val(''); + element.data('date', ''); + notifyEvent({ + type: 'dp.change', + date: false, + oldDate: oldDate, + }); + update(); + return; + } + + targetMoment = targetMoment.clone().locale(options.locale); + + if (hasTimeZone()) { + targetMoment.tz(options.timeZone); + } + + if (options.stepping !== 1) { + targetMoment.minutes(Math.round(targetMoment.minutes() / options.stepping) * options.stepping).seconds(0); + + while (options.minDate && targetMoment.isBefore(options.minDate)) { + targetMoment.add(options.stepping, 'minutes'); + } + } + + if (isValid(targetMoment)) { + date = targetMoment; + viewDate = date.clone(); + input.val(date.format(actualFormat)); + element.data('date', date.format(actualFormat)); + unset = false; + update(); + notifyEvent({ + type: 'dp.change', + date: date.clone(), + oldDate: oldDate, + }); + } else { + if (!options.keepInvalid) { + input.val(unset ? '' : date.format(actualFormat)); + } else { + notifyEvent({ + type: 'dp.change', + date: targetMoment, + oldDate: oldDate, + }); + } + notifyEvent({ + type: 'dp.error', + date: targetMoment, + oldDate: oldDate, + }); + } + }, + /** + * Hides the widget. Possibly will emit dp.hide + */ + hide = function () { + var transitioning = false; + if (!widget) { + return picker; + } + // Ignore event if in the middle of a picker transition + widget.find('.collapse').each(function () { + var collapseData = $(this).data('collapse'); + if (collapseData && collapseData.transitioning) { + transitioning = true; + return false; + } + return true; + }); + if (transitioning) { + return picker; + } + if (component && component.hasClass('btn')) { + component.toggleClass('active'); + } + + $(window).off('resize', place); + widget.off('click', '[data-action]'); + widget.off('mousedown', false); + + // Creative Tim Changes - we remove the ".open" class, then, fter 400 ms call the .hide() method, in this way the animations will be the same with the other dropdowns from the dashboard + + widget.removeClass('open'); + + setTimeout(function () { + widget.remove(); + widget.hide(); + + widget = false; + + notifyEvent({ + type: 'dp.hide', + date: date.clone(), + }); + + input.blur(); + + currentViewMode = 0; + viewDate = date.clone(); + + return picker; + }, 400); + }, + clear = function () { + setValue(null); + }, + parseInputDate = function (inputDate) { + if (options.parseInputDate === undefined) { + if (!moment.isMoment(inputDate) || inputDate instanceof Date) { + inputDate = getMoment(inputDate); + } + } else { + inputDate = options.parseInputDate(inputDate); + } + //inputDate.locale(options.locale); + return inputDate; + }, + /******************************************************************************** + * + * Widget UI interaction functions + * + ********************************************************************************/ + actions = { + next: function () { + var navFnc = datePickerModes[currentViewMode].navFnc; + viewDate.add(datePickerModes[currentViewMode].navStep, navFnc); + fillDate(); + viewUpdate(navFnc); + }, + + previous: function () { + var navFnc = datePickerModes[currentViewMode].navFnc; + viewDate.subtract(datePickerModes[currentViewMode].navStep, navFnc); + fillDate(); + viewUpdate(navFnc); + }, + + pickerSwitch: function () { + showMode(1); + }, + + selectMonth: function (e) { + var month = $(e.target).closest('tbody').find('span').index($(e.target)); + viewDate.month(month); + if (currentViewMode === minViewModeNumber) { + setValue(date.clone().year(viewDate.year()).month(viewDate.month())); + if (!options.inline) { + hide(); + } + } else { + showMode(-1); + fillDate(); + } + viewUpdate('M'); + }, + + selectYear: function (e) { + var year = parseInt($(e.target).text(), 10) || 0; + viewDate.year(year); + if (currentViewMode === minViewModeNumber) { + setValue(date.clone().year(viewDate.year())); + if (!options.inline) { + hide(); + } + } else { + showMode(-1); + fillDate(); + } + viewUpdate('YYYY'); + }, + + selectDecade: function (e) { + var year = parseInt($(e.target).data('selection'), 10) || 0; + viewDate.year(year); + if (currentViewMode === minViewModeNumber) { + setValue(date.clone().year(viewDate.year())); + if (!options.inline) { + hide(); + } + } else { + showMode(-1); + fillDate(); + } + viewUpdate('YYYY'); + }, + + selectDay: function (e) { + var day = viewDate.clone(); + if ($(e.target).is('.old')) { + day.subtract(1, 'M'); + } + if ($(e.target).is('.new')) { + day.add(1, 'M'); + } + setValue(day.date(parseInt($(e.target).text(), 10))); + if (!hasTime() && !options.keepOpen && !options.inline) { + hide(); + } + }, + + incrementHours: function () { + var newDate = date.clone().add(1, 'h'); + if (isValid(newDate, 'h')) { + setValue(newDate); + } + }, + + incrementMinutes: function () { + var newDate = date.clone().add(options.stepping, 'm'); + if (isValid(newDate, 'm')) { + setValue(newDate); + } + }, + + incrementSeconds: function () { + var newDate = date.clone().add(1, 's'); + if (isValid(newDate, 's')) { + setValue(newDate); + } + }, + + decrementHours: function () { + var newDate = date.clone().subtract(1, 'h'); + if (isValid(newDate, 'h')) { + setValue(newDate); + } + }, + + decrementMinutes: function () { + var newDate = date.clone().subtract(options.stepping, 'm'); + if (isValid(newDate, 'm')) { + setValue(newDate); + } + }, + + decrementSeconds: function () { + var newDate = date.clone().subtract(1, 's'); + if (isValid(newDate, 's')) { + setValue(newDate); + } + }, + + togglePeriod: function () { + setValue(date.clone().add(date.hours() >= 12 ? -12 : 12, 'h')); + }, + + togglePicker: function (e) { + var $this = $(e.target), + $parent = $this.closest('ul'), + expanded = $parent.find('.in'), + closed = $parent.find('.collapse:not(.in)'), + collapseData; + + if (expanded && expanded.length) { + collapseData = expanded.data('collapse'); + if (collapseData && collapseData.transitioning) { + return; + } + if (expanded.collapse) { + // if collapse plugin is available through bootstrap.js then use it + expanded.collapse('hide'); + closed.collapse('show'); + } else { + // otherwise just toggle in class on the two views + expanded.removeClass('in'); + closed.addClass('in'); + } + if ($this.is('span')) { + $this.toggleClass(options.icons.time + ' ' + options.icons.date); + } else { + $this.find('span').toggleClass(options.icons.time + ' ' + options.icons.date); + } + + // NOTE: uncomment if toggled state will be restored in show() + //if (component) { + // component.find('span').toggleClass(options.icons.time + ' ' + options.icons.date); + //} + } + }, + + showPicker: function () { + widget.find('.timepicker > div:not(.timepicker-picker)').hide(); + widget.find('.timepicker .timepicker-picker').show(); + }, + + showHours: function () { + widget.find('.timepicker .timepicker-picker').hide(); + widget.find('.timepicker .timepicker-hours').show(); + }, + + showMinutes: function () { + widget.find('.timepicker .timepicker-picker').hide(); + widget.find('.timepicker .timepicker-minutes').show(); + }, + + showSeconds: function () { + widget.find('.timepicker .timepicker-picker').hide(); + widget.find('.timepicker .timepicker-seconds').show(); + }, + + selectHour: function (e) { + var hour = parseInt($(e.target).text(), 10); + + if (!use24Hours) { + if (date.hours() >= 12) { + if (hour !== 12) { + hour += 12; + } + } else { + if (hour === 12) { + hour = 0; + } + } + } + setValue(date.clone().hours(hour)); + actions.showPicker.call(picker); + }, + + selectMinute: function (e) { + setValue(date.clone().minutes(parseInt($(e.target).text(), 10))); + actions.showPicker.call(picker); + }, + + selectSecond: function (e) { + setValue(date.clone().seconds(parseInt($(e.target).text(), 10))); + actions.showPicker.call(picker); + }, + + clear: clear, + + today: function () { + var todaysDate = getMoment(); + if (isValid(todaysDate, 'd')) { + setValue(todaysDate); + } + }, + + close: hide, + }, + doAction = function (e) { + if ($(e.currentTarget).is('.disabled')) { + return false; + } + actions[$(e.currentTarget).data('action')].apply(picker, arguments); + return false; + }, + /** + * Shows the widget. Possibly will emit dp.show and dp.change + */ + show = function () { + var currentMoment, + useCurrentGranularity = { + year: function (m) { + return m.month(0).date(1).hours(0).seconds(0).minutes(0); + }, + month: function (m) { + return m.date(1).hours(0).seconds(0).minutes(0); + }, + day: function (m) { + return m.hours(0).seconds(0).minutes(0); + }, + hour: function (m) { + return m.seconds(0).minutes(0); + }, + minute: function (m) { + return m.seconds(0); + }, + }; + + if (input.prop('disabled') || (!options.ignoreReadonly && input.prop('readonly')) || widget) { + return picker; + } + if (input.val() !== undefined && input.val().trim().length !== 0) { + setValue(parseInputDate(input.val().trim())); + } else if (unset && options.useCurrent && (options.inline || (input.is('input') && input.val().trim().length === 0))) { + currentMoment = getMoment(); + if (typeof options.useCurrent === 'string') { + currentMoment = useCurrentGranularity[options.useCurrent](currentMoment); + } + setValue(currentMoment); + } + widget = getTemplate(); + + fillDow(); + fillMonths(); + + widget.find('.timepicker-hours').hide(); + widget.find('.timepicker-minutes').hide(); + widget.find('.timepicker-seconds').hide(); + + update(); + showMode(); + + $(window).on('resize', place); + widget.on('click', '[data-action]', doAction); // this handles clicks on the widget + widget.on('mousedown', false); + + if (component && component.hasClass('btn')) { + component.toggleClass('active'); + } + place(); + widget.show(); + if (options.focusOnShow && !input.is(':focus')) { + input.focus(); + } + + notifyEvent({ + type: 'dp.show', + }); + return picker; + }, + /** + * Shows or hides the widget + */ + toggle = function () { + return widget ? hide() : show(); + }, + keydown = function (e) { + var handler = null, + index, + index2, + pressedKeys = [], + pressedModifiers = {}, + currentKey = e.which, + keyBindKeys, + allModifiersPressed, + pressed = 'p'; + + keyState[currentKey] = pressed; + + for (index in keyState) { + if (keyState.hasOwnProperty(index) && keyState[index] === pressed) { + pressedKeys.push(index); + if (parseInt(index, 10) !== currentKey) { + pressedModifiers[index] = true; + } + } + } + + for (index in options.keyBinds) { + if (options.keyBinds.hasOwnProperty(index) && typeof options.keyBinds[index] === 'function') { + keyBindKeys = index.split(' '); + if (keyBindKeys.length === pressedKeys.length && keyMap[currentKey] === keyBindKeys[keyBindKeys.length - 1]) { + allModifiersPressed = true; + for (index2 = keyBindKeys.length - 2; index2 >= 0; index2--) { + if (!(keyMap[keyBindKeys[index2]] in pressedModifiers)) { + allModifiersPressed = false; + break; + } + } + if (allModifiersPressed) { + handler = options.keyBinds[index]; + break; + } + } + } + } + + if (handler) { + handler.call(picker, widget); + e.stopPropagation(); + e.preventDefault(); + } + }, + keyup = function (e) { + keyState[e.which] = 'r'; + e.stopPropagation(); + e.preventDefault(); + }, + change = function (e) { + var val = $(e.target).val().trim(), + parsedDate = val ? parseInputDate(val) : null; + setValue(parsedDate); + e.stopImmediatePropagation(); + return false; + }, + attachDatePickerElementEvents = function () { + input.on({ + change: change, + blur: options.debug ? '' : hide, + keydown: keydown, + keyup: keyup, + focus: options.allowInputToggle ? show : '', + }); + + if (element.is('input')) { + input.on({ + focus: show, + }); + } else if (component) { + component.on('click', toggle); + component.on('mousedown', false); + } + }, + detachDatePickerElementEvents = function () { + input.off({ + change: change, + blur: blur, + keydown: keydown, + keyup: keyup, + focus: options.allowInputToggle ? hide : '', + }); + + if (element.is('input')) { + input.off({ + focus: show, + }); + } else if (component) { + component.off('click', toggle); + component.off('mousedown', false); + } + }, + indexGivenDates = function (givenDatesArray) { + // Store given enabledDates and disabledDates as keys. + // This way we can check their existence in O(1) time instead of looping through whole array. + // (for example: options.enabledDates['2014-02-27'] === true) + var givenDatesIndexed = {}; + $.each(givenDatesArray, function () { + var dDate = parseInputDate(this); + if (dDate.isValid()) { + givenDatesIndexed[dDate.format('YYYY-MM-DD')] = true; + } + }); + return Object.keys(givenDatesIndexed).length ? givenDatesIndexed : false; + }, + indexGivenHours = function (givenHoursArray) { + // Store given enabledHours and disabledHours as keys. + // This way we can check their existence in O(1) time instead of looping through whole array. + // (for example: options.enabledHours['2014-02-27'] === true) + var givenHoursIndexed = {}; + $.each(givenHoursArray, function () { + givenHoursIndexed[this] = true; + }); + return Object.keys(givenHoursIndexed).length ? givenHoursIndexed : false; + }, + initFormatting = function () { + var format = options.format || 'L LT'; + + actualFormat = format.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) { + var newinput = date.localeData().longDateFormat(formatInput) || formatInput; + return newinput.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput2) { + //temp fix for #740 + return date.localeData().longDateFormat(formatInput2) || formatInput2; + }); + }); + + parseFormats = options.extraFormats ? options.extraFormats.slice() : []; + if (parseFormats.indexOf(format) < 0 && parseFormats.indexOf(actualFormat) < 0) { + parseFormats.push(actualFormat); + } + + use24Hours = actualFormat.toLowerCase().indexOf('a') < 1 && actualFormat.replace(/\[.*?\]/g, '').indexOf('h') < 1; + + if (isEnabled('y')) { + minViewModeNumber = 2; + } + if (isEnabled('M')) { + minViewModeNumber = 1; + } + if (isEnabled('d')) { + minViewModeNumber = 0; + } + + currentViewMode = Math.max(minViewModeNumber, currentViewMode); + + if (!unset) { + setValue(date); + } + }; + + /******************************************************************************** + * + * Public API functions + * ===================== + * + * Important: Do not expose direct references to private objects or the options + * object to the outer world. Always return a clone when returning values or make + * a clone when setting a private variable. + * + ********************************************************************************/ + picker.destroy = function () { + ///Destroys the widget and removes all attached event listeners + hide(); + detachDatePickerElementEvents(); + element.removeData('DateTimePicker'); + element.removeData('date'); + }; + + picker.toggle = toggle; + + picker.show = show; + + picker.hide = hide; + + picker.disable = function () { + ///Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. + ///If the widget was visible before that call it is hidden. Possibly emits dp.hide + hide(); + if (component && component.hasClass('btn')) { + component.addClass('disabled'); + } + input.prop('disabled', true); + return picker; + }; + + picker.enable = function () { + ///Enables the input element, the component is attached to, by removing disabled attribute from it. + if (component && component.hasClass('btn')) { + component.removeClass('disabled'); + } + input.prop('disabled', false); + return picker; + }; + + picker.ignoreReadonly = function (ignoreReadonly) { + if (arguments.length === 0) { + return options.ignoreReadonly; + } + if (typeof ignoreReadonly !== 'boolean') { + throw new TypeError('ignoreReadonly () expects a boolean parameter'); + } + options.ignoreReadonly = ignoreReadonly; + return picker; + }; + + picker.options = function (newOptions) { + if (arguments.length === 0) { + return $.extend(true, {}, options); + } + + if (!(newOptions instanceof Object)) { + throw new TypeError('options() options parameter should be an object'); + } + $.extend(true, options, newOptions); + $.each(options, function (key, value) { + if (picker[key] !== undefined) { + picker[key](value); + } else { + throw new TypeError('option ' + key + ' is not recognized!'); + } + }); + return picker; + }; + + picker.date = function (newDate) { + /// + ///Returns the component's model current date, a moment object or null if not set. + ///date.clone() + /// + /// + ///Sets the components model current moment to it. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration. + ///Takes string, Date, moment, null parameter. + /// + if (arguments.length === 0) { + if (unset) { + return null; + } + return date.clone(); + } + + if (newDate !== null && typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) { + throw new TypeError('date() parameter must be one of [null, string, moment or Date]'); + } + + setValue(newDate === null ? null : parseInputDate(newDate)); + return picker; + }; + + picker.format = function (newFormat) { + ///test su + ///info about para + ///returns foo + if (arguments.length === 0) { + return options.format; + } + + if (typeof newFormat !== 'string' && (typeof newFormat !== 'boolean' || newFormat !== false)) { + throw new TypeError('format() expects a string or boolean:false parameter ' + newFormat); + } + + options.format = newFormat; + if (actualFormat) { + initFormatting(); // reinit formatting + } + return picker; + }; + + picker.timeZone = function (newZone) { + if (arguments.length === 0) { + return options.timeZone; + } + + if (typeof newZone !== 'string') { + throw new TypeError('newZone() expects a string parameter'); + } + + options.timeZone = newZone; + + return picker; + }; + + picker.dayViewHeaderFormat = function (newFormat) { + if (arguments.length === 0) { + return options.dayViewHeaderFormat; + } + + if (typeof newFormat !== 'string') { + throw new TypeError('dayViewHeaderFormat() expects a string parameter'); + } + + options.dayViewHeaderFormat = newFormat; + return picker; + }; + + picker.extraFormats = function (formats) { + if (arguments.length === 0) { + return options.extraFormats; + } + + if (formats !== false && !(formats instanceof Array)) { + throw new TypeError('extraFormats() expects an array or false parameter'); + } + + options.extraFormats = formats; + if (parseFormats) { + initFormatting(); // reinit formatting + } + return picker; + }; + + picker.disabledDates = function (dates) { + /// + ///Returns an array with the currently set disabled dates on the component. + ///options.disabledDates + /// + /// + ///Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of + ///options.enabledDates if such exist. + ///Takes an [ string or Date or moment ] of values and allows the user to select only from those days. + /// + if (arguments.length === 0) { + return options.disabledDates ? $.extend({}, options.disabledDates) : options.disabledDates; + } + + if (!dates) { + options.disabledDates = false; + update(); + return picker; + } + if (!(dates instanceof Array)) { + throw new TypeError('disabledDates() expects an array parameter'); + } + options.disabledDates = indexGivenDates(dates); + options.enabledDates = false; + update(); + return picker; + }; + + picker.enabledDates = function (dates) { + /// + ///Returns an array with the currently set enabled dates on the component. + ///options.enabledDates + /// + /// + ///Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of options.disabledDates if such exist. + ///Takes an [ string or Date or moment ] of values and allows the user to select only from those days. + /// + if (arguments.length === 0) { + return options.enabledDates ? $.extend({}, options.enabledDates) : options.enabledDates; + } + + if (!dates) { + options.enabledDates = false; + update(); + return picker; + } + if (!(dates instanceof Array)) { + throw new TypeError('enabledDates() expects an array parameter'); + } + options.enabledDates = indexGivenDates(dates); + options.disabledDates = false; + update(); + return picker; + }; + + picker.daysOfWeekDisabled = function (daysOfWeekDisabled) { + if (arguments.length === 0) { + return options.daysOfWeekDisabled.splice(0); + } + + if (typeof daysOfWeekDisabled === 'boolean' && !daysOfWeekDisabled) { + options.daysOfWeekDisabled = false; + update(); + return picker; + } + + if (!(daysOfWeekDisabled instanceof Array)) { + throw new TypeError('daysOfWeekDisabled() expects an array parameter'); + } + options.daysOfWeekDisabled = daysOfWeekDisabled + .reduce(function (previousValue, currentValue) { + currentValue = parseInt(currentValue, 10); + if (currentValue > 6 || currentValue < 0 || isNaN(currentValue)) { + return previousValue; + } + if (previousValue.indexOf(currentValue) === -1) { + previousValue.push(currentValue); + } + return previousValue; + }, []) + .sort(); + if (options.useCurrent && !options.keepInvalid) { + var tries = 0; + while (!isValid(date, 'd')) { + date.add(1, 'd'); + if (tries === 31) { + throw 'Tried 31 times to find a valid date'; + } + tries++; + } + setValue(date); + } + update(); + return picker; + }; + + picker.maxDate = function (maxDate) { + if (arguments.length === 0) { + return options.maxDate ? options.maxDate.clone() : options.maxDate; + } + + if (typeof maxDate === 'boolean' && maxDate === false) { + options.maxDate = false; + update(); + return picker; + } + + if (typeof maxDate === 'string') { + if (maxDate === 'now' || maxDate === 'moment') { + maxDate = getMoment(); + } + } + + var parsedDate = parseInputDate(maxDate); + + if (!parsedDate.isValid()) { + throw new TypeError('maxDate() Could not parse date parameter: ' + maxDate); + } + if (options.minDate && parsedDate.isBefore(options.minDate)) { + throw new TypeError('maxDate() date parameter is before options.minDate: ' + parsedDate.format(actualFormat)); + } + options.maxDate = parsedDate; + if (options.useCurrent && !options.keepInvalid && date.isAfter(maxDate)) { + setValue(options.maxDate); + } + if (viewDate.isAfter(parsedDate)) { + viewDate = parsedDate.clone().subtract(options.stepping, 'm'); + } + update(); + return picker; + }; + + picker.minDate = function (minDate) { + if (arguments.length === 0) { + return options.minDate ? options.minDate.clone() : options.minDate; + } + + if (typeof minDate === 'boolean' && minDate === false) { + options.minDate = false; + update(); + return picker; + } + + if (typeof minDate === 'string') { + if (minDate === 'now' || minDate === 'moment') { + minDate = getMoment(); + } + } + + var parsedDate = parseInputDate(minDate); + + if (!parsedDate.isValid()) { + throw new TypeError('minDate() Could not parse date parameter: ' + minDate); + } + if (options.maxDate && parsedDate.isAfter(options.maxDate)) { + throw new TypeError('minDate() date parameter is after options.maxDate: ' + parsedDate.format(actualFormat)); + } + options.minDate = parsedDate; + if (options.useCurrent && !options.keepInvalid && date.isBefore(minDate)) { + setValue(options.minDate); + } + if (viewDate.isBefore(parsedDate)) { + viewDate = parsedDate.clone().add(options.stepping, 'm'); + } + update(); + return picker; + }; + + picker.defaultDate = function (defaultDate) { + /// + ///Returns a moment with the options.defaultDate option configuration or false if not set + ///date.clone() + /// + /// + ///Will set the picker's inital date. If a boolean:false value is passed the options.defaultDate parameter is cleared. + ///Takes a string, Date, moment, boolean:false + /// + if (arguments.length === 0) { + return options.defaultDate ? options.defaultDate.clone() : options.defaultDate; + } + if (!defaultDate) { + options.defaultDate = false; + return picker; + } + + if (typeof defaultDate === 'string') { + if (defaultDate === 'now' || defaultDate === 'moment') { + defaultDate = getMoment(); + } else { + defaultDate = getMoment(defaultDate); + } + } + + var parsedDate = parseInputDate(defaultDate); + if (!parsedDate.isValid()) { + throw new TypeError('defaultDate() Could not parse date parameter: ' + defaultDate); + } + if (!isValid(parsedDate)) { + throw new TypeError('defaultDate() date passed is invalid according to component setup validations'); + } + + options.defaultDate = parsedDate; + + if ((options.defaultDate && options.inline) || input.val().trim() === '') { + setValue(options.defaultDate); + } + return picker; + }; + + picker.locale = function (locale) { + if (arguments.length === 0) { + return options.locale; + } + + if (!moment.localeData(locale)) { + throw new TypeError('locale() locale ' + locale + ' is not loaded from moment locales!'); + } + + options.locale = locale; + date.locale(options.locale); + viewDate.locale(options.locale); + + if (actualFormat) { + initFormatting(); // reinit formatting + } + if (widget) { + hide(); + show(); + } + return picker; + }; + + picker.stepping = function (stepping) { + if (arguments.length === 0) { + return options.stepping; + } + + stepping = parseInt(stepping, 10); + if (isNaN(stepping) || stepping < 1) { + stepping = 1; + } + options.stepping = stepping; + return picker; + }; + + picker.useCurrent = function (useCurrent) { + var useCurrentOptions = ['year', 'month', 'day', 'hour', 'minute']; + if (arguments.length === 0) { + return options.useCurrent; + } + + if (typeof useCurrent !== 'boolean' && typeof useCurrent !== 'string') { + throw new TypeError('useCurrent() expects a boolean or string parameter'); + } + if (typeof useCurrent === 'string' && useCurrentOptions.indexOf(useCurrent.toLowerCase()) === -1) { + throw new TypeError('useCurrent() expects a string parameter of ' + useCurrentOptions.join(', ')); + } + options.useCurrent = useCurrent; + return picker; + }; + + picker.collapse = function (collapse) { + if (arguments.length === 0) { + return options.collapse; + } + + if (typeof collapse !== 'boolean') { + throw new TypeError('collapse() expects a boolean parameter'); + } + if (options.collapse === collapse) { + return picker; + } + options.collapse = collapse; + if (widget) { + hide(); + show(); + } + return picker; + }; + + picker.icons = function (icons) { + if (arguments.length === 0) { + return $.extend({}, options.icons); + } + + if (!(icons instanceof Object)) { + throw new TypeError('icons() expects parameter to be an Object'); + } + $.extend(options.icons, icons); + if (widget) { + hide(); + show(); + } + return picker; + }; + + picker.tooltips = function (tooltips) { + if (arguments.length === 0) { + return $.extend({}, options.tooltips); + } + + if (!(tooltips instanceof Object)) { + throw new TypeError('tooltips() expects parameter to be an Object'); + } + $.extend(options.tooltips, tooltips); + if (widget) { + hide(); + show(); + } + return picker; + }; + + picker.useStrict = function (useStrict) { + if (arguments.length === 0) { + return options.useStrict; + } + + if (typeof useStrict !== 'boolean') { + throw new TypeError('useStrict() expects a boolean parameter'); + } + options.useStrict = useStrict; + return picker; + }; + + picker.sideBySide = function (sideBySide) { + if (arguments.length === 0) { + return options.sideBySide; + } + + if (typeof sideBySide !== 'boolean') { + throw new TypeError('sideBySide() expects a boolean parameter'); + } + options.sideBySide = sideBySide; + if (widget) { + hide(); + show(); + } + return picker; + }; + + picker.viewMode = function (viewMode) { + if (arguments.length === 0) { + return options.viewMode; + } + + if (typeof viewMode !== 'string') { + throw new TypeError('viewMode() expects a string parameter'); + } + + if (viewModes.indexOf(viewMode) === -1) { + throw new TypeError('viewMode() parameter must be one of (' + viewModes.join(', ') + ') value'); + } + + options.viewMode = viewMode; + currentViewMode = Math.max(viewModes.indexOf(viewMode), minViewModeNumber); + + showMode(); + return picker; + }; + + picker.toolbarPlacement = function (toolbarPlacement) { + if (arguments.length === 0) { + return options.toolbarPlacement; + } + + if (typeof toolbarPlacement !== 'string') { + throw new TypeError('toolbarPlacement() expects a string parameter'); + } + if (toolbarPlacements.indexOf(toolbarPlacement) === -1) { + throw new TypeError('toolbarPlacement() parameter must be one of (' + toolbarPlacements.join(', ') + ') value'); + } + options.toolbarPlacement = toolbarPlacement; + + if (widget) { + hide(); + show(); + } + return picker; + }; + + picker.widgetPositioning = function (widgetPositioning) { + if (arguments.length === 0) { + return $.extend({}, options.widgetPositioning); + } + + if ({}.toString.call(widgetPositioning) !== '[object Object]') { + throw new TypeError('widgetPositioning() expects an object variable'); + } + if (widgetPositioning.horizontal) { + if (typeof widgetPositioning.horizontal !== 'string') { + throw new TypeError('widgetPositioning() horizontal variable must be a string'); + } + widgetPositioning.horizontal = widgetPositioning.horizontal.toLowerCase(); + if (horizontalModes.indexOf(widgetPositioning.horizontal) === -1) { + throw new TypeError('widgetPositioning() expects horizontal parameter to be one of (' + horizontalModes.join(', ') + ')'); + } + options.widgetPositioning.horizontal = widgetPositioning.horizontal; + } + if (widgetPositioning.vertical) { + if (typeof widgetPositioning.vertical !== 'string') { + throw new TypeError('widgetPositioning() vertical variable must be a string'); + } + widgetPositioning.vertical = widgetPositioning.vertical.toLowerCase(); + if (verticalModes.indexOf(widgetPositioning.vertical) === -1) { + throw new TypeError('widgetPositioning() expects vertical parameter to be one of (' + verticalModes.join(', ') + ')'); + } + options.widgetPositioning.vertical = widgetPositioning.vertical; + } + update(); + return picker; + }; + + picker.calendarWeeks = function (calendarWeeks) { + if (arguments.length === 0) { + return options.calendarWeeks; + } + + if (typeof calendarWeeks !== 'boolean') { + throw new TypeError('calendarWeeks() expects parameter to be a boolean value'); + } + + options.calendarWeeks = calendarWeeks; + update(); + return picker; + }; + + picker.showTodayButton = function (showTodayButton) { + if (arguments.length === 0) { + return options.showTodayButton; + } + + if (typeof showTodayButton !== 'boolean') { + throw new TypeError('showTodayButton() expects a boolean parameter'); + } + + options.showTodayButton = showTodayButton; + if (widget) { + hide(); + show(); + } + return picker; + }; + + picker.showClear = function (showClear) { + if (arguments.length === 0) { + return options.showClear; + } + + if (typeof showClear !== 'boolean') { + throw new TypeError('showClear() expects a boolean parameter'); + } + + options.showClear = showClear; + if (widget) { + hide(); + show(); + } + return picker; + }; + + picker.widgetParent = function (widgetParent) { + if (arguments.length === 0) { + return options.widgetParent; + } + + if (typeof widgetParent === 'string') { + widgetParent = $(widgetParent); + } + + if (widgetParent !== null && typeof widgetParent !== 'string' && !(widgetParent instanceof $)) { + throw new TypeError('widgetParent() expects a string or a jQuery object parameter'); + } + + options.widgetParent = widgetParent; + if (widget) { + hide(); + show(); + } + return picker; + }; + + picker.keepOpen = function (keepOpen) { + if (arguments.length === 0) { + return options.keepOpen; + } + + if (typeof keepOpen !== 'boolean') { + throw new TypeError('keepOpen() expects a boolean parameter'); + } + + options.keepOpen = keepOpen; + return picker; + }; + + picker.focusOnShow = function (focusOnShow) { + if (arguments.length === 0) { + return options.focusOnShow; + } + + if (typeof focusOnShow !== 'boolean') { + throw new TypeError('focusOnShow() expects a boolean parameter'); + } + + options.focusOnShow = focusOnShow; + return picker; + }; + + picker.inline = function (inline) { + if (arguments.length === 0) { + return options.inline; + } + + if (typeof inline !== 'boolean') { + throw new TypeError('inline() expects a boolean parameter'); + } + + options.inline = inline; + return picker; + }; + + picker.clear = function () { + clear(); + return picker; + }; + + picker.keyBinds = function (keyBinds) { + if (arguments.length === 0) { + return options.keyBinds; + } + + options.keyBinds = keyBinds; + return picker; + }; + + picker.getMoment = function (d) { + return getMoment(d); + }; + + picker.debug = function (debug) { + if (typeof debug !== 'boolean') { + throw new TypeError('debug() expects a boolean parameter'); + } + + options.debug = debug; + return picker; + }; + + picker.allowInputToggle = function (allowInputToggle) { + if (arguments.length === 0) { + return options.allowInputToggle; + } + + if (typeof allowInputToggle !== 'boolean') { + throw new TypeError('allowInputToggle() expects a boolean parameter'); + } + + options.allowInputToggle = allowInputToggle; + return picker; + }; + + picker.showClose = function (showClose) { + if (arguments.length === 0) { + return options.showClose; + } + + if (typeof showClose !== 'boolean') { + throw new TypeError('showClose() expects a boolean parameter'); + } + + options.showClose = showClose; + return picker; + }; + + picker.keepInvalid = function (keepInvalid) { + if (arguments.length === 0) { + return options.keepInvalid; + } + + if (typeof keepInvalid !== 'boolean') { + throw new TypeError('keepInvalid() expects a boolean parameter'); + } + options.keepInvalid = keepInvalid; + return picker; + }; + + picker.datepickerInput = function (datepickerInput) { + if (arguments.length === 0) { + return options.datepickerInput; + } + + if (typeof datepickerInput !== 'string') { + throw new TypeError('datepickerInput() expects a string parameter'); + } + + options.datepickerInput = datepickerInput; + return picker; + }; + + picker.parseInputDate = function (parseInputDate) { + if (arguments.length === 0) { + return options.parseInputDate; + } + + if (typeof parseInputDate !== 'function') { + throw new TypeError('parseInputDate() sholud be as function'); + } + + options.parseInputDate = parseInputDate; + + return picker; + }; + + picker.disabledTimeIntervals = function (disabledTimeIntervals) { + /// + ///Returns an array with the currently set disabled dates on the component. + ///options.disabledTimeIntervals + /// + /// + ///Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of + ///options.enabledDates if such exist. + ///Takes an [ string or Date or moment ] of values and allows the user to select only from those days. + /// + if (arguments.length === 0) { + return options.disabledTimeIntervals ? $.extend({}, options.disabledTimeIntervals) : options.disabledTimeIntervals; + } + + if (!disabledTimeIntervals) { + options.disabledTimeIntervals = false; + update(); + return picker; + } + if (!(disabledTimeIntervals instanceof Array)) { + throw new TypeError('disabledTimeIntervals() expects an array parameter'); + } + options.disabledTimeIntervals = disabledTimeIntervals; + update(); + return picker; + }; + + picker.disabledHours = function (hours) { + /// + ///Returns an array with the currently set disabled hours on the component. + ///options.disabledHours + /// + /// + ///Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of + ///options.enabledHours if such exist. + ///Takes an [ int ] of values and disallows the user to select only from those hours. + /// + if (arguments.length === 0) { + return options.disabledHours ? $.extend({}, options.disabledHours) : options.disabledHours; + } + + if (!hours) { + options.disabledHours = false; + update(); + return picker; + } + if (!(hours instanceof Array)) { + throw new TypeError('disabledHours() expects an array parameter'); + } + options.disabledHours = indexGivenHours(hours); + options.enabledHours = false; + if (options.useCurrent && !options.keepInvalid) { + var tries = 0; + while (!isValid(date, 'h')) { + date.add(1, 'h'); + if (tries === 24) { + throw 'Tried 24 times to find a valid date'; + } + tries++; + } + setValue(date); + } + update(); + return picker; + }; + + picker.enabledHours = function (hours) { + /// + ///Returns an array with the currently set enabled hours on the component. + ///options.enabledHours + /// + /// + ///Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of options.disabledHours if such exist. + ///Takes an [ int ] of values and allows the user to select only from those hours. + /// + if (arguments.length === 0) { + return options.enabledHours ? $.extend({}, options.enabledHours) : options.enabledHours; + } + + if (!hours) { + options.enabledHours = false; + update(); + return picker; + } + if (!(hours instanceof Array)) { + throw new TypeError('enabledHours() expects an array parameter'); + } + options.enabledHours = indexGivenHours(hours); + options.disabledHours = false; + if (options.useCurrent && !options.keepInvalid) { + var tries = 0; + while (!isValid(date, 'h')) { + date.add(1, 'h'); + if (tries === 24) { + throw 'Tried 24 times to find a valid date'; + } + tries++; + } + setValue(date); + } + update(); + return picker; + }; + /** + * Returns the component's model current viewDate, a moment object or null if not set. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration. + * @param {Takes string, viewDate, moment, null parameter.} newDate + * @returns {viewDate.clone()} + */ + picker.viewDate = function (newDate) { + if (arguments.length === 0) { + return viewDate.clone(); + } + + if (!newDate) { + viewDate = date.clone(); + return picker; + } + + if (typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) { + throw new TypeError('viewDate() parameter must be one of [string, moment or Date]'); + } + + viewDate = parseInputDate(newDate); + viewUpdate(); + return picker; + }; + + // initializing element and component attributes + if (element.is('input')) { + input = element; + } else { + input = element.find(options.datepickerInput); + if (input.length === 0) { + input = element.find('input'); + } else if (!input.is('input')) { + throw new Error('CSS class "' + options.datepickerInput + '" cannot be applied to non input element'); + } + } + + if (element.hasClass('input-group')) { + // in case there is more then one 'input-group-addon' Issue #48 + if (element.find('.datepickerbutton').length === 0) { + component = element.find('.input-group-addon'); + } else { + component = element.find('.datepickerbutton'); + } + } + + if (!options.inline && !input.is('input')) { + throw new Error('Could not initialize DateTimePicker without an input element'); + } + + // Set defaults for date here now instead of in var declaration + date = getMoment(); + viewDate = date.clone(); + + $.extend(true, options, dataToOptions()); + + picker.options(options); + + initFormatting(); + + attachDatePickerElementEvents(); + + if (input.prop('disabled')) { + picker.disable(); + } + if (input.is('input') && input.val().trim().length !== 0) { + setValue(parseInputDate(input.val().trim())); + } else if (options.defaultDate && input.attr('placeholder') === undefined) { + setValue(options.defaultDate); + } + if (options.inline) { + show(); + } + return picker; + }; + + /******************************************************************************** + * + * jQuery plugin constructor and defaults object + * + ********************************************************************************/ + + /** + * See (http://jquery.com/). + * @name jQuery + * @class + * See the jQuery Library (http://jquery.com/) for full details. This just + * documents the function and classes that are added to jQuery by this plug-in. + */ + /** + * See (http://jquery.com/) + * @name fn + * @class + * See the jQuery Library (http://jquery.com/) for full details. This just + * documents the function and classes that are added to jQuery by this plug-in. + * @memberOf jQuery + */ + /** + * Show comments + * @class datetimepicker + * @memberOf jQuery.fn + */ + $.fn.datetimepicker = function (options) { + options = options || {}; + + var args = Array.prototype.slice.call(arguments, 1), + isInstance = true, + thisMethods = ['destroy', 'hide', 'show', 'toggle'], + returnValue; + + if (typeof options === 'object') { + return this.each(function () { + var $this = $(this), + _options; + if (!$this.data('DateTimePicker')) { + // create a private copy of the defaults object + _options = $.extend(true, {}, $.fn.datetimepicker.defaults, options); + $this.data('DateTimePicker', dateTimePicker($this, _options)); + } + }); + } else if (typeof options === 'string') { + this.each(function () { + var $this = $(this), + instance = $this.data('DateTimePicker'); + if (!instance) { + throw new Error('bootstrap-datetimepicker("' + options + '") method was called on an element that is not using DateTimePicker'); + } + + returnValue = instance[options].apply(instance, args); + isInstance = returnValue === instance; + }); + + if (isInstance || $.inArray(options, thisMethods) > -1) { + return this; + } + + return returnValue; + } + + throw new TypeError('Invalid arguments for DateTimePicker: ' + options); + }; + + $.fn.datetimepicker.defaults = { + timeZone: '', + format: false, + dayViewHeaderFormat: 'MMMM YYYY', + extraFormats: false, + stepping: 1, + minDate: false, + maxDate: false, + useCurrent: true, + collapse: true, + locale: moment.locale(), + defaultDate: false, + disabledDates: false, + enabledDates: false, + icons: { + time: 'glyphicon glyphicon-time', + date: 'glyphicon glyphicon-calendar', + up: 'glyphicon glyphicon-chevron-up', + down: 'glyphicon glyphicon-chevron-down', + previous: 'glyphicon glyphicon-chevron-left', + next: 'glyphicon glyphicon-chevron-right', + today: 'glyphicon glyphicon-screenshot', + clear: 'glyphicon glyphicon-trash', + close: 'glyphicon glyphicon-remove', + }, + tooltips: { + today: 'Go to today', + clear: 'Clear selection', + close: 'Close the picker', + selectMonth: 'Select Month', + prevMonth: 'Previous Month', + nextMonth: 'Next Month', + selectYear: 'Select Year', + prevYear: 'Previous Year', + nextYear: 'Next Year', + selectDecade: 'Select Decade', + prevDecade: 'Previous Decade', + nextDecade: 'Next Decade', + prevCentury: 'Previous Century', + nextCentury: 'Next Century', + pickHour: 'Pick Hour', + incrementHour: 'Increment Hour', + decrementHour: 'Decrement Hour', + pickMinute: 'Pick Minute', + incrementMinute: 'Increment Minute', + decrementMinute: 'Decrement Minute', + pickSecond: 'Pick Second', + incrementSecond: 'Increment Second', + decrementSecond: 'Decrement Second', + togglePeriod: 'Toggle Period', + selectTime: 'Select Time', + }, + useStrict: false, + sideBySide: false, + daysOfWeekDisabled: false, + calendarWeeks: false, + viewMode: 'days', + toolbarPlacement: 'default', + showTodayButton: false, + showClear: false, + showClose: false, + widgetPositioning: { + horizontal: 'auto', + vertical: 'auto', + }, + widgetParent: null, + ignoreReadonly: false, + keepOpen: false, + focusOnShow: true, + inline: false, + keepInvalid: false, + datepickerInput: '.datepickerinput', + keyBinds: { + up: function (widget) { + if (!widget) { + return; + } + var d = this.date() || this.getMoment(); + if (widget.find('.datepicker').is(':visible')) { + this.date(d.clone().subtract(7, 'd')); + } else { + this.date(d.clone().add(this.stepping(), 'm')); + } + }, + down: function (widget) { + if (!widget) { + this.show(); + return; + } + var d = this.date() || this.getMoment(); + if (widget.find('.datepicker').is(':visible')) { + this.date(d.clone().add(7, 'd')); + } else { + this.date(d.clone().subtract(this.stepping(), 'm')); + } + }, + 'control up': function (widget) { + if (!widget) { + return; + } + var d = this.date() || this.getMoment(); + if (widget.find('.datepicker').is(':visible')) { + this.date(d.clone().subtract(1, 'y')); + } else { + this.date(d.clone().add(1, 'h')); + } + }, + 'control down': function (widget) { + if (!widget) { + return; + } + var d = this.date() || this.getMoment(); + if (widget.find('.datepicker').is(':visible')) { + this.date(d.clone().add(1, 'y')); + } else { + this.date(d.clone().subtract(1, 'h')); + } + }, + left: function (widget) { + if (!widget) { + return; + } + var d = this.date() || this.getMoment(); + if (widget.find('.datepicker').is(':visible')) { + this.date(d.clone().subtract(1, 'd')); + } + }, + right: function (widget) { + if (!widget) { + return; + } + var d = this.date() || this.getMoment(); + if (widget.find('.datepicker').is(':visible')) { + this.date(d.clone().add(1, 'd')); + } + }, + pageUp: function (widget) { + if (!widget) { + return; + } + var d = this.date() || this.getMoment(); + if (widget.find('.datepicker').is(':visible')) { + this.date(d.clone().subtract(1, 'M')); + } + }, + pageDown: function (widget) { + if (!widget) { + return; + } + var d = this.date() || this.getMoment(); + if (widget.find('.datepicker').is(':visible')) { + this.date(d.clone().add(1, 'M')); + } + }, + enter: function () { + this.hide(); + }, + escape: function () { + this.hide(); + }, + //tab: function (widget) { //this break the flow of the form. disabling for now + // var toggle = widget.find('.picker-switch a[data-action="togglePicker"]'); + // if(toggle.length > 0) toggle.click(); + //}, + 'control space': function (widget) { + if (!widget) { + return; + } + if (widget.find('.timepicker').is(':visible')) { + widget.find('.btn[data-action="togglePeriod"]').click(); + } + }, + t: function () { + this.date(this.getMoment()); + }, + delete: function () { + this.clear(); + }, + }, + debug: false, + allowInputToggle: false, + disabledTimeIntervals: false, + disabledHours: false, + enabledHours: false, + viewDate: false, + }; + + return $.fn.datetimepicker; +}); diff --git a/src/main/webapp/content/js/bootstrap-notify.js b/src/main/webapp/content/js/bootstrap-notify.js new file mode 100644 index 0000000..dfda6d3 --- /dev/null +++ b/src/main/webapp/content/js/bootstrap-notify.js @@ -0,0 +1,432 @@ +/* + + + + Creative Tim Modifications + + Lines: 239, 240 was changed from top: 5px to top: 50% and we added margin-top: -13px. In this way the close button will be aligned vertically + Line:242 - modified when the icon is set, we add the class "alert-with-icon", so there will be enough space for the icon. + + + + +*/ + +/* + * Project: Bootstrap Notify = v3.1.5 + * Description: Turns standard Bootstrap alerts into "Growl-like" notifications. + * Author: Mouse0270 aka Robert McIntosh + * License: MIT License + * Website: https://github.com/mouse0270/bootstrap-growl + */ + +/* global define:false, require: false, jQuery:false */ + +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS + factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } +})(function ($) { + // Create the defaults once + var defaults = { + element: 'body', + position: null, + type: 'info', + allow_dismiss: true, + allow_duplicates: true, + newest_on_top: false, + showProgressbar: false, + placement: { + from: 'top', + align: 'right', + }, + offset: 20, + spacing: 10, + z_index: 1031, + delay: 5000, + timer: 1000, + url_target: '_blank', + mouse_over: null, + animate: { + enter: 'animated fadeInDown', + exit: 'animated fadeOutUp', + }, + onShow: null, + onShown: null, + onClose: null, + onClosed: null, + icon_type: 'class', + template: + '', + }; + + String.format = function () { + var str = arguments[0]; + for (var i = 1; i < arguments.length; i++) { + str = str.replace(RegExp('\\{' + (i - 1) + '\\}', 'gm'), arguments[i]); + } + return str; + }; + + function isDuplicateNotification(notification) { + var isDupe = false; + + $('[data-notify="container"]').each(function (i, el) { + var $el = $(el); + var title = $el.find('[data-notify="title"]').text().trim(); + var message = $el.find('[data-notify="message"]').html().trim(); + + // The input string might be different than the actual parsed HTML string! + // (
vs
for example) + // So we have to force-parse this as HTML here! + var isSameTitle = + title === + $('
' + notification.settings.content.title + '
') + .html() + .trim(); + var isSameMsg = + message === + $('
' + notification.settings.content.message + '
') + .html() + .trim(); + var isSameType = $el.hasClass('alert-' + notification.settings.type); + + if (isSameTitle && isSameMsg && isSameType) { + //we found the dupe. Set the var and stop checking. + isDupe = true; + } + return !isDupe; + }); + + return isDupe; + } + + function Notify(element, content, options) { + // Setup Content of Notify + var contentObj = { + content: { + message: typeof content === 'object' ? content.message : content, + title: content.title ? content.title : '', + icon: content.icon ? content.icon : '', + url: content.url ? content.url : '#', + target: content.target ? content.target : '-', + }, + }; + + options = $.extend(true, {}, contentObj, options); + this.settings = $.extend(true, {}, defaults, options); + this._defaults = defaults; + if (this.settings.content.target === '-') { + this.settings.content.target = this.settings.url_target; + } + this.animations = { + start: 'webkitAnimationStart oanimationstart MSAnimationStart animationstart', + end: 'webkitAnimationEnd oanimationend MSAnimationEnd animationend', + }; + + if (typeof this.settings.offset === 'number') { + this.settings.offset = { + x: this.settings.offset, + y: this.settings.offset, + }; + } + + //if duplicate messages are not allowed, then only continue if this new message is not a duplicate of one that it already showing + if (this.settings.allow_duplicates || (!this.settings.allow_duplicates && !isDuplicateNotification(this))) { + this.init(); + } + } + + $.extend(Notify.prototype, { + init: function () { + var self = this; + + this.buildNotify(); + if (this.settings.content.icon) { + this.setIcon(); + } + if (this.settings.content.url != '#') { + this.styleURL(); + } + this.styleDismiss(); + this.placement(); + this.bind(); + + this.notify = { + $ele: this.$ele, + update: function (command, update) { + var commands = {}; + if (typeof command === 'string') { + commands[command] = update; + } else { + commands = command; + } + for (var cmd in commands) { + switch (cmd) { + case 'type': + this.$ele.removeClass('alert-' + self.settings.type); + this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass('progress-bar-' + self.settings.type); + self.settings.type = commands[cmd]; + this.$ele + .addClass('alert-' + commands[cmd]) + .find('[data-notify="progressbar"] > .progress-bar') + .addClass('progress-bar-' + commands[cmd]); + break; + case 'icon': + var $icon = this.$ele.find('[data-notify="icon"]'); + if (self.settings.icon_type.toLowerCase() === 'class') { + $icon.removeClass(self.settings.content.icon).addClass(commands[cmd]); + } else { + if (!$icon.is('img')) { + $icon.find('img'); + } + $icon.attr('src', commands[cmd]); + } + break; + case 'progress': + var newDelay = self.settings.delay - self.settings.delay * (commands[cmd] / 100); + this.$ele.data('notify-delay', newDelay); + this.$ele + .find('[data-notify="progressbar"] > div') + .attr('aria-valuenow', commands[cmd]) + .css('width', commands[cmd] + '%'); + break; + case 'url': + this.$ele.find('[data-notify="url"]').attr('href', commands[cmd]); + break; + case 'target': + this.$ele.find('[data-notify="url"]').attr('target', commands[cmd]); + break; + default: + this.$ele.find('[data-notify="' + cmd + '"]').html(commands[cmd]); + } + } + var posX = this.$ele.outerHeight() + parseInt(self.settings.spacing) + parseInt(self.settings.offset.y); + self.reposition(posX); + }, + close: function () { + self.close(); + }, + }; + }, + buildNotify: function () { + var content = this.settings.content; + this.$ele = $(String.format(this.settings.template, this.settings.type, content.title, content.message, content.url, content.target)); + this.$ele.attr('data-notify-position', this.settings.placement.from + '-' + this.settings.placement.align); + if (!this.settings.allow_dismiss) { + this.$ele.find('[data-notify="dismiss"]').css('display', 'none'); + } + if ((this.settings.delay <= 0 && !this.settings.showProgressbar) || !this.settings.showProgressbar) { + this.$ele.find('[data-notify="progressbar"]').remove(); + } + }, + setIcon: function () { + this.$ele.addClass('alert-with-icon'); + + if (this.settings.icon_type.toLowerCase() === 'class') { + this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon); + } else { + if (this.$ele.find('[data-notify="icon"]').is('img')) { + this.$ele.find('[data-notify="icon"]').attr('src', this.settings.content.icon); + } else { + this.$ele.find('[data-notify="icon"]').append('Notify Icon'); + } + } + }, + styleDismiss: function () { + this.$ele.find('[data-notify="dismiss"]').css({ + position: 'absolute', + right: '10px', + top: '20px', + marginTop: '-6px', + zIndex: this.settings.z_index + 2, + }); + }, + styleURL: function () { + this.$ele.find('[data-notify="url"]').css({ + backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)', + height: '100%', + left: 0, + position: 'absolute', + top: 0, + width: '100%', + zIndex: this.settings.z_index + 1, + }); + }, + placement: function () { + var self = this, + offsetAmt = this.settings.offset.y, + css = { + display: 'inline-block', + margin: '0px auto', + position: this.settings.position ? this.settings.position : this.settings.element === 'body' ? 'fixed' : 'absolute', + transition: 'all .5s ease-in-out', + zIndex: this.settings.z_index, + }, + hasAnimation = false, + settings = this.settings; + + $( + '[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])' + ).each(function () { + offsetAmt = Math.max( + offsetAmt, + parseInt($(this).css(settings.placement.from)) + parseInt($(this).outerHeight()) + parseInt(settings.spacing) + ); + }); + if (this.settings.newest_on_top === true) { + offsetAmt = this.settings.offset.y; + } + css[this.settings.placement.from] = offsetAmt + 'px'; + + switch (this.settings.placement.align) { + case 'left': + case 'right': + css[this.settings.placement.align] = this.settings.offset.x + 'px'; + break; + case 'center': + css.left = 0; + css.right = 0; + break; + } + this.$ele.css(css).addClass(this.settings.animate.enter); + $.each(Array('webkit-', 'moz-', 'o-', 'ms-', ''), function (index, prefix) { + self.$ele[0].style[prefix + 'AnimationIterationCount'] = 1; + }); + + $(this.settings.element).append(this.$ele); + + if (this.settings.newest_on_top === true) { + offsetAmt = parseInt(offsetAmt) + parseInt(this.settings.spacing) + this.$ele.outerHeight(); + this.reposition(offsetAmt); + } + + if ($.isFunction(self.settings.onShow)) { + self.settings.onShow.call(this.$ele); + } + + this.$ele + .one(this.animations.start, function () { + hasAnimation = true; + }) + .one(this.animations.end, function () { + if ($.isFunction(self.settings.onShown)) { + self.settings.onShown.call(this); + } + }); + + setTimeout(function () { + if (!hasAnimation) { + if ($.isFunction(self.settings.onShown)) { + self.settings.onShown.call(this); + } + } + }, 600); + }, + bind: function () { + var self = this; + + this.$ele.find('[data-notify="dismiss"]').on('click', function () { + self.close(); + }); + + this.$ele + .mouseover(function () { + $(this).data('data-hover', 'true'); + }) + .mouseout(function () { + $(this).data('data-hover', 'false'); + }); + this.$ele.data('data-hover', 'false'); + + if (this.settings.delay > 0) { + self.$ele.data('notify-delay', self.settings.delay); + var timer = setInterval(function () { + var delay = parseInt(self.$ele.data('notify-delay')) - self.settings.timer; + if ((self.$ele.data('data-hover') === 'false' && self.settings.mouse_over === 'pause') || self.settings.mouse_over != 'pause') { + var percent = ((self.settings.delay - delay) / self.settings.delay) * 100; + self.$ele.data('notify-delay', delay); + self.$ele + .find('[data-notify="progressbar"] > div') + .attr('aria-valuenow', percent) + .css('width', percent + '%'); + } + if (delay <= -self.settings.timer) { + clearInterval(timer); + self.close(); + } + }, self.settings.timer); + } + }, + close: function () { + var self = this, + posX = parseInt(this.$ele.css(this.settings.placement.from)), + hasAnimation = false; + + this.$ele.data('closing', 'true').addClass(this.settings.animate.exit); + self.reposition(posX); + + if ($.isFunction(self.settings.onClose)) { + self.settings.onClose.call(this.$ele); + } + + this.$ele + .one(this.animations.start, function () { + hasAnimation = true; + }) + .one(this.animations.end, function () { + $(this).remove(); + if ($.isFunction(self.settings.onClosed)) { + self.settings.onClosed.call(this); + } + }); + + setTimeout(function () { + if (!hasAnimation) { + self.$ele.remove(); + if (self.settings.onClosed) { + self.settings.onClosed(self.$ele); + } + } + }, 600); + }, + reposition: function (posX) { + var self = this, + notifies = + '[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])', + $elements = this.$ele.nextAll(notifies); + if (this.settings.newest_on_top === true) { + $elements = this.$ele.prevAll(notifies); + } + $elements.each(function () { + $(this).css(self.settings.placement.from, posX); + posX = parseInt(posX) + parseInt(self.settings.spacing) + $(this).outerHeight(); + }); + }, + }); + + $.notify = function (content, options) { + var plugin = new Notify(this, content, options); + return plugin.notify; + }; + $.notifyDefaults = function (options) { + defaults = $.extend(true, {}, defaults, options); + return defaults; + }; + $.notifyClose = function (command) { + if (typeof command === 'undefined' || command === 'all') { + $('[data-notify]').find('[data-notify="dismiss"]').trigger('click'); + } else { + $('[data-notify-position="' + command + '"]') + .find('[data-notify="dismiss"]') + .trigger('click'); + } + }; +}); diff --git a/src/main/webapp/content/js/bootstrap-selectpicker.js b/src/main/webapp/content/js/bootstrap-selectpicker.js new file mode 100644 index 0000000..4c80554 --- /dev/null +++ b/src/main/webapp/content/js/bootstrap-selectpicker.js @@ -0,0 +1,1986 @@ +/*! + * Bootstrap-select v1.12.1 (http://silviomoreto.github.io/bootstrap-select) + * + * Copyright 2013-2016 bootstrap-select + * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE) + */ + +/* + + Creative Tim Modifications + + Lines: 384, 384 we added Themify Icons + + */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return factory(a0); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(root['jQuery']); + } +})(this, function (jQuery) { + (function ($) { + 'use strict'; + + // + if (!String.prototype.includes) { + (function () { + 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` + var toString = {}.toString; + var defineProperty = (function () { + // IE 8 only supports `Object.defineProperty` on DOM elements + try { + var object = {}; + var $defineProperty = Object.defineProperty; + var result = $defineProperty(object, object, object) && $defineProperty; + } catch (error) {} + return result; + })(); + var indexOf = ''.indexOf; + var includes = function (search) { + if (this == null) { + throw new TypeError(); + } + var string = String(this); + if (search && toString.call(search) == '[object RegExp]') { + throw new TypeError(); + } + var stringLength = string.length; + var searchString = String(search); + var searchLength = searchString.length; + var position = arguments.length > 1 ? arguments[1] : undefined; + // `ToInteger` + var pos = position ? Number(position) : 0; + if (pos != pos) { + // better `isNaN` + pos = 0; + } + var start = Math.min(Math.max(pos, 0), stringLength); + // Avoid the `indexOf` call if no match is possible + if (searchLength + start > stringLength) { + return false; + } + return indexOf.call(string, searchString, pos) != -1; + }; + if (defineProperty) { + defineProperty(String.prototype, 'includes', { + value: includes, + configurable: true, + writable: true, + }); + } else { + String.prototype.includes = includes; + } + })(); + } + + if (!String.prototype.startsWith) { + (function () { + 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` + var defineProperty = (function () { + // IE 8 only supports `Object.defineProperty` on DOM elements + try { + var object = {}; + var $defineProperty = Object.defineProperty; + var result = $defineProperty(object, object, object) && $defineProperty; + } catch (error) {} + return result; + })(); + var toString = {}.toString; + var startsWith = function (search) { + if (this == null) { + throw new TypeError(); + } + var string = String(this); + if (search && toString.call(search) == '[object RegExp]') { + throw new TypeError(); + } + var stringLength = string.length; + var searchString = String(search); + var searchLength = searchString.length; + var position = arguments.length > 1 ? arguments[1] : undefined; + // `ToInteger` + var pos = position ? Number(position) : 0; + if (pos != pos) { + // better `isNaN` + pos = 0; + } + var start = Math.min(Math.max(pos, 0), stringLength); + // Avoid the `indexOf` call if no match is possible + if (searchLength + start > stringLength) { + return false; + } + var index = -1; + while (++index < searchLength) { + if (string.charCodeAt(start + index) != searchString.charCodeAt(index)) { + return false; + } + } + return true; + }; + if (defineProperty) { + defineProperty(String.prototype, 'startsWith', { + value: startsWith, + configurable: true, + writable: true, + }); + } else { + String.prototype.startsWith = startsWith; + } + })(); + } + + if (!Object.keys) { + Object.keys = function ( + o, // object + k, // key + r // result array + ) { + // initialize object and result + r = []; + // iterate over object keys + // fill result array with non-prototypical keys + for (k in o) r.hasOwnProperty.call(o, k) && r.push(k); + // return result + return r; + }; + } + + // set data-selected on select element if the value has been programmatically selected + // prior to initialization of bootstrap-select + // * consider removing or replacing an alternative method * + var valHooks = { + useDefault: false, + _set: $.valHooks.select.set, + }; + + $.valHooks.select.set = function (elem, value) { + if (value && !valHooks.useDefault) $(elem).data('selected', true); + + return valHooks._set.apply(this, arguments); + }; + + var changed_arguments = null; + $.fn.triggerNative = function (eventName) { + var el = this[0], + event; + + if (el.dispatchEvent) { + // for modern browsers & IE9+ + if (typeof Event === 'function') { + // For modern browsers + event = new Event(eventName, { + bubbles: true, + }); + } else { + // For IE since it doesn't support Event constructor + event = document.createEvent('Event'); + event.initEvent(eventName, true, false); + } + + el.dispatchEvent(event); + } else if (el.fireEvent) { + // for IE8 + event = document.createEventObject(); + event.eventType = eventName; + el.fireEvent('on' + eventName, event); + } else { + // fall back to jQuery.trigger + this.trigger(eventName); + } + }; + // + + // Case insensitive contains search + $.expr.pseudos.icontains = function (obj, index, meta) { + var $obj = $(obj); + var haystack = ($obj.data('tokens') || $obj.text()).toString().toUpperCase(); + return haystack.includes(meta[3].toUpperCase()); + }; + + // Case insensitive begins search + $.expr.pseudos.ibegins = function (obj, index, meta) { + var $obj = $(obj); + var haystack = ($obj.data('tokens') || $obj.text()).toString().toUpperCase(); + return haystack.startsWith(meta[3].toUpperCase()); + }; + + // Case and accent insensitive contains search + $.expr.pseudos.aicontains = function (obj, index, meta) { + var $obj = $(obj); + var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase(); + return haystack.includes(meta[3].toUpperCase()); + }; + + // Case and accent insensitive begins search + $.expr.pseudos.aibegins = function (obj, index, meta) { + var $obj = $(obj); + var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase(); + return haystack.startsWith(meta[3].toUpperCase()); + }; + + /** + * Remove all diatrics from the given text. + * @access private + * @param {String} text + * @returns {String} + */ + function normalizeToBase(text) { + var rExps = [ + { re: /[\xC0-\xC6]/g, ch: 'A' }, + { re: /[\xE0-\xE6]/g, ch: 'a' }, + { re: /[\xC8-\xCB]/g, ch: 'E' }, + { re: /[\xE8-\xEB]/g, ch: 'e' }, + { re: /[\xCC-\xCF]/g, ch: 'I' }, + { re: /[\xEC-\xEF]/g, ch: 'i' }, + { re: /[\xD2-\xD6]/g, ch: 'O' }, + { re: /[\xF2-\xF6]/g, ch: 'o' }, + { re: /[\xD9-\xDC]/g, ch: 'U' }, + { re: /[\xF9-\xFC]/g, ch: 'u' }, + { re: /[\xC7-\xE7]/g, ch: 'c' }, + { re: /[\xD1]/g, ch: 'N' }, + { re: /[\xF1]/g, ch: 'n' }, + ]; + $.each(rExps, function () { + text = text ? text.replace(this.re, this.ch) : ''; + }); + return text; + } + + // List of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`', + }; + + var unescapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'", + '`': '`', + }; + + // Functions for escaping and unescaping strings to/from HTML interpolation. + var createEscaper = function (map) { + var escaper = function (match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped. + var source = '(?:' + Object.keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function (string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + }; + + var htmlEscape = createEscaper(escapeMap); + var htmlUnescape = createEscaper(unescapeMap); + + var Selectpicker = function (element, options) { + // bootstrap-select has been initialized - revert valHooks.select.set back to its original function + if (!valHooks.useDefault) { + $.valHooks.select.set = valHooks._set; + valHooks.useDefault = true; + } + + this.$element = $(element); + this.$newElement = null; + this.$button = null; + this.$menu = null; + this.$lis = null; + this.options = options; + + // If we have no title yet, try to pull it from the html title attribute (jQuery doesnt' pick it up as it's not a + // data-attribute) + if (this.options.title === null) { + this.options.title = this.$element.attr('title'); + } + + // Format window padding + var winPad = this.options.windowPadding; + if (typeof winPad === 'number') { + this.options.windowPadding = [winPad, winPad, winPad, winPad]; + } + + //Expose public methods + this.val = Selectpicker.prototype.val; + this.render = Selectpicker.prototype.render; + this.refresh = Selectpicker.prototype.refresh; + this.setStyle = Selectpicker.prototype.setStyle; + this.selectAll = Selectpicker.prototype.selectAll; + this.deselectAll = Selectpicker.prototype.deselectAll; + this.destroy = Selectpicker.prototype.destroy; + this.remove = Selectpicker.prototype.remove; + this.show = Selectpicker.prototype.show; + this.hide = Selectpicker.prototype.hide; + + this.init(); + }; + + Selectpicker.VERSION = '1.12.1'; + + // part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both. + Selectpicker.DEFAULTS = { + noneSelectedText: 'Nothing selected', + noneResultsText: 'No results matched {0}', + countSelectedText: function (numSelected, numTotal) { + return numSelected == 1 ? '{0} item selected' : '{0} items selected'; + }, + maxOptionsText: function (numAll, numGroup) { + return [ + numAll == 1 ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)', + numGroup == 1 ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)', + ]; + }, + selectAllText: 'Select All', + deselectAllText: 'Deselect All', + doneButton: false, + doneButtonText: 'Close', + multipleSeparator: ', ', + styleBase: 'btn', + style: 'btn-default', + size: 'auto', + title: null, + selectedTextFormat: 'values', + width: false, + container: false, + hideDisabled: false, + showSubtext: false, + showIcon: true, + showContent: true, + dropupAuto: true, + header: false, + liveSearch: false, + liveSearchPlaceholder: null, + liveSearchNormalize: false, + liveSearchStyle: 'contains', + actionsBox: false, + iconBase: '', + tickIcon: 'ti-check', + showTick: false, + template: { + caret: '', + }, + maxOptions: false, + mobile: false, + selectOnTab: false, + dropdownAlignRight: false, + windowPadding: 0, + }; + + Selectpicker.prototype = { + constructor: Selectpicker, + + init: function () { + var that = this, + id = this.$element.attr('id'); + + this.$element.addClass('bs-select-hidden'); + + // store originalIndex (key) and newIndex (value) in this.liObj for fast accessibility + // allows us to do this.$lis.eq(that.liObj[index]) instead of this.$lis.filter('[data-original-index="' + index + '"]') + this.liObj = {}; + this.multiple = this.$element.prop('multiple'); + this.autofocus = this.$element.prop('autofocus'); + this.$newElement = this.createView(); + this.$element.after(this.$newElement).appendTo(this.$newElement); + this.$button = this.$newElement.children('button'); + this.$menu = this.$newElement.children('.dropdown-menu'); + this.$menuInner = this.$menu.children('.inner'); + this.$searchbox = this.$menu.find('input'); + + this.$element.removeClass('bs-select-hidden'); + + if (this.options.dropdownAlignRight === true) this.$menu.addClass('dropdown-menu-right'); + + if (typeof id !== 'undefined') { + this.$button.attr('data-id', id); + $('label[for="' + id + '"]').click(function (e) { + e.preventDefault(); + that.$button.focus(); + }); + } + + this.checkDisabled(); + this.clickListener(); + if (this.options.liveSearch) this.liveSearchListener(); + this.render(); + this.setStyle(); + this.setWidth(); + if (this.options.container) this.selectPosition(); + this.$menu.data('this', this); + this.$newElement.data('this', this); + if (this.options.mobile) this.mobile(); + + this.$newElement.on({ + 'hide.bs.dropdown': function (e) { + that.$menuInner.attr('aria-expanded', false); + that.$element.trigger('hide.bs.select', e); + }, + 'hidden.bs.dropdown': function (e) { + that.$element.trigger('hidden.bs.select', e); + }, + 'show.bs.dropdown': function (e) { + that.$menuInner.attr('aria-expanded', true); + that.$element.trigger('show.bs.select', e); + }, + 'shown.bs.dropdown': function (e) { + that.$element.trigger('shown.bs.select', e); + }, + }); + + if (that.$element[0].hasAttribute('required')) { + this.$element.on('invalid', function () { + that.$button.addClass('bs-invalid').focus(); + + that.$element.on({ + 'focus.bs.select': function () { + that.$button.focus(); + that.$element.off('focus.bs.select'); + }, + 'shown.bs.select': function () { + that.$element + .val(that.$element.val()) // set the value to hide the validation message in Chrome when menu is opened + .off('shown.bs.select'); + }, + 'rendered.bs.select': function () { + // if select is no longer invalid, remove the bs-invalid class + if (this.validity.valid) that.$button.removeClass('bs-invalid'); + that.$element.off('rendered.bs.select'); + }, + }); + }); + } + + setTimeout(function () { + that.$element.trigger('loaded.bs.select'); + }); + }, + + createDropdown: function () { + // Options + // If we are multiple or showTick option is set, then add the show-tick class + var showTick = this.multiple || this.options.showTick ? ' show-tick' : '', + inputGroup = this.$element.parent().hasClass('input-group') ? ' input-group-btn' : '', + autofocus = this.autofocus ? ' autofocus' : ''; + // Elements + var header = this.options.header + ? '
' + + this.options.header + + '
' + : ''; + var searchbox = this.options.liveSearch + ? '' + : ''; + var actionsbox = + this.multiple && this.options.actionsBox + ? '
' + + '
' + + '' + + '' + + '
' + + '
' + : ''; + var donebutton = + this.multiple && this.options.doneButton + ? '
' + + '
' + + '' + + '
' + + '
' + : ''; + var drop = + '
' + + '' + + '' + + '
'; + + return $(drop); + }, + + createView: function () { + var $drop = this.createDropdown(), + li = this.createLi(); + + $drop.find('ul')[0].innerHTML = li; + return $drop; + }, + + reloadLi: function () { + // rebuild + var li = this.createLi(); + this.$menuInner[0].innerHTML = li; + }, + + createLi: function () { + var that = this, + _li = [], + optID = 0, + titleOption = document.createElement('option'), + liIndex = -1; // increment liIndex whenever a new
  • element is created to ensure liObj is correct + + // Helper functions + /** + * @param content + * @param [index] + * @param [classes] + * @param [optgroup] + * @returns {string} + */ + var generateLI = function (content, index, classes, optgroup) { + return ( + '' + + content + + '
  • ' + ); + }; + + /** + * @param text + * @param [classes] + * @param [inline] + * @param [tokens] + * @returns {string} + */ + var generateA = function (text, classes, inline, tokens) { + return ( + '' + + text + + '' + + '' + ); + }; + + if (this.options.title && !this.multiple) { + // this option doesn't create a new
  • element, but does add a new option, so liIndex is decreased + // since liObj is recalculated on every refresh, liIndex needs to be decreased even if the titleOption is already appended + liIndex--; + + if (!this.$element.find('.bs-title-option').length) { + // Use native JS to prepend option (faster) + var element = this.$element[0]; + titleOption.className = 'bs-title-option'; + titleOption.innerHTML = this.options.title; + titleOption.value = ''; + element.insertBefore(titleOption, element.firstChild); + // Check if selected or data-selected attribute is already set on an option. If not, select the titleOption option. + // the selected item may have been changed by user or programmatically before the bootstrap select plugin runs, + // if so, the select will have the data-selected attribute + var $opt = $(element.options[element.selectedIndex]); + if ($opt.attr('selected') === undefined && this.$element.data('selected') === undefined) { + titleOption.selected = true; + } + } + } + + this.$element.find('option').each(function (index) { + var $this = $(this); + + liIndex++; + + if ($this.hasClass('bs-title-option')) return; + + // Get the class and text for the option + var optionClass = this.className || '', + inline = this.style.cssText, + text = $this.data('content') ? $this.data('content') : $this.html(), + tokens = $this.data('tokens') ? $this.data('tokens') : null, + subtext = typeof $this.data('subtext') !== 'undefined' ? '' + $this.data('subtext') + '' : '', + icon = + typeof $this.data('icon') !== 'undefined' + ? ' ' + : '', + $parent = $this.parent(), + isOptgroup = $parent[0].tagName === 'OPTGROUP', + isOptgroupDisabled = isOptgroup && $parent[0].disabled, + isDisabled = this.disabled || isOptgroupDisabled; + + if (icon !== '' && isDisabled) { + icon = '' + icon + ''; + } + + if (that.options.hideDisabled && ((isDisabled && !isOptgroup) || isOptgroupDisabled)) { + liIndex--; + return; + } + + if (!$this.data('content')) { + // Prepend any icon and append any subtext to the main text. + text = icon + '' + text + subtext + ''; + } + + if (isOptgroup && $this.data('divider') !== true) { + if (that.options.hideDisabled && isDisabled) { + if ($parent.data('allOptionsDisabled') === undefined) { + var $options = $parent.children(); + $parent.data('allOptionsDisabled', $options.filter(':disabled').length === $options.length); + } + + if ($parent.data('allOptionsDisabled')) { + liIndex--; + return; + } + } + + var optGroupClass = ' ' + $parent[0].className || ''; + + if ($this.index() === 0) { + // Is it the first option of the optgroup? + optID += 1; + + // Get the opt group label + var label = $parent[0].label, + labelSubtext = + typeof $parent.data('subtext') !== 'undefined' ? '' + $parent.data('subtext') + '' : '', + labelIcon = $parent.data('icon') ? ' ' : ''; + + label = labelIcon + '' + htmlEscape(label) + labelSubtext + ''; + + if (index !== 0 && _li.length > 0) { + // Is it NOT the first option of the select && are there elements in the dropdown? + liIndex++; + _li.push(generateLI('', null, 'divider', optID + 'div')); + } + liIndex++; + _li.push(generateLI(label, null, 'dropdown-header' + optGroupClass, optID)); + } + + if (that.options.hideDisabled && isDisabled) { + liIndex--; + return; + } + + _li.push(generateLI(generateA(text, 'opt ' + optionClass + optGroupClass, inline, tokens), index, '', optID)); + } else if ($this.data('divider') === true) { + _li.push(generateLI('', index, 'divider')); + } else if ($this.data('hidden') === true) { + _li.push(generateLI(generateA(text, optionClass, inline, tokens), index, 'hidden is-hidden')); + } else { + var showDivider = this.previousElementSibling && this.previousElementSibling.tagName === 'OPTGROUP'; + + // if previous element is not an optgroup and hideDisabled is true + if (!showDivider && that.options.hideDisabled) { + // get previous elements + var $prev = $(this).prevAll(); + + for (var i = 0; i < $prev.length; i++) { + // find the first element in the previous elements that is an optgroup + if ($prev[i].tagName === 'OPTGROUP') { + var optGroupDistance = 0; + + // loop through the options in between the current option and the optgroup + // and check if they are hidden or disabled + for (var d = 0; d < i; d++) { + var prevOption = $prev[d]; + if (prevOption.disabled || $(prevOption).data('hidden') === true) optGroupDistance++; + } + + // if all of the options between the current option and the optgroup are hidden or disabled, show the divider + if (optGroupDistance === i) showDivider = true; + + break; + } + } + } + + if (showDivider) { + liIndex++; + _li.push(generateLI('', null, 'divider', optID + 'div')); + } + _li.push(generateLI(generateA(text, optionClass, inline, tokens), index)); + } + + that.liObj[index] = liIndex; + }); + + //If we are not multiple, we don't have a selected item, and we don't have a title, select the first element so something is set in the button + if (!this.multiple && this.$element.find('option:selected').length === 0 && !this.options.title) { + this.$element.find('option').eq(0).prop('selected', true).attr('selected', 'selected'); + } + + return _li.join(''); + }, + + findLis: function () { + if (this.$lis == null) this.$lis = this.$menu.find('li'); + return this.$lis; + }, + + /** + * @param [updateLi] defaults to true + */ + render: function (updateLi) { + var that = this, + notDisabled; + + //Update the LI to match the SELECT + if (updateLi !== false) { + this.$element.find('option').each(function (index) { + var $lis = that.findLis().eq(that.liObj[index]); + + that.setDisabled(index, this.disabled || (this.parentNode.tagName === 'OPTGROUP' && this.parentNode.disabled), $lis); + that.setSelected(index, this.selected, $lis); + }); + } + + this.togglePlaceholder(); + + this.tabIndex(); + + var selectedItems = this.$element + .find('option') + .map(function () { + if (this.selected) { + if (that.options.hideDisabled && (this.disabled || (this.parentNode.tagName === 'OPTGROUP' && this.parentNode.disabled))) + return; + + var $this = $(this), + icon = + $this.data('icon') && that.options.showIcon + ? ' ' + : '', + subtext; + + if (that.options.showSubtext && $this.data('subtext') && !that.multiple) { + subtext = ' ' + $this.data('subtext') + ''; + } else { + subtext = ''; + } + if (typeof $this.attr('title') !== 'undefined') { + return $this.attr('title'); + } else if ($this.data('content') && that.options.showContent) { + return $this.data('content').toString(); + } else { + return icon + $this.html() + subtext; + } + } + }) + .toArray(); + + //Fixes issue in IE10 occurring when no default option is selected and at least one option is disabled + //Convert all the values into a comma delimited string + var title = !this.multiple ? selectedItems[0] : selectedItems.join(this.options.multipleSeparator); + + //If this is multi select, and the selectText type is count, the show 1 of 2 selected etc.. + if (this.multiple && this.options.selectedTextFormat.indexOf('count') > -1) { + var max = this.options.selectedTextFormat.split('>'); + if ((max.length > 1 && selectedItems.length > max[1]) || (max.length == 1 && selectedItems.length >= 2)) { + notDisabled = this.options.hideDisabled ? ', [disabled]' : ''; + var totalCount = this.$element.find('option').not('[data-divider="true"], [data-hidden="true"]' + notDisabled).length, + tr8nText = + typeof this.options.countSelectedText === 'function' + ? this.options.countSelectedText(selectedItems.length, totalCount) + : this.options.countSelectedText; + title = tr8nText.replace('{0}', selectedItems.length.toString()).replace('{1}', totalCount.toString()); + } + } + + if (this.options.title == undefined) { + this.options.title = this.$element.attr('title'); + } + + if (this.options.selectedTextFormat == 'static') { + title = this.options.title; + } + + //If we dont have a title, then use the default, or if nothing is set at all, use the not selected text + if (!title) { + title = typeof this.options.title !== 'undefined' ? this.options.title : this.options.noneSelectedText; + } + + //strip all HTML tags and trim the result, then unescape any escaped tags + this.$button.attr('title', htmlUnescape($.trim(title.replace(/<[^>]*>?/g, '')))); + this.$button.children('.filter-option').html(title); + + this.$element.trigger('rendered.bs.select'); + }, + + /** + * @param [style] + * @param [status] + */ + setStyle: function (style, status) { + if (this.$element.attr('class')) { + this.$newElement.addClass( + this.$element.attr('class').replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, '') + ); + } + + var buttonClass = style ? style : this.options.style; + + if (status == 'add') { + this.$button.addClass(buttonClass); + } else if (status == 'remove') { + this.$button.removeClass(buttonClass); + } else { + this.$button.removeClass(this.options.style); + this.$button.addClass(buttonClass); + } + }, + + liHeight: function (refresh) { + if (!refresh && (this.options.size === false || this.sizeInfo)) return; + + var newElement = document.createElement('div'), + menu = document.createElement('div'), + menuInner = document.createElement('ul'), + divider = document.createElement('li'), + li = document.createElement('li'), + a = document.createElement('a'), + text = document.createElement('span'), + header = + this.options.header && this.$menu.find('.popover-title').length > 0 + ? this.$menu.find('.popover-title')[0].cloneNode(true) + : null, + search = this.options.liveSearch ? document.createElement('div') : null, + actions = + this.options.actionsBox && this.multiple && this.$menu.find('.bs-actionsbox').length > 0 + ? this.$menu.find('.bs-actionsbox')[0].cloneNode(true) + : null, + doneButton = + this.options.doneButton && this.multiple && this.$menu.find('.bs-donebutton').length > 0 + ? this.$menu.find('.bs-donebutton')[0].cloneNode(true) + : null; + + text.className = 'text'; + newElement.className = this.$menu[0].parentNode.className + ' open'; + menu.className = 'dropdown-menu open'; + menuInner.className = 'dropdown-menu inner'; + divider.className = 'divider'; + + text.appendChild(document.createTextNode('Inner text')); + a.appendChild(text); + li.appendChild(a); + menuInner.appendChild(li); + menuInner.appendChild(divider); + if (header) menu.appendChild(header); + if (search) { + // create a span instead of input as creating an input element is slower + var input = document.createElement('span'); + search.className = 'bs-searchbox'; + input.className = 'form-control'; + search.appendChild(input); + menu.appendChild(search); + } + if (actions) menu.appendChild(actions); + menu.appendChild(menuInner); + if (doneButton) menu.appendChild(doneButton); + newElement.appendChild(menu); + + document.body.appendChild(newElement); + + var liHeight = a.offsetHeight, + headerHeight = header ? header.offsetHeight : 0, + searchHeight = search ? search.offsetHeight : 0, + actionsHeight = actions ? actions.offsetHeight : 0, + doneButtonHeight = doneButton ? doneButton.offsetHeight : 0, + dividerHeight = $(divider).outerHeight(true), + // fall back to jQuery if getComputedStyle is not supported + menuStyle = typeof getComputedStyle === 'function' ? getComputedStyle(menu) : false, + $menu = menuStyle ? null : $(menu), + menuPadding = { + vert: + parseInt(menuStyle ? menuStyle.paddingTop : $menu.css('paddingTop')) + + parseInt(menuStyle ? menuStyle.paddingBottom : $menu.css('paddingBottom')) + + parseInt(menuStyle ? menuStyle.borderTopWidth : $menu.css('borderTopWidth')) + + parseInt(menuStyle ? menuStyle.borderBottomWidth : $menu.css('borderBottomWidth')), + horiz: + parseInt(menuStyle ? menuStyle.paddingLeft : $menu.css('paddingLeft')) + + parseInt(menuStyle ? menuStyle.paddingRight : $menu.css('paddingRight')) + + parseInt(menuStyle ? menuStyle.borderLeftWidth : $menu.css('borderLeftWidth')) + + parseInt(menuStyle ? menuStyle.borderRightWidth : $menu.css('borderRightWidth')), + }, + menuExtras = { + vert: + menuPadding.vert + + parseInt(menuStyle ? menuStyle.marginTop : $menu.css('marginTop')) + + parseInt(menuStyle ? menuStyle.marginBottom : $menu.css('marginBottom')) + + 2, + horiz: + menuPadding.horiz + + parseInt(menuStyle ? menuStyle.marginLeft : $menu.css('marginLeft')) + + parseInt(menuStyle ? menuStyle.marginRight : $menu.css('marginRight')) + + 2, + }; + + document.body.removeChild(newElement); + + this.sizeInfo = { + liHeight: liHeight, + headerHeight: headerHeight, + searchHeight: searchHeight, + actionsHeight: actionsHeight, + doneButtonHeight: doneButtonHeight, + dividerHeight: dividerHeight, + menuPadding: menuPadding, + menuExtras: menuExtras, + }; + }, + + setSize: function () { + this.findLis(); + this.liHeight(); + + if (this.options.header) this.$menu.css('padding-top', 0); + if (this.options.size === false) return; + + var that = this, + $menu = this.$menu, + $menuInner = this.$menuInner, + $window = $(window), + selectHeight = this.$newElement[0].offsetHeight, + selectWidth = this.$newElement[0].offsetWidth, + liHeight = this.sizeInfo['liHeight'], + headerHeight = this.sizeInfo['headerHeight'], + searchHeight = this.sizeInfo['searchHeight'], + actionsHeight = this.sizeInfo['actionsHeight'], + doneButtonHeight = this.sizeInfo['doneButtonHeight'], + divHeight = this.sizeInfo['dividerHeight'], + menuPadding = this.sizeInfo['menuPadding'], + menuExtras = this.sizeInfo['menuExtras'], + notDisabled = this.options.hideDisabled ? '.disabled' : '', + menuHeight, + menuWidth, + getHeight, + getWidth, + selectOffsetTop, + selectOffsetBot, + selectOffsetLeft, + selectOffsetRight, + getPos = function () { + var pos = that.$newElement.offset(), + $container = $(that.options.container), + containerPos; + + if (that.options.container && !$container.is('body')) { + containerPos = $container.offset(); + containerPos.top += parseInt($container.css('borderTopWidth')); + containerPos.left += parseInt($container.css('borderLeftWidth')); + } else { + containerPos = { top: 0, left: 0 }; + } + + var winPad = that.options.windowPadding; + selectOffsetTop = pos.top - containerPos.top - $window.scrollTop(); + selectOffsetBot = $window.height() - selectOffsetTop - selectHeight - containerPos.top - winPad[2]; + selectOffsetLeft = pos.left - containerPos.left - $window.scrollLeft(); + selectOffsetRight = $window.width() - selectOffsetLeft - selectWidth - containerPos.left - winPad[1]; + selectOffsetTop -= winPad[0]; + selectOffsetLeft -= winPad[3]; + }; + + getPos(); + + if (this.options.size === 'auto') { + var getSize = function () { + var minHeight, + hasClass = function (className, include) { + return function (element) { + if (include) { + return element.classList ? element.classList.contains(className) : $(element).hasClass(className); + } else { + return !(element.classList ? element.classList.contains(className) : $(element).hasClass(className)); + } + }; + }, + lis = that.$menuInner[0].getElementsByTagName('li'), + lisVisible = Array.prototype.filter ? Array.prototype.filter.call(lis, hasClass('hidden', false)) : that.$lis.not('.hidden'), + optGroup = Array.prototype.filter + ? Array.prototype.filter.call(lisVisible, hasClass('dropdown-header', true)) + : lisVisible.filter('.dropdown-header'); + + getPos(); + menuHeight = selectOffsetBot - menuExtras.vert; + menuWidth = selectOffsetRight - menuExtras.horiz; + + if (that.options.container) { + if (!$menu.data('height')) $menu.data('height', $menu.height()); + getHeight = $menu.data('height'); + + if (!$menu.data('width')) $menu.data('width', $menu.width()); + getWidth = $menu.data('width'); + } else { + getHeight = $menu.height(); + getWidth = $menu.width(); + } + + if (that.options.dropupAuto) { + that.$newElement.toggleClass('dropup', selectOffsetTop > selectOffsetBot && menuHeight - menuExtras.vert < getHeight); + } + + if (that.$newElement.hasClass('dropup')) { + menuHeight = selectOffsetTop - menuExtras.vert; + } + + if (that.options.dropdownAlignRight === 'auto') { + $menu.toggleClass( + 'dropdown-menu-right', + selectOffsetLeft > selectOffsetRight && menuWidth - menuExtras.horiz < getWidth - selectWidth + ); + } + + if (lisVisible.length + optGroup.length > 3) { + minHeight = liHeight * 3 + menuExtras.vert - 2; + } else { + minHeight = 0; + } + + $menu.css({ + 'max-height': menuHeight + 'px', + overflow: 'hidden', + 'min-height': minHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight + 'px', + }); + $menuInner.css({ + 'max-height': menuHeight - headerHeight - searchHeight - actionsHeight - doneButtonHeight - menuPadding.vert + 'px', + 'overflow-y': 'auto', + 'min-height': Math.max(minHeight - menuPadding.vert, 0) + 'px', + }); + }; + getSize(); + this.$searchbox.off('input.getSize propertychange.getSize').on('input.getSize propertychange.getSize', getSize); + $window.off('resize.getSize scroll.getSize').on('resize.getSize scroll.getSize', getSize); + } else if (this.options.size && this.options.size != 'auto' && this.$lis.not(notDisabled).length > this.options.size) { + var optIndex = this.$lis.not('.divider').not(notDisabled).children().slice(0, this.options.size).last().parent().index(), + divLength = this.$lis.slice(0, optIndex + 1).filter('.divider').length; + menuHeight = liHeight * this.options.size + divLength * divHeight + menuPadding.vert; + + if (that.options.container) { + if (!$menu.data('height')) $menu.data('height', $menu.height()); + getHeight = $menu.data('height'); + } else { + getHeight = $menu.height(); + } + + if (that.options.dropupAuto) { + //noinspection JSUnusedAssignment + this.$newElement.toggleClass('dropup', selectOffsetTop > selectOffsetBot && menuHeight - menuExtras.vert < getHeight); + } + $menu.css({ + 'max-height': menuHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight + 'px', + overflow: 'hidden', + 'min-height': '', + }); + $menuInner.css({ + 'max-height': menuHeight - menuPadding.vert + 'px', + 'overflow-y': 'auto', + 'min-height': '', + }); + } + }, + + setWidth: function () { + if (this.options.width === 'auto') { + this.$menu.css('min-width', '0'); + + // Get correct width if element is hidden + var $selectClone = this.$menu.parent().clone().appendTo('body'), + $selectClone2 = this.options.container ? this.$newElement.clone().appendTo('body') : $selectClone, + ulWidth = $selectClone.children('.dropdown-menu').outerWidth(), + btnWidth = $selectClone2.css('width', 'auto').children('button').outerWidth(); + + $selectClone.remove(); + $selectClone2.remove(); + + // Set width to whatever's larger, button title or longest option + this.$newElement.css('width', Math.max(ulWidth, btnWidth) + 'px'); + } else if (this.options.width === 'fit') { + // Remove inline min-width so width can be changed from 'auto' + this.$menu.css('min-width', ''); + this.$newElement.css('width', '').addClass('fit-width'); + } else if (this.options.width) { + // Remove inline min-width so width can be changed from 'auto' + this.$menu.css('min-width', ''); + this.$newElement.css('width', this.options.width); + } else { + // Remove inline min-width/width so width can be changed + this.$menu.css('min-width', ''); + this.$newElement.css('width', ''); + } + // Remove fit-width class if width is changed programmatically + if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') { + this.$newElement.removeClass('fit-width'); + } + }, + + selectPosition: function () { + this.$bsContainer = $('
    '); + + var that = this, + $container = $(this.options.container), + pos, + containerPos, + actualHeight, + getPlacement = function ($element) { + that.$bsContainer + .addClass($element.attr('class').replace(/form-control|fit-width/gi, '')) + .toggleClass('dropup', $element.hasClass('dropup')); + pos = $element.offset(); + + if (!$container.is('body')) { + containerPos = $container.offset(); + containerPos.top += parseInt($container.css('borderTopWidth')) - $container.scrollTop(); + containerPos.left += parseInt($container.css('borderLeftWidth')) - $container.scrollLeft(); + } else { + containerPos = { top: 0, left: 0 }; + } + + actualHeight = $element.hasClass('dropup') ? 0 : $element[0].offsetHeight; + + that.$bsContainer.css({ + top: pos.top - containerPos.top + actualHeight, + left: pos.left - containerPos.left, + width: $element[0].offsetWidth, + }); + }; + + this.$button.on('click', function () { + var $this = $(this); + + if (that.isDisabled()) { + return; + } + + getPlacement(that.$newElement); + + that.$bsContainer.appendTo(that.options.container).toggleClass('open', !$this.hasClass('open')).append(that.$menu); + }); + + $(window).on('resize scroll', function () { + getPlacement(that.$newElement); + }); + + this.$element.on('hide.bs.select', function () { + that.$menu.data('height', that.$menu.height()); + that.$bsContainer.detach(); + }); + }, + + /** + * @param {number} index - the index of the option that is being changed + * @param {boolean} selected - true if the option is being selected, false if being deselected + * @param {JQuery} $lis - the 'li' element that is being modified + */ + setSelected: function (index, selected, $lis) { + if (!$lis) { + this.togglePlaceholder(); // check if setSelected is being called by changing the value of the select + $lis = this.findLis().eq(this.liObj[index]); + } + + $lis.toggleClass('selected', selected).find('a').attr('aria-selected', selected); + }, + + /** + * @param {number} index - the index of the option that is being disabled + * @param {boolean} disabled - true if the option is being disabled, false if being enabled + * @param {JQuery} $lis - the 'li' element that is being modified + */ + setDisabled: function (index, disabled, $lis) { + if (!$lis) { + $lis = this.findLis().eq(this.liObj[index]); + } + + if (disabled) { + $lis.addClass('disabled').children('a').attr('href', '#').attr('tabindex', -1).attr('aria-disabled', true); + } else { + $lis.removeClass('disabled').children('a').removeAttr('href').attr('tabindex', 0).attr('aria-disabled', false); + } + }, + + isDisabled: function () { + return this.$element[0].disabled; + }, + + checkDisabled: function () { + var that = this; + + if (this.isDisabled()) { + this.$newElement.addClass('disabled'); + this.$button.addClass('disabled').attr('tabindex', -1).attr('aria-disabled', true); + } else { + if (this.$button.hasClass('disabled')) { + this.$newElement.removeClass('disabled'); + this.$button.removeClass('disabled').attr('aria-disabled', false); + } + + if (this.$button.attr('tabindex') == -1 && !this.$element.data('tabindex')) { + this.$button.removeAttr('tabindex'); + } + } + + this.$button.click(function () { + return !that.isDisabled(); + }); + }, + + togglePlaceholder: function () { + var value = this.$element.val(); + this.$button.toggleClass('bs-placeholder', value === null || value === '' || (value.constructor === Array && value.length === 0)); + }, + + tabIndex: function () { + if ( + this.$element.data('tabindex') !== this.$element.attr('tabindex') && + this.$element.attr('tabindex') !== -98 && + this.$element.attr('tabindex') !== '-98' + ) { + this.$element.data('tabindex', this.$element.attr('tabindex')); + this.$button.attr('tabindex', this.$element.data('tabindex')); + } + + this.$element.attr('tabindex', -98); + }, + + clickListener: function () { + var that = this, + $document = $(document); + + $document.data('spaceSelect', false); + + this.$button.on('keyup', function (e) { + if (/(32)/.test(e.keyCode.toString(10)) && $document.data('spaceSelect')) { + e.preventDefault(); + $document.data('spaceSelect', false); + } + }); + + this.$button.on('click', function () { + that.setSize(); + }); + + this.$element.on('shown.bs.select', function () { + if (!that.options.liveSearch && !that.multiple) { + that.$menuInner.find('.selected a').focus(); + } else if (!that.multiple) { + var selectedIndex = that.liObj[that.$element[0].selectedIndex]; + + if (typeof selectedIndex !== 'number' || that.options.size === false) return; + + // scroll to selected option + var offset = that.$lis.eq(selectedIndex)[0].offsetTop - that.$menuInner[0].offsetTop; + offset = offset - that.$menuInner[0].offsetHeight / 2 + that.sizeInfo.liHeight / 2; + that.$menuInner[0].scrollTop = offset; + } + }); + + this.$menuInner.on('click', 'li a', function (e) { + var $this = $(this), + clickedIndex = $this.parent().data('originalIndex'), + prevValue = that.$element.val(), + prevIndex = that.$element.prop('selectedIndex'), + triggerChange = true; + + // Don't close on multi choice menu + if (that.multiple && that.options.maxOptions !== 1) { + e.stopPropagation(); + } + + e.preventDefault(); + + //Don't run if we have been disabled + if (!that.isDisabled() && !$this.parent().hasClass('disabled')) { + var $options = that.$element.find('option'), + $option = $options.eq(clickedIndex), + state = $option.prop('selected'), + $optgroup = $option.parent('optgroup'), + maxOptions = that.options.maxOptions, + maxOptionsGrp = $optgroup.data('maxOptions') || false; + + if (!that.multiple) { + // Deselect all others if not multi select box + $options.prop('selected', false); + $option.prop('selected', true); + that.$menuInner.find('.selected').removeClass('selected').find('a').attr('aria-selected', false); + that.setSelected(clickedIndex, true); + } else { + // Toggle the one we have chosen if we are multi select. + $option.prop('selected', !state); + that.setSelected(clickedIndex, !state); + $this.blur(); + + if (maxOptions !== false || maxOptionsGrp !== false) { + var maxReached = maxOptions < $options.filter(':selected').length, + maxReachedGrp = maxOptionsGrp < $optgroup.find('option:selected').length; + + if ((maxOptions && maxReached) || (maxOptionsGrp && maxReachedGrp)) { + if (maxOptions && maxOptions == 1) { + $options.prop('selected', false); + $option.prop('selected', true); + that.$menuInner.find('.selected').removeClass('selected'); + that.setSelected(clickedIndex, true); + } else if (maxOptionsGrp && maxOptionsGrp == 1) { + $optgroup.find('option:selected').prop('selected', false); + $option.prop('selected', true); + var optgroupID = $this.parent().data('optgroup'); + that.$menuInner.find('[data-optgroup="' + optgroupID + '"]').removeClass('selected'); + that.setSelected(clickedIndex, true); + } else { + var maxOptionsText = + typeof that.options.maxOptionsText === 'string' + ? [that.options.maxOptionsText, that.options.maxOptionsText] + : that.options.maxOptionsText, + maxOptionsArr = typeof maxOptionsText === 'function' ? maxOptionsText(maxOptions, maxOptionsGrp) : maxOptionsText, + maxTxt = maxOptionsArr[0].replace('{n}', maxOptions), + maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp), + $notify = $('
    '); + // If {var} is set in array, replace it + /** @deprecated */ + if (maxOptionsArr[2]) { + maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]); + maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]); + } + + $option.prop('selected', false); + + that.$menu.append($notify); + + if (maxOptions && maxReached) { + $notify.append($('
    ' + maxTxt + '
    ')); + triggerChange = false; + that.$element.trigger('maxReached.bs.select'); + } + + if (maxOptionsGrp && maxReachedGrp) { + $notify.append($('
    ' + maxTxtGrp + '
    ')); + triggerChange = false; + that.$element.trigger('maxReachedGrp.bs.select'); + } + + setTimeout(function () { + that.setSelected(clickedIndex, false); + }, 10); + + $notify.delay(750).fadeOut(300, function () { + $(this).remove(); + }); + } + } + } + } + + if (!that.multiple || (that.multiple && that.options.maxOptions === 1)) { + that.$button.focus(); + } else if (that.options.liveSearch) { + that.$searchbox.focus(); + } + + // Trigger select 'change' + if (triggerChange) { + if ( + (prevValue != that.$element.val() && that.multiple) || + (prevIndex != that.$element.prop('selectedIndex') && !that.multiple) + ) { + // $option.prop('selected') is current option state (selected/unselected). state is previous option state. + changed_arguments = [clickedIndex, $option.prop('selected'), state]; + that.$element.triggerNative('change'); + } + } + } + }); + + this.$menu.on('click', 'li.disabled a, .popover-title, .popover-title :not(.close)', function (e) { + if (e.currentTarget == this) { + e.preventDefault(); + e.stopPropagation(); + if (that.options.liveSearch && !$(e.target).hasClass('close')) { + that.$searchbox.focus(); + } else { + that.$button.focus(); + } + } + }); + + this.$menuInner.on('click', '.divider, .dropdown-header', function (e) { + e.preventDefault(); + e.stopPropagation(); + if (that.options.liveSearch) { + that.$searchbox.focus(); + } else { + that.$button.focus(); + } + }); + + this.$menu.on('click', '.popover-title .close', function () { + that.$button.click(); + }); + + this.$searchbox.on('click', function (e) { + e.stopPropagation(); + }); + + this.$menu.on('click', '.actions-btn', function (e) { + if (that.options.liveSearch) { + that.$searchbox.focus(); + } else { + that.$button.focus(); + } + + e.preventDefault(); + e.stopPropagation(); + + if ($(this).hasClass('bs-select-all')) { + that.selectAll(); + } else { + that.deselectAll(); + } + }); + + this.$element.change(function () { + that.render(false); + that.$element.trigger('changed.bs.select', changed_arguments); + changed_arguments = null; + }); + }, + + liveSearchListener: function () { + var that = this, + $no_results = $('
  • '); + + this.$button.on('click.dropdown.data-api', function () { + that.$menuInner.find('.active').removeClass('active'); + if (!!that.$searchbox.val()) { + that.$searchbox.val(''); + that.$lis.not('.is-hidden').removeClass('hidden'); + if (!!$no_results.parent().length) $no_results.remove(); + } + if (!that.multiple) that.$menuInner.find('.selected').addClass('active'); + setTimeout(function () { + that.$searchbox.focus(); + }, 10); + }); + + this.$searchbox.on('click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api', function (e) { + e.stopPropagation(); + }); + + this.$searchbox.on('input propertychange', function () { + that.$lis.not('.is-hidden').removeClass('hidden'); + that.$lis.filter('.active').removeClass('active'); + $no_results.remove(); + + if (that.$searchbox.val()) { + var $searchBase = that.$lis.not('.is-hidden, .divider, .dropdown-header'), + $hideItems; + if (that.options.liveSearchNormalize) { + $hideItems = $searchBase.not(':a' + that._searchStyle() + '("' + normalizeToBase(that.$searchbox.val()) + '")'); + } else { + $hideItems = $searchBase.not(':' + that._searchStyle() + '("' + that.$searchbox.val() + '")'); + } + + if ($hideItems.length === $searchBase.length) { + $no_results.html(that.options.noneResultsText.replace('{0}', '"' + htmlEscape(that.$searchbox.val()) + '"')); + that.$menuInner.append($no_results); + that.$lis.addClass('hidden'); + } else { + $hideItems.addClass('hidden'); + + var $lisVisible = that.$lis.not('.hidden'), + $foundDiv; + + // hide divider if first or last visible, or if followed by another divider + $lisVisible.each(function (index) { + var $this = $(this); + + if ($this.hasClass('divider')) { + if ($foundDiv === undefined) { + $this.addClass('hidden'); + } else { + if ($foundDiv) $foundDiv.addClass('hidden'); + $foundDiv = $this; + } + } else if ($this.hasClass('dropdown-header') && $lisVisible.eq(index + 1).data('optgroup') !== $this.data('optgroup')) { + $this.addClass('hidden'); + } else { + $foundDiv = null; + } + }); + if ($foundDiv) $foundDiv.addClass('hidden'); + + $searchBase.not('.hidden').first().addClass('active'); + } + } + }); + }, + + _searchStyle: function () { + var styles = { + begins: 'ibegins', + startsWith: 'ibegins', + }; + + return styles[this.options.liveSearchStyle] || 'icontains'; + }, + + val: function (value) { + if (typeof value !== 'undefined') { + this.$element.val(value); + this.render(); + + return this.$element; + } else { + return this.$element.val(); + } + }, + + changeAll: function (status) { + if (!this.multiple) return; + if (typeof status === 'undefined') status = true; + + this.findLis(); + + var $options = this.$element.find('option'), + $lisVisible = this.$lis.not('.divider, .dropdown-header, .disabled, .hidden'), + lisVisLen = $lisVisible.length, + selectedOptions = []; + + if (status) { + if ($lisVisible.filter('.selected').length === $lisVisible.length) return; + } else { + if ($lisVisible.filter('.selected').length === 0) return; + } + + $lisVisible.toggleClass('selected', status); + + for (var i = 0; i < lisVisLen; i++) { + var origIndex = $lisVisible[i].getAttribute('data-original-index'); + selectedOptions[selectedOptions.length] = $options.eq(origIndex)[0]; + } + + $(selectedOptions).prop('selected', status); + + this.render(false); + + this.togglePlaceholder(); + + this.$element.triggerNative('change'); + }, + + selectAll: function () { + return this.changeAll(true); + }, + + deselectAll: function () { + return this.changeAll(false); + }, + + toggle: function (e) { + e = e || window.event; + + if (e) e.stopPropagation(); + + this.$button.trigger('click'); + }, + + keydown: function (e) { + var $this = $(this), + $parent = $this.is('input') ? $this.parent().parent() : $this.parent(), + $items, + that = $parent.data('this'), + index, + next, + first, + last, + prev, + nextPrev, + prevIndex, + isActive, + selector = ':not(.disabled, .hidden, .dropdown-header, .divider)', + keyCodeMap = { + 32: ' ', + 48: '0', + 49: '1', + 50: '2', + 51: '3', + 52: '4', + 53: '5', + 54: '6', + 55: '7', + 56: '8', + 57: '9', + 59: ';', + 65: 'a', + 66: 'b', + 67: 'c', + 68: 'd', + 69: 'e', + 70: 'f', + 71: 'g', + 72: 'h', + 73: 'i', + 74: 'j', + 75: 'k', + 76: 'l', + 77: 'm', + 78: 'n', + 79: 'o', + 80: 'p', + 81: 'q', + 82: 'r', + 83: 's', + 84: 't', + 85: 'u', + 86: 'v', + 87: 'w', + 88: 'x', + 89: 'y', + 90: 'z', + 96: '0', + 97: '1', + 98: '2', + 99: '3', + 100: '4', + 101: '5', + 102: '6', + 103: '7', + 104: '8', + 105: '9', + }; + + if (that.options.liveSearch) $parent = $this.parent().parent(); + + if (that.options.container) $parent = that.$menu; + + $items = $('[role="listbox"] li', $parent); + + isActive = that.$newElement.hasClass('open'); + + if ( + !isActive && + ((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 96 && e.keyCode <= 105) || (e.keyCode >= 65 && e.keyCode <= 90)) + ) { + if (!that.options.container) { + that.setSize(); + that.$menu.parent().addClass('open'); + isActive = true; + } else { + that.$button.trigger('click'); + } + that.$searchbox.focus(); + return; + } + + if (that.options.liveSearch) { + if (/(^9$|27)/.test(e.keyCode.toString(10)) && isActive) { + e.preventDefault(); + e.stopPropagation(); + that.$menuInner.click(); + that.$button.focus(); + } + // $items contains li elements when liveSearch is enabled + $items = $('[role="listbox"] li' + selector, $parent); + if (!$this.val() && !/(38|40)/.test(e.keyCode.toString(10))) { + if ($items.filter('.active').length === 0) { + $items = that.$menuInner.find('li'); + if (that.options.liveSearchNormalize) { + $items = $items.filter(':a' + that._searchStyle() + '(' + normalizeToBase(keyCodeMap[e.keyCode]) + ')'); + } else { + $items = $items.filter(':' + that._searchStyle() + '(' + keyCodeMap[e.keyCode] + ')'); + } + } + } + } + + if (!$items.length) return; + + if (/(38|40)/.test(e.keyCode.toString(10))) { + index = $items.index($items.find('a').filter(':focus').parent()); + first = $items.filter(selector).first().index(); + last = $items.filter(selector).last().index(); + next = $items.eq(index).nextAll(selector).eq(0).index(); + prev = $items.eq(index).prevAll(selector).eq(0).index(); + nextPrev = $items.eq(next).prevAll(selector).eq(0).index(); + + if (that.options.liveSearch) { + $items.each(function (i) { + if (!$(this).hasClass('disabled')) { + $(this).data('index', i); + } + }); + index = $items.index($items.filter('.active')); + first = $items.first().data('index'); + last = $items.last().data('index'); + next = $items.eq(index).nextAll().eq(0).data('index'); + prev = $items.eq(index).prevAll().eq(0).data('index'); + nextPrev = $items.eq(next).prevAll().eq(0).data('index'); + } + + prevIndex = $this.data('prevIndex'); + + if (e.keyCode == 38) { + if (that.options.liveSearch) index--; + if (index != nextPrev && index > prev) index = prev; + if (index < first) index = first; + if (index == prevIndex) index = last; + } else if (e.keyCode == 40) { + if (that.options.liveSearch) index++; + if (index == -1) index = 0; + if (index != nextPrev && index < next) index = next; + if (index > last) index = last; + if (index == prevIndex) index = first; + } + + $this.data('prevIndex', index); + + if (!that.options.liveSearch) { + $items.eq(index).children('a').focus(); + } else { + e.preventDefault(); + if (!$this.hasClass('dropdown-toggle')) { + $items.removeClass('active').eq(index).addClass('active').children('a').focus(); + $this.focus(); + } + } + } else if (!$this.is('input')) { + var keyIndex = [], + count, + prevKey; + + $items.each(function () { + if (!$(this).hasClass('disabled')) { + if ($.trim($(this).children('a').text().toLowerCase()).substring(0, 1) == keyCodeMap[e.keyCode]) { + keyIndex.push($(this).index()); + } + } + }); + + count = $(document).data('keycount'); + count++; + $(document).data('keycount', count); + + prevKey = $.trim($(':focus').text().toLowerCase()).substring(0, 1); + + if (prevKey != keyCodeMap[e.keyCode]) { + count = 1; + $(document).data('keycount', count); + } else if (count >= keyIndex.length) { + $(document).data('keycount', 0); + if (count > keyIndex.length) count = 1; + } + + $items + .eq(keyIndex[count - 1]) + .children('a') + .focus(); + } + + // Select focused option if "Enter", "Spacebar" or "Tab" (when selectOnTab is true) are pressed inside the menu. + if ((/(13|32)/.test(e.keyCode.toString(10)) || (/(^9$)/.test(e.keyCode.toString(10)) && that.options.selectOnTab)) && isActive) { + if (!/(32)/.test(e.keyCode.toString(10))) e.preventDefault(); + if (!that.options.liveSearch) { + var elem = $(':focus'); + elem.click(); + // Bring back focus for multiselects + elem.focus(); + // Prevent screen from scrolling if the user hit the spacebar + e.preventDefault(); + // Fixes spacebar selection of dropdown items in FF & IE + $(document).data('spaceSelect', true); + } else if (!/(32)/.test(e.keyCode.toString(10))) { + that.$menuInner.find('.active a').click(); + $this.focus(); + } + $(document).data('keycount', 0); + } + + if ( + (/(^9$|27)/.test(e.keyCode.toString(10)) && isActive && (that.multiple || that.options.liveSearch)) || + (/(27)/.test(e.keyCode.toString(10)) && !isActive) + ) { + that.$menu.parent().removeClass('open'); + if (that.options.container) that.$newElement.removeClass('open'); + that.$button.focus(); + } + }, + + mobile: function () { + this.$element.addClass('mobile-device'); + }, + + refresh: function () { + this.$lis = null; + this.liObj = {}; + this.reloadLi(); + this.render(); + this.checkDisabled(); + this.liHeight(true); + this.setStyle(); + this.setWidth(); + if (this.$lis) this.$searchbox.trigger('propertychange'); + + this.$element.trigger('refreshed.bs.select'); + }, + + hide: function () { + this.$newElement.hide(); + }, + + show: function () { + this.$newElement.show(); + }, + + remove: function () { + this.$newElement.remove(); + this.$element.remove(); + }, + + destroy: function () { + this.$newElement.before(this.$element).remove(); + + if (this.$bsContainer) { + this.$bsContainer.remove(); + } else { + this.$menu.remove(); + } + + this.$element.off('.bs.select').removeData('selectpicker').removeClass('bs-select-hidden selectpicker'); + }, + }; + + // SELECTPICKER PLUGIN DEFINITION + // ============================== + function Plugin(option) { + // get the args of the outer function.. + var args = arguments; + // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them + // to get lost/corrupted in android 2.3 and IE9 #715 #775 + var _option = option; + + [].shift.apply(args); + + var value; + var chain = this.each(function () { + var $this = $(this); + if ($this.is('select')) { + var data = $this.data('selectpicker'), + options = typeof _option == 'object' && _option; + + if (!data) { + var config = $.extend({}, Selectpicker.DEFAULTS, $.fn.selectpicker.defaults || {}, $this.data(), options); + config.template = $.extend( + {}, + Selectpicker.DEFAULTS.template, + $.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.template : {}, + $this.data().template, + options.template + ); + $this.data('selectpicker', (data = new Selectpicker(this, config))); + } else if (options) { + for (var i in options) { + if (options.hasOwnProperty(i)) { + data.options[i] = options[i]; + } + } + } + + if (typeof _option == 'string') { + if (data[_option] instanceof Function) { + value = data[_option].apply(data, args); + } else { + value = data.options[_option]; + } + } + } + }); + + if (typeof value !== 'undefined') { + //noinspection JSUnusedAssignment + return value; + } else { + return chain; + } + } + + var old = $.fn.selectpicker; + $.fn.selectpicker = Plugin; + $.fn.selectpicker.Constructor = Selectpicker; + + // SELECTPICKER NO CONFLICT + // ======================== + $.fn.selectpicker.noConflict = function () { + $.fn.selectpicker = old; + return this; + }; + + $(document) + .data('keycount', 0) + .on( + 'keydown.bs.select', + '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input', + Selectpicker.prototype.keydown + ) + .on( + 'focusin.modal', + '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input', + function (e) { + e.stopPropagation(); + } + ); + + // SELECTPICKER DATA-API + // ===================== + $(window).on('load.bs.select.data-api', function () { + $('.selectpicker').each(function () { + var $selectpicker = $(this); + Plugin.call($selectpicker, $selectpicker.data()); + }); + }); + })(jQuery); +}); diff --git a/src/main/webapp/content/js/bootstrap-switch-tags.js b/src/main/webapp/content/js/bootstrap-switch-tags.js new file mode 100644 index 0000000..069948b --- /dev/null +++ b/src/main/webapp/content/js/bootstrap-switch-tags.js @@ -0,0 +1,1495 @@ +/* ======================================================================== + * bootstrap-switch - v3.3.2 + * http://www.bootstrap-switch.org + * ======================================================================== + * Copyright 2012-2013 Mattia Larentis + * + * ======================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== + */ + +(function () { + var slice = [].slice; + + (function ($, window) { + 'use strict'; + var BootstrapSwitch; + BootstrapSwitch = (function () { + function BootstrapSwitch(element, options) { + if (options == null) { + options = {}; + } + this.$element = $(element); + this.options = $.extend( + {}, + $.fn.bootstrapSwitch.defaults, + { + state: this.$element.is(':checked'), + size: this.$element.data('size'), + animate: this.$element.data('animate'), + disabled: this.$element.is(':disabled'), + readonly: this.$element.is('[readonly]'), + indeterminate: this.$element.data('indeterminate'), + inverse: this.$element.data('inverse'), + radioAllOff: this.$element.data('radio-all-off'), + onColor: this.$element.data('on-color'), + offColor: this.$element.data('off-color'), + onText: this.$element.data('on-text'), + offText: this.$element.data('off-text'), + labelText: this.$element.data('label-text'), + handleWidth: this.$element.data('handle-width'), + labelWidth: this.$element.data('label-width'), + baseClass: this.$element.data('base-class'), + wrapperClass: this.$element.data('wrapper-class'), + }, + options + ); + this.prevOptions = {}; + this.$wrapper = $('
    ', { + class: (function (_this) { + return function () { + var classes; + classes = ['' + _this.options.baseClass].concat(_this._getClasses(_this.options.wrapperClass)); + classes.push(_this.options.state ? _this.options.baseClass + '-on' : _this.options.baseClass + '-off'); + if (_this.options.size != null) { + classes.push(_this.options.baseClass + '-' + _this.options.size); + } + if (_this.options.disabled) { + classes.push(_this.options.baseClass + '-disabled'); + } + if (_this.options.readonly) { + classes.push(_this.options.baseClass + '-readonly'); + } + if (_this.options.indeterminate) { + classes.push(_this.options.baseClass + '-indeterminate'); + } + if (_this.options.inverse) { + classes.push(_this.options.baseClass + '-inverse'); + } + if (_this.$element.attr('id')) { + classes.push(_this.options.baseClass + '-id-' + _this.$element.attr('id')); + } + return classes.join(' '); + }; + })(this)(), + }); + this.$container = $('
    ', { + class: this.options.baseClass + '-container', + }); + this.$on = $('', { + html: this.options.onText, + class: this.options.baseClass + '-handle-on ' + this.options.baseClass + '-' + this.options.onColor, + }); + this.$off = $('', { + html: this.options.offText, + class: this.options.baseClass + '-handle-off ' + this.options.baseClass + '-' + this.options.offColor, + }); + this.$label = $('', { + html: this.options.labelText, + class: this.options.baseClass + '-label', + }); + this.$element.on( + 'init.bootstrapSwitch', + (function (_this) { + return function () { + return _this.options.onInit.apply(element, arguments); + }; + })(this) + ); + this.$element.on( + 'switchChange.bootstrapSwitch', + (function (_this) { + return function (e) { + if (false === _this.options.onSwitchChange.apply(element, arguments)) { + if (_this.$element.is(':radio')) { + return $("[name='" + _this.$element.attr('name') + "']").trigger('previousState.bootstrapSwitch', true); + } else { + return _this.$element.trigger('previousState.bootstrapSwitch', true); + } + } + }; + })(this) + ); + this.$container = this.$element.wrap(this.$container).parent(); + this.$wrapper = this.$container.wrap(this.$wrapper).parent(); + this.$element + .before(this.options.inverse ? this.$off : this.$on) + .before(this.$label) + .before(this.options.inverse ? this.$on : this.$off); + if (this.options.indeterminate) { + this.$element.prop('indeterminate', true); + } + this._init(); + this._elementHandlers(); + this._handleHandlers(); + this._labelHandlers(); + this._formHandler(); + this._externalLabelHandler(); + this.$element.trigger('init.bootstrapSwitch', this.options.state); + } + + BootstrapSwitch.prototype._constructor = BootstrapSwitch; + + BootstrapSwitch.prototype.setPrevOptions = function () { + return (this.prevOptions = $.extend(true, {}, this.options)); + }; + + BootstrapSwitch.prototype.state = function (value, skip) { + if (typeof value === 'undefined') { + return this.options.state; + } + if (this.options.disabled || this.options.readonly) { + return this.$element; + } + if (this.options.state && !this.options.radioAllOff && this.$element.is(':radio')) { + return this.$element; + } + if (this.$element.is(':radio')) { + $("[name='" + this.$element.attr('name') + "']").trigger('setPreviousOptions.bootstrapSwitch'); + } else { + this.$element.trigger('setPreviousOptions.bootstrapSwitch'); + } + if (this.options.indeterminate) { + this.indeterminate(false); + } + value = !!value; + this.$element.prop('checked', value).trigger('change.bootstrapSwitch', skip); + return this.$element; + }; + + BootstrapSwitch.prototype.toggleState = function (skip) { + if (this.options.disabled || this.options.readonly) { + return this.$element; + } + if (this.options.indeterminate) { + this.indeterminate(false); + return this.state(true); + } else { + return this.$element.prop('checked', !this.options.state).trigger('change.bootstrapSwitch', skip); + } + }; + + BootstrapSwitch.prototype.size = function (value) { + if (typeof value === 'undefined') { + return this.options.size; + } + if (this.options.size != null) { + this.$wrapper.removeClass(this.options.baseClass + '-' + this.options.size); + } + if (value) { + this.$wrapper.addClass(this.options.baseClass + '-' + value); + } + this._width(); + this._containerPosition(); + this.options.size = value; + return this.$element; + }; + + BootstrapSwitch.prototype.animate = function (value) { + if (typeof value === 'undefined') { + return this.options.animate; + } + value = !!value; + if (value === this.options.animate) { + return this.$element; + } + return this.toggleAnimate(); + }; + + BootstrapSwitch.prototype.toggleAnimate = function () { + this.options.animate = !this.options.animate; + this.$wrapper.toggleClass(this.options.baseClass + '-animate'); + return this.$element; + }; + + BootstrapSwitch.prototype.disabled = function (value) { + if (typeof value === 'undefined') { + return this.options.disabled; + } + value = !!value; + if (value === this.options.disabled) { + return this.$element; + } + return this.toggleDisabled(); + }; + + BootstrapSwitch.prototype.toggleDisabled = function () { + this.options.disabled = !this.options.disabled; + this.$element.prop('disabled', this.options.disabled); + this.$wrapper.toggleClass(this.options.baseClass + '-disabled'); + return this.$element; + }; + + BootstrapSwitch.prototype.readonly = function (value) { + if (typeof value === 'undefined') { + return this.options.readonly; + } + value = !!value; + if (value === this.options.readonly) { + return this.$element; + } + return this.toggleReadonly(); + }; + + BootstrapSwitch.prototype.toggleReadonly = function () { + this.options.readonly = !this.options.readonly; + this.$element.prop('readonly', this.options.readonly); + this.$wrapper.toggleClass(this.options.baseClass + '-readonly'); + return this.$element; + }; + + BootstrapSwitch.prototype.indeterminate = function (value) { + if (typeof value === 'undefined') { + return this.options.indeterminate; + } + value = !!value; + if (value === this.options.indeterminate) { + return this.$element; + } + return this.toggleIndeterminate(); + }; + + BootstrapSwitch.prototype.toggleIndeterminate = function () { + this.options.indeterminate = !this.options.indeterminate; + this.$element.prop('indeterminate', this.options.indeterminate); + this.$wrapper.toggleClass(this.options.baseClass + '-indeterminate'); + this._containerPosition(); + return this.$element; + }; + + BootstrapSwitch.prototype.inverse = function (value) { + if (typeof value === 'undefined') { + return this.options.inverse; + } + value = !!value; + if (value === this.options.inverse) { + return this.$element; + } + return this.toggleInverse(); + }; + + BootstrapSwitch.prototype.toggleInverse = function () { + var $off, $on; + this.$wrapper.toggleClass(this.options.baseClass + '-inverse'); + $on = this.$on.clone(true); + $off = this.$off.clone(true); + this.$on.replaceWith($off); + this.$off.replaceWith($on); + this.$on = $off; + this.$off = $on; + this.options.inverse = !this.options.inverse; + return this.$element; + }; + + BootstrapSwitch.prototype.onColor = function (value) { + var color; + color = this.options.onColor; + if (typeof value === 'undefined') { + return color; + } + if (color != null) { + this.$on.removeClass(this.options.baseClass + '-' + color); + } + this.$on.addClass(this.options.baseClass + '-' + value); + this.options.onColor = value; + return this.$element; + }; + + BootstrapSwitch.prototype.offColor = function (value) { + var color; + color = this.options.offColor; + if (typeof value === 'undefined') { + return color; + } + if (color != null) { + this.$off.removeClass(this.options.baseClass + '-' + color); + } + this.$off.addClass(this.options.baseClass + '-' + value); + this.options.offColor = value; + return this.$element; + }; + + BootstrapSwitch.prototype.onText = function (value) { + if (typeof value === 'undefined') { + return this.options.onText; + } + this.$on.html(value); + this._width(); + this._containerPosition(); + this.options.onText = value; + return this.$element; + }; + + BootstrapSwitch.prototype.offText = function (value) { + if (typeof value === 'undefined') { + return this.options.offText; + } + this.$off.html(value); + this._width(); + this._containerPosition(); + this.options.offText = value; + return this.$element; + }; + + BootstrapSwitch.prototype.labelText = function (value) { + if (typeof value === 'undefined') { + return this.options.labelText; + } + this.$label.html(value); + this._width(); + this.options.labelText = value; + return this.$element; + }; + + BootstrapSwitch.prototype.handleWidth = function (value) { + if (typeof value === 'undefined') { + return this.options.handleWidth; + } + this.options.handleWidth = value; + this._width(); + this._containerPosition(); + return this.$element; + }; + + BootstrapSwitch.prototype.labelWidth = function (value) { + if (typeof value === 'undefined') { + return this.options.labelWidth; + } + this.options.labelWidth = value; + this._width(); + this._containerPosition(); + return this.$element; + }; + + BootstrapSwitch.prototype.baseClass = function (value) { + return this.options.baseClass; + }; + + BootstrapSwitch.prototype.wrapperClass = function (value) { + if (typeof value === 'undefined') { + return this.options.wrapperClass; + } + if (!value) { + value = $.fn.bootstrapSwitch.defaults.wrapperClass; + } + this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(' ')); + this.$wrapper.addClass(this._getClasses(value).join(' ')); + this.options.wrapperClass = value; + return this.$element; + }; + + BootstrapSwitch.prototype.radioAllOff = function (value) { + if (typeof value === 'undefined') { + return this.options.radioAllOff; + } + value = !!value; + if (value === this.options.radioAllOff) { + return this.$element; + } + this.options.radioAllOff = value; + return this.$element; + }; + + BootstrapSwitch.prototype.onInit = function (value) { + if (typeof value === 'undefined') { + return this.options.onInit; + } + if (!value) { + value = $.fn.bootstrapSwitch.defaults.onInit; + } + this.options.onInit = value; + return this.$element; + }; + + BootstrapSwitch.prototype.onSwitchChange = function (value) { + if (typeof value === 'undefined') { + return this.options.onSwitchChange; + } + if (!value) { + value = $.fn.bootstrapSwitch.defaults.onSwitchChange; + } + this.options.onSwitchChange = value; + return this.$element; + }; + + BootstrapSwitch.prototype.destroy = function () { + var $form; + $form = this.$element.closest('form'); + if ($form.length) { + $form.off('reset.bootstrapSwitch').removeData('bootstrap-switch'); + } + this.$container.children().not(this.$element).remove(); + this.$element.unwrap().unwrap().off('.bootstrapSwitch').removeData('bootstrap-switch'); + return this.$element; + }; + + BootstrapSwitch.prototype._width = function () { + var $handles, handleWidth; + $handles = this.$on.add(this.$off); + $handles.add(this.$label).css('width', ''); + handleWidth = this.options.handleWidth === 'auto' ? Math.max(this.$on.width(), this.$off.width()) : this.options.handleWidth; + $handles.width(handleWidth); + this.$label.width( + (function (_this) { + return function (index, width) { + if (_this.options.labelWidth !== 'auto') { + return _this.options.labelWidth; + } + if (width < handleWidth) { + return handleWidth; + } else { + return width; + } + }; + })(this) + ); + this._handleWidth = this.$on.outerWidth(); + this._labelWidth = this.$label.outerWidth(); + this.$container.width(this._handleWidth * 2 + this._labelWidth); + return this.$wrapper.width(this._handleWidth + this._labelWidth); + }; + + BootstrapSwitch.prototype._containerPosition = function (state, callback) { + if (state == null) { + state = this.options.state; + } + this.$container.css( + 'margin-left', + (function (_this) { + return function () { + var values; + values = [0, '-' + _this._handleWidth + 'px']; + if (_this.options.indeterminate) { + return '-' + _this._handleWidth / 2 + 'px'; + } + if (state) { + if (_this.options.inverse) { + return values[1]; + } else { + return values[0]; + } + } else { + if (_this.options.inverse) { + return values[0]; + } else { + return values[1]; + } + } + }; + })(this) + ); + if (!callback) { + return; + } + return setTimeout(function () { + return callback(); + }, 50); + }; + + BootstrapSwitch.prototype._init = function () { + var init, initInterval; + init = (function (_this) { + return function () { + _this.setPrevOptions(); + _this._width(); + return _this._containerPosition(null, function () { + if (_this.options.animate) { + return _this.$wrapper.addClass(_this.options.baseClass + '-animate'); + } + }); + }; + })(this); + if (this.$wrapper.is(':visible')) { + return init(); + } + return (initInterval = window.setInterval( + (function (_this) { + return function () { + if (_this.$wrapper.is(':visible')) { + init(); + return window.clearInterval(initInterval); + } + }; + })(this), + 50 + )); + }; + + BootstrapSwitch.prototype._elementHandlers = function () { + return this.$element.on({ + 'setPreviousOptions.bootstrapSwitch': (function (_this) { + return function (e) { + return _this.setPrevOptions(); + }; + })(this), + 'previousState.bootstrapSwitch': (function (_this) { + return function (e) { + _this.options = _this.prevOptions; + if (_this.options.indeterminate) { + _this.$wrapper.addClass(_this.options.baseClass + '-indeterminate'); + } + return _this.$element.prop('checked', _this.options.state).trigger('change.bootstrapSwitch', true); + }; + })(this), + 'change.bootstrapSwitch': (function (_this) { + return function (e, skip) { + var state; + e.preventDefault(); + e.stopImmediatePropagation(); + state = _this.$element.is(':checked'); + _this._containerPosition(state); + if (state === _this.options.state) { + return; + } + _this.options.state = state; + _this.$wrapper.toggleClass(_this.options.baseClass + '-off').toggleClass(_this.options.baseClass + '-on'); + if (!skip) { + if (_this.$element.is(':radio')) { + $("[name='" + _this.$element.attr('name') + "']") + .not(_this.$element) + .prop('checked', false) + .trigger('change.bootstrapSwitch', true); + } + return _this.$element.trigger('switchChange.bootstrapSwitch', [state]); + } + }; + })(this), + 'focus.bootstrapSwitch': (function (_this) { + return function (e) { + e.preventDefault(); + return _this.$wrapper.addClass(_this.options.baseClass + '-focused'); + }; + })(this), + 'blur.bootstrapSwitch': (function (_this) { + return function (e) { + e.preventDefault(); + return _this.$wrapper.removeClass(_this.options.baseClass + '-focused'); + }; + })(this), + 'keydown.bootstrapSwitch': (function (_this) { + return function (e) { + if (!e.which || _this.options.disabled || _this.options.readonly) { + return; + } + switch (e.which) { + case 37: + e.preventDefault(); + e.stopImmediatePropagation(); + return _this.state(false); + case 39: + e.preventDefault(); + e.stopImmediatePropagation(); + return _this.state(true); + } + }; + })(this), + }); + }; + + BootstrapSwitch.prototype._handleHandlers = function () { + this.$on.on( + 'click.bootstrapSwitch', + (function (_this) { + return function (event) { + event.preventDefault(); + event.stopPropagation(); + _this.state(false); + return _this.$element.trigger('focus.bootstrapSwitch'); + }; + })(this) + ); + return this.$off.on( + 'click.bootstrapSwitch', + (function (_this) { + return function (event) { + event.preventDefault(); + event.stopPropagation(); + _this.state(true); + return _this.$element.trigger('focus.bootstrapSwitch'); + }; + })(this) + ); + }; + + BootstrapSwitch.prototype._labelHandlers = function () { + return this.$label.on({ + click: function (e) { + return e.stopPropagation(); + }, + 'mousedown.bootstrapSwitch touchstart.bootstrapSwitch': (function (_this) { + return function (e) { + if (_this._dragStart || _this.options.disabled || _this.options.readonly) { + return; + } + e.preventDefault(); + e.stopPropagation(); + _this._dragStart = (e.pageX || e.originalEvent.touches[0].pageX) - parseInt(_this.$container.css('margin-left'), 10); + if (_this.options.animate) { + _this.$wrapper.removeClass(_this.options.baseClass + '-animate'); + } + return _this.$element.trigger('focus.bootstrapSwitch'); + }; + })(this), + 'mousemove.bootstrapSwitch touchmove.bootstrapSwitch': (function (_this) { + return function (e) { + var difference; + if (_this._dragStart == null) { + return; + } + e.preventDefault(); + difference = (e.pageX || e.originalEvent.touches[0].pageX) - _this._dragStart; + if (difference < -_this._handleWidth || difference > 0) { + return; + } + _this._dragEnd = difference; + return _this.$container.css('margin-left', _this._dragEnd + 'px'); + }; + })(this), + 'mouseup.bootstrapSwitch touchend.bootstrapSwitch': (function (_this) { + return function (e) { + var state; + if (!_this._dragStart) { + return; + } + e.preventDefault(); + if (_this.options.animate) { + _this.$wrapper.addClass(_this.options.baseClass + '-animate'); + } + if (_this._dragEnd) { + state = _this._dragEnd > -(_this._handleWidth / 2); + _this._dragEnd = false; + _this.state(_this.options.inverse ? !state : state); + } else { + _this.state(!_this.options.state); + } + return (_this._dragStart = false); + }; + })(this), + 'mouseleave.bootstrapSwitch': (function (_this) { + return function (e) { + return _this.$label.trigger('mouseup.bootstrapSwitch'); + }; + })(this), + }); + }; + + BootstrapSwitch.prototype._externalLabelHandler = function () { + var $externalLabel; + $externalLabel = this.$element.closest('label'); + return $externalLabel.on( + 'click', + (function (_this) { + return function (event) { + event.preventDefault(); + event.stopImmediatePropagation(); + if (event.target === $externalLabel[0]) { + return _this.toggleState(); + } + }; + })(this) + ); + }; + + BootstrapSwitch.prototype._formHandler = function () { + var $form; + $form = this.$element.closest('form'); + if ($form.data('bootstrap-switch')) { + return; + } + return $form + .on('reset.bootstrapSwitch', function () { + return window.setTimeout(function () { + return $form + .find('input') + .filter(function () { + return $(this).data('bootstrap-switch'); + }) + .each(function () { + return $(this).bootstrapSwitch('state', this.checked); + }); + }, 1); + }) + .data('bootstrap-switch', true); + }; + + BootstrapSwitch.prototype._getClasses = function (classes) { + var c, cls, i, len; + if (!$.isArray(classes)) { + return [this.options.baseClass + '-' + classes]; + } + cls = []; + for (i = 0, len = classes.length; i < len; i++) { + c = classes[i]; + cls.push(this.options.baseClass + '-' + c); + } + return cls; + }; + + return BootstrapSwitch; + })(); + $.fn.bootstrapSwitch = function () { + var args, option, ret; + (option = arguments[0]), (args = 2 <= arguments.length ? slice.call(arguments, 1) : []); + ret = this; + this.each(function () { + var $this, data; + $this = $(this); + data = $this.data('bootstrap-switch'); + if (!data) { + $this.data('bootstrap-switch', (data = new BootstrapSwitch(this, option))); + } + if (typeof option === 'string') { + return (ret = data[option].apply(data, args)); + } + }); + return ret; + }; + $.fn.bootstrapSwitch.Constructor = BootstrapSwitch; + return ($.fn.bootstrapSwitch.defaults = { + state: true, + size: null, + animate: true, + disabled: false, + readonly: false, + indeterminate: false, + inverse: false, + radioAllOff: false, + onColor: 'primary', + offColor: 'default', + onText: 'ON', + offText: 'OFF', + labelText: ' ', + handleWidth: 'auto', + labelWidth: 'auto', + baseClass: 'bootstrap-switch', + wrapperClass: 'wrapper', + onInit: function () {}, + onSwitchChange: function () {}, + }); + })(window.jQuery, window); +}.call(this)); + +// +/* + * bootstrap-tagsinput v0.8.0 + * + */ + +(function ($) { + 'use strict'; + + var defaultOptions = { + tagClass: function (item) { + return 'label label-info'; + }, + focusClass: 'focus', + itemValue: function (item) { + return item ? item.toString() : item; + }, + itemText: function (item) { + return this.itemValue(item); + }, + itemTitle: function (item) { + return null; + }, + freeInput: true, + addOnBlur: true, + maxTags: undefined, + maxChars: undefined, + confirmKeys: [13, 44], + delimiter: ',', + delimiterRegex: null, + cancelConfirmKeysOnEmpty: false, + onTagExists: function (item, $tag) { + $tag.hide().fadeIn(); + }, + trimValue: false, + allowDuplicates: false, + triggerChange: true, + }; + + /** + * Constructor function + */ + function TagsInput(element, options) { + this.isInit = true; + this.itemsArray = []; + + this.$element = $(element); + this.$element.hide(); + + this.isSelect = element.tagName === 'SELECT'; + this.multiple = this.isSelect && element.hasAttribute('multiple'); + this.objectItems = options && options.itemValue; + this.placeholderText = element.hasAttribute('placeholder') ? this.$element.attr('placeholder') : ''; + this.inputSize = Math.max(1, this.placeholderText.length); + + this.$container = $('
    '); + this.$input = $('').appendTo(this.$container); + + this.$element.before(this.$container); + + this.build(options); + this.isInit = false; + } + + TagsInput.prototype = { + constructor: TagsInput, + + /** + * Adds the given item as a new tag. Pass true to dontPushVal to prevent + * updating the elements val() + */ + add: function (item, dontPushVal, options) { + var self = this; + + if (self.options.maxTags && self.itemsArray.length >= self.options.maxTags) return; + + // Ignore falsey values, except false + if (item !== false && !item) return; + + // Trim value + if (typeof item === 'string' && self.options.trimValue) { + item = $.trim(item); + } + + // Throw an error when trying to add an object while the itemValue option was not set + if (typeof item === 'object' && !self.objectItems) throw "Can't add objects when itemValue option is not set"; + + // Ignore strings only containg whitespace + if (item.toString().match(/^\s*$/)) return; + + // If SELECT but not multiple, remove current tag + if (self.isSelect && !self.multiple && self.itemsArray.length > 0) self.remove(self.itemsArray[0]); + + if (typeof item === 'string' && this.$element[0].tagName === 'INPUT') { + var delimiter = self.options.delimiterRegex ? self.options.delimiterRegex : self.options.delimiter; + var items = item.split(delimiter); + if (items.length > 1) { + for (var i = 0; i < items.length; i++) { + this.add(items[i], true); + } + + if (!dontPushVal) self.pushVal(self.options.triggerChange); + return; + } + } + + var itemValue = self.options.itemValue(item), + itemText = self.options.itemText(item), + tagClass = self.options.tagClass(item), + itemTitle = self.options.itemTitle(item); + + // Ignore items allready added + var existing = $.grep(self.itemsArray, function (item) { + return self.options.itemValue(item) === itemValue; + })[0]; + if (existing && !self.options.allowDuplicates) { + // Invoke onTagExists + if (self.options.onTagExists) { + var $existingTag = $('.tag', self.$container).filter(function () { + return $(this).data('item') === existing; + }); + self.options.onTagExists(item, $existingTag); + } + return; + } + + // if length greater than limit + if (self.items().toString().length + item.length + 1 > self.options.maxInputLength) return; + + // raise beforeItemAdd arg + var beforeItemAddEvent = $.Event('beforeItemAdd', { item: item, cancel: false, options: options }); + self.$element.trigger(beforeItemAddEvent); + if (beforeItemAddEvent.cancel) return; + + // register item in internal array and map + self.itemsArray.push(item); + + // add a tag element + + var $tag = $( + '' + + htmlEncode(itemText) + + '' + ); + $tag.data('item', item); + self.findInputWrapper().before($tag); + $tag.after(' '); + + // Check to see if the tag exists in its raw or uri-encoded form + var optionExists = + $('option[value="' + encodeURIComponent(itemValue) + '"]', self.$element).length || + $('option[value="' + htmlEncode(itemValue) + '"]', self.$element).length; + + // add
    ').addClass('cw').text('#')); + } + + while (currentDate.isBefore(viewDate.clone().endOf('w'))) { + row.append($('').addClass('dow').text(currentDate.format('dd'))); + currentDate.add(1, 'd'); + } + widget.find('.datepicker-days thead').append(row); + }, + isInDisabledDates = function (testDate) { + return options.disabledDates[testDate.format('YYYY-MM-DD')] === true; + }, + isInEnabledDates = function (testDate) { + return options.enabledDates[testDate.format('YYYY-MM-DD')] === true; + }, + isInDisabledHours = function (testDate) { + return options.disabledHours[testDate.format('H')] === true; + }, + isInEnabledHours = function (testDate) { + return options.enabledHours[testDate.format('H')] === true; + }, + isValid = function (targetMoment, granularity) { + if (!targetMoment.isValid()) { + return false; + } + if (options.disabledDates && granularity === 'd' && isInDisabledDates(targetMoment)) { + return false; + } + if (options.enabledDates && granularity === 'd' && !isInEnabledDates(targetMoment)) { + return false; + } + if (options.minDate && targetMoment.isBefore(options.minDate, granularity)) { + return false; + } + if (options.maxDate && targetMoment.isAfter(options.maxDate, granularity)) { + return false; + } + if (options.daysOfWeekDisabled && granularity === 'd' && options.daysOfWeekDisabled.indexOf(targetMoment.day()) !== -1) { + return false; + } + if ( + options.disabledHours && + (granularity === 'h' || granularity === 'm' || granularity === 's') && + isInDisabledHours(targetMoment) + ) { + return false; + } + if ( + options.enabledHours && + (granularity === 'h' || granularity === 'm' || granularity === 's') && + !isInEnabledHours(targetMoment) + ) { + return false; + } + if (options.disabledTimeIntervals && (granularity === 'h' || granularity === 'm' || granularity === 's')) { + var found = false; + $.each(options.disabledTimeIntervals, function () { + if (targetMoment.isBetween(this[0], this[1])) { + found = true; + return false; + } + }); + if (found) { + return false; + } + } + return true; + }, + fillMonths = function () { + var spans = [], + monthsShort = viewDate.clone().startOf('y').startOf('d'); + while (monthsShort.isSame(viewDate, 'y')) { + spans.push($('').attr('data-action', 'selectMonth').addClass('month').text(monthsShort.format('MMM'))); + monthsShort.add(1, 'M'); + } + widget.find('.datepicker-months td').empty().append(spans); + }, + updateMonths = function () { + var monthsView = widget.find('.datepicker-months'), + monthsViewHeader = monthsView.find('th'), + months = monthsView.find('tbody').find('span'); + + monthsViewHeader.eq(0).find('span').attr('title', options.tooltips.prevYear); + monthsViewHeader.eq(1).attr('title', options.tooltips.selectYear); + monthsViewHeader.eq(2).find('span').attr('title', options.tooltips.nextYear); + + monthsView.find('.disabled').removeClass('disabled'); + + if (!isValid(viewDate.clone().subtract(1, 'y'), 'y')) { + monthsViewHeader.eq(0).addClass('disabled'); + } + + monthsViewHeader.eq(1).text(viewDate.year()); + + if (!isValid(viewDate.clone().add(1, 'y'), 'y')) { + monthsViewHeader.eq(2).addClass('disabled'); + } + + months.removeClass('active'); + if (date.isSame(viewDate, 'y') && !unset) { + months.eq(date.month()).addClass('active'); + } + + months.each(function (index) { + if (!isValid(viewDate.clone().month(index), 'M')) { + $(this).addClass('disabled'); + } + }); + }, + updateYears = function () { + var yearsView = widget.find('.datepicker-years'), + yearsViewHeader = yearsView.find('th'), + startYear = viewDate.clone().subtract(5, 'y'), + endYear = viewDate.clone().add(6, 'y'), + html = ''; + + yearsViewHeader.eq(0).find('span').attr('title', options.tooltips.prevDecade); + yearsViewHeader.eq(1).attr('title', options.tooltips.selectDecade); + yearsViewHeader.eq(2).find('span').attr('title', options.tooltips.nextDecade); + + yearsView.find('.disabled').removeClass('disabled'); + + if (options.minDate && options.minDate.isAfter(startYear, 'y')) { + yearsViewHeader.eq(0).addClass('disabled'); + } + + yearsViewHeader.eq(1).text(startYear.year() + '-' + endYear.year()); + + if (options.maxDate && options.maxDate.isBefore(endYear, 'y')) { + yearsViewHeader.eq(2).addClass('disabled'); + } + + while (!startYear.isAfter(endYear, 'y')) { + html += + '' + + startYear.year() + + ''; + startYear.add(1, 'y'); + } + + yearsView.find('td').html(html); + }, + updateDecades = function () { + var decadesView = widget.find('.datepicker-decades'), + decadesViewHeader = decadesView.find('th'), + startDecade = moment({ y: viewDate.year() - (viewDate.year() % 100) - 1 }), + endDecade = startDecade.clone().add(100, 'y'), + startedAt = startDecade.clone(), + minDateDecade = false, + maxDateDecade = false, + endDecadeYear, + html = ''; + + decadesViewHeader.eq(0).find('span').attr('title', options.tooltips.prevCentury); + decadesViewHeader.eq(2).find('span').attr('title', options.tooltips.nextCentury); + + decadesView.find('.disabled').removeClass('disabled'); + + if (startDecade.isSame(moment({ y: 1900 })) || (options.minDate && options.minDate.isAfter(startDecade, 'y'))) { + decadesViewHeader.eq(0).addClass('disabled'); + } + + decadesViewHeader.eq(1).text(startDecade.year() + '-' + endDecade.year()); + + if (startDecade.isSame(moment({ y: 2000 })) || (options.maxDate && options.maxDate.isBefore(endDecade, 'y'))) { + decadesViewHeader.eq(2).addClass('disabled'); + } + + while (!startDecade.isAfter(endDecade, 'y')) { + endDecadeYear = startDecade.year() + 12; + minDateDecade = options.minDate && options.minDate.isAfter(startDecade, 'y') && options.minDate.year() <= endDecadeYear; + maxDateDecade = options.maxDate && options.maxDate.isAfter(startDecade, 'y') && options.maxDate.year() <= endDecadeYear; + html += + '' + + (startDecade.year() + 1) + + ' - ' + + (startDecade.year() + 12) + + ''; + startDecade.add(12, 'y'); + } + html += ''; //push the dangling block over, at least this way it's even + + decadesView.find('td').html(html); + decadesViewHeader.eq(1).text(startedAt.year() + 1 + '-' + startDecade.year()); + }, + fillDate = function () { + var daysView = widget.find('.datepicker-days'), + daysViewHeader = daysView.find('th'), + currentDate, + html = [], + row, + clsNames = [], + i; + + if (!hasDate()) { + return; + } + + daysViewHeader.eq(0).find('span').attr('title', options.tooltips.prevMonth); + daysViewHeader.eq(1).attr('title', options.tooltips.selectMonth); + daysViewHeader.eq(2).find('span').attr('title', options.tooltips.nextMonth); + + daysView.find('.disabled').removeClass('disabled'); + daysViewHeader.eq(1).text(viewDate.format(options.dayViewHeaderFormat)); + + if (!isValid(viewDate.clone().subtract(1, 'M'), 'M')) { + daysViewHeader.eq(0).addClass('disabled'); + } + if (!isValid(viewDate.clone().add(1, 'M'), 'M')) { + daysViewHeader.eq(2).addClass('disabled'); + } + + currentDate = viewDate.clone().startOf('M').startOf('w').startOf('d'); + + for (i = 0; i < 42; i++) { + //always display 42 days (should show 6 weeks) + if (currentDate.weekday() === 0) { + row = $('
    ' + currentDate.week() + '
    ' + + currentDate.date() + + '
    ' + + currentHour.format(use24Hours ? 'HH' : 'hh') + + '
    ' + + currentMinute.format('mm') + + '
    ' + + currentSecond.format('ss') + + '
    ', + '
    ', + '
    ', + this.options.formatLoadingMessage(), + '
    ', + '
    ', + '', + this.options.paginationVAlign === 'bottom' || this.options.paginationVAlign === 'both' + ? '
    ' + : '', + '', + '', + ].join('') + ); + + this.$container.insertAfter(this.$el); + this.$tableContainer = this.$container.find('.fixed-table-container'); + this.$tableHeader = this.$container.find('.fixed-table-header'); + this.$tableBody = this.$container.find('.fixed-table-body'); + this.$tableLoading = this.$container.find('.fixed-table-loading'); + this.$tableFooter = this.$container.find('.fixed-table-footer'); + this.$toolbar = this.$container.find('.fixed-table-toolbar'); + this.$pagination = this.$container.find('.fixed-table-pagination'); + + this.$tableBody.append(this.$el); + this.$container.after('
    '); + + this.$el.addClass(this.options.classes); + if (this.options.striped) { + this.$el.addClass('table-striped'); + } + if ($.inArray('table-no-bordered', this.options.classes.split(' ')) !== -1) { + this.$tableContainer.addClass('table-no-bordered'); + } + }; + + BootstrapTable.prototype.initTable = function () { + var that = this, + columns = [], + data = []; + + this.$header = this.$el.find('thead'); + if (!this.$header.length) { + this.$header = $('
    ', this.header.fields.length)); + } + + if (!this.options.cardView && this.options.detailView) { + html.push( + '', + '', + sprintf('', this.options.iconsPrefix, this.options.icons.detailOpen), + '', + '', + '', + that.options.cardView ? '' : '
    %s
    %s
    ' + this.renderHeadTrHtml() + '
    '; + }, + renderHeadIntroHtml: function () { + return this.renderIntroHtml(); + }, + renderHeadTrHtml: function () { + return ( + '
    1 ? ' colspan="' + e + '"' : '') + + (n ? ' ' + n : '') + + '>' + + i.buildGotoAnchorHtml({ date: t, forceOff: this.rowCnt > 1 || 1 === this.colCnt }, tt(t.format(this.colHeadFormat))) + + '
    ' + + this.renderBgTrHtml(t) + + '
    ' + + (this.numbersVisible ? '' + this.renderNumberTrHtml(t) + '' : '') + + '
    ' + ); + }, + renderNumberTrHtml: function (t) { + return ( + '' + + (this.isRTL ? '' : this.renderNumberIntroHtml(t)) + + this.renderNumberCellsHtml(t) + + (this.isRTL ? this.renderNumberIntroHtml(t) : '') + + '' + ); + }, + renderNumberIntroHtml: function (t) { + return this.renderIntroHtml(); + }, + renderNumberCellsHtml: function (t) { + var e, + n, + i = []; + for (e = 0; e < this.colCnt; e++) (n = this.getCellDate(t, e)), i.push(this.renderNumberCellHtml(n)); + return i.join(''); + }, + renderNumberCellHtml: function (t) { + var e, + n, + i = ''; + return this.view.dayNumbersVisible || this.view.cellWeekNumbersVisible + ? ((e = this.getDayClasses(t)), + e.unshift('fc-day-top'), + this.view.cellWeekNumbersVisible && (n = 'ISO' === t._locale._fullCalendar_weekCalc ? 1 : t._locale.firstDayOfWeek()), + (i += ''), + this.view.cellWeekNumbersVisible && + t.day() == n && + (i += this.view.buildGotoAnchorHtml({ date: t, type: 'week' }, { class: 'fc-week-number' }, t.format('w'))), + this.view.dayNumbersVisible && (i += this.view.buildGotoAnchorHtml(t, { class: 'fc-day-number' }, t.date())), + (i += '')) + : ''; + }, + computeEventTimeFormat: function () { + return this.view.opt('extraSmallTimeFormat'); + }, + computeDisplayEventEnd: function () { + return 1 == this.colCnt; + }, + rangeUpdated: function () { + this.updateDayTable(); + }, + spanToSegs: function (t) { + var e, + n, + i = this.sliceRangeByRow(t); + for (e = 0; e < i.length; e++) + (n = i[e]), + this.isRTL + ? ((n.leftCol = this.daysPerRow - 1 - n.lastRowDayIndex), (n.rightCol = this.daysPerRow - 1 - n.firstRowDayIndex)) + : ((n.leftCol = n.firstRowDayIndex), (n.rightCol = n.lastRowDayIndex)); + return i; + }, + prepareHits: function () { + this.colCoordCache.build(), this.rowCoordCache.build(), (this.rowCoordCache.bottoms[this.rowCnt - 1] += this.bottomCoordPadding); + }, + releaseHits: function () { + this.colCoordCache.clear(), this.rowCoordCache.clear(); + }, + queryHit: function (t, e) { + if (this.colCoordCache.isLeftInBounds(t) && this.rowCoordCache.isTopInBounds(e)) { + var n = this.colCoordCache.getHorizontalIndex(t), + i = this.rowCoordCache.getVerticalIndex(e); + if (null != i && null != n) return this.getCellHit(i, n); + } + }, + getHitSpan: function (t) { + return this.getCellRange(t.row, t.col); + }, + getHitEl: function (t) { + return this.getCellEl(t.row, t.col); + }, + getCellHit: function (t, e) { + return { + row: t, + col: e, + component: this, + left: this.colCoordCache.getLeftOffset(e), + right: this.colCoordCache.getRightOffset(e), + top: this.rowCoordCache.getTopOffset(t), + bottom: this.rowCoordCache.getBottomOffset(t), + }; + }, + getCellEl: function (t, e) { + return this.cellEls.eq(t * this.colCnt + e); + }, + renderDrag: function (t, e) { + if ((this.renderHighlight(this.eventToSpan(t)), e && e.component !== this)) return this.renderEventLocationHelper(t, e); + }, + unrenderDrag: function () { + this.unrenderHighlight(), this.unrenderHelper(); + }, + renderEventResize: function (t, e) { + return this.renderHighlight(this.eventToSpan(t)), this.renderEventLocationHelper(t, e); + }, + unrenderEventResize: function () { + this.unrenderHighlight(), this.unrenderHelper(); + }, + renderHelper: function (e, n) { + var i, + r = [], + s = this.eventToSegs(e); + return ( + (s = this.renderFgSegEls(s)), + (i = this.renderSegRows(s)), + this.rowEls.each(function (e, s) { + var o, + l = t(s), + a = t('
    '); + (o = n && n.row === e ? n.el.position().top : l.find('.fc-content-skeleton tbody').position().top), + a.css('top', o).find('table').append(i[e].tbodyEl), + l.append(a), + r.push(a[0]); + }), + (this.helperEls = t(r)) + ); + }, + unrenderHelper: function () { + this.helperEls && (this.helperEls.remove(), (this.helperEls = null)); + }, + fillSegTag: 'td', + renderFill: function (e, n, i) { + var r, + s, + o, + l = []; + for (n = this.renderFillSegEls(e, n), r = 0; r < n.length; r++) + (s = n[r]), (o = this.renderFillRow(e, s, i)), this.rowEls.eq(s.row).append(o), l.push(o[0]); + return (this.elsByFill[e] = t(l)), n; + }, + renderFillRow: function (e, n, i) { + var r, + s, + o = this.colCnt, + l = n.leftCol, + a = n.rightCol + 1; + return ( + (i = i || e.toLowerCase()), + (r = t('
    ')), + (s = r.find('tr')), + l > 0 && s.append(''), + s.append(n.el.attr('colspan', a - l)), + a < o && s.append(''), + this.bookendCells(s), + r + ); + }, + })); + Se.mixin({ + rowStructs: null, + unrenderEvents: function () { + this.removeSegPopover(), me.prototype.unrenderEvents.apply(this, arguments); + }, + getEventSegs: function () { + return me.prototype.getEventSegs.call(this).concat(this.popoverSegs || []); + }, + renderBgSegs: function (e) { + var n = t.grep(e, function (t) { + return t.event.allDay; + }); + return me.prototype.renderBgSegs.call(this, n); + }, + renderFgSegs: function (e) { + var n; + return ( + (e = this.renderFgSegEls(e)), + (n = this.rowStructs = this.renderSegRows(e)), + this.rowEls.each(function (e, i) { + t(i).find('.fc-content-skeleton > table').append(n[e].tbodyEl); + }), + e + ); + }, + unrenderFgSegs: function () { + for (var t, e = this.rowStructs || []; (t = e.pop()); ) t.tbodyEl.remove(); + this.rowStructs = null; + }, + renderSegRows: function (t) { + var e, + n, + i = []; + for (e = this.groupSegRows(t), n = 0; n < e.length; n++) i.push(this.renderSegRow(n, e[n])); + return i; + }, + fgSegHtml: function (t, e) { + var n, + i, + r = this.view, + s = t.event, + o = r.isEventDraggable(s), + l = !e && s.allDay && t.isStart && r.isEventResizableFromStart(s), + a = !e && s.allDay && t.isEnd && r.isEventResizableFromEnd(s), + u = this.getSegClasses(t, o, l || a), + c = nt(this.getSegSkinCss(t)), + d = ''; + return ( + u.unshift('fc-day-grid-event', 'fc-h-event'), + t.isStart && ((n = this.getEventTimeText(s)), n && (d = '' + tt(n) + '')), + (i = '' + (tt(s.title || '') || ' ') + ''), + '
    ' + + (this.isRTL ? i + ' ' + d : d + ' ' + i) + + '
    ' + + (l ? '
    ' : '') + + (a ? '
    ' : '') + + '' + ); + }, + renderSegRow: function (e, n) { + function i(e) { + for (; o < e; ) + (c = (m[r - 1] || [])[o]), + c ? c.attr('rowspan', parseInt(c.attr('rowspan') || 1, 10) + 1) : ((c = t('')), l.append(c)), + (v[r][o] = c), + (m[r][o] = c), + o++; + } + var r, + s, + o, + l, + a, + u, + c, + d = this.colCnt, + h = this.buildSegLevels(n), + f = Math.max(1, h.length), + g = t(''), + p = [], + v = [], + m = []; + for (r = 0; r < f; r++) { + if (((s = h[r]), (o = 0), (l = t('')), p.push([]), v.push([]), m.push([]), s)) + for (a = 0; a < s.length; a++) { + for ( + u = s[a], + i(u.leftCol), + c = t('').append(u.el), + u.leftCol != u.rightCol ? c.attr('colspan', u.rightCol - u.leftCol + 1) : (m[r][o] = c); + o <= u.rightCol; + + ) + (v[r][o] = c), (p[r][o] = u), o++; + l.append(c); + } + i(d), this.bookendCells(l), g.append(l); + } + return { row: e, tbodyEl: g, cellMatrix: v, segMatrix: p, segLevels: h, segs: n }; + }, + buildSegLevels: function (t) { + var e, + n, + i, + r = []; + for (this.sortEventSegs(t), e = 0; e < t.length; e++) { + for (n = t[e], i = 0; i < r.length && Bt(n, r[i]); i++); + (n.level = i), (r[i] || (r[i] = [])).push(n); + } + for (i = 0; i < r.length; i++) r[i].sort(zt); + return r; + }, + groupSegRows: function (t) { + var e, + n = []; + for (e = 0; e < this.rowCnt; e++) n.push([]); + for (e = 0; e < t.length; e++) n[t[e].row].push(t[e]); + return n; + }, + }), + Se.mixin({ + segPopover: null, + popoverSegs: null, + removeSegPopover: function () { + this.segPopover && this.segPopover.hide(); + }, + limitRows: function (t) { + var e, + n, + i = this.rowStructs || []; + for (e = 0; e < i.length; e++) + this.unlimitRow(e), (n = !!t && ('number' == typeof t ? t : this.computeRowLevelLimit(e))), n !== !1 && this.limitRow(e, n); + }, + computeRowLevelLimit: function (e) { + function n(e, n) { + s = Math.max(s, t(n).outerHeight()); + } + var i, + r, + s, + o = this.rowEls.eq(e), + l = o.height(), + a = this.rowStructs[e].tbodyEl.children(); + for (i = 0; i < a.length; i++) + if (((r = a.eq(i).removeClass('fc-limited')), (s = 0), r.find('> td > :first-child').each(n), r.position().top + s > l)) return i; + return !1; + }, + limitRow: function (e, n) { + function i(i) { + for (; b < i; ) + (u = S.getCellSegs(e, b, n)), + u.length && ((h = s[n - 1][b]), (y = S.renderMoreLink(e, b, u)), (m = t('
    ').append(y)), h.append(m), E.push(m[0])), + b++; + } + var r, + s, + o, + l, + a, + u, + c, + d, + h, + f, + g, + p, + v, + m, + y, + S = this, + w = this.rowStructs[e], + E = [], + b = 0; + if (n && n < w.segLevels.length) { + for ( + r = w.segLevels[n - 1], s = w.cellMatrix, o = w.tbodyEl.children().slice(n).addClass('fc-limited').get(), l = 0; + l < r.length; + l++ + ) { + for (a = r[l], i(a.leftCol), d = [], c = 0; b <= a.rightCol; ) (u = this.getCellSegs(e, b, n)), d.push(u), (c += u.length), b++; + if (c) { + for (h = s[n - 1][a.leftCol], f = h.attr('rowspan') || 1, g = [], p = 0; p < d.length; p++) + (v = t('').attr('rowspan', f)), + (u = d[p]), + (y = this.renderMoreLink(e, a.leftCol + p, [a].concat(u))), + (m = t('
    ').append(y)), + v.append(m), + g.push(v[0]), + E.push(v[0]); + h.addClass('fc-limited').after(t(g)), o.push(h[0]); + } + } + i(this.colCnt), (w.moreEls = t(E)), (w.limitedEls = t(o)); + } + }, + unlimitRow: function (t) { + var e = this.rowStructs[t]; + e.moreEls && (e.moreEls.remove(), (e.moreEls = null)), + e.limitedEls && (e.limitedEls.removeClass('fc-limited'), (e.limitedEls = null)); + }, + renderMoreLink: function (e, n, i) { + var r = this, + s = this.view; + return t('') + .text(this.getMoreLinkText(i.length)) + .on('click', function (o) { + var l = s.opt('eventLimitClick'), + a = r.getCellDate(e, n), + u = t(this), + c = r.getCellEl(e, n), + d = r.getCellSegs(e, n), + h = r.resliceDaySegs(d, a), + f = r.resliceDaySegs(i, a); + 'function' == typeof l && + (l = s.publiclyTrigger('eventLimitClick', null, { date: a, dayEl: c, moreEl: u, segs: h, hiddenSegs: f }, o)), + 'popover' === l ? r.showSegPopover(e, n, u, h) : 'string' == typeof l && s.calendar.zoomTo(a, l); + }); + }, + showSegPopover: function (t, e, n, i) { + var r, + s, + o = this, + l = this.view, + a = n.parent(); + (r = 1 == this.rowCnt ? l.el : this.rowEls.eq(t)), + (s = { + className: 'fc-more-popover', + content: this.renderSegPopoverContent(t, e, i), + parentEl: this.view.el, + top: r.offset().top, + autoHide: !0, + viewportConstrain: l.opt('popoverViewportConstrain'), + hide: function () { + if (o.popoverSegs) + for (var t, e = 0; e < o.popoverSegs.length; ++e) + (t = o.popoverSegs[e]), l.publiclyTrigger('eventDestroy', t.event, t.event, t.el); + o.segPopover.removeElement(), (o.segPopover = null), (o.popoverSegs = null); + }, + }), + this.isRTL ? (s.right = a.offset().left + a.outerWidth() + 1) : (s.left = a.offset().left - 1), + (this.segPopover = new he(s)), + this.segPopover.show(), + this.bindSegHandlersToEl(this.segPopover.el); + }, + renderSegPopoverContent: function (e, n, i) { + var r, + s = this.view, + o = s.opt('theme'), + l = this.getCellDate(e, n).format(s.opt('dayPopoverFormat')), + a = t( + '
    ' + + tt(l) + + '
    ' + ), + u = a.find('.fc-event-container'); + for (i = this.renderFgSegEls(i, !0), this.popoverSegs = i, r = 0; r < i.length; r++) + this.prepareHits(), (i[r].hit = this.getCellHit(e, n)), this.releaseHits(), u.append(i[r].el); + return a; + }, + resliceDaySegs: function (e, n) { + var i = t.map(e, function (t) { + return t.event; + }), + r = n.clone(), + s = r.clone().add(1, 'days'), + o = { start: r, end: s }; + return ( + (e = this.eventsToSegs(i, function (t) { + var e = F(t, o); + return e ? [e] : []; + })), + this.sortEventSegs(e), + e + ); + }, + getMoreLinkText: function (t) { + var e = this.view.opt('eventLimitText'); + return 'function' == typeof e ? e(t) : '+' + t + ' ' + e; + }, + getCellSegs: function (t, e, n) { + for (var i, r = this.rowStructs[t].segMatrix, s = n || 0, o = []; s < r.length; ) (i = r[s][e]), i && o.push(i), s++; + return o; + }, + }); + var we = (qt.TimeGrid = me.extend(ye, { + slotDuration: null, + snapDuration: null, + snapsPerSlot: null, + minTime: null, + maxTime: null, + labelFormat: null, + labelInterval: null, + colEls: null, + slatContainerEl: null, + slatEls: null, + nowIndicatorEls: null, + colCoordCache: null, + slatCoordCache: null, + constructor: function () { + me.apply(this, arguments), this.processOptions(); + }, + renderDates: function () { + this.el.html(this.renderHtml()), + (this.colEls = this.el.find('.fc-day')), + (this.slatContainerEl = this.el.find('.fc-slats')), + (this.slatEls = this.slatContainerEl.find('tr')), + (this.colCoordCache = new fe({ els: this.colEls, isHorizontal: !0 })), + (this.slatCoordCache = new fe({ els: this.slatEls, isVertical: !0 })), + this.renderContentSkeleton(); + }, + renderHtml: function () { + return ( + '
    ' + + this.renderBgTrHtml(0) + + '
    ' + + this.renderSlatRowHtml() + + '
    ' + ); + }, + renderSlatRowHtml: function () { + for (var t, n, i, r = this.view, s = this.isRTL, o = '', l = e.duration(+this.minTime); l < this.maxTime; ) + (t = this.start.clone().time(l)), + (n = ot(_(l, this.labelInterval))), + (i = + '' + + (n ? '' + tt(t.format(this.labelFormat)) + '' : '') + + ''), + (o += + '' + + (s ? '' : i) + + '' + + (s ? i : '') + + ''), + l.add(this.slotDuration); + return o; + }, + processOptions: function () { + var n, + i = this.view, + r = i.opt('slotDuration'), + s = i.opt('snapDuration'); + (r = e.duration(r)), + (s = s ? e.duration(s) : r), + (this.slotDuration = r), + (this.snapDuration = s), + (this.snapsPerSlot = r / s), + (this.minResizeDuration = s), + (this.minTime = e.duration(i.opt('minTime'))), + (this.maxTime = e.duration(i.opt('maxTime'))), + (n = i.opt('slotLabelFormat')), + t.isArray(n) && (n = n[n.length - 1]), + (this.labelFormat = n || i.opt('smallTimeFormat')), + (n = i.opt('slotLabelInterval')), + (this.labelInterval = n ? e.duration(n) : this.computeLabelInterval(r)); + }, + computeLabelInterval: function (t) { + var n, i, r; + for (n = Oe.length - 1; n >= 0; n--) if (((i = e.duration(Oe[n])), (r = _(i, t)), ot(r) && r > 1)) return i; + return e.duration(t); + }, + computeEventTimeFormat: function () { + return this.view.opt('noMeridiemTimeFormat'); + }, + computeDisplayEventEnd: function () { + return !0; + }, + prepareHits: function () { + this.colCoordCache.build(), this.slatCoordCache.build(); + }, + releaseHits: function () { + this.colCoordCache.clear(); + }, + queryHit: function (t, e) { + var n = this.snapsPerSlot, + i = this.colCoordCache, + r = this.slatCoordCache; + if (i.isLeftInBounds(t) && r.isTopInBounds(e)) { + var s = i.getHorizontalIndex(t), + o = r.getVerticalIndex(e); + if (null != s && null != o) { + var l = r.getTopOffset(o), + a = r.getHeight(o), + u = (e - l) / a, + c = Math.floor(u * n), + d = o * n + c, + h = l + (c / n) * a, + f = l + ((c + 1) / n) * a; + return { col: s, snap: d, component: this, left: i.getLeftOffset(s), right: i.getRightOffset(s), top: h, bottom: f }; + } + } + }, + getHitSpan: function (t) { + var e, + n = this.getCellDate(0, t.col), + i = this.computeSnapTime(t.snap); + return n.time(i), (e = n.clone().add(this.snapDuration)), { start: n, end: e }; + }, + getHitEl: function (t) { + return this.colEls.eq(t.col); + }, + rangeUpdated: function () { + this.updateDayTable(); + }, + computeSnapTime: function (t) { + return e.duration(this.minTime + this.snapDuration * t); + }, + spanToSegs: function (t) { + var e, + n = this.sliceRangeByTimes(t); + for (e = 0; e < n.length; e++) this.isRTL ? (n[e].col = this.daysPerRow - 1 - n[e].dayIndex) : (n[e].col = n[e].dayIndex); + return n; + }, + sliceRangeByTimes: function (t) { + var e, + n, + i, + r, + s = []; + for (n = 0; n < this.daysPerRow; n++) + (i = this.dayDates[n].clone()), + (r = { start: i.clone().time(this.minTime), end: i.clone().time(this.maxTime) }), + (e = F(t, r)), + e && ((e.dayIndex = n), s.push(e)); + return s; + }, + updateSize: function (t) { + this.slatCoordCache.build(), t && this.updateSegVerticals([].concat(this.fgSegs || [], this.bgSegs || [], this.businessSegs || [])); + }, + getTotalSlatHeight: function () { + return this.slatContainerEl.outerHeight(); + }, + computeDateTop: function (t, n) { + return this.computeTimeTop(e.duration(t - n.clone().stripTime())); + }, + computeTimeTop: function (t) { + var e, + n, + i = this.slatEls.length, + r = (t - this.minTime) / this.slotDuration; + return ( + (r = Math.max(0, r)), + (r = Math.min(i, r)), + (e = Math.floor(r)), + (e = Math.min(e, i - 1)), + (n = r - e), + this.slatCoordCache.getTopPosition(e) + this.slatCoordCache.getHeight(e) * n + ); + }, + renderDrag: function (t, e) { + return e ? this.renderEventLocationHelper(t, e) : void this.renderHighlight(this.eventToSpan(t)); + }, + unrenderDrag: function () { + this.unrenderHelper(), this.unrenderHighlight(); + }, + renderEventResize: function (t, e) { + return this.renderEventLocationHelper(t, e); + }, + unrenderEventResize: function () { + this.unrenderHelper(); + }, + renderHelper: function (t, e) { + return this.renderHelperSegs(this.eventToSegs(t), e); + }, + unrenderHelper: function () { + this.unrenderHelperSegs(); + }, + renderBusinessHours: function () { + this.renderBusinessSegs(this.buildBusinessHourSegs()); + }, + unrenderBusinessHours: function () { + this.unrenderBusinessSegs(); + }, + getNowIndicatorUnit: function () { + return 'minute'; + }, + renderNowIndicator: function (e) { + var n, + i = this.spanToSegs({ start: e, end: e }), + r = this.computeDateTop(e, e), + s = []; + for (n = 0; n < i.length; n++) + s.push( + t('
    ').css('top', r).appendTo(this.colContainerEls.eq(i[n].col))[0] + ); + i.length > 0 && + s.push( + t('
    ').css('top', r).appendTo(this.el.find('.fc-content-skeleton'))[0] + ), + (this.nowIndicatorEls = t(s)); + }, + unrenderNowIndicator: function () { + this.nowIndicatorEls && (this.nowIndicatorEls.remove(), (this.nowIndicatorEls = null)); + }, + renderSelection: function (t) { + this.view.opt('selectHelper') ? this.renderEventLocationHelper(t) : this.renderHighlight(t); + }, + unrenderSelection: function () { + this.unrenderHelper(), this.unrenderHighlight(); + }, + renderHighlight: function (t) { + this.renderHighlightSegs(this.spanToSegs(t)); + }, + unrenderHighlight: function () { + this.unrenderHighlightSegs(); + }, + })); + we.mixin({ + colContainerEls: null, + fgContainerEls: null, + bgContainerEls: null, + helperContainerEls: null, + highlightContainerEls: null, + businessContainerEls: null, + fgSegs: null, + bgSegs: null, + helperSegs: null, + highlightSegs: null, + businessSegs: null, + renderContentSkeleton: function () { + var e, + n, + i = ''; + for (e = 0; e < this.colCnt; e++) + i += + '
    '; + (n = t('
    ' + i + '
    ')), + (this.colContainerEls = n.find('.fc-content-col')), + (this.helperContainerEls = n.find('.fc-helper-container')), + (this.fgContainerEls = n.find('.fc-event-container:not(.fc-helper-container)')), + (this.bgContainerEls = n.find('.fc-bgevent-container')), + (this.highlightContainerEls = n.find('.fc-highlight-container')), + (this.businessContainerEls = n.find('.fc-business-container')), + this.bookendCells(n.find('tr')), + this.el.append(n); + }, + renderFgSegs: function (t) { + return (t = this.renderFgSegsIntoContainers(t, this.fgContainerEls)), (this.fgSegs = t), t; + }, + unrenderFgSegs: function () { + this.unrenderNamedSegs('fgSegs'); + }, + renderHelperSegs: function (e, n) { + var i, + r, + s, + o = []; + for (e = this.renderFgSegsIntoContainers(e, this.helperContainerEls), i = 0; i < e.length; i++) + (r = e[i]), + n && + n.col === r.col && + ((s = n.el), + r.el.css({ + left: s.css('left'), + right: s.css('right'), + 'margin-left': s.css('margin-left'), + 'margin-right': s.css('margin-right'), + })), + o.push(r.el[0]); + return (this.helperSegs = e), t(o); + }, + unrenderHelperSegs: function () { + this.unrenderNamedSegs('helperSegs'); + }, + renderBgSegs: function (t) { + return ( + (t = this.renderFillSegEls('bgEvent', t)), + this.updateSegVerticals(t), + this.attachSegsByCol(this.groupSegsByCol(t), this.bgContainerEls), + (this.bgSegs = t), + t + ); + }, + unrenderBgSegs: function () { + this.unrenderNamedSegs('bgSegs'); + }, + renderHighlightSegs: function (t) { + (t = this.renderFillSegEls('highlight', t)), + this.updateSegVerticals(t), + this.attachSegsByCol(this.groupSegsByCol(t), this.highlightContainerEls), + (this.highlightSegs = t); + }, + unrenderHighlightSegs: function () { + this.unrenderNamedSegs('highlightSegs'); + }, + renderBusinessSegs: function (t) { + (t = this.renderFillSegEls('businessHours', t)), + this.updateSegVerticals(t), + this.attachSegsByCol(this.groupSegsByCol(t), this.businessContainerEls), + (this.businessSegs = t); + }, + unrenderBusinessSegs: function () { + this.unrenderNamedSegs('businessSegs'); + }, + groupSegsByCol: function (t) { + var e, + n = []; + for (e = 0; e < this.colCnt; e++) n.push([]); + for (e = 0; e < t.length; e++) n[t[e].col].push(t[e]); + return n; + }, + attachSegsByCol: function (t, e) { + var n, i, r; + for (n = 0; n < this.colCnt; n++) for (i = t[n], r = 0; r < i.length; r++) e.eq(n).append(i[r].el); + }, + unrenderNamedSegs: function (t) { + var e, + n = this[t]; + if (n) { + for (e = 0; e < n.length; e++) n[e].el.remove(); + this[t] = null; + } + }, + renderFgSegsIntoContainers: function (t, e) { + var n, i; + for (t = this.renderFgSegEls(t), n = this.groupSegsByCol(t), i = 0; i < this.colCnt; i++) this.updateFgSegCoords(n[i]); + return this.attachSegsByCol(n, e), t; + }, + fgSegHtml: function (t, e) { + var n, + i, + r, + s = this.view, + o = t.event, + l = s.isEventDraggable(o), + a = !e && t.isStart && s.isEventResizableFromStart(o), + u = !e && t.isEnd && s.isEventResizableFromEnd(o), + c = this.getSegClasses(t, l, a || u), + d = nt(this.getSegSkinCss(t)); + return ( + c.unshift('fc-time-grid-event', 'fc-v-event'), + s.isMultiDayEvent(o) + ? (t.isStart || t.isEnd) && + ((n = this.getEventTimeText(t)), (i = this.getEventTimeText(t, 'LT')), (r = this.getEventTimeText(t, null, !1))) + : ((n = this.getEventTimeText(o)), (i = this.getEventTimeText(o, 'LT')), (r = this.getEventTimeText(o, null, !1))), + '
    ' + + (n ? '
    ' + tt(n) + '
    ' : '') + + (o.title ? '
    ' + tt(o.title) + '
    ' : '') + + '
    ' + + (u ? '
    ' : '') + + '' + ); + }, + updateSegVerticals: function (t) { + this.computeSegVerticals(t), this.assignSegVerticals(t); + }, + computeSegVerticals: function (t) { + var e, n; + for (e = 0; e < t.length; e++) + (n = t[e]), (n.top = this.computeDateTop(n.start, n.start)), (n.bottom = this.computeDateTop(n.end, n.start)); + }, + assignSegVerticals: function (t) { + var e, n; + for (e = 0; e < t.length; e++) (n = t[e]), n.el.css(this.generateSegVerticalCss(n)); + }, + generateSegVerticalCss: function (t) { + return { top: t.top, bottom: -t.bottom }; + }, + updateFgSegCoords: function (t) { + this.computeSegVerticals(t), this.computeFgSegHorizontals(t), this.assignSegVerticals(t), this.assignFgSegHorizontals(t); + }, + computeFgSegHorizontals: function (t) { + var e, n, i; + if ((this.sortEventSegs(t), (e = Ft(t)), Nt(e), (n = e[0]))) { + for (i = 0; i < n.length; i++) Gt(n[i]); + for (i = 0; i < n.length; i++) this.computeFgSegForwardBack(n[i], 0, 0); + } + }, + computeFgSegForwardBack: function (t, e, n) { + var i, + r = t.forwardSegs; + if (void 0 === t.forwardCoord) + for ( + r.length + ? (this.sortForwardSegs(r), this.computeFgSegForwardBack(r[0], e + 1, n), (t.forwardCoord = r[0].backwardCoord)) + : (t.forwardCoord = 1), + t.backwardCoord = t.forwardCoord - (t.forwardCoord - n) / (e + 1), + i = 0; + i < r.length; + i++ + ) + this.computeFgSegForwardBack(r[i], 0, t.forwardCoord); + }, + sortForwardSegs: function (t) { + t.sort(lt(this, 'compareForwardSegs')); + }, + compareForwardSegs: function (t, e) { + return e.forwardPressure - t.forwardPressure || (t.backwardCoord || 0) - (e.backwardCoord || 0) || this.compareEventSegs(t, e); + }, + assignFgSegHorizontals: function (t) { + var e, n; + for (e = 0; e < t.length; e++) + (n = t[e]), n.el.css(this.generateFgSegHorizontalCss(n)), n.bottom - n.top < 30 && n.el.addClass('fc-short'); + }, + generateFgSegHorizontalCss: function (t) { + var e, + n, + i = this.view.opt('slotEventOverlap'), + r = t.backwardCoord, + s = t.forwardCoord, + o = this.generateSegVerticalCss(t); + return ( + i && (s = Math.min(1, r + 2 * (s - r))), + this.isRTL ? ((e = 1 - s), (n = r)) : ((e = r), (n = 1 - s)), + (o.zIndex = t.level + 1), + (o.left = 100 * e + '%'), + (o.right = 100 * n + '%'), + i && t.forwardPressure && (o[this.isRTL ? 'marginLeft' : 'marginRight'] = 20), + o + ); + }, + }); + var Ee = (qt.View = St.extend(ue, ce, { + type: null, + name: null, + title: null, + calendar: null, + options: null, + el: null, + isDateSet: !1, + isDateRendered: !1, + dateRenderQueue: null, + isEventsBound: !1, + isEventsSet: !1, + isEventsRendered: !1, + eventRenderQueue: null, + start: null, + end: null, + intervalStart: null, + intervalEnd: null, + intervalDuration: null, + intervalUnit: null, + isRTL: !1, + isSelected: !1, + selectedEvent: null, + eventOrderSpecs: null, + widgetHeaderClass: null, + widgetContentClass: null, + highlightStateClass: null, + nextDayThreshold: null, + isHiddenDayHash: null, + isNowIndicatorRendered: null, + initialNowDate: null, + initialNowQueriedMs: null, + nowIndicatorTimeoutID: null, + nowIndicatorIntervalID: null, + constructor: function (t, n, i, r) { + (this.calendar = t), + (this.type = this.name = n), + (this.options = i), + (this.intervalDuration = r || e.duration(1, 'day')), + (this.nextDayThreshold = e.duration(this.opt('nextDayThreshold'))), + this.initThemingProps(), + this.initHiddenDays(), + (this.isRTL = this.opt('isRTL')), + (this.eventOrderSpecs = L(this.opt('eventOrder'))), + (this.dateRenderQueue = new Dt()), + (this.eventRenderQueue = new Dt(this.opt('eventRenderWait'))), + this.initialize(); + }, + initialize: function () {}, + opt: function (t) { + return this.options[t]; + }, + publiclyTrigger: function (t, e) { + var n = this.calendar; + return n.publiclyTrigger.apply(n, [t, e || this].concat(Array.prototype.slice.call(arguments, 2), [this])); + }, + rejectOn: function (t, e) { + var n = this; + return new bt(function (i, r) { + function s() { + n.off(t, r); + } + n.one(t, r), + e.then( + function (t) { + s(), i(t); + }, + function () { + s(), r(); + } + ); + }); + }, + setRange: function (e) { + t.extend(this, e), this.updateTitle(); + }, + computeRange: function (t) { + var e, + n, + i = A(this.intervalDuration), + r = t.clone().startOf(i), + s = r.clone().add(this.intervalDuration); + return ( + /year|month|week|day/.test(i) + ? (r.stripTime(), s.stripTime()) + : (r.hasTime() || (r = this.calendar.time(0)), s.hasTime() || (s = this.calendar.time(0))), + (e = r.clone()), + (e = this.skipHiddenDays(e)), + (n = s.clone()), + (n = this.skipHiddenDays(n, -1, !0)), + { intervalUnit: i, intervalStart: r, intervalEnd: s, start: e, end: n } + ); + }, + computePrevDate: function (t) { + return this.massageCurrentDate(t.clone().startOf(this.intervalUnit).subtract(this.intervalDuration), -1); + }, + computeNextDate: function (t) { + return this.massageCurrentDate(t.clone().startOf(this.intervalUnit).add(this.intervalDuration)); + }, + massageCurrentDate: function (t, e) { + return this.intervalDuration.as('days') <= 1 && this.isHiddenDay(t) && ((t = this.skipHiddenDays(t, e)), t.startOf('day')), t; + }, + updateTitle: function () { + (this.title = this.computeTitle()), this.calendar.setToolbarsTitle(this.title); + }, + computeTitle: function () { + return this.formatRange( + { start: this.calendar.applyTimezone(this.intervalStart), end: this.calendar.applyTimezone(this.intervalEnd) }, + this.opt('titleFormat') || this.computeTitleFormat(), + this.opt('titleRangeSeparator') + ); + }, + computeTitleFormat: function () { + return 'year' == this.intervalUnit + ? 'YYYY' + : 'month' == this.intervalUnit + ? this.opt('monthYearFormat') + : this.intervalDuration.as('days') > 1 + ? 'll' + : 'LL'; + }, + formatRange: function (t, e, n) { + var i = t.end; + return i.hasTime() || (i = i.clone().subtract(1)), gt(t.start, i, e, n, this.opt('isRTL')); + }, + getAllDayHtml: function () { + return this.opt('allDayHtml') || tt(this.opt('allDayText')); + }, + buildGotoAnchorHtml: function (e, n, i) { + var r, s, o, l; + return ( + t.isPlainObject(e) ? ((r = e.date), (s = e.type), (o = e.forceOff)) : (r = e), + (r = qt.moment(r)), + (l = { date: r.format('YYYY-MM-DD'), type: s || 'day' }), + 'string' == typeof n && ((i = n), (n = null)), + (n = n ? ' ' + it(n) : ''), + (i = i || ''), + !o && this.opt('navLinks') + ? '' + i + '' + : '' + i + '' + ); + }, + setElement: function (t) { + (this.el = t), this.bindGlobalHandlers(), this.renderSkeleton(); + }, + removeElement: function () { + this.unsetDate(), this.unrenderSkeleton(), this.unbindGlobalHandlers(), this.el.remove(); + }, + renderSkeleton: function () {}, + unrenderSkeleton: function () {}, + setDate: function (t) { + var e = this.isDateSet; + (this.isDateSet = !0), this.handleDate(t, e), this.trigger(e ? 'dateReset' : 'dateSet', t); + }, + unsetDate: function () { + this.isDateSet && ((this.isDateSet = !1), this.handleDateUnset(), this.trigger('dateUnset')); + }, + handleDate: function (t, e) { + var n = this; + this.unbindEvents(), + this.requestDateRender(t).then(function () { + n.bindEvents(); + }); + }, + handleDateUnset: function () { + this.unbindEvents(), this.requestDateUnrender(); + }, + requestDateRender: function (t) { + var e = this; + return this.dateRenderQueue.add(function () { + return e.executeDateRender(t); + }); + }, + requestDateUnrender: function () { + var t = this; + return this.dateRenderQueue.add(function () { + return t.executeDateUnrender(); + }); + }, + executeDateRender: function (t) { + var e = this; + return ( + t ? this.captureInitialScroll() : this.captureScroll(), + this.freezeHeight(), + this.executeDateUnrender().then(function () { + t && e.setRange(e.computeRange(t)), + e.render && e.render(), + e.renderDates(), + e.updateSize(), + e.renderBusinessHours(), + e.startNowIndicator(), + e.thawHeight(), + e.releaseScroll(), + (e.isDateRendered = !0), + e.onDateRender(), + e.trigger('dateRender'); + }) + ); + }, + executeDateUnrender: function () { + var t = this; + return t.isDateRendered + ? this.requestEventsUnrender().then(function () { + t.unselect(), + t.stopNowIndicator(), + t.triggerUnrender(), + t.unrenderBusinessHours(), + t.unrenderDates(), + t.destroy && t.destroy(), + (t.isDateRendered = !1), + t.trigger('dateUnrender'); + }) + : bt.resolve(); + }, + onDateRender: function () { + this.triggerRender(); + }, + renderDates: function () {}, + unrenderDates: function () {}, + triggerRender: function () { + this.publiclyTrigger('viewRender', this, this, this.el); + }, + triggerUnrender: function () { + this.publiclyTrigger('viewDestroy', this, this, this.el); + }, + bindGlobalHandlers: function () { + this.listenTo(t(document), 'mousedown', this.handleDocumentMousedown), + this.listenTo(t(document), 'touchstart', this.processUnselect); + }, + unbindGlobalHandlers: function () { + this.stopListeningTo(t(document)); + }, + initThemingProps: function () { + var t = this.opt('theme') ? 'ui' : 'fc'; + (this.widgetHeaderClass = t + '-widget-header'), + (this.widgetContentClass = t + '-widget-content'), + (this.highlightStateClass = t + '-state-highlight'); + }, + renderBusinessHours: function () {}, + unrenderBusinessHours: function () {}, + startNowIndicator: function () { + var t, + n, + i, + r = this; + this.opt('nowIndicator') && + ((t = this.getNowIndicatorUnit()), + t && + ((n = lt(this, 'updateNowIndicator')), + (this.initialNowDate = this.calendar.getNow()), + (this.initialNowQueriedMs = +new Date()), + this.renderNowIndicator(this.initialNowDate), + (this.isNowIndicatorRendered = !0), + (i = this.initialNowDate.clone().startOf(t).add(1, t) - this.initialNowDate), + (this.nowIndicatorTimeoutID = setTimeout(function () { + (r.nowIndicatorTimeoutID = null), + n(), + (i = +e.duration(1, t)), + (i = Math.max(100, i)), + (r.nowIndicatorIntervalID = setInterval(n, i)); + }, i)))); + }, + updateNowIndicator: function () { + this.isNowIndicatorRendered && + (this.unrenderNowIndicator(), this.renderNowIndicator(this.initialNowDate.clone().add(new Date() - this.initialNowQueriedMs))); + }, + stopNowIndicator: function () { + this.isNowIndicatorRendered && + (this.nowIndicatorTimeoutID && (clearTimeout(this.nowIndicatorTimeoutID), (this.nowIndicatorTimeoutID = null)), + this.nowIndicatorIntervalID && (clearTimeout(this.nowIndicatorIntervalID), (this.nowIndicatorIntervalID = null)), + this.unrenderNowIndicator(), + (this.isNowIndicatorRendered = !1)); + }, + getNowIndicatorUnit: function () {}, + renderNowIndicator: function (t) {}, + unrenderNowIndicator: function () {}, + updateSize: function (t) { + t && this.captureScroll(), this.updateHeight(t), this.updateWidth(t), this.updateNowIndicator(), t && this.releaseScroll(); + }, + updateWidth: function (t) {}, + updateHeight: function (t) { + var e = this.calendar; + this.setHeight(e.getSuggestedViewHeight(), e.isHeightAuto()); + }, + setHeight: function (t, e) {}, + capturedScroll: null, + capturedScrollDepth: 0, + captureScroll: function () { + return !this.capturedScrollDepth++ && ((this.capturedScroll = this.isDateRendered ? this.queryScroll() : {}), !0); + }, + captureInitialScroll: function (e) { + this.captureScroll() && + ((this.capturedScroll.isInitial = !0), e ? t.extend(this.capturedScroll, e) : (this.capturedScroll.isComputed = !0)); + }, + releaseScroll: function () { + var e = this.capturedScroll, + n = this.discardScroll(); + e.isComputed && (n ? t.extend(e, this.computeInitialScroll()) : (e = null)), + e && (e.isInitial ? this.hardSetScroll(e) : this.setScroll(e)); + }, + discardScroll: function () { + return !--this.capturedScrollDepth && ((this.capturedScroll = null), !0); + }, + computeInitialScroll: function () { + return {}; + }, + queryScroll: function () { + return {}; + }, + hardSetScroll: function (t) { + var e = this, + n = function () { + e.setScroll(t); + }; + n(), setTimeout(n, 0); + }, + setScroll: function (t) {}, + freezeHeight: function () { + this.calendar.freezeContentHeight(); + }, + thawHeight: function () { + this.calendar.thawContentHeight(); + }, + bindEvents: function () { + var t = this; + this.isEventsBound || + ((this.isEventsBound = !0), + this.rejectOn('eventsUnbind', this.requestEvents()).then(function (e) { + t.listenTo(t.calendar, 'eventsReset', t.setEvents), t.setEvents(e); + })); + }, + unbindEvents: function () { + this.isEventsBound && + ((this.isEventsBound = !1), this.stopListeningTo(this.calendar, 'eventsReset'), this.unsetEvents(), this.trigger('eventsUnbind')); + }, + setEvents: function (t) { + var e = this.isEventSet; + (this.isEventsSet = !0), this.handleEvents(t, e), this.trigger(e ? 'eventsReset' : 'eventsSet', t); + }, + unsetEvents: function () { + this.isEventsSet && ((this.isEventsSet = !1), this.handleEventsUnset(), this.trigger('eventsUnset')); + }, + whenEventsSet: function () { + var t = this; + return this.isEventsSet + ? bt.resolve(this.getCurrentEvents()) + : new bt(function (e) { + t.one('eventsSet', e); + }); + }, + handleEvents: function (t, e) { + this.requestEventsRender(t); + }, + handleEventsUnset: function () { + this.requestEventsUnrender(); + }, + requestEventsRender: function (t) { + var e = this; + return this.eventRenderQueue.add(function () { + return e.executeEventsRender(t); + }); + }, + requestEventsUnrender: function () { + var t = this; + return this.isEventsRendered + ? this.eventRenderQueue.addQuickly(function () { + return t.executeEventsUnrender(); + }) + : bt.resolve(); + }, + requestCurrentEventsRender: function () { + return this.isEventsSet ? void this.requestEventsRender(this.getCurrentEvents()) : bt.reject(); + }, + executeEventsRender: function (t) { + var e = this; + return ( + this.captureScroll(), + this.freezeHeight(), + this.executeEventsUnrender().then(function () { + e.renderEvents(t), e.thawHeight(), e.releaseScroll(), (e.isEventsRendered = !0), e.onEventsRender(), e.trigger('eventsRender'); + }) + ); + }, + executeEventsUnrender: function () { + return ( + this.isEventsRendered && + (this.onBeforeEventsUnrender(), + this.captureScroll(), + this.freezeHeight(), + this.destroyEvents && this.destroyEvents(), + this.unrenderEvents(), + this.thawHeight(), + this.releaseScroll(), + (this.isEventsRendered = !1), + this.trigger('eventsUnrender')), + bt.resolve() + ); + }, + onEventsRender: function () { + this.renderedEventSegEach(function (t) { + this.publiclyTrigger('eventAfterRender', t.event, t.event, t.el); + }), + this.publiclyTrigger('eventAfterAllRender'); + }, + onBeforeEventsUnrender: function () { + this.renderedEventSegEach(function (t) { + this.publiclyTrigger('eventDestroy', t.event, t.event, t.el); + }); + }, + renderEvents: function (t) {}, + unrenderEvents: function () {}, + requestEvents: function () { + return this.calendar.requestEvents(this.start, this.end); + }, + getCurrentEvents: function () { + return this.calendar.getPrunedEventCache(); + }, + resolveEventEl: function (e, n) { + var i = this.publiclyTrigger('eventRender', e, e, n); + return i === !1 ? (n = null) : i && i !== !0 && (n = t(i)), n; + }, + showEvent: function (t) { + this.renderedEventSegEach(function (t) { + t.el.css('visibility', ''); + }, t); + }, + hideEvent: function (t) { + this.renderedEventSegEach(function (t) { + t.el.css('visibility', 'hidden'); + }, t); + }, + renderedEventSegEach: function (t, e) { + var n, + i = this.getEventSegs(); + for (n = 0; n < i.length; n++) (e && i[n].event._id !== e._id) || (i[n].el && t.call(this, i[n])); + }, + getEventSegs: function () { + return []; + }, + isEventDraggable: function (t) { + return this.isEventStartEditable(t); + }, + isEventStartEditable: function (t) { + return J(t.startEditable, (t.source || {}).startEditable, this.opt('eventStartEditable'), this.isEventGenerallyEditable(t)); + }, + isEventGenerallyEditable: function (t) { + return J(t.editable, (t.source || {}).editable, this.opt('editable')); + }, + reportEventDrop: function (t, e, n, i, r) { + var s = this.calendar, + o = s.mutateEvent(t, e, n), + l = function () { + o.undo(), s.reportEventChange(); + }; + this.triggerEventDrop(t, o.dateDelta, l, i, r), s.reportEventChange(); + }, + triggerEventDrop: function (t, e, n, i, r) { + this.publiclyTrigger('eventDrop', i[0], t, e, n, r, {}); + }, + reportExternalDrop: function (e, n, i, r, s) { + var o, + l, + a = e.eventProps; + a && ((o = t.extend({}, a, n)), (l = this.calendar.renderEvent(o, e.stick)[0])), this.triggerExternalDrop(l, n, i, r, s); + }, + triggerExternalDrop: function (t, e, n, i, r) { + this.publiclyTrigger('drop', n[0], e.start, i, r), t && this.publiclyTrigger('eventReceive', null, t); + }, + renderDrag: function (t, e) {}, + unrenderDrag: function () {}, + isEventResizableFromStart: function (t) { + return this.opt('eventResizableFromStart') && this.isEventResizable(t); + }, + isEventResizableFromEnd: function (t) { + return this.isEventResizable(t); + }, + isEventResizable: function (t) { + var e = t.source || {}; + return J(t.durationEditable, e.durationEditable, this.opt('eventDurationEditable'), t.editable, e.editable, this.opt('editable')); + }, + reportEventResize: function (t, e, n, i, r) { + var s = this.calendar, + o = s.mutateEvent(t, e, n), + l = function () { + o.undo(), s.reportEventChange(); + }; + this.triggerEventResize(t, o.durationDelta, l, i, r), s.reportEventChange(); + }, + triggerEventResize: function (t, e, n, i, r) { + this.publiclyTrigger('eventResize', i[0], t, e, n, r, {}); + }, + select: function (t, e) { + this.unselect(e), this.renderSelection(t), this.reportSelection(t, e); + }, + renderSelection: function (t) {}, + reportSelection: function (t, e) { + (this.isSelected = !0), this.triggerSelect(t, e); + }, + triggerSelect: function (t, e) { + this.publiclyTrigger('select', null, this.calendar.applyTimezone(t.start), this.calendar.applyTimezone(t.end), e); + }, + unselect: function (t) { + this.isSelected && + ((this.isSelected = !1), + this.destroySelection && this.destroySelection(), + this.unrenderSelection(), + this.publiclyTrigger('unselect', null, t)); + }, + unrenderSelection: function () {}, + selectEvent: function (t) { + (this.selectedEvent && this.selectedEvent === t) || + (this.unselectEvent(), + this.renderedEventSegEach(function (t) { + t.el.addClass('fc-selected'); + }, t), + (this.selectedEvent = t)); + }, + unselectEvent: function () { + this.selectedEvent && + (this.renderedEventSegEach(function (t) { + t.el.removeClass('fc-selected'); + }, this.selectedEvent), + (this.selectedEvent = null)); + }, + isEventSelected: function (t) { + return this.selectedEvent && this.selectedEvent._id === t._id; + }, + handleDocumentMousedown: function (t) { + S(t) && this.processUnselect(t); + }, + processUnselect: function (t) { + this.processRangeUnselect(t), this.processEventUnselect(t); + }, + processRangeUnselect: function (e) { + var n; + this.isSelected && + this.opt('unselectAuto') && + ((n = this.opt('unselectCancel')), (n && t(e.target).closest(n).length) || this.unselect(e)); + }, + processEventUnselect: function (e) { + this.selectedEvent && (t(e.target).closest('.fc-selected').length || this.unselectEvent()); + }, + triggerDayClick: function (t, e, n) { + this.publiclyTrigger('dayClick', e, this.calendar.applyTimezone(t.start), n); + }, + initHiddenDays: function () { + var e, + n = this.opt('hiddenDays') || [], + i = [], + r = 0; + for (this.opt('weekends') === !1 && n.push(0, 6), e = 0; e < 7; e++) (i[e] = t.inArray(e, n) !== -1) || r++; + if (!r) throw 'invalid hiddenDays'; + this.isHiddenDayHash = i; + }, + isHiddenDay: function (t) { + return e.isMoment(t) && (t = t.day()), this.isHiddenDayHash[t]; + }, + skipHiddenDays: function (t, e, n) { + var i = t.clone(); + for (e = e || 1; this.isHiddenDayHash[(i.day() + (n ? e : 0) + 7) % 7]; ) i.add(e, 'days'); + return i; + }, + computeDayRange: function (t) { + var e, + n = t.start.clone().stripTime(), + i = t.end, + r = null; + return ( + i && ((r = i.clone().stripTime()), (e = +i.time()), e && e >= this.nextDayThreshold && r.add(1, 'days')), + (!i || r <= n) && (r = n.clone().add(1, 'days')), + { start: n, end: r } + ); + }, + isMultiDayEvent: function (t) { + var e = this.computeDayRange(t); + return e.end.diff(e.start, 'days') > 1; + }, + })), + be = (qt.Scroller = St.extend({ + el: null, + scrollEl: null, + overflowX: null, + overflowY: null, + constructor: function (t) { + (t = t || {}), (this.overflowX = t.overflowX || t.overflow || 'auto'), (this.overflowY = t.overflowY || t.overflow || 'auto'); + }, + render: function () { + (this.el = this.renderEl()), this.applyOverflow(); + }, + renderEl: function () { + return (this.scrollEl = t('
    ')); + }, + clear: function () { + this.setHeight('auto'), this.applyOverflow(); + }, + destroy: function () { + this.el.remove(); + }, + applyOverflow: function () { + this.scrollEl.css({ 'overflow-x': this.overflowX, 'overflow-y': this.overflowY }); + }, + lockOverflow: function (t) { + var e = this.overflowX, + n = this.overflowY; + (t = t || this.getScrollbarWidths()), + 'auto' === e && (e = t.top || t.bottom || this.scrollEl[0].scrollWidth - 1 > this.scrollEl[0].clientWidth ? 'scroll' : 'hidden'), + 'auto' === n && + (n = t.left || t.right || this.scrollEl[0].scrollHeight - 1 > this.scrollEl[0].clientHeight ? 'scroll' : 'hidden'), + this.scrollEl.css({ 'overflow-x': e, 'overflow-y': n }); + }, + setHeight: function (t) { + this.scrollEl.height(t); + }, + getScrollTop: function () { + return this.scrollEl.scrollTop(); + }, + setScrollTop: function (t) { + this.scrollEl.scrollTop(t); + }, + getClientWidth: function () { + return this.scrollEl[0].clientWidth; + }, + getClientHeight: function () { + return this.scrollEl[0].clientHeight; + }, + getScrollbarWidths: function () { + return p(this.scrollEl); + }, + })); + Vt.prototype.proxyCall = function (t) { + var e = Array.prototype.slice.call(arguments, 1), + n = []; + return ( + this.items.forEach(function (i) { + n.push(i[t].apply(i, e)); + }), + n + ); + }; + var De = (qt.Calendar = St.extend({ + dirDefaults: null, + localeDefaults: null, + overrides: null, + dynamicOverrides: null, + options: null, + viewSpecCache: null, + view: null, + header: null, + footer: null, + loadingLevel: 0, + constructor: _t, + initialize: function () {}, + populateOptionsHash: function () { + var t, e, i, r; + (t = J(this.dynamicOverrides.locale, this.overrides.locale)), + (e = Te[t]), + e || ((t = De.defaults.locale), (e = Te[t] || {})), + (i = J(this.dynamicOverrides.isRTL, this.overrides.isRTL, e.isRTL, De.defaults.isRTL)), + (r = i ? De.rtlDefaults : {}), + (this.dirDefaults = r), + (this.localeDefaults = e), + (this.options = n([De.defaults, r, e, this.overrides, this.dynamicOverrides])), + Yt(this.options); + }, + getViewSpec: function (t) { + var e = this.viewSpecCache; + return e[t] || (e[t] = this.buildViewSpec(t)); + }, + getUnitViewSpec: function (e) { + var n, i, r; + if (t.inArray(e, Kt) != -1) + for ( + n = this.header.getViewsWithButtons(), + t.each(qt.views, function (t) { + n.push(t); + }), + i = 0; + i < n.length; + i++ + ) + if (((r = this.getViewSpec(n[i])), r && r.singleUnit == e)) return r; + }, + buildViewSpec: function (t) { + for (var i, r, s, o, l = this.overrides.views || {}, a = [], u = [], c = [], d = t; d; ) + (i = Zt[d]), + (r = l[d]), + (d = null), + 'function' == typeof i && (i = { class: i }), + i && (a.unshift(i), u.unshift(i.defaults || {}), (s = s || i.duration), (d = d || i.type)), + r && (c.unshift(r), (s = s || r.duration), (d = d || r.type)); + return ( + (i = q(a)), + (i.type = t), + !!i.class && + (s && + ((s = e.duration(s)), + s.valueOf() && ((i.duration = s), (o = A(s)), 1 === s.as(o) && ((i.singleUnit = o), c.unshift(l[o] || {})))), + (i.defaults = n(u)), + (i.overrides = n(c)), + this.buildViewSpecOptions(i), + this.buildViewSpecButtonText(i, t), + i) + ); + }, + buildViewSpecOptions: function (t) { + (t.options = n([De.defaults, t.defaults, this.dirDefaults, this.localeDefaults, this.overrides, t.overrides, this.dynamicOverrides])), + Yt(t.options); + }, + buildViewSpecButtonText: function (t, e) { + function n(n) { + var i = n.buttonText || {}; + return i[e] || (t.buttonTextKey ? i[t.buttonTextKey] : null) || (t.singleUnit ? i[t.singleUnit] : null); + } + (t.buttonTextOverride = n(this.dynamicOverrides) || n(this.overrides) || t.overrides.buttonText), + (t.buttonTextDefault = + n(this.localeDefaults) || + n(this.dirDefaults) || + t.defaults.buttonText || + n(De.defaults) || + (t.duration ? this.humanizeDuration(t.duration) : null) || + e); + }, + instantiateView: function (t) { + var e = this.getViewSpec(t); + return new e.class(this, t, e.options, e.duration); + }, + isValidViewType: function (t) { + return Boolean(this.getViewSpec(t)); + }, + pushLoading: function () { + this.loadingLevel++ || this.publiclyTrigger('loading', null, !0, this.view); + }, + popLoading: function () { + --this.loadingLevel || this.publiclyTrigger('loading', null, !1, this.view); + }, + buildSelectSpan: function (t, e) { + var n, + i = this.moment(t).stripZone(); + return ( + (n = e + ? this.moment(e).stripZone() + : i.hasTime() + ? i.clone().add(this.defaultTimedEventDuration) + : i.clone().add(this.defaultAllDayEventDuration)), + { start: i, end: n } + ); + }, + })); + De.mixin(ue), + De.mixin({ + optionHandlers: null, + bindOption: function (t, e) { + this.bindOptions([t], e); + }, + bindOptions: function (t, e) { + var n, + i = { func: e, names: t }; + for (n = 0; n < t.length; n++) this.registerOptionHandlerObj(t[n], i); + this.triggerOptionHandlerObj(i); + }, + registerOptionHandlerObj: function (t, e) { + (this.optionHandlers[t] || (this.optionHandlers[t] = [])).push(e); + }, + triggerOptionHandlers: function (t) { + var e, + n = this.optionHandlers[t] || []; + for (e = 0; e < n.length; e++) this.triggerOptionHandlerObj(n[e]); + }, + triggerOptionHandlerObj: function (t) { + var e, + n = t.names, + i = []; + for (e = 0; e < n.length; e++) i.push(this.options[n[e]]); + t.func.apply(this, i); + }, + }), + (De.defaults = { + titleRangeSeparator: ' – ', + monthYearFormat: 'MMMM YYYY', + defaultTimedEventDuration: '02:00:00', + defaultAllDayEventDuration: { days: 1 }, + forceEventDuration: !1, + nextDayThreshold: '09:00:00', + defaultView: 'month', + aspectRatio: 1.35, + header: { left: 'title', center: '', right: 'today prev,next' }, + weekends: !0, + weekNumbers: !1, + weekNumberTitle: 'W', + weekNumberCalculation: 'local', + scrollTime: '06:00:00', + lazyFetching: !0, + startParam: 'start', + endParam: 'end', + timezoneParam: 'timezone', + timezone: !1, + isRTL: !1, + buttonText: { + prev: 'prev', + next: 'next', + prevYear: 'prev year', + nextYear: 'next year', + year: 'year', + today: 'today', + month: 'month', + week: 'week', + day: 'day', + }, + buttonIcons: { prev: 'left-single-arrow', next: 'right-single-arrow', prevYear: 'left-double-arrow', nextYear: 'right-double-arrow' }, + allDayText: 'all-day', + theme: !1, + themeButtonIcons: { prev: 'circle-triangle-w', next: 'circle-triangle-e', prevYear: 'seek-prev', nextYear: 'seek-next' }, + dragOpacity: 0.75, + dragRevertDuration: 500, + dragScroll: !0, + unselectAuto: !0, + dropAccept: '*', + eventOrder: 'title', + eventLimit: !1, + eventLimitText: 'more', + eventLimitClick: 'popover', + dayPopoverFormat: 'LL', + handleWindowResize: !0, + windowResizeDelay: 100, + longPressDelay: 1e3, + }), + (De.englishDefaults = { dayPopoverFormat: 'dddd, MMMM D' }), + (De.rtlDefaults = { + header: { left: 'next,prev today', center: '', right: 'title' }, + buttonIcons: { prev: 'right-single-arrow', next: 'left-single-arrow', prevYear: 'right-double-arrow', nextYear: 'left-double-arrow' }, + themeButtonIcons: { prev: 'circle-triangle-e', next: 'circle-triangle-w', nextYear: 'seek-prev', prevYear: 'seek-next' }, + }); + var Te = (qt.locales = {}); + (qt.datepickerLocale = function (e, n, i) { + var r = Te[e] || (Te[e] = {}); + (r.isRTL = i.isRTL), + (r.weekNumberTitle = i.weekHeader), + t.each(Ce, function (t, e) { + r[t] = e(i); + }), + t.datepicker && + ((t.datepicker.regional[n] = t.datepicker.regional[e] = i), + (t.datepicker.regional.en = t.datepicker.regional['']), + t.datepicker.setDefaults(i)); + }), + (qt.locale = function (e, i) { + var r, s; + (r = Te[e] || (Te[e] = {})), + i && (r = Te[e] = n([r, i])), + (s = Wt(e)), + t.each(He, function (t, e) { + null == r[t] && (r[t] = e(s, r)); + }), + (De.defaults.locale = e); + }); + var Ce = { + buttonText: function (t) { + return { prev: et(t.prevText), next: et(t.nextText), today: et(t.currentText) }; + }, + monthYearFormat: function (t) { + return t.showMonthAfterYear ? 'YYYY[' + t.yearSuffix + '] MMMM' : 'MMMM YYYY[' + t.yearSuffix + ']'; + }, + }, + He = { + dayOfMonthFormat: function (t, e) { + var n = t.longDateFormat('l'); + return (n = n.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g, '')), e.isRTL ? (n += ' ddd') : (n = 'ddd ' + n), n; + }, + mediumTimeFormat: function (t) { + return t.longDateFormat('LT').replace(/\s*a$/i, 'a'); + }, + smallTimeFormat: function (t) { + return t + .longDateFormat('LT') + .replace(':mm', '(:mm)') + .replace(/(\Wmm)$/, '($1)') + .replace(/\s*a$/i, 'a'); + }, + extraSmallTimeFormat: function (t) { + return t + .longDateFormat('LT') + .replace(':mm', '(:mm)') + .replace(/(\Wmm)$/, '($1)') + .replace(/\s*a$/i, 't'); + }, + hourFormat: function (t) { + return t + .longDateFormat('LT') + .replace(':mm', '') + .replace(/(\Wmm)$/, '') + .replace(/\s*a$/i, 'a'); + }, + noMeridiemTimeFormat: function (t) { + return t.longDateFormat('LT').replace(/\s*a$/i, ''); + }, + }, + Re = { + smallDayDateFormat: function (t) { + return t.isRTL ? 'D dd' : 'dd D'; + }, + weekFormat: function (t) { + return t.isRTL ? 'w[ ' + t.weekNumberTitle + ']' : '[' + t.weekNumberTitle + ' ]w'; + }, + smallWeekFormat: function (t) { + return t.isRTL ? 'w[' + t.weekNumberTitle + ']' : '[' + t.weekNumberTitle + ']w'; + }, + }; + qt.locale('en', De.englishDefaults), (qt.sourceNormalizers = []), (qt.sourceFetchers = []); + var xe = { dataType: 'json', cache: !1 }, + Ie = 1; + (De.prototype.normalizeEvent = function (t) {}), + (De.prototype.spanContainsSpan = function (t, e) { + var n = t.start.clone().stripZone(), + i = this.getEventEnd(t).stripZone(); + return e.start >= n && e.end <= i; + }), + (De.prototype.getPeerEvents = function (t, e) { + var n, + i, + r = this.getEventCache(), + s = []; + for (n = 0; n < r.length; n++) (i = r[n]), (e && e._id === i._id) || s.push(i); + return s; + }), + (De.prototype.isEventSpanAllowed = function (t, e) { + var n = e.source || {}, + i = J(e.constraint, n.constraint, this.options.eventConstraint), + r = J(e.overlap, n.overlap, this.options.eventOverlap); + return this.isSpanAllowed(t, i, r, e) && (!this.options.eventAllow || this.options.eventAllow(t, e) !== !1); + }), + (De.prototype.isExternalSpanAllowed = function (e, n, i) { + var r, s; + return ( + i && ((r = t.extend({}, i, n)), (s = this.expandEvent(this.buildEventFromInput(r))[0])), + s ? this.isEventSpanAllowed(e, s) : this.isSelectionSpanAllowed(e) + ); + }), + (De.prototype.isSelectionSpanAllowed = function (t) { + return ( + this.isSpanAllowed(t, this.options.selectConstraint, this.options.selectOverlap) && + (!this.options.selectAllow || this.options.selectAllow(t) !== !1) + ); + }), + (De.prototype.isSpanAllowed = function (t, e, n, i) { + var r, s, o, l, a, u; + if (null != e && (r = this.constraintToEvents(e))) { + for (s = !1, l = 0; l < r.length; l++) + if (this.spanContainsSpan(r[l], t)) { + s = !0; + break; + } + if (!s) return !1; + } + for (o = this.getPeerEvents(t, i), l = 0; l < o.length; l++) + if (((a = o[l]), this.eventIntersectsRange(a, t))) { + if (n === !1) return !1; + if ('function' == typeof n && !n(a, i)) return !1; + if (i) { + if (((u = J(a.overlap, (a.source || {}).overlap)), u === !1)) return !1; + if ('function' == typeof u && !u(i, a)) return !1; + } + } + return !0; + }), + (De.prototype.constraintToEvents = function (t) { + return 'businessHours' === t + ? this.getCurrentBusinessHourEvents() + : 'object' == typeof t + ? null != t.start + ? this.expandEvent(this.buildEventFromInput(t)) + : null + : this.clientEvents(t); + }), + (De.prototype.eventIntersectsRange = function (t, e) { + var n = t.start.clone().stripZone(), + i = this.getEventEnd(t).stripZone(); + return e.start < i && e.end > n; + }); + var ke = { id: '_fcBusinessHours', start: '09:00', end: '17:00', dow: [1, 2, 3, 4, 5], rendering: 'inverse-background' }; + (De.prototype.getCurrentBusinessHourEvents = function (t) { + return this.computeBusinessHourEvents(t, this.options.businessHours); + }), + (De.prototype.computeBusinessHourEvents = function (e, n) { + return n === !0 + ? this.expandBusinessHourEvents(e, [{}]) + : t.isPlainObject(n) + ? this.expandBusinessHourEvents(e, [n]) + : t.isArray(n) + ? this.expandBusinessHourEvents(e, n, !0) + : []; + }), + (De.prototype.expandBusinessHourEvents = function (e, n, i) { + var r, + s, + o = this.getView(), + l = []; + for (r = 0; r < n.length; r++) + (s = n[r]), + (i && !s.dow) || + ((s = t.extend({}, ke, s)), + e && ((s.start = null), (s.end = null)), + l.push.apply(l, this.expandEvent(this.buildEventFromInput(s), o.start, o.end))); + return l; + }); + var Le = (qt.BasicView = Ee.extend({ + scroller: null, + dayGridClass: Se, + dayGrid: null, + dayNumbersVisible: !1, + colWeekNumbersVisible: !1, + cellWeekNumbersVisible: !1, + weekNumberWidth: null, + headContainerEl: null, + headRowEl: null, + initialize: function () { + (this.dayGrid = this.instantiateDayGrid()), (this.scroller = new be({ overflowX: 'hidden', overflowY: 'auto' })); + }, + instantiateDayGrid: function () { + var t = this.dayGridClass.extend(Me); + return new t(this); + }, + setRange: function (t) { + Ee.prototype.setRange.call(this, t), + (this.dayGrid.breakOnWeeks = /year|month|week/.test(this.intervalUnit)), + this.dayGrid.setRange(t); + }, + computeRange: function (t) { + var e = Ee.prototype.computeRange.call(this, t); + return ( + /year|month/.test(e.intervalUnit) && + (e.start.startOf('week'), + (e.start = this.skipHiddenDays(e.start)), + e.end.weekday() && (e.end.add(1, 'week').startOf('week'), (e.end = this.skipHiddenDays(e.end, -1, !0)))), + e + ); + }, + renderDates: function () { + (this.dayNumbersVisible = this.dayGrid.rowCnt > 1), + this.opt('weekNumbers') && + (this.opt('weekNumbersWithinDays') + ? ((this.cellWeekNumbersVisible = !0), (this.colWeekNumbersVisible = !1)) + : ((this.cellWeekNumbersVisible = !1), (this.colWeekNumbersVisible = !0))), + (this.dayGrid.numbersVisible = this.dayNumbersVisible || this.cellWeekNumbersVisible || this.colWeekNumbersVisible), + this.el.addClass('fc-basic-view').html(this.renderSkeletonHtml()), + this.renderHead(), + this.scroller.render(); + var e = this.scroller.el.addClass('fc-day-grid-container'), + n = t('
    ').appendTo(e); + this.el.find('.fc-body > tr > td').append(e), this.dayGrid.setElement(n), this.dayGrid.renderDates(this.hasRigidRows()); + }, + renderHead: function () { + (this.headContainerEl = this.el.find('.fc-head-container').html(this.dayGrid.renderHeadHtml())), + (this.headRowEl = this.headContainerEl.find('.fc-row')); + }, + unrenderDates: function () { + this.dayGrid.unrenderDates(), this.dayGrid.removeElement(), this.scroller.destroy(); + }, + renderBusinessHours: function () { + this.dayGrid.renderBusinessHours(); + }, + unrenderBusinessHours: function () { + this.dayGrid.unrenderBusinessHours(); + }, + renderSkeletonHtml: function () { + return ( + '
    ' + ); + }, + weekNumberStyleAttr: function () { + return null !== this.weekNumberWidth ? 'style="width:' + this.weekNumberWidth + 'px"' : ''; + }, + hasRigidRows: function () { + var t = this.opt('eventLimit'); + return t && 'number' != typeof t; + }, + updateWidth: function () { + this.colWeekNumbersVisible && (this.weekNumberWidth = u(this.el.find('.fc-week-number'))); + }, + setHeight: function (t, e) { + var n, + s, + o = this.opt('eventLimit'); + this.scroller.clear(), + r(this.headRowEl), + this.dayGrid.removeSegPopover(), + o && 'number' == typeof o && this.dayGrid.limitRows(o), + (n = this.computeScrollerHeight(t)), + this.setGridHeight(n, e), + o && 'number' != typeof o && this.dayGrid.limitRows(o), + e || + (this.scroller.setHeight(n), + (s = this.scroller.getScrollbarWidths()), + (s.left || s.right) && (i(this.headRowEl, s), (n = this.computeScrollerHeight(t)), this.scroller.setHeight(n)), + this.scroller.lockOverflow(s)); + }, + computeScrollerHeight: function (t) { + return t - c(this.el, this.scroller.el); + }, + setGridHeight: function (t, e) { + e ? a(this.dayGrid.rowEls) : l(this.dayGrid.rowEls, t, !0); + }, + computeInitialScroll: function () { + return { top: 0 }; + }, + queryScroll: function () { + return { top: this.scroller.getScrollTop() }; + }, + setScroll: function (t) { + this.scroller.setScrollTop(t.top); + }, + prepareHits: function () { + this.dayGrid.prepareHits(); + }, + releaseHits: function () { + this.dayGrid.releaseHits(); + }, + queryHit: function (t, e) { + return this.dayGrid.queryHit(t, e); + }, + getHitSpan: function (t) { + return this.dayGrid.getHitSpan(t); + }, + getHitEl: function (t) { + return this.dayGrid.getHitEl(t); + }, + renderEvents: function (t) { + this.dayGrid.renderEvents(t), this.updateHeight(); + }, + getEventSegs: function () { + return this.dayGrid.getEventSegs(); + }, + unrenderEvents: function () { + this.dayGrid.unrenderEvents(); + }, + renderDrag: function (t, e) { + return this.dayGrid.renderDrag(t, e); + }, + unrenderDrag: function () { + this.dayGrid.unrenderDrag(); + }, + renderSelection: function (t) { + this.dayGrid.renderSelection(t); + }, + unrenderSelection: function () { + this.dayGrid.unrenderSelection(); + }, + })), + Me = { + renderHeadIntroHtml: function () { + var t = this.view; + return t.colWeekNumbersVisible + ? '' + + tt(t.opt('weekNumberTitle')) + + '' + : ''; + }, + renderNumberIntroHtml: function (t) { + var e = this.view, + n = this.getCellDate(t, 0); + return e.colWeekNumbersVisible + ? '' + + e.buildGotoAnchorHtml({ date: n, type: 'week', forceOff: 1 === this.colCnt }, n.format('w')) + + '' + : ''; + }, + renderBgIntroHtml: function () { + var t = this.view; + return t.colWeekNumbersVisible + ? '' + : ''; + }, + renderIntroHtml: function () { + var t = this.view; + return t.colWeekNumbersVisible ? '' : ''; + }, + }, + Be = (qt.MonthView = Le.extend({ + computeRange: function (t) { + var e, + n = Le.prototype.computeRange.call(this, t); + return this.isFixedWeeks() && ((e = Math.ceil(n.end.diff(n.start, 'weeks', !0))), n.end.add(6 - e, 'weeks')), n; + }, + setGridHeight: function (t, e) { + e && (t *= this.rowCnt / 6), l(this.dayGrid.rowEls, t, !e); + }, + isFixedWeeks: function () { + return this.opt('fixedWeekCount'); + }, + })); + (Zt.basic = { class: Le }), + (Zt.basicDay = { type: 'basic', duration: { days: 1 } }), + (Zt.basicWeek = { type: 'basic', duration: { weeks: 1 } }), + (Zt.month = { class: Be, duration: { months: 1 }, defaults: { fixedWeekCount: !0 } }); + var ze = (qt.AgendaView = Ee.extend({ + scroller: null, + timeGridClass: we, + timeGrid: null, + dayGridClass: Se, + dayGrid: null, + axisWidth: null, + headContainerEl: null, + noScrollRowEls: null, + bottomRuleEl: null, + initialize: function () { + (this.timeGrid = this.instantiateTimeGrid()), + this.opt('allDaySlot') && (this.dayGrid = this.instantiateDayGrid()), + (this.scroller = new be({ overflowX: 'hidden', overflowY: 'auto' })); + }, + instantiateTimeGrid: function () { + var t = this.timeGridClass.extend(Fe); + return new t(this); + }, + instantiateDayGrid: function () { + var t = this.dayGridClass.extend(Ne); + return new t(this); + }, + setRange: function (t) { + Ee.prototype.setRange.call(this, t), this.timeGrid.setRange(t), this.dayGrid && this.dayGrid.setRange(t); + }, + renderDates: function () { + this.el.addClass('fc-agenda-view').html(this.renderSkeletonHtml()), this.renderHead(), this.scroller.render(); + var e = this.scroller.el.addClass('fc-time-grid-container'), + n = t('
    ').appendTo(e); + this.el.find('.fc-body > tr > td').append(e), + this.timeGrid.setElement(n), + this.timeGrid.renderDates(), + (this.bottomRuleEl = t('
    ').appendTo(this.timeGrid.el)), + this.dayGrid && + (this.dayGrid.setElement(this.el.find('.fc-day-grid')), + this.dayGrid.renderDates(), + (this.dayGrid.bottomCoordPadding = this.dayGrid.el.next('hr').outerHeight())), + (this.noScrollRowEls = this.el.find('.fc-row:not(.fc-scroller *)')); + }, + renderHead: function () { + this.headContainerEl = this.el.find('.fc-head-container').html(this.timeGrid.renderHeadHtml()); + }, + unrenderDates: function () { + this.timeGrid.unrenderDates(), + this.timeGrid.removeElement(), + this.dayGrid && (this.dayGrid.unrenderDates(), this.dayGrid.removeElement()), + this.scroller.destroy(); + }, + renderSkeletonHtml: function () { + return ( + '
    ' + + (this.dayGrid ? '

    ' : '') + + '
    ' + ); + }, + axisStyleAttr: function () { + return null !== this.axisWidth ? 'style="width:' + this.axisWidth + 'px"' : ''; + }, + renderBusinessHours: function () { + this.timeGrid.renderBusinessHours(), this.dayGrid && this.dayGrid.renderBusinessHours(); + }, + unrenderBusinessHours: function () { + this.timeGrid.unrenderBusinessHours(), this.dayGrid && this.dayGrid.unrenderBusinessHours(); + }, + getNowIndicatorUnit: function () { + return this.timeGrid.getNowIndicatorUnit(); + }, + renderNowIndicator: function (t) { + this.timeGrid.renderNowIndicator(t); + }, + unrenderNowIndicator: function () { + this.timeGrid.unrenderNowIndicator(); + }, + updateSize: function (t) { + this.timeGrid.updateSize(t), Ee.prototype.updateSize.call(this, t); + }, + updateWidth: function () { + this.axisWidth = u(this.el.find('.fc-axis')); + }, + setHeight: function (t, e) { + var n, s, o; + this.bottomRuleEl.hide(), + this.scroller.clear(), + r(this.noScrollRowEls), + this.dayGrid && + (this.dayGrid.removeSegPopover(), + (n = this.opt('eventLimit')), + n && 'number' != typeof n && (n = Ge), + n && this.dayGrid.limitRows(n)), + e || + ((s = this.computeScrollerHeight(t)), + this.scroller.setHeight(s), + (o = this.scroller.getScrollbarWidths()), + (o.left || o.right) && (i(this.noScrollRowEls, o), (s = this.computeScrollerHeight(t)), this.scroller.setHeight(s)), + this.scroller.lockOverflow(o), + this.timeGrid.getTotalSlatHeight() < s && this.bottomRuleEl.show()); + }, + computeScrollerHeight: function (t) { + return t - c(this.el, this.scroller.el); + }, + computeInitialScroll: function () { + var t = e.duration(this.opt('scrollTime')), + n = this.timeGrid.computeTimeTop(t); + return (n = Math.ceil(n)), n && n++, { top: n }; + }, + queryScroll: function () { + return { top: this.scroller.getScrollTop() }; + }, + setScroll: function (t) { + this.scroller.setScrollTop(t.top); + }, + prepareHits: function () { + this.timeGrid.prepareHits(), this.dayGrid && this.dayGrid.prepareHits(); + }, + releaseHits: function () { + this.timeGrid.releaseHits(), this.dayGrid && this.dayGrid.releaseHits(); + }, + queryHit: function (t, e) { + var n = this.timeGrid.queryHit(t, e); + return !n && this.dayGrid && (n = this.dayGrid.queryHit(t, e)), n; + }, + getHitSpan: function (t) { + return t.component.getHitSpan(t); + }, + getHitEl: function (t) { + return t.component.getHitEl(t); + }, + renderEvents: function (t) { + var e, + n, + i = [], + r = [], + s = []; + for (n = 0; n < t.length; n++) t[n].allDay ? i.push(t[n]) : r.push(t[n]); + (e = this.timeGrid.renderEvents(r)), this.dayGrid && (s = this.dayGrid.renderEvents(i)), this.updateHeight(); + }, + getEventSegs: function () { + return this.timeGrid.getEventSegs().concat(this.dayGrid ? this.dayGrid.getEventSegs() : []); + }, + unrenderEvents: function () { + this.timeGrid.unrenderEvents(), this.dayGrid && this.dayGrid.unrenderEvents(); + }, + renderDrag: function (t, e) { + return t.start.hasTime() ? this.timeGrid.renderDrag(t, e) : this.dayGrid ? this.dayGrid.renderDrag(t, e) : void 0; + }, + unrenderDrag: function () { + this.timeGrid.unrenderDrag(), this.dayGrid && this.dayGrid.unrenderDrag(); + }, + renderSelection: function (t) { + t.start.hasTime() || t.end.hasTime() ? this.timeGrid.renderSelection(t) : this.dayGrid && this.dayGrid.renderSelection(t); + }, + unrenderSelection: function () { + this.timeGrid.unrenderSelection(), this.dayGrid && this.dayGrid.unrenderSelection(); + }, + })), + Fe = { + renderHeadIntroHtml: function () { + var t, + e = this.view; + return e.opt('weekNumbers') + ? ((t = this.start.format(e.opt('smallWeekFormat'))), + '' + + e.buildGotoAnchorHtml({ date: this.start, type: 'week', forceOff: this.colCnt > 1 }, tt(t)) + + '') + : ''; + }, + renderBgIntroHtml: function () { + var t = this.view; + return ''; + }, + renderIntroHtml: function () { + var t = this.view; + return ''; + }, + }, + Ne = { + renderBgIntroHtml: function () { + var t = this.view; + return '' + t.getAllDayHtml() + ''; + }, + renderIntroHtml: function () { + var t = this.view; + return ''; + }, + }, + Ge = 5, + Oe = [{ hours: 1 }, { minutes: 30 }, { minutes: 15 }, { seconds: 30 }, { seconds: 15 }]; + (Zt.agenda = { + class: ze, + defaults: { allDaySlot: !0, slotDuration: '00:30:00', minTime: '00:00:00', maxTime: '24:00:00', slotEventOverlap: !0 }, + }), + (Zt.agendaDay = { type: 'agenda', duration: { days: 1 } }), + (Zt.agendaWeek = { type: 'agenda', duration: { weeks: 1 } }); + var Ae = Ee.extend({ + grid: null, + scroller: null, + initialize: function () { + (this.grid = new Ve(this)), (this.scroller = new be({ overflowX: 'hidden', overflowY: 'auto' })); + }, + setRange: function (t) { + Ee.prototype.setRange.call(this, t), this.grid.setRange(t); + }, + renderSkeleton: function () { + this.el.addClass('fc-list-view ' + this.widgetContentClass), + this.scroller.render(), + this.scroller.el.appendTo(this.el), + this.grid.setElement(this.scroller.scrollEl); + }, + unrenderSkeleton: function () { + this.scroller.destroy(); + }, + setHeight: function (t, e) { + this.scroller.setHeight(this.computeScrollerHeight(t)); + }, + computeScrollerHeight: function (t) { + return t - c(this.el, this.scroller.el); + }, + renderEvents: function (t) { + this.grid.renderEvents(t); + }, + unrenderEvents: function () { + this.grid.unrenderEvents(); + }, + isEventResizable: function (t) { + return !1; + }, + isEventDraggable: function (t) { + return !1; + }, + }), + Ve = me.extend({ + segSelector: '.fc-list-item', + hasDayInteractions: !1, + spanToSegs: function (t) { + for (var e, n = this.view, i = n.start.clone().time(0), r = 0, s = []; i < n.end; ) + if ( + ((e = F(t, { start: i, end: i.clone().add(1, 'day') })), + e && ((e.dayIndex = r), s.push(e)), + i.add(1, 'day'), + r++, + e && !e.isEnd && t.end.hasTime() && t.end < i.clone().add(this.view.nextDayThreshold)) + ) { + (e.end = t.end.clone()), (e.isEnd = !0); + break; + } + return s; + }, + computeEventTimeFormat: function () { + return this.view.opt('mediumTimeFormat'); + }, + handleSegClick: function (e, n) { + var i; + me.prototype.handleSegClick.apply(this, arguments), + t(n.target).closest('a[href]').length || ((i = e.event.url), i && !n.isDefaultPrevented() && (window.location.href = i)); + }, + renderFgSegs: function (t) { + return (t = this.renderFgSegEls(t)), t.length ? this.renderSegList(t) : this.renderEmptyMessage(), t; + }, + renderEmptyMessage: function () { + this.el.html( + '
    ' + + tt(this.view.opt('noEventsMessage')) + + '
    ' + ); + }, + renderSegList: function (e) { + var n, + i, + r, + s = this.groupSegsByDay(e), + o = t('
    '), + l = o.find('tbody'); + for (n = 0; n < s.length; n++) + if ((i = s[n])) + for (l.append(this.dayHeaderHtml(this.view.start.clone().add(n, 'days'))), this.sortEventSegs(i), r = 0; r < i.length; r++) + l.append(i[r].el); + this.el.empty().append(o); + }, + groupSegsByDay: function (t) { + var e, + n, + i = []; + for (e = 0; e < t.length; e++) (n = t[e]), (i[n.dayIndex] || (i[n.dayIndex] = [])).push(n); + return i; + }, + dayHeaderHtml: function (t) { + var e = this.view, + n = e.opt('listDayFormat'), + i = e.opt('listDayAltFormat'); + return ( + '' + + (n ? e.buildGotoAnchorHtml(t, { class: 'fc-list-heading-main' }, tt(t.format(n))) : '') + + (i ? e.buildGotoAnchorHtml(t, { class: 'fc-list-heading-alt' }, tt(t.format(i))) : '') + + '' + ); + }, + fgSegHtml: function (t) { + var e, + n = this.view, + i = ['fc-list-item'].concat(this.getSegCustomClasses(t)), + r = this.getSegBackgroundColor(t), + s = t.event, + o = s.url; + return ( + (e = s.allDay + ? n.getAllDayHtml() + : n.isMultiDayEvent(s) + ? t.isStart || t.isEnd + ? tt(this.getEventTimeText(t)) + : n.getAllDayHtml() + : tt(this.getEventTimeText(s))), + o && i.push('fc-has-url'), + '' + + (this.displayEventTime ? '' + (e || '') + '' : '') + + '' + + tt(t.event.title || '') + + '' + ); + }, + }); + return ( + (Zt.list = { + class: Ae, + buttonTextKey: 'list', + defaults: { buttonText: 'list', listDayFormat: 'LL', noEventsMessage: 'No events to display' }, + }), + (Zt.listDay = { type: 'list', duration: { days: 1 }, defaults: { listDayFormat: 'dddd' } }), + (Zt.listWeek = { type: 'list', duration: { weeks: 1 }, defaults: { listDayFormat: 'dddd', listDayAltFormat: 'LL' } }), + (Zt.listMonth = { type: 'list', duration: { month: 1 }, defaults: { listDayAltFormat: 'dddd' } }), + (Zt.listYear = { type: 'list', duration: { year: 1 }, defaults: { listDayAltFormat: 'dddd' } }), + qt + ); +}); diff --git a/src/main/webapp/content/js/jquery-3.1.1.min.js b/src/main/webapp/content/js/jquery-3.1.1.min.js new file mode 100644 index 0000000..e9df6b9 --- /dev/null +++ b/src/main/webapp/content/js/jquery-3.1.1.min.js @@ -0,0 +1,4432 @@ +/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */ +!(function (a, b) { + 'use strict'; + 'object' == typeof module && 'object' == typeof module.exports + ? (module.exports = a.document + ? b(a, !0) + : function (a) { + if (!a.document) throw new Error('jQuery requires a window with a document'); + return b(a); + }) + : b(a); +})('undefined' != typeof window ? window : this, function (a, b) { + 'use strict'; + var c = [], + d = a.document, + e = Object.getPrototypeOf, + f = c.slice, + g = c.concat, + h = c.push, + i = c.indexOf, + j = {}, + k = j.toString, + l = j.hasOwnProperty, + m = l.toString, + n = m.call(Object), + o = {}; + function p(a, b) { + b = b || d; + var c = b.createElement('script'); + (c.text = a), b.head.appendChild(c).parentNode.removeChild(c); + } + var q = '3.1.1', + r = function (a, b) { + return new r.fn.init(a, b); + }, + s = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + t = /^-ms-/, + u = /-([a-z])/g, + v = function (a, b) { + return b.toUpperCase(); + }; + (r.fn = r.prototype = + { + jquery: q, + constructor: r, + length: 0, + toArray: function () { + return f.call(this); + }, + get: function (a) { + return null == a ? f.call(this) : a < 0 ? this[a + this.length] : this[a]; + }, + pushStack: function (a) { + var b = r.merge(this.constructor(), a); + return (b.prevObject = this), b; + }, + each: function (a) { + return r.each(this, a); + }, + map: function (a) { + return this.pushStack( + r.map(this, function (b, c) { + return a.call(b, c, b); + }) + ); + }, + slice: function () { + return this.pushStack(f.apply(this, arguments)); + }, + first: function () { + return this.eq(0); + }, + last: function () { + return this.eq(-1); + }, + eq: function (a) { + var b = this.length, + c = +a + (a < 0 ? b : 0); + return this.pushStack(c >= 0 && c < b ? [this[c]] : []); + }, + end: function () { + return this.prevObject || this.constructor(); + }, + push: h, + sort: c.sort, + splice: c.splice, + }), + (r.extend = r.fn.extend = + function () { + var a, + b, + c, + d, + e, + f, + g = arguments[0] || {}, + h = 1, + i = arguments.length, + j = !1; + for ( + 'boolean' == typeof g && ((j = g), (g = arguments[h] || {}), h++), + 'object' == typeof g || r.isFunction(g) || (g = {}), + h === i && ((g = this), h--); + h < i; + h++ + ) + if (null != (a = arguments[h])) + for (b in a) + (c = g[b]), + (d = a[b]), + g !== d && + (j && d && (r.isPlainObject(d) || (e = r.isArray(d))) + ? (e ? ((e = !1), (f = c && r.isArray(c) ? c : [])) : (f = c && r.isPlainObject(c) ? c : {}), + (g[b] = r.extend(j, f, d))) + : void 0 !== d && (g[b] = d)); + return g; + }), + r.extend({ + expando: 'jQuery' + (q + Math.random()).replace(/\D/g, ''), + isReady: !0, + error: function (a) { + throw new Error(a); + }, + noop: function () {}, + isFunction: function (a) { + return 'function' === r.type(a); + }, + isArray: Array.isArray, + isWindow: function (a) { + return null != a && a === a.window; + }, + isNumeric: function (a) { + var b = r.type(a); + return ('number' === b || 'string' === b) && !isNaN(a - parseFloat(a)); + }, + isPlainObject: function (a) { + var b, c; + return ( + !(!a || '[object Object]' !== k.call(a)) && + (!(b = e(a)) || ((c = l.call(b, 'constructor') && b.constructor), 'function' == typeof c && m.call(c) === n)) + ); + }, + isEmptyObject: function (a) { + var b; + for (b in a) return !1; + return !0; + }, + type: function (a) { + return null == a ? a + '' : 'object' == typeof a || 'function' == typeof a ? j[k.call(a)] || 'object' : typeof a; + }, + globalEval: function (a) { + p(a); + }, + camelCase: function (a) { + return a.replace(t, 'ms-').replace(u, v); + }, + nodeName: function (a, b) { + return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase(); + }, + each: function (a, b) { + var c, + d = 0; + if (w(a)) { + for (c = a.length; d < c; d++) if (b.call(a[d], d, a[d]) === !1) break; + } else for (d in a) if (b.call(a[d], d, a[d]) === !1) break; + return a; + }, + trim: function (a) { + return null == a ? '' : (a + '').replace(s, ''); + }, + makeArray: function (a, b) { + var c = b || []; + return null != a && (w(Object(a)) ? r.merge(c, 'string' == typeof a ? [a] : a) : h.call(c, a)), c; + }, + inArray: function (a, b, c) { + return null == b ? -1 : i.call(b, a, c); + }, + merge: function (a, b) { + for (var c = +b.length, d = 0, e = a.length; d < c; d++) a[e++] = b[d]; + return (a.length = e), a; + }, + grep: function (a, b, c) { + for (var d, e = [], f = 0, g = a.length, h = !c; f < g; f++) (d = !b(a[f], f)), d !== h && e.push(a[f]); + return e; + }, + map: function (a, b, c) { + var d, + e, + f = 0, + h = []; + if (w(a)) for (d = a.length; f < d; f++) (e = b(a[f], f, c)), null != e && h.push(e); + else for (f in a) (e = b(a[f], f, c)), null != e && h.push(e); + return g.apply([], h); + }, + guid: 1, + proxy: function (a, b) { + var c, d, e; + if (('string' == typeof b && ((c = a[b]), (b = a), (a = c)), r.isFunction(a))) + return ( + (d = f.call(arguments, 2)), + (e = function () { + return a.apply(b || this, d.concat(f.call(arguments))); + }), + (e.guid = a.guid = a.guid || r.guid++), + e + ); + }, + now: Date.now, + support: o, + }), + 'function' == typeof Symbol && (r.fn[Symbol.iterator] = c[Symbol.iterator]), + r.each('Boolean Number String Function Array Date RegExp Object Error Symbol'.split(' '), function (a, b) { + j['[object ' + b + ']'] = b.toLowerCase(); + }); + function w(a) { + var b = !!a && 'length' in a && a.length, + c = r.type(a); + return 'function' !== c && !r.isWindow(a) && ('array' === c || 0 === b || ('number' == typeof b && b > 0 && b - 1 in a)); + } + var x = (function (a) { + var b, + c, + d, + e, + f, + g, + h, + i, + j, + k, + l, + m, + n, + o, + p, + q, + r, + s, + t, + u = 'sizzle' + 1 * new Date(), + v = a.document, + w = 0, + x = 0, + y = ha(), + z = ha(), + A = ha(), + B = function (a, b) { + return a === b && (l = !0), 0; + }, + C = {}.hasOwnProperty, + D = [], + E = D.pop, + F = D.push, + G = D.push, + H = D.slice, + I = function (a, b) { + for (var c = 0, d = a.length; c < d; c++) if (a[c] === b) return c; + return -1; + }, + J = 'checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped', + K = '[\\x20\\t\\r\\n\\f]', + L = '(?:\\\\.|[\\w-]|[^\0-\\xa0])+', + M = + '\\[' + + K + + '*(' + + L + + ')(?:' + + K + + '*([*^$|!~]?=)' + + K + + '*(?:\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)"|(' + + L + + '))|)' + + K + + '*\\]', + N = ':(' + L + ')(?:\\(((\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|' + M + ')*)|.*)\\)|)', + O = new RegExp(K + '+', 'g'), + P = new RegExp('^' + K + '+|((?:^|[^\\\\])(?:\\\\.)*)' + K + '+$', 'g'), + Q = new RegExp('^' + K + '*,' + K + '*'), + R = new RegExp('^' + K + '*([>+~]|' + K + ')' + K + '*'), + S = new RegExp('=' + K + '*([^\\]\'"]*?)' + K + '*\\]', 'g'), + T = new RegExp(N), + U = new RegExp('^' + L + '$'), + V = { + ID: new RegExp('^#(' + L + ')'), + CLASS: new RegExp('^\\.(' + L + ')'), + TAG: new RegExp('^(' + L + '|[*])'), + ATTR: new RegExp('^' + M), + PSEUDO: new RegExp('^' + N), + CHILD: new RegExp( + '^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(' + + K + + '*(even|odd|(([+-]|)(\\d*)n|)' + + K + + '*(?:([+-]|)' + + K + + '*(\\d+)|))' + + K + + '*\\)|)', + 'i' + ), + bool: new RegExp('^(?:' + J + ')$', 'i'), + needsContext: new RegExp( + '^' + K + '*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(' + K + '*((?:-\\d)?\\d*)' + K + '*\\)|)(?=[^-]|$)', + 'i' + ), + }, + W = /^(?:input|select|textarea|button)$/i, + X = /^h\d$/i, + Y = /^[^{]+\{\s*\[native \w/, + Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + $ = /[+~]/, + _ = new RegExp('\\\\([\\da-f]{1,6}' + K + '?|(' + K + ')|.)', 'ig'), + aa = function (a, b, c) { + var d = '0x' + b - 65536; + return d !== d || c ? b : d < 0 ? String.fromCharCode(d + 65536) : String.fromCharCode((d >> 10) | 55296, (1023 & d) | 56320); + }, + ba = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + ca = function (a, b) { + return b ? ('\0' === a ? '\ufffd' : a.slice(0, -1) + '\\' + a.charCodeAt(a.length - 1).toString(16) + ' ') : '\\' + a; + }, + da = function () { + m(); + }, + ea = ta( + function (a) { + return a.disabled === !0 && ('form' in a || 'label' in a); + }, + { dir: 'parentNode', next: 'legend' } + ); + try { + G.apply((D = H.call(v.childNodes)), v.childNodes), D[v.childNodes.length].nodeType; + } catch (fa) { + G = { + apply: D.length + ? function (a, b) { + F.apply(a, H.call(b)); + } + : function (a, b) { + var c = a.length, + d = 0; + while ((a[c++] = b[d++])); + a.length = c - 1; + }, + }; + } + function ga(a, b, d, e) { + var f, + h, + j, + k, + l, + o, + r, + s = b && b.ownerDocument, + w = b ? b.nodeType : 9; + if (((d = d || []), 'string' != typeof a || !a || (1 !== w && 9 !== w && 11 !== w))) return d; + if (!e && ((b ? b.ownerDocument || b : v) !== n && m(b), (b = b || n), p)) { + if (11 !== w && (l = Z.exec(a))) + if ((f = l[1])) { + if (9 === w) { + if (!(j = b.getElementById(f))) return d; + if (j.id === f) return d.push(j), d; + } else if (s && (j = s.getElementById(f)) && t(b, j) && j.id === f) return d.push(j), d; + } else { + if (l[2]) return G.apply(d, b.getElementsByTagName(a)), d; + if ((f = l[3]) && c.getElementsByClassName && b.getElementsByClassName) return G.apply(d, b.getElementsByClassName(f)), d; + } + if (c.qsa && !A[a + ' '] && (!q || !q.test(a))) { + if (1 !== w) (s = b), (r = a); + else if ('object' !== b.nodeName.toLowerCase()) { + (k = b.getAttribute('id')) ? (k = k.replace(ba, ca)) : b.setAttribute('id', (k = u)), (o = g(a)), (h = o.length); + while (h--) o[h] = '#' + k + ' ' + sa(o[h]); + (r = o.join(',')), (s = ($.test(a) && qa(b.parentNode)) || b); + } + if (r) + try { + return G.apply(d, s.querySelectorAll(r)), d; + } catch (x) { + } finally { + k === u && b.removeAttribute('id'); + } + } + } + return i(a.replace(P, '$1'), b, d, e); + } + function ha() { + var a = []; + function b(c, e) { + return a.push(c + ' ') > d.cacheLength && delete b[a.shift()], (b[c + ' '] = e); + } + return b; + } + function ia(a) { + return (a[u] = !0), a; + } + function ja(a) { + var b = n.createElement('fieldset'); + try { + return !!a(b); + } catch (c) { + return !1; + } finally { + b.parentNode && b.parentNode.removeChild(b), (b = null); + } + } + function ka(a, b) { + var c = a.split('|'), + e = c.length; + while (e--) d.attrHandle[c[e]] = b; + } + function la(a, b) { + var c = b && a, + d = c && 1 === a.nodeType && 1 === b.nodeType && a.sourceIndex - b.sourceIndex; + if (d) return d; + if (c) while ((c = c.nextSibling)) if (c === b) return -1; + return a ? 1 : -1; + } + function ma(a) { + return function (b) { + var c = b.nodeName.toLowerCase(); + return 'input' === c && b.type === a; + }; + } + function na(a) { + return function (b) { + var c = b.nodeName.toLowerCase(); + return ('input' === c || 'button' === c) && b.type === a; + }; + } + function oa(a) { + return function (b) { + return 'form' in b + ? b.parentNode && b.disabled === !1 + ? 'label' in b + ? 'label' in b.parentNode + ? b.parentNode.disabled === a + : b.disabled === a + : b.isDisabled === a || (b.isDisabled !== !a && ea(b) === a) + : b.disabled === a + : 'label' in b && b.disabled === a; + }; + } + function pa(a) { + return ia(function (b) { + return ( + (b = +b), + ia(function (c, d) { + var e, + f = a([], c.length, b), + g = f.length; + while (g--) c[(e = f[g])] && (c[e] = !(d[e] = c[e])); + }) + ); + }); + } + function qa(a) { + return a && 'undefined' != typeof a.getElementsByTagName && a; + } + (c = ga.support = {}), + (f = ga.isXML = + function (a) { + var b = a && (a.ownerDocument || a).documentElement; + return !!b && 'HTML' !== b.nodeName; + }), + (m = ga.setDocument = + function (a) { + var b, + e, + g = a ? a.ownerDocument || a : v; + return g !== n && 9 === g.nodeType && g.documentElement + ? ((n = g), + (o = n.documentElement), + (p = !f(n)), + v !== n && + (e = n.defaultView) && + e.top !== e && + (e.addEventListener ? e.addEventListener('unload', da, !1) : e.attachEvent && e.attachEvent('onunload', da)), + (c.attributes = ja(function (a) { + return (a.className = 'i'), !a.getAttribute('className'); + })), + (c.getElementsByTagName = ja(function (a) { + return a.appendChild(n.createComment('')), !a.getElementsByTagName('*').length; + })), + (c.getElementsByClassName = Y.test(n.getElementsByClassName)), + (c.getById = ja(function (a) { + return (o.appendChild(a).id = u), !n.getElementsByName || !n.getElementsByName(u).length; + })), + c.getById + ? ((d.filter.ID = function (a) { + var b = a.replace(_, aa); + return function (a) { + return a.getAttribute('id') === b; + }; + }), + (d.find.ID = function (a, b) { + if ('undefined' != typeof b.getElementById && p) { + var c = b.getElementById(a); + return c ? [c] : []; + } + })) + : ((d.filter.ID = function (a) { + var b = a.replace(_, aa); + return function (a) { + var c = 'undefined' != typeof a.getAttributeNode && a.getAttributeNode('id'); + return c && c.value === b; + }; + }), + (d.find.ID = function (a, b) { + if ('undefined' != typeof b.getElementById && p) { + var c, + d, + e, + f = b.getElementById(a); + if (f) { + if (((c = f.getAttributeNode('id')), c && c.value === a)) return [f]; + (e = b.getElementsByName(a)), (d = 0); + while ((f = e[d++])) if (((c = f.getAttributeNode('id')), c && c.value === a)) return [f]; + } + return []; + } + })), + (d.find.TAG = c.getElementsByTagName + ? function (a, b) { + return 'undefined' != typeof b.getElementsByTagName + ? b.getElementsByTagName(a) + : c.qsa + ? b.querySelectorAll(a) + : void 0; + } + : function (a, b) { + var c, + d = [], + e = 0, + f = b.getElementsByTagName(a); + if ('*' === a) { + while ((c = f[e++])) 1 === c.nodeType && d.push(c); + return d; + } + return f; + }), + (d.find.CLASS = + c.getElementsByClassName && + function (a, b) { + if ('undefined' != typeof b.getElementsByClassName && p) return b.getElementsByClassName(a); + }), + (r = []), + (q = []), + (c.qsa = Y.test(n.querySelectorAll)) && + (ja(function (a) { + (o.appendChild(a).innerHTML = + ""), + a.querySelectorAll("[msallowcapture^='']").length && q.push('[*^$]=' + K + '*(?:\'\'|"")'), + a.querySelectorAll('[selected]').length || q.push('\\[' + K + '*(?:value|' + J + ')'), + a.querySelectorAll('[id~=' + u + '-]').length || q.push('~='), + a.querySelectorAll(':checked').length || q.push(':checked'), + a.querySelectorAll('a#' + u + '+*').length || q.push('.#.+[+~]'); + }), + ja(function (a) { + a.innerHTML = ""; + var b = n.createElement('input'); + b.setAttribute('type', 'hidden'), + a.appendChild(b).setAttribute('name', 'D'), + a.querySelectorAll('[name=d]').length && q.push('name' + K + '*[*^$|!~]?='), + 2 !== a.querySelectorAll(':enabled').length && q.push(':enabled', ':disabled'), + (o.appendChild(a).disabled = !0), + 2 !== a.querySelectorAll(':disabled').length && q.push(':enabled', ':disabled'), + a.querySelectorAll('*,:x'), + q.push(',.*:'); + })), + (c.matchesSelector = Y.test( + (s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector) + )) && + ja(function (a) { + (c.disconnectedMatch = s.call(a, '*')), s.call(a, "[s!='']:x"), r.push('!=', N); + }), + (q = q.length && new RegExp(q.join('|'))), + (r = r.length && new RegExp(r.join('|'))), + (b = Y.test(o.compareDocumentPosition)), + (t = + b || Y.test(o.contains) + ? 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) while ((b = b.parentNode)) if (b === a) return !0; + return !1; + }), + (B = b + ? function (a, b) { + if (a === b) return (l = !0), 0; + var d = !a.compareDocumentPosition - !b.compareDocumentPosition; + return d + ? d + : ((d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1), + 1 & d || (!c.sortDetached && b.compareDocumentPosition(a) === d) + ? a === n || (a.ownerDocument === v && t(v, a)) + ? -1 + : b === n || (b.ownerDocument === v && t(v, b)) + ? 1 + : k + ? I(k, a) - I(k, b) + : 0 + : 4 & d + ? -1 + : 1); + } + : function (a, b) { + if (a === b) return (l = !0), 0; + var c, + d = 0, + e = a.parentNode, + f = b.parentNode, + g = [a], + h = [b]; + if (!e || !f) return a === n ? -1 : b === n ? 1 : e ? -1 : f ? 1 : k ? I(k, a) - I(k, b) : 0; + if (e === f) return la(a, b); + c = a; + while ((c = c.parentNode)) g.unshift(c); + c = b; + while ((c = c.parentNode)) h.unshift(c); + while (g[d] === h[d]) d++; + return d ? la(g[d], h[d]) : g[d] === v ? -1 : h[d] === v ? 1 : 0; + }), + n) + : n; + }), + (ga.matches = function (a, b) { + return ga(a, null, null, b); + }), + (ga.matchesSelector = function (a, b) { + if ( + ((a.ownerDocument || a) !== n && m(a), + (b = b.replace(S, "='$1']")), + c.matchesSelector && p && !A[b + ' '] && (!r || !r.test(b)) && (!q || !q.test(b))) + ) + try { + var d = s.call(a, b); + if (d || c.disconnectedMatch || (a.document && 11 !== a.document.nodeType)) return d; + } catch (e) {} + return ga(b, n, null, [a]).length > 0; + }), + (ga.contains = function (a, b) { + return (a.ownerDocument || a) !== n && m(a), t(a, b); + }), + (ga.attr = function (a, b) { + (a.ownerDocument || a) !== n && m(a); + var e = d.attrHandle[b.toLowerCase()], + f = e && C.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : void 0; + return void 0 !== f ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null; + }), + (ga.escape = function (a) { + return (a + '').replace(ba, ca); + }), + (ga.error = function (a) { + throw new Error('Syntax error, unrecognized expression: ' + a); + }), + (ga.uniqueSort = function (a) { + var b, + d = [], + e = 0, + f = 0; + if (((l = !c.detectDuplicates), (k = !c.sortStable && a.slice(0)), a.sort(B), l)) { + while ((b = a[f++])) b === a[f] && (e = d.push(f)); + while (e--) a.splice(d[e], 1); + } + return (k = null), a; + }), + (e = ga.getText = + function (a) { + var b, + c = '', + d = 0, + f = a.nodeType; + if (f) { + if (1 === f || 9 === f || 11 === f) { + if ('string' == typeof a.textContent) return a.textContent; + for (a = a.firstChild; a; a = a.nextSibling) c += e(a); + } else if (3 === f || 4 === f) return a.nodeValue; + } else while ((b = a[d++])) c += e(b); + return c; + }), + (d = ga.selectors = + { + cacheLength: 50, + createPseudo: ia, + match: V, + attrHandle: {}, + find: {}, + relative: { + '>': { dir: 'parentNode', first: !0 }, + ' ': { dir: 'parentNode' }, + '+': { dir: 'previousSibling', first: !0 }, + '~': { dir: 'previousSibling' }, + }, + preFilter: { + ATTR: function (a) { + return ( + (a[1] = a[1].replace(_, aa)), + (a[3] = (a[3] || a[4] || a[5] || '').replace(_, aa)), + '~=' === 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] || ga.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] && ga.error(a[0]), + a + ); + }, + PSEUDO: function (a) { + var b, + c = !a[6] && a[2]; + return V.CHILD.test(a[0]) + ? null + : (a[3] + ? (a[2] = a[4] || a[5] || '') + : c && + T.test(c) && + (b = g(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) { + var b = a.replace(_, aa).toLowerCase(); + return '*' === a + ? function () { + return !0; + } + : function (a) { + return a.nodeName && a.nodeName.toLowerCase() === b; + }; + }, + CLASS: function (a) { + var b = y[a + ' ']; + return ( + b || + ((b = new RegExp('(^|' + K + ')' + a + '(' + K + '|$)')) && + y(a, function (a) { + return b.test( + ('string' == typeof a.className && a.className) || + ('undefined' != typeof a.getAttribute && a.getAttribute('class')) || + '' + ); + })) + ); + }, + ATTR: function (a, b, c) { + return function (d) { + var e = ga.attr(d, a); + return null == e + ? '!=' === b + : !b || + ((e += ''), + '=' === b + ? e === c + : '!=' === b + ? e !== c + : '^=' === b + ? c && 0 === e.indexOf(c) + : '*=' === b + ? c && e.indexOf(c) > -1 + : '$=' === b + ? c && e.slice(-c.length) === c + : '~=' === b + ? (' ' + e.replace(O, ' ') + ' ').indexOf(c) > -1 + : '|=' === b && (e === c || e.slice(0, c.length + 1) === c + '-')); + }; + }, + 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, + t = !1; + if (q) { + if (f) { + while (p) { + m = b; + while ((m = m[p])) if (h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) return !1; + o = p = 'only' === a && !o && 'nextSibling'; + } + return !0; + } + if (((o = [g ? q.firstChild : q.lastChild]), g && s)) { + (m = q), + (l = m[u] || (m[u] = {})), + (k = l[m.uniqueID] || (l[m.uniqueID] = {})), + (j = k[a] || []), + (n = j[0] === w && j[1]), + (t = n && j[2]), + (m = n && q.childNodes[n]); + while ((m = (++n && m && m[p]) || (t = n = 0) || o.pop())) + if (1 === m.nodeType && ++t && m === b) { + k[a] = [w, n, t]; + break; + } + } else if ( + (s && + ((m = b), + (l = m[u] || (m[u] = {})), + (k = l[m.uniqueID] || (l[m.uniqueID] = {})), + (j = k[a] || []), + (n = j[0] === w && j[1]), + (t = n)), + t === !1) + ) + while ((m = (++n && m && m[p]) || (t = n = 0) || o.pop())) + if ( + (h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) && + ++t && + (s && ((l = m[u] || (m[u] = {})), (k = l[m.uniqueID] || (l[m.uniqueID] = {})), (k[a] = [w, t])), m === b) + ) + break; + return (t -= e), t === d || (t % d === 0 && t / d >= 0); + } + }; + }, + PSEUDO: function (a, b) { + var c, + e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || ga.error('unsupported pseudo: ' + a); + return e[u] + ? e(b) + : e.length > 1 + ? ((c = [a, a, '', b]), + d.setFilters.hasOwnProperty(a.toLowerCase()) + ? ia(function (a, c) { + var d, + f = e(a, b), + g = f.length; + while (g--) (d = I(a, f[g])), (a[d] = !(c[d] = f[g])); + }) + : function (a) { + return e(a, 0, c); + }) + : e; + }, + }, + pseudos: { + not: ia(function (a) { + var b = [], + c = [], + d = h(a.replace(P, '$1')); + return d[u] + ? ia(function (a, b, c, e) { + var f, + g = d(a, null, e, []), + h = a.length; + while (h--) (f = g[h]) && (a[h] = !(b[h] = f)); + }) + : function (a, e, f) { + return (b[0] = a), d(b, null, f, c), (b[0] = null), !c.pop(); + }; + }), + has: ia(function (a) { + return function (b) { + return ga(a, b).length > 0; + }; + }), + contains: ia(function (a) { + return ( + (a = a.replace(_, aa)), + function (b) { + return (b.textContent || b.innerText || e(b)).indexOf(a) > -1; + } + ); + }), + lang: ia(function (a) { + return ( + U.test(a || '') || ga.error('unsupported lang: ' + a), + (a = a.replace(_, aa).toLowerCase()), + function (b) { + var c; + do + if ((c = p ? 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 (b) { + var c = a.location && a.location.hash; + return c && c.slice(1) === b.id; + }, + root: function (a) { + return a === o; + }, + focus: function (a) { + return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex); + }, + enabled: oa(!1), + disabled: oa(!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.nodeType < 6) return !1; + return !0; + }, + parent: function (a) { + return !d.pseudos.empty(a); + }, + header: function (a) { + return X.test(a.nodeName); + }, + input: function (a) { + return W.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')) || 'text' === b.toLowerCase()) + ); + }, + first: pa(function () { + return [0]; + }), + last: pa(function (a, b) { + return [b - 1]; + }), + eq: pa(function (a, b, c) { + return [c < 0 ? c + b : c]; + }), + even: pa(function (a, b) { + for (var c = 0; c < b; c += 2) a.push(c); + return a; + }), + odd: pa(function (a, b) { + for (var c = 1; c < b; c += 2) a.push(c); + return a; + }), + lt: pa(function (a, b, c) { + for (var d = c < 0 ? c + b : c; --d >= 0; ) a.push(d); + return a; + }), + gt: pa(function (a, b, c) { + for (var d = c < 0 ? c + b : c; ++d < b; ) a.push(d); + return a; + }), + }, + }), + (d.pseudos.nth = d.pseudos.eq); + for (b in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) d.pseudos[b] = ma(b); + for (b in { submit: !0, reset: !0 }) d.pseudos[b] = na(b); + function ra() {} + (ra.prototype = d.filters = d.pseudos), + (d.setFilters = new ra()), + (g = ga.tokenize = + function (a, b) { + var c, + e, + f, + g, + h, + i, + j, + k = z[a + ' ']; + if (k) return b ? 0 : k.slice(0); + (h = a), (i = []), (j = d.preFilter); + while (h) { + (c && !(e = Q.exec(h))) || (e && (h = h.slice(e[0].length) || h), i.push((f = []))), + (c = !1), + (e = R.exec(h)) && ((c = e.shift()), f.push({ value: c, type: e[0].replace(P, ' ') }), (h = h.slice(c.length))); + for (g in d.filter) + !(e = V[g].exec(h)) || + (j[g] && !(e = j[g](e))) || + ((c = e.shift()), f.push({ value: c, type: g, matches: e }), (h = h.slice(c.length))); + if (!c) break; + } + return b ? h.length : h ? ga.error(a) : z(a, i).slice(0); + }); + function sa(a) { + for (var b = 0, c = a.length, d = ''; b < c; b++) d += a[b].value; + return d; + } + function ta(a, b, c) { + var d = b.dir, + e = b.next, + f = e || d, + g = c && 'parentNode' === f, + h = x++; + return b.first + ? function (b, c, e) { + while ((b = b[d])) if (1 === b.nodeType || g) return a(b, c, e); + return !1; + } + : function (b, c, i) { + var j, + k, + l, + m = [w, h]; + if (i) { + while ((b = b[d])) if ((1 === b.nodeType || g) && a(b, c, i)) return !0; + } else + while ((b = b[d])) + if (1 === b.nodeType || g) + if (((l = b[u] || (b[u] = {})), (k = l[b.uniqueID] || (l[b.uniqueID] = {})), e && e === b.nodeName.toLowerCase())) + b = b[d] || b; + else { + if ((j = k[f]) && j[0] === w && j[1] === h) return (m[2] = j[2]); + if (((k[f] = m), (m[2] = a(b, c, i)))) return !0; + } + return !1; + }; + } + function ua(a) { + return a.length > 1 + ? function (b, c, d) { + var e = a.length; + while (e--) if (!a[e](b, c, d)) return !1; + return !0; + } + : a[0]; + } + function va(a, b, c) { + for (var d = 0, e = b.length; d < e; d++) ga(a, b[d], c); + return c; + } + function wa(a, b, c, d, e) { + for (var f, g = [], h = 0, i = a.length, j = null != b; h < i; h++) (f = a[h]) && ((c && !c(f, d, e)) || (g.push(f), j && b.push(h))); + return g; + } + function xa(a, b, c, d, e, f) { + return ( + d && !d[u] && (d = xa(d)), + e && !e[u] && (e = xa(e, f)), + ia(function (f, g, h, i) { + var j, + k, + l, + m = [], + n = [], + o = g.length, + p = f || va(b || '*', h.nodeType ? [h] : h, []), + q = !a || (!f && b) ? p : wa(p, m, a, h, i), + r = c ? (e || (f ? a : o || d) ? [] : g) : q; + if ((c && c(q, r, h, i), d)) { + (j = wa(r, n)), d(j, [], h, i), (k = j.length); + while (k--) (l = j[k]) && (r[n[k]] = !(q[n[k]] = l)); + } + if (f) { + if (e || a) { + if (e) { + (j = []), (k = r.length); + while (k--) (l = r[k]) && j.push((q[k] = l)); + e(null, (r = []), j, i); + } + k = r.length; + while (k--) (l = r[k]) && (j = e ? I(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l)); + } + } else (r = wa(r === g ? r.splice(o, r.length) : r)), e ? e(null, g, r, i) : G.apply(g, r); + }) + ); + } + function ya(a) { + for ( + var b, + c, + e, + f = a.length, + g = d.relative[a[0].type], + h = g || d.relative[' '], + i = g ? 1 : 0, + k = ta( + function (a) { + return a === b; + }, + h, + !0 + ), + l = ta( + function (a) { + return I(b, a) > -1; + }, + h, + !0 + ), + m = [ + function (a, c, d) { + var e = (!g && (d || c !== j)) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d)); + return (b = null), e; + }, + ]; + i < f; + i++ + ) + if ((c = d.relative[a[i].type])) m = [ta(ua(m), c)]; + else { + if (((c = d.filter[a[i].type].apply(null, a[i].matches)), c[u])) { + for (e = ++i; e < f; e++) if (d.relative[a[e].type]) break; + return xa( + i > 1 && ua(m), + i > 1 && sa(a.slice(0, i - 1).concat({ value: ' ' === a[i - 2].type ? '*' : '' })).replace(P, '$1'), + c, + i < e && ya(a.slice(i, e)), + e < f && ya((a = a.slice(e))), + e < f && sa(a) + ); + } + m.push(c); + } + return ua(m); + } + function za(a, b) { + var c = b.length > 0, + e = a.length > 0, + f = function (f, g, h, i, k) { + var l, + o, + q, + r = 0, + s = '0', + t = f && [], + u = [], + v = j, + x = f || (e && d.find.TAG('*', k)), + y = (w += null == v ? 1 : Math.random() || 0.1), + z = x.length; + for (k && (j = g === n || g || k); s !== z && null != (l = x[s]); s++) { + if (e && l) { + (o = 0), g || l.ownerDocument === n || (m(l), (h = !p)); + while ((q = a[o++])) + if (q(l, g || n, h)) { + i.push(l); + break; + } + k && (w = y); + } + c && ((l = !q && l) && r--, f && t.push(l)); + } + if (((r += s), c && s !== r)) { + o = 0; + while ((q = b[o++])) q(t, u, g, h); + if (f) { + if (r > 0) while (s--) t[s] || u[s] || (u[s] = E.call(i)); + u = wa(u); + } + G.apply(i, u), k && !f && u.length > 0 && r + b.length > 1 && ga.uniqueSort(i); + } + return k && ((w = y), (j = v)), t; + }; + return c ? ia(f) : f; + } + return ( + (h = ga.compile = + function (a, b) { + var c, + d = [], + e = [], + f = A[a + ' ']; + if (!f) { + b || (b = g(a)), (c = b.length); + while (c--) (f = ya(b[c])), f[u] ? d.push(f) : e.push(f); + (f = A(a, za(e, d))), (f.selector = a); + } + return f; + }), + (i = ga.select = + function (a, b, c, e) { + var f, + i, + j, + k, + l, + m = 'function' == typeof a && a, + n = !e && g((a = m.selector || a)); + if (((c = c || []), 1 === n.length)) { + if (((i = n[0] = n[0].slice(0)), i.length > 2 && 'ID' === (j = i[0]).type && 9 === b.nodeType && p && d.relative[i[1].type])) { + if (((b = (d.find.ID(j.matches[0].replace(_, aa), b) || [])[0]), !b)) return c; + m && (b = b.parentNode), (a = a.slice(i.shift().value.length)); + } + f = V.needsContext.test(a) ? 0 : i.length; + while (f--) { + if (((j = i[f]), d.relative[(k = j.type)])) break; + if ((l = d.find[k]) && (e = l(j.matches[0].replace(_, aa), ($.test(i[0].type) && qa(b.parentNode)) || b))) { + if ((i.splice(f, 1), (a = e.length && sa(i)), !a)) return G.apply(c, e), c; + break; + } + } + } + return (m || h(a, n))(e, b, !p, c, !b || ($.test(a) && qa(b.parentNode)) || b), c; + }), + (c.sortStable = u.split('').sort(B).join('') === u), + (c.detectDuplicates = !!l), + m(), + (c.sortDetached = ja(function (a) { + return 1 & a.compareDocumentPosition(n.createElement('fieldset')); + })), + ja(function (a) { + return (a.innerHTML = ""), '#' === a.firstChild.getAttribute('href'); + }) || + ka('type|href|height|width', function (a, b, c) { + if (!c) return a.getAttribute(b, 'type' === b.toLowerCase() ? 1 : 2); + }), + (c.attributes && + ja(function (a) { + return (a.innerHTML = ''), a.firstChild.setAttribute('value', ''), '' === a.firstChild.getAttribute('value'); + })) || + ka('value', function (a, b, c) { + if (!c && 'input' === a.nodeName.toLowerCase()) return a.defaultValue; + }), + ja(function (a) { + return null == a.getAttribute('disabled'); + }) || + ka(J, function (a, b, c) { + var d; + if (!c) return a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null; + }), + ga + ); + })(a); + (r.find = x), + (r.expr = x.selectors), + (r.expr[':'] = r.expr.pseudos), + (r.uniqueSort = r.unique = x.uniqueSort), + (r.text = x.getText), + (r.isXMLDoc = x.isXML), + (r.contains = x.contains), + (r.escapeSelector = x.escape); + var y = function (a, b, c) { + var d = [], + e = void 0 !== c; + while ((a = a[b]) && 9 !== a.nodeType) + if (1 === a.nodeType) { + if (e && r(a).is(c)) break; + d.push(a); + } + return d; + }, + z = function (a, b) { + for (var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== b && c.push(a); + return c; + }, + A = r.expr.match.needsContext, + B = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i, + C = /^.[^:#\[\.,]*$/; + function D(a, b, c) { + return r.isFunction(b) + ? r.grep(a, function (a, d) { + return !!b.call(a, d, a) !== c; + }) + : b.nodeType + ? r.grep(a, function (a) { + return (a === b) !== c; + }) + : 'string' != typeof b + ? r.grep(a, function (a) { + return i.call(b, a) > -1 !== c; + }) + : C.test(b) + ? r.filter(b, a, c) + : ((b = r.filter(b, a)), + r.grep(a, function (a) { + return i.call(b, a) > -1 !== c && 1 === a.nodeType; + })); + } + (r.filter = function (a, b, c) { + var d = b[0]; + return ( + c && (a = ':not(' + a + ')'), + 1 === b.length && 1 === d.nodeType + ? r.find.matchesSelector(d, a) + ? [d] + : [] + : r.find.matches( + a, + r.grep(b, function (a) { + return 1 === a.nodeType; + }) + ) + ); + }), + r.fn.extend({ + find: function (a) { + var b, + c, + d = this.length, + e = this; + if ('string' != typeof a) + return this.pushStack( + r(a).filter(function () { + for (b = 0; b < d; b++) if (r.contains(e[b], this)) return !0; + }) + ); + for (c = this.pushStack([]), b = 0; b < d; b++) r.find(a, e[b], c); + return d > 1 ? r.uniqueSort(c) : c; + }, + filter: function (a) { + return this.pushStack(D(this, a || [], !1)); + }, + not: function (a) { + return this.pushStack(D(this, a || [], !0)); + }, + is: function (a) { + return !!D(this, 'string' == typeof a && A.test(a) ? r(a) : a || [], !1).length; + }, + }); + var E, + F = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + G = (r.fn.init = function (a, b, c) { + var e, f; + if (!a) return this; + if (((c = c || E), 'string' == typeof a)) { + if (((e = '<' === a[0] && '>' === a[a.length - 1] && a.length >= 3 ? [null, a, null] : F.exec(a)), !e || (!e[1] && b))) + return !b || b.jquery ? (b || c).find(a) : this.constructor(b).find(a); + if (e[1]) { + if ( + ((b = b instanceof r ? b[0] : b), + r.merge(this, r.parseHTML(e[1], b && b.nodeType ? b.ownerDocument || b : d, !0)), + B.test(e[1]) && r.isPlainObject(b)) + ) + for (e in b) r.isFunction(this[e]) ? this[e](b[e]) : this.attr(e, b[e]); + return this; + } + return (f = d.getElementById(e[2])), f && ((this[0] = f), (this.length = 1)), this; + } + return a.nodeType + ? ((this[0] = a), (this.length = 1), this) + : r.isFunction(a) + ? void 0 !== c.ready + ? c.ready(a) + : a(r) + : r.makeArray(a, this); + }); + (G.prototype = r.fn), (E = r(d)); + var H = /^(?:parents|prev(?:Until|All))/, + I = { children: !0, contents: !0, next: !0, prev: !0 }; + r.fn.extend({ + has: function (a) { + var b = r(a, this), + c = b.length; + return this.filter(function () { + for (var a = 0; a < c; a++) if (r.contains(this, b[a])) return !0; + }); + }, + closest: function (a, b) { + var c, + d = 0, + e = this.length, + f = [], + g = 'string' != typeof a && r(a); + if (!A.test(a)) + for (; d < e; d++) + for (c = this[d]; c && c !== b; c = c.parentNode) + if (c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && r.find.matchesSelector(c, a))) { + f.push(c); + break; + } + return this.pushStack(f.length > 1 ? r.uniqueSort(f) : f); + }, + index: function (a) { + return a + ? 'string' == typeof a + ? i.call(r(a), this[0]) + : i.call(this, a.jquery ? a[0] : a) + : this[0] && this[0].parentNode + ? this.first().prevAll().length + : -1; + }, + add: function (a, b) { + return this.pushStack(r.uniqueSort(r.merge(this.get(), r(a, b)))); + }, + addBack: function (a) { + return this.add(null == a ? this.prevObject : this.prevObject.filter(a)); + }, + }); + function J(a, b) { + while ((a = a[b]) && 1 !== a.nodeType); + return a; + } + r.each( + { + parent: function (a) { + var b = a.parentNode; + return b && 11 !== b.nodeType ? b : null; + }, + parents: function (a) { + return y(a, 'parentNode'); + }, + parentsUntil: function (a, b, c) { + return y(a, 'parentNode', c); + }, + next: function (a) { + return J(a, 'nextSibling'); + }, + prev: function (a) { + return J(a, 'previousSibling'); + }, + nextAll: function (a) { + return y(a, 'nextSibling'); + }, + prevAll: function (a) { + return y(a, 'previousSibling'); + }, + nextUntil: function (a, b, c) { + return y(a, 'nextSibling', c); + }, + prevUntil: function (a, b, c) { + return y(a, 'previousSibling', c); + }, + siblings: function (a) { + return z((a.parentNode || {}).firstChild, a); + }, + children: function (a) { + return z(a.firstChild); + }, + contents: function (a) { + return a.contentDocument || r.merge([], a.childNodes); + }, + }, + function (a, b) { + r.fn[a] = function (c, d) { + var e = r.map(this, b, c); + return ( + 'Until' !== a.slice(-5) && (d = c), + d && 'string' == typeof d && (e = r.filter(d, e)), + this.length > 1 && (I[a] || r.uniqueSort(e), H.test(a) && e.reverse()), + this.pushStack(e) + ); + }; + } + ); + var K = /[^\x20\t\r\n\f]+/g; + function L(a) { + var b = {}; + return ( + r.each(a.match(K) || [], function (a, c) { + b[c] = !0; + }), + b + ); + } + r.Callbacks = function (a) { + a = 'string' == typeof a ? L(a) : r.extend({}, a); + var b, + c, + d, + e, + f = [], + g = [], + h = -1, + i = function () { + for (e = a.once, d = b = !0; g.length; h = -1) { + c = g.shift(); + while (++h < f.length) f[h].apply(c[0], c[1]) === !1 && a.stopOnFalse && ((h = f.length), (c = !1)); + } + a.memory || (c = !1), (b = !1), e && (f = c ? [] : ''); + }, + j = { + add: function () { + return ( + f && + (c && !b && ((h = f.length - 1), g.push(c)), + (function d(b) { + r.each(b, function (b, c) { + r.isFunction(c) ? (a.unique && j.has(c)) || f.push(c) : c && c.length && 'string' !== r.type(c) && d(c); + }); + })(arguments), + c && !b && i()), + this + ); + }, + remove: function () { + return ( + r.each(arguments, function (a, b) { + var c; + while ((c = r.inArray(b, f, c)) > -1) f.splice(c, 1), c <= h && h--; + }), + this + ); + }, + has: function (a) { + return a ? r.inArray(a, f) > -1 : f.length > 0; + }, + empty: function () { + return f && (f = []), this; + }, + disable: function () { + return (e = g = []), (f = c = ''), this; + }, + disabled: function () { + return !f; + }, + lock: function () { + return (e = g = []), c || b || (f = c = ''), this; + }, + locked: function () { + return !!e; + }, + fireWith: function (a, c) { + return e || ((c = c || []), (c = [a, c.slice ? c.slice() : c]), g.push(c), b || i()), this; + }, + fire: function () { + return j.fireWith(this, arguments), this; + }, + fired: function () { + return !!d; + }, + }; + return j; + }; + function M(a) { + return a; + } + function N(a) { + throw a; + } + function O(a, b, c) { + var d; + try { + a && r.isFunction((d = a.promise)) + ? d.call(a).done(b).fail(c) + : a && r.isFunction((d = a.then)) + ? d.call(a, b, c) + : b.call(void 0, a); + } catch (a) { + c.call(void 0, a); + } + } + r.extend({ + Deferred: function (b) { + var c = [ + ['notify', 'progress', r.Callbacks('memory'), r.Callbacks('memory'), 2], + ['resolve', 'done', r.Callbacks('once memory'), r.Callbacks('once memory'), 0, 'resolved'], + ['reject', 'fail', r.Callbacks('once memory'), r.Callbacks('once memory'), 1, 'rejected'], + ], + d = 'pending', + e = { + state: function () { + return d; + }, + always: function () { + return f.done(arguments).fail(arguments), this; + }, + catch: function (a) { + return e.then(null, a); + }, + pipe: function () { + var a = arguments; + return r + .Deferred(function (b) { + r.each(c, function (c, d) { + var e = r.isFunction(a[d[4]]) && a[d[4]]; + f[d[1]](function () { + var a = e && e.apply(this, arguments); + a && r.isFunction(a.promise) + ? a.promise().progress(b.notify).done(b.resolve).fail(b.reject) + : b[d[0] + 'With'](this, e ? [a] : arguments); + }); + }), + (a = null); + }) + .promise(); + }, + then: function (b, d, e) { + var f = 0; + function g(b, c, d, e) { + return function () { + var h = this, + i = arguments, + j = function () { + var a, j; + if (!(b < f)) { + if (((a = d.apply(h, i)), a === c.promise())) throw new TypeError('Thenable self-resolution'); + (j = a && ('object' == typeof a || 'function' == typeof a) && a.then), + r.isFunction(j) + ? e + ? j.call(a, g(f, c, M, e), g(f, c, N, e)) + : (f++, j.call(a, g(f, c, M, e), g(f, c, N, e), g(f, c, M, c.notifyWith))) + : (d !== M && ((h = void 0), (i = [a])), (e || c.resolveWith)(h, i)); + } + }, + k = e + ? j + : function () { + try { + j(); + } catch (a) { + r.Deferred.exceptionHook && r.Deferred.exceptionHook(a, k.stackTrace), + b + 1 >= f && (d !== N && ((h = void 0), (i = [a])), c.rejectWith(h, i)); + } + }; + b ? k() : (r.Deferred.getStackHook && (k.stackTrace = r.Deferred.getStackHook()), a.setTimeout(k)); + }; + } + return r + .Deferred(function (a) { + c[0][3].add(g(0, a, r.isFunction(e) ? e : M, a.notifyWith)), + c[1][3].add(g(0, a, r.isFunction(b) ? b : M)), + c[2][3].add(g(0, a, r.isFunction(d) ? d : N)); + }) + .promise(); + }, + promise: function (a) { + return null != a ? r.extend(a, e) : e; + }, + }, + f = {}; + return ( + r.each(c, function (a, b) { + var g = b[2], + h = b[5]; + (e[b[1]] = g.add), + h && + g.add( + function () { + d = h; + }, + c[3 - a][2].disable, + c[0][2].lock + ), + g.add(b[3].fire), + (f[b[0]] = function () { + return f[b[0] + 'With'](this === f ? void 0 : this, arguments), this; + }), + (f[b[0] + 'With'] = g.fireWith); + }), + e.promise(f), + b && b.call(f, f), + f + ); + }, + when: function (a) { + var b = arguments.length, + c = b, + d = Array(c), + e = f.call(arguments), + g = r.Deferred(), + h = function (a) { + return function (c) { + (d[a] = this), (e[a] = arguments.length > 1 ? f.call(arguments) : c), --b || g.resolveWith(d, e); + }; + }; + if (b <= 1 && (O(a, g.done(h(c)).resolve, g.reject), 'pending' === g.state() || r.isFunction(e[c] && e[c].then))) return g.then(); + while (c--) O(e[c], h(c), g.reject); + return g.promise(); + }, + }); + var P = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + (r.Deferred.exceptionHook = function (b, c) { + a.console && a.console.warn && b && P.test(b.name) && a.console.warn('jQuery.Deferred exception: ' + b.message, b.stack, c); + }), + (r.readyException = function (b) { + a.setTimeout(function () { + throw b; + }); + }); + var Q = r.Deferred(); + (r.fn.ready = function (a) { + return ( + Q.then(a)['catch'](function (a) { + r.readyException(a); + }), + this + ); + }), + r.extend({ + isReady: !1, + readyWait: 1, + holdReady: function (a) { + a ? r.readyWait++ : r.ready(!0); + }, + ready: function (a) { + (a === !0 ? --r.readyWait : r.isReady) || ((r.isReady = !0), (a !== !0 && --r.readyWait > 0) || Q.resolveWith(d, [r])); + }, + }), + (r.ready.then = Q.then); + function R() { + d.removeEventListener('DOMContentLoaded', R), a.removeEventListener('load', R), r.ready(); + } + 'complete' === d.readyState || ('loading' !== d.readyState && !d.documentElement.doScroll) + ? a.setTimeout(r.ready) + : (d.addEventListener('DOMContentLoaded', R), a.addEventListener('load', R)); + var S = function (a, b, c, d, e, f, g) { + var h = 0, + i = a.length, + j = null == c; + if ('object' === r.type(c)) { + e = !0; + for (h in c) S(a, b, h, c[h], !0, f, g); + } else if ( + void 0 !== d && + ((e = !0), + r.isFunction(d) || (g = !0), + j && + (g + ? (b.call(a, d), (b = null)) + : ((j = b), + (b = function (a, b, c) { + return j.call(r(a), c); + }))), + b) + ) + for (; h < i; h++) b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c))); + return e ? a : j ? b.call(a) : i ? b(a[0], c) : f; + }, + T = function (a) { + return 1 === a.nodeType || 9 === a.nodeType || !+a.nodeType; + }; + function U() { + this.expando = r.expando + U.uid++; + } + (U.uid = 1), + (U.prototype = { + cache: function (a) { + var b = a[this.expando]; + return ( + b || + ((b = {}), + T(a) && (a.nodeType ? (a[this.expando] = b) : Object.defineProperty(a, this.expando, { value: b, configurable: !0 }))), + b + ); + }, + set: function (a, b, c) { + var d, + e = this.cache(a); + if ('string' == typeof b) e[r.camelCase(b)] = c; + else for (d in b) e[r.camelCase(d)] = b[d]; + return e; + }, + get: function (a, b) { + return void 0 === b ? this.cache(a) : a[this.expando] && a[this.expando][r.camelCase(b)]; + }, + access: function (a, b, c) { + return void 0 === b || (b && 'string' == typeof b && void 0 === c) ? this.get(a, b) : (this.set(a, b, c), void 0 !== c ? c : b); + }, + remove: function (a, b) { + var c, + d = a[this.expando]; + if (void 0 !== d) { + if (void 0 !== b) { + r.isArray(b) ? (b = b.map(r.camelCase)) : ((b = r.camelCase(b)), (b = b in d ? [b] : b.match(K) || [])), (c = b.length); + while (c--) delete d[b[c]]; + } + (void 0 === b || r.isEmptyObject(d)) && (a.nodeType ? (a[this.expando] = void 0) : delete a[this.expando]); + } + }, + hasData: function (a) { + var b = a[this.expando]; + return void 0 !== b && !r.isEmptyObject(b); + }, + }); + var V = new U(), + W = new U(), + X = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + Y = /[A-Z]/g; + function Z(a) { + return 'true' === a || ('false' !== a && ('null' === a ? null : a === +a + '' ? +a : X.test(a) ? JSON.parse(a) : a)); + } + function $(a, b, c) { + var d; + if (void 0 === c && 1 === a.nodeType) + if (((d = 'data-' + b.replace(Y, '-$&').toLowerCase()), (c = a.getAttribute(d)), 'string' == typeof c)) { + try { + c = Z(c); + } catch (e) {} + W.set(a, b, c); + } else c = void 0; + return c; + } + r.extend({ + hasData: function (a) { + return W.hasData(a) || V.hasData(a); + }, + data: function (a, b, c) { + return W.access(a, b, c); + }, + removeData: function (a, b) { + W.remove(a, b); + }, + _data: function (a, b, c) { + return V.access(a, b, c); + }, + _removeData: function (a, b) { + V.remove(a, b); + }, + }), + r.fn.extend({ + data: function (a, b) { + var c, + d, + e, + f = this[0], + g = f && f.attributes; + if (void 0 === a) { + if (this.length && ((e = W.get(f)), 1 === f.nodeType && !V.get(f, 'hasDataAttrs'))) { + c = g.length; + while (c--) g[c] && ((d = g[c].name), 0 === d.indexOf('data-') && ((d = r.camelCase(d.slice(5))), $(f, d, e[d]))); + V.set(f, 'hasDataAttrs', !0); + } + return e; + } + return 'object' == typeof a + ? this.each(function () { + W.set(this, a); + }) + : S( + this, + function (b) { + var c; + if (f && void 0 === b) { + if (((c = W.get(f, a)), void 0 !== c)) return c; + if (((c = $(f, a)), void 0 !== c)) return c; + } else + this.each(function () { + W.set(this, a, b); + }); + }, + null, + b, + arguments.length > 1, + null, + !0 + ); + }, + removeData: function (a) { + return this.each(function () { + W.remove(this, a); + }); + }, + }), + r.extend({ + queue: function (a, b, c) { + var d; + if (a) + return ( + (b = (b || 'fx') + 'queue'), + (d = V.get(a, b)), + c && (!d || r.isArray(c) ? (d = V.access(a, b, r.makeArray(c))) : d.push(c)), + d || [] + ); + }, + dequeue: function (a, b) { + b = b || 'fx'; + var c = r.queue(a, b), + d = c.length, + e = c.shift(), + f = r._queueHooks(a, b), + g = function () { + r.dequeue(a, b); + }; + 'inprogress' === e && ((e = c.shift()), d--), + e && ('fx' === b && c.unshift('inprogress'), delete f.stop, e.call(a, g, f)), + !d && f && f.empty.fire(); + }, + _queueHooks: function (a, b) { + var c = b + 'queueHooks'; + return ( + V.get(a, c) || + V.access(a, c, { + empty: r.Callbacks('once memory').add(function () { + V.remove(a, [b + 'queue', c]); + }), + }) + ); + }, + }), + r.fn.extend({ + queue: function (a, b) { + var c = 2; + return ( + 'string' != typeof a && ((b = a), (a = 'fx'), c--), + arguments.length < c + ? r.queue(this[0], a) + : void 0 === b + ? this + : this.each(function () { + var c = r.queue(this, a, b); + r._queueHooks(this, a), 'fx' === a && 'inprogress' !== c[0] && r.dequeue(this, a); + }) + ); + }, + dequeue: function (a) { + return this.each(function () { + r.dequeue(this, a); + }); + }, + clearQueue: function (a) { + return this.queue(a || 'fx', []); + }, + promise: function (a, b) { + var c, + d = 1, + e = r.Deferred(), + f = this, + g = this.length, + h = function () { + --d || e.resolveWith(f, [f]); + }; + 'string' != typeof a && ((b = a), (a = void 0)), (a = a || 'fx'); + while (g--) (c = V.get(f[g], a + 'queueHooks')), c && c.empty && (d++, c.empty.add(h)); + return h(), e.promise(b); + }, + }); + var _ = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, + aa = new RegExp('^(?:([+-])=|)(' + _ + ')([a-z%]*)$', 'i'), + ba = ['Top', 'Right', 'Bottom', 'Left'], + ca = function (a, b) { + return ( + (a = b || a), + 'none' === a.style.display || ('' === a.style.display && r.contains(a.ownerDocument, a) && 'none' === r.css(a, 'display')) + ); + }, + da = function (a, b, c, d) { + var e, + f, + g = {}; + for (f in b) (g[f] = a.style[f]), (a.style[f] = b[f]); + e = c.apply(a, d || []); + for (f in b) a.style[f] = g[f]; + return e; + }; + function ea(a, b, c, d) { + var e, + f = 1, + g = 20, + h = d + ? function () { + return d.cur(); + } + : function () { + return r.css(a, b, ''); + }, + i = h(), + j = (c && c[3]) || (r.cssNumber[b] ? '' : 'px'), + k = (r.cssNumber[b] || ('px' !== j && +i)) && aa.exec(r.css(a, b)); + if (k && k[3] !== j) { + (j = j || k[3]), (c = c || []), (k = +i || 1); + do (f = f || '.5'), (k /= f), r.style(a, b, k + j); + while (f !== (f = h() / i) && 1 !== f && --g); + } + return c && ((k = +k || +i || 0), (e = c[1] ? k + (c[1] + 1) * c[2] : +c[2]), d && ((d.unit = j), (d.start = k), (d.end = e))), e; + } + var fa = {}; + function ga(a) { + var b, + c = a.ownerDocument, + d = a.nodeName, + e = fa[d]; + return e + ? e + : ((b = c.body.appendChild(c.createElement(d))), + (e = r.css(b, 'display')), + b.parentNode.removeChild(b), + 'none' === e && (e = 'block'), + (fa[d] = e), + e); + } + function ha(a, b) { + for (var c, d, e = [], f = 0, g = a.length; f < g; f++) + (d = a[f]), + d.style && + ((c = d.style.display), + b + ? ('none' === c && ((e[f] = V.get(d, 'display') || null), e[f] || (d.style.display = '')), + '' === d.style.display && ca(d) && (e[f] = ga(d))) + : 'none' !== c && ((e[f] = 'none'), V.set(d, 'display', c))); + for (f = 0; f < g; f++) null != e[f] && (a[f].style.display = e[f]); + return a; + } + r.fn.extend({ + show: function () { + return ha(this, !0); + }, + hide: function () { + return ha(this); + }, + toggle: function (a) { + return 'boolean' == typeof a + ? a + ? this.show() + : this.hide() + : this.each(function () { + ca(this) ? r(this).show() : r(this).hide(); + }); + }, + }); + var ia = /^(?:checkbox|radio)$/i, + ja = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i, + ka = /^$|\/(?:java|ecma)script/i, + la = { + option: [1, "'], + thead: [1, '', '
    '], + col: [2, '', '
    '], + tr: [2, '', '
    '], + td: [3, '', '
    '], + _default: [0, '', ''], + }; + (la.optgroup = la.option), (la.tbody = la.tfoot = la.colgroup = la.caption = la.thead), (la.th = la.td); + function ma(a, b) { + var c; + return ( + (c = + 'undefined' != typeof a.getElementsByTagName + ? a.getElementsByTagName(b || '*') + : 'undefined' != typeof a.querySelectorAll + ? a.querySelectorAll(b || '*') + : []), + void 0 === b || (b && r.nodeName(a, b)) ? r.merge([a], c) : c + ); + } + function na(a, b) { + for (var c = 0, d = a.length; c < d; c++) V.set(a[c], 'globalEval', !b || V.get(b[c], 'globalEval')); + } + var oa = /<|&#?\w+;/; + function pa(a, b, c, d, e) { + for (var f, g, h, i, j, k, l = b.createDocumentFragment(), m = [], n = 0, o = a.length; n < o; n++) + if (((f = a[n]), f || 0 === f)) + if ('object' === r.type(f)) r.merge(m, f.nodeType ? [f] : f); + else if (oa.test(f)) { + (g = g || l.appendChild(b.createElement('div'))), + (h = (ja.exec(f) || ['', ''])[1].toLowerCase()), + (i = la[h] || la._default), + (g.innerHTML = i[1] + r.htmlPrefilter(f) + i[2]), + (k = i[0]); + while (k--) g = g.lastChild; + r.merge(m, g.childNodes), (g = l.firstChild), (g.textContent = ''); + } else m.push(b.createTextNode(f)); + (l.textContent = ''), (n = 0); + while ((f = m[n++])) + if (d && r.inArray(f, d) > -1) e && e.push(f); + else if (((j = r.contains(f.ownerDocument, f)), (g = ma(l.appendChild(f), 'script')), j && na(g), c)) { + k = 0; + while ((f = g[k++])) ka.test(f.type || '') && c.push(f); + } + return l; + } + !(function () { + var a = d.createDocumentFragment(), + b = a.appendChild(d.createElement('div')), + c = d.createElement('input'); + c.setAttribute('type', 'radio'), + c.setAttribute('checked', 'checked'), + c.setAttribute('name', 't'), + b.appendChild(c), + (o.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked), + (b.innerHTML = ''), + (o.noCloneChecked = !!b.cloneNode(!0).lastChild.defaultValue); + })(); + var qa = d.documentElement, + ra = /^key/, + sa = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + ta = /^([^.]*)(?:\.(.+)|)/; + function ua() { + return !0; + } + function va() { + return !1; + } + function wa() { + try { + return d.activeElement; + } catch (a) {} + } + function xa(a, b, c, d, e, f) { + var g, h; + if ('object' == typeof b) { + 'string' != typeof c && ((d = d || c), (c = void 0)); + for (h in b) xa(a, h, c, d, b[h], f); + return a; + } + if ( + (null == d && null == e + ? ((e = c), (d = c = void 0)) + : null == e && ('string' == typeof c ? ((e = d), (d = void 0)) : ((e = d), (d = c), (c = void 0))), + e === !1) + ) + e = va; + else if (!e) return a; + return ( + 1 === f && + ((g = e), + (e = function (a) { + return r().off(a), g.apply(this, arguments); + }), + (e.guid = g.guid || (g.guid = r.guid++))), + a.each(function () { + r.event.add(this, b, e, d, c); + }) + ); + } + (r.event = { + global: {}, + add: function (a, b, c, d, e) { + var f, + g, + h, + i, + j, + k, + l, + m, + n, + o, + p, + q = V.get(a); + if (q) { + c.handler && ((f = c), (c = f.handler), (e = f.selector)), + e && r.find.matchesSelector(qa, e), + c.guid || (c.guid = r.guid++), + (i = q.events) || (i = q.events = {}), + (g = q.handle) || + (g = q.handle = + function (b) { + return 'undefined' != typeof r && r.event.triggered !== b.type ? r.event.dispatch.apply(a, arguments) : void 0; + }), + (b = (b || '').match(K) || ['']), + (j = b.length); + while (j--) + (h = ta.exec(b[j]) || []), + (n = p = h[1]), + (o = (h[2] || '').split('.').sort()), + n && + ((l = r.event.special[n] || {}), + (n = (e ? l.delegateType : l.bindType) || n), + (l = r.event.special[n] || {}), + (k = r.extend( + { + type: n, + origType: p, + data: d, + handler: c, + guid: c.guid, + selector: e, + needsContext: e && r.expr.match.needsContext.test(e), + namespace: o.join('.'), + }, + f + )), + (m = i[n]) || + ((m = i[n] = []), + (m.delegateCount = 0), + (l.setup && l.setup.call(a, d, o, g) !== !1) || (a.addEventListener && a.addEventListener(n, g))), + l.add && (l.add.call(a, k), k.handler.guid || (k.handler.guid = c.guid)), + e ? m.splice(m.delegateCount++, 0, k) : m.push(k), + (r.event.global[n] = !0)); + } + }, + remove: function (a, b, c, d, e) { + var f, + g, + h, + i, + j, + k, + l, + m, + n, + o, + p, + q = V.hasData(a) && V.get(a); + if (q && (i = q.events)) { + (b = (b || '').match(K) || ['']), (j = b.length); + while (j--) + if (((h = ta.exec(b[j]) || []), (n = p = h[1]), (o = (h[2] || '').split('.').sort()), n)) { + (l = r.event.special[n] || {}), + (n = (d ? l.delegateType : l.bindType) || n), + (m = i[n] || []), + (h = h[2] && new RegExp('(^|\\.)' + o.join('\\.(?:.*\\.|)') + '(\\.|$)')), + (g = f = m.length); + while (f--) + (k = m[f]), + (!e && p !== k.origType) || + (c && c.guid !== k.guid) || + (h && !h.test(k.namespace)) || + (d && d !== k.selector && ('**' !== d || !k.selector)) || + (m.splice(f, 1), k.selector && m.delegateCount--, l.remove && l.remove.call(a, k)); + g && !m.length && ((l.teardown && l.teardown.call(a, o, q.handle) !== !1) || r.removeEvent(a, n, q.handle), delete i[n]); + } else for (n in i) r.event.remove(a, n + b[j], c, d, !0); + r.isEmptyObject(i) && V.remove(a, 'handle events'); + } + }, + dispatch: function (a) { + var b = r.event.fix(a), + c, + d, + e, + f, + g, + h, + i = new Array(arguments.length), + j = (V.get(this, 'events') || {})[b.type] || [], + k = r.event.special[b.type] || {}; + for (i[0] = b, c = 1; c < arguments.length; c++) i[c] = arguments[c]; + if (((b.delegateTarget = this), !k.preDispatch || k.preDispatch.call(this, b) !== !1)) { + (h = r.event.handlers.call(this, b, j)), (c = 0); + while ((f = h[c++]) && !b.isPropagationStopped()) { + (b.currentTarget = f.elem), (d = 0); + while ((g = f.handlers[d++]) && !b.isImmediatePropagationStopped()) + (b.rnamespace && !b.rnamespace.test(g.namespace)) || + ((b.handleObj = g), + (b.data = g.data), + (e = ((r.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i)), + void 0 !== e && (b.result = e) === !1 && (b.preventDefault(), b.stopPropagation())); + } + return k.postDispatch && k.postDispatch.call(this, b), b.result; + } + }, + handlers: function (a, b) { + var c, + d, + e, + f, + g, + h = [], + i = b.delegateCount, + j = a.target; + if (i && j.nodeType && !('click' === a.type && a.button >= 1)) + for (; j !== this; j = j.parentNode || this) + if (1 === j.nodeType && ('click' !== a.type || j.disabled !== !0)) { + for (f = [], g = {}, c = 0; c < i; c++) + (d = b[c]), + (e = d.selector + ' '), + void 0 === g[e] && (g[e] = d.needsContext ? r(e, this).index(j) > -1 : r.find(e, this, null, [j]).length), + g[e] && f.push(d); + f.length && h.push({ elem: j, handlers: f }); + } + return (j = this), i < b.length && h.push({ elem: j, handlers: b.slice(i) }), h; + }, + addProp: function (a, b) { + Object.defineProperty(r.Event.prototype, a, { + enumerable: !0, + configurable: !0, + get: r.isFunction(b) + ? function () { + if (this.originalEvent) return b(this.originalEvent); + } + : function () { + if (this.originalEvent) return this.originalEvent[a]; + }, + set: function (b) { + Object.defineProperty(this, a, { enumerable: !0, configurable: !0, writable: !0, value: b }); + }, + }); + }, + fix: function (a) { + return a[r.expando] ? a : new r.Event(a); + }, + special: { + load: { noBubble: !0 }, + focus: { + trigger: function () { + if (this !== wa() && this.focus) return this.focus(), !1; + }, + delegateType: 'focusin', + }, + blur: { + trigger: function () { + if (this === wa() && this.blur) return this.blur(), !1; + }, + delegateType: 'focusout', + }, + click: { + trigger: function () { + if ('checkbox' === this.type && this.click && r.nodeName(this, 'input')) return this.click(), !1; + }, + _default: function (a) { + return r.nodeName(a.target, 'a'); + }, + }, + beforeunload: { + postDispatch: function (a) { + void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result); + }, + }, + }, + }), + (r.removeEvent = function (a, b, c) { + a.removeEventListener && a.removeEventListener(b, c); + }), + (r.Event = function (a, b) { + return this instanceof r.Event + ? (a && a.type + ? ((this.originalEvent = a), + (this.type = a.type), + (this.isDefaultPrevented = a.defaultPrevented || (void 0 === a.defaultPrevented && a.returnValue === !1) ? ua : va), + (this.target = a.target && 3 === a.target.nodeType ? a.target.parentNode : a.target), + (this.currentTarget = a.currentTarget), + (this.relatedTarget = a.relatedTarget)) + : (this.type = a), + b && r.extend(this, b), + (this.timeStamp = (a && a.timeStamp) || r.now()), + void (this[r.expando] = !0)) + : new r.Event(a, b); + }), + (r.Event.prototype = { + constructor: r.Event, + isDefaultPrevented: va, + isPropagationStopped: va, + isImmediatePropagationStopped: va, + isSimulated: !1, + preventDefault: function () { + var a = this.originalEvent; + (this.isDefaultPrevented = ua), a && !this.isSimulated && a.preventDefault(); + }, + stopPropagation: function () { + var a = this.originalEvent; + (this.isPropagationStopped = ua), a && !this.isSimulated && a.stopPropagation(); + }, + stopImmediatePropagation: function () { + var a = this.originalEvent; + (this.isImmediatePropagationStopped = ua), a && !this.isSimulated && a.stopImmediatePropagation(), this.stopPropagation(); + }, + }), + r.each( + { + altKey: !0, + bubbles: !0, + cancelable: !0, + changedTouches: !0, + ctrlKey: !0, + detail: !0, + eventPhase: !0, + metaKey: !0, + pageX: !0, + pageY: !0, + shiftKey: !0, + view: !0, + char: !0, + charCode: !0, + key: !0, + keyCode: !0, + button: !0, + buttons: !0, + clientX: !0, + clientY: !0, + offsetX: !0, + offsetY: !0, + pointerId: !0, + pointerType: !0, + screenX: !0, + screenY: !0, + targetTouches: !0, + toElement: !0, + touches: !0, + which: function (a) { + var b = a.button; + return null == a.which && ra.test(a.type) + ? null != a.charCode + ? a.charCode + : a.keyCode + : !a.which && void 0 !== b && sa.test(a.type) + ? 1 & b + ? 1 + : 2 & b + ? 3 + : 4 & b + ? 2 + : 0 + : a.which; + }, + }, + r.event.addProp + ), + r.each({ mouseenter: 'mouseover', mouseleave: 'mouseout', pointerenter: 'pointerover', pointerleave: 'pointerout' }, function (a, b) { + r.event.special[a] = { + delegateType: b, + bindType: b, + handle: function (a) { + var c, + d = this, + e = a.relatedTarget, + f = a.handleObj; + return (e && (e === d || r.contains(d, e))) || ((a.type = f.origType), (c = f.handler.apply(this, arguments)), (a.type = b)), c; + }, + }; + }), + r.fn.extend({ + on: function (a, b, c, d) { + return xa(this, a, b, c, d); + }, + one: function (a, b, c, d) { + return xa(this, a, b, c, d, 1); + }, + off: function (a, b, c) { + var d, e; + if (a && a.preventDefault && a.handleObj) + return ( + (d = a.handleObj), + r(a.delegateTarget).off(d.namespace ? d.origType + '.' + d.namespace : d.origType, d.selector, d.handler), + this + ); + if ('object' == typeof a) { + for (e in a) this.off(e, b, a[e]); + return this; + } + return ( + (b !== !1 && 'function' != typeof b) || ((c = b), (b = void 0)), + c === !1 && (c = va), + this.each(function () { + r.event.remove(this, a, c, b); + }) + ); + }, + }); + var ya = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, + za = /\s*$/g; + function Da(a, b) { + return r.nodeName(a, 'table') && r.nodeName(11 !== b.nodeType ? b : b.firstChild, 'tr') ? a.getElementsByTagName('tbody')[0] || a : a; + } + function Ea(a) { + return (a.type = (null !== a.getAttribute('type')) + '/' + a.type), a; + } + function Fa(a) { + var b = Ba.exec(a.type); + return b ? (a.type = b[1]) : a.removeAttribute('type'), a; + } + function Ga(a, b) { + var c, d, e, f, g, h, i, j; + if (1 === b.nodeType) { + if (V.hasData(a) && ((f = V.access(a)), (g = V.set(b, f)), (j = f.events))) { + delete g.handle, (g.events = {}); + for (e in j) for (c = 0, d = j[e].length; c < d; c++) r.event.add(b, e, j[e][c]); + } + W.hasData(a) && ((h = W.access(a)), (i = r.extend({}, h)), W.set(b, i)); + } + } + function Ha(a, b) { + var c = b.nodeName.toLowerCase(); + 'input' === c && ia.test(a.type) ? (b.checked = a.checked) : ('input' !== c && 'textarea' !== c) || (b.defaultValue = a.defaultValue); + } + function Ia(a, b, c, d) { + b = g.apply([], b); + var e, + f, + h, + i, + j, + k, + l = 0, + m = a.length, + n = m - 1, + q = b[0], + s = r.isFunction(q); + if (s || (m > 1 && 'string' == typeof q && !o.checkClone && Aa.test(q))) + return a.each(function (e) { + var f = a.eq(e); + s && (b[0] = q.call(this, e, f.html())), Ia(f, b, c, d); + }); + if (m && ((e = pa(b, a[0].ownerDocument, !1, a, d)), (f = e.firstChild), 1 === e.childNodes.length && (e = f), f || d)) { + for (h = r.map(ma(e, 'script'), Ea), i = h.length; l < m; l++) + (j = e), l !== n && ((j = r.clone(j, !0, !0)), i && r.merge(h, ma(j, 'script'))), c.call(a[l], j, l); + if (i) + for (k = h[h.length - 1].ownerDocument, r.map(h, Fa), l = 0; l < i; l++) + (j = h[l]), + ka.test(j.type || '') && + !V.access(j, 'globalEval') && + r.contains(k, j) && + (j.src ? r._evalUrl && r._evalUrl(j.src) : p(j.textContent.replace(Ca, ''), k)); + } + return a; + } + function Ja(a, b, c) { + for (var d, e = b ? r.filter(b, a) : a, f = 0; null != (d = e[f]); f++) + c || 1 !== d.nodeType || r.cleanData(ma(d)), + d.parentNode && (c && r.contains(d.ownerDocument, d) && na(ma(d, 'script')), d.parentNode.removeChild(d)); + return a; + } + r.extend({ + htmlPrefilter: function (a) { + return a.replace(ya, '<$1>'); + }, + clone: function (a, b, c) { + var d, + e, + f, + g, + h = a.cloneNode(!0), + i = r.contains(a.ownerDocument, a); + if (!(o.noCloneChecked || (1 !== a.nodeType && 11 !== a.nodeType) || r.isXMLDoc(a))) + for (g = ma(h), f = ma(a), d = 0, e = f.length; d < e; d++) Ha(f[d], g[d]); + if (b) + if (c) for (f = f || ma(a), g = g || ma(h), d = 0, e = f.length; d < e; d++) Ga(f[d], g[d]); + else Ga(a, h); + return (g = ma(h, 'script')), g.length > 0 && na(g, !i && ma(a, 'script')), h; + }, + cleanData: function (a) { + for (var b, c, d, e = r.event.special, f = 0; void 0 !== (c = a[f]); f++) + if (T(c)) { + if ((b = c[V.expando])) { + if (b.events) for (d in b.events) e[d] ? r.event.remove(c, d) : r.removeEvent(c, d, b.handle); + c[V.expando] = void 0; + } + c[W.expando] && (c[W.expando] = void 0); + } + }, + }), + r.fn.extend({ + detach: function (a) { + return Ja(this, a, !0); + }, + remove: function (a) { + return Ja(this, a); + }, + text: function (a) { + return S( + this, + function (a) { + return void 0 === a + ? r.text(this) + : this.empty().each(function () { + (1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType) || (this.textContent = a); + }); + }, + null, + a, + arguments.length + ); + }, + append: function () { + return Ia(this, arguments, function (a) { + if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { + var b = Da(this, a); + b.appendChild(a); + } + }); + }, + prepend: function () { + return Ia(this, arguments, function (a) { + if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { + var b = Da(this, a); + b.insertBefore(a, b.firstChild); + } + }); + }, + before: function () { + return Ia(this, arguments, function (a) { + this.parentNode && this.parentNode.insertBefore(a, this); + }); + }, + after: function () { + return Ia(this, arguments, function (a) { + this.parentNode && this.parentNode.insertBefore(a, this.nextSibling); + }); + }, + empty: function () { + for (var a, b = 0; null != (a = this[b]); b++) 1 === a.nodeType && (r.cleanData(ma(a, !1)), (a.textContent = '')); + return this; + }, + clone: function (a, b) { + return ( + (a = null != a && a), + (b = null == b ? a : b), + this.map(function () { + return r.clone(this, a, b); + }) + ); + }, + html: function (a) { + return S( + this, + function (a) { + var b = this[0] || {}, + c = 0, + d = this.length; + if (void 0 === a && 1 === b.nodeType) return b.innerHTML; + if ('string' == typeof a && !za.test(a) && !la[(ja.exec(a) || ['', ''])[1].toLowerCase()]) { + a = r.htmlPrefilter(a); + try { + for (; c < d; c++) (b = this[c] || {}), 1 === b.nodeType && (r.cleanData(ma(b, !1)), (b.innerHTML = a)); + b = 0; + } catch (e) {} + } + b && this.empty().append(a); + }, + null, + a, + arguments.length + ); + }, + replaceWith: function () { + var a = []; + return Ia( + this, + arguments, + function (b) { + var c = this.parentNode; + r.inArray(this, a) < 0 && (r.cleanData(ma(this)), c && c.replaceChild(b, this)); + }, + a + ); + }, + }), + r.each( + { appendTo: 'append', prependTo: 'prepend', insertBefore: 'before', insertAfter: 'after', replaceAll: 'replaceWith' }, + function (a, b) { + r.fn[a] = function (a) { + for (var c, d = [], e = r(a), f = e.length - 1, g = 0; g <= f; g++) + (c = g === f ? this : this.clone(!0)), r(e[g])[b](c), h.apply(d, c.get()); + return this.pushStack(d); + }; + } + ); + var Ka = /^margin/, + La = new RegExp('^(' + _ + ')(?!px)[a-z%]+$', 'i'), + Ma = function (b) { + var c = b.ownerDocument.defaultView; + return (c && c.opener) || (c = a), c.getComputedStyle(b); + }; + !(function () { + function b() { + if (i) { + (i.style.cssText = 'box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%'), + (i.innerHTML = ''), + qa.appendChild(h); + var b = a.getComputedStyle(i); + (c = '1%' !== b.top), + (g = '2px' === b.marginLeft), + (e = '4px' === b.width), + (i.style.marginRight = '50%'), + (f = '4px' === b.marginRight), + qa.removeChild(h), + (i = null); + } + } + var c, + e, + f, + g, + h = d.createElement('div'), + i = d.createElement('div'); + i.style && + ((i.style.backgroundClip = 'content-box'), + (i.cloneNode(!0).style.backgroundClip = ''), + (o.clearCloneStyle = 'content-box' === i.style.backgroundClip), + (h.style.cssText = 'border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute'), + h.appendChild(i), + r.extend(o, { + pixelPosition: function () { + return b(), c; + }, + boxSizingReliable: function () { + return b(), e; + }, + pixelMarginRight: function () { + return b(), f; + }, + reliableMarginLeft: function () { + return b(), g; + }, + })); + })(); + function Na(a, b, c) { + var d, + e, + f, + g, + h = a.style; + return ( + (c = c || Ma(a)), + c && + ((g = c.getPropertyValue(b) || c[b]), + '' !== g || r.contains(a.ownerDocument, a) || (g = r.style(a, b)), + !o.pixelMarginRight() && + La.test(g) && + Ka.test(b) && + ((d = h.width), + (e = h.minWidth), + (f = h.maxWidth), + (h.minWidth = h.maxWidth = h.width = g), + (g = c.width), + (h.width = d), + (h.minWidth = e), + (h.maxWidth = f))), + void 0 !== g ? g + '' : g + ); + } + function Oa(a, b) { + return { + get: function () { + return a() ? void delete this.get : (this.get = b).apply(this, arguments); + }, + }; + } + var Pa = /^(none|table(?!-c[ea]).+)/, + Qa = { position: 'absolute', visibility: 'hidden', display: 'block' }, + Ra = { letterSpacing: '0', fontWeight: '400' }, + Sa = ['Webkit', 'Moz', 'ms'], + Ta = d.createElement('div').style; + function Ua(a) { + if (a in Ta) return a; + var b = a[0].toUpperCase() + a.slice(1), + c = Sa.length; + while (c--) if (((a = Sa[c] + b), a in Ta)) return a; + } + function Va(a, b, c) { + var d = aa.exec(b); + return d ? Math.max(0, d[2] - (c || 0)) + (d[3] || 'px') : b; + } + function Wa(a, b, c, d, e) { + var f, + g = 0; + for (f = c === (d ? 'border' : 'content') ? 4 : 'width' === b ? 1 : 0; f < 4; f += 2) + 'margin' === c && (g += r.css(a, c + ba[f], !0, e)), + d + ? ('content' === c && (g -= r.css(a, 'padding' + ba[f], !0, e)), + 'margin' !== c && (g -= r.css(a, 'border' + ba[f] + 'Width', !0, e))) + : ((g += r.css(a, 'padding' + ba[f], !0, e)), 'padding' !== c && (g += r.css(a, 'border' + ba[f] + 'Width', !0, e))); + return g; + } + function Xa(a, b, c) { + var d, + e = !0, + f = Ma(a), + g = 'border-box' === r.css(a, 'boxSizing', !1, f); + if ((a.getClientRects().length && (d = a.getBoundingClientRect()[b]), d <= 0 || null == d)) { + if (((d = Na(a, b, f)), (d < 0 || null == d) && (d = a.style[b]), La.test(d))) return d; + (e = g && (o.boxSizingReliable() || d === a.style[b])), (d = parseFloat(d) || 0); + } + return d + Wa(a, b, c || (g ? 'border' : 'content'), e, f) + 'px'; + } + r.extend({ + cssHooks: { + opacity: { + get: function (a, b) { + if (b) { + var c = Na(a, 'opacity'); + return '' === c ? '1' : c; + } + }, + }, + }, + cssNumber: { + animationIterationCount: !0, + columnCount: !0, + fillOpacity: !0, + flexGrow: !0, + flexShrink: !0, + fontWeight: !0, + lineHeight: !0, + opacity: !0, + order: !0, + orphans: !0, + widows: !0, + zIndex: !0, + zoom: !0, + }, + cssProps: { float: 'cssFloat' }, + style: function (a, b, c, d) { + if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) { + var e, + f, + g, + h = r.camelCase(b), + i = a.style; + return ( + (b = r.cssProps[h] || (r.cssProps[h] = Ua(h) || h)), + (g = r.cssHooks[b] || r.cssHooks[h]), + void 0 === c + ? g && 'get' in g && void 0 !== (e = g.get(a, !1, d)) + ? e + : i[b] + : ((f = typeof c), + 'string' === f && (e = aa.exec(c)) && e[1] && ((c = ea(a, b, e)), (f = 'number')), + null != c && + c === c && + ('number' === f && (c += (e && e[3]) || (r.cssNumber[h] ? '' : 'px')), + o.clearCloneStyle || '' !== c || 0 !== b.indexOf('background') || (i[b] = 'inherit'), + (g && 'set' in g && void 0 === (c = g.set(a, c, d))) || (i[b] = c)), + void 0) + ); + } + }, + css: function (a, b, c, d) { + var e, + f, + g, + h = r.camelCase(b); + return ( + (b = r.cssProps[h] || (r.cssProps[h] = Ua(h) || h)), + (g = r.cssHooks[b] || r.cssHooks[h]), + g && 'get' in g && (e = g.get(a, !0, c)), + void 0 === e && (e = Na(a, b, d)), + 'normal' === e && b in Ra && (e = Ra[b]), + '' === c || c ? ((f = parseFloat(e)), c === !0 || isFinite(f) ? f || 0 : e) : e + ); + }, + }), + r.each(['height', 'width'], function (a, b) { + r.cssHooks[b] = { + get: function (a, c, d) { + if (c) + return !Pa.test(r.css(a, 'display')) || (a.getClientRects().length && a.getBoundingClientRect().width) + ? Xa(a, b, d) + : da(a, Qa, function () { + return Xa(a, b, d); + }); + }, + set: function (a, c, d) { + var e, + f = d && Ma(a), + g = d && Wa(a, b, d, 'border-box' === r.css(a, 'boxSizing', !1, f), f); + return g && (e = aa.exec(c)) && 'px' !== (e[3] || 'px') && ((a.style[b] = c), (c = r.css(a, b))), Va(a, c, g); + }, + }; + }), + (r.cssHooks.marginLeft = Oa(o.reliableMarginLeft, function (a, b) { + if (b) + return ( + (parseFloat(Na(a, 'marginLeft')) || + a.getBoundingClientRect().left - + da(a, { marginLeft: 0 }, function () { + return a.getBoundingClientRect().left; + })) + 'px' + ); + })), + r.each({ margin: '', padding: '', border: 'Width' }, function (a, b) { + (r.cssHooks[a + b] = { + expand: function (c) { + for (var d = 0, e = {}, f = 'string' == typeof c ? c.split(' ') : [c]; d < 4; d++) e[a + ba[d] + b] = f[d] || f[d - 2] || f[0]; + return e; + }, + }), + Ka.test(a) || (r.cssHooks[a + b].set = Va); + }), + r.fn.extend({ + css: function (a, b) { + return S( + this, + function (a, b, c) { + var d, + e, + f = {}, + g = 0; + if (r.isArray(b)) { + for (d = Ma(a), e = b.length; g < e; g++) f[b[g]] = r.css(a, b[g], !1, d); + return f; + } + return void 0 !== c ? r.style(a, b, c) : r.css(a, b); + }, + a, + b, + arguments.length > 1 + ); + }, + }); + function Ya(a, b, c, d, e) { + return new Ya.prototype.init(a, b, c, d, e); + } + (r.Tween = Ya), + (Ya.prototype = { + constructor: Ya, + init: function (a, b, c, d, e, f) { + (this.elem = a), + (this.prop = c), + (this.easing = e || r.easing._default), + (this.options = b), + (this.start = this.now = this.cur()), + (this.end = d), + (this.unit = f || (r.cssNumber[c] ? '' : 'px')); + }, + cur: function () { + var a = Ya.propHooks[this.prop]; + return a && a.get ? a.get(this) : Ya.propHooks._default.get(this); + }, + run: function (a) { + var b, + c = Ya.propHooks[this.prop]; + return ( + this.options.duration + ? (this.pos = b = r.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration)) + : (this.pos = b = a), + (this.now = (this.end - this.start) * b + this.start), + this.options.step && this.options.step.call(this.elem, this.now, this), + c && c.set ? c.set(this) : Ya.propHooks._default.set(this), + this + ); + }, + }), + (Ya.prototype.init.prototype = Ya.prototype), + (Ya.propHooks = { + _default: { + get: function (a) { + var b; + return 1 !== a.elem.nodeType || (null != a.elem[a.prop] && null == a.elem.style[a.prop]) + ? a.elem[a.prop] + : ((b = r.css(a.elem, a.prop, '')), b && 'auto' !== b ? b : 0); + }, + set: function (a) { + r.fx.step[a.prop] + ? r.fx.step[a.prop](a) + : 1 !== a.elem.nodeType || (null == a.elem.style[r.cssProps[a.prop]] && !r.cssHooks[a.prop]) + ? (a.elem[a.prop] = a.now) + : r.style(a.elem, a.prop, a.now + a.unit); + }, + }, + }), + (Ya.propHooks.scrollTop = Ya.propHooks.scrollLeft = + { + set: function (a) { + a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now); + }, + }), + (r.easing = { + linear: function (a) { + return a; + }, + swing: function (a) { + return 0.5 - Math.cos(a * Math.PI) / 2; + }, + _default: 'swing', + }), + (r.fx = Ya.prototype.init), + (r.fx.step = {}); + var Za, + $a, + _a = /^(?:toggle|show|hide)$/, + ab = /queueHooks$/; + function bb() { + $a && (a.requestAnimationFrame(bb), r.fx.tick()); + } + function cb() { + return ( + a.setTimeout(function () { + Za = void 0; + }), + (Za = r.now()) + ); + } + function db(a, b) { + var c, + d = 0, + e = { height: a }; + for (b = b ? 1 : 0; d < 4; d += 2 - b) (c = ba[d]), (e['margin' + c] = e['padding' + c] = a); + return b && (e.opacity = e.width = a), e; + } + function eb(a, b, c) { + for (var d, e = (hb.tweeners[b] || []).concat(hb.tweeners['*']), f = 0, g = e.length; f < g; f++) + if ((d = e[f].call(c, b, a))) return d; + } + function fb(a, b, c) { + var d, + e, + f, + g, + h, + i, + j, + k, + l = 'width' in b || 'height' in b, + m = this, + n = {}, + o = a.style, + p = a.nodeType && ca(a), + q = V.get(a, 'fxshow'); + c.queue || + ((g = r._queueHooks(a, 'fx')), + null == g.unqueued && + ((g.unqueued = 0), + (h = g.empty.fire), + (g.empty.fire = function () { + g.unqueued || h(); + })), + g.unqueued++, + m.always(function () { + m.always(function () { + g.unqueued--, r.queue(a, 'fx').length || g.empty.fire(); + }); + })); + for (d in b) + if (((e = b[d]), _a.test(e))) { + if ((delete b[d], (f = f || 'toggle' === e), e === (p ? 'hide' : 'show'))) { + if ('show' !== e || !q || void 0 === q[d]) continue; + p = !0; + } + n[d] = (q && q[d]) || r.style(a, d); + } + if (((i = !r.isEmptyObject(b)), i || !r.isEmptyObject(n))) { + l && + 1 === a.nodeType && + ((c.overflow = [o.overflow, o.overflowX, o.overflowY]), + (j = q && q.display), + null == j && (j = V.get(a, 'display')), + (k = r.css(a, 'display')), + 'none' === k && (j ? (k = j) : (ha([a], !0), (j = a.style.display || j), (k = r.css(a, 'display')), ha([a]))), + ('inline' === k || ('inline-block' === k && null != j)) && + 'none' === r.css(a, 'float') && + (i || + (m.done(function () { + o.display = j; + }), + null == j && ((k = o.display), (j = 'none' === k ? '' : k))), + (o.display = 'inline-block'))), + c.overflow && + ((o.overflow = 'hidden'), + m.always(function () { + (o.overflow = c.overflow[0]), (o.overflowX = c.overflow[1]), (o.overflowY = c.overflow[2]); + })), + (i = !1); + for (d in n) + i || + (q ? 'hidden' in q && (p = q.hidden) : (q = V.access(a, 'fxshow', { display: j })), + f && (q.hidden = !p), + p && ha([a], !0), + m.done(function () { + p || ha([a]), V.remove(a, 'fxshow'); + for (d in n) r.style(a, d, n[d]); + })), + (i = eb(p ? q[d] : 0, d, m)), + d in q || ((q[d] = i.start), p && ((i.end = i.start), (i.start = 0))); + } + } + function gb(a, b) { + var c, d, e, f, g; + for (c in a) + if ( + ((d = r.camelCase(c)), + (e = b[d]), + (f = a[c]), + r.isArray(f) && ((e = f[1]), (f = a[c] = f[0])), + c !== d && ((a[d] = f), delete a[c]), + (g = r.cssHooks[d]), + g && 'expand' in g) + ) { + (f = g.expand(f)), delete a[d]; + for (c in f) c in a || ((a[c] = f[c]), (b[c] = e)); + } else b[d] = e; + } + function hb(a, b, c) { + var d, + e, + f = 0, + g = hb.prefilters.length, + h = r.Deferred().always(function () { + delete i.elem; + }), + i = function () { + if (e) return !1; + for ( + var b = Za || cb(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; + g < i; + g++ + ) + j.tweens[g].run(f); + return h.notifyWith(a, [j, f, c]), f < 1 && i ? c : (h.resolveWith(a, [j]), !1); + }, + j = h.promise({ + elem: a, + props: r.extend({}, b), + opts: r.extend(!0, { specialEasing: {}, easing: r.easing._default }, c), + originalProperties: b, + originalOptions: c, + startTime: Za || cb(), + duration: c.duration, + tweens: [], + createTween: function (b, c) { + var d = r.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing); + return j.tweens.push(d), d; + }, + stop: function (b) { + var c = 0, + d = b ? j.tweens.length : 0; + if (e) return this; + for (e = !0; c < d; c++) j.tweens[c].run(1); + return b ? (h.notifyWith(a, [j, 1, 0]), h.resolveWith(a, [j, b])) : h.rejectWith(a, [j, b]), this; + }, + }), + k = j.props; + for (gb(k, j.opts.specialEasing); f < g; f++) + if ((d = hb.prefilters[f].call(j, a, k, j.opts))) + return r.isFunction(d.stop) && (r._queueHooks(j.elem, j.opts.queue).stop = r.proxy(d.stop, d)), d; + return ( + r.map(k, eb, j), + r.isFunction(j.opts.start) && j.opts.start.call(a, j), + r.fx.timer(r.extend(i, { elem: a, anim: j, queue: j.opts.queue })), + j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always) + ); + } + (r.Animation = r.extend(hb, { + tweeners: { + '*': [ + function (a, b) { + var c = this.createTween(a, b); + return ea(c.elem, a, aa.exec(b), c), c; + }, + ], + }, + tweener: function (a, b) { + r.isFunction(a) ? ((b = a), (a = ['*'])) : (a = a.match(K)); + for (var c, d = 0, e = a.length; d < e; d++) (c = a[d]), (hb.tweeners[c] = hb.tweeners[c] || []), hb.tweeners[c].unshift(b); + }, + prefilters: [fb], + prefilter: function (a, b) { + b ? hb.prefilters.unshift(a) : hb.prefilters.push(a); + }, + })), + (r.speed = function (a, b, c) { + var e = + a && 'object' == typeof a + ? r.extend({}, a) + : { complete: c || (!c && b) || (r.isFunction(a) && a), duration: a, easing: (c && b) || (b && !r.isFunction(b) && b) }; + return ( + r.fx.off || d.hidden + ? (e.duration = 0) + : 'number' != typeof e.duration && + (e.duration in r.fx.speeds ? (e.duration = r.fx.speeds[e.duration]) : (e.duration = r.fx.speeds._default)), + (null != e.queue && e.queue !== !0) || (e.queue = 'fx'), + (e.old = e.complete), + (e.complete = function () { + r.isFunction(e.old) && e.old.call(this), e.queue && r.dequeue(this, e.queue); + }), + e + ); + }), + r.fn.extend({ + fadeTo: function (a, b, c, d) { + return this.filter(ca).css('opacity', 0).show().end().animate({ opacity: b }, a, c, d); + }, + animate: function (a, b, c, d) { + var e = r.isEmptyObject(a), + f = r.speed(b, c, d), + g = function () { + var b = hb(this, r.extend({}, a), f); + (e || V.get(this, 'finish')) && b.stop(!0); + }; + return (g.finish = g), e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g); + }, + stop: function (a, b, c) { + var d = function (a) { + var b = a.stop; + delete a.stop, b(c); + }; + return ( + 'string' != typeof a && ((c = b), (b = a), (a = void 0)), + b && a !== !1 && this.queue(a || 'fx', []), + this.each(function () { + var b = !0, + e = null != a && a + 'queueHooks', + f = r.timers, + g = V.get(this); + if (e) g[e] && g[e].stop && d(g[e]); + else for (e in g) g[e] && g[e].stop && ab.test(e) && d(g[e]); + for (e = f.length; e--; ) + f[e].elem !== this || (null != a && f[e].queue !== a) || (f[e].anim.stop(c), (b = !1), f.splice(e, 1)); + (!b && c) || r.dequeue(this, a); + }) + ); + }, + finish: function (a) { + return ( + a !== !1 && (a = a || 'fx'), + this.each(function () { + var b, + c = V.get(this), + d = c[a + 'queue'], + e = c[a + 'queueHooks'], + f = r.timers, + g = d ? d.length : 0; + for (c.finish = !0, r.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--; ) + f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1)); + for (b = 0; b < g; b++) d[b] && d[b].finish && d[b].finish.call(this); + delete c.finish; + }) + ); + }, + }), + r.each(['toggle', 'show', 'hide'], function (a, b) { + var c = r.fn[b]; + r.fn[b] = function (a, d, e) { + return null == a || 'boolean' == typeof a ? c.apply(this, arguments) : this.animate(db(b, !0), a, d, e); + }; + }), + r.each( + { + slideDown: db('show'), + slideUp: db('hide'), + slideToggle: db('toggle'), + fadeIn: { opacity: 'show' }, + fadeOut: { opacity: 'hide' }, + fadeToggle: { opacity: 'toggle' }, + }, + function (a, b) { + r.fn[a] = function (a, c, d) { + return this.animate(b, a, c, d); + }; + } + ), + (r.timers = []), + (r.fx.tick = function () { + var a, + b = 0, + c = r.timers; + for (Za = r.now(); b < c.length; b++) (a = c[b]), a() || c[b] !== a || c.splice(b--, 1); + c.length || r.fx.stop(), (Za = void 0); + }), + (r.fx.timer = function (a) { + r.timers.push(a), a() ? r.fx.start() : r.timers.pop(); + }), + (r.fx.interval = 13), + (r.fx.start = function () { + $a || ($a = a.requestAnimationFrame ? a.requestAnimationFrame(bb) : a.setInterval(r.fx.tick, r.fx.interval)); + }), + (r.fx.stop = function () { + a.cancelAnimationFrame ? a.cancelAnimationFrame($a) : a.clearInterval($a), ($a = null); + }), + (r.fx.speeds = { slow: 600, fast: 200, _default: 400 }), + (r.fn.delay = function (b, c) { + return ( + (b = r.fx ? r.fx.speeds[b] || b : b), + (c = c || 'fx'), + this.queue(c, function (c, d) { + var e = a.setTimeout(c, b); + d.stop = function () { + a.clearTimeout(e); + }; + }) + ); + }), + (function () { + var a = d.createElement('input'), + b = d.createElement('select'), + c = b.appendChild(d.createElement('option')); + (a.type = 'checkbox'), + (o.checkOn = '' !== a.value), + (o.optSelected = c.selected), + (a = d.createElement('input')), + (a.value = 't'), + (a.type = 'radio'), + (o.radioValue = 't' === a.value); + })(); + var ib, + jb = r.expr.attrHandle; + r.fn.extend({ + attr: function (a, b) { + return S(this, r.attr, a, b, arguments.length > 1); + }, + removeAttr: function (a) { + return this.each(function () { + r.removeAttr(this, a); + }); + }, + }), + r.extend({ + attr: function (a, b, c) { + var d, + e, + f = a.nodeType; + if (3 !== f && 8 !== f && 2 !== f) + return 'undefined' == typeof a.getAttribute + ? r.prop(a, b, c) + : ((1 === f && r.isXMLDoc(a)) || (e = r.attrHooks[b.toLowerCase()] || (r.expr.match.bool.test(b) ? ib : void 0)), + void 0 !== c + ? null === c + ? void r.removeAttr(a, b) + : e && 'set' in e && void 0 !== (d = e.set(a, c, b)) + ? d + : (a.setAttribute(b, c + ''), c) + : e && 'get' in e && null !== (d = e.get(a, b)) + ? d + : ((d = r.find.attr(a, b)), null == d ? void 0 : d)); + }, + attrHooks: { + type: { + set: function (a, b) { + if (!o.radioValue && 'radio' === b && r.nodeName(a, 'input')) { + var c = a.value; + return a.setAttribute('type', b), c && (a.value = c), b; + } + }, + }, + }, + removeAttr: function (a, b) { + var c, + d = 0, + e = b && b.match(K); + if (e && 1 === a.nodeType) while ((c = e[d++])) a.removeAttribute(c); + }, + }), + (ib = { + set: function (a, b, c) { + return b === !1 ? r.removeAttr(a, c) : a.setAttribute(c, c), c; + }, + }), + r.each(r.expr.match.bool.source.match(/\w+/g), function (a, b) { + var c = jb[b] || r.find.attr; + jb[b] = function (a, b, d) { + var e, + f, + g = b.toLowerCase(); + return d || ((f = jb[g]), (jb[g] = e), (e = null != c(a, b, d) ? g : null), (jb[g] = f)), e; + }; + }); + var kb = /^(?:input|select|textarea|button)$/i, + lb = /^(?:a|area)$/i; + r.fn.extend({ + prop: function (a, b) { + return S(this, r.prop, a, b, arguments.length > 1); + }, + removeProp: function (a) { + return this.each(function () { + delete this[r.propFix[a] || a]; + }); + }, + }), + r.extend({ + prop: function (a, b, c) { + var d, + e, + f = a.nodeType; + if (3 !== f && 8 !== f && 2 !== f) + return ( + (1 === f && r.isXMLDoc(a)) || ((b = r.propFix[b] || b), (e = r.propHooks[b])), + void 0 !== c + ? e && 'set' in e && void 0 !== (d = e.set(a, c, b)) + ? d + : (a[b] = c) + : e && 'get' in e && null !== (d = e.get(a, b)) + ? d + : a[b] + ); + }, + propHooks: { + tabIndex: { + get: function (a) { + var b = r.find.attr(a, 'tabindex'); + return b ? parseInt(b, 10) : kb.test(a.nodeName) || (lb.test(a.nodeName) && a.href) ? 0 : -1; + }, + }, + }, + propFix: { for: 'htmlFor', class: 'className' }, + }), + o.optSelected || + (r.propHooks.selected = { + get: function (a) { + var b = a.parentNode; + return b && b.parentNode && b.parentNode.selectedIndex, null; + }, + set: function (a) { + var b = a.parentNode; + b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex); + }, + }), + r.each( + ['tabIndex', 'readOnly', 'maxLength', 'cellSpacing', 'cellPadding', 'rowSpan', 'colSpan', 'useMap', 'frameBorder', 'contentEditable'], + function () { + r.propFix[this.toLowerCase()] = this; + } + ); + function mb(a) { + var b = a.match(K) || []; + return b.join(' '); + } + function nb(a) { + return (a.getAttribute && a.getAttribute('class')) || ''; + } + r.fn.extend({ + addClass: function (a) { + var b, + c, + d, + e, + f, + g, + h, + i = 0; + if (r.isFunction(a)) + return this.each(function (b) { + r(this).addClass(a.call(this, b, nb(this))); + }); + if ('string' == typeof a && a) { + b = a.match(K) || []; + while ((c = this[i++])) + if (((e = nb(c)), (d = 1 === c.nodeType && ' ' + mb(e) + ' '))) { + g = 0; + while ((f = b[g++])) d.indexOf(' ' + f + ' ') < 0 && (d += f + ' '); + (h = mb(d)), e !== h && c.setAttribute('class', h); + } + } + return this; + }, + removeClass: function (a) { + var b, + c, + d, + e, + f, + g, + h, + i = 0; + if (r.isFunction(a)) + return this.each(function (b) { + r(this).removeClass(a.call(this, b, nb(this))); + }); + if (!arguments.length) return this.attr('class', ''); + if ('string' == typeof a && a) { + b = a.match(K) || []; + while ((c = this[i++])) + if (((e = nb(c)), (d = 1 === c.nodeType && ' ' + mb(e) + ' '))) { + g = 0; + while ((f = b[g++])) while (d.indexOf(' ' + f + ' ') > -1) d = d.replace(' ' + f + ' ', ' '); + (h = mb(d)), e !== h && c.setAttribute('class', h); + } + } + return this; + }, + toggleClass: function (a, b) { + var c = typeof a; + return 'boolean' == typeof b && 'string' === c + ? b + ? this.addClass(a) + : this.removeClass(a) + : r.isFunction(a) + ? this.each(function (c) { + r(this).toggleClass(a.call(this, c, nb(this), b), b); + }) + : this.each(function () { + var b, d, e, f; + if ('string' === c) { + (d = 0), (e = r(this)), (f = a.match(K) || []); + while ((b = f[d++])) e.hasClass(b) ? e.removeClass(b) : e.addClass(b); + } else (void 0 !== a && 'boolean' !== c) || ((b = nb(this)), b && V.set(this, '__className__', b), this.setAttribute && this.setAttribute('class', b || a === !1 ? '' : V.get(this, '__className__') || '')); + }); + }, + hasClass: function (a) { + var b, + c, + d = 0; + b = ' ' + a + ' '; + while ((c = this[d++])) if (1 === c.nodeType && (' ' + mb(nb(c)) + ' ').indexOf(b) > -1) return !0; + return !1; + }, + }); + var ob = /\r/g; + r.fn.extend({ + val: function (a) { + var b, + c, + d, + e = this[0]; + { + if (arguments.length) + return ( + (d = r.isFunction(a)), + this.each(function (c) { + var e; + 1 === this.nodeType && + ((e = d ? a.call(this, c, r(this).val()) : a), + null == e + ? (e = '') + : 'number' == typeof e + ? (e += '') + : r.isArray(e) && + (e = r.map(e, function (a) { + return null == a ? '' : a + ''; + })), + (b = r.valHooks[this.type] || r.valHooks[this.nodeName.toLowerCase()]), + (b && 'set' in b && void 0 !== b.set(this, e, 'value')) || (this.value = e)); + }) + ); + if (e) + return ( + (b = r.valHooks[e.type] || r.valHooks[e.nodeName.toLowerCase()]), + b && 'get' in b && void 0 !== (c = b.get(e, 'value')) + ? c + : ((c = e.value), 'string' == typeof c ? c.replace(ob, '') : null == c ? '' : c) + ); + } + }, + }), + r.extend({ + valHooks: { + option: { + get: function (a) { + var b = r.find.attr(a, 'value'); + return null != b ? b : mb(r.text(a)); + }, + }, + select: { + get: function (a) { + var b, + c, + d, + e = a.options, + f = a.selectedIndex, + g = 'select-one' === a.type, + h = g ? null : [], + i = g ? f + 1 : e.length; + for (d = f < 0 ? i : g ? f : 0; d < i; d++) + if ( + ((c = e[d]), (c.selected || d === f) && !c.disabled && (!c.parentNode.disabled || !r.nodeName(c.parentNode, 'optgroup'))) + ) { + if (((b = r(c).val()), g)) return b; + h.push(b); + } + return h; + }, + set: function (a, b) { + var c, + d, + e = a.options, + f = r.makeArray(b), + g = e.length; + while (g--) (d = e[g]), (d.selected = r.inArray(r.valHooks.option.get(d), f) > -1) && (c = !0); + return c || (a.selectedIndex = -1), f; + }, + }, + }, + }), + r.each(['radio', 'checkbox'], function () { + (r.valHooks[this] = { + set: function (a, b) { + if (r.isArray(b)) return (a.checked = r.inArray(r(a).val(), b) > -1); + }, + }), + o.checkOn || + (r.valHooks[this].get = function (a) { + return null === a.getAttribute('value') ? 'on' : a.value; + }); + }); + var pb = /^(?:focusinfocus|focusoutblur)$/; + r.extend(r.event, { + trigger: function (b, c, e, f) { + var g, + h, + i, + j, + k, + m, + n, + o = [e || d], + p = l.call(b, 'type') ? b.type : b, + q = l.call(b, 'namespace') ? b.namespace.split('.') : []; + if ( + ((h = i = e = e || d), + 3 !== e.nodeType && + 8 !== e.nodeType && + !pb.test(p + r.event.triggered) && + (p.indexOf('.') > -1 && ((q = p.split('.')), (p = q.shift()), q.sort()), + (k = p.indexOf(':') < 0 && 'on' + p), + (b = b[r.expando] ? b : new r.Event(p, 'object' == typeof b && b)), + (b.isTrigger = f ? 2 : 3), + (b.namespace = q.join('.')), + (b.rnamespace = b.namespace ? new RegExp('(^|\\.)' + q.join('\\.(?:.*\\.|)') + '(\\.|$)') : null), + (b.result = void 0), + b.target || (b.target = e), + (c = null == c ? [b] : r.makeArray(c, [b])), + (n = r.event.special[p] || {}), + f || !n.trigger || n.trigger.apply(e, c) !== !1)) + ) { + if (!f && !n.noBubble && !r.isWindow(e)) { + for (j = n.delegateType || p, pb.test(j + p) || (h = h.parentNode); h; h = h.parentNode) o.push(h), (i = h); + i === (e.ownerDocument || d) && o.push(i.defaultView || i.parentWindow || a); + } + g = 0; + while ((h = o[g++]) && !b.isPropagationStopped()) + (b.type = g > 1 ? j : n.bindType || p), + (m = (V.get(h, 'events') || {})[b.type] && V.get(h, 'handle')), + m && m.apply(h, c), + (m = k && h[k]), + m && m.apply && T(h) && ((b.result = m.apply(h, c)), b.result === !1 && b.preventDefault()); + return ( + (b.type = p), + f || + b.isDefaultPrevented() || + (n._default && n._default.apply(o.pop(), c) !== !1) || + !T(e) || + (k && + r.isFunction(e[p]) && + !r.isWindow(e) && + ((i = e[k]), i && (e[k] = null), (r.event.triggered = p), e[p](), (r.event.triggered = void 0), i && (e[k] = i))), + b.result + ); + } + }, + simulate: function (a, b, c) { + var d = r.extend(new r.Event(), c, { type: a, isSimulated: !0 }); + r.event.trigger(d, null, b); + }, + }), + r.fn.extend({ + trigger: function (a, b) { + return this.each(function () { + r.event.trigger(a, b, this); + }); + }, + triggerHandler: function (a, b) { + var c = this[0]; + if (c) return r.event.trigger(a, b, c, !0); + }, + }), + r.each( + 'blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu'.split( + ' ' + ), + function (a, b) { + r.fn[b] = function (a, c) { + return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b); + }; + } + ), + r.fn.extend({ + hover: function (a, b) { + return this.mouseenter(a).mouseleave(b || a); + }, + }), + (o.focusin = 'onfocusin' in a), + o.focusin || + r.each({ focus: 'focusin', blur: 'focusout' }, function (a, b) { + var c = function (a) { + r.event.simulate(b, a.target, r.event.fix(a)); + }; + r.event.special[b] = { + setup: function () { + var d = this.ownerDocument || this, + e = V.access(d, b); + e || d.addEventListener(a, c, !0), V.access(d, b, (e || 0) + 1); + }, + teardown: function () { + var d = this.ownerDocument || this, + e = V.access(d, b) - 1; + e ? V.access(d, b, e) : (d.removeEventListener(a, c, !0), V.remove(d, b)); + }, + }; + }); + var qb = a.location, + rb = r.now(), + sb = /\?/; + r.parseXML = function (b) { + var c; + if (!b || 'string' != typeof b) return null; + try { + c = new a.DOMParser().parseFromString(b, 'text/xml'); + } catch (d) { + c = void 0; + } + return (c && !c.getElementsByTagName('parsererror').length) || r.error('Invalid XML: ' + b), c; + }; + var tb = /\[\]$/, + ub = /\r?\n/g, + vb = /^(?:submit|button|image|reset|file)$/i, + wb = /^(?:input|select|textarea|keygen)/i; + function xb(a, b, c, d) { + var e; + if (r.isArray(b)) + r.each(b, function (b, e) { + c || tb.test(a) ? d(a, e) : xb(a + '[' + ('object' == typeof e && null != e ? b : '') + ']', e, c, d); + }); + else if (c || 'object' !== r.type(b)) d(a, b); + else for (e in b) xb(a + '[' + e + ']', b[e], c, d); + } + (r.param = function (a, b) { + var c, + d = [], + e = function (a, b) { + var c = r.isFunction(b) ? b() : b; + d[d.length] = encodeURIComponent(a) + '=' + encodeURIComponent(null == c ? '' : c); + }; + if (r.isArray(a) || (a.jquery && !r.isPlainObject(a))) + r.each(a, function () { + e(this.name, this.value); + }); + else for (c in a) xb(c, a[c], b, e); + return d.join('&'); + }), + r.fn.extend({ + serialize: function () { + return r.param(this.serializeArray()); + }, + serializeArray: function () { + return this.map(function () { + var a = r.prop(this, 'elements'); + return a ? r.makeArray(a) : this; + }) + .filter(function () { + var a = this.type; + return this.name && !r(this).is(':disabled') && wb.test(this.nodeName) && !vb.test(a) && (this.checked || !ia.test(a)); + }) + .map(function (a, b) { + var c = r(this).val(); + return null == c + ? null + : r.isArray(c) + ? r.map(c, function (a) { + return { name: b.name, value: a.replace(ub, '\r\n') }; + }) + : { name: b.name, value: c.replace(ub, '\r\n') }; + }) + .get(); + }, + }); + var yb = /%20/g, + zb = /#.*$/, + Ab = /([?&])_=[^&]*/, + Bb = /^(.*?):[ \t]*([^\r\n]*)$/gm, + Cb = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + Db = /^(?:GET|HEAD)$/, + Eb = /^\/\//, + Fb = {}, + Gb = {}, + Hb = '*/'.concat('*'), + Ib = d.createElement('a'); + Ib.href = qb.href; + function Jb(a) { + return function (b, c) { + 'string' != typeof b && ((c = b), (b = '*')); + var d, + e = 0, + f = b.toLowerCase().match(K) || []; + if (r.isFunction(c)) + while ((d = f[e++])) '+' === d[0] ? ((d = d.slice(1) || '*'), (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c); + }; + } + function Kb(a, b, c, d) { + var e = {}, + f = a === Gb; + function g(h) { + var i; + return ( + (e[h] = !0), + r.each(a[h] || [], function (a, h) { + var j = h(b, c, d); + return 'string' != typeof j || f || e[j] ? (f ? !(i = j) : void 0) : (b.dataTypes.unshift(j), g(j), !1); + }), + i + ); + } + return g(b.dataTypes[0]) || (!e['*'] && g('*')); + } + function Lb(a, b) { + var c, + d, + e = r.ajaxSettings.flatOptions || {}; + for (c in b) void 0 !== b[c] && ((e[c] ? a : d || (d = {}))[c] = b[c]); + return d && r.extend(!0, a, d), a; + } + function Mb(a, b, c) { + var d, + e, + f, + g, + h = a.contents, + i = a.dataTypes; + while ('*' === i[0]) i.shift(), void 0 === d && (d = a.mimeType || b.getResponseHeader('Content-Type')); + if (d) + for (e in h) + if (h[e] && h[e].test(d)) { + i.unshift(e); + break; + } + if (i[0] in c) f = i[0]; + else { + for (e in c) { + if (!i[0] || a.converters[e + ' ' + i[0]]) { + f = e; + break; + } + g || (g = e); + } + f = f || g; + } + if (f) return f !== i[0] && i.unshift(f), c[f]; + } + function Nb(a, b, c, d) { + var e, + f, + g, + h, + i, + j = {}, + k = a.dataTypes.slice(); + if (k[1]) for (g in a.converters) j[g.toLowerCase()] = a.converters[g]; + f = k.shift(); + while (f) + if ( + (a.responseFields[f] && (c[a.responseFields[f]] = b), + !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), + (i = f), + (f = k.shift())) + ) + if ('*' === f) f = i; + else if ('*' !== i && i !== f) { + if (((g = j[i + ' ' + f] || j['* ' + f]), !g)) + for (e in j) + if (((h = e.split(' ')), h[1] === f && (g = j[i + ' ' + h[0]] || j['* ' + h[0]]))) { + g === !0 ? (g = j[e]) : j[e] !== !0 && ((f = h[0]), k.unshift(h[1])); + break; + } + if (g !== !0) + if (g && a['throws']) b = g(b); + else + try { + b = g(b); + } catch (l) { + return { state: 'parsererror', error: g ? l : 'No conversion from ' + i + ' to ' + f }; + } + } + return { state: 'success', data: b }; + } + r.extend({ + active: 0, + lastModified: {}, + etag: {}, + ajaxSettings: { + url: qb.href, + type: 'GET', + isLocal: Cb.test(qb.protocol), + global: !0, + processData: !0, + async: !0, + contentType: 'application/x-www-form-urlencoded; charset=UTF-8', + accepts: { + '*': Hb, + text: 'text/plain', + html: 'text/html', + xml: 'application/xml, text/xml', + json: 'application/json, text/javascript', + }, + contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, + responseFields: { xml: 'responseXML', text: 'responseText', json: 'responseJSON' }, + converters: { '* text': String, 'text html': !0, 'text json': JSON.parse, 'text xml': r.parseXML }, + flatOptions: { url: !0, context: !0 }, + }, + ajaxSetup: function (a, b) { + return b ? Lb(Lb(a, r.ajaxSettings), b) : Lb(r.ajaxSettings, a); + }, + ajaxPrefilter: Jb(Fb), + ajaxTransport: Jb(Gb), + ajax: function (b, c) { + 'object' == typeof b && ((c = b), (b = void 0)), (c = c || {}); + var e, + f, + g, + h, + i, + j, + k, + l, + m, + n, + o = r.ajaxSetup({}, c), + p = o.context || o, + q = o.context && (p.nodeType || p.jquery) ? r(p) : r.event, + s = r.Deferred(), + t = r.Callbacks('once memory'), + u = o.statusCode || {}, + v = {}, + w = {}, + x = 'canceled', + y = { + readyState: 0, + getResponseHeader: function (a) { + var b; + if (k) { + if (!h) { + h = {}; + while ((b = Bb.exec(g))) h[b[1].toLowerCase()] = b[2]; + } + b = h[a.toLowerCase()]; + } + return null == b ? null : b; + }, + getAllResponseHeaders: function () { + return k ? g : null; + }, + setRequestHeader: function (a, b) { + return null == k && ((a = w[a.toLowerCase()] = w[a.toLowerCase()] || a), (v[a] = b)), this; + }, + overrideMimeType: function (a) { + return null == k && (o.mimeType = a), this; + }, + statusCode: function (a) { + var b; + if (a) + if (k) y.always(a[y.status]); + else for (b in a) u[b] = [u[b], a[b]]; + return this; + }, + abort: function (a) { + var b = a || x; + return e && e.abort(b), A(0, b), this; + }, + }; + if ( + (s.promise(y), + (o.url = ((b || o.url || qb.href) + '').replace(Eb, qb.protocol + '//')), + (o.type = c.method || c.type || o.method || o.type), + (o.dataTypes = (o.dataType || '*').toLowerCase().match(K) || ['']), + null == o.crossDomain) + ) { + j = d.createElement('a'); + try { + (j.href = o.url), (j.href = j.href), (o.crossDomain = Ib.protocol + '//' + Ib.host != j.protocol + '//' + j.host); + } catch (z) { + o.crossDomain = !0; + } + } + if ((o.data && o.processData && 'string' != typeof o.data && (o.data = r.param(o.data, o.traditional)), Kb(Fb, o, c, y), k)) return y; + (l = r.event && o.global), + l && 0 === r.active++ && r.event.trigger('ajaxStart'), + (o.type = o.type.toUpperCase()), + (o.hasContent = !Db.test(o.type)), + (f = o.url.replace(zb, '')), + o.hasContent + ? o.data && + o.processData && + 0 === (o.contentType || '').indexOf('application/x-www-form-urlencoded') && + (o.data = o.data.replace(yb, '+')) + : ((n = o.url.slice(f.length)), + o.data && ((f += (sb.test(f) ? '&' : '?') + o.data), delete o.data), + o.cache === !1 && ((f = f.replace(Ab, '$1')), (n = (sb.test(f) ? '&' : '?') + '_=' + rb++ + n)), + (o.url = f + n)), + o.ifModified && + (r.lastModified[f] && y.setRequestHeader('If-Modified-Since', r.lastModified[f]), + r.etag[f] && y.setRequestHeader('If-None-Match', r.etag[f])), + ((o.data && o.hasContent && o.contentType !== !1) || c.contentType) && y.setRequestHeader('Content-Type', o.contentType), + y.setRequestHeader( + 'Accept', + o.dataTypes[0] && o.accepts[o.dataTypes[0]] + ? o.accepts[o.dataTypes[0]] + ('*' !== o.dataTypes[0] ? ', ' + Hb + '; q=0.01' : '') + : o.accepts['*'] + ); + for (m in o.headers) y.setRequestHeader(m, o.headers[m]); + if (o.beforeSend && (o.beforeSend.call(p, y, o) === !1 || k)) return y.abort(); + if (((x = 'abort'), t.add(o.complete), y.done(o.success), y.fail(o.error), (e = Kb(Gb, o, c, y)))) { + if (((y.readyState = 1), l && q.trigger('ajaxSend', [y, o]), k)) return y; + o.async && + o.timeout > 0 && + (i = a.setTimeout(function () { + y.abort('timeout'); + }, o.timeout)); + try { + (k = !1), e.send(v, A); + } catch (z) { + if (k) throw z; + A(-1, z); + } + } else A(-1, 'No Transport'); + function A(b, c, d, h) { + var j, + m, + n, + v, + w, + x = c; + k || + ((k = !0), + i && a.clearTimeout(i), + (e = void 0), + (g = h || ''), + (y.readyState = b > 0 ? 4 : 0), + (j = (b >= 200 && b < 300) || 304 === b), + d && (v = Mb(o, y, d)), + (v = Nb(o, v, y, j)), + j + ? (o.ifModified && + ((w = y.getResponseHeader('Last-Modified')), + w && (r.lastModified[f] = w), + (w = y.getResponseHeader('etag')), + w && (r.etag[f] = w)), + 204 === b || 'HEAD' === o.type + ? (x = 'nocontent') + : 304 === b + ? (x = 'notmodified') + : ((x = v.state), (m = v.data), (n = v.error), (j = !n))) + : ((n = x), (!b && x) || ((x = 'error'), b < 0 && (b = 0))), + (y.status = b), + (y.statusText = (c || x) + ''), + j ? s.resolveWith(p, [m, x, y]) : s.rejectWith(p, [y, x, n]), + y.statusCode(u), + (u = void 0), + l && q.trigger(j ? 'ajaxSuccess' : 'ajaxError', [y, o, j ? m : n]), + t.fireWith(p, [y, x]), + l && (q.trigger('ajaxComplete', [y, o]), --r.active || r.event.trigger('ajaxStop'))); + } + return y; + }, + getJSON: function (a, b, c) { + return r.get(a, b, c, 'json'); + }, + getScript: function (a, b) { + return r.get(a, void 0, b, 'script'); + }, + }), + r.each(['get', 'post'], function (a, b) { + r[b] = function (a, c, d, e) { + return ( + r.isFunction(c) && ((e = e || d), (d = c), (c = void 0)), + r.ajax(r.extend({ url: a, type: b, dataType: e, data: c, success: d }, r.isPlainObject(a) && a)) + ); + }; + }), + (r._evalUrl = function (a) { + return r.ajax({ url: a, type: 'GET', dataType: 'script', cache: !0, async: !1, global: !1, throws: !0 }); + }), + r.fn.extend({ + wrapAll: function (a) { + var b; + return ( + this[0] && + (r.isFunction(a) && (a = a.call(this[0])), + (b = r(a, this[0].ownerDocument).eq(0).clone(!0)), + this[0].parentNode && b.insertBefore(this[0]), + b + .map(function () { + var a = this; + while (a.firstElementChild) a = a.firstElementChild; + return a; + }) + .append(this)), + this + ); + }, + wrapInner: function (a) { + return r.isFunction(a) + ? this.each(function (b) { + r(this).wrapInner(a.call(this, b)); + }) + : this.each(function () { + var b = r(this), + c = b.contents(); + c.length ? c.wrapAll(a) : b.append(a); + }); + }, + wrap: function (a) { + var b = r.isFunction(a); + return this.each(function (c) { + r(this).wrapAll(b ? a.call(this, c) : a); + }); + }, + unwrap: function (a) { + return ( + this.parent(a) + .not('body') + .each(function () { + r(this).replaceWith(this.childNodes); + }), + this + ); + }, + }), + (r.expr.pseudos.hidden = function (a) { + return !r.expr.pseudos.visible(a); + }), + (r.expr.pseudos.visible = function (a) { + return !!(a.offsetWidth || a.offsetHeight || a.getClientRects().length); + }), + (r.ajaxSettings.xhr = function () { + try { + return new a.XMLHttpRequest(); + } catch (b) {} + }); + var Ob = { 0: 200, 1223: 204 }, + Pb = r.ajaxSettings.xhr(); + (o.cors = !!Pb && 'withCredentials' in Pb), + (o.ajax = Pb = !!Pb), + r.ajaxTransport(function (b) { + var c, d; + if (o.cors || (Pb && !b.crossDomain)) + return { + send: function (e, f) { + var g, + h = b.xhr(); + if ((h.open(b.type, b.url, b.async, b.username, b.password), b.xhrFields)) for (g in b.xhrFields) h[g] = b.xhrFields[g]; + b.mimeType && h.overrideMimeType && h.overrideMimeType(b.mimeType), + b.crossDomain || e['X-Requested-With'] || (e['X-Requested-With'] = 'XMLHttpRequest'); + for (g in e) h.setRequestHeader(g, e[g]); + (c = function (a) { + return function () { + c && + ((c = d = h.onload = h.onerror = h.onabort = h.onreadystatechange = null), + 'abort' === a + ? h.abort() + : 'error' === a + ? 'number' != typeof h.status + ? f(0, 'error') + : f(h.status, h.statusText) + : f( + Ob[h.status] || h.status, + h.statusText, + 'text' !== (h.responseType || 'text') || 'string' != typeof h.responseText + ? { binary: h.response } + : { text: h.responseText }, + h.getAllResponseHeaders() + )); + }; + }), + (h.onload = c()), + (d = h.onerror = c('error')), + void 0 !== h.onabort + ? (h.onabort = d) + : (h.onreadystatechange = function () { + 4 === h.readyState && + a.setTimeout(function () { + c && d(); + }); + }), + (c = c('abort')); + try { + h.send((b.hasContent && b.data) || null); + } catch (i) { + if (c) throw i; + } + }, + abort: function () { + c && c(); + }, + }; + }), + r.ajaxPrefilter(function (a) { + a.crossDomain && (a.contents.script = !1); + }), + r.ajaxSetup({ + accepts: { script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript' }, + contents: { script: /\b(?:java|ecma)script\b/ }, + converters: { + 'text script': function (a) { + return r.globalEval(a), a; + }, + }, + }), + r.ajaxPrefilter('script', function (a) { + void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = 'GET'); + }), + r.ajaxTransport('script', function (a) { + if (a.crossDomain) { + var b, c; + return { + send: function (e, f) { + (b = r('