game-min-07263.js 635 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582
  1. /*
  2. zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */
  3. var egret; (function(c) {
  4. var e = function() {
  5. function c() {
  6. this._hashCode = c.hashCount++
  7. }
  8. Object.defineProperty(c.prototype, "hashCode", {
  9. get: function() {
  10. return this._hashCode
  11. },
  12. enumerable: !0,
  13. configurable: !0
  14. });
  15. c.hashCount = 1;
  16. return c
  17. } ();
  18. c.HashObject = e
  19. })(egret || (egret = {}));
  20. var __extends = this.__extends ||
  21. function(c, e) {
  22. function d() {
  23. this.constructor = c
  24. }
  25. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  26. d.prototype = e.prototype;
  27. c.prototype = new d
  28. }; (function(c) {
  29. var e = function(c) {
  30. function a(b) {
  31. "undefined" === typeof b && (b = 300);
  32. c.call(this);
  33. this.objectPool = [];
  34. this._length = 0;
  35. 1 > b && (b = 1);
  36. this.autoDisposeTime = b;
  37. this.frameCount = 0
  38. }
  39. __extends(a, c);
  40. a.prototype._checkFrame = function() {
  41. this.frameCount--;
  42. 0 >= this.frameCount && this.dispose()
  43. };
  44. Object.defineProperty(a.prototype, "length", {
  45. get: function() {
  46. return this._length
  47. },
  48. enumerable: !0,
  49. configurable: !0
  50. });
  51. a.prototype.push = function(b) {
  52. var h = this.objectPool; - 1 == h.indexOf(b) && (h.push(b), this._length++, 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  53. };
  54. a.prototype.pop = function() {
  55. if (0 == this._length) return null;
  56. this._length--;
  57. return this.objectPool.pop()
  58. };
  59. a.prototype.dispose = function() {
  60. 0 < this._length && (this.objectPool = [], this._length = 0);
  61. this.frameCount = 0;
  62. var b = a._callBackList,
  63. h = b.indexOf(this); - 1 != h && b.splice(h, 1)
  64. };
  65. a._callBackList = [];
  66. return a
  67. } (c.HashObject);
  68. c.Recycler = e
  69. })(egret || (egret = {})); (function(c) {
  70. c.__START_TIME;
  71. c.getTimer = function() {
  72. return Date.now() - c.__START_TIME
  73. }
  74. })(egret || (egret = {})); (function(c) {
  75. c.__callLaterFunctionList = [];
  76. c.__callLaterThisList = [];
  77. c.__callLaterArgsList = [];
  78. c.callLater = function(e, d) {
  79. for (var a = [], b = 0; b < arguments.length - 2; b++) a[b] = arguments[b + 2];
  80. c.__callLaterFunctionList.push(e);
  81. c.__callLaterThisList.push(d);
  82. c.__callLaterArgsList.push(a)
  83. }
  84. })(egret || (egret = {}));
  85. __extends = this.__extends ||
  86. function(c, e) {
  87. function d() {
  88. this.constructor = c
  89. }
  90. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  91. d.prototype = e.prototype;
  92. c.prototype = new d
  93. }; (function(c) {
  94. var e = function(d) {
  95. function a(b, a, c) {
  96. "undefined" === typeof a && (a = !1);
  97. "undefined" === typeof c && (c = !1);
  98. d.call(this);
  99. this._eventPhase = 2;
  100. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  101. this.isNew = !0;
  102. this._type = b;
  103. this._bubbles = a;
  104. this._cancelable = c
  105. }
  106. __extends(a, d);
  107. Object.defineProperty(a.prototype, "type", {
  108. get: function() {
  109. return this._type
  110. },
  111. enumerable: !0,
  112. configurable: !0
  113. });
  114. Object.defineProperty(a.prototype, "bubbles", {
  115. get: function() {
  116. return this._bubbles
  117. },
  118. enumerable: !0,
  119. configurable: !0
  120. });
  121. Object.defineProperty(a.prototype, "cancelable", {
  122. get: function() {
  123. return this._cancelable
  124. },
  125. enumerable: !0,
  126. configurable: !0
  127. });
  128. Object.defineProperty(a.prototype, "eventPhase", {
  129. get: function() {
  130. return this._eventPhase
  131. },
  132. enumerable: !0,
  133. configurable: !0
  134. });
  135. Object.defineProperty(a.prototype, "currentTarget", {
  136. get: function() {
  137. return this._currentTarget
  138. },
  139. enumerable: !0,
  140. configurable: !0
  141. });
  142. a.prototype._setCurrentTarget = function(b) {
  143. this._currentTarget = b
  144. };
  145. Object.defineProperty(a.prototype, "target", {
  146. get: function() {
  147. return this._target
  148. },
  149. enumerable: !0,
  150. configurable: !0
  151. });
  152. a.prototype.isDefaultPrevented = function() {
  153. return this._isDefaultPrevented
  154. };
  155. a.prototype.preventDefault = function() {
  156. this._cancelable && (this._isDefaultPrevented = !0)
  157. };
  158. a.prototype.stopPropagation = function() {
  159. this._bubbles && (this._isPropagationStopped = !0)
  160. };
  161. a.prototype.stopImmediatePropagation = function() {
  162. this._bubbles && (this._isPropagationImmediateStopped = !0)
  163. };
  164. a.prototype._reset = function() {
  165. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  166. };
  167. a._dispatchByTarget = function(b, a, m, d, e, g) {
  168. "undefined" === typeof e && (e = !1);
  169. "undefined" === typeof g && (g = !1);
  170. var l = b.eventRecycler;
  171. l || (l = b.eventRecycler = new c.Recycler);
  172. var n = l.pop();
  173. n ? n._type = m: n = new b(m);
  174. n._bubbles = e;
  175. n._cancelable = g;
  176. if (d) for (var p in d) n[p] = d[p],
  177. null !== n[p] && (d[p] = null);
  178. b = a.dispatchEvent(n);
  179. l.push(n);
  180. return b
  181. };
  182. a._getPropertyData = function(b) {
  183. var a = b._props;
  184. a || (a = b._props = {});
  185. return a
  186. };
  187. a.dispatchEvent = function(b, h, c, d) {
  188. "undefined" === typeof c && (c = !1);
  189. var e = a._getPropertyData(a);
  190. d && (e.data = d);
  191. a._dispatchByTarget(a, b, h, e, c)
  192. };
  193. a.ADDED_TO_STAGE = "addedToStage";
  194. a.REMOVED_FROM_STAGE = "removedFromStage";
  195. a.ADDED = "added";
  196. a.REMOVED = "removed";
  197. a.COMPLETE = "complete";
  198. a.ENTER_FRAME = "enterFrame";
  199. a.RENDER = "render";
  200. a.FINISH_RENDER = "finishRender";
  201. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  202. a.LEAVE_STAGE = "leaveStage";
  203. a.RESIZE = "resize";
  204. a.CHANGE = "change";
  205. return a
  206. } (c.HashObject);
  207. c.Event = e
  208. })(egret || (egret = {}));
  209. __extends = this.__extends ||
  210. function(c, e) {
  211. function d() {
  212. this.constructor = c
  213. }
  214. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  215. d.prototype = e.prototype;
  216. c.prototype = new d
  217. }; (function(c) {
  218. var e = function(d) {
  219. function a(b, a, c) {
  220. "undefined" === typeof a && (a = !1);
  221. "undefined" === typeof c && (c = !1);
  222. d.call(this, b, a, c)
  223. }
  224. __extends(a, d);
  225. a.dispatchIOErrorEvent = function(b) {
  226. c.Event._dispatchByTarget(a, b, a.IO_ERROR)
  227. };
  228. a.IO_ERROR = "ioError";
  229. return a
  230. } (c.Event);
  231. c.IOErrorEvent = e
  232. })(egret || (egret = {}));
  233. __extends = this.__extends ||
  234. function(c, e) {
  235. function d() {
  236. this.constructor = c
  237. }
  238. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  239. d.prototype = e.prototype;
  240. c.prototype = new d
  241. }; (function(c) {
  242. var e = function(d) {
  243. function a(b, a, c, e, f, g, l, n, p, q) {
  244. "undefined" === typeof a && (a = !0);
  245. "undefined" === typeof c && (c = !0);
  246. "undefined" === typeof e && (e = 0);
  247. "undefined" === typeof f && (f = 0);
  248. "undefined" === typeof g && (g = 0);
  249. "undefined" === typeof l && (l = !1);
  250. "undefined" === typeof n && (n = !1);
  251. "undefined" === typeof q && (q = !1);
  252. d.call(this, b, a, c);
  253. this._localY = this._localX = this._stageY = this._stageX = 0;
  254. this.touchPointID = e;
  255. this._stageX = f;
  256. this._stageY = g;
  257. this.ctrlKey = l;
  258. this.altKey = n;
  259. this.touchDown = q
  260. }
  261. __extends(a, d);
  262. Object.defineProperty(a.prototype, "stageX", {
  263. get: function() {
  264. return this._stageX
  265. },
  266. enumerable: !0,
  267. configurable: !0
  268. });
  269. Object.defineProperty(a.prototype, "stageY", {
  270. get: function() {
  271. return this._stageY
  272. },
  273. enumerable: !0,
  274. configurable: !0
  275. });
  276. Object.defineProperty(a.prototype, "localX", {
  277. get: function() {
  278. return this._localX
  279. },
  280. enumerable: !0,
  281. configurable: !0
  282. });
  283. Object.defineProperty(a.prototype, "localY", {
  284. get: function() {
  285. return this._localY
  286. },
  287. enumerable: !0,
  288. configurable: !0
  289. });
  290. a.prototype._setCurrentTarget = function(b) {
  291. d.prototype._setCurrentTarget.call(this, b);
  292. b instanceof c.DisplayObject && (b = b.globalToLocal(this._stageX, this._stageY, c.Point.identity), this._localX = b.x, this._localY = b.y)
  293. };
  294. a.dispatchTouchEvent = function(b, h, m, d, e, g, l, n, p) {
  295. "undefined" === typeof m && (m = 0);
  296. "undefined" === typeof d && (d = 0);
  297. "undefined" === typeof e && (e = 0);
  298. "undefined" === typeof g && (g = !1);
  299. "undefined" === typeof l && (l = !1);
  300. "undefined" === typeof n && (n = !1);
  301. "undefined" === typeof p && (p = !1);
  302. var q = c.Event._getPropertyData(a);
  303. q.touchPointID = m;
  304. q._stageX = d;
  305. q._stageY = e;
  306. q.ctrlKey = g;
  307. q.altKey = l;
  308. q.shiftKey = n;
  309. q.touchDown = p;
  310. c.Event._dispatchByTarget(a, b, h, q, !0, !0)
  311. };
  312. a.TOUCH_TAP = "touchTap";
  313. a.TOUCH_MOVE = "touchMove";
  314. a.TOUCH_BEGIN = "touchBegin";
  315. a.TOUCH_END = "touchEnd";
  316. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  317. a.TOUCH_ROLL_OUT = "touchRollOut";
  318. a.TOUCH_ROLL_OVER = "touchRollOver";
  319. a.TOUCH_OUT = "touchOut";
  320. a.TOUCH_OVER = "touchOver";
  321. return a
  322. } (c.Event);
  323. c.TouchEvent = e
  324. })(egret || (egret = {}));
  325. __extends = this.__extends ||
  326. function(c, e) {
  327. function d() {
  328. this.constructor = c
  329. }
  330. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  331. d.prototype = e.prototype;
  332. c.prototype = new d
  333. }; (function(c) {
  334. var e = function(d) {
  335. function a(b, a, c) {
  336. "undefined" === typeof a && (a = !1);
  337. "undefined" === typeof c && (c = !1);
  338. d.call(this, b, a, c)
  339. }
  340. __extends(a, d);
  341. a.dispatchTimerEvent = function(b, h) {
  342. c.Event._dispatchByTarget(a, b, h)
  343. };
  344. a.TIMER = "timer";
  345. a.TIMER_COMPLETE = "timerComplete";
  346. return a
  347. } (c.Event);
  348. c.TimerEvent = e
  349. })(egret || (egret = {})); (function(c) {
  350. var e = function() {
  351. function c() {}
  352. c.CAPTURING_PHASE = 1;
  353. c.AT_TARGET = 2;
  354. c.BUBBLING_PHASE = 3;
  355. return c
  356. } ();
  357. c.EventPhase = e
  358. })(egret || (egret = {}));
  359. __extends = this.__extends ||
  360. function(c, e) {
  361. function d() {
  362. this.constructor = c
  363. }
  364. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  365. d.prototype = e.prototype;
  366. c.prototype = new d
  367. }; (function(c) {
  368. var e = function(d) {
  369. function a(b) {
  370. "undefined" === typeof b && (b = null);
  371. d.call(this);
  372. this._eventTarget = b ? b: this
  373. }
  374. __extends(a, d);
  375. a.prototype.addEventListener = function(b, a, m, d, e) {
  376. "undefined" === typeof d && (d = !1);
  377. "undefined" === typeof e && (e = 0);
  378. "undefined" === typeof d && (d = !1);
  379. "undefined" === typeof e && (e = 0);
  380. a || c.Logger.fatal("addEventListener侦听函数不能为空");
  381. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  382. var g = d[b];
  383. g || (g = d[b] = []);
  384. this._insertEventBin(g, a, m, e)
  385. };
  386. a.prototype._insertEventBin = function(b, a, c, d) {
  387. for (var e = -1,
  388. g = b.length,
  389. l = 0; l < g; l++) {
  390. var n = b[l];
  391. if (n.listener === a && n.thisObject === c) return ! 1; - 1 == e && n.priority < d && (e = l)
  392. }
  393. a = {
  394. listener: a,
  395. thisObject: c,
  396. priority: d
  397. }; - 1 != e ? b.splice(e, 0, a) : b.push(a);
  398. return ! 0
  399. };
  400. a.prototype.removeEventListener = function(b, a, c, d) {
  401. "undefined" === typeof d && (d = !1);
  402. if (d = d ? this._captureEventsMap: this._eventsMap) {
  403. var e = d[b];
  404. e && (this._removeEventBin(e, a, c), 0 == e.length && delete d[b])
  405. }
  406. };
  407. a.prototype._removeEventBin = function(b, a, c) {
  408. for (var d = b.length,
  409. e = 0; e < d; e++) {
  410. var g = b[e];
  411. if (g.listener === a && g.thisObject === c) return b.splice(e, 1),
  412. !0
  413. }
  414. return ! 1
  415. };
  416. a.prototype.hasEventListener = function(b) {
  417. return this._eventsMap && this._eventsMap[b] || this._captureEventsMap && this._captureEventsMap[b]
  418. };
  419. a.prototype.willTrigger = function(b) {
  420. return this.hasEventListener(b)
  421. };
  422. a.prototype.dispatchEvent = function(b) {
  423. b._reset();
  424. b._target = this._eventTarget;
  425. b._setCurrentTarget(this._eventTarget);
  426. return this._notifyListener(b)
  427. };
  428. a.prototype._notifyListener = function(b) {
  429. var a = 1 == b._eventPhase ? this._captureEventsMap: this._eventsMap;
  430. if (!a) return ! 0;
  431. a = a[b.type];
  432. if (!a) return ! 0;
  433. for (var a = a.concat(), c = a.length, d = 0; d < c; d++) {
  434. var e = a[d];
  435. e.listener.call(e.thisObject, b);
  436. if (b._isPropagationImmediateStopped) break
  437. }
  438. return ! b.isDefaultPrevented()
  439. };
  440. a.prototype.dispatchEventWith = function(b, a, m) {
  441. "undefined" === typeof a && (a = !1);
  442. c.Event.dispatchEvent(this, b, a, m)
  443. };
  444. return a
  445. } (c.HashObject);
  446. c.EventDispatcher = e
  447. })(egret || (egret = {}));
  448. __extends = this.__extends ||
  449. function(c, e) {
  450. function d() {
  451. this.constructor = c
  452. }
  453. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  454. d.prototype = e.prototype;
  455. c.prototype = new d
  456. }; (function(c) {
  457. var e = function(d) {
  458. function a() {
  459. d.call(this);
  460. this.reuseEvent = new c.Event("")
  461. }
  462. __extends(a, d);
  463. a.prototype.run = function() {
  464. c.Ticker.getInstance().run();
  465. c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  466. c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  467. this.touchContext.run();
  468. c.__invalidateModuleFlag = !0
  469. };
  470. a.prototype.renderLoop = function(b) {
  471. b = this.rendererContext;
  472. b.clearScreen();
  473. if (0 < c.__callLaterFunctionList.length) {
  474. var a = c.__callLaterFunctionList;
  475. c.__callLaterFunctionList = [];
  476. var m = c.__callLaterThisList;
  477. c.__callLaterThisList = [];
  478. var d = c.__callLaterArgsList;
  479. c.__callLaterArgsList = []
  480. }
  481. this.dispatchEventWith(c.Event.RENDER);
  482. c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
  483. a && this.doCallLaterList(a, m, d);
  484. this.stage._updateTransform();
  485. this.dispatchEventWith(c.Event.FINISH_UPDATE_TRANSFORM);
  486. this.stage._draw(b);
  487. this.dispatchEventWith(c.Event.FINISH_RENDER)
  488. };
  489. a.prototype.broadcastEnterFrame = function(b) {
  490. b = this.reuseEvent;
  491. b._type = c.Event.ENTER_FRAME;
  492. this.dispatchEvent(b);
  493. for (var a = c.DisplayObject._enterFrameCallBackList.concat(), m = a.length, d = 0; d < m; d++) {
  494. var e = a[d];
  495. b._target = e.display;
  496. b._setCurrentTarget(e.display);
  497. e.listener.call(e.thisObject, b)
  498. }
  499. a = c.Recycler._callBackList;
  500. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  501. };
  502. a.prototype.broadcastRender = function() {
  503. var b = this.reuseEvent;
  504. b._type = c.Event.RENDER;
  505. for (var a = c.DisplayObject._renderCallBackList.concat(), m = a.length, d = 0; d < m; d++) {
  506. var e = a[d];
  507. b._target = e.display;
  508. b._setCurrentTarget(e.display);
  509. e.listener.call(e.thisObject, b)
  510. }
  511. };
  512. a.prototype.doCallLaterList = function(b, a, c) {
  513. for (var d = b.length,
  514. e = 0; e < d; e++) {
  515. var g = b[e];
  516. null != g && g.apply(a[e], c[e])
  517. }
  518. };
  519. return a
  520. } (c.EventDispatcher);
  521. c.MainContext = e
  522. })(egret || (egret = {}));
  523. egret.MainContext.instance = new egret.MainContext; (function(c) {
  524. var e = function() {
  525. function d() {
  526. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  527. this._maxDeltaTime = 500;
  528. this._totalDeltaTime = 0
  529. }
  530. d.getInstance = function() {
  531. null == d.instance && (d.instance = new d);
  532. return d.instance
  533. };
  534. d.prototype.run = function() {
  535. c.Ticker.getInstance().register(this.update, this);
  536. null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, c.MainContext.instance.stage.addChild(this._txt));
  537. var a = c.MainContext.instance;
  538. a.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  539. a.addEventListener(c.Event.RENDER, this.onStartRender, this);
  540. a.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
  541. a.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  542. };
  543. d.prototype.onEnterFrame = function(a) {
  544. this._lastTime = c.getTimer()
  545. };
  546. d.prototype.onStartRender = function(a) {
  547. a = c.getTimer();
  548. this._logicPerformanceCost = a - this._lastTime;
  549. this._lastTime = a
  550. };
  551. d.prototype.onFinishUpdateTransform = function(a) {
  552. a = c.getTimer();
  553. this._updateTransformPerformanceCost = a - this._lastTime;
  554. this._lastTime = a
  555. };
  556. d.prototype.onFinishRender = function(a) {
  557. a = c.getTimer();
  558. this._renderPerformanceCost = a - this._lastTime;
  559. this._lastTime = a
  560. };
  561. d.prototype.update = function(a) {
  562. this._tick++;
  563. this._totalDeltaTime += a;
  564. if (this._totalDeltaTime >= this._maxDeltaTime) {
  565. a = (this._preDrawCount - 1).toString();
  566. var b = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() + "," + Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();
  567. this._txt.text = "draw:" + a + "\ncost:" + b + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  568. this._tick = this._totalDeltaTime = 0
  569. }
  570. this._preDrawCount = 0
  571. };
  572. d.prototype.onDrawImage = function() {
  573. this._preDrawCount++
  574. };
  575. return d
  576. } ();
  577. c.Profiler = e
  578. })(egret || (egret = {}));
  579. __extends = this.__extends ||
  580. function(c, e) {
  581. function d() {
  582. this.constructor = c
  583. }
  584. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  585. d.prototype = e.prototype;
  586. c.prototype = new d
  587. }; (function(c) {
  588. var e = function(d) {
  589. function a() {
  590. d.apply(this, arguments);
  591. this._timeScale = 1;
  592. this._paused = !1;
  593. this.callBackList = []
  594. }
  595. __extends(a, d);
  596. a.prototype.run = function() {
  597. c.__START_TIME = (new Date).getTime();
  598. c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  599. };
  600. a.prototype.update = function(b) {
  601. var a = this.callBackList.concat(),
  602. c = a.length;
  603. b *= this._timeScale;
  604. b *= this._timeScale;
  605. for (var d = 0; d < c; d++) {
  606. var e = a[d];
  607. e.listener.call(e.thisObject, b)
  608. }
  609. };
  610. a.prototype.register = function(b, a, c) {
  611. "undefined" === typeof c && (c = 0);
  612. this._insertEventBin(this.callBackList, b, a, c)
  613. };
  614. a.prototype.unregister = function(b, a) {
  615. this._removeEventBin(this.callBackList, b, a)
  616. };
  617. a.prototype.setTimeout = function(b, a, c) {
  618. for (var d = [], e = 0; e < arguments.length - 3; e++) d[e] = arguments[e + 3];
  619. var g = this,
  620. l = 0;
  621. this.register(function(e) {
  622. 0 == c ? (g.unregister(arguments.callee, a), b.apply(a, d)) : (l += e, l >= c && (g.unregister(arguments.callee, a), b.apply(a, d)))
  623. },
  624. a)
  625. };
  626. a.prototype.setTimeScale = function(b) {
  627. this._timeScale = b
  628. };
  629. a.prototype.getTimeScale = function() {
  630. return this._timeScale
  631. };
  632. a.prototype.pause = function() {
  633. this._paused = !0
  634. };
  635. a.prototype.resume = function() {
  636. this._paused = !1
  637. };
  638. a.getInstance = function() {
  639. null == a.instance && (a.instance = new a);
  640. return a.instance
  641. };
  642. return a
  643. } (c.EventDispatcher);
  644. c.Ticker = e
  645. })(egret || (egret = {})); (function(c) {
  646. var e = function() {
  647. function c() {}
  648. c.LEFT = "left";
  649. c.RIGHT = "right";
  650. c.CENTER = "center";
  651. c.JUSTIFY = "justify";
  652. c.CONTENT_JUSTIFY = "contentJustify";
  653. return c
  654. } ();
  655. c.HorizontalAlign = e
  656. })(egret || (egret = {})); (function(c) {
  657. var e = function() {
  658. function c() {}
  659. c.TOP = "top";
  660. c.BOTTOM = "bottom";
  661. c.MIDDLE = "middle";
  662. c.JUSTIFY = "justify";
  663. c.CONTENT_JUSTIFY = "contentJustify";
  664. return c
  665. } ();
  666. c.VerticalAlign = e
  667. })(egret || (egret = {}));
  668. __extends = this.__extends ||
  669. function(c, e) {
  670. function d() {
  671. this.constructor = c
  672. }
  673. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  674. d.prototype = e.prototype;
  675. c.prototype = new d
  676. }; (function(c) {
  677. var e = function(d) {
  678. function a(b, a) {
  679. "undefined" === typeof a && (a = 0);
  680. d.call(this);
  681. this._currentCount = 0;
  682. this.delay = b;
  683. this.repeatCount = a
  684. }
  685. __extends(a, d);
  686. a.prototype.currentCount = function() {
  687. return this._currentCount
  688. };
  689. Object.defineProperty(a.prototype, "running", {
  690. get: function() {
  691. return this._running
  692. },
  693. enumerable: !0,
  694. configurable: !0
  695. });
  696. a.prototype.reset = function() {
  697. this.stop();
  698. this._currentCount = 0
  699. };
  700. a.prototype.start = function() {
  701. this._running || (this.lastTime = c.getTimer(), 0 != this._currentCount && (this._currentCount = 0), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  702. };
  703. a.prototype.stop = function() {
  704. this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  705. };
  706. a.prototype.onEnterFrame = function(b) {
  707. b = c.getTimer();
  708. b - this.lastTime > this.delay && (this.lastTime = b, this._currentCount++, c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER_COMPLETE)))
  709. };
  710. return a
  711. } (c.EventDispatcher);
  712. c.Timer = e
  713. })(egret || (egret = {})); (function(c) {
  714. function e(b) {
  715. b = b.toString();
  716. var a = b.indexOf("(");
  717. return b.substring(9, a)
  718. }
  719. function d(b, h) {
  720. for (var c in b) {
  721. var k = b[c],
  722. f = typeof k;
  723. "function" == f ? k.prototype && (f = k.toString(), a[f] || (a[f] = h + "." + e(k))) : "object" != f || k instanceof Array || d(k, h + "." + c)
  724. }
  725. }
  726. c.__moduleNameList = ["egret", "RES", "dragonBones"];
  727. c.__invalidateModuleFlag = !0;
  728. var a = {};
  729. c.getQualifiedClassName = function(b) {
  730. b = b.prototype ? b.prototype.constructor: b.__proto__.constructor;
  731. var h = b.toString(),
  732. m = a[h];
  733. if (m) return m;
  734. if (c.__invalidateModuleFlag) {
  735. for (var m = c.__moduleNameList,
  736. k = m.length,
  737. f = 0; f < k; f++) {
  738. var g = m[f],
  739. l = __global[g];
  740. l && "object" == typeof l && l.__proto__ && "Object" == e(l.__proto__.constructor) && d(l, g)
  741. }
  742. c.__invalidateModuleFlag = !1;
  743. if (m = a[h]) return m
  744. }
  745. return a[h] = m = e(b)
  746. }
  747. })(egret || (egret = {}));
  748. var __global = __global || this; (function(c) {
  749. var e = {};
  750. c.getDefinitionByName = function(c) {
  751. if (!c) return null;
  752. var a = e[c];
  753. if (a) return a;
  754. for (var b = c.split("."), h = b.length, a = __global, m = 0; m < h; m++) if (a = a[b[m]], !a) return null;
  755. return e[c] = a
  756. }
  757. })(egret || (egret = {}));
  758. __global = __global || this; (function(c) {
  759. c.hasDefinition = function(e) {
  760. return c.getDefinitionByName(e) ? !0 : !1
  761. }
  762. })(egret || (egret = {})); (function(c) {
  763. c.toColorString = function(c) {
  764. if (isNaN(c) || 0 > c) c = 0;
  765. 16777215 < c && (c = 16777215);
  766. for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
  767. return "#" + c
  768. }
  769. })(egret || (egret = {}));
  770. __extends = this.__extends ||
  771. function(c, e) {
  772. function d() {
  773. this.constructor = c
  774. }
  775. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  776. d.prototype = e.prototype;
  777. c.prototype = new d
  778. }; (function(c) {
  779. var e = function(d) {
  780. function a(b, a, c, e, f, g) {
  781. "undefined" === typeof b && (b = 1);
  782. "undefined" === typeof a && (a = 0);
  783. "undefined" === typeof c && (c = 0);
  784. "undefined" === typeof e && (e = 1);
  785. "undefined" === typeof f && (f = 0);
  786. "undefined" === typeof g && (g = 0);
  787. d.call(this);
  788. this.a = b;
  789. this.b = a;
  790. this.c = c;
  791. this.d = e;
  792. this.tx = f;
  793. this.ty = g
  794. }
  795. __extends(a, d);
  796. a.prototype.prepend = function(b, a, c, d, e, g) {
  797. var l = this.tx;
  798. if (1 != b || 0 != a || 0 != c || 1 != d) {
  799. var n = this.a,
  800. p = this.c;
  801. this.a = n * b + this.b * c;
  802. this.b = n * a + this.b * d;
  803. this.c = p * b + this.d * c;
  804. this.d = p * a + this.d * d
  805. }
  806. this.tx = l * b + this.ty * c + e;
  807. this.ty = l * a + this.ty * d + g;
  808. return this
  809. };
  810. a.prototype.append = function(b, a, c, d, e, g) {
  811. var l = this.a,
  812. n = this.b,
  813. p = this.c,
  814. q = this.d;
  815. this.a = b * l + a * p;
  816. this.b = b * n + a * q;
  817. this.c = c * l + d * p;
  818. this.d = c * n + d * q;
  819. this.tx = e * l + g * p + this.tx;
  820. this.ty = e * n + g * q + this.ty;
  821. return this
  822. };
  823. a.prototype.prependMatrix = function(b) {
  824. this.prepend(b.a, b.b, b.c, b.d, b.tx, b.ty);
  825. return this
  826. };
  827. a.prototype.appendMatrix = function(b) {
  828. this.append(b.a, b.b, b.c, b.d, b.tx, b.ty);
  829. return this
  830. };
  831. a.prototype.prependTransform = function(b, h, c, d, e, g, l, n, p) {
  832. if (e % 360) {
  833. var q = e * a.DEG_TO_RAD;
  834. e = Math.cos(q);
  835. q = Math.sin(q)
  836. } else e = 1,
  837. q = 0;
  838. if (n || p) this.tx -= n,
  839. this.ty -= p;
  840. g || l ? (g *= a.DEG_TO_RAD, l *= a.DEG_TO_RAD, this.prepend(e * c, q * c, -q * d, e * d, 0, 0), this.prepend(Math.cos(l), Math.sin(l), -Math.sin(g), Math.cos(g), b, h)) : this.prepend(e * c, q * c, -q * d, e * d, b, h);
  841. return this
  842. };
  843. a.prototype.appendTransform = function(b, h, c, d, e, g, l, n, p) {
  844. if (e % 360) {
  845. var q = e * a.DEG_TO_RAD;
  846. e = Math.cos(q);
  847. q = Math.sin(q)
  848. } else e = 1,
  849. q = 0;
  850. g || l ? (g *= a.DEG_TO_RAD, l *= a.DEG_TO_RAD, this.append(Math.cos(l), Math.sin(l), -Math.sin(g), Math.cos(g), b, h), this.append(e * c, q * c, -q * d, e * d, 0, 0)) : this.append(e * c, q * c, -q * d, e * d, b, h);
  851. if (n || p) this.tx -= n * this.a + p * this.c,
  852. this.ty -= n * this.b + p * this.d;
  853. return this
  854. };
  855. a.prototype.rotate = function(b) {
  856. var a = Math.cos(b);
  857. b = Math.sin(b);
  858. var c = this.a,
  859. d = this.c,
  860. e = this.tx;
  861. this.a = c * a - this.b * b;
  862. this.b = c * b + this.b * a;
  863. this.c = d * a - this.d * b;
  864. this.d = d * b + this.d * a;
  865. this.tx = e * a - this.ty * b;
  866. this.ty = e * b + this.ty * a;
  867. return this
  868. };
  869. a.prototype.skew = function(b, h) {
  870. b *= a.DEG_TO_RAD;
  871. h *= a.DEG_TO_RAD;
  872. this.append(Math.cos(h), Math.sin(h), -Math.sin(b), Math.cos(b), 0, 0);
  873. return this
  874. };
  875. a.prototype.scale = function(b, a) {
  876. this.a *= b;
  877. this.d *= a;
  878. this.c *= b;
  879. this.b *= a;
  880. this.tx *= b;
  881. this.ty *= a;
  882. return this
  883. };
  884. a.prototype.translate = function(b, a) {
  885. this.tx += b;
  886. this.ty += a;
  887. return this
  888. };
  889. a.prototype.identity = function() {
  890. this.a = this.d = 1;
  891. this.b = this.c = this.tx = this.ty = 0;
  892. return this
  893. };
  894. a.prototype.invert = function() {
  895. var b = this.a,
  896. a = this.b,
  897. c = this.c,
  898. d = this.d,
  899. e = this.tx,
  900. g = b * d - a * c;
  901. this.a = d / g;
  902. this.b = -a / g;
  903. this.c = -c / g;
  904. this.d = b / g;
  905. this.tx = (c * this.ty - d * e) / g;
  906. this.ty = -(b * this.ty - a * e) / g;
  907. return this
  908. };
  909. a.transformCoords = function(b, a, m) {
  910. var d = c.Point.identity;
  911. d.x = b.a * a + b.c * m + b.tx;
  912. d.y = b.d * m + b.b * a + b.ty;
  913. return d
  914. };
  915. a.identity = new a;
  916. a.DEG_TO_RAD = Math.PI / 180;
  917. return a
  918. } (c.HashObject);
  919. c.Matrix = e
  920. })(egret || (egret = {}));
  921. __extends = this.__extends ||
  922. function(c, e) {
  923. function d() {
  924. this.constructor = c
  925. }
  926. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  927. d.prototype = e.prototype;
  928. c.prototype = new d
  929. }; (function(c) {
  930. var e = function(c) {
  931. function a(b, a) {
  932. "undefined" === typeof b && (b = 0);
  933. "undefined" === typeof a && (a = 0);
  934. c.call(this);
  935. this.x = b;
  936. this.y = a
  937. }
  938. __extends(a, c);
  939. a.prototype.clone = function() {
  940. return new a(this.x, this.y)
  941. };
  942. a.prototype.equals = function(b) {
  943. return this.x == b.x && this.y == b.y
  944. };
  945. a.distance = function(b, a) {
  946. return Math.sqrt((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y))
  947. };
  948. a.identity = new a(0, 0);
  949. return a
  950. } (c.HashObject);
  951. c.Point = e
  952. })(egret || (egret = {}));
  953. __extends = this.__extends ||
  954. function(c, e) {
  955. function d() {
  956. this.constructor = c
  957. }
  958. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  959. d.prototype = e.prototype;
  960. c.prototype = new d
  961. }; (function(c) {
  962. var e = function(c) {
  963. function a(b, a, m, e) {
  964. "undefined" === typeof b && (b = 0);
  965. "undefined" === typeof a && (a = 0);
  966. "undefined" === typeof m && (m = 0);
  967. "undefined" === typeof e && (e = 0);
  968. c.call(this);
  969. this.x = b;
  970. this.y = a;
  971. this.width = m;
  972. this.height = e
  973. }
  974. __extends(a, c);
  975. Object.defineProperty(a.prototype, "right", {
  976. get: function() {
  977. return this.x + this.width
  978. },
  979. set: function(b) {
  980. this.width = b - this.x
  981. },
  982. enumerable: !0,
  983. configurable: !0
  984. });
  985. Object.defineProperty(a.prototype, "bottom", {
  986. get: function() {
  987. return this.y + this.height
  988. },
  989. set: function(b) {
  990. this.height = b - this.y
  991. },
  992. enumerable: !0,
  993. configurable: !0
  994. });
  995. a.prototype.initialize = function(b, a, c, d) {
  996. this.x = b;
  997. this.y = a;
  998. this.width = c;
  999. this.height = d;
  1000. return this
  1001. };
  1002. a.prototype.contains = function(b, a) {
  1003. return this.x <= b && this.x + this.width >= b && this.y <= a && this.y + this.height >= a
  1004. };
  1005. a.prototype.intersects = function(b) {
  1006. return this.contains(b.x, b.y) || this.contains(b.x, b.bottom) || this.contains(b.right, b.y) || this.contains(b.right, b.bottom) ? !0 : !1
  1007. };
  1008. a.prototype.clone = function() {
  1009. return new a(this.x, this.y, this.width, this.height)
  1010. };
  1011. a.prototype.containsPoint = function(b) {
  1012. return this.x < b.x && this.x + this.width > b.x && this.y < b.y && this.y + this.height > b.y ? !0 : !1
  1013. };
  1014. a.identity = new a(0, 0, 0, 0);
  1015. return a
  1016. } (c.HashObject);
  1017. c.Rectangle = e
  1018. })(egret || (egret = {})); (function(c) {
  1019. var e = function() {
  1020. function d() {}
  1021. d.fatal = function(a, b) {
  1022. "undefined" === typeof b && (b = null);
  1023. c.Logger.traceToConsole("Fatal", a, b);
  1024. throw Error(c.Logger.getTraceCode("Fatal", a, b));
  1025. };
  1026. d.info = function(a, b) {
  1027. "undefined" === typeof b && (b = null);
  1028. c.Logger.traceToConsole("Info", a, b)
  1029. };
  1030. d.warning = function(a, b) {
  1031. "undefined" === typeof b && (b = null);
  1032. c.Logger.traceToConsole("Warning", a, b)
  1033. };
  1034. d.traceToConsole = function(a, b, h) {
  1035. console.log(c.Logger.getTraceCode(a, b, h))
  1036. };
  1037. d.getTraceCode = function(a, b, h) {
  1038. return "[" + a + "]" + b + ":" + (null == h ? "": h)
  1039. };
  1040. return d
  1041. } ();
  1042. c.Logger = e
  1043. })(egret || (egret = {}));
  1044. __extends = this.__extends ||
  1045. function(c, e) {
  1046. function d() {
  1047. this.constructor = c
  1048. }
  1049. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1050. d.prototype = e.prototype;
  1051. c.prototype = new d
  1052. }; (function(c) {
  1053. var e = function(b) {
  1054. function h() {
  1055. b.call(this);
  1056. this._designHeight = this._designWidth = 0;
  1057. this._scaleY = this._scaleX = 1;
  1058. var a = document.getElementById(h.canvas_name),
  1059. c = a.height;
  1060. this._designWidth = a.width;
  1061. this._designHeight = c
  1062. }
  1063. __extends(h, b);
  1064. h.getInstance = function() {
  1065. null == h.instance && (a.initialize(), h.instance = new h);
  1066. return h.instance
  1067. };
  1068. h.prototype.setDesignSize = function(b, a, h) {
  1069. this.setResolutionPolicy(h);
  1070. this._designWidth = b;
  1071. this._designHeight = a;
  1072. this._resolutionPolicy._apply(this, this._designWidth, this._designHeight)
  1073. };
  1074. h.prototype.setResolutionPolicy = function(b) {
  1075. this._resolutionPolicy = b;
  1076. b.init(this)
  1077. };
  1078. h.prototype.getScaleX = function() {
  1079. return this._scaleX
  1080. };
  1081. h.prototype.getScaleY = function() {
  1082. return this._scaleY
  1083. };
  1084. h.canvas_name = "gameCanvas";
  1085. h.canvas_div_name = "gameDiv";
  1086. return h
  1087. } (c.HashObject);
  1088. c.StageDelegate = e;
  1089. var d = function() {
  1090. function b(a, h) {
  1091. this.setContainerStrategy(a);
  1092. this.setContentStrategy(h)
  1093. }
  1094. b.prototype.init = function(b) {
  1095. this._containerStrategy.init(b);
  1096. this._contentStrategy.init(b)
  1097. };
  1098. b.prototype._apply = function(b, a, h) {
  1099. this._containerStrategy._apply(b, a, h);
  1100. this._contentStrategy._apply(b, a, h)
  1101. };
  1102. b.prototype.setContainerStrategy = function(b) {
  1103. b instanceof a && (this._containerStrategy = b)
  1104. };
  1105. b.prototype.setContentStrategy = function(b) {
  1106. b instanceof h && (this._contentStrategy = b)
  1107. };
  1108. return b
  1109. } ();
  1110. c.ResolutionPolicy = d;
  1111. var a = function() {
  1112. function a() {}
  1113. a.initialize = function() {
  1114. a.EQUAL_TO_FRAME = new b
  1115. };
  1116. a.prototype.init = function(b) {};
  1117. a.prototype._apply = function(b, a, h) {};
  1118. a.prototype._setupContainer = function() {
  1119. var b = document.body,
  1120. a;
  1121. b && (a = b.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1122. };
  1123. return a
  1124. } ();
  1125. c.ContainerStrategy = a;
  1126. var b = function(b) {
  1127. function a() {
  1128. b.apply(this, arguments)
  1129. }
  1130. __extends(a, b);
  1131. a.prototype._apply = function(b) {
  1132. this._setupContainer()
  1133. };
  1134. return a
  1135. } (a);
  1136. c.EqualToFrame = b;
  1137. var h = function() {
  1138. function b() {}
  1139. b.prototype.init = function(b) {};
  1140. b.prototype._apply = function(b, a, h) {};
  1141. return b
  1142. } ();
  1143. c.ContentStrategy = h;
  1144. d = function(b) {
  1145. function a() {
  1146. b.apply(this, arguments)
  1147. }
  1148. __extends(a, b);
  1149. a.prototype._apply = function(b, a, h) {
  1150. var c = document.getElementById(e.canvas_name),
  1151. m = document.getElementById(e.canvas_div_name),
  1152. d = c.height / h,
  1153. k = window.innerHeight,
  1154. d = k / h,
  1155. s = a * d;
  1156. c.width = a;
  1157. c.height = h;
  1158. c.style.width = s + "px";
  1159. c.style.height = k + "px";
  1160. m.style.width = s + "px";
  1161. m.style.height = k + "px";
  1162. b._scaleX = d;
  1163. b._scaleY = d
  1164. };
  1165. return a
  1166. } (h);
  1167. c.FixedHeight = d;
  1168. d = function(b) {
  1169. function a() {
  1170. b.apply(this, arguments)
  1171. }
  1172. __extends(a, b);
  1173. a.prototype._apply = function(b, a, h) {
  1174. h = document.getElementById(e.canvas_name);
  1175. var c = document.getElementById(e.canvas_div_name),
  1176. m = document.documentElement.clientWidth,
  1177. d = document.documentElement.clientHeight,
  1178. k = m / a;
  1179. h.width = a;
  1180. h.height = d / k;
  1181. h.style.width = m + "px";
  1182. h.style.height = d + "px";
  1183. c.style.width = m + "px";
  1184. c.style.height = d + "px";
  1185. b._scaleX = k;
  1186. b._scaleY = k
  1187. };
  1188. return a
  1189. } (h);
  1190. c.FixedWidth = d;
  1191. d = function(b) {
  1192. function a(h, c) {
  1193. b.call(this);
  1194. this.width = h;
  1195. this.height = c
  1196. }
  1197. __extends(a, b);
  1198. a.prototype._apply = function(b, a, h) {
  1199. h = document.getElementById(e.canvas_name);
  1200. var c = document.getElementById(e.canvas_div_name),
  1201. m = this.width,
  1202. d = this.height,
  1203. k = m / a;
  1204. h.width = a;
  1205. h.height = d / k;
  1206. h.style.width = m + "px";
  1207. h.style.height = d + "px";
  1208. c.style.width = m + "px";
  1209. c.style.height = d + "px";
  1210. b._scaleX = k;
  1211. b._scaleY = k
  1212. };
  1213. return a
  1214. } (h);
  1215. c.FixedSize = d;
  1216. d = function(b) {
  1217. function a(h, c) {
  1218. b.call(this);
  1219. this.width = h;
  1220. this.height = c
  1221. }
  1222. __extends(a, b);
  1223. a.prototype._apply = function(b, a, h) {
  1224. a = document.getElementById(e.canvas_name);
  1225. a.style.width = a.width + "px";
  1226. a.style.height = a.height + "px";
  1227. b._scaleX = 1;
  1228. b._scaleY = 1
  1229. };
  1230. return a
  1231. } (h);
  1232. c.NoScale = d
  1233. })(egret || (egret = {}));
  1234. __extends = this.__extends ||
  1235. function(c, e) {
  1236. function d() {
  1237. this.constructor = c
  1238. }
  1239. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1240. d.prototype = e.prototype;
  1241. c.prototype = new d
  1242. }; (function(c) {
  1243. var e = function(d) {
  1244. function a() {
  1245. d.call(this);
  1246. this._originalData = {};
  1247. this._drawAreaList = []
  1248. }
  1249. __extends(a, d);
  1250. a.getInstance = function() {
  1251. null == a.instance && (a.instance = new a);
  1252. return a.instance
  1253. };
  1254. a.prototype.addDrawArea = function(b) {
  1255. this._drawAreaList.push(b)
  1256. };
  1257. a.prototype.clearDrawArea = function() {
  1258. this._drawAreaList = []
  1259. };
  1260. a.prototype.drawImage = function(b, a, m, d, e, g, l, n, p, q) {
  1261. l = l || 0;
  1262. n = n || 0;
  1263. var r = a._texture_to_render;
  1264. if (null != r && 0 != g && 0 != e && 0 != p && 0 != q) if (a._worldBounds) {
  1265. var s = this._originalData;
  1266. s.sourceX = m;
  1267. s.sourceY = d;
  1268. s.sourceWidth = e;
  1269. s.sourceHeight = g;
  1270. s.destX = l;
  1271. s.destY = n;
  1272. s.destWidth = p;
  1273. s.destHeight = q;
  1274. for (var z = this.getDrawAreaList(), A = 0; A < z.length; A++) {
  1275. var v = z[A];
  1276. if (!this.ignoreRender(a, v, s.destX, s.destY)) {
  1277. if (0 != this._drawAreaList.length) if (0 != a._worldTransform.b || 0 != a._worldTransform.c) {
  1278. if (a._worldBounds.x + s.destX < v.x || a._worldBounds.y + s.destY < v.y || a._worldBounds.x + a._worldBounds.width + s.destX > v.x + v.width || a._worldBounds.y + a._worldBounds.height + s.destY > v.y + v.height) {
  1279. c.Logger.fatal("请不要让带有旋转和斜切的显示对象跨过重绘区域");
  1280. break
  1281. }
  1282. } else {
  1283. var B = a._worldTransform.a,
  1284. C = a._worldTransform.d,
  1285. t;
  1286. a._worldBounds.x + s.destX < v.x && (t = (v.x - a._worldBounds.x) / B - s.destX, m += t / (p / e), e -= t / (p / e), p -= t, l += t);
  1287. a._worldBounds.y + s.destY < v.y && (t = (v.y - a._worldBounds.y) / C - s.destY, d += t / (q / g), g -= t / (q / g), q -= t, n += t);
  1288. a._worldBounds.x + a._worldBounds.width + s.destX > v.x + v.width && (t = (a._worldBounds.x + a._worldBounds.width - v.x - v.width) / B + s.destX, e -= t / (p / e), p -= t);
  1289. a._worldBounds.y + a._worldBounds.height + s.destY > v.y + v.height && (t = (a._worldBounds.y + a._worldBounds.height - v.y - v.height) / C + s.destY, g -= t / (q / g), q -= t)
  1290. }
  1291. b.drawImage(r, m, d, e, g, l, n, p, q)
  1292. }
  1293. }
  1294. } else b.drawImage(r, m, d, e, g, l, n, p, q)
  1295. };
  1296. a.prototype.ignoreRender = function(b, a, c, d) {
  1297. var e = b._worldBounds;
  1298. c *= b._worldTransform.a;
  1299. d *= b._worldTransform.d;
  1300. return e.x + e.width + c <= a.x || e.x + c >= a.x + a.width || e.y + e.height + d <= a.y || e.y + d >= a.y + a.height ? !0 : !1
  1301. };
  1302. a.prototype.getDrawAreaList = function() {
  1303. var b;
  1304. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new c.Rectangle(0, 0, c.MainContext.instance.stage.stageWidth, c.MainContext.instance.stage.stageHeight)]), b = this._defaultDrawAreaList) : b = this._drawAreaList;
  1305. return b
  1306. };
  1307. return a
  1308. } (c.HashObject);
  1309. c.RenderFilter = e
  1310. })(egret || (egret = {})); (function(c) {
  1311. var e = function() {
  1312. function d() {}
  1313. d.mapClass = function(a, b, h) {
  1314. "undefined" === typeof h && (h = "");
  1315. a = this.getKey(a) + "#" + h;
  1316. this.mapClassDic[a] = b
  1317. };
  1318. d.getKey = function(a) {
  1319. return "string" == typeof a ? a: c.getQualifiedClassName(a)
  1320. };
  1321. d.mapValue = function(a, b, h) {
  1322. "undefined" === typeof h && (h = "");
  1323. a = this.getKey(a) + "#" + h;
  1324. this.mapValueDic[a] = b
  1325. };
  1326. d.hasMapRule = function(a, b) {
  1327. "undefined" === typeof b && (b = "");
  1328. var h = this.getKey(a) + "#" + b;
  1329. return this.mapValueDic[h] || this.mapClassDic[h] ? !0 : !1
  1330. };
  1331. d.getInstance = function(a, b) {
  1332. "undefined" === typeof b && (b = "");
  1333. var h = this.getKey(a) + "#" + b;
  1334. if (this.mapValueDic[h]) return this.mapValueDic[h];
  1335. var c = this.mapClassDic[h];
  1336. if (c) return c = new c,
  1337. this.mapValueDic[h] = c,
  1338. delete this.mapClassDic[h],
  1339. c;
  1340. throw Error("调用了未配置的注入规则:" + h + "。 请先在项目初始化里配置指定的注入规则,再调用对应单例。");
  1341. };
  1342. d.mapClassDic = {};
  1343. d.mapValueDic = {};
  1344. return d
  1345. } ();
  1346. c.Injector = e
  1347. })(egret || (egret = {}));
  1348. __extends = this.__extends ||
  1349. function(c, e) {
  1350. function d() {
  1351. this.constructor = c
  1352. }
  1353. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1354. d.prototype = e.prototype;
  1355. c.prototype = new d
  1356. }; (function(c) {
  1357. var e = function(d) {
  1358. function a() {
  1359. d.call(this);
  1360. this._parent = null;
  1361. this._cacheAsBitmap = !1;
  1362. this._y = this._x = 0;
  1363. this._scaleY = this._scaleX = 1;
  1364. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1365. this.visible = !0;
  1366. this._rotation = 0;
  1367. this._alpha = 1;
  1368. this._skewY = this._skewX = 0;
  1369. this._hasHeightSet = this._hasWidthSet = !1;
  1370. this.worldAlpha = 1;
  1371. this._worldTransform = new c.Matrix;
  1372. this._cacheBounds = new c.Rectangle(0, 0, 0, 0)
  1373. }
  1374. __extends(a, d);
  1375. Object.defineProperty(a.prototype, "parent", {
  1376. get: function() {
  1377. return this._parent
  1378. },
  1379. enumerable: !0,
  1380. configurable: !0
  1381. });
  1382. a.prototype._parentChanged = function(b) {
  1383. this._parent = b
  1384. };
  1385. Object.defineProperty(a.prototype, "x", {
  1386. get: function() {
  1387. return this._x
  1388. },
  1389. set: function(b) {
  1390. c.NumberUtils.isNumber(b) && (this._x = b)
  1391. },
  1392. enumerable: !0,
  1393. configurable: !0
  1394. });
  1395. Object.defineProperty(a.prototype, "y", {
  1396. get: function() {
  1397. return this._y
  1398. },
  1399. set: function(b) {
  1400. c.NumberUtils.isNumber(b) && (this._y = b)
  1401. },
  1402. enumerable: !0,
  1403. configurable: !0
  1404. });
  1405. Object.defineProperty(a.prototype, "scaleX", {
  1406. get: function() {
  1407. return this._scaleX
  1408. },
  1409. set: function(b) {
  1410. c.NumberUtils.isNumber(b) && (this._scaleX = b)
  1411. },
  1412. enumerable: !0,
  1413. configurable: !0
  1414. });
  1415. Object.defineProperty(a.prototype, "scaleY", {
  1416. get: function() {
  1417. return this._scaleY
  1418. },
  1419. set: function(b) {
  1420. c.NumberUtils.isNumber(b) && (this._scaleY = b)
  1421. },
  1422. enumerable: !0,
  1423. configurable: !0
  1424. });
  1425. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1426. get: function() {
  1427. return this._anchorOffsetX
  1428. },
  1429. set: function(b) {
  1430. c.NumberUtils.isNumber(b) && (this._anchorOffsetX = b)
  1431. },
  1432. enumerable: !0,
  1433. configurable: !0
  1434. });
  1435. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1436. get: function() {
  1437. return this._anchorOffsetY
  1438. },
  1439. set: function(b) {
  1440. c.NumberUtils.isNumber(b) && (this._anchorOffsetY = b)
  1441. },
  1442. enumerable: !0,
  1443. configurable: !0
  1444. });
  1445. Object.defineProperty(a.prototype, "anchorX", {
  1446. get: function() {
  1447. return this._anchorX
  1448. },
  1449. set: function(b) {
  1450. c.NumberUtils.isNumber(b) && (this._anchorX = b)
  1451. },
  1452. enumerable: !0,
  1453. configurable: !0
  1454. });
  1455. Object.defineProperty(a.prototype, "anchorY", {
  1456. get: function() {
  1457. return this._anchorY
  1458. },
  1459. set: function(b) {
  1460. c.NumberUtils.isNumber(b) && (this._anchorY = b)
  1461. },
  1462. enumerable: !0,
  1463. configurable: !0
  1464. });
  1465. Object.defineProperty(a.prototype, "rotation", {
  1466. get: function() {
  1467. return this._rotation
  1468. },
  1469. set: function(b) {
  1470. c.NumberUtils.isNumber(b) && (this._rotation = b)
  1471. },
  1472. enumerable: !0,
  1473. configurable: !0
  1474. });
  1475. Object.defineProperty(a.prototype, "alpha", {
  1476. get: function() {
  1477. return this._alpha
  1478. },
  1479. set: function(b) {
  1480. c.NumberUtils.isNumber(b) && (this._alpha = b)
  1481. },
  1482. enumerable: !0,
  1483. configurable: !0
  1484. });
  1485. Object.defineProperty(a.prototype, "skewX", {
  1486. get: function() {
  1487. return this._skewX
  1488. },
  1489. set: function(b) {
  1490. c.NumberUtils.isNumber(b) && (this._skewX = b)
  1491. },
  1492. enumerable: !0,
  1493. configurable: !0
  1494. });
  1495. Object.defineProperty(a.prototype, "skewY", {
  1496. get: function() {
  1497. return this._skewY
  1498. },
  1499. set: function(b) {
  1500. c.NumberUtils.isNumber(b) && (this._skewY = b)
  1501. },
  1502. enumerable: !0,
  1503. configurable: !0
  1504. });
  1505. Object.defineProperty(a.prototype, "touchEnabled", {
  1506. get: function() {
  1507. return this._touchEnabled
  1508. },
  1509. set: function(b) {
  1510. this._touchEnabled = b
  1511. },
  1512. enumerable: !0,
  1513. configurable: !0
  1514. });
  1515. Object.defineProperty(a.prototype, "scrollRect", {
  1516. get: function() {
  1517. return this._scrollRect
  1518. },
  1519. set: function(b) {
  1520. this._scrollRect = b
  1521. },
  1522. enumerable: !0,
  1523. configurable: !0
  1524. });
  1525. Object.defineProperty(a.prototype, "measuredWidth", {
  1526. get: function() {
  1527. return this._measureBounds().width
  1528. },
  1529. enumerable: !0,
  1530. configurable: !0
  1531. });
  1532. Object.defineProperty(a.prototype, "measuredHeight", {
  1533. get: function() {
  1534. return this._measureBounds().height
  1535. },
  1536. enumerable: !0,
  1537. configurable: !0
  1538. });
  1539. Object.defineProperty(a.prototype, "explicitWidth", {
  1540. get: function() {
  1541. return this._explicitWidth
  1542. },
  1543. enumerable: !0,
  1544. configurable: !0
  1545. });
  1546. Object.defineProperty(a.prototype, "explicitHeight", {
  1547. get: function() {
  1548. return this._explicitHeight
  1549. },
  1550. enumerable: !0,
  1551. configurable: !0
  1552. });
  1553. Object.defineProperty(a.prototype, "width", {
  1554. get: function() {
  1555. return this.getBounds(c.Rectangle.identity).width
  1556. },
  1557. set: function(b) {
  1558. this._setWidth(b)
  1559. },
  1560. enumerable: !0,
  1561. configurable: !0
  1562. });
  1563. Object.defineProperty(a.prototype, "height", {
  1564. get: function() {
  1565. return this.getBounds(c.Rectangle.identity).height
  1566. },
  1567. set: function(b) {
  1568. this._setHeight(b)
  1569. },
  1570. enumerable: !0,
  1571. configurable: !0
  1572. });
  1573. a.prototype._setWidth = function(b) {
  1574. this._explicitWidth = b;
  1575. this._hasWidthSet = c.NumberUtils.isNumber(b)
  1576. };
  1577. a.prototype._setHeight = function(b) {
  1578. this._explicitHeight = b;
  1579. this._hasHeightSet = c.NumberUtils.isNumber(b)
  1580. };
  1581. a.prototype._draw = function(b) {
  1582. if (this.visible && !this.drawCacheTexture(b)) {
  1583. b.setAlpha(this.worldAlpha, this.blendMode);
  1584. b.setTransform(this._worldTransform);
  1585. var a = this.mask || this._scrollRect;
  1586. a && b.pushMask(a);
  1587. this._render(b);
  1588. a && b.popMask()
  1589. }
  1590. this.destroyCacheBounds()
  1591. };
  1592. a.prototype.drawCacheTexture = function(b) {
  1593. if (this._cacheAsBitmap) {
  1594. var a = this._texture_to_render,
  1595. m = a._offsetX,
  1596. d = a._offsetY,
  1597. e = a._textureWidth,
  1598. a = a._textureHeight;
  1599. this._updateTransform();
  1600. b.setAlpha(this.worldAlpha, this.blendMode);
  1601. b.setTransform(this._worldTransform);
  1602. var g = this.mask || this._scrollRect;
  1603. g && b.pushMask(g);
  1604. var l = c.MainContext.instance.rendererContext.texture_scale_factor;
  1605. c.RenderFilter.getInstance().drawImage(b, this, 0, 0, e * l, a * l, m, d, e, a);
  1606. g && b.popMask();
  1607. return ! 0
  1608. }
  1609. return ! 1
  1610. };
  1611. a.prototype._updateTransform = function() {
  1612. this._worldTransform.identity().appendMatrix(this._parent._worldTransform);
  1613. var b = this._getOffsetPoint();
  1614. this._worldTransform.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, b.x, b.y);
  1615. this._scrollRect && this._worldTransform.append(1, 0, 0, 1, -this._scrollRect.x, -this._scrollRect.y);
  1616. this.worldAlpha = this._parent.worldAlpha * this._alpha
  1617. };
  1618. a.prototype._render = function(b) {};
  1619. a.prototype.getBounds = function(b) {
  1620. if (0 == this._cacheBounds.x && 0 == this._cacheBounds.y && 0 == this._cacheBounds.width && 0 == this._cacheBounds.height) {
  1621. var a = this._measureBounds(),
  1622. m = this._hasWidthSet ? this._explicitWidth: a.width,
  1623. d = this._hasHeightSet ? this._explicitHeight: a.height,
  1624. e = a.x,
  1625. a = a.y,
  1626. g,
  1627. l;
  1628. 0 != this._anchorX || 0 != this._anchorY ? (g = m * this._anchorX, l = d * this._anchorY) : (g = this._anchorOffsetX, l = this._anchorOffsetY);
  1629. this._cacheBounds.initialize(e - g, a - l, m, d)
  1630. }
  1631. m = this._cacheBounds;
  1632. b || (b = new c.Rectangle);
  1633. return b.initialize(m.x, m.y, m.width, m.height)
  1634. };
  1635. a.prototype.destroyCacheBounds = function() {
  1636. this._cacheBounds.x = 0;
  1637. this._cacheBounds.y = 0;
  1638. this._cacheBounds.width = 0;
  1639. this._cacheBounds.height = 0
  1640. };
  1641. a.prototype._getConcatenatedMatrix = function() {
  1642. for (var b = a.identityMatrixForGetConcatenated.identity(), h = this; null != h;) {
  1643. if (0 != h._anchorX || 0 != h._anchorY) {
  1644. var m = h._getSize(c.Rectangle.identity);
  1645. b.prependTransform(h._x, h._y, h._scaleX, h._scaleY, h._rotation, h._skewX, h._skewY, m.width * h._anchorX, m.height * h._anchorY)
  1646. } else b.prependTransform(h._x, h._y, h._scaleX, h._scaleY, h._rotation, h._skewX, h._skewY, h._anchorOffsetX, h._anchorOffsetY);
  1647. h = h._parent
  1648. }
  1649. return b
  1650. };
  1651. a.prototype.localToGlobal = function(b, a, m) {
  1652. "undefined" === typeof b && (b = 0);
  1653. "undefined" === typeof a && (a = 0);
  1654. var d = this._getConcatenatedMatrix();
  1655. d.append(1, 0, 0, 1, b, a);
  1656. m || (m = new c.Point);
  1657. m.x = d.tx;
  1658. m.y = d.ty;
  1659. return m
  1660. };
  1661. a.prototype.globalToLocal = function(b, a, d) {
  1662. "undefined" === typeof b && (b = 0);
  1663. "undefined" === typeof a && (a = 0);
  1664. var e = this._getConcatenatedMatrix();
  1665. e.invert();
  1666. e.append(1, 0, 0, 1, b, a);
  1667. d || (d = new c.Point);
  1668. d.x = e.tx;
  1669. d.y = e.ty;
  1670. return d
  1671. };
  1672. a.prototype.hitTest = function(b, a, d) {
  1673. "undefined" === typeof d && (d = !1);
  1674. if (!this.visible || !d && !this._touchEnabled) return null;
  1675. d = this._getSize(c.Rectangle.identity);
  1676. return 0 < b && b < d.width && 0 < a && a < d.height ? this.mask || this._scrollRect ? this._scrollRect && b < this._scrollRect.width && a < this._scrollRect.height || this.mask && this.mask.x < b && b < this.mask.x + this.mask.width && this.mask.y < a && a < this.mask.y + this.mask.height ? this: null: this: null
  1677. };
  1678. a.prototype.hitTestPoint = function(b, a, d) {
  1679. b = this.globalToLocal(b, a);
  1680. return d ? (this._hitTestPointTexture || (this._hitTestPointTexture = new c.RenderTexture), d = this._hitTestPointTexture, d.drawToTexture(this), 0 != d.getPixel32(b.x - this._hitTestPointTexture._offsetX, b.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(b.x, b.y, !0)
  1681. };
  1682. a.prototype._getMatrix = function() {
  1683. var b = c.Matrix.identity.identity(),
  1684. a = this._getOffsetPoint();
  1685. b.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a.x, a.y);
  1686. return b
  1687. };
  1688. a.prototype._getSize = function(b) {
  1689. return this._hasHeightSet && this._hasWidthSet ? b.initialize(NaN, NaN, this._explicitWidth, this._explicitHeight) : this._measureSize(c.Rectangle.identity)
  1690. };
  1691. a.prototype._measureSize = function(b) {
  1692. return this._measureBounds()
  1693. };
  1694. a.prototype._measureBounds = function() {
  1695. return c.Rectangle.identity.initialize(0, 0, 0, 0)
  1696. };
  1697. a.prototype._getOffsetPoint = function() {
  1698. var b = this._anchorOffsetX,
  1699. a = this._anchorOffsetY;
  1700. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(c.Rectangle.identity),
  1701. b = this._anchorX * a.width,
  1702. a = this._anchorY * a.height;
  1703. var d = c.Point.identity;
  1704. d.x = b;
  1705. d.y = a;
  1706. return d
  1707. };
  1708. a.prototype._onAddToStage = function() {
  1709. this._stage = c.MainContext.instance.stage;
  1710. c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  1711. };
  1712. a.prototype._onRemoveFromStage = function() {
  1713. this._stage = null;
  1714. c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  1715. };
  1716. Object.defineProperty(a.prototype, "stage", {
  1717. get: function() {
  1718. return this._stage
  1719. },
  1720. enumerable: !0,
  1721. configurable: !0
  1722. });
  1723. a.prototype.addEventListener = function(b, h, m, e, f) {
  1724. "undefined" === typeof e && (e = !1);
  1725. "undefined" === typeof f && (f = 0);
  1726. d.prototype.addEventListener.call(this, b, h, m, e, f); ((e = b == c.Event.ENTER_FRAME) || b == c.Event.RENDER) && this._insertEventBin(e ? a._enterFrameCallBackList: a._renderCallBackList, h, m, f)
  1727. };
  1728. a.prototype.removeEventListener = function(b, h, m, e) {
  1729. "undefined" === typeof e && (e = !1);
  1730. d.prototype.removeEventListener.call(this, b, h, m, e); ((e = b == c.Event.ENTER_FRAME) || b == c.Event.RENDER) && this._removeEventBin(e ? a._enterFrameCallBackList: a._renderCallBackList, h, m)
  1731. };
  1732. a.prototype.dispatchEvent = function(b) {
  1733. if (!b._bubbles) return d.prototype.dispatchEvent.call(this, b);
  1734. for (var a = [], c = this; c;) a.unshift(c),
  1735. c = c.parent;
  1736. for (var e = a.length,
  1737. c = e - 1,
  1738. e = e - 2; 0 <= e; e--) a.push(a[e]);
  1739. b._reset();
  1740. this._dispatchPropagationEvent(b, a, c);
  1741. return ! b.isDefaultPrevented()
  1742. };
  1743. a.prototype._dispatchPropagationEvent = function(b, a, c) {
  1744. for (var d = a.length,
  1745. e = 0; e < d; e++) {
  1746. var g = a[e];
  1747. b._setCurrentTarget(g);
  1748. b._target = this;
  1749. b._eventPhase = e < c ? 1 : e == c ? 2 : 3;
  1750. g._notifyListener(b);
  1751. if (b._isPropagationStopped || b._isPropagationImmediateStopped) break
  1752. }
  1753. };
  1754. a.prototype.willTrigger = function(b) {
  1755. for (var a = this; a;) {
  1756. if (a.hasEventListener(b)) return ! 0;
  1757. a = a._parent
  1758. }
  1759. return ! 1
  1760. };
  1761. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  1762. get: function() {
  1763. return this._cacheAsBitmap
  1764. },
  1765. set: function(b) { (this._cacheAsBitmap = b) ? (this.renderTexture || (this.renderTexture = new c.RenderTexture), this.renderTexture.drawToTexture(this), this._texture_to_render = this.renderTexture) : this._texture_to_render = null
  1766. },
  1767. enumerable: !0,
  1768. configurable: !0
  1769. });
  1770. a.getTransformBounds = function(b, a) {
  1771. var c, d, e = b.width,
  1772. g = b.height,
  1773. l = e * a.a,
  1774. e = e * a.b,
  1775. n = g * a.c,
  1776. g = g * a.d,
  1777. p = a.tx,
  1778. q = a.ty,
  1779. r = p,
  1780. s = p,
  1781. z = q,
  1782. A = q; (c = l + p) < r ? r = c: c > s && (s = c); (c = l + n + p) < r ? r = c: c > s && (s = c); (c = n + p) < r ? r = c: c > s && (s = c); (d = e + q) < z ? z = d: d > A && (A = d); (d = e + g + q) < z ? z = d: d > A && (A = d); (d = g + q) < z ? z = d: d > A && (A = d);
  1783. return b.initialize(r, z, s - r, A - z)
  1784. };
  1785. a.identityMatrixForGetConcatenated = new c.Matrix;
  1786. a._enterFrameCallBackList = [];
  1787. a._renderCallBackList = [];
  1788. return a
  1789. } (c.EventDispatcher);
  1790. c.DisplayObject = e
  1791. })(egret || (egret = {}));
  1792. __extends = this.__extends ||
  1793. function(c, e) {
  1794. function d() {
  1795. this.constructor = c
  1796. }
  1797. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1798. d.prototype = e.prototype;
  1799. c.prototype = new d
  1800. }; (function(c) {
  1801. var e = function(d) {
  1802. function a() {
  1803. d.call(this);
  1804. this._touchChildren = !0;
  1805. this._children = []
  1806. }
  1807. __extends(a, d);
  1808. Object.defineProperty(a.prototype, "touchChildren", {
  1809. get: function() {
  1810. return this._touchChildren
  1811. },
  1812. set: function(b) {
  1813. this._touchChildren = b
  1814. },
  1815. enumerable: !0,
  1816. configurable: !0
  1817. });
  1818. Object.defineProperty(a.prototype, "numChildren", {
  1819. get: function() {
  1820. return this._children.length
  1821. },
  1822. enumerable: !0,
  1823. configurable: !0
  1824. });
  1825. a.prototype.setChildIndex = function(b, a) {
  1826. this.doSetChildIndex(b, a)
  1827. };
  1828. a.prototype.doSetChildIndex = function(b, a) {
  1829. var d = this._children.indexOf(b);
  1830. 0 > d && c.Logger.fatal("child不在当前容器内");
  1831. this._children.splice(d, 1);
  1832. 0 > a || this._children.length <= a ? this._children.push(b) : this._children.splice(a, 0, b)
  1833. };
  1834. a.prototype.addChild = function(b) {
  1835. var a = this.numChildren;
  1836. b._parent == this && a--;
  1837. return this._doAddChild(b, a)
  1838. };
  1839. a.prototype.addChildAt = function(b, a) {
  1840. return this._doAddChild(b, a)
  1841. };
  1842. a.prototype._doAddChild = function(b, h, d) {
  1843. "undefined" === typeof d && (d = !0);
  1844. if (b == this) return b;
  1845. if (0 > h || h > this._children.length) return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  1846. b;
  1847. var e = b.parent;
  1848. if (e == this) return this.doSetChildIndex(b, h),
  1849. b;
  1850. e && e.removeChild(b);
  1851. this._children.splice(h, 0, b);
  1852. b._parentChanged(this);
  1853. d && b.dispatchEventWith(c.Event.ADDED, !0);
  1854. if (this._stage) for (b._onAddToStage(), h = a.__EVENT__ADD_TO_STAGE_LIST; 0 < h.length;) h.shift().dispatchEventWith(c.Event.ADDED_TO_STAGE);
  1855. return b
  1856. };
  1857. a.prototype.removeChild = function(b) {
  1858. b = this._children.indexOf(b);
  1859. if (0 <= b) return this._doRemoveChild(b);
  1860. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  1861. return null
  1862. };
  1863. a.prototype.removeChildAt = function(b) {
  1864. if (0 <= b && b < this._children.length) return this._doRemoveChild(b);
  1865. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  1866. return null
  1867. };
  1868. a.prototype._doRemoveChild = function(b, h) {
  1869. "undefined" === typeof h && (h = !0);
  1870. var d = this._children,
  1871. e = d[b];
  1872. h && e.dispatchEventWith(c.Event.REMOVED, !0);
  1873. if (this._stage) {
  1874. e._onRemoveFromStage();
  1875. for (var f = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < f.length;) f.shift().dispatchEventWith(c.Event.REMOVED_FROM_STAGE)
  1876. }
  1877. e._parentChanged(null);
  1878. d.splice(b, 1);
  1879. return e
  1880. };
  1881. a.prototype.getChildAt = function(b) {
  1882. if (0 <= b && b < this._children.length) return this._children[b];
  1883. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  1884. return null
  1885. };
  1886. a.prototype.contains = function(b) {
  1887. for (; b;) {
  1888. if (b == this) return ! 0;
  1889. b = b._parent
  1890. }
  1891. return ! 1
  1892. };
  1893. a.prototype.swapChildrenAt = function(b, a) {
  1894. 0 <= b && b < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(b, a) : c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  1895. };
  1896. a.prototype.swapChildren = function(b, a) {
  1897. var d = this._children.indexOf(b),
  1898. e = this._children.indexOf(a); - 1 == d || -1 == e ? c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(d, e)
  1899. };
  1900. a.prototype._swapChildrenAt = function(b, a) {
  1901. if (b != a) {
  1902. var c = this._children,
  1903. d = c[b];
  1904. c[b] = c[a];
  1905. c[a] = d
  1906. }
  1907. };
  1908. a.prototype.getChildIndex = function(b) {
  1909. return this._children.indexOf(b)
  1910. };
  1911. a.prototype.removeChildren = function() {
  1912. for (var b = this._children.length - 1; 0 <= b; b--) this._doRemoveChild(b)
  1913. };
  1914. a.prototype._updateTransform = function() {
  1915. if (this.visible) {
  1916. d.prototype._updateTransform.call(this);
  1917. for (var b = 0,
  1918. a = this._children.length; b < a; b++) this._children[b]._updateTransform()
  1919. }
  1920. };
  1921. a.prototype._render = function(b) {
  1922. for (var a = 0,
  1923. c = this._children.length; a < c; a++) this._children[a]._draw(b)
  1924. };
  1925. a.prototype._measureBounds = function() {
  1926. for (var b = 0,
  1927. a = 0,
  1928. d = 0,
  1929. e = 0,
  1930. f = this._children.length,
  1931. g = 0; g < f; g++) {
  1932. var l = this._children[g],
  1933. n;
  1934. if (l.visible && (n = c.DisplayObject.getTransformBounds(l._getSize(c.Rectangle.identity), l._getMatrix()))) {
  1935. var l = n.x,
  1936. p = n.y,
  1937. q = n.width + n.x,
  1938. r = n.height + n.y;
  1939. if (l < b || 0 == g) b = l;
  1940. if (q > a || 0 == g) a = q;
  1941. if (p < d || 0 == g) d = p;
  1942. if (r > e || 0 == g) e = r
  1943. }
  1944. }
  1945. return c.Rectangle.identity.initialize(b, d, a - b, e - d)
  1946. };
  1947. a.prototype.hitTest = function(b, a, m) {
  1948. "undefined" === typeof m && (m = !1);
  1949. var e;
  1950. if (!this.visible) return null;
  1951. if (this._scrollRect) {
  1952. if (b > this._scrollRect.width || a > this._scrollRect.height) return null
  1953. } else if (this.mask && (this.mask.x > b || b > this.mask.x + this.mask.width || this.mask.y > a || a > this.mask.y + this.mask.height)) return null;
  1954. for (var f = this._children,
  1955. g = this._touchChildren,
  1956. l = f.length - 1; 0 <= l; l--) {
  1957. var n = f[l],
  1958. p = n,
  1959. q = p._getOffsetPoint(),
  1960. r = p._x,
  1961. s = p._y;
  1962. this._scrollRect && (r -= this._scrollRect.x, s -= this._scrollRect.y);
  1963. p = c.Matrix.identity.identity().prependTransform(r, s, p._scaleX, p._scaleY, p._rotation, 0, 0, q.x, q.y);
  1964. p.invert();
  1965. p = c.Matrix.transformCoords(p, b, a);
  1966. if (n = n.hitTest(p.x, p.y, !0)) {
  1967. if (n._touchEnabled && g) return n;
  1968. if (this._touchEnabled) return this;
  1969. null == e && (e = n)
  1970. }
  1971. }
  1972. return e || !this._texture_to_render && !this._graphics ? e: d.prototype.hitTest.call(this, b, a, m)
  1973. };
  1974. a.prototype._onAddToStage = function() {
  1975. d.prototype._onAddToStage.call(this);
  1976. for (var b = this.numChildren,
  1977. a = 0; a < b; a++) this._children[a]._onAddToStage()
  1978. };
  1979. a.prototype._onRemoveFromStage = function() {
  1980. d.prototype._onRemoveFromStage.call(this);
  1981. for (var b = this.numChildren,
  1982. a = 0; a < b; a++) this._children[a]._onRemoveFromStage()
  1983. };
  1984. a.prototype.getChildByName = function(b) {
  1985. for (var a = this._children,
  1986. c = this.numChildren,
  1987. d, e = 0; e < c; e++) if (d = a[e], d.name == b) return d;
  1988. return null
  1989. };
  1990. a.__EVENT__ADD_TO_STAGE_LIST = [];
  1991. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  1992. return a
  1993. } (c.DisplayObject);
  1994. c.DisplayObjectContainer = e
  1995. })(egret || (egret = {}));
  1996. __extends = this.__extends ||
  1997. function(c, e) {
  1998. function d() {
  1999. this.constructor = c
  2000. }
  2001. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2002. d.prototype = e.prototype;
  2003. c.prototype = new d
  2004. }; (function(c) {
  2005. var e = function(d) {
  2006. function a(b, a) {
  2007. d.call(this);
  2008. this.touchEnabled = !0;
  2009. this._stage = this;
  2010. this._stageWidth = b;
  2011. this._stageHeight = a
  2012. }
  2013. __extends(a, d);
  2014. a.prototype.invalidate = function() {
  2015. a._invalidateRenderFlag = !0
  2016. };
  2017. a.prototype._setStageSize = function(b, a) {
  2018. if (this._stageWidth != b || this._stageHeight != a) this._stageWidth = b,
  2019. this._stageHeight = a,
  2020. this.dispatchEventWith(c.Event.RESIZE)
  2021. };
  2022. Object.defineProperty(a.prototype, "stageWidth", {
  2023. get: function() {
  2024. return this._stageWidth
  2025. },
  2026. enumerable: !0,
  2027. configurable: !0
  2028. });
  2029. Object.defineProperty(a.prototype, "stageHeight", {
  2030. get: function() {
  2031. return this._stageHeight
  2032. },
  2033. enumerable: !0,
  2034. configurable: !0
  2035. });
  2036. a.prototype.hitTest = function(b, a) {
  2037. if (!this.touchEnabled) return null;
  2038. var d;
  2039. if (!this.visible) return this;
  2040. for (var e = this._children,
  2041. f = e.length - 1; 0 <= f; f--) {
  2042. var g = d = e[f],
  2043. l = g._getOffsetPoint(),
  2044. g = c.Matrix.identity.identity().prependTransform(g.x, g.y, g.scaleX, g.scaleY, g.rotation, 0, 0, l.x, l.y);
  2045. g.invert();
  2046. g = c.Matrix.transformCoords(g, b, a);
  2047. if ((d = d.hitTest(g.x, g.y, !0)) && d.touchEnabled) return d
  2048. }
  2049. return this
  2050. };
  2051. a.prototype.getBounds = function(b) {
  2052. b || (b = new c.Rectangle);
  2053. return b.initialize(0, 0, this._stageWidth, this._stageHeight)
  2054. };
  2055. a.prototype._updateTransform = function() {
  2056. for (var b = 0,
  2057. a = this._children.length; b < a; b++) this._children[b]._updateTransform()
  2058. };
  2059. a._invalidateRenderFlag = !1;
  2060. return a
  2061. } (c.DisplayObjectContainer);
  2062. c.Stage = e
  2063. })(egret || (egret = {})); (function(c) {
  2064. var e = function() {
  2065. function c() {}
  2066. c.REPEAT = "repeat";
  2067. c.SCALE = "scale";
  2068. return c
  2069. } ();
  2070. c.BitmapFillMode = e
  2071. })(egret || (egret = {}));
  2072. __extends = this.__extends ||
  2073. function(c, e) {
  2074. function d() {
  2075. this.constructor = c
  2076. }
  2077. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2078. d.prototype = e.prototype;
  2079. c.prototype = new d
  2080. }; (function(c) {
  2081. var e = function(d) {
  2082. function a(b) {
  2083. d.call(this);
  2084. this.debug = !1;
  2085. this.debugColor = 16711680;
  2086. this.fillMode = "scale";
  2087. b && (this.texture = b)
  2088. }
  2089. __extends(a, d);
  2090. a.prototype._render = function(b) {
  2091. var c = this.texture;
  2092. c ? (this._texture_to_render = c, a._drawBitmap(b, this._hasWidthSet ? this._explicitWidth: c._textureWidth, this._hasHeightSet ? this._explicitHeight: c._textureHeight, this)) : this._texture_to_render = null
  2093. };
  2094. a._drawBitmap = function(b, h, d, e) {
  2095. var f = e._texture_to_render;
  2096. if (f) {
  2097. var g = f._textureWidth,
  2098. l = f._textureHeight;
  2099. if ("scale" == e.fillMode) {
  2100. var n = e.scale9Grid;
  2101. if (n && g - n.width < h && l - n.height < d) a.drawScale9GridImage(b, e, e.scale9Grid, h, d);
  2102. else {
  2103. var n = f._offsetX,
  2104. p = f._offsetY,
  2105. q = f._bitmapWidth || g,
  2106. r = f._bitmapHeight || l;
  2107. e._hasWidthSet ? (h /= g, n = Math.round(n * h), h = Math.round(q * h)) : h = q;
  2108. e._hasHeightSet ? (d /= l, p = Math.round(p * d), d = Math.round(r * d)) : d = r;
  2109. c.RenderFilter.getInstance().drawImage(b, e, f._bitmapX, f._bitmapY, q, r, n, p, h, d)
  2110. }
  2111. } else a.drawRepeatImage(b, e, h, d)
  2112. }
  2113. };
  2114. a.drawRepeatImage = function(b, a, d, e) {
  2115. var f = a._texture_to_render;
  2116. if (f) for (var g = f._textureWidth,
  2117. l = f._textureHeight,
  2118. n = f._bitmapX,
  2119. p = f._bitmapY,
  2120. q = f._bitmapWidth || g,
  2121. r = f._bitmapHeight || l,
  2122. s = f._offsetX,
  2123. f = f._offsetY,
  2124. z = c.RenderFilter.getInstance(); s < d; s += g) for (var A = f; A < e; A += l) {
  2125. var v = Math.min(q, d - s),
  2126. B = Math.min(r, e - A);
  2127. z.drawImage(b, a, n, p, q, r, s, A, v, B)
  2128. }
  2129. };
  2130. a.drawScale9GridImage = function(b, a, d, e, f) {
  2131. var g = a._texture_to_render;
  2132. if (g && d) {
  2133. var l = c.RenderFilter.getInstance(),
  2134. n = g._textureWidth,
  2135. p = g._textureHeight,
  2136. q = g._bitmapX,
  2137. r = g._bitmapY,
  2138. s = g._bitmapWidth || n,
  2139. z = g._bitmapHeight || p,
  2140. A = g._offsetX,
  2141. g = g._offsetY;
  2142. d = c.Rectangle.identity.initialize(d.x - Math.round(A), d.y - Math.round(A), d.width, d.height);
  2143. A = Math.round(A);
  2144. g = Math.round(g);
  2145. e -= n - s;
  2146. f -= p - z;
  2147. d.y == d.bottom && (d.bottom < z ? d.bottom++:d.y--);
  2148. d.x == d.right && (d.right < s ? d.right++:d.x--);
  2149. var n = q + d.x,
  2150. p = q + d.right,
  2151. v = s - d.right,
  2152. B = r + d.y,
  2153. C = r + d.bottom,
  2154. t = z - d.bottom,
  2155. u = A + d.x,
  2156. D = g + d.y,
  2157. z = f - (z - d.bottom),
  2158. s = e - (s - d.right);
  2159. l.drawImage(b, a, q, r, d.x, d.y, A, g, d.x, d.y);
  2160. l.drawImage(b, a, n, r, d.width, d.y, u, g, s - d.x, d.y);
  2161. l.drawImage(b, a, p, r, v, d.y, A + s, g, e - s, d.y);
  2162. l.drawImage(b, a, q, B, d.x, d.height, A, D, d.x, z - d.y);
  2163. l.drawImage(b, a, n, B, d.width, d.height, u, D, s - d.x, z - d.y);
  2164. l.drawImage(b, a, p, B, v, d.height, A + s, D, e - s, z - d.y);
  2165. l.drawImage(b, a, q, C, d.x, t, A, g + z, d.x, f - z);
  2166. l.drawImage(b, a, n, C, d.width, t, u, g + z, s - d.x, f - z);
  2167. l.drawImage(b, a, p, C, v, t, A + s, g + z, e - s, f - z)
  2168. }
  2169. };
  2170. a.prototype._measureBounds = function() {
  2171. var b = this.texture;
  2172. return b ? c.Rectangle.identity.initialize(b._offsetX, b._offsetY, b._textureWidth, b._textureHeight) : d.prototype._measureBounds.call(this)
  2173. };
  2174. a.debug = !1;
  2175. return a
  2176. } (c.DisplayObject);
  2177. c.Bitmap = e
  2178. })(egret || (egret = {}));
  2179. __extends = this.__extends ||
  2180. function(c, e) {
  2181. function d() {
  2182. this.constructor = c
  2183. }
  2184. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2185. d.prototype = e.prototype;
  2186. c.prototype = new d
  2187. }; (function(c) {
  2188. var e = function(d) {
  2189. function a() {
  2190. d.call(this);
  2191. this.text = "";
  2192. this._bitmapPool = []
  2193. }
  2194. __extends(a, d);
  2195. a.prototype._updateTransform = function() {
  2196. this.visible && (this._renderText(), d.prototype._updateTransform.call(this))
  2197. };
  2198. a.prototype._renderText = function(b) {
  2199. "undefined" === typeof b && (b = !1);
  2200. var a = c.Rectangle.identity.initialize(0, 0, 0, 0);
  2201. b || this.removeChildren();
  2202. for (var d = 0,
  2203. e = this.text.length; d < e; d++) {
  2204. var f = this.text.charAt(d),
  2205. f = this.spriteSheet.getTexture(f),
  2206. g = f._offsetX,
  2207. l = f._offsetY,
  2208. n = f._textureWidth;
  2209. if (!b) {
  2210. var p = this._bitmapPool[d];
  2211. p || (p = new c.Bitmap, this._bitmapPool.push(p));
  2212. p.texture = f;
  2213. this.addChild(p);
  2214. p.x = a.width
  2215. }
  2216. a.width += n + g;
  2217. l + f._textureHeight > a.height && (a.height = l + f._textureHeight)
  2218. }
  2219. return a
  2220. };
  2221. a.prototype._measureBounds = function() {
  2222. return this._renderText(!0)
  2223. };
  2224. return a
  2225. } (c.DisplayObjectContainer);
  2226. c.BitmapText = e
  2227. })(egret || (egret = {})); (function(c) {
  2228. var e = function() {
  2229. function c() {
  2230. this.commandQueue = []
  2231. }
  2232. c.prototype.beginFill = function(a, b) {};
  2233. c.prototype._setStyle = function(a) {};
  2234. c.prototype.drawRect = function(a, b, c, d) {};
  2235. c.prototype.drawCircle = function(a, b, c) {};
  2236. c.prototype.lineStyle = function(a, b, c, d, e, f, g, l) {};
  2237. c.prototype.lineTo = function(a, b) {};
  2238. c.prototype.curveTo = function(a, b, c, d) {};
  2239. c.prototype.moveTo = function(a, b) {};
  2240. c.prototype.clear = function() {};
  2241. c.prototype.endFill = function() {};
  2242. c.prototype._draw = function(a) {};
  2243. return c
  2244. } ();
  2245. c.Graphics = e; (function() {
  2246. return function(c, a, b) {
  2247. this.method = c;
  2248. this.thisObject = a;
  2249. this.args = b
  2250. }
  2251. })()
  2252. })(egret || (egret = {}));
  2253. __extends = this.__extends ||
  2254. function(c, e) {
  2255. function d() {
  2256. this.constructor = c
  2257. }
  2258. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2259. d.prototype = e.prototype;
  2260. c.prototype = new d
  2261. }; (function(c) {
  2262. var e = function(d) {
  2263. function a() {
  2264. d.call(this)
  2265. }
  2266. __extends(a, d);
  2267. Object.defineProperty(a.prototype, "graphics", {
  2268. get: function() {
  2269. this._graphics || (this._graphics = new c.Graphics);
  2270. return this._graphics
  2271. },
  2272. enumerable: !0,
  2273. configurable: !0
  2274. });
  2275. a.prototype._render = function(b) {
  2276. this._graphics && this._graphics._draw(b)
  2277. };
  2278. return a
  2279. } (c.DisplayObject);
  2280. c.Shape = e
  2281. })(egret || (egret = {}));
  2282. __extends = this.__extends ||
  2283. function(c, e) {
  2284. function d() {
  2285. this.constructor = c
  2286. }
  2287. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2288. d.prototype = e.prototype;
  2289. c.prototype = new d
  2290. }; (function(c) {
  2291. var e = function(d) {
  2292. function a() {
  2293. d.call(this)
  2294. }
  2295. __extends(a, d);
  2296. Object.defineProperty(a.prototype, "graphics", {
  2297. get: function() {
  2298. this._graphics || (this._graphics = new c.Graphics);
  2299. return this._graphics
  2300. },
  2301. enumerable: !0,
  2302. configurable: !0
  2303. });
  2304. a.prototype._render = function(b) {
  2305. this._graphics && this._graphics._draw(b);
  2306. d.prototype._render.call(this, b)
  2307. };
  2308. return a
  2309. } (c.DisplayObjectContainer);
  2310. c.Sprite = e
  2311. })(egret || (egret = {}));
  2312. __extends = this.__extends ||
  2313. function(c, e) {
  2314. function d() {
  2315. this.constructor = c
  2316. }
  2317. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2318. d.prototype = e.prototype;
  2319. c.prototype = new d
  2320. }; (function(c) {
  2321. var e = function(d) {
  2322. function a() {
  2323. d.call(this);
  2324. this._textDirty = !0;
  2325. this._fontFamily = "Arial";
  2326. this._size = 30;
  2327. this._textColorString = "#FFFFFF";
  2328. this._textColor = 16777215;
  2329. this._strokeColorString = "#000000";
  2330. this._stroke = this._strokeColor = 0;
  2331. this._textAlign = "left";
  2332. this._verticalAlign = "top";
  2333. this._numLines = this._lineSpacing = 0;
  2334. this.measuredWidths = []
  2335. }
  2336. __extends(a, d);
  2337. Object.defineProperty(a.prototype, "text", {
  2338. get: function() {
  2339. return this._text
  2340. },
  2341. set: function(b) {
  2342. this._text != b && (this._textDirty = !0, this._text = b)
  2343. },
  2344. enumerable: !0,
  2345. configurable: !0
  2346. });
  2347. Object.defineProperty(a.prototype, "fontFamily", {
  2348. get: function() {
  2349. return this._fontFamily
  2350. },
  2351. set: function(b) {
  2352. this._fontFamily != b && (this._textDirty = !0, this._fontFamily = b)
  2353. },
  2354. enumerable: !0,
  2355. configurable: !0
  2356. });
  2357. Object.defineProperty(a.prototype, "size", {
  2358. get: function() {
  2359. return this._size
  2360. },
  2361. set: function(b) {
  2362. this._size != b && (this._textDirty = !0, this._size = b)
  2363. },
  2364. enumerable: !0,
  2365. configurable: !0
  2366. });
  2367. Object.defineProperty(a.prototype, "italic", {
  2368. get: function() {
  2369. return this._italic
  2370. },
  2371. set: function(b) {
  2372. this._italic != b && (this._textDirty = !0, this._italic = b)
  2373. },
  2374. enumerable: !0,
  2375. configurable: !0
  2376. });
  2377. Object.defineProperty(a.prototype, "bold", {
  2378. get: function() {
  2379. return this._bold
  2380. },
  2381. set: function(b) {
  2382. this._bold != b && (this._textDirty = !0, this._bold = b)
  2383. },
  2384. enumerable: !0,
  2385. configurable: !0
  2386. });
  2387. Object.defineProperty(a.prototype, "textColor", {
  2388. get: function() {
  2389. return this._textColor
  2390. },
  2391. set: function(b) {
  2392. this._textColor != b && (this._textDirty = !0, this._textColor = b, this._textColorString = c.toColorString(b))
  2393. },
  2394. enumerable: !0,
  2395. configurable: !0
  2396. });
  2397. Object.defineProperty(a.prototype, "strokeColor", {
  2398. get: function() {
  2399. return this._strokeColor
  2400. },
  2401. set: function(b) {
  2402. this._strokeColor != b && (this._textDirty = !0, this._strokeColor = b, this._strokeColorString = c.toColorString(b))
  2403. },
  2404. enumerable: !0,
  2405. configurable: !0
  2406. });
  2407. Object.defineProperty(a.prototype, "stroke", {
  2408. get: function() {
  2409. return this._stroke
  2410. },
  2411. set: function(b) {
  2412. this._stroke != b && (this._textDirty = !0, this._stroke = b)
  2413. },
  2414. enumerable: !0,
  2415. configurable: !0
  2416. });
  2417. Object.defineProperty(a.prototype, "textAlign", {
  2418. get: function() {
  2419. return this._textAlign
  2420. },
  2421. set: function(b) {
  2422. this._textAlign != b && (this._textDirty = !0, this._textAlign = b)
  2423. },
  2424. enumerable: !0,
  2425. configurable: !0
  2426. });
  2427. Object.defineProperty(a.prototype, "verticalAlign", {
  2428. get: function() {
  2429. return this._verticalAlign
  2430. },
  2431. set: function(b) {
  2432. this._verticalAlign != b && (this._textDirty = !0, this._verticalAlign = b)
  2433. },
  2434. enumerable: !0,
  2435. configurable: !0
  2436. });
  2437. Object.defineProperty(a.prototype, "lineSpacing", {
  2438. get: function() {
  2439. return this._lineSpacing
  2440. },
  2441. set: function(b) {
  2442. this._lineSpacing != b && (this._textDirty = !0, this._lineSpacing = b)
  2443. },
  2444. enumerable: !0,
  2445. configurable: !0
  2446. });
  2447. Object.defineProperty(a.prototype, "numLines", {
  2448. get: function() {
  2449. return this._numLines
  2450. },
  2451. enumerable: !0,
  2452. configurable: !0
  2453. });
  2454. a.prototype._render = function(b) {
  2455. this.drawText(b, !1);
  2456. this._textDirty = !1
  2457. };
  2458. a.prototype._measureBounds = function() {
  2459. return this.drawText(c.MainContext.instance.rendererContext, !0)
  2460. };
  2461. a.prototype.drawText = function(b, a) {
  2462. var d = this.getTextLines(b);
  2463. if (!d) return c.Rectangle.identity.initialize(0, 0, 0, 0);
  2464. var e = d.length,
  2465. f = 0.5 * this._size,
  2466. g = this._size + this._lineSpacing,
  2467. l = e * g - this._lineSpacing;
  2468. this._textHeight = l;
  2469. var n = this._explicitHeight;
  2470. if (this._hasHeightSet && l < n) {
  2471. var p = 0;
  2472. this._verticalAlign == c.VerticalAlign.MIDDLE ? p = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (p = 1);
  2473. f += p * (n - l)
  2474. } else n = Number.POSITIVE_INFINITY;
  2475. var p = f = Math.round(f),
  2476. q = 0;
  2477. this._textAlign == c.HorizontalAlign.CENTER ? q = 0.5 : this._textAlign == c.HorizontalAlign.RIGHT && (q = 1);
  2478. var r = this.measuredWidths,
  2479. s;
  2480. s = this._hasWidthSet ? this._explicitWidth: this._textWidth;
  2481. for (var z = Number.POSITIVE_INFINITY,
  2482. A = 0; A < e; A++) {
  2483. var v = d[A],
  2484. B = Math.round((s - r[A]) * q);
  2485. B < z && (z = B); ! a && f < n && b.drawText(this, v, B, f, s);
  2486. f += g
  2487. }
  2488. return c.Rectangle.identity.initialize(z, p, s, l)
  2489. };
  2490. a.prototype.getTextLines = function(b) {
  2491. var a = this.text ? this.text.toString() : "";
  2492. if (!a) return null;
  2493. var c = this.measuredWidths;
  2494. c.length = 0;
  2495. b.setupFont(this);
  2496. var a = a.split(/(?:\r\n|\r|\n)/),
  2497. d = a.length,
  2498. e = 0;
  2499. if (this._hasWidthSet) for (var g = this._explicitWidth,
  2500. l = 0; l < d; l++) {
  2501. var n = a[l],
  2502. p = b.measureText(n);
  2503. if (p > g) {
  2504. for (var q = "",
  2505. r = 0,
  2506. s = n.length,
  2507. z = 0; z < s; z++) {
  2508. var A = n.charAt(z),
  2509. p = b.measureText(A);
  2510. r + p > g && (0 == r ? (a.splice(l, 0, A), c[l] = p, e < p && (e = p), p = 0, A = "") : (a.splice(l, 0, q), c[l] = r, e < r && (e = r), q = "", r = 0), l++, d++);
  2511. r += p;
  2512. q += A
  2513. }
  2514. a[l] = q;
  2515. c[l] = r
  2516. } else c[l] = p,
  2517. e < p && (e = p)
  2518. } else for (l = 0; l < d; l++) n = a[l],
  2519. p = b.measureText(n),
  2520. c[l] = p,
  2521. e < p && (e = p);
  2522. this._textWidth = e;
  2523. return a
  2524. };
  2525. return a
  2526. } (c.DisplayObject);
  2527. c.TextField = e
  2528. })(egret || (egret = {})); (function(c) {
  2529. var e = function() {
  2530. function c() {}
  2531. c.DYNAMIC = "dynamic";
  2532. c.INPUT = "input";
  2533. return c
  2534. } ();
  2535. c.TextFieldType = e
  2536. })(egret || (egret = {}));
  2537. __extends = this.__extends ||
  2538. function(c, e) {
  2539. function d() {
  2540. this.constructor = c
  2541. }
  2542. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2543. d.prototype = e.prototype;
  2544. c.prototype = new d
  2545. }; (function(c) {
  2546. var e = function(d) {
  2547. function a(b) {
  2548. d.call(this);
  2549. var a = b.bitmapData;
  2550. this.bitmapData = a;
  2551. this._textureMap = {};
  2552. this._sourceWidth = a.width;
  2553. this._sourceHeight = a.height;
  2554. this._bitmapX = b._bitmapX;
  2555. this._bitmapY = b._bitmapY
  2556. }
  2557. __extends(a, d);
  2558. a.prototype.getTexture = function(b) {
  2559. return this._textureMap[b]
  2560. };
  2561. a.prototype.createTexture = function(b, a, d, e, f, g, l, n, p) {
  2562. "undefined" === typeof g && (g = 0);
  2563. "undefined" === typeof l && (l = 0);
  2564. "undefined" === typeof n && (n = g + e);
  2565. "undefined" === typeof p && (p = l + f);
  2566. var q = new c.Texture;
  2567. q._bitmapData = this.bitmapData;
  2568. q._bitmapX = this._bitmapX + a;
  2569. q._bitmapY = this._bitmapY + d;
  2570. q._bitmapWidth = e;
  2571. q._bitmapHeight = f;
  2572. q._offsetX = g;
  2573. q._offsetY = l;
  2574. q._textureWidth = n;
  2575. q._textureHeight = p;
  2576. q._sourceWidth = this._sourceWidth;
  2577. q._sourceHeight = this._sourceHeight;
  2578. return this._textureMap[b] = q
  2579. };
  2580. return a
  2581. } (c.HashObject);
  2582. c.SpriteSheet = e
  2583. })(egret || (egret = {}));
  2584. __extends = this.__extends ||
  2585. function(c, e) {
  2586. function d() {
  2587. this.constructor = c
  2588. }
  2589. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2590. d.prototype = e.prototype;
  2591. c.prototype = new d
  2592. }; (function(c) {
  2593. var e = function(d) {
  2594. function a() {
  2595. d.apply(this, arguments);
  2596. this._placeholderText = "";
  2597. this._edFontSize = 14;
  2598. this._textColor = 16711680;
  2599. this._placeholderFontSize = 14;
  2600. this._placeholderColor = 16776960;
  2601. this._preY = this._preX = 0
  2602. }
  2603. __extends(a, d);
  2604. a.prototype._onAddToStage = function() {
  2605. d.prototype._onAddToStage.call(this);
  2606. var b = this.localToGlobal(),
  2607. a = new c.StageText;
  2608. a._open(b.x, b.y, this._explicitWidth, this._explicitHeight);
  2609. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
  2610. this.stageText = a
  2611. };
  2612. a.prototype.setText = function(b) {
  2613. this.stageText._setText(b)
  2614. };
  2615. a.prototype.getText = function() {
  2616. return this.stageText._getText()
  2617. };
  2618. a.prototype.setTextType = function(b) {
  2619. this.stageText._setTextType(b)
  2620. };
  2621. a.prototype.getTextType = function() {
  2622. return this.stageText._getTextType()
  2623. };
  2624. a.prototype.onMouseDownHandler = function(b) {};
  2625. a.prototype._onRemoveFromStage = function() {
  2626. this.stageText._remove()
  2627. };
  2628. a.prototype._measureBounds = function() {
  2629. return c.Rectangle.identity
  2630. };
  2631. a.prototype.hitTest = function(b, a, c) {
  2632. return null
  2633. };
  2634. return a
  2635. } (c.DisplayObject);
  2636. c.TextInput = e;
  2637. e = function() {
  2638. function c() {}
  2639. c.prototype.editBoxEditingDidBegin = function(a) {};
  2640. c.prototype.editBoxEditingDidEnd = function(a) {};
  2641. c.prototype.editBoxTextChanged = function(a, b) {};
  2642. c.prototype.editBoxReturn = function(a) {};
  2643. return c
  2644. } ();
  2645. c.TextInputDegelete = e
  2646. })(egret || (egret = {}));
  2647. __extends = this.__extends ||
  2648. function(c, e) {
  2649. function d() {
  2650. this.constructor = c
  2651. }
  2652. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2653. d.prototype = e.prototype;
  2654. c.prototype = new d
  2655. }; (function(c) {
  2656. var e = function(c) {
  2657. function a(b, a) {
  2658. c.call(this, b);
  2659. this.charList = this.parseConfig(a)
  2660. }
  2661. __extends(a, c);
  2662. a.prototype.getTexture = function(b) {
  2663. var a = this._textureMap[b];
  2664. if (!a) {
  2665. a = this.charList[b];
  2666. if (!a) return null;
  2667. a = this.createTexture(b, a.x, a.y, a.width, a.height, a.offsetX, a.offsetY);
  2668. this._textureMap[b] = a
  2669. }
  2670. return a
  2671. };
  2672. a.prototype.parseConfig = function(b) {
  2673. b = b.split("\r\n").join("\n");
  2674. b = b.split("\n");
  2675. for (var a = this.getConfigByKey(b[3], "count"), c = {},
  2676. d = 4; d < 4 + a; d++) {
  2677. var e = b[d],
  2678. g = String.fromCharCode(this.getConfigByKey(e, "id")),
  2679. l = {};
  2680. c[g] = l;
  2681. l.x = this.getConfigByKey(e, "x");
  2682. l.y = this.getConfigByKey(e, "y");
  2683. l.width = this.getConfigByKey(e, "width");
  2684. l.height = this.getConfigByKey(e, "height");
  2685. l.offsetX = this.getConfigByKey(e, "xoffset");
  2686. l.offsetY = this.getConfigByKey(e, "yoffset")
  2687. }
  2688. return c
  2689. };
  2690. a.prototype.getConfigByKey = function(b, a) {
  2691. for (var c = b.split(" "), d = 0, e = c.length; d < e; d++) {
  2692. var g = c[d];
  2693. if (a == g.substring(0, a.length)) return c = g.substring(a.length + 1),
  2694. parseInt(c)
  2695. }
  2696. return 0
  2697. };
  2698. return a
  2699. } (c.SpriteSheet);
  2700. c.BitmapTextSpriteSheet = e
  2701. })(egret || (egret = {}));
  2702. __extends = this.__extends ||
  2703. function(c, e) {
  2704. function d() {
  2705. this.constructor = c
  2706. }
  2707. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2708. d.prototype = e.prototype;
  2709. c.prototype = new d
  2710. }; (function(c) {
  2711. var e = function(a) {
  2712. function b(b, m) {
  2713. a.call(this);
  2714. this.frameRate = 60;
  2715. null != m && m instanceof c.Texture ? (c.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(new DefaultMovieClipDelegate(data,texture))"), this.delegate = new d(b, m)) : this.delegate = b;
  2716. this.delegate.setMovieClip(this)
  2717. }
  2718. __extends(b, a);
  2719. b.prototype.gotoAndPlay = function(b) {
  2720. this.delegate.gotoAndPlay(b)
  2721. };
  2722. b.prototype.gotoAndStop = function(b) {
  2723. this.delegate.gotoAndStop(b)
  2724. };
  2725. b.prototype.stop = function() {
  2726. this.delegate.stop()
  2727. };
  2728. b.prototype.dispose = function() {
  2729. this.delegate.dispose()
  2730. };
  2731. b.prototype.release = function() {
  2732. c.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2733. this.dispose()
  2734. };
  2735. b.prototype.getCurrentFrameIndex = function() {
  2736. c.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2737. return this.delegate._currentFrameIndex
  2738. };
  2739. b.prototype.getTotalFrame = function() {
  2740. c.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2741. return this.delegate._totalFrame
  2742. };
  2743. b.prototype.setInterval = function(b) {
  2744. c.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  2745. this.frameRate = 60 / b
  2746. };
  2747. b.prototype.getIsPlaying = function() {
  2748. c.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2749. return this.delegate.isPlaying
  2750. };
  2751. return b
  2752. } (c.DisplayObjectContainer);
  2753. c.MovieClip = e;
  2754. var d = function() {
  2755. function a(b, a) {
  2756. this.data = b;
  2757. this._currentFrameIndex = this._passTime = this._totalFrame = 0;
  2758. this._isPlaying = !1;
  2759. this._frameData = b;
  2760. this._spriteSheet = new c.SpriteSheet(a)
  2761. }
  2762. a.prototype.setMovieClip = function(b) {
  2763. this.movieClip = b;
  2764. this.bitmap = new c.Bitmap;
  2765. this.movieClip.addChild(this.bitmap)
  2766. };
  2767. a.prototype.gotoAndPlay = function(b) {
  2768. this.checkHasFrame(b);
  2769. this._isPlaying = !0;
  2770. this._currentFrameIndex = 0;
  2771. this._currentFrameName = b;
  2772. this.playNextFrame();
  2773. this._passTime = 0;
  2774. c.Ticker.getInstance().register(this.update, this);
  2775. this._totalFrame = this._frameData.frames[b].totalFrame
  2776. };
  2777. a.prototype.gotoAndStop = function(b) {
  2778. this.checkHasFrame(b);
  2779. this.stop();
  2780. this._currentFrameIndex = this._passTime = 0;
  2781. this._currentFrameName = b;
  2782. this._totalFrame = this._frameData.frames[b].totalFrame;
  2783. this.playNextFrame()
  2784. };
  2785. a.prototype.stop = function() {
  2786. this._isPlaying = !1;
  2787. c.Ticker.getInstance().unregister(this.update, this)
  2788. };
  2789. a.prototype.dispose = function() {};
  2790. a.prototype.checkHasFrame = function(b) {
  2791. void 0 == this._frameData.frames[b] && c.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", b)
  2792. };
  2793. a.prototype.update = function(b) {
  2794. for (var a = 1E3 / this.movieClip.frameRate,
  2795. a = Math.floor((this._passTime % a + b) / a); 1 <= a;) 1 == a ? this.playNextFrame() : this.playNextFrame(!1),
  2796. a--;
  2797. this._passTime += b
  2798. };
  2799. a.prototype.playNextFrame = function(b) {
  2800. "undefined" === typeof b && (b = !0);
  2801. var a = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  2802. if (b) {
  2803. b = this.getTexture(a.res);
  2804. var c = this.bitmap;
  2805. c.x = a.x;
  2806. c.y = a.y;
  2807. c.texture = b
  2808. }
  2809. null != a.action && this.movieClip.dispatchEventWith(a.action);
  2810. this._currentFrameIndex++;
  2811. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex = 0)
  2812. };
  2813. a.prototype.getTexture = function(b) {
  2814. var a = this._frameData.res[b],
  2815. c = this._spriteSheet.getTexture(b);
  2816. c || (c = this._spriteSheet.createTexture(b, a.x, a.y, a.w, a.h));
  2817. return c
  2818. };
  2819. return a
  2820. } ();
  2821. c.DefaultMovieClipDelegate = d
  2822. })(egret || (egret = {}));
  2823. __extends = this.__extends ||
  2824. function(c, e) {
  2825. function d() {
  2826. this.constructor = c
  2827. }
  2828. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2829. d.prototype = e.prototype;
  2830. c.prototype = new d
  2831. }; (function(c) {
  2832. var e = function(d) {
  2833. function a() {
  2834. d.call(this)
  2835. }
  2836. __extends(a, d);
  2837. a.prototype._getText = function() {
  2838. return this.inputElement.value
  2839. };
  2840. a.prototype._setText = function(b) {
  2841. this.inputElement.value = b
  2842. };
  2843. a.prototype._setTextType = function(b) {
  2844. this.inputElement.type = b
  2845. };
  2846. a.prototype._getTextType = function() {
  2847. return this.inputElement.type
  2848. };
  2849. a.prototype._open = function(b, a, d, e) {
  2850. "undefined" === typeof d && (d = 160);
  2851. "undefined" === typeof e && (e = 21);
  2852. var f = c.StageDelegate.getInstance().getScaleX(),
  2853. g = c.StageDelegate.getInstance().getScaleY(),
  2854. l = document.createElement("input");
  2855. l.type = "text";
  2856. l.style.fontSize = "20px";
  2857. l.style.color = "#FFFFFF";
  2858. l.style.borderStyle = "none";
  2859. l.style.background = "none";
  2860. l.style.width = d * f + "px";
  2861. l.style.height = e * g + "px";
  2862. l.style.outline = "medium";
  2863. var n = c.Browser.getInstance().$new("div");
  2864. n.style.position = "absolute";
  2865. n.position.x = b * f;
  2866. n.style.width = d * f + "px";
  2867. n.style.height = e * g + "px";
  2868. n.position.y = a * g;
  2869. n.transforms();
  2870. n.appendChild(l);
  2871. b = c.Browser.getInstance().$("#StageDelegateDiv");
  2872. b || (d = document.getElementById(c.StageDelegate.canvas_div_name), e = d.clientHeight, d = d.clientWidth, b = c.Browser.getInstance().$new("div"), b.id = "StageDelegateDiv", b.style.position = "absolute", b.style.width = d + "px", b.style.maxHeight = e + "px", b.style.margin = "0px", document.getElementById(c.StageDelegate.canvas_div_name).appendChild(b), b.position.y = -e, b.transforms());
  2873. b.appendChild(n);
  2874. this.div = n;
  2875. this.inputElement = l
  2876. };
  2877. a.prototype._remove = function() {
  2878. var b = this.div;
  2879. b && b.parentNode && b.parentNode.removeChild(b)
  2880. };
  2881. return a
  2882. } (c.HashObject);
  2883. c.StageText = e
  2884. })(egret || (egret = {})); (function(c) {
  2885. var e = function() {
  2886. function c() {}
  2887. c.GET = "GET";
  2888. c.POST = "POST";
  2889. return c
  2890. } ();
  2891. c.URLRequestMethod = e
  2892. })(egret || (egret = {})); (function(c) {
  2893. var e = function() {
  2894. function c() {}
  2895. c.BINARY = "binary";
  2896. c.TEXT = "text";
  2897. c.VARIABLES = "variables";
  2898. c.TEXTURE = "texture";
  2899. c.SOUND = "sound";
  2900. return c
  2901. } ();
  2902. c.URLLoaderDataFormat = e
  2903. })(egret || (egret = {}));
  2904. __extends = this.__extends ||
  2905. function(c, e) {
  2906. function d() {
  2907. this.constructor = c
  2908. }
  2909. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2910. d.prototype = e.prototype;
  2911. c.prototype = new d
  2912. }; (function(c) {
  2913. var e = function(c) {
  2914. function a(b) {
  2915. "undefined" === typeof b && (b = null);
  2916. c.call(this);
  2917. null !== b && this.decode(b)
  2918. }
  2919. __extends(a, c);
  2920. a.prototype.decode = function(b) {
  2921. this.variables || (this.variables = {});
  2922. b = b.split("+").join(" ");
  2923. for (var a, c = /[?&]?([^=]+)=([^&]*)/g; a = c.exec(b);) this.variables[decodeURIComponent(a[1])] = decodeURIComponent(a[2])
  2924. };
  2925. a.prototype.toString = function() {
  2926. if (!this.variables) return "";
  2927. var b = this.variables,
  2928. a = "",
  2929. c = !0,
  2930. d;
  2931. for (d in b) c ? c = !1 : a += "&",
  2932. a += d + "=" + b[d];
  2933. return a
  2934. };
  2935. return a
  2936. } (c.HashObject);
  2937. c.URLVariables = e
  2938. })(egret || (egret = {}));
  2939. __extends = this.__extends ||
  2940. function(c, e) {
  2941. function d() {
  2942. this.constructor = c
  2943. }
  2944. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2945. d.prototype = e.prototype;
  2946. c.prototype = new d
  2947. }; (function(c) {
  2948. var e = function(d) {
  2949. function a(b) {
  2950. "undefined" === typeof b && (b = null);
  2951. d.call(this);
  2952. this.method = c.URLRequestMethod.GET;
  2953. this.url = b
  2954. }
  2955. __extends(a, d);
  2956. return a
  2957. } (c.HashObject);
  2958. c.URLRequest = e
  2959. })(egret || (egret = {}));
  2960. __extends = this.__extends ||
  2961. function(c, e) {
  2962. function d() {
  2963. this.constructor = c
  2964. }
  2965. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2966. d.prototype = e.prototype;
  2967. c.prototype = new d
  2968. }; (function(c) {
  2969. var e = function(d) {
  2970. function a(b) {
  2971. "undefined" === typeof b && (b = null);
  2972. d.call(this);
  2973. this.dataFormat = c.URLLoaderDataFormat.TEXT;
  2974. b && this.load(b)
  2975. }
  2976. __extends(a, d);
  2977. a.prototype.load = function(b) {
  2978. this._request = b;
  2979. this.data = null;
  2980. c.MainContext.instance.netContext.proceed(this)
  2981. };
  2982. return a
  2983. } (c.EventDispatcher);
  2984. c.URLLoader = e
  2985. })(egret || (egret = {}));
  2986. __extends = this.__extends ||
  2987. function(c, e) {
  2988. function d() {
  2989. this.constructor = c
  2990. }
  2991. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2992. d.prototype = e.prototype;
  2993. c.prototype = new d
  2994. }; (function(c) {
  2995. var e = function(d) {
  2996. function a() {
  2997. d.call(this);
  2998. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  2999. }
  3000. __extends(a, d);
  3001. Object.defineProperty(a.prototype, "textureWidth", {
  3002. get: function() {
  3003. return this._textureWidth
  3004. },
  3005. enumerable: !0,
  3006. configurable: !0
  3007. });
  3008. Object.defineProperty(a.prototype, "textureHeight", {
  3009. get: function() {
  3010. return this._textureHeight
  3011. },
  3012. enumerable: !0,
  3013. configurable: !0
  3014. });
  3015. Object.defineProperty(a.prototype, "bitmapData", {
  3016. get: function() {
  3017. return this._bitmapData
  3018. },
  3019. enumerable: !0,
  3020. configurable: !0
  3021. });
  3022. a.prototype._setBitmapData = function(b) {
  3023. var a = c.MainContext.instance.rendererContext.texture_scale_factor;
  3024. this._bitmapData = b;
  3025. this._sourceWidth = b.width;
  3026. this._sourceHeight = b.height;
  3027. this._textureWidth = this._sourceWidth * a;
  3028. this._textureHeight = this._sourceHeight * a;
  3029. this._bitmapWidth = this._textureWidth;
  3030. this._bitmapHeight = this._textureHeight;
  3031. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  3032. };
  3033. a.prototype.getPixel32 = function(b, a) {
  3034. return this._bitmapData.getContext("2d").getImageData(b, a, 1, 1).data
  3035. };
  3036. return a
  3037. } (c.HashObject);
  3038. c.Texture = e
  3039. })(egret || (egret = {}));
  3040. __extends = this.__extends ||
  3041. function(c, e) {
  3042. function d() {
  3043. this.constructor = c
  3044. }
  3045. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3046. d.prototype = e.prototype;
  3047. c.prototype = new d
  3048. }; (function(c) {
  3049. var e = function(d) {
  3050. function a() {
  3051. d.call(this);
  3052. this._bitmapData = document.createElement("canvas");
  3053. this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
  3054. }
  3055. __extends(a, d);
  3056. a.prototype.drawToTexture = function(b) {
  3057. var a = this._bitmapData,
  3058. d = b.getBounds(c.Rectangle.identity);
  3059. a.width = d.width;
  3060. a.height = d.height;
  3061. b._worldTransform.identity();
  3062. b.worldAlpha = 1;
  3063. if (b instanceof c.DisplayObjectContainer) {
  3064. this._offsetX = d.x;
  3065. this._offsetY = d.y;
  3066. b._worldTransform.append(1, 0, 0, 1, -d.x, -d.y);
  3067. for (var a = b._children,
  3068. d = 0,
  3069. e = a.length; d < e; d++) a[d]._updateTransform()
  3070. }
  3071. a = c.RenderFilter.getInstance();
  3072. d = a._drawAreaList.concat();
  3073. a._drawAreaList.length = 0;
  3074. this.renderContext.clearScreen();
  3075. b._render(this.renderContext);
  3076. a._drawAreaList = d;
  3077. this._textureWidth = this._bitmapData.width;
  3078. this._textureHeight = this._bitmapData.height;
  3079. this._sourceWidth = this._textureWidth;
  3080. this._sourceHeight = this._textureHeight
  3081. };
  3082. return a
  3083. } (c.Texture);
  3084. c.RenderTexture = e
  3085. })(egret || (egret = {}));
  3086. __extends = this.__extends ||
  3087. function(c, e) {
  3088. function d() {
  3089. this.constructor = c
  3090. }
  3091. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3092. d.prototype = e.prototype;
  3093. c.prototype = new d
  3094. }; (function(c) {
  3095. var e = function(d) {
  3096. function a() {
  3097. d.call(this);
  3098. this.renderCost = 0;
  3099. this.texture_scale_factor = 1
  3100. }
  3101. __extends(a, d);
  3102. a.prototype.clearScreen = function() {};
  3103. a.prototype.clearRect = function(b, a, c, d) {};
  3104. a.prototype.drawImage = function(b, a, d, e, f, g, l, n, p) {
  3105. c.Profiler.getInstance().onDrawImage()
  3106. };
  3107. a.prototype.setTransform = function(b) {};
  3108. a.prototype.setAlpha = function(b, a) {};
  3109. a.prototype.setupFont = function(b) {};
  3110. a.prototype.measureText = function(b) {
  3111. return 0
  3112. };
  3113. a.prototype.drawText = function(b, a, d, e, f) {
  3114. c.Profiler.getInstance().onDrawImage()
  3115. };
  3116. a.prototype.strokeRect = function(b, a, c, d, e) {};
  3117. a.prototype.pushMask = function(b) {};
  3118. a.prototype.popMask = function() {};
  3119. a.createRendererContext = function(b) {
  3120. return null
  3121. };
  3122. return a
  3123. } (c.HashObject);
  3124. c.RendererContext = e;
  3125. e = function() {
  3126. function d(a) {
  3127. this.type = a;
  3128. switch (a) {
  3129. case "add":
  3130. case "layer":
  3131. this.value = "lighter";
  3132. break;
  3133. default:
  3134. this.value = "source-over"
  3135. }
  3136. }
  3137. d.getBlendMode = function(a) {
  3138. return a ? c.BlendMode[a.toUpperCase()] : c.BlendMode.NORMAL
  3139. };
  3140. d.NORMAL = new d("normal");
  3141. d.ADD = new d("add");
  3142. d.LAYER = new d("layer");
  3143. return d
  3144. } ();
  3145. c.BlendMode = e
  3146. })(egret || (egret = {})); (function(c) {
  3147. var e = function() {
  3148. function c() {}
  3149. c.MOUSE = "mouse";
  3150. c.TOUCH = "touch";
  3151. c.mode = "touch";
  3152. return c
  3153. } ();
  3154. c.InteractionMode = e
  3155. })(egret || (egret = {}));
  3156. __extends = this.__extends ||
  3157. function(c, e) {
  3158. function d() {
  3159. this.constructor = c
  3160. }
  3161. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3162. d.prototype = e.prototype;
  3163. c.prototype = new d
  3164. }; (function(c) {
  3165. var e = function(d) {
  3166. function a() {
  3167. d.call(this);
  3168. this._currentTouchTarget = {};
  3169. this.maxTouches = 2;
  3170. this.touchDownTarget = {};
  3171. this.lastTouchY = this.lastTouchX = -1
  3172. }
  3173. __extends(a, d);
  3174. a.prototype.run = function() {};
  3175. a.prototype.getTouchData = function(b, a, c) {
  3176. var d = this._currentTouchTarget[b];
  3177. null == d && (d = {},
  3178. this._currentTouchTarget[b] = d);
  3179. d.stageX = a;
  3180. d.stageY = c;
  3181. d.identifier = b;
  3182. return d
  3183. };
  3184. a.prototype.dispatchEvent = function(b, a) {
  3185. c.TouchEvent.dispatchTouchEvent(a.target, b, a.identifier, a.stageX, a.stageY, !1, !1, !1, !0 == this.touchDownTarget[a.identifier])
  3186. };
  3187. a.prototype.onTouchBegan = function(b, a, d) {
  3188. var e = c.MainContext.instance.stage.hitTest(b, a);
  3189. e && (b = this.getTouchData(d, b, a), this.touchDownTarget[d] = !0, b.target = e, b.beginTarget = e, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, b))
  3190. };
  3191. a.prototype.onTouchMove = function(b, a, d) {
  3192. if (b != this.lastTouchX || a != this.lastTouchY) {
  3193. this.lastTouchX = b;
  3194. this.lastTouchY = a;
  3195. var e = c.MainContext.instance.stage.hitTest(b, a);
  3196. e && (b = this.getTouchData(d, b, a), b.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE, b))
  3197. }
  3198. };
  3199. a.prototype.onTouchEnd = function(b, a, d) {
  3200. var e = c.MainContext.instance.stage.hitTest(b, a);
  3201. e && (b = this.getTouchData(d, b, a), delete this.touchDownTarget[d], d = b.beginTarget, b.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_END, b), d == e ? this.dispatchEvent(c.TouchEvent.TOUCH_TAP, b) : b.beginTarget && (b.target = b.beginTarget, this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE, b)), delete this._currentTouchTarget[b.identifier])
  3202. };
  3203. return a
  3204. } (c.HashObject);
  3205. c.TouchContext = e
  3206. })(egret || (egret = {}));
  3207. __extends = this.__extends ||
  3208. function(c, e) {
  3209. function d() {
  3210. this.constructor = c
  3211. }
  3212. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3213. d.prototype = e.prototype;
  3214. c.prototype = new d
  3215. }; (function(c) {
  3216. var e = function(c) {
  3217. function a() {
  3218. c.call(this)
  3219. }
  3220. __extends(a, c);
  3221. a.prototype.proceed = function(b) {};
  3222. return a
  3223. } (c.HashObject);
  3224. c.NetContext = e
  3225. })(egret || (egret = {}));
  3226. __extends = this.__extends ||
  3227. function(c, e) {
  3228. function d() {
  3229. this.constructor = c
  3230. }
  3231. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3232. d.prototype = e.prototype;
  3233. c.prototype = new d
  3234. }; (function(c) {
  3235. var e = function(c) {
  3236. function a() {
  3237. c.call(this);
  3238. this.frameRate = 60
  3239. }
  3240. __extends(a, c);
  3241. a.prototype.executeMainLoop = function(b, a) {};
  3242. return a
  3243. } (c.HashObject);
  3244. c.DeviceContext = e
  3245. })(egret || (egret = {}));
  3246. __extends = this.__extends ||
  3247. function(c, e) {
  3248. function d() {
  3249. this.constructor = c
  3250. }
  3251. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3252. d.prototype = e.prototype;
  3253. c.prototype = new d
  3254. }; (function(c) {
  3255. var e = function(d) {
  3256. function a() {
  3257. d.call(this);
  3258. this.translate = this.isHD ?
  3259. function(b) {
  3260. return "translate3d(" + b.x + "px, " + (b.y - c.MainContext.instance.stage.stageHeight) + "px, 0) "
  3261. }: function(b) {
  3262. console.log("translate(" + b.x + "px, " + b.y + "px) ");
  3263. return "translate(" + b.x + "px, " + b.y + "px) "
  3264. };
  3265. this.rotate = this.isHD ?
  3266. function(b) {
  3267. return "rotateZ(" + b + "deg) "
  3268. }: function(b) {
  3269. return "rotate(" + b + "deg) "
  3270. };
  3271. this.ua = navigator.userAgent.toLowerCase();
  3272. var b = this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/) || this.ua.match(/chrome|safari/);
  3273. b && 0 < b.length && (b = b[0], "micromessenger" == b && (this.type = "wechat"), this.type = b);
  3274. this.type = "unknow";
  3275. switch (this.type) {
  3276. case "firefox":
  3277. this.pfx = "Moz";
  3278. this.isHD = !0;
  3279. break;
  3280. case "chrome":
  3281. case "safari":
  3282. this.pfx = "webkit";
  3283. this.isHD = !0;
  3284. break;
  3285. case "opera":
  3286. this.pfx = "O";
  3287. this.isHD = !1;
  3288. break;
  3289. case "ie":
  3290. this.pfx = "ms";
  3291. this.isHD = !1;
  3292. break;
  3293. default:
  3294. this.pfx = "webkit",
  3295. this.isHD = !0
  3296. }
  3297. this.trans = this.pfx + "Transform";
  3298. this.isMobile = -1 != this.ua.indexOf("mobile") || -1 != this.ua.indexOf("android")
  3299. }
  3300. __extends(a, d);
  3301. a.getInstance = function() {
  3302. null == a.instance && (a.instance = new a);
  3303. return a.instance
  3304. };
  3305. a.prototype.$new = function(b) {
  3306. return this.$(document.createElement(b))
  3307. };
  3308. a.prototype.$ = function(b) {
  3309. var h = document;
  3310. if (b = b instanceof HTMLElement ? b: h.querySelector(b)) b.find = b.find || this.$,
  3311. b.hasClass = b.hasClass ||
  3312. function(b) {
  3313. return this.className.match(new RegExp("(\\s|^)" + b + "(\\s|$)"))
  3314. },
  3315. b.addClass = b.addClass ||
  3316. function(b) {
  3317. this.hasClass(b) || (this.className && (this.className += " "), this.className += b);
  3318. return this
  3319. },
  3320. b.removeClass = b.removeClass ||
  3321. function(b) {
  3322. this.hasClass(b) && (this.className = this.className.replace(b, ""));
  3323. return this
  3324. },
  3325. b.remove = b.remove ||
  3326. function() {},
  3327. b.appendTo = b.appendTo ||
  3328. function(b) {
  3329. b.appendChild(this);
  3330. return this
  3331. },
  3332. b.prependTo = b.prependTo ||
  3333. function(b) {
  3334. b.childNodes[0] ? b.insertBefore(this, b.childNodes[0]) : b.appendChild(this);
  3335. return this
  3336. },
  3337. b.transforms = b.transforms ||
  3338. function() {
  3339. this.style[a.getInstance().trans] = a.getInstance().translate(this.position) + a.getInstance().rotate(this.rotation) + a.getInstance().scale(this.scale) + a.getInstance().skew(this.skew);
  3340. return this
  3341. },
  3342. b.position = b.position || {
  3343. x: 0,
  3344. y: 0
  3345. },
  3346. b.rotation = b.rotation || 0,
  3347. b.scale = b.scale || {
  3348. x: 1,
  3349. y: 1
  3350. },
  3351. b.skew = b.skew || {
  3352. x: 0,
  3353. y: 0
  3354. },
  3355. b.translates = function(b, a) {
  3356. this.position.x = b;
  3357. this.position.y = a - c.MainContext.instance.stage.stageHeight;
  3358. this.transforms();
  3359. return this
  3360. },
  3361. b.rotate = function(b) {
  3362. this.rotation = b;
  3363. this.transforms();
  3364. return this
  3365. },
  3366. b.resize = function(b, a) {
  3367. this.scale.x = b;
  3368. this.scale.y = a;
  3369. this.transforms();
  3370. return this
  3371. },
  3372. b.setSkew = function(b, a) {
  3373. this.skew.x = b;
  3374. this.skew.y = a;
  3375. this.transforms();
  3376. return this
  3377. };
  3378. return b
  3379. };
  3380. a.prototype.scale = function(b) {
  3381. return "scale(" + b.x + ", " + b.y + ") "
  3382. };
  3383. a.prototype.skew = function(b) {
  3384. return "skewX(" + -b.x + "deg) skewY(" + b.y + "deg)"
  3385. };
  3386. return a
  3387. } (c.HashObject);
  3388. c.Browser = e
  3389. })(egret || (egret = {}));
  3390. egret.Codec = {
  3391. name: "Jacob__Codec"
  3392. };
  3393. egret.Utils = {};
  3394. egret.Utils.unzip = function() {
  3395. return egret.Codec.GZip.gunzip.apply(egret.Codec.GZip, arguments)
  3396. };
  3397. egret.Utils.unzipBase64 = function() {
  3398. var c = egret.Codec.Base64.decode.apply(egret.Codec.Base64, arguments);
  3399. return egret.Codec.GZip.gunzip.apply(egret.Codec.GZip, [c])
  3400. };
  3401. egret.Utils.unzipBase64AsArray = function(c, e) {
  3402. e = e || 1;
  3403. var d = this.unzipBase64(c),
  3404. a = [],
  3405. b,
  3406. h,
  3407. m;
  3408. b = 0;
  3409. for (m = d.length / e; b < m; b++) for (a[b] = 0, h = e - 1; 0 <= h; --h) a[b] += d.charCodeAt(b * e + h) << 8 * h;
  3410. return a
  3411. };
  3412. egret.Utils.unzipAsArray = function(c, e) {
  3413. e = e || 1;
  3414. var d = this.unzip(c),
  3415. a = [],
  3416. b,
  3417. h,
  3418. m;
  3419. b = 0;
  3420. for (m = d.length / e; b < m; b++) for (a[b] = 0, h = e - 1; 0 <= h; --h) a[b] += d.charCodeAt(b * e + h) << 8 * h;
  3421. return a
  3422. };
  3423. egret.Utils.StringToArray = function(c) {
  3424. c = c.split(",");
  3425. var e = [],
  3426. d;
  3427. for (d = 0; d < c.length; d++) e.push(parseInt(c[d]));
  3428. return e
  3429. };
  3430. egret.Codec.Base64 = {
  3431. name: "Jacob__Codec__Base64"
  3432. };
  3433. egret.Codec.Base64._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  3434. egret.Codec.Base64.decode = function(c) {
  3435. var e = [],
  3436. d,
  3437. a,
  3438. b,
  3439. h,
  3440. m,
  3441. k = 0;
  3442. for (c = c.replace(/[^A-Za-z0-9\+\/\=]/g, ""); k < c.length;) d = this._keyStr.indexOf(c.charAt(k++)),
  3443. a = this._keyStr.indexOf(c.charAt(k++)),
  3444. h = this._keyStr.indexOf(c.charAt(k++)),
  3445. m = this._keyStr.indexOf(c.charAt(k++)),
  3446. d = d << 2 | a >> 4,
  3447. a = (a & 15) << 4 | h >> 2,
  3448. b = (h & 3) << 6 | m,
  3449. e.push(String.fromCharCode(d)),
  3450. 64 != h && e.push(String.fromCharCode(a)),
  3451. 64 != m && e.push(String.fromCharCode(b));
  3452. return e = e.join("")
  3453. };
  3454. egret.Codec.Base64.decodeAsArray = function(c, e) {
  3455. var d = this.decode(c),
  3456. a = [],
  3457. b,
  3458. h,
  3459. m;
  3460. b = 0;
  3461. for (m = d.length / e; b < m; b++) for (a[b] = 0, h = e - 1; 0 <= h; --h) a[b] += d.charCodeAt(b * e + h) << 8 * h;
  3462. return a
  3463. };
  3464. egret.Utils.uint8ArrayToUint32Array = function(c) {
  3465. if (0 != c.length % 4) return null;
  3466. for (var e = c.length / 4,
  3467. d = window.Uint32Array ? new Uint32Array(e) : [], a = 0; a < e; a++) {
  3468. var b = 4 * a;
  3469. d[a] = c[b] + 256 * c[b + 1] + 65536 * c[b + 2] + 16777216 * c[b + 3]
  3470. }
  3471. return d
  3472. };
  3473. egret.Codec.GZip = function(c) {
  3474. this.data = c;
  3475. this.debug = !1;
  3476. this.gpflags = void 0;
  3477. this.files = 0;
  3478. this.unzipped = [];
  3479. this.buf32k = Array(32768);
  3480. this.bIdx = 0;
  3481. this.modeZIP = !1;
  3482. this.bytepos = 0;
  3483. this.bb = 1;
  3484. this.bits = 0;
  3485. this.nameBuf = [];
  3486. this.fileout = void 0;
  3487. this.literalTree = Array(egret.Codec.GZip.LITERALS);
  3488. this.distanceTree = Array(32);
  3489. this.treepos = 0;
  3490. this.Places = null;
  3491. this.len = 0;
  3492. this.fpos = Array(17);
  3493. this.fpos[0] = 0;
  3494. this.fmax = this.flens = void 0
  3495. };
  3496. egret.Codec.GZip.gunzip = function(c) {
  3497. return (new egret.Codec.GZip(c)).gunzip()[0][0]
  3498. };
  3499. egret.Codec.GZip.HufNode = function() {
  3500. this.b1 = this.b0 = 0;
  3501. this.jump = null;
  3502. this.jumppos = -1
  3503. };
  3504. egret.Codec.GZip.LITERALS = 288;
  3505. egret.Codec.GZip.NAMEMAX = 256;
  3506. egret.Codec.GZip.bitReverse = [0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254, 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241, 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249, 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245, 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253, 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243, 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251, 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247, 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255];
  3507. egret.Codec.GZip.cplens = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0];
  3508. egret.Codec.GZip.cplext = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99];
  3509. egret.Codec.GZip.cpdist = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
  3510. egret.Codec.GZip.cpdext = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
  3511. egret.Codec.GZip.border = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  3512. egret.Codec.GZip.prototype.gunzip = function() {
  3513. this.outputArr = [];
  3514. this.nextFile();
  3515. return this.unzipped
  3516. };
  3517. egret.Codec.GZip.prototype.readByte = function() {
  3518. this.bits += 8;
  3519. return this.bytepos < this.data.length ? this.data.charCodeAt(this.bytepos++) : -1
  3520. };
  3521. egret.Codec.GZip.prototype.byteAlign = function() {
  3522. this.bb = 1
  3523. };
  3524. egret.Codec.GZip.prototype.readBit = function() {
  3525. var c;
  3526. this.bits++;
  3527. c = this.bb & 1;
  3528. this.bb >>= 1;
  3529. 0 == this.bb && (this.bb = this.readByte(), c = this.bb & 1, this.bb = this.bb >> 1 | 128);
  3530. return c
  3531. };
  3532. egret.Codec.GZip.prototype.readBits = function(c) {
  3533. for (var e = 0,
  3534. d = c; d--;) e = e << 1 | this.readBit();
  3535. c && (e = egret.Codec.GZip.bitReverse[e] >> 8 - c);
  3536. return e
  3537. };
  3538. egret.Codec.GZip.prototype.flushBuffer = function() {
  3539. this.bIdx = 0
  3540. };
  3541. egret.Codec.GZip.prototype.addBuffer = function(c) {
  3542. this.buf32k[this.bIdx++] = c;
  3543. this.outputArr.push(String.fromCharCode(c));
  3544. 32768 == this.bIdx && (this.bIdx = 0)
  3545. };
  3546. egret.Codec.GZip.prototype.IsPat = function() {
  3547. for (;;) {
  3548. if (this.fpos[this.len] >= this.fmax) return - 1;
  3549. if (this.flens[this.fpos[this.len]] == this.len) return this.fpos[this.len]++;
  3550. this.fpos[this.len]++
  3551. }
  3552. };
  3553. egret.Codec.GZip.prototype.Rec = function() {
  3554. var c = this.Places[this.treepos],
  3555. e;
  3556. if (17 == this.len) return - 1;
  3557. this.treepos++;
  3558. this.len++;
  3559. e = this.IsPat();
  3560. if (0 <= e) c.b0 = e;
  3561. else if (c.b0 = 32768, this.Rec()) return - 1;
  3562. e = this.IsPat();
  3563. if (0 <= e) c.b1 = e,
  3564. c.jump = null;
  3565. else if (c.b1 = 32768, c.jump = this.Places[this.treepos], c.jumppos = this.treepos, this.Rec()) return - 1;
  3566. this.len--;
  3567. return 0
  3568. };
  3569. egret.Codec.GZip.prototype.CreateTree = function(c, e, d, a) {
  3570. this.Places = c;
  3571. this.treepos = 0;
  3572. this.flens = d;
  3573. this.fmax = e;
  3574. for (c = 0; 17 > c; c++) this.fpos[c] = 0;
  3575. this.len = 0;
  3576. return this.Rec() ? -1 : 0
  3577. };
  3578. egret.Codec.GZip.prototype.DecodeValue = function(c) {
  3579. for (var e, d, a = 0,
  3580. b = c[a];;) if (e = this.readBit()) {
  3581. if (! (b.b1 & 32768)) return b.b1;
  3582. b = b.jump;
  3583. e = c.length;
  3584. for (d = 0; d < e; d++) if (c[d] === b) {
  3585. a = d;
  3586. break
  3587. }
  3588. } else {
  3589. if (! (b.b0 & 32768)) return b.b0;
  3590. a++;
  3591. b = c[a]
  3592. }
  3593. return - 1
  3594. };
  3595. egret.Codec.GZip.prototype.DeflateLoop = function() {
  3596. var c, e, d, a, b;
  3597. do
  3598. if (c = this.readBit(), d = this.readBits(2), 0 == d) for (this.byteAlign(), d = this.readByte(), d |= this.readByte() << 8, e = this.readByte(), e |= this.readByte() << 8, (d ^ ~e) & 65535 && document.write("BlockLen checksum mismatch\n"); d--;) e = this.readByte(),
  3599. this.addBuffer(e);
  3600. else if (1 == d) for (;;) if (d = egret.Codec.GZip.bitReverse[this.readBits(7)] >> 1, 23 < d ? (d = d << 1 | this.readBit(), 199 < d ? (d -= 128, d = d << 1 | this.readBit()) : (d -= 48, 143 < d && (d += 136))) : d += 256, 256 > d) this.addBuffer(d);
  3601. else if (256 == d) break;
  3602. else {
  3603. var h;
  3604. d -= 257;
  3605. b = this.readBits(egret.Codec.GZip.cplext[d]) + egret.Codec.GZip.cplens[d];
  3606. d = egret.Codec.GZip.bitReverse[this.readBits(5)] >> 3;
  3607. 8 < egret.Codec.GZip.cpdext[d] ? (h = this.readBits(8), h |= this.readBits(egret.Codec.GZip.cpdext[d] - 8) << 8) : h = this.readBits(egret.Codec.GZip.cpdext[d]);
  3608. h += egret.Codec.GZip.cpdist[d];
  3609. for (d = 0; d < b; d++) e = this.buf32k[this.bIdx - h & 32767],
  3610. this.addBuffer(e)
  3611. } else if (2 == d) {
  3612. var m = Array(320);
  3613. e = 257 + this.readBits(5);
  3614. h = 1 + this.readBits(5);
  3615. a = 4 + this.readBits(4);
  3616. for (d = 0; 19 > d; d++) m[d] = 0;
  3617. for (d = 0; d < a; d++) m[egret.Codec.GZip.border[d]] = this.readBits(3);
  3618. b = this.distanceTree.length;
  3619. for (a = 0; a < b; a++) this.distanceTree[a] = new egret.Codec.GZip.HufNode;
  3620. if (this.CreateTree(this.distanceTree, 19, m, 0)) return this.flushBuffer(),
  3621. 1;
  3622. b = e + h;
  3623. a = 0;
  3624. for (var k = -1; a < b;) if (k++, d = this.DecodeValue(this.distanceTree), 16 > d) m[a++] = d;
  3625. else if (16 == d) {
  3626. var f;
  3627. d = 3 + this.readBits(2);
  3628. if (a + d > b) return this.flushBuffer(),
  3629. 1;
  3630. for (f = a ? m[a - 1] : 0; d--;) m[a++] = f
  3631. } else {
  3632. d = 17 == d ? 3 + this.readBits(3) : 11 + this.readBits(7);
  3633. if (a + d > b) return this.flushBuffer(),
  3634. 1;
  3635. for (; d--;) m[a++] = 0
  3636. }
  3637. b = this.literalTree.length;
  3638. for (a = 0; a < b; a++) this.literalTree[a] = new egret.Codec.GZip.HufNode;
  3639. if (this.CreateTree(this.literalTree, e, m, 0)) return this.flushBuffer(),
  3640. 1;
  3641. b = this.literalTree.length;
  3642. for (a = 0; a < b; a++) this.distanceTree[a] = new egret.Codec.GZip.HufNode;
  3643. d = [];
  3644. for (a = e; a < m.length; a++) d[a - e] = m[a];
  3645. if (this.CreateTree(this.distanceTree, h, d, 0)) return this.flushBuffer(),
  3646. 1;
  3647. for (;;) if (d = this.DecodeValue(this.literalTree), 256 <= d) {
  3648. d -= 256;
  3649. if (0 == d) break;
  3650. d--;
  3651. b = this.readBits(egret.Codec.GZip.cplext[d]) + egret.Codec.GZip.cplens[d];
  3652. d = this.DecodeValue(this.distanceTree);
  3653. 8 < egret.Codec.GZip.cpdext[d] ? (h = this.readBits(8), h |= this.readBits(egret.Codec.GZip.cpdext[d] - 8) << 8) : h = this.readBits(egret.Codec.GZip.cpdext[d]);
  3654. for (h += egret.Codec.GZip.cpdist[d]; b--;) e = this.buf32k[this.bIdx - h & 32767],
  3655. this.addBuffer(e)
  3656. } else this.addBuffer(d)
  3657. }
  3658. while (!c);
  3659. this.flushBuffer();
  3660. this.byteAlign();
  3661. return 0
  3662. };
  3663. egret.Codec.GZip.prototype.unzipFile = function(c) {
  3664. var e;
  3665. this.gunzip();
  3666. for (e = 0; e < this.unzipped.length; e++) if (this.unzipped[e][1] == c) return this.unzipped[e][0]
  3667. };
  3668. egret.Codec.GZip.prototype.nextFile = function() {
  3669. this.outputArr = [];
  3670. this.modeZIP = !1;
  3671. var c = [];
  3672. c[0] = this.readByte();
  3673. c[1] = this.readByte();
  3674. 120 == c[0] && 218 == c[1] && (this.DeflateLoop(), this.unzipped[this.files] = [this.outputArr.join(""), "geonext.gxt"], this.files++);
  3675. 31 == c[0] && 139 == c[1] && (this.skipdir(), this.unzipped[this.files] = [this.outputArr.join(""), "file"], this.files++);
  3676. if (80 == c[0] && 75 == c[1] && (this.modeZIP = !0, c[2] = this.readByte(), c[3] = this.readByte(), 3 == c[2] && 4 == c[3])) {
  3677. c[0] = this.readByte();
  3678. c[1] = this.readByte();
  3679. this.gpflags = this.readByte();
  3680. this.gpflags |= this.readByte() << 8;
  3681. c = this.readByte();
  3682. c |= this.readByte() << 8;
  3683. this.readByte();
  3684. this.readByte();
  3685. this.readByte();
  3686. this.readByte();
  3687. this.readByte();
  3688. this.readByte();
  3689. this.readByte();
  3690. this.readByte();
  3691. this.readByte();
  3692. this.readByte();
  3693. this.readByte();
  3694. this.readByte();
  3695. var e = this.readByte(),
  3696. e = e | this.readByte() << 8,
  3697. d = this.readByte(),
  3698. d = d | this.readByte() << 8,
  3699. a = 0;
  3700. for (this.nameBuf = []; e--;) {
  3701. var b = this.readByte();
  3702. "/" == b | ":" == b ? a = 0 : a < egret.Codec.GZip.NAMEMAX - 1 && (this.nameBuf[a++] = String.fromCharCode(b))
  3703. }
  3704. this.fileout || (this.fileout = this.nameBuf);
  3705. for (var a = 0; a < d;) this.readByte(),
  3706. a++;
  3707. 8 == c && (this.DeflateLoop(), this.unzipped[this.files] = [this.outputArr.join(""), this.nameBuf.join("")], this.files++);
  3708. this.skipdir()
  3709. }
  3710. };
  3711. egret.Codec.GZip.prototype.skipdir = function() {
  3712. var c = [],
  3713. e;
  3714. this.gpflags & 8 && (c[0] = this.readByte(), c[1] = this.readByte(), c[2] = this.readByte(), c[3] = this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte());
  3715. this.modeZIP && this.nextFile();
  3716. c[0] = this.readByte();
  3717. if (8 != c[0]) return 0;
  3718. this.gpflags = this.readByte();
  3719. this.readByte();
  3720. this.readByte();
  3721. this.readByte();
  3722. this.readByte();
  3723. this.readByte();
  3724. this.readByte();
  3725. if (this.gpflags & 4) for (c[0] = this.readByte(), c[2] = this.readByte(), this.len = c[0] + 256 * c[1], c = 0; c < this.len; c++) this.readByte();
  3726. if (this.gpflags & 8) for (c = 0, this.nameBuf = []; e = this.readByte();) {
  3727. if ("7" == e || ":" == e) c = 0;
  3728. c < egret.Codec.GZip.NAMEMAX - 1 && (this.nameBuf[c++] = e)
  3729. }
  3730. if (this.gpflags & 16) for (; this.readByte(););
  3731. this.gpflags & 2 && (this.readByte(), this.readByte());
  3732. this.DeflateLoop();
  3733. this.readByte();
  3734. this.readByte();
  3735. this.readByte();
  3736. this.readByte();
  3737. this.modeZIP && this.nextFile()
  3738. }; (function() {
  3739. function c(b) {
  3740. throw b;
  3741. }
  3742. function e(b, a) {
  3743. var c = b.split("."),
  3744. h = C;
  3745. c[0] in h || !h.execScript || h.execScript("var " + c[0]);
  3746. for (var d; c.length && (d = c.shift());) c.length || a === v ? h = h[d] ? h[d] : h[d] = {}: h[d] = a
  3747. }
  3748. function d(b) {
  3749. if ("string" === typeof b) {
  3750. b = b.split("");
  3751. var a, c;
  3752. a = 0;
  3753. for (c = b.length; a < c; a++) b[a] = (b[a].charCodeAt(0) & 255) >>> 0
  3754. }
  3755. a = 1;
  3756. c = 0;
  3757. for (var h = b.length,
  3758. d, m = 0; 0 < h;) {
  3759. d = 1024 < h ? 1024 : h;
  3760. h -= d;
  3761. do a += b[m++],
  3762. c += a;
  3763. while (--d);
  3764. a %= 65521;
  3765. c %= 65521
  3766. }
  3767. return (c << 16 | a) >>> 0
  3768. }
  3769. function a(b, a) {
  3770. this.index = "number" === typeof a ? a: 0;
  3771. this.i = 0;
  3772. this.buffer = b instanceof(t ? Uint8Array: Array) ? b: new(t ? Uint8Array: Array)(32768);
  3773. 2 * this.buffer.length <= this.index && c(Error("invalid index"));
  3774. this.buffer.length <= this.index && this.f()
  3775. }
  3776. function b(b) {
  3777. this.buffer = new(t ? Uint16Array: Array)(2 * b);
  3778. this.length = 0
  3779. }
  3780. function h(b) {
  3781. var a = b.length,
  3782. c = 0,
  3783. h = Number.POSITIVE_INFINITY,
  3784. d, m, e, k, f, g, l, p, r;
  3785. for (p = 0; p < a; ++p) b[p] > c && (c = b[p]),
  3786. b[p] < h && (h = b[p]);
  3787. d = 1 << c;
  3788. m = new(t ? Uint32Array: Array)(d);
  3789. e = 1;
  3790. k = 0;
  3791. for (f = 2; e <= c;) {
  3792. for (p = 0; p < a; ++p) if (b[p] === e) {
  3793. g = 0;
  3794. l = k;
  3795. for (r = 0; r < e; ++r) g = g << 1 | l & 1,
  3796. l >>= 1;
  3797. for (r = g; r < d; r += f) m[r] = e << 16 | p; ++k
  3798. }++e;
  3799. k <<= 1;
  3800. f <<= 1
  3801. }
  3802. return [m, c, h]
  3803. }
  3804. function m(b, a) {
  3805. this.h = H;
  3806. this.w = 0;
  3807. this.input = b;
  3808. this.b = 0;
  3809. a && (a.lazy && (this.w = a.lazy), "number" === typeof a.compressionType && (this.h = a.compressionType), a.outputBuffer && (this.a = t && a.outputBuffer instanceof Array ? new Uint8Array(a.outputBuffer) : a.outputBuffer), "number" === typeof a.outputIndex && (this.b = a.outputIndex));
  3810. this.a || (this.a = new(t ? Uint8Array: Array)(32768))
  3811. }
  3812. function k(b, a) {
  3813. this.length = b;
  3814. this.G = a
  3815. }
  3816. function f() {
  3817. var b = G;
  3818. switch (B) {
  3819. case 3 === b: return [257, b - 3, 0];
  3820. case 4 === b: return [258, b - 4, 0];
  3821. case 5 === b: return [259, b - 5, 0];
  3822. case 6 === b: return [260, b - 6, 0];
  3823. case 7 === b: return [261, b - 7, 0];
  3824. case 8 === b: return [262, b - 8, 0];
  3825. case 9 === b: return [263, b - 9, 0];
  3826. case 10 === b: return [264, b - 10, 0];
  3827. case 12 >= b: return [265, b - 11, 1];
  3828. case 14 >= b: return [266, b - 13, 1];
  3829. case 16 >= b: return [267, b - 15, 1];
  3830. case 18 >= b: return [268, b - 17, 1];
  3831. case 22 >= b: return [269, b - 19, 2];
  3832. case 26 >= b: return [270, b - 23, 2];
  3833. case 30 >= b: return [271, b - 27, 2];
  3834. case 34 >= b: return [272, b - 31, 2];
  3835. case 42 >= b: return [273, b - 35, 3];
  3836. case 50 >= b: return [274, b - 43, 3];
  3837. case 58 >= b: return [275, b - 51, 3];
  3838. case 66 >= b: return [276, b - 59, 3];
  3839. case 82 >= b: return [277, b - 67, 4];
  3840. case 98 >= b: return [278, b - 83, 4];
  3841. case 114 >= b: return [279, b - 99, 4];
  3842. case 130 >= b: return [280, b - 115, 4];
  3843. case 162 >= b: return [281, b - 131, 5];
  3844. case 194 >= b: return [282, b - 163, 5];
  3845. case 226 >= b: return [283, b - 195, 5];
  3846. case 257 >= b: return [284, b - 227, 5];
  3847. case 258 === b: return [285, b - 258, 0];
  3848. default:
  3849. c("invalid length: " + b)
  3850. }
  3851. }
  3852. function g(b, a) {
  3853. function h(b, a) {
  3854. var d = b.G,
  3855. e = [],
  3856. m = 0,
  3857. k;
  3858. k = M[b.length];
  3859. e[m++] = k & 65535;
  3860. e[m++] = k >> 16 & 255;
  3861. e[m++] = k >> 24;
  3862. var f;
  3863. switch (B) {
  3864. case 1 === d: f = [0, d - 1, 0];
  3865. break;
  3866. case 2 === d: f = [1, d - 2, 0];
  3867. break;
  3868. case 3 === d: f = [2, d - 3, 0];
  3869. break;
  3870. case 4 === d: f = [3, d - 4, 0];
  3871. break;
  3872. case 6 >= d: f = [4, d - 5, 1];
  3873. break;
  3874. case 8 >= d: f = [5, d - 7, 1];
  3875. break;
  3876. case 12 >= d: f = [6, d - 9, 2];
  3877. break;
  3878. case 16 >= d: f = [7, d - 13, 2];
  3879. break;
  3880. case 24 >= d: f = [8, d - 17, 3];
  3881. break;
  3882. case 32 >= d: f = [9, d - 25, 3];
  3883. break;
  3884. case 48 >= d: f = [10, d - 33, 4];
  3885. break;
  3886. case 64 >= d: f = [11, d - 49, 4];
  3887. break;
  3888. case 96 >= d: f = [12, d - 65, 5];
  3889. break;
  3890. case 128 >= d: f = [13, d - 97, 5];
  3891. break;
  3892. case 192 >= d: f = [14, d - 129, 6];
  3893. break;
  3894. case 256 >= d: f = [15, d - 193, 6];
  3895. break;
  3896. case 384 >= d: f = [16, d - 257, 7];
  3897. break;
  3898. case 512 >= d: f = [17, d - 385, 7];
  3899. break;
  3900. case 768 >= d: f = [18, d - 513, 8];
  3901. break;
  3902. case 1024 >= d: f = [19, d - 769, 8];
  3903. break;
  3904. case 1536 >= d: f = [20, d - 1025, 9];
  3905. break;
  3906. case 2048 >= d: f = [21, d - 1537, 9];
  3907. break;
  3908. case 3072 >= d: f = [22, d - 2049, 10];
  3909. break;
  3910. case 4096 >= d: f = [23, d - 3073, 10];
  3911. break;
  3912. case 6144 >= d: f = [24, d - 4097, 11];
  3913. break;
  3914. case 8192 >= d: f = [25, d - 6145, 11];
  3915. break;
  3916. case 12288 >= d: f = [26, d - 8193, 12];
  3917. break;
  3918. case 16384 >= d: f = [27, d - 12289, 12];
  3919. break;
  3920. case 24576 >= d: f = [28, d - 16385, 13];
  3921. break;
  3922. case 32768 >= d: f = [29, d - 24577, 13];
  3923. break;
  3924. default:
  3925. c("invalid distance")
  3926. }
  3927. k = f;
  3928. e[m++] = k[0];
  3929. e[m++] = k[1];
  3930. e[m++] = k[2];
  3931. d = 0;
  3932. for (m = e.length; d < m; ++d) r[q++] = e[d];
  3933. n[e[0]]++;
  3934. w[e[3]]++;
  3935. s = b.length + a - 1;
  3936. p = null
  3937. }
  3938. var d, m, e, f, g, l = {},
  3939. p, r = t ? new Uint16Array(2 * a.length) : [],
  3940. q = 0,
  3941. s = 0,
  3942. n = new(t ? Uint32Array: Array)(286),
  3943. w = new(t ? Uint32Array: Array)(30),
  3944. z = b.w,
  3945. A;
  3946. if (!t) {
  3947. for (e = 0; 285 >= e;) n[e++] = 0;
  3948. for (e = 0; 29 >= e;) w[e++] = 0
  3949. }
  3950. n[256] = 1;
  3951. d = 0;
  3952. for (m = a.length; d < m; ++d) {
  3953. e = g = 0;
  3954. for (f = 3; e < f && d + e !== m; ++e) g = g << 8 | a[d + e];
  3955. l[g] === v && (l[g] = []);
  3956. e = l[g];
  3957. if (! (0 < s--)) {
  3958. for (; 0 < e.length && 32768 < d - e[0];) e.shift();
  3959. if (d + 3 >= m) {
  3960. p && h(p, -1);
  3961. e = 0;
  3962. for (f = m - d; e < f; ++e) A = a[d + e],
  3963. r[q++] = A,
  3964. ++n[A];
  3965. break
  3966. }
  3967. if (0 < e.length) {
  3968. g = f = v;
  3969. var D = 0,
  3970. E = v,
  3971. x = v,
  3972. y = E = v,
  3973. u = a.length,
  3974. x = 0,
  3975. y = e.length;
  3976. a: for (; x < y; x++) {
  3977. f = e[y - x - 1];
  3978. E = 3;
  3979. if (3 < D) {
  3980. for (E = D; 3 < E; E--) if (a[f + E - 1] !== a[d + E - 1]) continue a;
  3981. E = D
  3982. }
  3983. for (; 258 > E && d + E < u && a[f + E] === a[d + E];)++E;
  3984. E > D && (g = f, D = E);
  3985. if (258 === E) break
  3986. }
  3987. f = new k(D, d - g);
  3988. p ? p.length < f.length ? (A = a[d - 1], r[q++] = A, ++n[A], h(f, 0)) : h(p, -1) : f.length < z ? p = f: h(f, 0)
  3989. } else p ? h(p, -1) : (A = a[d], r[q++] = A, ++n[A])
  3990. }
  3991. e.push(d)
  3992. }
  3993. r[q++] = 256;
  3994. n[256]++;
  3995. b.L = n;
  3996. b.K = w;
  3997. return t ? r.subarray(0, q) : r
  3998. }
  3999. function l(a, c) {
  4000. function h(b) {
  4001. var a = r[b][q[b]];
  4002. a === l ? (h(b + 1), h(b + 1)) : --p[a]; ++q[b]
  4003. }
  4004. var d = a.length,
  4005. e = new b(572),
  4006. m = new(t ? Uint8Array: Array)(d),
  4007. k,
  4008. f,
  4009. g;
  4010. if (!t) for (f = 0; f < d; f++) m[f] = 0;
  4011. for (f = 0; f < d; ++f) 0 < a[f] && e.push(f, a[f]);
  4012. d = Array(e.length / 2);
  4013. k = new(t ? Uint32Array: Array)(e.length / 2);
  4014. if (1 === d.length) return m[e.pop().index] = 1,
  4015. m;
  4016. f = 0;
  4017. for (g = e.length / 2; f < g; ++f) d[f] = e.pop(),
  4018. k[f] = d[f].value;
  4019. var l = k.length;
  4020. f = new(t ? Uint16Array: Array)(c);
  4021. var e = new(t ? Uint8Array: Array)(c),
  4022. p = new(t ? Uint8Array: Array)(l);
  4023. g = Array(c);
  4024. var r = Array(c),
  4025. q = Array(c),
  4026. s = (1 << c) - l,
  4027. n = 1 << c - 1,
  4028. w,
  4029. z,
  4030. v;
  4031. f[c - 1] = l;
  4032. for (w = 0; w < c; ++w) s < n ? e[w] = 0 : (e[w] = 1, s -= n),
  4033. s <<= 1,
  4034. f[c - 2 - w] = (f[c - 1 - w] / 2 | 0) + l;
  4035. f[0] = e[0];
  4036. g[0] = Array(f[0]);
  4037. r[0] = Array(f[0]);
  4038. for (w = 1; w < c; ++w) f[w] > 2 * f[w - 1] + e[w] && (f[w] = 2 * f[w - 1] + e[w]),
  4039. g[w] = Array(f[w]),
  4040. r[w] = Array(f[w]);
  4041. for (s = 0; s < l; ++s) p[s] = c;
  4042. for (n = 0; n < f[c - 1]; ++n) g[c - 1][n] = k[n],
  4043. r[c - 1][n] = n;
  4044. for (s = 0; s < c; ++s) q[s] = 0;
  4045. 1 === e[c - 1] && (--p[0], ++q[c - 1]);
  4046. for (w = c - 2; 0 <= w; --w) {
  4047. z = s = 0;
  4048. v = q[w + 1];
  4049. for (n = 0; n < f[w]; n++) z = g[w + 1][v] + g[w + 1][v + 1],
  4050. z > k[s] ? (g[w][n] = z, r[w][n] = l, v += 2) : (g[w][n] = k[s], r[w][n] = s, ++s);
  4051. q[w] = 0;
  4052. 1 === e[w] && h(w)
  4053. }
  4054. k = p;
  4055. f = 0;
  4056. for (g = d.length; f < g; ++f) m[d[f].index] = k[f];
  4057. return m
  4058. }
  4059. function n(b) {
  4060. var a = new(t ? Uint16Array: Array)(b.length),
  4061. h = [],
  4062. d = [],
  4063. e = 0,
  4064. m,
  4065. k,
  4066. f;
  4067. m = 0;
  4068. for (k = b.length; m < k; m++) h[b[m]] = (h[b[m]] | 0) + 1;
  4069. m = 1;
  4070. for (k = 16; m <= k; m++) d[m] = e,
  4071. e += h[m] | 0,
  4072. e > 1 << m && c("overcommitted"),
  4073. e <<= 1;
  4074. 65536 > e && c("undercommitted");
  4075. m = 0;
  4076. for (k = b.length; m < k; m++) for (e = d[b[m]], d[b[m]] += 1, h = a[m] = 0, f = b[m]; h < f; h++) a[m] = a[m] << 1 | e & 1,
  4077. e >>>= 1;
  4078. return a
  4079. }
  4080. function p(b, a) {
  4081. this.input = b;
  4082. this.a = new(t ? Uint8Array: Array)(32768);
  4083. this.h = J.j;
  4084. var c = {},
  4085. h; ! a && (a = {}) || "number" !== typeof a.compressionType || (this.h = a.compressionType);
  4086. for (h in a) c[h] = a[h];
  4087. c.outputBuffer = this.a;
  4088. this.z = new m(this.input, c)
  4089. }
  4090. function q(b, a) {
  4091. this.k = [];
  4092. this.l = 32768;
  4093. this.e = this.g = this.c = this.q = 0;
  4094. this.input = t ? new Uint8Array(b) : b;
  4095. this.s = !1;
  4096. this.m = F;
  4097. this.B = !1;
  4098. if (a || !(a = {})) a.index && (this.c = a.index),
  4099. a.bufferSize && (this.l = a.bufferSize),
  4100. a.bufferType && (this.m = a.bufferType),
  4101. a.resize && (this.B = a.resize);
  4102. switch (this.m) {
  4103. case N:
  4104. this.b = 32768;
  4105. this.a = new(t ? Uint8Array: Array)(32768 + this.l + 258);
  4106. break;
  4107. case F:
  4108. this.b = 0;
  4109. this.a = new(t ? Uint8Array: Array)(this.l);
  4110. this.f = this.J;
  4111. this.t = this.H;
  4112. this.o = this.I;
  4113. break;
  4114. default:
  4115. c(Error("invalid inflate mode"))
  4116. }
  4117. }
  4118. function r(b, a) {
  4119. for (var h = b.g,
  4120. d = b.e,
  4121. e = b.input,
  4122. m = b.c,
  4123. k; d < a;) k = e[m++],
  4124. k === v && c(Error("input buffer is broken")),
  4125. h |= k << d,
  4126. d += 8;
  4127. b.g = h >>> a;
  4128. b.e = d - a;
  4129. b.c = m;
  4130. return h & (1 << a) - 1
  4131. }
  4132. function s(b, a) {
  4133. for (var h = b.g,
  4134. d = b.e,
  4135. e = b.input,
  4136. m = b.c,
  4137. k = a[0], f = a[1], g; d < f;) g = e[m++],
  4138. g === v && c(Error("input buffer is broken")),
  4139. h |= g << d,
  4140. d += 8;
  4141. e = k[h & (1 << f) - 1];
  4142. k = e >>> 16;
  4143. b.g = h >> k;
  4144. b.e = d - k;
  4145. b.c = m;
  4146. return e & 65535
  4147. }
  4148. function z(b) {
  4149. function a(b, c, h) {
  4150. var d, e, m, k;
  4151. for (k = 0; k < b;) switch (d = s(this, c), d) {
  4152. case 16:
  4153. for (m = 3 + r(this, 2); m--;) h[k++] = e;
  4154. break;
  4155. case 17:
  4156. for (m = 3 + r(this, 3); m--;) h[k++] = 0;
  4157. e = 0;
  4158. break;
  4159. case 18:
  4160. for (m = 11 + r(this, 7); m--;) h[k++] = 0;
  4161. e = 0;
  4162. break;
  4163. default:
  4164. e = h[k++] = d
  4165. }
  4166. return h
  4167. }
  4168. var c = r(b, 5) + 257,
  4169. d = r(b, 5) + 1,
  4170. e = r(b, 4) + 4,
  4171. m = new(t ? Uint8Array: Array)(K.length),
  4172. k;
  4173. for (k = 0; k < e; ++k) m[K[k]] = r(b, 3);
  4174. e = h(m);
  4175. m = new(t ? Uint8Array: Array)(c);
  4176. k = new(t ? Uint8Array: Array)(d);
  4177. b.o(h(a.call(b, c, e, m)), h(a.call(b, d, e, k)))
  4178. }
  4179. function A(b, a) {
  4180. var h, d;
  4181. this.input = b;
  4182. this.c = 0;
  4183. if (a || !(a = {})) a.index && (this.c = a.index),
  4184. a.verify && (this.M = a.verify);
  4185. h = b[this.c++];
  4186. d = b[this.c++];
  4187. switch (h & 15) {
  4188. case O:
  4189. this.method = O;
  4190. break;
  4191. default:
  4192. c(Error("unsupported compression method"))
  4193. }
  4194. 0 !== ((h << 8) + d) % 31 && c(Error("invalid fcheck flag:" + ((h << 8) + d) % 31));
  4195. d & 32 && c(Error("fdict flag is not supported"));
  4196. this.A = new q(b, {
  4197. index: this.c,
  4198. bufferSize: a.bufferSize,
  4199. bufferType: a.bufferType,
  4200. resize: a.resize
  4201. })
  4202. }
  4203. var v = void 0,
  4204. B = !0,
  4205. C = this,
  4206. t = "undefined" !== typeof Uint8Array && "undefined" !== typeof Uint16Array && "undefined" !== typeof Uint32Array;
  4207. a.prototype.f = function() {
  4208. var b = this.buffer,
  4209. a, c = b.length,
  4210. h = new(t ? Uint8Array: Array)(c << 1);
  4211. if (t) h.set(b);
  4212. else for (a = 0; a < c; ++a) h[a] = b[a];
  4213. return this.buffer = h
  4214. };
  4215. a.prototype.d = function(b, a, c) {
  4216. var h = this.buffer,
  4217. d = this.index,
  4218. e = this.i,
  4219. m = h[d];
  4220. c && 1 < a && (b = 8 < a ? (y[b & 255] << 24 | y[b >>> 8 & 255] << 16 | y[b >>> 16 & 255] << 8 | y[b >>> 24 & 255]) >> 32 - a: y[b] >> 8 - a);
  4221. if (8 > a + e) m = m << a | b,
  4222. e += a;
  4223. else for (c = 0; c < a; ++c) m = m << 1 | b >> a - c - 1 & 1,
  4224. 8 === ++e && (e = 0, h[d++] = y[m], m = 0, d === h.length && (h = this.f()));
  4225. h[d] = m;
  4226. this.buffer = h;
  4227. this.i = e;
  4228. this.index = d
  4229. };
  4230. a.prototype.finish = function() {
  4231. var b = this.buffer,
  4232. a = this.index,
  4233. c;
  4234. 0 < this.i && (b[a] <<= 8 - this.i, b[a] = y[b[a]], a++);
  4235. t ? c = b.subarray(0, a) : (b.length = a, c = b);
  4236. return c
  4237. };
  4238. var u = new(t ? Uint8Array: Array)(256),
  4239. D;
  4240. for (D = 0; 256 > D; ++D) {
  4241. for (var w = D,
  4242. E = w,
  4243. x = 7,
  4244. w = w >>> 1; w; w >>>= 1) E <<= 1,
  4245. E |= w & 1,
  4246. --x;
  4247. u[D] = (E << x & 255) >>> 0
  4248. }
  4249. var y = u,
  4250. u = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918E3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117];
  4251. t && new Uint32Array(u);
  4252. b.prototype.getParent = function(b) {
  4253. return 2 * ((b - 2) / 4 | 0)
  4254. };
  4255. b.prototype.push = function(b, a) {
  4256. var c, h, d = this.buffer,
  4257. e;
  4258. c = this.length;
  4259. d[this.length++] = a;
  4260. for (d[this.length++] = b; 0 < c;) if (h = this.getParent(c), d[c] > d[h]) e = d[c],
  4261. d[c] = d[h],
  4262. d[h] = e,
  4263. e = d[c + 1],
  4264. d[c + 1] = d[h + 1],
  4265. d[h + 1] = e,
  4266. c = h;
  4267. else break;
  4268. return this.length
  4269. };
  4270. b.prototype.pop = function() {
  4271. var b, a, c = this.buffer,
  4272. h, d, e;
  4273. a = c[0];
  4274. b = c[1];
  4275. this.length -= 2;
  4276. c[0] = c[this.length];
  4277. c[1] = c[this.length + 1];
  4278. for (e = 0;;) {
  4279. d = 2 * e + 2;
  4280. if (d >= this.length) break;
  4281. d + 2 < this.length && c[d + 2] > c[d] && (d += 2);
  4282. if (c[d] > c[e]) h = c[e],
  4283. c[e] = c[d],
  4284. c[d] = h,
  4285. h = c[e + 1],
  4286. c[e + 1] = c[d + 1],
  4287. c[d + 1] = h;
  4288. else break;
  4289. e = d
  4290. }
  4291. return {
  4292. index: b,
  4293. value: a,
  4294. length: this.length
  4295. }
  4296. };
  4297. var H = 2,
  4298. u = {
  4299. NONE: 0,
  4300. r: 1,
  4301. j: H,
  4302. N: 3
  4303. },
  4304. L = [];
  4305. for (D = 0; 288 > D; D++) switch (B) {
  4306. case 143 >= D: L.push([D + 48, 8]);
  4307. break;
  4308. case 255 >= D: L.push([D - 144 + 400, 9]);
  4309. break;
  4310. case 279 >= D: L.push([D - 256 + 0, 7]);
  4311. break;
  4312. case 287 >= D: L.push([D - 280 + 192, 8]);
  4313. break;
  4314. default:
  4315. c("invalid literal: " + D)
  4316. }
  4317. m.prototype.n = function() {
  4318. var b, h, d, e, m = this.input;
  4319. switch (this.h) {
  4320. case 0:
  4321. d = 0;
  4322. for (e = m.length; d < e;) {
  4323. h = t ? m.subarray(d, d + 65535) : m.slice(d, d + 65535);
  4324. d += h.length;
  4325. var k = d === e,
  4326. f = v,
  4327. p = f = v,
  4328. p = f = v,
  4329. r = this.a,
  4330. q = this.b;
  4331. if (t) {
  4332. for (r = new Uint8Array(this.a.buffer); r.length <= q + h.length + 5;) r = new Uint8Array(r.length << 1);
  4333. r.set(this.a)
  4334. }
  4335. f = k ? 1 : 0;
  4336. r[q++] = f | 0;
  4337. f = h.length;
  4338. p = ~f + 65536 & 65535;
  4339. r[q++] = f & 255;
  4340. r[q++] = f >>> 8 & 255;
  4341. r[q++] = p & 255;
  4342. r[q++] = p >>> 8 & 255;
  4343. if (t) r.set(h, q),
  4344. q += h.length,
  4345. r = r.subarray(0, q);
  4346. else {
  4347. f = 0;
  4348. for (p = h.length; f < p; ++f) r[q++] = h[f];
  4349. r.length = q
  4350. }
  4351. this.b = q;
  4352. this.a = r
  4353. }
  4354. break;
  4355. case 1:
  4356. d = new a(new Uint8Array(this.a.buffer), this.b);
  4357. d.d(1, 1, B);
  4358. d.d(1, 2, B);
  4359. m = g(this, m);
  4360. h = 0;
  4361. for (k = m.length; h < k; h++) if (e = m[h], a.prototype.d.apply(d, L[e]), 256 < e) d.d(m[++h], m[++h], B),
  4362. d.d(m[++h], 5),
  4363. d.d(m[++h], m[++h], B);
  4364. else if (256 === e) break;
  4365. this.a = d.finish();
  4366. this.b = this.a.length;
  4367. break;
  4368. case H:
  4369. e = new a(new Uint8Array(this.a), this.b);
  4370. var s, w, z, A = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],
  4371. D,
  4372. E,
  4373. f = Array(19),
  4374. x,
  4375. r = H;
  4376. e.d(1, 1, B);
  4377. e.d(r, 2, B);
  4378. m = g(this, m);
  4379. p = l(this.L, 15);
  4380. D = n(p);
  4381. r = l(this.K, 7);
  4382. q = n(r);
  4383. for (s = 286; 257 < s && 0 === p[s - 1]; s--);
  4384. for (w = 30; 1 < w && 0 === r[w - 1]; w--);
  4385. var y = s,
  4386. u = w;
  4387. b = new(t ? Uint32Array: Array)(y + u);
  4388. var C = new(t ? Uint32Array: Array)(316),
  4389. G,
  4390. F;
  4391. E = new(t ? Uint8Array: Array)(19);
  4392. for (x = z = 0; x < y; x++) b[z++] = p[x];
  4393. for (x = 0; x < u; x++) b[z++] = r[x];
  4394. if (!t) for (x = 0, u = E.length; x < u; ++x) E[x] = 0;
  4395. x = G = 0;
  4396. for (u = b.length; x < u; x += z) {
  4397. for (z = 1; x + z < u && b[x + z] === b[x]; ++z);
  4398. y = z;
  4399. if (0 === b[x]) if (3 > y) for (; 0 < y--;) C[G++] = 0,
  4400. E[0]++;
  4401. else for (; 0 < y;) F = 138 > y ? y: 138,
  4402. F > y - 3 && F < y && (F = y - 3),
  4403. 10 >= F ? (C[G++] = 17, C[G++] = F - 3, E[17]++) : (C[G++] = 18, C[G++] = F - 11, E[18]++),
  4404. y -= F;
  4405. else if (C[G++] = b[x], E[b[x]]++, y--, 3 > y) for (; 0 < y--;) C[G++] = b[x],
  4406. E[b[x]]++;
  4407. else for (; 0 < y;) F = 6 > y ? y: 6,
  4408. F > y - 3 && F < y && (F = y - 3),
  4409. C[G++] = 16,
  4410. C[G++] = F - 3,
  4411. E[16]++,
  4412. y -= F
  4413. }
  4414. b = t ? C.subarray(0, G) : C.slice(0, G);
  4415. E = l(E, 7);
  4416. for (x = 0; 19 > x; x++) f[x] = E[A[x]];
  4417. for (z = 19; 4 < z && 0 === f[z - 1]; z--);
  4418. A = n(E);
  4419. e.d(s - 257, 5, B);
  4420. e.d(w - 1, 5, B);
  4421. e.d(z - 4, 4, B);
  4422. for (x = 0; x < z; x++) e.d(f[x], 3, B);
  4423. x = 0;
  4424. for (f = b.length; x < f; x++) if (h = b[x], e.d(A[h], E[h], B), 16 <= h) {
  4425. x++;
  4426. switch (h) {
  4427. case 16:
  4428. k = 2;
  4429. break;
  4430. case 17:
  4431. k = 3;
  4432. break;
  4433. case 18:
  4434. k = 7;
  4435. break;
  4436. default:
  4437. c("invalid code: " + h)
  4438. }
  4439. e.d(b[x], k, B)
  4440. }
  4441. k = [D, p];
  4442. q = [q, r];
  4443. h = k[0];
  4444. k = k[1];
  4445. r = q[0];
  4446. D = q[1];
  4447. q = 0;
  4448. for (f = m.length; q < f; ++q) if (d = m[q], e.d(h[d], k[d], B), 256 < d) e.d(m[++q], m[++q], B),
  4449. p = m[++q],
  4450. e.d(r[p], D[p], B),
  4451. e.d(m[++q], m[++q], B);
  4452. else if (256 === d) break;
  4453. this.a = e.finish();
  4454. this.b = this.a.length;
  4455. break;
  4456. default:
  4457. c("invalid compression type")
  4458. }
  4459. return this.a
  4460. };
  4461. D = [];
  4462. var G;
  4463. for (G = 3; 258 >= G; G++) w = f(),
  4464. D[G] = w[2] << 24 | w[1] << 16 | w[0];
  4465. var M = t ? new Uint32Array(D) : D,
  4466. J = u;
  4467. p.prototype.n = function() {
  4468. var b, a, h, e, m = 0;
  4469. e = this.a;
  4470. b = O;
  4471. switch (b) {
  4472. case O:
  4473. a = Math.LOG2E * Math.log(32768) - 8;
  4474. break;
  4475. default:
  4476. c(Error("invalid compression method"))
  4477. }
  4478. a = a << 4 | b;
  4479. e[m++] = a;
  4480. switch (b) {
  4481. case O:
  4482. switch (this.h) {
  4483. case J.NONE:
  4484. h = 0;
  4485. break;
  4486. case J.r:
  4487. h = 1;
  4488. break;
  4489. case J.j:
  4490. h = 2;
  4491. break;
  4492. default:
  4493. c(Error("unsupported compression type"))
  4494. }
  4495. break;
  4496. default:
  4497. c(Error("invalid compression method"))
  4498. }
  4499. b = h << 6 | 0;
  4500. e[m++] = b | 31 - (256 * a + b) % 31;
  4501. b = d(this.input);
  4502. this.z.b = m;
  4503. e = this.z.n();
  4504. m = e.length;
  4505. t && (e = new Uint8Array(e.buffer), e.length <= m + 4 && (this.a = new Uint8Array(e.length + 4), this.a.set(e), e = this.a), e = e.subarray(0, m + 4));
  4506. e[m++] = b >> 24 & 255;
  4507. e[m++] = b >> 16 & 255;
  4508. e[m++] = b >> 8 & 255;
  4509. e[m++] = b & 255;
  4510. return e
  4511. };
  4512. e("Zlib.Deflate", p);
  4513. e("Zlib.Deflate.compress",
  4514. function(b, a) {
  4515. return (new p(b, a)).n()
  4516. });
  4517. e("Zlib.Deflate.CompressionType", J);
  4518. e("Zlib.Deflate.CompressionType.NONE", J.NONE);
  4519. e("Zlib.Deflate.CompressionType.FIXED", J.r);
  4520. e("Zlib.Deflate.CompressionType.DYNAMIC", J.j);
  4521. var N = 0,
  4522. F = 1,
  4523. u = {
  4524. D: N,
  4525. C: F
  4526. };
  4527. q.prototype.p = function() {
  4528. for (; ! this.s;) {
  4529. var b = r(this, 3);
  4530. b & 1 && (this.s = B);
  4531. b >>>= 1;
  4532. switch (b) {
  4533. case 0:
  4534. var b = this.input,
  4535. a = this.c,
  4536. h = this.a,
  4537. d = this.b,
  4538. e = v,
  4539. m = v,
  4540. k = v,
  4541. f = h.length,
  4542. e = v;
  4543. this.e = this.g = 0;
  4544. e = b[a++];
  4545. e === v && c(Error("invalid uncompressed block header: LEN (first byte)"));
  4546. m = e;
  4547. e = b[a++];
  4548. e === v && c(Error("invalid uncompressed block header: LEN (second byte)"));
  4549. m |= e << 8;
  4550. e = b[a++];
  4551. e === v && c(Error("invalid uncompressed block header: NLEN (first byte)"));
  4552. k = e;
  4553. e = b[a++];
  4554. e === v && c(Error("invalid uncompressed block header: NLEN (second byte)"));
  4555. k |= e << 8;
  4556. m === ~k && c(Error("invalid uncompressed block header: length verify"));
  4557. a + m > b.length && c(Error("input buffer is broken"));
  4558. switch (this.m) {
  4559. case N:
  4560. for (; d + m > h.length;) {
  4561. e = f - d;
  4562. m -= e;
  4563. if (t) h.set(b.subarray(a, a + e), d),
  4564. d += e,
  4565. a += e;
  4566. else for (; e--;) h[d++] = b[a++];
  4567. this.b = d;
  4568. h = this.f();
  4569. d = this.b
  4570. }
  4571. break;
  4572. case F:
  4573. for (; d + m > h.length;) h = this.f({
  4574. v: 2
  4575. });
  4576. break;
  4577. default:
  4578. c(Error("invalid inflate mode"))
  4579. }
  4580. if (t) h.set(b.subarray(a, a + m), d),
  4581. d += m,
  4582. a += m;
  4583. else for (; m--;) h[d++] = b[a++];
  4584. this.c = a;
  4585. this.b = d;
  4586. this.a = h;
  4587. break;
  4588. case 1:
  4589. this.o(S, T);
  4590. break;
  4591. case 2:
  4592. z(this);
  4593. break;
  4594. default:
  4595. c(Error("unknown BTYPE: " + b))
  4596. }
  4597. }
  4598. return this.t()
  4599. };
  4600. D = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  4601. var K = t ? new Uint16Array(D) : D;
  4602. D = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 258, 258];
  4603. var I = t ? new Uint16Array(D) : D;
  4604. D = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0];
  4605. var P = t ? new Uint8Array(D) : D;
  4606. D = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
  4607. var R = t ? new Uint16Array(D) : D;
  4608. D = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
  4609. var Q = t ? new Uint8Array(D) : D;
  4610. D = new(t ? Uint8Array: Array)(288);
  4611. w = 0;
  4612. for (E = D.length; w < E; ++w) D[w] = 143 >= w ? 8 : 255 >= w ? 9 : 279 >= w ? 7 : 8;
  4613. var S = h(D);
  4614. D = new(t ? Uint8Array: Array)(30);
  4615. w = 0;
  4616. for (E = D.length; w < E; ++w) D[w] = 5;
  4617. var T = h(D);
  4618. q.prototype.o = function(b, a) {
  4619. var c = this.a,
  4620. h = this.b;
  4621. this.u = b;
  4622. for (var d = c.length - 258,
  4623. e, m, k; 256 !== (e = s(this, b));) if (256 > e) h >= d && (this.b = h, c = this.f(), h = this.b),
  4624. c[h++] = e;
  4625. else for (e -= 257, k = I[e], 0 < P[e] && (k += r(this, P[e])), e = s(this, a), m = R[e], 0 < Q[e] && (m += r(this, Q[e])), h >= d && (this.b = h, c = this.f(), h = this.b); k--;) c[h] = c[h++-m];
  4626. for (; 8 <= this.e;) this.e -= 8,
  4627. this.c--;
  4628. this.b = h
  4629. };
  4630. q.prototype.I = function(b, a) {
  4631. var c = this.a,
  4632. h = this.b;
  4633. this.u = b;
  4634. for (var d = c.length,
  4635. e, m, k; 256 !== (e = s(this, b));) if (256 > e) h >= d && (c = this.f(), d = c.length),
  4636. c[h++] = e;
  4637. else for (e -= 257, k = I[e], 0 < P[e] && (k += r(this, P[e])), e = s(this, a), m = R[e], 0 < Q[e] && (m += r(this, Q[e])), h + k > d && (c = this.f(), d = c.length); k--;) c[h] = c[h++-m];
  4638. for (; 8 <= this.e;) this.e -= 8,
  4639. this.c--;
  4640. this.b = h
  4641. };
  4642. q.prototype.f = function() {
  4643. var b = new(t ? Uint8Array: Array)(this.b - 32768),
  4644. a = this.b - 32768,
  4645. c,
  4646. h,
  4647. d = this.a;
  4648. if (t) b.set(d.subarray(32768, b.length));
  4649. else for (c = 0, h = b.length; c < h; ++c) b[c] = d[c + 32768];
  4650. this.k.push(b);
  4651. this.q += b.length;
  4652. if (t) d.set(d.subarray(a, a + 32768));
  4653. else for (c = 0; 32768 > c; ++c) d[c] = d[a + c];
  4654. this.b = 32768;
  4655. return d
  4656. };
  4657. q.prototype.J = function(b) {
  4658. var a, c = this.input.length / this.c + 1 | 0,
  4659. h, d, e, m = this.input,
  4660. k = this.a;
  4661. b && ("number" === typeof b.v && (c = b.v), "number" === typeof b.F && (c += b.F));
  4662. 2 > c ? (h = (m.length - this.c) / this.u[2], e = h / 2 * 258 | 0, d = e < k.length ? k.length + e: k.length << 1) : d = k.length * c;
  4663. t ? (a = new Uint8Array(d), a.set(k)) : a = k;
  4664. return this.a = a
  4665. };
  4666. q.prototype.t = function() {
  4667. var b = 0,
  4668. a = this.a,
  4669. c = this.k,
  4670. h, d = new(t ? Uint8Array: Array)(this.q + (this.b - 32768)),
  4671. e,
  4672. m,
  4673. k,
  4674. f;
  4675. if (0 === c.length) return t ? this.a.subarray(32768, this.b) : this.a.slice(32768, this.b);
  4676. e = 0;
  4677. for (m = c.length; e < m; ++e) for (h = c[e], k = 0, f = h.length; k < f; ++k) d[b++] = h[k];
  4678. e = 32768;
  4679. for (m = this.b; e < m; ++e) d[b++] = a[e];
  4680. this.k = [];
  4681. return this.buffer = d
  4682. };
  4683. q.prototype.H = function() {
  4684. var b, a = this.b;
  4685. t ? this.B ? (b = new Uint8Array(a), b.set(this.a.subarray(0, a))) : b = this.a.subarray(0, a) : (this.a.length > a && (this.a.length = a), b = this.a);
  4686. return this.buffer = b
  4687. };
  4688. A.prototype.p = function() {
  4689. var b = this.input,
  4690. a, h;
  4691. a = this.A.p();
  4692. this.c = this.A.c;
  4693. this.M && (h = (b[this.c++] << 24 | b[this.c++] << 16 | b[this.c++] << 8 | b[this.c++]) >>> 0, h !== d(a) && c(Error("invalid adler-32 checksum")));
  4694. return a
  4695. };
  4696. e("Zlib.Inflate", A);
  4697. e("Zlib.Inflate.BufferType", u);
  4698. u.ADAPTIVE = u.C;
  4699. u.BLOCK = u.D;
  4700. e("Zlib.Inflate.prototype.decompress", A.prototype.p);
  4701. u = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  4702. t && new Uint16Array(u);
  4703. u = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 258, 258];
  4704. t && new Uint16Array(u);
  4705. u = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0];
  4706. t && new Uint8Array(u);
  4707. u = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
  4708. t && new Uint16Array(u);
  4709. u = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
  4710. t && new Uint8Array(u);
  4711. u = new(t ? Uint8Array: Array)(288);
  4712. D = 0;
  4713. for (w = u.length; D < w; ++D) u[D] = 143 >= D ? 8 : 255 >= D ? 9 : 279 >= D ? 7 : 8;
  4714. h(u);
  4715. u = new(t ? Uint8Array: Array)(30);
  4716. D = 0;
  4717. for (w = u.length; D < w; ++D) u[D] = 5;
  4718. h(u);
  4719. var O = 8
  4720. }).call(this); (function(c) {
  4721. var e = function() {
  4722. function d() {}
  4723. d.parse = function(a) {
  4724. a = c.SAXParser.getInstance().parserXML(a);
  4725. if (!a || !a.childNodes) return null;
  4726. for (var b = a.childNodes.length,
  4727. h = !1,
  4728. e = 0; e < b; e++) {
  4729. var k = a.childNodes[e];
  4730. if (1 == k.nodeType) {
  4731. h = !0;
  4732. break
  4733. }
  4734. }
  4735. return h ? d.parseNode(k) : null
  4736. };
  4737. d.parseNode = function(a) {
  4738. if (!a || 1 != a.nodeType) return null;
  4739. var b = {};
  4740. b.localName = a.localName;
  4741. b.name = a.nodeName;
  4742. a.namespaceURI && (b.namespace = a.namespaceURI);
  4743. a.prefix && (b.prefix = a.prefix);
  4744. for (var c = a.attributes,
  4745. e = c.length,
  4746. k = 0; k < e; k++) {
  4747. var f = c[k],
  4748. g = f.name;
  4749. 0 != g.indexOf("xmlns:") && (b["$" + g] = f.value)
  4750. }
  4751. c = a.childNodes;
  4752. e = c.length;
  4753. for (k = 0; k < e; k++) if (f = d.parseNode(c[k])) b.children || (b.children = []),
  4754. f.parent = b,
  4755. b.children.push(f); ! b.children && (a = a.textContent.trim()) && (b.text = a);
  4756. return b
  4757. };
  4758. d.findChildren = function(a, b, c) {
  4759. c ? c.length = 0 : c = [];
  4760. d.findByPath(a, b, c);
  4761. return c
  4762. };
  4763. d.findByPath = function(a, b, c) {
  4764. var e = b.indexOf("."),
  4765. k; - 1 == e ? (k = b, e = !0) : (k = b.substring(0, e), b = b.substring(e + 1), e = !1);
  4766. if (a = a.children) for (var f = a.length,
  4767. g = 0; g < f; g++) {
  4768. var l = a[g];
  4769. l.localName == k && (e ? c.push(l) : d.findByPath(l, b, c))
  4770. }
  4771. };
  4772. d.getAttributes = function(a, b) {
  4773. b ? b.length = 0 : b = [];
  4774. for (var c in a)"$" == c.charAt(0) && b.push(c.substring(1));
  4775. return b
  4776. };
  4777. return d
  4778. } ();
  4779. c.XML = e
  4780. })(egret || (egret = {}));
  4781. __extends = this.__extends ||
  4782. function(c, e) {
  4783. function d() {
  4784. this.constructor = c
  4785. }
  4786. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  4787. d.prototype = e.prototype;
  4788. c.prototype = new d
  4789. }; (function(c) {
  4790. var e = function(d) {
  4791. function a(b, a, c) {
  4792. d.call(this);
  4793. this._target = null;
  4794. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  4795. this._actions = this._steps = this.pluginData = null;
  4796. this.paused = !1;
  4797. this.duration = 0;
  4798. this._prevPos = -1;
  4799. this.position = null;
  4800. this._stepPosition = this._prevPosition = 0;
  4801. this.passive = !1;
  4802. this.initialize(b, a, c)
  4803. }
  4804. __extends(a, d);
  4805. a.get = function(b, c, d, e) {
  4806. "undefined" === typeof c && (c = null);
  4807. "undefined" === typeof d && (d = null);
  4808. "undefined" === typeof e && (e = !1);
  4809. e && a.removeTweens(b);
  4810. return new a(b, c, d)
  4811. };
  4812. a.removeTweens = function(b) {
  4813. if (b.tween_count) {
  4814. for (var c = a._tweens,
  4815. d = c.length - 1; 0 <= d; d--) c[d]._target == b && (c[d].paused = !0, c.splice(d, 1));
  4816. b.tween_count = 0
  4817. }
  4818. };
  4819. a.tick = function(b, c) {
  4820. "undefined" === typeof c && (c = !1);
  4821. for (var d = a._tweens.concat(), e = d.length - 1; 0 <= e; e--) {
  4822. var f = d[e];
  4823. c && !f.ignoreGlobalPause || f.paused || f.tick(f._useTicks ? 1 : b)
  4824. }
  4825. };
  4826. a._register = function(b, h) {
  4827. var d = b._target,
  4828. e = a._tweens;
  4829. if (h) d && (d.tween_count = d.tween_count ? d.tween_count + 1 : 1),
  4830. e.push(b),
  4831. a._inited || (c.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  4832. else for (d && d.tween_count--, d = e.length; d--;) if (e[d] == b) {
  4833. e.splice(d, 1);
  4834. break
  4835. }
  4836. };
  4837. a.removeAllTweens = function() {
  4838. for (var b = a._tweens,
  4839. c = 0,
  4840. d = b.length; c < d; c++) {
  4841. var e = b[c];
  4842. e.paused = !0;
  4843. e._target.tweenjs_count = 0
  4844. }
  4845. b.length = 0
  4846. };
  4847. a.prototype.initialize = function(b, c, d) {
  4848. this._target = b;
  4849. c && (this._useTicks = c.useTicks, this.ignoreGlobalPause = c.ignoreGlobalPause, this.loop = c.loop, c.onChange && this.addEventListener("change", c.onChange, c.onChangeObj), c.override && a.removeTweens(b));
  4850. this.pluginData = d || {};
  4851. this._curQueueProps = {};
  4852. this._initQueueProps = {};
  4853. this._steps = [];
  4854. this._actions = [];
  4855. c && c.paused ? this.paused = !0 : a._register(this, !0);
  4856. c && null != c.position && this.setPosition(c.position, a.NONE)
  4857. };
  4858. a.prototype.setPosition = function(b, a) {
  4859. "undefined" === typeof a && (a = 1);
  4860. 0 > b && (b = 0);
  4861. var c = b,
  4862. d = !1;
  4863. c >= this.duration && (this.loop ? c %= this.duration: (c = this.duration, d = !0));
  4864. if (c == this._prevPos) return d;
  4865. var e = this._prevPos;
  4866. this.position = this._prevPos = c;
  4867. this._prevPosition = b;
  4868. if (this._target) if (d) this._updateTargetProps(null, 1);
  4869. else if (0 < this._steps.length) {
  4870. for (var g = 0,
  4871. l = this._steps.length; g < l && !(this._steps[g].t > c); g++);
  4872. g = this._steps[g - 1];
  4873. this._updateTargetProps(g, (this._stepPosition = c - g.t) / g.d)
  4874. }
  4875. 0 != a && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == a && c < e ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, c, !0)) : this._runActions(e, c));
  4876. d && this.setPaused(!0);
  4877. this.dispatchEventWith("change");
  4878. return d
  4879. };
  4880. a.prototype._runActions = function(b, a, c) {
  4881. "undefined" === typeof c && (c = !1);
  4882. var d = b,
  4883. e = a,
  4884. g = -1,
  4885. l = this._actions.length,
  4886. n = 1;
  4887. b > a && (d = a, e = b, g = l, l = n = -1);
  4888. for (; (g += n) != l;) {
  4889. a = this._actions[g];
  4890. var p = a.t; (p == e || p > d && p < e || c && p == b) && a.f.apply(a.o, a.p)
  4891. }
  4892. };
  4893. a.prototype._updateTargetProps = function(b, c) {
  4894. var d, e, f, g;
  4895. if (b || 1 != c) {
  4896. if (this.passive = !!b.v) return;
  4897. b.e && (c = b.e(c, 0, 1, 1));
  4898. d = b.p0;
  4899. e = b.p1
  4900. } else this.passive = !1,
  4901. d = e = this._curQueueProps;
  4902. for (var l in this._initQueueProps) {
  4903. null == (f = d[l]) && (d[l] = f = this._initQueueProps[l]);
  4904. null == (g = e[l]) && (e[l] = g = f);
  4905. f = f == g || 0 == c || 1 == c || "number" != typeof f ? 1 == c ? g: f: f + (g - f) * c;
  4906. var n = !1;
  4907. if (g = a._plugins[l]) for (var p = 0,
  4908. q = g.length; p < q; p++) {
  4909. var r = g[p].tween(this, l, f, d, e, c, !!b && d == e, !b);
  4910. r == a.IGNORE ? n = !0 : f = r
  4911. }
  4912. n || (this._target[l] = f)
  4913. }
  4914. };
  4915. a.prototype.setPaused = function(b) {
  4916. this.paused = b;
  4917. a._register(this, !b);
  4918. return this
  4919. };
  4920. a.prototype._cloneProps = function(b) {
  4921. var a = {},
  4922. c;
  4923. for (c in b) a[c] = b[c];
  4924. return a
  4925. };
  4926. a.prototype._addStep = function(b) {
  4927. 0 < b.d && (this._steps.push(b), b.t = this.duration, this.duration += b.d);
  4928. return this
  4929. };
  4930. a.prototype._appendQueueProps = function(b) {
  4931. var c, d, e, f, g, l;
  4932. for (l in b) if (void 0 === this._initQueueProps[l]) {
  4933. d = this._target[l];
  4934. if (c = a._plugins[l]) for (e = 0, f = c.length; e < f; e++) d = c[e].init(this, l, d);
  4935. this._initQueueProps[l] = this._curQueueProps[l] = void 0 === d ? null: d
  4936. }
  4937. for (l in b) {
  4938. d = this._curQueueProps[l];
  4939. if (c = a._plugins[l]) for (g = g || {},
  4940. e = 0, f = c.length; e < f; e++) c[e].step && c[e].step(this, l, d, b[l], g);
  4941. this._curQueueProps[l] = b[l]
  4942. }
  4943. g && this._appendQueueProps(g);
  4944. return this._curQueueProps
  4945. };
  4946. a.prototype._addAction = function(b) {
  4947. b.t = this.duration;
  4948. this._actions.push(b);
  4949. return this
  4950. };
  4951. a.prototype._set = function(b, a) {
  4952. for (var c in b) a[c] = b[c]
  4953. };
  4954. a.prototype.wait = function(b, a) {
  4955. "undefined" === typeof a && (a = !1);
  4956. if (null == b || 0 >= b) return this;
  4957. var c = this._cloneProps(this._curQueueProps);
  4958. return this._addStep({
  4959. d: b,
  4960. p0: c,
  4961. p1: c,
  4962. v: a
  4963. })
  4964. };
  4965. a.prototype.to = function(b, a, c) {
  4966. "undefined" === typeof c && (c = void 0);
  4967. if (isNaN(a) || 0 > a) a = 0;
  4968. return this._addStep({
  4969. d: a || 0,
  4970. p0: this._cloneProps(this._curQueueProps),
  4971. e: c,
  4972. p1: this._cloneProps(this._appendQueueProps(b))
  4973. })
  4974. };
  4975. a.prototype.call = function(b, a, c) {
  4976. "undefined" === typeof a && (a = void 0);
  4977. "undefined" === typeof c && (c = void 0);
  4978. return this._addAction({
  4979. f: b,
  4980. p: c ? c: [this],
  4981. o: a ? a: this._target
  4982. })
  4983. };
  4984. a.prototype.set = function(b, a) {
  4985. "undefined" === typeof a && (a = null);
  4986. return this._addAction({
  4987. f: this._set,
  4988. o: this,
  4989. p: [b, a ? a: this._target]
  4990. })
  4991. };
  4992. a.prototype.play = function(b) {
  4993. b || (b = this);
  4994. return this.call(b.setPaused, [!1], b)
  4995. };
  4996. a.prototype.pause = function(b) {
  4997. b || (b = this);
  4998. return this.call(b.setPaused, [!0], b)
  4999. };
  5000. a.prototype.tick = function(b) {
  5001. this.paused || this.setPosition(this._prevPosition + b)
  5002. };
  5003. a.NONE = 0;
  5004. a.LOOP = 1;
  5005. a.REVERSE = 2;
  5006. a._tweens = [];
  5007. a.IGNORE = {};
  5008. a._plugins = {};
  5009. a._inited = !1;
  5010. return a
  5011. } (c.EventDispatcher);
  5012. c.Tween = e
  5013. })(egret || (egret = {})); (function(c) {
  5014. var e = function() {
  5015. function d() {
  5016. c.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  5017. }
  5018. d.get = function(a) { - 1 > a && (a = -1);
  5019. 1 < a && (a = 1);
  5020. return function(b) {
  5021. return 0 == a ? b: 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  5022. }
  5023. };
  5024. d.getPowIn = function(a) {
  5025. return function(b) {
  5026. return Math.pow(b, a)
  5027. }
  5028. };
  5029. d.getPowOut = function(a) {
  5030. return function(b) {
  5031. return 1 - Math.pow(1 - b, a)
  5032. }
  5033. };
  5034. d.getPowInOut = function(a) {
  5035. return function(b) {
  5036. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  5037. }
  5038. };
  5039. d.sineIn = function(a) {
  5040. return 1 - Math.cos(a * Math.PI / 2)
  5041. };
  5042. d.sineOut = function(a) {
  5043. return Math.sin(a * Math.PI / 2)
  5044. };
  5045. d.sineInOut = function(a) {
  5046. return - 0.5 * (Math.cos(Math.PI * a) - 1)
  5047. };
  5048. d.getBackIn = function(a) {
  5049. return function(b) {
  5050. return b * b * ((a + 1) * b - a)
  5051. }
  5052. };
  5053. d.getBackOut = function(a) {
  5054. return function(b) {
  5055. b -= 1;
  5056. return b * b * ((a + 1) * b + a) + 1
  5057. }
  5058. };
  5059. d.getBackInOut = function(a) {
  5060. a *= 1.525;
  5061. return function(b) {
  5062. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  5063. }
  5064. };
  5065. d.circIn = function(a) {
  5066. return - (Math.sqrt(1 - a * a) - 1)
  5067. };
  5068. d.circOut = function(a) {
  5069. return Math.sqrt(1 - a * a)
  5070. };
  5071. d.circInOut = function(a) {
  5072. return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  5073. };
  5074. d.bounceIn = function(a) {
  5075. return 1 - d.bounceOut(1 - a)
  5076. };
  5077. d.bounceOut = function(a) {
  5078. return a < 1 / 2.75 ? 7.5625 * a * a: a < 2 / 2.75 ? 7.5625 * (a -= 1.5 / 2.75) * a + 0.75 : a < 2.5 / 2.75 ? 7.5625 * (a -= 2.25 / 2.75) * a + 0.9375 : 7.5625 * (a -= 2.625 / 2.75) * a + 0.984375
  5079. };
  5080. d.bounceInOut = function(a) {
  5081. return 0.5 > a ? 0.5 * d.bounceIn(2 * a) : 0.5 * d.bounceOut(2 * a - 1) + 0.5
  5082. };
  5083. d.getElasticIn = function(a, b) {
  5084. var c = 2 * Math.PI;
  5085. return function(d) {
  5086. if (0 == d || 1 == d) return d;
  5087. var e = b / c * Math.asin(1 / a);
  5088. return - (a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - e) * c / b))
  5089. }
  5090. };
  5091. d.getElasticOut = function(a, b) {
  5092. var c = 2 * Math.PI;
  5093. return function(d) {
  5094. if (0 == d || 1 == d) return d;
  5095. var e = b / c * Math.asin(1 / a);
  5096. return a * Math.pow(2, -10 * d) * Math.sin((d - e) * c / b) + 1
  5097. }
  5098. };
  5099. d.getElasticInOut = function(a, b) {
  5100. var c = 2 * Math.PI;
  5101. return function(d) {
  5102. var e = b / c * Math.asin(1 / a);
  5103. return 1 > (d *= 2) ? -0.5 * a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - e) * c / b) : a * Math.pow(2, -10 * (d -= 1)) * Math.sin((d - e) * c / b) * 0.5 + 1
  5104. }
  5105. };
  5106. d.quadIn = d.getPowIn(2);
  5107. d.quadOut = d.getPowOut(2);
  5108. d.quadInOut = d.getPowInOut(2);
  5109. d.cubicIn = d.getPowIn(3);
  5110. d.cubicOut = d.getPowOut(3);
  5111. d.cubicInOut = d.getPowInOut(3);
  5112. d.quartIn = d.getPowIn(4);
  5113. d.quartOut = d.getPowOut(4);
  5114. d.quartInOut = d.getPowInOut(4);
  5115. d.quintIn = d.getPowIn(5);
  5116. d.quintOut = d.getPowOut(5);
  5117. d.quintInOut = d.getPowInOut(5);
  5118. d.backIn = d.getBackIn(1.7);
  5119. d.backOut = d.getBackOut(1.7);
  5120. d.backInOut = d.getBackInOut(1.7);
  5121. d.elasticIn = d.getElasticIn(1, 0.3);
  5122. d.elasticOut = d.getElasticOut(1, 0.3);
  5123. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  5124. return d
  5125. } ();
  5126. c.Ease = e
  5127. })(egret || (egret = {})); (function(c) {
  5128. var e = function() {
  5129. function c() {}
  5130. c.prototype.play = function(a) {
  5131. "undefined" === typeof a && (a = !1);
  5132. var b = this.audio;
  5133. b && (isNaN(b.duration) || (b.currentTime = 0), b.loop = a, b.play())
  5134. };
  5135. c.prototype.pause = function() {
  5136. var a = this.audio;
  5137. a && a.pause()
  5138. };
  5139. c.prototype.load = function() {
  5140. var a = this.audio;
  5141. a && a.load()
  5142. };
  5143. c.prototype.addEventListener = function(a, b) {
  5144. this.audio && this.audio.addEventListener(a, b, !1)
  5145. };
  5146. c.prototype.removeEventListener = function(a, b) {
  5147. this.audio && this.audio.removeEventListener(a, b, !1)
  5148. };
  5149. c.prototype.setVolume = function(a) {
  5150. var b = this.audio;
  5151. b && (b.volume = a)
  5152. };
  5153. c.prototype.getVolume = function() {
  5154. return this.audio ? this.audio.volume: 0
  5155. };
  5156. return c
  5157. } ();
  5158. c.Sound = e
  5159. })(egret || (egret = {}));
  5160. __extends = this.__extends ||
  5161. function(c, e) {
  5162. function d() {
  5163. this.constructor = c
  5164. }
  5165. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5166. d.prototype = e.prototype;
  5167. c.prototype = new d
  5168. }; (function(c) {
  5169. var e = function(d) {
  5170. function a(b) {
  5171. "undefined" === typeof b && (b = null);
  5172. d.call(this);
  5173. this._source = b ? b: []
  5174. }
  5175. __extends(a, d);
  5176. Object.defineProperty(a.prototype, "source", {
  5177. get: function() {
  5178. return this._source
  5179. },
  5180. set: function(b) {
  5181. b || (b = []);
  5182. this._source = b;
  5183. this.dispatchCoEvent(c.CollectionEventKind.RESET)
  5184. },
  5185. enumerable: !0,
  5186. configurable: !0
  5187. });
  5188. a.prototype.refresh = function() {
  5189. this.dispatchCoEvent(c.CollectionEventKind.REFRESH)
  5190. };
  5191. a.prototype.contains = function(b) {
  5192. return - 1 != this.getItemIndex(b)
  5193. };
  5194. a.prototype.checkIndex = function(b) {
  5195. if (0 > b || b >= this._source.length) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  5196. };
  5197. Object.defineProperty(a.prototype, "length", {
  5198. get: function() {
  5199. return this._source.length
  5200. },
  5201. enumerable: !0,
  5202. configurable: !0
  5203. });
  5204. a.prototype.addItem = function(b) {
  5205. this._source.push(b);
  5206. this.dispatchCoEvent(c.CollectionEventKind.ADD, this._source.length - 1, -1, [b])
  5207. };
  5208. a.prototype.addItemAt = function(b, a) {
  5209. if (0 > a || a > this._source.length) throw new RangeError('\u7d22\u5f15:"' + a + '"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  5210. this._source.splice(a, 0, b);
  5211. this.dispatchCoEvent(c.CollectionEventKind.ADD, a, -1, [b])
  5212. };
  5213. a.prototype.getItemAt = function(b) {
  5214. return this._source[b]
  5215. };
  5216. a.prototype.getItemIndex = function(b) {
  5217. for (var a = this._source.length,
  5218. c = 0; c < a; c++) if (this._source[c] === b) return c;
  5219. return - 1
  5220. };
  5221. a.prototype.itemUpdated = function(b) {
  5222. var a = this.getItemIndex(b); - 1 != a && this.dispatchCoEvent(c.CollectionEventKind.UPDATE, a, -1, [b])
  5223. };
  5224. a.prototype.removeAll = function() {
  5225. var b = this._source.concat();
  5226. this._source.length = 0;
  5227. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, 0, -1, b)
  5228. };
  5229. a.prototype.removeItemAt = function(b) {
  5230. this.checkIndex(b);
  5231. var a = this._source.splice(b, 1)[0];
  5232. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, b, -1, [a]);
  5233. return a
  5234. };
  5235. a.prototype.replaceItemAt = function(b, a) {
  5236. this.checkIndex(a);
  5237. var d = this._source.splice(a, 1, b)[0];
  5238. this.dispatchCoEvent(c.CollectionEventKind.REPLACE, a, -1, [b], [d]);
  5239. return d
  5240. };
  5241. a.prototype.replaceAll = function(b) {
  5242. b || (b = []);
  5243. for (var a = b.length,
  5244. c = this._source.length,
  5245. d = a; d < c; d++) this.removeItemAt(a);
  5246. for (d = 0; d < a; d++) d >= c ? this.addItemAt(b[d], d) : this.replaceItemAt(b[d], d);
  5247. this._source = b
  5248. };
  5249. a.prototype.moveItemAt = function(b, a) {
  5250. this.checkIndex(b);
  5251. this.checkIndex(a);
  5252. var d = this._source.splice(b, 1)[0];
  5253. this._source.splice(a, 0, d);
  5254. this.dispatchCoEvent(c.CollectionEventKind.MOVE, a, b, [d]);
  5255. return d
  5256. };
  5257. a.prototype.dispatchCoEvent = function(b, a, d, e, f) {
  5258. "undefined" === typeof b && (b = null);
  5259. "undefined" === typeof a && (a = -1);
  5260. "undefined" === typeof d && (d = -1);
  5261. "undefined" === typeof e && (e = null);
  5262. "undefined" === typeof f && (f = null);
  5263. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, f)
  5264. };
  5265. return a
  5266. } (c.EventDispatcher);
  5267. c.ArrayCollection = e
  5268. })(egret || (egret = {}));
  5269. __extends = this.__extends ||
  5270. function(c, e) {
  5271. function d() {
  5272. this.constructor = c
  5273. }
  5274. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5275. d.prototype = e.prototype;
  5276. c.prototype = new d
  5277. }; (function(c) {
  5278. var e = function(d) {
  5279. function a(b, a) {
  5280. "undefined" === typeof b && (b = "children");
  5281. "undefined" === typeof a && (a = "parent");
  5282. d.call(this);
  5283. this.nodeList = [];
  5284. this._openNodes = [];
  5285. this._showRoot = !1;
  5286. this.childrenKey = b;
  5287. this.parentKey = a
  5288. }
  5289. __extends(a, d);
  5290. Object.defineProperty(a.prototype, "source", {
  5291. get: function() {
  5292. return this._source
  5293. },
  5294. set: function(b) {
  5295. this._source = b;
  5296. this._openNodes = [];
  5297. this.nodeList = [];
  5298. this._source && (this._showRoot ? this.nodeList.push(this._source) : (this._openNodes = [this._source], this.addChildren(this._source, this.nodeList)));
  5299. this.dispatchCoEvent(c.CollectionEventKind.RESET)
  5300. },
  5301. enumerable: !0,
  5302. configurable: !0
  5303. });
  5304. Object.defineProperty(a.prototype, "openNodes", {
  5305. get: function() {
  5306. return this._openNodes.concat()
  5307. },
  5308. set: function(b) {
  5309. this._openNodes = b ? b.concat() : [];
  5310. this.refresh()
  5311. },
  5312. enumerable: !0,
  5313. configurable: !0
  5314. });
  5315. Object.defineProperty(a.prototype, "length", {
  5316. get: function() {
  5317. return this.nodeList.length
  5318. },
  5319. enumerable: !0,
  5320. configurable: !0
  5321. });
  5322. a.prototype.getItemAt = function(b) {
  5323. return this.nodeList[b]
  5324. };
  5325. a.prototype.getItemIndex = function(b) {
  5326. for (var a = this.nodeList.length,
  5327. c = 0; c < a; c++) if (this.nodeList[c] === b) return c;
  5328. return - 1
  5329. };
  5330. a.prototype.itemUpdated = function(b) {
  5331. var a = this.getItemIndex(b); - 1 != a && this.dispatchCoEvent(c.CollectionEventKind.UPDATE, a, -1, [b])
  5332. };
  5333. a.prototype.removeItem = function(b) {
  5334. this.isItemOpen(b) && this.closeNode(b);
  5335. if (b) {
  5336. var a = b[this.parentKey];
  5337. if (a && (a = a[this.childrenKey])) {
  5338. var d = a.indexOf(b); - 1 != d && a.splice(d, 1);
  5339. b[this.parentKey] = null;
  5340. d = this.nodeList.indexOf(b); - 1 != d && (this.nodeList.splice(d, 1), this.dispatchCoEvent(c.CollectionEventKind.REMOVE, d, -1, [b]))
  5341. }
  5342. }
  5343. };
  5344. Object.defineProperty(a.prototype, "showRoot", {
  5345. get: function() {
  5346. return this._showRoot
  5347. },
  5348. set: function(b) {
  5349. this._showRoot != b && (this._showRoot = b, this._source && (this._showRoot ? this.nodeList.splice(0, 0, this._source) : (this.nodeList.shift(), -1 == this.openNodes.indexOf(this._source) && this.openNodes.push(this._source)), this.refresh()))
  5350. },
  5351. enumerable: !0,
  5352. configurable: !0
  5353. });
  5354. a.prototype.addChildren = function(b, a) {
  5355. if (b.hasOwnProperty(this.childrenKey) && -1 != this._openNodes.indexOf(b)) for (var c = b[this.childrenKey], d = c.length, e = 0; e < d; e++) {
  5356. var g = c[e];
  5357. a.push(g);
  5358. this.addChildren(g, a)
  5359. }
  5360. };
  5361. a.prototype.hasChildren = function(b) {
  5362. return b.hasOwnProperty(this.childrenKey) ? 0 < b[this.childrenKey].length: !1
  5363. };
  5364. a.prototype.isItemOpen = function(b) {
  5365. return - 1 != this._openNodes.indexOf(b)
  5366. };
  5367. a.prototype.expandItem = function(b, a) {
  5368. "undefined" === typeof a && (a = !0);
  5369. a ? this.openNode(b) : this.closeNode(b)
  5370. };
  5371. a.prototype.openNode = function(b) {
  5372. if ( - 1 == this._openNodes.indexOf(b)) {
  5373. this._openNodes.push(b);
  5374. var a = this.nodeList.indexOf(b);
  5375. if ( - 1 != a) {
  5376. var d = [];
  5377. this.addChildren(b, d);
  5378. for (var e = a; d.length;) {
  5379. e++;
  5380. var f = d.shift();
  5381. this.nodeList.splice(e, 0, f);
  5382. this.dispatchCoEvent(c.CollectionEventKind.ADD, e, -1, [f])
  5383. }
  5384. this.dispatchCoEvent("open", a, a, [b])
  5385. }
  5386. }
  5387. };
  5388. a.prototype.closeNode = function(b) {
  5389. var a = this._openNodes.indexOf(b);
  5390. if ( - 1 != a) {
  5391. var d = [];
  5392. this.addChildren(b, d);
  5393. this._openNodes.splice(a, 1);
  5394. a = this.nodeList.indexOf(b);
  5395. if ( - 1 != a) {
  5396. for (a++; d.length;) {
  5397. var e = this.nodeList.splice(a, 1)[0];
  5398. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, a, -1, [e]);
  5399. d.shift()
  5400. }
  5401. a--;
  5402. this.dispatchCoEvent(c.CollectionEventKind.CLOSE, a, a, [b])
  5403. }
  5404. }
  5405. };
  5406. a.prototype.getDepth = function(b) {
  5407. var a = 0;
  5408. for (b = b[this.parentKey]; b;) a++,
  5409. b = b[this.parentKey];
  5410. 0 < a && !this._showRoot && a--;
  5411. return a
  5412. };
  5413. a.prototype.refresh = function() {
  5414. this.nodeList = [];
  5415. this._source && (this._showRoot && this.nodeList.push(this._source), this.addChildren(this._source, this.nodeList));
  5416. this.dispatchCoEvent(c.CollectionEventKind.REFRESH)
  5417. };
  5418. a.prototype.dispatchCoEvent = function(b, a, d, e, f) {
  5419. "undefined" === typeof b && (b = null);
  5420. "undefined" === typeof a && (a = -1);
  5421. "undefined" === typeof d && (d = -1);
  5422. "undefined" === typeof e && (e = null);
  5423. "undefined" === typeof f && (f = null);
  5424. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, f)
  5425. };
  5426. a.assignParent = function(b, c, d) {
  5427. "undefined" === typeof c && (c = "children");
  5428. "undefined" === typeof d && (d = "parent");
  5429. if (b.hasOwnProperty(c)) for (var e = b[c], f = e.length, g = 0; g < f; g++) {
  5430. var l = e[g];
  5431. try {
  5432. l[d] = b
  5433. } catch(n) {}
  5434. a.assignParent(l, c, d)
  5435. }
  5436. };
  5437. return a
  5438. } (c.EventDispatcher);
  5439. c.ObjectCollection = e
  5440. })(egret || (egret = {}));
  5441. __extends = this.__extends ||
  5442. function(c, e) {
  5443. function d() {
  5444. this.constructor = c
  5445. }
  5446. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5447. d.prototype = e.prototype;
  5448. c.prototype = new d
  5449. }; (function(c) {
  5450. var e = function(d) {
  5451. function a() {
  5452. d.call(this);
  5453. this.targetLevel = Number.MAX_VALUE;
  5454. this.updateCompleteQueue = new c.DepthQueue;
  5455. this.invalidateClientPropertiesFlag = this.invalidatePropertiesFlag = !1;
  5456. this.invalidatePropertiesQueue = new c.DepthQueue;
  5457. this.invalidateClientSizeFlag = this.invalidateSizeFlag = !1;
  5458. this.invalidateSizeQueue = new c.DepthQueue;
  5459. this.invalidateDisplayListFlag = !1;
  5460. this.invalidateDisplayListQueue = new c.DepthQueue;
  5461. this.listenersAttached = !1
  5462. }
  5463. __extends(a, d);
  5464. a.prototype.invalidateProperties = function(b) {
  5465. this.invalidatePropertiesFlag || (this.invalidatePropertiesFlag = !0, this.listenersAttached || this.attachListeners());
  5466. this.targetLevel <= b.nestLevel && (this.invalidateClientPropertiesFlag = !0);
  5467. this.invalidatePropertiesQueue.insert(b)
  5468. };
  5469. a.prototype.validateProperties = function() {
  5470. for (var b = this.invalidatePropertiesQueue.shift(); b;) b.parent && (b.validateProperties(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)),
  5471. b = this.invalidatePropertiesQueue.shift();
  5472. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1)
  5473. };
  5474. a.prototype.invalidateSize = function(b) {
  5475. this.invalidateSizeFlag || (this.invalidateSizeFlag = !0, this.listenersAttached || this.attachListeners());
  5476. this.targetLevel <= b.nestLevel && (this.invalidateClientSizeFlag = !0);
  5477. this.invalidateSizeQueue.insert(b)
  5478. };
  5479. a.prototype.validateSize = function() {
  5480. for (var b = this.invalidateSizeQueue.pop(); b;) b.parent && (b.validateSize(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)),
  5481. b = this.invalidateSizeQueue.pop();
  5482. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1)
  5483. };
  5484. a.prototype.invalidateDisplayList = function(b) {
  5485. this.invalidateDisplayListFlag || (this.invalidateDisplayListFlag = !0, this.listenersAttached || this.attachListeners());
  5486. this.invalidateDisplayListQueue.insert(b)
  5487. };
  5488. a.prototype.validateDisplayList = function() {
  5489. for (var b = this.invalidateDisplayListQueue.shift(); b;) b.parent && (b.validateDisplayList(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)),
  5490. b = this.invalidateDisplayListQueue.shift();
  5491. this.invalidateDisplayListQueue.isEmpty() && (this.invalidateDisplayListFlag = !1)
  5492. };
  5493. a.prototype.attachListeners = function() {
  5494. c.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.doPhasedInstantiationCallBack, this);
  5495. c.UIGlobals.stage.addEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  5496. c.UIGlobals.stage.invalidate();
  5497. this.listenersAttached = !0
  5498. };
  5499. a.prototype.doPhasedInstantiationCallBack = function(b) {
  5500. c.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME, this.doPhasedInstantiationCallBack, this);
  5501. c.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  5502. this.doPhasedInstantiation()
  5503. };
  5504. a.prototype.doPhasedInstantiation = function() {
  5505. this.invalidatePropertiesFlag && this.validateProperties();
  5506. this.invalidateSizeFlag && this.validateSize();
  5507. this.invalidateDisplayListFlag && this.validateDisplayList();
  5508. if (this.invalidatePropertiesFlag || this.invalidateSizeFlag || this.invalidateDisplayListFlag) this.attachListeners();
  5509. else {
  5510. this.listenersAttached = !1;
  5511. for (var b = this.updateCompleteQueue.pop(); b;) b.initialized || (b.initialized = !0),
  5512. b.hasEventListener(c.UIEvent.UPDATE_COMPLETE) && c.UIEvent.dispatchUIEvent(b, c.UIEvent.UPDATE_COMPLETE),
  5513. b.updateCompletePendingFlag = !1,
  5514. b = this.updateCompleteQueue.pop();
  5515. c.UIEvent.dispatchUIEvent(this, c.UIEvent.UPDATE_COMPLETE)
  5516. }
  5517. };
  5518. a.prototype.validateNow = function() {
  5519. for (var b = 0; this.listenersAttached && 100 > b++;) this.doPhasedInstantiationCallBack()
  5520. };
  5521. a.prototype.validateClient = function(b, a) {
  5522. "undefined" === typeof a && (a = !1);
  5523. var d, e = !1,
  5524. f = this.targetLevel;
  5525. this.targetLevel == Number.MAX_VALUE && (this.targetLevel = b.nestLevel);
  5526. for (; ! e;) {
  5527. e = !0;
  5528. for (d = this.invalidatePropertiesQueue.removeSmallestChild(b); d;) d.parent && (d.validateProperties(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0)),
  5529. d = this.invalidatePropertiesQueue.removeSmallestChild(b);
  5530. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1);
  5531. this.invalidateClientPropertiesFlag = !1;
  5532. for (d = this.invalidateSizeQueue.removeLargestChild(b); d;) {
  5533. d.parent && (d.validateSize(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0));
  5534. if (this.invalidateClientPropertiesFlag && (d = this.invalidatePropertiesQueue.removeSmallestChild(b))) {
  5535. this.invalidatePropertiesQueue.insert(d);
  5536. e = !1;
  5537. break
  5538. }
  5539. d = this.invalidateSizeQueue.removeLargestChild(b)
  5540. }
  5541. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1);
  5542. this.invalidateClientSizeFlag = this.invalidateClientPropertiesFlag = !1;
  5543. if (!a) {
  5544. for (d = this.invalidateDisplayListQueue.removeSmallestChild(b); d;) {
  5545. d.parent && (d.validateDisplayList(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0));
  5546. if (this.invalidateClientPropertiesFlag && (d = this.invalidatePropertiesQueue.removeSmallestChild(b))) {
  5547. this.invalidatePropertiesQueue.insert(d);
  5548. e = !1;
  5549. break
  5550. }
  5551. if (this.invalidateClientSizeFlag && (d = this.invalidateSizeQueue.removeLargestChild(b))) {
  5552. this.invalidateSizeQueue.insert(d);
  5553. e = !1;
  5554. break
  5555. }
  5556. d = this.invalidateDisplayListQueue.removeSmallestChild(b)
  5557. }
  5558. this.invalidateDisplayListQueue.isEmpty() && (this.invalidateDisplayListFlag = !1)
  5559. }
  5560. }
  5561. if (f == Number.MAX_VALUE && (this.targetLevel = Number.MAX_VALUE, !a)) for (d = this.updateCompleteQueue.removeLargestChild(b); d;) d.initialized || (d.initialized = !0),
  5562. d.hasEventListener(c.UIEvent.UPDATE_COMPLETE) && c.UIEvent.dispatchUIEvent(d, c.UIEvent.UPDATE_COMPLETE),
  5563. d.updateCompletePendingFlag = !1,
  5564. d = this.updateCompleteQueue.removeLargestChild(b)
  5565. };
  5566. return a
  5567. } (c.EventDispatcher);
  5568. c.LayoutManager = e
  5569. })(egret || (egret = {})); (function(c) {
  5570. var e = function() {
  5571. function a() {
  5572. this.depthBins = [];
  5573. this.minDepth = 0;
  5574. this.maxDepth = -1
  5575. }
  5576. a.prototype.insert = function(b) {
  5577. var a = b.nestLevel,
  5578. c = b.hashCode;
  5579. this.maxDepth < this.minDepth ? this.minDepth = this.maxDepth = a: (a < this.minDepth && (this.minDepth = a), a > this.maxDepth && (this.maxDepth = a));
  5580. var e = this.depthBins[a];
  5581. e ? null == e.items[c] && (e.items[c] = b, e.length++) : (e = new d, this.depthBins[a] = e, e.items[c] = b, e.length++)
  5582. };
  5583. a.prototype.pop = function() {
  5584. var b = null;
  5585. if (this.minDepth <= this.maxDepth) {
  5586. for (var a = this.depthBins[this.maxDepth]; ! a || 0 == a.length;) {
  5587. this.maxDepth--;
  5588. if (this.maxDepth < this.minDepth) return null;
  5589. a = this.depthBins[this.maxDepth]
  5590. }
  5591. var c = a.items,
  5592. d;
  5593. for (d in c) {
  5594. b = c[d];
  5595. this.remove(b, this.maxDepth);
  5596. break
  5597. }
  5598. for (; ! a || 0 == a.length;) {
  5599. this.maxDepth--;
  5600. if (this.maxDepth < this.minDepth) break;
  5601. a = this.depthBins[this.maxDepth]
  5602. }
  5603. }
  5604. return b
  5605. };
  5606. a.prototype.shift = function() {
  5607. var b = null;
  5608. if (this.minDepth <= this.maxDepth) {
  5609. for (var a = this.depthBins[this.minDepth]; ! a || 0 == a.length;) {
  5610. this.minDepth++;
  5611. if (this.minDepth > this.maxDepth) return null;
  5612. a = this.depthBins[this.minDepth]
  5613. }
  5614. var c = a.items,
  5615. d;
  5616. for (d in c) {
  5617. b = c[d];
  5618. this.remove(b, this.minDepth);
  5619. break
  5620. }
  5621. for (; ! a || 0 == a.length;) {
  5622. this.minDepth++;
  5623. if (this.minDepth > this.maxDepth) break;
  5624. a = this.depthBins[this.minDepth]
  5625. }
  5626. }
  5627. return b
  5628. };
  5629. a.prototype.removeLargestChild = function(b) {
  5630. for (var a = this.maxDepth,
  5631. d = b.nestLevel,
  5632. e = b.hashCode; d <= a;) {
  5633. var f = this.depthBins[a];
  5634. if (f && 0 < f.length) {
  5635. if (a == b.nestLevel) {
  5636. if (f.items[e]) return this.remove(b, a),
  5637. b
  5638. } else {
  5639. var f = f.items,
  5640. g;
  5641. for (g in f) {
  5642. var l = f[g];
  5643. if (l instanceof c.DisplayObject && b instanceof c.DisplayObjectContainer && b.contains(l)) return this.remove(l, a),
  5644. l
  5645. }
  5646. }
  5647. a--
  5648. } else if (a == this.maxDepth && this.maxDepth--, a--, a < d) break
  5649. }
  5650. return null
  5651. };
  5652. a.prototype.removeSmallestChild = function(b) {
  5653. for (var a = b.nestLevel,
  5654. d = b.hashCode; a <= this.maxDepth;) {
  5655. var e = this.depthBins[a];
  5656. if (e && 0 < e.length) {
  5657. if (a == b.nestLevel) {
  5658. if (e.items[d]) return this.remove(b, a),
  5659. b
  5660. } else {
  5661. var e = e.items,
  5662. f;
  5663. for (f in e) {
  5664. var g = e[f];
  5665. if (g instanceof c.DisplayObject && b instanceof c.DisplayObjectContainer && b.contains(g)) return this.remove(g, a),
  5666. g
  5667. }
  5668. }
  5669. a++
  5670. } else if (a == this.minDepth && this.minDepth++, a++, a > this.maxDepth) break
  5671. }
  5672. return null
  5673. };
  5674. a.prototype.remove = function(b, a) {
  5675. "undefined" === typeof a && (a = -1);
  5676. var c = b.hashCode,
  5677. d = this.depthBins[0 <= a ? a: b.nestLevel];
  5678. return d && null != d.items[c] ? (delete d.items[c], d.length--, b) : null
  5679. };
  5680. a.prototype.removeAll = function() {
  5681. this.minDepth = this.depthBins.length = 0;
  5682. this.maxDepth = -1
  5683. };
  5684. a.prototype.isEmpty = function() {
  5685. return this.minDepth > this.maxDepth
  5686. };
  5687. return a
  5688. } ();
  5689. c.DepthQueue = e;
  5690. var d = function() {
  5691. return function() {
  5692. this.length = 0;
  5693. this.items = []
  5694. }
  5695. } ();
  5696. c.DepthBin = d
  5697. })(egret || (egret = {})); (function(c) {
  5698. var e = function() {
  5699. function d() {}
  5700. Object.defineProperty(d, "stage", {
  5701. get: function() {
  5702. return d._stage
  5703. },
  5704. enumerable: !0,
  5705. configurable: !0
  5706. });
  5707. d._initlize = function(a) {
  5708. d.initlized || (d._stage = a, d._layoutManager = new c.LayoutManager, d.initlized = !0)
  5709. };
  5710. Object.defineProperty(d, "uiStage", {
  5711. get: function() {
  5712. return d._uiStage
  5713. },
  5714. enumerable: !0,
  5715. configurable: !0
  5716. });
  5717. d.initlized = !1;
  5718. return d
  5719. } ();
  5720. c.UIGlobals = e
  5721. })(egret || (egret = {}));
  5722. __extends = this.__extends ||
  5723. function(c, e) {
  5724. function d() {
  5725. this.constructor = c
  5726. }
  5727. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5728. d.prototype = e.prototype;
  5729. c.prototype = new d
  5730. }; (function(c) {
  5731. var e = function(d) {
  5732. function a() {
  5733. d.call(this);
  5734. this.initializeCalled = this._initialized = this._updateCompletePendingFlag = !1;
  5735. this._nestLevel = 0;
  5736. this._enabled = !0;
  5737. this._minWidth = this._height = this._width = 0;
  5738. this._maxWidth = 1E4;
  5739. this._minHeight = 0;
  5740. this._maxHeight = 1E4;
  5741. this._measuredHeight = this._measuredWidth = 0;
  5742. this._validateNowFlag = this._invalidateDisplayListFlag = this._invalidateSizeFlag = this._invalidatePropertiesFlag = !1;
  5743. this._includeInLayout = !0;
  5744. this._layoutHeightExplicitlySet = this._layoutWidthExplicitlySet = !1;
  5745. this.touchEnabled = !0;
  5746. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  5747. this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this)
  5748. }
  5749. __extends(a, d);
  5750. a.prototype.onAddedToStage = function(b) {
  5751. this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  5752. this._initialize();
  5753. c.UIGlobals._initlize(this.stage);
  5754. 0 < this._nestLevel && this.checkInvalidateFlag()
  5755. };
  5756. Object.defineProperty(a.prototype, "id", {
  5757. get: function() {
  5758. return this._id
  5759. },
  5760. set: function(b) {
  5761. this._id = b
  5762. },
  5763. enumerable: !0,
  5764. configurable: !0
  5765. });
  5766. Object.defineProperty(a.prototype, "isPopUp", {
  5767. get: function() {
  5768. return this._isPopUp
  5769. },
  5770. set: function(b) {
  5771. this._isPopUp = b
  5772. },
  5773. enumerable: !0,
  5774. configurable: !0
  5775. });
  5776. Object.defineProperty(a.prototype, "owner", {
  5777. get: function() {
  5778. return this._owner ? this._owner: this.parent
  5779. },
  5780. enumerable: !0,
  5781. configurable: !0
  5782. });
  5783. a.prototype.ownerChanged = function(b) {
  5784. this._owner = b
  5785. };
  5786. Object.defineProperty(a.prototype, "updateCompletePendingFlag", {
  5787. get: function() {
  5788. return this._updateCompletePendingFlag
  5789. },
  5790. set: function(b) {
  5791. this._updateCompletePendingFlag = b
  5792. },
  5793. enumerable: !0,
  5794. configurable: !0
  5795. });
  5796. Object.defineProperty(a.prototype, "initialized", {
  5797. get: function() {
  5798. return this._initialized
  5799. },
  5800. set: function(b) {
  5801. this._initialized != b && (this._initialized = b) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.CREATION_COMPLETE)
  5802. },
  5803. enumerable: !0,
  5804. configurable: !0
  5805. });
  5806. a.prototype._initialize = function() {
  5807. this.initializeCalled || (c.UIGlobals.stage && this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this), this.initializeCalled = !0, c.UIEvent.dispatchUIEvent(this, c.UIEvent.INITIALIZE), this.createChildren(), this.childrenCreated())
  5808. };
  5809. a.prototype.createChildren = function() {};
  5810. a.prototype.childrenCreated = function() {
  5811. this.invalidateProperties();
  5812. this.invalidateSize();
  5813. this.invalidateDisplayList()
  5814. };
  5815. Object.defineProperty(a.prototype, "nestLevel", {
  5816. get: function() {
  5817. return this._nestLevel
  5818. },
  5819. set: function(b) {
  5820. if (this._nestLevel != b) for (this._nestLevel = b, 0 == this._nestLevel ? this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this) : this.removeEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this), b = this.numChildren - 1; 0 <= b; b--) {
  5821. var a = this.getChildAt(b);
  5822. null != a && (a.nestLevel = this._nestLevel + 1)
  5823. }
  5824. },
  5825. enumerable: !0,
  5826. configurable: !0
  5827. });
  5828. a.prototype._addToDisplayList = function(b, a) {
  5829. "undefined" === typeof a && (a = !0);
  5830. var c = this.numChildren;
  5831. b.parent == this && c--;
  5832. this._addingChild(b);
  5833. this._doAddChild(b, c, a);
  5834. this._childAdded(b);
  5835. return b
  5836. };
  5837. a.prototype._addToDisplayListAt = function(b, a, c) {
  5838. "undefined" === typeof c && (c = !0);
  5839. this._addingChild(b);
  5840. this._doAddChild(b, a, c);
  5841. this._childAdded(b);
  5842. return b
  5843. };
  5844. a.prototype._removeFromDisplayList = function(b, a) {
  5845. "undefined" === typeof a && (a = !0);
  5846. var d = this._children.indexOf(b);
  5847. if (0 <= d) return this._doRemoveChild(d, a),
  5848. this._childRemoved(b),
  5849. b;
  5850. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  5851. return null
  5852. };
  5853. a.prototype._removeFromDisplayListAt = function(b, a) {
  5854. "undefined" === typeof a && (a = !0);
  5855. if (0 <= b && b < this._children.length) {
  5856. var d = this._doRemoveChild(b, a);
  5857. this._childRemoved(d);
  5858. return d
  5859. }
  5860. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  5861. return null
  5862. };
  5863. a.prototype.addChild = function(b) {
  5864. this._addingChild(b);
  5865. d.prototype.addChild.call(this, b);
  5866. this._childAdded(b);
  5867. return b
  5868. };
  5869. a.prototype.addChildAt = function(b, a) {
  5870. this._addingChild(b);
  5871. d.prototype.addChildAt.call(this, b, a);
  5872. this._childAdded(b);
  5873. return b
  5874. };
  5875. a.prototype._addingChild = function(b) {
  5876. b && "nestLevel" in b && (b.nestLevel = this._nestLevel + 1)
  5877. };
  5878. a.prototype._childAdded = function(b) {
  5879. b instanceof a && (b._initialize(), b.checkInvalidateFlag())
  5880. };
  5881. a.prototype.removeChild = function(b) {
  5882. d.prototype.removeChild.call(this, b);
  5883. this._childRemoved(b);
  5884. return b
  5885. };
  5886. a.prototype.removeChildAt = function(b) {
  5887. b = d.prototype.removeChildAt.call(this, b);
  5888. this._childRemoved(b);
  5889. return b
  5890. };
  5891. a.prototype._childRemoved = function(b) {
  5892. b && "nestLevel" in b && (b.nestLevel = 0)
  5893. };
  5894. a.prototype.checkInvalidateFlag = function(b) {
  5895. c.UIGlobals._layoutManager && (this._invalidatePropertiesFlag && c.UIGlobals._layoutManager.invalidateProperties(this), this._invalidateSizeFlag && c.UIGlobals._layoutManager.invalidateSize(this), this._invalidateDisplayListFlag && c.UIGlobals._layoutManager.invalidateDisplayList(this), this._validateNowFlag && (c.UIGlobals._layoutManager.validateClient(this), this._validateNowFlag = !1))
  5896. };
  5897. Object.defineProperty(a.prototype, "enabled", {
  5898. get: function() {
  5899. return this._enabled
  5900. },
  5901. set: function(b) {
  5902. this._enabled = b
  5903. },
  5904. enumerable: !0,
  5905. configurable: !0
  5906. });
  5907. a.prototype._setWidth = function(b) {
  5908. if (this._width != b || this._explicitWidth != b) d.prototype._setWidth.call(this, b),
  5909. isNaN(b) ? this.invalidateSize() : this._width = b,
  5910. this.invalidateProperties(),
  5911. this.invalidateDisplayList(),
  5912. this.invalidateParentSizeAndDisplayList()
  5913. };
  5914. Object.defineProperty(a.prototype, "width", {
  5915. get: function() {
  5916. return this._width
  5917. },
  5918. set: function(b) {
  5919. this._setWidth(b)
  5920. },
  5921. enumerable: !0,
  5922. configurable: !0
  5923. });
  5924. a.prototype._setHeight = function(b) {
  5925. if (this._height != b || this._explicitHeight != b) d.prototype._setHeight.call(this, b),
  5926. isNaN(b) ? this.invalidateSize() : this._height = b,
  5927. this.invalidateProperties(),
  5928. this.invalidateDisplayList(),
  5929. this.invalidateParentSizeAndDisplayList()
  5930. };
  5931. Object.defineProperty(a.prototype, "height", {
  5932. get: function() {
  5933. return this._height
  5934. },
  5935. set: function(b) {
  5936. this._setHeight(b)
  5937. },
  5938. enumerable: !0,
  5939. configurable: !0
  5940. });
  5941. Object.defineProperty(a.prototype, "scaleX", {
  5942. get: function() {
  5943. return this._scaleX
  5944. },
  5945. set: function(b) {
  5946. this._setScaleX(b)
  5947. },
  5948. enumerable: !0,
  5949. configurable: !0
  5950. });
  5951. a.prototype._setScaleX = function(b) {
  5952. this._scaleX != b && (this._scaleX = b, this.invalidateParentSizeAndDisplayList())
  5953. };
  5954. Object.defineProperty(a.prototype, "scaleY", {
  5955. get: function() {
  5956. return this._scaleY
  5957. },
  5958. set: function(b) {
  5959. this._setScaleY(b)
  5960. },
  5961. enumerable: !0,
  5962. configurable: !0
  5963. });
  5964. a.prototype._setScaleY = function(b) {
  5965. this._scaleY != b && (this._scaleY = b, this.invalidateParentSizeAndDisplayList())
  5966. };
  5967. Object.defineProperty(a.prototype, "minWidth", {
  5968. get: function() {
  5969. return this._minWidth
  5970. },
  5971. set: function(b) {
  5972. this._minWidth != b && (this._minWidth = b, this.invalidateSize())
  5973. },
  5974. enumerable: !0,
  5975. configurable: !0
  5976. });
  5977. Object.defineProperty(a.prototype, "maxWidth", {
  5978. get: function() {
  5979. return this._maxWidth
  5980. },
  5981. set: function(b) {
  5982. this._maxWidth != b && (this._maxWidth = b, this.invalidateSize())
  5983. },
  5984. enumerable: !0,
  5985. configurable: !0
  5986. });
  5987. Object.defineProperty(a.prototype, "minHeight", {
  5988. get: function() {
  5989. return this._minHeight
  5990. },
  5991. set: function(b) {
  5992. this._minHeight != b && (this._minHeight = b, this.invalidateSize())
  5993. },
  5994. enumerable: !0,
  5995. configurable: !0
  5996. });
  5997. Object.defineProperty(a.prototype, "maxHeight", {
  5998. get: function() {
  5999. return this._maxHeight
  6000. },
  6001. set: function(b) {
  6002. this._maxHeight != b && (this._maxHeight = b, this.invalidateSize())
  6003. },
  6004. enumerable: !0,
  6005. configurable: !0
  6006. });
  6007. Object.defineProperty(a.prototype, "measuredWidth", {
  6008. get: function() {
  6009. return this._measuredWidth
  6010. },
  6011. set: function(b) {
  6012. this._measuredWidth = b
  6013. },
  6014. enumerable: !0,
  6015. configurable: !0
  6016. });
  6017. Object.defineProperty(a.prototype, "measuredHeight", {
  6018. get: function() {
  6019. return this._measuredHeight
  6020. },
  6021. set: function(b) {
  6022. this._measuredHeight = b
  6023. },
  6024. enumerable: !0,
  6025. configurable: !0
  6026. });
  6027. a.prototype.setActualSize = function(b, a) {
  6028. var c = !1;
  6029. this._width != b && (this._width = b, c = !0);
  6030. this._height != a && (this._height = a, c = !0);
  6031. c && (this.invalidateDisplayList(), this.dispatchResizeEvent())
  6032. };
  6033. Object.defineProperty(a.prototype, "x", {
  6034. get: function() {
  6035. return this._x
  6036. },
  6037. set: function(b) {
  6038. this._x != b && (this._x = b, this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6039. },
  6040. enumerable: !0,
  6041. configurable: !0
  6042. });
  6043. Object.defineProperty(a.prototype, "y", {
  6044. get: function() {
  6045. return this._y
  6046. },
  6047. set: function(b) {
  6048. this._y != b && (this._y = b, this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6049. },
  6050. enumerable: !0,
  6051. configurable: !0
  6052. });
  6053. a.prototype.invalidateProperties = function() {
  6054. this._invalidatePropertiesFlag || (this._invalidatePropertiesFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateProperties(this))
  6055. };
  6056. a.prototype.validateProperties = function() {
  6057. this._invalidatePropertiesFlag && (this.commitProperties(), this._invalidatePropertiesFlag = !1)
  6058. };
  6059. a.prototype.invalidateSize = function() {
  6060. this._invalidateSizeFlag || (this._invalidateSizeFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateSize(this))
  6061. };
  6062. a.prototype.validateSize = function(b) {
  6063. "undefined" === typeof b && (b = !1);
  6064. if (b) for (b = 0; b < this.numChildren; b++) {
  6065. var a = this.getChildAt(b);
  6066. "validateSize" in a && a.validateSize(!0)
  6067. }
  6068. this._invalidateSizeFlag && (this.measureSizes() && (this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()), this._invalidateSizeFlag = !1)
  6069. };
  6070. a.prototype.measureSizes = function() {
  6071. var b = !1;
  6072. if (!this._invalidateSizeFlag) return b;
  6073. this.canSkipMeasurement() || (this.measure(), this.measuredWidth < this.minWidth && (this.measuredWidth = this.minWidth), this.measuredWidth > this.maxWidth && (this.measuredWidth = this.maxWidth), this.measuredHeight < this.minHeight && (this.measuredHeight = this.minHeight), this.measuredHeight > this.maxHeight && (this.measuredHeight = this.maxHeight));
  6074. if (isNaN(this._oldPreferWidth)) this._oldPreferWidth = this.preferredWidth,
  6075. this._oldPreferHeight = this.preferredHeight,
  6076. b = !0;
  6077. else {
  6078. if (this.preferredWidth != this._oldPreferWidth || this.preferredHeight != this._oldPreferHeight) b = !0;
  6079. this._oldPreferWidth = this.preferredWidth;
  6080. this._oldPreferHeight = this.preferredHeight
  6081. }
  6082. return b
  6083. };
  6084. a.prototype.invalidateDisplayList = function() {
  6085. this._invalidateDisplayListFlag || (this._invalidateDisplayListFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateDisplayList(this))
  6086. };
  6087. a.prototype.validateDisplayList = function() {
  6088. if (this._invalidateDisplayListFlag) {
  6089. var b = 0,
  6090. a = 0,
  6091. b = this._layoutWidthExplicitlySet ? this._width: isNaN(this.explicitWidth) ? this.measuredWidth: this._explicitWidth,
  6092. a = this._layoutHeightExplicitlySet ? this._height: isNaN(this.explicitHeight) ? this.measuredHeight: this._explicitHeight;
  6093. isNaN(b) && (b = 0);
  6094. isNaN(a) && (a = 0);
  6095. this.setActualSize(b, a);
  6096. this.updateDisplayList(b, a);
  6097. this._invalidateDisplayListFlag = !1
  6098. }
  6099. };
  6100. a.prototype.validateNow = function(b) {
  6101. "undefined" === typeof b && (b = !1);
  6102. this._validateNowFlag || null == c.UIGlobals._layoutManager ? this._validateNowFlag = !0 : c.UIGlobals._layoutManager.validateClient(this, b)
  6103. };
  6104. a.prototype.invalidateParentSizeAndDisplayList = function() {
  6105. if (this.parent && this._includeInLayout && "invalidateSize" in this.parent) {
  6106. var b = this.parent;
  6107. b.invalidateSize();
  6108. b.invalidateDisplayList()
  6109. }
  6110. };
  6111. a.prototype.updateDisplayList = function(b, a) {};
  6112. a.prototype.canSkipMeasurement = function() {
  6113. return ! isNaN(this._explicitWidth) && !isNaN(this._explicitHeight)
  6114. };
  6115. a.prototype.commitProperties = function() {
  6116. this.oldWidth == this._width && this.oldHeight == this._height || this.dispatchResizeEvent();
  6117. this.oldX == this.x && this.oldY == this.y || this.dispatchMoveEvent()
  6118. };
  6119. a.prototype.measure = function() {
  6120. this._measuredWidth = this._measuredHeight = 0
  6121. };
  6122. a.prototype.dispatchMoveEvent = function() {
  6123. this.hasEventListener(c.MoveEvent.MOVE) && c.MoveEvent.dispatchMoveEvent(this, this.oldX, this.oldY);
  6124. this.oldX = this.x;
  6125. this.oldY = this.y
  6126. };
  6127. a.prototype._childXYChanged = function() {};
  6128. a.prototype.dispatchResizeEvent = function() {
  6129. this.hasEventListener(c.ResizeEvent.RESIZE) && c.ResizeEvent.dispatchResizeEvent(this, this.oldWidth, this.oldHeight);
  6130. this.oldWidth = this._width;
  6131. this.oldHeight = this._height
  6132. };
  6133. Object.defineProperty(a.prototype, "includeInLayout", {
  6134. get: function() {
  6135. return this._includeInLayout
  6136. },
  6137. set: function(b) {
  6138. this._includeInLayout != b && (this._includeInLayout = !0, this.invalidateParentSizeAndDisplayList(), this._includeInLayout = b)
  6139. },
  6140. enumerable: !0,
  6141. configurable: !0
  6142. });
  6143. Object.defineProperty(a.prototype, "left", {
  6144. get: function() {
  6145. return this._left
  6146. },
  6147. set: function(b) {
  6148. this._left != b && (this._left = b, this.invalidateParentSizeAndDisplayList())
  6149. },
  6150. enumerable: !0,
  6151. configurable: !0
  6152. });
  6153. Object.defineProperty(a.prototype, "right", {
  6154. get: function() {
  6155. return this._right
  6156. },
  6157. set: function(b) {
  6158. this._right != b && (this._right = b, this.invalidateParentSizeAndDisplayList())
  6159. },
  6160. enumerable: !0,
  6161. configurable: !0
  6162. });
  6163. Object.defineProperty(a.prototype, "top", {
  6164. get: function() {
  6165. return this._top
  6166. },
  6167. set: function(b) {
  6168. this._top != b && (this._top = b, this.invalidateParentSizeAndDisplayList())
  6169. },
  6170. enumerable: !0,
  6171. configurable: !0
  6172. });
  6173. Object.defineProperty(a.prototype, "bottom", {
  6174. get: function() {
  6175. return this._bottom
  6176. },
  6177. set: function(b) {
  6178. this._bottom != b && (this._bottom = b, this.invalidateParentSizeAndDisplayList())
  6179. },
  6180. enumerable: !0,
  6181. configurable: !0
  6182. });
  6183. Object.defineProperty(a.prototype, "horizontalCenter", {
  6184. get: function() {
  6185. return this._horizontalCenter
  6186. },
  6187. set: function(b) {
  6188. this._horizontalCenter != b && (this._horizontalCenter = b, this.invalidateParentSizeAndDisplayList())
  6189. },
  6190. enumerable: !0,
  6191. configurable: !0
  6192. });
  6193. Object.defineProperty(a.prototype, "verticalCenter", {
  6194. get: function() {
  6195. return this._verticalCenter
  6196. },
  6197. set: function(b) {
  6198. this._verticalCenter != b && (this._verticalCenter = b, this.invalidateParentSizeAndDisplayList())
  6199. },
  6200. enumerable: !0,
  6201. configurable: !0
  6202. });
  6203. Object.defineProperty(a.prototype, "percentWidth", {
  6204. get: function() {
  6205. return this._percentWidth
  6206. },
  6207. set: function(b) {
  6208. this._percentWidth != b && (this._percentWidth = b, this.invalidateParentSizeAndDisplayList())
  6209. },
  6210. enumerable: !0,
  6211. configurable: !0
  6212. });
  6213. Object.defineProperty(a.prototype, "percentHeight", {
  6214. get: function() {
  6215. return this._percentHeight
  6216. },
  6217. set: function(b) {
  6218. this._percentHeight != b && (this._percentHeight = b, this.invalidateParentSizeAndDisplayList())
  6219. },
  6220. enumerable: !0,
  6221. configurable: !0
  6222. });
  6223. a.prototype.setLayoutBoundsSize = function(b, a) {
  6224. isNaN(b) ? (this._layoutWidthExplicitlySet = !1, b = this.preferredWidth) : this._layoutWidthExplicitlySet = !0;
  6225. isNaN(a) ? (this._layoutHeightExplicitlySet = !1, a = this.preferredHeight) : this._layoutHeightExplicitlySet = !0;
  6226. this.setActualSize(b / this._scaleX, a / this._scaleY)
  6227. };
  6228. a.prototype.setLayoutBoundsPosition = function(b, a) {
  6229. 0 > this._scaleX && (b += this.layoutBoundsWidth);
  6230. 0 > this._scaleY && (a += this.layoutBoundsHeight);
  6231. var c = !1;
  6232. this._x != b && (this._x = b, c = !0);
  6233. this._y != a && (this._y = a, c = !0);
  6234. c && this.dispatchMoveEvent()
  6235. };
  6236. Object.defineProperty(a.prototype, "preferredWidth", {
  6237. get: function() {
  6238. var b = this._hasWidthSet ? this._explicitWidth: this._measuredWidth,
  6239. a = this._scaleX;
  6240. 0 > a && (a = -a);
  6241. return b * a
  6242. },
  6243. enumerable: !0,
  6244. configurable: !0
  6245. });
  6246. Object.defineProperty(a.prototype, "preferredHeight", {
  6247. get: function() {
  6248. var b = this._hasHeightSet ? this._explicitHeight: this._measuredHeight,
  6249. a = this._scaleY;
  6250. 0 > a && (a = -a);
  6251. return b * a
  6252. },
  6253. enumerable: !0,
  6254. configurable: !0
  6255. });
  6256. Object.defineProperty(a.prototype, "preferredX", {
  6257. get: function() {
  6258. return 0 <= this._scaleX ? this._x: this._x - this.preferredWidth
  6259. },
  6260. enumerable: !0,
  6261. configurable: !0
  6262. });
  6263. Object.defineProperty(a.prototype, "preferredY", {
  6264. get: function() {
  6265. return 0 <= this._scaleY ? this._y: this._y - this.preferredHeight
  6266. },
  6267. enumerable: !0,
  6268. configurable: !0
  6269. });
  6270. Object.defineProperty(a.prototype, "layoutBoundsX", {
  6271. get: function() {
  6272. return 0 <= this._scaleX ? this._x: this._x - this.layoutBoundsWidth
  6273. },
  6274. enumerable: !0,
  6275. configurable: !0
  6276. });
  6277. Object.defineProperty(a.prototype, "layoutBoundsY", {
  6278. get: function() {
  6279. return 0 <= this._scaleY ? this._y: this._y - this.layoutBoundsHeight
  6280. },
  6281. enumerable: !0,
  6282. configurable: !0
  6283. });
  6284. Object.defineProperty(a.prototype, "layoutBoundsWidth", {
  6285. get: function() {
  6286. var b = 0,
  6287. b = this._layoutWidthExplicitlySet ? this._width: this._hasWidthSet ? this._explicitWidth: this._measuredWidth,
  6288. a = this._scaleX;
  6289. 0 > a && (a = -a);
  6290. return b * a
  6291. },
  6292. enumerable: !0,
  6293. configurable: !0
  6294. });
  6295. Object.defineProperty(a.prototype, "layoutBoundsHeight", {
  6296. get: function() {
  6297. var b = 0,
  6298. b = this._layoutHeightExplicitlySet ? this._height: this._hasHeightSet ? this._explicitHeight: this._measuredHeight,
  6299. a = this.scaleY;
  6300. 0 > a && (a = -a);
  6301. return b * a
  6302. },
  6303. enumerable: !0,
  6304. configurable: !0
  6305. });
  6306. return a
  6307. } (c.DisplayObjectContainer);
  6308. c.UIComponent = e
  6309. })(egret || (egret = {})); (function(c) {
  6310. var e = function() {
  6311. function c() {}
  6312. c.ABOVE = "above";
  6313. c.BELOW = "below";
  6314. c.CENTER = "center";
  6315. c.TOP_LEFT = "topLeft";
  6316. c.LEFT = "left";
  6317. c.RIGHT = "right";
  6318. return c
  6319. } ();
  6320. c.PopUpPosition = e
  6321. })(egret || (egret = {})); (function(c) {
  6322. var e = function() {
  6323. function c() {}
  6324. c.AUTO = "auto";
  6325. c.OFF = "off";
  6326. c.ON = "on";
  6327. return c
  6328. } ();
  6329. c.ScrollPolicy = e
  6330. })(egret || (egret = {}));
  6331. __extends = this.__extends ||
  6332. function(c, e) {
  6333. function d() {
  6334. this.constructor = c
  6335. }
  6336. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6337. d.prototype = e.prototype;
  6338. c.prototype = new d
  6339. }; (function(c) {
  6340. var e = function(c) {
  6341. function a(b) {
  6342. "undefined" === typeof b && (b = null);
  6343. c.call(this);
  6344. this.generator = b
  6345. }
  6346. __extends(a, c);
  6347. a.prototype.newInstance = function() {
  6348. return new this.generator
  6349. };
  6350. return a
  6351. } (c.HashObject);
  6352. c.ClassFactory = e
  6353. })(egret || (egret = {}));
  6354. __extends = this.__extends ||
  6355. function(c, e) {
  6356. function d() {
  6357. this.constructor = c
  6358. }
  6359. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6360. d.prototype = e.prototype;
  6361. c.prototype = new d
  6362. }; (function(c) {
  6363. var e = function(c) {
  6364. function a() {
  6365. c.call(this)
  6366. }
  6367. __extends(a, c);
  6368. a.prototype.initialize = function(b) {};
  6369. a.prototype.apply = function(b) {};
  6370. a.prototype.remove = function(b) {};
  6371. a.prototype.initializeFromObject = function(b) {
  6372. for (var a in b) this[a] = b[a];
  6373. return this
  6374. };
  6375. return a
  6376. } (c.HashObject);
  6377. c.OverrideBase = e
  6378. })(egret || (egret = {}));
  6379. __extends = this.__extends ||
  6380. function(c, e) {
  6381. function d() {
  6382. this.constructor = c
  6383. }
  6384. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6385. d.prototype = e.prototype;
  6386. c.prototype = new d
  6387. }; (function(c) {
  6388. var e = function(d) {
  6389. function a(b, c, e, k) {
  6390. d.call(this);
  6391. this.propertyName = "";
  6392. this.position = a.LAST;
  6393. this.target = b;
  6394. this.propertyName = c;
  6395. this.position = e;
  6396. this.relativeTo = k
  6397. }
  6398. __extends(a, d);
  6399. a.prototype.initialize = function(b) {
  6400. if ((b = b[this.target]) && !(b instanceof c.SkinnableComponent) && "_initialize" in b) try {
  6401. b._initialize()
  6402. } catch(a) {}
  6403. };
  6404. a.prototype.apply = function(b) {
  6405. var c, d;
  6406. try {
  6407. d = b[this.relativeTo]
  6408. } catch(e) {}
  6409. var f = b[this.target];
  6410. b = this.propertyName ? b[this.propertyName] : b;
  6411. if (f && b) {
  6412. switch (this.position) {
  6413. case a.FIRST:
  6414. c = 0;
  6415. break;
  6416. case a.LAST:
  6417. c = -1;
  6418. break;
  6419. case a.BEFORE:
  6420. c = b.getElementIndex(d);
  6421. break;
  6422. case a.AFTER:
  6423. c = b.getElementIndex(d) + 1
  6424. } - 1 == c && (c = b.numElements);
  6425. b.addElementAt(f, c)
  6426. }
  6427. };
  6428. a.prototype.remove = function(b) {
  6429. var a = null == this.propertyName || "" == this.propertyName ? b: b[this.propertyName]; (b = b[this.target]) && a && -1 != a.getElementIndex(b) && a.removeElement(b)
  6430. };
  6431. a.FIRST = "first";
  6432. a.LAST = "last";
  6433. a.BEFORE = "before";
  6434. a.AFTER = "after";
  6435. return a
  6436. } (c.OverrideBase);
  6437. c.AddItems = e
  6438. })(egret || (egret = {}));
  6439. __extends = this.__extends ||
  6440. function(c, e) {
  6441. function d() {
  6442. this.constructor = c
  6443. }
  6444. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6445. d.prototype = e.prototype;
  6446. c.prototype = new d
  6447. }; (function(c) {
  6448. var e = function(c) {
  6449. function a(b, a, e) {
  6450. c.call(this);
  6451. this.target = b;
  6452. this.name = a;
  6453. this.value = e
  6454. }
  6455. __extends(a, c);
  6456. a.prototype.apply = function(b) {
  6457. b = null == this.target || "" == this.target ? b: b[this.target];
  6458. null != b && (this.oldValue = b[this.name], this.setPropertyValue(b, this.name, this.value, this.oldValue))
  6459. };
  6460. a.prototype.remove = function(b) {
  6461. b = null == this.target || "" == this.target ? b: b[this.target];
  6462. null != b && (this.setPropertyValue(b, this.name, this.oldValue, this.oldValue), this.oldValue = null)
  6463. };
  6464. a.prototype.setPropertyValue = function(b, a, c, d) {
  6465. b[a] = void 0 === c || null === c ? c: "boolean" == typeof d ? this.toBoolean(c) : c
  6466. };
  6467. a.prototype.toBoolean = function(b) {
  6468. return "string" == typeof b ? "true" == b.toLowerCase() : !1 != b
  6469. };
  6470. return a
  6471. } (c.OverrideBase);
  6472. c.SetProperty = e
  6473. })(egret || (egret = {}));
  6474. __extends = this.__extends ||
  6475. function(c, e) {
  6476. function d() {
  6477. this.constructor = c
  6478. }
  6479. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6480. d.prototype = e.prototype;
  6481. c.prototype = new d
  6482. }; (function(c) {
  6483. var e = function(c) {
  6484. function a(b, a) {
  6485. c.call(this);
  6486. this.initialized = !1;
  6487. this.name = b;
  6488. this.overrides = a
  6489. }
  6490. __extends(a, c);
  6491. a.prototype.initialize = function(b) {
  6492. if (!this.initialized) {
  6493. this.initialized = !0;
  6494. for (var a = 0; a < this.overrides.length; a++) this.overrides[a].initialize(b)
  6495. }
  6496. };
  6497. return a
  6498. } (c.HashObject);
  6499. c.State = e
  6500. })(egret || (egret = {})); (function(c) {
  6501. var e = function() {
  6502. function c() {}
  6503. c.adjustRelativeByXY = function(a, b) {
  6504. "undefined" === typeof b && (b = null);
  6505. if (a && (b || (b = a.parent), b)) {
  6506. var c = a.x,
  6507. d = a.y,
  6508. e = a.layoutBoundsHeight,
  6509. f = a.layoutBoundsWidth,
  6510. g = b.width,
  6511. l = b.height;
  6512. isNaN(a.left) || (a.left = c);
  6513. isNaN(a.right) || (a.right = g - c - f);
  6514. isNaN(a.horizontalCenter) || (a.horizontalCenter = c + 0.5 * f - 0.5 * g);
  6515. isNaN(a.top) || (a.top = d);
  6516. isNaN(a.bottom) || (a.bottom = l - d - e);
  6517. isNaN(a.verticalCenter) || (a.verticalCenter = 0.5 * e - 0.5 * l + d)
  6518. }
  6519. };
  6520. return c
  6521. } ();
  6522. c.LayoutUtil = e
  6523. })(egret || (egret = {}));
  6524. __extends = this.__extends ||
  6525. function(c, e) {
  6526. function d() {
  6527. this.constructor = c
  6528. }
  6529. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6530. d.prototype = e.prototype;
  6531. c.prototype = new d
  6532. }; (function(c) {
  6533. var e = function(d) {
  6534. function a(b, a) {
  6535. "undefined" === typeof a && (a = !0);
  6536. d.call(this);
  6537. this.fillMode = "scale";
  6538. this.contentReused = this.createChildrenCalled = this.sourceChanged = !1;
  6539. this.autoScale = !0;
  6540. this.touchChildren = !1;
  6541. b && (this.source = b);
  6542. this.autoScale = a
  6543. }
  6544. __extends(a, d);
  6545. Object.defineProperty(a.prototype, "source", {
  6546. get: function() {
  6547. return this._source
  6548. },
  6549. set: function(b) {
  6550. this._source != b && (this._source = b, this.createChildrenCalled ? this.parseSource() : this.sourceChanged = !0)
  6551. },
  6552. enumerable: !0,
  6553. configurable: !0
  6554. });
  6555. Object.defineProperty(a.prototype, "content", {
  6556. get: function() {
  6557. return this._content
  6558. },
  6559. enumerable: !0,
  6560. configurable: !0
  6561. });
  6562. a.prototype.createChildren = function() {
  6563. d.prototype.createChildren.call(this);
  6564. this.sourceChanged && this.parseSource();
  6565. this.createChildrenCalled = !0
  6566. };
  6567. a.prototype.parseSource = function() {
  6568. this.sourceChanged = !1;
  6569. var b = a.assetAdapter;
  6570. b || (b = this.getAdapter());
  6571. if (this._source) {
  6572. var c = this.contentReused ? null: this._content;
  6573. this.contentReused = !0;
  6574. b.getAsset(this._source, this.contentChanged, this, c)
  6575. } else this.contentChanged(null, null)
  6576. };
  6577. a.prototype.getAdapter = function() {
  6578. var b;
  6579. try {
  6580. b = c.Injector.getInstance("egret.IAssetAdapter")
  6581. } catch(d) {
  6582. b = new c.DefaultAssetAdapter
  6583. }
  6584. return a.assetAdapter = b
  6585. };
  6586. a.prototype.contentChanged = function(b, a) {
  6587. if (a === this._source) {
  6588. var d = this._content;
  6589. this._content = b;
  6590. d !== b && (d instanceof c.DisplayObject && this._removeFromDisplayList(d), b instanceof c.DisplayObject && this._addToDisplayListAt(b, 0));
  6591. b instanceof c.Texture && b.scale9Grid instanceof c.Rectangle && (this.scale9Grid = b.scale9Grid);
  6592. this.invalidateSize();
  6593. this.invalidateDisplayList();
  6594. this.contentReused = !1;
  6595. this.hasEventListener(c.UIEvent.CONTENT_CHANGED) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.CONTENT_CHANGED)
  6596. }
  6597. };
  6598. a.prototype.measure = function() {
  6599. d.prototype.measure.call(this);
  6600. var b = this._content;
  6601. b instanceof c.DisplayObject ? "preferredWidth" in b ? (this.measuredWidth = b.preferredWidth, this.measuredHeight = b.preferredHeight) : (this.measuredWidth = b.width * b.scaleX, this.measuredHeight = b.height * b.scaleY) : b instanceof c.Texture && (this.measuredWidth = b._textureWidth, this.measuredHeight = b._textureHeight)
  6602. };
  6603. a.prototype.updateDisplayList = function(b, a) {
  6604. d.prototype.updateDisplayList.call(this, b, a);
  6605. var e = this._content;
  6606. this.autoScale && e instanceof c.DisplayObject && ("setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(b, a) : (e.width = b / e.scaleX, e.height = a / e.scaleY))
  6607. };
  6608. a.prototype._render = function(b) {
  6609. if (this._content instanceof c.Texture) {
  6610. var a = this._content;
  6611. this._texture_to_render = a;
  6612. var e;
  6613. this.autoScale ? (e = this._width, a = this._height) : (e = a.textureWidth, a = a.textureHeight);
  6614. c.Bitmap._drawBitmap(b, e, a, this)
  6615. } else this._texture_to_render = null;
  6616. d.prototype._render.call(this, b)
  6617. };
  6618. a.prototype._measureBounds = function() {
  6619. var b = d.prototype._measureBounds.call(this);
  6620. if (this._content instanceof c.Texture) {
  6621. var a = this._content,
  6622. e = this.width,
  6623. k = this.height,
  6624. f = Math.floor(a._offsetX * e / a._textureWidth),
  6625. a = Math.floor(a._offsetY * k / a._textureHeight);
  6626. f < b.x && (b.x = f);
  6627. a < b.y && (b.y = a);
  6628. f + e > b.right && (b.right = f + e);
  6629. a + k > b.bottom && (b.bottom = a + k)
  6630. }
  6631. return b
  6632. };
  6633. a.prototype.addChild = function(b) {
  6634. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  6635. };
  6636. a.prototype.addChildAt = function(b, c) {
  6637. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  6638. };
  6639. a.prototype.removeChild = function(b) {
  6640. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  6641. };
  6642. a.prototype.removeChildAt = function(b) {
  6643. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  6644. };
  6645. a.prototype.setChildIndex = function(b, c) {
  6646. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  6647. };
  6648. a.prototype.swapChildren = function(b, c) {
  6649. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  6650. };
  6651. a.prototype.swapChildrenAt = function(b, c) {
  6652. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  6653. };
  6654. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  6655. return a
  6656. } (c.UIComponent);
  6657. c.UIAsset = e
  6658. })(egret || (egret = {}));
  6659. __extends = this.__extends ||
  6660. function(c, e) {
  6661. function d() {
  6662. this.constructor = c
  6663. }
  6664. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6665. d.prototype = e.prototype;
  6666. c.prototype = new d
  6667. }; (function(c) {
  6668. var e = function(d) {
  6669. function a() {
  6670. d.call(this);
  6671. this.hostComponentKey = "egret.SkinnableComponent";
  6672. this.stateIsDirty = this.createChildrenCalled = this._skinNameExplicitlySet = !1;
  6673. this.explicitMouseEnabled = this.explicitMouseChildren = this._autoMouseEnabled = !0
  6674. }
  6675. __extends(a, d);
  6676. Object.defineProperty(a.prototype, "skinName", {
  6677. get: function() {
  6678. return this._skinName
  6679. },
  6680. set: function(b) {
  6681. this._skinName != b && (this._skinName = b, this._skinNameExplicitlySet = !0, this.createChildrenCalled && this.parseSkinName())
  6682. },
  6683. enumerable: !0,
  6684. configurable: !0
  6685. });
  6686. Object.defineProperty(a.prototype, "skin", {
  6687. get: function() {
  6688. return this._skin
  6689. },
  6690. enumerable: !0,
  6691. configurable: !0
  6692. });
  6693. a.prototype.createChildren = function() {
  6694. d.prototype.createChildren.call(this);
  6695. this.parseSkinName();
  6696. this.createChildrenCalled = !0
  6697. };
  6698. a.prototype.parseSkinName = function() {
  6699. var b = a.skinAdapter;
  6700. b || (b = this.getSkinAdapter());
  6701. var b = b.getSkin(this._skinName, this.hostComponentKey),
  6702. d = this._skin;
  6703. this.detachSkin(d);
  6704. d instanceof c.DisplayObject && this._removeFromDisplayList(d);
  6705. this._skin = b;
  6706. b instanceof c.DisplayObject && this._addToDisplayListAt(this._skin, 0);
  6707. this.attachSkin(b);
  6708. this.invalidateSkinState();
  6709. this.invalidateSize();
  6710. this.invalidateDisplayList();
  6711. this.hasEventListener(c.UIEvent.SKIN_CHANGED) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.SKIN_CHANGED)
  6712. };
  6713. a.prototype.getSkinAdapter = function() {
  6714. var b;
  6715. try {
  6716. b = c.Injector.getInstance("egret.ISkinAdapter")
  6717. } catch(d) {
  6718. b = new c.DefaultSkinAdapter
  6719. }
  6720. return a.skinAdapter = b
  6721. };
  6722. a.prototype.attachSkin = function(b) {
  6723. b && "hostComponent" in b && (b.hostComponent = this, this.findSkinParts());
  6724. b && "hostComponent" in b && b instanceof c.DisplayObject ? this._setSkinLayoutEnabled(!1) : this._setSkinLayoutEnabled(!0)
  6725. };
  6726. a.prototype.findSkinParts = function() {
  6727. var b = this._skin;
  6728. if (b && "skinParts" in b) for (var a = b.skinParts,
  6729. c = a.length,
  6730. d = 0; d < c; d++) {
  6731. var e = a[d];
  6732. if (e in b) try {
  6733. this[e] = b[e],
  6734. this.partAdded(e, b[e])
  6735. } catch(g) {}
  6736. }
  6737. };
  6738. a.prototype.detachSkin = function(b) {
  6739. if (b && "skinParts" in b) {
  6740. for (var a = b.skinParts,
  6741. c = a.length,
  6742. d = 0; d < c; d++) {
  6743. var e = a[d];
  6744. e in this && (null != this[e] && this.partRemoved(e, this[e]), this[e] = null)
  6745. }
  6746. b.hostComponent = null
  6747. }
  6748. };
  6749. a.prototype.partAdded = function(b, a) {
  6750. c.SkinPartEvent.dispatchSkinPartEvent(this, c.SkinPartEvent.PART_ADDED, b, a)
  6751. };
  6752. a.prototype.partRemoved = function(b, a) {
  6753. c.SkinPartEvent.dispatchSkinPartEvent(this, c.SkinPartEvent.PART_REMOVED, b, a)
  6754. };
  6755. a.prototype.invalidateSkinState = function() {
  6756. this.stateIsDirty || (this.stateIsDirty = !0, this.invalidateProperties())
  6757. };
  6758. a.prototype.validateSkinState = function() {
  6759. var b = this.getCurrentSkinState(),
  6760. a = this._skin;
  6761. a && "currentState" in a && (a.currentState = b);
  6762. this.hasEventListener("stateChanged") && this.dispatchEventWith("stateChanged")
  6763. };
  6764. Object.defineProperty(a.prototype, "autoTouchEnabled", {
  6765. get: function() {
  6766. return this._autoMouseEnabled
  6767. },
  6768. set: function(b) {
  6769. this._autoMouseEnabled != b && ((this._autoMouseEnabled = b) ? (this._touchChildren = this.enabled ? this.explicitMouseChildren: !1, this._touchEnabled = this.enabled ? this.explicitMouseEnabled: !1) : (this._touchChildren = this.explicitMouseChildren, this._touchEnabled = this.explicitMouseEnabled))
  6770. },
  6771. enumerable: !0,
  6772. configurable: !0
  6773. });
  6774. Object.defineProperty(a.prototype, "touchChildren", {
  6775. get: function() {
  6776. return this._touchChildren
  6777. },
  6778. set: function(b) {
  6779. this.enabled && (this._touchChildren = b);
  6780. this.explicitMouseChildren = b
  6781. },
  6782. enumerable: !0,
  6783. configurable: !0
  6784. });
  6785. Object.defineProperty(a.prototype, "touchEnabled", {
  6786. get: function() {
  6787. return this._touchEnabled
  6788. },
  6789. set: function(b) {
  6790. this.enabled && (this._touchEnabled = b);
  6791. this.explicitMouseEnabled = b
  6792. },
  6793. enumerable: !0,
  6794. configurable: !0
  6795. });
  6796. Object.defineProperty(a.prototype, "enabled", {
  6797. get: function() {
  6798. return this._enabled
  6799. },
  6800. set: function(b) {
  6801. this._setEnabled(b)
  6802. },
  6803. enumerable: !0,
  6804. configurable: !0
  6805. });
  6806. a.prototype._setEnabled = function(b) {
  6807. this._enabled != b && (this._enabled = b, this._autoMouseEnabled && (this._touchChildren = b ? this.explicitMouseChildren: !1, this._touchEnabled = b ? this.explicitMouseEnabled: !1), this.invalidateSkinState())
  6808. };
  6809. a.prototype.getCurrentSkinState = function() {
  6810. return this.enabled ? "normal": "disabled"
  6811. };
  6812. a.prototype.commitProperties = function() {
  6813. d.prototype.commitProperties.call(this);
  6814. this.stateIsDirty && (this.stateIsDirty = !1, this.validateSkinState())
  6815. };
  6816. a.prototype._setSkinLayoutEnabled = function(b) {
  6817. null != this.skinLayout != b && (b ? (this.skinLayout = new c.SkinBasicLayout, this.skinLayout.target = this) : this.skinLayout = this.skinLayout.target = null, this.invalidateSize(), this.invalidateDisplayList())
  6818. };
  6819. a.prototype._childXYChanged = function() {
  6820. this.skinLayout && (this.invalidateSize(), this.invalidateDisplayList())
  6821. };
  6822. a.prototype.measure = function() {
  6823. d.prototype.measure.call(this);
  6824. var b = this._skin;
  6825. if (b) {
  6826. var a = b instanceof c.DisplayObject;
  6827. a && (b && "preferredWidth" in b ? (this.measuredWidth = b.preferredWidth, this.measuredHeight = b.preferredHeight) : (this.measuredWidth = b.width, this.measuredHeight = b.height));
  6828. this.skinLayout && this.skinLayout.measure();
  6829. if (!a) {
  6830. var a = this.measuredWidth,
  6831. e = this.measuredHeight;
  6832. try {
  6833. isNaN(b.width) || (a = Math.ceil(b.width)),
  6834. isNaN(b.height) || (e = Math.ceil(b.height)),
  6835. b.hasOwnProperty("minWidth") && a < b.minWidth && (a = b.minWidth),
  6836. b.hasOwnProperty("maxWidth") && a > b.maxWidth && (a = b.maxWidth),
  6837. b.hasOwnProperty("minHeight") && e < b.minHeight && (e = b.minHeight),
  6838. b.hasOwnProperty("maxHeight") && e > b.maxHeight && (e = b.maxHeight),
  6839. this.measuredWidth = a,
  6840. this.measuredHeight = e
  6841. } catch(k) {}
  6842. }
  6843. }
  6844. };
  6845. a.prototype.updateDisplayList = function(b, a) {
  6846. d.prototype.updateDisplayList.call(this, b, a);
  6847. var e = this._skin;
  6848. e && ("setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(b, a) : e instanceof c.DisplayObject && (e.scaleX = 0 == e.width ? 1 : b / e.width, e.scaleY = 0 == e.height ? 1 : a / e.height));
  6849. this.skinLayout && this.skinLayout.updateDisplayList(b, a)
  6850. };
  6851. a.prototype.addChild = function(b) {
  6852. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  6853. };
  6854. a.prototype.addChildAt = function(b, c) {
  6855. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  6856. };
  6857. a.prototype.removeChild = function(b) {
  6858. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  6859. };
  6860. a.prototype.removeChildAt = function(b) {
  6861. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  6862. };
  6863. a.prototype.setChildIndex = function(b, c) {
  6864. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  6865. };
  6866. a.prototype.swapChildren = function(b, c) {
  6867. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  6868. };
  6869. a.prototype.swapChildrenAt = function(b, c) {
  6870. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  6871. };
  6872. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  6873. return a
  6874. } (c.UIComponent);
  6875. c.SkinnableComponent = e
  6876. })(egret || (egret = {})); (function(c) {
  6877. var e = function() {
  6878. function d() {}
  6879. d.prototype.getSkin = function(a, b) {
  6880. if (!a) return null;
  6881. if (a.prototype) return new a;
  6882. if ("string" == typeof a) {
  6883. var d = c.getDefinitionByName(a);
  6884. return d ? new d: null
  6885. }
  6886. return a
  6887. };
  6888. return d
  6889. } ();
  6890. c.DefaultSkinAdapter = e
  6891. })(egret || (egret = {})); (function(c) {
  6892. var e = function() {
  6893. function d() {}
  6894. d.prototype.getAsset = function(a, b, d, e) {
  6895. var k = a;
  6896. a.prototype && (k = new a);
  6897. if (k instanceof c.DisplayObject || k instanceof c.Texture) b.call(d, k, a);
  6898. else if ("string" == typeof a) {
  6899. var f = new c.URLLoader;
  6900. f.dataFormat = c.URLLoaderDataFormat.TEXTURE;
  6901. f.addEventListener(c.Event.COMPLETE,
  6902. function(c) {
  6903. k = f.data;
  6904. b.call(d, k, a)
  6905. },
  6906. this);
  6907. f.load(new c.URLRequest(a))
  6908. } else b.call(d, k, a)
  6909. };
  6910. return d
  6911. } ();
  6912. c.DefaultAssetAdapter = e
  6913. })(egret || (egret = {}));
  6914. __extends = this.__extends ||
  6915. function(c, e) {
  6916. function d() {
  6917. this.constructor = c
  6918. }
  6919. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6920. d.prototype = e.prototype;
  6921. c.prototype = new d
  6922. }; (function(c) {
  6923. var e = function(c) {
  6924. function a() {
  6925. c.call(this)
  6926. }
  6927. __extends(a, c);
  6928. Object.defineProperty(a.prototype, "target", {
  6929. get: function() {
  6930. return this._target
  6931. },
  6932. set: function(b) {
  6933. this._target = b
  6934. },
  6935. enumerable: !0,
  6936. configurable: !0
  6937. });
  6938. a.prototype.measure = function() {
  6939. if (null != this.target) {
  6940. for (var b = 0,
  6941. a = 0,
  6942. c = this._target.skin,
  6943. d = this.target.numChildren,
  6944. e = 0; e < d; e++) {
  6945. var g = this.target.getChildAt(e);
  6946. if (g && g != c && g.includeInLayout) {
  6947. var l = g.horizontalCenter,
  6948. n = g.verticalCenter,
  6949. p = g.left,
  6950. q = g.right,
  6951. r = g.top,
  6952. s = g.bottom;
  6953. isNaN(p) || isNaN(q) ? isNaN(l) ? isNaN(p) && isNaN(q) ? l = g.preferredX: (l = isNaN(p) ? 0 : p, l += isNaN(q) ? 0 : q) : l = 2 * Math.abs(l) : l = p + q;
  6954. isNaN(r) || isNaN(s) ? isNaN(n) ? isNaN(r) && isNaN(s) ? n = g.preferredY: (n = isNaN(r) ? 0 : r, n += isNaN(s) ? 0 : s) : n = 2 * Math.abs(n) : n = r + s;
  6955. s = g.preferredHeight;
  6956. b = Math.ceil(Math.max(b, l + g.preferredWidth));
  6957. a = Math.ceil(Math.max(a, n + s))
  6958. }
  6959. }
  6960. this.target.measuredWidth = Math.max(b, this.target.measuredWidth);
  6961. this.target.measuredHeight = Math.max(a, this.target.measuredHeight)
  6962. }
  6963. };
  6964. a.prototype.updateDisplayList = function(b, a) {
  6965. if (null != this.target) for (var c = this.target.numChildren,
  6966. d = this._target.skin,
  6967. e = 0; e < c; e++) {
  6968. var g = this.target.getChildAt(e);
  6969. if (null != g && g != d && g.includeInLayout) {
  6970. var l = g.horizontalCenter,
  6971. n = g.verticalCenter,
  6972. p = g.left,
  6973. q = g.right,
  6974. r = g.top,
  6975. s = g.bottom,
  6976. z = g.percentWidth,
  6977. A = g.percentHeight,
  6978. v = NaN,
  6979. B = NaN;
  6980. isNaN(p) || isNaN(q) ? isNaN(z) || (v = Math.round(b * Math.min(0.01 * z, 1))) : v = b - q - p;
  6981. isNaN(r) || isNaN(s) ? isNaN(A) || (B = Math.round(a * Math.min(0.01 * A, 1))) : B = a - s - r;
  6982. g.setLayoutBoundsSize(v, B);
  6983. z = g.layoutBoundsWidth;
  6984. A = g.layoutBoundsHeight;
  6985. B = v = NaN;
  6986. v = isNaN(l) ? isNaN(p) ? isNaN(q) ? g.layoutBoundsX: b - z - q: p: Math.round((b - z) / 2 + l);
  6987. B = isNaN(n) ? isNaN(r) ? isNaN(s) ? g.layoutBoundsY: a - A - s: r: Math.round((a - A) / 2 + n);
  6988. g.setLayoutBoundsPosition(v, B)
  6989. }
  6990. }
  6991. };
  6992. return a
  6993. } (c.HashObject);
  6994. c.SkinBasicLayout = e
  6995. })(egret || (egret = {}));
  6996. __extends = this.__extends ||
  6997. function(c, e) {
  6998. function d() {
  6999. this.constructor = c
  7000. }
  7001. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7002. d.prototype = e.prototype;
  7003. c.prototype = new d
  7004. }; (function(c) {
  7005. var e = function(d) {
  7006. function a() {
  7007. d.call(this);
  7008. this._autoRepeat = this._downEventFired = !1;
  7009. this._repeatInterval = this._repeatDelay = 35;
  7010. this._keepDown = this._hovered = !1;
  7011. this._label = "";
  7012. this.touchChildren = this._stickyHighlighting = this._mouseCaptured = !1;
  7013. this.addHandlers()
  7014. }
  7015. __extends(a, d);
  7016. Object.defineProperty(a.prototype, "autoRepeat", {
  7017. get: function() {
  7018. return this._autoRepeat
  7019. },
  7020. set: function(b) {
  7021. b != this._autoRepeat && (this._autoRepeat = b, this.checkAutoRepeatTimerConditions(this.isDown()))
  7022. },
  7023. enumerable: !0,
  7024. configurable: !0
  7025. });
  7026. Object.defineProperty(a.prototype, "repeatDelay", {
  7027. get: function() {
  7028. return this._repeatDelay
  7029. },
  7030. set: function(b) {
  7031. this._repeatDelay = b
  7032. },
  7033. enumerable: !0,
  7034. configurable: !0
  7035. });
  7036. Object.defineProperty(a.prototype, "repeatInterval", {
  7037. get: function() {
  7038. return this._repeatInterval
  7039. },
  7040. set: function(b) {
  7041. this._repeatInterval = b
  7042. },
  7043. enumerable: !0,
  7044. configurable: !0
  7045. });
  7046. Object.defineProperty(a.prototype, "hovered", {
  7047. get: function() {
  7048. return this._hovered
  7049. },
  7050. set: function(b) {
  7051. b != this._hovered && (this._hovered = b, this.invalidateSkinState(), this.checkButtonDownConditions())
  7052. },
  7053. enumerable: !0,
  7054. configurable: !0
  7055. });
  7056. a.prototype._setKeepDown = function(b) {
  7057. this._keepDown != b && (this._keepDown = b, this.invalidateSkinState())
  7058. };
  7059. Object.defineProperty(a.prototype, "label", {
  7060. get: function() {
  7061. return this._getLabel()
  7062. },
  7063. set: function(b) {
  7064. this._setLabel(b)
  7065. },
  7066. enumerable: !0,
  7067. configurable: !0
  7068. });
  7069. a.prototype._getLabel = function() {
  7070. return this.labelDisplay ? this.labelDisplay.text: this._label
  7071. };
  7072. a.prototype._setLabel = function(b) {
  7073. this._label = b;
  7074. this.labelDisplay && (this.labelDisplay.text = b)
  7075. };
  7076. Object.defineProperty(a.prototype, "mouseCaptured", {
  7077. get: function() {
  7078. return this._mouseCaptured
  7079. },
  7080. set: function(b) {
  7081. b != this._mouseCaptured && (this._mouseCaptured = b, this.invalidateSkinState(), b || this.removeStageMouseHandlers(), this.checkButtonDownConditions())
  7082. },
  7083. enumerable: !0,
  7084. configurable: !0
  7085. });
  7086. Object.defineProperty(a.prototype, "stickyHighlighting", {
  7087. get: function() {
  7088. return this._stickyHighlighting
  7089. },
  7090. set: function(b) {
  7091. b != this._stickyHighlighting && (this._stickyHighlighting = b, this.invalidateSkinState(), this.checkButtonDownConditions())
  7092. },
  7093. enumerable: !0,
  7094. configurable: !0
  7095. });
  7096. a.prototype.checkButtonDownConditions = function() {
  7097. var b = this.isDown();
  7098. this._downEventFired != b && (b && c.UIEvent.dispatchUIEvent(this, c.UIEvent.BUTTON_DOWN), this._downEventFired = b, this.checkAutoRepeatTimerConditions(b))
  7099. };
  7100. a.prototype.addHandlers = function() {
  7101. this.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.mouseEventHandler, this);
  7102. this.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.mouseEventHandler, this);
  7103. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.mouseEventHandler, this);
  7104. this.addEventListener(c.TouchEvent.TOUCH_END, this.mouseEventHandler, this);
  7105. this.addEventListener(c.TouchEvent.TOUCH_TAP, this.mouseEventHandler, this)
  7106. };
  7107. a.prototype.addStageMouseHandlers = function() {
  7108. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  7109. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  7110. };
  7111. a.prototype.removeStageMouseHandlers = function() {
  7112. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  7113. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  7114. };
  7115. a.prototype.isDown = function() {
  7116. return this.enabled ? this.mouseCaptured && (this.hovered || this.stickyHighlighting) ? !0 : !1 : !1
  7117. };
  7118. a.prototype.checkAutoRepeatTimerConditions = function(b) {
  7119. b = this.autoRepeat && b;
  7120. b != (null != this.autoRepeatTimer) && (b ? this.startTimer() : this.stopTimer())
  7121. };
  7122. a.prototype.startTimer = function() {
  7123. this.autoRepeatTimer = new c.Timer(1);
  7124. this.autoRepeatTimer.delay = this._repeatDelay;
  7125. this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerDelayHandler, this);
  7126. this.autoRepeatTimer.start()
  7127. };
  7128. a.prototype.stopTimer = function() {
  7129. this.autoRepeatTimer.stop();
  7130. this.autoRepeatTimer = null
  7131. };
  7132. a.prototype.mouseEventHandler = function(b) {
  7133. switch (b.type) {
  7134. case c.TouchEvent.TOUCH_ROLL_OVER:
  7135. if (b.touchDown && !this.mouseCaptured) break;
  7136. this.hovered = !0;
  7137. break;
  7138. case c.TouchEvent.TOUCH_ROLL_OUT:
  7139. this.hovered = !1;
  7140. break;
  7141. case c.TouchEvent.TOUCH_BEGIN:
  7142. this.addStageMouseHandlers();
  7143. c.InteractionMode.mode == c.InteractionMode.TOUCH && (this.hovered = !0);
  7144. this.mouseCaptured = !0;
  7145. break;
  7146. case c.TouchEvent.TOUCH_END:
  7147. b.target == this && (this.hovered = !0, this.mouseCaptured && (this.buttonReleased(), this.mouseCaptured = !1));
  7148. break;
  7149. case c.TouchEvent.TOUCH_TAP:
  7150. this.enabled ? this.clickHandler(b) : b.stopImmediatePropagation()
  7151. }
  7152. };
  7153. a.prototype.buttonReleased = function() {};
  7154. a.prototype.clickHandler = function(b) {};
  7155. a.prototype.stage_mouseUpHandler = function(b) {
  7156. b.target != this && (this.mouseCaptured = !1)
  7157. };
  7158. a.prototype.autoRepeat_timerDelayHandler = function(b) {
  7159. this.autoRepeatTimer.reset();
  7160. this.autoRepeatTimer.removeEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerDelayHandler, this);
  7161. this.autoRepeatTimer.delay = this._repeatInterval;
  7162. this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerHandler, this);
  7163. this.autoRepeatTimer.start()
  7164. };
  7165. a.prototype.autoRepeat_timerHandler = function(b) {
  7166. c.UIEvent.dispatchUIEvent(this, c.UIEvent.BUTTON_DOWN)
  7167. };
  7168. a.prototype.getCurrentSkinState = function() {
  7169. return this.enabled ? this.isDown() || this._keepDown ? "down": c.InteractionMode.mode == c.InteractionMode.MOUSE && (this.hovered || this.mouseCaptured) ? "over": "up": d.prototype.getCurrentSkinState.call(this)
  7170. };
  7171. a.prototype.partAdded = function(b, a) {
  7172. d.prototype.partAdded.call(this, b, a);
  7173. a == this.labelDisplay && (this.labelDisplay.text = this._label)
  7174. };
  7175. return a
  7176. } (c.SkinnableComponent);
  7177. c.ButtonBase = e
  7178. })(egret || (egret = {}));
  7179. __extends = this.__extends ||
  7180. function(c, e) {
  7181. function d() {
  7182. this.constructor = c
  7183. }
  7184. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7185. d.prototype = e.prototype;
  7186. c.prototype = new d
  7187. }; (function(c) {
  7188. var e = function(d) {
  7189. function a() {
  7190. d.call(this);
  7191. this._autoSelected = !0
  7192. }
  7193. __extends(a, d);
  7194. Object.defineProperty(a.prototype, "selected", {
  7195. get: function() {
  7196. return this._selected
  7197. },
  7198. set: function(b) {
  7199. this._setSelected(b)
  7200. },
  7201. enumerable: !0,
  7202. configurable: !0
  7203. });
  7204. a.prototype._setSelected = function(b) {
  7205. b != this._selected && (this._selected = b, c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT), this.invalidateSkinState())
  7206. };
  7207. a.prototype.getCurrentSkinState = function() {
  7208. return this.selected ? d.prototype.getCurrentSkinState.call(this) + "AndSelected": d.prototype.getCurrentSkinState.call(this)
  7209. };
  7210. a.prototype.buttonReleased = function() {
  7211. d.prototype.buttonReleased.call(this);
  7212. this._autoSelected && this.enabled && (this.selected = !this.selected, this.dispatchEventWith(c.Event.CHANGE))
  7213. };
  7214. return a
  7215. } (c.ButtonBase);
  7216. c.ToggleButtonBase = e
  7217. })(egret || (egret = {}));
  7218. __extends = this.__extends ||
  7219. function(c, e) {
  7220. function d() {
  7221. this.constructor = c
  7222. }
  7223. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7224. d.prototype = e.prototype;
  7225. c.prototype = new d
  7226. }; (function(c) {
  7227. var e = function(d) {
  7228. function a() {
  7229. d.call(this);
  7230. this._fontFamily = "SimSun";
  7231. this._size = 30;
  7232. this._textAlign = c.HorizontalAlign.LEFT;
  7233. this._verticalAlign = c.VerticalAlign.TOP;
  7234. this._lineSpacing = 0;
  7235. this._textColor = 16777215;
  7236. this._text = ""
  7237. }
  7238. __extends(a, d);
  7239. Object.defineProperty(a.prototype, "fontFamily", {
  7240. get: function() {
  7241. return this._fontFamily
  7242. },
  7243. set: function(b) {
  7244. this._fontFamily != b && (this._fontFamily = b, this.fontFamilyChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7245. },
  7246. enumerable: !0,
  7247. configurable: !0
  7248. });
  7249. Object.defineProperty(a.prototype, "size", {
  7250. get: function() {
  7251. return this._size
  7252. },
  7253. set: function(b) {
  7254. this._size != b && (this._size = b, this.sizeChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7255. },
  7256. enumerable: !0,
  7257. configurable: !0
  7258. });
  7259. Object.defineProperty(a.prototype, "bold", {
  7260. get: function() {
  7261. return this._bold
  7262. },
  7263. set: function(b) {
  7264. this._bold != b && (this._bold = b, this.boldChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7265. },
  7266. enumerable: !0,
  7267. configurable: !0
  7268. });
  7269. Object.defineProperty(a.prototype, "italic", {
  7270. get: function() {
  7271. return this._italic
  7272. },
  7273. set: function(b) {
  7274. this._italic != b && (this._italic = b, this.italicChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7275. },
  7276. enumerable: !0,
  7277. configurable: !0
  7278. });
  7279. Object.defineProperty(a.prototype, "textAlign", {
  7280. get: function() {
  7281. return this._textAlign
  7282. },
  7283. set: function(b) {
  7284. this._textAlign != b && (this._textAlign = b, this.textAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7285. },
  7286. enumerable: !0,
  7287. configurable: !0
  7288. });
  7289. Object.defineProperty(a.prototype, "verticalAlign", {
  7290. get: function() {
  7291. return this._verticalAlign
  7292. },
  7293. set: function(b) {
  7294. this._verticalAlign != b && (this._verticalAlign = b, this.verticalAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7295. },
  7296. enumerable: !0,
  7297. configurable: !0
  7298. });
  7299. Object.defineProperty(a.prototype, "lineSpacing", {
  7300. get: function() {
  7301. return this._lineSpacing
  7302. },
  7303. set: function(b) {
  7304. this._lineSpacing != b && (this._lineSpacing = b, this.lineSpacingChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7305. },
  7306. enumerable: !0,
  7307. configurable: !0
  7308. });
  7309. Object.defineProperty(a.prototype, "textColor", {
  7310. get: function() {
  7311. return this._textColor
  7312. },
  7313. set: function(b) {
  7314. this._textColor != b && (this._textColor = b, this.textColorChanged = !0, this.invalidateProperties())
  7315. },
  7316. enumerable: !0,
  7317. configurable: !0
  7318. });
  7319. Object.defineProperty(a.prototype, "text", {
  7320. get: function() {
  7321. return this._text
  7322. },
  7323. set: function(b) {
  7324. b != this._text && (this._text = b, this._textChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7325. },
  7326. enumerable: !0,
  7327. configurable: !0
  7328. });
  7329. a.prototype.createChildren = function() {
  7330. d.prototype.createChildren.call(this);
  7331. this._textField || this.checkTextField()
  7332. };
  7333. a.prototype.commitProperties = function() {
  7334. d.prototype.commitProperties.call(this);
  7335. this._textField || this.checkTextField();
  7336. this.fontFamilyChanged && (this._textField.fontFamily = this._fontFamily, this.fontFamilyChanged = !1);
  7337. this.sizeChanged && (this._textField.size = this._size, this.sizeChanged = !1);
  7338. this.boldChanged && (this._textField.bold = this._bold, this.boldChanged = !1);
  7339. this.italic && (this._textField.italic = this._italic, this.italicChanged = !1);
  7340. this.textAlignChanged && (this._textField.textAlign = this._textAlign, this.textAlignChanged = !1);
  7341. this.verticalAlignChanged && (this._textField.verticalAlign = this._verticalAlign, this.verticalAlignChanged = !1);
  7342. this.lineSpacingChanged && (this._textField.lineSpacing = this._lineSpacing, this.lineSpacingChanged = !1);
  7343. this.textColorChanged && (this._textField.textColor = this._textColor, this.textColorChanged = !1);
  7344. this._textChanged && (this._textField.text = this._text, this._textChanged = !1)
  7345. };
  7346. a.prototype.checkTextField = function() {
  7347. this._textField || (this.createTextField(), this._textField.text = this._text, this._textChanged = !0, this.invalidateProperties())
  7348. };
  7349. a.prototype.createTextField = function() {
  7350. this._textField = new c.TextField;
  7351. this._textField.fontFamily = this._fontFamily;
  7352. this._textField.size = this._size;
  7353. this._textField.textAlign = this._textAlign;
  7354. this._textField.verticalAlign = this._verticalAlign;
  7355. this._textField.lineSpacing = this._lineSpacing;
  7356. this._textField.textColor = this._textColor;
  7357. this._addToDisplayList(this._textField)
  7358. };
  7359. a.prototype.measure = function() {
  7360. d.prototype.measure.call(this);
  7361. this.measuredWidth = a.DEFAULT_MEASURED_WIDTH;
  7362. this.measuredHeight = a.DEFAULT_MEASURED_HEIGHT
  7363. };
  7364. a.prototype.$updateDisplayList = function(b, a) {
  7365. d.prototype.updateDisplayList.call(this, b, a)
  7366. };
  7367. a.prototype.updateDisplayList = function(b, a) {
  7368. d.prototype.updateDisplayList.call(this, b, a);
  7369. this._textField.width = b;
  7370. this._textField.height = a
  7371. };
  7372. a.DEFAULT_MEASURED_WIDTH = 160;
  7373. a.DEFAULT_MEASURED_HEIGHT = 22;
  7374. return a
  7375. } (c.UIComponent);
  7376. c.TextBase = e
  7377. })(egret || (egret = {}));
  7378. __extends = this.__extends ||
  7379. function(c, e) {
  7380. function d() {
  7381. this.constructor = c
  7382. }
  7383. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7384. d.prototype = e.prototype;
  7385. c.prototype = new d
  7386. }; (function(c) {
  7387. var e = function(d) {
  7388. function a() {
  7389. d.call(this);
  7390. this._contentHeight = this._contentWidth = 0;
  7391. this._clipAndEnableScrolling = !1;
  7392. this._verticalScrollPosition = this._horizontalScrollPosition = 0;
  7393. this.touchEnabled = this._layoutInvalidateSizeFlag = this._layoutInvalidateDisplayListFlag = !1
  7394. }
  7395. __extends(a, d);
  7396. a.prototype.createChildren = function() {
  7397. d.prototype.createChildren.call(this);
  7398. this._layout || (this.layout = new c.BasicLayout)
  7399. };
  7400. Object.defineProperty(a.prototype, "contentWidth", {
  7401. get: function() {
  7402. return this._contentWidth
  7403. },
  7404. enumerable: !0,
  7405. configurable: !0
  7406. });
  7407. a.prototype.setContentWidth = function(b) {
  7408. if (b != this._contentWidth) {
  7409. var a = this._contentWidth;
  7410. this._contentWidth = b;
  7411. this.hasEventListener("propertyChange") && c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "contentWidth", a, b, this)
  7412. }
  7413. };
  7414. Object.defineProperty(a.prototype, "contentHeight", {
  7415. get: function() {
  7416. return this._contentHeight
  7417. },
  7418. enumerable: !0,
  7419. configurable: !0
  7420. });
  7421. a.prototype.setContentHeight = function(b) {
  7422. if (b != this._contentHeight) {
  7423. var a = this._contentHeight;
  7424. this._contentHeight = b;
  7425. this.hasEventListener("propertyChange") && c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "contentHeight", a, b, this)
  7426. }
  7427. };
  7428. a.prototype.setContentSize = function(b, a) {
  7429. if (b != this._contentWidth || a != this._contentHeight) this.setContentWidth(b),
  7430. this.setContentHeight(a)
  7431. };
  7432. Object.defineProperty(a.prototype, "layout", {
  7433. get: function() {
  7434. return this._layout
  7435. },
  7436. set: function(b) {
  7437. this._setLayout(b)
  7438. },
  7439. enumerable: !0,
  7440. configurable: !0
  7441. });
  7442. a.prototype._setLayout = function(b) {
  7443. if (this._layout != b) {
  7444. this._layout && (this._layout.target = null);
  7445. if (this._layout = b) this._layout.target = this;
  7446. this.invalidateSize();
  7447. this.invalidateDisplayList();
  7448. this.dispatchEventWith("layoutChanged")
  7449. }
  7450. };
  7451. Object.defineProperty(a.prototype, "clipAndEnableScrolling", {
  7452. get: function() {
  7453. return this._clipAndEnableScrolling
  7454. },
  7455. set: function(b) {
  7456. b != this._clipAndEnableScrolling && (this.scrollRect = (this._clipAndEnableScrolling = b) ? new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, this.width, this.height) : null)
  7457. },
  7458. enumerable: !0,
  7459. configurable: !0
  7460. });
  7461. Object.defineProperty(a.prototype, "horizontalScrollPosition", {
  7462. get: function() {
  7463. return this._horizontalScrollPosition
  7464. },
  7465. set: function(b) {
  7466. if (b != this._horizontalScrollPosition) {
  7467. var a = this._horizontalScrollPosition;
  7468. this._horizontalScrollPosition = b;
  7469. this.scrollPositionChanged();
  7470. c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "horizontalScrollPosition", a, b, this)
  7471. }
  7472. },
  7473. enumerable: !0,
  7474. configurable: !0
  7475. });
  7476. Object.defineProperty(a.prototype, "verticalScrollPosition", {
  7477. get: function() {
  7478. return this._verticalScrollPosition
  7479. },
  7480. set: function(b) {
  7481. if (b != this._verticalScrollPosition) {
  7482. var a = this._verticalScrollPosition;
  7483. this._verticalScrollPosition = b;
  7484. this.scrollPositionChanged();
  7485. c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "verticalScrollPosition", a, b, this)
  7486. }
  7487. },
  7488. enumerable: !0,
  7489. configurable: !0
  7490. });
  7491. a.prototype.scrollPositionChanged = function() {
  7492. this._clipAndEnableScrolling && (this.updateScrollRect(this.width, this.height), this._invalidateDisplayListExceptLayout(), this._layout && this._layout.scrollPositionChanged())
  7493. };
  7494. a.prototype.updateScrollRect = function(b, a) {
  7495. var d = this._scrollRect;
  7496. this._clipAndEnableScrolling ? d ? (d.x = this._horizontalScrollPosition, d.y = this._verticalScrollPosition, d.width = b, d.height = a) : this._scrollRect = new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, b, a) : d && (this._scrollRect = null)
  7497. };
  7498. a.prototype.measure = function() {
  7499. this._layout && this._layoutInvalidateSizeFlag && (d.prototype.measure.call(this), this._layout.measure())
  7500. };
  7501. a.prototype._invalidateDisplayListExceptLayout = function() {
  7502. d.prototype.invalidateDisplayList.call(this)
  7503. };
  7504. a.prototype.invalidateDisplayList = function() {
  7505. d.prototype.invalidateDisplayList.call(this);
  7506. this._layoutInvalidateDisplayListFlag = !0
  7507. };
  7508. a.prototype._childXYChanged = function() {
  7509. this.invalidateSize();
  7510. this.invalidateDisplayList()
  7511. };
  7512. a.prototype._invalidateSizeExceptLayout = function() {
  7513. d.prototype.invalidateSize.call(this)
  7514. };
  7515. a.prototype.invalidateSize = function() {
  7516. d.prototype.invalidateSize.call(this);
  7517. this._layoutInvalidateSizeFlag = !0
  7518. };
  7519. a.prototype.updateDisplayList = function(b, a) {
  7520. d.prototype.updateDisplayList.call(this, b, a);
  7521. this._layoutInvalidateDisplayListFlag && this._layout && (this._layoutInvalidateDisplayListFlag = !1, this._layout.updateDisplayList(b, a), this.updateScrollRect(b, a))
  7522. };
  7523. Object.defineProperty(a.prototype, "numElements", {
  7524. get: function() {
  7525. return - 1
  7526. },
  7527. enumerable: !0,
  7528. configurable: !0
  7529. });
  7530. a.prototype.getElementAt = function(b) {
  7531. return null
  7532. };
  7533. a.prototype.getElementIndex = function(b) {
  7534. return - 1
  7535. };
  7536. a.prototype.getElementIndicesInView = function() {
  7537. var b = [],
  7538. a;
  7539. if (this.scrollRect) for (a = 0; a < this.numChildren; a++) {
  7540. var d = this.getChildAt(a);
  7541. if (d) {
  7542. var e = new c.Rectangle;
  7543. e.x = d.layoutBoundsX;
  7544. e.y = d.layoutBoundsY;
  7545. e.width = d.layoutBoundsWidth;
  7546. e.height = d.layoutBoundsHeight;
  7547. this.scrollRect.intersects(e) && b.push(a)
  7548. }
  7549. } else for (a = 0; a < this.numChildren; a++) b.push(a);
  7550. return b
  7551. };
  7552. a.prototype.setVirtualElementIndicesInView = function(b, a) {};
  7553. a.prototype.getVirtualElementAt = function(b) {
  7554. return this.getElementAt(b)
  7555. };
  7556. return a
  7557. } (c.UIComponent);
  7558. c.GroupBase = e
  7559. })(egret || (egret = {}));
  7560. __extends = this.__extends ||
  7561. function(c, e) {
  7562. function d() {
  7563. this.constructor = c
  7564. }
  7565. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7566. d.prototype = e.prototype;
  7567. c.prototype = new d
  7568. }; (function(c) {
  7569. var e = function(c) {
  7570. function a() {
  7571. c.call(this);
  7572. this._selected = this.dataChangedFlag = !1;
  7573. this._itemIndex = -1;
  7574. this.touchChildren = !0
  7575. }
  7576. __extends(a, c);
  7577. Object.defineProperty(a.prototype, "data", {
  7578. get: function() {
  7579. return this._data
  7580. },
  7581. set: function(b) {
  7582. this._data = b;
  7583. this.initialized || this.parent ? (this.dataChangedFlag = !1, this.dataChanged()) : (this.dataChangedFlag = !0, this.invalidateProperties())
  7584. },
  7585. enumerable: !0,
  7586. configurable: !0
  7587. });
  7588. a.prototype.dataChanged = function() {};
  7589. Object.defineProperty(a.prototype, "selected", {
  7590. get: function() {
  7591. return this._selected
  7592. },
  7593. set: function(b) {
  7594. this._selected != b && (this._selected = b, this.invalidateSkinState())
  7595. },
  7596. enumerable: !0,
  7597. configurable: !0
  7598. });
  7599. Object.defineProperty(a.prototype, "itemIndex", {
  7600. get: function() {
  7601. return this._itemIndex
  7602. },
  7603. set: function(b) {
  7604. this._itemIndex = b
  7605. },
  7606. enumerable: !0,
  7607. configurable: !0
  7608. });
  7609. a.prototype.commitProperties = function() {
  7610. c.prototype.commitProperties.call(this);
  7611. this.dataChangedFlag && (this.dataChangedFlag = !1, this.dataChanged())
  7612. };
  7613. a.prototype.getCurrentSkinState = function() {
  7614. return this._selected ? "down": c.prototype.getCurrentSkinState.call(this)
  7615. };
  7616. return a
  7617. } (c.ButtonBase);
  7618. c.ItemRenderer = e
  7619. })(egret || (egret = {}));
  7620. __extends = this.__extends ||
  7621. function(c, e) {
  7622. function d() {
  7623. this.constructor = c
  7624. }
  7625. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7626. d.prototype = e.prototype;
  7627. c.prototype = new d
  7628. }; (function(c) {
  7629. var e = function(d) {
  7630. function a() {
  7631. d.call(this);
  7632. this._indentation = 17;
  7633. this._depth = 0;
  7634. this._isOpen = this._hasChildren = !1;
  7635. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onItemMouseDown, this, !1, 1E3)
  7636. }
  7637. __extends(a, d);
  7638. a.prototype.onItemMouseDown = function(b) {
  7639. b.target == this.disclosureButton && b.stopImmediatePropagation()
  7640. };
  7641. Object.defineProperty(a.prototype, "indentation", {
  7642. get: function() {
  7643. return this._indentation
  7644. },
  7645. set: function(b) {
  7646. this._indentation = b
  7647. },
  7648. enumerable: !0,
  7649. configurable: !0
  7650. });
  7651. Object.defineProperty(a.prototype, "iconSkinName", {
  7652. get: function() {
  7653. return this._iconSkinName
  7654. },
  7655. set: function(b) {
  7656. this._iconSkinName != b && (this._iconSkinName = b, this.iconDisplay && (this.iconDisplay.source = this._iconSkinName))
  7657. },
  7658. enumerable: !0,
  7659. configurable: !0
  7660. });
  7661. Object.defineProperty(a.prototype, "depth", {
  7662. get: function() {
  7663. return this._depth
  7664. },
  7665. set: function(b) {
  7666. b != this._depth && (this._depth = b, this.contentGroup && (this.contentGroup.x = this._depth * this._indentation))
  7667. },
  7668. enumerable: !0,
  7669. configurable: !0
  7670. });
  7671. Object.defineProperty(a.prototype, "hasChildren", {
  7672. get: function() {
  7673. return this._hasChildren
  7674. },
  7675. set: function(b) {
  7676. this._hasChildren != b && (this._hasChildren = b, this.disclosureButton && (this.disclosureButton.visible = this._hasChildren))
  7677. },
  7678. enumerable: !0,
  7679. configurable: !0
  7680. });
  7681. Object.defineProperty(a.prototype, "opened", {
  7682. get: function() {
  7683. return this._isOpen
  7684. },
  7685. set: function(b) {
  7686. this._isOpen != b && (this._isOpen = b, this.disclosureButton && (this.disclosureButton.selected = this._isOpen))
  7687. },
  7688. enumerable: !0,
  7689. configurable: !0
  7690. });
  7691. a.prototype.partAdded = function(b, a) {
  7692. d.prototype.partAdded.call(this, b, a);
  7693. a == this.iconDisplay ? this.iconDisplay.source = this._iconSkinName: a == this.disclosureButton ? (this.disclosureButton.visible = this._hasChildren, this.disclosureButton.selected = this._isOpen, this.disclosureButton._autoSelected = !1, this.disclosureButton.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.disclosureButton_mouseDownHandler, this)) : a == this.contentGroup && (this.contentGroup.x = this._depth * this._indentation)
  7694. };
  7695. a.prototype.partRemoved = function(b, a) {
  7696. d.prototype.partRemoved.call(this, b, a);
  7697. a == this.iconDisplay ? this.iconDisplay.source = null: a == this.disclosureButton && (this.disclosureButton.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.disclosureButton_mouseDownHandler, this), this.disclosureButton._autoSelected = !0, this.disclosureButton.visible = !0)
  7698. };
  7699. a.prototype.disclosureButton_mouseDownHandler = function(b) {
  7700. c.TreeEvent.dispatchTreeEvent(this, c.TreeEvent.ITEM_OPENING, this.itemIndex, this.data, this, !this._isOpen)
  7701. };
  7702. return a
  7703. } (c.ItemRenderer);
  7704. c.TreeItemRenderer = e
  7705. })(egret || (egret = {})); (function(c) {
  7706. var e = function() {
  7707. function d(a, b) {
  7708. this.easerFunction = c.Ease.sineInOut;
  7709. this._duration = 500;
  7710. this._startDelay = 0;
  7711. this._repeatCount = 1;
  7712. this._repeatDelay = 0;
  7713. this.motionPaths = [];
  7714. this._currentValue = {};
  7715. this.pauseTime = 0;
  7716. this._isPaused = !1;
  7717. this.startTime = 0;
  7718. this._started = !1;
  7719. this.playedTimes = 0;
  7720. this.updateFunction = a;
  7721. this.thisObject = b
  7722. }
  7723. Object.defineProperty(d.prototype, "isPlaying", {
  7724. get: function() {
  7725. return this._isPlaying
  7726. },
  7727. enumerable: !0,
  7728. configurable: !0
  7729. });
  7730. Object.defineProperty(d.prototype, "duration", {
  7731. get: function() {
  7732. return this._duration
  7733. },
  7734. set: function(a) {
  7735. this._duration = a
  7736. },
  7737. enumerable: !0,
  7738. configurable: !0
  7739. });
  7740. Object.defineProperty(d.prototype, "startDelay", {
  7741. get: function() {
  7742. return this._startDelay
  7743. },
  7744. set: function(a) {
  7745. this._startDelay = a
  7746. },
  7747. enumerable: !0,
  7748. configurable: !0
  7749. });
  7750. Object.defineProperty(d.prototype, "repeatCount", {
  7751. get: function() {
  7752. return this._repeatCount
  7753. },
  7754. set: function(a) {
  7755. this._repeatCount = a
  7756. },
  7757. enumerable: !0,
  7758. configurable: !0
  7759. });
  7760. Object.defineProperty(d.prototype, "repeatDelay", {
  7761. get: function() {
  7762. return this._repeatDelay
  7763. },
  7764. set: function(a) {
  7765. this._repeatDelay = a
  7766. },
  7767. enumerable: !0,
  7768. configurable: !0
  7769. });
  7770. Object.defineProperty(d.prototype, "currentValue", {
  7771. get: function() {
  7772. return this._currentValue
  7773. },
  7774. enumerable: !0,
  7775. configurable: !0
  7776. });
  7777. d.prototype.play = function() {
  7778. this.stopAnimation();
  7779. this.start()
  7780. };
  7781. d.prototype.seek = function(a) {
  7782. a = Math.min(a, this.duration);
  7783. this.caculateCurrentValue(a / this.duration);
  7784. this.startTime = c.getTimer() - a - this._startDelay;
  7785. null != this.updateFunction && this.updateFunction.call(this.thisObject, this)
  7786. };
  7787. d.prototype.start = function() {
  7788. this.playedTimes = 0;
  7789. this._started = !0;
  7790. this._isPlaying = !1;
  7791. this._currentValue = {};
  7792. this.caculateCurrentValue(0);
  7793. this.startTime = c.getTimer();
  7794. d.currentTime = this.startTime;
  7795. this.doInterval();
  7796. d.addAnimation(this)
  7797. };
  7798. d.prototype.end = function() {
  7799. this._started || (this.caculateCurrentValue(0), null != this.startFunction && this.startFunction.call(this.thisObject, this), null != this.updateFunction && this.updateFunction.call(this.thisObject, this));
  7800. this.caculateCurrentValue(1);
  7801. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  7802. this.stopAnimation();
  7803. null != this.endFunction && this.endFunction.call(this.thisObject, this)
  7804. };
  7805. d.prototype.stop = function() {
  7806. this.stopAnimation();
  7807. null != this.stopFunction && this.stopFunction.call(this.thisObject, this)
  7808. };
  7809. d.prototype.stopAnimation = function() {
  7810. this.playedTimes = 0;
  7811. this._isPlaying = !1;
  7812. this.startTime = 0;
  7813. this._started = !1;
  7814. d.removeAnimation(this)
  7815. };
  7816. Object.defineProperty(d.prototype, "isPaused", {
  7817. get: function() {
  7818. return this._isPaused
  7819. },
  7820. enumerable: !0,
  7821. configurable: !0
  7822. });
  7823. d.prototype.pause = function() {
  7824. this._started && (this._isPaused = !0, this.pauseTime = c.getTimer(), this._isPlaying = !1, d.removeAnimation(this))
  7825. };
  7826. d.prototype.resume = function() {
  7827. this._started && this._isPaused && (this._isPaused = !1, this.startTime += c.getTimer() - this.pauseTime, this.pauseTime = -1, d.addAnimation(this))
  7828. };
  7829. Object.defineProperty(d.prototype, "started", {
  7830. get: function() {
  7831. return this._started
  7832. },
  7833. enumerable: !0,
  7834. configurable: !0
  7835. });
  7836. d.prototype.doInterval = function() {
  7837. var a = d.currentTime - this.startTime - (0 < this.playedTimes ? this._repeatDelay: this._startDelay);
  7838. if (0 > a) return ! 1;
  7839. this._isPlaying || (this._isPlaying = !0, 0 == this.playedTimes && null != this.startFunction && this.startFunction.call(this.thisObject, this));
  7840. var b = 0 == this._duration ? 1 : Math.min(a, this._duration) / this._duration;
  7841. this.caculateCurrentValue(b);
  7842. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  7843. if (a = a >= this._duration) this.playedTimes++,
  7844. this._isPlaying = !1,
  7845. this.startTime = d.currentTime,
  7846. 0 == this._repeatCount || this.playedTimes < this._repeatCount ? a = !1 : (d.removeAnimation(this), this._started = !1, this.playedTimes = 0);
  7847. a && null != this.endFunction && this.endFunction.call(this.thisObject, this);
  7848. return a
  7849. };
  7850. d.prototype.caculateCurrentValue = function(a) {
  7851. this.easerFunction && (a = this.easerFunction(a));
  7852. for (var b = this.motionPaths,
  7853. c = b.length,
  7854. d = 0; d < c; d++) {
  7855. var e = b[d];
  7856. this.currentValue[e.prop] = e.from + (e.to - e.from) * a
  7857. }
  7858. };
  7859. d.addAnimation = function(a) { - 1 == d.activeAnimations.indexOf(a) && (d.activeAnimations.push(a), d.registered || (d.registered = !0, c.Ticker.getInstance().register(d.onEnterFrame, null)))
  7860. };
  7861. d.removeAnimation = function(a) {
  7862. a = d.activeAnimations.indexOf(a); - 1 != a && (d.activeAnimations.splice(a, 1), a <= d.currentIntervalIndex && d.currentIntervalIndex--);
  7863. 0 == d.activeAnimations.length && d.registered && (d.registered = !1, c.Ticker.getInstance().unregister(d.onEnterFrame, null))
  7864. };
  7865. d.onEnterFrame = function(a, b) {
  7866. d.currentTime = c.getTimer();
  7867. for (d.currentIntervalIndex = 0; d.currentIntervalIndex < d.activeAnimations.length;) d.activeAnimations[d.currentIntervalIndex].doInterval(),
  7868. d.currentIntervalIndex++;
  7869. d.currentIntervalIndex = -1;
  7870. 0 == d.activeAnimations.length && d.registered && (d.registered = !1, c.Ticker.getInstance().unregister(d.onEnterFrame, null))
  7871. };
  7872. d.currentTime = 0;
  7873. d.TIMER_RESOLUTION = 1E3 / 60;
  7874. d.activeAnimations = [];
  7875. d.currentIntervalIndex = -1;
  7876. return d
  7877. } ();
  7878. c.Animation = e
  7879. })(egret || (egret = {}));
  7880. __extends = this.__extends ||
  7881. function(c, e) {
  7882. function d() {
  7883. this.constructor = c
  7884. }
  7885. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7886. d.prototype = e.prototype;
  7887. c.prototype = new d
  7888. }; (function(c) {
  7889. var e = function(c) {
  7890. function a() {
  7891. c.call(this);
  7892. this._maximum = 100;
  7893. this.maxChanged = !1;
  7894. this._minimum = 0;
  7895. this.minChanged = !1;
  7896. this._stepSize = 1;
  7897. this.stepSizeChanged = !1;
  7898. this._changedValue = this._value = 0;
  7899. this.valueChanged = !1;
  7900. this._snapInterval = 1;
  7901. this._explicitSnapInterval = this.snapIntervalChanged = !1
  7902. }
  7903. __extends(a, c);
  7904. Object.defineProperty(a.prototype, "maximum", {
  7905. get: function() {
  7906. return this._maximum
  7907. },
  7908. set: function(b) {
  7909. this._setMaximun(b)
  7910. },
  7911. enumerable: !0,
  7912. configurable: !0
  7913. });
  7914. a.prototype._setMaximun = function(b) {
  7915. b != this._maximum && (this._maximum = b, this.maxChanged = !0, this.invalidateProperties())
  7916. };
  7917. Object.defineProperty(a.prototype, "minimum", {
  7918. get: function() {
  7919. return this._minimum
  7920. },
  7921. set: function(b) {
  7922. this._setMinimun(b)
  7923. },
  7924. enumerable: !0,
  7925. configurable: !0
  7926. });
  7927. a.prototype._setMinimun = function(b) {
  7928. b != this._minimum && (this._minimum = b, this.minChanged = !0, this.invalidateProperties())
  7929. };
  7930. Object.defineProperty(a.prototype, "stepSize", {
  7931. get: function() {
  7932. return this._stepSize
  7933. },
  7934. set: function(b) {
  7935. b != this._stepSize && (this._stepSize = b, this.stepSizeChanged = !0, this.invalidateProperties())
  7936. },
  7937. enumerable: !0,
  7938. configurable: !0
  7939. });
  7940. Object.defineProperty(a.prototype, "value", {
  7941. get: function() {
  7942. return this._getValue()
  7943. },
  7944. set: function(b) {
  7945. this._setValue(b)
  7946. },
  7947. enumerable: !0,
  7948. configurable: !0
  7949. });
  7950. a.prototype._setValue = function(b) {
  7951. b != this.value && (this._changedValue = b, this.valueChanged = !0, this.invalidateProperties())
  7952. };
  7953. a.prototype._getValue = function() {
  7954. return this.valueChanged ? this._changedValue: this._value
  7955. };
  7956. Object.defineProperty(a.prototype, "snapInterval", {
  7957. get: function() {
  7958. return this._snapInterval
  7959. },
  7960. set: function(b) {
  7961. this._explicitSnapInterval = !0;
  7962. b != this._snapInterval && (isNaN(b) ? (this._snapInterval = 1, this._explicitSnapInterval = !1) : this._snapInterval = b, this.stepSizeChanged = this.snapIntervalChanged = !0, this.invalidateProperties())
  7963. },
  7964. enumerable: !0,
  7965. configurable: !0
  7966. });
  7967. a.prototype.commitProperties = function() {
  7968. c.prototype.commitProperties.call(this);
  7969. this.minimum > this.maximum && (this.maxChanged ? this._maximum = this._minimum: this._minimum = this._maximum);
  7970. if (this.valueChanged || this.maxChanged || this.minChanged || this.snapIntervalChanged) {
  7971. var b = this.valueChanged ? this._changedValue: this._value;
  7972. this.snapIntervalChanged = this.minChanged = this.maxChanged = this.valueChanged = !1;
  7973. this.setValue(this.nearestValidValue(b, this.snapInterval))
  7974. }
  7975. this.stepSizeChanged && (this._explicitSnapInterval ? this._stepSize = this.nearestValidSize(this._stepSize) : (this._snapInterval = this._stepSize, this.setValue(this.nearestValidValue(this._value, this.snapInterval))), this.stepSizeChanged = !1)
  7976. };
  7977. a.prototype.nearestValidSize = function(b) {
  7978. var a = this.snapInterval;
  7979. if (0 == a) return b;
  7980. b = Math.round(b / a) * a;
  7981. return Math.abs(b) < a ? a: b
  7982. };
  7983. a.prototype.nearestValidValue = function(b, a) {
  7984. if (0 == a) return Math.max(this.minimum, Math.min(this.maximum, b));
  7985. var c = this.maximum - this.minimum,
  7986. d = 1;
  7987. b -= this.minimum;
  7988. a != Math.round(a) && (d = (1 + a).toString().split("."), d = Math.pow(10, d[1].length), c *= d, b = Math.round(b * d), a = Math.round(a * d));
  7989. var e = Math.max(0, Math.floor(b / a) * a),
  7990. c = Math.min(c, Math.floor((b + a) / a) * a);
  7991. return (b - e >= (c - e) / 2 ? c: e) / d + this.minimum
  7992. };
  7993. a.prototype.setValue = function(b) {
  7994. this._value != b && (isNaN(b) && (b = 0), !isNaN(this.maximum) && !isNaN(this.minimum) && this.maximum > this.minimum ? this._value = Math.min(this.maximum, Math.max(this.minimum, b)) : this._value = b, this.valueChanged = !1)
  7995. };
  7996. a.prototype.changeValueByStep = function(b) {
  7997. "undefined" === typeof b && (b = !0);
  7998. 0 != this.stepSize && this.setValue(this.nearestValidValue(b ? this.value + this.stepSize: this.value - this.stepSize, this.snapInterval))
  7999. };
  8000. return a
  8001. } (c.SkinnableComponent);
  8002. c.Range = e
  8003. })(egret || (egret = {}));
  8004. __extends = this.__extends ||
  8005. function(c, e) {
  8006. function d() {
  8007. this.constructor = c
  8008. }
  8009. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8010. d.prototype = e.prototype;
  8011. c.prototype = new d
  8012. }; (function(c) {
  8013. var e = function(d) {
  8014. function a() {
  8015. d.call(this);
  8016. this._slideDuration = 300;
  8017. this.needUpdateValue = !1;
  8018. this.addEventListener(c.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  8019. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.mouseDownHandler, this)
  8020. }
  8021. __extends(a, d);
  8022. Object.defineProperty(a.prototype, "slideDuration", {
  8023. get: function() {
  8024. return this._slideDuration
  8025. },
  8026. set: function(b) {
  8027. this._slideDuration = b
  8028. },
  8029. enumerable: !0,
  8030. configurable: !0
  8031. });
  8032. Object.defineProperty(a.prototype, "maximum", {
  8033. get: function() {
  8034. return this._maximum
  8035. },
  8036. set: function(b) {
  8037. b != this._maximum && (this._setMaximun(b), this.invalidateDisplayList())
  8038. },
  8039. enumerable: !0,
  8040. configurable: !0
  8041. });
  8042. Object.defineProperty(a.prototype, "minimum", {
  8043. get: function() {
  8044. return this._minimum
  8045. },
  8046. set: function(b) {
  8047. b != this._minimum && (this._setMinimun(b), this.invalidateDisplayList())
  8048. },
  8049. enumerable: !0,
  8050. configurable: !0
  8051. });
  8052. Object.defineProperty(a.prototype, "value", {
  8053. get: function() {
  8054. return this._getValue()
  8055. },
  8056. set: function(b) {
  8057. b != this._getValue() && (this._setValue(b), this.invalidateDisplayList())
  8058. },
  8059. enumerable: !0,
  8060. configurable: !0
  8061. });
  8062. a.prototype.setValue = function(b) {
  8063. d.prototype.setValue.call(this, b);
  8064. this.invalidateDisplayList()
  8065. };
  8066. a.prototype.pointToValue = function(b, a) {
  8067. return this.minimum
  8068. };
  8069. a.prototype.changeValueByStep = function(b) {
  8070. "undefined" === typeof b && (b = !0);
  8071. var a = this.value;
  8072. d.prototype.changeValueByStep.call(this, b);
  8073. this.value != a && this.dispatchEventWith(c.Event.CHANGE)
  8074. };
  8075. a.prototype.partAdded = function(b, a) {
  8076. d.prototype.partAdded.call(this, b, a);
  8077. a == this.thumb ? (this.thumb.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.thumb_mouseDownHandler, this), this.thumb.addEventListener(c.ResizeEvent.RESIZE, this.thumb_resizeHandler, this), this.thumb.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this), this.thumb.stickyHighlighting = !0) : a == this.track && (this.track.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.track_mouseDownHandler, this), this.track.addEventListener(c.ResizeEvent.RESIZE, this.track_resizeHandler, this))
  8078. };
  8079. a.prototype.partRemoved = function(b, a) {
  8080. d.prototype.partRemoved.call(this, b, a);
  8081. a == this.thumb ? (this.thumb.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.thumb_mouseDownHandler, this), this.thumb.removeEventListener(c.ResizeEvent.RESIZE, this.thumb_resizeHandler, this), this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this)) : a == this.track && (this.track.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.track_mouseDownHandler, this), this.track.removeEventListener(c.ResizeEvent.RESIZE, this.track_resizeHandler, this))
  8082. };
  8083. a.prototype.updateDisplayList = function(b, a) {
  8084. d.prototype.updateDisplayList.call(this, b, a);
  8085. this.updateSkinDisplayList()
  8086. };
  8087. a.prototype.updateSkinDisplayList = function() {};
  8088. a.prototype.addedToStageHandler = function(b) {
  8089. this.updateSkinDisplayList()
  8090. };
  8091. a.prototype.track_resizeHandler = function(b) {
  8092. this.updateSkinDisplayList()
  8093. };
  8094. a.prototype.thumb_resizeHandler = function(b) {
  8095. this.updateSkinDisplayList()
  8096. };
  8097. a.prototype.thumb_updateCompleteHandler = function(b) {
  8098. this.updateSkinDisplayList();
  8099. this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this)
  8100. };
  8101. a.prototype.thumb_mouseDownHandler = function(b) {
  8102. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  8103. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8104. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  8105. this.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  8106. b = this.thumb.globalToLocal(b.stageX, b.stageY, c.Point.identity);
  8107. this._clickOffsetX = b.x;
  8108. this._clickOffsetY = b.y;
  8109. c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_PRESS);
  8110. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_START)
  8111. };
  8112. a.prototype.onEnterFrame = function(b) {
  8113. this.needUpdateValue && this.track && (this.updateWhenMouseMove(), this.needUpdateValue = !1)
  8114. };
  8115. a.prototype.updateWhenMouseMove = function() {
  8116. if (this.track) {
  8117. var b = this.track.globalToLocal(this._moveStageX, this._moveStageY, c.Point.identity),
  8118. b = this.pointToValue(b.x - this._clickOffsetX, b.y - this._clickOffsetY),
  8119. b = this.nearestValidValue(b, this.snapInterval);
  8120. b != this.value && (this.setValue(b), this.validateDisplayList(), c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_DRAG), this.dispatchEventWith(c.Event.CHANGE))
  8121. }
  8122. };
  8123. a.prototype.stage_mouseMoveHandler = function(b) {
  8124. this._moveStageX = b.stageX;
  8125. this._moveStageY = b.stageY;
  8126. this.needUpdateValue || (this.needUpdateValue = !0)
  8127. };
  8128. a.prototype.stage_mouseUpHandler = function(b) {
  8129. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  8130. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8131. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  8132. this.removeEventListener(c.Event.ENTER_FRAME, this.updateWhenMouseMove, this);
  8133. this.needUpdateValue && (this.updateWhenMouseMove(), this.needUpdateValue = !1);
  8134. c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_RELEASE);
  8135. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8136. };
  8137. a.prototype.track_mouseDownHandler = function(b) {};
  8138. a.prototype.mouseDownHandler = function(b) {
  8139. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  8140. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  8141. this.mouseDownTarget = b.target
  8142. };
  8143. a.prototype.stage_mouseUpSomewhereHandler = function(b) {
  8144. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  8145. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  8146. if (this.mouseDownTarget != b.target && b instanceof c.TouchEvent && this.contains(b.target)) {
  8147. var a = b.target.localToGlobal(b.localX, b.localY);
  8148. c.TouchEvent.dispatchTouchEvent(this, c.TouchEvent.TOUCH_TAP, b.touchPointID, a.x, a.y, b.ctrlKey, b.altKey, b.shiftKey, b.touchDown)
  8149. }
  8150. this.mouseDownTarget = null
  8151. };
  8152. return a
  8153. } (c.Range);
  8154. c.TrackBase = e
  8155. })(egret || (egret = {}));
  8156. __extends = this.__extends ||
  8157. function(c, e) {
  8158. function d() {
  8159. this.constructor = c
  8160. }
  8161. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8162. d.prototype = e.prototype;
  8163. c.prototype = new d
  8164. }; (function(c) {
  8165. var e = function(d) {
  8166. function a() {
  8167. d.call(this);
  8168. this._showTrackHighlight = !0;
  8169. this._pendingValue = 0;
  8170. this._liveDragging = !0;
  8171. this.maximum = 10
  8172. }
  8173. __extends(a, d);
  8174. Object.defineProperty(a.prototype, "showTrackHighlight", {
  8175. get: function() {
  8176. return this._showTrackHighlight
  8177. },
  8178. set: function(b) {
  8179. this._showTrackHighlight != b && (this._showTrackHighlight = b, this.trackHighlight && (this.trackHighlight.visible = b), this.invalidateDisplayList())
  8180. },
  8181. enumerable: !0,
  8182. configurable: !0
  8183. });
  8184. Object.defineProperty(a.prototype, "pendingValue", {
  8185. get: function() {
  8186. return this._pendingValue
  8187. },
  8188. set: function(b) {
  8189. b != this._pendingValue && (this._pendingValue = b, this.invalidateDisplayList())
  8190. },
  8191. enumerable: !0,
  8192. configurable: !0
  8193. });
  8194. a.prototype.setValue = function(b) {
  8195. this._pendingValue = b;
  8196. d.prototype.setValue.call(this, b)
  8197. };
  8198. a.prototype.animationUpdateHandler = function(b) {
  8199. this.pendingValue = b.currentValue.value
  8200. };
  8201. a.prototype.animationEndHandler = function(b) {
  8202. this.setValue(this.slideToValue);
  8203. this.dispatchEventWith(c.Event.CHANGE);
  8204. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8205. };
  8206. a.prototype.stopAnimation = function() {
  8207. this.animator.stop();
  8208. this.setValue(this.nearestValidValue(this.pendingValue, this.snapInterval));
  8209. this.dispatchEventWith(c.Event.CHANGE);
  8210. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8211. };
  8212. a.prototype.thumb_mouseDownHandler = function(b) {
  8213. this.animator && this.animator.isPlaying && this.stopAnimation();
  8214. d.prototype.thumb_mouseDownHandler.call(this, b)
  8215. };
  8216. Object.defineProperty(a.prototype, "liveDragging", {
  8217. get: function() {
  8218. return this._liveDragging
  8219. },
  8220. set: function(b) {
  8221. this._liveDragging = b
  8222. },
  8223. enumerable: !0,
  8224. configurable: !0
  8225. });
  8226. a.prototype.updateWhenMouseMove = function() {
  8227. if (this.track) {
  8228. var b = this.track.globalToLocal(this._moveStageX, this._moveStageY, c.Point.identity),
  8229. b = this.pointToValue(b.x - this._clickOffsetX, b.y - this._clickOffsetY),
  8230. b = this.nearestValidValue(b, this.snapInterval);
  8231. b != this.pendingValue && (c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_DRAG), !0 == this.liveDragging ? (this.setValue(b), this.dispatchEventWith(c.Event.CHANGE)) : this.pendingValue = b)
  8232. }
  8233. };
  8234. a.prototype.stage_mouseUpHandler = function(b) {
  8235. d.prototype.stage_mouseUpHandler.call(this, b); ! 1 == this.liveDragging && this.value != this.pendingValue && (this.setValue(this.pendingValue), this.dispatchEventWith(c.Event.CHANGE))
  8236. };
  8237. a.prototype.track_mouseDownHandler = function(b) {
  8238. this.enabled && (b = this.track.globalToLocal(b.stageX - (this.thumb ? this.thumb.width: 0) / 2, b.stageY - (this.thumb ? this.thumb.height: 0) / 2, c.Point.identity), b = this.pointToValue(b.x, b.y), b = this.nearestValidValue(b, this.snapInterval), b != this.pendingValue && (0 != this.slideDuration ? (this.animator || (this.animator = new c.Animation(this.animationUpdateHandler, this), this.animator.endFunction = this.animationEndHandler), this.animator.isPlaying && this.stopAnimation(), this.slideToValue = b, this.animator.duration = this.slideDuration * (Math.abs(this.pendingValue - this.slideToValue) / (this.maximum - this.minimum)), this.animator.motionPaths = [{
  8239. prop: "value",
  8240. from: this.pendingValue,
  8241. to: this.slideToValue
  8242. }], c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_START), this.animator.play()) : (this.setValue(b), this.dispatchEventWith(c.Event.CHANGE))))
  8243. };
  8244. a.prototype.partAdded = function(b, a) {
  8245. d.prototype.partAdded.call(this, b, a);
  8246. a == this.trackHighlight && (this.trackHighlight.touchEnabled = !1, this.trackHighlight instanceof c.DisplayObjectContainer && (this.trackHighlight.touchChildren = !1), this.trackHighlight.visible = this._showTrackHighlight)
  8247. };
  8248. return a
  8249. } (c.TrackBase);
  8250. c.SliderBase = e
  8251. })(egret || (egret = {}));
  8252. __extends = this.__extends ||
  8253. function(c, e) {
  8254. function d() {
  8255. this.constructor = c
  8256. }
  8257. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8258. d.prototype = e.prototype;
  8259. c.prototype = new d
  8260. }; (function(c) {
  8261. var e = function(d) {
  8262. function a() {
  8263. d.call(this);
  8264. this._maxDisplayedLines = 0;
  8265. this.lastUnscaledWidth = NaN;
  8266. this._padding = 0;
  8267. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  8268. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.updateCompleteHandler, this)
  8269. }
  8270. __extends(a, d);
  8271. a.prototype.updateCompleteHandler = function(b) {
  8272. this.lastUnscaledWidth = NaN
  8273. };
  8274. Object.defineProperty(a.prototype, "maxDisplayedLines", {
  8275. get: function() {
  8276. return this._maxDisplayedLines
  8277. },
  8278. set: function(b) {
  8279. this._maxDisplayedLines != b && (this._maxDisplayedLines = b, this.invalidateSize(), this.invalidateDisplayList())
  8280. },
  8281. enumerable: !0,
  8282. configurable: !0
  8283. });
  8284. Object.defineProperty(a.prototype, "padding", {
  8285. get: function() {
  8286. return this._padding
  8287. },
  8288. set: function(b) {
  8289. this._padding != b && (this._padding = b, this.invalidateSize(), this.invalidateDisplayList())
  8290. },
  8291. enumerable: !0,
  8292. configurable: !0
  8293. });
  8294. Object.defineProperty(a.prototype, "paddingLeft", {
  8295. get: function() {
  8296. return this._paddingLeft
  8297. },
  8298. set: function(b) {
  8299. this._paddingLeft != b && (this._paddingLeft = b, this.invalidateSize(), this.invalidateDisplayList())
  8300. },
  8301. enumerable: !0,
  8302. configurable: !0
  8303. });
  8304. Object.defineProperty(a.prototype, "paddingRight", {
  8305. get: function() {
  8306. return this._paddingRight
  8307. },
  8308. set: function(b) {
  8309. this._paddingRight != b && (this._paddingRight = b, this.invalidateSize(), this.invalidateDisplayList())
  8310. },
  8311. enumerable: !0,
  8312. configurable: !0
  8313. });
  8314. Object.defineProperty(a.prototype, "paddingTop", {
  8315. get: function() {
  8316. return this._paddingTop
  8317. },
  8318. set: function(b) {
  8319. this._paddingTop != b && (this._paddingTop = b, this.invalidateSize(), this.invalidateDisplayList())
  8320. },
  8321. enumerable: !0,
  8322. configurable: !0
  8323. });
  8324. Object.defineProperty(a.prototype, "paddingBottom", {
  8325. get: function() {
  8326. return this._paddingBottom
  8327. },
  8328. set: function(b) {
  8329. this._paddingBottom != b && (this._paddingBottom = b, this.invalidateSize(), this.invalidateDisplayList())
  8330. },
  8331. enumerable: !0,
  8332. configurable: !0
  8333. });
  8334. a.prototype.measure = function() {
  8335. this._invalidatePropertiesFlag && this.validateProperties();
  8336. if (this.isSpecialCase()) if (isNaN(this.lastUnscaledWidth)) this._oldPreferHeight = this._oldPreferWidth = NaN;
  8337. else {
  8338. this.measureUsingWidth(this.lastUnscaledWidth);
  8339. return
  8340. }
  8341. var b;
  8342. isNaN(this.explicitWidth) ? 1E4 != this.maxWidth && (b = this.maxWidth) : b = this.explicitWidth;
  8343. this.measureUsingWidth(b)
  8344. };
  8345. a.prototype.isSpecialCase = function() {
  8346. return 1 != this._maxDisplayedLines && (!isNaN(this.percentWidth) || !isNaN(this.left) && !isNaN(this.right)) && isNaN(this.explicitHeight) && isNaN(this.percentHeight)
  8347. };
  8348. a.prototype.measureUsingWidth = function(b) {
  8349. var a = this._textField.text;
  8350. this._textChanged && (this._textField.text = this._text);
  8351. var c = isNaN(this._padding) ? 0 : this._padding,
  8352. d = isNaN(this._paddingLeft) ? c: this._paddingLeft,
  8353. e = isNaN(this._paddingRight) ? c: this._paddingRight,
  8354. g = isNaN(this._paddingTop) ? c: this._paddingTop,
  8355. c = isNaN(this._paddingBottom) ? c: this._paddingBottom;
  8356. this._textField.width = NaN;
  8357. this._textField.height = NaN;
  8358. isNaN(b) || (this._textField.width = b - d - e);
  8359. this.measuredWidth = Math.ceil(this._textField.measuredWidth);
  8360. this.measuredHeight = Math.ceil(this._textField.measuredHeight);
  8361. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (b = this._textField.lineSpacing, this.measuredHeight = (this._textField.size + b) * this._maxDisplayedLines - b);
  8362. this.measuredWidth += d + e;
  8363. this.measuredHeight += g + c;
  8364. this._textField.text = a
  8365. };
  8366. a.prototype.updateDisplayList = function(b, a) {
  8367. this.$updateDisplayList(b, a);
  8368. var c = isNaN(this._padding) ? 0 : this._padding,
  8369. d = isNaN(this._paddingLeft) ? c: this._paddingLeft,
  8370. e = isNaN(this._paddingRight) ? c: this._paddingRight,
  8371. g = isNaN(this._paddingTop) ? c: this._paddingTop,
  8372. c = isNaN(this._paddingBottom) ? c: this._paddingBottom;
  8373. this._textField.x = d;
  8374. this._textField.y = g;
  8375. if (this.isSpecialCase()) {
  8376. var l = isNaN(this.lastUnscaledWidth) || this.lastUnscaledWidth != b;
  8377. this.lastUnscaledWidth = b;
  8378. if (l) {
  8379. this._oldPreferHeight = this._oldPreferWidth = NaN;
  8380. this.invalidateSize();
  8381. return
  8382. }
  8383. }
  8384. this._invalidateSizeFlag && this.validateSize();
  8385. this._textField.visible || (this._textField.visible = !0);
  8386. this._textField.width = b - d - e;
  8387. d = a - g - c;
  8388. this._textField.height = d;
  8389. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (e = this._textField.lineSpacing, this._textField.height = Math.min(d, (this._textField.size + e) * this._maxDisplayedLines - e))
  8390. };
  8391. return a
  8392. } (c.TextBase);
  8393. c.Label = e
  8394. })(egret || (egret = {}));
  8395. __extends = this.__extends ||
  8396. function(c, e) {
  8397. function d() {
  8398. this.constructor = c
  8399. }
  8400. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8401. d.prototype = e.prototype;
  8402. c.prototype = new d
  8403. }; (function(c) {
  8404. var e = function(d) {
  8405. function a() {
  8406. d.call(this);
  8407. this._fillColor = 16777215;
  8408. this._fillAlpha = 1;
  8409. this._strokeColor = 4473924;
  8410. this._strokeAlpha = 0;
  8411. this._strokeWeight = 1;
  8412. this.touchChildren = !1
  8413. }
  8414. __extends(a, d);
  8415. Object.defineProperty(a.prototype, "graphics", {
  8416. get: function() {
  8417. this._graphics || (this._graphics = new c.Graphics);
  8418. return this._graphics
  8419. },
  8420. enumerable: !0,
  8421. configurable: !0
  8422. });
  8423. a.prototype._render = function(b) {
  8424. this._graphics && this._graphics._draw(b);
  8425. d.prototype._render.call(this, b)
  8426. };
  8427. Object.defineProperty(a.prototype, "fillColor", {
  8428. get: function() {
  8429. return this._fillColor
  8430. },
  8431. set: function(b) {
  8432. this._fillColor != b && (this._fillColor = b, this.invalidateDisplayList())
  8433. },
  8434. enumerable: !0,
  8435. configurable: !0
  8436. });
  8437. Object.defineProperty(a.prototype, "fillAlpha", {
  8438. get: function() {
  8439. return this._fillAlpha
  8440. },
  8441. set: function(b) {
  8442. this._fillAlpha != b && (this._fillAlpha = b, this.invalidateDisplayList())
  8443. },
  8444. enumerable: !0,
  8445. configurable: !0
  8446. });
  8447. Object.defineProperty(a.prototype, "strokeColor", {
  8448. get: function() {
  8449. return this._strokeColor
  8450. },
  8451. set: function(b) {
  8452. this._strokeColor != b && (this._strokeColor = b, this.invalidateDisplayList())
  8453. },
  8454. enumerable: !0,
  8455. configurable: !0
  8456. });
  8457. Object.defineProperty(a.prototype, "strokeAlpha", {
  8458. get: function() {
  8459. return this._strokeAlpha
  8460. },
  8461. set: function(b) {
  8462. this._strokeAlpha != b && (this._strokeAlpha = b, this.invalidateDisplayList())
  8463. },
  8464. enumerable: !0,
  8465. configurable: !0
  8466. });
  8467. Object.defineProperty(a.prototype, "strokeWeight", {
  8468. get: function() {
  8469. return this._strokeWeight
  8470. },
  8471. set: function(b) {
  8472. this._strokeWeight != b && (this._strokeWeight = b, this.invalidateDisplayList())
  8473. },
  8474. enumerable: !0,
  8475. configurable: !0
  8476. });
  8477. a.prototype._measureBounds = function() {
  8478. var b = d.prototype._measureBounds.call(this),
  8479. a = this.width,
  8480. c = this.height;
  8481. 0 < b.x && (b.x = 0);
  8482. 0 < b.y && (b.y = 0);
  8483. 0 + a > b.right && (b.right = 0 + a);
  8484. 0 + c > b.bottom && (b.bottom = 0 + c);
  8485. return b
  8486. };
  8487. a.prototype.updateDisplayList = function(b, a) {
  8488. d.prototype.updateDisplayList.call(this, b, b);
  8489. var c = this.graphics;
  8490. c.clear();
  8491. c.beginFill(this._fillColor, this._fillAlpha);
  8492. 0 < this._strokeAlpha && c.lineStyle(this._strokeWeight, this._strokeColor, this._strokeAlpha, !0, "normal", "square", "miter");
  8493. c.drawRect(0, 0, b, a);
  8494. c.endFill()
  8495. };
  8496. return a
  8497. } (c.UIComponent);
  8498. c.Rect = e
  8499. })(egret || (egret = {}));
  8500. __extends = this.__extends ||
  8501. function(c, e) {
  8502. function d() {
  8503. this.constructor = c
  8504. }
  8505. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8506. d.prototype = e.prototype;
  8507. c.prototype = new d
  8508. }; (function(c) {
  8509. var e = function(c) {
  8510. function a() {
  8511. c.call(this);
  8512. this.hostComponentKey = "egret.Button"
  8513. }
  8514. __extends(a, c);
  8515. return a
  8516. } (c.ButtonBase);
  8517. c.Button = e
  8518. })(egret || (egret = {}));
  8519. __extends = this.__extends ||
  8520. function(c, e) {
  8521. function d() {
  8522. this.constructor = c
  8523. }
  8524. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8525. d.prototype = e.prototype;
  8526. c.prototype = new d
  8527. }; (function(c) {
  8528. var e = function(c) {
  8529. function a() {
  8530. c.call(this);
  8531. this.hostComponentKey = "egret.ToggleButton"
  8532. }
  8533. __extends(a, c);
  8534. return a
  8535. } (c.ToggleButtonBase);
  8536. c.ToggleButton = e
  8537. })(egret || (egret = {}));
  8538. __extends = this.__extends ||
  8539. function(c, e) {
  8540. function d() {
  8541. this.constructor = c
  8542. }
  8543. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8544. d.prototype = e.prototype;
  8545. c.prototype = new d
  8546. }; (function(c) {
  8547. var e = function(c) {
  8548. function a() {
  8549. c.call(this);
  8550. this.hostComponentKey = "egret.CheckBox"
  8551. }
  8552. __extends(a, c);
  8553. return a
  8554. } (c.ToggleButtonBase);
  8555. c.CheckBox = e
  8556. })(egret || (egret = {}));
  8557. __extends = this.__extends ||
  8558. function(c, e) {
  8559. function d() {
  8560. this.constructor = c
  8561. }
  8562. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8563. d.prototype = e.prototype;
  8564. c.prototype = new d
  8565. }; (function(c) {
  8566. var e = function(d) {
  8567. function a() {
  8568. d.call(this);
  8569. this.radioButtons = [];
  8570. this._enabled = !0;
  8571. this._name = "_radioButtonGroup" + a.groupCount;
  8572. a.groupCount++
  8573. }
  8574. __extends(a, d);
  8575. Object.defineProperty(a.prototype, "enabled", {
  8576. get: function() {
  8577. return this._enabled
  8578. },
  8579. set: function(b) {
  8580. if (this._enabled != b) for (this._enabled = b, b = 0; b < this.numRadioButtons; b++) this.getRadioButtonAt(b).invalidateSkinState()
  8581. },
  8582. enumerable: !0,
  8583. configurable: !0
  8584. });
  8585. Object.defineProperty(a.prototype, "numRadioButtons", {
  8586. get: function() {
  8587. return this.radioButtons.length
  8588. },
  8589. enumerable: !0,
  8590. configurable: !0
  8591. });
  8592. Object.defineProperty(a.prototype, "selectedValue", {
  8593. get: function() {
  8594. return this.selection ? null != this.selection.value ? this.selection.value: this.selection.label: null
  8595. },
  8596. set: function(b) {
  8597. this._selectedValue = b;
  8598. if (null == b) this._setSelection(null, !1);
  8599. else for (var a = this.numRadioButtons,
  8600. d = 0; d < a; d++) {
  8601. var e = this.getRadioButtonAt(d);
  8602. if (e.value == b || e.label == b) {
  8603. this.changeSelection(d, !1);
  8604. this._selectedValue = null;
  8605. c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT);
  8606. break
  8607. }
  8608. }
  8609. },
  8610. enumerable: !0,
  8611. configurable: !0
  8612. });
  8613. Object.defineProperty(a.prototype, "selection", {
  8614. get: function() {
  8615. return this._selection
  8616. },
  8617. set: function(b) {
  8618. this._selection != b && this._setSelection(b, !1)
  8619. },
  8620. enumerable: !0,
  8621. configurable: !0
  8622. });
  8623. a.prototype.getRadioButtonAt = function(b) {
  8624. return 0 <= b && b < this.numRadioButtons ? this.radioButtons[b] : null
  8625. };
  8626. a.prototype._addInstance = function(b) {
  8627. function a(b, d) {
  8628. var e = b.parent,
  8629. m = d.parent;
  8630. if (!e || !m) return 0;
  8631. var n = b instanceof c.UIComponent ? b.nestLevel: -1,
  8632. p = d instanceof c.UIComponent ? d.nestLevel: -1,
  8633. q = 0,
  8634. r = 0;
  8635. e == m && (q = "getElementIndex" in e && "ownerChanged" in b ? e.getElementIndex(b) : e.getChildIndex(b), r = "getElementIndex" in m && "ownerChanged" in d ? m.getElementIndex(d) : m.getChildIndex(d));
  8636. return n > p || q > r ? 1 : n < p || r > q ? -1 : b == d ? 0 : a(e, m)
  8637. }
  8638. b.addEventListener(c.Event.REMOVED, this.radioButton_removedHandler, this);
  8639. this.radioButtons.push(b);
  8640. this.radioButtons.sort(a);
  8641. for (var d = 0; d < this.radioButtons.length; d++) this.radioButtons[d]._indexNumber = d;
  8642. this._selectedValue && (this.selectedValue = this._selectedValue); ! 0 == b.selected && (this.selection = b);
  8643. b._radioButtonGroup = this;
  8644. b.invalidateSkinState();
  8645. this.dispatchEventWith("numRadioButtonsChanged")
  8646. };
  8647. a.prototype._removeInstance = function(b) {
  8648. this.doRemoveInstance(b, !1)
  8649. };
  8650. a.prototype.doRemoveInstance = function(b, a) {
  8651. "undefined" === typeof a && (a = !0);
  8652. if (b) {
  8653. for (var d = !1,
  8654. e = 0; e < this.numRadioButtons; e++) {
  8655. var f = this.getRadioButtonAt(e);
  8656. d ? f._indexNumber -= 1 : f == b && (a && b.addEventListener(c.Event.ADDED, this.radioButton_addedHandler, this), b == this._selection && (this._selection = null), b._radioButtonGroup = null, b.invalidateSkinState(), this.radioButtons.splice(e, 1), d = !0, e--)
  8657. }
  8658. d && this.dispatchEventWith("numRadioButtonsChanged")
  8659. }
  8660. };
  8661. a.prototype._setSelection = function(b, a) {
  8662. "undefined" === typeof a && (a = !0);
  8663. if (this._selection != b) {
  8664. if (b) for (var d = this.numRadioButtons,
  8665. e = 0; e < d; e++) {
  8666. if (b == this.getRadioButtonAt(e)) {
  8667. this.changeSelection(e, a);
  8668. break
  8669. }
  8670. } else this.selection && (this._selection.selected = !1, this._selection = null, a && this.dispatchEventWith(c.Event.CHANGE));
  8671. c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT)
  8672. }
  8673. };
  8674. a.prototype.changeSelection = function(b, a) {
  8675. "undefined" === typeof a && (a = !0);
  8676. var d = this.getRadioButtonAt(b);
  8677. d && d != this._selection && (this._selection && (this._selection.selected = !1), this._selection = d, this._selection.selected = !0, a && this.dispatchEventWith(c.Event.CHANGE))
  8678. };
  8679. a.prototype.radioButton_addedHandler = function(b) {
  8680. if (b = b.target) b.removeEventListener(c.Event.ADDED, this.radioButton_addedHandler, this),
  8681. this._addInstance(b)
  8682. };
  8683. a.prototype.radioButton_removedHandler = function(b) {
  8684. if (b = b.target) b.removeEventListener(c.Event.REMOVED, this.radioButton_removedHandler, this),
  8685. this.doRemoveInstance(b)
  8686. };
  8687. a.groupCount = 0;
  8688. return a
  8689. } (c.EventDispatcher);
  8690. c.RadioButtonGroup = e
  8691. })(egret || (egret = {}));
  8692. __extends = this.__extends ||
  8693. function(c, e) {
  8694. function d() {
  8695. this.constructor = c
  8696. }
  8697. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8698. d.prototype = e.prototype;
  8699. c.prototype = new d
  8700. }; (function(c) {
  8701. var e = function(d) {
  8702. function a() {
  8703. d.call(this);
  8704. this._indexNumber = 0;
  8705. this._radioButtonGroup = null;
  8706. this.groupChanged = !1;
  8707. this._groupName = "radioGroup";
  8708. this.hostComponentKey = "egret.RadioButton";
  8709. this.groupName = "radioGroup"
  8710. }
  8711. __extends(a, d);
  8712. Object.defineProperty(a.prototype, "enabled", {
  8713. get: function() {
  8714. return this._enabled ? !this._radioButtonGroup || this._radioButtonGroup.enabled: !1
  8715. },
  8716. set: function(b) {
  8717. this._setEnabled(b)
  8718. },
  8719. enumerable: !0,
  8720. configurable: !0
  8721. });
  8722. Object.defineProperty(a.prototype, "group", {
  8723. get: function() {
  8724. if (!this._group && this._groupName) {
  8725. a.automaticRadioButtonGroups || (a.automaticRadioButtonGroups = {});
  8726. var b = a.automaticRadioButtonGroups[this._groupName];
  8727. b || (b = new c.RadioButtonGroup, b._name = this._groupName, a.automaticRadioButtonGroups[this._groupName] = b);
  8728. this._group = b
  8729. }
  8730. return this._group
  8731. },
  8732. set: function(b) {
  8733. this._group != b && (this._radioButtonGroup && this._radioButtonGroup._removeInstance(this), this._groupName = (this._group = b) ? this.group._name: "radioGroup", this.groupChanged = !0, this.invalidateProperties(), this.invalidateDisplayList())
  8734. },
  8735. enumerable: !0,
  8736. configurable: !0
  8737. });
  8738. Object.defineProperty(a.prototype, "groupName", {
  8739. get: function() {
  8740. return this._groupName
  8741. },
  8742. set: function(b) {
  8743. b && "" != b && (this._groupName = b, this._radioButtonGroup && this._radioButtonGroup._removeInstance(this), this._group = null, this.groupChanged = !0, this.invalidateProperties(), this.invalidateDisplayList())
  8744. },
  8745. enumerable: !0,
  8746. configurable: !0
  8747. });
  8748. a.prototype._setSelected = function(b) {
  8749. d.prototype._setSelected.call(this, b);
  8750. this.invalidateDisplayList()
  8751. };
  8752. Object.defineProperty(a.prototype, "value", {
  8753. get: function() {
  8754. return this._value
  8755. },
  8756. set: function(b) {
  8757. this._value != b && (this._value = b, this.selected && this.group && c.UIEvent.dispatchUIEvent(this.group, c.UIEvent.VALUE_COMMIT))
  8758. },
  8759. enumerable: !0,
  8760. configurable: !0
  8761. });
  8762. a.prototype.commitProperties = function() {
  8763. this.groupChanged && (this.addToGroup(), this.groupChanged = !1);
  8764. d.prototype.commitProperties.call(this)
  8765. };
  8766. a.prototype.updateDisplayList = function(b, a) {
  8767. d.prototype.updateDisplayList.call(this, b, a);
  8768. this.group && (this.selected ? this._group.selection = this: this.group.selection == this && (this._group.selection = null))
  8769. };
  8770. a.prototype.buttonReleased = function() {
  8771. this.enabled && !this.selected && (this._radioButtonGroup || this.addToGroup(), d.prototype.buttonReleased.call(this), this.group._setSelection(this))
  8772. };
  8773. a.prototype.addToGroup = function() {
  8774. var b = this.group;
  8775. b && b._addInstance(this);
  8776. return b
  8777. };
  8778. return a
  8779. } (c.ToggleButtonBase);
  8780. c.RadioButton = e
  8781. })(egret || (egret = {}));
  8782. __extends = this.__extends ||
  8783. function(c, e) {
  8784. function d() {
  8785. this.constructor = c
  8786. }
  8787. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8788. d.prototype = e.prototype;
  8789. c.prototype = new d
  8790. }; (function(c) {
  8791. var e = function(d) {
  8792. function a() {
  8793. d.call(this);
  8794. this.elementsContentChanged = this.createChildrenCalled = !1;
  8795. this._elementsContent = []
  8796. }
  8797. __extends(a, d);
  8798. a.prototype.createChildren = function() {
  8799. d.prototype.createChildren.call(this);
  8800. this.createChildrenCalled = !0;
  8801. this.elementsContentChanged && (this.elementsContentChanged = !1, this.setElementsContent(this._elementsContent))
  8802. };
  8803. a.prototype._getElementsContent = function() {
  8804. return this._elementsContent
  8805. };
  8806. Object.defineProperty(a.prototype, "elementsContent", {
  8807. set: function(b) {
  8808. null == b && (b = []);
  8809. if (b != this._elementsContent) if (this.createChildrenCalled) this.setElementsContent(b);
  8810. else {
  8811. this.elementsContentChanged = !0;
  8812. for (var a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  8813. this._elementsContent = b
  8814. }
  8815. },
  8816. enumerable: !0,
  8817. configurable: !0
  8818. });
  8819. a.prototype.setElementsContent = function(b) {
  8820. var a;
  8821. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  8822. this._elementsContent = b.concat();
  8823. b = this._elementsContent.length;
  8824. for (a = 0; a < b; a++) {
  8825. var c = this._elementsContent[a];
  8826. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  8827. this._elementAdded(c, a)
  8828. }
  8829. };
  8830. Object.defineProperty(a.prototype, "numElements", {
  8831. get: function() {
  8832. return this._elementsContent.length
  8833. },
  8834. enumerable: !0,
  8835. configurable: !0
  8836. });
  8837. a.prototype.getElementAt = function(b) {
  8838. this.checkForRangeError(b);
  8839. return this._elementsContent[b]
  8840. };
  8841. a.prototype.checkForRangeError = function(b, a) {
  8842. "undefined" === typeof a && (a = !1);
  8843. var c = this._elementsContent.length - 1;
  8844. a && c++;
  8845. if (0 > b || b > c) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  8846. };
  8847. a.prototype.addElement = function(b) {
  8848. var a = this.numElements;
  8849. b.parent == this && (a = this.numElements - 1);
  8850. return this.addElementAt(b, a)
  8851. };
  8852. a.prototype.addElementAt = function(b, a) {
  8853. if (b == this) return b;
  8854. this.checkForRangeError(a, !0);
  8855. var c = b.owner;
  8856. if (c == this) return this.setElementIndex(b, a),
  8857. b;
  8858. c && "removeElement" in c && b.owner.removeElement(b);
  8859. this._elementsContent.splice(a, 0, b);
  8860. this.elementsContentChanged || this._elementAdded(b, a);
  8861. return b
  8862. };
  8863. a.prototype.removeElement = function(b) {
  8864. return this.removeElementAt(this.getElementIndex(b))
  8865. };
  8866. a.prototype.removeElementAt = function(b) {
  8867. this.checkForRangeError(b);
  8868. var a = this._elementsContent[b];
  8869. this.elementsContentChanged || this._elementRemoved(a, b);
  8870. this._elementsContent.splice(b, 1);
  8871. return a
  8872. };
  8873. a.prototype.removeAllElements = function() {
  8874. for (var b = this.numElements - 1; 0 <= b; b--) this.removeElementAt(b)
  8875. };
  8876. a.prototype.getElementIndex = function(b) {
  8877. return this._elementsContent.indexOf(b)
  8878. };
  8879. a.prototype.setElementIndex = function(b, a) {
  8880. this.checkForRangeError(a);
  8881. var c = this.getElementIndex(b); - 1 != c && c != a && (this.elementsContentChanged || this._elementRemoved(b, c, !1), this._elementsContent.splice(c, 1), this._elementsContent.splice(a, 0, b), this.elementsContentChanged || this._elementAdded(b, a, !1))
  8882. };
  8883. a.prototype.swapElements = function(b, a) {
  8884. this.swapElementsAt(this.getElementIndex(b), this.getElementIndex(a))
  8885. };
  8886. a.prototype.swapElementsAt = function(b, a) {
  8887. this.checkForRangeError(b);
  8888. this.checkForRangeError(a);
  8889. if (b > a) {
  8890. var c = a;
  8891. a = b;
  8892. b = c
  8893. } else if (b == a) return;
  8894. var c = this._elementsContent,
  8895. d = c[b],
  8896. e = c[a];
  8897. this.elementsContentChanged || (this._elementRemoved(d, b, !1), this._elementRemoved(e, a, !1));
  8898. c[b] = e;
  8899. c[a] = d;
  8900. this.elementsContentChanged || (this._elementAdded(e, b, !1), this._elementAdded(d, a, !1))
  8901. };
  8902. a.prototype._elementAdded = function(b, a, d) {
  8903. "undefined" === typeof d && (d = !0);
  8904. b instanceof c.DisplayObject && this._addToDisplayListAt(b, a, d);
  8905. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  8906. this.invalidateSize();
  8907. this.invalidateDisplayList()
  8908. };
  8909. a.prototype._elementRemoved = function(b, a, d) {
  8910. "undefined" === typeof d && (d = !0);
  8911. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_REMOVE, b, a);
  8912. b instanceof c.DisplayObject && b.parent == this && this._removeFromDisplayList(b, d);
  8913. this.invalidateSize();
  8914. this.invalidateDisplayList()
  8915. };
  8916. a.prototype.addChild = function(b) {
  8917. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  8918. };
  8919. a.prototype.addChildAt = function(b, c) {
  8920. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  8921. };
  8922. a.prototype.removeChild = function(b) {
  8923. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  8924. };
  8925. a.prototype.removeChildAt = function(b) {
  8926. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  8927. };
  8928. a.prototype.setChildIndex = function(b, c) {
  8929. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  8930. };
  8931. a.prototype.swapChildren = function(b, c) {
  8932. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  8933. };
  8934. a.prototype.swapChildrenAt = function(b, c) {
  8935. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  8936. };
  8937. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  8938. return a
  8939. } (c.GroupBase);
  8940. c.Group = e
  8941. })(egret || (egret = {}));
  8942. __extends = this.__extends ||
  8943. function(c, e) {
  8944. function d() {
  8945. this.constructor = c
  8946. }
  8947. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8948. d.prototype = e.prototype;
  8949. c.prototype = new d
  8950. }; (function(c) {
  8951. var e = function(d) {
  8952. function a() {
  8953. d.call(this);
  8954. this._createAllChildren = !1;
  8955. this.proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  8956. this._selectedIndex = -1;
  8957. this.childOrderingChanged = this.notifyTabBar = !1;
  8958. this._setLayout(new c.BasicLayout)
  8959. }
  8960. __extends(a, d);
  8961. Object.defineProperty(a.prototype, "layout", {
  8962. get: function() {
  8963. return this._layout
  8964. },
  8965. set: function(b) {},
  8966. enumerable: !0,
  8967. configurable: !0
  8968. });
  8969. Object.defineProperty(a.prototype, "createAllChildren", {
  8970. get: function() {
  8971. return this._createAllChildren
  8972. },
  8973. set: function(b) {
  8974. if (this._createAllChildren != b && (this._createAllChildren = b)) {
  8975. b = this._getElementsContent();
  8976. for (var a = b.length,
  8977. d = 0; d < a; d++) {
  8978. var e = b[d];
  8979. e instanceof c.DisplayObject && e.parent != this && (this.childOrderingChanged = !0, this._addToDisplayList(e))
  8980. }
  8981. this.childOrderingChanged && this.invalidateProperties()
  8982. }
  8983. },
  8984. enumerable: !0,
  8985. configurable: !0
  8986. });
  8987. Object.defineProperty(a.prototype, "selectedChild", {
  8988. get: function() {
  8989. var b = this.selectedIndex;
  8990. return 0 <= b && b < this.numElements ? this.getElementAt(b) : null
  8991. },
  8992. set: function(b) {
  8993. b = this.getElementIndex(b);
  8994. 0 <= b && b < this.numElements && this._setSelectedIndex(b)
  8995. },
  8996. enumerable: !0,
  8997. configurable: !0
  8998. });
  8999. Object.defineProperty(a.prototype, "selectedIndex", {
  9000. get: function() {
  9001. return this.proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this.proposedSelectedIndex: this._selectedIndex
  9002. },
  9003. set: function(b) {
  9004. this._setSelectedIndex(b)
  9005. },
  9006. enumerable: !0,
  9007. configurable: !0
  9008. });
  9009. a.prototype._setSelectedIndex = function(b, a) {
  9010. "undefined" === typeof a && (a = !0);
  9011. b != this.selectedIndex && (this.proposedSelectedIndex = b, this.invalidateProperties(), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT), this.notifyTabBar = this.notifyTabBar || a)
  9012. };
  9013. a.prototype._elementAdded = function(b, a, d) {
  9014. "undefined" === typeof d && (d = !0);
  9015. this._createAllChildren && b instanceof c.DisplayObject && this._addToDisplayListAt(b, a, d);
  9016. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9017. b.visible = !1;
  9018. b.includeInLayout = !1; - 1 == this.selectedIndex ? this._setSelectedIndex(a, !1) : a <= this.selectedIndex && this.initialized && this._setSelectedIndex(this.selectedIndex + 1);
  9019. this.dispatchCoEvent(c.CollectionEventKind.ADD, a, -1, [b.name])
  9020. };
  9021. a.prototype._elementRemoved = function(b, a, e) {
  9022. "undefined" === typeof e && (e = !0);
  9023. d.prototype._elementRemoved.call(this, b, a, e);
  9024. b.visible = !0;
  9025. b.includeInLayout = !0;
  9026. a == this.selectedIndex ? 0 < this.numElements ? 0 == a ? (this.proposedSelectedIndex = 0, this.invalidateProperties()) : this._setSelectedIndex(0, !1) : this._setSelectedIndex( - 1) : a < this.selectedIndex && this._setSelectedIndex(this.selectedIndex - 1);
  9027. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, a, -1, [b.name])
  9028. };
  9029. a.prototype.commitProperties = function() {
  9030. d.prototype.commitProperties.call(this);
  9031. this.proposedSelectedIndex != a.NO_PROPOSED_SELECTION && (this.commitSelection(this.proposedSelectedIndex), this.proposedSelectedIndex = a.NO_PROPOSED_SELECTION);
  9032. if (this.childOrderingChanged) {
  9033. this.childOrderingChanged = !1;
  9034. for (var b = this._getElementsContent(), e = b.length, m = 0; m < e; m++) {
  9035. var k = b[m];
  9036. k instanceof c.DisplayObject && k.parent == this && this._addToDisplayList(k)
  9037. }
  9038. }
  9039. this.notifyTabBar && (this.notifyTabBar = !0, this.dispatchEventWith("IndexChanged"))
  9040. };
  9041. a.prototype.commitSelection = function(b) {
  9042. 0 <= b && b < this.numElements ? (this._selectedIndex = b, this._selectedChild && this._selectedChild.parent == this && (this._selectedChild.visible = !1, this._selectedChild.includeInLayout = !1), this._selectedChild = this.getElementAt(this._selectedIndex), this._selectedChild.visible = !0, this._selectedChild.includeInLayout = !0, this._selectedChild.parent != this && this._selectedChild instanceof c.DisplayObject && (this._addToDisplayList(this._selectedChild), this.childOrderingChanged || (this.childOrderingChanged = !0))) : (this._selectedChild = null, this._selectedIndex = -1);
  9043. this.invalidateSize();
  9044. this.invalidateDisplayList()
  9045. };
  9046. Object.defineProperty(a.prototype, "length", {
  9047. get: function() {
  9048. return this.numElements
  9049. },
  9050. enumerable: !0,
  9051. configurable: !0
  9052. });
  9053. a.prototype.getItemAt = function(b) {
  9054. return (b = this.getElementAt(b)) ? b.name: ""
  9055. };
  9056. a.prototype.getItemIndex = function(b) {
  9057. for (var a = this._getElementsContent(), c = a.length, d = 0; d < c; d++) if (a[d].name === b) return d;
  9058. return - 1
  9059. };
  9060. a.prototype.dispatchCoEvent = function(b, a, d, e, f) {
  9061. "undefined" === typeof b && (b = null);
  9062. "undefined" === typeof a && (a = -1);
  9063. "undefined" === typeof d && (d = -1);
  9064. "undefined" === typeof e && (e = null);
  9065. "undefined" === typeof f && (f = null);
  9066. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, f)
  9067. };
  9068. a.NO_PROPOSED_SELECTION = -2;
  9069. return a
  9070. } (c.Group);
  9071. c.ViewStack = e
  9072. })(egret || (egret = {}));
  9073. __extends = this.__extends ||
  9074. function(c, e) {
  9075. function d() {
  9076. this.constructor = c
  9077. }
  9078. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9079. d.prototype = e.prototype;
  9080. c.prototype = new d
  9081. }; (function(c) {
  9082. var e = function(d) {
  9083. function a() {
  9084. d.call(this);
  9085. this.maxWidth = 1E4;
  9086. this.minWidth = 0;
  9087. this.maxHeight = 1E4;
  9088. this.minHeight = 0;
  9089. this.height = this.width = NaN;
  9090. this._initialized = !1;
  9091. this._elementsContent = [];
  9092. this._states = [];
  9093. this.initialized = !1
  9094. }
  9095. __extends(a, d);
  9096. a.prototype.createChildren = function() {};
  9097. Object.defineProperty(a.prototype, "hostComponent", {
  9098. get: function() {
  9099. return this._hostComponent
  9100. },
  9101. set: function(b) {
  9102. this._setHostComponent(b)
  9103. },
  9104. enumerable: !0,
  9105. configurable: !0
  9106. });
  9107. a.prototype._setHostComponent = function(b) {
  9108. if (this._hostComponent != b) {
  9109. var a;
  9110. if (this._hostComponent) for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9111. this._hostComponent = b;
  9112. this._initialized || (this._initialized = !0, this.createChildren());
  9113. if (this._hostComponent) {
  9114. b = this._elementsContent.length;
  9115. for (a = 0; a < b; a++) this._elementAdded(this._elementsContent[a], a);
  9116. this.initializeStates();
  9117. this.currentStateChanged && this.commitCurrentState()
  9118. }
  9119. }
  9120. };
  9121. a.prototype._getElementsContent = function() {
  9122. return this._elementsContent
  9123. };
  9124. Object.defineProperty(a.prototype, "elementsContent", {
  9125. set: function(b) {
  9126. null == b && (b = []);
  9127. if (b != this._elementsContent) if (this._hostComponent) {
  9128. var a;
  9129. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9130. this._elementsContent = b.concat();
  9131. b = this._elementsContent.length;
  9132. for (a = 0; a < b; a++) {
  9133. var c = this._elementsContent[a];
  9134. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  9135. this._elementAdded(c, a)
  9136. }
  9137. } else this._elementsContent = b.concat()
  9138. },
  9139. enumerable: !0,
  9140. configurable: !0
  9141. });
  9142. Object.defineProperty(a.prototype, "numElements", {
  9143. get: function() {
  9144. return this._elementsContent.length
  9145. },
  9146. enumerable: !0,
  9147. configurable: !0
  9148. });
  9149. a.prototype.getElementAt = function(b) {
  9150. this.checkForRangeError(b);
  9151. return this._elementsContent[b]
  9152. };
  9153. a.prototype.checkForRangeError = function(b, a) {
  9154. "undefined" === typeof a && (a = !1);
  9155. var c = this._elementsContent.length - 1;
  9156. a && c++;
  9157. if (0 > b || b > c) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  9158. };
  9159. a.prototype.addElement = function(b) {
  9160. var a = this.numElements;
  9161. b.owner == this && (a = this.numElements - 1);
  9162. return this.addElementAt(b, a)
  9163. };
  9164. a.prototype.addElementAt = function(b, a) {
  9165. this.checkForRangeError(a, !0);
  9166. var c = b.owner;
  9167. if (c == this) return this.setElementIndex(b, a),
  9168. b;
  9169. c && "removeElement" in c && c.removeElement(b);
  9170. this._elementsContent.splice(a, 0, b);
  9171. this._hostComponent ? this._elementAdded(b, a) : b.ownerChanged(this);
  9172. return b
  9173. };
  9174. a.prototype.removeElement = function(b) {
  9175. return this.removeElementAt(this.getElementIndex(b))
  9176. };
  9177. a.prototype.removeElementAt = function(b) {
  9178. this.checkForRangeError(b);
  9179. var a = this._elementsContent[b];
  9180. this._hostComponent ? this._elementRemoved(a, b) : a.ownerChanged(null);
  9181. this._elementsContent.splice(b, 1);
  9182. return a
  9183. };
  9184. a.prototype.getElementIndex = function(b) {
  9185. return this._elementsContent.indexOf(b)
  9186. };
  9187. a.prototype.setElementIndex = function(b, a) {
  9188. this.checkForRangeError(a);
  9189. var c = this.getElementIndex(b); - 1 != c && c != a && (this._hostComponent && this._elementRemoved(b, c, !1), this._elementsContent.splice(c, 1), this._elementsContent.splice(a, 0, b), this._hostComponent && this._elementAdded(b, a, !1))
  9190. };
  9191. a.prototype._elementAdded = function(b, a, d) {
  9192. "undefined" === typeof d && (d = !0);
  9193. b.ownerChanged(this);
  9194. b instanceof c.DisplayObject && this._hostComponent._addToDisplayListAt(b, a, d);
  9195. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9196. this._hostComponent.invalidateSize();
  9197. this._hostComponent.invalidateDisplayList()
  9198. };
  9199. a.prototype._elementRemoved = function(b, a, d) {
  9200. "undefined" === typeof d && (d = !0);
  9201. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_REMOVE, b, a);
  9202. b instanceof c.DisplayObject && b.parent == this._hostComponent && this._hostComponent._removeFromDisplayList(b, d);
  9203. b.ownerChanged(null);
  9204. this._hostComponent.invalidateSize();
  9205. this._hostComponent.invalidateDisplayList()
  9206. };
  9207. Object.defineProperty(a.prototype, "states", {
  9208. get: function() {
  9209. return this._states
  9210. },
  9211. set: function(b) {
  9212. this._setStates(b)
  9213. },
  9214. enumerable: !0,
  9215. configurable: !0
  9216. });
  9217. a.prototype._setStates = function(b) {
  9218. b || (b = []);
  9219. if ("string" == typeof b[0]) for (var a = b.length,
  9220. d = 0; d < a; d++) {
  9221. var e = new c.State(b[d], []);
  9222. b[d] = e
  9223. }
  9224. this._states = b;
  9225. this.currentStateChanged = !0;
  9226. this.requestedCurrentState = this._currentState;
  9227. this.hasState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState())
  9228. };
  9229. Object.defineProperty(a.prototype, "currentState", {
  9230. get: function() {
  9231. return this.currentStateChanged ? this.requestedCurrentState: this._currentState ? this._currentState: this.getDefaultState()
  9232. },
  9233. set: function(b) {
  9234. b || (b = this.getDefaultState());
  9235. b != this.currentState && b && this.currentState && (this.requestedCurrentState = b, this.currentStateChanged = !0, this._hostComponent && this.commitCurrentState())
  9236. },
  9237. enumerable: !0,
  9238. configurable: !0
  9239. });
  9240. a.prototype.hasState = function(b) {
  9241. return null != this.getState(b)
  9242. };
  9243. a.prototype.getDefaultState = function() {
  9244. return 0 < this._states.length ? this._states[0].name: null
  9245. };
  9246. a.prototype.commitCurrentState = function() {
  9247. if (this.currentStateChanged) {
  9248. this.currentStateChanged = !1;
  9249. this.getState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState());
  9250. var b = this._currentState ? this._currentState: "";
  9251. this.hasEventListener(c.StateChangeEvent.CURRENT_STATE_CHANGING) && c.StateChangeEvent.dispatchStateChangeEvent(this, c.StateChangeEvent.CURRENT_STATE_CHANGING, b, this.requestedCurrentState ? this.requestedCurrentState: "");
  9252. this.removeState(this._currentState); (this._currentState = this.requestedCurrentState) && this.applyState(this._currentState);
  9253. this.hasEventListener(c.StateChangeEvent.CURRENT_STATE_CHANGE) && c.StateChangeEvent.dispatchStateChangeEvent(this, c.StateChangeEvent.CURRENT_STATE_CHANGE, b, this._currentState ? this._currentState: "")
  9254. }
  9255. };
  9256. a.prototype.getState = function(b) {
  9257. if (!b) return null;
  9258. for (var a = this._states,
  9259. c = a.length,
  9260. d = 0; d < c; d++) {
  9261. var e = a[d];
  9262. if (e.name == b) return e
  9263. }
  9264. return null
  9265. };
  9266. a.prototype.removeState = function(b) {
  9267. if (b = this.getState(b)) {
  9268. b = b.overrides;
  9269. for (var a = b.length - 1; 0 <= a; a--) b[a].remove(this)
  9270. }
  9271. };
  9272. a.prototype.applyState = function(b) {
  9273. if (b = this.getState(b)) {
  9274. b = b.overrides;
  9275. for (var a = b.length,
  9276. c = 0; c < a; c++) b[c].apply(this)
  9277. }
  9278. };
  9279. a.prototype.initializeStates = function() {
  9280. if (!this.initialized) {
  9281. this.initialized = !0;
  9282. for (var b = this._states,
  9283. a = b.length,
  9284. c = 0; c < a; c++) b[c].initialize(this)
  9285. }
  9286. };
  9287. return a
  9288. } (c.EventDispatcher);
  9289. c.Skin = e
  9290. })(egret || (egret = {}));
  9291. __extends = this.__extends ||
  9292. function(c, e) {
  9293. function d() {
  9294. this.constructor = c
  9295. }
  9296. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9297. d.prototype = e.prototype;
  9298. c.prototype = new d
  9299. }; (function(c) {
  9300. var e = function(d) {
  9301. function a() {
  9302. d.call(this);
  9303. this.useVirtualLayoutChanged = !1;
  9304. this.rendererToClassMap = [];
  9305. this.freeRenderers = [];
  9306. this.dataProviderChanged = this.createNewRendererFlag = !1;
  9307. this.recyclerDic = [];
  9308. this.typicalItemChanged = this.virtualLayoutUnderway = this.itemRendererSkinNameChange = !1;
  9309. this.indexToRenderer = [];
  9310. this.renderersBeingUpdated = this.cleanFreeRenderer = !1
  9311. }
  9312. __extends(a, d);
  9313. Object.defineProperty(a.prototype, "layout", {
  9314. get: function() {
  9315. return this._layout
  9316. },
  9317. set: function(b) {
  9318. b != this.layout && (this.layout && (this.layout.typicalLayoutRect = null, this.layout.removeEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler, this)), this.layout && b && this.layout.useVirtualLayout != b.useVirtualLayout && this.changeUseVirtualLayout(), this._setLayout(b), b && (b.typicalLayoutRect = this.typicalLayoutRect, b.addEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler, this)))
  9319. },
  9320. enumerable: !0,
  9321. configurable: !0
  9322. });
  9323. a.prototype.layout_useVirtualLayoutChangedHandler = function(b) {
  9324. this.changeUseVirtualLayout()
  9325. };
  9326. a.prototype.setVirtualElementIndicesInView = function(b, a) {
  9327. if (this.layout && this.layout.useVirtualLayout) {
  9328. this.virtualRendererIndices = [];
  9329. for (var c = b; c <= a; c++) this.virtualRendererIndices.push(c);
  9330. for (var d in this.indexToRenderer) d = parseInt(d),
  9331. -1 == this.virtualRendererIndices.indexOf(d) && this.freeRendererByIndex(d)
  9332. }
  9333. };
  9334. a.prototype.getVirtualElementAt = function(b) {
  9335. if (0 > b || b >= this.dataProvider.length) return null;
  9336. var a = this.indexToRenderer[b];
  9337. if (!a) {
  9338. var a = this.dataProvider.getItemAt(b),
  9339. d = this.createVirtualRenderer(b);
  9340. this.indexToRenderer[b] = d;
  9341. this.updateRenderer(d, b, a);
  9342. this.createNewRendererFlag && ("validateNow" in d && d.validateNow(), this.createNewRendererFlag = !1, c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_ADD, d, b, a));
  9343. a = d
  9344. }
  9345. return a
  9346. };
  9347. a.prototype.freeRendererByIndex = function(b) {
  9348. if (this.indexToRenderer[b]) {
  9349. var a = this.indexToRenderer[b];
  9350. delete this.indexToRenderer[b];
  9351. a && a instanceof c.DisplayObject && this.doFreeRenderer(a)
  9352. }
  9353. };
  9354. a.prototype.doFreeRenderer = function(b) {
  9355. var a = this.rendererToClassMap[b.hashCode].hashCode;
  9356. this.freeRenderers[a] || (this.freeRenderers[a] = []);
  9357. this.freeRenderers[a].push(b);
  9358. b.visible = !1
  9359. };
  9360. a.prototype.invalidateSize = function() {
  9361. this.createNewRendererFlag || d.prototype.invalidateSize.call(this)
  9362. };
  9363. a.prototype.createVirtualRenderer = function(b) {
  9364. b = this.dataProvider.getItemAt(b);
  9365. b = this.itemToRendererClass(b);
  9366. var a = b.hashCode,
  9367. c = this.freeRenderers;
  9368. if (c[a] && 0 < c[a].length) return b = c[a].pop(),
  9369. b.visible = !0,
  9370. b;
  9371. this.createNewRendererFlag = !0;
  9372. return this.createOneRenderer(b)
  9373. };
  9374. a.prototype.createOneRenderer = function(b) {
  9375. var a, d = b.hashCode,
  9376. e = this.recyclerDic[d];
  9377. e && (a = e.pop(), 0 == e.length && delete this.recyclerDic[d]);
  9378. a || (a = b.newInstance(), this.rendererToClassMap[a.hashCode] = b);
  9379. if (! (a && a instanceof c.DisplayObject)) return null;
  9380. this._itemRendererSkinName && this.setItemRenderSkinName(a);
  9381. this._addToDisplayList(a);
  9382. a.setLayoutBoundsSize(NaN, NaN);
  9383. return a
  9384. };
  9385. a.prototype.setItemRenderSkinName = function(b) {
  9386. b && (b ? b._skinNameExplicitlySet || (b.skinName = this._itemRendererSkinName) : b && !b.skinName && (b.skinName = this._itemRendererSkinName))
  9387. };
  9388. a.prototype.finishVirtualLayout = function() {
  9389. if (this.virtualLayoutUnderway) {
  9390. var b = this.virtualLayoutUnderway = !1,
  9391. a;
  9392. for (a in this.freeRenderers) if (0 < this.freeRenderers[a].length) {
  9393. b = !0;
  9394. break
  9395. }
  9396. b && (this.cleanTimer || (this.cleanTimer = new c.Timer(3E3, 1), this.cleanTimer.addEventListener(c.TimerEvent.TIMER, this.cleanAllFreeRenderer, this)), this.cleanTimer.reset(), this.cleanTimer.start())
  9397. }
  9398. };
  9399. a.prototype.cleanAllFreeRenderer = function(b) {
  9400. var a = this.freeRenderers,
  9401. c;
  9402. for (c in a) for (var d = a[c], e = d.length, g = 0; g < e; g++) b = d[g],
  9403. b.visible = !0,
  9404. this.recycle(b);
  9405. this.freeRenderers = [];
  9406. this.cleanFreeRenderer = !1
  9407. };
  9408. a.prototype.getElementIndicesInView = function() {
  9409. return this.layout && this.layout.useVirtualLayout ? this.virtualRendererIndices ? this.virtualRendererIndices: [] : d.prototype.getElementIndicesInView.call(this)
  9410. };
  9411. a.prototype.changeUseVirtualLayout = function() {
  9412. this.cleanFreeRenderer = this.useVirtualLayoutChanged = !0;
  9413. this.removeDataProviderListener();
  9414. this.invalidateProperties()
  9415. };
  9416. Object.defineProperty(a.prototype, "dataProvider", {
  9417. get: function() {
  9418. return this._dataProvider
  9419. },
  9420. set: function(b) {
  9421. this._dataProvider != b && (this.removeDataProviderListener(), this._dataProvider = b, this.cleanFreeRenderer = this.dataProviderChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  9422. },
  9423. enumerable: !0,
  9424. configurable: !0
  9425. });
  9426. a.prototype.removeDataProviderListener = function() {
  9427. this._dataProvider && this._dataProvider.removeEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange, this)
  9428. };
  9429. a.prototype.onCollectionChange = function(b) {
  9430. switch (b.kind) {
  9431. case c.CollectionEventKind.ADD:
  9432. this.itemAddedHandler(b.items, b.location);
  9433. break;
  9434. case c.CollectionEventKind.MOVE:
  9435. this.itemMovedHandler(b.items[0], b.location, b.oldLocation);
  9436. break;
  9437. case c.CollectionEventKind.REMOVE:
  9438. this.itemRemovedHandler(b.items, b.location);
  9439. break;
  9440. case c.CollectionEventKind.UPDATE:
  9441. this.itemUpdatedHandler(b.items[0], b.location);
  9442. break;
  9443. case c.CollectionEventKind.REPLACE:
  9444. this.itemRemoved(b.oldItems[0], b.location);
  9445. this.itemAdded(b.items[0], b.location);
  9446. break;
  9447. case c.CollectionEventKind.RESET:
  9448. case c.CollectionEventKind.REFRESH:
  9449. if (this.layout && this.layout.useVirtualLayout) for (var a in this.indexToRenderer) a = parseInt(a),
  9450. this.freeRendererByIndex(a);
  9451. this.dataProviderChanged = !0;
  9452. this.invalidateProperties()
  9453. }
  9454. this.invalidateSize();
  9455. this.invalidateDisplayList()
  9456. };
  9457. a.prototype.itemAddedHandler = function(b, a) {
  9458. for (var c = b.length,
  9459. d = 0; d < c; d++) this.itemAdded(b[d], a + d);
  9460. this.resetRenderersIndices()
  9461. };
  9462. a.prototype.itemMovedHandler = function(b, a, c) {
  9463. this.itemRemoved(b, c);
  9464. this.itemAdded(b, a);
  9465. this.resetRenderersIndices()
  9466. };
  9467. a.prototype.itemRemovedHandler = function(b, a) {
  9468. for (var c = b.length - 1; 0 <= c; c--) this.itemRemoved(b[c], a + c);
  9469. this.resetRenderersIndices()
  9470. };
  9471. a.prototype.itemAdded = function(b, a) {
  9472. this.layout && this.layout.elementAdded(a);
  9473. if (this.layout && this.layout.useVirtualLayout) {
  9474. var d = this.virtualRendererIndices;
  9475. if (d) {
  9476. for (var e = d.length,
  9477. f = 0; f < e; f++) {
  9478. var g = d[f];
  9479. g >= a && (d[f] = g + 1)
  9480. }
  9481. this.indexToRenderer.splice(a, 0, null)
  9482. }
  9483. } else d = this.itemToRendererClass(b),
  9484. d = this.createOneRenderer(d),
  9485. this.indexToRenderer.splice(a, 0, d),
  9486. d && (this.updateRenderer(d, a, b), c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_ADD, d, a, b))
  9487. };
  9488. a.prototype.itemRemoved = function(b, a) {
  9489. this.layout && this.layout.elementRemoved(a);
  9490. var d = this.virtualRendererIndices;
  9491. if (d && 0 < d.length) {
  9492. for (var e = -1,
  9493. f = d.length,
  9494. g = 0; g < f; g++) {
  9495. var l = d[g];
  9496. l == a ? e = g: l > a && (d[g] = l - 1)
  9497. } - 1 != e && d.splice(e, 1)
  9498. }
  9499. d = this.indexToRenderer[a];
  9500. this.indexToRenderer.length > a && this.indexToRenderer.splice(a, 1);
  9501. c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_REMOVE, d, a, b);
  9502. d && d instanceof c.DisplayObject && this.recycle(d)
  9503. };
  9504. a.prototype.recycle = function(b) {
  9505. this._removeFromDisplayList(b);
  9506. "ownerChanged" in b && b.ownerChanged(null);
  9507. var a = this.rendererToClassMap[b.hashCode].hashCode;
  9508. this.recyclerDic[a] || (this.recyclerDic[a] = new c.Recycler);
  9509. this.recyclerDic[a].push(b)
  9510. };
  9511. a.prototype.resetRenderersIndices = function() {
  9512. if (0 != this.indexToRenderer.length) if (this.layout && this.layout.useVirtualLayout) for (var b = this.virtualRendererIndices,
  9513. a = b.length,
  9514. c = 0; c < a; c++) {
  9515. var d = b[c];
  9516. this.resetRendererItemIndex(d)
  9517. } else for (b = this.indexToRenderer.length, d = 0; d < b; d++) this.resetRendererItemIndex(d)
  9518. };
  9519. a.prototype.itemUpdatedHandler = function(b, a) {
  9520. if (!this.renderersBeingUpdated) {
  9521. var c = this.indexToRenderer[a];
  9522. c && this.updateRenderer(c, a, b)
  9523. }
  9524. };
  9525. a.prototype.resetRendererItemIndex = function(b) {
  9526. var a = this.indexToRenderer[b];
  9527. a && (a.itemIndex = b)
  9528. };
  9529. Object.defineProperty(a.prototype, "itemRenderer", {
  9530. get: function() {
  9531. return this._itemRenderer
  9532. },
  9533. set: function(b) {
  9534. this._itemRenderer !== b && (this._itemRenderer = b, this.cleanFreeRenderer = this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  9535. },
  9536. enumerable: !0,
  9537. configurable: !0
  9538. });
  9539. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  9540. get: function() {
  9541. return this._itemRendererSkinName
  9542. },
  9543. set: function(b) {
  9544. this._itemRendererSkinName != b && (this._itemRendererSkinName = b) && this.initialized && (this.itemRendererSkinNameChange = !0, this.invalidateProperties())
  9545. },
  9546. enumerable: !0,
  9547. configurable: !0
  9548. });
  9549. Object.defineProperty(a.prototype, "itemRendererFunction", {
  9550. get: function() {
  9551. return this._itemRendererFunction
  9552. },
  9553. set: function(b) {
  9554. this._itemRendererFunction != b && (this._itemRendererFunction = b, this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  9555. },
  9556. enumerable: !0,
  9557. configurable: !0
  9558. });
  9559. a.prototype.itemToRendererClass = function(b) {
  9560. null != this._itemRendererFunction ? (b = this._itemRendererFunction(b), b || (b = this._itemRenderer)) : b = this._itemRenderer;
  9561. return b ? b: a.defaultRendererFactory
  9562. };
  9563. a.prototype.createChildren = function() {
  9564. if (!this.layout) {
  9565. var b = new c.VerticalLayout;
  9566. b.gap = 0;
  9567. b.horizontalAlign = c.HorizontalAlign.CONTENT_JUSTIFY;
  9568. this.layout = b
  9569. }
  9570. d.prototype.createChildren.call(this)
  9571. };
  9572. a.prototype.commitProperties = function() {
  9573. if (this.itemRendererChanged || this.dataProviderChanged || this.useVirtualLayoutChanged) this.removeAllRenderers(),
  9574. this.layout && this.layout.clearVirtualLayoutCache(),
  9575. this.setTypicalLayoutRect(null),
  9576. this.itemRendererChanged = this.useVirtualLayoutChanged = !1,
  9577. this._dataProvider && this._dataProvider.addEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange, this),
  9578. this.layout && this.layout.useVirtualLayout ? (this.invalidateSize(), this.invalidateDisplayList()) : this.createRenderers(),
  9579. this.dataProviderChanged && (this.dataProviderChanged = !1, this.verticalScrollPosition = this.horizontalScrollPosition = 0);
  9580. d.prototype.commitProperties.call(this);
  9581. this.typicalItemChanged && (this.typicalItemChanged = !1, this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize()));
  9582. if (this.itemRendererSkinNameChange) {
  9583. this.itemRendererSkinNameChange = !1;
  9584. for (var b = this.indexToRenderer.length,
  9585. a = 0; a < b; a++) this.setItemRenderSkinName(this.indexToRenderer[a]);
  9586. var e = this.freeRenderers,
  9587. k;
  9588. for (k in e) {
  9589. var f = e[k];
  9590. if (f) for (b = f.length, a = 0; a < b; a++) this.setItemRenderSkinName(f[a])
  9591. }
  9592. }
  9593. };
  9594. a.prototype.measure = function() {
  9595. this.layout && this.layout.useVirtualLayout && this.ensureTypicalLayoutElement();
  9596. d.prototype.measure.call(this)
  9597. };
  9598. a.prototype.updateDisplayList = function(b, a) {
  9599. this._layoutInvalidateDisplayListFlag && this.layout && this.layout.useVirtualLayout && (this.virtualLayoutUnderway = !0, this.ensureTypicalLayoutElement());
  9600. d.prototype.updateDisplayList.call(this, b, a);
  9601. this.virtualLayoutUnderway && this.finishVirtualLayout()
  9602. };
  9603. a.prototype.ensureTypicalLayoutElement = function() { ! this.layout.typicalLayoutRect && this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize())
  9604. };
  9605. a.prototype.measureRendererSize = function() {
  9606. if (this.typicalItem) {
  9607. var b = this.itemToRendererClass(this.typicalItem);
  9608. if (b = this.createOneRenderer(b)) {
  9609. this.createNewRendererFlag = !0;
  9610. this.updateRenderer(b, 0, this.typicalItem);
  9611. "validateNow" in b && b.validateNow();
  9612. var a = new c.Rectangle(0, 0, b.preferredWidth, b.preferredHeight);
  9613. this.recycle(b);
  9614. this.setTypicalLayoutRect(a);
  9615. this.createNewRendererFlag = !1
  9616. } else this.setTypicalLayoutRect(null)
  9617. } else this.setTypicalLayoutRect(null)
  9618. };
  9619. a.prototype.setTypicalLayoutRect = function(b) {
  9620. this.typicalLayoutRect = b;
  9621. this.layout && (this.layout.typicalLayoutRect = b)
  9622. };
  9623. a.prototype.removeAllRenderers = function() {
  9624. for (var b = this.indexToRenderer.length,
  9625. a, d = 0; d < b; d++) if (a = this.indexToRenderer[d]) this.recycle(a),
  9626. c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_REMOVE, a, a.itemIndex, a.data);
  9627. this.indexToRenderer = [];
  9628. this.virtualRendererIndices = null;
  9629. this.cleanFreeRenderer && this.cleanAllFreeRenderer()
  9630. };
  9631. a.prototype.createRenderers = function() {
  9632. if (this._dataProvider) for (var b = 0,
  9633. a = this._dataProvider.length,
  9634. d = 0; d < a; d++) {
  9635. var e = this._dataProvider.getItemAt(d),
  9636. f = this.itemToRendererClass(e);
  9637. if (f = this.createOneRenderer(f)) this.indexToRenderer[b] = f,
  9638. this.updateRenderer(f, b, e),
  9639. c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_ADD, f, b, e),
  9640. b++
  9641. }
  9642. };
  9643. a.prototype.updateRenderer = function(b, a, c) {
  9644. this.renderersBeingUpdated = !0;
  9645. this._rendererOwner ? b = this._rendererOwner.updateRenderer(b, a, c) : ("ownerChanged" in b && b.ownerChanged(this), b.itemIndex = a, b.label = this.itemToLabel(c), b.data = c);
  9646. this.renderersBeingUpdated = !1;
  9647. return b
  9648. };
  9649. a.prototype.itemToLabel = function(b) {
  9650. return b ? b.toString() : " "
  9651. };
  9652. a.prototype.getElementAt = function(b) {
  9653. return this.indexToRenderer[b]
  9654. };
  9655. a.prototype.getElementIndex = function(b) {
  9656. return b ? this.indexToRenderer.indexOf(b) : -1
  9657. };
  9658. Object.defineProperty(a.prototype, "numElements", {
  9659. get: function() {
  9660. return this._dataProvider ? this._dataProvider.length: 0
  9661. },
  9662. enumerable: !0,
  9663. configurable: !0
  9664. });
  9665. a.prototype.addChild = function(b) {
  9666. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  9667. };
  9668. a.prototype.addChildAt = function(b, c) {
  9669. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  9670. };
  9671. a.prototype.removeChild = function(b) {
  9672. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  9673. };
  9674. a.prototype.removeChildAt = function(b) {
  9675. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  9676. };
  9677. a.prototype.setChildIndex = function(b, c) {
  9678. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  9679. };
  9680. a.prototype.swapChildren = function(b, c) {
  9681. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  9682. };
  9683. a.prototype.swapChildrenAt = function(b, c) {
  9684. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  9685. };
  9686. a.defaultRendererFactory = new c.ClassFactory(c.ItemRenderer);
  9687. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  9688. return a
  9689. } (c.GroupBase);
  9690. c.DataGroup = e
  9691. })(egret || (egret = {}));
  9692. __extends = this.__extends ||
  9693. function(c, e) {
  9694. function d() {
  9695. this.constructor = c
  9696. }
  9697. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9698. d.prototype = e.prototype;
  9699. c.prototype = new d
  9700. }; (function(c) {
  9701. var e = function(d) {
  9702. function a() {
  9703. d.call(this);
  9704. this.contentGroupProperties = {};
  9705. this.hostComponentKey = "egret.SkinnableContainer"
  9706. }
  9707. __extends(a, d);
  9708. a.prototype._getCurrentContentGroup = function() {
  9709. return null == this.contentGroup ? (null == this._placeHolderGroup && (this._placeHolderGroup = new c.Group, this._placeHolderGroup.visible = !1, this._addToDisplayList(this._placeHolderGroup)), this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this), this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this), this._placeHolderGroup) : this.contentGroup
  9710. };
  9711. Object.defineProperty(a.prototype, "elementsContent", {
  9712. set: function(b) {
  9713. this._getCurrentContentGroup().elementsContent = b
  9714. },
  9715. enumerable: !0,
  9716. configurable: !0
  9717. });
  9718. Object.defineProperty(a.prototype, "numElements", {
  9719. get: function() {
  9720. return this._getCurrentContentGroup().numElements
  9721. },
  9722. enumerable: !0,
  9723. configurable: !0
  9724. });
  9725. a.prototype.getElementAt = function(b) {
  9726. return this._getCurrentContentGroup().getElementAt(b)
  9727. };
  9728. a.prototype.addElement = function(b) {
  9729. return this._getCurrentContentGroup().addElement(b)
  9730. };
  9731. a.prototype.addElementAt = function(b, a) {
  9732. return this._getCurrentContentGroup().addElementAt(b, a)
  9733. };
  9734. a.prototype.removeElement = function(b) {
  9735. return this._getCurrentContentGroup().removeElement(b)
  9736. };
  9737. a.prototype.removeElementAt = function(b) {
  9738. return this._getCurrentContentGroup().removeElementAt(b)
  9739. };
  9740. a.prototype.removeAllElements = function() {
  9741. this._getCurrentContentGroup().removeAllElements()
  9742. };
  9743. a.prototype.getElementIndex = function(b) {
  9744. return this._getCurrentContentGroup().getElementIndex(b)
  9745. };
  9746. a.prototype.setElementIndex = function(b, a) {
  9747. this._getCurrentContentGroup().setElementIndex(b, a)
  9748. };
  9749. a.prototype.swapElements = function(b, a) {
  9750. this._getCurrentContentGroup().swapElements(b, a)
  9751. };
  9752. a.prototype.swapElementsAt = function(b, a) {
  9753. this._getCurrentContentGroup().swapElementsAt(b, a)
  9754. };
  9755. Object.defineProperty(a.prototype, "layout", {
  9756. get: function() {
  9757. return null != this.contentGroup ? this.contentGroup.layout: this.contentGroupProperties.layout
  9758. },
  9759. set: function(b) {
  9760. null != this.contentGroup ? this.contentGroup.layout = b: this.contentGroupProperties.layout = b
  9761. },
  9762. enumerable: !0,
  9763. configurable: !0
  9764. });
  9765. a.prototype.partAdded = function(b, a) {
  9766. d.prototype.partAdded.call(this, b, a);
  9767. if (a == this.contentGroup) {
  9768. void 0 !== this.contentGroupProperties.layout && (this.contentGroup.layout = this.contentGroupProperties.layout, this.contentGroupProperties = {});
  9769. if (this._placeHolderGroup) {
  9770. this._placeHolderGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  9771. this._placeHolderGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this);
  9772. for (var e = this._placeHolderGroup._getElementsContent().concat(), k = this._placeHolderGroup.numElements; 0 < k; k--) {
  9773. var f = this._placeHolderGroup.removeElementAt(0);
  9774. f.ownerChanged(null)
  9775. }
  9776. this._removeFromDisplayList(this._placeHolderGroup);
  9777. this.contentGroup.elementsContent = e;
  9778. for (k = e.length - 1; 0 <= k; k--) f = e[k],
  9779. f.ownerChanged(this);
  9780. this._placeHolderGroup = null
  9781. }
  9782. this.contentGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  9783. this.contentGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this)
  9784. }
  9785. };
  9786. a.prototype.partRemoved = function(b, a) {
  9787. d.prototype.partRemoved.call(this, b, a);
  9788. if (a == this.contentGroup && (this.contentGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this), this.contentGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this), this.contentGroupProperties.layout = this.contentGroup.layout, this.contentGroup.layout = null, 0 < this.contentGroup.numElements)) {
  9789. for (this._placeHolderGroup = new c.Group; 0 < this.contentGroup.numElements;) this._placeHolderGroup.addElement(this.contentGroup.getElementAt(0));
  9790. this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  9791. this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this)
  9792. }
  9793. };
  9794. a.prototype._contentGroup_elementAddedHandler = function(b) {
  9795. b.element.ownerChanged(this);
  9796. this.dispatchEvent(b)
  9797. };
  9798. a.prototype._contentGroup_elementRemovedHandler = function(b) {
  9799. b.element.ownerChanged(null);
  9800. this.dispatchEvent(b)
  9801. };
  9802. return a
  9803. } (c.SkinnableComponent);
  9804. c.SkinnableContainer = e
  9805. })(egret || (egret = {}));
  9806. __extends = this.__extends ||
  9807. function(c, e) {
  9808. function d() {
  9809. this.constructor = c
  9810. }
  9811. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9812. d.prototype = e.prototype;
  9813. c.prototype = new d
  9814. }; (function(c) {
  9815. var e = function(d) {
  9816. function a() {
  9817. d.call(this);
  9818. this._dataGroupProperties = {};
  9819. this.hostComponentKey = "egret.SkinnableDataContainer"
  9820. }
  9821. __extends(a, d);
  9822. a.prototype.updateRenderer = function(b, a, c) {
  9823. "ownerChanged" in b && b.ownerChanged(this);
  9824. b.itemIndex = a;
  9825. b.label = this.itemToLabel(c);
  9826. b.data = c;
  9827. return b
  9828. };
  9829. a.prototype.itemToLabel = function(b) {
  9830. return null !== b ? b.toString() : " "
  9831. };
  9832. Object.defineProperty(a.prototype, "dataProvider", {
  9833. get: function() {
  9834. return this._getDataProvider()
  9835. },
  9836. set: function(b) {
  9837. this._setDataProvider(b)
  9838. },
  9839. enumerable: !0,
  9840. configurable: !0
  9841. });
  9842. a.prototype._getDataProvider = function() {
  9843. return null != this.dataGroup ? this.dataGroup.dataProvider: this._dataGroupProperties.dataProvider
  9844. };
  9845. a.prototype._setDataProvider = function(b) {
  9846. null == this.dataGroup ? this._dataGroupProperties.dataProvider = b: (this.dataGroup.dataProvider = b, this._dataGroupProperties.dataProvider = !0)
  9847. };
  9848. Object.defineProperty(a.prototype, "itemRenderer", {
  9849. get: function() {
  9850. return this.dataGroup ? this.dataGroup.itemRenderer: this._dataGroupProperties.itemRenderer
  9851. },
  9852. set: function(b) {
  9853. null == this.dataGroup ? this._dataGroupProperties.itemRenderer = b: (this.dataGroup.itemRenderer = b, this._dataGroupProperties.itemRenderer = !0)
  9854. },
  9855. enumerable: !0,
  9856. configurable: !0
  9857. });
  9858. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  9859. get: function() {
  9860. return this.dataGroup ? this.dataGroup.itemRendererSkinName: this._dataGroupProperties.itemRendererSkinName
  9861. },
  9862. set: function(b) {
  9863. null == this.dataGroup ? this._dataGroupProperties.itemRendererSkinName = b: (this.dataGroup.itemRendererSkinName = b, this._dataGroupProperties.itemRendererSkinName = !0)
  9864. },
  9865. enumerable: !0,
  9866. configurable: !0
  9867. });
  9868. Object.defineProperty(a.prototype, "itemRendererFunction", {
  9869. get: function() {
  9870. return this.dataGroup ? this.dataGroup.itemRendererFunction: this._dataGroupProperties.itemRendererFunction
  9871. },
  9872. set: function(b) {
  9873. null == this.dataGroup ? this._dataGroupProperties.itemRendererFunction = b: (this.dataGroup.itemRendererFunction = b, this._dataGroupProperties.itemRendererFunction = !0)
  9874. },
  9875. enumerable: !0,
  9876. configurable: !0
  9877. });
  9878. Object.defineProperty(a.prototype, "layout", {
  9879. get: function() {
  9880. return this.dataGroup ? this.dataGroup.layout: this._dataGroupProperties.layout
  9881. },
  9882. set: function(b) {
  9883. this._setLayout(b)
  9884. },
  9885. enumerable: !0,
  9886. configurable: !0
  9887. });
  9888. a.prototype._setLayout = function(b) {
  9889. null == this.dataGroup ? this._dataGroupProperties.layout = b: (this.dataGroup.layout = b, this._dataGroupProperties.layout = !0)
  9890. };
  9891. a.prototype.partAdded = function(b, a) {
  9892. d.prototype.partAdded.call(this, b, a);
  9893. if (a == this.dataGroup) {
  9894. var e = {};
  9895. void 0 !== this._dataGroupProperties.layout && (this.dataGroup.layout = this._dataGroupProperties.layout, e.layout = !0);
  9896. void 0 !== this._dataGroupProperties.dataProvider && (this.dataGroup.dataProvider = this._dataGroupProperties.dataProvider, e.dataProvider = !0);
  9897. void 0 !== this._dataGroupProperties.itemRenderer && (this.dataGroup.itemRenderer = this._dataGroupProperties.itemRenderer, e.itemRenderer = !0);
  9898. void 0 !== this._dataGroupProperties.itemRendererSkinName && (this.dataGroup.itemRendererSkinName = this._dataGroupProperties.itemRendererSkinName, e.itemRendererSkinName = !0);
  9899. void 0 !== this._dataGroupProperties.itemRendererFunction && (this.dataGroup.itemRendererFunction = this._dataGroupProperties.itemRendererFunction, e.itemRendererFunction = !0);
  9900. this.dataGroup._rendererOwner = this;
  9901. this._dataGroupProperties = e;
  9902. this.hasEventListener(c.RendererExistenceEvent.RENDERER_ADD) && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  9903. this.hasEventListener(c.RendererExistenceEvent.RENDERER_REMOVE) && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this)
  9904. }
  9905. };
  9906. a.prototype.partRemoved = function(b, a) {
  9907. d.prototype.partRemoved.call(this, b, a);
  9908. if (a == this.dataGroup) {
  9909. this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  9910. this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this);
  9911. var e = {};
  9912. this._dataGroupProperties.layout && (e.layout = this.dataGroup.layout);
  9913. this._dataGroupProperties.dataProvider && (e.dataProvider = this.dataGroup.dataProvider);
  9914. this._dataGroupProperties.itemRenderer && (e.itemRenderer = this.dataGroup.itemRenderer);
  9915. this._dataGroupProperties.itemRendererSkinName && (e.itemRendererSkinName = this.dataGroup.itemRendererSkinName);
  9916. this._dataGroupProperties.itemRendererFunction && (e.itemRendererFunction = this.dataGroup.itemRendererFunction);
  9917. this._dataGroupProperties = e;
  9918. this.dataGroup._rendererOwner = null;
  9919. this.dataGroup.dataProvider = null;
  9920. this.dataGroup.layout = null
  9921. }
  9922. };
  9923. a.prototype.addEventListener = function(b, a, e, k, f) {
  9924. "undefined" === typeof k && (k = !1);
  9925. "undefined" === typeof f && (f = 0);
  9926. d.prototype.addEventListener.call(this, b, a, e, k, f);
  9927. b == c.RendererExistenceEvent.RENDERER_ADD && this.dataGroup && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  9928. b == c.RendererExistenceEvent.RENDERER_REMOVE && this.dataGroup && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this)
  9929. };
  9930. a.prototype.removeEventListener = function(b, a, e, k) {
  9931. "undefined" === typeof k && (k = !1);
  9932. d.prototype.removeEventListener.call(this, b, a, e, k);
  9933. b == c.RendererExistenceEvent.RENDERER_ADD && this.dataGroup && (this.hasEventListener(c.RendererExistenceEvent.RENDERER_ADD) || this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this));
  9934. b == c.RendererExistenceEvent.RENDERER_REMOVE && this.dataGroup && (this.hasEventListener(c.RendererExistenceEvent.RENDERER_REMOVE) || this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this))
  9935. };
  9936. return a
  9937. } (c.SkinnableComponent);
  9938. c.SkinnableDataContainer = e
  9939. })(egret || (egret = {}));
  9940. __extends = this.__extends ||
  9941. function(c, e) {
  9942. function d() {
  9943. this.constructor = c
  9944. }
  9945. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9946. d.prototype = e.prototype;
  9947. c.prototype = new d
  9948. }; (function(c) {
  9949. var e = function(d) {
  9950. function a() {
  9951. d.call(this);
  9952. this._doingWholesaleChanges = !1;
  9953. this._labelField = "label";
  9954. this.requireSelectionChanged = this._requireSelection = !1;
  9955. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  9956. this._selectedIndex = a.NO_SELECTION;
  9957. this.selectedIndexAdjusted = this._useVirtualLayout = this._dispatchChangeAfterSelection = this._allowCustomSelectedItem = !1
  9958. }
  9959. __extends(a, d);
  9960. a.prototype._setDataProvider = function(b) {
  9961. this.dataProvider && this.dataProvider.removeEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.dataProvider_collectionChangeHandler, this);
  9962. this._doingWholesaleChanges = this.dataProviderChanged = !0;
  9963. b && b.addEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.dataProvider_collectionChangeHandler, this);
  9964. d.prototype._setDataProvider.call(this, b);
  9965. this.invalidateProperties()
  9966. };
  9967. Object.defineProperty(a.prototype, "layout", {
  9968. get: function() {
  9969. return this.dataGroup ? this.dataGroup.layout: this._dataGroupProperties.layout
  9970. },
  9971. set: function(b) {
  9972. b && this.useVirtualLayout && (b.useVirtualLayout = !0);
  9973. this._setLayout(b)
  9974. },
  9975. enumerable: !0,
  9976. configurable: !0
  9977. });
  9978. Object.defineProperty(a.prototype, "labelField", {
  9979. get: function() {
  9980. return this._labelField
  9981. },
  9982. set: function(b) {
  9983. this._setLabelField(b)
  9984. },
  9985. enumerable: !0,
  9986. configurable: !0
  9987. });
  9988. a.prototype._setLabelField = function(b) {
  9989. b != this._labelField && (this._labelField = b, this.labelFieldOrFunctionChanged = !0, this.invalidateProperties())
  9990. };
  9991. Object.defineProperty(a.prototype, "labelFunction", {
  9992. get: function() {
  9993. return this._labelFunction
  9994. },
  9995. set: function(b) {
  9996. this._setLabelFunction(b)
  9997. },
  9998. enumerable: !0,
  9999. configurable: !0
  10000. });
  10001. a.prototype._setLabelFunction = function(b) {
  10002. b != this._labelFunction && (this._labelFunction = b, this.labelFieldOrFunctionChanged = !0, this.invalidateProperties())
  10003. };
  10004. Object.defineProperty(a.prototype, "requireSelection", {
  10005. get: function() {
  10006. return this._requireSelection
  10007. },
  10008. set: function(b) {
  10009. this._setRequireSelection(b)
  10010. },
  10011. enumerable: !0,
  10012. configurable: !0
  10013. });
  10014. a.prototype._setRequireSelection = function(b) {
  10015. b != this._requireSelection && (this._requireSelection = b) && (this.requireSelectionChanged = !0, this.invalidateProperties())
  10016. };
  10017. Object.defineProperty(a.prototype, "selectedIndex", {
  10018. get: function() {
  10019. return this._getSelectedIndex()
  10020. },
  10021. set: function(b) {
  10022. this._setSelectedIndex(b, !1)
  10023. },
  10024. enumerable: !0,
  10025. configurable: !0
  10026. });
  10027. a.prototype._getSelectedIndex = function() {
  10028. return this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this._proposedSelectedIndex: this._selectedIndex
  10029. };
  10030. a.prototype._setSelectedIndex = function(b, a) {
  10031. "undefined" === typeof a && (a = !1);
  10032. b != this.selectedIndex && (a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a), this._proposedSelectedIndex = b, this.invalidateProperties())
  10033. };
  10034. Object.defineProperty(a.prototype, "selectedItem", {
  10035. get: function() {
  10036. return void 0 !== this._pendingSelectedItem ? this._pendingSelectedItem: this._allowCustomSelectedItem && this.selectedIndex == a.CUSTOM_SELECTED_ITEM ? this._selectedItem: this.selectedIndex == a.NO_SELECTION || null == this.dataProvider ? void 0 : this.dataProvider.length > this.selectedIndex ? this.dataProvider.getItemAt(this.selectedIndex) : void 0
  10037. },
  10038. set: function(b) {
  10039. this._setSelectedItem(b, !1)
  10040. },
  10041. enumerable: !0,
  10042. configurable: !0
  10043. });
  10044. a.prototype._setSelectedItem = function(b, a) {
  10045. "undefined" === typeof a && (a = !1);
  10046. this.selectedItem !== b && (a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a), this._pendingSelectedItem = b, this.invalidateProperties())
  10047. };
  10048. Object.defineProperty(a.prototype, "useVirtualLayout", {
  10049. get: function() {
  10050. return this._getUseVirtualLayout()
  10051. },
  10052. set: function(b) {
  10053. this._setUseVirtualLayout(b)
  10054. },
  10055. enumerable: !0,
  10056. configurable: !0
  10057. });
  10058. a.prototype._getUseVirtualLayout = function() {
  10059. return this.layout ? this.layout.useVirtualLayout: this._useVirtualLayout
  10060. };
  10061. a.prototype._setUseVirtualLayout = function(b) {
  10062. b != this.useVirtualLayout && (this._useVirtualLayout = b, this.layout && (this.layout.useVirtualLayout = b))
  10063. };
  10064. a.prototype.commitProperties = function() {
  10065. d.prototype.commitProperties.call(this);
  10066. this.dataProviderChanged && (this._doingWholesaleChanges = this.dataProviderChanged = !1, 0 <= this.selectedIndex && this.dataProvider && this.selectedIndex < this.dataProvider.length ? this.itemSelected(this.selectedIndex, !0) : this.requireSelection ? this._proposedSelectedIndex = 0 : this._setSelectedIndex( - 1, !1));
  10067. this.requireSelectionChanged && (this.requireSelectionChanged = !1, this.requireSelection && this.selectedIndex == a.NO_SELECTION && this.dataProvider && 0 < this.dataProvider.length && (this._proposedSelectedIndex = 0));
  10068. void 0 !== this._pendingSelectedItem && (this._proposedSelectedIndex = this.dataProvider ? this.dataProvider.getItemIndex(this._pendingSelectedItem) : a.NO_SELECTION, this._allowCustomSelectedItem && -1 == this._proposedSelectedIndex && (this._proposedSelectedIndex = a.CUSTOM_SELECTED_ITEM, this._selectedItem = this._pendingSelectedItem), this._pendingSelectedItem = void 0);
  10069. var b = !1;
  10070. this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION && (b = this.commitSelection());
  10071. this.selectedIndexAdjusted && (this.selectedIndexAdjusted = !1, b || c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10072. if (this.labelFieldOrFunctionChanged) {
  10073. if (null != this.dataGroup) if (this.layout && this.layout.useVirtualLayout) for (var e = this.dataGroup.getElementIndicesInView(), m = e.length, k = 0; k < m; k++) b = e[k],
  10074. this.updateRendererLabelProperty(b);
  10075. else for (e = this.dataGroup.numElements, b = 0; b < e; b++) this.updateRendererLabelProperty(b);
  10076. this.labelFieldOrFunctionChanged = !1
  10077. }
  10078. };
  10079. a.prototype.updateRendererLabelProperty = function(b) {
  10080. if (b = this.dataGroup.getElementAt(b)) b.label = this.itemToLabel(b.data)
  10081. };
  10082. a.prototype.partAdded = function(b, a) {
  10083. d.prototype.partAdded.call(this, b, a);
  10084. a == this.dataGroup && (this._useVirtualLayout && this.dataGroup.layout && (this.dataGroup.layout.useVirtualLayout = !0), this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dataGroup_rendererAddHandler, this), this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dataGroup_rendererRemoveHandler, this))
  10085. };
  10086. a.prototype.partRemoved = function(b, a) {
  10087. d.prototype.partRemoved.call(this, b, a);
  10088. a == this.dataGroup && (this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dataGroup_rendererAddHandler, this), this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dataGroup_rendererRemoveHandler, this))
  10089. };
  10090. a.prototype.updateRenderer = function(b, a, c) {
  10091. this.itemSelected(a, this._isItemIndexSelected(a));
  10092. return d.prototype.updateRenderer.call(this, b, a, c)
  10093. };
  10094. a.prototype.itemToLabel = function(b) {
  10095. if (null != this._labelFunction) return this._labelFunction(b);
  10096. if ("string" == typeof b) return b;
  10097. if (b instanceof c.XML) try {
  10098. 0 != b[this.labelField].length() && (b = b[this.labelField])
  10099. } catch(a) {} else if (b instanceof Object) try {
  10100. null != b[this.labelField] && (b = b[this.labelField])
  10101. } catch(d) {}
  10102. if ("string" == typeof b) return b;
  10103. try {
  10104. if (null !== b) return b.toString()
  10105. } catch(e) {}
  10106. return " "
  10107. };
  10108. a.prototype.itemSelected = function(b, a) {
  10109. if (this.dataGroup) {
  10110. var c = this.dataGroup.getElementAt(b);
  10111. null != c && (c.selected = a)
  10112. }
  10113. };
  10114. a.prototype._isItemIndexSelected = function(b) {
  10115. return b == this.selectedIndex
  10116. };
  10117. a.prototype.commitSelection = function(b) {
  10118. "undefined" === typeof b && (b = !0);
  10119. var d = this.dataProvider ? this.dataProvider.length - 1 : -1,
  10120. e = this._selectedIndex;
  10121. if (!this._allowCustomSelectedItem || this._proposedSelectedIndex != a.CUSTOM_SELECTED_ITEM) if (this._proposedSelectedIndex < a.NO_SELECTION && (this._proposedSelectedIndex = a.NO_SELECTION), this._proposedSelectedIndex > d && (this._proposedSelectedIndex = d), this.requireSelection && this._proposedSelectedIndex == a.NO_SELECTION && this.dataProvider && 0 < this.dataProvider.length) return this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION,
  10122. this._dispatchChangeAfterSelection = !1;
  10123. d = this._proposedSelectedIndex;
  10124. if (this._dispatchChangeAfterSelection && !c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGING, this._selectedIndex, this._proposedSelectedIndex, !0)) return this.itemSelected(this._proposedSelectedIndex, !1),
  10125. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION,
  10126. this._dispatchChangeAfterSelection = !1;
  10127. this._selectedIndex = d;
  10128. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  10129. e != a.NO_SELECTION && this.itemSelected(e, !1);
  10130. this._selectedIndex != a.NO_SELECTION && this.itemSelected(this._selectedIndex, !0);
  10131. b && (this._dispatchChangeAfterSelection && (c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGE, e, this._selectedIndex), this._dispatchChangeAfterSelection = !1), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10132. return ! 0
  10133. };
  10134. a.prototype.adjustSelection = function(b, c) {
  10135. this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this._proposedSelectedIndex = b: this._selectedIndex = b;
  10136. this.selectedIndexAdjusted = !0;
  10137. this.invalidateProperties()
  10138. };
  10139. a.prototype.itemAdded = function(b) {
  10140. this._doingWholesaleChanges || (this.selectedIndex == a.NO_SELECTION ? this.requireSelection && this.adjustSelection(b, !0) : b <= this.selectedIndex && this.adjustSelection(this.selectedIndex + 1, !0))
  10141. };
  10142. a.prototype.itemRemoved = function(b) {
  10143. this.selectedIndex == a.NO_SELECTION || this._doingWholesaleChanges || (b == this.selectedIndex ? this.requireSelection && this.dataProvider && 0 < this.dataProvider.length ? 0 == b ? (this._proposedSelectedIndex = 0, this.invalidateProperties()) : this._setSelectedIndex(0, !1) : this.adjustSelection( - 1, !1) : b < this.selectedIndex && this.adjustSelection(this.selectedIndex - 1, !1))
  10144. };
  10145. a.prototype.dataGroup_rendererAddHandler = function(b) {
  10146. b = b.renderer;
  10147. null != b && (b.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.item_mouseEventHandler, this), b.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.item_mouseEventHandler, this))
  10148. };
  10149. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  10150. b = b.renderer;
  10151. null != b && (b.removeEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.item_mouseEventHandler, this), b.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.item_mouseEventHandler, this))
  10152. };
  10153. a.prototype.item_mouseEventHandler = function(b) {
  10154. var c = b.type,
  10155. c = a.TYPE_MAP[c];
  10156. this.hasEventListener(c) && this._dispatchListEvent(b, c, b.currentTarget)
  10157. };
  10158. a.prototype._dispatchListEvent = function(b, a, d) {
  10159. var e = -1,
  10160. e = d ? d.itemIndex: this.dataGroup.getElementIndex(b.currentTarget),
  10161. f = this.dataProvider.getItemAt(e);
  10162. c.ListEvent.dispatchListEvent(this, a, b, e, f, d)
  10163. };
  10164. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  10165. var d = b.items;
  10166. if (b.kind == c.CollectionEventKind.ADD) for (var d = d.length,
  10167. e = 0; e < d; e++) this.itemAdded(b.location + e);
  10168. else if (b.kind == c.CollectionEventKind.REMOVE) for (d = d.length, e = d - 1; 0 <= e; e--) this.itemRemoved(b.location + e);
  10169. else b.kind == c.CollectionEventKind.MOVE ? (this.itemRemoved(b.oldLocation), this.itemAdded(b.location)) : b.kind == c.CollectionEventKind.RESET ? 0 == this.dataProvider.length ? this._setSelectedIndex(a.NO_SELECTION, !1) : (this.dataProviderChanged = !0, this.invalidateProperties()) : b.kind == c.CollectionEventKind.REFRESH && this._setSelectedIndex(a.NO_SELECTION, !1)
  10170. };
  10171. a.NO_SELECTION = -1;
  10172. a.NO_PROPOSED_SELECTION = -2;
  10173. a.CUSTOM_SELECTED_ITEM = -3;
  10174. a.TYPE_MAP = {
  10175. rollOver: "itemRollOver",
  10176. rollOut: "itemRollOut"
  10177. };
  10178. return a
  10179. } (c.SkinnableDataContainer);
  10180. c.ListBase = e
  10181. })(egret || (egret = {}));
  10182. __extends = this.__extends ||
  10183. function(c, e) {
  10184. function d() {
  10185. this.constructor = c
  10186. }
  10187. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10188. d.prototype = e.prototype;
  10189. c.prototype = new d
  10190. }; (function(c) {
  10191. var e = function(c) {
  10192. function a() {
  10193. c.call(this);
  10194. this._title = "";
  10195. this.hostComponentKey = "egret.Panel";
  10196. this.touchEnabled = !1
  10197. }
  10198. __extends(a, c);
  10199. Object.defineProperty(a.prototype, "title", {
  10200. get: function() {
  10201. return this._title
  10202. },
  10203. set: function(b) {
  10204. this._title = b;
  10205. this.titleDisplay && (this.titleDisplay.text = this.title)
  10206. },
  10207. enumerable: !0,
  10208. configurable: !0
  10209. });
  10210. a.prototype.partAdded = function(b, a) {
  10211. c.prototype.partAdded.call(this, b, a);
  10212. a == this.titleDisplay && (this.titleDisplay.text = this.title)
  10213. };
  10214. return a
  10215. } (c.SkinnableContainer);
  10216. c.Panel = e
  10217. })(egret || (egret = {}));
  10218. __extends = this.__extends ||
  10219. function(c, e) {
  10220. function d() {
  10221. this.constructor = c
  10222. }
  10223. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10224. d.prototype = e.prototype;
  10225. c.prototype = new d
  10226. }; (function(c) {
  10227. var e = function(d) {
  10228. function a() {
  10229. d.call(this);
  10230. this._autoBackToStage = this._showCloseButton = !0;
  10231. this.hostComponentKey = "egret.TitleWindow";
  10232. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onWindowMouseDown, this, !0, 100)
  10233. }
  10234. __extends(a, d);
  10235. a.prototype.onWindowMouseDown = function(b) {
  10236. this.enabled && this.isPopUp && b.target != this.closeButton && c.PopUpManager.bringToFront(this)
  10237. };
  10238. Object.defineProperty(a.prototype, "showCloseButton", {
  10239. get: function() {
  10240. return this._showCloseButton
  10241. },
  10242. set: function(b) {
  10243. this._showCloseButton != b && (this._showCloseButton = b, this.closeButton && (this.closeButton.visible = this._showCloseButton))
  10244. },
  10245. enumerable: !0,
  10246. configurable: !0
  10247. });
  10248. Object.defineProperty(a.prototype, "autoBackToStage", {
  10249. get: function() {
  10250. return this._autoBackToStage
  10251. },
  10252. set: function(b) {
  10253. this._autoBackToStage = b
  10254. },
  10255. enumerable: !0,
  10256. configurable: !0
  10257. });
  10258. a.prototype.partAdded = function(b, a) {
  10259. d.prototype.partAdded.call(this, b, a);
  10260. a == this.moveArea ? this.moveArea.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.moveArea_mouseDownHandler, this) : a == this.closeButton && (this.closeButton.addEventListener(c.TouchEvent.TOUCH_TAP, this.closeButton_clickHandler, this), this.closeButton.visible = this._showCloseButton)
  10261. };
  10262. a.prototype.partRemoved = function(b, a) {
  10263. d.prototype.partRemoved.call(this, b, a);
  10264. a == this.moveArea ? this.moveArea.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.moveArea_mouseDownHandler, this) : a == this.closeButton && this.closeButton.removeEventListener(c.TouchEvent.TOUCH_TAP, this.closeButton_clickHandler, this)
  10265. };
  10266. a.prototype.closeButton_clickHandler = function(b) {
  10267. c.CloseEvent.dispatchCloseEvent(this, c.CloseEvent.CLOSE)
  10268. };
  10269. a.prototype.moveArea_mouseDownHandler = function(b) {
  10270. this.enabled && this.isPopUp && (b = this.globalToLocal(b.stageX, b.stageY, c.Point.identity), this._offsetPointX = b.x, this._offsetPointY = b.y, this._includeInLayout = !1, c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.moveArea_mouseMoveHandler, this), c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.moveArea_mouseUpHandler, this), c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.moveArea_mouseUpHandler, this))
  10271. };
  10272. a.prototype.moveArea_mouseMoveHandler = function(b) {
  10273. b = this.globalToLocal(b.stageX, b.stageY, c.Point.identity);
  10274. this.x += b.x - this._offsetPointX;
  10275. this.y += b.y - this._offsetPointY
  10276. };
  10277. a.prototype.moveArea_mouseUpHandler = function(b) {
  10278. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.moveArea_mouseMoveHandler, this);
  10279. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.moveArea_mouseUpHandler, this);
  10280. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.moveArea_mouseUpHandler, this);
  10281. this._autoBackToStage && this.adjustPosForStage();
  10282. c.LayoutUtil.adjustRelativeByXY(this);
  10283. this.includeInLayout = !0
  10284. };
  10285. a.prototype.adjustPosForStage = function() {
  10286. if (this.moveArea && this.stage) {
  10287. var b = this.moveArea.localToGlobal(0, 0),
  10288. a = b.x,
  10289. c = b.y;
  10290. 35 > b.x + this.moveArea.width && (a = 35 - this.moveArea.width);
  10291. b.x > this.stage.stageWidth - 20 && (a = this.stage.stageWidth - 20);
  10292. 20 > b.y + this.moveArea.height && (c = 20 - this.moveArea.height);
  10293. b.y > this.stage.stageHeight - 20 && (c = this.stage.stageHeight - 20);
  10294. this.x += a - b.x;
  10295. this.y += c - b.y
  10296. }
  10297. };
  10298. return a
  10299. } (c.Panel);
  10300. c.TitleWindow = e
  10301. })(egret || (egret = {}));
  10302. __extends = this.__extends ||
  10303. function(c, e) {
  10304. function d() {
  10305. this.constructor = c
  10306. }
  10307. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10308. d.prototype = e.prototype;
  10309. c.prototype = new d
  10310. }; (function(c) {
  10311. var e = function(d) {
  10312. function a() {
  10313. d.call(this);
  10314. this._contentText = this._secondButtonLabel = this._firstButtonLabel = "";
  10315. this.hostComponentKey = "egret.Alert"
  10316. }
  10317. __extends(a, d);
  10318. a.show = function(b, d, e, k, f, g, l) {
  10319. "undefined" === typeof b && (b = "");
  10320. "undefined" === typeof d && (d = "");
  10321. "undefined" === typeof e && (e = null);
  10322. "undefined" === typeof k && (k = "\u786e\u5b9a");
  10323. "undefined" === typeof f && (f = "");
  10324. "undefined" === typeof g && (g = !0);
  10325. "undefined" === typeof l && (l = !0);
  10326. var n = new a;
  10327. n.contentText = b;
  10328. n.title = d;
  10329. n._firstButtonLabel = k;
  10330. n._secondButtonLabel = f;
  10331. n.closeHandler = e;
  10332. c.PopUpManager.addPopUp(n, g, l);
  10333. return n
  10334. };
  10335. Object.defineProperty(a.prototype, "firstButtonLabel", {
  10336. get: function() {
  10337. return this._firstButtonLabel
  10338. },
  10339. set: function(b) {
  10340. this._firstButtonLabel != b && (this._firstButtonLabel = b, this.firstButton && (this.firstButton.label = b))
  10341. },
  10342. enumerable: !0,
  10343. configurable: !0
  10344. });
  10345. Object.defineProperty(a.prototype, "secondButtonLabel", {
  10346. get: function() {
  10347. return this._secondButtonLabel
  10348. },
  10349. set: function(b) {
  10350. this._secondButtonLabel != b && (this._secondButtonLabel = b, !this.secondButton || null != b && "" != b || (this.secondButton.includeInLayout = this.secondButton.visible = "" != this._secondButtonLabel && null != this._secondButtonLabel))
  10351. },
  10352. enumerable: !0,
  10353. configurable: !0
  10354. });
  10355. Object.defineProperty(a.prototype, "contentText", {
  10356. get: function() {
  10357. return this._contentText
  10358. },
  10359. set: function(b) {
  10360. this._contentText != b && (this._contentText = b, this.contentDisplay && (this.contentDisplay.text = b))
  10361. },
  10362. enumerable: !0,
  10363. configurable: !0
  10364. });
  10365. a.prototype.onClose = function(b) {
  10366. c.PopUpManager.removePopUp(this);
  10367. if (null != this.closeHandler) {
  10368. var d = new c.CloseEvent(c.CloseEvent.CLOSE);
  10369. switch (b.currentTarget) {
  10370. case this.firstButton:
  10371. d.detail = a.FIRST_BUTTON;
  10372. break;
  10373. case this.secondButton:
  10374. d.detail = a.SECOND_BUTTON
  10375. }
  10376. this.closeHandler(d)
  10377. }
  10378. };
  10379. a.prototype.closeButton_clickHandler = function(b) {
  10380. d.prototype.closeButton_clickHandler.call(this, b);
  10381. c.PopUpManager.removePopUp(this);
  10382. b = new c.CloseEvent(c.CloseEvent.CLOSE, !1, !1, a.CLOSE_BUTTON);
  10383. null != this.closeHandler && this.closeHandler(b)
  10384. };
  10385. a.prototype.partAdded = function(b, a) {
  10386. d.prototype.partAdded.call(this, b, a);
  10387. a == this.contentDisplay ? this.contentDisplay.text = this._contentText: a == this.firstButton ? (this.firstButton.label = this._firstButtonLabel, this.firstButton.addEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this)) : a == this.secondButton && (this.secondButton.label = this._secondButtonLabel, this.secondButton.includeInLayout = this.secondButton.visible = "" != this._secondButtonLabel && null != this._secondButtonLabel, this.secondButton.addEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this))
  10388. };
  10389. a.prototype.partRemoved = function(b, a) {
  10390. d.prototype.partRemoved.call(this, b, a);
  10391. a == this.firstButton ? this.firstButton.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this) : a == this.secondButton && this.secondButton.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this)
  10392. };
  10393. a.FIRST_BUTTON = "firstButton";
  10394. a.SECOND_BUTTON = "secondButton";
  10395. a.CLOSE_BUTTON = "closeButton";
  10396. return a
  10397. } (c.TitleWindow);
  10398. c.Alert = e
  10399. })(egret || (egret = {}));
  10400. __extends = this.__extends ||
  10401. function(c, e) {
  10402. function d() {
  10403. this.constructor = c
  10404. }
  10405. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10406. d.prototype = e.prototype;
  10407. c.prototype = new d
  10408. }; (function(c) {
  10409. var e = function(d) {
  10410. function a() {
  10411. d.call(this);
  10412. this._slideDuration = 500;
  10413. this._direction = c.ProgressBarDirection.LEFT_TO_RIGHT;
  10414. this.animationValue = 0;
  10415. this.trackResizedOrMoved = !1;
  10416. this.hostComponentKey = "egret.ProgressBar"
  10417. }
  10418. __extends(a, d);
  10419. Object.defineProperty(a.prototype, "labelFunction", {
  10420. get: function() {
  10421. return this._labelFunction
  10422. },
  10423. set: function(b) {
  10424. this._labelFunction != b && (this._labelFunction = b, this.invalidateDisplayList())
  10425. },
  10426. enumerable: !0,
  10427. configurable: !0
  10428. });
  10429. a.prototype.valueToLabel = function(b, a) {
  10430. return null != this.labelFunction ? this._labelFunction(b, a) : b + " / " + a
  10431. };
  10432. Object.defineProperty(a.prototype, "slideDuration", {
  10433. get: function() {
  10434. return this._slideDuration
  10435. },
  10436. set: function(b) {
  10437. this._slideDuration != b && (this._slideDuration = b, this.animator && this.animator.isPlaying && (this.animator.stop(), this._setValue(this.slideToValue)))
  10438. },
  10439. enumerable: !0,
  10440. configurable: !0
  10441. });
  10442. Object.defineProperty(a.prototype, "direction", {
  10443. get: function() {
  10444. return this._direction
  10445. },
  10446. set: function(b) {
  10447. this._direction != b && (this._direction = b, this.invalidateDisplayList())
  10448. },
  10449. enumerable: !0,
  10450. configurable: !0
  10451. });
  10452. Object.defineProperty(a.prototype, "value", {
  10453. get: function() {
  10454. return this._getValue()
  10455. },
  10456. set: function(b) {
  10457. this._getValue() != b && (this._setValue(b), 0 < this._slideDuration && this.stage ? (this.validateProperties(), this.animator || (this.animator = new c.Animation(this.animationUpdateHandler, this)), this.animator.isPlaying && (this.animationValue = this.slideToValue, this.invalidateDisplayList(), this.animator.stop()), this.slideToValue = this.nearestValidValue(b, this.snapInterval), this.slideToValue != this.animationValue && (b = this._slideDuration * (Math.abs(this.animationValue - this.slideToValue) / (this.maximum - this.minimum)), this.animator.duration = Infinity === b ? 0 : b, this.animator.motionPaths = [{
  10458. prop: "value",
  10459. from: this.animationValue,
  10460. to: this.slideToValue
  10461. }], this.animator.play())) : this.animationValue = this._getValue())
  10462. },
  10463. enumerable: !0,
  10464. configurable: !0
  10465. });
  10466. a.prototype.animationUpdateHandler = function(b) {
  10467. b = this.nearestValidValue(b.currentValue.value, this.snapInterval);
  10468. this.animationValue = Math.min(this.maximum, Math.max(this.minimum, b));
  10469. this.invalidateDisplayList()
  10470. };
  10471. a.prototype.setValue = function(b) {
  10472. d.prototype.setValue.call(this, b);
  10473. this.invalidateDisplayList()
  10474. };
  10475. a.prototype.updateDisplayList = function(b, a) {
  10476. d.prototype.updateDisplayList.call(this, b, a);
  10477. this.updateSkinDisplayList()
  10478. };
  10479. a.prototype.partAdded = function(b, a) {
  10480. a == this.track && this.track instanceof c.UIComponent && (this.track.addEventListener(c.ResizeEvent.RESIZE, this.onTrackResizeOrMove, this), this.track.addEventListener(c.MoveEvent.MOVE, this.onTrackResizeOrMove, this))
  10481. };
  10482. a.prototype.partRemoved = function(b, a) {
  10483. a == this.track && this.track instanceof c.UIComponent && (this.track.removeEventListener(c.ResizeEvent.RESIZE, this.onTrackResizeOrMove, this), this.track.removeEventListener(c.MoveEvent.MOVE, this.onTrackResizeOrMove, this))
  10484. };
  10485. a.prototype.onTrackResizeOrMove = function(b) {
  10486. this.trackResizedOrMoved = !0;
  10487. this.invalidateProperties()
  10488. };
  10489. a.prototype.commitProperties = function() {
  10490. d.prototype.commitProperties.call(this);
  10491. this.trackResizedOrMoved && (this.trackResizedOrMoved = !1, this.updateSkinDisplayList())
  10492. };
  10493. a.prototype.updateSkinDisplayList = function() {
  10494. this.trackResizedOrMoved = !1;
  10495. var b = this.value;
  10496. this.animator && this.animator.isPlaying ? b = this.animationValue: (b = this.value, isNaN(b) && (b = 0));
  10497. var a = isNaN(this.maximum) ? 0 : this.maximum;
  10498. if (this.thumb && this.track) {
  10499. var d = isNaN(this.track.width) ? 0 : this.track.width,
  10500. d = d * this.track.scaleX,
  10501. e = isNaN(this.track.height) ? 0 : this.track.height,
  10502. e = e * this.track.scaleY,
  10503. f = Math.round(b / a * d);
  10504. if (isNaN(f) || 0 > f || Infinity === f) f = 0;
  10505. var g = Math.round(b / a * e);
  10506. if (isNaN(g) || 0 > g || Infinity === g) g = 0;
  10507. var l = this.track.localToGlobal(0, 0),
  10508. n = this.globalToLocal(l.x, l.y, c.Point.identity),
  10509. l = n.x,
  10510. n = n.y;
  10511. switch (this._direction) {
  10512. case c.ProgressBarDirection.LEFT_TO_RIGHT:
  10513. this.thumb.width = f;
  10514. this.thumb.height = e;
  10515. this.thumb.x = l;
  10516. break;
  10517. case c.ProgressBarDirection.RIGHT_TO_LEFT:
  10518. this.thumb.width = f;
  10519. this.thumb.height = e;
  10520. this.thumb.x = l + d - f;
  10521. break;
  10522. case c.ProgressBarDirection.TOP_TO_BOTTOM:
  10523. this.thumb.width = d;
  10524. this.thumb.height = g;
  10525. this.thumb.y = n;
  10526. break;
  10527. case c.ProgressBarDirection.BOTTOM_TO_TOP:
  10528. this.thumb.width = d,
  10529. this.thumb.height = g,
  10530. this.thumb.y = n + e - g
  10531. }
  10532. }
  10533. this.labelDisplay && (this.labelDisplay.text = this.valueToLabel(b, a))
  10534. };
  10535. return a
  10536. } (c.Range);
  10537. c.ProgressBar = e
  10538. })(egret || (egret = {})); (function(c) {
  10539. var e = function() {
  10540. function c() {}
  10541. c.LEFT_TO_RIGHT = "leftToRight";
  10542. c.RIGHT_TO_LEFT = "rightToLeft";
  10543. c.TOP_TO_BOTTOM = "topToBottom";
  10544. c.BOTTOM_TO_TOP = "bottomToTop";
  10545. return c
  10546. } ();
  10547. c.ProgressBarDirection = e
  10548. })(egret || (egret = {}));
  10549. __extends = this.__extends ||
  10550. function(c, e) {
  10551. function d() {
  10552. this.constructor = c
  10553. }
  10554. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10555. d.prototype = e.prototype;
  10556. c.prototype = new d
  10557. }; (function(c) {
  10558. var e = function(d) {
  10559. function a() {
  10560. d.call(this);
  10561. this.hostComponentKey = "egret.HSlider"
  10562. }
  10563. __extends(a, d);
  10564. a.prototype.pointToValue = function(b, a) {
  10565. if (!this.thumb || !this.track) return 0;
  10566. var c = this.maximum - this.minimum,
  10567. d = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth;
  10568. return this.minimum + (0 != d ? b / d * c: 0)
  10569. };
  10570. a.prototype.updateSkinDisplayList = function() {
  10571. if (this.thumb && this.track) {
  10572. var b = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth,
  10573. a = this.maximum - this.minimum,
  10574. b = 0 < a ? (this.pendingValue - this.minimum) / a * b: 0,
  10575. d = this.track.localToGlobal(b, 0),
  10576. a = d.x,
  10577. d = d.y,
  10578. e = this.thumb.parent.globalToLocal(a, d, c.Point.identity).x;
  10579. this.thumb.setLayoutBoundsPosition(Math.round(e), this.thumb.layoutBoundsY);
  10580. this.showTrackHighlight && this.trackHighlight && this.trackHighlight.parent && (a = this.trackHighlight.parent.globalToLocal(a, d, c.Point.identity).x - b, this.trackHighlight.x = Math.round(a), this.trackHighlight.width = Math.round(b))
  10581. }
  10582. };
  10583. return a
  10584. } (c.SliderBase);
  10585. c.HSlider = e
  10586. })(egret || (egret = {}));
  10587. __extends = this.__extends ||
  10588. function(c, e) {
  10589. function d() {
  10590. this.constructor = c
  10591. }
  10592. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10593. d.prototype = e.prototype;
  10594. c.prototype = new d
  10595. }; (function(c) {
  10596. var e = function(d) {
  10597. function a() {
  10598. d.call(this);
  10599. this.hostComponentKey = "egret.VSlider"
  10600. }
  10601. __extends(a, d);
  10602. a.prototype.pointToValue = function(b, a) {
  10603. if (!this.thumb || !this.track) return 0;
  10604. var c = this.maximum - this.minimum,
  10605. d = this.track.layoutBoundsHeight - this.thumb.layoutBoundsHeight;
  10606. return this.minimum + (0 != d ? (d - a) / d * c: 0)
  10607. };
  10608. a.prototype.updateSkinDisplayList = function() {
  10609. if (this.thumb && this.track) {
  10610. var b = this.thumb.layoutBoundsHeight,
  10611. a = this.track.layoutBoundsHeight - b,
  10612. d = this.maximum - this.minimum,
  10613. e = this.track.localToGlobal(0, 0 < d ? a - (this.pendingValue - this.minimum) / d * a: 0),
  10614. d = e.x,
  10615. e = e.y,
  10616. f = this.thumb.parent.globalToLocal(d, e, c.Point.identity).y;
  10617. this.thumb.setLayoutBoundsPosition(this.thumb.layoutBoundsX, Math.round(f));
  10618. this.showTrackHighlight && this.trackHighlight && this.trackHighlight._parent && (d = this.trackHighlight._parent.globalToLocal(d, e, c.Point.identity).y, this.trackHighlight.y = Math.round(d + b), this.trackHighlight.height = Math.round(a - d))
  10619. }
  10620. };
  10621. return a
  10622. } (c.SliderBase);
  10623. c.VSlider = e
  10624. })(egret || (egret = {}));
  10625. __extends = this.__extends ||
  10626. function(c, e) {
  10627. function d() {
  10628. this.constructor = c
  10629. }
  10630. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10631. d.prototype = e.prototype;
  10632. c.prototype = new d
  10633. }; (function(c) {
  10634. var e = function(d) {
  10635. function a() {
  10636. d.call(this);
  10637. this._allowMultipleSelection = !1;
  10638. this._selectedIndices = [];
  10639. this._captureItemRenderer = !0;
  10640. this.hostComponentKey = "egret.List";
  10641. this.useVirtualLayout = !0
  10642. }
  10643. __extends(a, d);
  10644. a.prototype.createChildren = function() {
  10645. this.itemRenderer || (this.itemRenderer = c.DataGroup.defaultRendererFactory);
  10646. d.prototype.createChildren.call(this)
  10647. };
  10648. Object.defineProperty(a.prototype, "useVirtualLayout", {
  10649. get: function() {
  10650. return this._getUseVirtualLayout()
  10651. },
  10652. set: function(b) {
  10653. this._setUseVirtualLayout(b)
  10654. },
  10655. enumerable: !0,
  10656. configurable: !0
  10657. });
  10658. Object.defineProperty(a.prototype, "allowMultipleSelection", {
  10659. get: function() {
  10660. return this._allowMultipleSelection
  10661. },
  10662. set: function(b) {
  10663. this._allowMultipleSelection = b
  10664. },
  10665. enumerable: !0,
  10666. configurable: !0
  10667. });
  10668. Object.defineProperty(a.prototype, "selectedIndices", {
  10669. get: function() {
  10670. return this._proposedSelectedIndices ? this._proposedSelectedIndices: this._selectedIndices
  10671. },
  10672. set: function(b) {
  10673. this._setSelectedIndices(b, !1)
  10674. },
  10675. enumerable: !0,
  10676. configurable: !0
  10677. });
  10678. Object.defineProperty(a.prototype, "selectedIndex", {
  10679. get: function() {
  10680. return this._proposedSelectedIndices ? 0 < this._proposedSelectedIndices.length ? this._proposedSelectedIndices[0] : -1 : this._getSelectedIndex()
  10681. },
  10682. set: function(b) {
  10683. this._setSelectedIndex(b)
  10684. },
  10685. enumerable: !0,
  10686. configurable: !0
  10687. });
  10688. Object.defineProperty(a.prototype, "selectedItems", {
  10689. get: function() {
  10690. var b = [],
  10691. a = this.selectedIndices;
  10692. if (a) for (var c = a.length,
  10693. d = 0; d < c; d++) b[d] = this.dataProvider.getItemAt(a[d]);
  10694. return b
  10695. },
  10696. set: function(b) {
  10697. var a = [];
  10698. if (b) for (var c = b.length,
  10699. d = 0; d < c; d++) {
  10700. var e = this.dataProvider.getItemIndex(b[d]); - 1 != e && a.splice(0, 0, e);
  10701. if ( - 1 == e) {
  10702. a = [];
  10703. break
  10704. }
  10705. }
  10706. this._setSelectedIndices(a, !1)
  10707. },
  10708. enumerable: !0,
  10709. configurable: !0
  10710. });
  10711. a.prototype._setSelectedIndices = function(b, a) {
  10712. "undefined" === typeof a && (a = !1);
  10713. a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a);
  10714. this._proposedSelectedIndices = b ? b: [];
  10715. this.invalidateProperties()
  10716. };
  10717. a.prototype.commitProperties = function() {
  10718. d.prototype.commitProperties.call(this);
  10719. this._proposedSelectedIndices && this.commitSelection()
  10720. };
  10721. a.prototype.commitSelection = function(b) {
  10722. "undefined" === typeof b && (b = !0);
  10723. var a = this._selectedIndex;
  10724. if (this._proposedSelectedIndices) {
  10725. this._proposedSelectedIndices = this._proposedSelectedIndices.filter(this.isValidIndex);
  10726. if (!this.allowMultipleSelection && 0 < this._proposedSelectedIndices.length) {
  10727. var e = [];
  10728. e.push(this._proposedSelectedIndices[0]);
  10729. this._proposedSelectedIndices = e
  10730. }
  10731. this._proposedSelectedIndex = 0 < this._proposedSelectedIndices.length ? this._proposedSelectedIndices[0] : -1
  10732. }
  10733. e = d.prototype.commitSelection.call(this, !1);
  10734. if (!e) return this._proposedSelectedIndices = null,
  10735. !1;
  10736. this.selectedIndex > c.ListBase.NO_SELECTION && (this._proposedSelectedIndices ? -1 == this._proposedSelectedIndices.indexOf(this.selectedIndex) && this._proposedSelectedIndices.push(this.selectedIndex) : this._proposedSelectedIndices = [this.selectedIndex]);
  10737. this._proposedSelectedIndices && ( - 1 != this._proposedSelectedIndices.indexOf(a) && this.itemSelected(a, !0), this.commitMultipleSelection());
  10738. b && e && (this._dispatchChangeAfterSelection && (c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGE, a, this._selectedIndex), this._dispatchChangeAfterSelection = !1), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10739. return e
  10740. };
  10741. a.prototype.isValidIndex = function(b, a, c) {
  10742. return this.dataProvider && 0 <= b && b < this.dataProvider.length
  10743. };
  10744. a.prototype.commitMultipleSelection = function() {
  10745. var b = [],
  10746. a = [],
  10747. c,
  10748. d;
  10749. if (0 < this._selectedIndices.length && 0 < this._proposedSelectedIndices.length) {
  10750. d = this._proposedSelectedIndices.length;
  10751. for (c = 0; c < d; c++) - 1 == this._selectedIndices.indexOf(this._proposedSelectedIndices[c]) && a.push(this._proposedSelectedIndices[c]);
  10752. d = this._selectedIndices.length;
  10753. for (c = 0; c < d; c++) - 1 == this._proposedSelectedIndices.indexOf(this._selectedIndices[c]) && b.push(this._selectedIndices[c])
  10754. } else 0 < this._selectedIndices.length ? b = this._selectedIndices: 0 < this._proposedSelectedIndices.length && (a = this._proposedSelectedIndices);
  10755. this._selectedIndices = this._proposedSelectedIndices;
  10756. if (0 < b.length) for (d = b.length, c = 0; c < d; c++) this.itemSelected(b[c], !1);
  10757. if (0 < a.length) for (d = a.length, c = 0; c < d; c++) this.itemSelected(a[c], !0);
  10758. this._proposedSelectedIndices = null
  10759. };
  10760. a.prototype._isItemIndexSelected = function(b) {
  10761. return this._allowMultipleSelection ? -1 != this._selectedIndices.indexOf(b) : d.prototype._isItemIndexSelected.call(this, b)
  10762. };
  10763. a.prototype.dataGroup_rendererAddHandler = function(b) {
  10764. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  10765. b = b.renderer;
  10766. null != b && (b.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.item_mouseDownHandler, this), b.addEventListener(c.TouchEvent.TOUCH_END, this.item_mouseUpHandler, this))
  10767. };
  10768. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  10769. d.prototype.dataGroup_rendererRemoveHandler.call(this, b);
  10770. b = b.renderer;
  10771. null != b && (b.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.item_mouseDownHandler, this), b.removeEventListener(c.TouchEvent.TOUCH_END, this.item_mouseUpHandler, this))
  10772. };
  10773. a.prototype.item_mouseDownHandler = function(b) {
  10774. if (!b.isDefaultPrevented()) {
  10775. var a = b.currentTarget,
  10776. d;
  10777. d = a ? a.itemIndex: this.dataGroup.getElementIndex(b.currentTarget);
  10778. this._allowMultipleSelection ? this._setSelectedIndices(this.calculateSelectedIndices(d, b.shiftKey, b.ctrlKey), !0) : this._setSelectedIndex(d, !0);
  10779. this._captureItemRenderer && (this.mouseDownItemRenderer = a, c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this))
  10780. }
  10781. };
  10782. a.prototype.calculateSelectedIndices = function(b, a, c) {
  10783. var d = [];
  10784. if (a) if (a = 0 < this._selectedIndices.length ? this._selectedIndices[this._selectedIndices.length - 1] : 0, a < b) for (; a <= b; a++) d.splice(0, 0, a);
  10785. else for (; a >= b; a--) d.splice(0, 0, a);
  10786. else if (c) if (0 < this._selectedIndices.length) if (1 == this._selectedIndices.length && this._selectedIndices[0] == b) {
  10787. if (!this.requireSelection) return d;
  10788. d.splice(0, 0, this._selectedIndices[0])
  10789. } else {
  10790. c = !1;
  10791. for (a = 0; a < this._selectedIndices.length; a++) this._selectedIndices[a] == b ? c = !0 : this._selectedIndices[a] != b && d.splice(0, 0, this._selectedIndices[a]);
  10792. c || d.splice(0, 0, b)
  10793. } else d.splice(0, 0, b);
  10794. else d.splice(0, 0, b);
  10795. return d
  10796. };
  10797. a.prototype.item_mouseUpHandler = function(b) {
  10798. var a = b.currentTarget;
  10799. a == this.mouseDownItemRenderer && this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, a)
  10800. };
  10801. a.prototype.stage_mouseUpHandler = function(b) {
  10802. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  10803. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  10804. this.mouseDownItemRenderer = null
  10805. };
  10806. return a
  10807. } (c.ListBase);
  10808. c.List = e
  10809. })(egret || (egret = {}));
  10810. __extends = this.__extends ||
  10811. function(c, e) {
  10812. function d() {
  10813. this.constructor = c
  10814. }
  10815. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10816. d.prototype = e.prototype;
  10817. c.prototype = new d
  10818. }; (function(c) {
  10819. var e = function(d) {
  10820. function a() {
  10821. d.call(this);
  10822. this._displayPopUp = this._popUpWidthMatchesAnchorWidth = this._popUpHeightMatchesAnchorHeight = this.addedToStage = this.popUpIsDisplayed = !1;
  10823. this._popUpPosition = c.PopUpPosition.TOP_LEFT;
  10824. this.inAnimation = !1;
  10825. this.animator = null;
  10826. this._openDuration = 250;
  10827. this._closeDuration = 150;
  10828. this.valueRange = 1;
  10829. this.addEventListener(c.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  10830. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.removedFromStageHandler, this)
  10831. }
  10832. __extends(a, d);
  10833. Object.defineProperty(a.prototype, "popUpHeightMatchesAnchorHeight", {
  10834. get: function() {
  10835. return this._popUpHeightMatchesAnchorHeight
  10836. },
  10837. set: function(b) {
  10838. this._popUpHeightMatchesAnchorHeight != b && (this._popUpHeightMatchesAnchorHeight = b, this.invalidateDisplayList())
  10839. },
  10840. enumerable: !0,
  10841. configurable: !0
  10842. });
  10843. Object.defineProperty(a.prototype, "popUpWidthMatchesAnchorWidth", {
  10844. get: function() {
  10845. return this._popUpWidthMatchesAnchorWidth
  10846. },
  10847. set: function(b) {
  10848. this._popUpWidthMatchesAnchorWidth != b && (this._popUpWidthMatchesAnchorWidth = b, this.invalidateDisplayList())
  10849. },
  10850. enumerable: !0,
  10851. configurable: !0
  10852. });
  10853. Object.defineProperty(a.prototype, "displayPopUp", {
  10854. get: function() {
  10855. return this._displayPopUp
  10856. },
  10857. set: function(b) {
  10858. this._displayPopUp != b && (this._displayPopUp = b, this.addOrRemovePopUp())
  10859. },
  10860. enumerable: !0,
  10861. configurable: !0
  10862. });
  10863. Object.defineProperty(a.prototype, "popUp", {
  10864. get: function() {
  10865. return this._popUp
  10866. },
  10867. set: function(b) {
  10868. this._popUp != b && (this._popUp = b, this.dispatchEventWith("popUpChanged"))
  10869. },
  10870. enumerable: !0,
  10871. configurable: !0
  10872. });
  10873. Object.defineProperty(a.prototype, "popUpPosition", {
  10874. get: function() {
  10875. return this._popUpPosition
  10876. },
  10877. set: function(b) {
  10878. this._popUpPosition != b && (this._popUpPosition = b, this.invalidateDisplayList())
  10879. },
  10880. enumerable: !0,
  10881. configurable: !0
  10882. });
  10883. a.prototype.updateDisplayList = function(b, a) {
  10884. d.prototype.updateDisplayList.call(this, b, a);
  10885. this.applyPopUpTransform(b, a)
  10886. };
  10887. a.prototype.updatePopUpTransform = function() {
  10888. this.applyPopUpTransform(this.width, this.height)
  10889. };
  10890. a.prototype.calculatePopUpPosition = function() {
  10891. var b = c.Point.identity;
  10892. switch (this._popUpPosition) {
  10893. case c.PopUpPosition.BELOW:
  10894. b.x = 0;
  10895. b.y = this.height;
  10896. break;
  10897. case c.PopUpPosition.ABOVE:
  10898. b.x = 0;
  10899. b.y = -this.popUp.layoutBoundsHeight;
  10900. break;
  10901. case c.PopUpPosition.LEFT:
  10902. b.x = -this.popUp.layoutBoundsWidth;
  10903. b.y = 0;
  10904. break;
  10905. case c.PopUpPosition.RIGHT:
  10906. b.x = this.width;
  10907. b.y = 0;
  10908. break;
  10909. case c.PopUpPosition.CENTER:
  10910. b.x = 0.5 * (this.width - this.popUp.layoutBoundsWidth),
  10911. b.y = 0.5 * (this.height - this.popUp.layoutBoundsHeight)
  10912. }
  10913. b = this.localToGlobal(b.x, b.y, b);
  10914. return b = this.popUp.parent.globalToLocal(b.x, b.y, b)
  10915. };
  10916. Object.defineProperty(a.prototype, "openDuration", {
  10917. get: function() {
  10918. return this._openDuration
  10919. },
  10920. set: function(b) {
  10921. this._openDuration = b
  10922. },
  10923. enumerable: !0,
  10924. configurable: !0
  10925. });
  10926. Object.defineProperty(a.prototype, "closeDuration", {
  10927. get: function() {
  10928. return this._closeDuration
  10929. },
  10930. set: function(b) {
  10931. this._closeDuration = b
  10932. },
  10933. enumerable: !0,
  10934. configurable: !0
  10935. });
  10936. a.prototype.animationStartHandler = function(b) {
  10937. this.inAnimation = !0;
  10938. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !1)
  10939. };
  10940. a.prototype.animationUpdateHandler = function(b) {
  10941. var a = this.popUp._scrollRect,
  10942. d = Math.round(b.currentValue.x);
  10943. b = Math.round(b.currentValue.y);
  10944. a ? (a.x = d, a.y = b, a.width = this.popUp.width, a.height = this.popUp.height) : this.popUp._scrollRect = new c.Rectangle(d, b, this.popUp.width, this.popUp.height)
  10945. };
  10946. a.prototype.animationEndHandler = function(b) {
  10947. this.inAnimation = !1;
  10948. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !0);
  10949. this.popUp.scrollRect = null;
  10950. this.popUpIsDisplayed || (c.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  10951. };
  10952. a.prototype.addOrRemovePopUp = function() {
  10953. this.addedToStage && this.popUp && (null == this.popUp.parent && this.displayPopUp ? (c.PopUpManager.addPopUp(this.popUp, !1, !1), this.popUp.ownerChanged(this), this.popUpIsDisplayed = !0, this.inAnimation && this.animator.end(), this.initialized ? (this.applyPopUpTransform(this.width, this.height), 0 < this._openDuration && this.startAnimation()) : c.callLater(function() {
  10954. 0 < this.openDuration && this.startAnimation()
  10955. },
  10956. this)) : null == this.popUp.parent || this.displayPopUp || this.removeAndResetPopUp())
  10957. };
  10958. a.prototype.removeAndResetPopUp = function() {
  10959. this.inAnimation && this.animator.end();
  10960. this.popUpIsDisplayed = !1;
  10961. 0 < this._closeDuration ? this.startAnimation() : (c.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  10962. };
  10963. a.prototype.applyPopUpTransform = function(b, a) {
  10964. if (this.popUpIsDisplayed) {
  10965. this.popUpWidthMatchesAnchorWidth && (this.popUp.width = b);
  10966. this.popUpHeightMatchesAnchorHeight && (this.popUp.height = a);
  10967. "validateNow" in this.popUp && this.popUp.validateNow();
  10968. var c = this.calculatePopUpPosition();
  10969. this.popUp.x = c.x;
  10970. this.popUp.y = c.y
  10971. }
  10972. };
  10973. a.prototype.startAnimation = function() {
  10974. this.animator || (this.animator = new c.Animation(this.animationUpdateHandler, this), this.animator.endFunction = this.animationEndHandler, this.animator.startFunction = this.animationStartHandler);
  10975. this.animator.motionPaths = this.createMotionPath();
  10976. this.animator.duration = this.popUpIsDisplayed ? this._openDuration: this._closeDuration;
  10977. this.animator.play()
  10978. };
  10979. a.prototype.createMotionPath = function() {
  10980. var b = {
  10981. prop: "x"
  10982. },
  10983. a = {
  10984. prop: "y"
  10985. },
  10986. d = [b, a];
  10987. switch (this._popUpPosition) {
  10988. case c.PopUpPosition.TOP_LEFT:
  10989. case c.PopUpPosition.CENTER:
  10990. case c.PopUpPosition.BELOW:
  10991. b.from = b.to = 0;
  10992. a.from = this.popUp.height;
  10993. a.to = 0;
  10994. this.valueRange = this.popUp.height;
  10995. break;
  10996. case c.PopUpPosition.ABOVE:
  10997. b.from = b.to = 0;
  10998. a.from = -this.popUp.height;
  10999. a.to = 0;
  11000. this.valueRange = this.popUp.height;
  11001. break;
  11002. case c.PopUpPosition.LEFT:
  11003. a.from = a.to = 0;
  11004. b.from = -this.popUp.width;
  11005. b.to = 0;
  11006. this.valueRange = this.popUp.width;
  11007. break;
  11008. case c.PopUpPosition.RIGHT:
  11009. a.from = a.to = 0;
  11010. b.from = this.popUp.width;
  11011. b.to = 0;
  11012. this.valueRange = this.popUp.width;
  11013. break;
  11014. default:
  11015. this.valueRange = 1
  11016. }
  11017. this.valueRange = Math.abs(this.valueRange);
  11018. if (!this.popUpIsDisplayed) {
  11019. var e = b.from;
  11020. b.from = b.to;
  11021. b.to = e;
  11022. e = a.from;
  11023. a.from = a.to;
  11024. a.to = e
  11025. }
  11026. return d
  11027. };
  11028. a.prototype.addedToStageHandler = function(b) {
  11029. this.addedToStage = !0;
  11030. c.callLater(this.checkPopUpState, this)
  11031. };
  11032. a.prototype.checkPopUpState = function() {
  11033. this.addedToStage ? this.addOrRemovePopUp() : null != this.popUp && null != this.popUp.parent && this.removeAndResetPopUp()
  11034. };
  11035. a.prototype.removedFromStageHandler = function(b) {
  11036. this.addedToStage = !1;
  11037. c.callLater(this.checkPopUpState, this)
  11038. };
  11039. return a
  11040. } (c.UIComponent);
  11041. c.PopUpAnchor = e
  11042. })(egret || (egret = {}));
  11043. __extends = this.__extends ||
  11044. function(c, e) {
  11045. function d() {
  11046. this.constructor = c
  11047. }
  11048. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11049. d.prototype = e.prototype;
  11050. c.prototype = new d
  11051. }; (function(c) {
  11052. var e = function(d) {
  11053. function a() {
  11054. d.call(this);
  11055. this._isOpen = !1;
  11056. this._closeOnResize = !0;
  11057. this._rollOverOpenDelay = NaN
  11058. }
  11059. __extends(a, d);
  11060. Object.defineProperty(a.prototype, "openButton", {
  11061. get: function() {
  11062. return this._openButton
  11063. },
  11064. set: function(b) {
  11065. this._openButton !== b && (this.removeOpenTriggers(), this._openButton = b, this.addOpenTriggers())
  11066. },
  11067. enumerable: !0,
  11068. configurable: !0
  11069. });
  11070. Object.defineProperty(a.prototype, "dropDown", {
  11071. get: function() {
  11072. return this._dropDown
  11073. },
  11074. set: function(b) {
  11075. this._dropDown !== b && (this._dropDown = b)
  11076. },
  11077. enumerable: !0,
  11078. configurable: !0
  11079. });
  11080. Object.defineProperty(a.prototype, "isOpen", {
  11081. get: function() {
  11082. return this._isOpen
  11083. },
  11084. enumerable: !0,
  11085. configurable: !0
  11086. });
  11087. Object.defineProperty(a.prototype, "closeOnResize", {
  11088. get: function() {
  11089. return this._closeOnResize
  11090. },
  11091. set: function(b) {
  11092. this._closeOnResize != b && (this.isOpen && this.removeCloseOnResizeTrigger(), this._closeOnResize = b, this.addCloseOnResizeTrigger())
  11093. },
  11094. enumerable: !0,
  11095. configurable: !0
  11096. });
  11097. Object.defineProperty(a.prototype, "rollOverOpenDelay", {
  11098. get: function() {
  11099. return this._rollOverOpenDelay
  11100. },
  11101. set: function(b) {
  11102. this._rollOverOpenDelay != b && (this.removeOpenTriggers(), this._rollOverOpenDelay = b, this.addOpenTriggers())
  11103. },
  11104. enumerable: !0,
  11105. configurable: !0
  11106. });
  11107. a.prototype.addOpenTriggers = function() {
  11108. this.openButton && (isNaN(this.rollOverOpenDelay) ? this.openButton.addEventListener(c.UIEvent.BUTTON_DOWN, this._openButton_buttonDownHandler, this) : this.openButton.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this._openButton_rollOverHandler, this))
  11109. };
  11110. a.prototype.removeOpenTriggers = function() {
  11111. this.openButton && (isNaN(this.rollOverOpenDelay) ? this.openButton.removeEventListener(c.UIEvent.BUTTON_DOWN, this._openButton_buttonDownHandler, this) : this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this._openButton_rollOverHandler, this))
  11112. };
  11113. a.prototype.addCloseTriggers = function() {
  11114. c.UIGlobals.stage && (isNaN(this.rollOverOpenDelay) ? (c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.stage_mouseDownHandler, this), c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler_noRollOverOpenDelay, this)) : c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this), this.addCloseOnResizeTrigger())
  11115. };
  11116. a.prototype.removeCloseTriggers = function() {
  11117. c.UIGlobals.stage && (isNaN(this.rollOverOpenDelay) ? (c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.stage_mouseDownHandler, this), c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler_noRollOverOpenDelay, this)) : (c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this), c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)), this.removeCloseOnResizeTrigger())
  11118. };
  11119. a.prototype.addCloseOnResizeTrigger = function() {
  11120. this.closeOnResize && c.UIGlobals.stage.addEventListener(c.Event.RESIZE, this.stage_resizeHandler, this)
  11121. };
  11122. a.prototype.removeCloseOnResizeTrigger = function() {
  11123. this.closeOnResize && c.UIGlobals.stage.removeEventListener(c.Event.RESIZE, this.stage_resizeHandler, this)
  11124. };
  11125. a.prototype.isTargetOverDropDownOrOpenButton = function(b) {
  11126. if (b) {
  11127. if (this.openButton && this.openButton.contains(b)) return ! 0;
  11128. if (null != this.hitAreaAdditions) for (var a = 0; a < this.hitAreaAdditions.length; a++) if (this.hitAreaAdditions[a] == b || this.hitAreaAdditions[a] instanceof c.DisplayObjectContainer && this.hitAreaAdditions[a].contains(b)) return ! 0;
  11129. if (this.dropDown instanceof c.DisplayObjectContainer) {
  11130. if (this.dropDown.contains(b)) return ! 0
  11131. } else if (b == this.dropDown) return ! 0
  11132. }
  11133. return ! 1
  11134. };
  11135. a.prototype.openDropDown = function() {
  11136. this.openDropDownHelper()
  11137. };
  11138. a.prototype.openDropDownHelper = function() {
  11139. this.isOpen || (this.addCloseTriggers(), this._isOpen = !0, this.openButton && this.openButton._setKeepDown(!0), c.UIEvent.dispatchUIEvent(this, c.UIEvent.OPEN))
  11140. };
  11141. a.prototype.closeDropDown = function(b) {
  11142. if (this.isOpen) {
  11143. this._isOpen = !1;
  11144. this.openButton && this.openButton._setKeepDown(!1);
  11145. var a = new c.UIEvent(c.UIEvent.CLOSE, !1, !0);
  11146. b || a.preventDefault();
  11147. this.dispatchEvent(a);
  11148. this.removeCloseTriggers()
  11149. }
  11150. };
  11151. a.prototype._openButton_buttonDownHandler = function(b) {
  11152. this.isOpen ? this.closeDropDown(!0) : (this.mouseIsDown = !0, this.openDropDownHelper())
  11153. };
  11154. a.prototype._openButton_rollOverHandler = function(b) {
  11155. 0 == this.rollOverOpenDelay ? this.openDropDownHelper() : (this.openButton.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this), this.rollOverOpenDelayTimer = new c.Timer(this.rollOverOpenDelay, 1), this.rollOverOpenDelayTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this.rollOverDelay_timerCompleteHandler, this), this.rollOverOpenDelayTimer.start())
  11156. };
  11157. a.prototype.openButton_rollOutHandler = function(b) {
  11158. this.rollOverOpenDelayTimer && this.rollOverOpenDelayTimer.running && (this.rollOverOpenDelayTimer.stop(), this.rollOverOpenDelayTimer = null);
  11159. this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this)
  11160. };
  11161. a.prototype.rollOverDelay_timerCompleteHandler = function(b) {
  11162. this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this);
  11163. this.rollOverOpenDelayTimer = null;
  11164. this.openDropDownHelper()
  11165. };
  11166. a.prototype.stage_mouseDownHandler = function(b) {
  11167. if (this.mouseIsDown) this.mouseIsDown = !1;
  11168. else if (!this.dropDown || this.dropDown && (b.target == this.dropDown || this.dropDown instanceof c.DisplayObjectContainer && !this.dropDown.contains(b.target))) {
  11169. var a = b.target;
  11170. if (! (this.openButton && a && this.openButton.contains(a))) {
  11171. if (null != this.hitAreaAdditions) for (a = 0; a < this.hitAreaAdditions.length; a++) if (this.hitAreaAdditions[a] == b.target || this.hitAreaAdditions[a] instanceof c.DisplayObjectContainer && this.hitAreaAdditions[a].contains(b.target)) return;
  11172. this.closeDropDown(!0)
  11173. }
  11174. }
  11175. };
  11176. a.prototype.stage_mouseMoveHandler = function(b) {
  11177. this.isTargetOverDropDownOrOpenButton(b.target) || (b instanceof c.TouchEvent && b.touchDown ? (c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)) : this.closeDropDown(!0))
  11178. };
  11179. a.prototype.stage_mouseUpHandler_noRollOverOpenDelay = function(b) {
  11180. this.mouseIsDown && (this.mouseIsDown = !1)
  11181. };
  11182. a.prototype.stage_mouseUpHandler = function(b) {
  11183. this.isTargetOverDropDownOrOpenButton(b.target) ? (c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)) : this.closeDropDown(!0)
  11184. };
  11185. a.prototype.stage_resizeHandler = function(b) {
  11186. this.closeDropDown(!0)
  11187. };
  11188. a.prototype.stage_mouseWheelHandler = function(b) { ! this.dropDown || this.dropDown.contains(b.target) && b.isDefaultPrevented() || this.closeDropDown(!1)
  11189. };
  11190. return a
  11191. } (c.EventDispatcher);
  11192. c.DropDownController = e
  11193. })(egret || (egret = {}));
  11194. __extends = this.__extends ||
  11195. function(c, e) {
  11196. function d() {
  11197. this.constructor = c
  11198. }
  11199. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11200. d.prototype = e.prototype;
  11201. c.prototype = new d
  11202. }; (function(c) {
  11203. var e = function(d) {
  11204. function a() {
  11205. d.call(this);
  11206. this._labelChanged = !1;
  11207. this._userProposedSelectedIndex = c.ListBase.NO_SELECTION;
  11208. this._captureItemRenderer = !1;
  11209. this.dropDownController = new c.DropDownController
  11210. }
  11211. __extends(a, d);
  11212. a.prototype._setDataProvider = function(b) {
  11213. this.dataProvider !== b && (d.prototype._setDataProvider.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11214. };
  11215. a.prototype._setLabelField = function(b) {
  11216. this.labelField != b && (d.prototype._setLabelField.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11217. };
  11218. a.prototype._setLabelFunction = function(b) {
  11219. this.labelFunction != b && (d.prototype._setLabelFunction.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11220. };
  11221. Object.defineProperty(a.prototype, "dropDownController", {
  11222. get: function() {
  11223. return this._dropDownController
  11224. },
  11225. set: function(b) {
  11226. this._dropDownController != b && (this._dropDownController = b, this._dropDownController.addEventListener(c.UIEvent.OPEN, this._dropDownController_openHandler, this), this._dropDownController.addEventListener(c.UIEvent.CLOSE, this.dropDownController_closeHandler, this), this.openButton && (this._dropDownController.openButton = this.openButton), this.dropDown && (this._dropDownController.dropDown = this.dropDown))
  11227. },
  11228. enumerable: !0,
  11229. configurable: !0
  11230. });
  11231. Object.defineProperty(a.prototype, "isDropDownOpen", {
  11232. get: function() {
  11233. return this.dropDownController ? this.dropDownController.isOpen: !1
  11234. },
  11235. enumerable: !0,
  11236. configurable: !0
  11237. });
  11238. a.prototype.commitProperties = function() {
  11239. d.prototype.commitProperties.call(this);
  11240. this._labelChanged && (this._labelChanged = !1, this.updateLabelDisplay())
  11241. };
  11242. a.prototype.partAdded = function(b, a) {
  11243. d.prototype.partAdded.call(this, b, a);
  11244. a == this.openButton ? this.dropDownController && (this.dropDownController.openButton = this.openButton) : a == this.dropDown && this.dropDownController && (this.dropDownController.dropDown = this.dropDown)
  11245. };
  11246. a.prototype.partRemoved = function(b, a) {
  11247. this.dropDownController && (a == this.openButton && (this.dropDownController.openButton = null), a == this.dropDown && (this.dropDownController.dropDown = null));
  11248. d.prototype.partRemoved.call(this, b, a)
  11249. };
  11250. a.prototype.getCurrentSkinState = function() {
  11251. return this.enabled ? this.isDropDownOpen ? "open": "normal": "disabled"
  11252. };
  11253. a.prototype.commitSelection = function(b) {
  11254. "undefined" === typeof b && (b = !0);
  11255. b = d.prototype.commitSelection.call(this, b);
  11256. this.updateLabelDisplay();
  11257. return b
  11258. };
  11259. a.prototype._isItemIndexSelected = function(b) {
  11260. return this._userProposedSelectedIndex == b
  11261. };
  11262. a.prototype.openDropDown = function() {
  11263. this.dropDownController.openDropDown()
  11264. };
  11265. a.prototype.closeDropDown = function(b) {
  11266. this.dropDownController.closeDropDown(b)
  11267. };
  11268. a.prototype.updateLabelDisplay = function(b) {};
  11269. a.prototype._changeHighlightedSelection = function(b, a) {
  11270. this.itemSelected(this._userProposedSelectedIndex, !1);
  11271. this._userProposedSelectedIndex = b;
  11272. this.itemSelected(this._userProposedSelectedIndex, !0)
  11273. };
  11274. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  11275. d.prototype.dataProvider_collectionChangeHandler.call(this, b);
  11276. this._labelChanged = !0;
  11277. this.invalidateProperties()
  11278. };
  11279. a.prototype.item_mouseDownHandler = function(b) {
  11280. d.prototype.item_mouseDownHandler.call(this, b);
  11281. this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, b.currentTarget);
  11282. this._userProposedSelectedIndex = this.selectedIndex;
  11283. this.closeDropDown(!0)
  11284. };
  11285. a.prototype._dropDownController_openHandler = function(b) {
  11286. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this._open_updateCompleteHandler, this);
  11287. this._userProposedSelectedIndex = this.selectedIndex;
  11288. this.invalidateSkinState()
  11289. };
  11290. a.prototype._open_updateCompleteHandler = function(b) {
  11291. this.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this._open_updateCompleteHandler, this);
  11292. c.UIEvent.dispatchUIEvent(this, c.UIEvent.OPEN)
  11293. };
  11294. a.prototype.dropDownController_closeHandler = function(b) {
  11295. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.close_updateCompleteHandler, this);
  11296. this.invalidateSkinState();
  11297. b.isDefaultPrevented() ? this._changeHighlightedSelection(this.selectedIndex) : this._setSelectedIndex(this._userProposedSelectedIndex, !0)
  11298. };
  11299. a.prototype.close_updateCompleteHandler = function(b) {
  11300. this.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.close_updateCompleteHandler, this);
  11301. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CLOSE)
  11302. };
  11303. a.PAGE_SIZE = 5;
  11304. return a
  11305. } (c.List);
  11306. c.DropDownListBase = e
  11307. })(egret || (egret = {}));
  11308. __extends = this.__extends ||
  11309. function(c, e) {
  11310. function d() {
  11311. this.constructor = c
  11312. }
  11313. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11314. d.prototype = e.prototype;
  11315. c.prototype = new d
  11316. }; (function(c) {
  11317. var e = function(d) {
  11318. function a() {
  11319. d.call(this);
  11320. this.iconFieldOrFunctionChanged = !1;
  11321. this.hostComponentKey = "egret.Tree"
  11322. }
  11323. __extends(a, d);
  11324. a.prototype.createChildren = function() {
  11325. this.itemRenderer || (this.itemRenderer = a.defaultTreeRendererFactory);
  11326. d.prototype.createChildren.call(this)
  11327. };
  11328. a.prototype.updateRenderer = function(b, a, c) {
  11329. if ("hasChildren" in b && "hasChildren" in this.dataProvider) {
  11330. var e = this.dataProvider;
  11331. b.hasChildren = e.hasChildren(c);
  11332. b.opened = e.isItemOpen(c);
  11333. b.depth = e.getDepth(c);
  11334. b.iconSkinName = this.itemToIcon(c)
  11335. }
  11336. return d.prototype.updateRenderer.call(this, b, a, c)
  11337. };
  11338. a.prototype.itemToIcon = function(b) {
  11339. if (!b) return null;
  11340. if (null != this._iconFunction) return this._iconFunction(b);
  11341. var a;
  11342. if (b instanceof Object) try {
  11343. b[this.iconField] && (a = b[this.iconField])
  11344. } catch(c) {}
  11345. return a
  11346. };
  11347. a.prototype.dataGroup_rendererAddHandler = function(b) {
  11348. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  11349. b.renderer && "hasChildren" in b.renderer && b.renderer.addEventListener(c.TreeEvent.ITEM_OPENING, this.onItemOpening, this)
  11350. };
  11351. a.prototype.onItemOpening = function(b) {
  11352. var a = b.itemRenderer,
  11353. d = b.item,
  11354. e = this._getDataProvider();
  11355. a && e && "hasChildren" in e && this.dispatchEvent(b) && (b = !a.opened, e.expandItem(d, b), c.TreeEvent.dispatchTreeEvent(this, b ? c.TreeEvent.ITEM_OPEN: c.TreeEvent.ITEM_CLOSE, a.itemIndex, d, a))
  11356. };
  11357. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  11358. d.prototype.dataGroup_rendererRemoveHandler.call(this, b);
  11359. b.renderer && "hasChildren" in b.renderer && b.renderer.removeEventListener(c.TreeEvent.ITEM_OPENING, this.onItemOpening, this)
  11360. };
  11361. Object.defineProperty(a.prototype, "iconField", {
  11362. get: function() {
  11363. return this._iconField
  11364. },
  11365. set: function(b) {
  11366. this._iconField != b && (this._iconField = b, this.iconFieldOrFunctionChanged = !0, this.invalidateProperties())
  11367. },
  11368. enumerable: !0,
  11369. configurable: !0
  11370. });
  11371. Object.defineProperty(a.prototype, "iconFunction", {
  11372. get: function() {
  11373. return this._iconFunction
  11374. },
  11375. set: function(b) {
  11376. this._iconFunction != b && (this._iconFunction = b, this.iconFieldOrFunctionChanged = !0, this.invalidateProperties())
  11377. },
  11378. enumerable: !0,
  11379. configurable: !0
  11380. });
  11381. a.prototype.expandItem = function(b, a) {
  11382. "undefined" === typeof a && (a = !0);
  11383. var c = this._getDataProvider();
  11384. c && "hasChildren" in c && c.expandItem(b, a)
  11385. };
  11386. a.prototype.isItemOpen = function(b) {
  11387. var a = this._getDataProvider();
  11388. return a && "hasChildren" in a ? a.isItemOpen(b) : !1
  11389. };
  11390. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  11391. d.prototype.dataProvider_collectionChangeHandler.call(this, b);
  11392. if (b.kind == c.CollectionEventKind.OPEN || b.kind == c.CollectionEventKind.CLOSE) {
  11393. var a = this.dataGroup ? this.dataGroup.getElementAt(b.location) : null;
  11394. a && (this.updateRenderer(a, b.location, b.items[0]), b.kind == c.CollectionEventKind.CLOSE && this.layout && this.layout.useVirtualLayout && (this.layout.clearVirtualLayoutCache(), this.invalidateSize()))
  11395. }
  11396. };
  11397. a.prototype.commitProperties = function() {
  11398. d.prototype.commitProperties.call(this);
  11399. if (this.iconFieldOrFunctionChanged) {
  11400. if (null != this.dataGroup) {
  11401. var b;
  11402. if (this.layout && this.layout.useVirtualLayout) for (var a = this.dataGroup.getElementIndicesInView(), c = a.length, e = 0; e < c; e++) b = a[e],
  11403. this.updateRendererIconProperty(b);
  11404. else for (a = this.dataGroup.numElements, b = 0; b < a; b++) this.updateRendererIconProperty(b)
  11405. }
  11406. this.iconFieldOrFunctionChanged = !1
  11407. }
  11408. };
  11409. a.prototype.updateRendererIconProperty = function(b) {
  11410. if (b = this.dataGroup.getElementAt(b)) b.iconSkinName = this.itemToIcon(b.data)
  11411. };
  11412. a.defaultTreeRendererFactory = new c.ClassFactory(c.TreeItemRenderer);
  11413. return a
  11414. } (c.List);
  11415. c.Tree = e
  11416. })(egret || (egret = {}));
  11417. __extends = this.__extends ||
  11418. function(c, e) {
  11419. function d() {
  11420. this.constructor = c
  11421. }
  11422. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11423. d.prototype = e.prototype;
  11424. c.prototype = new d
  11425. }; (function(c) {
  11426. var e = function(c) {
  11427. function a() {
  11428. c.call(this);
  11429. this._prompt = "";
  11430. this.hostComponentKey = "egret.DropDownList"
  11431. }
  11432. __extends(a, c);
  11433. Object.defineProperty(a.prototype, "prompt", {
  11434. get: function() {
  11435. return this._prompt
  11436. },
  11437. set: function(b) {
  11438. this._prompt != b && (this._prompt = b, this._labelChanged = !0, this.invalidateProperties())
  11439. },
  11440. enumerable: !0,
  11441. configurable: !0
  11442. });
  11443. a.prototype.partAdded = function(b, a) {
  11444. c.prototype.partAdded.call(this, b, a);
  11445. a == this.labelDisplay && (this._labelChanged = !0, this.invalidateProperties())
  11446. };
  11447. a.prototype.updateLabelDisplay = function(b) {
  11448. "undefined" === typeof b && (b = void 0);
  11449. this.labelDisplay && (void 0 == b && (b = this.selectedItem), this.labelDisplay.text = null != b && void 0 != b ? this.itemToLabel(b) : this._prompt)
  11450. };
  11451. return a
  11452. } (c.DropDownListBase);
  11453. c.DropDownList = e
  11454. })(egret || (egret = {}));
  11455. __extends = this.__extends ||
  11456. function(c, e) {
  11457. function d() {
  11458. this.constructor = c
  11459. }
  11460. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11461. d.prototype = e.prototype;
  11462. c.prototype = new d
  11463. }; (function(c) {
  11464. var e = function(c) {
  11465. function a() {
  11466. c.call(this);
  11467. this._allowDeselection = !0;
  11468. this.hostComponentKey = "egret.TabBarButton"
  11469. }
  11470. __extends(a, c);
  11471. Object.defineProperty(a.prototype, "allowDeselection", {
  11472. get: function() {
  11473. return this._allowDeselection
  11474. },
  11475. set: function(b) {
  11476. this._allowDeselection = b
  11477. },
  11478. enumerable: !0,
  11479. configurable: !0
  11480. });
  11481. Object.defineProperty(a.prototype, "data", {
  11482. get: function() {
  11483. return this._data
  11484. },
  11485. set: function(b) {
  11486. this._data = b;
  11487. this.dispatchEventWith("dataChange")
  11488. },
  11489. enumerable: !0,
  11490. configurable: !0
  11491. });
  11492. Object.defineProperty(a.prototype, "itemIndex", {
  11493. get: function() {
  11494. return this._itemIndex
  11495. },
  11496. set: function(b) {
  11497. this._itemIndex = b
  11498. },
  11499. enumerable: !0,
  11500. configurable: !0
  11501. });
  11502. a.prototype._setLabel = function(b) {
  11503. b != this._getLabel() && (c.prototype._setLabel.call(this, b), this.labelDisplay && (this.labelDisplay.text = this._getLabel()))
  11504. };
  11505. a.prototype.buttonReleased = function() {
  11506. this.selected && !this.allowDeselection || c.prototype.buttonReleased.call(this)
  11507. };
  11508. return a
  11509. } (c.ToggleButtonBase);
  11510. c.TabBarButton = e
  11511. })(egret || (egret = {}));
  11512. __extends = this.__extends ||
  11513. function(c, e) {
  11514. function d() {
  11515. this.constructor = c
  11516. }
  11517. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11518. d.prototype = e.prototype;
  11519. c.prototype = new d
  11520. }; (function(c) {
  11521. var e = function(d) {
  11522. function a() {
  11523. d.call(this);
  11524. this.hostComponentKey = "egret.TabBar";
  11525. this.requireSelection = !0
  11526. }
  11527. __extends(a, d);
  11528. a.prototype.c = function(b) {
  11529. b != this._requireSelection && (d.prototype._setRequireSelection.call(this, b), this.requireSelectionChanged_tabBar = !0, this.invalidateProperties())
  11530. };
  11531. a.prototype._setDataProvider = function(b) {
  11532. this.dataProvider instanceof c.ViewStack && (this.dataProvider.removeEventListener("IndexChanged", this.onViewStackIndexChange, this), this.removeEventListener(c.IndexChangeEvent.CHANGE, this.onIndexChanged, this));
  11533. b instanceof c.ViewStack && (b.addEventListener("IndexChanged", this.onViewStackIndexChange, this), this.addEventListener(c.IndexChangeEvent.CHANGE, this.onIndexChanged, this));
  11534. d.prototype._setDataProvider.call(this, b)
  11535. };
  11536. a.prototype.onIndexChanged = function(b) {
  11537. this.dataProvider._setSelectedIndex(b.newIndex, !1)
  11538. };
  11539. a.prototype.onViewStackIndexChange = function(b) {
  11540. this._setSelectedIndex(this.dataProvider.selectedIndex, !1)
  11541. };
  11542. a.prototype.commitProperties = function() {
  11543. d.prototype.commitProperties.call(this);
  11544. if (this.requireSelectionChanged_tabBar && this.dataGroup) {
  11545. this.requireSelectionChanged_tabBar = !1;
  11546. for (var b = this.dataGroup.numElements,
  11547. a = 0; a < b; a++) {
  11548. var c = this.dataGroup.getElementAt(a);
  11549. c && (c.allowDeselection = !this.requireSelection)
  11550. }
  11551. }
  11552. };
  11553. a.prototype.dataGroup_rendererAddHandler = function(b) {
  11554. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  11555. if (b = b.renderer) b.addEventListener(c.TouchEvent.TOUCH_TAP, this.item_clickHandler, this),
  11556. b instanceof c.TabBarButton && (b.allowDeselection = !this.requireSelection)
  11557. };
  11558. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  11559. d.prototype.dataGroup_rendererRemoveHandler.call(this, b); (b = b.renderer) && b.removeEventListener(c.TouchEvent.TOUCH_TAP, this.item_clickHandler, this)
  11560. };
  11561. a.prototype.item_clickHandler = function(b) {
  11562. var a = b.currentTarget,
  11563. d;
  11564. d = a ? a.itemIndex: this.dataGroup.getElementIndex(b.currentTarget);
  11565. d == this.selectedIndex ? this.requireSelection || this._setSelectedIndex(c.ListBase.NO_SELECTION, !0) : this._setSelectedIndex(d, !0);
  11566. this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, a)
  11567. };
  11568. return a
  11569. } (c.ListBase);
  11570. c.TabBar = e
  11571. })(egret || (egret = {}));
  11572. __extends = this.__extends ||
  11573. function(c, e) {
  11574. function d() {
  11575. this.constructor = c
  11576. }
  11577. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11578. d.prototype = e.prototype;
  11579. c.prototype = new d
  11580. }; (function(c) {
  11581. var e = function(d) {
  11582. function a() {
  11583. d.call(this);
  11584. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  11585. this.ignoreTouchBegin = !1;
  11586. this._velocityY = this._velocityX = 0;
  11587. this._previousVelocityX = [];
  11588. this._previousVelocityY = []
  11589. }
  11590. __extends(a, d);
  11591. a.prototype.measure = function() {
  11592. this._viewport && (this.measuredWidth = this._viewport.preferredWidth, this.measuredHeight = this._viewport.preferredHeight)
  11593. };
  11594. a.prototype.updateDisplayList = function(b, a) {
  11595. this._viewport.setLayoutBoundsSize(b, a)
  11596. };
  11597. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  11598. get: function() {
  11599. return this._verticalScrollPolicy
  11600. },
  11601. set: function(b) {
  11602. this._verticalScrollPolicy = b
  11603. },
  11604. enumerable: !0,
  11605. configurable: !0
  11606. });
  11607. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  11608. get: function() {
  11609. return this._horizontalScrollPolicy
  11610. },
  11611. set: function(b) {
  11612. this._horizontalScrollPolicy = b
  11613. },
  11614. enumerable: !0,
  11615. configurable: !0
  11616. });
  11617. Object.defineProperty(a.prototype, "viewport", {
  11618. get: function() {
  11619. return this._viewport
  11620. },
  11621. set: function(b) {
  11622. b != this._viewport && (this.uninstallViewport(), this._viewport = b, this.installViewport(), this.dispatchEventWith("viewportChanged"))
  11623. },
  11624. enumerable: !0,
  11625. configurable: !0
  11626. });
  11627. a.prototype.installViewport = function() {
  11628. this.viewport && (this.viewport.clipAndEnableScrolling = !0, this.viewport.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this), this.viewport.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBeginCapture, this, !0), this.viewport.addEventListener(c.TouchEvent.TOUCH_END, this.onTouchEndCapture, this, !0), this._addToDisplayListAt(this.viewport, 0))
  11629. };
  11630. a.prototype.uninstallViewport = function() {
  11631. this.viewport && (this.viewport.clipAndEnableScrolling = !1, this.viewport.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this), this.viewport.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBeginCapture, this, !0), this.viewport.removeEventListener(c.TouchEvent.TOUCH_END, this.onTouchEndCapture, this, !0), this._removeFromDisplayList(this.viewport))
  11632. };
  11633. a.prototype.onTouchEndCapture = function(b) {
  11634. this.delayTouchBeginEvent && (b.stopPropagation(), this.delayTouchEndEvent = this.cloneTouchEvent(b), this.onTouchBeginTimer(), this.touchEndTimer || (this.touchEndTimer = new c.Timer(100, 1), this.touchEndTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this.onTouchEndTimer, this)), this.touchEndTimer.start())
  11635. };
  11636. a.prototype.onTouchEndTimer = function(b) {
  11637. this.touchEndTimer.stop();
  11638. b = this.delayTouchEndEvent;
  11639. this.delayTouchEndEvent = null;
  11640. this.dispatchPropagationEvent(b)
  11641. };
  11642. a.prototype.dispatchPropagationEvent = function(b) {
  11643. for (var a = [], c = b._target; c;) a.push(c),
  11644. c = c.parent;
  11645. for (var d = this._viewport,
  11646. e = 1;; e += 2) {
  11647. c = a[e];
  11648. if (!c || c === d) break;
  11649. a.unshift(c)
  11650. }
  11651. c = a.indexOf(b._target);
  11652. this._dispatchPropagationEvent(b, a, c)
  11653. };
  11654. a.prototype.onTouchBeginCapture = function(b) {
  11655. var d = this.checkScrollPolicy();
  11656. if (d) {
  11657. for (var e = b.target; e != this;) {
  11658. if (e instanceof a && (d = e.checkScrollPolicy())) return;
  11659. e = e.parent
  11660. }
  11661. this.delayTouchEndEvent && (this.delayTouchEndEvent = null, this.touchEndTimer.stop());
  11662. b.stopPropagation();
  11663. this.delayTouchBeginEvent = this.cloneTouchEvent(b);
  11664. this.touchBeginTimer || (this.touchBeginTimer = new c.Timer(100, 1), this.touchBeginTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this.onTouchBeginTimer, this));
  11665. this.touchBeginTimer.start();
  11666. this.onTouchBegin(b)
  11667. }
  11668. };
  11669. a.prototype.cloneTouchEvent = function(b) {
  11670. var a = new c.TouchEvent(b._type, b._bubbles, b.cancelable);
  11671. a.touchPointID = b.touchPointID;
  11672. a._stageX = b._stageX;
  11673. a._stageY = b._stageY;
  11674. a.ctrlKey = b.ctrlKey;
  11675. a.altKey = b.altKey;
  11676. a.shiftKey = b.shiftKey;
  11677. a.touchDown = b.touchDown;
  11678. a._isDefaultPrevented = !1;
  11679. a._target = b._target;
  11680. return a
  11681. };
  11682. a.prototype.onTouchBeginTimer = function(b) {
  11683. this.touchBeginTimer.stop();
  11684. b = this.delayTouchBeginEvent;
  11685. this.delayTouchBeginEvent = null;
  11686. this.dispatchPropagationEvent(b)
  11687. };
  11688. a.prototype.checkScrollPolicy = function() {
  11689. var b = this._viewport,
  11690. a;
  11691. switch (this._horizontalScrollPolicy) {
  11692. case "auto":
  11693. a = b.contentWidth > b.width ? !0 : !1;
  11694. break;
  11695. case "on":
  11696. a = !0;
  11697. break;
  11698. case "off":
  11699. a = !1
  11700. }
  11701. this._horizontalCanScroll = a;
  11702. var c;
  11703. switch (this._verticalScrollPolicy) {
  11704. case "auto":
  11705. c = b.contentHeight > b.height ? !0 : !1;
  11706. break;
  11707. case "on":
  11708. c = !0;
  11709. break;
  11710. case "off":
  11711. c = !1
  11712. }
  11713. this._verticalCanScroll = c;
  11714. return a || c
  11715. };
  11716. a.prototype.onTouchBegin = function(b) {
  11717. if (!b.isDefaultPrevented() && this.checkScrollPolicy()) {
  11718. this.verticalAnimator && this.verticalAnimator.isPlaying && this.verticalAnimator.stop();
  11719. this.horizontalAnimator && this.horizontalAnimator.isPlaying && this.horizontalAnimator.stop();
  11720. var a = this._viewport,
  11721. d = a.horizontalScrollPosition,
  11722. a = a.verticalScrollPosition;
  11723. this._offsetPointX = d + b.stageX;
  11724. this._offsetPointY = a + b.stageY;
  11725. this._velocityY = this._velocityX = 0;
  11726. this._previousVelocityX.length = 0;
  11727. this._previousVelocityY.length = 0;
  11728. this._previousTouchTime = c.getTimer();
  11729. this._previousTouchX = this._startTouchX = this._currentTouchX = b.stageX;
  11730. this._previousTouchY = this._startTouchY = this._currentTouchY = b.stageY;
  11731. this._startHorizontalScrollPosition = d;
  11732. this._startVerticalScrollPosition = a;
  11733. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  11734. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  11735. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.onTouchEnd, this);
  11736. this.addEventListener(c.Event.ENTER_FRAME, this.enterFrameHandler, this);
  11737. b.preventDefault()
  11738. }
  11739. };
  11740. a.prototype.onTouchMove = function(b) {
  11741. this._currentTouchX = b.stageX;
  11742. this._currentTouchY = b.stageY;
  11743. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  11744. var a = this._viewport;
  11745. if (this._horizontalCanScroll) {
  11746. var c = this._offsetPointX - b.stageX;
  11747. 0 > c && (c *= 0.5);
  11748. c > a.contentWidth - a.width && (c = 0.5 * (c + a.contentWidth - a.width));
  11749. a.horizontalScrollPosition = c
  11750. }
  11751. this._verticalCanScroll && (b = this._offsetPointY - b.stageY, 0 > b && (b *= 0.5), b > a.contentHeight - a.height && (b = 0.5 * (b + a.contentHeight - a.height)), a.verticalScrollPosition = b)
  11752. };
  11753. a.prototype.onTouchEnd = function(a) {
  11754. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  11755. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  11756. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.onTouchEnd, this);
  11757. this.removeEventListener(c.Event.ENTER_FRAME, this.enterFrameHandler, this);
  11758. this._horizontalCanScroll && this.checkHorizontalScrollPosition();
  11759. this._verticalCanScroll && this.checkVerticalScrollPosition()
  11760. };
  11761. a.easeOut = function(a) {
  11762. a -= 1;
  11763. return a * a * a + 1
  11764. };
  11765. a.prototype.enterFrameHandler = function(a) {
  11766. a = c.getTimer();
  11767. var d = a - this._previousTouchTime;
  11768. 0 < d && (this._previousVelocityX[this._previousVelocityX.length] = this._velocityX, 4 < this._previousVelocityX.length && this._previousVelocityX.shift(), this._previousVelocityY[this._previousVelocityY.length] = this._velocityY, 4 < this._previousVelocityY.length && this._previousVelocityY.shift(), this._velocityX = (this._currentTouchX - this._previousTouchX) / d, this._velocityY = (this._currentTouchY - this._previousTouchY) / d, this._previousTouchTime = a, this._previousTouchX = this._currentTouchX, this._previousTouchY = this._currentTouchY);
  11769. a = Math.abs(this._currentTouchX - this._startTouchX);
  11770. d = Math.abs(this._currentTouchY - this._startTouchY);
  11771. this._horizontalCanScroll && 0.04 <= a && (this._startTouchX = this._currentTouchX, this._startHorizontalScrollPosition = this._viewport.horizontalScrollPosition);
  11772. this._verticalCanScroll && 0.04 <= d && (this._startTouchY = this._currentTouchY, this._startVerticalScrollPosition = this._viewport.verticalScrollPosition)
  11773. };
  11774. a.prototype.checkHorizontalScrollPosition = function() {
  11775. for (var b = this._viewport,
  11776. c = b.horizontalScrollPosition,
  11777. b = b.contentWidth - b.width,
  11778. b = Math.max(0, b), d = 2.33 * this._velocityX, e = this._previousVelocityX.length, f = 2.33, g = 0; g < e; g++) var l = a.VELOCITY_WEIGHTS[g],
  11779. d = d + this._previousVelocityX.shift() * l,
  11780. f = f + l;
  11781. d /= f;
  11782. 0.02 >= Math.abs(d) ? this.finishScrollingHorizontally() : (c = this.getAnimationDatas(d, c, b), this.throwHorizontally(c[0], c[1]))
  11783. };
  11784. a.prototype.checkVerticalScrollPosition = function() {
  11785. for (var b = this._viewport,
  11786. c = b.verticalScrollPosition,
  11787. b = b.contentHeight - b.height,
  11788. d = 2.33 * this._velocityY,
  11789. e = this._previousVelocityY.length,
  11790. f = 2.33,
  11791. g = 0; g < e; g++) var l = a.VELOCITY_WEIGHTS[g],
  11792. d = d + this._previousVelocityY.shift() * l,
  11793. f = f + l;
  11794. d /= f;
  11795. 0.02 >= Math.abs(d) ? this.finishScrollingVertically() : (c = this.getAnimationDatas(d, c, b), this.throwVertically(c[0], c[1]))
  11796. };
  11797. a.prototype.getAnimationDatas = function(b, c, d) {
  11798. var e = Math.abs(b),
  11799. f = 0,
  11800. g = c + (b - 0.02) / Math.log(0.998);
  11801. if (0 > g || g > d) for (g = c; 0.02 < Math.abs(b);) g -= b,
  11802. b = 0 > g || g > d ? 0.998 * b * 0.95 : 0.998 * b,
  11803. f++;
  11804. else f = Math.log(0.02 / e) / Math.log(0.998);
  11805. a.animationData || (a.animationData = [0, 0]);
  11806. b = a.animationData;
  11807. b[0] = g;
  11808. b[1] = f;
  11809. return b
  11810. };
  11811. a.prototype.finishScrollingHorizontally = function(a) {
  11812. var c = this._viewport;
  11813. a = c.horizontalScrollPosition;
  11814. var c = c.contentWidth - c.width,
  11815. d = a;
  11816. 0 > a && (d = 0);
  11817. a > c && (d = c);
  11818. this.throwHorizontally(d, 300)
  11819. };
  11820. a.prototype.throwHorizontally = function(b, d) {
  11821. "undefined" === typeof d && (d = 500);
  11822. var e = this._viewport.horizontalScrollPosition;
  11823. e != b && (this.horizontalAnimator || (this.horizontalAnimator = new c.Animation(this.horizontalUpdateHandler, this), this.horizontalAnimator.endFunction = this.finishScrollingHorizontally, this.horizontalAnimator.easerFunction = a.easeOut), this.horizontalAnimator.isPlaying && this.horizontalAnimator.stop(), this.horizontalAnimator.duration = d, this.horizontalAnimator.motionPaths = [{
  11824. prop: "hsp",
  11825. from: e,
  11826. to: b
  11827. }], this.horizontalAnimator.play())
  11828. };
  11829. a.prototype.horizontalUpdateHandler = function(a) {
  11830. this._viewport.horizontalScrollPosition = a.currentValue.hsp
  11831. };
  11832. a.prototype.finishScrollingVertically = function(a) {
  11833. var c = this._viewport;
  11834. a = c.verticalScrollPosition;
  11835. var c = c.contentHeight - c.height,
  11836. c = Math.max(0, c),
  11837. d = a;
  11838. 0 > a && (d = 0);
  11839. a > c && (d = c);
  11840. this.throwVertically(d, 300)
  11841. };
  11842. a.prototype.throwVertically = function(b, d) {
  11843. "undefined" === typeof d && (d = 500);
  11844. var e = this._viewport.verticalScrollPosition;
  11845. e != b && (this.verticalAnimator || (this.verticalAnimator = new c.Animation(this.verticalUpdateHandler, this), this.verticalAnimator.endFunction = this.finishScrollingVertically, this.verticalAnimator.easerFunction = a.easeOut), this.verticalAnimator.isPlaying && this.verticalAnimator.stop(), this.verticalAnimator.duration = d, this.verticalAnimator.motionPaths = [{
  11846. prop: "vsp",
  11847. from: e,
  11848. to: b
  11849. }], this.verticalAnimator.play())
  11850. };
  11851. a.prototype.verticalUpdateHandler = function(a) {
  11852. this._viewport.verticalScrollPosition = a.currentValue.vsp
  11853. };
  11854. Object.defineProperty(a.prototype, "numElements", {
  11855. get: function() {
  11856. return this.viewport ? 1 : 0
  11857. },
  11858. enumerable: !0,
  11859. configurable: !0
  11860. });
  11861. a.prototype.throwRangeError = function(a) {
  11862. throw new RangeError('\u7d22\u5f15:"' + a + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  11863. };
  11864. a.prototype.getElementAt = function(a) {
  11865. if (this.viewport && 0 == a) return this.viewport;
  11866. this.throwRangeError(a);
  11867. return null
  11868. };
  11869. a.prototype.getElementIndex = function(a) {
  11870. return null != a && a == this.viewport ? 0 : -1
  11871. };
  11872. a.prototype.containsElement = function(a) {
  11873. return null != a && a == this.viewport ? !0 : !1
  11874. };
  11875. a.prototype.throwNotSupportedError = function() {
  11876. throw Error("\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!");
  11877. };
  11878. a.prototype.addElement = function(a) {
  11879. this.throwNotSupportedError();
  11880. return null
  11881. };
  11882. a.prototype.addElementAt = function(a, c) {
  11883. this.throwNotSupportedError();
  11884. return null
  11885. };
  11886. a.prototype.removeElement = function(a) {
  11887. this.throwNotSupportedError();
  11888. return null
  11889. };
  11890. a.prototype.removeElementAt = function(a) {
  11891. this.throwNotSupportedError();
  11892. return null
  11893. };
  11894. a.prototype.removeAllElements = function() {
  11895. this.throwNotSupportedError()
  11896. };
  11897. a.prototype.setElementIndex = function(a, c) {
  11898. this.throwNotSupportedError()
  11899. };
  11900. a.prototype.swapElements = function(a, c) {
  11901. this.throwNotSupportedError()
  11902. };
  11903. a.prototype.swapElementsAt = function(a, c) {
  11904. this.throwNotSupportedError()
  11905. };
  11906. a.prototype.addChild = function(a) {
  11907. this.throwNotSupportedError();
  11908. return null
  11909. };
  11910. a.prototype.addChildAt = function(a, c) {
  11911. this.throwNotSupportedError();
  11912. return null
  11913. };
  11914. a.prototype.removeChild = function(a) {
  11915. this.throwNotSupportedError();
  11916. return null
  11917. };
  11918. a.prototype.removeChildAt = function(a) {
  11919. this.throwNotSupportedError();
  11920. return null
  11921. };
  11922. a.prototype.setChildIndex = function(a, c) {
  11923. this.throwNotSupportedError()
  11924. };
  11925. a.prototype.swapChildren = function(a, c) {
  11926. this.throwNotSupportedError()
  11927. };
  11928. a.prototype.swapChildrenAt = function(a, c) {
  11929. this.throwNotSupportedError()
  11930. };
  11931. a.VELOCITY_WEIGHTS = [1, 1.33, 1.66, 2];
  11932. return a
  11933. } (c.UIComponent);
  11934. c.Scroller = e
  11935. })(egret || (egret = {}));
  11936. __extends = this.__extends ||
  11937. function(c, e) {
  11938. function d() {
  11939. this.constructor = c
  11940. }
  11941. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11942. d.prototype = e.prototype;
  11943. c.prototype = new d
  11944. }; (function(c) {
  11945. var e = function(d) {
  11946. function a(a, c, e) {
  11947. "undefined" === typeof c && (c = !1);
  11948. "undefined" === typeof e && (e = !1);
  11949. d.call(this, a, c, e)
  11950. }
  11951. __extends(a, d);
  11952. a.dispatchUIEvent = function(b, d) {
  11953. c.Event._dispatchByTarget(a, b, d)
  11954. };
  11955. a.INITIALIZE = "initialize";
  11956. a.CREATION_COMPLETE = "creationComplete";
  11957. a.UPDATE_COMPLETE = "updateComplete";
  11958. a.BUTTON_DOWN = "buttonDown";
  11959. a.CHANGE_END = "changeEnd";
  11960. a.CHANGE_START = "changeStart";
  11961. a.CHANGING = "changing";
  11962. a.VALUE_COMMIT = "valueCommit";
  11963. a.SKIN_CHANGED = "skinChanged";
  11964. a.CONTENT_CHANGED = "contentChanged";
  11965. a.OPEN = "open";
  11966. a.CLOSE = "close";
  11967. a.PLAY_COMPLETE = "playComplete";
  11968. return a
  11969. } (c.Event);
  11970. c.UIEvent = e
  11971. })(egret || (egret = {}));
  11972. __extends = this.__extends ||
  11973. function(c, e) {
  11974. function d() {
  11975. this.constructor = c
  11976. }
  11977. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11978. d.prototype = e.prototype;
  11979. c.prototype = new d
  11980. }; (function(c) {
  11981. var e = function(d) {
  11982. function a(a, c, e, k, f, g, l, n) {
  11983. "undefined" === typeof c && (c = !1);
  11984. "undefined" === typeof e && (e = !1);
  11985. "undefined" === typeof k && (k = null);
  11986. "undefined" === typeof f && (f = null);
  11987. "undefined" === typeof g && (g = null);
  11988. "undefined" === typeof l && (l = null);
  11989. "undefined" === typeof n && (n = null);
  11990. d.call(this, a, c, e);
  11991. this.kind = k;
  11992. this.property = f;
  11993. this.oldValue = g;
  11994. this.newValue = l;
  11995. this.source = n
  11996. }
  11997. __extends(a, d);
  11998. a.dispatchPropertyChangeEvent = function(b, d, e, k, f, g) {
  11999. "undefined" === typeof d && (d = null);
  12000. "undefined" === typeof e && (e = null);
  12001. "undefined" === typeof k && (k = null);
  12002. "undefined" === typeof f && (f = null);
  12003. "undefined" === typeof g && (g = null);
  12004. var l = c.Event._getPropertyData(a);
  12005. l.kind = d;
  12006. l.property = e;
  12007. l.oldValue = k;
  12008. l.newValue = f;
  12009. l.source = g;
  12010. c.Event._dispatchByTarget(a, b, a.PROPERTY_CHANGE, l)
  12011. };
  12012. a.PROPERTY_CHANGE = "propertyChange";
  12013. return a
  12014. } (c.Event);
  12015. c.PropertyChangeEvent = e
  12016. })(egret || (egret = {})); (function(c) {
  12017. var e = function() {
  12018. function c() {}
  12019. c.UPDATE = "update";
  12020. c.DELETE = "delete";
  12021. return c
  12022. } ();
  12023. c.PropertyChangeEventKind = e
  12024. })(egret || (egret = {}));
  12025. __extends = this.__extends ||
  12026. function(c, e) {
  12027. function d() {
  12028. this.constructor = c
  12029. }
  12030. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12031. d.prototype = e.prototype;
  12032. c.prototype = new d
  12033. }; (function(c) {
  12034. var e = function(d) {
  12035. function a(a, c, e, k, f) {
  12036. "undefined" === typeof c && (c = NaN);
  12037. "undefined" === typeof e && (e = NaN);
  12038. "undefined" === typeof k && (k = !1);
  12039. "undefined" === typeof f && (f = !1);
  12040. d.call(this, a, k, f);
  12041. this.oldX = c;
  12042. this.oldY = e
  12043. }
  12044. __extends(a, d);
  12045. a.dispatchMoveEvent = function(b, d, e) {
  12046. "undefined" === typeof d && (d = NaN);
  12047. "undefined" === typeof e && (e = NaN);
  12048. var k = c.Event._getPropertyData(a);
  12049. k.oldX = d;
  12050. k.oldY = e;
  12051. c.Event._dispatchByTarget(a, b, a.MOVE, k)
  12052. };
  12053. a.MOVE = "move";
  12054. return a
  12055. } (c.Event);
  12056. c.MoveEvent = e
  12057. })(egret || (egret = {}));
  12058. __extends = this.__extends ||
  12059. function(c, e) {
  12060. function d() {
  12061. this.constructor = c
  12062. }
  12063. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12064. d.prototype = e.prototype;
  12065. c.prototype = new d
  12066. }; (function(c) {
  12067. var e = function(d) {
  12068. function a(a, c, e, k, f) {
  12069. "undefined" === typeof c && (c = NaN);
  12070. "undefined" === typeof e && (e = NaN);
  12071. "undefined" === typeof k && (k = !1);
  12072. "undefined" === typeof f && (f = !1);
  12073. d.call(this, a, k, f);
  12074. this.oldWidth = c;
  12075. this.oldHeight = e
  12076. }
  12077. __extends(a, d);
  12078. a.dispatchResizeEvent = function(b, d, e) {
  12079. "undefined" === typeof d && (d = NaN);
  12080. "undefined" === typeof e && (e = NaN);
  12081. var k = c.Event._getPropertyData(a);
  12082. k.oldWidth = d;
  12083. k.oldHeight = e;
  12084. c.Event._dispatchByTarget(a, b, a.RESIZE, k)
  12085. };
  12086. a.RESIZE = "resize";
  12087. return a
  12088. } (c.Event);
  12089. c.ResizeEvent = e
  12090. })(egret || (egret = {}));
  12091. __extends = this.__extends ||
  12092. function(c, e) {
  12093. function d() {
  12094. this.constructor = c
  12095. }
  12096. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12097. d.prototype = e.prototype;
  12098. c.prototype = new d
  12099. }; (function(c) {
  12100. var e = function(d) {
  12101. function a(a, c, e, k, f) {
  12102. "undefined" === typeof c && (c = !1);
  12103. "undefined" === typeof e && (e = !1);
  12104. "undefined" === typeof k && (k = null);
  12105. "undefined" === typeof f && (f = null);
  12106. d.call(this, a, c, e);
  12107. this.partName = k;
  12108. this.instance = f
  12109. }
  12110. __extends(a, d);
  12111. a.dispatchSkinPartEvent = function(b, d, e, k) {
  12112. "undefined" === typeof e && (e = null);
  12113. "undefined" === typeof k && (k = null);
  12114. var f = c.Event._getPropertyData(a);
  12115. f.partName = e;
  12116. f.instance = k;
  12117. c.Event._dispatchByTarget(a, b, d, f)
  12118. };
  12119. a.PART_ADDED = "partAdded";
  12120. a.PART_REMOVED = "partRemoved";
  12121. return a
  12122. } (c.Event);
  12123. c.SkinPartEvent = e
  12124. })(egret || (egret = {}));
  12125. __extends = this.__extends ||
  12126. function(c, e) {
  12127. function d() {
  12128. this.constructor = c
  12129. }
  12130. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12131. d.prototype = e.prototype;
  12132. c.prototype = new d
  12133. }; (function(c) {
  12134. var e = function(d) {
  12135. function a(a, c, e, k) {
  12136. "undefined" === typeof c && (c = !1);
  12137. "undefined" === typeof e && (e = !1);
  12138. "undefined" === typeof k && (k = -1);
  12139. d.call(this, a, c, e);
  12140. this.detail = k
  12141. }
  12142. __extends(a, d);
  12143. a.dispatchCloseEvent = function(b, d, e) {
  12144. "undefined" === typeof e && (e = -1);
  12145. var k = c.Event._getPropertyData(a);
  12146. k.detail = e;
  12147. c.Event._dispatchByTarget(a, b, d, k)
  12148. };
  12149. a.CLOSE = "close";
  12150. return a
  12151. } (c.Event);
  12152. c.CloseEvent = e
  12153. })(egret || (egret = {}));
  12154. __extends = this.__extends ||
  12155. function(c, e) {
  12156. function d() {
  12157. this.constructor = c
  12158. }
  12159. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12160. d.prototype = e.prototype;
  12161. c.prototype = new d
  12162. }; (function(c) {
  12163. var e = function(d) {
  12164. function a(a, c, e, k, f, g, l, n) {
  12165. "undefined" === typeof c && (c = !1);
  12166. "undefined" === typeof e && (e = !1);
  12167. "undefined" === typeof k && (k = null);
  12168. "undefined" === typeof f && (f = -1);
  12169. "undefined" === typeof g && (g = -1);
  12170. "undefined" === typeof l && (l = null);
  12171. "undefined" === typeof n && (n = null);
  12172. d.call(this, a, c, e);
  12173. this.kind = k;
  12174. this.location = f;
  12175. this.oldLocation = g;
  12176. this.items = l ? l: [];
  12177. this.oldItems = n ? n: []
  12178. }
  12179. __extends(a, d);
  12180. a.dispatchCollectionEvent = function(b, d, e, k, f, g, l) {
  12181. "undefined" === typeof e && (e = null);
  12182. "undefined" === typeof k && (k = -1);
  12183. "undefined" === typeof f && (f = -1);
  12184. "undefined" === typeof g && (g = null);
  12185. "undefined" === typeof l && (l = null);
  12186. var n = c.Event._getPropertyData(a);
  12187. n.kind = e;
  12188. n.location = k;
  12189. n.oldLocation = f;
  12190. n.items = g;
  12191. n.oldItems = l;
  12192. c.Event._dispatchByTarget(a, b, d, n)
  12193. };
  12194. a.COLLECTION_CHANGE = "collectionChange";
  12195. return a
  12196. } (c.Event);
  12197. c.CollectionEvent = e
  12198. })(egret || (egret = {})); (function(c) {
  12199. var e = function() {
  12200. function c() {}
  12201. c.ADD = "add";
  12202. c.MOVE = "move";
  12203. c.REFRESH = "refresh";
  12204. c.REMOVE = "remove";
  12205. c.REPLACE = "replace";
  12206. c.RESET = "reset";
  12207. c.UPDATE = "update";
  12208. c.OPEN = "open";
  12209. c.CLOSE = "close";
  12210. return c
  12211. } ();
  12212. c.CollectionEventKind = e
  12213. })(egret || (egret = {}));
  12214. __extends = this.__extends ||
  12215. function(c, e) {
  12216. function d() {
  12217. this.constructor = c
  12218. }
  12219. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12220. d.prototype = e.prototype;
  12221. c.prototype = new d
  12222. }; (function(c) {
  12223. var e = function(d) {
  12224. function a(a, c, e, k, f) {
  12225. "undefined" === typeof c && (c = !1);
  12226. "undefined" === typeof e && (e = !1);
  12227. "undefined" === typeof k && (k = null);
  12228. "undefined" === typeof f && (f = -1);
  12229. d.call(this, a, c, e);
  12230. this.element = k;
  12231. this.index = f
  12232. }
  12233. __extends(a, d);
  12234. a.dispatchElementExistenceEvent = function(b, d, e, k) {
  12235. "undefined" === typeof e && (e = null);
  12236. "undefined" === typeof k && (k = -1);
  12237. var f = c.Event._getPropertyData(a);
  12238. f.element = e;
  12239. f.index = k;
  12240. c.Event._dispatchByTarget(a, b, d, f)
  12241. };
  12242. a.ELEMENT_ADD = "elementAdd";
  12243. a.ELEMENT_REMOVE = "elementRemove";
  12244. return a
  12245. } (c.Event);
  12246. c.ElementExistenceEvent = e
  12247. })(egret || (egret = {}));
  12248. __extends = this.__extends ||
  12249. function(c, e) {
  12250. function d() {
  12251. this.constructor = c
  12252. }
  12253. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12254. d.prototype = e.prototype;
  12255. c.prototype = new d
  12256. }; (function(c) {
  12257. var e = function(d) {
  12258. function a(a, c, e, k, f) {
  12259. "undefined" === typeof c && (c = !1);
  12260. "undefined" === typeof e && (e = !1);
  12261. "undefined" === typeof k && (k = -1);
  12262. "undefined" === typeof f && (f = -1);
  12263. d.call(this, a, c, e);
  12264. this.oldIndex = k;
  12265. this.newIndex = f
  12266. }
  12267. __extends(a, d);
  12268. a.dispatchIndexChangeEvent = function(b, d, e, k, f) {
  12269. "undefined" === typeof e && (e = -1);
  12270. "undefined" === typeof k && (k = -1);
  12271. "undefined" === typeof f && (f = !1);
  12272. var g = c.Event._getPropertyData(a);
  12273. g.oldIndex = e;
  12274. g.newIndex = k;
  12275. return c.Event._dispatchByTarget(a, b, d, g, !1, f)
  12276. };
  12277. a.CHANGE = "change";
  12278. a.CHANGING = "changing";
  12279. return a
  12280. } (c.Event);
  12281. c.IndexChangeEvent = e
  12282. })(egret || (egret = {}));
  12283. __extends = this.__extends ||
  12284. function(c, e) {
  12285. function d() {
  12286. this.constructor = c
  12287. }
  12288. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12289. d.prototype = e.prototype;
  12290. c.prototype = new d
  12291. }; (function(c) {
  12292. var e = function(d) {
  12293. function a(a, c, e, k, f, g, l, n, p, q, r, s, z) {
  12294. "undefined" === typeof c && (c = !0);
  12295. "undefined" === typeof e && (e = !0);
  12296. "undefined" === typeof k && (k = 0);
  12297. "undefined" === typeof f && (f = 0);
  12298. "undefined" === typeof g && (g = 0);
  12299. "undefined" === typeof l && (l = !1);
  12300. "undefined" === typeof n && (n = !1);
  12301. "undefined" === typeof p && (p = !1);
  12302. "undefined" === typeof q && (q = !1);
  12303. "undefined" === typeof r && (r = -1);
  12304. "undefined" === typeof s && (s = null);
  12305. "undefined" === typeof z && (z = null);
  12306. d.call(this, a, c, e, k, f, g, l, n, p, q);
  12307. this.itemIndex = r;
  12308. this.item = s;
  12309. this.itemRenderer = z
  12310. }
  12311. __extends(a, d);
  12312. a.dispatchListEvent = function(b, d, e, k, f, g) {
  12313. "undefined" === typeof e && (e = null);
  12314. "undefined" === typeof k && (k = -1);
  12315. "undefined" === typeof f && (f = null);
  12316. "undefined" === typeof g && (g = null);
  12317. var l = c.Event._getPropertyData(a);
  12318. l.touchPointID = e.touchPointID;
  12319. l._stageX = e.stageX;
  12320. l._stageY = e.stageY;
  12321. l.ctrlKey = e.ctrlKey;
  12322. l.altKey = e.altKey;
  12323. l.shiftKey = e.shiftKey;
  12324. l.touchDown = e.touchDown;
  12325. l.itemIndex = k;
  12326. l.item = f;
  12327. l.itemRenderer = g;
  12328. c.Event._dispatchByTarget(a, b, d, l)
  12329. };
  12330. a.ITEM_ROLL_OUT = "itemRollOut";
  12331. a.ITEM_ROLL_OVER = "itemRollOver";
  12332. a.ITEM_CLICK = "itemClick";
  12333. return a
  12334. } (c.TouchEvent);
  12335. c.ListEvent = e
  12336. })(egret || (egret = {}));
  12337. __extends = this.__extends ||
  12338. function(c, e) {
  12339. function d() {
  12340. this.constructor = c
  12341. }
  12342. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12343. d.prototype = e.prototype;
  12344. c.prototype = new d
  12345. }; (function(c) {
  12346. var e = function(d) {
  12347. function a(a, c, e, k, f) {
  12348. "undefined" === typeof c && (c = !1);
  12349. "undefined" === typeof e && (e = !1);
  12350. "undefined" === typeof k && (k = null);
  12351. "undefined" === typeof f && (f = !1);
  12352. d.call(this, a, c, e);
  12353. this.popUp = k;
  12354. this.modal = f
  12355. }
  12356. __extends(a, d);
  12357. a.dispatchPopUpEvent = function(b, d, e, k) {
  12358. "undefined" === typeof e && (e = null);
  12359. "undefined" === typeof k && (k = !1);
  12360. var f = c.Event._getPropertyData(a);
  12361. f.popUp = e;
  12362. f.modal = k;
  12363. c.Event._dispatchByTarget(a, b, d, f)
  12364. };
  12365. a.ADD_POPUP = "addPopUp";
  12366. a.REMOVE_POPUP = "removePopUp";
  12367. a.BRING_TO_FRONT = "bringToFront";
  12368. return a
  12369. } (c.Event);
  12370. c.PopUpEvent = e
  12371. })(egret || (egret = {}));
  12372. __extends = this.__extends ||
  12373. function(c, e) {
  12374. function d() {
  12375. this.constructor = c
  12376. }
  12377. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12378. d.prototype = e.prototype;
  12379. c.prototype = new d
  12380. }; (function(c) {
  12381. var e = function(d) {
  12382. function a(a, c, e, k, f, g) {
  12383. "undefined" === typeof c && (c = !1);
  12384. "undefined" === typeof e && (e = !1);
  12385. "undefined" === typeof k && (k = null);
  12386. "undefined" === typeof f && (f = -1);
  12387. "undefined" === typeof g && (g = null);
  12388. d.call(this, a, c, e);
  12389. this.renderer = k;
  12390. this.index = f;
  12391. this.data = g
  12392. }
  12393. __extends(a, d);
  12394. a.dispatchRendererExistenceEvent = function(b, d, e, k, f) {
  12395. "undefined" === typeof e && (e = null);
  12396. "undefined" === typeof k && (k = -1);
  12397. "undefined" === typeof f && (f = null);
  12398. var g = c.Event._getPropertyData(a);
  12399. g.renderer = e;
  12400. g.index = k;
  12401. g.data = f;
  12402. c.Event._dispatchByTarget(a, b, d, g)
  12403. };
  12404. a.RENDERER_ADD = "rendererAdd";
  12405. a.RENDERER_REMOVE = "rendererRemove";
  12406. return a
  12407. } (c.Event);
  12408. c.RendererExistenceEvent = e
  12409. })(egret || (egret = {}));
  12410. __extends = this.__extends ||
  12411. function(c, e) {
  12412. function d() {
  12413. this.constructor = c
  12414. }
  12415. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12416. d.prototype = e.prototype;
  12417. c.prototype = new d
  12418. }; (function(c) {
  12419. var e = function(d) {
  12420. function a(a, c, e, k, f) {
  12421. "undefined" === typeof c && (c = !1);
  12422. "undefined" === typeof e && (e = !1);
  12423. "undefined" === typeof k && (k = null);
  12424. "undefined" === typeof f && (f = null);
  12425. d.call(this, a, c, e);
  12426. this.oldState = k;
  12427. this.newState = f
  12428. }
  12429. __extends(a, d);
  12430. a.dispatchStateChangeEvent = function(b, d, e, k) {
  12431. "undefined" === typeof e && (e = null);
  12432. "undefined" === typeof k && (k = null);
  12433. var f = c.Event._getPropertyData(a);
  12434. f.oldState = e;
  12435. f.newState = k;
  12436. c.Event._dispatchByTarget(a, b, d, f)
  12437. };
  12438. a.CURRENT_STATE_CHANGE = "currentStateChange";
  12439. a.CURRENT_STATE_CHANGING = "currentStateChanging";
  12440. return a
  12441. } (c.Event);
  12442. c.StateChangeEvent = e
  12443. })(egret || (egret = {}));
  12444. __extends = this.__extends ||
  12445. function(c, e) {
  12446. function d() {
  12447. this.constructor = c
  12448. }
  12449. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12450. d.prototype = e.prototype;
  12451. c.prototype = new d
  12452. }; (function(c) {
  12453. var e = function(d) {
  12454. function a(a, c, e) {
  12455. "undefined" === typeof c && (c = !1);
  12456. "undefined" === typeof e && (e = !1);
  12457. d.call(this, a, c, e)
  12458. }
  12459. __extends(a, d);
  12460. a.dispatchTrackBaseEvent = function(b, d) {
  12461. c.Event._dispatchByTarget(a, b, d)
  12462. };
  12463. a.THUMB_DRAG = "thumbDrag";
  12464. a.THUMB_PRESS = "thumbPress";
  12465. a.THUMB_RELEASE = "thumbRelease";
  12466. return a
  12467. } (c.Event);
  12468. c.TrackBaseEvent = e
  12469. })(egret || (egret = {}));
  12470. __extends = this.__extends ||
  12471. function(c, e) {
  12472. function d() {
  12473. this.constructor = c
  12474. }
  12475. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12476. d.prototype = e.prototype;
  12477. c.prototype = new d
  12478. }; (function(c) {
  12479. var e = function(d) {
  12480. function a(a, c, e, k, f, g) {
  12481. "undefined" === typeof c && (c = !1);
  12482. "undefined" === typeof e && (e = !0);
  12483. "undefined" === typeof k && (k = -1);
  12484. "undefined" === typeof f && (f = null);
  12485. "undefined" === typeof g && (g = null);
  12486. d.call(this, a, c, e);
  12487. this.item = f;
  12488. this.itemRenderer = g;
  12489. this.itemIndex = k
  12490. }
  12491. __extends(a, d);
  12492. a.dispatchTreeEvent = function(b, d, e, k, f, g) {
  12493. "undefined" === typeof e && (e = -1);
  12494. "undefined" === typeof k && (k = null);
  12495. "undefined" === typeof f && (f = null);
  12496. "undefined" === typeof g && (g = !1);
  12497. var l = c.Event._getPropertyData(a);
  12498. l.itemIndex = e;
  12499. l.item = k;
  12500. l.itemRenderer = f;
  12501. l.opening = g;
  12502. c.Event._dispatchByTarget(a, b, d, l)
  12503. };
  12504. a.ITEM_CLOSE = "itemClose";
  12505. a.ITEM_OPEN = "itemOpen";
  12506. a.ITEM_OPENING = "itemOpening";
  12507. return a
  12508. } (c.Event);
  12509. c.TreeEvent = e
  12510. })(egret || (egret = {}));
  12511. __extends = this.__extends ||
  12512. function(c, e) {
  12513. function d() {
  12514. this.constructor = c
  12515. }
  12516. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12517. d.prototype = e.prototype;
  12518. c.prototype = new d
  12519. }; (function(c) {
  12520. var e = function(c) {
  12521. function a() {
  12522. c.call(this);
  12523. this._useVirtualLayout = !1
  12524. }
  12525. __extends(a, c);
  12526. Object.defineProperty(a.prototype, "target", {
  12527. get: function() {
  12528. return this._target
  12529. },
  12530. set: function(a) {
  12531. this._target != a && (this._target = a, this.clearVirtualLayoutCache())
  12532. },
  12533. enumerable: !0,
  12534. configurable: !0
  12535. });
  12536. Object.defineProperty(a.prototype, "useVirtualLayout", {
  12537. get: function() {
  12538. return this._useVirtualLayout
  12539. },
  12540. set: function(a) {
  12541. this._useVirtualLayout != a && (this._useVirtualLayout = a, this.dispatchEventWith("useVirtualLayoutChanged"), this._useVirtualLayout && !a && this.clearVirtualLayoutCache(), this.target && this.target.invalidateDisplayList())
  12542. },
  12543. enumerable: !0,
  12544. configurable: !0
  12545. });
  12546. Object.defineProperty(a.prototype, "typicalLayoutRect", {
  12547. get: function() {
  12548. return this._typicalLayoutRect
  12549. },
  12550. set: function(a) {
  12551. this._typicalLayoutRect != a && (this._typicalLayoutRect = a, this.target && this.target.invalidateSize())
  12552. },
  12553. enumerable: !0,
  12554. configurable: !0
  12555. });
  12556. a.prototype.scrollPositionChanged = function() {};
  12557. a.prototype.clearVirtualLayoutCache = function() {};
  12558. a.prototype.elementAdded = function(a) {};
  12559. a.prototype.elementRemoved = function(a) {};
  12560. a.prototype.measure = function() {};
  12561. a.prototype.updateDisplayList = function(a, c) {};
  12562. return a
  12563. } (c.EventDispatcher);
  12564. c.LayoutBase = e
  12565. })(egret || (egret = {}));
  12566. __extends = this.__extends ||
  12567. function(c, e) {
  12568. function d() {
  12569. this.constructor = c
  12570. }
  12571. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12572. d.prototype = e.prototype;
  12573. c.prototype = new d
  12574. }; (function(c) {
  12575. var e = function(d) {
  12576. function a() {
  12577. d.call(this);
  12578. this._mouseWheelSpeed = 20
  12579. }
  12580. __extends(a, d);
  12581. Object.defineProperty(a.prototype, "useVirtualLayout", {
  12582. set: function(a) {},
  12583. enumerable: !0,
  12584. configurable: !0
  12585. });
  12586. Object.defineProperty(a.prototype, "mouseWheelSpeed", {
  12587. get: function() {
  12588. return this._mouseWheelSpeed
  12589. },
  12590. set: function(a) {
  12591. 0 == a && (a = 1);
  12592. this._mouseWheelSpeed = a
  12593. },
  12594. enumerable: !0,
  12595. configurable: !0
  12596. });
  12597. a.prototype.getElementBoundsLeftOfScrollRect = function(a) {
  12598. var d = new c.Rectangle;
  12599. d.x = a.x - this._mouseWheelSpeed;
  12600. d.right = a.x;
  12601. return d
  12602. };
  12603. a.prototype.getElementBoundsRightOfScrollRect = function(a) {
  12604. var d = new c.Rectangle;
  12605. d.x = a.right;
  12606. d.right = a.right + this._mouseWheelSpeed;
  12607. return d
  12608. };
  12609. a.prototype.getElementBoundsAboveScrollRect = function(a) {
  12610. var d = new c.Rectangle;
  12611. d.y = a.y - this._mouseWheelSpeed;
  12612. d.bottom = a.y;
  12613. return d
  12614. };
  12615. a.prototype.getElementBoundsBelowScrollRect = function(a) {
  12616. var d = new c.Rectangle;
  12617. d.y = a.bottom;
  12618. d.bottom = a.bottom + this._mouseWheelSpeed;
  12619. return d
  12620. };
  12621. a.prototype.measure = function() {
  12622. d.prototype.measure.call(this);
  12623. if (null != this.target) {
  12624. for (var a = 0,
  12625. c = 0,
  12626. e = this.target.numElements,
  12627. k = 0; k < e; k++) {
  12628. var f = this.target.getElementAt(k);
  12629. if (f && f.includeInLayout) {
  12630. var g = f.horizontalCenter,
  12631. l = f.verticalCenter,
  12632. n = f.left,
  12633. p = f.right,
  12634. q = f.top,
  12635. r = f.bottom;
  12636. isNaN(n) || isNaN(p) ? isNaN(g) ? isNaN(n) && isNaN(p) ? g = f.preferredX: (g = isNaN(n) ? 0 : n, g += isNaN(p) ? 0 : p) : g = 2 * Math.abs(g) : g = n + p;
  12637. isNaN(q) || isNaN(r) ? isNaN(l) ? isNaN(q) && isNaN(r) ? l = f.preferredY: (l = isNaN(q) ? 0 : q, l += isNaN(r) ? 0 : r) : l = 2 * Math.abs(l) : l = q + r;
  12638. r = f.preferredHeight;
  12639. a = Math.ceil(Math.max(a, g + f.preferredWidth));
  12640. c = Math.ceil(Math.max(c, l + r))
  12641. }
  12642. }
  12643. this.target.measuredWidth = a;
  12644. this.target.measuredHeight = c
  12645. }
  12646. };
  12647. a.prototype.updateDisplayList = function(a, c) {
  12648. d.prototype.updateDisplayList.call(this, a, c);
  12649. if (null != this.target) {
  12650. for (var e = this.target.numElements,
  12651. k = 0,
  12652. f = 0,
  12653. g = 0; g < e; g++) {
  12654. var l = this.target.getElementAt(g);
  12655. if (null != l && l.includeInLayout) {
  12656. var n = l.horizontalCenter,
  12657. p = l.verticalCenter,
  12658. q = l.left,
  12659. r = l.right,
  12660. s = l.top,
  12661. z = l.bottom,
  12662. A = l.percentWidth,
  12663. v = l.percentHeight,
  12664. B = NaN,
  12665. C = NaN;
  12666. isNaN(q) || isNaN(r) ? isNaN(A) || (B = Math.round(a * Math.min(0.01 * A, 1))) : B = a - r - q;
  12667. isNaN(s) || isNaN(z) ? isNaN(v) || (C = Math.round(c * Math.min(0.01 * v, 1))) : C = c - z - s;
  12668. l.setLayoutBoundsSize(B, C);
  12669. A = l.layoutBoundsWidth;
  12670. v = l.layoutBoundsHeight;
  12671. C = B = NaN;
  12672. B = isNaN(n) ? isNaN(q) ? isNaN(r) ? l.layoutBoundsX: a - A - r: q: Math.round((a - A) / 2 + n);
  12673. C = isNaN(p) ? isNaN(s) ? isNaN(z) ? l.layoutBoundsY: c - v - z: s: Math.round((c - v) / 2 + p);
  12674. l.setLayoutBoundsPosition(B, C);
  12675. k = Math.max(k, B + A);
  12676. f = Math.max(f, C + v)
  12677. }
  12678. }
  12679. this.target.setContentSize(k, f)
  12680. }
  12681. };
  12682. return a
  12683. } (c.LayoutBase);
  12684. c.BasicLayout = e
  12685. })(egret || (egret = {})); (function(c) {
  12686. var e = function() {
  12687. function c() {}
  12688. c.LEFT = "left";
  12689. c.JUSTIFY_USING_GAP = "justifyUsingGap";
  12690. c.JUSTIFY_USING_WIDTH = "justifyUsingWidth";
  12691. return c
  12692. } ();
  12693. c.ColumnAlign = e
  12694. })(egret || (egret = {})); (function(c) {
  12695. var e = function() {
  12696. function c() {}
  12697. c.TOP = "top";
  12698. c.JUSTIFY_USING_GAP = "justifyUsingGap";
  12699. c.JUSTIFY_USING_HEIGHT = "justifyUsingHeight";
  12700. return c
  12701. } ();
  12702. c.RowAlign = e
  12703. })(egret || (egret = {})); (function(c) {
  12704. var e = function() {
  12705. function c() {}
  12706. c.ROWS = "rows";
  12707. c.COLUMNS = "columns";
  12708. return c
  12709. } ();
  12710. c.TileOrientation = e
  12711. })(egret || (egret = {}));
  12712. __extends = this.__extends ||
  12713. function(c, e) {
  12714. function d() {
  12715. this.constructor = c
  12716. }
  12717. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12718. d.prototype = e.prototype;
  12719. c.prototype = new d
  12720. }; (function(c) {
  12721. var e = function(a) {
  12722. function b() {
  12723. a.call(this);
  12724. this._horizontalAlign = c.HorizontalAlign.LEFT;
  12725. this._verticalAlign = c.VerticalAlign.TOP;
  12726. this._gap = 6;
  12727. this._padding = 0;
  12728. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  12729. this.elementSizeTable = [];
  12730. this.endIndex = this.startIndex = -1;
  12731. this.indexInViewCalculated = !1;
  12732. this.maxElementWidth = 0
  12733. }
  12734. __extends(b, a);
  12735. Object.defineProperty(b.prototype, "horizontalAlign", {
  12736. get: function() {
  12737. return this._horizontalAlign
  12738. },
  12739. set: function(a) {
  12740. this._horizontalAlign != a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  12741. },
  12742. enumerable: !0,
  12743. configurable: !0
  12744. });
  12745. Object.defineProperty(b.prototype, "verticalAlign", {
  12746. get: function() {
  12747. return this._verticalAlign
  12748. },
  12749. set: function(a) {
  12750. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  12751. },
  12752. enumerable: !0,
  12753. configurable: !0
  12754. });
  12755. Object.defineProperty(b.prototype, "gap", {
  12756. get: function() {
  12757. return this._gap
  12758. },
  12759. set: function(a) {
  12760. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  12761. },
  12762. enumerable: !0,
  12763. configurable: !0
  12764. });
  12765. Object.defineProperty(b.prototype, "padding", {
  12766. get: function() {
  12767. return this._padding
  12768. },
  12769. set: function(a) {
  12770. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  12771. },
  12772. enumerable: !0,
  12773. configurable: !0
  12774. });
  12775. Object.defineProperty(b.prototype, "paddingLeft", {
  12776. get: function() {
  12777. return this._paddingLeft
  12778. },
  12779. set: function(a) {
  12780. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  12781. },
  12782. enumerable: !0,
  12783. configurable: !0
  12784. });
  12785. Object.defineProperty(b.prototype, "paddingRight", {
  12786. get: function() {
  12787. return this._paddingRight
  12788. },
  12789. set: function(a) {
  12790. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  12791. },
  12792. enumerable: !0,
  12793. configurable: !0
  12794. });
  12795. Object.defineProperty(b.prototype, "paddingTop", {
  12796. get: function() {
  12797. return this._paddingTop
  12798. },
  12799. set: function(a) {
  12800. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  12801. },
  12802. enumerable: !0,
  12803. configurable: !0
  12804. });
  12805. Object.defineProperty(b.prototype, "paddingBottom", {
  12806. get: function() {
  12807. return this._paddingBottom
  12808. },
  12809. set: function(a) {
  12810. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  12811. },
  12812. enumerable: !0,
  12813. configurable: !0
  12814. });
  12815. b.prototype.invalidateTargetSizeAndDisplayList = function() {
  12816. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  12817. };
  12818. b.prototype.measure = function() {
  12819. a.prototype.measure.call(this);
  12820. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  12821. };
  12822. b.prototype.measureVirtual = function() {
  12823. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22, b = Math.max(this.maxElementWidth, this.typicalLayoutRect ? this.typicalLayoutRect.width: 71), c = this.getElementTotalSize(), d = this.target.getElementIndicesInView(), e = d.length, l = 0; l < e; l++) {
  12824. var n = d[l],
  12825. p = this.target.getElementAt(n);
  12826. if (null != p && p.includeInLayout) var q = p.preferredWidth,
  12827. c = c + p.preferredHeight,
  12828. c = c - (isNaN(this.elementSizeTable[n]) ? a: this.elementSizeTable[n]),
  12829. b = Math.max(b, q)
  12830. }
  12831. l = isNaN(this._padding) ? 0 : this._padding;
  12832. a = isNaN(this._paddingLeft) ? l: this._paddingLeft;
  12833. d = isNaN(this._paddingRight) ? l: this._paddingRight;
  12834. e = isNaN(this._paddingTop) ? l: this._paddingTop;
  12835. l = isNaN(this._paddingBottom) ? l: this._paddingBottom;
  12836. e += l;
  12837. this.target.measuredWidth = Math.ceil(b + (a + d));
  12838. this.target.measuredHeight = Math.ceil(c + e)
  12839. };
  12840. b.prototype.measureReal = function() {
  12841. for (var a = this.target.numElements,
  12842. b = a,
  12843. c = 0,
  12844. d = 0,
  12845. e = 0; e < a; e++) {
  12846. var l = this.target.getElementAt(e);
  12847. if (l && l.includeInLayout) var n = l.preferredWidth,
  12848. d = d + l.preferredHeight,
  12849. c = Math.max(c, n);
  12850. else b--
  12851. }
  12852. a = isNaN(this._gap) ? 0 : this._gap;
  12853. d += (b - 1) * a;
  12854. l = isNaN(this._padding) ? 0 : this._padding;
  12855. b = isNaN(this._paddingLeft) ? l: this._paddingLeft;
  12856. a = isNaN(this._paddingRight) ? l: this._paddingRight;
  12857. e = isNaN(this._paddingTop) ? l: this._paddingTop;
  12858. l = isNaN(this._paddingBottom) ? l: this._paddingBottom;
  12859. e += l;
  12860. this.target.measuredWidth = Math.ceil(c + (b + a));
  12861. this.target.measuredHeight = Math.ceil(d + e)
  12862. };
  12863. b.prototype.updateDisplayList = function(b, c) {
  12864. a.prototype.updateDisplayList.call(this, b, c);
  12865. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b, c) : this.updateDisplayListReal(b, c))
  12866. };
  12867. b.prototype.getStartPosition = function(a) {
  12868. var b = isNaN(this._padding) ? 0 : this._padding,
  12869. c = isNaN(this._paddingTop) ? b: this._paddingTop,
  12870. b = isNaN(this._gap) ? 0 : this._gap;
  12871. if (!this.useVirtualLayout) {
  12872. var d;
  12873. this.target && (d = this.target.getElementAt(a));
  12874. return d ? d.y: c
  12875. }
  12876. d = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22;
  12877. for (var e = 0; e < a; e++) {
  12878. var l = this.elementSizeTable[e];
  12879. isNaN(l) && (l = d);
  12880. c += l + b
  12881. }
  12882. return c
  12883. };
  12884. b.prototype.getElementSize = function(a) {
  12885. return this.useVirtualLayout ? (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22), a) : this.target ? this.target.getElementAt(a).height: 0
  12886. };
  12887. b.prototype.getElementTotalSize = function() {
  12888. for (var a = isNaN(this._gap) ? 0 : this._gap, b = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22, c = 0, d = this.target.numElements, e = 0; e < d; e++) {
  12889. var l = this.elementSizeTable[e];
  12890. isNaN(l) && (l = b);
  12891. c += l + a
  12892. }
  12893. return c - a
  12894. };
  12895. b.prototype.elementAdded = function(b) {
  12896. a.prototype.elementAdded.call(this, b);
  12897. this.elementSizeTable.splice(b, 0, this.typicalLayoutRect ? this.typicalLayoutRect.height: 22)
  12898. };
  12899. b.prototype.elementRemoved = function(b) {
  12900. a.prototype.elementRemoved.call(this, b);
  12901. this.elementSizeTable.splice(b, 1)
  12902. };
  12903. b.prototype.clearVirtualLayoutCache = function() {
  12904. a.prototype.clearVirtualLayoutCache.call(this);
  12905. this.elementSizeTable = [];
  12906. this.maxElementWidth = 0
  12907. };
  12908. b.prototype.findIndexAt = function(a, b, c) {
  12909. var d = Math.floor(0.5 * (b + c)),
  12910. e = this.getStartPosition(d),
  12911. l = this.getElementSize(d),
  12912. n = isNaN(this._gap) ? 0 : this._gap;
  12913. return a >= e && a < e + l + n ? d: b == c ? -1 : a < e ? this.findIndexAt(a, b, Math.max(b, d - 1)) : this.findIndexAt(a, Math.min(d + 1, c), c)
  12914. };
  12915. b.prototype.scrollPositionChanged = function() {
  12916. a.prototype.scrollPositionChanged.call(this);
  12917. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  12918. };
  12919. b.prototype.getIndexInView = function() {
  12920. if (!this.target || 0 == this.target.numElements || isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1,
  12921. !1;
  12922. var a = isNaN(this._padding) ? 0 : this._padding,
  12923. b = isNaN(this._paddingTop) ? a: this._paddingTop,
  12924. c = isNaN(this._paddingBottom) ? a: this._paddingBottom,
  12925. a = this.target.numElements,
  12926. d = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + c,
  12927. e = this.target.verticalScrollPosition;
  12928. if (e > d - c) return this.endIndex = this.startIndex = -1,
  12929. !1;
  12930. c = this.target.verticalScrollPosition + this.target.height;
  12931. if (c < b) return this.endIndex = this.startIndex = -1,
  12932. !1;
  12933. b = this.startIndex;
  12934. d = this.endIndex;
  12935. this.startIndex = this.findIndexAt(e, 0, a - 1); - 1 == this.startIndex && (this.startIndex = 0);
  12936. this.endIndex = this.findIndexAt(c, 0, a - 1); - 1 == this.endIndex && (this.endIndex = a - 1);
  12937. return b != this.startIndex || d != this.endIndex
  12938. };
  12939. b.prototype.updateDisplayListVirtual = function(a, b) {
  12940. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  12941. var d = isNaN(this._padding) ? 0 : this._padding,
  12942. e = isNaN(this._paddingLeft) ? d: this._paddingLeft,
  12943. g = isNaN(this._paddingRight) ? d: this._paddingRight,
  12944. l = isNaN(this._paddingBottom) ? d: this._paddingBottom,
  12945. n = isNaN(this._gap) ? 0 : this._gap,
  12946. p = this.target.numElements;
  12947. if ( - 1 == this.startIndex || -1 == this.endIndex) e = this.getStartPosition(p) - n + l,
  12948. this.target.setContentSize(this.target.contentWidth, Math.ceil(e));
  12949. else {
  12950. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  12951. var q = this._horizontalAlign == c.HorizontalAlign.JUSTIFY || this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  12952. r = this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  12953. s = 0;
  12954. q || (this._horizontalAlign == c.HorizontalAlign.CENTER ? s = 0.5 : this._horizontalAlign == c.HorizontalAlign.RIGHT && (s = 1));
  12955. var z = Math.max(0, a - e - g),
  12956. A = Math.ceil(z),
  12957. v,
  12958. B = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22,
  12959. d = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.width: 71, this.maxElementWidth);
  12960. if (r) {
  12961. for (var C = this.startIndex; C <= this.endIndex; C++)(v = this.target.getVirtualElementAt(C)) && v.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, v.preferredWidth));
  12962. A = Math.ceil(Math.max(z, this.maxElementWidth))
  12963. }
  12964. for (var t = 0,
  12965. u = 0,
  12966. C = 0,
  12967. D = !1,
  12968. w = this.startIndex; w <= this.endIndex; w++) if (t = 0, v = this.target.getVirtualElementAt(w)) v.includeInLayout ? (q ? (t = e, v.setLayoutBoundsSize(A, NaN)) : (t = (z - v.layoutBoundsWidth) * s, t = 0 < t ? t: 0, t = e + t), r || (this.maxElementWidth = Math.max(this.maxElementWidth, v.preferredWidth)), C = Math.max(C, v.layoutBoundsWidth), D || (u = isNaN(this.elementSizeTable[w]) ? B: this.elementSizeTable[w], u != v.layoutBoundsHeight && (D = !0)), 0 == w && 0 < this.elementSizeTable.length && this.elementSizeTable[w] != v.layoutBoundsHeight && (this.typicalLayoutRect = null), this.elementSizeTable[w] = v.layoutBoundsHeight, u = this.getStartPosition(w), v.setLayoutBoundsPosition(Math.round(t), Math.round(u))) : this.elementSizeTable[w] = 0;
  12969. C += e + g;
  12970. e = this.getStartPosition(p) - n + l;
  12971. this.target.setContentSize(Math.ceil(C), Math.ceil(e)); (D || d < this.maxElementWidth) && this.target.invalidateSize()
  12972. }
  12973. };
  12974. b.prototype.updateDisplayListReal = function(a, e) {
  12975. var k = isNaN(this._padding) ? 0 : this._padding,
  12976. f = isNaN(this._paddingLeft) ? k: this._paddingLeft,
  12977. g = isNaN(this._paddingRight) ? k: this._paddingRight,
  12978. l = isNaN(this._paddingTop) ? k: this._paddingTop,
  12979. k = isNaN(this._paddingBottom) ? k: this._paddingBottom,
  12980. n = isNaN(this._gap) ? 0 : this._gap,
  12981. p = Math.max(0, a - f - g),
  12982. q = Math.max(0, e - l - k),
  12983. r = this._verticalAlign == c.VerticalAlign.JUSTIFY,
  12984. s = this._horizontalAlign == c.HorizontalAlign.JUSTIFY || this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  12985. z = 0;
  12986. s || (this._horizontalAlign == c.HorizontalAlign.CENTER ? z = 0.5 : this._horizontalAlign == c.HorizontalAlign.RIGHT && (z = 1));
  12987. var A = this.target.numElements,
  12988. v = A,
  12989. B = f,
  12990. C = l,
  12991. t, u, D = 0,
  12992. B = 0,
  12993. w = [],
  12994. E,
  12995. x = q;
  12996. for (t = 0; t < A; t++)(u = this.target.getElementAt(t)) && u.includeInLayout ? (this.maxElementWidth = Math.max(this.maxElementWidth, u.preferredWidth), r ? D += u.preferredHeight: isNaN(u.percentHeight) ? x -= u.preferredHeight: (B += u.percentHeight, E = new d, E.layoutElement = u, E.percent = u.percentHeight, E.min = u.minHeight, E.max = u.maxHeight, w.push(E))) : v--;
  12997. var x = x - (v - 1) * n,
  12998. x = 0 < x ? x: 0,
  12999. y = q - D - n * (v - 1),
  13000. H,
  13001. L = v,
  13002. G = [];
  13003. if (r) {
  13004. if (0 > y) {
  13005. H = x / v;
  13006. for (t = 0; t < A; t++)(u = this.target.getElementAt(t)) && u.includeInLayout && (u = u.preferredHeight, u <= H && (x -= u, L--));
  13007. x = 0 < x ? x: 0
  13008. }
  13009. } else if (0 < B) {
  13010. b.flexChildrenProportionally(q, x, B, w);
  13011. q = 0;
  13012. u = w.length;
  13013. for (t = 0; t < u; t++) E = w[t],
  13014. B = Math.round(E.size + q),
  13015. q += E.size - B,
  13016. G[E.layoutElement.hashCode] = B,
  13017. x -= B;
  13018. x = 0 < x ? x: 0
  13019. }
  13020. this._verticalAlign == c.VerticalAlign.MIDDLE ? C = l + 0.5 * x: this._verticalAlign == c.VerticalAlign.BOTTOM && (C = l + x);
  13021. w = f;
  13022. u = v = 0;
  13023. E = Math.ceil(p);
  13024. this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY && (E = Math.ceil(Math.max(p, this.maxElementWidth)));
  13025. q = 0;
  13026. v = NaN;
  13027. for (t = 0; t < A; t++) B = 0,
  13028. (u = this.target.getElementAt(t)) && u.includeInLayout && (v = NaN, r ? (B = NaN, 0 < y ? B = x * u.preferredHeight / D: 0 > y && u.preferredHeight > H && (B = x / L), isNaN(B) || (v = Math.round(B + q), q += B - v)) : v = G[u.hashCode], s ? (B = f, u.setLayoutBoundsSize(E, v)) : (B = NaN, isNaN(u.percentWidth) || (B = Math.min(100, u.percentWidth), B = Math.round(p * B * 0.01)), u.setLayoutBoundsSize(B, v), B = (p - u.layoutBoundsWidth) * z, B = 0 < B ? B: 0, B = f + B), u.setLayoutBoundsPosition(Math.round(B), Math.round(C)), v = Math.ceil(u.layoutBoundsWidth), u = Math.ceil(u.layoutBoundsHeight), w = Math.max(w, B + v), l = Math.max(l, C + u), C += u + n);
  13029. this.target.setContentSize(Math.ceil(w + g), Math.ceil(l + k))
  13030. };
  13031. b.flexChildrenProportionally = function(a, b, c, d) {
  13032. var e = d.length,
  13033. l;
  13034. do {
  13035. l = !0;
  13036. var n = b - a * c / 100;
  13037. 0 < n ? b -= n: n = 0;
  13038. for (var p = b / c,
  13039. q = 0; q < e; q++) {
  13040. var r = d[q],
  13041. s = r.percent * p;
  13042. if (s < r.min) {
  13043. l = r.min;
  13044. r.size = l;
  13045. d[q] = d[--e];
  13046. d[e] = r;
  13047. c -= r.percent;
  13048. n >= l || (b -= l - n);
  13049. l = !1;
  13050. break
  13051. } else if (s > r.max) {
  13052. l = r.max;
  13053. r.size = l;
  13054. d[q] = d[--e];
  13055. d[e] = r;
  13056. c -= r.percent;
  13057. n >= l || (b -= l - n);
  13058. l = !1;
  13059. break
  13060. } else r.size = s
  13061. }
  13062. } while (! l )
  13063. };
  13064. return b
  13065. } (c.LayoutBase);
  13066. c.VerticalLayout = e;
  13067. var d = function() {
  13068. return function() {
  13069. this.size = 0
  13070. }
  13071. } ()
  13072. })(egret || (egret = {}));
  13073. __extends = this.__extends ||
  13074. function(c, e) {
  13075. function d() {
  13076. this.constructor = c
  13077. }
  13078. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  13079. d.prototype = e.prototype;
  13080. c.prototype = new d
  13081. }; (function(c) {
  13082. var e = function(a) {
  13083. function b() {
  13084. a.call(this);
  13085. this._horizontalAlign = c.HorizontalAlign.LEFT;
  13086. this._verticalAlign = c.VerticalAlign.TOP;
  13087. this._gap = 6;
  13088. this._padding = 0;
  13089. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  13090. this.elementSizeTable = [];
  13091. this.endIndex = this.startIndex = -1;
  13092. this.indexInViewCalculated = !1;
  13093. this.maxElementHeight = 0
  13094. }
  13095. __extends(b, a);
  13096. Object.defineProperty(b.prototype, "horizontalAlign", {
  13097. get: function() {
  13098. return this._horizontalAlign
  13099. },
  13100. set: function(a) {
  13101. this._horizontalAlign != a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  13102. },
  13103. enumerable: !0,
  13104. configurable: !0
  13105. });
  13106. Object.defineProperty(b.prototype, "verticalAlign", {
  13107. get: function() {
  13108. return this._verticalAlign
  13109. },
  13110. set: function(a) {
  13111. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  13112. },
  13113. enumerable: !0,
  13114. configurable: !0
  13115. });
  13116. Object.defineProperty(b.prototype, "gap", {
  13117. get: function() {
  13118. return this._gap
  13119. },
  13120. set: function(a) {
  13121. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13122. },
  13123. enumerable: !0,
  13124. configurable: !0
  13125. });
  13126. Object.defineProperty(b.prototype, "padding", {
  13127. get: function() {
  13128. return this._padding
  13129. },
  13130. set: function(a) {
  13131. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13132. },
  13133. enumerable: !0,
  13134. configurable: !0
  13135. });
  13136. Object.defineProperty(b.prototype, "paddingLeft", {
  13137. get: function() {
  13138. return this._paddingLeft
  13139. },
  13140. set: function(a) {
  13141. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13142. },
  13143. enumerable: !0,
  13144. configurable: !0
  13145. });
  13146. Object.defineProperty(b.prototype, "paddingRight", {
  13147. get: function() {
  13148. return this._paddingRight
  13149. },
  13150. set: function(a) {
  13151. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13152. },
  13153. enumerable: !0,
  13154. configurable: !0
  13155. });
  13156. Object.defineProperty(b.prototype, "paddingTop", {
  13157. get: function() {
  13158. return this._paddingTop
  13159. },
  13160. set: function(a) {
  13161. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13162. },
  13163. enumerable: !0,
  13164. configurable: !0
  13165. });
  13166. Object.defineProperty(b.prototype, "paddingBottom", {
  13167. get: function() {
  13168. return this._paddingBottom
  13169. },
  13170. set: function(a) {
  13171. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13172. },
  13173. enumerable: !0,
  13174. configurable: !0
  13175. });
  13176. b.prototype.invalidateTargetSizeAndDisplayList = function() {
  13177. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13178. };
  13179. b.prototype.measure = function() {
  13180. a.prototype.measure.call(this);
  13181. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  13182. };
  13183. b.prototype.measureVirtual = function() {
  13184. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22, b = this.typicalLayoutRect ? this.typicalLayoutRect.width: 71, c = this.getElementTotalSize(), a = Math.max(this.maxElementHeight, a), d = this.target.getElementIndicesInView(), e = d.length, l = 0; l < e; l++) {
  13185. var n = d[l],
  13186. p = this.target.getElementAt(n);
  13187. if (null != p && p.includeInLayout) var q = p.preferredHeight,
  13188. c = c + p.preferredWidth,
  13189. c = c - (isNaN(this.elementSizeTable[n]) ? b: this.elementSizeTable[n]),
  13190. a = Math.max(a, q)
  13191. }
  13192. l = isNaN(this._padding) ? 0 : this._padding;
  13193. b = isNaN(this._paddingLeft) ? l: this._paddingLeft;
  13194. d = isNaN(this._paddingRight) ? l: this._paddingRight;
  13195. e = isNaN(this._paddingTop) ? l: this._paddingTop;
  13196. l = isNaN(this._paddingBottom) ? l: this._paddingBottom;
  13197. e += l;
  13198. this.target.measuredWidth = Math.ceil(c + (b + d));
  13199. this.target.measuredHeight = Math.ceil(a + e)
  13200. };
  13201. b.prototype.measureReal = function() {
  13202. for (var a = this.target.numElements,
  13203. b = a,
  13204. c = 0,
  13205. d = 0,
  13206. e = 0; e < a; e++) {
  13207. var l = this.target.getElementAt(e);
  13208. if (l && l.includeInLayout) var n = l.preferredHeight,
  13209. c = c + l.preferredWidth,
  13210. d = Math.max(d, n);
  13211. else b--
  13212. }
  13213. a = isNaN(this._gap) ? 0 : this._gap;
  13214. c += (b - 1) * a;
  13215. l = isNaN(this._padding) ? 0 : this._padding;
  13216. b = isNaN(this._paddingLeft) ? l: this._paddingLeft;
  13217. a = isNaN(this._paddingRight) ? l: this._paddingRight;
  13218. e = isNaN(this._paddingTop) ? l: this._paddingTop;
  13219. l = isNaN(this._paddingBottom) ? l: this._paddingBottom;
  13220. e += l;
  13221. this.target.measuredWidth = Math.ceil(c + (b + a));
  13222. this.target.measuredHeight = Math.ceil(d + e)
  13223. };
  13224. b.prototype.updateDisplayList = function(b, c) {
  13225. a.prototype.updateDisplayList.call(this, b, c);
  13226. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b, c) : this.updateDisplayListReal(b, c))
  13227. };
  13228. b.prototype.getStartPosition = function(a) {
  13229. var b = isNaN(this._padding) ? 0 : this._padding,
  13230. c = isNaN(this._paddingLeft) ? b: this._paddingLeft,
  13231. b = isNaN(this._gap) ? 0 : this._gap;
  13232. if (!this.useVirtualLayout) {
  13233. var d;
  13234. this.target && (d = this.target.getElementAt(a));
  13235. return d ? d.x: c
  13236. }
  13237. d = this.typicalLayoutRect ? this.typicalLayoutRect.width: 71;
  13238. for (var e = 0; e < a; e++) {
  13239. var l = this.elementSizeTable[e];
  13240. isNaN(l) && (l = d);
  13241. c += l + b
  13242. }
  13243. return c
  13244. };
  13245. b.prototype.getElementSize = function(a) {
  13246. return this.useVirtualLayout ? (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.width: 71), a) : this.target ? this.target.getElementAt(a).width: 0
  13247. };
  13248. b.prototype.getElementTotalSize = function() {
  13249. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.width: 71, b = isNaN(this._gap) ? 0 : this._gap, c = 0, d = this.target.numElements, e = 0; e < d; e++) {
  13250. var l = this.elementSizeTable[e];
  13251. isNaN(l) && (l = a);
  13252. c += l + b
  13253. }
  13254. return c - b
  13255. };
  13256. b.prototype.elementAdded = function(b) {
  13257. this.useVirtualLayout && (a.prototype.elementAdded.call(this, b), this.elementSizeTable.splice(b, 0, this.typicalLayoutRect ? this.typicalLayoutRect.width: 71))
  13258. };
  13259. b.prototype.elementRemoved = function(b) {
  13260. this.useVirtualLayout && (a.prototype.elementRemoved.call(this, b), this.elementSizeTable.splice(b, 1))
  13261. };
  13262. b.prototype.clearVirtualLayoutCache = function() {
  13263. this.useVirtualLayout && (a.prototype.clearVirtualLayoutCache.call(this), this.elementSizeTable = [], this.maxElementHeight = 0)
  13264. };
  13265. b.prototype.findIndexAt = function(a, b, c) {
  13266. var d = Math.floor(0.5 * (b + c)),
  13267. e = this.getStartPosition(d),
  13268. l = this.getElementSize(d),
  13269. n = isNaN(this._gap) ? 0 : this._gap;
  13270. return a >= e && a < e + l + n ? d: b == c ? -1 : a < e ? this.findIndexAt(a, b, Math.max(b, d - 1)) : this.findIndexAt(a, Math.min(d + 1, c), c)
  13271. };
  13272. b.prototype.scrollPositionChanged = function() {
  13273. a.prototype.scrollPositionChanged.call(this);
  13274. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  13275. };
  13276. b.prototype.getIndexInView = function() {
  13277. if (!this.target || 0 == this.target.numElements || isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1,
  13278. !1;
  13279. var a = isNaN(this._padding) ? 0 : this._padding,
  13280. b = isNaN(this._paddingLeft) ? a: this._paddingLeft,
  13281. c = isNaN(this._paddingRight) ? a: this._paddingRight;
  13282. isNaN(this._paddingTop);
  13283. isNaN(this._paddingBottom);
  13284. var a = this.target.numElements,
  13285. d = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + c,
  13286. e = this.target.horizontalScrollPosition;
  13287. if (e > d - c) return this.endIndex = this.startIndex = -1,
  13288. !1;
  13289. c = this.target.horizontalScrollPosition + this.target.width;
  13290. if (c < b) return this.endIndex = this.startIndex = -1,
  13291. !1;
  13292. b = this.startIndex;
  13293. d = this.endIndex;
  13294. this.startIndex = this.findIndexAt(e, 0, a - 1); - 1 == this.startIndex && (this.startIndex = 0);
  13295. this.endIndex = this.findIndexAt(c, 0, a - 1); - 1 == this.endIndex && (this.endIndex = a - 1);
  13296. return b != this.startIndex || d != this.endIndex
  13297. };
  13298. b.prototype.updateDisplayListVirtual = function(a, b) {
  13299. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  13300. var d = isNaN(this._padding) ? 0 : this._padding,
  13301. e = isNaN(this._paddingRight) ? d: this._paddingRight,
  13302. g = isNaN(this._paddingTop) ? d: this._paddingTop,
  13303. l = isNaN(this._paddingBottom) ? d: this._paddingBottom,
  13304. n = isNaN(this._gap) ? 0 : this._gap,
  13305. p = this.target.numElements;
  13306. if ( - 1 == this.startIndex || -1 == this.endIndex) e = this.getStartPosition(p) - n + e,
  13307. this.target.setContentSize(Math.ceil(e), this.target.contentHeight);
  13308. else {
  13309. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  13310. var q = this._verticalAlign == c.VerticalAlign.JUSTIFY || this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13311. r = this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13312. s = 0;
  13313. q || (this._verticalAlign == c.VerticalAlign.MIDDLE ? s = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (s = 1));
  13314. var z = Math.max(0, b - g - l),
  13315. A = Math.ceil(z),
  13316. v,
  13317. B = this.typicalLayoutRect ? this.typicalLayoutRect.width: 71,
  13318. d = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.height: 22, this.maxElementHeight);
  13319. if (r) {
  13320. for (var C = this.startIndex; C <= this.endIndex; C++)(v = this.target.getVirtualElementAt(C)) && v.includeInLayout && (this.maxElementHeight = Math.max(this.maxElementHeight, v.preferredHeight));
  13321. A = Math.ceil(Math.max(z, this.maxElementHeight))
  13322. }
  13323. for (var t = 0,
  13324. u = 0,
  13325. C = 0,
  13326. D = !1,
  13327. w = this.startIndex; w <= this.endIndex; w++) if (u = 0, v = this.target.getVirtualElementAt(w)) v.includeInLayout ? (q ? (u = g, v.setLayoutBoundsSize(NaN, A)) : (u = (z - v.layoutBoundsHeight) * s, u = 0 < u ? u: 0, u = g + u), r || (this.maxElementHeight = Math.max(this.maxElementHeight, v.preferredHeight)), C = Math.max(C, v.layoutBoundsHeight), D || (t = isNaN(this.elementSizeTable[w]) ? B: this.elementSizeTable[w], t != v.layoutBoundsWidth && (D = !0)), 0 == w && 0 < this.elementSizeTable.length && this.elementSizeTable[w] != v.layoutBoundsWidth && (this.typicalLayoutRect = null), this.elementSizeTable[w] = v.layoutBoundsWidth, t = this.getStartPosition(w), v.setLayoutBoundsPosition(Math.round(t), Math.round(u))) : this.elementSizeTable[w] = 0;
  13328. C += g + l;
  13329. e = this.getStartPosition(p) - n + e;
  13330. this.target.setContentSize(Math.ceil(e), Math.ceil(C)); (D || d < this.maxElementHeight) && this.target.invalidateSize()
  13331. }
  13332. };
  13333. b.prototype.updateDisplayListReal = function(a, e) {
  13334. var k = isNaN(this._padding) ? 0 : this._padding,
  13335. f = isNaN(this._paddingLeft) ? k: this._paddingLeft,
  13336. g = isNaN(this._paddingRight) ? k: this._paddingRight,
  13337. l = isNaN(this._paddingTop) ? k: this._paddingTop,
  13338. k = isNaN(this._paddingBottom) ? k: this._paddingBottom,
  13339. n = isNaN(this._gap) ? 0 : this._gap,
  13340. p = Math.max(0, a - f - g),
  13341. q = Math.max(0, e - l - k),
  13342. r = this._horizontalAlign == c.HorizontalAlign.JUSTIFY,
  13343. s = this._verticalAlign == c.VerticalAlign.JUSTIFY || this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13344. z = 0;
  13345. s || (this._verticalAlign == c.VerticalAlign.MIDDLE ? z = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (z = 1));
  13346. var A = this.target.numElements,
  13347. v = A,
  13348. B = f,
  13349. C = l,
  13350. t, u, D = 0,
  13351. C = 0,
  13352. w = [],
  13353. E,
  13354. x = p;
  13355. for (t = 0; t < A; t++)(u = this.target.getElementAt(t)) && u.includeInLayout ? (this.maxElementHeight = Math.max(this.maxElementHeight, u.preferredHeight), r ? D += u.preferredWidth: isNaN(u.percentWidth) ? x -= u.preferredWidth: (C += u.percentWidth, E = new d, E.layoutElement = u, E.percent = u.percentWidth, E.min = u.minWidth, E.max = u.maxWidth, w.push(E))) : v--;
  13356. var x = x - n * (v - 1),
  13357. x = 0 < x ? x: 0,
  13358. y = p - D - n * (v - 1),
  13359. H,
  13360. L = v,
  13361. G = [];
  13362. if (r) {
  13363. if (0 > y) {
  13364. H = x / v;
  13365. for (t = 0; t < A; t++)(u = this.target.getElementAt(t)) && u.includeInLayout && (u = u.preferredWidth, u <= H && (x -= u, L--));
  13366. x = 0 < x ? x: 0
  13367. }
  13368. } else if (0 < C) {
  13369. b.flexChildrenProportionally(p, x, C, w);
  13370. p = 0;
  13371. u = w.length;
  13372. for (t = 0; t < u; t++) E = w[t],
  13373. C = Math.round(E.size + p),
  13374. p += E.size - C,
  13375. G[E.layoutElement.hashCode] = C,
  13376. x -= C;
  13377. x = 0 < x ? x: 0
  13378. }
  13379. this._horizontalAlign == c.HorizontalAlign.CENTER ? B = f + 0.5 * x: this._horizontalAlign == c.HorizontalAlign.RIGHT && (B = f + x);
  13380. w = l;
  13381. u = v = 0;
  13382. E = Math.ceil(q);
  13383. this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY && (E = Math.ceil(Math.max(q, this.maxElementHeight)));
  13384. for (t = p = 0; t < A; t++) C = 0,
  13385. (u = this.target.getElementAt(t)) && u.includeInLayout && (v = NaN, r ? (C = NaN, 0 < y ? C = x * u.preferredWidth / D: 0 > y && u.preferredWidth > H && (C = x / L), isNaN(C) || (v = Math.round(C + p), p += C - v)) : v = G[u.hashCode], s ? (C = l, u.setLayoutBoundsSize(v, E)) : (C = NaN, isNaN(u.percentHeight) || (C = Math.min(100, u.percentHeight), C = Math.round(q * C * 0.01)), u.setLayoutBoundsSize(v, C), C = (q - u.layoutBoundsHeight) * z, C = 0 < C ? C: 0, C = l + C), u.setLayoutBoundsPosition(Math.round(B), Math.round(C)), v = Math.ceil(u.layoutBoundsWidth), u = Math.ceil(u.layoutBoundsHeight), f = Math.max(f, B + v), w = Math.max(w, C + u), B += v + n);
  13386. this.target.setContentSize(Math.ceil(f + g), Math.ceil(w + k))
  13387. };
  13388. b.flexChildrenProportionally = function(a, b, c, d) {
  13389. var e = d.length,
  13390. l;
  13391. do {
  13392. l = !0;
  13393. var n = b - a * c / 100;
  13394. 0 < n ? b -= n: n = 0;
  13395. for (var p = b / c,
  13396. q = 0; q < e; q++) {
  13397. var r = d[q],
  13398. s = r.percent * p;
  13399. if (s < r.min) {
  13400. l = r.min;
  13401. r.size = l;
  13402. d[q] = d[--e];
  13403. d[e] = r;
  13404. c -= r.percent;
  13405. n >= l || (b -= l - n);
  13406. l = !1;
  13407. break
  13408. } else if (s > r.max) {
  13409. l = r.max;
  13410. r.size = l;
  13411. d[q] = d[--e];
  13412. d[e] = r;
  13413. c -= r.percent;
  13414. n >= l || (b -= l - n);
  13415. l = !1;
  13416. break
  13417. } else r.size = s
  13418. }
  13419. } while (! l )
  13420. };
  13421. return b
  13422. } (c.LayoutBase);
  13423. c.HorizontalLayout = e;
  13424. var d = function() {
  13425. return function() {
  13426. this.size = 0
  13427. }
  13428. } ()
  13429. })(egret || (egret = {}));
  13430. __extends = this.__extends ||
  13431. function(c, e) {
  13432. function d() {
  13433. this.constructor = c
  13434. }
  13435. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  13436. d.prototype = e.prototype;
  13437. c.prototype = new d
  13438. }; (function(c) {
  13439. var e = function(d) {
  13440. function a() {
  13441. d.call(this);
  13442. this.explicitHorizontalGap = NaN;
  13443. this._horizontalGap = 6;
  13444. this.explicitVerticalGap = NaN;
  13445. this._verticalGap = 6;
  13446. this._columnCount = -1;
  13447. this._requestedColumnCount = 0;
  13448. this._rowCount = -1;
  13449. this._requestedRowCount = 0;
  13450. this._rowHeight = this.explicitRowHeight = this._columnWidth = this.explicitColumnWidth = NaN;
  13451. this._padding = 0;
  13452. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  13453. this._horizontalAlign = c.HorizontalAlign.JUSTIFY;
  13454. this._verticalAlign = c.VerticalAlign.JUSTIFY;
  13455. this._columnAlign = c.ColumnAlign.LEFT;
  13456. this._rowAlign = c.RowAlign.TOP;
  13457. this._orientation = c.TileOrientation.ROWS;
  13458. this.maxElementHeight = this.maxElementWidth = 0;
  13459. this.endIndex = this.startIndex = -1;
  13460. this.indexInViewCalculated = !1
  13461. }
  13462. __extends(a, d);
  13463. Object.defineProperty(a.prototype, "horizontalGap", {
  13464. get: function() {
  13465. return this._horizontalGap
  13466. },
  13467. set: function(a) {
  13468. a != this._horizontalGap && (this._horizontalGap = this.explicitHorizontalGap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13469. },
  13470. enumerable: !0,
  13471. configurable: !0
  13472. });
  13473. Object.defineProperty(a.prototype, "verticalGap", {
  13474. get: function() {
  13475. return this._verticalGap
  13476. },
  13477. set: function(a) {
  13478. a != this._verticalGap && (this._verticalGap = this.explicitVerticalGap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13479. },
  13480. enumerable: !0,
  13481. configurable: !0
  13482. });
  13483. Object.defineProperty(a.prototype, "columnCount", {
  13484. get: function() {
  13485. return this._columnCount
  13486. },
  13487. enumerable: !0,
  13488. configurable: !0
  13489. });
  13490. Object.defineProperty(a.prototype, "requestedColumnCount", {
  13491. get: function() {
  13492. return this._requestedColumnCount
  13493. },
  13494. set: function(a) {
  13495. this._requestedColumnCount != a && (this._columnCount = this._requestedColumnCount = a, this.invalidateTargetSizeAndDisplayList())
  13496. },
  13497. enumerable: !0,
  13498. configurable: !0
  13499. });
  13500. Object.defineProperty(a.prototype, "rowCount", {
  13501. get: function() {
  13502. return this._rowCount
  13503. },
  13504. enumerable: !0,
  13505. configurable: !0
  13506. });
  13507. Object.defineProperty(a.prototype, "requestedRowCount", {
  13508. get: function() {
  13509. return this._requestedRowCount
  13510. },
  13511. set: function(a) {
  13512. this._requestedRowCount != a && (this._rowCount = this._requestedRowCount = a, this.invalidateTargetSizeAndDisplayList())
  13513. },
  13514. enumerable: !0,
  13515. configurable: !0
  13516. });
  13517. Object.defineProperty(a.prototype, "columnWidth", {
  13518. get: function() {
  13519. return this._columnWidth
  13520. },
  13521. set: function(a) {
  13522. a != this._columnWidth && (this._columnWidth = this.explicitColumnWidth = a, this.invalidateTargetSizeAndDisplayList())
  13523. },
  13524. enumerable: !0,
  13525. configurable: !0
  13526. });
  13527. Object.defineProperty(a.prototype, "rowHeight", {
  13528. get: function() {
  13529. return this._rowHeight
  13530. },
  13531. set: function(a) {
  13532. a != this._rowHeight && (this._rowHeight = this.explicitRowHeight = a, this.invalidateTargetSizeAndDisplayList())
  13533. },
  13534. enumerable: !0,
  13535. configurable: !0
  13536. });
  13537. Object.defineProperty(a.prototype, "padding", {
  13538. get: function() {
  13539. return this._padding
  13540. },
  13541. set: function(a) {
  13542. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13543. },
  13544. enumerable: !0,
  13545. configurable: !0
  13546. });
  13547. Object.defineProperty(a.prototype, "paddingLeft", {
  13548. get: function() {
  13549. return this._paddingLeft
  13550. },
  13551. set: function(a) {
  13552. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13553. },
  13554. enumerable: !0,
  13555. configurable: !0
  13556. });
  13557. Object.defineProperty(a.prototype, "paddingRight", {
  13558. get: function() {
  13559. return this._paddingRight
  13560. },
  13561. set: function(a) {
  13562. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13563. },
  13564. enumerable: !0,
  13565. configurable: !0
  13566. });
  13567. Object.defineProperty(a.prototype, "paddingTop", {
  13568. get: function() {
  13569. return this._paddingTop
  13570. },
  13571. set: function(a) {
  13572. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13573. },
  13574. enumerable: !0,
  13575. configurable: !0
  13576. });
  13577. Object.defineProperty(a.prototype, "paddingBottom", {
  13578. get: function() {
  13579. return this._paddingBottom
  13580. },
  13581. set: function(a) {
  13582. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13583. },
  13584. enumerable: !0,
  13585. configurable: !0
  13586. });
  13587. Object.defineProperty(a.prototype, "horizontalAlign", {
  13588. get: function() {
  13589. return this._horizontalAlign
  13590. },
  13591. set: function(a) {
  13592. this._horizontalAlign != a && (this._horizontalAlign = a, this.invalidateTargetSizeAndDisplayList())
  13593. },
  13594. enumerable: !0,
  13595. configurable: !0
  13596. });
  13597. Object.defineProperty(a.prototype, "verticalAlign", {
  13598. get: function() {
  13599. return this._verticalAlign
  13600. },
  13601. set: function(a) {
  13602. this._verticalAlign != a && (this._verticalAlign = a, this.invalidateTargetSizeAndDisplayList())
  13603. },
  13604. enumerable: !0,
  13605. configurable: !0
  13606. });
  13607. Object.defineProperty(a.prototype, "columnAlign", {
  13608. get: function() {
  13609. return this._columnAlign
  13610. },
  13611. set: function(a) {
  13612. this._columnAlign != a && (this._columnAlign = a, this.invalidateTargetSizeAndDisplayList())
  13613. },
  13614. enumerable: !0,
  13615. configurable: !0
  13616. });
  13617. Object.defineProperty(a.prototype, "rowAlign", {
  13618. get: function() {
  13619. return this._rowAlign
  13620. },
  13621. set: function(a) {
  13622. this._rowAlign != a && (this._rowAlign = a, this.invalidateTargetSizeAndDisplayList())
  13623. },
  13624. enumerable: !0,
  13625. configurable: !0
  13626. });
  13627. Object.defineProperty(a.prototype, "orientation", {
  13628. get: function() {
  13629. return this._orientation
  13630. },
  13631. set: function(a) {
  13632. this._orientation != a && (this._orientation = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("orientationChanged") && this.dispatchEventWith("orientationChanged"))
  13633. },
  13634. enumerable: !0,
  13635. configurable: !0
  13636. });
  13637. a.prototype.invalidateTargetSizeAndDisplayList = function() {
  13638. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13639. };
  13640. a.prototype.measure = function() {
  13641. if (this.target) {
  13642. var a = this._columnCount,
  13643. c = this._rowCount,
  13644. d = this._columnWidth,
  13645. e = this._rowHeight,
  13646. f = 0,
  13647. g = 0;
  13648. this.calculateRowAndColumn(this.target.explicitWidth, this.target.explicitHeight);
  13649. var l = 0 < this._requestedColumnCount ? this._requestedColumnCount: this._columnCount,
  13650. n = 0 < this._requestedRowCount ? this._requestedRowCount: this._rowCount,
  13651. p = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13652. q = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13653. 0 < l && (f = l * (this._columnWidth + p) - p);
  13654. 0 < n && (g = n * (this._rowHeight + q) - q);
  13655. q = isNaN(this._padding) ? 0 : this._padding;
  13656. l = isNaN(this._paddingLeft) ? q: this._paddingLeft;
  13657. n = isNaN(this._paddingRight) ? q: this._paddingRight;
  13658. p = isNaN(this._paddingTop) ? q: this._paddingTop;
  13659. q = isNaN(this._paddingBottom) ? q: this._paddingBottom;
  13660. p += q;
  13661. this.target.measuredWidth = Math.ceil(f + (l + n));
  13662. this.target.measuredHeight = Math.ceil(g + p);
  13663. this._columnCount = a;
  13664. this._rowCount = c;
  13665. this._columnWidth = d;
  13666. this._rowHeight = e
  13667. }
  13668. };
  13669. a.prototype.calculateRowAndColumn = function(a, d) {
  13670. var e = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13671. k = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13672. this._rowCount = this._columnCount = -1;
  13673. for (var f = this.target.numElements,
  13674. g = f,
  13675. l = 0; l < g; l++) {
  13676. var n = this.target.getElementAt(l);
  13677. n && !n.includeInLayout && f--
  13678. }
  13679. if (0 == f) this._rowCount = this._columnCount = 0;
  13680. else { (isNaN(this.explicitColumnWidth) || isNaN(this.explicitRowHeight)) && this.updateMaxElementSize();
  13681. isNaN(this.explicitColumnWidth) ? this._columnWidth = this.maxElementWidth: this._columnWidth = this.explicitColumnWidth;
  13682. isNaN(this.explicitRowHeight) ? this._rowHeight = this.maxElementHeight: this._rowHeight = this.explicitRowHeight;
  13683. g = this._columnWidth + e;
  13684. 0 >= g && (g = 1);
  13685. l = this._rowHeight + k;
  13686. 0 >= l && (l = 1);
  13687. var n = this.orientation == c.TileOrientation.COLUMNS,
  13688. p = !isNaN(a),
  13689. q = !isNaN(d),
  13690. r = isNaN(this._padding) ? 0 : this._padding,
  13691. s = isNaN(this._paddingLeft) ? r: this._paddingLeft,
  13692. z = isNaN(this._paddingRight) ? r: this._paddingRight,
  13693. A = isNaN(this._paddingTop) ? r: this._paddingTop,
  13694. r = isNaN(this._paddingBottom) ? r: this._paddingBottom;
  13695. 0 < this._requestedColumnCount || 0 < this._requestedRowCount ? (0 < this._requestedRowCount && (this._rowCount = Math.min(this._requestedRowCount, f)), 0 < this._requestedColumnCount && (this._columnCount = Math.min(this._requestedColumnCount, f))) : p || q ? !p || q && n ? (e = Math.max(0, d - A - r), this._rowCount = Math.floor((e + k) / l), this._rowCount = Math.max(1, Math.min(this._rowCount, f))) : (k = Math.max(0, a - s - z), this._columnCount = Math.floor((k + e) / g), this._columnCount = Math.max(1, Math.min(this._columnCount, f))) : (e = Math.sqrt(f * g * l), n ? this._rowCount = Math.max(1, Math.round(e / l)) : this._columnCount = Math.max(1, Math.round(e / g))); - 1 == this._rowCount && (this._rowCount = Math.max(1, Math.ceil(f / this._columnCount))); - 1 == this._columnCount && (this._columnCount = Math.max(1, Math.ceil(f / this._rowCount)));
  13696. 0 < this._requestedColumnCount && 0 < this._requestedRowCount && (this.orientation == c.TileOrientation.ROWS ? this._rowCount = Math.max(1, Math.ceil(f / this._requestedColumnCount)) : this._columnCount = Math.max(1, Math.ceil(f / this._requestedRowCount)))
  13697. }
  13698. };
  13699. a.prototype.updateMaxElementSize = function() {
  13700. this.target && (this.useVirtualLayout ? this.updateMaxElementSizeVirtual() : this.updateMaxElementSizeReal())
  13701. };
  13702. a.prototype.updateMaxElementSizeVirtual = function() {
  13703. var a = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22;
  13704. this.maxElementWidth = Math.max(this.maxElementWidth, this.typicalLayoutRect ? this.typicalLayoutRect.width: 22);
  13705. this.maxElementHeight = Math.max(this.maxElementHeight, a);
  13706. if ( - 1 != this.startIndex && -1 != this.endIndex) for (a = this.startIndex; a <= this.endIndex; a++) {
  13707. var c = this.target.getVirtualElementAt(a);
  13708. c && c.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, c.preferredWidth), this.maxElementHeight = Math.max(this.maxElementHeight, c.preferredHeight))
  13709. }
  13710. };
  13711. a.prototype.updateMaxElementSizeReal = function() {
  13712. for (var a = this.target.numElements,
  13713. c = 0; c < a; c++) {
  13714. var d = this.target.getElementAt(c);
  13715. d && d.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, d.preferredWidth), this.maxElementHeight = Math.max(this.maxElementHeight, d.preferredHeight))
  13716. }
  13717. };
  13718. a.prototype.clearVirtualLayoutCache = function() {
  13719. d.prototype.clearVirtualLayoutCache.call(this);
  13720. this.maxElementHeight = this.maxElementWidth = 0
  13721. };
  13722. a.prototype.scrollPositionChanged = function() {
  13723. d.prototype.scrollPositionChanged.call(this);
  13724. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  13725. };
  13726. a.prototype.getIndexInView = function() {
  13727. if (!this.target || 0 == this.target.numElements) return this.startIndex = this.endIndex = -1,
  13728. !1;
  13729. var a = this.target.numElements;
  13730. if (!this.useVirtualLayout) return this.startIndex = 0,
  13731. this.endIndex = a - 1,
  13732. !1;
  13733. if (isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1,
  13734. !1;
  13735. var d = this.startIndex,
  13736. e = this.endIndex,
  13737. k = isNaN(this._padding) ? 0 : this._padding,
  13738. f = isNaN(this._paddingLeft) ? k: this._paddingLeft,
  13739. k = isNaN(this._paddingTop) ? k: this._paddingTop,
  13740. g = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13741. l = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13742. if (this.orientation == c.TileOrientation.COLUMNS) {
  13743. g = this._columnWidth + g;
  13744. if (0 >= g) return this.startIndex = 0,
  13745. this.endIndex = a - 1,
  13746. !1;
  13747. l = this.target.horizontalScrollPosition + this.target.width;
  13748. k = Math.floor((this.target.horizontalScrollPosition - f) / g);
  13749. 0 > k && (k = 0);
  13750. f = Math.ceil((l - f) / g);
  13751. 0 > f && (f = 0);
  13752. this.startIndex = Math.min(a - 1, Math.max(0, k * this._rowCount));
  13753. this.endIndex = Math.min(a - 1, Math.max(0, f * this._rowCount - 1))
  13754. } else {
  13755. g = this._rowHeight + l;
  13756. if (0 >= g) return this.startIndex = 0,
  13757. this.endIndex = a - 1,
  13758. !1;
  13759. l = this.target.verticalScrollPosition + this.target.height;
  13760. f = Math.floor((this.target.verticalScrollPosition - k) / g);
  13761. 0 > f && (f = 0);
  13762. k = Math.ceil((l - k) / g);
  13763. 0 > k && (k = 0);
  13764. this.startIndex = Math.min(a - 1, Math.max(0, f * this._columnCount));
  13765. this.endIndex = Math.min(a - 1, Math.max(0, k * this._columnCount - 1))
  13766. }
  13767. return this.startIndex != d || this.endIndex != e
  13768. };
  13769. a.prototype.updateDisplayList = function(a, e) {
  13770. d.prototype.updateDisplayList.call(this, a, e);
  13771. if (this.target) {
  13772. var m = isNaN(this._padding) ? 0 : this._padding,
  13773. k = isNaN(this._paddingLeft) ? m: this._paddingLeft,
  13774. f = isNaN(this._paddingRight) ? m: this._paddingRight,
  13775. g = isNaN(this._paddingTop) ? m: this._paddingTop,
  13776. l = isNaN(this._paddingBottom) ? m: this._paddingBottom,
  13777. m = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13778. n = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13779. if (this.indexInViewCalculated) this.indexInViewCalculated = !1;
  13780. else {
  13781. this.calculateRowAndColumn(a, e);
  13782. if (0 == this._rowCount || 0 == this._columnCount) {
  13783. this.target.setContentSize(k + f, g + l);
  13784. return
  13785. }
  13786. this.adjustForJustify(a, e);
  13787. this.getIndexInView()
  13788. }
  13789. this.useVirtualLayout && (this.calculateRowAndColumn(a, e), this.adjustForJustify(a, e));
  13790. if ( - 1 == this.startIndex || -1 == this.endIndex) this.target.setContentSize(0, 0);
  13791. else {
  13792. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  13793. for (var p, q, r, s = this.orientation == c.TileOrientation.COLUMNS,
  13794. z = this.startIndex,
  13795. A = this.startIndex; A <= this.endIndex; A++) p = this.useVirtualLayout ? this.target.getVirtualElementAt(A) : this.target.getElementAt(A),
  13796. null != p && p.includeInLayout && (s ? (q = Math.ceil((z + 1) / this._rowCount) - 1, r = Math.ceil((z + 1) % this._rowCount) - 1, -1 == r && (r = this._rowCount - 1)) : (q = Math.ceil((z + 1) % this._columnCount) - 1, -1 == q && (q = this._columnCount - 1), r = Math.ceil((z + 1) / this._columnCount) - 1), q = q * (this._columnWidth + m) + k, r = r * (this._rowHeight + n) + g, this.sizeAndPositionElement(p, q, r, this._columnWidth, this.rowHeight), z++);
  13797. g += l;
  13798. n = (this._rowHeight + n) * this._rowCount - n;
  13799. this.target.setContentSize(Math.ceil((this._columnWidth + m) * this._columnCount - m + (k + f)), Math.ceil(n + g))
  13800. }
  13801. }
  13802. };
  13803. a.prototype.sizeAndPositionElement = function(a, d, e, k, f) {
  13804. var g = NaN,
  13805. l = NaN;
  13806. this.horizontalAlign == c.HorizontalAlign.JUSTIFY ? g = k: isNaN(a.percentWidth) || (g = k * a.percentWidth * 0.01);
  13807. this.verticalAlign == c.VerticalAlign.JUSTIFY ? l = f: isNaN(a.percentHeight) || (l = f * a.percentHeight * 0.01);
  13808. a.setLayoutBoundsSize(Math.round(g), Math.round(l));
  13809. g = d;
  13810. switch (this.horizontalAlign) {
  13811. case c.HorizontalAlign.RIGHT:
  13812. g += k - a.layoutBoundsWidth;
  13813. break;
  13814. case c.HorizontalAlign.CENTER:
  13815. g = d + (k - a.layoutBoundsWidth) / 2
  13816. }
  13817. d = e;
  13818. switch (this.verticalAlign) {
  13819. case c.VerticalAlign.BOTTOM:
  13820. d += f - a.layoutBoundsHeight;
  13821. break;
  13822. case c.VerticalAlign.MIDDLE:
  13823. d += (f - a.layoutBoundsHeight) / 2
  13824. }
  13825. a.setLayoutBoundsPosition(Math.round(g), Math.round(d))
  13826. };
  13827. a.prototype.adjustForJustify = function(a, d) {
  13828. var e = isNaN(this._padding) ? 0 : this._padding,
  13829. k = isNaN(this._paddingLeft) ? e: this._paddingLeft,
  13830. f = isNaN(this._paddingRight) ? e: this._paddingRight,
  13831. g = isNaN(this._paddingTop) ? e: this._paddingTop,
  13832. e = isNaN(this._paddingBottom) ? e: this._paddingBottom,
  13833. k = Math.max(0, a - k - f),
  13834. g = Math.max(0, d - g - e);
  13835. isNaN(this.explicitVerticalGap) || (this._verticalGap = this.explicitVerticalGap);
  13836. isNaN(this.explicitHorizontalGap) || (this._horizontalGap = this.explicitHorizontalGap);
  13837. this._verticalGap = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13838. this._horizontalGap = isNaN(this._horizontalGap) ? 0 : this._horizontalGap;
  13839. g -= this._rowHeight * this._rowCount;
  13840. k -= this._columnWidth * this._columnCount;
  13841. 0 < g && (this.rowAlign == c.RowAlign.JUSTIFY_USING_GAP ? (f = Math.max(1, this._rowCount - 1), this._verticalGap = g / f) : this.rowAlign == c.RowAlign.JUSTIFY_USING_HEIGHT && 0 < this._rowCount && (this._rowHeight += (g - (this._rowCount - 1) * this._verticalGap) / this._rowCount));
  13842. 0 < k && (this.columnAlign == c.ColumnAlign.JUSTIFY_USING_GAP ? (f = Math.max(1, this._columnCount - 1), this._horizontalGap = k / f) : this.columnAlign == c.ColumnAlign.JUSTIFY_USING_WIDTH && 0 < this._columnCount && (this._columnWidth += (k - (this._columnCount - 1) * this._horizontalGap) / this._columnCount))
  13843. };
  13844. return a
  13845. } (c.LayoutBase);
  13846. c.TileLayout = e
  13847. })(egret || (egret = {})); (function(c) {
  13848. var e = function() {
  13849. function c(a, b, d) {
  13850. this.raw_getElementAt = "raw_getElementAt";
  13851. this.raw_addElementAt = "raw_addElementAt";
  13852. this.raw_getElementIndex = "raw_getElementIndex";
  13853. this.raw_removeElement = "raw_removeElement";
  13854. this.raw_removeElementAt = "raw_removeElementAt";
  13855. this.raw_setElementIndex = "raw_setElementIndex";
  13856. this.owner = a;
  13857. this.lowerBoundReference = b;
  13858. this.upperBoundReference = d
  13859. }
  13860. Object.defineProperty(c.prototype, "numElements", {
  13861. get: function() {
  13862. return this.owner[this.upperBoundReference] - this.owner[this.lowerBoundReference]
  13863. },
  13864. enumerable: !0,
  13865. configurable: !0
  13866. });
  13867. c.prototype.getElementAt = function(a) {
  13868. return this.owner[this.raw_getElementAt](this.owner[this.lowerBoundReference] + a)
  13869. };
  13870. c.prototype.addElement = function(a) {
  13871. var b = this.owner[this.upperBoundReference];
  13872. a.parent === this.owner && b--;
  13873. this.owner[this.upperBoundReference]++;
  13874. this.owner[this.raw_addElementAt](a, b);
  13875. a.ownerChanged(this);
  13876. return a
  13877. };
  13878. c.prototype.addElementAt = function(a, b) {
  13879. this.owner[this.upperBoundReference]++;
  13880. this.owner[this.raw_addElementAt](a, this.owner[this.lowerBoundReference] + b);
  13881. a.ownerChanged(this);
  13882. return a
  13883. };
  13884. c.prototype.removeElement = function(a) {
  13885. var b = this.owner[this.raw_getElementIndex](a);
  13886. this.owner[this.lowerBoundReference] <= b && b < this.owner[this.upperBoundReference] && (this.owner[this.raw_removeElement](a), this.owner[this.upperBoundReference]--);
  13887. a.ownerChanged(null);
  13888. return a
  13889. };
  13890. c.prototype.removeElementAt = function(a) {
  13891. a += this.owner[this.lowerBoundReference];
  13892. var b;
  13893. this.owner[this.lowerBoundReference] <= a && a < this.owner[this.upperBoundReference] && (b = this.owner[this.raw_removeElementAt](a), this.owner[this.upperBoundReference]--);
  13894. b.ownerChanged(null);
  13895. return b
  13896. };
  13897. c.prototype.getElementIndex = function(a) {
  13898. a = this.owner[this.raw_getElementIndex](a);
  13899. return a -= this.owner[this.lowerBoundReference]
  13900. };
  13901. c.prototype.setElementIndex = function(a, b) {
  13902. this.owner[this.raw_setElementIndex](a, this.owner[this.lowerBoundReference] + b)
  13903. };
  13904. return c
  13905. } ();
  13906. c.UILayer = e
  13907. })(egret || (egret = {}));
  13908. __extends = this.__extends ||
  13909. function(c, e) {
  13910. function d() {
  13911. this.constructor = c
  13912. }
  13913. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  13914. d.prototype = e.prototype;
  13915. c.prototype = new d
  13916. }; (function(c) {
  13917. var e = function(d) {
  13918. function a() {
  13919. d.call(this);
  13920. this._autoResize = !0;
  13921. this._cursorIndex = this._toolTipIndex = this._topMostIndex = this._noTopMostIndex = 0;
  13922. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  13923. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this)
  13924. }
  13925. __extends(a, d);
  13926. a.prototype.onAddToStage = function(a) {
  13927. if (c.UIGlobals._uiStage) throw Error("UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01");
  13928. c.UIGlobals._uiStage = this;
  13929. this._autoResize && (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize())
  13930. };
  13931. a.prototype.onRemoveFromStage = function(a) {
  13932. c.UIGlobals._uiStage = null;
  13933. this._autoResize && this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)
  13934. };
  13935. a.prototype.onResize = function(a) {
  13936. this._setWidth(this.stage.stageWidth);
  13937. this._setHeight(this.stage.stageHeight)
  13938. };
  13939. Object.defineProperty(a.prototype, "autoResize", {
  13940. get: function() {
  13941. return this._autoResize
  13942. },
  13943. set: function(a) {
  13944. this._autoResize != a && (this._autoResize = a, this.stage && (this._autoResize ? (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize()) : this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)))
  13945. },
  13946. enumerable: !0,
  13947. configurable: !0
  13948. });
  13949. Object.defineProperty(a.prototype, "x", {
  13950. get: function() {
  13951. return this._x
  13952. },
  13953. set: function(a) {
  13954. this._autoResize || (this._x = a)
  13955. },
  13956. enumerable: !0,
  13957. configurable: !0
  13958. });
  13959. Object.defineProperty(a.prototype, "y", {
  13960. get: function() {
  13961. return this._y
  13962. },
  13963. set: function(a) {
  13964. this._autoResize || (this._y = a)
  13965. },
  13966. enumerable: !0,
  13967. configurable: !0
  13968. });
  13969. Object.defineProperty(a.prototype, "width", {
  13970. get: function() {
  13971. return this._width
  13972. },
  13973. set: function(a) {
  13974. this._autoResize || this._setWidth(a)
  13975. },
  13976. enumerable: !0,
  13977. configurable: !0
  13978. });
  13979. Object.defineProperty(a.prototype, "height", {
  13980. get: function() {
  13981. return this._height
  13982. },
  13983. set: function(a) {
  13984. this._autoResize || this._setHeight(a)
  13985. },
  13986. enumerable: !0,
  13987. configurable: !0
  13988. });
  13989. Object.defineProperty(a.prototype, "scaleX", {
  13990. get: function() {
  13991. return this._scaleX
  13992. },
  13993. set: function(a) {
  13994. this._autoResize || this._setScaleX(a)
  13995. },
  13996. enumerable: !0,
  13997. configurable: !0
  13998. });
  13999. Object.defineProperty(a.prototype, "scaleY", {
  14000. get: function() {
  14001. return this._scaleY
  14002. },
  14003. set: function(a) {
  14004. this._autoResize || this._setScaleY(a)
  14005. },
  14006. enumerable: !0,
  14007. configurable: !0
  14008. });
  14009. a.prototype.setActualSize = function(a, c) {
  14010. this._autoResize || d.prototype.setActualSize.call(this, a, c)
  14011. };
  14012. a.prototype.setLayoutBoundsPosition = function(a, c) {
  14013. this._autoResize || d.prototype.setLayoutBoundsPosition.call(this, a, c)
  14014. };
  14015. a.prototype.setLayoutBoundsSize = function(a, c) {
  14016. this._autoResize || d.prototype.setLayoutBoundsSize.call(this, a, c)
  14017. };
  14018. Object.defineProperty(a.prototype, "layout", {
  14019. get: function() {
  14020. return this._layout
  14021. },
  14022. set: function(a) {
  14023. a instanceof c.BasicLayout && this._setLayout(a)
  14024. },
  14025. enumerable: !0,
  14026. configurable: !0
  14027. });
  14028. Object.defineProperty(a.prototype, "popUpContainer", {
  14029. get: function() {
  14030. this._popUpContainer || (this._popUpContainer = new c.UILayer(this, "noTopMostIndex", "topMostIndex"));
  14031. return this._popUpContainer
  14032. },
  14033. enumerable: !0,
  14034. configurable: !0
  14035. });
  14036. Object.defineProperty(a.prototype, "toolTipContainer", {
  14037. get: function() {
  14038. this._toolTipContainer || (this._toolTipContainer = new c.UILayer(this, "topMostIndex", "toolTipIndex"));
  14039. return this._toolTipContainer
  14040. },
  14041. enumerable: !0,
  14042. configurable: !0
  14043. });
  14044. Object.defineProperty(a.prototype, "cursorContainer", {
  14045. get: function() {
  14046. this._cursorContainer || (this._cursorContainer = new c.UILayer(this, "toolTipIndex", "cursorIndex"));
  14047. return this._cursorContainer
  14048. },
  14049. enumerable: !0,
  14050. configurable: !0
  14051. });
  14052. Object.defineProperty(a.prototype, "noTopMostIndex", {
  14053. get: function() {
  14054. return this._noTopMostIndex
  14055. },
  14056. set: function(a) {
  14057. var c = a - this._noTopMostIndex;
  14058. this._noTopMostIndex = a;
  14059. this.topMostIndex += c
  14060. },
  14061. enumerable: !0,
  14062. configurable: !0
  14063. });
  14064. Object.defineProperty(a.prototype, "topMostIndex", {
  14065. get: function() {
  14066. return this._topMostIndex
  14067. },
  14068. set: function(a) {
  14069. var c = a - this._topMostIndex;
  14070. this._topMostIndex = a;
  14071. this.toolTipIndex += c
  14072. },
  14073. enumerable: !0,
  14074. configurable: !0
  14075. });
  14076. Object.defineProperty(a.prototype, "toolTipIndex", {
  14077. get: function() {
  14078. return this._toolTipIndex
  14079. },
  14080. set: function(a) {
  14081. var c = a - this._toolTipIndex;
  14082. this._toolTipIndex = a;
  14083. this.cursorIndex += c
  14084. },
  14085. enumerable: !0,
  14086. configurable: !0
  14087. });
  14088. Object.defineProperty(a.prototype, "cursorIndex", {
  14089. get: function() {
  14090. return this._cursorIndex
  14091. },
  14092. set: function(a) {
  14093. this._cursorIndex = a
  14094. },
  14095. enumerable: !0,
  14096. configurable: !0
  14097. });
  14098. a.prototype.addElement = function(a) {
  14099. var c = this._noTopMostIndex;
  14100. a.parent == this && c--;
  14101. return this.addElementAt(a, c)
  14102. };
  14103. a.prototype.addElementAt = function(a, c) {
  14104. if (a.parent == this) {
  14105. var e = this.getElementIndex(a);
  14106. e < this._noTopMostIndex ? this.noTopMostIndex--:e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex--:e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex--:this.cursorIndex--
  14107. }
  14108. c <= this._noTopMostIndex ? this.noTopMostIndex++:c > this._noTopMostIndex && c <= this._topMostIndex ? this.topMostIndex++:c > this._topMostIndex && c <= this._toolTipIndex ? this.toolTipIndex++:this.cursorIndex++;
  14109. return d.prototype.addElementAt.call(this, a, c)
  14110. };
  14111. a.prototype.removeElement = function(a) {
  14112. return this.removeElementAt(d.prototype.getElementIndex.call(this, a))
  14113. };
  14114. a.prototype.removeElementAt = function(a) {
  14115. var c = d.prototype.removeElementAt.call(this, a);
  14116. a < this._noTopMostIndex ? this.noTopMostIndex--:a >= this._noTopMostIndex && a < this._topMostIndex ? this.topMostIndex--:a >= this._topMostIndex && a < this._toolTipIndex ? this.toolTipIndex--:this.cursorIndex--;
  14117. return c
  14118. };
  14119. a.prototype.removeAllElements = function() {
  14120. for (; 0 < this._noTopMostIndex;) d.prototype.removeElementAt.call(this, 0),
  14121. this.noTopMostIndex--
  14122. };
  14123. a.prototype._elementRemoved = function(a, e, m) {
  14124. "undefined" === typeof m && (m = !0);
  14125. m && c.Event.dispatchEvent(a, "removeFromUIStage");
  14126. d.prototype._elementRemoved.call(this, a, e, m)
  14127. };
  14128. a.prototype.raw_getElementAt = function(a) {
  14129. return d.prototype.getElementAt.call(this, a)
  14130. };
  14131. a.prototype.raw_addElement = function(a) {
  14132. var c = this.numElements;
  14133. a.parent == this && c--;
  14134. return this.raw_addElementAt(a, c)
  14135. };
  14136. a.prototype.raw_addElementAt = function(a, c) {
  14137. if (a.parent == this) {
  14138. var e = this.getElementIndex(a);
  14139. e < this._noTopMostIndex ? this.noTopMostIndex--:e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex--:e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex--:this.cursorIndex--
  14140. }
  14141. return d.prototype.addElementAt.call(this, a, c)
  14142. };
  14143. a.prototype.raw_removeElement = function(a) {
  14144. return d.prototype.removeElementAt.call(this, d.prototype.getElementIndex.call(this, a))
  14145. };
  14146. a.prototype.raw_removeElementAt = function(a) {
  14147. return d.prototype.removeElementAt.call(this, a)
  14148. };
  14149. a.prototype.raw_removeAllElements = function() {
  14150. for (; 0 < this.numElements;) d.prototype.removeElementAt.call(this, 0)
  14151. };
  14152. a.prototype.raw_getElementIndex = function(a) {
  14153. return d.prototype.getElementIndex.call(this, a)
  14154. };
  14155. a.prototype.raw_setElementIndex = function(a, c) {
  14156. d.prototype.setElementIndex.call(this, a, c)
  14157. };
  14158. a.prototype.raw_swapElements = function(a, c) {
  14159. d.prototype.swapElementsAt.call(this, d.prototype.getElementIndex.call(this, a), d.prototype.getElementIndex.call(this, c))
  14160. };
  14161. a.prototype.raw_swapElementsAt = function(a, c) {
  14162. d.prototype.swapElementsAt.call(this, a, c)
  14163. };
  14164. return a
  14165. } (c.Group);
  14166. c.UIStage = e
  14167. })(egret || (egret = {}));
  14168. __extends = this.__extends ||
  14169. function(c, e) {
  14170. function d() {
  14171. this.constructor = c
  14172. }
  14173. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14174. d.prototype = e.prototype;
  14175. c.prototype = new d
  14176. }; (function(c) {
  14177. var e = function(a) {
  14178. function b() {
  14179. a.call(this);
  14180. this._popUpList = [];
  14181. this.popUpDataList = [];
  14182. this._modalColor = 0;
  14183. this._modalAlpha = 0.5;
  14184. this.invalidateModalFlag = !1
  14185. }
  14186. __extends(b, a);
  14187. Object.defineProperty(b.prototype, "popUpList", {
  14188. get: function() {
  14189. return this._popUpList.concat()
  14190. },
  14191. enumerable: !0,
  14192. configurable: !0
  14193. });
  14194. b.prototype.findPopUpData = function(a) {
  14195. for (var b = this.popUpDataList,
  14196. c = b.length,
  14197. d = 0; d < c; d++) {
  14198. var e = b[d];
  14199. if (e.popUp == a) return e
  14200. }
  14201. return null
  14202. };
  14203. b.prototype.addPopUp = function(a, e, k) {
  14204. "undefined" === typeof e && (e = !1);
  14205. "undefined" === typeof k && (k = !0);
  14206. var f = c.UIGlobals.uiStage,
  14207. g = this.findPopUpData(a);
  14208. g ? (g.modal = e, a.removeEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this)) : (g = new d(a, e), this.popUpDataList.push(g), this._popUpList.push(a));
  14209. f.popUpContainer.addElement(a);
  14210. k && this.centerPopUp(a);
  14211. "isPopUp" in a && (a.isPopUp = !0);
  14212. e && this.invalidateModal();
  14213. a.addEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this)
  14214. };
  14215. b.prototype.onRemoved = function(a) {
  14216. for (var c = 0,
  14217. d = this.popUpDataList,
  14218. e = d.length,
  14219. g = 0; g < e; g++) {
  14220. var l = d[g];
  14221. if (l.popUp == a.target) {
  14222. "isPopUp" in l.popUp && (l.popUp.isPopUp = !1);
  14223. l.popUp.removeEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this);
  14224. this.popUpDataList.splice(c, 1);
  14225. this._popUpList.splice(c, 1);
  14226. this.invalidateModal();
  14227. break
  14228. }
  14229. c++
  14230. }
  14231. };
  14232. Object.defineProperty(b.prototype, "modalColor", {
  14233. get: function() {
  14234. return this._modalColor
  14235. },
  14236. set: function(a) {
  14237. this._modalColor != a && (this._modalColor = a, this.invalidateModal())
  14238. },
  14239. enumerable: !0,
  14240. configurable: !0
  14241. });
  14242. Object.defineProperty(b.prototype, "modalAlpha", {
  14243. get: function() {
  14244. return this._modalAlpha
  14245. },
  14246. set: function(a) {
  14247. this._modalAlpha != a && (this._modalAlpha = a, this.invalidateModal())
  14248. },
  14249. enumerable: !0,
  14250. configurable: !0
  14251. });
  14252. b.prototype.invalidateModal = function() {
  14253. this.invalidateModalFlag || (this.invalidateModalFlag = !0, c.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.validateModal, this), c.UIGlobals.stage.addEventListener(c.Event.RENDER, this.validateModal, this), c.UIGlobals.stage.invalidate())
  14254. };
  14255. b.prototype.validateModal = function(a) {
  14256. this.invalidateModalFlag = !1;
  14257. c.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME, this.validateModal, this);
  14258. c.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.validateModal, this);
  14259. this.updateModal(c.UIGlobals.uiStage)
  14260. };
  14261. b.prototype.updateModal = function(a) {
  14262. for (var b = a.popUpContainer,
  14263. d = !1,
  14264. e = b.numElements - 1; 0 <= e; e--) {
  14265. var g = b.getElementAt(e);
  14266. if ((g = this.findPopUpData(g)) && g.modal) {
  14267. d = !0;
  14268. break
  14269. }
  14270. }
  14271. d ? (this.modalMask || (this.modalMask = new c.Rect, this.modalMask.touchEnabled = !0, this.modalMask.top = this.modalMask.left = this.modalMask.right = this.modalMask.bottom = 0), this.modalMask.fillColor = this._modalColor, this.modalMask.alpha = this._modalAlpha, this.modalMask.parent == a ? (b.getElementIndex(this.modalMask) < e && e--, b.setElementIndex(this.modalMask, e)) : b.addElementAt(this.modalMask, e)) : this.modalMask && this.modalMask.parent == a && b.removeElement(this.modalMask)
  14272. };
  14273. b.prototype.removePopUp = function(a) {
  14274. a && a.parent && this.findPopUpData(a) && ("removeElement" in a.parent ? a.parent.removeElement(a) : a.parent instanceof c.UIComponent ? a.parent._removeFromDisplayList(a) : a instanceof c.DisplayObject && a.parent.removeChild(a))
  14275. };
  14276. b.prototype.centerPopUp = function(a) {
  14277. a.top = a.bottom = a.left = a.right = NaN;
  14278. a.verticalCenter = a.horizontalCenter = 0;
  14279. var b = a.parent;
  14280. b && ("validateNow" in a && a.validateNow(), a.x = 0.5 * (b.width - a.layoutBoundsWidth), a.y = 0.5 * (b.height - a.layoutBoundsHeight))
  14281. };
  14282. b.prototype.bringToFront = function(a) {
  14283. if (this.findPopUpData(a) && a.parent && "popUpContainer" in a.parent) {
  14284. var b = a.parent;
  14285. b.popUpContainer.setElementIndex(a, b.popUpContainer.numElements - 1);
  14286. this.invalidateModal()
  14287. }
  14288. };
  14289. b.REMOVE_FROM_UISTAGE = "removeFromUIStage";
  14290. return b
  14291. } (c.EventDispatcher);
  14292. c.PopUpManagerImpl = e;
  14293. var d = function() {
  14294. return function(a, b) {
  14295. this.popUp = a;
  14296. this.modal = b
  14297. }
  14298. } ()
  14299. })(egret || (egret = {})); (function(c) {
  14300. var e = function() {
  14301. function d() {}
  14302. d.getImpl = function() {
  14303. if (!d._impl) try {
  14304. d._impl = c.Injector.getInstance("egret.IPopUpManager")
  14305. } catch(a) {
  14306. d._impl = new c.PopUpManagerImpl
  14307. }
  14308. return d._impl
  14309. };
  14310. Object.defineProperty(d.prototype, "modalColor", {
  14311. get: function() {
  14312. return d.getImpl().modalColor
  14313. },
  14314. set: function(a) {
  14315. d.getImpl().modalColor = a
  14316. },
  14317. enumerable: !0,
  14318. configurable: !0
  14319. });
  14320. Object.defineProperty(d.prototype, "modalAlpha", {
  14321. get: function() {
  14322. return d.getImpl().modalAlpha
  14323. },
  14324. set: function(a) {
  14325. d.getImpl().modalAlpha = a
  14326. },
  14327. enumerable: !0,
  14328. configurable: !0
  14329. });
  14330. d.addPopUp = function(a, b, e) {
  14331. "undefined" === typeof b && (b = !1);
  14332. "undefined" === typeof e && (e = !0);
  14333. d.getImpl().addPopUp(a, b, e);
  14334. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.ADD_POPUP, a, b)
  14335. };
  14336. d.removePopUp = function(a) {
  14337. d.getImpl().removePopUp(a);
  14338. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.REMOVE_POPUP, a)
  14339. };
  14340. d.centerPopUp = function(a) {
  14341. d.getImpl().centerPopUp(a)
  14342. };
  14343. d.bringToFront = function(a) {
  14344. d.getImpl().bringToFront(a);
  14345. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.BRING_TO_FRONT, a)
  14346. };
  14347. Object.defineProperty(d, "popUpList", {
  14348. get: function() {
  14349. return d.getImpl().popUpList
  14350. },
  14351. enumerable: !0,
  14352. configurable: !0
  14353. });
  14354. d.addEventListener = function(a, b, c, e, k) {
  14355. "undefined" === typeof e && (e = !1);
  14356. "undefined" === typeof k && (k = 0);
  14357. d.getImpl().addEventListener(a, b, this, e, k)
  14358. };
  14359. d.removeEventListener = function(a, b, c, e) {
  14360. "undefined" === typeof e && (e = !1);
  14361. d.getImpl().removeEventListener(a, b, c, e)
  14362. };
  14363. return d
  14364. } ();
  14365. c.PopUpManager = e
  14366. })(egret || (egret = {}));
  14367. var __extends = this.__extends ||
  14368. function(c, e) {
  14369. function d() {
  14370. this.constructor = c
  14371. }
  14372. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14373. d.prototype = e.prototype;
  14374. c.prototype = new d
  14375. },
  14376. dragonBones; (function(c) { (function(a) {
  14377. var b = function() {
  14378. function a(b, c) {
  14379. "undefined" === typeof b && (b = 0);
  14380. "undefined" === typeof c && (c = 0);
  14381. this.x = b;
  14382. this.y = c
  14383. }
  14384. a.prototype.toString = function() {
  14385. return "[Point (x=" + this.x + " y=" + this.y + ")]"
  14386. };
  14387. return a
  14388. } ();
  14389. a.Point = b;
  14390. b = function() {
  14391. return function(a, b, c, d) {
  14392. "undefined" === typeof a && (a = 0);
  14393. "undefined" === typeof b && (b = 0);
  14394. "undefined" === typeof c && (c = 0);
  14395. "undefined" === typeof d && (d = 0);
  14396. this.x = a;
  14397. this.y = b;
  14398. this.width = c;
  14399. this.height = d
  14400. }
  14401. } ();
  14402. a.Rectangle = b;
  14403. b = function() {
  14404. function a() {
  14405. this.a = 1;
  14406. this.c = this.b = 0;
  14407. this.d = 1;
  14408. this.ty = this.tx = 0
  14409. }
  14410. a.prototype.invert = function() {
  14411. var a = this.a,
  14412. b = this.b,
  14413. c = this.c,
  14414. d = this.d,
  14415. e = this.tx,
  14416. h = a * d - b * c;
  14417. this.a = d / h;
  14418. this.b = -b / h;
  14419. this.c = -c / h;
  14420. this.d = a / h;
  14421. this.tx = (c * this.ty - d * e) / h;
  14422. this.ty = -(a * this.ty - b * e) / h
  14423. };
  14424. return a
  14425. } ();
  14426. a.Matrix = b;
  14427. b = function() {
  14428. return function() {
  14429. this.redOffset = this.redMultiplier = this.greenOffset = this.greenMultiplier = this.blueOffset = this.blueMultiplier = this.alphaOffset = this.alphaMultiplier = 0
  14430. }
  14431. } ();
  14432. a.ColorTransform = b
  14433. })(c.geom || (c.geom = {}));
  14434. var e = c.geom; (function(a) {
  14435. var b = function() {
  14436. return function(a) {
  14437. this.type = a
  14438. }
  14439. } ();
  14440. a.Event = b;
  14441. var c = function(a) {
  14442. function b(c) {
  14443. a.call(this, c)
  14444. }
  14445. __extends(b, a);
  14446. b.FADE_IN = "fadeIn";
  14447. b.FADE_OUT = "fadeOut";
  14448. b.START = "start";
  14449. b.COMPLETE = "complete";
  14450. b.LOOP_COMPLETE = "loopComplete";
  14451. b.FADE_IN_COMPLETE = "fadeInComplete";
  14452. b.FADE_OUT_COMPLETE = "fadeOutComplete";
  14453. return b
  14454. } (b);
  14455. a.AnimationEvent = c;
  14456. c = function(a) {
  14457. function b(c) {
  14458. a.call(this, c)
  14459. }
  14460. __extends(b, a);
  14461. b.Z_ORDER_UPDATED = "zOrderUpdated";
  14462. return b
  14463. } (b);
  14464. a.ArmatureEvent = c;
  14465. c = function(a) {
  14466. function b(c) {
  14467. a.call(this, c)
  14468. }
  14469. __extends(b, a);
  14470. b.ANIMATION_FRAME_EVENT = "animationFrameEvent";
  14471. b.BONE_FRAME_EVENT = "boneFrameEvent";
  14472. return b
  14473. } (b);
  14474. a.FrameEvent = c;
  14475. b = function(a) {
  14476. function b(c) {
  14477. a.call(this, c)
  14478. }
  14479. __extends(b, a);
  14480. b.SOUND = "sound";
  14481. b.BONE_FRAME_EVENT = "boneFrameEvent";
  14482. return b
  14483. } (b);
  14484. a.SoundEvent = b;
  14485. b = function() {
  14486. function a() {}
  14487. a.prototype.hasEventListener = function(a) {
  14488. return this._listenersMap && this._listenersMap[a] ? !0 : !1
  14489. };
  14490. a.prototype.addEventListener = function(a, b) {
  14491. if (a && b) {
  14492. this._listenersMap || (this._listenersMap = {});
  14493. var c = this._listenersMap[a];
  14494. c && this.removeEventListener(a, b);
  14495. c ? c.push(b) : this._listenersMap[a] = [b]
  14496. }
  14497. };
  14498. a.prototype.removeEventListener = function(a, b) {
  14499. if (this._listenersMap && a && b) {
  14500. var c = this._listenersMap[a];
  14501. if (c) for (var d = c.length,
  14502. e = 0; e < d; e++) c[e] == b && (1 == d ? (c.length = 0, delete this._listenersMap[a]) : c.splice(e, 1))
  14503. }
  14504. };
  14505. a.prototype.removeAllEventListeners = function(a) {
  14506. a ? delete this._listenersMap[a] : this._listenersMap = null
  14507. };
  14508. a.prototype.dispatchEvent = function(a) {
  14509. if (a) {
  14510. var b = this._listenersMap[a.type];
  14511. if (b) {
  14512. a.target = this;
  14513. for (var c = b.concat(), b = b.length, d = 0; d < b; d++) c[d](a)
  14514. }
  14515. }
  14516. };
  14517. return a
  14518. } ();
  14519. a.EventDispatcher = b;
  14520. b = function(a) {
  14521. function b() {
  14522. a.call(this);
  14523. if (b._instance) throw Error("Singleton already constructed!");
  14524. }
  14525. __extends(b, a);
  14526. b.getInstance = function() {
  14527. b._instance || (b._instance = new b);
  14528. return b._instance
  14529. };
  14530. return b
  14531. } (b);
  14532. a.SoundEventManager = b
  14533. })(c.events || (c.events = {}));
  14534. var d = c.events; (function(a) {
  14535. var c = function() {
  14536. function a() {
  14537. this.timeScale = 1;
  14538. this.time = 0.001 * (new Date).getTime();
  14539. this._animatableList = []
  14540. }
  14541. a.prototype.contains = function(a) {
  14542. return 0 <= this._animatableList.indexOf(a)
  14543. };
  14544. a.prototype.add = function(a) {
  14545. a && -1 == this._animatableList.indexOf(a) && this._animatableList.push(a)
  14546. };
  14547. a.prototype.remove = function(a) {
  14548. a = this._animatableList.indexOf(a);
  14549. 0 <= a && (this._animatableList[a] = null)
  14550. };
  14551. a.prototype.clear = function() {
  14552. this._animatableList.length = 0
  14553. };
  14554. a.prototype.advanceTime = function(a) {
  14555. if (0 > a) {
  14556. var b = 0.001 * (new Date).getTime();
  14557. a = b - this.time;
  14558. this.time = b
  14559. }
  14560. a *= this.timeScale;
  14561. b = this._animatableList.length;
  14562. if (0 != b) {
  14563. for (var c = 0,
  14564. d = 0; d < b; d++) {
  14565. var e = this._animatableList[d];
  14566. e && (c != d && (this._animatableList[c] = e, this._animatableList[d] = null), e.advanceTime(a), c++)
  14567. }
  14568. if (c != d) {
  14569. for (b = this._animatableList.length; d < b;) this._animatableList[c++] = this._animatableList[d++];
  14570. this._animatableList.length = c
  14571. }
  14572. }
  14573. };
  14574. a.clock = new a;
  14575. return a
  14576. } ();
  14577. a.WorldClock = c;
  14578. var f = function() {
  14579. function a() {
  14580. this.transform = new b.DBTransform;
  14581. this.pivot = new e.Point;
  14582. this._durationTransform = new b.DBTransform;
  14583. this._durationPivot = new e.Point;
  14584. this._durationColor = new e.ColorTransform
  14585. }
  14586. a._borrowObject = function() {
  14587. return 0 == a._pool.length ? new a: a._pool.pop()
  14588. };
  14589. a._returnObject = function(b) {
  14590. 0 > a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  14591. b.clear()
  14592. };
  14593. a._clear = function() {
  14594. for (var b = a._pool.length; b--;) a._pool[b].clear();
  14595. a._pool.length = 0
  14596. };
  14597. a.getEaseValue = function(b, c) {
  14598. if (1 < c) {
  14599. var d = 0.5 * (1 - Math.cos(b * Math.PI)) - b;
  14600. c -= 1
  14601. } else 0 < c ? d = Math.sin(b * a.HALF_PI) - b: 0 > c && (d = 1 - Math.cos(b * a.HALF_PI) - b, c *= -1);
  14602. return d * c + b
  14603. };
  14604. a.prototype.fadeIn = function(a, b, c) {
  14605. this._bone = a;
  14606. this._animationState = b;
  14607. this._timeline = c;
  14608. this._originTransform = this._timeline.originTransform;
  14609. this._originPivot = this._timeline.originPivot;
  14610. this._tweenColor = this._tweenTransform = !1;
  14611. this._totalTime = this._animationState.totalTime;
  14612. this.transform.x = 0;
  14613. this.transform.y = 0;
  14614. this.transform.scaleX = 0;
  14615. this.transform.scaleY = 0;
  14616. this.transform.skewX = 0;
  14617. this.transform.skewY = 0;
  14618. this.pivot.x = 0;
  14619. this.pivot.y = 0;
  14620. this._durationTransform.x = 0;
  14621. this._durationTransform.y = 0;
  14622. this._durationTransform.scaleX = 0;
  14623. this._durationTransform.scaleY = 0;
  14624. this._durationTransform.skewX = 0;
  14625. this._durationTransform.skewY = 0;
  14626. this._durationPivot.x = 0;
  14627. this._durationPivot.y = 0;
  14628. this._currentFrame = null;
  14629. switch (this._timeline.getFrameList().length) {
  14630. case 0:
  14631. this._bone._arriveAtFrame(null, this, this._animationState, !1);
  14632. this._updateState = 0;
  14633. break;
  14634. case 1:
  14635. this._updateState = -1;
  14636. break;
  14637. default:
  14638. this._updateState = 1
  14639. }
  14640. };
  14641. a.prototype.fadeOut = function() {
  14642. this.transform.skewX = h.TransformUtil.formatRadian(this.transform.skewX);
  14643. this.transform.skewY = h.TransformUtil.formatRadian(this.transform.skewY)
  14644. };
  14645. a.prototype.update = function(b) {
  14646. if (this._updateState) if (0 < this._updateState) {
  14647. b = 0 == this._timeline.scale ? 1 : b / this._timeline.scale;
  14648. 1 == b && (b = 0.99999999);
  14649. b += this._timeline.offset;
  14650. var c = Math.floor(b);
  14651. b -= c;
  14652. for (var d = this._totalTime * b,
  14653. e = !1,
  14654. f; ! this._currentFrame || d > this._currentFramePosition + this._currentFrameDuration || d < this._currentFramePosition;) e && this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !0),
  14655. e = !0,
  14656. this._currentFrame ? (f = this._timeline.getFrameList().indexOf(this._currentFrame) + 1, f >= this._timeline.getFrameList().length && (f = 0), this._currentFrame = this._timeline.getFrameList()[f]) : (f = 0, this._currentFrame = this._timeline.getFrameList()[0]),
  14657. this._currentFrameDuration = this._currentFrame.duration,
  14658. this._currentFramePosition = this._currentFrame.position;
  14659. e && (this.tweenActive = 0 <= this._currentFrame.displayIndex, f++, f >= this._timeline.getFrameList().length && (f = 0), e = this._timeline.getFrameList()[f], 0 == f && this._animationState.loop && this._animationState.loopCount >= Math.abs(this._animationState.loop) - 1 && 0.99999999 < ((this._currentFramePosition + this._currentFrameDuration) / this._totalTime + c - this._timeline.offset) * this._timeline.scale ? (this._updateState = 0, this._tweenEasing = NaN) : 0 > this._currentFrame.displayIndex || 0 > e.displayIndex || !this._animationState.tweenEnabled ? this._tweenEasing = NaN: isNaN(this._animationState.clip.tweenEasing) ? this._tweenEasing = this._currentFrame.tweenEasing: this._tweenEasing = this._animationState.clip.tweenEasing, isNaN(this._tweenEasing) ? this._tweenColor = this._tweenTransform = !1 : (this._durationTransform.x = e.transform.x - this._currentFrame.transform.x, this._durationTransform.y = e.transform.y - this._currentFrame.transform.y, this._durationTransform.skewX = e.transform.skewX - this._currentFrame.transform.skewX, this._durationTransform.skewY = e.transform.skewY - this._currentFrame.transform.skewY, this._durationTransform.scaleX = e.transform.scaleX - this._currentFrame.transform.scaleX, this._durationTransform.scaleY = e.transform.scaleY - this._currentFrame.transform.scaleY, 0 == f && (this._durationTransform.skewX = h.TransformUtil.formatRadian(this._durationTransform.skewX), this._durationTransform.skewY = h.TransformUtil.formatRadian(this._durationTransform.skewY)), this._durationPivot.x = e.pivot.x - this._currentFrame.pivot.x, this._durationPivot.y = e.pivot.y - this._currentFrame.pivot.y, this._tweenTransform = 0 != this._durationTransform.x || 0 != this._durationTransform.y || 0 != this._durationTransform.skewX || 0 != this._durationTransform.skewY || 0 != this._durationTransform.scaleX || 0 != this._durationTransform.scaleY || 0 != this._durationPivot.x || 0 != this._durationPivot.y ? !0 : !1, this._currentFrame.color && e.color ? (this._durationColor.alphaOffset = e.color.alphaOffset - this._currentFrame.color.alphaOffset, this._durationColor.redOffset = e.color.redOffset - this._currentFrame.color.redOffset, this._durationColor.greenOffset = e.color.greenOffset - this._currentFrame.color.greenOffset, this._durationColor.blueOffset = e.color.blueOffset - this._currentFrame.color.blueOffset, this._durationColor.alphaMultiplier = e.color.alphaMultiplier - this._currentFrame.color.alphaMultiplier, this._durationColor.redMultiplier = e.color.redMultiplier - this._currentFrame.color.redMultiplier, this._durationColor.greenMultiplier = e.color.greenMultiplier - this._currentFrame.color.greenMultiplier, this._durationColor.blueMultiplier = e.color.blueMultiplier - this._currentFrame.color.blueMultiplier, this._tweenColor = 0 != this._durationColor.alphaOffset || 0 != this._durationColor.redOffset || 0 != this._durationColor.greenOffset || 0 != this._durationColor.blueOffset || 0 != this._durationColor.alphaMultiplier || 0 != this._durationColor.redMultiplier || 0 != this._durationColor.greenMultiplier || 0 != this._durationColor.blueMultiplier ? !0 : !1) : this._currentFrame.color ? (this._tweenColor = !0, this._durationColor.alphaOffset = -this._currentFrame.color.alphaOffset, this._durationColor.redOffset = -this._currentFrame.color.redOffset, this._durationColor.greenOffset = -this._currentFrame.color.greenOffset, this._durationColor.blueOffset = -this._currentFrame.color.blueOffset, this._durationColor.alphaMultiplier = 1 - this._currentFrame.color.alphaMultiplier, this._durationColor.redMultiplier = 1 - this._currentFrame.color.redMultiplier, this._durationColor.greenMultiplier = 1 - this._currentFrame.color.greenMultiplier, this._durationColor.blueMultiplier = 1 - this._currentFrame.color.blueMultiplier) : e.color ? (this._tweenColor = !0, this._durationColor.alphaOffset = e.color.alphaOffset, this._durationColor.redOffset = e.color.redOffset, this._durationColor.greenOffset = e.color.greenOffset, this._durationColor.blueOffset = e.color.blueOffset, this._durationColor.alphaMultiplier = e.color.alphaMultiplier - 1, this._durationColor.redMultiplier = e.color.redMultiplier - 1, this._durationColor.greenMultiplier = e.color.greenMultiplier - 1, this._durationColor.blueMultiplier = e.color.blueMultiplier - 1) : this._tweenColor = !1), this._tweenTransform || (this._animationState.blend ? (this.transform.x = this._originTransform.x + this._currentFrame.transform.x, this.transform.y = this._originTransform.y + this._currentFrame.transform.y, this.transform.skewX = this._originTransform.skewX + this._currentFrame.transform.skewX, this.transform.skewY = this._originTransform.skewY + this._currentFrame.transform.skewY, this.transform.scaleX = this._originTransform.scaleX + this._currentFrame.transform.scaleX, this.transform.scaleY = this._originTransform.scaleY + this._currentFrame.transform.scaleY, this.pivot.x = this._originPivot.x + this._currentFrame.pivot.x, this.pivot.y = this._originPivot.y + this._currentFrame.pivot.y) : (this.transform.x = this._currentFrame.transform.x, this.transform.y = this._currentFrame.transform.y, this.transform.skewX = this._currentFrame.transform.skewX, this.transform.skewY = this._currentFrame.transform.skewY, this.transform.scaleX = this._currentFrame.transform.scaleX, this.transform.scaleY = this._currentFrame.transform.scaleY, this.pivot.x = this._currentFrame.pivot.x, this.pivot.y = this._currentFrame.pivot.y)), this._tweenColor || (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset, this._currentFrame.color.redOffset, this._currentFrame.color.greenOffset, this._currentFrame.color.blueOffset, this._currentFrame.color.alphaMultiplier, this._currentFrame.color.redMultiplier, this._currentFrame.color.greenMultiplier, this._currentFrame.color.blueMultiplier, !0) : this._bone._isColorChanged && this._bone._updateColor(0, 0, 0, 0, 1, 1, 1, 1, !1)), this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1));
  14660. if (this._tweenTransform || this._tweenColor) b = (d - this._currentFramePosition) / this._currentFrameDuration,
  14661. this._tweenEasing && (b = a.getEaseValue(b, this._tweenEasing));
  14662. this._tweenTransform && (c = this._currentFrame.transform, d = this._currentFrame.pivot, this._animationState.blend ? (this.transform.x = this._originTransform.x + c.x + this._durationTransform.x * b, this.transform.y = this._originTransform.y + c.y + this._durationTransform.y * b, this.transform.skewX = this._originTransform.skewX + c.skewX + this._durationTransform.skewX * b, this.transform.skewY = this._originTransform.skewY + c.skewY + this._durationTransform.skewY * b, this.transform.scaleX = this._originTransform.scaleX + c.scaleX + this._durationTransform.scaleX * b, this.transform.scaleY = this._originTransform.scaleY + c.scaleY + this._durationTransform.scaleY * b, this.pivot.x = this._originPivot.x + d.x + this._durationPivot.x * b, this.pivot.y = this._originPivot.y + d.y + this._durationPivot.y * b) : (this.transform.x = c.x + this._durationTransform.x * b, this.transform.y = c.y + this._durationTransform.y * b, this.transform.skewX = c.skewX + this._durationTransform.skewX * b, this.transform.skewY = c.skewY + this._durationTransform.skewY * b, this.transform.scaleX = c.scaleX + this._durationTransform.scaleX * b, this.transform.scaleY = c.scaleY + this._durationTransform.scaleY * b, this.pivot.x = d.x + this._durationPivot.x * b, this.pivot.y = d.y + this._durationPivot.y * b));
  14663. this._tweenColor && (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset + this._durationColor.alphaOffset * b, this._currentFrame.color.redOffset + this._durationColor.redOffset * b, this._currentFrame.color.greenOffset + this._durationColor.greenOffset * b, this._currentFrame.color.blueOffset + this._durationColor.blueOffset * b, this._currentFrame.color.alphaMultiplier + this._durationColor.alphaMultiplier * b, this._currentFrame.color.redMultiplier + this._durationColor.redMultiplier * b, this._currentFrame.color.greenMultiplier + this._durationColor.greenMultiplier * b, this._currentFrame.color.blueMultiplier + this._durationColor.blueMultiplier * b, !0) : this._bone._updateColor(this._durationColor.alphaOffset * b, this._durationColor.redOffset * b, this._durationColor.greenOffset * b, this._durationColor.blueOffset * b, 1 + this._durationColor.alphaMultiplier * b, 1 + this._durationColor.redMultiplier * b, 1 + this._durationColor.greenMultiplier * b, 1 + this._durationColor.blueMultiplier * b, !0))
  14664. } else this._updateState = 0,
  14665. this._animationState.blend ? (this.transform.copy(this._originTransform), this.pivot.x = this._originPivot.x, this.pivot.y = this._originPivot.y) : (this.transform.x = this.transform.y = this.transform.skewX = this.transform.skewY = this.transform.scaleX = this.transform.scaleY = 0, this.pivot.x = 0, this.pivot.y = 0),
  14666. this._currentFrame = this._timeline.getFrameList()[0],
  14667. this.tweenActive = 0 <= this._currentFrame.displayIndex,
  14668. this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset, this._currentFrame.color.redOffset, this._currentFrame.color.greenOffset, this._currentFrame.color.blueOffset, this._currentFrame.color.alphaMultiplier, this._currentFrame.color.redMultiplier, this._currentFrame.color.greenMultiplier, this._currentFrame.color.blueMultiplier, !0) : this._bone._updateColor(0, 0, 0, 0, 1, 1, 1, 1, !1),
  14669. this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1)
  14670. };
  14671. a.prototype.clear = function() {
  14672. this._updateState = 0;
  14673. this._originPivot = this._originTransform = this._currentFrame = this._timeline = this._animationState = this._bone = null
  14674. };
  14675. a.HALF_PI = 0.5 * Math.PI;
  14676. a._pool = [];
  14677. return a
  14678. } ();
  14679. a.TimelineState = f;
  14680. var m = function() {
  14681. function a() {
  14682. this.layer = this.loop = 0;
  14683. this._timelineStates = {}
  14684. }
  14685. a._borrowObject = function() {
  14686. return 0 == a._pool.length ? new a: a._pool.pop()
  14687. };
  14688. a._returnObject = function(b) {
  14689. 0 > a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  14690. b.clear()
  14691. };
  14692. a._clear = function() {
  14693. for (var b = a._pool.length; b--;) a._pool[b].clear();
  14694. a._pool.length = 0
  14695. };
  14696. a.prototype.fadeIn = function(a, b, c, d, e, h, f, m) {
  14697. this.layer = h;
  14698. this.clip = b;
  14699. this.name = this.clip.name;
  14700. this.totalTime = this.clip.duration;
  14701. this._armature = a;
  14702. 2 > Math.round(this.clip.duration * this.clip.frameRate) || Infinity == d ? (this.timeScale = 1, this.currentTime = this.totalTime, this.loop = 0 <= this.loop ? 1 : -1) : (this.timeScale = d, this.currentTime = 0, this.loop = e);
  14703. this._pauseBeforeFadeInComplete = m;
  14704. this._fadeInTime = c * this.timeScale;
  14705. this._fadeState = 1;
  14706. this._fadeOutBeginTime = 0;
  14707. this._fadeOutWeight = -1;
  14708. this._fadeWeight = 0;
  14709. this._fadeIn = !0;
  14710. this._fadeOut = !1;
  14711. this.loopCount = -1;
  14712. this.displayControl = f;
  14713. this.isPlaying = !0;
  14714. this.isComplete = !1;
  14715. this.weight = 1;
  14716. this.tweenEnabled = this.enabled = this.blend = !0;
  14717. this.updateTimelineStates()
  14718. };
  14719. a.prototype.fadeOut = function(a, b) {
  14720. "undefined" === typeof b && (b = !1);
  14721. if (this._armature && !(0 <= this._fadeOutWeight)) {
  14722. this._fadeState = -1;
  14723. this._fadeOutWeight = this._fadeWeight;
  14724. this._fadeOutTime = a * this.timeScale;
  14725. this._fadeOutBeginTime = this.currentTime;
  14726. this._fadeOut = !0;
  14727. this.isPlaying = !b;
  14728. this.displayControl = !1;
  14729. for (var c in this._timelineStates) this._timelineStates[c].fadeOut();
  14730. this.enabled = !0
  14731. }
  14732. };
  14733. a.prototype.play = function() {
  14734. this.isPlaying = !0
  14735. };
  14736. a.prototype.stop = function() {
  14737. this.isPlaying = !1
  14738. };
  14739. a.prototype.getMixingTransform = function(a) {
  14740. return this._mixingTransforms ? Number(this._mixingTransforms[a]) : -1
  14741. };
  14742. a.prototype.addMixingTransform = function(a, b, c) {
  14743. "undefined" === typeof b && (b = 2);
  14744. "undefined" === typeof c && (c = !0);
  14745. if (this.clip && this.clip.getTimeline(a)) {
  14746. this._mixingTransforms || (this._mixingTransforms = {});
  14747. if (c) {
  14748. c = this._armature._boneList.length;
  14749. for (var d, e; c--;) d = this._armature._boneList[c],
  14750. d.name == a && (e = d),
  14751. e && (e == d || e.contains(d)) && (this._mixingTransforms[d.name] = b)
  14752. } else this._mixingTransforms[a] = b;
  14753. this.updateTimelineStates()
  14754. } else throw Error();
  14755. };
  14756. a.prototype.removeMixingTransform = function(a, b) {
  14757. "undefined" === typeof a && (a = null);
  14758. "undefined" === typeof b && (b = !0);
  14759. if (a) {
  14760. if (b) for (var c = this._armature._boneList.length,
  14761. d, e; c--;) d = this._armature._boneList[c],
  14762. d.name == a && (e = d),
  14763. e && (e == d || e.contains(d)) && delete this._mixingTransforms[d.name];
  14764. else delete this._mixingTransforms[a];
  14765. for (var h in this._mixingTransforms) {
  14766. var f = !0;
  14767. break
  14768. }
  14769. f || (this._mixingTransforms = null)
  14770. } else this._mixingTransforms = null;
  14771. this.updateTimelineStates()
  14772. };
  14773. a.prototype.advanceTime = function(a) {
  14774. if (!this.enabled) return ! 1;
  14775. var b, c;
  14776. this._fadeIn && (this._fadeIn = !1, this._armature.hasEventListener(d.AnimationEvent.FADE_IN) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_IN), b.animationState = this, this._armature._eventList.push(b)));
  14777. this._fadeOut && (this._fadeOut = !1, this._armature.hasEventListener(d.AnimationEvent.FADE_OUT) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_OUT), b.animationState = this, this._armature._eventList.push(b)));
  14778. this.currentTime += a * this.timeScale;
  14779. if (this.isPlaying && !this.isComplete) {
  14780. var e;
  14781. if (this._pauseBeforeFadeInComplete) this.isPlaying = this._pauseBeforeFadeInComplete = !1,
  14782. a = 0,
  14783. e = Math.floor(a);
  14784. else if (a = this.currentTime / this.totalTime, e = Math.floor(a), e != this.loopCount && ( - 1 == this.loopCount && this._armature.hasEventListener(d.AnimationEvent.START) && (b = new d.AnimationEvent(d.AnimationEvent.START), b.animationState = this, this._armature._eventList.push(b)), this.loopCount = e)) this.loop && this.loopCount * this.loopCount >= this.loop * this.loop - 1 ? (c = !0, a = 1, e = 0, this._armature.hasEventListener(d.AnimationEvent.COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.COMPLETE), b.animationState = this, this._armature._eventList.push(b))) : this._armature.hasEventListener(d.AnimationEvent.LOOP_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.LOOP_COMPLETE), b.animationState = this, this._armature._eventList.push(b));
  14785. for (var h in this._timelineStates) this._timelineStates[h].update(a);
  14786. b = this.clip.getFrameList();
  14787. if (0 < b.length) {
  14788. a = this.totalTime * (a - e);
  14789. for (e = !1; ! this._currentFrame || a > this._currentFrame.position + this._currentFrame.duration || a < this._currentFrame.position;) e && this._armature._arriveAtFrame(this._currentFrame, null, this, !0),
  14790. e = !0,
  14791. this._currentFrame ? (h = b.indexOf(this._currentFrame), h++, h >= b.length && (h = 0), this._currentFrame = b[h]) : this._currentFrame = b[0];
  14792. e && this._armature._arriveAtFrame(this._currentFrame, null, this, !1)
  14793. }
  14794. }
  14795. if (0 < this._fadeState) 0 == this._fadeInTime ? (this._fadeWeight = 1, this._fadeState = 0, this.isPlaying = !0, this._armature.hasEventListener(d.AnimationEvent.FADE_IN_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_IN_COMPLETE), b.animationState = this, this._armature._eventList.push(b))) : (this._fadeWeight = this.currentTime / this._fadeInTime, 1 <= this._fadeWeight && (this._fadeWeight = 1, this._fadeState = 0, this.isPlaying || (this.currentTime -= this._fadeInTime), this.isPlaying = !0, this._armature.hasEventListener(d.AnimationEvent.FADE_IN_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_IN_COMPLETE), b.animationState = this, this._armature._eventList.push(b))));
  14796. else if (0 > this._fadeState) {
  14797. if (0 == this._fadeOutTime) return this._fadeState = this._fadeWeight = 0,
  14798. this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE), b.animationState = this, this._armature._eventList.push(b)),
  14799. !0;
  14800. this._fadeWeight = (1 - (this.currentTime - this._fadeOutBeginTime) / this._fadeOutTime) * this._fadeOutWeight;
  14801. if (0 >= this._fadeWeight) return this._fadeState = this._fadeWeight = 0,
  14802. this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE), b.animationState = this, this._armature._eventList.push(b)),
  14803. !0
  14804. }
  14805. c && (this.isComplete = !0, 0 > this.loop && this.fadeOut((this._fadeOutWeight || this._fadeInTime) / this.timeScale, !0));
  14806. return ! 1
  14807. };
  14808. a.prototype.updateTimelineStates = function() {
  14809. if (this._mixingTransforms) {
  14810. for (var a in this._timelineStates) null == this._mixingTransforms[a] && this.removeTimelineState(a);
  14811. for (a in this._mixingTransforms) this._timelineStates[a] || this.addTimelineState(a)
  14812. } else for (a in this.clip.getTimelines()) this._timelineStates[a] || this.addTimelineState(a)
  14813. };
  14814. a.prototype.addTimelineState = function(a) {
  14815. var b = this._armature.getBone(a);
  14816. if (b) {
  14817. var c = f._borrowObject(),
  14818. d = this.clip.getTimeline(a);
  14819. c.fadeIn(b, this, d);
  14820. this._timelineStates[a] = c
  14821. }
  14822. };
  14823. a.prototype.removeTimelineState = function(a) {
  14824. f._returnObject(this._timelineStates[a]);
  14825. delete this._timelineStates[a]
  14826. };
  14827. a.prototype.clear = function() {
  14828. this.clip = null;
  14829. this.enabled = !1;
  14830. this._mixingTransforms = this._currentFrame = this._armature = null;
  14831. for (var a in this._timelineStates) this.removeTimelineState(a)
  14832. };
  14833. a._pool = [];
  14834. return a
  14835. } ();
  14836. a.AnimationState = m;
  14837. c = function() {
  14838. function a(b) {
  14839. this._armature = b;
  14840. this._animationLayer = [];
  14841. this._isPlaying = !1;
  14842. this.animationNameList = [];
  14843. this.tweenEnabled = !0;
  14844. this.timeScale = 1
  14845. }
  14846. a.prototype.getLastAnimationName = function() {
  14847. return this._lastAnimationState ? this._lastAnimationState.name: null
  14848. };
  14849. a.prototype.getLastAnimationState = function() {
  14850. return this._lastAnimationState
  14851. };
  14852. a.prototype.getAnimationDataList = function() {
  14853. return this._animationDataList
  14854. };
  14855. a.prototype.setAnimationDataList = function(a) {
  14856. this._animationDataList = a;
  14857. this.animationNameList.length = 0;
  14858. for (var b in this._animationDataList) this.animationNameList[this.animationNameList.length] = this._animationDataList[b].name
  14859. };
  14860. a.prototype.getIsPlaying = function() {
  14861. return this._isPlaying && !this.getIsComplete()
  14862. };
  14863. a.prototype.getIsComplete = function() {
  14864. if (this._lastAnimationState) {
  14865. if (!this._lastAnimationState.isComplete) return ! 1;
  14866. for (var a = this._animationLayer.length; a--;) for (var b = this._animationLayer[a], c = b.length; c--;) if (!b[c].isComplete) return ! 1;
  14867. return ! 0
  14868. }
  14869. return ! 1
  14870. };
  14871. a.prototype.dispose = function() {
  14872. if (this._armature) {
  14873. this.stop();
  14874. for (var a = this._animationLayer.length; a--;) {
  14875. for (var b = this._animationLayer[a], c = b.length; c--;) m._returnObject(b[c]);
  14876. b.length = 0
  14877. }
  14878. this._animationLayer.length = 0;
  14879. this.animationNameList.length = 0;
  14880. this.animationNameList = this._animationDataList = this._animationLayer = this._armature = null
  14881. }
  14882. };
  14883. a.prototype.gotoAndPlay = function(b, c, d, e, h, f, k, l, g, p) {
  14884. "undefined" === typeof c && (c = -1);
  14885. "undefined" === typeof d && (d = -1);
  14886. "undefined" === typeof e && (e = NaN);
  14887. "undefined" === typeof h && (h = 0);
  14888. "undefined" === typeof f && (f = null);
  14889. "undefined" === typeof k && (k = a.SAME_LAYER_AND_GROUP);
  14890. "undefined" === typeof l && (l = !0);
  14891. "undefined" === typeof g && (g = !0);
  14892. "undefined" === typeof p && (p = !0);
  14893. if (!this._animationDataList) return null;
  14894. for (var n = this._animationDataList.length,
  14895. x; n--;) if (this._animationDataList[n].name == b) {
  14896. x = this._animationDataList[n];
  14897. break
  14898. }
  14899. if (!x) return null;
  14900. this._isPlaying = !0;
  14901. c = 0 > c ? 0 > x.fadeInTime ? 0.3 : x.fadeInTime: c;
  14902. d = 0 > d ? 0 > x.scale ? 1 : x.scale: d / x.duration;
  14903. e = isNaN(e) ? x.loop: e;
  14904. h = this.addLayer(h);
  14905. var y;
  14906. switch (k) {
  14907. case a.NONE:
  14908. break;
  14909. case a.SAME_LAYER:
  14910. y = this._animationLayer[h];
  14911. for (n = y.length; n--;) k = y[n],
  14912. k.fadeOut(c, g);
  14913. break;
  14914. case a.SAME_GROUP:
  14915. for (H = this._animationLayer.length; H--;) for (y = this._animationLayer[H], n = y.length; n--;) k = y[n],
  14916. k.group == f && k.fadeOut(c, g);
  14917. break;
  14918. case a.ALL:
  14919. for (var H = this._animationLayer.length; H--;) for (y = this._animationLayer[H], n = y.length; n--;) k = y[n],
  14920. k.fadeOut(c, g);
  14921. break;
  14922. default:
  14923. for (y = this._animationLayer[h], n = y.length; n--;) k = y[n],
  14924. k.group == f && k.fadeOut(c, g)
  14925. }
  14926. this._lastAnimationState = m._borrowObject();
  14927. this._lastAnimationState.group = f;
  14928. this._lastAnimationState.tweenEnabled = this.tweenEnabled;
  14929. this._lastAnimationState.fadeIn(this._armature, x, c, 1 / d, e, h, l, p);
  14930. this.addState(this._lastAnimationState);
  14931. e = this._armature._slotList;
  14932. for (n = e.length; n--;) h = e[n],
  14933. (h = h.getChildArmature()) && h.animation.gotoAndPlay(b, c);
  14934. return this._lastAnimationState
  14935. };
  14936. a.prototype.play = function() {
  14937. this._animationDataList && 0 != this._animationDataList.length && (this._lastAnimationState ? this._isPlaying ? this.gotoAndPlay(this._lastAnimationState.name) : this._isPlaying = !0 : this.gotoAndPlay(this._animationDataList[0].name))
  14938. };
  14939. a.prototype.stop = function() {
  14940. this._isPlaying = !1
  14941. };
  14942. a.prototype.getState = function(a, b) {
  14943. "undefined" === typeof b && (b = 0);
  14944. var c = this._animationLayer.length;
  14945. if (0 == c) return null;
  14946. b >= c && (b = c - 1);
  14947. c = this._animationLayer[b];
  14948. if (!c) return null;
  14949. for (var d = c.length; d--;) if (c[d].name == a) return c[d];
  14950. return null
  14951. };
  14952. a.prototype.hasAnimation = function(a) {
  14953. for (var b = this._animationDataList.length; b--;) if (this._animationDataList[b].name == a) return ! 0;
  14954. return ! 1
  14955. };
  14956. a.prototype.advanceTime = function(a) {
  14957. if (this._isPlaying) {
  14958. a *= this.timeScale;
  14959. var b = this._armature._boneList.length,
  14960. c, d, e = b,
  14961. h, f, m, k, l, g, p, q, n, r, G, M, J, N, F, K, I;
  14962. for (b--; e--;) {
  14963. f = this._armature._boneList[e];
  14964. m = f.name;
  14965. k = 1;
  14966. M = G = r = n = q = p = g = l = 0;
  14967. for (c = this._animationLayer.length; c--;) {
  14968. J = 0;
  14969. N = this._animationLayer[c];
  14970. h = N.length;
  14971. for (d = 0; d < h; d++) F = N[d],
  14972. e == b && F.advanceTime(a) ? (this.removeState(F), d--, h--) : (K = F._timelineStates[m]) && K.tweenActive && (F = F._fadeWeight * F.weight * k, I = K.transform, K = K.pivot, l += I.x * F, g += I.y * F, p += I.skewX * F, q += I.skewY * F, n += I.scaleX * F, r += I.scaleY * F, G += K.x * F, M += K.y * F, J += F);
  14973. if (J >= k) break;
  14974. else k -= J
  14975. }
  14976. I = f.tween;
  14977. K = f._tweenPivot;
  14978. I.x = l;
  14979. I.y = g;
  14980. I.skewX = p;
  14981. I.skewY = q;
  14982. I.scaleX = n;
  14983. I.scaleY = r;
  14984. K.x = G;
  14985. K.y = M
  14986. }
  14987. }
  14988. };
  14989. a.prototype.addLayer = function(a) {
  14990. a >= this._animationLayer.length && (a = this._animationLayer.length, this._animationLayer[a] = []);
  14991. return a
  14992. };
  14993. a.prototype.addState = function(a) {
  14994. this._animationLayer[a.layer].push(a)
  14995. };
  14996. a.prototype.removeState = function(a) {
  14997. var b = a.layer,
  14998. c = this._animationLayer[b];
  14999. c.splice(c.indexOf(a), 1);
  15000. m._returnObject(a);
  15001. 0 == c.length && b == this._animationLayer.length - 1 && this._animationLayer.length--
  15002. };
  15003. a.NONE = "none";
  15004. a.SAME_LAYER = "sameLayer";
  15005. a.SAME_GROUP = "sameGroup";
  15006. a.SAME_LAYER_AND_GROUP = "sameLayerAndGroup";
  15007. a.ALL = "all";
  15008. return a
  15009. } ();
  15010. a.Animation = c
  15011. })(c.animation || (c.animation = {}));
  15012. var a = c.animation; (function(a) {
  15013. var b = function() {
  15014. function a() {
  15015. this.skewY = this.skewX = this.y = this.x = 0;
  15016. this.scaleY = this.scaleX = 1
  15017. }
  15018. a.prototype.getRotation = function() {
  15019. return this.skewX
  15020. };
  15021. a.prototype.setRotation = function(a) {
  15022. this.skewX = this.skewY = a
  15023. };
  15024. a.prototype.copy = function(a) {
  15025. this.x = a.x;
  15026. this.y = a.y;
  15027. this.skewX = a.skewX;
  15028. this.skewY = a.skewY;
  15029. this.scaleX = a.scaleX;
  15030. this.scaleY = a.scaleY
  15031. };
  15032. a.prototype.toString = function() {
  15033. return "[DBTransform (x=" + this.x + " y=" + this.y + " skewX=" + this.skewX + " skewY=" + this.skewY + " scaleX=" + this.scaleX + " scaleY=" + this.scaleY + ")]"
  15034. };
  15035. return a
  15036. } ();
  15037. a.DBTransform = b;
  15038. var c = function() {
  15039. function a() {
  15040. this.duration = this.position = 0
  15041. }
  15042. a.prototype.dispose = function() {};
  15043. return a
  15044. } ();
  15045. a.Frame = c;
  15046. var d = function(a) {
  15047. function c() {
  15048. a.call(this);
  15049. this.displayIndex = this.tweenRotate = this.tweenEasing = 0;
  15050. this.zOrder = NaN;
  15051. this.visible = !0;
  15052. this.global = new b;
  15053. this.transform = new b;
  15054. this.pivot = new e.Point
  15055. }
  15056. __extends(c, a);
  15057. c.prototype.dispose = function() {
  15058. a.prototype.dispose.call(this);
  15059. this.color = this.pivot = this.transform = this.global = null
  15060. };
  15061. return c
  15062. } (c);
  15063. a.TransformFrame = d;
  15064. var f = function() {
  15065. function a() {
  15066. this._frameList = [];
  15067. this.duration = 0;
  15068. this.scale = 1
  15069. }
  15070. a.prototype.getFrameList = function() {
  15071. return this._frameList
  15072. };
  15073. a.prototype.dispose = function() {
  15074. for (var a = this._frameList.length; a--;) this._frameList[a].dispose();
  15075. this._frameList.length = 0;
  15076. this._frameList = null
  15077. };
  15078. a.prototype.addFrame = function(a) {
  15079. if (!a) throw Error();
  15080. if (0 > this._frameList.indexOf(a)) this._frameList[this._frameList.length] = a;
  15081. else throw Error();
  15082. };
  15083. return a
  15084. } ();
  15085. a.Timeline = f;
  15086. var k = function(a) {
  15087. function c() {
  15088. a.call(this);
  15089. this.originTransform = new b;
  15090. this.originPivot = new e.Point;
  15091. this.offset = 0;
  15092. this.transformed = !1
  15093. }
  15094. __extends(c, a);
  15095. c.prototype.dispose = function() {
  15096. this != c.HIDE_TIMELINE && (a.prototype.dispose.call(this), this.originPivot = this.originTransform = null)
  15097. };
  15098. c.HIDE_TIMELINE = new c;
  15099. return c
  15100. } (f);
  15101. a.TransformTimeline = k;
  15102. var m = function(a) {
  15103. function b() {
  15104. a.call(this);
  15105. this.loop = this.frameRate = 0;
  15106. this.tweenEasing = NaN;
  15107. this.fadeInTime = 0;
  15108. this._timelines = {}
  15109. }
  15110. __extends(b, a);
  15111. b.prototype.getTimelines = function() {
  15112. return this._timelines
  15113. };
  15114. b.prototype.dispose = function() {
  15115. a.prototype.dispose.call(this);
  15116. for (var b in this._timelines) this._timelines[b].dispose();
  15117. this._timelines = null
  15118. };
  15119. b.prototype.getTimeline = function(a) {
  15120. return this._timelines[a]
  15121. };
  15122. b.prototype.addTimeline = function(a, b) {
  15123. if (!a) throw Error();
  15124. this._timelines[b] = a
  15125. };
  15126. return b
  15127. } (f);
  15128. a.AnimationData = m;
  15129. var g = function() {
  15130. function a() {
  15131. this.transform = new b
  15132. }
  15133. a.prototype.dispose = function() {
  15134. this.pivot = this.transform = null
  15135. };
  15136. a.ARMATURE = "armature";
  15137. a.IMAGE = "image";
  15138. return a
  15139. } ();
  15140. a.DisplayData = g;
  15141. var v = function() {
  15142. function a() {
  15143. this._displayDataList = [];
  15144. this.zOrder = 0;
  15145. this.blendMode = "normal"
  15146. }
  15147. a.prototype.getDisplayDataList = function() {
  15148. return this._displayDataList
  15149. };
  15150. a.prototype.dispose = function() {
  15151. for (var a = this._displayDataList.length; a--;) this._displayDataList[a].dispose();
  15152. this._displayDataList.length = 0;
  15153. this._displayDataList = null
  15154. };
  15155. a.prototype.addDisplayData = function(a) {
  15156. if (!a) throw Error();
  15157. if (0 > this._displayDataList.indexOf(a)) this._displayDataList[this._displayDataList.length] = a;
  15158. else throw Error();
  15159. };
  15160. a.prototype.getDisplayData = function(a) {
  15161. for (var b = this._displayDataList.length; b--;) if (this._displayDataList[b].name == a) return this._displayDataList[b];
  15162. return null
  15163. };
  15164. return a
  15165. } ();
  15166. a.SlotData = v;
  15167. var B = function() {
  15168. function a() {
  15169. this.length = 0;
  15170. this.global = new b;
  15171. this.transform = new b;
  15172. this.scaleMode = 1;
  15173. this.fixedRotation = !1
  15174. }
  15175. a.prototype.dispose = function() {
  15176. this.transform = this.global = null
  15177. };
  15178. return a
  15179. } ();
  15180. a.BoneData = B;
  15181. var C = function() {
  15182. function a() {
  15183. this._slotDataList = []
  15184. }
  15185. a.prototype.getSlotDataList = function() {
  15186. return this._slotDataList
  15187. };
  15188. a.prototype.dispose = function() {
  15189. for (var a = this._slotDataList.length; a--;) this._slotDataList[a].dispose();
  15190. this._slotDataList.length = 0;
  15191. this._slotDataList = null
  15192. };
  15193. a.prototype.getSlotData = function(a) {
  15194. for (var b = this._slotDataList.length; b--;) if (this._slotDataList[b].name == a) return this._slotDataList[b];
  15195. return null
  15196. };
  15197. a.prototype.addSlotData = function(a) {
  15198. if (!a) throw Error();
  15199. if (0 > this._slotDataList.indexOf(a)) this._slotDataList[this._slotDataList.length] = a;
  15200. else throw Error();
  15201. };
  15202. return a
  15203. } ();
  15204. a.SkinData = C;
  15205. var t = function() {
  15206. function a() {
  15207. this._boneDataList = [];
  15208. this._skinDataList = [];
  15209. this._animationDataList = []
  15210. }
  15211. a.prototype.getBoneDataList = function() {
  15212. return this._boneDataList
  15213. };
  15214. a.prototype.getSkinDataList = function() {
  15215. return this._skinDataList
  15216. };
  15217. a.prototype.getAnimationDataList = function() {
  15218. return this._animationDataList
  15219. };
  15220. a.prototype.dispose = function() {
  15221. for (var a = this._boneDataList.length; a--;) this._boneDataList[a].dispose();
  15222. for (a = this._skinDataList.length; a--;) this._skinDataList[a].dispose();
  15223. for (a = this._animationDataList.length; a--;) this._animationDataList[a].dispose();
  15224. this._boneDataList.length = 0;
  15225. this._skinDataList.length = 0;
  15226. this._animationDataList.length = 0;
  15227. this._animationDataList = this._skinDataList = this._boneDataList = null
  15228. };
  15229. a.prototype.getBoneData = function(a) {
  15230. for (var b = this._boneDataList.length; b--;) if (this._boneDataList[b].name == a) return this._boneDataList[b];
  15231. return null
  15232. };
  15233. a.prototype.getSkinData = function(a) {
  15234. if (!a) return this._skinDataList[0];
  15235. for (var b = this._skinDataList.length; b--;) if (this._skinDataList[b].name == a) return this._skinDataList[b];
  15236. return null
  15237. };
  15238. a.prototype.getAnimationData = function(a) {
  15239. for (var b = this._animationDataList.length; b--;) if (this._animationDataList[b].name == a) return this._animationDataList[b];
  15240. return null
  15241. };
  15242. a.prototype.addBoneData = function(a) {
  15243. if (!a) throw Error();
  15244. if (0 > this._boneDataList.indexOf(a)) this._boneDataList[this._boneDataList.length] = a;
  15245. else throw Error();
  15246. };
  15247. a.prototype.addSkinData = function(a) {
  15248. if (!a) throw Error();
  15249. if (0 > this._skinDataList.indexOf(a)) this._skinDataList[this._skinDataList.length] = a;
  15250. else throw Error();
  15251. };
  15252. a.prototype.addAnimationData = function(a) {
  15253. if (!a) throw Error();
  15254. 0 > this._animationDataList.indexOf(a) && (this._animationDataList[this._animationDataList.length] = a)
  15255. };
  15256. a.prototype.sortBoneDataList = function() {
  15257. var a = this._boneDataList.length;
  15258. if (0 != a) {
  15259. for (var b = []; a--;) {
  15260. for (var c = this._boneDataList[a], d = 0, e = c; e && e.parent;) d++,
  15261. e = this.getBoneData(e.parent);
  15262. b[a] = {
  15263. level: d,
  15264. boneData: c
  15265. }
  15266. }
  15267. b.sort(this.sortBoneData);
  15268. for (a = b.length; a--;) this._boneDataList[a] = b[a].boneData
  15269. }
  15270. };
  15271. a.prototype.sortBoneData = function(a, b) {
  15272. return a.level > b.level ? 1 : -1
  15273. };
  15274. return a
  15275. } ();
  15276. a.ArmatureData = t;
  15277. var u = function() {
  15278. function a() {
  15279. this._armatureDataList = [];
  15280. this._subTexturePivots = {}
  15281. }
  15282. a.prototype.getArmatureNames = function() {
  15283. var a = [],
  15284. b;
  15285. for (b in this._armatureDataList) a[a.length] = this._armatureDataList[b].name;
  15286. return a
  15287. };
  15288. a.prototype.getArmatureDataList = function() {
  15289. return this._armatureDataList
  15290. };
  15291. a.prototype.dispose = function() {
  15292. for (var a in this._armatureDataList) this._armatureDataList[a].dispose();
  15293. this._armatureDataList.length = 0;
  15294. this._subTexturePivots = this._armatureDataList = null
  15295. };
  15296. a.prototype.getArmatureData = function(a) {
  15297. for (var b = this._armatureDataList.length; b--;) if (this._armatureDataList[b].name == a) return this._armatureDataList[b];
  15298. return null
  15299. };
  15300. a.prototype.addArmatureData = function(a) {
  15301. if (!a) throw Error();
  15302. if (0 > this._armatureDataList.indexOf(a)) this._armatureDataList[this._armatureDataList.length] = a;
  15303. else throw Error();
  15304. };
  15305. a.prototype.removeArmatureData = function(a) {
  15306. a = this._armatureDataList.indexOf(a);
  15307. 0 <= a && this._armatureDataList.splice(a, 1)
  15308. };
  15309. a.prototype.removeArmatureDataByName = function(a) {
  15310. for (var b = this._armatureDataList.length; b--;) this._armatureDataList[b].name == a && this._armatureDataList.splice(b, 1)
  15311. };
  15312. a.prototype.getSubTexturePivot = function(a) {
  15313. return this._subTexturePivots[a]
  15314. };
  15315. a.prototype.addSubTexturePivot = function(a, b, c) {
  15316. var d = this._subTexturePivots[c];
  15317. d ? (d.x = a, d.y = b) : this._subTexturePivots[c] = d = new e.Point(a, b);
  15318. return d
  15319. };
  15320. a.prototype.removeSubTexturePivot = function(a) {
  15321. if (a) delete this._subTexturePivots[a];
  15322. else for (a in this._subTexturePivots) delete this._subTexturePivots[a]
  15323. };
  15324. return a
  15325. } ();
  15326. a.SkeletonData = u;
  15327. f = function() {
  15328. function a() {}
  15329. a.parseTextureAtlasData = function(a, b) {
  15330. "undefined" === typeof b && (b = 1);
  15331. if (!a) throw Error();
  15332. var c = {};
  15333. c.__name = a[h.ConstValues.A_NAME];
  15334. var d = a[h.ConstValues.SUB_TEXTURE],
  15335. f;
  15336. for (f in d) {
  15337. var k = d[f],
  15338. m = k[h.ConstValues.A_NAME],
  15339. k = new e.Rectangle(Number(k[h.ConstValues.A_X]) / b, Number(k[h.ConstValues.A_Y]) / b, Number(k[h.ConstValues.A_WIDTH]) / b, Number(k[h.ConstValues.A_HEIGHT]) / b);
  15340. c[m] = k
  15341. }
  15342. return c
  15343. };
  15344. a.parseSkeletonData = function(b) {
  15345. if (!b) throw Error();
  15346. var c = Number(b[h.ConstValues.A_FRAME_RATE]),
  15347. d = new u;
  15348. d.name = b[h.ConstValues.A_NAME];
  15349. b = b[h.ConstValues.ARMATURE];
  15350. for (var e in b) d.addArmatureData(a.parseArmatureData(b[e], d, c));
  15351. return d
  15352. };
  15353. a.parseArmatureData = function(b, c, d) {
  15354. var e = new t;
  15355. e.name = b[h.ConstValues.A_NAME];
  15356. var f = b[h.ConstValues.BONE],
  15357. k;
  15358. for (k in f) e.addBoneData(a.parseBoneData(f[k]));
  15359. f = b[h.ConstValues.SKIN];
  15360. for (k in f) e.addSkinData(a.parseSkinData(f[k], c));
  15361. h.DBDataUtil.transformArmatureData(e);
  15362. e.sortBoneDataList();
  15363. b = b[h.ConstValues.ANIMATION];
  15364. for (k in b) e.addAnimationData(a.parseAnimationData(b[k], e, d));
  15365. return e
  15366. };
  15367. a.parseBoneData = function(b) {
  15368. var c = new B;
  15369. c.name = b[h.ConstValues.A_NAME];
  15370. c.parent = b[h.ConstValues.A_PARENT];
  15371. c.length = Number(b[h.ConstValues.A_LENGTH]) || 0;
  15372. var d = Number(b[h.ConstValues.A_SCALE_MODE]); ! isNaN(d) && d && (c.scaleMode = d);
  15373. if (d = b[h.ConstValues.A_FIXED_ROTATION]) c.fixedRotation = d;
  15374. a.parseTransform(b[h.ConstValues.TRANSFORM], c.global);
  15375. c.transform.copy(c.global);
  15376. return c
  15377. };
  15378. a.parseSkinData = function(b, c) {
  15379. var d = new C;
  15380. d.name = b[h.ConstValues.A_NAME];
  15381. var e = b[h.ConstValues.SLOT],
  15382. f;
  15383. for (f in e) d.addSlotData(a.parseSlotData(e[f], c));
  15384. return d
  15385. };
  15386. a.parseSlotData = function(b, c) {
  15387. var d = new v;
  15388. d.name = b[h.ConstValues.A_NAME];
  15389. d.parent = b[h.ConstValues.A_PARENT];
  15390. d.zOrder = Number(b[h.ConstValues.A_Z_ORDER]);
  15391. d.blendMode = b[h.ConstValues.A_BLENDMODE];
  15392. d.blendMode || (d.blendMode = "normal");
  15393. var e = b[h.ConstValues.DISPLAY],
  15394. f;
  15395. for (f in e) d.addDisplayData(a.parseDisplayData(e[f], c));
  15396. return d
  15397. };
  15398. a.parseDisplayData = function(b, c) {
  15399. var d = new g;
  15400. d.name = b[h.ConstValues.A_NAME];
  15401. d.type = b[h.ConstValues.A_TYPE];
  15402. d.pivot = c.addSubTexturePivot(0, 0, d.name);
  15403. a.parseTransform(b[h.ConstValues.TRANSFORM], d.transform, d.pivot);
  15404. return d
  15405. };
  15406. a.parseAnimationData = function(b, c, d) {
  15407. var e = new m;
  15408. e.name = b[h.ConstValues.A_NAME];
  15409. e.frameRate = d;
  15410. e.loop = Number(b[h.ConstValues.A_LOOP]) || 0;
  15411. e.fadeInTime = Number(b[h.ConstValues.A_FADE_IN_TIME]);
  15412. e.duration = Number(b[h.ConstValues.A_DURATION]) / d;
  15413. e.scale = Number(b[h.ConstValues.A_SCALE]);
  15414. if (b.hasOwnProperty(h.ConstValues.A_TWEEN_EASING)) {
  15415. var f = b[h.ConstValues.A_TWEEN_EASING];
  15416. e.tweenEasing = void 0 == f || null == f ? NaN: Number(f)
  15417. } else e.tweenEasing = NaN;
  15418. a.parseTimeline(b, e, a.parseMainFrame, d);
  15419. var k, f = b[h.ConstValues.TIMELINE],
  15420. l;
  15421. for (l in f) k = f[l],
  15422. b = a.parseTransformTimeline(k, e.duration, d),
  15423. k = k[h.ConstValues.A_NAME],
  15424. e.addTimeline(b, k);
  15425. h.DBDataUtil.addHideTimeline(e, c);
  15426. h.DBDataUtil.transformAnimationData(e, c);
  15427. return e
  15428. };
  15429. a.parseTimeline = function(a, b, c, d) {
  15430. var e = 0,
  15431. f;
  15432. a = a[h.ConstValues.FRAME];
  15433. for (var k in a) f = c(a[k], d),
  15434. f.position = e,
  15435. b.addFrame(f),
  15436. e += f.duration;
  15437. f && (f.duration = b.duration - f.position)
  15438. };
  15439. a.parseTransformTimeline = function(b, c, d) {
  15440. var e = new k;
  15441. e.duration = c;
  15442. a.parseTimeline(b, e, a.parseTransformFrame, d);
  15443. e.scale = Number(b[h.ConstValues.A_SCALE]);
  15444. e.offset = Number(b[h.ConstValues.A_OFFSET]);
  15445. return e
  15446. };
  15447. a.parseFrame = function(a, b, c) {
  15448. b.duration = Number(a[h.ConstValues.A_DURATION]) / c;
  15449. b.action = a[h.ConstValues.A_ACTION];
  15450. b.event = a[h.ConstValues.A_EVENT];
  15451. b.sound = a[h.ConstValues.A_SOUND]
  15452. };
  15453. a.parseMainFrame = function(b, d) {
  15454. var e = new c;
  15455. a.parseFrame(b, e, d);
  15456. return e
  15457. };
  15458. a.parseTransformFrame = function(b, c) {
  15459. var f = new d;
  15460. a.parseFrame(b, f, c);
  15461. f.visible = 1 != Number(b[h.ConstValues.A_HIDE]);
  15462. if (b.hasOwnProperty(h.ConstValues.A_TWEEN_EASING)) {
  15463. var k = b[h.ConstValues.A_TWEEN_EASING];
  15464. f.tweenEasing = void 0 == k || null == k ? NaN: Number(k)
  15465. } else f.tweenEasing = 0;
  15466. f.tweenRotate = Number(b[h.ConstValues.A_TWEEN_ROTATE]) || 0;
  15467. f.displayIndex = Number(b[h.ConstValues.A_DISPLAY_INDEX]) || 0;
  15468. f.zOrder = Number(b[h.ConstValues.A_Z_ORDER]) || 0;
  15469. a.parseTransform(b[h.ConstValues.TRANSFORM], f.global, f.pivot);
  15470. f.transform.copy(f.global);
  15471. if (k = b[h.ConstValues.COLOR_TRANSFORM]) f.color = new e.ColorTransform,
  15472. f.color.alphaOffset = Number(k[h.ConstValues.A_ALPHA_OFFSET]),
  15473. f.color.redOffset = Number(k[h.ConstValues.A_RED_OFFSET]),
  15474. f.color.greenOffset = Number(k[h.ConstValues.A_GREEN_OFFSET]),
  15475. f.color.blueOffset = Number(k[h.ConstValues.A_BLUE_OFFSET]),
  15476. f.color.alphaMultiplier = 0.01 * Number(k[h.ConstValues.A_ALPHA_MULTIPLIER]),
  15477. f.color.redMultiplier = 0.01 * Number(k[h.ConstValues.A_RED_MULTIPLIER]),
  15478. f.color.greenMultiplier = 0.01 * Number(k[h.ConstValues.A_GREEN_MULTIPLIER]),
  15479. f.color.blueMultiplier = 0.01 * Number(k[h.ConstValues.A_BLUE_MULTIPLIER]);
  15480. return f
  15481. };
  15482. a.parseTransform = function(a, b, c) {
  15483. "undefined" === typeof c && (c = null);
  15484. a && (b && (b.x = Number(a[h.ConstValues.A_X]), b.y = Number(a[h.ConstValues.A_Y]), b.skewX = Number(a[h.ConstValues.A_SKEW_X]) * h.ConstValues.ANGLE_TO_RADIAN, b.skewY = Number(a[h.ConstValues.A_SKEW_Y]) * h.ConstValues.ANGLE_TO_RADIAN, b.scaleX = Number(a[h.ConstValues.A_SCALE_X]), b.scaleY = Number(a[h.ConstValues.A_SCALE_Y])), c && (c.x = Number(a[h.ConstValues.A_PIVOT_X]), c.y = Number(a[h.ConstValues.A_PIVOT_Y])))
  15485. };
  15486. return a
  15487. } ();
  15488. a.DataParser = f
  15489. })(c.objects || (c.objects = {}));
  15490. var b = c.objects; (function(a) {
  15491. var c = function(a) {
  15492. function c() {
  15493. a.call(this);
  15494. this._dataDic = {};
  15495. this._textureAtlasDic = {};
  15496. this._textureAtlasLoadingDic = {}
  15497. }
  15498. __extends(c, a);
  15499. c.prototype.getSkeletonData = function(a) {
  15500. return this._dataDic[a]
  15501. };
  15502. c.prototype.addSkeletonData = function(a, b) {
  15503. "undefined" === typeof b && (b = null);
  15504. if (!a) throw Error();
  15505. b = b || a.name;
  15506. if (!b) throw Error("Unnamed data!");
  15507. this._dataDic[b] = a
  15508. };
  15509. c.prototype.removeSkeletonData = function(a) {
  15510. delete this._dataDic[a]
  15511. };
  15512. c.prototype.getTextureAtlas = function(a) {
  15513. return this._textureAtlasDic[a]
  15514. };
  15515. c.prototype.addTextureAtlas = function(a, b) {
  15516. "undefined" === typeof b && (b = null);
  15517. if (!a) throw Error();
  15518. b = b || a.name;
  15519. if (!b) throw Error("Unnamed data!");
  15520. this._textureAtlasDic[b] = a
  15521. };
  15522. c.prototype.removeTextureAtlas = function(a) {
  15523. delete this._textureAtlasDic[a]
  15524. };
  15525. c.prototype.dispose = function(a) {
  15526. "undefined" === typeof a && (a = !0);
  15527. if (a) {
  15528. for (var b in this._dataDic) this._dataDic[b].dispose();
  15529. for (b in this._textureAtlasDic) this._textureAtlasDic[b].dispose()
  15530. }
  15531. this._currentTextureAtlasName = this._currentDataName = this._textureAtlasLoadingDic = this._textureAtlasDic = this._dataDic = null
  15532. };
  15533. c.prototype.buildArmature = function(a, c, d, e, h) {
  15534. if (d) {
  15535. var k = this._dataDic[d];
  15536. if (k) var m = k.getArmatureData(a)
  15537. } else for (d in this._dataDic) if (k = this._dataDic[d], m = k.getArmatureData(a)) break;
  15538. if (!m) return null;
  15539. this._currentDataName = d;
  15540. this._currentTextureAtlasName = e || d;
  15541. e = this._generateArmature();
  15542. e.name = a;
  15543. var l, g, p = m.getBoneDataList(),
  15544. q;
  15545. for (q in p) g = p[q],
  15546. l = new f,
  15547. l.name = g.name,
  15548. l.fixedRotation = g.fixedRotation,
  15549. l.scaleMode = g.scaleMode,
  15550. l.origin.copy(g.transform),
  15551. m.getBoneData(g.parent) ? e.addChild(l, g.parent) : e.addChild(l, null);
  15552. if (c && c != a) {
  15553. var n = k.getArmatureData(c);
  15554. if (!n) for (d in this._dataDic) if (k = this._dataDic[d], n = k.getArmatureData(c)) break
  15555. }
  15556. n ? e.animation.setAnimationDataList(n.getAnimationDataList()) : e.animation.setAnimationDataList(m.getAnimationDataList());
  15557. l = m.getSkinData(h);
  15558. if (!l) throw Error();
  15559. a = [];
  15560. d = l.getSlotDataList();
  15561. for (q in d) if (k = d[q], l = e.getBone(k.parent)) {
  15562. h = k.getDisplayDataList();
  15563. c = this._generateSlot();
  15564. c.name = k.name;
  15565. c._blendMode = k.blendMode;
  15566. c._originZOrder = k.zOrder;
  15567. c._dislayDataList = h;
  15568. a.length = 0;
  15569. for (k = h.length; k--;) switch (m = h[k], m.type) {
  15570. case b.DisplayData.ARMATURE:
  15571. (m = this.buildArmature(m.name, null, this._currentDataName, this._currentTextureAtlasName, null)) && (a[k] = m);
  15572. break;
  15573. default:
  15574. a[k] = this._generateDisplay(this._textureAtlasDic[this._currentTextureAtlasName], m.name, m.pivot.x, m.pivot.y)
  15575. }
  15576. c.setDisplayList(a);
  15577. c._changeDisplay(0);
  15578. l.addChild(c)
  15579. }
  15580. e._slotsZOrderChanged = !0;
  15581. e.advanceTime(0);
  15582. return e
  15583. };
  15584. c.prototype.getTextureDisplay = function(a, b, c, d) {
  15585. if (b) var e = this._textureAtlasDic[b];
  15586. if (!e && !b) for (b in this._textureAtlasDic) {
  15587. e = this._textureAtlasDic[b];
  15588. if (e.getRegion(a)) break;
  15589. e = null
  15590. }
  15591. if (e) {
  15592. if (isNaN(c) || isNaN(d)) if (b = this._dataDic[b]) if (b = b.getSubTexturePivot(a)) c = b.x,
  15593. d = b.y;
  15594. return this._generateDisplay(e, a, c, d)
  15595. }
  15596. return null
  15597. };
  15598. c.prototype._generateArmature = function() {
  15599. return null
  15600. };
  15601. c.prototype._generateSlot = function() {
  15602. return null
  15603. };
  15604. c.prototype._generateDisplay = function(a, b, c, d) {
  15605. return null
  15606. };
  15607. return c
  15608. } (d.EventDispatcher);
  15609. a.BaseFactory = c
  15610. })(c.factorys || (c.factorys = {})); (function(c) {
  15611. var d = function() {
  15612. function a() {}
  15613. a.ANGLE_TO_RADIAN = Math.PI / 180;
  15614. a.DRAGON_BONES = "dragonBones";
  15615. a.ARMATURE = "armature";
  15616. a.SKIN = "skin";
  15617. a.BONE = "bone";
  15618. a.SLOT = "slot";
  15619. a.DISPLAY = "display";
  15620. a.ANIMATION = "animation";
  15621. a.TIMELINE = "timeline";
  15622. a.FRAME = "frame";
  15623. a.TRANSFORM = "transform";
  15624. a.COLOR_TRANSFORM = "colorTransform";
  15625. a.TEXTURE_ATLAS = "TextureAtlas";
  15626. a.SUB_TEXTURE = "SubTexture";
  15627. a.A_VERSION = "version";
  15628. a.A_IMAGE_PATH = "imagePath";
  15629. a.A_FRAME_RATE = "frameRate";
  15630. a.A_NAME = "name";
  15631. a.A_PARENT = "parent";
  15632. a.A_LENGTH = "length";
  15633. a.A_TYPE = "type";
  15634. a.A_FADE_IN_TIME = "fadeInTime";
  15635. a.A_DURATION = "duration";
  15636. a.A_SCALE = "scale";
  15637. a.A_OFFSET = "offset";
  15638. a.A_LOOP = "loop";
  15639. a.A_EVENT = "event";
  15640. a.A_SOUND = "sound";
  15641. a.A_ACTION = "action";
  15642. a.A_HIDE = "hide";
  15643. a.A_TWEEN_EASING = "tweenEasing";
  15644. a.A_TWEEN_ROTATE = "tweenRotate";
  15645. a.A_DISPLAY_INDEX = "displayIndex";
  15646. a.A_Z_ORDER = "z";
  15647. a.A_BLENDMODE = "blendMode";
  15648. a.A_WIDTH = "width";
  15649. a.A_HEIGHT = "height";
  15650. a.A_SCALE_MODE = "scaleMode";
  15651. a.A_FIXED_ROTATION = "fixedRotation";
  15652. a.A_X = "x";
  15653. a.A_Y = "y";
  15654. a.A_SKEW_X = "skX";
  15655. a.A_SKEW_Y = "skY";
  15656. a.A_SCALE_X = "scX";
  15657. a.A_SCALE_Y = "scY";
  15658. a.A_PIVOT_X = "pX";
  15659. a.A_PIVOT_Y = "pY";
  15660. a.A_ALPHA_OFFSET = "aO";
  15661. a.A_RED_OFFSET = "rO";
  15662. a.A_GREEN_OFFSET = "gO";
  15663. a.A_BLUE_OFFSET = "bO";
  15664. a.A_ALPHA_MULTIPLIER = "aM";
  15665. a.A_RED_MULTIPLIER = "rM";
  15666. a.A_GREEN_MULTIPLIER = "gM";
  15667. a.A_BLUE_MULTIPLIER = "bM";
  15668. return a
  15669. } ();
  15670. c.ConstValues = d;
  15671. var h = function() {
  15672. function a() {}
  15673. a.transformPointWithParent = function(b, c) {
  15674. var d = a._helpMatrix;
  15675. a.transformToMatrix(c, d);
  15676. d.invert();
  15677. var e = b.x,
  15678. h = b.y;
  15679. b.x = d.a * e + d.c * h + d.tx;
  15680. b.y = d.d * h + d.b * e + d.ty;
  15681. b.skewX = a.formatRadian(b.skewX - c.skewX);
  15682. b.skewY = a.formatRadian(b.skewY - c.skewY)
  15683. };
  15684. a.transformToMatrix = function(a, b) {
  15685. b.a = a.scaleX * Math.cos(a.skewY);
  15686. b.b = a.scaleX * Math.sin(a.skewY);
  15687. b.c = -a.scaleY * Math.sin(a.skewX);
  15688. b.d = a.scaleY * Math.cos(a.skewX);
  15689. b.tx = a.x;
  15690. b.ty = a.y
  15691. };
  15692. a.formatRadian = function(b) {
  15693. b %= a.DOUBLE_PI;
  15694. b > Math.PI && (b -= a.DOUBLE_PI);
  15695. b < -Math.PI && (b += a.DOUBLE_PI);
  15696. return b
  15697. };
  15698. a.DOUBLE_PI = 2 * Math.PI;
  15699. a._helpMatrix = new e.Matrix;
  15700. return a
  15701. } ();
  15702. c.TransformUtil = h;
  15703. d = function() {
  15704. function c() {}
  15705. c.transformArmatureData = function(a) {
  15706. for (var b = a.getBoneDataList(), c = b.length, d, e; c--;) if (d = b[c], d.parent && (e = a.getBoneData(d.parent))) d.transform.copy(d.global),
  15707. h.transformPointWithParent(d.transform, e.global)
  15708. };
  15709. c.transformArmatureDataAnimations = function(a) {
  15710. for (var b = a.getAnimationDataList(), d = b.length; d--;) c.transformAnimationData(b[d], a)
  15711. };
  15712. c.transformAnimationData = function(a, b) {
  15713. for (var d = b.getSkinData(null), e = b.getBoneDataList(), d = d.getSlotDataList(), f = e.length, k, m, l, g, n, w, E, x, y, H; f--;) if (k = e[f], m = a.getTimeline(k.name)) {
  15714. l = null;
  15715. for (var L in d) if (l = d[L], l.parent == k.name) break;
  15716. g = k.parent ? a.getTimeline(k.parent) : null;
  15717. n = m.getFrameList();
  15718. x = E = w = null;
  15719. H = n.length;
  15720. for (var G = 0; G < H; G++) {
  15721. y = n[G];
  15722. g ? (c._helpTransform1.copy(y.global), c.getTimelineTransform(g, y.position, c._helpTransform2), h.transformPointWithParent(c._helpTransform1, c._helpTransform2), y.transform.copy(c._helpTransform1)) : y.transform.copy(y.global);
  15723. y.transform.x -= k.transform.x;
  15724. y.transform.y -= k.transform.y;
  15725. y.transform.skewX -= k.transform.skewX;
  15726. y.transform.skewY -= k.transform.skewY;
  15727. y.transform.scaleX -= k.transform.scaleX;
  15728. y.transform.scaleY -= k.transform.scaleY; ! m.transformed && l && (y.zOrder -= l.zOrder);
  15729. w || (w = m.originTransform, w.copy(y.transform), w.skewX = h.formatRadian(w.skewX), w.skewY = h.formatRadian(w.skewY), E = m.originPivot, E.x = y.pivot.x, E.y = y.pivot.y);
  15730. y.transform.x -= w.x;
  15731. y.transform.y -= w.y;
  15732. y.transform.skewX = h.formatRadian(y.transform.skewX - w.skewX);
  15733. y.transform.skewY = h.formatRadian(y.transform.skewY - w.skewY);
  15734. y.transform.scaleX -= w.scaleX;
  15735. y.transform.scaleY -= w.scaleY;
  15736. m.transformed || (y.pivot.x -= E.x, y.pivot.y -= E.y);
  15737. if (x) {
  15738. var M = y.transform.skewX - x.transform.skewX;
  15739. x.tweenRotate ? 0 < x.tweenRotate ? (0 > M && (y.transform.skewX += 2 * Math.PI, y.transform.skewY += 2 * Math.PI), 1 < x.tweenRotate && (y.transform.skewX += 2 * Math.PI * (x.tweenRotate - 1), y.transform.skewY += 2 * Math.PI * (x.tweenRotate - 1))) : (0 < M && (y.transform.skewX -= 2 * Math.PI, y.transform.skewY -= 2 * Math.PI), 1 > x.tweenRotate && (y.transform.skewX += 2 * Math.PI * (x.tweenRotate + 1), y.transform.skewY += 2 * Math.PI * (x.tweenRotate + 1))) : (y.transform.skewX = x.transform.skewX + h.formatRadian(y.transform.skewX - x.transform.skewX), y.transform.skewY = x.transform.skewY + h.formatRadian(y.transform.skewY - x.transform.skewY))
  15740. }
  15741. x = y
  15742. }
  15743. m.transformed = !0
  15744. }
  15745. };
  15746. c.getTimelineTransform = function(b, c, d) {
  15747. for (var e = b.getFrameList(), f = e.length, k; f--;) if (b = e[f], b.position <= c && b.position + b.duration > c) {
  15748. k = b.tweenEasing;
  15749. f == e.length - 1 || isNaN(k) || c == b.position ? d.copy(b.global) : (c = (c - b.position) / b.duration, k && (c = a.TimelineState.getEaseValue(c, k)), e = e[f + 1], d.x = b.global.x + (e.global.x - b.global.x) * c, d.y = b.global.y + (e.global.y - b.global.y) * c, d.skewX = h.formatRadian(b.global.skewX + (e.global.skewX - b.global.skewX) * c), d.skewY = h.formatRadian(b.global.skewY + (e.global.skewY - b.global.skewY) * c), d.scaleX = b.global.scaleX + (e.global.scaleX - b.global.scaleX) * c, d.scaleY = b.global.scaleY + (e.global.scaleY - b.global.scaleY) * c);
  15750. break
  15751. }
  15752. };
  15753. c.addHideTimeline = function(a, c) {
  15754. for (var d = c.getBoneDataList(), e = d.length, h; e--;) h = d[e],
  15755. h = h.name,
  15756. a.getTimeline(h) || a.addTimeline(b.TransformTimeline.HIDE_TIMELINE, h)
  15757. };
  15758. c._helpTransform1 = new b.DBTransform;
  15759. c._helpTransform2 = new b.DBTransform;
  15760. return c
  15761. } ();
  15762. c.DBDataUtil = d
  15763. })(c.utils || (c.utils = {}));
  15764. var h = c.utils,
  15765. m = function() {
  15766. function a() {
  15767. this.global = new b.DBTransform;
  15768. this.origin = new b.DBTransform;
  15769. this.offset = new b.DBTransform;
  15770. this.tween = new b.DBTransform;
  15771. this.tween.scaleX = this.tween.scaleY = 0;
  15772. this._globalTransformMatrix = new e.Matrix;
  15773. this._visible = !0;
  15774. this._isDisplayOnStage = this._isColorChanged = !1;
  15775. this._scaleType = 0;
  15776. this.fixedRotation = !1
  15777. }
  15778. a.prototype.getVisible = function() {
  15779. return this._visible
  15780. };
  15781. a.prototype.setVisible = function(a) {
  15782. this._visible = a
  15783. };
  15784. a.prototype._setParent = function(a) {
  15785. this.parent = a
  15786. };
  15787. a.prototype._setArmature = function(a) {
  15788. this.armature && this.armature._removeDBObject(this); (this.armature = a) && this.armature._addDBObject(this)
  15789. };
  15790. a.prototype.dispose = function() {
  15791. this._globalTransformMatrix = this.tween = this.offset = this.origin = this.global = this.armature = this.parent = null
  15792. };
  15793. a.prototype._update = function() {
  15794. this.global.scaleX = (this.origin.scaleX + this.tween.scaleX) * this.offset.scaleX;
  15795. this.global.scaleY = (this.origin.scaleY + this.tween.scaleY) * this.offset.scaleY;
  15796. if (this.parent) {
  15797. var a = this.origin.x + this.offset.x + this.tween.x,
  15798. b = this.origin.y + this.offset.y + this.tween.y,
  15799. c = this.parent._globalTransformMatrix;
  15800. this._globalTransformMatrix.tx = this.global.x = c.a * a + c.c * b + c.tx;
  15801. this._globalTransformMatrix.ty = this.global.y = c.d * b + c.b * a + c.ty;
  15802. this.fixedRotation ? (this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY) : (this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX + this.parent.global.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY + this.parent.global.skewY);
  15803. this.parent.scaleMode >= this._scaleType && (this.global.scaleX *= this.parent.global.scaleX, this.global.scaleY *= this.parent.global.scaleY)
  15804. } else this._globalTransformMatrix.tx = this.global.x = this.origin.x + this.offset.x + this.tween.x,
  15805. this._globalTransformMatrix.ty = this.global.y = this.origin.y + this.offset.y + this.tween.y,
  15806. this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX,
  15807. this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY;
  15808. this._globalTransformMatrix.a = this.global.scaleX * Math.cos(this.global.skewY);
  15809. this._globalTransformMatrix.b = this.global.scaleX * Math.sin(this.global.skewY);
  15810. this._globalTransformMatrix.c = -this.global.scaleY * Math.sin(this.global.skewX);
  15811. this._globalTransformMatrix.d = this.global.scaleY * Math.cos(this.global.skewX)
  15812. };
  15813. return a
  15814. } ();
  15815. c.DBObject = m;
  15816. var k = function(a) {
  15817. function b(c) {
  15818. a.call(this);
  15819. this._displayBridge = c;
  15820. this._displayList = [];
  15821. this._displayIndex = -1;
  15822. this._scaleType = 1;
  15823. this._offsetZOrder = this._tweenZorder = this._originZOrder = 0;
  15824. this._isHideDisplay = this._isDisplayOnStage = !1;
  15825. this._blendMode = "normal";
  15826. this._displayBridge.updateBlendMode(this._blendMode)
  15827. }
  15828. __extends(b, a);
  15829. b.prototype.getZOrder = function() {
  15830. return this._originZOrder + this._tweenZorder + this._offsetZOrder
  15831. };
  15832. b.prototype.setZOrder = function(a) {
  15833. this.getZOrder() != a && (this._offsetZOrder = a - this._originZOrder - this._tweenZorder, this.armature && (this.armature._slotsZOrderChanged = !0))
  15834. };
  15835. b.prototype.getDisplay = function() {
  15836. var a = this._displayList[this._displayIndex];
  15837. return a instanceof g ? a.getDisplay() : a
  15838. };
  15839. b.prototype.setDisplay = function(a) {
  15840. this._displayList[this._displayIndex] = a;
  15841. this._setDisplay(a)
  15842. };
  15843. b.prototype.getBlendMode = function() {
  15844. return this._blendMode
  15845. };
  15846. b.prototype.setBlendMode = function(a) {
  15847. this._blendMode != a && (this._blendMode = a, this._displayBridge.getDisplay() && this._displayBridge.updateBlendMode(this._blendMode))
  15848. };
  15849. b.prototype.getChildArmature = function() {
  15850. var a = this._displayList[this._displayIndex];
  15851. return a instanceof g ? a: null
  15852. };
  15853. b.prototype.setChildArmature = function(a) { (this._displayList[this._displayIndex] = a) && this._setDisplay(a.getDisplay())
  15854. };
  15855. b.prototype.getDisplayList = function() {
  15856. return this._displayList
  15857. };
  15858. b.prototype.setDisplayList = function(a) {
  15859. if (!a) throw Error();
  15860. for (var b = this._displayList.length = a.length; b--;) this._displayList[b] = a[b];
  15861. 0 <= this._displayIndex && (a = this._displayIndex, this._displayIndex = -1, this._changeDisplay(a))
  15862. };
  15863. b.prototype._setDisplay = function(a) {
  15864. this._displayBridge.getDisplay() ? this._displayBridge.setDisplay(a) : (this._displayBridge.setDisplay(a), this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0));
  15865. this.updateChildArmatureAnimation();
  15866. a && this._displayBridge.updateBlendMode(this._blendMode); ! this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  15867. };
  15868. b.prototype._changeDisplay = function(a) {
  15869. if (0 > a) this._isHideDisplay || (this._isHideDisplay = !0, this._displayBridge.removeDisplay(), this.updateChildArmatureAnimation());
  15870. else {
  15871. if (this._isHideDisplay) {
  15872. this._isHideDisplay = !1;
  15873. var b = !0;
  15874. this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0)
  15875. }
  15876. var c = this._displayList.length;
  15877. a >= c && 0 < c && (a = c - 1);
  15878. this._displayIndex != a ? (this._displayIndex = a, a = this._displayList[this._displayIndex], a instanceof g ? this._setDisplay(a.getDisplay()) : this._setDisplay(a), this._dislayDataList && this._displayIndex <= this._dislayDataList.length && this.origin.copy(this._dislayDataList[this._displayIndex].transform)) : b && this.updateChildArmatureAnimation()
  15879. } ! this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  15880. };
  15881. b.prototype.setVisible = function(a) {
  15882. a != this._visible && (this._visible = a, this._updateVisible(this._visible))
  15883. };
  15884. b.prototype._setArmature = function(b) {
  15885. a.prototype._setArmature.call(this, b);
  15886. this.armature ? (this.armature._slotsZOrderChanged = !0, this._displayBridge.addDisplay(this.armature.getDisplay(), -1)) : this._displayBridge.removeDisplay()
  15887. };
  15888. b.prototype.dispose = function() {
  15889. this._displayBridge && (a.prototype.dispose.call(this), this._displayBridge.dispose(), this._displayList.length = 0, this._dislayDataList = this._displayList = this._displayBridge = null)
  15890. };
  15891. b.prototype._update = function() {
  15892. a.prototype._update.call(this);
  15893. if (this._isDisplayOnStage) {
  15894. var b = this.parent._tweenPivot.x,
  15895. c = this.parent._tweenPivot.y;
  15896. if (b || c) {
  15897. var d = this.parent._globalTransformMatrix;
  15898. this._globalTransformMatrix.tx += d.a * b + d.c * c;
  15899. this._globalTransformMatrix.ty += d.b * b + d.d * c
  15900. }
  15901. this._displayBridge.updateTransform(this._globalTransformMatrix, this.global)
  15902. }
  15903. };
  15904. b.prototype._updateVisible = function(a) {
  15905. this._displayBridge.setVisible(this.parent.getVisible() && this._visible && a)
  15906. };
  15907. b.prototype.updateChildArmatureAnimation = function() {
  15908. var a = this.getChildArmature();
  15909. if (a) if (this._isHideDisplay) a.animation.stop(),
  15910. a.animation._lastAnimationState = null;
  15911. else {
  15912. var b = this.armature ? this.armature.animation.getLastAnimationName() : null;
  15913. b && a.animation.hasAnimation(b) ? a.animation.gotoAndPlay(b) : a.animation.play()
  15914. }
  15915. };
  15916. return b
  15917. } (m);
  15918. c.Slot = k;
  15919. var f = function(a) {
  15920. function b() {
  15921. a.call(this);
  15922. this._children = [];
  15923. this._scaleType = 2;
  15924. this._tweenPivot = new e.Point;
  15925. this.scaleMode = 1
  15926. }
  15927. __extends(b, a);
  15928. b.prototype.setVisible = function(a) {
  15929. if (this._visible != a) for (this._visible = a, a = this._children.length; a--;) {
  15930. var b = this._children[a];
  15931. b instanceof k && b._updateVisible(this._visible)
  15932. }
  15933. };
  15934. b.prototype._setArmature = function(b) {
  15935. a.prototype._setArmature.call(this, b);
  15936. for (b = this._children.length; b--;) this._children[b]._setArmature(this.armature)
  15937. };
  15938. b.prototype.dispose = function() {
  15939. if (this._children) {
  15940. a.prototype.dispose.call(this);
  15941. for (var b = this._children.length; b--;) this._children[b].dispose();
  15942. this._children.length = 0;
  15943. this.slot = this._tweenPivot = this._children = null
  15944. }
  15945. };
  15946. b.prototype.contains = function(a) {
  15947. if (!a) throw Error();
  15948. if (a == this) return ! 1;
  15949. for (; a != this && null != a;) a = a.parent;
  15950. return a == this
  15951. };
  15952. b.prototype.addChild = function(a) {
  15953. if (!a) throw Error();
  15954. if (a == this || a instanceof b && a.contains(this)) throw Error("An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)");
  15955. a.parent && a.parent.removeChild(a);
  15956. this._children[this._children.length] = a;
  15957. a._setParent(this);
  15958. a._setArmature(this.armature); ! this.slot && a instanceof k && (this.slot = a)
  15959. };
  15960. b.prototype.removeChild = function(a) {
  15961. if (!a) throw Error();
  15962. var b = this._children.indexOf(a);
  15963. if (0 <= b) this._children.splice(b, 1),
  15964. a._setParent(null),
  15965. a._setArmature(null),
  15966. a == this.slot && (this.slot = null);
  15967. else throw Error();
  15968. };
  15969. b.prototype.getSlots = function() {
  15970. for (var a = [], b = this._children.length; b--;) this._children[b] instanceof k && a.unshift(this._children[b]);
  15971. return a
  15972. };
  15973. b.prototype._arriveAtFrame = function(a, c, e, h) {
  15974. if (a) {
  15975. if (c = e.getMixingTransform(this.name), !e.displayControl || 2 != c && -1 != c || this.displayController && this.displayController != e.name || !this.slot || (c = a.displayIndex, 0 <= c && !isNaN(a.zOrder) && a.zOrder != this.slot._tweenZorder && (this.slot._tweenZorder = a.zOrder, this.armature._slotsZOrderChanged = !0), this.slot._changeDisplay(c), this.slot._updateVisible(a.visible)), a.event && this.armature.hasEventListener(d.FrameEvent.BONE_FRAME_EVENT) && (c = new d.FrameEvent(d.FrameEvent.BONE_FRAME_EVENT), c.bone = this, c.animationState = e, c.frameLabel = a.event, this.armature._eventList.push(c)), a.sound && b._soundManager.hasEventListener(d.SoundEvent.SOUND) && (c = new d.SoundEvent(d.SoundEvent.SOUND), c.armature = this.armature, c.animationState = e, c.sound = a.sound, b._soundManager.dispatchEvent(c)), a.action) for (var f in this._children) this._children[f] instanceof k && (e = this._children[f].getChildArmature()) && e.animation.gotoAndPlay(a.action)
  15976. } else this.slot && this.slot._changeDisplay( - 1)
  15977. };
  15978. b.prototype._updateColor = function(a, b, c, d, e, h, f, k, m) { (m || this._isColorChanged) && this.slot._displayBridge.updateColor(a, b, c, d, e, h, f, k);
  15979. this._isColorChanged = m
  15980. };
  15981. b._soundManager = d.SoundEventManager.getInstance();
  15982. return b
  15983. } (m);
  15984. c.Bone = f;
  15985. var g = function(b) {
  15986. function c(d) {
  15987. b.call(this);
  15988. this.animation = new a.Animation(this);
  15989. this._display = d;
  15990. this._slotsZOrderChanged = !1;
  15991. this._slotList = [];
  15992. this._boneList = [];
  15993. this._eventList = []
  15994. }
  15995. __extends(c, b);
  15996. c.prototype.getDisplay = function() {
  15997. return this._display
  15998. };
  15999. c.prototype.dispose = function() {
  16000. if (this.animation) {
  16001. this.animation.dispose();
  16002. for (var a = this._slotList.length; a--;) this._slotList[a].dispose();
  16003. for (a = this._boneList.length; a--;) this._boneList[a].dispose();
  16004. this._slotList.length = 0;
  16005. this._boneList.length = 0;
  16006. this._eventList.length = 0;
  16007. this.animation = this._display = this._eventList = this._boneList = this._slotList = null
  16008. }
  16009. };
  16010. c.prototype.advanceTime = function(a) {
  16011. this.animation.advanceTime(a);
  16012. a *= this.animation.timeScale;
  16013. for (var b = this._boneList.length; b--;) this._boneList[b]._update();
  16014. for (var b = this._slotList.length,
  16015. c; b--;) c = this._slotList[b],
  16016. c._update(),
  16017. c._isDisplayOnStage && (c = c.getChildArmature()) && c.advanceTime(a);
  16018. this._slotsZOrderChanged && (this.updateSlotsZOrder(), this.hasEventListener(d.ArmatureEvent.Z_ORDER_UPDATED) && this.dispatchEvent(new d.ArmatureEvent(d.ArmatureEvent.Z_ORDER_UPDATED)));
  16019. if (this._eventList.length) {
  16020. a = this._eventList.length;
  16021. for (b = 0; b < a; b++) this.dispatchEvent(this._eventList[b]);
  16022. this._eventList.length = 0
  16023. }
  16024. };
  16025. c.prototype.getSlots = function(a) {
  16026. "undefined" === typeof a && (a = !0);
  16027. return a ? this._slotList.concat() : this._slotList
  16028. };
  16029. c.prototype.getBones = function(a) {
  16030. "undefined" === typeof a && (a = !0);
  16031. return a ? this._boneList.concat() : this._boneList
  16032. };
  16033. c.prototype.getSlot = function(a) {
  16034. for (var b = this._slotList.length; b--;) if (this._slotList[b].name == a) return this._slotList[b];
  16035. return null
  16036. };
  16037. c.prototype.getSlotByDisplay = function(a) {
  16038. if (a) for (var b = this._slotList.length; b--;) if (this._slotList[b].getDisplay() == a) return this._slotList[b];
  16039. return null
  16040. };
  16041. c.prototype.removeSlot = function(a) {
  16042. if (!a) throw Error();
  16043. if (0 <= this._slotList.indexOf(a)) a.parent.removeChild(a);
  16044. else throw Error();
  16045. };
  16046. c.prototype.removeSlotByName = function(a) {
  16047. a && (a = this.getSlot(a)) && this.removeSlot(a)
  16048. };
  16049. c.prototype.getBone = function(a) {
  16050. for (var b = this._boneList.length; b--;) if (this._boneList[b].name == a) return this._boneList[b];
  16051. return null
  16052. };
  16053. c.prototype.getBoneByDisplay = function(a) {
  16054. return (a = this.getSlotByDisplay(a)) ? a.parent: null
  16055. };
  16056. c.prototype.removeBone = function(a) {
  16057. if (!a) throw Error();
  16058. if (0 <= this._boneList.indexOf(a)) a.parent ? a.parent.removeChild(a) : a._setArmature(null);
  16059. else throw Error();
  16060. };
  16061. c.prototype.removeBoneByName = function(a) {
  16062. a && (a = this.getBone(a)) && this.removeBone(a)
  16063. };
  16064. c.prototype.addChild = function(a, b) {
  16065. if (!a) throw Error();
  16066. if (b) {
  16067. var c = this.getBone(b);
  16068. if (c) c.addChild(a);
  16069. else throw Error();
  16070. } else a.parent && a.parent.removeChild(a),
  16071. a._setArmature(this)
  16072. };
  16073. c.prototype.updateSlotsZOrder = function() {
  16074. this._slotList.sort(this.sortSlot);
  16075. for (var a = this._slotList.length,
  16076. b; a--;) b = this._slotList[a],
  16077. b._isDisplayOnStage && b._displayBridge.addDisplay(this._display, -1);
  16078. this._slotsZOrderChanged = !1
  16079. };
  16080. c.prototype._addDBObject = function(a) {
  16081. a instanceof k ? 0 > this._slotList.indexOf(a) && (this._slotList[this._slotList.length] = a) : a instanceof f && 0 > this._boneList.indexOf(a) && (this._boneList[this._boneList.length] = a, this._sortBoneList())
  16082. };
  16083. c.prototype._removeDBObject = function(a) {
  16084. a instanceof k ? (a = this._slotList.indexOf(a), 0 <= a && this._slotList.splice(a, 1)) : a instanceof f && (a = this._boneList.indexOf(a), 0 <= a && this._boneList.splice(a, 1))
  16085. };
  16086. c.prototype._sortBoneList = function() {
  16087. var a = this._boneList.length;
  16088. if (0 != a) {
  16089. for (var b = [], c, d, e; a--;) {
  16090. c = 0;
  16091. for (e = d = this._boneList[a]; e;) c++,
  16092. e = e.parent;
  16093. b[a] = {
  16094. level: c,
  16095. bone: d
  16096. }
  16097. }
  16098. b.sort(this.sortBone);
  16099. for (a = b.length; a--;) this._boneList[a] = b[a].bone
  16100. }
  16101. };
  16102. c.prototype._arriveAtFrame = function(a, b, e, h) {
  16103. a.event && this.hasEventListener(d.FrameEvent.ANIMATION_FRAME_EVENT) && (b = new d.FrameEvent(d.FrameEvent.ANIMATION_FRAME_EVENT), b.animationState = e, b.frameLabel = a.event, this._eventList.push(b));
  16104. a.sound && c._soundManager.hasEventListener(d.SoundEvent.SOUND) && (b = new d.SoundEvent(d.SoundEvent.SOUND), b.armature = this, b.animationState = e, b.sound = a.sound, c._soundManager.dispatchEvent(b));
  16105. a.action && e.isPlaying && this.animation.gotoAndPlay(a.action)
  16106. };
  16107. c.prototype.sortSlot = function(a, b) {
  16108. return a.getZOrder() < b.getZOrder() ? 1 : -1
  16109. };
  16110. c.prototype.sortBone = function(a, b) {
  16111. return a.level < b.level ? 1 : -1
  16112. };
  16113. c._soundManager = d.SoundEventManager.getInstance();
  16114. return c
  16115. } (d.EventDispatcher);
  16116. c.Armature = g
  16117. })(dragonBones || (dragonBones = {}));
  16118. __extends = this.__extends ||
  16119. function(c, e) {
  16120. function d() {
  16121. this.constructor = c
  16122. }
  16123. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16124. d.prototype = e.prototype;
  16125. c.prototype = new d
  16126. }; (function(c) { (function(c) {
  16127. var a = function() {
  16128. function a() {}
  16129. a.prototype.getVisible = function() {
  16130. return this._display ? this._display.visible: !1
  16131. };
  16132. a.prototype.setVisible = function(a) {
  16133. this._display && (this._display.visible = a)
  16134. };
  16135. a.prototype.getDisplay = function() {
  16136. return this._display
  16137. };
  16138. a.prototype.setDisplay = function(a) {
  16139. if (this._display != a) {
  16140. if (this._display) {
  16141. var b = this._display.parent;
  16142. if (b) var c = b.getChildIndex(this._display);
  16143. this.removeDisplay()
  16144. }
  16145. this._display = a;
  16146. this.addDisplay(b, c)
  16147. }
  16148. };
  16149. a.prototype.dispose = function() {
  16150. this._display = null
  16151. };
  16152. a.prototype.updateTransform = function(c, d) {
  16153. this._display._x = c.tx;
  16154. this._display._y = c.ty;
  16155. this._display._skewX = d.skewX * a.RADIAN_TO_ANGLE;
  16156. this._display._skewY = d.skewY * a.RADIAN_TO_ANGLE;
  16157. this._display._scaleX = d.scaleX;
  16158. this._display._scaleY = d.scaleY
  16159. };
  16160. a.prototype.updateColor = function(a, b, c, d, e, l, n, p) {
  16161. this._display && (this._display._alpha = e)
  16162. };
  16163. a.prototype.updateBlendMode = function(a) {
  16164. this._display && a && (this._display.blendMode = egret.BlendMode.getBlendMode(a))
  16165. };
  16166. a.prototype.addDisplay = function(a, b) {
  16167. a && this._display && (this._display._parent && this._display._parent.removeChild(this._display), 0 > b ? a.addChild(this._display) : a.addChildAt(this._display, Math.min(b, a.numChildren)))
  16168. };
  16169. a.prototype.removeDisplay = function() {
  16170. this._display && this._display._parent && this._display._parent.removeChild(this._display)
  16171. };
  16172. a.RADIAN_TO_ANGLE = 180 / Math.PI;
  16173. return a
  16174. } ();
  16175. c.DragonBonesEgretBridge = a
  16176. })(c.display || (c.display = {}));
  16177. var e = c.display; (function(d) {
  16178. var a = function() {
  16179. function a(b, d, e) {
  16180. "undefined" === typeof e && (e = 1);
  16181. this.texture = b;
  16182. this.textureAtlasRawData = d;
  16183. this._textureData = {};
  16184. this.scale = e;
  16185. this.name = d[c.utils.ConstValues.A_NAME];
  16186. this.parseData(d);
  16187. this.spriteSheet = new egret.SpriteSheet(b)
  16188. }
  16189. a.prototype.getTexture = function(a) {
  16190. var b = this.spriteSheet.getTexture(a);
  16191. b || (b = this._textureData[a], b = this.spriteSheet.createTexture(a, b.x, b.y, b.width, b.height));
  16192. return b
  16193. };
  16194. a.prototype.dispose = function() {
  16195. this.texture = null
  16196. };
  16197. a.prototype.getRegion = function(a) {
  16198. throw Error("error");
  16199. };
  16200. a.prototype.parseData = function(a) {
  16201. for (var b = a.SubTexture.length,
  16202. c = 0; c < b; c++) {
  16203. var d = a.SubTexture[c];
  16204. this._textureData[d.name] = d
  16205. }
  16206. };
  16207. return a
  16208. } ();
  16209. d.EgretTextureAtlas = a
  16210. })(c.textures || (c.textures = {})); (function(d) {
  16211. var a = function(a) {
  16212. function d() {
  16213. a.call(this)
  16214. }
  16215. __extends(d, a);
  16216. d.prototype._generateArmature = function() {
  16217. return new c.Armature(new egret.DisplayObjectContainer)
  16218. };
  16219. d.prototype._generateSlot = function() {
  16220. return new c.Slot(new e.DragonBonesEgretBridge)
  16221. };
  16222. d.prototype._generateDisplay = function(a, b, c, d) {
  16223. var e = new egret.Bitmap;
  16224. e.texture = a.getTexture(b);
  16225. e.anchorOffsetX = c;
  16226. e.anchorOffsetY = d;
  16227. return e
  16228. };
  16229. return d
  16230. } (d.BaseFactory);
  16231. d.EgretFactory = a
  16232. })(c.factorys || (c.factorys = {}))
  16233. })(dragonBones || (dragonBones = {})); (function(c) {
  16234. var e = function() {
  16235. function d() {}
  16236. d.TRACE_RENDER_LOOP = function(a) {
  16237. "undefined" === typeof a && (a = 0);
  16238. var b = c.Ticker.getInstance(),
  16239. d = c.MainContext.instance;
  16240. switch (a) {
  16241. case 0:
  16242. b.unregister(d.renderLoop, d);
  16243. break;
  16244. case 1:
  16245. d.renderLoop();
  16246. break;
  16247. case 2:
  16248. b.register(d.renderLoop, d)
  16249. }
  16250. };
  16251. d.DRAW_IMAGE = !0;
  16252. d.ADD_EVENT_LISTENER = !0;
  16253. d.SCALE_BITMAP_SET_SCALE_GRID = !0;
  16254. return d
  16255. } ();
  16256. c.DEBUG = e
  16257. })(egret || (egret = {})); (function(c) {
  16258. var e = function() {
  16259. function c() {}
  16260. c.isNumber = function(a) {
  16261. return "number" === typeof a && !isNaN(a)
  16262. };
  16263. return c
  16264. } ();
  16265. c.NumberUtils = e
  16266. })(egret || (egret = {}));
  16267. var __extends = this.__extends ||
  16268. function(c, e) {
  16269. function d() {
  16270. this.constructor = c
  16271. }
  16272. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16273. d.prototype = e.prototype;
  16274. c.prototype = new d
  16275. },
  16276. RES; (function(c) {
  16277. var e = function(c) {
  16278. function a(a, e, m) {
  16279. "undefined" === typeof e && (e = !1);
  16280. "undefined" === typeof m && (m = !1);
  16281. c.call(this, a, e, m);
  16282. this.itemsTotal = this.itemsLoaded = 0
  16283. }
  16284. __extends(a, c);
  16285. a.dispatchResourceEvent = function(b, c, d, e, f, g) {
  16286. "undefined" === typeof d && (d = "");
  16287. "undefined" === typeof e && (e = null);
  16288. "undefined" === typeof f && (f = 0);
  16289. "undefined" === typeof g && (g = 0);
  16290. var l = egret.Event._getPropertyData(a);
  16291. l.groupName = d;
  16292. l.resItem = e;
  16293. l.itemsLoaded = f;
  16294. l.itemsTotal = g;
  16295. egret.Event._dispatchByTarget(a, b, c, l)
  16296. };
  16297. a.ITEM_LOAD_ERROR = "itemLoadError";
  16298. a.CONFIG_COMPLETE = "configComplete";
  16299. a.GROUP_PROGRESS = "groupProgress";
  16300. a.GROUP_COMPLETE = "groupComplete";
  16301. return a
  16302. } (egret.Event);
  16303. c.ResourceEvent = e
  16304. })(RES || (RES = {})); (function(c) {
  16305. var e = function() {
  16306. function c(a, b, d) {
  16307. this._loaded = !1;
  16308. this.name = a;
  16309. this.url = b;
  16310. this.type = d
  16311. }
  16312. Object.defineProperty(c.prototype, "loaded", {
  16313. get: function() {
  16314. return this.data ? this.data.loaded: this._loaded
  16315. },
  16316. set: function(a) {
  16317. this.data && (this.data.loaded = a);
  16318. this._loaded = a
  16319. },
  16320. enumerable: !0,
  16321. configurable: !0
  16322. });
  16323. c.prototype.toString = function() {
  16324. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  16325. };
  16326. c.TYPE_XML = "xml";
  16327. c.TYPE_IMAGE = "image";
  16328. c.TYPE_BIN = "bin";
  16329. c.TYPE_TEXT = "text";
  16330. c.TYPE_JSON = "json";
  16331. c.TYPE_SHEET = "sheet";
  16332. c.TYPE_FONT = "font";
  16333. c.TYPE_SOUND = "sound";
  16334. return c
  16335. } ();
  16336. c.ResourceItem = e
  16337. })(RES || (RES = {})); (function(c) {
  16338. var e = function() {
  16339. function d() {
  16340. this.keyMap = {};
  16341. this.groupDic = {}
  16342. }
  16343. d.prototype.getGroupByName = function(a) {
  16344. var b = [];
  16345. if (!this.groupDic[a]) return b;
  16346. a = this.groupDic[a];
  16347. for (var c = a.length,
  16348. d = 0; d < c; d++) b.push(this.parseResourceItem(a[d]));
  16349. return b
  16350. };
  16351. d.prototype.getRawGroupByName = function(a) {
  16352. return this.groupDic[a] ? this.groupDic[a] : []
  16353. };
  16354. d.prototype.createGroup = function(a, b, c) {
  16355. "undefined" === typeof c && (c = !1);
  16356. if (!c && this.groupDic[a] || !b || 0 == b.length) return ! 1;
  16357. c = this.groupDic;
  16358. for (var d = [], e = b.length, f = 0; f < e; f++) {
  16359. var g = b[f],
  16360. l = c[g];
  16361. if (l) for (var g = l.length,
  16362. n = 0; n < g; n++) {
  16363. var p = l[n]; - 1 == d.indexOf(p) && d.push(p)
  16364. } else(p = this.keyMap[g]) && -1 == d.indexOf(p) && d.push(p)
  16365. }
  16366. if (0 == d.length) return ! 1;
  16367. this.groupDic[a] = d;
  16368. return ! 0
  16369. };
  16370. d.prototype.parseConfig = function(a, b) {
  16371. if (a) {
  16372. var c = a.resources;
  16373. if (c) for (var d = c.length,
  16374. e = 0; e < d; e++) {
  16375. var f = c[e];
  16376. f.url = b + f.url;
  16377. this.keyMap[f.name] || (this.keyMap[f.name] = f)
  16378. }
  16379. if (c = a.groups) for (d = c.length, e = 0; e < d; e++) {
  16380. for (var g = c[e], l = [], n = g.keys.split(","), p = n.length, q = 0; q < p; q++) f = n[q].trim(),
  16381. (f = this.keyMap[f]) && -1 == l.indexOf(f) && l.push(f);
  16382. this.groupDic[g.name] = l
  16383. }
  16384. }
  16385. };
  16386. d.prototype.getType = function(a) {
  16387. return (a = this.keyMap[a]) ? a.type: ""
  16388. };
  16389. d.prototype.getRawResourceItem = function(a) {
  16390. return this.keyMap[a]
  16391. };
  16392. d.prototype.getResourceItem = function(a) {
  16393. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  16394. };
  16395. d.prototype.parseResourceItem = function(a) {
  16396. var b = new c.ResourceItem(a.name, a.url, a.type);
  16397. b.data = a;
  16398. return b
  16399. };
  16400. return d
  16401. } ();
  16402. c.ResourceConfig = e
  16403. })(RES || (RES = {}));
  16404. __extends = this.__extends ||
  16405. function(c, e) {
  16406. function d() {
  16407. this.constructor = c
  16408. }
  16409. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16410. d.prototype = e.prototype;
  16411. c.prototype = new d
  16412. }; (function(c) {
  16413. var e = function(d) {
  16414. function a() {
  16415. d.call(this);
  16416. this.groupTotalDic = {};
  16417. this.numLoadedDic = {};
  16418. this.itemListDic = {};
  16419. this.priorityQueue = {};
  16420. this.lazyLoadList = [];
  16421. this.analyzerDic = {};
  16422. this.queueIndex = 0
  16423. }
  16424. __extends(a, d);
  16425. a.prototype.isGroupInLoading = function(a) {
  16426. return void 0 !== this.itemListDic[a]
  16427. };
  16428. a.prototype.loadGroup = function(a, d, e) {
  16429. "undefined" === typeof e && (e = 0);
  16430. if (!this.itemListDic[d] && d) if (a && 0 != a.length) {
  16431. this.priorityQueue[e] ? this.priorityQueue[e].push(d) : this.priorityQueue[e] = [d];
  16432. this.itemListDic[d] = a;
  16433. e = a.length;
  16434. for (var k = 0; k < e; k++) a[k].groupName = d;
  16435. this.groupTotalDic[d] = a.length;
  16436. this.numLoadedDic[d] = 0;
  16437. this.next()
  16438. } else a = new c.ResourceEvent(c.ResourceEvent.GROUP_COMPLETE),
  16439. a.groupName = d,
  16440. this.dispatchEvent(a)
  16441. };
  16442. a.prototype.loadItem = function(a) {
  16443. this.lazyLoadList.push(a);
  16444. a.groupName = "";
  16445. this.next()
  16446. };
  16447. a.prototype.next = function() {
  16448. var a = this.getOneResourceItem();
  16449. if (a) if (a.loaded) this.onItemComplete(a);
  16450. else {
  16451. var d = this.analyzerDic[a.type];
  16452. d || (d = this.analyzerDic[a.type] = egret.Injector.getInstance(c.AnalyzerBase, a.type));
  16453. d.loadFile(a, this.onItemComplete, this)
  16454. }
  16455. };
  16456. a.prototype.getOneResourceItem = function() {
  16457. var a = Number.NEGATIVE_INFINITY,
  16458. c;
  16459. for (c in this.priorityQueue) a = Math.max(a, c);
  16460. a = this.priorityQueue[a];
  16461. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null: this.lazyLoadList.pop();
  16462. c = a.length;
  16463. for (var d, e = 0; e < c; e++) {
  16464. this.queueIndex >= c && (this.queueIndex = 0);
  16465. d = this.itemListDic[a[this.queueIndex]];
  16466. if (0 < d.length) break;
  16467. this.queueIndex++
  16468. }
  16469. return 0 == d.length ? null: d.shift()
  16470. };
  16471. a.prototype.onItemComplete = function(a) {
  16472. var d = a.groupName;
  16473. a.loaded || c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.ITEM_LOAD_ERROR, d, a);
  16474. if (d) {
  16475. this.numLoadedDic[d]++;
  16476. var e = this.numLoadedDic[d],
  16477. k = this.groupTotalDic[d];
  16478. c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.GROUP_PROGRESS, d, a, e, k);
  16479. e == k && (this.removeGroupName(d), delete this.groupTotalDic[d], delete this.numLoadedDic[d], delete this.itemListDic[d], c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, d))
  16480. } else this.callBack.call(this.resInstance, a);
  16481. this.next()
  16482. };
  16483. a.prototype.removeGroupName = function(a) {
  16484. for (var c in this.priorityQueue) {
  16485. for (var d = this.priorityQueue[c], e = d.length, f = 0, g = !1, e = d.length, l = 0; l < e; l++) {
  16486. if (d[l] == a) {
  16487. d.splice(f, 1);
  16488. g = !0;
  16489. break
  16490. }
  16491. f++
  16492. }
  16493. if (g) {
  16494. 0 == d.length && delete this.priorityQueue[c];
  16495. break
  16496. }
  16497. }
  16498. };
  16499. return a
  16500. } (egret.EventDispatcher);
  16501. c.ResourceLoader = e
  16502. })(RES || (RES = {}));
  16503. __extends = this.__extends ||
  16504. function(c, e) {
  16505. function d() {
  16506. this.constructor = c
  16507. }
  16508. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16509. d.prototype = e.prototype;
  16510. c.prototype = new d
  16511. }; (function(c) {
  16512. var e = function(c) {
  16513. function a() {
  16514. c.call(this)
  16515. }
  16516. __extends(a, c);
  16517. a.prototype.loadFile = function(a, c, d) {};
  16518. a.prototype.getRes = function(a) {};
  16519. a.prototype.destroyRes = function(a) {
  16520. return ! 1
  16521. };
  16522. a.getStringPrefix = function(a) {
  16523. if (!a) return "";
  16524. var c = a.indexOf(".");
  16525. return - 1 != c ? a.substring(0, c) : ""
  16526. };
  16527. a.getStringTail = function(a) {
  16528. if (!a) return "";
  16529. var c = a.indexOf(".");
  16530. return - 1 != c ? a.substring(c + 1) : ""
  16531. };
  16532. return a
  16533. } (egret.HashObject);
  16534. c.AnalyzerBase = e
  16535. })(RES || (RES = {}));
  16536. __extends = this.__extends ||
  16537. function(c, e) {
  16538. function d() {
  16539. this.constructor = c
  16540. }
  16541. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16542. d.prototype = e.prototype;
  16543. c.prototype = new d
  16544. }; (function(c) {
  16545. var e = function(c) {
  16546. function a() {
  16547. c.call(this);
  16548. this.fileDic = {};
  16549. this.resItemDic = [];
  16550. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  16551. this.recycler = new egret.Recycler
  16552. }
  16553. __extends(a, c);
  16554. a.prototype.loadFile = function(a, c, d) {
  16555. if (this.fileDic[a.name]) c.call(d, a);
  16556. else {
  16557. var e = this.getLoader();
  16558. this.resItemDic[e.hashCode] = {
  16559. item: a,
  16560. func: c,
  16561. thisObject: d
  16562. };
  16563. e.load(new egret.URLRequest(a.url))
  16564. }
  16565. };
  16566. a.prototype.getLoader = function() {
  16567. var a = this.recycler.pop();
  16568. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE, this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  16569. a.dataFormat = this._dataFormat;
  16570. return a
  16571. };
  16572. a.prototype.onLoadFinish = function(a) {
  16573. var c = a.target,
  16574. d = this.resItemDic[c.hashCode];
  16575. delete this.resItemDic[c.hashCode];
  16576. this.recycler.push(c);
  16577. var e = d.item,
  16578. f = d.func;
  16579. e.loaded = a.type == egret.Event.COMPLETE;
  16580. e.loaded && this.analyzeData(e, c.data);
  16581. f.call(d.thisObject, e)
  16582. };
  16583. a.prototype.analyzeData = function(a, c) {
  16584. var d = a.name; ! this.fileDic[d] && c && (this.fileDic[d] = c)
  16585. };
  16586. a.prototype.getRes = function(a) {
  16587. return this.fileDic[a]
  16588. };
  16589. a.prototype.hasRes = function(a) {
  16590. return null != this.getRes(a)
  16591. };
  16592. a.prototype.destroyRes = function(a) {
  16593. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  16594. };
  16595. return a
  16596. } (c.AnalyzerBase);
  16597. c.BinAnalyzer = e
  16598. })(RES || (RES = {}));
  16599. __extends = this.__extends ||
  16600. function(c, e) {
  16601. function d() {
  16602. this.constructor = c
  16603. }
  16604. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16605. d.prototype = e.prototype;
  16606. c.prototype = new d
  16607. }; (function(c) {
  16608. var e = function(c) {
  16609. function a() {
  16610. c.call(this);
  16611. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  16612. }
  16613. __extends(a, c);
  16614. a.prototype.analyzeData = function(a, c) {
  16615. var d = a.name; ! this.fileDic[d] && c && (this.fileDic[d] = c, (d = a.data) && d.scale9grid && (d = d.scale9grid.split(","), c.scale9Grid = new egret.Rectangle(parseInt(d[0]), parseInt(d[1]), parseInt(d[2]), parseInt(d[3]))))
  16616. };
  16617. return a
  16618. } (c.BinAnalyzer);
  16619. c.ImageAnalyzer = e
  16620. })(RES || (RES = {}));
  16621. __extends = this.__extends ||
  16622. function(c, e) {
  16623. function d() {
  16624. this.constructor = c
  16625. }
  16626. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16627. d.prototype = e.prototype;
  16628. c.prototype = new d
  16629. }; (function(c) {
  16630. var e = function(c) {
  16631. function a() {
  16632. c.call(this);
  16633. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  16634. }
  16635. __extends(a, c);
  16636. a.prototype.analyzeData = function(a, c) {
  16637. var d = a.name;
  16638. if (!this.fileDic[d] && c) try {
  16639. this.fileDic[d] = JSON.parse(c)
  16640. } catch(e) {}
  16641. };
  16642. return a
  16643. } (c.BinAnalyzer);
  16644. c.JsonAnalyzer = e
  16645. })(RES || (RES = {}));
  16646. __extends = this.__extends ||
  16647. function(c, e) {
  16648. function d() {
  16649. this.constructor = c
  16650. }
  16651. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16652. d.prototype = e.prototype;
  16653. c.prototype = new d
  16654. }; (function(c) {
  16655. var e = function(c) {
  16656. function a() {
  16657. c.call(this);
  16658. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  16659. }
  16660. __extends(a, c);
  16661. return a
  16662. } (c.BinAnalyzer);
  16663. c.TextAnalyzer = e
  16664. })(RES || (RES = {}));
  16665. __extends = this.__extends ||
  16666. function(c, e) {
  16667. function d() {
  16668. this.constructor = c
  16669. }
  16670. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16671. d.prototype = e.prototype;
  16672. c.prototype = new d
  16673. }; (function(c) {
  16674. var e = function(d) {
  16675. function a() {
  16676. d.call(this);
  16677. this.sheetMap = {};
  16678. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  16679. }
  16680. __extends(a, d);
  16681. a.prototype.getRes = function(a) {
  16682. var d = this.fileDic[a]; ! d && (d = c.AnalyzerBase.getStringPrefix(a), d = this.fileDic[d]) && (a = c.AnalyzerBase.getStringTail(a), d = d.getTexture(a));
  16683. return d
  16684. };
  16685. a.prototype.onLoadFinish = function(a) {
  16686. var c = a.target,
  16687. d = this.resItemDic[c.hashCode];
  16688. delete this.resItemDic[c.hashCode];
  16689. this.recycler.push(c);
  16690. var e = d.item,
  16691. f = d.func;
  16692. e.loaded = a.type == egret.Event.COMPLETE;
  16693. e.loaded && this.analyzeData(e, c.data);
  16694. "string" == typeof c.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(e, f, d.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : f.call(d.thisObject, e)
  16695. };
  16696. a.prototype.analyzeData = function(a, c) {
  16697. var d = a.name;
  16698. if (!this.fileDic[d] && c) {
  16699. var e;
  16700. if ("string" == typeof c) {
  16701. try {
  16702. e = JSON.parse(c)
  16703. } catch(f) {}
  16704. e && (this.sheetMap[d] = e, a.loaded = !1, a.url = this.getRelativePath(a.url, e.file))
  16705. } else e = this.sheetMap[d],
  16706. delete this.sheetMap[d],
  16707. c && (e = this.parseSpriteSheet(c, e), this.fileDic[d] = e)
  16708. }
  16709. };
  16710. a.prototype.getRelativePath = function(a, c) {
  16711. a = a.split("\\").join("/");
  16712. var d = a.lastIndexOf("/");
  16713. return a = -1 != d ? a.substring(0, d + 1) + c: c
  16714. };
  16715. a.prototype.parseSpriteSheet = function(a, c) {
  16716. var d = c.frames;
  16717. if (!d) return null;
  16718. var e = new egret.SpriteSheet(a),
  16719. f;
  16720. for (f in d) {
  16721. var g = d[f];
  16722. e.createTexture(f, g.x, g.y, g.w, g.h)
  16723. }
  16724. return e
  16725. };
  16726. return a
  16727. } (c.BinAnalyzer);
  16728. c.SheetAnalyzer = e
  16729. })(RES || (RES = {}));
  16730. __extends = this.__extends ||
  16731. function(c, e) {
  16732. function d() {
  16733. this.constructor = c
  16734. }
  16735. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16736. d.prototype = e.prototype;
  16737. c.prototype = new d
  16738. }; (function(c) {
  16739. var e = function(c) {
  16740. function a() {
  16741. c.call(this)
  16742. }
  16743. __extends(a, c);
  16744. a.prototype.analyzeData = function(a, c) {
  16745. var d = a.name;
  16746. if (!this.fileDic[d] && c) {
  16747. var e;
  16748. "string" == typeof c ? (e = c, this.sheetMap[d] = e, a.loaded = !1, a.url = this.getTexturePath(a.url, e)) : (e = this.sheetMap[d], delete this.sheetMap[d], c && (e = new egret.BitmapTextSpriteSheet(c, e), this.fileDic[d] = e))
  16749. }
  16750. };
  16751. a.prototype.getTexturePath = function(a, c) {
  16752. var d = "",
  16753. e = c.split("\n")[2],
  16754. f = e.indexOf('file="'); - 1 != f && (e = e.substring(f + 6), f = e.indexOf('"'), d = e.substring(0, f));
  16755. a = a.split("\\").join("/");
  16756. f = a.lastIndexOf("/");
  16757. return a = -1 != f ? a.substring(0, f + 1) + d: d
  16758. };
  16759. return a
  16760. } (c.SheetAnalyzer);
  16761. c.FontAnalyzer = e
  16762. })(RES || (RES = {}));
  16763. __extends = this.__extends ||
  16764. function(c, e) {
  16765. function d() {
  16766. this.constructor = c
  16767. }
  16768. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16769. d.prototype = e.prototype;
  16770. c.prototype = new d
  16771. }; (function(c) {
  16772. var e = function(c) {
  16773. function a() {
  16774. c.call(this);
  16775. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  16776. }
  16777. __extends(a, c);
  16778. return a
  16779. } (c.BinAnalyzer);
  16780. c.SoundAnalyzer = e
  16781. })(RES || (RES = {}));
  16782. __extends = this.__extends ||
  16783. function(c, e) {
  16784. function d() {
  16785. this.constructor = c
  16786. }
  16787. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16788. d.prototype = e.prototype;
  16789. c.prototype = new d
  16790. }; (function(c) {
  16791. var e = function(c) {
  16792. function a() {
  16793. c.call(this);
  16794. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  16795. }
  16796. __extends(a, c);
  16797. a.prototype.analyzeData = function(a, c) {
  16798. var d = a.name;
  16799. if (!this.fileDic[d] && c) try {
  16800. var e = egret.XML.parse(c);
  16801. this.fileDic[d] = e
  16802. } catch(f) {}
  16803. };
  16804. return a
  16805. } (c.BinAnalyzer);
  16806. c.XMLAnalyzer = e
  16807. })(RES || (RES = {}));
  16808. __extends = this.__extends ||
  16809. function(c, e) {
  16810. function d() {
  16811. this.constructor = c
  16812. }
  16813. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16814. d.prototype = e.prototype;
  16815. c.prototype = new d
  16816. }; (function(c) {
  16817. c.loadConfig = function(c, a) {
  16818. "undefined" === typeof a && (a = "");
  16819. e.loadConfig(c, a)
  16820. };
  16821. c.loadGroup = function(c, a) {
  16822. "undefined" === typeof a && (a = 0);
  16823. e.loadGroup(c, a)
  16824. };
  16825. c.isGroupLoaded = function(c) {
  16826. return e.isGroupLoaded(c)
  16827. };
  16828. c.getGroupByName = function(c) {
  16829. return e.getGroupByName(c)
  16830. };
  16831. c.createGroup = function(c, a, b) {
  16832. "undefined" === typeof b && (b = !1);
  16833. return e.createGroup(c, a, b)
  16834. };
  16835. c.hasRes = function(c) {
  16836. return e.hasRes(c)
  16837. };
  16838. c.getRes = function(c) {
  16839. return e.getRes(c)
  16840. };
  16841. c.getResAsync = function(c, a, b) {
  16842. e.getResAsync(c, a, b)
  16843. };
  16844. c.getResByUrl = function(c, a, b, h) {
  16845. "undefined" === typeof h && (h = "");
  16846. e.getResByUrl(c, a, b, h)
  16847. };
  16848. c.destroyRes = function(c) {
  16849. return e.destroyRes(c)
  16850. };
  16851. c.addEventListener = function(c, a, b, h, m) {
  16852. "undefined" === typeof h && (h = !1);
  16853. "undefined" === typeof m && (m = 0);
  16854. e.addEventListener(c, a, b, h, m)
  16855. };
  16856. c.removeEventListener = function(c, a, b, h) {
  16857. "undefined" === typeof h && (h = !1);
  16858. e.removeEventListener(c, a, b, h)
  16859. };
  16860. var e = new(function(d) {
  16861. function a() {
  16862. d.call(this);
  16863. this.analyzerDic = {};
  16864. this.configComplete = !1;
  16865. this.loadedGroups = [];
  16866. this.groupNameList = [];
  16867. this.asyncDic = {};
  16868. this.init()
  16869. }
  16870. __extends(a, d);
  16871. a.prototype.getAnalyzerByType = function(a) {
  16872. var d = this.analyzerDic[a];
  16873. d || (d = this.analyzerDic[a] = egret.Injector.getInstance(c.AnalyzerBase, a));
  16874. return d
  16875. };
  16876. a.prototype.init = function() {
  16877. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(c.AnalyzerBase, c.BinAnalyzer, c.ResourceItem.TYPE_BIN);
  16878. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(c.AnalyzerBase, c.ImageAnalyzer, c.ResourceItem.TYPE_IMAGE);
  16879. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(c.AnalyzerBase, c.TextAnalyzer, c.ResourceItem.TYPE_TEXT);
  16880. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(c.AnalyzerBase, c.JsonAnalyzer, c.ResourceItem.TYPE_JSON);
  16881. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(c.AnalyzerBase, c.SheetAnalyzer, c.ResourceItem.TYPE_SHEET);
  16882. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(c.AnalyzerBase, c.FontAnalyzer, c.ResourceItem.TYPE_FONT);
  16883. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(c.AnalyzerBase, c.SoundAnalyzer, c.ResourceItem.TYPE_SOUND);
  16884. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_XML) || egret.Injector.mapClass(c.AnalyzerBase, c.XMLAnalyzer, c.ResourceItem.TYPE_XML);
  16885. this.resConfig = new c.ResourceConfig;
  16886. this.resLoader = new c.ResourceLoader;
  16887. this.resLoader.callBack = this.onResourceItemComp;
  16888. this.resLoader.resInstance = this;
  16889. this.resLoader.addEventListener(c.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  16890. };
  16891. a.prototype.loadConfig = function(b, d) {
  16892. this.configURL = b;
  16893. this.resourceRoot = d;
  16894. var e = [new c.ResourceItem(b, b, c.ResourceItem.TYPE_JSON)];
  16895. this.resLoader.loadGroup(e, a.GROUP_CONFIG, Number.MAX_VALUE)
  16896. };
  16897. a.prototype.isGroupLoaded = function(a) {
  16898. return - 1 != this.loadedGroups.indexOf(a)
  16899. };
  16900. a.prototype.getGroupByName = function(a) {
  16901. return this.resConfig.getGroupByName(a)
  16902. };
  16903. a.prototype.loadGroup = function(a, c) {
  16904. "undefined" === typeof c && (c = 0);
  16905. if ( - 1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a)) if (this.configComplete) {
  16906. var d = this.resConfig.getGroupByName(a);
  16907. this.resLoader.loadGroup(d, a, c)
  16908. } else this.groupNameList.push({
  16909. name: a,
  16910. priority: c
  16911. })
  16912. };
  16913. a.prototype.createGroup = function(a, c, d) {
  16914. "undefined" === typeof d && (d = !1);
  16915. return this.resConfig.createGroup(a, c, d)
  16916. };
  16917. a.prototype.onGroupComp = function(b) {
  16918. if (b.groupName == a.GROUP_CONFIG) {
  16919. b = this.getAnalyzerByType(c.ResourceItem.TYPE_JSON);
  16920. var d = b.getRes(this.configURL);
  16921. b.destroyRes(this.configURL);
  16922. this.resConfig.parseConfig(d, this.resourceRoot);
  16923. this.configComplete = !0;
  16924. c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_COMPLETE);
  16925. b = this.groupNameList;
  16926. for (var d = b.length,
  16927. e = 0; e < d; e++) {
  16928. var k = b[e];
  16929. this.loadGroup(k.name, k.priority)
  16930. }
  16931. this.groupNameList = []
  16932. } else this.loadedGroups.push(b.groupName),
  16933. this.dispatchEvent(b)
  16934. };
  16935. a.prototype.hasRes = function(a) {
  16936. var d = this.resConfig.getType(a);
  16937. return "" == d && (a = c.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(a), "" == d) ? !1 : !0
  16938. };
  16939. a.prototype.getRes = function(a) {
  16940. var d = this.resConfig.getType(a);
  16941. return "" == d && (d = c.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(d), "" == d) ? null: this.getAnalyzerByType(d).getRes(a)
  16942. };
  16943. a.prototype.getResAsync = function(a, d, e) {
  16944. var k = this.resConfig.getType(a),
  16945. f = a;
  16946. if ("" == k && (f = c.AnalyzerBase.getStringPrefix(a), k = this.resConfig.getType(f), "" == k)) {
  16947. d.call(e, null);
  16948. return
  16949. } (k = this.getAnalyzerByType(k).getRes(a)) ? d.call(e, k) : (a = {
  16950. name: a,
  16951. compFunc: d,
  16952. thisObject: e
  16953. },
  16954. this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  16955. };
  16956. a.prototype.getResByUrl = function(a, d, e, k) {
  16957. "undefined" === typeof k && (k = "");
  16958. if (a) {
  16959. k || (k = this.getTypeByUrl(a));
  16960. var f = this.getAnalyzerByType(k).getRes(a);
  16961. f ? d.call(e, f) : (d = {
  16962. name: a,
  16963. compFunc: d,
  16964. thisObject: e
  16965. },
  16966. this.asyncDic[a] ? this.asyncDic[a].push(d) : (this.asyncDic[a] = [d], a = new c.ResourceItem(a, a, k), this.resLoader.loadItem(a)))
  16967. } else d.call(e, null)
  16968. };
  16969. a.prototype.getTypeByUrl = function(a) {
  16970. a = a.substr(a.lastIndexOf(".") + 1);
  16971. switch (a) {
  16972. case c.ResourceItem.TYPE_XML:
  16973. case c.ResourceItem.TYPE_JSON:
  16974. case c.ResourceItem.TYPE_SHEET:
  16975. break;
  16976. case "png":
  16977. case "jpg":
  16978. case "gif":
  16979. a = c.ResourceItem.TYPE_IMAGE;
  16980. break;
  16981. case "fnt":
  16982. a = c.ResourceItem.TYPE_FONT;
  16983. break;
  16984. case "txt":
  16985. a = c.ResourceItem.TYPE_TEXT;
  16986. break;
  16987. default:
  16988. a = c.ResourceItem.TYPE_BIN
  16989. }
  16990. return a
  16991. };
  16992. a.prototype.onResourceItemComp = function(a) {
  16993. var c = this.asyncDic[a.name];
  16994. delete this.asyncDic[a.name];
  16995. a = this.getAnalyzerByType(a.type);
  16996. for (var d = c.length,
  16997. e = 0; e < d; e++) {
  16998. var f = c[e],
  16999. g = a.getRes(f.name);
  17000. f.compFunc.call(f.thisObject, g)
  17001. }
  17002. };
  17003. a.prototype.destroyRes = function(a) {
  17004. var c = this.resConfig.getRawGroupByName(a);
  17005. if (c) {
  17006. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1);
  17007. a = c.length;
  17008. for (var e = 0; e < a; e++) {
  17009. d = c[e];
  17010. d.loaded = !1;
  17011. var f = this.getAnalyzerByType(d.type);
  17012. f.destroyRes(d.name)
  17013. }
  17014. return ! 0
  17015. }
  17016. c = this.resConfig.getType(a);
  17017. if ("" == c) return ! 1;
  17018. d = this.resConfig.getRawResourceItem(a);
  17019. d.loaded = !1;
  17020. f = this.getAnalyzerByType(c);
  17021. return f.destroyRes(a)
  17022. };
  17023. a.GROUP_CONFIG = "RES__CONFIG";
  17024. return a
  17025. } (egret.EventDispatcher))
  17026. })(RES || (RES = {}));
  17027. __extends = this.__extends ||
  17028. function(c, e) {
  17029. function d() {
  17030. this.constructor = c
  17031. }
  17032. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17033. d.prototype = e.prototype;
  17034. c.prototype = new d
  17035. }; (function(c) {
  17036. var e = function(d) {
  17037. function a() {
  17038. d.call(this);
  17039. this._time = 0;
  17040. this.frameRate = 60;
  17041. a.instance = this;
  17042. this.registerListener()
  17043. }
  17044. __extends(a, d);
  17045. a.prototype.enterFrame = function() {
  17046. var b = a.instance,
  17047. d = a._thisObject,
  17048. e = a._callback,
  17049. k = c.getTimer();
  17050. e.call(d, k - b._time);
  17051. b._time = k;
  17052. b._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame)
  17053. };
  17054. a.prototype.executeMainLoop = function(b, c) {
  17055. a._callback = b;
  17056. a._thisObject = c;
  17057. this.enterFrame()
  17058. };
  17059. a.prototype.reset = function() {
  17060. var b = a.instance;
  17061. b._requestAnimationId && (b._time = c.getTimer(), a.cancelAnimationFrame.call(window, b._requestAnimationId));
  17062. b.enterFrame()
  17063. };
  17064. a.prototype.registerListener = function() {
  17065. window.onfocus = function() {
  17066. a.instance.reset()
  17067. };
  17068. window.onblur = function() {}
  17069. };
  17070. a.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
  17071. function(a) {
  17072. return window.setTimeout(a, 1E3 / 60)
  17073. };
  17074. a.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame ||
  17075. function(a) {
  17076. return window.clearTimeout(a)
  17077. };
  17078. return a
  17079. } (c.DeviceContext);
  17080. c.HTML5DeviceContext = e
  17081. })(egret || (egret = {}));
  17082. __extends = this.__extends ||
  17083. function(c, e) {
  17084. function d() {
  17085. this.constructor = c
  17086. }
  17087. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17088. d.prototype = e.prototype;
  17089. c.prototype = new d
  17090. }; (function(c) {
  17091. var e = function(d) {
  17092. function a(a) {
  17093. this.canvas = a;
  17094. this.canvasContext = a.getContext("2d");
  17095. var c = this.canvasContext.setTransform,
  17096. e = this;
  17097. this.canvasContext.setTransform = function(a, b, d, l, n, p) {
  17098. e._matrixA = a;
  17099. e._matrixB = b;
  17100. e._matrixC = d;
  17101. e._matrixD = l;
  17102. e._matrixTx = n;
  17103. e._matrixTy = p;
  17104. c.call(e.canvasContext, a, b, d, l, n, p)
  17105. };
  17106. this._matrixA = 1;
  17107. this._matrixC = this._matrixB = 0;
  17108. this._matrixD = 1;
  17109. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  17110. d.call(this)
  17111. }
  17112. __extends(a, d);
  17113. a.prototype.clearScreen = function() {
  17114. this.setTransform(c.Matrix.identity.identity());
  17115. for (var a = c.RenderFilter.getInstance().getDrawAreaList(), d = 0, e = a.length; d < e; d++) {
  17116. var k = a[d];
  17117. this.clearRect(k.x + this._transformTx, k.y + this._transformTy, k.width, k.height)
  17118. }
  17119. this.renderCost = 0
  17120. };
  17121. a.prototype.clearRect = function(a, c, d, e) {
  17122. this.canvasContext.clearRect(a, c, d, e)
  17123. };
  17124. a.prototype.drawImage = function(a, e, m, k, f, g, l, n, p) {
  17125. e /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17126. m /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17127. k /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17128. f /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17129. a = a._bitmapData;
  17130. g += this._transformTx;
  17131. l += this._transformTy;
  17132. var q = c.getTimer();
  17133. this.canvasContext.drawImage(a, e, m, k, f, g, l, n, p);
  17134. d.prototype.drawImage.call(this, a, e, m, k, f, g, l, n, p);
  17135. this.renderCost += c.getTimer() - q
  17136. };
  17137. a.prototype.setTransform = function(a) {
  17138. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this.canvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  17139. };
  17140. a.prototype.save = function() {
  17141. this.canvasContext.save()
  17142. };
  17143. a.prototype.restore = function() {
  17144. this.canvasContext.restore();
  17145. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  17146. };
  17147. a.prototype.setAlpha = function(a, d) {
  17148. a != this.canvasContext.globalAlpha && (this.canvasContext.globalAlpha = a);
  17149. d ? (this.blendValue = d.value, this.canvasContext.globalCompositeOperation = d.value) : this.blendValue != c.BlendMode.NORMAL.value && (this.blendValue = c.BlendMode.NORMAL.value, this.canvasContext.globalCompositeOperation = c.BlendMode.NORMAL.value)
  17150. };
  17151. a.prototype.setupFont = function(a) {
  17152. var c = this.canvasContext,
  17153. d = a.italic ? "italic ": "normal ",
  17154. d = d + (a.bold ? "bold ": "normal "),
  17155. d = d + (a.size + "px " + a.fontFamily);
  17156. c.font = d;
  17157. c.textAlign = "left";
  17158. c.textBaseline = "middle"
  17159. };
  17160. a.prototype.measureText = function(a) {
  17161. return this.canvasContext.measureText(a).width
  17162. };
  17163. a.prototype.drawText = function(a, c, e, k, f) {
  17164. var g = a._strokeColorString,
  17165. l = a.stroke,
  17166. n = this.canvasContext;
  17167. n.fillStyle = a._textColorString;
  17168. n.strokeStyle = g;
  17169. l && (n.lineWidth = 2 * l, n.strokeText(c, e + this._transformTx, k + this._transformTy, f || 65535));
  17170. n.fillText(c, e + this._transformTx, k + this._transformTy, f || 65535);
  17171. d.prototype.drawText.call(this, a, c, e, k, f)
  17172. };
  17173. a.prototype.clip = function(a, c, d, e) {};
  17174. a.prototype.strokeRect = function(a, c, d, e, f) {
  17175. this.canvasContext.strokeStyle = f;
  17176. this.canvasContext.strokeRect(a, c, d, e)
  17177. };
  17178. a.prototype.pushMask = function(a) {
  17179. this.canvasContext.save();
  17180. this.canvasContext.beginPath();
  17181. this.canvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  17182. this.canvasContext.clip();
  17183. this.canvasContext.closePath()
  17184. };
  17185. a.prototype.popMask = function() {
  17186. this.canvasContext.restore();
  17187. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  17188. };
  17189. return a
  17190. } (c.RendererContext);
  17191. c.HTML5CanvasRenderer = e
  17192. })(egret || (egret = {}));
  17193. var egret_h5_graphics; (function(c) {
  17194. c.beginFill = function(c, a) {
  17195. "undefined" === typeof a && (a = 1);
  17196. var b = "rgba(" + (c >> 16) + "," + ((c & 65280) >> 8) + "," + (c & 255) + "," + a + ")";
  17197. this.fillStyleColor = b;
  17198. this.commandQueue.push(new e(this._setStyle, this, [b]))
  17199. };
  17200. c.drawRect = function(c, a, b, h) {
  17201. this.commandQueue.push(new e(function(a, b, c, d) {
  17202. var e = this.renderContext;
  17203. this.canvasContext.beginPath();
  17204. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  17205. this.canvasContext.closePath()
  17206. },
  17207. this, [c, a, b, h]));
  17208. this._fill()
  17209. };
  17210. c.drawCircle = function(c, a, b) {
  17211. this.commandQueue.push(new e(function(a, b, c) {
  17212. var d = this.renderContext;
  17213. this.canvasContext.beginPath();
  17214. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, c, 0, 2 * Math.PI);
  17215. this.canvasContext.closePath()
  17216. },
  17217. this, [c, a, b]));
  17218. this._fill()
  17219. };
  17220. c.lineStyle = function(c, a, b, h, m, k, f, g) {
  17221. "undefined" === typeof c && (c = NaN);
  17222. "undefined" === typeof a && (a = 0);
  17223. "undefined" === typeof b && (b = 1);
  17224. "undefined" === typeof h && (h = !1);
  17225. "undefined" === typeof m && (m = "normal");
  17226. "undefined" === typeof k && (k = null);
  17227. "undefined" === typeof f && (f = null);
  17228. "undefined" === typeof g && (g = 3);
  17229. this.strokeStyleColor && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  17230. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + b + ")";
  17231. this.commandQueue.push(new e(function(a, b) {
  17232. this.canvasContext.lineWidth = a;
  17233. this.canvasContext.strokeStyle = b;
  17234. this.canvasContext.beginPath()
  17235. },
  17236. this, [c, a]));
  17237. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  17238. this.moveTo(this.lineX, this.lineY)
  17239. };
  17240. c.lineTo = function(c, a) {
  17241. this.commandQueue.push(new e(function(a, c) {
  17242. var d = this.renderContext;
  17243. this.canvasContext.lineTo(d._transformTx + a, d._transformTy + c)
  17244. },
  17245. this, [c, a]));
  17246. this.lineX = c;
  17247. this.lineY = a
  17248. };
  17249. c.curveTo = function(c, a, b, h) {
  17250. this.commandQueue.push(new e(function(a, b, c, d) {
  17251. var e = this.renderContext;
  17252. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, c, d)
  17253. },
  17254. this, [c, a, b, h]));
  17255. this.lineX = b;
  17256. this.lineY = h
  17257. };
  17258. c.moveTo = function(c, a) {
  17259. this.commandQueue.push(new e(function(a, c) {
  17260. var d = this.renderContext;
  17261. this.canvasContext.moveTo(d._transformTx + a, d._transformTy + c)
  17262. },
  17263. this, [c, a]))
  17264. };
  17265. c.clear = function() {
  17266. this.lineY = this.lineX = this.commandQueue.length = 0;
  17267. this.fillStyleColor = this.strokeStyleColor = null
  17268. };
  17269. c.createEndFillCommand = function() {
  17270. this.endFillCommand || (this.endFillCommand = new e(function() {
  17271. this.canvasContext.fill()
  17272. },
  17273. this, null))
  17274. };
  17275. c.endFill = function() {
  17276. this.fillStyleColor = null
  17277. };
  17278. c._fill = function() {
  17279. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  17280. };
  17281. c.createEndLineCommand = function() {
  17282. this.endLineCommand || (this.endLineCommand = new e(function() {
  17283. this.canvasContext.stroke();
  17284. this.canvasContext.closePath()
  17285. },
  17286. this, null))
  17287. };
  17288. c._draw = function(c) {
  17289. this.renderContext = c;
  17290. c = this.canvasContext = this.renderContext.canvasContext;
  17291. c.save();
  17292. var a = this.commandQueue.length;
  17293. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  17294. for (var b = 0; b < a; b++) {
  17295. var e = this.commandQueue[b];
  17296. e.method.apply(e.thisObject, e.args)
  17297. }
  17298. c.restore()
  17299. };
  17300. var e = function() {
  17301. return function(c, a, b) {
  17302. this.method = c;
  17303. this.thisObject = a;
  17304. this.args = b
  17305. }
  17306. } ();
  17307. c._setStyle = function(c) {
  17308. this.canvasContext.fillStyle = c
  17309. };
  17310. c.init = function() {
  17311. for (var d in c) egret.Graphics.prototype[d] = c[d];
  17312. egret.RendererContext.createRendererContext = function(a) {
  17313. return new egret.HTML5CanvasRenderer(a)
  17314. }
  17315. }
  17316. })(egret_h5_graphics || (egret_h5_graphics = {}));
  17317. egret_h5_graphics.init();
  17318. __extends = this.__extends ||
  17319. function(c, e) {
  17320. function d() {
  17321. this.constructor = c
  17322. }
  17323. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17324. d.prototype = e.prototype;
  17325. c.prototype = new d
  17326. }; (function(c) {
  17327. var e = function(d) {
  17328. function a() {
  17329. d.call(this)
  17330. }
  17331. __extends(a, d);
  17332. a.prototype.proceed = function(a) {
  17333. function d(e) {
  17334. c.IOErrorEvent.dispatchIOErrorEvent(a)
  17335. }
  17336. function e(d) {
  17337. switch (this.dataFormat) {
  17338. case c.URLLoaderDataFormat.TEXT:
  17339. a.data = f.responseText;
  17340. break;
  17341. case c.URLLoaderDataFormat.VARIABLES:
  17342. a.data = new c.URLVariables(f.responseText);
  17343. break;
  17344. case c.URLLoaderDataFormat.BINARY:
  17345. a.data = f.response;
  17346. break;
  17347. default:
  17348. a.data = f.responseText
  17349. }
  17350. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  17351. }
  17352. if (a.dataFormat == c.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  17353. else if (a.dataFormat == c.URLLoaderDataFormat.SOUND) this.loadSound(a);
  17354. else {
  17355. var k = a._request,
  17356. f = this.getXHR();
  17357. f.onerror = d;
  17358. f.onload = e;
  17359. f.open(k.method, k.url, !0);
  17360. this.setResponseType(f, a.dataFormat);
  17361. k.method != c.URLRequestMethod.GET && k.data ? k.data instanceof c.URLVariables ? (f.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), f.send(k.data.toString())) : (f.setRequestHeader("Content-Type", "multipart/form-data"), f.send(k.data)) : f.send()
  17362. }
  17363. };
  17364. a.prototype.loadSound = function(a) {
  17365. function d(f) {
  17366. k.removeEventListener("canplaythrough", d, !1);
  17367. k.removeEventListener("error", e, !1);
  17368. f = new c.Sound;
  17369. f.audio = k;
  17370. a.data = f;
  17371. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  17372. }
  17373. function e(f) {
  17374. k.removeEventListener("canplaythrough", d, !1);
  17375. k.removeEventListener("error", e, !1);
  17376. c.IOErrorEvent.dispatchIOErrorEvent(a)
  17377. }
  17378. var k = new Audio(a._request.url);
  17379. k.addEventListener("canplaythrough", d, !1);
  17380. k.addEventListener("error", e, !1);
  17381. k.load()
  17382. };
  17383. a.prototype.getXHR = function() {
  17384. return window.XMLHttpRequest ? new window.XMLHttpRequest: new ActiveXObject("MSXML2.XMLHTTP")
  17385. };
  17386. a.prototype.setResponseType = function(a, d) {
  17387. switch (d) {
  17388. case c.URLLoaderDataFormat.TEXT:
  17389. case c.URLLoaderDataFormat.VARIABLES:
  17390. a.responseType = c.URLLoaderDataFormat.TEXT;
  17391. break;
  17392. case c.URLLoaderDataFormat.BINARY:
  17393. a.responseType = "arraybuffer";
  17394. break;
  17395. default:
  17396. a.responseType = d
  17397. }
  17398. };
  17399. a.prototype.loadTexture = function(a) {
  17400. var d = a._request,
  17401. e = new Image;
  17402. e.crossOrigin = "Anonymous";
  17403. e.onload = function(d) {
  17404. e.onerror = null;
  17405. e.onload = null;
  17406. d = new c.Texture;
  17407. d._setBitmapData(e);
  17408. a.data = d;
  17409. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  17410. };
  17411. e.onerror = function(d) {
  17412. e.onerror = null;
  17413. e.onload = null;
  17414. c.IOErrorEvent.dispatchIOErrorEvent(a)
  17415. };
  17416. e.src = d.url
  17417. };
  17418. return a
  17419. } (c.NetContext);
  17420. c.HTML5NetContext = e
  17421. })(egret || (egret = {}));
  17422. __extends = this.__extends ||
  17423. function(c, e) {
  17424. function d() {
  17425. this.constructor = c
  17426. }
  17427. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17428. d.prototype = e.prototype;
  17429. c.prototype = new d
  17430. }; (function(c) {
  17431. var e = function(d) {
  17432. function a(a) {
  17433. d.call(this);
  17434. this.canvas = a;
  17435. this._isTouchDown = !1
  17436. }
  17437. __extends(a, d);
  17438. a.prototype.run = function() {
  17439. var a = this;
  17440. "ontouchstart" in window ? (this.canvas.addEventListener("touchstart",
  17441. function(c) {
  17442. for (var d = c.changedTouches.length,
  17443. e = 0; e < d && e < a.maxTouches; e++) a._onTouchBegin(c.changedTouches[e]);
  17444. c.stopPropagation();
  17445. c.preventDefault()
  17446. },
  17447. !1), this.canvas.addEventListener("touchmove",
  17448. function(c) {
  17449. for (var d = c.changedTouches.length,
  17450. e = 0; e < d && e < a.maxTouches; e++) a._onTouchMove(c.changedTouches[e]);
  17451. c.stopPropagation();
  17452. c.preventDefault()
  17453. },
  17454. !1), this.canvas.addEventListener("touchend",
  17455. function(c) {
  17456. for (var d = c.changedTouches.length,
  17457. e = 0; e < d && e < a.maxTouches; e++) a._onTouchEnd(c.changedTouches[e]);
  17458. c.stopPropagation();
  17459. c.preventDefault()
  17460. },
  17461. !1), this.canvas.addEventListener("touchcancel",
  17462. function(c) {
  17463. for (var d = c.changedTouches.length,
  17464. e = 0; e < d && e < a.maxTouches; e++) a._onTouchEnd(c.changedTouches[e]);
  17465. c.stopPropagation();
  17466. c.preventDefault()
  17467. },
  17468. !1)) : window.navigator.msPointerEnabled ? (this.canvas.addEventListener("MSPointerDown",
  17469. function(c) {
  17470. a._onTouchBegin(c);
  17471. c.stopPropagation();
  17472. c.preventDefault()
  17473. },
  17474. !1), this.canvas.addEventListener("MSPointerMove",
  17475. function(c) {
  17476. a._onTouchMove(c);
  17477. c.stopPropagation();
  17478. c.preventDefault()
  17479. },
  17480. !1), this.canvas.addEventListener("MSPointerUp",
  17481. function(c) {
  17482. a._onTouchEnd(c);
  17483. c.stopPropagation();
  17484. c.preventDefault()
  17485. },
  17486. !1)) : (this.canvas.addEventListener("mousedown",
  17487. function(c) {
  17488. a._onTouchBegin(c)
  17489. }), this.canvas.addEventListener("mousemove",
  17490. function(c) {
  17491. a._onTouchMove(c)
  17492. }), this.canvas.addEventListener("mouseup",
  17493. function(c) {
  17494. a._onTouchEnd(c)
  17495. }));
  17496. window.addEventListener("mousedown",
  17497. function(c) {
  17498. a.inOutOfCanvas(c) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  17499. });
  17500. window.addEventListener("mouseup",
  17501. function(c) {
  17502. a._isTouchDown && a.inOutOfCanvas(c) && a.dispatchLeaveStageEvent();
  17503. a._isTouchDown = !1
  17504. })
  17505. };
  17506. a.prototype.inOutOfCanvas = function(a) {
  17507. a = this.getLocation(this.canvas, a);
  17508. return 0 > a.x || 0 > a.y || a.x > this.canvas.width || a.y > this.canvas.height ? !0 : !1
  17509. };
  17510. a.prototype.dispatchLeaveStageEvent = function() {
  17511. c.MainContext.instance.stage.dispatchEventWith(c.Event.LEAVE_STAGE)
  17512. };
  17513. a.prototype._onTouchBegin = function(a) {
  17514. var c = this.getLocation(this.canvas, a),
  17515. d = -1;
  17516. a.hasOwnProperty("identifier") && (d = a.identifier);
  17517. this.onTouchBegan(c.x, c.y, d)
  17518. };
  17519. a.prototype._onTouchMove = function(a) {
  17520. var c = this.getLocation(this.canvas, a),
  17521. d = -1;
  17522. a.hasOwnProperty("identifier") && (d = a.identifier);
  17523. this.onTouchMove(c.x, c.y, d)
  17524. };
  17525. a.prototype._onTouchEnd = function(a) {
  17526. var c = this.getLocation(this.canvas, a),
  17527. d = -1;
  17528. a.hasOwnProperty("identifier") && (d = a.identifier);
  17529. this.onTouchEnd(c.x, c.y, d)
  17530. };
  17531. a.prototype.getLocation = function(a, d) {
  17532. var e = document.documentElement,
  17533. k = window,
  17534. f, g;
  17535. "function" === typeof a.getBoundingClientRect ? (g = a.getBoundingClientRect(), f = g.left, g = g.top) : g = f = 0;
  17536. f += k.pageXOffset - e.clientLeft;
  17537. g += k.pageYOffset - e.clientTop;
  17538. null != d.pageX ? (e = d.pageX, k = d.pageY) : (f -= document.body.scrollLeft, g -= document.body.scrollTop, e = d.clientX, k = d.clientY);
  17539. var l = c.Point.identity;
  17540. l.x = (e - f) / c.StageDelegate.getInstance().getScaleX();
  17541. l.y = (k - g) / c.StageDelegate.getInstance().getScaleY();
  17542. return l
  17543. };
  17544. return a
  17545. } (c.TouchContext);
  17546. c.HTML5TouchContext = e
  17547. })(egret || (egret = {}));
  17548. __extends = this.__extends ||
  17549. function(c, e) {
  17550. function d() {
  17551. this.constructor = c
  17552. }
  17553. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17554. d.prototype = e.prototype;
  17555. c.prototype = new d
  17556. }; (function(c) {
  17557. var e = function(d) {
  17558. function a() {
  17559. d.call(this);
  17560. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  17561. this._xmlDict = {};
  17562. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  17563. }
  17564. __extends(a, d);
  17565. a.getInstance = function() {
  17566. a._instance || (a._instance = new a);
  17567. return a._instance
  17568. };
  17569. a.prototype.parserXML = function(a) {
  17570. for (var d = 0;
  17571. "\n" == a.charAt(d) || "\t" == a.charAt(d) || "\r" == a.charAt(d) || " " == a.charAt(d);) d++;
  17572. 0 != d && (a = a.substring(d, a.length));
  17573. this._isSupportDOMParser ? d = this._parser.parseFromString(a, "text/xml") : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(a));
  17574. null == d && c.Logger.info("xml not found!");
  17575. return d
  17576. };
  17577. a._instance = null;
  17578. return a
  17579. } (c.HashObject);
  17580. c.SAXParser = e
  17581. })(egret || (egret = {}));
  17582. var __extends = this.__extends ||
  17583. function(c, e) {
  17584. function d() {
  17585. this.constructor = c
  17586. }
  17587. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17588. d.prototype = e.prototype;
  17589. c.prototype = new d
  17590. },
  17591. catgame; (function(c) {
  17592. var e = function(c) {
  17593. function a(a, e) {
  17594. var m = RES.getRes("pot1");
  17595. this.posx = a;
  17596. this.posy = e;
  17597. c.call(this, m);
  17598. this.anchorX = this.anchorY = 0.5;
  17599. this.fill = !1
  17600. }
  17601. __extends(a, c);
  17602. a.prototype.getY = function() {
  17603. return this.posy
  17604. };
  17605. a.prototype.doFillPot = function() {
  17606. this.texture = RES.getRes("pot2");
  17607. this.fill = !0
  17608. };
  17609. a.prototype.clean = function() {
  17610. this.prenode = null
  17611. };
  17612. a.prototype.getPos = function() {
  17613. return [this.posx, this.posy]
  17614. };
  17615. a.prototype.isFill = function() {
  17616. return this.fill
  17617. };
  17618. return a
  17619. } (egret.Bitmap);
  17620. c.Node = e
  17621. })(catgame || (catgame = {})); (function(c) {
  17622. var e = function() {
  17623. function c() {}
  17624. c.hitTest = function(a, b) {
  17625. var c = a.getBounds(),
  17626. d = b.getBounds();
  17627. c.x = a.x;
  17628. c.y = a.y;
  17629. d.x = b.x;
  17630. d.y = b.y;
  17631. return c.intersects(d)
  17632. };
  17633. return c
  17634. } ();
  17635. c.GameUtil = e;
  17636. c.createBitmapByName = function(c) {
  17637. var a = new egret.Bitmap;
  17638. c = RES.getRes(c);
  17639. a.texture = c;
  17640. return a
  17641. }
  17642. })(catgame || (catgame = {}));
  17643. __extends = this.__extends ||
  17644. function(c, e) {
  17645. function d() {
  17646. this.constructor = c
  17647. }
  17648. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17649. d.prototype = e.prototype;
  17650. c.prototype = new d
  17651. }; (function(c) {
  17652. var e = function(c) {
  17653. function a() {
  17654. c.call(this);
  17655. this.isWeizhu = !1;
  17656. var a = RES.getRes("stay1_json"),
  17657. e = RES.getRes("stay1_png");
  17658. this.standmc = new egret.MovieClip(a, e);
  17659. this.standmc.setInterval(3);
  17660. this.standmc.gotoAndPlay("stay1");
  17661. a = RES.getRes("weizhu1_json");
  17662. e = RES.getRes("weizhu1_png");
  17663. this.weizhumc = new egret.MovieClip(a, e);
  17664. this.weizhumc.setInterval(3);
  17665. this.weizhumc.gotoAndPlay("weizhu1");
  17666. this.anchorX = 0.5;
  17667. this.anchorY = 1;
  17668. this.stay()
  17669. }
  17670. __extends(a, c);
  17671. a.prototype.init = function() {
  17672. this.isWeizhu = !1;
  17673. this.stay()
  17674. };
  17675. a.prototype.run = function(a) {
  17676. this.x = a[0];
  17677. this.y = a[1];
  17678. this.dispatchEventWith("catRun")
  17679. };
  17680. a.prototype.stay = function() {
  17681. this.numChildren && this.removeChildAt(0);
  17682. this.isWeizhu ? this.addChild(this.weizhumc) : this.addChild(this.standmc)
  17683. };
  17684. a.prototype.weizhu = function() {
  17685. this.isWeizhu = !0;
  17686. this.stay()
  17687. };
  17688. a.prototype.successShow = function() {};
  17689. a.prototype.failShow = function() {};
  17690. return a
  17691. } (egret.Sprite);
  17692. c.Cat2 = e
  17693. })(catgame || (catgame = {}));
  17694. __extends = this.__extends ||
  17695. function(c, e) {
  17696. function d() {
  17697. this.constructor = c
  17698. }
  17699. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17700. d.prototype = e.prototype;
  17701. c.prototype = new d
  17702. }; (function(c) {
  17703. var e = function(c) {
  17704. function a() {
  17705. c.call(this);
  17706. var a = this.createBitmapByName("failed_bg");
  17707. this.tap_textfeild = new egret.TextField;
  17708. this.tap_textfeild.width = 400;
  17709. this.tap_textfeild.textColor = 16711680;
  17710. this.tap_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  17711. this.tap_textfeild.text = "你没能拯救蠢!儿!子!!";
  17712. this.tap_textfeild.size = 22;
  17713. this.tap_textfeild.x = 20;
  17714. this.tap_textfeild.y = 190;
  17715. this.rank_textfeild = new egret.TextField;
  17716. this.rank_textfeild.width = 400;
  17717. this.rank_textfeild.textColor = 16777215;
  17718. this.rank_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  17719. this.rank_textfeild.text = "快帮助成龙大哥!!";
  17720. this.rank_textfeild.size = 22;
  17721. this.rank_textfeild.strokeColor = 0;
  17722. this.rank_textfeild.stroke = 2;
  17723. this.rank_textfeild.x = 20;
  17724. this.rank_textfeild.y = 230;
  17725. this.share_btn = this.createBitmapByName("share_btn");
  17726. this.share_btn.x = 10;
  17727. this.share_btn.y = a.height + 20;
  17728. this.share_btn.touchEnabled = !0;
  17729. this.share_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doShare, this);
  17730. this.replay_btn = this.createBitmapByName("replay_btn");
  17731. this.replay_btn.x = 220;
  17732. this.replay_btn.y = a.height + 20;
  17733. this.replay_btn.touchEnabled = !0;
  17734. this.replay_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doRepaly, this);
  17735. this.addChild(a);
  17736. this.addChild(this.tap_textfeild);
  17737. this.addChild(this.rank_textfeild);
  17738. this.addChild(this.share_btn);
  17739. this.addChild(this.replay_btn)
  17740. }
  17741. __extends(a, c);
  17742. a.prototype.score = function(a) {
  17743. this.tap_textfeild.text = "您用" + a + "颗药都没有见效,继续加油。"
  17744. };
  17745. a.prototype.doShare = function(a) {
  17746. this.dispatchEventWith("shareEvent")
  17747. };
  17748. a.prototype.doRepaly = function(a) {
  17749. this.dispatchEventWith("replayEvent")
  17750. };
  17751. a.prototype.createBitmapByName = function(a) {
  17752. var c = new egret.Bitmap;
  17753. a = RES.getRes(a);
  17754. c.texture = a;
  17755. return c
  17756. };
  17757. return a
  17758. } (egret.Sprite);
  17759. c.FailPanel = e
  17760. })(catgame || (catgame = {}));
  17761. __extends = this.__extends ||
  17762. function(c, e) {
  17763. function d() {
  17764. this.constructor = c
  17765. }
  17766. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17767. d.prototype = e.prototype;
  17768. c.prototype = new d
  17769. }; (function(c) {
  17770. var e = function(c) {
  17771. function a() {
  17772. c.call(this);
  17773. this.isWeizhu = !1;
  17774. var a = RES.getRes("stay2_json"),
  17775. e = RES.getRes("stay2_png");
  17776. this.standmc = new egret.MovieClip(a, e);
  17777. this.standmc.setInterval(3);
  17778. this.standmc.gotoAndPlay("stay2");
  17779. a = RES.getRes("weizhu2_json");
  17780. e = RES.getRes("weizhu2_png");
  17781. this.weizhumc = new egret.MovieClip(a, e);
  17782. this.weizhumc.setInterval(3);
  17783. this.weizhumc.gotoAndPlay("weizhu2");
  17784. this.anchorX = 0.5;
  17785. this.anchorY = 1;
  17786. this.stay()
  17787. }
  17788. __extends(a, c);
  17789. a.prototype.init = function() {
  17790. this.isWeizhu = !1;
  17791. this.stay()
  17792. };
  17793. a.prototype.run = function(a) {
  17794. this.x = a[0];
  17795. this.y = a[1];
  17796. this.dispatchEventWith("catRun")
  17797. };
  17798. a.prototype.stay = function() {
  17799. this.numChildren && this.removeChildAt(0);
  17800. this.isWeizhu ? this.addChild(this.weizhumc) : this.addChild(this.standmc)
  17801. };
  17802. a.prototype.weizhu = function() {
  17803. this.isWeizhu = !0;
  17804. this.stay()
  17805. };
  17806. a.prototype.successShow = function() {};
  17807. a.prototype.failShow = function() {};
  17808. return a
  17809. } (egret.Sprite);
  17810. c.Kitty = e
  17811. })(catgame || (catgame = {}));
  17812. __extends = this.__extends ||
  17813. function(c, e) {
  17814. function d() {
  17815. this.constructor = c
  17816. }
  17817. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17818. d.prototype = e.prototype;
  17819. c.prototype = new d
  17820. }; (function(c) {
  17821. var e = function(d) {
  17822. function a() {
  17823. d.call(this);
  17824. this.map = [];
  17825. this.mapsize = 9;
  17826. this.playTurn = !0;
  17827. this.block = 0.2;
  17828. this.tap = 0;
  17829. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  17830. }
  17831. __extends(a, d);
  17832. a.prototype.onAddToStage = function(a) {
  17833. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  17834. };
  17835. a.prototype.init = function(a) {
  17836. for ("undefined" === typeof a && (a = 0.2); this.numChildren;) this.removeChildAt(0);
  17837. this.block = a;
  17838. this.map = [];
  17839. this.createMap();
  17840. this.tap = 0
  17841. };
  17842. a.prototype.createMap = function() {
  17843. for (var a, d = 0; d < this.mapsize; d++) {
  17844. this.map[d] = [];
  17845. for (var e = 0; e < this.mapsize; e++) {
  17846. a = new c.Node(d, e);
  17847. a.x = 48 * d + e % 2 * 24;
  17848. a.y = 44 * e;
  17849. this.map[d][e] = a;
  17850. a.touchEnabled = !0;
  17851. a.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onNodeClick, this);
  17852. this.addChild(a);
  17853. var k = (this.mapsize - 1) / 2;
  17854. d != k && e != k && Math.random() < this.block && (a.doFillPot(), a.touchEnabled = !1)
  17855. }
  17856. }
  17857. };
  17858. a.prototype.lock = function() {
  17859. this.playTurn = !1
  17860. };
  17861. a.prototype.unlock = function() {
  17862. this.playTurn = !0
  17863. };
  17864. a.prototype.getNode = function(a) {
  17865. return this.map[a[0]][a[1]]
  17866. };
  17867. a.prototype.onNodeClick = function(a) {
  17868. this.playTurn && (this.tap += 1, a = a.target, a.doFillPot(), a.touchEnabled = !1, a.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onNodeClick, this), this.dispatchEventWith("nodeClick"))
  17869. };
  17870. a.prototype.showRound = function(a) {
  17871. var c = a.getPos();
  17872. a = this.getRound(c);
  17873. for (var d = a.length,
  17874. e, f = 0; f < this.mapsize; f++) for (var g = 0; g < this.mapsize; g++) if (f != c[0] || g != c[1]) e = this.map[f][g],
  17875. e.clean();
  17876. for (f = 0; f < d; f++) c = a[f],
  17877. e = this.map[c[0]][c[1]],
  17878. e.doFillPot()
  17879. };
  17880. a.prototype.coverPos2Point = function(a) {
  17881. return [this.x + 48 * a[0] + a[1] % 2 * 24, this.y + 44 * a[1]]
  17882. };
  17883. a.prototype.getRound = function(a) {
  17884. var c = a[0],
  17885. d = a[1];
  17886. a = [];
  17887. c = 0 == d % 2 ? [[c - 1, d - 1], [c - 1, d], [c - 1, d + 1], [c, d + 1], [c + 1, d], [c, d - 1]] : [[c, d - 1], [c - 1, d], [c, d + 1], [c + 1, d + 1], [c + 1, d], [c + 1, d - 1]];
  17888. for (d = 0; 6 > d; d++) {
  17889. var e = c[d];
  17890. 0 <= e[0] && 0 <= e[1] && e[0] < this.mapsize && e[1] < this.mapsize && a.push(e)
  17891. }
  17892. return a
  17893. };
  17894. a.prototype.findPath = function(a, c) {
  17895. "undefined" === typeof c && (c = null);
  17896. for (var d, e = 0; e < this.mapsize; e++) for (var f = 0; f < this.mapsize; f++) d = this.map[e][f],
  17897. d.clean();
  17898. d = this.findNode(a, c);
  17899. e = [];
  17900. if (d) for (; d.prenode;) e.push(d.getPos()),
  17901. d = d.prenode;
  17902. else console.log("\u5df2\u7ecf\u88ab\u56f0\u968f\u4fbf\u8d70\u4e00\u6b65"),
  17903. this.dispatchEventWith("weizhu", !1, a),
  17904. e = this.getNear(a, c);
  17905. return e.reverse()
  17906. };
  17907. a.prototype.randomSort = function(a, c) {
  17908. return 0.5 < Math.random() ? 1 : -1
  17909. };
  17910. a.prototype.findNode = function(a, c) {
  17911. var d = [a, c];
  17912. c && d.push(c);
  17913. for (var e = [a], f, g = 0, l = 0, n = 0, p = 0, q, r;;) {
  17914. l = e.length;
  17915. if (0 == l) return null;
  17916. for (var s = [], g = 0; g < l; g++) {
  17917. q = e.shift();
  17918. f = this.getRound(q.getPos());
  17919. p = f.length;
  17920. for (n = 0; n < p; n++) if (r = f[n], r = this.map[r[0]][r[1]], r.isFill()) d.push(r);
  17921. else if (! ( - 1 < d.indexOf(r) || -1 < e.indexOf(r))) {
  17922. r.prenode = q;
  17923. if (this.isExit(r)) return r;
  17924. s.push(r)
  17925. }
  17926. d.push(q)
  17927. }
  17928. e = s
  17929. }
  17930. };
  17931. a.prototype.getNear = function(a, c) {
  17932. for (var d = a.getPos(), d = this.getRound(d), e = d.length, f = 0; f < e; f++) if (!this.getNode(d[f]).isFill() && this.getNode(d[f]) != c) return [d[f]];
  17933. return []
  17934. };
  17935. a.prototype.isExit = function(a) {
  17936. a = a.getPos();
  17937. return 0 == a[0] || 0 == a[1] || a[0] == this.mapsize - 1 || a[1] == this.mapsize - 1 ? !0 : !1
  17938. };
  17939. return a
  17940. } (egret.DisplayObjectContainer);
  17941. c.Map = e
  17942. })(catgame || (catgame = {}));
  17943. __extends = this.__extends ||
  17944. function(c, e) {
  17945. function d() {
  17946. this.constructor = c
  17947. }
  17948. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17949. d.prototype = e.prototype;
  17950. c.prototype = new d
  17951. }; (function(c) {
  17952. var e = function(c) {
  17953. function a() {
  17954. c.call(this);
  17955. var a = this.graphics;
  17956. a.beginFill(0, 0.8);
  17957. a.drawRect(0, 0, 400, 200);
  17958. a.endFill();
  17959. this.txt = new egret.TextField;
  17960. this.txt.width = 400;
  17961. this.txt.height = 200;
  17962. this.txt.textAlign = "center";
  17963. this.txt.textColor = 16777215;
  17964. this.txt.size = 24;
  17965. this.txt.y = 60;
  17966. this.addChild(this.txt)
  17967. }
  17968. __extends(a, c);
  17969. a.prototype.showScore = function(a) {
  17970. this.txt.text = a + "\n再来一次吧"
  17971. };
  17972. return a
  17973. } (egret.Sprite);
  17974. c.ScorePanel = e
  17975. })(catgame || (catgame = {}));
  17976. __extends = this.__extends ||
  17977. function(c, e) {
  17978. function d() {
  17979. this.constructor = c
  17980. }
  17981. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17982. d.prototype = e.prototype;
  17983. c.prototype = new d
  17984. }; (function(c) {
  17985. var e = function(c) {
  17986. function a() {
  17987. c.call(this);
  17988. this.titles_arr = "小房救星 柯景腾救心丸 反毒卫士 龙哥小天使 林妈妈派来的救兵 捞子医院院长 知错就改好孩子 传说中的高手 隔壁警察".split(" ");
  17989. this.titles2_arr = "小房救星 柯景腾救心丸 隔壁警察 龙哥小天使 林妈妈派来的救兵 捞子医院院长 反毒卫士 做好事不留名".split(" ");
  17990. var a = this.createBitmapByName("victory_bg");
  17991. this.tap_textfeild = new egret.TextField;
  17992. this.tap_textfeild.width = 400;
  17993. this.tap_textfeild.textColor = 16711680;
  17994. this.tap_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  17995. this.tap_textfeild.text = "您用13颗药拯救了蠢儿子";
  17996. this.tap_textfeild.size = 22;
  17997. this.tap_textfeild.x = 20;
  17998. this.tap_textfeild.y = 150;
  17999. this.rank_textfeild = new egret.TextField;
  18000. this.rank_textfeild.width = 400;
  18001. this.rank_textfeild.textColor = 16777215;
  18002. this.rank_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18003. this.rank_textfeild.text = "全国排名421位";
  18004. this.rank_textfeild.size = 22;
  18005. this.rank_textfeild.strokeColor = 0;
  18006. this.rank_textfeild.stroke = 2;
  18007. this.rank_textfeild.x = 20;
  18008. this.rank_textfeild.y = 190;
  18009. this.beat_textfeild = new egret.TextField;
  18010. this.beat_textfeild.width = 400;
  18011. this.beat_textfeild.textColor = 16711680;
  18012. this.beat_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18013. this.beat_textfeild.size = 22;
  18014. this.beat_textfeild.text = "反毒决心超过80%的人";
  18015. this.beat_textfeild.x = 20;
  18016. this.beat_textfeild.y = 230;
  18017. this.title_textfeild = new egret.TextField;
  18018. this.title_textfeild.width = 400;
  18019. this.title_textfeild.textColor = 16711680;
  18020. this.title_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18021. this.title_textfeild.size = 24;
  18022. this.title_textfeild.text = "获得称号:思维广";
  18023. this.title_textfeild.x = 20;
  18024. this.title_textfeild.y = 270;
  18025. this.share_btn = this.createBitmapByName("share_btn");
  18026. this.share_btn.x = 10;
  18027. this.share_btn.y = a.height + 20;
  18028. this.share_btn.touchEnabled = !0;
  18029. this.share_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doShare, this);
  18030. this.replay_btn = this.createBitmapByName("replay_btn");
  18031. this.replay_btn.x = 220;
  18032. this.replay_btn.y = a.height + 20;
  18033. this.replay_btn.touchEnabled = !0;
  18034. this.replay_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doRepaly, this);
  18035. this.addChild(a);
  18036. this.addChild(this.tap_textfeild);
  18037. this.addChild(this.rank_textfeild);
  18038. this.addChild(this.beat_textfeild);
  18039. this.addChild(this.title_textfeild);
  18040. this.addChild(this.share_btn);
  18041. this.addChild(this.replay_btn)
  18042. }
  18043. __extends(a, c);
  18044. a.prototype.score = function(a) {
  18045. this.tap_textfeild.text = "您用" + a + "颗药拯救了房祖名。";
  18046. this.rank_textfeild.text = "全国排名" + Math.floor(1234678 * a + Math.random() * a * 500) + "位";
  18047. this.beat_textfeild.text = "反毒决心超过全国" + (100 - Math.floor(a * Math.random())) + "%的人";
  18048. a = 11 > a ? this.titles_arr[a] : this.titles2_arr[Math.floor(Math.random() * this.titles2_arr.length)];
  18049. this.title_textfeild.text = "获得称号:" + a
  18050. };
  18051. a.prototype.doShare = function(a) {
  18052. this.dispatchEventWith("shareEvent")
  18053. };
  18054. a.prototype.doRepaly = function(a) {
  18055. this.dispatchEventWith("replayEvent")
  18056. };
  18057. a.prototype.createBitmapByName = function(a) {
  18058. var c = new egret.Bitmap;
  18059. a = RES.getRes(a);
  18060. c.texture = a;
  18061. return c
  18062. };
  18063. return a
  18064. } (egret.Sprite);
  18065. c.SuccessPanel = e
  18066. })(catgame || (catgame = {}));
  18067. __extends = this.__extends ||
  18068. function(c, e) {
  18069. function d() {
  18070. this.constructor = c
  18071. }
  18072. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18073. d.prototype = e.prototype;
  18074. c.prototype = new d
  18075. }; (function(c) {
  18076. var e = function(c) {
  18077. function a() {
  18078. c.call(this);
  18079. var a = this.createBitmapByName("failed_bg");
  18080. this.tap_textfeild = new egret.TextField;
  18081. this.tap_textfeild.width = 400;
  18082. this.tap_textfeild.textColor = 16711680;
  18083. this.tap_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18084. this.tap_textfeild.text = "你没有拯救房祖名和他的好!基!友!!";
  18085. this.tap_textfeild.size = 22;
  18086. this.tap_textfeild.x = 20;
  18087. this.tap_textfeild.y = 190;
  18088. this.rank_textfeild = new egret.TextField;
  18089. this.rank_textfeild.width = 400;
  18090. this.rank_textfeild.textColor = 16777215;
  18091. this.rank_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18092. this.rank_textfeild.text = "继续加油帮助成龙捞儿子。";
  18093. this.rank_textfeild.size = 22;
  18094. this.rank_textfeild.strokeColor = 0;
  18095. this.rank_textfeild.stroke = 2;
  18096. this.rank_textfeild.x = 20;
  18097. this.rank_textfeild.y = 230;
  18098. this.share_btn = this.createBitmapByName("share_btn");
  18099. this.share_btn.x = 10;
  18100. this.share_btn.y = a.height + 20;
  18101. this.share_btn.touchEnabled = !0;
  18102. this.share_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doShare, this);
  18103. this.replay_btn = this.createBitmapByName("replay_btn");
  18104. this.replay_btn.x = 220;
  18105. this.replay_btn.y = a.height + 20;
  18106. this.replay_btn.touchEnabled = !0;
  18107. this.replay_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doRepaly, this);
  18108. this.addChild(a);
  18109. this.addChild(this.tap_textfeild);
  18110. this.addChild(this.rank_textfeild);
  18111. this.addChild(this.share_btn);
  18112. this.addChild(this.replay_btn)
  18113. }
  18114. __extends(a, c);
  18115. a.prototype.score = function(a) {
  18116. this.tap_textfeild.text = "您用" + a + "颗药都没有见效,继续加油"
  18117. };
  18118. a.prototype.doShare = function(a) {
  18119. this.dispatchEventWith("shareEvent")
  18120. };
  18121. a.prototype.doRepaly = function(a) {
  18122. this.dispatchEventWith("replayEvent")
  18123. };
  18124. a.prototype.createBitmapByName = function(a) {
  18125. var c = new egret.Bitmap;
  18126. a = RES.getRes(a);
  18127. c.texture = a;
  18128. return c
  18129. };
  18130. return a
  18131. } (egret.Sprite);
  18132. c.TFailPanel = e
  18133. })(catgame || (catgame = {}));
  18134. __extends = this.__extends ||
  18135. function(c, e) {
  18136. function d() {
  18137. this.constructor = c
  18138. }
  18139. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18140. d.prototype = e.prototype;
  18141. c.prototype = new d
  18142. }; (function(c) {
  18143. var e = function(c) {
  18144. function a() {
  18145. c.call(this);
  18146. this.titles_arr = "小房救星 柯景腾救心丸 反毒卫士 龙哥小天使 林妈妈派来的救兵 捞子医院院长 知错就改好孩子 传说中的高手 隔壁警察".split(" ");
  18147. this.titles2_arr = "小房救星 柯景腾救心丸 隔壁警察 龙哥小天使 林妈妈派来的救兵 捞子医院院长 反毒卫士 做好事不留名".split(" ");
  18148. var a = this.createBitmapByName("victory_bg");
  18149. this.tap_textfeild = new egret.TextField;
  18150. this.tap_textfeild.width = 400;
  18151. this.tap_textfeild.textColor = 16711680;
  18152. this.tap_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18153. this.tap_textfeild.text = "您用13颗药拯救了蠢儿子";
  18154. this.tap_textfeild.size = 22;
  18155. this.tap_textfeild.x = 20;
  18156. this.tap_textfeild.y = 150;
  18157. this.rank_textfeild = new egret.TextField;
  18158. this.rank_textfeild.width = 400;
  18159. this.rank_textfeild.textColor = 16777215;
  18160. this.rank_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18161. this.rank_textfeild.text = "全国排名421位";
  18162. this.rank_textfeild.size = 22;
  18163. this.rank_textfeild.strokeColor = 0;
  18164. this.rank_textfeild.stroke = 2;
  18165. this.rank_textfeild.x = 20;
  18166. this.rank_textfeild.y = 190;
  18167. this.beat_textfeild = new egret.TextField;
  18168. this.beat_textfeild.width = 400;
  18169. this.beat_textfeild.textColor = 16711680;
  18170. this.beat_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18171. this.beat_textfeild.size = 22;
  18172. this.beat_textfeild.text = "反毒决心超过全国80%的人";
  18173. this.beat_textfeild.x = 20;
  18174. this.beat_textfeild.y = 230;
  18175. this.title_textfeild = new egret.TextField;
  18176. this.title_textfeild.width = 400;
  18177. this.title_textfeild.textColor = 16711680;
  18178. this.title_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18179. this.title_textfeild.size = 24;
  18180. this.title_textfeild.text = "获得称号:思维广";
  18181. this.title_textfeild.x = 20;
  18182. this.title_textfeild.y = 270;
  18183. this.share_btn = this.createBitmapByName("share_btn");
  18184. this.share_btn.x = 10;
  18185. this.share_btn.y = a.height + 20;
  18186. this.share_btn.touchEnabled = !0;
  18187. this.share_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doShare, this);
  18188. this.replay_btn = this.createBitmapByName("replay_btn");
  18189. this.replay_btn.x = 220;
  18190. this.replay_btn.y = a.height + 20;
  18191. this.replay_btn.touchEnabled = !0;
  18192. this.replay_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doRepaly, this);
  18193. this.addChild(a);
  18194. this.addChild(this.tap_textfeild);
  18195. this.addChild(this.rank_textfeild);
  18196. this.addChild(this.beat_textfeild);
  18197. this.addChild(this.title_textfeild);
  18198. this.addChild(this.share_btn);
  18199. this.addChild(this.replay_btn)
  18200. }
  18201. __extends(a, c);
  18202. a.prototype.score = function(a) {
  18203. this.tap_textfeild.text = "您用" + a + "颗药拯救了房祖名和他的好基友";
  18204. this.rank_textfeild.text = "在全国排名" + Math.floor(1234678 * a + Math.random() * a * 500) + "位";
  18205. this.beat_textfeild.text = "反毒决心超过全国" + (100 - Math.floor(a * Math.random())) + "%的人";
  18206. a = 11 > a ? this.titles_arr[a] : this.titles2_arr[Math.floor(Math.random() * this.titles2_arr.length)];
  18207. this.title_textfeild.text = "获得称号:" + a
  18208. };
  18209. a.prototype.doShare = function(a) {
  18210. this.dispatchEventWith("shareEvent")
  18211. };
  18212. a.prototype.doRepaly = function(a) {
  18213. this.dispatchEventWith("replayEvent")
  18214. };
  18215. a.prototype.createBitmapByName = function(a) {
  18216. var c = new egret.Bitmap;
  18217. a = RES.getRes(a);
  18218. c.texture = a;
  18219. return c
  18220. };
  18221. return a
  18222. } (egret.Sprite);
  18223. c.TSuccessPanel = e
  18224. })(catgame || (catgame = {}));
  18225. var __extends = this.__extends ||
  18226. function(c, e) {
  18227. function d() {
  18228. this.constructor = c
  18229. }
  18230. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18231. d.prototype = e.prototype;
  18232. c.prototype = new d
  18233. },
  18234. LoadingUI = function(c) {
  18235. function e() {
  18236. c.call(this);
  18237. this.createView()
  18238. }
  18239. __extends(e, c);
  18240. e.prototype.createView = function() {
  18241. this.textField = new egret.TextField;
  18242. this.addChild(this.textField);
  18243. this.textField.y = 300;
  18244. this.textField.width = 480;
  18245. this.textField.height = 100;
  18246. this.textField.textAlign = "center"
  18247. };
  18248. e.prototype.setProgress = function(c, a) {
  18249. this.textField.text = "游戏加载中..." + c + "/" + a
  18250. };
  18251. return e
  18252. } (egret.Sprite),
  18253. __extends = this.__extends ||
  18254. function(c, e) {
  18255. function d() {
  18256. this.constructor = c
  18257. }
  18258. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18259. d.prototype = e.prototype;
  18260. c.prototype = new d
  18261. }; (function(c) {
  18262. var e = function(d) {
  18263. function a() {
  18264. d.call(this);
  18265. this.isWin = 0;
  18266. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  18267. }
  18268. __extends(a, d);
  18269. a.prototype.onAddToStage = function(a) {
  18270. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  18271. this.createGameScene()
  18272. };
  18273. a.prototype.createGameScene = function() {
  18274. this.stageW = this.stage.stageWidth;
  18275. this.stageH = this.stage.stageHeight;
  18276. this.map = new c.Map;
  18277. this.map.init();
  18278. this.map.x = 35;
  18279. this.map.y = this.stageH - 460;
  18280. this.addChild(this.map);
  18281. this.cat = new c.Cat2;
  18282. this.map.addEventListener("nodeClick", this.onNodeClick, this);
  18283. this.map.addEventListener("weizhu", this.onWeiZhu, this);
  18284. this.cat.addEventListener("catRun", this.onCatRun, this);
  18285. this.morebtn = this.createBitmapByName("more_btn");
  18286. this.morebtn.x = (this.stageW - this.morebtn.width) / 2;
  18287. this.morebtn.y = this.stageH - this.morebtn.height;
  18288. this.morebtn.touchEnabled = !0;
  18289. this.morebtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doMore, this);
  18290. this.scorePanel = new c.ScorePanel;
  18291. this.successPanel = new c.SuccessPanel;
  18292. this.successPanel.addEventListener("shareEvent", this.doShare, this);
  18293. this.successPanel.addEventListener("replayEvent", this.doRestart, this);
  18294. this.failPanel = new c.FailPanel;
  18295. this.failPanel.addEventListener("shareEvent", this.doShare, this);
  18296. this.failPanel.addEventListener("replayEvent", this.doRestart, this);
  18297. this.gameStart(null);
  18298. };
  18299. a.prototype.onWeiZhu = function(a) {
  18300. this.cat.weizhu()
  18301. };
  18302. a.prototype.doShare = function(a) {
  18303. dp_share();
  18304. };
  18305. a.prototype.doRestart = function(a) {
  18306. this.gameStart(null)
  18307. };
  18308. a.prototype.doMore = function(a) {
  18309. clickMore();
  18310. };
  18311. a.prototype.gameStart = function(a) {
  18312. this.map.init();
  18313. this.cat.init();
  18314. this.cat.node = this.map.getNode([4, 4]);
  18315. a = this.map.coverPos2Point([4, 4]);
  18316. this.cat.x = a[0];
  18317. this.cat.y = a[1] + 10;
  18318. this.addChild(this.cat);
  18319. this.successPanel.parent && this.removeChild(this.successPanel);
  18320. this.failPanel.parent && this.removeChild(this.failPanel);
  18321. this.morebtn.parent && this.removeChild(this.morebtn);
  18322. this.map.unlock();
  18323. this.isWin = 0;
  18324. };
  18325. a.prototype.onNodeClick = function(a) {
  18326. if (this.map.isExit(this.cat.node)) this.showResult(!1);
  18327. else if (this.map.lock(), a = this.map.findPath(this.cat.node), a.length) {
  18328. a = a[0];
  18329. var c = this.map.coverPos2Point(a);
  18330. this.cat.node = this.map.getNode(a);
  18331. this.cat.run(c)
  18332. } else this.showResult(!0)
  18333. };
  18334. a.prototype.onCatRun = function(a) {
  18335. this.map.unlock()
  18336. };
  18337. a.prototype.showResult = function(a) {
  18338. a ? (this.successPanel.x = (this.stageW - this.successPanel.width) / 2, this.successPanel.y = (this.stageH - this.successPanel.height - this.morebtn.height) / 2, this.successPanel.score(this.map.tap), this.addChild(this.successPanel), this.isWin = 1) : (this.failPanel.x = (this.stageW - this.failPanel.width) / 2, this.failPanel.y = (this.stageH - this.failPanel.height - this.morebtn.height) / 2, this.successPanel.score(this.map.tap), this.addChild(this.failPanel), this.isWin = 2);
  18339. this.addChild(this.morebtn);
  18340. dp_submitScore(this.map.tap,this.isWin);
  18341. };
  18342. a.prototype.createBitmapByName = function(a) {
  18343. var c = new egret.Bitmap;
  18344. a = RES.getRes(a);
  18345. c.texture = a;
  18346. return c
  18347. };
  18348. return a
  18349. } (egret.DisplayObjectContainer);
  18350. c.GameContainer = e
  18351. })(catgame || (catgame = {}));
  18352. __extends = this.__extends ||
  18353. function(c, e) {
  18354. function d() {
  18355. this.constructor = c
  18356. }
  18357. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18358. d.prototype = e.prototype;
  18359. c.prototype = new d
  18360. }; (function(c) {
  18361. var e = function(c) {
  18362. function a() {
  18363. c.call(this);
  18364. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  18365. }
  18366. __extends(a, c);
  18367. a.prototype.onAddToStage = function(a) {
  18368. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  18369. this.createMenu()
  18370. };
  18371. a.prototype.createMenu = function() {
  18372. this.stageW = this.stage.stageWidth;
  18373. this.stageH = this.stage.stageHeight;
  18374. this.logoImg = this.createBitmapByName("logoImage");
  18375. this.logoImg.x = (this.stageW - this.logoImg.width) / 2;
  18376. this.logoImg.y = (this.stageH - this.logoImg.height) / 2;
  18377. this.addChild(this.logoImg);
  18378. this.btnStart = this.createBitmapByName("btnStart");
  18379. this.btnStart.x = this.logoImg.x - 10;
  18380. this.btnStart.y = this.logoImg.y + this.logoImg.height + 10;
  18381. this.btnStart.touchEnabled = !0;
  18382. this.btnStart.addEventListener(egret.TouchEvent.TOUCH_TAP, this.gameStart, this);
  18383. this.addChild(this.btnStart);
  18384. this.btnFriend = this.createBitmapByName("btnFriend");
  18385. this.btnFriend.x = this.logoImg.x + this.logoImg.width - this.btnFriend.width - 10;
  18386. this.btnFriend.y = this.logoImg.y + this.logoImg.height + 10;
  18387. this.btnFriend.touchEnabled = !0;
  18388. this.btnFriend.addEventListener(egret.TouchEvent.TOUCH_TAP, this.gameStart, this);
  18389. this.addChild(this.btnFriend)
  18390. };
  18391. a.prototype.gameStart = function(a) {
  18392. a.target == this.btnStart ? this.dispatchEventWith("classic") : this.dispatchEventWith("hooby")
  18393. };
  18394. a.prototype.createBitmapByName = function(a) {
  18395. var c = new egret.Bitmap;
  18396. a = RES.getRes(a);
  18397. c.texture = a;
  18398. return c
  18399. };
  18400. return a
  18401. } (egret.DisplayObjectContainer);
  18402. c.Menu = e
  18403. })(catgame || (catgame = {}));
  18404. __extends = this.__extends ||
  18405. function(c, e) {
  18406. function d() {
  18407. this.constructor = c
  18408. }
  18409. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18410. d.prototype = e.prototype;
  18411. c.prototype = new d
  18412. }; (function(c) {
  18413. var e = function(d) {
  18414. function a() {
  18415. d.call(this);
  18416. this.isWin = this.cidx = 0;
  18417. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  18418. }
  18419. __extends(a, d);
  18420. a.prototype.onAddToStage = function(a) {
  18421. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  18422. this.createGameScene()
  18423. };
  18424. a.prototype.createGameScene = function() {
  18425. this.stageW = this.stage.stageWidth;
  18426. this.stageH = this.stage.stageHeight;
  18427. this.map = new c.Map;
  18428. this.map.init(0.2);
  18429. this.map.x = 35;
  18430. this.map.y = this.stageH - 460;
  18431. this.addChild(this.map);
  18432. this.cat = new c.Cat2;
  18433. this.kitty = new c.Kitty;
  18434. this.map.addEventListener("nodeClick", this.onNodeClick, this);
  18435. this.map.addEventListener("weizhu", this.onWeiZhu, this);
  18436. this.cat.addEventListener("catRun", this.onCatRun, this);
  18437. this.kitty.addEventListener("catRun", this.onCatRun, this);
  18438. this.morebtn = this.createBitmapByName("more_btn");
  18439. this.morebtn.x = (this.stageW - this.morebtn.width) / 2;
  18440. this.morebtn.y = this.stageH - this.morebtn.height;
  18441. this.morebtn.touchEnabled = !0;
  18442. this.morebtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doMore, this);
  18443. this.scorePanel = new c.ScorePanel;
  18444. this.successPanel = new c.TSuccessPanel;
  18445. this.successPanel.addEventListener("shareEvent", this.doShare, this);
  18446. this.successPanel.addEventListener("replayEvent", this.doRestart, this);
  18447. this.failPanel = new c.TFailPanel;
  18448. this.failPanel.addEventListener("shareEvent", this.doShare, this);
  18449. this.failPanel.addEventListener("replayEvent", this.doRestart, this);
  18450. this.gameStart(null)
  18451. };
  18452. a.prototype.onWeiZhu = function(a) {
  18453. this.thecat.weizhu()
  18454. };
  18455. a.prototype.doShare = function(a) {
  18456. share(this.map.tap, this.isWin)
  18457. };
  18458. a.prototype.doRestart = function(a) {
  18459. this.gameStart(null)
  18460. };
  18461. a.prototype.doMore = function(a) {
  18462. showme()
  18463. };
  18464. a.prototype.gameStart = function(a) {
  18465. this.map.init(0.2);
  18466. this.cat.init();
  18467. this.cat.node = this.map.getNode([4, 4]);
  18468. a = this.map.coverPos2Point([4, 4]);
  18469. this.cat.x = a[0];
  18470. this.cat.y = a[1] + 10;
  18471. this.kitty.init();
  18472. this.kitty.node = this.map.getNode([5, 4]);
  18473. a = this.map.coverPos2Point([5, 4]);
  18474. this.kitty.x = a[0];
  18475. this.kitty.y = a[1] + 10;
  18476. this.thecat = this.cat;
  18477. this.theothercat = this.kitty;
  18478. this.cidx = 0;
  18479. this.addChild(this.cat);
  18480. this.addChild(this.kitty);
  18481. this.successPanel.parent && this.removeChild(this.successPanel);
  18482. this.failPanel.parent && this.removeChild(this.failPanel);
  18483. this.morebtn.parent && this.removeChild(this.morebtn);
  18484. this.map.unlock();
  18485. this.isWin = 0
  18486. };
  18487. a.prototype.onNodeClick = function(a) {
  18488. if (this.map.isExit(this.thecat.node) || this.map.isExit(this.theothercat.node)) this.showResult(!1);
  18489. else if (this.map.lock(), 0 == this.cidx ? (this.cidx = 1, this.thecat = this.kitty, this.theothercat = this.cat) : 1 == this.cidx && (this.cidx = 0, this.thecat = this.cat, this.theothercat = this.kitty), a = this.map.findPath(this.thecat.node, this.theothercat.node), a.length) {
  18490. a = a[0];
  18491. var c = this.map.coverPos2Point(a);
  18492. this.thecat.node = this.map.getNode(a);
  18493. this.thecat.run(c)
  18494. } else this.checkAllCatch() ? this.showResult(!0) : (this.onCatRun(null), this.onNodeClick(null))
  18495. };
  18496. a.prototype.onCatRun = function(a) {
  18497. this.map.unlock();
  18498. this.thecat.y > this.theothercat.y && this.getChildIndex(this.thecat) < this.getChildIndex(this.theothercat) ? this.swapChildren(this.thecat, this.theothercat) : this.thecat.y < this.theothercat.y && this.getChildIndex(this.thecat) > this.getChildIndex(this.theothercat) && this.swapChildren(this.thecat, this.theothercat)
  18499. };
  18500. a.prototype.showResult = function(a) {
  18501. a ? (this.successPanel.x = (this.stageW - this.successPanel.width) / 2, this.successPanel.y = (this.stageH - this.successPanel.height - this.morebtn.height) / 2, this.successPanel.score(this.map.tap), this.addChild(this.successPanel), this.isWin = 1) : (this.failPanel.x = (this.stageW - this.failPanel.width) / 2, this.failPanel.y = (this.stageH - this.failPanel.height - this.morebtn.height) / 2, this.successPanel.score(this.map.tap), this.addChild(this.failPanel), this.isWin = 2);
  18502. this.addChild(this.morebtn)
  18503. };
  18504. a.prototype.createBitmapByName = function(a) {
  18505. var c = new egret.Bitmap;
  18506. a = RES.getRes(a);
  18507. c.texture = a;
  18508. return c
  18509. };
  18510. a.prototype.checkAllCatch = function() {
  18511. return this.map.findPath(this.theothercat.node, this.thecat.node).length ? !1 : !0
  18512. };
  18513. return a
  18514. } (egret.DisplayObjectContainer);
  18515. c.TwoGameContainer = e
  18516. })(catgame || (catgame = {}));
  18517. var __extends = this.__extends ||
  18518. function(c, e) {
  18519. function d() {
  18520. this.constructor = c
  18521. }
  18522. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18523. d.prototype = e.prototype;
  18524. c.prototype = new d
  18525. },
  18526. GameApp = function(c) {
  18527. function e() {
  18528. c.call(this);
  18529. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  18530. }
  18531. __extends(e, c);
  18532. e.prototype.onAddToStage = function(c) {
  18533. this.loadingView = new LoadingUI;
  18534. this.stage.addChild(this.loadingView);
  18535. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  18536. RES.loadConfig("resource/resource.js", "resource/")
  18537. };
  18538. e.prototype.onConfigComplete = function(c) {
  18539. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  18540. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  18541. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  18542. RES.loadGroup("preload")
  18543. };
  18544. e.prototype.onResourceLoadComplete = function(c) {
  18545. "preload" == c.groupName && (this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.createGameScene())
  18546. };
  18547. e.prototype.onResourceProgress = function(c) {
  18548. "preload" == c.groupName && this.loadingView.setProgress(c.itemsLoaded, c.itemsTotal)
  18549. };
  18550. e.prototype.createGameScene = function() {
  18551. var c = this.createBitmapByName("bgImage");
  18552. this.addChild(c);
  18553. var a = this.stage.stageWidth,
  18554. b = this.stage.stageHeight;
  18555. c.width = a;
  18556. c.height = b;
  18557. this.menu = new catgame.Menu;
  18558. this.menu.addEventListener("classic", this.enterClassic, this);
  18559. this.menu.addEventListener("hooby", this.enterHooby, this);
  18560. this.addChild(this.menu)
  18561. };
  18562. e.prototype.enterClassic = function(c) {
  18563. this.removeChild(this.menu);
  18564. c = new catgame.GameContainer;
  18565. this.addChild(c)
  18566. };
  18567. e.prototype.enterHooby = function(c) {
  18568. this.removeChild(this.menu);
  18569. c = new catgame.TwoGameContainer;
  18570. this.addChild(c)
  18571. };
  18572. e.prototype.createBitmapByName = function(c) {
  18573. var a = new egret.Bitmap;
  18574. c = RES.getRes(c);
  18575. a.texture = c;
  18576. return a
  18577. };
  18578. return e
  18579. } (egret.DisplayObjectContainer);