text: /**
   * jquery-date-range-picker
   * @version v0.16.1
   * @link https://github.com/longbill/jquery-date-range-picker
   * @license MIT
   */
  !function(e){"function"==typeof define&&define.amd?define(["jquery","moment"],e):"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("moment")):e(jQuery,moment)}(function(e,t){"use strict";e.dateRangePickerLanguages={default:{selected:"Selected:",day:"Day",days:"Days",apply:"Close","week-1":"mo","week-2":"tu","week-3":"we","week-4":"th","week-5":"fr","week-6":"sa","week-7":"su","week-number":"W","month-name":["january","february","march","april","may","june","july","august","september","october","november","december"],shortcuts:"Shortcuts","custom-values":"Custom Values",past:"Past",following:"Following",previous:"Previous","prev-week":"Week","prev-month":"Month","prev-year":"Year",next:"Next","next-week":"Week","next-month":"Month","next-year":"Year","less-than":"Date range should not be more than %d days","more-than":"Date range should not be less than %d days","default-more":"Please select a date range longer than %d days","default-single":"Please select a date","default-less":"Please select a date range less than %d days","default-range":"Please select a date range between %d and %d days","default-default":"Please select a date range",time:"Time",hour:"Hour",minute:"Minute"},id:{selected:"Terpilih:",day:"Hari",days:"Hari",apply:"Tutup","week-1":"sen","week-2":"sel","week-3":"rab","week-4":"kam","week-5":"jum","week-6":"sab","week-7":"min","week-number":"W","month-name":["januari","februari","maret","april","mei","juni","juli","agustus","september","oktober","november","desember"],shortcuts:"Pintas","custom-values":"Nilai yang ditentukan",past:"Yang Lalu",following:"Mengikuti",previous:"Sebelumnya","prev-week":"Minggu","prev-month":"Bulan","prev-year":"Tahun",next:"Selanjutnya","next-week":"Minggu","next-month":"Bulan","next-year":"Tahun","less-than":"Tanggal harus lebih dari %d hari","more-than":"Tanggal harus kurang dari %d hari","default-more":"Jarak tanggal harus lebih lama dari %d hari","default-single":"Silakan pilih tanggal","default-less":"Jarak rentang tanggal tidak boleh lebih lama dari %d hari","default-range":"Rentang tanggal harus antara %d dan %d hari","default-default":"Silakan pilih rentang tanggal",time:"Waktu",hour:"Jam",minute:"Menit"},az:{selected:"Seçildi:",day:" gün",days:" gün",apply:"tətbiq","week-1":"1","week-2":"2","week-3":"3","week-4":"4","week-5":"5","week-6":"6","week-7":"7","month-name":["yanvar","fevral","mart","aprel","may","iyun","iyul","avqust","sentyabr","oktyabr","noyabr","dekabr"],shortcuts:"Qısayollar",past:"Keçmiş",following:"Növbəti",previous:"&nbsp;&nbsp;&nbsp;","prev-week":"Öncəki həftə","prev-month":"Öncəki ay","prev-year":"Öncəki il",next:"&nbsp;&nbsp;&nbsp;","next-week":"Növbəti həftə","next-month":"Növbəti ay","next-year":"Növbəti il","less-than":"Tarix aralığı %d gündən çox olmamalıdır","more-than":"Tarix aralığı %d gündən az olmamalıdır","default-more":"%d gündən çox bir tarix seçin","default-single":"Tarix seçin","default-less":"%d gündən az bir tarix seçin","default-range":"%d və %d gün aralığında tarixlər seçin","default-default":"Tarix aralığı seçin"},bg:{selected:"Избрано:",day:"Ден",days:"Дни",apply:"Затвори","week-1":"пн","week-2":"вт","week-3":"ср","week-4":"чт","week-5":"пт","week-6":"сб","week-7":"нд","week-number":"С","month-name":["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември"],shortcuts:"Преки пътища","custom-values":"Персонализирани стойности",past:"Минал",following:"Следващ",previous:"Предишен","prev-week":"Седмица","prev-month":"Месец","prev-year":"Година",next:"Следващ","next-week":"Седмица","next-month":"Месец","next-year":"Година","less-than":"Периодът от време не трябва да е повече от %d дни","more-than":"Периодът от време не трябва да е по-малко от %d дни","default-more":"Моля изберете период по-дълъг от %d дни","default-single":"Моля изберете дата","default-less":"Моля изберете период по-къс от %d дни","default-range":"Моля изберете период между %d и %d дни","default-default":"Моля изберете период",time:"Време",hour:"Час",minute:"Минута"},cn:{selected:"已选择:",day:"天",days:"天",apply:"确定","week-1":"一","week-2":"二","week-3":"三","week-4":"四","week-5":"五","week-6":"六","week-7":"日","week-number":"周","month-name":["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortcuts:"快捷选择",past:"过去",following:"将来",previous:"&nbsp;&nbsp;&nbsp;","prev-week":"上周","prev-month":"上个月","prev-year":"去年",next:"&nbsp;&nbsp;&nbsp;","next-week":"下周","next-month":"下个月","next-year":"明年","less-than":"所选日期范围不能大于%d天","more-than":"所选日期范围不能小于%d天","default-more":"请选择大于%d天的日期范围","default-less":"请选择小于%d天的日期范围","default-range":"请选择%d天到%d天的日期范围","default-single":"请选择一个日期","default-default":"请选择一个日期范围",time:"时间",hour:"小时",minute:"分钟"},cz:{selected:"Vybráno:",day:"Den",days:"Dny",apply:"Zavřít","week-1":"po","week-2":"út","week-3":"st","week-4":"čt","week-5":"pá","week-6":"so","week-7":"ne","month-name":["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],shortcuts:"Zkratky",past:"po",following:"následující",previous:"předchozí","prev-week":"týden","prev-month":"měsíc","prev-year":"rok",next:"další","next-week":"týden","next-month":"měsíc","next-year":"rok","less-than":"Rozsah data by neměl být větší než %d dnů","more-than":"Rozsah data by neměl být menší než %d dnů","default-more":"Prosím zvolte rozsah data větší než %d dnů","default-single":"Prosím zvolte datum","default-less":"Prosím zvolte rozsah data menší než %d dnů","default-range":"Prosím zvolte rozsah data mezi %d a %d dny","default-default":"Prosím zvolte rozsah data"},de:{selected:"Auswahl:",day:"Tag",days:"Tage",apply:"Schließen","week-1":"mo","week-2":"di","week-3":"mi","week-4":"do","week-5":"fr","week-6":"sa","week-7":"so","month-name":["januar","februar","märz","april","mai","juni","juli","august","september","oktober","november","dezember"],shortcuts:"Schnellwahl",past:"Vorherige",following:"Folgende",previous:"Vorherige","prev-week":"Woche","prev-month":"Monat","prev-year":"Jahr",next:"Nächste","next-week":"Woche","next-month":"Monat","next-year":"Jahr","less-than":"Datumsbereich darf nicht größer sein als %d Tage","more-than":"Datumsbereich darf nicht kleiner sein als %d Tage","default-more":"Bitte mindestens %d Tage auswählen","default-single":"Bitte ein Datum auswählen","default-less":"Bitte weniger als %d Tage auswählen","default-range":"Bitte einen Datumsbereich zwischen %d und %d Tagen auswählen","default-default":"Bitte ein Start- und Enddatum auswählen",Time:"Zeit",hour:"Stunde",minute:"Minute"},es:{selected:"Seleccionado:",day:"Día",days:"Días",apply:"Cerrar","week-1":"lu","week-2":"ma","week-3":"mi","week-4":"ju","week-5":"vi","week-6":"sa","week-7":"do","month-name":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],shortcuts:"Accesos directos",past:"Pasado",following:"Siguiente",previous:"Anterior","prev-week":"Semana","prev-month":"Mes","prev-year":"Año",next:"Siguiente","next-week":"Semana","next-month":"Mes","next-year":"Año","less-than":"El rango no debería ser mayor de %d días","more-than":"El rango no debería ser menor de %d días","default-more":"Por favor selecciona un rango mayor a %d días","default-single":"Por favor selecciona un día","default-less":"Por favor selecciona un rango menor a %d días","default-range":"Por favor selecciona un rango entre %d y %d días","default-default":"Por favor selecciona un rango de fechas."},fr:{selected:"Sélection:",day:"Jour",days:"Jours",apply:"Fermer","week-1":"lu","week-2":"ma","week-3":"me","week-4":"je","week-5":"ve","week-6":"sa","week-7":"di","month-name":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortcuts:"Raccourcis",past:"Passé",following:"Suivant",previous:"Précédent","prev-week":"Semaine","prev-month":"Mois","prev-year":"Année",next:"Suivant","next-week":"Semaine","next-month":"Mois","next-year":"Année","less-than":"L'intervalle ne doit pas être supérieure à %d jours","more-than":"L'intervalle ne doit pas être inférieure à %d jours","default-more":"Merci de choisir une intervalle supérieure à %d jours","default-single":"Merci de choisir une date","default-less":"Merci de choisir une intervalle inférieure %d jours","default-range":"Merci de choisir une intervalle comprise entre %d et %d jours","default-default":"Merci de choisir une date"},hu:{selected:"Kiválasztva:",day:"Nap",days:"Nap",apply:"Ok","week-1":"h","week-2":"k","week-3":"sz","week-4":"cs","week-5":"p","week-6":"sz","week-7":"v","month-name":["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],shortcuts:"Gyorsválasztó",past:"Múlt",following:"Következő",previous:"Előző","prev-week":"Hét","prev-month":"Hónap","prev-year":"Év",next:"Következő","next-week":"Hét","next-month":"Hónap","next-year":"Év","less-than":"A kiválasztás nem lehet több %d napnál","more-than":"A kiválasztás nem lehet több %d napnál","default-more":"Válassz ki egy időszakot ami hosszabb mint %d nap","default-single":"Válassz egy napot","default-less":"Válassz ki egy időszakot ami rövidebb mint %d nap","default-range":"Válassz ki egy %d - %d nap hosszú időszakot","default-default":"Válassz ki egy időszakot"},it:{selected:"Selezionati:",day:"Giorno",days:"Giorni",apply:"Chiudi","week-1":"lu","week-2":"ma","week-3":"me","week-4":"gi","week-5":"ve","week-6":"sa","week-7":"do","month-name":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],shortcuts:"Scorciatoie",past:"Scorso",following:"Successivo",previous:"Precedente","prev-week":"Settimana","prev-month":"Mese","prev-year":"Anno",next:"Prossimo","next-week":"Settimana","next-month":"Mese","next-year":"Anno","less-than":"L'intervallo non dev'essere maggiore di %d giorni","more-than":"L'intervallo non dev'essere minore di %d giorni","default-more":"Seleziona un intervallo maggiore di %d giorni","default-single":"Seleziona una data","default-less":"Seleziona un intervallo minore di %d giorni","default-range":"Seleziona un intervallo compreso tra i %d e i %d giorni","default-default":"Seleziona un intervallo di date"},ko:{selected:"기간:",day:"일",days:"일간",apply:"닫기","week-1":"월","week-2":"화","week-3":"수","week-4":"목","week-5":"금","week-6":"토","week-7":"일","week-number":"주","month-name":["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],shortcuts:"단축키들",past:"지난(오늘기준)",following:"이후(오늘기준)",previous:"이전","prev-week":"1주","prev-month":"1달","prev-year":"1년",next:"다음","next-week":"1주","next-month":"1달","next-year":"1년","less-than":"날짜 범위는 %d 일보다 많을 수 없습니다","more-than":"날짜 범위는 %d 일보다 작을 수 없습니다","default-more":"날짜 범위를 %d 일보다 길게 선택해 주세요","default-single":"날짜를 선택해 주세요","default-less":"%d 일보다 작은 날짜를 선택해 주세요","default-range":"%d와 %d 일 사이의 날짜 범위를 선택해 주세요","default-default":"날짜 범위를 선택해 주세요",time:"시각",hour:"시",minute:"분"},no:{selected:"Valgt:",day:"Dag",days:"Dager",apply:"Lukk","week-1":"ma","week-2":"ti","week-3":"on","week-4":"to","week-5":"fr","week-6":"lø","week-7":"sø","month-name":["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],shortcuts:"Snarveier","custom-values":"Egendefinerte Verdier",past:"Over",following:"Følger",previous:"Forrige","prev-week":"Uke","prev-month":"Måned","prev-year":"År",next:"Neste","next-week":"Uke","next-month":"Måned","next-year":"År","less-than":"Datoperioden skal ikkje være lengre enn %d dager","more-than":"Datoperioden skal ikkje være kortere enn %d dager","default-more":"Vennligst velg ein datoperiode lengre enn %d dager","default-single":"Vennligst velg ein dato","default-less":"Vennligst velg ein datoperiode mindre enn %d dager","default-range":"Vennligst velg ein datoperiode mellom %d og %d dager","default-default":"Vennligst velg ein datoperiode",time:"Tid",hour:"Time",minute:"Minutter"},nl:{selected:"Geselecteerd:",day:"Dag",days:"Dagen",apply:"Ok","week-1":"ma","week-2":"di","week-3":"wo","week-4":"do","week-5":"vr","week-6":"za","week-7":"zo","month-name":["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortcuts:"Snelkoppelingen","custom-values":"Aangepaste waarden",past:"Verleden",following:"Komend",previous:"Vorige","prev-week":"Week","prev-month":"Maand","prev-year":"Jaar",next:"Volgende","next-week":"Week","next-month":"Maand","next-year":"Jaar","less-than":"Interval moet langer dan %d dagen zijn","more-than":"Interval mag niet minder dan %d dagen zijn","default-more":"Selecteer een interval langer dan %dagen","default-single":"Selecteer een datum","default-less":"Selecteer een interval minder dan %d dagen","default-range":"Selecteer een interval tussen %d en %d dagen","default-default":"Selecteer een interval",time:"Tijd",hour:"Uur",minute:"Minuut"},ru:{selected:"Выбрано:",day:"День",days:"Дней",apply:"Применить","week-1":"пн","week-2":"вт","week-3":"ср","week-4":"чт","week-5":"пт","week-6":"сб","week-7":"вс","month-name":["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],shortcuts:"Быстрый выбор","custom-values":"Пользовательские значения",past:"Прошедшие",following:"Следующие",previous:"&nbsp;&nbsp;&nbsp;","prev-week":"Неделя","prev-month":"Месяц","prev-year":"Год",next:"&nbsp;&nbsp;&nbsp;","next-week":"Неделя","next-month":"Месяц","next-year":"Год","less-than":"Диапазон не может быть больше %d дней","more-than":"Диапазон не может быть меньше %d дней","default-more":"Пожалуйста выберите диапазон больше %d дней","default-single":"Пожалуйста выберите дату","default-less":"Пожалуйста выберите диапазон меньше %d дней","default-range":"Пожалуйста выберите диапазон между %d и %d днями","default-default":"Пожалуйста выберите диапазон",time:"Время",hour:"Часы",minute:"Минуты"},pl:{selected:"Wybrany:",day:"Dzień",days:"Dni",apply:"Zamknij","week-1":"pon","week-2":"wt","week-3":"śr","week-4":"czw","week-5":"pt","week-6":"so","week-7":"nd","month-name":["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],shortcuts:"Skróty","custom-values":"Niestandardowe wartości",past:"Przeszłe",following:"Następne",previous:"Poprzednie","prev-week":"tydzień","prev-month":"miesiąc","prev-year":"rok",next:"Następny","next-week":"tydzień","next-month":"miesiąc","next-year":"rok","less-than":"Okres nie powinien być dłuższy niż %d dni","more-than":"Okres nie powinien być krótszy niż  %d ni","default-more":"Wybierz okres dłuższy niż %d dni","default-single":"Wybierz datę","default-less":"Wybierz okres krótszy niż %d dni","default-range":"Wybierz okres trwający od %d do %d dni","default-default":"Wybierz okres",time:"Czas",hour:"Godzina",minute:"Minuta"},se:{selected:"Vald:",day:"dag",days:"dagar",apply:"godkänn","week-1":"ma","week-2":"ti","week-3":"on","week-4":"to","week-5":"fr","week-6":"lö","week-7":"sö","month-name":["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],shortcuts:"genvägar","custom-values":"Anpassade värden",past:"över",following:"följande",previous:"förra","prev-week":"vecka","prev-month":"månad","prev-year":"år",next:"nästa","next-week":"vecka","next-month":"måned","next-year":"år","less-than":"Datumintervall bör inte vara mindre än %d dagar","more-than":"Datumintervall bör inte vara mer än %d dagar","default-more":"Välj ett datumintervall längre än %d dagar","default-single":"Välj ett datum","default-less":"Välj ett datumintervall mindre än %d dagar","default-range":"Välj ett datumintervall mellan %d och %d dagar","default-default":"Välj ett datumintervall",time:"tid",hour:"timme",minute:"minut"},pt:{selected:"Selecionado:",day:"Dia",days:"Dias",apply:"Fechar","week-1":"seg","week-2":"ter","week-3":"qua","week-4":"qui","week-5":"sex","week-6":"sab","week-7":"dom","week-number":"N","month-name":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],shortcuts:"Atalhos","custom-values":"Valores Personalizados",past:"Passado",following:"Seguinte",previous:"Anterior","prev-week":"Semana","prev-month":"Mês","prev-year":"Ano",next:"Próximo","next-week":"Próxima Semana","next-month":"Próximo Mês","next-year":"Próximo Ano","less-than":"O período selecionado não deve ser maior que %d dias","more-than":"O período selecionado não deve ser menor que %d dias","default-more":"Selecione um período superior a %d dias","default-single":"Selecione uma data","default-less":"Selecione um período inferior a %d dias","default-range":"Selecione um período de %d a %d dias","default-default":"Selecione um período",time:"Tempo",hour:"Hora",minute:"Minuto"},tc:{selected:"已選擇:",day:"天",days:"天",apply:"確定","week-1":"一","week-2":"二","week-3":"三","week-4":"四","week-5":"五","week-6":"六","week-7":"日","week-number":"周","month-name":["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortcuts:"快速選擇",past:"過去",following:"將來",previous:"&nbsp;&nbsp;&nbsp;","prev-week":"上週","prev-month":"上個月","prev-year":"去年",next:"&nbsp;&nbsp;&nbsp;","next-week":"下周","next-month":"下個月","next-year":"明年","less-than":"所選日期範圍不能大於%d天","more-than":"所選日期範圍不能小於%d天","default-more":"請選擇大於%d天的日期範圍","default-less":"請選擇小於%d天的日期範圍","default-range":"請選擇%d天到%d天的日期範圍","default-single":"請選擇一個日期","default-default":"請選擇一個日期範圍",time:"日期",hour:"小時",minute:"分鐘"},ja:{selected:"選択しました:",day:"日",days:"日々",apply:"閉じる","week-1":"月","week-2":"火","week-3":"水","week-4":"木","week-5":"金","week-6":"土","week-7":"日","month-name":["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],shortcuts:"クイック選択",past:"過去",following:"将来",previous:"&nbsp;&nbsp;&nbsp;","prev-week":"先週、","prev-month":"先月","prev-year":"昨年",next:"&nbsp;&nbsp;&nbsp;","next-week":"来週","next-month":"来月","next-year":"来年","less-than":"日付の範囲は ％d 日以上にすべきではありません","more-than":"日付の範囲は ％d 日を下回ってはいけません","default-more":"％d 日よりも長い期間を選択してください","default-less":"％d 日未満の期間を選択してください","default-range":"％d と％ d日の間の日付範囲を選択してください","default-single":"日付を選択してください","default-default":"日付範囲を選択してください",time:"時間",hour:"時間",minute:"分"},da:{selected:"Valgt:",day:"Dag",days:"Dage",apply:"Luk","week-1":"ma","week-2":"ti","week-3":"on","week-4":"to","week-5":"fr","week-6":"lö","week-7":"sö","month-name":["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],shortcuts:"genveje","custom-values":"Brugerdefinerede værdier",past:"Forbi",following:"Følgende",previous:"Forrige","prev-week":"uge","prev-month":"månad","prev-year":"år",next:"Næste","next-week":"Næste uge","next-month":"Næste måned","next-year":"Næste år","less-than":"Dato interval bør ikke være med end %d dage","more-than":"Dato interval bør ikke være mindre end %d dage","default-more":"Vælg datointerval længere end %d dage","default-single":"Vælg dato","default-less":"Vælg datointerval mindre end %d dage","default-range":"Vælg datointerval mellem %d og %d dage","default-default":"Vælg datointerval",time:"tid",hour:"time",minute:"minut"},fi:{selected:"Valittu:",day:"Päivä",days:"Päivää",apply:"Sulje","week-1":"ma","week-2":"ti","week-3":"ke","week-4":"to","week-5":"pe","week-6":"la","week-7":"su","week-number":"V","month-name":["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],shortcuts:"Pikavalinnat","custom-values":"Mukautetut Arvot",past:"Menneet",following:"Tulevat",previous:"Edellinen","prev-week":"Viikko","prev-month":"Kuukausi","prev-year":"Vuosi",next:"Seuraava","next-week":"Viikko","next-month":"Kuukausi","next-year":"Vuosi","less-than":"Aikajakson tulisi olla vähemmän kuin %d päivää","more-than":"Aikajakson ei tulisi olla vähempää kuin %d päivää","default-more":"Valitse pidempi aikajakso kuin %d päivää","default-single":"Valitse päivä","default-less":"Valitse lyhyempi aikajakso kuin %d päivää","default-range":"Valitse aikajakso %d ja %d päivän väliltä","default-default":"Valitse aikajakso",time:"Aika",hour:"Tunti",minute:"Minuutti"},cat:{selected:"Seleccionats:",day:"Dia",days:"Dies",apply:"Tanca","week-1":"Dl","week-2":"Dm","week-3":"Dc","week-4":"Dj","week-5":"Dv","week-6":"Ds","week-7":"Dg","week-number":"S","month-name":["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],shortcuts:"Dreçeres","custom-values":"Valors personalitzats",past:"Passat",following:"Futur",previous:"Anterior","prev-week":"Setmana","prev-month":"Mes","prev-year":"Any",next:"Següent","next-week":"Setmana","next-month":"Mes","next-year":"Any","less-than":"El període no hauria de ser de més de %d dies","more-than":"El període no hauria de ser de menys de %d dies","default-more":"Perfavor selecciona un període més gran de %d dies","default-single":"Perfavor selecciona una data","default-less":"Perfavor selecciona un període de menys de %d dies","default-range":"Perfavor selecciona un període d'entre %d i %d dies","default-default":"Perfavor selecciona un període",time:"Temps",hour:"Hora",minute:"Minut"}},e.fn.dateRangePicker=function(a){a||(a={}),(a=e.extend(!0,{autoClose:!1,format:"YYYY-MM-DD",separator:" to ",language:"auto",startOfWeek:"sunday",getValue:function(){return e(this).val()},setValue:function(t){e(this).attr("readonly")||e(this).is(":disabled")||t==e(this).val()||e(this).val(t)},startDate:!1,endDate:!1,time:{enabled:!1},minDays:0,maxDays:0,showShortcuts:!1,shortcuts:{},customShortcuts:[],inline:!1,container:"body",customCalendar:"#add-time-period",alwaysOpen:!1,singleDate:!1,lookBehind:!1,batchMode:!1,duration:200,stickyMonths:!1,dayDivAttrs:[],dayTdAttrs:[],selectForward:!1,selectBackward:!1,applyBtnClass:"",singleMonth:"auto",hoveringTooltip:function(e,t,a){return e>1?e+" "+U("days"):""},showTopbar:!0,swapTime:!1,showWeekNumbers:!1,getWeekNumber:function(e){return t(e).format("w")},customOpenAnimation:null,customCloseAnimation:null,customArrowPrevSymbol:null,customArrowNextSymbol:null,monthSelect:!1,yearSelect:!1},a)).start=!1,a.end=!1,a.startWeek=!1,a.isTouchDevice="ontouchstart"in window||navigator.msMaxTouchPoints,a.isTouchDevice&&(a.hoveringTooltip=!1),"auto"==a.singleMonth&&(a.singleMonth=e(window).width()<480),a.singleMonth&&(a.stickyMonths=!1),a.showTopbar||(a.autoClose=!0),a.startDate&&"string"==typeof a.startDate&&(a.startDate=t(a.startDate,a.format).toDate()),a.endDate&&"string"==typeof a.endDate&&(a.endDate=t(a.endDate,a.format).toDate()),a.yearSelect&&"boolean"==typeof a.yearSelect&&(a.yearSelect=function(e){return[e-5,e+5]});var n,r,s=function(){{if("auto"==a.language){var t=navigator.language?navigator.language:navigator.browserLanguage;return t&&(t=t.toLowerCase())in e.dateRangePickerLanguages?e.dateRangePickerLanguages[t]:e.dateRangePickerLanguages.default}return a.language&&a.language in e.dateRangePickerLanguages?e.dateRangePickerLanguages[a.language]:e.dateRangePickerLanguages.default}}(),i=!1,o=this,d=e(o).get(0);return e(this).unbind(".datepicker").bind("click.datepicker",function(e){n.is(":visible")||u(a.duration)}).bind("change.datepicker",function(e){m()}).bind("keyup.datepicker",function(){try{clearTimeout(r)}catch(e){}r=setTimeout(function(){m()},2e3)}),function(){var r=this;if(e(this).data("date-picker-opened"))return void L();e(this).data("date-picker-opened",!0),(n=function(){var t,n='<div class="date-picker-wrapper';a.extraClass&&(n+=" "+a.extraClass+" "),a.singleDate&&(n+=" single-date "),a.showShortcuts||(n+=" no-shortcuts "),a.showTopbar||(n+=" no-topbar "),a.customTopBar&&(n+=" custom-topbar "),n+='">',a.showTopbar&&(n+='<div class="drp_top-bar">',a.customTopBar?("function"==typeof a.customTopBar&&(a.customTopBar=a.customTopBar()),n+='<div class="custom-top">'+a.customTopBar+"</div>"):(n+='<div class="normal-top"><span class="selection-top">'+U("selected")+' </span> <b class="start-day">...</b>',a.singleDate||(n+=' <span class="separator-day">'+a.separator+'</span> <b class="end-day">...</b> <i class="selected-days">(<span class="selected-days-num">3</span> '+U("days")+")</i>"),n+="</div>",n+='<div class="error-top">error</div><div class="default-top">default</div>'),n+='<input type="button" class="apply-btn disabled'+(t="",!0===a.autoClose&&(t+=" hide"),""!==a.applyBtnClass&&(t+=" "+a.applyBtnClass),t)+'" value="'+U("apply")+'" />',n+="</div>");var r=a.showWeekNumbers?6:5,s="&lt;";a.customArrowPrevSymbol&&(s=a.customArrowPrevSymbol);var i="&gt;";if(a.customArrowNextSymbol&&(i=a.customArrowNextSymbol),n+='<div class="month-wrapper">   <table class="month1" cellspacing="0" border="0" cellpadding="0">       <thead>           <tr class="caption">               <th>                   <span class="prev">'+s+'                   </span>               </th>               <th colspan="'+r+'" class="month-name">               </th>               <th>'+(a.singleDate||!a.stickyMonths?'<span class="next">'+i+"</span>":"")+'               </th>           </tr>           <tr class="week-name">'+$()+"       </thead>       <tbody></tbody>   </table>",a.singleMonth||(n+='<div class="gap">'+function(){for(var e=['<div class="gap-top-mask"></div><div class="gap-bottom-mask"></div><div class="gap-lines">'],t=0;t<20;t++)e.push('<div class="gap-line"><div class="gap-1"></div><div class="gap-2"></div><div class="gap-3"></div></div>');return e.push("</div>"),e.join("")}()+'</div><table class="month2" cellspacing="0" border="0" cellpadding="0">   <thead>   <tr class="caption">       <th>'+(a.stickyMonths?"":'<span class="prev">'+s+"</span>")+'       </th>       <th colspan="'+r+'" class="month-name">       </th>       <th>           <span class="next">'+i+'</span>       </th>   </tr>   <tr class="week-name">'+$()+"   </thead>   <tbody></tbody></table>"),n+='<div class="dp-clearfix"></div><div class="time"><div class="time1"></div>',a.singleDate||(n+='<div class="time2"></div>'),n+='</div><div class="dp-clearfix"></div></div>',n+='<div class="footer">',a.showShortcuts){n+='<div class="shortcuts"><b>'+U("shortcuts")+"</b>";var o=a.shortcuts;if(o){var d;if(o["prev-days"]&&o["prev-days"].length>0){n+='&nbsp;<span class="prev-days">'+U("past");for(var l=0;l<o["prev-days"].length;l++)d=o["prev-days"][l],d+=o["prev-days"][l]>1?U("days"):U("day"),n+=' <a href="javascript:;" shortcut="day,-'+o["prev-days"][l]+'">'+d+"</a>";n+="</span>"}if(o["next-days"]&&o["next-days"].length>0){n+='&nbsp;<span class="next-days">'+U("following");for(var l=0;l<o["next-days"].length;l++)d=o["next-days"][l],d+=o["next-days"][l]>1?U("days"):U("day"),n+=' <a href="javascript:;" shortcut="day,'+o["next-days"][l]+'">'+d+"</a>";n+="</span>"}if(o.prev&&o.prev.length>0){n+='&nbsp;<span class="prev-buttons">'+U("previous");for(var l=0;l<o.prev.length;l++)d=U("prev-"+o.prev[l]),n+=' <a href="javascript:;" shortcut="prev,'+o.prev[l]+'">'+d+"</a>";n+="</span>"}if(o.next&&o.next.length>0){n+='&nbsp;<span class="next-buttons">'+U("next");for(var l=0;l<o.next.length;l++)d=U("next-"+o.next[l]),n+=' <a href="javascript:;" shortcut="next,'+o.next[l]+'">'+d+"</a>";n+="</span>"}}if(a.customShortcuts)for(var l=0;l<a.customShortcuts.length;l++){var u=a.customShortcuts[l];n+='&nbsp;<span class="custom-shortcut"><a href="javascript:;" shortcut="custom">'+u.name+"</a></span>"}n+="</div>"}if(a.showCustomValues&&(n+='<div class="customValues"><b>'+(a.customValueLabel||U("custom-values"))+"</b>",a.customValues))for(var l=0;l<a.customValues.length;l++){var m=a.customValues[l];n+='&nbsp;<span class="custom-value"><a href="javascript:;" custom="'+m.value+'">'+m.name+"</a></span>"}return e(n+="</div></div>")}().hide()).append('<div class="date-range-length-tip"></div>'),e(a.customCalendar).append(n),a.inline?n.addClass("inline-wrapper"):l();a.alwaysOpen&&n.find(".apply-btn").hide();var s=Z();if(Q(s),a.time.enabled)if(a.startDate&&a.endDate||a.start&&a.end)W(t(a.start||a.startDate).toDate(),"time1"),W(t(a.end||a.endDate).toDate(),"time2");else{var o=a.defaultEndTime?a.defaultEndTime:s;W(s,"time1"),W(o,"time2")}var u="";u=a.singleDate?U("default-single"):a.minDays&&a.maxDays?U("default-range"):a.minDays?U("default-more"):a.maxDays?U("default-less"):U("default-default");n.find(".default-top").html(u.replace(/\%d/,a.minDays).replace(/\%d/,a.maxDays)),a.singleMonth?n.addClass("single-month"):n.addClass("two-months");setTimeout(function(){c(),i=!0},0),n.click(function(e){e.stopPropagation()}),e(document).bind("click.datepicker",function(t){var a,s;a=t,(s=r[0]).contains(a.target)||a.target==s||null!=s.childNodes&&e.inArray(a.target,s.childNodes)>=0||n.is(":visible")&&L()}),n.find(".next").click(function(){a.stickyMonths?function(e){var t=E(a.month1),n=E(a.month2);if(J(n))return;if(!a.singleDate&&H(t,n)>=0)return;V(t,"month1"),V(n,"month2"),P()}():function(t){var n=e(t).parents("table").hasClass("month2"),r=n?a.month2:a.month1;if(r=E(r),!a.singleMonth&&!a.singleDate&&!n&&H(r,a.month2)>=0||J(r))return;V(r,n?"month2":"month1"),B()}(this)}),n.find(".prev").click(function(){a.stickyMonths?function(e){var t=q(a.month1),n=q(a.month2);if(J(t))return;if(!a.singleDate&&H(n,t)<=0)return;V(n,"month2"),V(t,"month1"),P()}():function(t){var n=e(t).parents("table").hasClass("month2"),r=n?a.month2:a.month1;if(r=q(r),n&&H(r,a.month1)<=0||J(r))return;V(r,n?"month2":"month1"),B()}(this)}),n.attr("unselectable","on").css("user-select","none").bind("selectstart",function(e){return e.preventDefault(),!1}),n.find(".apply-btn").click(function(){L();var t=N(new Date(a.start))+a.separator+N(new Date(a.end));e(r).trigger("datepicker-apply",{value:t,date1:new Date(a.start),date2:new Date(a.end)})}),n.find("[custom]").click(function(){var t=e(this).attr("custom");a.start=!1,a.end=!1,n.find(".day.checked").removeClass("checked"),a.setValue.call(d,t),T(),C(!0),P(),a.autoClose&&L()}),n.find("[shortcut]").click(function(){var t,n=e(this).attr("shortcut"),r=new Date,s=!1;if(-1!=n.indexOf("day")){var i=parseInt(n.split(",",2)[1],10);s=new Date((new Date).getTime()+864e5*i),r=new Date(r.getTime()+864e5*(i>0?1:-1))}else if(-1!=n.indexOf("week")){var o;for(t=-1!=n.indexOf("prev,")?-1:1,o=1==t?"monday"==a.startOfWeek?1:0:"monday"==a.startOfWeek?0:6,r=new Date(r.getTime()-864e5);r.getDay()!=o;)r=new Date(r.getTime()+864e5*t);s=new Date(r.getTime()+864e5*t*6)}else if(-1!=n.indexOf("month"))t=-1!=n.indexOf("prev,")?-1:1,(s=1==t?E(r):q(r)).setDate(1),(r=E(s)).setDate(1),r=new Date(r.getTime()-864e5);else if(-1!=n.indexOf("year"))t=-1!=n.indexOf("prev,")?-1:1,(s=new Date).setFullYear(r.getFullYear()+t),s.setMonth(0),s.setDate(1),r.setFullYear(r.getFullYear()+t),r.setMonth(11),r.setDate(31);else if("custom"==n){var d=e(this).html();if(a.customShortcuts&&a.customShortcuts.length>0)for(var l=0;l<a.customShortcuts.length;l++){var u=a.customShortcuts[l];if(u.name==d){var m=[];if((m=u.dates.call())&&2==m.length&&(s=m[0],r=m[1]),m&&1==m.length){var h=m[0];V(h,"month1"),V(E(h),"month2"),B()}break}}}s&&r&&(j(s,r),T())}),n.find(".time1 input[type=range]").bind("change touchmove",function(t){var a=t.target,n="hour"==a.name?e(a).val().replace(/^(\d{1})$/,"0$1"):void 0,r="minute"==a.name?e(a).val().replace(/^(\d{1})$/,"0$1"):void 0;v("time1",n,r)}),n.find(".time2 input[type=range]").bind("change touchmove",function(t){var a=t.target,n="hour"==a.name?e(a).val().replace(/^(\d{1})$/,"0$1"):void 0,r="minute"==a.name?e(a).val().replace(/^(\d{1})$/,"0$1"):void 0;v("time2",n,r)})}.call(this),a.alwaysOpen&&u(0),e(this).data("dateRangePicker",{setStart:function(e){return"string"==typeof e&&(e=t(e,a.format).toDate()),a.end=!1,z(e),this},setEnd:function(e,n){var r=new Date;return r.setTime(a.start),"string"==typeof e&&(e=t(e,a.format).toDate()),j(r,e,n),this},setDateRange:function(e,n,r){"string"==typeof e&&"string"==typeof n&&(e=t(e,a.format).toDate(),n=t(n,a.format).toDate()),j(e,n,r)},clear:function(){a.start=!1,a.end=!1,n.find(".day.checked").removeClass("checked"),n.find(".day.last-date-selected").removeClass("last-date-selected"),n.find(".day.first-date-selected").removeClass("first-date-selected"),a.setValue.call(d,""),T(),C(),P()},close:L,open:u,redraw:F,getDatePicker:function(){return n},resetMonthsView:Q,destroy:function(){e(o).unbind(".datepicker"),e(o).data("dateRangePicker",""),e(o).data("date-picker-opened",null),n.remove(),e(window).unbind("resize.datepicker",l),e(document).unbind("click.datepicker",L)}}),e(window).bind("resize.datepicker",l),this;function l(){a.inline}function u(t){F(),m(),a.customOpenAnimation?a.customOpenAnimation.call(n.get(0),function(){e(o).trigger("datepicker-opened",{relatedTarget:n})}):n.slideDown(t,function(){e(o).trigger("datepicker-opened",{relatedTarget:n})}),e(o).trigger("datepicker-open",{relatedTarget:n}),B(),c(),l()}function m(){var e=a.getValue.call(d),n=e?e.split(a.separator):"";if(n&&(1==n.length&&a.singleDate||n.length>=2)){var r=a.format;r.match(/Do/)&&(r=r.replace(/Do/,"D"),n[0]=n[0].replace(/(\d+)(th|nd|st)/,"$1"),n.length>=2&&(n[1]=n[1].replace(/(\d+)(th|nd|st)/,"$1"))),i=!1,n.length>=2?j(h(n[0],r,t.locale(a.language)),h(n[1],r,t.locale(a.language))):1==n.length&&a.singleDate&&z(h(n[0],r,t.locale(a.language))),i=!0}}function h(e,a,n){return t(e,a,n).isValid()?t(e,a,n).toDate():t().toDate()}function c(){var e=n.find(".gap").css("margin-left");e&&(e=parseInt(e));var t=n.find(".month1").width(),a=n.find(".gap").width()+(e?2*e:0),r=n.find(".month2").width();n.find(".month-wrapper").width(t+a+r)}function p(e,a){n.find("."+e+" input[type=range].hour-range").val(t(a).hours()),n.find("."+e+" input[type=range].minute-range").val(t(a).minutes()),v(e,t(a).format("HH"),t(a).format("mm"))}function f(e,n){a[e]=parseInt(t(parseInt(n)).startOf("day").add(t(a[e+"Time"]).format("HH"),"h").add(t(a[e+"Time"]).format("mm"),"m").valueOf())}function v(e,r,s){switch(r&&n.find("."+e+" .hour-val").text(r),s&&n.find("."+e+" .minute-val").text(s),e){case"time1":a.start&&i("start",t(a.start)),i("startTime",t(a.startTime||t().valueOf()));break;case"time2":a.end&&i("end",t(a.end)),i("endTime",t(a.endTime||t().valueOf()))}function i(e,t){var n=t.format("HH"),i=t.format("mm");a[e]=t.startOf("day").add(r||n,"h").add(s||i,"m").valueOf()}T(),C(),P()}function g(e){var n=e;return"week-range"===a.batchMode?n="monday"===a.startOfWeek?t(parseInt(e)).startOf("isoweek").valueOf():t(parseInt(e)).startOf("week").valueOf():"month-range"===a.batchMode&&(n=t(parseInt(e)).startOf("month").valueOf()),n}function k(e){var n=e;return"week-range"===a.batchMode?n="monday"===a.startOfWeek?t(parseInt(e)).endOf("isoweek").valueOf():t(parseInt(e)).endOf("week").valueOf():"month-range"===a.batchMode&&(n=t(parseInt(e)).endOf("month").valueOf()),n}function w(n){if(!n.hasClass("invalid")){var r=n.attr("time");if(n.addClass("checked"),a.singleDate?(a.start=r,a.end=!1):"week"===a.batchMode?"monday"===a.startOfWeek?(a.start=t(parseInt(r)).startOf("isoweek").valueOf(),a.end=t(parseInt(r)).endOf("isoweek").valueOf()):(a.end=t(parseInt(r)).endOf("week").valueOf(),a.start=t(parseInt(r)).startOf("week").valueOf()):"workweek"===a.batchMode?(a.start=t(parseInt(r)).day(1).valueOf(),a.end=t(parseInt(r)).day(5).valueOf()):"weekend"===a.batchMode?(a.start=t(parseInt(r)).day(6).valueOf(),a.end=t(parseInt(r)).day(7).valueOf()):"month"===a.batchMode?(a.start=t(parseInt(r)).startOf("month").valueOf(),a.end=t(parseInt(r)).endOf("month").valueOf()):a.start&&a.end||!a.start&&!a.end?(a.start=g(r),a.end=!1):a.start&&(a.end=k(r),a.time.enabled&&f("end",a.end)),a.time.enabled&&(a.start&&f("start",a.start),a.end&&f("end",a.end)),!a.singleDate&&a.start&&a.end&&a.start>a.end){var s=a.end;a.end=k(a.start),a.start=g(s),a.time.enabled&&a.swapTime&&(p("time1",a.start),p("time2",a.end))}a.start=parseInt(a.start),a.end=parseInt(a.end),x(),a.start&&!a.end&&(e(o).trigger("datepicker-first-date-selected",{date1:new Date(a.start)}),D(n)),b(),T(),C(),P(),S()}}function y(e){if(e=parseInt(e,10),a.startDate&&R(e,a.startDate)<0)return!1;if(a.endDate&&R(e,a.endDate)>0)return!1;if(a.start&&!a.end&&!a.singleDate){if(a.maxDays>0&&O(e,a.start)>a.maxDays)return!1;if(a.minDays>0&&O(e,a.start)<a.minDays)return!1;if(a.selectForward&&e<a.start)return!1;if(a.selectBackward&&e>a.start)return!1;if(a.beforeShowDay&&"function"==typeof a.beforeShowDay){for(var t=!0,n=e;O(n,a.start)>1;){if(!a.beforeShowDay(new Date(n))[0]){t=!1;break}if(Math.abs(n-a.start)<864e5)break;n>a.start&&(n-=864e5),n<a.start&&(n+=864e5)}if(!t)return!1}}return!0}function b(){return n.find(".day.invalid.tmp").removeClass("tmp invalid").addClass("valid"),a.start&&!a.end&&n.find(".day.toMonth.valid").each(function(){y(parseInt(e(this).attr("time"),10))?e(this).addClass("valid tmp").removeClass("invalid"):e(this).addClass("invalid tmp").removeClass("valid")}),!0}function D(t){var r=parseInt(t.attr("time")),s="";if(t.hasClass("has-tooltip")&&t.attr("data-tooltip"))s='<span class="tooltip-content">'+t.attr("data-tooltip")+"</span>";else if(!t.hasClass("invalid"))if(a.singleDate)n.find(".day.hovering").removeClass("hovering"),t.addClass("hovering");else if(n.find(".day").each(function(){var t=parseInt(e(this).attr("time"));a.start,a.end;t==r?e(this).addClass("hovering"):e(this).removeClass("hovering"),a.start&&!a.end&&(a.start<t&&r>=t||a.start>t&&r<=t)?e(this).addClass("hovering"):e(this).removeClass("hovering")}),a.start&&!a.end){var i=O(r,a.start);a.hoveringTooltip&&("function"==typeof a.hoveringTooltip?s=a.hoveringTooltip(i,a.start,r):!0===a.hoveringTooltip&&i>1&&(s=i+" "+U("days")))}if(s){var o=t.offset(),d=n.offset(),l=o.left-d.left,u=o.top-d.top;l+=t.width()/2;var m=n.find(".date-range-length-tip"),h=m.css({visibility:"hidden",display:"none"}).html(s).width(),c=m.height();l-=h/2,u-=c,setTimeout(function(){m.css({left:l,top:u,display:"block",visibility:"visible"})},10)}else n.find(".date-range-length-tip").hide()}function x(){n.find(".day.hovering").removeClass("hovering"),n.find(".date-range-length-tip").hide()}function M(e){var n=e.val(),r=e.attr("name"),s=e.parents("table").hasClass("month1")?"month1":"month2",i="month1"===s?"month2":"month1",o=!!a.startDate&&t(a.startDate),d=!!a.endDate&&t(a.endDate),l=t(a[s])[r](n);o&&l.isSameOrBefore(o)&&(l=o.add("month2"===s?1:0,"month")),d&&l.isSameOrAfter(d)&&(l=d.add(a.singleMonth||"month1"!==s?0:-1,"month")),V(l,s),"month1"===s?(a.stickyMonths||t(l).isSameOrAfter(a[i],"month"))&&V(t(l).add(1,"month"),i):(a.stickyMonths||t(l).isSameOrBefore(a[i],"month"))&&V(t(l).add(-1,"month"),i),B()}function S(){!0===a.singleDate?i&&a.start&&a.autoClose&&L():i&&a.start&&a.end&&a.autoClose&&L()}function T(){var e=Math.ceil((a.end-a.start)/864e5)+1;a.singleDate?a.start&&!a.end?n.find(".drp_top-bar").removeClass("error").addClass("normal"):n.find(".drp_top-bar").removeClass("error").removeClass("normal"):a.maxDays&&e>a.maxDays?(a.start=!1,a.end=!1,n.find(".day").removeClass("checked"),n.find(".drp_top-bar").removeClass("normal").addClass("error").find(".error-top").html(U("less-than").replace("%d",a.maxDays))):a.minDays&&e<a.minDays?(a.start=!1,a.end=!1,n.find(".day").removeClass("checked"),n.find(".drp_top-bar").removeClass("normal").addClass("error").find(".error-top").html(U("more-than").replace("%d",a.minDays))):a.start||a.end?n.find(".drp_top-bar").removeClass("error").addClass("normal"):n.find(".drp_top-bar").removeClass("error").removeClass("normal"),a.singleDate&&a.start&&!a.end||!a.singleDate&&a.start&&a.end?n.find(".apply-btn").removeClass("disabled"):n.find(".apply-btn").addClass("disabled"),a.batchMode&&(a.start&&a.startDate&&R(a.start,a.startDate)<0||a.end&&a.endDate&&R(a.end,a.endDate)>0)&&(a.start=!1,a.end=!1,n.find(".day").removeClass("checked"))}function C(t,r){var s;n.find(".start-day").html("..."),n.find(".end-day").html("..."),n.find(".selected-days").hide(),a.start&&n.find(".start-day").html(N(new Date(parseInt(a.start)))),a.end&&n.find(".end-day").html(N(new Date(parseInt(a.end)))),a.start&&a.singleDate?(n.find(".apply-btn").removeClass("disabled"),s=N(new Date(a.start)),a.setValue.call(d,s,N(new Date(a.start)),N(new Date(a.end))),i&&!r&&e(o).trigger("datepicker-change",{value:s,date1:new Date(a.start)})):a.start&&a.end?(n.find(".selected-days").show().find(".selected-days-num").html(O(a.end,a.start)),n.find(".apply-btn").removeClass("disabled"),s=N(new Date(a.start))+a.separator+N(new Date(a.end)),a.setValue.call(d,s,N(new Date(a.start)),N(new Date(a.end))),i&&!r&&e(o).trigger("datepicker-change",{value:s,date1:new Date(a.start),date2:new Date(a.end)})):t?n.find(".apply-btn").removeClass("disabled"):n.find(".apply-btn").addClass("disabled")}function O(e,t){return Math.abs(_(e)-_(t))+1}function j(e,t,n){if(e.getTime()>t.getTime()){var r=t;t=e,e=r,r=null}var s=!0;if(a.startDate&&R(e,a.startDate)<0&&(s=!1),a.endDate&&R(t,a.endDate)>0&&(s=!1),!s)return V(a.startDate,"month1"),V(E(a.startDate),"month2"),void B();a.start=e.getTime(),a.end=t.getTime(),a.time.enabled&&(p("time1",e),p("time2",t)),(a.stickyMonths||R(e,t)>0&&0===H(e,t))&&(a.lookBehind?e=q(t):t=E(e)),a.stickyMonths&&!1!==a.endDate&&H(t,a.endDate)>0&&(e=q(e),t=q(t)),a.stickyMonths||0===H(e,t)&&(a.lookBehind?e=q(t):t=E(e)),V(e,"month1"),V(t,"month2"),B(),T(),C(!1,n),S()}function z(e){var t=!0;if(a.startDate&&R(e,a.startDate)<0&&(t=!1),a.endDate&&R(e,a.endDate)>0&&(t=!1),t){if(a.start=e.getTime(),a.time.enabled&&p("time1",e),V(e,"month1"),!0!==a.singleMonth)V(E(e),"month2");B(),C(),S()}else V(a.startDate,"month1")}function P(){(a.start||a.end)&&(n.find(".day").each(function(){var n=parseInt(e(this).attr("time")),r=a.start,s=a.end;a.time.enabled&&(n=t(n).startOf("day").valueOf(),r=t(r||t().valueOf()).startOf("day").valueOf(),s=t(s||t().valueOf()).startOf("day").valueOf()),a.start&&a.end&&s>=n&&r<=n||a.start&&!a.end&&t(r).format("YYYY-MM-DD")==t(n).format("YYYY-MM-DD")?e(this).addClass("checked"):e(this).removeClass("checked"),a.start&&t(r).format("YYYY-MM-DD")==t(n).format("YYYY-MM-DD")?e(this).addClass("first-date-selected"):e(this).removeClass("first-date-selected"),a.end&&t(s).format("YYYY-MM-DD")==t(n).format("YYYY-MM-DD")?e(this).addClass("last-date-selected"):e(this).removeClass("last-date-selected")}),n.find(".week-number").each(function(){e(this).attr("data-start-time")==a.startWeek&&e(this).addClass("week-number-selected")}))}function V(r,s){var i=function(e,n){var r,s=!!a.startDate&&t(a.startDate).add(a.singleMonth||"month2"!==n?0:1,"month"),i=!!a.endDate&&t(a.endDate).add(a.singleMonth||"month1"!==n?0:-1,"month");if(e=t(e),!a.monthSelect||s&&i&&s.isSame(i,"month"))return'<div class="month-element">'+I(e.get("month"))+"</div>";if((r=[s&&e.isSame(s,"year")?s.get("month"):0,i&&e.isSame(i,"year")?i.get("month"):11])[0]===r[1])return'<div class="month-element">'+I(e.get("month"))+"</div>";return A("month",Y(r,e.get("month"),function(e){return I(e)}))}(r=t(r).toDate(),s),o=function(e,n){e=t(e);var r,s=!!a.startDate&&t(a.startDate).add(a.singleMonth||"month2"!==n?0:1,"month"),i=!!a.endDate&&t(a.endDate).add(a.singleMonth||"month1"!==n?0:-1,"month"),o=e.get("year"),d=a.yearSelect&&"function"==typeof a.yearSelect;if(!a.yearSelect||s&&i&&s.isSame(t(i),"year"))return'<div class="month-element">'+o+"</div>";return r=d?a.yearSelect(o):a.yearSelect.slice(),A("year",Y(r=[s?Math.max(r[0],s.get("year")):Math.min(r[0],o),i?Math.min(r[1],i.get("year")):Math.max(r[1],o)],o))}(r,s);n.find("."+s+" .month-name").html(o+" "+i),n.find("."+s+" tbody").html(function(e){var n=[];e.setDate(1);new Date(e.getTime()-864e5);var r,s,i=new Date,o=e.getDay();0===o&&"monday"===a.startOfWeek&&(o=7);if(o>0)for(var d=o;d>0;d--){var l=new Date(e.getTime()-864e5*d);s=y(l.getTime()),a.startDate&&R(l,a.startDate)<0&&(s=!1),a.endDate&&R(l,a.endDate)>0&&(s=!1),n.push({date:l,type:"lastMonth",day:l.getDate(),time:l.getTime(),valid:s})}for(var u=e.getMonth(),d=0;d<40;d++)r=t(e).add(d,"days").toDate(),s=y(r.getTime()),a.startDate&&R(r,a.startDate)<0&&(s=!1),a.endDate&&R(r,a.endDate)>0&&(s=!1),n.push({date:r,type:r.getMonth()==u?"toMonth":"nextMonth",day:r.getDate(),time:r.getTime(),valid:s});for(var m=[],h=0;h<6&&"nextMonth"!=n[7*h].type;h++){m.push("<tr>");for(var l=0;l<7;l++){var c="monday"==a.startOfWeek?l+1:l;r=n[7*h+c];var p=t(r.time).format("L")==t(i).format("L");if(r.extraClass="",r.tooltip="",r.valid&&a.beforeShowDay&&"function"==typeof a.beforeShowDay){var f=a.beforeShowDay(t(r.time).toDate());r.valid=f[0],r.extraClass=f[1]||"",r.tooltip=f[2]||"",""!==r.tooltip&&(r.extraClass+=" has-tooltip ")}var v={time:r.time,"data-tooltip":r.tooltip,class:"day "+r.type+" "+r.extraClass+" "+(r.valid?"valid":"invalid")+" "+(p?"real-today":"")};0===l&&a.showWeekNumbers&&m.push('<td><div class="week-number" data-start-time="'+r.time+'">'+a.getWeekNumber(r.date)+"</div></td>"),m.push("<td "+K({},a.dayTdAttrs,r)+"><div "+K(v,a.dayDivAttrs,r)+">"+G(r.time,r.day)+"</div></td>")}m.push("</tr>")}return m.join("")}(r)),a[s]=r,b(),n.find(".day").unbind("click").click(function(t){w(e(this))}),n.find(".day").unbind("mouseenter").mouseenter(function(t){D(e(this))}),n.find(".day").unbind("mouseleave").mouseleave(function(e){n.find(".date-range-length-tip").hide(),a.singleDate&&x()}),n.find(".week-number").unbind("click").click(function(r){var s,i,o,d;s=e(this),d=parseInt(s.attr("data-start-time"),10),a.startWeek?(n.find(".week-number-selected").removeClass("week-number-selected"),i=new Date(d<a.startWeek?d:a.startWeek),o=new Date(d<a.startWeek?a.startWeek:d),a.startWeek=!1,a.start=t(i).day("monday"==a.startOfWeek?1:0).valueOf(),a.end=t(o).day("monday"==a.startOfWeek?7:6).valueOf()):(a.startWeek=d,s.addClass("week-number-selected"),i=new Date(d),a.start=t(i).day("monday"==a.startOfWeek?1:0).valueOf(),a.end=t(i).day("monday"==a.startOfWeek?7:6).valueOf()),b(),T(),C(),P(),S()}),n.find(".month").unbind("change").change(function(t){M(e(this))}),n.find(".year").unbind("change").change(function(t){M(e(this))})}function Y(e,t,a){var n=[];a=a||function(e){return e};for(var r=e[0];r<=e[1];r++)n.push({value:r,text:a(r),isCurrent:r===t});return n}function A(e,t){for(var a,n='<div class="select-wrapper"><select class="'+e+'" name="'+e+'">',r=0,s=t.length;r<s;r++)n+='<option value="'+t[r].value+'"'+(t[r].isCurrent?" selected":"")+">",n+=t[r].text,n+="</option>",t[r].isCurrent&&(a=t[r].text);return n+="</select>"+a+"</div>"}function W(e,t){n.find("."+t).append("<div><span>"+U("Time")+': <span class="hour-val">00</span>:<span class="minute-val">00</span></span></div><div class="hour"><label>'+U("Hour")+': <input type="range" class="hour-range" name="hour" min="0" max="23"></label></div><div class="minute"><label>'+U("Minute")+': <input type="range" class="minute-range" name="minute" min="0" max="59"></label></div>'),p(t,e)}function I(e){return U("month-name")[e]}function N(e){return t(e).format(a.format)}function B(){P();var e=parseInt(t(a.month1).format("YYYYMM")),r=parseInt(t(a.month2).format("YYYYMM")),s=Math.abs(e-r);s>1&&89!=s?n.addClass("has-gap").removeClass("no-gap").find(".gap").css("visibility","visible"):n.removeClass("has-gap").addClass("no-gap").find(".gap").css("visibility","hidden");var i=n.find("table.month1").height(),o=n.find("table.month2").height();n.find(".gap").height(Math.max(i,o)+10)}function L(){if(!a.alwaysOpen){var t=function(){e(o).data("date-picker-opened",!1),e(o).trigger("datepicker-closed",{relatedTarget:n})};a.customCloseAnimation?a.customCloseAnimation.call(n.get(0),t):e(n).slideUp(a.duration,t),e(o).trigger("datepicker-close",{relatedTarget:n})}}function F(){V(a.month1,"month1"),V(a.month2,"month2")}function H(e,a){var n=parseInt(t(e).format("YYYYMM"))-parseInt(t(a).format("YYYYMM"));return n>0?1:0===n?0:-1}function R(e,a){var n=parseInt(t(e).format("YYYYMMDD"))-parseInt(t(a).format("YYYYMMDD"));return n>0?1:0===n?0:-1}function E(e){return t(e).add(1,"months").toDate()}function q(e){return t(e).add(-1,"months").toDate()}function $(){var e=a.showWeekNumbers?"<th>"+U("week-number")+"</th>":"";return"monday"==a.startOfWeek?e+"<th>"+U("week-1")+"</th><th>"+U("week-2")+"</th><th>"+U("week-3")+"</th><th>"+U("week-4")+"</th><th>"+U("week-5")+"</th><th>"+U("week-6")+"</th><th>"+U("week-7")+"</th>":e+"<th>"+U("week-7")+"</th><th>"+U("week-1")+"</th><th>"+U("week-2")+"</th><th>"+U("week-3")+"</th><th>"+U("week-4")+"</th><th>"+U("week-5")+"</th><th>"+U("week-6")+"</th>"}function J(e){return e=t(e),!(!a.startDate||!e.endOf("month").isBefore(a.startDate))||!(!a.endDate||!e.startOf("month").isAfter(a.endDate))}function K(t,a,n){var r=e.extend(!0,{},t);e.each(a,function(e,t){var a=t(n);for(var s in a)r.hasOwnProperty(s)?r[s]+=a[s]:r[s]=a[s]});var s="";for(var i in r)r.hasOwnProperty(i)&&(s+=i+'="'+r[i]+'" ');return s}function _(e){return Math.floor(function(e){t.isMoment(e)&&(e=e.toDate().getTime());"object"==typeof e&&e.getTime&&(e=e.getTime());"string"!=typeof e||e.match(/\d{13}/)||(e=t(e,a.format).toDate().getTime());return e=parseInt(e,10)-60*(new Date).getTimezoneOffset()*1e3}(e)/864e5)}function G(e,t){return a.showDateFilter&&"function"==typeof a.showDateFilter?a.showDateFilter(e,t):t}function U(t){var a=t.toLowerCase(),n=t in s?s[t]:a in s?s[a]:null,r=e.dateRangePickerLanguages.default;return null==n&&(n=t in r?r[t]:a in r?r[a]:""),n}function Z(){var e=a.defaultTime?a.defaultTime:new Date;return a.lookBehind?(a.startDate&&H(e,a.startDate)<0&&(e=E(t(a.startDate).toDate())),a.endDate&&H(e,a.endDate)>0&&(e=t(a.endDate).toDate())):(a.startDate&&H(e,a.startDate)<0&&(e=t(a.startDate).toDate()),a.endDate&&H(E(e),a.endDate)>0&&(e=q(t(a.endDate).toDate()))),a.singleDate&&(a.startDate&&H(e,a.startDate)<0&&(e=t(a.startDate).toDate()),a.endDate&&H(e,a.endDate)>0&&(e=t(a.endDate).toDate())),e}function Q(e){e||(e=Z()),a.lookBehind?(V(q(e),"month1"),V(e,"month2")):(V(e,"month1"),V(E(e),"month2")),a.singleDate&&V(e,"month1"),P(),B()}}});