0ecc897e6b2c08a923fba58cb1176dccb1cb4783.svn-base 96 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519
  1. /*!
  2. * Bootstrap v4.0.0-alpha (http://getbootstrap.com)
  3. * Copyright 2011-2015 Twitter, Inc.
  4. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5. */
  6. if (typeof jQuery === 'undefined') {
  7. throw new Error('Bootstrap\'s JavaScript requires jQuery')
  8. }
  9. +function ($) {
  10. var version = $.fn.jquery.split(' ')[0].split('.')
  11. if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
  12. throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
  13. }
  14. }(jQuery);
  15. +function ($) {
  16. /**
  17. * --------------------------------------------------------------------------
  18. * Bootstrap (v4.0.0): util.js
  19. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  20. * --------------------------------------------------------------------------
  21. */
  22. 'use strict';
  23. var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
  24. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  25. function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  26. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
  27. var Util = (function ($) {
  28. /**
  29. * ------------------------------------------------------------------------
  30. * Private TransitionEnd Helpers
  31. * ------------------------------------------------------------------------
  32. */
  33. var transition = false;
  34. var TransitionEndEvent = {
  35. WebkitTransition: 'webkitTransitionEnd',
  36. MozTransition: 'transitionend',
  37. OTransition: 'oTransitionEnd otransitionend',
  38. transition: 'transitionend'
  39. };
  40. // shoutout AngusCroll (https://goo.gl/pxwQGp)
  41. function toType(obj) {
  42. return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
  43. }
  44. function isElement(obj) {
  45. return (obj[0] || obj).nodeType;
  46. }
  47. function getSpecialTransitionEndEvent() {
  48. return {
  49. bindType: transition.end,
  50. delegateType: transition.end,
  51. handle: function handle(event) {
  52. if ($(event.target).is(this)) {
  53. return event.handleObj.handler.apply(this, arguments);
  54. }
  55. }
  56. };
  57. }
  58. function transitionEndTest() {
  59. if (window.QUnit) {
  60. return false;
  61. }
  62. var el = document.createElement('bootstrap');
  63. for (var _name in TransitionEndEvent) {
  64. if (el.style[_name] !== undefined) {
  65. return { end: TransitionEndEvent[_name] };
  66. }
  67. }
  68. return false;
  69. }
  70. function transitionEndEmulator(duration) {
  71. var _this = this;
  72. var called = false;
  73. $(this).one(Util.TRANSITION_END, function () {
  74. called = true;
  75. });
  76. setTimeout(function () {
  77. if (!called) {
  78. Util.triggerTransitionEnd(_this);
  79. }
  80. }, duration);
  81. return this;
  82. }
  83. function setTransitionEndSupport() {
  84. transition = transitionEndTest();
  85. $.fn.emulateTransitionEnd = transitionEndEmulator;
  86. if (Util.supportsTransitionEnd()) {
  87. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  88. }
  89. }
  90. /**
  91. * --------------------------------------------------------------------------
  92. * Public Util Api
  93. * --------------------------------------------------------------------------
  94. */
  95. var Util = {
  96. TRANSITION_END: 'bsTransitionEnd',
  97. getUID: function getUID(prefix) {
  98. do {
  99. prefix += ~ ~(Math.random() * 1000000);
  100. } while (document.getElementById(prefix));
  101. return prefix;
  102. },
  103. getSelectorFromElement: function getSelectorFromElement(element) {
  104. var selector = element.getAttribute('data-target');
  105. if (!selector) {
  106. selector = element.getAttribute('href') || '';
  107. selector = /^#[a-z]/i.test(selector) ? selector : null;
  108. }
  109. return selector;
  110. },
  111. reflow: function reflow(element) {
  112. new Function('bs', 'return bs')(element.offsetHeight);
  113. },
  114. triggerTransitionEnd: function triggerTransitionEnd(element) {
  115. $(element).trigger(transition.end);
  116. },
  117. supportsTransitionEnd: function supportsTransitionEnd() {
  118. return Boolean(transition);
  119. },
  120. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  121. for (var property in configTypes) {
  122. if (configTypes.hasOwnProperty(property)) {
  123. var expectedTypes = configTypes[property];
  124. var value = config[property];
  125. var valueType = undefined;
  126. if (value && isElement(value)) {
  127. valueType = 'element';
  128. } else {
  129. valueType = toType(value);
  130. }
  131. if (!new RegExp(expectedTypes).test(valueType)) {
  132. throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".'));
  133. }
  134. }
  135. }
  136. }
  137. };
  138. setTransitionEndSupport();
  139. return Util;
  140. })(jQuery);
  141. /**
  142. * --------------------------------------------------------------------------
  143. * Bootstrap (v4.0.0): alert.js
  144. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  145. * --------------------------------------------------------------------------
  146. */
  147. var Alert = (function ($) {
  148. /**
  149. * ------------------------------------------------------------------------
  150. * Constants
  151. * ------------------------------------------------------------------------
  152. */
  153. var NAME = 'alert';
  154. var VERSION = '4.0.0';
  155. var DATA_KEY = 'bs.alert';
  156. var EVENT_KEY = '.' + DATA_KEY;
  157. var DATA_API_KEY = '.data-api';
  158. var JQUERY_NO_CONFLICT = $.fn[NAME];
  159. var TRANSITION_DURATION = 150;
  160. var Selector = {
  161. DISMISS: '[data-dismiss="alert"]'
  162. };
  163. var Event = {
  164. CLOSE: 'close' + EVENT_KEY,
  165. CLOSED: 'closed' + EVENT_KEY,
  166. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
  167. };
  168. var ClassName = {
  169. ALERT: 'alert',
  170. FADE: 'fade',
  171. IN: 'in'
  172. };
  173. /**
  174. * ------------------------------------------------------------------------
  175. * Class Definition
  176. * ------------------------------------------------------------------------
  177. */
  178. var Alert = (function () {
  179. function Alert(element) {
  180. _classCallCheck(this, Alert);
  181. this._element = element;
  182. }
  183. /**
  184. * ------------------------------------------------------------------------
  185. * Data Api implementation
  186. * ------------------------------------------------------------------------
  187. */
  188. // getters
  189. _createClass(Alert, [{
  190. key: 'close',
  191. // public
  192. value: function close(element) {
  193. element = element || this._element;
  194. var rootElement = this._getRootElement(element);
  195. var customEvent = this._triggerCloseEvent(rootElement);
  196. if (customEvent.isDefaultPrevented()) {
  197. return;
  198. }
  199. this._removeElement(rootElement);
  200. }
  201. }, {
  202. key: 'dispose',
  203. value: function dispose() {
  204. $.removeData(this._element, DATA_KEY);
  205. this._element = null;
  206. }
  207. // private
  208. }, {
  209. key: '_getRootElement',
  210. value: function _getRootElement(element) {
  211. var selector = Util.getSelectorFromElement(element);
  212. var parent = false;
  213. if (selector) {
  214. parent = $(selector)[0];
  215. }
  216. if (!parent) {
  217. parent = $(element).closest('.' + ClassName.ALERT)[0];
  218. }
  219. return parent;
  220. }
  221. }, {
  222. key: '_triggerCloseEvent',
  223. value: function _triggerCloseEvent(element) {
  224. var closeEvent = $.Event(Event.CLOSE);
  225. $(element).trigger(closeEvent);
  226. return closeEvent;
  227. }
  228. }, {
  229. key: '_removeElement',
  230. value: function _removeElement(element) {
  231. $(element).removeClass(ClassName.IN);
  232. if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
  233. this._destroyElement(element);
  234. return;
  235. }
  236. $(element).one(Util.TRANSITION_END, $.proxy(this._destroyElement, this, element)).emulateTransitionEnd(TRANSITION_DURATION);
  237. }
  238. }, {
  239. key: '_destroyElement',
  240. value: function _destroyElement(element) {
  241. $(element).detach().trigger(Event.CLOSED).remove();
  242. }
  243. // static
  244. }], [{
  245. key: '_jQueryInterface',
  246. value: function _jQueryInterface(config) {
  247. return this.each(function () {
  248. var $element = $(this);
  249. var data = $element.data(DATA_KEY);
  250. if (!data) {
  251. data = new Alert(this);
  252. $element.data(DATA_KEY, data);
  253. }
  254. if (config === 'close') {
  255. data[config](this);
  256. }
  257. });
  258. }
  259. }, {
  260. key: '_handleDismiss',
  261. value: function _handleDismiss(alertInstance) {
  262. return function (event) {
  263. if (event) {
  264. event.preventDefault();
  265. }
  266. alertInstance.close(this);
  267. };
  268. }
  269. }, {
  270. key: 'VERSION',
  271. get: function get() {
  272. return VERSION;
  273. }
  274. }]);
  275. return Alert;
  276. })();
  277. $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  278. /**
  279. * ------------------------------------------------------------------------
  280. * jQuery
  281. * ------------------------------------------------------------------------
  282. */
  283. $.fn[NAME] = Alert._jQueryInterface;
  284. $.fn[NAME].Constructor = Alert;
  285. $.fn[NAME].noConflict = function () {
  286. $.fn[NAME] = JQUERY_NO_CONFLICT;
  287. return Alert._jQueryInterface;
  288. };
  289. return Alert;
  290. })(jQuery);
  291. /**
  292. * --------------------------------------------------------------------------
  293. * Bootstrap (v4.0.0): button.js
  294. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  295. * --------------------------------------------------------------------------
  296. */
  297. var Button = (function ($) {
  298. /**
  299. * ------------------------------------------------------------------------
  300. * Constants
  301. * ------------------------------------------------------------------------
  302. */
  303. var NAME = 'button';
  304. var VERSION = '4.0.0';
  305. var DATA_KEY = 'bs.button';
  306. var EVENT_KEY = '.' + DATA_KEY;
  307. var DATA_API_KEY = '.data-api';
  308. var JQUERY_NO_CONFLICT = $.fn[NAME];
  309. var ClassName = {
  310. ACTIVE: 'active',
  311. BUTTON: 'btn',
  312. FOCUS: 'focus'
  313. };
  314. var Selector = {
  315. DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  316. DATA_TOGGLE: '[data-toggle="buttons"]',
  317. INPUT: 'input',
  318. ACTIVE: '.active',
  319. BUTTON: '.btn'
  320. };
  321. var Event = {
  322. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
  323. FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY)
  324. };
  325. /**
  326. * ------------------------------------------------------------------------
  327. * Class Definition
  328. * ------------------------------------------------------------------------
  329. */
  330. var Button = (function () {
  331. function Button(element) {
  332. _classCallCheck(this, Button);
  333. this._element = element;
  334. }
  335. /**
  336. * ------------------------------------------------------------------------
  337. * Data Api implementation
  338. * ------------------------------------------------------------------------
  339. */
  340. // getters
  341. _createClass(Button, [{
  342. key: 'toggle',
  343. // public
  344. value: function toggle() {
  345. var triggerChangeEvent = true;
  346. var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
  347. if (rootElement) {
  348. var input = $(this._element).find(Selector.INPUT)[0];
  349. if (input) {
  350. if (input.type === 'radio') {
  351. if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {
  352. triggerChangeEvent = false;
  353. } else {
  354. var activeElement = $(rootElement).find(Selector.ACTIVE)[0];
  355. if (activeElement) {
  356. $(activeElement).removeClass(ClassName.ACTIVE);
  357. }
  358. }
  359. }
  360. if (triggerChangeEvent) {
  361. input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
  362. $(this._element).trigger('change');
  363. }
  364. }
  365. } else {
  366. this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
  367. }
  368. if (triggerChangeEvent) {
  369. $(this._element).toggleClass(ClassName.ACTIVE);
  370. }
  371. }
  372. }, {
  373. key: 'dispose',
  374. value: function dispose() {
  375. $.removeData(this._element, DATA_KEY);
  376. this._element = null;
  377. }
  378. // static
  379. }], [{
  380. key: '_jQueryInterface',
  381. value: function _jQueryInterface(config) {
  382. return this.each(function () {
  383. var data = $(this).data(DATA_KEY);
  384. if (!data) {
  385. data = new Button(this);
  386. $(this).data(DATA_KEY, data);
  387. }
  388. if (config === 'toggle') {
  389. data[config]();
  390. }
  391. });
  392. }
  393. }, {
  394. key: 'VERSION',
  395. get: function get() {
  396. return VERSION;
  397. }
  398. }]);
  399. return Button;
  400. })();
  401. $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
  402. event.preventDefault();
  403. var button = event.target;
  404. if (!$(button).hasClass(ClassName.BUTTON)) {
  405. button = $(button).closest(Selector.BUTTON);
  406. }
  407. Button._jQueryInterface.call($(button), 'toggle');
  408. }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
  409. var button = $(event.target).closest(Selector.BUTTON)[0];
  410. $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
  411. });
  412. /**
  413. * ------------------------------------------------------------------------
  414. * jQuery
  415. * ------------------------------------------------------------------------
  416. */
  417. $.fn[NAME] = Button._jQueryInterface;
  418. $.fn[NAME].Constructor = Button;
  419. $.fn[NAME].noConflict = function () {
  420. $.fn[NAME] = JQUERY_NO_CONFLICT;
  421. return Button._jQueryInterface;
  422. };
  423. return Button;
  424. })(jQuery);
  425. /**
  426. * --------------------------------------------------------------------------
  427. * Bootstrap (v4.0.0): carousel.js
  428. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  429. * --------------------------------------------------------------------------
  430. */
  431. var Carousel = (function ($) {
  432. /**
  433. * ------------------------------------------------------------------------
  434. * Constants
  435. * ------------------------------------------------------------------------
  436. */
  437. var NAME = 'carousel';
  438. var VERSION = '4.0.0';
  439. var DATA_KEY = 'bs.carousel';
  440. var EVENT_KEY = '.' + DATA_KEY;
  441. var DATA_API_KEY = '.data-api';
  442. var JQUERY_NO_CONFLICT = $.fn[NAME];
  443. var TRANSITION_DURATION = 600;
  444. var Default = {
  445. interval: 5000,
  446. keyboard: true,
  447. slide: false,
  448. pause: 'hover',
  449. wrap: true
  450. };
  451. var DefaultType = {
  452. interval: '(number|boolean)',
  453. keyboard: 'boolean',
  454. slide: '(boolean|string)',
  455. pause: '(string|boolean)',
  456. wrap: 'boolean'
  457. };
  458. var Direction = {
  459. NEXT: 'next',
  460. PREVIOUS: 'prev'
  461. };
  462. var Event = {
  463. SLIDE: 'slide' + EVENT_KEY,
  464. SLID: 'slid' + EVENT_KEY,
  465. KEYDOWN: 'keydown' + EVENT_KEY,
  466. MOUSEENTER: 'mouseenter' + EVENT_KEY,
  467. MOUSELEAVE: 'mouseleave' + EVENT_KEY,
  468. LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY,
  469. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
  470. };
  471. var ClassName = {
  472. CAROUSEL: 'carousel',
  473. ACTIVE: 'active',
  474. SLIDE: 'slide',
  475. RIGHT: 'right',
  476. LEFT: 'left',
  477. ITEM: 'carousel-item'
  478. };
  479. var Selector = {
  480. ACTIVE: '.active',
  481. ACTIVE_ITEM: '.active.carousel-item',
  482. ITEM: '.carousel-item',
  483. NEXT_PREV: '.next, .prev',
  484. INDICATORS: '.carousel-indicators',
  485. DATA_SLIDE: '[data-slide], [data-slide-to]',
  486. DATA_RIDE: '[data-ride="carousel"]'
  487. };
  488. /**
  489. * ------------------------------------------------------------------------
  490. * Class Definition
  491. * ------------------------------------------------------------------------
  492. */
  493. var Carousel = (function () {
  494. function Carousel(element, config) {
  495. _classCallCheck(this, Carousel);
  496. this._items = null;
  497. this._interval = null;
  498. this._activeElement = null;
  499. this._isPaused = false;
  500. this._isSliding = false;
  501. this._config = this._getConfig(config);
  502. this._element = $(element)[0];
  503. this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];
  504. this._addEventListeners();
  505. }
  506. /**
  507. * ------------------------------------------------------------------------
  508. * Data Api implementation
  509. * ------------------------------------------------------------------------
  510. */
  511. // getters
  512. _createClass(Carousel, [{
  513. key: 'next',
  514. // public
  515. value: function next() {
  516. if (!this._isSliding) {
  517. this._slide(Direction.NEXT);
  518. }
  519. }
  520. }, {
  521. key: 'prev',
  522. value: function prev() {
  523. if (!this._isSliding) {
  524. this._slide(Direction.PREVIOUS);
  525. }
  526. }
  527. }, {
  528. key: 'pause',
  529. value: function pause(event) {
  530. if (!event) {
  531. this._isPaused = true;
  532. }
  533. if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
  534. Util.triggerTransitionEnd(this._element);
  535. this.cycle(true);
  536. }
  537. clearInterval(this._interval);
  538. this._interval = null;
  539. }
  540. }, {
  541. key: 'cycle',
  542. value: function cycle(event) {
  543. if (!event) {
  544. this._isPaused = false;
  545. }
  546. if (this._interval) {
  547. clearInterval(this._interval);
  548. this._interval = null;
  549. }
  550. if (this._config.interval && !this._isPaused) {
  551. this._interval = setInterval($.proxy(this.next, this), this._config.interval);
  552. }
  553. }
  554. }, {
  555. key: 'to',
  556. value: function to(index) {
  557. var _this2 = this;
  558. this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
  559. var activeIndex = this._getItemIndex(this._activeElement);
  560. if (index > this._items.length - 1 || index < 0) {
  561. return;
  562. }
  563. if (this._isSliding) {
  564. $(this._element).one(Event.SLID, function () {
  565. return _this2.to(index);
  566. });
  567. return;
  568. }
  569. if (activeIndex === index) {
  570. this.pause();
  571. this.cycle();
  572. return;
  573. }
  574. var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS;
  575. this._slide(direction, this._items[index]);
  576. }
  577. }, {
  578. key: 'dispose',
  579. value: function dispose() {
  580. $(this._element).off(EVENT_KEY);
  581. $.removeData(this._element, DATA_KEY);
  582. this._items = null;
  583. this._config = null;
  584. this._element = null;
  585. this._interval = null;
  586. this._isPaused = null;
  587. this._isSliding = null;
  588. this._activeElement = null;
  589. this._indicatorsElement = null;
  590. }
  591. // private
  592. }, {
  593. key: '_getConfig',
  594. value: function _getConfig(config) {
  595. config = $.extend({}, Default, config);
  596. Util.typeCheckConfig(NAME, config, DefaultType);
  597. return config;
  598. }
  599. }, {
  600. key: '_addEventListeners',
  601. value: function _addEventListeners() {
  602. if (this._config.keyboard) {
  603. $(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this));
  604. }
  605. if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
  606. $(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this));
  607. }
  608. }
  609. }, {
  610. key: '_keydown',
  611. value: function _keydown(event) {
  612. event.preventDefault();
  613. if (/input|textarea/i.test(event.target.tagName)) {
  614. return;
  615. }
  616. switch (event.which) {
  617. case 37:
  618. this.prev();break;
  619. case 39:
  620. this.next();break;
  621. default:
  622. return;
  623. }
  624. }
  625. }, {
  626. key: '_getItemIndex',
  627. value: function _getItemIndex(element) {
  628. this._items = $.makeArray($(element).parent().find(Selector.ITEM));
  629. return this._items.indexOf(element);
  630. }
  631. }, {
  632. key: '_getItemByDirection',
  633. value: function _getItemByDirection(direction, activeElement) {
  634. var isNextDirection = direction === Direction.NEXT;
  635. var isPrevDirection = direction === Direction.PREVIOUS;
  636. var activeIndex = this._getItemIndex(activeElement);
  637. var lastItemIndex = this._items.length - 1;
  638. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  639. if (isGoingToWrap && !this._config.wrap) {
  640. return activeElement;
  641. }
  642. var delta = direction === Direction.PREVIOUS ? -1 : 1;
  643. var itemIndex = (activeIndex + delta) % this._items.length;
  644. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  645. }
  646. }, {
  647. key: '_triggerSlideEvent',
  648. value: function _triggerSlideEvent(relatedTarget, directionalClassname) {
  649. var slideEvent = $.Event(Event.SLIDE, {
  650. relatedTarget: relatedTarget,
  651. direction: directionalClassname
  652. });
  653. $(this._element).trigger(slideEvent);
  654. return slideEvent;
  655. }
  656. }, {
  657. key: '_setActiveIndicatorElement',
  658. value: function _setActiveIndicatorElement(element) {
  659. if (this._indicatorsElement) {
  660. $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
  661. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  662. if (nextIndicator) {
  663. $(nextIndicator).addClass(ClassName.ACTIVE);
  664. }
  665. }
  666. }
  667. }, {
  668. key: '_slide',
  669. value: function _slide(direction, element) {
  670. var _this3 = this;
  671. var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
  672. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  673. var isCycling = Boolean(this._interval);
  674. var directionalClassName = direction === Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT;
  675. if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
  676. this._isSliding = false;
  677. return;
  678. }
  679. var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName);
  680. if (slideEvent.isDefaultPrevented()) {
  681. return;
  682. }
  683. if (!activeElement || !nextElement) {
  684. // some weirdness is happening, so we bail
  685. return;
  686. }
  687. this._isSliding = true;
  688. if (isCycling) {
  689. this.pause();
  690. }
  691. this._setActiveIndicatorElement(nextElement);
  692. var slidEvent = $.Event(Event.SLID, {
  693. relatedTarget: nextElement,
  694. direction: directionalClassName
  695. });
  696. if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) {
  697. $(nextElement).addClass(direction);
  698. Util.reflow(nextElement);
  699. $(activeElement).addClass(directionalClassName);
  700. $(nextElement).addClass(directionalClassName);
  701. $(activeElement).one(Util.TRANSITION_END, function () {
  702. $(nextElement).removeClass(directionalClassName).removeClass(direction);
  703. $(nextElement).addClass(ClassName.ACTIVE);
  704. $(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName);
  705. _this3._isSliding = false;
  706. setTimeout(function () {
  707. return $(_this3._element).trigger(slidEvent);
  708. }, 0);
  709. }).emulateTransitionEnd(TRANSITION_DURATION);
  710. } else {
  711. $(activeElement).removeClass(ClassName.ACTIVE);
  712. $(nextElement).addClass(ClassName.ACTIVE);
  713. this._isSliding = false;
  714. $(this._element).trigger(slidEvent);
  715. }
  716. if (isCycling) {
  717. this.cycle();
  718. }
  719. }
  720. // static
  721. }], [{
  722. key: '_jQueryInterface',
  723. value: function _jQueryInterface(config) {
  724. return this.each(function () {
  725. var data = $(this).data(DATA_KEY);
  726. var _config = $.extend({}, Default, $(this).data());
  727. if (typeof config === 'object') {
  728. $.extend(_config, config);
  729. }
  730. var action = typeof config === 'string' ? config : _config.slide;
  731. if (!data) {
  732. data = new Carousel(this, _config);
  733. $(this).data(DATA_KEY, data);
  734. }
  735. if (typeof config === 'number') {
  736. data.to(config);
  737. } else if (action) {
  738. data[action]();
  739. } else if (_config.interval) {
  740. data.pause();
  741. data.cycle();
  742. }
  743. });
  744. }
  745. }, {
  746. key: '_dataApiClickHandler',
  747. value: function _dataApiClickHandler(event) {
  748. var selector = Util.getSelectorFromElement(this);
  749. if (!selector) {
  750. return;
  751. }
  752. var target = $(selector)[0];
  753. if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
  754. return;
  755. }
  756. var config = $.extend({}, $(target).data(), $(this).data());
  757. var slideIndex = this.getAttribute('data-slide-to');
  758. if (slideIndex) {
  759. config.interval = false;
  760. }
  761. Carousel._jQueryInterface.call($(target), config);
  762. if (slideIndex) {
  763. $(target).data(DATA_KEY).to(slideIndex);
  764. }
  765. event.preventDefault();
  766. }
  767. }, {
  768. key: 'VERSION',
  769. get: function get() {
  770. return VERSION;
  771. }
  772. }, {
  773. key: 'Default',
  774. get: function get() {
  775. return Default;
  776. }
  777. }]);
  778. return Carousel;
  779. })();
  780. $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
  781. $(window).on(Event.LOAD_DATA_API, function () {
  782. $(Selector.DATA_RIDE).each(function () {
  783. var $carousel = $(this);
  784. Carousel._jQueryInterface.call($carousel, $carousel.data());
  785. });
  786. });
  787. /**
  788. * ------------------------------------------------------------------------
  789. * jQuery
  790. * ------------------------------------------------------------------------
  791. */
  792. $.fn[NAME] = Carousel._jQueryInterface;
  793. $.fn[NAME].Constructor = Carousel;
  794. $.fn[NAME].noConflict = function () {
  795. $.fn[NAME] = JQUERY_NO_CONFLICT;
  796. return Carousel._jQueryInterface;
  797. };
  798. return Carousel;
  799. })(jQuery);
  800. /**
  801. * --------------------------------------------------------------------------
  802. * Bootstrap (v4.0.0): collapse.js
  803. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  804. * --------------------------------------------------------------------------
  805. */
  806. var Collapse = (function ($) {
  807. /**
  808. * ------------------------------------------------------------------------
  809. * Constants
  810. * ------------------------------------------------------------------------
  811. */
  812. var NAME = 'collapse';
  813. var VERSION = '4.0.0';
  814. var DATA_KEY = 'bs.collapse';
  815. var EVENT_KEY = '.' + DATA_KEY;
  816. var DATA_API_KEY = '.data-api';
  817. var JQUERY_NO_CONFLICT = $.fn[NAME];
  818. var TRANSITION_DURATION = 600;
  819. var Default = {
  820. toggle: true,
  821. parent: ''
  822. };
  823. var DefaultType = {
  824. toggle: 'boolean',
  825. parent: 'string'
  826. };
  827. var Event = {
  828. SHOW: 'show' + EVENT_KEY,
  829. SHOWN: 'shown' + EVENT_KEY,
  830. HIDE: 'hide' + EVENT_KEY,
  831. HIDDEN: 'hidden' + EVENT_KEY,
  832. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
  833. };
  834. var ClassName = {
  835. IN: 'in',
  836. COLLAPSE: 'collapse',
  837. COLLAPSING: 'collapsing',
  838. COLLAPSED: 'collapsed'
  839. };
  840. var Dimension = {
  841. WIDTH: 'width',
  842. HEIGHT: 'height'
  843. };
  844. var Selector = {
  845. ACTIVES: '.panel > .in, .panel > .collapsing',
  846. DATA_TOGGLE: '[data-toggle="collapse"]'
  847. };
  848. /**
  849. * ------------------------------------------------------------------------
  850. * Class Definition
  851. * ------------------------------------------------------------------------
  852. */
  853. var Collapse = (function () {
  854. function Collapse(element, config) {
  855. _classCallCheck(this, Collapse);
  856. this._isTransitioning = false;
  857. this._element = element;
  858. this._config = this._getConfig(config);
  859. this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]')));
  860. this._parent = this._config.parent ? this._getParent() : null;
  861. if (!this._config.parent) {
  862. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  863. }
  864. if (this._config.toggle) {
  865. this.toggle();
  866. }
  867. }
  868. /**
  869. * ------------------------------------------------------------------------
  870. * Data Api implementation
  871. * ------------------------------------------------------------------------
  872. */
  873. // getters
  874. _createClass(Collapse, [{
  875. key: 'toggle',
  876. // public
  877. value: function toggle() {
  878. if ($(this._element).hasClass(ClassName.IN)) {
  879. this.hide();
  880. } else {
  881. this.show();
  882. }
  883. }
  884. }, {
  885. key: 'show',
  886. value: function show() {
  887. var _this4 = this;
  888. if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) {
  889. return;
  890. }
  891. var actives = undefined;
  892. var activesData = undefined;
  893. if (this._parent) {
  894. actives = $.makeArray($(Selector.ACTIVES));
  895. if (!actives.length) {
  896. actives = null;
  897. }
  898. }
  899. if (actives) {
  900. activesData = $(actives).data(DATA_KEY);
  901. if (activesData && activesData._isTransitioning) {
  902. return;
  903. }
  904. }
  905. var startEvent = $.Event(Event.SHOW);
  906. $(this._element).trigger(startEvent);
  907. if (startEvent.isDefaultPrevented()) {
  908. return;
  909. }
  910. if (actives) {
  911. Collapse._jQueryInterface.call($(actives), 'hide');
  912. if (!activesData) {
  913. $(actives).data(DATA_KEY, null);
  914. }
  915. }
  916. var dimension = this._getDimension();
  917. $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
  918. this._element.style[dimension] = 0;
  919. this._element.setAttribute('aria-expanded', true);
  920. if (this._triggerArray.length) {
  921. $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
  922. }
  923. this.setTransitioning(true);
  924. var complete = function complete() {
  925. $(_this4._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN);
  926. _this4._element.style[dimension] = '';
  927. _this4.setTransitioning(false);
  928. $(_this4._element).trigger(Event.SHOWN);
  929. };
  930. if (!Util.supportsTransitionEnd()) {
  931. complete();
  932. return;
  933. }
  934. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  935. var scrollSize = 'scroll' + capitalizedDimension;
  936. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
  937. this._element.style[dimension] = this._element[scrollSize] + 'px';
  938. }
  939. }, {
  940. key: 'hide',
  941. value: function hide() {
  942. var _this5 = this;
  943. if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) {
  944. return;
  945. }
  946. var startEvent = $.Event(Event.HIDE);
  947. $(this._element).trigger(startEvent);
  948. if (startEvent.isDefaultPrevented()) {
  949. return;
  950. }
  951. var dimension = this._getDimension();
  952. var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight';
  953. this._element.style[dimension] = this._element[offsetDimension] + 'px';
  954. Util.reflow(this._element);
  955. $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN);
  956. this._element.setAttribute('aria-expanded', false);
  957. if (this._triggerArray.length) {
  958. $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
  959. }
  960. this.setTransitioning(true);
  961. var complete = function complete() {
  962. _this5.setTransitioning(false);
  963. $(_this5._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
  964. };
  965. this._element.style[dimension] = 0;
  966. if (!Util.supportsTransitionEnd()) {
  967. complete();
  968. return;
  969. }
  970. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
  971. }
  972. }, {
  973. key: 'setTransitioning',
  974. value: function setTransitioning(isTransitioning) {
  975. this._isTransitioning = isTransitioning;
  976. }
  977. }, {
  978. key: 'dispose',
  979. value: function dispose() {
  980. $.removeData(this._element, DATA_KEY);
  981. this._config = null;
  982. this._parent = null;
  983. this._element = null;
  984. this._triggerArray = null;
  985. this._isTransitioning = null;
  986. }
  987. // private
  988. }, {
  989. key: '_getConfig',
  990. value: function _getConfig(config) {
  991. config = $.extend({}, Default, config);
  992. config.toggle = Boolean(config.toggle); // coerce string values
  993. Util.typeCheckConfig(NAME, config, DefaultType);
  994. return config;
  995. }
  996. }, {
  997. key: '_getDimension',
  998. value: function _getDimension() {
  999. var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
  1000. return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
  1001. }
  1002. }, {
  1003. key: '_getParent',
  1004. value: function _getParent() {
  1005. var _this6 = this;
  1006. var parent = $(this._config.parent)[0];
  1007. var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]';
  1008. $(parent).find(selector).each(function (i, element) {
  1009. _this6._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  1010. });
  1011. return parent;
  1012. }
  1013. }, {
  1014. key: '_addAriaAndCollapsedClass',
  1015. value: function _addAriaAndCollapsedClass(element, triggerArray) {
  1016. if (element) {
  1017. var isOpen = $(element).hasClass(ClassName.IN);
  1018. element.setAttribute('aria-expanded', isOpen);
  1019. if (triggerArray.length) {
  1020. $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  1021. }
  1022. }
  1023. }
  1024. // static
  1025. }], [{
  1026. key: '_getTargetFromElement',
  1027. value: function _getTargetFromElement(element) {
  1028. var selector = Util.getSelectorFromElement(element);
  1029. return selector ? $(selector)[0] : null;
  1030. }
  1031. }, {
  1032. key: '_jQueryInterface',
  1033. value: function _jQueryInterface(config) {
  1034. return this.each(function () {
  1035. var $this = $(this);
  1036. var data = $this.data(DATA_KEY);
  1037. var _config = $.extend({}, Default, $this.data(), typeof config === 'object' && config);
  1038. if (!data && _config.toggle && /show|hide/.test(config)) {
  1039. _config.toggle = false;
  1040. }
  1041. if (!data) {
  1042. data = new Collapse(this, _config);
  1043. $this.data(DATA_KEY, data);
  1044. }
  1045. if (typeof config === 'string') {
  1046. data[config]();
  1047. }
  1048. });
  1049. }
  1050. }, {
  1051. key: 'VERSION',
  1052. get: function get() {
  1053. return VERSION;
  1054. }
  1055. }, {
  1056. key: 'Default',
  1057. get: function get() {
  1058. return Default;
  1059. }
  1060. }]);
  1061. return Collapse;
  1062. })();
  1063. $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
  1064. event.preventDefault();
  1065. var target = Collapse._getTargetFromElement(this);
  1066. var data = $(target).data(DATA_KEY);
  1067. var config = data ? 'toggle' : $(this).data();
  1068. Collapse._jQueryInterface.call($(target), config);
  1069. });
  1070. /**
  1071. * ------------------------------------------------------------------------
  1072. * jQuery
  1073. * ------------------------------------------------------------------------
  1074. */
  1075. $.fn[NAME] = Collapse._jQueryInterface;
  1076. $.fn[NAME].Constructor = Collapse;
  1077. $.fn[NAME].noConflict = function () {
  1078. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1079. return Collapse._jQueryInterface;
  1080. };
  1081. return Collapse;
  1082. })(jQuery);
  1083. /**
  1084. * --------------------------------------------------------------------------
  1085. * Bootstrap (v4.0.0): dropdown.js
  1086. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1087. * --------------------------------------------------------------------------
  1088. */
  1089. var Dropdown = (function ($) {
  1090. /**
  1091. * ------------------------------------------------------------------------
  1092. * Constants
  1093. * ------------------------------------------------------------------------
  1094. */
  1095. var NAME = 'dropdown';
  1096. var VERSION = '4.0.0';
  1097. var DATA_KEY = 'bs.dropdown';
  1098. var EVENT_KEY = '.' + DATA_KEY;
  1099. var DATA_API_KEY = '.data-api';
  1100. var JQUERY_NO_CONFLICT = $.fn[NAME];
  1101. var Event = {
  1102. HIDE: 'hide' + EVENT_KEY,
  1103. HIDDEN: 'hidden' + EVENT_KEY,
  1104. SHOW: 'show' + EVENT_KEY,
  1105. SHOWN: 'shown' + EVENT_KEY,
  1106. CLICK: 'click' + EVENT_KEY,
  1107. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
  1108. KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY
  1109. };
  1110. var ClassName = {
  1111. BACKDROP: 'dropdown-backdrop',
  1112. DISABLED: 'disabled',
  1113. OPEN: 'open'
  1114. };
  1115. var Selector = {
  1116. BACKDROP: '.dropdown-backdrop',
  1117. DATA_TOGGLE: '[data-toggle="dropdown"]',
  1118. FORM_CHILD: '.dropdown form',
  1119. ROLE_MENU: '[role="menu"]',
  1120. ROLE_LISTBOX: '[role="listbox"]',
  1121. NAVBAR_NAV: '.navbar-nav',
  1122. VISIBLE_ITEMS: '[role="menu"] li:not(.disabled) a, ' + '[role="listbox"] li:not(.disabled) a'
  1123. };
  1124. /**
  1125. * ------------------------------------------------------------------------
  1126. * Class Definition
  1127. * ------------------------------------------------------------------------
  1128. */
  1129. var Dropdown = (function () {
  1130. function Dropdown(element) {
  1131. _classCallCheck(this, Dropdown);
  1132. this._element = element;
  1133. this._addEventListeners();
  1134. }
  1135. /**
  1136. * ------------------------------------------------------------------------
  1137. * Data Api implementation
  1138. * ------------------------------------------------------------------------
  1139. */
  1140. // getters
  1141. _createClass(Dropdown, [{
  1142. key: 'toggle',
  1143. // public
  1144. value: function toggle() {
  1145. if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
  1146. return false;
  1147. }
  1148. var parent = Dropdown._getParentFromElement(this);
  1149. var isActive = $(parent).hasClass(ClassName.OPEN);
  1150. Dropdown._clearMenus();
  1151. if (isActive) {
  1152. return false;
  1153. }
  1154. if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
  1155. // if mobile we use a backdrop because click events don't delegate
  1156. var dropdown = document.createElement('div');
  1157. dropdown.className = ClassName.BACKDROP;
  1158. $(dropdown).insertBefore(this);
  1159. $(dropdown).on('click', Dropdown._clearMenus);
  1160. }
  1161. var relatedTarget = { relatedTarget: this };
  1162. var showEvent = $.Event(Event.SHOW, relatedTarget);
  1163. $(parent).trigger(showEvent);
  1164. if (showEvent.isDefaultPrevented()) {
  1165. return false;
  1166. }
  1167. this.focus();
  1168. this.setAttribute('aria-expanded', 'true');
  1169. $(parent).toggleClass(ClassName.OPEN);
  1170. $(parent).trigger($.Event(Event.SHOWN, relatedTarget));
  1171. return false;
  1172. }
  1173. }, {
  1174. key: 'dispose',
  1175. value: function dispose() {
  1176. $.removeData(this._element, DATA_KEY);
  1177. $(this._element).off(EVENT_KEY);
  1178. this._element = null;
  1179. }
  1180. // private
  1181. }, {
  1182. key: '_addEventListeners',
  1183. value: function _addEventListeners() {
  1184. $(this._element).on(Event.CLICK, this.toggle);
  1185. }
  1186. // static
  1187. }], [{
  1188. key: '_jQueryInterface',
  1189. value: function _jQueryInterface(config) {
  1190. return this.each(function () {
  1191. var data = $(this).data(DATA_KEY);
  1192. if (!data) {
  1193. $(this).data(DATA_KEY, data = new Dropdown(this));
  1194. }
  1195. if (typeof config === 'string') {
  1196. data[config].call(this);
  1197. }
  1198. });
  1199. }
  1200. }, {
  1201. key: '_clearMenus',
  1202. value: function _clearMenus(event) {
  1203. if (event && event.which === 3) {
  1204. return;
  1205. }
  1206. var backdrop = $(Selector.BACKDROP)[0];
  1207. if (backdrop) {
  1208. backdrop.parentNode.removeChild(backdrop);
  1209. }
  1210. var toggles = $.makeArray($(Selector.DATA_TOGGLE));
  1211. for (var i = 0; i < toggles.length; i++) {
  1212. var _parent = Dropdown._getParentFromElement(toggles[i]);
  1213. var relatedTarget = { relatedTarget: toggles[i] };
  1214. if (!$(_parent).hasClass(ClassName.OPEN)) {
  1215. continue;
  1216. }
  1217. if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(_parent, event.target)) {
  1218. continue;
  1219. }
  1220. var hideEvent = $.Event(Event.HIDE, relatedTarget);
  1221. $(_parent).trigger(hideEvent);
  1222. if (hideEvent.isDefaultPrevented()) {
  1223. continue;
  1224. }
  1225. toggles[i].setAttribute('aria-expanded', 'false');
  1226. $(_parent).removeClass(ClassName.OPEN).trigger($.Event(Event.HIDDEN, relatedTarget));
  1227. }
  1228. }
  1229. }, {
  1230. key: '_getParentFromElement',
  1231. value: function _getParentFromElement(element) {
  1232. var parent = undefined;
  1233. var selector = Util.getSelectorFromElement(element);
  1234. if (selector) {
  1235. parent = $(selector)[0];
  1236. }
  1237. return parent || element.parentNode;
  1238. }
  1239. }, {
  1240. key: '_dataApiKeydownHandler',
  1241. value: function _dataApiKeydownHandler(event) {
  1242. if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
  1243. return;
  1244. }
  1245. event.preventDefault();
  1246. event.stopPropagation();
  1247. if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
  1248. return;
  1249. }
  1250. var parent = Dropdown._getParentFromElement(this);
  1251. var isActive = $(parent).hasClass(ClassName.OPEN);
  1252. if (!isActive && event.which !== 27 || isActive && event.which === 27) {
  1253. if (event.which === 27) {
  1254. var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
  1255. $(toggle).trigger('focus');
  1256. }
  1257. $(this).trigger('click');
  1258. return;
  1259. }
  1260. var items = $.makeArray($(Selector.VISIBLE_ITEMS));
  1261. items = items.filter(function (item) {
  1262. return item.offsetWidth || item.offsetHeight;
  1263. });
  1264. if (!items.length) {
  1265. return;
  1266. }
  1267. var index = items.indexOf(event.target);
  1268. if (event.which === 38 && index > 0) {
  1269. // up
  1270. index--;
  1271. }
  1272. if (event.which === 40 && index < items.length - 1) {
  1273. // down
  1274. index++;
  1275. }
  1276. if (! ~index) {
  1277. index = 0;
  1278. }
  1279. items[index].focus();
  1280. }
  1281. }, {
  1282. key: 'VERSION',
  1283. get: function get() {
  1284. return VERSION;
  1285. }
  1286. }]);
  1287. return Dropdown;
  1288. })();
  1289. $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
  1290. e.stopPropagation();
  1291. });
  1292. /**
  1293. * ------------------------------------------------------------------------
  1294. * jQuery
  1295. * ------------------------------------------------------------------------
  1296. */
  1297. $.fn[NAME] = Dropdown._jQueryInterface;
  1298. $.fn[NAME].Constructor = Dropdown;
  1299. $.fn[NAME].noConflict = function () {
  1300. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1301. return Dropdown._jQueryInterface;
  1302. };
  1303. return Dropdown;
  1304. })(jQuery);
  1305. /**
  1306. * --------------------------------------------------------------------------
  1307. * Bootstrap (v4.0.0): modal.js
  1308. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1309. * --------------------------------------------------------------------------
  1310. */
  1311. var Modal = (function ($) {
  1312. /**
  1313. * ------------------------------------------------------------------------
  1314. * Constants
  1315. * ------------------------------------------------------------------------
  1316. */
  1317. var NAME = 'modal';
  1318. var VERSION = '4.0.0';
  1319. var DATA_KEY = 'bs.modal';
  1320. var EVENT_KEY = '.' + DATA_KEY;
  1321. var DATA_API_KEY = '.data-api';
  1322. var JQUERY_NO_CONFLICT = $.fn[NAME];
  1323. var TRANSITION_DURATION = 300;
  1324. var BACKDROP_TRANSITION_DURATION = 150;
  1325. var Default = {
  1326. backdrop: true,
  1327. keyboard: true,
  1328. focus: true,
  1329. show: true
  1330. };
  1331. var DefaultType = {
  1332. backdrop: '(boolean|string)',
  1333. keyboard: 'boolean',
  1334. focus: 'boolean',
  1335. show: 'boolean'
  1336. };
  1337. var Event = {
  1338. HIDE: 'hide' + EVENT_KEY,
  1339. HIDDEN: 'hidden' + EVENT_KEY,
  1340. SHOW: 'show' + EVENT_KEY,
  1341. SHOWN: 'shown' + EVENT_KEY,
  1342. FOCUSIN: 'focusin' + EVENT_KEY,
  1343. RESIZE: 'resize' + EVENT_KEY,
  1344. CLICK_DISMISS: 'click.dismiss' + EVENT_KEY,
  1345. KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY,
  1346. MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY,
  1347. MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY,
  1348. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
  1349. };
  1350. var ClassName = {
  1351. SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  1352. BACKDROP: 'modal-backdrop',
  1353. OPEN: 'modal-open',
  1354. FADE: 'fade',
  1355. IN: 'in'
  1356. };
  1357. var Selector = {
  1358. DIALOG: '.modal-dialog',
  1359. DATA_TOGGLE: '[data-toggle="modal"]',
  1360. DATA_DISMISS: '[data-dismiss="modal"]',
  1361. FIXED_CONTENT: '.navbar-fixed-top, .navbar-fixed-bottom, .is-fixed'
  1362. };
  1363. /**
  1364. * ------------------------------------------------------------------------
  1365. * Class Definition
  1366. * ------------------------------------------------------------------------
  1367. */
  1368. var Modal = (function () {
  1369. function Modal(element, config) {
  1370. _classCallCheck(this, Modal);
  1371. this._config = this._getConfig(config);
  1372. this._element = element;
  1373. this._dialog = $(element).find(Selector.DIALOG)[0];
  1374. this._backdrop = null;
  1375. this._isShown = false;
  1376. this._isBodyOverflowing = false;
  1377. this._ignoreBackdropClick = false;
  1378. this._originalBodyPadding = 0;
  1379. this._scrollbarWidth = 0;
  1380. }
  1381. /**
  1382. * ------------------------------------------------------------------------
  1383. * Data Api implementation
  1384. * ------------------------------------------------------------------------
  1385. */
  1386. // getters
  1387. _createClass(Modal, [{
  1388. key: 'toggle',
  1389. // public
  1390. value: function toggle(relatedTarget) {
  1391. return this._isShown ? this.hide() : this.show(relatedTarget);
  1392. }
  1393. }, {
  1394. key: 'show',
  1395. value: function show(relatedTarget) {
  1396. var _this7 = this;
  1397. var showEvent = $.Event(Event.SHOW, {
  1398. relatedTarget: relatedTarget
  1399. });
  1400. $(this._element).trigger(showEvent);
  1401. if (this._isShown || showEvent.isDefaultPrevented()) {
  1402. return;
  1403. }
  1404. this._isShown = true;
  1405. this._checkScrollbar();
  1406. this._setScrollbar();
  1407. $(document.body).addClass(ClassName.OPEN);
  1408. this._setEscapeEvent();
  1409. this._setResizeEvent();
  1410. $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this));
  1411. $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
  1412. $(_this7._element).one(Event.MOUSEUP_DISMISS, function (event) {
  1413. if ($(event.target).is(_this7._element)) {
  1414. that._ignoreBackdropClick = true;
  1415. }
  1416. });
  1417. });
  1418. this._showBackdrop($.proxy(this._showElement, this, relatedTarget));
  1419. }
  1420. }, {
  1421. key: 'hide',
  1422. value: function hide(event) {
  1423. if (event) {
  1424. event.preventDefault();
  1425. }
  1426. var hideEvent = $.Event(Event.HIDE);
  1427. $(this._element).trigger(hideEvent);
  1428. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  1429. return;
  1430. }
  1431. this._isShown = false;
  1432. this._setEscapeEvent();
  1433. this._setResizeEvent();
  1434. $(document).off(Event.FOCUSIN);
  1435. $(this._element).removeClass(ClassName.IN);
  1436. $(this._element).off(Event.CLICK_DISMISS);
  1437. $(this._dialog).off(Event.MOUSEDOWN_DISMISS);
  1438. if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
  1439. $(this._element).one(Util.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION);
  1440. } else {
  1441. this._hideModal();
  1442. }
  1443. }
  1444. }, {
  1445. key: 'dispose',
  1446. value: function dispose() {
  1447. $.removeData(this._element, DATA_KEY);
  1448. $(window).off(EVENT_KEY);
  1449. $(document).off(EVENT_KEY);
  1450. $(this._element).off(EVENT_KEY);
  1451. $(this._backdrop).off(EVENT_KEY);
  1452. this._config = null;
  1453. this._element = null;
  1454. this._dialog = null;
  1455. this._backdrop = null;
  1456. this._isShown = null;
  1457. this._isBodyOverflowing = null;
  1458. this._ignoreBackdropClick = null;
  1459. this._originalBodyPadding = null;
  1460. this._scrollbarWidth = null;
  1461. }
  1462. // private
  1463. }, {
  1464. key: '_getConfig',
  1465. value: function _getConfig(config) {
  1466. config = $.extend({}, Default, config);
  1467. Util.typeCheckConfig(NAME, config, DefaultType);
  1468. return config;
  1469. }
  1470. }, {
  1471. key: '_showElement',
  1472. value: function _showElement(relatedTarget) {
  1473. var _this8 = this;
  1474. var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
  1475. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  1476. // don't move modals dom position
  1477. document.body.appendChild(this._element);
  1478. }
  1479. this._element.style.display = 'block';
  1480. this._element.scrollTop = 0;
  1481. if (transition) {
  1482. Util.reflow(this._element);
  1483. }
  1484. $(this._element).addClass(ClassName.IN);
  1485. if (this._config.focus) {
  1486. this._enforceFocus();
  1487. }
  1488. var shownEvent = $.Event(Event.SHOWN, {
  1489. relatedTarget: relatedTarget
  1490. });
  1491. var transitionComplete = function transitionComplete() {
  1492. if (_this8._config.focus) {
  1493. _this8._element.focus();
  1494. }
  1495. $(_this8._element).trigger(shownEvent);
  1496. };
  1497. if (transition) {
  1498. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
  1499. } else {
  1500. transitionComplete();
  1501. }
  1502. }
  1503. }, {
  1504. key: '_enforceFocus',
  1505. value: function _enforceFocus() {
  1506. var _this9 = this;
  1507. $(document).off(Event.FOCUSIN) // guard against infinite focus loop
  1508. .on(Event.FOCUSIN, function (event) {
  1509. if (_this9._element !== event.target && !$(_this9._element).has(event.target).length) {
  1510. _this9._element.focus();
  1511. }
  1512. });
  1513. }
  1514. }, {
  1515. key: '_setEscapeEvent',
  1516. value: function _setEscapeEvent() {
  1517. var _this10 = this;
  1518. if (this._isShown && this._config.keyboard) {
  1519. $(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
  1520. if (event.which === 27) {
  1521. _this10.hide();
  1522. }
  1523. });
  1524. } else if (!this._isShown) {
  1525. $(this._element).off(Event.KEYDOWN_DISMISS);
  1526. }
  1527. }
  1528. }, {
  1529. key: '_setResizeEvent',
  1530. value: function _setResizeEvent() {
  1531. if (this._isShown) {
  1532. $(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this));
  1533. } else {
  1534. $(window).off(Event.RESIZE);
  1535. }
  1536. }
  1537. }, {
  1538. key: '_hideModal',
  1539. value: function _hideModal() {
  1540. var _this11 = this;
  1541. this._element.style.display = 'none';
  1542. this._showBackdrop(function () {
  1543. $(document.body).removeClass(ClassName.OPEN);
  1544. _this11._resetAdjustments();
  1545. _this11._resetScrollbar();
  1546. $(_this11._element).trigger(Event.HIDDEN);
  1547. });
  1548. }
  1549. }, {
  1550. key: '_removeBackdrop',
  1551. value: function _removeBackdrop() {
  1552. if (this._backdrop) {
  1553. $(this._backdrop).remove();
  1554. this._backdrop = null;
  1555. }
  1556. }
  1557. }, {
  1558. key: '_showBackdrop',
  1559. value: function _showBackdrop(callback) {
  1560. var _this12 = this;
  1561. var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
  1562. if (this._isShown && this._config.backdrop) {
  1563. var doAnimate = Util.supportsTransitionEnd() && animate;
  1564. this._backdrop = document.createElement('div');
  1565. this._backdrop.className = ClassName.BACKDROP;
  1566. if (animate) {
  1567. $(this._backdrop).addClass(animate);
  1568. }
  1569. $(this._backdrop).appendTo(document.body);
  1570. $(this._element).on(Event.CLICK_DISMISS, function (event) {
  1571. if (_this12._ignoreBackdropClick) {
  1572. _this12._ignoreBackdropClick = false;
  1573. return;
  1574. }
  1575. if (event.target !== event.currentTarget) {
  1576. return;
  1577. }
  1578. if (_this12._config.backdrop === 'static') {
  1579. _this12._element.focus();
  1580. } else {
  1581. _this12.hide();
  1582. }
  1583. });
  1584. if (doAnimate) {
  1585. Util.reflow(this._backdrop);
  1586. }
  1587. $(this._backdrop).addClass(ClassName.IN);
  1588. if (!callback) {
  1589. return;
  1590. }
  1591. if (!doAnimate) {
  1592. callback();
  1593. return;
  1594. }
  1595. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
  1596. } else if (!this._isShown && this._backdrop) {
  1597. $(this._backdrop).removeClass(ClassName.IN);
  1598. var callbackRemove = function callbackRemove() {
  1599. _this12._removeBackdrop();
  1600. if (callback) {
  1601. callback();
  1602. }
  1603. };
  1604. if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
  1605. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
  1606. } else {
  1607. callbackRemove();
  1608. }
  1609. } else if (callback) {
  1610. callback();
  1611. }
  1612. }
  1613. // ----------------------------------------------------------------------
  1614. // the following methods are used to handle overflowing modals
  1615. // todo (fat): these should probably be refactored out of modal.js
  1616. // ----------------------------------------------------------------------
  1617. }, {
  1618. key: '_handleUpdate',
  1619. value: function _handleUpdate() {
  1620. this._adjustDialog();
  1621. }
  1622. }, {
  1623. key: '_adjustDialog',
  1624. value: function _adjustDialog() {
  1625. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  1626. if (!this._isBodyOverflowing && isModalOverflowing) {
  1627. this._element.style.paddingLeft = this._scrollbarWidth + 'px';
  1628. }
  1629. if (this._isBodyOverflowing && !isModalOverflowing) {
  1630. this._element.style.paddingRight = this._scrollbarWidth + 'px~';
  1631. }
  1632. }
  1633. }, {
  1634. key: '_resetAdjustments',
  1635. value: function _resetAdjustments() {
  1636. this._element.style.paddingLeft = '';
  1637. this._element.style.paddingRight = '';
  1638. }
  1639. }, {
  1640. key: '_checkScrollbar',
  1641. value: function _checkScrollbar() {
  1642. var fullWindowWidth = window.innerWidth;
  1643. if (!fullWindowWidth) {
  1644. // workaround for missing window.innerWidth in IE8
  1645. var documentElementRect = document.documentElement.getBoundingClientRect();
  1646. fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left);
  1647. }
  1648. this._isBodyOverflowing = document.body.clientWidth < fullWindowWidth;
  1649. this._scrollbarWidth = this._getScrollbarWidth();
  1650. }
  1651. }, {
  1652. key: '_setScrollbar',
  1653. value: function _setScrollbar() {
  1654. var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10);
  1655. this._originalBodyPadding = document.body.style.paddingRight || '';
  1656. if (this._isBodyOverflowing) {
  1657. document.body.style.paddingRight = bodyPadding + (this._scrollbarWidth + 'px');
  1658. }
  1659. }
  1660. }, {
  1661. key: '_resetScrollbar',
  1662. value: function _resetScrollbar() {
  1663. document.body.style.paddingRight = this._originalBodyPadding;
  1664. }
  1665. }, {
  1666. key: '_getScrollbarWidth',
  1667. value: function _getScrollbarWidth() {
  1668. // thx d.walsh
  1669. var scrollDiv = document.createElement('div');
  1670. scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
  1671. document.body.appendChild(scrollDiv);
  1672. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  1673. document.body.removeChild(scrollDiv);
  1674. return scrollbarWidth;
  1675. }
  1676. // static
  1677. }], [{
  1678. key: '_jQueryInterface',
  1679. value: function _jQueryInterface(config, relatedTarget) {
  1680. return this.each(function () {
  1681. var data = $(this).data(DATA_KEY);
  1682. var _config = $.extend({}, Modal.Default, $(this).data(), typeof config === 'object' && config);
  1683. if (!data) {
  1684. data = new Modal(this, _config);
  1685. $(this).data(DATA_KEY, data);
  1686. }
  1687. if (typeof config === 'string') {
  1688. data[config](relatedTarget);
  1689. } else if (_config.show) {
  1690. data.show(relatedTarget);
  1691. }
  1692. });
  1693. }
  1694. }, {
  1695. key: 'VERSION',
  1696. get: function get() {
  1697. return VERSION;
  1698. }
  1699. }, {
  1700. key: 'Default',
  1701. get: function get() {
  1702. return Default;
  1703. }
  1704. }]);
  1705. return Modal;
  1706. })();
  1707. $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
  1708. var _this13 = this;
  1709. var target = undefined;
  1710. var selector = Util.getSelectorFromElement(this);
  1711. if (selector) {
  1712. target = $(selector)[0];
  1713. }
  1714. var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data());
  1715. if (this.tagName === 'A') {
  1716. event.preventDefault();
  1717. }
  1718. var $target = $(target).one(Event.SHOW, function (showEvent) {
  1719. if (showEvent.isDefaultPrevented()) {
  1720. // only register focus restorer if modal will actually get shown
  1721. return;
  1722. }
  1723. $target.one(Event.HIDDEN, function () {
  1724. if ($(_this13).is(':visible')) {
  1725. _this13.focus();
  1726. }
  1727. });
  1728. });
  1729. Modal._jQueryInterface.call($(target), config, this);
  1730. });
  1731. /**
  1732. * ------------------------------------------------------------------------
  1733. * jQuery
  1734. * ------------------------------------------------------------------------
  1735. */
  1736. $.fn[NAME] = Modal._jQueryInterface;
  1737. $.fn[NAME].Constructor = Modal;
  1738. $.fn[NAME].noConflict = function () {
  1739. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1740. return Modal._jQueryInterface;
  1741. };
  1742. return Modal;
  1743. })(jQuery);
  1744. /**
  1745. * --------------------------------------------------------------------------
  1746. * Bootstrap (v4.0.0): scrollspy.js
  1747. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1748. * --------------------------------------------------------------------------
  1749. */
  1750. var ScrollSpy = (function ($) {
  1751. /**
  1752. * ------------------------------------------------------------------------
  1753. * Constants
  1754. * ------------------------------------------------------------------------
  1755. */
  1756. var NAME = 'scrollspy';
  1757. var VERSION = '4.0.0';
  1758. var DATA_KEY = 'bs.scrollspy';
  1759. var EVENT_KEY = '.' + DATA_KEY;
  1760. var DATA_API_KEY = '.data-api';
  1761. var JQUERY_NO_CONFLICT = $.fn[NAME];
  1762. var Default = {
  1763. offset: 10,
  1764. method: 'auto',
  1765. target: ''
  1766. };
  1767. var DefaultType = {
  1768. offset: 'number',
  1769. method: 'string',
  1770. target: '(string|element)'
  1771. };
  1772. var Event = {
  1773. ACTIVATE: 'activate' + EVENT_KEY,
  1774. SCROLL: 'scroll' + EVENT_KEY,
  1775. LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY
  1776. };
  1777. var ClassName = {
  1778. DROPDOWN_ITEM: 'dropdown-item',
  1779. DROPDOWN_MENU: 'dropdown-menu',
  1780. NAV_LINK: 'nav-link',
  1781. NAV: 'nav',
  1782. ACTIVE: 'active'
  1783. };
  1784. var Selector = {
  1785. DATA_SPY: '[data-spy="scroll"]',
  1786. ACTIVE: '.active',
  1787. LIST_ITEM: '.list-item',
  1788. LI: 'li',
  1789. LI_DROPDOWN: 'li.dropdown',
  1790. NAV_LINKS: '.nav-link',
  1791. DROPDOWN: '.dropdown',
  1792. DROPDOWN_ITEMS: '.dropdown-item',
  1793. DROPDOWN_TOGGLE: '.dropdown-toggle'
  1794. };
  1795. var OffsetMethod = {
  1796. OFFSET: 'offset',
  1797. POSITION: 'position'
  1798. };
  1799. /**
  1800. * ------------------------------------------------------------------------
  1801. * Class Definition
  1802. * ------------------------------------------------------------------------
  1803. */
  1804. var ScrollSpy = (function () {
  1805. function ScrollSpy(element, config) {
  1806. _classCallCheck(this, ScrollSpy);
  1807. this._element = element;
  1808. this._scrollElement = element.tagName === 'BODY' ? window : element;
  1809. this._config = this._getConfig(config);
  1810. this._selector = this._config.target + ' ' + Selector.NAV_LINKS + ',' + (this._config.target + ' ' + Selector.DROPDOWN_ITEMS);
  1811. this._offsets = [];
  1812. this._targets = [];
  1813. this._activeTarget = null;
  1814. this._scrollHeight = 0;
  1815. $(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this));
  1816. this.refresh();
  1817. this._process();
  1818. }
  1819. /**
  1820. * ------------------------------------------------------------------------
  1821. * Data Api implementation
  1822. * ------------------------------------------------------------------------
  1823. */
  1824. // getters
  1825. _createClass(ScrollSpy, [{
  1826. key: 'refresh',
  1827. // public
  1828. value: function refresh() {
  1829. var _this14 = this;
  1830. var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
  1831. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  1832. var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
  1833. this._offsets = [];
  1834. this._targets = [];
  1835. this._scrollHeight = this._getScrollHeight();
  1836. var targets = $.makeArray($(this._selector));
  1837. targets.map(function (element) {
  1838. var target = undefined;
  1839. var targetSelector = Util.getSelectorFromElement(element);
  1840. if (targetSelector) {
  1841. target = $(targetSelector)[0];
  1842. }
  1843. if (target && (target.offsetWidth || target.offsetHeight)) {
  1844. // todo (fat): remove sketch reliance on jQuery position/offset
  1845. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  1846. }
  1847. }).filter(function (item) {
  1848. return item;
  1849. }).sort(function (a, b) {
  1850. return a[0] - b[0];
  1851. }).forEach(function (item) {
  1852. _this14._offsets.push(item[0]);
  1853. _this14._targets.push(item[1]);
  1854. });
  1855. }
  1856. }, {
  1857. key: 'dispose',
  1858. value: function dispose() {
  1859. $.removeData(this._element, DATA_KEY);
  1860. $(this._scrollElement).off(EVENT_KEY);
  1861. this._element = null;
  1862. this._scrollElement = null;
  1863. this._config = null;
  1864. this._selector = null;
  1865. this._offsets = null;
  1866. this._targets = null;
  1867. this._activeTarget = null;
  1868. this._scrollHeight = null;
  1869. }
  1870. // private
  1871. }, {
  1872. key: '_getConfig',
  1873. value: function _getConfig(config) {
  1874. config = $.extend({}, Default, config);
  1875. if (typeof config.target !== 'string') {
  1876. var id = $(config.target).attr('id');
  1877. if (!id) {
  1878. id = Util.getUID(NAME);
  1879. $(config.target).attr('id', id);
  1880. }
  1881. config.target = '#' + id;
  1882. }
  1883. Util.typeCheckConfig(NAME, config, DefaultType);
  1884. return config;
  1885. }
  1886. }, {
  1887. key: '_getScrollTop',
  1888. value: function _getScrollTop() {
  1889. return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop;
  1890. }
  1891. }, {
  1892. key: '_getScrollHeight',
  1893. value: function _getScrollHeight() {
  1894. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  1895. }
  1896. }, {
  1897. key: '_process',
  1898. value: function _process() {
  1899. var scrollTop = this._getScrollTop() + this._config.offset;
  1900. var scrollHeight = this._getScrollHeight();
  1901. var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
  1902. if (this._scrollHeight !== scrollHeight) {
  1903. this.refresh();
  1904. }
  1905. if (scrollTop >= maxScroll) {
  1906. var target = this._targets[this._targets.length - 1];
  1907. if (this._activeTarget !== target) {
  1908. this._activate(target);
  1909. }
  1910. }
  1911. if (this._activeTarget && scrollTop < this._offsets[0]) {
  1912. this._activeTarget = null;
  1913. this._clear();
  1914. return;
  1915. }
  1916. for (var i = this._offsets.length; i--;) {
  1917. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]);
  1918. if (isActiveTarget) {
  1919. this._activate(this._targets[i]);
  1920. }
  1921. }
  1922. }
  1923. }, {
  1924. key: '_activate',
  1925. value: function _activate(target) {
  1926. this._activeTarget = target;
  1927. this._clear();
  1928. var queries = this._selector.split(',');
  1929. queries = queries.map(function (selector) {
  1930. return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]');
  1931. });
  1932. var $link = $(queries.join(','));
  1933. if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
  1934. $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
  1935. $link.addClass(ClassName.ACTIVE);
  1936. } else {
  1937. // todo (fat) this is kinda sus…
  1938. // recursively add actives to tested nav-links
  1939. $link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
  1940. }
  1941. $(this._scrollElement).trigger(Event.ACTIVATE, {
  1942. relatedTarget: target
  1943. });
  1944. }
  1945. }, {
  1946. key: '_clear',
  1947. value: function _clear() {
  1948. $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
  1949. }
  1950. // static
  1951. }], [{
  1952. key: '_jQueryInterface',
  1953. value: function _jQueryInterface(config) {
  1954. return this.each(function () {
  1955. var data = $(this).data(DATA_KEY);
  1956. var _config = typeof config === 'object' && config || null;
  1957. if (!data) {
  1958. data = new ScrollSpy(this, _config);
  1959. $(this).data(DATA_KEY, data);
  1960. }
  1961. if (typeof config === 'string') {
  1962. data[config]();
  1963. }
  1964. });
  1965. }
  1966. }, {
  1967. key: 'VERSION',
  1968. get: function get() {
  1969. return VERSION;
  1970. }
  1971. }, {
  1972. key: 'Default',
  1973. get: function get() {
  1974. return Default;
  1975. }
  1976. }]);
  1977. return ScrollSpy;
  1978. })();
  1979. $(window).on(Event.LOAD_DATA_API, function () {
  1980. var scrollSpys = $.makeArray($(Selector.DATA_SPY));
  1981. for (var i = scrollSpys.length; i--;) {
  1982. var $spy = $(scrollSpys[i]);
  1983. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  1984. }
  1985. });
  1986. /**
  1987. * ------------------------------------------------------------------------
  1988. * jQuery
  1989. * ------------------------------------------------------------------------
  1990. */
  1991. $.fn[NAME] = ScrollSpy._jQueryInterface;
  1992. $.fn[NAME].Constructor = ScrollSpy;
  1993. $.fn[NAME].noConflict = function () {
  1994. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1995. return ScrollSpy._jQueryInterface;
  1996. };
  1997. return ScrollSpy;
  1998. })(jQuery);
  1999. /**
  2000. * --------------------------------------------------------------------------
  2001. * Bootstrap (v4.0.0): tab.js
  2002. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  2003. * --------------------------------------------------------------------------
  2004. */
  2005. var Tab = (function ($) {
  2006. /**
  2007. * ------------------------------------------------------------------------
  2008. * Constants
  2009. * ------------------------------------------------------------------------
  2010. */
  2011. var NAME = 'tab';
  2012. var VERSION = '4.0.0';
  2013. var DATA_KEY = 'bs.tab';
  2014. var EVENT_KEY = '.' + DATA_KEY;
  2015. var DATA_API_KEY = '.data-api';
  2016. var JQUERY_NO_CONFLICT = $.fn[NAME];
  2017. var TRANSITION_DURATION = 150;
  2018. var Event = {
  2019. HIDE: 'hide' + EVENT_KEY,
  2020. HIDDEN: 'hidden' + EVENT_KEY,
  2021. SHOW: 'show' + EVENT_KEY,
  2022. SHOWN: 'shown' + EVENT_KEY,
  2023. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
  2024. };
  2025. var ClassName = {
  2026. DROPDOWN_MENU: 'dropdown-menu',
  2027. ACTIVE: 'active',
  2028. FADE: 'fade',
  2029. IN: 'in'
  2030. };
  2031. var Selector = {
  2032. A: 'a',
  2033. LI: 'li',
  2034. DROPDOWN: '.dropdown',
  2035. UL: 'ul:not(.dropdown-menu)',
  2036. FADE_CHILD: '> .nav-item .fade, > .fade',
  2037. ACTIVE: '.active',
  2038. ACTIVE_CHILD: '> .nav-item > .active, > .active',
  2039. DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"]',
  2040. DROPDOWN_TOGGLE: '.dropdown-toggle',
  2041. DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
  2042. };
  2043. /**
  2044. * ------------------------------------------------------------------------
  2045. * Class Definition
  2046. * ------------------------------------------------------------------------
  2047. */
  2048. var Tab = (function () {
  2049. function Tab(element) {
  2050. _classCallCheck(this, Tab);
  2051. this._element = element;
  2052. }
  2053. /**
  2054. * ------------------------------------------------------------------------
  2055. * Data Api implementation
  2056. * ------------------------------------------------------------------------
  2057. */
  2058. // getters
  2059. _createClass(Tab, [{
  2060. key: 'show',
  2061. // public
  2062. value: function show() {
  2063. var _this15 = this;
  2064. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE)) {
  2065. return;
  2066. }
  2067. var target = undefined;
  2068. var previous = undefined;
  2069. var ulElement = $(this._element).closest(Selector.UL)[0];
  2070. var selector = Util.getSelectorFromElement(this._element);
  2071. if (ulElement) {
  2072. previous = $.makeArray($(ulElement).find(Selector.ACTIVE));
  2073. previous = previous[previous.length - 1];
  2074. }
  2075. var hideEvent = $.Event(Event.HIDE, {
  2076. relatedTarget: this._element
  2077. });
  2078. var showEvent = $.Event(Event.SHOW, {
  2079. relatedTarget: previous
  2080. });
  2081. if (previous) {
  2082. $(previous).trigger(hideEvent);
  2083. }
  2084. $(this._element).trigger(showEvent);
  2085. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  2086. return;
  2087. }
  2088. if (selector) {
  2089. target = $(selector)[0];
  2090. }
  2091. this._activate(this._element, ulElement);
  2092. var complete = function complete() {
  2093. var hiddenEvent = $.Event(Event.HIDDEN, {
  2094. relatedTarget: _this15._element
  2095. });
  2096. var shownEvent = $.Event(Event.SHOWN, {
  2097. relatedTarget: previous
  2098. });
  2099. $(previous).trigger(hiddenEvent);
  2100. $(_this15._element).trigger(shownEvent);
  2101. };
  2102. if (target) {
  2103. this._activate(target, target.parentNode, complete);
  2104. } else {
  2105. complete();
  2106. }
  2107. }
  2108. }, {
  2109. key: 'dispose',
  2110. value: function dispose() {
  2111. $.removeClass(this._element, DATA_KEY);
  2112. this._element = null;
  2113. }
  2114. // private
  2115. }, {
  2116. key: '_activate',
  2117. value: function _activate(element, container, callback) {
  2118. var active = $(container).find(Selector.ACTIVE_CHILD)[0];
  2119. var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
  2120. var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback);
  2121. if (active && isTransitioning) {
  2122. $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
  2123. } else {
  2124. complete();
  2125. }
  2126. if (active) {
  2127. $(active).removeClass(ClassName.IN);
  2128. }
  2129. }
  2130. }, {
  2131. key: '_transitionComplete',
  2132. value: function _transitionComplete(element, active, isTransitioning, callback) {
  2133. if (active) {
  2134. $(active).removeClass(ClassName.ACTIVE);
  2135. var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
  2136. if (dropdownChild) {
  2137. $(dropdownChild).removeClass(ClassName.ACTIVE);
  2138. }
  2139. active.setAttribute('aria-expanded', false);
  2140. }
  2141. $(element).addClass(ClassName.ACTIVE);
  2142. element.setAttribute('aria-expanded', true);
  2143. if (isTransitioning) {
  2144. Util.reflow(element);
  2145. $(element).addClass(ClassName.IN);
  2146. } else {
  2147. $(element).removeClass(ClassName.FADE);
  2148. }
  2149. if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
  2150. var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];
  2151. if (dropdownElement) {
  2152. $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
  2153. }
  2154. element.setAttribute('aria-expanded', true);
  2155. }
  2156. if (callback) {
  2157. callback();
  2158. }
  2159. }
  2160. // static
  2161. }], [{
  2162. key: '_jQueryInterface',
  2163. value: function _jQueryInterface(config) {
  2164. return this.each(function () {
  2165. var $this = $(this);
  2166. var data = $this.data(DATA_KEY);
  2167. if (!data) {
  2168. data = data = new Tab(this);
  2169. $this.data(DATA_KEY, data);
  2170. }
  2171. if (typeof config === 'string') {
  2172. data[config]();
  2173. }
  2174. });
  2175. }
  2176. }, {
  2177. key: 'VERSION',
  2178. get: function get() {
  2179. return VERSION;
  2180. }
  2181. }]);
  2182. return Tab;
  2183. })();
  2184. $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
  2185. event.preventDefault();
  2186. Tab._jQueryInterface.call($(this), 'show');
  2187. });
  2188. /**
  2189. * ------------------------------------------------------------------------
  2190. * jQuery
  2191. * ------------------------------------------------------------------------
  2192. */
  2193. $.fn[NAME] = Tab._jQueryInterface;
  2194. $.fn[NAME].Constructor = Tab;
  2195. $.fn[NAME].noConflict = function () {
  2196. $.fn[NAME] = JQUERY_NO_CONFLICT;
  2197. return Tab._jQueryInterface;
  2198. };
  2199. return Tab;
  2200. })(jQuery);
  2201. /**
  2202. * --------------------------------------------------------------------------
  2203. * Bootstrap (v4.0.0): tooltip.js
  2204. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  2205. * --------------------------------------------------------------------------
  2206. */
  2207. var Tooltip = (function ($) {
  2208. /**
  2209. * ------------------------------------------------------------------------
  2210. * Constants
  2211. * ------------------------------------------------------------------------
  2212. */
  2213. var NAME = 'tooltip';
  2214. var VERSION = '4.0.0';
  2215. var DATA_KEY = 'bs.tooltip';
  2216. var EVENT_KEY = '.' + DATA_KEY;
  2217. var JQUERY_NO_CONFLICT = $.fn[NAME];
  2218. var TRANSITION_DURATION = 150;
  2219. var CLASS_PREFIX = 'bs-tether';
  2220. var Default = {
  2221. animation: true,
  2222. template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  2223. trigger: 'hover focus',
  2224. title: '',
  2225. delay: 0,
  2226. html: false,
  2227. selector: false,
  2228. placement: 'top',
  2229. offset: '0 0',
  2230. constraints: []
  2231. };
  2232. var DefaultType = {
  2233. animation: 'boolean',
  2234. template: 'string',
  2235. title: '(string|function)',
  2236. trigger: 'string',
  2237. delay: '(number|object)',
  2238. html: 'boolean',
  2239. selector: '(string|boolean)',
  2240. placement: '(string|function)',
  2241. offset: 'string',
  2242. constraints: 'array'
  2243. };
  2244. var AttachmentMap = {
  2245. TOP: 'bottom center',
  2246. RIGHT: 'middle left',
  2247. BOTTOM: 'top center',
  2248. LEFT: 'middle right'
  2249. };
  2250. var HoverState = {
  2251. IN: 'in',
  2252. OUT: 'out'
  2253. };
  2254. var Event = {
  2255. HIDE: 'hide' + EVENT_KEY,
  2256. HIDDEN: 'hidden' + EVENT_KEY,
  2257. SHOW: 'show' + EVENT_KEY,
  2258. SHOWN: 'shown' + EVENT_KEY,
  2259. INSERTED: 'inserted' + EVENT_KEY,
  2260. CLICK: 'click' + EVENT_KEY,
  2261. FOCUSIN: 'focusin' + EVENT_KEY,
  2262. FOCUSOUT: 'focusout' + EVENT_KEY,
  2263. MOUSEENTER: 'mouseenter' + EVENT_KEY,
  2264. MOUSELEAVE: 'mouseleave' + EVENT_KEY
  2265. };
  2266. var ClassName = {
  2267. FADE: 'fade',
  2268. IN: 'in'
  2269. };
  2270. var Selector = {
  2271. TOOLTIP: '.tooltip',
  2272. TOOLTIP_INNER: '.tooltip-inner'
  2273. };
  2274. var TetherClass = {
  2275. element: false,
  2276. enabled: false
  2277. };
  2278. var Trigger = {
  2279. HOVER: 'hover',
  2280. FOCUS: 'focus',
  2281. CLICK: 'click',
  2282. MANUAL: 'manual'
  2283. };
  2284. /**
  2285. * ------------------------------------------------------------------------
  2286. * Class Definition
  2287. * ------------------------------------------------------------------------
  2288. */
  2289. var Tooltip = (function () {
  2290. function Tooltip(element, config) {
  2291. _classCallCheck(this, Tooltip);
  2292. // private
  2293. this._isEnabled = true;
  2294. this._timeout = 0;
  2295. this._hoverState = '';
  2296. this._activeTrigger = {};
  2297. this._tether = null;
  2298. // protected
  2299. this.element = element;
  2300. this.config = this._getConfig(config);
  2301. this.tip = null;
  2302. this._setListeners();
  2303. }
  2304. /**
  2305. * ------------------------------------------------------------------------
  2306. * jQuery
  2307. * ------------------------------------------------------------------------
  2308. */
  2309. // getters
  2310. _createClass(Tooltip, [{
  2311. key: 'enable',
  2312. // public
  2313. value: function enable() {
  2314. this._isEnabled = true;
  2315. }
  2316. }, {
  2317. key: 'disable',
  2318. value: function disable() {
  2319. this._isEnabled = false;
  2320. }
  2321. }, {
  2322. key: 'toggleEnabled',
  2323. value: function toggleEnabled() {
  2324. this._isEnabled = !this._isEnabled;
  2325. }
  2326. }, {
  2327. key: 'toggle',
  2328. value: function toggle(event) {
  2329. if (event) {
  2330. var dataKey = this.constructor.DATA_KEY;
  2331. var context = $(event.currentTarget).data(dataKey);
  2332. if (!context) {
  2333. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2334. $(event.currentTarget).data(dataKey, context);
  2335. }
  2336. context._activeTrigger.click = !context._activeTrigger.click;
  2337. if (context._isWithActiveTrigger()) {
  2338. context._enter(null, context);
  2339. } else {
  2340. context._leave(null, context);
  2341. }
  2342. } else {
  2343. if ($(this.getTipElement()).hasClass(ClassName.IN)) {
  2344. this._leave(null, this);
  2345. return;
  2346. }
  2347. this._enter(null, this);
  2348. }
  2349. }
  2350. }, {
  2351. key: 'dispose',
  2352. value: function dispose() {
  2353. clearTimeout(this._timeout);
  2354. this.cleanupTether();
  2355. $.removeData(this.element, this.constructor.DATA_KEY);
  2356. $(this.element).off(this.constructor.EVENT_KEY);
  2357. if (this.tip) {
  2358. $(this.tip).remove();
  2359. }
  2360. this._isEnabled = null;
  2361. this._timeout = null;
  2362. this._hoverState = null;
  2363. this._activeTrigger = null;
  2364. this._tether = null;
  2365. this.element = null;
  2366. this.config = null;
  2367. this.tip = null;
  2368. }
  2369. }, {
  2370. key: 'show',
  2371. value: function show() {
  2372. var _this16 = this;
  2373. var showEvent = $.Event(this.constructor.Event.SHOW);
  2374. if (this.isWithContent() && this._isEnabled) {
  2375. $(this.element).trigger(showEvent);
  2376. var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
  2377. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  2378. return;
  2379. }
  2380. var tip = this.getTipElement();
  2381. var tipId = Util.getUID(this.constructor.NAME);
  2382. tip.setAttribute('id', tipId);
  2383. this.element.setAttribute('aria-describedby', tipId);
  2384. this.setContent();
  2385. if (this.config.animation) {
  2386. $(tip).addClass(ClassName.FADE);
  2387. }
  2388. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  2389. var attachment = this._getAttachment(placement);
  2390. $(tip).data(this.constructor.DATA_KEY, this).appendTo(document.body);
  2391. $(this.element).trigger(this.constructor.Event.INSERTED);
  2392. this._tether = new Tether({
  2393. attachment: attachment,
  2394. element: tip,
  2395. target: this.element,
  2396. classes: TetherClass,
  2397. classPrefix: CLASS_PREFIX,
  2398. offset: this.config.offset,
  2399. constraints: this.config.constraints
  2400. });
  2401. Util.reflow(tip);
  2402. this._tether.position();
  2403. $(tip).addClass(ClassName.IN);
  2404. var complete = function complete() {
  2405. var prevHoverState = _this16._hoverState;
  2406. _this16._hoverState = null;
  2407. $(_this16.element).trigger(_this16.constructor.Event.SHOWN);
  2408. if (prevHoverState === HoverState.OUT) {
  2409. _this16._leave(null, _this16);
  2410. }
  2411. };
  2412. if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
  2413. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
  2414. return;
  2415. }
  2416. complete();
  2417. }
  2418. }
  2419. }, {
  2420. key: 'hide',
  2421. value: function hide(callback) {
  2422. var _this17 = this;
  2423. var tip = this.getTipElement();
  2424. var hideEvent = $.Event(this.constructor.Event.HIDE);
  2425. var complete = function complete() {
  2426. if (_this17._hoverState !== HoverState.IN && tip.parentNode) {
  2427. tip.parentNode.removeChild(tip);
  2428. }
  2429. _this17.element.removeAttribute('aria-describedby');
  2430. $(_this17.element).trigger(_this17.constructor.Event.HIDDEN);
  2431. _this17.cleanupTether();
  2432. if (callback) {
  2433. callback();
  2434. }
  2435. };
  2436. $(this.element).trigger(hideEvent);
  2437. if (hideEvent.isDefaultPrevented()) {
  2438. return;
  2439. }
  2440. $(tip).removeClass(ClassName.IN);
  2441. if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
  2442. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
  2443. } else {
  2444. complete();
  2445. }
  2446. this._hoverState = '';
  2447. }
  2448. // protected
  2449. }, {
  2450. key: 'isWithContent',
  2451. value: function isWithContent() {
  2452. return Boolean(this.getTitle());
  2453. }
  2454. }, {
  2455. key: 'getTipElement',
  2456. value: function getTipElement() {
  2457. return this.tip = this.tip || $(this.config.template)[0];
  2458. }
  2459. }, {
  2460. key: 'setContent',
  2461. value: function setContent() {
  2462. var tip = this.getTipElement();
  2463. var title = this.getTitle();
  2464. var method = this.config.html ? 'innerHTML' : 'innerText';
  2465. $(tip).find(Selector.TOOLTIP_INNER)[0][method] = title;
  2466. $(tip).removeClass(ClassName.FADE).removeClass(ClassName.IN);
  2467. this.cleanupTether();
  2468. }
  2469. }, {
  2470. key: 'getTitle',
  2471. value: function getTitle() {
  2472. var title = this.element.getAttribute('data-original-title');
  2473. if (!title) {
  2474. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  2475. }
  2476. return title;
  2477. }
  2478. }, {
  2479. key: 'cleanupTether',
  2480. value: function cleanupTether() {
  2481. if (this._tether) {
  2482. this._tether.destroy();
  2483. // clean up after tether's junk classes
  2484. // remove after they fix issue
  2485. // (https://github.com/HubSpot/tether/issues/36)
  2486. $(this.element).removeClass(this._removeTetherClasses);
  2487. $(this.tip).removeClass(this._removeTetherClasses);
  2488. }
  2489. }
  2490. // private
  2491. }, {
  2492. key: '_getAttachment',
  2493. value: function _getAttachment(placement) {
  2494. return AttachmentMap[placement.toUpperCase()];
  2495. }
  2496. }, {
  2497. key: '_setListeners',
  2498. value: function _setListeners() {
  2499. var _this18 = this;
  2500. var triggers = this.config.trigger.split(' ');
  2501. triggers.forEach(function (trigger) {
  2502. if (trigger === 'click') {
  2503. $(_this18.element).on(_this18.constructor.Event.CLICK, _this18.config.selector, $.proxy(_this18.toggle, _this18));
  2504. } else if (trigger !== Trigger.MANUAL) {
  2505. var eventIn = trigger === Trigger.HOVER ? _this18.constructor.Event.MOUSEENTER : _this18.constructor.Event.FOCUSIN;
  2506. var eventOut = trigger === Trigger.HOVER ? _this18.constructor.Event.MOUSELEAVE : _this18.constructor.Event.FOCUSOUT;
  2507. $(_this18.element).on(eventIn, _this18.config.selector, $.proxy(_this18._enter, _this18)).on(eventOut, _this18.config.selector, $.proxy(_this18._leave, _this18));
  2508. }
  2509. });
  2510. if (this.config.selector) {
  2511. this.config = $.extend({}, this.config, {
  2512. trigger: 'manual',
  2513. selector: ''
  2514. });
  2515. } else {
  2516. this._fixTitle();
  2517. }
  2518. }
  2519. }, {
  2520. key: '_removeTetherClasses',
  2521. value: function _removeTetherClasses(i, css) {
  2522. return ((css.baseVal || css).match(new RegExp('(^|\\s)' + CLASS_PREFIX + '-\\S+', 'g')) || []).join(' ');
  2523. }
  2524. }, {
  2525. key: '_fixTitle',
  2526. value: function _fixTitle() {
  2527. var titleType = typeof this.element.getAttribute('data-original-title');
  2528. if (this.element.getAttribute('title') || titleType !== 'string') {
  2529. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  2530. this.element.setAttribute('title', '');
  2531. }
  2532. }
  2533. }, {
  2534. key: '_enter',
  2535. value: function _enter(event, context) {
  2536. var dataKey = this.constructor.DATA_KEY;
  2537. context = context || $(event.currentTarget).data(dataKey);
  2538. if (!context) {
  2539. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2540. $(event.currentTarget).data(dataKey, context);
  2541. }
  2542. if (event) {
  2543. context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
  2544. }
  2545. if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) {
  2546. context._hoverState = HoverState.IN;
  2547. return;
  2548. }
  2549. clearTimeout(context._timeout);
  2550. context._hoverState = HoverState.IN;
  2551. if (!context.config.delay || !context.config.delay.show) {
  2552. context.show();
  2553. return;
  2554. }
  2555. context._timeout = setTimeout(function () {
  2556. if (context._hoverState === HoverState.IN) {
  2557. context.show();
  2558. }
  2559. }, context.config.delay.show);
  2560. }
  2561. }, {
  2562. key: '_leave',
  2563. value: function _leave(event, context) {
  2564. var dataKey = this.constructor.DATA_KEY;
  2565. context = context || $(event.currentTarget).data(dataKey);
  2566. if (!context) {
  2567. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2568. $(event.currentTarget).data(dataKey, context);
  2569. }
  2570. if (event) {
  2571. context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
  2572. }
  2573. if (context._isWithActiveTrigger()) {
  2574. return;
  2575. }
  2576. clearTimeout(context._timeout);
  2577. context._hoverState = HoverState.OUT;
  2578. if (!context.config.delay || !context.config.delay.hide) {
  2579. context.hide();
  2580. return;
  2581. }
  2582. context._timeout = setTimeout(function () {
  2583. if (context._hoverState === HoverState.OUT) {
  2584. context.hide();
  2585. }
  2586. }, context.config.delay.hide);
  2587. }
  2588. }, {
  2589. key: '_isWithActiveTrigger',
  2590. value: function _isWithActiveTrigger() {
  2591. for (var trigger in this._activeTrigger) {
  2592. if (this._activeTrigger[trigger]) {
  2593. return true;
  2594. }
  2595. }
  2596. return false;
  2597. }
  2598. }, {
  2599. key: '_getConfig',
  2600. value: function _getConfig(config) {
  2601. config = $.extend({}, this.constructor.Default, $(this.element).data(), config);
  2602. if (config.delay && typeof config.delay === 'number') {
  2603. config.delay = {
  2604. show: config.delay,
  2605. hide: config.delay
  2606. };
  2607. }
  2608. Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
  2609. return config;
  2610. }
  2611. }, {
  2612. key: '_getDelegateConfig',
  2613. value: function _getDelegateConfig() {
  2614. var config = {};
  2615. if (this.config) {
  2616. for (var key in this.config) {
  2617. if (this.constructor.Default[key] !== this.config[key]) {
  2618. config[key] = this.config[key];
  2619. }
  2620. }
  2621. }
  2622. return config;
  2623. }
  2624. // static
  2625. }], [{
  2626. key: '_jQueryInterface',
  2627. value: function _jQueryInterface(config) {
  2628. return this.each(function () {
  2629. var data = $(this).data(DATA_KEY);
  2630. var _config = typeof config === 'object' ? config : null;
  2631. if (!data && /destroy|hide/.test(config)) {
  2632. return;
  2633. }
  2634. if (!data) {
  2635. data = new Tooltip(this, _config);
  2636. $(this).data(DATA_KEY, data);
  2637. }
  2638. if (typeof config === 'string') {
  2639. data[config]();
  2640. }
  2641. });
  2642. }
  2643. }, {
  2644. key: 'VERSION',
  2645. get: function get() {
  2646. return VERSION;
  2647. }
  2648. }, {
  2649. key: 'Default',
  2650. get: function get() {
  2651. return Default;
  2652. }
  2653. }, {
  2654. key: 'NAME',
  2655. get: function get() {
  2656. return NAME;
  2657. }
  2658. }, {
  2659. key: 'DATA_KEY',
  2660. get: function get() {
  2661. return DATA_KEY;
  2662. }
  2663. }, {
  2664. key: 'Event',
  2665. get: function get() {
  2666. return Event;
  2667. }
  2668. }, {
  2669. key: 'EVENT_KEY',
  2670. get: function get() {
  2671. return EVENT_KEY;
  2672. }
  2673. }, {
  2674. key: 'DefaultType',
  2675. get: function get() {
  2676. return DefaultType;
  2677. }
  2678. }]);
  2679. return Tooltip;
  2680. })();
  2681. $.fn[NAME] = Tooltip._jQueryInterface;
  2682. $.fn[NAME].Constructor = Tooltip;
  2683. $.fn[NAME].noConflict = function () {
  2684. $.fn[NAME] = JQUERY_NO_CONFLICT;
  2685. return Tooltip._jQueryInterface;
  2686. };
  2687. return Tooltip;
  2688. })(jQuery);
  2689. /**
  2690. * --------------------------------------------------------------------------
  2691. * Bootstrap (v4.0.0): popover.js
  2692. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  2693. * --------------------------------------------------------------------------
  2694. */
  2695. var Popover = (function ($) {
  2696. /**
  2697. * ------------------------------------------------------------------------
  2698. * Constants
  2699. * ------------------------------------------------------------------------
  2700. */
  2701. var NAME = 'popover';
  2702. var VERSION = '4.0.0';
  2703. var DATA_KEY = 'bs.popover';
  2704. var EVENT_KEY = '.' + DATA_KEY;
  2705. var JQUERY_NO_CONFLICT = $.fn[NAME];
  2706. var Default = $.extend({}, Tooltip.Default, {
  2707. placement: 'right',
  2708. trigger: 'click',
  2709. content: '',
  2710. template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>'
  2711. });
  2712. var DefaultType = $.extend({}, Tooltip.DefaultType, {
  2713. content: '(string|function)'
  2714. });
  2715. var ClassName = {
  2716. FADE: 'fade',
  2717. IN: 'in'
  2718. };
  2719. var Selector = {
  2720. TITLE: '.popover-title',
  2721. CONTENT: '.popover-content',
  2722. ARROW: '.popover-arrow'
  2723. };
  2724. var Event = {
  2725. HIDE: 'hide' + EVENT_KEY,
  2726. HIDDEN: 'hidden' + EVENT_KEY,
  2727. SHOW: 'show' + EVENT_KEY,
  2728. SHOWN: 'shown' + EVENT_KEY,
  2729. INSERTED: 'inserted' + EVENT_KEY,
  2730. CLICK: 'click' + EVENT_KEY,
  2731. FOCUSIN: 'focusin' + EVENT_KEY,
  2732. FOCUSOUT: 'focusout' + EVENT_KEY,
  2733. MOUSEENTER: 'mouseenter' + EVENT_KEY,
  2734. MOUSELEAVE: 'mouseleave' + EVENT_KEY
  2735. };
  2736. /**
  2737. * ------------------------------------------------------------------------
  2738. * Class Definition
  2739. * ------------------------------------------------------------------------
  2740. */
  2741. var Popover = (function (_Tooltip) {
  2742. _inherits(Popover, _Tooltip);
  2743. function Popover() {
  2744. _classCallCheck(this, Popover);
  2745. _get(Object.getPrototypeOf(Popover.prototype), 'constructor', this).apply(this, arguments);
  2746. }
  2747. /**
  2748. * ------------------------------------------------------------------------
  2749. * jQuery
  2750. * ------------------------------------------------------------------------
  2751. */
  2752. _createClass(Popover, [{
  2753. key: 'isWithContent',
  2754. // overrides
  2755. value: function isWithContent() {
  2756. return this.getTitle() || this._getContent();
  2757. }
  2758. }, {
  2759. key: 'getTipElement',
  2760. value: function getTipElement() {
  2761. return this.tip = this.tip || $(this.config.template)[0];
  2762. }
  2763. }, {
  2764. key: 'setContent',
  2765. value: function setContent() {
  2766. var tip = this.getTipElement();
  2767. var title = this.getTitle();
  2768. var content = this._getContent();
  2769. var titleElement = $(tip).find(Selector.TITLE)[0];
  2770. if (titleElement) {
  2771. titleElement[this.config.html ? 'innerHTML' : 'innerText'] = title;
  2772. }
  2773. // we use append for html objects to maintain js events
  2774. $(tip).find(Selector.CONTENT).children().detach().end()[this.config.html ? typeof content === 'string' ? 'html' : 'append' : 'text'](content);
  2775. $(tip).removeClass(ClassName.FADE).removeClass(ClassName.IN);
  2776. this.cleanupTether();
  2777. }
  2778. // private
  2779. }, {
  2780. key: '_getContent',
  2781. value: function _getContent() {
  2782. return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content);
  2783. }
  2784. // static
  2785. }], [{
  2786. key: '_jQueryInterface',
  2787. value: function _jQueryInterface(config) {
  2788. return this.each(function () {
  2789. var data = $(this).data(DATA_KEY);
  2790. var _config = typeof config === 'object' ? config : null;
  2791. if (!data && /destroy|hide/.test(config)) {
  2792. return;
  2793. }
  2794. if (!data) {
  2795. data = new Popover(this, _config);
  2796. $(this).data(DATA_KEY, data);
  2797. }
  2798. if (typeof config === 'string') {
  2799. data[config]();
  2800. }
  2801. });
  2802. }
  2803. }, {
  2804. key: 'VERSION',
  2805. // getters
  2806. get: function get() {
  2807. return VERSION;
  2808. }
  2809. }, {
  2810. key: 'Default',
  2811. get: function get() {
  2812. return Default;
  2813. }
  2814. }, {
  2815. key: 'NAME',
  2816. get: function get() {
  2817. return NAME;
  2818. }
  2819. }, {
  2820. key: 'DATA_KEY',
  2821. get: function get() {
  2822. return DATA_KEY;
  2823. }
  2824. }, {
  2825. key: 'Event',
  2826. get: function get() {
  2827. return Event;
  2828. }
  2829. }, {
  2830. key: 'EVENT_KEY',
  2831. get: function get() {
  2832. return EVENT_KEY;
  2833. }
  2834. }, {
  2835. key: 'DefaultType',
  2836. get: function get() {
  2837. return DefaultType;
  2838. }
  2839. }]);
  2840. return Popover;
  2841. })(Tooltip);
  2842. $.fn[NAME] = Popover._jQueryInterface;
  2843. $.fn[NAME].Constructor = Popover;
  2844. $.fn[NAME].noConflict = function () {
  2845. $.fn[NAME] = JQUERY_NO_CONFLICT;
  2846. return Popover._jQueryInterface;
  2847. };
  2848. return Popover;
  2849. })(jQuery);
  2850. }(jQuery);