require-frontend.min.js 342 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708
  1. /*! jQuery v2.2.4 | (c) jQuery Foundation | jquery.org/license */
  2. !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c;
  3. }catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ca(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Fa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ba.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Oa(a,b,c||(g?"border":"content"),d,f)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),
  4. void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(hb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,ib.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b)}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var jb=a.location,kb=n.now(),lb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb={},tb={},ub="*/".concat("*"),vb=d.createElement("a");vb.href=jb.href;function wb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function xb(a,b,c,d){var e={},f=a===tb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function yb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function zb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Ab(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jb.href,type:"GET",isLocal:pb.test(jb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ub,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?yb(yb(a,n.ajaxSettings),b):yb(n.ajaxSettings,a)},ajaxPrefilter:wb(sb),ajaxTransport:wb(tb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=ob.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||jb.href)+"").replace(mb,"").replace(rb,jb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=vb.protocol+"//"+vb.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),xb(sb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!qb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(lb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=nb.test(f)?f.replace(nb,"$1_="+kb++):f+(lb.test(f)?"&":"?")+"_="+kb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+ub+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=xb(tb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=zb(m,x,d)),u=Ab(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Bb=/%20/g,Cb=/\[\]$/,Db=/\r?\n/g,Eb=/^(?:submit|button|image|reset|file)$/i,Fb=/^(?:input|select|textarea|keygen)/i;function Gb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Cb.test(a)?d(a,e):Gb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Gb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Gb(c,a[c],b,e);return d.join("&").replace(Bb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Fb.test(this.nodeName)&&!Eb.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Db,"\r\n")}}):{name:b.name,value:c.replace(Db,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Hb={0:200,1223:204},Ib=n.ajaxSettings.xhr();l.cors=!!Ib&&"withCredentials"in Ib,l.ajax=Ib=!!Ib,n.ajaxTransport(function(b){var c,d;return l.cors||Ib&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Hb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Jb=[],Kb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Jb.pop()||n.expando+"_"+kb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Kb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Kb,"$1"+e):b.jsonp!==!1&&(b.url+=(lb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Jb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Lb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Lb)return Lb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Mb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Mb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Mb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Nb=a.jQuery,Ob=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Ob),b&&a.jQuery===n&&(a.jQuery=Nb),n},b||(a.jQuery=a.$=n),n});
  5. /*!
  6. * Bootstrap v3.4.1 (https://getbootstrap.com/)
  7. * Copyright 2011-2019 Twitter, Inc.
  8. * Licensed under the MIT license
  9. */
  10. if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function o(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";var e='[data-dismiss="alert"]',a=function(t){s(t).on("click",e,this.close)};a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.close=function(t){var e=s(this),i=e.attr("data-target");i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=e.closest(".alert")),o.trigger(t=s.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),s.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function o(i){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new a(this)),"string"==typeof i&&e[i].call(t)})},s.fn.alert.Constructor=a,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery),function(s){"use strict";var n=function(t,e){this.$element=s(t),this.options=s.extend({},n.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new n(this,i)),"toggle"==o?e.toggle():o&&e.setState(o)})}n.VERSION="3.4.1",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",null==n.resetText&&i.data("resetText",i[o]()),setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=s.fn.button;s.fn.button=i,s.fn.button.Constructor=n,s.fn.button.noConflict=function(){return s.fn.button=t,this},s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=s(t.target).closest(".btn");i.call(e,"toggle"),s(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){s(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(p){"use strict";var c=function(t,e){this.$element=p(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=e,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",p.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",p.proxy(this.pause,this)).on("mouseleave.bs.carousel",p.proxy(this.cycle,this))};function r(n){return this.each(function(){var t=p(this),e=t.data("bs.carousel"),i=p.extend({},c.DEFAULTS,t.data(),"object"==typeof n&&n),o="string"==typeof n?n:i.slide;e||t.data("bs.carousel",e=new c(this,i)),"number"==typeof n?e.to(n):o?e[o]():i.interval&&e.pause().cycle()})}c.VERSION="3.4.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},c.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(p.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},c.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var o=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(o)},c.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i<t?"next":"prev",this.$items.eq(t))},c.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&p.support.transition&&(this.$element.trigger(p.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(t,e){var i=this.$element.find(".item.active"),o=e||this.getItemForDirection(t,i),n=this.interval,s="next"==t?"left":"right",a=this;if(o.hasClass("active"))return this.sliding=!1;var r=o[0],l=p.Event("slide.bs.carousel",{relatedTarget:r,direction:s});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=p(this.$indicators.children()[this.getItemIndex(o)]);h&&h.addClass("active")}var d=p.Event("slid.bs.carousel",{relatedTarget:r,direction:s});return p.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([t,s].join(" ")).addClass("active"),i.removeClass(["active",s].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger(d)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(d)),n&&this.cycle(),this}};var t=p.fn.carousel;p.fn.carousel=r,p.fn.carousel.Constructor=c,p.fn.carousel.noConflict=function(){return p.fn.carousel=t,this};var e=function(t){var e=p(this),i=e.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=e.attr("data-target")||i,n=p(document).find(o);if(n.hasClass("carousel")){var s=p.extend({},n.data(),e.data()),a=e.attr("data-slide-to");a&&(s.interval=!1),r.call(n,s),a&&n.data("bs.carousel").to(a),t.preventDefault()}};p(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),p(window).on("load",function(){p('[data-ride="carousel"]').each(function(){var t=p(this);r.call(t,t.data())})})}(jQuery),function(a){"use strict";var r=function(t,e){this.$element=a(t),this.options=a.extend({},r.DEFAULTS,e),this.$trigger=a('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var e,i=t.attr("data-target")||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return a(document).find(i)}function l(o){return this.each(function(){var t=a(this),e=t.data("bs.collapse"),i=a.extend({},r.DEFAULTS,t.data(),"object"==typeof o&&o);!e&&i.toggle&&/show|hide/.test(o)&&(i.toggle=!1),e||t.data("bs.collapse",e=new r(this,i)),"string"==typeof o&&e[o]()})}r.VERSION="3.4.1",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(t=e.data("bs.collapse"))&&t.transitioning)){var i=a.Event("show.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){e&&e.length&&(l.call(e,"hide"),t||e.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var n=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return n.call(this);var s=a.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",a.proxy(n,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][s])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=a.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!a.support.transition)return i.call(this);this.$element[e](0).one("bsTransitionEnd",a.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return a(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(t,e){var i=a(e);this.addAriaAndCollapsedClass(n(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var t=a.fn.collapse;a.fn.collapse=l,a.fn.collapse.Constructor=r,a.fn.collapse.noConflict=function(){return a.fn.collapse=t,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=a(this);e.attr("data-target")||t.preventDefault();var i=n(e),o=i.data("bs.collapse")?"toggle":e.data();l.call(i,o)})}(jQuery),function(a){"use strict";var r='[data-toggle="dropdown"]',o=function(t){a(t).on("click.bs.dropdown",this.toggle)};function l(t){var e=t.attr("data-target");e||(e=(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==e?a(document).find(e):null;return i&&i.length?i:t.parent()}function s(o){o&&3===o.which||(a(".dropdown-backdrop").remove(),a(r).each(function(){var t=a(this),e=l(t),i={relatedTarget:this};e.hasClass("open")&&(o&&"click"==o.type&&/input|textarea/i.test(o.target.tagName)&&a.contains(e[0],o.target)||(e.trigger(o=a.Event("hide.bs.dropdown",i)),o.isDefaultPrevented()||(t.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",i)))))}))}o.VERSION="3.4.1",o.prototype.toggle=function(t){var e=a(this);if(!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(s(),!o){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",s);var n={relatedTarget:this};if(i.trigger(t=a.Event("show.bs.dropdown",n)),t.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(a.Event("shown.bs.dropdown",n))}return!1}},o.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var e=a(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(!o&&27!=t.which||o&&27==t.which)return 27==t.which&&i.find(r).trigger("focus"),e.trigger("click");var n=i.find(".dropdown-menu li:not(.disabled):visible a");if(n.length){var s=n.index(t.target);38==t.which&&0<s&&s--,40==t.which&&s<n.length-1&&s++,~s||(s=0),n.eq(s).trigger("focus")}}}};var t=a.fn.dropdown;a.fn.dropdown=function e(i){return this.each(function(){var t=a(this),e=t.data("bs.dropdown");e||t.data("bs.dropdown",e=new o(this)),"string"==typeof i&&e[i].call(t)})},a.fn.dropdown.Constructor=o,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=t,this},a(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",r,o.prototype.toggle).on("keydown.bs.dropdown.data-api",r,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),function(a){"use strict";var s=function(t,e){this.options=e,this.$body=a(document.body),this.$element=a(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function r(o,n){return this.each(function(){var t=a(this),e=t.data("bs.modal"),i=a.extend({},s.DEFAULTS,t.data(),"object"==typeof o&&o);e||t.data("bs.modal",e=new s(this,i)),"string"==typeof o?e[o](n):i.show&&e.show(n)})}s.VERSION="3.4.1",s.TRANSITION_DURATION=300,s.BACKDROP_TRANSITION_DURATION=150,s.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},s.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},s.prototype.show=function(i){var o=this,t=a.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(t),this.isShown||t.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(t){a(t.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var t=a.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),t&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:i});t?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(s.TRANSITION_DURATION):o.$element.trigger("focus").trigger(e)}))},s.prototype.hide=function(t){t&&t.preventDefault(),t=a.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(s.TRANSITION_DURATION):this.hideModal())},s.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},s.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},s.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},s.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},s.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},s.prototype.backdrop=function(t){var e=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=a.support.transition&&i;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var n=function(){e.removeBackdrop(),t&&t()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):n()}else t&&t()},s.prototype.handleUpdate=function(){this.adjustDialog()},s.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},s.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),a(this.fixedContent).each(function(t,e){var i=e.style.paddingRight,o=a(e).css("padding-right");a(e).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))},s.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),a(this.fixedContent).each(function(t,e){var i=a(e).data("padding-right");a(e).removeData("padding-right"),e.style.paddingRight=i||""})},s.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var t=a.fn.modal;a.fn.modal=r,a.fn.modal.Constructor=s,a.fn.modal.noConflict=function(){return a.fn.modal=t,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var e=a(this),i=e.attr("href"),o=e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),n=a(document).find(o),s=n.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(i)&&i},n.data(),e.data());e.is("a")&&t.preventDefault(),n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){e.is(":visible")&&e.trigger("focus")})}),r.call(n,s,this)})}(jQuery),function(g){"use strict";var o=["sanitize","whiteList","sanitizeFn"],a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],t={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function u(t,e){var i=t.nodeName.toLowerCase();if(-1!==g.inArray(i,e))return-1===g.inArray(i,a)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(l));for(var o=g(e).filter(function(t,e){return e instanceof RegExp}),n=0,s=o.length;n<s;n++)if(i.match(o[n]))return!0;return!1}function n(t,e,i){if(0===t.length)return t;if(i&&"function"==typeof i)return i(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var o=document.implementation.createHTMLDocument("sanitization");o.body.innerHTML=t;for(var n=g.map(e,function(t,e){return e}),s=g(o.body).find("*"),a=0,r=s.length;a<r;a++){var l=s[a],h=l.nodeName.toLowerCase();if(-1!==g.inArray(h,n))for(var d=g.map(l.attributes,function(t){return t}),p=[].concat(e["*"]||[],e[h]||[]),c=0,f=d.length;c<f;c++)u(d[c],p)||l.removeAttribute(d[c].nodeName);else l.parentNode.removeChild(l)}return o.body.innerHTML}var m=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};m.VERSION="3.4.1",m.TRANSITION_DURATION=150,m.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:t},m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t},m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}},m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent(),o.attr("id",n),this.$element.attr("aria-describedby",n),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-d<c.top?"bottom":"right"==s&&l.right+h>c.width?"left":"left"==s&&l.left-h<c.left?"right":s,o.removeClass(p).addClass(s)}var f=this.getCalculatedOffset(s,l,h,d);this.applyPlacement(f,s);var u=function(){var t=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==t&&i.leave(i)};g.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",u).emulateTransitionEnd(m.TRANSITION_DURATION):u()}},m.prototype.applyPlacement=function(t,e){var i=this.tip(),o=i[0].offsetWidth,n=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(a)&&(a=0),t.top+=s,t.left+=a,g.offset.setOffset(i[0],g.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},t),0),i.addClass("in");var r=i[0].offsetWidth,l=i[0].offsetHeight;"top"==e&&l!=n&&(t.top=t.top+n-l);var h=this.getViewportAdjustedDelta(e,t,r,l);h.left?t.left+=h.left:t.top+=h.top;var d=/top|bottom/.test(e),p=d?2*h.left-o+r:2*h.top-n+l,c=d?"offsetWidth":"offsetHeight";i.offset(t),this.replaceArrow(p,i[0][c],d)},m.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},m.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();this.options.html?(this.options.sanitize&&(e=n(e,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(e)):t.find(".tooltip-inner").text(e),t.removeClass("fade in top bottom left right")},m.prototype.hide=function(t){var e=this,i=g(this.$tip),o=g.Event("hide.bs."+this.type);function n(){"in"!=e.hoverState&&i.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),t&&t()}if(this.$element.trigger(o),!o.isDefaultPrevented())return i.removeClass("in"),g.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",n).emulateTransitionEnd(m.TRANSITION_DURATION):n(),this.hoverState=null,this},m.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},m.prototype.hasContent=function(){return this.getTitle()},m.prototype.getPosition=function(t){var e=(t=t||this.$element)[0],i="BODY"==e.tagName,o=e.getBoundingClientRect();null==o.width&&(o=g.extend({},o,{width:o.right-o.left,height:o.bottom-o.top}));var n=window.SVGElement&&e instanceof window.SVGElement,s=i?{top:0,left:0}:n?null:t.offset(),a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},r=i?{width:g(window).width(),height:g(window).height()}:null;return g.extend({},o,a,r,s)},m.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},m.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e))),t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)},m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function i(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})},g.fn.tooltip.Constructor=m,g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1",s.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function e(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})},n.fn.popover.Constructor=s,n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body),this.$scrollElement=s(t).is(document.body)?s(window):s(t),this.options=s.extend({},n.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i)),"string"==typeof o&&e[o]()})}n.VERSION="3.4.1",n.DEFAULTS={offset:10},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(n[t+1]===undefined||e<n[t+1])&&this.activate(s[t])},n.prototype.activate=function(t){this.activeTarget=t,this.clear();var e=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=s(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},n.prototype.clear=function(){s(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var t=s.fn.scrollspy;s.fn.scrollspy=e,s.fn.scrollspy.Constructor=n,s.fn.scrollspy.noConflict=function(){return s.fn.scrollspy=t,this},s(window).on("load.bs.scrollspy.data-api",function(){s('[data-spy="scroll"]').each(function(){var t=s(this);e.call(t,t.data())})})}(jQuery),function(r){"use strict";var a=function(t){this.element=r(t)};function e(i){return this.each(function(){var t=r(this),e=t.data("bs.tab");e||t.data("bs.tab",e=new a(this)),"string"==typeof i&&e[i]()})}a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var o=e.find(".active:last a"),n=r.Event("hide.bs.tab",{relatedTarget:t[0]}),s=r.Event("show.bs.tab",{relatedTarget:o[0]});if(o.trigger(n),t.trigger(s),!s.isDefaultPrevented()&&!n.isDefaultPrevented()){var a=r(document).find(i);this.activate(t.closest("li"),e),this.activate(a,a.parent(),function(){o.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:o[0]})})}}},a.prototype.activate=function(t,e,i){var o=e.find("> .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=a,r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault(),e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new h(this,i)),"string"==typeof o&&e[o]()})}h.VERSION="3.4.1",h.RESET="affix affix-top affix-bottom",h.DEFAULTS={offset:0,target:window},h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n<i&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(n+a<=t-o)&&"bottom";var r=null==this.affixed,l=r?n:s.top;return null!=i&&n<=i?"top":null!=o&&t-o<=l+(r?a:e)&&"bottom"},h.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(h.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},h.prototype.checkPositionWithEventLoop=function(){setTimeout(l.proxy(this.checkPosition,this),1)},h.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),e=this.options.offset,i=e.top,o=e.bottom,n=Math.max(l(document).height(),l(document.body).height());"object"!=typeof e&&(o=i=e),"function"==typeof i&&(i=e.top(this.$element)),"function"==typeof o&&(o=e.bottom(this.$element));var s=this.getState(n,t,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var a="affix"+(s?"-"+s:""),r=l.Event(a+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(h.RESET).addClass(a).trigger(a.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:n-t-o})}};var t=l.fn.affix;l.fn.affix=i,l.fn.affix.Constructor=h,l.fn.affix.noConflict=function(){return l.fn.affix=t,this},l(window).on("load",function(){l('[data-spy="affix"]').each(function(){var t=l(this),e=t.data();e.offset=e.offset||{},null!=e.offsetBottom&&(e.offset.bottom=e.offsetBottom),null!=e.offsetTop&&(e.offset.top=e.offsetTop),i.call(t,e)})})}(jQuery);
  11. define("bootstrap", ["jquery"], function(){});
  12. require.config({
  13. urlArgs: "v=" + requirejs.s.contexts._.config.config.site.version,
  14. packages: [{
  15. name: 'moment',
  16. location: '../libs/moment',
  17. main: 'moment'
  18. }
  19. ],
  20. //在打包压缩时将会把include中的模块合并到主文件中
  21. include: ['css', 'layer', 'toastr', 'fast', 'frontend', 'frontend-init'],
  22. paths: {
  23. 'lang': "empty:",
  24. 'form': 'require-form',
  25. 'table': 'require-table',
  26. 'upload': 'require-upload',
  27. 'validator': 'require-validator',
  28. 'drag': 'jquery.drag.min',
  29. 'drop': 'jquery.drop.min',
  30. 'echarts': 'echarts.min',
  31. 'echarts-theme': 'echarts-theme',
  32. 'adminlte': 'adminlte',
  33. 'bootstrap-table-commonsearch': 'bootstrap-table-commonsearch',
  34. 'bootstrap-table-template': 'bootstrap-table-template',
  35. //
  36. // 以下的包从bower的libs目录加载
  37. 'jquery': '../libs/jquery/dist/jquery.min',
  38. 'bootstrap': '../libs/bootstrap/dist/js/bootstrap.min',
  39. 'bootstrap-datetimepicker': '../libs/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min',
  40. 'bootstrap-daterangepicker': '../libs/bootstrap-daterangepicker/daterangepicker',
  41. 'bootstrap-select': '../libs/bootstrap-select/dist/js/bootstrap-select.min',
  42. 'bootstrap-select-lang': '../libs/bootstrap-select/dist/js/i18n/defaults-zh_CN',
  43. 'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table.min',
  44. 'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
  45. 'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
  46. 'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
  47. 'bootstrap-table-jumpto': '../libs/bootstrap-table/dist/extensions/page-jumpto/bootstrap-table-jumpto',
  48. 'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
  49. 'dragsort': '../libs/fastadmin-dragsort/jquery.dragsort',
  50. 'sortable': '../libs/Sortable/Sortable.min',
  51. 'addtabs': '../libs/fastadmin-addtabs/jquery.addtabs',
  52. 'slimscroll': '../libs/jquery-slimscroll/jquery.slimscroll',
  53. 'validator-core': '../libs/nice-validator/dist/jquery.validator',
  54. 'validator-lang': '../libs/nice-validator/dist/local/zh-CN',
  55. 'plupload': '../libs/plupload/js/plupload.min',
  56. 'toastr': '../libs/toastr/toastr',
  57. 'jstree': '../libs/jstree/dist/jstree.min',
  58. 'layer': '../libs/fastadmin-layer/dist/layer',
  59. 'cookie': '../libs/jquery.cookie/jquery.cookie',
  60. 'cxselect': '../libs/fastadmin-cxselect/js/jquery.cxselect',
  61. 'template': '../libs/art-template/dist/template-native',
  62. 'selectpage': '../libs/fastadmin-selectpage/selectpage',
  63. 'citypicker': '../libs/fastadmin-citypicker/dist/js/city-picker.min',
  64. 'citypicker-data': '../libs/fastadmin-citypicker/dist/js/city-picker.data'
  65. },
  66. // shim依赖配置
  67. shim: {
  68. 'addons': ['frontend'],
  69. 'bootstrap': ['jquery'],
  70. 'bootstrap-table': {
  71. deps: [
  72. 'bootstrap',
  73. // 'css!../libs/bootstrap-table/dist/bootstrap-table.min.css'
  74. ],
  75. exports: '$.fn.bootstrapTable'
  76. },
  77. 'bootstrap-table-lang': {
  78. deps: ['bootstrap-table'],
  79. exports: '$.fn.bootstrapTable.defaults'
  80. },
  81. 'bootstrap-table-export': {
  82. deps: ['bootstrap-table', 'tableexport'],
  83. exports: '$.fn.bootstrapTable.defaults'
  84. },
  85. 'bootstrap-table-mobile': {
  86. deps: ['bootstrap-table'],
  87. exports: '$.fn.bootstrapTable.defaults'
  88. },
  89. 'bootstrap-table-advancedsearch': {
  90. deps: ['bootstrap-table'],
  91. exports: '$.fn.bootstrapTable.defaults'
  92. },
  93. 'bootstrap-table-commonsearch': {
  94. deps: ['bootstrap-table'],
  95. exports: '$.fn.bootstrapTable.defaults'
  96. },
  97. 'bootstrap-table-template': {
  98. deps: ['bootstrap-table', 'template'],
  99. exports: '$.fn.bootstrapTable.defaults'
  100. },
  101. 'bootstrap-table-jumpto': {
  102. deps: ['bootstrap-table'],
  103. exports: '$.fn.bootstrapTable.defaults'
  104. },
  105. 'tableexport': {
  106. deps: ['jquery'],
  107. exports: '$.fn.extend'
  108. },
  109. 'slimscroll': {
  110. deps: ['jquery'],
  111. exports: '$.fn.extend'
  112. },
  113. 'adminlte': {
  114. deps: ['bootstrap', 'slimscroll'],
  115. exports: '$.AdminLTE'
  116. },
  117. 'bootstrap-daterangepicker': [
  118. 'moment/locale/zh-cn'
  119. ],
  120. 'bootstrap-datetimepicker': [
  121. 'moment/locale/zh-cn',
  122. // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
  123. ],
  124. // 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ],
  125. 'bootstrap-select-lang': ['bootstrap-select'],
  126. // 'toastr': ['css!../libs/toastr/toastr.min.css'],
  127. 'jstree': ['css!../libs/jstree/dist/themes/default/style.css', ],
  128. 'plupload': {
  129. deps: ['../libs/plupload/js/moxie.min'],
  130. exports: "plupload"
  131. },
  132. // 'layer': ['css!../libs/fastadmin-layer/dist/theme/default/layer.css'],
  133. // 'validator-core': ['css!../libs/nice-validator/dist/jquery.validator.css'],
  134. 'validator-lang': ['validator-core'],
  135. // 'selectpage': ['css!../libs/fastadmin-selectpage/selectpage.css'],
  136. 'citypicker': ['citypicker-data', 'css!../libs/fastadmin-citypicker/dist/css/city-picker.css']
  137. },
  138. baseUrl: requirejs.s.contexts._.config.config.site.cdnurl + '/assets/js/', //资源基础路径
  139. map: {
  140. '*': {
  141. 'css': '../libs/require-css/css.min'
  142. }
  143. },
  144. waitSeconds: 30,
  145. charset: 'utf-8' // 文件编码
  146. });
  147. require(['jquery', 'bootstrap'], function ($, undefined) {
  148. //初始配置
  149. var Config = requirejs.s.contexts._.config.config;
  150. //将Config渲染到全局
  151. window.Config = Config;
  152. // 配置语言包的路径
  153. var paths = {};
  154. paths['lang'] = Config.moduleurl + '/ajax/lang?callback=define&controllername=' + Config.controllername;
  155. // 避免目录冲突
  156. paths['frontend/'] = 'frontend/';
  157. require.config({paths: paths});
  158. // 初始化
  159. $(function () {
  160. require(['fast'], function (Fast) {
  161. require(['frontend', 'frontend-init', 'addons'], function (Frontend, Addons) {
  162. //加载相应模块
  163. if (Config.jsname) {
  164. require([Config.jsname], function (Controller) {
  165. Controller[Config.actionname] != undefined && Controller[Config.actionname]();
  166. }, function (e) {
  167. console.error(e);
  168. // 这里可捕获模块加载的错误
  169. });
  170. }
  171. });
  172. });
  173. });
  174. });
  175. define("require-frontend", function(){});
  176. define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(a,b,c){c()}};var a=document.getElementsByTagName("head")[0],b=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,c=!1,d=!0;b[1]||b[7]?c=parseInt(b[1])<6||parseInt(b[7])<=9:b[2]||b[8]?d=!1:b[4]&&(c=parseInt(b[4])<18);var e={};e.pluginBuilder="./css-builder";var f,g,h,i=function(){f=document.createElement("style"),a.appendChild(f),g=f.styleSheet||f.sheet},j=0,k=[],l=function(a){g.addImport(a),f.onload=function(){m()},j++,31==j&&(i(),j=0)},m=function(){h();var a=k.shift();return a?(h=a[1],void l(a[0])):void(h=null)},n=function(a,b){if(g&&g.addImport||i(),g&&g.addImport)h?k.push([a,b]):(l(a),h=b);else{f.textContent='@import "'+a+'";';var c=setInterval(function(){try{f.sheet.cssRules,clearInterval(c),b()}catch(a){}},10)}},o=function(b,c){var e=document.createElement("link");if(e.type="text/css",e.rel="stylesheet",d)e.onload=function(){e.onload=function(){},setTimeout(c,7)};else var f=setInterval(function(){for(var a=0;a<document.styleSheets.length;a++){var b=document.styleSheets[a];if(b.href==e.href)return clearInterval(f),c()}},10);e.href=b,a.appendChild(e)};return e.normalize=function(a,b){return".css"==a.substr(a.length-4,4)&&(a=a.substr(0,a.length-4)),b(a)},e.load=function(a,b,d,e){(c?n:o)(b.toUrl(a+".css"),d)},e});
  177. /*! layer-v3.1.4 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */
  178. ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},f=r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},n.icon!==-1&&n.icon!==t||(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,focusBtn:0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'<div class="layui-layer-title" style="'+(f?r.title[1]:"")+'">'+(f?r.title[0]:r.title)+"</div>":"";return r.zIndex=s,t([r.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+a+'" times="'+a+'" style="'+("z-index:"+(s-1)+"; ")+'"></div>':"",'<div class="'+l[0]+(" layui-layer-"+o.type[r.type])+(0!=r.type&&2!=r.type||r.shade?"":" layui-layer-border")+" "+(r.skin||"")+'" id="'+l[0]+a+'" type="'+o.type[r.type]+'" times="'+a+'" showtime="'+r.time+'" conType="'+(e?"object":"string")+'" style="z-index: '+s+"; width:"+r.area[0]+";height:"+r.area[1]+(r.fixed?"":";position:absolute;")+'">'+(e&&2!=r.type?"":u)+'<div id="'+(r.id||"")+'" class="layui-layer-content'+(0==r.type&&r.icon!==-1?" layui-layer-padding":"")+(3==r.type?" layui-layer-loading"+r.icon:"")+'">'+(0==r.type&&r.icon!==-1?'<i class="layui-layer-ico layui-layer-ico'+r.icon+'"></i>':"")+(1==r.type&&e?"":r.content||"")+'</div><span class="layui-layer-setwin">'+function(){var e=c?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return r.closeBtn&&(e+='<a class="layui-layer-ico '+l[7]+" "+l[7]+(r.title?r.closeBtn:4==r.type?"1":"2")+'" href="javascript:;"></a>'),e}()+"</span>"+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t<i;t++)e+='<a class="'+l[6]+t+'" href="javascript:;">'+r.btn[t]+"</a>";return'<div class="'+l[6]+" layui-layer-btn-"+(r.btnAlign||"")+'">'+e+"</div>"}():"")+(r.resize?'<span class="layui-layer-resize"></span>':"")+"</div>"],u,i('<div class="layui-layer-move"></div>')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='<iframe scrolling="'+(t.content[1]||"auto")+'" allowtransparency="true" id="'+l[4]+a+'" name="'+l[4]+a+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+t.content[0]+'"></iframe>';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'<i class="layui-layer-TipsG"></i>',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;a<c.stX&&(a=c.stX),a>f&&(a=f),o<c.stY&&(o=c.stY),o>u&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;if(t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),"number"==typeof a.focusBtn){var s=n.find("."+l[6]).children("a").eq(a.focusBtn);if(s.size()>0){var f=s.position(),c={width:s.outerWidth(),height:s.outerHeight(),left:f.left,top:f.top,marginTop:s.css("marginTop"),marginLeft:s.css("marginLeft")},u=i("<button class='layui-layer-confirm'></button>").css(c);n.find("."+l[6]).after(u),u.focus().click(function(){return s.trigger("click"),!1}).on("focus blur",function(e){s.toggleClass("focus","focus"===e.type)})}}n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'<textarea class="layui-layer-input"'+a+">"+(e.value||"")+"</textarea>":function(){return'<input type="'+(1==e.formType?"password":"text")+'" class="layui-layer-input" value="'+(e.value||"")+'">'}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(e.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a='<span class="'+n+'">'+t[0].title+"</span>";i<e;i++)a+="<span>"+t[i].title+"</span>";return a}(),content:'<ul class="layui-layer-tabmain">'+function(){var e=t.length,i=1,a="";if(e>0)for(a='<li class="layui-layer-tabli '+n+'">'+(t[0].content||"no content")+"</li>";i<e;i++)a+='<li class="layui-layer-tabli">'+(t[i].content||"no content")+"</li>";return a}()+"</ul>",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:"shade"in t?t.shade:.9,scrollbar:"scrollbar"in t&&t.scrollbar}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]<r[1]&&(a[0]=a[0]/r[1],a[1]=a[1]/r[1])}return[a[0]+"px",a[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,isOutAnim:!1,skin:"layui-layer-photos"+c("photos"),content:'<div class="layui-layer-phimg"><img src="'+u[d].src+'" alt="'+(u[d].alt||"")+'" layer-pid="'+u[d].pid+'"><div class="layui-layer-imgsee">'+(u.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(a?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(u[d].alt||"")+"</a><em>"+s.imgIndex+"/"+u.length+"</em></span></div></div></div>",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["&#x4E0B;&#x4E00;&#x5F20;","&#x4E0D;&#x770B;&#x4E86;"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define('layer',["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);
  179. /*
  180. * Toastr
  181. * Copyright 2012-2015
  182. * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.
  183. * All Rights Reserved.
  184. * Use, reproduction, distribution, and modification of this code is subject to the terms and
  185. * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
  186. *
  187. * ARIA Support: Greta Krafsig
  188. *
  189. * Project: https://github.com/CodeSeven/toastr
  190. */
  191. /* global define */
  192. (function (define) {
  193. define('toastr',['jquery'], function ($) {
  194. return (function () {
  195. var $container;
  196. var listener;
  197. var toastId = 0;
  198. var toastType = {
  199. error: 'error',
  200. info: 'info',
  201. success: 'success',
  202. warning: 'warning'
  203. };
  204. var toastr = {
  205. clear: clear,
  206. remove: remove,
  207. error: error,
  208. getContainer: getContainer,
  209. info: info,
  210. options: {},
  211. subscribe: subscribe,
  212. success: success,
  213. version: '2.1.3',
  214. warning: warning
  215. };
  216. var previousToast;
  217. return toastr;
  218. ////////////////
  219. function error(message, title, optionsOverride) {
  220. return notify({
  221. type: toastType.error,
  222. iconClass: getOptions().iconClasses.error,
  223. message: message,
  224. optionsOverride: optionsOverride,
  225. title: title
  226. });
  227. }
  228. function getContainer(options, create) {
  229. if (!options) { options = getOptions(); }
  230. $container = $('#' + options.containerId);
  231. if ($container.length) {
  232. return $container;
  233. }
  234. if (create) {
  235. $container = createContainer(options);
  236. }
  237. return $container;
  238. }
  239. function info(message, title, optionsOverride) {
  240. return notify({
  241. type: toastType.info,
  242. iconClass: getOptions().iconClasses.info,
  243. message: message,
  244. optionsOverride: optionsOverride,
  245. title: title
  246. });
  247. }
  248. function subscribe(callback) {
  249. listener = callback;
  250. }
  251. function success(message, title, optionsOverride) {
  252. return notify({
  253. type: toastType.success,
  254. iconClass: getOptions().iconClasses.success,
  255. message: message,
  256. optionsOverride: optionsOverride,
  257. title: title
  258. });
  259. }
  260. function warning(message, title, optionsOverride) {
  261. return notify({
  262. type: toastType.warning,
  263. iconClass: getOptions().iconClasses.warning,
  264. message: message,
  265. optionsOverride: optionsOverride,
  266. title: title
  267. });
  268. }
  269. function clear($toastElement, clearOptions) {
  270. var options = getOptions();
  271. if (!$container) { getContainer(options); }
  272. if (!clearToast($toastElement, options, clearOptions)) {
  273. clearContainer(options);
  274. }
  275. }
  276. function remove($toastElement) {
  277. var options = getOptions();
  278. if (!$container) { getContainer(options); }
  279. if ($toastElement && $(':focus', $toastElement).length === 0) {
  280. removeToast($toastElement);
  281. return;
  282. }
  283. if ($container.children().length) {
  284. $container.remove();
  285. }
  286. }
  287. // internal functions
  288. function clearContainer (options) {
  289. var toastsToClear = $container.children();
  290. for (var i = toastsToClear.length - 1; i >= 0; i--) {
  291. clearToast($(toastsToClear[i]), options);
  292. }
  293. }
  294. function clearToast ($toastElement, options, clearOptions) {
  295. var force = clearOptions && clearOptions.force ? clearOptions.force : false;
  296. if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
  297. $toastElement[options.hideMethod]({
  298. duration: options.hideDuration,
  299. easing: options.hideEasing,
  300. complete: function () { removeToast($toastElement); }
  301. });
  302. return true;
  303. }
  304. return false;
  305. }
  306. function createContainer(options) {
  307. $container = $('<div/>')
  308. .attr('id', options.containerId)
  309. .addClass(options.positionClass);
  310. $container.appendTo($(options.target));
  311. return $container;
  312. }
  313. function getDefaults() {
  314. return {
  315. tapToDismiss: true,
  316. toastClass: 'toast',
  317. containerId: 'toast-container',
  318. debug: false,
  319. showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
  320. showDuration: 300,
  321. showEasing: 'swing', //swing and linear are built into jQuery
  322. onShown: undefined,
  323. hideMethod: 'fadeOut',
  324. hideDuration: 1000,
  325. hideEasing: 'swing',
  326. onHidden: undefined,
  327. closeMethod: false,
  328. closeDuration: false,
  329. closeEasing: false,
  330. closeOnHover: true,
  331. extendedTimeOut: 1000,
  332. iconClasses: {
  333. error: 'toast-error',
  334. info: 'toast-info',
  335. success: 'toast-success',
  336. warning: 'toast-warning'
  337. },
  338. iconClass: 'toast-info',
  339. positionClass: 'toast-top-right',
  340. timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
  341. titleClass: 'toast-title',
  342. messageClass: 'toast-message',
  343. escapeHtml: false,
  344. target: 'body',
  345. closeHtml: '<button type="button">&times;</button>',
  346. closeClass: 'toast-close-button',
  347. newestOnTop: true,
  348. preventDuplicates: false,
  349. progressBar: false,
  350. progressClass: 'toast-progress',
  351. rtl: false
  352. };
  353. }
  354. function publish(args) {
  355. if (!listener) { return; }
  356. listener(args);
  357. }
  358. function notify(map) {
  359. var options = getOptions();
  360. var iconClass = map.iconClass || options.iconClass;
  361. if (typeof (map.optionsOverride) !== 'undefined') {
  362. options = $.extend(options, map.optionsOverride);
  363. iconClass = map.optionsOverride.iconClass || iconClass;
  364. }
  365. if (shouldExit(options, map)) { return; }
  366. toastId++;
  367. $container = getContainer(options, true);
  368. var intervalId = null;
  369. var $toastElement = $('<div/>');
  370. var $titleElement = $('<div/>');
  371. var $messageElement = $('<div/>');
  372. var $progressElement = $('<div/>');
  373. var $closeElement = $(options.closeHtml);
  374. var progressBar = {
  375. intervalId: null,
  376. hideEta: null,
  377. maxHideTime: null
  378. };
  379. var response = {
  380. toastId: toastId,
  381. state: 'visible',
  382. startTime: new Date(),
  383. options: options,
  384. map: map
  385. };
  386. personalizeToast();
  387. displayToast();
  388. handleEvents();
  389. publish(response);
  390. if (options.debug && console) {
  391. console.log(response);
  392. }
  393. return $toastElement;
  394. function escapeHtml(source) {
  395. if (source == null) {
  396. source = '';
  397. }
  398. return source
  399. .replace(/&/g, '&amp;')
  400. .replace(/"/g, '&quot;')
  401. .replace(/'/g, '&#39;')
  402. .replace(/</g, '&lt;')
  403. .replace(/>/g, '&gt;');
  404. }
  405. function personalizeToast() {
  406. setIcon();
  407. setTitle();
  408. setMessage();
  409. setCloseButton();
  410. setProgressBar();
  411. setRTL();
  412. setSequence();
  413. setAria();
  414. }
  415. function setAria() {
  416. var ariaValue = '';
  417. switch (map.iconClass) {
  418. case 'toast-success':
  419. case 'toast-info':
  420. ariaValue = 'polite';
  421. break;
  422. default:
  423. ariaValue = 'assertive';
  424. }
  425. $toastElement.attr('aria-live', ariaValue);
  426. }
  427. function handleEvents() {
  428. if (options.closeOnHover) {
  429. $toastElement.hover(stickAround, delayedHideToast);
  430. }
  431. if (!options.onclick && options.tapToDismiss) {
  432. $toastElement.click(hideToast);
  433. }
  434. if (options.closeButton && $closeElement) {
  435. $closeElement.click(function (event) {
  436. if (event.stopPropagation) {
  437. event.stopPropagation();
  438. } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
  439. event.cancelBubble = true;
  440. }
  441. if (options.onCloseClick) {
  442. options.onCloseClick(event);
  443. }
  444. hideToast(true);
  445. });
  446. }
  447. if (options.onclick) {
  448. $toastElement.click(function (event) {
  449. options.onclick(event);
  450. hideToast();
  451. });
  452. }
  453. }
  454. function displayToast() {
  455. $toastElement.hide();
  456. $toastElement[options.showMethod](
  457. {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
  458. );
  459. if (options.timeOut > 0) {
  460. intervalId = setTimeout(hideToast, options.timeOut);
  461. progressBar.maxHideTime = parseFloat(options.timeOut);
  462. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  463. if (options.progressBar) {
  464. progressBar.intervalId = setInterval(updateProgress, 10);
  465. }
  466. }
  467. }
  468. function setIcon() {
  469. if (map.iconClass) {
  470. $toastElement.addClass(options.toastClass).addClass(iconClass);
  471. }
  472. }
  473. function setSequence() {
  474. if (options.newestOnTop) {
  475. $container.prepend($toastElement);
  476. } else {
  477. $container.append($toastElement);
  478. }
  479. }
  480. function setTitle() {
  481. if (map.title) {
  482. var suffix = map.title;
  483. if (options.escapeHtml) {
  484. suffix = escapeHtml(map.title);
  485. }
  486. $titleElement.append(suffix).addClass(options.titleClass);
  487. $toastElement.append($titleElement);
  488. }
  489. }
  490. function setMessage() {
  491. if (map.message) {
  492. var suffix = map.message;
  493. if (options.escapeHtml) {
  494. suffix = escapeHtml(map.message);
  495. }
  496. $messageElement.append(suffix).addClass(options.messageClass);
  497. $toastElement.append($messageElement);
  498. }
  499. }
  500. function setCloseButton() {
  501. if (options.closeButton) {
  502. $closeElement.addClass(options.closeClass).attr('role', 'button');
  503. $toastElement.prepend($closeElement);
  504. }
  505. }
  506. function setProgressBar() {
  507. if (options.progressBar) {
  508. $progressElement.addClass(options.progressClass);
  509. $toastElement.prepend($progressElement);
  510. }
  511. }
  512. function setRTL() {
  513. if (options.rtl) {
  514. $toastElement.addClass('rtl');
  515. }
  516. }
  517. function shouldExit(options, map) {
  518. if (options.preventDuplicates) {
  519. if (map.message === previousToast) {
  520. return true;
  521. } else {
  522. previousToast = map.message;
  523. }
  524. }
  525. return false;
  526. }
  527. function hideToast(override) {
  528. var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;
  529. var duration = override && options.closeDuration !== false ?
  530. options.closeDuration : options.hideDuration;
  531. var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;
  532. if ($(':focus', $toastElement).length && !override) {
  533. return;
  534. }
  535. clearTimeout(progressBar.intervalId);
  536. return $toastElement[method]({
  537. duration: duration,
  538. easing: easing,
  539. complete: function () {
  540. removeToast($toastElement);
  541. clearTimeout(intervalId);
  542. if (options.onHidden && response.state !== 'hidden') {
  543. options.onHidden();
  544. }
  545. response.state = 'hidden';
  546. response.endTime = new Date();
  547. publish(response);
  548. }
  549. });
  550. }
  551. function delayedHideToast() {
  552. if (options.timeOut > 0 || options.extendedTimeOut > 0) {
  553. intervalId = setTimeout(hideToast, options.extendedTimeOut);
  554. progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
  555. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  556. }
  557. }
  558. function stickAround() {
  559. clearTimeout(intervalId);
  560. progressBar.hideEta = 0;
  561. $toastElement.stop(true, true)[options.showMethod](
  562. {duration: options.showDuration, easing: options.showEasing}
  563. );
  564. }
  565. function updateProgress() {
  566. var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
  567. $progressElement.width(percentage + '%');
  568. }
  569. }
  570. function getOptions() {
  571. return $.extend({}, getDefaults(), toastr.options);
  572. }
  573. function removeToast($toastElement) {
  574. if (!$container) { $container = getContainer(); }
  575. if ($toastElement.is(':visible')) {
  576. return;
  577. }
  578. $toastElement.remove();
  579. $toastElement = null;
  580. if ($container.children().length === 0) {
  581. $container.remove();
  582. previousToast = undefined;
  583. }
  584. }
  585. })();
  586. });
  587. }(typeof define === 'function' && define.amd ? define : function (deps, factory) {
  588. if (typeof module !== 'undefined' && module.exports) { //Node
  589. module.exports = factory(require('jquery'));
  590. } else {
  591. window.toastr = factory(window.jQuery);
  592. }
  593. }));
  594. define('fast',['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefined, Toastr, Layer, Lang) {
  595. var Fast = {
  596. config: {
  597. //toastr默认配置
  598. toastr: {
  599. "closeButton": true,
  600. "debug": false,
  601. "newestOnTop": false,
  602. "progressBar": false,
  603. "positionClass": "toast-top-center",
  604. "preventDuplicates": false,
  605. "onclick": null,
  606. "showDuration": "300",
  607. "hideDuration": "1000",
  608. "timeOut": "5000",
  609. "extendedTimeOut": "1000",
  610. "showEasing": "swing",
  611. "hideEasing": "linear",
  612. "showMethod": "fadeIn",
  613. "hideMethod": "fadeOut"
  614. }
  615. },
  616. events: {
  617. //请求成功的回调
  618. onAjaxSuccess: function (ret, onAjaxSuccess) {
  619. var data = typeof ret.data !== 'undefined' ? ret.data : null;
  620. var msg = typeof ret.msg !== 'undefined' && ret.msg ? ret.msg : __('Operation completed');
  621. if (typeof onAjaxSuccess === 'function') {
  622. var result = onAjaxSuccess.call(this, data, ret);
  623. if (result === false)
  624. return;
  625. }
  626. Toastr.success(msg);
  627. },
  628. //请求错误的回调
  629. onAjaxError: function (ret, onAjaxError) {
  630. var data = typeof ret.data !== 'undefined' ? ret.data : null;
  631. if (typeof onAjaxError === 'function') {
  632. var result = onAjaxError.call(this, data, ret);
  633. if (result === false) {
  634. return;
  635. }
  636. }
  637. Toastr.error(ret.msg);
  638. },
  639. //服务器响应数据后
  640. onAjaxResponse: function (response) {
  641. try {
  642. var ret = typeof response === 'object' ? response : JSON.parse(response);
  643. if (!ret.hasOwnProperty('code')) {
  644. $.extend(ret, {code: -2, msg: response, data: null});
  645. }
  646. } catch (e) {
  647. var ret = {code: -1, msg: e.message, data: null};
  648. }
  649. return ret;
  650. }
  651. },
  652. api: {
  653. //发送Ajax请求
  654. ajax: function (options, success, error) {
  655. options = typeof options === 'string' ? {url: options} : options;
  656. var index;
  657. if (typeof options.loading === 'undefined' || options.loading) {
  658. index = Layer.load(options.loading || 0);
  659. }
  660. options = $.extend({
  661. type: "POST",
  662. dataType: "json",
  663. success: function (ret) {
  664. index && Layer.close(index);
  665. ret = Fast.events.onAjaxResponse(ret);
  666. if (ret.code === 1) {
  667. Fast.events.onAjaxSuccess(ret, success);
  668. } else {
  669. Fast.events.onAjaxError(ret, error);
  670. }
  671. },
  672. error: function (xhr) {
  673. index && Layer.close(index);
  674. var ret = {code: xhr.status, msg: xhr.statusText, data: null};
  675. Fast.events.onAjaxError(ret, error);
  676. }
  677. }, options);
  678. return $.ajax(options);
  679. },
  680. //修复URL
  681. fixurl: function (url) {
  682. if (url.substr(0, 1) !== "/") {
  683. var r = new RegExp('^(?:[a-z]+:)?//', 'i');
  684. if (!r.test(url)) {
  685. url = Config.moduleurl + "/" + url;
  686. }
  687. } else if (url.substr(0, 8) === "/addons/") {
  688. url = Config.__PUBLIC__.replace(/(\/*$)/g, "") + url;
  689. }
  690. return url;
  691. },
  692. //获取修复后可访问的cdn链接
  693. cdnurl: function (url, domain) {
  694. var rule = new RegExp("^((?:[a-z]+:)?\\/\\/|data:image\\/)", "i");
  695. var url = rule.test(url) ? url : Config.upload.cdnurl + url;
  696. if (domain && !rule.test(url)) {
  697. domain = typeof domain === 'string' ? domain : location.origin;
  698. url = domain + url;
  699. }
  700. return url;
  701. },
  702. //查询Url参数
  703. query: function (name, url) {
  704. if (!url) {
  705. url = window.location.href;
  706. }
  707. name = name.replace(/[\[\]]/g, "\\$&");
  708. var regex = new RegExp("[?&/]" + name + "([=/]([^&#/?]*)|&|#|$)"),
  709. results = regex.exec(url);
  710. if (!results)
  711. return null;
  712. if (!results[2])
  713. return '';
  714. return decodeURIComponent(results[2].replace(/\+/g, " "));
  715. },
  716. //打开一个弹出窗口
  717. open: function (url, title, options) {
  718. title = options && options.title ? options.title : (title ? title : "");
  719. url = Fast.api.fixurl(url);
  720. url = url + (url.indexOf("?") > -1 ? "&" : "?") + "dialog=1";
  721. var area = Fast.config.openArea != undefined ? Fast.config.openArea : [$(window).width() > 800 ? '800px' : '95%', $(window).height() > 600 ? '600px' : '95%'];
  722. options = $.extend({
  723. type: 2,
  724. title: title,
  725. shadeClose: true,
  726. shade: false,
  727. maxmin: true,
  728. moveOut: true,
  729. area: area,
  730. content: url,
  731. zIndex: Layer.zIndex,
  732. success: function (layero, index) {
  733. var that = this;
  734. //存储callback事件
  735. $(layero).data("callback", that.callback);
  736. //$(layero).removeClass("layui-layer-border");
  737. Layer.setTop(layero);
  738. try {
  739. var frame = Layer.getChildFrame('html', index);
  740. var layerfooter = frame.find(".layer-footer");
  741. Fast.api.layerfooter(layero, index, that);
  742. //绑定事件
  743. if (layerfooter.size() > 0) {
  744. // 监听窗口内的元素及属性变化
  745. // Firefox和Chrome早期版本中带有前缀
  746. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  747. if (MutationObserver) {
  748. // 选择目标节点
  749. var target = layerfooter[0];
  750. // 创建观察者对象
  751. var observer = new MutationObserver(function (mutations) {
  752. Fast.api.layerfooter(layero, index, that);
  753. mutations.forEach(function (mutation) {
  754. });
  755. });
  756. // 配置观察选项:
  757. var config = {attributes: true, childList: true, characterData: true, subtree: true}
  758. // 传入目标节点和观察选项
  759. observer.observe(target, config);
  760. // 随后,你还可以停止观察
  761. // observer.disconnect();
  762. }
  763. }
  764. } catch (e) {
  765. }
  766. if ($(layero).height() > $(window).height()) {
  767. //当弹出窗口大于浏览器可视高度时,重定位
  768. Layer.style(index, {
  769. top: 0,
  770. height: $(window).height()
  771. });
  772. }
  773. }
  774. }, options ? options : {});
  775. if ($(window).width() < 480 || (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream && top.$(".tab-pane.active").size() > 0)) {
  776. options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
  777. options.offset = [top.$(".tab-pane.active").scrollTop() + "px", "0px"];
  778. }
  779. return Layer.open(options);
  780. },
  781. //关闭窗口并回传数据
  782. close: function (data) {
  783. var index = parent.Layer.getFrameIndex(window.name);
  784. var callback = parent.$("#layui-layer" + index).data("callback");
  785. //再执行关闭
  786. parent.Layer.close(index);
  787. //再调用回传函数
  788. if (typeof callback === 'function') {
  789. callback.call(undefined, data);
  790. }
  791. },
  792. layerfooter: function (layero, index, that) {
  793. var frame = Layer.getChildFrame('html', index);
  794. var layerfooter = frame.find(".layer-footer");
  795. if (layerfooter.size() > 0) {
  796. $(".layui-layer-footer", layero).remove();
  797. var footer = $("<div />").addClass('layui-layer-btn layui-layer-footer');
  798. footer.html(layerfooter.html());
  799. if ($(".row", footer).size() === 0) {
  800. $(">", footer).wrapAll("<div class='row'></div>");
  801. }
  802. footer.insertAfter(layero.find('.layui-layer-content'));
  803. //绑定事件
  804. footer.on("click", ".btn", function () {
  805. if ($(this).hasClass("disabled") || $(this).parent().hasClass("disabled")) {
  806. return;
  807. }
  808. var index = footer.find('.btn').index(this);
  809. $(".btn:eq(" + index + ")", layerfooter).trigger("click");
  810. });
  811. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  812. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  813. //重设iframe高度
  814. $("iframe", layero).height(layero.height() - titHeight - btnHeight);
  815. }
  816. //修复iOS下弹出窗口的高度和iOS下iframe无法滚动的BUG
  817. if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
  818. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  819. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  820. $("iframe", layero).parent().css("height", layero.height() - titHeight - btnHeight);
  821. $("iframe", layero).css("height", "100%");
  822. }
  823. },
  824. success: function (options, callback) {
  825. var type = typeof options === 'function';
  826. if (type) {
  827. callback = options;
  828. }
  829. return Layer.msg(__('Operation completed'), $.extend({
  830. offset: 0, icon: 1
  831. }, type ? {} : options), callback);
  832. },
  833. error: function (options, callback) {
  834. var type = typeof options === 'function';
  835. if (type) {
  836. callback = options;
  837. }
  838. return Layer.msg(__('Operation failed'), $.extend({
  839. offset: 0, icon: 2
  840. }, type ? {} : options), callback);
  841. },
  842. msg: function (message, url) {
  843. var callback = typeof url === 'function' ? url : function () {
  844. if (typeof url !== 'undefined' && url) {
  845. location.href = url;
  846. }
  847. };
  848. Layer.msg(message, {
  849. time: 2000
  850. }, callback);
  851. },
  852. toastr: Toastr,
  853. layer: Layer
  854. },
  855. lang: function () {
  856. var args = arguments,
  857. string = args[0],
  858. i = 1;
  859. string = string.toLowerCase();
  860. //string = typeof Lang[string] != 'undefined' ? Lang[string] : string;
  861. if (typeof Lang !== 'undefined' && typeof Lang[string] !== 'undefined') {
  862. if (typeof Lang[string] == 'object')
  863. return Lang[string];
  864. string = Lang[string];
  865. } else if (string.indexOf('.') !== -1 && false) {
  866. var arr = string.split('.');
  867. var current = Lang[arr[0]];
  868. for (var i = 1; i < arr.length; i++) {
  869. current = typeof current[arr[i]] != 'undefined' ? current[arr[i]] : '';
  870. if (typeof current != 'object')
  871. break;
  872. }
  873. if (typeof current == 'object')
  874. return current;
  875. string = current;
  876. } else {
  877. string = args[0];
  878. }
  879. return string.replace(/%((%)|s|d)/g, function (m) {
  880. // m is the matched format, e.g. %s, %d
  881. var val = null;
  882. if (m[2]) {
  883. val = m[2];
  884. } else {
  885. val = args[i];
  886. // A switch statement so that the formatter can be extended. Default is %s
  887. switch (m) {
  888. case '%d':
  889. val = parseFloat(val);
  890. if (isNaN(val)) {
  891. val = 0;
  892. }
  893. break;
  894. }
  895. i++;
  896. }
  897. return val;
  898. });
  899. },
  900. init: function () {
  901. // 对相对地址进行处理
  902. $.ajaxSetup({
  903. beforeSend: function (xhr, setting) {
  904. setting.url = Fast.api.fixurl(setting.url);
  905. }
  906. });
  907. Layer.config({
  908. skin: 'layui-layer-fast'
  909. });
  910. // 绑定ESC关闭窗口事件
  911. $(window).keyup(function (e) {
  912. if (e.keyCode == 27) {
  913. if ($(".layui-layer").size() > 0) {
  914. var index = 0;
  915. $(".layui-layer").each(function () {
  916. index = Math.max(index, parseInt($(this).attr("times")));
  917. });
  918. if (index) {
  919. Layer.close(index);
  920. }
  921. }
  922. }
  923. });
  924. //公共代码
  925. //配置Toastr的参数
  926. Toastr.options = Fast.config.toastr;
  927. }
  928. };
  929. //将Layer暴露到全局中去
  930. window.Layer = Layer;
  931. //将Toastr暴露到全局中去
  932. window.Toastr = Toastr;
  933. //将语言方法暴露到全局中去
  934. window.__ = Fast.lang;
  935. //将Fast渲染至全局
  936. window.Fast = Fast;
  937. //默认初始化执行的代码
  938. Fast.init();
  939. return Fast;
  940. });
  941. /*!art-template - Template Engine | http://aui.github.com/artTemplate/*/
  942. !function(){function a(a){return a.replace(t,"").replace(u,",").replace(v,"").replace(w,"").replace(x,"").split(y)}function b(a){return"'"+a.replace(/('|\\)/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+"'"}function c(c,d){function e(a){return m+=a.split(/\n/).length-1,k&&(a=a.replace(/\s+/g," ").replace(/<!--[\w\W]*?-->/g,"")),a&&(a=s[1]+b(a)+s[2]+"\n"),a}function f(b){var c=m;if(j?b=j(b,d):g&&(b=b.replace(/\n/g,function(){return m++,"$line="+m+";"})),0===b.indexOf("=")){var e=l&&!/^=[=#]/.test(b);if(b=b.replace(/^=[=#]?|[\s;]*$/g,""),e){var f=b.replace(/\s*\([^\)]+\)/,"");n[f]||/^(include|print)$/.test(f)||(b="$escape("+b+")")}else b="$string("+b+")";b=s[1]+b+s[2]}return g&&(b="$line="+c+";"+b),r(a(b),function(a){if(a&&!p[a]){var b;b="print"===a?u:"include"===a?v:n[a]?"$utils."+a:o[a]?"$helpers."+a:"$data."+a,w+=a+"="+b+",",p[a]=!0}}),b+"\n"}var g=d.debug,h=d.openTag,i=d.closeTag,j=d.parser,k=d.compress,l=d.escape,m=1,p={$data:1,$filename:1,$utils:1,$helpers:1,$out:1,$line:1},q="".trim,s=q?["$out='';","$out+=",";","$out"]:["$out=[];","$out.push(",");","$out.join('')"],t=q?"$out+=text;return $out;":"$out.push(text);",u="function(){var text=''.concat.apply('',arguments);"+t+"}",v="function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);"+t+"}",w="'use strict';var $utils=this,$helpers=$utils.$helpers,"+(g?"$line=0,":""),x=s[0],y="return new String("+s[3]+");";r(c.split(h),function(a){a=a.split(i);var b=a[0],c=a[1];1===a.length?x+=e(b):(x+=f(b),c&&(x+=e(c)))});var z=w+x+y;g&&(z="try{"+z+"}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:"+b(c)+".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}");try{var A=new Function("$data","$filename",z);return A.prototype=n,A}catch(a){throw a.temp="function anonymous($data,$filename) {"+z+"}",a}}var d=function(a,b){return"string"==typeof b?q(b,{filename:a}):g(a,b)};d.version="3.0.0",d.config=function(a,b){e[a]=b};var e=d.defaults={openTag:"<%",closeTag:"%>",escape:!0,cache:!0,compress:!1,parser:null},f=d.cache={};d.render=function(a,b){return q(a)(b)};var g=d.renderFile=function(a,b){var c=d.get(a)||p({filename:a,name:"Render Error",message:"Template not found"});return b?c(b):c};d.get=function(a){var b;if(f[a])b=f[a];else if("object"==typeof document){var c=document.getElementById(a);if(c){var d=(c.value||c.innerHTML).replace(/^\s*|\s*$/g,"");b=q(d,{filename:a})}}return b};var h=function(a,b){return"string"!=typeof a&&(b=typeof a,"number"===b?a+="":a="function"===b?h(a.call(a)):""),a},i={"<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","&":"&#38;"},j=function(a){return i[a]},k=function(a){return h(a).replace(/&(?![\w#]+;)|[<>"']/g,j)},l=Array.isArray||function(a){return"[object Array]"==={}.toString.call(a)},m=function(a,b){var c,d;if(l(a))for(c=0,d=a.length;c<d;c++)b.call(a,a[c],c,a);else for(c in a)b.call(a,a[c],c)},n=d.utils={$helpers:{},$include:g,$string:h,$escape:k,$each:m};d.helper=function(a,b){o[a]=b};var o=d.helpers=n.$helpers;d.onerror=function(a){var b="Template Error\n\n";for(var c in a)b+="<"+c+">\n"+a[c]+"\n\n";"object"==typeof console&&console.error(b)};var p=function(a){return d.onerror(a),function(){return"{Template Error}"}},q=d.compile=function(a,b){function d(c){try{return new i(c,h)+""}catch(d){return b.debug?p(d)():(b.debug=!0,q(a,b)(c))}}b=b||{};for(var g in e)void 0===b[g]&&(b[g]=e[g]);var h=b.filename;try{var i=c(a,b)}catch(a){return a.filename=h||"anonymous",a.name="Syntax Error",p(a)}return d.prototype=i.prototype,d.toString=function(){return i.toString()},h&&b.cache&&(f[h]=d),d},r=n.$each,s="break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined",t=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g,u=/[^\w$]+/g,v=new RegExp(["\\b"+s.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),w=/^\d[^,]*|,\d[^,]*/g,x=/^,+|,+$/g,y=/^$|,+/;"object"==typeof exports&&"undefined"!=typeof module?module.exports=d:"function"==typeof define?define('template',[],function(){return d}):this.template=d}();
  943. //! moment.js
  944. ;(function (global, factory) {
  945. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  946. typeof define === 'function' && define.amd ? define('moment/moment',factory) :
  947. global.moment = factory()
  948. }(this, (function () { 'use strict';
  949. var hookCallback;
  950. function hooks () {
  951. return hookCallback.apply(null, arguments);
  952. }
  953. // This is done to register the method called with moment()
  954. // without creating circular dependencies.
  955. function setHookCallback (callback) {
  956. hookCallback = callback;
  957. }
  958. function isArray(input) {
  959. return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  960. }
  961. function isObject(input) {
  962. // IE8 will treat undefined and null as object if it wasn't for
  963. // input != null
  964. return input != null && Object.prototype.toString.call(input) === '[object Object]';
  965. }
  966. function isObjectEmpty(obj) {
  967. if (Object.getOwnPropertyNames) {
  968. return (Object.getOwnPropertyNames(obj).length === 0);
  969. } else {
  970. var k;
  971. for (k in obj) {
  972. if (obj.hasOwnProperty(k)) {
  973. return false;
  974. }
  975. }
  976. return true;
  977. }
  978. }
  979. function isUndefined(input) {
  980. return input === void 0;
  981. }
  982. function isNumber(input) {
  983. return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
  984. }
  985. function isDate(input) {
  986. return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  987. }
  988. function map(arr, fn) {
  989. var res = [], i;
  990. for (i = 0; i < arr.length; ++i) {
  991. res.push(fn(arr[i], i));
  992. }
  993. return res;
  994. }
  995. function hasOwnProp(a, b) {
  996. return Object.prototype.hasOwnProperty.call(a, b);
  997. }
  998. function extend(a, b) {
  999. for (var i in b) {
  1000. if (hasOwnProp(b, i)) {
  1001. a[i] = b[i];
  1002. }
  1003. }
  1004. if (hasOwnProp(b, 'toString')) {
  1005. a.toString = b.toString;
  1006. }
  1007. if (hasOwnProp(b, 'valueOf')) {
  1008. a.valueOf = b.valueOf;
  1009. }
  1010. return a;
  1011. }
  1012. function createUTC (input, format, locale, strict) {
  1013. return createLocalOrUTC(input, format, locale, strict, true).utc();
  1014. }
  1015. function defaultParsingFlags() {
  1016. // We need to deep clone this object.
  1017. return {
  1018. empty : false,
  1019. unusedTokens : [],
  1020. unusedInput : [],
  1021. overflow : -2,
  1022. charsLeftOver : 0,
  1023. nullInput : false,
  1024. invalidMonth : null,
  1025. invalidFormat : false,
  1026. userInvalidated : false,
  1027. iso : false,
  1028. parsedDateParts : [],
  1029. meridiem : null,
  1030. rfc2822 : false,
  1031. weekdayMismatch : false
  1032. };
  1033. }
  1034. function getParsingFlags(m) {
  1035. if (m._pf == null) {
  1036. m._pf = defaultParsingFlags();
  1037. }
  1038. return m._pf;
  1039. }
  1040. var some;
  1041. if (Array.prototype.some) {
  1042. some = Array.prototype.some;
  1043. } else {
  1044. some = function (fun) {
  1045. var t = Object(this);
  1046. var len = t.length >>> 0;
  1047. for (var i = 0; i < len; i++) {
  1048. if (i in t && fun.call(this, t[i], i, t)) {
  1049. return true;
  1050. }
  1051. }
  1052. return false;
  1053. };
  1054. }
  1055. function isValid(m) {
  1056. if (m._isValid == null) {
  1057. var flags = getParsingFlags(m);
  1058. var parsedParts = some.call(flags.parsedDateParts, function (i) {
  1059. return i != null;
  1060. });
  1061. var isNowValid = !isNaN(m._d.getTime()) &&
  1062. flags.overflow < 0 &&
  1063. !flags.empty &&
  1064. !flags.invalidMonth &&
  1065. !flags.invalidWeekday &&
  1066. !flags.weekdayMismatch &&
  1067. !flags.nullInput &&
  1068. !flags.invalidFormat &&
  1069. !flags.userInvalidated &&
  1070. (!flags.meridiem || (flags.meridiem && parsedParts));
  1071. if (m._strict) {
  1072. isNowValid = isNowValid &&
  1073. flags.charsLeftOver === 0 &&
  1074. flags.unusedTokens.length === 0 &&
  1075. flags.bigHour === undefined;
  1076. }
  1077. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  1078. m._isValid = isNowValid;
  1079. }
  1080. else {
  1081. return isNowValid;
  1082. }
  1083. }
  1084. return m._isValid;
  1085. }
  1086. function createInvalid (flags) {
  1087. var m = createUTC(NaN);
  1088. if (flags != null) {
  1089. extend(getParsingFlags(m), flags);
  1090. }
  1091. else {
  1092. getParsingFlags(m).userInvalidated = true;
  1093. }
  1094. return m;
  1095. }
  1096. // Plugins that add properties should also add the key here (null value),
  1097. // so we can properly clone ourselves.
  1098. var momentProperties = hooks.momentProperties = [];
  1099. function copyConfig(to, from) {
  1100. var i, prop, val;
  1101. if (!isUndefined(from._isAMomentObject)) {
  1102. to._isAMomentObject = from._isAMomentObject;
  1103. }
  1104. if (!isUndefined(from._i)) {
  1105. to._i = from._i;
  1106. }
  1107. if (!isUndefined(from._f)) {
  1108. to._f = from._f;
  1109. }
  1110. if (!isUndefined(from._l)) {
  1111. to._l = from._l;
  1112. }
  1113. if (!isUndefined(from._strict)) {
  1114. to._strict = from._strict;
  1115. }
  1116. if (!isUndefined(from._tzm)) {
  1117. to._tzm = from._tzm;
  1118. }
  1119. if (!isUndefined(from._isUTC)) {
  1120. to._isUTC = from._isUTC;
  1121. }
  1122. if (!isUndefined(from._offset)) {
  1123. to._offset = from._offset;
  1124. }
  1125. if (!isUndefined(from._pf)) {
  1126. to._pf = getParsingFlags(from);
  1127. }
  1128. if (!isUndefined(from._locale)) {
  1129. to._locale = from._locale;
  1130. }
  1131. if (momentProperties.length > 0) {
  1132. for (i = 0; i < momentProperties.length; i++) {
  1133. prop = momentProperties[i];
  1134. val = from[prop];
  1135. if (!isUndefined(val)) {
  1136. to[prop] = val;
  1137. }
  1138. }
  1139. }
  1140. return to;
  1141. }
  1142. var updateInProgress = false;
  1143. // Moment prototype object
  1144. function Moment(config) {
  1145. copyConfig(this, config);
  1146. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  1147. if (!this.isValid()) {
  1148. this._d = new Date(NaN);
  1149. }
  1150. // Prevent infinite loop in case updateOffset creates new moment
  1151. // objects.
  1152. if (updateInProgress === false) {
  1153. updateInProgress = true;
  1154. hooks.updateOffset(this);
  1155. updateInProgress = false;
  1156. }
  1157. }
  1158. function isMoment (obj) {
  1159. return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
  1160. }
  1161. function absFloor (number) {
  1162. if (number < 0) {
  1163. // -0 -> 0
  1164. return Math.ceil(number) || 0;
  1165. } else {
  1166. return Math.floor(number);
  1167. }
  1168. }
  1169. function toInt(argumentForCoercion) {
  1170. var coercedNumber = +argumentForCoercion,
  1171. value = 0;
  1172. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  1173. value = absFloor(coercedNumber);
  1174. }
  1175. return value;
  1176. }
  1177. // compare two arrays, return the number of differences
  1178. function compareArrays(array1, array2, dontConvert) {
  1179. var len = Math.min(array1.length, array2.length),
  1180. lengthDiff = Math.abs(array1.length - array2.length),
  1181. diffs = 0,
  1182. i;
  1183. for (i = 0; i < len; i++) {
  1184. if ((dontConvert && array1[i] !== array2[i]) ||
  1185. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  1186. diffs++;
  1187. }
  1188. }
  1189. return diffs + lengthDiff;
  1190. }
  1191. function warn(msg) {
  1192. if (hooks.suppressDeprecationWarnings === false &&
  1193. (typeof console !== 'undefined') && console.warn) {
  1194. console.warn('Deprecation warning: ' + msg);
  1195. }
  1196. }
  1197. function deprecate(msg, fn) {
  1198. var firstTime = true;
  1199. return extend(function () {
  1200. if (hooks.deprecationHandler != null) {
  1201. hooks.deprecationHandler(null, msg);
  1202. }
  1203. if (firstTime) {
  1204. var args = [];
  1205. var arg;
  1206. for (var i = 0; i < arguments.length; i++) {
  1207. arg = '';
  1208. if (typeof arguments[i] === 'object') {
  1209. arg += '\n[' + i + '] ';
  1210. for (var key in arguments[0]) {
  1211. arg += key + ': ' + arguments[0][key] + ', ';
  1212. }
  1213. arg = arg.slice(0, -2); // Remove trailing comma and space
  1214. } else {
  1215. arg = arguments[i];
  1216. }
  1217. args.push(arg);
  1218. }
  1219. warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
  1220. firstTime = false;
  1221. }
  1222. return fn.apply(this, arguments);
  1223. }, fn);
  1224. }
  1225. var deprecations = {};
  1226. function deprecateSimple(name, msg) {
  1227. if (hooks.deprecationHandler != null) {
  1228. hooks.deprecationHandler(name, msg);
  1229. }
  1230. if (!deprecations[name]) {
  1231. warn(msg);
  1232. deprecations[name] = true;
  1233. }
  1234. }
  1235. hooks.suppressDeprecationWarnings = false;
  1236. hooks.deprecationHandler = null;
  1237. function isFunction(input) {
  1238. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  1239. }
  1240. function set (config) {
  1241. var prop, i;
  1242. for (i in config) {
  1243. prop = config[i];
  1244. if (isFunction(prop)) {
  1245. this[i] = prop;
  1246. } else {
  1247. this['_' + i] = prop;
  1248. }
  1249. }
  1250. this._config = config;
  1251. // Lenient ordinal parsing accepts just a number in addition to
  1252. // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
  1253. // TODO: Remove "ordinalParse" fallback in next major release.
  1254. this._dayOfMonthOrdinalParseLenient = new RegExp(
  1255. (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
  1256. '|' + (/\d{1,2}/).source);
  1257. }
  1258. function mergeConfigs(parentConfig, childConfig) {
  1259. var res = extend({}, parentConfig), prop;
  1260. for (prop in childConfig) {
  1261. if (hasOwnProp(childConfig, prop)) {
  1262. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  1263. res[prop] = {};
  1264. extend(res[prop], parentConfig[prop]);
  1265. extend(res[prop], childConfig[prop]);
  1266. } else if (childConfig[prop] != null) {
  1267. res[prop] = childConfig[prop];
  1268. } else {
  1269. delete res[prop];
  1270. }
  1271. }
  1272. }
  1273. for (prop in parentConfig) {
  1274. if (hasOwnProp(parentConfig, prop) &&
  1275. !hasOwnProp(childConfig, prop) &&
  1276. isObject(parentConfig[prop])) {
  1277. // make sure changes to properties don't modify parent config
  1278. res[prop] = extend({}, res[prop]);
  1279. }
  1280. }
  1281. return res;
  1282. }
  1283. function Locale(config) {
  1284. if (config != null) {
  1285. this.set(config);
  1286. }
  1287. }
  1288. var keys;
  1289. if (Object.keys) {
  1290. keys = Object.keys;
  1291. } else {
  1292. keys = function (obj) {
  1293. var i, res = [];
  1294. for (i in obj) {
  1295. if (hasOwnProp(obj, i)) {
  1296. res.push(i);
  1297. }
  1298. }
  1299. return res;
  1300. };
  1301. }
  1302. var defaultCalendar = {
  1303. sameDay : '[Today at] LT',
  1304. nextDay : '[Tomorrow at] LT',
  1305. nextWeek : 'dddd [at] LT',
  1306. lastDay : '[Yesterday at] LT',
  1307. lastWeek : '[Last] dddd [at] LT',
  1308. sameElse : 'L'
  1309. };
  1310. function calendar (key, mom, now) {
  1311. var output = this._calendar[key] || this._calendar['sameElse'];
  1312. return isFunction(output) ? output.call(mom, now) : output;
  1313. }
  1314. var defaultLongDateFormat = {
  1315. LTS : 'h:mm:ss A',
  1316. LT : 'h:mm A',
  1317. L : 'MM/DD/YYYY',
  1318. LL : 'MMMM D, YYYY',
  1319. LLL : 'MMMM D, YYYY h:mm A',
  1320. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  1321. };
  1322. function longDateFormat (key) {
  1323. var format = this._longDateFormat[key],
  1324. formatUpper = this._longDateFormat[key.toUpperCase()];
  1325. if (format || !formatUpper) {
  1326. return format;
  1327. }
  1328. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
  1329. return val.slice(1);
  1330. });
  1331. return this._longDateFormat[key];
  1332. }
  1333. var defaultInvalidDate = 'Invalid date';
  1334. function invalidDate () {
  1335. return this._invalidDate;
  1336. }
  1337. var defaultOrdinal = '%d';
  1338. var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  1339. function ordinal (number) {
  1340. return this._ordinal.replace('%d', number);
  1341. }
  1342. var defaultRelativeTime = {
  1343. future : 'in %s',
  1344. past : '%s ago',
  1345. s : 'a few seconds',
  1346. ss : '%d seconds',
  1347. m : 'a minute',
  1348. mm : '%d minutes',
  1349. h : 'an hour',
  1350. hh : '%d hours',
  1351. d : 'a day',
  1352. dd : '%d days',
  1353. M : 'a month',
  1354. MM : '%d months',
  1355. y : 'a year',
  1356. yy : '%d years'
  1357. };
  1358. function relativeTime (number, withoutSuffix, string, isFuture) {
  1359. var output = this._relativeTime[string];
  1360. return (isFunction(output)) ?
  1361. output(number, withoutSuffix, string, isFuture) :
  1362. output.replace(/%d/i, number);
  1363. }
  1364. function pastFuture (diff, output) {
  1365. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  1366. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  1367. }
  1368. var aliases = {};
  1369. function addUnitAlias (unit, shorthand) {
  1370. var lowerCase = unit.toLowerCase();
  1371. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  1372. }
  1373. function normalizeUnits(units) {
  1374. return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  1375. }
  1376. function normalizeObjectUnits(inputObject) {
  1377. var normalizedInput = {},
  1378. normalizedProp,
  1379. prop;
  1380. for (prop in inputObject) {
  1381. if (hasOwnProp(inputObject, prop)) {
  1382. normalizedProp = normalizeUnits(prop);
  1383. if (normalizedProp) {
  1384. normalizedInput[normalizedProp] = inputObject[prop];
  1385. }
  1386. }
  1387. }
  1388. return normalizedInput;
  1389. }
  1390. var priorities = {};
  1391. function addUnitPriority(unit, priority) {
  1392. priorities[unit] = priority;
  1393. }
  1394. function getPrioritizedUnits(unitsObj) {
  1395. var units = [];
  1396. for (var u in unitsObj) {
  1397. units.push({unit: u, priority: priorities[u]});
  1398. }
  1399. units.sort(function (a, b) {
  1400. return a.priority - b.priority;
  1401. });
  1402. return units;
  1403. }
  1404. function zeroFill(number, targetLength, forceSign) {
  1405. var absNumber = '' + Math.abs(number),
  1406. zerosToFill = targetLength - absNumber.length,
  1407. sign = number >= 0;
  1408. return (sign ? (forceSign ? '+' : '') : '-') +
  1409. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  1410. }
  1411. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  1412. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  1413. var formatFunctions = {};
  1414. var formatTokenFunctions = {};
  1415. // token: 'M'
  1416. // padded: ['MM', 2]
  1417. // ordinal: 'Mo'
  1418. // callback: function () { this.month() + 1 }
  1419. function addFormatToken (token, padded, ordinal, callback) {
  1420. var func = callback;
  1421. if (typeof callback === 'string') {
  1422. func = function () {
  1423. return this[callback]();
  1424. };
  1425. }
  1426. if (token) {
  1427. formatTokenFunctions[token] = func;
  1428. }
  1429. if (padded) {
  1430. formatTokenFunctions[padded[0]] = function () {
  1431. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  1432. };
  1433. }
  1434. if (ordinal) {
  1435. formatTokenFunctions[ordinal] = function () {
  1436. return this.localeData().ordinal(func.apply(this, arguments), token);
  1437. };
  1438. }
  1439. }
  1440. function removeFormattingTokens(input) {
  1441. if (input.match(/\[[\s\S]/)) {
  1442. return input.replace(/^\[|\]$/g, '');
  1443. }
  1444. return input.replace(/\\/g, '');
  1445. }
  1446. function makeFormatFunction(format) {
  1447. var array = format.match(formattingTokens), i, length;
  1448. for (i = 0, length = array.length; i < length; i++) {
  1449. if (formatTokenFunctions[array[i]]) {
  1450. array[i] = formatTokenFunctions[array[i]];
  1451. } else {
  1452. array[i] = removeFormattingTokens(array[i]);
  1453. }
  1454. }
  1455. return function (mom) {
  1456. var output = '', i;
  1457. for (i = 0; i < length; i++) {
  1458. output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
  1459. }
  1460. return output;
  1461. };
  1462. }
  1463. // format date using native date object
  1464. function formatMoment(m, format) {
  1465. if (!m.isValid()) {
  1466. return m.localeData().invalidDate();
  1467. }
  1468. format = expandFormat(format, m.localeData());
  1469. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  1470. return formatFunctions[format](m);
  1471. }
  1472. function expandFormat(format, locale) {
  1473. var i = 5;
  1474. function replaceLongDateFormatTokens(input) {
  1475. return locale.longDateFormat(input) || input;
  1476. }
  1477. localFormattingTokens.lastIndex = 0;
  1478. while (i >= 0 && localFormattingTokens.test(format)) {
  1479. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  1480. localFormattingTokens.lastIndex = 0;
  1481. i -= 1;
  1482. }
  1483. return format;
  1484. }
  1485. var match1 = /\d/; // 0 - 9
  1486. var match2 = /\d\d/; // 00 - 99
  1487. var match3 = /\d{3}/; // 000 - 999
  1488. var match4 = /\d{4}/; // 0000 - 9999
  1489. var match6 = /[+-]?\d{6}/; // -999999 - 999999
  1490. var match1to2 = /\d\d?/; // 0 - 99
  1491. var match3to4 = /\d\d\d\d?/; // 999 - 9999
  1492. var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
  1493. var match1to3 = /\d{1,3}/; // 0 - 999
  1494. var match1to4 = /\d{1,4}/; // 0 - 9999
  1495. var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
  1496. var matchUnsigned = /\d+/; // 0 - inf
  1497. var matchSigned = /[+-]?\d+/; // -inf - inf
  1498. var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
  1499. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  1500. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
  1501. // any word (or two) characters or numbers including two/three word month in arabic.
  1502. // includes scottish gaelic two word and hyphenated months
  1503. var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
  1504. var regexes = {};
  1505. function addRegexToken (token, regex, strictRegex) {
  1506. regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
  1507. return (isStrict && strictRegex) ? strictRegex : regex;
  1508. };
  1509. }
  1510. function getParseRegexForToken (token, config) {
  1511. if (!hasOwnProp(regexes, token)) {
  1512. return new RegExp(unescapeFormat(token));
  1513. }
  1514. return regexes[token](config._strict, config._locale);
  1515. }
  1516. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  1517. function unescapeFormat(s) {
  1518. return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
  1519. return p1 || p2 || p3 || p4;
  1520. }));
  1521. }
  1522. function regexEscape(s) {
  1523. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  1524. }
  1525. var tokens = {};
  1526. function addParseToken (token, callback) {
  1527. var i, func = callback;
  1528. if (typeof token === 'string') {
  1529. token = [token];
  1530. }
  1531. if (isNumber(callback)) {
  1532. func = function (input, array) {
  1533. array[callback] = toInt(input);
  1534. };
  1535. }
  1536. for (i = 0; i < token.length; i++) {
  1537. tokens[token[i]] = func;
  1538. }
  1539. }
  1540. function addWeekParseToken (token, callback) {
  1541. addParseToken(token, function (input, array, config, token) {
  1542. config._w = config._w || {};
  1543. callback(input, config._w, config, token);
  1544. });
  1545. }
  1546. function addTimeToArrayFromToken(token, input, config) {
  1547. if (input != null && hasOwnProp(tokens, token)) {
  1548. tokens[token](input, config._a, config, token);
  1549. }
  1550. }
  1551. var YEAR = 0;
  1552. var MONTH = 1;
  1553. var DATE = 2;
  1554. var HOUR = 3;
  1555. var MINUTE = 4;
  1556. var SECOND = 5;
  1557. var MILLISECOND = 6;
  1558. var WEEK = 7;
  1559. var WEEKDAY = 8;
  1560. // FORMATTING
  1561. addFormatToken('Y', 0, 0, function () {
  1562. var y = this.year();
  1563. return y <= 9999 ? '' + y : '+' + y;
  1564. });
  1565. addFormatToken(0, ['YY', 2], 0, function () {
  1566. return this.year() % 100;
  1567. });
  1568. addFormatToken(0, ['YYYY', 4], 0, 'year');
  1569. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  1570. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  1571. // ALIASES
  1572. addUnitAlias('year', 'y');
  1573. // PRIORITIES
  1574. addUnitPriority('year', 1);
  1575. // PARSING
  1576. addRegexToken('Y', matchSigned);
  1577. addRegexToken('YY', match1to2, match2);
  1578. addRegexToken('YYYY', match1to4, match4);
  1579. addRegexToken('YYYYY', match1to6, match6);
  1580. addRegexToken('YYYYYY', match1to6, match6);
  1581. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  1582. addParseToken('YYYY', function (input, array) {
  1583. array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  1584. });
  1585. addParseToken('YY', function (input, array) {
  1586. array[YEAR] = hooks.parseTwoDigitYear(input);
  1587. });
  1588. addParseToken('Y', function (input, array) {
  1589. array[YEAR] = parseInt(input, 10);
  1590. });
  1591. // HELPERS
  1592. function daysInYear(year) {
  1593. return isLeapYear(year) ? 366 : 365;
  1594. }
  1595. function isLeapYear(year) {
  1596. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  1597. }
  1598. // HOOKS
  1599. hooks.parseTwoDigitYear = function (input) {
  1600. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  1601. };
  1602. // MOMENTS
  1603. var getSetYear = makeGetSet('FullYear', true);
  1604. function getIsLeapYear () {
  1605. return isLeapYear(this.year());
  1606. }
  1607. function makeGetSet (unit, keepTime) {
  1608. return function (value) {
  1609. if (value != null) {
  1610. set$1(this, unit, value);
  1611. hooks.updateOffset(this, keepTime);
  1612. return this;
  1613. } else {
  1614. return get(this, unit);
  1615. }
  1616. };
  1617. }
  1618. function get (mom, unit) {
  1619. return mom.isValid() ?
  1620. mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
  1621. }
  1622. function set$1 (mom, unit, value) {
  1623. if (mom.isValid() && !isNaN(value)) {
  1624. if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
  1625. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
  1626. }
  1627. else {
  1628. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  1629. }
  1630. }
  1631. }
  1632. // MOMENTS
  1633. function stringGet (units) {
  1634. units = normalizeUnits(units);
  1635. if (isFunction(this[units])) {
  1636. return this[units]();
  1637. }
  1638. return this;
  1639. }
  1640. function stringSet (units, value) {
  1641. if (typeof units === 'object') {
  1642. units = normalizeObjectUnits(units);
  1643. var prioritized = getPrioritizedUnits(units);
  1644. for (var i = 0; i < prioritized.length; i++) {
  1645. this[prioritized[i].unit](units[prioritized[i].unit]);
  1646. }
  1647. } else {
  1648. units = normalizeUnits(units);
  1649. if (isFunction(this[units])) {
  1650. return this[units](value);
  1651. }
  1652. }
  1653. return this;
  1654. }
  1655. function mod(n, x) {
  1656. return ((n % x) + x) % x;
  1657. }
  1658. var indexOf;
  1659. if (Array.prototype.indexOf) {
  1660. indexOf = Array.prototype.indexOf;
  1661. } else {
  1662. indexOf = function (o) {
  1663. // I know
  1664. var i;
  1665. for (i = 0; i < this.length; ++i) {
  1666. if (this[i] === o) {
  1667. return i;
  1668. }
  1669. }
  1670. return -1;
  1671. };
  1672. }
  1673. function daysInMonth(year, month) {
  1674. if (isNaN(year) || isNaN(month)) {
  1675. return NaN;
  1676. }
  1677. var modMonth = mod(month, 12);
  1678. year += (month - modMonth) / 12;
  1679. return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2);
  1680. }
  1681. // FORMATTING
  1682. addFormatToken('M', ['MM', 2], 'Mo', function () {
  1683. return this.month() + 1;
  1684. });
  1685. addFormatToken('MMM', 0, 0, function (format) {
  1686. return this.localeData().monthsShort(this, format);
  1687. });
  1688. addFormatToken('MMMM', 0, 0, function (format) {
  1689. return this.localeData().months(this, format);
  1690. });
  1691. // ALIASES
  1692. addUnitAlias('month', 'M');
  1693. // PRIORITY
  1694. addUnitPriority('month', 8);
  1695. // PARSING
  1696. addRegexToken('M', match1to2);
  1697. addRegexToken('MM', match1to2, match2);
  1698. addRegexToken('MMM', function (isStrict, locale) {
  1699. return locale.monthsShortRegex(isStrict);
  1700. });
  1701. addRegexToken('MMMM', function (isStrict, locale) {
  1702. return locale.monthsRegex(isStrict);
  1703. });
  1704. addParseToken(['M', 'MM'], function (input, array) {
  1705. array[MONTH] = toInt(input) - 1;
  1706. });
  1707. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  1708. var month = config._locale.monthsParse(input, token, config._strict);
  1709. // if we didn't find a month name, mark the date as invalid.
  1710. if (month != null) {
  1711. array[MONTH] = month;
  1712. } else {
  1713. getParsingFlags(config).invalidMonth = input;
  1714. }
  1715. });
  1716. // LOCALES
  1717. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  1718. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  1719. function localeMonths (m, format) {
  1720. if (!m) {
  1721. return isArray(this._months) ? this._months :
  1722. this._months['standalone'];
  1723. }
  1724. return isArray(this._months) ? this._months[m.month()] :
  1725. this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  1726. }
  1727. var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  1728. function localeMonthsShort (m, format) {
  1729. if (!m) {
  1730. return isArray(this._monthsShort) ? this._monthsShort :
  1731. this._monthsShort['standalone'];
  1732. }
  1733. return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
  1734. this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  1735. }
  1736. function handleStrictParse(monthName, format, strict) {
  1737. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  1738. if (!this._monthsParse) {
  1739. // this is not used
  1740. this._monthsParse = [];
  1741. this._longMonthsParse = [];
  1742. this._shortMonthsParse = [];
  1743. for (i = 0; i < 12; ++i) {
  1744. mom = createUTC([2000, i]);
  1745. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  1746. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  1747. }
  1748. }
  1749. if (strict) {
  1750. if (format === 'MMM') {
  1751. ii = indexOf.call(this._shortMonthsParse, llc);
  1752. return ii !== -1 ? ii : null;
  1753. } else {
  1754. ii = indexOf.call(this._longMonthsParse, llc);
  1755. return ii !== -1 ? ii : null;
  1756. }
  1757. } else {
  1758. if (format === 'MMM') {
  1759. ii = indexOf.call(this._shortMonthsParse, llc);
  1760. if (ii !== -1) {
  1761. return ii;
  1762. }
  1763. ii = indexOf.call(this._longMonthsParse, llc);
  1764. return ii !== -1 ? ii : null;
  1765. } else {
  1766. ii = indexOf.call(this._longMonthsParse, llc);
  1767. if (ii !== -1) {
  1768. return ii;
  1769. }
  1770. ii = indexOf.call(this._shortMonthsParse, llc);
  1771. return ii !== -1 ? ii : null;
  1772. }
  1773. }
  1774. }
  1775. function localeMonthsParse (monthName, format, strict) {
  1776. var i, mom, regex;
  1777. if (this._monthsParseExact) {
  1778. return handleStrictParse.call(this, monthName, format, strict);
  1779. }
  1780. if (!this._monthsParse) {
  1781. this._monthsParse = [];
  1782. this._longMonthsParse = [];
  1783. this._shortMonthsParse = [];
  1784. }
  1785. // TODO: add sorting
  1786. // Sorting makes sure if one month (or abbr) is a prefix of another
  1787. // see sorting in computeMonthsParse
  1788. for (i = 0; i < 12; i++) {
  1789. // make the regex if we don't have it already
  1790. mom = createUTC([2000, i]);
  1791. if (strict && !this._longMonthsParse[i]) {
  1792. this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
  1793. this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
  1794. }
  1795. if (!strict && !this._monthsParse[i]) {
  1796. regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  1797. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  1798. }
  1799. // test the regex
  1800. if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
  1801. return i;
  1802. } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
  1803. return i;
  1804. } else if (!strict && this._monthsParse[i].test(monthName)) {
  1805. return i;
  1806. }
  1807. }
  1808. }
  1809. // MOMENTS
  1810. function setMonth (mom, value) {
  1811. var dayOfMonth;
  1812. if (!mom.isValid()) {
  1813. // No op
  1814. return mom;
  1815. }
  1816. if (typeof value === 'string') {
  1817. if (/^\d+$/.test(value)) {
  1818. value = toInt(value);
  1819. } else {
  1820. value = mom.localeData().monthsParse(value);
  1821. // TODO: Another silent failure?
  1822. if (!isNumber(value)) {
  1823. return mom;
  1824. }
  1825. }
  1826. }
  1827. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  1828. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  1829. return mom;
  1830. }
  1831. function getSetMonth (value) {
  1832. if (value != null) {
  1833. setMonth(this, value);
  1834. hooks.updateOffset(this, true);
  1835. return this;
  1836. } else {
  1837. return get(this, 'Month');
  1838. }
  1839. }
  1840. function getDaysInMonth () {
  1841. return daysInMonth(this.year(), this.month());
  1842. }
  1843. var defaultMonthsShortRegex = matchWord;
  1844. function monthsShortRegex (isStrict) {
  1845. if (this._monthsParseExact) {
  1846. if (!hasOwnProp(this, '_monthsRegex')) {
  1847. computeMonthsParse.call(this);
  1848. }
  1849. if (isStrict) {
  1850. return this._monthsShortStrictRegex;
  1851. } else {
  1852. return this._monthsShortRegex;
  1853. }
  1854. } else {
  1855. if (!hasOwnProp(this, '_monthsShortRegex')) {
  1856. this._monthsShortRegex = defaultMonthsShortRegex;
  1857. }
  1858. return this._monthsShortStrictRegex && isStrict ?
  1859. this._monthsShortStrictRegex : this._monthsShortRegex;
  1860. }
  1861. }
  1862. var defaultMonthsRegex = matchWord;
  1863. function monthsRegex (isStrict) {
  1864. if (this._monthsParseExact) {
  1865. if (!hasOwnProp(this, '_monthsRegex')) {
  1866. computeMonthsParse.call(this);
  1867. }
  1868. if (isStrict) {
  1869. return this._monthsStrictRegex;
  1870. } else {
  1871. return this._monthsRegex;
  1872. }
  1873. } else {
  1874. if (!hasOwnProp(this, '_monthsRegex')) {
  1875. this._monthsRegex = defaultMonthsRegex;
  1876. }
  1877. return this._monthsStrictRegex && isStrict ?
  1878. this._monthsStrictRegex : this._monthsRegex;
  1879. }
  1880. }
  1881. function computeMonthsParse () {
  1882. function cmpLenRev(a, b) {
  1883. return b.length - a.length;
  1884. }
  1885. var shortPieces = [], longPieces = [], mixedPieces = [],
  1886. i, mom;
  1887. for (i = 0; i < 12; i++) {
  1888. // make the regex if we don't have it already
  1889. mom = createUTC([2000, i]);
  1890. shortPieces.push(this.monthsShort(mom, ''));
  1891. longPieces.push(this.months(mom, ''));
  1892. mixedPieces.push(this.months(mom, ''));
  1893. mixedPieces.push(this.monthsShort(mom, ''));
  1894. }
  1895. // Sorting makes sure if one month (or abbr) is a prefix of another it
  1896. // will match the longer piece.
  1897. shortPieces.sort(cmpLenRev);
  1898. longPieces.sort(cmpLenRev);
  1899. mixedPieces.sort(cmpLenRev);
  1900. for (i = 0; i < 12; i++) {
  1901. shortPieces[i] = regexEscape(shortPieces[i]);
  1902. longPieces[i] = regexEscape(longPieces[i]);
  1903. }
  1904. for (i = 0; i < 24; i++) {
  1905. mixedPieces[i] = regexEscape(mixedPieces[i]);
  1906. }
  1907. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  1908. this._monthsShortRegex = this._monthsRegex;
  1909. this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  1910. this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  1911. }
  1912. function createDate (y, m, d, h, M, s, ms) {
  1913. // can't just apply() to create a date:
  1914. // https://stackoverflow.com/q/181348
  1915. var date;
  1916. // the date constructor remaps years 0-99 to 1900-1999
  1917. if (y < 100 && y >= 0) {
  1918. // preserve leap years using a full 400 year cycle, then reset
  1919. date = new Date(y + 400, m, d, h, M, s, ms);
  1920. if (isFinite(date.getFullYear())) {
  1921. date.setFullYear(y);
  1922. }
  1923. } else {
  1924. date = new Date(y, m, d, h, M, s, ms);
  1925. }
  1926. return date;
  1927. }
  1928. function createUTCDate (y) {
  1929. var date;
  1930. // the Date.UTC function remaps years 0-99 to 1900-1999
  1931. if (y < 100 && y >= 0) {
  1932. var args = Array.prototype.slice.call(arguments);
  1933. // preserve leap years using a full 400 year cycle, then reset
  1934. args[0] = y + 400;
  1935. date = new Date(Date.UTC.apply(null, args));
  1936. if (isFinite(date.getUTCFullYear())) {
  1937. date.setUTCFullYear(y);
  1938. }
  1939. } else {
  1940. date = new Date(Date.UTC.apply(null, arguments));
  1941. }
  1942. return date;
  1943. }
  1944. // start-of-first-week - start-of-year
  1945. function firstWeekOffset(year, dow, doy) {
  1946. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  1947. fwd = 7 + dow - doy,
  1948. // first-week day local weekday -- which local weekday is fwd
  1949. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  1950. return -fwdlw + fwd - 1;
  1951. }
  1952. // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  1953. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  1954. var localWeekday = (7 + weekday - dow) % 7,
  1955. weekOffset = firstWeekOffset(year, dow, doy),
  1956. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  1957. resYear, resDayOfYear;
  1958. if (dayOfYear <= 0) {
  1959. resYear = year - 1;
  1960. resDayOfYear = daysInYear(resYear) + dayOfYear;
  1961. } else if (dayOfYear > daysInYear(year)) {
  1962. resYear = year + 1;
  1963. resDayOfYear = dayOfYear - daysInYear(year);
  1964. } else {
  1965. resYear = year;
  1966. resDayOfYear = dayOfYear;
  1967. }
  1968. return {
  1969. year: resYear,
  1970. dayOfYear: resDayOfYear
  1971. };
  1972. }
  1973. function weekOfYear(mom, dow, doy) {
  1974. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  1975. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  1976. resWeek, resYear;
  1977. if (week < 1) {
  1978. resYear = mom.year() - 1;
  1979. resWeek = week + weeksInYear(resYear, dow, doy);
  1980. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  1981. resWeek = week - weeksInYear(mom.year(), dow, doy);
  1982. resYear = mom.year() + 1;
  1983. } else {
  1984. resYear = mom.year();
  1985. resWeek = week;
  1986. }
  1987. return {
  1988. week: resWeek,
  1989. year: resYear
  1990. };
  1991. }
  1992. function weeksInYear(year, dow, doy) {
  1993. var weekOffset = firstWeekOffset(year, dow, doy),
  1994. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  1995. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  1996. }
  1997. // FORMATTING
  1998. addFormatToken('w', ['ww', 2], 'wo', 'week');
  1999. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  2000. // ALIASES
  2001. addUnitAlias('week', 'w');
  2002. addUnitAlias('isoWeek', 'W');
  2003. // PRIORITIES
  2004. addUnitPriority('week', 5);
  2005. addUnitPriority('isoWeek', 5);
  2006. // PARSING
  2007. addRegexToken('w', match1to2);
  2008. addRegexToken('ww', match1to2, match2);
  2009. addRegexToken('W', match1to2);
  2010. addRegexToken('WW', match1to2, match2);
  2011. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
  2012. week[token.substr(0, 1)] = toInt(input);
  2013. });
  2014. // HELPERS
  2015. // LOCALES
  2016. function localeWeek (mom) {
  2017. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  2018. }
  2019. var defaultLocaleWeek = {
  2020. dow : 0, // Sunday is the first day of the week.
  2021. doy : 6 // The week that contains Jan 6th is the first week of the year.
  2022. };
  2023. function localeFirstDayOfWeek () {
  2024. return this._week.dow;
  2025. }
  2026. function localeFirstDayOfYear () {
  2027. return this._week.doy;
  2028. }
  2029. // MOMENTS
  2030. function getSetWeek (input) {
  2031. var week = this.localeData().week(this);
  2032. return input == null ? week : this.add((input - week) * 7, 'd');
  2033. }
  2034. function getSetISOWeek (input) {
  2035. var week = weekOfYear(this, 1, 4).week;
  2036. return input == null ? week : this.add((input - week) * 7, 'd');
  2037. }
  2038. // FORMATTING
  2039. addFormatToken('d', 0, 'do', 'day');
  2040. addFormatToken('dd', 0, 0, function (format) {
  2041. return this.localeData().weekdaysMin(this, format);
  2042. });
  2043. addFormatToken('ddd', 0, 0, function (format) {
  2044. return this.localeData().weekdaysShort(this, format);
  2045. });
  2046. addFormatToken('dddd', 0, 0, function (format) {
  2047. return this.localeData().weekdays(this, format);
  2048. });
  2049. addFormatToken('e', 0, 0, 'weekday');
  2050. addFormatToken('E', 0, 0, 'isoWeekday');
  2051. // ALIASES
  2052. addUnitAlias('day', 'd');
  2053. addUnitAlias('weekday', 'e');
  2054. addUnitAlias('isoWeekday', 'E');
  2055. // PRIORITY
  2056. addUnitPriority('day', 11);
  2057. addUnitPriority('weekday', 11);
  2058. addUnitPriority('isoWeekday', 11);
  2059. // PARSING
  2060. addRegexToken('d', match1to2);
  2061. addRegexToken('e', match1to2);
  2062. addRegexToken('E', match1to2);
  2063. addRegexToken('dd', function (isStrict, locale) {
  2064. return locale.weekdaysMinRegex(isStrict);
  2065. });
  2066. addRegexToken('ddd', function (isStrict, locale) {
  2067. return locale.weekdaysShortRegex(isStrict);
  2068. });
  2069. addRegexToken('dddd', function (isStrict, locale) {
  2070. return locale.weekdaysRegex(isStrict);
  2071. });
  2072. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  2073. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  2074. // if we didn't get a weekday name, mark the date as invalid
  2075. if (weekday != null) {
  2076. week.d = weekday;
  2077. } else {
  2078. getParsingFlags(config).invalidWeekday = input;
  2079. }
  2080. });
  2081. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  2082. week[token] = toInt(input);
  2083. });
  2084. // HELPERS
  2085. function parseWeekday(input, locale) {
  2086. if (typeof input !== 'string') {
  2087. return input;
  2088. }
  2089. if (!isNaN(input)) {
  2090. return parseInt(input, 10);
  2091. }
  2092. input = locale.weekdaysParse(input);
  2093. if (typeof input === 'number') {
  2094. return input;
  2095. }
  2096. return null;
  2097. }
  2098. function parseIsoWeekday(input, locale) {
  2099. if (typeof input === 'string') {
  2100. return locale.weekdaysParse(input) % 7 || 7;
  2101. }
  2102. return isNaN(input) ? null : input;
  2103. }
  2104. // LOCALES
  2105. function shiftWeekdays (ws, n) {
  2106. return ws.slice(n, 7).concat(ws.slice(0, n));
  2107. }
  2108. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  2109. function localeWeekdays (m, format) {
  2110. var weekdays = isArray(this._weekdays) ? this._weekdays :
  2111. this._weekdays[(m && m !== true && this._weekdays.isFormat.test(format)) ? 'format' : 'standalone'];
  2112. return (m === true) ? shiftWeekdays(weekdays, this._week.dow)
  2113. : (m) ? weekdays[m.day()] : weekdays;
  2114. }
  2115. var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  2116. function localeWeekdaysShort (m) {
  2117. return (m === true) ? shiftWeekdays(this._weekdaysShort, this._week.dow)
  2118. : (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  2119. }
  2120. var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  2121. function localeWeekdaysMin (m) {
  2122. return (m === true) ? shiftWeekdays(this._weekdaysMin, this._week.dow)
  2123. : (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  2124. }
  2125. function handleStrictParse$1(weekdayName, format, strict) {
  2126. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  2127. if (!this._weekdaysParse) {
  2128. this._weekdaysParse = [];
  2129. this._shortWeekdaysParse = [];
  2130. this._minWeekdaysParse = [];
  2131. for (i = 0; i < 7; ++i) {
  2132. mom = createUTC([2000, 1]).day(i);
  2133. this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
  2134. this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
  2135. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  2136. }
  2137. }
  2138. if (strict) {
  2139. if (format === 'dddd') {
  2140. ii = indexOf.call(this._weekdaysParse, llc);
  2141. return ii !== -1 ? ii : null;
  2142. } else if (format === 'ddd') {
  2143. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2144. return ii !== -1 ? ii : null;
  2145. } else {
  2146. ii = indexOf.call(this._minWeekdaysParse, llc);
  2147. return ii !== -1 ? ii : null;
  2148. }
  2149. } else {
  2150. if (format === 'dddd') {
  2151. ii = indexOf.call(this._weekdaysParse, llc);
  2152. if (ii !== -1) {
  2153. return ii;
  2154. }
  2155. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2156. if (ii !== -1) {
  2157. return ii;
  2158. }
  2159. ii = indexOf.call(this._minWeekdaysParse, llc);
  2160. return ii !== -1 ? ii : null;
  2161. } else if (format === 'ddd') {
  2162. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2163. if (ii !== -1) {
  2164. return ii;
  2165. }
  2166. ii = indexOf.call(this._weekdaysParse, llc);
  2167. if (ii !== -1) {
  2168. return ii;
  2169. }
  2170. ii = indexOf.call(this._minWeekdaysParse, llc);
  2171. return ii !== -1 ? ii : null;
  2172. } else {
  2173. ii = indexOf.call(this._minWeekdaysParse, llc);
  2174. if (ii !== -1) {
  2175. return ii;
  2176. }
  2177. ii = indexOf.call(this._weekdaysParse, llc);
  2178. if (ii !== -1) {
  2179. return ii;
  2180. }
  2181. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2182. return ii !== -1 ? ii : null;
  2183. }
  2184. }
  2185. }
  2186. function localeWeekdaysParse (weekdayName, format, strict) {
  2187. var i, mom, regex;
  2188. if (this._weekdaysParseExact) {
  2189. return handleStrictParse$1.call(this, weekdayName, format, strict);
  2190. }
  2191. if (!this._weekdaysParse) {
  2192. this._weekdaysParse = [];
  2193. this._minWeekdaysParse = [];
  2194. this._shortWeekdaysParse = [];
  2195. this._fullWeekdaysParse = [];
  2196. }
  2197. for (i = 0; i < 7; i++) {
  2198. // make the regex if we don't have it already
  2199. mom = createUTC([2000, 1]).day(i);
  2200. if (strict && !this._fullWeekdaysParse[i]) {
  2201. this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');
  2202. this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');
  2203. this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');
  2204. }
  2205. if (!this._weekdaysParse[i]) {
  2206. regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
  2207. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  2208. }
  2209. // test the regex
  2210. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  2211. return i;
  2212. } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  2213. return i;
  2214. } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  2215. return i;
  2216. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  2217. return i;
  2218. }
  2219. }
  2220. }
  2221. // MOMENTS
  2222. function getSetDayOfWeek (input) {
  2223. if (!this.isValid()) {
  2224. return input != null ? this : NaN;
  2225. }
  2226. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  2227. if (input != null) {
  2228. input = parseWeekday(input, this.localeData());
  2229. return this.add(input - day, 'd');
  2230. } else {
  2231. return day;
  2232. }
  2233. }
  2234. function getSetLocaleDayOfWeek (input) {
  2235. if (!this.isValid()) {
  2236. return input != null ? this : NaN;
  2237. }
  2238. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  2239. return input == null ? weekday : this.add(input - weekday, 'd');
  2240. }
  2241. function getSetISODayOfWeek (input) {
  2242. if (!this.isValid()) {
  2243. return input != null ? this : NaN;
  2244. }
  2245. // behaves the same as moment#day except
  2246. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  2247. // as a setter, sunday should belong to the previous week.
  2248. if (input != null) {
  2249. var weekday = parseIsoWeekday(input, this.localeData());
  2250. return this.day(this.day() % 7 ? weekday : weekday - 7);
  2251. } else {
  2252. return this.day() || 7;
  2253. }
  2254. }
  2255. var defaultWeekdaysRegex = matchWord;
  2256. function weekdaysRegex (isStrict) {
  2257. if (this._weekdaysParseExact) {
  2258. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2259. computeWeekdaysParse.call(this);
  2260. }
  2261. if (isStrict) {
  2262. return this._weekdaysStrictRegex;
  2263. } else {
  2264. return this._weekdaysRegex;
  2265. }
  2266. } else {
  2267. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2268. this._weekdaysRegex = defaultWeekdaysRegex;
  2269. }
  2270. return this._weekdaysStrictRegex && isStrict ?
  2271. this._weekdaysStrictRegex : this._weekdaysRegex;
  2272. }
  2273. }
  2274. var defaultWeekdaysShortRegex = matchWord;
  2275. function weekdaysShortRegex (isStrict) {
  2276. if (this._weekdaysParseExact) {
  2277. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2278. computeWeekdaysParse.call(this);
  2279. }
  2280. if (isStrict) {
  2281. return this._weekdaysShortStrictRegex;
  2282. } else {
  2283. return this._weekdaysShortRegex;
  2284. }
  2285. } else {
  2286. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  2287. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  2288. }
  2289. return this._weekdaysShortStrictRegex && isStrict ?
  2290. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  2291. }
  2292. }
  2293. var defaultWeekdaysMinRegex = matchWord;
  2294. function weekdaysMinRegex (isStrict) {
  2295. if (this._weekdaysParseExact) {
  2296. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2297. computeWeekdaysParse.call(this);
  2298. }
  2299. if (isStrict) {
  2300. return this._weekdaysMinStrictRegex;
  2301. } else {
  2302. return this._weekdaysMinRegex;
  2303. }
  2304. } else {
  2305. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  2306. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  2307. }
  2308. return this._weekdaysMinStrictRegex && isStrict ?
  2309. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  2310. }
  2311. }
  2312. function computeWeekdaysParse () {
  2313. function cmpLenRev(a, b) {
  2314. return b.length - a.length;
  2315. }
  2316. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
  2317. i, mom, minp, shortp, longp;
  2318. for (i = 0; i < 7; i++) {
  2319. // make the regex if we don't have it already
  2320. mom = createUTC([2000, 1]).day(i);
  2321. minp = this.weekdaysMin(mom, '');
  2322. shortp = this.weekdaysShort(mom, '');
  2323. longp = this.weekdays(mom, '');
  2324. minPieces.push(minp);
  2325. shortPieces.push(shortp);
  2326. longPieces.push(longp);
  2327. mixedPieces.push(minp);
  2328. mixedPieces.push(shortp);
  2329. mixedPieces.push(longp);
  2330. }
  2331. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  2332. // will match the longer piece.
  2333. minPieces.sort(cmpLenRev);
  2334. shortPieces.sort(cmpLenRev);
  2335. longPieces.sort(cmpLenRev);
  2336. mixedPieces.sort(cmpLenRev);
  2337. for (i = 0; i < 7; i++) {
  2338. shortPieces[i] = regexEscape(shortPieces[i]);
  2339. longPieces[i] = regexEscape(longPieces[i]);
  2340. mixedPieces[i] = regexEscape(mixedPieces[i]);
  2341. }
  2342. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  2343. this._weekdaysShortRegex = this._weekdaysRegex;
  2344. this._weekdaysMinRegex = this._weekdaysRegex;
  2345. this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  2346. this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  2347. this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  2348. }
  2349. // FORMATTING
  2350. function hFormat() {
  2351. return this.hours() % 12 || 12;
  2352. }
  2353. function kFormat() {
  2354. return this.hours() || 24;
  2355. }
  2356. addFormatToken('H', ['HH', 2], 0, 'hour');
  2357. addFormatToken('h', ['hh', 2], 0, hFormat);
  2358. addFormatToken('k', ['kk', 2], 0, kFormat);
  2359. addFormatToken('hmm', 0, 0, function () {
  2360. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  2361. });
  2362. addFormatToken('hmmss', 0, 0, function () {
  2363. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
  2364. zeroFill(this.seconds(), 2);
  2365. });
  2366. addFormatToken('Hmm', 0, 0, function () {
  2367. return '' + this.hours() + zeroFill(this.minutes(), 2);
  2368. });
  2369. addFormatToken('Hmmss', 0, 0, function () {
  2370. return '' + this.hours() + zeroFill(this.minutes(), 2) +
  2371. zeroFill(this.seconds(), 2);
  2372. });
  2373. function meridiem (token, lowercase) {
  2374. addFormatToken(token, 0, 0, function () {
  2375. return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
  2376. });
  2377. }
  2378. meridiem('a', true);
  2379. meridiem('A', false);
  2380. // ALIASES
  2381. addUnitAlias('hour', 'h');
  2382. // PRIORITY
  2383. addUnitPriority('hour', 13);
  2384. // PARSING
  2385. function matchMeridiem (isStrict, locale) {
  2386. return locale._meridiemParse;
  2387. }
  2388. addRegexToken('a', matchMeridiem);
  2389. addRegexToken('A', matchMeridiem);
  2390. addRegexToken('H', match1to2);
  2391. addRegexToken('h', match1to2);
  2392. addRegexToken('k', match1to2);
  2393. addRegexToken('HH', match1to2, match2);
  2394. addRegexToken('hh', match1to2, match2);
  2395. addRegexToken('kk', match1to2, match2);
  2396. addRegexToken('hmm', match3to4);
  2397. addRegexToken('hmmss', match5to6);
  2398. addRegexToken('Hmm', match3to4);
  2399. addRegexToken('Hmmss', match5to6);
  2400. addParseToken(['H', 'HH'], HOUR);
  2401. addParseToken(['k', 'kk'], function (input, array, config) {
  2402. var kInput = toInt(input);
  2403. array[HOUR] = kInput === 24 ? 0 : kInput;
  2404. });
  2405. addParseToken(['a', 'A'], function (input, array, config) {
  2406. config._isPm = config._locale.isPM(input);
  2407. config._meridiem = input;
  2408. });
  2409. addParseToken(['h', 'hh'], function (input, array, config) {
  2410. array[HOUR] = toInt(input);
  2411. getParsingFlags(config).bigHour = true;
  2412. });
  2413. addParseToken('hmm', function (input, array, config) {
  2414. var pos = input.length - 2;
  2415. array[HOUR] = toInt(input.substr(0, pos));
  2416. array[MINUTE] = toInt(input.substr(pos));
  2417. getParsingFlags(config).bigHour = true;
  2418. });
  2419. addParseToken('hmmss', function (input, array, config) {
  2420. var pos1 = input.length - 4;
  2421. var pos2 = input.length - 2;
  2422. array[HOUR] = toInt(input.substr(0, pos1));
  2423. array[MINUTE] = toInt(input.substr(pos1, 2));
  2424. array[SECOND] = toInt(input.substr(pos2));
  2425. getParsingFlags(config).bigHour = true;
  2426. });
  2427. addParseToken('Hmm', function (input, array, config) {
  2428. var pos = input.length - 2;
  2429. array[HOUR] = toInt(input.substr(0, pos));
  2430. array[MINUTE] = toInt(input.substr(pos));
  2431. });
  2432. addParseToken('Hmmss', function (input, array, config) {
  2433. var pos1 = input.length - 4;
  2434. var pos2 = input.length - 2;
  2435. array[HOUR] = toInt(input.substr(0, pos1));
  2436. array[MINUTE] = toInt(input.substr(pos1, 2));
  2437. array[SECOND] = toInt(input.substr(pos2));
  2438. });
  2439. // LOCALES
  2440. function localeIsPM (input) {
  2441. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  2442. // Using charAt should be more compatible.
  2443. return ((input + '').toLowerCase().charAt(0) === 'p');
  2444. }
  2445. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  2446. function localeMeridiem (hours, minutes, isLower) {
  2447. if (hours > 11) {
  2448. return isLower ? 'pm' : 'PM';
  2449. } else {
  2450. return isLower ? 'am' : 'AM';
  2451. }
  2452. }
  2453. // MOMENTS
  2454. // Setting the hour should keep the time, because the user explicitly
  2455. // specified which hour they want. So trying to maintain the same hour (in
  2456. // a new timezone) makes sense. Adding/subtracting hours does not follow
  2457. // this rule.
  2458. var getSetHour = makeGetSet('Hours', true);
  2459. var baseConfig = {
  2460. calendar: defaultCalendar,
  2461. longDateFormat: defaultLongDateFormat,
  2462. invalidDate: defaultInvalidDate,
  2463. ordinal: defaultOrdinal,
  2464. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  2465. relativeTime: defaultRelativeTime,
  2466. months: defaultLocaleMonths,
  2467. monthsShort: defaultLocaleMonthsShort,
  2468. week: defaultLocaleWeek,
  2469. weekdays: defaultLocaleWeekdays,
  2470. weekdaysMin: defaultLocaleWeekdaysMin,
  2471. weekdaysShort: defaultLocaleWeekdaysShort,
  2472. meridiemParse: defaultLocaleMeridiemParse
  2473. };
  2474. // internal storage for locale config files
  2475. var locales = {};
  2476. var localeFamilies = {};
  2477. var globalLocale;
  2478. function normalizeLocale(key) {
  2479. return key ? key.toLowerCase().replace('_', '-') : key;
  2480. }
  2481. // pick the locale from the array
  2482. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  2483. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  2484. function chooseLocale(names) {
  2485. var i = 0, j, next, locale, split;
  2486. while (i < names.length) {
  2487. split = normalizeLocale(names[i]).split('-');
  2488. j = split.length;
  2489. next = normalizeLocale(names[i + 1]);
  2490. next = next ? next.split('-') : null;
  2491. while (j > 0) {
  2492. locale = loadLocale(split.slice(0, j).join('-'));
  2493. if (locale) {
  2494. return locale;
  2495. }
  2496. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  2497. //the next array item is better than a shallower substring of this one
  2498. break;
  2499. }
  2500. j--;
  2501. }
  2502. i++;
  2503. }
  2504. return globalLocale;
  2505. }
  2506. function loadLocale(name) {
  2507. var oldLocale = null;
  2508. // TODO: Find a better way to register and load all the locales in Node
  2509. if (!locales[name] && (typeof module !== 'undefined') &&
  2510. module && module.exports) {
  2511. try {
  2512. oldLocale = globalLocale._abbr;
  2513. var aliasedRequire = require;
  2514. aliasedRequire('./locale/' + name);
  2515. getSetGlobalLocale(oldLocale);
  2516. } catch (e) {}
  2517. }
  2518. return locales[name];
  2519. }
  2520. // This function will load locale and then set the global locale. If
  2521. // no arguments are passed in, it will simply return the current global
  2522. // locale key.
  2523. function getSetGlobalLocale (key, values) {
  2524. var data;
  2525. if (key) {
  2526. if (isUndefined(values)) {
  2527. data = getLocale(key);
  2528. }
  2529. else {
  2530. data = defineLocale(key, values);
  2531. }
  2532. if (data) {
  2533. // moment.duration._locale = moment._locale = data;
  2534. globalLocale = data;
  2535. }
  2536. else {
  2537. if ((typeof console !== 'undefined') && console.warn) {
  2538. //warn user if arguments are passed but the locale could not be set
  2539. console.warn('Locale ' + key + ' not found. Did you forget to load it?');
  2540. }
  2541. }
  2542. }
  2543. return globalLocale._abbr;
  2544. }
  2545. function defineLocale (name, config) {
  2546. if (config !== null) {
  2547. var locale, parentConfig = baseConfig;
  2548. config.abbr = name;
  2549. if (locales[name] != null) {
  2550. deprecateSimple('defineLocaleOverride',
  2551. 'use moment.updateLocale(localeName, config) to change ' +
  2552. 'an existing locale. moment.defineLocale(localeName, ' +
  2553. 'config) should only be used for creating a new locale ' +
  2554. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
  2555. parentConfig = locales[name]._config;
  2556. } else if (config.parentLocale != null) {
  2557. if (locales[config.parentLocale] != null) {
  2558. parentConfig = locales[config.parentLocale]._config;
  2559. } else {
  2560. locale = loadLocale(config.parentLocale);
  2561. if (locale != null) {
  2562. parentConfig = locale._config;
  2563. } else {
  2564. if (!localeFamilies[config.parentLocale]) {
  2565. localeFamilies[config.parentLocale] = [];
  2566. }
  2567. localeFamilies[config.parentLocale].push({
  2568. name: name,
  2569. config: config
  2570. });
  2571. return null;
  2572. }
  2573. }
  2574. }
  2575. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  2576. if (localeFamilies[name]) {
  2577. localeFamilies[name].forEach(function (x) {
  2578. defineLocale(x.name, x.config);
  2579. });
  2580. }
  2581. // backwards compat for now: also set the locale
  2582. // make sure we set the locale AFTER all child locales have been
  2583. // created, so we won't end up with the child locale set.
  2584. getSetGlobalLocale(name);
  2585. return locales[name];
  2586. } else {
  2587. // useful for testing
  2588. delete locales[name];
  2589. return null;
  2590. }
  2591. }
  2592. function updateLocale(name, config) {
  2593. if (config != null) {
  2594. var locale, tmpLocale, parentConfig = baseConfig;
  2595. // MERGE
  2596. tmpLocale = loadLocale(name);
  2597. if (tmpLocale != null) {
  2598. parentConfig = tmpLocale._config;
  2599. }
  2600. config = mergeConfigs(parentConfig, config);
  2601. locale = new Locale(config);
  2602. locale.parentLocale = locales[name];
  2603. locales[name] = locale;
  2604. // backwards compat for now: also set the locale
  2605. getSetGlobalLocale(name);
  2606. } else {
  2607. // pass null for config to unupdate, useful for tests
  2608. if (locales[name] != null) {
  2609. if (locales[name].parentLocale != null) {
  2610. locales[name] = locales[name].parentLocale;
  2611. } else if (locales[name] != null) {
  2612. delete locales[name];
  2613. }
  2614. }
  2615. }
  2616. return locales[name];
  2617. }
  2618. // returns locale data
  2619. function getLocale (key) {
  2620. var locale;
  2621. if (key && key._locale && key._locale._abbr) {
  2622. key = key._locale._abbr;
  2623. }
  2624. if (!key) {
  2625. return globalLocale;
  2626. }
  2627. if (!isArray(key)) {
  2628. //short-circuit everything else
  2629. locale = loadLocale(key);
  2630. if (locale) {
  2631. return locale;
  2632. }
  2633. key = [key];
  2634. }
  2635. return chooseLocale(key);
  2636. }
  2637. function listLocales() {
  2638. return keys(locales);
  2639. }
  2640. function checkOverflow (m) {
  2641. var overflow;
  2642. var a = m._a;
  2643. if (a && getParsingFlags(m).overflow === -2) {
  2644. overflow =
  2645. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  2646. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  2647. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  2648. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  2649. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  2650. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  2651. -1;
  2652. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  2653. overflow = DATE;
  2654. }
  2655. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  2656. overflow = WEEK;
  2657. }
  2658. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  2659. overflow = WEEKDAY;
  2660. }
  2661. getParsingFlags(m).overflow = overflow;
  2662. }
  2663. return m;
  2664. }
  2665. // Pick the first defined of two or three arguments.
  2666. function defaults(a, b, c) {
  2667. if (a != null) {
  2668. return a;
  2669. }
  2670. if (b != null) {
  2671. return b;
  2672. }
  2673. return c;
  2674. }
  2675. function currentDateArray(config) {
  2676. // hooks is actually the exported moment object
  2677. var nowValue = new Date(hooks.now());
  2678. if (config._useUTC) {
  2679. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  2680. }
  2681. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  2682. }
  2683. // convert an array to a date.
  2684. // the array should mirror the parameters below
  2685. // note: all values past the year are optional and will default to the lowest possible value.
  2686. // [year, month, day , hour, minute, second, millisecond]
  2687. function configFromArray (config) {
  2688. var i, date, input = [], currentDate, expectedWeekday, yearToUse;
  2689. if (config._d) {
  2690. return;
  2691. }
  2692. currentDate = currentDateArray(config);
  2693. //compute day of the year from weeks and weekdays
  2694. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  2695. dayOfYearFromWeekInfo(config);
  2696. }
  2697. //if the day of the year is set, figure out what it is
  2698. if (config._dayOfYear != null) {
  2699. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  2700. if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
  2701. getParsingFlags(config)._overflowDayOfYear = true;
  2702. }
  2703. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  2704. config._a[MONTH] = date.getUTCMonth();
  2705. config._a[DATE] = date.getUTCDate();
  2706. }
  2707. // Default to current date.
  2708. // * if no year, month, day of month are given, default to today
  2709. // * if day of month is given, default month and year
  2710. // * if month is given, default only year
  2711. // * if year is given, don't default anything
  2712. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  2713. config._a[i] = input[i] = currentDate[i];
  2714. }
  2715. // Zero out whatever was not defaulted, including time
  2716. for (; i < 7; i++) {
  2717. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  2718. }
  2719. // Check for 24:00:00.000
  2720. if (config._a[HOUR] === 24 &&
  2721. config._a[MINUTE] === 0 &&
  2722. config._a[SECOND] === 0 &&
  2723. config._a[MILLISECOND] === 0) {
  2724. config._nextDay = true;
  2725. config._a[HOUR] = 0;
  2726. }
  2727. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  2728. expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
  2729. // Apply timezone offset from input. The actual utcOffset can be changed
  2730. // with parseZone.
  2731. if (config._tzm != null) {
  2732. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  2733. }
  2734. if (config._nextDay) {
  2735. config._a[HOUR] = 24;
  2736. }
  2737. // check for mismatching day of week
  2738. if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
  2739. getParsingFlags(config).weekdayMismatch = true;
  2740. }
  2741. }
  2742. function dayOfYearFromWeekInfo(config) {
  2743. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
  2744. w = config._w;
  2745. if (w.GG != null || w.W != null || w.E != null) {
  2746. dow = 1;
  2747. doy = 4;
  2748. // TODO: We need to take the current isoWeekYear, but that depends on
  2749. // how we interpret now (local, utc, fixed offset). So create
  2750. // a now version of current config (take local/utc/offset flags, and
  2751. // create now).
  2752. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
  2753. week = defaults(w.W, 1);
  2754. weekday = defaults(w.E, 1);
  2755. if (weekday < 1 || weekday > 7) {
  2756. weekdayOverflow = true;
  2757. }
  2758. } else {
  2759. dow = config._locale._week.dow;
  2760. doy = config._locale._week.doy;
  2761. var curWeek = weekOfYear(createLocal(), dow, doy);
  2762. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  2763. // Default to current week.
  2764. week = defaults(w.w, curWeek.week);
  2765. if (w.d != null) {
  2766. // weekday -- low day numbers are considered next week
  2767. weekday = w.d;
  2768. if (weekday < 0 || weekday > 6) {
  2769. weekdayOverflow = true;
  2770. }
  2771. } else if (w.e != null) {
  2772. // local weekday -- counting starts from beginning of week
  2773. weekday = w.e + dow;
  2774. if (w.e < 0 || w.e > 6) {
  2775. weekdayOverflow = true;
  2776. }
  2777. } else {
  2778. // default to beginning of week
  2779. weekday = dow;
  2780. }
  2781. }
  2782. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  2783. getParsingFlags(config)._overflowWeeks = true;
  2784. } else if (weekdayOverflow != null) {
  2785. getParsingFlags(config)._overflowWeekday = true;
  2786. } else {
  2787. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  2788. config._a[YEAR] = temp.year;
  2789. config._dayOfYear = temp.dayOfYear;
  2790. }
  2791. }
  2792. // iso 8601 regex
  2793. // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
  2794. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  2795. var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  2796. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  2797. var isoDates = [
  2798. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  2799. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  2800. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  2801. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  2802. ['YYYY-DDD', /\d{4}-\d{3}/],
  2803. ['YYYY-MM', /\d{4}-\d\d/, false],
  2804. ['YYYYYYMMDD', /[+-]\d{10}/],
  2805. ['YYYYMMDD', /\d{8}/],
  2806. // YYYYMM is NOT allowed by the standard
  2807. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  2808. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  2809. ['YYYYDDD', /\d{7}/]
  2810. ];
  2811. // iso time formats and regexes
  2812. var isoTimes = [
  2813. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  2814. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  2815. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  2816. ['HH:mm', /\d\d:\d\d/],
  2817. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  2818. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  2819. ['HHmmss', /\d\d\d\d\d\d/],
  2820. ['HHmm', /\d\d\d\d/],
  2821. ['HH', /\d\d/]
  2822. ];
  2823. var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  2824. // date from iso format
  2825. function configFromISO(config) {
  2826. var i, l,
  2827. string = config._i,
  2828. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  2829. allowTime, dateFormat, timeFormat, tzFormat;
  2830. if (match) {
  2831. getParsingFlags(config).iso = true;
  2832. for (i = 0, l = isoDates.length; i < l; i++) {
  2833. if (isoDates[i][1].exec(match[1])) {
  2834. dateFormat = isoDates[i][0];
  2835. allowTime = isoDates[i][2] !== false;
  2836. break;
  2837. }
  2838. }
  2839. if (dateFormat == null) {
  2840. config._isValid = false;
  2841. return;
  2842. }
  2843. if (match[3]) {
  2844. for (i = 0, l = isoTimes.length; i < l; i++) {
  2845. if (isoTimes[i][1].exec(match[3])) {
  2846. // match[2] should be 'T' or space
  2847. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  2848. break;
  2849. }
  2850. }
  2851. if (timeFormat == null) {
  2852. config._isValid = false;
  2853. return;
  2854. }
  2855. }
  2856. if (!allowTime && timeFormat != null) {
  2857. config._isValid = false;
  2858. return;
  2859. }
  2860. if (match[4]) {
  2861. if (tzRegex.exec(match[4])) {
  2862. tzFormat = 'Z';
  2863. } else {
  2864. config._isValid = false;
  2865. return;
  2866. }
  2867. }
  2868. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  2869. configFromStringAndFormat(config);
  2870. } else {
  2871. config._isValid = false;
  2872. }
  2873. }
  2874. // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
  2875. var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
  2876. function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
  2877. var result = [
  2878. untruncateYear(yearStr),
  2879. defaultLocaleMonthsShort.indexOf(monthStr),
  2880. parseInt(dayStr, 10),
  2881. parseInt(hourStr, 10),
  2882. parseInt(minuteStr, 10)
  2883. ];
  2884. if (secondStr) {
  2885. result.push(parseInt(secondStr, 10));
  2886. }
  2887. return result;
  2888. }
  2889. function untruncateYear(yearStr) {
  2890. var year = parseInt(yearStr, 10);
  2891. if (year <= 49) {
  2892. return 2000 + year;
  2893. } else if (year <= 999) {
  2894. return 1900 + year;
  2895. }
  2896. return year;
  2897. }
  2898. function preprocessRFC2822(s) {
  2899. // Remove comments and folding whitespace and replace multiple-spaces with a single space
  2900. return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  2901. }
  2902. function checkWeekday(weekdayStr, parsedInput, config) {
  2903. if (weekdayStr) {
  2904. // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
  2905. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
  2906. weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
  2907. if (weekdayProvided !== weekdayActual) {
  2908. getParsingFlags(config).weekdayMismatch = true;
  2909. config._isValid = false;
  2910. return false;
  2911. }
  2912. }
  2913. return true;
  2914. }
  2915. var obsOffsets = {
  2916. UT: 0,
  2917. GMT: 0,
  2918. EDT: -4 * 60,
  2919. EST: -5 * 60,
  2920. CDT: -5 * 60,
  2921. CST: -6 * 60,
  2922. MDT: -6 * 60,
  2923. MST: -7 * 60,
  2924. PDT: -7 * 60,
  2925. PST: -8 * 60
  2926. };
  2927. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  2928. if (obsOffset) {
  2929. return obsOffsets[obsOffset];
  2930. } else if (militaryOffset) {
  2931. // the only allowed military tz is Z
  2932. return 0;
  2933. } else {
  2934. var hm = parseInt(numOffset, 10);
  2935. var m = hm % 100, h = (hm - m) / 100;
  2936. return h * 60 + m;
  2937. }
  2938. }
  2939. // date and time from ref 2822 format
  2940. function configFromRFC2822(config) {
  2941. var match = rfc2822.exec(preprocessRFC2822(config._i));
  2942. if (match) {
  2943. var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
  2944. if (!checkWeekday(match[1], parsedArray, config)) {
  2945. return;
  2946. }
  2947. config._a = parsedArray;
  2948. config._tzm = calculateOffset(match[8], match[9], match[10]);
  2949. config._d = createUTCDate.apply(null, config._a);
  2950. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  2951. getParsingFlags(config).rfc2822 = true;
  2952. } else {
  2953. config._isValid = false;
  2954. }
  2955. }
  2956. // date from iso format or fallback
  2957. function configFromString(config) {
  2958. var matched = aspNetJsonRegex.exec(config._i);
  2959. if (matched !== null) {
  2960. config._d = new Date(+matched[1]);
  2961. return;
  2962. }
  2963. configFromISO(config);
  2964. if (config._isValid === false) {
  2965. delete config._isValid;
  2966. } else {
  2967. return;
  2968. }
  2969. configFromRFC2822(config);
  2970. if (config._isValid === false) {
  2971. delete config._isValid;
  2972. } else {
  2973. return;
  2974. }
  2975. // Final attempt, use Input Fallback
  2976. hooks.createFromInputFallback(config);
  2977. }
  2978. hooks.createFromInputFallback = deprecate(
  2979. 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
  2980. 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
  2981. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  2982. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  2983. function (config) {
  2984. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  2985. }
  2986. );
  2987. // constant that refers to the ISO standard
  2988. hooks.ISO_8601 = function () {};
  2989. // constant that refers to the RFC 2822 form
  2990. hooks.RFC_2822 = function () {};
  2991. // date from string and format string
  2992. function configFromStringAndFormat(config) {
  2993. // TODO: Move this to another part of the creation flow to prevent circular deps
  2994. if (config._f === hooks.ISO_8601) {
  2995. configFromISO(config);
  2996. return;
  2997. }
  2998. if (config._f === hooks.RFC_2822) {
  2999. configFromRFC2822(config);
  3000. return;
  3001. }
  3002. config._a = [];
  3003. getParsingFlags(config).empty = true;
  3004. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  3005. var string = '' + config._i,
  3006. i, parsedInput, tokens, token, skipped,
  3007. stringLength = string.length,
  3008. totalParsedInputLength = 0;
  3009. tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  3010. for (i = 0; i < tokens.length; i++) {
  3011. token = tokens[i];
  3012. parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
  3013. // console.log('token', token, 'parsedInput', parsedInput,
  3014. // 'regex', getParseRegexForToken(token, config));
  3015. if (parsedInput) {
  3016. skipped = string.substr(0, string.indexOf(parsedInput));
  3017. if (skipped.length > 0) {
  3018. getParsingFlags(config).unusedInput.push(skipped);
  3019. }
  3020. string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
  3021. totalParsedInputLength += parsedInput.length;
  3022. }
  3023. // don't parse if it's not a known token
  3024. if (formatTokenFunctions[token]) {
  3025. if (parsedInput) {
  3026. getParsingFlags(config).empty = false;
  3027. }
  3028. else {
  3029. getParsingFlags(config).unusedTokens.push(token);
  3030. }
  3031. addTimeToArrayFromToken(token, parsedInput, config);
  3032. }
  3033. else if (config._strict && !parsedInput) {
  3034. getParsingFlags(config).unusedTokens.push(token);
  3035. }
  3036. }
  3037. // add remaining unparsed input length to the string
  3038. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  3039. if (string.length > 0) {
  3040. getParsingFlags(config).unusedInput.push(string);
  3041. }
  3042. // clear _12h flag if hour is <= 12
  3043. if (config._a[HOUR] <= 12 &&
  3044. getParsingFlags(config).bigHour === true &&
  3045. config._a[HOUR] > 0) {
  3046. getParsingFlags(config).bigHour = undefined;
  3047. }
  3048. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  3049. getParsingFlags(config).meridiem = config._meridiem;
  3050. // handle meridiem
  3051. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  3052. configFromArray(config);
  3053. checkOverflow(config);
  3054. }
  3055. function meridiemFixWrap (locale, hour, meridiem) {
  3056. var isPm;
  3057. if (meridiem == null) {
  3058. // nothing to do
  3059. return hour;
  3060. }
  3061. if (locale.meridiemHour != null) {
  3062. return locale.meridiemHour(hour, meridiem);
  3063. } else if (locale.isPM != null) {
  3064. // Fallback
  3065. isPm = locale.isPM(meridiem);
  3066. if (isPm && hour < 12) {
  3067. hour += 12;
  3068. }
  3069. if (!isPm && hour === 12) {
  3070. hour = 0;
  3071. }
  3072. return hour;
  3073. } else {
  3074. // this is not supposed to happen
  3075. return hour;
  3076. }
  3077. }
  3078. // date from string and array of format strings
  3079. function configFromStringAndArray(config) {
  3080. var tempConfig,
  3081. bestMoment,
  3082. scoreToBeat,
  3083. i,
  3084. currentScore;
  3085. if (config._f.length === 0) {
  3086. getParsingFlags(config).invalidFormat = true;
  3087. config._d = new Date(NaN);
  3088. return;
  3089. }
  3090. for (i = 0; i < config._f.length; i++) {
  3091. currentScore = 0;
  3092. tempConfig = copyConfig({}, config);
  3093. if (config._useUTC != null) {
  3094. tempConfig._useUTC = config._useUTC;
  3095. }
  3096. tempConfig._f = config._f[i];
  3097. configFromStringAndFormat(tempConfig);
  3098. if (!isValid(tempConfig)) {
  3099. continue;
  3100. }
  3101. // if there is any input that was not parsed add a penalty for that format
  3102. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  3103. //or tokens
  3104. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  3105. getParsingFlags(tempConfig).score = currentScore;
  3106. if (scoreToBeat == null || currentScore < scoreToBeat) {
  3107. scoreToBeat = currentScore;
  3108. bestMoment = tempConfig;
  3109. }
  3110. }
  3111. extend(config, bestMoment || tempConfig);
  3112. }
  3113. function configFromObject(config) {
  3114. if (config._d) {
  3115. return;
  3116. }
  3117. var i = normalizeObjectUnits(config._i);
  3118. config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
  3119. return obj && parseInt(obj, 10);
  3120. });
  3121. configFromArray(config);
  3122. }
  3123. function createFromConfig (config) {
  3124. var res = new Moment(checkOverflow(prepareConfig(config)));
  3125. if (res._nextDay) {
  3126. // Adding is smart enough around DST
  3127. res.add(1, 'd');
  3128. res._nextDay = undefined;
  3129. }
  3130. return res;
  3131. }
  3132. function prepareConfig (config) {
  3133. var input = config._i,
  3134. format = config._f;
  3135. config._locale = config._locale || getLocale(config._l);
  3136. if (input === null || (format === undefined && input === '')) {
  3137. return createInvalid({nullInput: true});
  3138. }
  3139. if (typeof input === 'string') {
  3140. config._i = input = config._locale.preparse(input);
  3141. }
  3142. if (isMoment(input)) {
  3143. return new Moment(checkOverflow(input));
  3144. } else if (isDate(input)) {
  3145. config._d = input;
  3146. } else if (isArray(format)) {
  3147. configFromStringAndArray(config);
  3148. } else if (format) {
  3149. configFromStringAndFormat(config);
  3150. } else {
  3151. configFromInput(config);
  3152. }
  3153. if (!isValid(config)) {
  3154. config._d = null;
  3155. }
  3156. return config;
  3157. }
  3158. function configFromInput(config) {
  3159. var input = config._i;
  3160. if (isUndefined(input)) {
  3161. config._d = new Date(hooks.now());
  3162. } else if (isDate(input)) {
  3163. config._d = new Date(input.valueOf());
  3164. } else if (typeof input === 'string') {
  3165. configFromString(config);
  3166. } else if (isArray(input)) {
  3167. config._a = map(input.slice(0), function (obj) {
  3168. return parseInt(obj, 10);
  3169. });
  3170. configFromArray(config);
  3171. } else if (isObject(input)) {
  3172. configFromObject(config);
  3173. } else if (isNumber(input)) {
  3174. // from milliseconds
  3175. config._d = new Date(input);
  3176. } else {
  3177. hooks.createFromInputFallback(config);
  3178. }
  3179. }
  3180. function createLocalOrUTC (input, format, locale, strict, isUTC) {
  3181. var c = {};
  3182. if (locale === true || locale === false) {
  3183. strict = locale;
  3184. locale = undefined;
  3185. }
  3186. if ((isObject(input) && isObjectEmpty(input)) ||
  3187. (isArray(input) && input.length === 0)) {
  3188. input = undefined;
  3189. }
  3190. // object construction must be done this way.
  3191. // https://github.com/moment/moment/issues/1423
  3192. c._isAMomentObject = true;
  3193. c._useUTC = c._isUTC = isUTC;
  3194. c._l = locale;
  3195. c._i = input;
  3196. c._f = format;
  3197. c._strict = strict;
  3198. return createFromConfig(c);
  3199. }
  3200. function createLocal (input, format, locale, strict) {
  3201. return createLocalOrUTC(input, format, locale, strict, false);
  3202. }
  3203. var prototypeMin = deprecate(
  3204. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  3205. function () {
  3206. var other = createLocal.apply(null, arguments);
  3207. if (this.isValid() && other.isValid()) {
  3208. return other < this ? this : other;
  3209. } else {
  3210. return createInvalid();
  3211. }
  3212. }
  3213. );
  3214. var prototypeMax = deprecate(
  3215. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  3216. function () {
  3217. var other = createLocal.apply(null, arguments);
  3218. if (this.isValid() && other.isValid()) {
  3219. return other > this ? this : other;
  3220. } else {
  3221. return createInvalid();
  3222. }
  3223. }
  3224. );
  3225. // Pick a moment m from moments so that m[fn](other) is true for all
  3226. // other. This relies on the function fn to be transitive.
  3227. //
  3228. // moments should either be an array of moment objects or an array, whose
  3229. // first element is an array of moment objects.
  3230. function pickBy(fn, moments) {
  3231. var res, i;
  3232. if (moments.length === 1 && isArray(moments[0])) {
  3233. moments = moments[0];
  3234. }
  3235. if (!moments.length) {
  3236. return createLocal();
  3237. }
  3238. res = moments[0];
  3239. for (i = 1; i < moments.length; ++i) {
  3240. if (!moments[i].isValid() || moments[i][fn](res)) {
  3241. res = moments[i];
  3242. }
  3243. }
  3244. return res;
  3245. }
  3246. // TODO: Use [].sort instead?
  3247. function min () {
  3248. var args = [].slice.call(arguments, 0);
  3249. return pickBy('isBefore', args);
  3250. }
  3251. function max () {
  3252. var args = [].slice.call(arguments, 0);
  3253. return pickBy('isAfter', args);
  3254. }
  3255. var now = function () {
  3256. return Date.now ? Date.now() : +(new Date());
  3257. };
  3258. var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
  3259. function isDurationValid(m) {
  3260. for (var key in m) {
  3261. if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
  3262. return false;
  3263. }
  3264. }
  3265. var unitHasDecimal = false;
  3266. for (var i = 0; i < ordering.length; ++i) {
  3267. if (m[ordering[i]]) {
  3268. if (unitHasDecimal) {
  3269. return false; // only allow non-integers for smallest unit
  3270. }
  3271. if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  3272. unitHasDecimal = true;
  3273. }
  3274. }
  3275. }
  3276. return true;
  3277. }
  3278. function isValid$1() {
  3279. return this._isValid;
  3280. }
  3281. function createInvalid$1() {
  3282. return createDuration(NaN);
  3283. }
  3284. function Duration (duration) {
  3285. var normalizedInput = normalizeObjectUnits(duration),
  3286. years = normalizedInput.year || 0,
  3287. quarters = normalizedInput.quarter || 0,
  3288. months = normalizedInput.month || 0,
  3289. weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
  3290. days = normalizedInput.day || 0,
  3291. hours = normalizedInput.hour || 0,
  3292. minutes = normalizedInput.minute || 0,
  3293. seconds = normalizedInput.second || 0,
  3294. milliseconds = normalizedInput.millisecond || 0;
  3295. this._isValid = isDurationValid(normalizedInput);
  3296. // representation for dateAddRemove
  3297. this._milliseconds = +milliseconds +
  3298. seconds * 1e3 + // 1000
  3299. minutes * 6e4 + // 1000 * 60
  3300. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  3301. // Because of dateAddRemove treats 24 hours as different from a
  3302. // day when working around DST, we need to store them separately
  3303. this._days = +days +
  3304. weeks * 7;
  3305. // It is impossible to translate months into days without knowing
  3306. // which months you are are talking about, so we have to store
  3307. // it separately.
  3308. this._months = +months +
  3309. quarters * 3 +
  3310. years * 12;
  3311. this._data = {};
  3312. this._locale = getLocale();
  3313. this._bubble();
  3314. }
  3315. function isDuration (obj) {
  3316. return obj instanceof Duration;
  3317. }
  3318. function absRound (number) {
  3319. if (number < 0) {
  3320. return Math.round(-1 * number) * -1;
  3321. } else {
  3322. return Math.round(number);
  3323. }
  3324. }
  3325. // FORMATTING
  3326. function offset (token, separator) {
  3327. addFormatToken(token, 0, 0, function () {
  3328. var offset = this.utcOffset();
  3329. var sign = '+';
  3330. if (offset < 0) {
  3331. offset = -offset;
  3332. sign = '-';
  3333. }
  3334. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  3335. });
  3336. }
  3337. offset('Z', ':');
  3338. offset('ZZ', '');
  3339. // PARSING
  3340. addRegexToken('Z', matchShortOffset);
  3341. addRegexToken('ZZ', matchShortOffset);
  3342. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  3343. config._useUTC = true;
  3344. config._tzm = offsetFromString(matchShortOffset, input);
  3345. });
  3346. // HELPERS
  3347. // timezone chunker
  3348. // '+10:00' > ['10', '00']
  3349. // '-1530' > ['-15', '30']
  3350. var chunkOffset = /([\+\-]|\d\d)/gi;
  3351. function offsetFromString(matcher, string) {
  3352. var matches = (string || '').match(matcher);
  3353. if (matches === null) {
  3354. return null;
  3355. }
  3356. var chunk = matches[matches.length - 1] || [];
  3357. var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  3358. var minutes = +(parts[1] * 60) + toInt(parts[2]);
  3359. return minutes === 0 ?
  3360. 0 :
  3361. parts[0] === '+' ? minutes : -minutes;
  3362. }
  3363. // Return a moment from input, that is local/utc/zone equivalent to model.
  3364. function cloneWithOffset(input, model) {
  3365. var res, diff;
  3366. if (model._isUTC) {
  3367. res = model.clone();
  3368. diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
  3369. // Use low-level api, because this fn is low-level api.
  3370. res._d.setTime(res._d.valueOf() + diff);
  3371. hooks.updateOffset(res, false);
  3372. return res;
  3373. } else {
  3374. return createLocal(input).local();
  3375. }
  3376. }
  3377. function getDateOffset (m) {
  3378. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  3379. // https://github.com/moment/moment/pull/1871
  3380. return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
  3381. }
  3382. // HOOKS
  3383. // This function will be called whenever a moment is mutated.
  3384. // It is intended to keep the offset in sync with the timezone.
  3385. hooks.updateOffset = function () {};
  3386. // MOMENTS
  3387. // keepLocalTime = true means only change the timezone, without
  3388. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  3389. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  3390. // +0200, so we adjust the time as needed, to be valid.
  3391. //
  3392. // Keeping the time actually adds/subtracts (one hour)
  3393. // from the actual represented time. That is why we call updateOffset
  3394. // a second time. In case it wants us to change the offset again
  3395. // _changeInProgress == true case, then we have to adjust, because
  3396. // there is no such time in the given timezone.
  3397. function getSetOffset (input, keepLocalTime, keepMinutes) {
  3398. var offset = this._offset || 0,
  3399. localAdjust;
  3400. if (!this.isValid()) {
  3401. return input != null ? this : NaN;
  3402. }
  3403. if (input != null) {
  3404. if (typeof input === 'string') {
  3405. input = offsetFromString(matchShortOffset, input);
  3406. if (input === null) {
  3407. return this;
  3408. }
  3409. } else if (Math.abs(input) < 16 && !keepMinutes) {
  3410. input = input * 60;
  3411. }
  3412. if (!this._isUTC && keepLocalTime) {
  3413. localAdjust = getDateOffset(this);
  3414. }
  3415. this._offset = input;
  3416. this._isUTC = true;
  3417. if (localAdjust != null) {
  3418. this.add(localAdjust, 'm');
  3419. }
  3420. if (offset !== input) {
  3421. if (!keepLocalTime || this._changeInProgress) {
  3422. addSubtract(this, createDuration(input - offset, 'm'), 1, false);
  3423. } else if (!this._changeInProgress) {
  3424. this._changeInProgress = true;
  3425. hooks.updateOffset(this, true);
  3426. this._changeInProgress = null;
  3427. }
  3428. }
  3429. return this;
  3430. } else {
  3431. return this._isUTC ? offset : getDateOffset(this);
  3432. }
  3433. }
  3434. function getSetZone (input, keepLocalTime) {
  3435. if (input != null) {
  3436. if (typeof input !== 'string') {
  3437. input = -input;
  3438. }
  3439. this.utcOffset(input, keepLocalTime);
  3440. return this;
  3441. } else {
  3442. return -this.utcOffset();
  3443. }
  3444. }
  3445. function setOffsetToUTC (keepLocalTime) {
  3446. return this.utcOffset(0, keepLocalTime);
  3447. }
  3448. function setOffsetToLocal (keepLocalTime) {
  3449. if (this._isUTC) {
  3450. this.utcOffset(0, keepLocalTime);
  3451. this._isUTC = false;
  3452. if (keepLocalTime) {
  3453. this.subtract(getDateOffset(this), 'm');
  3454. }
  3455. }
  3456. return this;
  3457. }
  3458. function setOffsetToParsedOffset () {
  3459. if (this._tzm != null) {
  3460. this.utcOffset(this._tzm, false, true);
  3461. } else if (typeof this._i === 'string') {
  3462. var tZone = offsetFromString(matchOffset, this._i);
  3463. if (tZone != null) {
  3464. this.utcOffset(tZone);
  3465. }
  3466. else {
  3467. this.utcOffset(0, true);
  3468. }
  3469. }
  3470. return this;
  3471. }
  3472. function hasAlignedHourOffset (input) {
  3473. if (!this.isValid()) {
  3474. return false;
  3475. }
  3476. input = input ? createLocal(input).utcOffset() : 0;
  3477. return (this.utcOffset() - input) % 60 === 0;
  3478. }
  3479. function isDaylightSavingTime () {
  3480. return (
  3481. this.utcOffset() > this.clone().month(0).utcOffset() ||
  3482. this.utcOffset() > this.clone().month(5).utcOffset()
  3483. );
  3484. }
  3485. function isDaylightSavingTimeShifted () {
  3486. if (!isUndefined(this._isDSTShifted)) {
  3487. return this._isDSTShifted;
  3488. }
  3489. var c = {};
  3490. copyConfig(c, this);
  3491. c = prepareConfig(c);
  3492. if (c._a) {
  3493. var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  3494. this._isDSTShifted = this.isValid() &&
  3495. compareArrays(c._a, other.toArray()) > 0;
  3496. } else {
  3497. this._isDSTShifted = false;
  3498. }
  3499. return this._isDSTShifted;
  3500. }
  3501. function isLocal () {
  3502. return this.isValid() ? !this._isUTC : false;
  3503. }
  3504. function isUtcOffset () {
  3505. return this.isValid() ? this._isUTC : false;
  3506. }
  3507. function isUtc () {
  3508. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  3509. }
  3510. // ASP.NET json date format regex
  3511. var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
  3512. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  3513. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  3514. // and further modified to allow for strings containing both week and day
  3515. var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  3516. function createDuration (input, key) {
  3517. var duration = input,
  3518. // matching against regexp is expensive, do it on demand
  3519. match = null,
  3520. sign,
  3521. ret,
  3522. diffRes;
  3523. if (isDuration(input)) {
  3524. duration = {
  3525. ms : input._milliseconds,
  3526. d : input._days,
  3527. M : input._months
  3528. };
  3529. } else if (isNumber(input)) {
  3530. duration = {};
  3531. if (key) {
  3532. duration[key] = input;
  3533. } else {
  3534. duration.milliseconds = input;
  3535. }
  3536. } else if (!!(match = aspNetRegex.exec(input))) {
  3537. sign = (match[1] === '-') ? -1 : 1;
  3538. duration = {
  3539. y : 0,
  3540. d : toInt(match[DATE]) * sign,
  3541. h : toInt(match[HOUR]) * sign,
  3542. m : toInt(match[MINUTE]) * sign,
  3543. s : toInt(match[SECOND]) * sign,
  3544. ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
  3545. };
  3546. } else if (!!(match = isoRegex.exec(input))) {
  3547. sign = (match[1] === '-') ? -1 : 1;
  3548. duration = {
  3549. y : parseIso(match[2], sign),
  3550. M : parseIso(match[3], sign),
  3551. w : parseIso(match[4], sign),
  3552. d : parseIso(match[5], sign),
  3553. h : parseIso(match[6], sign),
  3554. m : parseIso(match[7], sign),
  3555. s : parseIso(match[8], sign)
  3556. };
  3557. } else if (duration == null) {// checks for null or undefined
  3558. duration = {};
  3559. } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
  3560. diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
  3561. duration = {};
  3562. duration.ms = diffRes.milliseconds;
  3563. duration.M = diffRes.months;
  3564. }
  3565. ret = new Duration(duration);
  3566. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  3567. ret._locale = input._locale;
  3568. }
  3569. return ret;
  3570. }
  3571. createDuration.fn = Duration.prototype;
  3572. createDuration.invalid = createInvalid$1;
  3573. function parseIso (inp, sign) {
  3574. // We'd normally use ~~inp for this, but unfortunately it also
  3575. // converts floats to ints.
  3576. // inp may be undefined, so careful calling replace on it.
  3577. var res = inp && parseFloat(inp.replace(',', '.'));
  3578. // apply sign while we're at it
  3579. return (isNaN(res) ? 0 : res) * sign;
  3580. }
  3581. function positiveMomentsDifference(base, other) {
  3582. var res = {};
  3583. res.months = other.month() - base.month() +
  3584. (other.year() - base.year()) * 12;
  3585. if (base.clone().add(res.months, 'M').isAfter(other)) {
  3586. --res.months;
  3587. }
  3588. res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
  3589. return res;
  3590. }
  3591. function momentsDifference(base, other) {
  3592. var res;
  3593. if (!(base.isValid() && other.isValid())) {
  3594. return {milliseconds: 0, months: 0};
  3595. }
  3596. other = cloneWithOffset(other, base);
  3597. if (base.isBefore(other)) {
  3598. res = positiveMomentsDifference(base, other);
  3599. } else {
  3600. res = positiveMomentsDifference(other, base);
  3601. res.milliseconds = -res.milliseconds;
  3602. res.months = -res.months;
  3603. }
  3604. return res;
  3605. }
  3606. // TODO: remove 'name' arg after deprecation is removed
  3607. function createAdder(direction, name) {
  3608. return function (val, period) {
  3609. var dur, tmp;
  3610. //invert the arguments, but complain about it
  3611. if (period !== null && !isNaN(+period)) {
  3612. deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
  3613. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
  3614. tmp = val; val = period; period = tmp;
  3615. }
  3616. val = typeof val === 'string' ? +val : val;
  3617. dur = createDuration(val, period);
  3618. addSubtract(this, dur, direction);
  3619. return this;
  3620. };
  3621. }
  3622. function addSubtract (mom, duration, isAdding, updateOffset) {
  3623. var milliseconds = duration._milliseconds,
  3624. days = absRound(duration._days),
  3625. months = absRound(duration._months);
  3626. if (!mom.isValid()) {
  3627. // No op
  3628. return;
  3629. }
  3630. updateOffset = updateOffset == null ? true : updateOffset;
  3631. if (months) {
  3632. setMonth(mom, get(mom, 'Month') + months * isAdding);
  3633. }
  3634. if (days) {
  3635. set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
  3636. }
  3637. if (milliseconds) {
  3638. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  3639. }
  3640. if (updateOffset) {
  3641. hooks.updateOffset(mom, days || months);
  3642. }
  3643. }
  3644. var add = createAdder(1, 'add');
  3645. var subtract = createAdder(-1, 'subtract');
  3646. function getCalendarFormat(myMoment, now) {
  3647. var diff = myMoment.diff(now, 'days', true);
  3648. return diff < -6 ? 'sameElse' :
  3649. diff < -1 ? 'lastWeek' :
  3650. diff < 0 ? 'lastDay' :
  3651. diff < 1 ? 'sameDay' :
  3652. diff < 2 ? 'nextDay' :
  3653. diff < 7 ? 'nextWeek' : 'sameElse';
  3654. }
  3655. function calendar$1 (time, formats) {
  3656. // We want to compare the start of today, vs this.
  3657. // Getting start-of-today depends on whether we're local/utc/offset or not.
  3658. var now = time || createLocal(),
  3659. sod = cloneWithOffset(now, this).startOf('day'),
  3660. format = hooks.calendarFormat(this, sod) || 'sameElse';
  3661. var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
  3662. return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
  3663. }
  3664. function clone () {
  3665. return new Moment(this);
  3666. }
  3667. function isAfter (input, units) {
  3668. var localInput = isMoment(input) ? input : createLocal(input);
  3669. if (!(this.isValid() && localInput.isValid())) {
  3670. return false;
  3671. }
  3672. units = normalizeUnits(units) || 'millisecond';
  3673. if (units === 'millisecond') {
  3674. return this.valueOf() > localInput.valueOf();
  3675. } else {
  3676. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  3677. }
  3678. }
  3679. function isBefore (input, units) {
  3680. var localInput = isMoment(input) ? input : createLocal(input);
  3681. if (!(this.isValid() && localInput.isValid())) {
  3682. return false;
  3683. }
  3684. units = normalizeUnits(units) || 'millisecond';
  3685. if (units === 'millisecond') {
  3686. return this.valueOf() < localInput.valueOf();
  3687. } else {
  3688. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  3689. }
  3690. }
  3691. function isBetween (from, to, units, inclusivity) {
  3692. var localFrom = isMoment(from) ? from : createLocal(from),
  3693. localTo = isMoment(to) ? to : createLocal(to);
  3694. if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
  3695. return false;
  3696. }
  3697. inclusivity = inclusivity || '()';
  3698. return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) &&
  3699. (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
  3700. }
  3701. function isSame (input, units) {
  3702. var localInput = isMoment(input) ? input : createLocal(input),
  3703. inputMs;
  3704. if (!(this.isValid() && localInput.isValid())) {
  3705. return false;
  3706. }
  3707. units = normalizeUnits(units) || 'millisecond';
  3708. if (units === 'millisecond') {
  3709. return this.valueOf() === localInput.valueOf();
  3710. } else {
  3711. inputMs = localInput.valueOf();
  3712. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  3713. }
  3714. }
  3715. function isSameOrAfter (input, units) {
  3716. return this.isSame(input, units) || this.isAfter(input, units);
  3717. }
  3718. function isSameOrBefore (input, units) {
  3719. return this.isSame(input, units) || this.isBefore(input, units);
  3720. }
  3721. function diff (input, units, asFloat) {
  3722. var that,
  3723. zoneDelta,
  3724. output;
  3725. if (!this.isValid()) {
  3726. return NaN;
  3727. }
  3728. that = cloneWithOffset(input, this);
  3729. if (!that.isValid()) {
  3730. return NaN;
  3731. }
  3732. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  3733. units = normalizeUnits(units);
  3734. switch (units) {
  3735. case 'year': output = monthDiff(this, that) / 12; break;
  3736. case 'month': output = monthDiff(this, that); break;
  3737. case 'quarter': output = monthDiff(this, that) / 3; break;
  3738. case 'second': output = (this - that) / 1e3; break; // 1000
  3739. case 'minute': output = (this - that) / 6e4; break; // 1000 * 60
  3740. case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60
  3741. case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst
  3742. case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst
  3743. default: output = this - that;
  3744. }
  3745. return asFloat ? output : absFloor(output);
  3746. }
  3747. function monthDiff (a, b) {
  3748. // difference in months
  3749. var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
  3750. // b is in (anchor - 1 month, anchor + 1 month)
  3751. anchor = a.clone().add(wholeMonthDiff, 'months'),
  3752. anchor2, adjust;
  3753. if (b - anchor < 0) {
  3754. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  3755. // linear across the month
  3756. adjust = (b - anchor) / (anchor - anchor2);
  3757. } else {
  3758. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  3759. // linear across the month
  3760. adjust = (b - anchor) / (anchor2 - anchor);
  3761. }
  3762. //check for negative zero, return zero if negative zero
  3763. return -(wholeMonthDiff + adjust) || 0;
  3764. }
  3765. hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  3766. hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  3767. function toString () {
  3768. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  3769. }
  3770. function toISOString(keepOffset) {
  3771. if (!this.isValid()) {
  3772. return null;
  3773. }
  3774. var utc = keepOffset !== true;
  3775. var m = utc ? this.clone().utc() : this;
  3776. if (m.year() < 0 || m.year() > 9999) {
  3777. return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
  3778. }
  3779. if (isFunction(Date.prototype.toISOString)) {
  3780. // native implementation is ~50x faster, use it when we can
  3781. if (utc) {
  3782. return this.toDate().toISOString();
  3783. } else {
  3784. return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
  3785. }
  3786. }
  3787. return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
  3788. }
  3789. /**
  3790. * Return a human readable representation of a moment that can
  3791. * also be evaluated to get a new moment which is the same
  3792. *
  3793. * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
  3794. */
  3795. function inspect () {
  3796. if (!this.isValid()) {
  3797. return 'moment.invalid(/* ' + this._i + ' */)';
  3798. }
  3799. var func = 'moment';
  3800. var zone = '';
  3801. if (!this.isLocal()) {
  3802. func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
  3803. zone = 'Z';
  3804. }
  3805. var prefix = '[' + func + '("]';
  3806. var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
  3807. var datetime = '-MM-DD[T]HH:mm:ss.SSS';
  3808. var suffix = zone + '[")]';
  3809. return this.format(prefix + year + datetime + suffix);
  3810. }
  3811. function format (inputString) {
  3812. if (!inputString) {
  3813. inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
  3814. }
  3815. var output = formatMoment(this, inputString);
  3816. return this.localeData().postformat(output);
  3817. }
  3818. function from (time, withoutSuffix) {
  3819. if (this.isValid() &&
  3820. ((isMoment(time) && time.isValid()) ||
  3821. createLocal(time).isValid())) {
  3822. return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
  3823. } else {
  3824. return this.localeData().invalidDate();
  3825. }
  3826. }
  3827. function fromNow (withoutSuffix) {
  3828. return this.from(createLocal(), withoutSuffix);
  3829. }
  3830. function to (time, withoutSuffix) {
  3831. if (this.isValid() &&
  3832. ((isMoment(time) && time.isValid()) ||
  3833. createLocal(time).isValid())) {
  3834. return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
  3835. } else {
  3836. return this.localeData().invalidDate();
  3837. }
  3838. }
  3839. function toNow (withoutSuffix) {
  3840. return this.to(createLocal(), withoutSuffix);
  3841. }
  3842. // If passed a locale key, it will set the locale for this
  3843. // instance. Otherwise, it will return the locale configuration
  3844. // variables for this instance.
  3845. function locale (key) {
  3846. var newLocaleData;
  3847. if (key === undefined) {
  3848. return this._locale._abbr;
  3849. } else {
  3850. newLocaleData = getLocale(key);
  3851. if (newLocaleData != null) {
  3852. this._locale = newLocaleData;
  3853. }
  3854. return this;
  3855. }
  3856. }
  3857. var lang = deprecate(
  3858. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  3859. function (key) {
  3860. if (key === undefined) {
  3861. return this.localeData();
  3862. } else {
  3863. return this.locale(key);
  3864. }
  3865. }
  3866. );
  3867. function localeData () {
  3868. return this._locale;
  3869. }
  3870. var MS_PER_SECOND = 1000;
  3871. var MS_PER_MINUTE = 60 * MS_PER_SECOND;
  3872. var MS_PER_HOUR = 60 * MS_PER_MINUTE;
  3873. var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
  3874. // actual modulo - handles negative numbers (for dates before 1970):
  3875. function mod$1(dividend, divisor) {
  3876. return (dividend % divisor + divisor) % divisor;
  3877. }
  3878. function localStartOfDate(y, m, d) {
  3879. // the date constructor remaps years 0-99 to 1900-1999
  3880. if (y < 100 && y >= 0) {
  3881. // preserve leap years using a full 400 year cycle, then reset
  3882. return new Date(y + 400, m, d) - MS_PER_400_YEARS;
  3883. } else {
  3884. return new Date(y, m, d).valueOf();
  3885. }
  3886. }
  3887. function utcStartOfDate(y, m, d) {
  3888. // Date.UTC remaps years 0-99 to 1900-1999
  3889. if (y < 100 && y >= 0) {
  3890. // preserve leap years using a full 400 year cycle, then reset
  3891. return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
  3892. } else {
  3893. return Date.UTC(y, m, d);
  3894. }
  3895. }
  3896. function startOf (units) {
  3897. var time;
  3898. units = normalizeUnits(units);
  3899. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  3900. return this;
  3901. }
  3902. var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  3903. switch (units) {
  3904. case 'year':
  3905. time = startOfDate(this.year(), 0, 1);
  3906. break;
  3907. case 'quarter':
  3908. time = startOfDate(this.year(), this.month() - this.month() % 3, 1);
  3909. break;
  3910. case 'month':
  3911. time = startOfDate(this.year(), this.month(), 1);
  3912. break;
  3913. case 'week':
  3914. time = startOfDate(this.year(), this.month(), this.date() - this.weekday());
  3915. break;
  3916. case 'isoWeek':
  3917. time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
  3918. break;
  3919. case 'day':
  3920. case 'date':
  3921. time = startOfDate(this.year(), this.month(), this.date());
  3922. break;
  3923. case 'hour':
  3924. time = this._d.valueOf();
  3925. time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);
  3926. break;
  3927. case 'minute':
  3928. time = this._d.valueOf();
  3929. time -= mod$1(time, MS_PER_MINUTE);
  3930. break;
  3931. case 'second':
  3932. time = this._d.valueOf();
  3933. time -= mod$1(time, MS_PER_SECOND);
  3934. break;
  3935. }
  3936. this._d.setTime(time);
  3937. hooks.updateOffset(this, true);
  3938. return this;
  3939. }
  3940. function endOf (units) {
  3941. var time;
  3942. units = normalizeUnits(units);
  3943. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  3944. return this;
  3945. }
  3946. var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  3947. switch (units) {
  3948. case 'year':
  3949. time = startOfDate(this.year() + 1, 0, 1) - 1;
  3950. break;
  3951. case 'quarter':
  3952. time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
  3953. break;
  3954. case 'month':
  3955. time = startOfDate(this.year(), this.month() + 1, 1) - 1;
  3956. break;
  3957. case 'week':
  3958. time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
  3959. break;
  3960. case 'isoWeek':
  3961. time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
  3962. break;
  3963. case 'day':
  3964. case 'date':
  3965. time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
  3966. break;
  3967. case 'hour':
  3968. time = this._d.valueOf();
  3969. time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;
  3970. break;
  3971. case 'minute':
  3972. time = this._d.valueOf();
  3973. time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
  3974. break;
  3975. case 'second':
  3976. time = this._d.valueOf();
  3977. time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
  3978. break;
  3979. }
  3980. this._d.setTime(time);
  3981. hooks.updateOffset(this, true);
  3982. return this;
  3983. }
  3984. function valueOf () {
  3985. return this._d.valueOf() - ((this._offset || 0) * 60000);
  3986. }
  3987. function unix () {
  3988. return Math.floor(this.valueOf() / 1000);
  3989. }
  3990. function toDate () {
  3991. return new Date(this.valueOf());
  3992. }
  3993. function toArray () {
  3994. var m = this;
  3995. return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  3996. }
  3997. function toObject () {
  3998. var m = this;
  3999. return {
  4000. years: m.year(),
  4001. months: m.month(),
  4002. date: m.date(),
  4003. hours: m.hours(),
  4004. minutes: m.minutes(),
  4005. seconds: m.seconds(),
  4006. milliseconds: m.milliseconds()
  4007. };
  4008. }
  4009. function toJSON () {
  4010. // new Date(NaN).toJSON() === null
  4011. return this.isValid() ? this.toISOString() : null;
  4012. }
  4013. function isValid$2 () {
  4014. return isValid(this);
  4015. }
  4016. function parsingFlags () {
  4017. return extend({}, getParsingFlags(this));
  4018. }
  4019. function invalidAt () {
  4020. return getParsingFlags(this).overflow;
  4021. }
  4022. function creationData() {
  4023. return {
  4024. input: this._i,
  4025. format: this._f,
  4026. locale: this._locale,
  4027. isUTC: this._isUTC,
  4028. strict: this._strict
  4029. };
  4030. }
  4031. // FORMATTING
  4032. addFormatToken(0, ['gg', 2], 0, function () {
  4033. return this.weekYear() % 100;
  4034. });
  4035. addFormatToken(0, ['GG', 2], 0, function () {
  4036. return this.isoWeekYear() % 100;
  4037. });
  4038. function addWeekYearFormatToken (token, getter) {
  4039. addFormatToken(0, [token, token.length], 0, getter);
  4040. }
  4041. addWeekYearFormatToken('gggg', 'weekYear');
  4042. addWeekYearFormatToken('ggggg', 'weekYear');
  4043. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  4044. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  4045. // ALIASES
  4046. addUnitAlias('weekYear', 'gg');
  4047. addUnitAlias('isoWeekYear', 'GG');
  4048. // PRIORITY
  4049. addUnitPriority('weekYear', 1);
  4050. addUnitPriority('isoWeekYear', 1);
  4051. // PARSING
  4052. addRegexToken('G', matchSigned);
  4053. addRegexToken('g', matchSigned);
  4054. addRegexToken('GG', match1to2, match2);
  4055. addRegexToken('gg', match1to2, match2);
  4056. addRegexToken('GGGG', match1to4, match4);
  4057. addRegexToken('gggg', match1to4, match4);
  4058. addRegexToken('GGGGG', match1to6, match6);
  4059. addRegexToken('ggggg', match1to6, match6);
  4060. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
  4061. week[token.substr(0, 2)] = toInt(input);
  4062. });
  4063. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  4064. week[token] = hooks.parseTwoDigitYear(input);
  4065. });
  4066. // MOMENTS
  4067. function getSetWeekYear (input) {
  4068. return getSetWeekYearHelper.call(this,
  4069. input,
  4070. this.week(),
  4071. this.weekday(),
  4072. this.localeData()._week.dow,
  4073. this.localeData()._week.doy);
  4074. }
  4075. function getSetISOWeekYear (input) {
  4076. return getSetWeekYearHelper.call(this,
  4077. input, this.isoWeek(), this.isoWeekday(), 1, 4);
  4078. }
  4079. function getISOWeeksInYear () {
  4080. return weeksInYear(this.year(), 1, 4);
  4081. }
  4082. function getWeeksInYear () {
  4083. var weekInfo = this.localeData()._week;
  4084. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  4085. }
  4086. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  4087. var weeksTarget;
  4088. if (input == null) {
  4089. return weekOfYear(this, dow, doy).year;
  4090. } else {
  4091. weeksTarget = weeksInYear(input, dow, doy);
  4092. if (week > weeksTarget) {
  4093. week = weeksTarget;
  4094. }
  4095. return setWeekAll.call(this, input, week, weekday, dow, doy);
  4096. }
  4097. }
  4098. function setWeekAll(weekYear, week, weekday, dow, doy) {
  4099. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  4100. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  4101. this.year(date.getUTCFullYear());
  4102. this.month(date.getUTCMonth());
  4103. this.date(date.getUTCDate());
  4104. return this;
  4105. }
  4106. // FORMATTING
  4107. addFormatToken('Q', 0, 'Qo', 'quarter');
  4108. // ALIASES
  4109. addUnitAlias('quarter', 'Q');
  4110. // PRIORITY
  4111. addUnitPriority('quarter', 7);
  4112. // PARSING
  4113. addRegexToken('Q', match1);
  4114. addParseToken('Q', function (input, array) {
  4115. array[MONTH] = (toInt(input) - 1) * 3;
  4116. });
  4117. // MOMENTS
  4118. function getSetQuarter (input) {
  4119. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  4120. }
  4121. // FORMATTING
  4122. addFormatToken('D', ['DD', 2], 'Do', 'date');
  4123. // ALIASES
  4124. addUnitAlias('date', 'D');
  4125. // PRIORITY
  4126. addUnitPriority('date', 9);
  4127. // PARSING
  4128. addRegexToken('D', match1to2);
  4129. addRegexToken('DD', match1to2, match2);
  4130. addRegexToken('Do', function (isStrict, locale) {
  4131. // TODO: Remove "ordinalParse" fallback in next major release.
  4132. return isStrict ?
  4133. (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :
  4134. locale._dayOfMonthOrdinalParseLenient;
  4135. });
  4136. addParseToken(['D', 'DD'], DATE);
  4137. addParseToken('Do', function (input, array) {
  4138. array[DATE] = toInt(input.match(match1to2)[0]);
  4139. });
  4140. // MOMENTS
  4141. var getSetDayOfMonth = makeGetSet('Date', true);
  4142. // FORMATTING
  4143. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  4144. // ALIASES
  4145. addUnitAlias('dayOfYear', 'DDD');
  4146. // PRIORITY
  4147. addUnitPriority('dayOfYear', 4);
  4148. // PARSING
  4149. addRegexToken('DDD', match1to3);
  4150. addRegexToken('DDDD', match3);
  4151. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  4152. config._dayOfYear = toInt(input);
  4153. });
  4154. // HELPERS
  4155. // MOMENTS
  4156. function getSetDayOfYear (input) {
  4157. var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
  4158. return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
  4159. }
  4160. // FORMATTING
  4161. addFormatToken('m', ['mm', 2], 0, 'minute');
  4162. // ALIASES
  4163. addUnitAlias('minute', 'm');
  4164. // PRIORITY
  4165. addUnitPriority('minute', 14);
  4166. // PARSING
  4167. addRegexToken('m', match1to2);
  4168. addRegexToken('mm', match1to2, match2);
  4169. addParseToken(['m', 'mm'], MINUTE);
  4170. // MOMENTS
  4171. var getSetMinute = makeGetSet('Minutes', false);
  4172. // FORMATTING
  4173. addFormatToken('s', ['ss', 2], 0, 'second');
  4174. // ALIASES
  4175. addUnitAlias('second', 's');
  4176. // PRIORITY
  4177. addUnitPriority('second', 15);
  4178. // PARSING
  4179. addRegexToken('s', match1to2);
  4180. addRegexToken('ss', match1to2, match2);
  4181. addParseToken(['s', 'ss'], SECOND);
  4182. // MOMENTS
  4183. var getSetSecond = makeGetSet('Seconds', false);
  4184. // FORMATTING
  4185. addFormatToken('S', 0, 0, function () {
  4186. return ~~(this.millisecond() / 100);
  4187. });
  4188. addFormatToken(0, ['SS', 2], 0, function () {
  4189. return ~~(this.millisecond() / 10);
  4190. });
  4191. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  4192. addFormatToken(0, ['SSSS', 4], 0, function () {
  4193. return this.millisecond() * 10;
  4194. });
  4195. addFormatToken(0, ['SSSSS', 5], 0, function () {
  4196. return this.millisecond() * 100;
  4197. });
  4198. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  4199. return this.millisecond() * 1000;
  4200. });
  4201. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  4202. return this.millisecond() * 10000;
  4203. });
  4204. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  4205. return this.millisecond() * 100000;
  4206. });
  4207. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  4208. return this.millisecond() * 1000000;
  4209. });
  4210. // ALIASES
  4211. addUnitAlias('millisecond', 'ms');
  4212. // PRIORITY
  4213. addUnitPriority('millisecond', 16);
  4214. // PARSING
  4215. addRegexToken('S', match1to3, match1);
  4216. addRegexToken('SS', match1to3, match2);
  4217. addRegexToken('SSS', match1to3, match3);
  4218. var token;
  4219. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  4220. addRegexToken(token, matchUnsigned);
  4221. }
  4222. function parseMs(input, array) {
  4223. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  4224. }
  4225. for (token = 'S'; token.length <= 9; token += 'S') {
  4226. addParseToken(token, parseMs);
  4227. }
  4228. // MOMENTS
  4229. var getSetMillisecond = makeGetSet('Milliseconds', false);
  4230. // FORMATTING
  4231. addFormatToken('z', 0, 0, 'zoneAbbr');
  4232. addFormatToken('zz', 0, 0, 'zoneName');
  4233. // MOMENTS
  4234. function getZoneAbbr () {
  4235. return this._isUTC ? 'UTC' : '';
  4236. }
  4237. function getZoneName () {
  4238. return this._isUTC ? 'Coordinated Universal Time' : '';
  4239. }
  4240. var proto = Moment.prototype;
  4241. proto.add = add;
  4242. proto.calendar = calendar$1;
  4243. proto.clone = clone;
  4244. proto.diff = diff;
  4245. proto.endOf = endOf;
  4246. proto.format = format;
  4247. proto.from = from;
  4248. proto.fromNow = fromNow;
  4249. proto.to = to;
  4250. proto.toNow = toNow;
  4251. proto.get = stringGet;
  4252. proto.invalidAt = invalidAt;
  4253. proto.isAfter = isAfter;
  4254. proto.isBefore = isBefore;
  4255. proto.isBetween = isBetween;
  4256. proto.isSame = isSame;
  4257. proto.isSameOrAfter = isSameOrAfter;
  4258. proto.isSameOrBefore = isSameOrBefore;
  4259. proto.isValid = isValid$2;
  4260. proto.lang = lang;
  4261. proto.locale = locale;
  4262. proto.localeData = localeData;
  4263. proto.max = prototypeMax;
  4264. proto.min = prototypeMin;
  4265. proto.parsingFlags = parsingFlags;
  4266. proto.set = stringSet;
  4267. proto.startOf = startOf;
  4268. proto.subtract = subtract;
  4269. proto.toArray = toArray;
  4270. proto.toObject = toObject;
  4271. proto.toDate = toDate;
  4272. proto.toISOString = toISOString;
  4273. proto.inspect = inspect;
  4274. proto.toJSON = toJSON;
  4275. proto.toString = toString;
  4276. proto.unix = unix;
  4277. proto.valueOf = valueOf;
  4278. proto.creationData = creationData;
  4279. proto.year = getSetYear;
  4280. proto.isLeapYear = getIsLeapYear;
  4281. proto.weekYear = getSetWeekYear;
  4282. proto.isoWeekYear = getSetISOWeekYear;
  4283. proto.quarter = proto.quarters = getSetQuarter;
  4284. proto.month = getSetMonth;
  4285. proto.daysInMonth = getDaysInMonth;
  4286. proto.week = proto.weeks = getSetWeek;
  4287. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  4288. proto.weeksInYear = getWeeksInYear;
  4289. proto.isoWeeksInYear = getISOWeeksInYear;
  4290. proto.date = getSetDayOfMonth;
  4291. proto.day = proto.days = getSetDayOfWeek;
  4292. proto.weekday = getSetLocaleDayOfWeek;
  4293. proto.isoWeekday = getSetISODayOfWeek;
  4294. proto.dayOfYear = getSetDayOfYear;
  4295. proto.hour = proto.hours = getSetHour;
  4296. proto.minute = proto.minutes = getSetMinute;
  4297. proto.second = proto.seconds = getSetSecond;
  4298. proto.millisecond = proto.milliseconds = getSetMillisecond;
  4299. proto.utcOffset = getSetOffset;
  4300. proto.utc = setOffsetToUTC;
  4301. proto.local = setOffsetToLocal;
  4302. proto.parseZone = setOffsetToParsedOffset;
  4303. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  4304. proto.isDST = isDaylightSavingTime;
  4305. proto.isLocal = isLocal;
  4306. proto.isUtcOffset = isUtcOffset;
  4307. proto.isUtc = isUtc;
  4308. proto.isUTC = isUtc;
  4309. proto.zoneAbbr = getZoneAbbr;
  4310. proto.zoneName = getZoneName;
  4311. proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  4312. proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  4313. proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  4314. proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  4315. proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  4316. function createUnix (input) {
  4317. return createLocal(input * 1000);
  4318. }
  4319. function createInZone () {
  4320. return createLocal.apply(null, arguments).parseZone();
  4321. }
  4322. function preParsePostFormat (string) {
  4323. return string;
  4324. }
  4325. var proto$1 = Locale.prototype;
  4326. proto$1.calendar = calendar;
  4327. proto$1.longDateFormat = longDateFormat;
  4328. proto$1.invalidDate = invalidDate;
  4329. proto$1.ordinal = ordinal;
  4330. proto$1.preparse = preParsePostFormat;
  4331. proto$1.postformat = preParsePostFormat;
  4332. proto$1.relativeTime = relativeTime;
  4333. proto$1.pastFuture = pastFuture;
  4334. proto$1.set = set;
  4335. proto$1.months = localeMonths;
  4336. proto$1.monthsShort = localeMonthsShort;
  4337. proto$1.monthsParse = localeMonthsParse;
  4338. proto$1.monthsRegex = monthsRegex;
  4339. proto$1.monthsShortRegex = monthsShortRegex;
  4340. proto$1.week = localeWeek;
  4341. proto$1.firstDayOfYear = localeFirstDayOfYear;
  4342. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  4343. proto$1.weekdays = localeWeekdays;
  4344. proto$1.weekdaysMin = localeWeekdaysMin;
  4345. proto$1.weekdaysShort = localeWeekdaysShort;
  4346. proto$1.weekdaysParse = localeWeekdaysParse;
  4347. proto$1.weekdaysRegex = weekdaysRegex;
  4348. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  4349. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  4350. proto$1.isPM = localeIsPM;
  4351. proto$1.meridiem = localeMeridiem;
  4352. function get$1 (format, index, field, setter) {
  4353. var locale = getLocale();
  4354. var utc = createUTC().set(setter, index);
  4355. return locale[field](utc, format);
  4356. }
  4357. function listMonthsImpl (format, index, field) {
  4358. if (isNumber(format)) {
  4359. index = format;
  4360. format = undefined;
  4361. }
  4362. format = format || '';
  4363. if (index != null) {
  4364. return get$1(format, index, field, 'month');
  4365. }
  4366. var i;
  4367. var out = [];
  4368. for (i = 0; i < 12; i++) {
  4369. out[i] = get$1(format, i, field, 'month');
  4370. }
  4371. return out;
  4372. }
  4373. // ()
  4374. // (5)
  4375. // (fmt, 5)
  4376. // (fmt)
  4377. // (true)
  4378. // (true, 5)
  4379. // (true, fmt, 5)
  4380. // (true, fmt)
  4381. function listWeekdaysImpl (localeSorted, format, index, field) {
  4382. if (typeof localeSorted === 'boolean') {
  4383. if (isNumber(format)) {
  4384. index = format;
  4385. format = undefined;
  4386. }
  4387. format = format || '';
  4388. } else {
  4389. format = localeSorted;
  4390. index = format;
  4391. localeSorted = false;
  4392. if (isNumber(format)) {
  4393. index = format;
  4394. format = undefined;
  4395. }
  4396. format = format || '';
  4397. }
  4398. var locale = getLocale(),
  4399. shift = localeSorted ? locale._week.dow : 0;
  4400. if (index != null) {
  4401. return get$1(format, (index + shift) % 7, field, 'day');
  4402. }
  4403. var i;
  4404. var out = [];
  4405. for (i = 0; i < 7; i++) {
  4406. out[i] = get$1(format, (i + shift) % 7, field, 'day');
  4407. }
  4408. return out;
  4409. }
  4410. function listMonths (format, index) {
  4411. return listMonthsImpl(format, index, 'months');
  4412. }
  4413. function listMonthsShort (format, index) {
  4414. return listMonthsImpl(format, index, 'monthsShort');
  4415. }
  4416. function listWeekdays (localeSorted, format, index) {
  4417. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  4418. }
  4419. function listWeekdaysShort (localeSorted, format, index) {
  4420. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  4421. }
  4422. function listWeekdaysMin (localeSorted, format, index) {
  4423. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  4424. }
  4425. getSetGlobalLocale('en', {
  4426. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  4427. ordinal : function (number) {
  4428. var b = number % 10,
  4429. output = (toInt(number % 100 / 10) === 1) ? 'th' :
  4430. (b === 1) ? 'st' :
  4431. (b === 2) ? 'nd' :
  4432. (b === 3) ? 'rd' : 'th';
  4433. return number + output;
  4434. }
  4435. });
  4436. // Side effect imports
  4437. hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
  4438. hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
  4439. var mathAbs = Math.abs;
  4440. function abs () {
  4441. var data = this._data;
  4442. this._milliseconds = mathAbs(this._milliseconds);
  4443. this._days = mathAbs(this._days);
  4444. this._months = mathAbs(this._months);
  4445. data.milliseconds = mathAbs(data.milliseconds);
  4446. data.seconds = mathAbs(data.seconds);
  4447. data.minutes = mathAbs(data.minutes);
  4448. data.hours = mathAbs(data.hours);
  4449. data.months = mathAbs(data.months);
  4450. data.years = mathAbs(data.years);
  4451. return this;
  4452. }
  4453. function addSubtract$1 (duration, input, value, direction) {
  4454. var other = createDuration(input, value);
  4455. duration._milliseconds += direction * other._milliseconds;
  4456. duration._days += direction * other._days;
  4457. duration._months += direction * other._months;
  4458. return duration._bubble();
  4459. }
  4460. // supports only 2.0-style add(1, 's') or add(duration)
  4461. function add$1 (input, value) {
  4462. return addSubtract$1(this, input, value, 1);
  4463. }
  4464. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  4465. function subtract$1 (input, value) {
  4466. return addSubtract$1(this, input, value, -1);
  4467. }
  4468. function absCeil (number) {
  4469. if (number < 0) {
  4470. return Math.floor(number);
  4471. } else {
  4472. return Math.ceil(number);
  4473. }
  4474. }
  4475. function bubble () {
  4476. var milliseconds = this._milliseconds;
  4477. var days = this._days;
  4478. var months = this._months;
  4479. var data = this._data;
  4480. var seconds, minutes, hours, years, monthsFromDays;
  4481. // if we have a mix of positive and negative values, bubble down first
  4482. // check: https://github.com/moment/moment/issues/2166
  4483. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  4484. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  4485. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  4486. days = 0;
  4487. months = 0;
  4488. }
  4489. // The following code bubbles up values, see the tests for
  4490. // examples of what that means.
  4491. data.milliseconds = milliseconds % 1000;
  4492. seconds = absFloor(milliseconds / 1000);
  4493. data.seconds = seconds % 60;
  4494. minutes = absFloor(seconds / 60);
  4495. data.minutes = minutes % 60;
  4496. hours = absFloor(minutes / 60);
  4497. data.hours = hours % 24;
  4498. days += absFloor(hours / 24);
  4499. // convert days to months
  4500. monthsFromDays = absFloor(daysToMonths(days));
  4501. months += monthsFromDays;
  4502. days -= absCeil(monthsToDays(monthsFromDays));
  4503. // 12 months -> 1 year
  4504. years = absFloor(months / 12);
  4505. months %= 12;
  4506. data.days = days;
  4507. data.months = months;
  4508. data.years = years;
  4509. return this;
  4510. }
  4511. function daysToMonths (days) {
  4512. // 400 years have 146097 days (taking into account leap year rules)
  4513. // 400 years have 12 months === 4800
  4514. return days * 4800 / 146097;
  4515. }
  4516. function monthsToDays (months) {
  4517. // the reverse of daysToMonths
  4518. return months * 146097 / 4800;
  4519. }
  4520. function as (units) {
  4521. if (!this.isValid()) {
  4522. return NaN;
  4523. }
  4524. var days;
  4525. var months;
  4526. var milliseconds = this._milliseconds;
  4527. units = normalizeUnits(units);
  4528. if (units === 'month' || units === 'quarter' || units === 'year') {
  4529. days = this._days + milliseconds / 864e5;
  4530. months = this._months + daysToMonths(days);
  4531. switch (units) {
  4532. case 'month': return months;
  4533. case 'quarter': return months / 3;
  4534. case 'year': return months / 12;
  4535. }
  4536. } else {
  4537. // handle milliseconds separately because of floating point math errors (issue #1867)
  4538. days = this._days + Math.round(monthsToDays(this._months));
  4539. switch (units) {
  4540. case 'week' : return days / 7 + milliseconds / 6048e5;
  4541. case 'day' : return days + milliseconds / 864e5;
  4542. case 'hour' : return days * 24 + milliseconds / 36e5;
  4543. case 'minute' : return days * 1440 + milliseconds / 6e4;
  4544. case 'second' : return days * 86400 + milliseconds / 1000;
  4545. // Math.floor prevents floating point math errors here
  4546. case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
  4547. default: throw new Error('Unknown unit ' + units);
  4548. }
  4549. }
  4550. }
  4551. // TODO: Use this.as('ms')?
  4552. function valueOf$1 () {
  4553. if (!this.isValid()) {
  4554. return NaN;
  4555. }
  4556. return (
  4557. this._milliseconds +
  4558. this._days * 864e5 +
  4559. (this._months % 12) * 2592e6 +
  4560. toInt(this._months / 12) * 31536e6
  4561. );
  4562. }
  4563. function makeAs (alias) {
  4564. return function () {
  4565. return this.as(alias);
  4566. };
  4567. }
  4568. var asMilliseconds = makeAs('ms');
  4569. var asSeconds = makeAs('s');
  4570. var asMinutes = makeAs('m');
  4571. var asHours = makeAs('h');
  4572. var asDays = makeAs('d');
  4573. var asWeeks = makeAs('w');
  4574. var asMonths = makeAs('M');
  4575. var asQuarters = makeAs('Q');
  4576. var asYears = makeAs('y');
  4577. function clone$1 () {
  4578. return createDuration(this);
  4579. }
  4580. function get$2 (units) {
  4581. units = normalizeUnits(units);
  4582. return this.isValid() ? this[units + 's']() : NaN;
  4583. }
  4584. function makeGetter(name) {
  4585. return function () {
  4586. return this.isValid() ? this._data[name] : NaN;
  4587. };
  4588. }
  4589. var milliseconds = makeGetter('milliseconds');
  4590. var seconds = makeGetter('seconds');
  4591. var minutes = makeGetter('minutes');
  4592. var hours = makeGetter('hours');
  4593. var days = makeGetter('days');
  4594. var months = makeGetter('months');
  4595. var years = makeGetter('years');
  4596. function weeks () {
  4597. return absFloor(this.days() / 7);
  4598. }
  4599. var round = Math.round;
  4600. var thresholds = {
  4601. ss: 44, // a few seconds to seconds
  4602. s : 45, // seconds to minute
  4603. m : 45, // minutes to hour
  4604. h : 22, // hours to day
  4605. d : 26, // days to month
  4606. M : 11 // months to year
  4607. };
  4608. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  4609. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  4610. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  4611. }
  4612. function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
  4613. var duration = createDuration(posNegDuration).abs();
  4614. var seconds = round(duration.as('s'));
  4615. var minutes = round(duration.as('m'));
  4616. var hours = round(duration.as('h'));
  4617. var days = round(duration.as('d'));
  4618. var months = round(duration.as('M'));
  4619. var years = round(duration.as('y'));
  4620. var a = seconds <= thresholds.ss && ['s', seconds] ||
  4621. seconds < thresholds.s && ['ss', seconds] ||
  4622. minutes <= 1 && ['m'] ||
  4623. minutes < thresholds.m && ['mm', minutes] ||
  4624. hours <= 1 && ['h'] ||
  4625. hours < thresholds.h && ['hh', hours] ||
  4626. days <= 1 && ['d'] ||
  4627. days < thresholds.d && ['dd', days] ||
  4628. months <= 1 && ['M'] ||
  4629. months < thresholds.M && ['MM', months] ||
  4630. years <= 1 && ['y'] || ['yy', years];
  4631. a[2] = withoutSuffix;
  4632. a[3] = +posNegDuration > 0;
  4633. a[4] = locale;
  4634. return substituteTimeAgo.apply(null, a);
  4635. }
  4636. // This function allows you to set the rounding function for relative time strings
  4637. function getSetRelativeTimeRounding (roundingFunction) {
  4638. if (roundingFunction === undefined) {
  4639. return round;
  4640. }
  4641. if (typeof(roundingFunction) === 'function') {
  4642. round = roundingFunction;
  4643. return true;
  4644. }
  4645. return false;
  4646. }
  4647. // This function allows you to set a threshold for relative time strings
  4648. function getSetRelativeTimeThreshold (threshold, limit) {
  4649. if (thresholds[threshold] === undefined) {
  4650. return false;
  4651. }
  4652. if (limit === undefined) {
  4653. return thresholds[threshold];
  4654. }
  4655. thresholds[threshold] = limit;
  4656. if (threshold === 's') {
  4657. thresholds.ss = limit - 1;
  4658. }
  4659. return true;
  4660. }
  4661. function humanize (withSuffix) {
  4662. if (!this.isValid()) {
  4663. return this.localeData().invalidDate();
  4664. }
  4665. var locale = this.localeData();
  4666. var output = relativeTime$1(this, !withSuffix, locale);
  4667. if (withSuffix) {
  4668. output = locale.pastFuture(+this, output);
  4669. }
  4670. return locale.postformat(output);
  4671. }
  4672. var abs$1 = Math.abs;
  4673. function sign(x) {
  4674. return ((x > 0) - (x < 0)) || +x;
  4675. }
  4676. function toISOString$1() {
  4677. // for ISO strings we do not use the normal bubbling rules:
  4678. // * milliseconds bubble up until they become hours
  4679. // * days do not bubble at all
  4680. // * months bubble up until they become years
  4681. // This is because there is no context-free conversion between hours and days
  4682. // (think of clock changes)
  4683. // and also not between days and months (28-31 days per month)
  4684. if (!this.isValid()) {
  4685. return this.localeData().invalidDate();
  4686. }
  4687. var seconds = abs$1(this._milliseconds) / 1000;
  4688. var days = abs$1(this._days);
  4689. var months = abs$1(this._months);
  4690. var minutes, hours, years;
  4691. // 3600 seconds -> 60 minutes -> 1 hour
  4692. minutes = absFloor(seconds / 60);
  4693. hours = absFloor(minutes / 60);
  4694. seconds %= 60;
  4695. minutes %= 60;
  4696. // 12 months -> 1 year
  4697. years = absFloor(months / 12);
  4698. months %= 12;
  4699. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  4700. var Y = years;
  4701. var M = months;
  4702. var D = days;
  4703. var h = hours;
  4704. var m = minutes;
  4705. var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
  4706. var total = this.asSeconds();
  4707. if (!total) {
  4708. // this is the same as C#'s (Noda) and python (isodate)...
  4709. // but not other JS (goog.date)
  4710. return 'P0D';
  4711. }
  4712. var totalSign = total < 0 ? '-' : '';
  4713. var ymSign = sign(this._months) !== sign(total) ? '-' : '';
  4714. var daysSign = sign(this._days) !== sign(total) ? '-' : '';
  4715. var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
  4716. return totalSign + 'P' +
  4717. (Y ? ymSign + Y + 'Y' : '') +
  4718. (M ? ymSign + M + 'M' : '') +
  4719. (D ? daysSign + D + 'D' : '') +
  4720. ((h || m || s) ? 'T' : '') +
  4721. (h ? hmsSign + h + 'H' : '') +
  4722. (m ? hmsSign + m + 'M' : '') +
  4723. (s ? hmsSign + s + 'S' : '');
  4724. }
  4725. var proto$2 = Duration.prototype;
  4726. proto$2.isValid = isValid$1;
  4727. proto$2.abs = abs;
  4728. proto$2.add = add$1;
  4729. proto$2.subtract = subtract$1;
  4730. proto$2.as = as;
  4731. proto$2.asMilliseconds = asMilliseconds;
  4732. proto$2.asSeconds = asSeconds;
  4733. proto$2.asMinutes = asMinutes;
  4734. proto$2.asHours = asHours;
  4735. proto$2.asDays = asDays;
  4736. proto$2.asWeeks = asWeeks;
  4737. proto$2.asMonths = asMonths;
  4738. proto$2.asQuarters = asQuarters;
  4739. proto$2.asYears = asYears;
  4740. proto$2.valueOf = valueOf$1;
  4741. proto$2._bubble = bubble;
  4742. proto$2.clone = clone$1;
  4743. proto$2.get = get$2;
  4744. proto$2.milliseconds = milliseconds;
  4745. proto$2.seconds = seconds;
  4746. proto$2.minutes = minutes;
  4747. proto$2.hours = hours;
  4748. proto$2.days = days;
  4749. proto$2.weeks = weeks;
  4750. proto$2.months = months;
  4751. proto$2.years = years;
  4752. proto$2.humanize = humanize;
  4753. proto$2.toISOString = toISOString$1;
  4754. proto$2.toString = toISOString$1;
  4755. proto$2.toJSON = toISOString$1;
  4756. proto$2.locale = locale;
  4757. proto$2.localeData = localeData;
  4758. proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
  4759. proto$2.lang = lang;
  4760. // Side effect imports
  4761. // FORMATTING
  4762. addFormatToken('X', 0, 0, 'unix');
  4763. addFormatToken('x', 0, 0, 'valueOf');
  4764. // PARSING
  4765. addRegexToken('x', matchSigned);
  4766. addRegexToken('X', matchTimestamp);
  4767. addParseToken('X', function (input, array, config) {
  4768. config._d = new Date(parseFloat(input, 10) * 1000);
  4769. });
  4770. addParseToken('x', function (input, array, config) {
  4771. config._d = new Date(toInt(input));
  4772. });
  4773. // Side effect imports
  4774. hooks.version = '2.24.0';
  4775. setHookCallback(createLocal);
  4776. hooks.fn = proto;
  4777. hooks.min = min;
  4778. hooks.max = max;
  4779. hooks.now = now;
  4780. hooks.utc = createUTC;
  4781. hooks.unix = createUnix;
  4782. hooks.months = listMonths;
  4783. hooks.isDate = isDate;
  4784. hooks.locale = getSetGlobalLocale;
  4785. hooks.invalid = createInvalid;
  4786. hooks.duration = createDuration;
  4787. hooks.isMoment = isMoment;
  4788. hooks.weekdays = listWeekdays;
  4789. hooks.parseZone = createInZone;
  4790. hooks.localeData = getLocale;
  4791. hooks.isDuration = isDuration;
  4792. hooks.monthsShort = listMonthsShort;
  4793. hooks.weekdaysMin = listWeekdaysMin;
  4794. hooks.defineLocale = defineLocale;
  4795. hooks.updateLocale = updateLocale;
  4796. hooks.locales = listLocales;
  4797. hooks.weekdaysShort = listWeekdaysShort;
  4798. hooks.normalizeUnits = normalizeUnits;
  4799. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  4800. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  4801. hooks.calendarFormat = getCalendarFormat;
  4802. hooks.prototype = proto;
  4803. // currently HTML5 input type only supports 24-hour formats
  4804. hooks.HTML5_FMT = {
  4805. DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
  4806. DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
  4807. DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
  4808. DATE: 'YYYY-MM-DD', // <input type="date" />
  4809. TIME: 'HH:mm', // <input type="time" />
  4810. TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
  4811. TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
  4812. WEEK: 'GGGG-[W]WW', // <input type="week" />
  4813. MONTH: 'YYYY-MM' // <input type="month" />
  4814. };
  4815. return hooks;
  4816. })));
  4817. define('moment', ['moment/moment'], function (main) { return main; });
  4818. define('frontend',['fast', 'template', 'moment'], function (Fast, Template, Moment) {
  4819. var Frontend = {
  4820. api: Fast.api,
  4821. init: function () {
  4822. var si = {};
  4823. //发送验证码
  4824. $(document).on("click", ".btn-captcha", function (e) {
  4825. var type = $(this).data("type") ? $(this).data("type") : 'mobile';
  4826. var btn = this;
  4827. Frontend.api.sendcaptcha = function (btn, type, data, callback) {
  4828. $(btn).addClass("disabled", true).text("发送中...");
  4829. Frontend.api.ajax({url: $(btn).data("url"), data: data}, function (data, ret) {
  4830. clearInterval(si[type]);
  4831. var seconds = 60;
  4832. si[type] = setInterval(function () {
  4833. seconds--;
  4834. if (seconds <= 0) {
  4835. clearInterval(si);
  4836. $(btn).removeClass("disabled").text("发送验证码");
  4837. } else {
  4838. $(btn).addClass("disabled").text(seconds + "秒后可再次发送");
  4839. }
  4840. }, 1000);
  4841. if (typeof callback == 'function') {
  4842. callback.call(this, data, ret);
  4843. }
  4844. }, function () {
  4845. $(btn).removeClass("disabled").text('发送验证码');
  4846. });
  4847. };
  4848. if (['mobile', 'email'].indexOf(type) > -1) {
  4849. var element = $(this).data("input-id") ? $("#" + $(this).data("input-id")) : $("input[name='" + type + "']", $(this).closest("form"));
  4850. var text = type === 'email' ? '邮箱' : '手机号码';
  4851. if (element.val() === "") {
  4852. Layer.msg(text + "不能为空!");
  4853. element.focus();
  4854. return false;
  4855. } else if (type === 'mobile' && !element.val().match(/^1[3-9]\d{9}$/)) {
  4856. Layer.msg("请输入正确的" + text + "!");
  4857. element.focus();
  4858. return false;
  4859. } else if (type === 'email' && !element.val().match(/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/)) {
  4860. Layer.msg("请输入正确的" + text + "!");
  4861. element.focus();
  4862. return false;
  4863. }
  4864. element.isValid(function (v) {
  4865. if (v) {
  4866. var data = {event: $(btn).data("event")};
  4867. data[type] = element.val();
  4868. Frontend.api.sendcaptcha(btn, type, data);
  4869. } else {
  4870. Layer.msg("请确认已经输入了正确的" + text + "!");
  4871. }
  4872. });
  4873. } else {
  4874. var data = {event: $(btn).data("event")};
  4875. Frontend.api.sendcaptcha(btn, type, data, function (data, ret) {
  4876. Layer.open({title: false, area: ["400px", "430px"], content: "<img src='" + data.image + "' width='400' height='400' /><div class='text-center panel-title'>扫一扫关注公众号获取验证码</div>", type: 1});
  4877. });
  4878. }
  4879. return false;
  4880. });
  4881. //tooltip和popover
  4882. if (!('ontouchstart' in document.documentElement)) {
  4883. $('body').tooltip({selector: '[data-toggle="tooltip"]'});
  4884. }
  4885. $('body').popover({selector: '[data-toggle="popover"]'});
  4886. }
  4887. };
  4888. Frontend.api = $.extend(Fast.api, Frontend.api);
  4889. //将Template渲染至全局,以便于在子框架中调用
  4890. window.Template = Template;
  4891. //将Moment渲染至全局,以便于在子框架中调用
  4892. window.Moment = Moment;
  4893. //将Frontend渲染至全局,以便于在子框架中调用
  4894. window.Frontend = Frontend;
  4895. Frontend.init();
  4896. return Frontend;
  4897. });
  4898. define('frontend-init',['frontend'], function (Frontend) {
  4899. });