binance.js 691 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577
  1. function isArray(e) {
  2. return "[object Array]" === Object.prototype.toString.call(e)
  3. }
  4. function isBoolean(e) {
  5. return "boolean" == typeof e
  6. }
  7. function isDate(e) {
  8. return "[object Date]" === Object.prototype.toString.call(e)
  9. }
  10. function isDefined(e) {
  11. return void 0 !== e
  12. }
  13. function isFunction(e) {
  14. return "function" == typeof e
  15. }
  16. function isNull(e) {
  17. return null === e
  18. }
  19. function isNumber(e) {
  20. return "number" == typeof e
  21. }
  22. function isObject(e) {
  23. return null !== e && "object" == typeof e
  24. }
  25. function isString(e) {
  26. return "string" == typeof e
  27. }
  28. function isUndefined(e) {
  29. return void 0 === e
  30. }
  31. function convertToBoolean(e) {
  32. return isBoolean(e) ? e : null !== e && "" !== e && "false" !== e
  33. }
  34. function hasProperty(e, t) {
  35. return e.hasOwnProperty(t)
  36. }
  37. function isStringEmpty(e) {
  38. return isNull(e) || isUndefined(e) || isString(e) && 0 == e.length
  39. }
  40. function isStringNonempty(e) {
  41. return isString(e) && e.length > 0
  42. }
  43. function upperCaseFirstLetter(e) {
  44. return e.charAt(0).toUpperCase() + e.slice(1)
  45. }
  46. function areEqual(e, t) {
  47. return angular.equals(e, t)
  48. }
  49. function min(e, t) {
  50. return e < t ? e : t
  51. }
  52. function max(e, t) {
  53. return e > t ? e : t
  54. }
  55. function beginsWith(e, t) {
  56. return isString(e) && 0 == e.lastIndexOf(t, 0)
  57. }
  58. function endsWith(e, t) {
  59. return isString(e) && -1 !== e.indexOf(t, e.length - t.length)
  60. }
  61. function copy(e, t) {
  62. return angular.copy(e, t)
  63. }
  64. function removeProperty(e, t) {
  65. delete e[t]
  66. }
  67. function removeProperties(e, t) {
  68. for (var n = 0; n < t.length; ++n) delete e[t[n]]
  69. }
  70. function forEach(e, t, n) {
  71. return angular.forEach(e, t, n)
  72. }
  73. function defineScalyrJsLibrary(e, t) {
  74. var n = [];
  75. if (t instanceof Array) for (var r = 0; r < t.length - 1; ++r) n.push(t[r]);
  76. return angular.module(e, n).factory(e, t)
  77. }
  78. function defineScalyrAngularModule(e, t) {
  79. return angular.module(e, t)
  80. }
  81. function isArray(e) {
  82. return "[object Array]" === Object.prototype.toString.call(e)
  83. }
  84. function isBoolean(e) {
  85. return "boolean" == typeof e
  86. }
  87. function isDate(e) {
  88. return "[object Date]" === Object.prototype.toString.call(e)
  89. }
  90. function isDefined(e) {
  91. return void 0 !== e
  92. }
  93. function isFunction(e) {
  94. return "function" == typeof e
  95. }
  96. function isNull(e) {
  97. return null === e
  98. }
  99. function isNumber(e) {
  100. return "number" == typeof e
  101. }
  102. function isObject(e) {
  103. return null !== e && "object" == typeof e
  104. }
  105. function isString(e) {
  106. return "string" == typeof e
  107. }
  108. function isUndefined(e) {
  109. return void 0 === e
  110. }
  111. function convertToBoolean(e) {
  112. return isBoolean(e) ? e : null !== e && "" !== e && "false" !== e
  113. }
  114. function hasProperty(e, t) {
  115. return e.hasOwnProperty(t)
  116. }
  117. function isStringEmpty(e) {
  118. return isNull(e) || isUndefined(e) || isString(e) && 0 == e.length
  119. }
  120. function isStringNonempty(e) {
  121. return isString(e) && e.length > 0
  122. }
  123. function upperCaseFirstLetter(e) {
  124. return e.charAt(0).toUpperCase() + e.slice(1)
  125. }
  126. function areEqual(e, t) {
  127. return angular.equals(e, t)
  128. }
  129. function min(e, t) {
  130. return e < t ? e : t
  131. }
  132. function max(e, t) {
  133. return e > t ? e : t
  134. }
  135. function beginsWith(e, t) {
  136. return isString(e) && 0 == e.lastIndexOf(t, 0)
  137. }
  138. function endsWith(e, t) {
  139. return isString(e) && -1 !== e.indexOf(t, e.length - t.length)
  140. }
  141. function copy(e, t) {
  142. return angular.copy(e, t)
  143. }
  144. function removeProperty(e, t) {
  145. delete e[t]
  146. }
  147. function removeProperties(e, t) {
  148. for (var n = 0; n < t.length; ++n) delete e[t[n]]
  149. }
  150. function forEach(e, t, n) {
  151. return angular.forEach(e, t, n)
  152. }
  153. function defineScalyrJsLibrary(e, t) {
  154. var n = [];
  155. if (t instanceof Array) for (var r = 0; r < t.length - 1; ++r) n.push(t[r]);
  156. return angular.module(e, n).factory(e, t)
  157. }
  158. function defineScalyrAngularModule(e, t) {
  159. return angular.module(e, t)
  160. }
  161. function getLang() {
  162. var e = localStorage.lang || "cn";
  163. return Langs[e] || Langs.en
  164. }
  165. function log10(e) {
  166. return Math.log(e) / Math.LN10
  167. }
  168. function millitime() {
  169. return (new Date).getTime() / 1e3
  170. }
  171. function hms_from_epoch_ms(e, t) {
  172. var n, r, o, i = "", a = null;
  173. try {
  174. a = new Date(e), t ? (n = a.getHours(), r = a.getMinutes(), o = a.getSeconds()) : (n = a.getUTCHours(), r = a.getUTCMinutes(), o = a.getUTCSeconds()), i += (n < 10 ? "0" + n : n) + ":", i += (r < 10 ? "0" + r : r) + ":", i += o < 10 ? "0" + o : o
  175. } catch (e) {
  176. i = "00:00:00"
  177. }
  178. return i
  179. }
  180. function formatted_date(e, t, n) {
  181. var r = new Date(1e3 * e), o = "";
  182. return !0 === n ? (t && (o = r.getFullYear() + "-"), o += r.getMonth() + 1 < 10 ? "0" : "", o += r.getMonth() + 1 + "-", o += r.getDate() < 10 ? "0" : "", o += r.getDate()) : (t && (o = r.getUTCFullYear() + "-"), o += r.getUTCMonth() + 1 < 10 ? "0" : "", o += r.getUTCMonth() + 1 + "-", o += r.getUTCDate() < 10 ? "0" : "", o += r.getUTCDate()), o
  183. }
  184. function timestamp(e) {
  185. null != e && void 0 !== e || (e = !0);
  186. var t, n, r, o = new Date, i = "";
  187. return e ? (t = o.getHours(), n = o.getMinutes(), r = o.getSeconds()) : (t = o.getUTCHours(), n = o.getUTCMinutes(), r = o.getUTCSeconds()), i += (t < 10 ? "0" + t : t) + ":", i += (n < 10 ? "0" + n : n) + ":", i += r < 10 ? "0" + r : r
  188. }
  189. function hms_from_sec(e) {
  190. var t = "", n = e % 60, r = (e - n) / 60 % 60, o = (e - 60 * r - n) / 3600 % 3600;
  191. return t += (o < 10 ? "0" + o : o) + ":", t += (r < 10 ? "0" + r : r) + ":", t += n < 10 ? "0" + n : n
  192. }
  193. function dhms_from_sec(e) {
  194. var t, n, r, o, i = "", a = e;
  195. return t = Math.floor(a / 86400), a -= 86400 * t, n = Math.floor(a / 3600), a -= 3600 * n, r = Math.floor(a / 60), o = a - 60 * r, i += t > 0 ? t + ":" : "", i += (n < 10 ? "0" + n : n) + ":", i += (r < 10 ? "0" + r : r) + ":", i += o < 10 ? "0" + o : o
  196. }
  197. function time_delta_print(e) {
  198. var t = "", n = 0, r = 0, o = 0, i = 0, a = e;
  199. return a |= 0, n = Math.floor(a / 86400), a -= 86400 * n, r = Math.floor(a / 3600), a -= 3600 * r, o = Math.floor(a / 60), i = a - 60 * o, n >= 2 ? t = n + " days" : n >= 1 ? (t = n + " day, " + r + " hour", r > 1 && (t += "s")) : r >= 1 ? (t = r + " hour", r > 1 && (t += "s")) : t = o >= 1 ? o + " min" : i + " sec", t + " ago"
  200. }
  201. function numberWithCommas(e) {
  202. var t = e.toString().split(".");
  203. return t[0] = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), t.join(".")
  204. }
  205. function delayClass(e, t, n) {
  206. window.setTimeout(function () {
  207. $(e).removeClass(t)
  208. }, n)
  209. }
  210. function deepCopy(e) {
  211. return $.extend(!0, {}, e)
  212. }
  213. function AssertException(e) {
  214. this.message = e
  215. }
  216. function assert(e, t) {
  217. if (!e) throw new AssertException(t)
  218. }
  219. function stopEvent(e) {
  220. try {
  221. e.preventDefault(), e.stopPropagation()
  222. } catch (e) {
  223. }
  224. }
  225. function NoBreak(e) {
  226. return e.replace(/ /g, "&nbsp;")
  227. }
  228. function HTMLEncode(e) {
  229. return $("<div/>").text(e).html()
  230. }
  231. function HTMLDecode(e) {
  232. return $("<div/>").html(e).text()
  233. }
  234. function clearingSpan() {
  235. return $("<span/>").addClass("clear").html("&nbsp;")
  236. }
  237. function clearingSpanHTML() {
  238. return '<span class="clear">&nbsp;</span>'
  239. }
  240. function uniqueID() {
  241. return "id" + lastUniqueID++
  242. }
  243. function randInt(e) {
  244. return Math.floor(Math.random() * e)
  245. }
  246. function randRange(e, t) {
  247. return Math.floor(Math.random() * (t - e)) + e
  248. }
  249. function randomString(e) {
  250. "number" != typeof e && (e = 10);
  251. var t = 0, n = "";
  252. for (t = 0; t < e; t++) n += alphabet[randInt(alphalen)];
  253. return n
  254. }
  255. function storageSupport() {
  256. try {
  257. return "localStorage" in window && null !== window.localStorage
  258. } catch (e) {
  259. return !1
  260. }
  261. }
  262. function wsSupport() {
  263. try {
  264. return !!window.WebSocket
  265. } catch (e) {
  266. return !1
  267. }
  268. }
  269. function locationOf(e, t, n, r, o) {
  270. null == n && (n = 0), null == r && (r = t.length - 1), "string" == typeof o && ("gt" == o ? o = function (e, t) {
  271. return e > t
  272. } : "lt" == o && (o = function (e, t) {
  273. return e < t
  274. }));
  275. var i = parseInt(n + (r - n) / 2);
  276. return t[i] == e ? {index: i, exact: !0} : r - n <= 1 ? {
  277. index: i + 1,
  278. exact: !1
  279. } : o(t[i], e) ? locationOf(e, t, i, r, o) : locationOf(e, t, n, i, o)
  280. }
  281. function has_worker() {
  282. return !!window.Worker
  283. }
  284. function pixel_ratio() {
  285. return window.hasOwnProperty("devicePixelRatio") ? window.devicePixelRatio : 1
  286. }
  287. function _(e, t) {
  288. return e
  289. }
  290. function PtInPolygon(e, t) {
  291. for (var n = 0, r = 0; r < t.length; r++) p1 = t[r], p2 = t[(r + 1) % t.length], p1[1] != p2[1] && (e[1] < Math.min(p1[1], p2[1]) || e[1] >= Math.max(p1[1], p2[1]) || (e[1] - p1[1]) * (p2[0] - p1[0]) / (p2[1] - p1[1]) + p1[0] > e[0] && n++);
  292. return n % 2 == 1
  293. }
  294. function chackRate() {
  295. var e = 0;
  296. for (timesList.length >= times && timesList.pop(), timesList.splice(0, 0, (new Date).getTime()), e = 0; e < timesList.length && !(timesList[e] + timeLimit < (new Date).getTime()); e++) ;
  297. return !(e >= times) || (console.log("@@@@@@按钮点击频率太快"), !1)
  298. }
  299. function Graph(e) {
  300. this.vertices = e, this.edges = 0, this.adj = [], this.edgeTo = [];
  301. for (var t = 0; t < this.vertices; t++) ;
  302. this.marked = {}, this.addEdge = function (e, t) {
  303. this.adj[e] || (this.adj[e] = []), this.adj[t] || (this.adj[t] = []), this.adj[e].push(t), this.adj[t].push(e), this.edges++
  304. }, this.bfs = function (e) {
  305. this.source = e;
  306. for (var t in this.marked) this.marked[t] = !1;
  307. var n = [];
  308. for (this.marked[e] = !0, n.push(e); n.length > 0;) {
  309. var r = n.shift();
  310. if (this.adj[r]) for (var o = 0; o < this.adj[r].length; o++) for (var i = this.adj[r], a = 0; a < i.length; a++) this.marked[i[a]] || (this.edgeTo[i[a]] = r, this.marked[i[a]] = !0, n.push(i[a]))
  311. }
  312. }, this.pathTo = function (e) {
  313. var t = this.source, n = 0, r = [];
  314. if (!this.edgeTo[e]) return 0;
  315. for (var o = e; o != t; o = this.edgeTo[o]) {
  316. if (!this.edgeTo[o]) return 0;
  317. if (r.push([this.edgeTo[o], o]), ++n > 100) break
  318. }
  319. return r
  320. }
  321. }
  322. !function (e) {
  323. var t = function (e) {
  324. var t = e.backingStorePixelRatio || e.mozBackingStorePixelRatio || e.msBackingStorePixelRatio || e.oBackingStorePixelRatio || e.backingStorePixelRatio || 1;
  325. return (window.devicePixelRatio || 1) / t
  326. }(e);
  327. 1 !== t && (!function (e, t) {
  328. for (var n in e) e.hasOwnProperty(n) && t(e[n], n)
  329. }({
  330. fillRect: "all",
  331. clearRect: "all",
  332. strokeRect: "all",
  333. moveTo: "all",
  334. lineTo: "all",
  335. arc: [0, 1, 2],
  336. arcTo: "all",
  337. bezierCurveTo: "all",
  338. isPointinPath: "all",
  339. isPointinStroke: "all",
  340. quadraticCurveTo: "all",
  341. rect: "all",
  342. translate: "all",
  343. createRadialGradient: "all",
  344. createLinearGradient: "all"
  345. }, function (n, r) {
  346. e[r] = function (e) {
  347. return function () {
  348. var r, o, i = Array.prototype.slice.call(arguments);
  349. if ("all" === n) i = i.map(function (e) {
  350. return e * t
  351. }); else if (Array.isArray(n)) for (r = 0, o = n.length; r < o; r++) i[n[r]] *= t;
  352. return e.apply(this, i)
  353. }
  354. }(e[r])
  355. }), e.stroke = function (e) {
  356. return function () {
  357. this.lineWidth *= t, e.apply(this, arguments), this.lineWidth /= t
  358. }
  359. }(e.stroke), e.fillText = function (e) {
  360. return function () {
  361. var n = Array.prototype.slice.call(arguments);
  362. n[1] *= t, n[2] *= t, this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (e, n, r) {
  363. return n * t + r
  364. }), n.length >= 4 && t > 1 && (n[3] *= t), e.apply(this, n), this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (e, n, r) {
  365. return n / t + r
  366. })
  367. }
  368. }(e.fillText), e.strokeText = function (e) {
  369. return function () {
  370. var n = Array.prototype.slice.call(arguments);
  371. n[1] *= t, n[2] *= t, this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (e, n, r) {
  372. return n * t + r
  373. }), e.apply(this, n), this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (e, n, r) {
  374. return n / t + r
  375. })
  376. }
  377. }(e.strokeText))
  378. }(CanvasRenderingContext2D.prototype), function (e) {
  379. e.getContext = function (e) {
  380. return function (t) {
  381. var n, r, o = e.call(this, t);
  382. return "2d" === t && (n = o.backingStorePixelRatio || o.mozBackingStorePixelRatio || o.msBackingStorePixelRatio || o.oBackingStorePixelRatio || o.backingStorePixelRatio || 1, (r = (window.devicePixelRatio || 1) / n) > 1 && "true" != $(this).attr("val") && !($(this).attr("class") || "").match("geetest_absolute") && ("" != this.style.height && Number(this.style.height.replace("px", "")) * r == this.height || (this.style.height = this.height + "px", this.style.width = this.width + "px", this.width *= r, this.height *= r, $(this).attr("val", !0)))), o
  383. }
  384. }(e.getContext)
  385. }(HTMLCanvasElement.prototype), function (e, t) {
  386. function n(e) {
  387. var t = e.length, n = ce.type(e);
  388. return !ce.isWindow(e) && (!(1 !== e.nodeType || !t) || ("array" === n || "function" !== n && (0 === t || "number" == typeof t && t > 0 && t - 1 in e)))
  389. }
  390. function r(e) {
  391. var t = Te[e] = {};
  392. return ce.each(e.match(fe) || [], function (e, n) {
  393. t[n] = !0
  394. }), t
  395. }
  396. function o(e, n, r, o) {
  397. if (ce.acceptData(e)) {
  398. var i, a, s = ce.expando, l = e.nodeType, c = l ? ce.cache : e, u = l ? e[s] : e[s] && s;
  399. if (u && c[u] && (o || c[u].data) || r !== t || "string" != typeof n) return u || (u = l ? e[s] = ee.pop() || ce.guid++ : s), c[u] || (c[u] = l ? {} : {toJSON: ce.noop}), ("object" == typeof n || "function" == typeof n) && (o ? c[u] = ce.extend(c[u], n) : c[u].data = ce.extend(c[u].data, n)), a = c[u], o || (a.data || (a.data = {}), a = a.data), r !== t && (a[ce.camelCase(n)] = r), "string" == typeof n ? null == (i = a[n]) && (i = a[ce.camelCase(n)]) : i = a, i
  400. }
  401. }
  402. function i(e, t, n) {
  403. if (ce.acceptData(e)) {
  404. var r, o, i = e.nodeType, a = i ? ce.cache : e, l = i ? e[ce.expando] : ce.expando;
  405. if (a[l]) {
  406. if (t && (r = n ? a[l] : a[l].data)) {
  407. ce.isArray(t) ? t = t.concat(ce.map(t, ce.camelCase)) : t in r ? t = [t] : (t = ce.camelCase(t), t = t in r ? [t] : t.split(" ")), o = t.length;
  408. for (; o--;) delete r[t[o]];
  409. if (n ? !s(r) : !ce.isEmptyObject(r)) return
  410. }
  411. (n || (delete a[l].data, s(a[l]))) && (i ? ce.cleanData([e], !0) : ce.support.deleteExpando || a != a.window ? delete a[l] : a[l] = null)
  412. }
  413. }
  414. }
  415. function a(e, n, r) {
  416. if (r === t && 1 === e.nodeType) {
  417. var o = "data-" + n.replace(Ce, "-$1").toLowerCase();
  418. if ("string" == typeof(r = e.getAttribute(o))) {
  419. try {
  420. r = "true" === r || "false" !== r && ("null" === r ? null : +r + "" === r ? +r : Se.test(r) ? ce.parseJSON(r) : r)
  421. } catch (e) {
  422. }
  423. ce.data(e, n, r)
  424. } else r = t
  425. }
  426. return r
  427. }
  428. function s(e) {
  429. var t;
  430. for (t in e) if (("data" !== t || !ce.isEmptyObject(e[t])) && "toJSON" !== t) return !1;
  431. return !0
  432. }
  433. function l() {
  434. return !0
  435. }
  436. function c() {
  437. return !1
  438. }
  439. function u() {
  440. try {
  441. return X.activeElement
  442. } catch (e) {
  443. }
  444. }
  445. function f(e, t) {
  446. do {
  447. e = e[t]
  448. } while (e && 1 !== e.nodeType);
  449. return e
  450. }
  451. function d(e, t, n) {
  452. if (ce.isFunction(t)) return ce.grep(e, function (e, r) {
  453. return !!t.call(e, r, e) !== n
  454. });
  455. if (t.nodeType) return ce.grep(e, function (e) {
  456. return e === t !== n
  457. });
  458. if ("string" == typeof t) {
  459. if (qe.test(t)) return ce.filter(t, e, n);
  460. t = ce.filter(t, e)
  461. }
  462. return ce.grep(e, function (e) {
  463. return ce.inArray(e, t) >= 0 !== n
  464. })
  465. }
  466. function p(e) {
  467. var t = ze.split("|"), n = e.createDocumentFragment();
  468. if (n.createElement) for (; t.length;) n.createElement(t.pop());
  469. return n
  470. }
  471. function h(e, t) {
  472. return ce.nodeName(e, "table") && ce.nodeName(1 === t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e
  473. }
  474. function g(e) {
  475. return e.type = (null !== ce.find.attr(e, "type")) + "/" + e.type, e
  476. }
  477. function m(e) {
  478. var t = rt.exec(e.type);
  479. return t ? e.type = t[1] : e.removeAttribute("type"), e
  480. }
  481. function v(e, t) {
  482. for (var n, r = 0; null != (n = e[r]); r++) ce._data(n, "globalEval", !t || ce._data(t[r], "globalEval"))
  483. }
  484. function b(e, t) {
  485. if (1 === t.nodeType && ce.hasData(e)) {
  486. var n, r, o, i = ce._data(e), a = ce._data(t, i), s = i.events;
  487. if (s) {
  488. delete a.handle, a.events = {};
  489. for (n in s) for (r = 0, o = s[n].length; o > r; r++) ce.event.add(t, n, s[n][r])
  490. }
  491. a.data && (a.data = ce.extend({}, a.data))
  492. }
  493. }
  494. function y(e, t) {
  495. var n, r, o;
  496. if (1 === t.nodeType) {
  497. if (n = t.nodeName.toLowerCase(), !ce.support.noCloneEvent && t[ce.expando]) {
  498. o = ce._data(t);
  499. for (r in o.events) ce.removeEvent(t, r, o.handle);
  500. t.removeAttribute(ce.expando)
  501. }
  502. "script" === n && t.text !== e.text ? (g(t).text = e.text, m(t)) : "object" === n ? (t.parentNode && (t.outerHTML = e.outerHTML), ce.support.html5Clone && e.innerHTML && !ce.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : "input" === n && et.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : "option" === n ? t.defaultSelected = t.selected = e.defaultSelected : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue)
  503. }
  504. }
  505. function x(e, n) {
  506. var r, o, i = 0,
  507. a = typeof e.getElementsByTagName !== G ? e.getElementsByTagName(n || "*") : typeof e.querySelectorAll !== G ? e.querySelectorAll(n || "*") : t;
  508. if (!a) for (a = [], r = e.childNodes || e; null != (o = r[i]); i++) !n || ce.nodeName(o, n) ? a.push(o) : ce.merge(a, x(o, n));
  509. return n === t || n && ce.nodeName(e, n) ? ce.merge([e], a) : a
  510. }
  511. function w(e) {
  512. et.test(e.type) && (e.defaultChecked = e.checked)
  513. }
  514. function $(e, t) {
  515. if (t in e) return t;
  516. for (var n = t.charAt(0).toUpperCase() + t.slice(1), r = t, o = $t.length; o--;) if ((t = $t[o] + n) in e) return t;
  517. return r
  518. }
  519. function k(e, t) {
  520. return e = t || e, "none" === ce.css(e, "display") || !ce.contains(e.ownerDocument, e)
  521. }
  522. function T(e, t) {
  523. for (var n, r, o, i = [], a = 0, s = e.length; s > a; a++) (r = e[a]).style && (i[a] = ce._data(r, "olddisplay"), n = r.style.display, t ? (i[a] || "none" !== n || (r.style.display = ""), "" === r.style.display && k(r) && (i[a] = ce._data(r, "olddisplay", A(r.nodeName)))) : i[a] || (o = k(r), (n && "none" !== n || !o) && ce._data(r, "olddisplay", o ? n : ce.css(r, "display"))));
  524. for (a = 0; s > a; a++) (r = e[a]).style && (t && "none" !== r.style.display && "" !== r.style.display || (r.style.display = t ? i[a] || "" : "none"));
  525. return e
  526. }
  527. function S(e, t, n) {
  528. var r = gt.exec(t);
  529. return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t
  530. }
  531. function C(e, t, n, r, o) {
  532. for (var i = n === (r ? "border" : "content") ? 4 : "width" === t ? 1 : 0, a = 0; 4 > i; i += 2) "margin" === n && (a += ce.css(e, n + wt[i], !0, o)), r ? ("content" === n && (a -= ce.css(e, "padding" + wt[i], !0, o)), "margin" !== n && (a -= ce.css(e, "border" + wt[i] + "Width", !0, o))) : (a += ce.css(e, "padding" + wt[i], !0, o), "padding" !== n && (a += ce.css(e, "border" + wt[i] + "Width", !0, o)));
  533. return a
  534. }
  535. function E(e, t, n) {
  536. var r = !0, o = "width" === t ? e.offsetWidth : e.offsetHeight, i = lt(e),
  537. a = ce.support.boxSizing && "border-box" === ce.css(e, "boxSizing", !1, i);
  538. if (0 >= o || null == o) {
  539. if ((0 > (o = ct(e, t, i)) || null == o) && (o = e.style[t]), mt.test(o)) return o;
  540. r = a && (ce.support.boxSizingReliable || o === e.style[t]), o = parseFloat(o) || 0
  541. }
  542. return o + C(e, t, n || (a ? "border" : "content"), r, i) + "px"
  543. }
  544. function A(e) {
  545. var t = X, n = bt[e];
  546. return n || ("none" !== (n = N(e, t)) && n || (st = (st || ce("<iframe frameborder='0' width='0' height='0'/>").css("cssText", "display:block !important")).appendTo(t.documentElement), (t = (st[0].contentWindow || st[0].contentDocument).document).write("<!doctype html><html><body>"), t.close(), n = N(e, t), st.detach()), bt[e] = n), n
  547. }
  548. function N(e, t) {
  549. var n = ce(t.createElement(e)).appendTo(t.body), r = ce.css(n[0], "display");
  550. return n.remove(), r
  551. }
  552. function P(e, t, n, r) {
  553. var o;
  554. if (ce.isArray(t)) ce.each(t, function (t, o) {
  555. n || Tt.test(e) ? r(e, o) : P(e + "[" + ("object" == typeof o ? t : "") + "]", o, n, r)
  556. }); else if (n || "object" !== ce.type(t)) r(e, t); else for (o in t) P(e + "[" + o + "]", t[o], n, r)
  557. }
  558. function O(e) {
  559. return function (t, n) {
  560. "string" != typeof t && (n = t, t = "*");
  561. var r, o = 0, i = t.toLowerCase().match(fe) || [];
  562. if (ce.isFunction(n)) for (; r = i[o++];) "+" === r[0] ? (r = r.slice(1) || "*", (e[r] = e[r] || []).unshift(n)) : (e[r] = e[r] || []).push(n)
  563. }
  564. }
  565. function D(e, n, r, o) {
  566. function i(l) {
  567. var c;
  568. return a[l] = !0, ce.each(e[l] || [], function (e, l) {
  569. var u = l(n, r, o);
  570. return "string" != typeof u || s || a[u] ? s ? !(c = u) : t : (n.dataTypes.unshift(u), i(u), !1)
  571. }), c
  572. }
  573. var a = {}, s = e === jt;
  574. return i(n.dataTypes[0]) || !a["*"] && i("*")
  575. }
  576. function I(e, n) {
  577. var r, o, i = ce.ajaxSettings.flatOptions || {};
  578. for (o in n) n[o] !== t && ((i[o] ? e : r || (r = {}))[o] = n[o]);
  579. return r && ce.extend(!0, e, r), e
  580. }
  581. function M(e, n, r) {
  582. for (var o, i, a, s, l = e.contents, c = e.dataTypes; "*" === c[0];) c.shift(), i === t && (i = e.mimeType || n.getResponseHeader("Content-Type"));
  583. if (i) for (s in l) if (l[s] && l[s].test(i)) {
  584. c.unshift(s);
  585. break
  586. }
  587. if (c[0] in r) a = c[0]; else {
  588. for (s in r) {
  589. if (!c[0] || e.converters[s + " " + c[0]]) {
  590. a = s;
  591. break
  592. }
  593. o || (o = s)
  594. }
  595. a = a || o
  596. }
  597. return a ? (a !== c[0] && c.unshift(a), r[a]) : t
  598. }
  599. function _(e, t, n, r) {
  600. var o, i, a, s, l, c = {}, u = e.dataTypes.slice();
  601. if (u[1]) for (a in e.converters) c[a.toLowerCase()] = e.converters[a];
  602. for (i = u.shift(); i;) if (e.responseFields[i] && (n[e.responseFields[i]] = t), !l && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), l = i, i = u.shift()) if ("*" === i) i = l; else if ("*" !== l && l !== i) {
  603. if (!(a = c[l + " " + i] || c["* " + i])) for (o in c) if ((s = o.split(" "))[1] === i && (a = c[l + " " + s[0]] || c["* " + s[0]])) {
  604. !0 === a ? a = c[o] : !0 !== c[o] && (i = s[0], u.unshift(s[1]));
  605. break
  606. }
  607. if (!0 !== a) if (a && e.throws) t = a(t); else try {
  608. t = a(t)
  609. } catch (e) {
  610. return {state: "parsererror", error: a ? e : "No conversion from " + l + " to " + i}
  611. }
  612. }
  613. return {state: "success", data: t}
  614. }
  615. function L() {
  616. try {
  617. return new e.XMLHttpRequest
  618. } catch (e) {
  619. }
  620. }
  621. function F() {
  622. try {
  623. return new e.ActiveXObject("Microsoft.XMLHTTP")
  624. } catch (e) {
  625. }
  626. }
  627. function B() {
  628. return setTimeout(function () {
  629. Yt = t
  630. }), Yt = ce.now()
  631. }
  632. function R(e, t, n) {
  633. for (var r, o = (en[t] || []).concat(en["*"]), i = 0, a = o.length; a > i; i++) if (r = o[i].call(n, t, e)) return r
  634. }
  635. function j(e, t, n) {
  636. var r, o, i = 0, a = Zt.length, s = ce.Deferred().always(function () {
  637. delete l.elem
  638. }), l = function () {
  639. if (o) return !1;
  640. for (var t = Yt || B(), n = Math.max(0, c.startTime + c.duration - t), r = 1 - (n / c.duration || 0), i = 0, a = c.tweens.length; a > i; i++) c.tweens[i].run(r);
  641. return s.notifyWith(e, [c, r, n]), 1 > r && a ? n : (s.resolveWith(e, [c]), !1)
  642. }, c = s.promise({
  643. elem: e,
  644. props: ce.extend({}, t),
  645. opts: ce.extend(!0, {specialEasing: {}}, n),
  646. originalProperties: t,
  647. originalOptions: n,
  648. startTime: Yt || B(),
  649. duration: n.duration,
  650. tweens: [],
  651. createTween: function (t, n) {
  652. var r = ce.Tween(e, c.opts, t, n, c.opts.specialEasing[t] || c.opts.easing);
  653. return c.tweens.push(r), r
  654. },
  655. stop: function (t) {
  656. var n = 0, r = t ? c.tweens.length : 0;
  657. if (o) return this;
  658. for (o = !0; r > n; n++) c.tweens[n].run(1);
  659. return t ? s.resolveWith(e, [c, t]) : s.rejectWith(e, [c, t]), this
  660. }
  661. }), u = c.props;
  662. for (q(u, c.opts.specialEasing); a > i; i++) if (r = Zt[i].call(c, e, u, c.opts)) return r;
  663. return ce.map(u, R, c), ce.isFunction(c.opts.start) && c.opts.start.call(e, c), ce.fx.timer(ce.extend(l, {
  664. elem: e,
  665. anim: c,
  666. queue: c.opts.queue
  667. })), c.progress(c.opts.progress).done(c.opts.done, c.opts.complete).fail(c.opts.fail).always(c.opts.always)
  668. }
  669. function q(e, t) {
  670. var n, r, o, i, a;
  671. for (n in e) if (r = ce.camelCase(n), o = t[r], i = e[n], ce.isArray(i) && (o = i[1], i = e[n] = i[0]), n !== r && (e[r] = i, delete e[n]), (a = ce.cssHooks[r]) && "expand" in a) {
  672. i = a.expand(i), delete e[r];
  673. for (n in i) n in e || (e[n] = i[n], t[n] = o)
  674. } else t[r] = o
  675. }
  676. function U(e, t, n, r, o) {
  677. return new U.prototype.init(e, t, n, r, o)
  678. }
  679. function H(e, t) {
  680. var n, r = {height: e}, o = 0;
  681. for (t = t ? 1 : 0; 4 > o; o += 2 - t) n = wt[o], r["margin" + n] = r["padding" + n] = e;
  682. return t && (r.opacity = r.width = e), r
  683. }
  684. function V(e) {
  685. return ce.isWindow(e) ? e : 9 === e.nodeType && (e.defaultView || e.parentWindow)
  686. }
  687. var z, W, G = typeof t, Y = e.location, X = e.document, K = X.documentElement, Q = e.jQuery, J = e.$, Z = {}, ee = [],
  688. te = "1.10.2", ne = ee.concat, re = ee.push, oe = ee.slice, ie = ee.indexOf, ae = Z.toString, se = Z.hasOwnProperty,
  689. le = te.trim, ce = function (e, t) {
  690. return new ce.fn.init(e, t, W)
  691. }, ue = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, fe = /\S+/g, de = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  692. pe = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, he = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, ge = /^[\],:{}\s]*$/,
  693. me = /(?:^|:|,)(?:\s*\[)+/g, ve = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
  694. be = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, ye = /^-ms-/, xe = /-([\da-z])/gi,
  695. we = function (e, t) {
  696. return t.toUpperCase()
  697. }, $e = function (e) {
  698. (X.addEventListener || "load" === e.type || "complete" === X.readyState) && (ke(), ce.ready())
  699. }, ke = function () {
  700. X.addEventListener ? (X.removeEventListener("DOMContentLoaded", $e, !1), e.removeEventListener("load", $e, !1)) : (X.detachEvent("onreadystatechange", $e), e.detachEvent("onload", $e))
  701. };
  702. ce.fn = ce.prototype = {
  703. jquery: te, constructor: ce, init: function (e, n, r) {
  704. var o, i;
  705. if (!e) return this;
  706. if ("string" == typeof e) {
  707. if (!(o = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : pe.exec(e)) || !o[1] && n) return !n || n.jquery ? (n || r).find(e) : this.constructor(n).find(e);
  708. if (o[1]) {
  709. if (n = n instanceof ce ? n[0] : n, ce.merge(this, ce.parseHTML(o[1], n && n.nodeType ? n.ownerDocument || n : X, !0)), he.test(o[1]) && ce.isPlainObject(n)) for (o in n) ce.isFunction(this[o]) ? this[o](n[o]) : this.attr(o, n[o]);
  710. return this
  711. }
  712. if ((i = X.getElementById(o[2])) && i.parentNode) {
  713. if (i.id !== o[2]) return r.find(e);
  714. this.length = 1, this[0] = i
  715. }
  716. return this.context = X, this.selector = e, this
  717. }
  718. return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : ce.isFunction(e) ? r.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), ce.makeArray(e, this))
  719. }, selector: "", length: 0, toArray: function () {
  720. return oe.call(this)
  721. }, get: function (e) {
  722. return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e]
  723. }, pushStack: function (e) {
  724. var t = ce.merge(this.constructor(), e);
  725. return t.prevObject = this, t.context = this.context, t
  726. }, each: function (e, t) {
  727. return ce.each(this, e, t)
  728. }, ready: function (e) {
  729. return ce.ready.promise().done(e), this
  730. }, slice: function () {
  731. return this.pushStack(oe.apply(this, arguments))
  732. }, first: function () {
  733. return this.eq(0)
  734. }, last: function () {
  735. return this.eq(-1)
  736. }, eq: function (e) {
  737. var t = this.length, n = +e + (0 > e ? t : 0);
  738. return this.pushStack(n >= 0 && t > n ? [this[n]] : [])
  739. }, map: function (e) {
  740. return this.pushStack(ce.map(this, function (t, n) {
  741. return e.call(t, n, t)
  742. }))
  743. }, end: function () {
  744. return this.prevObject || this.constructor(null)
  745. }, push: re, sort: [].sort, splice: [].splice
  746. }, ce.fn.init.prototype = ce.fn, ce.extend = ce.fn.extend = function () {
  747. var e, n, r, o, i, a, s = arguments[0] || {}, l = 1, c = arguments.length, u = !1;
  748. for ("boolean" == typeof s && (u = s, s = arguments[1] || {}, l = 2), "object" == typeof s || ce.isFunction(s) || (s = {}), c === l && (s = this, --l); c > l; l++) if (null != (i = arguments[l])) for (o in i) e = s[o], r = i[o], s !== r && (u && r && (ce.isPlainObject(r) || (n = ce.isArray(r))) ? (n ? (n = !1, a = e && ce.isArray(e) ? e : []) : a = e && ce.isPlainObject(e) ? e : {}, s[o] = ce.extend(u, a, r)) : r !== t && (s[o] = r));
  749. return s
  750. }, ce.extend({
  751. expando: "jQuery" + (te + Math.random()).replace(/\D/g, ""), noConflict: function (t) {
  752. return e.$ === ce && (e.$ = J), t && e.jQuery === ce && (e.jQuery = Q), ce
  753. }, isReady: !1, readyWait: 1, holdReady: function (e) {
  754. e ? ce.readyWait++ : ce.ready(!0)
  755. }, ready: function (e) {
  756. if (!0 === e ? !--ce.readyWait : !ce.isReady) {
  757. if (!X.body) return setTimeout(ce.ready);
  758. ce.isReady = !0, !0 !== e && --ce.readyWait > 0 || (z.resolveWith(X, [ce]), ce.fn.trigger && ce(X).trigger("ready").off("ready"))
  759. }
  760. }, isFunction: function (e) {
  761. return "function" === ce.type(e)
  762. }, isArray: Array.isArray || function (e) {
  763. return "array" === ce.type(e)
  764. }, isWindow: function (e) {
  765. return null != e && e == e.window
  766. }, isNumeric: function (e) {
  767. return !isNaN(parseFloat(e)) && isFinite(e)
  768. }, type: function (e) {
  769. return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? Z[ae.call(e)] || "object" : typeof e
  770. }, isPlainObject: function (e) {
  771. var n;
  772. if (!e || "object" !== ce.type(e) || e.nodeType || ce.isWindow(e)) return !1;
  773. try {
  774. if (e.constructor && !se.call(e, "constructor") && !se.call(e.constructor.prototype, "isPrototypeOf")) return !1
  775. } catch (e) {
  776. return !1
  777. }
  778. if (ce.support.ownLast) for (n in e) return se.call(e, n);
  779. for (n in e) ;
  780. return n === t || se.call(e, n)
  781. }, isEmptyObject: function (e) {
  782. var t;
  783. for (t in e) return !1;
  784. return !0
  785. }, error: function (e) {
  786. throw Error(e)
  787. }, parseHTML: function (e, t, n) {
  788. if (!e || "string" != typeof e) return null;
  789. "boolean" == typeof t && (n = t, t = !1), t = t || X;
  790. var r = he.exec(e), o = !n && [];
  791. return r ? [t.createElement(r[1])] : (r = ce.buildFragment([e], t, o), o && ce(o).remove(), ce.merge([], r.childNodes))
  792. }, parseJSON: function (n) {
  793. return e.JSON && e.JSON.parse ? e.JSON.parse(n) : null === n ? n : "string" == typeof n && (n = ce.trim(n)) && ge.test(n.replace(ve, "@").replace(be, "]").replace(me, "")) ? Function("return " + n)() : (ce.error("Invalid JSON: " + n), t)
  794. }, parseXML: function (n) {
  795. var r, o;
  796. if (!n || "string" != typeof n) return null;
  797. try {
  798. e.DOMParser ? (o = new DOMParser, r = o.parseFromString(n, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(n))
  799. } catch (e) {
  800. r = t
  801. }
  802. return r && r.documentElement && !r.getElementsByTagName("parsererror").length || ce.error("Invalid XML: " + n), r
  803. }, noop: function () {
  804. }, globalEval: function (t) {
  805. t && ce.trim(t) && (e.execScript || function (t) {
  806. e.eval.call(e, t)
  807. })(t)
  808. }, camelCase: function (e) {
  809. return e.replace(ye, "ms-").replace(xe, we)
  810. }, nodeName: function (e, t) {
  811. return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase()
  812. }, each: function (e, t, r) {
  813. var o = 0, i = e.length, a = n(e);
  814. if (r) {
  815. if (a) for (; i > o && !1 !== t.apply(e[o], r); o++) ; else for (o in e) if (!1 === t.apply(e[o], r)) break
  816. } else if (a) for (; i > o && !1 !== t.call(e[o], o, e[o]); o++) ; else for (o in e) if (!1 === t.call(e[o], o, e[o])) break;
  817. return e
  818. }, trim: le && !le.call("\ufeff ") ? function (e) {
  819. return null == e ? "" : le.call(e)
  820. } : function (e) {
  821. return null == e ? "" : (e + "").replace(de, "")
  822. }, makeArray: function (e, t) {
  823. var r = t || [];
  824. return null != e && (n(Object(e)) ? ce.merge(r, "string" == typeof e ? [e] : e) : re.call(r, e)), r
  825. }, inArray: function (e, t, n) {
  826. var r;
  827. if (t) {
  828. if (ie) return ie.call(t, e, n);
  829. for (r = t.length, n = n ? 0 > n ? Math.max(0, r + n) : n : 0; r > n; n++) if (n in t && t[n] === e) return n
  830. }
  831. return -1
  832. }, merge: function (e, n) {
  833. var r = n.length, o = e.length, i = 0;
  834. if ("number" == typeof r) for (; r > i; i++) e[o++] = n[i]; else for (; n[i] !== t;) e[o++] = n[i++];
  835. return e.length = o, e
  836. }, grep: function (e, t, n) {
  837. var r, o = [], i = 0, a = e.length;
  838. for (n = !!n; a > i; i++) r = !!t(e[i], i), n !== r && o.push(e[i]);
  839. return o
  840. }, map: function (e, t, r) {
  841. var o, i = 0, a = e.length, s = [];
  842. if (n(e)) for (; a > i; i++) null != (o = t(e[i], i, r)) && (s[s.length] = o); else for (i in e) null != (o = t(e[i], i, r)) && (s[s.length] = o);
  843. return ne.apply([], s)
  844. }, guid: 1, proxy: function (e, n) {
  845. var r, o, i;
  846. return "string" == typeof n && (i = e[n], n = e, e = i), ce.isFunction(e) ? (r = oe.call(arguments, 2), o = function () {
  847. return e.apply(n || this, r.concat(oe.call(arguments)))
  848. }, o.guid = e.guid = e.guid || ce.guid++, o) : t
  849. }, access: function (e, n, r, o, i, a, s) {
  850. var l = 0, c = e.length, u = null == r;
  851. if ("object" === ce.type(r)) {
  852. i = !0;
  853. for (l in r) ce.access(e, n, l, r[l], !0, a, s)
  854. } else if (o !== t && (i = !0, ce.isFunction(o) || (s = !0), u && (s ? (n.call(e, o), n = null) : (u = n, n = function (e, t, n) {
  855. return u.call(ce(e), n)
  856. })), n)) for (; c > l; l++) n(e[l], r, s ? o : o.call(e[l], l, n(e[l], r)));
  857. return i ? e : u ? n.call(e) : c ? n(e[0], r) : a
  858. }, now: function () {
  859. return (new Date).getTime()
  860. }, swap: function (e, t, n, r) {
  861. var o, i, a = {};
  862. for (i in t) a[i] = e.style[i], e.style[i] = t[i];
  863. o = n.apply(e, r || []);
  864. for (i in t) e.style[i] = a[i];
  865. return o
  866. }
  867. }), ce.ready.promise = function (t) {
  868. if (!z) if (z = ce.Deferred(), "complete" === X.readyState) setTimeout(ce.ready); else if (X.addEventListener) X.addEventListener("DOMContentLoaded", $e, !1), e.addEventListener("load", $e, !1); else {
  869. X.attachEvent("onreadystatechange", $e), e.attachEvent("onload", $e);
  870. var n = !1;
  871. try {
  872. n = null == e.frameElement && X.documentElement
  873. } catch (e) {
  874. }
  875. n && n.doScroll && function e() {
  876. if (!ce.isReady) {
  877. try {
  878. n.doScroll("left")
  879. } catch (t) {
  880. return setTimeout(e, 50)
  881. }
  882. ke(), ce.ready()
  883. }
  884. }()
  885. }
  886. return z.promise(t)
  887. }, ce.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (e, t) {
  888. Z["[object " + t + "]"] = t.toLowerCase()
  889. }), W = ce(X), function (e, t) {
  890. function n(e, t, n, r) {
  891. var o, i, a, s, l, c, d, p, h, g;
  892. if ((t ? t.ownerDocument || t : B) !== P && N(t), t = t || P, n = n || [], !e || "string" != typeof e) return n;
  893. if (1 !== (s = t.nodeType) && 9 !== s) return [];
  894. if (D && !r) {
  895. if (o = ve.exec(e)) if (a = o[1]) {
  896. if (9 === s) {
  897. if (!(i = t.getElementById(a)) || !i.parentNode) return n;
  898. if (i.id === a) return n.push(i), n
  899. } else if (t.ownerDocument && (i = t.ownerDocument.getElementById(a)) && L(t, i) && i.id === a) return n.push(i), n
  900. } else {
  901. if (o[2]) return J.apply(n, t.getElementsByTagName(e)), n;
  902. if ((a = o[3]) && w.getElementsByClassName && t.getElementsByClassName) return J.apply(n, t.getElementsByClassName(a)), n
  903. }
  904. if (w.qsa && (!I || !I.test(e))) {
  905. if (p = d = F, h = t, g = 9 === s && e, 1 === s && "object" !== t.nodeName.toLowerCase()) {
  906. for (c = u(e), (d = t.getAttribute("id")) ? p = d.replace(xe, "\\$&") : t.setAttribute("id", p), p = "[id='" + p + "'] ", l = c.length; l--;) c[l] = p + f(c[l]);
  907. h = fe.test(e) && t.parentNode || t, g = c.join(",")
  908. }
  909. if (g) try {
  910. return J.apply(n, h.querySelectorAll(g)), n
  911. } catch (e) {
  912. } finally {
  913. d || t.removeAttribute("id")
  914. }
  915. }
  916. }
  917. return y(e.replace(se, "$1"), t, n, r)
  918. }
  919. function r() {
  920. function e(n, r) {
  921. return t.push(n += " ") > k.cacheLength && delete e[t.shift()], e[n] = r
  922. }
  923. var t = [];
  924. return e
  925. }
  926. function o(e) {
  927. return e[F] = !0, e
  928. }
  929. function i(e) {
  930. var t = P.createElement("div");
  931. try {
  932. return !!e(t)
  933. } catch (e) {
  934. return !1
  935. } finally {
  936. t.parentNode && t.parentNode.removeChild(t), t = null
  937. }
  938. }
  939. function a(e, t) {
  940. for (var n = e.split("|"), r = e.length; r--;) k.attrHandle[n[r]] = t
  941. }
  942. function s(e, t) {
  943. var n = t && e, r = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || G) - (~e.sourceIndex || G);
  944. if (r) return r;
  945. if (n) for (; n = n.nextSibling;) if (n === t) return -1;
  946. return e ? 1 : -1
  947. }
  948. function l(e) {
  949. return o(function (t) {
  950. return t = +t, o(function (n, r) {
  951. for (var o, i = e([], n.length, t), a = i.length; a--;) n[o = i[a]] && (n[o] = !(r[o] = n[o]))
  952. })
  953. })
  954. }
  955. function c() {
  956. }
  957. function u(e, t) {
  958. var r, o, i, a, s, l, c, u = U[e + " "];
  959. if (u) return t ? 0 : u.slice(0);
  960. for (s = e, l = [], c = k.preFilter; s;) {
  961. (!r || (o = le.exec(s))) && (o && (s = s.slice(o[0].length) || s), l.push(i = [])), r = !1, (o = ue.exec(s)) && (r = o.shift(), i.push({
  962. value: r,
  963. type: o[0].replace(se, " ")
  964. }), s = s.slice(r.length));
  965. for (a in k.filter) !(o = ge[a].exec(s)) || c[a] && !(o = c[a](o)) || (r = o.shift(), i.push({
  966. value: r,
  967. type: a,
  968. matches: o
  969. }), s = s.slice(r.length));
  970. if (!r) break
  971. }
  972. return t ? s.length : s ? n.error(e) : U(e, l).slice(0)
  973. }
  974. function f(e) {
  975. for (var t = 0, n = e.length, r = ""; n > t; t++) r += e[t].value;
  976. return r
  977. }
  978. function d(e, t, n) {
  979. var r = t.dir, o = n && "parentNode" === r, i = j++;
  980. return t.first ? function (t, n, i) {
  981. for (; t = t[r];) if (1 === t.nodeType || o) return e(t, n, i)
  982. } : function (t, n, a) {
  983. var s, l, c, u = R + " " + i;
  984. if (a) {
  985. for (; t = t[r];) if ((1 === t.nodeType || o) && e(t, n, a)) return !0
  986. } else for (; t = t[r];) if (1 === t.nodeType || o) if (c = t[F] || (t[F] = {}), (l = c[r]) && l[0] === u) {
  987. if (!0 === (s = l[1]) || s === $) return !0 === s
  988. } else if (l = c[r] = [u], l[1] = e(t, n, a) || $, !0 === l[1]) return !0
  989. }
  990. }
  991. function p(e) {
  992. return e.length > 1 ? function (t, n, r) {
  993. for (var o = e.length; o--;) if (!e[o](t, n, r)) return !1;
  994. return !0
  995. } : e[0]
  996. }
  997. function h(e, t, n, r, o) {
  998. for (var i, a = [], s = 0, l = e.length, c = null != t; l > s; s++) (i = e[s]) && (!n || n(i, r, o)) && (a.push(i), c && t.push(s));
  999. return a
  1000. }
  1001. function g(e, t, n, r, i, a) {
  1002. return r && !r[F] && (r = g(r)), i && !i[F] && (i = g(i, a)), o(function (o, a, s, l) {
  1003. var c, u, f, d = [], p = [], g = a.length, m = o || b(t || "*", s.nodeType ? [s] : s, []),
  1004. v = !e || !o && t ? m : h(m, d, e, s, l), y = n ? i || (o ? e : g || r) ? [] : a : v;
  1005. if (n && n(v, y, s, l), r) for (c = h(y, p), r(c, [], s, l), u = c.length; u--;) (f = c[u]) && (y[p[u]] = !(v[p[u]] = f));
  1006. if (o) {
  1007. if (i || e) {
  1008. if (i) {
  1009. for (c = [], u = y.length; u--;) (f = y[u]) && c.push(v[u] = f);
  1010. i(null, y = [], c, l)
  1011. }
  1012. for (u = y.length; u--;) (f = y[u]) && (c = i ? ee.call(o, f) : d[u]) > -1 && (o[c] = !(a[c] = f))
  1013. }
  1014. } else y = h(y === a ? y.splice(g, y.length) : y), i ? i(null, a, y, l) : J.apply(a, y)
  1015. })
  1016. }
  1017. function m(e) {
  1018. for (var t, n, r, o = e.length, i = k.relative[e[0].type], a = i || k.relative[" "], s = i ? 1 : 0, l = d(function (e) {
  1019. return e === t
  1020. }, a, !0), c = d(function (e) {
  1021. return ee.call(t, e) > -1
  1022. }, a, !0), u = [function (e, n, r) {
  1023. return !i && (r || n !== E) || ((t = n).nodeType ? l(e, n, r) : c(e, n, r))
  1024. }]; o > s; s++) if (n = k.relative[e[s].type]) u = [d(p(u), n)]; else {
  1025. if ((n = k.filter[e[s].type].apply(null, e[s].matches))[F]) {
  1026. for (r = ++s; o > r && !k.relative[e[r].type]; r++) ;
  1027. return g(s > 1 && p(u), s > 1 && f(e.slice(0, s - 1).concat({value: " " === e[s - 2].type ? "*" : ""})).replace(se, "$1"), n, r > s && m(e.slice(s, r)), o > r && m(e = e.slice(r)), o > r && f(e))
  1028. }
  1029. u.push(n)
  1030. }
  1031. return p(u)
  1032. }
  1033. function v(e, t) {
  1034. var r = 0, i = t.length > 0, a = e.length > 0, s = function (o, s, l, c, u) {
  1035. var f, d, p, g = [], m = 0, v = "0", b = o && [], y = null != u, x = E,
  1036. w = o || a && k.find.TAG("*", u && s.parentNode || s), T = R += null == x ? 1 : Math.random() || .1;
  1037. for (y && (E = s !== P && s, $ = r); null != (f = w[v]); v++) {
  1038. if (a && f) {
  1039. for (d = 0; p = e[d++];) if (p(f, s, l)) {
  1040. c.push(f);
  1041. break
  1042. }
  1043. y && (R = T, $ = ++r)
  1044. }
  1045. i && ((f = !p && f) && m--, o && b.push(f))
  1046. }
  1047. if (m += v, i && v !== m) {
  1048. for (d = 0; p = t[d++];) p(b, g, s, l);
  1049. if (o) {
  1050. if (m > 0) for (; v--;) b[v] || g[v] || (g[v] = K.call(c));
  1051. g = h(g)
  1052. }
  1053. J.apply(c, g), y && !o && g.length > 0 && m + t.length > 1 && n.uniqueSort(c)
  1054. }
  1055. return y && (R = T, E = x), b
  1056. };
  1057. return i ? o(s) : s
  1058. }
  1059. function b(e, t, r) {
  1060. for (var o = 0, i = t.length; i > o; o++) n(e, t[o], r);
  1061. return r
  1062. }
  1063. function y(e, t, n, r) {
  1064. var o, i, a, s, l, c = u(e);
  1065. if (!r && 1 === c.length) {
  1066. if ((i = c[0] = c[0].slice(0)).length > 2 && "ID" === (a = i[0]).type && w.getById && 9 === t.nodeType && D && k.relative[i[1].type]) {
  1067. if (!(t = (k.find.ID(a.matches[0].replace(we, $e), t) || [])[0])) return n;
  1068. e = e.slice(i.shift().value.length)
  1069. }
  1070. for (o = ge.needsContext.test(e) ? 0 : i.length; o-- && (a = i[o], !k.relative[s = a.type]);) if ((l = k.find[s]) && (r = l(a.matches[0].replace(we, $e), fe.test(i[0].type) && t.parentNode || t))) {
  1071. if (i.splice(o, 1), !(e = r.length && f(i))) return J.apply(n, r), n;
  1072. break
  1073. }
  1074. }
  1075. return C(e, c)(r, t, !D, n, fe.test(e)), n
  1076. }
  1077. var x, w, $, k, T, S, C, E, A, N, P, O, D, I, M, _, L, F = "sizzle" + -new Date, B = e.document, R = 0, j = 0,
  1078. q = r(), U = r(), H = r(), V = !1, z = function (e, t) {
  1079. return e === t ? (V = !0, 0) : 0
  1080. }, W = typeof t, G = 1 << 31, Y = {}.hasOwnProperty, X = [], K = X.pop, Q = X.push, J = X.push, Z = X.slice,
  1081. ee = X.indexOf || function (e) {
  1082. for (var t = 0, n = this.length; n > t; t++) if (this[t] === e) return t;
  1083. return -1
  1084. },
  1085. te = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  1086. ne = "[\\x20\\t\\r\\n\\f]", re = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", oe = re.replace("w", "w#"),
  1087. ie = "\\[" + ne + "*(" + re + ")" + ne + "*(?:([*^$|!~]?=)" + ne + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + oe + ")|)|)" + ne + "*\\]",
  1088. ae = ":(" + re + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + ie.replace(3, 8) + ")*)|.*)\\)|)",
  1089. se = RegExp("^" + ne + "+|((?:^|[^\\\\])(?:\\\\.)*)" + ne + "+$", "g"), le = RegExp("^" + ne + "*," + ne + "*"),
  1090. ue = RegExp("^" + ne + "*([>+~]|" + ne + ")" + ne + "*"), fe = RegExp(ne + "*[+~]"),
  1091. de = RegExp("=" + ne + "*([^\\]'\"]*)" + ne + "*\\]", "g"), pe = RegExp(ae), he = RegExp("^" + oe + "$"), ge = {
  1092. ID: RegExp("^#(" + re + ")"),
  1093. CLASS: RegExp("^\\.(" + re + ")"),
  1094. TAG: RegExp("^(" + re.replace("w", "w*") + ")"),
  1095. ATTR: RegExp("^" + ie),
  1096. PSEUDO: RegExp("^" + ae),
  1097. CHILD: RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + ne + "*(even|odd|(([+-]|)(\\d*)n|)" + ne + "*(?:([+-]|)" + ne + "*(\\d+)|))" + ne + "*\\)|)", "i"),
  1098. bool: RegExp("^(?:" + te + ")$", "i"),
  1099. needsContext: RegExp("^" + ne + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + ne + "*((?:-\\d)?\\d*)" + ne + "*\\)|)(?=[^-]|$)", "i")
  1100. }, me = /^[^{]+\{\s*\[native \w/, ve = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  1101. be = /^(?:input|select|textarea|button)$/i, ye = /^h\d$/i, xe = /'|\\/g,
  1102. we = RegExp("\\\\([\\da-f]{1,6}" + ne + "?|(" + ne + ")|.)", "ig"), $e = function (e, t, n) {
  1103. var r = "0x" + t - 65536;
  1104. return r != r || n ? t : 0 > r ? String.fromCharCode(r + 65536) : String.fromCharCode(55296 | r >> 10, 56320 | 1023 & r)
  1105. };
  1106. try {
  1107. J.apply(X = Z.call(B.childNodes), B.childNodes), X[B.childNodes.length].nodeType
  1108. } catch (e) {
  1109. J = {
  1110. apply: X.length ? function (e, t) {
  1111. Q.apply(e, Z.call(t))
  1112. } : function (e, t) {
  1113. for (var n = e.length, r = 0; e[n++] = t[r++];) ;
  1114. e.length = n - 1
  1115. }
  1116. }
  1117. }
  1118. S = n.isXML = function (e) {
  1119. var t = e && (e.ownerDocument || e).documentElement;
  1120. return !!t && "HTML" !== t.nodeName
  1121. }, w = n.support = {}, N = n.setDocument = function (e) {
  1122. var n = e ? e.ownerDocument || e : B, r = n.defaultView;
  1123. return n !== P && 9 === n.nodeType && n.documentElement ? (P = n, O = n.documentElement, D = !S(n), r && r.attachEvent && r !== r.top && r.attachEvent("onbeforeunload", function () {
  1124. N()
  1125. }), w.attributes = i(function (e) {
  1126. return e.className = "i", !e.getAttribute("className")
  1127. }), w.getElementsByTagName = i(function (e) {
  1128. return e.appendChild(n.createComment("")), !e.getElementsByTagName("*").length
  1129. }), w.getElementsByClassName = i(function (e) {
  1130. return e.innerHTML = "<div class='a'></div><div class='a i'></div>", e.firstChild.className = "i", 2 === e.getElementsByClassName("i").length
  1131. }), w.getById = i(function (e) {
  1132. return O.appendChild(e).id = F, !n.getElementsByName || !n.getElementsByName(F).length
  1133. }), w.getById ? (k.find.ID = function (e, t) {
  1134. if (typeof t.getElementById !== W && D) {
  1135. var n = t.getElementById(e);
  1136. return n && n.parentNode ? [n] : []
  1137. }
  1138. }, k.filter.ID = function (e) {
  1139. var t = e.replace(we, $e);
  1140. return function (e) {
  1141. return e.getAttribute("id") === t
  1142. }
  1143. }) : (delete k.find.ID, k.filter.ID = function (e) {
  1144. var t = e.replace(we, $e);
  1145. return function (e) {
  1146. var n = typeof e.getAttributeNode !== W && e.getAttributeNode("id");
  1147. return n && n.value === t
  1148. }
  1149. }), k.find.TAG = w.getElementsByTagName ? function (e, n) {
  1150. return typeof n.getElementsByTagName !== W ? n.getElementsByTagName(e) : t
  1151. } : function (e, t) {
  1152. var n, r = [], o = 0, i = t.getElementsByTagName(e);
  1153. if ("*" === e) {
  1154. for (; n = i[o++];) 1 === n.nodeType && r.push(n);
  1155. return r
  1156. }
  1157. return i
  1158. }, k.find.CLASS = w.getElementsByClassName && function (e, n) {
  1159. return typeof n.getElementsByClassName !== W && D ? n.getElementsByClassName(e) : t
  1160. }, M = [], I = [], (w.qsa = me.test(n.querySelectorAll)) && (i(function (e) {
  1161. e.innerHTML = "<select><option selected=''></option></select>", e.querySelectorAll("[selected]").length || I.push("\\[" + ne + "*(?:value|" + te + ")"), e.querySelectorAll(":checked").length || I.push(":checked")
  1162. }), i(function (e) {
  1163. var t = n.createElement("input");
  1164. t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("t", ""), e.querySelectorAll("[t^='']").length && I.push("[*^$]=" + ne + "*(?:''|\"\")"), e.querySelectorAll(":enabled").length || I.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), I.push(",.*:")
  1165. })), (w.matchesSelector = me.test(_ = O.webkitMatchesSelector || O.mozMatchesSelector || O.oMatchesSelector || O.msMatchesSelector)) && i(function (e) {
  1166. w.disconnectedMatch = _.call(e, "div"), _.call(e, "[s!='']:x"), M.push("!=", ae)
  1167. }), I = I.length && RegExp(I.join("|")), M = M.length && RegExp(M.join("|")), L = me.test(O.contains) || O.compareDocumentPosition ? function (e, t) {
  1168. var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode;
  1169. return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r)))
  1170. } : function (e, t) {
  1171. if (t) for (; t = t.parentNode;) if (t === e) return !0;
  1172. return !1
  1173. }, z = O.compareDocumentPosition ? function (e, t) {
  1174. if (e === t) return V = !0, 0;
  1175. var r = t.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(t);
  1176. return r ? 1 & r || !w.sortDetached && t.compareDocumentPosition(e) === r ? e === n || L(B, e) ? -1 : t === n || L(B, t) ? 1 : A ? ee.call(A, e) - ee.call(A, t) : 0 : 4 & r ? -1 : 1 : e.compareDocumentPosition ? -1 : 1
  1177. } : function (e, t) {
  1178. var r, o = 0, i = e.parentNode, a = t.parentNode, l = [e], c = [t];
  1179. if (e === t) return V = !0, 0;
  1180. if (!i || !a) return e === n ? -1 : t === n ? 1 : i ? -1 : a ? 1 : A ? ee.call(A, e) - ee.call(A, t) : 0;
  1181. if (i === a) return s(e, t);
  1182. for (r = e; r = r.parentNode;) l.unshift(r);
  1183. for (r = t; r = r.parentNode;) c.unshift(r);
  1184. for (; l[o] === c[o];) o++;
  1185. return o ? s(l[o], c[o]) : l[o] === B ? -1 : c[o] === B ? 1 : 0
  1186. }, n) : P
  1187. }, n.matches = function (e, t) {
  1188. return n(e, null, null, t)
  1189. }, n.matchesSelector = function (e, t) {
  1190. if ((e.ownerDocument || e) !== P && N(e), t = t.replace(de, "='$1']"), !(!w.matchesSelector || !D || M && M.test(t) || I && I.test(t))) try {
  1191. var r = _.call(e, t);
  1192. if (r || w.disconnectedMatch || e.document && 11 !== e.document.nodeType) return r
  1193. } catch (e) {
  1194. }
  1195. return n(t, P, null, [e]).length > 0
  1196. }, n.contains = function (e, t) {
  1197. return (e.ownerDocument || e) !== P && N(e), L(e, t)
  1198. }, n.attr = function (e, n) {
  1199. (e.ownerDocument || e) !== P && N(e);
  1200. var r = k.attrHandle[n.toLowerCase()], o = r && Y.call(k.attrHandle, n.toLowerCase()) ? r(e, n, !D) : t;
  1201. return o === t ? w.attributes || !D ? e.getAttribute(n) : (o = e.getAttributeNode(n)) && o.specified ? o.value : null : o
  1202. }, n.error = function (e) {
  1203. throw Error("Syntax error, unrecognized expression: " + e)
  1204. }, n.uniqueSort = function (e) {
  1205. var t, n = [], r = 0, o = 0;
  1206. if (V = !w.detectDuplicates, A = !w.sortStable && e.slice(0), e.sort(z), V) {
  1207. for (; t = e[o++];) t === e[o] && (r = n.push(o));
  1208. for (; r--;) e.splice(n[r], 1)
  1209. }
  1210. return e
  1211. }, T = n.getText = function (e) {
  1212. var t, n = "", r = 0, o = e.nodeType;
  1213. if (o) {
  1214. if (1 === o || 9 === o || 11 === o) {
  1215. if ("string" == typeof e.textContent) return e.textContent;
  1216. for (e = e.firstChild; e; e = e.nextSibling) n += T(e)
  1217. } else if (3 === o || 4 === o) return e.nodeValue
  1218. } else for (; t = e[r]; r++) n += T(t);
  1219. return n
  1220. }, (k = n.selectors = {
  1221. cacheLength: 50,
  1222. createPseudo: o,
  1223. match: ge,
  1224. attrHandle: {},
  1225. find: {},
  1226. relative: {
  1227. ">": {dir: "parentNode", first: !0},
  1228. " ": {dir: "parentNode"},
  1229. "+": {dir: "previousSibling", first: !0},
  1230. "~": {dir: "previousSibling"}
  1231. },
  1232. preFilter: {
  1233. ATTR: function (e) {
  1234. return e[1] = e[1].replace(we, $e), e[3] = (e[4] || e[5] || "").replace(we, $e), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4)
  1235. }, CHILD: function (e) {
  1236. return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || n.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && n.error(e[0]), e
  1237. }, PSEUDO: function (e) {
  1238. var n, r = !e[5] && e[2];
  1239. return ge.CHILD.test(e[0]) ? null : (e[3] && e[4] !== t ? e[2] = e[4] : r && pe.test(r) && (n = u(r, !0)) && (n = r.indexOf(")", r.length - n) - r.length) && (e[0] = e[0].slice(0, n), e[2] = r.slice(0, n)), e.slice(0, 3))
  1240. }
  1241. },
  1242. filter: {
  1243. TAG: function (e) {
  1244. var t = e.replace(we, $e).toLowerCase();
  1245. return "*" === e ? function () {
  1246. return !0
  1247. } : function (e) {
  1248. return e.nodeName && e.nodeName.toLowerCase() === t
  1249. }
  1250. }, CLASS: function (e) {
  1251. var t = q[e + " "];
  1252. return t || (t = RegExp("(^|" + ne + ")" + e + "(" + ne + "|$)")) && q(e, function (e) {
  1253. return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== W && e.getAttribute("class") || "")
  1254. })
  1255. }, ATTR: function (e, t, r) {
  1256. return function (o) {
  1257. var i = n.attr(o, e);
  1258. return null == i ? "!=" === t : !t || (i += "", "=" === t ? i === r : "!=" === t ? i !== r : "^=" === t ? r && 0 === i.indexOf(r) : "*=" === t ? r && i.indexOf(r) > -1 : "$=" === t ? r && i.slice(-r.length) === r : "~=" === t ? (" " + i + " ").indexOf(r) > -1 : "|=" === t && (i === r || i.slice(0, r.length + 1) === r + "-"))
  1259. }
  1260. }, CHILD: function (e, t, n, r, o) {
  1261. var i = "nth" !== e.slice(0, 3), a = "last" !== e.slice(-4), s = "of-type" === t;
  1262. return 1 === r && 0 === o ? function (e) {
  1263. return !!e.parentNode
  1264. } : function (t, n, l) {
  1265. var c, u, f, d, p, h, g = i !== a ? "nextSibling" : "previousSibling", m = t.parentNode,
  1266. v = s && t.nodeName.toLowerCase(), b = !l && !s;
  1267. if (m) {
  1268. if (i) {
  1269. for (; g;) {
  1270. for (f = t; f = f[g];) if (s ? f.nodeName.toLowerCase() === v : 1 === f.nodeType) return !1;
  1271. h = g = "only" === e && !h && "nextSibling"
  1272. }
  1273. return !0
  1274. }
  1275. if (h = [a ? m.firstChild : m.lastChild], a && b) {
  1276. for (p = (c = (u = m[F] || (m[F] = {}))[e] || [])[0] === R && c[1], d = c[0] === R && c[2], f = p && m.childNodes[p]; f = ++p && f && f[g] || (d = p = 0) || h.pop();) if (1 === f.nodeType && ++d && f === t) {
  1277. u[e] = [R, p, d];
  1278. break
  1279. }
  1280. } else if (b && (c = (t[F] || (t[F] = {}))[e]) && c[0] === R) d = c[1]; else for (; (f = ++p && f && f[g] || (d = p = 0) || h.pop()) && ((s ? f.nodeName.toLowerCase() !== v : 1 !== f.nodeType) || !++d || (b && ((f[F] || (f[F] = {}))[e] = [R, d]), f !== t));) ;
  1281. return (d -= o) === r || 0 == d % r && d / r >= 0
  1282. }
  1283. }
  1284. }, PSEUDO: function (e, t) {
  1285. var r, i = k.pseudos[e] || k.setFilters[e.toLowerCase()] || n.error("unsupported pseudo: " + e);
  1286. return i[F] ? i(t) : i.length > 1 ? (r = [e, e, "", t], k.setFilters.hasOwnProperty(e.toLowerCase()) ? o(function (e, n) {
  1287. for (var r, o = i(e, t), a = o.length; a--;) r = ee.call(e, o[a]), e[r] = !(n[r] = o[a])
  1288. }) : function (e) {
  1289. return i(e, 0, r)
  1290. }) : i
  1291. }
  1292. },
  1293. pseudos: {
  1294. not: o(function (e) {
  1295. var t = [], n = [], r = C(e.replace(se, "$1"));
  1296. return r[F] ? o(function (e, t, n, o) {
  1297. for (var i, a = r(e, null, o, []), s = e.length; s--;) (i = a[s]) && (e[s] = !(t[s] = i))
  1298. }) : function (e, o, i) {
  1299. return t[0] = e, r(t, null, i, n), !n.pop()
  1300. }
  1301. }), has: o(function (e) {
  1302. return function (t) {
  1303. return n(e, t).length > 0
  1304. }
  1305. }), contains: o(function (e) {
  1306. return function (t) {
  1307. return (t.textContent || t.innerText || T(t)).indexOf(e) > -1
  1308. }
  1309. }), lang: o(function (e) {
  1310. return he.test(e || "") || n.error("unsupported lang: " + e), e = e.replace(we, $e).toLowerCase(), function (t) {
  1311. var n;
  1312. do {
  1313. if (n = D ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return (n = n.toLowerCase()) === e || 0 === n.indexOf(e + "-")
  1314. } while ((t = t.parentNode) && 1 === t.nodeType);
  1315. return !1
  1316. }
  1317. }), target: function (t) {
  1318. var n = e.location && e.location.hash;
  1319. return n && n.slice(1) === t.id
  1320. }, root: function (e) {
  1321. return e === O
  1322. }, focus: function (e) {
  1323. return e === P.activeElement && (!P.hasFocus || P.hasFocus()) && !!(e.type || e.href || ~e.tabIndex)
  1324. }, enabled: function (e) {
  1325. return !1 === e.disabled
  1326. }, disabled: function (e) {
  1327. return !0 === e.disabled
  1328. }, checked: function (e) {
  1329. var t = e.nodeName.toLowerCase();
  1330. return "input" === t && !!e.checked || "option" === t && !!e.selected
  1331. }, selected: function (e) {
  1332. return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected
  1333. }, empty: function (e) {
  1334. for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeName > "@" || 3 === e.nodeType || 4 === e.nodeType) return !1;
  1335. return !0
  1336. }, parent: function (e) {
  1337. return !k.pseudos.empty(e)
  1338. }, header: function (e) {
  1339. return ye.test(e.nodeName)
  1340. }, input: function (e) {
  1341. return be.test(e.nodeName)
  1342. }, button: function (e) {
  1343. var t = e.nodeName.toLowerCase();
  1344. return "input" === t && "button" === e.type || "button" === t
  1345. }, text: function (e) {
  1346. var t;
  1347. return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || t.toLowerCase() === e.type)
  1348. }, first: l(function () {
  1349. return [0]
  1350. }), last: l(function (e, t) {
  1351. return [t - 1]
  1352. }), eq: l(function (e, t, n) {
  1353. return [0 > n ? n + t : n]
  1354. }), even: l(function (e, t) {
  1355. for (var n = 0; t > n; n += 2) e.push(n);
  1356. return e
  1357. }), odd: l(function (e, t) {
  1358. for (var n = 1; t > n; n += 2) e.push(n);
  1359. return e
  1360. }), lt: l(function (e, t, n) {
  1361. for (var r = 0 > n ? n + t : n; --r >= 0;) e.push(r);
  1362. return e
  1363. }), gt: l(function (e, t, n) {
  1364. for (var r = 0 > n ? n + t : n; t > ++r;) e.push(r);
  1365. return e
  1366. })
  1367. }
  1368. }).pseudos.nth = k.pseudos.eq;
  1369. for (x in{radio: !0, checkbox: !0, file: !0, password: !0, image: !0}) k.pseudos[x] = function (e) {
  1370. return function (t) {
  1371. return "input" === t.nodeName.toLowerCase() && t.type === e
  1372. }
  1373. }(x);
  1374. for (x in{submit: !0, reset: !0}) k.pseudos[x] = function (e) {
  1375. return function (t) {
  1376. var n = t.nodeName.toLowerCase();
  1377. return ("input" === n || "button" === n) && t.type === e
  1378. }
  1379. }(x);
  1380. c.prototype = k.filters = k.pseudos, k.setFilters = new c, C = n.compile = function (e, t) {
  1381. var n, r = [], o = [], i = H[e + " "];
  1382. if (!i) {
  1383. for (t || (t = u(e)), n = t.length; n--;) (i = m(t[n]))[F] ? r.push(i) : o.push(i);
  1384. i = H(e, v(o, r))
  1385. }
  1386. return i
  1387. }, w.sortStable = F.split("").sort(z).join("") === F, w.detectDuplicates = V, N(), w.sortDetached = i(function (e) {
  1388. return 1 & e.compareDocumentPosition(P.createElement("div"))
  1389. }), i(function (e) {
  1390. return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href")
  1391. }) || a("type|href|height|width", function (e, n, r) {
  1392. return r ? t : e.getAttribute(n, "type" === n.toLowerCase() ? 1 : 2)
  1393. }), w.attributes && i(function (e) {
  1394. return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value")
  1395. }) || a("value", function (e, n, r) {
  1396. return r || "input" !== e.nodeName.toLowerCase() ? t : e.defaultValue
  1397. }), i(function (e) {
  1398. return null == e.getAttribute("disabled")
  1399. }) || a(te, function (e, n, r) {
  1400. var o;
  1401. return r ? t : (o = e.getAttributeNode(n)) && o.specified ? o.value : !0 === e[n] ? n.toLowerCase() : null
  1402. }), ce.find = n, ce.expr = n.selectors, ce.expr[":"] = ce.expr.pseudos, ce.unique = n.uniqueSort, ce.text = n.getText, ce.isXMLDoc = n.isXML, ce.contains = n.contains
  1403. }(e);
  1404. var Te = {};
  1405. ce.Callbacks = function (e) {
  1406. var n, o, i, a, s, l, c = [], u = !(e = "string" == typeof e ? Te[e] || r(e) : ce.extend({}, e)).once && [],
  1407. f = function (t) {
  1408. for (o = e.memory && t, i = !0, s = l || 0, l = 0, a = c.length, n = !0; c && a > s; s++) if (!1 === c[s].apply(t[0], t[1]) && e.stopOnFalse) {
  1409. o = !1;
  1410. break
  1411. }
  1412. n = !1, c && (u ? u.length && f(u.shift()) : o ? c = [] : d.disable())
  1413. }, d = {
  1414. add: function () {
  1415. if (c) {
  1416. var t = c.length;
  1417. (function t(n) {
  1418. ce.each(n, function (n, r) {
  1419. var o = ce.type(r);
  1420. "function" === o ? e.unique && d.has(r) || c.push(r) : r && r.length && "string" !== o && t(r)
  1421. })
  1422. })(arguments), n ? a = c.length : o && (l = t, f(o))
  1423. }
  1424. return this
  1425. }, remove: function () {
  1426. return c && ce.each(arguments, function (e, t) {
  1427. for (var r; (r = ce.inArray(t, c, r)) > -1;) c.splice(r, 1), n && (a >= r && a--, s >= r && s--)
  1428. }), this
  1429. }, has: function (e) {
  1430. return e ? ce.inArray(e, c) > -1 : !(!c || !c.length)
  1431. }, empty: function () {
  1432. return c = [], a = 0, this
  1433. }, disable: function () {
  1434. return c = u = o = t, this
  1435. }, disabled: function () {
  1436. return !c
  1437. }, lock: function () {
  1438. return u = t, o || d.disable(), this
  1439. }, locked: function () {
  1440. return !u
  1441. }, fireWith: function (e, t) {
  1442. return !c || i && !u || (t = t || [], t = [e, t.slice ? t.slice() : t], n ? u.push(t) : f(t)), this
  1443. }, fire: function () {
  1444. return d.fireWith(this, arguments), this
  1445. }, fired: function () {
  1446. return !!i
  1447. }
  1448. };
  1449. return d
  1450. }, ce.extend({
  1451. Deferred: function (e) {
  1452. var t = [["resolve", "done", ce.Callbacks("once memory"), "resolved"], ["reject", "fail", ce.Callbacks("once memory"), "rejected"], ["notify", "progress", ce.Callbacks("memory")]],
  1453. n = "pending", r = {
  1454. state: function () {
  1455. return n
  1456. }, always: function () {
  1457. return o.done(arguments).fail(arguments), this
  1458. }, then: function () {
  1459. var e = arguments;
  1460. return ce.Deferred(function (n) {
  1461. ce.each(t, function (t, i) {
  1462. var a = i[0], s = ce.isFunction(e[t]) && e[t];
  1463. o[i[1]](function () {
  1464. var e = s && s.apply(this, arguments);
  1465. e && ce.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[a + "With"](this === r ? n.promise() : this, s ? [e] : arguments)
  1466. })
  1467. }), e = null
  1468. }).promise()
  1469. }, promise: function (e) {
  1470. return null != e ? ce.extend(e, r) : r
  1471. }
  1472. }, o = {};
  1473. return r.pipe = r.then, ce.each(t, function (e, i) {
  1474. var a = i[2], s = i[3];
  1475. r[i[1]] = a.add, s && a.add(function () {
  1476. n = s
  1477. }, t[1 ^ e][2].disable, t[2][2].lock), o[i[0]] = function () {
  1478. return o[i[0] + "With"](this === o ? r : this, arguments), this
  1479. }, o[i[0] + "With"] = a.fireWith
  1480. }), r.promise(o), e && e.call(o, o), o
  1481. }, when: function (e) {
  1482. var t, n, r, o = 0, i = oe.call(arguments), a = i.length, s = 1 !== a || e && ce.isFunction(e.promise) ? a : 0,
  1483. l = 1 === s ? e : ce.Deferred(), c = function (e, n, r) {
  1484. return function (o) {
  1485. n[e] = this, r[e] = arguments.length > 1 ? oe.call(arguments) : o, r === t ? l.notifyWith(n, r) : --s || l.resolveWith(n, r)
  1486. }
  1487. };
  1488. if (a > 1) for (t = Array(a), n = Array(a), r = Array(a); a > o; o++) i[o] && ce.isFunction(i[o].promise) ? i[o].promise().done(c(o, r, i)).fail(l.reject).progress(c(o, n, t)) : --s;
  1489. return s || l.resolveWith(r, i), l.promise()
  1490. }
  1491. }), ce.support = function (t) {
  1492. var n, r, o, i, a, s, l, c, u, f = X.createElement("div");
  1493. if (f.setAttribute("className", "t"), f.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", n = f.getElementsByTagName("*") || [], !(r = f.getElementsByTagName("a")[0]) || !r.style || !n.length) return t;
  1494. s = (i = X.createElement("select")).appendChild(X.createElement("option")), o = f.getElementsByTagName("input")[0], r.style.cssText = "top:1px;float:left;opacity:.5", t.getSetAttribute = "t" !== f.className, t.leadingWhitespace = 3 === f.firstChild.nodeType, t.tbody = !f.getElementsByTagName("tbody").length, t.htmlSerialize = !!f.getElementsByTagName("link").length, t.style = /top/.test(r.getAttribute("style")), t.hrefNormalized = "/a" === r.getAttribute("href"), t.opacity = /^0.5/.test(r.style.opacity), t.cssFloat = !!r.style.cssFloat, t.checkOn = !!o.value, t.optSelected = s.selected, t.enctype = !!X.createElement("form").enctype, t.html5Clone = "<:nav></:nav>" !== X.createElement("nav").cloneNode(!0).outerHTML, t.inlineBlockNeedsLayout = !1, t.shrinkWrapBlocks = !1, t.pixelPosition = !1, t.deleteExpando = !0, t.noCloneEvent = !0, t.reliableMarginRight = !0, t.boxSizingReliable = !0, o.checked = !0, t.noCloneChecked = o.cloneNode(!0).checked, i.disabled = !0, t.optDisabled = !s.disabled;
  1495. try {
  1496. delete f.test
  1497. } catch (e) {
  1498. t.deleteExpando = !1
  1499. }
  1500. (o = X.createElement("input")).setAttribute("value", ""), t.input = "" === o.getAttribute("value"), o.value = "t", o.setAttribute("type", "radio"), t.radioValue = "t" === o.value, o.setAttribute("checked", "t"), o.setAttribute("name", "t"), (a = X.createDocumentFragment()).appendChild(o), t.appendChecked = o.checked, t.checkClone = a.cloneNode(!0).cloneNode(!0).lastChild.checked, f.attachEvent && (f.attachEvent("onclick", function () {
  1501. t.noCloneEvent = !1
  1502. }), f.cloneNode(!0).click());
  1503. for (u in{
  1504. submit: !0,
  1505. change: !0,
  1506. focusin: !0
  1507. }) f.setAttribute(l = "on" + u, "t"), t[u + "Bubbles"] = l in e || !1 === f.attributes[l].expando;
  1508. f.style.backgroundClip = "content-box", f.cloneNode(!0).style.backgroundClip = "", t.clearCloneStyle = "content-box" === f.style.backgroundClip;
  1509. for (u in ce(t)) break;
  1510. return t.ownLast = "0" !== u, ce(function () {
  1511. var n, r, o,
  1512. i = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
  1513. a = X.getElementsByTagName("body")[0];
  1514. a && (n = X.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", a.appendChild(n).appendChild(f), f.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", o = f.getElementsByTagName("td"), o[0].style.cssText = "padding:0;margin:0;border:0;display:none", c = 0 === o[0].offsetHeight, o[0].style.display = "", o[1].style.display = "none", t.reliableHiddenOffsets = c && 0 === o[0].offsetHeight, f.innerHTML = "", f.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", ce.swap(a, null != a.style.zoom ? {zoom: 1} : {}, function () {
  1515. t.boxSizing = 4 === f.offsetWidth
  1516. }), e.getComputedStyle && (t.pixelPosition = "1%" !== (e.getComputedStyle(f, null) || {}).top, t.boxSizingReliable = "4px" === (e.getComputedStyle(f, null) || {width: "4px"}).width, r = f.appendChild(X.createElement("div")), r.style.cssText = f.style.cssText = i, r.style.marginRight = r.style.width = "0", f.style.width = "1px", t.reliableMarginRight = !parseFloat((e.getComputedStyle(r, null) || {}).marginRight)), typeof f.style.zoom !== G && (f.innerHTML = "", f.style.cssText = i + "width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = 3 === f.offsetWidth, f.style.display = "block", f.innerHTML = "<div></div>", f.firstChild.style.width = "5px", t.shrinkWrapBlocks = 3 !== f.offsetWidth, t.inlineBlockNeedsLayout && (a.style.zoom = 1)), a.removeChild(n), n = f = o = r = null)
  1517. }), n = i = a = s = r = o = null, t
  1518. }({});
  1519. var Se = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, Ce = /([A-Z])/g;
  1520. ce.extend({
  1521. cache: {},
  1522. noData: {applet: !0, embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},
  1523. hasData: function (e) {
  1524. return !!(e = e.nodeType ? ce.cache[e[ce.expando]] : e[ce.expando]) && !s(e)
  1525. },
  1526. data: function (e, t, n) {
  1527. return o(e, t, n)
  1528. },
  1529. removeData: function (e, t) {
  1530. return i(e, t)
  1531. },
  1532. _data: function (e, t, n) {
  1533. return o(e, t, n, !0)
  1534. },
  1535. _removeData: function (e, t) {
  1536. return i(e, t, !0)
  1537. },
  1538. acceptData: function (e) {
  1539. if (e.nodeType && 1 !== e.nodeType && 9 !== e.nodeType) return !1;
  1540. var t = e.nodeName && ce.noData[e.nodeName.toLowerCase()];
  1541. return !t || !0 !== t && e.getAttribute("classid") === t
  1542. }
  1543. }), ce.fn.extend({
  1544. data: function (e, n) {
  1545. var r, o, i = null, s = 0, l = this[0];
  1546. if (e === t) {
  1547. if (this.length && (i = ce.data(l), 1 === l.nodeType && !ce._data(l, "parsedAttrs"))) {
  1548. for (r = l.attributes; r.length > s; s++) 0 === (o = r[s].name).indexOf("data-") && (o = ce.camelCase(o.slice(5)), a(l, o, i[o]));
  1549. ce._data(l, "parsedAttrs", !0)
  1550. }
  1551. return i
  1552. }
  1553. return "object" == typeof e ? this.each(function () {
  1554. ce.data(this, e)
  1555. }) : arguments.length > 1 ? this.each(function () {
  1556. ce.data(this, e, n)
  1557. }) : l ? a(l, e, ce.data(l, e)) : null
  1558. }, removeData: function (e) {
  1559. return this.each(function () {
  1560. ce.removeData(this, e)
  1561. })
  1562. }
  1563. }), ce.extend({
  1564. queue: function (e, n, r) {
  1565. var o;
  1566. return e ? (n = (n || "fx") + "queue", o = ce._data(e, n), r && (!o || ce.isArray(r) ? o = ce._data(e, n, ce.makeArray(r)) : o.push(r)), o || []) : t
  1567. }, dequeue: function (e, t) {
  1568. t = t || "fx";
  1569. var n = ce.queue(e, t), r = n.length, o = n.shift(), i = ce._queueHooks(e, t);
  1570. "inprogress" === o && (o = n.shift(), r--), o && ("fx" === t && n.unshift("inprogress"), delete i.stop, o.call(e, function () {
  1571. ce.dequeue(e, t)
  1572. }, i)), !r && i && i.empty.fire()
  1573. }, _queueHooks: function (e, t) {
  1574. var n = t + "queueHooks";
  1575. return ce._data(e, n) || ce._data(e, n, {
  1576. empty: ce.Callbacks("once memory").add(function () {
  1577. ce._removeData(e, t + "queue"), ce._removeData(e, n)
  1578. })
  1579. })
  1580. }
  1581. }), ce.fn.extend({
  1582. queue: function (e, n) {
  1583. var r = 2;
  1584. return "string" != typeof e && (n = e, e = "fx", r--), r > arguments.length ? ce.queue(this[0], e) : n === t ? this : this.each(function () {
  1585. var t = ce.queue(this, e, n);
  1586. ce._queueHooks(this, e), "fx" === e && "inprogress" !== t[0] && ce.dequeue(this, e)
  1587. })
  1588. }, dequeue: function (e) {
  1589. return this.each(function () {
  1590. ce.dequeue(this, e)
  1591. })
  1592. }, delay: function (e, t) {
  1593. return e = ce.fx ? ce.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function (t, n) {
  1594. var r = setTimeout(t, e);
  1595. n.stop = function () {
  1596. clearTimeout(r)
  1597. }
  1598. })
  1599. }, clearQueue: function (e) {
  1600. return this.queue(e || "fx", [])
  1601. }, promise: function (e, n) {
  1602. var r, o = 1, i = ce.Deferred(), a = this, s = this.length, l = function () {
  1603. --o || i.resolveWith(a, [a])
  1604. };
  1605. for ("string" != typeof e && (n = e, e = t), e = e || "fx"; s--;) (r = ce._data(a[s], e + "queueHooks")) && r.empty && (o++, r.empty.add(l));
  1606. return l(), i.promise(n)
  1607. }
  1608. });
  1609. var Ee, Ae, Ne = /[\t\r\n\f]/g, Pe = /\r/g, Oe = /^(?:input|select|textarea|button|object)$/i, De = /^(?:a|area)$/i,
  1610. Ie = /^(?:checked|selected)$/i, Me = ce.support.getSetAttribute, _e = ce.support.input;
  1611. ce.fn.extend({
  1612. attr: function (e, t) {
  1613. return ce.access(this, ce.attr, e, t, arguments.length > 1)
  1614. }, removeAttr: function (e) {
  1615. return this.each(function () {
  1616. ce.removeAttr(this, e)
  1617. })
  1618. }, prop: function (e, t) {
  1619. return ce.access(this, ce.prop, e, t, arguments.length > 1)
  1620. }, removeProp: function (e) {
  1621. return e = ce.propFix[e] || e, this.each(function () {
  1622. try {
  1623. this[e] = t, delete this[e]
  1624. } catch (e) {
  1625. }
  1626. })
  1627. }, addClass: function (e) {
  1628. var t, n, r, o, i, a = 0, s = this.length, l = "string" == typeof e && e;
  1629. if (ce.isFunction(e)) return this.each(function (t) {
  1630. ce(this).addClass(e.call(this, t, this.className))
  1631. });
  1632. if (l) for (t = (e || "").match(fe) || []; s > a; a++) if (n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(Ne, " ") : " ")) {
  1633. for (i = 0; o = t[i++];) 0 > r.indexOf(" " + o + " ") && (r += o + " ");
  1634. n.className = ce.trim(r)
  1635. }
  1636. return this
  1637. }, removeClass: function (e) {
  1638. var t, n, r, o, i, a = 0, s = this.length, l = 0 === arguments.length || "string" == typeof e && e;
  1639. if (ce.isFunction(e)) return this.each(function (t) {
  1640. ce(this).removeClass(e.call(this, t, this.className))
  1641. });
  1642. if (l) for (t = (e || "").match(fe) || []; s > a; a++) if (n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(Ne, " ") : "")) {
  1643. for (i = 0; o = t[i++];) for (; r.indexOf(" " + o + " ") >= 0;) r = r.replace(" " + o + " ", " ");
  1644. n.className = e ? ce.trim(r) : ""
  1645. }
  1646. return this
  1647. }, toggleClass: function (e, t) {
  1648. var n = typeof e;
  1649. return "boolean" == typeof t && "string" === n ? t ? this.addClass(e) : this.removeClass(e) : ce.isFunction(e) ? this.each(function (n) {
  1650. ce(this).toggleClass(e.call(this, n, this.className, t), t)
  1651. }) : this.each(function () {
  1652. if ("string" === n) for (var t, r = 0, o = ce(this), i = e.match(fe) || []; t = i[r++];) o.hasClass(t) ? o.removeClass(t) : o.addClass(t); else (n === G || "boolean" === n) && (this.className && ce._data(this, "__className__", this.className), this.className = this.className || !1 === e ? "" : ce._data(this, "__className__") || "")
  1653. })
  1654. }, hasClass: function (e) {
  1655. for (var t = " " + e + " ", n = 0, r = this.length; r > n; n++) if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(Ne, " ").indexOf(t) >= 0) return !0;
  1656. return !1
  1657. }, val: function (e) {
  1658. var n, r, o, i = this[0];
  1659. return arguments.length ? (o = ce.isFunction(e), this.each(function (n) {
  1660. var i;
  1661. 1 === this.nodeType && (null == (i = o ? e.call(this, n, ce(this).val()) : e) ? i = "" : "number" == typeof i ? i += "" : ce.isArray(i) && (i = ce.map(i, function (e) {
  1662. return null == e ? "" : e + ""
  1663. })), (r = ce.valHooks[this.type] || ce.valHooks[this.nodeName.toLowerCase()]) && "set" in r && r.set(this, i, "value") !== t || (this.value = i))
  1664. })) : i ? (r = ce.valHooks[i.type] || ce.valHooks[i.nodeName.toLowerCase()]) && "get" in r && (n = r.get(i, "value")) !== t ? n : "string" == typeof(n = i.value) ? n.replace(Pe, "") : null == n ? "" : n : void 0
  1665. }
  1666. }), ce.extend({
  1667. valHooks: {
  1668. option: {
  1669. get: function (e) {
  1670. var t = ce.find.attr(e, "value");
  1671. return null != t ? t : e.text
  1672. }
  1673. }, select: {
  1674. get: function (e) {
  1675. for (var t, n, r = e.options, o = e.selectedIndex, i = "select-one" === e.type || 0 > o, a = i ? null : [], s = i ? o + 1 : r.length, l = 0 > o ? s : i ? o : 0; s > l; l++) if (!(!(n = r[l]).selected && l !== o || (ce.support.optDisabled ? n.disabled : null !== n.getAttribute("disabled")) || n.parentNode.disabled && ce.nodeName(n.parentNode, "optgroup"))) {
  1676. if (t = ce(n).val(), i) return t;
  1677. a.push(t)
  1678. }
  1679. return a
  1680. }, set: function (e, t) {
  1681. for (var n, r, o = e.options, i = ce.makeArray(t), a = o.length; a--;) r = o[a], (r.selected = ce.inArray(ce(r).val(), i) >= 0) && (n = !0);
  1682. return n || (e.selectedIndex = -1), i
  1683. }
  1684. }
  1685. }, attr: function (e, n, r) {
  1686. var o, i, a = e.nodeType;
  1687. if (e && 3 !== a && 8 !== a && 2 !== a) return typeof e.getAttribute === G ? ce.prop(e, n, r) : (1 === a && ce.isXMLDoc(e) || (n = n.toLowerCase(), o = ce.attrHooks[n] || (ce.expr.match.bool.test(n) ? Ae : Ee)), r === t ? o && "get" in o && null !== (i = o.get(e, n)) ? i : null == (i = ce.find.attr(e, n)) ? t : i : null !== r ? o && "set" in o && (i = o.set(e, r, n)) !== t ? i : (e.setAttribute(n, r + ""), r) : (ce.removeAttr(e, n), t))
  1688. }, removeAttr: function (e, t) {
  1689. var n, r, o = 0, i = t && t.match(fe);
  1690. if (i && 1 === e.nodeType) for (; n = i[o++];) r = ce.propFix[n] || n, ce.expr.match.bool.test(n) ? _e && Me || !Ie.test(n) ? e[r] = !1 : e[ce.camelCase("default-" + n)] = e[r] = !1 : ce.attr(e, n, ""), e.removeAttribute(Me ? n : r)
  1691. }, attrHooks: {
  1692. type: {
  1693. set: function (e, t) {
  1694. if (!ce.support.radioValue && "radio" === t && ce.nodeName(e, "input")) {
  1695. var n = e.value;
  1696. return e.setAttribute("type", t), n && (e.value = n), t
  1697. }
  1698. }
  1699. }
  1700. }, propFix: {for: "htmlFor", class: "className"}, prop: function (e, n, r) {
  1701. var o, i, a = e.nodeType;
  1702. if (e && 3 !== a && 8 !== a && 2 !== a) return (1 !== a || !ce.isXMLDoc(e)) && (n = ce.propFix[n] || n, i = ce.propHooks[n]), r !== t ? i && "set" in i && (o = i.set(e, r, n)) !== t ? o : e[n] = r : i && "get" in i && null !== (o = i.get(e, n)) ? o : e[n]
  1703. }, propHooks: {
  1704. tabIndex: {
  1705. get: function (e) {
  1706. var t = ce.find.attr(e, "tabindex");
  1707. return t ? parseInt(t, 10) : Oe.test(e.nodeName) || De.test(e.nodeName) && e.href ? 0 : -1
  1708. }
  1709. }
  1710. }
  1711. }), Ae = {
  1712. set: function (e, t, n) {
  1713. return !1 === t ? ce.removeAttr(e, n) : _e && Me || !Ie.test(n) ? e.setAttribute(!Me && ce.propFix[n] || n, n) : e[ce.camelCase("default-" + n)] = e[n] = !0, n
  1714. }
  1715. }, ce.each(ce.expr.match.bool.source.match(/\w+/g), function (e, n) {
  1716. var r = ce.expr.attrHandle[n] || ce.find.attr;
  1717. ce.expr.attrHandle[n] = _e && Me || !Ie.test(n) ? function (e, n, o) {
  1718. var i = ce.expr.attrHandle[n], a = o ? t : (ce.expr.attrHandle[n] = t) != r(e, n, o) ? n.toLowerCase() : null;
  1719. return ce.expr.attrHandle[n] = i, a
  1720. } : function (e, n, r) {
  1721. return r ? t : e[ce.camelCase("default-" + n)] ? n.toLowerCase() : null
  1722. }
  1723. }), _e && Me || (ce.attrHooks.value = {
  1724. set: function (e, n, r) {
  1725. return ce.nodeName(e, "input") ? (e.defaultValue = n, t) : Ee && Ee.set(e, n, r)
  1726. }
  1727. }), Me || (Ee = {
  1728. set: function (e, n, r) {
  1729. var o = e.getAttributeNode(r);
  1730. return o || e.setAttributeNode(o = e.ownerDocument.createAttribute(r)), o.value = n += "", "value" === r || n === e.getAttribute(r) ? n : t
  1731. }
  1732. }, ce.expr.attrHandle.id = ce.expr.attrHandle.name = ce.expr.attrHandle.coords = function (e, n, r) {
  1733. var o;
  1734. return r ? t : (o = e.getAttributeNode(n)) && "" !== o.value ? o.value : null
  1735. }, ce.valHooks.button = {
  1736. get: function (e, n) {
  1737. var r = e.getAttributeNode(n);
  1738. return r && r.specified ? r.value : t
  1739. }, set: Ee.set
  1740. }, ce.attrHooks.contenteditable = {
  1741. set: function (e, t, n) {
  1742. Ee.set(e, "" !== t && t, n)
  1743. }
  1744. }, ce.each(["width", "height"], function (e, n) {
  1745. ce.attrHooks[n] = {
  1746. set: function (e, r) {
  1747. return "" === r ? (e.setAttribute(n, "auto"), r) : t
  1748. }
  1749. }
  1750. })), ce.support.hrefNormalized || ce.each(["href", "src"], function (e, t) {
  1751. ce.propHooks[t] = {
  1752. get: function (e) {
  1753. return e.getAttribute(t, 4)
  1754. }
  1755. }
  1756. }), ce.support.style || (ce.attrHooks.style = {
  1757. get: function (e) {
  1758. return e.style.cssText || t
  1759. }, set: function (e, t) {
  1760. return e.style.cssText = t + ""
  1761. }
  1762. }), ce.support.optSelected || (ce.propHooks.selected = {
  1763. get: function (e) {
  1764. var t = e.parentNode;
  1765. return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null
  1766. }
  1767. }), ce.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () {
  1768. ce.propFix[this.toLowerCase()] = this
  1769. }), ce.support.enctype || (ce.propFix.enctype = "encoding"), ce.each(["radio", "checkbox"], function () {
  1770. ce.valHooks[this] = {
  1771. set: function (e, n) {
  1772. return ce.isArray(n) ? e.checked = ce.inArray(ce(e).val(), n) >= 0 : t
  1773. }
  1774. }, ce.support.checkOn || (ce.valHooks[this].get = function (e) {
  1775. return null === e.getAttribute("value") ? "on" : e.value
  1776. })
  1777. });
  1778. var Le = /^(?:input|select|textarea)$/i, Fe = /^key/, Be = /^(?:mouse|contextmenu)|click/,
  1779. Re = /^(?:focusinfocus|focusoutblur)$/, je = /^([^.]*)(?:\.(.+)|)$/;
  1780. ce.event = {
  1781. global: {},
  1782. add: function (e, n, r, o, i) {
  1783. var a, s, l, c, u, f, d, p, h, g, m, v = ce._data(e);
  1784. if (v) {
  1785. for (r.handler && (c = r, r = c.handler, i = c.selector), r.guid || (r.guid = ce.guid++), (s = v.events) || (s = v.events = {}), (f = v.handle) || (f = v.handle = function (e) {
  1786. return typeof ce === G || e && ce.event.triggered === e.type ? t : ce.event.dispatch.apply(f.elem, arguments)
  1787. }, f.elem = e), l = (n = (n || "").match(fe) || [""]).length; l--;) a = je.exec(n[l]) || [], h = m = a[1], g = (a[2] || "").split(".").sort(), h && (u = ce.event.special[h] || {}, h = (i ? u.delegateType : u.bindType) || h, u = ce.event.special[h] || {}, d = ce.extend({
  1788. type: h,
  1789. origType: m,
  1790. data: o,
  1791. handler: r,
  1792. guid: r.guid,
  1793. selector: i,
  1794. needsContext: i && ce.expr.match.needsContext.test(i),
  1795. namespace: g.join(".")
  1796. }, c), (p = s[h]) || (p = s[h] = [], p.delegateCount = 0, u.setup && !1 !== u.setup.call(e, o, g, f) || (e.addEventListener ? e.addEventListener(h, f, !1) : e.attachEvent && e.attachEvent("on" + h, f))), u.add && (u.add.call(e, d), d.handler.guid || (d.handler.guid = r.guid)), i ? p.splice(p.delegateCount++, 0, d) : p.push(d), ce.event.global[h] = !0);
  1797. e = null
  1798. }
  1799. },
  1800. remove: function (e, t, n, r, o) {
  1801. var i, a, s, l, c, u, f, d, p, h, g, m = ce.hasData(e) && ce._data(e);
  1802. if (m && (u = m.events)) {
  1803. for (c = (t = (t || "").match(fe) || [""]).length; c--;) if (s = je.exec(t[c]) || [], p = g = s[1], h = (s[2] || "").split(".").sort(), p) {
  1804. for (f = ce.event.special[p] || {}, d = u[p = (r ? f.delegateType : f.bindType) || p] || [], s = s[2] && RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), l = i = d.length; i--;) a = d[i], !o && g !== a.origType || n && n.guid !== a.guid || s && !s.test(a.namespace) || r && r !== a.selector && ("**" !== r || !a.selector) || (d.splice(i, 1), a.selector && d.delegateCount--, f.remove && f.remove.call(e, a));
  1805. l && !d.length && (f.teardown && !1 !== f.teardown.call(e, h, m.handle) || ce.removeEvent(e, p, m.handle), delete u[p])
  1806. } else for (p in u) ce.event.remove(e, p + t[c], n, r, !0);
  1807. ce.isEmptyObject(u) && (delete m.handle, ce._removeData(e, "events"))
  1808. }
  1809. },
  1810. trigger: function (n, r, o, i) {
  1811. var a, s, l, c, u, f, d, p = [o || X], h = se.call(n, "type") ? n.type : n,
  1812. g = se.call(n, "namespace") ? n.namespace.split(".") : [];
  1813. if (l = f = o = o || X, 3 !== o.nodeType && 8 !== o.nodeType && !Re.test(h + ce.event.triggered) && (h.indexOf(".") >= 0 && (g = h.split("."), h = g.shift(), g.sort()), s = 0 > h.indexOf(":") && "on" + h, n = n[ce.expando] ? n : new ce.Event(h, "object" == typeof n && n), n.isTrigger = i ? 2 : 3, n.namespace = g.join("."), n.namespace_re = n.namespace ? RegExp("(^|\\.)" + g.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, n.result = t, n.target || (n.target = o), r = null == r ? [n] : ce.makeArray(r, [n]), u = ce.event.special[h] || {}, i || !u.trigger || !1 !== u.trigger.apply(o, r))) {
  1814. if (!i && !u.noBubble && !ce.isWindow(o)) {
  1815. for (c = u.delegateType || h, Re.test(c + h) || (l = l.parentNode); l; l = l.parentNode) p.push(l), f = l;
  1816. f === (o.ownerDocument || X) && p.push(f.defaultView || f.parentWindow || e)
  1817. }
  1818. for (d = 0; (l = p[d++]) && !n.isPropagationStopped();) n.type = d > 1 ? c : u.bindType || h, (a = (ce._data(l, "events") || {})[n.type] && ce._data(l, "handle")) && a.apply(l, r), (a = s && l[s]) && ce.acceptData(l) && a.apply && !1 === a.apply(l, r) && n.preventDefault();
  1819. if (n.type = h, !i && !n.isDefaultPrevented() && (!u._default || !1 === u._default.apply(p.pop(), r)) && ce.acceptData(o) && s && o[h] && !ce.isWindow(o)) {
  1820. (f = o[s]) && (o[s] = null), ce.event.triggered = h;
  1821. try {
  1822. o[h]()
  1823. } catch (e) {
  1824. }
  1825. ce.event.triggered = t, f && (o[s] = f)
  1826. }
  1827. return n.result
  1828. }
  1829. },
  1830. dispatch: function (e) {
  1831. e = ce.event.fix(e);
  1832. var n, r, o, i, a, s = [], l = oe.call(arguments), c = (ce._data(this, "events") || {})[e.type] || [],
  1833. u = ce.event.special[e.type] || {};
  1834. if (l[0] = e, e.delegateTarget = this, !u.preDispatch || !1 !== u.preDispatch.call(this, e)) {
  1835. for (s = ce.event.handlers.call(this, e, c), n = 0; (i = s[n++]) && !e.isPropagationStopped();) for (e.currentTarget = i.elem, a = 0; (o = i.handlers[a++]) && !e.isImmediatePropagationStopped();) (!e.namespace_re || e.namespace_re.test(o.namespace)) && (e.handleObj = o, e.data = o.data, (r = ((ce.event.special[o.origType] || {}).handle || o.handler).apply(i.elem, l)) !== t && !1 === (e.result = r) && (e.preventDefault(), e.stopPropagation()));
  1836. return u.postDispatch && u.postDispatch.call(this, e), e.result
  1837. }
  1838. },
  1839. handlers: function (e, n) {
  1840. var r, o, i, a, s = [], l = n.delegateCount, c = e.target;
  1841. if (l && c.nodeType && (!e.button || "click" !== e.type)) for (; c != this; c = c.parentNode || this) if (1 === c.nodeType && (!0 !== c.disabled || "click" !== e.type)) {
  1842. for (i = [], a = 0; l > a; a++) o = n[a], r = o.selector + " ", i[r] === t && (i[r] = o.needsContext ? ce(r, this).index(c) >= 0 : ce.find(r, this, null, [c]).length), i[r] && i.push(o);
  1843. i.length && s.push({elem: c, handlers: i})
  1844. }
  1845. return n.length > l && s.push({elem: this, handlers: n.slice(l)}), s
  1846. },
  1847. fix: function (e) {
  1848. if (e[ce.expando]) return e;
  1849. var t, n, r, o = e.type, i = e, a = this.fixHooks[o];
  1850. for (a || (this.fixHooks[o] = a = Be.test(o) ? this.mouseHooks : Fe.test(o) ? this.keyHooks : {}), r = a.props ? this.props.concat(a.props) : this.props, e = new ce.Event(i), t = r.length; t--;) n = r[t], e[n] = i[n];
  1851. return e.target || (e.target = i.srcElement || X), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey = !!e.metaKey, a.filter ? a.filter(e, i) : e
  1852. },
  1853. props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  1854. fixHooks: {},
  1855. keyHooks: {
  1856. props: "char charCode key keyCode".split(" "), filter: function (e, t) {
  1857. return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e
  1858. }
  1859. },
  1860. mouseHooks: {
  1861. props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  1862. filter: function (e, n) {
  1863. var r, o, i, a = n.button, s = n.fromElement;
  1864. return null == e.pageX && null != n.clientX && (o = e.target.ownerDocument || X, i = o.documentElement, r = o.body, e.pageX = n.clientX + (i && i.scrollLeft || r && r.scrollLeft || 0) - (i && i.clientLeft || r && r.clientLeft || 0), e.pageY = n.clientY + (i && i.scrollTop || r && r.scrollTop || 0) - (i && i.clientTop || r && r.clientTop || 0)), !e.relatedTarget && s && (e.relatedTarget = s === e.target ? n.toElement : s), e.which || a === t || (e.which = 1 & a ? 1 : 2 & a ? 3 : 4 & a ? 2 : 0), e
  1865. }
  1866. },
  1867. special: {
  1868. load: {noBubble: !0}, focus: {
  1869. trigger: function () {
  1870. if (this !== u() && this.focus) try {
  1871. return this.focus(), !1
  1872. } catch (e) {
  1873. }
  1874. }, delegateType: "focusin"
  1875. }, blur: {
  1876. trigger: function () {
  1877. return this === u() && this.blur ? (this.blur(), !1) : t
  1878. }, delegateType: "focusout"
  1879. }, click: {
  1880. trigger: function () {
  1881. return ce.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : t
  1882. }, _default: function (e) {
  1883. return ce.nodeName(e.target, "a")
  1884. }
  1885. }, beforeunload: {
  1886. postDispatch: function (e) {
  1887. e.result !== t && (e.originalEvent.returnValue = e.result)
  1888. }
  1889. }
  1890. },
  1891. simulate: function (e, t, n, r) {
  1892. var o = ce.extend(new ce.Event, n, {type: e, isSimulated: !0, originalEvent: {}});
  1893. r ? ce.event.trigger(o, null, t) : ce.event.dispatch.call(t, o), o.isDefaultPrevented() && n.preventDefault()
  1894. }
  1895. }, ce.removeEvent = X.removeEventListener ? function (e, t, n) {
  1896. e.removeEventListener && e.removeEventListener(t, n, !1)
  1897. } : function (e, t, n) {
  1898. var r = "on" + t;
  1899. e.detachEvent && (typeof e[r] === G && (e[r] = null), e.detachEvent(r, n))
  1900. }, ce.Event = function (e, n) {
  1901. return this instanceof ce.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || !1 === e.returnValue || e.getPreventDefault && e.getPreventDefault() ? l : c) : this.type = e, n && ce.extend(this, n), this.timeStamp = e && e.timeStamp || ce.now(), this[ce.expando] = !0, t) : new ce.Event(e, n)
  1902. }, ce.Event.prototype = {
  1903. isDefaultPrevented: c,
  1904. isPropagationStopped: c,
  1905. isImmediatePropagationStopped: c,
  1906. preventDefault: function () {
  1907. var e = this.originalEvent;
  1908. this.isDefaultPrevented = l, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1)
  1909. },
  1910. stopPropagation: function () {
  1911. var e = this.originalEvent;
  1912. this.isPropagationStopped = l, e && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0)
  1913. },
  1914. stopImmediatePropagation: function () {
  1915. this.isImmediatePropagationStopped = l, this.stopPropagation()
  1916. }
  1917. }, ce.each({mouseenter: "mouseover", mouseleave: "mouseout"}, function (e, t) {
  1918. ce.event.special[e] = {
  1919. delegateType: t, bindType: t, handle: function (e) {
  1920. var n, r = this, o = e.relatedTarget, i = e.handleObj;
  1921. return (!o || o !== r && !ce.contains(r, o)) && (e.type = i.origType, n = i.handler.apply(this, arguments), e.type = t), n
  1922. }
  1923. }
  1924. }), ce.support.submitBubbles || (ce.event.special.submit = {
  1925. setup: function () {
  1926. return !ce.nodeName(this, "form") && (ce.event.add(this, "click._submit keypress._submit", function (e) {
  1927. var n = e.target, r = ce.nodeName(n, "input") || ce.nodeName(n, "button") ? n.form : t;
  1928. r && !ce._data(r, "submitBubbles") && (ce.event.add(r, "submit._submit", function (e) {
  1929. e._submit_bubble = !0
  1930. }), ce._data(r, "submitBubbles", !0))
  1931. }), t)
  1932. }, postDispatch: function (e) {
  1933. e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && ce.event.simulate("submit", this.parentNode, e, !0))
  1934. }, teardown: function () {
  1935. return !ce.nodeName(this, "form") && (ce.event.remove(this, "._submit"), t)
  1936. }
  1937. }), ce.support.changeBubbles || (ce.event.special.change = {
  1938. setup: function () {
  1939. return Le.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (ce.event.add(this, "propertychange._change", function (e) {
  1940. "checked" === e.originalEvent.propertyName && (this._just_changed = !0)
  1941. }), ce.event.add(this, "click._change", function (e) {
  1942. this._just_changed && !e.isTrigger && (this._just_changed = !1), ce.event.simulate("change", this, e, !0)
  1943. })), !1) : (ce.event.add(this, "beforeactivate._change", function (e) {
  1944. var t = e.target;
  1945. Le.test(t.nodeName) && !ce._data(t, "changeBubbles") && (ce.event.add(t, "change._change", function (e) {
  1946. !this.parentNode || e.isSimulated || e.isTrigger || ce.event.simulate("change", this.parentNode, e, !0)
  1947. }), ce._data(t, "changeBubbles", !0))
  1948. }), t)
  1949. }, handle: function (e) {
  1950. var n = e.target;
  1951. return this !== n || e.isSimulated || e.isTrigger || "radio" !== n.type && "checkbox" !== n.type ? e.handleObj.handler.apply(this, arguments) : t
  1952. }, teardown: function () {
  1953. return ce.event.remove(this, "._change"), !Le.test(this.nodeName)
  1954. }
  1955. }), ce.support.focusinBubbles || ce.each({focus: "focusin", blur: "focusout"}, function (e, t) {
  1956. var n = 0, r = function (e) {
  1957. ce.event.simulate(t, e.target, ce.event.fix(e), !0)
  1958. };
  1959. ce.event.special[t] = {
  1960. setup: function () {
  1961. 0 == n++ && X.addEventListener(e, r, !0)
  1962. }, teardown: function () {
  1963. 0 == --n && X.removeEventListener(e, r, !0)
  1964. }
  1965. }
  1966. }), ce.fn.extend({
  1967. on: function (e, n, r, o, i) {
  1968. var a, s;
  1969. if ("object" == typeof e) {
  1970. "string" != typeof n && (r = r || n, n = t);
  1971. for (a in e) this.on(a, n, r, e[a], i);
  1972. return this
  1973. }
  1974. if (null == r && null == o ? (o = n, r = n = t) : null == o && ("string" == typeof n ? (o = r, r = t) : (o = r, r = n, n = t)), !1 === o) o = c; else if (!o) return this;
  1975. return 1 === i && (s = o, o = function (e) {
  1976. return ce().off(e), s.apply(this, arguments)
  1977. }, o.guid = s.guid || (s.guid = ce.guid++)), this.each(function () {
  1978. ce.event.add(this, e, o, r, n)
  1979. })
  1980. }, one: function (e, t, n, r) {
  1981. return this.on(e, t, n, r, 1)
  1982. }, off: function (e, n, r) {
  1983. var o, i;
  1984. if (e && e.preventDefault && e.handleObj) return o = e.handleObj, ce(e.delegateTarget).off(o.namespace ? o.origType + "." + o.namespace : o.origType, o.selector, o.handler), this;
  1985. if ("object" == typeof e) {
  1986. for (i in e) this.off(i, n, e[i]);
  1987. return this
  1988. }
  1989. return (!1 === n || "function" == typeof n) && (r = n, n = t), !1 === r && (r = c), this.each(function () {
  1990. ce.event.remove(this, e, r, n)
  1991. })
  1992. }, trigger: function (e, t) {
  1993. return this.each(function () {
  1994. ce.event.trigger(e, t, this)
  1995. })
  1996. }, triggerHandler: function (e, n) {
  1997. var r = this[0];
  1998. return r ? ce.event.trigger(e, n, r, !0) : t
  1999. }
  2000. });
  2001. var qe = /^.[^:#\[\.,]*$/, Ue = /^(?:parents|prev(?:Until|All))/, He = ce.expr.match.needsContext,
  2002. Ve = {children: !0, contents: !0, next: !0, prev: !0};
  2003. ce.fn.extend({
  2004. find: function (e) {
  2005. var t, n = [], r = this, o = r.length;
  2006. if ("string" != typeof e) return this.pushStack(ce(e).filter(function () {
  2007. for (t = 0; o > t; t++) if (ce.contains(r[t], this)) return !0
  2008. }));
  2009. for (t = 0; o > t; t++) ce.find(e, r[t], n);
  2010. return n = this.pushStack(o > 1 ? ce.unique(n) : n), n.selector = this.selector ? this.selector + " " + e : e, n
  2011. }, has: function (e) {
  2012. var t, n = ce(e, this), r = n.length;
  2013. return this.filter(function () {
  2014. for (t = 0; r > t; t++) if (ce.contains(this, n[t])) return !0
  2015. })
  2016. }, not: function (e) {
  2017. return this.pushStack(d(this, e || [], !0))
  2018. }, filter: function (e) {
  2019. return this.pushStack(d(this, e || [], !1))
  2020. }, is: function (e) {
  2021. return !!d(this, "string" == typeof e && He.test(e) ? ce(e) : e || [], !1).length
  2022. }, closest: function (e, t) {
  2023. for (var n, r = 0, o = this.length, i = [], a = He.test(e) || "string" != typeof e ? ce(e, t || this.context) : 0; o > r; r++) for (n = this[r]; n && n !== t; n = n.parentNode) if (11 > n.nodeType && (a ? a.index(n) > -1 : 1 === n.nodeType && ce.find.matchesSelector(n, e))) {
  2024. n = i.push(n);
  2025. break
  2026. }
  2027. return this.pushStack(i.length > 1 ? ce.unique(i) : i)
  2028. }, index: function (e) {
  2029. return e ? "string" == typeof e ? ce.inArray(this[0], ce(e)) : ce.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
  2030. }, add: function (e, t) {
  2031. var n = "string" == typeof e ? ce(e, t) : ce.makeArray(e && e.nodeType ? [e] : e), r = ce.merge(this.get(), n);
  2032. return this.pushStack(ce.unique(r))
  2033. }, addBack: function (e) {
  2034. return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
  2035. }
  2036. }), ce.each({
  2037. parent: function (e) {
  2038. var t = e.parentNode;
  2039. return t && 11 !== t.nodeType ? t : null
  2040. }, parents: function (e) {
  2041. return ce.dir(e, "parentNode")
  2042. }, parentsUntil: function (e, t, n) {
  2043. return ce.dir(e, "parentNode", n)
  2044. }, next: function (e) {
  2045. return f(e, "nextSibling")
  2046. }, prev: function (e) {
  2047. return f(e, "previousSibling")
  2048. }, nextAll: function (e) {
  2049. return ce.dir(e, "nextSibling")
  2050. }, prevAll: function (e) {
  2051. return ce.dir(e, "previousSibling")
  2052. }, nextUntil: function (e, t, n) {
  2053. return ce.dir(e, "nextSibling", n)
  2054. }, prevUntil: function (e, t, n) {
  2055. return ce.dir(e, "previousSibling", n)
  2056. }, siblings: function (e) {
  2057. return ce.sibling((e.parentNode || {}).firstChild, e)
  2058. }, children: function (e) {
  2059. return ce.sibling(e.firstChild)
  2060. }, contents: function (e) {
  2061. return ce.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : ce.merge([], e.childNodes)
  2062. }
  2063. }, function (e, t) {
  2064. ce.fn[e] = function (n, r) {
  2065. var o = ce.map(this, t, n);
  2066. return "Until" !== e.slice(-5) && (r = n), r && "string" == typeof r && (o = ce.filter(r, o)), this.length > 1 && (Ve[e] || (o = ce.unique(o)), Ue.test(e) && (o = o.reverse())), this.pushStack(o)
  2067. }
  2068. }), ce.extend({
  2069. filter: function (e, t, n) {
  2070. var r = t[0];
  2071. return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? ce.find.matchesSelector(r, e) ? [r] : [] : ce.find.matches(e, ce.grep(t, function (e) {
  2072. return 1 === e.nodeType
  2073. }))
  2074. }, dir: function (e, n, r) {
  2075. for (var o = [], i = e[n]; i && 9 !== i.nodeType && (r === t || 1 !== i.nodeType || !ce(i).is(r));) 1 === i.nodeType && o.push(i), i = i[n];
  2076. return o
  2077. }, sibling: function (e, t) {
  2078. for (var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);
  2079. return n
  2080. }
  2081. });
  2082. var ze = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
  2083. We = / jQuery\d+="(?:null|\d+)"/g, Ge = RegExp("<(?:" + ze + ")[\\s/>]", "i"), Ye = /^\s+/,
  2084. Xe = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, Ke = /<([\w:]+)/, Qe = /<tbody/i,
  2085. Je = /<|&#?\w+;/, Ze = /<(?:script|style|link)/i, et = /^(?:checkbox|radio)$/i,
  2086. tt = /checked\s*(?:[^=]|=\s*.checked.)/i, nt = /^$|\/(?:java|ecma)script/i, rt = /^true\/(.*)/,
  2087. ot = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, it = {
  2088. option: [1, "<select multiple='multiple'>", "</select>"],
  2089. legend: [1, "<fieldset>", "</fieldset>"],
  2090. area: [1, "<map>", "</map>"],
  2091. param: [1, "<object>", "</object>"],
  2092. thead: [1, "<table>", "</table>"],
  2093. tr: [2, "<table><tbody>", "</tbody></table>"],
  2094. col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
  2095. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  2096. _default: ce.support.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"]
  2097. }, at = p(X).appendChild(X.createElement("div"));
  2098. it.optgroup = it.option, it.tbody = it.tfoot = it.colgroup = it.caption = it.thead, it.th = it.td, ce.fn.extend({
  2099. text: function (e) {
  2100. return ce.access(this, function (e) {
  2101. return e === t ? ce.text(this) : this.empty().append((this[0] && this[0].ownerDocument || X).createTextNode(e))
  2102. }, null, e, arguments.length)
  2103. }, append: function () {
  2104. return this.domManip(arguments, function (e) {
  2105. 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || h(this, e).appendChild(e)
  2106. })
  2107. }, prepend: function () {
  2108. return this.domManip(arguments, function (e) {
  2109. if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
  2110. var t = h(this, e);
  2111. t.insertBefore(e, t.firstChild)
  2112. }
  2113. })
  2114. }, before: function () {
  2115. return this.domManip(arguments, function (e) {
  2116. this.parentNode && this.parentNode.insertBefore(e, this)
  2117. })
  2118. }, after: function () {
  2119. return this.domManip(arguments, function (e) {
  2120. this.parentNode && this.parentNode.insertBefore(e, this.nextSibling)
  2121. })
  2122. }, remove: function (e, t) {
  2123. for (var n, r = e ? ce.filter(e, this) : this, o = 0; null != (n = r[o]); o++) t || 1 !== n.nodeType || ce.cleanData(x(n)), n.parentNode && (t && ce.contains(n.ownerDocument, n) && v(x(n, "script")), n.parentNode.removeChild(n));
  2124. return this
  2125. }, empty: function () {
  2126. for (var e, t = 0; null != (e = this[t]); t++) {
  2127. for (1 === e.nodeType && ce.cleanData(x(e, !1)); e.firstChild;) e.removeChild(e.firstChild);
  2128. e.options && ce.nodeName(e, "select") && (e.options.length = 0)
  2129. }
  2130. return this
  2131. }, clone: function (e, t) {
  2132. return e = null != e && e, t = null == t ? e : t, this.map(function () {
  2133. return ce.clone(this, e, t)
  2134. })
  2135. }, html: function (e) {
  2136. return ce.access(this, function (e) {
  2137. var n = this[0] || {}, r = 0, o = this.length;
  2138. if (e === t) return 1 === n.nodeType ? n.innerHTML.replace(We, "") : t;
  2139. if (!("string" != typeof e || Ze.test(e) || !ce.support.htmlSerialize && Ge.test(e) || !ce.support.leadingWhitespace && Ye.test(e) || it[(Ke.exec(e) || ["", ""])[1].toLowerCase()])) {
  2140. e = e.replace(Xe, "<$1></$2>");
  2141. try {
  2142. for (; o > r; r++) 1 === (n = this[r] || {}).nodeType && (ce.cleanData(x(n, !1)), n.innerHTML = e);
  2143. n = 0
  2144. } catch (e) {
  2145. }
  2146. }
  2147. n && this.empty().append(e)
  2148. }, null, e, arguments.length)
  2149. }, replaceWith: function () {
  2150. var e = ce.map(this, function (e) {
  2151. return [e.nextSibling, e.parentNode]
  2152. }), t = 0;
  2153. return this.domManip(arguments, function (n) {
  2154. var r = e[t++], o = e[t++];
  2155. o && (r && r.parentNode !== o && (r = this.nextSibling), ce(this).remove(), o.insertBefore(n, r))
  2156. }, !0), t ? this : this.remove()
  2157. }, detach: function (e) {
  2158. return this.remove(e, !0)
  2159. }, domManip: function (e, t, n) {
  2160. e = ne.apply([], e);
  2161. var r, o, i, a, s, l, c = 0, u = this.length, f = this, d = u - 1, p = e[0], h = ce.isFunction(p);
  2162. if (h || !(1 >= u || "string" != typeof p || ce.support.checkClone) && tt.test(p)) return this.each(function (r) {
  2163. var o = f.eq(r);
  2164. h && (e[0] = p.call(this, r, o.html())), o.domManip(e, t, n)
  2165. });
  2166. if (u && (l = ce.buildFragment(e, this[0].ownerDocument, !1, !n && this), r = l.firstChild, 1 === l.childNodes.length && (l = r), r)) {
  2167. for (i = (a = ce.map(x(l, "script"), g)).length; u > c; c++) o = l, c !== d && (o = ce.clone(o, !0, !0), i && ce.merge(a, x(o, "script"))), t.call(this[c], o, c);
  2168. if (i) for (s = a[a.length - 1].ownerDocument, ce.map(a, m), c = 0; i > c; c++) o = a[c], nt.test(o.type || "") && !ce._data(o, "globalEval") && ce.contains(s, o) && (o.src ? ce._evalUrl(o.src) : ce.globalEval((o.text || o.textContent || o.innerHTML || "").replace(ot, "")));
  2169. l = r = null
  2170. }
  2171. return this
  2172. }
  2173. }), ce.each({
  2174. appendTo: "append",
  2175. prependTo: "prepend",
  2176. insertBefore: "before",
  2177. insertAfter: "after",
  2178. replaceAll: "replaceWith"
  2179. }, function (e, t) {
  2180. ce.fn[e] = function (e) {
  2181. for (var n, r = 0, o = [], i = ce(e), a = i.length - 1; a >= r; r++) n = r === a ? this : this.clone(!0), ce(i[r])[t](n), re.apply(o, n.get());
  2182. return this.pushStack(o)
  2183. }
  2184. }), ce.extend({
  2185. clone: function (e, t, n) {
  2186. var r, o, i, a, s, l = ce.contains(e.ownerDocument, e);
  2187. if (ce.support.html5Clone || ce.isXMLDoc(e) || !Ge.test("<" + e.nodeName + ">") ? i = e.cloneNode(!0) : (at.innerHTML = e.outerHTML, at.removeChild(i = at.firstChild)), !(ce.support.noCloneEvent && ce.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || ce.isXMLDoc(e))) for (r = x(i), s = x(e), a = 0; null != (o = s[a]); ++a) r[a] && y(o, r[a]);
  2188. if (t) if (n) for (s = s || x(e), r = r || x(i), a = 0; null != (o = s[a]); a++) b(o, r[a]); else b(e, i);
  2189. return (r = x(i, "script")).length > 0 && v(r, !l && x(e, "script")), r = s = o = null, i
  2190. }, buildFragment: function (e, t, n, r) {
  2191. for (var o, i, a, s, l, c, u, f = e.length, d = p(t), h = [], g = 0; f > g; g++) if ((i = e[g]) || 0 === i) if ("object" === ce.type(i)) ce.merge(h, i.nodeType ? [i] : i); else if (Je.test(i)) {
  2192. for (s = s || d.appendChild(t.createElement("div")), l = (Ke.exec(i) || ["", ""])[1].toLowerCase(), u = it[l] || it._default, s.innerHTML = u[1] + i.replace(Xe, "<$1></$2>") + u[2], o = u[0]; o--;) s = s.lastChild;
  2193. if (!ce.support.leadingWhitespace && Ye.test(i) && h.push(t.createTextNode(Ye.exec(i)[0])), !ce.support.tbody) for (o = (i = "table" !== l || Qe.test(i) ? "<table>" !== u[1] || Qe.test(i) ? 0 : s : s.firstChild) && i.childNodes.length; o--;) ce.nodeName(c = i.childNodes[o], "tbody") && !c.childNodes.length && i.removeChild(c);
  2194. for (ce.merge(h, s.childNodes), s.textContent = ""; s.firstChild;) s.removeChild(s.firstChild);
  2195. s = d.lastChild
  2196. } else h.push(t.createTextNode(i));
  2197. for (s && d.removeChild(s), ce.support.appendChecked || ce.grep(x(h, "input"), w), g = 0; i = h[g++];) if ((!r || -1 === ce.inArray(i, r)) && (a = ce.contains(i.ownerDocument, i), s = x(d.appendChild(i), "script"), a && v(s), n)) for (o = 0; i = s[o++];) nt.test(i.type || "") && n.push(i);
  2198. return s = null, d
  2199. }, cleanData: function (e, t) {
  2200. for (var n, r, o, i, a = 0, s = ce.expando, l = ce.cache, c = ce.support.deleteExpando, u = ce.event.special; null != (n = e[a]); a++) if ((t || ce.acceptData(n)) && (o = n[s], i = o && l[o])) {
  2201. if (i.events) for (r in i.events) u[r] ? ce.event.remove(n, r) : ce.removeEvent(n, r, i.handle);
  2202. l[o] && (delete l[o], c ? delete n[s] : typeof n.removeAttribute !== G ? n.removeAttribute(s) : n[s] = null, ee.push(o))
  2203. }
  2204. }, _evalUrl: function (e) {
  2205. return ce.ajax({url: e, type: "GET", dataType: "script", async: !1, global: !1, throws: !0})
  2206. }
  2207. }), ce.fn.extend({
  2208. wrapAll: function (e) {
  2209. if (ce.isFunction(e)) return this.each(function (t) {
  2210. ce(this).wrapAll(e.call(this, t))
  2211. });
  2212. if (this[0]) {
  2213. var t = ce(e, this[0].ownerDocument).eq(0).clone(!0);
  2214. this[0].parentNode && t.insertBefore(this[0]), t.map(function () {
  2215. for (var e = this; e.firstChild && 1 === e.firstChild.nodeType;) e = e.firstChild;
  2216. return e
  2217. }).append(this)
  2218. }
  2219. return this
  2220. }, wrapInner: function (e) {
  2221. return ce.isFunction(e) ? this.each(function (t) {
  2222. ce(this).wrapInner(e.call(this, t))
  2223. }) : this.each(function () {
  2224. var t = ce(this), n = t.contents();
  2225. n.length ? n.wrapAll(e) : t.append(e)
  2226. })
  2227. }, wrap: function (e) {
  2228. var t = ce.isFunction(e);
  2229. return this.each(function (n) {
  2230. ce(this).wrapAll(t ? e.call(this, n) : e)
  2231. })
  2232. }, unwrap: function () {
  2233. return this.parent().each(function () {
  2234. ce.nodeName(this, "body") || ce(this).replaceWith(this.childNodes)
  2235. }).end()
  2236. }
  2237. });
  2238. var st, lt, ct, ut = /alpha\([^)]*\)/i, ft = /opacity\s*=\s*([^)]*)/, dt = /^(top|right|bottom|left)$/,
  2239. pt = /^(none|table(?!-c[ea]).+)/, ht = /^margin/, gt = RegExp("^(" + ue + ")(.*)$", "i"),
  2240. mt = RegExp("^(" + ue + ")(?!px)[a-z%]+$", "i"), vt = RegExp("^([+-])=(" + ue + ")", "i"), bt = {BODY: "block"},
  2241. yt = {position: "absolute", visibility: "hidden", display: "block"}, xt = {letterSpacing: 0, fontWeight: 400},
  2242. wt = ["Top", "Right", "Bottom", "Left"], $t = ["Webkit", "O", "Moz", "ms"];
  2243. ce.fn.extend({
  2244. css: function (e, n) {
  2245. return ce.access(this, function (e, n, r) {
  2246. var o, i, a = {}, s = 0;
  2247. if (ce.isArray(n)) {
  2248. for (i = lt(e), o = n.length; o > s; s++) a[n[s]] = ce.css(e, n[s], !1, i);
  2249. return a
  2250. }
  2251. return r !== t ? ce.style(e, n, r) : ce.css(e, n)
  2252. }, e, n, arguments.length > 1)
  2253. }, show: function () {
  2254. return T(this, !0)
  2255. }, hide: function () {
  2256. return T(this)
  2257. }, toggle: function (e) {
  2258. return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function () {
  2259. k(this) ? ce(this).show() : ce(this).hide()
  2260. })
  2261. }
  2262. }), ce.extend({
  2263. cssHooks: {
  2264. opacity: {
  2265. get: function (e, t) {
  2266. if (t) {
  2267. var n = ct(e, "opacity");
  2268. return "" === n ? "1" : n
  2269. }
  2270. }
  2271. }
  2272. },
  2273. cssNumber: {
  2274. columnCount: !0,
  2275. fillOpacity: !0,
  2276. fontWeight: !0,
  2277. lineHeight: !0,
  2278. opacity: !0,
  2279. order: !0,
  2280. orphans: !0,
  2281. widows: !0,
  2282. zIndex: !0,
  2283. zoom: !0
  2284. },
  2285. cssProps: {float: ce.support.cssFloat ? "cssFloat" : "styleFloat"},
  2286. style: function (e, n, r, o) {
  2287. if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
  2288. var i, a, s, l = ce.camelCase(n), c = e.style;
  2289. if (n = ce.cssProps[l] || (ce.cssProps[l] = $(c, l)), s = ce.cssHooks[n] || ce.cssHooks[l], r === t) return s && "get" in s && (i = s.get(e, !1, o)) !== t ? i : c[n];
  2290. if ("string" === (a = typeof r) && (i = vt.exec(r)) && (r = (i[1] + 1) * i[2] + parseFloat(ce.css(e, n)), a = "number"), !(null == r || "number" === a && isNaN(r) || ("number" !== a || ce.cssNumber[l] || (r += "px"), ce.support.clearCloneStyle || "" !== r || 0 !== n.indexOf("background") || (c[n] = "inherit"), s && "set" in s && (r = s.set(e, r, o)) === t))) try {
  2291. c[n] = r
  2292. } catch (e) {
  2293. }
  2294. }
  2295. },
  2296. css: function (e, n, r, o) {
  2297. var i, a, s, l = ce.camelCase(n);
  2298. return n = ce.cssProps[l] || (ce.cssProps[l] = $(e.style, l)), (s = ce.cssHooks[n] || ce.cssHooks[l]) && "get" in s && (a = s.get(e, !0, r)), a === t && (a = ct(e, n, o)), "normal" === a && n in xt && (a = xt[n]), "" === r || r ? (i = parseFloat(a), !0 === r || ce.isNumeric(i) ? i || 0 : a) : a
  2299. }
  2300. }), e.getComputedStyle ? (lt = function (t) {
  2301. return e.getComputedStyle(t, null)
  2302. }, ct = function (e, n, r) {
  2303. var o, i, a, s = r || lt(e), l = s ? s.getPropertyValue(n) || s[n] : t, c = e.style;
  2304. return s && ("" !== l || ce.contains(e.ownerDocument, e) || (l = ce.style(e, n)), mt.test(l) && ht.test(n) && (o = c.width, i = c.minWidth, a = c.maxWidth, c.minWidth = c.maxWidth = c.width = l, l = s.width, c.width = o, c.minWidth = i, c.maxWidth = a)), l
  2305. }) : X.documentElement.currentStyle && (lt = function (e) {
  2306. return e.currentStyle
  2307. }, ct = function (e, n, r) {
  2308. var o, i, a, s = r || lt(e), l = s ? s[n] : t, c = e.style;
  2309. return null == l && c && c[n] && (l = c[n]), mt.test(l) && !dt.test(n) && (o = c.left, i = e.runtimeStyle, (a = i && i.left) && (i.left = e.currentStyle.left), c.left = "fontSize" === n ? "1em" : l, l = c.pixelLeft + "px", c.left = o, a && (i.left = a)), "" === l ? "auto" : l
  2310. }), ce.each(["height", "width"], function (e, n) {
  2311. ce.cssHooks[n] = {
  2312. get: function (e, r, o) {
  2313. return r ? 0 === e.offsetWidth && pt.test(ce.css(e, "display")) ? ce.swap(e, yt, function () {
  2314. return E(e, n, o)
  2315. }) : E(e, n, o) : t
  2316. }, set: function (e, t, r) {
  2317. var o = r && lt(e);
  2318. return S(0, t, r ? C(e, n, r, ce.support.boxSizing && "border-box" === ce.css(e, "boxSizing", !1, o), o) : 0)
  2319. }
  2320. }
  2321. }), ce.support.opacity || (ce.cssHooks.opacity = {
  2322. get: function (e, t) {
  2323. return ft.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : t ? "1" : ""
  2324. }, set: function (e, t) {
  2325. var n = e.style, r = e.currentStyle, o = ce.isNumeric(t) ? "alpha(opacity=" + 100 * t + ")" : "",
  2326. i = r && r.filter || n.filter || "";
  2327. n.zoom = 1, (t >= 1 || "" === t) && "" === ce.trim(i.replace(ut, "")) && n.removeAttribute && (n.removeAttribute("filter"), "" === t || r && !r.filter) || (n.filter = ut.test(i) ? i.replace(ut, o) : i + " " + o)
  2328. }
  2329. }), ce(function () {
  2330. ce.support.reliableMarginRight || (ce.cssHooks.marginRight = {
  2331. get: function (e, n) {
  2332. return n ? ce.swap(e, {display: "inline-block"}, ct, [e, "marginRight"]) : t
  2333. }
  2334. }), !ce.support.pixelPosition && ce.fn.position && ce.each(["top", "left"], function (e, n) {
  2335. ce.cssHooks[n] = {
  2336. get: function (e, r) {
  2337. return r ? (r = ct(e, n), mt.test(r) ? ce(e).position()[n] + "px" : r) : t
  2338. }
  2339. }
  2340. })
  2341. }), ce.expr && ce.expr.filters && (ce.expr.filters.hidden = function (e) {
  2342. return 0 >= e.offsetWidth && 0 >= e.offsetHeight || !ce.support.reliableHiddenOffsets && "none" === (e.style && e.style.display || ce.css(e, "display"))
  2343. }, ce.expr.filters.visible = function (e) {
  2344. return !ce.expr.filters.hidden(e)
  2345. }), ce.each({margin: "", padding: "", border: "Width"}, function (e, t) {
  2346. ce.cssHooks[e + t] = {
  2347. expand: function (n) {
  2348. for (var r = 0, o = {}, i = "string" == typeof n ? n.split(" ") : [n]; 4 > r; r++) o[e + wt[r] + t] = i[r] || i[r - 2] || i[0];
  2349. return o
  2350. }
  2351. }, ht.test(e) || (ce.cssHooks[e + t].set = S)
  2352. });
  2353. var kt = /%20/g, Tt = /\[\]$/, St = /\r?\n/g, Ct = /^(?:submit|button|image|reset|file)$/i,
  2354. Et = /^(?:input|select|textarea|keygen)/i;
  2355. ce.fn.extend({
  2356. serialize: function () {
  2357. return ce.param(this.serializeArray())
  2358. }, serializeArray: function () {
  2359. return this.map(function () {
  2360. var e = ce.prop(this, "elements");
  2361. return e ? ce.makeArray(e) : this
  2362. }).filter(function () {
  2363. var e = this.type;
  2364. return this.name && !ce(this).is(":disabled") && Et.test(this.nodeName) && !Ct.test(e) && (this.checked || !et.test(e))
  2365. }).map(function (e, t) {
  2366. var n = ce(this).val();
  2367. return null == n ? null : ce.isArray(n) ? ce.map(n, function (e) {
  2368. return {name: t.name, value: e.replace(St, "\r\n")}
  2369. }) : {name: t.name, value: n.replace(St, "\r\n")}
  2370. }).get()
  2371. }
  2372. }), ce.param = function (e, n) {
  2373. var r, o = [], i = function (e, t) {
  2374. t = ce.isFunction(t) ? t() : null == t ? "" : t, o[o.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t)
  2375. };
  2376. if (n === t && (n = ce.ajaxSettings && ce.ajaxSettings.traditional), ce.isArray(e) || e.jquery && !ce.isPlainObject(e)) ce.each(e, function () {
  2377. i(this.name, this.value)
  2378. }); else for (r in e) P(r, e[r], n, i);
  2379. return o.join("&").replace(kt, "+")
  2380. }, ce.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 (e, t) {
  2381. ce.fn[t] = function (e, n) {
  2382. return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t)
  2383. }
  2384. }), ce.fn.extend({
  2385. hover: function (e, t) {
  2386. return this.mouseenter(e).mouseleave(t || e)
  2387. }, bind: function (e, t, n) {
  2388. return this.on(e, null, t, n)
  2389. }, unbind: function (e, t) {
  2390. return this.off(e, null, t)
  2391. }, delegate: function (e, t, n, r) {
  2392. return this.on(t, e, n, r)
  2393. }, undelegate: function (e, t, n) {
  2394. return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n)
  2395. }
  2396. });
  2397. var At, Nt, Pt = ce.now(), Ot = /\?/, Dt = /#.*$/, It = /([?&])_=[^&]*/, Mt = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm,
  2398. _t = /^(?:GET|HEAD)$/, Lt = /^\/\//, Ft = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, Bt = ce.fn.load, Rt = {},
  2399. jt = {}, qt = "*/".concat("*");
  2400. try {
  2401. Nt = Y.href
  2402. } catch (e) {
  2403. (Nt = X.createElement("a")).href = "", Nt = Nt.href
  2404. }
  2405. At = Ft.exec(Nt.toLowerCase()) || [], ce.fn.load = function (e, n, r) {
  2406. if ("string" != typeof e && Bt) return Bt.apply(this, arguments);
  2407. var o, i, a, s = this, l = e.indexOf(" ");
  2408. return l >= 0 && (o = e.slice(l, e.length), e = e.slice(0, l)), ce.isFunction(n) ? (r = n, n = t) : n && "object" == typeof n && (a = "POST"), s.length > 0 && ce.ajax({
  2409. url: e,
  2410. type: a,
  2411. dataType: "html",
  2412. data: n
  2413. }).done(function (e) {
  2414. i = arguments, s.html(o ? ce("<div>").append(ce.parseHTML(e)).find(o) : e)
  2415. }).complete(r && function (e, t) {
  2416. s.each(r, i || [e.responseText, t, e])
  2417. }), this
  2418. }, ce.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (e, t) {
  2419. ce.fn[t] = function (e) {
  2420. return this.on(t, e)
  2421. }
  2422. }), ce.extend({
  2423. active: 0,
  2424. lastModified: {},
  2425. etag: {},
  2426. ajaxSettings: {
  2427. url: Nt,
  2428. type: "GET",
  2429. isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(At[1]),
  2430. global: !0,
  2431. processData: !0,
  2432. async: !0,
  2433. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  2434. accepts: {
  2435. "*": qt,
  2436. text: "text/plain",
  2437. html: "text/html",
  2438. xml: "application/xml, text/xml",
  2439. json: "application/json, text/javascript"
  2440. },
  2441. contents: {xml: /xml/, html: /html/, json: /json/},
  2442. responseFields: {xml: "responseXML", text: "responseText", json: "responseJSON"},
  2443. converters: {"* text": String, "text html": !0, "text json": ce.parseJSON, "text xml": ce.parseXML},
  2444. flatOptions: {url: !0, context: !0}
  2445. },
  2446. ajaxSetup: function (e, t) {
  2447. return t ? I(I(e, ce.ajaxSettings), t) : I(ce.ajaxSettings, e)
  2448. },
  2449. ajaxPrefilter: O(Rt),
  2450. ajaxTransport: O(jt),
  2451. ajax: function (e, n) {
  2452. function r(e, n, r, o) {
  2453. var i, f, b, y, w, k = n;
  2454. 2 !== x && (x = 2, l && clearTimeout(l), u = t, s = o || "", $.readyState = e > 0 ? 4 : 0, i = e >= 200 && 300 > e || 304 === e, r && (y = M(d, $, r)), y = _(d, y, $, i), i ? (d.ifModified && ((w = $.getResponseHeader("Last-Modified")) && (ce.lastModified[a] = w), (w = $.getResponseHeader("etag")) && (ce.etag[a] = w)), 204 === e || "HEAD" === d.type ? k = "nocontent" : 304 === e ? k = "notmodified" : (k = y.state, f = y.data, b = y.error, i = !b)) : (b = k, (e || !k) && (k = "error", 0 > e && (e = 0))), $.status = e, $.statusText = (n || k) + "", i ? g.resolveWith(p, [f, k, $]) : g.rejectWith(p, [$, k, b]), $.statusCode(v), v = t, c && h.trigger(i ? "ajaxSuccess" : "ajaxError", [$, d, i ? f : b]), m.fireWith(p, [$, k]), c && (h.trigger("ajaxComplete", [$, d]), --ce.active || ce.event.trigger("ajaxStop")))
  2455. }
  2456. "object" == typeof e && (n = e, e = t), n = n || {};
  2457. var o, i, a, s, l, c, u, f, d = ce.ajaxSetup({}, n), p = d.context || d,
  2458. h = d.context && (p.nodeType || p.jquery) ? ce(p) : ce.event, g = ce.Deferred(),
  2459. m = ce.Callbacks("once memory"), v = d.statusCode || {}, b = {}, y = {}, x = 0, w = "canceled", $ = {
  2460. readyState: 0, getResponseHeader: function (e) {
  2461. var t;
  2462. if (2 === x) {
  2463. if (!f) for (f = {}; t = Mt.exec(s);) f[t[1].toLowerCase()] = t[2];
  2464. t = f[e.toLowerCase()]
  2465. }
  2466. return null == t ? null : t
  2467. }, getAllResponseHeaders: function () {
  2468. return 2 === x ? s : null
  2469. }, setRequestHeader: function (e, t) {
  2470. var n = e.toLowerCase();
  2471. return x || (e = y[n] = y[n] || e, b[e] = t), this
  2472. }, overrideMimeType: function (e) {
  2473. return x || (d.mimeType = e), this
  2474. }, statusCode: function (e) {
  2475. var t;
  2476. if (e) if (2 > x) for (t in e) v[t] = [v[t], e[t]]; else $.always(e[$.status]);
  2477. return this
  2478. }, abort: function (e) {
  2479. var t = e || w;
  2480. return u && u.abort(t), r(0, t), this
  2481. }
  2482. };
  2483. if (g.promise($).complete = m.add, $.success = $.done, $.error = $.fail, d.url = ((e || d.url || Nt) + "").replace(Dt, "").replace(Lt, At[1] + "//"), d.type = n.method || n.type || d.method || d.type, d.dataTypes = ce.trim(d.dataType || "*").toLowerCase().match(fe) || [""], null == d.crossDomain && (o = Ft.exec(d.url.toLowerCase()), d.crossDomain = !(!o || o[1] === At[1] && o[2] === At[2] && (o[3] || ("http:" === o[1] ? "80" : "443")) === (At[3] || ("http:" === At[1] ? "80" : "443")))), d.data && d.processData && "string" != typeof d.data && (d.data = ce.param(d.data, d.traditional)), D(Rt, d, n, $), 2 === x) return $;
  2484. (c = d.global) && 0 == ce.active++ && ce.event.trigger("ajaxStart"), d.type = d.type.toUpperCase(), d.hasContent = !_t.test(d.type), a = d.url, d.hasContent || (d.data && (a = d.url += (Ot.test(a) ? "&" : "?") + d.data, delete d.data), !1 === d.cache && (d.url = It.test(a) ? a.replace(It, "$1_=" + Pt++) : a + (Ot.test(a) ? "&" : "?") + "_=" + Pt++)), d.ifModified && (ce.lastModified[a] && $.setRequestHeader("If-Modified-Since", ce.lastModified[a]), ce.etag[a] && $.setRequestHeader("If-None-Match", ce.etag[a])), (d.data && d.hasContent && !1 !== d.contentType || n.contentType) && $.setRequestHeader("Content-Type", d.contentType), $.setRequestHeader("Accept", d.dataTypes[0] && d.accepts[d.dataTypes[0]] ? d.accepts[d.dataTypes[0]] + ("*" !== d.dataTypes[0] ? ", " + qt + "; q=0.01" : "") : d.accepts["*"]);
  2485. for (i in d.headers) $.setRequestHeader(i, d.headers[i]);
  2486. if (d.beforeSend && (!1 === d.beforeSend.call(p, $, d) || 2 === x)) return $.abort();
  2487. w = "abort";
  2488. for (i in{success: 1, error: 1, complete: 1}) $[i](d[i]);
  2489. if (u = D(jt, d, n, $)) {
  2490. $.readyState = 1, c && h.trigger("ajaxSend", [$, d]), d.async && d.timeout > 0 && (l = setTimeout(function () {
  2491. $.abort("timeout")
  2492. }, d.timeout));
  2493. try {
  2494. x = 1, u.send(b, r)
  2495. } catch (e) {
  2496. if (!(2 > x)) throw e;
  2497. r(-1, e)
  2498. }
  2499. } else r(-1, "No Transport");
  2500. return $
  2501. },
  2502. getJSON: function (e, t, n) {
  2503. return ce.get(e, t, n, "json")
  2504. },
  2505. getScript: function (e, n) {
  2506. return ce.get(e, t, n, "script")
  2507. }
  2508. }), ce.each(["get", "post"], function (e, n) {
  2509. ce[n] = function (e, r, o, i) {
  2510. return ce.isFunction(r) && (i = i || o, o = r, r = t), ce.ajax({
  2511. url: e,
  2512. type: n,
  2513. dataType: i,
  2514. data: r,
  2515. success: o
  2516. })
  2517. }
  2518. }), ce.ajaxSetup({
  2519. accepts: {script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},
  2520. contents: {script: /(?:java|ecma)script/},
  2521. converters: {
  2522. "text script": function (e) {
  2523. return ce.globalEval(e), e
  2524. }
  2525. }
  2526. }), ce.ajaxPrefilter("script", function (e) {
  2527. e.cache === t && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1)
  2528. }), ce.ajaxTransport("script", function (e) {
  2529. if (e.crossDomain) {
  2530. var n, r = X.head || ce("head")[0] || X.documentElement;
  2531. return {
  2532. send: function (t, o) {
  2533. (n = X.createElement("script")).async = !0, e.scriptCharset && (n.charset = e.scriptCharset), n.src = e.url, n.onload = n.onreadystatechange = function (e, t) {
  2534. (t || !n.readyState || /loaded|complete/.test(n.readyState)) && (n.onload = n.onreadystatechange = null, n.parentNode && n.parentNode.removeChild(n), n = null, t || o(200, "success"))
  2535. }, r.insertBefore(n, r.firstChild)
  2536. }, abort: function () {
  2537. n && n.onload(t, !0)
  2538. }
  2539. }
  2540. }
  2541. });
  2542. var Ut = [], Ht = /(=)\?(?=&|$)|\?\?/;
  2543. ce.ajaxSetup({
  2544. jsonp: "callback", jsonpCallback: function () {
  2545. var e = Ut.pop() || ce.expando + "_" + Pt++;
  2546. return this[e] = !0, e
  2547. }
  2548. }), ce.ajaxPrefilter("json jsonp", function (n, r, o) {
  2549. var i, a, s,
  2550. l = !1 !== n.jsonp && (Ht.test(n.url) ? "url" : "string" == typeof n.data && !(n.contentType || "").indexOf("application/x-www-form-urlencoded") && Ht.test(n.data) && "data");
  2551. return l || "jsonp" === n.dataTypes[0] ? (i = n.jsonpCallback = ce.isFunction(n.jsonpCallback) ? n.jsonpCallback() : n.jsonpCallback, l ? n[l] = n[l].replace(Ht, "$1" + i) : !1 !== n.jsonp && (n.url += (Ot.test(n.url) ? "&" : "?") + n.jsonp + "=" + i), n.converters["script json"] = function () {
  2552. return s || ce.error(i + " was not called"), s[0]
  2553. }, n.dataTypes[0] = "json", a = e[i], e[i] = function () {
  2554. s = arguments
  2555. }, o.always(function () {
  2556. e[i] = a, n[i] && (n.jsonpCallback = r.jsonpCallback, Ut.push(i)), s && ce.isFunction(a) && a(s[0]), s = a = t
  2557. }), "script") : t
  2558. });
  2559. var Vt, zt, Wt = 0, Gt = e.ActiveXObject && function () {
  2560. var e;
  2561. for (e in Vt) Vt[e](t, !0)
  2562. };
  2563. ce.ajaxSettings.xhr = e.ActiveXObject ? function () {
  2564. return !this.isLocal && L() || F()
  2565. } : L, zt = ce.ajaxSettings.xhr(), ce.support.cors = !!zt && "withCredentials" in zt, (zt = ce.support.ajax = !!zt) && ce.ajaxTransport(function (n) {
  2566. if (!n.crossDomain || ce.support.cors) {
  2567. var r;
  2568. return {
  2569. send: function (o, i) {
  2570. var a, s, l = n.xhr();
  2571. if (n.username ? l.open(n.type, n.url, n.async, n.username, n.password) : l.open(n.type, n.url, n.async), n.xhrFields) for (s in n.xhrFields) l[s] = n.xhrFields[s];
  2572. n.mimeType && l.overrideMimeType && l.overrideMimeType(n.mimeType), n.crossDomain || o["X-Requested-With"] || (o["X-Requested-With"] = "XMLHttpRequest");
  2573. try {
  2574. for (s in o) l.setRequestHeader(s, o[s])
  2575. } catch (e) {
  2576. }
  2577. l.send(n.hasContent && n.data || null), r = function (e, o) {
  2578. var s, c, u, f;
  2579. try {
  2580. if (r && (o || 4 === l.readyState)) if (r = t, a && (l.onreadystatechange = ce.noop, Gt && delete Vt[a]), o) 4 !== l.readyState && l.abort(); else {
  2581. f = {}, s = l.status, c = l.getAllResponseHeaders(), "string" == typeof l.responseText && (f.text = l.responseText);
  2582. try {
  2583. u = l.statusText
  2584. } catch (e) {
  2585. u = ""
  2586. }
  2587. s || !n.isLocal || n.crossDomain ? 1223 === s && (s = 204) : s = f.text ? 200 : 404
  2588. }
  2589. } catch (e) {
  2590. o || i(-1, e)
  2591. }
  2592. f && i(s, u, f, c)
  2593. }, n.async ? 4 === l.readyState ? setTimeout(r) : (a = ++Wt, Gt && (Vt || (Vt = {}, ce(e).unload(Gt)), Vt[a] = r), l.onreadystatechange = r) : r()
  2594. }, abort: function () {
  2595. r && r(t, !0)
  2596. }
  2597. }
  2598. }
  2599. });
  2600. var Yt, Xt, Kt = /^(?:toggle|show|hide)$/, Qt = RegExp("^(?:([+-])=|)(" + ue + ")([a-z%]*)$", "i"),
  2601. Jt = /queueHooks$/, Zt = [function (e, t, n) {
  2602. var r, o, i, a, s, l, c = this, u = {}, f = e.style, d = e.nodeType && k(e), p = ce._data(e, "fxshow");
  2603. n.queue || (null == (s = ce._queueHooks(e, "fx")).unqueued && (s.unqueued = 0, l = s.empty.fire, s.empty.fire = function () {
  2604. s.unqueued || l()
  2605. }), s.unqueued++, c.always(function () {
  2606. c.always(function () {
  2607. s.unqueued--, ce.queue(e, "fx").length || s.empty.fire()
  2608. })
  2609. })), 1 === e.nodeType && ("height" in t || "width" in t) && (n.overflow = [f.overflow, f.overflowX, f.overflowY], "inline" === ce.css(e, "display") && "none" === ce.css(e, "float") && (ce.support.inlineBlockNeedsLayout && "inline" !== A(e.nodeName) ? f.zoom = 1 : f.display = "inline-block")), n.overflow && (f.overflow = "hidden", ce.support.shrinkWrapBlocks || c.always(function () {
  2610. f.overflow = n.overflow[0], f.overflowX = n.overflow[1], f.overflowY = n.overflow[2]
  2611. }));
  2612. for (r in t) if (o = t[r], Kt.exec(o)) {
  2613. if (delete t[r], i = i || "toggle" === o, o === (d ? "hide" : "show")) continue;
  2614. u[r] = p && p[r] || ce.style(e, r)
  2615. }
  2616. if (!ce.isEmptyObject(u)) {
  2617. p ? "hidden" in p && (d = p.hidden) : p = ce._data(e, "fxshow", {}), i && (p.hidden = !d), d ? ce(e).show() : c.done(function () {
  2618. ce(e).hide()
  2619. }), c.done(function () {
  2620. var t;
  2621. ce._removeData(e, "fxshow");
  2622. for (t in u) ce.style(e, t, u[t])
  2623. });
  2624. for (r in u) a = R(d ? p[r] : 0, r, c), r in p || (p[r] = a.start, d && (a.end = a.start, a.start = "width" === r || "height" === r ? 1 : 0))
  2625. }
  2626. }], en = {
  2627. "*": [function (e, t) {
  2628. var n = this.createTween(e, t), r = n.cur(), o = Qt.exec(t), i = o && o[3] || (ce.cssNumber[e] ? "" : "px"),
  2629. a = (ce.cssNumber[e] || "px" !== i && +r) && Qt.exec(ce.css(n.elem, e)), s = 1, l = 20;
  2630. if (a && a[3] !== i) {
  2631. i = i || a[3], o = o || [], a = +r || 1;
  2632. do {
  2633. s = s || ".5", a /= s, ce.style(n.elem, e, a + i)
  2634. } while (s !== (s = n.cur() / r) && 1 !== s && --l)
  2635. }
  2636. return o && (a = n.start = +a || +r || 0, n.unit = i, n.end = o[1] ? a + (o[1] + 1) * o[2] : +o[2]), n
  2637. }]
  2638. };
  2639. ce.Animation = ce.extend(j, {
  2640. tweener: function (e, t) {
  2641. ce.isFunction(e) ? (t = e, e = ["*"]) : e = e.split(" ");
  2642. for (var n, r = 0, o = e.length; o > r; r++) n = e[r], en[n] = en[n] || [], en[n].unshift(t)
  2643. }, prefilter: function (e, t) {
  2644. t ? Zt.unshift(e) : Zt.push(e)
  2645. }
  2646. }), ce.Tween = U, U.prototype = {
  2647. constructor: U, init: function (e, t, n, r, o, i) {
  2648. this.elem = e, this.prop = n, this.easing = o || "swing", this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = i || (ce.cssNumber[n] ? "" : "px")
  2649. }, cur: function () {
  2650. var e = U.propHooks[this.prop];
  2651. return e && e.get ? e.get(this) : U.propHooks._default.get(this)
  2652. }, run: function (e) {
  2653. var t, n = U.propHooks[this.prop];
  2654. return this.pos = t = this.options.duration ? ce.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : U.propHooks._default.set(this), this
  2655. }
  2656. }, U.prototype.init.prototype = U.prototype, U.propHooks = {
  2657. _default: {
  2658. get: function (e) {
  2659. var t;
  2660. return null == e.elem[e.prop] || e.elem.style && null != e.elem.style[e.prop] ? (t = ce.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0 : e.elem[e.prop]
  2661. }, set: function (e) {
  2662. ce.fx.step[e.prop] ? ce.fx.step[e.prop](e) : e.elem.style && (null != e.elem.style[ce.cssProps[e.prop]] || ce.cssHooks[e.prop]) ? ce.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now
  2663. }
  2664. }
  2665. }, U.propHooks.scrollTop = U.propHooks.scrollLeft = {
  2666. set: function (e) {
  2667. e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now)
  2668. }
  2669. }, ce.each(["toggle", "show", "hide"], function (e, t) {
  2670. var n = ce.fn[t];
  2671. ce.fn[t] = function (e, r, o) {
  2672. return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(H(t, !0), e, r, o)
  2673. }
  2674. }), ce.fn.extend({
  2675. fadeTo: function (e, t, n, r) {
  2676. return this.filter(k).css("opacity", 0).show().end().animate({opacity: t}, e, n, r)
  2677. }, animate: function (e, t, n, r) {
  2678. var o = ce.isEmptyObject(e), i = ce.speed(t, n, r), a = function () {
  2679. var t = j(this, ce.extend({}, e), i);
  2680. (o || ce._data(this, "finish")) && t.stop(!0)
  2681. };
  2682. return a.finish = a, o || !1 === i.queue ? this.each(a) : this.queue(i.queue, a)
  2683. }, stop: function (e, n, r) {
  2684. var o = function (e) {
  2685. var t = e.stop;
  2686. delete e.stop, t(r)
  2687. };
  2688. return "string" != typeof e && (r = n, n = e, e = t), n && !1 !== e && this.queue(e || "fx", []), this.each(function () {
  2689. var t = !0, n = null != e && e + "queueHooks", i = ce.timers, a = ce._data(this);
  2690. if (n) a[n] && a[n].stop && o(a[n]); else for (n in a) a[n] && a[n].stop && Jt.test(n) && o(a[n]);
  2691. for (n = i.length; n--;) i[n].elem !== this || null != e && i[n].queue !== e || (i[n].anim.stop(r), t = !1, i.splice(n, 1));
  2692. (t || !r) && ce.dequeue(this, e)
  2693. })
  2694. }, finish: function (e) {
  2695. return !1 !== e && (e = e || "fx"), this.each(function () {
  2696. var t, n = ce._data(this), r = n[e + "queue"], o = n[e + "queueHooks"], i = ce.timers, a = r ? r.length : 0;
  2697. for (n.finish = !0, ce.queue(this, e, []), o && o.stop && o.stop.call(this, !0), t = i.length; t--;) i[t].elem === this && i[t].queue === e && (i[t].anim.stop(!0), i.splice(t, 1));
  2698. for (t = 0; a > t; t++) r[t] && r[t].finish && r[t].finish.call(this);
  2699. delete n.finish
  2700. })
  2701. }
  2702. }), ce.each({
  2703. slideDown: H("show"),
  2704. slideUp: H("hide"),
  2705. slideToggle: H("toggle"),
  2706. fadeIn: {opacity: "show"},
  2707. fadeOut: {opacity: "hide"},
  2708. fadeToggle: {opacity: "toggle"}
  2709. }, function (e, t) {
  2710. ce.fn[e] = function (e, n, r) {
  2711. return this.animate(t, e, n, r)
  2712. }
  2713. }), ce.speed = function (e, t, n) {
  2714. var r = e && "object" == typeof e ? ce.extend({}, e) : {
  2715. complete: n || !n && t || ce.isFunction(e) && e,
  2716. duration: e,
  2717. easing: n && t || t && !ce.isFunction(t) && t
  2718. };
  2719. return r.duration = ce.fx.off ? 0 : "number" == typeof r.duration ? r.duration : r.duration in ce.fx.speeds ? ce.fx.speeds[r.duration] : ce.fx.speeds._default, (null == r.queue || !0 === r.queue) && (r.queue = "fx"), r.old = r.complete, r.complete = function () {
  2720. ce.isFunction(r.old) && r.old.call(this), r.queue && ce.dequeue(this, r.queue)
  2721. }, r
  2722. }, ce.easing = {
  2723. linear: function (e) {
  2724. return e
  2725. }, swing: function (e) {
  2726. return .5 - Math.cos(e * Math.PI) / 2
  2727. }
  2728. }, ce.timers = [], ce.fx = U.prototype.init, ce.fx.tick = function () {
  2729. var e, n = ce.timers, r = 0;
  2730. for (Yt = ce.now(); n.length > r; r++) (e = n[r])() || n[r] !== e || n.splice(r--, 1);
  2731. n.length || ce.fx.stop(), Yt = t
  2732. }, ce.fx.timer = function (e) {
  2733. e() && ce.timers.push(e) && ce.fx.start()
  2734. }, ce.fx.interval = 13, ce.fx.start = function () {
  2735. Xt || (Xt = setInterval(ce.fx.tick, ce.fx.interval))
  2736. }, ce.fx.stop = function () {
  2737. clearInterval(Xt), Xt = null
  2738. }, ce.fx.speeds = {
  2739. slow: 600,
  2740. fast: 200,
  2741. _default: 400
  2742. }, ce.fx.step = {}, ce.expr && ce.expr.filters && (ce.expr.filters.animated = function (e) {
  2743. return ce.grep(ce.timers, function (t) {
  2744. return e === t.elem
  2745. }).length
  2746. }), ce.fn.offset = function (e) {
  2747. if (arguments.length) return e === t ? this : this.each(function (t) {
  2748. ce.offset.setOffset(this, e, t)
  2749. });
  2750. var n, r, o = {top: 0, left: 0}, i = this[0], a = i && i.ownerDocument;
  2751. return a ? (n = a.documentElement, ce.contains(n, i) ? (typeof i.getBoundingClientRect !== G && (o = i.getBoundingClientRect()), r = V(a), {
  2752. top: o.top + (r.pageYOffset || n.scrollTop) - (n.clientTop || 0),
  2753. left: o.left + (r.pageXOffset || n.scrollLeft) - (n.clientLeft || 0)
  2754. }) : o) : void 0
  2755. }, ce.offset = {
  2756. setOffset: function (e, t, n) {
  2757. var r = ce.css(e, "position");
  2758. "static" === r && (e.style.position = "relative");
  2759. var o, i, a = ce(e), s = a.offset(), l = ce.css(e, "top"), c = ce.css(e, "left"), u = {}, f = {};
  2760. ("absolute" === r || "fixed" === r) && ce.inArray("auto", [l, c]) > -1 ? (f = a.position(), o = f.top, i = f.left) : (o = parseFloat(l) || 0, i = parseFloat(c) || 0), ce.isFunction(t) && (t = t.call(e, n, s)), null != t.top && (u.top = t.top - s.top + o), null != t.left && (u.left = t.left - s.left + i), "using" in t ? t.using.call(e, u) : a.css(u)
  2761. }
  2762. }, ce.fn.extend({
  2763. position: function () {
  2764. if (this[0]) {
  2765. var e, t, n = {top: 0, left: 0}, r = this[0];
  2766. return "fixed" === ce.css(r, "position") ? t = r.getBoundingClientRect() : (e = this.offsetParent(), t = this.offset(), ce.nodeName(e[0], "html") || (n = e.offset()), n.top += ce.css(e[0], "borderTopWidth", !0), n.left += ce.css(e[0], "borderLeftWidth", !0)), {
  2767. top: t.top - n.top - ce.css(r, "marginTop", !0),
  2768. left: t.left - n.left - ce.css(r, "marginLeft", !0)
  2769. }
  2770. }
  2771. }, offsetParent: function () {
  2772. return this.map(function () {
  2773. for (var e = this.offsetParent || K; e && !ce.nodeName(e, "html") && "static" === ce.css(e, "position");) e = e.offsetParent;
  2774. return e || K
  2775. })
  2776. }
  2777. }), ce.each({scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function (e, n) {
  2778. var r = /Y/.test(n);
  2779. ce.fn[e] = function (o) {
  2780. return ce.access(this, function (e, o, i) {
  2781. var a = V(e);
  2782. return i === t ? a ? n in a ? a[n] : a.document.documentElement[o] : e[o] : (a ? a.scrollTo(r ? ce(a).scrollLeft() : i, r ? i : ce(a).scrollTop()) : e[o] = i, t)
  2783. }, e, o, arguments.length, null)
  2784. }
  2785. }), ce.each({Height: "height", Width: "width"}, function (e, n) {
  2786. ce.each({padding: "inner" + e, content: n, "": "outer" + e}, function (r, o) {
  2787. ce.fn[o] = function (o, i) {
  2788. var a = arguments.length && (r || "boolean" != typeof o), s = r || (!0 === o || !0 === i ? "margin" : "border");
  2789. return ce.access(this, function (n, r, o) {
  2790. var i;
  2791. return ce.isWindow(n) ? n.document.documentElement["client" + e] : 9 === n.nodeType ? (i = n.documentElement, Math.max(n.body["scroll" + e], i["scroll" + e], n.body["offset" + e], i["offset" + e], i["client" + e])) : o === t ? ce.css(n, r, s) : ce.style(n, r, o, s)
  2792. }, n, a ? o : t, a, null)
  2793. }
  2794. })
  2795. }), ce.fn.size = function () {
  2796. return this.length
  2797. }, ce.fn.andSelf = ce.fn.addBack, "object" == typeof module && module && "object" == typeof module.exports ? module.exports = ce : (e.jQuery = e.$ = ce, "function" == typeof define && define.amd && define("jquery", [], function () {
  2798. return ce
  2799. }))
  2800. }(window), function (e) {
  2801. "use strict";
  2802. function t() {
  2803. function e(r) {
  2804. var o = this;
  2805. return o instanceof e ? (r instanceof e ? (o.s = r.s, o.e = r.e, o.c = r.c.slice()) : n(o, r), void(o.constructor = e)) : r === m ? t() : new e(r)
  2806. }
  2807. return e.prototype = g, e.DP = a, e.RM = s, e.NE = c, e.PE = u, e.version = "5.0.2", e
  2808. }
  2809. function n(e, t) {
  2810. var n, r, o;
  2811. if (0 === t && 0 > 1 / t) t = "-0"; else if (!v.test(t += "")) throw Error(d + "number");
  2812. for (e.s = "-" == t.charAt(0) ? (t = t.slice(1), -1) : 1, (n = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (r = t.search(/e/i)) > 0 ? (0 > n && (n = r), n += +t.slice(r + 1), t = t.substring(0, r)) : 0 > n && (n = t.length), o = t.length, r = 0; o > r && "0" == t.charAt(r);) ++r;
  2813. if (r == o) e.c = [e.e = 0]; else {
  2814. for (; o > 0 && "0" == t.charAt(--o);) ;
  2815. for (e.e = n - r - 1, e.c = [], n = 0; o >= r;) e.c[n++] = +t.charAt(r++)
  2816. }
  2817. return e
  2818. }
  2819. function r(e, t, n, r) {
  2820. var o = e.c, i = e.e + t + 1;
  2821. if (1 === n) r = o[i] >= 5; else if (2 === n) r = o[i] > 5 || 5 == o[i] && (r || 0 > i || o[i + 1] !== m || 1 & o[i - 1]); else if (3 === n) r = r || o[i] !== m || 0 > i; else if (r = !1, 0 !== n) throw Error(d + "rounding mode");
  2822. if (1 > i || !o[0]) o.length = 1, r ? (e.e = -t, o[0] = 1) : o[0] = e.e = 0; else {
  2823. if (o.length = i--, r) for (; ++o[i] > 9;) o[i] = 0, i-- || (++e.e, o.unshift(1));
  2824. for (i = o.length; !o[--i];) o.pop()
  2825. }
  2826. return e
  2827. }
  2828. function o(e, t, n, o) {
  2829. var i, a, s = e.constructor, c = !e.c[0];
  2830. if (n !== m) {
  2831. if (n !== ~~n || (3 == t) > n || n > l) throw Error(3 == t ? d + "precision" : p);
  2832. for (n = o - (e = new s(e)).e, e.c.length > ++o && r(e, n, s.RM), 2 == t && (o = e.e + n + 1); e.c.length < o;) e.c.push(0)
  2833. }
  2834. if (i = e.e, a = e.c.join(""), n = a.length, 2 != t && (1 == t || 3 == t && i >= o || i <= s.NE || i >= s.PE)) a = a.charAt(0) + (n > 1 ? "." + a.slice(1) : "") + (0 > i ? "e" : "e+") + i; else if (0 > i) {
  2835. for (; ++i;) a = "0" + a;
  2836. a = "0." + a
  2837. } else if (i > 0) if (++i > n) for (i -= n; i--;) a += "0"; else n > i && (a = a.slice(0, i) + "." + a.slice(i)); else n > 1 && (a = a.charAt(0) + "." + a.slice(1));
  2838. return e.s < 0 && (!c || 4 == t) ? "-" + a : a
  2839. }
  2840. var i, a = 20, s = 1, l = 1e6, c = -7, u = 21, f = "[big.js] ", d = f + "Invalid ", p = d + "decimal places",
  2841. h = f + "Division by zero", g = {}, m = void 0, v = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
  2842. g.abs = function () {
  2843. var e = new this.constructor(this);
  2844. return e.s = 1, e
  2845. }, g.cmp = function (e) {
  2846. var t, n = this, r = n.c, o = (e = new n.constructor(e)).c, i = n.s, a = e.s, s = n.e, l = e.e;
  2847. if (!r[0] || !o[0]) return r[0] ? i : o[0] ? -a : 0;
  2848. if (i != a) return i;
  2849. if (t = 0 > i, s != l) return s > l ^ t ? 1 : -1;
  2850. for (a = (s = r.length) < (l = o.length) ? s : l, i = -1; ++i < a;) if (r[i] != o[i]) return r[i] > o[i] ^ t ? 1 : -1;
  2851. return s == l ? 0 : s > l ^ t ? 1 : -1
  2852. }, g.div = function (e) {
  2853. var t = this, n = t.constructor, o = t.c, i = (e = new n(e)).c, a = t.s == e.s ? 1 : -1, s = n.DP;
  2854. if (s !== ~~s || 0 > s || s > l) throw Error(p);
  2855. if (!i[0]) throw Error(h);
  2856. if (!o[0]) return new n(0 * a);
  2857. var c, u, f, d, g, v = i.slice(), b = c = i.length, y = o.length, x = o.slice(0, c), w = x.length, $ = e,
  2858. k = $.c = [], T = 0, S = s + ($.e = t.e - e.e) + 1;
  2859. for ($.s = a, a = 0 > S ? 0 : S, v.unshift(0); w++ < c;) x.push(0);
  2860. do {
  2861. for (f = 0; 10 > f; f++) {
  2862. if (c != (w = x.length)) d = c > w ? 1 : -1; else for (g = -1, d = 0; ++g < c;) if (i[g] != x[g]) {
  2863. d = i[g] > x[g] ? 1 : -1;
  2864. break
  2865. }
  2866. if (!(0 > d)) break;
  2867. for (u = w == c ? i : v; w;) {
  2868. if (x[--w] < u[w]) {
  2869. for (g = w; g && !x[--g];) x[g] = 9;
  2870. --x[g], x[w] += 10
  2871. }
  2872. x[w] -= u[w]
  2873. }
  2874. for (; !x[0];) x.shift()
  2875. }
  2876. k[T++] = d ? f : ++f, x[0] && d ? x[w] = o[b] || 0 : x = [o[b]]
  2877. } while ((b++ < y || x[0] !== m) && a--);
  2878. return k[0] || 1 == T || (k.shift(), $.e--), T > S && r($, s, n.RM, x[0] !== m), $
  2879. }, g.eq = function (e) {
  2880. return !this.cmp(e)
  2881. }, g.gt = function (e) {
  2882. return this.cmp(e) > 0
  2883. }, g.gte = function (e) {
  2884. return this.cmp(e) > -1
  2885. }, g.lt = function (e) {
  2886. return this.cmp(e) < 0
  2887. }, g.lte = function (e) {
  2888. return this.cmp(e) < 1
  2889. }, g.minus = g.sub = function (e) {
  2890. var t, n, r, o, i = this, a = i.constructor, s = i.s, l = (e = new a(e)).s;
  2891. if (s != l) return e.s = -l, i.plus(e);
  2892. var c = i.c.slice(), u = i.e, f = e.c, d = e.e;
  2893. if (!c[0] || !f[0]) return f[0] ? (e.s = -l, e) : new a(c[0] ? i : 0);
  2894. if (s = u - d) {
  2895. for ((o = 0 > s) ? (s = -s, r = c) : (d = u, r = f), r.reverse(), l = s; l--;) r.push(0);
  2896. r.reverse()
  2897. } else for (n = ((o = c.length < f.length) ? c : f).length, s = l = 0; n > l; l++) if (c[l] != f[l]) {
  2898. o = c[l] < f[l];
  2899. break
  2900. }
  2901. if (o && (r = c, c = f, f = r, e.s = -e.s), (l = (n = f.length) - (t = c.length)) > 0) for (; l--;) c[t++] = 0;
  2902. for (l = t; n > s;) {
  2903. if (c[--n] < f[n]) {
  2904. for (t = n; t && !c[--t];) c[t] = 9;
  2905. --c[t], c[n] += 10
  2906. }
  2907. c[n] -= f[n]
  2908. }
  2909. for (; 0 === c[--l];) c.pop();
  2910. for (; 0 === c[0];) c.shift(), --d;
  2911. return c[0] || (e.s = 1, c = [d = 0]), e.c = c, e.e = d, e
  2912. }, g.mod = function (e) {
  2913. var t, n = this, r = n.constructor, o = n.s, i = (e = new r(e)).s;
  2914. if (!e.c[0]) throw Error(h);
  2915. return n.s = e.s = 1, t = 1 == e.cmp(n), n.s = o, e.s = i, t ? new r(n) : (o = r.DP, i = r.RM, r.DP = r.RM = 0, n = n.div(e), r.DP = o, r.RM = i, this.minus(n.times(e)))
  2916. }, g.plus = g.add = function (e) {
  2917. var t, n = this, r = n.constructor, o = n.s, i = (e = new r(e)).s;
  2918. if (o != i) return e.s = -i, n.minus(e);
  2919. var a = n.e, s = n.c, l = e.e, c = e.c;
  2920. if (!s[0] || !c[0]) return c[0] ? e : new r(s[0] ? n : 0 * o);
  2921. if (s = s.slice(), o = a - l) {
  2922. for (o > 0 ? (l = a, t = c) : (o = -o, t = s), t.reverse(); o--;) t.push(0);
  2923. t.reverse()
  2924. }
  2925. for (s.length - c.length < 0 && (t = c, c = s, s = t), o = c.length, i = 0; o; s[o] %= 10) i = (s[--o] = s[o] + c[o] + i) / 10 | 0;
  2926. for (i && (s.unshift(i), ++l), o = s.length; 0 === s[--o];) s.pop();
  2927. return e.c = s, e.e = l, e
  2928. }, g.pow = function (e) {
  2929. var t = this, n = new t.constructor(1), r = n, o = 0 > e;
  2930. if (e !== ~~e || -1e6 > e || e > 1e6) throw Error(d + "exponent");
  2931. for (o && (e = -e); 1 & e && (r = r.times(t)), e >>= 1;) t = t.times(t);
  2932. return o ? n.div(r) : r
  2933. }, g.round = function (e, t) {
  2934. var n = this.constructor;
  2935. if (e === m) e = 0; else if (e !== ~~e || 0 > e || e > l) throw Error(p);
  2936. return r(new n(this), e, t === m ? n.RM : t)
  2937. }, g.sqrt = function () {
  2938. var e, t, n, o = this, i = o.constructor, a = o.s, s = o.e, l = new i(.5);
  2939. if (!o.c[0]) return new i(o);
  2940. if (0 > a) throw Error(f + "No square root");
  2941. 0 === (a = Math.sqrt(o.toString())) || a === 1 / 0 ? ((t = o.c.join("")).length + s & 1 || (t += "0"), e = new i(Math.sqrt(t).toString()), e.e = ((s + 1) / 2 | 0) - (0 > s || 1 & s)) : e = new i(a.toString()), s = e.e + (i.DP += 4);
  2942. do {
  2943. n = e, e = l.times(n.plus(o.div(n)))
  2944. } while (n.c.slice(0, s).join("") !== e.c.slice(0, s).join(""));
  2945. return r(e, i.DP -= 4, i.RM)
  2946. }, g.times = g.mul = function (e) {
  2947. var t, n = this, r = n.constructor, o = n.c, i = (e = new r(e)).c, a = o.length, s = i.length, l = n.e, c = e.e;
  2948. if (e.s = n.s == e.s ? 1 : -1, !o[0] || !i[0]) return new r(0 * e.s);
  2949. for (e.e = l + c, s > a && (t = o, o = i, i = t, c = a, a = s, s = c), t = new Array(c = a + s); c--;) t[c] = 0;
  2950. for (l = s; l--;) {
  2951. for (s = 0, c = a + l; c > l;) s = t[c] + i[l] * o[c - l - 1] + s, t[c--] = s % 10, s = s / 10 | 0;
  2952. t[c] = (t[c] + s) % 10
  2953. }
  2954. for (s ? ++e.e : t.shift(), l = t.length; !t[--l];) t.pop();
  2955. return e.c = t, e
  2956. }, g.toExponential = function (e) {
  2957. return o(this, 1, e, e)
  2958. }, g.toFixed = function (e) {
  2959. return o(this, 2, e, this.e + e)
  2960. }, g.toPrecision = function (e) {
  2961. return o(this, 3, e, e - 1)
  2962. }, g.toString = function () {
  2963. return o(this)
  2964. }, g.valueOf = g.toJSON = function () {
  2965. return o(this, 4)
  2966. }, (i = t()).default = i.Big = i, "function" == typeof define && define.amd ? define(function () {
  2967. return i
  2968. }) : "undefined" != typeof module && module.exports ? module.exports = i : e.Big = i
  2969. }(this), function (e) {
  2970. "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? module.exports = e : e(jQuery)
  2971. }(function (e) {
  2972. function t(t) {
  2973. var o, i = t || window.event, a = [].slice.call(arguments, 1), s = 0, l = 0, c = 0, u = 0, f = 0;
  2974. return t = e.event.fix(i), t.type = "mousewheel", i.wheelDelta && (s = i.wheelDelta), i.detail && (s = -1 * i.detail), i.deltaY && (s = c = -1 * i.deltaY), i.deltaX && (s = -1 * (l = i.deltaX)), void 0 !== i.wheelDeltaY && (c = i.wheelDeltaY), void 0 !== i.wheelDeltaX && (l = -1 * i.wheelDeltaX), u = Math.abs(s), (!n || u < n) && (n = u), f = Math.max(Math.abs(c), Math.abs(l)), (!r || f < r) && (r = f), o = s > 0 ? "floor" : "ceil", s = Math[o](s / n), l = Math[o](l / r), c = Math[o](c / r), a.unshift(t, s, l, c), (e.event.dispatch || e.event.handle).apply(this, a)
  2975. }
  2976. var n, r, o = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"],
  2977. i = "onwheel" in document || document.documentMode >= 9 ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"];
  2978. if (e.event.fixHooks) for (var a = o.length; a;) e.event.fixHooks[o[--a]] = e.event.mouseHooks;
  2979. e.event.special.mousewheel = {
  2980. setup: function () {
  2981. if (this.addEventListener) for (var e = i.length; e;) this.addEventListener(i[--e], t, !1); else this.onmousewheel = t
  2982. }, teardown: function () {
  2983. if (this.removeEventListener) for (var e = i.length; e;) this.removeEventListener(i[--e], t, !1); else this.onmousewheel = null
  2984. }
  2985. }, e.fn.extend({
  2986. mousewheel: function (e) {
  2987. return e ? this.bind("mousewheel", e) : this.trigger("mousewheel")
  2988. }, unmousewheel: function (e) {
  2989. return this.unbind("mousewheel", e)
  2990. }
  2991. })
  2992. }), function (e) {
  2993. var t = function () {
  2994. var t = 65, n = {
  2995. eventName: "click", onShow: function () {
  2996. }, onBeforeShow: function () {
  2997. }, onHide: function () {
  2998. }, onChange: function () {
  2999. }, onSubmit: function () {
  3000. }, color: "ff0000", livePreview: !0, flat: !1
  3001. }, r = function (t, n) {
  3002. var r = L(t);
  3003. e(n).data("colorpicker").fields.eq(1).val(r.r).end().eq(2).val(r.g).end().eq(3).val(r.b).end()
  3004. }, o = function (t, n) {
  3005. e(n).data("colorpicker").fields.eq(4).val(t.h).end().eq(5).val(t.s).end().eq(6).val(t.b).end()
  3006. }, i = function (t, n) {
  3007. e(n).data("colorpicker").fields.eq(0).val(B(t)).end()
  3008. }, a = function (t, n) {
  3009. e(n).data("colorpicker").selector.css("backgroundColor", "#" + B({
  3010. h: t.h,
  3011. s: 100,
  3012. b: 100
  3013. })), e(n).data("colorpicker").selectorIndic.css({
  3014. left: parseInt(150 * t.s / 100, 10),
  3015. top: parseInt(150 * (100 - t.b) / 100, 10)
  3016. })
  3017. }, s = function (t, n) {
  3018. e(n).data("colorpicker").hue.css("top", parseInt(150 - 150 * t.h / 360, 10))
  3019. }, l = function (t, n) {
  3020. e(n).data("colorpicker").currentColor.css("backgroundColor", "#" + B(t))
  3021. }, c = function (t, n) {
  3022. e(n).data("colorpicker").newColor.css("backgroundColor", "#" + B(t))
  3023. }, u = function (n) {
  3024. var r = n.charCode || n.keyCode || -1;
  3025. if (r > t && r <= 90 || 32 == r) return !1;
  3026. !0 === e(this).parent().parent().data("colorpicker").livePreview && f.apply(this)
  3027. }, f = function (t) {
  3028. var n, l = e(this).parent().parent();
  3029. this.parentNode.className.indexOf("_hex") > 0 ? l.data("colorpicker").color = n = M(D(this.value)) : this.parentNode.className.indexOf("_hsb") > 0 ? l.data("colorpicker").color = n = P({
  3030. h: parseInt(l.data("colorpicker").fields.eq(4).val(), 10),
  3031. s: parseInt(l.data("colorpicker").fields.eq(5).val(), 10),
  3032. b: parseInt(l.data("colorpicker").fields.eq(6).val(), 10)
  3033. }) : l.data("colorpicker").color = n = _(O({
  3034. r: parseInt(l.data("colorpicker").fields.eq(1).val(), 10),
  3035. g: parseInt(l.data("colorpicker").fields.eq(2).val(), 10),
  3036. b: parseInt(l.data("colorpicker").fields.eq(3).val(), 10)
  3037. })), t && (r(n, l.get(0)), i(n, l.get(0)), o(n, l.get(0))), a(n, l.get(0)), s(n, l.get(0)), c(n, l.get(0)), l.data("colorpicker").onChange.apply(l, [n, B(n), L(n)])
  3038. }, d = function (t) {
  3039. e(this).parent().parent().data("colorpicker").fields.parent().removeClass("colorpicker_focus")
  3040. }, p = function () {
  3041. t = this.parentNode.className.indexOf("_hex") > 0 ? 70 : 65, e(this).parent().parent().data("colorpicker").fields.parent().removeClass("colorpicker_focus"), e(this).parent().addClass("colorpicker_focus")
  3042. }, h = function (t) {
  3043. var n = e(this).parent().find("input").focus(), r = {
  3044. el: e(this).parent().addClass("colorpicker_slider"),
  3045. max: this.parentNode.className.indexOf("_hsb_h") > 0 ? 360 : this.parentNode.className.indexOf("_hsb") > 0 ? 100 : 255,
  3046. y: t.pageY,
  3047. field: n,
  3048. val: parseInt(n.val(), 10),
  3049. preview: e(this).parent().parent().data("colorpicker").livePreview
  3050. };
  3051. e(document).bind("mouseup", r, m), e(document).bind("mousemove", r, g)
  3052. }, g = function (e) {
  3053. return e.data.field.val(Math.max(0, Math.min(e.data.max, parseInt(e.data.val + e.pageY - e.data.y, 10)))), e.data.preview && f.apply(e.data.field.get(0), [!0]), !1
  3054. }, m = function (t) {
  3055. return f.apply(t.data.field.get(0), [!0]), t.data.el.removeClass("colorpicker_slider").find("input").focus(), e(document).unbind("mouseup", m), e(document).unbind("mousemove", g), !1
  3056. }, v = function (t) {
  3057. var n = {cal: e(this).parent(), y: e(this).offset().top};
  3058. n.preview = n.cal.data("colorpicker").livePreview, e(document).bind("mouseup", n, y), e(document).bind("mousemove", n, b)
  3059. }, b = function (e) {
  3060. return f.apply(e.data.cal.data("colorpicker").fields.eq(4).val(parseInt(360 * (150 - Math.max(0, Math.min(150, e.pageY - e.data.y))) / 150, 10)).get(0), [e.data.preview]), !1
  3061. }, y = function (t) {
  3062. return r(t.data.cal.data("colorpicker").color, t.data.cal.get(0)), i(t.data.cal.data("colorpicker").color, t.data.cal.get(0)), e(document).unbind("mouseup", y), e(document).unbind("mousemove", b), !1
  3063. }, x = function (t) {
  3064. var n = {cal: e(this).parent(), pos: e(this).offset()};
  3065. n.preview = n.cal.data("colorpicker").livePreview, e(document).bind("mouseup", n, $), e(document).bind("mousemove", n, w)
  3066. }, w = function (e) {
  3067. return f.apply(e.data.cal.data("colorpicker").fields.eq(6).val(parseInt(100 * (150 - Math.max(0, Math.min(150, e.pageY - e.data.pos.top))) / 150, 10)).end().eq(5).val(parseInt(100 * Math.max(0, Math.min(150, e.pageX - e.data.pos.left)) / 150, 10)).get(0), [e.data.preview]), !1
  3068. }, $ = function (t) {
  3069. return r(t.data.cal.data("colorpicker").color, t.data.cal.get(0)), i(t.data.cal.data("colorpicker").color, t.data.cal.get(0)), e(document).unbind("mouseup", $), e(document).unbind("mousemove", w), !1
  3070. }, k = function (t) {
  3071. e(this).addClass("colorpicker_focus")
  3072. }, T = function (t) {
  3073. e(this).removeClass("colorpicker_focus")
  3074. }, S = function (t) {
  3075. var n = e(this).parent(), r = n.data("colorpicker").color;
  3076. n.data("colorpicker").origColor = r, l(r, n.get(0)), n.data("colorpicker").onSubmit(r, B(r), L(r), n.data("colorpicker").el)
  3077. }, C = function (t) {
  3078. var n = e("#" + e(this).data("colorpickerId"));
  3079. n.data("colorpicker").onBeforeShow.apply(this, [n.get(0)]);
  3080. var r = e(this).offset(), o = N(), i = r.top + this.offsetHeight, a = r.left;
  3081. return i + 176 > o.t + o.h && (i -= this.offsetHeight + 176), a + 356 > o.l + o.w && (a -= 356), n.css({
  3082. left: a + "px",
  3083. top: i + "px"
  3084. }), 0 != n.data("colorpicker").onShow.apply(this, [n.get(0)]) && n.show(), e(document).bind("mousedown", {cal: n}, E), !1
  3085. }, E = function (t) {
  3086. A(t.data.cal.get(0), t.target, t.data.cal.get(0)) || (0 != t.data.cal.data("colorpicker").onHide.apply(this, [t.data.cal.get(0)]) && t.data.cal.hide(), e(document).unbind("mousedown", E))
  3087. }, A = function (e, t, n) {
  3088. if (e == t) return !0;
  3089. if (e.contains) return e.contains(t);
  3090. if (e.compareDocumentPosition) return !!(16 & e.compareDocumentPosition(t));
  3091. for (var r = t.parentNode; r && r != n;) {
  3092. if (r == e) return !0;
  3093. r = r.parentNode
  3094. }
  3095. return !1
  3096. }, N = function () {
  3097. var e = "CSS1Compat" == document.compatMode;
  3098. return {
  3099. l: window.pageXOffset || (e ? document.documentElement.scrollLeft : document.body.scrollLeft),
  3100. t: window.pageYOffset || (e ? document.documentElement.scrollTop : document.body.scrollTop),
  3101. w: window.innerWidth || (e ? document.documentElement.clientWidth : document.body.clientWidth),
  3102. h: window.innerHeight || (e ? document.documentElement.clientHeight : document.body.clientHeight)
  3103. }
  3104. }, P = function (e) {
  3105. return {
  3106. h: Math.min(360, Math.max(0, e.h)),
  3107. s: Math.min(100, Math.max(0, e.s)),
  3108. b: Math.min(100, Math.max(0, e.b))
  3109. }
  3110. }, O = function (e) {
  3111. return {
  3112. r: Math.min(255, Math.max(0, e.r)),
  3113. g: Math.min(255, Math.max(0, e.g)),
  3114. b: Math.min(255, Math.max(0, e.b))
  3115. }
  3116. }, D = function (e) {
  3117. var t = 6 - e.length;
  3118. if (t > 0) {
  3119. for (var n = [], r = 0; r < t; r++) n.push("0");
  3120. n.push(e), e = n.join("")
  3121. }
  3122. return e
  3123. }, I = function (e) {
  3124. return {r: (e = parseInt(e.indexOf("#") > -1 ? e.substring(1) : e, 16)) >> 16, g: (65280 & e) >> 8, b: 255 & e}
  3125. }, M = function (e) {
  3126. return _(I(e))
  3127. }, _ = function (e) {
  3128. var t = {h: 0, s: 0, b: 0}, n = Math.min(e.r, e.g, e.b), r = Math.max(e.r, e.g, e.b), o = r - n;
  3129. return t.b = r, t.s = 0 != r ? 255 * o / r : 0, 0 != t.s ? e.r == r ? t.h = (e.g - e.b) / o : e.g == r ? t.h = 2 + (e.b - e.r) / o : t.h = 4 + (e.r - e.g) / o : t.h = -1, t.h *= 60, t.h < 0 && (t.h += 360), t.s *= 100 / 255, t.b *= 100 / 255, t
  3130. }, L = function (e) {
  3131. var t = {}, n = Math.round(e.h), r = Math.round(255 * e.s / 100), o = Math.round(255 * e.b / 100);
  3132. if (0 == r) t.r = t.g = t.b = o; else {
  3133. var i = o, a = (255 - r) * o / 255, s = n % 60 * (i - a) / 60;
  3134. 360 == n && (n = 0), n < 60 ? (t.r = i, t.b = a, t.g = a + s) : n < 120 ? (t.g = i, t.b = a, t.r = i - s) : n < 180 ? (t.g = i, t.r = a, t.b = a + s) : n < 240 ? (t.b = i, t.r = a, t.g = i - s) : n < 300 ? (t.b = i, t.g = a, t.r = a + s) : n < 360 ? (t.r = i, t.g = a, t.b = i - s) : (t.r = 0, t.g = 0, t.b = 0)
  3135. }
  3136. return {r: Math.round(t.r), g: Math.round(t.g), b: Math.round(t.b)}
  3137. }, F = function (t) {
  3138. var n = [t.r.toString(16), t.g.toString(16), t.b.toString(16)];
  3139. return e.each(n, function (e, t) {
  3140. 1 == t.length && (n[e] = "0" + t)
  3141. }), n.join("")
  3142. }, B = function (e) {
  3143. return F(L(e))
  3144. }, R = function () {
  3145. var t = e(this).parent(), n = t.data("colorpicker").origColor;
  3146. t.data("colorpicker").color = n, r(n, t.get(0)), i(n, t.get(0)), o(n, t.get(0)), a(n, t.get(0)), s(n, t.get(0)), c(n, t.get(0))
  3147. };
  3148. return {
  3149. init: function (t) {
  3150. if ("string" == typeof(t = e.extend({}, n, t || {})).color) t.color = M(t.color); else if (void 0 != t.color.r && void 0 != t.color.g && void 0 != t.color.b) t.color = _(t.color); else {
  3151. if (void 0 == t.color.h || void 0 == t.color.s || void 0 == t.color.b) return this;
  3152. t.color = P(t.color)
  3153. }
  3154. return this.each(function () {
  3155. if (!e(this).data("colorpickerId")) {
  3156. var n = e.extend({}, t);
  3157. n.origColor = t.color;
  3158. var g = "collorpicker_" + parseInt(1e3 * Math.random());
  3159. e(this).data("colorpickerId", g);
  3160. var m = e('<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>').attr("id", g);
  3161. n.flat ? m.appendTo(this).show() : m.appendTo(document.body), n.fields = m.find("input").bind("keyup", u).bind("change", f).bind("blur", d).bind("focus", p), m.find("span").bind("mousedown", h).end().find(">div.colorpicker_current_color").bind("click", R), n.selector = m.find("div.colorpicker_color").bind("mousedown", x), n.selectorIndic = n.selector.find("div div"), n.el = this, n.hue = m.find("div.colorpicker_hue div"), m.find("div.colorpicker_hue").bind("mousedown", v), n.newColor = m.find("div.colorpicker_new_color"), n.currentColor = m.find("div.colorpicker_current_color"), m.data("colorpicker", n), m.find("div.colorpicker_submit").bind("mouseenter", k).bind("mouseleave", T).bind("click", S), r(n.color, m.get(0)), o(n.color, m.get(0)), i(n.color, m.get(0)), s(n.color, m.get(0)), a(n.color, m.get(0)), l(n.color, m.get(0)), c(n.color, m.get(0)), n.flat ? m.css({
  3162. position: "relative",
  3163. display: "block"
  3164. }) : e(this).bind(n.eventName, C)
  3165. }
  3166. })
  3167. }, showPicker: function () {
  3168. return this.each(function () {
  3169. e(this).data("colorpickerId") && C.apply(this)
  3170. })
  3171. }, hidePicker: function () {
  3172. return this.each(function () {
  3173. e(this).data("colorpickerId") && e("#" + e(this).data("colorpickerId")).hide()
  3174. })
  3175. }, setColor: function (t) {
  3176. if ("string" == typeof t) t = M(t); else if (void 0 != t.r && void 0 != t.g && void 0 != t.b) t = _(t); else {
  3177. if (void 0 == t.h || void 0 == t.s || void 0 == t.b) return this;
  3178. t = P(t)
  3179. }
  3180. return this.each(function () {
  3181. if (e(this).data("colorpickerId")) {
  3182. var n = e("#" + e(this).data("colorpickerId"));
  3183. n.data("colorpicker").color = t, n.data("colorpicker").origColor = t, r(t, n.get(0)), o(t, n.get(0)), i(t, n.get(0)), s(t, n.get(0)), a(t, n.get(0)), l(t, n.get(0)), c(t, n.get(0))
  3184. }
  3185. })
  3186. }
  3187. }
  3188. }();
  3189. e.fn.extend({
  3190. ColorPicker: t.init,
  3191. ColorPickerHide: t.hidePicker,
  3192. ColorPickerShow: t.showPicker,
  3193. ColorPickerSetColor: t.setColor,
  3194. ColorPicker: t.init,
  3195. ColorPickerHide: t.hidePicker,
  3196. ColorPickerShow: t.showPicker,
  3197. ColorPickerSetColor: t.setColor
  3198. })
  3199. }(jQuery), function (e) {
  3200. var t = function (e, t) {
  3201. return e << t | e >>> 32 - t
  3202. }, n = function (e, t) {
  3203. var n, r, o, i, a;
  3204. return o = 2147483648 & e, i = 2147483648 & t, n = 1073741824 & e, r = 1073741824 & t, a = (1073741823 & e) + (1073741823 & t), n & r ? 2147483648 ^ a ^ o ^ i : n | r ? 1073741824 & a ? 3221225472 ^ a ^ o ^ i : 1073741824 ^ a ^ o ^ i : a ^ o ^ i
  3205. }, r = function (e, t, n) {
  3206. return e & t | ~e & n
  3207. }, o = function (e, t, n) {
  3208. return e & n | t & ~n
  3209. }, i = function (e, t, n) {
  3210. return e ^ t ^ n
  3211. }, a = function (e, t, n) {
  3212. return t ^ (e | ~n)
  3213. }, s = function (e, o, i, a, s, l, c) {
  3214. return e = n(e, n(n(r(o, i, a), s), c)), n(t(e, l), o)
  3215. }, l = function (e, r, i, a, s, l, c) {
  3216. return e = n(e, n(n(o(r, i, a), s), c)), n(t(e, l), r)
  3217. }, c = function (e, r, o, a, s, l, c) {
  3218. return e = n(e, n(n(i(r, o, a), s), c)), n(t(e, l), r)
  3219. }, u = function (e, r, o, i, s, l, c) {
  3220. return e = n(e, n(n(a(r, o, i), s), c)), n(t(e, l), r)
  3221. }, f = function (e) {
  3222. for (var t, n = e.length, r = n + 8, o = 16 * ((r - r % 64) / 64 + 1), i = Array(o - 1), a = 0, s = 0; s < n;) a = s % 4 * 8, i[t = (s - s % 4) / 4] = i[t] | e.charCodeAt(s) << a, s++;
  3223. return t = (s - s % 4) / 4, a = s % 4 * 8, i[t] = i[t] | 128 << a, i[o - 2] = n << 3, i[o - 1] = n >>> 29, i
  3224. }, d = function (e) {
  3225. var t, n = "", r = "";
  3226. for (t = 0; t <= 3; t++) n += (r = "0" + (e >>> 8 * t & 255).toString(16)).substr(r.length - 2, 2);
  3227. return n
  3228. }, p = function (e) {
  3229. e = e.replace(/\x0d\x0a/g, "\n");
  3230. for (var t = "", n = 0; n < e.length; n++) {
  3231. var r = e.charCodeAt(n);
  3232. r < 128 ? t += String.fromCharCode(r) : r > 127 && r < 2048 ? (t += String.fromCharCode(r >> 6 | 192), t += String.fromCharCode(63 & r | 128)) : (t += String.fromCharCode(r >> 12 | 224), t += String.fromCharCode(r >> 6 & 63 | 128), t += String.fromCharCode(63 & r | 128))
  3233. }
  3234. return t
  3235. };
  3236. jQuery.extend({
  3237. md5: function (e) {
  3238. var t, r, o, i, a, h, g, m, v, b = Array();
  3239. for (e = p(e), b = f(e), h = 1732584193, g = 4023233417, m = 2562383102, v = 271733878, t = 0; t < b.length; t += 16) r = h, o = g, i = m, a = v, h = s(h, g, m, v, b[t + 0], 7, 3614090360), v = s(v, h, g, m, b[t + 1], 12, 3905402710), m = s(m, v, h, g, b[t + 2], 17, 606105819), g = s(g, m, v, h, b[t + 3], 22, 3250441966), h = s(h, g, m, v, b[t + 4], 7, 4118548399), v = s(v, h, g, m, b[t + 5], 12, 1200080426), m = s(m, v, h, g, b[t + 6], 17, 2821735955), g = s(g, m, v, h, b[t + 7], 22, 4249261313), h = s(h, g, m, v, b[t + 8], 7, 1770035416), v = s(v, h, g, m, b[t + 9], 12, 2336552879), m = s(m, v, h, g, b[t + 10], 17, 4294925233), g = s(g, m, v, h, b[t + 11], 22, 2304563134), h = s(h, g, m, v, b[t + 12], 7, 1804603682), v = s(v, h, g, m, b[t + 13], 12, 4254626195), m = s(m, v, h, g, b[t + 14], 17, 2792965006), g = s(g, m, v, h, b[t + 15], 22, 1236535329), h = l(h, g, m, v, b[t + 1], 5, 4129170786), v = l(v, h, g, m, b[t + 6], 9, 3225465664), m = l(m, v, h, g, b[t + 11], 14, 643717713), g = l(g, m, v, h, b[t + 0], 20, 3921069994), h = l(h, g, m, v, b[t + 5], 5, 3593408605), v = l(v, h, g, m, b[t + 10], 9, 38016083), m = l(m, v, h, g, b[t + 15], 14, 3634488961), g = l(g, m, v, h, b[t + 4], 20, 3889429448), h = l(h, g, m, v, b[t + 9], 5, 568446438), v = l(v, h, g, m, b[t + 14], 9, 3275163606), m = l(m, v, h, g, b[t + 3], 14, 4107603335), g = l(g, m, v, h, b[t + 8], 20, 1163531501), h = l(h, g, m, v, b[t + 13], 5, 2850285829), v = l(v, h, g, m, b[t + 2], 9, 4243563512), m = l(m, v, h, g, b[t + 7], 14, 1735328473), g = l(g, m, v, h, b[t + 12], 20, 2368359562), h = c(h, g, m, v, b[t + 5], 4, 4294588738), v = c(v, h, g, m, b[t + 8], 11, 2272392833), m = c(m, v, h, g, b[t + 11], 16, 1839030562), g = c(g, m, v, h, b[t + 14], 23, 4259657740), h = c(h, g, m, v, b[t + 1], 4, 2763975236), v = c(v, h, g, m, b[t + 4], 11, 1272893353), m = c(m, v, h, g, b[t + 7], 16, 4139469664), g = c(g, m, v, h, b[t + 10], 23, 3200236656), h = c(h, g, m, v, b[t + 13], 4, 681279174), v = c(v, h, g, m, b[t + 0], 11, 3936430074), m = c(m, v, h, g, b[t + 3], 16, 3572445317), g = c(g, m, v, h, b[t + 6], 23, 76029189), h = c(h, g, m, v, b[t + 9], 4, 3654602809), v = c(v, h, g, m, b[t + 12], 11, 3873151461), m = c(m, v, h, g, b[t + 15], 16, 530742520), g = c(g, m, v, h, b[t + 2], 23, 3299628645), h = u(h, g, m, v, b[t + 0], 6, 4096336452), v = u(v, h, g, m, b[t + 7], 10, 1126891415), m = u(m, v, h, g, b[t + 14], 15, 2878612391), g = u(g, m, v, h, b[t + 5], 21, 4237533241), h = u(h, g, m, v, b[t + 12], 6, 1700485571), v = u(v, h, g, m, b[t + 3], 10, 2399980690), m = u(m, v, h, g, b[t + 10], 15, 4293915773), g = u(g, m, v, h, b[t + 1], 21, 2240044497), h = u(h, g, m, v, b[t + 8], 6, 1873313359), v = u(v, h, g, m, b[t + 15], 10, 4264355552), m = u(m, v, h, g, b[t + 6], 15, 2734768916), g = u(g, m, v, h, b[t + 13], 21, 1309151649), h = u(h, g, m, v, b[t + 4], 6, 4149444226), v = u(v, h, g, m, b[t + 11], 10, 3174756917), m = u(m, v, h, g, b[t + 2], 15, 718787259), g = u(g, m, v, h, b[t + 9], 21, 3951481745), h = n(h, r), g = n(g, o), m = n(m, i), v = n(v, a);
  3240. return (d(h) + d(g) + d(m) + d(v)).toLowerCase()
  3241. }
  3242. })
  3243. }(), function (e, t, n) {
  3244. "use strict";
  3245. function r(e) {
  3246. return function () {
  3247. var t, n = arguments[0],
  3248. n = "[" + (e ? e + ":" : "") + n + "] http://errors.angularjs.org/1.2.28/" + (e ? e + "/" : "") + n;
  3249. for (t = 1; t < arguments.length; t++) n = n + (1 == t ? "?" : "&") + "p" + (t - 1) + "=" + encodeURIComponent("function" == typeof arguments[t] ? arguments[t].toString().replace(/ \{[\s\S]*$/, "") : void 0 === arguments[t] ? "undefined" : "string" != typeof arguments[t] ? JSON.stringify(arguments[t]) : arguments[t]);
  3250. return Error(n)
  3251. }
  3252. }
  3253. function o(e) {
  3254. if (null == e || S(e)) return !1;
  3255. var t = e.length;
  3256. return !(1 !== e.nodeType || !t) || (x(e) || on(e) || 0 === t || "number" == typeof t && 0 < t && t - 1 in e)
  3257. }
  3258. function i(e, t, n) {
  3259. var r;
  3260. if (e) if (k(e)) for (r in e) "prototype" == r || "length" == r || "name" == r || e.hasOwnProperty && !e.hasOwnProperty(r) || t.call(n, e[r], r); else if (on(e) || o(e)) for (r = 0; r < e.length; r++) t.call(n, e[r], r); else if (e.forEach && e.forEach !== i) e.forEach(t, n); else for (r in e) e.hasOwnProperty(r) && t.call(n, e[r], r);
  3261. return e
  3262. }
  3263. function a(e) {
  3264. var t, n = [];
  3265. for (t in e) e.hasOwnProperty(t) && n.push(t);
  3266. return n.sort()
  3267. }
  3268. function s(e, t, n) {
  3269. for (var r = a(e), o = 0; o < r.length; o++) t.call(n, e[r[o]], r[o]);
  3270. return r
  3271. }
  3272. function l(e) {
  3273. return function (t, n) {
  3274. e(n, t)
  3275. }
  3276. }
  3277. function c() {
  3278. for (var e, t = rn.length; t;) {
  3279. if (t--, 57 == (e = rn[t].charCodeAt(0))) return rn[t] = "A", rn.join("");
  3280. if (90 != e) return rn[t] = String.fromCharCode(e + 1), rn.join("");
  3281. rn[t] = "0"
  3282. }
  3283. return rn.unshift("0"), rn.join("")
  3284. }
  3285. function u(e, t) {
  3286. t ? e.$$hashKey = t : delete e.$$hashKey
  3287. }
  3288. function f(e) {
  3289. var t = e.$$hashKey;
  3290. return i(arguments, function (t) {
  3291. t !== e && i(t, function (t, n) {
  3292. e[n] = t
  3293. })
  3294. }), u(e, t), e
  3295. }
  3296. function d(e) {
  3297. return parseInt(e, 10)
  3298. }
  3299. function p(e, t) {
  3300. return f(new (f(function () {
  3301. }, {prototype: e})), t)
  3302. }
  3303. function h() {
  3304. }
  3305. function g(e) {
  3306. return e
  3307. }
  3308. function m(e) {
  3309. return function () {
  3310. return e
  3311. }
  3312. }
  3313. function v(e) {
  3314. return void 0 === e
  3315. }
  3316. function b(e) {
  3317. return void 0 !== e
  3318. }
  3319. function y(e) {
  3320. return null != e && "object" == typeof e
  3321. }
  3322. function x(e) {
  3323. return "string" == typeof e
  3324. }
  3325. function w(e) {
  3326. return "number" == typeof e
  3327. }
  3328. function $(e) {
  3329. return "[object Date]" === en.call(e)
  3330. }
  3331. function k(e) {
  3332. return "function" == typeof e
  3333. }
  3334. function T(e) {
  3335. return "[object RegExp]" === en.call(e)
  3336. }
  3337. function S(e) {
  3338. return e && e.document && e.location && e.alert && e.setInterval
  3339. }
  3340. function C(e) {
  3341. return !(!e || !(e.nodeName || e.prop && e.attr && e.find))
  3342. }
  3343. function E(e, t, n) {
  3344. var r = [];
  3345. return i(e, function (e, o, i) {
  3346. r.push(t.call(n, e, o, i))
  3347. }), r
  3348. }
  3349. function A(e, t) {
  3350. if (e.indexOf) return e.indexOf(t);
  3351. for (var n = 0; n < e.length; n++) if (t === e[n]) return n;
  3352. return -1
  3353. }
  3354. function N(e, t) {
  3355. var n = A(e, t);
  3356. return 0 <= n && e.splice(n, 1), t
  3357. }
  3358. function P(e, t, n, r) {
  3359. if (S(e) || e && e.$evalAsync && e.$watch) throw tn("cpws");
  3360. if (t) {
  3361. if (e === t) throw tn("cpi");
  3362. if (n = n || [], r = r || [], y(e)) {
  3363. var o = A(n, e);
  3364. if (-1 !== o) return r[o];
  3365. n.push(e), r.push(t)
  3366. }
  3367. if (on(e)) for (var a = t.length = 0; a < e.length; a++) o = P(e[a], null, n, r), y(e[a]) && (n.push(e[a]), r.push(o)), t.push(o); else {
  3368. var s = t.$$hashKey;
  3369. on(t) ? t.length = 0 : i(t, function (e, n) {
  3370. delete t[n]
  3371. });
  3372. for (a in e) o = P(e[a], null, n, r), y(e[a]) && (n.push(e[a]), r.push(o)), t[a] = o;
  3373. u(t, s)
  3374. }
  3375. } else (t = e) && (on(e) ? t = P(e, [], n, r) : $(e) ? t = new Date(e.getTime()) : T(e) ? (t = RegExp(e.source, e.toString().match(/[^\/]*$/)[0]), t.lastIndex = e.lastIndex) : y(e) && (t = P(e, {}, n, r)));
  3376. return t
  3377. }
  3378. function O(e, t) {
  3379. if (on(e)) {
  3380. t = t || [];
  3381. for (var n = 0; n < e.length; n++) t[n] = e[n]
  3382. } else if (y(e)) for (n in t = t || {}, e) !Kt.call(e, n) || "$" === n.charAt(0) && "$" === n.charAt(1) || (t[n] = e[n]);
  3383. return t || e
  3384. }
  3385. function D(e, t) {
  3386. if (e === t) return !0;
  3387. if (null === e || null === t) return !1;
  3388. if (e != e && t != t) return !0;
  3389. var r, o = typeof e;
  3390. if (o == typeof t && "object" == o) {
  3391. if (!on(e)) {
  3392. if ($(e)) return !!$(t) && (isNaN(e.getTime()) && isNaN(t.getTime()) || e.getTime() === t.getTime());
  3393. if (T(e) && T(t)) return e.toString() == t.toString();
  3394. if (e && e.$evalAsync && e.$watch || t && t.$evalAsync && t.$watch || S(e) || S(t) || on(t)) return !1;
  3395. o = {};
  3396. for (r in e) if ("$" !== r.charAt(0) && !k(e[r])) {
  3397. if (!D(e[r], t[r])) return !1;
  3398. o[r] = !0
  3399. }
  3400. for (r in t) if (!o.hasOwnProperty(r) && "$" !== r.charAt(0) && t[r] !== n && !k(t[r])) return !1;
  3401. return !0
  3402. }
  3403. if (!on(t)) return !1;
  3404. if ((o = e.length) == t.length) {
  3405. for (r = 0; r < o; r++) if (!D(e[r], t[r])) return !1;
  3406. return !0
  3407. }
  3408. }
  3409. return !1
  3410. }
  3411. function I(e, t) {
  3412. var n = 2 < arguments.length ? Jt.call(arguments, 2) : [];
  3413. return !k(t) || t instanceof RegExp ? t : n.length ? function () {
  3414. return arguments.length ? t.apply(e, n.concat(Jt.call(arguments, 0))) : t.apply(e, n)
  3415. } : function () {
  3416. return arguments.length ? t.apply(e, arguments) : t.call(e)
  3417. }
  3418. }
  3419. function M(e, r) {
  3420. var o = r;
  3421. return "string" == typeof e && "$" === e.charAt(0) ? o = n : S(r) ? o = "$WINDOW" : r && t === r ? o = "$DOCUMENT" : r && r.$evalAsync && r.$watch && (o = "$SCOPE"), o
  3422. }
  3423. function _(e, t) {
  3424. return void 0 === e ? n : JSON.stringify(e, M, t ? " " : null)
  3425. }
  3426. function L(e) {
  3427. return x(e) ? JSON.parse(e) : e
  3428. }
  3429. function F(e) {
  3430. return "function" == typeof e ? e = !0 : e && 0 !== e.length ? (e = Xt("" + e), e = !("f" == e || "0" == e || "false" == e || "no" == e || "n" == e || "[]" == e)) : e = !1, e
  3431. }
  3432. function B(e) {
  3433. e = Vt(e).clone();
  3434. try {
  3435. e.empty()
  3436. } catch (e) {
  3437. }
  3438. var t = Vt("<div>").append(e).html();
  3439. try {
  3440. return 3 === e[0].nodeType ? Xt(t) : t.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, function (e, t) {
  3441. return "<" + Xt(t)
  3442. })
  3443. } catch (e) {
  3444. return Xt(t)
  3445. }
  3446. }
  3447. function R(e) {
  3448. try {
  3449. return decodeURIComponent(e)
  3450. } catch (e) {
  3451. }
  3452. }
  3453. function j(e) {
  3454. var t, n, r = {};
  3455. return i((e || "").split("&"), function (e) {
  3456. e && (t = e.replace(/\+/g, "%20").split("="), n = R(t[0]), b(n) && (e = !b(t[1]) || R(t[1]), Kt.call(r, n) ? on(r[n]) ? r[n].push(e) : r[n] = [r[n], e] : r[n] = e))
  3457. }), r
  3458. }
  3459. function q(e) {
  3460. var t = [];
  3461. return i(e, function (e, n) {
  3462. on(e) ? i(e, function (e) {
  3463. t.push(H(n, !0) + (!0 === e ? "" : "=" + H(e, !0)))
  3464. }) : t.push(H(n, !0) + (!0 === e ? "" : "=" + H(e, !0)))
  3465. }), t.length ? t.join("&") : ""
  3466. }
  3467. function U(e) {
  3468. return H(e, !0).replace(/%26/gi, "&").replace(/%3D/gi, "=").replace(/%2B/gi, "+")
  3469. }
  3470. function H(e, t) {
  3471. return encodeURIComponent(e).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, t ? "%20" : "+")
  3472. }
  3473. function V(e, n) {
  3474. function r(e) {
  3475. e && s.push(e)
  3476. }
  3477. var o, a, s = [e], l = ["ng:app", "ng-app", "x-ng-app", "data-ng-app"], c = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;
  3478. i(l, function (n) {
  3479. l[n] = !0, r(t.getElementById(n)), n = n.replace(":", "\\:"), e.querySelectorAll && (i(e.querySelectorAll("." + n), r), i(e.querySelectorAll("." + n + "\\:"), r), i(e.querySelectorAll("[" + n + "]"), r))
  3480. }), i(s, function (e) {
  3481. if (!o) {
  3482. var t = c.exec(" " + e.className + " ");
  3483. t ? (o = e, a = (t[2] || "").replace(/\s+/g, ",")) : i(e.attributes, function (t) {
  3484. !o && l[t.name] && (o = e, a = t.value)
  3485. })
  3486. }
  3487. }), o && n(o, a ? [a] : [])
  3488. }
  3489. function z(n, r) {
  3490. var o = function () {
  3491. if ((n = Vt(n)).injector()) {
  3492. var e = n[0] === t ? "document" : B(n);
  3493. throw tn("btstrpd", e.replace(/</, "&lt;").replace(/>/, "&gt;"))
  3494. }
  3495. return (r = r || []).unshift(["$provide", function (e) {
  3496. e.value("$rootElement", n)
  3497. }]), r.unshift("ng"), (e = xe(r)).invoke(["$rootScope", "$rootElement", "$compile", "$injector", "$animate", function (e, t, n, r, o) {
  3498. e.$apply(function () {
  3499. t.data("$injector", r), n(t)(e)
  3500. })
  3501. }]), e
  3502. }, a = /^NG_DEFER_BOOTSTRAP!/;
  3503. if (e && !a.test(e.name)) return o();
  3504. e.name = e.name.replace(a, ""), nn.resumeBootstrap = function (e) {
  3505. i(e, function (e) {
  3506. r.push(e)
  3507. }), o()
  3508. }
  3509. }
  3510. function W(e, t) {
  3511. return t = t || "_", e.replace(ln, function (e, n) {
  3512. return (n ? t : "") + e.toLowerCase()
  3513. })
  3514. }
  3515. function G(e, t, n) {
  3516. if (!e) throw tn("areq", t || "?", n || "required");
  3517. return e
  3518. }
  3519. function Y(e, t, n) {
  3520. return n && on(e) && (e = e[e.length - 1]), G(k(e), t, "not a function, got " + (e && "object" == typeof e ? e.constructor.name || "Object" : typeof e)), e
  3521. }
  3522. function X(e, t) {
  3523. if ("hasOwnProperty" === e) throw tn("badname", t)
  3524. }
  3525. function K(e, t, n) {
  3526. if (!t) return e;
  3527. for (var r, o = e, i = (t = t.split(".")).length, a = 0; a < i; a++) r = t[a], e && (e = (o = e)[r]);
  3528. return !n && k(e) ? I(o, e) : e
  3529. }
  3530. function Q(e) {
  3531. var t = e[0];
  3532. if (e = e[e.length - 1], t === e) return Vt(t);
  3533. var n = [t];
  3534. do {
  3535. if (!(t = t.nextSibling)) break;
  3536. n.push(t)
  3537. } while (t !== e);
  3538. return Vt(n)
  3539. }
  3540. function J(e) {
  3541. var t = r("$injector"), n = r("ng");
  3542. return e = e.angular || (e.angular = {}), e.$$minErr = e.$$minErr || r, e.module || (e.module = function () {
  3543. var e = {};
  3544. return function (r, o, i) {
  3545. if ("hasOwnProperty" === r) throw n("badname", "module");
  3546. return o && e.hasOwnProperty(r) && (e[r] = null), e[r] || (e[r] = function () {
  3547. function e(e, t, r) {
  3548. return function () {
  3549. return n[r || "push"]([e, t, arguments]), l
  3550. }
  3551. }
  3552. if (!o) throw t("nomod", r);
  3553. var n = [], a = [], s = e("$injector", "invoke"), l = {
  3554. _invokeQueue: n,
  3555. _runBlocks: a,
  3556. requires: o,
  3557. name: r,
  3558. provider: e("$provide", "provider"),
  3559. factory: e("$provide", "factory"),
  3560. service: e("$provide", "service"),
  3561. value: e("$provide", "value"),
  3562. constant: e("$provide", "constant", "unshift"),
  3563. animation: e("$animateProvider", "register"),
  3564. filter: e("$filterProvider", "register"),
  3565. controller: e("$controllerProvider", "register"),
  3566. directive: e("$compileProvider", "directive"),
  3567. config: s,
  3568. run: function (e) {
  3569. return a.push(e), this
  3570. }
  3571. };
  3572. return i && s(i), l
  3573. }())
  3574. }
  3575. }())
  3576. }
  3577. function Z(e) {
  3578. return e.replace(hn, function (e, t, n, r) {
  3579. return r ? n.toUpperCase() : n
  3580. }).replace(gn, "Moz$1")
  3581. }
  3582. function ee(e, t, n, r) {
  3583. function o(e) {
  3584. var o, a, s, l, c, u, f = n && e ? [this.filter(e)] : [this], d = t;
  3585. if (!r || null != e) for (; f.length;) for (o = f.shift(), a = 0, s = o.length; a < s; a++) for (l = Vt(o[a]), d ? l.triggerHandler("$destroy") : d = !d, c = 0, l = (u = l.children()).length; c < l; c++) f.push(zt(u[c]));
  3586. return i.apply(this, arguments)
  3587. }
  3588. var i = (i = zt.fn[e]).$original || i;
  3589. o.$original = i, zt.fn[e] = o
  3590. }
  3591. function te(e) {
  3592. if (e instanceof te) return e;
  3593. if (x(e) && (e = an(e)), !(this instanceof te)) {
  3594. if (x(e) && "<" != e.charAt(0)) throw mn("nosel");
  3595. return new te(e)
  3596. }
  3597. if (x(e)) {
  3598. var n = e;
  3599. e = t;
  3600. var r;
  3601. if (r = vn.exec(n)) e = [e.createElement(r[1])]; else {
  3602. var o, i = e;
  3603. if (e = i.createDocumentFragment(), r = [], bn.test(n)) {
  3604. for (i = e.appendChild(i.createElement("div")), o = (yn.exec(n) || ["", ""])[1].toLowerCase(), o = wn[o] || wn._default, i.innerHTML = "<div>&#160;</div>" + o[1] + n.replace(xn, "<$1></$2>") + o[2], i.removeChild(i.firstChild), n = o[0]; n--;) i = i.lastChild;
  3605. for (n = 0, o = i.childNodes.length; n < o; ++n) r.push(i.childNodes[n]);
  3606. (i = e.firstChild).textContent = ""
  3607. } else r.push(i.createTextNode(n));
  3608. e.textContent = "", e.innerHTML = "", e = r
  3609. }
  3610. fe(this, e), Vt(t.createDocumentFragment()).append(this)
  3611. } else fe(this, e)
  3612. }
  3613. function ne(e) {
  3614. return e.cloneNode(!0)
  3615. }
  3616. function re(e) {
  3617. ie(e);
  3618. var t = 0;
  3619. for (e = e.childNodes || []; t < e.length; t++) re(e[t])
  3620. }
  3621. function oe(e, t, n, r) {
  3622. if (b(r)) throw mn("offargs");
  3623. var o = ae(e, "events");
  3624. ae(e, "handle") && (v(t) ? i(o, function (t, n) {
  3625. pn(e, n, t), delete o[n]
  3626. }) : i(t.split(" "), function (t) {
  3627. v(n) ? (pn(e, t, o[t]), delete o[t]) : N(o[t] || [], n)
  3628. }))
  3629. }
  3630. function ie(e, t) {
  3631. var r = e.ng339, o = un[r];
  3632. o && (t ? delete un[r].data[t] : (o.handle && (o.events.$destroy && o.handle({}, "$destroy"), oe(e)), delete un[r], e.ng339 = n))
  3633. }
  3634. function ae(e, t, n) {
  3635. var r = e.ng339, r = un[r || -1];
  3636. if (!b(n)) return r && r[t];
  3637. r || (e.ng339 = r = ++fn, r = un[r] = {}), r[t] = n
  3638. }
  3639. function se(e, t, n) {
  3640. var r = ae(e, "data"), o = b(n), i = !o && b(t), a = i && !y(t);
  3641. if (r || a || ae(e, "data", r = {}), o) r[t] = n; else {
  3642. if (!i) return r;
  3643. if (a) return r && r[t];
  3644. f(r, t)
  3645. }
  3646. }
  3647. function le(e, t) {
  3648. return !!e.getAttribute && -1 < (" " + (e.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " ").indexOf(" " + t + " ")
  3649. }
  3650. function ce(e, t) {
  3651. t && e.setAttribute && i(t.split(" "), function (t) {
  3652. e.setAttribute("class", an((" " + (e.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " ").replace(" " + an(t) + " ", " ")))
  3653. })
  3654. }
  3655. function ue(e, t) {
  3656. if (t && e.setAttribute) {
  3657. var n = (" " + (e.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " ");
  3658. i(t.split(" "), function (e) {
  3659. e = an(e), -1 === n.indexOf(" " + e + " ") && (n += e + " ")
  3660. }), e.setAttribute("class", an(n))
  3661. }
  3662. }
  3663. function fe(e, t) {
  3664. if (t) {
  3665. t = t.nodeName || !b(t.length) || S(t) ? [t] : t;
  3666. for (var n = 0; n < t.length; n++) e.push(t[n])
  3667. }
  3668. }
  3669. function de(e, t) {
  3670. return pe(e, "$" + (t || "ngController") + "Controller")
  3671. }
  3672. function pe(e, t, r) {
  3673. for (9 == e.nodeType && (e = e.documentElement), t = on(t) ? t : [t]; e;) {
  3674. for (var o = 0, i = t.length; o < i; o++) if ((r = Vt.data(e, t[o])) !== n) return r;
  3675. e = e.parentNode || 11 === e.nodeType && e.host
  3676. }
  3677. }
  3678. function he(e) {
  3679. for (var t = 0, n = e.childNodes; t < n.length; t++) re(n[t]);
  3680. for (; e.firstChild;) e.removeChild(e.firstChild)
  3681. }
  3682. function ge(e, t) {
  3683. var n = kn[t.toLowerCase()];
  3684. return n && Tn[e.nodeName] && n
  3685. }
  3686. function me(e, n) {
  3687. var r = function (r, o) {
  3688. if (r.preventDefault || (r.preventDefault = function () {
  3689. r.returnValue = !1
  3690. }), r.stopPropagation || (r.stopPropagation = function () {
  3691. r.cancelBubble = !0
  3692. }), r.target || (r.target = r.srcElement || t), v(r.defaultPrevented)) {
  3693. var a = r.preventDefault;
  3694. r.preventDefault = function () {
  3695. r.defaultPrevented = !0, a.call(r)
  3696. }, r.defaultPrevented = !1
  3697. }
  3698. r.isDefaultPrevented = function () {
  3699. return r.defaultPrevented || !1 === r.returnValue
  3700. }, i(O(n[o || r.type] || []), function (t) {
  3701. t.call(e, r)
  3702. }), 8 >= Ht ? (r.preventDefault = null, r.stopPropagation = null, r.isDefaultPrevented = null) : (delete r.preventDefault, delete r.stopPropagation, delete r.isDefaultPrevented)
  3703. };
  3704. return r.elem = e, r
  3705. }
  3706. function ve(e, t) {
  3707. var r, o = typeof e;
  3708. return "function" == o || "object" == o && null !== e ? "function" == typeof(r = e.$$hashKey) ? r = e.$$hashKey() : r === n && (r = e.$$hashKey = (t || c)()) : r = e, o + ":" + r
  3709. }
  3710. function be(e, t) {
  3711. if (t) {
  3712. var n = 0;
  3713. this.nextUid = function () {
  3714. return ++n
  3715. }
  3716. }
  3717. i(e, this.put, this)
  3718. }
  3719. function ye(e) {
  3720. var t, n;
  3721. return "function" == typeof e ? (t = e.$inject) || (t = [], e.length && (n = e.toString().replace(An, ""), n = n.match(Sn), i(n[1].split(Cn), function (e) {
  3722. e.replace(En, function (e, n, r) {
  3723. t.push(r)
  3724. })
  3725. })), e.$inject = t) : on(e) ? (n = e.length - 1, Y(e[n], "fn"), t = e.slice(0, n)) : Y(e, "fn", !0), t
  3726. }
  3727. function xe(e) {
  3728. function t(e) {
  3729. return function (t, n) {
  3730. if (!y(t)) return e(t, n);
  3731. i(t, l(e))
  3732. }
  3733. }
  3734. function n(e, t) {
  3735. if (X(e, "service"), (k(t) || on(t)) && (t = p.instantiate(t)), !t.$get) throw Nn("pget", e);
  3736. return d[e + c] = t
  3737. }
  3738. function r(e, t) {
  3739. return n(e, {$get: t})
  3740. }
  3741. function o(e) {
  3742. var t, n, r, a, s = [];
  3743. return i(e, function (e) {
  3744. if (!f.get(e)) {
  3745. f.put(e, !0);
  3746. try {
  3747. if (x(e)) for (t = Wt(e), s = s.concat(o(t.requires)).concat(t._runBlocks), n = t._invokeQueue, r = 0, a = n.length; r < a; r++) {
  3748. var i = n[r], l = p.get(i[0]);
  3749. l[i[1]].apply(l, i[2])
  3750. } else k(e) ? s.push(p.invoke(e)) : on(e) ? s.push(p.invoke(e)) : Y(e, "module")
  3751. } catch (t) {
  3752. throw on(e) && (e = e[e.length - 1]), t.message && t.stack && -1 == t.stack.indexOf(t.message) && (t = t.message + "\n" + t.stack), Nn("modulerr", e, t.stack || t.message || t)
  3753. }
  3754. }
  3755. }), s
  3756. }
  3757. function a(e, t) {
  3758. function n(n) {
  3759. if (e.hasOwnProperty(n)) {
  3760. if (e[n] === s) throw Nn("cdep", n + " <- " + u.join(" <- "));
  3761. return e[n]
  3762. }
  3763. try {
  3764. return u.unshift(n), e[n] = s, e[n] = t(n)
  3765. } catch (t) {
  3766. throw e[n] === s && delete e[n], t
  3767. } finally {
  3768. u.shift()
  3769. }
  3770. }
  3771. function r(e, t, r) {
  3772. var o, i, a, s = [], l = ye(e);
  3773. for (i = 0, o = l.length; i < o; i++) {
  3774. if ("string" != typeof(a = l[i])) throw Nn("itkn", a);
  3775. s.push(r && r.hasOwnProperty(a) ? r[a] : n(a))
  3776. }
  3777. return on(e) && (e = e[o]), e.apply(t, s)
  3778. }
  3779. return {
  3780. invoke: r, instantiate: function (e, t) {
  3781. var n, o = function () {
  3782. };
  3783. return o.prototype = (on(e) ? e[e.length - 1] : e).prototype, o = new o, n = r(e, o, t), y(n) || k(n) ? n : o
  3784. }, get: n, annotate: ye, has: function (t) {
  3785. return d.hasOwnProperty(t + c) || e.hasOwnProperty(t)
  3786. }
  3787. }
  3788. }
  3789. var s = {}, c = "Provider", u = [], f = new be([], !0), d = {
  3790. $provide: {
  3791. provider: t(n), factory: t(r), service: t(function (e, t) {
  3792. return r(e, ["$injector", function (e) {
  3793. return e.instantiate(t)
  3794. }])
  3795. }), value: t(function (e, t) {
  3796. return r(e, m(t))
  3797. }), constant: t(function (e, t) {
  3798. X(e, "constant"), d[e] = t, g[e] = t
  3799. }), decorator: function (e, t) {
  3800. var n = p.get(e + c), r = n.$get;
  3801. n.$get = function () {
  3802. var e = v.invoke(r, n);
  3803. return v.invoke(t, null, {$delegate: e})
  3804. }
  3805. }
  3806. }
  3807. }, p = d.$injector = a(d, function () {
  3808. throw Nn("unpr", u.join(" <- "))
  3809. }), g = {}, v = g.$injector = a(g, function (e) {
  3810. return e = p.get(e + c), v.invoke(e.$get, e)
  3811. });
  3812. return i(o(e), function (e) {
  3813. v.invoke(e || h)
  3814. }), v
  3815. }
  3816. function we() {
  3817. var e = !0;
  3818. this.disableAutoScrolling = function () {
  3819. e = !1
  3820. }, this.$get = ["$window", "$location", "$rootScope", function (t, n, r) {
  3821. function o(e) {
  3822. var t = null;
  3823. return i(e, function (e) {
  3824. t || "a" !== Xt(e.nodeName) || (t = e)
  3825. }), t
  3826. }
  3827. function a() {
  3828. var e, r = n.hash();
  3829. r ? (e = s.getElementById(r)) ? e.scrollIntoView() : (e = o(s.getElementsByName(r))) ? e.scrollIntoView() : "top" === r && t.scrollTo(0, 0) : t.scrollTo(0, 0)
  3830. }
  3831. var s = t.document;
  3832. return e && r.$watch(function () {
  3833. return n.hash()
  3834. }, function () {
  3835. r.$evalAsync(a)
  3836. }), a
  3837. }]
  3838. }
  3839. function $e() {
  3840. this.$get = ["$$rAF", "$timeout", function (e, t) {
  3841. return e.supported ? function (t) {
  3842. return e(t)
  3843. } : function (e) {
  3844. return t(e, 0, !1)
  3845. }
  3846. }]
  3847. }
  3848. function ke(e, t, r, o) {
  3849. function a(e) {
  3850. try {
  3851. e.apply(null, Jt.call(arguments, 1))
  3852. } finally {
  3853. if (0 == --b) for (; y.length;) try {
  3854. y.pop()()
  3855. } catch (e) {
  3856. r.error(e)
  3857. }
  3858. }
  3859. }
  3860. function s(e, t) {
  3861. !function n() {
  3862. i($, function (e) {
  3863. e()
  3864. }), w = t(n, e)
  3865. }()
  3866. }
  3867. function l() {
  3868. k != c.url() && (k = c.url(), i(C, function (e) {
  3869. e(c.url())
  3870. }))
  3871. }
  3872. var c = this, u = t[0], f = e.location, d = e.history, p = e.setTimeout, g = e.clearTimeout, m = {};
  3873. c.isMock = !1;
  3874. var b = 0, y = [];
  3875. c.$$completeOutstandingRequest = a, c.$$incOutstandingRequestCount = function () {
  3876. b++
  3877. }, c.notifyWhenNoOutstandingRequests = function (e) {
  3878. i($, function (e) {
  3879. e()
  3880. }), 0 === b ? e() : y.push(e)
  3881. };
  3882. var w, $ = [];
  3883. c.addPollFn = function (e) {
  3884. return v(w) && s(100, p), $.push(e), e
  3885. };
  3886. var k = f.href, T = t.find("base"), S = null;
  3887. c.url = function (t, n) {
  3888. if (f !== e.location && (f = e.location), d !== e.history && (d = e.history), !t) return S || f.href.replace(/%27/g, "'");
  3889. if (k != t) {
  3890. var r = k && Ge(k) === Ge(t);
  3891. return k = t, !r && o.history ? n ? d.replaceState(null, "", t) : (d.pushState(null, "", t), T.attr("href", T.attr("href"))) : (r || (S = t), n ? f.replace(t) : f.href = t), c
  3892. }
  3893. };
  3894. var C = [], E = !1;
  3895. c.onUrlChange = function (t) {
  3896. return E || (o.history && Vt(e).on("popstate", l), o.hashchange ? Vt(e).on("hashchange", l) : c.addPollFn(l), E = !0), C.push(t), t
  3897. }, c.$$checkUrlChange = l, c.baseHref = function () {
  3898. var e = T.attr("href");
  3899. return e ? e.replace(/^(https?\:)?\/\/[^\/]*/, "") : ""
  3900. };
  3901. var A = {}, N = "", P = c.baseHref();
  3902. c.cookies = function (e, t) {
  3903. var o, i, a, s;
  3904. if (!e) {
  3905. if (u.cookie !== N) for (N = u.cookie, o = N.split("; "), A = {}, a = 0; a < o.length; a++) i = o[a], 0 < (s = i.indexOf("=")) && (e = unescape(i.substring(0, s)), A[e] === n && (A[e] = unescape(i.substring(s + 1))));
  3906. return A
  3907. }
  3908. t === n ? u.cookie = escape(e) + "=;path=" + P + ";expires=Thu, 01 Jan 1970 00:00:00 GMT" : x(t) && 4096 < (o = (u.cookie = escape(e) + "=" + escape(t) + ";path=" + P).length + 1) && r.warn("Cookie '" + e + "' possibly not set or overflowed because it was too large (" + o + " > 4096 bytes)!")
  3909. }, c.defer = function (e, t) {
  3910. var n;
  3911. return b++, n = p(function () {
  3912. delete m[n], a(e)
  3913. }, t || 0), m[n] = !0, n
  3914. }, c.defer.cancel = function (e) {
  3915. return !!m[e] && (delete m[e], g(e), a(h), !0)
  3916. }
  3917. }
  3918. function Te() {
  3919. this.$get = ["$window", "$log", "$sniffer", "$document", function (e, t, n, r) {
  3920. return new ke(e, r, t, n)
  3921. }]
  3922. }
  3923. function Se() {
  3924. this.$get = function () {
  3925. function e(e, n) {
  3926. function o(e) {
  3927. e != d && (p ? p == e && (p = e.n) : p = e, i(e.n, e.p), i(e, d), d = e, d.n = null)
  3928. }
  3929. function i(e, t) {
  3930. e != t && (e && (e.p = t), t && (t.n = e))
  3931. }
  3932. if (e in t) throw r("$cacheFactory")("iid", e);
  3933. var a = 0, s = f({}, n, {id: e}), l = {}, c = n && n.capacity || Number.MAX_VALUE, u = {}, d = null, p = null;
  3934. return t[e] = {
  3935. put: function (e, t) {
  3936. if (c < Number.MAX_VALUE && o(u[e] || (u[e] = {key: e})), !v(t)) return e in l || a++, l[e] = t, a > c && this.remove(p.key), t
  3937. }, get: function (e) {
  3938. if (c < Number.MAX_VALUE) {
  3939. var t = u[e];
  3940. if (!t) return;
  3941. o(t)
  3942. }
  3943. return l[e]
  3944. }, remove: function (e) {
  3945. if (c < Number.MAX_VALUE) {
  3946. var t = u[e];
  3947. if (!t) return;
  3948. t == d && (d = t.p), t == p && (p = t.n), i(t.n, t.p), delete u[e]
  3949. }
  3950. delete l[e], a--
  3951. }, removeAll: function () {
  3952. l = {}, a = 0, u = {}, d = p = null
  3953. }, destroy: function () {
  3954. u = s = l = null, delete t[e]
  3955. }, info: function () {
  3956. return f({}, s, {size: a})
  3957. }
  3958. }
  3959. }
  3960. var t = {};
  3961. return e.info = function () {
  3962. var e = {};
  3963. return i(t, function (t, n) {
  3964. e[n] = t.info()
  3965. }), e
  3966. }, e.get = function (e) {
  3967. return t[e]
  3968. }, e
  3969. }
  3970. }
  3971. function Ce() {
  3972. this.$get = ["$cacheFactory", function (e) {
  3973. return e("templates")
  3974. }]
  3975. }
  3976. function Ee(e, r) {
  3977. var o = {}, a = "Directive", s = /^\s*directive\:\s*([\d\w_\-]+)\s+(.*)$/, c = /(([\d\w_\-]+)(?:\:([^;]+))?;?)/,
  3978. u = /^(on[a-z]+|formaction)$/;
  3979. this.directive = function t(n, r) {
  3980. return X(n, "directive"), x(n) ? (G(r, "directiveFactory"), o.hasOwnProperty(n) || (o[n] = [], e.factory(n + a, ["$injector", "$exceptionHandler", function (e, t) {
  3981. var r = [];
  3982. return i(o[n], function (o, i) {
  3983. try {
  3984. var a = e.invoke(o);
  3985. k(a) ? a = {compile: m(a)} : !a.compile && a.link && (a.compile = m(a.link)), a.priority = a.priority || 0, a.index = i, a.name = a.name || n, a.require = a.require || a.controller && a.name, a.restrict = a.restrict || "A", r.push(a)
  3986. } catch (e) {
  3987. t(e)
  3988. }
  3989. }), r
  3990. }])), o[n].push(r)) : i(n, l(t)), this
  3991. }, this.aHrefSanitizationWhitelist = function (e) {
  3992. return b(e) ? (r.aHrefSanitizationWhitelist(e), this) : r.aHrefSanitizationWhitelist()
  3993. }, this.imgSrcSanitizationWhitelist = function (e) {
  3994. return b(e) ? (r.imgSrcSanitizationWhitelist(e), this) : r.imgSrcSanitizationWhitelist()
  3995. }, this.$get = ["$injector", "$interpolate", "$exceptionHandler", "$http", "$templateCache", "$parse", "$controller", "$rootScope", "$document", "$sce", "$animate", "$$sanitizeUri", function (e, r, l, d, h, m, v, b, w, $, T, S) {
  3996. function C(e, t, n, r, o) {
  3997. e instanceof Vt || (e = Vt(e)), i(e, function (t, n) {
  3998. 3 == t.nodeType && t.nodeValue.match(/\S+/) && (e[n] = Vt(t).wrap("<span></span>").parent()[0])
  3999. });
  4000. var a = A(e, t, e, n, r, o);
  4001. return E(e, "ng-scope"), function (t, n, r, o) {
  4002. G(t, "scope");
  4003. var s = n ? $n.clone.call(e) : e;
  4004. i(r, function (e, t) {
  4005. s.data("$" + t + "Controller", e)
  4006. }), r = 0;
  4007. for (var l = s.length; r < l; r++) {
  4008. var c = s[r].nodeType;
  4009. 1 !== c && 9 !== c || s.eq(r).data("$scope", t)
  4010. }
  4011. return n && n(s, t), a && a(t, s, s, o), s
  4012. }
  4013. }
  4014. function E(e, t) {
  4015. try {
  4016. e.addClass(t)
  4017. } catch (e) {
  4018. }
  4019. }
  4020. function A(e, t, r, o, i, a) {
  4021. for (var s, l, c, u, f = [], d = 0; d < e.length; d++) s = new K, l = P(e[d], [], s, 0 === d ? o : n, i), (a = l.length ? _(l, e[d], s, t, r, null, [], [], a) : null) && a.scope && E(s.$$element, "ng-scope"), s = a && a.terminal || !(c = e[d].childNodes) || !c.length ? null : A(c, a ? (a.transcludeOnThisElement || !a.templateOnThisElement) && a.transclude : t), f.push(a, s), u = u || a || s, a = null;
  4022. return u ? function (e, r, o, i) {
  4023. var a, s, l, c, u, d, p;
  4024. a = r.length;
  4025. var h = Array(a);
  4026. for (c = 0; c < a; c++) h[c] = r[c];
  4027. for (d = c = 0, u = f.length; c < u; d++) s = h[d], r = f[c++], a = f[c++], r ? (r.scope ? (l = e.$new(), Vt.data(s, "$scope", l)) : l = e, p = r.transcludeOnThisElement ? N(e, r.transclude, i) : !r.templateOnThisElement && i ? i : !i && t ? N(e, t) : null, r(a, l, s, o, p)) : a && a(e, s.childNodes, n, i)
  4028. } : null
  4029. }
  4030. function N(e, t, n) {
  4031. return function (r, o, i) {
  4032. var a = !1;
  4033. return r || (r = e.$new(), a = r.$$transcluded = !0), o = t(r, o, i, n), a && o.on("$destroy", function () {
  4034. r.$destroy()
  4035. }), o
  4036. }
  4037. }
  4038. function P(e, t, n, r, o) {
  4039. var i, a = n.$attr;
  4040. switch (e.nodeType) {
  4041. case 1:
  4042. F(t, Ae(Gt(e).toLowerCase()), "E", r, o);
  4043. for (var l, u, f, d = e.attributes, p = 0, h = d && d.length; p < h; p++) {
  4044. var g = !1, m = !1;
  4045. l = d[p], (!Ht || 8 <= Ht || l.specified) && (i = l.name, u = an(l.value), l = Ae(i), (f = ee.test(l)) && (i = W(l.substr(6), "-")), l === l.replace(/(Start|End)$/, "") + "Start" && (g = i, m = i.substr(0, i.length - 5) + "end", i = i.substr(0, i.length - 6)), a[l = Ae(i.toLowerCase())] = i, !f && n.hasOwnProperty(l) || (n[l] = u, ge(e, l) && (n[l] = !0)), z(e, t, u, l), F(t, l, "A", r, o, g, m))
  4046. }
  4047. if (e = e.className, x(e) && "" !== e) for (; i = c.exec(e);) l = Ae(i[2]), F(t, l, "C", r, o) && (n[l] = an(i[3])), e = e.substr(i.index + i[0].length);
  4048. break;
  4049. case 3:
  4050. H(t, e.nodeValue);
  4051. break;
  4052. case 8:
  4053. try {
  4054. (i = s.exec(e.nodeValue)) && (l = Ae(i[1]), F(t, l, "M", r, o) && (n[l] = an(i[2])))
  4055. } catch (e) {
  4056. }
  4057. }
  4058. return t.sort(q), t
  4059. }
  4060. function I(e, t, n) {
  4061. var r = [], o = 0;
  4062. if (t && e.hasAttribute && e.hasAttribute(t)) do {
  4063. if (!e) throw Dn("uterdir", t, n);
  4064. 1 == e.nodeType && (e.hasAttribute(t) && o++, e.hasAttribute(n) && o--), r.push(e), e = e.nextSibling
  4065. } while (0 < o); else r.push(e);
  4066. return Vt(r)
  4067. }
  4068. function M(e, t, n) {
  4069. return function (r, o, i, a, s) {
  4070. return o = I(o[0], t, n), e(r, o, i, a, s)
  4071. }
  4072. }
  4073. function _(e, o, a, s, c, u, f, d, p) {
  4074. function h(e, t, n, r) {
  4075. e && (n && (e = M(e, n, r)), e.require = $.require, e.directiveName = T, (F === $ || $.$$isolateScope) && (e = X(e, {isolateScope: !0})), f.push(e)), t && (n && (t = M(t, n, r)), t.require = $.require, t.directiveName = T, (F === $ || $.$$isolateScope) && (t = X(t, {isolateScope: !0})), d.push(t))
  4076. }
  4077. function g(e, t, n, r) {
  4078. var o, a = "data", s = !1;
  4079. if (x(t)) {
  4080. for (; "^" == (o = t.charAt(0)) || "?" == o;) t = t.substr(1), "^" == o && (a = "inheritedData"), s = s || "?" == o;
  4081. if (o = null, r && "data" === a && (o = r[t]), !(o = o || n[a]("$" + t + "Controller")) && !s) throw Dn("ctreq", t, e)
  4082. } else on(t) && (o = [], i(t, function (t) {
  4083. o.push(g(e, t, n, r))
  4084. }));
  4085. return o
  4086. }
  4087. function b(e, t, s, c, u) {
  4088. var p, h, b, y, x, w, $, k = {};
  4089. if (p = o === s ? a : O(a, new K(Vt(s), a.$attr)), h = p.$$element, F) {
  4090. var T = /^\s*([@=&])(\??)\s*(\w*)\s*$/;
  4091. w = t.$new(!0), !q || q !== F && q !== F.$$originalDirective ? h.data("$isolateScopeNoTemplate", w) : h.data("$isolateScope", w), E(h, "ng-isolate-scope"), i(F.scope, function (e, n) {
  4092. var o, i, a, s, l = (u = e.match(T) || [])[3] || n, c = "?" == u[2], u = u[1];
  4093. switch (w.$$isolateBindings[n] = u + l, u) {
  4094. case"@":
  4095. p.$observe(l, function (e) {
  4096. w[n] = e
  4097. }), p.$$observers[l].$$scope = t, p[l] && (w[n] = r(p[l])(t));
  4098. break;
  4099. case"=":
  4100. if (c && !p[l]) break;
  4101. i = m(p[l]), s = i.literal ? D : function (e, t) {
  4102. return e === t || e != e && t != t
  4103. }, a = i.assign || function () {
  4104. throw o = w[n] = i(t), Dn("nonassign", p[l], F.name)
  4105. }, o = w[n] = i(t), w.$watch(function () {
  4106. var e = i(t);
  4107. return s(e, w[n]) || (s(e, o) ? a(t, e = w[n]) : w[n] = e), o = e
  4108. }, null, i.literal);
  4109. break;
  4110. case"&":
  4111. i = m(p[l]), w[n] = function (e) {
  4112. return i(t, e)
  4113. };
  4114. break;
  4115. default:
  4116. throw Dn("iscp", F.name, n, e)
  4117. }
  4118. })
  4119. }
  4120. for ($ = u && function (e, t) {
  4121. var r;
  4122. return 2 > arguments.length && (t = e, e = n), W && (r = k), u(e, t, r)
  4123. }, _ && i(_, function (e) {
  4124. var n, r = {$scope: e === F || e.$$isolateScope ? w : t, $element: h, $attrs: p, $transclude: $};
  4125. "@" == (x = e.controller) && (x = p[e.name]), n = v(x, r), k[e.name] = n, W || h.data("$" + e.name + "Controller", n), e.controllerAs && (r.$scope[e.controllerAs] = n)
  4126. }), c = 0, b = f.length; c < b; c++) try {
  4127. (y = f[c])(y.isolateScope ? w : t, h, p, y.require && g(y.directiveName, y.require, h, k), $)
  4128. } catch (e) {
  4129. l(e, B(h))
  4130. }
  4131. for (c = t, F && (F.template || null === F.templateUrl) && (c = w), e && e(c, s.childNodes, n, u), c = d.length - 1; 0 <= c; c--) try {
  4132. (y = d[c])(y.isolateScope ? w : t, h, p, y.require && g(y.directiveName, y.require, h, k), $)
  4133. } catch (e) {
  4134. l(e, B(h))
  4135. }
  4136. }
  4137. p = p || {};
  4138. for (var w, $, T, S, A, N = -Number.MAX_VALUE, _ = p.controllerDirectives, F = p.newIsolateScopeDirective, q = p.templateDirective, H = p.nonTlbTranscludeDirective, V = !1, z = !1, W = p.hasElementTranscludeDirective, G = a.$$element = Vt(o), Q = s, J = 0, ee = e.length; J < ee; J++) {
  4139. var te = ($ = e[J]).$$start, re = $.$$end;
  4140. if (te && (G = I(o, te, re)), S = n, N > $.priority) break;
  4141. if ((S = $.scope) && (w = w || $, $.templateUrl || (U("new/isolated scope", F, $, G), y(S) && (F = $))), T = $.name, !$.templateUrl && $.controller && (S = $.controller, _ = _ || {}, U("'" + T + "' controller", _[T], $, G), _[T] = $), (S = $.transclude) && (V = !0, $.$$tlb || (U("transclusion", H, $, G), H = $), "element" == S ? (W = !0, N = $.priority, S = G, G = a.$$element = Vt(t.createComment(" " + T + ": " + a[T] + " ")), o = G[0], Y(c, Jt.call(S, 0), o), Q = C(S, s, N, u && u.name, {nonTlbTranscludeDirective: H})) : (S = Vt(ne(o)).contents(), G.empty(), Q = C(S, s))), $.template) if (z = !0, U("template", q, $, G), q = $, S = k($.template) ? $.template(G, a) : $.template, S = Z(S), $.replace) {
  4142. if (u = $, S = bn.test(S) ? Vt(an(S)) : [], o = S[0], 1 != S.length || 1 !== o.nodeType) throw Dn("tplrt", T, "");
  4143. Y(c, G, o), S = P(o, [], ee = {$attr: {}});
  4144. var oe = e.splice(J + 1, e.length - (J + 1));
  4145. F && L(S), e = e.concat(S).concat(oe), R(a, ee), ee = e.length
  4146. } else G.html(S);
  4147. if ($.templateUrl) z = !0, U("template", q, $, G), q = $, $.replace && (u = $), b = j(e.splice(J, e.length - J), G, a, c, V && Q, f, d, {
  4148. controllerDirectives: _,
  4149. newIsolateScopeDirective: F,
  4150. templateDirective: q,
  4151. nonTlbTranscludeDirective: H
  4152. }), ee = e.length; else if ($.compile) try {
  4153. k(A = $.compile(G, a, Q)) ? h(null, A, te, re) : A && h(A.pre, A.post, te, re)
  4154. } catch (e) {
  4155. l(e, B(G))
  4156. }
  4157. $.terminal && (b.terminal = !0, N = Math.max(N, $.priority))
  4158. }
  4159. return b.scope = w && !0 === w.scope, b.transcludeOnThisElement = V, b.templateOnThisElement = z, b.transclude = Q, p.hasElementTranscludeDirective = W, b
  4160. }
  4161. function L(e) {
  4162. for (var t = 0, n = e.length; t < n; t++) e[t] = p(e[t], {$$isolateScope: !0})
  4163. }
  4164. function F(t, r, i, s, c, u, f) {
  4165. if (r === c) return null;
  4166. if (c = null, o.hasOwnProperty(r)) for (var d, h = 0, g = (r = e.get(r + a)).length; h < g; h++) try {
  4167. d = r[h], (s === n || s > d.priority) && -1 != d.restrict.indexOf(i) && (u && (d = p(d, {
  4168. $$start: u,
  4169. $$end: f
  4170. })), t.push(d), c = d)
  4171. } catch (e) {
  4172. l(e)
  4173. }
  4174. return c
  4175. }
  4176. function R(e, t) {
  4177. var n = t.$attr, r = e.$attr, o = e.$$element;
  4178. i(e, function (r, o) {
  4179. "$" != o.charAt(0) && (t[o] && t[o] !== r && (r += ("style" === o ? ";" : " ") + t[o]), e.$set(o, r, !0, n[o]))
  4180. }), i(t, function (t, i) {
  4181. "class" == i ? (E(o, t), e.class = (e.class ? e.class + " " : "") + t) : "style" == i ? (o.attr("style", o.attr("style") + ";" + t), e.style = (e.style ? e.style + ";" : "") + t) : "$" == i.charAt(0) || e.hasOwnProperty(i) || (e[i] = t, r[i] = n[i])
  4182. })
  4183. }
  4184. function j(e, t, n, r, o, a, s, l) {
  4185. var c, u, p = [], g = t[0], m = e.shift(),
  4186. v = f({}, m, {templateUrl: null, transclude: null, replace: null, $$originalDirective: m}),
  4187. b = k(m.templateUrl) ? m.templateUrl(t, n) : m.templateUrl;
  4188. return t.empty(), d.get($.getTrustedResourceUrl(b), {cache: h}).success(function (f) {
  4189. var d, h;
  4190. if (f = Z(f), m.replace) {
  4191. if (f = bn.test(f) ? Vt(an(f)) : [], d = f[0], 1 != f.length || 1 !== d.nodeType) throw Dn("tplrt", m.name, b);
  4192. f = {$attr: {}}, Y(r, t, d);
  4193. $ = P(d, [], f);
  4194. y(m.scope) && L($), e = $.concat(e), R(n, f)
  4195. } else d = g, t.html(f);
  4196. for (e.unshift(v), c = _(e, d, n, o, t, m, a, s, l), i(r, function (e, n) {
  4197. e == d && (r[n] = t[0])
  4198. }), u = A(t[0].childNodes, o); p.length;) {
  4199. f = p.shift(), h = p.shift();
  4200. var x = p.shift(), w = p.shift(), $ = t[0];
  4201. if (h !== g) {
  4202. var k = h.className;
  4203. l.hasElementTranscludeDirective && m.replace || ($ = ne(d)), Y(x, Vt(h), $), E(Vt($), k)
  4204. }
  4205. h = c.transcludeOnThisElement ? N(f, c.transclude, w) : w, c(u, f, $, r, h)
  4206. }
  4207. p = null
  4208. }).error(function (e, t, n, r) {
  4209. throw Dn("tpload", r.url)
  4210. }), function (e, t, n, r, o) {
  4211. e = o, p ? (p.push(t), p.push(n), p.push(r), p.push(e)) : (c.transcludeOnThisElement && (e = N(t, c.transclude, o)), c(u, t, n, r, e))
  4212. }
  4213. }
  4214. function q(e, t) {
  4215. var n = t.priority - e.priority;
  4216. return 0 !== n ? n : e.name !== t.name ? e.name < t.name ? -1 : 1 : e.index - t.index
  4217. }
  4218. function U(e, t, n, r) {
  4219. if (t) throw Dn("multidir", t.name, n.name, e, B(r))
  4220. }
  4221. function H(e, t) {
  4222. var n = r(t, !0);
  4223. n && e.push({
  4224. priority: 0, compile: function (e) {
  4225. var t = e.parent().length;
  4226. return t && E(e.parent(), "ng-binding"), function (e, r) {
  4227. var o = r.parent(), i = o.data("$binding") || [];
  4228. i.push(n), o.data("$binding", i), t || E(o, "ng-binding"), e.$watch(n, function (e) {
  4229. r[0].nodeValue = e
  4230. })
  4231. }
  4232. }
  4233. })
  4234. }
  4235. function V(e, t) {
  4236. if ("srcdoc" == t) return $.HTML;
  4237. var n = Gt(e);
  4238. return "xlinkHref" == t || "FORM" == n && "action" == t || "IMG" != n && ("src" == t || "ngSrc" == t) ? $.RESOURCE_URL : void 0
  4239. }
  4240. function z(e, t, n, o) {
  4241. var i = r(n, !0);
  4242. if (i) {
  4243. if ("multiple" === o && "SELECT" === Gt(e)) throw Dn("selmulti", B(e));
  4244. t.push({
  4245. priority: 100, compile: function () {
  4246. return {
  4247. pre: function (t, n, a) {
  4248. if (n = a.$$observers || (a.$$observers = {}), u.test(o)) throw Dn("nodomevents");
  4249. (i = r(a[o], !0, V(e, o))) && (a[o] = i(t), (n[o] || (n[o] = [])).$$inter = !0, (a.$$observers && a.$$observers[o].$$scope || t).$watch(i, function (e, t) {
  4250. "class" === o && e != t ? a.$updateClass(e, t) : a.$set(o, e)
  4251. }))
  4252. }
  4253. }
  4254. }
  4255. })
  4256. }
  4257. }
  4258. function Y(e, n, r) {
  4259. var o, i, a = n[0], s = n.length, l = a.parentNode;
  4260. if (e) for (o = 0, i = e.length; o < i; o++) if (e[o] == a) {
  4261. e[o++] = r, i = o + s - 1;
  4262. for (var c = e.length; o < c; o++, i++) i < c ? e[o] = e[i] : delete e[o];
  4263. e.length -= s - 1;
  4264. break
  4265. }
  4266. for (l && l.replaceChild(r, a), (e = t.createDocumentFragment()).appendChild(a), r[Vt.expando] = a[Vt.expando], a = 1, s = n.length; a < s; a++) l = n[a], Vt(l).remove(), e.appendChild(l), delete n[a];
  4267. n[0] = r, n.length = 1
  4268. }
  4269. function X(e, t) {
  4270. return f(function () {
  4271. return e.apply(null, arguments)
  4272. }, e, t)
  4273. }
  4274. var K = function (e, t) {
  4275. this.$$element = e, this.$attr = t || {}
  4276. };
  4277. K.prototype = {
  4278. $normalize: Ae, $addClass: function (e) {
  4279. e && 0 < e.length && T.addClass(this.$$element, e)
  4280. }, $removeClass: function (e) {
  4281. e && 0 < e.length && T.removeClass(this.$$element, e)
  4282. }, $updateClass: function (e, t) {
  4283. var n = Ne(e, t), r = Ne(t, e);
  4284. 0 === n.length ? T.removeClass(this.$$element, r) : 0 === r.length ? T.addClass(this.$$element, n) : T.setClass(this.$$element, n, r)
  4285. }, $set: function (e, t, r, o) {
  4286. var a = ge(this.$$element[0], e);
  4287. a && (this.$$element.prop(e, t), o = a), this[e] = t, o ? this.$attr[e] = o : (o = this.$attr[e]) || (this.$attr[e] = o = W(e, "-")), ("A" === (a = Gt(this.$$element)) && "href" === e || "IMG" === a && "src" === e) && (this[e] = t = S(t, "src" === e)), !1 !== r && (null === t || t === n ? this.$$element.removeAttr(o) : this.$$element.attr(o, t)), (r = this.$$observers) && i(r[e], function (e) {
  4288. try {
  4289. e(t)
  4290. } catch (e) {
  4291. l(e)
  4292. }
  4293. })
  4294. }, $observe: function (e, t) {
  4295. var n = this, r = n.$$observers || (n.$$observers = {}), o = r[e] || (r[e] = []);
  4296. return o.push(t), b.$evalAsync(function () {
  4297. o.$$inter || t(n[e])
  4298. }), t
  4299. }
  4300. };
  4301. var Q = r.startSymbol(), J = r.endSymbol(), Z = "{{" == Q || "}}" == J ? g : function (e) {
  4302. return e.replace(/\{\{/g, Q).replace(/}}/g, J)
  4303. }, ee = /^ngAttr[A-Z]/;
  4304. return C
  4305. }]
  4306. }
  4307. function Ae(e) {
  4308. return Z(e.replace(In, ""))
  4309. }
  4310. function Ne(e, t) {
  4311. var n = "", r = e.split(/\s+/), o = t.split(/\s+/), i = 0;
  4312. e:for (; i < r.length; i++) {
  4313. for (var a = r[i], s = 0; s < o.length; s++) if (a == o[s]) continue e;
  4314. n += (0 < n.length ? " " : "") + a
  4315. }
  4316. return n
  4317. }
  4318. function Pe() {
  4319. var e = {}, t = /^(\S+)(\s+as\s+(\w+))?$/;
  4320. this.register = function (t, n) {
  4321. X(t, "controller"), y(t) ? f(e, t) : e[t] = n
  4322. }, this.$get = ["$injector", "$window", function (n, o) {
  4323. return function (i, a) {
  4324. var s, l, c;
  4325. if (x(i) && (s = i.match(t), l = s[1], c = s[3], i = e.hasOwnProperty(l) ? e[l] : K(a.$scope, l, !0) || K(o, l, !0), Y(i, l, !0)), s = n.instantiate(i, a), c) {
  4326. if (!a || "object" != typeof a.$scope) throw r("$controller")("noscp", l || i.name, c);
  4327. a.$scope[c] = s
  4328. }
  4329. return s
  4330. }
  4331. }]
  4332. }
  4333. function Oe() {
  4334. this.$get = ["$window", function (e) {
  4335. return Vt(e.document)
  4336. }]
  4337. }
  4338. function De() {
  4339. this.$get = ["$log", function (e) {
  4340. return function (t, n) {
  4341. e.error.apply(e, arguments)
  4342. }
  4343. }]
  4344. }
  4345. function Ie(e) {
  4346. var t, n, r, o = {};
  4347. return e ? (i(e.split("\n"), function (e) {
  4348. r = e.indexOf(":"), t = Xt(an(e.substr(0, r))), n = an(e.substr(r + 1)), t && (o[t] = o[t] ? o[t] + ", " + n : n)
  4349. }), o) : o
  4350. }
  4351. function Me(e) {
  4352. var t = y(e) ? e : n;
  4353. return function (n) {
  4354. return t || (t = Ie(e)), n ? t[Xt(n)] || null : t
  4355. }
  4356. }
  4357. function _e(e, t, n) {
  4358. return k(n) ? n(e, t) : (i(n, function (n) {
  4359. e = n(e, t)
  4360. }), e)
  4361. }
  4362. function Le() {
  4363. var e = /^\s*(\[|\{[^\{])/, t = /[\}\]]\s*$/, r = /^\)\]\}',?\n/,
  4364. o = {"Content-Type": "application/json;charset=utf-8"}, a = this.defaults = {
  4365. transformResponse: [function (n) {
  4366. return x(n) && (n = n.replace(r, ""), e.test(n) && t.test(n) && (n = L(n))), n
  4367. }],
  4368. transformRequest: [function (e) {
  4369. return y(e) && "[object File]" !== en.call(e) && "[object Blob]" !== en.call(e) ? _(e) : e
  4370. }],
  4371. headers: {common: {Accept: "application/json, text/plain, */*"}, post: O(o), put: O(o), patch: O(o)},
  4372. xsrfCookieName: "XSRF-TOKEN",
  4373. xsrfHeaderName: "X-XSRF-TOKEN"
  4374. }, l = this.interceptors = [], c = this.responseInterceptors = [];
  4375. this.$get = ["$httpBackend", "$browser", "$cacheFactory", "$rootScope", "$q", "$injector", function (e, t, r, o, u, d) {
  4376. function p(e) {
  4377. function t(e) {
  4378. var t = f({}, e, {data: _e(e.data, e.headers, r.transformResponse)});
  4379. return 200 <= e.status && 300 > e.status ? t : u.reject(t)
  4380. }
  4381. var r = {method: "get", transformRequest: a.transformRequest, transformResponse: a.transformResponse},
  4382. o = function (e) {
  4383. var t, n, r = a.headers, o = f({}, e.headers), r = f({}, r.common, r[Xt(e.method)]);
  4384. e:for (t in r) {
  4385. e = Xt(t);
  4386. for (n in o) if (Xt(n) === e) continue e;
  4387. o[t] = r[t]
  4388. }
  4389. return function (e) {
  4390. var t;
  4391. i(e, function (n, r) {
  4392. k(n) && (null != (t = n()) ? e[r] = t : delete e[r])
  4393. })
  4394. }(o), o
  4395. }(e);
  4396. f(r, e), r.headers = o, r.method = Qt(r.method);
  4397. var s = [function (e) {
  4398. o = e.headers;
  4399. var n = _e(e.data, Me(o), e.transformRequest);
  4400. return v(n) && i(o, function (e, t) {
  4401. "content-type" === Xt(t) && delete o[t]
  4402. }), v(e.withCredentials) && !v(a.withCredentials) && (e.withCredentials = a.withCredentials), h(e, n, o).then(t, t)
  4403. }, n], l = u.when(r);
  4404. for (i(w, function (e) {
  4405. (e.request || e.requestError) && s.unshift(e.request, e.requestError), (e.response || e.responseError) && s.push(e.response, e.responseError)
  4406. }); s.length;) {
  4407. e = s.shift();
  4408. var c = s.shift(), l = l.then(e, c)
  4409. }
  4410. return l.success = function (e) {
  4411. return l.then(function (t) {
  4412. e(t.data, t.status, t.headers, r)
  4413. }), l
  4414. }, l.error = function (e) {
  4415. return l.then(null, function (t) {
  4416. e(t.data, t.status, t.headers, r)
  4417. }), l
  4418. }, l
  4419. }
  4420. function h(r, i, s) {
  4421. function l(e, t, n, o) {
  4422. (200 <= (t = Math.max(t, 0)) && 300 > t ? h.resolve : h.reject)({
  4423. data: e,
  4424. status: t,
  4425. headers: Me(n),
  4426. config: r,
  4427. statusText: o
  4428. })
  4429. }
  4430. function c() {
  4431. var e = A(p.pendingRequests, r);
  4432. -1 !== e && p.pendingRequests.splice(e, 1)
  4433. }
  4434. var f, d, h = u.defer(), x = h.promise, w = g(r.url, r.params);
  4435. if (p.pendingRequests.push(r), x.then(c, c), !r.cache && !a.cache || !1 === r.cache || "GET" !== r.method && "JSONP" !== r.method || (f = y(r.cache) ? r.cache : y(a.cache) ? a.cache : m), f) if (d = f.get(w), b(d)) {
  4436. if (d && k(d.then)) return d.then(c, c), d;
  4437. on(d) ? l(d[1], d[0], O(d[2]), d[3]) : l(d, 200, {}, "OK")
  4438. } else f.put(w, x);
  4439. return v(d) && ((d = $t(r.url) ? t.cookies()[r.xsrfCookieName || a.xsrfCookieName] : n) && (s[r.xsrfHeaderName || a.xsrfHeaderName] = d), e(r.method, w, i, function (e, t, n, r) {
  4440. f && (200 <= e && 300 > e ? f.put(w, [e, t, Ie(n), r]) : f.remove(w)), l(t, e, n, r), o.$$phase || o.$apply()
  4441. }, s, r.timeout, r.withCredentials, r.responseType)), x
  4442. }
  4443. function g(e, t) {
  4444. if (!t) return e;
  4445. var n = [];
  4446. return s(t, function (e, t) {
  4447. null === e || v(e) || (on(e) || (e = [e]), i(e, function (e) {
  4448. y(e) && (e = $(e) ? e.toISOString() : _(e)), n.push(H(t) + "=" + H(e))
  4449. }))
  4450. }), 0 < n.length && (e += (-1 == e.indexOf("?") ? "?" : "&") + n.join("&")), e
  4451. }
  4452. var m = r("$http"), w = [];
  4453. return i(l, function (e) {
  4454. w.unshift(x(e) ? d.get(e) : d.invoke(e))
  4455. }), i(c, function (e, t) {
  4456. var n = x(e) ? d.get(e) : d.invoke(e);
  4457. w.splice(t, 0, {
  4458. response: function (e) {
  4459. return n(u.when(e))
  4460. }, responseError: function (e) {
  4461. return n(u.reject(e))
  4462. }
  4463. })
  4464. }), p.pendingRequests = [], function (e) {
  4465. i(arguments, function (e) {
  4466. p[e] = function (t, n) {
  4467. return p(f(n || {}, {method: e, url: t}))
  4468. }
  4469. })
  4470. }("get", "delete", "head", "jsonp"), function (e) {
  4471. i(arguments, function (e) {
  4472. p[e] = function (t, n, r) {
  4473. return p(f(r || {}, {method: e, url: t, data: n}))
  4474. }
  4475. })
  4476. }("post", "put", "patch"), p.defaults = a, p
  4477. }]
  4478. }
  4479. function Fe(t) {
  4480. if (8 >= Ht && (!t.match(/^(get|post|head|put|delete|options)$/i) || !e.XMLHttpRequest)) return new e.ActiveXObject("Microsoft.XMLHTTP");
  4481. if (e.XMLHttpRequest) return new e.XMLHttpRequest;
  4482. throw r("$httpBackend")("noxhr")
  4483. }
  4484. function Be() {
  4485. this.$get = ["$browser", "$window", "$document", function (e, t, n) {
  4486. return Re(e, Fe, e.defer, t.angular.callbacks, n[0])
  4487. }]
  4488. }
  4489. function Re(e, t, n, r, o) {
  4490. function a(e, t, n) {
  4491. var i = o.createElement("script"), a = null;
  4492. return i.type = "text/javascript", i.src = e, i.async = !0, a = function (e) {
  4493. pn(i, "load", a), pn(i, "error", a), o.body.removeChild(i), i = null;
  4494. var s = -1, l = "unknown";
  4495. e && ("load" !== e.type || r[t].called || (e = {type: "error"}), l = e.type, s = "error" === e.type ? 404 : 200), n && n(s, l)
  4496. }, dn(i, "load", a), dn(i, "error", a), 8 >= Ht && (i.onreadystatechange = function () {
  4497. x(i.readyState) && /loaded|complete/.test(i.readyState) && (i.onreadystatechange = null, a({type: "load"}))
  4498. }), o.body.appendChild(i), a
  4499. }
  4500. var s = -1;
  4501. return function (o, l, c, u, f, d, p, g) {
  4502. function m() {
  4503. y = s, w && w(), $ && $.abort()
  4504. }
  4505. function v(t, r, o, i, a) {
  4506. T && n.cancel(T), w = $ = null, 0 === r && (r = o ? 200 : "file" == wt(l).protocol ? 404 : 0), t(1223 === r ? 204 : r, o, i, a || ""), e.$$completeOutstandingRequest(h)
  4507. }
  4508. var y;
  4509. if (e.$$incOutstandingRequestCount(), l = l || e.url(), "jsonp" == Xt(o)) {
  4510. var x = "_" + (r.counter++).toString(36);
  4511. r[x] = function (e) {
  4512. r[x].data = e, r[x].called = !0
  4513. };
  4514. var w = a(l.replace("JSON_CALLBACK", "angular.callbacks." + x), x, function (e, t) {
  4515. v(u, e, r[x].data, "", t), r[x] = h
  4516. })
  4517. } else {
  4518. var $ = t(o);
  4519. if ($.open(o, l, !0), i(f, function (e, t) {
  4520. b(e) && $.setRequestHeader(t, e)
  4521. }), $.onreadystatechange = function () {
  4522. if ($ && 4 == $.readyState) {
  4523. var e = null, t = null, n = "";
  4524. y !== s && (e = $.getAllResponseHeaders(), t = "response" in $ ? $.response : $.responseText), y === s && 10 > Ht || (n = $.statusText), v(u, y || $.status, t, e, n)
  4525. }
  4526. }, p && ($.withCredentials = !0), g) try {
  4527. $.responseType = g
  4528. } catch (e) {
  4529. if ("json" !== g) throw e
  4530. }
  4531. $.send(c || null)
  4532. }
  4533. if (0 < d) var T = n(m, d); else d && k(d.then) && d.then(m)
  4534. }
  4535. }
  4536. function je() {
  4537. var e = "{{", t = "}}";
  4538. this.startSymbol = function (t) {
  4539. return t ? (e = t, this) : e
  4540. }, this.endSymbol = function (e) {
  4541. return e ? (t = e, this) : t
  4542. }, this.$get = ["$parse", "$exceptionHandler", "$sce", function (n, r, o) {
  4543. function i(i, l, c) {
  4544. for (var u, f, d = 0, p = [], h = i.length, g = !1, m = []; d < h;) -1 != (u = i.indexOf(e, d)) && -1 != (f = i.indexOf(t, u + a)) ? (d != u && p.push(i.substring(d, u)), p.push(d = n(g = i.substring(u + a, f))), d.exp = g, d = f + s, g = !0) : (d != h && p.push(i.substring(d)), d = h);
  4545. if ((h = p.length) || (p.push(""), h = 1), c && 1 < p.length) throw Mn("noconcat", i);
  4546. if (!l || g) return m.length = h, d = function (e) {
  4547. try {
  4548. for (var t, n = 0, a = h; n < a; n++) {
  4549. if ("function" == typeof(t = p[n])) if (t = t(e), null == (t = c ? o.getTrusted(c, t) : o.valueOf(t))) t = ""; else switch (typeof t) {
  4550. case"string":
  4551. break;
  4552. case"number":
  4553. t = "" + t;
  4554. break;
  4555. default:
  4556. t = _(t)
  4557. }
  4558. m[n] = t
  4559. }
  4560. return m.join("")
  4561. } catch (t) {
  4562. e = Mn("interr", i, t.toString()), r(e)
  4563. }
  4564. }, d.exp = i, d.parts = p, d
  4565. }
  4566. var a = e.length, s = t.length;
  4567. return i.startSymbol = function () {
  4568. return e
  4569. }, i.endSymbol = function () {
  4570. return t
  4571. }, i
  4572. }]
  4573. }
  4574. function qe() {
  4575. this.$get = ["$rootScope", "$window", "$q", function (e, t, n) {
  4576. function r(r, i, a, s) {
  4577. var l = t.setInterval, c = t.clearInterval, u = n.defer(), f = u.promise, d = 0, p = b(s) && !s;
  4578. return a = b(a) ? a : 0, f.then(null, null, r), f.$$intervalId = l(function () {
  4579. u.notify(d++), 0 < a && d >= a && (u.resolve(d), c(f.$$intervalId), delete o[f.$$intervalId]), p || e.$apply()
  4580. }, i), o[f.$$intervalId] = u, f
  4581. }
  4582. var o = {};
  4583. return r.cancel = function (e) {
  4584. return !!(e && e.$$intervalId in o) && (o[e.$$intervalId].reject("canceled"), t.clearInterval(e.$$intervalId), delete o[e.$$intervalId], !0)
  4585. }, r
  4586. }]
  4587. }
  4588. function Ue() {
  4589. this.$get = function () {
  4590. return {
  4591. id: "en-us",
  4592. NUMBER_FORMATS: {
  4593. DECIMAL_SEP: ".",
  4594. GROUP_SEP: ",",
  4595. PATTERNS: [{
  4596. minInt: 1,
  4597. minFrac: 0,
  4598. maxFrac: 3,
  4599. posPre: "",
  4600. posSuf: "",
  4601. negPre: "-",
  4602. negSuf: "",
  4603. gSize: 3,
  4604. lgSize: 3
  4605. }, {
  4606. minInt: 1,
  4607. minFrac: 2,
  4608. maxFrac: 2,
  4609. posPre: "¤",
  4610. posSuf: "",
  4611. negPre: "(¤",
  4612. negSuf: ")",
  4613. gSize: 3,
  4614. lgSize: 3
  4615. }],
  4616. CURRENCY_SYM: "$"
  4617. },
  4618. DATETIME_FORMATS: {
  4619. MONTH: "January February March April May June July August September October November December".split(" "),
  4620. SHORTMONTH: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
  4621. DAY: "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
  4622. SHORTDAY: "Sun Mon Tue Wed Thu Fri Sat".split(" "),
  4623. AMPMS: ["AM", "PM"],
  4624. medium: "MMM d, y h:mm:ss a",
  4625. short: "M/d/yy h:mm a",
  4626. fullDate: "EEEE, MMMM d, y",
  4627. longDate: "MMMM d, y",
  4628. mediumDate: "MMM d, y",
  4629. shortDate: "M/d/yy",
  4630. mediumTime: "h:mm:ss a",
  4631. shortTime: "h:mm a"
  4632. },
  4633. pluralCat: function (e) {
  4634. return 1 === e ? "one" : "other"
  4635. }
  4636. }
  4637. }
  4638. }
  4639. function He(e) {
  4640. for (var t = (e = e.split("/")).length; t--;) e[t] = U(e[t]);
  4641. return e.join("/")
  4642. }
  4643. function Ve(e, t, n) {
  4644. e = wt(e, n), t.$$protocol = e.protocol, t.$$host = e.hostname, t.$$port = d(e.port) || Ln[e.protocol] || null
  4645. }
  4646. function ze(e, t, n) {
  4647. var r = "/" !== e.charAt(0);
  4648. r && (e = "/" + e), e = wt(e, n), t.$$path = decodeURIComponent(r && "/" === e.pathname.charAt(0) ? e.pathname.substring(1) : e.pathname), t.$$search = j(e.search), t.$$hash = decodeURIComponent(e.hash), t.$$path && "/" != t.$$path.charAt(0) && (t.$$path = "/" + t.$$path)
  4649. }
  4650. function We(e, t) {
  4651. if (0 === t.indexOf(e)) return t.substr(e.length)
  4652. }
  4653. function Ge(e) {
  4654. var t = e.indexOf("#");
  4655. return -1 == t ? e : e.substr(0, t)
  4656. }
  4657. function Ye(e) {
  4658. return e.substr(0, Ge(e).lastIndexOf("/") + 1)
  4659. }
  4660. function Xe(e, t) {
  4661. this.$$html5 = !0, t = t || "";
  4662. var r = Ye(e);
  4663. Ve(e, this, e), this.$$parse = function (t) {
  4664. var n = We(r, t);
  4665. if (!x(n)) throw Fn("ipthprfx", t, r);
  4666. ze(n, this, e), this.$$path || (this.$$path = "/"), this.$$compose()
  4667. }, this.$$compose = function () {
  4668. var e = q(this.$$search), t = this.$$hash ? "#" + U(this.$$hash) : "";
  4669. this.$$url = He(this.$$path) + (e ? "?" + e : "") + t, this.$$absUrl = r + this.$$url.substr(1)
  4670. }, this.$$parseLinkUrl = function (o, i) {
  4671. var a, s;
  4672. return (a = We(e, o)) !== n ? (s = a, s = (a = We(t, a)) !== n ? r + (We("/", a) || a) : e + s) : (a = We(r, o)) !== n ? s = r + a : r == o + "/" && (s = r), s && this.$$parse(s), !!s
  4673. }
  4674. }
  4675. function Ke(e, t) {
  4676. var n = Ye(e);
  4677. Ve(e, this, e), this.$$parse = function (r) {
  4678. var o = We(e, r) || We(n, r);
  4679. if (!x(o = "#" == o.charAt(0) ? We(t, o) : this.$$html5 ? o : "")) throw Fn("ihshprfx", r, t);
  4680. ze(o, this, e), r = this.$$path;
  4681. var i = /^\/[A-Z]:(\/.*)/;
  4682. 0 === o.indexOf(e) && (o = o.replace(e, "")), i.exec(o) || (r = (o = i.exec(r)) ? o[1] : r), this.$$path = r, this.$$compose()
  4683. }, this.$$compose = function () {
  4684. var n = q(this.$$search), r = this.$$hash ? "#" + U(this.$$hash) : "";
  4685. this.$$url = He(this.$$path) + (n ? "?" + n : "") + r, this.$$absUrl = e + (this.$$url ? t + this.$$url : "")
  4686. }, this.$$parseLinkUrl = function (t, n) {
  4687. return Ge(e) == Ge(t) && (this.$$parse(t), !0)
  4688. }
  4689. }
  4690. function Qe(e, t) {
  4691. this.$$html5 = !0, Ke.apply(this, arguments);
  4692. var n = Ye(e);
  4693. this.$$parseLinkUrl = function (r, o) {
  4694. var i, a;
  4695. return e == Ge(r) ? i = r : (a = We(n, r)) ? i = e + t + a : n === r + "/" && (i = n), i && this.$$parse(i), !!i
  4696. }, this.$$compose = function () {
  4697. var n = q(this.$$search), r = this.$$hash ? "#" + U(this.$$hash) : "";
  4698. this.$$url = He(this.$$path) + (n ? "?" + n : "") + r, this.$$absUrl = e + t + this.$$url
  4699. }
  4700. }
  4701. function Je(e) {
  4702. return function () {
  4703. return this[e]
  4704. }
  4705. }
  4706. function Ze(e, t) {
  4707. return function (n) {
  4708. return v(n) ? this[e] : (this[e] = t(n), this.$$compose(), this)
  4709. }
  4710. }
  4711. function et() {
  4712. var t = "", n = !1;
  4713. this.hashPrefix = function (e) {
  4714. return b(e) ? (t = e, this) : t
  4715. }, this.html5Mode = function (e) {
  4716. return b(e) ? (n = e, this) : n
  4717. }, this.$get = ["$rootScope", "$browser", "$sniffer", "$rootElement", function (r, o, i, a) {
  4718. function s(e) {
  4719. r.$broadcast("$locationChangeSuccess", l.absUrl(), e)
  4720. }
  4721. var l, c = o.baseHref(), u = o.url();
  4722. n ? (c = u.substring(0, u.indexOf("/", u.indexOf("//") + 2)) + (c || "/"), i = i.history ? Xe : Qe) : (c = Ge(u), i = Ke), (l = new i(c, "#" + t)).$$parseLinkUrl(u, u);
  4723. var f = /^\s*(javascript|mailto):/i;
  4724. a.on("click", function (t) {
  4725. if (!t.ctrlKey && !t.metaKey && 2 != t.which) {
  4726. for (var n = Vt(t.target); "a" !== Xt(n[0].nodeName);) if (n[0] === a[0] || !(n = n.parent())[0]) return;
  4727. var i = n.prop("href"), s = n.attr("href") || n.attr("xlink:href");
  4728. y(i) && "[object SVGAnimatedString]" === i.toString() && (i = wt(i.animVal).href), f.test(i) || !i || n.attr("target") || t.isDefaultPrevented() || !l.$$parseLinkUrl(i, s) || (t.preventDefault(), l.absUrl() != o.url() && (r.$apply(), e.angular["ff-684208-preventDefault"] = !0))
  4729. }
  4730. }), l.absUrl() != u && o.url(l.absUrl(), !0), o.onUrlChange(function (e) {
  4731. l.absUrl() != e && (r.$evalAsync(function () {
  4732. var t = l.absUrl();
  4733. l.$$parse(e), r.$broadcast("$locationChangeStart", e, t).defaultPrevented ? (l.$$parse(t), o.url(t)) : s(t)
  4734. }), r.$$phase || r.$digest())
  4735. });
  4736. var d = 0;
  4737. return r.$watch(function () {
  4738. var e = o.url(), t = l.$$replace;
  4739. return d && e == l.absUrl() || (d++, r.$evalAsync(function () {
  4740. r.$broadcast("$locationChangeStart", l.absUrl(), e).defaultPrevented ? l.$$parse(e) : (o.url(l.absUrl(), t), s(e))
  4741. })), l.$$replace = !1, d
  4742. }), l
  4743. }]
  4744. }
  4745. function tt() {
  4746. var e = !0, t = this;
  4747. this.debugEnabled = function (t) {
  4748. return b(t) ? (e = t, this) : e
  4749. }, this.$get = ["$window", function (n) {
  4750. function r(e) {
  4751. return e instanceof Error && (e.stack ? e = e.message && -1 === e.stack.indexOf(e.message) ? "Error: " + e.message + "\n" + e.stack : e.stack : e.sourceURL && (e = e.message + "\n" + e.sourceURL + ":" + e.line)), e
  4752. }
  4753. function o(e) {
  4754. var t = n.console || {}, o = t[e] || t.log || h;
  4755. e = !1;
  4756. try {
  4757. e = !!o.apply
  4758. } catch (e) {
  4759. }
  4760. return e ? function () {
  4761. var e = [];
  4762. return i(arguments, function (t) {
  4763. e.push(r(t))
  4764. }), o.apply(t, e)
  4765. } : function (e, t) {
  4766. o(e, null == t ? "" : t)
  4767. }
  4768. }
  4769. return {
  4770. log: o("log"), info: o("info"), warn: o("warn"), error: o("error"), debug: function () {
  4771. var n = o("debug");
  4772. return function () {
  4773. e && n.apply(t, arguments)
  4774. }
  4775. }()
  4776. }
  4777. }]
  4778. }
  4779. function nt(e, t) {
  4780. if ("__defineGetter__" === e || "__defineSetter__" === e || "__lookupGetter__" === e || "__lookupSetter__" === e || "__proto__" === e) throw Rn("isecfld", t);
  4781. return e
  4782. }
  4783. function rt(e, t) {
  4784. if (e) {
  4785. if (e.constructor === e) throw Rn("isecfn", t);
  4786. if (e.document && e.location && e.alert && e.setInterval) throw Rn("isecwindow", t);
  4787. if (e.children && (e.nodeName || e.prop && e.attr && e.find)) throw Rn("isecdom", t);
  4788. if (e === Object) throw Rn("isecobj", t)
  4789. }
  4790. return e
  4791. }
  4792. function ot(e, t, r, o, i) {
  4793. rt(e, o), i = i || {}, t = t.split(".");
  4794. for (var a, s = 0; 1 < t.length; s++) {
  4795. var l = rt(e[a = nt(t.shift(), o)], o);
  4796. l || (l = {}, e[a] = l), (e = l).then && i.unwrapPromises && (Bn(o), "$$v" in e || function (e) {
  4797. e.then(function (t) {
  4798. e.$$v = t
  4799. })
  4800. }(e), e.$$v === n && (e.$$v = {}), e = e.$$v)
  4801. }
  4802. return a = nt(t.shift(), o), rt(e[a], o), e[a] = r
  4803. }
  4804. function it(e) {
  4805. return "constructor" == e
  4806. }
  4807. function at(e, t, r, o, i, a, s) {
  4808. nt(e, a), nt(t, a), nt(r, a), nt(o, a), nt(i, a);
  4809. var l = function (e) {
  4810. return rt(e, a)
  4811. }, c = s.expensiveChecks, u = c || it(e) ? l : g, f = c || it(t) ? l : g, d = c || it(r) ? l : g,
  4812. p = c || it(o) ? l : g, h = c || it(i) ? l : g;
  4813. return s.unwrapPromises ? function (s, l) {
  4814. var c, g = l && l.hasOwnProperty(e) ? l : s;
  4815. return null == g ? g : ((g = u(g[e])) && g.then && (Bn(a), "$$v" in g || (c = g, c.$$v = n, c.then(function (e) {
  4816. c.$$v = u(e)
  4817. })), g = u(g.$$v)), t ? null == g ? n : ((g = f(g[t])) && g.then && (Bn(a), "$$v" in g || (c = g, c.$$v = n, c.then(function (e) {
  4818. c.$$v = f(e)
  4819. })), g = f(g.$$v)), r ? null == g ? n : ((g = d(g[r])) && g.then && (Bn(a), "$$v" in g || (c = g, c.$$v = n, c.then(function (e) {
  4820. c.$$v = d(e)
  4821. })), g = d(g.$$v)), o ? null == g ? n : ((g = p(g[o])) && g.then && (Bn(a), "$$v" in g || (c = g, c.$$v = n, c.then(function (e) {
  4822. c.$$v = p(e)
  4823. })), g = p(g.$$v)), i ? null == g ? n : ((g = h(g[i])) && g.then && (Bn(a), "$$v" in g || (c = g, c.$$v = n, c.then(function (e) {
  4824. c.$$v = h(e)
  4825. })), g = h(g.$$v)), g) : g) : g) : g) : g)
  4826. } : function (a, s) {
  4827. var l = s && s.hasOwnProperty(e) ? s : a;
  4828. return null == l ? l : (l = u(l[e]), t ? null == l ? n : (l = f(l[t]), r ? null == l ? n : (l = d(l[r]), o ? null == l ? n : (l = p(l[o]), i ? null == l ? n : l = h(l[i]) : l) : l) : l) : l)
  4829. }
  4830. }
  4831. function st(e, t) {
  4832. return function (n, r) {
  4833. return e(n, r, Bn, rt, t)
  4834. }
  4835. }
  4836. function lt(e, t, r) {
  4837. var o = t.expensiveChecks, a = o ? Xn : Yn;
  4838. if (a.hasOwnProperty(e)) return a[e];
  4839. var s, l = e.split("."), c = l.length;
  4840. if (t.csp) s = 6 > c ? at(l[0], l[1], l[2], l[3], l[4], r, t) : function (e, o) {
  4841. var i, a = 0;
  4842. do {
  4843. i = at(l[a++], l[a++], l[a++], l[a++], l[a++], r, t)(e, o), o = n, e = i
  4844. } while (a < c);
  4845. return i
  4846. }; else {
  4847. var u = "var p;\n";
  4848. o && (u += "s = eso(s, fe);\nl = eso(l, fe);\n");
  4849. var f = o;
  4850. i(l, function (e, n) {
  4851. nt(e, r);
  4852. var i = (n ? "s" : '((l&&l.hasOwnProperty("' + e + '"))?l:s)') + '["' + e + '"]', a = o || it(e);
  4853. a && (i = "eso(" + i + ", fe)", f = !0), u += "if(s == null) return undefined;\ns=" + i + ";\n", t.unwrapPromises && (u += 'if (s && s.then) {\n pw("' + r.replace(/(["\r\n])/g, "\\$1") + '");\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=' + (a ? "eso(v)" : "v") + ";});\n}\n s=" + (a ? "eso(s.$$v)" : "s.$$v") + "\n}\n")
  4854. }), u += "return s;", (s = new Function("s", "l", "pw", "eso", "fe", u)).toString = m(u), (f || t.unwrapPromises) && (s = st(s, r))
  4855. }
  4856. return "hasOwnProperty" !== e && (a[e] = s), s
  4857. }
  4858. function ct() {
  4859. var e = {}, t = {}, n = {csp: !1, unwrapPromises: !1, logPromiseWarnings: !0, expensiveChecks: !1};
  4860. this.unwrapPromises = function (e) {
  4861. return b(e) ? (n.unwrapPromises = !!e, this) : n.unwrapPromises
  4862. }, this.logPromiseWarnings = function (e) {
  4863. return b(e) ? (n.logPromiseWarnings = e, this) : n.logPromiseWarnings
  4864. }, this.$get = ["$filter", "$sniffer", "$log", function (r, o, i) {
  4865. n.csp = o.csp;
  4866. var a = {
  4867. csp: n.csp,
  4868. unwrapPromises: n.unwrapPromises,
  4869. logPromiseWarnings: n.logPromiseWarnings,
  4870. expensiveChecks: !0
  4871. };
  4872. return Bn = function (e) {
  4873. n.logPromiseWarnings && !jn.hasOwnProperty(e) && (jn[e] = !0, i.warn("[$parse] Promise found in the expression `" + e + "`. Automatic unwrapping of promises in Angular expressions is deprecated."))
  4874. }, function (o, i) {
  4875. var s;
  4876. switch (typeof o) {
  4877. case"string":
  4878. var l = i ? t : e;
  4879. if (l.hasOwnProperty(o)) return l[o];
  4880. var c = new Wn(s = i ? a : n);
  4881. return s = new Gn(c, r, s).parse(o), "hasOwnProperty" !== o && (l[o] = s), s;
  4882. case"function":
  4883. return o;
  4884. default:
  4885. return h
  4886. }
  4887. }
  4888. }]
  4889. }
  4890. function ut() {
  4891. this.$get = ["$rootScope", "$exceptionHandler", function (e, t) {
  4892. return ft(function (t) {
  4893. e.$evalAsync(t)
  4894. }, t)
  4895. }]
  4896. }
  4897. function ft(e, t) {
  4898. function r(e) {
  4899. return e
  4900. }
  4901. function o(e) {
  4902. return l(e)
  4903. }
  4904. var a = function () {
  4905. var i, l, u = [];
  4906. return l = {
  4907. resolve: function (t) {
  4908. if (u) {
  4909. var r = u;
  4910. u = n, i = s(t), r.length && e(function () {
  4911. for (var e, t = 0, n = r.length; t < n; t++) e = r[t], i.then(e[0], e[1], e[2])
  4912. })
  4913. }
  4914. }, reject: function (e) {
  4915. l.resolve(c(e))
  4916. }, notify: function (t) {
  4917. if (u) {
  4918. var n = u;
  4919. u.length && e(function () {
  4920. for (var e = 0, r = n.length; e < r; e++) n[e][2](t)
  4921. })
  4922. }
  4923. }, promise: {
  4924. then: function (e, n, s) {
  4925. var l = a(), c = function (n) {
  4926. try {
  4927. l.resolve((k(e) ? e : r)(n))
  4928. } catch (e) {
  4929. l.reject(e), t(e)
  4930. }
  4931. }, f = function (e) {
  4932. try {
  4933. l.resolve((k(n) ? n : o)(e))
  4934. } catch (e) {
  4935. l.reject(e), t(e)
  4936. }
  4937. }, d = function (e) {
  4938. try {
  4939. l.notify((k(s) ? s : r)(e))
  4940. } catch (e) {
  4941. t(e)
  4942. }
  4943. };
  4944. return u ? u.push([c, f, d]) : i.then(c, f, d), l.promise
  4945. }, catch: function (e) {
  4946. return this.then(null, e)
  4947. }, finally: function (e) {
  4948. function t(e, t) {
  4949. var n = a();
  4950. return t ? n.resolve(e) : n.reject(e), n.promise
  4951. }
  4952. function n(n, o) {
  4953. var i = null;
  4954. try {
  4955. i = (e || r)()
  4956. } catch (e) {
  4957. return t(e, !1)
  4958. }
  4959. return i && k(i.then) ? i.then(function () {
  4960. return t(n, o)
  4961. }, function (e) {
  4962. return t(e, !1)
  4963. }) : t(n, o)
  4964. }
  4965. return this.then(function (e) {
  4966. return n(e, !0)
  4967. }, function (e) {
  4968. return n(e, !1)
  4969. })
  4970. }
  4971. }
  4972. }
  4973. }, s = function (t) {
  4974. return t && k(t.then) ? t : {
  4975. then: function (n) {
  4976. var r = a();
  4977. return e(function () {
  4978. r.resolve(n(t))
  4979. }), r.promise
  4980. }
  4981. }
  4982. }, l = function (e) {
  4983. var t = a();
  4984. return t.reject(e), t.promise
  4985. }, c = function (n) {
  4986. return {
  4987. then: function (r, i) {
  4988. var s = a();
  4989. return e(function () {
  4990. try {
  4991. s.resolve((k(i) ? i : o)(n))
  4992. } catch (e) {
  4993. s.reject(e), t(e)
  4994. }
  4995. }), s.promise
  4996. }
  4997. }
  4998. };
  4999. return {
  5000. defer: a, reject: l, when: function (n, i, c, u) {
  5001. var f, d = a(), p = function (e) {
  5002. try {
  5003. return (k(i) ? i : r)(e)
  5004. } catch (e) {
  5005. return t(e), l(e)
  5006. }
  5007. }, h = function (e) {
  5008. try {
  5009. return (k(c) ? c : o)(e)
  5010. } catch (e) {
  5011. return t(e), l(e)
  5012. }
  5013. }, g = function (e) {
  5014. try {
  5015. return (k(u) ? u : r)(e)
  5016. } catch (e) {
  5017. t(e)
  5018. }
  5019. };
  5020. return e(function () {
  5021. s(n).then(function (e) {
  5022. f || (f = !0, d.resolve(s(e).then(p, h, g)))
  5023. }, function (e) {
  5024. f || (f = !0, d.resolve(h(e)))
  5025. }, function (e) {
  5026. f || d.notify(g(e))
  5027. })
  5028. }), d.promise
  5029. }, all: function (e) {
  5030. var t = a(), n = 0, r = on(e) ? [] : {};
  5031. return i(e, function (e, o) {
  5032. n++, s(e).then(function (e) {
  5033. r.hasOwnProperty(o) || (r[o] = e, --n || t.resolve(r))
  5034. }, function (e) {
  5035. r.hasOwnProperty(o) || t.reject(e)
  5036. })
  5037. }), 0 === n && t.resolve(r), t.promise
  5038. }
  5039. }
  5040. }
  5041. function dt() {
  5042. this.$get = ["$window", "$timeout", function (e, t) {
  5043. var n = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame,
  5044. r = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.mozCancelAnimationFrame || e.webkitCancelRequestAnimationFrame,
  5045. o = !!n, i = o ? function (e) {
  5046. var t = n(e);
  5047. return function () {
  5048. r(t)
  5049. }
  5050. } : function (e) {
  5051. var n = t(e, 16.66, !1);
  5052. return function () {
  5053. t.cancel(n)
  5054. }
  5055. };
  5056. return i.supported = o, i
  5057. }]
  5058. }
  5059. function pt() {
  5060. var e = 10, t = r("$rootScope"), n = null;
  5061. this.digestTtl = function (t) {
  5062. return arguments.length && (e = t), e
  5063. }, this.$get = ["$injector", "$exceptionHandler", "$parse", "$browser", function (r, a, s, l) {
  5064. function u() {
  5065. this.$id = c(), this.$$phase = this.$parent = this.$$watchers = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = null, this.this = this.$root = this, this.$$destroyed = !1, this.$$asyncQueue = [], this.$$postDigestQueue = [], this.$$listeners = {}, this.$$listenerCount = {}, this.$$isolateBindings = {}
  5066. }
  5067. function f(e) {
  5068. if (m.$$phase) throw t("inprog", m.$$phase);
  5069. m.$$phase = e
  5070. }
  5071. function d(e, t) {
  5072. var n = s(e);
  5073. return Y(n, t), n
  5074. }
  5075. function p(e, t, n) {
  5076. do {
  5077. e.$$listenerCount[n] -= t, 0 === e.$$listenerCount[n] && delete e.$$listenerCount[n]
  5078. } while (e = e.$parent)
  5079. }
  5080. function g() {
  5081. }
  5082. u.prototype = {
  5083. constructor: u, $new: function (e) {
  5084. return e ? (e = new u, e.$root = this.$root, e.$$asyncQueue = this.$$asyncQueue, e.$$postDigestQueue = this.$$postDigestQueue) : (this.$$childScopeClass || (this.$$childScopeClass = function () {
  5085. this.$$watchers = this.$$nextSibling = this.$$childHead = this.$$childTail = null, this.$$listeners = {}, this.$$listenerCount = {}, this.$id = c(), this.$$childScopeClass = null
  5086. }, this.$$childScopeClass.prototype = this), e = new this.$$childScopeClass), e.this = e, e.$parent = this, e.$$prevSibling = this.$$childTail, this.$$childHead ? this.$$childTail = this.$$childTail.$$nextSibling = e : this.$$childHead = this.$$childTail = e, e
  5087. }, $watch: function (e, t, r) {
  5088. var o = d(e, "watch"), i = this.$$watchers, a = {fn: t, last: g, get: o, exp: e, eq: !!r};
  5089. if (n = null, !k(t)) {
  5090. var s = d(t || h, "listener");
  5091. a.fn = function (e, t, n) {
  5092. s(n)
  5093. }
  5094. }
  5095. if ("string" == typeof e && o.constant) {
  5096. var l = a.fn;
  5097. a.fn = function (e, t, n) {
  5098. l.call(this, e, t, n), N(i, a)
  5099. }
  5100. }
  5101. return i || (i = this.$$watchers = []), i.unshift(a), function () {
  5102. N(i, a), n = null
  5103. }
  5104. }, $watchCollection: function (e, t) {
  5105. var n, r, i, a = this, l = 1 < t.length, c = 0, u = s(e), f = [], d = {}, p = !0, h = 0;
  5106. return this.$watch(function () {
  5107. var e, t;
  5108. if (y(n = u(a))) if (o(n)) for (r !== f && (r = f, h = r.length = 0, c++), e = n.length, h !== e && (c++, r.length = h = e), t = 0; t < e; t++) r[t] != r[t] && n[t] != n[t] || r[t] === n[t] || (c++, r[t] = n[t]); else {
  5109. r !== d && (r = d = {}, h = 0, c++), e = 0;
  5110. for (t in n) n.hasOwnProperty(t) && (e++, r.hasOwnProperty(t) ? r[t] != r[t] && n[t] != n[t] || r[t] === n[t] || (c++, r[t] = n[t]) : (h++, r[t] = n[t], c++));
  5111. if (h > e) for (t in c++, r) r.hasOwnProperty(t) && !n.hasOwnProperty(t) && (h--, delete r[t])
  5112. } else r !== n && (r = n, c++);
  5113. return c
  5114. }, function () {
  5115. if (p ? (p = !1, t(n, n, a)) : t(n, i, a), l) if (y(n)) if (o(n)) {
  5116. i = Array(n.length);
  5117. for (var e = 0; e < n.length; e++) i[e] = n[e]
  5118. } else for (e in i = {}, n) Kt.call(n, e) && (i[e] = n[e]); else i = n
  5119. })
  5120. }, $digest: function () {
  5121. var r, o, i, s, c, u, d, p, h, v, b = this.$$asyncQueue, y = this.$$postDigestQueue, x = e, w = [];
  5122. f("$digest"), l.$$checkUrlChange(), n = null;
  5123. do {
  5124. for (u = !1, d = this; b.length;) {
  5125. try {
  5126. (v = b.shift()).scope.$eval(v.expression)
  5127. } catch (e) {
  5128. m.$$phase = null, a(e)
  5129. }
  5130. n = null
  5131. }
  5132. e:do {
  5133. if (s = d.$$watchers) for (c = s.length; c--;) try {
  5134. if (r = s[c]) if ((o = r.get(d)) === (i = r.last) || (r.eq ? D(o, i) : "number" == typeof o && "number" == typeof i && isNaN(o) && isNaN(i))) {
  5135. if (r === n) {
  5136. u = !1;
  5137. break e
  5138. }
  5139. } else u = !0, n = r, r.last = r.eq ? P(o, null) : o, r.fn(o, i === g ? o : i, d), 5 > x && (p = 4 - x, w[p] || (w[p] = []), h = k(r.exp) ? "fn: " + (r.exp.name || r.exp.toString()) : r.exp, h += "; newVal: " + _(o) + "; oldVal: " + _(i), w[p].push(h))
  5140. } catch (e) {
  5141. m.$$phase = null, a(e)
  5142. }
  5143. if (!(s = d.$$childHead || d !== this && d.$$nextSibling)) for (; d !== this && !(s = d.$$nextSibling);) d = d.$parent
  5144. } while (d = s);
  5145. if ((u || b.length) && !x--) throw m.$$phase = null, t("infdig", e, _(w))
  5146. } while (u || b.length);
  5147. for (m.$$phase = null; y.length;) try {
  5148. y.shift()()
  5149. } catch (e) {
  5150. a(e)
  5151. }
  5152. }, $destroy: function () {
  5153. if (!this.$$destroyed) {
  5154. var e = this.$parent;
  5155. this.$broadcast("$destroy"), this.$$destroyed = !0, this !== m && (i(this.$$listenerCount, I(null, p, this)), e.$$childHead == this && (e.$$childHead = this.$$nextSibling), e.$$childTail == this && (e.$$childTail = this.$$prevSibling), this.$$prevSibling && (this.$$prevSibling.$$nextSibling = this.$$nextSibling), this.$$nextSibling && (this.$$nextSibling.$$prevSibling = this.$$prevSibling), this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = this.$root = null, this.$$listeners = {}, this.$$watchers = this.$$asyncQueue = this.$$postDigestQueue = [], this.$destroy = this.$digest = this.$apply = h, this.$on = this.$watch = function () {
  5156. return h
  5157. })
  5158. }
  5159. }, $eval: function (e, t) {
  5160. return s(e)(this, t)
  5161. }, $evalAsync: function (e) {
  5162. m.$$phase || m.$$asyncQueue.length || l.defer(function () {
  5163. m.$$asyncQueue.length && m.$digest()
  5164. }), this.$$asyncQueue.push({scope: this, expression: e})
  5165. }, $$postDigest: function (e) {
  5166. this.$$postDigestQueue.push(e)
  5167. }, $apply: function (e) {
  5168. try {
  5169. return f("$apply"), this.$eval(e)
  5170. } catch (e) {
  5171. a(e)
  5172. } finally {
  5173. m.$$phase = null;
  5174. try {
  5175. m.$digest()
  5176. } catch (e) {
  5177. throw a(e), e
  5178. }
  5179. }
  5180. }, $on: function (e, t) {
  5181. var n = this.$$listeners[e];
  5182. n || (this.$$listeners[e] = n = []), n.push(t);
  5183. var r = this;
  5184. do {
  5185. r.$$listenerCount[e] || (r.$$listenerCount[e] = 0), r.$$listenerCount[e]++
  5186. } while (r = r.$parent);
  5187. var o = this;
  5188. return function () {
  5189. var r = A(n, t);
  5190. -1 !== r && (n[r] = null, p(o, 1, e))
  5191. }
  5192. }, $emit: function (e, t) {
  5193. var n, r, o, i = [], s = this, l = !1, c = {
  5194. name: e, targetScope: s, stopPropagation: function () {
  5195. l = !0
  5196. }, preventDefault: function () {
  5197. c.defaultPrevented = !0
  5198. }, defaultPrevented: !1
  5199. }, u = [c].concat(Jt.call(arguments, 1));
  5200. do {
  5201. for (n = s.$$listeners[e] || i, c.currentScope = s, r = 0, o = n.length; r < o; r++) if (n[r]) try {
  5202. n[r].apply(null, u)
  5203. } catch (e) {
  5204. a(e)
  5205. } else n.splice(r, 1), r--, o--;
  5206. if (l) break;
  5207. s = s.$parent
  5208. } while (s);
  5209. return c
  5210. }, $broadcast: function (e, t) {
  5211. for (var n, r, o = this, i = this, s = {
  5212. name: e, targetScope: this, preventDefault: function () {
  5213. s.defaultPrevented = !0
  5214. }, defaultPrevented: !1
  5215. }, l = [s].concat(Jt.call(arguments, 1)); o = i;) {
  5216. for (s.currentScope = o, n = 0, r = (i = o.$$listeners[e] || []).length; n < r; n++) if (i[n]) try {
  5217. i[n].apply(null, l)
  5218. } catch (e) {
  5219. a(e)
  5220. } else i.splice(n, 1), n--, r--;
  5221. if (!(i = o.$$listenerCount[e] && o.$$childHead || o !== this && o.$$nextSibling)) for (; o !== this && !(i = o.$$nextSibling);) o = o.$parent
  5222. }
  5223. return s
  5224. }
  5225. };
  5226. var m = new u;
  5227. return m
  5228. }]
  5229. }
  5230. function ht() {
  5231. var e = /^\s*(https?|ftp|mailto|tel|file):/, t = /^\s*((https?|ftp|file):|data:image\/)/;
  5232. this.aHrefSanitizationWhitelist = function (t) {
  5233. return b(t) ? (e = t, this) : e
  5234. }, this.imgSrcSanitizationWhitelist = function (e) {
  5235. return b(e) ? (t = e, this) : t
  5236. }, this.$get = function () {
  5237. return function (n, r) {
  5238. var o, i = r ? t : e;
  5239. return Ht && !(8 <= Ht) || "" === (o = wt(n).href) || o.match(i) ? n : "unsafe:" + o
  5240. }
  5241. }
  5242. }
  5243. function gt(e) {
  5244. if ("self" === e) return e;
  5245. if (x(e)) {
  5246. if (-1 < e.indexOf("***")) throw Kn("iwcard", e);
  5247. return e = e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08").replace("\\*\\*", ".*").replace("\\*", "[^:/.?&;]*"), RegExp("^" + e + "$")
  5248. }
  5249. if (T(e)) return RegExp("^" + e.source + "$");
  5250. throw Kn("imatcher")
  5251. }
  5252. function mt(e) {
  5253. var t = [];
  5254. return b(e) && i(e, function (e) {
  5255. t.push(gt(e))
  5256. }), t
  5257. }
  5258. function vt() {
  5259. this.SCE_CONTEXTS = Qn;
  5260. var e = ["self"], t = [];
  5261. this.resourceUrlWhitelist = function (t) {
  5262. return arguments.length && (e = mt(t)), e
  5263. }, this.resourceUrlBlacklist = function (e) {
  5264. return arguments.length && (t = mt(e)), t
  5265. }, this.$get = ["$injector", function (r) {
  5266. function o(e) {
  5267. var t = function (e) {
  5268. this.$$unwrapTrustedValue = function () {
  5269. return e
  5270. }
  5271. };
  5272. return e && (t.prototype = new e), t.prototype.valueOf = function () {
  5273. return this.$$unwrapTrustedValue()
  5274. }, t.prototype.toString = function () {
  5275. return this.$$unwrapTrustedValue().toString()
  5276. }, t
  5277. }
  5278. var i = function (e) {
  5279. throw Kn("unsafe")
  5280. };
  5281. r.has("$sanitize") && (i = r.get("$sanitize"));
  5282. var a = o(), s = {};
  5283. return s[Qn.HTML] = o(a), s[Qn.CSS] = o(a), s[Qn.URL] = o(a), s[Qn.JS] = o(a), s[Qn.RESOURCE_URL] = o(s[Qn.URL]), {
  5284. trustAs: function (e, t) {
  5285. var r = s.hasOwnProperty(e) ? s[e] : null;
  5286. if (!r) throw Kn("icontext", e, t);
  5287. if (null === t || t === n || "" === t) return t;
  5288. if ("string" != typeof t) throw Kn("itype", e);
  5289. return new r(t)
  5290. }, getTrusted: function (r, o) {
  5291. if (null === o || o === n || "" === o) return o;
  5292. if ((c = s.hasOwnProperty(r) ? s[r] : null) && o instanceof c) return o.$$unwrapTrustedValue();
  5293. if (r === Qn.RESOURCE_URL) {
  5294. var a, l, c = wt(o.toString()), u = !1;
  5295. for (a = 0, l = e.length; a < l; a++) if ("self" === e[a] ? $t(c) : e[a].exec(c.href)) {
  5296. u = !0;
  5297. break
  5298. }
  5299. if (u) for (a = 0, l = t.length; a < l; a++) if ("self" === t[a] ? $t(c) : t[a].exec(c.href)) {
  5300. u = !1;
  5301. break
  5302. }
  5303. if (u) return o;
  5304. throw Kn("insecurl", o.toString())
  5305. }
  5306. if (r === Qn.HTML) return i(o);
  5307. throw Kn("unsafe")
  5308. }, valueOf: function (e) {
  5309. return e instanceof a ? e.$$unwrapTrustedValue() : e
  5310. }
  5311. }
  5312. }]
  5313. }
  5314. function bt() {
  5315. var e = !0;
  5316. this.enabled = function (t) {
  5317. return arguments.length && (e = !!t), e
  5318. }, this.$get = ["$parse", "$sniffer", "$sceDelegate", function (t, n, r) {
  5319. if (e && n.msie && 8 > n.msieDocumentMode) throw Kn("iequirks");
  5320. var o = O(Qn);
  5321. o.isEnabled = function () {
  5322. return e
  5323. }, o.trustAs = r.trustAs, o.getTrusted = r.getTrusted, o.valueOf = r.valueOf, e || (o.trustAs = o.getTrusted = function (e, t) {
  5324. return t
  5325. }, o.valueOf = g), o.parseAs = function (e, n) {
  5326. var r = t(n);
  5327. return r.literal && r.constant ? r : function (t, n) {
  5328. return o.getTrusted(e, r(t, n))
  5329. }
  5330. };
  5331. var a = o.parseAs, s = o.getTrusted, l = o.trustAs;
  5332. return i(Qn, function (e, t) {
  5333. var n = Xt(t);
  5334. o[Z("parse_as_" + n)] = function (t) {
  5335. return a(e, t)
  5336. }, o[Z("get_trusted_" + n)] = function (t) {
  5337. return s(e, t)
  5338. }, o[Z("trust_as_" + n)] = function (t) {
  5339. return l(e, t)
  5340. }
  5341. }), o
  5342. }]
  5343. }
  5344. function yt() {
  5345. this.$get = ["$window", "$document", function (e, t) {
  5346. var n, r = {}, o = d((/android (\d+)/.exec(Xt((e.navigator || {}).userAgent)) || [])[1]),
  5347. i = /Boxee/i.test((e.navigator || {}).userAgent), a = t[0] || {}, s = a.documentMode,
  5348. l = /^(Moz|webkit|O|ms)(?=[A-Z])/, c = a.body && a.body.style, u = !1, f = !1;
  5349. if (c) {
  5350. for (var p in c) if (u = l.exec(p)) {
  5351. n = (n = u[0]).substr(0, 1).toUpperCase() + n.substr(1);
  5352. break
  5353. }
  5354. n || (n = "WebkitOpacity" in c && "webkit"), u = !!("transition" in c || n + "Transition" in c), f = !!("animation" in c || n + "Animation" in c), !o || u && f || (u = x(a.body.style.webkitTransition), f = x(a.body.style.webkitAnimation))
  5355. }
  5356. return {
  5357. history: !(!e.history || !e.history.pushState || 4 > o || i),
  5358. hashchange: "onhashchange" in e && (!s || 7 < s),
  5359. hasEvent: function (e) {
  5360. if ("input" == e && 9 == Ht) return !1;
  5361. if (v(r[e])) {
  5362. var t = a.createElement("div");
  5363. r[e] = "on" + e in t
  5364. }
  5365. return r[e]
  5366. },
  5367. csp: sn(),
  5368. vendorPrefix: n,
  5369. transitions: u,
  5370. animations: f,
  5371. android: o,
  5372. msie: Ht,
  5373. msieDocumentMode: s
  5374. }
  5375. }]
  5376. }
  5377. function xt() {
  5378. this.$get = ["$rootScope", "$browser", "$q", "$exceptionHandler", function (e, t, n, r) {
  5379. function o(o, a, s) {
  5380. var l = n.defer(), c = l.promise, u = b(s) && !s;
  5381. return a = t.defer(function () {
  5382. try {
  5383. l.resolve(o())
  5384. } catch (e) {
  5385. l.reject(e), r(e)
  5386. } finally {
  5387. delete i[c.$$timeoutId]
  5388. }
  5389. u || e.$apply()
  5390. }, a), c.$$timeoutId = a, i[a] = l, c
  5391. }
  5392. var i = {};
  5393. return o.cancel = function (e) {
  5394. return !!(e && e.$$timeoutId in i) && (i[e.$$timeoutId].reject("canceled"), delete i[e.$$timeoutId], t.defer.cancel(e.$$timeoutId))
  5395. }, o
  5396. }]
  5397. }
  5398. function wt(e, t) {
  5399. var n = e;
  5400. return Ht && (Jn.setAttribute("href", n), n = Jn.href), Jn.setAttribute("href", n), {
  5401. href: Jn.href,
  5402. protocol: Jn.protocol ? Jn.protocol.replace(/:$/, "") : "",
  5403. host: Jn.host,
  5404. search: Jn.search ? Jn.search.replace(/^\?/, "") : "",
  5405. hash: Jn.hash ? Jn.hash.replace(/^#/, "") : "",
  5406. hostname: Jn.hostname,
  5407. port: Jn.port,
  5408. pathname: "/" === Jn.pathname.charAt(0) ? Jn.pathname : "/" + Jn.pathname
  5409. }
  5410. }
  5411. function $t(e) {
  5412. return (e = x(e) ? wt(e) : e).protocol === Zn.protocol && e.host === Zn.host
  5413. }
  5414. function kt() {
  5415. this.$get = m(e)
  5416. }
  5417. function Tt(e) {
  5418. function t(r, o) {
  5419. if (y(r)) {
  5420. var a = {};
  5421. return i(r, function (e, n) {
  5422. a[n] = t(n, e)
  5423. }), a
  5424. }
  5425. return e.factory(r + n, o)
  5426. }
  5427. var n = "Filter";
  5428. this.register = t, this.$get = ["$injector", function (e) {
  5429. return function (t) {
  5430. return e.get(t + n)
  5431. }
  5432. }], t("currency", Ct), t("date", Dt), t("filter", St), t("json", It), t("limitTo", Mt), t("lowercase", or), t("number", Et), t("orderBy", _t), t("uppercase", ir)
  5433. }
  5434. function St() {
  5435. return function (e, t, n) {
  5436. if (!on(e)) return e;
  5437. var r = typeof n, o = [];
  5438. o.check = function (e) {
  5439. for (var t = 0; t < o.length; t++) if (!o[t](e)) return !1;
  5440. return !0
  5441. }, "function" !== r && (n = "boolean" === r && n ? function (e, t) {
  5442. return nn.equals(e, t)
  5443. } : function (e, t) {
  5444. if (e && t && "object" == typeof e && "object" == typeof t) {
  5445. for (var r in e) if ("$" !== r.charAt(0) && Kt.call(e, r) && n(e[r], t[r])) return !0;
  5446. return !1
  5447. }
  5448. return t = ("" + t).toLowerCase(), -1 < ("" + e).toLowerCase().indexOf(t)
  5449. });
  5450. var i = function (e, t) {
  5451. if ("string" == typeof t && "!" === t.charAt(0)) return !i(e, t.substr(1));
  5452. switch (typeof e) {
  5453. case"boolean":
  5454. case"number":
  5455. case"string":
  5456. return n(e, t);
  5457. case"object":
  5458. switch (typeof t) {
  5459. case"object":
  5460. return n(e, t);
  5461. default:
  5462. for (var r in e) if ("$" !== r.charAt(0) && i(e[r], t)) return !0
  5463. }
  5464. return !1;
  5465. case"array":
  5466. for (r = 0; r < e.length; r++) if (i(e[r], t)) return !0;
  5467. return !1;
  5468. default:
  5469. return !1
  5470. }
  5471. };
  5472. switch (typeof t) {
  5473. case"boolean":
  5474. case"number":
  5475. case"string":
  5476. t = {$: t};
  5477. case"object":
  5478. for (var a in t) !function (e) {
  5479. void 0 !== t[e] && o.push(function (n) {
  5480. return i("$" == e ? n : n && n[e], t[e])
  5481. })
  5482. }(a);
  5483. break;
  5484. case"function":
  5485. o.push(t);
  5486. break;
  5487. default:
  5488. return e
  5489. }
  5490. for (r = [], a = 0; a < e.length; a++) {
  5491. var s = e[a];
  5492. o.check(s) && r.push(s)
  5493. }
  5494. return r
  5495. }
  5496. }
  5497. function Ct(e) {
  5498. var t = e.NUMBER_FORMATS;
  5499. return function (e, n) {
  5500. return v(n) && (n = t.CURRENCY_SYM), At(e, t.PATTERNS[1], t.GROUP_SEP, t.DECIMAL_SEP, 2).replace(/\u00A4/g, n)
  5501. }
  5502. }
  5503. function Et(e) {
  5504. var t = e.NUMBER_FORMATS;
  5505. return function (e, n) {
  5506. return At(e, t.PATTERNS[0], t.GROUP_SEP, t.DECIMAL_SEP, n)
  5507. }
  5508. }
  5509. function At(e, t, n, r, o) {
  5510. if (null == e || !isFinite(e) || y(e)) return "";
  5511. var i = 0 > e, a = (e = Math.abs(e)) + "", s = "", l = [], c = !1;
  5512. if (-1 !== a.indexOf("e") && ((u = a.match(/([\d\.]+)e(-?)(\d+)/)) && "-" == u[2] && u[3] > o + 1 ? (a = "0", e = 0) : (s = a, c = !0)), c) 0 < o && -1 < e && 1 > e && (s = e.toFixed(o)); else {
  5513. a = (a.split(er)[1] || "").length, v(o) && (o = Math.min(Math.max(t.minFrac, a), t.maxFrac)), 0 === (e = +(Math.round(+(e.toString() + "e" + o)).toString() + "e" + -o)) && (i = !1), a = (e = ("" + e).split(er))[0], e = e[1] || "";
  5514. var u = 0, f = t.lgSize, d = t.gSize;
  5515. if (a.length >= f + d) for (u = a.length - f, c = 0; c < u; c++) 0 == (u - c) % d && 0 !== c && (s += n), s += a.charAt(c);
  5516. for (c = u; c < a.length; c++) 0 == (a.length - c) % f && 0 !== c && (s += n), s += a.charAt(c);
  5517. for (; e.length < o;) e += "0";
  5518. o && "0" !== o && (s += r + e.substr(0, o))
  5519. }
  5520. return l.push(i ? t.negPre : t.posPre), l.push(s), l.push(i ? t.negSuf : t.posSuf), l.join("")
  5521. }
  5522. function Nt(e, t, n) {
  5523. var r = "";
  5524. for (0 > e && (r = "-", e = -e), e = "" + e; e.length < t;) e = "0" + e;
  5525. return n && (e = e.substr(e.length - t)), r + e
  5526. }
  5527. function Pt(e, t, n, r) {
  5528. return n = n || 0, function (o) {
  5529. return o = o["get" + e](), (0 < n || o > -n) && (o += n), 0 === o && -12 == n && (o = 12), Nt(o, t, r)
  5530. }
  5531. }
  5532. function Ot(e, t) {
  5533. return function (n, r) {
  5534. var o = n["get" + e]();
  5535. return r[Qt(t ? "SHORT" + e : e)][o]
  5536. }
  5537. }
  5538. function Dt(e) {
  5539. function t(e) {
  5540. var t;
  5541. if (t = e.match(n)) {
  5542. e = new Date(0);
  5543. var r = 0, o = 0, i = t[8] ? e.setUTCFullYear : e.setFullYear, a = t[8] ? e.setUTCHours : e.setHours;
  5544. t[9] && (r = d(t[9] + t[10]), o = d(t[9] + t[11])), i.call(e, d(t[1]), d(t[2]) - 1, d(t[3])), r = d(t[4] || 0) - r, o = d(t[5] || 0) - o, i = d(t[6] || 0), t = Math.round(1e3 * parseFloat("0." + (t[7] || 0))), a.call(e, r, o, i, t)
  5545. }
  5546. return e
  5547. }
  5548. var n = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
  5549. return function (n, r) {
  5550. var o, a, s = "", l = [];
  5551. if (r = r || "mediumDate", r = e.DATETIME_FORMATS[r] || r, x(n) && (n = rr.test(n) ? d(n) : t(n)), w(n) && (n = new Date(n)), !$(n)) return n;
  5552. for (; r;) (a = nr.exec(r)) ? (l = l.concat(Jt.call(a, 1)), r = l.pop()) : (l.push(r), r = null);
  5553. return i(l, function (t) {
  5554. o = tr[t], s += o ? o(n, e.DATETIME_FORMATS) : t.replace(/(^'|'$)/g, "").replace(/''/g, "'")
  5555. }), s
  5556. }
  5557. }
  5558. function It() {
  5559. return function (e) {
  5560. return _(e, !0)
  5561. }
  5562. }
  5563. function Mt() {
  5564. return function (e, t) {
  5565. if (!on(e) && !x(e)) return e;
  5566. if (t = 1 / 0 === Math.abs(Number(t)) ? Number(t) : d(t), x(e)) return t ? 0 <= t ? e.slice(0, t) : e.slice(t, e.length) : "";
  5567. var n, r, o = [];
  5568. for (t > e.length ? t = e.length : t < -e.length && (t = -e.length), 0 < t ? (n = 0, r = t) : (n = e.length + t, r = e.length); n < r; n++) o.push(e[n]);
  5569. return o
  5570. }
  5571. }
  5572. function _t(e) {
  5573. return function (t, n, r) {
  5574. function i(e, t) {
  5575. return F(t) ? function (t, n) {
  5576. return e(n, t)
  5577. } : e
  5578. }
  5579. function a(e, t) {
  5580. var n = typeof e, r = typeof t;
  5581. return n == r ? ($(e) && $(t) && (e = e.valueOf(), t = t.valueOf()), "string" == n && (e = e.toLowerCase(), t = t.toLowerCase()), e === t ? 0 : e < t ? -1 : 1) : n < r ? -1 : 1
  5582. }
  5583. return o(t) ? (0 === (n = on(n) ? n : [n]).length && (n = ["+"]), n = E(n, function (t) {
  5584. var n = !1, r = t || g;
  5585. if (x(t)) {
  5586. if ("+" != t.charAt(0) && "-" != t.charAt(0) || (n = "-" == t.charAt(0), t = t.substring(1)), "" === t) return i(function (e, t) {
  5587. return a(e, t)
  5588. }, n);
  5589. if ((r = e(t)).constant) {
  5590. var o = r();
  5591. return i(function (e, t) {
  5592. return a(e[o], t[o])
  5593. }, n)
  5594. }
  5595. }
  5596. return i(function (e, t) {
  5597. return a(r(e), r(t))
  5598. }, n)
  5599. }), Jt.call(t).sort(i(function (e, t) {
  5600. for (var r = 0; r < n.length; r++) {
  5601. var o = n[r](e, t);
  5602. if (0 !== o) return o
  5603. }
  5604. return 0
  5605. }, r))) : t
  5606. }
  5607. }
  5608. function Lt(e) {
  5609. return k(e) && (e = {link: e}), e.restrict = e.restrict || "AC", m(e)
  5610. }
  5611. function Ft(e, t, n, r) {
  5612. function o(t, n) {
  5613. n = n ? "-" + W(n, "-") : "", r.setClass(e, (t ? br : yr) + n, (t ? yr : br) + n)
  5614. }
  5615. var a = this, s = e.parent().controller("form") || lr, l = 0, c = a.$error = {}, u = [];
  5616. a.$name = t.name || t.ngForm, a.$dirty = !1, a.$pristine = !0, a.$valid = !0, a.$invalid = !1, s.$addControl(a), e.addClass(xr), o(!0), a.$addControl = function (e) {
  5617. X(e.$name, "input"), u.push(e), e.$name && (a[e.$name] = e)
  5618. }, a.$removeControl = function (e) {
  5619. e.$name && a[e.$name] === e && delete a[e.$name], i(c, function (t, n) {
  5620. a.$setValidity(n, !0, e)
  5621. }), N(u, e)
  5622. }, a.$setValidity = function (e, t, n) {
  5623. var r = c[e];
  5624. if (t) r && (N(r, n), r.length || (--l || (o(t), a.$valid = !0, a.$invalid = !1), c[e] = !1, o(!0, e), s.$setValidity(e, !0, a))); else {
  5625. if (l || o(t), r) {
  5626. if (-1 != A(r, n)) return
  5627. } else c[e] = r = [], l++, o(!1, e), s.$setValidity(e, !1, a);
  5628. r.push(n), a.$valid = !1, a.$invalid = !0
  5629. }
  5630. }, a.$setDirty = function () {
  5631. r.removeClass(e, xr), r.addClass(e, wr), a.$dirty = !0, a.$pristine = !1, s.$setDirty()
  5632. }, a.$setPristine = function () {
  5633. r.removeClass(e, wr), r.addClass(e, xr), a.$dirty = !1, a.$pristine = !0, i(u, function (e) {
  5634. e.$setPristine()
  5635. })
  5636. }
  5637. }
  5638. function Bt(e, t, r, o) {
  5639. return e.$setValidity(t, r), r ? o : n
  5640. }
  5641. function Rt(e, t) {
  5642. var n, r;
  5643. if (t) for (n = 0; n < t.length; ++n) if (r = t[n], e[r]) return !0;
  5644. return !1
  5645. }
  5646. function jt(e, t, n, r, o) {
  5647. y(o) && (e.$$hasNativeValidators = !0, e.$parsers.push(function (i) {
  5648. if (e.$error[t] || Rt(o, r) || !Rt(o, n)) return i;
  5649. e.$setValidity(t, !1)
  5650. }))
  5651. }
  5652. function qt(e, t, n, o, i, a) {
  5653. var s = t.prop(Yt), l = t[0].placeholder, c = {}, u = Xt(t[0].type);
  5654. if (o.$$validityState = s, !i.android) {
  5655. var f = !1;
  5656. t.on("compositionstart", function (e) {
  5657. f = !0
  5658. }), t.on("compositionend", function () {
  5659. f = !1, p()
  5660. })
  5661. }
  5662. var p = function (r) {
  5663. if (!f) {
  5664. var i = t.val();
  5665. Ht && "input" === (r || c).type && t[0].placeholder !== l ? l = t[0].placeholder : ("password" !== u && F(n.ngTrim || "T") && (i = an(i)), r = s && o.$$hasNativeValidators, (o.$viewValue !== i || "" === i && r) && (e.$root.$$phase ? o.$setViewValue(i) : e.$apply(function () {
  5666. o.$setViewValue(i)
  5667. })))
  5668. }
  5669. };
  5670. if (i.hasEvent("input")) t.on("input", p); else {
  5671. var h, g = function () {
  5672. h || (h = a.defer(function () {
  5673. p(), h = null
  5674. }))
  5675. };
  5676. t.on("keydown", function (e) {
  5677. 91 === (e = e.keyCode) || 15 < e && 19 > e || 37 <= e && 40 >= e || g()
  5678. }), i.hasEvent("paste") && t.on("paste cut", g)
  5679. }
  5680. t.on("change", p), o.$render = function () {
  5681. t.val(o.$isEmpty(o.$viewValue) ? "" : o.$viewValue)
  5682. };
  5683. var m = n.ngPattern;
  5684. if (m && ((i = m.match(/^\/(.*)\/([gim]*)$/)) ? (m = RegExp(i[1], i[2]), i = function (e) {
  5685. return Bt(o, "pattern", o.$isEmpty(e) || m.test(e), e)
  5686. }) : i = function (n) {
  5687. var i = e.$eval(m);
  5688. if (!i || !i.test) throw r("ngPattern")("noregexp", m, i, B(t));
  5689. return Bt(o, "pattern", o.$isEmpty(n) || i.test(n), n)
  5690. }, o.$formatters.push(i), o.$parsers.push(i)), n.ngMinlength) {
  5691. var v = d(n.ngMinlength);
  5692. i = function (e) {
  5693. return Bt(o, "minlength", o.$isEmpty(e) || e.length >= v, e)
  5694. }, o.$parsers.push(i), o.$formatters.push(i)
  5695. }
  5696. if (n.ngMaxlength) {
  5697. var b = d(n.ngMaxlength);
  5698. i = function (e) {
  5699. return Bt(o, "maxlength", o.$isEmpty(e) || e.length <= b, e)
  5700. }, o.$parsers.push(i), o.$formatters.push(i)
  5701. }
  5702. }
  5703. function Ut(e, t) {
  5704. return e = "ngClass" + e, ["$animate", function (n) {
  5705. function r(e, t) {
  5706. var n = [], r = 0;
  5707. e:for (; r < e.length; r++) {
  5708. for (var o = e[r], i = 0; i < t.length; i++) if (o == t[i]) continue e;
  5709. n.push(o)
  5710. }
  5711. return n
  5712. }
  5713. function o(e) {
  5714. if (!on(e)) {
  5715. if (x(e)) return e.split(" ");
  5716. if (y(e)) {
  5717. var t = [];
  5718. return i(e, function (e, n) {
  5719. e && (t = t.concat(n.split(" ")))
  5720. }), t
  5721. }
  5722. }
  5723. return e
  5724. }
  5725. return {
  5726. restrict: "AC", link: function (a, s, l) {
  5727. function c(e, t) {
  5728. var n = s.data("$classCounts") || {}, r = [];
  5729. return i(e, function (e) {
  5730. (0 < t || n[e]) && (n[e] = (n[e] || 0) + t, n[e] === +(0 < t) && r.push(e))
  5731. }), s.data("$classCounts", n), r.join(" ")
  5732. }
  5733. function u(e) {
  5734. if (!0 === t || a.$index % 2 === t) {
  5735. d = o(e || []);
  5736. if (f) {
  5737. if (!D(e, f)) {
  5738. var i = o(f), u = r(d, i), d = c(d = r(i, d), -1);
  5739. 0 === (u = c(u, 1)).length ? n.removeClass(s, d) : 0 === d.length ? n.addClass(s, u) : n.setClass(s, u, d)
  5740. }
  5741. } else {
  5742. u = c(d, 1);
  5743. l.$addClass(u)
  5744. }
  5745. }
  5746. f = O(e)
  5747. }
  5748. var f;
  5749. a.$watch(l[e], u, !0), l.$observe("class", function (t) {
  5750. u(a.$eval(l[e]))
  5751. }), "ngClass" !== e && a.$watch("$index", function (n, r) {
  5752. var i = 1 & n;
  5753. if (i !== (1 & r)) {
  5754. var s = o(a.$eval(l[e]));
  5755. i === t ? (i = c(s, 1), l.$addClass(i)) : (i = c(s, -1), l.$removeClass(i))
  5756. }
  5757. })
  5758. }
  5759. }
  5760. }]
  5761. }
  5762. var Ht, Vt, zt, Wt, Gt, Yt = "validity", Xt = function (e) {
  5763. return x(e) ? e.toLowerCase() : e
  5764. }, Kt = Object.prototype.hasOwnProperty, Qt = function (e) {
  5765. return x(e) ? e.toUpperCase() : e
  5766. }, Jt = [].slice, Zt = [].push, en = Object.prototype.toString, tn = r("ng"), nn = e.angular || (e.angular = {}),
  5767. rn = ["0", "0", "0"];
  5768. Ht = d((/msie (\d+)/.exec(Xt(navigator.userAgent)) || [])[1]), isNaN(Ht) && (Ht = d((/trident\/.*; rv:(\d+)/.exec(Xt(navigator.userAgent)) || [])[1])), h.$inject = [], g.$inject = [];
  5769. var on = k(Array.isArray) ? Array.isArray : function (e) {
  5770. return "[object Array]" === en.call(e)
  5771. }, an = String.prototype.trim ? function (e) {
  5772. return x(e) ? e.trim() : e
  5773. } : function (e) {
  5774. return x(e) ? e.replace(/^\s\s*/, "").replace(/\s\s*$/, "") : e
  5775. };
  5776. Gt = 9 > Ht ? function (e) {
  5777. return (e = e.nodeName ? e : e[0]).scopeName && "HTML" != e.scopeName ? Qt(e.scopeName + ":" + e.nodeName) : e.nodeName
  5778. } : function (e) {
  5779. return e.nodeName ? e.nodeName : e[0].nodeName
  5780. };
  5781. var sn = function () {
  5782. if (b(sn.isActive_)) return sn.isActive_;
  5783. var e = !(!t.querySelector("[ng-csp]") && !t.querySelector("[data-ng-csp]"));
  5784. if (!e) try {
  5785. new Function("")
  5786. } catch (t) {
  5787. e = !0
  5788. }
  5789. return sn.isActive_ = e
  5790. }, ln = /[A-Z]/g, cn = {full: "1.2.28", major: 1, minor: 2, dot: 28, codeName: "finnish-disembarkation"};
  5791. te.expando = "ng339";
  5792. var un = te.cache = {}, fn = 1, dn = e.document.addEventListener ? function (e, t, n) {
  5793. e.addEventListener(t, n, !1)
  5794. } : function (e, t, n) {
  5795. e.attachEvent("on" + t, n)
  5796. }, pn = e.document.removeEventListener ? function (e, t, n) {
  5797. e.removeEventListener(t, n, !1)
  5798. } : function (e, t, n) {
  5799. e.detachEvent("on" + t, n)
  5800. };
  5801. te._data = function (e) {
  5802. return this.cache[e[this.expando]] || {}
  5803. };
  5804. var hn = /([\:\-\_]+(.))/g, gn = /^moz([A-Z])/, mn = r("jqLite"), vn = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, bn = /<|&#?\w+;/,
  5805. yn = /<([\w:]+)/, xn = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, wn = {
  5806. option: [1, '<select multiple="multiple">', "</select>"],
  5807. thead: [1, "<table>", "</table>"],
  5808. col: [2, "<table><colgroup>", "</colgroup></table>"],
  5809. tr: [2, "<table><tbody>", "</tbody></table>"],
  5810. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  5811. _default: [0, "", ""]
  5812. };
  5813. wn.optgroup = wn.option, wn.tbody = wn.tfoot = wn.colgroup = wn.caption = wn.thead, wn.th = wn.td;
  5814. var $n = te.prototype = {
  5815. ready: function (n) {
  5816. function r() {
  5817. o || (o = !0, n())
  5818. }
  5819. var o = !1;
  5820. "complete" === t.readyState ? setTimeout(r) : (this.on("DOMContentLoaded", r), te(e).on("load", r))
  5821. }, toString: function () {
  5822. var e = [];
  5823. return i(this, function (t) {
  5824. e.push("" + t)
  5825. }), "[" + e.join(", ") + "]"
  5826. }, eq: function (e) {
  5827. return Vt(0 <= e ? this[e] : this[this.length + e])
  5828. }, length: 0, push: Zt, sort: [].sort, splice: [].splice
  5829. }, kn = {};
  5830. i("multiple selected checked disabled readOnly required open".split(" "), function (e) {
  5831. kn[Xt(e)] = e
  5832. });
  5833. var Tn = {};
  5834. i("input select option textarea button form details".split(" "), function (e) {
  5835. Tn[Qt(e)] = !0
  5836. }), i({data: se, removeData: ie}, function (e, t) {
  5837. te[t] = e
  5838. }), i({
  5839. data: se, inheritedData: pe, scope: function (e) {
  5840. return Vt.data(e, "$scope") || pe(e.parentNode || e, ["$isolateScope", "$scope"])
  5841. }, isolateScope: function (e) {
  5842. return Vt.data(e, "$isolateScope") || Vt.data(e, "$isolateScopeNoTemplate")
  5843. }, controller: de, injector: function (e) {
  5844. return pe(e, "$injector")
  5845. }, removeAttr: function (e, t) {
  5846. e.removeAttribute(t)
  5847. }, hasClass: le, css: function (e, t, r) {
  5848. if (t = Z(t), !b(r)) {
  5849. var o;
  5850. return 8 >= Ht && "" === (o = e.currentStyle && e.currentStyle[t]) && (o = "auto"), o = o || e.style[t], 8 >= Ht && (o = "" === o ? n : o), o
  5851. }
  5852. e.style[t] = r
  5853. }, attr: function (e, t, r) {
  5854. var o = Xt(t);
  5855. if (kn[o]) {
  5856. if (!b(r)) return e[t] || (e.attributes.getNamedItem(t) || h).specified ? o : n;
  5857. r ? (e[t] = !0, e.setAttribute(t, o)) : (e[t] = !1, e.removeAttribute(o))
  5858. } else if (b(r)) e.setAttribute(t, r); else if (e.getAttribute) return null === (e = e.getAttribute(t, 2)) ? n : e
  5859. }, prop: function (e, t, n) {
  5860. if (!b(n)) return e[t];
  5861. e[t] = n
  5862. }, text: function () {
  5863. function e(e, n) {
  5864. var r = t[e.nodeType];
  5865. if (v(n)) return r ? e[r] : "";
  5866. e[r] = n
  5867. }
  5868. var t = [];
  5869. return 9 > Ht ? (t[1] = "innerText", t[3] = "nodeValue") : t[1] = t[3] = "textContent", e.$dv = "", e
  5870. }(), val: function (e, t) {
  5871. if (v(t)) {
  5872. if ("SELECT" === Gt(e) && e.multiple) {
  5873. var n = [];
  5874. return i(e.options, function (e) {
  5875. e.selected && n.push(e.value || e.text)
  5876. }), 0 === n.length ? null : n
  5877. }
  5878. return e.value
  5879. }
  5880. e.value = t
  5881. }, html: function (e, t) {
  5882. if (v(t)) return e.innerHTML;
  5883. for (var n = 0, r = e.childNodes; n < r.length; n++) re(r[n]);
  5884. e.innerHTML = t
  5885. }, empty: he
  5886. }, function (e, t) {
  5887. te.prototype[t] = function (t, r) {
  5888. var o, i, a = this.length;
  5889. if (e !== he && (2 == e.length && e !== le && e !== de ? t : r) === n) {
  5890. if (y(t)) {
  5891. for (o = 0; o < a; o++) if (e === se) e(this[o], t); else for (i in t) e(this[o], i, t[i]);
  5892. return this
  5893. }
  5894. for (a = (o = e.$dv) === n ? Math.min(a, 1) : a, i = 0; i < a; i++) {
  5895. var s = e(this[i], t, r);
  5896. o = o ? o + s : s
  5897. }
  5898. return o
  5899. }
  5900. for (o = 0; o < a; o++) e(this[o], t, r);
  5901. return this
  5902. }
  5903. }), i({
  5904. removeData: ie, dealoc: re, on: function e(n, r, o, a) {
  5905. if (b(a)) throw mn("onargs");
  5906. var s = ae(n, "events"), l = ae(n, "handle");
  5907. s || ae(n, "events", s = {}), l || ae(n, "handle", l = me(n, s)), i(r.split(" "), function (r) {
  5908. var i = s[r];
  5909. if (!i) {
  5910. if ("mouseenter" == r || "mouseleave" == r) {
  5911. var a = t.body.contains || t.body.compareDocumentPosition ? function (e, t) {
  5912. var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode;
  5913. return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r)))
  5914. } : function (e, t) {
  5915. if (t) for (; t = t.parentNode;) if (t === e) return !0;
  5916. return !1
  5917. };
  5918. s[r] = [], e(n, {mouseleave: "mouseout", mouseenter: "mouseover"}[r], function (e) {
  5919. var t = e.relatedTarget;
  5920. t && (t === this || a(this, t)) || l(e, r)
  5921. })
  5922. } else dn(n, r, l), s[r] = [];
  5923. i = s[r]
  5924. }
  5925. i.push(o)
  5926. })
  5927. }, off: oe, one: function (e, t, n) {
  5928. (e = Vt(e)).on(t, function r() {
  5929. e.off(t, n), e.off(t, r)
  5930. }), e.on(t, n)
  5931. }, replaceWith: function (e, t) {
  5932. var n, r = e.parentNode;
  5933. re(e), i(new te(t), function (t) {
  5934. n ? r.insertBefore(t, n.nextSibling) : r.replaceChild(t, e), n = t
  5935. })
  5936. }, children: function (e) {
  5937. var t = [];
  5938. return i(e.childNodes, function (e) {
  5939. 1 === e.nodeType && t.push(e)
  5940. }), t
  5941. }, contents: function (e) {
  5942. return e.contentDocument || e.childNodes || []
  5943. }, append: function (e, t) {
  5944. i(new te(t), function (t) {
  5945. 1 !== e.nodeType && 11 !== e.nodeType || e.appendChild(t)
  5946. })
  5947. }, prepend: function (e, t) {
  5948. if (1 === e.nodeType) {
  5949. var n = e.firstChild;
  5950. i(new te(t), function (t) {
  5951. e.insertBefore(t, n)
  5952. })
  5953. }
  5954. }, wrap: function (e, t) {
  5955. t = Vt(t)[0];
  5956. var n = e.parentNode;
  5957. n && n.replaceChild(t, e), t.appendChild(e)
  5958. }, remove: function (e) {
  5959. re(e);
  5960. var t = e.parentNode;
  5961. t && t.removeChild(e)
  5962. }, after: function (e, t) {
  5963. var n = e, r = e.parentNode;
  5964. i(new te(t), function (e) {
  5965. r.insertBefore(e, n.nextSibling), n = e
  5966. })
  5967. }, addClass: ue, removeClass: ce, toggleClass: function (e, t, n) {
  5968. t && i(t.split(" "), function (t) {
  5969. var r = n;
  5970. v(r) && (r = !le(e, t)), (r ? ue : ce)(e, t)
  5971. })
  5972. }, parent: function (e) {
  5973. return (e = e.parentNode) && 11 !== e.nodeType ? e : null
  5974. }, next: function (e) {
  5975. if (e.nextElementSibling) return e.nextElementSibling;
  5976. for (e = e.nextSibling; null != e && 1 !== e.nodeType;) e = e.nextSibling;
  5977. return e
  5978. }, find: function (e, t) {
  5979. return e.getElementsByTagName ? e.getElementsByTagName(t) : []
  5980. }, clone: ne, triggerHandler: function (e, t, n) {
  5981. var r, o;
  5982. r = t.type || t;
  5983. var a = (ae(e, "events") || {})[r];
  5984. a && (r = {
  5985. preventDefault: function () {
  5986. this.defaultPrevented = !0
  5987. }, isDefaultPrevented: function () {
  5988. return !0 === this.defaultPrevented
  5989. }, stopPropagation: h, type: r, target: e
  5990. }, t.type && (r = f(r, t)), t = O(a), o = n ? [r].concat(n) : [r], i(t, function (t) {
  5991. t.apply(e, o)
  5992. }))
  5993. }
  5994. }, function (e, t) {
  5995. te.prototype[t] = function (t, n, r) {
  5996. for (var o, i = 0; i < this.length; i++) v(o) ? (o = e(this[i], t, n, r), b(o) && (o = Vt(o))) : fe(o, e(this[i], t, n, r));
  5997. return b(o) ? o : this
  5998. }, te.prototype.bind = te.prototype.on, te.prototype.unbind = te.prototype.off
  5999. }), be.prototype = {
  6000. put: function (e, t) {
  6001. this[ve(e, this.nextUid)] = t
  6002. }, get: function (e) {
  6003. return this[ve(e, this.nextUid)]
  6004. }, remove: function (e) {
  6005. var t = this[e = ve(e, this.nextUid)];
  6006. return delete this[e], t
  6007. }
  6008. };
  6009. var Sn = /^function\s*[^\(]*\(\s*([^\)]*)\)/m, Cn = /,/, En = /^\s*(_?)(\S+?)\1\s*$/,
  6010. An = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm, Nn = r("$injector"), Pn = r("$animate"), On = ["$provide", function (e) {
  6011. this.$$selectors = {}, this.register = function (t, n) {
  6012. var r = t + "-animation";
  6013. if (t && "." != t.charAt(0)) throw Pn("notcsel", t);
  6014. this.$$selectors[t.substr(1)] = r, e.factory(r, n)
  6015. }, this.classNameFilter = function (e) {
  6016. return 1 === arguments.length && (this.$$classNameFilter = e instanceof RegExp ? e : null), this.$$classNameFilter
  6017. }, this.$get = ["$timeout", "$$asyncCallback", function (e, t) {
  6018. return {
  6019. enter: function (e, n, r, o) {
  6020. r ? r.after(e) : (n && n[0] || (n = r.parent()), n.append(e)), o && t(o)
  6021. }, leave: function (e, n) {
  6022. e.remove(), n && t(n)
  6023. }, move: function (e, t, n, r) {
  6024. this.enter(e, t, n, r)
  6025. }, addClass: function (e, n, r) {
  6026. n = x(n) ? n : on(n) ? n.join(" ") : "", i(e, function (e) {
  6027. ue(e, n)
  6028. }), r && t(r)
  6029. }, removeClass: function (e, n, r) {
  6030. n = x(n) ? n : on(n) ? n.join(" ") : "", i(e, function (e) {
  6031. ce(e, n)
  6032. }), r && t(r)
  6033. }, setClass: function (e, n, r, o) {
  6034. i(e, function (e) {
  6035. ue(e, n), ce(e, r)
  6036. }), o && t(o)
  6037. }, enabled: h
  6038. }
  6039. }]
  6040. }], Dn = r("$compile");
  6041. Ee.$inject = ["$provide", "$$sanitizeUriProvider"];
  6042. var In = /^(x[\:\-_]|data[\:\-_])/i, Mn = r("$interpolate"), _n = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/,
  6043. Ln = {http: 80, https: 443, ftp: 21}, Fn = r("$location");
  6044. Qe.prototype = Ke.prototype = Xe.prototype = {
  6045. $$html5: !1, $$replace: !1, absUrl: Je("$$absUrl"), url: function (e) {
  6046. return v(e) ? this.$$url : ((e = _n.exec(e))[1] && this.path(decodeURIComponent(e[1])), (e[2] || e[1]) && this.search(e[3] || ""), this.hash(e[5] || ""), this)
  6047. }, protocol: Je("$$protocol"), host: Je("$$host"), port: Je("$$port"), path: Ze("$$path", function (e) {
  6048. return "/" == (e = null !== e ? e.toString() : "").charAt(0) ? e : "/" + e
  6049. }), search: function (e, t) {
  6050. switch (arguments.length) {
  6051. case 0:
  6052. return this.$$search;
  6053. case 1:
  6054. if (x(e) || w(e)) e = e.toString(), this.$$search = j(e); else {
  6055. if (!y(e)) throw Fn("isrcharg");
  6056. i(e, function (t, n) {
  6057. null == t && delete e[n]
  6058. }), this.$$search = e
  6059. }
  6060. break;
  6061. default:
  6062. v(t) || null === t ? delete this.$$search[e] : this.$$search[e] = t
  6063. }
  6064. return this.$$compose(), this
  6065. }, hash: Ze("$$hash", function (e) {
  6066. return null !== e ? e.toString() : ""
  6067. }), replace: function () {
  6068. return this.$$replace = !0, this
  6069. }
  6070. };
  6071. var Bn, Rn = r("$parse"), jn = {}, qn = Function.prototype.call, Un = Function.prototype.apply,
  6072. Hn = Function.prototype.bind, Vn = {
  6073. null: function () {
  6074. return null
  6075. }, true: function () {
  6076. return !0
  6077. }, false: function () {
  6078. return !1
  6079. }, undefined: h, "+": function (e, t, r, o) {
  6080. return r = r(e, t), o = o(e, t), b(r) ? b(o) ? r + o : r : b(o) ? o : n
  6081. }, "-": function (e, t, n, r) {
  6082. return n = n(e, t), r = r(e, t), (b(n) ? n : 0) - (b(r) ? r : 0)
  6083. }, "*": function (e, t, n, r) {
  6084. return n(e, t) * r(e, t)
  6085. }, "/": function (e, t, n, r) {
  6086. return n(e, t) / r(e, t)
  6087. }, "%": function (e, t, n, r) {
  6088. return n(e, t) % r(e, t)
  6089. }, "^": function (e, t, n, r) {
  6090. return n(e, t) ^ r(e, t)
  6091. }, "=": h, "===": function (e, t, n, r) {
  6092. return n(e, t) === r(e, t)
  6093. }, "!==": function (e, t, n, r) {
  6094. return n(e, t) !== r(e, t)
  6095. }, "==": function (e, t, n, r) {
  6096. return n(e, t) == r(e, t)
  6097. }, "!=": function (e, t, n, r) {
  6098. return n(e, t) != r(e, t)
  6099. }, "<": function (e, t, n, r) {
  6100. return n(e, t) < r(e, t)
  6101. }, ">": function (e, t, n, r) {
  6102. return n(e, t) > r(e, t)
  6103. }, "<=": function (e, t, n, r) {
  6104. return n(e, t) <= r(e, t)
  6105. }, ">=": function (e, t, n, r) {
  6106. return n(e, t) >= r(e, t)
  6107. }, "&&": function (e, t, n, r) {
  6108. return n(e, t) && r(e, t)
  6109. }, "||": function (e, t, n, r) {
  6110. return n(e, t) || r(e, t)
  6111. }, "&": function (e, t, n, r) {
  6112. return n(e, t) & r(e, t)
  6113. }, "|": function (e, t, n, r) {
  6114. return r(e, t)(e, t, n(e, t))
  6115. }, "!": function (e, t, n) {
  6116. return !n(e, t)
  6117. }
  6118. }, zn = {n: "\n", f: "\f", r: "\r", t: "\t", v: "\v", "'": "'", '"': '"'}, Wn = function (e) {
  6119. this.options = e
  6120. };
  6121. Wn.prototype = {
  6122. constructor: Wn, lex: function (e) {
  6123. for (this.text = e, this.index = 0, this.ch = n, this.lastCh = ":", this.tokens = []; this.index < this.text.length;) {
  6124. if (this.ch = this.text.charAt(this.index), this.is("\"'")) this.readString(this.ch); else if (this.isNumber(this.ch) || this.is(".") && this.isNumber(this.peek())) this.readNumber(); else if (this.isIdent(this.ch)) this.readIdent(); else if (this.is("(){}[].,;:?")) this.tokens.push({
  6125. index: this.index,
  6126. text: this.ch
  6127. }), this.index++; else {
  6128. if (this.isWhitespace(this.ch)) {
  6129. this.index++;
  6130. continue
  6131. }
  6132. var t = (e = this.ch + this.peek()) + this.peek(2), r = Vn[this.ch], o = Vn[e], i = Vn[t];
  6133. i ? (this.tokens.push({
  6134. index: this.index,
  6135. text: t,
  6136. fn: i
  6137. }), this.index += 3) : o ? (this.tokens.push({
  6138. index: this.index,
  6139. text: e,
  6140. fn: o
  6141. }), this.index += 2) : r ? (this.tokens.push({
  6142. index: this.index,
  6143. text: this.ch,
  6144. fn: r
  6145. }), this.index += 1) : this.throwError("Unexpected next character ", this.index, this.index + 1)
  6146. }
  6147. this.lastCh = this.ch
  6148. }
  6149. return this.tokens
  6150. }, is: function (e) {
  6151. return -1 !== e.indexOf(this.ch)
  6152. }, was: function (e) {
  6153. return -1 !== e.indexOf(this.lastCh)
  6154. }, peek: function (e) {
  6155. return e = e || 1, this.index + e < this.text.length && this.text.charAt(this.index + e)
  6156. }, isNumber: function (e) {
  6157. return "0" <= e && "9" >= e
  6158. }, isWhitespace: function (e) {
  6159. return " " === e || "\r" === e || "\t" === e || "\n" === e || "\v" === e || " " === e
  6160. }, isIdent: function (e) {
  6161. return "a" <= e && "z" >= e || "A" <= e && "Z" >= e || "_" === e || "$" === e
  6162. }, isExpOperator: function (e) {
  6163. return "-" === e || "+" === e || this.isNumber(e)
  6164. }, throwError: function (e, t, n) {
  6165. throw n = n || this.index, t = b(t) ? "s " + t + "-" + this.index + " [" + this.text.substring(t, n) + "]" : " " + n, Rn("lexerr", e, t, this.text)
  6166. }, readNumber: function () {
  6167. for (var e = "", t = this.index; this.index < this.text.length;) {
  6168. var n = Xt(this.text.charAt(this.index));
  6169. if ("." == n || this.isNumber(n)) e += n; else {
  6170. var r = this.peek();
  6171. if ("e" == n && this.isExpOperator(r)) e += n; else if (this.isExpOperator(n) && r && this.isNumber(r) && "e" == e.charAt(e.length - 1)) e += n; else {
  6172. if (!this.isExpOperator(n) || r && this.isNumber(r) || "e" != e.charAt(e.length - 1)) break;
  6173. this.throwError("Invalid exponent")
  6174. }
  6175. }
  6176. this.index++
  6177. }
  6178. e *= 1, this.tokens.push({
  6179. index: t, text: e, literal: !0, constant: !0, fn: function () {
  6180. return e
  6181. }
  6182. })
  6183. }, readIdent: function () {
  6184. for (var e, t, n, r, o = this, i = "", a = this.index; this.index < this.text.length && ("." === (r = this.text.charAt(this.index)) || this.isIdent(r) || this.isNumber(r));) "." === r && (e = this.index), i += r, this.index++;
  6185. if (e) for (t = this.index; t < this.text.length;) {
  6186. if ("(" === (r = this.text.charAt(t))) {
  6187. n = i.substr(e - a + 1), i = i.substr(0, e - a), this.index = t;
  6188. break
  6189. }
  6190. if (!this.isWhitespace(r)) break;
  6191. t++
  6192. }
  6193. if (a = {index: a, text: i}, Vn.hasOwnProperty(i)) a.fn = Vn[i], a.literal = !0, a.constant = !0; else {
  6194. var s = lt(i, this.options, this.text);
  6195. a.fn = f(function (e, t) {
  6196. return s(e, t)
  6197. }, {
  6198. assign: function (e, t) {
  6199. return ot(e, i, t, o.text, o.options)
  6200. }
  6201. })
  6202. }
  6203. this.tokens.push(a), n && (this.tokens.push({index: e, text: "."}), this.tokens.push({index: e + 1, text: n}))
  6204. }, readString: function (e) {
  6205. var t = this.index;
  6206. this.index++;
  6207. for (var n = "", r = e, o = !1; this.index < this.text.length;) {
  6208. var i = this.text.charAt(this.index), r = r + i;
  6209. if (o) "u" === i ? ((o = this.text.substring(this.index + 1, this.index + 5)).match(/[\da-f]{4}/i) || this.throwError("Invalid unicode escape [\\u" + o + "]"), this.index += 4, n += String.fromCharCode(parseInt(o, 16))) : n += zn[i] || i, o = !1; else if ("\\" === i) o = !0; else {
  6210. if (i === e) return this.index++, void this.tokens.push({
  6211. index: t,
  6212. text: r,
  6213. string: n,
  6214. literal: !0,
  6215. constant: !0,
  6216. fn: function () {
  6217. return n
  6218. }
  6219. });
  6220. n += i
  6221. }
  6222. this.index++
  6223. }
  6224. this.throwError("Unterminated quote", t)
  6225. }
  6226. };
  6227. var Gn = function (e, t, n) {
  6228. this.lexer = e, this.$filter = t, this.options = n
  6229. };
  6230. Gn.ZERO = f(function () {
  6231. return 0
  6232. }, {constant: !0}), Gn.prototype = {
  6233. constructor: Gn, parse: function (e) {
  6234. return this.text = e, this.tokens = this.lexer.lex(e), e = this.statements(), 0 !== this.tokens.length && this.throwError("is an unexpected token", this.tokens[0]), e.literal = !!e.literal, e.constant = !!e.constant, e
  6235. }, primary: function () {
  6236. var e;
  6237. if (this.expect("(")) e = this.filterChain(), this.consume(")"); else if (this.expect("[")) e = this.arrayDeclaration(); else if (this.expect("{")) e = this.object(); else {
  6238. var t = this.expect();
  6239. (e = t.fn) || this.throwError("not a primary expression", t), e.literal = !!t.literal, e.constant = !!t.constant
  6240. }
  6241. for (var n; t = this.expect("(", "[", ".");) "(" === t.text ? (e = this.functionCall(e, n), n = null) : "[" === t.text ? (n = e, e = this.objectIndex(e)) : "." === t.text ? (n = e, e = this.fieldAccess(e)) : this.throwError("IMPOSSIBLE");
  6242. return e
  6243. }, throwError: function (e, t) {
  6244. throw Rn("syntax", t.text, e, t.index + 1, this.text, this.text.substring(t.index))
  6245. }, peekToken: function () {
  6246. if (0 === this.tokens.length) throw Rn("ueoe", this.text);
  6247. return this.tokens[0]
  6248. }, peek: function (e, t, n, r) {
  6249. if (0 < this.tokens.length) {
  6250. var o = this.tokens[0], i = o.text;
  6251. if (i === e || i === t || i === n || i === r || !(e || t || n || r)) return o
  6252. }
  6253. return !1
  6254. }, expect: function (e, t, n, r) {
  6255. return !!(e = this.peek(e, t, n, r)) && (this.tokens.shift(), e)
  6256. }, consume: function (e) {
  6257. this.expect(e) || this.throwError("is unexpected, expecting [" + e + "]", this.peek())
  6258. }, unaryFn: function (e, t) {
  6259. return f(function (n, r) {
  6260. return e(n, r, t)
  6261. }, {constant: t.constant})
  6262. }, ternaryFn: function (e, t, n) {
  6263. return f(function (r, o) {
  6264. return e(r, o) ? t(r, o) : n(r, o)
  6265. }, {constant: e.constant && t.constant && n.constant})
  6266. }, binaryFn: function (e, t, n) {
  6267. return f(function (r, o) {
  6268. return t(r, o, e, n)
  6269. }, {constant: e.constant && n.constant})
  6270. }, statements: function () {
  6271. for (var e = []; ;) if (0 < this.tokens.length && !this.peek("}", ")", ";", "]") && e.push(this.filterChain()), !this.expect(";")) return 1 === e.length ? e[0] : function (t, n) {
  6272. for (var r, o = 0; o < e.length; o++) {
  6273. var i = e[o];
  6274. i && (r = i(t, n))
  6275. }
  6276. return r
  6277. }
  6278. }, filterChain: function () {
  6279. for (var e, t = this.expression(); ;) {
  6280. if (!(e = this.expect("|"))) return t;
  6281. t = this.binaryFn(t, e.fn, this.filter())
  6282. }
  6283. }, filter: function () {
  6284. for (var e = this.expect(), t = this.$filter(e.text), n = []; ;) {
  6285. if (!(e = this.expect(":"))) {
  6286. var r = function (e, r, o) {
  6287. o = [o];
  6288. for (var i = 0; i < n.length; i++) o.push(n[i](e, r));
  6289. return t.apply(e, o)
  6290. };
  6291. return function () {
  6292. return r
  6293. }
  6294. }
  6295. n.push(this.expression())
  6296. }
  6297. }, expression: function () {
  6298. return this.assignment()
  6299. }, assignment: function () {
  6300. var e, t, n = this.ternary();
  6301. return (t = this.expect("=")) ? (n.assign || this.throwError("implies assignment but [" + this.text.substring(0, t.index) + "] can not be assigned to", t), e = this.ternary(), function (t, r) {
  6302. return n.assign(t, e(t, r), r)
  6303. }) : n
  6304. }, ternary: function () {
  6305. var e, t, n = this.logicalOR();
  6306. return this.expect("?") ? (e = this.assignment(), (t = this.expect(":")) ? this.ternaryFn(n, e, this.assignment()) : void this.throwError("expected :", t)) : n
  6307. }, logicalOR: function () {
  6308. for (var e, t = this.logicalAND(); ;) {
  6309. if (!(e = this.expect("||"))) return t;
  6310. t = this.binaryFn(t, e.fn, this.logicalAND())
  6311. }
  6312. }, logicalAND: function () {
  6313. var e, t = this.equality();
  6314. return (e = this.expect("&&")) && (t = this.binaryFn(t, e.fn, this.logicalAND())), t
  6315. }, equality: function () {
  6316. var e, t = this.relational();
  6317. return (e = this.expect("==", "!=", "===", "!==")) && (t = this.binaryFn(t, e.fn, this.equality())), t
  6318. }, relational: function () {
  6319. var e, t = this.additive();
  6320. return (e = this.expect("<", ">", "<=", ">=")) && (t = this.binaryFn(t, e.fn, this.relational())), t
  6321. }, additive: function () {
  6322. for (var e, t = this.multiplicative(); e = this.expect("+", "-");) t = this.binaryFn(t, e.fn, this.multiplicative());
  6323. return t
  6324. }, multiplicative: function () {
  6325. for (var e, t = this.unary(); e = this.expect("*", "/", "%");) t = this.binaryFn(t, e.fn, this.unary());
  6326. return t
  6327. }, unary: function () {
  6328. var e;
  6329. return this.expect("+") ? this.primary() : (e = this.expect("-")) ? this.binaryFn(Gn.ZERO, e.fn, this.unary()) : (e = this.expect("!")) ? this.unaryFn(e.fn, this.unary()) : this.primary()
  6330. }, fieldAccess: function (e) {
  6331. var t = this, n = this.expect().text, r = lt(n, this.options, this.text);
  6332. return f(function (t, n, o) {
  6333. return r(o || e(t, n))
  6334. }, {
  6335. assign: function (r, o, i) {
  6336. return (i = e(r, i)) || e.assign(r, i = {}), ot(i, n, o, t.text, t.options)
  6337. }
  6338. })
  6339. }, objectIndex: function (e) {
  6340. var t = this, r = this.expression();
  6341. return this.consume("]"), f(function (o, i) {
  6342. var a, s = e(o, i), l = r(o, i);
  6343. return nt(l, t.text), s ? ((s = rt(s[l], t.text)) && s.then && t.options.unwrapPromises && (a = s, "$$v" in s || (a.$$v = n, a.then(function (e) {
  6344. a.$$v = e
  6345. })), s = s.$$v), s) : n
  6346. }, {
  6347. assign: function (n, o, i) {
  6348. var a = nt(r(n, i), t.text);
  6349. return (i = rt(e(n, i), t.text)) || e.assign(n, i = {}), i[a] = o
  6350. }
  6351. })
  6352. }, functionCall: function (e, t) {
  6353. var n = [];
  6354. if (")" !== this.peekToken().text) do {
  6355. n.push(this.expression())
  6356. } while (this.expect(","));
  6357. this.consume(")");
  6358. var r = this;
  6359. return function (o, i) {
  6360. for (var a = [], s = t ? t(o, i) : o, l = 0; l < n.length; l++) a.push(rt(n[l](o, i), r.text));
  6361. l = e(o, i, s) || h, rt(s, r.text);
  6362. var c = r.text;
  6363. if (l) {
  6364. if (l.constructor === l) throw Rn("isecfn", c);
  6365. if (l === qn || l === Un || Hn && l === Hn) throw Rn("isecff", c)
  6366. }
  6367. return a = l.apply ? l.apply(s, a) : l(a[0], a[1], a[2], a[3], a[4]), rt(a, r.text)
  6368. }
  6369. }, arrayDeclaration: function () {
  6370. var e = [], t = !0;
  6371. if ("]" !== this.peekToken().text) do {
  6372. if (this.peek("]")) break;
  6373. var n = this.expression();
  6374. e.push(n), n.constant || (t = !1)
  6375. } while (this.expect(","));
  6376. return this.consume("]"), f(function (t, n) {
  6377. for (var r = [], o = 0; o < e.length; o++) r.push(e[o](t, n));
  6378. return r
  6379. }, {literal: !0, constant: t})
  6380. }, object: function () {
  6381. var e = [], t = !0;
  6382. if ("}" !== this.peekToken().text) do {
  6383. if (this.peek("}")) break;
  6384. var n = (n = this.expect()).string || n.text;
  6385. this.consume(":");
  6386. var r = this.expression();
  6387. e.push({key: n, value: r}), r.constant || (t = !1)
  6388. } while (this.expect(","));
  6389. return this.consume("}"), f(function (t, n) {
  6390. for (var r = {}, o = 0; o < e.length; o++) {
  6391. var i = e[o];
  6392. r[i.key] = i.value(t, n)
  6393. }
  6394. return r
  6395. }, {literal: !0, constant: t})
  6396. }
  6397. };
  6398. var Yn = {}, Xn = {}, Kn = r("$sce"),
  6399. Qn = {HTML: "html", CSS: "css", URL: "url", RESOURCE_URL: "resourceUrl", JS: "js"}, Jn = t.createElement("a"),
  6400. Zn = wt(e.location.href, !0);
  6401. Tt.$inject = ["$provide"], Ct.$inject = ["$locale"], Et.$inject = ["$locale"];
  6402. var er = ".", tr = {
  6403. yyyy: Pt("FullYear", 4),
  6404. yy: Pt("FullYear", 2, 0, !0),
  6405. y: Pt("FullYear", 1),
  6406. MMMM: Ot("Month"),
  6407. MMM: Ot("Month", !0),
  6408. MM: Pt("Month", 2, 1),
  6409. M: Pt("Month", 1, 1),
  6410. dd: Pt("Date", 2),
  6411. d: Pt("Date", 1),
  6412. HH: Pt("Hours", 2),
  6413. H: Pt("Hours", 1),
  6414. hh: Pt("Hours", 2, -12),
  6415. h: Pt("Hours", 1, -12),
  6416. mm: Pt("Minutes", 2),
  6417. m: Pt("Minutes", 1),
  6418. ss: Pt("Seconds", 2),
  6419. s: Pt("Seconds", 1),
  6420. sss: Pt("Milliseconds", 3),
  6421. EEEE: Ot("Day"),
  6422. EEE: Ot("Day", !0),
  6423. a: function (e, t) {
  6424. return 12 > e.getHours() ? t.AMPMS[0] : t.AMPMS[1]
  6425. },
  6426. Z: function (e) {
  6427. return e = -1 * e.getTimezoneOffset(), e = (0 <= e ? "+" : "") + (Nt(Math[0 < e ? "floor" : "ceil"](e / 60), 2) + Nt(Math.abs(e % 60), 2))
  6428. }
  6429. }, nr = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/, rr = /^\-?\d+$/;
  6430. Dt.$inject = ["$locale"];
  6431. var or = m(Xt), ir = m(Qt);
  6432. _t.$inject = ["$parse"];
  6433. var ar = m({
  6434. restrict: "E", compile: function (e, n) {
  6435. if (8 >= Ht && (n.href || n.name || n.$set("href", ""), e.append(t.createComment("IE fix"))), !n.href && !n.xlinkHref && !n.name) return function (e, t) {
  6436. var n = "[object SVGAnimatedString]" === en.call(t.prop("href")) ? "xlink:href" : "href";
  6437. t.on("click", function (e) {
  6438. t.attr(n) || e.preventDefault()
  6439. })
  6440. }
  6441. }
  6442. }), sr = {};
  6443. i(kn, function (e, t) {
  6444. if ("multiple" != e) {
  6445. var n = Ae("ng-" + t);
  6446. sr[n] = function () {
  6447. return {
  6448. priority: 100, link: function (e, r, o) {
  6449. e.$watch(o[n], function (e) {
  6450. o.$set(t, !!e)
  6451. })
  6452. }
  6453. }
  6454. }
  6455. }
  6456. }), i(["src", "srcset", "href"], function (e) {
  6457. var t = Ae("ng-" + e);
  6458. sr[t] = function () {
  6459. return {
  6460. priority: 99, link: function (n, r, o) {
  6461. var i = e, a = e;
  6462. "href" === e && "[object SVGAnimatedString]" === en.call(r.prop("href")) && (a = "xlinkHref", o.$attr[a] = "xlink:href", i = null), o.$observe(t, function (t) {
  6463. t ? (o.$set(a, t), Ht && i && r.prop(i, o[a])) : "href" === e && o.$set(a, null)
  6464. })
  6465. }
  6466. }
  6467. }
  6468. });
  6469. var lr = {$addControl: h, $removeControl: h, $setValidity: h, $setDirty: h, $setPristine: h};
  6470. Ft.$inject = ["$element", "$attrs", "$scope", "$animate"];
  6471. var cr = function (e) {
  6472. return ["$timeout", function (t) {
  6473. return {
  6474. name: "form", restrict: e ? "EAC" : "E", controller: Ft, compile: function () {
  6475. return {
  6476. pre: function (e, r, o, i) {
  6477. if (!o.action) {
  6478. var a = function (e) {
  6479. e.preventDefault ? e.preventDefault() : e.returnValue = !1
  6480. };
  6481. dn(r[0], "submit", a), r.on("$destroy", function () {
  6482. t(function () {
  6483. pn(r[0], "submit", a)
  6484. }, 0, !1)
  6485. })
  6486. }
  6487. var s = r.parent().controller("form"), l = o.name || o.ngForm;
  6488. l && ot(e, l, i, l), s && r.on("$destroy", function () {
  6489. s.$removeControl(i), l && ot(e, l, n, l), f(i, lr)
  6490. })
  6491. }
  6492. }
  6493. }
  6494. }
  6495. }]
  6496. }, ur = cr(), fr = cr(!0), dr = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,
  6497. pr = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,
  6498. hr = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/, gr = {
  6499. text: qt, number: function (e, t, r, o, i, a) {
  6500. qt(e, t, r, o, i, a), o.$parsers.push(function (e) {
  6501. var t = o.$isEmpty(e);
  6502. return t || hr.test(e) ? (o.$setValidity("number", !0), "" === e ? null : t ? e : parseFloat(e)) : (o.$setValidity("number", !1), n)
  6503. }), jt(o, "number", mr, null, o.$$validityState), o.$formatters.push(function (e) {
  6504. return o.$isEmpty(e) ? "" : "" + e
  6505. }), r.min && (e = function (e) {
  6506. var t = parseFloat(r.min);
  6507. return Bt(o, "min", o.$isEmpty(e) || e >= t, e)
  6508. }, o.$parsers.push(e), o.$formatters.push(e)), r.max && (e = function (e) {
  6509. var t = parseFloat(r.max);
  6510. return Bt(o, "max", o.$isEmpty(e) || e <= t, e)
  6511. }, o.$parsers.push(e), o.$formatters.push(e)), o.$formatters.push(function (e) {
  6512. return Bt(o, "number", o.$isEmpty(e) || w(e), e)
  6513. })
  6514. }, url: function (e, t, n, r, o, i) {
  6515. qt(e, t, n, r, o, i), e = function (e) {
  6516. return Bt(r, "url", r.$isEmpty(e) || dr.test(e), e)
  6517. }, r.$formatters.push(e), r.$parsers.push(e)
  6518. }, email: function (e, t, n, r, o, i) {
  6519. qt(e, t, n, r, o, i), e = function (e) {
  6520. return Bt(r, "email", r.$isEmpty(e) || pr.test(e), e)
  6521. }, r.$formatters.push(e), r.$parsers.push(e)
  6522. }, radio: function (e, t, n, r) {
  6523. v(n.name) && t.attr("name", c()), t.on("click", function () {
  6524. t[0].checked && e.$apply(function () {
  6525. r.$setViewValue(n.value)
  6526. })
  6527. }), r.$render = function () {
  6528. t[0].checked = n.value == r.$viewValue
  6529. }, n.$observe("value", r.$render)
  6530. }, checkbox: function (e, t, n, r) {
  6531. var o = n.ngTrueValue, i = n.ngFalseValue;
  6532. x(o) || (o = !0), x(i) || (i = !1), t.on("click", function () {
  6533. e.$apply(function () {
  6534. r.$setViewValue(t[0].checked)
  6535. })
  6536. }), r.$render = function () {
  6537. t[0].checked = r.$viewValue
  6538. }, r.$isEmpty = function (e) {
  6539. return e !== o
  6540. }, r.$formatters.push(function (e) {
  6541. return e === o
  6542. }), r.$parsers.push(function (e) {
  6543. return e ? o : i
  6544. })
  6545. }, hidden: h, button: h, submit: h, reset: h, file: h
  6546. }, mr = ["badInput"], vr = ["$browser", "$sniffer", function (e, t) {
  6547. return {
  6548. restrict: "E", require: "?ngModel", link: function (n, r, o, i) {
  6549. i && (gr[Xt(o.type)] || gr.text)(n, r, o, i, t, e)
  6550. }
  6551. }
  6552. }], br = "ng-valid", yr = "ng-invalid", xr = "ng-pristine", wr = "ng-dirty",
  6553. $r = ["$scope", "$exceptionHandler", "$attrs", "$element", "$parse", "$animate", function (e, t, n, o, a, s) {
  6554. function l(e, t) {
  6555. t = t ? "-" + W(t, "-") : "", s.removeClass(o, (e ? yr : br) + t), s.addClass(o, (e ? br : yr) + t)
  6556. }
  6557. this.$modelValue = this.$viewValue = Number.NaN, this.$parsers = [], this.$formatters = [], this.$viewChangeListeners = [], this.$pristine = !0, this.$dirty = !1, this.$valid = !0, this.$invalid = !1, this.$name = n.name;
  6558. var c = a(n.ngModel), u = c.assign;
  6559. if (!u) throw r("ngModel")("nonassign", n.ngModel, B(o));
  6560. this.$render = h, this.$isEmpty = function (e) {
  6561. return v(e) || "" === e || null === e || e != e
  6562. };
  6563. var f = o.inheritedData("$formController") || lr, d = 0, p = this.$error = {};
  6564. o.addClass(xr), l(!0), this.$setValidity = function (e, t) {
  6565. p[e] !== !t && (t ? (p[e] && d--, d || (l(!0), this.$valid = !0, this.$invalid = !1)) : (l(!1), this.$invalid = !0, this.$valid = !1, d++), p[e] = !t, l(t, e), f.$setValidity(e, t, this))
  6566. }, this.$setPristine = function () {
  6567. this.$dirty = !1, this.$pristine = !0, s.removeClass(o, wr), s.addClass(o, xr)
  6568. }, this.$setViewValue = function (n) {
  6569. this.$viewValue = n, this.$pristine && (this.$dirty = !0, this.$pristine = !1, s.removeClass(o, xr), s.addClass(o, wr), f.$setDirty()), i(this.$parsers, function (e) {
  6570. n = e(n)
  6571. }), this.$modelValue !== n && (this.$modelValue = n, u(e, n), i(this.$viewChangeListeners, function (e) {
  6572. try {
  6573. e()
  6574. } catch (e) {
  6575. t(e)
  6576. }
  6577. }))
  6578. };
  6579. var g = this;
  6580. e.$watch(function () {
  6581. var t = c(e);
  6582. if (g.$modelValue !== t) {
  6583. var n = g.$formatters, r = n.length;
  6584. for (g.$modelValue = t; r--;) t = n[r](t);
  6585. g.$viewValue !== t && (g.$viewValue = t, g.$render())
  6586. }
  6587. return t
  6588. })
  6589. }], kr = function () {
  6590. return {
  6591. require: ["ngModel", "^?form"], controller: $r, link: function (e, t, n, r) {
  6592. var o = r[0], i = r[1] || lr;
  6593. i.$addControl(o), e.$on("$destroy", function () {
  6594. i.$removeControl(o)
  6595. })
  6596. }
  6597. }
  6598. }, Tr = m({
  6599. require: "ngModel", link: function (e, t, n, r) {
  6600. r.$viewChangeListeners.push(function () {
  6601. e.$eval(n.ngChange)
  6602. })
  6603. }
  6604. }), Sr = function () {
  6605. return {
  6606. require: "?ngModel", link: function (e, t, n, r) {
  6607. if (r) {
  6608. n.required = !0;
  6609. var o = function (e) {
  6610. if (!n.required || !r.$isEmpty(e)) return r.$setValidity("required", !0), e;
  6611. r.$setValidity("required", !1)
  6612. };
  6613. r.$formatters.push(o), r.$parsers.unshift(o), n.$observe("required", function () {
  6614. o(r.$viewValue)
  6615. })
  6616. }
  6617. }
  6618. }
  6619. }, Cr = function () {
  6620. return {
  6621. require: "ngModel", link: function (e, t, r, o) {
  6622. var a = (e = /\/(.*)\//.exec(r.ngList)) && RegExp(e[1]) || r.ngList || ",";
  6623. o.$parsers.push(function (e) {
  6624. if (!v(e)) {
  6625. var t = [];
  6626. return e && i(e.split(a), function (e) {
  6627. e && t.push(an(e))
  6628. }), t
  6629. }
  6630. }), o.$formatters.push(function (e) {
  6631. return on(e) ? e.join(", ") : n
  6632. }), o.$isEmpty = function (e) {
  6633. return !e || !e.length
  6634. }
  6635. }
  6636. }
  6637. }, Er = /^(true|false|\d+)$/, Ar = function () {
  6638. return {
  6639. priority: 100, compile: function (e, t) {
  6640. return Er.test(t.ngValue) ? function (e, t, n) {
  6641. n.$set("value", e.$eval(n.ngValue))
  6642. } : function (e, t, n) {
  6643. e.$watch(n.ngValue, function (e) {
  6644. n.$set("value", e)
  6645. })
  6646. }
  6647. }
  6648. }
  6649. }, Nr = Lt({
  6650. compile: function (e) {
  6651. return e.addClass("ng-binding"), function (e, t, r) {
  6652. t.data("$binding", r.ngBind), e.$watch(r.ngBind, function (e) {
  6653. t.text(e == n ? "" : e)
  6654. })
  6655. }
  6656. }
  6657. }), Pr = ["$interpolate", function (e) {
  6658. return function (t, n, r) {
  6659. t = e(n.attr(r.$attr.ngBindTemplate)), n.addClass("ng-binding").data("$binding", t), r.$observe("ngBindTemplate", function (e) {
  6660. n.text(e)
  6661. })
  6662. }
  6663. }], Or = ["$sce", "$parse", function (e, t) {
  6664. return {
  6665. compile: function (n) {
  6666. return n.addClass("ng-binding"), function (n, r, o) {
  6667. r.data("$binding", o.ngBindHtml);
  6668. var i = t(o.ngBindHtml);
  6669. n.$watch(function () {
  6670. return (i(n) || "").toString()
  6671. }, function (t) {
  6672. r.html(e.getTrustedHtml(i(n)) || "")
  6673. })
  6674. }
  6675. }
  6676. }
  6677. }], Dr = Ut("", !0), Ir = Ut("Odd", 0), Mr = Ut("Even", 1), _r = Lt({
  6678. compile: function (e, t) {
  6679. t.$set("ngCloak", n), e.removeClass("ng-cloak")
  6680. }
  6681. }), Lr = [function () {
  6682. return {scope: !0, controller: "@", priority: 500}
  6683. }], Fr = {}, Br = {blur: !0, focus: !0};
  6684. i("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "), function (e) {
  6685. var t = Ae("ng-" + e);
  6686. Fr[t] = ["$parse", "$rootScope", function (n, r) {
  6687. return {
  6688. compile: function (o, i) {
  6689. var a = n(i[t], !0);
  6690. return function (t, n) {
  6691. n.on(e, function (n) {
  6692. var o = function () {
  6693. a(t, {$event: n})
  6694. };
  6695. Br[e] && r.$$phase ? t.$evalAsync(o) : t.$apply(o)
  6696. })
  6697. }
  6698. }
  6699. }
  6700. }]
  6701. });
  6702. var Rr = ["$animate", function (e) {
  6703. return {
  6704. transclude: "element",
  6705. priority: 600,
  6706. terminal: !0,
  6707. restrict: "A",
  6708. $$tlb: !0,
  6709. link: function (n, r, o, i, a) {
  6710. var s, l, c;
  6711. n.$watch(o.ngIf, function (i) {
  6712. F(i) ? l || (l = n.$new(), a(l, function (n) {
  6713. n[n.length++] = t.createComment(" end ngIf: " + o.ngIf + " "), s = {clone: n}, e.enter(n, r.parent(), r)
  6714. })) : (c && (c.remove(), c = null), l && (l.$destroy(), l = null), s && (c = Q(s.clone), e.leave(c, function () {
  6715. c = null
  6716. }), s = null))
  6717. })
  6718. }
  6719. }
  6720. }], jr = ["$http", "$templateCache", "$anchorScroll", "$animate", "$sce", function (e, t, n, r, o) {
  6721. return {
  6722. restrict: "ECA",
  6723. priority: 400,
  6724. terminal: !0,
  6725. transclude: "element",
  6726. controller: nn.noop,
  6727. compile: function (i, a) {
  6728. var s = a.ngInclude || a.src, l = a.onload || "", c = a.autoscroll;
  6729. return function (i, a, u, f, d) {
  6730. var p, h, g, m = 0, v = function () {
  6731. h && (h.remove(), h = null), p && (p.$destroy(), p = null), g && (r.leave(g, function () {
  6732. h = null
  6733. }), h = g, g = null)
  6734. };
  6735. i.$watch(o.parseAsResourceUrl(s), function (o) {
  6736. var s = function () {
  6737. !b(c) || c && !i.$eval(c) || n()
  6738. }, u = ++m;
  6739. o ? (e.get(o, {cache: t}).success(function (e) {
  6740. if (u === m) {
  6741. var t = i.$new();
  6742. f.template = e, e = d(t, function (e) {
  6743. v(), r.enter(e, null, a, s)
  6744. }), g = e, (p = t).$emit("$includeContentLoaded"), i.$eval(l)
  6745. }
  6746. }).error(function () {
  6747. u === m && v()
  6748. }), i.$emit("$includeContentRequested")) : (v(), f.template = null)
  6749. })
  6750. }
  6751. }
  6752. }
  6753. }], qr = ["$compile", function (e) {
  6754. return {
  6755. restrict: "ECA", priority: -400, require: "ngInclude", link: function (t, n, r, o) {
  6756. n.html(o.template), e(n.contents())(t)
  6757. }
  6758. }
  6759. }], Ur = Lt({
  6760. priority: 450, compile: function () {
  6761. return {
  6762. pre: function (e, t, n) {
  6763. e.$eval(n.ngInit)
  6764. }
  6765. }
  6766. }
  6767. }), Hr = Lt({terminal: !0, priority: 1e3}), Vr = ["$locale", "$interpolate", function (e, t) {
  6768. var n = /{}/g;
  6769. return {
  6770. restrict: "EA", link: function (r, o, a) {
  6771. var s = a.count, l = a.$attr.when && o.attr(a.$attr.when), c = a.offset || 0, u = r.$eval(l) || {}, f = {},
  6772. d = t.startSymbol(), p = t.endSymbol(), h = /^when(Minus)?(.+)$/;
  6773. i(a, function (e, t) {
  6774. h.test(t) && (u[Xt(t.replace("when", "").replace("Minus", "-"))] = o.attr(a.$attr[t]))
  6775. }), i(u, function (e, r) {
  6776. f[r] = t(e.replace(n, d + s + "-" + c + p))
  6777. }), r.$watch(function () {
  6778. var t = parseFloat(r.$eval(s));
  6779. return isNaN(t) ? "" : (t in u || (t = e.pluralCat(t - c)), f[t](r, o, !0))
  6780. }, function (e) {
  6781. o.text(e)
  6782. })
  6783. }
  6784. }
  6785. }], zr = ["$parse", "$animate", function (e, n) {
  6786. var a = r("ngRepeat");
  6787. return {
  6788. transclude: "element", priority: 1e3, terminal: !0, $$tlb: !0, link: function (r, s, l, c, u) {
  6789. var f, d, p, h, g, m, v = l.ngRepeat,
  6790. b = v.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/), y = {$id: ve};
  6791. if (!b) throw a("iexp", v);
  6792. if (l = b[1], c = b[2], (b = b[3]) ? (f = e(b), d = function (e, t, n) {
  6793. return m && (y[m] = e), y[g] = t, y.$index = n, f(r, y)
  6794. }) : (p = function (e, t) {
  6795. return ve(t)
  6796. }, h = function (e) {
  6797. return e
  6798. }), !(b = l.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/))) throw a("iidexp", l);
  6799. g = b[3] || b[1], m = b[2];
  6800. var x = {};
  6801. r.$watchCollection(c, function (e) {
  6802. var l, c, f, b, y, w, $, k, T, S, C = s[0], E = {}, A = [];
  6803. if (o(e)) T = e, k = d || p; else {
  6804. k = d || h, T = [];
  6805. for (w in e) e.hasOwnProperty(w) && "$" != w.charAt(0) && T.push(w);
  6806. T.sort()
  6807. }
  6808. for (b = T.length, c = A.length = T.length, l = 0; l < c; l++) if (w = e === T ? l : T[l], $ = e[w], f = k(w, $, l), X(f, "`track by` id"), x.hasOwnProperty(f)) S = x[f], delete x[f], E[f] = S, A[l] = S; else {
  6809. if (E.hasOwnProperty(f)) throw i(A, function (e) {
  6810. e && e.scope && (x[e.id] = e)
  6811. }), a("dupes", v, f, _($));
  6812. A[l] = {id: f}, E[f] = !1
  6813. }
  6814. for (w in x) x.hasOwnProperty(w) && (S = x[w], l = Q(S.clone), n.leave(l), i(l, function (e) {
  6815. e.$$NG_REMOVED = !0
  6816. }), S.scope.$destroy());
  6817. for (l = 0, c = T.length; l < c; l++) {
  6818. if (w = e === T ? l : T[l], $ = e[w], S = A[l], A[l - 1] && (C = A[l - 1].clone[A[l - 1].clone.length - 1]), S.scope) {
  6819. y = S.scope, f = C;
  6820. do {
  6821. f = f.nextSibling
  6822. } while (f && f.$$NG_REMOVED);
  6823. S.clone[0] != f && n.move(Q(S.clone), null, Vt(C)), C = S.clone[S.clone.length - 1]
  6824. } else y = r.$new();
  6825. y[g] = $, m && (y[m] = w), y.$index = l, y.$first = 0 === l, y.$last = l === b - 1, y.$middle = !(y.$first || y.$last), y.$odd = !(y.$even = 0 == (1 & l)), S.scope || u(y, function (e) {
  6826. e[e.length++] = t.createComment(" end ngRepeat: " + v + " "), n.enter(e, null, Vt(C)), C = e, S.scope = y, S.clone = e, E[S.id] = S
  6827. })
  6828. }
  6829. x = E
  6830. })
  6831. }
  6832. }
  6833. }], Wr = ["$animate", function (e) {
  6834. return function (t, n, r) {
  6835. t.$watch(r.ngShow, function (t) {
  6836. e[F(t) ? "removeClass" : "addClass"](n, "ng-hide")
  6837. })
  6838. }
  6839. }], Gr = ["$animate", function (e) {
  6840. return function (t, n, r) {
  6841. t.$watch(r.ngHide, function (t) {
  6842. e[F(t) ? "addClass" : "removeClass"](n, "ng-hide")
  6843. })
  6844. }
  6845. }], Yr = Lt(function (e, t, n) {
  6846. e.$watch(n.ngStyle, function (e, n) {
  6847. n && e !== n && i(n, function (e, n) {
  6848. t.css(n, "")
  6849. }), e && t.css(e)
  6850. }, !0)
  6851. }), Xr = ["$animate", function (e) {
  6852. return {
  6853. restrict: "EA", require: "ngSwitch", controller: ["$scope", function () {
  6854. this.cases = {}
  6855. }], link: function (t, n, r, o) {
  6856. var a = [], s = [], l = [], c = [];
  6857. t.$watch(r.ngSwitch || r.on, function (n) {
  6858. var u, f;
  6859. for (u = 0, f = l.length; u < f; ++u) l[u].remove();
  6860. for (u = l.length = 0, f = c.length; u < f; ++u) {
  6861. var d = s[u];
  6862. c[u].$destroy(), l[u] = d, e.leave(d, function () {
  6863. l.splice(u, 1)
  6864. })
  6865. }
  6866. s.length = 0, c.length = 0, (a = o.cases["!" + n] || o.cases["?"]) && (t.$eval(r.change), i(a, function (n) {
  6867. var r = t.$new();
  6868. c.push(r), n.transclude(r, function (t) {
  6869. var r = n.element;
  6870. s.push(t), e.enter(t, r.parent(), r)
  6871. })
  6872. }))
  6873. })
  6874. }
  6875. }
  6876. }], Kr = Lt({
  6877. transclude: "element", priority: 800, require: "^ngSwitch", link: function (e, t, n, r, o) {
  6878. r.cases["!" + n.ngSwitchWhen] = r.cases["!" + n.ngSwitchWhen] || [], r.cases["!" + n.ngSwitchWhen].push({
  6879. transclude: o,
  6880. element: t
  6881. })
  6882. }
  6883. }), Qr = Lt({
  6884. transclude: "element", priority: 800, require: "^ngSwitch", link: function (e, t, n, r, o) {
  6885. r.cases["?"] = r.cases["?"] || [], r.cases["?"].push({transclude: o, element: t})
  6886. }
  6887. }), Jr = Lt({
  6888. link: function (e, t, n, o, i) {
  6889. if (!i) throw r("ngTransclude")("orphan", B(t));
  6890. i(function (e) {
  6891. t.empty(), t.append(e)
  6892. })
  6893. }
  6894. }), Zr = ["$templateCache", function (e) {
  6895. return {
  6896. restrict: "E", terminal: !0, compile: function (t, n) {
  6897. "text/ng-template" == n.type && e.put(n.id, t[0].text)
  6898. }
  6899. }
  6900. }], eo = r("ngOptions"), to = m({terminal: !0}), no = ["$compile", "$parse", function (e, r) {
  6901. var o = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
  6902. s = {$setViewValue: h};
  6903. return {
  6904. restrict: "E",
  6905. require: ["select", "?ngModel"],
  6906. controller: ["$element", "$scope", "$attrs", function (e, t, n) {
  6907. var r, o = this, i = {}, a = s;
  6908. o.databound = n.ngModel, o.init = function (e, t, n) {
  6909. a = e, r = n
  6910. }, o.addOption = function (t) {
  6911. X(t, '"option value"'), i[t] = !0, a.$viewValue == t && (e.val(t), r.parent() && r.remove())
  6912. }, o.removeOption = function (e) {
  6913. this.hasOption(e) && (delete i[e], a.$viewValue == e && this.renderUnknownOption(e))
  6914. }, o.renderUnknownOption = function (t) {
  6915. t = "? " + ve(t) + " ?", r.val(t), e.prepend(r), e.val(t), r.prop("selected", !0)
  6916. }, o.hasOption = function (e) {
  6917. return i.hasOwnProperty(e)
  6918. }, t.$on("$destroy", function () {
  6919. o.renderUnknownOption = h
  6920. })
  6921. }],
  6922. link: function (s, l, c, u) {
  6923. if (u[1]) {
  6924. var f = u[0];
  6925. u = u[1];
  6926. var d, p = c.multiple, h = c.ngOptions, g = !1, m = Vt(t.createElement("option")),
  6927. y = Vt(t.createElement("optgroup")), x = m.clone();
  6928. c = 0;
  6929. for (var w = l.children(), $ = w.length; c < $; c++) if ("" === w[c].value) {
  6930. d = g = w.eq(c);
  6931. break
  6932. }
  6933. f.init(u, g, x), p && (u.$isEmpty = function (e) {
  6934. return !e || 0 === e.length
  6935. }), h ? function (t, i, s) {
  6936. function l() {
  6937. var e, n, r, o, l, c = {"": []}, h = [""];
  6938. r = s.$modelValue, o = $(t) || [];
  6939. var S, C, E, A = v ? a(o) : o;
  6940. if (C = {}, E = !1, p) if (n = s.$modelValue, k && on(n)) for (E = new be([]), e = {}, l = 0; l < n.length; l++) e[d] = n[l], E.put(k(t, e), n[l]); else E = new be(n);
  6941. l = E;
  6942. var N, P;
  6943. for (E = 0; S = A.length, E < S; E++) {
  6944. if (n = E, v) {
  6945. if ("$" === (n = A[E]).charAt(0)) continue;
  6946. C[v] = n
  6947. }
  6948. C[d] = o[n], (n = c[e = x(t, C) || ""]) || (n = c[e] = [], h.push(e)), p ? e = b(l.remove(k ? k(t, C) : w(t, C))) : (k ? (e = {}, e[d] = r, e = k(t, e) === k(t, C)) : e = r === w(t, C), l = l || e), N = b(N = u(t, C)) ? N : "", n.push({
  6949. id: k ? k(t, C) : v ? A[E] : E,
  6950. label: N,
  6951. selected: e
  6952. })
  6953. }
  6954. for (p || (g || null === r ? c[""].unshift({
  6955. id: "",
  6956. label: "",
  6957. selected: !l
  6958. }) : l || c[""].unshift({id: "?", label: "", selected: !0})), C = 0, A = h.length; C < A; C++) {
  6959. for (n = c[e = h[C]], T.length <= C ? (r = {
  6960. element: y.clone().attr("label", e),
  6961. label: n.label
  6962. }, o = [r], T.push(o), i.append(r.element)) : (o = T[C], (r = o[0]).label != e && r.element.attr("label", r.label = e)), N = null, E = 0, S = n.length; E < S; E++) e = n[E], (l = o[E + 1]) ? (N = l.element, l.label !== e.label && (N.text(l.label = e.label), N.prop("label", l.label)), l.id !== e.id && N.val(l.id = e.id), N[0].selected !== e.selected && (N.prop("selected", l.selected = e.selected), Ht && N.prop("selected", l.selected))) : ("" === e.id && g ? P = g : (P = m.clone()).val(e.id).prop("selected", e.selected).attr("selected", e.selected).prop("label", e.label).text(e.label), o.push({
  6963. element: P,
  6964. label: e.label,
  6965. id: e.id,
  6966. selected: e.selected
  6967. }), f.addOption(e.label, P), N ? N.after(P) : r.element.append(P), N = P);
  6968. for (E++; o.length > E;) e = o.pop(), f.removeOption(e.label), e.element.remove()
  6969. }
  6970. for (; T.length > C;) T.pop()[0].element.remove()
  6971. }
  6972. var c;
  6973. if (!(c = h.match(o))) throw eo("iexp", h, B(i));
  6974. var u = r(c[2] || c[1]), d = c[4] || c[6], v = c[5], x = r(c[3] || ""), w = r(c[2] ? c[1] : d), $ = r(c[7]),
  6975. k = c[8] ? r(c[8]) : null, T = [[{element: i, label: ""}]];
  6976. g && (e(g)(t), g.removeClass("ng-scope"), g.remove()), i.empty(), i.on("change", function () {
  6977. t.$apply(function () {
  6978. var e, r, o, a, c, u, f, h, g = $(t) || [], m = {};
  6979. if (p) {
  6980. for (o = [], c = 0, f = T.length; c < f; c++) for (e = T[c], a = 1, u = e.length; a < u; a++) if ((r = e[a].element)[0].selected) {
  6981. if (r = r.val(), v && (m[v] = r), k) for (h = 0; h < g.length && (m[d] = g[h], k(t, m) != r); h++) ; else m[d] = g[r];
  6982. o.push(w(t, m))
  6983. }
  6984. } else if ("?" == (r = i.val())) o = n; else if ("" === r) o = null; else if (k) {
  6985. for (h = 0; h < g.length; h++) if (m[d] = g[h], k(t, m) == r) {
  6986. o = w(t, m);
  6987. break
  6988. }
  6989. } else m[d] = g[r], v && (m[v] = r), o = w(t, m);
  6990. s.$setViewValue(o), l()
  6991. })
  6992. }), s.$render = l, t.$watchCollection($, l), t.$watchCollection(function () {
  6993. var e = {}, n = $(t);
  6994. if (n) {
  6995. for (var r = Array(n.length), o = 0, i = n.length; o < i; o++) e[d] = n[o], r[o] = u(t, e);
  6996. return r
  6997. }
  6998. }, l), p && t.$watchCollection(function () {
  6999. return s.$modelValue
  7000. }, l)
  7001. }(s, l, u) : p ? function (e, t, n) {
  7002. var r;
  7003. n.$render = function () {
  7004. var e = new be(n.$viewValue);
  7005. i(t.find("option"), function (t) {
  7006. t.selected = b(e.get(t.value))
  7007. })
  7008. }, e.$watch(function () {
  7009. D(r, n.$viewValue) || (r = O(n.$viewValue), n.$render())
  7010. }), t.on("change", function () {
  7011. e.$apply(function () {
  7012. var e = [];
  7013. i(t.find("option"), function (t) {
  7014. t.selected && e.push(t.value)
  7015. }), n.$setViewValue(e)
  7016. })
  7017. })
  7018. }(s, l, u) : function (e, t, n, r) {
  7019. n.$render = function () {
  7020. var e = n.$viewValue;
  7021. r.hasOption(e) ? (x.parent() && x.remove(), t.val(e), "" === e && d.prop("selected", !0)) : v(e) && d ? t.val("") : r.renderUnknownOption(e)
  7022. }, t.on("change", function () {
  7023. e.$apply(function () {
  7024. x.parent() && x.remove(), n.$setViewValue(t.val())
  7025. })
  7026. })
  7027. }(s, l, u, f)
  7028. }
  7029. }
  7030. }
  7031. }], ro = ["$interpolate", function (e) {
  7032. var t = {addOption: h, removeOption: h};
  7033. return {
  7034. restrict: "E", priority: 100, compile: function (n, r) {
  7035. if (v(r.value)) {
  7036. var o = e(n.text(), !0);
  7037. o || r.$set("value", n.text())
  7038. }
  7039. return function (e, n, r) {
  7040. var i = n.parent(), a = i.data("$selectController") || i.parent().data("$selectController");
  7041. a && a.databound ? n.prop("selected", !1) : a = t, o ? e.$watch(o, function (e, t) {
  7042. r.$set("value", e), e !== t && a.removeOption(t), a.addOption(e)
  7043. }) : a.addOption(r.value), n.on("$destroy", function () {
  7044. a.removeOption(r.value)
  7045. })
  7046. }
  7047. }
  7048. }
  7049. }], oo = m({restrict: "E", terminal: !0});
  7050. e.angular.bootstrap ? console.log("WARNING: Tried to load angular more than once.") : ((zt = e.jQuery) && zt.fn.on ? (Vt = zt, f(zt.fn, {
  7051. scope: $n.scope,
  7052. isolateScope: $n.isolateScope,
  7053. controller: $n.controller,
  7054. injector: $n.injector,
  7055. inheritedData: $n.inheritedData
  7056. }), ee("remove", !0, !0, !1), ee("empty", !1, !1, !1), ee("html", !1, !1, !0)) : Vt = te, nn.element = Vt, function (t) {
  7057. f(t, {
  7058. bootstrap: z,
  7059. copy: P,
  7060. extend: f,
  7061. equals: D,
  7062. element: Vt,
  7063. forEach: i,
  7064. injector: xe,
  7065. noop: h,
  7066. bind: I,
  7067. toJson: _,
  7068. fromJson: L,
  7069. identity: g,
  7070. isUndefined: v,
  7071. isDefined: b,
  7072. isString: x,
  7073. isFunction: k,
  7074. isObject: y,
  7075. isNumber: w,
  7076. isElement: C,
  7077. isArray: on,
  7078. version: cn,
  7079. isDate: $,
  7080. lowercase: Xt,
  7081. uppercase: Qt,
  7082. callbacks: {counter: 0},
  7083. $$minErr: r,
  7084. $$csp: sn
  7085. }), Wt = J(e);
  7086. try {
  7087. Wt("ngLocale")
  7088. } catch (e) {
  7089. Wt("ngLocale", []).provider("$locale", Ue)
  7090. }
  7091. Wt("ng", ["ngLocale"], ["$provide", function (e) {
  7092. e.provider({$$sanitizeUri: ht}), e.provider("$compile", Ee).directive({
  7093. a: ar,
  7094. input: vr,
  7095. textarea: vr,
  7096. form: ur,
  7097. script: Zr,
  7098. select: no,
  7099. style: oo,
  7100. option: ro,
  7101. ngBind: Nr,
  7102. ngBindHtml: Or,
  7103. ngBindTemplate: Pr,
  7104. ngClass: Dr,
  7105. ngClassEven: Mr,
  7106. ngClassOdd: Ir,
  7107. ngCloak: _r,
  7108. ngController: Lr,
  7109. ngForm: fr,
  7110. ngHide: Gr,
  7111. ngIf: Rr,
  7112. ngInclude: jr,
  7113. ngInit: Ur,
  7114. ngNonBindable: Hr,
  7115. ngPluralize: Vr,
  7116. ngRepeat: zr,
  7117. ngShow: Wr,
  7118. ngStyle: Yr,
  7119. ngSwitch: Xr,
  7120. ngSwitchWhen: Kr,
  7121. ngSwitchDefault: Qr,
  7122. ngOptions: to,
  7123. ngTransclude: Jr,
  7124. ngModel: kr,
  7125. ngList: Cr,
  7126. ngChange: Tr,
  7127. required: Sr,
  7128. ngRequired: Sr,
  7129. ngValue: Ar
  7130. }).directive({ngInclude: qr}).directive(sr).directive(Fr), e.provider({
  7131. $anchorScroll: we,
  7132. $animate: On,
  7133. $browser: Te,
  7134. $cacheFactory: Se,
  7135. $controller: Pe,
  7136. $document: Oe,
  7137. $exceptionHandler: De,
  7138. $filter: Tt,
  7139. $interpolate: je,
  7140. $interval: qe,
  7141. $http: Le,
  7142. $httpBackend: Be,
  7143. $location: et,
  7144. $log: tt,
  7145. $parse: ct,
  7146. $rootScope: pt,
  7147. $q: ut,
  7148. $sce: bt,
  7149. $sceDelegate: vt,
  7150. $sniffer: yt,
  7151. $templateCache: Ce,
  7152. $timeout: xt,
  7153. $window: kt,
  7154. $$rAF: dt,
  7155. $$asyncCallback: $e
  7156. })
  7157. }])
  7158. }(nn), Vt(t).ready(function () {
  7159. V(t, z)
  7160. }))
  7161. }(window, document), !window.angular.$$csp() && window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}.ng-hide-add-active,.ng-hide-remove{display:block!important;}</style>'), angular.module("sly", ["slyEvaluate", "slyRepeat"]), defineScalyrAngularModule("slyEvaluate", ["gatedScope"]).directive("slyEvaluateOnlyWhen", ["$parse", function (e) {
  7162. return {
  7163. scope: !0, restrict: "A", compile: function (t, n) {
  7164. return {
  7165. pre: function (t, n, r) {
  7166. var o = null, i = !1, a = e(r.slyEvaluateOnlyWhen), s = null;
  7167. if (hasProperty(r, "slyAlwaysEvaluate") && (s = r.slyAlwaysEvaluate, isStringEmpty(s))) throw new Exception("Empty string is illegal for value of slyAlwaysEvaluate");
  7168. t.$addWatcherGate(function () {
  7169. var e = a(t);
  7170. if (!i) return i = !0, o = e, !0;
  7171. var n = o !== e;
  7172. return o = e, n
  7173. }, function (e) {
  7174. return isNull(s) || !(isStringNonempty(e) && e.indexOf(s) >= 0)
  7175. }, !0)
  7176. }
  7177. }
  7178. }
  7179. }
  7180. }]).directive("slyAlwaysEvaluate", function () {
  7181. return {
  7182. restrict: "A", link: function (e, t, n) {
  7183. }
  7184. }
  7185. }).directive("slyShow", ["$animate", function (e) {
  7186. function t(e) {
  7187. if (e && 0 !== e.length) {
  7188. var t = "" + e;
  7189. e = !("f" == (t = isString(t) ? t.toLowerCase() : t) || "0" == t || "false" == t || "no" == t || "n" == t || "[]" == t)
  7190. } else e = !1;
  7191. return e
  7192. }
  7193. return {
  7194. restrict: "A", link: function (n, r, o) {
  7195. n.$watch(o.slyShow, function (n) {
  7196. e[t(n) ? "removeClass" : "addClass"](r, "ng-hide")
  7197. }, !1, "slyShow")
  7198. }
  7199. }
  7200. }]).directive("slyPreventEvaluationWhenHidden", function () {
  7201. return {
  7202. restrict: "A", scope: !0, compile: function (e, t) {
  7203. return {
  7204. pre: function (e, t, n) {
  7205. e.$addWatcherGate(function () {
  7206. return !t.hasClass("ng-hide")
  7207. }, function (e, t, n, r) {
  7208. return !isDefined(r) || "slyShow" != r
  7209. })
  7210. }
  7211. }
  7212. }
  7213. }
  7214. }), defineScalyrAngularModule("slyRepeat", ["gatedScope"]).directive("slyRepeat", ["$animate", "$parse", function (e, t) {
  7215. function n(e) {
  7216. e.scope.$addWatcherGate(function () {
  7217. return e.isActiveForRepeat
  7218. })
  7219. }
  7220. return {
  7221. restrict: "A", scope: !0, transclude: "element", priority: 1e3, terminal: !0, compile: function (t, r, o) {
  7222. return function (t, r, i) {
  7223. var a = i.slyRepeat, s = a.match(/^\s*(.+)\s+in\s+(.*?)$/);
  7224. if (!s) throw Error("Expected slyRepeat in form of '_item_ in _collection_' but got '" + a + "'.");
  7225. var l = s[1], c = s[2];
  7226. if (!(s = l.match(/^(?:([\$\w]+))$/))) throw Error("'item' in 'item in collection' should be identifier but got '" + lhs + "'.");
  7227. var u = [], f = [], d = t.$watchCollection(c, function (i) {
  7228. if (i) {
  7229. if (!isArray(i)) throw Error("'collection' did not evaluate to an array. expression was " + c);
  7230. var a = u.length;
  7231. if (u.length < i.length && f.length > 0) {
  7232. var s = u.length + f.length;
  7233. s > i.length && (s = i.length), u = u.concat(f.splice(0, s - u.length))
  7234. }
  7235. var d = null, p = [], h = [];
  7236. if (i.length > u.length) {
  7237. for (y = u.length; y < i.length; ++y) {
  7238. var g = {scope: t.$new(), isActiveForRepeat: !0};
  7239. n(g), g.scope.$index = y, g.scope.$first = 0 == y, h.push(g)
  7240. }
  7241. d = u.concat(h), p = f
  7242. } else if (i.length < u.length) {
  7243. for (y = i.length; y < u.length; ++y) u[y].isActiveForRepeat = !1;
  7244. p = u.splice(i.length, u.length - i.length).concat(f), d = u
  7245. } else d = u, p = f;
  7246. if (d.length > 0) {
  7247. var m = d.length - 1, v = d.length - 1;
  7248. a < d.length && (m = a), m > 0 && (m -= 1);
  7249. for (y = m; y <= v; ++y) d[y].scope.$last = y == d.length - 1, d[y].scope.$middle = 0 != y && y != d.length - 1, d[y].isActiveForRepeat || (d[y].isActiveForRepeat = !0, d[y].element.css("display", ""))
  7250. }
  7251. for (y = 0; y < p.length && !p[y].isActiveForRepeat; ++y) p[y].element.css("display", "none");
  7252. for (y = 0; y < d.length; ++y) d[y].scope[l] = i[y];
  7253. var b = r;
  7254. u.length > 0 && (b = u[u.length - 1].element);
  7255. for (var y = 0; y < h.length; ++y) o(h[y].scope, function (t) {
  7256. e.enter(t, null, b), b = t, h[y].element = t
  7257. });
  7258. u = d, f = p
  7259. }
  7260. });
  7261. t.$on("$destroy", function () {
  7262. d()
  7263. })
  7264. }
  7265. }
  7266. }
  7267. }]), defineScalyrAngularModule("gatedScope", []).config(["$provide", function (e) {
  7268. e.decorator("$rootScope", ["$delegate", "$exceptionHandler", function (e, t) {
  7269. var n = {};
  7270. for (var r in e) isFunction(e[r]) && (n[r] = e[r]);
  7271. var o, i = e.constructor, a = {};
  7272. return a.$new = function (e) {
  7273. var t = n.$new.call(this, e);
  7274. return t.$$gatingFunction = this.$$gatingFunction, t.$$parentGatingFunction = this.$$gatingFunction, t.$$shouldGateFunction = this.$$shouldGateFunction, t.$$gatedWatchers = [], t.$$cleanUpQueue = this.$$cleanUpQueue, t
  7275. }, a.$digestGated = function (e) {
  7276. var n, r, i, a, s, l, c = this, u = this, f = !1;
  7277. do {
  7278. if (i = c.$$gatedWatchers) for (a = i.length; a--;) try {
  7279. if ((n = i[a]).gatingFunction !== e) continue;
  7280. n && !isNull(n.cleanUp) && (n.cleanUp(), n.cleanUp = null), n && (r = n.get(c)) !== (l = n.last) && !(n.eq ? areEqual(r, l) : "number" == typeof r && "number" == typeof l && isNaN(r) && isNaN(l)) && (f = !0, n.last = n.eq ? copy(r) : r, n.fn(r, l === o ? r : l, c))
  7281. } catch (e) {
  7282. t(e)
  7283. }
  7284. if (!(s = c.$$gatingFunction === e && c.$$childHead || c !== u && c.$$nextSibling)) for (; c !== u && !(s = c.$$nextSibling);) c = c.$parent
  7285. } while (c = s);
  7286. return e.hasDigested = !0, f
  7287. }, a.$watch = function (e, t, r, i) {
  7288. if (isNull(this.$$gatingFunction) || !isNull(this.$$shouldGateFunction) && !this.$$shouldGateFunction(e, t, r, i)) return n.$watch.call(this, e, t, r);
  7289. var a = this.$$watchers;
  7290. this.$$watchers = this.$$gatedWatchers;
  7291. var s = n.$watch.call(this, e, t, r);
  7292. this.$$watchers = a, this.$$gatedWatchers[0].gatingFunction = this.$$gatingFunction, this.$$gatedWatchers[0].cleanUp = null, o = this.$$gatedWatchers[0].last;
  7293. var l = this.$$gatedWatchers[0];
  7294. if (this.$$gatingFunction.shouldEvalNewWatchers && this.$$gatingFunction.hasDigested) {
  7295. var c = this;
  7296. l.cleanUp = n.$watch.call(c, function () {
  7297. isNull(l.cleanUp) || (c.$$cleanUpQueue.unshift(l.cleanUp), l.cleanUp = null);
  7298. var e, t = o;
  7299. return l && (e = l.get(c)) !== (t = l.last) && !(l.eq ? areEqual(e, t) : "number" == typeof e && "number" == typeof t && isNaN(e) && isNaN(t)) && (l.last = l.eq ? copy(e) : e, l.fn(e, t === o ? e : t, c)), l.last
  7300. })
  7301. }
  7302. return s
  7303. }, a.$digest = function () {
  7304. var e = !1;
  7305. if (!isNull(this.$$parentGatingFunction) && this.$$parentGatingFunction()) {
  7306. var r = 5;
  7307. do {
  7308. if (e = this.$digestGated(this.$$parentGatingFunction), r--, e && !r--) throw Error(TTL + " $digest() iterations reached for gated watcher. Aborting!\nWatchers fired in the last 5 iterations.")
  7309. } while (e)
  7310. }
  7311. e = n.$digest.call(this) || e;
  7312. for (var o = this.$$cleanUpQueue; o.length;) try {
  7313. o.shift()()
  7314. } catch (e) {
  7315. t(e)
  7316. }
  7317. return e
  7318. }, a.$addWatcherGate = function (e, t, r) {
  7319. var o = 0, i = this, a = !isNull(this.$$gatingFunction);
  7320. !function () {
  7321. var t = null;
  7322. i.$watch(function () {
  7323. return e() ? i.$digestGated(e) && ++o : a && isNull(t) && (t = n.$watch.call(i, function () {
  7324. return e() && (t(), t = null, i.$digestGated(e) && ++o), o
  7325. })), o
  7326. })
  7327. }(), isUndefined(t) && (t = null), isUndefined(r) && (r = !1), this.$$gatingFunction = e, this.$$gatingFunction.shouldEvalNewWatchers = r, this.$$shouldGateFunction = t
  7328. }, angular.extend(i.prototype, a), angular.extend(e, a), e.$$gatingFunction = null, e.$$parentGatingFunction = null, e.$$shouldGateFunction = null, e.$$gatedWatchers = [], e.$$cleanUpQueue = [], e
  7329. }])
  7330. }]), defineScalyrAngularModule("slyEvaluate", ["gatedScope"]).directive("slyEvaluateOnlyWhen", ["$parse", function (e) {
  7331. return {
  7332. scope: !0, restrict: "A", compile: function (t, n) {
  7333. return {
  7334. pre: function (t, n, r) {
  7335. var o = null, i = !1, a = e(r.slyEvaluateOnlyWhen), s = null;
  7336. if (hasProperty(r, "slyAlwaysEvaluate") && (s = r.slyAlwaysEvaluate, isStringEmpty(s))) throw new Exception("Empty string is illegal for value of slyAlwaysEvaluate");
  7337. t.$addWatcherGate(function () {
  7338. var e = a(t);
  7339. if (!i) return i = !0, o = e, !0;
  7340. var n = o !== e;
  7341. return o = e, n
  7342. }, function (e) {
  7343. return isNull(s) || !(isStringNonempty(e) && e.indexOf(s) >= 0)
  7344. }, !0)
  7345. }
  7346. }
  7347. }
  7348. }
  7349. }]).directive("slyAlwaysEvaluate", function () {
  7350. return {
  7351. restrict: "A", link: function (e, t, n) {
  7352. }
  7353. }
  7354. }).directive("slyShow", ["$animate", function (e) {
  7355. function t(e) {
  7356. if (e && 0 !== e.length) {
  7357. var t = "" + e;
  7358. e = !("f" == (t = isString(t) ? t.toLowerCase() : t) || "0" == t || "false" == t || "no" == t || "n" == t || "[]" == t)
  7359. } else e = !1;
  7360. return e
  7361. }
  7362. return {
  7363. restrict: "A", link: function (n, r, o) {
  7364. n.$watch(o.slyShow, function (n) {
  7365. e[t(n) ? "removeClass" : "addClass"](r, "ng-hide")
  7366. }, !1, "slyShow")
  7367. }
  7368. }
  7369. }]).directive("slyPreventEvaluationWhenHidden", function () {
  7370. return {
  7371. restrict: "A", scope: !0, compile: function (e, t) {
  7372. return {
  7373. pre: function (e, t, n) {
  7374. e.$addWatcherGate(function () {
  7375. return !t.hasClass("ng-hide")
  7376. }, function (e, t, n, r) {
  7377. return !isDefined(r) || "slyShow" != r
  7378. })
  7379. }
  7380. }
  7381. }
  7382. }
  7383. }), defineScalyrAngularModule("slyRepeat", ["gatedScope"]).directive("slyRepeat", ["$animate", "$parse", function (e, t) {
  7384. function n(e) {
  7385. e.scope.$addWatcherGate(function () {
  7386. return e.isActiveForRepeat
  7387. })
  7388. }
  7389. return {
  7390. restrict: "A", scope: !0, transclude: "element", priority: 1e3, terminal: !0, compile: function (t, r, o) {
  7391. return function (t, r, i) {
  7392. var a = i.slyRepeat, s = a.match(/^\s*(.+)\s+in\s+(.*?)$/);
  7393. if (!s) throw Error("Expected slyRepeat in form of '_item_ in _collection_' but got '" + a + "'.");
  7394. var l = s[1], c = s[2];
  7395. if (!(s = l.match(/^(?:([\$\w]+))$/))) throw Error("'item' in 'item in collection' should be identifier but got '" + lhs + "'.");
  7396. var u = [], f = [], d = t.$watchCollection(c, function (i) {
  7397. if (i) {
  7398. if (!isArray(i)) throw Error("'collection' did not evaluate to an array. expression was " + c);
  7399. var a = u.length;
  7400. if (u.length < i.length && f.length > 0) {
  7401. var s = u.length + f.length;
  7402. s > i.length && (s = i.length), u = u.concat(f.splice(0, s - u.length))
  7403. }
  7404. var d = null, p = [], h = [];
  7405. if (i.length > u.length) {
  7406. for (y = u.length; y < i.length; ++y) {
  7407. var g = {scope: t.$new(), isActiveForRepeat: !0};
  7408. n(g), g.scope.$index = y, g.scope.$first = 0 == y, h.push(g)
  7409. }
  7410. d = u.concat(h), p = f
  7411. } else if (i.length < u.length) {
  7412. for (y = i.length; y < u.length; ++y) u[y].isActiveForRepeat = !1;
  7413. p = u.splice(i.length, u.length - i.length).concat(f), d = u
  7414. } else d = u, p = f;
  7415. if (d.length > 0) {
  7416. var m = d.length - 1, v = d.length - 1;
  7417. a < d.length && (m = a), m > 0 && (m -= 1);
  7418. for (y = m; y <= v; ++y) d[y].scope.$last = y == d.length - 1, d[y].scope.$middle = 0 != y && y != d.length - 1, d[y].isActiveForRepeat || (d[y].isActiveForRepeat = !0, d[y].element.css("display", ""))
  7419. }
  7420. for (y = 0; y < p.length && !p[y].isActiveForRepeat; ++y) p[y].element.css("display", "none");
  7421. for (y = 0; y < d.length; ++y) d[y].scope[l] = i[y];
  7422. var b = r;
  7423. u.length > 0 && (b = u[u.length - 1].element);
  7424. for (var y = 0; y < h.length; ++y) o(h[y].scope, function (t) {
  7425. e.enter(t, null, b), b = t, h[y].element = t
  7426. });
  7427. u = d, f = p
  7428. }
  7429. });
  7430. t.$on("$destroy", function () {
  7431. d()
  7432. })
  7433. }
  7434. }
  7435. }
  7436. }]), function (e, t) {
  7437. "function" == typeof define && define.amd ? define([], function () {
  7438. return t()
  7439. }) : "object" == typeof exports ? module.exports = t() : t()
  7440. }(0, function () {
  7441. function e(e) {
  7442. "use strict";
  7443. var t = e.storageKey(), n = e.storage(), r = function () {
  7444. var r = e.preferredLanguage();
  7445. angular.isString(r) ? e.use(r) : n.put(t, e.use())
  7446. };
  7447. r.displayName = "fallbackFromIncorrectStorageValue", n ? n.get(t) ? e.use(n.get(t)).catch(r) : r() : angular.isString(e.preferredLanguage()) && e.use(e.preferredLanguage())
  7448. }
  7449. function t(e, t, n, r) {
  7450. "use strict";
  7451. var o, i, a, s, l, c, u, f, d, p, h, g, m, v, b, y = {}, x = [], w = e, $ = [], k = "translate-cloak", T = !1,
  7452. S = !1, C = ".", E = 0, A = !0, N = "default", P = {
  7453. default: function (e) {
  7454. return (e || "").split("-").join("_")
  7455. }, java: function (e) {
  7456. var t = (e || "").split("-").join("_"), n = t.split("_");
  7457. return n.length > 1 ? n[0].toLowerCase() + "_" + n[1].toUpperCase() : t
  7458. }, bcp47: function (e) {
  7459. var t = (e || "").split("_").join("-"), n = t.split("-");
  7460. return n.length > 1 ? n[0].toLowerCase() + "-" + n[1].toUpperCase() : t
  7461. }
  7462. }, O = function () {
  7463. if (angular.isFunction(r.getLocale)) return r.getLocale();
  7464. var e, n, o = t.$get().navigator, i = ["language", "browserLanguage", "systemLanguage", "userLanguage"];
  7465. if (angular.isArray(o.languages)) for (e = 0; e < o.languages.length; e++) if ((n = o.languages[e]) && n.length) return n;
  7466. for (e = 0; e < i.length; e++) if ((n = o[i[e]]) && n.length) return n;
  7467. return null
  7468. };
  7469. O.displayName = "angular-translate/service: getFirstBrowserLanguage";
  7470. var D = function () {
  7471. var e = O() || "";
  7472. return P[N] && (e = P[N](e)), e
  7473. };
  7474. D.displayName = "angular-translate/service: getLocale";
  7475. var I = function (e, t) {
  7476. for (var n = 0, r = e.length; r > n; n++) if (e[n] === t) return n;
  7477. return -1
  7478. }, M = function () {
  7479. return this.toString().replace(/^\s+|\s+$/g, "")
  7480. }, _ = function (e) {
  7481. for (var t = [], n = angular.lowercase(e), r = 0, o = x.length; o > r; r++) t.push(angular.lowercase(x[r]));
  7482. if (I(t, n) > -1) return e;
  7483. if (i) {
  7484. var a;
  7485. for (var s in i) {
  7486. var l = !1, c = Object.prototype.hasOwnProperty.call(i, s) && angular.lowercase(s) === angular.lowercase(e);
  7487. if ("*" === s.slice(-1) && (l = s.slice(0, -1) === e.slice(0, s.length - 1)), (c || l) && (a = i[s], I(t, angular.lowercase(a)) > -1)) return a
  7488. }
  7489. }
  7490. if (e) {
  7491. var u = e.split("_");
  7492. if (u.length > 1 && I(t, angular.lowercase(u[0])) > -1) return u[0]
  7493. }
  7494. return e
  7495. }, L = function (e, t) {
  7496. if (!e && !t) return y;
  7497. if (e && !t) {
  7498. if (angular.isString(e)) return y[e]
  7499. } else angular.isObject(y[e]) || (y[e] = {}), angular.extend(y[e], F(t));
  7500. return this
  7501. };
  7502. this.translations = L, this.cloakClassName = function (e) {
  7503. return e ? (k = e, this) : k
  7504. }, this.nestedObjectDelimeter = function (e) {
  7505. return e ? (C = e, this) : C
  7506. };
  7507. var F = function (e, t, n, r) {
  7508. var o, i, a, s;
  7509. t || (t = []), n || (n = {});
  7510. for (o in e) Object.prototype.hasOwnProperty.call(e, o) && (s = e[o], angular.isObject(s) ? F(s, t.concat(o), n, o) : (i = t.length ? "" + t.join(C) + C + o : o, t.length && o === r && (a = "" + t.join(C), n[a] = "@:" + i), n[i] = s));
  7511. return n
  7512. };
  7513. F.displayName = "flatObject", this.addInterpolation = function (e) {
  7514. return $.push(e), this
  7515. }, this.useMessageFormatInterpolation = function () {
  7516. return this.useInterpolation("$translateMessageFormatInterpolation")
  7517. }, this.useInterpolation = function (e) {
  7518. return p = e, this
  7519. }, this.useSanitizeValueStrategy = function (e) {
  7520. return n.useStrategy(e), this
  7521. }, this.preferredLanguage = function (e) {
  7522. return e ? (B(e), this) : o
  7523. };
  7524. var B = function (e) {
  7525. return e && (o = e), o
  7526. };
  7527. this.translationNotFoundIndicator = function (e) {
  7528. return this.translationNotFoundIndicatorLeft(e), this.translationNotFoundIndicatorRight(e), this
  7529. }, this.translationNotFoundIndicatorLeft = function (e) {
  7530. return e ? (m = e, this) : m
  7531. }, this.translationNotFoundIndicatorRight = function (e) {
  7532. return e ? (v = e, this) : v
  7533. }, this.fallbackLanguage = function (e) {
  7534. return R(e), this
  7535. };
  7536. var R = function (e) {
  7537. return e ? (angular.isString(e) ? (s = !0, a = [e]) : angular.isArray(e) && (s = !1, a = e), angular.isString(o) && I(a, o) < 0 && a.push(o), this) : s ? a[0] : a
  7538. };
  7539. this.use = function (e) {
  7540. if (e) {
  7541. if (!y[e] && !h) throw new Error("$translateProvider couldn't find translationTable for langKey: '" + e + "'");
  7542. return l = e, this
  7543. }
  7544. return l
  7545. };
  7546. var j = function (e) {
  7547. return e ? (w = e, this) : f ? f + w : w
  7548. };
  7549. this.storageKey = j, this.useUrlLoader = function (e, t) {
  7550. return this.useLoader("$translateUrlLoader", angular.extend({url: e}, t))
  7551. }, this.useStaticFilesLoader = function (e) {
  7552. return this.useLoader("$translateStaticFilesLoader", e)
  7553. }, this.useLoader = function (e, t) {
  7554. return h = e, g = t || {}, this
  7555. }, this.useLocalStorage = function () {
  7556. return this.useStorage("$translateLocalStorage")
  7557. }, this.useCookieStorage = function () {
  7558. return this.useStorage("$translateCookieStorage")
  7559. }, this.useStorage = function (e) {
  7560. return u = e, this
  7561. }, this.storagePrefix = function (e) {
  7562. return e ? (f = e, this) : e
  7563. }, this.useMissingTranslationHandlerLog = function () {
  7564. return this.useMissingTranslationHandler("$translateMissingTranslationHandlerLog")
  7565. }, this.useMissingTranslationHandler = function (e) {
  7566. return d = e, this
  7567. }, this.usePostCompiling = function (e) {
  7568. return T = !!e, this
  7569. }, this.forceAsyncReload = function (e) {
  7570. return S = !!e, this
  7571. }, this.uniformLanguageTag = function (e) {
  7572. return e ? angular.isString(e) && (e = {standard: e}) : e = {}, N = e.standard, this
  7573. }, this.determinePreferredLanguage = function (e) {
  7574. var t = e && angular.isFunction(e) ? e() : D();
  7575. return o = x.length ? _(t) : t, this
  7576. }, this.registerAvailableLanguageKeys = function (e, t) {
  7577. return e ? (x = e, t && (i = t), this) : x
  7578. }, this.useLoaderCache = function (e) {
  7579. return !1 === e ? b = void 0 : !0 === e ? b = !0 : void 0 === e ? b = "$translationCache" : e && (b = e), this
  7580. }, this.directivePriority = function (e) {
  7581. return void 0 === e ? E : (E = e, this)
  7582. }, this.statefulFilter = function (e) {
  7583. return void 0 === e ? A : (A = e, this)
  7584. }, this.$get = ["$log", "$injector", "$rootScope", "$q", function (e, t, n, r) {
  7585. var i, f, x, N, P = t.get(p || "$translateDefaultInterpolation"), O = !1, D = {}, q = {},
  7586. U = function (e, t, n, s) {
  7587. if (angular.isArray(e)) {
  7588. return function (e) {
  7589. for (var o = {}, i = [], a = 0, l = e.length; l > a; a++) i.push(function (e) {
  7590. var i = r.defer(), a = function (t) {
  7591. o[e] = t, i.resolve([e, t])
  7592. };
  7593. return U(e, t, n, s).then(a, a), i.promise
  7594. }(e[a]));
  7595. return r.all(i).then(function () {
  7596. return o
  7597. })
  7598. }(e)
  7599. }
  7600. var c = r.defer();
  7601. e && (e = M.apply(e));
  7602. var d = function () {
  7603. var e = o ? q[o] : q[l];
  7604. if (f = 0, u && !e) {
  7605. var t = i.get(w);
  7606. if (e = q[t], a && a.length) {
  7607. var n = I(a, t);
  7608. f = 0 === n ? 1 : 0, I(a, o) < 0 && a.push(o)
  7609. }
  7610. }
  7611. return e
  7612. }();
  7613. if (d) {
  7614. var p = function () {
  7615. te(e, t, n, s).then(c.resolve, c.reject)
  7616. };
  7617. p.displayName = "promiseResolved", d.finally(p, c.reject)
  7618. } else te(e, t, n, s).then(c.resolve, c.reject);
  7619. return c.promise
  7620. }, H = function (e) {
  7621. return m && (e = [m, e].join(" ")), v && (e = [e, v].join(" ")), e
  7622. }, V = function (e) {
  7623. l = e, u && i.put(U.storageKey(), l), n.$emit("$translateChangeSuccess", {language: e}), P.setLocale(l);
  7624. var t = function (e, t) {
  7625. D[t].setLocale(l)
  7626. };
  7627. t.displayName = "eachInterpolatorLocaleSetter", angular.forEach(D, t), n.$emit("$translateChangeEnd", {language: e})
  7628. }, z = function (e) {
  7629. if (!e) throw"No language key specified for loading.";
  7630. var o = r.defer();
  7631. n.$emit("$translateLoadingStart", {language: e}), O = !0;
  7632. var i = b;
  7633. "string" == typeof i && (i = t.get(i)), O && N && N.resolve(), N = r.defer();
  7634. var a = angular.extend({}, g, {key: e, $http: angular.extend({}, {cache: i, timeout: N.promise}, g.$http)}),
  7635. s = function (t) {
  7636. var r = {};
  7637. n.$emit("$translateLoadingSuccess", {language: e}), angular.isArray(t) ? angular.forEach(t, function (e) {
  7638. angular.extend(r, F(e))
  7639. }) : angular.extend(r, F(t)), O = !1, o.resolve({
  7640. key: e,
  7641. table: r
  7642. }), n.$emit("$translateLoadingEnd", {language: e})
  7643. };
  7644. s.displayName = "onLoaderSuccess";
  7645. var l = function (e) {
  7646. n.$emit("$translateLoadingError", {language: e}), o.reject(e), n.$emit("$translateLoadingEnd", {language: e})
  7647. };
  7648. return l.displayName = "onLoaderError", t.get(h)(a).then(s, l), o.promise
  7649. };
  7650. if (u && (!(i = t.get(u)).get || !i.put)) throw new Error("Couldn't use storage '" + u + "', missing get() or put() method!");
  7651. if ($.length) {
  7652. var W = function (e) {
  7653. var n = t.get(e);
  7654. n.setLocale(o || l), D[n.getInterpolationIdentifier()] = n
  7655. };
  7656. W.displayName = "interpolationFactoryAdder", angular.forEach($, W)
  7657. }
  7658. var G = function (e) {
  7659. var t = r.defer();
  7660. if (Object.prototype.hasOwnProperty.call(y, e)) t.resolve(y[e]); else if (q[e]) {
  7661. var n = function (e) {
  7662. L(e.key, e.table), t.resolve(e.table)
  7663. };
  7664. n.displayName = "translationTableResolver", q[e].then(n, t.reject)
  7665. } else t.reject();
  7666. return t.promise
  7667. }, Y = function (e, t, n, o) {
  7668. var i = r.defer(), a = function (r) {
  7669. if (Object.prototype.hasOwnProperty.call(r, t)) {
  7670. o.setLocale(e);
  7671. var a = r[t];
  7672. "@:" === a.substr(0, 2) ? Y(e, a.substr(2), n, o).then(i.resolve, i.reject) : i.resolve(o.interpolate(r[t], n)), o.setLocale(l)
  7673. } else i.reject()
  7674. };
  7675. return a.displayName = "fallbackTranslationResolver", G(e).then(a, i.reject), i.promise
  7676. }, X = function (e, t, n, r) {
  7677. var o, i = y[e];
  7678. if (i && Object.prototype.hasOwnProperty.call(i, t)) {
  7679. if (r.setLocale(e), "@:" === (o = r.interpolate(i[t], n)).substr(0, 2)) return X(e, o.substr(2), n, r);
  7680. r.setLocale(l)
  7681. }
  7682. return o
  7683. }, K = function (e, n) {
  7684. if (d) {
  7685. var r = t.get(d)(e, l, n);
  7686. return void 0 !== r ? r : e
  7687. }
  7688. return e
  7689. }, Q = function (e, t, n, o, i) {
  7690. var s = r.defer();
  7691. if (e < a.length) {
  7692. var l = a[e];
  7693. Y(l, t, n, o).then(s.resolve, function () {
  7694. Q(e + 1, t, n, o, i).then(s.resolve)
  7695. })
  7696. } else s.resolve(i || K(t, n));
  7697. return s.promise
  7698. }, J = function (e, t, n, r) {
  7699. var o;
  7700. if (e < a.length) {
  7701. var i = a[e];
  7702. (o = X(i, t, n, r)) || (o = J(e + 1, t, n, r))
  7703. }
  7704. return o
  7705. }, Z = function (e, t, n, r) {
  7706. return Q(x > 0 ? x : f, e, t, n, r)
  7707. }, ee = function (e, t, n) {
  7708. return J(x > 0 ? x : f, e, t, n)
  7709. }, te = function (e, t, n, o) {
  7710. var i = r.defer(), s = l ? y[l] : y, c = n ? D[n] : P;
  7711. if (s && Object.prototype.hasOwnProperty.call(s, e)) {
  7712. var u = s[e];
  7713. "@:" === u.substr(0, 2) ? U(u.substr(2), t, n, o).then(i.resolve, i.reject) : i.resolve(c.interpolate(u, t))
  7714. } else {
  7715. var f;
  7716. d && !O && (f = K(e, t)), l && a && a.length ? Z(e, t, c, o).then(function (e) {
  7717. i.resolve(e)
  7718. }, function (e) {
  7719. i.reject(H(e))
  7720. }) : d && !O && f ? i.resolve(o || f) : o ? i.resolve(o) : i.reject(H(e))
  7721. }
  7722. return i.promise
  7723. }, ne = function (e, t, n) {
  7724. var r, o = l ? y[l] : y, i = P;
  7725. if (D && Object.prototype.hasOwnProperty.call(D, n) && (i = D[n]), o && Object.prototype.hasOwnProperty.call(o, e)) {
  7726. var s = o[e];
  7727. r = "@:" === s.substr(0, 2) ? ne(s.substr(2), t, n) : i.interpolate(s, t)
  7728. } else {
  7729. var c;
  7730. d && !O && (c = K(e, t)), l && a && a.length ? (f = 0, r = ee(e, t, i)) : r = d && !O && c ? c : H(e)
  7731. }
  7732. return r
  7733. }, re = function (e) {
  7734. c === e && (c = void 0), q[e] = void 0
  7735. };
  7736. U.preferredLanguage = function (e) {
  7737. return e && B(e), o
  7738. }, U.cloakClassName = function () {
  7739. return k
  7740. }, U.nestedObjectDelimeter = function () {
  7741. return C
  7742. }, U.fallbackLanguage = function (e) {
  7743. if (void 0 !== e && null !== e) {
  7744. if (R(e), h && a && a.length) for (var t = 0, n = a.length; n > t; t++) q[a[t]] || (q[a[t]] = z(a[t]));
  7745. U.use(U.use())
  7746. }
  7747. return s ? a[0] : a
  7748. }, U.useFallbackLanguage = function (e) {
  7749. if (void 0 !== e && null !== e) if (e) {
  7750. var t = I(a, e);
  7751. t > -1 && (x = t)
  7752. } else x = 0
  7753. }, U.proposedLanguage = function () {
  7754. return c
  7755. }, U.storage = function () {
  7756. return i
  7757. }, U.use = function (e) {
  7758. if (!e) return l;
  7759. var t = r.defer();
  7760. n.$emit("$translateChangeStart", {language: e});
  7761. var o = _(e);
  7762. return o && (e = o), !S && y[e] || !h || q[e] ? c === e && q[e] ? q[e].then(function (e) {
  7763. return t.resolve(e.key), e
  7764. }, function (e) {
  7765. return t.reject(e), r.reject(e)
  7766. }) : (t.resolve(e), V(e)) : (c = e, q[e] = z(e).then(function (e) {
  7767. return L(e.key, e.table), t.resolve(e.key), V(e.key), e
  7768. }, function (e) {
  7769. return n.$emit("$translateChangeError", {language: e}), t.reject(e), n.$emit("$translateChangeEnd", {language: e}), r.reject(e)
  7770. }), q[e].finally(function () {
  7771. re(e)
  7772. })), t.promise
  7773. }, U.storageKey = function () {
  7774. return j()
  7775. }, U.isPostCompilingEnabled = function () {
  7776. return T
  7777. }, U.isForceAsyncReloadEnabled = function () {
  7778. return S
  7779. }, U.refresh = function (e) {
  7780. function t() {
  7781. i.resolve(), n.$emit("$translateRefreshEnd", {language: e})
  7782. }
  7783. function o() {
  7784. i.reject(), n.$emit("$translateRefreshEnd", {language: e})
  7785. }
  7786. if (!h) throw new Error("Couldn't refresh translation table, no loader registered!");
  7787. var i = r.defer();
  7788. if (n.$emit("$translateRefreshStart", {language: e}), e) if (y[e]) {
  7789. var s = function (n) {
  7790. L(n.key, n.table), e === l && V(l), t()
  7791. };
  7792. s.displayName = "refreshPostProcessor", z(e).then(s, o)
  7793. } else o(); else {
  7794. var c = [], u = {};
  7795. if (a && a.length) for (var f = 0, d = a.length; d > f; f++) c.push(z(a[f])), u[a[f]] = !0;
  7796. l && !u[l] && c.push(z(l));
  7797. var p = function (e) {
  7798. y = {}, angular.forEach(e, function (e) {
  7799. L(e.key, e.table)
  7800. }), l && V(l), t()
  7801. };
  7802. p.displayName = "refreshPostProcessor", r.all(c).then(p, o)
  7803. }
  7804. return i.promise
  7805. }, U.instant = function (e, t, n) {
  7806. if (null === e || angular.isUndefined(e)) return e;
  7807. if (angular.isArray(e)) {
  7808. for (var r = {}, i = 0, s = e.length; s > i; i++) r[e[i]] = U.instant(e[i], t, n);
  7809. return r
  7810. }
  7811. if (angular.isString(e) && e.length < 1) return e;
  7812. e && (e = M.apply(e));
  7813. var c, u = [];
  7814. o && u.push(o), l && u.push(l), a && a.length && (u = u.concat(a));
  7815. for (var f = 0, p = u.length; p > f; f++) {
  7816. var h = u[f];
  7817. if (y[h] && (void 0 !== y[h][e] ? c = ne(e, t, n) : (m || v) && (c = H(e))), void 0 !== c) break
  7818. }
  7819. return c || "" === c || (c = P.interpolate(e, t), d && !O && (c = K(e, t))), c
  7820. }, U.versionInfo = function () {
  7821. return "2.8.0"
  7822. }, U.loaderCache = function () {
  7823. return b
  7824. }, U.directivePriority = function () {
  7825. return E
  7826. }, U.statefulFilter = function () {
  7827. return A
  7828. }, U.isReady = function () {
  7829. return !1
  7830. };
  7831. var oe = r.defer();
  7832. U.onReady = function (e) {
  7833. var t = r.defer();
  7834. return angular.isFunction(e) && t.promise.then(e), oe.promise.then(function () {
  7835. t.resolve()
  7836. }), t.promise
  7837. };
  7838. var ie = n.$on("$translateReady", function () {
  7839. oe.resolve(), ie(), ie = null
  7840. }), ae = n.$on("$translateChangeEnd", function () {
  7841. oe.resolve(), ae(), ae = null
  7842. });
  7843. if (h) {
  7844. if (angular.equals(y, {}) && U.use() && U.use(U.use()), a && a.length) for (var se = 0, le = a.length; le > se; se++) {
  7845. var ce = a[se];
  7846. (S || !y[ce]) && (q[ce] = z(ce).then(function (e) {
  7847. return L(e.key, e.table), n.$emit("$translateChangeEnd", {language: e.key}), e
  7848. }))
  7849. }
  7850. } else n.$emit("$translateReady", {language: U.use()});
  7851. return U
  7852. }]
  7853. }
  7854. function n(e, t) {
  7855. "use strict";
  7856. var n, r = {};
  7857. return r.setLocale = function (e) {
  7858. n = e
  7859. }, r.getInterpolationIdentifier = function () {
  7860. return "default"
  7861. }, r.useSanitizeValueStrategy = function (e) {
  7862. return t.useStrategy(e), this
  7863. }, r.interpolate = function (n, r) {
  7864. r = r || {}, r = t.sanitize(r, "params");
  7865. var o = e(n)(r);
  7866. return o = t.sanitize(o, "text")
  7867. }, r
  7868. }
  7869. function r(e, t, n, r, i, a) {
  7870. "use strict";
  7871. var s = function () {
  7872. return this.toString().replace(/^\s+|\s+$/g, "")
  7873. };
  7874. return {
  7875. restrict: "AE", scope: !0, priority: e.directivePriority(), compile: function (t, l) {
  7876. var c = l.translateValues ? l.translateValues : void 0,
  7877. u = l.translateInterpolation ? l.translateInterpolation : void 0,
  7878. f = t[0].outerHTML.match(/translate-value-+/i),
  7879. d = "^(.*)(" + n.startSymbol() + ".*" + n.endSymbol() + ")(.*)",
  7880. p = "^(.*)" + n.startSymbol() + "(.*)" + n.endSymbol() + "(.*)";
  7881. return function (t, h, g) {
  7882. t.interpolateParams = {}, t.preText = "", t.postText = "", t.translateNamespace = o(t);
  7883. var m = {}, v = function (e) {
  7884. if (angular.isFunction(v._unwatchOld) && (v._unwatchOld(), v._unwatchOld = void 0), angular.equals(e, "") || !angular.isDefined(e)) {
  7885. var r = s.apply(h.text()), o = r.match(d);
  7886. if (angular.isArray(o)) {
  7887. t.preText = o[1], t.postText = o[3], m.translate = n(o[2])(t.$parent);
  7888. var i = r.match(p);
  7889. angular.isArray(i) && i[2] && i[2].length && (v._unwatchOld = t.$watch(i[2], function (e) {
  7890. m.translate = e, w()
  7891. }))
  7892. } else m.translate = r
  7893. } else m.translate = e;
  7894. w()
  7895. };
  7896. !function (e, n, r) {
  7897. if (n.translateValues && angular.extend(e, i(n.translateValues)(t.$parent)), f) for (var o in r) Object.prototype.hasOwnProperty.call(n, o) && "translateValue" === o.substr(0, 14) && "translateValues" !== o && (e[angular.lowercase(o.substr(14, 1)) + o.substr(15)] = r[o])
  7898. }(t.interpolateParams, g, l);
  7899. var b = !0;
  7900. g.$observe("translate", function (e) {
  7901. void 0 === e ? v("") : "" === e && b || (m.translate = e, w()), b = !1
  7902. });
  7903. for (var y in g) g.hasOwnProperty(y) && "translateAttr" === y.substr(0, 13) && function (e) {
  7904. g.$observe(e, function (t) {
  7905. m[e] = t, w()
  7906. })
  7907. }(y);
  7908. if (g.$observe("translateDefault", function (e) {
  7909. t.defaultText = e
  7910. }), c && g.$observe("translateValues", function (e) {
  7911. e && t.$parent.$watch(function () {
  7912. angular.extend(t.interpolateParams, i(e)(t.$parent))
  7913. })
  7914. }), f) {
  7915. for (var x in g) Object.prototype.hasOwnProperty.call(g, x) && "translateValue" === x.substr(0, 14) && "translateValues" !== x && function (e) {
  7916. g.$observe(e, function (n) {
  7917. var r = angular.lowercase(e.substr(14, 1)) + e.substr(15);
  7918. t.interpolateParams[r] = n
  7919. })
  7920. }(x)
  7921. }
  7922. var w = function () {
  7923. for (var e in m) m.hasOwnProperty(e) && void 0 !== m[e] && $(e, m[e], t, t.interpolateParams, t.defaultText, t.translateNamespace)
  7924. }, $ = function (t, n, r, o, i, a) {
  7925. n ? (a && "." === n.charAt(0) && (n = a + n), e(n, o, u, i).then(function (e) {
  7926. k(e, r, !0, t)
  7927. }, function (e) {
  7928. k(e, r, !1, t)
  7929. })) : k(n, r, !1, t)
  7930. }, k = function (t, n, o, i) {
  7931. if ("translate" === i) {
  7932. o || void 0 === n.defaultText || (t = n.defaultText), h.empty().append(n.preText + t + n.postText);
  7933. var a = e.isPostCompilingEnabled(), s = void 0 !== l.translateCompile,
  7934. c = s && "false" !== l.translateCompile;
  7935. (a && !s || c) && r(h.contents())(n)
  7936. } else {
  7937. o || void 0 === n.defaultText || (t = n.defaultText);
  7938. var u = g.$attr[i];
  7939. "data-" === u.substr(0, 5) && (u = u.substr(5)), u = u.substr(15), h.attr(u, t)
  7940. }
  7941. };
  7942. (c || f || g.translateDefault) && t.$watch("interpolateParams", w, !0);
  7943. var T = a.$on("$translateChangeSuccess", w);
  7944. h.text().length ? v(g.translate ? g.translate : "") : g.translate && v(g.translate), w(), t.$on("$destroy", T)
  7945. }
  7946. }
  7947. }
  7948. }
  7949. function o(e) {
  7950. "use strict";
  7951. return e.translateNamespace ? e.translateNamespace : e.$parent ? o(e.$parent) : void 0
  7952. }
  7953. function i(e) {
  7954. "use strict";
  7955. return {
  7956. compile: function (t) {
  7957. var n = function () {
  7958. t.addClass(e.cloakClassName())
  7959. }, r = function () {
  7960. t.removeClass(e.cloakClassName())
  7961. };
  7962. return e.onReady(function () {
  7963. r()
  7964. }), n(), function (t, o, i) {
  7965. i.translateCloak && i.translateCloak.length && i.$observe("translateCloak", function (t) {
  7966. e(t).then(r, n)
  7967. })
  7968. }
  7969. }
  7970. }
  7971. }
  7972. function a() {
  7973. "use strict";
  7974. return {
  7975. restrict: "A", scope: !0, compile: function () {
  7976. return {
  7977. pre: function (e, t, n) {
  7978. e.translateNamespace = o(e), e.translateNamespace && "." === n.translateNamespace.charAt(0) ? e.translateNamespace += n.translateNamespace : e.translateNamespace = n.translateNamespace
  7979. }
  7980. }
  7981. }
  7982. }
  7983. }
  7984. function o(e) {
  7985. "use strict";
  7986. return e.translateNamespace ? e.translateNamespace : e.$parent ? o(e.$parent) : void 0
  7987. }
  7988. function s(e, t) {
  7989. "use strict";
  7990. var n = function (n, r, o) {
  7991. return angular.isObject(r) || (r = e(r)(this)), t.instant(n, r, o)
  7992. };
  7993. return t.statefulFilter() && (n.$stateful = !0), n
  7994. }
  7995. function l(e) {
  7996. "use strict";
  7997. return e("translations")
  7998. }
  7999. return angular.module("pascalprecht.translate", ["ng"]).run(e), e.$inject = ["$translate"], e.displayName = "runTranslate", angular.module("pascalprecht.translate").provider("$translateSanitization", function () {
  8000. "use strict";
  8001. var e, t, n = null, r = !1, o = !1;
  8002. (t = {
  8003. sanitize: function (e, t) {
  8004. return "text" === t && (e = a(e)), e
  8005. }, escape: function (e, t) {
  8006. return "text" === t && (e = i(e)), e
  8007. }, sanitizeParameters: function (e, t) {
  8008. return "params" === t && (e = s(e, a)), e
  8009. }, escapeParameters: function (e, t) {
  8010. return "params" === t && (e = s(e, i)), e
  8011. }
  8012. }).escaped = t.escapeParameters, this.addStrategy = function (e, n) {
  8013. return t[e] = n, this
  8014. }, this.removeStrategy = function (e) {
  8015. return delete t[e], this
  8016. }, this.useStrategy = function (e) {
  8017. return r = !0, n = e, this
  8018. }, this.$get = ["$injector", "$log", function (i, a) {
  8019. var s = {}, l = function (e, n, r) {
  8020. return angular.forEach(r, function (r) {
  8021. if (angular.isFunction(r)) e = r(e, n); else if (angular.isFunction(t[r])) e = t[r](e, n); else {
  8022. if (!angular.isString(t[r])) throw new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '" + r + "'");
  8023. if (!s[t[r]]) try {
  8024. s[t[r]] = i.get(t[r])
  8025. } catch (e) {
  8026. throw s[t[r]] = function () {
  8027. }, new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '" + r + "'")
  8028. }
  8029. e = s[t[r]](e, n)
  8030. }
  8031. }), e
  8032. }, c = function () {
  8033. r || o || (a.warn("pascalprecht.translate.$translateSanitization: No sanitization strategy has been configured. This can have serious security implications. See http://angular-translate.github.io/docs/#/guide/19_security for details."), o = !0)
  8034. };
  8035. return i.has("$sanitize") && (e = i.get("$sanitize")), {
  8036. useStrategy: function (e) {
  8037. return function (t) {
  8038. e.useStrategy(t)
  8039. }
  8040. }(this), sanitize: function (e, t, r) {
  8041. if (n || c(), arguments.length < 3 && (r = n), !r) return e;
  8042. var o = angular.isArray(r) ? r : [r];
  8043. return l(e, t, o)
  8044. }
  8045. }
  8046. }];
  8047. var i = function (e) {
  8048. var t = angular.element("<div></div>");
  8049. return t.text(e), t.html()
  8050. }, a = function (t) {
  8051. if (!e) throw new Error("pascalprecht.translate.$translateSanitization: Error cannot find $sanitize service. Either include the ngSanitize module (https://docs.angularjs.org/api/ngSanitize) or use a sanitization strategy which does not depend on $sanitize, such as 'escape'.");
  8052. return e(t)
  8053. }, s = function (e, t) {
  8054. if (angular.isObject(e)) {
  8055. var n = angular.isArray(e) ? [] : {};
  8056. return angular.forEach(e, function (e, r) {
  8057. n[r] = s(e, t)
  8058. }), n
  8059. }
  8060. return angular.isNumber(e) ? e : t(e)
  8061. }
  8062. }), angular.module("pascalprecht.translate").constant("pascalprechtTranslateOverrider", {}).provider("$translate", t), t.$inject = ["$STORAGE_KEY", "$windowProvider", "$translateSanitizationProvider", "pascalprechtTranslateOverrider"], t.displayName = "displayName", angular.module("pascalprecht.translate").factory("$translateDefaultInterpolation", n), n.$inject = ["$interpolate", "$translateSanitization"], n.displayName = "$translateDefaultInterpolation", angular.module("pascalprecht.translate").constant("$STORAGE_KEY", "NG_TRANSLATE_LANG_KEY"), angular.module("pascalprecht.translate").directive("translate", r), r.$inject = ["$translate", "$q", "$interpolate", "$compile", "$parse", "$rootScope"], r.displayName = "translateDirective", angular.module("pascalprecht.translate").directive("translateCloak", i), i.$inject = ["$translate"], i.displayName = "translateCloakDirective", angular.module("pascalprecht.translate").directive("translateNamespace", a), a.displayName = "translateNamespaceDirective", angular.module("pascalprecht.translate").filter("translate", s), s.$inject = ["$parse", "$translate"], s.displayName = "translateFilterFactory", angular.module("pascalprecht.translate").factory("$translationCache", l), l.$inject = ["$cacheFactory"], l.displayName = "$translationCache", "pascalprecht.translate"
  8063. }), function (e, t) {
  8064. "function" == typeof define && define.amd ? define([], function () {
  8065. return t()
  8066. }) : "object" == typeof exports ? module.exports = t() : t()
  8067. }(0, function () {
  8068. function e(e, t) {
  8069. "use strict";
  8070. return function (n) {
  8071. if (!n || !(angular.isArray(n.files) || angular.isString(n.prefix) && angular.isString(n.suffix))) throw new Error("Couldn't load static files, no files and prefix or suffix specified!");
  8072. n.files || (n.files = [{prefix: n.prefix, suffix: n.suffix}]);
  8073. for (var r = [], o = n.files.length, i = 0; o > i; i++) r.push(function (r) {
  8074. if (!r || !angular.isString(r.prefix) || !angular.isString(r.suffix)) throw new Error("Couldn't load static file, no prefix or suffix specified!");
  8075. return t(angular.extend({
  8076. url: [r.prefix, n.key, r.suffix].join(""),
  8077. method: "GET",
  8078. params: ""
  8079. }, n.$http)).then(function (e) {
  8080. return e.data
  8081. }, function () {
  8082. return e.reject(n.key)
  8083. })
  8084. }({prefix: n.files[i].prefix, key: n.key, suffix: n.files[i].suffix}));
  8085. return e.all(r).then(function (e) {
  8086. for (var t = e.length, n = {}, r = 0; t > r; r++) for (var o in e[r]) n[o] = e[r][o];
  8087. return n
  8088. })
  8089. }
  8090. }
  8091. return e.$inject = ["$q", "$http"], angular.module("pascalprecht.translate").factory("$translateStaticFilesLoader", e), e.displayName = "$translateStaticFilesLoader", "pascalprecht.translate"
  8092. }), function (e, t, n) {
  8093. "use strict";
  8094. t.module("ngCookies", ["ng"]).factory("$cookies", ["$rootScope", "$browser", function (e, n) {
  8095. var r, o = {}, i = {}, a = !1, s = t.copy, l = t.isUndefined;
  8096. return n.addPollFn(function () {
  8097. var t = n.cookies();
  8098. r != t && (r = t, s(t, i), s(t, o), a && e.$apply())
  8099. })(), a = !0, e.$watch(function () {
  8100. var e, r, a;
  8101. for (e in i) l(o[e]) && n.cookies(e, void 0);
  8102. for (e in o) r = o[e], t.isString(r) || (r = "" + r, o[e] = r), r !== i[e] && (n.cookies(e, r), a = !0);
  8103. if (a) for (e in r = n.cookies(), o) o[e] !== r[e] && (l(r[e]) ? delete o[e] : o[e] = r[e])
  8104. }), o
  8105. }]).factory("$cookieStore", ["$cookies", function (e) {
  8106. return {
  8107. get: function (n) {
  8108. return (n = e[n]) ? t.fromJson(n) : n
  8109. }, put: function (n, r) {
  8110. e[n] = t.toJson(r)
  8111. }, remove: function (t) {
  8112. delete e[t]
  8113. }
  8114. }
  8115. }])
  8116. }(window, window.angular);
  8117. var Langs = {};
  8118. Langs.en = {
  8119. time: "时间",
  8120. open: "开盘",
  8121. high: "最高",
  8122. low: "最低",
  8123. close: "收盘",
  8124. increase: "涨幅",
  8125. swing: "振幅",
  8126. volume: "VOL",
  8127. quoteVolume: "转让额",
  8128. hand: "换手率",
  8129. o: "开",
  8130. h: "高",
  8131. l: "低",
  8132. c: "收",
  8133. price: "价格",
  8134. updown: "涨跌",
  8135. rang: "幅度"
  8136. }, Langs.cn = {
  8137. time: "时间",
  8138. open: "开盘",
  8139. high: "最高",
  8140. low: "最低",
  8141. close: "收盘",
  8142. increase: "涨幅",
  8143. swing: "振幅",
  8144. volume: "成交量",
  8145. quoteVolume: "成交额",
  8146. hand: "换手率",
  8147. o: "开",
  8148. h: "高",
  8149. l: "低",
  8150. c: "收",
  8151. price: "价格",
  8152. updown: "涨跌",
  8153. rang: "幅度"
  8154. }, function (e) {
  8155. "use strict";
  8156. var t = function (e, t) {
  8157. this.init("tooltip", e, t)
  8158. };
  8159. t.prototype = {
  8160. constructor: t, init: function (t, n, r) {
  8161. var o, i;
  8162. this.type = t, this.$element = e(n), this.options = this.getOptions(r), this.enabled = !0, "manual" != this.options.trigger && (o = "hover" == this.options.trigger ? "mouseenter" : "focus", i = "hover" == this.options.trigger ? "mouseleave" : "blur", this.$element.on(o, this.options.selector, e.proxy(this.enter, this)), this.$element.on(i, this.options.selector, e.proxy(this.leave, this))), this.options.selector ? this._options = e.extend({}, this.options, {
  8163. trigger: "manual",
  8164. selector: ""
  8165. }) : this.fixTitle()
  8166. }, getOptions: function (t) {
  8167. return (t = e.extend({}, e.fn[this.type].defaults, t, this.$element.data())).delay && "number" == typeof t.delay && (t.delay = {
  8168. show: t.delay,
  8169. hide: t.delay
  8170. }), t
  8171. }, enter: function (t) {
  8172. var n = e(t.currentTarget)[this.type](this._options).data(this.type);
  8173. n.options.delay && n.options.delay.show ? (n.hoverState = "in", setTimeout(function () {
  8174. "in" == n.hoverState && n.show()
  8175. }, n.options.delay.show)) : n.show()
  8176. }, leave: function (t) {
  8177. var n = e(t.currentTarget)[this.type](this._options).data(this.type);
  8178. n.options.delay && n.options.delay.hide ? (n.hoverState = "out", setTimeout(function () {
  8179. "out" == n.hoverState && n.hide()
  8180. }, n.options.delay.hide)) : n.hide()
  8181. }, show: function () {
  8182. var e, t, n, r, o, i, a;
  8183. if (this.hasContent() && this.enabled) {
  8184. switch (e = this.tip(), this.setContent(), this.options.animation && e.addClass("fade"), i = "function" == typeof this.options.placement ? this.options.placement.call(this, e[0], this.$element[0]) : this.options.placement, t = /in/.test(i), e.remove().css({
  8185. top: 0,
  8186. left: 0,
  8187. display: "block"
  8188. }).appendTo(t ? this.$element : document.body), n = this.getPosition(t), r = e[0].offsetWidth, o = e[0].offsetHeight, t ? i.split(" ")[1] : i) {
  8189. case"bottom":
  8190. a = {top: n.top + n.height, left: n.left + n.width / 2 - r / 2};
  8191. break;
  8192. case"top":
  8193. a = {top: n.top - o, left: n.left + n.width / 2 - r / 2};
  8194. break;
  8195. case"left":
  8196. a = {top: n.top + n.height / 2 - o / 2, left: n.left - r};
  8197. break;
  8198. case"right":
  8199. a = {top: n.top + n.height / 2 - o / 2, left: n.left + n.width}
  8200. }
  8201. e.css(a).addClass(i).addClass("in")
  8202. }
  8203. }, setContent: function () {
  8204. var e = this.tip();
  8205. e.find(".tooltip-inner").html(this.getTitle()), e.removeClass("fade in top bottom left right")
  8206. }, hide: function () {
  8207. var t = this.tip();
  8208. t.removeClass("in"), e.support.transition && this.$tip.hasClass("fade") ? function () {
  8209. var n = setTimeout(function () {
  8210. t.off(e.support.transition.end).remove()
  8211. }, 500);
  8212. t.one(e.support.transition.end, function () {
  8213. clearTimeout(n), t.remove()
  8214. })
  8215. }() : t.remove()
  8216. }, fixTitle: function () {
  8217. var e = this.$element;
  8218. (e.attr("title") || "string" != typeof e.attr("data-original-title")) && e.attr("data-original-title", e.attr("title") || "").removeAttr("title")
  8219. }, hasContent: function () {
  8220. return this.getTitle()
  8221. }, getPosition: function (t) {
  8222. return e.extend({}, t ? {top: 0, left: 0} : this.$element.offset(), {
  8223. width: this.$element[0].offsetWidth,
  8224. height: this.$element[0].offsetHeight
  8225. })
  8226. }, getTitle: function () {
  8227. var e, t = this.$element, n = this.options;
  8228. return e = t.attr("data-original-title") || ("function" == typeof n.title ? n.title.call(t[0]) : n.title), e = e.toString().replace(/(^\s*|\s*$)/, "")
  8229. }, tip: function () {
  8230. return this.$tip = this.$tip || e(this.options.template)
  8231. }, validate: function () {
  8232. this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
  8233. }, enable: function () {
  8234. this.enabled = !0
  8235. }, disable: function () {
  8236. this.enabled = !1
  8237. }, toggleEnabled: function () {
  8238. this.enabled = !this.enabled
  8239. }, toggle: function () {
  8240. this[this.tip().hasClass("in") ? "hide" : "show"]()
  8241. }
  8242. }, e.fn.tooltip = function (n) {
  8243. return this.each(function () {
  8244. var r = e(this), o = r.data("tooltip"), i = "object" == typeof n && n;
  8245. o || r.data("tooltip", o = new t(this, i)), "string" == typeof n && o[n]()
  8246. })
  8247. }, e.fn.tooltip.Constructor = t, e.fn.tooltip.defaults = {
  8248. animation: !0,
  8249. delay: 0,
  8250. selector: !1,
  8251. placement: "top",
  8252. trigger: "hover",
  8253. title: "",
  8254. template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
  8255. }
  8256. }(window.jQuery);
  8257. var BASE_URL = "http://localhost/rtbtc-dev/", DATA_URL = "http://localhost/rtbtc-dev/", DEBUG = !0, OFFLINE = !1,
  8258. RTBTC_Class = function (e, t, n) {
  8259. function r() {
  8260. function r(e, t) {
  8261. if (i.handlers.hasOwnProperty(e)) for (var n = 0; n < i.handlers[e].length; n++) i.handlers[e][n][1](t)
  8262. }
  8263. function o(e, t, n) {
  8264. DEBUG && a("JSON Call for " + e), $.ajax({
  8265. url: e, type: "GET", dataType: "json", success: function (e, n, r) {
  8266. "function" == typeof t && t(e)
  8267. }, error: function (e, t, r) {
  8268. "function" == typeof n && n()
  8269. }
  8270. })
  8271. }
  8272. var i = {
  8273. url: "" + e,
  8274. debug: !!t,
  8275. offline: !!n,
  8276. lang: "en",
  8277. accounts: {},
  8278. has_api: !1,
  8279. prefsAccount: "",
  8280. expires: millitime() + 60,
  8281. expires_id: -1,
  8282. base: "",
  8283. base_int: 1,
  8284. base_prec: 8,
  8285. quote: "CNY",
  8286. quote_int: 1,
  8287. quote_prec: 4,
  8288. exch_fee: {mtgox: .0065, bitstamp: .005, btce: .002},
  8289. token: "",
  8290. version: "0.0.0",
  8291. startTime: millitime(),
  8292. offset: 0,
  8293. exchange: "bitstamp",
  8294. exch_list: ["bitstamp", "btce"],
  8295. handlers: {},
  8296. title: "" + window.document.title,
  8297. ERROR: 1,
  8298. WARNING: 2,
  8299. MESSAGE: 3,
  8300. windows: []
  8301. }, a = function (e, t) {
  8302. switch (t) {
  8303. case i.ERROR:
  8304. console.error(e);
  8305. break;
  8306. case i.WARNING:
  8307. console.warn(e);
  8308. break;
  8309. case i.MESSAGE:
  8310. default:
  8311. console.log(e)
  8312. }
  8313. if (!DEBUG) throw{}
  8314. };
  8315. $.ajaxSetup({async: !0, type: "POST", dataType: "json", crossDomain: !1});
  8316. for (var s = function (e, t, n, o, s) {
  8317. DEBUG && a("AJAX Call for " + e + ", data:"), DEBUG && null != t && a(t), $.ajax({
  8318. url: i.url + "api/" + e,
  8319. data: {payload: t, token: i.token, aid: i.accounts[i.exchange], t0: millitime()},
  8320. success: function (t, c, u) {
  8321. var f = millitime();
  8322. if (void 0 !== t.result) {
  8323. if (void 0 !== t.timing && l({
  8324. t0: parseFloat(t.timing.t0),
  8325. t1: parseFloat(t.timing.t1),
  8326. t2: parseFloat(t.timing.t2),
  8327. t3: f
  8328. }), void 0 !== t.token && (i.token = $.trim(t.token)), void 0 !== t.version) {
  8329. var d = $.trim(t.version);
  8330. d != i.version && window.setTimeout(function () {
  8331. r("version", d)
  8332. }, 5e3)
  8333. }
  8334. if ("success" == t.result) DEBUG && a("Success data [" + e + "]:"), DEBUG && a(t.data), "function" == typeof n && n(t.data); else if (void 0 !== t.reason) switch (t.reason) {
  8335. case"session":
  8336. case"auth":
  8337. DEBUG && a("Save failure: " + t.reason), !OFFLINE && window.location.reload();
  8338. break;
  8339. default:
  8340. "function" == typeof o && (DEBUG && a("Calling failure fn with:"), DEBUG && a(t.reason), o(t.reason))
  8341. } else "function" == typeof o && o()
  8342. } else "function" == typeof s && s()
  8343. },
  8344. error: function (e, t, n) {
  8345. "function" == typeof s && s()
  8346. }
  8347. })
  8348. }, l = function (e) {
  8349. void 0 !== e.t0 && void 0 !== e.t1 && void 0 !== e.t2 && void 0 !== e.t3 && r("timing", {
  8350. latency: (-e.t0 + e.t1 - e.t2 + e.t3) / 2,
  8351. processing: e.t2 - e.t1
  8352. })
  8353. }, c = function () {
  8354. i.windows.append(window.open(i.url + "s/platform/window", uniqueID()))
  8355. }, u = function () {
  8356. var e = i.expires - millitime();
  8357. 1e3 * e > 2147483647 || (DEBUG && a("Expire in " + (i.expires - millitime()) + "s"), window.clearTimeout(i.expires_id), i.expires_id = window.setTimeout(function () {
  8358. DEBUG && a("Subscription expired. Reloading."), window.location.reload()
  8359. }, 1e3 * e))
  8360. }, f = [""], d = [""], p = 1; p <= 30; p++) d.push(d[p - 1] + "&nbsp;"), f.push(f[p - 1] + "0");
  8361. return {
  8362. token: function (e) {
  8363. return null == e ? i.token : (i.token = e, DEBUG && a('Set RTBTC token to "' + e + '"'), this)
  8364. }, account: function () {
  8365. return i.accounts[i.exchange]
  8366. }, accounts: function (e) {
  8367. i.accounts = {};
  8368. for (var t in e) i.exch_list.indexOf(t) < 0 || (i.accounts[t] = e[t], DEBUG && a("Set user account string for " + t + ' to "' + e[t] + '"'));
  8369. return this
  8370. }, prefsAccount: function (e) {
  8371. return null == e ? i.prefsAccount : (i.prefsAccount = e, DEBUG && a('Set user preferences account string to "' + e + '"'), this)
  8372. }, hasApi: function () {
  8373. return i.accounts.hasOwnProperty(i.exchange)
  8374. }, startTime: function () {
  8375. return i.startTime
  8376. }, offset: function (e) {
  8377. return null == e ? i.offset : (i.offset = e.client - e.server, DEBUG && a("Got server time offset of " + i.offset + "s"), this)
  8378. }, expires: function (e) {
  8379. return null == e ? i.expires : (i.expires = +e + i.offset, u(), DEBUG && a("Set expiration time to " + new Date(1e3 * i.expires)), this)
  8380. }, ajax: function (e, t, n, r, o) {
  8381. return void 0 !== e && s(e, t, n, r, o), this
  8382. }, json: function (e, t, n) {
  8383. return void 0 !== e && o(e, t, n), this
  8384. }, base: function () {
  8385. return i.base
  8386. }, quote: function () {
  8387. return i.quote
  8388. }, symbol: function () {
  8389. return i.base + "/" + i.quote
  8390. }, baseInt: function () {
  8391. return i.base_int
  8392. }, quoteInt: function () {
  8393. return i.quote_int
  8394. }, basePrec: function () {
  8395. return i.base_prec
  8396. }, quotePrec: function () {
  8397. return i.quote_prec
  8398. }, instrument: function (e, t, n) {
  8399. try {
  8400. e = e.toLowerCase(), t = t.toUpperCase(), n = n.toUpperCase()
  8401. } catch (r) {
  8402. return DEBUG && a("RTBTC.instrument 1: " + e + ", " + t + ", " + n, i.ERROR), this
  8403. }
  8404. var o = {exch: "" + i.exchange, base: "" + i.base, quote: "" + i.quote};
  8405. return i.exchange = e, i.base = t, i.quote = n, DEBUG && a("RTBTC:instrument(" + i.exchange + ", " + i.base + ", " + i.quote + ")"), DEBUG && a(" " + i.base + " precision : " + i.base_prec + ", int: " + i.base_int), DEBUG && a(" " + i.quote + " precision: " + i.quote_prec + ", int: " + i.quote_int), r("instrument", {
  8406. old_instr: o,
  8407. new_instr: {exch: i.exchange, base: i.base, quote: i.quote}
  8408. }), this
  8409. }, version: function (e) {
  8410. if (null == e) return i.version;
  8411. i.version = e;
  8412. for (var t = "", n = 0; n < 75; n++) t += "=";
  8413. return DEBUG && a(t), DEBUG && a("RTBTC Version " + i.version), DEBUG && a(t), DEBUG && a(" "), this
  8414. }, url: function () {
  8415. return i.url
  8416. }, language: function (e) {
  8417. return null == e ? i.lang : (i.lang = e, r("language", i.lang), this)
  8418. }, handler: function (e, t, n) {
  8419. return i.handlers.hasOwnProperty(e) || (i.handlers[e] = []), i.handlers[e].push([t, n]), this
  8420. }, unregister: function (e, t, n) {
  8421. if (i.handlers.hasOwnProperty(e)) {
  8422. var r, o = void 0 === n;
  8423. for (r = i.handlers[e].length - 1; r >= 0; r--) i.handlers[e][r][0] == t && (o || i.handlers[e][r][1] == n) && i.handlers[e].splice(r, 1);
  8424. return this
  8425. }
  8426. }, unregisterAll: function (e) {
  8427. var t, n;
  8428. for (n in i.handlers) if (i.handlers.hasOwnProperty(n)) for (t = i.handlers[n].length - 1; t >= 0; t--) i.handlers[n][t][0] == e && i.handlers[n].splice(t, 1)
  8429. }, trigger: function (e, t) {
  8430. r(e, t)
  8431. }, countdown: function (e, t) {
  8432. $(e).each(function (e, t) {
  8433. $(t).data("time", parseInt($(this).attr("name"))).removeAttr("name")
  8434. });
  8435. var n = function (e, t) {
  8436. $(e).each(function (e, n) {
  8437. var r = Math.max($(n).data("time"), 0), o = t ? dhms_from_sec(r) : hms_from_sec(r);
  8438. return $(n).text(o), $(n).data("time", r - 1), !0
  8439. })
  8440. };
  8441. window.setInterval(function () {
  8442. n(e, t)
  8443. }, 1e3), n(e, t)
  8444. }, toggle: function (e, t, n, r) {
  8445. return $("<span/>").addClass("control-toggle").addClass(function () {
  8446. return e ? "yes" : "no"
  8447. }).append(function () {
  8448. return '<i class="icon-' + (e ? "ok" : "remove") + '"></i>'
  8449. }).data("state", e).click(function (e) {
  8450. var o = $(e.currentTarget);
  8451. o.data("state") ? (o.data("state", !1).removeClass("yes").addClass("no").html('<i class="icon-remove"></i>'), "function" == typeof n && n()) : (o.data("state", !0).removeClass("no").addClass("yes").html('<i class="icon-ok"></i>'), "function" == typeof t && t()), "function" == typeof r && r(), stopEvent(e)
  8452. })
  8453. }, select: function (e, t, n, r) {
  8454. var o, i, a = $("<select/>").on("change", function (t) {
  8455. n(t.currentTarget.value), r && (t.currentTarget.value = e)
  8456. });
  8457. for (o = 0; o < t.length; o++) i = $("<option/>").html(t[o].text).attr("value", t[o].val), t[o].val == e && i.attr("selected", "selected"), a.append(i);
  8458. return a
  8459. }, numFormat: function (e, t) {
  8460. if (void 0 === e) return "";
  8461. var n = null == t ? Settings.display.precision.price : t, r = e.toFixed(n), o = r.length, i = 1;
  8462. for (isNaN(r) && (r = "0.0"); i < t;) {
  8463. if ("0" != r.charAt(o - i)) {
  8464. if (1 == i) return r;
  8465. break
  8466. }
  8467. i++
  8468. }
  8469. return Settings.display.zeros ? r.slice(0, o - i + 1) + '<span class="insig">' + f[i - 1] + "</span>" : r.slice(0, o - i + 1) + d[i - 1]
  8470. }, numFormatShort: function (e, t) {
  8471. if (void 0 === e) return "";
  8472. var n = null == t ? Settings.display.precision.price : t, r = e.toFixed(n), o = r.length, i = 1;
  8473. for (isNaN(r) && (r = "0.0"); i < t;) {
  8474. if ("0" != r.charAt(o - i)) {
  8475. if (1 == i) return r;
  8476. break
  8477. }
  8478. i++
  8479. }
  8480. return r.slice(0, o - i + 1)
  8481. }, siteTitle: function (e) {
  8482. window.document.title = e + i.title
  8483. }, newWindow: function () {
  8484. return c(), this
  8485. }, regUnsignedNum: new RegExp(/^\d*\.?\d*$/), internals: DEBUG ? function () {
  8486. return i
  8487. } : function () {
  8488. return null
  8489. }, debug: i.debug ? a : function (e, t) {
  8490. }, isDebug: function () {
  8491. return i.debug
  8492. }, offline: function () {
  8493. return i.offline
  8494. }, ERROR: i.ERROR, WARNING: i.WARNING, MESSAGE: i.MESSAGE, ZEROS: f, SPACES: d
  8495. }
  8496. }
  8497. var o = null;
  8498. return new function () {
  8499. this.Build = function () {
  8500. return null == o && ((o = new r).constructor = null), o
  8501. }
  8502. }
  8503. }(BASE_URL, DEBUG, OFFLINE), RTBTC = RTBTC_Class.Build(), BTC = "&#3647;", BTC_U = "฿", BTC_INT = 1;
  8504. AssertException.prototype.toString = function () {
  8505. return "AssertException: " + this.message
  8506. };
  8507. var lastUniqueID = 0, alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(""),
  8508. alphalen = alphabet.length;
  8509. Object.size = function (e) {
  8510. var t, n = 0;
  8511. for (t in e) e.hasOwnProperty(t) && n++;
  8512. return n
  8513. }, Array.prototype.indexOf || (Array.prototype.indexOf = function (e) {
  8514. var t = this.length, n = Number(arguments[1]) || 0;
  8515. for ((n = n < 0 ? Math.ceil(n) : Math.floor(n)) < 0 && (n += t); n < t; n++) if (n in this && this[n] === e) return n;
  8516. return -1
  8517. });
  8518. var has_dataURI = function () {
  8519. return !1
  8520. };
  8521. !function () {
  8522. var e = new Image;
  8523. e.onload = function () {
  8524. 1 == this.width && 1 == this.height && (has_dataURI = function () {
  8525. return !0
  8526. })
  8527. }, e.onerror = function () {
  8528. }, e.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="
  8529. }(), function () {
  8530. var e = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
  8531. window.reqAnimFrame = void 0 !== e ? e : function (e) {
  8532. e()
  8533. }
  8534. }(), jQuery.cookie = function (e, t, n) {
  8535. if (arguments.length > 1 && "[object Object]" !== String(t)) {
  8536. if (n = jQuery.extend({}, n), null !== t && void 0 !== t || (n.expires = -1), "number" == typeof n.expires) {
  8537. var r = n.expires, o = n.expires = new Date;
  8538. o.setDate(o.getDate() + r)
  8539. }
  8540. return t = String(t), document.cookie = [encodeURIComponent(e), "=", n.raw ? t : encodeURIComponent(t), n.expires ? "; expires=" + n.expires.toUTCString() : "", n.path ? "; path=" + n.path : "", n.domain ? "; domain=" + n.domain : "", n.secure ? "; secure" : ""].join("")
  8541. }
  8542. var i, a = (n = t || {}).raw ? function (e) {
  8543. return e
  8544. } : decodeURIComponent;
  8545. return (i = new RegExp("(?:^|; )" + encodeURIComponent(e) + "=([^;]*)").exec(document.cookie)) ? a(i[1]) : null
  8546. };
  8547. var mobile, Colors = {
  8548. c: {
  8549. stroke: {
  8550. fenshi: "#ffffff",
  8551. up: "#ff0000",
  8552. down: "#3AA60C",
  8553. bid: "#4dd710",
  8554. ask: "#d00017",
  8555. grid: "#252522",
  8556. border: "#333",
  8557. arrow: "#fff",
  8558. order: "#ffc200",
  8559. majorlevel: "#666",
  8560. minorlevel: "#666",
  8561. crosshair: "#fff",
  8562. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8563. },
  8564. fill: {
  8565. bg: "#191919",
  8566. up: "#ff0000",
  8567. down: "#3AA60C",
  8568. label: "#9EA694",
  8569. flags: "#191919",
  8570. crosshair: "#191919",
  8571. blankBG: "#0A0A09",
  8572. flagtext: "#f4ffe4",
  8573. ordertext: "#ffc200",
  8574. slottext: "#f4ffe4"
  8575. }
  8576. },
  8577. c1: {
  8578. stroke: {
  8579. fenshi: "#ffffff",
  8580. up: "#d00017",
  8581. down: "#4dd710",
  8582. bid: "#d00017",
  8583. ask: "#4dd710",
  8584. grid: "#252522",
  8585. border: "#333",
  8586. arrow: "#fff",
  8587. order: "#ffc200",
  8588. majorlevel: "#666",
  8589. minorlevel: "#666",
  8590. crosshair: "#fff",
  8591. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8592. },
  8593. fill: {
  8594. bg: "#191919",
  8595. up: "#3AA60C",
  8596. down: "#A10013",
  8597. label: "#9EA694",
  8598. flags: "#191919",
  8599. crosshair: "#191919",
  8600. blankBG: "#0A0A09",
  8601. flagtext: "#f4ffe4",
  8602. ordertext: "#ffc200",
  8603. slottext: "#f4ffe4"
  8604. }
  8605. },
  8606. f: {
  8607. stroke: {
  8608. up: "#00a1d9",
  8609. down: "#ed111a",
  8610. bid: "#ed111a",
  8611. ask: "#00a1d9",
  8612. grid: "#d5e4eb",
  8613. border: "#014d65",
  8614. order: "#014d65",
  8615. majorlevel: "#014d65",
  8616. minorlevel: "#014d65",
  8617. crosshair: "#040f12",
  8618. i: ["#00a1d9", "#ed111a", "#014d65", "#c60", "#6c0", "#0cc", "#cc0", "#0c0"]
  8619. },
  8620. fill: {
  8621. bg: "#d5e4eb",
  8622. up: "#00ACE5",
  8623. down: "#FF121A",
  8624. label: "#09232B",
  8625. flags: "#F2F8FA",
  8626. crosshair: "#fff",
  8627. blankBG: "#fff",
  8628. flagtext: "#040f12",
  8629. ordertext: "#014d65",
  8630. slottext: "#040f12"
  8631. }
  8632. },
  8633. m: {
  8634. stroke: {
  8635. up: "#9C6",
  8636. down: "#B40000",
  8637. bid: "#7A1631",
  8638. ask: "#89D12A",
  8639. grid: "#454545",
  8640. border: "#616161",
  8641. order: "#014d65",
  8642. majorlevel: "#014d65",
  8643. minorlevel: "#014d65",
  8644. crosshair: "#ffc200",
  8645. i: ["#ffc200", "#0099cc", "#014d65", "#c60", "#6c0", "#0cc", "#cc0", "#0c0"]
  8646. },
  8647. fill: {
  8648. bg: "#0f0f0f",
  8649. up: "#658744",
  8650. down: "#750000",
  8651. label: "#F4FFE4",
  8652. flags: "#0f0f0f",
  8653. crosshair: "#0f0f0f",
  8654. blankBG: "#0f0f0f",
  8655. flagtext: "#F4FFE4",
  8656. ordertext: "#014d65",
  8657. slottext: "#F4FFE4"
  8658. }
  8659. },
  8660. t: {
  8661. stroke: {
  8662. up: "#498192",
  8663. down: "#daa102",
  8664. bid: "#daa102",
  8665. ask: "#498192",
  8666. grid: "#0d1e29",
  8667. border: "#014d65",
  8668. order: "#014d65",
  8669. majorlevel: "#014d65",
  8670. minorlevel: "#014d65",
  8671. crosshair: "#040f12",
  8672. i: ["#498192", "#daa102", "#014d65", "#c60", "#6c0", "#0cc", "#cc0", "#0c0"]
  8673. },
  8674. fill: {
  8675. bg: "#05232c",
  8676. up: "#d6f7fb",
  8677. down: "#f9f15f",
  8678. label: "#daa102",
  8679. flags: "#F2F8FA",
  8680. crosshair: "#fff",
  8681. blankBG: "#050b0f",
  8682. flagtext: "#040f12",
  8683. ordertext: "#014d65",
  8684. slottext: "#040f12"
  8685. }
  8686. },
  8687. s: {
  8688. stroke: {
  8689. up: "#999",
  8690. down: "#000",
  8691. bid: "#333",
  8692. ask: "#999",
  8693. grid: "#ddd",
  8694. border: "#000",
  8695. order: "#014d65",
  8696. majorlevel: "#ccc",
  8697. minorlevel: "#ddd",
  8698. crosshair: "#000",
  8699. i: ["#aaa", "#999", "#ccc", "#777"]
  8700. },
  8701. fill: {
  8702. bg: "#fff",
  8703. up: "#bbb",
  8704. down: "#333",
  8705. label: "#333",
  8706. flags: "#fff",
  8707. crosshair: "#fff",
  8708. blankBG: "#fff",
  8709. flagtext: "#000",
  8710. ordertext: "#014d65",
  8711. slottext: "#000"
  8712. }
  8713. },
  8714. a: {
  8715. stroke: {
  8716. up: "#d00017",
  8717. down: "#4dd710",
  8718. bid: "#4dd710",
  8719. ask: "#d00017",
  8720. grid: "#d3d3d3",
  8721. border: "#999999",
  8722. order: "red",
  8723. majorlevel: "#666",
  8724. minorlevel: "#666",
  8725. crosshair: "#008fdb",
  8726. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8727. },
  8728. fill: {
  8729. bg: "#ffffff",
  8730. up: "#A10013",
  8731. down: "#3AA60C",
  8732. label: "#999999",
  8733. flags: "#ffffff",
  8734. crosshair: "#ffffff",
  8735. blankBG: "#ffffff",
  8736. flagtext: "#999999",
  8737. ordertext: "#ffc200",
  8738. slottext: "#165d82"
  8739. }
  8740. },
  8741. a1: {
  8742. stroke: {
  8743. fenshi: "#267cd1",
  8744. up: "#f24957",
  8745. down: "#1dbf60",
  8746. bid: "#4dd710",
  8747. ask: "#d00017",
  8748. grid: "#d3d3d3",
  8749. border: "#999999",
  8750. arrow: "#008fbd",
  8751. order: "red",
  8752. opacity: !0,
  8753. majorlevel: "#666",
  8754. minorlevel: "#666",
  8755. crosshair: "#008fdb",
  8756. i: ["#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8757. },
  8758. fill: {
  8759. bg: "#ffffff",
  8760. up: "#f24957",
  8761. down: "#1dbf60",
  8762. label: "#999999",
  8763. flags: "#ffffff",
  8764. crosshair: "#ffffff",
  8765. blankBG: "#ffffff",
  8766. flagtext: "#999999",
  8767. ordertext: "#ffc200",
  8768. slottext: "#165d82"
  8769. }
  8770. },
  8771. a2: {
  8772. stroke: {
  8773. fenshi: "#267cd1",
  8774. up: "#f24957",
  8775. down: "#1dbf60",
  8776. bid: "#4dd710",
  8777. ask: "#d00017",
  8778. grid: "#d3d3d3",
  8779. border: "#999999",
  8780. arrow: "#008fbd",
  8781. order: "red",
  8782. priceShow: !0,
  8783. opacity: !0,
  8784. majorlevel: "#666",
  8785. minorlevel: "#666",
  8786. crosshair: "#008fdb",
  8787. i: ["#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8788. },
  8789. fill: {
  8790. bg: "#ffffff",
  8791. up: "#f24957",
  8792. down: "#1dbf60",
  8793. label: "#999999",
  8794. flags: "#ffffff",
  8795. crosshair: "#ffffff",
  8796. blankBG: "#ffffff",
  8797. flagtext: "#999999",
  8798. ordertext: "#ffc200",
  8799. slottext: "#165d82"
  8800. }
  8801. },
  8802. "depth-white": {
  8803. stroke: {
  8804. up: "#d00017",
  8805. down: "#ff6c78",
  8806. bid: "#4dd710",
  8807. ask: "#ff6c78",
  8808. grid: "#dedede",
  8809. border: "#dedede",
  8810. order: "#1ad1af",
  8811. majorlevel: "blue",
  8812. minorlevel: "blue",
  8813. crosshair: "#deac37",
  8814. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8815. },
  8816. fill: {
  8817. bg: "#ffffff",
  8818. up: "#ff6c78",
  8819. down: "#9ed577",
  8820. label: "#999999",
  8821. flags: "#191919",
  8822. crosshair: "#fff",
  8823. blankBG: "#ffffff",
  8824. flagtext: "#666666",
  8825. ordertext: "#1ad1af",
  8826. slottext: "blue"
  8827. }
  8828. },
  8829. "chart-white2": {
  8830. stroke: {
  8831. fenshi: "#267cd1",
  8832. up: "#73c921",
  8833. fillUp: "#73c921",
  8834. down: "#ca2c78",
  8835. bid: "#79b48a",
  8836. ask: "#f32f3f",
  8837. grid: "#f1f1f1",
  8838. border: "#f1f1f1",
  8839. arrow: "#444",
  8840. order: "red",
  8841. majorlevel: "#666",
  8842. minorlevel: "#666",
  8843. crosshair: "#008fdb",
  8844. i: ["#ffc200", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8845. },
  8846. fill: {
  8847. bg: "#ffffff",
  8848. up: "#73c921",
  8849. down: "#ca2c78",
  8850. label: "#999999",
  8851. flags: "#ffffff",
  8852. crosshair: "#ffffff",
  8853. blankBG: "#ffffff",
  8854. flagtext: "#999999",
  8855. ordertext: "#ffc200",
  8856. slottext: "#165d82"
  8857. }
  8858. },
  8859. "depth-black-bnb": {
  8860. stroke: {
  8861. up: "#d00017",
  8862. down: "#4dd710",
  8863. bid: "#a3ff61",
  8864. ask: "#ff3394",
  8865. grid: "#323c45",
  8866. border: "#333",
  8867. order: "#ffffff",
  8868. majorlevel: "#666",
  8869. minorlevel: "#666",
  8870. crosshair: "#deac37",
  8871. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8872. },
  8873. fill: {
  8874. bg: "#262d33",
  8875. up: "#ff3394",
  8876. down: "#a3ff61",
  8877. label: "#9EA694",
  8878. flags: "#191919",
  8879. crosshair: "#191919",
  8880. blankBG: "#0A0A09",
  8881. flagtext: "#f4ffe4",
  8882. ordertext: "#ffffff",
  8883. slottext: "#f4ffe4"
  8884. }
  8885. },
  8886. "depth-black-mobile-bnb": {
  8887. stroke: {
  8888. up: "#d00017",
  8889. down: "#4dd710",
  8890. bid: "#a3ff61",
  8891. ask: "#ff3394",
  8892. grid: "#323c45",
  8893. border: "#333",
  8894. order: "#ffffff",
  8895. majorlevel: "#666",
  8896. minorlevel: "#666",
  8897. crosshair: "#deac37",
  8898. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8899. },
  8900. fill: {
  8901. bg: "#191d21",
  8902. up: "#ff3394",
  8903. down: "#a3ff61",
  8904. label: "#9EA694",
  8905. flags: "#191919",
  8906. crosshair: "#191919",
  8907. blankBG: "#0A0A09",
  8908. flagtext: "#f4ffe4",
  8909. ordertext: "#ffffff",
  8910. slottext: "#f4ffe4"
  8911. }
  8912. },
  8913. "chart-black-bnb": {
  8914. stroke: {
  8915. fenshi: "#ffffff",
  8916. up: "#73c921",
  8917. down: "#ca2c78",
  8918. bid: "#4dd710",
  8919. ask: "#d00017",
  8920. grid: "#323c45",
  8921. border: "#323c45",
  8922. arrow: "#fff",
  8923. order: "#ffc200",
  8924. majorlevel: "#666",
  8925. minorlevel: "#666",
  8926. crosshair: "#fff",
  8927. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8928. },
  8929. fill: {
  8930. bg: "#262d33",
  8931. up: "#73c921",
  8932. down: "#ca2c78",
  8933. label: "#9EA694",
  8934. flags: "#262d33",
  8935. crosshair: "#262d33",
  8936. blankBG: "#0A0A09",
  8937. flagtext: "#f4ffe4",
  8938. ordertext: "#ffc200",
  8939. slottext: "#f4ffe4"
  8940. }
  8941. },
  8942. "chart-black-mobile-bnb": {
  8943. stroke: {
  8944. fenshi: "#ffffff",
  8945. up: "#73c921",
  8946. down: "#ca2c78",
  8947. bid: "#4dd710",
  8948. ask: "#d00017",
  8949. grid: "#323c45",
  8950. border: "#323c45",
  8951. arrow: "#fff",
  8952. order: "#ffc200",
  8953. majorlevel: "#666",
  8954. minorlevel: "#666",
  8955. crosshair: "#fff",
  8956. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8957. },
  8958. fill: {
  8959. bg: "#191d21",
  8960. up: "#73c921",
  8961. down: "#ca2c78",
  8962. label: "#9EA694",
  8963. flags: "#262d33",
  8964. crosshair: "#262d33",
  8965. blankBG: "#0A0A09",
  8966. flagtext: "#f4ffe4",
  8967. ordertext: "#ffc200",
  8968. slottext: "#f4ffe4"
  8969. }
  8970. },
  8971. "depth-black-ico": {
  8972. stroke: {
  8973. fenshi: "#ffffff",
  8974. up: "#4dd710",
  8975. down: "#d00017",
  8976. bid: "#4dd710",
  8977. ask: "#d00017",
  8978. grid: "#252522",
  8979. border: "#333",
  8980. arrow: "#fff",
  8981. order: "#ffc200",
  8982. majorlevel: "#666",
  8983. minorlevel: "#666",
  8984. crosshair: "#fff",
  8985. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  8986. },
  8987. fill: {
  8988. bg: "#191919",
  8989. up: "#A10013",
  8990. down: "#3AA60C",
  8991. label: "#9EA694",
  8992. flags: "#191919",
  8993. crosshair: "#191919",
  8994. blankBG: "#0A0A09",
  8995. flagtext: "#f4ffe4",
  8996. ordertext: "#ffc200",
  8997. slottext: "#f4ffe4"
  8998. }
  8999. },
  9000. "chart-black-ico": {
  9001. stroke: {
  9002. fenshi: "#ffffff",
  9003. up: "#3AA60C",
  9004. down: "#ff0000",
  9005. bid: "#4dd710",
  9006. ask: "#d00017",
  9007. grid: "#323c45",
  9008. border: "#333",
  9009. arrow: "#fff",
  9010. order: "#ffc200",
  9011. majorlevel: "#666",
  9012. minorlevel: "#666",
  9013. crosshair: "#fff",
  9014. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  9015. },
  9016. fill: {
  9017. bg: "#191919",
  9018. up: "#3AA60C",
  9019. down: "#ff0000",
  9020. label: "#9EA694",
  9021. flags: "#191919",
  9022. crosshair: "#262d33",
  9023. blankBG: "#191919",
  9024. flagtext: "#f4ffe4",
  9025. ordertext: "#ffc200",
  9026. slottext: "#f4ffe4"
  9027. }
  9028. },
  9029. "chart-black-zql": {
  9030. stroke: {
  9031. fenshi: "#ffffff",
  9032. up: "#3AA60C",
  9033. down: "#ff0000",
  9034. bid: "#4dd710",
  9035. ask: "#d00017",
  9036. grid: "#323c45",
  9037. border: "#333",
  9038. arrow: "#fff",
  9039. order: "#ffc200",
  9040. majorlevel: "#666",
  9041. minorlevel: "#666",
  9042. crosshair: "#fff",
  9043. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  9044. },
  9045. fill: {
  9046. bg: "#191919",
  9047. up: "#3AA60C",
  9048. down: "#ff0000",
  9049. label: "#9EA694",
  9050. flags: "#191919",
  9051. crosshair: "#262d33",
  9052. blankBG: "#191919",
  9053. flagtext: "#f4ffe4",
  9054. ordertext: "#ffc200",
  9055. slottext: "#f4ffe4"
  9056. }
  9057. },
  9058. "chart-black-mobile-zql": {
  9059. stroke: {
  9060. fenshi: "#ffffff",
  9061. up: "#73c921",
  9062. down: "#ca2c78",
  9063. bid: "#4dd710",
  9064. ask: "#d00017",
  9065. grid: "#323c45",
  9066. border: "#323c45",
  9067. arrow: "#fff",
  9068. order: "#ffc200",
  9069. majorlevel: "#666",
  9070. minorlevel: "#666",
  9071. crosshair: "#fff",
  9072. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  9073. },
  9074. fill: {
  9075. bg: "#191d21",
  9076. up: "#73c921",
  9077. down: "#ca2c78",
  9078. label: "#9EA694",
  9079. flags: "#262d33",
  9080. crosshair: "#262d33",
  9081. blankBG: "#0A0A09",
  9082. flagtext: "#f4ffe4",
  9083. ordertext: "#ffc200",
  9084. slottext: "#f4ffe4"
  9085. }
  9086. },
  9087. "depth-black-zql": {
  9088. stroke: {
  9089. fenshi: "#ffffff",
  9090. up: "#4dd710",
  9091. down: "#d00017",
  9092. bid: "#4dd710",
  9093. ask: "#d00017",
  9094. grid: "#252522",
  9095. border: "#333",
  9096. arrow: "#fff",
  9097. order: "#ffc200",
  9098. majorlevel: "#666",
  9099. minorlevel: "#666",
  9100. crosshair: "#fff",
  9101. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  9102. },
  9103. fill: {
  9104. bg: "#191919",
  9105. up: "#A10013",
  9106. down: "#3AA60C",
  9107. label: "#9EA694",
  9108. flags: "#191919",
  9109. crosshair: "#191919",
  9110. blankBG: "#0A0A09",
  9111. flagtext: "#f4ffe4",
  9112. ordertext: "#ffc200",
  9113. slottext: "#f4ffe4"
  9114. }
  9115. },
  9116. "depth-black-mobile-zql": {
  9117. stroke: {
  9118. up: "#d00017",
  9119. down: "#4dd710",
  9120. bid: "#a3ff61",
  9121. ask: "#ff3394",
  9122. grid: "#323c45",
  9123. border: "#333",
  9124. order: "#ffffff",
  9125. majorlevel: "#666",
  9126. minorlevel: "#666",
  9127. crosshair: "#deac37",
  9128. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  9129. },
  9130. fill: {
  9131. bg: "#191d21",
  9132. up: "#ff3394",
  9133. down: "#a3ff61",
  9134. label: "#9EA694",
  9135. flags: "#191919",
  9136. crosshair: "#191919",
  9137. blankBG: "#0A0A09",
  9138. flagtext: "#f4ffe4",
  9139. ordertext: "#ffffff",
  9140. slottext: "#f4ffe4"
  9141. }
  9142. },
  9143. "chart-black-dae": {
  9144. stroke: {
  9145. fenshi: "#ffffff",
  9146. up: "#73c921",
  9147. down: "#ca2c78",
  9148. bid: "#4dd710",
  9149. ask: "#d00017",
  9150. grid: "#323c45",
  9151. border: "#323c45",
  9152. arrow: "#fff",
  9153. order: "#ffc200",
  9154. majorlevel: "#666",
  9155. minorlevel: "#666",
  9156. crosshair: "#fff",
  9157. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  9158. },
  9159. fill: {
  9160. bg: "#191919",
  9161. up: "#73c921",
  9162. down: "#ca2c78",
  9163. label: "#9EA694",
  9164. flags: "#262d33",
  9165. crosshair: "#262d33",
  9166. blankBG: "#0A0A09",
  9167. flagtext: "#f4ffe4",
  9168. ordertext: "#ffc200",
  9169. slottext: "#f4ffe4"
  9170. }
  9171. },
  9172. "chart-black-mobile-dae": {
  9173. stroke: {
  9174. fenshi: "#ffffff",
  9175. up: "#73c921",
  9176. down: "#ca2c78",
  9177. bid: "#4dd710",
  9178. ask: "#d00017",
  9179. grid: "#323c45",
  9180. border: "#323c45",
  9181. arrow: "#fff",
  9182. order: "#ffc200",
  9183. majorlevel: "#666",
  9184. minorlevel: "#666",
  9185. crosshair: "#fff",
  9186. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  9187. },
  9188. fill: {
  9189. bg: "#191d21",
  9190. up: "#73c921",
  9191. down: "#ca2c78",
  9192. label: "#9EA694",
  9193. flags: "#262d33",
  9194. crosshair: "#262d33",
  9195. blankBG: "#0A0A09",
  9196. flagtext: "#f4ffe4",
  9197. ordertext: "#ffc200",
  9198. slottext: "#f4ffe4"
  9199. }
  9200. },
  9201. "depth-black-dae": {
  9202. stroke: {
  9203. up: "#d00017",
  9204. down: "#4dd710",
  9205. bid: "#a3ff61",
  9206. ask: "#ff3394",
  9207. grid: "#323c45",
  9208. border: "#333",
  9209. order: "#ffffff",
  9210. majorlevel: "#666",
  9211. minorlevel: "#666",
  9212. crosshair: "#deac37",
  9213. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  9214. },
  9215. fill: {
  9216. bg: "#262d33",
  9217. up: "#ff3394",
  9218. down: "#a3ff61",
  9219. label: "#9EA694",
  9220. flags: "#191919",
  9221. crosshair: "#191919",
  9222. blankBG: "#0A0A09",
  9223. flagtext: "#f4ffe4",
  9224. ordertext: "#ffffff",
  9225. slottext: "#f4ffe4"
  9226. }
  9227. },
  9228. "depth-black-mobile-dae": {
  9229. stroke: {
  9230. up: "#d00017",
  9231. down: "#4dd710",
  9232. bid: "#a3ff61",
  9233. ask: "#ff3394",
  9234. grid: "#323c45",
  9235. border: "#333",
  9236. order: "#ffffff",
  9237. majorlevel: "#666",
  9238. minorlevel: "#666",
  9239. crosshair: "#deac37",
  9240. i: ["#0066cc", "#ffc200", "#6600cc", "#cc0066", "#00cccc", "#CC401D", "#fff385", "#9665cc", "#cc5c79", "#cc9056", "#86ccb6"]
  9241. },
  9242. fill: {
  9243. bg: "#191d21",
  9244. up: "#ff3394",
  9245. down: "#a3ff61",
  9246. label: "#9EA694",
  9247. flags: "#191919",
  9248. crosshair: "#191919",
  9249. blankBG: "#0A0A09",
  9250. flagtext: "#f4ffe4",
  9251. ordertext: "#ffffff",
  9252. slottext: "#f4ffe4"
  9253. }
  9254. }
  9255. }, Validator = function () {
  9256. var e = null, t = null, n = {BOOL: 1, INT: 2, FLOAT: 3, STRING: 4}, r = RTBTC.debug, o = function (e) {
  9257. switch (e) {
  9258. case n.BOOL:
  9259. return "boolean";
  9260. case n.INT:
  9261. return "integer";
  9262. case n.FLOAT:
  9263. return "float";
  9264. case n.STRING:
  9265. return "string";
  9266. default:
  9267. return "unknown"
  9268. }
  9269. }, i = function (i) {
  9270. switch (t) {
  9271. case n.BOOL:
  9272. if ("boolean" == typeof i) return e = i, !0;
  9273. break;
  9274. case n.INT:
  9275. if ("number" == typeof i) return e = parseInt(i), !0;
  9276. break;
  9277. case n.FLOAT:
  9278. if ("number" == typeof i) return e = parseFloat(i), !0;
  9279. break;
  9280. case n.STRING:
  9281. if ("string" == typeof i) return e = "" + i, !0
  9282. }
  9283. return DEBUG && r("Unable to validate " + i + ' as type "' + o(t) + '". Detected type: ' + typeof i, RTBTC.ERROR), !1
  9284. };
  9285. return {
  9286. create: function (r) {
  9287. if (r === n.BOOL && (t = r), r === n.INT && (t = r), r === n.FLOAT && (t = r), r === n.STRING && (t = r), null == t) throw"Invalid type.";
  9288. return {
  9289. get: function () {
  9290. return e
  9291. }, set: function (e) {
  9292. return i(e), this
  9293. }, toString: function () {
  9294. return "" + e
  9295. }
  9296. }
  9297. }, BOOL: n.BOOL, INT: n.INT, FLOAT: n.FLOAT, STRING: n.STRING
  9298. }
  9299. }, V = new Validator, Settings = {
  9300. base: "BTC",
  9301. quote: "USD",
  9302. exchange: "mtgox",
  9303. display: {precision: {price: 5, volume: 4}, zeros: !0, grid: 5},
  9304. sounds: {},
  9305. localTime: !0,
  9306. theme: "c",
  9307. version: "0.0.0",
  9308. layouts: [{
  9309. name: "Market Overview",
  9310. modules: [{
  9311. m: {t: "order-book", w: 478, h: 478, x: 510, y: 100, l: !0},
  9312. c: {g: !0, i: .01, s: !0, d: 50}
  9313. }, {m: {t: "time-sales", w: 488, h: 178, x: 10, y: 400, l: !0}, c: {f: !0, s: !0}}, {
  9314. m: {
  9315. t: "ticker",
  9316. w: 478,
  9317. h: 78,
  9318. x: 510,
  9319. y: 10,
  9320. l: !0
  9321. }, c: {a: !0, h: !0, l: !0, v: !0}
  9322. }, {m: {t: "orders", w: 488, h: 108, x: 10, y: 280, l: !0}, c: {}}, {
  9323. m: {
  9324. t: "order-entry",
  9325. w: 238,
  9326. h: 258,
  9327. x: 10,
  9328. y: 10,
  9329. l: !0
  9330. }, c: {b: !0, c: !0, l: !1}
  9331. }, {m: {t: "order-entry", w: 238, h: 258, x: 260, y: 10, l: !0}, c: {b: !1, c: !0, l: !1}}]
  9332. }]
  9333. }, Settings_Helper = function () {
  9334. var e = (new Validator).create(V.BOOL), t = (new Validator).create(V.INT),
  9335. n = ((new Validator).create(V.FLOAT), (new Validator).create(V.STRING)), r = {}, o = {
  9336. dpp: Settings.display.precision.price,
  9337. dpv: Settings.display.precision.volume,
  9338. dz: Settings.display.zeros,
  9339. dg: Settings.display.grid,
  9340. b: Settings.base,
  9341. q: Settings.quote,
  9342. ex: Settings.exchange,
  9343. lt: Settings.localTime,
  9344. thm: Settings.theme,
  9345. snd: Settings.sounds,
  9346. version: Settings.version
  9347. }, i = (RTBTC.debug, function (e, t, n) {
  9348. return void 0 === r[e] ? t : n.set(t).set(r[e]).get()
  9349. }), a = function (a) {
  9350. r = a, Settings.display.precision.price = i("dpp", o.dpp, t), Settings.display.precision.volume = i("dpv", o.dpv, t), Settings.display.zeros = i("dz", o.dz, e), Settings.display.grid = i("dg", o.dg, t), Settings.display.grid = 5, Settings.localTime = i("lt", o.lt, e), Settings.theme = i("thm", o.thm, n), Settings.version = i("version", o.version, n);
  9351. var s = i("b", o.b, n);
  9352. Currency.valid(s) && (Settings.base = s);
  9353. var l = i("q", o.q, n);
  9354. Currency.valid(l) && (Settings.quote = l);
  9355. var c = i("ex", o.ex, n);
  9356. if (Exchanges.valid(c) && (Settings.exchange = c), Settings.sounds = a.hasOwnProperty("snd") ? a.snd : {}, void 0 !== a.layouts && a.layouts.length > 0) {
  9357. Settings.layouts = [];
  9358. for (var u, f, d = 0; d < a.layouts.length; d++) {
  9359. if (u = {}, void 0 !== a.layouts[d].name && a.layouts[d].name.length > 0 && (u.name = "" + a.layouts[d].name), void 0 !== a.layouts[d].modules) {
  9360. u.modules = [];
  9361. for (var p = 0; p < a.layouts[d].modules.length; p++) f = {
  9362. m: {},
  9363. c: {}
  9364. }, void 0 !== a.layouts[d].modules[p].m && (f.m = a.layouts[d].modules[p].m), void 0 !== a.layouts[d].modules[p].c && (f.c = a.layouts[d].modules[p].c), u.modules.push(deepCopy(f))
  9365. }
  9366. Settings.layouts.push(deepCopy(u))
  9367. }
  9368. }
  9369. };
  9370. return {
  9371. process: function (e) {
  9372. return a(e), this
  9373. }, save: function () {
  9374. var e = {};
  9375. for (var t in o) o.hasOwnProperty(t) && (e[t] = o[t]);
  9376. return e.layouts = Settings.layouts, JSON.stringify(e)
  9377. }, saveToStructure: function (e, t) {
  9378. o[e] = t
  9379. }
  9380. }
  9381. }(), i18n = {
  9382. Account: {
  9383. ru: "счет",
  9384. de: "Konto",
  9385. cn: "帐户",
  9386. pl: "konto",
  9387. vi: "T�i kho?n",
  9388. da: "konto",
  9389. es: "",
  9390. sv: "",
  9391. fi: "",
  9392. bg: "",
  9393. it: ""
  9394. },
  9395. Close: {
  9396. ru: "?????????",
  9397. de: "schlie�en",
  9398. cn: "??",
  9399. pl: "zamkn??",
  9400. vi: "?�ng",
  9401. da: "Luk",
  9402. es: "",
  9403. sv: "",
  9404. fi: "",
  9405. bg: "",
  9406. it: ""
  9407. },
  9408. Settings: {
  9409. ru: "?????????",
  9410. de: "Einstellungen",
  9411. cn: "??",
  9412. pl: "Ustawienia",
  9413. vi: "C�i ??t",
  9414. da: "Indstillinger",
  9415. es: "",
  9416. sv: "",
  9417. fi: "",
  9418. bg: "",
  9419. it: ""
  9420. },
  9421. Layout: {
  9422. ru: "????????????",
  9423. de: "Layout",
  9424. cn: "??",
  9425. pl: "uk?ad",
  9426. vi: "Giao di?n",
  9427. da: "Layout",
  9428. es: "",
  9429. sv: "",
  9430. fi: "",
  9431. bg: "",
  9432. it: ""
  9433. },
  9434. Locking: {
  9435. ru: "??????????",
  9436. de: "Sperren",
  9437. cn: "??",
  9438. pl: "Blokowanie",
  9439. vi: "kh�a",
  9440. da: "L�sning",
  9441. es: "",
  9442. sv: "",
  9443. fi: "",
  9444. bg: "",
  9445. it: ""
  9446. },
  9447. "Place Order": {
  9448. ru: "?????????? ?????",
  9449. de: "Bestellung aufgeben",
  9450. cn: "???",
  9451. pl: "Z?�? zam�wienie",
  9452. vi: "??t th? t?",
  9453. da: "Afgiv ordre",
  9454. es: "",
  9455. sv: "",
  9456. fi: "",
  9457. bg: "",
  9458. it: ""
  9459. },
  9460. Sending: {
  9461. ru: "??????????",
  9462. de: "Senden",
  9463. cn: "??",
  9464. pl: "wysy?anie",
  9465. vi: "g?i",
  9466. da: "Sende",
  9467. es: "",
  9468. sv: "",
  9469. fi: "",
  9470. bg: "",
  9471. it: ""
  9472. },
  9473. Bid: {
  9474. ru: "???",
  9475. de: "Geld",
  9476. cn: "??",
  9477. pl: "oferta",
  9478. vi: "Gi� th?u",
  9479. da: "Bud",
  9480. es: "",
  9481. sv: "",
  9482. fi: "",
  9483. bg: "",
  9484. it: ""
  9485. },
  9486. Ask: {
  9487. ru: "???",
  9488. de: "Brief",
  9489. "en-gb": "Offer",
  9490. cn: "?",
  9491. pl: "zapyta?",
  9492. vi: "xin",
  9493. da: "Sp�rg",
  9494. es: "",
  9495. sv: "",
  9496. fi: "",
  9497. bg: "",
  9498. it: ""
  9499. },
  9500. Sum: {ru: "?????", de: "Summe", cn: "??", pl: "suma", vi: "Sum", da: "Sum", es: "", sv: "", fi: "", bg: "", it: ""},
  9501. Size: {
  9502. ru: "??????",
  9503. de: "Gr��e",
  9504. cn: "??",
  9505. pl: "rozmiar",
  9506. vi: "K�ch th??c",
  9507. da: "St�rrelse",
  9508. es: "",
  9509. sv: "",
  9510. fi: "",
  9511. bg: "",
  9512. it: ""
  9513. }
  9514. }, Data_Class = function () {
  9515. function e() {
  9516. function e() {
  9517. DEBUG && d("Data Setup. " + (f.hasStorage ? "Has" : "Does not have") + " localStorage"), f.hasStorage && (f.storage = window.localStorage), c()
  9518. }
  9519. function t(e) {
  9520. switch (e) {
  9521. case 0:
  9522. case 60:
  9523. return "1m";
  9524. case 180:
  9525. return "3m";
  9526. case 300:
  9527. return "5m";
  9528. case 900:
  9529. return "15m";
  9530. case 1800:
  9531. return "30m";
  9532. case 3600:
  9533. return "1h";
  9534. case 7200:
  9535. return "2h";
  9536. case 14400:
  9537. return "4h";
  9538. case 21600:
  9539. return "6h";
  9540. case 43200:
  9541. return "12h";
  9542. case 86400:
  9543. return "1d";
  9544. case 259200:
  9545. return "3d";
  9546. case 604800:
  9547. return "1w"
  9548. }
  9549. }
  9550. function n(e, n) {
  9551. if (f.lock[e]) DEBUG && d("data: _load: LOCK on period " + e); else {
  9552. f.lock[e] = !0;
  9553. var i = RTBTC.base(), a = p + "/klines?symbol=" + RTBTC.base() + "&interval=" + t(e);
  9554. if (null != f.links[e].prev) a += "&endTime=" + f.links[e].prev; else if (!n) return void(f.lock[e] = !1);
  9555. RTBTC.json(a, function (e) {
  9556. return function (t) {
  9557. i == RTBTC.base() && r(t, e, null)
  9558. }
  9559. }(e), function (e) {
  9560. return function (t) {
  9561. o(e)
  9562. }
  9563. }(e))
  9564. }
  9565. }
  9566. function r(e, t, n) {
  9567. f.lock[t] = !1, e.length >= 0 && f._onLoaded && f._onLoaded(), e[e.length - 1];
  9568. var r;
  9569. if (e.length > 0 && (f.links[t].prev = e[0][0] - 1e3 * t), RTBTC.trigger("console", "Loaded " + e.length + " chart bars."), 0 != e.length) {
  9570. for (f.cache.bars[t] = [], r = e.length - 1; r >= 0; r--) f.cache.bars[t].push([e[r][0], Number(e[r][1]), Number(e[r][2]), Number(e[r][3]), Number(e[r][4]), Number(e[r][5]), Number(e[r][7])]);
  9571. RTBTC.trigger("barclose", t)
  9572. }
  9573. }
  9574. function o(e) {
  9575. f.lock[e] = !1, DEBUG && d("Data: load failure for period " + e + "!")
  9576. }
  9577. function i(e, t) {
  9578. return (e = +e) - e % t
  9579. }
  9580. function a(e) {
  9581. var t, n = [e.time, e.price, e.amount];
  9582. f.cache.ticks.splice(0, 0, n);
  9583. var r, o, a = f.cache.ticks.length, s = f.config.tradeBuffer;
  9584. a > s && f.cache.ticks.splice(s - 1, s - a);
  9585. for (o in f.cache.bars) f.cache.bars.hasOwnProperty(o) && (r = +o, t = i(e.time, r), 0 == f.cache.bars[o].length || t >= f.cache.bars[o][0][0] + r ? (f.cache.bars[o].splice(0, 0, [t, n[1], n[1], n[1], n[1], n[2]]), RTBTC.trigger("barclose", o)) : t == f.cache.bars[o][0][0] && (n[1] > f.cache.bars[o][0][2] && (f.cache.bars[o][0][2] = n[1]), n[1] < f.cache.bars[o][0][3] && (f.cache.bars[o][0][3] = n[1]), f.cache.bars[o][0][4] = n[1], f.cache.bars[o][0][5] += n[2]));
  9586. ++f.config.tradeCount % f.config.tradeSave == 0 ? u() : -1 == f.config.saveID && (f.config.saveID = window.setTimeout(u, f.config.saveTimeout))
  9587. }
  9588. function s(e) {
  9589. f.cache.ticker = e
  9590. }
  9591. function l(e, t) {
  9592. if (void 0 != f.cache.bars[t]) if (f.cache.bars[t].length > 0) {
  9593. if (e[0] < f.cache.bars[t][0][0]) return;
  9594. if (e[0] == f.cache.bars[t][0][0] && e[5] <= f.cache.bars[t][0][5]) return;
  9595. e[0] == f.cache.bars[t][0][0] ? f.cache.bars[t][0] = e : f.cache.bars[t].splice(0, 0, e), RTBTC.trigger("barclose", t)
  9596. } else f.cache.bars[t].splice(0, 0, e), RTBTC.trigger("barclose", t)
  9597. }
  9598. function c() {
  9599. var e, t, r = RTBTC.base(), o = RTBTC.quote();
  9600. for (f.cache.ticks = [], f.cache.ticker = {}, t = 0; t < f.offline.length; t++) e = f.offline[t], f.cache.bars[e] = [];
  9601. for (t = 0; t < f.online.length; t++) e = f.online[t], f.links[e] = {
  9602. prev: null,
  9603. next: null,
  9604. last: null
  9605. }, f.lock[e] = !1;
  9606. if (n(f.currentPeriod, !0), f.hasStorage) {
  9607. var i = r + o + "_ticks";
  9608. if (void 0 !== f.storage[i]) {
  9609. var a = JSON.parse(f.storage[i]);
  9610. a.hasOwnProperty("stamp") && a.stamp + f.config.ticksMaxAge > millitime() && (f.cache.ticks = a.ticks)
  9611. }
  9612. }
  9613. }
  9614. function u() {
  9615. if (f.hasStorage) {
  9616. millitime();
  9617. var e = RTBTC.exchange() + "_" + RTBTC.base() + RTBTC.quote() + "_ticks",
  9618. t = f.cache.ticks.slice(0, f.config.tradeBuffer), n = {};
  9619. if (0 != t.length) {
  9620. n.stamp = millitime(), n.ticks = t;
  9621. try {
  9622. f.storage[e] = JSON.stringify(n)
  9623. } catch (e) {
  9624. DEBUG && d("LocalStorage quota exceeded.")
  9625. }
  9626. window.clearTimeout(f.config.saveID), f.config.saveID = -1
  9627. }
  9628. }
  9629. }
  9630. var f = {
  9631. cache: {bars: {}, ticks: [], ticker: {}},
  9632. links: {},
  9633. currentPeriod: 60,
  9634. online: [2592e3, 604800, 259200, 86400, 43200, 21600, 14400, 7200, 3600, 1800, 900, 300, 180, 60],
  9635. offline: [2592e3, 604800, 259200, 86400, 43200, 21600, 14400, 7200, 3600, 1800, 900, 300, 180, 60],
  9636. lock: {},
  9637. storage: null,
  9638. hasStorage: storageSupport(),
  9639. config: {saveTimeout: 3e4, saveID: -1, tradeCount: 0, tradeSave: 100, tradeBuffer: 1500, ticksMaxAge: 300},
  9640. self: null,
  9641. debug: RTBTC.isDebug()
  9642. }, d = RTBTC.debug,
  9643. p = location.host.match("localhost") || location.host.match("192.168.0") ? "/exchange/public" : "/api/v1";
  9644. return {
  9645. setup: function (t) {
  9646. return "undifined" != t && f.online.indexOf(t) >= 0 && (f.currentPeriod = t), e(), this
  9647. }, self: function (t) {
  9648. return f.self = t, RTBTC.handler("trade", "data", f.self.onTrade), RTBTC.handler("ticker", "data", f.self.onTicker), RTBTC.handler("instrument", "data", e), this
  9649. }, onTrade: function (e) {
  9650. a(e)
  9651. }, onTicker: function (e) {
  9652. s(e)
  9653. }, onBar: function (e, t) {
  9654. l(e, t)
  9655. }, onLoaded: function (e) {
  9656. f._onLoaded = e
  9657. }, data: f.cache, loadPrev: function (e) {
  9658. var t = e;
  9659. if (-1 == f.online.indexOf(e)) for (var r = 0; r < f.online.length; r++) if (f.online[r] <= e) {
  9660. t = f.online[r];
  9661. break
  9662. }
  9663. n(t, !1)
  9664. }, internals: f.debug ? function () {
  9665. return f
  9666. } : function () {
  9667. return {}
  9668. }, debug: f.debug ? d : function (e, t) {
  9669. }
  9670. }
  9671. }
  9672. var t = null;
  9673. return new function () {
  9674. this.Build = function () {
  9675. return null == t && ((t = new e).constructor = null), t
  9676. }
  9677. }
  9678. }(), Data = Data_Class.Build(), digit = 6, Indicator = function () {
  9679. function e(e) {
  9680. if (void 0 !== e && e.hasOwnProperty("length")) {
  9681. var t;
  9682. for (t = 0; t < Ae.ps.length; t++) e.length <= t || e[t] < Ae.ps[t].bounds[0] || e[t] > Ae.ps[t].bounds[1] || (Ae.p[t] = e[t])
  9683. }
  9684. }
  9685. function t(e) {
  9686. var t = _("DMI");
  9687. return t += "(" + ~~Ae.p[0] + ")", e >= 0 && Ae.output.length > 0 && e < Ae.output[0].length && (t += ": ", t += Ae.output[2][e].toFixed(1), t += ", +DI: ", t += Ae.output[1][e].toFixed(1), t += ", -DI: ", t += Ae.output[0][e].toFixed(1)), t
  9688. }
  9689. function n() {
  9690. return [{type: Ae.LINE, data: Ae.output[0]}, {type: Ae.LINE, data: Ae.output[1]}, {
  9691. type: Ae.LINE,
  9692. data: Ae.output[2]
  9693. }]
  9694. }
  9695. function r(e, t, n) {
  9696. var r, o, i, a, s, l, c = 0, u = 0, f = 0, d = 0, p = 0, h = 0;
  9697. for (Ae.output = [[0], [0], [0]], Ae.min = 1 / 0, Ae.max = -1 / 0, r = Math.min(e.length - 2, n + 150 - 1); r >= t; r--) u = Math.max(e[r][2] - e[r][3], Math.abs(e[r][2] - e[r + 1][4]), Math.abs(e[r][3] - e[r + 1][4])), o = e[r][2] - e[r + 1][2] > e[r + 1][3] - e[r][3] ? Math.max(e[r][2] - e[r + 1][2], 0) : 0, i = e[r + 1][3] - e[r][3] > e[r][2] - e[r + 1][2] ? Math.max(e[r + 1][3] - e[r][3], 0) : 0, c < Ae.p[0] ? (f += u, d += o, p += i) : (f = f - f / Ae.p[0] + u, d = d - d / Ae.p[0] + o, p = p - p / Ae.p[0] + i), a = 100 * d / f, s = 100 * p / f, l = 100 * Math.abs(a - s) / (a + s + 1e-6), c < Ae.p[0] ? h = 0 : c < 2 * Ae.p[0] ? h += l / Ae.p[0] : h = (h * (Ae.p[0] - 1) + l) / Ae.p[0], Ae.output[0].splice(0, 0, s), Ae.output[1].splice(0, 0, a), Ae.output[2].splice(0, 0, h), r < n && (s < Ae.min && (Ae.min = s), a < Ae.min && (Ae.min = a), h < Ae.min && (Ae.min = h), s > Ae.max && (Ae.max = s), a > Ae.max && (Ae.max = a), h > Ae.max && (Ae.max = h)), c++
  9698. }
  9699. function o() {
  9700. return {major: [50], minor: [30, 70]}
  9701. }
  9702. function i() {
  9703. return [{type: Ae.LINE, data: Ae.output[0]}, {type: Ae.LINE, data: Ae.output[1]}, {
  9704. type: Ae.LINE,
  9705. data: Ae.output[2]
  9706. }]
  9707. }
  9708. function a(e, t, n) {
  9709. var r, o, i = Ae.p[0], a = Ae.p[1], s = 0, l = 0, c = 0, u = .05, f = [], d = 0, p = [];
  9710. for (Ae.output = [[], [], []], r = Math.min(e.length - 1, n + i); r >= t; r--) o = e[r][4], f.splice(0, 0, o), p.splice(0, 0, o * o), l += o, c += p[0], f.length > i && (l -= f.pop(), c -= p.pop()), s = l / f.length, f.length > 1 ? (d = f.length, u = Math.sqrt((d * c - l * l) / (d * (d - 1)))) : u = 0, Ae.output[0].splice(0, 0, s), Ae.output[1].splice(0, 0, s + a * u), Ae.output[2].splice(0, 0, s - a * u)
  9711. }
  9712. function s(e) {
  9713. var t = _("Bands");
  9714. return t += "(" + ~~Ae.p[0] + ", " + Ae.p[1].toFixed(1) + ")", e >= 0 && Ae.output.length > 0 && e < Ae.output[0].length && (t += ": ", t += Ae.output[2][e].toFixed(digit) + ", ", t += Ae.output[0][e].toFixed(digit) + ", ", t += Ae.output[1][e].toFixed(digit)), t
  9715. }
  9716. function l() {
  9717. return [{type: Ae.LINE, data: Ae.output[0]}]
  9718. }
  9719. function c() {
  9720. return {major: [-200, -100, 100, 200], minor: [0]}
  9721. }
  9722. function u(e, t, n) {
  9723. var r, o, i, a, s, l = Ae.p[0], c = [], u = Math.min(e.length - 1, n + Ae.p[0]);
  9724. for (Ae.output = [[]], r = u; r >= t; r--) {
  9725. a = (e[r][2] + e[r][3] + e[r][4]) / 3;
  9726. var f = 0;
  9727. for (o = r; o <= Math.min(r + l - 1, u); o++) f += e[o][4];
  9728. var d = f / (Math.min(r + l - 1, u) - r + 1);
  9729. c.splice(0, 0, d), c.length > l && c.pop();
  9730. var p = 0;
  9731. for (i = 0; i <= c.length - 1; i++) p += Math.abs(c[i] - e[r + i][4]);
  9732. var h = p / c.length;
  9733. s = 0 == h ? 0 : (a - d) / h / .015, Ae.output[0].splice(0, 0, s)
  9734. }
  9735. }
  9736. function f(e) {
  9737. var t = "CCI";
  9738. return t += "(" + ~~Ae.p[0] + ")", e >= 0 && Ae.output.length > 0 && e < Ae.output[0].length && (t += " " + Ae.output[0][e].toFixed(digit)), t
  9739. }
  9740. function d() {
  9741. return [{type: Ae.LINE, data: Ae.output[0]}, {type: Ae.LINE, data: Ae.output[1]}, {
  9742. type: Ae.LINE,
  9743. data: Ae.output[2]
  9744. }]
  9745. }
  9746. function p(e, t, n) {
  9747. var r, o, i, a = Ae.p[0], s = Math.min(e.length - 1, n + a), l = [], c = e[s][2], u = e[s][3];
  9748. for (Ae.output = [[], [], []], r = s; r >= t; r--) {
  9749. if (i = e[r][4], l.splice(0, 0, i), i > c && (c = i), i < u && (u = i), l.length > a) for (l.pop(), u = 1e15, c = -1e15, o = 0; o < l.length; o++) l[o] > c && (c = l[o]), l[o] < u && (u = l[o]);
  9750. Ae.output[0].splice(0, 0, (c + u) / 2), Ae.output[1].splice(0, 0, c), Ae.output[2].splice(0, 0, u)
  9751. }
  9752. }
  9753. function h(e) {
  9754. var t = _("Channel");
  9755. return t += "(" + ~~Ae.p[0] + ")", e >= 0 && Ae.output.length > 0 && e < Ae.output[0].length && (t += ": ", t += Ae.output[2][e].toFixed(digit) + ", ", t += Ae.output[0][e].toFixed(digit) + ", ", t += Ae.output[1][e].toFixed(digit)), t
  9756. }
  9757. function g() {
  9758. return [{type: Ae.LINE, data: Ae.output}]
  9759. }
  9760. function m(e, t, n) {
  9761. var r, o, i = 2 / (Ae.p[0] + 1), a = Math.ceil(Math.log(.01) / Math.log(1 - i));
  9762. for (Ae.output = [e[Math.min(e.length - 1, n + a + 1)][4]], r = Math.min(e.length - 2, n + a); r >= t; r--) o = i * e[r][4] + (1 - i) * Ae.output[0], Ae.output.splice(0, 0, o)
  9763. }
  9764. function v(e) {
  9765. var t = "";
  9766. return e >= 0 && e < Ae.output.length && (t = _("EMA"), t += "(" + ~~Ae.p[0] + "): ", t += Ae.output[e].toFixed(digit)), t
  9767. }
  9768. function b() {
  9769. return [{type: Ae.LINE, data: Ae.output}]
  9770. }
  9771. function y(e, t, n) {
  9772. var r, o = Ae.p[0], i = 0, a = 0;
  9773. for (Ae.output = [], r = Math.min(e.length - 1, n + o); r >= t; r--) {
  9774. if (i == o - 1) {
  9775. a = 0;
  9776. for (var s = 0; s <= o - 1; s++) a += e[r + s][4];
  9777. Ae.output.splice(0, 0, a / o)
  9778. } else i > o - 1 ? (a = Ae.output[0] * o, a -= e[r + o][4], a += e[r][4], Ae.output.splice(0, 0, a / o)) : Ae.output.splice(0, 0, void 0);
  9779. i++
  9780. }
  9781. }
  9782. function x(e) {
  9783. var t = "";
  9784. return e >= 0 && e < Ae.output.length && (t = _("MA"), t += "(" + ~~Ae.p[0] + "): ", t += (Ae.output[e] || 0).toFixed(digit)), t
  9785. }
  9786. function w() {
  9787. return [{type: Ae.LINE, data: Ae.output}]
  9788. }
  9789. function $() {
  9790. return {major: [-500, 500], minor: [0]}
  9791. }
  9792. function k(e, t, n) {
  9793. var r, o, i = 2 / (Ae.p[1] + 1), a = Math.ceil(Math.log(.01) / Math.log(1 - i));
  9794. if (Ae.min = 1 / 0, Ae.max = -1 / 0, Ae.output = [], r = Math.min(e.length - 1, n + a + 1), !(--r < 0)) {
  9795. for (o = 0 == e[r][5] ? 0 : Ae.p[0] * (e[r][2] - e[r][3]) / e[r][5] * (e[r][2] + e[r][3] - e[r + 1][2] - e[r + 1][3]) * .5, Ae.output.splice(0, 0, o), --r; r >= t; r--) (o = i * (0 == e[r][5] ? 0 : Ae.p[0] * (e[r][2] - e[r][3]) / e[r][5] * (e[r][2] + e[r][3] - e[r + 1][2] - e[r + 1][3]) * .5) + (1 - i) * o) > Ae.max && (Ae.max = o), o < Ae.min && (Ae.min = o), Ae.output.splice(0, 0, o);
  9796. Ae.max = Ae.max + .05 * (Ae.max - Ae.min)
  9797. }
  9798. }
  9799. function T(e) {
  9800. var t = _("EMV");
  9801. return e >= 0 && e < Ae.output.length && (t += "(" + ~~Ae.p[0] + ", " + ~~Ae.p[1] + "): ", t += Ae.output[e].toFixed(digit)), t
  9802. }
  9803. function S() {
  9804. return [{type: Ae.LINE, data: Ae.output}]
  9805. }
  9806. function C(e, t, n) {
  9807. var r, o, i, a, s = 2 / (Ae.p[0] + 1), l = Math.ceil(Math.log(.01) / Math.log(1 - s));
  9808. for (a = i = o = e[Math.min(e.length - 1, n + l + 1)][4], r = Math.min(e.length - 2, n + l); r >= t; r--) a = s * (i = s * (o = s * e[r][4] + (1 - s) * o) + (1 - s) * i) + (1 - s) * a, Ae.output.splice(0, 0, a)
  9809. }
  9810. function E(e) {
  9811. var t = _("TRIX");
  9812. return e >= 0 && e < Ae.output.length && (t += "(" + ~~Ae.p[0] + "): ", t += Ae.output[e].toFixed(digit)), t
  9813. }
  9814. function A() {
  9815. return [{type: Ae.HIST, data: Ae.output[0]}, {type: Ae.LINE, data: Ae.output[1]}, {
  9816. type: Ae.LINE,
  9817. data: Ae.output[2]
  9818. }]
  9819. }
  9820. function N() {
  9821. return {minor: [0]}
  9822. }
  9823. function P(e, t, n) {
  9824. var r, o, i, a = 0, s = 0, l = 0, c = 2 / (1 + Ae.p[0]), u = 2 / (1 + Ae.p[1]), f = 2 / (1 + Ae.p[2]),
  9825. d = Math.ceil(Math.log(.01) / Math.log(1 - Math.min(c, u))), p = e[Math.min(e.length - 1, n + d + 1)][4];
  9826. for (Ae.output = [[0], [0], [0]], a = p, s = p, l = 0, Ae.min = 0, Ae.max = 0, r = Math.min(e.length - 2, n + d); r >= t; r--) i = (o = (a = c * (p = e[r][4]) + (1 - c) * a) - (s = u * p + (1 - u) * s)) - (l = f * o + (1 - f) * l), Ae.output[0].splice(0, 0, i), Ae.output[1].splice(0, 0, l), Ae.output[2].splice(0, 0, o), r < n && (o > Ae.max && (Ae.max = o), o < Ae.min && (Ae.min = o), i > Ae.max && (Ae.max = i), i < Ae.min && (Ae.min = i));
  9827. Ae.max = Ae.max + .05 * (Ae.max - Ae.min), 0 == Ae.max && 0 == Ae.min && (Ae.max = 10, Ae.min = -10)
  9828. }
  9829. function O(e) {
  9830. var t = _("MACD");
  9831. return t += "(" + ~~Ae.p[0] + ", " + ~~Ae.p[1] + ", " + ~~Ae.p[2] + ")", e >= 0 && Ae.output.length > 0 && e < Ae.output[0].length && (t += ": ", t += Ae.output[0][e].toFixed(digit) + ", ", t += Ae.output[1][e].toFixed(digit) + ", ", t += Ae.output[2][e].toFixed(digit)), t
  9832. }
  9833. function D() {
  9834. return {major: [20, 80]}
  9835. }
  9836. function I() {
  9837. return [{type: Ae.LINE, data: Ae.output}]
  9838. }
  9839. function M() {
  9840. return {minor: [0]}
  9841. }
  9842. function L(e, t, n) {
  9843. var r;
  9844. if (!(e.length <= 1)) for (Ae.output = [e[Math.min(e.length - 2, n - 1)][5] / BTC_INT], Ae.min = Ae.output[0], Ae.max = Ae.min, r = Math.min(e.length - 2, n - 1); r >= t; r--) e[r][4] > e[r + 1][4] ? Ae.output.splice(0, 0, Ae.output[0] + e[r][5] / BTC_INT) : Ae.output.splice(0, 0, Ae.output[0] - e[r][5] / BTC_INT), Ae.output[0] < Ae.min && (Ae.min = Ae.output[0]), Ae.output[0] > Ae.max && (Ae.max = Ae.output[0])
  9845. }
  9846. function F(e) {
  9847. var t = _("On Balance Volume");
  9848. return e >= 0 && e < Ae.output.length && (t += ": ", t += Ae.output[e].toFixed(1)), t
  9849. }
  9850. function B() {
  9851. return [{type: Ae.PSAR, data: Ae.output}]
  9852. }
  9853. function R(e, t, n) {
  9854. var r, o, i, a = !0, s = Ae.p[0], l = (Ae.p[1], Math.min(e.length - 1, n + 100)), c = e[l][2], u = e[l][3], f = c,
  9855. d = u;
  9856. for (Ae.output = [d], i = l - 1; i >= t; i--) r = e[i][2], o = e[i][3], d = Ae.output[0] + s * (f - Ae.output[0]), a ? (r > f && (f = r, (s += Ae.p[0]) > Ae.p[1] && (s = Ae.p[1])), d > o && (a = !1, d = f, s = Ae.p[0], f = o)) : (o < f && (f = o, (s += Ae.p[0]) > Ae.p[1] && (s = Ae.p[1])), d < r && (a = !0, d = f, s = Ae.p[0], f = r)), c = r, u = o, Ae.output.splice(0, 0, d)
  9857. }
  9858. function j(e) {
  9859. var t = "PSAR";
  9860. return t += "(" + Ae.p[0].toFixed(3) + ", " + Ae.p[1].toFixed(digit) + ")", e >= 0 && e < Ae.output.length && (t += ": ", t += Ae.output[e].toFixed(digit)), t
  9861. }
  9862. function q() {
  9863. return [{type: Ae.LINE, data: Ae.output}]
  9864. }
  9865. function U() {
  9866. return {major: [30, 70], minor: [50]}
  9867. }
  9868. function H(e, t, n) {
  9869. var r, o, i = 0, a = [], s = [], l = 0, c = 0, u = 0, f = !1, d = 0;
  9870. for (Ae.output = [50], r = Math.min(e.length - 2, n + 250); r >= t; r--) {
  9871. if (f = e[r][4] > e[r + 1][4], d = e[r][4] - e[r + 1][4], f ? a.push(d) : s.push(-d), i < Ae.p[0]) Ae.output.splice(0, 0, 50); else if (i == Ae.p[0]) {
  9872. for (o = 0; o < a.length; o++) l += a[o];
  9873. for (0 == a.length ? l = 0 : l /= a.length, o = 0; o < s.length; o++) c += s[o];
  9874. 0 == s.length ? c = 0 : c /= s.length, u = l / (c + 1e-8), Ae.output.splice(0, 0, 100 - 100 / (1 + u))
  9875. } else u = (l = (l * (Ae.p[0] - 1) + (f ? d : 0)) / Ae.p[0]) / ((c = (c * (Ae.p[0] - 1) + (f ? 0 : -d)) / Ae.p[0]) + 1e-8), Ae.output.splice(0, 0, 100 - 100 / (1 + u));
  9876. i++
  9877. }
  9878. }
  9879. function V(e) {
  9880. var t = _("RSI");
  9881. return e >= 0 && e < Ae.output.length && (t += "(" + ~~Ae.p[0] + "): ", t += Ae.output[e].toFixed(1)), t
  9882. }
  9883. function z() {
  9884. return [{type: Ae.LINE, data: Ae.output[0]}, {type: Ae.LINE, data: Ae.output[1]}]
  9885. }
  9886. function W() {
  9887. return {major: [20, 80], minor: [50]}
  9888. }
  9889. function G(e, t, n) {
  9890. var r, o, i = [], a = 1e15, s = -1e15, l = 0, c = 0, u = 2 / (Ae.p[2] + 1), f = 2 / (Ae.p[3] + 1);
  9891. Ae.output = [[], []];
  9892. var d, p, h = 0, g = [], m = [], v = 0, b = 0, y = 0, x = !1, w = 0;
  9893. for (d = Math.min(e.length - 2, n + 250); d >= t; d--) {
  9894. if (x = e[d][4] > e[d + 1][4], w = e[d][4] - e[d + 1][4], x ? g.push(w) : m.push(-w), h < Ae.p[0]) y = 50; else if (h == Ae.p[0]) {
  9895. for (p = 0; p < g.length; p++) v += g[p];
  9896. for (0 == g.length ? v = 0 : v /= g.length, p = 0; p < m.length; p++) b += m[p];
  9897. 0 == m.length ? b = 0 : b /= m.length, y = 100 - 100 / (1 + v / (b + 1e-8))
  9898. } else y = 100 - 100 / (1 + (v = (v * (Ae.p[0] - 1) + (x ? w : 0)) / Ae.p[0]) / ((b = (b * (Ae.p[0] - 1) + (x ? 0 : -w)) / Ae.p[0]) + 1e-8));
  9899. if (h++, i.splice(0, 0, y), y > s && (s = y), y < a && (a = y), i.length > Ae.p[1] && ((o = i.pop()) >= s || o <= a)) for (a = 1e15, s = -1e15, r = 0; r < i.length; r++) i[r] > s && (s = i[r]), i[r] < a && (a = i[r]);
  9900. c = f * (l = u * (s == a ? 100 : 100 * (y - a) / (s - a)) + (1 - u) * l) + (1 - f) * c, Ae.output[0].splice(0, 0, l), Ae.output[1].splice(0, 0, c)
  9901. }
  9902. }
  9903. function Y(e) {
  9904. var t = "STORSI";
  9905. return t += "(" + ~~Ae.p[0] + ", " + ~~Ae.p[1] + ", " + ~~Ae.p[2] + ", " + ~~Ae.p[3] + ")", e >= 0 && Ae.output.length > 0 && e < Ae.output[0].length && (t += " K:" + Ae.output[0][e].toFixed(digit) + ", ", t += " D:" + Ae.output[1][e].toFixed(digit)), t
  9906. }
  9907. function X() {
  9908. return [{type: Ae.LINE, data: Ae.output}]
  9909. }
  9910. function K(e, t, n) {
  9911. var r, o, i = [], a = 0, s = Ae.p[0];
  9912. for (Ae.output = [], r = Math.min(e.length - 1, n + s); r >= t; r--) o = e[r][4], i.length < s ? (i.push(o), a = (a * (i.length - 1) + o) / i.length) : (a -= i[0] / s, a += o / s, i.splice(0, 1), i.push(o)), Ae.output.splice(0, 0, a)
  9913. }
  9914. function Q(e) {
  9915. var t = _("SMA");
  9916. return e >= 0 && e < Ae.output.length && (t += "(" + ~~Ae.p[0] + "): ", t += Ae.output[e].toFixed(digit)), t
  9917. }
  9918. function J() {
  9919. return [{type: Ae.LINE, data: Ae.output[0]}, {type: Ae.LINE, data: Ae.output[1]}]
  9920. }
  9921. function Z() {
  9922. return {major: [20, 80], minor: [50]}
  9923. }
  9924. function ee(e, t, n) {
  9925. var r, o, i, a, s = [], l = 1e15, c = -1e15, u = 0, f = 0, d = 2 / (Ae.p[1] + 1), p = 2 / (Ae.p[2] + 1);
  9926. for (Ae.output = [[], []], r = Math.min(e.length - 1, n + Ae.p[0]); r >= t; r--) {
  9927. if (i = e[r][4], s.splice(0, 0, i), i > c && (c = i), i < l && (l = i), s.length > Ae.p[0] && ((a = s.pop()) >= c || a <= l)) for (l = 1e15, c = -1e15, o = 0; o < s.length; o++) s[o] > c && (c = s[o]), s[o] < l && (l = s[o]);
  9928. f = p * (u = d * (c == l ? 100 : 100 * (i - l) / (c - l)) + (1 - d) * u) + (1 - p) * f, Ae.output[0].splice(0, 0, u), Ae.output[1].splice(0, 0, f)
  9929. }
  9930. }
  9931. function te(e) {
  9932. var t = "STO";
  9933. return e >= 0 && Ae.output.length > 0 && e < Ae.output[0].length && (t += " %K(" + ~~Ae.p[0] + ", " + ~~Ae.p[1] + "): ", t += Ae.output[0][e].toFixed(1), t += " %D(" + ~~Ae.p[2] + "): ", t += Ae.output[1][e].toFixed(1)), t
  9934. }
  9935. function ne() {
  9936. return [{type: Ae.LINE, data: Ae.output[0]}, {type: Ae.LINE, data: Ae.output[1]}, {
  9937. type: Ae.LINE,
  9938. data: Ae.output[2]
  9939. }]
  9940. }
  9941. function re() {
  9942. return {major: [0, 100], minor: [50]}
  9943. }
  9944. function oe(e, t, n) {
  9945. var r, o, i, a, s = [], l = 1e15, c = -1e15, u = 0, f = 0, d = 0, p = 1 / Ae.p[1], h = 1 / Ae.p[2];
  9946. for (Ae.output = [[], [], []], r = Math.min(e.length - 1, n + Ae.p[0]); r >= t; r--) {
  9947. if (i = e[r][4], s.splice(0, 0, i), i > c && (c = i), i < l && (l = i), s.length > Ae.p[0] && ((a = s.pop()) >= c || a <= l)) for (l = 1e15, c = -1e15, o = 0; o < s.length; o++) s[o] > c && (c = s[o]), s[o] < l && (l = s[o]);
  9948. d = 3 * (u = p * (c == l ? 100 : 100 * (i - l) / (c - l)) + (1 - p) * u) - 2 * (f = h * u + (1 - h) * f), Ae.output[0].splice(0, 0, u), Ae.output[1].splice(0, 0, f), Ae.output[2].splice(0, 0, d)
  9949. }
  9950. }
  9951. function ie(e) {
  9952. var t = "KDJ";
  9953. return t += "(" + ~~Ae.p[0] + ", " + ~~Ae.p[1] + ", " + ~~Ae.p[2] + ")", e >= 0 && Ae.output.length > 0 && e < Ae.output[0].length && (t += " K:" + Ae.output[0][e].toFixed(digit) + ", ", t += " D:" + Ae.output[1][e].toFixed(digit) + ", ", t += " J:" + Ae.output[2][e].toFixed(digit)), t
  9954. }
  9955. function ae(e, t, n) {
  9956. var r, o;
  9957. if (!(void 0 === e || e.length <= t)) {
  9958. for (Ae.max = -1 / 0, r = 0; r <= n - t; r++) {
  9959. (o = e[r + t][5] / BTC_INT) > Ae.max && (Ae.max = o);
  9960. var i = !0;
  9961. i = e[r + t][4] >= e[r + t][1] && !(e[r + t][1] == e[r + t][4] && e[r + t + 1] && e[r + t + 1][4] > e[r + t][4]), Ae.output.push([o, i])
  9962. }
  9963. 0 == Ae.max ? Ae.max = 10 : Ae.max = Ae.max
  9964. }
  9965. }
  9966. function se() {
  9967. return [{type: Ae.LBLHIST, data: Ae.output}]
  9968. }
  9969. function le(e) {
  9970. var t = "";
  9971. return e >= 0 && e < Ae.output.length && (t = _(getLang().volume), t += " " + Ae.output[e][0].toFixed(4)), t
  9972. }
  9973. function ce() {
  9974. return [{type: Ae.LINE, data: Ae.output}]
  9975. }
  9976. function ue(e, t, n) {
  9977. var r, o = 0, i = 0, a = 0;
  9978. for (Ae.output = [], r = Math.min(e.length - 1, n + Ae.p[0]); r >= t; r--) o += e[r][4] * (e[r][5] / BTC_INT), i += e[r][5] / BTC_INT, a >= Ae.p[0] && (o -= e[r + Ae.p[0]][4] * (e[r + Ae.p[0]][5] / BTC_INT), i -= e[r + Ae.p[0]][5] / BTC_INT), Ae.output.splice(0, 0, o / i), a++
  9979. }
  9980. function fe(e) {
  9981. var t = "VWAP";
  9982. return t += "(" + ~~Ae.p[0] + ")", e >= 0 && e < Ae.output.length && (t += ": ", t += Ae.output[e].toFixed(digit)), t
  9983. }
  9984. function de() {
  9985. return {major: [20, 80], minor: [50]}
  9986. }
  9987. function pe() {
  9988. return [{type: Ae.LINE, data: Ae.output}]
  9989. }
  9990. function he(e, t, n) {
  9991. var r, o, i, a, s = [], l = 1e15, c = -1e15, u = 0;
  9992. for (Ae.output = [], r = Math.min(e.length - 1, n + Ae.p[0]); r >= t; r--) {
  9993. if (i = e[r][4], s.splice(0, 0, i), i > c && (c = i), i < l && (l = i), s.length > Ae.p[0] && ((a = s.pop()) >= c || a <= l)) for (l = 1e15, c = -1e15, o = 0; o < s.length; o++) s[o] > c && (c = s[o]), s[o] < l && (l = s[o]);
  9994. u = c == l ? 100 : 100 * (i - l) / (c - l), Ae.output.splice(0, 0, u)
  9995. }
  9996. }
  9997. function ge(e) {
  9998. var t = "Wm %R";
  9999. return t += "(" + ~~Ae.p[0] + ")", e >= 0 && e < Ae.output.length && (t += ": ", t += Ae.output[e].toFixed(1)), t
  10000. }
  10001. function me() {
  10002. return {major: [-5, 5], minor: [0]}
  10003. }
  10004. function ve(e) {
  10005. var t = _("MTM");
  10006. return t += "(" + ~~Ae.p[0] + ")", e >= 0 && Ae.output.length > 0 && e < Ae.output.length && (t += ": ", t += Ae.output[e].toFixed(digit)), t
  10007. }
  10008. function be() {
  10009. return [{type: Ae.LINE, data: Ae.output}]
  10010. }
  10011. function ye(e, t, n) {
  10012. var r;
  10013. for (Ae.min = 1 / 0, Ae.max = -1 / 0, Ae.output = [], r = Math.min(e.length - 1 - Ae.p[0], n); r >= t; r--) {
  10014. var o = e[r][4] - e[r + Ae.p[0]][4];
  10015. o > Ae.max && (Ae.max = o), o < Ae.min && (Ae.min = o), Ae.output.splice(0, 0, o)
  10016. }
  10017. Ae.max = Ae.max + .05 * (Ae.max - Ae.min)
  10018. }
  10019. function xe() {
  10020. return [{type: Ae.LINE, data: Ae.output}]
  10021. }
  10022. function we(e, t, n) {
  10023. var r = 0, o = 0;
  10024. Ae.output = [];
  10025. for (var i = Math.min(e.length - 1, n); i >= t; i--) r += e[i][6], 0 == (o += e[i][5]) ? Ae.output.splice(0, 0, e[i][4]) : Ae.output.splice(0, 0, r / o)
  10026. }
  10027. function $e(e) {
  10028. var t = "";
  10029. return e >= 0 && e < Ae.output.length && (t = _("AVL"), t += Ae.output[e].toFixed(digit)), t
  10030. }
  10031. function ke() {
  10032. return [{type: Ae.LINE, data: Ae.output}]
  10033. }
  10034. function Te(e, t, n) {
  10035. var r = 0, o = 0;
  10036. Ae.output = [];
  10037. for (var i = Math.min(e.length - 1, n); i >= t; i--) r += (e[i][1] + e[i][2] + e[i][3] + e[i][4]) / 4 * e[i][5], 0 == (o += e[i][5]) ? Ae.output.splice(0, 0, e[i][4]) : Ae.output.splice(0, 0, r / o)
  10038. }
  10039. function Se(e) {
  10040. var t = "";
  10041. return e >= 0 && e < Ae.output.length && (t = _("AVL"), t += Ae.output[e].toFixed(digit)), t
  10042. }
  10043. function Ce(e) {
  10044. switch (DEBUG && Ne("Indicator: building " + e), e) {
  10045. case"dmi":
  10046. Ae.shortName = "DMI", Ae.p = [14], Ae.ps = [{
  10047. label: _("Period"),
  10048. type: Ae.V.INT,
  10049. bounds: [2, 1 / 0]
  10050. }], Ae.label = t, Ae.draw = n, Ae.update = r;
  10051. break;
  10052. case"arn":
  10053. Ae.shortName = "Aroon", Ae.min = 0, Ae.max = 100, Ae.p = [25], Ae.ps = [{
  10054. label: _("Period"),
  10055. type: Ae.V.INT,
  10056. bounds: [2, 1 / 0]
  10057. }], Ae.statics = o;
  10058. break;
  10059. case"atr":
  10060. Ae.shortName = "ATR", Ae.p = [14], Ae.ps = [{label: _("Period"), type: Ae.V.INT, bounds: [2, 1 / 0]}];
  10061. break;
  10062. case"bnd":
  10063. Ae.shortName = "Bands", Ae.p = [21, 2], Ae.ps = [{
  10064. label: _("Period"),
  10065. type: Ae.V.INT,
  10066. bounds: [2, 1 / 0]
  10067. }, {
  10068. label: _("z Score"),
  10069. type: Ae.V.FLOAT,
  10070. bounds: [.1, 1 / 0],
  10071. inc: .1,
  10072. places: 1
  10073. }], Ae.draw = i, Ae.update = a, Ae.label = s;
  10074. break;
  10075. case"cci":
  10076. Ae.shortName = "CCI", Ae.min = -250, Ae.max = 250, Ae.p = [20], Ae.ps = [{
  10077. label: _("Period"),
  10078. type: Ae.V.INT,
  10079. bounds: [2, 1 / 0]
  10080. }], Ae.draw = l, Ae.statics = c, Ae.update = u, Ae.label = f;
  10081. break;
  10082. case"dcn":
  10083. Ae.shortName = "Channels", Ae.p = [21], Ae.ps = [{
  10084. label: _("Period"),
  10085. type: Ae.V.INT,
  10086. bounds: [2, 1 / 0]
  10087. }], Ae.draw = d, Ae.update = p, Ae.label = h;
  10088. break;
  10089. case"ema":
  10090. Ae.shortName = "EMA", Ae.p = [5], Ae.ps = [{
  10091. label: _("Period"),
  10092. type: Ae.V.INT,
  10093. bounds: [1, 1 / 0]
  10094. }], Ae.draw = g, Ae.update = m, Ae.label = v;
  10095. break;
  10096. case"ma":
  10097. Ae.shortName = "MA", Ae.p = [5], Ae.ps = [{
  10098. label: _("Period"),
  10099. type: Ae.V.INT,
  10100. bounds: [1, 1 / 0]
  10101. }], Ae.draw = b, Ae.update = y, Ae.label = x;
  10102. break;
  10103. case"trix":
  10104. Ae.shortName = "TRIX", Ae.p = [9], Ae.ps = [{
  10105. label: _("Period"),
  10106. type: Ae.V.INT,
  10107. bounds: [1, 1 / 0]
  10108. }], Ae.draw = S, Ae.update = C, Ae.label = E;
  10109. break;
  10110. case"macd":
  10111. Ae.shortName = "MACD", Ae.p = [12, 26, 9], Ae.ps = [{
  10112. label: "Short EMA",
  10113. type: Ae.V.INT,
  10114. bounds: [2, 1 / 0]
  10115. }, {label: "Long EMA", type: Ae.V.INT, bounds: [2, 1 / 0]}, {
  10116. label: "Signal",
  10117. type: Ae.V.INT,
  10118. bounds: [2, 1 / 0]
  10119. }], Ae.label = O, Ae.draw = A, Ae.statics = N, Ae.update = P;
  10120. break;
  10121. case"mfi":
  10122. Ae.shortName = "MFI", Ae.min = 0, Ae.max = 100, Ae.p = [14], Ae.ps = [{
  10123. label: _("Period"),
  10124. type: Ae.V.INT,
  10125. bounds: [2, 1 / 0]
  10126. }], Ae.statics = D;
  10127. break;
  10128. case"obv":
  10129. Ae.shortName = "OBV", Ae.p = [], Ae.draw = I, Ae.statics = M, Ae.update = L, Ae.label = F;
  10130. break;
  10131. case"emv":
  10132. Ae.shortName = "EMV", Ae.p = [1e4, 14], Ae.ps = [{
  10133. label: "除数",
  10134. type: Ae.V.INT,
  10135. bounds: [2, 1 / 0]
  10136. }, {label: "长度", type: Ae.V.INT, bounds: [2, 1 / 0]}], Ae.draw = w, Ae.statics = $, Ae.update = k, Ae.label = T;
  10137. break;
  10138. case"psar":
  10139. Ae.shortName = "PSAR", Ae.p = [.02, .2], Ae.ps = [{
  10140. label: "AF",
  10141. type: Ae.V.FLOAT,
  10142. bounds: [0, 1],
  10143. inc: .01,
  10144. places: 3
  10145. }, {
  10146. label: "Max AF",
  10147. type: Ae.V.FLOAT,
  10148. bounds: [0, 1],
  10149. inc: .01,
  10150. places: 3
  10151. }], Ae.draw = B, Ae.update = R, Ae.label = j;
  10152. break;
  10153. case"rsi":
  10154. Ae.shortName = "RSI", Ae.min = 0, Ae.max = 100, Ae.p = [14], Ae.ps = [{
  10155. label: _("Period"),
  10156. type: Ae.V.INT,
  10157. bounds: [2, 1 / 0]
  10158. }], Ae.draw = q, Ae.statics = U, Ae.update = H, Ae.label = V;
  10159. break;
  10160. case"storsi":
  10161. Ae.shortName = "STORSI", Ae.min = 0, Ae.max = 100, Ae.p = [14, 9, 3, 3], Ae.ps = [{
  10162. label: "RSI长度",
  10163. type: Ae.V.INT,
  10164. bounds: [1, 1 / 0]
  10165. }, {label: "Stoch长度", type: Ae.V.INT, bounds: [1, 1 / 0]}, {
  10166. label: "平滑%K",
  10167. type: Ae.V.INT,
  10168. bounds: [1, 1 / 0]
  10169. }, {
  10170. label: "平滑%D",
  10171. type: Ae.V.INT,
  10172. bounds: [1, 1 / 0]
  10173. }], Ae.draw = z, Ae.statics = W, Ae.update = G, Ae.label = Y;
  10174. break;
  10175. case"sma":
  10176. Ae.shortName = "SMA", Ae.p = [21], Ae.ps = [{
  10177. label: _("Period"),
  10178. type: Ae.V.INT,
  10179. bounds: [2, 1 / 0]
  10180. }], Ae.draw = X, Ae.update = K, Ae.label = Q;
  10181. break;
  10182. case"sto":
  10183. Ae.shortName = "STO", Ae.min = 0, Ae.max = 100, Ae.p = [14, 3, 3], Ae.ps = [{
  10184. label: "长度",
  10185. type: Ae.V.INT,
  10186. bounds: [1, 1 / 0]
  10187. }, {label: "平滑%K", type: Ae.V.INT, bounds: [1, 1 / 0]}, {
  10188. label: "平滑%D",
  10189. type: Ae.V.INT,
  10190. bounds: [1, 1 / 0]
  10191. }], Ae.draw = J, Ae.statics = Z, Ae.update = ee, Ae.label = te;
  10192. break;
  10193. case"kdj":
  10194. Ae.shortName = "KDJ", Ae.min = -50, Ae.max = 150, Ae.p = [9, 3, 3], Ae.ps = [{
  10195. label: "%K",
  10196. type: Ae.V.INT,
  10197. bounds: [1, 1 / 0]
  10198. }, {label: "%D", type: Ae.V.INT, bounds: [1, 1 / 0]}, {
  10199. label: "%J",
  10200. type: Ae.V.INT,
  10201. bounds: [1, 1 / 0]
  10202. }], Ae.draw = ne, Ae.statics = re, Ae.update = oe, Ae.label = ie;
  10203. break;
  10204. case"vol":
  10205. Ae.shortName = "VOL", Ae.min = 0, Ae.update = ae, Ae.draw = se, Ae.label = le;
  10206. break;
  10207. case"vwap":
  10208. Ae.shortName = "VWAP", Ae.p = [14], Ae.ps = [{
  10209. label: _("Period"),
  10210. type: Ae.V.INT,
  10211. bounds: [1, 1 / 0]
  10212. }], Ae.draw = ce, Ae.update = ue, Ae.label = fe;
  10213. break;
  10214. case"wpr":
  10215. Ae.shortName = "Wm %R", Ae.min = 0, Ae.max = 100, Ae.p = [14], Ae.ps = [{
  10216. label: _("Period"),
  10217. type: Ae.V.INT,
  10218. bounds: [1, 1 / 0]
  10219. }], Ae.draw = pe, Ae.statics = de, Ae.update = he, Ae.label = ge;
  10220. break;
  10221. case"mtm":
  10222. Ae.shortName = "MTM", Ae.p = [14], Ae.ps = [{
  10223. label: _("Period"),
  10224. type: Ae.V.INT,
  10225. bounds: [2, 1 / 0]
  10226. }], Ae.label = ve, Ae.draw = be, Ae.statics = me, Ae.update = ye;
  10227. break;
  10228. case"avl":
  10229. Ae.shortName = "AVL", Ae.draw = xe, Ae.update = we, Ae.label = $e;
  10230. break;
  10231. case"avlIndex":
  10232. Ae.shortName = "AVL", Ae.draw = ke, Ae.update = Te, Ae.label = Se
  10233. }
  10234. Ae.type = e
  10235. }
  10236. function Ee() {
  10237. Ae.output = []
  10238. }
  10239. var Ae = {
  10240. type: "",
  10241. shortName: "IND",
  10242. color: null,
  10243. min: 0,
  10244. max: 1,
  10245. p: [],
  10246. ps: [],
  10247. V: new Validator,
  10248. input: null,
  10249. output: [],
  10250. cache: {i0: -1, i1: -1, t0: -1, values: []},
  10251. CANDLE: 0,
  10252. OHLC: 1,
  10253. HLC: 2,
  10254. LINE: 3,
  10255. MOUNTAIN: 4,
  10256. BANDS: 5,
  10257. PSAR: 6,
  10258. HIST: 7,
  10259. LBLHIST: 8,
  10260. HISTLINE: 9,
  10261. draw: function () {
  10262. return []
  10263. },
  10264. statics: function () {
  10265. return {}
  10266. },
  10267. update: function (e, t, n) {
  10268. },
  10269. label: function (e) {
  10270. return ""
  10271. },
  10272. debug: RTBTC.isDebug()
  10273. }, Ne = RTBTC.debug;
  10274. return {
  10275. build: function (t, n) {
  10276. return Ce(t), e(n), this
  10277. }, reset: function () {
  10278. return Ee(), this
  10279. }, bounds: function () {
  10280. return [Ae.min, Ae.max]
  10281. }, update: function (e, t, n) {
  10282. if (Ae.output = [], void 0 !== e && e.hasOwnProperty("length") && 0 != e.length) return Ae.update(e, t, n), this
  10283. }, draw: function () {
  10284. return Ae.draw()
  10285. }, statics: function () {
  10286. return Ae.statics()
  10287. }, label: function (e) {
  10288. return Ae.label(e)
  10289. }, color: function (e) {
  10290. return void 0 === e ? Ae.color : (Ae.color = e, this)
  10291. }, shortName: function () {
  10292. return Ae.shortName
  10293. }, settings: function () {
  10294. return Ae.p
  10295. }, paramSettings: function () {
  10296. return Ae.ps
  10297. }, params: function (e) {
  10298. }, paramUpdate: function (e, t) {
  10299. return Ae.p[e] = t, this
  10300. }, internals: Ae.debug ? function () {
  10301. return Ae
  10302. } : function () {
  10303. return null
  10304. }
  10305. }
  10306. }, Chart = function () {
  10307. function e() {
  10308. $(bt.element).empty(), bt.w = $(bt.element).width(), bt.h = $(bt.element).height(), DEBUG && yt("#######################_P.w, h: " + bt.w + ", " + bt.h), bt.canvas.base = $("<canvas/>").attr("width", bt.w + "px").attr("height", bt.h + "px").attr("z-index", 100), bt.canvas.bg = $("<canvas/>").attr("width", bt.w + "px").attr("height", bt.h + "px").attr("z-index", 101), bt.canvas.main = $("<canvas/>").attr("width", bt.w + "px").attr("height", bt.h + "px").attr("z-index", 102), bt.canvas.fg = $("<canvas/>").attr("width", bt.w + "px").attr("height", bt.h + "px").attr("z-index", 103), bt.canvas.orders = $("<canvas/>").attr("width", bt.w + "px").attr("height", bt.h + "px").attr("z-index", 104), bt.canvas.lbl = $("<canvas/>").attr("width", bt.w + "px").attr("height", bt.h + "px").attr("z-index", 105), bt.canvas.line = $("<canvas/>").attr("width", bt.w + "px").attr("height", bt.h + "px").attr("z-index", 106).attr("id", "line"), bt.canvas.i = $("<canvas/>").attr("width", bt.w + "px").attr("height", bt.h + "px").attr("z-index", 107), $(bt.element).append(bt.canvas.base).append(bt.canvas.bg).append(bt.canvas.main).append(bt.canvas.fg).append(bt.canvas.orders).append(bt.canvas.lbl).append(bt.canvas.line).append(bt.canvas.i);
  10309. bt.canvas.line[0].getContext("2d")
  10310. }
  10311. function t() {
  10312. var e, t = (bt.slots.length - 1) * (2 + bt.px.pad) + 1 + bt.px.lbl.h, n = bt.h - t, r = -1;
  10313. for (e = 0; e < bt.slots.length; e++) bt.slots[e].hasOwnProperty("main") ? bt.slots[e].h = (bt.mainSlotHeightPercent || .67) * n | 0 : bt.slots[e].h = (1 - bt.mainSlotHeightPercent || .33) * n / (bt.slots.length - 1) | 0, bt.slots[e].px = r, r += bt.slots[e].h + 2 + bt.px.pad + 1, DEBUG && yt("Slot " + e + " height: " + bt.slots[e].h + ", px: " + bt.slots[e].px)
  10314. }
  10315. function n(e) {
  10316. if (t(), void 0 !== e) {
  10317. var n = new Validator, r = (new Validator).create(n.INT), o = (new Validator).create(n.BOOL);
  10318. e.hasOwnProperty("r") && (bt.settings.repaint = o.set(bt.settings.repaint).set(e.r).get()), e.hasOwnProperty("g") && (bt.settings.grid = o.set(bt.settings.grid).set(e.g).get()), e.hasOwnProperty("c") && (bt.settings.crosshairs = o.set(bt.settings.crosshairs).set(e.c).get()), e.hasOwnProperty("k") && (bt.settings.icontrols = o.set(bt.settings.icontrols).set(e.k).get()), e.hasOwnProperty("b") && (bt.settings.bidask = o.set(bt.settings.bidask).set(e.b).get()), e.hasOwnProperty("l") && (bt.settings.logscale = o.set(bt.settings.logscale).set(e.l).get()), e.hasOwnProperty("o") && (bt.settings.userorders = o.set(bt.settings.userorders).set(e.o).get()), e.hasOwnProperty("time") && (bt.settings.time = o.set(bt.settings.userorders).set(e.time).get()), e.hasOwnProperty("m") && (bt.mode.current = r.set(bt.mode.current).set(e.m).get()), e.hasOwnProperty("d") && (bt.mode.display = r.set(bt.mode.display).set(e.d).get()), e.hasOwnProperty("w") && (bt.px.bar.width = r.set(bt.px.bar.width).set(e.w).get()), e.hasOwnProperty("s") && (bt.px.bar.spacing = r.set(bt.px.bar.spacing).set(e.s).get());
  10319. for (var i = r.set(bt.period.avail[bt.period.current]).set(e.t).get(), a = 0; a < bt.period.avail.length; a++) bt.period.avail[a] == i && (bt.period.current = a);
  10320. if (e.hasOwnProperty("i")) {
  10321. var s, l, c, u, f = [], d = ["m", "p", "h"], p = [], h = [];
  10322. for (a in bt.indicators) bt.indicators.hasOwnProperty(a) && p.push(a);
  10323. for (a in bt.overlays) bt.overlays.hasOwnProperty(a) && h.push(a);
  10324. for (a = 0; a < e.i.length; a++) {
  10325. for (l = !0, s = 0; s < d.length; s++) l = l && e.i[a].hasOwnProperty(d[s]);
  10326. if (l) {
  10327. if (c = {px: ~~+e.i[a].p, h: ~~+e.i[a].h}, e.i[a].m) {
  10328. if (c.main = !0, c.o = [], c.u = [], e.i[a].hasOwnProperty("o")) for (s = 0; s < e.i[a].o.length; s++) u = null, e.i[a].o[s].hasOwnProperty("t") && h.indexOf(e.i[a].o[s].t) >= 0 && e.i[a].o[s].hasOwnProperty("s") && (e.i[a].o[s].hasOwnProperty("c") && (u = e.i[a].o[s].c), c.o.push({
  10329. t: e.i[a].o[s].t,
  10330. i: null,
  10331. s: e.i[a].o[s].s,
  10332. c: u
  10333. }));
  10334. if (e.i[a].hasOwnProperty("u")) for (s = 0; s < e.i[a].u.length; s++) e.i[a].u[s].hasOwnProperty("t") && h.indexOf(e.i[a].u[s].t) >= 0 && e.i[a].u[s].hasOwnProperty("s") && (e.i[a].u[s].hasOwnProperty("c") && (u = e.i[a].u[s].c), c.u.push({
  10335. t: e.i[a].u[s].t,
  10336. i: null,
  10337. s: e.i[a].u[s].s,
  10338. c: u
  10339. }))
  10340. } else {
  10341. if (!(p.indexOf(e.i[a].t) >= 0 && e.i[a].hasOwnProperty("r"))) continue;
  10342. c.t = e.i[a].t, c.i = null, c.s = e.i[a].r
  10343. }
  10344. f.push(c)
  10345. }
  10346. }
  10347. f.length > 0 && (bt.slots = f, t())
  10348. }
  10349. }
  10350. }
  10351. function r() {
  10352. var e;
  10353. if (bt.bars.data = [], 0 != bt.period.avail[bt.period.current]) for (bt.bars.data.push([bt.bars.ticks[0][0], bt.bars.ticks[0][1], bt.bars.ticks[0][1], bt.bars.ticks[0][1], bt.bars.ticks[0][1], bt.bars.ticks[0][2]]), e = 1; e < bt.bars.ticks.length; e++) o(bt.bars.ticks[e]); else for (e = 0; e < bt.bars.ticks.length; e++) bt.bars.splice(0, 0, [bt.bars.ticks[e][0], bt.bars.ticks[e][1], bt.bars.ticks[e][1], bt.bars.ticks[e][1], bt.bars.ticks[e][1], bt.bars.ticks[e][2]])
  10354. }
  10355. function o(e) {
  10356. var t = e[0], n = lt();
  10357. 0 == bt.bars.data.length || 0 == n || t >= bt.bars.data[0][0] + 1e3 * n ? (bt.bars.data.splice(0, 0, [t, e[1], e[1], e[1], e[1], e[2]]), bt.flags.recompute = !0) : (e[1] > bt.bars.data[0][2] && (bt.bars.data[0][2] = e[1]), e[1] < bt.bars.data[0][3] && (bt.bars.data[0][3] = e[1]), bt.bars.data[0][4] = e[1], bt.bars.data[0][5] += e[2], bt.flags.recompute = !0), (e[1] > bt.highPrice || e[1] < bt.lowPrice || bt.bars.data[0][5] > bt.maxVol) && (bt.flags.recompute = !0)
  10358. }
  10359. function i(e) {
  10360. var t = parseFloat(e[0]), n = parseFloat(e[1]), r = parseFloat(e[2]);
  10361. return !(isNaN(t) || isNaN(n) || isNaN(r))
  10362. }
  10363. function a() {
  10364. var e, t, n = {};
  10365. for (n.r = bt.settings.repaint, n.g = bt.settings.grid, n.c = bt.settings.crosshairs, n.k = bt.settings.icontrols, n.b = bt.settings.bidask, n.l = bt.settings.logscale, n.o = bt.settings.userorders, n.m = +~~bt.mode.current, n.d = +~~bt.mode.display, n.t = +~~bt.period.avail[bt.period.current], n.w = +~~bt.px.bar.width, n.s = +~~bt.px.bar.spacing, n.i = [], e = 0; e < bt.slots.length; e++) if (bt.slots[e].hasOwnProperty("main")) {
  10366. var r, o = [], i = [];
  10367. for (t = 0; t < bt.slots[e].o.length; t++) r = B(e, t, "o"), o.push({
  10368. t: bt.slots[e].o[t].t,
  10369. s: bt.slots[e].o[t].i.settings(),
  10370. c: r
  10371. });
  10372. for (t = 0; t < bt.slots[e].u.length; t++) r = B(e, t, "u"), i.push({
  10373. t: bt.slots[e].u[t].t,
  10374. s: bt.slots[e].u[t].i.settings(),
  10375. c: r
  10376. });
  10377. n.i.push({m: !0, p: +~~bt.slots[e].px, h: +~~bt.slots[e].h, o: o, u: i})
  10378. } else n.i.push({m: !1, t: bt.slots[e].t, p: +~~bt.slots[e].px, h: +~~bt.slots[e].h, r: bt.slots[e].i.settings()});
  10379. return n
  10380. }
  10381. function s(e) {
  10382. var t = "";
  10383. switch (e) {
  10384. case 0:
  10385. t = "日";
  10386. break;
  10387. case 1:
  10388. t = "一";
  10389. break;
  10390. case 2:
  10391. t = "二";
  10392. break;
  10393. case 3:
  10394. t = "三";
  10395. break;
  10396. case 4:
  10397. t = "四";
  10398. break;
  10399. case 5:
  10400. t = "五";
  10401. break;
  10402. case 6:
  10403. t = "六"
  10404. }
  10405. return t
  10406. }
  10407. function l() {
  10408. $(bt.element).append($('<div id="chartCtrlFixed" class="chartCtrl" hidden><div class="content"><div>时间:<span id="date"></span></div><div>开盘:<span id="open"></span></div><div>最高:<span id="high"></span></div><div>最低:<span id="low"></span></div><div>收盘:<span id="close"></span></div><div>涨幅:<span id="updownPercent" ></span></div><div>振幅:<span id="updown1"></span></div><div>成交量:<span id="volume"></span></div><div>成交额:<span id="quoteVolume"></span></div><div>换手率:<span id="hand"></span></div></div></div>'));
  10409. $(bt.element).mouseover(function () {
  10410. bt.mode.display, bt.CANDLE
  10411. }), $(bt.element).mouseout(function () {
  10412. bt.mode.display == bt.CANDLE && $("#chartCtrlFixed").hide()
  10413. }), bt.updateXFK = function (e) {
  10414. if (e) r = t = [(new Date).getTime(), 0, 0, 0, 0, 0]; else var t = bt.bars.data[bt.curIndex],
  10415. n = bt.curIndex + 1 >= bt.bars.data.length ? bt.curIndex : bt.curIndex + 1, r = bt.bars.data[n];
  10416. var o, i = bt.period.avail[bt.period.current];
  10417. i > 0 && i <= 3600 ? o = new Date(t[0]).Format("MM-dd hh:mm") : 86400 == i ? o = new Date(t[0]).Format("yyyy/MM/dd/") + s(new Date(t[0]).getDay()) : 604800 == i && (o = new Date(t[0]).Format("yyyy-MM-dd")), e && (o = "--"), $("#chartCtrlFixed #date").text(o), $("#chartCtrlFixed #open").text(e ? "--" : Ee(t[1])), $("#chartCtrlFixed #open").css("color", t[1] < r[4] ? "#ff4056" : t[1] > r[4] ? "#34ce6b" : ""), $("#chartCtrlFixed #high").text(e ? "--" : Ee(t[2])), $("#chartCtrlFixed #high").css("color", t[2] < r[4] ? "#ff4056" : t[2] > r[4] ? "#34ce6b" : ""), $("#chartCtrlFixed #low").text(e ? "--" : Ee(t[3])), $("#chartCtrlFixed #low").css("color", t[3] < r[4] ? "#ff4056" : t[3] > r[4] ? "#34ce6b" : ""), $("#chartCtrlFixed #close").text(e ? "--" : Ee(t[4])), $("#chartCtrlFixed #close").css("color", t[4] < r[4] ? "#ff4056" : t[4] > r[4] ? "#34ce6b" : ""), $("#chartCtrlFixed #updownPercent").text(e ? "--" : (100 * (t[4] - r[4]) / r[4]).toFixed(2) + "%"), $("#chartCtrlFixed #updownPercent").css("color", t[4] < r[4] ? "#ff4056" : t[4] > r[4] ? "#34ce6b" : ""), $("#chartCtrlFixed #updown1").text(e ? "--" : (100 * (t[2] - t[3]) / r[4]).toFixed(2) + "%"), $("#chartCtrlFixed #volume").text(e ? "--" : t[5].toFixed(0)), $("#chartCtrlFixed #hand").text(e ? "--" : (100 * (bt.data.circulation ? t[5] / bt.data.circulation : 0)).toFixed(6) + "%")
  10418. }
  10419. }
  10420. function c(e) {
  10421. if (bt.mode.display != bt.CANDLE) {
  10422. var t;
  10423. (t = e < 0 || e > bt.bars.data.length ? [(new Date).getTime(), 0, 0, 0, 0, 0] : bt.bars.data[e]) && ($("#time").text(new Date(t[0]).Format("hh:mm")), $("#price").text(t[4].toFixed(6)), $("#volume").text(t[5].toFixed(0)), $("#updown").text((0 == t[4] ? 0 : t[4] - bt.preClose).toFixed(6)), $("#price").css("color", t[4] >= bt.preClose ? "red" : "green"), $("#updown").css("color", t[4] >= bt.preClose ? "red" : "green"))
  10424. }
  10425. }
  10426. function u() {
  10427. $(bt.element).attr("tabindex", 0).keydown(function (e) {
  10428. if (37 == e.keyCode || 39 == e.keyCode) {
  10429. if (bt.mouse.x < 0 && (bt.mouse.x = 0), bt.mouse.x > Ie(0) && (bt.mouse.x = Ie(0)), 37 == e.keyCode) {
  10430. bt.mode.display, bt.CANDLE;
  10431. var t = bt.mouse.x - bt.px.bar.width - bt.px.bar.spacing;
  10432. (n = _e(t < 0 ? 0 : t)) > bt.bars.visible - 4 ? Re(n) < bt.bars.data.length && (bt.bars.offset++, E()) : (bt.mouse.x -= bt.px.bar.width + bt.px.bar.spacing, bt.mouse.x < 0 && (bt.mouse.x = 0))
  10433. } else if (39 == e.keyCode) {
  10434. var n = _e(bt.mouse.x + bt.px.bar.width + bt.px.bar.spacing);
  10435. 0 == n && bt.bars.offset > 0 ? (bt.bars.offset--, E()) : bt.mouse.x += bt.px.bar.width + bt.px.bar.spacing
  10436. }
  10437. bt.bars.data[Re(_e(bt.mouse.x))] && (bt.mouse.y = De(bt.bars.data[Re(_e(bt.mouse.x))][4], 0)), window.reqAnimFrame(function () {
  10438. oe(bt.mouse.x, bt.mouse.y, !0)
  10439. })
  10440. }
  10441. })
  10442. }
  10443. function f(e) {
  10444. var t = [], n = 0, r = $("<div/>").addClass("control-" + e);
  10445. return t[n++] = '<span class="settings-popout">', t[n++] = '<span class="icon settings">', t[n++] = '<i class="icon-wrench"></i></span>', t[n++] = "</span>", r.addClass("icontrol").html(t.join("")).css("top", bt.slots[e].px + 3 + "px"), r.hide(), 0 == e ? $("span.move-up i", r).addClass("disable") : $("span.move-up", r).tooltip({
  10446. placement: "right",
  10447. title: _("Move Up")
  10448. }).click(function (e) {
  10449. return function () {
  10450. k(e, !0)
  10451. }
  10452. }(e)), $("span.settings", r).tooltip({placement: "right", title: _("Settings")}).click(function (e) {
  10453. return function () {
  10454. d(e)
  10455. }
  10456. }(e)), e == bt.slots.length - 1 && $("span.move-down i", r).addClass("disable"), r
  10457. }
  10458. function d(e) {
  10459. if (!(bt.slots.length <= e || e < 0 || $(".popout .extra-settings").length > 0)) {
  10460. var t = $(".control-" + e, bt.element);
  10461. if (t.click(function (e) {
  10462. e.stopPropagation()
  10463. }), $(document).click(function () {
  10464. $(".extra-settings", t).remove(), $(".colorpicker").hide(), t.data("popped", !1)
  10465. }), t.data("popped")) return $(".extra-settings", t).remove(), t.removeClass("popout"), t.data("popped", !1), void $(".settings", t).tooltip("enable");
  10466. var n = $("<span/>").addClass("extra-settings"), r = [];
  10467. if (bt.slots[e].hasOwnProperty("main")) {
  10468. var o, i, a, s = $("<div/>").addClass("underlays sortable"), l = $("<div/>").addClass("overlays sortable"),
  10469. c = $("<div/>").addClass("rows");
  10470. for (c.append($("<div/>").addClass("title").html(_("Behind Price"))), b = 0; b < bt.slots[e].u.length; b++) {
  10471. for (i = B(e, b, "u"), "bidask" == bt.slots[e].u[b].t && (i = null), a = uniqueID(), o = $("<div/>").addClass("row").addClass("row1").addClass("u" + b).data({
  10472. j: b,
  10473. place: "u"
  10474. }).append($("<span/>").addClass("icon reorder-icon").append($("<i/>").addClass("icon-reorder").css("color", i).attr("id", a))).append($("<u/>").html(bt.slots[e].u[b].i.shortName() + ": ")), u = bt.slots[e].u[b].i.settings(), f = bt.slots[e].u[b].i.paramSettings(), p = "", 0 == u.length && o.append($("<u/>").text(" --- ")), v = 0; v < u.length; v++) p = uniqueID(), o.append($("<span/>").addClass("param-field").append($("<strong/>").text(f[v].hasOwnProperty("label") ? f[v].label : "P" + (v + 1))).append($("<input/>").attr("type", "text").val(u[v]).addClass("param-input").attr("id", p))), r.push({
  10475. val: u[v],
  10476. sel: "#" + p,
  10477. set: f[v],
  10478. fn: function (t, n, r) {
  10479. return function (o) {
  10480. "function" == typeof t && t(n, o), bt.slots[e].u[r].s = [o], E()
  10481. }
  10482. }(bt.slots[e].u[b].i.paramUpdate, v, b)
  10483. });
  10484. p = uniqueID(), o.append($("<span/>").addClass("icon remove-icon").attr("id", p).append($("<i/>").addClass("icon-trash")).click(function (e, t, n, r) {
  10485. return function () {
  10486. $("#" + e).tooltip("hide"), T(t, "u", r), d(r), d(r)
  10487. }
  10488. }(p, b, 0, e)).tooltip({
  10489. placement: "right",
  10490. title: _("Remove")
  10491. })), h = uniqueID(), o.append($("<span/>").addClass("icon edit-icon").attr("id", h).append($("<i/>").addClass("icon-edit")).click(g(h, e, "u", b, a)).tooltip({
  10492. placement: "right",
  10493. title: _("Pick Color")
  10494. })), o.append(clearingSpan()), s.append(o)
  10495. }
  10496. for (c.append(s), c.append($("<div/>").addClass("title").html(_("In Front of Price"))), b = 0; b < bt.slots[e].o.length; b++) {
  10497. for (i = B(e, b, "o"), "bidask" == bt.slots[e].o[b].t && (i = null), a = uniqueID(), o = $("<div/>").addClass("row").addClass("o" + b).data({
  10498. j: b,
  10499. place: "o"
  10500. }).append($("<span/>").addClass("icon reorder-icon").append($("<i/>").addClass("icon-reorder").css("color", i).attr("id", a))).append($("<u/>").html(bt.slots[e].o[b].i.shortName() + ": ")), u = bt.slots[e].o[b].i.settings(), f = bt.slots[e].o[b].i.paramSettings(), p = "", 0 == u.length && o.append($("<u/>").text(" --- ")), v = 0; v < u.length; v++) p = uniqueID(), o.append($("<span/>").addClass("param-field").append($("<strong/>").text(f[v].hasOwnProperty("label") ? f[v].label : "P" + (v + 1))).append($("<input/>").attr("type", "text").val(u[v]).addClass("param-input").attr("id", p))), r.push({
  10501. val: u[v],
  10502. sel: "#" + p,
  10503. set: f[v],
  10504. fn: function (t, n, r) {
  10505. return function (o) {
  10506. "function" == typeof t && t(n, o), bt.slots[e].o[r].s = [o], E()
  10507. }
  10508. }(bt.slots[e].o[b].i.paramUpdate, v, b)
  10509. });
  10510. p = uniqueID(), o.append($("<span/>").addClass("icon remove-icon").attr("id", p).append($("<i/>").addClass("icon-trash")).click(function (e, t, n, r) {
  10511. return function () {
  10512. $("#" + e).tooltip("hide"), T(t, "o", r), d(r), d(r)
  10513. }
  10514. }(p, b, 0, e)).tooltip({
  10515. placement: "right",
  10516. title: _("Remove")
  10517. })), h = uniqueID(), o.append($("<span/>").addClass("icon edit-icon").attr("id", h).append($("<i/>").addClass("icon-edit")).click(g(h, e, "o", b, a)).tooltip({
  10518. placement: "right",
  10519. title: _("Pick Color")
  10520. })), o.append(clearingSpan()), l.append(o)
  10521. }
  10522. c.append(l), n.append(c);
  10523. $(".rows", n), $(".reorder-icon", n), function (e) {
  10524. }($(".rows", n));
  10525. $(".overlays", n).append("<div class='row' style='height:0'></div>"), $(".underlays", n).append("<div class='row' style='height:0'></div>")
  10526. } else {
  10527. n.append($("<span/>").addClass("icon remove-icon").append($("<i/>").addClass("icon-trash")).click(function (e) {
  10528. return function () {
  10529. $(".control-" + e + " .remove-icon", bt.element).tooltip("hide"), S(e)
  10530. }
  10531. }(e)).tooltip({placement: "bottom", title: _("Remove")}));
  10532. for (var u = bt.slots[e].i.settings(), f = bt.slots[e].i.paramSettings(), p = "", h = "", v = 0; v < u.length; v++) p = uniqueID(), n.append($("<span/>").addClass("param-field").append($("<strong/>").text(f[v].hasOwnProperty("label") ? f[v].label : "P" + (v + 1))).append($("<input/>").attr("type", "text").val(u[v]).addClass("param-input").attr("id", p))), r.push({
  10533. val: u[v],
  10534. sel: "#" + p,
  10535. set: f[v],
  10536. fn: function (e, t) {
  10537. return function (n) {
  10538. "function" == typeof e && e(t, n), E()
  10539. }
  10540. }(bt.slots[e].i.paramUpdate, v)
  10541. })
  10542. }
  10543. n.append(clearingSpan()), $(".settings-popout", t).append(n);
  10544. for (var b = 0; b < r.length; b++) $(r[b].sel).data("value", r[b].val), m(e, r[b].sel, r[b].set, r[b].fn, E);
  10545. t.addClass("popout"), $(".settings", t).tooltip("disable"), t.data("popped", !0)
  10546. }
  10547. }
  10548. function p() {
  10549. var e;
  10550. for (e = 0; e < bt.slots.length; e++) $(".control-" + e, bt.element).data("popped") && d(e)
  10551. }
  10552. function h() {
  10553. var e, t;
  10554. for (e = 0; e < bt.slots.length; e++) (t = $(".control-" + e, bt.element)).data("popped") || t.hide()
  10555. }
  10556. function g(e, t, n, r, o) {
  10557. return function () {
  10558. $("#" + e).ColorPicker({
  10559. color: B(t, r, n), onChange: function (e, i, a) {
  10560. R(t, r, n, "#" + i), "o" == n ? bt.flags.redraw.overlay = !0 : "u" == n && (bt.flags.redraw.underlay = !0), window.reqAnimFrame(C), $("#" + o).css("color", "#" + i)
  10561. }, onHide: function () {
  10562. }
  10563. }).ColorPickerShow(), $(".colorpicker").click(function (e) {
  10564. e.stopPropagation()
  10565. })
  10566. }
  10567. }
  10568. function m(e, t, n, r, o, i) {
  10569. new Validator;
  10570. var a = (new Validator).create(n.type), s = n.hasOwnProperty("inc") ? n.inc : 1,
  10571. l = n.hasOwnProperty("places") ? n.places : 0;
  10572. $(t).on({
  10573. keyup: function (o) {
  10574. var i = $(t), c = o.keyCode || o.which, u = {left: 37, up: 38, right: 39, down: 40}, f = {enter: 13, esc: 27},
  10575. p = !1, h = i.data("value");
  10576. switch (c) {
  10577. case u.up:
  10578. h + s <= n.bounds[1] && (i.data("value", h + s), i.val((h + s).toFixed(l)), "function" == typeof r && r(h + s));
  10579. break;
  10580. case u.down:
  10581. h - s >= n.bounds[0] && (i.data("value", h - s), i.val((h - s).toFixed(l)), "function" == typeof r && r(h - s));
  10582. break;
  10583. case f.enter:
  10584. case f.esc:
  10585. o.preventDefault(), o.stopPropagation(), d(e);
  10586. break;
  10587. default:
  10588. p = !0
  10589. }
  10590. if (p) {
  10591. var g = +i.val(), m = a.set(h).set(g).get();
  10592. m != h && (m >= n.bounds[0] && m <= n.bounds[1] ? (i.data("value", m), "function" == typeof r && r(m)) : i.val().length > 0 && i.val(h))
  10593. }
  10594. }, blur: function () {
  10595. 0 == $(t).val().length && $(t).val($(t).data("value")), "function" == typeof o && o()
  10596. }
  10597. })
  10598. }
  10599. function v() {
  10600. var e, t = [], n = [], r = [{val: 0, text: _("Indicator…")}], o = [{val: 0, text: _("Overlay…")}];
  10601. for (e = 0; e < bt.period.avail.length; e++) t.push({val: bt.period.avail[e], text: ut(bt.period.avail[e])});
  10602. for (e = 0; e < bt.mode.avail_display.length; e++) n.push({val: e, text: bt.mode.avail_display[e]});
  10603. for (e in bt.indicators) bt.indicators.hasOwnProperty(e) && r.push({val: e, text: bt.indicators[e]});
  10604. for (e in bt.overlays) bt.overlays.hasOwnProperty(e) && o.push({val: e, text: bt.overlays[e]});
  10605. return [$("<p/>").append(RTBTC.select(bt.period.avail[bt.period.current], t, function (e) {
  10606. bt.period.current = bt.period.avail.indexOf(+e), pt(), E()
  10607. })).append($("<span/>").addClass("control-label").html(_("Time Period"))), $("<p/>").append(RTBTC.select(bt.mode.display, n, function (e) {
  10608. bt.mode.display = +e, E()
  10609. })).append($("<span/>").addClass("control-label").html(_("Draw Style"))), $("<p/>").append(RTBTC.toggle(bt.settings.bidask, function () {
  10610. bt.settings.bidask = !0
  10611. }, function () {
  10612. bt.settings.bidask = !1
  10613. }, function () {
  10614. E()
  10615. })).append($("<span/>").addClass("control-label").html(_("Show Bid / Ask"))), $("<p/>").append(RTBTC.toggle(bt.settings.crosshairs, function () {
  10616. bt.settings.crosshairs = !0
  10617. }, function () {
  10618. bt.settings.crosshairs = !1
  10619. }, function () {
  10620. E()
  10621. })).append($("<span/>").addClass("control-label").html(_("Show Crosshair"))), $("<p/>").append(RTBTC.toggle(bt.settings.grid, function () {
  10622. bt.settings.grid = !0
  10623. }, function () {
  10624. bt.settings.grid = !1
  10625. }, function () {
  10626. E()
  10627. })).append($("<span/>").addClass("control-label").html(_("Show Grid"))), $("<p/>").append(RTBTC.toggle(bt.settings.icontrols, function () {
  10628. bt.settings.icontrols = !0
  10629. }, function () {
  10630. bt.settings.icontrols = !1;
  10631. for (var e = 0; e < bt.slots.length; e++) $(".control-" + e, bt.element).hide().data("popped", !1)
  10632. }, function () {
  10633. E()
  10634. })).append($("<span/>").addClass("control-label").html(_("Show Indicator Controls"))), $("<p/>").append(RTBTC.toggle(bt.settings.logscale, function () {
  10635. bt.settings.logscale = !0
  10636. }, function () {
  10637. bt.settings.logscale = !1
  10638. }, function () {
  10639. E()
  10640. })).append($("<span/>").addClass("control-label").html(_("Logarithmic Scale"))), $("<p/>").append(RTBTC.select(0, o, function (e) {
  10641. 0 != +e && y(e)
  10642. }, !0)).append($("<span/>").addClass("control-label").html(_("Add Overlay"))), $("<p/>").append(RTBTC.select(0, r, function (e) {
  10643. 0 != +e && x(e)
  10644. }, !0)).append($("<span/>").addClass("control-label").html(_("Add Indicator"))), $("<p/>").append(RTBTC.toggle(bt.settings.userorders, function () {
  10645. bt.settings.userorders = !0
  10646. }, function () {
  10647. bt.settings.userorders = !1
  10648. }, function () {
  10649. E()
  10650. })).append($("<span/>").addClass("control-label").html(_("Show User Orders")))]
  10651. }
  10652. function b() {
  10653. var e, t, n;
  10654. for (e = 0; e < bt.slots.length; e++) {
  10655. if (bt.slots[e].hasOwnProperty("main")) {
  10656. for (t = 0; t < bt.slots[e].u.length; t++) n = void 0 !== bt.slots[e].u[t].c && null != bt.slots[e].u[t].c ? bt.slots[e].u[t].c : B(e), bt.slots[e].u[t].i = (new Indicator).build(bt.slots[e].u[t].t, bt.slots[e].u[t].s).color(n);
  10657. for (t = 0; t < bt.slots[e].o.length; t++) n = void 0 !== bt.slots[e].o[t].c && null != bt.slots[e].o[t].c ? bt.slots[e].o[t].c : B(e), bt.slots[e].o[t].i = (new Indicator).build(bt.slots[e].o[t].t, bt.slots[e].o[t].s).color(n)
  10658. } else bt.slots[e].i = (new Indicator).build(bt.slots[e].t, bt.slots[e].s);
  10659. bt.slots[e].control = f(e), $(bt.element).append(bt.slots[e].control)
  10660. }
  10661. }
  10662. function y(e, t) {
  10663. DEBUG && yt("Adding overlay " + e + " to chart.");
  10664. var n = {t: e, i: (new Indicator).build(e), s: []};
  10665. n.s = n.i.settings(), t && n.i.paramUpdate(0, t), n.i.color(bt.colors.stroke.i[bt.lastColorIndex % bt.colors.stroke.i.length]), bt.lastColorIndex++;
  10666. var r, o = -1;
  10667. for (r = 0; r < bt.slots.length; r++) if (bt.slots[r].hasOwnProperty("main")) {
  10668. o = r;
  10669. break
  10670. }
  10671. -1 != o && (bt.slots[o].u.push(n), $(".control-" + o, bt.element).data("popped") && (d(o), d(o)), E())
  10672. }
  10673. function x(e) {
  10674. DEBUG && yt("Adding indicator " + e + " to chart.");
  10675. var n, r = (bt.slots.length - 1) * (2 + bt.px.pad) + 1 + bt.px.lbl.h,
  10676. o = (bt.h, Math.max(bt.slots[bt.slots.length - 1].h * bt.slots.length / (bt.slots.length + 1), bt.px.slotmin)),
  10677. i = 0, a = 0, s = 0, l = !1, c = 0, u = {t: e, h: o, px: 0, i: (new Indicator).build(e), s: []};
  10678. for (u.s = u.i.settings(); i < o;) if (!l && bt.slots[a % bt.slots.length].h <= bt.px.slotmin) ++s == bt.slots.length && (l = !0), a++; else {
  10679. for (s = 0, bt.slots[a % bt.slots.length].h -= 1, i += 1, n = 1 + a % bt.slots.length; n < bt.slots.length; n++) bt.slots[n].px -= 1;
  10680. if (a++, ++c > 1500) {
  10681. DEBUG && yt("Emergency break. nc = " + s + " shrink: " + (l ? "true" : "false")), DEBUG && yt(bt.slots);
  10682. break
  10683. }
  10684. }
  10685. u.px = bt.slots[bt.slots.length - 1].h + 2 + bt.px.pad + 1, bt.slots.push(u);
  10686. for (var d = 1; d <= bt.slots.length - 2; d++) $(".control-" + d, bt.element).remove(), bt.slots[d].control = f(d), $(bt.element).append(bt.slots[d].control);
  10687. bt.slots[bt.slots.length - 1].control = f(bt.slots.length - 1), $(bt.element).append(bt.slots[bt.slots.length - 1].control), t(), ot(), st()
  10688. }
  10689. function k(e, t) {
  10690. if (!(bt.slots.length <= 1) && (0 != e || !t) && (e != bt.slots.length - 1 || t)) {
  10691. DEBUG && yt("Moving indicator in slot " + e + " " + (t ? "up" : "down")), $(".icontrol", bt.element).each(function (e, t) {
  10692. $(t).data("popped") && d(e)
  10693. });
  10694. var n, r, o = t ? e - 1 : e + 1;
  10695. r = bt.slots[o].px, bt.slots[o].px = bt.slots[e].px, bt.slots[e].px = r, n = bt.slots.splice(e, 1)[0], bt.slots.splice(o, 0, n), ot(), st()
  10696. }
  10697. }
  10698. function T(e, t, n) {
  10699. bt.slots[n].hasOwnProperty(t) && (bt.slots[n][t].splice(e, 1), $(".control-" + n + " ." + t + e, bt.element).remove(), E())
  10700. }
  10701. function S(e) {
  10702. if (!bt.slots[e].hasOwnProperty("main")) {
  10703. var t, n = +bt.slots[e].h + bt.px.pad + 3, r = -1;
  10704. for ($(".control-" + (bt.slots.length - 1), bt.element).remove(), $(".icontrol", bt.element).each(function (e, t) {
  10705. $(t).data("popped") && d(e)
  10706. }), t = 0; t < bt.slots.length; t++) if (t != e && (r < 0 && t > e && (bt.slots[t].px -= bt.slots[e].h), bt.slots[t].hasOwnProperty("main"))) {
  10707. r = t, bt.slots[t].h += n;
  10708. break
  10709. }
  10710. for (t = 0; t < bt.slots.length; t++) DEBUG && yt("Slot " + t + " h: " + bt.slots[t].h + ", px: " + bt.slots[t].px);
  10711. bt.slots.splice(e, 1), ot(), st()
  10712. }
  10713. }
  10714. function C() {
  10715. var e = bt.canvas.base[0].getContext("2d"), t = bt.canvas.orders[0].getContext("2d"),
  10716. n = bt.canvas.bg[0].getContext("2d"), r = bt.canvas.main[0].getContext("2d"),
  10717. o = bt.canvas.fg[0].getContext("2d");
  10718. bt.flags.recompute && A(e), bt.flags.redraw.base && (e.clearRect(0, 0, bt.w, bt.h), P(e), bt.flags.redraw.base = !1, bt.settings.userorders ? D(t) : t.clearRect(0, 0, bt.w, bt.h));
  10719. var i, a;
  10720. for ((bt.flags.redraw.inds || bt.flags.redraw.overlay) && (o.clearRect(0, 0, bt.w, bt.h), bt.flags.redraw.inds = !0, bt.flags.redraw.overlay = !0), bt.flags.redraw.underlay && n.clearRect(0, 0, bt.w, bt.h), i = 0; i < bt.slots.length; i++) if (bt.slots[i].hasOwnProperty("main")) {
  10721. if (bt.flags.redraw.main && (r.clearRect(0, 0, bt.w, bt.h), M(r, i), bt.flags.redraw.main = !1), bt.flags.redraw.underlay) {
  10722. for (N(n, i), a = 0; a < bt.slots[i].u.length; a++) j(n, i, bt.slots[i].u[a].i);
  10723. bt.flags.redraw.underlay = !1
  10724. }
  10725. if (bt.flags.redraw.overlay) {
  10726. for (N(o, i), a = 0; a < bt.slots[i].o.length; a++) j(o, i, bt.slots[i].o[a].i);
  10727. bt.flags.redraw.overlay = !1
  10728. }
  10729. } else (bt.flags.redraw.inds || "vol" == bt.slots[i].t) && (N(o, i), j(o, i, bt.slots[i].i));
  10730. bt.flags.redraw.inds = !1, bt.notClicked || 1 == mobile || (o.strokeStyle = "#f9ee30", o.strokeRect(0, 0, bt.w, bt.h))
  10731. }
  10732. function E() {
  10733. var e = lt(), t = 0;
  10734. if (bt.bars.data = [], Data.data.bars[e]) if (1 == bt.bars.fixTime) for (t = 0; t < Data.data.bars[e].length; t++) bt.bars.data.push(Data.data.bars[e][t]); else bt.bars.data = Data.data.bars[e];
  10735. void 0 === bt.bars.data && (DEBUG && yt("No data for " + e), bt.bars.data = []), bt.flags.recompute = !0, C()
  10736. }
  10737. function A(e) {
  10738. if (bt.bars.fixTime) {
  10739. var t, n = new Date(bt.bars.data && bt.bars.data.length > 0 ? bt.bars.data[0][0] : new Date),
  10740. r = new Date(n.getFullYear() + "/" + (n.getMonth() + 1) + "/" + n.getDate() + " " + bt.bars.startTime1),
  10741. o = new Date(n.getFullYear() + "/" + (n.getMonth() + 1) + "/" + n.getDate() + " " + bt.bars.endTime1),
  10742. i = new Date(n.getFullYear() + "/" + (n.getMonth() + 1) + "/" + n.getDate() + " " + bt.bars.startTime2),
  10743. a = new Date(n.getFullYear() + "/" + (n.getMonth() + 1) + "/" + n.getDate() + " " + bt.bars.endTime2);
  10744. t = n <= o && n >= r ? (o.getTime() - n.getTime() + (a - i)) / 6e4 + 1 : n < i && n > o ? (a - i) / 6e4 : n <= a && n >= i ? (a.getTime() - n.getTime()) / 6e4 : n > a ? 0 : (o.getTime() - r.getTime() + a.getTime() - i.getTime()) / 6e4, t = Math.floor(t), bt.bars.blank = t < 0 ? 0 : t, bt.bars.visible = (o.getTime() - r.getTime() + a.getTime() - i.getTime()) / 6e4 + 1, bt.px.bar.spacing = 1
  10745. } else bt.px.bar.spacing = bt.px.bar.width / 3 > 2 ? bt.px.bar.width / 3 : 2, bt.bars.visible = 0 | parseInt((bt.w - bt.px.lbl.tick - bt.px.lbl.w - 1) / (bt.px.bar.width + bt.px.bar.spacing));
  10746. var s, l, c = Be();
  10747. if (c[1] > -1 && (bt.price.high = 0, bt.price.low = 1e15), bt.mode.display == bt.CANDLE) for (s = c[0]; s <= c[1]; s++) bt.bars.data[s][2] > bt.price.high && (bt.price.high = bt.bars.data[s][2]), bt.bars.data[s][3] < bt.price.low && (bt.price.low = bt.bars.data[s][3]); else for (s = c[0]; s <= c[1]; s++) bt.bars.data[s][4] > bt.price.high && (bt.price.high = bt.bars.data[s][4]), bt.bars.data[s][4] < bt.price.low && (bt.price.low = bt.bars.data[s][4]);
  10748. var u = bt.canvas.base[0].getContext("2d");
  10749. u.font = bt.font.labels, bt.px.lbl.w = u.measureText(Ee(10)).width + 8, bt.LblWidthChange && bt.LblWidthChange(bt.px.lbl.w);
  10750. var f = bt.price.high - bt.price.low;
  10751. for (bt.settings.logscale && (bt.price.high = Math.min(1.1 * bt.price.high, bt.price.high + .1 * f), bt.price.low = Math.max(bt.price.low / 1.1, bt.price.low - .1 * f)), bt.price.low < 0 && (bt.price.low = 0), bt.px.bar.dx = (bt.px.bar.width - 1) / 2 | 0, bt.period.string = ut(), s = 0; s < bt.slots.length; s++) if (bt.slots[s].hasOwnProperty("main")) {
  10752. if (bt.settings.logscale) {
  10753. var d = bt.slots[s].px, p = d + bt.slots[s].h;
  10754. try {
  10755. bt.log.m = (d - p) / log10(p1 / p0), bt.log.b = (d * log10(p0) - p * log10(p1)) / log10(p0 / p1)
  10756. } catch (e) {
  10757. bt.log.m = 0, bt.log.b = 0
  10758. }
  10759. }
  10760. bt.price.high, bt.price.low;
  10761. for (l = 0; l < bt.slots[s].o.length; l++) if (bt.slots[s].o[l].hasOwnProperty("i") && (bt.slots[s].o[l].i.update(bt.bars.data, c[0], c[1]), m = bt.slots[s].o[l].i.draw())) for (v = 0; v < m.length; v++) for (var h = m[v].data, g = 0; g < c[1] - c[0]; g++) (b = h[g]) > bt.price.high && (bt.price.high = b), b < bt.price.low && (bt.price.low = b);
  10762. for (l = 0; l < bt.slots[s].u.length; l++) if (bt.slots[s].u[l].hasOwnProperty("i")) {
  10763. "ema" == bt.slots[s].u[l].t && bt.slots[s].u[l].s && bt.slots[s].u[l].i.paramUpdate(0, bt.slots[s].u[l].s[0]), bt.slots[s].u[l].i.update(bt.bars.data, c[0], c[1]);
  10764. var m = bt.slots[s].u[l].i.draw();
  10765. if (m) for (var v = 0; v < m.length; v++) for (var h = m[v].data, g = 0; g < c[1] - c[0]; g++) {
  10766. var b = h[g];
  10767. b > bt.price.high && (bt.price.high = b), b < bt.price.low && (bt.price.low = b)
  10768. }
  10769. }
  10770. } else bt.slots[s].i.update(bt.bars.data, c[0], c[1]);
  10771. var y = bt.slots[0].h, x = 40 * (bt.price.high - bt.price.low) / (y - 40);
  10772. x > (void 0 === Data.qouteFixed ? 1e-5 : Math.pow(.1, Data.qouteFixed - 2)) ? (bt.price.high += 3 * x / 4, bt.price.low -= x / 4) : (bt.price.high = 1.01 * bt.price.high, bt.price.low = bt.price.low / 1.01), bt.price.low < 0 && (bt.price.low = 0), bt.price.range = bt.price.high - bt.price.low, bt.flags.recompute = !1, bt.flags.redraw.base = !0, bt.flags.redraw.main = !0, bt.flags.redraw.underlay = !0, bt.flags.redraw.overlay = !0, bt.flags.redraw.inds = !0
  10773. }
  10774. function N(e, t) {
  10775. e.clearRect(0, bt.slots[t].px - bt.px.pad, bt.w, bt.slots[t].h + 2 * bt.px.pad)
  10776. }
  10777. function P(e, t) {
  10778. void 0 === t && (t = !1);
  10779. var n, r;
  10780. for (e.fillStyle = bt.colors.fill.bg, Pe(e, r = bt.w - bt.px.lbl.w - bt.px.lbl.tick, 0, bt.px.lbl.w + bt.px.lbl.tick, bt.h), Pe(e, 0, 0, bt.offset, bt.h), n = 0; n < bt.slots.length; n++) n < bt.slots.length - 1 ? Pe(e, 0, bt.slots[n].px + bt.slots[n].h + 2, r, bt.px.pad) : Pe(e, 0, bt.slots[n].px + bt.slots[n].h + 2, r, bt.px.lbl.h);
  10781. for (Z(e), e.textAlign = "left", e.textBaseline = "middle", e.font = bt.font.labels, e.fillStyle = bt.colors.fill.label, n = 0; n < bt.slots.length; n++) bt.slots[n].hasOwnProperty("main") ? (e.strokeStyle = bt.colors.stroke.border, e.beginPath(), U(e, n), e.stroke()) : F(e, n), Q(e, n)
  10782. }
  10783. function O() {
  10784. var e = bt.canvas.orders[0].getContext("2d");
  10785. DEBUG && yt("Chart refreshing user orders.");
  10786. try {
  10787. D(e)
  10788. } catch (e) {
  10789. DEBUG && yt("Could not clear user orders"), DEBUG && console.error(e)
  10790. }
  10791. }
  10792. function D(e) {
  10793. void 0 === e && (e = bt.canvas.orders[0].getContext("2d"));
  10794. for (var t = -1, n = 0; n < bt.slots.length; n++) if (bt.slots[n].hasOwnProperty("main")) {
  10795. t = n;
  10796. break
  10797. }
  10798. if (-1 != t) {
  10799. try {
  10800. e.clearRect(0, 0, bt.w, bt.h)
  10801. } catch (e) {
  10802. return
  10803. }
  10804. if (bt.settings.userorders) {
  10805. var r = UserAccount.orders(), o = "", i = "", a = {}, s = [], l = [], c = [], u = [], n = 0, f = 0;
  10806. for (o in r) if (r.hasOwnProperty(o) && o == RTBTC.exchange()) for (i in r[o]) r[o].hasOwnProperty(i) && ((a = r[o][i]).exch = o, a.hasOwnProperty("base") && a.base == RTBTC.base() && a.hasOwnProperty("quote") && a.quote == RTBTC.quote() && ((f = De(a.price, t)) < bt.slots[t].px || f > bt.slots[t].px + bt.slots[t].h || ("buy" == a.action ? (s.push(a), c.push(I(a))) : "sell" == a.action && (l.push(a), u.push(I(a))))));
  10807. if (s.length + l.length > 0 && (e.textAlign = "left", e.font = bt.font.indicators), s.length > 0) {
  10808. for (e.strokeStyle = bt.colors.stroke.bid, e.fillStyle = bt.colors.stroke.bid, e.textBaseline = "top", e.beginPath(), n = 0; n < s.length; n++) ne(e, t, s[n].price, bt.DASHDOT), (f = De(s[n].price, t) + 1) > bt.slots[t].px + bt.slots[t].h - 10 || e.fillText(c[n], 2, f);
  10809. for (e.stroke(), e.font = bt.font.labels, e.textBaseline = "middle", n = 0; n < s.length; n++) e.fillStyle = bt.colors.fill.flags, Te(e, t, s[n].price, Ee(s[n].price))
  10810. }
  10811. if (l.length > 0) {
  10812. for (e.strokeStyle = bt.colors.stroke.ask, e.fillStyle = bt.colors.stroke.ask, e.textBaseline = "top", e.font = bt.font.indicators, e.beginPath(), n = 0; n < l.length; n++) ne(e, t, l[n].price, bt.DASHDOT), f = De(l[n].price, t) + 1, e.fillText(u[n], 2, f);
  10813. for (e.stroke(), e.font = bt.font.labels, e.textBaseline = "middle", n = 0; n < l.length; n++) e.fillStyle = bt.colors.fill.flags, Te(e, t, l[n].price, Ee(l[n].price))
  10814. }
  10815. }
  10816. }
  10817. }
  10818. function I(e) {
  10819. var t = "";
  10820. return "buy" == e.action ? t += _("BUY") : "sell" == e.action ? t += _("SELL") : t += "UNKNOWN ACTION", t += " ", t += parseFloat(e.amount).toFixed(Exchanges.cur_prec(e.exch, e.base))
  10821. }
  10822. function M(e, t) {
  10823. if (void 0 !== bt.bars.data && 0 != bt.bars.data.length) switch (bt.settings.bidask && L(e, t), bt.mode.display) {
  10824. case bt.CANDLE:
  10825. case bt.OHLC:
  10826. case bt.HLC:
  10827. H(e, t, bt.bars.data, bt.mode.display);
  10828. break;
  10829. case bt.LINE:
  10830. case bt.MOUNTAIN:
  10831. V(e, t, bt.bars.data, bt.mode.display == bt.MOUNTAIN, !0, !0)
  10832. }
  10833. }
  10834. function L(e, t) {
  10835. if (!isNaN(bt.price.bid) || !isNaN(bt.price.ask)) {
  10836. var n = bt.price.bid, r = bt.price.ask;
  10837. e.textBaseline = "middle", e.textAlign = "left", e.font = bt.font.labels, e.fillStyle = bt.colors.fill.flags, e.strokeStyle = bt.colors.stroke.ask, e.beginPath(), ne(e, t, r, bt.SOLID), e.stroke(), Te(e, t, r, Ee(r)), e.fillStyle = bt.colors.fill.flags, e.strokeStyle = bt.colors.stroke.bid, e.beginPath(), ne(e, t, n, bt.SOLID), e.stroke(), Te(e, t, n, Ee(n))
  10838. }
  10839. }
  10840. function F(e, t) {
  10841. var n, r, o = bt.slots[t].i.statics(), i = !0, a = bt.slots[t].i.bounds();
  10842. if (e.lineWidth = 1, o.hasOwnProperty("minor")) {
  10843. for (e.strokeStyle = bt.colors.stroke.minorlevel, e.fillStyle = bt.colors.fill.label, e.beginPath(), n = 0; n < o.minor.length; n++) (r = o.minor[n]) < a[0] || r > a[1] || (ne(e, t, r, bt.DASHDOT), xe(e, t, r, Ee(r)));
  10844. for (e.stroke(), e.strokeStyle = bt.colors.stroke.border, e.beginPath(), n = 0; n < o.minor.length; n++) (r = o.minor[n]) < a[0] || r > a[1] || xe(e, t, r, Ee(r));
  10845. e.stroke(), i = !1
  10846. }
  10847. if (o.hasOwnProperty("major")) {
  10848. for (e.strokeStyle = bt.colors.stroke.majorlevel, e.fillStyle = bt.colors.fill.label, e.beginPath(), n = 0; n < o.major.length; n++) (r = o.major[n]) < a[0] || r > a[1] || (ne(e, t, r, bt.SOLID), xe(e, t, r, Ee(r)));
  10849. for (e.stroke(), e.strokeStyle = bt.colors.stroke.border, e.beginPath(), n = 0; n < o.major.length; n++) (r = o.major[n]) < a[0] || r > a[1] || xe(e, t, r, Ee(r));
  10850. e.stroke(), i = !1
  10851. }
  10852. i && (e.strokeStyle = bt.colors.stroke.border, e.beginPath(), U(e, t), e.stroke())
  10853. }
  10854. function B(e, t, n) {
  10855. var r = null, o = bt.colors.stroke.i, i = null;
  10856. return bt.slots[e].hasOwnProperty("main") && void 0 !== n && (i = bt.slots[e][n][t].i), null != i && (r = i.color()), null === r && (void 0 !== t ? r = o[t % o.length] : (r = o[bt.lastColorIndex % o.length], bt.lastColorIndex++)), r
  10857. }
  10858. function R(e, t, n, r) {
  10859. var o = null;
  10860. null != (o = bt.slots[e].hasOwnProperty("main") && void 0 !== n ? bt.slots[e][n][t].i : bt.slots[e].i) && o.color(r)
  10861. }
  10862. function j(e, t, n, r) {
  10863. if (void 0 !== n) {
  10864. var o, i = n.draw(), a = null, s = bt.slots[t].hasOwnProperty("main");
  10865. for (o = 0; o < i.length; o++) switch (a = null, i[o].type) {
  10866. case bt.CANDLE:
  10867. case bt.OHLC:
  10868. case bt.HLC:
  10869. break;
  10870. case bt.LINE:
  10871. s && (a = n.color()), null == a && (a = B(t, o)), e.strokeStyle = a, e.beginPath(), V(e, t, i[o].data, !1, !1), e.stroke();
  10872. break;
  10873. case bt.MOUNTAIN:
  10874. V(e, t, i[o].data, !0, !1);
  10875. break;
  10876. case bt.BANDS:
  10877. break;
  10878. case bt.PSAR:
  10879. s && (a = n.color()), null == a && (a = B(t, o)), e.strokeStyle = a, e.beginPath(), W(e, t, i[o].data), e.stroke();
  10880. break;
  10881. case bt.HIST:
  10882. z(e, t, i[o].data, !0);
  10883. break;
  10884. case bt.LBLHIST:
  10885. z(e, t, i[o].data, !1)
  10886. }
  10887. }
  10888. }
  10889. function q(e) {
  10890. var t, n, r, o, i, a = bt.canvas.lbl[0].getContext("2d"), s = ~~(1.25 * bt.px.lbl.font), l = Be(), c = Re(0),
  10891. u = Re(e), f = (bt.colors.stroke.i, bt.w - bt.px.lbl.tick - bt.px.lbl.w - 2);
  10892. l[0], l[1];
  10893. c < 0 && (e += c), e < 0 && (e = -1), a.strokeStyle = bt.colors.fill.blankBG, a.lineWidth = 1.5, a.fillStyle = bt.colors.fill.slottext, a.textBaseline = "top", a.font = bt.font.indicators;
  10894. var d = 3 + bt.offset, p = 3 + bt.offset;
  10895. for (a.clearRect(0, 0, bt.w, bt.h), t = 0; t < bt.slots.length; t++) if (bt.slots[t].hasOwnProperty("main")) {
  10896. if (o = ae(u), r = bt.slots[t].px + 1, a.strokeText(o, p, r, f), a.fillText(o, p, r, f), p = 6 + bt.offset + a.measureText(o).width, 1 == bt.colors.stroke.priceShow) {
  10897. var h = bt.w - bt.px.lbl.tick - bt.px.lbl.w, g = bt.canvas.base[0].getContext("2d"),
  10898. m = h - g.measureText(Ee(bt.price.high)).width - 3, p = h - g.measureText(Ee(bt.price.low)).width - 3;
  10899. a.clearRect(m, r, f, 13), a.strokeText(Ee(bt.price.high), m, r, f), a.fillText(Ee(bt.price.high), m, r, f);
  10900. var v = bt.slots[t].h - 14;
  10901. a.strokeText(Ee(bt.price.low), p, v, f), a.fillText(Ee(bt.price.low), p, v, f)
  10902. }
  10903. for (n = 0; n < bt.slots[t].u.length; n++) if ((i = bt.slots[t].u[n].i).hasOwnProperty("label")) {
  10904. if (r + s > bt.slots[t].px + bt.slots[t].h) break;
  10905. 1 != mobile ? (o = i.label(e), a.fillStyle = B(t, n, "u"), p + a.measureText(o).width + 2 > f && (r += s, p = 2), a.fillText(o, p, r, f), p += a.measureText(o).width + 2) : (o = i.label(e), a.fillStyle = B(t, n, "u"), a.fillText(o, d, r, f), r += s)
  10906. }
  10907. for (n = 0; n < bt.slots[t].o.length; n++) if ((i = bt.slots[t].o[n].i).hasOwnProperty("label")) {
  10908. if ((r += s) + s > bt.slots[t].px + bt.slots[t].h) break;
  10909. 1 != mobile ? (o = i.label(e), a.fillStyle = B(t, n, "o"), p + a.measureText(o).width + 2 > f && (r += s, p = 2), a.fillText(o, p, 0, f), p += a.measureText(o).width + 2) : (o = i.label(e), a.fillStyle = B(t, n, "o"), a.fillText(o, d, r, f))
  10910. }
  10911. a.fillStyle = bt.colors.fill.flagtext
  10912. } else {
  10913. if (!(i = bt.slots[t].i).hasOwnProperty("label")) continue;
  10914. o = i.label(e), r = bt.slots[t].px + 1, a.fillText(o, d, r, f)
  10915. }
  10916. }
  10917. function U(e, t) {
  10918. var n, r, o, i, a, s, l, c, u, f, d, p, h, g, m = [], v = 0, b = 0, y = [5, 2.5, 2];
  10919. if (bt.slots[t].hasOwnProperty("main")) r = bt.price.high, o = bt.price.low; else {
  10920. var x = bt.slots[t].i.bounds();
  10921. o = x[0], r = x[1]
  10922. }
  10923. if (!((n = r - o) < 0 || (i = ~~(bt.slots[t].h / (4 * bt.px.lbl.font)), (a = n / i) < 0))) {
  10924. for (c = Math.log(a) / Math.LN10, s = Math.pow(10, c > 0 ? ~~c : Math.floor(c)), .5, v = 0; v < y.length; v++) (h = Math.log(a / s / (y[v] / 10)) / Math.LN10) > 1 && m.push([s * y[v], Math.abs(.5 - h), h]);
  10925. for (0 == m.length && m.push([s, 0, 0]), l = 1e8, v = 0; v < m.length; v++) m[v][1] < l && (l = m[v][1], a = m[v][0]);
  10926. if (u = ~~(r / a) * a, f = bt.w - bt.px.lbl.tick - bt.px.lbl.w, d = De(u, t), p = De(o, t) - bt.px.lbl.font / 2 | 0, 1 != t) {
  10927. if (bt.slots[t].hasOwnProperty("main") && 0 != bt.offset) {
  10928. e.textAlign = "right";
  10929. for (v = 0; v <= 6; v++) {
  10930. var w = bt.price.low + v * (bt.price.high - bt.price.low) / 6, $ = De(w, t);
  10931. e.textBaseline = 6 == v ? "top" : 0 == v ? "bottom" : "middle", e.fillText((100 * (bt.preClose ? w / bt.preClose - 1 : 0)).toFixed(2) + "%", bt.offset - 3, $, bt.offset - 3)
  10932. }
  10933. e.textAlign = "start"
  10934. }
  10935. for (v = 0, 2; u >= o && d < p && v < 100;) {
  10936. for (d >= bt.slots[t].px + bt.px.lbl.font / 2 && (we(e, f, d, Ee(u)), bt.settings.grid && re(e, d, bt.DASHED), b++), g = 0; g < 2; g++) $e(e, t, u - (g + 1) * a / 3);
  10937. d = De(u -= a, t), v++
  10938. }
  10939. 0 == b && we(e, f, d = De(u = o + n / 2, t), Ee(u))
  10940. } else we(e, f, $ = De(r, t), r.toFixed(2))
  10941. }
  10942. }
  10943. function H(e, t, n, r) {
  10944. var o, i, a, s, l = Be(), c = null, u = [], f = [];
  10945. switch (o = n.length - 1 > l[1] ? n[l[1] + 1] : n[l[1]], r) {
  10946. case bt.CANDLE:
  10947. c = G;
  10948. break;
  10949. case bt.OHLC:
  10950. c = Y;
  10951. break;
  10952. case bt.HLC:
  10953. c = X;
  10954. break;
  10955. default:
  10956. return
  10957. }
  10958. var d, p, h = 0, g = 1e5;
  10959. for (i = l[1]; i >= l[0]; i--) n[i][4] >= n[i][1] ? n[i][1] == n[i][4] && n[i + 1] && n[i + 1][4] > n[i][1] ? f.push([i, je(i)]) : u.push([i, je(i)]) : f.push([i, je(i)]), o = n[i], n[i][2] >= h && (h = n[i][2], d = i), n[i][3] <= g && (g = n[i][3], p = i);
  10960. for (e.strokeStyle = bt.colors.stroke.down, e.fillStyle = bt.colors.fill.down, e.beginPath(), i = 0; i < f.length; i++) (a = n[f[i][0]].slice())[5] /= BTC_INT, c(e, t, f[i][1], a, !0);
  10961. for (e.stroke(), e.strokeStyle = bt.colors.stroke.up, e.fillStyle = bt.colors.fill.up, e.beginPath(), i = 0; i < u.length; i++) (a = deepCopy(n[u[i][0]]))[5] /= BTC_INT, c(e, t, u[i][1], a, !1);
  10962. if (e.stroke(), s = o[4], n.length >= 2 && n[1][4] > n[0][4] && (e.strokeStyle = bt.colors.stroke.down), e.fillStyle = bt.colors.fill.flags, e.textBaseline = "middle", e.font = bt.font.labels, Te(e, t, s, Ee(s)), r == bt.CANDLE) {
  10963. e.textBaseline = "middle", e.fillStyle = bt.colors.stroke.arrow;
  10964. var m = De(h, t), v = Ie(je(d)), b = De(g, t), y = Ie(je(p)), x = e.measureText(Ee(h)).width + 19,
  10965. w = e.measureText(Ee(g)).width + 21;
  10966. v - x > 0 ? (Ve(e, 0, 0, v - 15, m, v - 2, m), e.fillText(Ee(h), v - x, m)) : (Ve(e, 0, 0, v + 15, m, v + 2, m), e.fillText(Ee(h), v + 19, m)), y - w > 0 ? (Ve(e, 0, 0, y - 15, b, y - 2, b), e.fillText(Ee(g), y - x, b)) : (Ve(e, 0, 0, y + 15, b, y + 2, b), e.fillText(Ee(g), y + 19, b))
  10967. }
  10968. }
  10969. function V(e, t, n, r, o, i) {
  10970. if (void 0 !== n && n.hasOwnProperty("length") && n.length > 0) {
  10971. var a, s, l, c, u, f, d = Be();
  10972. if (!r) {
  10973. if (c = Ie(je(d[1])), u = o ? De(n[d[1]][4], t) : De(n[d[1] - d[0]], t), o) {
  10974. var p = [], h = {};
  10975. for ((l = []).push(d[1]), c = Ie(je(d[1])), u = De(n[d[1]][4], t), h[d[1]] = [+c, +u], a = d[1] - 1; a >= d[0]; a--) c = Ie(je(a)), u = De(n[a][4], t), n[a + 1][4] <= n[a][4] ? l.push(a) : p.push(a), h[a] = [+c, +u];
  10976. for (f = n.length + 2, e.lineWidth = 1, e.strokeStyle = bt.colors.stroke.fenshi || bt.colors.stroke.down, e.beginPath(), s = 0; s < p.length; s++) (a = p[s]) < f - 1 && h.hasOwnProperty(a + 1) && Ae(e, h[a + 1][0], h[a + 1][1]), Ne(e, h[a][0], h[a][1]), f = a;
  10977. for (e.stroke(), e.strokeStyle = bt.colors.stroke.fenshi || bt.colors.stroke.up, e.beginPath(), f = n.length + 2, a = 0; a < l.length; a++) l[a] < f - 1 && h.hasOwnProperty(l[a] + 1) && Ae(e, h[l[a] + 1][0], h[l[a] + 1][1]), Ne(e, h[l[a]][0], h[l[a]][1]), f = l[a];
  10978. e.stroke(), n.length > 1 ? e.strokeStyle = n[1][4] <= n[0][4] ? bt.colors.stroke.up : bt.colors.stroke.down : e.strokeStyle = l, f = n[0][4]
  10979. } else {
  10980. var g = !1;
  10981. for (Ae(e, c, u), a = d[1] - d[0]; a >= 0; a--) c = Ie(je(a + d[0])), (u = De(n[a], t)) >= bt.slots[t].px && u <= bt.slots[t].px + bt.slots[t].h ? g ? (g = !1, e.beginPath(), Ae(e, c, u)) : Ne(e, c, u) : g || (e.stroke(), g = !0);
  10982. f = n[0], e.stroke()
  10983. }
  10984. e.lineWidth = 1, e.fillStyle = bt.colors.fill.flags, e.textBaseline = "middle", e.font = bt.font.labels, i && Te(e, t, f, Ee(f))
  10985. }
  10986. }
  10987. }
  10988. function z(e, t, n, r) {
  10989. if (void 0 !== n && n.hasOwnProperty("length") && n.length > 0) {
  10990. var o, i, a = Be(), s = [], l = [];
  10991. if (r) for (o = 0; o <= a[1] - a[0]; o++) n[o] > 0 ? s.push([o, je(o + a[0])]) : l.push([o, je(o + a[0])]); else for (o = 0; o <= a[1] - a[0]; o++) n && void 0 !== n[o] && (n[o][1] ? s.push([o, je(o + a[0])]) : l.push([o, je(o + a[0])]));
  10992. for (e.strokeStyle = bt.colors.stroke.down, e.fillStyle = bt.colors.fill.down, e.beginPath(), o = 0; o < l.length; o++) K(e, t, l[o][1], r ? n[l[o][0]] : n[l[o][0]][0], !1);
  10993. for (e.stroke(), e.strokeStyle = bt.colors.stroke.up, e.fillStyle = bt.colors.fill.up, e.beginPath(), o = 0; o < s.length; o++) K(e, t, s[o][1], r ? n[s[o][0]] : n[s[o][0]][0]);
  10994. e.stroke(), r ? (i = n[0]) < 0 && (e.strokeStyle = bt.colors.stroke.down) : (i = n[0][0], n[0][1] || (e.strokeStyle = bt.colors.stroke.down)), e.lineWidth = 1, e.fillStyle = bt.colors.fill.flags, e.textBaseline = "middle", e.font = bt.font.labels, Te(e, t, i, Ee(i)), e.stroke()
  10995. }
  10996. }
  10997. function W(e, t, n) {
  10998. if (n.hasOwnProperty("length") && n.length > 0) {
  10999. var r, o, i, a = Be(), s = bt.slots[t].px + 3, l = s + bt.slots[t].h - 3;
  11000. for (r = 0; r <= a[1] - a[0]; r++) o = Ie(je(r + a[0])), (i = De(n[r], t)) < s || i > l || Oe(e, o - 1, i - 1, 2, 2)
  11001. }
  11002. }
  11003. function G(e, t, n, r, o) {
  11004. var i = De(r[1], t), a = De(r[2], t), s = De(r[3], t), l = De(r[4], t), c = Math.min(i, l), u = Ie(n);
  11005. o ? 1 == mobile && Pe(e, u - bt.px.bar.dx + 1, c, bt.px.bar.width - 2, Math.abs(l - i)) : bt.colors.stroke.fillUp && Pe(e, u - bt.px.bar.dx + 1, Math.min(i, l), bt.px.bar.width - 2, Math.abs(i - l)), Oe(e, u - bt.px.bar.dx, Math.min(i, l), bt.px.bar.width - 1, Math.abs(i - l)), a < Math.min(i, l) && (Ae(e, u, a), Ne(e, u, Math.min(i, l) - 1)), s > Math.max(i, l) && (Ae(e, u, s), Ne(e, u, Math.max(i, l))), o && Pe(e, u - bt.px.bar.dx, c, bt.px.bar.width - 1, Math.abs(l - i))
  11006. }
  11007. function Y(e, t, n, r) {
  11008. var o = De(r[1], t), i = De(r[2], t), a = De(r[3], t), s = De(r[4], t), l = Ie(n);
  11009. Ae(e, l - bt.px.bar.dx, o), Ne(e, l, o), Ae(e, l, s), e.lineTo(.6 + (l + bt.px.bar.dx | 0), .5 + (0 | s)), Ae(e, l, i), Ne(e, l, a)
  11010. }
  11011. function X(e, t, n, r) {
  11012. var o = De(r[2], t), i = De(r[3], t), a = De(r[4], t), s = Ie(n);
  11013. Ae(e, s, a), e.lineTo(.6 + (s + bt.px.bar.dx | 0), .5 + (0 | a)), Ae(e, s, o), Ne(e, s, i)
  11014. }
  11015. function K(e, t, n, r, o) {
  11016. var i = De(r, t), a = Ie(n), s = De(0, t), l = Math.abs(s - i), c = Math.min(i, s);
  11017. i < bt.slots[t].px ? i = bt.slots[t].px : i > bt.slots[t].px + bt.slots[t].h && (i = bt.slots[t].px + bt.slots[t].h), Oe(e, a - bt.px.bar.dx, c, bt.px.bar.width - 1 <= 0 ? 0 : bt.px.bar.width - 1, l), !1 === o ? Pe(e, a - bt.px.bar.dx + 1, c + 1, bt.px.bar.width - 2 <= 0 ? 0 : bt.px.bar.width - 2, l) : bt.colors.stroke.fillUp && Pe(e, a - bt.px.bar.dx + 1, c + 1, bt.px.bar.width - 2 <= 0 ? 0 : bt.px.bar.width - 2, l)
  11018. }
  11019. function Q(e, t) {
  11020. e.lineWidth = mobile ? 2 : 1, e.strokeStyle = bt.colors.stroke.border;
  11021. var n = bt.offset - 1, r = bt.slots[t].px - 1, o = bt.w - bt.px.lbl.w - bt.offset - bt.px.lbl.tick,
  11022. i = bt.slots[t].h + 2;
  11023. Oe(e, n <= 0 ? 0 : n, r <= 0 ? 0 : r, o - (n <= 0 ? -n : 0), i - (r <= 0 ? -r : 0))
  11024. }
  11025. function J(e) {
  11026. for (var t = 1; t <= 5; t++) re(e, De(t * (bt.price.high - bt.price.low) / 6 + bt.price.low, 0), bt.DOTTED)
  11027. }
  11028. function Z(e) {
  11029. bt.w;
  11030. var t, n, r, o, i, a, s, l, c, u = lt(), f = Settings.localTime, d = [];
  11031. if (ge(e, !0), e.strokeStyle = bt.colors.stroke.grid, e.lineWidth = 1, a = e.measureText("00:00").width, s = e.measureText("12/30").width, e.measureText("Jan").width, l = 1.25 * a, (c = 2 * Math.ceil(l / (bt.px.bar.width + bt.px.bar.spacing))) <= 0 && (c = 1), e.beginPath(), u < 14400) {
  11032. for (n = 0; ; n++) if (!((o = Re(n)) < 0)) {
  11033. if (o >= bt.bars.data.length) break;
  11034. if (i = bt.bars.data[o][0], he(i, f)) {
  11035. if (d.push(n), 1 == de(i, f) ? 1 == ce(i, f) ? me(e, le(i, f), n) : me(e, ue(i, f), n) : me(e, fe(i, !1, f), n), bt.settings.grid) for (r = 0; r < bt.slots.length; r++) ;
  11036. if (n > bt.bars.visible) break;
  11037. n += c - 1
  11038. }
  11039. }
  11040. if (0 == d.length && d.push(je(bt.bars.data.length - 1)), e.stroke(), e.beginPath(), ge(e, !1), e.strokeStyle = bt.colors.stroke.grid, bt.bars.fixTime) {
  11041. var p = new Date,
  11042. h = new Date(p.getFullYear() + "/" + (p.getMonth() + 1) + "/" + p.getDate() + " " + bt.bars.startTime1),
  11043. g = new Date(p.getFullYear() + "/" + (p.getMonth() + 1) + "/" + p.getDate() + " " + bt.bars.endTime1),
  11044. m = new Date(p.getFullYear() + "/" + (p.getMonth() + 1) + "/" + p.getDate() + " " + bt.bars.startTime2),
  11045. v = new Date(p.getFullYear() + "/" + (p.getMonth() + 1) + "/" + p.getDate() + " " + bt.bars.endTime2),
  11046. b = g.getTime() - h.getTime();
  11047. b /= 6e4;
  11048. var y = g.getTime() - h.getTime() + v.getTime() - m.getTime();
  11049. y /= 6e4;
  11050. var x = Math.ceil(y / bt.w * 17);
  11051. Math.ceil(y / bt.w * bt.offset);
  11052. for (me(e, pe(i = v.getTime(), !1, f), x + Math.ceil(y / bt.w * 2)), me(e, pe(i = (v.getTime() + m.getTime()) / 2, !1, f), 60), me(e, pe(i = g.getTime(), !1, f), 120), me(e, pe(i = (g.getTime() + h.getTime()) / 2, !1, f), 180), me(e, pe(i = h.getTime(), !1, f), 240 - x), bt.mode.display != bt.CANDLE && J(e), r = 0; r < bt.slots.length; r++) ee(e, r, 0, bt.DOTTED);
  11053. for (r = 0; r < bt.slots.length; r++) ee(e, r, y / 4, bt.DOTTED);
  11054. for (r = 0; r < bt.slots.length; r++) ee(e, r, b + 1, bt.DOTTED);
  11055. for (r = 0; r < bt.slots.length; r++) ee(e, r, y + 1, bt.DOTTED);
  11056. for (r = 0; r < bt.slots.length; r++) ee(e, r, 3 * y / 4 + 1, bt.DOTTED)
  11057. } else for (t = d.length - 1; t >= 0; t--) for (n = d[t] - c; ; n -= c) if (!(n > bt.bars.visible)) {
  11058. if (0 == t && n < 0) break;
  11059. if ((o = Re(n)) < 0) break;
  11060. if (!(o >= bt.bars.data.length)) {
  11061. if (bt.settings.grid) for (r = 0; r < bt.slots.length; r++) ;
  11062. if (n <= d[t - 1]) break;
  11063. if (t > 0 && Ie(n) + a / 2 >= Ie(d[t - 1]) - s / 2) break;
  11064. me(e, pe(i = bt.bars.data[o][0], !1, f), n)
  11065. }
  11066. }
  11067. e.stroke()
  11068. } else if (u < 86400) {
  11069. var w = -1, $ = -1;
  11070. for (n = 0; ; n++) if (!((o = Re(n)) < 0)) {
  11071. if (o >= bt.bars.data.length - 1) break;
  11072. if (i = bt.bars.data[o][0], $ = de(i, f), w = de(bt.bars.data[o + 1][0], f), u > 86400 && ce(i, f) != ce(bt.bars.data[o + 1][0], f) || w > 1 && 1 == $) {
  11073. if (d.push(n), 1 == ce(i, f) ? me(e, le(i, f), n) : me(e, ue(i, f), n), bt.settings.grid) for (r = 0; r < bt.slots.length; r++) ;
  11074. if (d[d.length - 1] > bt.bars.visible) break;
  11075. n += c - 1
  11076. }
  11077. }
  11078. for (d.push(je(bt.bars.data.length - 1)), e.stroke(), e.beginPath(), ge(e, !1), e.strokeStyle = bt.colors.stroke.grid, t = d.length - 1; t >= 0; t--) for (n = d[t] - c; ; n -= c) if (!(n > bt.bars.visible)) {
  11079. if (0 == t && n < 0) break;
  11080. if ((o = Re(n)) < 0) break;
  11081. if (!(o >= bt.bars.data.length)) {
  11082. if (bt.settings.grid) for (r = 0; r < bt.slots.length; r++) ;
  11083. if (n <= d[t - 1]) break;
  11084. if (t > 0 && Ie(n) + a / 2 >= Ie(d[t - 1]) - s / 2) break;
  11085. me(e, he(i = bt.bars.data[o][0], f) ? u < 86400 ? de(i, f) : fe(i, !1, f) : pe(i, !1, f), n)
  11086. }
  11087. }
  11088. e.stroke()
  11089. } else if (u < 2592e3) {
  11090. var w = -1, $ = -1;
  11091. for (n = 0; ; n++) if (!((o = Re(n)) < 0)) {
  11092. if (o >= bt.bars.data.length - 1) break;
  11093. if (i = bt.bars.data[o][0], $ = de(i, f), w = de(bt.bars.data[o + 1][0], f), u > 86400 && ce(i, f) != ce(bt.bars.data[o + 1][0], f) || w > 1 && 1 == $) {
  11094. if (d.push(n), 1 == ce(i, f) ? me(e, le(i, f), n) : me(e, ue(i, f), n), bt.settings.grid) for (r = 0; r < bt.slots.length; r++) ;
  11095. if (d[d.length - 1] > bt.bars.visible) break;
  11096. n += c - 1
  11097. }
  11098. }
  11099. for (d.push(je(bt.bars.data.length - 1)), e.stroke(), e.beginPath(), ge(e, !1), e.strokeStyle = bt.colors.stroke.grid, t = d.length - 1; t >= 0; t--) for (n = d[t] - c; ; n -= c) if (!(n > bt.bars.visible)) {
  11100. if (0 == t && n < 0) break;
  11101. if ((o = Re(n)) < 0) break;
  11102. if (!(o >= bt.bars.data.length)) {
  11103. if (bt.settings.grid) for (r = 0; r < bt.slots.length; r++) ;
  11104. if (n <= d[t - 1]) break;
  11105. if (t > 0 && Ie(n) + a / 2 >= Ie(d[t - 1]) - s / 2) break;
  11106. i = bt.bars.data[o][0], me(e, u < 86400 ? de(i, f) : fe(i, !1, f), n)
  11107. }
  11108. }
  11109. e.stroke()
  11110. }
  11111. }
  11112. function ee(e, t, n, r) {
  11113. te(e, t, Ie(n), r)
  11114. }
  11115. function te(e, t, n, r) {
  11116. var o, i = bt.slots[t].px - 1, a = bt.slots[t].px + bt.slots[t].h;
  11117. if (DEBUG && assert(a > i, "Invalid bounds on vertical line drawing. y0:" + i + ", y1:" + a), a > i && !(a < 0 || n < 0 || n > bt.w || n > 25e3)) switch (Ae(e, n, i), o = i, r) {
  11118. case bt.DOTTED:
  11119. for (; o < a;) Ne(e, n, ++o), Ae(e, n, ++o);
  11120. break;
  11121. case bt.DASHED:
  11122. for (; o < a;) Ne(e, n, o = (o += 6) > a ? a : o), Ae(e, n, o += 2);
  11123. break;
  11124. case bt.DASHDOT:
  11125. for (; o < a && (o += 7, o = o > a ? a : o, Ne(e, n, o), !((o += 4) >= a));) Ae(e, n, o), Ne(e, n, o = (o += 2) > a ? a : o), Ae(e, n, o += 4);
  11126. break;
  11127. case bt.SOLID:
  11128. default:
  11129. Ne(e, n, a)
  11130. }
  11131. }
  11132. function ne(e, t, n, r) {
  11133. var o = De(n, t);
  11134. o < bt.slots[t].px || o > bt.slots[t].px + bt.slots[t].h || re(e, o, r)
  11135. }
  11136. function re(e, t, n) {
  11137. var r, o = bt.w - bt.px.lbl.tick - bt.px.lbl.w - 1, i = bt.offset;
  11138. if (DEBUG && assert(o > i, "Invalid bounds on line drawing. x0: " + o + ", x1: " + i), o > i) switch (Ae(e, o, t), r = o, n) {
  11139. case bt.DOTTED:
  11140. for (; r > i + 1;) Ne(e, --r, t), Ae(e, --r, t);
  11141. break;
  11142. case bt.DASHED:
  11143. for (; r > i;) Ne(e, r = (r -= 6) < i ? i : r, t), Ae(e, r -= 2, t);
  11144. break;
  11145. case bt.DASHDOT:
  11146. for (; r > i && (r -= 7, r = r < i ? i : r, Ne(e, r, t), !((r -= 4) <= i));) Ae(e, r, t), Ne(e, r = (r -= 2) < i ? i : r, t), Ae(e, r -= 4, t);
  11147. break;
  11148. case bt.SOLID:
  11149. default:
  11150. Ne(e, i, t)
  11151. }
  11152. }
  11153. function oe(e, t, n) {
  11154. if (bt.settings.crosshairs && !(e < bt.offset)) {
  11155. var r = bt.canvas.i[0].getContext("2d"), o = _e(e), i = qe(e, t);
  11156. if (!(null == i || i < 0)) {
  11157. var a, s = Fe(i, t), l = Re(o), c = Ie(o);
  11158. if (ie(r), r.textBaseline = "middle", r.textAlign = "left", r.font = bt.font.labels, r.lineWidth = 1, r.fillStyle = bt.colors.fill.crosshair, r.strokeStyle = bt.colors.stroke.crosshair, r.beginPath(), bt.showMainCrosshairs) for (bt.crossHairH && re(r, t, bt.SOLID), a = 0; a < bt.slots.length; a++) te(r, a, c, bt.SOLID);
  11159. if (r.stroke(), r.fillStyle = bt.colors.fill.crosshair, bt.crossHairH && (n && (s = bt.bars.data[l] && bt.bars.data[l][4] || 0), Se(r, i, t, Ee(s))), mobile && bt.updateXFK && bt.updateXFK(!0), l >= 0 && l < bt.bars.data.length) {
  11160. ge(r, !0);
  11161. var u = se(bt.bars.data[l][0], !1, Settings.localTime), f = r.measureText(u).width, d = r.fillStyle,
  11162. p = r.strokeStyle;
  11163. r.fillStyle = bt.colors.fill.crosshair, r.strokeStyle = bt.colors.stroke.crosshair, ye(r, o, 0 | f), r.fillStyle = d, r.strokeStyle = p, ve(r, u, be(Ie(o), f + 10)), q(o)
  11164. }
  11165. bt.px.crosshairs.x = c, bt.px.crosshairs.y = t, bt.mouse.bar = o
  11166. }
  11167. }
  11168. }
  11169. function ie(e) {
  11170. if (bt.settings.crosshairs) {
  11171. var t = e || bt.canvas.i[0].getContext("2d");
  11172. t.clearRect(0, bt.px.crosshairs.y - 30, bt.w, 60), t.clearRect(bt.px.crosshairs.x - 30, 0, 60, bt.h), t.clearRect(0, bt.h - bt.px.lbl.h - 4, bt.w, bt.px.lbl.h + 4), bt.mouse.bar = null, bt.canvas.lbl[0].getContext("2d").clearRect(0, 0, bt.w, bt.h)
  11173. }
  11174. }
  11175. function ae(e) {
  11176. if (bt.curIndex = e, c(e), e < 0 || e >= bt.bars.data.length) return "";
  11177. if (0 != qe(bt.mouse.x, bt.mouse.y) && 1 != qe(bt.mouse.x, bt.mouse.y) && 2 != qe(bt.mouse.x, bt.mouse.y) && 3 != qe(bt.mouse.x, bt.mouse.y) || (bt.curIndex = e, mobile && bt.updateXFK && bt.updateXFK(!1)), void 0 === bt.bars.data[e]) return "";
  11178. var t = bt.bars.data[e][0], n = bt.bars.data[e][1], r = bt.bars.data[e][2], o = bt.bars.data[e][3],
  11179. i = bt.bars.data[e][4], a = (bt.bars.data[e][5], []), s = bt.bars.data[e + 1];
  11180. return a = [se(t, !1, Settings.localTime), " ", " O:", Ee(n), " H:", Ee(r), " L:", Ee(o), " C:", Ee(i), " CHANGE:", (s ? 100 * (i - s[4]) / s[4] : 0).toFixed(2) + "%", " AMPLITUDE:", (s ? 100 * (r - o) / s[4] : 0).toFixed(2) + "%"], "cn" == localStorage.lang && (a = [se(t, !1, Settings.localTime), " ", " 开:", Ee(n), " 高:", Ee(r), " 低:", Ee(o), " 收:", Ee(i), " 涨幅:", (s ? 100 * (i - s[4]) / s[4] : 0).toFixed(2) + "%", " 振幅:", (s ? 100 * (r - o) / s[4] : 0).toFixed(2) + "%"]), mobile ? "" : a.join("")
  11181. }
  11182. function se(e, t, n) {
  11183. var r = new Date(e), o = "";
  11184. return !0 === n ? (o = r.getFullYear() + "-", o += r.getMonth() + 1 < 10 ? "0" : "", o += r.getMonth() + 1 + "-", o += r.getDate() < 10 ? "0" : "", o += r.getDate() + " ", o += r.getHours() < 10 ? "0" : "", o += r.getHours() + ":", o += r.getMinutes() < 10 ? "0" : "", o += r.getMinutes(), t && (o += (r.getSeconds(), "0"), o += r.getSeconds())) : (o = r.getUTCFullYear() + "-", o += r.getUTCMonth() + 1 < 10 ? "0" : "", o += r.getUTCMonth() + 1 + "-", o += r.getUTCDate() < 10 ? "0" : "", o += r.getUTCDate() + " ", o += r.getUTCHours() < 10 ? "0" : "", o += r.getUTCHours() + ":", o += r.getUTCMinutes() < 10 ? "0" : "", o += r.getUTCMinutes(), t && (o += (r.getUTCSeconds(), "0"), o += r.getUTCSeconds())), o
  11185. }
  11186. function le(e, t) {
  11187. var n = new Date(e);
  11188. return !0 === t ? n.getFullYear() : n.getUTCFullYear()
  11189. }
  11190. function ce(e, t) {
  11191. var n = new Date(e);
  11192. return !0 === t ? n.getMonth() + 1 : n.getUTCMonth() + 1
  11193. }
  11194. function ue(e, t) {
  11195. var n = new Date(e);
  11196. return !0 === t ? kt[n.getMonth()] : kt[n.getUTCMonth()]
  11197. }
  11198. function fe(e, t, n) {
  11199. var r = new Date(e), o = "";
  11200. return !0 === n ? (t && (o = r.getFullYear() + "/"), o += r.getMonth() + 1 + "/", o += r.getDate()) : (t && (o = r.getUTCFullYear() + "/"), o += r.getUTCMonth() + 1 + "/", o += r.getUTCDate()), o
  11201. }
  11202. function de(e, t) {
  11203. var n = new Date(e), r = "";
  11204. return r += !0 === t ? n.getDate() : n.getUTCDate()
  11205. }
  11206. function pe(e, t, n) {
  11207. var r = new Date(e), o = "";
  11208. return !0 === n ? (o = r.getHours() + ":", o += r.getMinutes() < 10 ? "0" : "", o += r.getMinutes(), t && (o += ":" + (r.getSeconds() < 10 ? "0" : ""), o += r.getSeconds())) : (o = r.getUTCHours() + ":", o += r.getUTCMinutes() < 10 ? "0" : "", o += r.getUTCMinutes(), t && (o += ":" + (r.getUTCSeconds() < 10 ? "0" : ""), o += r.getUTCSeconds())), o
  11209. }
  11210. function he(e, t) {
  11211. if (!0 === t) {
  11212. var n = new Date(e);
  11213. return 0 == n.getHours() && 0 == n.getMinutes() && 0 == n.getSeconds()
  11214. }
  11215. return e % 86400 == 0
  11216. }
  11217. function ge(e, t) {
  11218. e.textBaseline = "bottom", e.textAlign = "center";
  11219. var n = bt.font.size + "px/" + bt.font.lineHeight + "em " + bt.font.face;
  11220. t ? (n += " bold", e.fillStyle = bt.colors.stroke.crosshair) : e.fillStyle = bt.colors.fill.label, e.font = n
  11221. }
  11222. function me(e, t, n) {
  11223. var r = bt.h - (bt.px.lbl.h - bt.px.lbl.font) / 2, o = Ie(n);
  11224. e.fillText(t, o, r)
  11225. }
  11226. function ve(e, t, n) {
  11227. var r = bt.h - (bt.px.lbl.h - bt.px.lbl.font) / 2;
  11228. e.fillText(t, n, r)
  11229. }
  11230. function be(e, t) {
  11231. return e > bt.w - bt.px.lbl.w - bt.px.lbl.tick - 1 - t / 2 ? bt.w - bt.px.lbl.w - bt.px.lbl.tick - 1 - t / 2 : e < t / 2 ? t / 2 : e
  11232. }
  11233. function ye(e, t, n) {
  11234. var r = Ie(t), o = 0 | be(r, n + 10), i = n / 2 + 5 | 0, a = be(r, 7);
  11235. e.beginPath(), Ae(e, o - i, bt.h - 1), Ne(e, o + i, bt.h - 1), Ne(e, o + i, bt.h - bt.px.lbl.h), Ne(e, a + 3.5, bt.h - bt.px.lbl.h), Ne(e, a, bt.h - bt.px.lbl.h - 4), Ne(e, a - 3.5, bt.h - bt.px.lbl.h), Ne(e, o - i, bt.h - bt.px.lbl.h), Ne(e, o - i, bt.h - 1), e.fill(), e.stroke()
  11236. }
  11237. function xe(e, t, n, r) {
  11238. var o = De(n, t);
  11239. we(e, bt.w - bt.px.lbl.tick - bt.px.lbl.w, o, r)
  11240. }
  11241. function we(e, t, n, r) {
  11242. Ae(e, t, n), Ne(e, t + bt.px.lbl.tick, n), e.fillText(r, t + bt.px.lbl.tick + 2, n, bt.px.lbl.w)
  11243. }
  11244. function $e(e, t, n) {
  11245. var r = De(n, t);
  11246. ke(e, bt.w - bt.px.lbl.tick - bt.px.lbl.w, r)
  11247. }
  11248. function ke(e, t, n) {
  11249. Ae(e, t, n), Ne(e, t + bt.px.lbl.halftick, n)
  11250. }
  11251. function Te(e, t, n, r) {
  11252. if (1 != bt.colors.stroke.opacity) {
  11253. var o, i = De(n, t), a = bt.w - bt.px.lbl.tick - bt.px.lbl.w - 3;
  11254. i < (o = bt.slots[t].px + 1 + Math.ceil(bt.px.lbl.font / 2)) ? i = o : i > (o = bt.slots[t].px + bt.slots[t].h - Math.ceil(bt.px.lbl.font / 2)) && (i = o), Ce(e, a, i, r)
  11255. }
  11256. }
  11257. function Se(e, t, n, r) {
  11258. var o, i = bt.w - bt.px.lbl.tick - bt.px.lbl.w - 3;
  11259. n < (o = bt.slots[t].px + 1 + Math.ceil(bt.px.lbl.font / 2)) ? n = o : n > (o = bt.slots[t].px + bt.slots[t].h - Math.ceil(bt.px.lbl.font / 2)) && (n = o), Ce(e, i, n, r)
  11260. }
  11261. function Ce(e, t, n, r) {
  11262. var o, i, a = bt.px.lbl.font / 2;
  11263. e.beginPath(), Ae(e, t, n), Ne(e, o = t + ~~a, i = ~~(n - 1 - a)), o = t + bt.px.lbl.w + bt.px.lbl.tick + 1, e.lineTo(.6 + (0 | o), .5 + (0 | i)), Ae(e, o, i), Ne(e, o, i = Math.ceil(n + 1 + a)), Ne(e, o = t + ~~a, i), Ne(e, t, n), e.fill(), e.stroke(), e.fillStyle = bt.colors.fill.flagtext, e.fillText(r, t + bt.px.lbl.tick + 5, n + 1)
  11264. }
  11265. function Ee(e) {
  11266. return e.toFixed(Data.qouteFixed || 8)
  11267. }
  11268. function Ae(e, t, n) {
  11269. e.moveTo(.5 + (0 | t), .5 + (0 | n))
  11270. }
  11271. function Ne(e, t, n) {
  11272. e.lineTo(.5 + (0 | t), .5 + (0 | n))
  11273. }
  11274. function Pe(e, t, n, r, o) {
  11275. e.fillRect(0 | t, 0 | n, 0 | r, 0 | o)
  11276. }
  11277. function Oe(e, t, n, r, o) {
  11278. e.strokeRect(.5 + (0 | t), .5 + (0 | n), 0 | r, 0 | o)
  11279. }
  11280. function De(e, t) {
  11281. var n, r = null;
  11282. if (bt.slots[t].hasOwnProperty("main")) {
  11283. if (r = [bt.price.low, bt.price.high], bt.settings.logscale) return bt.log.m * log10(e) + bt.log.b;
  11284. n = bt.price.range
  11285. } else r = bt.slots[t].i.bounds(), n = Math.max(r[1] - r[0], 1e-8);
  11286. var o = (r[1] - e) / n;
  11287. return bt.slots[t].px + Math.ceil(bt.slots[t].h * o)
  11288. }
  11289. function Ie(e) {
  11290. var t = Be();
  11291. return bt.bars.visible > bt.bars.data.length ? Me(e) - Me(t[1]) + (bt.px.bar.width + 1) / 2 : Me(e)
  11292. }
  11293. function Me(e) {
  11294. return bt.w - bt.px.lbl.w - bt.px.lbl.tick - 1 - (e + 1) * (bt.px.bar.spacing + bt.px.bar.width) + (bt.px.bar.width + 1) / 2 | 0
  11295. }
  11296. function _e(e) {
  11297. var t = Be();
  11298. return bt.bars.visible > bt.bars.data.length ? t[1] - (e - (bt.px.bar.spacing + bt.px.bar.width) / 2) / (bt.px.bar.spacing + bt.px.bar.width) | 0 : Le(e)
  11299. }
  11300. function Le(e) {
  11301. return (bt.w - bt.px.lbl.w - bt.px.lbl.tick - 1 - bt.px.bar.spacing / 2 - e) / (bt.px.bar.spacing + bt.px.bar.width) | 0
  11302. }
  11303. function Fe(e, t) {
  11304. var n = null;
  11305. if (bt.slots[e].hasOwnProperty("main")) {
  11306. if (bt.settings.logscale) return Math.pow(10, (t - bt.log.b) / bt.log.m);
  11307. n = [bt.price.low, bt.price.high]
  11308. } else n = bt.slots[e].i.bounds();
  11309. var r = Math.max(n[1] - n[0], 1e-8), o = (t - bt.slots[e].px) / bt.slots[e].h;
  11310. return n[1] - o * r
  11311. }
  11312. function Be() {
  11313. return void 0 === bt.bars.data || 0 == bt.bars.data.length ? [0, -1] : [Math.max(0, Re(0)), Math.min(bt.bars.data.length - 1, Re(bt.bars.visible))]
  11314. }
  11315. function Re(e) {
  11316. return e + bt.bars.offset - bt.bars.blank
  11317. }
  11318. function je(e) {
  11319. return e - bt.bars.offset + bt.bars.blank
  11320. }
  11321. function qe(e, t) {
  11322. if (e >= bt.w - bt.px.lbl.w - bt.px.lbl.tick - 1) return null;
  11323. if (e < bt.offset) return null;
  11324. if (t >= bt.h - bt.px.lbl.h - 1) return null;
  11325. if (t <= bt.slots[0].px + bt.slots[0].h) return 0;
  11326. for (var n = 1; n < bt.slots.length; n++) {
  11327. if (t < bt.slots[n].px) return -n;
  11328. if (t <= bt.slots[n].px + bt.slots[n].h) return n
  11329. }
  11330. }
  11331. function Ue(e, t) {
  11332. return !(t < bt.h - bt.px.lbl.h) && (!(e > bt.w - bt.px.lbl.w) && !(e < bt.offset))
  11333. }
  11334. function He() {
  11335. bt.settings.crosshairs && window.reqAnimFrame(function () {
  11336. ie()
  11337. })
  11338. }
  11339. function Ve(e, t, n, r, o, i, a) {
  11340. var s = new Array(r, o), l = new Array(i, a);
  11341. e.fillStyle = bt.colors.stroke.arrow, e.strokeStyle = bt.colors.stroke.arrow, e.beginPath(), e.translate(t, n, 0), e.moveTo(s[0], s[1]), e.lineTo(l[0], l[1]), e.fill(), e.stroke(), e.save(), e.translate(l[0], l[1]);
  11342. var c = (l[0] - s[0]) / (l[1] - s[1]);
  11343. c = Math.atan(c), l[1] - s[1] >= 0 ? e.rotate(-c) : e.rotate(Math.PI - c), e.lineTo(-5, -10), e.lineTo(0, -5), e.lineTo(5, -10), e.lineTo(0, 0), e.fill(), e.restore(), e.closePath()
  11344. }
  11345. function ze() {
  11346. bt.canvas.i.on({
  11347. mousedown: function (e) {
  11348. if (!bt.stopEvent && !mobile) {
  11349. bt.mouse.origOffset = bt.bars.offset, bt.mouse.origOffsetBlank = bt.bars.blank, bt.mouse.origSpacing = bt.px.bar.spacing, Ge(e), bt.mouse.sx = bt.mouse.x, bt.mouse.sy = bt.mouse.y, wt = e.offsetX, $t = e.offsetY;
  11350. var t = qe(bt.mouse.x, bt.mouse.y);
  11351. if (null == t ? (Ue(bt.mouse.x, bt.mouse.y) ? (bt.canvas.i.css("cursor", "e-resize"), bt.mouse.zoom = !0, bt.mouse.w0 = +bt.px.bar.width) : bt.canvas.i.css("cursor", "default"), He()) : t < 0 ? (bt.canvas.i.css("cursor", "n-resize"), bt.mouse.resize = !0, bt.mouse.re_slot = -t, bt.mouse.re_slots.px0 = bt.slots[bt.mouse.re_slot - 1].px, bt.mouse.re_slots.h0 = bt.slots[bt.mouse.re_slot - 1].h, bt.mouse.re_slots.px1 = bt.slots[bt.mouse.re_slot].px, bt.mouse.re_slots.h1 = bt.slots[bt.mouse.re_slot].h, He()) : (bt.mouse.down = !0, He(), bt.settings.crosshairs ? (bt.canvas.i.css("cursor", "none"), window.reqAnimFrame(function () {
  11352. oe(bt.mouse.x, bt.mouse.y)
  11353. })) : bt.canvas.i.css("cursor", "crosshair")), bt.settings.icontrols && t != bt.mouse.slot) {
  11354. null != t && t >= 0 && $(".control-" + t, bt.element).show();
  11355. var n, r;
  11356. for (n = 0; n < bt.slots.length; n++) n != t && ((r = $(".control-" + n, bt.element)).data("popped") || r.hide())
  11357. }
  11358. bt.mouse.slot = t, tt(e), e.preventDefault(), e.stopPropagation()
  11359. }
  11360. }, mouseup: function (e) {
  11361. bt.stopEvent || mobile || (bt.mouse.down = !1, bt.mouse.resize = !1, bt.mouse.zoom = !1, Math.abs(wt - e.offsetX) < 1 && Math.abs($t - e.offsetY) < 1 && (bt.notClicked = !bt.notClicked, $(bt.element).focus(), E()), tt(e), Ue(bt.mouse.x, bt.mouse.y) ? bt.canvas.i.css("cursor", "e-resize") : bt.canvas.i.css("cursor", "none"), e.ctrlKey && e.shiftKey && (qe(bt.mouse.x, bt.mouse.y) >= 0 && bt.settings.crosshairs && (bt.canvas.i.css("cursor", "none"), oe(bt.mouse.x, bt.mouse.y)), vt()))
  11362. }, contextmenu: function (e) {
  11363. return Ge(e), qe(bt.mouse.x, bt.mouse.y) >= 0 && bt.settings.crosshairs && (bt.canvas.i.css("cursor", "none"), oe(bt.mouse.x, bt.mouse.y)), vt(), e.stopPropagation(), e.preventDefault(), !1
  11364. }, mouseout: function (e) {
  11365. bt.mouse.down = !1, bt.mouse.resize = !1, bt.mouse.zoom = !1, bt.canvas.i.css("cursor", "none"), He(), bt.mouse.slot = -1
  11366. }, mousemove: function (e) {
  11367. if (!mobile && ((bt.mouse.down || bt.mouse.resize || bt.mouse.zoom) && (bt.flags.recompute = !0, tt(e)), e.offsetY != Tt || e.offsetX != St)) {
  11368. Tt = e.offsetY, St = e.offsetX, Ge(e);
  11369. var t = qe(bt.mouse.x, bt.mouse.y);
  11370. bt.canvas.i[0].getContext("2d");
  11371. if (null == t ? (Ue(bt.mouse.x, bt.mouse.y) ? bt.canvas.i.css("cursor", "e-resize") : bt.canvas.i.css("cursor", "default"), He()) : t < 0 ? (bt.canvas.i.css("cursor", "n-resize"), He()) : bt.settings.crosshairs ? (bt.canvas.i.css("cursor", "none"), window.reqAnimFrame(function () {
  11372. oe(bt.mouse.x, bt.mouse.y)
  11373. })) : bt.canvas.i.css("cursor", "crosshair"), bt.settings.icontrols && t != bt.mouse.slot) {
  11374. null != t && t >= 0 && $(".control-" + t, bt.element).show();
  11375. var n, r;
  11376. for (n = 0; n < bt.slots.length; n++) n != t && ((r = $(".control-" + n, bt.element)).data("popped") || r.hide())
  11377. }
  11378. bt.mouse.slot = t, (bt.mouse.down || bt.mouse.resize || bt.mouse.zoom) && (bt.mouse.down || bt.mouse.zoom ? $(bt.canvas.i).css("cursor", "e-resize") : bt.canvas.i.css("cursor", "n-resize"))
  11379. }
  11380. }, dblclick: function (e) {
  11381. bt.stopEvent || (bt.mode.display, bt.CANDLE, bt.mouse.down = !1)
  11382. }, touchstart: function (e) {
  11383. if (1 == e.originalEvent.touches.length && (timeOutEvent = setTimeout(function () {
  11384. xt = !0, Xe(e), $(".chartDetail").show(), $("html,body", parent.document).addClass("hidden")
  11385. }, 300)), bt.mouse.origOffset = bt.bars.offset, bt.mouse.origSpacing = bt.px.bar.spacing, e.originalEvent.touches[0].clientX) bt.mouse.sx = e.originalEvent.touches[0].clientX, bt.mouse.sy = e.originalEvent.touches[0].clientY; else if (e.originalEvent.touches[0].pageX) {
  11386. var t = bt.canvas.i.offset();
  11387. bt.mouse.sx = e.originalEvent.touches[0].pageX - t.left, bt.mouse.sy = e.originalEvent.touches[0].pageY - t.top
  11388. }
  11389. bt.startTouchCoords = [];
  11390. for (var n = 0; n < e.originalEvent.touches.length; ++n) bt.startTouchCoords.push([e.originalEvent.touches[n].clientX, e.originalEvent.touches[n].clientY])
  11391. }, touchmove: function (e) {
  11392. var t, n;
  11393. if (e.originalEvent.touches[0].clientX) t = e.originalEvent.touches[0].clientX, n = e.originalEvent.touches[0].clientY; else if (e.originalEvent.touches[0].pageX) {
  11394. var r = bt.canvas.i.offset();
  11395. t = e.originalEvent.touches[0].pageX - r.left, n = e.originalEvent.touches[0].pageY - r.top
  11396. }
  11397. (Math.abs(bt.mouse.sx - t) > 6 || Math.abs(bt.mouse.sy - n) > 6) && clearTimeout(timeOutEvent), 0 != xt ? Xe(e) : Ke(e)
  11398. }, touchend: function (e) {
  11399. clearTimeout(timeOutEvent), xt = !1, $(".chartDetail").hide(), $("html,body", parent.document).removeClass("hidden"), Qe(e), He()
  11400. }
  11401. }), bt.canvas.i.bind("mousewheel", We), bt.canvas.i.bind("pinch", Ye), RTBTC.handler("barclose", bt.element, ht)
  11402. }
  11403. function We(e, t, n, r) {
  11404. if (!(bt.stopEvent || bt.notClicked || (stopEvent(e), isNaN(n) || isNaN(r)))) {
  11405. if (0 != n && (bt.mouse.origOffset = bt.bars.offset, bt.bars.offset -= n, nt(), bt.bars.offset != bt.mouse.origOffset && (E(), et())), 0 != r) {
  11406. var o = bt.px.bar.width;
  11407. bt.px.bar.width += r, rt(), bt.px.bar.width < 2 && (bt.px.bar.width = 2), bt.px.bar.width > 51 && (bt.px.bar.width = 51), bt.px.bar.width != o && (nt(), E(), et())
  11408. }
  11409. localStorage.barWidth = bt.px.bar.width
  11410. }
  11411. }
  11412. function Ge(e) {
  11413. if (e.offsetX) bt.mouse.x = e.offsetX, bt.mouse.y = e.offsetY; else if (e.pageX) {
  11414. var t = bt.canvas.i.offset();
  11415. bt.mouse.x = e.pageX - t.left, bt.mouse.y = e.pageY - t.top
  11416. }
  11417. }
  11418. function Ye(e, t) {
  11419. if (null != t.scale) {
  11420. w = bt.px.bar.width;
  11421. var n = Math.round(bt.px.bar.width * t.scale);
  11422. bt.px.bar.width = n + (n + 1) % 2, bt.px.bar.width < 2 && (bt.px.bar.width = 2), bt.px.bar.width > 51 && (bt.px.bar.width = 51), bt.px.bar.width != w && (nt(), E(), et()), bt.lastPinchTime = (new Date).getTime()
  11423. }
  11424. t.originalEvent.preventDefault(), t.originalEvent.stopPropagation()
  11425. }
  11426. function Xe(e) {
  11427. e.pageX = e.originalEvent.touches[0].pageX, e.pageY = e.originalEvent.touches[0].pageY, Ge(e);
  11428. var t = qe(bt.mouse.x, bt.mouse.y);
  11429. bt.canvas.i[0].getContext("2d");
  11430. null == t ? He() : t < 0 ? (bt.canvas.i.css("cursor", "n-resize"), He()) : bt.settings.crosshairs ? (bt.canvas.i.css("cursor", "none"), window.reqAnimFrame(function () {
  11431. oe(bt.mouse.x, bt.mouse.y)
  11432. })) : bt.canvas.i.css("cursor", "crosshair"), bt.mouse.slot = t, e.originalEvent.preventDefault(), e.originalEvent.stopPropagation()
  11433. }
  11434. function Ke(e) {
  11435. if (bt.bars.allowScale = !0, !((new Date).getTime() - bt.lastPinchTime < 1e3)) if (2 != e.originalEvent.touches.length || 2 != bt.startTouchCoords.length) e.originalEvent.touches.length > 1 || (new Date).getTime() - bt.lastZoomTime < 1e3 || (bt.flags.recompute = !0, bt.bars.offset = bt.mouse.origOffset + Math.round((e.originalEvent.touches[0].clientX - bt.mouse.sx) / (bt.px.bar.width + bt.px.bar.spacing)), nt(), bt.bars.offset != bt.mouse.origOffset && (E(), et()), bt.canvas.i.css("cursor", "e-resize")); else {
  11436. var t = Math.sqrt(Math.pow(bt.startTouchCoords[0][0] - bt.startTouchCoords[1][0], 2) + Math.pow(bt.startTouchCoords[0][1] - bt.startTouchCoords[1][1], 2)),
  11437. n = Math.sqrt(Math.pow(e.originalEvent.touches[0].clientX - e.originalEvent.touches[1].clientX, 2) + Math.pow(e.originalEvent.touches[0].clientY - e.originalEvent.touches[1].clientY, 2)) / t;
  11438. if (n > 1 && (n *= 1.3), n < 1 && (n *= .7), null != n) {
  11439. w = bt.px.bar.width;
  11440. var r = Math.round(bt.px.bar.width * n);
  11441. bt.px.bar.width = r + (r + 1) % 2, bt.px.bar.width < 2 && (bt.px.bar.width = 2), bt.px.bar.width > 51 && (bt.px.bar.width = 51), bt.px.bar.width != w && (nt(), E(), et()), bt.lastZoomTime = (new Date).getTime()
  11442. }
  11443. }
  11444. }
  11445. function Qe(e) {
  11446. if (bt.bars.allowScale = !0, 1 == e.originalEvent.changedTouches.length && 1 == bt.startTouchCoords.length && bt.startTouchCoords[0][1] != e.originalEvent.changedTouches[0].clientY && Math.abs((bt.startTouchCoords[0][0] - e.originalEvent.changedTouches[0].clientX) / (bt.startTouchCoords[0][1] - e.originalEvent.changedTouches[0].clientY)) < .15) {
  11447. var t = qe(bt.mouse.sx, bt.mouse.sy), n = 0;
  11448. n = e.originalEvent.changedTouches[0].clientY > bt.startTouchCoords[0][1] ? 1 : -1, 0 == t ? (bt.currentOverlay = (bt.currentOverlay + bt.mobileOverlays.length + n) % bt.mobileOverlays.length, Ze(bt.mobileOverlays[bt.currentOverlay])) : t > 0 && (bt.currentIndicator = (bt.currentIndicator + bt.mobileIndicators.length + n) % bt.mobileIndicators.length, Je(bt.mobileIndicators[bt.currentIndicator]))
  11449. }
  11450. }
  11451. function Je(e) {
  11452. if (bt.indicators.hasOwnProperty(e)) {
  11453. for (; bt.slots.length > 2;) S(bt.slots.length - 1);
  11454. x(e)
  11455. }
  11456. return this
  11457. }
  11458. function Ze(e) {
  11459. if (bt.overlays.hasOwnProperty(e)) {
  11460. for (; bt.slots[0].u.length > 0;) T(bt.slots[0].u.length - 1, "u", 0);
  11461. y(e)
  11462. }
  11463. return this
  11464. }
  11465. function et() {
  11466. Be()[1] > -1 && bt.bars.offset >= bt.bars.data.length - bt.bars.visible + bt.bars.blank + bt.bars.endpad - 3 && Data.loadPrev(lt())
  11467. }
  11468. function tt(e) {
  11469. if (Ge(e), bt.mouse.down) if (e.ctrlKey) {
  11470. var t = bt.px.bar.spacing;
  11471. bt.px.bar.spacing = bt.mouse.origSpacing + Math.round((bt.mouse.sx - bt.mouse.x) / 10), bt.px.bar.spacing < 0 && (bt.px.bar.spacing = 0), bt.px.bar.spacing > 51 && (bt.px.bar.spacing = 51), bt.px.bar.spacing != t && (E(), et())
  11472. } else 0 == bt.mouse.origOffsetBlank && (bt.bars.offset = bt.mouse.origOffset + Math.round((bt.mouse.x - bt.mouse.sx) / (bt.px.bar.width + bt.px.bar.spacing))), 0 == bt.mouse.origOffset && (bt.bars.blank = bt.mouse.origOffsetBlank + Math.round((bt.mouse.sx - bt.mouse.x) / (bt.px.bar.width + bt.px.bar.spacing)), rt()), nt(), bt.bars.offset == bt.mouse.origOffset && 0 != bt.bars.offset || (E(), et()); else if (bt.mouse.zoom) {
  11473. var n = bt.mouse.x - bt.mouse.sx, r = +bt.px.bar.width;
  11474. bt.px.bar.width = bt.mouse.w0 - 2 * (n / 10 | 0), bt.px.bar.width < 3 && (bt.px.bar.width = 3), bt.px.bar.width > 51 && (bt.px.bar.width = 51), bt.px.bar.width != r && (nt(), E(), et())
  11475. } else if (bt.mouse.resize) {
  11476. var o = bt.mouse.y - bt.mouse.sy;
  11477. if (bt.slots[bt.mouse.re_slot - 1].h = bt.mouse.re_slots.h0 + o, bt.slots[bt.mouse.re_slot - 1].h < bt.px.slotmin && (o = bt.px.slotmin - bt.mouse.re_slots.h0, bt.slots[bt.mouse.re_slot - 1].h = bt.px.slotmin), bt.slots[bt.mouse.re_slot].h = bt.mouse.re_slots.h1 - o, bt.slots[bt.mouse.re_slot].px = bt.mouse.re_slots.px1 + o, bt.slots[bt.mouse.re_slot].h < bt.px.slotmin && (o = bt.mouse.re_slots.h1 - bt.px.slotmin, bt.slots[bt.mouse.re_slot].h = bt.px.slotmin, bt.slots[bt.mouse.re_slot].px = bt.mouse.re_slots.px1 + o), bt.slots[bt.mouse.re_slot - 1].h = bt.mouse.re_slots.h0 + o, bt.slots[bt.mouse.re_slot - 1].h < bt.px.slotmin) {
  11478. var i = (bt.slots[bt.mouse.re_slot - 1].h + bt.slots[bt.mouse.re_slot].h) / 2;
  11479. bt.slots[bt.mouse.re_slot].h = i, bt.slots[bt.mouse.re_slot - 1].h = i, bt.slots[bt.mouse.re_slot].px = bt.slots[bt.mouse.re_slot - 1].px + bt.slots[bt.mouse.re_slot - 1].h + bt.px.pad + 3
  11480. }
  11481. for (var a = 0; a < bt.slots.length; a++) $(".control-" + a, bt.element).css("top", bt.slots[a].px + 3 + "px");
  11482. E()
  11483. }
  11484. }
  11485. function nt() {
  11486. bt.bars.offset > bt.bars.data.length - bt.bars.visible + bt.bars.blank + bt.bars.endpad && (bt.bars.offset = bt.bars.data.length - bt.bars.visible + bt.bars.blank + bt.bars.endpad), bt.bars.offset < 0 && (bt.bars.offset = 0)
  11487. }
  11488. function rt() {
  11489. var e = bt.bars.visible, t = 0;
  11490. t = bt.bars.data.length > e ? e / 2 : bt.bars.data.length > e / 2 ? (bt.bars.data.length - e / 2) / 2 : 0, t = parseInt(t), bt.bars.blank > t && (bt.bars.blank = t), bt.bars.blank < 0 && (bt.bars.blank = 0)
  11491. }
  11492. function ot() {
  11493. bt.resize.avail = bt.h - (bt.slots.length * (2 + bt.px.pad) - bt.px.pad - 1 + bt.px.lbl.h), bt.resize.slots = [], bt.resize.pct = [];
  11494. for (var e = 0; e < bt.slots.length; e++) bt.resize.slots.push(bt.slots[e].h), bt.resize.pct.push(bt.slots[e].h / bt.resize.avail);
  11495. p()
  11496. }
  11497. function it() {
  11498. var e = $(bt.element).width(), t = $(bt.element).height();
  11499. if (bt.w != e || bt.h != t) {
  11500. bt.w = e, bt.h = t, DEBUG && yt("@@@@@@@_P.w, h: " + bt.w + ", " + bt.h), $("canvas", bt.element).each(function (e, t) {
  11501. $(t).attr("width", bt.w + "px").attr("height", bt.h + "px")
  11502. }), $("canvas", bt.element).attr("val", !1), at();
  11503. bt.canvas.i[0].getContext("2d");
  11504. bt.canvas.line[0].getContext("2d"), E()
  11505. }
  11506. }
  11507. function at() {
  11508. var e, t, n = (bt.slots.length - 1) * (2 + bt.px.pad) + 1 + bt.px.lbl.h, r = bt.h - n, o = -1, i = 0;
  11509. for (e = 0; e < bt.slots.length; e++) bt.slots[e].h = bt.resize.pct[e] * r | 0, bt.slots[e].px = o, o += bt.slots[e].h + 2 + bt.px.pad, i += bt.slots[e].h;
  11510. for (e = 0; i < r;) {
  11511. for (bt.slots[e % bt.slots.length].h += 1, i += 1, t = 1 + e % bt.slots.length; t < bt.slots.length; t++) bt.slots[t].px += 1;
  11512. e++
  11513. }
  11514. for (e = 0; i > r;) {
  11515. for (bt.slots[e % bt.slots.length].h -= 1, i -= 1, t = 1 + e % bt.slots.length; t < bt.slots.length; t++) bt.slots[t].px -= 1;
  11516. e++
  11517. }
  11518. for (e = 0; e < bt.slots.length; e++) $(".control-" + e, bt.element).css("top", bt.slots[e].px + 3 + "px")
  11519. }
  11520. function st() {
  11521. at(), E()
  11522. }
  11523. function lt() {
  11524. return bt.period.avail[bt.period.current]
  11525. }
  11526. function ct() {
  11527. switch (bt.mode.current) {
  11528. case bt.TIME_BAR:
  11529. return ut();
  11530. case bt.VOL_BAR:
  11531. return dt();
  11532. default:
  11533. return ""
  11534. }
  11535. }
  11536. function ut(e) {
  11537. var t = void 0 === e ? bt.period.avail[bt.period.current] : e;
  11538. return 0 == t ? "Ticks" : t < 60 ? "S" + t : t < 3600 ? "M" + (t / 60 | 0) : t < 86400 ? "H" + (t / 3600 | 0) : t < 604800 ? "D" + (t / 86400 | 0) : t < 2592e3 ? "W" + (t / 604800 | 0) : (t / 2592e3 | 0) + "M"
  11539. }
  11540. function ft(e) {
  11541. var t = void 0 === e ? bt.period.avail[bt.period.current] : e;
  11542. return 0 == t ? _("Ticks") : t < 60 ? t + " NaN" : t < 3600 ? (t / 60 | 0) + " " + _("minute") : t < 86400 ? (t / 3600 | 0) + " " + _("hour") : t < 604800 ? (t / 86400 | 0) + " " + _("day") : t < 2592e3 ? (t / 604800 | 0) + " " + _("week") : (t / 2592e3 | 0) + " " + _("month")
  11543. }
  11544. function dt(e) {
  11545. var t = void 0 === e ? bt.volume.avail[bt.volume.current] : e;
  11546. return (t |= 0) < 1e3 ? "V" + t : t < 1e6 ? "V" + ~~(t / 1e3) + "K" : t < 1e9 ? "V" + ~~(t / 1e6) + "M" : "V" + ~~(t / 1e9) + "B"
  11547. }
  11548. function pt() {
  11549. var e = RTBTC.exchangeName() + " " + RTBTC.base() + "/" + RTBTC.quote() + ", " + ct();
  11550. bt.module.setTitle(e)
  11551. }
  11552. function ht(e) {
  11553. void 0 === e && (e = lt());
  11554. var t = +e;
  11555. isNaN(t) || bt.mode.current == bt.TIME_BAR && e == bt.period.avail[bt.period.current] && (DEBUG && yt("handling bar close for period: " + e), bt.bars.data = Data.data.bars[e], E())
  11556. }
  11557. function gt(e) {
  11558. E()
  11559. }
  11560. function mt(e) {
  11561. Colors.hasOwnProperty(e) && (bt.colors = Colors[e]), E()
  11562. }
  11563. function vt() {
  11564. if (!mobile) {
  11565. var e, t, n, r, o = bt.font.headingSize, i = 1.25 * o, a = 2.75 * i | 0,
  11566. s = $("<canvas/>").attr("width", bt.w).attr("height", bt.h + a), l = s[0].getContext("2d"),
  11567. c = RTBTC.base() + "/" + RTBTC.quote(), u = ", " + ft() + " " + _("bars"), f = Be(), d = Settings.localTime;
  11568. if (l.fillStyle = bt.colors.fill.blankBG, l.fillRect(0, a, bt.w, bt.h), l.fillStyle = bt.colors.fill.bg, l.fillRect(0, 0, bt.w, a), l.fillStyle = bt.colors.stroke.crosshair, l.font = bt.font.headingBold, l.textBaseline = "middle", n = l.measureText(c).width, e = l.measureText(bt.watermark).width, t = bt.w - e - o, f[1] >= f[0]) {
  11569. for (l.fillText(c, o / 2, i), l.font = bt.font.heading, l.fillStyle = bt.colors.fill.slottext, l.fillText(u, o / 2 + n, i, t - n), r = f[1]; r > f[0]; r--) if (r < bt.bars.data.length) {
  11570. u = fe(bt.bars.data[r][0], !0, d) + " " + pe(bt.bars.data[r][0], d);
  11571. break
  11572. }
  11573. for (u += " - ", r = f[0]; r < f[1]; r++) if (r >= 0) {
  11574. u += fe(bt.bars.data[r][0], !0, d) + " " + pe(bt.bars.data[r][0], d);
  11575. break
  11576. }
  11577. l.fillText(u, o / 2, 2 * i, t - bt.px.lbl.tick - bt.px.lbl.w)
  11578. } else l.fillText(c, o / 2, 2 * i), l.font = bt.font.heading, l.fillStyle = bt.colors.fill.slottext, l.fillText(u, o / 2 + n, 2 * i, t - n);
  11579. l.fillText(bt.watermark, bt.w - e - o / 2 - bt.px.lbl.tick - bt.px.lbl.w, 2 * i), l.drawImage(bt.canvas.base[0], 0, a), l.drawImage(bt.canvas.bg[0], 0, a), l.drawImage(bt.canvas.main[0], 0, a), l.drawImage(bt.canvas.fg[0], 0, a), l.drawImage(bt.canvas.orders[0], 0, a), l.drawImage(bt.canvas.lbl[0], 0, a), l.drawImage(bt.canvas.line[0], 0, a), l.drawImage(bt.canvas.i[0], 0, a), l.strokeStyle = bt.colors.stroke.border, l.lineWidth = 1, l.beginPath(), Ae(l, 0, a), Ne(l, bt.w - bt.px.lbl.tick - bt.px.lbl.w, a), l.stroke();
  11580. var p = s[0].toDataURL("image/png");
  11581. if (has_dataURI()) window.open(p, "_blank"); else {
  11582. var h = window.open(BASE_URL + "blank.html");
  11583. h.data = '<img src="' + p + '"/>', h.document.write(h.data), h.focus()
  11584. }
  11585. }
  11586. }
  11587. var bt = {
  11588. element: "",
  11589. parent: null,
  11590. module: null,
  11591. self: null,
  11592. canvas: {base: null, bg: null, main: null, fg: null, orders: null, lbl: null, i: null, line: null},
  11593. w: 0,
  11594. h: 0,
  11595. mode: {current: 0, avail: ["Time Bars"], display: 0, avail_display: ["Candle", "OHLC", "HLC", "Line"]},
  11596. TIME_BAR: 0,
  11597. CANDLE: 0,
  11598. OHLC: 1,
  11599. HLC: 2,
  11600. LINE: 3,
  11601. MOUNTAIN: 4,
  11602. BANDS: 5,
  11603. PSAR: 6,
  11604. HIST: 7,
  11605. LBLHIST: 8,
  11606. period: {
  11607. current: 13,
  11608. string: "M15",
  11609. avail: [2592e3, 604800, 259200, 86400, 43200, 28800, 21600, 14400, 7200, 3600, 2700, 1800, 900, 300, 180, 60, 0]
  11610. },
  11611. bars: {
  11612. visible: -1,
  11613. offset: 0,
  11614. blank: 0,
  11615. endpad: 0,
  11616. data: [],
  11617. noload: {},
  11618. startTime1: "9:30:00",
  11619. endTime1: "11:30:00",
  11620. startTime2: "13:00:00",
  11621. endTime2: "15:00:00",
  11622. ticks: [],
  11623. fixTime: !1
  11624. },
  11625. slots: [{main: !0, px: 0, h: 50, u: [{t: "ema", i: null, s: [5]}], o: []}, {
  11626. t: "vol",
  11627. i: null,
  11628. px: 5,
  11629. h: 10,
  11630. s: []
  11631. }],
  11632. resize: {avail: 0, slots: [], pct: []},
  11633. price: {high: 100, low: 50, range: 50, bid: NaN, ask: NaN},
  11634. log: {m: 0, b: 0, b10: 0},
  11635. px: {
  11636. pad: 5,
  11637. lbl: {w: 65, h: 14, tick: 5, halftick: 2, font: 11},
  11638. bar: {width: 7, dx: 4, spacing: 1},
  11639. price: 1,
  11640. crosshairs: {x: 0, y: 0},
  11641. slotmin: 50
  11642. },
  11643. flags: {redraw: {base: !0, main: !0, underlay: !0, overlay: !0, inds: !0}, recompute: !0, widget: !1},
  11644. mouse: {
  11645. down: !1,
  11646. zoom: !1,
  11647. w0: null,
  11648. x: 0,
  11649. y: 0,
  11650. bar: null,
  11651. sx: 0,
  11652. sy: 0,
  11653. origOffset: 0,
  11654. origSpacing: 1,
  11655. resize: !1,
  11656. re_slot: 0,
  11657. re_slots: {px0: 0, h0: 0, px1: 0, h1: 0},
  11658. slot: -1
  11659. },
  11660. colors: Colors.c,
  11661. lastColorIndex: 0,
  11662. defaultColors: null,
  11663. SOLID: 0,
  11664. DOTTED: 1,
  11665. DASHED: 2,
  11666. DASHDOT: 3,
  11667. font: {
  11668. precision: 2,
  11669. labels: mobile ? '10px/1.0em "Microsoft YaHei", Arial, sans-serif' : '11px/1.0em Consolas, "Courier New", monospace',
  11670. size: 11,
  11671. lineHeight: 1,
  11672. face: ' "Microsoft YaHei", Consolas, "Courier New", monospace',
  11673. indicators: '10px/1.0em "Microsoft YaHei", Arial, sans-serif',
  11674. heading: '12px/1.0em "Microsoft YaHei", Arial, sans-serif',
  11675. headingBold: 'bold 12px/1.0em "Microsoft YaHei", Arial, sans-serif',
  11676. headingSize: 12
  11677. },
  11678. watermark: "bijietech.com",
  11679. settings: {repaint: !0, grid: !0, crosshairs: !0, icontrols: !0, bidask: !0, logscale: !1, userorders: !1},
  11680. indicators: {
  11681. macd: "MACD",
  11682. kdj: "KDJ",
  11683. cci: "Commodity Channel Index",
  11684. dmi: "Directional Movement Index",
  11685. obv: "On-Balance Volume",
  11686. rsi: "Relative Strength Index",
  11687. sto: "Stochastic Oscillator",
  11688. storsi: "Stochastic RSI",
  11689. vol: "Volume",
  11690. wpr: "Williams %R",
  11691. emv: "Ease of movement value",
  11692. mtm: "Momentum"
  11693. },
  11694. mobileIndicators: ["macd", "kdj", "cci", "dmi", "obv", "rsi", "sto", "storsi", "wpr", "emv", "mtm", "avl"],
  11695. currentIndicator: 0,
  11696. overlays: {
  11697. ema: "Exponential Moving Average",
  11698. bnd: "Bollinger Bands &reg;",
  11699. psar: "Parabolic SAR",
  11700. dcn: "Price Channels",
  11701. sma: "Simple Moving Average",
  11702. vwap: "Volume Weighted Average Price",
  11703. trix: "Triple Exponentially Smoothed Average",
  11704. avl: "avl",
  11705. ma: "ma"
  11706. },
  11707. mobileOverlays: ["ema", "bnd", "psar", "dcn", "sma", "vwap", "trix", "avl", "ma"],
  11708. currentOverlay: 0,
  11709. lastPinchTime: -1,
  11710. lastZoomTime: -1,
  11711. startTouchCoords: [],
  11712. crossHairH: !0,
  11713. setShowRateOnLeft: !1,
  11714. data: {},
  11715. curIndex: 1,
  11716. offset: 0,
  11717. preClose: 0,
  11718. showMainCrosshairs: !0,
  11719. stopEvent: !1,
  11720. preTradingDay: 0,
  11721. notClicked: !0,
  11722. debug: RTBTC.isDebug()
  11723. }, yt = RTBTC.debug;
  11724. Date.prototype.Format = function (e) {
  11725. var t = {
  11726. "M+": this.getMonth() + 1,
  11727. "d+": this.getDate(),
  11728. "h+": this.getHours(),
  11729. "m+": this.getMinutes(),
  11730. "s+": this.getSeconds(),
  11731. "q+": Math.floor((this.getMonth() + 3) / 3),
  11732. S: this.getMilliseconds()
  11733. };
  11734. /(y+)/.test(e) && (e = e.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)));
  11735. for (var n in t) new RegExp("(" + n + ")").test(e) && (e = e.replace(RegExp.$1, 1 == RegExp.$1.length ? t[n] : ("00" + t[n]).substr(("" + t[n]).length)));
  11736. return e
  11737. };
  11738. var xt, wt, $t,
  11739. kt = [_("Jan"), _("Feb"), _("Mar"), _("Apr"), _("May"), _("Jun"), _("Jul"), _("Aug"), _("Sep"), _("Oct"), _("Nov"), _("Dec")],
  11740. Tt = 0, St = 0;
  11741. return {
  11742. build: function (t, r, o) {
  11743. return bt.element = t, bt.parent = r, e(), ze(), n(o), b(), u(), l(), window.setTimeout(function () {
  11744. RTBTC.trigger("what-theme", null)
  11745. }, 100), $(bt.element).on("mouseleave", function () {
  11746. h()
  11747. }), $(bt.element).on("keydown", function (e) {
  11748. 38 == e.keyCode && We(bt.element, 0, 0, 1), 40 == e.keyCode && We(bt.element, 0, 0, -1)
  11749. }), this
  11750. }, lblWidth: function () {
  11751. return bt.px.lbl.w
  11752. }, module: function (e) {
  11753. return bt.module = e, pt(), RTBTC.handler("barclose", bt.module.id(), bt.self.onBarClose), RTBTC.handler("theme", bt.module.id(), bt.self.onTheme), RTBTC.handler("trade", bt.module.id(), bt.self.onTrade), RTBTC.handler("bidask", bt.module.id(), bt.self.bidask), RTBTC.handler("orders", bt.module.id(), D), RTBTC.handler("order-canceled", bt.module.id(), O), this
  11754. }, self: function (e) {
  11755. return bt.self = e, this
  11756. }, settings: function () {
  11757. return v()
  11758. }, save: function () {
  11759. return a()
  11760. }, load: function (e) {
  11761. n(e), E()
  11762. }, unload: function () {
  11763. RTBTC.unregisterAll(bt.module.id())
  11764. }, onBarClose: function (e) {
  11765. ht(e)
  11766. }, onTheme: function (e) {
  11767. mt(e)
  11768. }, setPreClose: function (e) {
  11769. bt.preClose = Number(e)
  11770. }, showDetail: function () {
  11771. l()
  11772. }, onTrade: function (e) {
  11773. gt()
  11774. }, wheel: function (e) {
  11775. We(bt.element, 0, 0, -e)
  11776. }, loadTicks: function (e) {
  11777. var t = bt.bars.ticks;
  11778. bt.bars.ticks = [];
  11779. for (var n = 0; n < e.length; n++) i(e[n]) && bt.bars.ticks.push(e[n]);
  11780. return 0 == bt.bars.ticks.length ? (bt.bars.ticks = t, yt("Failed to load any new ticks!")) : (r(), C()), this
  11781. }, loadBars: function (e) {
  11782. var t, n, r = bt.bars.ticks, o = bt.bars.data;
  11783. if (e.length > 0) {
  11784. for (bt.bars.ticks = [], t = e.length - 1; t >= 0; t--) i(n = [e[t][0], e[t][1], e[t][5] / 4]) && bt.bars.ticks.push(n), i(n = [e[t][0], e[t][2], e[t][5] / 4]) && bt.bars.ticks.push(n), i(n = [e[t][0], e[t][3], e[t][5] / 4]) && bt.bars.ticks.push(n), i(n = [e[t][0], e[t][4], e[t][5] / 4]) && bt.bars.ticks.push(n);
  11785. bt.bars.ticks.length > 0 ? (bt.bars.data = e, bt.flags.redrawBG = !0, bt.flags.recompute = !0, C()) : (bt.bars.ticks = r, bt.bars.data = o)
  11786. }
  11787. return this
  11788. }, tick: function (e) {
  11789. var t = bt.bars.data.length;
  11790. i(e) && (bt.bars.ticks.push([e[0], e[1], e[2]]), o(e), bt.bars.data.length > t && (bt.flags.redrawFG = !0), C())
  11791. }, bar: function (e) {
  11792. bt.bars.data.length;
  11793. if (bt.bars.data.length > 0) {
  11794. if (e[0] < bt.bars.data[0][0]) return;
  11795. if (e[0] == bt.bars.data[0][0] && e[5] <= bt.bars.data[0][5]) return;
  11796. e[0] == bt.bars.data[0][0] ? bt.bars.data[0] = e : (bt.bars.data.splice(0, 0, e), bt.flags.redrawFG = !0)
  11797. } else bt.bars.data.splice(0, 0, e), bt.flags.redrawFG = !0;
  11798. bt.flags.recompute = !0, C()
  11799. }, bidask: function (e) {
  11800. var t = !1;
  11801. return e.hasOwnProperty("bid") && bt.price.bid != e.bid && (bt.price.bid = e.bid, t = !0), e.hasOwnProperty("ask") && bt.price.ask != e.ask && (bt.price.ask = e.ask, t = !0), t && (bt.flags.redraw.main = !0, C()), this
  11802. }, resize: function () {
  11803. t(), ot(), window.reqAnimFrame(it), st()
  11804. }, drag: function (e) {
  11805. switch (e) {
  11806. case"start":
  11807. p()
  11808. }
  11809. }, widget: function (e) {
  11810. return null == e || void 0 === e ? bt.flags.widget : (bt.flags.widget = e, this)
  11811. }, addIndicator: function (e) {
  11812. return x(e), this
  11813. }, addOrUpdateIndicator: function (e, t) {
  11814. return bt.indicators.hasOwnProperty(e) ? x(e, t) : bt.overlays.hasOwnProperty(e) && y(e, t), this
  11815. }, removeIndicator: function () {
  11816. for (; bt.slots.length > 2;) S(bt.slots.length - 1);
  11817. for (; bt.slots[0].u.length > 1;) T(bt.slots[0].u.length - 1, "u", 0);
  11818. return this
  11819. }, addOverlay: function (e, t) {
  11820. y(e, t)
  11821. }, removeIndicatorByname: function (e) {
  11822. return e instanceof Array && e.forEach(function (e) {
  11823. for (var t = bt.slots[0].u, n = t.length, r = 0; r < n; r++) t[r] && t[r].t == e && T(r, "u", 0);
  11824. for (var o = bt.slots, i = 0; i < o.length; i++) o[i].t == e && S(i)
  11825. }), this
  11826. }, setResolution: function (e) {
  11827. return bt.period.avail.indexOf(e) >= 0 && bt.period.current != bt.period.avail.indexOf(e) && (bt.period.current = bt.period.avail.indexOf(e), bt.bars.offset = 0, bt.bars.blank = 0), Data.setup(e), this
  11828. }, crossHairH: function (e) {
  11829. bt.crossHairH = e
  11830. }, fixTime: function (e) {
  11831. bt.bars.fixTime = e, bt.offset = e ? 40 : 0, bt.bars.offset = 0, bt.settings.grid = !0
  11832. }, setBarwidth: function (e) {
  11833. bt.px.bar.width = e
  11834. }, setData: function (e) {
  11835. bt.data = e
  11836. }, clearData: function () {
  11837. Data.data.bars[lt()] = [], E()
  11838. }, setOffset: function (e) {
  11839. bt.offset = e
  11840. }, setShowRateOnLeft: function (e) {
  11841. bt.setShowRateOnLeft = e
  11842. }, setLastColorIndex: function (e) {
  11843. bt.lastColorIndex = e
  11844. }, setMode: function (e) {
  11845. return bt.mode.avail_display.indexOf(e) >= 0 && bt.mode.display != bt.mode.avail_display.indexOf(e) && (bt.mode.display = bt.mode.avail_display.indexOf(e)), $(".icontrol", bt.element).css("left", bt.offset + 2 + "px"), this
  11846. }, setCrossHair: function (e) {
  11847. bt.showMainCrosshairs = e, bt.stopEvent = !e, e ? (bt.canvas.i.removeClass("showHand"), 0 == $("#chartCtrlFixed").length && l()) : (bt.canvas.i.addClass("showHand"), $("#chartCtrlFixed").remove())
  11848. }, getMode: function () {
  11849. return bt.mode.display
  11850. }, getInernal: function () {
  11851. return bt.yToVal = Fe, bt.xToBar = _e, bt.toPxX = Ie, bt.barToIndex = Re, bt.toPxY = De, bt
  11852. }, getCurDay: function () {
  11853. if (bt.bars.data[bt.curIndex]) return $("#chartCtrlFixed").hide(), bt.bars.data[bt.curIndex][0]
  11854. }, getPerClose: function () {
  11855. if (bt.bars.data[bt.curIndex + 1]) return bt.bars.data[bt.curIndex + 1][4]
  11856. }, LblWidthChangeEvent: function (e) {
  11857. bt.LblWidthChange = e
  11858. }, showHighlowPriceAtAngles: function () {
  11859. bt.colors.stroke.priceShow = !0
  11860. }, setMainSlotHeightPercent: function (e) {
  11861. bt.mainSlotHeightPercent = e
  11862. }, redraw: function () {
  11863. E()
  11864. }, isIndicator: function (e) {
  11865. return !!bt.indicators[e]
  11866. }, internals: (bt.debug, function () {
  11867. return bt
  11868. })
  11869. }
  11870. };
  11871. Date.prototype.get8Date = function () {
  11872. var e = 6e4 * this.getTimezoneOffset(), t = this.getTime() + e;
  11873. return new Date(t + 288e5)
  11874. };
  11875. var Currency = function () {
  11876. var e = [], t = {
  11877. AUD: {symbol: "$", before: !0, digits: 2, name: _("Australian dollar")},
  11878. BTC: {symbol: "BTC", before: !1, digits: 8, name: _("Bitcoin")},
  11879. USDT: {symbol: "USDT", before: !1, digits: 2, name: _("USDT")},
  11880. ANS: {symbol: "ANS", before: !1, digits: 8, name: _("Antshares")},
  11881. BNB: {symbol: "BNB", before: !1, digits: 8, name: _("Binance")},
  11882. ETH: {symbol: "ETH", before: !1, digits: 8, name: _("Ethereum")},
  11883. 123: {symbol: "123", before: !1, digits: 8, name: _("123")},
  11884. 456: {symbol: "456", before: !1, digits: 8, name: _("456")},
  11885. CAD: {symbol: "$", before: !0, digits: 2, name: _("Canadian dollar")},
  11886. CHF: {symbol: "S₣", before: !1, digits: 2, name: _("Swiss franc")},
  11887. CLP: {symbol: "$", before: !0, digits: 2, name: _("Chilean peso")},
  11888. CNY: {symbol: "CNY", before: !1, digits: 2, name: _("Chinese yuan")},
  11889. DKK: {symbol: "kr", before: !1, digits: 2, name: _("Danish krone")},
  11890. EUR: {symbol: "€", before: !0, digits: 2, name: _("Euro")},
  11891. GBP: {symbol: "£", before: !0, digits: 2, name: _("Pound sterling")},
  11892. HKD: {symbol: "圓", before: !0, digits: 2, name: _("Hong Kong dollar")},
  11893. JPY: {symbol: "¥", before: !0, digits: 2, name: _("Japanese yen")},
  11894. FTC: {symbol: "FTC", before: !1, digits: 8, name: _("Feathercoin")},
  11895. LTC: {symbol: "Ł", before: !0, digits: 6, name: _("Litecoin")},
  11896. NMC: {symbol: "ℕ", before: !0, digits: 8, name: _("Namecoin")},
  11897. NVC: {symbol: "NVC", before: !1, digits: 8, name: _("Novacoin")},
  11898. NOK: {symbol: "kr", before: !1, digits: 2, name: _("Norwegian krone")},
  11899. NZD: {symbol: "$", before: !0, digits: 2, name: _("New Zealand dollar")},
  11900. PLN: {symbol: "zł", before: !1, digits: 2, name: _("Polish złoty")},
  11901. PPC: {symbol: "PPC", before: !1, digits: 8, name: _("Peercoin")},
  11902. RUB: {symbol: "руб", before: !1, digits: 2, name: _("Russian ruble")},
  11903. SEK: {symbol: "kr", before: !1, digits: 2, name: _("Swedish krona")},
  11904. SGD: {symbol: "S", before: !0, digits: 2, name: _("Singapore dollar")},
  11905. THB: {symbol: "฿", before: !0, digits: 2, name: _("Thai baht")},
  11906. TRC: {symbol: "TRC", before: !1, digits: 8, name: _("Terracoin")},
  11907. USD: {symbol: "$", before: !0, digits: 2, name: _("United States dollar")},
  11908. XPM: {symbol: "Ψ", before: !0, digits: 8, name: _("Primecoin")}
  11909. };
  11910. for (var n in t) t.hasOwnProperty(n) && e.push(n);
  11911. return e.sort(), {
  11912. list: function () {
  11913. return e
  11914. }, before: function (e) {
  11915. try {
  11916. return t[e].before
  11917. } catch (e) {
  11918. return !0
  11919. }
  11920. }, fullname: function (e) {
  11921. try {
  11922. return t[e].name
  11923. } catch (e) {
  11924. return _("Currency")
  11925. }
  11926. }, format: function (e, n, r) {
  11927. try {
  11928. null == r && (r = t[e].digits);
  11929. var o = numberWithCommas((n = parseFloat(n)).toFixed(r));
  11930. return t[e].before ? t[e].symbol + o : o + " " + t[e].symbol
  11931. } catch (e) {
  11932. return "¤0.00"
  11933. }
  11934. }, symbol: function (e) {
  11935. try {
  11936. return t[e].symbol
  11937. } catch (e) {
  11938. return "¤"
  11939. }
  11940. }, valid: function (e) {
  11941. return t.hasOwnProperty(e)
  11942. }
  11943. }
  11944. }(), OrderBookDaemon = function () {
  11945. function e() {
  11946. function e(e, n) {
  11947. var r = 0, o = 0, i = RTBTC.baseInt();
  11948. if (e *= RTBTC.quoteInt(), "bid" == n) for (o = 0; o < t.book.bid.price.length && !(t.book.bid.price[o] < e); o++) r += t.book.bid.amount[o] / i; else if ("ask" == n) for (o = 0; o < t.book.ask.price.length && !(t.book.ask.price[o] > e); o++) r += t.book.ask.amount[o] / i;
  11949. return r
  11950. }
  11951. var t = {book: {bid: {price: [], amount: []}, ask: {price: [], amount: []}}};
  11952. return {
  11953. book: t.book, sumToPrice: function (t, n) {
  11954. return e(t, n)
  11955. }, loadBook: function (e, n, r) {
  11956. t.book.bid.price = [], t.book.bid.amount = [], t.book.ask.price = [], t.book.ask.amount = [];
  11957. var o = Object.keys(n).sort(function (e, t) {
  11958. return e - t
  11959. }).reverse(), i = Object.keys(e).sort(function (e, t) {
  11960. return e - t
  11961. });
  11962. o.slice(0, r || 20).forEach(function (e) {
  11963. t.book.bid.price.push(parseFloat(e)), t.book.bid.amount.push(n[e])
  11964. }), i.slice(0, r || 20).forEach(function (n) {
  11965. t.book.ask.price.push(parseFloat(n)), t.book.ask.amount.push(e[n])
  11966. }), RTBTC.trigger("newbook", null)
  11967. }
  11968. }
  11969. }
  11970. var t = null;
  11971. return new function () {
  11972. this.Build = function () {
  11973. return null == t && ((t = new e).constructor = null), t
  11974. }
  11975. }
  11976. }(), OBD = null, TWOPI = 2 * Math.PI, OBD = OrderBookDaemon.Build(), VisualDepth = function () {
  11977. function e() {
  11978. ce.parent.addClass("visualdepth"), ce.element = $(".box-inner", ce.parent), ce.element.empty(), ce.w = ce.element.width(), ce.h = ce.element.height(), ce.canvas.bg = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 100), ce.canvas.bidFill = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 101), ce.canvas.askFill = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 102), ce.canvas.bid = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 103), ce.canvas.sweepFill = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 104), ce.canvas.sweep = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 105), ce.canvas.ask = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 106), ce.canvas.orders = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 107), ce.canvas.userOrders = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 108), ce.canvas.axes = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 109), ce.canvas.lbl = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 110), ce.canvas.i = $("<canvas/>").attr("width", ce.w + "px").attr("height", ce.h + "px").attr("z-index", 111), ce.element.append(ce.canvas.bg).append(ce.canvas.bidFill).append(ce.canvas.askFill).append(ce.canvas.bid).append(ce.canvas.ask).append(ce.canvas.sweepFill).append(ce.canvas.sweep).append(ce.canvas.orders).append(ce.canvas.userOrders).append(ce.canvas.axes).append(ce.canvas.lbl).append(ce.canvas.i), ce.defaultColors = deepCopy(ce.colors);
  11979. var e = ce.canvas.bg[0].getContext("2d");
  11980. e.font = ce.font.labels, ce.px.lbl.w = e.measureText("100.00").width + ce.px.pad + 2
  11981. }
  11982. function t(e) {
  11983. if (void 0 !== e) {
  11984. var t = new Validator, n = (new Validator).create(t.FLOAT), r = (new Validator).create(t.BOOL);
  11985. ce.settings.grid = r.set(ce.settings.grid).set(e.g).get(), ce.settings.fill = r.set(ce.settings.fill).set(e.f).get(), ce.price.scale = n.set(ce.price.scale).set(e.s).get()
  11986. }
  11987. }
  11988. function n() {
  11989. var e = {};
  11990. return e.g = ce.settings.grid, e.f = ce.settings.fill, e.s = ce.price.scale, e
  11991. }
  11992. function r() {
  11993. return [$("<p/>").append(RTBTC.toggle(ce.settings.fill, function () {
  11994. ce.settings.fill = !0
  11995. }, function () {
  11996. ce.settings.fill = !1, m()
  11997. }, function () {
  11998. i()
  11999. })).append($("<span/>").addClass("control-label").html(_("Fill the Chart"))), $("<p/>").append(RTBTC.toggle(ce.settings.grid, function () {
  12000. ce.settings.grid = !0
  12001. }, function () {
  12002. ce.settings.grid = !1
  12003. }, function () {
  12004. i()
  12005. })).append($("<span/>").addClass("control-label").html(_("Show Grid")))]
  12006. }
  12007. function o() {
  12008. var e = ce.canvas.bg[0].getContext("2d"), t = ce.canvas.bidFill[0].getContext("2d"),
  12009. n = ce.canvas.askFill[0].getContext("2d"), r = ce.canvas.bid[0].getContext("2d"),
  12010. o = ce.canvas.ask[0].getContext("2d"), i = ce.canvas.axes[0].getContext("2d"),
  12011. s = ce.canvas.lbl[0].getContext("2d");
  12012. if (ce.flags.recompute && a(e), ce.flags.redraw.base) {
  12013. e.clearRect(0, 0, ce.w, ce.h), l(e), i.clearRect(0, ce.h - ce.px.lbl.h - 2 * ce.px.lbl.tick - 2, ce.w, ce.px.lbl.h + 2 * ce.px.lbl.tick + 2), i.font = ce.font.labels;
  12014. var u = i.measureText(ce.volume).width;
  12015. i.clearRect(0, 0, ce.px.lbl.tick + u + 5, ce.h - ce.px.lbl.h - ce.px.lbl.tick - 1), c(i, e), ce.flags.redraw.base = !1
  12016. }
  12017. var f = ce.flags.redraw.bid || ce.flags.redraw.ask;
  12018. ce.flags.redraw.bid && (d(r, t), ce.flags.redraw.bid = !1), ce.flags.redraw.ask && (p(o, n), ce.flags.redraw.ask = !1), f && v(s), ae()
  12019. }
  12020. function i(e) {
  12021. ce.flags.recompute = !0, e ? o() : window.reqAnimFrame(o)
  12022. }
  12023. function a(e) {
  12024. ce.price.low, ce.price.high;
  12025. var t = RTBTC.quoteInt(), n = !1, r = (fe = OBD.book).bid.price, o = fe.ask.price;
  12026. if (0 == r.length && o.length > 0) fe.bid.price = [o[0]], fe.bid.amount = [fe.ask.amount[0]]; else if (r.length > 0 && 0 == o.length) fe.ask.price = [r[0]], fe.ask.amount = [fe.bid.amount[0]]; else if (0 == r.length && 0 == o.length) return;
  12027. if (fe.bid.price.length > 0 && fe.ask.price.length > 0) {
  12028. ce.price.low < fe.bid.price[fe.bid.price.length - 1] / t && (n = !0, DEBUG && ue("New low price: " + ce.price.low)), ce.price.high > fe.ask.price[fe.ask.price.length - 1] / t && (n = !0, DEBUG && ue("New high price: " + ce.price.high)), ce.price.low > fe.bid.price[fe.bid.price.length - 1] / t && DEBUG && ue("New low price: " + ce.price.low), ce.price.high < fe.ask.price[fe.ask.price.length - 1] / t && DEBUG && ue("New high price: " + ce.price.high);
  12029. var i = (fe.ask.price[0] + fe.bid.price[0]) / 2;
  12030. i * (1 - ce.price.scale) > 0 && (ce.price.high = i * (1 + ce.price.scale), ce.price.low = i * (1 - ce.price.scale)), (0 == r.length || 1 == r.length && r[0] == o[0]) && o.length > 0 ? ce.price.low < 0 && (ce.price.low = 0) : r.length > 0 && (0 == o.length || 1 == o.length && (o[0], r[0])), ce.allowScale ? ce.allowScale = !1 : ce.price.range = ce.price.high - ce.price.low, ce.price.range = ce.price.high - ce.price.low, n && (DEBUG && ue(ce.price), ce.price.range = ce.price.high - ce.price.low, ce.price.range <= 0 && (ce.price.range = 1), ce.price.high < ce.price.low && (ce.price.high = ce.price.low + 1 / RTBTC.quoteInt()), ce.price.scale < ce.price.minScale ? ce.price.scale = ce.price.minScale : ce.price.scale > ce.price.maxScale && (ce.price.scale = ce.price.maxScale), DEBUG && ue("Scale: " + ce.price.scale + ", range: " + ce.price.range))
  12031. }
  12032. var a, s = 0;
  12033. for (ce.sums.bid = [], a = 0; a < fe.bid.amount.length && (s += fe.bid.amount[a] / RTBTC.baseInt(), ce.sums.bid[a] = s, !(fe.bid.price[a] / t < ce.price.low)); a++) ;
  12034. for (s = 0, ce.sums.ask = [], a = 0; a < fe.ask.amount.length && (s += fe.ask.amount[a] / RTBTC.baseInt(), ce.sums.ask[a] = s, !(fe.ask.price[a] / t > ce.price.high)); a++) ;
  12035. var l = 0, c = 0;
  12036. l = fe.ask.price[ce.sums.ask.length - 1] > ce.price.high ? ce.sums.ask[ce.sums.ask.length - 2] : ce.sums.ask[ce.sums.ask.length - 1], c = fe.bid.price[ce.sums.bid.length - 1] < ce.price.low ? ce.sums.bid[ce.sums.bid.length - 2] : ce.sums.bid[ce.sums.bid.length - 1], ce.volume = Math.max(l, c), ce.volume *= 1.15, ce.flags.recompute = !1, ce.flags.redraw.base = !0, ce.flags.redraw.bid = !0, ce.flags.redraw.ask = !0, void 0 === ce.asdf && (ue(ce), ce.asdf = !0)
  12037. }
  12038. function s() {
  12039. var e = fe.bid.amount.length, t = fe.ask.amount.length, n = RTBTC.quoteInt();
  12040. fe.bid.price[e - 1] / n < ce.price.low && ce.sums.bid.length > 0 && fe.bid.price[ce.sums.bid.length - 1] > ce.price.low ? ce.flags.recompute = !0 : fe.ask.price[t - 1] / n > ce.price.high && ce.sums.ask.length > 0 && fe.ask.price[ce.sums.ask.length - 1] < ce.price.high && (ce.flags.recompute = !0)
  12041. }
  12042. function l(e, t) {
  12043. void 0 === t && (t = !1);
  12044. var n = ce.px.lbl.h + ce.px.lbl.tick + 1, r = ce.h - n;
  12045. e.fillStyle = ce.colors.fill.bg, U(e, 0, r, ce.w, n), e.strokeStyle = ce.colors.stroke.border, e.beginPath(), R(e, 0, r), j(e, ce.w, r), e.stroke()
  12046. }
  12047. function c(e, t) {
  12048. u(e, t), f(e, t)
  12049. }
  12050. function u(e, t) {
  12051. e.font = ce.font.labels, e.fillStyle = ce.colors.fill.label, e.strokeStyle = ce.colors.stroke.border, e.textBaseline = "middle", e.textAlign = "center";
  12052. var n, r, o = 1 / RTBTC.quoteInt(), i = 7, a = 1.5 * ce.font.size, s = 0,
  12053. l = [1e-6, 2e-5, 1e-4, 2e-4, 5e-4, .001, .01, .5, 1, 2, 2.5, 5], c = 1e-8, u = !1;
  12054. for (o = 1e-8, n = 0; n < 15; n++) {
  12055. for (i = Math.max(Math.abs(Math.log(o) / Math.LN10) + 1, 2), r = 0; r < l.length; r++) if (c = o * l[r], s = e.measureText(ce.price.high.toFixed(i)).width, V(2 * c) - V(c) >= s + a) {
  12056. u = !0;
  12057. break
  12058. }
  12059. if (u) break;
  12060. o *= 10
  12061. }
  12062. ce.price.decimals = i;
  12063. var f = Math.ceil(ce.price.high / c) * c, d = V(f);
  12064. for (ce.settings.grid && (t.strokeStyle = ce.colors.stroke.grid, t.beginPath()), e.beginPath(); f >= ce.price.low && !(d < 0);) P(e, f.toFixed(i), f), ce.settings.grid && x(t, d, ce.DOTTED), d = V(f -= c);
  12065. e.stroke(), ce.settings.grid && t.stroke()
  12066. }
  12067. function f(e, t) {
  12068. e.font = ce.font.labels, e.fillStyle = ce.colors.fill.label, e.strokeStyle = ce.colors.stroke.border, e.textBaseline = "middle", e.textAlign = "left";
  12069. var n, r, o = 1e-8, i = 8, a = .625 * ce.font.size, s = ce.px.lbl.font, l = [1, 2, 2.5, 5], c = 1e-8, u = !1;
  12070. for (n = 0; n < 20; n++) {
  12071. for (i = Math.max(Math.abs(Math.log(o) / Math.LN10) + 1, 2), r = 0; r < l.length; r++) if (c = o * l[r], H(c) - H(2 * c) >= s + a) {
  12072. u = !0;
  12073. break
  12074. }
  12075. if (u) break;
  12076. o *= 10
  12077. }
  12078. o >= 1 && (i = 0);
  12079. var f = c, d = H(f);
  12080. for (ce.settings.grid && (t.strokeStyle = ce.colors.stroke.grid, t.beginPath()), e.beginPath(); f < ce.volume;) D(e, numberWithCommas(f.toFixed(i)), f), ce.settings.grid && k(t, d, ce.DOTTED), d = H(f += c);
  12081. e.stroke(), ce.settings.grid && t.stroke()
  12082. }
  12083. function d(e, t) {
  12084. e.clearRect(0, 0, ce.w, ce.h), e.strokeStyle = ce.colors.stroke.bid, ce.settings.fill && (t.clearRect(0, 0, ce.w, ce.h), t.fillStyle = ce.colors.fill.down, g(t, ce.sums.bid, fe.bid.price, !0));
  12085. var n = !1;
  12086. if (ce.interacted && fe.bid.price.length > 0) {
  12087. var r = fe.bid.price[0] / RTBTC.quoteInt();
  12088. ce.px.crosshairs.x <= V(r) && (C(), n = !0)
  12089. }
  12090. h(e, ce.sums.bid, fe.bid.price, !0), n && S(ce.mouse.x, ce.mouse.y)
  12091. }
  12092. function p(e, t) {
  12093. e.clearRect(0, 0, ce.w, ce.h), e.strokeStyle = ce.colors.stroke.ask, ce.settings.fill && (t.clearRect(0, 0, ce.w, ce.h), t.fillStyle = ce.colors.fill.up, g(t, ce.sums.ask, fe.ask.price, !1));
  12094. var n = !1;
  12095. if (ce.interacted && fe.ask.price.length > 0) {
  12096. var r = fe.ask.price[0] / RTBTC.quoteInt();
  12097. ce.px.crosshairs.x >= V(r) && (C(), n = !0)
  12098. }
  12099. h(e, ce.sums.ask, fe.ask.price, !1), n && S(ce.mouse.x, ce.mouse.y)
  12100. }
  12101. function h(e, t, n, r, o) {
  12102. if (0 != n.length) {
  12103. var i, a, s, l = t.length, c = RTBTC.quoteInt(), u = V(n[l - 1] / c), f = u, d = H(t[l - 1]), p = u,
  12104. h = void 0 !== o, g = h ? V(o) : r ? ce.w + 1 : -1;
  12105. if (e.beginPath(), h) for (p = u = g, i = l - 1; i >= 0; i--) if (r && n[i] / c > o || !r && n[i] / c < o) {
  12106. l = i + 1;
  12107. break
  12108. }
  12109. for (R(e, u, s = H(t[l - 1])), !h && u > 0 && (ce.yVals[u] = s), i = l - 1; i >= 0; i--) {
  12110. if (u = V(n[i] / c), r && u > p || !r && u < p) {
  12111. if (s = H(t[i]), r && u > p + 1 && j(e, p + 1, s), !r && u < p - 1 && j(e, p - 1, s), j(e, u, s), !h && u > 0 && (ce.yVals[u] = s), !h) {
  12112. if (r && u > p + 1) for (a = p + 1; a < u; a++) ce.yVals[a] = void 0;
  12113. if (!r && u < p - 1) for (a = p - 1; a > u; a--) ce.yVals[a] = void 0
  12114. }
  12115. p = u
  12116. }
  12117. if (u < -100 * ce.w || u > 100 * ce.w) {
  12118. DEBUG && ue(fe), DEBUG && ue("n: " + l + ", curInt: " + c + ", prices[n-1]: " + n[l - 1] + ", x: " + u + ", xf: " + f + ", sums[n-1]: " + t[l - 1] + ", yf: " + d + ", ");
  12119. break
  12120. }
  12121. }
  12122. e.stroke()
  12123. }
  12124. }
  12125. function g(e, t, n, r, o) {
  12126. if (0 != n.length) {
  12127. var i, a = t.length, s = RTBTC.quoteInt(), l = V(n[a - 1] / s), c = l, u = l, f = 0, d = H(0),
  12128. p = e.createLinearGradient(0, 0, 0, d), h = void 0 !== o, g = h ? V(o) : r ? ce.w + 1 : -1;
  12129. if (e.beginPath(), h) for (l = g, u = g, c = g, i = a - 1; i >= 0; i--) if (r && n[i] / s > o || !r && n[i] / s < o) {
  12130. a = i + 1;
  12131. break
  12132. }
  12133. for (R(e, l, f = H(t[a - 1])), i = a - 1; i >= 0; i--) l = V(n[i] / s), (r && l > u || !r && l < u) && (f = H(t[i]), r && l > u + 1 && j(e, u + 1, f), !r && l < u - 1 && j(e, u - 1, f), j(e, l, f), u = l);
  12134. j(e, u, d), j(e, c, d), e.closePath(), p.addColorStop(0, e.fillStyle), p.addColorStop(1, ce.colors.fill.blankBG), e.fillStyle = p, e.fill()
  12135. }
  12136. }
  12137. function m() {
  12138. var e = ce.canvas.bidFill[0].getContext("2d");
  12139. e.clearRect(0, 0, ce.w, ce.h), (e = ce.canvas.askFill[0].getContext("2d")).clearRect(0, 0, ce.w, ce.h)
  12140. }
  12141. function v(e) {
  12142. e.clearRect(0, ce.h - ce.px.lbl.h - ce.px.lbl.tick - 1, ce.w, ce.px.lbl.h + ce.px.lbl.tick + 1), e.clearRect(0, 0, ce.w, ce.font.overlaySize + ce.px.lbl.tick + 5);
  12143. var t = 0, n = 0;
  12144. try {
  12145. t = fe.bid.price.length, n = fe.ask.price.length
  12146. } catch (e) {
  12147. return
  12148. }
  12149. if (0 != t || 0 != n) {
  12150. var r = fe.bid.price[0] / RTBTC.quoteInt(), o = fe.ask.price[0] / RTBTC.quoteInt(), i = "", a = 0, s = 0,
  12151. l = o > 0 ? 100 * (o - r) / o : NaN;
  12152. e.font = ce.font.labels, e.lineWidth = 1, e.fillStyle = ce.colors.fill.crosshair, e.textAlign = "center", e.textBaseline = "middle", o > ce.price.low && o < ce.price.high && (i = Currency.format(RTBTC.quote(), o), a = V(o), e.strokeStyle = ce.colors.stroke.ask, F(e, a, e.measureText(i).width), e.fillStyle = ce.colors.fill.flagtext, O(e, i, a)), r > ce.price.low && r < ce.price.high && (e.fillStyle = ce.colors.fill.crosshair, i = Currency.format(RTBTC.quote(), r), s = V(r), e.strokeStyle = ce.colors.stroke.bid, F(e, s, e.measureText(i).width), e.fillStyle = ce.colors.fill.flagtext, O(e, i, s)), o > ce.price.low && o < ce.price.high && r > ce.price.low && r < ce.price.high && !isNaN(l) && (i = l.toFixed(2) + "%", e.fillStyle = ce.colors.fill.ordertext, e.strokeStyle = ce.colors.stroke.order, e.textAlign = "center", e.textBaseline = "top", e.font = ce.font.overlays, e.fillText(i, (a + s) / 2, 1), e.beginPath(), R(e, s, ce.font.overlaySize + ce.px.lbl.tick + 3), j(e, s, ce.font.overlaySize + 3), j(e, a, ce.font.overlaySize + 3), j(e, a, ce.font.overlaySize + ce.px.lbl.tick + 3), e.stroke())
  12153. }
  12154. }
  12155. function b(e) {
  12156. var t = ce.canvas.orders[0].getContext("2d"), n = V(e.price / RTBTC.quoteInt());
  12157. if (!(n < 0 || n > ce.w)) {
  12158. if (e.amount > 0) t.strokeStyle = ce.colors.stroke.up; else {
  12159. if (!(e.amount < 0)) return;
  12160. t.strokeStyle = ce.colors.stroke.down
  12161. }
  12162. ce.orders.length > n && n >= 0 && (t.beginPath(), R(t, n, ce.h), j(t, n, ce.h - ce.px.lbl.h - ce.px.lbl.tick), t.stroke(), void 0 === ce.orders[n] ? ce.orders[n] = 1 : ce.orders[n]++), window.setTimeout(function (e) {
  12163. return function () {
  12164. y(e)
  12165. }
  12166. }(n), ce.orderDelay)
  12167. }
  12168. }
  12169. function y(e) {
  12170. if (ce.orders.length > e && e >= 0) {
  12171. if (void 0 === ce.orders[e]) return;
  12172. if (--ce.orders[e] > 0) return;
  12173. ce.canvas.orders[0].getContext("2d").clearRect(e, ce.h - ce.px.lbl.h - ce.px.lbl.tick, 1, ce.px.lbl.h + ce.px.lbl.tick)
  12174. }
  12175. }
  12176. function x(e, t, n) {
  12177. var r, o = ce.h - ce.px.lbl.h - ce.px.lbl.tick - 2;
  12178. switch (R(e, t, 0), r = 0, n) {
  12179. case ce.DOTTED:
  12180. for (; r < o;) j(e, t, ++r), R(e, t, ++r);
  12181. break;
  12182. case ce.DASHED:
  12183. for (; r < o;) j(e, t, r = (r += 6) > o ? o : r), R(e, t, r += 2);
  12184. break;
  12185. case ce.DASHDOT:
  12186. for (; r < o && (r += 7, r = r > o ? o : r, j(e, t, r), !((r += 4) >= o));) R(e, t, r), j(e, t, r = (r += 2) > o ? o : r), R(e, t, r += 4);
  12187. break;
  12188. case ce.SOLID:
  12189. default:
  12190. j(e, t, o)
  12191. }
  12192. }
  12193. function k(e, t, n) {
  12194. var r, o = ce.w;
  12195. switch (R(e, o, t), r = o, n) {
  12196. case ce.DOTTED:
  12197. for (; r > 1;) j(e, --r, t), R(e, --r, t);
  12198. break;
  12199. case ce.DASHED:
  12200. for (; r > 0;) j(e, r = (r -= 6) < 0 ? 0 : r, t), R(e, r -= 2, t);
  12201. break;
  12202. case ce.DASHDOT:
  12203. for (; r > 0 && (r -= 7, r = r < 0 ? 0 : r, j(e, r, t), !((r -= 4) <= 0));) R(e, r, t), j(e, r = (r -= 2) < 0 ? 0 : r, t), R(e, r -= 4, t);
  12204. break;
  12205. case ce.SOLID:
  12206. default:
  12207. j(e, 0, t)
  12208. }
  12209. }
  12210. function T(e) {
  12211. var t = ce.h - ce.px.lbl.h - ce.px.lbl.tick - 2;
  12212. if (fe.bid.price.length > 0 && fe.ask.price.length > 0) {
  12213. var n = fe.bid.price[0] / RTBTC.quoteInt(), r = fe.ask.price[0] / RTBTC.quoteInt(), o = V(n), i = V(r);
  12214. if (e > o && e < i) return t;
  12215. if (void 0 !== ce.yVals[e]) return ce.yVals[e];
  12216. ce.price.high, ce.price.low;
  12217. var a = e;
  12218. if (z(e) >= r) for (; Math.ceil(1e6 * z(--a)) / 1e6 >= r;) {
  12219. if (void 0 !== ce.yVals[a]) return ce.yVals[a];
  12220. if (a <= 0) break
  12221. } else if (z(e) <= n) for (; Math.floor(1e6 * z(++a)) / 1e6 <= n;) {
  12222. if (void 0 !== ce.yVals[a]) return ce.yVals[a];
  12223. if (a >= ce.w) break
  12224. }
  12225. }
  12226. return t
  12227. }
  12228. function S(e, t) {
  12229. ce.mouse.shift && (N(), A(e, t));
  12230. var n = ce.canvas.i[0].getContext("2d");
  12231. if (!G(e, t)) {
  12232. var r = z(e), o = T(e), i = W(o);
  12233. C(n), n.font = ce.font.labels, n.lineWidth = 1, n.fillStyle = ce.colors.fill.crosshair, n.strokeStyle = ce.colors.stroke.crosshair, n.beginPath(), n.arc(e + .5, o + .5, 2, 0, TWOPI, !1), n.stroke();
  12234. var a = Currency.format(RTBTC.quote(), r), s = i.toFixed(ce.volDecimals);
  12235. F(n, e, n.measureText(a).width), B(n, o, n.measureText(s).width), n.fillStyle = ce.colors.fill.flagtext, n.textAlign = "left", n.textBaseline = "middle", I(n, s, o, !0), n.textAlign = "center", O(n, a, e), ce.px.crosshairs.x = e, ce.px.crosshairs.y = t, ce.interacted = !0
  12236. }
  12237. }
  12238. function C(e, t) {
  12239. ce.interacted = !1;
  12240. var n = e || ce.canvas.i[0].getContext("2d");
  12241. if (!0 !== t) {
  12242. n.font = ce.font.labels;
  12243. var r = T(ce.px.crosshairs.x),
  12244. o = n.measureText(Currency.format("CNY", ce.volume, ce.volDecimals)).width + ce.px.lbl.tick + 6;
  12245. n.clearRect(ce.px.crosshairs.x - 4, r - 4, 8, 8), n.clearRect(0, ce.h - ce.px.lbl.h - ce.px.lbl.tick - 1, ce.w, ce.px.lbl.h + ce.px.lbl.tick + 1), n.clearRect(0, r - ce.px.lbl.font - 3, o, 2 * ce.px.lbl.font + 6)
  12246. } else n.clearRect(0, 0, ce.w, ce.h)
  12247. }
  12248. function E() {
  12249. window.reqAnimFrame(function () {
  12250. C()
  12251. })
  12252. }
  12253. function A(e, t) {
  12254. var n = ce.canvas.sweep[0].getContext("2d"), r = ce.canvas.sweepFill[0].getContext("2d"), o = z(e),
  12255. i = fe.bid.price[0] / RTBTC.quoteInt(), a = fe.ask.price[0] / RTBTC.quoteInt();
  12256. n.clearRect(0, 0, ce.w, ce.h), n.strokeStyle = ce.colors.stroke.order, r.clearRect(0, 0, ce.w, ce.h), r.fillStyle = ce.colors.fill.ordertext, o >= a ? (g(r, ce.sums.ask, fe.ask.price, !1, o), h(n, ce.sums.ask, fe.ask.price, !1, o)) : o <= i && (g(r, ce.sums.bid, fe.bid.price, !0, o), h(n, ce.sums.bid, fe.bid.price, !0, o))
  12257. }
  12258. function N() {
  12259. var e = ce.canvas.sweep[0].getContext("2d"), t = ce.canvas.sweepFill[0].getContext("2d");
  12260. e.clearRect(0, 0, ce.w, ce.h), t.clearRect(0, 0, ce.w, ce.h)
  12261. }
  12262. function P(e, t, n) {
  12263. var r = ce.h - (ce.px.lbl.h - ce.px.lbl.tick) / 2 - 2, o = V(n);
  12264. R(e, o, ce.h - ce.px.lbl.h - 2 * ce.px.lbl.tick - 1), j(e, o, ce.h - ce.px.lbl.h - .5 * ce.px.lbl.tick), e.fillText(t, o, r)
  12265. }
  12266. function O(e, t, n) {
  12267. var r = ce.h - (ce.px.lbl.h - ce.px.lbl.tick) / 2 - 2;
  12268. e.fillText(t, M(n, 10 + e.measureText(t).width), r)
  12269. }
  12270. function D(e, t, n, r) {
  12271. I(e, t, H(n), r)
  12272. }
  12273. function I(e, t, n, r) {
  12274. !0 !== r && (R(e, 0, n), j(e, ce.px.lbl.tick, n)), n = L(n, ce.px.lbl.font + 2), e.save(), e.strokeStyle = ce.colors.fill.blankBG, e.strokeText(t, ce.px.lbl.tick + 2, n), e.restore(), e.fillText(t, ce.px.lbl.tick + 2, n)
  12275. }
  12276. function M(e, t) {
  12277. return e > ce.w - t / 2 ? ce.w - t / 2 : e < t / 2 ? t / 2 : e
  12278. }
  12279. function L(e, t) {
  12280. var n = ce.h - ce.px.lbl.h - ce.px.lbl.tick - 1 - t / 2;
  12281. return e > n ? n : e < t / 2 ? t / 2 : e
  12282. }
  12283. function F(e, t, n) {
  12284. var r = 0 | M(t, n + 10), o = n / 2 + 5 | 0, i = M(t, 7);
  12285. e.beginPath(), R(e, r - o, ce.h - 1), j(e, r + o, ce.h - 1), j(e, r + o, ce.h - ce.px.lbl.h), j(e, i + 3.5, ce.h - ce.px.lbl.h), j(e, i, ce.h - ce.px.lbl.h - 4), j(e, i - 3.5, ce.h - ce.px.lbl.h), j(e, r - o, ce.h - ce.px.lbl.h), j(e, r - o, ce.h - 1), e.fill(), e.stroke()
  12286. }
  12287. function B(e, t, n) {
  12288. var r = ce.px.lbl.tick + 2 + n + 3, o = ce.px.lbl.font / 2;
  12289. t = L(t, ce.px.lbl.font + 2), e.beginPath(), R(e, 0, t), j(e, o, t - 1 - o), e.lineTo(.6 + (0 | r), .5 + (t - 1 - o | 0)), R(e, r, t - 1 - o), j(e, r, t + 1 + o), j(e, o, t + 1 + o), j(e, 0, t), e.fill(), e.stroke()
  12290. }
  12291. function R(e, t, n) {
  12292. e.moveTo(.5 + (0 | t), .5 + (0 | n))
  12293. }
  12294. function j(e, t, n) {
  12295. e.lineTo(.5 + (0 | t), .5 + (0 | n))
  12296. }
  12297. function q(e, t, n) {
  12298. e.lineTo(.6 + (0 | t), .5 + (0 | n))
  12299. }
  12300. function U(e, t, n, r, o) {
  12301. e.fillRect(0 | t, 0 | n, 0 | r, 0 | o)
  12302. }
  12303. function H(e) {
  12304. var t = 1 - e / ce.volume;
  12305. return (ce.h - ce.px.lbl.h - ce.px.lbl.tick - 2) * t | 0
  12306. }
  12307. function V(e) {
  12308. return ce.w * (e - ce.price.low) / ce.price.range | 0
  12309. }
  12310. function z(e) {
  12311. return ce.price.low + e / ce.w * ce.price.range
  12312. }
  12313. function W(e) {
  12314. return (1 - e / (ce.h - ce.px.lbl.h - ce.px.lbl.tick - 2)) * ce.volume
  12315. }
  12316. function G(e, t) {
  12317. return !(t < ce.h - ce.px.lbl.h - ce.px.lbl.tick - 1)
  12318. }
  12319. function Y() {
  12320. ce.canvas.i.on({
  12321. mousedown: function (e) {
  12322. Q(e), ce.mouse.sx = ce.mouse.x, ce.mouse.sy = ce.mouse.y, ce.mouse.s0 = ce.price.scale, ce.mouse.down = !0, G(ce.mouse.x, ce.mouse.y) && (ce.mouse.zoom = !0), stopEvent(e)
  12323. }, click: function (e) {
  12324. Q(e), ce.mouse.sx = ce.mouse.x, ce.mouse.sy = ce.mouse.y, ce.mouse.s0 = ce.price.scale, S(ce.mouse.x, ce.mouse.y)
  12325. }, mouseup: function (e) {
  12326. ce.mouse.down = !1, ce.mouse.zoom = !1, e.ctrlKey && e.shiftKey || Z(e)
  12327. }, mouseout: function (e) {
  12328. ce.mouse.down = !1, ce.mouse.zoom = !1, E(), N()
  12329. }, mousemove: function (e) {
  12330. ce.mouse.down ? (J(e), ce.mouse.zoom && ce.canvas.i.css("cursor", "e-resize")) : (ce.mouse.shift && !e.shiftKey && N(), Q(e), G(ce.mouse.x, ce.mouse.y) ? (E(), ce.canvas.i.css("cursor", "e-resize")) : (S(ce.mouse.x, ce.mouse.y), ce.canvas.i.css("cursor", "pointer")))
  12331. }, dblclick: function (e) {
  12332. ce.mouse.down = !1, ce.mouse.zoom = !1, ce.price.scale != ce.price.defaultScale && (ce.price.scale = ce.price.defaultScale, ce.flags.recompute = !0, i(), stopEvent(e))
  12333. }
  12334. }), ce.canvas.i.bind("pinch", K), ce.canvas.i.bind("mousewheel", X), RTBTC.handler("newbook", ce.element, ie), RTBTC.handler("orders", ce.element, ae)
  12335. }
  12336. function X(e, t, n, r) {
  12337. ce.allowScale = !0, stopEvent(e);
  12338. var o = 1;
  12339. if (void 0 !== n || void 0 !== r) {
  12340. 0 != n ? o = 1 - .01 * n : 0 != r && (o = 1 - .1 * r);
  12341. var a = ce.price.scale;
  12342. ce.price.scale *= o, ce.price.scale > ce.price.maxScale && (ce.price.scale = ce.price.maxScale), ce.price.scale < ce.price.minScale && (ce.price.scale = ce.price.minScale), ce.price.scale != a && i()
  12343. }
  12344. }
  12345. function K(e, t) {
  12346. if (null != t.scale) {
  12347. w = ce.px.bar.width;
  12348. var n = ce.price.scale;
  12349. ce.price.scale *= t.scale, ce.price.scale > ce.price.maxScale && (ce.price.scale = ce.price.maxScale), ce.price.scale < ce.price.minScale && (ce.price.scale = ce.price.minScale), ce.price.scale != n && i()
  12350. }
  12351. t.originalEvent.preventDefault(), t.originalEvent.stopPropagation()
  12352. }
  12353. function Q(e) {
  12354. if (e.offsetX) ce.mouse.x = e.offsetX, ce.mouse.y = e.offsetY; else if (e.pageX) {
  12355. var t = ce.canvas.i.offset();
  12356. ce.mouse.x = e.pageX - t.left, ce.mouse.y = e.pageY - t.top
  12357. }
  12358. ce.mouse.shift = e.shiftKey
  12359. }
  12360. function J(e) {
  12361. if (Q(e), ce.mouse.zoom) {
  12362. var t = ce.mouse.x - ce.mouse.sx, n = ce.price.scale;
  12363. e.shiftKey ? ce.price.scale = ce.mouse.s0 * (1 - t / 1e3) : ce.price.scale = ce.mouse.s0 * (1 - t / 100), ce.price.scale > ce.price.maxScale && (ce.price.scale = ce.price.maxScale), ce.price.scale < ce.price.minScale && (ce.price.scale = ce.price.minScale), ce.price.scale != n && i()
  12364. }
  12365. }
  12366. function Z(e) {
  12367. if (Q(e), !G(ce.mouse.x, ce.mouse.y)) {
  12368. var t = +z(ce.mouse.x).toFixed(ce.price.decimals), n = "", r = 0, o = {side: "", price: t};
  12369. fe.bid.price.length > 0 && t <= fe.bid.price[0] / RTBTC.quoteInt() ? ce.mouse.shift ? (n = "sell", r = OBD.sumToPrice(t, "bid"), o.amount = r) : n = "buy" : fe.ask.price.length > 0 && t >= fe.ask.price[0] / RTBTC.quoteInt() && (ce.mouse.shift ? (n = "buy", r = OBD.sumToPrice(t, "ask"), o.amount = r) : n = "sell"), o.side = n, RTBTC.trigger("set-order-entry-" + n, o), ce.mouse.shift && N()
  12370. }
  12371. }
  12372. function ee() {
  12373. }
  12374. function te() {
  12375. var e = $(ce.element).width(), t = $(ce.element).height();
  12376. ce.w == e && ce.h == t || (ce.w = e, ce.h = t, $("canvas", ce.element).each(function (e, t) {
  12377. $(t).attr("width", ce.w + "px").attr("height", ce.h + "px")
  12378. }), i(!0))
  12379. }
  12380. function ne() {
  12381. if (!isNaN(parseInt(ce.w)) && (ce.w = 0 | ce.w, ce.w >= 0)) {
  12382. try {
  12383. ce.orders = new Array(ce.w + 1), ce.yVals = new Array(ce.w + 1)
  12384. } catch (e) {
  12385. DEBUG && ue("Exception on Array size");
  12386. try {
  12387. "console" in window && console.log("Warning: " + ce.w)
  12388. } catch (e) {
  12389. }
  12390. }
  12391. i()
  12392. }
  12393. }
  12394. function re() {
  12395. ce.module.setTitle(_("Visual Depth"))
  12396. }
  12397. function oe(e) {
  12398. var t = e.price / RTBTC.quoteInt();
  12399. s(), "bid" == e.location ? t >= ce.price.low && (ce.flags.redraw.bid = !0, o()) : "ask" == e.location && t <= ce.price.high && (ce.flags.redraw.ask = !0, o()), ce.settings.orders && b(e)
  12400. }
  12401. function ie() {
  12402. ce.flags.recompute = !0, ce.flags.redraw.base = !0, ce.flags.redraw.bid = !0, ce.flags.redraw.ask = !0, C(null, !0), i(!0)
  12403. }
  12404. function ae() {
  12405. var e, t, n = UserAccount.orders(), r = null, o = 0;
  12406. if (n.hasOwnProperty("BIJIE")) {
  12407. n = n.BIJIE;
  12408. for (e in n) n.hasOwnProperty(e) && (o++, null == r && ((r = ce.canvas.userOrders[0].getContext("2d")).clearRect(0, 0, ce.w, ce.h), r.text = ce.font.overlays, r.textBaseline = "bottom", r.strokeStyle = ce.colors.stroke.order, r.fillStyle = ce.colors.fill.ordertext, r.beginPath()), (t = n[e]).quote == RTBTC.quote() && se(r, t));
  12409. null != r && (r.fill(), r.stroke()), 0 == o && ce.userOrders > 0 && (r = ce.canvas.userOrders[0].getContext("2d")).clearRect(0, 0, ce.w, ce.h), ce.userOrders = o
  12410. }
  12411. }
  12412. function se(e, t) {
  12413. var n = V(t.price), r = 0, o = "", i = "", a = t.quote;
  12414. n < 0 || n > ce.w || (R(e, n, r = T(n)), j(e, n - ce.px.lbl.tick / 2, r - ce.px.lbl.tick), q(e, n + ce.px.lbl.tick / 2, r - ce.px.lbl.tick), j(e, n, r), "buy" == t.action ? (o = _("BUY"), e.textAlign = "left", n -= ce.px.lbl.tick / 2) : "sell" == t.action && (o = _("SELL"), e.textAlign = "right", n += ce.px.lbl.tick / 2), i = Currency.format(a, t.price), o += " " + RTBTC.numFormatShort(t.amount, 8) + " @ " + i, e.fillText(o, n, r - 1.5 * ce.px.lbl.tick))
  12415. }
  12416. function le(e) {
  12417. Colors.hasOwnProperty(e) && (ce.colors = Colors[e], i())
  12418. }
  12419. var ce = {
  12420. element: "",
  12421. parent: null,
  12422. module: null,
  12423. self: null,
  12424. canvas: {
  12425. bg: null,
  12426. bidFill: null,
  12427. askFill: null,
  12428. bid: null,
  12429. ask: null,
  12430. sweepFill: null,
  12431. sweep: null,
  12432. orders: null,
  12433. userOrders: null,
  12434. axes: null,
  12435. lbl: null,
  12436. i: null
  12437. },
  12438. w: 0,
  12439. h: 0,
  12440. price: {low: 5, high: 10, range: 5, scale: .01, defaultScale: .01, minScale: 1e-5, maxScale: 1e5, decimals: 4},
  12441. volume: 100,
  12442. volDecimals: 2,
  12443. orders: [],
  12444. orderDelay: 1250,
  12445. userOrders: 0,
  12446. yVals: [],
  12447. allowScale: !1,
  12448. sums: {bid: [], ask: []},
  12449. log: {m: 0, b: 0, b10: 0},
  12450. px: {pad: 5, lbl: {w: 65, h: 16, tick: 4, halftick: 2, font: 11}, crosshairs: {x: 0, y: 0}},
  12451. flags: {redraw: {base: !0, bid: !0, ask: !0}, recompute: !0, widget: !1},
  12452. interacted: !1,
  12453. mouse: {down: !1, zoom: !1, x: 0, y: 0, sx: 0, sy: 0, s0: null, shift: !1},
  12454. colors: Colors.c1,
  12455. SOLID: 0,
  12456. DOTTED: 1,
  12457. DASHED: 2,
  12458. DASHDOT: 3,
  12459. font: {
  12460. precision: 6,
  12461. labels: '11px/1.0em Consolas, "Courier New", monospace',
  12462. size: 11,
  12463. lineHeight: 1,
  12464. face: 'Consolas, "Courier New", monospace',
  12465. overlays: "10px/1.0em Arial, sans-serif",
  12466. overlaySize: 10,
  12467. heading: "12px/1.0em Arial, sans-serif",
  12468. headingBold: "bold 12px/1.0em Arial, sans-serif",
  12469. headingSize: 12
  12470. },
  12471. watermark: "© RTBTC",
  12472. settings: {grid: !0, fill: !0, orders: !0},
  12473. debug: RTBTC.isDebug()
  12474. }, ue = RTBTC.debug, fe = OBD.book;
  12475. return {
  12476. build: function (n, r, o) {
  12477. return ce.element = n, ce.parent = r, e(), Y(), t(o), window.setTimeout(function () {
  12478. RTBTC.trigger("what-theme", null)
  12479. }, 100), this
  12480. }, module: function (e) {
  12481. return ce.module = e, re(), RTBTC.handler("newbook", ce.module.id(), ce.self.onBook), RTBTC.handler("depth", ce.module.id(), ce.self.onDepth), RTBTC.handler("theme", ce.module.id(), ce.self.onTheme), RTBTC.handler("orders", ce.module.id(), ae), RTBTC.handler("order-canceled", ce.module.id(), ae), this
  12482. }, self: function (e) {
  12483. ce.self = e
  12484. }, settings: function () {
  12485. return r()
  12486. }, save: function () {
  12487. return n()
  12488. }, load: function (e) {
  12489. t(e), i()
  12490. }, unload: function () {
  12491. RTBTC.unregisterAll(ce.module.id())
  12492. }, onDepth: function (e) {
  12493. oe(e)
  12494. }, onTheme: function (e) {
  12495. le(e)
  12496. }, onBook: function (e) {
  12497. ie()
  12498. }, resize: function (e) {
  12499. ee(), window.reqAnimFrame(te), ne()
  12500. }, resizeStop: function () {
  12501. ne()
  12502. }, drag: function (e) {
  12503. e
  12504. }, widget: function (e) {
  12505. return null == e || void 0 === e ? ce.flags.widget : (ce.flags.widget = e, this)
  12506. }, internals: ce.debug ? function () {
  12507. return ce
  12508. } : function () {
  12509. return {}
  12510. }
  12511. }
  12512. }, custLine = function () {
  12513. function e() {
  12514. window.reqAnimFrame(function () {
  12515. t()
  12516. })
  12517. }
  12518. function t() {
  12519. D.canvas[0].getContext("2d").clearRect(0, 0, D.chart.w, D.chart.h);
  12520. for (var e = 0; e < D.objLines.length; e++) D.objLines[e].draw();
  12521. n()
  12522. }
  12523. function n() {
  12524. var e = b();
  12525. I.globalCompositeOperation = "destination-out", I.fillStyle = "rgba(250,250,250,1)", I.beginPath(), I.rect(0, 0, D.chart.w, D.chart.h), o(I, e.x, e.y), i(I, e.x, e.y + e.h), i(I, e.x + e.w, e.y + e.h), i(I, e.x + e.w, e.y), i(I, e.x, e.y), I.closePath(), I.fill(), I.globalCompositeOperation = "source-over"
  12526. }
  12527. function r(e, t, n, r, o) {
  12528. e.strokeRect(.5 + (0 | t), .5 + (0 | n), 0 | r, 0 | o)
  12529. }
  12530. function o(e, t, n) {
  12531. e.moveTo(.5 + (0 | t), .5 + (0 | n))
  12532. }
  12533. function i(e, t, n) {
  12534. e.lineTo(.5 + (0 | t), .5 + (0 | n))
  12535. }
  12536. function a(e) {
  12537. I.strokeStyle = C.line, I.lineWidth = 1, I.beginPath();
  12538. for (n = 0; n < e.points.length; n++) {
  12539. r = e.points[n];
  12540. o(I, r[0], r[1]), i(I, r[2], r[3])
  12541. }
  12542. I.stroke(), I.fillStyle = C.text, I.textBaseline = "bottom", I.textAlign = "left", I.font = "12px Arial";
  12543. var t = 0;
  12544. if ("periodicLine" != e.name && "fibonacciSequence" != e.name || (t = 40), e.text.length > 0) {
  12545. for (var n = 0; n < e.points.length; n++) {
  12546. var r = e.points[n];
  12547. I.fillText(e.text[n], r[0], r[1] + t)
  12548. }
  12549. I.stroke()
  12550. }
  12551. D.selectDrawObj && e.id == D.selectDrawObj.id && u(e)
  12552. }
  12553. function s(e) {
  12554. I.strokeStyle = C.line, I.lineWidth = 1, I.beginPath();
  12555. for (var t = 0; t < e.points.length; t++) {
  12556. n = e.points[t];
  12557. o(I, n[0], n[1]), i(I, n[2], n[3])
  12558. }
  12559. I.stroke(), I.fillStyle = C.text, I.textBaseline = "bottom", I.textAlign = "left", I.font = "12px Arial";
  12560. var n = e.points[0];
  12561. I.fillText(e.text[0], n[0], n[1]), I.fillText(e.text[1], n[2], n[3]), I.stroke(), D.selectDrawObj && e.id == D.selectDrawObj.id && u(e)
  12562. }
  12563. function l(e) {
  12564. I.fillStyle = I.strokeStyle = e.up ? C.upArrow : C.downArrow, I.lineWidth = 1, I.beginPath();
  12565. var t = e.points[0];
  12566. o(I, t[0], t[1]);
  12567. for (var n = 0; n < e.points.length; n++) t = e.points[n], i(I, t[0], t[1]);
  12568. I.stroke(), I.fill()
  12569. }
  12570. function c(e) {
  12571. I.strokeStyle = C.line, I.lineWidth = 1;
  12572. for (var t = 0; t < e.points.length; t++) {
  12573. var n = e.points[t];
  12574. r(I, n[0], n[1], n[2] - n[0], n[3] - n[1])
  12575. }
  12576. I.fillStyle = C.text, I.textBaseline = "bottom", I.textAlign = "left", I.font = "12px Arial", (n = e.points[0])[0] <= n[2] ? I.textAlign = "left" : I.textAlign = "right", I.fillText(e.text[0], n[0], n[1]), n[0] > n[2] ? I.textAlign = "left" : I.textAlign = "right", I.textBaseline = "top", I.fillText(e.text[1], n[2], n[3]), D.selectDrawObj && e.id == D.selectDrawObj.id && u(e)
  12577. }
  12578. function u(e) {
  12579. I.strokeStyle = C.pot, I.fillStyle = "black", I.lineWidth = 1;
  12580. var t = 3;
  12581. 1 == e.large && (t = 5), e.pots.forEach(function (e) {
  12582. I.beginPath(), I.arc(e[0] + .5, e[1] + .5, t, 0, 2 * Math.PI, !0), I.stroke(), I.beginPath(), I.arc(e[0] + .5, e[1] + .5, t - 1, 0, 2 * Math.PI, !0), I.fill()
  12583. })
  12584. }
  12585. function f() {
  12586. function e() {
  12587. return (65536 * (1 + Math.random()) | 0).toString(16).substring(1)
  12588. }
  12589. return e() + e() + "-" + e() + "-" + e()
  12590. }
  12591. function d(e) {
  12592. var t = !1;
  12593. return e.forEach(function (e) {
  12594. var n = D.mouse.x, r = D.mouse.y, o = e[0], i = e[1], a = e[2], s = e[3], l = s - i, c = o - a, u = a * i - o * s,
  12595. f = l, d = c, p = u + 5 * Math.sqrt(l * l + c * c), h = l, g = c, m = u - 5 * Math.sqrt(l * l + c * c);
  12596. f * n + d * r + p > 0 && h * n + g * r + m < 0 && -c * n + l * r + (c * o - l * i) > 0 && -c * n + l * r + (c * a - l * s) < 0 && (t = !0)
  12597. }), t
  12598. }
  12599. function p() {
  12600. D.objLines && D.objLines.forEach(function (e) {
  12601. e.selectPotIndex = null
  12602. })
  12603. }
  12604. function h(e) {
  12605. var t = !1;
  12606. return e.pots.forEach(function (n, r) {
  12607. var o = D.mouse.x, i = D.mouse.y;
  12608. Math.sqrt((o - n[0]) * (o - n[0]) + (i - n[1]) * (i - n[1])) <= 5 && (e.selectPotIndex = r, t = !0)
  12609. }), t
  12610. }
  12611. function g() {
  12612. D.selectDrawObj = null;
  12613. for (var t = 0; t < D.objLines.length; t++) switch (drawType = D.objLines[t].drawType || D.LINES, drawType) {
  12614. case D.LINES:
  12615. var n = d(D.objLines[t].points), r = h(D.objLines[t]);
  12616. 1 != n && 1 != r || (D.selectDrawObj = D.objLines[t], 0 == r && (D.selectDrawObj.selectPotIndex = null));
  12617. break;
  12618. case D.RECT:
  12619. var o = [];
  12620. D.objLines[t].points.forEach(function (e) {
  12621. o.push([e[0], e[1], e[2], e[1]]), o.push([e[2], e[1], e[2], e[3]]), o.push([e[2], e[3], e[0], e[3]]), o.push([e[0], e[3], e[0], e[1]])
  12622. });
  12623. var n = d(o), r = h(D.objLines[t]);
  12624. 1 != n && 1 != r || (D.selectDrawObj = D.objLines[t], 0 == r && (D.selectDrawObj.selectPotIndex = null));
  12625. break;
  12626. case D.ARROW:
  12627. PtInPolygon([D.mouse.x, D.mouse.y], D.objLines[t].points) && (D.selectDrawObj = D.objLines[t])
  12628. }
  12629. e()
  12630. }
  12631. function m() {
  12632. D.chart.canvas.i.on({
  12633. mousedown: function (t) {
  12634. 0 == t.button && (v(t), D.mouseOri.x = D.mouse.x, D.mouseOri.y = D.mouse.y, D.mouseDown = !0, D.curLine ? (D.objLines.push(D.curLine), D.curLine.init(), D.selectDrawObj = D.curLine, D.curLine = null) : g(), e())
  12635. }, mousemove: function (t) {
  12636. v(t);
  12637. var n = !1;
  12638. if (D.selectDrawObj && 1 == D.mouseDown && (D.selectDrawObj.moving(), n = !0), D.selectDrawObj && 0 == D.mouseDown) {
  12639. var r = D.selectDrawObj.large, o = h(D.selectDrawObj);
  12640. D.selectDrawObj.large = 1 == o
  12641. }
  12642. D.selectDrawObj && (n || r != D.selectDrawObj.large) && e()
  12643. }
  12644. }), $(document).on({
  12645. mouseup: function (e) {
  12646. 1 == D.mouseDown && (D.mouseDown = !1, p())
  12647. }, keydown: function (t) {
  12648. var n = t || window.event;
  12649. 46 == (n.keyCode || n.which || n.charCode) && D.selectDrawObj && (D.objLines.forEach(function (e, t) {
  12650. e.name == D.selectDrawObj.name && e.id == D.selectDrawObj.id && (D.objLines.splice(t, 1), 0 == D.objLines.length && D.nullDrawObj && D.nullDrawObj())
  12651. }), e())
  12652. }
  12653. })
  12654. }
  12655. function v(e) {
  12656. if (e.offsetX) D.mouse.x = e.offsetX, D.mouse.y = e.offsetY; else if (e.pageX) {
  12657. var t = D.canvas.offset();
  12658. D.mouse.x = e.pageX - t.left, D.mouse.y = e.pageY - t.top
  12659. }
  12660. }
  12661. function b() {
  12662. return {
  12663. x: D.chart.offset,
  12664. y: 0,
  12665. w: D.chart.w - D.chart.offset - D.chart.px.lbl.w - D.chart.px.lbl.tick - 1,
  12666. h: D.chart.slots[0].px + D.chart.slots[0].h
  12667. }
  12668. }
  12669. function y() {
  12670. this.name = "percentLine", this.points = [], this.pots = [], this.text = [], this.selectPotIndex = 1;
  12671. var e = [0, 1 / 8, .25, 1 / 3, 3 / 8, .5, 5 / 8, 2 / 3, .75, 7 / 8, 1];
  12672. this.init = function () {
  12673. var t = b();
  12674. this.points = [];
  12675. for (var n = D.chart.yToVal(0, D.mouse.y), r = 0; r < 11; r++) this.points.push([t.x, D.mouse.y, t.w + t.x, D.mouse.y]), this.text.push((100 * e[r]).toFixed(2) + "% " + n.toFixed(2));
  12676. return this.pots = [], this.pots.push([D.w / 2, D.mouse.y, 0]), this.pots.push([D.w / 2, D.mouse.y, 10]), this.points
  12677. }, this.moving = function () {
  12678. if (D.mouseDown) {
  12679. var t = D.mouse.y - D.mouseOri.y;
  12680. null != this.selectPotIndex && 0 != t ? 1 == this.selectPotIndex ? (this.points.forEach(function (n, r, o) {
  12681. n[1] = n[3] += t * e[r]
  12682. }), this.pots.forEach(function (n, r, o) {
  12683. n[1] += t * e[n[2]]
  12684. })) : 0 == this.selectPotIndex && (this.points.forEach(function (n, r, o) {
  12685. n[1] = n[3] += t * (1 - e[r])
  12686. }), this.pots.forEach(function (n, r, o) {
  12687. n[1] += t * (1 - e[n[2]])
  12688. })) : null == this.selectPotIndex && 0 != t && (this.points.forEach(function (e, n, r) {
  12689. e[1] = e[3] += t
  12690. }), this.pots.forEach(function (e, n, r) {
  12691. e[1] += t
  12692. })), this.text = [];
  12693. var n = this;
  12694. this.points.forEach(function (t, r) {
  12695. var o = D.chart.yToVal(0, t[1]);
  12696. n.text.push((100 * e[r]).toFixed(2) + "% " + o.toFixed(2))
  12697. }), D.mouseOri.y = D.mouse.y
  12698. }
  12699. }, this.draw = function () {
  12700. a(this)
  12701. }
  12702. }
  12703. function x() {
  12704. this.name = "godPercentLines", this.points = [], this.pots = [], this.text = [], this.selectPotIndex = 1;
  12705. var e = [0, .191, .382, .5, .618, 1, 1.191, 1.382, 1.5, 1.618, 2];
  12706. this.init = function () {
  12707. var t = b();
  12708. this.points = [];
  12709. for (var n = D.chart.yToVal(0, D.mouse.y), r = 0; r < 11; r++) this.points.push([t.x, D.mouse.y, t.w + t.x, D.mouse.y]), this.text.push((100 * e[r]).toFixed(2) + "% " + n.toFixed(2));
  12710. return this.pots = [], this.pots.push([D.w / 2, D.mouse.y, 0]), this.pots.push([D.w / 2, D.mouse.y, 5]), this.points
  12711. }, this.moving = function () {
  12712. if (D.mouseDown) {
  12713. var t = D.mouse.y - D.mouseOri.y;
  12714. null != this.selectPotIndex && 0 != t ? 1 == this.selectPotIndex ? (this.points.forEach(function (n, r, o) {
  12715. n[1] = n[3] += t * e[r]
  12716. }), this.pots.forEach(function (n, r, o) {
  12717. n[1] += t * e[n[2]]
  12718. })) : 0 == this.selectPotIndex && (this.points.forEach(function (n, r, o) {
  12719. n[1] = n[3] += t * (1 - e[r])
  12720. }), this.pots.forEach(function (n, r, o) {
  12721. n[1] += t * (1 - e[n[2]])
  12722. })) : null == this.selectPotIndex && 0 != t && (this.points.forEach(function (e, n, r) {
  12723. e[1] = e[3] += t
  12724. }), this.pots.forEach(function (e, n, r) {
  12725. e[1] += t
  12726. })), this.text = [];
  12727. var n = this;
  12728. this.points.forEach(function (t, r) {
  12729. var o = D.chart.yToVal(0, t[1]);
  12730. n.text.push((100 * e[r]).toFixed(2) + "% " + o.toFixed(2))
  12731. }), D.mouseOri.y = D.mouse.y
  12732. }
  12733. }, this.draw = function () {
  12734. a(this)
  12735. }
  12736. }
  12737. function w() {
  12738. this.name = "wavePercentLines", this.points = [], this.pots = [], this.text = [], this.selectPotIndex = 1;
  12739. var e = [0, .25, .333, .5, 1];
  12740. this.init = function () {
  12741. var t = b();
  12742. this.points = [];
  12743. for (var n = D.chart.yToVal(0, D.mouse.y), r = 0; r < 5; r++) this.points.push([t.x, D.mouse.y, t.w + t.x, D.mouse.y]), this.text.push((100 * e[r]).toFixed(2) + "% " + n.toFixed(2));
  12744. return this.pots = [], this.pots.push([D.w / 2, D.mouse.y, 0]), this.pots.push([D.w / 2, D.mouse.y, 4]), this.points
  12745. }, this.moving = function () {
  12746. if (D.mouseDown) {
  12747. var t = D.mouse.y - D.mouseOri.y;
  12748. null != this.selectPotIndex && 0 != t ? 1 == this.selectPotIndex ? (this.points.forEach(function (n, r, o) {
  12749. n[1] = n[3] += t * e[r]
  12750. }), this.pots.forEach(function (n, r) {
  12751. n[1] += t * e[n[2]]
  12752. })) : 0 == this.selectPotIndex && (this.points.forEach(function (n, r, o) {
  12753. n[1] = n[3] += t * (1 - e[r])
  12754. }), this.pots.forEach(function (n, r, o) {
  12755. n[1] += t * (1 - e[n[2]])
  12756. })) : null == this.selectPotIndex && 0 != t && (this.points.forEach(function (e, n, r) {
  12757. e[1] = e[3] += t
  12758. }), this.pots.forEach(function (e, n, r) {
  12759. e[1] += t
  12760. })), this.text = [];
  12761. var n = this;
  12762. this.points.forEach(function (t, r) {
  12763. var o = D.chart.yToVal(0, t[1]);
  12764. n.text.push((100 * e[r]).toFixed(2) + "% " + o.toFixed(2))
  12765. }), D.mouseOri.y = D.mouse.y
  12766. }
  12767. }, this.draw = function () {
  12768. a(this)
  12769. }
  12770. }
  12771. function k() {
  12772. this.name = "fibonacciSequence", this.points = [], this.pots = [], this.text = [], this.selectPotIndex = null;
  12773. var e = [];
  12774. this.id = f(), this.init = function () {
  12775. var t = b();
  12776. this.points = [];
  12777. D.chart.yToVal(0, D.mouse.y);
  12778. for (var n = 0; n < 100; n++) 0 == n ? e.push(0) : e.push(n + e[n - 1]);
  12779. for (var r = D.chart.xToBar(D.mouse.x), o = 0; o < e.length; o++) {
  12780. var i = D.chart.toPxX(r - e[o]);
  12781. if (i > t.x + t.w) break;
  12782. this.points.push([i, 0, i, t.h]), this.text.push(o)
  12783. }
  12784. return this.pots = [], this.pots.push([D.chart.toPxX(r), t.h / 2, 0]), this.points
  12785. }, this.moving = function () {
  12786. if (D.mouseDown) {
  12787. var t = b();
  12788. this.points = [], this.text = [];
  12789. for (var n = D.chart.xToBar(D.mouse.x), r = 0; r < e.length; r++) {
  12790. var o = D.chart.toPxX(n - e[r]);
  12791. if (o > t.x + t.w) break;
  12792. this.points.push([o, 0, o, t.h]), this.text.push(r)
  12793. }
  12794. this.pots.forEach(function (e, t, r) {
  12795. e[0] = D.chart.toPxX(n)
  12796. })
  12797. }
  12798. }, this.draw = function () {
  12799. a(this)
  12800. }
  12801. }
  12802. function T() {
  12803. this.name = "periodicLine", this.points = [], this.pots = [], this.text = [], this.id = f(), this.selectPotIndex = 1;
  12804. var e = 0;
  12805. this.init = function () {
  12806. var e = b();
  12807. this.points = [];
  12808. D.chart.yToVal(0, D.mouse.y);
  12809. for (var t = D.chart.xToBar(D.mouse.x), n = 0; n < 300; n++) {
  12810. var r = D.chart.toPxX(t - n);
  12811. this.points.push([r, 0, r, e.h]), this.text.push(n)
  12812. }
  12813. return this.pots = [], this.pots.push([D.chart.toPxX(t), e.h / 2, 0]), this.pots.push([D.chart.toPxX(t - 1), e.h / 2, 0]), this.points
  12814. }, this.moving = function () {
  12815. if (D.mouseDown) {
  12816. b();
  12817. var t = D.mouse.x - D.mouseOri.x;
  12818. if (null != this.selectPotIndex && 0 != t) if (0 == this.selectPotIndex) {
  12819. e += t;
  12820. for (var n = parseInt(e / (D.chart.px.bar.spacing + D.chart.px.bar.width)), r = 0; r < this.points.length; r++) this.points[r][0] = this.points[r][2] += n * (D.chart.px.bar.spacing + D.chart.px.bar.width);
  12821. this.pots[1][0] += n * (D.chart.px.bar.spacing + D.chart.px.bar.width), this.pots[0][0] += n * (D.chart.px.bar.spacing + D.chart.px.bar.width), e %= D.chart.px.bar.spacing + D.chart.px.bar.width
  12822. } else {
  12823. e += t;
  12824. for (var n = parseInt(e / (D.chart.px.bar.spacing + D.chart.px.bar.width)), r = 0; r < this.points.length; r++) this.points[r][0] = this.points[r][2] += r * n * (D.chart.px.bar.spacing + D.chart.px.bar.width), this.text[r] += n * r;
  12825. this.pots[1][0] += n * (D.chart.px.bar.spacing + D.chart.px.bar.width), e %= D.chart.px.bar.spacing + D.chart.px.bar.width
  12826. }
  12827. D.mouseOri.x = D.mouse.x
  12828. }
  12829. }, this.draw = function () {
  12830. a(this)
  12831. }
  12832. }
  12833. function S() {
  12834. this.name = "lineSegment", this.points = [], this.pots = [], this.text = [], this.id = f(), this.selectPotIndex = 1;
  12835. var e = 0;
  12836. this.init = function () {
  12837. b();
  12838. this.points = [];
  12839. for (var e = D.chart.yToVal(0, D.mouse.y), t = D.chart.xToBar(D.mouse.x), n = D.chart.barToIndex(t), r = new Date(D.chart.bars.data[n][0]).Format("yyyy.MM.dd") + " " + e.toFixed(2), o = D.chart.toPxX(t), i = D.chart.toPxY(e, 0), a = 0; a < 1; a++) this.points.push([o, i, o, i]), this.text.push(r);
  12840. return this.pots = [], this.pots.push([o, i]), this.pots.push([o, i]), this.points
  12841. }, this.moving = function () {
  12842. if (D.mouseDown) {
  12843. var t = D.mouse.y - D.mouseOri.y, n = D.mouse.x - D.mouseOri.x;
  12844. e += n;
  12845. var r = parseInt(e / (D.chart.px.bar.spacing + D.chart.px.bar.width)) * (D.chart.px.bar.spacing + D.chart.px.bar.width);
  12846. null == this.selectPotIndex || 0 == t && 0 == r ? null != this.selectPotIndex || 0 == t && 0 == r || (this.points.forEach(function (e, n, o) {
  12847. e[0] += r, e[1] += t, e[2] += r, e[3] += t
  12848. }), this.pots.forEach(function (e, n, o) {
  12849. e[1] += t, e[0] += r
  12850. })) : 1 == this.selectPotIndex ? (this.points[0][2] += r, this.points[0][3] += t, this.pots[1][0] += r, this.pots[1][1] += t) : 0 == this.selectPotIndex && (this.points[0][0] += r, this.points[0][1] += t, this.pots[0][0] += r, this.pots[0][1] += t), this.text = [];
  12851. var o = this.points[0], i = D.chart.yToVal(0, o[1]), a = D.chart.xToBar(o[0]), s = D.chart.barToIndex(a),
  12852. l = D.chart.bars.data[s] ? new Date(D.chart.bars.data[s][0]).Format("yyyy.MM.dd") : "";
  12853. this.text.push(l + " " + i.toFixed(2)), i = D.chart.yToVal(0, o[3]), a = D.chart.xToBar(o[2]), s = D.chart.barToIndex(a), l = D.chart.bars.data[s] ? new Date(D.chart.bars.data[s][0]).Format("yyyy.MM.dd") : "", this.text.push(l + " " + i.toFixed(2)), e %= D.chart.px.bar.spacing + D.chart.px.bar.width, D.mouseOri.y = D.mouse.y, D.mouseOri.x = D.mouse.x
  12854. }
  12855. }, this.draw = function () {
  12856. s(this)
  12857. }
  12858. }
  12859. function E() {
  12860. function e(e, t) {
  12861. var n = D.chart.bars.data.slice(e, t + 1), r = n.length, o = (1 + r) / 2, i = 0, a = 0, s = 0;
  12862. n.forEach(function (e, t) {
  12863. i += e[4], a += e[4] * (t + 1), s += (t + 1) * (t + 1)
  12864. });
  12865. var l, c, u = i / r, f = (a - r * o * u) / (s - r * o * o), d = u - f * o, p = d + 1 * f, h = d + f * r, g = 0,
  12866. m = 0;
  12867. n.forEach(function (e, t) {
  12868. var n = (e[2] - (t + 1) * f - d) / Math.sqrt(d * d + f * f);
  12869. n > g && (g = n, l = t), (n = (e[3] - (t + 1) * f - d) / Math.sqrt(d * d + f * f)) < m && (m = n, c = t)
  12870. });
  12871. var v = n[l || 0][2] - ((l || 0) + 1) * f, b = f, y = v + 1 * b, x = v + b * r,
  12872. w = n[c || 0][3] - ((c || 0) + 1) * f, $ = f;
  12873. return [[p, h], [y, x], [w + 1 * $, w + $ * r]]
  12874. }
  12875. this.name = "regressionLine", this.points = [], this.pots = [], this.text = [], this.id = f(), this.selectPotIndex = 1;
  12876. var t = 0;
  12877. this.init = function () {
  12878. var e = b();
  12879. this.points = [];
  12880. for (var t = D.chart.yToVal(0, D.mouse.y), n = D.chart.xToBar(D.mouse.x), r = (D.chart.barToIndex(n), D.chart.toPxX(n)), o = (D.chart.toPxY(t, 0), 0); o < 2; o++) this.points.push([r, 0, r, e.h]);
  12881. for (var i = 0; i < 3; i++) this.points.push([r, 0, r, 0]);
  12882. return this.pots = [], this.pots.push([r, e.h / 2]), this.pots.push([r, e.h / 2]), this.points
  12883. }, this.moving = function () {
  12884. if (D.mouseDown) {
  12885. var n = D.mouse.y - D.mouseOri.y, r = D.mouse.x - D.mouseOri.x;
  12886. t += r;
  12887. var o = parseInt(t / (D.chart.px.bar.spacing + D.chart.px.bar.width)) * (D.chart.px.bar.spacing + D.chart.px.bar.width);
  12888. null == this.selectPotIndex || 0 == n && 0 == o ? null != this.selectPotIndex || 0 == n && 0 == o || (this.points.forEach(function (e, t, n) {
  12889. e[0] += o, e[2] += o
  12890. }), this.pots.forEach(function (e, t, n) {
  12891. e[0] += o
  12892. })) : 1 == this.selectPotIndex ? (this.points[1][0] = this.points[1][2] += o, this.points[2][2] += o, this.points[3][2] += o, this.points[4][2] += o, this.pots[1][0] += o) : 0 == this.selectPotIndex && (this.points[0][0] = this.points[0][2] += o, this.points[2][0] += o, this.points[3][0] += o, this.points[4][0] += o, this.pots[0][0] += o), index1 = D.chart.barToIndex(D.chart.xToBar(this.points[0][0])), index2 = D.chart.barToIndex(D.chart.xToBar(this.points[1][0]));
  12893. var i, a = 0, s = 0;
  12894. index1 > index2 ? (i = e(index2, index1), a = D.chart.toPxY(i[0][0], 0), s = D.chart.toPxY(i[0][1], 0), y2 = D.chart.toPxY(i[1][0], 0), y3 = D.chart.toPxY(i[1][1], 0), y4 = D.chart.toPxY(i[2][0], 0), y5 = D.chart.toPxY(i[2][1], 0), this.points[2][3] = a, this.points[2][1] = s, this.points[3][3] = y2, this.points[3][1] = y3, this.points[4][3] = y4, this.points[4][1] = y5) : index1 < index2 ? (i = e(index1, index2), a = D.chart.toPxY(i[0][0], 0), s = D.chart.toPxY(i[0][1], 0), y2 = D.chart.toPxY(i[1][0], 0), y3 = D.chart.toPxY(i[1][1], 0), y4 = D.chart.toPxY(i[2][0], 0), y5 = D.chart.toPxY(i[2][1], 0), this.points[2][3] = s, this.points[2][1] = a, this.points[3][3] = y3, this.points[3][1] = y2, this.points[4][3] = y5, this.points[4][1] = y4) : (this.points[2][3] = 0, this.points[2][1] = 0, this.points[3][3] = 0, this.points[3][1] = 0, this.points[4][3] = 0, this.points[4][1] = 0), t %= D.chart.px.bar.spacing + D.chart.px.bar.width, D.mouseOri.y = D.mouse.y, D.mouseOri.x = D.mouse.x
  12895. }
  12896. }, this.draw = function () {
  12897. a(this)
  12898. }
  12899. }
  12900. function A() {
  12901. this.name = "rectLine", this.drawType = D.RECT, this.id = f(), this.points = [], this.pots = [], this.text = [], this.selectPotIndex = 1;
  12902. var e = 0;
  12903. this.init = function () {
  12904. b();
  12905. this.points = [];
  12906. for (var e = D.chart.yToVal(0, D.mouse.y), t = D.chart.xToBar(D.mouse.x), n = D.chart.barToIndex(t), r = new Date(D.chart.bars.data[n][0]).Format("yyyy.MM.dd") + " " + e.toFixed(2), o = D.chart.toPxX(t), i = D.chart.toPxY(e, 0), a = 0; a < 1; a++) this.points.push([o, i, o, i]);
  12907. return this.text.push(r), this.text.push(r), this.pots = [], this.pots.push([o, i]), this.pots.push([o, i]), this.points
  12908. }, this.moving = function () {
  12909. if (D.mouseDown) {
  12910. var t = D.mouse.y - D.mouseOri.y, n = D.mouse.x - D.mouseOri.x;
  12911. e += n;
  12912. var r = parseInt(e / (D.chart.px.bar.spacing + D.chart.px.bar.width)) * (D.chart.px.bar.spacing + D.chart.px.bar.width);
  12913. null == this.selectPotIndex || 0 == t && 0 == r ? null != this.selectPotIndex || 0 == t && 0 == r || (this.points.forEach(function (e, n, o) {
  12914. e[0] += r, e[1] += t, e[2] += r, e[3] += t
  12915. }), this.pots.forEach(function (e, n, o) {
  12916. e[1] += t, e[0] += r
  12917. })) : 1 == this.selectPotIndex ? (this.points[0][2] += r, this.points[0][3] += t, this.pots[1][0] += r, this.pots[1][1] += t) : 0 == this.selectPotIndex && (this.points[0][0] += r, this.points[0][1] += t, this.pots[0][0] += r, this.pots[0][1] += t), this.text = [];
  12918. var o = this.points[0], i = D.chart.yToVal(0, o[1]), a = D.chart.xToBar(o[0]), s = D.chart.barToIndex(a),
  12919. l = D.chart.bars.data[s] ? new Date(D.chart.bars.data[s][0]).Format("yyyy.MM.dd") : "";
  12920. this.text.push(l + " " + i.toFixed(2)), i = D.chart.yToVal(0, o[3]), a = D.chart.xToBar(o[2]), s = D.chart.barToIndex(a), l = D.chart.bars.data[s] ? new Date(D.chart.bars.data[s][0]).Format("yyyy.MM.dd") : "", this.text.push(l + " " + i.toFixed(2)), e %= D.chart.px.bar.spacing + D.chart.px.bar.width, D.mouseOri.y = D.mouse.y, D.mouseOri.x = D.mouse.x
  12921. }
  12922. }, this.draw = function () {
  12923. c(this)
  12924. }
  12925. }
  12926. function N() {
  12927. this.name = "singleLine", this.points = [], this.pots = [], this.text = [], this.selectPotIndex = null, this.init = function () {
  12928. var e = b();
  12929. this.points = [];
  12930. for (var t = D.chart.yToVal(0, D.mouse.y), n = 0; n < 1; n++) this.points.push([e.x, D.mouse.y, e.w + e.x, D.mouse.y]), this.text.push(t.toFixed(2));
  12931. return this.pots = [], this.pots.push([D.w / 2, D.mouse.y, 0]), this.points
  12932. }, this.moving = function () {
  12933. if (D.mouseDown) {
  12934. var e = D.mouse.y - D.mouseOri.y;
  12935. 0 != e && (this.points.forEach(function (t, n, r) {
  12936. t[1] = t[3] += e
  12937. }), this.pots.forEach(function (t, n, r) {
  12938. t[1] += e
  12939. })), this.text = [];
  12940. var t = this;
  12941. this.points.forEach(function (e, n) {
  12942. var r = D.chart.yToVal(0, e[1]);
  12943. t.text.push(r.toFixed(2))
  12944. }), D.mouseOri.y = D.mouse.y
  12945. }
  12946. }, this.draw = function () {
  12947. a(this)
  12948. }
  12949. }
  12950. function P() {
  12951. this.name = "upArrow", this.up = !0, this.id = f(), this.drawType = D.ARROW, this.points = [], this.pots = [], this.text = [], this.selectPotIndex = null;
  12952. var e = 0;
  12953. this.init = function () {
  12954. b();
  12955. this.points = [];
  12956. var e = D.chart.toPxX(D.chart.xToBar(D.mouse.x)), t = D.mouse.y;
  12957. return this.points.push([e, t]), this.points.push([e + 10, t + 10]), this.points.push([e + 10, t + 14]), this.points.push([e + 2, t + 6]), this.points.push([e + 2, t + 20]), this.points.push([e - 2, t + 20]), this.points.push([e - 2, t + 6]), this.points.push([e - 10, t + 14]), this.points.push([e - 10, t + 10]), this.points.push([e, t]), this.points
  12958. }, this.moving = function () {
  12959. if (D.mouseDown) {
  12960. var t = D.mouse.x - D.mouseOri.x, n = D.mouse.y - D.mouseOri.y;
  12961. e += t, 0 == n && 0 == t || this.points.forEach(function (t, r, o) {
  12962. t[0] += e - e % (D.chart.px.bar.spacing + D.chart.px.bar.width), t[1] += n
  12963. }), e %= D.chart.px.bar.spacing + D.chart.px.bar.width, D.mouseOri.x = D.mouse.x, D.mouseOri.y = D.mouse.y
  12964. }
  12965. }, this.draw = function () {
  12966. l(this)
  12967. }
  12968. }
  12969. function O() {
  12970. this.name = "downArrow", this.up = !1, this.id = f(), this.drawType = D.ARROW, this.points = [], this.pots = [], this.text = [], this.selectPotIndex = null;
  12971. var e = 0;
  12972. this.init = function () {
  12973. b();
  12974. this.points = [];
  12975. var e = D.chart.toPxX(D.chart.xToBar(D.mouse.x)), t = D.mouse.y;
  12976. return this.points.push([e, t]), this.points.push([e + 10, t - 10]), this.points.push([e + 10, t - 14]), this.points.push([e + 2, t - 6]), this.points.push([e + 2, t - 20]), this.points.push([e - 2, t - 20]), this.points.push([e - 2, t - 6]), this.points.push([e - 10, t - 14]), this.points.push([e - 10, t - 10]), this.points.push([e, t]), this.points
  12977. }, this.moving = function () {
  12978. if (D.mouseDown) {
  12979. var t = D.mouse.x - D.mouseOri.x, n = D.mouse.y - D.mouseOri.y;
  12980. e += t, 0 == n && 0 == t || this.points.forEach(function (t, r, o) {
  12981. t[0] += e - e % (D.chart.px.bar.spacing + D.chart.px.bar.width), t[1] += n
  12982. }), e %= D.chart.px.bar.spacing + D.chart.px.bar.width, D.mouseOri.x = D.mouse.x, D.mouseOri.y = D.mouse.y
  12983. }
  12984. }, this.draw = function () {
  12985. l(this)
  12986. }
  12987. }
  12988. var D = {
  12989. canvas: $("#line"),
  12990. chart: null,
  12991. w: 0,
  12992. h: 0,
  12993. objLines: [],
  12994. curLine: null,
  12995. points: [],
  12996. selectDrawObj: null,
  12997. LINES: 0,
  12998. CIRCLE: 1,
  12999. RECT: 2,
  13000. ARROW: 3,
  13001. mouse: {},
  13002. mouseOri: {}
  13003. }, I = D.canvas[0].getContext("2d");
  13004. return {
  13005. build: function () {
  13006. return D.w = D.canvas.width(), D.h = D.canvas.height(), this
  13007. }, add: function (e, t) {
  13008. switch (e) {
  13009. case"percentLine":
  13010. D.curLine = new y;
  13011. break;
  13012. case"godPercentLine":
  13013. D.curLine = new x;
  13014. break;
  13015. case"wavePercentLines":
  13016. D.curLine = new w;
  13017. break;
  13018. case"fibonacciSequence":
  13019. D.curLine = new k;
  13020. break;
  13021. case"periodicLine":
  13022. D.curLine = new T;
  13023. break;
  13024. case"lineSegment":
  13025. D.curLine = new S;
  13026. break;
  13027. case"regressionLine":
  13028. D.curLine = new E;
  13029. break;
  13030. case"rectLine":
  13031. D.curLine = new A;
  13032. break;
  13033. case"singleLine":
  13034. D.curLine = new N;
  13035. break;
  13036. case"upArrow":
  13037. D.curLine = new P;
  13038. break;
  13039. case"downArrow":
  13040. D.curLine = new O
  13041. }
  13042. }, setType: function (e) {
  13043. D._drawType = e
  13044. }, resize: function () {
  13045. return D.w = D.canvas.width(), D.h = D.canvas.height(), this
  13046. }, setChartData: function (e) {
  13047. D.chart = e, m()
  13048. }, ifNull: function (e) {
  13049. D.nullDrawObj = e
  13050. }, clean: function () {
  13051. D.objLines = [], D.curLine = null, D.selectDrawObj = null, I.clearRect(0, 0, D.w, D.h), D.nullDrawObj && D.nullDrawObj()
  13052. }, deleteLine: function () {
  13053. D.selectDrawObj && (D.objLines.forEach(function (e, t) {
  13054. e.name == D.selectDrawObj.name && e.id == D.selectDrawObj.id && (D.objLines.splice(t, 1), 0 == D.objLines.length && D.nullDrawObj && D.nullDrawObj())
  13055. }), e())
  13056. }
  13057. }
  13058. }, C = {upArrow: "#ff4056", downArrow: "#34ce6b", line: "#787878", text: "#20acea", pot: "#20acea"};
  13059. Array.prototype.clone = function () {
  13060. return JSON.parse(JSON.stringify(this))
  13061. };
  13062. var UserAccount, UserAccount_Class = function () {
  13063. function e() {
  13064. function e(e) {
  13065. if (null != e && void 0 !== e) {
  13066. var n = null;
  13067. e.hasOwnProperty("exch") ? (n = e.exch, e.hasOwnProperty("orders") && null != e.orders && e.orders.hasOwnProperty("length") && (t(e.orders, n), RTBTC.trigger("orders"))) : DEBUG && _debug("No exchange sent with orders!", RTBTC.ERROR)
  13068. } else _ordersFail()
  13069. }
  13070. function t(e, t) {
  13071. var o = "", i = 0;
  13072. millitime();
  13073. for (o in r.orders[t]) r.orders[t].hasOwnProperty(o) && (r.orders[t][o], delete r.orders[t][o]);
  13074. for (i = 0; i < e.length; i++) n(e[i], t)
  13075. }
  13076. function n(e, t) {
  13077. var n = e.id, o = millitime();
  13078. null != t && void 0 !== t ? (r.orders[t] || (r.orders[t] = {}), r.orders[t].hasOwnProperty(n) ? r.orders[t][n].hasOwnProperty("added") && (r.orders[t][n].added = 0) : (r.orders[t][n] = {}, r.orders[t][n].added = o), r.orders[t][n].action = e.action, r.orders[t][n].amount = parseFloat(e.amount), r.orders[t][n].price = parseFloat(e.price), r.orders[t][n].base = e.base, r.orders[t][n].quote = e.quote, r.orders[t][n].status = e.status, "Unknown" == r.orders[t][n].status && (r.orders[t][n].status = "Open")) : DEBUG && _debug("Order triggered with no exchange!", RTBTC.ERROR)
  13079. }
  13080. var r = {orders: {}};
  13081. return {
  13082. orders: function () {
  13083. return r.orders
  13084. }, ordersAdd: function (t) {
  13085. e(t)
  13086. }
  13087. }
  13088. }
  13089. var t = null;
  13090. return new function () {
  13091. this.Build = function () {
  13092. return null == t && ((t = new e).constructor = null), t
  13093. }
  13094. }
  13095. }(), timesList = [], timeLimit = 1e3, times = 7,
  13096. app = angular.module("tradeApp", ["pascalprecht.translate", "ngCookies", "sly"]);
  13097. app.config(["$translateProvider", "$httpProvider", function (e, t) {
  13098. t.interceptors.push("myInterceptor"), window.translations = e.translations, function (t) {
  13099. e.translations(t, window["mm" + t]), e.preferredLanguage(t), e.useSanitizeValueStrategy("escape")
  13100. }(initLang)
  13101. }]).controller("tradeController", ["$scope", "$rootScope", "$http", "$interval", "$cookies", "$timeout", "$document", "$window", "$q", "streamer", "user", "$translate", "userStreamer", "klineStreamer", "tradeStreamer", "pageLoading1", "scroll", "mktdataStreamer", "form", "mobile", "$filter", "urlSearch", "SPA", "divLoading", function (e, t, n, r, i, a, s, l, c, u, f, d, p, h, g, m, v, b, y, x, w, k, T, S) {
  13102. function C(t, n) {
  13103. var r = new Date;
  13104. if (r.setFullYear(2999), document.cookie = "lang=" + t.toUpperCase() + ";path=/;expires=" + r.toGMTString(), $("#loaded" + t).length) translations(t, window["mm" + t]), d.use(t); else {
  13105. var o = document.createElement("script");
  13106. o.src = n + t + ".js?v=" + r.getTime(), o.type = "text/javascript", o.id = "loaded" + t, o.onload = function () {
  13107. translations(t, window["mm" + t]), d.use(t);
  13108. var n = e.$root.$$phase;
  13109. "$apply" != n && "$digest" != n && e.$apply()
  13110. }, document.getElementsByTagName("head")[0].appendChild(o)
  13111. }
  13112. }
  13113. function E(t) {
  13114. e.products = t, BTCConvert.setProducts(t), "y" == i.logined && e.getUserAsset(), A(t), e.getTransToUSDT(e.products);
  13115. for (var n = 0; n < t.length; n++) -1 == e.Markets.indexOf(t[n].quoteAsset) && e.Markets.push(t[n].quoteAsset), e.lastPrices[t[n].baseAsset] = t[n].close, e.productSplit[t[n].symbol] = {
  13116. base: t[n].baseAsset,
  13117. quote: t[n].quoteAsset
  13118. }, e.assetFixed[t[n].quoteAsset] = t[n].decimalPlaces, e.assetFixed[t[n].baseAsset] = t[n].decimalPlaces, e.fixed[t[n].symbol] = t[n].decimalPlaces, e.minFixed[t[n].symbol] = {
  13119. qtyTick: Math.abs(Math.log10(t[n].minTrade)),
  13120. priceTick: Math.abs(Math.log10(t[n].tickSize))
  13121. }, e.currentProduct, angular.forEach(e.products, function (t, n) {
  13122. var r = Math.abs(Math.log10(t.tickSize)), o = Math.abs(Math.log10(t.minTrade));
  13123. e.products[n].priceTick = r, e.products[n].qtyTick = o, e.products[n].close = Number(t.close), null == t.close || 0 == t.close ? e.products[n].changeRate = 0 : e.products[n].changeRate = 100 * Number(t.close - t.open) / t.open
  13124. }), console.log(e.products)
  13125. }
  13126. function A(n) {
  13127. angular.forEach(n, function (r, o) {
  13128. if (r.symbol == e.product.symbol) {
  13129. e.currentProduct = r, Data.baseFixed = e.currentProduct.qtyTick = Math.abs(Math.log10(Number(e.currentProduct.minTrade))), Data.qouteFixed = e.currentProduct.priceTick = Math.abs(Math.log10(Number(e.currentProduct.tickSize))), chart.redraw(), e.currentProduct.amountTick = Math.abs(Math.log10(e.currentProduct.tickSize * e.currentProduct.minTrade)), e.currentProduct.amountTick = Math.min(e.currentProduct.amountTick, 8), 8 == e.depthMergeUnit && (e.depthMergeUnit = e.currentProduct.priceTick), e.priceRegExp = new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.priceTick + "}0*)?$"), e.newest = e.currentProduct.close, e.buy_order.price = e.sell_order.sell_price = e.currentProduct.close && Number(e.currentProduct.close).toFixed(e.fixed[e.currentProduct.symbol]), t.pageTitle = e.currentProduct.symbol, e.depthUnits = [];
  13130. for (var i = 3; i >= 0;) e.currentProduct.priceTick - i < 0 ? i-- : (e.depthUnits.push(e.currentProduct.priceTick - i), i--);
  13131. e.depthMergeChange(e.depthUnits[e.depthUnits.length - 1]), e.trade(e.currentProduct.close), Z = n[o - 1 < 0 ? o - 1 + n.length : o - 1].baseAsset + "_" + n[o - 1 < 0 ? o - 1 + n.length : o - 1].quoteAsset, ee = n[(o + 1) % n.length].baseAsset + "_" + n[(o + 1) % n.length].quoteAsset, $(window).bind("keyup", N)
  13132. }
  13133. })
  13134. }
  13135. function N(e) {
  13136. if (te) {
  13137. if ((new Date).getTime() - te < 600) return
  13138. } else te = (new Date).getTime();
  13139. te = (new Date).getTime(), 33 == e.keyCode && ($(window).unbind("keyup", N), T.setUrl("?symbol=" + Z)), 34 == e.keyCode && ($(window).unbind("keyup", N), T.setUrl("?symbol=" + ee))
  13140. }
  13141. function P(t) {
  13142. angular.forEach(e.products, function (n, r) {
  13143. -1 != jQuery.inArray(n.symbol, t) && (e.products[r].pro = !0)
  13144. }), e.getProNum()
  13145. }
  13146. function O(t) {
  13147. if (t && t instanceof Array) {
  13148. var n = {};
  13149. n.exch = "BIJIE", n.orders = [], t.forEach(function (t) {
  13150. t.symbol == e.product.symbol && n.orders.push({
  13151. id: t.id || t.orderId,
  13152. action: t.side.toLowerCase(),
  13153. amount: t.origQty,
  13154. price: t.price,
  13155. base: e.product.baseCurrency,
  13156. quote: e.product.qouteCurrency,
  13157. status: "Open"
  13158. })
  13159. }), UserAccount.ordersAdd(n)
  13160. }
  13161. }
  13162. function D(e, t) {
  13163. return Math.floor(new Big(e + "").times(new Big(Math.pow(10, t) + "")).toString()) / Math.pow(10, t)
  13164. }
  13165. function I(e, t) {
  13166. return Math.ceil(new Big(e + "").times(new Big(Math.pow(10, t) + "")).toString()) / Math.pow(10, t)
  13167. }
  13168. function M(t, n, r, o) {
  13169. angular.forEach(t, function (t) {
  13170. if (e.depthUnits.length) if (e.depthMergeUnit != e.depthUnits[e.depthUnits.length - 1].value) {
  13171. var i = !1;
  13172. r.forEach(function (r) {
  13173. r[0] == o(Number(t), e.depthMergeUnit) && (r[1] += Number(n[t]), r[2] += Number(n[t] * t), i = !0)
  13174. }), i || r.push([o(Number(t), e.depthMergeUnit), Number(n[t]), Number(n[t]) * Number(t)])
  13175. } else r.push([Number(t), Number(n[t]), Number(t) * Number(n[t])])
  13176. })
  13177. }
  13178. function _(e, t) {
  13179. var n = [], r = [];
  13180. angular.forEach(e, function (e) {
  13181. n.push(e)
  13182. }), angular.forEach(t, function (e) {
  13183. r.push(e)
  13184. });
  13185. var o = sortDepth.medianUnit(n, r, 48);
  13186. angular.forEach(e, function (e) {
  13187. e.push({width: sortDepth.width(e[1], o) * xe / 100})
  13188. }), angular.forEach(t, function (e) {
  13189. e.push({width: sortDepth.width(e[1], o) * xe / 100})
  13190. })
  13191. }
  13192. function L(e, t) {
  13193. e && e.forEach(function (e) {
  13194. var n = Number(e[0]), r = Number(e[1]);
  13195. 0 != r ? t[n] = r : delete t[n]
  13196. })
  13197. }
  13198. function F(e) {
  13199. for (; e.length < 51;) e.push(["--", "--", "--", {width: 0}])
  13200. }
  13201. function B(e) {
  13202. for (; e.length < 51;) e.unshift(["--", "--", "--", {width: 0}])
  13203. }
  13204. function R(e, t) {
  13205. he.clean(), chart.setCrossHair(!0), chart.fixTime(!1), chart.setBarwidth(ke), chart.clearData(), chart.setMode(t), le = ae(se = e), chart.setResolution(Number(e))
  13206. }
  13207. function j(e) {
  13208. var t;
  13209. return "MACD" == e ? t = "macd" : "TRIX" == e ? t = "trix" : "KDJ" == e ? t = "kdj" : "BRAR" == e || ("StochRSI" == e ? t = "storsi" : "VR" == e || ("RSI" == e ? t = "rsi" : "EMV" == e ? t = "emv" : "DMI" == e ? t = "dmi" : "WR" == e ? t = "wpr" : "OBV" == e ? t = "obv" : "ROC" == e || ("BOLL" == e ? t = "bnd" : "MTM" == e ? t = "mtm" : "SAR" == e ? t = "psar" : "EMA" == e ? t = "ema" : "PSY" == e || ("CCI" == e ? t = "cci" : "VWAP" == e ? t = "vwap" : "MA" == e ? t = "ma" : "AVL" == e && (t = "avl"))))), t
  13210. }
  13211. function q(t) {
  13212. e.depthWrong = t;
  13213. var n = e.$root.$$phase;
  13214. "$apply" != n && "$digest" != n && e.$apply()
  13215. }
  13216. function U(t, n, r) {
  13217. [t, n].forEach(function (t) {
  13218. t && t.forEach(function (t) {
  13219. "--" != t[0] && (t[4] = !1, r && r.forEach(function (n) {
  13220. if (n.symbol == e.product.symbol) {
  13221. var r = n.price;
  13222. "SELL" == n.side ? r = I(r, e.depthMergeUnit) : "BUY" == n.side && (r = D(r, e.depthMergeUnit)), t[0] == r && (t[4] = !0)
  13223. }
  13224. }))
  13225. })
  13226. })
  13227. }
  13228. if (console.log = function () {
  13229. }, T.UrlChange = function () {
  13230. e.product.oriSymbol = k.getUrlParam("symbol") || localStorage.echangeProduct || "BNB_BTC", e.product.symbol = e.product.oriSymbol.replace("_", ""), void 0 !== e.product.symbol && (e.product.baseCurrency = e.product.oriSymbol.split("_")[0], e.product.qouteCurrency = e.product.oriSymbol.split("_")[1]), e.buy_order.quantity = "", e.sell_order.sell_quantity = "", e.market_buy_order.quantity = "", e.market_sell_order.quantity = "", S.loading("#chart"), RTBTC.instrument("BIJIE", e.product.symbol, e.product.qouteCurrency), chart.setResolution(Number(X[e.curIndex])), e.Islogin && (e.getCommission(e.product.symbol), e.getUserAsset()), A(e.products), e.getStreamers(), e.getLocalProStatus()
  13231. }, t.ts = k.getUrlParam("ts"), e.agentId = k.getUrlParam("ref"), t.ts) {
  13232. /^[\w|\d|\.|-]+$/.test(t.ts) && sessionStorage.setItem("ts", t.ts.substr(0, 16))
  13233. }
  13234. e.agentId && sessionStorage.setItem("refId", e.agentId);
  13235. location.host.match("localhost") || location.host.match("192.168.0");
  13236. e.tradeDetail = !0, e.product = {}, e.EXCHANGE = "Binance", e.lang = window.localStorage.lang, e.timeLang = "zh-cn", "cn" != e.lang && (e.timeLang = "en"), e.product.oriSymbol = k.getUrlParam("symbol") || localStorage.echangeProduct || "BNB_BTC", e.curIndex = 1 * localStorage.curIndex || 0, e.product.symbol = e.product.oriSymbol.replace("_", ""), e.buy_order = {}, e.sell_order = {}, e.market_buy_order = {}, e.market_sell_order = {}, e.stopBuy_order = {}, e.stopSell_order = {}, e.userAsset = {}, e.fixed = {}, e.assetFixed = {};
  13237. var H = new Date, V = H.getFullYear(), z = H.getMonth(), W = H.getDate(), G = new Date(V, z, W, 0, 0, 0).getTime(),
  13238. Y = H.setDate(H.getDate() + 1), X = [60, 60, 300, 900, 1800, 3600, 7200, 14400, 21600, 43200, 86400, 604800];
  13239. window.dateStartSelect = function () {
  13240. WdatePicker({dateFmt: "yyyy-MM-dd", maxDate: "#F{$dp.$D('lscj_end')||'%y-%M-%d'}", readOnly: !0, lang: e.timeLang})
  13241. }, window.dateEndSelect = function () {
  13242. WdatePicker({dateFmt: "yyyy-MM-dd", minDate: "#F{$dp.$D('lscj_start')}", readOnly: !0, lang: e.timeLang})
  13243. };
  13244. var K = d.instant;
  13245. d.instant = function (e) {
  13246. return (K(e) == e ? mmen[e] : K(e)) || e
  13247. };
  13248. var Q = (new Date).getTime();
  13249. n.get("/exchange/public/serverTime").success(function (t) {
  13250. var n = ((new Date).getTime() - Q) / 2, r = new Date(Math.round(Number(t) + n)).getTime() - (new Date).getTime();
  13251. e.today = new Date((new Date).getTime() + r);
  13252. var o = "";
  13253. setInterval(function () {
  13254. var e = w("date")(new Date((new Date).getTime() + r), "yyyy-MM-dd HH:mm:ss");
  13255. e != o && (o = e, $("#todaytime").text(o))
  13256. }, 100)
  13257. }), e.logout = f.logout, e.getUserBaseDetail = function () {
  13258. n({method: "post", url: "/user/basedetail.html"}).success(function (t) {
  13259. e.userBaseInfo = t, e.userEmail = t.email.split("@")[0]
  13260. })
  13261. }, $("body").attr("class", localStorage.lang), e.switching = function (t) {
  13262. C(t, "/" + resourcePerfixed + "/js/i18n/"), window.localStorage.lang = t, e.lang = t, $("body").attr("class", t)
  13263. };
  13264. var J;
  13265. e.currentUserAsset = null, e.getUserAsset = function () {
  13266. n.post("/exchange/private/userAsset").success(function (t) {
  13267. t = t || [], e.userAssets = [], t.forEach(function (t) {
  13268. 0 == Number(t.free) && 0 == Number(t.freeze) && 0 == Number(t.withdrawing) && 0 == Number(t.locked) || e.userAssets.push(t)
  13269. }), e.userAssetsNum = t.length, e.totalMarketValue = 0, e.totalProfit = 0, e.cost = 0, e.totalAsset = 0, e.freezeAsset = 0, e.qouteFree = 0, e.baseFree = 0, angular.forEach(e.userAssets, function (t) {
  13270. t.asset == e.product.qouteCurrency && (e.currentUserAsset = t.free, e.qouteFree = t.free), t.asset == e.product.baseCurrency && (e.baseFree = t.free)
  13271. }), e.btcWatch = [e.products, e.userAssets], J && J(), J = e.$watch("btcWatch", function () {
  13272. angular.forEach(e.userAssets, function (e) {
  13273. e.btcValue = BTCConvert.getNewPrice(e.asset, 1 * e.free + 1 * e.freeze + 1 * e.locked + 1 * e.withdrawing)
  13274. })
  13275. }, !0)
  13276. })
  13277. }, e.refresh = function () {
  13278. window.location.href = window.location.href
  13279. }, e.getOrders = function () {
  13280. n({method: "post", url: "/exchange/private/openOrders"}).success(function (t) {
  13281. O(t), e.openOrders = t;
  13282. var n = e.openOrders.length;
  13283. e.IsopenOrdersNull = 0 == n, U(e.asksTwenty, e.bidsTwenty, e.openOrders)
  13284. })
  13285. }, e.allOrders = [], e.getTradeOrders = function (t, r, o, i) {
  13286. e.loading = !0;
  13287. var a = new Date, s = (a.getTime(), a.setDate(a.getDate() - 1), $.param({page: t, rows: r, start: o, end: i}));
  13288. n.post("/exchange/private/tradeOrders", s).success(function (t) {
  13289. e.loading = !1, t.data ? (e.scrollLoading = !1, angular.forEach(t.data, function (t, n) {
  13290. -1 == e.allOrders.indexOf(t) && e.allOrders.push(t), 0 == t.statusCode && (e.allOrders[n].executedPrice = t.price)
  13291. }), e.tradeOrdersCurrentPage = t.page, e.tradeOrdersPages = t.pages, e.isBottom("tradeOrderBox", e.getTradeOrders, e.tradeOrdersCurrentPage, e.tradeOrdersPages, G, Y)) : e.allOrders = []
  13292. })
  13293. }, e.cal = function (e, t, n) {
  13294. var r = $(n.target).parent("span"), o = Math.pow(.1, e), i = r.siblings("input"), a = i.val();
  13295. a ? t ? i.val((1 * a + o).toFixed(e)) : a > o && i.val((1 * a - o).toFixed(e)) : (a = o, i.val(a.toFixed(e))), i.trigger("input")
  13296. }, e.orderPercent = function (t, n, r) {
  13297. var o = {};
  13298. if (e.userAssets) {
  13299. for (var i = 0; i < e.userAssets.length; i++) o[e.userAssets[i].asset] = e.userAssets[i].free;
  13300. "limit" == r ? "buy" == n && e.buy_order.price ? e.buy_order.quantity = re(t * o[e.currentProduct.quoteAsset] / e.buy_order.price, e.currentProduct.qtyTick) : e.sell_order.sell_quantity = re(t * o[e.currentProduct.baseAsset], e.currentProduct.qtyTick) : "market" == r ? "buy" == n ? e.market_buy_order.quantity = re(t * o[e.currentProduct.quoteAsset] / e.currentProduct.close, e.currentProduct.qtyTick) : e.market_sell_order.quantity = re(t * o[e.currentProduct.baseAsset], e.currentProduct.qtyTick) : "stopLimit" == r && ("buy" == n ? e.stopBuy_order.price && (e.stopBuy_order.quantity = re(t * o[e.currentProduct.quoteAsset] / e.stopBuy_order.price, e.currentProduct.qtyTick)) : e.stopSell_order.quantity = re(t * o[e.currentProduct.baseAsset], e.currentProduct.qtyTick))
  13301. }
  13302. }, e.setTimequantum = function (t, n) {
  13303. if (e.Islogin) {
  13304. var r = new Date, o = r.getFullYear(), i = r.getMonth(), a = r.getDate(), s = new Date(o, i, a, 0, 0, 0),
  13305. l = s.getTime(), c = new Date(o, i, a, 0, 0, 0).setDate(new Date(o, i, a, 0, 0, 0).getDate() + 1);
  13306. switch (t) {
  13307. case 0:
  13308. l = s.getTime();
  13309. break;
  13310. case 1:
  13311. l = Math.abs(s.setDate(s.getDate() - 7));
  13312. break;
  13313. case 2:
  13314. l = Math.abs(s.setMonth(s.getMonth() - 1));
  13315. break;
  13316. case 3:
  13317. l = Math.abs(s.setMonth(s.getMonth() - 3))
  13318. }
  13319. n(1, 30, l, c)
  13320. } else e.showLoginBox()
  13321. }, e.search_submit = function (t, n) {
  13322. if (e.Islogin) {
  13323. var r = new Date($("#" + n + "_start").val()).setHours(0), o = new Date($("#" + n + "_end").val()).setHours(0);
  13324. r && o && t(1, 30, r, o)
  13325. } else e.showLoginBox()
  13326. }, e.isBottom = function (t, n, r, o, i, a) {
  13327. (t = document.getElementById(t)).onscroll = function () {
  13328. var s = t.clientHeight;
  13329. if (t.scrollHeight == s + t.scrollTop) {
  13330. var l = r + 1;
  13331. l <= o ? (e.scrollLoading = !0, n(l, 30, i, a)) : e.scrollLoading = !1;
  13332. var c = e.$root.$$phase;
  13333. "$apply" != c && "$digest" != c && e.$apply()
  13334. }
  13335. }
  13336. }, e.dealOrders = [], e.getDealOrders = function (t, r, o, i) {
  13337. e.loading = !0;
  13338. var a = $.param({page: t, start: o, rows: r, end: i});
  13339. n.post("/exchange/private/userTrades", a).success(function (t) {
  13340. e.loading = !1, t.data ? (e.scrollLoading = !1, angular.forEach(t.data, function (t) {
  13341. -1 == e.dealOrders.indexOf(t) && e.dealOrders.push(t)
  13342. }), e.dealOrdersCurrentPage = t.page, e.dealOrdersPages = t.pages, e.isBottom("userTradeBox", e.getDealOrders, e.dealOrdersCurrentPage, e.dealOrdersPages, o, i)) : e.dealOrders = []
  13343. })
  13344. }, e.isLogin = function () {
  13345. if ("y" == i.logined) {
  13346. e.Islogin = !0;
  13347. i.userId;
  13348. e.getUserBaseDetail(), e.getOrders(), e.getTradeOrders(1, 30, G, Y), e.getDealOrders(1, 30, G, Y), e.getCommission(e.product.symbol), e.getUserInfo()
  13349. } else e.Islogin = !1
  13350. }, e.hideInfo = function () {
  13351. angular.element(".wrap").removeClass("blur"), angular.element(".overlayer,#aboutus-box").hide()
  13352. }, e.getTransToUSDT = function (t) {
  13353. angular.forEach(t, function (t, n) {
  13354. "USDT" == t.quoteAsset && (e.transToUSDT[t.baseAsset] = t.close)
  13355. }), e.transToUSDT.USDT = 1
  13356. }, e.products = [], e.currentProduct = {}, e.productSplit = {}, e.lastPrices = {}, e.minFixed = {}, e.lastPrices.BTC = 1, e.priceRegExp = new RegExp("^\\d+(\\.\\d{0,8}0*)?$"), e.depthUnits = [], e.transToUSDT = {USDT: 1}, e.getTradeLists = function () {
  13357. n.get("/exchange/public/product").success(function (t) {
  13358. if (t.data.length) {
  13359. for (var r = t.data, o = !1, i = 0; i < r.length; i++) r[i].symbol == e.product.symbol && (o = !0), r[i].pro = !1;
  13360. e.Islogin ? setTimeout(function () {
  13361. e.getFavorite(r)
  13362. }, 0) : setTimeout(function () {
  13363. e.noLoginFavoreteFun(r)
  13364. }, 0), o ? E(r) : n.get("/exchange/public/product?symbol=" + e.product.baseAsset + "_" + e.product.quoteAsset).success(function (e) {
  13365. e.data[0] && r.push(e.data[0]), E(r)
  13366. })
  13367. } else e.products = []
  13368. })
  13369. }, e.changeMarket = function (t) {
  13370. e.curMarket = t
  13371. }, e.Markets = [];
  13372. var Z, ee, te;
  13373. e.getTradeLists(), e.getCnyusd = function () {
  13374. n.get("/exchange/public/cnyusd").success(function (t) {
  13375. e.cnyusdRate = t.rate
  13376. })
  13377. }, e.getCnyusd(), e.orderKey = "tradedMoney", e.isSameKey = "tradedMoney", e.orderDesc = !1, e.sortByKey = function (t, n) {
  13378. e.orderKey = t, e.isSameKey != t ? (e.isSameKey = t, e.orderDesc = !0) : n || (e.orderDesc = !e.orderDesc)
  13379. }, e.sortByKey(e.orderKey);
  13380. location.host.match("localhost") || location.host.match("192.168.0");
  13381. e.delayHide = function (t, n) {
  13382. e[n] = a(function () {
  13383. e[t] = !1
  13384. }, 500)
  13385. }, e.clearTimer = function (t) {
  13386. a.cancel(e[t])
  13387. };
  13388. var ne;
  13389. e.selectProduct = function (t, n, r, o) {
  13390. if (r.stopPropagation(), ne) {
  13391. if ((new Date).getTime() - ne < 300) return
  13392. } else ne = (new Date).getTime();
  13393. ne = (new Date).getTime(), e.isShowProduct = !1, localStorage.ProStatus = t + n, localStorage.setStatus = t + "_" + n, localStorage.quoteAsset = n, localStorage.curMarket = o, localStorage.thisMarket = "" == o ? "Favorete" : n, T.setUrl("?symbol=" + t + "_" + n)
  13394. }, e.getLocalProStatus = function () {
  13395. void 0 !== localStorage.ProStatus && (e.proStatus = localStorage.ProStatus, window.location.search.indexOf("symbol") < 0 && (window.location.href = "/tradeDetail.html?symbol=" + localStorage.setStatus)), void 0 !== localStorage.quoteAsset ? void 0 !== localStorage.thisMarket && "Favorete" == localStorage.thisMarket ? (e.getQuoteAsset = "", e.curMarket = "", e.isPro = !0) : e.getQuoteAsset = localStorage.quoteAsset : e.getQuoteAsset = "BTC"
  13396. }, e.localListData = [], e.favoriteFun = function (t, r, o) {
  13397. if (t.stopPropagation(), o) e.Islogin ? n.post("/exchange/private/deletePortfolio", $.param({symbol: r})).success(function (t) {
  13398. for (var n = 0; n < e.products.length; n++) if (r == e.products[n].symbol) {
  13399. e.products[n].pro = !1;
  13400. break
  13401. }
  13402. e.getProNum()
  13403. }) : (console.log("未登录,删除本地"), angular.forEach(e.products, function (e, t) {
  13404. r == e.symbol && (e.pro = !1)
  13405. }), e.getProNum(), e.removeByValue(e.localListData, r), localStorage.sortLists = JSON.stringify(e.localListData), console.log(localStorage.sortLists)); else if (e.Islogin) n.post("/exchange/private/addPortfolio", $.param({symbol: r})).success(function (t) {
  13406. for (var n = 0; n < e.products.length; n++) r == e.products[n].symbol && (e.products[n].pro = !0);
  13407. e.getProNum()
  13408. }); else {
  13409. console.log("未登录,添加到本地");
  13410. for (var i = 0; i < e.products.length; i++) r == e.products[i].symbol && (e.products[i].pro = !0, e.localListData.push(e.products[i].symbol));
  13411. e.getProNum(), localStorage.sortLists = JSON.stringify(e.localListData), console.log(JSON.parse(localStorage.sortLists).length)
  13412. }
  13413. }, e.removeByValue = function (e, t) {
  13414. for (var n = 0; n < e.length; n++) if (e[n] == t) {
  13415. e.splice(n, 1);
  13416. break
  13417. }
  13418. }, e.noLoginFavoreteFun = function (t) {
  13419. void 0 !== localStorage.sortLists && (e.localListData = JSON.parse(localStorage.sortLists));
  13420. var n = e.localListData;
  13421. angular.forEach(n, function (e) {
  13422. angular.forEach(t, function (t) {
  13423. e == t.symbol && (t.pro = !0)
  13424. })
  13425. }), e.getProNum()
  13426. }, e.getFavorite = function () {
  13427. e.Islogin ? n.post("/exchange/private/portfolios").success(function (e) {
  13428. P(e.data)
  13429. }) : localStorage.sortLists && P(JSON.parse(localStorage.sortLists))
  13430. }, e.getProNum = function () {
  13431. var t = 0;
  13432. angular.forEach(e.products, function (e, n) {
  13433. e.pro && t++
  13434. }), t ? e.noPro = !1 : (e.noPro = !0, localStorage.thisMarket = "")
  13435. }, e.getLocalProStatus(), e.changeMarket(e.getQuoteAsset), s.bind("keydown", function (t) {
  13436. e.$apply(function () {
  13437. 114 == t.keyCode ? (t.preventDefault(), e.sign = "dqwt") : 121 == t.keyCode ? e.tabName = "cpxx" : t.ctrlKey && t.shiftKey && 75 == t.keyCode ? exchangeDate.bool = !0 : t.keyCode
  13438. })
  13439. }), e.sign = localStorage.sign || "zjcc", e.tab = function (t) {
  13440. e.sign = t, localStorage.sign = t
  13441. }, e.trade = function (t) {
  13442. isNaN(Number(t)) || ("limit" == e.orderType.v ? (e.buy_order.price = Number(t).toFixed(e.currentProduct.priceTick), e.sell_order.sell_price = Number(t).toFixed(e.currentProduct.priceTick)) : "stopLimit" == e.orderType.v && (e.stopBuy_order.stopPrice = Number(t).toFixed(e.currentProduct.priceTick), e.stopBuy_order.price = Number(t).toFixed(e.currentProduct.priceTick), e.stopSell_order.stopPrice = Number(t).toFixed(e.currentProduct.priceTick), e.stopSell_order.curPrice = Number(t).toFixed(e.currentProduct.priceTick)))
  13443. }, e.tradeBuyVol = function (t) {
  13444. for (var n = 0, r = 0; r <= t; r++) n += Number(e.bidsTwenty[r][1]);
  13445. e.Islogin ? n < Number(e.baseFree) ? e.sell_order.sell_quantity = re(n, e.currentProduct.qtyTick) : e.sell_order.sell_quantity = re(e.baseFree, e.currentProduct.qtyTick) : e.sell_order.sell_quantity = re(n, e.currentProduct.qtyTick)
  13446. }, e.tradeSellVol = function (t) {
  13447. for (var n = e.asksTwenty.indexOf(t), r = 0, o = e.asksTwenty.length - 1; o >= n; o--) r += Number(e.asksTwenty[o][1]);
  13448. e.Islogin ? r < Number(e.qouteFree / e.buy_order.price) ? e.buy_order.quantity = re(r, e.currentProduct.qtyTick) : e.buy_order.quantity = re(e.qouteFree / e.buy_order.price, e.currentProduct.qtyTick) : e.buy_order.quantity = re(r, e.currentProduct.qtyTick)
  13449. };
  13450. var re = function (e, t) {
  13451. return (Math.floor(new Big(e + "").times(new Big(Math.pow(10, t) + "")).toString()) / Math.pow(10, t)).toFixed(t)
  13452. };
  13453. e.googleVerify = !1, e.showLoginBox = f.login, e.logout = f.logout, e.loadingGeetest = !0;
  13454. var oe, ie = function (t) {
  13455. oe = t, t.onReady(function () {
  13456. e.loadingGeetest = !1;
  13457. var t = e.$root.$$phase;
  13458. "$apply" != t && "$digest" != t && e.$apply()
  13459. }), t.onSuccess(function () {
  13460. $("#userId").attr("disabled", !1);
  13461. var r = t.getValidate(), o = layer.load(1, {shade: [.1, "#fff"]}), i = $.param({
  13462. email: e.login.email.trim().toLowerCase(),
  13463. password: $.md5(e.login.password + e.login.email.trim().toLowerCase()),
  13464. validateCodeType: "gt",
  13465. geetest_challenge: r.geetest_challenge,
  13466. geetest_seccode: r.geetest_seccode,
  13467. geetest_validate: r.geetest_validate
  13468. });
  13469. n.post("/user/login.html", i).then(function (t) {
  13470. if (layer.close(o), t.data.success) if (document.cookie = "logined=y;path=/;", document.cookie = "CSRFToken=" + t.data.CSRFToken + ";path=/", document.cookie = "mobile=" + t.data.mobile + ";path=/", document.cookie = "userId=" + t.data.userId + ";path=/", t.data.confirmTips) window.location.reload(); else {
  13471. var n = encodeURIComponent(location.pathname + location.search);
  13472. location.href = "/safetyInstructions.html?callback=" + n
  13473. } else e.verifyEmail = e.login.email.trim().toLowerCase(), 0 == t.data.emailVerified ? window.location.href = "/resendEmail.html" : t.data.gauth && !t.data.mobileSecurity ? (e.googleVerify = !0, e.verifyType = 1, setTimeout(function () {
  13474. y.validate("#googleVerify-form", "#googleVerify-btn", e.verifySuccess)
  13475. }, 500)) : t.data.mobileSecurity && !t.data.gauth ? (e.googleVerify = !0, e.verifyType = 2, setTimeout(function () {
  13476. y.validate("#mobile-form", "#mobile-btn", e.verifySuccess)
  13477. }, 500)) : t.data.gauth && t.data.mobileSecurity ? (e.googleVerify = !0, e.verifyType = 0, setTimeout(function () {
  13478. y.validate("#googleVerify-form", "#googleVerify-btn", e.verifySuccess), y.validate("#mobile-form", "#mobile-btn", e.verifySuccess)
  13479. }, 500)) : angular.element("#error-info").show().html(t.data.msg);
  13480. void 0 != oe && null != oe && oe.reset(), $("#login-btn").attr("disabled", !1)
  13481. }, function (e) {
  13482. return void 0 != oe && null != oe && oe.reset(), $("#login-btn").attr("disabled", !1), layer.msg("登录异常", {
  13483. icon: 5,
  13484. shift: 1,
  13485. time: 1e3
  13486. }), angular.element("#loginValiCode").val("").focus(), angular.element("#imageStream1").click(), !1
  13487. })
  13488. }), t.onClose(function () {
  13489. $("#userId").attr("disabled", !1)
  13490. }), t.onError(function () {
  13491. $("#userId").attr("disabled", !1), layer.msg("geetestError", {icon: 2, time: 1500})
  13492. })
  13493. };
  13494. !function () {
  13495. var t = localStorage.lang;
  13496. t = "cn" != t ? "en" : "zh-cn", $("#loadingGeetest").html('<img src="/resources/img/loading-2.gif" style="vertical-align:middle;"/> Loading...'), setTimeout(function () {
  13497. e.loadingGeetest && ("cn" == e.lang ? $("#loadingGeetest").html('网络不给力,请 <a href="javascript:;" class="yellow" onclick="location.reload()">刷新</a> 后重试') : "tw" == e.lang ? $("#loadingGeetest").html('網絡不給力,請 <a href="javascript:;" class="yellow" onclick="location.reload()">刷新</a> 後重試') : $("#loadingGeetest").html('Network unavailable,please <a href="javascript:;" class="yellow" onclick="location.reload()">refresh</a> and try again'))
  13498. }, 5e3), n.get("/security/getGtCode.html?t=" + (new Date).getTime()).success(function (e) {
  13499. initGeetest({
  13500. gt: e.gt,
  13501. challenge: e.challenge,
  13502. new_captcha: e.new_captcha,
  13503. offline: !e.success,
  13504. product: "bind",
  13505. lang: t,
  13506. width: "100%"
  13507. }, ie)
  13508. })
  13509. }(), e.login = function () {
  13510. $("#userId").attr("disabled", !0), oe.verify()
  13511. }, e.send = function () {
  13512. x.sendVerifyCode("/user/sendMobileVerifyCode.html", "verifyCode", "sendBtn")
  13513. }, e.verifySuccess = function (e) {
  13514. if (e.success) if (layer.msg(e.msg, {
  13515. icon: 1,
  13516. time: 2e3
  13517. }), document.cookie = "logined=y;path=/;", document.cookie = "CSRFToken=" + e.CSRFToken + ";path=/", document.cookie = "email=" + e.email + ";path=/", e.confirmTips) window.location.reload(); else {
  13518. var t = encodeURIComponent(location.pathname + location.search);
  13519. location.href = "/safetyInstructions.html?callback=" + t
  13520. } else layer.msg(e.msg, {icon: 5, time: 2e3})
  13521. }, e.checkinput = function (e, t) {
  13522. var n = $(e.target).val();
  13523. if (!new RegExp("^\\d+(\\.\\d{0," + t + "})?$").test(n) && ($(e.target).val(n.replace(/[^\d\.]/g, "")), -1 != n.indexOf("."))) {
  13524. var r = n.toString().split(".")[1].length;
  13525. r > t && $(e.target).val(n.slice(0, -(r - t)))
  13526. }
  13527. $(e.target).trigger("input"), $(e.target).trigger("change")
  13528. }, e.buy_submit = function () {
  13529. if (chackRate()) {
  13530. var t = angular.element("#buyPrice").val(),
  13531. r = (e.buy_order.quantity, new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.qtyTick + "}0*)?$")),
  13532. o = new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.priceTick + "}0*)?$");
  13533. if (!e.Islogin) return e.showLoginBox(), !1;
  13534. var i = e.qouteFree / e.buy_order.price;
  13535. if ("" == t || null == t) return layer.msg(d.instant("inputprice"), {icon: 5, shift: 1, time: 500}), !1;
  13536. if (!o.test(t)) return layer.msg(d.instant("inputCrrectPrice").replace("&&&", Number(e.currentProduct.tickSize).toFixed(e.currentProduct.priceTick)), {
  13537. icon: 5,
  13538. shift: 1,
  13539. time: 500
  13540. }), !1;
  13541. if ("" == e.buy_order.quantity || null == e.buy_order.quantity) return layer.msg(d.instant("inputVolume"), {
  13542. icon: 5,
  13543. shift: 1,
  13544. time: 500
  13545. }), angular.element("#buy_order").focus(), !1;
  13546. if (r.test(e.buy_order.quantity)) {
  13547. if (Number(e.buy_order.quantity) > i) return angular.element("#buy_order").focus(), !1;
  13548. var s = {
  13549. method: "post",
  13550. url: "/exchange/private/order",
  13551. data: $.param({
  13552. price: t,
  13553. quantity: e.buy_order.quantity,
  13554. symbol: e.currentProduct.symbol,
  13555. side: "BUY",
  13556. type: "LIMIT"
  13557. })
  13558. };
  13559. 0 != e.currentProduct.close && (t - e.currentProduct.close) / e.currentProduct.close > .05 ? layer.confirm(d.instant("buyorderConfirmTip"), {
  13560. title: "",
  13561. area: "320px",
  13562. closeBtn: !1,
  13563. skin: "confirm-class",
  13564. btn: [d.instant("Yes"), d.instant("No")]
  13565. }, function () {
  13566. n(s).then(function (t) {
  13567. layer.msg(d.instant("orderSucceed"), {icon: 1, shift: 1, time: 500}), a(function () {
  13568. e.buy_order.quantity = "", e.openOrderType.v = "limitOrder"
  13569. }, 500)
  13570. }, function (e) {
  13571. e.data.msg.toUpperCase().match("INSUFFICIENT BALANCE") ? layer.msg(d.instant("Balance is not enough"), {
  13572. icon: 5,
  13573. shift: 1,
  13574. time: 1e3
  13575. }) : layer.msg(e.data.msg, {icon: 5, shift: 1, time: 1e3})
  13576. })
  13577. }, function () {
  13578. layer.closeAll()
  13579. }) : n(s).then(function (t) {
  13580. layer.msg(d.instant("orderSucceed"), {icon: 1, shift: 1, time: 500}), a(function () {
  13581. e.buy_order.quantity = "", e.openOrderType.v = "limitOrder"
  13582. }, 500)
  13583. }, function (e) {
  13584. e.data.msg.toUpperCase().match("INSUFFICIENT BALANCE") ? layer.msg(d.instant("Balance is not enough"), {
  13585. icon: 5,
  13586. shift: 1,
  13587. time: 1e3
  13588. }) : layer.msg(e.data.msg, {icon: 5, shift: 1, time: 1e3})
  13589. })
  13590. } else layer.msg(d.instant("inputCorrectVolume").replace("&&&", Number(e.currentProduct.minTrade).toFixed(e.currentProduct.qtyTick)), {
  13591. icon: 5,
  13592. shift: 1,
  13593. time: 500
  13594. }), angular.element("#buy_order").val("").focus()
  13595. } else layer.msg(d.instant("tooFast"), {icon: 5, shift: 1, time: 700})
  13596. }, e.limitBuyOrder = function () {
  13597. exchangeDate.isClose(e.today, e.buy_submit)
  13598. }, e.getCommission = function (t, r) {
  13599. n.get("/exchange/public/userTradeFee?symbol=" + t).success(function (t) {
  13600. e.buyFee = t.buyMakerCommission, e.sellFee = t.sellMakerCommission
  13601. })
  13602. }, e.sell_submit = function () {
  13603. if (chackRate()) {
  13604. var t = angular.element("#sellPrice").val(), r = Number(e.sell_order.sell_quantity),
  13605. o = new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.qtyTick + "}0*)?$"),
  13606. i = new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.priceTick + "}0*)?$");
  13607. if (!e.Islogin) return e.showLoginBox(), !1;
  13608. if ("" == t || null == t) return layer.msg(d.instant("inputprice"), {icon: 5, shift: 1, time: 500}), !1;
  13609. if (!i.test(t)) return layer.msg(d.instant("inputCrrectPrice").replace("&&&", Number(e.currentProduct.tickSize).toFixed(e.currentProduct.priceTick)), {
  13610. icon: 5,
  13611. shift: 1,
  13612. time: 500
  13613. }), !1;
  13614. if ("" == e.sell_order.sell_quantity || null == e.sell_order.sell_quantity) return layer.msg(d.instant("inputSellVolume"), {
  13615. icon: 5,
  13616. shift: 1,
  13617. time: 500
  13618. }), angular.element("#sell_order").focus(), !1;
  13619. if (!o.test(e.sell_order.sell_quantity)) return layer.msg(d.instant("inputCorrectVolume").replace("&&&", Number(e.currentProduct.minTrade).toFixed(e.currentProduct.qtyTick)), {
  13620. icon: 5,
  13621. shift: 1,
  13622. time: 500
  13623. }), angular.element("#sell_order").val("").focus(), !1;
  13624. if (r > Number(e.baseFree)) return angular.element("#sell_order").focus(), !1;
  13625. var s = {
  13626. method: "post",
  13627. url: "/exchange/private/order",
  13628. data: $.param({
  13629. price: t,
  13630. quantity: e.sell_order.sell_quantity,
  13631. symbol: e.currentProduct.symbol,
  13632. side: "SELL",
  13633. type: "LIMIT"
  13634. })
  13635. };
  13636. 0 != e.currentProduct.close && (e.currentProduct.close - t) / e.currentProduct.close > .05 ? layer.confirm(d.instant("sellorderConfirmTip"), {
  13637. title: "",
  13638. area: "320px",
  13639. closeBtn: !1,
  13640. skin: "confirm-class",
  13641. btn: [d.instant("Yes"), d.instant("No")]
  13642. }, function () {
  13643. n(s).then(function (t) {
  13644. layer.msg(d.instant("orderSucceed"), {icon: 1, shift: 1, time: 500}), a(function () {
  13645. e.sell_order.sell_quantity = "", e.openOrderType.v = "limitOrder"
  13646. }, 500)
  13647. }, function (e) {
  13648. e.data.msg.toUpperCase().match("INSUFFICIENT BALANCE") ? layer.msg(d.instant("Balance is not enough"), {
  13649. icon: 5,
  13650. shift: 1,
  13651. time: 500
  13652. }) : layer.msg(e.data.msg, {icon: 5, shift: 1, time: 500})
  13653. })
  13654. }, function () {
  13655. layer.closeAll()
  13656. }) : n(s).then(function (t) {
  13657. layer.msg(d.instant("orderSucceed"), {icon: 1, shift: 1, time: 500}), a(function () {
  13658. e.sell_order.sell_quantity = "", e.openOrderType.v = "limitOrder"
  13659. }, 500)
  13660. }, function (e) {
  13661. e.data.msg.toUpperCase().match("INSUFFICIENT BALANCE") ? layer.msg(d.instant("Balance is not enough"), {
  13662. icon: 5,
  13663. shift: 1,
  13664. time: 500
  13665. }) : layer.msg(e.data.msg, {icon: 5, shift: 1, time: 500})
  13666. })
  13667. } else layer.msg(d.instant("tooFast"), {icon: 5, shift: 1, time: 700})
  13668. }, e.limitSellOrder = function () {
  13669. exchangeDate.isClose(e.today, e.sell_submit)
  13670. }, e.market_buy_submit = function () {
  13671. if (chackRate()) {
  13672. var t = new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.qtyTick + "}0*)?$");
  13673. if (!e.Islogin) return e.showLoginBox(), !1;
  13674. if ("" == e.market_buy_order.quantity || null == e.market_buy_order.quantity) return layer.msg(d.instant("inputVolume"), {
  13675. icon: 5,
  13676. shift: 1,
  13677. time: 500
  13678. }), angular.element("#market_buy_order").focus(), !1;
  13679. if (t.test(e.market_buy_order.quantity)) {
  13680. var r = {
  13681. method: "post",
  13682. url: "/exchange/private/order",
  13683. data: $.param({
  13684. quantity: e.market_buy_order.quantity,
  13685. symbol: e.currentProduct.symbol,
  13686. side: "BUY",
  13687. type: "MARKET"
  13688. })
  13689. };
  13690. e.market_buy_order.quantity = "", n(r).then(function (e) {
  13691. layer.msg(d.instant("orderSucceed"), {icon: 1, shift: 1, time: 500})
  13692. }, function (e) {
  13693. e.data.msg.toUpperCase().match("INSUFFICIENT BALANCE") ? layer.msg(d.instant("Balance is not enough"), {
  13694. icon: 5,
  13695. shift: 1,
  13696. time: 1e3
  13697. }) : layer.msg(e.data.msg, {icon: 5, shift: 1, time: 1e3})
  13698. })
  13699. } else layer.msg(d.instant("inputCorrectVolume").replace("&&&", Number(e.currentProduct.minTrade).toFixed(e.currentProduct.qtyTick)), {
  13700. icon: 5,
  13701. shift: 1,
  13702. time: 500
  13703. }), angular.element("#market_buy_order").val("").focus()
  13704. } else layer.msg(d.instant("tooFast"), {icon: 5, shift: 1, time: 700})
  13705. }, e.market_sell_submit = function () {
  13706. if (chackRate()) {
  13707. var t = new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.qtyTick + "}0*)?$");
  13708. if (!e.Islogin) return e.showLoginBox(), !1;
  13709. if ("" == e.market_sell_order.quantity || null == e.market_sell_order.quantity) return layer.msg(d.instant("inputVolume"), {
  13710. icon: 5,
  13711. shift: 1,
  13712. time: 500
  13713. }), angular.element("#market_sell_order").focus(), !1;
  13714. if (t.test(e.market_sell_order.quantity)) {
  13715. var r = {
  13716. method: "post",
  13717. url: "/exchange/private/order",
  13718. data: $.param({
  13719. quantity: e.market_sell_order.quantity,
  13720. symbol: e.currentProduct.symbol,
  13721. side: "SELL",
  13722. type: "MARKET"
  13723. })
  13724. };
  13725. e.market_sell_order.quantity = "", n(r).then(function (e) {
  13726. layer.msg(d.instant("orderSucceed"), {icon: 1, shift: 1, time: 500})
  13727. }, function (e) {
  13728. e.data.msg.toUpperCase().match("INSUFFICIENT BALANCE") ? layer.msg(d.instant("Balance is not enough"), {
  13729. icon: 5,
  13730. shift: 1,
  13731. time: 1e3
  13732. }) : layer.msg(e.data.msg, {icon: 5, shift: 1, time: 1e3})
  13733. })
  13734. } else layer.msg(d.instant("inputCorrectVolume").replace("&&&", Number(e.currentProduct.minTrade).toFixed(e.currentProduct.qtyTick)), {
  13735. icon: 5,
  13736. shift: 1,
  13737. time: 500
  13738. }), angular.element("#market_sell_order").val("").focus()
  13739. } else layer.msg(d.instant("tooFast"), {icon: 5, shift: 1, time: 700})
  13740. }, e.stopLimit_buy_submit = function () {
  13741. if (chackRate()) {
  13742. var t = angular.element("#buy_stopPrice").val(), r = angular.element("#stop_curPrice").val(),
  13743. o = angular.element("#stop_buyQuanity").val(),
  13744. i = new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.qtyTick + "}0*)?$"),
  13745. s = new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.priceTick + "}0*)?$");
  13746. if (!e.Islogin) return e.showLoginBox(), !1;
  13747. var l = e.qouteFree / r;
  13748. if ("" == t || null == t) return layer.msg(d.instant("inputprice"), {icon: 5, shift: 1, time: 500}), !1;
  13749. if (!s.test(t)) return layer.msg(d.instant("inputCrrectPrice").replace("&&&", Number(e.currentProduct.tickSize).toFixed(e.currentProduct.priceTick)), {
  13750. icon: 5,
  13751. shift: 1,
  13752. time: 500
  13753. }), !1;
  13754. if ("" == r || null == r) return layer.msg(d.instant("inputprice"), {icon: 5, shift: 1, time: 500}), !1;
  13755. if (!s.test(r)) return layer.msg(d.instant("inputCrrectPrice").replace("&&&", Number(e.currentProduct.tickSize).toFixed(e.currentProduct.priceTick)), {
  13756. icon: 5,
  13757. shift: 1,
  13758. time: 500
  13759. }), !1;
  13760. if ("" == o || null == o) return layer.msg(d.instant("inputVolume"), {
  13761. icon: 5,
  13762. shift: 1,
  13763. time: 500
  13764. }), angular.element("#stop_buyQuanity").focus(), !1;
  13765. if (!i.test(o)) return layer.msg(d.instant("inputCorrectVolume").replace("&&&", Number(e.currentProduct.minTrade).toFixed(e.currentProduct.qtyTick)), {
  13766. icon: 5,
  13767. shift: 1,
  13768. time: 500
  13769. }), angular.element("#stop_buyQuanity").focus(), !1;
  13770. if (Number(o) > l) return angular.element("#stop_buyQuanity").focus(), !1;
  13771. var c, u;
  13772. Number(t) >= Number(e.currentProduct.close) ? (c = "STOP_LOSS_LIMIT", u = "cn" != e.lang ? "If the last price rises to or above " + t + " " + e.currentProduct.quoteAsset + " ,an order to buy " + o + " " + e.currentProduct.baseAsset + " at a price of " + r + " " + e.currentProduct.quoteAsset + " will be placed." : "当价格上涨至或高于" + t + " " + e.currentProduct.quoteAsset + "时,则触发以" + r + " " + e.currentProduct.quoteAsset + "的价格买入" + o + " " + e.currentProduct.baseAsset + "的订单") : Number(t) < Number(e.currentProduct.close) && (c = "TAKE_PROFIT_LIMIT", u = "cn" != e.lang ? "If the last price drops to or below " + t + " " + e.currentProduct.quoteAsset + ", an order to buy" + o + " " + e.currentProduct.baseAsset + "at a price of" + r + " " + e.currentProduct.quoteAsset + "will be placed." : "当价格下跌至或低于" + t + " " + e.currentProduct.quoteAsset + "时,则触发以" + r + " " + e.currentProduct.quoteAsset + "的价格买入" + o + " " + e.currentProduct.baseAsset + "的订单");
  13773. var f = {
  13774. method: "post",
  13775. url: "/exchange/private/order",
  13776. data: $.param({price: r, quantity: o, symbol: e.product.symbol, side: "BUY", stopPrice: t, type: c})
  13777. };
  13778. layer.confirm(u, {
  13779. title: "",
  13780. area: "320px",
  13781. closeBtn: !1,
  13782. skin: "confirm-class",
  13783. btn: [d.instant("Yes"), d.instant("No")]
  13784. }, function () {
  13785. n(f).then(function (t) {
  13786. layer.msg(d.instant("orderSucceed"), {icon: 1, shift: 1, time: 500}), a(function () {
  13787. e.stopBuy_order.quantity = "", e.openOrderType.v = "stopLimitOrder"
  13788. }, 500)
  13789. }, function (e) {
  13790. e.data.msg.toUpperCase().match("INSUFFICIENT BALANCE") ? layer.msg(d.instant("Balance is not enough"), {
  13791. icon: 5,
  13792. shift: 1,
  13793. time: 1e3
  13794. }) : layer.msg(e.data.msg, {icon: 5, shift: 1, time: 1e3})
  13795. })
  13796. }, function () {
  13797. layer.closeAll()
  13798. })
  13799. } else layer.msg(d.instant("tooFast"), {icon: 5, shift: 1, time: 700})
  13800. }, e.stopLimit_sell_submit = function () {
  13801. if (chackRate()) {
  13802. var t = angular.element("#stopSell_StopPrice").val(), r = angular.element("#stopSell_curPrice").val(),
  13803. o = angular.element("#stopSell_Quanity").val(),
  13804. i = new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.qtyTick + "}0*)?$"),
  13805. s = new RegExp("^\\d+(\\.\\d{0," + e.currentProduct.priceTick + "}0*)?$");
  13806. if (!e.Islogin) return e.showLoginBox(), !1;
  13807. if ("" == t || null == t) return layer.msg(d.instant("inputprice"), {icon: 5, shift: 1, time: 500}), !1;
  13808. if (!s.test(t)) return layer.msg(d.instant("inputCrrectPrice").replace("&&&", Number(e.currentProduct.tickSize).toFixed(e.currentProduct.priceTick)), {
  13809. icon: 5,
  13810. shift: 1,
  13811. time: 500
  13812. }), !1;
  13813. if ("" == r || null == r) return layer.msg(d.instant("inputprice"), {icon: 5, shift: 1, time: 500}), !1;
  13814. if (!s.test(r)) return layer.msg(d.instant("inputCrrectPrice").replace("&&&", Number(e.currentProduct.tickSize).toFixed(e.currentProduct.priceTick)), {
  13815. icon: 5,
  13816. shift: 1,
  13817. time: 500
  13818. }), !1;
  13819. if ("" == o || null == o) return layer.msg(d.instant("inputSellVolume"), {
  13820. icon: 5,
  13821. shift: 1,
  13822. time: 500
  13823. }), angular.element("#stopSell_Quanity").focus(), !1;
  13824. if (!i.test(o)) return layer.msg(d.instant("inputCorrectVolume").replace("&&&", Number(e.currentProduct.minTrade).toFixed(e.currentProduct.qtyTick)), {
  13825. icon: 5,
  13826. shift: 1,
  13827. time: 500
  13828. }), angular.element("#stopSell_Quanity").val("").focus(), !1;
  13829. if (o > Number(e.baseFree)) return angular.element("#stopSell_Quanity").focus(), !1;
  13830. var l, c;
  13831. Number(t) > Number(e.currentProduct.close) ? (l = "TAKE_PROFIT_LIMIT", c = "cn" != e.lang ? "If the last price rises to or above " + t + " " + e.currentProduct.quoteAsset + " ,an order to sell " + o + " " + e.currentProduct.baseAsset + " at a price of " + r + " " + e.currentProduct.quoteAsset + " will be placed." : "当价格上涨至或高于" + t + " " + e.currentProduct.quoteAsset + "时,则触发以" + r + " " + e.currentProduct.quoteAsset + "的价格卖出" + o + " " + e.currentProduct.baseAsset + "的订单") : Number(t) <= Number(e.currentProduct.close) && (l = "STOP_LOSS_LIMIT", c = "cn" != e.lang ? "If the last price drops to or below " + t + " " + e.currentProduct.quoteAsset + ", an order to sell" + o + " " + e.currentProduct.baseAsset + "at a price of" + r + " " + e.currentProduct.quoteAsset + "will be placed." : "当价格下跌至或低于" + t + " " + e.currentProduct.quoteAsset + "时,则触发以" + r + " " + e.currentProduct.quoteAsset + "的价格卖出" + o + " " + e.currentProduct.baseAsset + "的订单");
  13832. var u = {
  13833. method: "post",
  13834. url: "/exchange/private/order",
  13835. data: $.param({price: r, quantity: o, symbol: e.product.symbol, side: "SELL", stopPrice: t, type: l})
  13836. };
  13837. layer.confirm(c, {
  13838. title: "",
  13839. area: "320px",
  13840. closeBtn: !1,
  13841. skin: "confirm-class",
  13842. btn: [d.instant("Yes"), d.instant("No")]
  13843. }, function () {
  13844. n(u).then(function (t) {
  13845. layer.msg(d.instant("orderSucceed"), {icon: 1, shift: 1, time: 500}), a(function () {
  13846. e.stopSell_order.quantity = "", e.openOrderType.v = "stopLimitOrder"
  13847. }, 500)
  13848. }, function (e) {
  13849. e.data.msg.toUpperCase().match("INSUFFICIENT BALANCE") ? layer.msg(d.instant("Balance is not enough"), {
  13850. icon: 5,
  13851. shift: 1,
  13852. time: 500
  13853. }) : layer.msg(e.data.msg, {icon: 5, shift: 1, time: 500})
  13854. })
  13855. }, function () {
  13856. layer.closeAll()
  13857. })
  13858. } else layer.msg(d.instant("tooFast"), {icon: 5, shift: 1, time: 700})
  13859. }, e.deleteOrder = function (e, t) {
  13860. var r = {method: "post", url: "/exchange/private/deleteOrder", data: $.param({orderId: e, symbol: t})};
  13861. n(r).then(function (e) {
  13862. layer.msg(d.instant("cancelOrderSucceed"), {icon: 1, shift: 1, time: 500})
  13863. }, function (e) {
  13864. layer.msg(e.data.msg, {icon: 5, shift: 1, time: 500})
  13865. })
  13866. }, e.caculateNum = function (t) {
  13867. var n = 0;
  13868. return "All" == t ? n = e.openOrders.length : "Stop-Limit" == t ? angular.forEach(e.openOrders, function (e, t) {
  13869. e.stopPrice && (n += 1)
  13870. }) : "Limit" == t && angular.forEach(e.openOrders, function (e, t) {
  13871. e.stopPrice || (n += 1)
  13872. }), n
  13873. }, e.deleteAllOrder = function (t) {
  13874. "dqwt" == e.sign && (angular.element(".wrap").removeClass("blur"), angular.forEach(e.openOrders, function (n) {
  13875. "All" == t ? e.deleteOrder(n.orderId, n.symbol) : "Limit" == t ? n.stopPrice || e.deleteOrder(n.orderId, n.symbol) : "Stop-Limit" == t && n.stopPrice && e.deleteOrder(n.orderId, n.symbol)
  13876. }))
  13877. }, e.deleteAllOrderAsk = function (t) {
  13878. var n, r;
  13879. if ("Limit" == t ? (r = e.caculateNum("Limit"), n = "Are you sure to cancel all Limit orders?") : "Stop-Limit" == t ? (r = e.caculateNum("Stop-Limit"), n = "Are you sure to cancel all Stop-Limit orders?") : "All" == t && (r = e.caculateNum("All"), n = "Are you sure you want to cancel all?"), r) {
  13880. angular.element(".wrap").addClass("blur");
  13881. var o = layer.confirm('<p style="font-size:16px;color:#c3c3c3;font-family:NSimSun;text-align: center;margin-top: 18px;height:60px">' + d.instant(n) + "</p>", {
  13882. skin: "confirm-class",
  13883. closeBtn: !1,
  13884. area: ["345px", "170px"],
  13885. title: !1,
  13886. btn: [d.instant("Yes"), d.instant("No")]
  13887. }, function () {
  13888. e.deleteAllOrder(t)
  13889. }, function () {
  13890. angular.element(".wrap").removeClass("blur"), layer.close(o)
  13891. })
  13892. }
  13893. };
  13894. var ae = function (e) {
  13895. switch (e) {
  13896. case"0":
  13897. case"60":
  13898. return "1m";
  13899. case"180":
  13900. return "3m";
  13901. case"300":
  13902. return "5m";
  13903. case"900":
  13904. return "15m";
  13905. case"1800":
  13906. return "30m";
  13907. case"3600":
  13908. return "1h";
  13909. case"7200":
  13910. return "2h";
  13911. case"14400":
  13912. return "4h";
  13913. case"21600":
  13914. return "6h";
  13915. case"43200":
  13916. return "12h";
  13917. case"86400":
  13918. return "1d";
  13919. case"259200":
  13920. return "3d";
  13921. case"604800":
  13922. return "1w"
  13923. }
  13924. console.log("Error parsing resolution: " + e)
  13925. };
  13926. void 0 !== e.product.symbol && (e.product.baseCurrency = e.product.oriSymbol.split("_")[0], e.product.qouteCurrency = e.product.oriSymbol.split("_")[1]);
  13927. var se = "60", le = ae(se);
  13928. RTBTC.instrument("Binance", e.product.symbol, e.product.qouteCurrency);
  13929. var ce = JSON.parse(localStorage.chart || "{}"), ue = {
  13930. t: Number(se),
  13931. icontrols: !0,
  13932. i: [{m: !0, p: 0, h: 50, u: [], g: !0, o: []}, {m: !1, t: "vol", i: null, p: 5, h: 10, r: []}]
  13933. };
  13934. if (localStorage.chart) {
  13935. e.curzb = ce.curzb;
  13936. for (pe = 0; pe < ce.u.length; pe++) {
  13937. fe = ce.u[pe];
  13938. ue.i[0].u.push({i: null, s: fe.s, t: fe.t}), e.curOver = function (e) {
  13939. var t;
  13940. return "macd" == e ? t = "MACD" : "trix" == e ? t = "TRIX" : "kdj" == e ? t = "KDJ" : "BRAR" == e || ("storsi" == e ? t = "StochRSI" : "VR" == e || ("rsi" == e ? t = "RSI" : "emv" == e ? t = "EMV" : "dmi" == e ? t = "DMI" : "wpr" == e ? t = "WR" : "obv" == e ? t = "OBV" : "ROC" == e || ("bnd" == e ? t = "BOLL" : "mtm" == e ? t = "MTM" : "psar" == e ? t = "SAR" : "ema" == e ? t = "EMA" : "PSY" == e || ("cci" == e ? t = "CCI" : "vwap" == e ? t = "VWAP" : "ma" == e ? t = "MA" : "avl" == e && (t = "AVL"))))), t
  13941. }(fe.t)
  13942. }
  13943. for (pe = 0; pe < ce.o.length; pe++) {
  13944. var fe = ce.o[pe];
  13945. ue.i[0].o.push({i: null, s: o.s, t: o.t}), e.curOver = fe.t
  13946. }
  13947. for (var de = 0; de < ce.i.length; de++) {
  13948. var pe = ce.i[de];
  13949. ue.i.push({i: null, t: pe.t, h: pe.h, r: [], p: 5, m: !1})
  13950. }
  13951. } else e.curzb = "MACD", ue.i.push({m: !1, t: "macd", i: null, p: 5, h: 10, r: []}), ue.i[0].u.push({
  13952. t: "avl",
  13953. i: null,
  13954. s: []
  13955. });
  13956. window.chart = (new Chart).build("#chart", null, ue), chart.onTheme("chart-black-" + EXCHANGE);
  13957. var he = (new custLine).build();
  13958. he.setChartData(chart.getInernal()), e.setDrawLineType = function (e) {
  13959. he.add(e), chart.setCrossHair(!1)
  13960. }, he.ifNull(function () {
  13961. chart.setCrossHair(!0)
  13962. }), e.deleteLine = function () {
  13963. he.deleteLine(), e.drawLists = !1
  13964. }, e.cleanLines = function () {
  13965. he.clean(), e.drawLists = !1
  13966. }, window.UserAccount = UserAccount_Class.Build();
  13967. var ge = angular.element(window).height(), me = angular.element(".header").outerHeight(!0),
  13968. ve = angular.element(".detail-lb").outerHeight(!0);
  13969. angular.element(".box-inner").css({height: ge - me - ve - 39, "max-height": ge - me - 75});
  13970. var be = (new VisualDepth).build("#depth", $("#p"));
  13971. be.onTheme("depth-black-" + EXCHANGE), e.depthMergeUnit = 8, e.trades = [], e.todayTrades = [], e.streamBids = {}, e.streamBidsKeys = [], e.streamAsks = {}, e.streamAsksKeys = [];
  13972. var ye = function (t) {
  13973. if ("depthUpdate" == t.eventType) {
  13974. console.log(t.bids), L(t.bids, e.streamBids), L(t.asks, e.streamAsks);
  13975. OBD.loadBook(e.streamAsks, e.streamBids, 100), e.streamBidsKeys = Object.keys(e.streamBids).sort(function (e, t) {
  13976. return e - t
  13977. }), e.streamAsksKeys = Object.keys(e.streamAsks).sort(function (e, t) {
  13978. return e - t
  13979. });
  13980. var n = [], r = [];
  13981. M(e.streamBidsKeys, e.streamBids, n, D), M(e.streamAsksKeys, e.streamAsks, r, I), n[n.length - 1] && r[0] && !isNaN(Number(n[n.length - 1][0])) && !isNaN(Number(r[0][0])) && Number(n[n.length - 1][0]) >= Number(r[0][0]) && e.streamerInstance.RePull(), (n = n.reverse()).length > 100 && (n = n.slice(0, 100)), e.bidsTwenty = n, r.length > 100 && (r = r.slice(0, 100)), e.asksTwenty = r.reverse(), (e.bidsTwenty.length || e.asksTwenty.length) && _(e.bidsTwenty, e.asksTwenty), U(e.asksTwenty, e.bidsTwenty, e.openOrders), F(e.bidsTwenty), B(e.asksTwenty), "$apply" != (i = e.$root.$$phase) && "$digest" != i && e.$apply()
  13982. } else if ("trade" == t.eventType) {
  13983. if ((0 == e.trades.length || e.trades[0].aggTradeId < t.aggTradeId) && (e.trades.unshift(t), e.trades.length > 50 && e.trades.pop()), !e.currentProduct.lastAggTradeId || null == e.currentProduct.lastAggTradeId || e.currentProduct.lastAggTradeId >= t.aggTradeId) return;
  13984. e.currentProduct.lastAggTradeId = t.aggTradeId;
  13985. var o = Number(t.price);
  13986. e.currentProduct.close = o;
  13987. var i = e.$root.$$phase;
  13988. "$apply" != i && "$digest" != i && e.$apply()
  13989. } else "kline" == t.eventType ? t.kline.interval == le && Data.onBar([t.kline.time, Number(t.kline.open), Number(t.kline.high), Number(t.kline.low), Number(t.kline.close), Number(t.kline.volume), Number(t.kline.quoteVolume)], Number(se)) : (console.log("Error! Bad data received:"), console.log(t))
  13990. }, xe = 280;
  13991. e.depthMergeChange = function (t) {
  13992. e.depthMergeUnit = t, ye({eventType: "depthUpdate"})
  13993. };
  13994. var we = !0, $e = function (t, n) {
  13995. he.clean(), chart.setCrossHair(!0), n ? (we || (chart.fixTime(!1), chart.clearData(), chart.removeIndicatorByname(["avl"]), chart.addOrUpdateIndicator("ma", 7), chart.addOrUpdateIndicator("ma", 25), chart.addOrUpdateIndicator("ma", 99), chart.setMode("Candle"), e.curOver = "MA", Se(), we = !0), le = ae(se = t), chart.setResolution(Number(t))) : (we && (chart.fixTime(!1), chart.clearData(), chart.setLastColorIndex(0), e.removeOver(e.curOver), chart.addOrUpdateIndicator("avl"), chart.setMode("Line"), Se(), e.curOver = "AVL", we = !1), le = ae(se = "60"), chart.setResolution(60))
  13996. }, ke = Number(localStorage.barWidth || 5);
  13997. e.getByInterval = function (t, n) {
  13998. Te != n && ($e(t, !0), e.curIndex = n, Te = n, localStorage.curIndex = n)
  13999. }, e.setTimeLine = function (t) {
  14000. Te != t && ($e("60", !1), e.curIndex = t, localStorage.curIndex = t, Te = t)
  14001. }, parseInt(e.curIndex) ? (we = !0, R(X[parseInt(e.curIndex)] + "", "Candle")) : (we = !1, e.curIndex = 0, R(X[parseInt(e.curIndex)] + "", "Line")), e.chartLoaded = function () {
  14002. e.klineStreamer && e.klineStreamer.stopStream(), e.loaded = !0, n.get("/exchange/public/klineUrl").success(function (t) {
  14003. e.connectToKlineStreamer(t)
  14004. })
  14005. };
  14006. var Te = "-1";
  14007. Data.onLoaded(function () {
  14008. S.close("#chart"), e.chartLoaded()
  14009. }), e.jszbLists = !1, e.setIndicator = function (t) {
  14010. var n = j(t);
  14011. chart.isIndicator(n) ? (e.removeIndicator(e.curzb), chart.addOrUpdateIndicator(n), e.curzb = t) : (e.removeOver(e.curOver), "ema" == n || "ma" == n ? (chart.addOrUpdateIndicator(n, 7), chart.addOrUpdateIndicator(n, 25), chart.addOrUpdateIndicator(n, 99)) : chart.addOrUpdateIndicator(n), e.curOver = t), Se()
  14012. }, e.removeIndicator = function (t) {
  14013. var n = j(t);
  14014. "ema" == n || "ma" == n ? (chart.removeIndicatorByname([n]), chart.removeIndicatorByname([n]), chart.removeIndicatorByname([n])) : chart.removeIndicatorByname([n]), e.curzb = "", Se()
  14015. }, e.removeOver = function (t) {
  14016. var n = j(t);
  14017. "ema" == n || "ma" == n ? (chart.removeIndicatorByname([n]), chart.removeIndicatorByname([n]), chart.removeIndicatorByname([n])) : chart.removeIndicatorByname([n]), e.curOver = "", Se()
  14018. }, $(".chart").on("blur", ".icontrol input", function () {
  14019. Se()
  14020. });
  14021. var Se = function () {
  14022. var t = {};
  14023. t.u = [], t.o = [];
  14024. for (var n = chart.internals().slots[0].u, r = chart.internals().slots[0].o, o = 0; o < n.length; o++) t.u.push({
  14025. s: n[o].s,
  14026. t: n[o].t
  14027. });
  14028. for (o = 0; o < r.length; o++) t.o.push({s: r[o].s, t: r[o].t});
  14029. t.i = [];
  14030. for (var i = 2; i < chart.internals().slots.length; i++) {
  14031. var a = chart.internals().slots[i];
  14032. t.i.push({h: a.h, px: a.px, s: a.s, t: a.t})
  14033. }
  14034. t.curzb = e.curzb, localStorage.chart = JSON.stringify(t)
  14035. };
  14036. e.disconnect = function () {
  14037. e.streamerInstance.stopStream(), e.streamerInstance = null
  14038. }, e.connectToSymbol = function (t) {
  14039. null == e.streamerInstance ? e.streamerInstance = new u : e.streamerInstance.stopStream(), e.streamerInstance.startStream(e.product.symbol, t, function (t) {
  14040. t.clean && (e.streamBids = {}, e.streamAsks = {}), ye(t)
  14041. }, q)
  14042. }, e.getStreamers = function () {
  14043. e.connectToTradeStream(e.wssUrl), e.connectToSymbol(e.wssUrl)
  14044. }, n.get("/exchange/public/wssUrl").success(function (t) {
  14045. e.wssUrl = t, e.connectToTradeStream(t), e.connectToSymbol(t)
  14046. });
  14047. e.userCallback = function (t) {
  14048. if ("outboundAccountInfo" == t.eventType && t.balances.forEach(function (t) {
  14049. if (t.asset == e.product.qouteCurrency && (e.qouteFree = t.free), t.asset == e.product.baseCurrency && (e.baseFree = t.free), e.userAssets instanceof Array) {
  14050. var n;
  14051. e.userAssets.forEach(function (r, o) {
  14052. r.asset == t.asset && (r.locked = t.locked, r.free = t.free, e.currentUserAsset = r.free, 0 == e.currentUserAsset ? e.takeDelivery = !1 : e.takeDelivery = !0, 0 == parseFloat(r.free).toFixed(2) && 0 == parseFloat(r.locked).toFixed(2) && 0 == parseFloat(r.freeze).toFixed(2) && 0 == parseFloat(r.ipoing).toFixed(2) && 0 == parseFloat(r.ipoable).toFixed(2) && 0 == parseFloat(r.storage).toFixed(2) && (n = o))
  14053. }), void 0 !== n && e.userAssets.splice(n, 1)
  14054. }
  14055. }), "executionReport" == t.eventType) {
  14056. var n = {};
  14057. switch (n.time = t.time, n.symbol = t.symbol, n.side = t.side, n.type = t.orderType, n.orderType = d.instant(n.type), n.status = t.orderStatus, n.workingIndicator = t.workingIndicator, n.origQty = parseFloat(t.qty), n.price = parseFloat(t.price), n.stopPrice = parseFloat(t.stopPrice), n.executedQty = parseFloat(t.cummulativeQty), n.commissionAsset = t.commissionAsset, n.orderId = t.orderId, "STOP_LOSS_LIMIT" != n.type && "TAKE_PROFIT_LIMIT" != n.type || (n.orderType = d.instant("Stop-Limit")), t.orderStatus) {
  14058. case"NEW":
  14059. n.executedQty = 0, n.executedPrice = 0, console.log(n.symbol + " 委托" + n.origQty), "LIMIT" == n.type || "MARKET" == n.type ? (e.openOrders.splice(0, 0, n), e.IsopenOrdersNull = !1) : "STOP_LOSS_LIMIT" != n.type && "TAKE_PROFIT_LIMIT" != n.type || (n.workingIndicator ? angular.forEach(e.openOrders, function (t, r) {
  14060. n.orderId == t.orderId && n.symbol == t.symbol && (e.openOrders[r].workingIndicator = n.workingIndicator)
  14061. }) : (e.openOrders.splice(0, 0, n), e.IsopenOrdersNull = !1));
  14062. break;
  14063. case"PARTIALLY_FILLED":
  14064. var r = parseFloat(t.lastQty), o = parseFloat(t.lastPrice), i = parseFloat(t.cummulativeQty);
  14065. e.openOrders instanceof Array && e.openOrders.forEach(function (e) {
  14066. e.symbol == n.symbol && e.orderId == n.orderId && (e.executedPrice = (e.executedQty * e.executedPrice + o * r) / i, e.executedQty = i, e.executedQuoteQty = e.executedPrice * e.executedQty, e.status = d.instant("PARTIALLY_FILLED"))
  14067. });
  14068. var a = {};
  14069. a.symbol = t.symbol, a.time = t.time, a.side = t.side, a.qty = t.lastQty, a.price = t.lastPrice, a.totalQuota = i * o, a.fee = parseFloat(t.commission), a.feeAsset = t.commissionAsset, e.dealOrders.splice(0, 0, a), e.dealOrders && e.dealOrders.length > 30 && e.dealOrders.pop(), e.dealBigTotalItems = e.dealOrders.length, e.updatePosition(n, r, o, parseFloat(a.fee));
  14070. break;
  14071. case"FILLED":
  14072. var s = parseFloat(t.lastQty), l = parseFloat(t.lastPrice), c = parseFloat(t.cummulativeQty);
  14073. console.log(t), e.openOrders instanceof Array && e.openOrders.forEach(function (e) {
  14074. e.symbol == n.symbol && e.orderId == n.orderId && (e.executedPrice = (e.executedQty * e.executedPrice + l * s) / c, e.executedQty = c, e.status = d.instant("FILLED"), e.executedQuoteQty = e.executedPrice * e.executedQty, g = e)
  14075. });
  14076. var u = {};
  14077. u.symbol = n.symbol, u.time = n.time, u.side = n.side, u.qty = s, u.price = l;
  14078. var f = parseFloat(t.commission);
  14079. u.fee = f, u.feeAsset = t.commissionAsset, u.totalQuota = c * l, e.dealOrders.splice(0, 0, u), e.dealOrders && e.dealOrders.length > 30 && e.dealOrders.pop(), e.dealBigTotalItems = e.dealOrders.length, e.allOrders.splice(0, 0, g), e.allOrders && e.allOrders.length > 30 && e.allOrders.pop();
  14080. var p;
  14081. e.openOrders.forEach(function (e, t) {
  14082. e.symbol == n.symbol && e.orderId == n.orderId && (p = t)
  14083. }), e.openOrders.splice(p, 1), 0 == e.openOrders.length ? e.IsopenOrdersNull = !0 : e.IsopenOrdersNull = !1, e.updatePosition(n, s, l, parseFloat(f));
  14084. break;
  14085. case"CANCELED":
  14086. case"EXPIRED":
  14087. var h, g, s = parseFloat(t.lastQty), l = parseFloat(t.lastPrice), c = parseFloat(t.cummulativeQty);
  14088. e.openOrders.forEach(function (e, t) {
  14089. e.symbol == n.symbol && e.orderId == n.orderId && (h = t, 0 == c ? (e.executedPrice = n.price, e.status = d.instant("CANCELED"), "MARKET" == n.type && (e.status = d.instant("EXPIRED")), e.executedQuoteQty = 0) : (e.executedPrice = (e.executedQty * e.executedPrice + l * s) / c, e.executedQty = c, e.status = d.instant("PARTIALLY_FILLED"), e.executedQuoteQty = e.executedPrice * e.executedQty), g = e)
  14090. }), e.openOrders.splice(h, 1), 0 == e.openOrders.length ? e.IsopenOrdersNull = !0 : e.IsopenOrdersNull = !1, e.allOrders.splice(0, 0, g), e.allOrders && e.allOrders.length > 30 && e.allOrders.pop()
  14091. }
  14092. O(e.openOrders), U(e.asksTwenty, e.bidsTwenty, e.openOrders)
  14093. }
  14094. var m = e.$root.$$phase;
  14095. "$apply" != m && "$digest" != m && e.$apply()
  14096. }, e.updatePosition = function (t, n, r, o) {
  14097. var i, a;
  14098. if (e.userAssets instanceof Array && (e.userAssets.forEach(function (n, r) {
  14099. n.asset == e.productSplit[t.symbol].base && (i = n, a = r)
  14100. }), !i && "BUY" == t.side)) {
  14101. var s = {};
  14102. s.asset = t.symbol.replace(t.commissionAsset, ""), s.productName = t.productName, s.free = n, s.locked = 0, s.freeze = 0, s.withdrawing = 0, s.ipoing = 0, s.ipoable = 0, s.storage = 0, s.quoteAsset = t.commissionAsset, s.price = r, s.marketValue = n * r, s.profitLoss = -o, e.userAssets.splice(0, 0, s)
  14103. }
  14104. 0 == e.userAssets.length && (e.totalMarketValue = 0, e.totalProfit = 0)
  14105. }, e.connectToKlineStreamer = function (t) {
  14106. null == e.klineStreamer ? e.klineStreamer = new h : e.klineStreamer.stopStream(), e.klineStreamer.startStream(e.product.symbol, t, ae(se), function (e) {
  14107. ye(e)
  14108. })
  14109. }, e.connectToTradeStream = function (t) {
  14110. S.loading("#tradeHistory"), null == e.streamerTrade ? e.streamerTrade = new g : e.streamerTrade.stopStream(), e.streamerTrade.startStream(e.product.symbol, t, function (t) {
  14111. 1 == t.clean && (e.trades = []), ye(t), S.close("#tradeHistory")
  14112. })
  14113. }, e.connectToMktdata = function (t) {
  14114. null == e.streamerMktdata && (e.streamerMktdata = new b, e.streamerMktdata.startStream(t, function (t) {
  14115. t.forEach(function (t) {
  14116. if ("trade" == t.eventType) {
  14117. if (e.currentProduct.symbol == t.symbol) {
  14118. var n = Number(t.price);
  14119. e.currentProduct.close = n, e.currentProduct.open = t.open, e.currentProduct.high = t.high, e.currentProduct.low = t.low, e.currentProduct.volume = Number(t.volume), e.currentProduct.tradedMoney = Number(t.quoteVolume)
  14120. }
  14121. e.productSplit[t.symbol] && (e.lastPrices[e.productSplit[t.symbol].base] = t.price), angular.forEach(e.products, function (e) {
  14122. e.symbol == t.symbol && (e.close = Number(t.price), e.open = t.open, e.high = t.high, e.low = t.low, e.volume = Number(t.volume), e.tradedMoney = Number(t.quoteVolume), e.changeRate = 100 * Number(1 * t.price - t.open) / t.open)
  14123. }), e.getTransToUSDT(e.products), e.sortByKey(e.orderKey, 1)
  14124. }
  14125. });
  14126. var n = e.$root.$$phase;
  14127. "$apply" != n && "$digest" != n && e.$apply()
  14128. }))
  14129. }, n.get("/exchange/public/mktdataWssUrl").success(function (t) {
  14130. e.connectToMktdata(t)
  14131. }), e.getUserInfo = function () {
  14132. var t = {};
  14133. t.method = "post", t.url = "/exchange/private/startStream", n(t).success(function (t) {
  14134. n.get("/exchange/public/wssUrl").success(function (o) {
  14135. var i = o + "/" + t.listenKey;
  14136. r(function () {
  14137. n({
  14138. url: "/exchange/private/pingStream",
  14139. method: "post",
  14140. data: "listenKey=" + t.listenKey
  14141. }).success(function () {
  14142. console.log("pingStream success")
  14143. })
  14144. }, 18e5), null == e.userStreamerInstance && (e.userStreamerInstance = new p, e.userStreamerInstance.startStream(i, e.userCallback))
  14145. })
  14146. })
  14147. }, e.depthSelect = function (e) {
  14148. }, e.isFull = !1;
  14149. var Ce = angular.element("#klinecon"), Ee = angular.element("#chart_container"),
  14150. ge = angular.element(window).height();
  14151. e.setlayout = function () {
  14152. var t = angular.element(window).height(), n = angular.element(".header").outerHeight(!0),
  14153. r = angular.element(".detail-lb").outerHeight(!0), o = angular.element(".detail-rb").outerHeight(!0),
  14154. i = angular.element(".depthctrl").outerHeight(!0), a = angular.element(".orderform").outerHeight(!0);
  14155. angular.element(".detail-lt").css({
  14156. height: t - n - r + 25,
  14157. "max-height": t - n - 12
  14158. }), angular.element(".detail-rt").css("height", t - n - o - 11), angular.element(".newtrade").css("height", 16 * Math.floor((t - n - o - 6 - 20) / 16)), angular.element(".tradefive").css("height", 16 * Math.floor((t - n - o - 6 - 12 - i) / 16) + 12 + i), angular.element(".tradefive-inner").css("height", 16 * Math.floor((t - n - a - (37 + i)) / 2 / 16)), ye({eventType: "depthUpdate"}), "kline" == e.tabName && chart.resize(), "depth" == e.tabName && (angular.element(".box-inner").css({
  14159. height: t - n - r - 47,
  14160. "max-height": t
  14161. }), be.resize())
  14162. }, e.fullpage = function () {
  14163. e.isFull = !0, Ce.css({
  14164. position: "fixed",
  14165. top: "0px",
  14166. left: "0px",
  14167. width: "100%",
  14168. height: "100%",
  14169. "z-index": 99
  14170. }), Ee.css({width: "100%", "max-height": ge - 33 + "px"}), chart.resize()
  14171. }, $(window).keydown(function (t) {
  14172. 27 == t.keyCode && e.isFull && e.offFullpage()
  14173. }), e.offFullpage = function () {
  14174. e.isFull = !1, Ce.css({position: "static"}), e.setlayout()
  14175. }, m.loading(), $(window).load(function () {
  14176. e.setlayout(), chart.resize(), angular.element("input").attr("autocomplete", "off"), m.close()
  14177. }), window.onresize = function () {
  14178. e.setlayout()
  14179. };
  14180. var Ae = !1, Ne = 0;
  14181. $(".handle").mousedown(function (t) {
  14182. Ae = !0, Ne = t.clientY;
  14183. var n = $(".detail-lt").height(), r = $(".detail-lb").height();
  14184. return $(document).mousemove(function (t) {
  14185. if (Ae) {
  14186. var o = t.clientY - Ne;
  14187. $(".detail-lt").css("height", n + o + "px"), $(".detail-lb").css("height", r - o + "px"), "kline" == e.tabName && (chart.resize(), he.resize()), "depth" == e.tabName && ($(".box-inner").css("height", n + o - 34 + "px"), be.resize())
  14188. }
  14189. }), !1
  14190. }), $(document).mouseup(function () {
  14191. Ae = !1
  14192. }), e.isLogin(), (v = document.getElementById("askScrollBox")) && (v.addEventListener(getTransitionEvent().type, function () {
  14193. document.getElementById("askScrollBox").scrollTop = document.getElementById("askScrollBox").scrollHeight
  14194. }), document.getElementById("bidScrollBox").addEventListener(getTransitionEvent().type, function () {
  14195. document.getElementById("bidScrollBox").scrollTop = 0
  14196. })), e.autoSubmit = function (e) {
  14197. var t = $(e.target);
  14198. 6 == t.val().length && setTimeout(function () {
  14199. t.is(":focus") && t.parents("form").submit()
  14200. }, 500)
  14201. }
  14202. }]);
  14203. var sortDepth = new function () {
  14204. this.sort = function (e) {
  14205. return e.sort(function (e, t) {
  14206. return e[1] - t[1]
  14207. }), e
  14208. }, this.median = function (e) {
  14209. var t = Math.floor(e.length / 3 * 2);
  14210. return e[t][1] < 1 ? 1 : e[t][1]
  14211. }, this.medianUnit = function (e, t, n) {
  14212. var r = new Array(e);
  14213. r = r[0];
  14214. var o = new Array(t);
  14215. o = o[0], r = r.concat(o);
  14216. var i = this.median(this.sort(r)) / n;
  14217. return r = null, o = null, i
  14218. }, this.width = function (e, t) {
  14219. if (0 == t) return 1;
  14220. var n = Math.round(Number(e) / t);
  14221. return n <= 0 ? 1 : n > 160 ? 160 : n
  14222. }
  14223. }, BTCConvert = new function () {
  14224. this.setProducts = function (e) {
  14225. this.products = e, this.g = new Graph(e.length);
  14226. var t = this;
  14227. e.forEach(function (e) {
  14228. t.g.addEdge(e.baseAsset, e.quoteAsset, e.symbol)
  14229. })
  14230. }, this.getNewPrice = function (e, t, n) {
  14231. n && this.setProducts(n), this.g.bfs(e);
  14232. var r = this.g.pathTo("BTC");
  14233. if (r) {
  14234. for (var o = 0; o < r.length; o++) this.products.forEach(function (e) {
  14235. if (e.baseAsset == r[o][0] && e.quoteAsset == r[o][1]) {
  14236. n = e.close;
  14237. t *= n
  14238. }
  14239. if (e.quoteAsset == r[o][0] && e.baseAsset == r[o][1]) {
  14240. var n = e.close;
  14241. t /= n
  14242. }
  14243. });
  14244. return t
  14245. }
  14246. return 0
  14247. }
  14248. }, getTransitionEvent = function () {
  14249. var e, t, n = !1, r = document.createElement("fakeelement"), o = {
  14250. WebkitTransition: "webkitTransitionEnd",
  14251. MozTransition: "transitionend",
  14252. OTransition: "otransitionend",
  14253. transition: "transitionend"
  14254. };
  14255. for (e in o) if (void 0 !== r.style[e]) {
  14256. t = o[e], n = !0;
  14257. break
  14258. }
  14259. return {type: t, supported: n}
  14260. };
  14261. app.factory("streamer", ["$http", "$interval", function (e, t) {
  14262. return function () {
  14263. var t, n = {};
  14264. return n.isRunning = !1, n.restart = !1, n.root_url = location.host.match("localhost") || location.host.match("192.168.0") ? "/exchange/public" : "/api/v1", n.startStream = function (e, t, r, o) {
  14265. n.isRunning = !0, n.url = t, n.lastDepthId = -2, n.connectRightNow = !0, n.backedMsg = [], n.buildingState = !0, n.wsbuildingState = !0, n.restart = !0, n.lastConntectTime, n.callback = r, n.symbol = e, n.lowerCaseSymbol = e.toLowerCase(), n.stateChange = o || function () {
  14266. }, n.stateChange(!0), n.ws && n.stopStream(), n.ws = n._makeStream()
  14267. }, n.processData = function (e) {
  14268. n._isDuplicate(e) || n.callback(e)
  14269. }, n.stopStream = function () {
  14270. n.restart = !1, n.ws && (n._clear(n.ws), n.ws.handClose = !0, n.ws.close()), n.lastDepthId = -2, n.connectRightNow = !0, n.backedMsg = [], n.buildingState = !0, n.wsbuildingState = !0, n.isRunning = !1
  14271. }, n._rolloverStream = function () {
  14272. console.log("Rolling over stream!"), n.backedMsg = [], n.buildingState = !0, n.wsbuildingState = !0, n.stateChange(!0), n.ws = n._makeStream()
  14273. }, n._makeStream = function () {
  14274. var r = new WebSocket(n.url + "/" + n.lowerCaseSymbol + "@depth.b10");
  14275. return n._buildState(), r.onopen = function () {
  14276. console.log("Socket has been opened for: " + n.symbol + "!"), n.lastConntectTime = new Date, n.wsbuildingState = !1, n.stateChange(!(0 == n.buildingState && 0 == n.wsbuildingState)), clearInterval(t)
  14277. }, r.onclose = function (e) {
  14278. console.log("Socket has been CLOSED for: " + n.symbol + "!"), n.wsbuildingState = !0, n.stateChange(!0), r.handClose ? (r.handClose = !1, console.log("Socket done!")) : (new Date).getTime() - n.lastConntectTime.getTime() < 12e4 ? setTimeout(function () {
  14279. console.log("streamer reconntect delay=========="), n._rolloverStream()
  14280. }, 1e3) : (console.log("streamer reconntect now=========="), n._rolloverStream())
  14281. }, r.onmessage = function (e) {
  14282. if (r == n.ws) {
  14283. var t = JSON.parse(e.data);
  14284. console.log("WS recv: " + t), t = n.converter(t), n.buildingState ? (n.backedMsg.push(t), console.log("Adding msg to backlog: " + t)) : n._isLoss(t) ? (n.backedMsg = [], n.backedMsg.push(t), n.buildingState = !0, n.stateChange(n.buildingState), n._buildState()) : n.processData(t)
  14285. }
  14286. }, r.onerror = function (r) {
  14287. n.wsbuildingState = !0, n.stateChange(!0), t || (t = setInterval(function () {
  14288. var t = {};
  14289. t.method = "get", t.url = n.root_url + "/depth", t.params = {
  14290. symbol: n.symbol,
  14291. limit: 100
  14292. }, e(t).success(function (e) {
  14293. var t = {};
  14294. t.eventType = "depthUpdate", t.updateId = e.lastUpdateId, t.bids = e.bids, t.asks = e.asks, n.processData(t)
  14295. })
  14296. }, 3e3)), setTimeout(function () {
  14297. console.log("streamer reconntect now=========="), n.stopStream(), n._rolloverStream()
  14298. }, 6e4)
  14299. }, r
  14300. }, n.RePull = function () {
  14301. n.backedMsg = [], n.buildingState = !0, n.stateChange(n.buildingState), n._buildState()
  14302. }, n._buildState = function () {
  14303. var t = {};
  14304. t.method = "get", t.url = n.root_url + "/depth", t.params = {symbol: n.symbol};
  14305. var r = function () {
  14306. e(t).success(function (e) {
  14307. n.lastDepthId = -1;
  14308. var t = {};
  14309. t.eventType = "depthUpdate", t.updateId = e.lastUpdateId, t.bids = e.bids, t.asks = e.asks, t.clean = !0, console.log("GET All Depth Success "), n.processData(t), console.log("Initial state set!"), console.log("Replaying " + n.backedMsg.length + " backed msgs!");
  14310. var o = !1;
  14311. if (n.backedMsg && n.backedMsg.length > 0) {
  14312. var i = n.backedMsg[0];
  14313. n._isLoss(i) && (o = !0, setTimeout(function () {
  14314. r()
  14315. }, 500))
  14316. }
  14317. o || n.backedMsg.forEach(function (e, t) {
  14318. n.processData(e), console.log("Replayed: " + e.eventType)
  14319. }), n.buildingState = !1, n.stateChange(!(0 == n.buildingState && 0 == n.wsbuildingState))
  14320. })
  14321. };
  14322. r()
  14323. }, n.converter = function (e) {
  14324. var t = {};
  14325. return t.eventType = e.e, t.eventTime = e.E, t.symbol = e.s, t.kline = e.k, "depthUpdate" == t.eventType ? (t.event = e.e, t.eventTime = e.E, t.symbol = e.s, t.updateId = e.u, t.fupdateId = e.U, t.bids = e.b, t.asks = e.a) : (console.log("Error! Bad data received:"), console.log(t)), t
  14326. }, n._isDuplicate = function (e) {
  14327. if ("depthUpdate" == e.eventType) {
  14328. if (e.updateId > n.lastDepthId) return n.lastDepthId = e.updateId, !1
  14329. } else console.log("Error! Bad data received:"), console.log(e);
  14330. return !0
  14331. }, n._isLoss = function (e) {
  14332. if ("depthUpdate" == e.eventType) {
  14333. if (e.fupdateId <= n.lastDepthId + 1) return !1
  14334. } else console.log("Error! Has Loss data");
  14335. return !0
  14336. }, n._clear = function (e) {
  14337. e.onopen = null, e.onmessage = null, e.onerror = null, e.onclose = null
  14338. }, n
  14339. }
  14340. }]), app.factory("userStreamer", function () {
  14341. return function () {
  14342. var e = {};
  14343. return e.isRunning = !1, e.restart = !1, e.lastConntectTime = new Date, e.startStream = function (t, n) {
  14344. e.isRunning = !0, e.url = t, e.lastTradeIds = {}, e.backedMsg = [], e.buildingState = !0, e.restart = !0, e.callback = n, e.ws ? e.ws.close() : e.ws = e._makeStream()
  14345. }, e.processData = function (t) {
  14346. e._isDuplicate(t) || e.callback(t)
  14347. }, e.stopStream = function () {
  14348. e.restart = !1, e.ws && e.ws.close(), e.lastTradeIds = {}, e.backedMsg = [], e.buildingState = !0, e.isRunning = !1
  14349. }, e._rolloverStream = function () {
  14350. console.log("Rolling over stream!"), e.backedMsg = [], e.buildingState = !0, e.ws = e._makeStream()
  14351. }, e._makeStream = function () {
  14352. var t = new WebSocket(e.url);
  14353. return t.onopen = function () {
  14354. console.log("Socket has been opened for: market data!"), e.lastConntectTime = new Date, e._buildState()
  14355. }, t.onclose = function (t) {
  14356. console.log("Socket has been CLOSED for: market data!"), e.restart ? (new Date).getTime() - e.lastConntectTime.getTime() < 12e4 ? setTimeout(function () {
  14357. console.log("streamer reconntect delay=========="), e._rolloverStream()
  14358. }, 1e3) : (console.log("streamer reconntect now=========="), e._rolloverStream()) : (delete e.ws, console.log("Socket done!"))
  14359. }, t.onmessage = function (t) {
  14360. var n = JSON.parse(t.data);
  14361. n = e.converter(n), console.log("User data WS recv, eventType: " + n.eventType + ", eventTime: " + n.eventTime), e.buildingState ? (e.backedMsg.push(n), console.log("Adding msg to backlog: " + n.eventType)) : e.processData(n)
  14362. }, t
  14363. }, e._buildState = function () {
  14364. e.buildingState = !1
  14365. }, e.converter = function (e) {
  14366. var t = {};
  14367. return t.eventType = e.e, "outboundAccountInfo" == t.eventType ? (t.eventTime = e.E, t.makerCommission = e.m, t.takerCommission = e.t, t.buyerCommission = e.b, t.sellerCommission = e.s, t.isActive = e.a, t.balances = [], e.B && e.B.forEach(function (e) {
  14368. t.balances.push({asset: e.a, free: e.f, locked: e.l})
  14369. }), t.leverage = e.l, t.positions = [], e.p && e.p.forEach(function (e) {
  14370. t.positions.push({
  14371. symbol: e.s,
  14372. usedQty: e.u,
  14373. usedMargin: e.U,
  14374. avgQuotePrice: e.q,
  14375. pendingQtyBuy: e.b,
  14376. pendingMarginBuy: e.B,
  14377. pendingQtySell: e.a,
  14378. pendingMarginSell: e.A,
  14379. lockedProfitLoss: e.l
  14380. })
  14381. })) : "executionReport" == t.eventType && (t.event = e.e, t.eventTime = e.E, t.symbol = e.s, t.clOrdId = e.c, t.side = e.S, t.orderType = e.o, t.timeInForce = e.f, t.qty = e.q, t.price = e.p, t.stopPrice = e.P, t.maxFloor = e.F, t.originalClOrdId = e.C, t.executionType = e.x, t.orderStatus = e.X, t.orderRejectReason = e.r, t.orderId = e.i, t.lastQty = e.l, t.cummulativeQty = e.z, t.lastPrice = e.L, t.commission = e.n, t.commissionAsset = e.N, t.time = e.T, t.executionId = e.I, t.tradeId = e.t, t.workingIndicator = e.w, t.isMaker = e.m, t.commissionAsset = e.N), t
  14382. }, e._isDuplicate = function (e) {
  14383. return !1
  14384. }, e
  14385. }
  14386. }), app.factory("klineStreamer", ["$http", "$interval", "$rootScope", function (e, t, n) {
  14387. return function () {
  14388. var e = {};
  14389. return e.isRunning = !1, e.restart = !1, e.lastTradeId = -1, e.root_url = location.host.match("localhost") || location.host.match("192.168.0") ? "/exchange/public" : "/api/v1", e.startStream = function (t, n, r, o) {
  14390. e.isRunning = !0, e.url = n, e.interval = r, e.lastDepthId = -2, e.lastKlineId = -1, e.backedMsg = [], e.restart = !0, e.lastConntectTime = new Date, e.symbol = t, e.lowerCaseSymbol = t.toLowerCase(), e.callback = o, e.ws && e.stopStream(), e.ws = e._makeStream()
  14391. }, e.processData = function (t) {
  14392. e._isDuplicate(t) || e.callback(t)
  14393. }, e.stopStream = function () {
  14394. e.restart = !1, e.ws && (e._clear(e.ws), e.ws.HandClose = !0, e.ws.close()), e.lastDepthId = -1, e.lastKlineId = -1, e.backedMsg = [], e.isRunning = !1
  14395. }, e._rolloverStream = function () {
  14396. console.log("Rolling over stream!"), e.backedMsg = [], e.ws = e._makeStream()
  14397. }, e._makeStream = function () {
  14398. var t = new WebSocket(e.url + "/" + e.lowerCaseSymbol + "@kline_" + e.interval + ".b10");
  14399. return n.websocketStatus = "connecting", t.onopen = function () {
  14400. n.websocketStatus = "connected", console.log("Socket has been opened for: " + e.symbol + "!"), e.lastConntectTime = new Date
  14401. }, t.onclose = function (r) {
  14402. console.log("Socket has been CLOSED for: " + e.symbol + "!"), t.HandClose ? (t.HandClose = !0, console.log("Socket done!")) : (n.websocketStatus = "reconnecting", (new Date).getTime() - e.lastConntectTime.getTime() < 12e4 ? setTimeout(function () {
  14403. console.log("streamer reconntect delay=========="), e._rolloverStream()
  14404. }, 1e3) : (console.log("streamer reconntect now=========="), e._rolloverStream()))
  14405. }, t.onerror = function () {
  14406. n.websocketStatus = "error"
  14407. }, t.onmessage = function (t) {
  14408. var n = JSON.parse(t.data);
  14409. n = e.converter(n), console.log("WS recv: " + n), e.processData(n)
  14410. }, t
  14411. }, e.converter = function (e) {
  14412. var t = {};
  14413. return t.eventType = e.e, t.eventTime = e.E, t.symbol = e.s, t.kline = {}, t.kline.time = e.k.t, t.kline.closeTime = e.k.T, t.kline.symbol = e.k.s, t.kline.interval = e.k.i, t.kline.firstId = e.k.f, t.kline.lastId = e.k.L, t.kline.open = e.k.o, t.kline.close = e.k.c, t.kline.high = e.k.h, t.kline.low = e.k.l, t.kline.volume = e.k.v, t.kline.quoteVolume = e.k.q, t.kline.count = e.k.n, t.kline.closed = e.k.x, t
  14414. }, e._isDuplicate = function (e) {
  14415. return "kline" != e.eventType && (console.log("Error! Bad data received:"), console.log(e), !0)
  14416. }, e._clear = function (e) {
  14417. e.onopen = null, e.onmessage = null, e.onerror = null, e.onclose = null
  14418. }, e
  14419. }
  14420. }]);
  14421. var tradeSymbol = "";
  14422. app.factory("tradeStreamer", ["$http", "$interval", function (e, t) {
  14423. return function () {
  14424. var t = {};
  14425. return t.isRunning = !1, t.restart = !1, t.lastAggTradeId = -2, t.root_url = location.host.match("localhost") || location.host.match("192.168.0") ? "/exchange/public" : "/api/v1", t.startStream = function (e, n, r) {
  14426. t.isRunning = !0, t.lastDepthId = -2, t.lastKlineId = -1, t.backedMsg = [], t.buildingState = !0, t.restart = !0, t.lastConntectTime, t.symbol = e, tradeSymbol = e, t.lowerCaseSymbol = e.toLowerCase(), t.url = n, t.callback = r, t.ws && t.stopStream(), t.ws = t._makeStream()
  14427. }, t.processData = function (e) {
  14428. t._isDuplicate(e) || t.callback(e)
  14429. }, t.stopStream = function () {
  14430. t.restart = !1, t.ws && (t._clear(t.ws), t.ws.HandClose = !0, t.ws.close()), t.lastKlineId = -1, t.backedMsg = [], t.buildingState = !0, t.isRunning = !1
  14431. }, t._rolloverStream = function () {
  14432. console.log("Rolling over stream!"), t.backedMsg = [], t.buildingState = !0, t.ws = t._makeStream()
  14433. }, t._makeStream = function () {
  14434. var n = new WebSocket(t.url + "/" + t.lowerCaseSymbol + "@aggTrade.b10");
  14435. return n.onopen = function () {
  14436. console.log("Socket has been opened for: " + t.symbol + "!"), t.lastConntectTime = new Date, t._buildState(), clearInterval(void 0)
  14437. }, n.onclose = function (e) {
  14438. console.log("Socket has been CLOSED for: " + t.symbol + "!"), n.HandClose ? (n.HandClose = !1, console.log("Socket done!")) : (new Date).getTime() - t.lastConntectTime.getTime() < 12e4 ? setTimeout(function () {
  14439. console.log("streamer reconntect delay=========="), t._rolloverStream()
  14440. }, 1e3) : (console.log("streamer reconntect now=========="), t._rolloverStream())
  14441. }, n.onmessage = function (e) {
  14442. var n = JSON.parse(e.data);
  14443. console.log("WS recv: " + n), n = t.converter(n), t.buildingState ? (t.backedMsg.push(n), console.log("Adding msg to backlog: " + n)) : t.processData(n)
  14444. }, n.onerror = function (n) {
  14445. var r = {};
  14446. r.method = "get", r.url = t.root_url + "/aggTrades", r.params = {
  14447. symbol: t.symbol,
  14448. limit: 40
  14449. }, e(r).success(function (e) {
  14450. for (var n = 0; n < e.length; n++) {
  14451. var r = {};
  14452. r.eventType = "trade", r.aggTradeId = e[n].a, r.firstTradeId = e[n].f, r.lastTradeId = e[n].l, r.price = e[n].p, r.qty = e[n].q, r.symbol = e[n].s, r.time = e[n].T, r.isBuyerMaker = e[n].m, r.buyerOrderId = -1, r.sellerOrderId = -1, t.processData(r)
  14453. }
  14454. }), setTimeout(function () {
  14455. console.log("streamer reconntect now=========="), t.stopStream(), t._rolloverStream()
  14456. }, 6e4)
  14457. }, n
  14458. }, t._buildState = function () {
  14459. var n = {};
  14460. n.method = "get", n.url = t.root_url + "/aggTrades", n.params = {
  14461. symbol: t.symbol,
  14462. limit: 40
  14463. }, e(n).success(function (e) {
  14464. if (console.log("Successfully Get Trades Second Time"), tradeSymbol == t.symbol) {
  14465. t.lastAggTradeId = -1;
  14466. var n = {};
  14467. n.clean = !0, 0 == e.length && (n.eventType = "trade", n.aggTradeId = 1, t.processData(n));
  14468. for (var r = 0; r < e.length; r++) n.eventType = "trade", n.aggTradeId = e[r].a, n.firstTradeId = e[r].f, n.lastTradeId = e[r].l, n.price = e[r].p, n.qty = e[r].q, n.symbol = e[r].s, n.time = e[r].T, n.isBuyerMaker = e[r].m, n.buyerOrderId = -1, n.sellerOrderId = -1, t.processData(n), n = {};
  14469. console.log("Initial state set!"), console.log("Replaying " + t.backedMsg.length + " backed msgs!");
  14470. for (var o = t.backedMsg.shift(); o;) t.processData(o), console.log("Replayed: " + o.eventType), o = t.backedMsg.shift();
  14471. if (t.buildingState = !1, console.log("Replaying DONE! " + t.backedMsg.length + " backed msgs remain."), 0 != t.backedMsg.length) for (console.log("OMG!! ME SMASH!!! GIVE ME A REAL THREADING MODEL PLEASE!!"), o = t.backedMsg.shift(); o;) t.processData(o), o = t.backedMsg.shift()
  14472. }
  14473. })
  14474. }, t._getLastTrade = function (n) {
  14475. var r = {};
  14476. r.method = "get", r.url = t.root_url + "/aggTrades", r.params = {
  14477. symbol: t.symbol,
  14478. limit: 40
  14479. }, e(r).success(function (e) {
  14480. n(e)
  14481. })
  14482. }, t.converterGets = function (e) {
  14483. for (var t = [], n = 0; n < e.length; n++) {
  14484. var r = {};
  14485. r.eventType = "trade", r.aggTradeId = e[n].a, r.firstTradeId = e[n].f, r.lastTradeId = e[n].l, r.price = e[n].p, r.qty = e[n].q, r.symbol = e[n].s, r.time = e[n].T, r.isBuyerMaker = e[n].m, r.buyerOrderId = -1, r.sellerOrderId = -1, t.push(r)
  14486. }
  14487. return t
  14488. }, t.converter = function (e) {
  14489. var t = {};
  14490. return t.eventType = "aggTrade" == e.e && "trade", t.eventTime = e.E, t.symbol = e.s, t.kline = e.k, "trade" == t.eventType ? (t.aggTradeId = e.a, t.event = e.e, t.eventTime = e.E, t.firstTradeId = e.f, t.lastTradeId = e.l, t.price = e.p, t.qty = e.q, t.symbol = e.s, t.time = e.T, t.isBuyerMaker = e.m) : (console.log("Error! Bad data received:"), console.log(t)), t
  14491. }, t._isDuplicate = function (e) {
  14492. if ("trade" == e.eventType) {
  14493. if (e.aggTradeId > t.lastAggTradeId) return t.lastAggTradeId = e.aggTradeId, !1
  14494. } else console.log("Error! Bad data received:"), console.log(e);
  14495. return !0
  14496. }, t._clear = function (e) {
  14497. e.onopen = null, e.onmessage = null, e.onerror = null, e.onclose = null
  14498. }, t
  14499. }
  14500. }]), app.factory("mktdataStreamer", ["$http", "$interval", "$rootScope", function (e, t, n) {
  14501. return function () {
  14502. var e = {};
  14503. return e.isRunning = !1, e.restart = !1, e.startStream = function (t, n) {
  14504. e.isRunning = !0, e.url = t, e.lastTradeIds = {}, e.backedMsg = [], e.buildingState = !0, e.restart = !0, e.callback = n, e.ws ? e.ws.close() : e.ws = e._makeStream()
  14505. }, e.processData = function (t) {
  14506. e.callback(t)
  14507. }, e.stopStream = function () {
  14508. e.restart = !1, e.ws && e.ws.close(), e.lastTradeIds = {}, e.backedMsg = [], e.buildingState = !0, e.isRunning = !1
  14509. }, e._rolloverStream = function () {
  14510. console.log("Rolling over stream!"), e.backedMsg = [], e.buildingState = !0, e.ws = e._makeStream()
  14511. }, e._makeStream = function () {
  14512. var t = new WebSocket(e.url + "/!miniTicker@arr@3000ms");
  14513. return n.websocketStatus = "connecting", t.onopen = function () {
  14514. n.websocketStatus = "connected", console.log("Socket has been opened for: market data!"), e.lastConntectTime = new Date, e._buildState()
  14515. }, t.onclose = function (t) {
  14516. console.log("Socket has been CLOSED for: market data!"), e.restart ? (n.websocketStatus = "reconnecting", (new Date).getTime() - e.lastConntectTime.getTime() < 12e4 ? setTimeout(function () {
  14517. console.log("streamer reconntect delay=========="), e._rolloverStream()
  14518. }, 1e3) : (console.log("streamer reconntect now=========="), e._rolloverStream())) : (delete e.ws, console.log("Socket done!"))
  14519. }, t.onerror = function () {
  14520. n.websocketStatus = "error"
  14521. }, t.onmessage = function (t) {
  14522. var n = JSON.parse(t.data);
  14523. n = e.converter(n), console.log("Market data WS recv, symbol: " + n.symbol + ", lastUpdateTime: " + n.lastUpdateTime), e.buildingState ? (e.backedMsg.push(n), console.log("Adding msg to backlog: " + n.eventType)) : e.processData(n)
  14524. }, t
  14525. }, e._buildState = function () {
  14526. e.buildingState = !1
  14527. }, e.converter = function (e) {
  14528. for (var t = [], n = 0; n < e.length; n++) {
  14529. var r = {}, o = e[n];
  14530. r.eventType = "trade", r.symbol = o.s, r.price = o.c, r.open = o.o, r.high = o.h, r.low = o.l, r.volume = o.v, r.quoteVolume = o.q, t.push(r)
  14531. }
  14532. return t
  14533. }, e._isDuplicate = function (t) {
  14534. for (var n = 0; n < t.length; n++) {
  14535. var r = t[n];
  14536. if ("trade" == r.eventType && (void 0 == e.lastTradeIds[r.symbol] || e.lastTradeIds[r.symbol] < r.tradeId)) return e.lastTradeIds[r.symbol] = r.tradeId, !1
  14537. }
  14538. return !0
  14539. }, e
  14540. }
  14541. }]), app.factory("myInterceptor", ["$q", "$cookies", function (e, t) {
  14542. return {
  14543. request: function (e) {
  14544. return e.headers = {
  14545. "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
  14546. lang: localStorage.lang,
  14547. clientType: "web"
  14548. }, t.CSRFToken && (e.headers.CSRFToken = $.md5(t.CSRFToken)), e
  14549. }, response: function (e) {
  14550. return e
  14551. }, requestError: function (t) {
  14552. return e.reject(t)
  14553. }, responseError: function (t) {
  14554. if (console.log(t), 401 == t.status) {
  14555. var n = new Date;
  14556. n.setTime(n.getTime() - 1e3), t = JSON.stringify(t), localStorage.setItem("temp2", t), localStorage.getItem("temp2"), localStorage.getItem("temp2"), localStorage.a = document.cookie, document.cookie = "logined=;path=/;expires=" + n.toGMTString(), location.href = "/login.html?callback=" + encodeURIComponent(location.pathname) + encodeURIComponent(location.search)
  14557. }
  14558. return e.reject(t)
  14559. }
  14560. }
  14561. }]), app.factory("user", ["$http", "$cookies", "$translate", function (e, t, n) {
  14562. var r = {};
  14563. return r.logout = function () {
  14564. e({method: "post", url: "/user/loginOut.html"}).success(function (e) {
  14565. if (e.success) {
  14566. var t = new Date;
  14567. t.setTime(t.getTime() - 1e3), document.cookie = "logined=;path=/;expires=" + t.toGMTString(), window.location.reload()
  14568. }
  14569. })
  14570. }, r.login = function () {
  14571. setTimeout(function () {
  14572. angular.element("#userId").focus()
  14573. }), layer.open({
  14574. type: 1,
  14575. title: null,
  14576. shade: [.85, "#000"],
  14577. shadeClose: !0,
  14578. shift: 1,
  14579. closeBtn: 1,
  14580. area: "auto",
  14581. content: $("#login-box"),
  14582. end: function () {
  14583. }
  14584. })
  14585. }, r.gauth = function () {
  14586. angular.element(".wrap").addClass("blur"), angular.element("#imageStream1").click(), layer.open({
  14587. type: 1,
  14588. title: n.instant("gauth"),
  14589. shadeClose: !0,
  14590. shift: 1,
  14591. area: ["300px", "200px"],
  14592. content: $("#gauth-box"),
  14593. end: function () {
  14594. angular.element(".wrap").removeClass("blur")
  14595. }
  14596. })
  14597. }, r
  14598. }]), app.factory("getRequest", function () {
  14599. var e = location.search, t = new Object;
  14600. if (-1 != e.indexOf("?")) for (var n = e.substr(1).split("&"), r = 0; r < n.length; r++) t[n[r].split("=")[0]] = unescape(n[r].split("=")[1]);
  14601. return t
  14602. }), app.factory("layout", function () {
  14603. var e = {};
  14604. return e.set = function () {
  14605. var e = angular.element(".header").outerHeight(!0), t = angular.element(".tradelist-main-bottom").outerHeight(!0),
  14606. n = angular.element(window).height();
  14607. angular.element(".tradelist-main-top").css({
  14608. height: n - e - t,
  14609. "max-height": n - e - t
  14610. }), angular.element(".list-table").css({height: n - e - t - 79, "max-height": n - e - t - 79})
  14611. }, e
  14612. }), app.factory("intro", ["$rootScope", function (e) {
  14613. var t = {};
  14614. return t.init = function () {
  14615. e.ShouldAutoStart = !1, e.IntroOptions = {
  14616. steps: [{
  14617. element: "#step1",
  14618. intro: '<img src="/exchange/resources/img/guide/step1.png"/>',
  14619. position: "right"
  14620. }, {
  14621. element: "#step2",
  14622. intro: '<img src="/exchange/resources/img/guide/step2.png"/>',
  14623. position: "bottom"
  14624. }, {
  14625. element: "#step3",
  14626. intro: '<img src="/exchange/resources/img/guide/step3.png"/>',
  14627. position: "bottom"
  14628. }, {
  14629. element: "#step4",
  14630. intro: '<img src="/exchange/resources/img/guide/step4.png"/>',
  14631. position: "right"
  14632. }, {
  14633. element: "#step5",
  14634. intro: '<img src="/exchange/resources/img/guide/step5.png"/>',
  14635. position: "left"
  14636. }, {
  14637. element: "#step6",
  14638. intro: '<img src="/exchange/resources/img/guide/step6.png"/><span class="start-btn" onclick="document.getElementsByClassName(\'introjs-overlay\')[0].click()">开始交易</span>',
  14639. position: "left"
  14640. }],
  14641. showStepNumbers: !1,
  14642. exitOnOverlayClick: !0,
  14643. exitOnEsc: !0,
  14644. keyboardNavigation: !0,
  14645. showBullets: !1,
  14646. overlayOpacity: 1,
  14647. nextLabel: "<strong>下一步</strong>",
  14648. prevLabel: '<span style="color:green">上一步</span>',
  14649. skipLabel: '<i class="font font-close"></i>',
  14650. doneLabel: '<i class="font font-close"></i>'
  14651. }, e.showHelp = function () {
  14652. angular.element("body").append('<div class="overlayer"></div>'), angular.element("#guide-box").show()
  14653. }, e.hideHelp = function () {
  14654. angular.element(".overlayer").remove(), angular.element("#guide-box").hide()
  14655. }, e.startGuide = function () {
  14656. e.hideHelp()
  14657. }
  14658. }, t
  14659. }]), app.factory("scroll", function () {
  14660. var e, t = {};
  14661. return t.scrollTop = function (t) {
  14662. var n = $(t), r = n.find("li"), o = "-" + r.height() + "px";
  14663. r.length > 1 && (e = setInterval(function () {
  14664. n.animate({top: o}, 500, function () {
  14665. n.find("li:first").appendTo(n), n.css("top", 0)
  14666. })
  14667. }, 5e3))
  14668. }, t.stop = function () {
  14669. clearInterval(e)
  14670. }, t
  14671. }), app.factory("pageLoading", function () {
  14672. var e = {};
  14673. return e.loading = function () {
  14674. var t = ['<div class="spinner">', '<div class="rect2"></div>', '<div class="rect3"></div>', '<div class="rect4"></div>', '<div class="rect5"></div>', "</div>"].join("");
  14675. e.loading = layer.open({type: 1, title: null, closeBtn: !1, shade: .9, area: ["100%", "100%"], content: t})
  14676. }, e.close = function () {
  14677. layer.close(e.loading)
  14678. }, e
  14679. }), app.factory("pageLoading1", function () {
  14680. var e = {};
  14681. return e.loading = function () {
  14682. if (!$("#pageLoading").html()) {
  14683. var e = ['<div id="pageLoading">', '<div class="spinner">', '<div class="rect2"></div>', '<div class="rect3"></div>', '<div class="rect4"></div>', '<div class="rect5"></div>', "</div>", "</div>"].join("");
  14684. $("body").append(e)
  14685. }
  14686. }, e.close = function () {
  14687. $("#pageLoading").hide()
  14688. }, e
  14689. }), app.factory("divLoading", function () {
  14690. var e = {}, t = {};
  14691. return e.loading = function (e) {
  14692. if ($(e + " #divLoading").html()) $(e + " #divLoading").show(); else {
  14693. var n = ['<div id="divLoading">', '<div class="spinner">', '<div class="rect2"></div>', '<div class="rect3"></div>', '<div class="rect4"></div>', '<div class="rect5"></div>', "</div>", "</div>"].join("");
  14694. $(e).append(n)
  14695. }
  14696. t[e] || (t[e] = 0), t[e] += 1
  14697. }, e.close = function (e, n) {
  14698. n ? (t[e] -= 1, t[e] <= 0 && $(e + " #divLoading").hide()) : $(e + " #divLoading").hide()
  14699. }, e
  14700. }), app.factory("T", ["$translate", function (e) {
  14701. return {
  14702. T: function (t) {
  14703. return t ? e.instant(t) : t
  14704. }
  14705. }
  14706. }]), app.factory("form", function () {
  14707. var e, t = {};
  14708. return t.validate = function (t, n, r, o) {
  14709. return $(t).Validform({
  14710. btnSubmit: n,
  14711. showAllError: !1,
  14712. datatype: {
  14713. amount: /^(([1-9]\d{0,9})|0)(\.\d{1,8})?$/,
  14714. pwd: /^(?=.*\d)(?=.*[A-Z])[\da-zA-Z~!@#$%^&*-_——\\\/]{8,}$/,
  14715. mobile: /^[1]\d{10}$/
  14716. },
  14717. postonce: !1,
  14718. ajaxPost: !0,
  14719. tiptype: function (t, n, r) {
  14720. if (n.obj.is("form")) e = layer.load("正在提交...", 3); else {
  14721. var o = n.obj.siblings(".Validform_checktip");
  14722. r(o, n.type), o.text(t)
  14723. }
  14724. },
  14725. beforeSubmit: function (e) {
  14726. $(this.btnSubmit).attr("disabled", !0), o && o()
  14727. },
  14728. callback: function (t) {
  14729. layer.close(e), $(this.btnSubmit).attr("disabled", !1), r(t)
  14730. }
  14731. })
  14732. }, t
  14733. }), app.factory("mobile", ["$http", "$translate", function (e, t) {
  14734. var n = {}, r = null;
  14735. return n.flag = !0, n.showError = function (e, t) {
  14736. angular.element("#" + e).focus().siblings(".Validform_checktip").text(t).addClass("Validform_wrong")
  14737. }, n.picVerifyCode = function (e, t) {
  14738. angular.element("#" + e).val("").focus(), angular.element("#" + t).click()
  14739. }, n.clearCountDown = function (e, o) {
  14740. n.flag = !0, angular.element("#" + o).text(t.instant("Regain")).removeClass("btn-disabled"), clearInterval(r)
  14741. }, n.countDown = function (e, o) {
  14742. angular.element("#" + e).val(""), angular.element("#" + o).addClass("btn-disabled");
  14743. var i = 60;
  14744. r = setInterval(function () {
  14745. angular.element("#" + o).text(t.instant("Regain") + "(" + i + ")"), -1 == --i && n.clearCountDown(e, o)
  14746. }, 1e3)
  14747. }, n.sendVerifyCode = function (t, r, o, i) {
  14748. if (n.flag) {
  14749. if (n.flag = !1, n.countDown(r, o), i) a = $.param({mobile: i}); else var a;
  14750. e.post(t, a).then(function (e) {
  14751. if (!e.data.success) return layer.msg(e.data.msg, {
  14752. icon: 2,
  14753. shift: 1,
  14754. time: 1500
  14755. }), n.picVerifyCode("registerValiCode", "imageStream1"), n.flag = !0, n.clearCountDown(r, o), !1
  14756. }, function (e) {
  14757. layer.msg(e.data.msg, {icon: 2, shift: 1, time: 1500}), n.clearCountDown(r, o)
  14758. })
  14759. }
  14760. }, n
  14761. }]), app.factory("urlSearch", function () {
  14762. var e = {};
  14763. return e.getUrlParam = function (e) {
  14764. for (var t = location.search.substr(1).split("&"), n = 0; n < t.length; n++) {
  14765. var r = t[n].split("=");
  14766. if (e == r[0]) return r[1]
  14767. }
  14768. }, e
  14769. }), app.factory("SPA", function () {
  14770. var e = {};
  14771. return e.setUrl = function (t) {
  14772. history.replaceState(null, "", t), e.UrlChange && e.UrlChange()
  14773. }, e
  14774. }), app.filter("filterFloor", function () {
  14775. return function (e) {
  14776. return Math.floor(e)
  14777. }
  14778. }).filter("marketPrice", function () {
  14779. return function (e) {
  14780. return -1 == e ? "市价" : e
  14781. }
  14782. }).filter("filterol", function () {
  14783. return function (e) {
  14784. return null != e ? Number(e).toFixed(8) : "--"
  14785. }
  14786. }).filter("filterProfitRatio", function () {
  14787. return function (e) {
  14788. return e > 9999 ? "+9999" : e
  14789. }
  14790. }).filter("phone", function () {
  14791. return function (e) {
  14792. var t;
  14793. return e && (t = e.substr(0, 3) + "****" + e.substr(e.length - 4)), t
  14794. }
  14795. }).filter("filtermn", function () {
  14796. return function (e) {
  14797. return e >= 0 ? "+" + Number(e).toFixed(2) : Number(e).toFixed(2)
  14798. }
  14799. }).filter("filtermnq", function () {
  14800. return function (e) {
  14801. var t;
  14802. return 0 == e ? t = Number(e).toFixed(2) + "%" : e > 0 || e < 0 ? t = Number(e).toFixed(2) + "%" : "--" == e && (t = "--"), t
  14803. }
  14804. }).filter("filtermns", function () {
  14805. return function (e) {
  14806. var t;
  14807. return 0 == e ? t = Number(e).toFixed(2) : e > 0 || e < 0 ? t = Number(e).toFixed(2) : "--" == e && (t = "--"), t
  14808. }
  14809. }).filter("get8Date", function () {
  14810. return function (e) {
  14811. var t = new Date(e), n = 6e4 * t.getTimezoneOffset(), r = t.getTime() + n;
  14812. return new Date(r + 288e5)
  14813. }
  14814. }).filter("T", ["$translate", function (e) {
  14815. return function (t) {
  14816. if (t) return e.instant(t)
  14817. }
  14818. }]).filter("floor", function () {
  14819. return function (e) {
  14820. var t = Array.prototype.slice.call(arguments);
  14821. return (Math.floor(Number(e) * Math.pow(10, Number(t[1]))) / Math.pow(10, Number(t[1]))).toFixed(t[1])
  14822. }
  14823. }).filter("ifnull", function () {
  14824. return function (e) {
  14825. return e && 0 != Number(e) ? e : "--"
  14826. }
  14827. }).filter("symbol", function () {
  14828. return function (e) {
  14829. return e = e || 0, Number(e) >= 0 ? "+" + e : e
  14830. }
  14831. }).filter("sameGray", ["$sce", function (e) {
  14832. return function (t, n, r) {
  14833. var o;
  14834. return t = t && (t + "").replace(",", ""), o = n && t.substring(0, t.length - 2) == Number(n).toFixed(r).substring(0, t.length - 2) ? '<span class="gray">' + t.substring(0, t.length - 2) + "</span>" + t.substr(t.length - 2, 2) : Number(t).toFixed(r), o = "<span>" + o + "</span>", e.trustAsHtml(o)
  14835. }
  14836. }]).filter("getDigit", function () {
  14837. return function (e) {
  14838. return (1 / Math.pow(10, e)).toFixed(e)
  14839. }
  14840. }), Date.prototype.get8Date = function () {
  14841. var e = 6e4 * this.getTimezoneOffset(), t = this.getTime() + e;
  14842. return new Date(t + 288e5)
  14843. };