game-min.js 798 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878
  1. /*
  2. zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */
  3. var egret;
  4. (function(c) {
  5. var e = function() {
  6. function c() {
  7. this._hashCode = c.hashCount++
  8. }
  9. Object.defineProperty(c.prototype, "hashCode", {
  10. get: function() {
  11. return this._hashCode
  12. },
  13. enumerable: !0,
  14. configurable: !0
  15. });
  16. c.hashCount = 1;
  17. return c
  18. }();
  19. c.HashObject = e
  20. })(egret || (egret = {}));
  21. var __extends = this.__extends || 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. };
  29. (function(c) {
  30. var e = function(c) {
  31. function a(b) {
  32. "undefined" === typeof b && (b = 300);
  33. c.call(this);
  34. this.objectPool = [];
  35. this._length = 0;
  36. 1 > b && (b = 1);
  37. this.autoDisposeTime = b;
  38. this.frameCount = 0
  39. }
  40. __extends(a, c);
  41. a.prototype._checkFrame = function() {
  42. this.frameCount--;
  43. 0 >= this.frameCount && this.dispose()
  44. };
  45. Object.defineProperty(a.prototype, "length", {
  46. get: function() {
  47. return this._length
  48. },
  49. enumerable: !0,
  50. configurable: !0
  51. });
  52. a.prototype.push = function(b) {
  53. var g = this.objectPool; - 1 == g.indexOf(b) && (g.push(b), this._length++, 0 == this.frameCount &&
  54. (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  55. };
  56. a.prototype.pop = function() {
  57. if (0 == this._length) return null;
  58. this._length--;
  59. return this.objectPool.pop()
  60. };
  61. a.prototype.dispose = function() {
  62. 0 < this._length && (this.objectPool = [], this._length = 0);
  63. this.frameCount = 0;
  64. var b = a._callBackList,
  65. g = b.indexOf(this); - 1 != g && b.splice(g, 1)
  66. };
  67. a._callBackList = [];
  68. return a
  69. }(c.HashObject);
  70. c.Recycler = e
  71. })(egret || (egret = {}));
  72. (function(c) {
  73. c.__START_TIME;
  74. c.getTimer = function() {
  75. return Date.now() - c.__START_TIME
  76. }
  77. })(egret || (egret = {}));
  78. (function(c) {
  79. c.__callLaterFunctionList = [];
  80. c.__callLaterThisList = [];
  81. c.__callLaterArgsList = [];
  82. c.callLater = function(e, d) {
  83. for (var a = [], b = 0; b < arguments.length - 2; b++) a[b] = arguments[b + 2];
  84. c.__callLaterFunctionList.push(e);
  85. c.__callLaterThisList.push(d);
  86. c.__callLaterArgsList.push(a)
  87. }
  88. })(egret || (egret = {}));
  89. __extends = this.__extends || function(c, e) {
  90. function d() {
  91. this.constructor = c
  92. }
  93. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  94. d.prototype = e.prototype;
  95. c.prototype = new d
  96. };
  97. (function(c) {
  98. var e = function(d) {
  99. function a(b, a, c) {
  100. "undefined" === typeof a && (a = !1);
  101. "undefined" === typeof c && (c = !1);
  102. d.call(this);
  103. this._eventPhase = 2;
  104. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  105. this.isNew = !0;
  106. this._type = b;
  107. this._bubbles = a;
  108. this._cancelable = c
  109. }
  110. __extends(a, d);
  111. Object.defineProperty(a.prototype, "type", {
  112. get: function() {
  113. return this._type
  114. },
  115. enumerable: !0,
  116. configurable: !0
  117. });
  118. Object.defineProperty(a.prototype, "bubbles", {
  119. get: function() {
  120. return this._bubbles
  121. },
  122. enumerable: !0,
  123. configurable: !0
  124. });
  125. Object.defineProperty(a.prototype, "cancelable", {
  126. get: function() {
  127. return this._cancelable
  128. },
  129. enumerable: !0,
  130. configurable: !0
  131. });
  132. Object.defineProperty(a.prototype, "eventPhase", {
  133. get: function() {
  134. return this._eventPhase
  135. },
  136. enumerable: !0,
  137. configurable: !0
  138. });
  139. Object.defineProperty(a.prototype, "currentTarget", {
  140. get: function() {
  141. return this._currentTarget
  142. },
  143. enumerable: !0,
  144. configurable: !0
  145. });
  146. a.prototype._setCurrentTarget = function(b) {
  147. this._currentTarget = b
  148. };
  149. Object.defineProperty(a.prototype, "target", {
  150. get: function() {
  151. return this._target
  152. },
  153. enumerable: !0,
  154. configurable: !0
  155. });
  156. a.prototype.isDefaultPrevented = function() {
  157. return this._isDefaultPrevented
  158. };
  159. a.prototype.preventDefault = function() {
  160. this._cancelable && (this._isDefaultPrevented = !0)
  161. };
  162. a.prototype.stopPropagation = function() {
  163. this._bubbles && (this._isPropagationStopped = !0)
  164. };
  165. a.prototype.stopImmediatePropagation = function() {
  166. this._bubbles && (this._isPropagationImmediateStopped = !0)
  167. };
  168. a.prototype._reset = function() {
  169. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped =
  170. this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  171. };
  172. a._dispatchByTarget = function(b, a, l, d, e, h) {
  173. "undefined" === typeof e && (e = !1);
  174. "undefined" === typeof h && (h = !1);
  175. var k = b.eventRecycler;
  176. k || (k = b.eventRecycler = new c.Recycler);
  177. var n = k.pop();
  178. n ? n._type = l : n = new b(l);
  179. n._bubbles = e;
  180. n._cancelable = h;
  181. if (d)
  182. for (var q in d) n[q] = d[q], null !== n[q] && (d[q] = null);
  183. b = a.dispatchEvent(n);
  184. k.push(n);
  185. return b
  186. };
  187. a._getPropertyData = function(b) {
  188. var a = b._props;
  189. a || (a = b._props = {});
  190. return a
  191. };
  192. a.dispatchEvent = function(b, g, c, d) {
  193. "undefined" === typeof c && (c = !1);
  194. var e = a._getPropertyData(a);
  195. d && (e.data = d);
  196. a._dispatchByTarget(a, b, g, e, c)
  197. };
  198. a.ADDED_TO_STAGE = "addedToStage";
  199. a.REMOVED_FROM_STAGE = "removedFromStage";
  200. a.ADDED = "added";
  201. a.REMOVED = "removed";
  202. a.COMPLETE = "complete";
  203. a.ENTER_FRAME = "enterFrame";
  204. a.RENDER = "render";
  205. a.FINISH_RENDER = "finishRender";
  206. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  207. a.LEAVE_STAGE = "leaveStage";
  208. a.RESIZE = "resize";
  209. a.CHANGE = "change";
  210. return a
  211. }(c.HashObject);
  212. c.Event =
  213. e
  214. })(egret || (egret = {}));
  215. __extends = this.__extends || function(c, e) {
  216. function d() {
  217. this.constructor = c
  218. }
  219. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  220. d.prototype = e.prototype;
  221. c.prototype = new d
  222. };
  223. (function(c) {
  224. var e = function(d) {
  225. function a(b, a, c) {
  226. "undefined" === typeof a && (a = !1);
  227. "undefined" === typeof c && (c = !1);
  228. d.call(this, b, a, c)
  229. }
  230. __extends(a, d);
  231. a.dispatchIOErrorEvent = function(b) {
  232. c.Event._dispatchByTarget(a, b, a.IO_ERROR)
  233. };
  234. a.IO_ERROR = "ioError";
  235. return a
  236. }(c.Event);
  237. c.IOErrorEvent = e
  238. })(egret || (egret = {}));
  239. __extends = this.__extends || function(c, e) {
  240. function d() {
  241. this.constructor = c
  242. }
  243. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  244. d.prototype = e.prototype;
  245. c.prototype = new d
  246. };
  247. (function(c) {
  248. var e = function(d) {
  249. function a(b, a, c, m, e, h, k, n, q, p) {
  250. "undefined" === typeof a && (a = !0);
  251. "undefined" === typeof c && (c = !0);
  252. "undefined" === typeof m && (m = 0);
  253. "undefined" === typeof e && (e = 0);
  254. "undefined" === typeof h && (h = 0);
  255. "undefined" === typeof k && (k = !1);
  256. "undefined" === typeof n && (n = !1);
  257. "undefined" === typeof p && (p = !1);
  258. d.call(this, b, a, c);
  259. this._localY = this._localX = this._stageY = this._stageX = 0;
  260. this.touchPointID = m;
  261. this._stageX = e;
  262. this._stageY = h;
  263. this.ctrlKey = k;
  264. this.altKey = n;
  265. this.touchDown = p
  266. }
  267. __extends(a, d);
  268. Object.defineProperty(a.prototype,
  269. "stageX", {
  270. get: function() {
  271. return this._stageX
  272. },
  273. enumerable: !0,
  274. configurable: !0
  275. });
  276. Object.defineProperty(a.prototype, "stageY", {
  277. get: function() {
  278. return this._stageY
  279. },
  280. enumerable: !0,
  281. configurable: !0
  282. });
  283. Object.defineProperty(a.prototype, "localX", {
  284. get: function() {
  285. return this._localX
  286. },
  287. enumerable: !0,
  288. configurable: !0
  289. });
  290. Object.defineProperty(a.prototype, "localY", {
  291. get: function() {
  292. return this._localY
  293. },
  294. enumerable: !0,
  295. configurable: !0
  296. });
  297. a.prototype._setCurrentTarget = function(b) {
  298. d.prototype._setCurrentTarget.call(this, b);
  299. b instanceof
  300. c.DisplayObject && (b = b.globalToLocal(this._stageX, this._stageY, c.Point.identity), this._localX = b.x, this._localY = b.y)
  301. };
  302. a.dispatchTouchEvent = function(b, g, l, d, e, h, k, n, q) {
  303. "undefined" === typeof l && (l = 0);
  304. "undefined" === typeof d && (d = 0);
  305. "undefined" === typeof e && (e = 0);
  306. "undefined" === typeof h && (h = !1);
  307. "undefined" === typeof k && (k = !1);
  308. "undefined" === typeof n && (n = !1);
  309. "undefined" === typeof q && (q = !1);
  310. var p = c.Event._getPropertyData(a);
  311. p.touchPointID = l;
  312. p._stageX = d;
  313. p._stageY = e;
  314. p.ctrlKey = h;
  315. p.altKey = k;
  316. p.shiftKey = n;
  317. p.touchDown =
  318. q;
  319. c.Event._dispatchByTarget(a, b, g, p, !0, !0)
  320. };
  321. a.TOUCH_TAP = "touchTap";
  322. a.TOUCH_MOVE = "touchMove";
  323. a.TOUCH_BEGIN = "touchBegin";
  324. a.TOUCH_END = "touchEnd";
  325. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  326. a.TOUCH_ROLL_OUT = "touchRollOut";
  327. a.TOUCH_ROLL_OVER = "touchRollOver";
  328. a.TOUCH_OUT = "touchOut";
  329. a.TOUCH_OVER = "touchOver";
  330. return a
  331. }(c.Event);
  332. c.TouchEvent = e
  333. })(egret || (egret = {}));
  334. __extends = this.__extends || function(c, e) {
  335. function d() {
  336. this.constructor = c
  337. }
  338. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  339. d.prototype = e.prototype;
  340. c.prototype = new d
  341. };
  342. (function(c) {
  343. var e = function(d) {
  344. function a(b, a, c) {
  345. "undefined" === typeof a && (a = !1);
  346. "undefined" === typeof c && (c = !1);
  347. d.call(this, b, a, c)
  348. }
  349. __extends(a, d);
  350. a.dispatchTimerEvent = function(b, g) {
  351. c.Event._dispatchByTarget(a, b, g)
  352. };
  353. a.TIMER = "timer";
  354. a.TIMER_COMPLETE = "timerComplete";
  355. return a
  356. }(c.Event);
  357. c.TimerEvent = e
  358. })(egret || (egret = {}));
  359. (function(c) {
  360. var e = function() {
  361. function c() {}
  362. c.CAPTURING_PHASE = 1;
  363. c.AT_TARGET = 2;
  364. c.BUBBLING_PHASE = 3;
  365. return c
  366. }();
  367. c.EventPhase = e
  368. })(egret || (egret = {}));
  369. __extends = this.__extends || function(c, e) {
  370. function d() {
  371. this.constructor = c
  372. }
  373. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  374. d.prototype = e.prototype;
  375. c.prototype = new d
  376. };
  377. (function(c) {
  378. var e = function(d) {
  379. function a(b) {
  380. "undefined" === typeof b && (b = null);
  381. d.call(this);
  382. this._eventTarget = b ? b : this
  383. }
  384. __extends(a, d);
  385. a.prototype.addEventListener = function(b, a, l, d, e) {
  386. "undefined" === typeof d && (d = !1);
  387. "undefined" === typeof e && (e = 0);
  388. "undefined" === typeof d && (d = !1);
  389. "undefined" === typeof e && (e = 0);
  390. a || c.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  391. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  392. var h = d[b];
  393. h || (h = d[b] = []);
  394. this._insertEventBin(h, a, l, e)
  395. };
  396. a.prototype._insertEventBin = function(b, a, c, d) {
  397. for (var e = -1, h = b.length, k = 0; k < h; k++) {
  398. var n = b[k];
  399. if (n.listener === a && n.thisObject === c) return !1; - 1 == e && n.priority < d && (e = k)
  400. }
  401. a = {
  402. listener: a,
  403. thisObject: c,
  404. priority: d
  405. }; - 1 != e ? b.splice(e, 0, a) : b.push(a);
  406. return !0
  407. };
  408. a.prototype.removeEventListener = function(b, a, c, d) {
  409. "undefined" === typeof d && (d = !1);
  410. if (d = d ? this._captureEventsMap : this._eventsMap) {
  411. var e = d[b];
  412. e && (this._removeEventBin(e, a, c), 0 ==
  413. e.length && delete d[b])
  414. }
  415. };
  416. a.prototype._removeEventBin = function(b, a, c) {
  417. for (var d = b.length, e = 0; e < d; e++) {
  418. var h = b[e];
  419. if (h.listener === a && h.thisObject === c) return b.splice(e, 1), !0
  420. }
  421. return !1
  422. };
  423. a.prototype.hasEventListener = function(b) {
  424. return this._eventsMap && this._eventsMap[b] || this._captureEventsMap && this._captureEventsMap[b]
  425. };
  426. a.prototype.willTrigger = function(b) {
  427. return this.hasEventListener(b)
  428. };
  429. a.prototype.dispatchEvent = function(b) {
  430. b._reset();
  431. b._target = this._eventTarget;
  432. b._setCurrentTarget(this._eventTarget);
  433. return this._notifyListener(b)
  434. };
  435. a.prototype._notifyListener = function(b) {
  436. var a = 1 == b._eventPhase ? this._captureEventsMap : this._eventsMap;
  437. if (!a) return !0;
  438. a = a[b.type];
  439. if (!a) return !0;
  440. for (var a = a.concat(), c = a.length, d = 0; d < c; d++) {
  441. var e = a[d];
  442. e.listener.call(e.thisObject, b);
  443. if (b._isPropagationImmediateStopped) break
  444. }
  445. return !b.isDefaultPrevented()
  446. };
  447. a.prototype.dispatchEventWith = function(b, a, l) {
  448. "undefined" === typeof a && (a = !1);
  449. c.Event.dispatchEvent(this, b, a, l)
  450. };
  451. return a
  452. }(c.HashObject);
  453. c.EventDispatcher = e
  454. })(egret ||
  455. (egret = {}));
  456. __extends = this.__extends || function(c, e) {
  457. function d() {
  458. this.constructor = c
  459. }
  460. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  461. d.prototype = e.prototype;
  462. c.prototype = new d
  463. };
  464. (function(c) {
  465. var e = function(d) {
  466. function a() {
  467. d.call(this);
  468. this.reuseEvent = new c.Event("")
  469. }
  470. __extends(a, d);
  471. a.prototype.run = function() {
  472. c.Ticker.getInstance().run();
  473. c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  474. c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  475. this.touchContext.run();
  476. c.__invalidateModuleFlag = !0
  477. };
  478. a.prototype.renderLoop = function(b) {
  479. b = this.rendererContext;
  480. b.clearScreen();
  481. if (0 < c.__callLaterFunctionList.length) {
  482. var a = c.__callLaterFunctionList;
  483. c.__callLaterFunctionList = [];
  484. var l = c.__callLaterThisList;
  485. c.__callLaterThisList = [];
  486. var d = c.__callLaterArgsList;
  487. c.__callLaterArgsList = []
  488. }
  489. this.dispatchEventWith(c.Event.RENDER);
  490. c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
  491. a && this.doCallLaterList(a, l, d);
  492. this.stage._updateTransform();
  493. this.dispatchEventWith(c.Event.FINISH_UPDATE_TRANSFORM);
  494. this.stage._draw(b);
  495. this.dispatchEventWith(c.Event.FINISH_RENDER)
  496. };
  497. a.prototype.broadcastEnterFrame = function(b) {
  498. b = this.reuseEvent;
  499. b._type = c.Event.ENTER_FRAME;
  500. this.dispatchEvent(b);
  501. for (var a = c.DisplayObject._enterFrameCallBackList.concat(), l = a.length, d = 0; d < l; d++) {
  502. var e = a[d];
  503. b._target = e.display;
  504. b._setCurrentTarget(e.display);
  505. e.listener.call(e.thisObject, b)
  506. }
  507. a = c.Recycler._callBackList;
  508. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  509. };
  510. a.prototype.broadcastRender = function() {
  511. var b = this.reuseEvent;
  512. b._type = c.Event.RENDER;
  513. for (var a = c.DisplayObject._renderCallBackList.concat(), l = a.length, d = 0; d < l; d++) {
  514. var e = a[d];
  515. b._target = e.display;
  516. b._setCurrentTarget(e.display);
  517. e.listener.call(e.thisObject, b)
  518. }
  519. };
  520. a.prototype.doCallLaterList = function(b, a, c) {
  521. for (var d = b.length, e = 0; e < d; e++) {
  522. var h = b[e];
  523. null != h && h.apply(a[e], c[e])
  524. }
  525. };
  526. return a
  527. }(c.EventDispatcher);
  528. c.MainContext = e
  529. })(egret || (egret = {}));
  530. egret.MainContext.instance = new egret.MainContext;
  531. (function(c) {
  532. var e = function() {
  533. function d() {
  534. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  535. this._maxDeltaTime = 500;
  536. this._totalDeltaTime = 0
  537. }
  538. d.getInstance = function() {
  539. null == d.instance && (d.instance = new d);
  540. return d.instance
  541. };
  542. d.prototype.run = function() {
  543. c.Ticker.getInstance().register(this.update, this);
  544. null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, c.MainContext.instance.stage.addChild(this._txt));
  545. var a =
  546. c.MainContext.instance;
  547. a.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  548. a.addEventListener(c.Event.RENDER, this.onStartRender, this);
  549. a.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
  550. a.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  551. };
  552. d.prototype.onEnterFrame = function(a) {
  553. this._lastTime = c.getTimer()
  554. };
  555. d.prototype.onStartRender = function(a) {
  556. a = c.getTimer();
  557. this._logicPerformanceCost = a - this._lastTime;
  558. this._lastTime = a
  559. };
  560. d.prototype.onFinishUpdateTransform =
  561. function(a) {
  562. a = c.getTimer();
  563. this._updateTransformPerformanceCost = a - this._lastTime;
  564. this._lastTime = a
  565. };
  566. d.prototype.onFinishRender = function(a) {
  567. a = c.getTimer();
  568. this._renderPerformanceCost = a - this._lastTime;
  569. this._lastTime = a
  570. };
  571. d.prototype.update = function(a) {
  572. this._tick++;
  573. this._totalDeltaTime += a;
  574. if (this._totalDeltaTime >= this._maxDeltaTime) {
  575. a = (this._preDrawCount - 1).toString();
  576. var b = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  577. "," + Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();
  578. this._txt.text = "draw:" + a + "\ncost:" + b + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  579. this._tick = this._totalDeltaTime = 0
  580. }
  581. this._preDrawCount = 0
  582. };
  583. d.prototype.onDrawImage = function() {
  584. this._preDrawCount++
  585. };
  586. return d
  587. }();
  588. c.Profiler = e
  589. })(egret || (egret = {}));
  590. __extends = this.__extends || function(c, e) {
  591. function d() {
  592. this.constructor = c
  593. }
  594. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  595. d.prototype = e.prototype;
  596. c.prototype = new d
  597. };
  598. (function(c) {
  599. var e = function(d) {
  600. function a() {
  601. d.apply(this, arguments);
  602. this._timeScale = 1;
  603. this._paused = !1;
  604. this.callBackList = []
  605. }
  606. __extends(a, d);
  607. a.prototype.run = function() {
  608. c.__START_TIME = (new Date).getTime();
  609. c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  610. };
  611. a.prototype.update = function(b) {
  612. var a = this.callBackList.concat(),
  613. c = a.length;
  614. b *= this._timeScale;
  615. b *= this._timeScale;
  616. for (var d = 0; d < c; d++) {
  617. var e = a[d];
  618. e.listener.call(e.thisObject, b)
  619. }
  620. };
  621. a.prototype.register = function(b, a, c) {
  622. "undefined" ===
  623. typeof c && (c = 0);
  624. this._insertEventBin(this.callBackList, b, a, c)
  625. };
  626. a.prototype.unregister = function(b, a) {
  627. this._removeEventBin(this.callBackList, b, a)
  628. };
  629. a.prototype.setTimeout = function(b, a, l) {
  630. for (var d = [], e = 0; e < arguments.length - 3; e++) d[e] = arguments[e + 3];
  631. c.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  632. c.setTimeout.apply(null, [b, a, l].concat(d))
  633. };
  634. a.prototype.setTimeScale = function(b) {
  635. this._timeScale = b
  636. };
  637. a.prototype.getTimeScale = function() {
  638. return this._timeScale
  639. };
  640. a.prototype.pause = function() {
  641. this._paused = !0
  642. };
  643. a.prototype.resume = function() {
  644. this._paused = !1
  645. };
  646. a.getInstance = function() {
  647. null == a.instance && (a.instance = new a);
  648. return a.instance
  649. };
  650. return a
  651. }(c.EventDispatcher);
  652. c.Ticker = e
  653. })(egret || (egret = {}));
  654. (function(c) {
  655. var e = function() {
  656. function c() {}
  657. c.LEFT = "left";
  658. c.RIGHT = "right";
  659. c.CENTER = "center";
  660. c.JUSTIFY = "justify";
  661. c.CONTENT_JUSTIFY = "contentJustify";
  662. return c
  663. }();
  664. c.HorizontalAlign = e
  665. })(egret || (egret = {}));
  666. (function(c) {
  667. var e = function() {
  668. function c() {}
  669. c.TOP = "top";
  670. c.BOTTOM = "bottom";
  671. c.MIDDLE = "middle";
  672. c.JUSTIFY = "justify";
  673. c.CONTENT_JUSTIFY = "contentJustify";
  674. return c
  675. }();
  676. c.VerticalAlign = e
  677. })(egret || (egret = {}));
  678. __extends = this.__extends || function(c, e) {
  679. function d() {
  680. this.constructor = c
  681. }
  682. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  683. d.prototype = e.prototype;
  684. c.prototype = new d
  685. };
  686. (function(c) {
  687. var e = function(d) {
  688. function a(b, a) {
  689. "undefined" === typeof a && (a = 0);
  690. d.call(this);
  691. this._currentCount = 0;
  692. this.delay = b;
  693. this.repeatCount = a
  694. }
  695. __extends(a, d);
  696. a.prototype.currentCount = function() {
  697. return this._currentCount
  698. };
  699. Object.defineProperty(a.prototype, "running", {
  700. get: function() {
  701. return this._running
  702. },
  703. enumerable: !0,
  704. configurable: !0
  705. });
  706. a.prototype.reset = function() {
  707. this.stop();
  708. this._currentCount = 0
  709. };
  710. a.prototype.start = function() {
  711. this._running || (this.lastTime = c.getTimer(), 0 != this._currentCount && (this._currentCount =
  712. 0), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  713. };
  714. a.prototype.stop = function() {
  715. this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  716. };
  717. a.prototype.onEnterFrame = function(b) {
  718. b = c.getTimer();
  719. 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)))
  720. };
  721. return a
  722. }(c.EventDispatcher);
  723. c.Timer = e
  724. })(egret || (egret = {}));
  725. (function(c) {
  726. function e(b) {
  727. b = b.toString();
  728. var a = b.indexOf("(");
  729. return b.substring(9, a)
  730. }
  731. function d(b, g) {
  732. for (var c in b) {
  733. var m = b[c],
  734. f = typeof m;
  735. "function" == f ? m.prototype && (f = m.toString(), a[f] || (a[f] = g + "." + e(m))) : "object" != f || m instanceof Array || d(m, g + "." + c)
  736. }
  737. }
  738. c.__moduleNameList = ["egret", "RES", "dragonBones"];
  739. c.__invalidateModuleFlag = !0;
  740. var a = {};
  741. c.getQualifiedClassName = function(b) {
  742. b = b.prototype ? b.prototype.constructor : b.__proto__.constructor;
  743. var g = b.toString(),
  744. l = a[g];
  745. if (l) return l;
  746. if (c.__invalidateModuleFlag) {
  747. for (var l =
  748. c.__moduleNameList, m = l.length, f = 0; f < m; f++) {
  749. var h = l[f],
  750. k = __global[h];
  751. k && "object" == typeof k && k.__proto__ && "Object" == e(k.__proto__.constructor) && d(k, h)
  752. }
  753. c.__invalidateModuleFlag = !1;
  754. if (l = a[g]) return l
  755. }
  756. return a[g] = l = e(b)
  757. }
  758. })(egret || (egret = {}));
  759. var __global = __global || this;
  760. (function(c) {
  761. var e = {};
  762. c.getDefinitionByName = function(c) {
  763. if (!c) return null;
  764. var a = e[c];
  765. if (a) return a;
  766. for (var b = c.split("."), g = b.length, a = __global, l = 0; l < g; l++)
  767. if (a = a[b[l]], !a) return null;
  768. return e[c] = a
  769. }
  770. })(egret || (egret = {}));
  771. __global = __global || this;
  772. (function(c) {
  773. function e(b) {
  774. for (var a in d) {
  775. var c = d[a];
  776. c.delay -= b;
  777. 0 >= c.delay && (c.listener.apply(c.thisObject, c.params), delete d[a])
  778. }
  779. }
  780. var d = {},
  781. a = 0;
  782. c.setTimeout = function(b, g, l) {
  783. for (var m = [], f = 0; f < arguments.length - 3; f++) m[f] = arguments[f + 3];
  784. m = {
  785. listener: b,
  786. thisObject: g,
  787. delay: l,
  788. params: m
  789. };
  790. 0 == a && c.Ticker.getInstance().register(e, null);
  791. a++;
  792. d[a] = m;
  793. return a
  794. };
  795. c.clearTimeout = function(b) {
  796. delete d[b]
  797. }
  798. })(egret || (egret = {}));
  799. (function(c) {
  800. c.hasDefinition = function(e) {
  801. return c.getDefinitionByName(e) ? !0 : !1
  802. }
  803. })(egret || (egret = {}));
  804. (function(c) {
  805. c.toColorString = function(c) {
  806. if (isNaN(c) || 0 > c) c = 0;
  807. 16777215 < c && (c = 16777215);
  808. for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
  809. return "#" + c
  810. }
  811. })(egret || (egret = {}));
  812. __extends = this.__extends || function(c, e) {
  813. function d() {
  814. this.constructor = c
  815. }
  816. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  817. d.prototype = e.prototype;
  818. c.prototype = new d
  819. };
  820. (function(c) {
  821. var e = function(d) {
  822. function a(b, a, c, e, f, h) {
  823. "undefined" === typeof b && (b = 1);
  824. "undefined" === typeof a && (a = 0);
  825. "undefined" === typeof c && (c = 0);
  826. "undefined" === typeof e && (e = 1);
  827. "undefined" === typeof f && (f = 0);
  828. "undefined" === typeof h && (h = 0);
  829. d.call(this);
  830. this.a = b;
  831. this.b = a;
  832. this.c = c;
  833. this.d = e;
  834. this.tx = f;
  835. this.ty = h
  836. }
  837. __extends(a, d);
  838. a.prototype.prepend = function(b, a, c, d, e, h) {
  839. var k = this.tx;
  840. if (1 != b || 0 != a || 0 != c || 1 != d) {
  841. var n = this.a,
  842. q = this.c;
  843. this.a = n * b + this.b * c;
  844. this.b = n * a + this.b * d;
  845. this.c = q * b + this.d * c;
  846. this.d = q * a + this.d *
  847. d
  848. }
  849. this.tx = k * b + this.ty * c + e;
  850. this.ty = k * a + this.ty * d + h;
  851. return this
  852. };
  853. a.prototype.append = function(b, a, c, d, e, h) {
  854. var k = this.a,
  855. n = this.b,
  856. q = this.c,
  857. p = this.d;
  858. this.a = b * k + a * q;
  859. this.b = b * n + a * p;
  860. this.c = c * k + d * q;
  861. this.d = c * n + d * p;
  862. this.tx = e * k + h * q + this.tx;
  863. this.ty = e * n + h * p + this.ty;
  864. return this
  865. };
  866. a.prototype.prependMatrix = function(b) {
  867. this.prepend(b.a, b.b, b.c, b.d, b.tx, b.ty);
  868. return this
  869. };
  870. a.prototype.appendMatrix = function(b) {
  871. this.append(b.a, b.b, b.c, b.d, b.tx, b.ty);
  872. return this
  873. };
  874. a.prototype.prependTransform = function(b, g, c, d, e, h, k, n, q) {
  875. if (e %
  876. 360) {
  877. var p = e * a.DEG_TO_RAD;
  878. e = Math.cos(p);
  879. p = Math.sin(p)
  880. } else e = 1, p = 0; if (n || q) this.tx -= n, this.ty -= q;
  881. h || k ? (h *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.prepend(e * c, p * c, -p * d, e * d, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), b, g)) : this.prepend(e * c, p * c, -p * d, e * d, b, g);
  882. return this
  883. };
  884. a.prototype.appendTransform = function(b, g, c, d, e, h, k, n, q) {
  885. if (e % 360) {
  886. var p = e * a.DEG_TO_RAD;
  887. e = Math.cos(p);
  888. p = Math.sin(p)
  889. } else e = 1, p = 0;
  890. h || k ? (h *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(h),
  891. Math.cos(h), b, g), this.append(e * c, p * c, -p * d, e * d, 0, 0)) : this.append(e * c, p * c, -p * d, e * d, b, g);
  892. if (n || q) this.tx -= n * this.a + q * this.c, this.ty -= n * this.b + q * this.d;
  893. return this
  894. };
  895. a.prototype.rotate = function(b) {
  896. var a = Math.cos(b);
  897. b = Math.sin(b);
  898. var c = this.a,
  899. d = this.c,
  900. e = this.tx;
  901. this.a = c * a - this.b * b;
  902. this.b = c * b + this.b * a;
  903. this.c = d * a - this.d * b;
  904. this.d = d * b + this.d * a;
  905. this.tx = e * a - this.ty * b;
  906. this.ty = e * b + this.ty * a;
  907. return this
  908. };
  909. a.prototype.skew = function(b, g) {
  910. b *= a.DEG_TO_RAD;
  911. g *= a.DEG_TO_RAD;
  912. this.append(Math.cos(g), Math.sin(g), -Math.sin(b),
  913. Math.cos(b), 0, 0);
  914. return this
  915. };
  916. a.prototype.scale = function(b, a) {
  917. this.a *= b;
  918. this.d *= a;
  919. this.c *= b;
  920. this.b *= a;
  921. this.tx *= b;
  922. this.ty *= a;
  923. return this
  924. };
  925. a.prototype.translate = function(b, a) {
  926. this.tx += b;
  927. this.ty += a;
  928. return this
  929. };
  930. a.prototype.identity = function() {
  931. this.a = this.d = 1;
  932. this.b = this.c = this.tx = this.ty = 0;
  933. return this
  934. };
  935. a.prototype.invert = function() {
  936. var b = this.a,
  937. a = this.b,
  938. c = this.c,
  939. d = this.d,
  940. e = this.tx,
  941. h = b * d - a * c;
  942. this.a = d / h;
  943. this.b = -a / h;
  944. this.c = -c / h;
  945. this.d = b / h;
  946. this.tx = (c * this.ty - d * e) / h;
  947. this.ty = -(b * this.ty - a * e) / h;
  948. return this
  949. };
  950. a.transformCoords = function(b, a, d) {
  951. var e = c.Point.identity;
  952. e.x = b.a * a + b.c * d + b.tx;
  953. e.y = b.d * d + b.b * a + b.ty;
  954. return e
  955. };
  956. a.prototype.toArray = function(b) {
  957. this.array || (this.array = new Float32Array(9));
  958. b ? (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = 0, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = 0, this.array[6] = this.tx, this.array[7] = this.ty) : (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = this.tx, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = this.ty, this.array[6] = 0, this.array[7] =
  959. 0);
  960. this.array[8] = 1;
  961. return this.array
  962. };
  963. a.identity = new a;
  964. a.DEG_TO_RAD = Math.PI / 180;
  965. return a
  966. }(c.HashObject);
  967. c.Matrix = e
  968. })(egret || (egret = {}));
  969. __extends = this.__extends || function(c, e) {
  970. function d() {
  971. this.constructor = c
  972. }
  973. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  974. d.prototype = e.prototype;
  975. c.prototype = new d
  976. };
  977. (function(c) {
  978. var e = function(c) {
  979. function a(b, a) {
  980. "undefined" === typeof b && (b = 0);
  981. "undefined" === typeof a && (a = 0);
  982. c.call(this);
  983. this.x = b;
  984. this.y = a
  985. }
  986. __extends(a, c);
  987. a.prototype.clone = function() {
  988. return new a(this.x, this.y)
  989. };
  990. a.prototype.equals = function(b) {
  991. return this.x == b.x && this.y == b.y
  992. };
  993. a.distance = function(b, a) {
  994. return Math.sqrt((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y))
  995. };
  996. a.identity = new a(0, 0);
  997. return a
  998. }(c.HashObject);
  999. c.Point = e
  1000. })(egret || (egret = {}));
  1001. __extends = this.__extends || function(c, e) {
  1002. function d() {
  1003. this.constructor = c
  1004. }
  1005. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1006. d.prototype = e.prototype;
  1007. c.prototype = new d
  1008. };
  1009. (function(c) {
  1010. var e = function(c) {
  1011. function a(b, a, l, e) {
  1012. "undefined" === typeof b && (b = 0);
  1013. "undefined" === typeof a && (a = 0);
  1014. "undefined" === typeof l && (l = 0);
  1015. "undefined" === typeof e && (e = 0);
  1016. c.call(this);
  1017. this.x = b;
  1018. this.y = a;
  1019. this.width = l;
  1020. this.height = e
  1021. }
  1022. __extends(a, c);
  1023. Object.defineProperty(a.prototype, "right", {
  1024. get: function() {
  1025. return this.x + this.width
  1026. },
  1027. set: function(b) {
  1028. this.width = b - this.x
  1029. },
  1030. enumerable: !0,
  1031. configurable: !0
  1032. });
  1033. Object.defineProperty(a.prototype, "bottom", {
  1034. get: function() {
  1035. return this.y + this.height
  1036. },
  1037. set: function(b) {
  1038. this.height =
  1039. b - this.y
  1040. },
  1041. enumerable: !0,
  1042. configurable: !0
  1043. });
  1044. a.prototype.initialize = function(b, a, c, d) {
  1045. this.x = b;
  1046. this.y = a;
  1047. this.width = c;
  1048. this.height = d;
  1049. return this
  1050. };
  1051. a.prototype.contains = function(b, a) {
  1052. return this.x <= b && this.x + this.width >= b && this.y <= a && this.y + this.height >= a
  1053. };
  1054. a.prototype.intersects = function(b) {
  1055. 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
  1056. };
  1057. a.prototype.clone = function() {
  1058. return new a(this.x, this.y, this.width, this.height)
  1059. };
  1060. a.prototype.containsPoint =
  1061. function(b) {
  1062. return this.x < b.x && this.x + this.width > b.x && this.y < b.y && this.y + this.height > b.y ? !0 : !1
  1063. };
  1064. a.identity = new a(0, 0, 0, 0);
  1065. return a
  1066. }(c.HashObject);
  1067. c.Rectangle = e
  1068. })(egret || (egret = {}));
  1069. (function(c) {
  1070. var e = function() {
  1071. function d() {}
  1072. d.fatal = function(a, b) {
  1073. "undefined" === typeof b && (b = null);
  1074. c.Logger.traceToConsole("Fatal", a, b);
  1075. throw Error(c.Logger.getTraceCode("Fatal", a, b));
  1076. };
  1077. d.info = function(a, b) {
  1078. "undefined" === typeof b && (b = null);
  1079. c.Logger.traceToConsole("Info", a, b)
  1080. };
  1081. d.warning = function(a, b) {
  1082. "undefined" === typeof b && (b = null);
  1083. c.Logger.traceToConsole("Warning", a, b)
  1084. };
  1085. d.traceToConsole = function(a, b, g) {
  1086. console.log(c.Logger.getTraceCode(a, b, g))
  1087. };
  1088. d.getTraceCode = function(a, b, g) {
  1089. return "[" + a + "]" + b + ":" +
  1090. (null == g ? "" : g)
  1091. };
  1092. return d
  1093. }();
  1094. c.Logger = e
  1095. })(egret || (egret = {}));
  1096. __extends = this.__extends || function(c, e) {
  1097. function d() {
  1098. this.constructor = c
  1099. }
  1100. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1101. d.prototype = e.prototype;
  1102. c.prototype = new d
  1103. };
  1104. (function(c) {
  1105. var e = function(b) {
  1106. function g() {
  1107. b.call(this);
  1108. this._designHeight = this._designWidth = 0;
  1109. this._scaleY = this._scaleX = 1;
  1110. var a = document.getElementById(g.canvas_name),
  1111. c = a.height;
  1112. this._designWidth = a.width;
  1113. this._designHeight = c
  1114. }
  1115. __extends(g, b);
  1116. g.getInstance = function() {
  1117. null == g.instance && (a.initialize(), g.instance = new g);
  1118. return g.instance
  1119. };
  1120. g.prototype.setDesignSize = function(b, a, g) {
  1121. this.setResolutionPolicy(g);
  1122. this._designWidth = b;
  1123. this._designHeight = a;
  1124. this._resolutionPolicy._apply(this, this._designWidth,
  1125. this._designHeight)
  1126. };
  1127. g.prototype.setResolutionPolicy = function(b) {
  1128. this._resolutionPolicy = b;
  1129. b.init(this)
  1130. };
  1131. g.prototype.getScaleX = function() {
  1132. return this._scaleX
  1133. };
  1134. g.prototype.getScaleY = function() {
  1135. return this._scaleY
  1136. };
  1137. g.canvas_name = "gameCanvas";
  1138. g.canvas_div_name = "gameDiv";
  1139. return g
  1140. }(c.HashObject);
  1141. c.StageDelegate = e;
  1142. var d = function() {
  1143. function b(a, g) {
  1144. this.setContainerStrategy(a);
  1145. this.setContentStrategy(g)
  1146. }
  1147. b.prototype.init = function(b) {
  1148. this._containerStrategy.init(b);
  1149. this._contentStrategy.init(b)
  1150. };
  1151. b.prototype._apply =
  1152. function(b, a, g) {
  1153. this._containerStrategy._apply(b, a, g);
  1154. this._contentStrategy._apply(b, a, g)
  1155. };
  1156. b.prototype.setContainerStrategy = function(b) {
  1157. b instanceof a && (this._containerStrategy = b)
  1158. };
  1159. b.prototype.setContentStrategy = function(b) {
  1160. b instanceof g && (this._contentStrategy = b)
  1161. };
  1162. return b
  1163. }();
  1164. c.ResolutionPolicy = d;
  1165. var a = function() {
  1166. function a() {}
  1167. a.initialize = function() {
  1168. a.EQUAL_TO_FRAME = new b
  1169. };
  1170. a.prototype.init = function(b) {};
  1171. a.prototype._apply = function(b, a, g) {};
  1172. a.prototype._setupContainer = function() {
  1173. var b = document.body,
  1174. a;
  1175. 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")
  1176. };
  1177. return a
  1178. }();
  1179. c.ContainerStrategy = a;
  1180. var b = function(b) {
  1181. function a() {
  1182. b.apply(this,
  1183. arguments)
  1184. }
  1185. __extends(a, b);
  1186. a.prototype._apply = function(b) {
  1187. this._setupContainer()
  1188. };
  1189. return a
  1190. }(a);
  1191. c.EqualToFrame = b;
  1192. var g = function() {
  1193. function b() {}
  1194. b.prototype.init = function(b) {};
  1195. b.prototype._apply = function(b, a, g) {};
  1196. return b
  1197. }();
  1198. c.ContentStrategy = g;
  1199. d = function(b) {
  1200. function a() {
  1201. b.apply(this, arguments)
  1202. }
  1203. __extends(a, b);
  1204. a.prototype._apply = function(b, a, g) {
  1205. var c = document.getElementById(e.canvas_name),
  1206. d = document.getElementById(e.canvas_div_name),
  1207. l = c.height / g,
  1208. m = window.innerHeight,
  1209. l = m / g,
  1210. s = a * l;
  1211. c.width = a;
  1212. c.height = g;
  1213. c.style.width =
  1214. s + "px";
  1215. c.style.height = m + "px";
  1216. d.style.width = s + "px";
  1217. d.style.height = m + "px";
  1218. b._scaleX = l;
  1219. b._scaleY = l
  1220. };
  1221. return a
  1222. }(g);
  1223. c.FixedHeight = d;
  1224. d = function(b) {
  1225. function a() {
  1226. b.apply(this, arguments)
  1227. }
  1228. __extends(a, b);
  1229. a.prototype._apply = function(b, a, g) {
  1230. g = document.getElementById(e.canvas_name);
  1231. var c = document.getElementById(e.canvas_div_name),
  1232. d = document.documentElement.clientWidth,
  1233. l = document.documentElement.clientHeight,
  1234. m = d / a;
  1235. g.width = a;
  1236. g.height = l / m;
  1237. g.style.width = d + "px";
  1238. g.style.height = l + "px";
  1239. c.style.width = d + "px";
  1240. c.style.height =
  1241. l + "px";
  1242. b._scaleX = m;
  1243. b._scaleY = m
  1244. };
  1245. return a
  1246. }(g);
  1247. c.FixedWidth = d;
  1248. d = function(b) {
  1249. function a(g, c) {
  1250. b.call(this);
  1251. this.width = g;
  1252. this.height = c
  1253. }
  1254. __extends(a, b);
  1255. a.prototype._apply = function(b, a, g) {
  1256. g = document.getElementById(e.canvas_name);
  1257. var c = document.getElementById(e.canvas_div_name),
  1258. d = this.width,
  1259. l = this.height,
  1260. m = d / a;
  1261. g.width = a;
  1262. g.height = l / m;
  1263. g.style.width = d + "px";
  1264. g.style.height = l + "px";
  1265. c.style.width = d + "px";
  1266. c.style.height = l + "px";
  1267. b._scaleX = m;
  1268. b._scaleY = m
  1269. };
  1270. return a
  1271. }(g);
  1272. c.FixedSize = d;
  1273. d = function(b) {
  1274. function a(g, c) {
  1275. b.call(this);
  1276. this.width = g;
  1277. this.height = c
  1278. }
  1279. __extends(a, b);
  1280. a.prototype._apply = function(b, a, g) {
  1281. a = document.getElementById(e.canvas_name);
  1282. a.style.width = a.width + "px";
  1283. a.style.height = a.height + "px";
  1284. b._scaleX = 1;
  1285. b._scaleY = 1
  1286. };
  1287. return a
  1288. }(g);
  1289. c.NoScale = d
  1290. })(egret || (egret = {}));
  1291. __extends = this.__extends || function(c, e) {
  1292. function d() {
  1293. this.constructor = c
  1294. }
  1295. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1296. d.prototype = e.prototype;
  1297. c.prototype = new d
  1298. };
  1299. (function(c) {
  1300. var e = function(d) {
  1301. function a() {
  1302. d.call(this);
  1303. this._originalData = {};
  1304. this._drawAreaList = []
  1305. }
  1306. __extends(a, d);
  1307. a.getInstance = function() {
  1308. null == a.instance && (a.instance = new a);
  1309. return a.instance
  1310. };
  1311. a.prototype.addDrawArea = function(b) {
  1312. this._drawAreaList.push(b)
  1313. };
  1314. a.prototype.clearDrawArea = function() {
  1315. this._drawAreaList = []
  1316. };
  1317. a.prototype.drawImage = function(b, a, d, e, f, h, k, n, q, p) {
  1318. k = k || 0;
  1319. n = n || 0;
  1320. var r = a._texture_to_render;
  1321. if (null != r && 0 != h && 0 != f && 0 != q && 0 != p)
  1322. if (a._worldBounds) {
  1323. var s = this._originalData;
  1324. s.sourceX =
  1325. d;
  1326. s.sourceY = e;
  1327. s.sourceWidth = f;
  1328. s.sourceHeight = h;
  1329. s.destX = k;
  1330. s.destY = n;
  1331. s.destWidth = q;
  1332. s.destHeight = p;
  1333. for (var t = this.getDrawAreaList(), A = 0; A < t.length; A++) {
  1334. var w = t[A];
  1335. if (!this.ignoreRender(a, w, s.destX, s.destY)) {
  1336. if (0 != this._drawAreaList.length)
  1337. if (0 != a._worldTransform.b || 0 != a._worldTransform.c) {
  1338. if (a._worldBounds.x + s.destX < w.x || a._worldBounds.y + s.destY < w.y || a._worldBounds.x + a._worldBounds.width + s.destX > w.x + w.width || a._worldBounds.y + a._worldBounds.height + s.destY > w.y + w.height) {
  1339. c.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df");
  1340. break
  1341. }
  1342. } else {
  1343. var B = a._worldTransform.a,
  1344. C = a._worldTransform.d,
  1345. u;
  1346. a._worldBounds.x + s.destX < w.x && (u = (w.x - a._worldBounds.x) / B - s.destX, d += u / (q / f), f -= u / (q / f), q -= u, k += u);
  1347. a._worldBounds.y + s.destY < w.y && (u = (w.y - a._worldBounds.y) / C - s.destY, e += u / (p / h), h -= u / (p / h), p -= u, n += u);
  1348. a._worldBounds.x + a._worldBounds.width + s.destX > w.x + w.width && (u = (a._worldBounds.x + a._worldBounds.width - w.x - w.width) / B + s.destX, f -= u / (q / f), q -= u);
  1349. a._worldBounds.y + a._worldBounds.height + s.destY > w.y + w.height && (u = (a._worldBounds.y + a._worldBounds.height -
  1350. w.y - w.height) / C + s.destY, h -= u / (p / h), p -= u)
  1351. }
  1352. b.drawImage(r, d, e, f, h, k, n, q, p)
  1353. }
  1354. }
  1355. } else b.drawImage(r, d, e, f, h, k, n, q, p)
  1356. };
  1357. a.prototype.ignoreRender = function(b, a, c, d) {
  1358. var e = b._worldBounds;
  1359. c *= b._worldTransform.a;
  1360. d *= b._worldTransform.d;
  1361. 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
  1362. };
  1363. a.prototype.getDrawAreaList = function() {
  1364. var b;
  1365. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new c.Rectangle(0, 0, c.MainContext.instance.stage.stageWidth,
  1366. c.MainContext.instance.stage.stageHeight)]), b = this._defaultDrawAreaList) : b = this._drawAreaList;
  1367. return b
  1368. };
  1369. return a
  1370. }(c.HashObject);
  1371. c.RenderFilter = e
  1372. })(egret || (egret = {}));
  1373. (function(c) {
  1374. var e = function() {
  1375. function d() {}
  1376. d.mapClass = function(a, b, g) {
  1377. "undefined" === typeof g && (g = "");
  1378. a = this.getKey(a) + "#" + g;
  1379. this.mapClassDic[a] = b
  1380. };
  1381. d.getKey = function(a) {
  1382. return "string" == typeof a ? a : c.getQualifiedClassName(a)
  1383. };
  1384. d.mapValue = function(a, b, g) {
  1385. "undefined" === typeof g && (g = "");
  1386. a = this.getKey(a) + "#" + g;
  1387. this.mapValueDic[a] = b
  1388. };
  1389. d.hasMapRule = function(a, b) {
  1390. "undefined" === typeof b && (b = "");
  1391. var g = this.getKey(a) + "#" + b;
  1392. return this.mapValueDic[g] || this.mapClassDic[g] ? !0 : !1
  1393. };
  1394. d.getInstance = function(a, b) {
  1395. "undefined" ===
  1396. typeof b && (b = "");
  1397. var g = this.getKey(a) + "#" + b;
  1398. if (this.mapValueDic[g]) return this.mapValueDic[g];
  1399. var c = this.mapClassDic[g];
  1400. if (c) return c = new c, this.mapValueDic[g] = c, delete this.mapClassDic[g], c;
  1401. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + g + "\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");
  1402. };
  1403. d.mapClassDic = {};
  1404. d.mapValueDic = {};
  1405. return d
  1406. }();
  1407. c.Injector =
  1408. e
  1409. })(egret || (egret = {}));
  1410. __extends = this.__extends || function(c, e) {
  1411. function d() {
  1412. this.constructor = c
  1413. }
  1414. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1415. d.prototype = e.prototype;
  1416. c.prototype = new d
  1417. };
  1418. (function(c) {
  1419. var e = function(d) {
  1420. function a() {
  1421. d.call(this);
  1422. this._parent = null;
  1423. this._cacheAsBitmap = !1;
  1424. this._y = this._x = 0;
  1425. this._scaleY = this._scaleX = 1;
  1426. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1427. this.visible = !0;
  1428. this._rotation = 0;
  1429. this._alpha = 1;
  1430. this._skewY = this._skewX = 0;
  1431. this._hasHeightSet = this._hasWidthSet = !1;
  1432. this.worldAlpha = 1;
  1433. this._worldTransform = new c.Matrix;
  1434. this._cacheBounds = new c.Rectangle(0, 0, 0, 0)
  1435. }
  1436. __extends(a, d);
  1437. Object.defineProperty(a.prototype, "parent", {
  1438. get: function() {
  1439. return this._parent
  1440. },
  1441. enumerable: !0,
  1442. configurable: !0
  1443. });
  1444. a.prototype._parentChanged = function(b) {
  1445. this._parent = b
  1446. };
  1447. Object.defineProperty(a.prototype, "x", {
  1448. get: function() {
  1449. return this._x
  1450. },
  1451. set: function(b) {
  1452. c.NumberUtils.isNumber(b) && (this._x = b)
  1453. },
  1454. enumerable: !0,
  1455. configurable: !0
  1456. });
  1457. Object.defineProperty(a.prototype, "y", {
  1458. get: function() {
  1459. return this._y
  1460. },
  1461. set: function(b) {
  1462. c.NumberUtils.isNumber(b) && (this._y = b)
  1463. },
  1464. enumerable: !0,
  1465. configurable: !0
  1466. });
  1467. Object.defineProperty(a.prototype, "scaleX", {
  1468. get: function() {
  1469. return this._scaleX
  1470. },
  1471. set: function(b) {
  1472. c.NumberUtils.isNumber(b) &&
  1473. (this._scaleX = b)
  1474. },
  1475. enumerable: !0,
  1476. configurable: !0
  1477. });
  1478. Object.defineProperty(a.prototype, "scaleY", {
  1479. get: function() {
  1480. return this._scaleY
  1481. },
  1482. set: function(b) {
  1483. c.NumberUtils.isNumber(b) && (this._scaleY = b)
  1484. },
  1485. enumerable: !0,
  1486. configurable: !0
  1487. });
  1488. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1489. get: function() {
  1490. return this._anchorOffsetX
  1491. },
  1492. set: function(b) {
  1493. c.NumberUtils.isNumber(b) && (this._anchorOffsetX = b)
  1494. },
  1495. enumerable: !0,
  1496. configurable: !0
  1497. });
  1498. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1499. get: function() {
  1500. return this._anchorOffsetY
  1501. },
  1502. set: function(b) {
  1503. c.NumberUtils.isNumber(b) && (this._anchorOffsetY = b)
  1504. },
  1505. enumerable: !0,
  1506. configurable: !0
  1507. });
  1508. Object.defineProperty(a.prototype, "anchorX", {
  1509. get: function() {
  1510. return this._anchorX
  1511. },
  1512. set: function(b) {
  1513. c.NumberUtils.isNumber(b) && (this._anchorX = b)
  1514. },
  1515. enumerable: !0,
  1516. configurable: !0
  1517. });
  1518. Object.defineProperty(a.prototype, "anchorY", {
  1519. get: function() {
  1520. return this._anchorY
  1521. },
  1522. set: function(b) {
  1523. c.NumberUtils.isNumber(b) && (this._anchorY = b)
  1524. },
  1525. enumerable: !0,
  1526. configurable: !0
  1527. });
  1528. Object.defineProperty(a.prototype, "rotation", {
  1529. get: function() {
  1530. return this._rotation
  1531. },
  1532. set: function(b) {
  1533. c.NumberUtils.isNumber(b) && (this._rotation = b)
  1534. },
  1535. enumerable: !0,
  1536. configurable: !0
  1537. });
  1538. Object.defineProperty(a.prototype, "alpha", {
  1539. get: function() {
  1540. return this._alpha
  1541. },
  1542. set: function(b) {
  1543. c.NumberUtils.isNumber(b) && (this._alpha = b)
  1544. },
  1545. enumerable: !0,
  1546. configurable: !0
  1547. });
  1548. Object.defineProperty(a.prototype, "skewX", {
  1549. get: function() {
  1550. return this._skewX
  1551. },
  1552. set: function(b) {
  1553. c.NumberUtils.isNumber(b) && (this._skewX = b)
  1554. },
  1555. enumerable: !0,
  1556. configurable: !0
  1557. });
  1558. Object.defineProperty(a.prototype, "skewY", {
  1559. get: function() {
  1560. return this._skewY
  1561. },
  1562. set: function(b) {
  1563. c.NumberUtils.isNumber(b) && (this._skewY = b)
  1564. },
  1565. enumerable: !0,
  1566. configurable: !0
  1567. });
  1568. Object.defineProperty(a.prototype, "touchEnabled", {
  1569. get: function() {
  1570. return this._touchEnabled
  1571. },
  1572. set: function(b) {
  1573. this._touchEnabled = b
  1574. },
  1575. enumerable: !0,
  1576. configurable: !0
  1577. });
  1578. Object.defineProperty(a.prototype, "scrollRect", {
  1579. get: function() {
  1580. return this._scrollRect
  1581. },
  1582. set: function(b) {
  1583. this._scrollRect = b
  1584. },
  1585. enumerable: !0,
  1586. configurable: !0
  1587. });
  1588. Object.defineProperty(a.prototype, "measuredWidth", {
  1589. get: function() {
  1590. return this._measureBounds().width
  1591. },
  1592. enumerable: !0,
  1593. configurable: !0
  1594. });
  1595. Object.defineProperty(a.prototype, "measuredHeight", {
  1596. get: function() {
  1597. return this._measureBounds().height
  1598. },
  1599. enumerable: !0,
  1600. configurable: !0
  1601. });
  1602. Object.defineProperty(a.prototype, "explicitWidth", {
  1603. get: function() {
  1604. return this._explicitWidth
  1605. },
  1606. enumerable: !0,
  1607. configurable: !0
  1608. });
  1609. Object.defineProperty(a.prototype, "explicitHeight", {
  1610. get: function() {
  1611. return this._explicitHeight
  1612. },
  1613. enumerable: !0,
  1614. configurable: !0
  1615. });
  1616. Object.defineProperty(a.prototype, "width", {
  1617. get: function() {
  1618. return this.getBounds(c.Rectangle.identity).width
  1619. },
  1620. set: function(b) {
  1621. this._setWidth(b)
  1622. },
  1623. enumerable: !0,
  1624. configurable: !0
  1625. });
  1626. Object.defineProperty(a.prototype, "height", {
  1627. get: function() {
  1628. return this.getBounds(c.Rectangle.identity).height
  1629. },
  1630. set: function(b) {
  1631. this._setHeight(b)
  1632. },
  1633. enumerable: !0,
  1634. configurable: !0
  1635. });
  1636. a.prototype._setWidth = function(b) {
  1637. this._explicitWidth = b;
  1638. this._hasWidthSet = c.NumberUtils.isNumber(b)
  1639. };
  1640. a.prototype._setHeight = function(b) {
  1641. this._explicitHeight = b;
  1642. this._hasHeightSet = c.NumberUtils.isNumber(b)
  1643. };
  1644. a.prototype._draw = function(b) {
  1645. if (this.visible && !this.drawCacheTexture(b)) {
  1646. b.setAlpha(this.worldAlpha,
  1647. this.blendMode);
  1648. b.setTransform(this._worldTransform);
  1649. var a = this.mask || this._scrollRect;
  1650. a && b.pushMask(a);
  1651. this._render(b);
  1652. a && b.popMask()
  1653. }
  1654. this.destroyCacheBounds()
  1655. };
  1656. a.prototype.drawCacheTexture = function(b) {
  1657. if (this._cacheAsBitmap) {
  1658. var a = this._texture_to_render,
  1659. d = a._offsetX,
  1660. e = a._offsetY,
  1661. f = a._textureWidth,
  1662. a = a._textureHeight;
  1663. this._updateTransform();
  1664. b.setAlpha(this.worldAlpha, this.blendMode);
  1665. b.setTransform(this._worldTransform);
  1666. var h = c.MainContext.instance.rendererContext.texture_scale_factor;
  1667. c.RenderFilter.getInstance().drawImage(b,
  1668. this, 0, 0, f * h, a * h, d, e, f, a);
  1669. return !0
  1670. }
  1671. return !1
  1672. };
  1673. a.prototype._updateTransform = function() {
  1674. this._worldTransform.identity().appendMatrix(this._parent._worldTransform);
  1675. var b = this._getOffsetPoint();
  1676. this._worldTransform.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, b.x, b.y);
  1677. this._scrollRect && this._worldTransform.append(1, 0, 0, 1, -this._scrollRect.x, -this._scrollRect.y);
  1678. this.worldAlpha = this._parent.worldAlpha * this._alpha
  1679. };
  1680. a.prototype._render = function(b) {};
  1681. a.prototype.getBounds =
  1682. function(b) {
  1683. if (0 == this._cacheBounds.x && 0 == this._cacheBounds.y && 0 == this._cacheBounds.width && 0 == this._cacheBounds.height) {
  1684. var a = this._measureBounds(),
  1685. d = this._hasWidthSet ? this._explicitWidth : a.width,
  1686. e = this._hasHeightSet ? this._explicitHeight : a.height,
  1687. f = a.x,
  1688. a = a.y,
  1689. h, k;
  1690. 0 != this._anchorX || 0 != this._anchorY ? (h = d * this._anchorX, k = e * this._anchorY) : (h = this._anchorOffsetX, k = this._anchorOffsetY);
  1691. this._cacheBounds.initialize(f - h, a - k, d, e)
  1692. }
  1693. d = this._cacheBounds;
  1694. b || (b = new c.Rectangle);
  1695. return b.initialize(d.x, d.y, d.width,
  1696. d.height)
  1697. };
  1698. a.prototype.destroyCacheBounds = function() {
  1699. this._cacheBounds.x = 0;
  1700. this._cacheBounds.y = 0;
  1701. this._cacheBounds.width = 0;
  1702. this._cacheBounds.height = 0
  1703. };
  1704. a.prototype._getConcatenatedMatrix = function() {
  1705. for (var b = a.identityMatrixForGetConcatenated.identity(), g = this; null != g;) {
  1706. if (0 != g._anchorX || 0 != g._anchorY) {
  1707. var d = g._getSize(c.Rectangle.identity);
  1708. b.prependTransform(g._x, g._y, g._scaleX, g._scaleY, g._rotation, g._skewX, g._skewY, d.width * g._anchorX, d.height * g._anchorY)
  1709. } else b.prependTransform(g._x, g._y, g._scaleX,
  1710. g._scaleY, g._rotation, g._skewX, g._skewY, g._anchorOffsetX, g._anchorOffsetY);
  1711. g = g._parent
  1712. }
  1713. return b
  1714. };
  1715. a.prototype.localToGlobal = function(b, a, d) {
  1716. "undefined" === typeof b && (b = 0);
  1717. "undefined" === typeof a && (a = 0);
  1718. var e = this._getConcatenatedMatrix();
  1719. e.append(1, 0, 0, 1, b, a);
  1720. d || (d = new c.Point);
  1721. d.x = e.tx;
  1722. d.y = e.ty;
  1723. return d
  1724. };
  1725. a.prototype.globalToLocal = function(b, a, d) {
  1726. "undefined" === typeof b && (b = 0);
  1727. "undefined" === typeof a && (a = 0);
  1728. var e = this._getConcatenatedMatrix();
  1729. e.invert();
  1730. e.append(1, 0, 0, 1, b, a);
  1731. d || (d = new c.Point);
  1732. d.x = e.tx;
  1733. d.y = e.ty;
  1734. return d
  1735. };
  1736. a.prototype.hitTest = function(b, a, d) {
  1737. "undefined" === typeof d && (d = !1);
  1738. if (!this.visible || !d && !this._touchEnabled) return null;
  1739. d = this._getSize(c.Rectangle.identity);
  1740. 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
  1741. };
  1742. a.prototype.hitTestPoint = function(b, a, d) {
  1743. b = this.globalToLocal(b,
  1744. a);
  1745. 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)
  1746. };
  1747. a.prototype._getMatrix = function() {
  1748. var b = c.Matrix.identity.identity(),
  1749. a = this._getOffsetPoint();
  1750. b.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a.x, a.y);
  1751. return b
  1752. };
  1753. a.prototype._getSize =
  1754. function(b) {
  1755. return this._hasHeightSet && this._hasWidthSet ? b.initialize(NaN, NaN, this._explicitWidth, this._explicitHeight) : this._measureSize(c.Rectangle.identity)
  1756. };
  1757. a.prototype._measureSize = function(b) {
  1758. return this._measureBounds()
  1759. };
  1760. a.prototype._measureBounds = function() {
  1761. return c.Rectangle.identity.initialize(0, 0, 0, 0)
  1762. };
  1763. a.prototype._getOffsetPoint = function() {
  1764. var b = this._anchorOffsetX,
  1765. a = this._anchorOffsetY;
  1766. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(c.Rectangle.identity), b = this._anchorX * a.width,
  1767. a = this._anchorY * a.height;
  1768. var d = c.Point.identity;
  1769. d.x = b;
  1770. d.y = a;
  1771. return d
  1772. };
  1773. a.prototype._onAddToStage = function() {
  1774. this._stage = c.MainContext.instance.stage;
  1775. c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  1776. };
  1777. a.prototype._onRemoveFromStage = function() {
  1778. this._stage = null;
  1779. c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  1780. };
  1781. Object.defineProperty(a.prototype, "stage", {
  1782. get: function() {
  1783. return this._stage
  1784. },
  1785. enumerable: !0,
  1786. configurable: !0
  1787. });
  1788. a.prototype.addEventListener = function(b, g, l, e, f) {
  1789. "undefined" ===
  1790. typeof e && (e = !1);
  1791. "undefined" === typeof f && (f = 0);
  1792. d.prototype.addEventListener.call(this, b, g, l, e, f);
  1793. ((e = b == c.Event.ENTER_FRAME) || b == c.Event.RENDER) && this._insertEventBin(e ? a._enterFrameCallBackList : a._renderCallBackList, g, l, f)
  1794. };
  1795. a.prototype.removeEventListener = function(b, g, l, e) {
  1796. "undefined" === typeof e && (e = !1);
  1797. d.prototype.removeEventListener.call(this, b, g, l, e);
  1798. ((e = b == c.Event.ENTER_FRAME) || b == c.Event.RENDER) && this._removeEventBin(e ? a._enterFrameCallBackList : a._renderCallBackList, g, l)
  1799. };
  1800. a.prototype.dispatchEvent =
  1801. function(b) {
  1802. if (!b._bubbles) return d.prototype.dispatchEvent.call(this, b);
  1803. for (var a = [], c = this; c;) a.unshift(c), c = c.parent;
  1804. for (var e = a.length, c = e - 1, e = e - 2; 0 <= e; e--) a.push(a[e]);
  1805. b._reset();
  1806. this._dispatchPropagationEvent(b, a, c);
  1807. return !b.isDefaultPrevented()
  1808. };
  1809. a.prototype._dispatchPropagationEvent = function(b, a, c) {
  1810. for (var d = a.length, e = 0; e < d; e++) {
  1811. var h = a[e];
  1812. b._setCurrentTarget(h);
  1813. b._target = this;
  1814. b._eventPhase = e < c ? 1 : e == c ? 2 : 3;
  1815. h._notifyListener(b);
  1816. if (b._isPropagationStopped || b._isPropagationImmediateStopped) break
  1817. }
  1818. };
  1819. a.prototype.willTrigger = function(b) {
  1820. for (var a = this; a;) {
  1821. if (a.hasEventListener(b)) return !0;
  1822. a = a._parent
  1823. }
  1824. return !1
  1825. };
  1826. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  1827. get: function() {
  1828. return this._cacheAsBitmap
  1829. },
  1830. set: function(b) {
  1831. (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
  1832. },
  1833. enumerable: !0,
  1834. configurable: !0
  1835. });
  1836. a.getTransformBounds = function(b, a) {
  1837. var c, d, e = b.width,
  1838. h = b.height,
  1839. k = e * a.a,
  1840. e = e * a.b,
  1841. n = h * a.c,
  1842. h = h * a.d,
  1843. q = a.tx,
  1844. p = a.ty,
  1845. r = q,
  1846. s = q,
  1847. t = p,
  1848. A = p;
  1849. (c = k + q) < r ? r = c : c > s && (s = c);
  1850. (c = k + n + q) < r ? r = c : c > s && (s = c);
  1851. (c = n + q) < r ? r = c : c > s && (s = c);
  1852. (d = e + p) < t ? t = d : d > A && (A = d);
  1853. (d = e + h + p) < t ? t = d : d > A && (A = d);
  1854. (d = h + p) < t ? t = d : d > A && (A = d);
  1855. return b.initialize(r, t, s - r, A - t)
  1856. };
  1857. a.identityMatrixForGetConcatenated = new c.Matrix;
  1858. a._enterFrameCallBackList = [];
  1859. a._renderCallBackList = [];
  1860. return a
  1861. }(c.EventDispatcher);
  1862. c.DisplayObject = e
  1863. })(egret || (egret = {}));
  1864. __extends = this.__extends || function(c, e) {
  1865. function d() {
  1866. this.constructor = c
  1867. }
  1868. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1869. d.prototype = e.prototype;
  1870. c.prototype = new d
  1871. };
  1872. (function(c) {
  1873. var e = function(d) {
  1874. function a() {
  1875. d.call(this);
  1876. this._touchChildren = !0;
  1877. this._children = []
  1878. }
  1879. __extends(a, d);
  1880. Object.defineProperty(a.prototype, "touchChildren", {
  1881. get: function() {
  1882. return this._touchChildren
  1883. },
  1884. set: function(b) {
  1885. this._touchChildren = b
  1886. },
  1887. enumerable: !0,
  1888. configurable: !0
  1889. });
  1890. Object.defineProperty(a.prototype, "numChildren", {
  1891. get: function() {
  1892. return this._children.length
  1893. },
  1894. enumerable: !0,
  1895. configurable: !0
  1896. });
  1897. a.prototype.setChildIndex = function(b, a) {
  1898. this.doSetChildIndex(b, a)
  1899. };
  1900. a.prototype.doSetChildIndex = function(b,
  1901. a) {
  1902. var d = this._children.indexOf(b);
  1903. 0 > d && c.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  1904. this._children.splice(d, 1);
  1905. 0 > a || this._children.length <= a ? this._children.push(b) : this._children.splice(a, 0, b)
  1906. };
  1907. a.prototype.addChild = function(b) {
  1908. var a = this.numChildren;
  1909. b._parent == this && a--;
  1910. return this._doAddChild(b, a)
  1911. };
  1912. a.prototype.addChildAt = function(b, a) {
  1913. return this._doAddChild(b, a)
  1914. };
  1915. a.prototype._doAddChild = function(b, g, d) {
  1916. "undefined" === typeof d && (d = !0);
  1917. if (b == this) return b;
  1918. if (0 > g || g > this._children.length) return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  1919. b;
  1920. var e = b.parent;
  1921. if (e == this) return this.doSetChildIndex(b, g), b;
  1922. e && e.removeChild(b);
  1923. this._children.splice(g, 0, b);
  1924. b._parentChanged(this);
  1925. d && b.dispatchEventWith(c.Event.ADDED, !0);
  1926. if (this._stage)
  1927. for (b._onAddToStage(), g = a.__EVENT__ADD_TO_STAGE_LIST; 0 < g.length;) g.shift().dispatchEventWith(c.Event.ADDED_TO_STAGE);
  1928. return b
  1929. };
  1930. a.prototype.removeChild = function(b) {
  1931. b = this._children.indexOf(b);
  1932. if (0 <= b) return this._doRemoveChild(b);
  1933. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  1934. return null
  1935. };
  1936. a.prototype.removeChildAt =
  1937. function(b) {
  1938. if (0 <= b && b < this._children.length) return this._doRemoveChild(b);
  1939. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  1940. return null
  1941. };
  1942. a.prototype._doRemoveChild = function(b, g) {
  1943. "undefined" === typeof g && (g = !0);
  1944. var d = this._children,
  1945. e = d[b];
  1946. g && e.dispatchEventWith(c.Event.REMOVED, !0);
  1947. if (this._stage) {
  1948. e._onRemoveFromStage();
  1949. for (var f = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < f.length;) f.shift().dispatchEventWith(c.Event.REMOVED_FROM_STAGE)
  1950. }
  1951. e._parentChanged(null);
  1952. d.splice(b, 1);
  1953. return e
  1954. };
  1955. a.prototype.getChildAt = function(b) {
  1956. if (0 <= b && b < this._children.length) return this._children[b];
  1957. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  1958. return null
  1959. };
  1960. a.prototype.contains = function(b) {
  1961. for (; b;) {
  1962. if (b == this) return !0;
  1963. b = b._parent
  1964. }
  1965. return !1
  1966. };
  1967. a.prototype.swapChildrenAt = function(b, a) {
  1968. 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")
  1969. };
  1970. a.prototype.swapChildren = function(b,
  1971. a) {
  1972. var d = this._children.indexOf(b),
  1973. e = this._children.indexOf(a); - 1 == d || -1 == e ? c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(d, e)
  1974. };
  1975. a.prototype._swapChildrenAt = function(b, a) {
  1976. if (b != a) {
  1977. var c = this._children,
  1978. d = c[b];
  1979. c[b] = c[a];
  1980. c[a] = d
  1981. }
  1982. };
  1983. a.prototype.getChildIndex = function(b) {
  1984. return this._children.indexOf(b)
  1985. };
  1986. a.prototype.removeChildren = function() {
  1987. for (var b = this._children.length - 1; 0 <= b; b--) this._doRemoveChild(b)
  1988. };
  1989. a.prototype._updateTransform = function() {
  1990. if (this.visible) {
  1991. d.prototype._updateTransform.call(this);
  1992. for (var b = 0, a = this._children.length; b < a; b++) this._children[b]._updateTransform()
  1993. }
  1994. };
  1995. a.prototype._render = function(b) {
  1996. for (var a = 0, c = this._children.length; a < c; a++) this._children[a]._draw(b)
  1997. };
  1998. a.prototype._measureBounds = function() {
  1999. for (var b = 0, a = 0, d = 0, e = 0, f = this._children.length, h = 0; h < f; h++) {
  2000. var k = this._children[h],
  2001. n;
  2002. if (k.visible && (n = c.DisplayObject.getTransformBounds(k._getSize(c.Rectangle.identity), k._getMatrix()))) {
  2003. var k = n.x,
  2004. q = n.y,
  2005. p = n.width + n.x,
  2006. r = n.height + n.y;
  2007. if (k < b || 0 == h) b = k;
  2008. if (p > a || 0 == h) a = p;
  2009. if (q < d ||
  2010. 0 == h) d = q;
  2011. if (r > e || 0 == h) e = r
  2012. }
  2013. }
  2014. return c.Rectangle.identity.initialize(b, d, a - b, e - d)
  2015. };
  2016. a.prototype.hitTest = function(b, a, l) {
  2017. "undefined" === typeof l && (l = !1);
  2018. var e;
  2019. if (!this.visible) return null;
  2020. if (this._scrollRect) {
  2021. if (b > this._scrollRect.width || a > this._scrollRect.height) return null
  2022. } 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;
  2023. for (var f = this._children, h = this._touchChildren, k = f.length - 1; 0 <= k; k--) {
  2024. var n = f[k],
  2025. q = n,
  2026. p = q._getOffsetPoint(),
  2027. r = q._x,
  2028. s = q._y;
  2029. this._scrollRect && (r -= this._scrollRect.x, s -= this._scrollRect.y);
  2030. q = c.Matrix.identity.identity().prependTransform(r, s, q._scaleX, q._scaleY, q._rotation, 0, 0, p.x, p.y);
  2031. q.invert();
  2032. q = c.Matrix.transformCoords(q, b, a);
  2033. if (n = n.hitTest(q.x, q.y, !0)) {
  2034. if (n._touchEnabled && h) return n;
  2035. if (this._touchEnabled) return this;
  2036. null == e && (e = n)
  2037. }
  2038. }
  2039. return e ? e : d.prototype.hitTest.call(this, b, a, l)
  2040. };
  2041. a.prototype._onAddToStage = function() {
  2042. d.prototype._onAddToStage.call(this);
  2043. for (var b = this.numChildren, a = 0; a < b; a++) this._children[a]._onAddToStage()
  2044. };
  2045. a.prototype._onRemoveFromStage = function() {
  2046. d.prototype._onRemoveFromStage.call(this);
  2047. for (var b = this.numChildren, a = 0; a < b; a++) this._children[a]._onRemoveFromStage()
  2048. };
  2049. a.prototype.getChildByName = function(b) {
  2050. for (var a = this._children, c = this.numChildren, d, e = 0; e < c; e++)
  2051. if (d = a[e], d.name == b) return d;
  2052. return null
  2053. };
  2054. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2055. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2056. return a
  2057. }(c.DisplayObject);
  2058. c.DisplayObjectContainer = e
  2059. })(egret || (egret = {}));
  2060. __extends = this.__extends || function(c, e) {
  2061. function d() {
  2062. this.constructor = c
  2063. }
  2064. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2065. d.prototype = e.prototype;
  2066. c.prototype = new d
  2067. };
  2068. (function(c) {
  2069. var e = function(d) {
  2070. function a(b, a) {
  2071. d.call(this);
  2072. this.touchEnabled = !0;
  2073. this._stage = this;
  2074. this._stageWidth = b;
  2075. this._stageHeight = a
  2076. }
  2077. __extends(a, d);
  2078. a.prototype.invalidate = function() {
  2079. a._invalidateRenderFlag = !0
  2080. };
  2081. a.prototype._setStageSize = function(b, a) {
  2082. if (this._stageWidth != b || this._stageHeight != a) this._stageWidth = b, this._stageHeight = a, this.dispatchEventWith(c.Event.RESIZE)
  2083. };
  2084. Object.defineProperty(a.prototype, "stageWidth", {
  2085. get: function() {
  2086. return this._stageWidth
  2087. },
  2088. enumerable: !0,
  2089. configurable: !0
  2090. });
  2091. Object.defineProperty(a.prototype,
  2092. "stageHeight", {
  2093. get: function() {
  2094. return this._stageHeight
  2095. },
  2096. enumerable: !0,
  2097. configurable: !0
  2098. });
  2099. a.prototype.hitTest = function(b, a) {
  2100. if (!this.touchEnabled) return null;
  2101. var d;
  2102. if (!this.visible) return this;
  2103. for (var e = this._children, f = e.length - 1; 0 <= f; f--) {
  2104. var h = d = e[f],
  2105. k = h._getOffsetPoint(),
  2106. h = c.Matrix.identity.identity().prependTransform(h.x, h.y, h.scaleX, h.scaleY, h.rotation, 0, 0, k.x, k.y);
  2107. h.invert();
  2108. h = c.Matrix.transformCoords(h, b, a);
  2109. if ((d = d.hitTest(h.x, h.y, !0)) && d.touchEnabled) return d
  2110. }
  2111. return this
  2112. };
  2113. a.prototype.getBounds =
  2114. function(b) {
  2115. b || (b = new c.Rectangle);
  2116. return b.initialize(0, 0, this._stageWidth, this._stageHeight)
  2117. };
  2118. a.prototype._updateTransform = function() {
  2119. for (var b = 0, a = this._children.length; b < a; b++) this._children[b]._updateTransform()
  2120. };
  2121. a._invalidateRenderFlag = !1;
  2122. return a
  2123. }(c.DisplayObjectContainer);
  2124. c.Stage = e
  2125. })(egret || (egret = {}));
  2126. (function(c) {
  2127. var e = function() {
  2128. function c() {}
  2129. c.REPEAT = "repeat";
  2130. c.SCALE = "scale";
  2131. return c
  2132. }();
  2133. c.BitmapFillMode = e
  2134. })(egret || (egret = {}));
  2135. __extends = this.__extends || function(c, e) {
  2136. function d() {
  2137. this.constructor = c
  2138. }
  2139. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2140. d.prototype = e.prototype;
  2141. c.prototype = new d
  2142. };
  2143. (function(c) {
  2144. var e = function(d) {
  2145. function a(b) {
  2146. d.call(this);
  2147. this.debug = !1;
  2148. this.debugColor = 16711680;
  2149. this.fillMode = "scale";
  2150. b && (this.texture = b)
  2151. }
  2152. __extends(a, d);
  2153. a.prototype._render = function(b) {
  2154. var g = this.texture;
  2155. g ? (this._texture_to_render = g, a._drawBitmap(b, this._hasWidthSet ? this._explicitWidth : g._textureWidth, this._hasHeightSet ? this._explicitHeight : g._textureHeight, this)) : this._texture_to_render = null
  2156. };
  2157. a._drawBitmap = function(b, g, d, e) {
  2158. var f = e._texture_to_render;
  2159. if (f) {
  2160. var h = f._textureWidth,
  2161. k = f._textureHeight;
  2162. if ("scale" == e.fillMode) {
  2163. var n = e.scale9Grid;
  2164. if (n && h - n.width < g && k - n.height < d) a.drawScale9GridImage(b, e, e.scale9Grid, g, d);
  2165. else {
  2166. var n = f._offsetX,
  2167. q = f._offsetY,
  2168. p = f._bitmapWidth || h,
  2169. r = f._bitmapHeight || k;
  2170. e._hasWidthSet ? (g /= h, n = Math.round(n * g), g = Math.round(p * g)) : g = p;
  2171. e._hasHeightSet ? (d /= k, q = Math.round(q * d), d = Math.round(r * d)) : d = r;
  2172. c.RenderFilter.getInstance().drawImage(b, e, f._bitmapX, f._bitmapY, p, r, n, q, g, d)
  2173. }
  2174. } else a.drawRepeatImage(b, e, g, d)
  2175. }
  2176. };
  2177. a.drawRepeatImage = function(b, a, d, e) {
  2178. var f = a._texture_to_render;
  2179. if (f)
  2180. for (var h =
  2181. f._textureWidth, k = f._textureHeight, n = f._bitmapX, q = f._bitmapY, p = f._bitmapWidth || h, r = f._bitmapHeight || k, s = f._offsetX, f = f._offsetY, t = c.RenderFilter.getInstance(); s < d; s += h)
  2182. for (var A = f; A < e; A += k) {
  2183. var w = Math.min(p, d - s),
  2184. B = Math.min(r, e - A);
  2185. t.drawImage(b, a, n, q, p, r, s, A, w, B)
  2186. }
  2187. };
  2188. a.drawScale9GridImage = function(b, a, d, e, f) {
  2189. var h = a._texture_to_render;
  2190. if (h && d) {
  2191. var k = c.RenderFilter.getInstance(),
  2192. n = h._textureWidth,
  2193. q = h._textureHeight,
  2194. p = h._bitmapX,
  2195. r = h._bitmapY,
  2196. s = h._bitmapWidth || n,
  2197. t = h._bitmapHeight || q,
  2198. A = h._offsetX,
  2199. h = h._offsetY;
  2200. d = c.Rectangle.identity.initialize(d.x - Math.round(A), d.y - Math.round(A), d.width, d.height);
  2201. A = Math.round(A);
  2202. h = Math.round(h);
  2203. e -= n - s;
  2204. f -= q - t;
  2205. d.y == d.bottom && (d.bottom < t ? d.bottom++ : d.y--);
  2206. d.x == d.right && (d.right < s ? d.right++ : d.x--);
  2207. var n = p + d.x,
  2208. q = p + d.right,
  2209. w = s - d.right,
  2210. B = r + d.y,
  2211. C = r + d.bottom,
  2212. u = t - d.bottom,
  2213. v = A + d.x,
  2214. D = h + d.y,
  2215. t = f - (t - d.bottom),
  2216. s = e - (s - d.right);
  2217. k.drawImage(b, a, p, r, d.x, d.y, A, h, d.x, d.y);
  2218. k.drawImage(b, a, n, r, d.width, d.y, v, h, s - d.x, d.y);
  2219. k.drawImage(b, a, q, r, w, d.y, A + s, h, e - s, d.y);
  2220. k.drawImage(b, a, p, B, d.x, d.height,
  2221. A, D, d.x, t - d.y);
  2222. k.drawImage(b, a, n, B, d.width, d.height, v, D, s - d.x, t - d.y);
  2223. k.drawImage(b, a, q, B, w, d.height, A + s, D, e - s, t - d.y);
  2224. k.drawImage(b, a, p, C, d.x, u, A, h + t, d.x, f - t);
  2225. k.drawImage(b, a, n, C, d.width, u, v, h + t, s - d.x, f - t);
  2226. k.drawImage(b, a, q, C, w, u, A + s, h + t, e - s, f - t)
  2227. }
  2228. };
  2229. a.prototype._measureBounds = function() {
  2230. var b = this.texture;
  2231. return b ? c.Rectangle.identity.initialize(b._offsetX, b._offsetY, b._textureWidth, b._textureHeight) : d.prototype._measureBounds.call(this)
  2232. };
  2233. a.debug = !1;
  2234. return a
  2235. }(c.DisplayObject);
  2236. c.Bitmap = e
  2237. })(egret || (egret = {}));
  2238. __extends = this.__extends || function(c, e) {
  2239. function d() {
  2240. this.constructor = c
  2241. }
  2242. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2243. d.prototype = e.prototype;
  2244. c.prototype = new d
  2245. };
  2246. (function(c) {
  2247. var e = function(d) {
  2248. function a() {
  2249. d.call(this);
  2250. this.text = "";
  2251. this._bitmapPool = []
  2252. }
  2253. __extends(a, d);
  2254. a.prototype._updateTransform = function() {
  2255. this.visible && (this._renderText(), d.prototype._updateTransform.call(this))
  2256. };
  2257. a.prototype._renderText = function(b) {
  2258. "undefined" === typeof b && (b = !1);
  2259. var a = 0,
  2260. d = 0;
  2261. b || this.removeChildren();
  2262. for (var e = 0, f = this.text.length; e < f; e++) {
  2263. var h = this.text.charAt(e),
  2264. k = this.spriteSheet.getTexture(h);
  2265. if (null == k) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" +
  2266. h);
  2267. else {
  2268. var h = k._offsetX,
  2269. n = k._offsetY,
  2270. q = k._textureWidth;
  2271. if (!b) {
  2272. var p = this._bitmapPool[e];
  2273. p || (p = new c.Bitmap, this._bitmapPool.push(p));
  2274. p.texture = k;
  2275. this.addChild(p);
  2276. p.x = a
  2277. }
  2278. a += q + h;
  2279. n + k._textureHeight > d && (d = n + k._textureHeight)
  2280. }
  2281. }
  2282. return c.Rectangle.identity.initialize(0, 0, a, d)
  2283. };
  2284. a.prototype._measureBounds = function() {
  2285. return this._renderText(!0)
  2286. };
  2287. return a
  2288. }(c.DisplayObjectContainer);
  2289. c.BitmapText = e
  2290. })(egret || (egret = {}));
  2291. (function(c) {
  2292. var e = function() {
  2293. function c() {
  2294. this.commandQueue = []
  2295. }
  2296. c.prototype.beginFill = function(a, b) {};
  2297. c.prototype._setStyle = function(a) {};
  2298. c.prototype.drawRect = function(a, b, g, c) {};
  2299. c.prototype.drawCircle = function(a, b, g) {};
  2300. c.prototype.lineStyle = function(a, b, g, c, d, e, h, k) {};
  2301. c.prototype.lineTo = function(a, b) {};
  2302. c.prototype.curveTo = function(a, b, g, c) {};
  2303. c.prototype.moveTo = function(a, b) {};
  2304. c.prototype.clear = function() {};
  2305. c.prototype.endFill = function() {};
  2306. c.prototype._draw = function(a) {};
  2307. return c
  2308. }();
  2309. c.Graphics = e;
  2310. (function() {
  2311. return function(c, a, b) {
  2312. this.method = c;
  2313. this.thisObject = a;
  2314. this.args = b
  2315. }
  2316. })()
  2317. })(egret || (egret = {}));
  2318. __extends = this.__extends || function(c, e) {
  2319. function d() {
  2320. this.constructor = c
  2321. }
  2322. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2323. d.prototype = e.prototype;
  2324. c.prototype = new d
  2325. };
  2326. (function(c) {
  2327. var e = function(d) {
  2328. function a() {
  2329. d.call(this)
  2330. }
  2331. __extends(a, d);
  2332. Object.defineProperty(a.prototype, "graphics", {
  2333. get: function() {
  2334. this._graphics || (this._graphics = new c.Graphics);
  2335. return this._graphics
  2336. },
  2337. enumerable: !0,
  2338. configurable: !0
  2339. });
  2340. a.prototype._render = function(b) {
  2341. this._graphics && this._graphics._draw(b)
  2342. };
  2343. return a
  2344. }(c.DisplayObject);
  2345. c.Shape = e
  2346. })(egret || (egret = {}));
  2347. __extends = this.__extends || function(c, e) {
  2348. function d() {
  2349. this.constructor = c
  2350. }
  2351. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2352. d.prototype = e.prototype;
  2353. c.prototype = new d
  2354. };
  2355. (function(c) {
  2356. var e = function(d) {
  2357. function a() {
  2358. d.call(this)
  2359. }
  2360. __extends(a, d);
  2361. Object.defineProperty(a.prototype, "graphics", {
  2362. get: function() {
  2363. this._graphics || (this._graphics = new c.Graphics);
  2364. return this._graphics
  2365. },
  2366. enumerable: !0,
  2367. configurable: !0
  2368. });
  2369. a.prototype._render = function(b) {
  2370. this._graphics && this._graphics._draw(b);
  2371. d.prototype._render.call(this, b)
  2372. };
  2373. return a
  2374. }(c.DisplayObjectContainer);
  2375. c.Sprite = e
  2376. })(egret || (egret = {}));
  2377. __extends = this.__extends || function(c, e) {
  2378. function d() {
  2379. this.constructor = c
  2380. }
  2381. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2382. d.prototype = e.prototype;
  2383. c.prototype = new d
  2384. };
  2385. (function(c) {
  2386. var e = function(d) {
  2387. function a() {
  2388. d.call(this);
  2389. this._textDirty = !0;
  2390. this._fontFamily = "Arial";
  2391. this._size = 30;
  2392. this._textColorString = "#FFFFFF";
  2393. this._textColor = 16777215;
  2394. this._strokeColorString = "#000000";
  2395. this._stroke = this._strokeColor = 0;
  2396. this._textAlign = "left";
  2397. this._verticalAlign = "top";
  2398. this._numLines = this._lineSpacing = 0;
  2399. this.measuredWidths = []
  2400. }
  2401. __extends(a, d);
  2402. Object.defineProperty(a.prototype, "text", {
  2403. get: function() {
  2404. return this._text
  2405. },
  2406. set: function(b) {
  2407. this._text != b && (this._textDirty = !0, this._text = b)
  2408. },
  2409. enumerable: !0,
  2410. configurable: !0
  2411. });
  2412. Object.defineProperty(a.prototype, "fontFamily", {
  2413. get: function() {
  2414. return this._fontFamily
  2415. },
  2416. set: function(b) {
  2417. this._fontFamily != b && (this._textDirty = !0, this._fontFamily = b)
  2418. },
  2419. enumerable: !0,
  2420. configurable: !0
  2421. });
  2422. Object.defineProperty(a.prototype, "size", {
  2423. get: function() {
  2424. return this._size
  2425. },
  2426. set: function(b) {
  2427. this._size != b && (this._textDirty = !0, this._size = b)
  2428. },
  2429. enumerable: !0,
  2430. configurable: !0
  2431. });
  2432. Object.defineProperty(a.prototype, "italic", {
  2433. get: function() {
  2434. return this._italic
  2435. },
  2436. set: function(b) {
  2437. this._italic !=
  2438. b && (this._textDirty = !0, this._italic = b)
  2439. },
  2440. enumerable: !0,
  2441. configurable: !0
  2442. });
  2443. Object.defineProperty(a.prototype, "bold", {
  2444. get: function() {
  2445. return this._bold
  2446. },
  2447. set: function(b) {
  2448. this._bold != b && (this._textDirty = !0, this._bold = b)
  2449. },
  2450. enumerable: !0,
  2451. configurable: !0
  2452. });
  2453. Object.defineProperty(a.prototype, "textColor", {
  2454. get: function() {
  2455. return this._textColor
  2456. },
  2457. set: function(b) {
  2458. this._textColor != b && (this._textDirty = !0, this._textColor = b, this._textColorString = c.toColorString(b))
  2459. },
  2460. enumerable: !0,
  2461. configurable: !0
  2462. });
  2463. Object.defineProperty(a.prototype,
  2464. "strokeColor", {
  2465. get: function() {
  2466. return this._strokeColor
  2467. },
  2468. set: function(b) {
  2469. this._strokeColor != b && (this._textDirty = !0, this._strokeColor = b, this._strokeColorString = c.toColorString(b))
  2470. },
  2471. enumerable: !0,
  2472. configurable: !0
  2473. });
  2474. Object.defineProperty(a.prototype, "stroke", {
  2475. get: function() {
  2476. return this._stroke
  2477. },
  2478. set: function(b) {
  2479. this._stroke != b && (this._textDirty = !0, this._stroke = b)
  2480. },
  2481. enumerable: !0,
  2482. configurable: !0
  2483. });
  2484. Object.defineProperty(a.prototype, "textAlign", {
  2485. get: function() {
  2486. return this._textAlign
  2487. },
  2488. set: function(b) {
  2489. this._textAlign !=
  2490. b && (this._textDirty = !0, this._textAlign = b)
  2491. },
  2492. enumerable: !0,
  2493. configurable: !0
  2494. });
  2495. Object.defineProperty(a.prototype, "verticalAlign", {
  2496. get: function() {
  2497. return this._verticalAlign
  2498. },
  2499. set: function(b) {
  2500. this._verticalAlign != b && (this._textDirty = !0, this._verticalAlign = b)
  2501. },
  2502. enumerable: !0,
  2503. configurable: !0
  2504. });
  2505. Object.defineProperty(a.prototype, "lineSpacing", {
  2506. get: function() {
  2507. return this._lineSpacing
  2508. },
  2509. set: function(b) {
  2510. this._lineSpacing != b && (this._textDirty = !0, this._lineSpacing = b)
  2511. },
  2512. enumerable: !0,
  2513. configurable: !0
  2514. });
  2515. Object.defineProperty(a.prototype,
  2516. "numLines", {
  2517. get: function() {
  2518. return this._numLines
  2519. },
  2520. enumerable: !0,
  2521. configurable: !0
  2522. });
  2523. a.prototype._render = function(b) {
  2524. this.drawText(b, !1);
  2525. this._textDirty = !1
  2526. };
  2527. a.prototype._measureBounds = function() {
  2528. return this.drawText(c.MainContext.instance.rendererContext, !0)
  2529. };
  2530. a.prototype.drawText = function(b, a) {
  2531. var d = this.getTextLines(b);
  2532. if (!d) return c.Rectangle.identity.initialize(0, 0, 0, 0);
  2533. var e = d.length,
  2534. f = 0.5 * this._size,
  2535. h = this._size + this._lineSpacing,
  2536. k = e * h - this._lineSpacing;
  2537. this._textHeight = k;
  2538. var n = this._explicitHeight;
  2539. if (this._hasHeightSet && k < n) {
  2540. var q = 0;
  2541. this._verticalAlign == c.VerticalAlign.MIDDLE ? q = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (q = 1);
  2542. f += q * (n - k)
  2543. } else n = Number.POSITIVE_INFINITY;
  2544. var q = f = Math.round(f),
  2545. p = 0;
  2546. this._textAlign == c.HorizontalAlign.CENTER ? p = 0.5 : this._textAlign == c.HorizontalAlign.RIGHT && (p = 1);
  2547. var r = this.measuredWidths,
  2548. s;
  2549. s = this._hasWidthSet ? this._explicitWidth : this._textWidth;
  2550. for (var t = Number.POSITIVE_INFINITY, A = 0; A < e; A++) {
  2551. var w = d[A],
  2552. B = Math.round((s - r[A]) * p);
  2553. B < t && (t = B);
  2554. !a && f < n && b.drawText(this,
  2555. w, B, f, s);
  2556. f += h
  2557. }
  2558. return c.Rectangle.identity.initialize(t, q, s, k)
  2559. };
  2560. a.prototype.getTextLines = function(b) {
  2561. var a = this.text ? this.text.toString() : "";
  2562. if (!a) return null;
  2563. var c = this.measuredWidths;
  2564. c.length = 0;
  2565. b.setupFont(this);
  2566. var a = a.split(/(?:\r\n|\r|\n)/),
  2567. d = a.length,
  2568. e = 0;
  2569. if (this._hasWidthSet)
  2570. for (var h = this._explicitWidth, k = 0; k < d; k++) {
  2571. var n = a[k],
  2572. q = b.measureText(n);
  2573. if (q > h) {
  2574. for (var p = "", r = 0, s = n.length, t = 0; t < s; t++) {
  2575. var A = n.charAt(t),
  2576. q = b.measureText(A);
  2577. r + q > h && (0 == r ? (a.splice(k, 0, A), c[k] = q, e < q && (e = q), q = 0, A = "") : (a.splice(k,
  2578. 0, p), c[k] = r, e < r && (e = r), p = "", r = 0), k++, d++);
  2579. r += q;
  2580. p += A
  2581. }
  2582. a[k] = p;
  2583. c[k] = r
  2584. } else c[k] = q, e < q && (e = q)
  2585. } else
  2586. for (k = 0; k < d; k++) n = a[k], q = b.measureText(n), c[k] = q, e < q && (e = q);
  2587. this._textWidth = e;
  2588. return a
  2589. };
  2590. return a
  2591. }(c.DisplayObject);
  2592. c.TextField = e
  2593. })(egret || (egret = {}));
  2594. (function(c) {
  2595. var e = function() {
  2596. function c() {}
  2597. c.DYNAMIC = "dynamic";
  2598. c.INPUT = "input";
  2599. return c
  2600. }();
  2601. c.TextFieldType = e
  2602. })(egret || (egret = {}));
  2603. __extends = this.__extends || function(c, e) {
  2604. function d() {
  2605. this.constructor = c
  2606. }
  2607. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2608. d.prototype = e.prototype;
  2609. c.prototype = new d
  2610. };
  2611. (function(c) {
  2612. var e = function(d) {
  2613. function a(b) {
  2614. d.call(this);
  2615. var a = b.bitmapData;
  2616. this.bitmapData = a;
  2617. this._textureMap = {};
  2618. this._sourceWidth = a.width;
  2619. this._sourceHeight = a.height;
  2620. this._bitmapX = b._bitmapX;
  2621. this._bitmapY = b._bitmapY
  2622. }
  2623. __extends(a, d);
  2624. a.prototype.getTexture = function(b) {
  2625. return this._textureMap[b]
  2626. };
  2627. a.prototype.createTexture = function(b, a, d, e, f, h, k, n, q) {
  2628. "undefined" === typeof h && (h = 0);
  2629. "undefined" === typeof k && (k = 0);
  2630. "undefined" === typeof n && (n = h + e);
  2631. "undefined" === typeof q && (q = k + f);
  2632. var p = new c.Texture;
  2633. p._bitmapData =
  2634. this.bitmapData;
  2635. p._bitmapX = this._bitmapX + a;
  2636. p._bitmapY = this._bitmapY + d;
  2637. p._bitmapWidth = e;
  2638. p._bitmapHeight = f;
  2639. p._offsetX = h;
  2640. p._offsetY = k;
  2641. p._textureWidth = n;
  2642. p._textureHeight = q;
  2643. p._sourceWidth = this._sourceWidth;
  2644. p._sourceHeight = this._sourceHeight;
  2645. return this._textureMap[b] = p
  2646. };
  2647. return a
  2648. }(c.HashObject);
  2649. c.SpriteSheet = e
  2650. })(egret || (egret = {}));
  2651. __extends = this.__extends || function(c, e) {
  2652. function d() {
  2653. this.constructor = c
  2654. }
  2655. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2656. d.prototype = e.prototype;
  2657. c.prototype = new d
  2658. };
  2659. (function(c) {
  2660. var e = function(d) {
  2661. function a() {
  2662. d.apply(this, arguments);
  2663. this._placeholderText = "";
  2664. this._edFontSize = 14;
  2665. this._textColor = 16711680;
  2666. this._placeholderFontSize = 14;
  2667. this._placeholderColor = 16776960;
  2668. this._preY = this._preX = 0
  2669. }
  2670. __extends(a, d);
  2671. a.prototype._onAddToStage = function() {
  2672. d.prototype._onAddToStage.call(this);
  2673. var b = this.localToGlobal(),
  2674. a = new c.StageText;
  2675. a._open(b.x, b.y, this._explicitWidth, this._explicitHeight);
  2676. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
  2677. this.stageText =
  2678. a
  2679. };
  2680. a.prototype.setText = function(b) {
  2681. this.stageText._setText(b)
  2682. };
  2683. a.prototype.getText = function() {
  2684. return this.stageText._getText()
  2685. };
  2686. a.prototype.setTextType = function(b) {
  2687. this.stageText._setTextType(b)
  2688. };
  2689. a.prototype.getTextType = function() {
  2690. return this.stageText._getTextType()
  2691. };
  2692. a.prototype.onMouseDownHandler = function(b) {};
  2693. a.prototype._onRemoveFromStage = function() {
  2694. this.stageText._remove()
  2695. };
  2696. a.prototype._measureBounds = function() {
  2697. return c.Rectangle.identity
  2698. };
  2699. a.prototype.hitTest = function(b, a, c) {
  2700. return null
  2701. };
  2702. return a
  2703. }(c.DisplayObject);
  2704. c.TextInput = e;
  2705. e = function() {
  2706. function c() {}
  2707. c.prototype.editBoxEditingDidBegin = function(a) {};
  2708. c.prototype.editBoxEditingDidEnd = function(a) {};
  2709. c.prototype.editBoxTextChanged = function(a, b) {};
  2710. c.prototype.editBoxReturn = function(a) {};
  2711. return c
  2712. }();
  2713. c.TextInputDegelete = e
  2714. })(egret || (egret = {}));
  2715. __extends = this.__extends || function(c, e) {
  2716. function d() {
  2717. this.constructor = c
  2718. }
  2719. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2720. d.prototype = e.prototype;
  2721. c.prototype = new d
  2722. };
  2723. (function(c) {
  2724. var e = function(c) {
  2725. function a(b, a) {
  2726. c.call(this, b);
  2727. this.charList = this.parseConfig(a)
  2728. }
  2729. __extends(a, c);
  2730. a.prototype.getTexture = function(b) {
  2731. var a = this._textureMap[b];
  2732. if (!a) {
  2733. a = this.charList[b];
  2734. if (!a) return null;
  2735. a = this.createTexture(b, a.x, a.y, a.width, a.height, a.offsetX, a.offsetY);
  2736. this._textureMap[b] = a
  2737. }
  2738. return a
  2739. };
  2740. a.prototype.parseConfig = function(b) {
  2741. b = b.split("\r\n").join("\n");
  2742. b = b.split("\n");
  2743. for (var a = this.getConfigByKey(b[3], "count"), c = {}, d = 4; d < 4 + a; d++) {
  2744. var e = b[d],
  2745. h = String.fromCharCode(this.getConfigByKey(e,
  2746. "id")),
  2747. k = {};
  2748. c[h] = k;
  2749. k.x = this.getConfigByKey(e, "x");
  2750. k.y = this.getConfigByKey(e, "y");
  2751. k.width = this.getConfigByKey(e, "width");
  2752. k.height = this.getConfigByKey(e, "height");
  2753. k.offsetX = this.getConfigByKey(e, "xoffset");
  2754. k.offsetY = this.getConfigByKey(e, "yoffset")
  2755. }
  2756. return c
  2757. };
  2758. a.prototype.getConfigByKey = function(b, a) {
  2759. for (var c = b.split(" "), d = 0, e = c.length; d < e; d++) {
  2760. var h = c[d];
  2761. if (a == h.substring(0, a.length)) return c = h.substring(a.length + 1), parseInt(c)
  2762. }
  2763. return 0
  2764. };
  2765. return a
  2766. }(c.SpriteSheet);
  2767. c.BitmapTextSpriteSheet = e
  2768. })(egret ||
  2769. (egret = {}));
  2770. __extends = this.__extends || function(c, e) {
  2771. function d() {
  2772. this.constructor = c
  2773. }
  2774. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2775. d.prototype = e.prototype;
  2776. c.prototype = new d
  2777. };
  2778. (function(c) {
  2779. var e = function(a) {
  2780. function b(b, l) {
  2781. a.call(this);
  2782. this.frameRate = 60;
  2783. null != l && l 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, l)) : this.delegate = b;
  2784. this.delegate.setMovieClip(this)
  2785. }
  2786. __extends(b, a);
  2787. b.prototype.gotoAndPlay = function(b) {
  2788. this.delegate.gotoAndPlay(b)
  2789. };
  2790. b.prototype.gotoAndStop = function(b) {
  2791. this.delegate.gotoAndStop(b)
  2792. };
  2793. b.prototype.stop = function() {
  2794. this.delegate.stop()
  2795. };
  2796. b.prototype.dispose = function() {
  2797. this.delegate.dispose()
  2798. };
  2799. b.prototype.release = function() {
  2800. c.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2801. this.dispose()
  2802. };
  2803. b.prototype.getCurrentFrameIndex = function() {
  2804. c.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2805. return this.delegate._currentFrameIndex
  2806. };
  2807. b.prototype.getTotalFrame = function() {
  2808. c.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2809. return this.delegate._totalFrame
  2810. };
  2811. b.prototype.setInterval = function(b) {
  2812. c.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  2813. this.frameRate = 60 / b
  2814. };
  2815. b.prototype.getIsPlaying = function() {
  2816. c.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2817. return this.delegate.isPlaying
  2818. };
  2819. return b
  2820. }(c.DisplayObjectContainer);
  2821. c.MovieClip = e;
  2822. var d = function() {
  2823. function a(b, a) {
  2824. this.data = b;
  2825. this._currentFrameIndex = this._passTime = this._totalFrame =
  2826. 0;
  2827. this._isPlaying = !1;
  2828. this._frameData = b;
  2829. this._spriteSheet = new c.SpriteSheet(a)
  2830. }
  2831. a.prototype.setMovieClip = function(b) {
  2832. this.movieClip = b;
  2833. this.bitmap = new c.Bitmap;
  2834. this.movieClip.addChild(this.bitmap)
  2835. };
  2836. a.prototype.gotoAndPlay = function(b) {
  2837. this.checkHasFrame(b);
  2838. this._isPlaying = !0;
  2839. this._currentFrameIndex = 0;
  2840. this._currentFrameName = b;
  2841. this.playNextFrame();
  2842. this._passTime = 0;
  2843. c.Ticker.getInstance().register(this.update, this);
  2844. this._totalFrame = this._frameData.frames[b].totalFrame
  2845. };
  2846. a.prototype.gotoAndStop = function(b) {
  2847. this.checkHasFrame(b);
  2848. this.stop();
  2849. this._currentFrameIndex = this._passTime = 0;
  2850. this._currentFrameName = b;
  2851. this._totalFrame = this._frameData.frames[b].totalFrame;
  2852. this.playNextFrame()
  2853. };
  2854. a.prototype.stop = function() {
  2855. this._isPlaying = !1;
  2856. c.Ticker.getInstance().unregister(this.update, this)
  2857. };
  2858. a.prototype.dispose = function() {};
  2859. a.prototype.checkHasFrame = function(b) {
  2860. void 0 == this._frameData.frames[b] && c.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", b)
  2861. };
  2862. a.prototype.update = function(b) {
  2863. for (var a = 1E3 / this.movieClip.frameRate,
  2864. a = Math.floor((this._passTime % a + b) / a); 1 <= a;) 1 == a ? this.playNextFrame() : this.playNextFrame(!1), a--;
  2865. this._passTime += b
  2866. };
  2867. a.prototype.playNextFrame = function(b) {
  2868. "undefined" === typeof b && (b = !0);
  2869. var a = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  2870. if (b) {
  2871. b = this.getTexture(a.res);
  2872. var c = this.bitmap;
  2873. c.x = a.x;
  2874. c.y = a.y;
  2875. c.texture = b
  2876. }
  2877. null != a.action && this.movieClip.dispatchEventWith(a.action);
  2878. this._currentFrameIndex++;
  2879. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex =
  2880. 0)
  2881. };
  2882. a.prototype.getTexture = function(b) {
  2883. var a = this._frameData.res[b],
  2884. c = this._spriteSheet.getTexture(b);
  2885. c || (c = this._spriteSheet.createTexture(b, a.x, a.y, a.w, a.h));
  2886. return c
  2887. };
  2888. return a
  2889. }();
  2890. c.DefaultMovieClipDelegate = d
  2891. })(egret || (egret = {}));
  2892. __extends = this.__extends || function(c, e) {
  2893. function d() {
  2894. this.constructor = c
  2895. }
  2896. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2897. d.prototype = e.prototype;
  2898. c.prototype = new d
  2899. };
  2900. (function(c) {
  2901. var e = function(d) {
  2902. function a() {
  2903. d.call(this)
  2904. }
  2905. __extends(a, d);
  2906. a.prototype._getText = function() {
  2907. return this.inputElement.value
  2908. };
  2909. a.prototype._setText = function(b) {
  2910. this.inputElement.value = b
  2911. };
  2912. a.prototype._setTextType = function(b) {
  2913. this.inputElement.type = b
  2914. };
  2915. a.prototype._getTextType = function() {
  2916. return this.inputElement.type
  2917. };
  2918. a.prototype._open = function(b, a, d, e) {
  2919. "undefined" === typeof d && (d = 160);
  2920. "undefined" === typeof e && (e = 21);
  2921. var f = c.StageDelegate.getInstance().getScaleX(),
  2922. h = c.StageDelegate.getInstance().getScaleY(),
  2923. k = document.createElement("input");
  2924. k.type = "text";
  2925. k.style.fontSize = "20px";
  2926. k.style.color = "#FFFFFF";
  2927. k.style.borderStyle = "none";
  2928. k.style.background = "none";
  2929. k.style.width = d * f + "px";
  2930. k.style.height = e * h + "px";
  2931. k.style.outline = "medium";
  2932. var n = c.Browser.getInstance().$new("div");
  2933. n.style.position = "absolute";
  2934. n.position.x = b * f;
  2935. n.style.width = d * f + "px";
  2936. n.style.height = e * h + "px";
  2937. n.position.y = a * h;
  2938. n.transforms();
  2939. n.appendChild(k);
  2940. b = c.Browser.getInstance().$("#StageDelegateDiv");
  2941. b || (d = document.getElementById(c.StageDelegate.canvas_div_name),
  2942. 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());
  2943. b.appendChild(n);
  2944. this.div = n;
  2945. this.inputElement = k
  2946. };
  2947. a.prototype._remove = function() {
  2948. var b = this.div;
  2949. b && b.parentNode && b.parentNode.removeChild(b)
  2950. };
  2951. return a
  2952. }(c.HashObject);
  2953. c.StageText = e
  2954. })(egret || (egret = {}));
  2955. (function(c) {
  2956. var e = function() {
  2957. function c() {}
  2958. c.GET = "GET";
  2959. c.POST = "POST";
  2960. return c
  2961. }();
  2962. c.URLRequestMethod = e
  2963. })(egret || (egret = {}));
  2964. (function(c) {
  2965. var e = function() {
  2966. function c() {}
  2967. c.BINARY = "binary";
  2968. c.TEXT = "text";
  2969. c.VARIABLES = "variables";
  2970. c.TEXTURE = "texture";
  2971. c.SOUND = "sound";
  2972. return c
  2973. }();
  2974. c.URLLoaderDataFormat = e
  2975. })(egret || (egret = {}));
  2976. __extends = this.__extends || function(c, e) {
  2977. function d() {
  2978. this.constructor = c
  2979. }
  2980. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2981. d.prototype = e.prototype;
  2982. c.prototype = new d
  2983. };
  2984. (function(c) {
  2985. var e = function(c) {
  2986. function a(b) {
  2987. "undefined" === typeof b && (b = null);
  2988. c.call(this);
  2989. null !== b && this.decode(b)
  2990. }
  2991. __extends(a, c);
  2992. a.prototype.decode = function(b) {
  2993. this.variables || (this.variables = {});
  2994. b = b.split("+").join(" ");
  2995. for (var a, c = /[?&]?([^=]+)=([^&]*)/g; a = c.exec(b);) this.variables[decodeURIComponent(a[1])] = decodeURIComponent(a[2])
  2996. };
  2997. a.prototype.toString = function() {
  2998. if (!this.variables) return "";
  2999. var b = this.variables,
  3000. a = "",
  3001. c = !0,
  3002. d;
  3003. for (d in b) c ? c = !1 : a += "&", a += d + "=" + b[d];
  3004. return a
  3005. };
  3006. return a
  3007. }(c.HashObject);
  3008. c.URLVariables = e
  3009. })(egret || (egret = {}));
  3010. __extends = this.__extends || function(c, e) {
  3011. function d() {
  3012. this.constructor = c
  3013. }
  3014. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3015. d.prototype = e.prototype;
  3016. c.prototype = new d
  3017. };
  3018. (function(c) {
  3019. var e = function(d) {
  3020. function a(b) {
  3021. "undefined" === typeof b && (b = null);
  3022. d.call(this);
  3023. this.method = c.URLRequestMethod.GET;
  3024. this.url = b
  3025. }
  3026. __extends(a, d);
  3027. return a
  3028. }(c.HashObject);
  3029. c.URLRequest = e
  3030. })(egret || (egret = {}));
  3031. __extends = this.__extends || function(c, e) {
  3032. function d() {
  3033. this.constructor = c
  3034. }
  3035. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3036. d.prototype = e.prototype;
  3037. c.prototype = new d
  3038. };
  3039. (function(c) {
  3040. var e = function(d) {
  3041. function a(b) {
  3042. "undefined" === typeof b && (b = null);
  3043. d.call(this);
  3044. this.dataFormat = c.URLLoaderDataFormat.TEXT;
  3045. b && this.load(b)
  3046. }
  3047. __extends(a, d);
  3048. a.prototype.load = function(b) {
  3049. this._request = b;
  3050. this.data = null;
  3051. c.MainContext.instance.netContext.proceed(this)
  3052. };
  3053. return a
  3054. }(c.EventDispatcher);
  3055. c.URLLoader = e
  3056. })(egret || (egret = {}));
  3057. __extends = this.__extends || function(c, e) {
  3058. function d() {
  3059. this.constructor = c
  3060. }
  3061. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3062. d.prototype = e.prototype;
  3063. c.prototype = new d
  3064. };
  3065. (function(c) {
  3066. var e = function(d) {
  3067. function a() {
  3068. d.call(this);
  3069. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  3070. }
  3071. __extends(a, d);
  3072. Object.defineProperty(a.prototype, "textureWidth", {
  3073. get: function() {
  3074. return this._textureWidth
  3075. },
  3076. enumerable: !0,
  3077. configurable: !0
  3078. });
  3079. Object.defineProperty(a.prototype, "textureHeight", {
  3080. get: function() {
  3081. return this._textureHeight
  3082. },
  3083. enumerable: !0,
  3084. configurable: !0
  3085. });
  3086. Object.defineProperty(a.prototype, "bitmapData", {
  3087. get: function() {
  3088. return this._bitmapData
  3089. },
  3090. enumerable: !0,
  3091. configurable: !0
  3092. });
  3093. a.prototype._setBitmapData = function(b) {
  3094. var a = c.MainContext.instance.rendererContext.texture_scale_factor;
  3095. this._bitmapData = b;
  3096. this._sourceWidth = b.width;
  3097. this._sourceHeight = b.height;
  3098. this._textureWidth = this._sourceWidth * a;
  3099. this._textureHeight = this._sourceHeight * a;
  3100. this._bitmapWidth = this._textureWidth;
  3101. this._bitmapHeight = this._textureHeight;
  3102. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  3103. };
  3104. a.prototype.getPixel32 = function(b, a) {
  3105. return this._bitmapData.getContext("2d").getImageData(b,
  3106. a, 1, 1).data
  3107. };
  3108. return a
  3109. }(c.HashObject);
  3110. c.Texture = e
  3111. })(egret || (egret = {}));
  3112. __extends = this.__extends || function(c, e) {
  3113. function d() {
  3114. this.constructor = c
  3115. }
  3116. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3117. d.prototype = e.prototype;
  3118. c.prototype = new d
  3119. };
  3120. (function(c) {
  3121. var e = function(d) {
  3122. function a() {
  3123. d.call(this);
  3124. this._bitmapData = document.createElement("canvas");
  3125. this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
  3126. }
  3127. __extends(a, d);
  3128. a.prototype.drawToTexture = function(b) {
  3129. var a = this._bitmapData,
  3130. d = b.getBounds(c.Rectangle.identity);
  3131. a.width = d.width;
  3132. a.height = d.height;
  3133. b._worldTransform.identity();
  3134. b.worldAlpha = 1;
  3135. if (b instanceof c.DisplayObjectContainer) {
  3136. this._offsetX = d.x;
  3137. this._offsetY = d.y;
  3138. b._worldTransform.append(1, 0, 0, 1, -d.x, -d.y);
  3139. for (var a =
  3140. b._children, d = 0, e = a.length; d < e; d++) a[d]._updateTransform()
  3141. }
  3142. a = c.RenderFilter.getInstance();
  3143. d = a._drawAreaList.concat();
  3144. a._drawAreaList.length = 0;
  3145. this.renderContext.clearScreen();
  3146. this.webGLTexture = null;
  3147. (e = b.mask || b._scrollRect) && this.renderContext.pushMask(e);
  3148. b._render(this.renderContext);
  3149. e && this.renderContext.popMask();
  3150. a._drawAreaList = d;
  3151. this._textureWidth = this._bitmapData.width;
  3152. this._textureHeight = this._bitmapData.height;
  3153. this._sourceWidth = this._textureWidth;
  3154. this._sourceHeight = this._textureHeight
  3155. };
  3156. return a
  3157. }(c.Texture);
  3158. c.RenderTexture = e
  3159. })(egret || (egret = {}));
  3160. __extends = this.__extends || function(c, e) {
  3161. function d() {
  3162. this.constructor = c
  3163. }
  3164. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3165. d.prototype = e.prototype;
  3166. c.prototype = new d
  3167. };
  3168. (function(c) {
  3169. var e = function(d) {
  3170. function a() {
  3171. d.call(this);
  3172. this.renderCost = 0;
  3173. this.texture_scale_factor = 1
  3174. }
  3175. __extends(a, d);
  3176. a.prototype.clearScreen = function() {};
  3177. a.prototype.clearRect = function(b, a, c, d) {};
  3178. a.prototype.drawImage = function(b, a, d, e, f, h, k, n, q) {
  3179. c.Profiler.getInstance().onDrawImage()
  3180. };
  3181. a.prototype.setTransform = function(b) {};
  3182. a.prototype.setAlpha = function(b, a) {};
  3183. a.prototype.setupFont = function(b) {};
  3184. a.prototype.measureText = function(b) {
  3185. return 0
  3186. };
  3187. a.prototype.drawText = function(b, a, d, e, f) {
  3188. c.Profiler.getInstance().onDrawImage()
  3189. };
  3190. a.prototype.strokeRect = function(b, a, c, d, e) {};
  3191. a.prototype.pushMask = function(b) {};
  3192. a.prototype.popMask = function() {};
  3193. a.createRendererContext = function(b) {
  3194. return null
  3195. };
  3196. return a
  3197. }(c.HashObject);
  3198. c.RendererContext = e;
  3199. e = function() {
  3200. function d(a) {
  3201. this.type = a;
  3202. switch (a) {
  3203. case "add":
  3204. case "layer":
  3205. this.value = "lighter";
  3206. break;
  3207. default:
  3208. this.value = "source-over"
  3209. }
  3210. }
  3211. d.getBlendMode = function(a) {
  3212. return a ? c.BlendMode[a.toUpperCase()] : c.BlendMode.NORMAL
  3213. };
  3214. d.NORMAL = new d("normal");
  3215. d.ADD = new d("add");
  3216. d.LAYER = new d("layer");
  3217. return d
  3218. }();
  3219. c.BlendMode = e
  3220. })(egret || (egret = {}));
  3221. (function(c) {
  3222. var e = function() {
  3223. function c() {}
  3224. c.MOUSE = "mouse";
  3225. c.TOUCH = "touch";
  3226. c.mode = "touch";
  3227. return c
  3228. }();
  3229. c.InteractionMode = e
  3230. })(egret || (egret = {}));
  3231. __extends = this.__extends || function(c, e) {
  3232. function d() {
  3233. this.constructor = c
  3234. }
  3235. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3236. d.prototype = e.prototype;
  3237. c.prototype = new d
  3238. };
  3239. (function(c) {
  3240. var e = function(d) {
  3241. function a() {
  3242. d.call(this);
  3243. this._currentTouchTarget = {};
  3244. this.maxTouches = 2;
  3245. this.touchDownTarget = {};
  3246. this.lastTouchY = this.lastTouchX = -1
  3247. }
  3248. __extends(a, d);
  3249. a.prototype.run = function() {};
  3250. a.prototype.getTouchData = function(b, a, c) {
  3251. var d = this._currentTouchTarget[b];
  3252. null == d && (d = {}, this._currentTouchTarget[b] = d);
  3253. d.stageX = a;
  3254. d.stageY = c;
  3255. d.identifier = b;
  3256. return d
  3257. };
  3258. a.prototype.dispatchEvent = function(b, a) {
  3259. c.TouchEvent.dispatchTouchEvent(a.target, b, a.identifier, a.stageX, a.stageY, !1, !1, !1, !0 ==
  3260. this.touchDownTarget[a.identifier])
  3261. };
  3262. a.prototype.onTouchBegan = function(b, a, d) {
  3263. var e = c.MainContext.instance.stage.hitTest(b, a);
  3264. e && (b = this.getTouchData(d, b, a), this.touchDownTarget[d] = !0, b.target = e, b.beginTarget = e, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, b))
  3265. };
  3266. a.prototype.onTouchMove = function(b, a, d) {
  3267. if (b != this.lastTouchX || a != this.lastTouchY) {
  3268. this.lastTouchX = b;
  3269. this.lastTouchY = a;
  3270. var e = c.MainContext.instance.stage.hitTest(b, a);
  3271. e && (b = this.getTouchData(d, b, a), b.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE,
  3272. b))
  3273. }
  3274. };
  3275. a.prototype.onTouchEnd = function(b, a, d) {
  3276. var e = c.MainContext.instance.stage.hitTest(b, a);
  3277. 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])
  3278. };
  3279. return a
  3280. }(c.HashObject);
  3281. c.TouchContext = e
  3282. })(egret || (egret = {}));
  3283. __extends = this.__extends || function(c, e) {
  3284. function d() {
  3285. this.constructor = c
  3286. }
  3287. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3288. d.prototype = e.prototype;
  3289. c.prototype = new d
  3290. };
  3291. (function(c) {
  3292. var e = function(c) {
  3293. function a() {
  3294. c.call(this)
  3295. }
  3296. __extends(a, c);
  3297. a.prototype.proceed = function(b) {};
  3298. return a
  3299. }(c.HashObject);
  3300. c.NetContext = e
  3301. })(egret || (egret = {}));
  3302. __extends = this.__extends || function(c, e) {
  3303. function d() {
  3304. this.constructor = c
  3305. }
  3306. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3307. d.prototype = e.prototype;
  3308. c.prototype = new d
  3309. };
  3310. (function(c) {
  3311. var e = function(c) {
  3312. function a() {
  3313. c.call(this);
  3314. this.frameRate = 60
  3315. }
  3316. __extends(a, c);
  3317. a.prototype.executeMainLoop = function(b, a) {};
  3318. return a
  3319. }(c.HashObject);
  3320. c.DeviceContext = e
  3321. })(egret || (egret = {}));
  3322. __extends = this.__extends || function(c, e) {
  3323. function d() {
  3324. this.constructor = c
  3325. }
  3326. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3327. d.prototype = e.prototype;
  3328. c.prototype = new d
  3329. };
  3330. (function(c) {
  3331. var e = function(d) {
  3332. function a() {
  3333. d.call(this);
  3334. this.translate = this.isHD ? function(b) {
  3335. return "translate3d(" + b.x + "px, " + (b.y - c.MainContext.instance.stage.stageHeight) + "px, 0) "
  3336. } : function(b) {
  3337. console.log("translate(" + b.x + "px, " + b.y + "px) ");
  3338. return "translate(" + b.x + "px, " + b.y + "px) "
  3339. };
  3340. this.rotate = this.isHD ? function(b) {
  3341. return "rotateZ(" + b + "deg) "
  3342. } : function(b) {
  3343. return "rotate(" + b + "deg) "
  3344. };
  3345. this.ua = navigator.userAgent.toLowerCase();
  3346. var b = this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/) ||
  3347. this.ua.match(/chrome|safari/);
  3348. b && 0 < b.length && (b = b[0], "micromessenger" == b && (this.type = "wechat"), this.type = b);
  3349. this.type = "unknow";
  3350. switch (this.type) {
  3351. case "firefox":
  3352. this.pfx = "Moz";
  3353. this.isHD = !0;
  3354. break;
  3355. case "chrome":
  3356. case "safari":
  3357. this.pfx = "webkit";
  3358. this.isHD = !0;
  3359. break;
  3360. case "opera":
  3361. this.pfx = "O";
  3362. this.isHD = !1;
  3363. break;
  3364. case "ie":
  3365. this.pfx = "ms";
  3366. this.isHD = !1;
  3367. break;
  3368. default:
  3369. this.pfx = "webkit", this.isHD = !0
  3370. }
  3371. this.trans = this.pfx + "Transform";
  3372. this.isMobile = -1 != this.ua.indexOf("mobile") || -1 != this.ua.indexOf("android")
  3373. }
  3374. __extends(a,
  3375. d);
  3376. a.getInstance = function() {
  3377. null == a.instance && (a.instance = new a);
  3378. return a.instance
  3379. };
  3380. a.prototype.$new = function(b) {
  3381. return this.$(document.createElement(b))
  3382. };
  3383. a.prototype.$ = function(b) {
  3384. var g = document;
  3385. if (b = b instanceof HTMLElement ? b : g.querySelector(b)) b.find = b.find || this.$, b.hasClass = b.hasClass || function(b) {
  3386. return this.className.match(new RegExp("(\\s|^)" + b + "(\\s|$)"))
  3387. }, b.addClass = b.addClass || function(b) {
  3388. this.hasClass(b) || (this.className && (this.className += " "), this.className += b);
  3389. return this
  3390. }, b.removeClass =
  3391. b.removeClass || function(b) {
  3392. this.hasClass(b) && (this.className = this.className.replace(b, ""));
  3393. return this
  3394. }, b.remove = b.remove || function() {}, b.appendTo = b.appendTo || function(b) {
  3395. b.appendChild(this);
  3396. return this
  3397. }, b.prependTo = b.prependTo || function(b) {
  3398. b.childNodes[0] ? b.insertBefore(this, b.childNodes[0]) : b.appendChild(this);
  3399. return this
  3400. }, b.transforms = b.transforms || function() {
  3401. this.style[a.getInstance().trans] = a.getInstance().translate(this.position) + a.getInstance().rotate(this.rotation) + a.getInstance().scale(this.scale) +
  3402. a.getInstance().skew(this.skew);
  3403. return this
  3404. }, b.position = b.position || {
  3405. x: 0,
  3406. y: 0
  3407. }, b.rotation = b.rotation || 0, b.scale = b.scale || {
  3408. x: 1,
  3409. y: 1
  3410. }, b.skew = b.skew || {
  3411. x: 0,
  3412. y: 0
  3413. }, b.translates = function(b, a) {
  3414. this.position.x = b;
  3415. this.position.y = a - c.MainContext.instance.stage.stageHeight;
  3416. this.transforms();
  3417. return this
  3418. }, b.rotate = function(b) {
  3419. this.rotation = b;
  3420. this.transforms();
  3421. return this
  3422. }, b.resize = function(b, a) {
  3423. this.scale.x = b;
  3424. this.scale.y = a;
  3425. this.transforms();
  3426. return this
  3427. }, b.setSkew = function(b, a) {
  3428. this.skew.x = b;
  3429. this.skew.y = a;
  3430. this.transforms();
  3431. return this
  3432. };
  3433. return b
  3434. };
  3435. a.prototype.scale = function(b) {
  3436. return "scale(" + b.x + ", " + b.y + ") "
  3437. };
  3438. a.prototype.skew = function(b) {
  3439. return "skewX(" + -b.x + "deg) skewY(" + b.y + "deg)"
  3440. };
  3441. return a
  3442. }(c.HashObject);
  3443. c.Browser = e
  3444. })(egret || (egret = {}));
  3445. egret.Codec = {
  3446. name: "Jacob__Codec"
  3447. };
  3448. egret.Utils = {};
  3449. egret.Utils.unzip = function() {
  3450. return egret.Codec.GZip.gunzip.apply(egret.Codec.GZip, arguments)
  3451. };
  3452. egret.Utils.unzipBase64 = function() {
  3453. var c = egret.Codec.Base64.decode.apply(egret.Codec.Base64, arguments);
  3454. return egret.Codec.GZip.gunzip.apply(egret.Codec.GZip, [c])
  3455. };
  3456. egret.Utils.unzipBase64AsArray = function(c, e) {
  3457. e = e || 1;
  3458. var d = this.unzipBase64(c),
  3459. a = [],
  3460. b, g, l;
  3461. b = 0;
  3462. for (l = d.length / e; b < l; b++)
  3463. for (a[b] = 0, g = e - 1; 0 <= g; --g) a[b] += d.charCodeAt(b * e + g) << 8 * g;
  3464. return a
  3465. };
  3466. egret.Utils.unzipAsArray = function(c, e) {
  3467. e = e || 1;
  3468. var d = this.unzip(c),
  3469. a = [],
  3470. b, g, l;
  3471. b = 0;
  3472. for (l = d.length / e; b < l; b++)
  3473. for (a[b] = 0, g = e - 1; 0 <= g; --g) a[b] += d.charCodeAt(b * e + g) << 8 * g;
  3474. return a
  3475. };
  3476. egret.Utils.StringToArray = function(c) {
  3477. c = c.split(",");
  3478. var e = [],
  3479. d;
  3480. for (d = 0; d < c.length; d++) e.push(parseInt(c[d]));
  3481. return e
  3482. };
  3483. egret.Codec.Base64 = {
  3484. name: "Jacob__Codec__Base64"
  3485. };
  3486. egret.Codec.Base64._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  3487. egret.Codec.Base64.decode = function(c) {
  3488. var e = [],
  3489. d, a, b, g, l, m = 0;
  3490. for (c = c.replace(/[^A-Za-z0-9\+\/\=]/g, ""); m < c.length;) d = this._keyStr.indexOf(c.charAt(m++)), a = this._keyStr.indexOf(c.charAt(m++)), g = this._keyStr.indexOf(c.charAt(m++)), l = this._keyStr.indexOf(c.charAt(m++)), d = d << 2 | a >> 4, a = (a & 15) << 4 | g >> 2, b = (g & 3) << 6 | l, e.push(String.fromCharCode(d)), 64 != g && e.push(String.fromCharCode(a)), 64 != l && e.push(String.fromCharCode(b));
  3491. return e = e.join("")
  3492. };
  3493. egret.Codec.Base64.decodeAsArray = function(c, e) {
  3494. var d = this.decode(c),
  3495. a = [],
  3496. b, g, l;
  3497. b = 0;
  3498. for (l = d.length / e; b < l; b++)
  3499. for (a[b] = 0, g = e - 1; 0 <= g; --g) a[b] += d.charCodeAt(b * e + g) << 8 * g;
  3500. return a
  3501. };
  3502. egret.Utils.uint8ArrayToUint32Array = function(c) {
  3503. if (0 != c.length % 4) return null;
  3504. for (var e = c.length / 4, d = window.Uint32Array ? new Uint32Array(e) : [], a = 0; a < e; a++) {
  3505. var b = 4 * a;
  3506. d[a] = c[b] + 256 * c[b + 1] + 65536 * c[b + 2] + 16777216 * c[b + 3]
  3507. }
  3508. return d
  3509. };
  3510. egret.Codec.GZip = function(c) {
  3511. this.data = c;
  3512. this.debug = !1;
  3513. this.gpflags = void 0;
  3514. this.files = 0;
  3515. this.unzipped = [];
  3516. this.buf32k = Array(32768);
  3517. this.bIdx = 0;
  3518. this.modeZIP = !1;
  3519. this.bytepos = 0;
  3520. this.bb = 1;
  3521. this.bits = 0;
  3522. this.nameBuf = [];
  3523. this.fileout = void 0;
  3524. this.literalTree = Array(egret.Codec.GZip.LITERALS);
  3525. this.distanceTree = Array(32);
  3526. this.treepos = 0;
  3527. this.Places = null;
  3528. this.len = 0;
  3529. this.fpos = Array(17);
  3530. this.fpos[0] = 0;
  3531. this.fmax = this.flens = void 0
  3532. };
  3533. egret.Codec.GZip.gunzip = function(c) {
  3534. return (new egret.Codec.GZip(c)).gunzip()[0][0]
  3535. };
  3536. egret.Codec.GZip.HufNode = function() {
  3537. this.b1 = this.b0 = 0;
  3538. this.jump = null;
  3539. this.jumppos = -1
  3540. };
  3541. egret.Codec.GZip.LITERALS = 288;
  3542. egret.Codec.GZip.NAMEMAX = 256;
  3543. 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,
  3544. 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
  3545. ];
  3546. 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];
  3547. 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];
  3548. 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];
  3549. 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];
  3550. egret.Codec.GZip.border = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  3551. egret.Codec.GZip.prototype.gunzip = function() {
  3552. this.outputArr = [];
  3553. this.nextFile();
  3554. return this.unzipped
  3555. };
  3556. egret.Codec.GZip.prototype.readByte = function() {
  3557. this.bits += 8;
  3558. return this.bytepos < this.data.length ? this.data.charCodeAt(this.bytepos++) : -1
  3559. };
  3560. egret.Codec.GZip.prototype.byteAlign = function() {
  3561. this.bb = 1
  3562. };
  3563. egret.Codec.GZip.prototype.readBit = function() {
  3564. var c;
  3565. this.bits++;
  3566. c = this.bb & 1;
  3567. this.bb >>= 1;
  3568. 0 == this.bb && (this.bb = this.readByte(), c = this.bb & 1, this.bb = this.bb >> 1 | 128);
  3569. return c
  3570. };
  3571. egret.Codec.GZip.prototype.readBits = function(c) {
  3572. for (var e = 0, d = c; d--;) e = e << 1 | this.readBit();
  3573. c && (e = egret.Codec.GZip.bitReverse[e] >> 8 - c);
  3574. return e
  3575. };
  3576. egret.Codec.GZip.prototype.flushBuffer = function() {
  3577. this.bIdx = 0
  3578. };
  3579. egret.Codec.GZip.prototype.addBuffer = function(c) {
  3580. this.buf32k[this.bIdx++] = c;
  3581. this.outputArr.push(String.fromCharCode(c));
  3582. 32768 == this.bIdx && (this.bIdx = 0)
  3583. };
  3584. egret.Codec.GZip.prototype.IsPat = function() {
  3585. for (;;) {
  3586. if (this.fpos[this.len] >= this.fmax) return -1;
  3587. if (this.flens[this.fpos[this.len]] == this.len) return this.fpos[this.len]++;
  3588. this.fpos[this.len]++
  3589. }
  3590. };
  3591. egret.Codec.GZip.prototype.Rec = function() {
  3592. var c = this.Places[this.treepos],
  3593. e;
  3594. if (17 == this.len) return -1;
  3595. this.treepos++;
  3596. this.len++;
  3597. e = this.IsPat();
  3598. if (0 <= e) c.b0 = e;
  3599. else if (c.b0 = 32768, this.Rec()) return -1;
  3600. e = this.IsPat();
  3601. if (0 <= e) c.b1 = e, c.jump = null;
  3602. else if (c.b1 = 32768, c.jump = this.Places[this.treepos], c.jumppos = this.treepos, this.Rec()) return -1;
  3603. this.len--;
  3604. return 0
  3605. };
  3606. egret.Codec.GZip.prototype.CreateTree = function(c, e, d, a) {
  3607. this.Places = c;
  3608. this.treepos = 0;
  3609. this.flens = d;
  3610. this.fmax = e;
  3611. for (c = 0; 17 > c; c++) this.fpos[c] = 0;
  3612. this.len = 0;
  3613. return this.Rec() ? -1 : 0
  3614. };
  3615. egret.Codec.GZip.prototype.DecodeValue = function(c) {
  3616. for (var e, d, a = 0, b = c[a];;)
  3617. if (e = this.readBit()) {
  3618. if (!(b.b1 & 32768)) return b.b1;
  3619. b = b.jump;
  3620. e = c.length;
  3621. for (d = 0; d < e; d++)
  3622. if (c[d] === b) {
  3623. a = d;
  3624. break
  3625. }
  3626. } else {
  3627. if (!(b.b0 & 32768)) return b.b0;
  3628. a++;
  3629. b = c[a]
  3630. }
  3631. return -1
  3632. };
  3633. egret.Codec.GZip.prototype.DeflateLoop = function() {
  3634. var c, e, d, a, b;
  3635. do
  3636. if (c = this.readBit(), d = this.readBits(2), 0 == d)
  3637. 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(), this.addBuffer(e);
  3638. else if (1 == d)
  3639. for (;;)
  3640. 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);
  3641. else if (256 == d) break;
  3642. else {
  3643. var g;
  3644. d -= 257;
  3645. b = this.readBits(egret.Codec.GZip.cplext[d]) + egret.Codec.GZip.cplens[d];
  3646. d = egret.Codec.GZip.bitReverse[this.readBits(5)] >> 3;
  3647. 8 < egret.Codec.GZip.cpdext[d] ? (g = this.readBits(8), g |= this.readBits(egret.Codec.GZip.cpdext[d] - 8) << 8) : g = this.readBits(egret.Codec.GZip.cpdext[d]);
  3648. g += egret.Codec.GZip.cpdist[d];
  3649. for (d = 0; d < b; d++) e = this.buf32k[this.bIdx - g & 32767], this.addBuffer(e)
  3650. } else if (2 == d) {
  3651. var l = Array(320);
  3652. e = 257 + this.readBits(5);
  3653. g = 1 + this.readBits(5);
  3654. a = 4 + this.readBits(4);
  3655. for (d =
  3656. 0; 19 > d; d++) l[d] = 0;
  3657. for (d = 0; d < a; d++) l[egret.Codec.GZip.border[d]] = this.readBits(3);
  3658. b = this.distanceTree.length;
  3659. for (a = 0; a < b; a++) this.distanceTree[a] = new egret.Codec.GZip.HufNode;
  3660. if (this.CreateTree(this.distanceTree, 19, l, 0)) return this.flushBuffer(), 1;
  3661. b = e + g;
  3662. a = 0;
  3663. for (var m = -1; a < b;)
  3664. if (m++, d = this.DecodeValue(this.distanceTree), 16 > d) l[a++] = d;
  3665. else if (16 == d) {
  3666. var f;
  3667. d = 3 + this.readBits(2);
  3668. if (a + d > b) return this.flushBuffer(), 1;
  3669. for (f = a ? l[a - 1] : 0; d--;) l[a++] = f
  3670. } else {
  3671. d = 17 == d ? 3 + this.readBits(3) : 11 + this.readBits(7);
  3672. if (a +
  3673. d > b) return this.flushBuffer(), 1;
  3674. for (; d--;) l[a++] = 0
  3675. }
  3676. b = this.literalTree.length;
  3677. for (a = 0; a < b; a++) this.literalTree[a] = new egret.Codec.GZip.HufNode;
  3678. if (this.CreateTree(this.literalTree, e, l, 0)) return this.flushBuffer(), 1;
  3679. b = this.literalTree.length;
  3680. for (a = 0; a < b; a++) this.distanceTree[a] = new egret.Codec.GZip.HufNode;
  3681. d = [];
  3682. for (a = e; a < l.length; a++) d[a - e] = l[a];
  3683. if (this.CreateTree(this.distanceTree, g, d, 0)) return this.flushBuffer(), 1;
  3684. for (;;)
  3685. if (d = this.DecodeValue(this.literalTree), 256 <= d) {
  3686. d -= 256;
  3687. if (0 == d) break;
  3688. d--;
  3689. b = this.readBits(egret.Codec.GZip.cplext[d]) +
  3690. egret.Codec.GZip.cplens[d];
  3691. d = this.DecodeValue(this.distanceTree);
  3692. 8 < egret.Codec.GZip.cpdext[d] ? (g = this.readBits(8), g |= this.readBits(egret.Codec.GZip.cpdext[d] - 8) << 8) : g = this.readBits(egret.Codec.GZip.cpdext[d]);
  3693. for (g += egret.Codec.GZip.cpdist[d]; b--;) e = this.buf32k[this.bIdx - g & 32767], this.addBuffer(e)
  3694. } else this.addBuffer(d)
  3695. }
  3696. while (!c);
  3697. this.flushBuffer();
  3698. this.byteAlign();
  3699. return 0
  3700. };
  3701. egret.Codec.GZip.prototype.unzipFile = function(c) {
  3702. var e;
  3703. this.gunzip();
  3704. for (e = 0; e < this.unzipped.length; e++)
  3705. if (this.unzipped[e][1] == c) return this.unzipped[e][0]
  3706. };
  3707. egret.Codec.GZip.prototype.nextFile = function() {
  3708. this.outputArr = [];
  3709. this.modeZIP = !1;
  3710. var c = [];
  3711. c[0] = this.readByte();
  3712. c[1] = this.readByte();
  3713. 120 == c[0] && 218 == c[1] && (this.DeflateLoop(), this.unzipped[this.files] = [this.outputArr.join(""), "geonext.gxt"], this.files++);
  3714. 31 == c[0] && 139 == c[1] && (this.skipdir(), this.unzipped[this.files] = [this.outputArr.join(""), "file"], this.files++);
  3715. if (80 == c[0] && 75 == c[1] && (this.modeZIP = !0, c[2] = this.readByte(), c[3] = this.readByte(), 3 == c[2] && 4 == c[3])) {
  3716. c[0] = this.readByte();
  3717. c[1] = this.readByte();
  3718. this.gpflags = this.readByte();
  3719. this.gpflags |= this.readByte() << 8;
  3720. c = this.readByte();
  3721. c |= this.readByte() << 8;
  3722. this.readByte();
  3723. this.readByte();
  3724. this.readByte();
  3725. this.readByte();
  3726. this.readByte();
  3727. this.readByte();
  3728. this.readByte();
  3729. this.readByte();
  3730. this.readByte();
  3731. this.readByte();
  3732. this.readByte();
  3733. this.readByte();
  3734. var e = this.readByte(),
  3735. e = e | this.readByte() << 8,
  3736. d = this.readByte(),
  3737. d = d | this.readByte() << 8,
  3738. a = 0;
  3739. for (this.nameBuf = []; e--;) {
  3740. var b = this.readByte();
  3741. "/" == b | ":" == b ? a = 0 : a < egret.Codec.GZip.NAMEMAX - 1 && (this.nameBuf[a++] = String.fromCharCode(b))
  3742. }
  3743. this.fileout ||
  3744. (this.fileout = this.nameBuf);
  3745. for (var a = 0; a < d;) this.readByte(), a++;
  3746. 8 == c && (this.DeflateLoop(), this.unzipped[this.files] = [this.outputArr.join(""), this.nameBuf.join("")], this.files++);
  3747. this.skipdir()
  3748. }
  3749. };
  3750. egret.Codec.GZip.prototype.skipdir = function() {
  3751. var c = [],
  3752. e;
  3753. 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());
  3754. this.modeZIP && this.nextFile();
  3755. c[0] = this.readByte();
  3756. if (8 != c[0]) return 0;
  3757. this.gpflags = this.readByte();
  3758. this.readByte();
  3759. this.readByte();
  3760. this.readByte();
  3761. this.readByte();
  3762. this.readByte();
  3763. this.readByte();
  3764. if (this.gpflags & 4)
  3765. for (c[0] =
  3766. this.readByte(), c[2] = this.readByte(), this.len = c[0] + 256 * c[1], c = 0; c < this.len; c++) this.readByte();
  3767. if (this.gpflags & 8)
  3768. for (c = 0, this.nameBuf = []; e = this.readByte();) {
  3769. if ("7" == e || ":" == e) c = 0;
  3770. c < egret.Codec.GZip.NAMEMAX - 1 && (this.nameBuf[c++] = e)
  3771. }
  3772. if (this.gpflags & 16)
  3773. for (; this.readByte(););
  3774. this.gpflags & 2 && (this.readByte(), this.readByte());
  3775. this.DeflateLoop();
  3776. this.readByte();
  3777. this.readByte();
  3778. this.readByte();
  3779. this.readByte();
  3780. this.modeZIP && this.nextFile()
  3781. };
  3782. (function() {
  3783. function c(b) {
  3784. throw b;
  3785. }
  3786. function e(b, a) {
  3787. var c = b.split("."),
  3788. g = C;
  3789. c[0] in g || !g.execScript || g.execScript("var " + c[0]);
  3790. for (var d; c.length && (d = c.shift());) c.length || a === w ? g = g[d] ? g[d] : g[d] = {} : g[d] = a
  3791. }
  3792. function d(b) {
  3793. if ("string" === typeof b) {
  3794. b = b.split("");
  3795. var a, c;
  3796. a = 0;
  3797. for (c = b.length; a < c; a++) b[a] = (b[a].charCodeAt(0) & 255) >>> 0
  3798. }
  3799. a = 1;
  3800. c = 0;
  3801. for (var g = b.length, d, l = 0; 0 < g;) {
  3802. d = 1024 < g ? 1024 : g;
  3803. g -= d;
  3804. do a += b[l++], c += a; while (--d);
  3805. a %= 65521;
  3806. c %= 65521
  3807. }
  3808. return (c << 16 | a) >>> 0
  3809. }
  3810. function a(b, a) {
  3811. this.index = "number" === typeof a ? a : 0;
  3812. this.i = 0;
  3813. this.buffer = b instanceof(u ? Uint8Array : Array) ? b : new(u ? Uint8Array : Array)(32768);
  3814. 2 * this.buffer.length <= this.index && c(Error("invalid index"));
  3815. this.buffer.length <= this.index && this.f()
  3816. }
  3817. function b(b) {
  3818. this.buffer = new(u ? Uint16Array : Array)(2 * b);
  3819. this.length = 0
  3820. }
  3821. function g(b) {
  3822. var a = b.length,
  3823. c = 0,
  3824. g = Number.POSITIVE_INFINITY,
  3825. d, l, e, m, f, h, k, q, r;
  3826. for (q = 0; q < a; ++q) b[q] > c && (c = b[q]), b[q] < g && (g = b[q]);
  3827. d = 1 << c;
  3828. l = new(u ? Uint32Array : Array)(d);
  3829. e = 1;
  3830. m = 0;
  3831. for (f = 2; e <= c;) {
  3832. for (q = 0; q < a; ++q)
  3833. if (b[q] === e) {
  3834. h = 0;
  3835. k = m;
  3836. for (r = 0; r < e; ++r) h =
  3837. h << 1 | k & 1, k >>= 1;
  3838. for (r = h; r < d; r += f) l[r] = e << 16 | q;
  3839. ++m
  3840. }++e;
  3841. m <<= 1;
  3842. f <<= 1
  3843. }
  3844. return [l, c, g]
  3845. }
  3846. function l(b, a) {
  3847. this.h = H;
  3848. this.w = 0;
  3849. this.input = b;
  3850. this.b = 0;
  3851. a && (a.lazy && (this.w = a.lazy), "number" === typeof a.compressionType && (this.h = a.compressionType), a.outputBuffer && (this.a = u && a.outputBuffer instanceof Array ? new Uint8Array(a.outputBuffer) : a.outputBuffer), "number" === typeof a.outputIndex && (this.b = a.outputIndex));
  3852. this.a || (this.a = new(u ? Uint8Array : Array)(32768))
  3853. }
  3854. function m(b, a) {
  3855. this.length = b;
  3856. this.G = a
  3857. }
  3858. function f() {
  3859. var b = G;
  3860. switch (B) {
  3861. case 3 ===
  3862. b:
  3863. return [257, b - 3, 0];
  3864. case 4 === b:
  3865. return [258, b - 4, 0];
  3866. case 5 === b:
  3867. return [259, b - 5, 0];
  3868. case 6 === b:
  3869. return [260, b - 6, 0];
  3870. case 7 === b:
  3871. return [261, b - 7, 0];
  3872. case 8 === b:
  3873. return [262, b - 8, 0];
  3874. case 9 === b:
  3875. return [263, b - 9, 0];
  3876. case 10 === b:
  3877. return [264, b - 10, 0];
  3878. case 12 >= b:
  3879. return [265, b - 11, 1];
  3880. case 14 >= b:
  3881. return [266, b - 13, 1];
  3882. case 16 >= b:
  3883. return [267, b - 15, 1];
  3884. case 18 >= b:
  3885. return [268, b - 17, 1];
  3886. case 22 >= b:
  3887. return [269, b - 19, 2];
  3888. case 26 >= b:
  3889. return [270, b - 23, 2];
  3890. case 30 >= b:
  3891. return [271, b - 27, 2];
  3892. case 34 >= b:
  3893. return [272, b - 31, 2];
  3894. case 42 >= b:
  3895. return [273, b - 35, 3];
  3896. case 50 >=
  3897. b:
  3898. return [274, b - 43, 3];
  3899. case 58 >= b:
  3900. return [275, b - 51, 3];
  3901. case 66 >= b:
  3902. return [276, b - 59, 3];
  3903. case 82 >= b:
  3904. return [277, b - 67, 4];
  3905. case 98 >= b:
  3906. return [278, b - 83, 4];
  3907. case 114 >= b:
  3908. return [279, b - 99, 4];
  3909. case 130 >= b:
  3910. return [280, b - 115, 4];
  3911. case 162 >= b:
  3912. return [281, b - 131, 5];
  3913. case 194 >= b:
  3914. return [282, b - 163, 5];
  3915. case 226 >= b:
  3916. return [283, b - 195, 5];
  3917. case 257 >= b:
  3918. return [284, b - 227, 5];
  3919. case 258 === b:
  3920. return [285, b - 258, 0];
  3921. default:
  3922. c("invalid length: " + b)
  3923. }
  3924. }
  3925. function h(b, a) {
  3926. function g(b, a) {
  3927. var d = b.G,
  3928. l = [],
  3929. e = 0,
  3930. m;
  3931. m = M[b.length];
  3932. l[e++] = m & 65535;
  3933. l[e++] = m >> 16 & 255;
  3934. l[e++] =
  3935. m >> 24;
  3936. var f;
  3937. switch (B) {
  3938. case 1 === d:
  3939. f = [0, d - 1, 0];
  3940. break;
  3941. case 2 === d:
  3942. f = [1, d - 2, 0];
  3943. break;
  3944. case 3 === d:
  3945. f = [2, d - 3, 0];
  3946. break;
  3947. case 4 === d:
  3948. f = [3, d - 4, 0];
  3949. break;
  3950. case 6 >= d:
  3951. f = [4, d - 5, 1];
  3952. break;
  3953. case 8 >= d:
  3954. f = [5, d - 7, 1];
  3955. break;
  3956. case 12 >= d:
  3957. f = [6, d - 9, 2];
  3958. break;
  3959. case 16 >= d:
  3960. f = [7, d - 13, 2];
  3961. break;
  3962. case 24 >= d:
  3963. f = [8, d - 17, 3];
  3964. break;
  3965. case 32 >= d:
  3966. f = [9, d - 25, 3];
  3967. break;
  3968. case 48 >= d:
  3969. f = [10, d - 33, 4];
  3970. break;
  3971. case 64 >= d:
  3972. f = [11, d - 49, 4];
  3973. break;
  3974. case 96 >= d:
  3975. f = [12, d - 65, 5];
  3976. break;
  3977. case 128 >= d:
  3978. f = [13, d - 97, 5];
  3979. break;
  3980. case 192 >= d:
  3981. f = [14, d - 129, 6];
  3982. break;
  3983. case 256 >= d:
  3984. f = [15, d - 193, 6];
  3985. break;
  3986. case 384 >= d:
  3987. f = [16, d - 257, 7];
  3988. break;
  3989. case 512 >= d:
  3990. f = [17, d - 385, 7];
  3991. break;
  3992. case 768 >= d:
  3993. f = [18, d - 513, 8];
  3994. break;
  3995. case 1024 >= d:
  3996. f = [19, d - 769, 8];
  3997. break;
  3998. case 1536 >= d:
  3999. f = [20, d - 1025, 9];
  4000. break;
  4001. case 2048 >= d:
  4002. f = [21, d - 1537, 9];
  4003. break;
  4004. case 3072 >= d:
  4005. f = [22, d - 2049, 10];
  4006. break;
  4007. case 4096 >= d:
  4008. f = [23, d - 3073, 10];
  4009. break;
  4010. case 6144 >= d:
  4011. f = [24, d - 4097, 11];
  4012. break;
  4013. case 8192 >= d:
  4014. f = [25, d - 6145, 11];
  4015. break;
  4016. case 12288 >= d:
  4017. f = [26, d - 8193, 12];
  4018. break;
  4019. case 16384 >= d:
  4020. f = [27, d - 12289, 12];
  4021. break;
  4022. case 24576 >= d:
  4023. f = [28, d - 16385, 13];
  4024. break;
  4025. case 32768 >= d:
  4026. f = [29, d - 24577, 13];
  4027. break;
  4028. default:
  4029. c("invalid distance")
  4030. }
  4031. m =
  4032. f;
  4033. l[e++] = m[0];
  4034. l[e++] = m[1];
  4035. l[e++] = m[2];
  4036. d = 0;
  4037. for (e = l.length; d < e; ++d) r[p++] = l[d];
  4038. n[l[0]]++;
  4039. t[l[3]]++;
  4040. s = b.length + a - 1;
  4041. q = null
  4042. }
  4043. var d, l, e, f, h, k = {},
  4044. q, r = u ? new Uint16Array(2 * a.length) : [],
  4045. p = 0,
  4046. s = 0,
  4047. n = new(u ? Uint32Array : Array)(286),
  4048. t = new(u ? Uint32Array : Array)(30),
  4049. z = b.w,
  4050. A;
  4051. if (!u) {
  4052. for (e = 0; 285 >= e;) n[e++] = 0;
  4053. for (e = 0; 29 >= e;) t[e++] = 0
  4054. }
  4055. n[256] = 1;
  4056. d = 0;
  4057. for (l = a.length; d < l; ++d) {
  4058. e = h = 0;
  4059. for (f = 3; e < f && d + e !== l; ++e) h = h << 8 | a[d + e];
  4060. k[h] === w && (k[h] = []);
  4061. e = k[h];
  4062. if (!(0 < s--)) {
  4063. for (; 0 < e.length && 32768 < d - e[0];) e.shift();
  4064. if (d + 3 >= l) {
  4065. q && g(q, -1);
  4066. e = 0;
  4067. for (f = l - d; e < f; ++e) A = a[d + e], r[p++] = A, ++n[A];
  4068. break
  4069. }
  4070. if (0 < e.length) {
  4071. h = f = w;
  4072. var D = 0,
  4073. E = w,
  4074. x = w,
  4075. y = E = w,
  4076. v = a.length,
  4077. x = 0,
  4078. y = e.length;
  4079. a: for (; x < y; x++) {
  4080. f = e[y - x - 1];
  4081. E = 3;
  4082. if (3 < D) {
  4083. for (E = D; 3 < E; E--)
  4084. if (a[f + E - 1] !== a[d + E - 1]) continue a;
  4085. E = D
  4086. }
  4087. for (; 258 > E && d + E < v && a[f + E] === a[d + E];)++E;
  4088. E > D && (h = f, D = E);
  4089. if (258 === E) break
  4090. }
  4091. f = new m(D, d - h);
  4092. q ? q.length < f.length ? (A = a[d - 1], r[p++] = A, ++n[A], g(f, 0)) : g(q, -1) : f.length < z ? q = f : g(f, 0)
  4093. } else q ? g(q, -1) : (A = a[d], r[p++] = A, ++n[A])
  4094. }
  4095. e.push(d)
  4096. }
  4097. r[p++] = 256;
  4098. n[256]++;
  4099. b.L = n;
  4100. b.K = t;
  4101. return u ? r.subarray(0, p) : r
  4102. }
  4103. function k(a,
  4104. c) {
  4105. function g(b) {
  4106. var a = r[b][p[b]];
  4107. a === k ? (g(b + 1), g(b + 1)) : --q[a];
  4108. ++p[b]
  4109. }
  4110. var d = a.length,
  4111. l = new b(572),
  4112. e = new(u ? Uint8Array : Array)(d),
  4113. m, f, h;
  4114. if (!u)
  4115. for (f = 0; f < d; f++) e[f] = 0;
  4116. for (f = 0; f < d; ++f) 0 < a[f] && l.push(f, a[f]);
  4117. d = Array(l.length / 2);
  4118. m = new(u ? Uint32Array : Array)(l.length / 2);
  4119. if (1 === d.length) return e[l.pop().index] = 1, e;
  4120. f = 0;
  4121. for (h = l.length / 2; f < h; ++f) d[f] = l.pop(), m[f] = d[f].value;
  4122. var k = m.length;
  4123. f = new(u ? Uint16Array : Array)(c);
  4124. var l = new(u ? Uint8Array : Array)(c),
  4125. q = new(u ? Uint8Array : Array)(k);
  4126. h = Array(c);
  4127. var r = Array(c),
  4128. p =
  4129. Array(c),
  4130. s = (1 << c) - k,
  4131. n = 1 << c - 1,
  4132. t, z, w;
  4133. f[c - 1] = k;
  4134. for (t = 0; t < c; ++t) s < n ? l[t] = 0 : (l[t] = 1, s -= n), s <<= 1, f[c - 2 - t] = (f[c - 1 - t] / 2 | 0) + k;
  4135. f[0] = l[0];
  4136. h[0] = Array(f[0]);
  4137. r[0] = Array(f[0]);
  4138. for (t = 1; t < c; ++t) f[t] > 2 * f[t - 1] + l[t] && (f[t] = 2 * f[t - 1] + l[t]), h[t] = Array(f[t]), r[t] = Array(f[t]);
  4139. for (s = 0; s < k; ++s) q[s] = c;
  4140. for (n = 0; n < f[c - 1]; ++n) h[c - 1][n] = m[n], r[c - 1][n] = n;
  4141. for (s = 0; s < c; ++s) p[s] = 0;
  4142. 1 === l[c - 1] && (--q[0], ++p[c - 1]);
  4143. for (t = c - 2; 0 <= t; --t) {
  4144. z = s = 0;
  4145. w = p[t + 1];
  4146. for (n = 0; n < f[t]; n++) z = h[t + 1][w] + h[t + 1][w + 1], z > m[s] ? (h[t][n] = z, r[t][n] = k, w += 2) : (h[t][n] = m[s],
  4147. r[t][n] = s, ++s);
  4148. p[t] = 0;
  4149. 1 === l[t] && g(t)
  4150. }
  4151. m = q;
  4152. f = 0;
  4153. for (h = d.length; f < h; ++f) e[d[f].index] = m[f];
  4154. return e
  4155. }
  4156. function n(b) {
  4157. var a = new(u ? Uint16Array : Array)(b.length),
  4158. g = [],
  4159. d = [],
  4160. l = 0,
  4161. e, m, f;
  4162. e = 0;
  4163. for (m = b.length; e < m; e++) g[b[e]] = (g[b[e]] | 0) + 1;
  4164. e = 1;
  4165. for (m = 16; e <= m; e++) d[e] = l, l += g[e] | 0, l > 1 << e && c("overcommitted"), l <<= 1;
  4166. 65536 > l && c("undercommitted");
  4167. e = 0;
  4168. for (m = b.length; e < m; e++)
  4169. for (l = d[b[e]], d[b[e]] += 1, g = a[e] = 0, f = b[e]; g < f; g++) a[e] = a[e] << 1 | l & 1, l >>>= 1;
  4170. return a
  4171. }
  4172. function q(b, a) {
  4173. this.input = b;
  4174. this.a = new(u ? Uint8Array : Array)(32768);
  4175. this.h =
  4176. J.j;
  4177. var c = {},
  4178. g;
  4179. !a && (a = {}) || "number" !== typeof a.compressionType || (this.h = a.compressionType);
  4180. for (g in a) c[g] = a[g];
  4181. c.outputBuffer = this.a;
  4182. this.z = new l(this.input, c)
  4183. }
  4184. function p(b, a) {
  4185. this.k = [];
  4186. this.l = 32768;
  4187. this.e = this.g = this.c = this.q = 0;
  4188. this.input = u ? new Uint8Array(b) : b;
  4189. this.s = !1;
  4190. this.m = F;
  4191. this.B = !1;
  4192. if (a || !(a = {})) a.index && (this.c = a.index), a.bufferSize && (this.l = a.bufferSize), a.bufferType && (this.m = a.bufferType), a.resize && (this.B = a.resize);
  4193. switch (this.m) {
  4194. case N:
  4195. this.b = 32768;
  4196. this.a = new(u ? Uint8Array : Array)(32768 +
  4197. this.l + 258);
  4198. break;
  4199. case F:
  4200. this.b = 0;
  4201. this.a = new(u ? Uint8Array : Array)(this.l);
  4202. this.f = this.J;
  4203. this.t = this.H;
  4204. this.o = this.I;
  4205. break;
  4206. default:
  4207. c(Error("invalid inflate mode"))
  4208. }
  4209. }
  4210. function r(b, a) {
  4211. for (var g = b.g, d = b.e, l = b.input, e = b.c, m; d < a;) m = l[e++], m === w && c(Error("input buffer is broken")), g |= m << d, d += 8;
  4212. b.g = g >>> a;
  4213. b.e = d - a;
  4214. b.c = e;
  4215. return g & (1 << a) - 1
  4216. }
  4217. function s(b, a) {
  4218. for (var g = b.g, d = b.e, l = b.input, e = b.c, m = a[0], f = a[1], h; d < f;) h = l[e++], h === w && c(Error("input buffer is broken")), g |= h << d, d += 8;
  4219. l = m[g & (1 << f) - 1];
  4220. m = l >>> 16;
  4221. b.g = g >> m;
  4222. b.e =
  4223. d - m;
  4224. b.c = e;
  4225. return l & 65535
  4226. }
  4227. function t(b) {
  4228. function a(b, c, g) {
  4229. var d, l, e, m;
  4230. for (m = 0; m < b;) switch (d = s(this, c), d) {
  4231. case 16:
  4232. for (e = 3 + r(this, 2); e--;) g[m++] = l;
  4233. break;
  4234. case 17:
  4235. for (e = 3 + r(this, 3); e--;) g[m++] = 0;
  4236. l = 0;
  4237. break;
  4238. case 18:
  4239. for (e = 11 + r(this, 7); e--;) g[m++] = 0;
  4240. l = 0;
  4241. break;
  4242. default:
  4243. l = g[m++] = d
  4244. }
  4245. return g
  4246. }
  4247. var c = r(b, 5) + 257,
  4248. d = r(b, 5) + 1,
  4249. l = r(b, 4) + 4,
  4250. e = new(u ? Uint8Array : Array)(K.length),
  4251. m;
  4252. for (m = 0; m < l; ++m) e[K[m]] = r(b, 3);
  4253. l = g(e);
  4254. e = new(u ? Uint8Array : Array)(c);
  4255. m = new(u ? Uint8Array : Array)(d);
  4256. b.o(g(a.call(b, c, l, e)), g(a.call(b, d, l, m)))
  4257. }
  4258. function A(b,
  4259. a) {
  4260. var g, d;
  4261. this.input = b;
  4262. this.c = 0;
  4263. if (a || !(a = {})) a.index && (this.c = a.index), a.verify && (this.M = a.verify);
  4264. g = b[this.c++];
  4265. d = b[this.c++];
  4266. switch (g & 15) {
  4267. case O:
  4268. this.method = O;
  4269. break;
  4270. default:
  4271. c(Error("unsupported compression method"))
  4272. }
  4273. 0 !== ((g << 8) + d) % 31 && c(Error("invalid fcheck flag:" + ((g << 8) + d) % 31));
  4274. d & 32 && c(Error("fdict flag is not supported"));
  4275. this.A = new p(b, {
  4276. index: this.c,
  4277. bufferSize: a.bufferSize,
  4278. bufferType: a.bufferType,
  4279. resize: a.resize
  4280. })
  4281. }
  4282. var w = void 0,
  4283. B = !0,
  4284. C = this,
  4285. u = "undefined" !== typeof Uint8Array && "undefined" !==
  4286. typeof Uint16Array && "undefined" !== typeof Uint32Array;
  4287. a.prototype.f = function() {
  4288. var b = this.buffer,
  4289. a, c = b.length,
  4290. g = new(u ? Uint8Array : Array)(c << 1);
  4291. if (u) g.set(b);
  4292. else
  4293. for (a = 0; a < c; ++a) g[a] = b[a];
  4294. return this.buffer = g
  4295. };
  4296. a.prototype.d = function(b, a, c) {
  4297. var g = this.buffer,
  4298. d = this.index,
  4299. l = this.i,
  4300. e = g[d];
  4301. 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);
  4302. if (8 > a + l) e = e << a | b, l += a;
  4303. else
  4304. for (c = 0; c < a; ++c) e = e << 1 | b >> a - c - 1 & 1, 8 === ++l && (l = 0, g[d++] = y[e], e = 0, d === g.length && (g = this.f()));
  4305. g[d] = e;
  4306. this.buffer = g;
  4307. this.i = l;
  4308. this.index = d
  4309. };
  4310. a.prototype.finish = function() {
  4311. var b = this.buffer,
  4312. a = this.index,
  4313. c;
  4314. 0 < this.i && (b[a] <<= 8 - this.i, b[a] = y[b[a]], a++);
  4315. u ? c = b.subarray(0, a) : (b.length = a, c = b);
  4316. return c
  4317. };
  4318. var v = new(u ? Uint8Array : Array)(256),
  4319. D;
  4320. for (D = 0; 256 > D; ++D) {
  4321. for (var z = D, E = z, x = 7, z = z >>> 1; z; z >>>= 1) E <<= 1, E |= z & 1, --x;
  4322. v[D] = (E << x & 255) >>> 0
  4323. }
  4324. var y = v,
  4325. v = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049,
  4326. 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,
  4327. 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,
  4328. 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,
  4329. 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,
  4330. 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,
  4331. 711928724, 3020668471, 3272380065, 1510334235, 755167117
  4332. ];
  4333. u && new Uint32Array(v);
  4334. b.prototype.getParent = function(b) {
  4335. return 2 * ((b - 2) / 4 | 0)
  4336. };
  4337. b.prototype.push = function(b, a) {
  4338. var c, g, d = this.buffer,
  4339. l;
  4340. c = this.length;
  4341. d[this.length++] = a;
  4342. for (d[this.length++] = b; 0 < c;)
  4343. if (g = this.getParent(c), d[c] > d[g]) l = d[c], d[c] = d[g], d[g] = l, l = d[c + 1], d[c + 1] = d[g + 1], d[g + 1] = l, c = g;
  4344. else break;
  4345. return this.length
  4346. };
  4347. b.prototype.pop = function() {
  4348. var b, a, c = this.buffer,
  4349. g, d, l;
  4350. a = c[0];
  4351. b = c[1];
  4352. this.length -= 2;
  4353. c[0] = c[this.length];
  4354. c[1] = c[this.length + 1];
  4355. for (l =
  4356. 0;;) {
  4357. d = 2 * l + 2;
  4358. if (d >= this.length) break;
  4359. d + 2 < this.length && c[d + 2] > c[d] && (d += 2);
  4360. if (c[d] > c[l]) g = c[l], c[l] = c[d], c[d] = g, g = c[l + 1], c[l + 1] = c[d + 1], c[d + 1] = g;
  4361. else break;
  4362. l = d
  4363. }
  4364. return {
  4365. index: b,
  4366. value: a,
  4367. length: this.length
  4368. }
  4369. };
  4370. var H = 2,
  4371. v = {
  4372. NONE: 0,
  4373. r: 1,
  4374. j: H,
  4375. N: 3
  4376. },
  4377. L = [];
  4378. for (D = 0; 288 > D; D++) switch (B) {
  4379. case 143 >= D:
  4380. L.push([D + 48, 8]);
  4381. break;
  4382. case 255 >= D:
  4383. L.push([D - 144 + 400, 9]);
  4384. break;
  4385. case 279 >= D:
  4386. L.push([D - 256 + 0, 7]);
  4387. break;
  4388. case 287 >= D:
  4389. L.push([D - 280 + 192, 8]);
  4390. break;
  4391. default:
  4392. c("invalid literal: " + D)
  4393. }
  4394. l.prototype.n = function() {
  4395. var b, g, d, l, e = this.input;
  4396. switch (this.h) {
  4397. case 0:
  4398. d = 0;
  4399. for (l = e.length; d < l;) {
  4400. g = u ? e.subarray(d, d + 65535) : e.slice(d, d + 65535);
  4401. d += g.length;
  4402. var m = d === l,
  4403. f = w,
  4404. q = f = w,
  4405. q = f = w,
  4406. r = this.a,
  4407. p = this.b;
  4408. if (u) {
  4409. for (r = new Uint8Array(this.a.buffer); r.length <= p + g.length + 5;) r = new Uint8Array(r.length << 1);
  4410. r.set(this.a)
  4411. }
  4412. f = m ? 1 : 0;
  4413. r[p++] = f | 0;
  4414. f = g.length;
  4415. q = ~f + 65536 & 65535;
  4416. r[p++] = f & 255;
  4417. r[p++] = f >>> 8 & 255;
  4418. r[p++] = q & 255;
  4419. r[p++] = q >>> 8 & 255;
  4420. if (u) r.set(g, p), p += g.length, r = r.subarray(0, p);
  4421. else {
  4422. f = 0;
  4423. for (q = g.length; f < q; ++f) r[p++] = g[f];
  4424. r.length = p
  4425. }
  4426. this.b = p;
  4427. this.a = r
  4428. }
  4429. break;
  4430. case 1:
  4431. d =
  4432. new a(new Uint8Array(this.a.buffer), this.b);
  4433. d.d(1, 1, B);
  4434. d.d(1, 2, B);
  4435. e = h(this, e);
  4436. g = 0;
  4437. for (m = e.length; g < m; g++)
  4438. if (l = e[g], a.prototype.d.apply(d, L[l]), 256 < l) d.d(e[++g], e[++g], B), d.d(e[++g], 5), d.d(e[++g], e[++g], B);
  4439. else if (256 === l) break;
  4440. this.a = d.finish();
  4441. this.b = this.a.length;
  4442. break;
  4443. case H:
  4444. l = new a(new Uint8Array(this.a), this.b);
  4445. var s, t, z, A = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],
  4446. D, E, f = Array(19),
  4447. x, r = H;
  4448. l.d(1, 1, B);
  4449. l.d(r, 2, B);
  4450. e = h(this, e);
  4451. q = k(this.L, 15);
  4452. D = n(q);
  4453. r = k(this.K, 7);
  4454. p = n(r);
  4455. for (s = 286; 257 < s && 0 === q[s -
  4456. 1]; s--);
  4457. for (t = 30; 1 < t && 0 === r[t - 1]; t--);
  4458. var y = s,
  4459. v = t;
  4460. b = new(u ? Uint32Array : Array)(y + v);
  4461. var C = new(u ? Uint32Array : Array)(316),
  4462. G, F;
  4463. E = new(u ? Uint8Array : Array)(19);
  4464. for (x = z = 0; x < y; x++) b[z++] = q[x];
  4465. for (x = 0; x < v; x++) b[z++] = r[x];
  4466. if (!u)
  4467. for (x = 0, v = E.length; x < v; ++x) E[x] = 0;
  4468. x = G = 0;
  4469. for (v = b.length; x < v; x += z) {
  4470. for (z = 1; x + z < v && b[x + z] === b[x]; ++z);
  4471. y = z;
  4472. if (0 === b[x])
  4473. if (3 > y)
  4474. for (; 0 < y--;) C[G++] = 0, E[0]++;
  4475. else
  4476. for (; 0 < y;) F = 138 > y ? y : 138, F > y - 3 && F < y && (F = y - 3), 10 >= F ? (C[G++] = 17, C[G++] = F - 3, E[17]++) : (C[G++] = 18, C[G++] = F - 11, E[18]++), y -= F;
  4477. else if (C[G++] =
  4478. b[x], E[b[x]]++, y--, 3 > y)
  4479. for (; 0 < y--;) C[G++] = b[x], E[b[x]]++;
  4480. else
  4481. for (; 0 < y;) F = 6 > y ? y : 6, F > y - 3 && F < y && (F = y - 3), C[G++] = 16, C[G++] = F - 3, E[16]++, y -= F
  4482. }
  4483. b = u ? C.subarray(0, G) : C.slice(0, G);
  4484. E = k(E, 7);
  4485. for (x = 0; 19 > x; x++) f[x] = E[A[x]];
  4486. for (z = 19; 4 < z && 0 === f[z - 1]; z--);
  4487. A = n(E);
  4488. l.d(s - 257, 5, B);
  4489. l.d(t - 1, 5, B);
  4490. l.d(z - 4, 4, B);
  4491. for (x = 0; x < z; x++) l.d(f[x], 3, B);
  4492. x = 0;
  4493. for (f = b.length; x < f; x++)
  4494. if (g = b[x], l.d(A[g], E[g], B), 16 <= g) {
  4495. x++;
  4496. switch (g) {
  4497. case 16:
  4498. m = 2;
  4499. break;
  4500. case 17:
  4501. m = 3;
  4502. break;
  4503. case 18:
  4504. m = 7;
  4505. break;
  4506. default:
  4507. c("invalid code: " + g)
  4508. }
  4509. l.d(b[x], m, B)
  4510. }
  4511. m = [D, q];
  4512. p = [p,
  4513. r
  4514. ];
  4515. g = m[0];
  4516. m = m[1];
  4517. r = p[0];
  4518. D = p[1];
  4519. p = 0;
  4520. for (f = e.length; p < f; ++p)
  4521. if (d = e[p], l.d(g[d], m[d], B), 256 < d) l.d(e[++p], e[++p], B), q = e[++p], l.d(r[q], D[q], B), l.d(e[++p], e[++p], B);
  4522. else if (256 === d) break;
  4523. this.a = l.finish();
  4524. this.b = this.a.length;
  4525. break;
  4526. default:
  4527. c("invalid compression type")
  4528. }
  4529. return this.a
  4530. };
  4531. D = [];
  4532. var G;
  4533. for (G = 3; 258 >= G; G++) z = f(), D[G] = z[2] << 24 | z[1] << 16 | z[0];
  4534. var M = u ? new Uint32Array(D) : D,
  4535. J = v;
  4536. q.prototype.n = function() {
  4537. var b, a, g, l, e = 0;
  4538. l = this.a;
  4539. b = O;
  4540. switch (b) {
  4541. case O:
  4542. a = Math.LOG2E * Math.log(32768) - 8;
  4543. break;
  4544. default:
  4545. c(Error("invalid compression method"))
  4546. }
  4547. a =
  4548. a << 4 | b;
  4549. l[e++] = a;
  4550. switch (b) {
  4551. case O:
  4552. switch (this.h) {
  4553. case J.NONE:
  4554. g = 0;
  4555. break;
  4556. case J.r:
  4557. g = 1;
  4558. break;
  4559. case J.j:
  4560. g = 2;
  4561. break;
  4562. default:
  4563. c(Error("unsupported compression type"))
  4564. }
  4565. break;
  4566. default:
  4567. c(Error("invalid compression method"))
  4568. }
  4569. b = g << 6 | 0;
  4570. l[e++] = b | 31 - (256 * a + b) % 31;
  4571. b = d(this.input);
  4572. this.z.b = e;
  4573. l = this.z.n();
  4574. e = l.length;
  4575. u && (l = new Uint8Array(l.buffer), l.length <= e + 4 && (this.a = new Uint8Array(l.length + 4), this.a.set(l), l = this.a), l = l.subarray(0, e + 4));
  4576. l[e++] = b >> 24 & 255;
  4577. l[e++] = b >> 16 & 255;
  4578. l[e++] = b >> 8 & 255;
  4579. l[e++] = b & 255;
  4580. return l
  4581. };
  4582. e("Zlib.Deflate",
  4583. q);
  4584. e("Zlib.Deflate.compress", function(b, a) {
  4585. return (new q(b, a)).n()
  4586. });
  4587. e("Zlib.Deflate.CompressionType", J);
  4588. e("Zlib.Deflate.CompressionType.NONE", J.NONE);
  4589. e("Zlib.Deflate.CompressionType.FIXED", J.r);
  4590. e("Zlib.Deflate.CompressionType.DYNAMIC", J.j);
  4591. var N = 0,
  4592. F = 1,
  4593. v = {
  4594. D: N,
  4595. C: F
  4596. };
  4597. p.prototype.p = function() {
  4598. for (; !this.s;) {
  4599. var b = r(this, 3);
  4600. b & 1 && (this.s = B);
  4601. b >>>= 1;
  4602. switch (b) {
  4603. case 0:
  4604. var b = this.input,
  4605. a = this.c,
  4606. g = this.a,
  4607. d = this.b,
  4608. l = w,
  4609. e = w,
  4610. m = w,
  4611. f = g.length,
  4612. l = w;
  4613. this.e = this.g = 0;
  4614. l = b[a++];
  4615. l === w && c(Error("invalid uncompressed block header: LEN (first byte)"));
  4616. e = l;
  4617. l = b[a++];
  4618. l === w && c(Error("invalid uncompressed block header: LEN (second byte)"));
  4619. e |= l << 8;
  4620. l = b[a++];
  4621. l === w && c(Error("invalid uncompressed block header: NLEN (first byte)"));
  4622. m = l;
  4623. l = b[a++];
  4624. l === w && c(Error("invalid uncompressed block header: NLEN (second byte)"));
  4625. m |= l << 8;
  4626. e === ~m && c(Error("invalid uncompressed block header: length verify"));
  4627. a + e > b.length && c(Error("input buffer is broken"));
  4628. switch (this.m) {
  4629. case N:
  4630. for (; d + e > g.length;) {
  4631. l = f - d;
  4632. e -= l;
  4633. if (u) g.set(b.subarray(a, a + l), d), d += l, a += l;
  4634. else
  4635. for (; l--;) g[d++] =
  4636. b[a++];
  4637. this.b = d;
  4638. g = this.f();
  4639. d = this.b
  4640. }
  4641. break;
  4642. case F:
  4643. for (; d + e > g.length;) g = this.f({
  4644. v: 2
  4645. });
  4646. break;
  4647. default:
  4648. c(Error("invalid inflate mode"))
  4649. }
  4650. if (u) g.set(b.subarray(a, a + e), d), d += e, a += e;
  4651. else
  4652. for (; e--;) g[d++] = b[a++];
  4653. this.c = a;
  4654. this.b = d;
  4655. this.a = g;
  4656. break;
  4657. case 1:
  4658. this.o(S, T);
  4659. break;
  4660. case 2:
  4661. t(this);
  4662. break;
  4663. default:
  4664. c(Error("unknown BTYPE: " + b))
  4665. }
  4666. }
  4667. return this.t()
  4668. };
  4669. D = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  4670. var K = u ? new Uint16Array(D) : D;
  4671. 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,
  4672. 258, 258, 258
  4673. ];
  4674. var I = u ? new Uint16Array(D) : D;
  4675. 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];
  4676. var P = u ? new Uint8Array(D) : D;
  4677. 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];
  4678. var R = u ? new Uint16Array(D) : D;
  4679. 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];
  4680. var Q = u ? new Uint8Array(D) : D;
  4681. D = new(u ? Uint8Array : Array)(288);
  4682. z = 0;
  4683. for (E = D.length; z < E; ++z) D[z] = 143 >= z ? 8 : 255 >= z ? 9 : 279 >= z ? 7 : 8;
  4684. var S = g(D);
  4685. D = new(u ? Uint8Array :
  4686. Array)(30);
  4687. z = 0;
  4688. for (E = D.length; z < E; ++z) D[z] = 5;
  4689. var T = g(D);
  4690. p.prototype.o = function(b, a) {
  4691. var c = this.a,
  4692. g = this.b;
  4693. this.u = b;
  4694. for (var d = c.length - 258, l, e, m; 256 !== (l = s(this, b));)
  4695. if (256 > l) g >= d && (this.b = g, c = this.f(), g = this.b), c[g++] = l;
  4696. else
  4697. for (l -= 257, m = I[l], 0 < P[l] && (m += r(this, P[l])), l = s(this, a), e = R[l], 0 < Q[l] && (e += r(this, Q[l])), g >= d && (this.b = g, c = this.f(), g = this.b); m--;) c[g] = c[g++-e];
  4698. for (; 8 <= this.e;) this.e -= 8, this.c--;
  4699. this.b = g
  4700. };
  4701. p.prototype.I = function(b, a) {
  4702. var c = this.a,
  4703. g = this.b;
  4704. this.u = b;
  4705. for (var d = c.length, l, e, m; 256 !==
  4706. (l = s(this, b));)
  4707. if (256 > l) g >= d && (c = this.f(), d = c.length), c[g++] = l;
  4708. else
  4709. for (l -= 257, m = I[l], 0 < P[l] && (m += r(this, P[l])), l = s(this, a), e = R[l], 0 < Q[l] && (e += r(this, Q[l])), g + m > d && (c = this.f(), d = c.length); m--;) c[g] = c[g++-e];
  4710. for (; 8 <= this.e;) this.e -= 8, this.c--;
  4711. this.b = g
  4712. };
  4713. p.prototype.f = function() {
  4714. var b = new(u ? Uint8Array : Array)(this.b - 32768),
  4715. a = this.b - 32768,
  4716. c, g, d = this.a;
  4717. if (u) b.set(d.subarray(32768, b.length));
  4718. else
  4719. for (c = 0, g = b.length; c < g; ++c) b[c] = d[c + 32768];
  4720. this.k.push(b);
  4721. this.q += b.length;
  4722. if (u) d.set(d.subarray(a, a + 32768));
  4723. else
  4724. for (c = 0; 32768 > c; ++c) d[c] = d[a + c];
  4725. this.b = 32768;
  4726. return d
  4727. };
  4728. p.prototype.J = function(b) {
  4729. var a, c = this.input.length / this.c + 1 | 0,
  4730. g, d, l, e = this.input,
  4731. m = this.a;
  4732. b && ("number" === typeof b.v && (c = b.v), "number" === typeof b.F && (c += b.F));
  4733. 2 > c ? (g = (e.length - this.c) / this.u[2], l = g / 2 * 258 | 0, d = l < m.length ? m.length + l : m.length << 1) : d = m.length * c;
  4734. u ? (a = new Uint8Array(d), a.set(m)) : a = m;
  4735. return this.a = a
  4736. };
  4737. p.prototype.t = function() {
  4738. var b = 0,
  4739. a = this.a,
  4740. c = this.k,
  4741. g, d = new(u ? Uint8Array : Array)(this.q + (this.b - 32768)),
  4742. l, e, m, f;
  4743. if (0 === c.length) return u ?
  4744. this.a.subarray(32768, this.b) : this.a.slice(32768, this.b);
  4745. l = 0;
  4746. for (e = c.length; l < e; ++l)
  4747. for (g = c[l], m = 0, f = g.length; m < f; ++m) d[b++] = g[m];
  4748. l = 32768;
  4749. for (e = this.b; l < e; ++l) d[b++] = a[l];
  4750. this.k = [];
  4751. return this.buffer = d
  4752. };
  4753. p.prototype.H = function() {
  4754. var b, a = this.b;
  4755. u ? 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);
  4756. return this.buffer = b
  4757. };
  4758. A.prototype.p = function() {
  4759. var b = this.input,
  4760. a, g;
  4761. a = this.A.p();
  4762. this.c = this.A.c;
  4763. this.M && (g = (b[this.c++] << 24 | b[this.c++] <<
  4764. 16 | b[this.c++] << 8 | b[this.c++]) >>> 0, g !== d(a) && c(Error("invalid adler-32 checksum")));
  4765. return a
  4766. };
  4767. e("Zlib.Inflate", A);
  4768. e("Zlib.Inflate.BufferType", v);
  4769. v.ADAPTIVE = v.C;
  4770. v.BLOCK = v.D;
  4771. e("Zlib.Inflate.prototype.decompress", A.prototype.p);
  4772. v = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  4773. u && new Uint16Array(v);
  4774. v = [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];
  4775. u && new Uint16Array(v);
  4776. v = [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];
  4777. u && new Uint8Array(v);
  4778. v = [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];
  4779. u && new Uint16Array(v);
  4780. v = [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];
  4781. u && new Uint8Array(v);
  4782. v = new(u ? Uint8Array : Array)(288);
  4783. D = 0;
  4784. for (z = v.length; D < z; ++D) v[D] = 143 >= D ? 8 : 255 >= D ? 9 : 279 >= D ? 7 : 8;
  4785. g(v);
  4786. v = new(u ? Uint8Array : Array)(30);
  4787. D = 0;
  4788. for (z = v.length; D < z; ++D) v[D] = 5;
  4789. g(v);
  4790. var O = 8
  4791. }).call(this);
  4792. (function(c) {
  4793. var e = function() {
  4794. function d() {}
  4795. d.parse = function(a) {
  4796. a = c.SAXParser.getInstance().parserXML(a);
  4797. if (!a || !a.childNodes) return null;
  4798. for (var b = a.childNodes.length, g = !1, l = 0; l < b; l++) {
  4799. var e = a.childNodes[l];
  4800. if (1 == e.nodeType) {
  4801. g = !0;
  4802. break
  4803. }
  4804. }
  4805. return g ? d.parseNode(e) : null
  4806. };
  4807. d.parseNode = function(a) {
  4808. if (!a || 1 != a.nodeType) return null;
  4809. var b = {};
  4810. b.localName = a.localName;
  4811. b.name = a.nodeName;
  4812. a.namespaceURI && (b.namespace = a.namespaceURI);
  4813. a.prefix && (b.prefix = a.prefix);
  4814. for (var c = a.attributes, l = c.length, e = 0; e < l; e++) {
  4815. var f =
  4816. c[e],
  4817. h = f.name;
  4818. 0 != h.indexOf("xmlns:") && (b["$" + h] = f.value)
  4819. }
  4820. c = a.childNodes;
  4821. l = c.length;
  4822. for (e = 0; e < l; e++)
  4823. if (f = d.parseNode(c[e])) b.children || (b.children = []), f.parent = b, b.children.push(f);
  4824. !b.children && (a = a.textContent.trim()) && (b.text = a);
  4825. return b
  4826. };
  4827. d.findChildren = function(a, b, c) {
  4828. c ? c.length = 0 : c = [];
  4829. d.findByPath(a, b, c);
  4830. return c
  4831. };
  4832. d.findByPath = function(a, b, c) {
  4833. var l = b.indexOf("."),
  4834. e; - 1 == l ? (e = b, l = !0) : (e = b.substring(0, l), b = b.substring(l + 1), l = !1);
  4835. if (a = a.children)
  4836. for (var f = a.length, h = 0; h < f; h++) {
  4837. var k = a[h];
  4838. k.localName ==
  4839. e && (l ? c.push(k) : d.findByPath(k, b, c))
  4840. }
  4841. };
  4842. d.getAttributes = function(a, b) {
  4843. b ? b.length = 0 : b = [];
  4844. for (var c in a) "$" == c.charAt(0) && b.push(c.substring(1));
  4845. return b
  4846. };
  4847. return d
  4848. }();
  4849. c.XML = e
  4850. })(egret || (egret = {}));
  4851. __extends = this.__extends || function(c, e) {
  4852. function d() {
  4853. this.constructor = c
  4854. }
  4855. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  4856. d.prototype = e.prototype;
  4857. c.prototype = new d
  4858. };
  4859. (function(c) {
  4860. var e = function(d) {
  4861. function a(b, a, c) {
  4862. d.call(this);
  4863. this._target = null;
  4864. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  4865. this._actions = this._steps = this.pluginData = null;
  4866. this.paused = !1;
  4867. this.duration = 0;
  4868. this._prevPos = -1;
  4869. this.position = null;
  4870. this._stepPosition = this._prevPosition = 0;
  4871. this.passive = !1;
  4872. this.initialize(b, a, c)
  4873. }
  4874. __extends(a, d);
  4875. a.get = function(b, c, d, e) {
  4876. "undefined" === typeof c && (c = null);
  4877. "undefined" === typeof d && (d = null);
  4878. "undefined" === typeof e && (e = !1);
  4879. e && a.removeTweens(b);
  4880. return new a(b, c, d)
  4881. };
  4882. a.removeTweens = function(b) {
  4883. if (b.tween_count) {
  4884. for (var c = a._tweens, d = c.length - 1; 0 <= d; d--) c[d]._target == b && (c[d].paused = !0, c.splice(d, 1));
  4885. b.tween_count = 0
  4886. }
  4887. };
  4888. a.tick = function(b, c) {
  4889. "undefined" === typeof c && (c = !1);
  4890. for (var d = a._tweens.concat(), e = d.length - 1; 0 <= e; e--) {
  4891. var f = d[e];
  4892. c && !f.ignoreGlobalPause || f.paused || f.tick(f._useTicks ? 1 : b)
  4893. }
  4894. };
  4895. a._register = function(b, g) {
  4896. var d = b._target,
  4897. e = a._tweens;
  4898. if (g) d && (d.tween_count = d.tween_count ? d.tween_count + 1 : 1), e.push(b), a._inited || (c.Ticker.getInstance().register(a.tick, null),
  4899. a._inited = !0);
  4900. else
  4901. for (d && d.tween_count--, d = e.length; d--;)
  4902. if (e[d] == b) {
  4903. e.splice(d, 1);
  4904. break
  4905. }
  4906. };
  4907. a.removeAllTweens = function() {
  4908. for (var b = a._tweens, c = 0, d = b.length; c < d; c++) {
  4909. var e = b[c];
  4910. e.paused = !0;
  4911. e._target.tweenjs_count = 0
  4912. }
  4913. b.length = 0
  4914. };
  4915. a.prototype.initialize = function(b, c, d) {
  4916. this._target = b;
  4917. 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));
  4918. this.pluginData = d || {};
  4919. this._curQueueProps = {};
  4920. this._initQueueProps = {};
  4921. this._steps = [];
  4922. this._actions = [];
  4923. c && c.paused ? this.paused = !0 : a._register(this, !0);
  4924. c && null != c.position && this.setPosition(c.position, a.NONE)
  4925. };
  4926. a.prototype.setPosition = function(b, a) {
  4927. "undefined" === typeof a && (a = 1);
  4928. 0 > b && (b = 0);
  4929. var c = b,
  4930. d = !1;
  4931. c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0));
  4932. if (c == this._prevPos) return d;
  4933. var e = this._prevPos;
  4934. this.position = this._prevPos = c;
  4935. this._prevPosition = b;
  4936. if (this._target)
  4937. if (d) this._updateTargetProps(null, 1);
  4938. else if (0 < this._steps.length) {
  4939. for (var h =
  4940. 0, k = this._steps.length; h < k && !(this._steps[h].t > c); h++);
  4941. h = this._steps[h - 1];
  4942. this._updateTargetProps(h, (this._stepPosition = c - h.t) / h.d)
  4943. }
  4944. 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));
  4945. d && this.setPaused(!0);
  4946. this.dispatchEventWith("change");
  4947. return d
  4948. };
  4949. a.prototype._runActions = function(b, a, c) {
  4950. "undefined" === typeof c && (c = !1);
  4951. var d = b,
  4952. e = a,
  4953. h = -1,
  4954. k = this._actions.length,
  4955. n = 1;
  4956. b > a && (d = a,
  4957. e = b, h = k, k = n = -1);
  4958. for (;
  4959. (h += n) != k;) {
  4960. a = this._actions[h];
  4961. var q = a.t;
  4962. (q == e || q > d && q < e || c && q == b) && a.f.apply(a.o, a.p)
  4963. }
  4964. };
  4965. a.prototype._updateTargetProps = function(b, c) {
  4966. var d, e, f, h;
  4967. if (b || 1 != c) {
  4968. if (this.passive = !!b.v) return;
  4969. b.e && (c = b.e(c, 0, 1, 1));
  4970. d = b.p0;
  4971. e = b.p1
  4972. } else this.passive = !1, d = e = this._curQueueProps;
  4973. for (var k in this._initQueueProps) {
  4974. null == (f = d[k]) && (d[k] = f = this._initQueueProps[k]);
  4975. null == (h = e[k]) && (e[k] = h = f);
  4976. f = f == h || 0 == c || 1 == c || "number" != typeof f ? 1 == c ? h : f : f + (h - f) * c;
  4977. var n = !1;
  4978. if (h = a._plugins[k])
  4979. for (var q = 0, p = h.length; q <
  4980. p; q++) {
  4981. var r = h[q].tween(this, k, f, d, e, c, !!b && d == e, !b);
  4982. r == a.IGNORE ? n = !0 : f = r
  4983. }
  4984. n || (this._target[k] = f)
  4985. }
  4986. };
  4987. a.prototype.setPaused = function(b) {
  4988. this.paused = b;
  4989. a._register(this, !b);
  4990. return this
  4991. };
  4992. a.prototype._cloneProps = function(b) {
  4993. var a = {},
  4994. c;
  4995. for (c in b) a[c] = b[c];
  4996. return a
  4997. };
  4998. a.prototype._addStep = function(b) {
  4999. 0 < b.d && (this._steps.push(b), b.t = this.duration, this.duration += b.d);
  5000. return this
  5001. };
  5002. a.prototype._appendQueueProps = function(b) {
  5003. var c, d, e, f, h, k;
  5004. for (k in b)
  5005. if (void 0 === this._initQueueProps[k]) {
  5006. d = this._target[k];
  5007. if (c = a._plugins[k])
  5008. for (e =
  5009. 0, f = c.length; e < f; e++) d = c[e].init(this, k, d);
  5010. this._initQueueProps[k] = this._curQueueProps[k] = void 0 === d ? null : d
  5011. }
  5012. for (k in b) {
  5013. d = this._curQueueProps[k];
  5014. if (c = a._plugins[k])
  5015. for (h = h || {}, e = 0, f = c.length; e < f; e++) c[e].step && c[e].step(this, k, d, b[k], h);
  5016. this._curQueueProps[k] = b[k]
  5017. }
  5018. h && this._appendQueueProps(h);
  5019. return this._curQueueProps
  5020. };
  5021. a.prototype._addAction = function(b) {
  5022. b.t = this.duration;
  5023. this._actions.push(b);
  5024. return this
  5025. };
  5026. a.prototype._set = function(b, a) {
  5027. for (var c in b) a[c] = b[c]
  5028. };
  5029. a.prototype.wait = function(b, a) {
  5030. "undefined" ===
  5031. typeof a && (a = !1);
  5032. if (null == b || 0 >= b) return this;
  5033. var c = this._cloneProps(this._curQueueProps);
  5034. return this._addStep({
  5035. d: b,
  5036. p0: c,
  5037. p1: c,
  5038. v: a
  5039. })
  5040. };
  5041. a.prototype.to = function(b, a, c) {
  5042. "undefined" === typeof c && (c = void 0);
  5043. if (isNaN(a) || 0 > a) a = 0;
  5044. return this._addStep({
  5045. d: a || 0,
  5046. p0: this._cloneProps(this._curQueueProps),
  5047. e: c,
  5048. p1: this._cloneProps(this._appendQueueProps(b))
  5049. })
  5050. };
  5051. a.prototype.call = function(b, a, c) {
  5052. "undefined" === typeof a && (a = void 0);
  5053. "undefined" === typeof c && (c = void 0);
  5054. return this._addAction({
  5055. f: b,
  5056. p: c ? c : [this],
  5057. o: a ? a : this._target
  5058. })
  5059. };
  5060. a.prototype.set = function(b, a) {
  5061. "undefined" === typeof a && (a = null);
  5062. return this._addAction({
  5063. f: this._set,
  5064. o: this,
  5065. p: [b, a ? a : this._target]
  5066. })
  5067. };
  5068. a.prototype.play = function(b) {
  5069. b || (b = this);
  5070. return this.call(b.setPaused, [!1], b)
  5071. };
  5072. a.prototype.pause = function(b) {
  5073. b || (b = this);
  5074. return this.call(b.setPaused, [!0], b)
  5075. };
  5076. a.prototype.tick = function(b) {
  5077. this.paused || this.setPosition(this._prevPosition + b)
  5078. };
  5079. a.NONE = 0;
  5080. a.LOOP = 1;
  5081. a.REVERSE = 2;
  5082. a._tweens = [];
  5083. a.IGNORE = {};
  5084. a._plugins = {};
  5085. a._inited = !1;
  5086. return a
  5087. }(c.EventDispatcher);
  5088. c.Tween = e
  5089. })(egret ||
  5090. (egret = {}));
  5091. (function(c) {
  5092. var e = function() {
  5093. function d() {
  5094. c.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  5095. }
  5096. d.get = function(a) {
  5097. -1 > a && (a = -1);
  5098. 1 < a && (a = 1);
  5099. return function(b) {
  5100. return 0 == a ? b : 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  5101. }
  5102. };
  5103. d.getPowIn = function(a) {
  5104. return function(b) {
  5105. return Math.pow(b, a)
  5106. }
  5107. };
  5108. d.getPowOut = function(a) {
  5109. return function(b) {
  5110. return 1 - Math.pow(1 - b, a)
  5111. }
  5112. };
  5113. d.getPowInOut = function(a) {
  5114. return function(b) {
  5115. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  5116. }
  5117. };
  5118. d.sineIn = function(a) {
  5119. return 1 - Math.cos(a *
  5120. Math.PI / 2)
  5121. };
  5122. d.sineOut = function(a) {
  5123. return Math.sin(a * Math.PI / 2)
  5124. };
  5125. d.sineInOut = function(a) {
  5126. return -0.5 * (Math.cos(Math.PI * a) - 1)
  5127. };
  5128. d.getBackIn = function(a) {
  5129. return function(b) {
  5130. return b * b * ((a + 1) * b - a)
  5131. }
  5132. };
  5133. d.getBackOut = function(a) {
  5134. return function(b) {
  5135. b -= 1;
  5136. return b * b * ((a + 1) * b + a) + 1
  5137. }
  5138. };
  5139. d.getBackInOut = function(a) {
  5140. a *= 1.525;
  5141. return function(b) {
  5142. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  5143. }
  5144. };
  5145. d.circIn = function(a) {
  5146. return -(Math.sqrt(1 - a * a) - 1)
  5147. };
  5148. d.circOut = function(a) {
  5149. return Math.sqrt(1 - a * a)
  5150. };
  5151. d.circInOut = function(a) {
  5152. return 1 >
  5153. (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  5154. };
  5155. d.bounceIn = function(a) {
  5156. return 1 - d.bounceOut(1 - a)
  5157. };
  5158. d.bounceOut = function(a) {
  5159. 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
  5160. };
  5161. d.bounceInOut = function(a) {
  5162. return 0.5 > a ? 0.5 * d.bounceIn(2 * a) : 0.5 * d.bounceOut(2 * a - 1) + 0.5
  5163. };
  5164. d.getElasticIn = function(a, b) {
  5165. var c = 2 * Math.PI;
  5166. return function(d) {
  5167. if (0 == d || 1 == d) return d;
  5168. var e = b / c * Math.asin(1 / a);
  5169. return -(a * Math.pow(2, 10 *
  5170. (d -= 1)) * Math.sin((d - e) * c / b))
  5171. }
  5172. };
  5173. d.getElasticOut = function(a, b) {
  5174. var c = 2 * Math.PI;
  5175. return function(d) {
  5176. if (0 == d || 1 == d) return d;
  5177. var e = b / c * Math.asin(1 / a);
  5178. return a * Math.pow(2, -10 * d) * Math.sin((d - e) * c / b) + 1
  5179. }
  5180. };
  5181. d.getElasticInOut = function(a, b) {
  5182. var c = 2 * Math.PI;
  5183. return function(d) {
  5184. var e = b / c * Math.asin(1 / a);
  5185. 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
  5186. }
  5187. };
  5188. d.quadIn = d.getPowIn(2);
  5189. d.quadOut = d.getPowOut(2);
  5190. d.quadInOut = d.getPowInOut(2);
  5191. d.cubicIn = d.getPowIn(3);
  5192. d.cubicOut = d.getPowOut(3);
  5193. d.cubicInOut = d.getPowInOut(3);
  5194. d.quartIn = d.getPowIn(4);
  5195. d.quartOut = d.getPowOut(4);
  5196. d.quartInOut = d.getPowInOut(4);
  5197. d.quintIn = d.getPowIn(5);
  5198. d.quintOut = d.getPowOut(5);
  5199. d.quintInOut = d.getPowInOut(5);
  5200. d.backIn = d.getBackIn(1.7);
  5201. d.backOut = d.getBackOut(1.7);
  5202. d.backInOut = d.getBackInOut(1.7);
  5203. d.elasticIn = d.getElasticIn(1, 0.3);
  5204. d.elasticOut = d.getElasticOut(1, 0.3);
  5205. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  5206. return d
  5207. }();
  5208. c.Ease = e
  5209. })(egret || (egret = {}));
  5210. (function(c) {
  5211. var e = function() {
  5212. function c() {}
  5213. c.prototype.play = function(a) {
  5214. "undefined" === typeof a && (a = !1);
  5215. var b = this.audio;
  5216. b && (isNaN(b.duration) || (b.currentTime = 0), b.loop = a, b.play())
  5217. };
  5218. c.prototype.pause = function() {
  5219. var a = this.audio;
  5220. a && a.pause()
  5221. };
  5222. c.prototype.load = function() {
  5223. var a = this.audio;
  5224. a && a.load()
  5225. };
  5226. c.prototype.addEventListener = function(a, b) {
  5227. this.audio && this.audio.addEventListener(a, b, !1)
  5228. };
  5229. c.prototype.removeEventListener = function(a, b) {
  5230. this.audio && this.audio.removeEventListener(a, b, !1)
  5231. };
  5232. c.prototype.setVolume =
  5233. function(a) {
  5234. var b = this.audio;
  5235. b && (b.volume = a)
  5236. };
  5237. c.prototype.getVolume = function() {
  5238. return this.audio ? this.audio.volume : 0
  5239. };
  5240. return c
  5241. }();
  5242. c.Sound = e
  5243. })(egret || (egret = {}));
  5244. __extends = this.__extends || function(c, e) {
  5245. function d() {
  5246. this.constructor = c
  5247. }
  5248. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5249. d.prototype = e.prototype;
  5250. c.prototype = new d
  5251. };
  5252. (function(c) {
  5253. var e = function(d) {
  5254. function a(b) {
  5255. "undefined" === typeof b && (b = null);
  5256. d.call(this);
  5257. this._source = b ? b : []
  5258. }
  5259. __extends(a, d);
  5260. Object.defineProperty(a.prototype, "source", {
  5261. get: function() {
  5262. return this._source
  5263. },
  5264. set: function(b) {
  5265. b || (b = []);
  5266. this._source = b;
  5267. this.dispatchCoEvent(c.CollectionEventKind.RESET)
  5268. },
  5269. enumerable: !0,
  5270. configurable: !0
  5271. });
  5272. a.prototype.refresh = function() {
  5273. this.dispatchCoEvent(c.CollectionEventKind.REFRESH)
  5274. };
  5275. a.prototype.contains = function(b) {
  5276. return -1 != this.getItemIndex(b)
  5277. };
  5278. a.prototype.checkIndex =
  5279. function(b) {
  5280. if (0 > b || b >= this._source.length) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  5281. };
  5282. Object.defineProperty(a.prototype, "length", {
  5283. get: function() {
  5284. return this._source.length
  5285. },
  5286. enumerable: !0,
  5287. configurable: !0
  5288. });
  5289. a.prototype.addItem = function(b) {
  5290. this._source.push(b);
  5291. this.dispatchCoEvent(c.CollectionEventKind.ADD, this._source.length - 1, -1, [b])
  5292. };
  5293. a.prototype.addItemAt = function(b, a) {
  5294. if (0 > a || a > this._source.length) throw new RangeError('\u7d22\u5f15:"' +
  5295. a + '"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  5296. this._source.splice(a, 0, b);
  5297. this.dispatchCoEvent(c.CollectionEventKind.ADD, a, -1, [b])
  5298. };
  5299. a.prototype.getItemAt = function(b) {
  5300. return this._source[b]
  5301. };
  5302. a.prototype.getItemIndex = function(b) {
  5303. for (var a = this._source.length, c = 0; c < a; c++)
  5304. if (this._source[c] === b) return c;
  5305. return -1
  5306. };
  5307. a.prototype.itemUpdated = function(b) {
  5308. var a = this.getItemIndex(b); - 1 != a && this.dispatchCoEvent(c.CollectionEventKind.UPDATE, a, -1, [b])
  5309. };
  5310. a.prototype.removeAll = function() {
  5311. var b =
  5312. this._source.concat();
  5313. this._source.length = 0;
  5314. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, 0, -1, b)
  5315. };
  5316. a.prototype.removeItemAt = function(b) {
  5317. this.checkIndex(b);
  5318. var a = this._source.splice(b, 1)[0];
  5319. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, b, -1, [a]);
  5320. return a
  5321. };
  5322. a.prototype.replaceItemAt = function(b, a) {
  5323. this.checkIndex(a);
  5324. var d = this._source.splice(a, 1, b)[0];
  5325. this.dispatchCoEvent(c.CollectionEventKind.REPLACE, a, -1, [b], [d]);
  5326. return d
  5327. };
  5328. a.prototype.replaceAll = function(b) {
  5329. b || (b = []);
  5330. for (var a = b.length, c = this._source.length,
  5331. d = a; d < c; d++) this.removeItemAt(a);
  5332. for (d = 0; d < a; d++) d >= c ? this.addItemAt(b[d], d) : this.replaceItemAt(b[d], d);
  5333. this._source = b
  5334. };
  5335. a.prototype.moveItemAt = function(b, a) {
  5336. this.checkIndex(b);
  5337. this.checkIndex(a);
  5338. var d = this._source.splice(b, 1)[0];
  5339. this._source.splice(a, 0, d);
  5340. this.dispatchCoEvent(c.CollectionEventKind.MOVE, a, b, [d]);
  5341. return d
  5342. };
  5343. a.prototype.dispatchCoEvent = function(b, a, d, e, f) {
  5344. "undefined" === typeof b && (b = null);
  5345. "undefined" === typeof a && (a = -1);
  5346. "undefined" === typeof d && (d = -1);
  5347. "undefined" === typeof e && (e = null);
  5348. "undefined" ===
  5349. typeof f && (f = null);
  5350. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, f)
  5351. };
  5352. return a
  5353. }(c.EventDispatcher);
  5354. c.ArrayCollection = e
  5355. })(egret || (egret = {}));
  5356. __extends = this.__extends || function(c, e) {
  5357. function d() {
  5358. this.constructor = c
  5359. }
  5360. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5361. d.prototype = e.prototype;
  5362. c.prototype = new d
  5363. };
  5364. (function(c) {
  5365. var e = function(d) {
  5366. function a(b, a) {
  5367. "undefined" === typeof b && (b = "children");
  5368. "undefined" === typeof a && (a = "parent");
  5369. d.call(this);
  5370. this.nodeList = [];
  5371. this._openNodes = [];
  5372. this._showRoot = !1;
  5373. this.childrenKey = b;
  5374. this.parentKey = a
  5375. }
  5376. __extends(a, d);
  5377. Object.defineProperty(a.prototype, "source", {
  5378. get: function() {
  5379. return this._source
  5380. },
  5381. set: function(b) {
  5382. this._source = b;
  5383. this._openNodes = [];
  5384. this.nodeList = [];
  5385. this._source && (this._showRoot ? this.nodeList.push(this._source) : (this._openNodes = [this._source], this.addChildren(this._source,
  5386. this.nodeList)));
  5387. this.dispatchCoEvent(c.CollectionEventKind.RESET)
  5388. },
  5389. enumerable: !0,
  5390. configurable: !0
  5391. });
  5392. Object.defineProperty(a.prototype, "openNodes", {
  5393. get: function() {
  5394. return this._openNodes.concat()
  5395. },
  5396. set: function(b) {
  5397. this._openNodes = b ? b.concat() : [];
  5398. this.refresh()
  5399. },
  5400. enumerable: !0,
  5401. configurable: !0
  5402. });
  5403. Object.defineProperty(a.prototype, "length", {
  5404. get: function() {
  5405. return this.nodeList.length
  5406. },
  5407. enumerable: !0,
  5408. configurable: !0
  5409. });
  5410. a.prototype.getItemAt = function(b) {
  5411. return this.nodeList[b]
  5412. };
  5413. a.prototype.getItemIndex = function(b) {
  5414. for (var a =
  5415. this.nodeList.length, c = 0; c < a; c++)
  5416. if (this.nodeList[c] === b) return c;
  5417. return -1
  5418. };
  5419. a.prototype.itemUpdated = function(b) {
  5420. var a = this.getItemIndex(b); - 1 != a && this.dispatchCoEvent(c.CollectionEventKind.UPDATE, a, -1, [b])
  5421. };
  5422. a.prototype.removeItem = function(b) {
  5423. this.isItemOpen(b) && this.closeNode(b);
  5424. if (b) {
  5425. var a = b[this.parentKey];
  5426. if (a && (a = a[this.childrenKey])) {
  5427. var d = a.indexOf(b); - 1 != d && a.splice(d, 1);
  5428. b[this.parentKey] = null;
  5429. d = this.nodeList.indexOf(b); - 1 != d && (this.nodeList.splice(d, 1), this.dispatchCoEvent(c.CollectionEventKind.REMOVE,
  5430. d, -1, [b]))
  5431. }
  5432. }
  5433. };
  5434. Object.defineProperty(a.prototype, "showRoot", {
  5435. get: function() {
  5436. return this._showRoot
  5437. },
  5438. set: function(b) {
  5439. 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()))
  5440. },
  5441. enumerable: !0,
  5442. configurable: !0
  5443. });
  5444. a.prototype.addChildren = function(b, a) {
  5445. if (b.hasOwnProperty(this.childrenKey) && -1 != this._openNodes.indexOf(b))
  5446. for (var c = b[this.childrenKey],
  5447. d = c.length, e = 0; e < d; e++) {
  5448. var h = c[e];
  5449. a.push(h);
  5450. this.addChildren(h, a)
  5451. }
  5452. };
  5453. a.prototype.hasChildren = function(b) {
  5454. return b.hasOwnProperty(this.childrenKey) ? 0 < b[this.childrenKey].length : !1
  5455. };
  5456. a.prototype.isItemOpen = function(b) {
  5457. return -1 != this._openNodes.indexOf(b)
  5458. };
  5459. a.prototype.expandItem = function(b, a) {
  5460. "undefined" === typeof a && (a = !0);
  5461. a ? this.openNode(b) : this.closeNode(b)
  5462. };
  5463. a.prototype.openNode = function(b) {
  5464. if (-1 == this._openNodes.indexOf(b)) {
  5465. this._openNodes.push(b);
  5466. var a = this.nodeList.indexOf(b);
  5467. if (-1 != a) {
  5468. var d = [];
  5469. this.addChildren(b, d);
  5470. for (var e = a; d.length;) {
  5471. e++;
  5472. var f = d.shift();
  5473. this.nodeList.splice(e, 0, f);
  5474. this.dispatchCoEvent(c.CollectionEventKind.ADD, e, -1, [f])
  5475. }
  5476. this.dispatchCoEvent("open", a, a, [b])
  5477. }
  5478. }
  5479. };
  5480. a.prototype.closeNode = function(b) {
  5481. var a = this._openNodes.indexOf(b);
  5482. if (-1 != a) {
  5483. var d = [];
  5484. this.addChildren(b, d);
  5485. this._openNodes.splice(a, 1);
  5486. a = this.nodeList.indexOf(b);
  5487. if (-1 != a) {
  5488. for (a++; d.length;) {
  5489. var e = this.nodeList.splice(a, 1)[0];
  5490. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, a, -1, [e]);
  5491. d.shift()
  5492. }
  5493. a--;
  5494. this.dispatchCoEvent(c.CollectionEventKind.CLOSE,
  5495. a, a, [b])
  5496. }
  5497. }
  5498. };
  5499. a.prototype.getDepth = function(b) {
  5500. var a = 0;
  5501. for (b = b[this.parentKey]; b;) a++, b = b[this.parentKey];
  5502. 0 < a && !this._showRoot && a--;
  5503. return a
  5504. };
  5505. a.prototype.refresh = function() {
  5506. this.nodeList = [];
  5507. this._source && (this._showRoot && this.nodeList.push(this._source), this.addChildren(this._source, this.nodeList));
  5508. this.dispatchCoEvent(c.CollectionEventKind.REFRESH)
  5509. };
  5510. a.prototype.dispatchCoEvent = function(b, a, d, e, f) {
  5511. "undefined" === typeof b && (b = null);
  5512. "undefined" === typeof a && (a = -1);
  5513. "undefined" === typeof d && (d = -1);
  5514. "undefined" ===
  5515. typeof e && (e = null);
  5516. "undefined" === typeof f && (f = null);
  5517. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, f)
  5518. };
  5519. a.assignParent = function(b, c, d) {
  5520. "undefined" === typeof c && (c = "children");
  5521. "undefined" === typeof d && (d = "parent");
  5522. if (b.hasOwnProperty(c))
  5523. for (var e = b[c], f = e.length, h = 0; h < f; h++) {
  5524. var k = e[h];
  5525. try {
  5526. k[d] = b
  5527. } catch (n) {}
  5528. a.assignParent(k, c, d)
  5529. }
  5530. };
  5531. return a
  5532. }(c.EventDispatcher);
  5533. c.ObjectCollection = e
  5534. })(egret || (egret = {}));
  5535. __extends = this.__extends || function(c, e) {
  5536. function d() {
  5537. this.constructor = c
  5538. }
  5539. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5540. d.prototype = e.prototype;
  5541. c.prototype = new d
  5542. };
  5543. (function(c) {
  5544. var e = function(d) {
  5545. function a() {
  5546. d.call(this);
  5547. this.targetLevel = Number.MAX_VALUE;
  5548. this.updateCompleteQueue = new c.DepthQueue;
  5549. this.invalidateClientPropertiesFlag = this.invalidatePropertiesFlag = !1;
  5550. this.invalidatePropertiesQueue = new c.DepthQueue;
  5551. this.invalidateClientSizeFlag = this.invalidateSizeFlag = !1;
  5552. this.invalidateSizeQueue = new c.DepthQueue;
  5553. this.invalidateDisplayListFlag = !1;
  5554. this.invalidateDisplayListQueue = new c.DepthQueue;
  5555. this.listenersAttached = !1
  5556. }
  5557. __extends(a, d);
  5558. a.prototype.invalidateProperties =
  5559. function(b) {
  5560. this.invalidatePropertiesFlag || (this.invalidatePropertiesFlag = !0, this.listenersAttached || this.attachListeners());
  5561. this.targetLevel <= b.nestLevel && (this.invalidateClientPropertiesFlag = !0);
  5562. this.invalidatePropertiesQueue.insert(b)
  5563. };
  5564. a.prototype.validateProperties = function() {
  5565. for (var b = this.invalidatePropertiesQueue.shift(); b;) b.parent && (b.validateProperties(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)), b = this.invalidatePropertiesQueue.shift();
  5566. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1)
  5567. };
  5568. a.prototype.invalidateSize = function(b) {
  5569. this.invalidateSizeFlag || (this.invalidateSizeFlag = !0, this.listenersAttached || this.attachListeners());
  5570. this.targetLevel <= b.nestLevel && (this.invalidateClientSizeFlag = !0);
  5571. this.invalidateSizeQueue.insert(b)
  5572. };
  5573. a.prototype.validateSize = function() {
  5574. for (var b = this.invalidateSizeQueue.pop(); b;) b.parent && (b.validateSize(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)), b = this.invalidateSizeQueue.pop();
  5575. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1)
  5576. };
  5577. a.prototype.invalidateDisplayList = function(b) {
  5578. this.invalidateDisplayListFlag || (this.invalidateDisplayListFlag = !0, this.listenersAttached || this.attachListeners());
  5579. this.invalidateDisplayListQueue.insert(b)
  5580. };
  5581. a.prototype.validateDisplayList = function() {
  5582. for (var b = this.invalidateDisplayListQueue.shift(); b;) b.parent && (b.validateDisplayList(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b),
  5583. b.updateCompletePendingFlag = !0)), b = this.invalidateDisplayListQueue.shift();
  5584. this.invalidateDisplayListQueue.isEmpty() && (this.invalidateDisplayListFlag = !1)
  5585. };
  5586. a.prototype.attachListeners = function() {
  5587. c.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.doPhasedInstantiationCallBack, this);
  5588. c.UIGlobals.stage.addEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  5589. c.UIGlobals.stage.invalidate();
  5590. this.listenersAttached = !0
  5591. };
  5592. a.prototype.doPhasedInstantiationCallBack = function(b) {
  5593. c.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME,
  5594. this.doPhasedInstantiationCallBack, this);
  5595. c.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  5596. this.doPhasedInstantiation()
  5597. };
  5598. a.prototype.doPhasedInstantiation = function() {
  5599. this.invalidatePropertiesFlag && this.validateProperties();
  5600. this.invalidateSizeFlag && this.validateSize();
  5601. this.invalidateDisplayListFlag && this.validateDisplayList();
  5602. if (this.invalidatePropertiesFlag || this.invalidateSizeFlag || this.invalidateDisplayListFlag) this.attachListeners();
  5603. else {
  5604. this.listenersAttached = !1;
  5605. for (var b = this.updateCompleteQueue.pop(); b;) b.initialized || (b.initialized = !0), b.hasEventListener(c.UIEvent.UPDATE_COMPLETE) && c.UIEvent.dispatchUIEvent(b, c.UIEvent.UPDATE_COMPLETE), b.updateCompletePendingFlag = !1, b = this.updateCompleteQueue.pop();
  5606. c.UIEvent.dispatchUIEvent(this, c.UIEvent.UPDATE_COMPLETE)
  5607. }
  5608. };
  5609. a.prototype.validateNow = function() {
  5610. for (var b = 0; this.listenersAttached && 100 > b++;) this.doPhasedInstantiationCallBack()
  5611. };
  5612. a.prototype.validateClient = function(b, a) {
  5613. "undefined" === typeof a && (a = !1);
  5614. var d,
  5615. e = !1,
  5616. f = this.targetLevel;
  5617. this.targetLevel == Number.MAX_VALUE && (this.targetLevel = b.nestLevel);
  5618. for (; !e;) {
  5619. e = !0;
  5620. for (d = this.invalidatePropertiesQueue.removeSmallestChild(b); d;) d.parent && (d.validateProperties(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0)), d = this.invalidatePropertiesQueue.removeSmallestChild(b);
  5621. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1);
  5622. this.invalidateClientPropertiesFlag = !1;
  5623. for (d = this.invalidateSizeQueue.removeLargestChild(b); d;) {
  5624. d.parent &&
  5625. (d.validateSize(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0));
  5626. if (this.invalidateClientPropertiesFlag && (d = this.invalidatePropertiesQueue.removeSmallestChild(b))) {
  5627. this.invalidatePropertiesQueue.insert(d);
  5628. e = !1;
  5629. break
  5630. }
  5631. d = this.invalidateSizeQueue.removeLargestChild(b)
  5632. }
  5633. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1);
  5634. this.invalidateClientSizeFlag = this.invalidateClientPropertiesFlag = !1;
  5635. if (!a) {
  5636. for (d = this.invalidateDisplayListQueue.removeSmallestChild(b); d;) {
  5637. d.parent &&
  5638. (d.validateDisplayList(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0));
  5639. if (this.invalidateClientPropertiesFlag && (d = this.invalidatePropertiesQueue.removeSmallestChild(b))) {
  5640. this.invalidatePropertiesQueue.insert(d);
  5641. e = !1;
  5642. break
  5643. }
  5644. if (this.invalidateClientSizeFlag && (d = this.invalidateSizeQueue.removeLargestChild(b))) {
  5645. this.invalidateSizeQueue.insert(d);
  5646. e = !1;
  5647. break
  5648. }
  5649. d = this.invalidateDisplayListQueue.removeSmallestChild(b)
  5650. }
  5651. this.invalidateDisplayListQueue.isEmpty() &&
  5652. (this.invalidateDisplayListFlag = !1)
  5653. }
  5654. }
  5655. if (f == Number.MAX_VALUE && (this.targetLevel = Number.MAX_VALUE, !a))
  5656. for (d = this.updateCompleteQueue.removeLargestChild(b); d;) d.initialized || (d.initialized = !0), d.hasEventListener(c.UIEvent.UPDATE_COMPLETE) && c.UIEvent.dispatchUIEvent(d, c.UIEvent.UPDATE_COMPLETE), d.updateCompletePendingFlag = !1, d = this.updateCompleteQueue.removeLargestChild(b)
  5657. };
  5658. return a
  5659. }(c.EventDispatcher);
  5660. c.LayoutManager = e
  5661. })(egret || (egret = {}));
  5662. (function(c) {
  5663. var e = function() {
  5664. function a() {
  5665. this.depthBins = [];
  5666. this.minDepth = 0;
  5667. this.maxDepth = -1
  5668. }
  5669. a.prototype.insert = function(b) {
  5670. var a = b.nestLevel,
  5671. c = b.hashCode;
  5672. this.maxDepth < this.minDepth ? this.minDepth = this.maxDepth = a : (a < this.minDepth && (this.minDepth = a), a > this.maxDepth && (this.maxDepth = a));
  5673. var e = this.depthBins[a];
  5674. e ? null == e.items[c] && (e.items[c] = b, e.length++) : (e = new d, this.depthBins[a] = e, e.items[c] = b, e.length++)
  5675. };
  5676. a.prototype.pop = function() {
  5677. var b = null;
  5678. if (this.minDepth <= this.maxDepth) {
  5679. for (var a = this.depthBins[this.maxDepth]; !a ||
  5680. 0 == a.length;) {
  5681. this.maxDepth--;
  5682. if (this.maxDepth < this.minDepth) return null;
  5683. a = this.depthBins[this.maxDepth]
  5684. }
  5685. var c = a.items,
  5686. d;
  5687. for (d in c) {
  5688. b = c[d];
  5689. this.remove(b, this.maxDepth);
  5690. break
  5691. }
  5692. for (; !a || 0 == a.length;) {
  5693. this.maxDepth--;
  5694. if (this.maxDepth < this.minDepth) break;
  5695. a = this.depthBins[this.maxDepth]
  5696. }
  5697. }
  5698. return b
  5699. };
  5700. a.prototype.shift = function() {
  5701. var b = null;
  5702. if (this.minDepth <= this.maxDepth) {
  5703. for (var a = this.depthBins[this.minDepth]; !a || 0 == a.length;) {
  5704. this.minDepth++;
  5705. if (this.minDepth > this.maxDepth) return null;
  5706. a = this.depthBins[this.minDepth]
  5707. }
  5708. var c =
  5709. a.items,
  5710. d;
  5711. for (d in c) {
  5712. b = c[d];
  5713. this.remove(b, this.minDepth);
  5714. break
  5715. }
  5716. for (; !a || 0 == a.length;) {
  5717. this.minDepth++;
  5718. if (this.minDepth > this.maxDepth) break;
  5719. a = this.depthBins[this.minDepth]
  5720. }
  5721. }
  5722. return b
  5723. };
  5724. a.prototype.removeLargestChild = function(b) {
  5725. for (var a = this.maxDepth, d = b.nestLevel, e = b.hashCode; d <= a;) {
  5726. var f = this.depthBins[a];
  5727. if (f && 0 < f.length) {
  5728. if (a == b.nestLevel) {
  5729. if (f.items[e]) return this.remove(b, a), b
  5730. } else {
  5731. var f = f.items,
  5732. h;
  5733. for (h in f) {
  5734. var k = f[h];
  5735. if (k instanceof c.DisplayObject && b instanceof c.DisplayObjectContainer &&
  5736. b.contains(k)) return this.remove(k, a), k
  5737. }
  5738. }
  5739. a--
  5740. } else if (a == this.maxDepth && this.maxDepth--, a--, a < d) break
  5741. }
  5742. return null
  5743. };
  5744. a.prototype.removeSmallestChild = function(b) {
  5745. for (var a = b.nestLevel, d = b.hashCode; a <= this.maxDepth;) {
  5746. var e = this.depthBins[a];
  5747. if (e && 0 < e.length) {
  5748. if (a == b.nestLevel) {
  5749. if (e.items[d]) return this.remove(b, a), b
  5750. } else {
  5751. var e = e.items,
  5752. f;
  5753. for (f in e) {
  5754. var h = e[f];
  5755. if (h instanceof c.DisplayObject && b instanceof c.DisplayObjectContainer && b.contains(h)) return this.remove(h, a), h
  5756. }
  5757. }
  5758. a++
  5759. } else if (a == this.minDepth && this.minDepth++,
  5760. a++, a > this.maxDepth) break
  5761. }
  5762. return null
  5763. };
  5764. a.prototype.remove = function(b, a) {
  5765. "undefined" === typeof a && (a = -1);
  5766. var c = b.hashCode,
  5767. d = this.depthBins[0 <= a ? a : b.nestLevel];
  5768. return d && null != d.items[c] ? (delete d.items[c], d.length--, b) : null
  5769. };
  5770. a.prototype.removeAll = function() {
  5771. this.minDepth = this.depthBins.length = 0;
  5772. this.maxDepth = -1
  5773. };
  5774. a.prototype.isEmpty = function() {
  5775. return this.minDepth > this.maxDepth
  5776. };
  5777. return a
  5778. }();
  5779. c.DepthQueue = e;
  5780. var d = function() {
  5781. return function() {
  5782. this.length = 0;
  5783. this.items = []
  5784. }
  5785. }();
  5786. c.DepthBin = d
  5787. })(egret || (egret = {}));
  5788. (function(c) {
  5789. var e = function() {
  5790. function d() {}
  5791. Object.defineProperty(d, "stage", {
  5792. get: function() {
  5793. return d._stage
  5794. },
  5795. enumerable: !0,
  5796. configurable: !0
  5797. });
  5798. d._initlize = function(a) {
  5799. d.initlized || (d._stage = a, d._layoutManager = new c.LayoutManager, d.initlized = !0)
  5800. };
  5801. Object.defineProperty(d, "uiStage", {
  5802. get: function() {
  5803. return d._uiStage
  5804. },
  5805. enumerable: !0,
  5806. configurable: !0
  5807. });
  5808. d.initlized = !1;
  5809. return d
  5810. }();
  5811. c.UIGlobals = e
  5812. })(egret || (egret = {}));
  5813. __extends = this.__extends || function(c, e) {
  5814. function d() {
  5815. this.constructor = c
  5816. }
  5817. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5818. d.prototype = e.prototype;
  5819. c.prototype = new d
  5820. };
  5821. (function(c) {
  5822. var e = function(d) {
  5823. function a() {
  5824. d.call(this);
  5825. this.initializeCalled = this._initialized = this._updateCompletePendingFlag = !1;
  5826. this._nestLevel = 0;
  5827. this._enabled = !0;
  5828. this._minWidth = this._height = this._width = 0;
  5829. this._maxWidth = 1E4;
  5830. this._minHeight = 0;
  5831. this._maxHeight = 1E4;
  5832. this._measuredHeight = this._measuredWidth = 0;
  5833. this._validateNowFlag = this._invalidateDisplayListFlag = this._invalidateSizeFlag = this._invalidatePropertiesFlag = !1;
  5834. this._includeInLayout = !0;
  5835. this._layoutHeightExplicitlySet = this._layoutWidthExplicitlySet = !1;
  5836. this.touchEnabled = !0;
  5837. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  5838. this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this)
  5839. }
  5840. __extends(a, d);
  5841. a.prototype.onAddedToStage = function(b) {
  5842. this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  5843. this._initialize();
  5844. c.UIGlobals._initlize(this.stage);
  5845. 0 < this._nestLevel && this.checkInvalidateFlag()
  5846. };
  5847. Object.defineProperty(a.prototype, "id", {
  5848. get: function() {
  5849. return this._id
  5850. },
  5851. set: function(b) {
  5852. this._id = b
  5853. },
  5854. enumerable: !0,
  5855. configurable: !0
  5856. });
  5857. Object.defineProperty(a.prototype, "isPopUp", {
  5858. get: function() {
  5859. return this._isPopUp
  5860. },
  5861. set: function(b) {
  5862. this._isPopUp = b
  5863. },
  5864. enumerable: !0,
  5865. configurable: !0
  5866. });
  5867. Object.defineProperty(a.prototype, "owner", {
  5868. get: function() {
  5869. return this._owner ? this._owner : this.parent
  5870. },
  5871. enumerable: !0,
  5872. configurable: !0
  5873. });
  5874. a.prototype.ownerChanged = function(b) {
  5875. this._owner = b
  5876. };
  5877. Object.defineProperty(a.prototype, "updateCompletePendingFlag", {
  5878. get: function() {
  5879. return this._updateCompletePendingFlag
  5880. },
  5881. set: function(b) {
  5882. this._updateCompletePendingFlag =
  5883. b
  5884. },
  5885. enumerable: !0,
  5886. configurable: !0
  5887. });
  5888. Object.defineProperty(a.prototype, "initialized", {
  5889. get: function() {
  5890. return this._initialized
  5891. },
  5892. set: function(b) {
  5893. this._initialized != b && (this._initialized = b) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.CREATION_COMPLETE)
  5894. },
  5895. enumerable: !0,
  5896. configurable: !0
  5897. });
  5898. a.prototype._initialize = function() {
  5899. 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),
  5900. this.createChildren(), this.childrenCreated())
  5901. };
  5902. a.prototype.createChildren = function() {};
  5903. a.prototype.childrenCreated = function() {
  5904. this.invalidateProperties();
  5905. this.invalidateSize();
  5906. this.invalidateDisplayList()
  5907. };
  5908. Object.defineProperty(a.prototype, "nestLevel", {
  5909. get: function() {
  5910. return this._nestLevel
  5911. },
  5912. set: function(b) {
  5913. if (this._nestLevel != b)
  5914. 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,
  5915. this), b = this.numChildren - 1; 0 <= b; b--) {
  5916. var a = this.getChildAt(b);
  5917. null != a && (a.nestLevel = this._nestLevel + 1)
  5918. }
  5919. },
  5920. enumerable: !0,
  5921. configurable: !0
  5922. });
  5923. a.prototype._addToDisplayList = function(b, a) {
  5924. "undefined" === typeof a && (a = !0);
  5925. var c = this.numChildren;
  5926. b.parent == this && c--;
  5927. this._addingChild(b);
  5928. this._doAddChild(b, c, a);
  5929. this._childAdded(b);
  5930. return b
  5931. };
  5932. a.prototype._addToDisplayListAt = function(b, a, c) {
  5933. "undefined" === typeof c && (c = !0);
  5934. this._addingChild(b);
  5935. this._doAddChild(b, a, c);
  5936. this._childAdded(b);
  5937. return b
  5938. };
  5939. a.prototype._removeFromDisplayList =
  5940. function(b, a) {
  5941. "undefined" === typeof a && (a = !0);
  5942. var d = this._children.indexOf(b);
  5943. if (0 <= d) return this._doRemoveChild(d, a), this._childRemoved(b), b;
  5944. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  5945. return null
  5946. };
  5947. a.prototype._removeFromDisplayListAt = function(b, a) {
  5948. "undefined" === typeof a && (a = !0);
  5949. if (0 <= b && b < this._children.length) {
  5950. var d = this._doRemoveChild(b, a);
  5951. this._childRemoved(d);
  5952. return d
  5953. }
  5954. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  5955. return null
  5956. };
  5957. a.prototype.addChild =
  5958. function(b) {
  5959. this._addingChild(b);
  5960. d.prototype.addChild.call(this, b);
  5961. this._childAdded(b);
  5962. return b
  5963. };
  5964. a.prototype.addChildAt = function(b, a) {
  5965. this._addingChild(b);
  5966. d.prototype.addChildAt.call(this, b, a);
  5967. this._childAdded(b);
  5968. return b
  5969. };
  5970. a.prototype._addingChild = function(b) {
  5971. b && "nestLevel" in b && (b.nestLevel = this._nestLevel + 1)
  5972. };
  5973. a.prototype._childAdded = function(b) {
  5974. b instanceof a && (b._initialize(), b.checkInvalidateFlag())
  5975. };
  5976. a.prototype.removeChild = function(b) {
  5977. d.prototype.removeChild.call(this, b);
  5978. this._childRemoved(b);
  5979. return b
  5980. };
  5981. a.prototype.removeChildAt = function(b) {
  5982. b = d.prototype.removeChildAt.call(this, b);
  5983. this._childRemoved(b);
  5984. return b
  5985. };
  5986. a.prototype._childRemoved = function(b) {
  5987. b && "nestLevel" in b && (b.nestLevel = 0)
  5988. };
  5989. a.prototype.checkInvalidateFlag = function(b) {
  5990. c.UIGlobals._layoutManager && (this._invalidatePropertiesFlag && c.UIGlobals._layoutManager.invalidateProperties(this), this._invalidateSizeFlag && c.UIGlobals._layoutManager.invalidateSize(this), this._invalidateDisplayListFlag && c.UIGlobals._layoutManager.invalidateDisplayList(this),
  5991. this._validateNowFlag && (c.UIGlobals._layoutManager.validateClient(this), this._validateNowFlag = !1))
  5992. };
  5993. Object.defineProperty(a.prototype, "enabled", {
  5994. get: function() {
  5995. return this._enabled
  5996. },
  5997. set: function(b) {
  5998. this._enabled = b
  5999. },
  6000. enumerable: !0,
  6001. configurable: !0
  6002. });
  6003. a.prototype._setWidth = function(b) {
  6004. if (this._width != b || this._explicitWidth != b) d.prototype._setWidth.call(this, b), isNaN(b) ? this.invalidateSize() : this._width = b, this.invalidateProperties(), this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()
  6005. };
  6006. Object.defineProperty(a.prototype, "width", {
  6007. get: function() {
  6008. return this._width
  6009. },
  6010. set: function(b) {
  6011. this._setWidth(b)
  6012. },
  6013. enumerable: !0,
  6014. configurable: !0
  6015. });
  6016. a.prototype._setHeight = function(b) {
  6017. if (this._height != b || this._explicitHeight != b) d.prototype._setHeight.call(this, b), isNaN(b) ? this.invalidateSize() : this._height = b, this.invalidateProperties(), this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()
  6018. };
  6019. Object.defineProperty(a.prototype, "height", {
  6020. get: function() {
  6021. return this._height
  6022. },
  6023. set: function(b) {
  6024. this._setHeight(b)
  6025. },
  6026. enumerable: !0,
  6027. configurable: !0
  6028. });
  6029. Object.defineProperty(a.prototype, "scaleX", {
  6030. get: function() {
  6031. return this._scaleX
  6032. },
  6033. set: function(b) {
  6034. this._setScaleX(b)
  6035. },
  6036. enumerable: !0,
  6037. configurable: !0
  6038. });
  6039. a.prototype._setScaleX = function(b) {
  6040. this._scaleX != b && (this._scaleX = b, this.invalidateParentSizeAndDisplayList())
  6041. };
  6042. Object.defineProperty(a.prototype, "scaleY", {
  6043. get: function() {
  6044. return this._scaleY
  6045. },
  6046. set: function(b) {
  6047. this._setScaleY(b)
  6048. },
  6049. enumerable: !0,
  6050. configurable: !0
  6051. });
  6052. a.prototype._setScaleY = function(b) {
  6053. this._scaleY != b && (this._scaleY =
  6054. b, this.invalidateParentSizeAndDisplayList())
  6055. };
  6056. Object.defineProperty(a.prototype, "minWidth", {
  6057. get: function() {
  6058. return this._minWidth
  6059. },
  6060. set: function(b) {
  6061. this._minWidth != b && (this._minWidth = b, this.invalidateSize())
  6062. },
  6063. enumerable: !0,
  6064. configurable: !0
  6065. });
  6066. Object.defineProperty(a.prototype, "maxWidth", {
  6067. get: function() {
  6068. return this._maxWidth
  6069. },
  6070. set: function(b) {
  6071. this._maxWidth != b && (this._maxWidth = b, this.invalidateSize())
  6072. },
  6073. enumerable: !0,
  6074. configurable: !0
  6075. });
  6076. Object.defineProperty(a.prototype, "minHeight", {
  6077. get: function() {
  6078. return this._minHeight
  6079. },
  6080. set: function(b) {
  6081. this._minHeight != b && (this._minHeight = b, this.invalidateSize())
  6082. },
  6083. enumerable: !0,
  6084. configurable: !0
  6085. });
  6086. Object.defineProperty(a.prototype, "maxHeight", {
  6087. get: function() {
  6088. return this._maxHeight
  6089. },
  6090. set: function(b) {
  6091. this._maxHeight != b && (this._maxHeight = b, this.invalidateSize())
  6092. },
  6093. enumerable: !0,
  6094. configurable: !0
  6095. });
  6096. Object.defineProperty(a.prototype, "measuredWidth", {
  6097. get: function() {
  6098. return this._measuredWidth
  6099. },
  6100. set: function(b) {
  6101. this._measuredWidth = b
  6102. },
  6103. enumerable: !0,
  6104. configurable: !0
  6105. });
  6106. Object.defineProperty(a.prototype,
  6107. "measuredHeight", {
  6108. get: function() {
  6109. return this._measuredHeight
  6110. },
  6111. set: function(b) {
  6112. this._measuredHeight = b
  6113. },
  6114. enumerable: !0,
  6115. configurable: !0
  6116. });
  6117. a.prototype.setActualSize = function(b, a) {
  6118. var c = !1;
  6119. this._width != b && (this._width = b, c = !0);
  6120. this._height != a && (this._height = a, c = !0);
  6121. c && (this.invalidateDisplayList(), this.dispatchResizeEvent())
  6122. };
  6123. Object.defineProperty(a.prototype, "x", {
  6124. get: function() {
  6125. return this._x
  6126. },
  6127. set: function(b) {
  6128. this._x != b && (this._x = b, this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6129. },
  6130. enumerable: !0,
  6131. configurable: !0
  6132. });
  6133. Object.defineProperty(a.prototype, "y", {
  6134. get: function() {
  6135. return this._y
  6136. },
  6137. set: function(b) {
  6138. this._y != b && (this._y = b, this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6139. },
  6140. enumerable: !0,
  6141. configurable: !0
  6142. });
  6143. a.prototype.invalidateProperties = function() {
  6144. this._invalidatePropertiesFlag || (this._invalidatePropertiesFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateProperties(this))
  6145. };
  6146. a.prototype.validateProperties = function() {
  6147. this._invalidatePropertiesFlag && (this.commitProperties(), this._invalidatePropertiesFlag = !1)
  6148. };
  6149. a.prototype.invalidateSize = function() {
  6150. this._invalidateSizeFlag || (this._invalidateSizeFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateSize(this))
  6151. };
  6152. a.prototype.validateSize = function(b) {
  6153. "undefined" === typeof b && (b = !1);
  6154. if (b)
  6155. for (b = 0; b < this.numChildren; b++) {
  6156. var a = this.getChildAt(b);
  6157. "validateSize" in a && a.validateSize(!0)
  6158. }
  6159. this._invalidateSizeFlag &&
  6160. (this.measureSizes() && (this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()), this._invalidateSizeFlag = !1)
  6161. };
  6162. a.prototype.measureSizes = function() {
  6163. var b = !1;
  6164. if (!this._invalidateSizeFlag) return b;
  6165. 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 =
  6166. this.maxHeight));
  6167. if (isNaN(this._oldPreferWidth)) this._oldPreferWidth = this.preferredWidth, this._oldPreferHeight = this.preferredHeight, b = !0;
  6168. else {
  6169. if (this.preferredWidth != this._oldPreferWidth || this.preferredHeight != this._oldPreferHeight) b = !0;
  6170. this._oldPreferWidth = this.preferredWidth;
  6171. this._oldPreferHeight = this.preferredHeight
  6172. }
  6173. return b
  6174. };
  6175. a.prototype.invalidateDisplayList = function() {
  6176. this._invalidateDisplayListFlag || (this._invalidateDisplayListFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateDisplayList(this))
  6177. };
  6178. a.prototype.validateDisplayList = function() {
  6179. if (this._invalidateDisplayListFlag) {
  6180. var b = 0,
  6181. a = 0,
  6182. b = this._layoutWidthExplicitlySet ? this._width : isNaN(this.explicitWidth) ? this.measuredWidth : this._explicitWidth,
  6183. a = this._layoutHeightExplicitlySet ? this._height : isNaN(this.explicitHeight) ? this.measuredHeight : this._explicitHeight;
  6184. isNaN(b) && (b = 0);
  6185. isNaN(a) && (a = 0);
  6186. this.setActualSize(b, a);
  6187. this.updateDisplayList(b, a);
  6188. this._invalidateDisplayListFlag = !1
  6189. }
  6190. };
  6191. a.prototype.validateNow = function(b) {
  6192. "undefined" === typeof b && (b = !1);
  6193. this._validateNowFlag || null == c.UIGlobals._layoutManager ? this._validateNowFlag = !0 : c.UIGlobals._layoutManager.validateClient(this, b)
  6194. };
  6195. a.prototype.invalidateParentSizeAndDisplayList = function() {
  6196. if (this.parent && this._includeInLayout && "invalidateSize" in this.parent) {
  6197. var b = this.parent;
  6198. b.invalidateSize();
  6199. b.invalidateDisplayList()
  6200. }
  6201. };
  6202. a.prototype.updateDisplayList = function(b, a) {};
  6203. a.prototype.canSkipMeasurement = function() {
  6204. return !isNaN(this._explicitWidth) && !isNaN(this._explicitHeight)
  6205. };
  6206. a.prototype.commitProperties =
  6207. function() {
  6208. this.oldWidth == this._width && this.oldHeight == this._height || this.dispatchResizeEvent();
  6209. this.oldX == this.x && this.oldY == this.y || this.dispatchMoveEvent()
  6210. };
  6211. a.prototype.measure = function() {
  6212. this._measuredWidth = this._measuredHeight = 0
  6213. };
  6214. a.prototype.dispatchMoveEvent = function() {
  6215. this.hasEventListener(c.MoveEvent.MOVE) && c.MoveEvent.dispatchMoveEvent(this, this.oldX, this.oldY);
  6216. this.oldX = this.x;
  6217. this.oldY = this.y
  6218. };
  6219. a.prototype._childXYChanged = function() {};
  6220. a.prototype.dispatchResizeEvent = function() {
  6221. this.hasEventListener(c.ResizeEvent.RESIZE) &&
  6222. c.ResizeEvent.dispatchResizeEvent(this, this.oldWidth, this.oldHeight);
  6223. this.oldWidth = this._width;
  6224. this.oldHeight = this._height
  6225. };
  6226. Object.defineProperty(a.prototype, "includeInLayout", {
  6227. get: function() {
  6228. return this._includeInLayout
  6229. },
  6230. set: function(b) {
  6231. this._includeInLayout != b && (this._includeInLayout = !0, this.invalidateParentSizeAndDisplayList(), this._includeInLayout = b)
  6232. },
  6233. enumerable: !0,
  6234. configurable: !0
  6235. });
  6236. Object.defineProperty(a.prototype, "left", {
  6237. get: function() {
  6238. return this._left
  6239. },
  6240. set: function(b) {
  6241. this._left != b && (this._left =
  6242. b, this.invalidateParentSizeAndDisplayList())
  6243. },
  6244. enumerable: !0,
  6245. configurable: !0
  6246. });
  6247. Object.defineProperty(a.prototype, "right", {
  6248. get: function() {
  6249. return this._right
  6250. },
  6251. set: function(b) {
  6252. this._right != b && (this._right = b, this.invalidateParentSizeAndDisplayList())
  6253. },
  6254. enumerable: !0,
  6255. configurable: !0
  6256. });
  6257. Object.defineProperty(a.prototype, "top", {
  6258. get: function() {
  6259. return this._top
  6260. },
  6261. set: function(b) {
  6262. this._top != b && (this._top = b, this.invalidateParentSizeAndDisplayList())
  6263. },
  6264. enumerable: !0,
  6265. configurable: !0
  6266. });
  6267. Object.defineProperty(a.prototype,
  6268. "bottom", {
  6269. get: function() {
  6270. return this._bottom
  6271. },
  6272. set: function(b) {
  6273. this._bottom != b && (this._bottom = b, this.invalidateParentSizeAndDisplayList())
  6274. },
  6275. enumerable: !0,
  6276. configurable: !0
  6277. });
  6278. Object.defineProperty(a.prototype, "horizontalCenter", {
  6279. get: function() {
  6280. return this._horizontalCenter
  6281. },
  6282. set: function(b) {
  6283. this._horizontalCenter != b && (this._horizontalCenter = b, this.invalidateParentSizeAndDisplayList())
  6284. },
  6285. enumerable: !0,
  6286. configurable: !0
  6287. });
  6288. Object.defineProperty(a.prototype, "verticalCenter", {
  6289. get: function() {
  6290. return this._verticalCenter
  6291. },
  6292. set: function(b) {
  6293. this._verticalCenter != b && (this._verticalCenter = b, this.invalidateParentSizeAndDisplayList())
  6294. },
  6295. enumerable: !0,
  6296. configurable: !0
  6297. });
  6298. Object.defineProperty(a.prototype, "percentWidth", {
  6299. get: function() {
  6300. return this._percentWidth
  6301. },
  6302. set: function(b) {
  6303. this._percentWidth != b && (this._percentWidth = b, this.invalidateParentSizeAndDisplayList())
  6304. },
  6305. enumerable: !0,
  6306. configurable: !0
  6307. });
  6308. Object.defineProperty(a.prototype, "percentHeight", {
  6309. get: function() {
  6310. return this._percentHeight
  6311. },
  6312. set: function(b) {
  6313. this._percentHeight !=
  6314. b && (this._percentHeight = b, this.invalidateParentSizeAndDisplayList())
  6315. },
  6316. enumerable: !0,
  6317. configurable: !0
  6318. });
  6319. a.prototype.setLayoutBoundsSize = function(b, a) {
  6320. isNaN(b) ? (this._layoutWidthExplicitlySet = !1, b = this.preferredWidth) : this._layoutWidthExplicitlySet = !0;
  6321. isNaN(a) ? (this._layoutHeightExplicitlySet = !1, a = this.preferredHeight) : this._layoutHeightExplicitlySet = !0;
  6322. this.setActualSize(b / this._scaleX, a / this._scaleY)
  6323. };
  6324. a.prototype.setLayoutBoundsPosition = function(b, a) {
  6325. 0 > this._scaleX && (b += this.layoutBoundsWidth);
  6326. 0 > this._scaleY &&
  6327. (a += this.layoutBoundsHeight);
  6328. var c = !1;
  6329. this._x != b && (this._x = b, c = !0);
  6330. this._y != a && (this._y = a, c = !0);
  6331. c && this.dispatchMoveEvent()
  6332. };
  6333. Object.defineProperty(a.prototype, "preferredWidth", {
  6334. get: function() {
  6335. var b = this._hasWidthSet ? this._explicitWidth : this._measuredWidth,
  6336. a = this._scaleX;
  6337. 0 > a && (a = -a);
  6338. return b * a
  6339. },
  6340. enumerable: !0,
  6341. configurable: !0
  6342. });
  6343. Object.defineProperty(a.prototype, "preferredHeight", {
  6344. get: function() {
  6345. var b = this._hasHeightSet ? this._explicitHeight : this._measuredHeight,
  6346. a = this._scaleY;
  6347. 0 > a && (a = -a);
  6348. return b * a
  6349. },
  6350. enumerable: !0,
  6351. configurable: !0
  6352. });
  6353. Object.defineProperty(a.prototype, "preferredX", {
  6354. get: function() {
  6355. return 0 <= this._scaleX ? this._x : this._x - this.preferredWidth
  6356. },
  6357. enumerable: !0,
  6358. configurable: !0
  6359. });
  6360. Object.defineProperty(a.prototype, "preferredY", {
  6361. get: function() {
  6362. return 0 <= this._scaleY ? this._y : this._y - this.preferredHeight
  6363. },
  6364. enumerable: !0,
  6365. configurable: !0
  6366. });
  6367. Object.defineProperty(a.prototype, "layoutBoundsX", {
  6368. get: function() {
  6369. return 0 <= this._scaleX ? this._x : this._x - this.layoutBoundsWidth
  6370. },
  6371. enumerable: !0,
  6372. configurable: !0
  6373. });
  6374. Object.defineProperty(a.prototype, "layoutBoundsY", {
  6375. get: function() {
  6376. return 0 <= this._scaleY ? this._y : this._y - this.layoutBoundsHeight
  6377. },
  6378. enumerable: !0,
  6379. configurable: !0
  6380. });
  6381. Object.defineProperty(a.prototype, "layoutBoundsWidth", {
  6382. get: function() {
  6383. var b = 0,
  6384. b = this._layoutWidthExplicitlySet ? this._width : this._hasWidthSet ? this._explicitWidth : this._measuredWidth,
  6385. a = this._scaleX;
  6386. 0 > a && (a = -a);
  6387. return b * a
  6388. },
  6389. enumerable: !0,
  6390. configurable: !0
  6391. });
  6392. Object.defineProperty(a.prototype, "layoutBoundsHeight", {
  6393. get: function() {
  6394. var b = 0,
  6395. b = this._layoutHeightExplicitlySet ?
  6396. this._height : this._hasHeightSet ? this._explicitHeight : this._measuredHeight,
  6397. a = this.scaleY;
  6398. 0 > a && (a = -a);
  6399. return b * a
  6400. },
  6401. enumerable: !0,
  6402. configurable: !0
  6403. });
  6404. return a
  6405. }(c.DisplayObjectContainer);
  6406. c.UIComponent = e
  6407. })(egret || (egret = {}));
  6408. (function(c) {
  6409. var e = function() {
  6410. function c() {}
  6411. c.ABOVE = "above";
  6412. c.BELOW = "below";
  6413. c.CENTER = "center";
  6414. c.TOP_LEFT = "topLeft";
  6415. c.LEFT = "left";
  6416. c.RIGHT = "right";
  6417. return c
  6418. }();
  6419. c.PopUpPosition = e
  6420. })(egret || (egret = {}));
  6421. (function(c) {
  6422. var e = function() {
  6423. function c() {}
  6424. c.AUTO = "auto";
  6425. c.OFF = "off";
  6426. c.ON = "on";
  6427. return c
  6428. }();
  6429. c.ScrollPolicy = e
  6430. })(egret || (egret = {}));
  6431. __extends = this.__extends || function(c, e) {
  6432. function d() {
  6433. this.constructor = c
  6434. }
  6435. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6436. d.prototype = e.prototype;
  6437. c.prototype = new d
  6438. };
  6439. (function(c) {
  6440. var e = function(c) {
  6441. function a(b) {
  6442. "undefined" === typeof b && (b = null);
  6443. c.call(this);
  6444. this.generator = b
  6445. }
  6446. __extends(a, c);
  6447. a.prototype.newInstance = function() {
  6448. return new this.generator
  6449. };
  6450. return a
  6451. }(c.HashObject);
  6452. c.ClassFactory = e
  6453. })(egret || (egret = {}));
  6454. __extends = this.__extends || function(c, e) {
  6455. function d() {
  6456. this.constructor = c
  6457. }
  6458. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6459. d.prototype = e.prototype;
  6460. c.prototype = new d
  6461. };
  6462. (function(c) {
  6463. var e = function(c) {
  6464. function a() {
  6465. c.call(this)
  6466. }
  6467. __extends(a, c);
  6468. a.prototype.initialize = function(b) {};
  6469. a.prototype.apply = function(b) {};
  6470. a.prototype.remove = function(b) {};
  6471. a.prototype.initializeFromObject = function(b) {
  6472. for (var a in b) this[a] = b[a];
  6473. return this
  6474. };
  6475. return a
  6476. }(c.HashObject);
  6477. c.OverrideBase = e
  6478. })(egret || (egret = {}));
  6479. __extends = this.__extends || function(c, e) {
  6480. function d() {
  6481. this.constructor = c
  6482. }
  6483. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6484. d.prototype = e.prototype;
  6485. c.prototype = new d
  6486. };
  6487. (function(c) {
  6488. var e = function(d) {
  6489. function a(b, c, e, m) {
  6490. d.call(this);
  6491. this.propertyName = "";
  6492. this.position = a.LAST;
  6493. this.target = b;
  6494. this.propertyName = c;
  6495. this.position = e;
  6496. this.relativeTo = m
  6497. }
  6498. __extends(a, d);
  6499. a.prototype.initialize = function(b) {
  6500. if ((b = b[this.target]) && !(b instanceof c.SkinnableComponent) && "_initialize" in b) try {
  6501. b._initialize()
  6502. } catch (a) {}
  6503. };
  6504. a.prototype.apply = function(b) {
  6505. var c, d;
  6506. try {
  6507. d = b[this.relativeTo]
  6508. } catch (e) {}
  6509. var f = b[this.target];
  6510. b = this.propertyName ? b[this.propertyName] : b;
  6511. if (f && b) {
  6512. switch (this.position) {
  6513. case a.FIRST:
  6514. c =
  6515. 0;
  6516. break;
  6517. case a.LAST:
  6518. c = -1;
  6519. break;
  6520. case a.BEFORE:
  6521. c = b.getElementIndex(d);
  6522. break;
  6523. case a.AFTER:
  6524. c = b.getElementIndex(d) + 1
  6525. } - 1 == c && (c = b.numElements);
  6526. b.addElementAt(f, c)
  6527. }
  6528. };
  6529. a.prototype.remove = function(b) {
  6530. var a = null == this.propertyName || "" == this.propertyName ? b : b[this.propertyName];
  6531. (b = b[this.target]) && a && -1 != a.getElementIndex(b) && a.removeElement(b)
  6532. };
  6533. a.FIRST = "first";
  6534. a.LAST = "last";
  6535. a.BEFORE = "before";
  6536. a.AFTER = "after";
  6537. return a
  6538. }(c.OverrideBase);
  6539. c.AddItems = e
  6540. })(egret || (egret = {}));
  6541. __extends = this.__extends || function(c, e) {
  6542. function d() {
  6543. this.constructor = c
  6544. }
  6545. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6546. d.prototype = e.prototype;
  6547. c.prototype = new d
  6548. };
  6549. (function(c) {
  6550. var e = function(c) {
  6551. function a(b, a, e) {
  6552. c.call(this);
  6553. this.target = b;
  6554. this.name = a;
  6555. this.value = e
  6556. }
  6557. __extends(a, c);
  6558. a.prototype.apply = function(b) {
  6559. b = null == this.target || "" == this.target ? b : b[this.target];
  6560. null != b && (this.oldValue = b[this.name], this.setPropertyValue(b, this.name, this.value, this.oldValue))
  6561. };
  6562. a.prototype.remove = function(b) {
  6563. b = null == this.target || "" == this.target ? b : b[this.target];
  6564. null != b && (this.setPropertyValue(b, this.name, this.oldValue, this.oldValue), this.oldValue = null)
  6565. };
  6566. a.prototype.setPropertyValue =
  6567. function(b, a, c, d) {
  6568. b[a] = void 0 === c || null === c ? c : "boolean" == typeof d ? this.toBoolean(c) : c
  6569. };
  6570. a.prototype.toBoolean = function(b) {
  6571. return "string" == typeof b ? "true" == b.toLowerCase() : !1 != b
  6572. };
  6573. return a
  6574. }(c.OverrideBase);
  6575. c.SetProperty = e
  6576. })(egret || (egret = {}));
  6577. __extends = this.__extends || function(c, e) {
  6578. function d() {
  6579. this.constructor = c
  6580. }
  6581. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6582. d.prototype = e.prototype;
  6583. c.prototype = new d
  6584. };
  6585. (function(c) {
  6586. var e = function(c) {
  6587. function a(b, a) {
  6588. c.call(this);
  6589. this.initialized = !1;
  6590. this.name = b;
  6591. this.overrides = a
  6592. }
  6593. __extends(a, c);
  6594. a.prototype.initialize = function(b) {
  6595. if (!this.initialized) {
  6596. this.initialized = !0;
  6597. for (var a = 0; a < this.overrides.length; a++) this.overrides[a].initialize(b)
  6598. }
  6599. };
  6600. return a
  6601. }(c.HashObject);
  6602. c.State = e
  6603. })(egret || (egret = {}));
  6604. (function(c) {
  6605. var e = function() {
  6606. function c() {}
  6607. c.adjustRelativeByXY = function(a, b) {
  6608. "undefined" === typeof b && (b = null);
  6609. if (a && (b || (b = a.parent), b)) {
  6610. var c = a.x,
  6611. d = a.y,
  6612. e = a.layoutBoundsHeight,
  6613. f = a.layoutBoundsWidth,
  6614. h = b.width,
  6615. k = b.height;
  6616. isNaN(a.left) || (a.left = c);
  6617. isNaN(a.right) || (a.right = h - c - f);
  6618. isNaN(a.horizontalCenter) || (a.horizontalCenter = c + 0.5 * f - 0.5 * h);
  6619. isNaN(a.top) || (a.top = d);
  6620. isNaN(a.bottom) || (a.bottom = k - d - e);
  6621. isNaN(a.verticalCenter) || (a.verticalCenter = 0.5 * e - 0.5 * k + d)
  6622. }
  6623. };
  6624. return c
  6625. }();
  6626. c.LayoutUtil = e
  6627. })(egret || (egret = {}));
  6628. __extends = this.__extends || function(c, e) {
  6629. function d() {
  6630. this.constructor = c
  6631. }
  6632. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6633. d.prototype = e.prototype;
  6634. c.prototype = new d
  6635. };
  6636. (function(c) {
  6637. var e = function(d) {
  6638. function a(b, a) {
  6639. "undefined" === typeof a && (a = !0);
  6640. d.call(this);
  6641. this.fillMode = "scale";
  6642. this.contentReused = this.createChildrenCalled = this.sourceChanged = !1;
  6643. this.autoScale = !0;
  6644. this.touchChildren = !1;
  6645. b && (this.source = b);
  6646. this.autoScale = a
  6647. }
  6648. __extends(a, d);
  6649. Object.defineProperty(a.prototype, "source", {
  6650. get: function() {
  6651. return this._source
  6652. },
  6653. set: function(b) {
  6654. this._source != b && (this._source = b, this.createChildrenCalled ? this.parseSource() : this.sourceChanged = !0)
  6655. },
  6656. enumerable: !0,
  6657. configurable: !0
  6658. });
  6659. Object.defineProperty(a.prototype, "content", {
  6660. get: function() {
  6661. return this._content
  6662. },
  6663. enumerable: !0,
  6664. configurable: !0
  6665. });
  6666. a.prototype.createChildren = function() {
  6667. d.prototype.createChildren.call(this);
  6668. this.sourceChanged && this.parseSource();
  6669. this.createChildrenCalled = !0
  6670. };
  6671. a.prototype.parseSource = function() {
  6672. this.sourceChanged = !1;
  6673. var b = a.assetAdapter;
  6674. b || (b = this.getAdapter());
  6675. if (this._source) {
  6676. var c = this.contentReused ? null : this._content;
  6677. this.contentReused = !0;
  6678. b.getAsset(this._source, this.contentChanged, this, c)
  6679. } else this.contentChanged(null,
  6680. null)
  6681. };
  6682. a.prototype.getAdapter = function() {
  6683. var b;
  6684. try {
  6685. b = c.Injector.getInstance("egret.IAssetAdapter")
  6686. } catch (d) {
  6687. b = new c.DefaultAssetAdapter
  6688. }
  6689. return a.assetAdapter = b
  6690. };
  6691. a.prototype.contentChanged = function(b, a) {
  6692. if (a === this._source) {
  6693. var d = this._content;
  6694. this._content = b;
  6695. d !== b && (d instanceof c.DisplayObject && this._removeFromDisplayList(d), b instanceof c.DisplayObject && this._addToDisplayListAt(b, 0));
  6696. b instanceof c.Texture && b.scale9Grid instanceof c.Rectangle && (this.scale9Grid = b.scale9Grid);
  6697. this.invalidateSize();
  6698. this.invalidateDisplayList();
  6699. this.contentReused = !1;
  6700. this.hasEventListener(c.UIEvent.CONTENT_CHANGED) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.CONTENT_CHANGED)
  6701. }
  6702. };
  6703. a.prototype.measure = function() {
  6704. d.prototype.measure.call(this);
  6705. var b = this._content;
  6706. 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,
  6707. this.measuredHeight = b._textureHeight)
  6708. };
  6709. a.prototype.updateDisplayList = function(b, a) {
  6710. d.prototype.updateDisplayList.call(this, b, a);
  6711. var e = this._content;
  6712. this.autoScale && e instanceof c.DisplayObject && ("setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(b, a) : (e.width = b / e.scaleX, e.height = a / e.scaleY))
  6713. };
  6714. a.prototype._render = function(b) {
  6715. if (this._content instanceof c.Texture) {
  6716. var a = this._content;
  6717. this._texture_to_render = a;
  6718. var e;
  6719. this.autoScale ? (e = this._width, a = this._height) : (e = a.textureWidth, a = a.textureHeight);
  6720. c.Bitmap._drawBitmap(b,
  6721. e, a, this)
  6722. } else this._texture_to_render = null;
  6723. d.prototype._render.call(this, b)
  6724. };
  6725. a.prototype._measureBounds = function() {
  6726. var b = d.prototype._measureBounds.call(this);
  6727. if (this._content instanceof c.Texture) {
  6728. var a = this._content,
  6729. e = this.width,
  6730. m = this.height,
  6731. f = Math.floor(a._offsetX * e / a._textureWidth),
  6732. a = Math.floor(a._offsetY * m / a._textureHeight);
  6733. f < b.x && (b.x = f);
  6734. a < b.y && (b.y = a);
  6735. f + e > b.right && (b.right = f + e);
  6736. a + m > b.bottom && (b.bottom = a + m)
  6737. }
  6738. return b
  6739. };
  6740. a.prototype.addChild = function(b) {
  6741. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  6742. };
  6743. a.prototype.addChildAt = function(b, c) {
  6744. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  6745. };
  6746. a.prototype.removeChild = function(b) {
  6747. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  6748. };
  6749. a.prototype.removeChildAt = function(b) {
  6750. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  6751. };
  6752. a.prototype.setChildIndex = function(b, c) {
  6753. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  6754. };
  6755. a.prototype.swapChildren = function(b, c) {
  6756. throw Error("swapChildren()" +
  6757. a.errorStr + "swapElements()\u4ee3\u66ff");
  6758. };
  6759. a.prototype.swapChildrenAt = function(b, c) {
  6760. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  6761. };
  6762. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  6763. return a
  6764. }(c.UIComponent);
  6765. c.UIAsset = e
  6766. })(egret || (egret = {}));
  6767. __extends = this.__extends || function(c, e) {
  6768. function d() {
  6769. this.constructor = c
  6770. }
  6771. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6772. d.prototype = e.prototype;
  6773. c.prototype = new d
  6774. };
  6775. (function(c) {
  6776. var e = function(d) {
  6777. function a() {
  6778. d.call(this);
  6779. this.hostComponentKey = "egret.SkinnableComponent";
  6780. this.stateIsDirty = this.createChildrenCalled = this._skinNameExplicitlySet = !1;
  6781. this.explicitMouseEnabled = this.explicitMouseChildren = this._autoMouseEnabled = !0
  6782. }
  6783. __extends(a, d);
  6784. Object.defineProperty(a.prototype, "skinName", {
  6785. get: function() {
  6786. return this._skinName
  6787. },
  6788. set: function(b) {
  6789. this._skinName != b && (this._skinName = b, this._skinNameExplicitlySet = !0, this.createChildrenCalled && this.parseSkinName())
  6790. },
  6791. enumerable: !0,
  6792. configurable: !0
  6793. });
  6794. Object.defineProperty(a.prototype, "skin", {
  6795. get: function() {
  6796. return this._skin
  6797. },
  6798. enumerable: !0,
  6799. configurable: !0
  6800. });
  6801. a.prototype.createChildren = function() {
  6802. d.prototype.createChildren.call(this);
  6803. this.parseSkinName();
  6804. this.createChildrenCalled = !0
  6805. };
  6806. a.prototype.parseSkinName = function() {
  6807. var b = a.skinAdapter;
  6808. b || (b = this.getSkinAdapter());
  6809. var b = b.getSkin(this._skinName, this.hostComponentKey),
  6810. d = this._skin;
  6811. this.detachSkin(d);
  6812. d instanceof c.DisplayObject && this._removeFromDisplayList(d);
  6813. this._skin = b;
  6814. b instanceof
  6815. c.DisplayObject && this._addToDisplayListAt(this._skin, 0);
  6816. this.attachSkin(b);
  6817. this.invalidateSkinState();
  6818. this.invalidateSize();
  6819. this.invalidateDisplayList();
  6820. this.hasEventListener(c.UIEvent.SKIN_CHANGED) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.SKIN_CHANGED)
  6821. };
  6822. a.prototype.getSkinAdapter = function() {
  6823. var b;
  6824. try {
  6825. b = c.Injector.getInstance("egret.ISkinAdapter")
  6826. } catch (d) {
  6827. b = new c.DefaultSkinAdapter
  6828. }
  6829. return a.skinAdapter = b
  6830. };
  6831. a.prototype.attachSkin = function(b) {
  6832. b && "hostComponent" in b && (b.hostComponent = this, this.findSkinParts());
  6833. b && "hostComponent" in b && b instanceof c.DisplayObject ? this._setSkinLayoutEnabled(!1) : this._setSkinLayoutEnabled(!0)
  6834. };
  6835. a.prototype.findSkinParts = function() {
  6836. var b = this._skin;
  6837. if (b && "skinParts" in b)
  6838. for (var a = b.skinParts, c = a.length, d = 0; d < c; d++) {
  6839. var e = a[d];
  6840. if (e in b) try {
  6841. this[e] = b[e], this.partAdded(e, b[e])
  6842. } catch (h) {}
  6843. }
  6844. };
  6845. a.prototype.detachSkin = function(b) {
  6846. if (b && "skinParts" in b) {
  6847. for (var a = b.skinParts, c = a.length, d = 0; d < c; d++) {
  6848. var e = a[d];
  6849. e in this && (null != this[e] && this.partRemoved(e, this[e]), this[e] = null)
  6850. }
  6851. b.hostComponent =
  6852. null
  6853. }
  6854. };
  6855. a.prototype.partAdded = function(b, a) {
  6856. c.SkinPartEvent.dispatchSkinPartEvent(this, c.SkinPartEvent.PART_ADDED, b, a)
  6857. };
  6858. a.prototype.partRemoved = function(b, a) {
  6859. c.SkinPartEvent.dispatchSkinPartEvent(this, c.SkinPartEvent.PART_REMOVED, b, a)
  6860. };
  6861. a.prototype.invalidateSkinState = function() {
  6862. this.stateIsDirty || (this.stateIsDirty = !0, this.invalidateProperties())
  6863. };
  6864. a.prototype.validateSkinState = function() {
  6865. var b = this.getCurrentSkinState(),
  6866. a = this._skin;
  6867. a && "currentState" in a && (a.currentState = b);
  6868. this.hasEventListener("stateChanged") &&
  6869. this.dispatchEventWith("stateChanged")
  6870. };
  6871. Object.defineProperty(a.prototype, "autoTouchEnabled", {
  6872. get: function() {
  6873. return this._autoMouseEnabled
  6874. },
  6875. set: function(b) {
  6876. 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))
  6877. },
  6878. enumerable: !0,
  6879. configurable: !0
  6880. });
  6881. Object.defineProperty(a.prototype, "touchChildren", {
  6882. get: function() {
  6883. return this._touchChildren
  6884. },
  6885. set: function(b) {
  6886. this.enabled && (this._touchChildren = b);
  6887. this.explicitMouseChildren = b
  6888. },
  6889. enumerable: !0,
  6890. configurable: !0
  6891. });
  6892. Object.defineProperty(a.prototype, "touchEnabled", {
  6893. get: function() {
  6894. return this._touchEnabled
  6895. },
  6896. set: function(b) {
  6897. this.enabled && (this._touchEnabled = b);
  6898. this.explicitMouseEnabled = b
  6899. },
  6900. enumerable: !0,
  6901. configurable: !0
  6902. });
  6903. Object.defineProperty(a.prototype, "enabled", {
  6904. get: function() {
  6905. return this._enabled
  6906. },
  6907. set: function(b) {
  6908. this._setEnabled(b)
  6909. },
  6910. enumerable: !0,
  6911. configurable: !0
  6912. });
  6913. a.prototype._setEnabled = function(b) {
  6914. this._enabled != b && (this._enabled = b, this._autoMouseEnabled && (this._touchChildren = b ? this.explicitMouseChildren : !1, this._touchEnabled = b ? this.explicitMouseEnabled : !1), this.invalidateSkinState())
  6915. };
  6916. a.prototype.getCurrentSkinState = function() {
  6917. return this.enabled ? "normal" : "disabled"
  6918. };
  6919. a.prototype.commitProperties = function() {
  6920. d.prototype.commitProperties.call(this);
  6921. this.stateIsDirty && (this.stateIsDirty = !1, this.validateSkinState())
  6922. };
  6923. a.prototype._setSkinLayoutEnabled = function(b) {
  6924. null !=
  6925. this.skinLayout != b && (b ? (this.skinLayout = new c.SkinBasicLayout, this.skinLayout.target = this) : this.skinLayout = this.skinLayout.target = null, this.invalidateSize(), this.invalidateDisplayList())
  6926. };
  6927. a.prototype._childXYChanged = function() {
  6928. this.skinLayout && (this.invalidateSize(), this.invalidateDisplayList())
  6929. };
  6930. a.prototype.measure = function() {
  6931. d.prototype.measure.call(this);
  6932. var b = this._skin;
  6933. if (b) {
  6934. var a = b instanceof c.DisplayObject;
  6935. a && (b && "preferredWidth" in b ? (this.measuredWidth = b.preferredWidth, this.measuredHeight =
  6936. b.preferredHeight) : (this.measuredWidth = b.width, this.measuredHeight = b.height));
  6937. this.skinLayout && this.skinLayout.measure();
  6938. if (!a) {
  6939. var a = this.measuredWidth,
  6940. e = this.measuredHeight;
  6941. try {
  6942. isNaN(b.width) || (a = Math.ceil(b.width)), isNaN(b.height) || (e = Math.ceil(b.height)), b.hasOwnProperty("minWidth") && a < b.minWidth && (a = b.minWidth), b.hasOwnProperty("maxWidth") && a > b.maxWidth && (a = b.maxWidth), b.hasOwnProperty("minHeight") && e < b.minHeight && (e = b.minHeight), b.hasOwnProperty("maxHeight") && e > b.maxHeight && (e = b.maxHeight),
  6943. this.measuredWidth = a, this.measuredHeight = e
  6944. } catch (m) {}
  6945. }
  6946. }
  6947. };
  6948. a.prototype.updateDisplayList = function(b, a) {
  6949. d.prototype.updateDisplayList.call(this, b, a);
  6950. var e = this._skin;
  6951. 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));
  6952. this.skinLayout && this.skinLayout.updateDisplayList(b, a)
  6953. };
  6954. a.prototype.addChild = function(b) {
  6955. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  6956. };
  6957. a.prototype.addChildAt = function(b,
  6958. c) {
  6959. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  6960. };
  6961. a.prototype.removeChild = function(b) {
  6962. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  6963. };
  6964. a.prototype.removeChildAt = function(b) {
  6965. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  6966. };
  6967. a.prototype.setChildIndex = function(b, c) {
  6968. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  6969. };
  6970. a.prototype.swapChildren = function(b, c) {
  6971. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  6972. };
  6973. a.prototype.swapChildrenAt = function(b, c) {
  6974. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  6975. };
  6976. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  6977. return a
  6978. }(c.UIComponent);
  6979. c.SkinnableComponent = e
  6980. })(egret || (egret = {}));
  6981. (function(c) {
  6982. var e = function() {
  6983. function d() {}
  6984. d.prototype.getSkin = function(a, b) {
  6985. if (!a) return null;
  6986. if (a.prototype) return new a;
  6987. if ("string" == typeof a) {
  6988. var d = c.getDefinitionByName(a);
  6989. return d ? new d : null
  6990. }
  6991. return a
  6992. };
  6993. return d
  6994. }();
  6995. c.DefaultSkinAdapter = e
  6996. })(egret || (egret = {}));
  6997. (function(c) {
  6998. var e = function() {
  6999. function d() {}
  7000. d.prototype.getAsset = function(a, b, d, e) {
  7001. var m = a;
  7002. a.prototype && (m = new a);
  7003. if (m instanceof c.DisplayObject || m instanceof c.Texture) b.call(d, m, a);
  7004. else if ("string" == typeof a) {
  7005. var f = new c.URLLoader;
  7006. f.dataFormat = c.URLLoaderDataFormat.TEXTURE;
  7007. f.addEventListener(c.Event.COMPLETE, function(c) {
  7008. m = f.data;
  7009. b.call(d, m, a)
  7010. }, this);
  7011. f.load(new c.URLRequest(a))
  7012. } else b.call(d, m, a)
  7013. };
  7014. return d
  7015. }();
  7016. c.DefaultAssetAdapter = e
  7017. })(egret || (egret = {}));
  7018. __extends = this.__extends || function(c, e) {
  7019. function d() {
  7020. this.constructor = c
  7021. }
  7022. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7023. d.prototype = e.prototype;
  7024. c.prototype = new d
  7025. };
  7026. (function(c) {
  7027. var e = function(c) {
  7028. function a() {
  7029. c.call(this)
  7030. }
  7031. __extends(a, c);
  7032. Object.defineProperty(a.prototype, "target", {
  7033. get: function() {
  7034. return this._target
  7035. },
  7036. set: function(b) {
  7037. this._target = b
  7038. },
  7039. enumerable: !0,
  7040. configurable: !0
  7041. });
  7042. a.prototype.measure = function() {
  7043. if (null != this.target) {
  7044. for (var b = 0, a = 0, c = this._target.skin, d = this.target.numChildren, e = 0; e < d; e++) {
  7045. var h = this.target.getChildAt(e);
  7046. if (h && h != c && h.includeInLayout) {
  7047. var k = h.horizontalCenter,
  7048. n = h.verticalCenter,
  7049. q = h.left,
  7050. p = h.right,
  7051. r = h.top,
  7052. s = h.bottom;
  7053. isNaN(q) || isNaN(p) ?
  7054. isNaN(k) ? isNaN(q) && isNaN(p) ? k = h.preferredX : (k = isNaN(q) ? 0 : q, k += isNaN(p) ? 0 : p) : k = 2 * Math.abs(k) : k = q + p;
  7055. isNaN(r) || isNaN(s) ? isNaN(n) ? isNaN(r) && isNaN(s) ? n = h.preferredY : (n = isNaN(r) ? 0 : r, n += isNaN(s) ? 0 : s) : n = 2 * Math.abs(n) : n = r + s;
  7056. s = h.preferredHeight;
  7057. b = Math.ceil(Math.max(b, k + h.preferredWidth));
  7058. a = Math.ceil(Math.max(a, n + s))
  7059. }
  7060. }
  7061. this.target.measuredWidth = Math.max(b, this.target.measuredWidth);
  7062. this.target.measuredHeight = Math.max(a, this.target.measuredHeight)
  7063. }
  7064. };
  7065. a.prototype.updateDisplayList = function(b, a) {
  7066. if (null != this.target)
  7067. for (var c =
  7068. this.target.numChildren, d = this._target.skin, e = 0; e < c; e++) {
  7069. var h = this.target.getChildAt(e);
  7070. if (null != h && h != d && h.includeInLayout) {
  7071. var k = h.horizontalCenter,
  7072. n = h.verticalCenter,
  7073. q = h.left,
  7074. p = h.right,
  7075. r = h.top,
  7076. s = h.bottom,
  7077. t = h.percentWidth,
  7078. A = h.percentHeight,
  7079. w = NaN,
  7080. B = NaN;
  7081. isNaN(q) || isNaN(p) ? isNaN(t) || (w = Math.round(b * Math.min(0.01 * t, 1))) : w = b - p - q;
  7082. isNaN(r) || isNaN(s) ? isNaN(A) || (B = Math.round(a * Math.min(0.01 * A, 1))) : B = a - s - r;
  7083. h.setLayoutBoundsSize(w, B);
  7084. t = h.layoutBoundsWidth;
  7085. A = h.layoutBoundsHeight;
  7086. B = w = NaN;
  7087. w = isNaN(k) ? isNaN(q) ?
  7088. isNaN(p) ? h.layoutBoundsX : b - t - p : q : Math.round((b - t) / 2 + k);
  7089. B = isNaN(n) ? isNaN(r) ? isNaN(s) ? h.layoutBoundsY : a - A - s : r : Math.round((a - A) / 2 + n);
  7090. h.setLayoutBoundsPosition(w, B)
  7091. }
  7092. }
  7093. };
  7094. return a
  7095. }(c.HashObject);
  7096. c.SkinBasicLayout = e
  7097. })(egret || (egret = {}));
  7098. __extends = this.__extends || function(c, e) {
  7099. function d() {
  7100. this.constructor = c
  7101. }
  7102. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7103. d.prototype = e.prototype;
  7104. c.prototype = new d
  7105. };
  7106. (function(c) {
  7107. var e = function(d) {
  7108. function a() {
  7109. d.call(this);
  7110. this._autoRepeat = this._downEventFired = !1;
  7111. this._repeatInterval = this._repeatDelay = 35;
  7112. this._keepDown = this._hovered = !1;
  7113. this._label = "";
  7114. this.touchChildren = this._stickyHighlighting = this._mouseCaptured = !1;
  7115. this.addHandlers()
  7116. }
  7117. __extends(a, d);
  7118. Object.defineProperty(a.prototype, "autoRepeat", {
  7119. get: function() {
  7120. return this._autoRepeat
  7121. },
  7122. set: function(b) {
  7123. b != this._autoRepeat && (this._autoRepeat = b, this.checkAutoRepeatTimerConditions(this.isDown()))
  7124. },
  7125. enumerable: !0,
  7126. configurable: !0
  7127. });
  7128. Object.defineProperty(a.prototype, "repeatDelay", {
  7129. get: function() {
  7130. return this._repeatDelay
  7131. },
  7132. set: function(b) {
  7133. this._repeatDelay = b
  7134. },
  7135. enumerable: !0,
  7136. configurable: !0
  7137. });
  7138. Object.defineProperty(a.prototype, "repeatInterval", {
  7139. get: function() {
  7140. return this._repeatInterval
  7141. },
  7142. set: function(b) {
  7143. this._repeatInterval = b
  7144. },
  7145. enumerable: !0,
  7146. configurable: !0
  7147. });
  7148. Object.defineProperty(a.prototype, "hovered", {
  7149. get: function() {
  7150. return this._hovered
  7151. },
  7152. set: function(b) {
  7153. b != this._hovered && (this._hovered = b, this.invalidateSkinState(), this.checkButtonDownConditions())
  7154. },
  7155. enumerable: !0,
  7156. configurable: !0
  7157. });
  7158. a.prototype._setKeepDown = function(b) {
  7159. this._keepDown != b && (this._keepDown = b, this.invalidateSkinState())
  7160. };
  7161. Object.defineProperty(a.prototype, "label", {
  7162. get: function() {
  7163. return this._getLabel()
  7164. },
  7165. set: function(b) {
  7166. this._setLabel(b)
  7167. },
  7168. enumerable: !0,
  7169. configurable: !0
  7170. });
  7171. a.prototype._getLabel = function() {
  7172. return this.labelDisplay ? this.labelDisplay.text : this._label
  7173. };
  7174. a.prototype._setLabel = function(b) {
  7175. this._label = b;
  7176. this.labelDisplay && (this.labelDisplay.text = b)
  7177. };
  7178. Object.defineProperty(a.prototype,
  7179. "mouseCaptured", {
  7180. get: function() {
  7181. return this._mouseCaptured
  7182. },
  7183. set: function(b) {
  7184. b != this._mouseCaptured && (this._mouseCaptured = b, this.invalidateSkinState(), b || this.removeStageMouseHandlers(), this.checkButtonDownConditions())
  7185. },
  7186. enumerable: !0,
  7187. configurable: !0
  7188. });
  7189. Object.defineProperty(a.prototype, "stickyHighlighting", {
  7190. get: function() {
  7191. return this._stickyHighlighting
  7192. },
  7193. set: function(b) {
  7194. b != this._stickyHighlighting && (this._stickyHighlighting = b, this.invalidateSkinState(), this.checkButtonDownConditions())
  7195. },
  7196. enumerable: !0,
  7197. configurable: !0
  7198. });
  7199. a.prototype.checkButtonDownConditions = function() {
  7200. var b = this.isDown();
  7201. this._downEventFired != b && (b && c.UIEvent.dispatchUIEvent(this, c.UIEvent.BUTTON_DOWN), this._downEventFired = b, this.checkAutoRepeatTimerConditions(b))
  7202. };
  7203. a.prototype.addHandlers = function() {
  7204. this.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.mouseEventHandler, this);
  7205. this.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.mouseEventHandler, this);
  7206. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.mouseEventHandler, this);
  7207. this.addEventListener(c.TouchEvent.TOUCH_END, this.mouseEventHandler, this);
  7208. this.addEventListener(c.TouchEvent.TOUCH_TAP, this.mouseEventHandler, this)
  7209. };
  7210. a.prototype.addStageMouseHandlers = function() {
  7211. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  7212. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  7213. };
  7214. a.prototype.removeStageMouseHandlers = function() {
  7215. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler,
  7216. this);
  7217. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  7218. };
  7219. a.prototype.isDown = function() {
  7220. return this.enabled ? this.mouseCaptured && (this.hovered || this.stickyHighlighting) ? !0 : !1 : !1
  7221. };
  7222. a.prototype.checkAutoRepeatTimerConditions = function(b) {
  7223. b = this.autoRepeat && b;
  7224. b != (null != this.autoRepeatTimer) && (b ? this.startTimer() : this.stopTimer())
  7225. };
  7226. a.prototype.startTimer = function() {
  7227. this.autoRepeatTimer = new c.Timer(1);
  7228. this.autoRepeatTimer.delay = this._repeatDelay;
  7229. this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER,
  7230. this.autoRepeat_timerDelayHandler, this);
  7231. this.autoRepeatTimer.start()
  7232. };
  7233. a.prototype.stopTimer = function() {
  7234. this.autoRepeatTimer.stop();
  7235. this.autoRepeatTimer = null
  7236. };
  7237. a.prototype.mouseEventHandler = function(b) {
  7238. switch (b.type) {
  7239. case c.TouchEvent.TOUCH_ROLL_OVER:
  7240. if (b.touchDown && !this.mouseCaptured) break;
  7241. this.hovered = !0;
  7242. break;
  7243. case c.TouchEvent.TOUCH_ROLL_OUT:
  7244. this.hovered = !1;
  7245. break;
  7246. case c.TouchEvent.TOUCH_BEGIN:
  7247. this.addStageMouseHandlers();
  7248. c.InteractionMode.mode == c.InteractionMode.TOUCH && (this.hovered = !0);
  7249. this.mouseCaptured = !0;
  7250. break;
  7251. case c.TouchEvent.TOUCH_END:
  7252. b.target == this && (this.hovered = !0, this.mouseCaptured && (this.buttonReleased(), this.mouseCaptured = !1));
  7253. break;
  7254. case c.TouchEvent.TOUCH_TAP:
  7255. this.enabled ? this.clickHandler(b) : b.stopImmediatePropagation()
  7256. }
  7257. };
  7258. a.prototype.buttonReleased = function() {};
  7259. a.prototype.clickHandler = function(b) {};
  7260. a.prototype.stage_mouseUpHandler = function(b) {
  7261. b.target != this && (this.mouseCaptured = !1)
  7262. };
  7263. a.prototype.autoRepeat_timerDelayHandler = function(b) {
  7264. this.autoRepeatTimer.reset();
  7265. this.autoRepeatTimer.removeEventListener(c.TimerEvent.TIMER,
  7266. this.autoRepeat_timerDelayHandler, this);
  7267. this.autoRepeatTimer.delay = this._repeatInterval;
  7268. this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerHandler, this);
  7269. this.autoRepeatTimer.start()
  7270. };
  7271. a.prototype.autoRepeat_timerHandler = function(b) {
  7272. c.UIEvent.dispatchUIEvent(this, c.UIEvent.BUTTON_DOWN)
  7273. };
  7274. a.prototype.getCurrentSkinState = function() {
  7275. return this.enabled ? this.isDown() || this._keepDown ? "down" : c.InteractionMode.mode == c.InteractionMode.MOUSE && (this.hovered || this.mouseCaptured) ? "over" :
  7276. "up" : d.prototype.getCurrentSkinState.call(this)
  7277. };
  7278. a.prototype.partAdded = function(b, a) {
  7279. d.prototype.partAdded.call(this, b, a);
  7280. a == this.labelDisplay && (this.labelDisplay.text = this._label)
  7281. };
  7282. return a
  7283. }(c.SkinnableComponent);
  7284. c.ButtonBase = e
  7285. })(egret || (egret = {}));
  7286. __extends = this.__extends || function(c, e) {
  7287. function d() {
  7288. this.constructor = c
  7289. }
  7290. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7291. d.prototype = e.prototype;
  7292. c.prototype = new d
  7293. };
  7294. (function(c) {
  7295. var e = function(d) {
  7296. function a() {
  7297. d.call(this);
  7298. this._autoSelected = !0
  7299. }
  7300. __extends(a, d);
  7301. Object.defineProperty(a.prototype, "selected", {
  7302. get: function() {
  7303. return this._selected
  7304. },
  7305. set: function(b) {
  7306. this._setSelected(b)
  7307. },
  7308. enumerable: !0,
  7309. configurable: !0
  7310. });
  7311. a.prototype._setSelected = function(b) {
  7312. b != this._selected && (this._selected = b, c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT), this.invalidateSkinState())
  7313. };
  7314. a.prototype.getCurrentSkinState = function() {
  7315. return this.selected ? d.prototype.getCurrentSkinState.call(this) +
  7316. "AndSelected" : d.prototype.getCurrentSkinState.call(this)
  7317. };
  7318. a.prototype.buttonReleased = function() {
  7319. d.prototype.buttonReleased.call(this);
  7320. this._autoSelected && this.enabled && (this.selected = !this.selected, this.dispatchEventWith(c.Event.CHANGE))
  7321. };
  7322. return a
  7323. }(c.ButtonBase);
  7324. c.ToggleButtonBase = e
  7325. })(egret || (egret = {}));
  7326. __extends = this.__extends || function(c, e) {
  7327. function d() {
  7328. this.constructor = c
  7329. }
  7330. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7331. d.prototype = e.prototype;
  7332. c.prototype = new d
  7333. };
  7334. (function(c) {
  7335. var e = function(d) {
  7336. function a() {
  7337. d.call(this);
  7338. this._fontFamily = "SimSun";
  7339. this._size = 30;
  7340. this._textAlign = c.HorizontalAlign.LEFT;
  7341. this._verticalAlign = c.VerticalAlign.TOP;
  7342. this._lineSpacing = 0;
  7343. this._textColor = 16777215;
  7344. this._text = ""
  7345. }
  7346. __extends(a, d);
  7347. Object.defineProperty(a.prototype, "fontFamily", {
  7348. get: function() {
  7349. return this._fontFamily
  7350. },
  7351. set: function(b) {
  7352. this._fontFamily != b && (this._fontFamily = b, this.fontFamilyChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7353. },
  7354. enumerable: !0,
  7355. configurable: !0
  7356. });
  7357. Object.defineProperty(a.prototype, "size", {
  7358. get: function() {
  7359. return this._size
  7360. },
  7361. set: function(b) {
  7362. this._size != b && (this._size = b, this.sizeChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7363. },
  7364. enumerable: !0,
  7365. configurable: !0
  7366. });
  7367. Object.defineProperty(a.prototype, "bold", {
  7368. get: function() {
  7369. return this._bold
  7370. },
  7371. set: function(b) {
  7372. this._bold != b && (this._bold = b, this.boldChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7373. },
  7374. enumerable: !0,
  7375. configurable: !0
  7376. });
  7377. Object.defineProperty(a.prototype, "italic", {
  7378. get: function() {
  7379. return this._italic
  7380. },
  7381. set: function(b) {
  7382. this._italic != b && (this._italic = b, this.italicChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7383. },
  7384. enumerable: !0,
  7385. configurable: !0
  7386. });
  7387. Object.defineProperty(a.prototype, "textAlign", {
  7388. get: function() {
  7389. return this._textAlign
  7390. },
  7391. set: function(b) {
  7392. this._textAlign != b && (this._textAlign = b, this.textAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(),
  7393. this.invalidateDisplayList())
  7394. },
  7395. enumerable: !0,
  7396. configurable: !0
  7397. });
  7398. Object.defineProperty(a.prototype, "verticalAlign", {
  7399. get: function() {
  7400. return this._verticalAlign
  7401. },
  7402. set: function(b) {
  7403. this._verticalAlign != b && (this._verticalAlign = b, this.verticalAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7404. },
  7405. enumerable: !0,
  7406. configurable: !0
  7407. });
  7408. Object.defineProperty(a.prototype, "lineSpacing", {
  7409. get: function() {
  7410. return this._lineSpacing
  7411. },
  7412. set: function(b) {
  7413. this._lineSpacing != b && (this._lineSpacing =
  7414. b, this.lineSpacingChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7415. },
  7416. enumerable: !0,
  7417. configurable: !0
  7418. });
  7419. Object.defineProperty(a.prototype, "textColor", {
  7420. get: function() {
  7421. return this._textColor
  7422. },
  7423. set: function(b) {
  7424. this._textColor != b && (this._textColor = b, this.textColorChanged = !0, this.invalidateProperties())
  7425. },
  7426. enumerable: !0,
  7427. configurable: !0
  7428. });
  7429. Object.defineProperty(a.prototype, "text", {
  7430. get: function() {
  7431. return this._text
  7432. },
  7433. set: function(b) {
  7434. b != this._text && (this._text = b, this._textChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7435. },
  7436. enumerable: !0,
  7437. configurable: !0
  7438. });
  7439. a.prototype.createChildren = function() {
  7440. d.prototype.createChildren.call(this);
  7441. this._textField || this.checkTextField()
  7442. };
  7443. a.prototype.commitProperties = function() {
  7444. d.prototype.commitProperties.call(this);
  7445. this._textField || this.checkTextField();
  7446. this.fontFamilyChanged && (this._textField.fontFamily = this._fontFamily, this.fontFamilyChanged = !1);
  7447. this.sizeChanged && (this._textField.size = this._size, this.sizeChanged = !1);
  7448. this.boldChanged && (this._textField.bold = this._bold, this.boldChanged = !1);
  7449. this.italic && (this._textField.italic = this._italic, this.italicChanged = !1);
  7450. this.textAlignChanged && (this._textField.textAlign = this._textAlign, this.textAlignChanged = !1);
  7451. this.verticalAlignChanged && (this._textField.verticalAlign = this._verticalAlign, this.verticalAlignChanged = !1);
  7452. this.lineSpacingChanged && (this._textField.lineSpacing = this._lineSpacing, this.lineSpacingChanged = !1);
  7453. this.textColorChanged && (this._textField.textColor = this._textColor,
  7454. this.textColorChanged = !1);
  7455. this._textChanged && (this._textField.text = this._text, this._textChanged = !1)
  7456. };
  7457. a.prototype.checkTextField = function() {
  7458. this._textField || (this.createTextField(), this._textField.text = this._text, this._textChanged = !0, this.invalidateProperties())
  7459. };
  7460. a.prototype.createTextField = function() {
  7461. this._textField = new c.TextField;
  7462. this._textField.fontFamily = this._fontFamily;
  7463. this._textField.size = this._size;
  7464. this._textField.textAlign = this._textAlign;
  7465. this._textField.verticalAlign = this._verticalAlign;
  7466. this._textField.lineSpacing = this._lineSpacing;
  7467. this._textField.textColor = this._textColor;
  7468. this._addToDisplayList(this._textField)
  7469. };
  7470. a.prototype.measure = function() {
  7471. d.prototype.measure.call(this);
  7472. this.measuredWidth = a.DEFAULT_MEASURED_WIDTH;
  7473. this.measuredHeight = a.DEFAULT_MEASURED_HEIGHT
  7474. };
  7475. a.prototype.$updateDisplayList = function(b, a) {
  7476. d.prototype.updateDisplayList.call(this, b, a)
  7477. };
  7478. a.prototype.updateDisplayList = function(b, a) {
  7479. d.prototype.updateDisplayList.call(this, b, a);
  7480. this._textField.width = b;
  7481. this._textField.height =
  7482. a
  7483. };
  7484. a.DEFAULT_MEASURED_WIDTH = 160;
  7485. a.DEFAULT_MEASURED_HEIGHT = 22;
  7486. return a
  7487. }(c.UIComponent);
  7488. c.TextBase = e
  7489. })(egret || (egret = {}));
  7490. __extends = this.__extends || function(c, e) {
  7491. function d() {
  7492. this.constructor = c
  7493. }
  7494. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7495. d.prototype = e.prototype;
  7496. c.prototype = new d
  7497. };
  7498. (function(c) {
  7499. var e = function(d) {
  7500. function a() {
  7501. d.call(this);
  7502. this._contentHeight = this._contentWidth = 0;
  7503. this._clipAndEnableScrolling = !1;
  7504. this._verticalScrollPosition = this._horizontalScrollPosition = 0;
  7505. this.touchEnabled = this._layoutInvalidateSizeFlag = this._layoutInvalidateDisplayListFlag = !1
  7506. }
  7507. __extends(a, d);
  7508. a.prototype.createChildren = function() {
  7509. d.prototype.createChildren.call(this);
  7510. this._layout || (this.layout = new c.BasicLayout)
  7511. };
  7512. Object.defineProperty(a.prototype, "contentWidth", {
  7513. get: function() {
  7514. return this._contentWidth
  7515. },
  7516. enumerable: !0,
  7517. configurable: !0
  7518. });
  7519. a.prototype.setContentWidth = function(b) {
  7520. if (b != this._contentWidth) {
  7521. var a = this._contentWidth;
  7522. this._contentWidth = b;
  7523. this.hasEventListener("propertyChange") && c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "contentWidth", a, b, this)
  7524. }
  7525. };
  7526. Object.defineProperty(a.prototype, "contentHeight", {
  7527. get: function() {
  7528. return this._contentHeight
  7529. },
  7530. enumerable: !0,
  7531. configurable: !0
  7532. });
  7533. a.prototype.setContentHeight = function(b) {
  7534. if (b != this._contentHeight) {
  7535. var a = this._contentHeight;
  7536. this._contentHeight = b;
  7537. this.hasEventListener("propertyChange") && c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "contentHeight", a, b, this)
  7538. }
  7539. };
  7540. a.prototype.setContentSize = function(b, a) {
  7541. if (b != this._contentWidth || a != this._contentHeight) this.setContentWidth(b), this.setContentHeight(a)
  7542. };
  7543. Object.defineProperty(a.prototype, "layout", {
  7544. get: function() {
  7545. return this._layout
  7546. },
  7547. set: function(b) {
  7548. this._setLayout(b)
  7549. },
  7550. enumerable: !0,
  7551. configurable: !0
  7552. });
  7553. a.prototype._setLayout = function(b) {
  7554. if (this._layout !=
  7555. b) {
  7556. this._layout && (this._layout.target = null);
  7557. if (this._layout = b) this._layout.target = this;
  7558. this.invalidateSize();
  7559. this.invalidateDisplayList();
  7560. this.dispatchEventWith("layoutChanged")
  7561. }
  7562. };
  7563. Object.defineProperty(a.prototype, "clipAndEnableScrolling", {
  7564. get: function() {
  7565. return this._clipAndEnableScrolling
  7566. },
  7567. set: function(b) {
  7568. b != this._clipAndEnableScrolling && (this.scrollRect = (this._clipAndEnableScrolling = b) ? new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, this.width, this.height) : null)
  7569. },
  7570. enumerable: !0,
  7571. configurable: !0
  7572. });
  7573. Object.defineProperty(a.prototype, "horizontalScrollPosition", {
  7574. get: function() {
  7575. return this._horizontalScrollPosition
  7576. },
  7577. set: function(b) {
  7578. if (b != this._horizontalScrollPosition) {
  7579. var a = this._horizontalScrollPosition;
  7580. this._horizontalScrollPosition = b;
  7581. this.scrollPositionChanged();
  7582. c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "horizontalScrollPosition", a, b, this)
  7583. }
  7584. },
  7585. enumerable: !0,
  7586. configurable: !0
  7587. });
  7588. Object.defineProperty(a.prototype, "verticalScrollPosition", {
  7589. get: function() {
  7590. return this._verticalScrollPosition
  7591. },
  7592. set: function(b) {
  7593. if (b != this._verticalScrollPosition) {
  7594. var a = this._verticalScrollPosition;
  7595. this._verticalScrollPosition = b;
  7596. this.scrollPositionChanged();
  7597. c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "verticalScrollPosition", a, b, this)
  7598. }
  7599. },
  7600. enumerable: !0,
  7601. configurable: !0
  7602. });
  7603. a.prototype.scrollPositionChanged = function() {
  7604. this._clipAndEnableScrolling && (this.updateScrollRect(this.width, this.height), this._invalidateDisplayListExceptLayout(),
  7605. this._layout && this._layout.scrollPositionChanged())
  7606. };
  7607. a.prototype.updateScrollRect = function(b, a) {
  7608. var d = this._scrollRect;
  7609. 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)
  7610. };
  7611. a.prototype.measure = function() {
  7612. this._layout && this._layoutInvalidateSizeFlag && (d.prototype.measure.call(this), this._layout.measure())
  7613. };
  7614. a.prototype._invalidateDisplayListExceptLayout = function() {
  7615. d.prototype.invalidateDisplayList.call(this)
  7616. };
  7617. a.prototype.invalidateDisplayList = function() {
  7618. d.prototype.invalidateDisplayList.call(this);
  7619. this._layoutInvalidateDisplayListFlag = !0
  7620. };
  7621. a.prototype._childXYChanged = function() {
  7622. this.invalidateSize();
  7623. this.invalidateDisplayList()
  7624. };
  7625. a.prototype._invalidateSizeExceptLayout = function() {
  7626. d.prototype.invalidateSize.call(this)
  7627. };
  7628. a.prototype.invalidateSize = function() {
  7629. d.prototype.invalidateSize.call(this);
  7630. this._layoutInvalidateSizeFlag = !0
  7631. };
  7632. a.prototype.updateDisplayList = function(b, a) {
  7633. d.prototype.updateDisplayList.call(this, b, a);
  7634. this._layoutInvalidateDisplayListFlag && this._layout && (this._layoutInvalidateDisplayListFlag = !1, this._layout.updateDisplayList(b, a), this.updateScrollRect(b, a))
  7635. };
  7636. Object.defineProperty(a.prototype, "numElements", {
  7637. get: function() {
  7638. return -1
  7639. },
  7640. enumerable: !0,
  7641. configurable: !0
  7642. });
  7643. a.prototype.getElementAt = function(b) {
  7644. return null
  7645. };
  7646. a.prototype.getElementIndex = function(b) {
  7647. return -1
  7648. };
  7649. a.prototype.getElementIndicesInView = function() {
  7650. var b = [],
  7651. a;
  7652. if (this.scrollRect)
  7653. for (a = 0; a < this.numChildren; a++) {
  7654. var d = this.getChildAt(a);
  7655. if (d) {
  7656. var e = new c.Rectangle;
  7657. e.x = d.layoutBoundsX;
  7658. e.y = d.layoutBoundsY;
  7659. e.width = d.layoutBoundsWidth;
  7660. e.height = d.layoutBoundsHeight;
  7661. this.scrollRect.intersects(e) && b.push(a)
  7662. }
  7663. } else
  7664. for (a = 0; a < this.numChildren; a++) b.push(a);
  7665. return b
  7666. };
  7667. a.prototype.setVirtualElementIndicesInView = function(b, a) {};
  7668. a.prototype.getVirtualElementAt = function(b) {
  7669. return this.getElementAt(b)
  7670. };
  7671. return a
  7672. }(c.UIComponent);
  7673. c.GroupBase = e
  7674. })(egret || (egret = {}));
  7675. __extends = this.__extends || function(c, e) {
  7676. function d() {
  7677. this.constructor = c
  7678. }
  7679. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7680. d.prototype = e.prototype;
  7681. c.prototype = new d
  7682. };
  7683. (function(c) {
  7684. var e = function(c) {
  7685. function a() {
  7686. c.call(this);
  7687. this._selected = this.dataChangedFlag = !1;
  7688. this._itemIndex = -1;
  7689. this.touchChildren = !0
  7690. }
  7691. __extends(a, c);
  7692. Object.defineProperty(a.prototype, "data", {
  7693. get: function() {
  7694. return this._data
  7695. },
  7696. set: function(b) {
  7697. this._data = b;
  7698. this.initialized || this.parent ? (this.dataChangedFlag = !1, this.dataChanged()) : (this.dataChangedFlag = !0, this.invalidateProperties())
  7699. },
  7700. enumerable: !0,
  7701. configurable: !0
  7702. });
  7703. a.prototype.dataChanged = function() {};
  7704. Object.defineProperty(a.prototype, "selected", {
  7705. get: function() {
  7706. return this._selected
  7707. },
  7708. set: function(b) {
  7709. this._selected != b && (this._selected = b, this.invalidateSkinState())
  7710. },
  7711. enumerable: !0,
  7712. configurable: !0
  7713. });
  7714. Object.defineProperty(a.prototype, "itemIndex", {
  7715. get: function() {
  7716. return this._itemIndex
  7717. },
  7718. set: function(b) {
  7719. this._itemIndex = b
  7720. },
  7721. enumerable: !0,
  7722. configurable: !0
  7723. });
  7724. a.prototype.commitProperties = function() {
  7725. c.prototype.commitProperties.call(this);
  7726. this.dataChangedFlag && (this.dataChangedFlag = !1, this.dataChanged())
  7727. };
  7728. a.prototype.getCurrentSkinState = function() {
  7729. return this._selected ?
  7730. "down" : c.prototype.getCurrentSkinState.call(this)
  7731. };
  7732. return a
  7733. }(c.ButtonBase);
  7734. c.ItemRenderer = e
  7735. })(egret || (egret = {}));
  7736. __extends = this.__extends || function(c, e) {
  7737. function d() {
  7738. this.constructor = c
  7739. }
  7740. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7741. d.prototype = e.prototype;
  7742. c.prototype = new d
  7743. };
  7744. (function(c) {
  7745. var e = function(d) {
  7746. function a() {
  7747. d.call(this);
  7748. this._indentation = 17;
  7749. this._depth = 0;
  7750. this._isOpen = this._hasChildren = !1;
  7751. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onItemMouseDown, this, !1, 1E3)
  7752. }
  7753. __extends(a, d);
  7754. a.prototype.onItemMouseDown = function(b) {
  7755. b.target == this.disclosureButton && b.stopImmediatePropagation()
  7756. };
  7757. Object.defineProperty(a.prototype, "indentation", {
  7758. get: function() {
  7759. return this._indentation
  7760. },
  7761. set: function(b) {
  7762. this._indentation = b
  7763. },
  7764. enumerable: !0,
  7765. configurable: !0
  7766. });
  7767. Object.defineProperty(a.prototype,
  7768. "iconSkinName", {
  7769. get: function() {
  7770. return this._iconSkinName
  7771. },
  7772. set: function(b) {
  7773. this._iconSkinName != b && (this._iconSkinName = b, this.iconDisplay && (this.iconDisplay.source = this._iconSkinName))
  7774. },
  7775. enumerable: !0,
  7776. configurable: !0
  7777. });
  7778. Object.defineProperty(a.prototype, "depth", {
  7779. get: function() {
  7780. return this._depth
  7781. },
  7782. set: function(b) {
  7783. b != this._depth && (this._depth = b, this.contentGroup && (this.contentGroup.x = this._depth * this._indentation))
  7784. },
  7785. enumerable: !0,
  7786. configurable: !0
  7787. });
  7788. Object.defineProperty(a.prototype, "hasChildren", {
  7789. get: function() {
  7790. return this._hasChildren
  7791. },
  7792. set: function(b) {
  7793. this._hasChildren != b && (this._hasChildren = b, this.disclosureButton && (this.disclosureButton.visible = this._hasChildren))
  7794. },
  7795. enumerable: !0,
  7796. configurable: !0
  7797. });
  7798. Object.defineProperty(a.prototype, "opened", {
  7799. get: function() {
  7800. return this._isOpen
  7801. },
  7802. set: function(b) {
  7803. this._isOpen != b && (this._isOpen = b, this.disclosureButton && (this.disclosureButton.selected = this._isOpen))
  7804. },
  7805. enumerable: !0,
  7806. configurable: !0
  7807. });
  7808. a.prototype.partAdded = function(b, a) {
  7809. d.prototype.partAdded.call(this, b, a);
  7810. a == this.iconDisplay ? this.iconDisplay.source =
  7811. 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)
  7812. };
  7813. a.prototype.partRemoved = function(b, a) {
  7814. d.prototype.partRemoved.call(this, b, a);
  7815. a == this.iconDisplay ? this.iconDisplay.source = null : a == this.disclosureButton &&
  7816. (this.disclosureButton.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.disclosureButton_mouseDownHandler, this), this.disclosureButton._autoSelected = !0, this.disclosureButton.visible = !0)
  7817. };
  7818. a.prototype.disclosureButton_mouseDownHandler = function(b) {
  7819. c.TreeEvent.dispatchTreeEvent(this, c.TreeEvent.ITEM_OPENING, this.itemIndex, this.data, this, !this._isOpen)
  7820. };
  7821. return a
  7822. }(c.ItemRenderer);
  7823. c.TreeItemRenderer = e
  7824. })(egret || (egret = {}));
  7825. (function(c) {
  7826. var e = function() {
  7827. function d(a, b) {
  7828. this.easerFunction = c.Ease.sineInOut;
  7829. this._duration = 500;
  7830. this._startDelay = 0;
  7831. this._repeatCount = 1;
  7832. this._repeatDelay = 0;
  7833. this.motionPaths = [];
  7834. this._currentValue = {};
  7835. this.pauseTime = 0;
  7836. this._isPaused = !1;
  7837. this.startTime = 0;
  7838. this._started = !1;
  7839. this.playedTimes = 0;
  7840. this.updateFunction = a;
  7841. this.thisObject = b
  7842. }
  7843. Object.defineProperty(d.prototype, "isPlaying", {
  7844. get: function() {
  7845. return this._isPlaying
  7846. },
  7847. enumerable: !0,
  7848. configurable: !0
  7849. });
  7850. Object.defineProperty(d.prototype, "duration", {
  7851. get: function() {
  7852. return this._duration
  7853. },
  7854. set: function(a) {
  7855. this._duration = a
  7856. },
  7857. enumerable: !0,
  7858. configurable: !0
  7859. });
  7860. Object.defineProperty(d.prototype, "startDelay", {
  7861. get: function() {
  7862. return this._startDelay
  7863. },
  7864. set: function(a) {
  7865. this._startDelay = a
  7866. },
  7867. enumerable: !0,
  7868. configurable: !0
  7869. });
  7870. Object.defineProperty(d.prototype, "repeatCount", {
  7871. get: function() {
  7872. return this._repeatCount
  7873. },
  7874. set: function(a) {
  7875. this._repeatCount = a
  7876. },
  7877. enumerable: !0,
  7878. configurable: !0
  7879. });
  7880. Object.defineProperty(d.prototype, "repeatDelay", {
  7881. get: function() {
  7882. return this._repeatDelay
  7883. },
  7884. set: function(a) {
  7885. this._repeatDelay =
  7886. a
  7887. },
  7888. enumerable: !0,
  7889. configurable: !0
  7890. });
  7891. Object.defineProperty(d.prototype, "currentValue", {
  7892. get: function() {
  7893. return this._currentValue
  7894. },
  7895. enumerable: !0,
  7896. configurable: !0
  7897. });
  7898. d.prototype.play = function() {
  7899. this.stopAnimation();
  7900. this.start()
  7901. };
  7902. d.prototype.seek = function(a) {
  7903. a = Math.min(a, this.duration);
  7904. this.caculateCurrentValue(a / this.duration);
  7905. this.startTime = c.getTimer() - a - this._startDelay;
  7906. null != this.updateFunction && this.updateFunction.call(this.thisObject, this)
  7907. };
  7908. d.prototype.start = function() {
  7909. this.playedTimes = 0;
  7910. this._started = !0;
  7911. this._isPlaying = !1;
  7912. this._currentValue = {};
  7913. this.caculateCurrentValue(0);
  7914. this.startTime = c.getTimer();
  7915. d.currentTime = this.startTime;
  7916. this.doInterval();
  7917. d.addAnimation(this)
  7918. };
  7919. d.prototype.end = function() {
  7920. this._started || (this.caculateCurrentValue(0), null != this.startFunction && this.startFunction.call(this.thisObject, this), null != this.updateFunction && this.updateFunction.call(this.thisObject, this));
  7921. this.caculateCurrentValue(1);
  7922. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  7923. this.stopAnimation();
  7924. null != this.endFunction && this.endFunction.call(this.thisObject, this)
  7925. };
  7926. d.prototype.stop = function() {
  7927. this.stopAnimation();
  7928. null != this.stopFunction && this.stopFunction.call(this.thisObject, this)
  7929. };
  7930. d.prototype.stopAnimation = function() {
  7931. this.playedTimes = 0;
  7932. this._isPlaying = !1;
  7933. this.startTime = 0;
  7934. this._started = !1;
  7935. d.removeAnimation(this)
  7936. };
  7937. Object.defineProperty(d.prototype, "isPaused", {
  7938. get: function() {
  7939. return this._isPaused
  7940. },
  7941. enumerable: !0,
  7942. configurable: !0
  7943. });
  7944. d.prototype.pause = function() {
  7945. this._started && (this._isPaused = !0,
  7946. this.pauseTime = c.getTimer(), this._isPlaying = !1, d.removeAnimation(this))
  7947. };
  7948. d.prototype.resume = function() {
  7949. this._started && this._isPaused && (this._isPaused = !1, this.startTime += c.getTimer() - this.pauseTime, this.pauseTime = -1, d.addAnimation(this))
  7950. };
  7951. Object.defineProperty(d.prototype, "started", {
  7952. get: function() {
  7953. return this._started
  7954. },
  7955. enumerable: !0,
  7956. configurable: !0
  7957. });
  7958. d.prototype.doInterval = function() {
  7959. var a = d.currentTime - this.startTime - (0 < this.playedTimes ? this._repeatDelay : this._startDelay);
  7960. if (0 > a) return !1;
  7961. this._isPlaying ||
  7962. (this._isPlaying = !0, 0 == this.playedTimes && null != this.startFunction && this.startFunction.call(this.thisObject, this));
  7963. var b = 0 == this._duration ? 1 : Math.min(a, this._duration) / this._duration;
  7964. this.caculateCurrentValue(b);
  7965. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  7966. if (a = a >= this._duration) this.playedTimes++, this._isPlaying = !1, this.startTime = d.currentTime, 0 == this._repeatCount || this.playedTimes < this._repeatCount ? a = !1 : (d.removeAnimation(this), this._started = !1, this.playedTimes = 0);
  7967. a &&
  7968. null != this.endFunction && this.endFunction.call(this.thisObject, this);
  7969. return a
  7970. };
  7971. d.prototype.caculateCurrentValue = function(a) {
  7972. this.easerFunction && (a = this.easerFunction(a));
  7973. for (var b = this.motionPaths, c = b.length, d = 0; d < c; d++) {
  7974. var e = b[d];
  7975. this.currentValue[e.prop] = e.from + (e.to - e.from) * a
  7976. }
  7977. };
  7978. d.addAnimation = function(a) {
  7979. -1 == d.activeAnimations.indexOf(a) && (d.activeAnimations.push(a), d.registered || (d.registered = !0, c.Ticker.getInstance().register(d.onEnterFrame, null)))
  7980. };
  7981. d.removeAnimation = function(a) {
  7982. a = d.activeAnimations.indexOf(a); - 1 != a && (d.activeAnimations.splice(a, 1), a <= d.currentIntervalIndex && d.currentIntervalIndex--);
  7983. 0 == d.activeAnimations.length && d.registered && (d.registered = !1, c.Ticker.getInstance().unregister(d.onEnterFrame, null))
  7984. };
  7985. d.onEnterFrame = function(a, b) {
  7986. d.currentTime = c.getTimer();
  7987. for (d.currentIntervalIndex = 0; d.currentIntervalIndex < d.activeAnimations.length;) d.activeAnimations[d.currentIntervalIndex].doInterval(), d.currentIntervalIndex++;
  7988. d.currentIntervalIndex = -1;
  7989. 0 == d.activeAnimations.length && d.registered && (d.registered = !1, c.Ticker.getInstance().unregister(d.onEnterFrame, null))
  7990. };
  7991. d.currentTime = 0;
  7992. d.TIMER_RESOLUTION = 1E3 / 60;
  7993. d.activeAnimations = [];
  7994. d.currentIntervalIndex = -1;
  7995. return d
  7996. }();
  7997. c.Animation = e
  7998. })(egret || (egret = {}));
  7999. __extends = this.__extends || function(c, e) {
  8000. function d() {
  8001. this.constructor = c
  8002. }
  8003. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8004. d.prototype = e.prototype;
  8005. c.prototype = new d
  8006. };
  8007. (function(c) {
  8008. var e = function(c) {
  8009. function a() {
  8010. c.call(this);
  8011. this._maximum = 100;
  8012. this.maxChanged = !1;
  8013. this._minimum = 0;
  8014. this.minChanged = !1;
  8015. this._stepSize = 1;
  8016. this.stepSizeChanged = !1;
  8017. this._changedValue = this._value = 0;
  8018. this.valueChanged = !1;
  8019. this._snapInterval = 1;
  8020. this._explicitSnapInterval = this.snapIntervalChanged = !1
  8021. }
  8022. __extends(a, c);
  8023. Object.defineProperty(a.prototype, "maximum", {
  8024. get: function() {
  8025. return this._maximum
  8026. },
  8027. set: function(b) {
  8028. this._setMaximun(b)
  8029. },
  8030. enumerable: !0,
  8031. configurable: !0
  8032. });
  8033. a.prototype._setMaximun = function(b) {
  8034. b !=
  8035. this._maximum && (this._maximum = b, this.maxChanged = !0, this.invalidateProperties())
  8036. };
  8037. Object.defineProperty(a.prototype, "minimum", {
  8038. get: function() {
  8039. return this._minimum
  8040. },
  8041. set: function(b) {
  8042. this._setMinimun(b)
  8043. },
  8044. enumerable: !0,
  8045. configurable: !0
  8046. });
  8047. a.prototype._setMinimun = function(b) {
  8048. b != this._minimum && (this._minimum = b, this.minChanged = !0, this.invalidateProperties())
  8049. };
  8050. Object.defineProperty(a.prototype, "stepSize", {
  8051. get: function() {
  8052. return this._stepSize
  8053. },
  8054. set: function(b) {
  8055. b != this._stepSize && (this._stepSize = b, this.stepSizeChanged = !0, this.invalidateProperties())
  8056. },
  8057. enumerable: !0,
  8058. configurable: !0
  8059. });
  8060. Object.defineProperty(a.prototype, "value", {
  8061. get: function() {
  8062. return this._getValue()
  8063. },
  8064. set: function(b) {
  8065. this._setValue(b)
  8066. },
  8067. enumerable: !0,
  8068. configurable: !0
  8069. });
  8070. a.prototype._setValue = function(b) {
  8071. b != this.value && (this._changedValue = b, this.valueChanged = !0, this.invalidateProperties())
  8072. };
  8073. a.prototype._getValue = function() {
  8074. return this.valueChanged ? this._changedValue : this._value
  8075. };
  8076. Object.defineProperty(a.prototype, "snapInterval", {
  8077. get: function() {
  8078. return this._snapInterval
  8079. },
  8080. set: function(b) {
  8081. this._explicitSnapInterval = !0;
  8082. b != this._snapInterval && (isNaN(b) ? (this._snapInterval = 1, this._explicitSnapInterval = !1) : this._snapInterval = b, this.stepSizeChanged = this.snapIntervalChanged = !0, this.invalidateProperties())
  8083. },
  8084. enumerable: !0,
  8085. configurable: !0
  8086. });
  8087. a.prototype.commitProperties = function() {
  8088. c.prototype.commitProperties.call(this);
  8089. this.minimum > this.maximum && (this.maxChanged ? this._maximum = this._minimum : this._minimum = this._maximum);
  8090. if (this.valueChanged || this.maxChanged || this.minChanged ||
  8091. this.snapIntervalChanged) {
  8092. var b = this.valueChanged ? this._changedValue : this._value;
  8093. this.snapIntervalChanged = this.minChanged = this.maxChanged = this.valueChanged = !1;
  8094. this.setValue(this.nearestValidValue(b, this.snapInterval))
  8095. }
  8096. 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)
  8097. };
  8098. a.prototype.nearestValidSize = function(b) {
  8099. var a = this.snapInterval;
  8100. if (0 == a) return b;
  8101. b = Math.round(b / a) * a;
  8102. return Math.abs(b) < a ? a : b
  8103. };
  8104. a.prototype.nearestValidValue = function(b, a) {
  8105. if (0 == a) return Math.max(this.minimum, Math.min(this.maximum, b));
  8106. var c = this.maximum - this.minimum,
  8107. d = 1;
  8108. b -= this.minimum;
  8109. 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));
  8110. var e = Math.max(0, Math.floor(b / a) * a),
  8111. c = Math.min(c, Math.floor((b + a) / a) * a);
  8112. return (b - e >= (c - e) / 2 ? c : e) / d + this.minimum
  8113. };
  8114. a.prototype.setValue = function(b) {
  8115. this._value != b &&
  8116. (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)
  8117. };
  8118. a.prototype.changeValueByStep = function(b) {
  8119. "undefined" === typeof b && (b = !0);
  8120. 0 != this.stepSize && this.setValue(this.nearestValidValue(b ? this.value + this.stepSize : this.value - this.stepSize, this.snapInterval))
  8121. };
  8122. return a
  8123. }(c.SkinnableComponent);
  8124. c.Range = e
  8125. })(egret || (egret = {}));
  8126. __extends = this.__extends || function(c, e) {
  8127. function d() {
  8128. this.constructor = c
  8129. }
  8130. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8131. d.prototype = e.prototype;
  8132. c.prototype = new d
  8133. };
  8134. (function(c) {
  8135. var e = function(d) {
  8136. function a() {
  8137. d.call(this);
  8138. this._slideDuration = 300;
  8139. this.needUpdateValue = !1;
  8140. this.addEventListener(c.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  8141. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.mouseDownHandler, this)
  8142. }
  8143. __extends(a, d);
  8144. Object.defineProperty(a.prototype, "slideDuration", {
  8145. get: function() {
  8146. return this._slideDuration
  8147. },
  8148. set: function(b) {
  8149. this._slideDuration = b
  8150. },
  8151. enumerable: !0,
  8152. configurable: !0
  8153. });
  8154. Object.defineProperty(a.prototype, "maximum", {
  8155. get: function() {
  8156. return this._maximum
  8157. },
  8158. set: function(b) {
  8159. b != this._maximum && (this._setMaximun(b), this.invalidateDisplayList())
  8160. },
  8161. enumerable: !0,
  8162. configurable: !0
  8163. });
  8164. Object.defineProperty(a.prototype, "minimum", {
  8165. get: function() {
  8166. return this._minimum
  8167. },
  8168. set: function(b) {
  8169. b != this._minimum && (this._setMinimun(b), this.invalidateDisplayList())
  8170. },
  8171. enumerable: !0,
  8172. configurable: !0
  8173. });
  8174. Object.defineProperty(a.prototype, "value", {
  8175. get: function() {
  8176. return this._getValue()
  8177. },
  8178. set: function(b) {
  8179. b != this._getValue() && (this._setValue(b), this.invalidateDisplayList())
  8180. },
  8181. enumerable: !0,
  8182. configurable: !0
  8183. });
  8184. a.prototype.setValue = function(b) {
  8185. d.prototype.setValue.call(this, b);
  8186. this.invalidateDisplayList()
  8187. };
  8188. a.prototype.pointToValue = function(b, a) {
  8189. return this.minimum
  8190. };
  8191. a.prototype.changeValueByStep = function(b) {
  8192. "undefined" === typeof b && (b = !0);
  8193. var a = this.value;
  8194. d.prototype.changeValueByStep.call(this, b);
  8195. this.value != a && this.dispatchEventWith(c.Event.CHANGE)
  8196. };
  8197. a.prototype.partAdded = function(b, a) {
  8198. d.prototype.partAdded.call(this, b, a);
  8199. a == this.thumb ? (this.thumb.addEventListener(c.TouchEvent.TOUCH_BEGIN,
  8200. 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))
  8201. };
  8202. a.prototype.partRemoved = function(b, a) {
  8203. d.prototype.partRemoved.call(this, b, a);
  8204. 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))
  8205. };
  8206. a.prototype.updateDisplayList =
  8207. function(b, a) {
  8208. d.prototype.updateDisplayList.call(this, b, a);
  8209. this.updateSkinDisplayList()
  8210. };
  8211. a.prototype.updateSkinDisplayList = function() {};
  8212. a.prototype.addedToStageHandler = function(b) {
  8213. this.updateSkinDisplayList()
  8214. };
  8215. a.prototype.track_resizeHandler = function(b) {
  8216. this.updateSkinDisplayList()
  8217. };
  8218. a.prototype.thumb_resizeHandler = function(b) {
  8219. this.updateSkinDisplayList()
  8220. };
  8221. a.prototype.thumb_updateCompleteHandler = function(b) {
  8222. this.updateSkinDisplayList();
  8223. this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler,
  8224. this)
  8225. };
  8226. a.prototype.thumb_mouseDownHandler = function(b) {
  8227. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  8228. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8229. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  8230. this.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  8231. b = this.thumb.globalToLocal(b.stageX, b.stageY, c.Point.identity);
  8232. this._clickOffsetX = b.x;
  8233. this._clickOffsetY = b.y;
  8234. c.TrackBaseEvent.dispatchTrackBaseEvent(this,
  8235. c.TrackBaseEvent.THUMB_PRESS);
  8236. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_START)
  8237. };
  8238. a.prototype.onEnterFrame = function(b) {
  8239. this.needUpdateValue && this.track && (this.updateWhenMouseMove(), this.needUpdateValue = !1)
  8240. };
  8241. a.prototype.updateWhenMouseMove = function() {
  8242. if (this.track) {
  8243. var b = this.track.globalToLocal(this._moveStageX, this._moveStageY, c.Point.identity),
  8244. b = this.pointToValue(b.x - this._clickOffsetX, b.y - this._clickOffsetY),
  8245. b = this.nearestValidValue(b, this.snapInterval);
  8246. b != this.value && (this.setValue(b), this.validateDisplayList(),
  8247. c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_DRAG), this.dispatchEventWith(c.Event.CHANGE))
  8248. }
  8249. };
  8250. a.prototype.stage_mouseMoveHandler = function(b) {
  8251. this._moveStageX = b.stageX;
  8252. this._moveStageY = b.stageY;
  8253. this.needUpdateValue || (this.needUpdateValue = !0)
  8254. };
  8255. a.prototype.stage_mouseUpHandler = function(b) {
  8256. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  8257. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8258. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,
  8259. this.stage_mouseUpHandler, this);
  8260. this.removeEventListener(c.Event.ENTER_FRAME, this.updateWhenMouseMove, this);
  8261. this.needUpdateValue && (this.updateWhenMouseMove(), this.needUpdateValue = !1);
  8262. c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_RELEASE);
  8263. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8264. };
  8265. a.prototype.track_mouseDownHandler = function(b) {};
  8266. a.prototype.mouseDownHandler = function(b) {
  8267. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  8268. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  8269. this.mouseDownTarget = b.target
  8270. };
  8271. a.prototype.stage_mouseUpSomewhereHandler = function(b) {
  8272. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  8273. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  8274. if (this.mouseDownTarget != b.target && b instanceof c.TouchEvent && this.contains(b.target)) {
  8275. var a = b.target.localToGlobal(b.localX,
  8276. b.localY);
  8277. c.TouchEvent.dispatchTouchEvent(this, c.TouchEvent.TOUCH_TAP, b.touchPointID, a.x, a.y, b.ctrlKey, b.altKey, b.shiftKey, b.touchDown)
  8278. }
  8279. this.mouseDownTarget = null
  8280. };
  8281. return a
  8282. }(c.Range);
  8283. c.TrackBase = e
  8284. })(egret || (egret = {}));
  8285. __extends = this.__extends || function(c, e) {
  8286. function d() {
  8287. this.constructor = c
  8288. }
  8289. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8290. d.prototype = e.prototype;
  8291. c.prototype = new d
  8292. };
  8293. (function(c) {
  8294. var e = function(d) {
  8295. function a() {
  8296. d.call(this);
  8297. this._showTrackHighlight = !0;
  8298. this._pendingValue = 0;
  8299. this._liveDragging = !0;
  8300. this.maximum = 10
  8301. }
  8302. __extends(a, d);
  8303. Object.defineProperty(a.prototype, "showTrackHighlight", {
  8304. get: function() {
  8305. return this._showTrackHighlight
  8306. },
  8307. set: function(b) {
  8308. this._showTrackHighlight != b && (this._showTrackHighlight = b, this.trackHighlight && (this.trackHighlight.visible = b), this.invalidateDisplayList())
  8309. },
  8310. enumerable: !0,
  8311. configurable: !0
  8312. });
  8313. Object.defineProperty(a.prototype, "pendingValue", {
  8314. get: function() {
  8315. return this._pendingValue
  8316. },
  8317. set: function(b) {
  8318. b != this._pendingValue && (this._pendingValue = b, this.invalidateDisplayList())
  8319. },
  8320. enumerable: !0,
  8321. configurable: !0
  8322. });
  8323. a.prototype.setValue = function(b) {
  8324. this._pendingValue = b;
  8325. d.prototype.setValue.call(this, b)
  8326. };
  8327. a.prototype.animationUpdateHandler = function(b) {
  8328. this.pendingValue = b.currentValue.value
  8329. };
  8330. a.prototype.animationEndHandler = function(b) {
  8331. this.setValue(this.slideToValue);
  8332. this.dispatchEventWith(c.Event.CHANGE);
  8333. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8334. };
  8335. a.prototype.stopAnimation = function() {
  8336. this.animator.stop();
  8337. this.setValue(this.nearestValidValue(this.pendingValue, this.snapInterval));
  8338. this.dispatchEventWith(c.Event.CHANGE);
  8339. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8340. };
  8341. a.prototype.thumb_mouseDownHandler = function(b) {
  8342. this.animator && this.animator.isPlaying && this.stopAnimation();
  8343. d.prototype.thumb_mouseDownHandler.call(this, b)
  8344. };
  8345. Object.defineProperty(a.prototype, "liveDragging", {
  8346. get: function() {
  8347. return this._liveDragging
  8348. },
  8349. set: function(b) {
  8350. this._liveDragging =
  8351. b
  8352. },
  8353. enumerable: !0,
  8354. configurable: !0
  8355. });
  8356. a.prototype.updateWhenMouseMove = function() {
  8357. if (this.track) {
  8358. var b = this.track.globalToLocal(this._moveStageX, this._moveStageY, c.Point.identity),
  8359. b = this.pointToValue(b.x - this._clickOffsetX, b.y - this._clickOffsetY),
  8360. b = this.nearestValidValue(b, this.snapInterval);
  8361. 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)
  8362. }
  8363. };
  8364. a.prototype.stage_mouseUpHandler =
  8365. function(b) {
  8366. d.prototype.stage_mouseUpHandler.call(this, b);
  8367. !1 == this.liveDragging && this.value != this.pendingValue && (this.setValue(this.pendingValue), this.dispatchEventWith(c.Event.CHANGE))
  8368. };
  8369. a.prototype.track_mouseDownHandler = function(b) {
  8370. 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 ?
  8371. (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 = [{
  8372. prop: "value",
  8373. from: this.pendingValue,
  8374. to: this.slideToValue
  8375. }], c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_START), this.animator.play()) : (this.setValue(b), this.dispatchEventWith(c.Event.CHANGE))))
  8376. };
  8377. a.prototype.partAdded = function(b, a) {
  8378. d.prototype.partAdded.call(this, b, a);
  8379. a == this.trackHighlight && (this.trackHighlight.touchEnabled = !1, this.trackHighlight instanceof c.DisplayObjectContainer && (this.trackHighlight.touchChildren = !1), this.trackHighlight.visible = this._showTrackHighlight)
  8380. };
  8381. return a
  8382. }(c.TrackBase);
  8383. c.SliderBase = e
  8384. })(egret || (egret = {}));
  8385. __extends = this.__extends || function(c, e) {
  8386. function d() {
  8387. this.constructor = c
  8388. }
  8389. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8390. d.prototype = e.prototype;
  8391. c.prototype = new d
  8392. };
  8393. (function(c) {
  8394. var e = function(d) {
  8395. function a() {
  8396. d.call(this);
  8397. this._maxDisplayedLines = 0;
  8398. this.lastUnscaledWidth = NaN;
  8399. this._padding = 0;
  8400. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  8401. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.updateCompleteHandler, this)
  8402. }
  8403. __extends(a, d);
  8404. a.prototype.updateCompleteHandler = function(b) {
  8405. this.lastUnscaledWidth = NaN
  8406. };
  8407. Object.defineProperty(a.prototype, "maxDisplayedLines", {
  8408. get: function() {
  8409. return this._maxDisplayedLines
  8410. },
  8411. set: function(b) {
  8412. this._maxDisplayedLines !=
  8413. b && (this._maxDisplayedLines = b, this.invalidateSize(), this.invalidateDisplayList())
  8414. },
  8415. enumerable: !0,
  8416. configurable: !0
  8417. });
  8418. Object.defineProperty(a.prototype, "padding", {
  8419. get: function() {
  8420. return this._padding
  8421. },
  8422. set: function(b) {
  8423. this._padding != b && (this._padding = b, this.invalidateSize(), this.invalidateDisplayList())
  8424. },
  8425. enumerable: !0,
  8426. configurable: !0
  8427. });
  8428. Object.defineProperty(a.prototype, "paddingLeft", {
  8429. get: function() {
  8430. return this._paddingLeft
  8431. },
  8432. set: function(b) {
  8433. this._paddingLeft != b && (this._paddingLeft = b, this.invalidateSize(),
  8434. this.invalidateDisplayList())
  8435. },
  8436. enumerable: !0,
  8437. configurable: !0
  8438. });
  8439. Object.defineProperty(a.prototype, "paddingRight", {
  8440. get: function() {
  8441. return this._paddingRight
  8442. },
  8443. set: function(b) {
  8444. this._paddingRight != b && (this._paddingRight = b, this.invalidateSize(), this.invalidateDisplayList())
  8445. },
  8446. enumerable: !0,
  8447. configurable: !0
  8448. });
  8449. Object.defineProperty(a.prototype, "paddingTop", {
  8450. get: function() {
  8451. return this._paddingTop
  8452. },
  8453. set: function(b) {
  8454. this._paddingTop != b && (this._paddingTop = b, this.invalidateSize(), this.invalidateDisplayList())
  8455. },
  8456. enumerable: !0,
  8457. configurable: !0
  8458. });
  8459. Object.defineProperty(a.prototype, "paddingBottom", {
  8460. get: function() {
  8461. return this._paddingBottom
  8462. },
  8463. set: function(b) {
  8464. this._paddingBottom != b && (this._paddingBottom = b, this.invalidateSize(), this.invalidateDisplayList())
  8465. },
  8466. enumerable: !0,
  8467. configurable: !0
  8468. });
  8469. a.prototype.measure = function() {
  8470. this._invalidatePropertiesFlag && this.validateProperties();
  8471. if (this.isSpecialCase())
  8472. if (isNaN(this.lastUnscaledWidth)) this._oldPreferHeight = this._oldPreferWidth = NaN;
  8473. else {
  8474. this.measureUsingWidth(this.lastUnscaledWidth);
  8475. return
  8476. }
  8477. var b;
  8478. isNaN(this.explicitWidth) ? 1E4 != this.maxWidth && (b = this.maxWidth) : b = this.explicitWidth;
  8479. this.measureUsingWidth(b)
  8480. };
  8481. a.prototype.isSpecialCase = function() {
  8482. return 1 != this._maxDisplayedLines && (!isNaN(this.percentWidth) || !isNaN(this.left) && !isNaN(this.right)) && isNaN(this.explicitHeight) && isNaN(this.percentHeight)
  8483. };
  8484. a.prototype.measureUsingWidth = function(b) {
  8485. var a = this._textField.text;
  8486. this._textChanged && (this._textField.text = this._text);
  8487. var c = isNaN(this._padding) ? 0 : this._padding,
  8488. d = isNaN(this._paddingLeft) ?
  8489. c : this._paddingLeft,
  8490. e = isNaN(this._paddingRight) ? c : this._paddingRight,
  8491. h = isNaN(this._paddingTop) ? c : this._paddingTop,
  8492. c = isNaN(this._paddingBottom) ? c : this._paddingBottom;
  8493. this._textField.width = NaN;
  8494. this._textField.height = NaN;
  8495. isNaN(b) || (this._textField.width = b - d - e);
  8496. this.measuredWidth = Math.ceil(this._textField.measuredWidth);
  8497. this.measuredHeight = Math.ceil(this._textField.measuredHeight);
  8498. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (b = this._textField.lineSpacing, this.measuredHeight =
  8499. (this._textField.size + b) * this._maxDisplayedLines - b);
  8500. this.measuredWidth += d + e;
  8501. this.measuredHeight += h + c;
  8502. this._textField.text = a
  8503. };
  8504. a.prototype.updateDisplayList = function(b, a) {
  8505. this.$updateDisplayList(b, a);
  8506. var c = isNaN(this._padding) ? 0 : this._padding,
  8507. d = isNaN(this._paddingLeft) ? c : this._paddingLeft,
  8508. e = isNaN(this._paddingRight) ? c : this._paddingRight,
  8509. h = isNaN(this._paddingTop) ? c : this._paddingTop,
  8510. c = isNaN(this._paddingBottom) ? c : this._paddingBottom;
  8511. this._textField.x = d;
  8512. this._textField.y = h;
  8513. if (this.isSpecialCase()) {
  8514. var k =
  8515. isNaN(this.lastUnscaledWidth) || this.lastUnscaledWidth != b;
  8516. this.lastUnscaledWidth = b;
  8517. if (k) {
  8518. this._oldPreferHeight = this._oldPreferWidth = NaN;
  8519. this.invalidateSize();
  8520. return
  8521. }
  8522. }
  8523. this._invalidateSizeFlag && this.validateSize();
  8524. this._textField.visible || (this._textField.visible = !0);
  8525. this._textField.width = b - d - e;
  8526. d = a - h - c;
  8527. this._textField.height = d;
  8528. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (e = this._textField.lineSpacing, this._textField.height = Math.min(d, (this._textField.size + e) * this._maxDisplayedLines -
  8529. e))
  8530. };
  8531. return a
  8532. }(c.TextBase);
  8533. c.Label = e
  8534. })(egret || (egret = {}));
  8535. __extends = this.__extends || function(c, e) {
  8536. function d() {
  8537. this.constructor = c
  8538. }
  8539. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8540. d.prototype = e.prototype;
  8541. c.prototype = new d
  8542. };
  8543. (function(c) {
  8544. var e = function(d) {
  8545. function a() {
  8546. d.call(this);
  8547. this._fillColor = 16777215;
  8548. this._fillAlpha = 1;
  8549. this._strokeColor = 4473924;
  8550. this._strokeAlpha = 0;
  8551. this._strokeWeight = 1;
  8552. this.touchChildren = !1
  8553. }
  8554. __extends(a, d);
  8555. Object.defineProperty(a.prototype, "graphics", {
  8556. get: function() {
  8557. this._graphics || (this._graphics = new c.Graphics);
  8558. return this._graphics
  8559. },
  8560. enumerable: !0,
  8561. configurable: !0
  8562. });
  8563. a.prototype._render = function(b) {
  8564. this._graphics && this._graphics._draw(b);
  8565. d.prototype._render.call(this, b)
  8566. };
  8567. Object.defineProperty(a.prototype,
  8568. "fillColor", {
  8569. get: function() {
  8570. return this._fillColor
  8571. },
  8572. set: function(b) {
  8573. this._fillColor != b && (this._fillColor = b, this.invalidateDisplayList())
  8574. },
  8575. enumerable: !0,
  8576. configurable: !0
  8577. });
  8578. Object.defineProperty(a.prototype, "fillAlpha", {
  8579. get: function() {
  8580. return this._fillAlpha
  8581. },
  8582. set: function(b) {
  8583. this._fillAlpha != b && (this._fillAlpha = b, this.invalidateDisplayList())
  8584. },
  8585. enumerable: !0,
  8586. configurable: !0
  8587. });
  8588. Object.defineProperty(a.prototype, "strokeColor", {
  8589. get: function() {
  8590. return this._strokeColor
  8591. },
  8592. set: function(b) {
  8593. this._strokeColor != b &&
  8594. (this._strokeColor = b, this.invalidateDisplayList())
  8595. },
  8596. enumerable: !0,
  8597. configurable: !0
  8598. });
  8599. Object.defineProperty(a.prototype, "strokeAlpha", {
  8600. get: function() {
  8601. return this._strokeAlpha
  8602. },
  8603. set: function(b) {
  8604. this._strokeAlpha != b && (this._strokeAlpha = b, this.invalidateDisplayList())
  8605. },
  8606. enumerable: !0,
  8607. configurable: !0
  8608. });
  8609. Object.defineProperty(a.prototype, "strokeWeight", {
  8610. get: function() {
  8611. return this._strokeWeight
  8612. },
  8613. set: function(b) {
  8614. this._strokeWeight != b && (this._strokeWeight = b, this.invalidateDisplayList())
  8615. },
  8616. enumerable: !0,
  8617. configurable: !0
  8618. });
  8619. a.prototype._measureBounds = function() {
  8620. var b = d.prototype._measureBounds.call(this),
  8621. a = this.width,
  8622. c = this.height;
  8623. 0 < b.x && (b.x = 0);
  8624. 0 < b.y && (b.y = 0);
  8625. 0 + a > b.right && (b.right = 0 + a);
  8626. 0 + c > b.bottom && (b.bottom = 0 + c);
  8627. return b
  8628. };
  8629. a.prototype.updateDisplayList = function(b, a) {
  8630. d.prototype.updateDisplayList.call(this, b, b);
  8631. var c = this.graphics;
  8632. c.clear();
  8633. c.beginFill(this._fillColor, this._fillAlpha);
  8634. 0 < this._strokeAlpha && c.lineStyle(this._strokeWeight, this._strokeColor, this._strokeAlpha, !0, "normal", "square", "miter");
  8635. c.drawRect(0, 0,
  8636. b, a);
  8637. c.endFill()
  8638. };
  8639. return a
  8640. }(c.UIComponent);
  8641. c.Rect = e
  8642. })(egret || (egret = {}));
  8643. __extends = this.__extends || function(c, e) {
  8644. function d() {
  8645. this.constructor = c
  8646. }
  8647. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8648. d.prototype = e.prototype;
  8649. c.prototype = new d
  8650. };
  8651. (function(c) {
  8652. var e = function(c) {
  8653. function a() {
  8654. c.call(this);
  8655. this.hostComponentKey = "egret.Button"
  8656. }
  8657. __extends(a, c);
  8658. return a
  8659. }(c.ButtonBase);
  8660. c.Button = e
  8661. })(egret || (egret = {}));
  8662. __extends = this.__extends || function(c, e) {
  8663. function d() {
  8664. this.constructor = c
  8665. }
  8666. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8667. d.prototype = e.prototype;
  8668. c.prototype = new d
  8669. };
  8670. (function(c) {
  8671. var e = function(c) {
  8672. function a() {
  8673. c.call(this);
  8674. this.hostComponentKey = "egret.ToggleButton"
  8675. }
  8676. __extends(a, c);
  8677. return a
  8678. }(c.ToggleButtonBase);
  8679. c.ToggleButton = e
  8680. })(egret || (egret = {}));
  8681. __extends = this.__extends || function(c, e) {
  8682. function d() {
  8683. this.constructor = c
  8684. }
  8685. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8686. d.prototype = e.prototype;
  8687. c.prototype = new d
  8688. };
  8689. (function(c) {
  8690. var e = function(c) {
  8691. function a() {
  8692. c.call(this);
  8693. this.hostComponentKey = "egret.CheckBox"
  8694. }
  8695. __extends(a, c);
  8696. return a
  8697. }(c.ToggleButtonBase);
  8698. c.CheckBox = e
  8699. })(egret || (egret = {}));
  8700. __extends = this.__extends || function(c, e) {
  8701. function d() {
  8702. this.constructor = c
  8703. }
  8704. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8705. d.prototype = e.prototype;
  8706. c.prototype = new d
  8707. };
  8708. (function(c) {
  8709. var e = function(d) {
  8710. function a() {
  8711. d.call(this);
  8712. this.radioButtons = [];
  8713. this._enabled = !0;
  8714. this._name = "_radioButtonGroup" + a.groupCount;
  8715. a.groupCount++
  8716. }
  8717. __extends(a, d);
  8718. Object.defineProperty(a.prototype, "enabled", {
  8719. get: function() {
  8720. return this._enabled
  8721. },
  8722. set: function(b) {
  8723. if (this._enabled != b)
  8724. for (this._enabled = b, b = 0; b < this.numRadioButtons; b++) this.getRadioButtonAt(b).invalidateSkinState()
  8725. },
  8726. enumerable: !0,
  8727. configurable: !0
  8728. });
  8729. Object.defineProperty(a.prototype, "numRadioButtons", {
  8730. get: function() {
  8731. return this.radioButtons.length
  8732. },
  8733. enumerable: !0,
  8734. configurable: !0
  8735. });
  8736. Object.defineProperty(a.prototype, "selectedValue", {
  8737. get: function() {
  8738. return this.selection ? null != this.selection.value ? this.selection.value : this.selection.label : null
  8739. },
  8740. set: function(b) {
  8741. this._selectedValue = b;
  8742. if (null == b) this._setSelection(null, !1);
  8743. else
  8744. for (var a = this.numRadioButtons, d = 0; d < a; d++) {
  8745. var e = this.getRadioButtonAt(d);
  8746. if (e.value == b || e.label == b) {
  8747. this.changeSelection(d, !1);
  8748. this._selectedValue = null;
  8749. c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT);
  8750. break
  8751. }
  8752. }
  8753. },
  8754. enumerable: !0,
  8755. configurable: !0
  8756. });
  8757. Object.defineProperty(a.prototype, "selection", {
  8758. get: function() {
  8759. return this._selection
  8760. },
  8761. set: function(b) {
  8762. this._selection != b && this._setSelection(b, !1)
  8763. },
  8764. enumerable: !0,
  8765. configurable: !0
  8766. });
  8767. a.prototype.getRadioButtonAt = function(b) {
  8768. return 0 <= b && b < this.numRadioButtons ? this.radioButtons[b] : null
  8769. };
  8770. a.prototype._addInstance = function(b) {
  8771. function a(b, d) {
  8772. var e = b.parent,
  8773. l = d.parent;
  8774. if (!e || !l) return 0;
  8775. var n = b instanceof c.UIComponent ? b.nestLevel : -1,
  8776. q = d instanceof c.UIComponent ? d.nestLevel : -1,
  8777. p = 0,
  8778. r = 0;
  8779. e ==
  8780. l && (p = "getElementIndex" in e && "ownerChanged" in b ? e.getElementIndex(b) : e.getChildIndex(b), r = "getElementIndex" in l && "ownerChanged" in d ? l.getElementIndex(d) : l.getChildIndex(d));
  8781. return n > q || p > r ? 1 : n < q || r > p ? -1 : b == d ? 0 : a(e, l)
  8782. }
  8783. b.addEventListener(c.Event.REMOVED, this.radioButton_removedHandler, this);
  8784. this.radioButtons.push(b);
  8785. this.radioButtons.sort(a);
  8786. for (var d = 0; d < this.radioButtons.length; d++) this.radioButtons[d]._indexNumber = d;
  8787. this._selectedValue && (this.selectedValue = this._selectedValue);
  8788. !0 == b.selected && (this.selection =
  8789. b);
  8790. b._radioButtonGroup = this;
  8791. b.invalidateSkinState();
  8792. this.dispatchEventWith("numRadioButtonsChanged")
  8793. };
  8794. a.prototype._removeInstance = function(b) {
  8795. this.doRemoveInstance(b, !1)
  8796. };
  8797. a.prototype.doRemoveInstance = function(b, a) {
  8798. "undefined" === typeof a && (a = !0);
  8799. if (b) {
  8800. for (var d = !1, e = 0; e < this.numRadioButtons; e++) {
  8801. var f = this.getRadioButtonAt(e);
  8802. 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(),
  8803. this.radioButtons.splice(e, 1), d = !0, e--)
  8804. }
  8805. d && this.dispatchEventWith("numRadioButtonsChanged")
  8806. }
  8807. };
  8808. a.prototype._setSelection = function(b, a) {
  8809. "undefined" === typeof a && (a = !0);
  8810. if (this._selection != b) {
  8811. if (b)
  8812. for (var d = this.numRadioButtons, e = 0; e < d; e++) {
  8813. if (b == this.getRadioButtonAt(e)) {
  8814. this.changeSelection(e, a);
  8815. break
  8816. }
  8817. } else this.selection && (this._selection.selected = !1, this._selection = null, a && this.dispatchEventWith(c.Event.CHANGE));
  8818. c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT)
  8819. }
  8820. };
  8821. a.prototype.changeSelection =
  8822. function(b, a) {
  8823. "undefined" === typeof a && (a = !0);
  8824. var d = this.getRadioButtonAt(b);
  8825. d && d != this._selection && (this._selection && (this._selection.selected = !1), this._selection = d, this._selection.selected = !0, a && this.dispatchEventWith(c.Event.CHANGE))
  8826. };
  8827. a.prototype.radioButton_addedHandler = function(b) {
  8828. if (b = b.target) b.removeEventListener(c.Event.ADDED, this.radioButton_addedHandler, this), this._addInstance(b)
  8829. };
  8830. a.prototype.radioButton_removedHandler = function(b) {
  8831. if (b = b.target) b.removeEventListener(c.Event.REMOVED, this.radioButton_removedHandler,
  8832. this), this.doRemoveInstance(b)
  8833. };
  8834. a.groupCount = 0;
  8835. return a
  8836. }(c.EventDispatcher);
  8837. c.RadioButtonGroup = e
  8838. })(egret || (egret = {}));
  8839. __extends = this.__extends || function(c, e) {
  8840. function d() {
  8841. this.constructor = c
  8842. }
  8843. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8844. d.prototype = e.prototype;
  8845. c.prototype = new d
  8846. };
  8847. (function(c) {
  8848. var e = function(d) {
  8849. function a() {
  8850. d.call(this);
  8851. this._indexNumber = 0;
  8852. this._radioButtonGroup = null;
  8853. this.groupChanged = !1;
  8854. this._groupName = "radioGroup";
  8855. this.hostComponentKey = "egret.RadioButton";
  8856. this.groupName = "radioGroup"
  8857. }
  8858. __extends(a, d);
  8859. Object.defineProperty(a.prototype, "enabled", {
  8860. get: function() {
  8861. return this._enabled ? !this._radioButtonGroup || this._radioButtonGroup.enabled : !1
  8862. },
  8863. set: function(b) {
  8864. this._setEnabled(b)
  8865. },
  8866. enumerable: !0,
  8867. configurable: !0
  8868. });
  8869. Object.defineProperty(a.prototype, "group", {
  8870. get: function() {
  8871. if (!this._group &&
  8872. this._groupName) {
  8873. a.automaticRadioButtonGroups || (a.automaticRadioButtonGroups = {});
  8874. var b = a.automaticRadioButtonGroups[this._groupName];
  8875. b || (b = new c.RadioButtonGroup, b._name = this._groupName, a.automaticRadioButtonGroups[this._groupName] = b);
  8876. this._group = b
  8877. }
  8878. return this._group
  8879. },
  8880. set: function(b) {
  8881. 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())
  8882. },
  8883. enumerable: !0,
  8884. configurable: !0
  8885. });
  8886. Object.defineProperty(a.prototype, "groupName", {
  8887. get: function() {
  8888. return this._groupName
  8889. },
  8890. set: function(b) {
  8891. b && "" != b && (this._groupName = b, this._radioButtonGroup && this._radioButtonGroup._removeInstance(this), this._group = null, this.groupChanged = !0, this.invalidateProperties(), this.invalidateDisplayList())
  8892. },
  8893. enumerable: !0,
  8894. configurable: !0
  8895. });
  8896. a.prototype._setSelected = function(b) {
  8897. d.prototype._setSelected.call(this, b);
  8898. this.invalidateDisplayList()
  8899. };
  8900. Object.defineProperty(a.prototype, "value", {
  8901. get: function() {
  8902. return this._value
  8903. },
  8904. set: function(b) {
  8905. this._value != b && (this._value = b, this.selected && this.group && c.UIEvent.dispatchUIEvent(this.group, c.UIEvent.VALUE_COMMIT))
  8906. },
  8907. enumerable: !0,
  8908. configurable: !0
  8909. });
  8910. a.prototype.commitProperties = function() {
  8911. this.groupChanged && (this.addToGroup(), this.groupChanged = !1);
  8912. d.prototype.commitProperties.call(this)
  8913. };
  8914. a.prototype.updateDisplayList = function(b, a) {
  8915. d.prototype.updateDisplayList.call(this, b, a);
  8916. this.group && (this.selected ? this._group.selection = this : this.group.selection ==
  8917. this && (this._group.selection = null))
  8918. };
  8919. a.prototype.buttonReleased = function() {
  8920. this.enabled && !this.selected && (this._radioButtonGroup || this.addToGroup(), d.prototype.buttonReleased.call(this), this.group._setSelection(this))
  8921. };
  8922. a.prototype.addToGroup = function() {
  8923. var b = this.group;
  8924. b && b._addInstance(this);
  8925. return b
  8926. };
  8927. return a
  8928. }(c.ToggleButtonBase);
  8929. c.RadioButton = e
  8930. })(egret || (egret = {}));
  8931. __extends = this.__extends || function(c, e) {
  8932. function d() {
  8933. this.constructor = c
  8934. }
  8935. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8936. d.prototype = e.prototype;
  8937. c.prototype = new d
  8938. };
  8939. (function(c) {
  8940. var e = function(d) {
  8941. function a() {
  8942. d.call(this);
  8943. this.elementsContentChanged = this.createChildrenCalled = !1;
  8944. this._elementsContent = []
  8945. }
  8946. __extends(a, d);
  8947. a.prototype.createChildren = function() {
  8948. d.prototype.createChildren.call(this);
  8949. this.createChildrenCalled = !0;
  8950. this.elementsContentChanged && (this.elementsContentChanged = !1, this.setElementsContent(this._elementsContent))
  8951. };
  8952. a.prototype._getElementsContent = function() {
  8953. return this._elementsContent
  8954. };
  8955. Object.defineProperty(a.prototype, "elementsContent", {
  8956. set: function(b) {
  8957. null ==
  8958. b && (b = []);
  8959. if (b != this._elementsContent)
  8960. if (this.createChildrenCalled) this.setElementsContent(b);
  8961. else {
  8962. this.elementsContentChanged = !0;
  8963. for (var a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  8964. this._elementsContent = b
  8965. }
  8966. },
  8967. enumerable: !0,
  8968. configurable: !0
  8969. });
  8970. a.prototype.setElementsContent = function(b) {
  8971. var a;
  8972. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  8973. this._elementsContent = b.concat();
  8974. b = this._elementsContent.length;
  8975. for (a =
  8976. 0; a < b; a++) {
  8977. var c = this._elementsContent[a];
  8978. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  8979. this._elementAdded(c, a)
  8980. }
  8981. };
  8982. Object.defineProperty(a.prototype, "numElements", {
  8983. get: function() {
  8984. return this._elementsContent.length
  8985. },
  8986. enumerable: !0,
  8987. configurable: !0
  8988. });
  8989. a.prototype.getElementAt = function(b) {
  8990. this.checkForRangeError(b);
  8991. return this._elementsContent[b]
  8992. };
  8993. a.prototype.checkForRangeError = function(b, a) {
  8994. "undefined" === typeof a && (a = !1);
  8995. var c =
  8996. this._elementsContent.length - 1;
  8997. a && c++;
  8998. if (0 > b || b > c) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  8999. };
  9000. a.prototype.addElement = function(b) {
  9001. var a = this.numElements;
  9002. b.parent == this && (a = this.numElements - 1);
  9003. return this.addElementAt(b, a)
  9004. };
  9005. a.prototype.addElementAt = function(b, a) {
  9006. if (b == this) return b;
  9007. this.checkForRangeError(a, !0);
  9008. var c = b.owner;
  9009. if (c == this || b.parent == this) return this.setElementIndex(b, a), b;
  9010. c && "removeElement" in c && b.owner.removeElement(b);
  9011. this._elementsContent.splice(a,
  9012. 0, b);
  9013. this.elementsContentChanged || this._elementAdded(b, a);
  9014. return b
  9015. };
  9016. a.prototype.removeElement = function(b) {
  9017. return this.removeElementAt(this.getElementIndex(b))
  9018. };
  9019. a.prototype.removeElementAt = function(b) {
  9020. this.checkForRangeError(b);
  9021. var a = this._elementsContent[b];
  9022. this.elementsContentChanged || this._elementRemoved(a, b);
  9023. this._elementsContent.splice(b, 1);
  9024. return a
  9025. };
  9026. a.prototype.removeAllElements = function() {
  9027. for (var b = this.numElements - 1; 0 <= b; b--) this.removeElementAt(b)
  9028. };
  9029. a.prototype.getElementIndex = function(b) {
  9030. return this._elementsContent.indexOf(b)
  9031. };
  9032. a.prototype.setElementIndex = function(b, a) {
  9033. this.checkForRangeError(a);
  9034. 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))
  9035. };
  9036. a.prototype.swapElements = function(b, a) {
  9037. this.swapElementsAt(this.getElementIndex(b), this.getElementIndex(a))
  9038. };
  9039. a.prototype.swapElementsAt = function(b, a) {
  9040. this.checkForRangeError(b);
  9041. this.checkForRangeError(a);
  9042. if (b > a) {
  9043. var c = a;
  9044. a = b;
  9045. b = c
  9046. } else if (b == a) return;
  9047. var c = this._elementsContent,
  9048. d = c[b],
  9049. e = c[a];
  9050. this.elementsContentChanged || (this._elementRemoved(d, b, !1), this._elementRemoved(e, a, !1));
  9051. c[b] = e;
  9052. c[a] = d;
  9053. this.elementsContentChanged || (this._elementAdded(e, b, !1), this._elementAdded(d, a, !1))
  9054. };
  9055. a.prototype._elementAdded = function(b, a, d) {
  9056. "undefined" === typeof d && (d = !0);
  9057. b instanceof c.DisplayObject && this._addToDisplayListAt(b, a, d);
  9058. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this,
  9059. c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9060. this.invalidateSize();
  9061. this.invalidateDisplayList()
  9062. };
  9063. a.prototype._elementRemoved = function(b, a, d) {
  9064. "undefined" === typeof d && (d = !0);
  9065. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_REMOVE, b, a);
  9066. b instanceof c.DisplayObject && b.parent == this && this._removeFromDisplayList(b, d);
  9067. this.invalidateSize();
  9068. this.invalidateDisplayList()
  9069. };
  9070. a.prototype.addChild = function(b) {
  9071. throw Error("addChild()" +
  9072. a.errorStr + "addElement()\u4ee3\u66ff");
  9073. };
  9074. a.prototype.addChildAt = function(b, c) {
  9075. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  9076. };
  9077. a.prototype.removeChild = function(b) {
  9078. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  9079. };
  9080. a.prototype.removeChildAt = function(b) {
  9081. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  9082. };
  9083. a.prototype.setChildIndex = function(b, c) {
  9084. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  9085. };
  9086. a.prototype.swapChildren =
  9087. function(b, c) {
  9088. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  9089. };
  9090. a.prototype.swapChildrenAt = function(b, c) {
  9091. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  9092. };
  9093. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  9094. return a
  9095. }(c.GroupBase);
  9096. c.Group = e
  9097. })(egret || (egret = {}));
  9098. __extends = this.__extends || function(c, e) {
  9099. function d() {
  9100. this.constructor = c
  9101. }
  9102. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9103. d.prototype = e.prototype;
  9104. c.prototype = new d
  9105. };
  9106. (function(c) {
  9107. var e = function(d) {
  9108. function a() {
  9109. d.call(this);
  9110. this._createAllChildren = !1;
  9111. this.proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  9112. this._selectedIndex = -1;
  9113. this.childOrderingChanged = this.notifyTabBar = !1;
  9114. this._setLayout(new c.BasicLayout)
  9115. }
  9116. __extends(a, d);
  9117. Object.defineProperty(a.prototype, "layout", {
  9118. get: function() {
  9119. return this._layout
  9120. },
  9121. set: function(b) {},
  9122. enumerable: !0,
  9123. configurable: !0
  9124. });
  9125. Object.defineProperty(a.prototype, "createAllChildren", {
  9126. get: function() {
  9127. return this._createAllChildren
  9128. },
  9129. set: function(b) {
  9130. if (this._createAllChildren !=
  9131. b && (this._createAllChildren = b)) {
  9132. b = this._getElementsContent();
  9133. for (var a = b.length, d = 0; d < a; d++) {
  9134. var e = b[d];
  9135. e instanceof c.DisplayObject && e.parent != this && (this.childOrderingChanged = !0, this._addToDisplayList(e))
  9136. }
  9137. this.childOrderingChanged && this.invalidateProperties()
  9138. }
  9139. },
  9140. enumerable: !0,
  9141. configurable: !0
  9142. });
  9143. Object.defineProperty(a.prototype, "selectedChild", {
  9144. get: function() {
  9145. var b = this.selectedIndex;
  9146. return 0 <= b && b < this.numElements ? this.getElementAt(b) : null
  9147. },
  9148. set: function(b) {
  9149. b = this.getElementIndex(b);
  9150. 0 <= b && b < this.numElements &&
  9151. this._setSelectedIndex(b)
  9152. },
  9153. enumerable: !0,
  9154. configurable: !0
  9155. });
  9156. Object.defineProperty(a.prototype, "selectedIndex", {
  9157. get: function() {
  9158. return this.proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this.proposedSelectedIndex : this._selectedIndex
  9159. },
  9160. set: function(b) {
  9161. this._setSelectedIndex(b)
  9162. },
  9163. enumerable: !0,
  9164. configurable: !0
  9165. });
  9166. a.prototype._setSelectedIndex = function(b, a) {
  9167. "undefined" === typeof a && (a = !0);
  9168. b != this.selectedIndex && (this.proposedSelectedIndex = b, this.invalidateProperties(), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT),
  9169. this.notifyTabBar = this.notifyTabBar || a)
  9170. };
  9171. a.prototype._elementAdded = function(b, a, d) {
  9172. "undefined" === typeof d && (d = !0);
  9173. this._createAllChildren && b instanceof c.DisplayObject && this._addToDisplayListAt(b, a, d);
  9174. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9175. b.visible = !1;
  9176. b.includeInLayout = !1; - 1 == this.selectedIndex ? this._setSelectedIndex(a, !1) : a <= this.selectedIndex && this.initialized && this._setSelectedIndex(this.selectedIndex +
  9177. 1);
  9178. this.dispatchCoEvent(c.CollectionEventKind.ADD, a, -1, [b.name])
  9179. };
  9180. a.prototype._elementRemoved = function(b, a, e) {
  9181. "undefined" === typeof e && (e = !0);
  9182. d.prototype._elementRemoved.call(this, b, a, e);
  9183. b.visible = !0;
  9184. b.includeInLayout = !0;
  9185. 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);
  9186. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, a, -1, [b.name])
  9187. };
  9188. a.prototype.commitProperties = function() {
  9189. d.prototype.commitProperties.call(this);
  9190. this.proposedSelectedIndex != a.NO_PROPOSED_SELECTION && (this.commitSelection(this.proposedSelectedIndex), this.proposedSelectedIndex = a.NO_PROPOSED_SELECTION);
  9191. if (this.childOrderingChanged) {
  9192. this.childOrderingChanged = !1;
  9193. for (var b = this._getElementsContent(), g = b.length, e = 0; e < g; e++) {
  9194. var m = b[e];
  9195. m instanceof c.DisplayObject && m.parent == this && this._addToDisplayList(m)
  9196. }
  9197. }
  9198. this.notifyTabBar && (this.notifyTabBar = !0, this.dispatchEventWith("IndexChanged"))
  9199. };
  9200. a.prototype.commitSelection = function(b) {
  9201. 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);
  9202. this.invalidateSize();
  9203. this.invalidateDisplayList()
  9204. };
  9205. Object.defineProperty(a.prototype, "length", {
  9206. get: function() {
  9207. return this.numElements
  9208. },
  9209. enumerable: !0,
  9210. configurable: !0
  9211. });
  9212. a.prototype.getItemAt = function(b) {
  9213. return (b = this.getElementAt(b)) ? b.name : ""
  9214. };
  9215. a.prototype.getItemIndex = function(b) {
  9216. for (var a = this._getElementsContent(), c = a.length, d = 0; d < c; d++)
  9217. if (a[d].name === b) return d;
  9218. return -1
  9219. };
  9220. a.prototype.dispatchCoEvent = function(b, a, d, e, f) {
  9221. "undefined" === typeof b &&
  9222. (b = null);
  9223. "undefined" === typeof a && (a = -1);
  9224. "undefined" === typeof d && (d = -1);
  9225. "undefined" === typeof e && (e = null);
  9226. "undefined" === typeof f && (f = null);
  9227. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, f)
  9228. };
  9229. a.NO_PROPOSED_SELECTION = -2;
  9230. return a
  9231. }(c.Group);
  9232. c.ViewStack = e
  9233. })(egret || (egret = {}));
  9234. __extends = this.__extends || function(c, e) {
  9235. function d() {
  9236. this.constructor = c
  9237. }
  9238. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9239. d.prototype = e.prototype;
  9240. c.prototype = new d
  9241. };
  9242. (function(c) {
  9243. var e = function(d) {
  9244. function a() {
  9245. d.call(this);
  9246. this.maxWidth = 1E4;
  9247. this.minWidth = 0;
  9248. this.maxHeight = 1E4;
  9249. this.minHeight = 0;
  9250. this.height = this.width = NaN;
  9251. this._initialized = !1;
  9252. this._elementsContent = [];
  9253. this._states = [];
  9254. this.initialized = !1
  9255. }
  9256. __extends(a, d);
  9257. a.prototype.createChildren = function() {};
  9258. Object.defineProperty(a.prototype, "hostComponent", {
  9259. get: function() {
  9260. return this._hostComponent
  9261. },
  9262. set: function(b) {
  9263. this._setHostComponent(b)
  9264. },
  9265. enumerable: !0,
  9266. configurable: !0
  9267. });
  9268. a.prototype._setHostComponent = function(b) {
  9269. if (this._hostComponent !=
  9270. b) {
  9271. var a;
  9272. if (this._hostComponent)
  9273. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9274. this._hostComponent = b;
  9275. this._initialized || (this._initialized = !0, this.createChildren());
  9276. if (this._hostComponent) {
  9277. b = this._elementsContent.length;
  9278. for (a = 0; a < b; a++) this._elementAdded(this._elementsContent[a], a);
  9279. this.initializeStates();
  9280. this.currentStateChanged && this.commitCurrentState()
  9281. }
  9282. }
  9283. };
  9284. a.prototype._getElementsContent = function() {
  9285. return this._elementsContent
  9286. };
  9287. Object.defineProperty(a.prototype,
  9288. "elementsContent", {
  9289. set: function(b) {
  9290. null == b && (b = []);
  9291. if (b != this._elementsContent)
  9292. if (this._hostComponent) {
  9293. var a;
  9294. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9295. this._elementsContent = b.concat();
  9296. b = this._elementsContent.length;
  9297. for (a = 0; a < b; a++) {
  9298. var c = this._elementsContent[a];
  9299. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  9300. this._elementAdded(c, a)
  9301. }
  9302. } else this._elementsContent = b.concat()
  9303. },
  9304. enumerable: !0,
  9305. configurable: !0
  9306. });
  9307. Object.defineProperty(a.prototype, "numElements", {
  9308. get: function() {
  9309. return this._elementsContent.length
  9310. },
  9311. enumerable: !0,
  9312. configurable: !0
  9313. });
  9314. a.prototype.getElementAt = function(b) {
  9315. this.checkForRangeError(b);
  9316. return this._elementsContent[b]
  9317. };
  9318. a.prototype.checkForRangeError = function(b, a) {
  9319. "undefined" === typeof a && (a = !1);
  9320. var c = this._elementsContent.length - 1;
  9321. a && c++;
  9322. if (0 > b || b > c) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  9323. };
  9324. a.prototype.addElement = function(b) {
  9325. var a = this.numElements;
  9326. b.owner == this && (a = this.numElements - 1);
  9327. return this.addElementAt(b, a)
  9328. };
  9329. a.prototype.addElementAt = function(b, a) {
  9330. this.checkForRangeError(a, !0);
  9331. var c = b.owner;
  9332. if (c == this) return this.setElementIndex(b, a), b;
  9333. c && "removeElement" in c && c.removeElement(b);
  9334. this._elementsContent.splice(a, 0, b);
  9335. this._hostComponent ? this._elementAdded(b, a) : b.ownerChanged(this);
  9336. return b
  9337. };
  9338. a.prototype.removeElement = function(b) {
  9339. return this.removeElementAt(this.getElementIndex(b))
  9340. };
  9341. a.prototype.removeElementAt = function(b) {
  9342. this.checkForRangeError(b);
  9343. var a = this._elementsContent[b];
  9344. this._hostComponent ? this._elementRemoved(a, b) : a.ownerChanged(null);
  9345. this._elementsContent.splice(b, 1);
  9346. return a
  9347. };
  9348. a.prototype.getElementIndex = function(b) {
  9349. return this._elementsContent.indexOf(b)
  9350. };
  9351. a.prototype.setElementIndex = function(b, a) {
  9352. this.checkForRangeError(a);
  9353. 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,
  9354. 0, b), this._hostComponent && this._elementAdded(b, a, !1))
  9355. };
  9356. a.prototype._elementAdded = function(b, a, d) {
  9357. "undefined" === typeof d && (d = !0);
  9358. b.ownerChanged(this);
  9359. b instanceof c.DisplayObject && this._hostComponent._addToDisplayListAt(b, a, d);
  9360. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9361. this._hostComponent.invalidateSize();
  9362. this._hostComponent.invalidateDisplayList()
  9363. };
  9364. a.prototype._elementRemoved = function(b,
  9365. a, d) {
  9366. "undefined" === typeof d && (d = !0);
  9367. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_REMOVE, b, a);
  9368. b instanceof c.DisplayObject && b.parent == this._hostComponent && this._hostComponent._removeFromDisplayList(b, d);
  9369. b.ownerChanged(null);
  9370. this._hostComponent.invalidateSize();
  9371. this._hostComponent.invalidateDisplayList()
  9372. };
  9373. Object.defineProperty(a.prototype, "states", {
  9374. get: function() {
  9375. return this._states
  9376. },
  9377. set: function(b) {
  9378. this._setStates(b)
  9379. },
  9380. enumerable: !0,
  9381. configurable: !0
  9382. });
  9383. a.prototype._setStates = function(b) {
  9384. b || (b = []);
  9385. if ("string" == typeof b[0])
  9386. for (var a = b.length, d = 0; d < a; d++) {
  9387. var e = new c.State(b[d], []);
  9388. b[d] = e
  9389. }
  9390. this._states = b;
  9391. this.currentStateChanged = !0;
  9392. this.requestedCurrentState = this._currentState;
  9393. this.hasState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState())
  9394. };
  9395. Object.defineProperty(a.prototype, "currentState", {
  9396. get: function() {
  9397. return this.currentStateChanged ? this.requestedCurrentState : this._currentState ? this._currentState :
  9398. this.getDefaultState()
  9399. },
  9400. set: function(b) {
  9401. b || (b = this.getDefaultState());
  9402. b != this.currentState && b && this.currentState && (this.requestedCurrentState = b, this.currentStateChanged = !0, this._hostComponent && this.commitCurrentState())
  9403. },
  9404. enumerable: !0,
  9405. configurable: !0
  9406. });
  9407. a.prototype.hasState = function(b) {
  9408. return null != this.getState(b)
  9409. };
  9410. a.prototype.getDefaultState = function() {
  9411. return 0 < this._states.length ? this._states[0].name : null
  9412. };
  9413. a.prototype.commitCurrentState = function() {
  9414. if (this.currentStateChanged) {
  9415. this.currentStateChanged = !1;
  9416. this.getState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState());
  9417. var b = this._currentState ? this._currentState : "";
  9418. this.hasEventListener(c.StateChangeEvent.CURRENT_STATE_CHANGING) && c.StateChangeEvent.dispatchStateChangeEvent(this, c.StateChangeEvent.CURRENT_STATE_CHANGING, b, this.requestedCurrentState ? this.requestedCurrentState : "");
  9419. this.removeState(this._currentState);
  9420. (this._currentState = this.requestedCurrentState) && this.applyState(this._currentState);
  9421. this.hasEventListener(c.StateChangeEvent.CURRENT_STATE_CHANGE) &&
  9422. c.StateChangeEvent.dispatchStateChangeEvent(this, c.StateChangeEvent.CURRENT_STATE_CHANGE, b, this._currentState ? this._currentState : "")
  9423. }
  9424. };
  9425. a.prototype.getState = function(b) {
  9426. if (!b) return null;
  9427. for (var a = this._states, c = a.length, d = 0; d < c; d++) {
  9428. var e = a[d];
  9429. if (e.name == b) return e
  9430. }
  9431. return null
  9432. };
  9433. a.prototype.removeState = function(b) {
  9434. if (b = this.getState(b)) {
  9435. b = b.overrides;
  9436. for (var a = b.length - 1; 0 <= a; a--) b[a].remove(this)
  9437. }
  9438. };
  9439. a.prototype.applyState = function(b) {
  9440. if (b = this.getState(b)) {
  9441. b = b.overrides;
  9442. for (var a = b.length, c = 0; c < a; c++) b[c].apply(this)
  9443. }
  9444. };
  9445. a.prototype.initializeStates = function() {
  9446. if (!this.initialized) {
  9447. this.initialized = !0;
  9448. for (var b = this._states, a = b.length, c = 0; c < a; c++) b[c].initialize(this)
  9449. }
  9450. };
  9451. return a
  9452. }(c.EventDispatcher);
  9453. c.Skin = e
  9454. })(egret || (egret = {}));
  9455. __extends = this.__extends || function(c, e) {
  9456. function d() {
  9457. this.constructor = c
  9458. }
  9459. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9460. d.prototype = e.prototype;
  9461. c.prototype = new d
  9462. };
  9463. (function(c) {
  9464. var e = function(d) {
  9465. function a() {
  9466. d.call(this);
  9467. this.useVirtualLayoutChanged = !1;
  9468. this.rendererToClassMap = [];
  9469. this.freeRenderers = [];
  9470. this.dataProviderChanged = this.createNewRendererFlag = !1;
  9471. this.recyclerDic = [];
  9472. this.typicalItemChanged = this.virtualLayoutUnderway = this.itemRendererSkinNameChange = !1;
  9473. this.indexToRenderer = [];
  9474. this.renderersBeingUpdated = this.cleanFreeRenderer = !1
  9475. }
  9476. __extends(a, d);
  9477. Object.defineProperty(a.prototype, "layout", {
  9478. get: function() {
  9479. return this._layout
  9480. },
  9481. set: function(b) {
  9482. b != this.layout &&
  9483. (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)))
  9484. },
  9485. enumerable: !0,
  9486. configurable: !0
  9487. });
  9488. a.prototype.layout_useVirtualLayoutChangedHandler = function(b) {
  9489. this.changeUseVirtualLayout()
  9490. };
  9491. a.prototype.setVirtualElementIndicesInView = function(b, a) {
  9492. if (this.layout && this.layout.useVirtualLayout) {
  9493. this.virtualRendererIndices = [];
  9494. for (var c = b; c <= a; c++) this.virtualRendererIndices.push(c);
  9495. for (var d in this.indexToRenderer) d = parseInt(d), -1 == this.virtualRendererIndices.indexOf(d) && this.freeRendererByIndex(d)
  9496. }
  9497. };
  9498. a.prototype.getVirtualElementAt = function(b) {
  9499. if (0 > b || b >= this.dataProvider.length) return null;
  9500. var a = this.indexToRenderer[b];
  9501. if (!a) {
  9502. var a = this.dataProvider.getItemAt(b),
  9503. d = this.createVirtualRenderer(b);
  9504. this.indexToRenderer[b] = d;
  9505. this.updateRenderer(d, b, a);
  9506. this.createNewRendererFlag && ("validateNow" in d && d.validateNow(), this.createNewRendererFlag = !1, c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_ADD, d, b, a));
  9507. a = d
  9508. }
  9509. return a
  9510. };
  9511. a.prototype.freeRendererByIndex = function(b) {
  9512. if (this.indexToRenderer[b]) {
  9513. var a = this.indexToRenderer[b];
  9514. delete this.indexToRenderer[b];
  9515. a && a instanceof c.DisplayObject && this.doFreeRenderer(a)
  9516. }
  9517. };
  9518. a.prototype.doFreeRenderer = function(b) {
  9519. var a =
  9520. this.rendererToClassMap[b.hashCode].hashCode;
  9521. this.freeRenderers[a] || (this.freeRenderers[a] = []);
  9522. this.freeRenderers[a].push(b);
  9523. b.visible = !1
  9524. };
  9525. a.prototype.invalidateSize = function() {
  9526. this.createNewRendererFlag || d.prototype.invalidateSize.call(this)
  9527. };
  9528. a.prototype.createVirtualRenderer = function(b) {
  9529. b = this.dataProvider.getItemAt(b);
  9530. b = this.itemToRendererClass(b);
  9531. var a = b.hashCode,
  9532. c = this.freeRenderers;
  9533. if (c[a] && 0 < c[a].length) return b = c[a].pop(), b.visible = !0, b;
  9534. this.createNewRendererFlag = !0;
  9535. return this.createOneRenderer(b)
  9536. };
  9537. a.prototype.createOneRenderer = function(b) {
  9538. var a, d = b.hashCode,
  9539. e = this.recyclerDic[d];
  9540. e && (a = e.pop(), 0 == e.length && delete this.recyclerDic[d]);
  9541. a || (a = b.newInstance(), this.rendererToClassMap[a.hashCode] = b);
  9542. if (!(a && a instanceof c.DisplayObject)) return null;
  9543. this._itemRendererSkinName && this.setItemRenderSkinName(a);
  9544. this._addToDisplayList(a);
  9545. a.setLayoutBoundsSize(NaN, NaN);
  9546. return a
  9547. };
  9548. a.prototype.setItemRenderSkinName = function(b) {
  9549. b && (b ? b._skinNameExplicitlySet || (b.skinName = this._itemRendererSkinName) : b && !b.skinName &&
  9550. (b.skinName = this._itemRendererSkinName))
  9551. };
  9552. a.prototype.finishVirtualLayout = function() {
  9553. if (this.virtualLayoutUnderway) {
  9554. var b = this.virtualLayoutUnderway = !1,
  9555. a;
  9556. for (a in this.freeRenderers)
  9557. if (0 < this.freeRenderers[a].length) {
  9558. b = !0;
  9559. break
  9560. }
  9561. 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())
  9562. }
  9563. };
  9564. a.prototype.cleanAllFreeRenderer = function(b) {
  9565. var a = this.freeRenderers,
  9566. c;
  9567. for (c in a)
  9568. for (var d =
  9569. a[c], e = d.length, h = 0; h < e; h++) b = d[h], b.visible = !0, this.recycle(b);
  9570. this.freeRenderers = [];
  9571. this.cleanFreeRenderer = !1
  9572. };
  9573. a.prototype.getElementIndicesInView = function() {
  9574. return this.layout && this.layout.useVirtualLayout ? this.virtualRendererIndices ? this.virtualRendererIndices : [] : d.prototype.getElementIndicesInView.call(this)
  9575. };
  9576. a.prototype.changeUseVirtualLayout = function() {
  9577. this.cleanFreeRenderer = this.useVirtualLayoutChanged = !0;
  9578. this.removeDataProviderListener();
  9579. this.invalidateProperties()
  9580. };
  9581. Object.defineProperty(a.prototype,
  9582. "dataProvider", {
  9583. get: function() {
  9584. return this._dataProvider
  9585. },
  9586. set: function(b) {
  9587. this._dataProvider != b && (this.removeDataProviderListener(), this._dataProvider = b, this.cleanFreeRenderer = this.dataProviderChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  9588. },
  9589. enumerable: !0,
  9590. configurable: !0
  9591. });
  9592. a.prototype.removeDataProviderListener = function() {
  9593. this._dataProvider && this._dataProvider.removeEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange, this)
  9594. };
  9595. a.prototype.onCollectionChange =
  9596. function(b) {
  9597. switch (b.kind) {
  9598. case c.CollectionEventKind.ADD:
  9599. this.itemAddedHandler(b.items, b.location);
  9600. break;
  9601. case c.CollectionEventKind.MOVE:
  9602. this.itemMovedHandler(b.items[0], b.location, b.oldLocation);
  9603. break;
  9604. case c.CollectionEventKind.REMOVE:
  9605. this.itemRemovedHandler(b.items, b.location);
  9606. break;
  9607. case c.CollectionEventKind.UPDATE:
  9608. this.itemUpdatedHandler(b.items[0], b.location);
  9609. break;
  9610. case c.CollectionEventKind.REPLACE:
  9611. this.itemRemoved(b.oldItems[0], b.location);
  9612. this.itemAdded(b.items[0], b.location);
  9613. break;
  9614. case c.CollectionEventKind.RESET:
  9615. case c.CollectionEventKind.REFRESH:
  9616. if (this.layout &&
  9617. this.layout.useVirtualLayout)
  9618. for (var a in this.indexToRenderer) a = parseInt(a), this.freeRendererByIndex(a);
  9619. this.dataProviderChanged = !0;
  9620. this.invalidateProperties()
  9621. }
  9622. this.invalidateSize();
  9623. this.invalidateDisplayList()
  9624. };
  9625. a.prototype.itemAddedHandler = function(b, a) {
  9626. for (var c = b.length, d = 0; d < c; d++) this.itemAdded(b[d], a + d);
  9627. this.resetRenderersIndices()
  9628. };
  9629. a.prototype.itemMovedHandler = function(b, a, c) {
  9630. this.itemRemoved(b, c);
  9631. this.itemAdded(b, a);
  9632. this.resetRenderersIndices()
  9633. };
  9634. a.prototype.itemRemovedHandler = function(b,
  9635. a) {
  9636. for (var c = b.length - 1; 0 <= c; c--) this.itemRemoved(b[c], a + c);
  9637. this.resetRenderersIndices()
  9638. };
  9639. a.prototype.itemAdded = function(b, a) {
  9640. this.layout && this.layout.elementAdded(a);
  9641. if (this.layout && this.layout.useVirtualLayout) {
  9642. var d = this.virtualRendererIndices;
  9643. if (d) {
  9644. for (var e = d.length, f = 0; f < e; f++) {
  9645. var h = d[f];
  9646. h >= a && (d[f] = h + 1)
  9647. }
  9648. this.indexToRenderer.splice(a, 0, null)
  9649. }
  9650. } else d = this.itemToRendererClass(b), d = this.createOneRenderer(d), this.indexToRenderer.splice(a, 0, d), d && (this.updateRenderer(d, a, b), c.RendererExistenceEvent.dispatchRendererExistenceEvent(this,
  9651. c.RendererExistenceEvent.RENDERER_ADD, d, a, b))
  9652. };
  9653. a.prototype.itemRemoved = function(b, a) {
  9654. this.layout && this.layout.elementRemoved(a);
  9655. var d = this.virtualRendererIndices;
  9656. if (d && 0 < d.length) {
  9657. for (var e = -1, f = d.length, h = 0; h < f; h++) {
  9658. var k = d[h];
  9659. k == a ? e = h : k > a && (d[h] = k - 1)
  9660. } - 1 != e && d.splice(e, 1)
  9661. }
  9662. d = this.indexToRenderer[a];
  9663. this.indexToRenderer.length > a && this.indexToRenderer.splice(a, 1);
  9664. c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_REMOVE, d, a, b);
  9665. d && d instanceof c.DisplayObject &&
  9666. this.recycle(d)
  9667. };
  9668. a.prototype.recycle = function(b) {
  9669. this._removeFromDisplayList(b);
  9670. "ownerChanged" in b && b.ownerChanged(null);
  9671. var a = this.rendererToClassMap[b.hashCode].hashCode;
  9672. this.recyclerDic[a] || (this.recyclerDic[a] = new c.Recycler);
  9673. this.recyclerDic[a].push(b)
  9674. };
  9675. a.prototype.resetRenderersIndices = function() {
  9676. if (0 != this.indexToRenderer.length)
  9677. if (this.layout && this.layout.useVirtualLayout)
  9678. for (var b = this.virtualRendererIndices, a = b.length, c = 0; c < a; c++) {
  9679. var d = b[c];
  9680. this.resetRendererItemIndex(d)
  9681. } else
  9682. for (b = this.indexToRenderer.length,
  9683. d = 0; d < b; d++) this.resetRendererItemIndex(d)
  9684. };
  9685. a.prototype.itemUpdatedHandler = function(b, a) {
  9686. if (!this.renderersBeingUpdated) {
  9687. var c = this.indexToRenderer[a];
  9688. c && this.updateRenderer(c, a, b)
  9689. }
  9690. };
  9691. a.prototype.resetRendererItemIndex = function(b) {
  9692. var a = this.indexToRenderer[b];
  9693. a && (a.itemIndex = b)
  9694. };
  9695. Object.defineProperty(a.prototype, "itemRenderer", {
  9696. get: function() {
  9697. return this._itemRenderer
  9698. },
  9699. set: function(b) {
  9700. this._itemRenderer !== b && (this._itemRenderer = b, this.cleanFreeRenderer = this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  9701. },
  9702. enumerable: !0,
  9703. configurable: !0
  9704. });
  9705. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  9706. get: function() {
  9707. return this._itemRendererSkinName
  9708. },
  9709. set: function(b) {
  9710. this._itemRendererSkinName != b && (this._itemRendererSkinName = b) && this.initialized && (this.itemRendererSkinNameChange = !0, this.invalidateProperties())
  9711. },
  9712. enumerable: !0,
  9713. configurable: !0
  9714. });
  9715. Object.defineProperty(a.prototype, "itemRendererFunction", {
  9716. get: function() {
  9717. return this._itemRendererFunction
  9718. },
  9719. set: function(b) {
  9720. this._itemRendererFunction != b && (this._itemRendererFunction = b, this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  9721. },
  9722. enumerable: !0,
  9723. configurable: !0
  9724. });
  9725. a.prototype.itemToRendererClass = function(b) {
  9726. null != this._itemRendererFunction ? (b = this._itemRendererFunction(b), b || (b = this._itemRenderer)) : b = this._itemRenderer;
  9727. return b ? b : a.defaultRendererFactory
  9728. };
  9729. a.prototype.createChildren = function() {
  9730. if (!this.layout) {
  9731. var b = new c.VerticalLayout;
  9732. b.gap = 0;
  9733. b.horizontalAlign = c.HorizontalAlign.CONTENT_JUSTIFY;
  9734. this.layout = b
  9735. }
  9736. d.prototype.createChildren.call(this)
  9737. };
  9738. a.prototype.commitProperties = function() {
  9739. if (this.itemRendererChanged || this.dataProviderChanged || this.useVirtualLayoutChanged) this.removeAllRenderers(), this.layout && this.layout.clearVirtualLayoutCache(), this.setTypicalLayoutRect(null), this.itemRendererChanged = this.useVirtualLayoutChanged = !1, this._dataProvider && this._dataProvider.addEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange,
  9740. this), this.layout && this.layout.useVirtualLayout ? (this.invalidateSize(), this.invalidateDisplayList()) : this.createRenderers(), this.dataProviderChanged && (this.dataProviderChanged = !1, this.verticalScrollPosition = this.horizontalScrollPosition = 0);
  9741. d.prototype.commitProperties.call(this);
  9742. this.typicalItemChanged && (this.typicalItemChanged = !1, this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize()));
  9743. if (this.itemRendererSkinNameChange) {
  9744. this.itemRendererSkinNameChange = !1;
  9745. for (var b = this.indexToRenderer.length, a = 0; a < b; a++) this.setItemRenderSkinName(this.indexToRenderer[a]);
  9746. var e = this.freeRenderers,
  9747. m;
  9748. for (m in e) {
  9749. var f = e[m];
  9750. if (f)
  9751. for (b = f.length, a = 0; a < b; a++) this.setItemRenderSkinName(f[a])
  9752. }
  9753. }
  9754. };
  9755. a.prototype.measure = function() {
  9756. this.layout && this.layout.useVirtualLayout && this.ensureTypicalLayoutElement();
  9757. d.prototype.measure.call(this)
  9758. };
  9759. a.prototype.updateDisplayList = function(b, a) {
  9760. this._layoutInvalidateDisplayListFlag && this.layout && this.layout.useVirtualLayout && (this.virtualLayoutUnderway = !0, this.ensureTypicalLayoutElement());
  9761. d.prototype.updateDisplayList.call(this, b, a);
  9762. this.virtualLayoutUnderway && this.finishVirtualLayout()
  9763. };
  9764. a.prototype.ensureTypicalLayoutElement = function() {
  9765. !this.layout.typicalLayoutRect && this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize())
  9766. };
  9767. a.prototype.measureRendererSize = function() {
  9768. if (this.typicalItem) {
  9769. var b = this.itemToRendererClass(this.typicalItem);
  9770. if (b = this.createOneRenderer(b)) {
  9771. this.createNewRendererFlag = !0;
  9772. this.updateRenderer(b, 0, this.typicalItem);
  9773. "validateNow" in b && b.validateNow();
  9774. var a = new c.Rectangle(0, 0, b.preferredWidth, b.preferredHeight);
  9775. this.recycle(b);
  9776. this.setTypicalLayoutRect(a);
  9777. this.createNewRendererFlag = !1
  9778. } else this.setTypicalLayoutRect(null)
  9779. } else this.setTypicalLayoutRect(null)
  9780. };
  9781. a.prototype.setTypicalLayoutRect = function(b) {
  9782. this.typicalLayoutRect = b;
  9783. this.layout && (this.layout.typicalLayoutRect = b)
  9784. };
  9785. a.prototype.removeAllRenderers = function() {
  9786. for (var b = this.indexToRenderer.length, a, d = 0; d < b; d++)
  9787. if (a =
  9788. this.indexToRenderer[d]) this.recycle(a), c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_REMOVE, a, a.itemIndex, a.data);
  9789. this.indexToRenderer = [];
  9790. this.virtualRendererIndices = null;
  9791. this.cleanFreeRenderer && this.cleanAllFreeRenderer()
  9792. };
  9793. a.prototype.createRenderers = function() {
  9794. if (this._dataProvider)
  9795. for (var b = 0, a = this._dataProvider.length, d = 0; d < a; d++) {
  9796. var e = this._dataProvider.getItemAt(d),
  9797. f = this.itemToRendererClass(e);
  9798. if (f = this.createOneRenderer(f)) this.indexToRenderer[b] =
  9799. f, this.updateRenderer(f, b, e), c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_ADD, f, b, e), b++
  9800. }
  9801. };
  9802. a.prototype.updateRenderer = function(b, a, c) {
  9803. this.renderersBeingUpdated = !0;
  9804. 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);
  9805. this.renderersBeingUpdated = !1;
  9806. return b
  9807. };
  9808. a.prototype.itemToLabel = function(b) {
  9809. return b ? b.toString() : " "
  9810. };
  9811. a.prototype.getElementAt = function(b) {
  9812. return this.indexToRenderer[b]
  9813. };
  9814. a.prototype.getElementIndex = function(b) {
  9815. return b ? this.indexToRenderer.indexOf(b) : -1
  9816. };
  9817. Object.defineProperty(a.prototype, "numElements", {
  9818. get: function() {
  9819. return this._dataProvider ? this._dataProvider.length : 0
  9820. },
  9821. enumerable: !0,
  9822. configurable: !0
  9823. });
  9824. a.prototype.addChild = function(b) {
  9825. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  9826. };
  9827. a.prototype.addChildAt = function(b, c) {
  9828. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  9829. };
  9830. a.prototype.removeChild = function(b) {
  9831. throw Error("removeChild()" +
  9832. a.errorStr + "removeElement()\u4ee3\u66ff");
  9833. };
  9834. a.prototype.removeChildAt = function(b) {
  9835. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  9836. };
  9837. a.prototype.setChildIndex = function(b, c) {
  9838. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  9839. };
  9840. a.prototype.swapChildren = function(b, c) {
  9841. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  9842. };
  9843. a.prototype.swapChildrenAt = function(b, c) {
  9844. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  9845. };
  9846. a.defaultRendererFactory = new c.ClassFactory(c.ItemRenderer);
  9847. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  9848. return a
  9849. }(c.GroupBase);
  9850. c.DataGroup = e
  9851. })(egret || (egret = {}));
  9852. __extends = this.__extends || function(c, e) {
  9853. function d() {
  9854. this.constructor = c
  9855. }
  9856. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9857. d.prototype = e.prototype;
  9858. c.prototype = new d
  9859. };
  9860. (function(c) {
  9861. var e = function(d) {
  9862. function a() {
  9863. d.call(this);
  9864. this.contentGroupProperties = {};
  9865. this.hostComponentKey = "egret.SkinnableContainer"
  9866. }
  9867. __extends(a, d);
  9868. a.prototype._getCurrentContentGroup = function() {
  9869. 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,
  9870. this._contentGroup_elementRemovedHandler, this), this._placeHolderGroup) : this.contentGroup
  9871. };
  9872. Object.defineProperty(a.prototype, "elementsContent", {
  9873. set: function(b) {
  9874. this._getCurrentContentGroup().elementsContent = b
  9875. },
  9876. enumerable: !0,
  9877. configurable: !0
  9878. });
  9879. Object.defineProperty(a.prototype, "numElements", {
  9880. get: function() {
  9881. return this._getCurrentContentGroup().numElements
  9882. },
  9883. enumerable: !0,
  9884. configurable: !0
  9885. });
  9886. a.prototype.getElementAt = function(b) {
  9887. return this._getCurrentContentGroup().getElementAt(b)
  9888. };
  9889. a.prototype.addElement =
  9890. function(b) {
  9891. return this._getCurrentContentGroup().addElement(b)
  9892. };
  9893. a.prototype.addElementAt = function(b, a) {
  9894. return this._getCurrentContentGroup().addElementAt(b, a)
  9895. };
  9896. a.prototype.removeElement = function(b) {
  9897. return this._getCurrentContentGroup().removeElement(b)
  9898. };
  9899. a.prototype.removeElementAt = function(b) {
  9900. return this._getCurrentContentGroup().removeElementAt(b)
  9901. };
  9902. a.prototype.removeAllElements = function() {
  9903. this._getCurrentContentGroup().removeAllElements()
  9904. };
  9905. a.prototype.getElementIndex = function(b) {
  9906. return this._getCurrentContentGroup().getElementIndex(b)
  9907. };
  9908. a.prototype.setElementIndex = function(b, a) {
  9909. this._getCurrentContentGroup().setElementIndex(b, a)
  9910. };
  9911. a.prototype.swapElements = function(b, a) {
  9912. this._getCurrentContentGroup().swapElements(b, a)
  9913. };
  9914. a.prototype.swapElementsAt = function(b, a) {
  9915. this._getCurrentContentGroup().swapElementsAt(b, a)
  9916. };
  9917. Object.defineProperty(a.prototype, "layout", {
  9918. get: function() {
  9919. return null != this.contentGroup ? this.contentGroup.layout : this.contentGroupProperties.layout
  9920. },
  9921. set: function(b) {
  9922. null != this.contentGroup ? this.contentGroup.layout = b : this.contentGroupProperties.layout =
  9923. b
  9924. },
  9925. enumerable: !0,
  9926. configurable: !0
  9927. });
  9928. a.prototype.partAdded = function(b, a) {
  9929. d.prototype.partAdded.call(this, b, a);
  9930. if (a == this.contentGroup) {
  9931. void 0 !== this.contentGroupProperties.layout && (this.contentGroup.layout = this.contentGroupProperties.layout, this.contentGroupProperties = {});
  9932. if (this._placeHolderGroup) {
  9933. this._placeHolderGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  9934. this._placeHolderGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE,
  9935. this._contentGroup_elementRemovedHandler, this);
  9936. for (var e = this._placeHolderGroup._getElementsContent().concat(), m = this._placeHolderGroup.numElements; 0 < m; m--) {
  9937. var f = this._placeHolderGroup.removeElementAt(0);
  9938. f.ownerChanged(null)
  9939. }
  9940. this._removeFromDisplayList(this._placeHolderGroup);
  9941. this.contentGroup.elementsContent = e;
  9942. for (m = e.length - 1; 0 <= m; m--) f = e[m], f.ownerChanged(this);
  9943. this._placeHolderGroup = null
  9944. }
  9945. this.contentGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler,
  9946. this);
  9947. this.contentGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this)
  9948. }
  9949. };
  9950. a.prototype.partRemoved = function(b, a) {
  9951. d.prototype.partRemoved.call(this, b, a);
  9952. 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 =
  9953. this.contentGroup.layout, this.contentGroup.layout = null, 0 < this.contentGroup.numElements)) {
  9954. for (this._placeHolderGroup = new c.Group; 0 < this.contentGroup.numElements;) this._placeHolderGroup.addElement(this.contentGroup.getElementAt(0));
  9955. this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  9956. this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this)
  9957. }
  9958. };
  9959. a.prototype._contentGroup_elementAddedHandler =
  9960. function(b) {
  9961. b.element.ownerChanged(this);
  9962. this.dispatchEvent(b)
  9963. };
  9964. a.prototype._contentGroup_elementRemovedHandler = function(b) {
  9965. b.element.ownerChanged(null);
  9966. this.dispatchEvent(b)
  9967. };
  9968. return a
  9969. }(c.SkinnableComponent);
  9970. c.SkinnableContainer = e
  9971. })(egret || (egret = {}));
  9972. __extends = this.__extends || function(c, e) {
  9973. function d() {
  9974. this.constructor = c
  9975. }
  9976. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9977. d.prototype = e.prototype;
  9978. c.prototype = new d
  9979. };
  9980. (function(c) {
  9981. var e = function(d) {
  9982. function a() {
  9983. d.call(this);
  9984. this._dataGroupProperties = {};
  9985. this.hostComponentKey = "egret.SkinnableDataContainer"
  9986. }
  9987. __extends(a, d);
  9988. a.prototype.updateRenderer = function(b, a, c) {
  9989. "ownerChanged" in b && b.ownerChanged(this);
  9990. b.itemIndex = a;
  9991. b.label = this.itemToLabel(c);
  9992. b.data = c;
  9993. return b
  9994. };
  9995. a.prototype.itemToLabel = function(b) {
  9996. return null !== b ? b.toString() : " "
  9997. };
  9998. Object.defineProperty(a.prototype, "dataProvider", {
  9999. get: function() {
  10000. return this._getDataProvider()
  10001. },
  10002. set: function(b) {
  10003. this._setDataProvider(b)
  10004. },
  10005. enumerable: !0,
  10006. configurable: !0
  10007. });
  10008. a.prototype._getDataProvider = function() {
  10009. return null != this.dataGroup ? this.dataGroup.dataProvider : this._dataGroupProperties.dataProvider
  10010. };
  10011. a.prototype._setDataProvider = function(b) {
  10012. null == this.dataGroup ? this._dataGroupProperties.dataProvider = b : (this.dataGroup.dataProvider = b, this._dataGroupProperties.dataProvider = !0)
  10013. };
  10014. Object.defineProperty(a.prototype, "itemRenderer", {
  10015. get: function() {
  10016. return this.dataGroup ? this.dataGroup.itemRenderer : this._dataGroupProperties.itemRenderer
  10017. },
  10018. set: function(b) {
  10019. null == this.dataGroup ? this._dataGroupProperties.itemRenderer = b : (this.dataGroup.itemRenderer = b, this._dataGroupProperties.itemRenderer = !0)
  10020. },
  10021. enumerable: !0,
  10022. configurable: !0
  10023. });
  10024. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  10025. get: function() {
  10026. return this.dataGroup ? this.dataGroup.itemRendererSkinName : this._dataGroupProperties.itemRendererSkinName
  10027. },
  10028. set: function(b) {
  10029. null == this.dataGroup ? this._dataGroupProperties.itemRendererSkinName = b : (this.dataGroup.itemRendererSkinName = b, this._dataGroupProperties.itemRendererSkinName = !0)
  10030. },
  10031. enumerable: !0,
  10032. configurable: !0
  10033. });
  10034. Object.defineProperty(a.prototype, "itemRendererFunction", {
  10035. get: function() {
  10036. return this.dataGroup ? this.dataGroup.itemRendererFunction : this._dataGroupProperties.itemRendererFunction
  10037. },
  10038. set: function(b) {
  10039. null == this.dataGroup ? this._dataGroupProperties.itemRendererFunction = b : (this.dataGroup.itemRendererFunction = b, this._dataGroupProperties.itemRendererFunction = !0)
  10040. },
  10041. enumerable: !0,
  10042. configurable: !0
  10043. });
  10044. Object.defineProperty(a.prototype, "layout", {
  10045. get: function() {
  10046. return this.dataGroup ?
  10047. this.dataGroup.layout : this._dataGroupProperties.layout
  10048. },
  10049. set: function(b) {
  10050. this._setLayout(b)
  10051. },
  10052. enumerable: !0,
  10053. configurable: !0
  10054. });
  10055. a.prototype._setLayout = function(b) {
  10056. null == this.dataGroup ? this._dataGroupProperties.layout = b : (this.dataGroup.layout = b, this._dataGroupProperties.layout = !0)
  10057. };
  10058. a.prototype.partAdded = function(b, a) {
  10059. d.prototype.partAdded.call(this, b, a);
  10060. if (a == this.dataGroup) {
  10061. var e = {};
  10062. void 0 !== this._dataGroupProperties.layout && (this.dataGroup.layout = this._dataGroupProperties.layout, e.layout = !0);
  10063. void 0 !==
  10064. this._dataGroupProperties.dataProvider && (this.dataGroup.dataProvider = this._dataGroupProperties.dataProvider, e.dataProvider = !0);
  10065. void 0 !== this._dataGroupProperties.itemRenderer && (this.dataGroup.itemRenderer = this._dataGroupProperties.itemRenderer, e.itemRenderer = !0);
  10066. void 0 !== this._dataGroupProperties.itemRendererSkinName && (this.dataGroup.itemRendererSkinName = this._dataGroupProperties.itemRendererSkinName, e.itemRendererSkinName = !0);
  10067. void 0 !== this._dataGroupProperties.itemRendererFunction && (this.dataGroup.itemRendererFunction =
  10068. this._dataGroupProperties.itemRendererFunction, e.itemRendererFunction = !0);
  10069. this.dataGroup._rendererOwner = this;
  10070. this._dataGroupProperties = e;
  10071. this.hasEventListener(c.RendererExistenceEvent.RENDERER_ADD) && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10072. this.hasEventListener(c.RendererExistenceEvent.RENDERER_REMOVE) && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this)
  10073. }
  10074. };
  10075. a.prototype.partRemoved = function(b, a) {
  10076. d.prototype.partRemoved.call(this,
  10077. b, a);
  10078. if (a == this.dataGroup) {
  10079. this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10080. this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this);
  10081. var e = {};
  10082. this._dataGroupProperties.layout && (e.layout = this.dataGroup.layout);
  10083. this._dataGroupProperties.dataProvider && (e.dataProvider = this.dataGroup.dataProvider);
  10084. this._dataGroupProperties.itemRenderer && (e.itemRenderer = this.dataGroup.itemRenderer);
  10085. this._dataGroupProperties.itemRendererSkinName &&
  10086. (e.itemRendererSkinName = this.dataGroup.itemRendererSkinName);
  10087. this._dataGroupProperties.itemRendererFunction && (e.itemRendererFunction = this.dataGroup.itemRendererFunction);
  10088. this._dataGroupProperties = e;
  10089. this.dataGroup._rendererOwner = null;
  10090. this.dataGroup.dataProvider = null;
  10091. this.dataGroup.layout = null
  10092. }
  10093. };
  10094. a.prototype.addEventListener = function(b, a, e, m, f) {
  10095. "undefined" === typeof m && (m = !1);
  10096. "undefined" === typeof f && (f = 0);
  10097. d.prototype.addEventListener.call(this, b, a, e, m, f);
  10098. b == c.RendererExistenceEvent.RENDERER_ADD && this.dataGroup &&
  10099. this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10100. b == c.RendererExistenceEvent.RENDERER_REMOVE && this.dataGroup && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this)
  10101. };
  10102. a.prototype.removeEventListener = function(b, a, e, m) {
  10103. "undefined" === typeof m && (m = !1);
  10104. d.prototype.removeEventListener.call(this, b, a, e, m);
  10105. b == c.RendererExistenceEvent.RENDERER_ADD && this.dataGroup && (this.hasEventListener(c.RendererExistenceEvent.RENDERER_ADD) ||
  10106. this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this));
  10107. b == c.RendererExistenceEvent.RENDERER_REMOVE && this.dataGroup && (this.hasEventListener(c.RendererExistenceEvent.RENDERER_REMOVE) || this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this))
  10108. };
  10109. return a
  10110. }(c.SkinnableComponent);
  10111. c.SkinnableDataContainer = e
  10112. })(egret || (egret = {}));
  10113. __extends = this.__extends || function(c, e) {
  10114. function d() {
  10115. this.constructor = c
  10116. }
  10117. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10118. d.prototype = e.prototype;
  10119. c.prototype = new d
  10120. };
  10121. (function(c) {
  10122. var e = function(d) {
  10123. function a() {
  10124. d.call(this);
  10125. this._doingWholesaleChanges = !1;
  10126. this._labelField = "label";
  10127. this.requireSelectionChanged = this._requireSelection = !1;
  10128. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  10129. this._selectedIndex = a.NO_SELECTION;
  10130. this.selectedIndexAdjusted = this._useVirtualLayout = this._dispatchChangeAfterSelection = this._allowCustomSelectedItem = !1
  10131. }
  10132. __extends(a, d);
  10133. a.prototype._setDataProvider = function(b) {
  10134. this.dataProvider && this.dataProvider.removeEventListener(c.CollectionEvent.COLLECTION_CHANGE,
  10135. this.dataProvider_collectionChangeHandler, this);
  10136. this._doingWholesaleChanges = this.dataProviderChanged = !0;
  10137. b && b.addEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.dataProvider_collectionChangeHandler, this);
  10138. d.prototype._setDataProvider.call(this, b);
  10139. this.invalidateProperties()
  10140. };
  10141. Object.defineProperty(a.prototype, "layout", {
  10142. get: function() {
  10143. return this.dataGroup ? this.dataGroup.layout : this._dataGroupProperties.layout
  10144. },
  10145. set: function(b) {
  10146. b && this.useVirtualLayout && (b.useVirtualLayout = !0);
  10147. this._setLayout(b)
  10148. },
  10149. enumerable: !0,
  10150. configurable: !0
  10151. });
  10152. Object.defineProperty(a.prototype, "labelField", {
  10153. get: function() {
  10154. return this._labelField
  10155. },
  10156. set: function(b) {
  10157. this._setLabelField(b)
  10158. },
  10159. enumerable: !0,
  10160. configurable: !0
  10161. });
  10162. a.prototype._setLabelField = function(b) {
  10163. b != this._labelField && (this._labelField = b, this.labelFieldOrFunctionChanged = !0, this.invalidateProperties())
  10164. };
  10165. Object.defineProperty(a.prototype, "labelFunction", {
  10166. get: function() {
  10167. return this._labelFunction
  10168. },
  10169. set: function(b) {
  10170. this._setLabelFunction(b)
  10171. },
  10172. enumerable: !0,
  10173. configurable: !0
  10174. });
  10175. a.prototype._setLabelFunction = function(b) {
  10176. b != this._labelFunction && (this._labelFunction = b, this.labelFieldOrFunctionChanged = !0, this.invalidateProperties())
  10177. };
  10178. Object.defineProperty(a.prototype, "requireSelection", {
  10179. get: function() {
  10180. return this._requireSelection
  10181. },
  10182. set: function(b) {
  10183. this._setRequireSelection(b)
  10184. },
  10185. enumerable: !0,
  10186. configurable: !0
  10187. });
  10188. a.prototype._setRequireSelection = function(b) {
  10189. b != this._requireSelection && (this._requireSelection = b) && (this.requireSelectionChanged = !0, this.invalidateProperties())
  10190. };
  10191. Object.defineProperty(a.prototype,
  10192. "selectedIndex", {
  10193. get: function() {
  10194. return this._getSelectedIndex()
  10195. },
  10196. set: function(b) {
  10197. this._setSelectedIndex(b, !1)
  10198. },
  10199. enumerable: !0,
  10200. configurable: !0
  10201. });
  10202. a.prototype._getSelectedIndex = function() {
  10203. return this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this._proposedSelectedIndex : this._selectedIndex
  10204. };
  10205. a.prototype._setSelectedIndex = function(b, a) {
  10206. "undefined" === typeof a && (a = !1);
  10207. b != this.selectedIndex && (a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a), this._proposedSelectedIndex = b, this.invalidateProperties())
  10208. };
  10209. Object.defineProperty(a.prototype, "selectedItem", {
  10210. get: function() {
  10211. 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
  10212. },
  10213. set: function(b) {
  10214. this._setSelectedItem(b, !1)
  10215. },
  10216. enumerable: !0,
  10217. configurable: !0
  10218. });
  10219. a.prototype._setSelectedItem = function(b,
  10220. a) {
  10221. "undefined" === typeof a && (a = !1);
  10222. this.selectedItem !== b && (a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a), this._pendingSelectedItem = b, this.invalidateProperties())
  10223. };
  10224. Object.defineProperty(a.prototype, "useVirtualLayout", {
  10225. get: function() {
  10226. return this._getUseVirtualLayout()
  10227. },
  10228. set: function(b) {
  10229. this._setUseVirtualLayout(b)
  10230. },
  10231. enumerable: !0,
  10232. configurable: !0
  10233. });
  10234. a.prototype._getUseVirtualLayout = function() {
  10235. return this.layout ? this.layout.useVirtualLayout : this._useVirtualLayout
  10236. };
  10237. a.prototype._setUseVirtualLayout =
  10238. function(b) {
  10239. b != this.useVirtualLayout && (this._useVirtualLayout = b, this.layout && (this.layout.useVirtualLayout = b))
  10240. };
  10241. a.prototype.commitProperties = function() {
  10242. d.prototype.commitProperties.call(this);
  10243. 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));
  10244. this.requireSelectionChanged &&
  10245. (this.requireSelectionChanged = !1, this.requireSelection && this.selectedIndex == a.NO_SELECTION && this.dataProvider && 0 < this.dataProvider.length && (this._proposedSelectedIndex = 0));
  10246. 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 =
  10247. void 0);
  10248. var b = !1;
  10249. this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION && (b = this.commitSelection());
  10250. this.selectedIndexAdjusted && (this.selectedIndexAdjusted = !1, b || c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10251. if (this.labelFieldOrFunctionChanged) {
  10252. if (null != this.dataGroup)
  10253. if (this.layout && this.layout.useVirtualLayout)
  10254. for (var e = this.dataGroup.getElementIndicesInView(), l = e.length, m = 0; m < l; m++) b = e[m], this.updateRendererLabelProperty(b);
  10255. else
  10256. for (e = this.dataGroup.numElements, b = 0; b < e; b++) this.updateRendererLabelProperty(b);
  10257. this.labelFieldOrFunctionChanged = !1
  10258. }
  10259. };
  10260. a.prototype.updateRendererLabelProperty = function(b) {
  10261. if (b = this.dataGroup.getElementAt(b)) b.label = this.itemToLabel(b.data)
  10262. };
  10263. a.prototype.partAdded = function(b, a) {
  10264. d.prototype.partAdded.call(this, b, a);
  10265. 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,
  10266. this.dataGroup_rendererRemoveHandler, this))
  10267. };
  10268. a.prototype.partRemoved = function(b, a) {
  10269. d.prototype.partRemoved.call(this, b, a);
  10270. 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))
  10271. };
  10272. a.prototype.updateRenderer = function(b, a, c) {
  10273. this.itemSelected(a, this._isItemIndexSelected(a));
  10274. return d.prototype.updateRenderer.call(this,
  10275. b, a, c)
  10276. };
  10277. a.prototype.itemToLabel = function(b) {
  10278. if (null != this._labelFunction) return this._labelFunction(b);
  10279. if ("string" == typeof b) return b;
  10280. if (b instanceof c.XML) try {
  10281. 0 != b[this.labelField].length() && (b = b[this.labelField])
  10282. } catch (a) {} else if (b instanceof Object) try {
  10283. null != b[this.labelField] && (b = b[this.labelField])
  10284. } catch (d) {}
  10285. if ("string" == typeof b) return b;
  10286. try {
  10287. if (null !== b) return b.toString()
  10288. } catch (e) {}
  10289. return " "
  10290. };
  10291. a.prototype.itemSelected = function(b, a) {
  10292. if (this.dataGroup) {
  10293. var c = this.dataGroup.getElementAt(b);
  10294. null !=
  10295. c && (c.selected = a)
  10296. }
  10297. };
  10298. a.prototype._isItemIndexSelected = function(b) {
  10299. return b == this.selectedIndex
  10300. };
  10301. a.prototype.commitSelection = function(b) {
  10302. "undefined" === typeof b && (b = !0);
  10303. var d = this.dataProvider ? this.dataProvider.length - 1 : -1,
  10304. e = this._selectedIndex;
  10305. if (!this._allowCustomSelectedItem || this._proposedSelectedIndex != a.CUSTOM_SELECTED_ITEM)
  10306. if (this._proposedSelectedIndex < a.NO_SELECTION && (this._proposedSelectedIndex = a.NO_SELECTION), this._proposedSelectedIndex > d && (this._proposedSelectedIndex = d), this.requireSelection &&
  10307. this._proposedSelectedIndex == a.NO_SELECTION && this.dataProvider && 0 < this.dataProvider.length) return this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION, this._dispatchChangeAfterSelection = !1;
  10308. d = this._proposedSelectedIndex;
  10309. if (this._dispatchChangeAfterSelection && !c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGING, this._selectedIndex, this._proposedSelectedIndex, !0)) return this.itemSelected(this._proposedSelectedIndex, !1), this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION, this._dispatchChangeAfterSelection = !1;
  10310. this._selectedIndex = d;
  10311. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  10312. e != a.NO_SELECTION && this.itemSelected(e, !1);
  10313. this._selectedIndex != a.NO_SELECTION && this.itemSelected(this._selectedIndex, !0);
  10314. b && (this._dispatchChangeAfterSelection && (c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGE, e, this._selectedIndex), this._dispatchChangeAfterSelection = !1), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10315. return !0
  10316. };
  10317. a.prototype.adjustSelection = function(b, c) {
  10318. this._proposedSelectedIndex !=
  10319. a.NO_PROPOSED_SELECTION ? this._proposedSelectedIndex = b : this._selectedIndex = b;
  10320. this.selectedIndexAdjusted = !0;
  10321. this.invalidateProperties()
  10322. };
  10323. a.prototype.itemAdded = function(b) {
  10324. this._doingWholesaleChanges || (this.selectedIndex == a.NO_SELECTION ? this.requireSelection && this.adjustSelection(b, !0) : b <= this.selectedIndex && this.adjustSelection(this.selectedIndex + 1, !0))
  10325. };
  10326. a.prototype.itemRemoved = function(b) {
  10327. this.selectedIndex == a.NO_SELECTION || this._doingWholesaleChanges || (b == this.selectedIndex ? this.requireSelection &&
  10328. 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))
  10329. };
  10330. a.prototype.dataGroup_rendererAddHandler = function(b) {
  10331. b = b.renderer;
  10332. null != b && (b.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.item_mouseEventHandler, this), b.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.item_mouseEventHandler, this))
  10333. };
  10334. a.prototype.dataGroup_rendererRemoveHandler =
  10335. function(b) {
  10336. b = b.renderer;
  10337. null != b && (b.removeEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.item_mouseEventHandler, this), b.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.item_mouseEventHandler, this))
  10338. };
  10339. a.prototype.item_mouseEventHandler = function(b) {
  10340. var c = b.type,
  10341. c = a.TYPE_MAP[c];
  10342. this.hasEventListener(c) && this._dispatchListEvent(b, c, b.currentTarget)
  10343. };
  10344. a.prototype._dispatchListEvent = function(b, a, d) {
  10345. var e = -1,
  10346. e = d ? d.itemIndex : this.dataGroup.getElementIndex(b.currentTarget),
  10347. f = this.dataProvider.getItemAt(e);
  10348. c.ListEvent.dispatchListEvent(this, a, b, e, f, d)
  10349. };
  10350. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  10351. var d = b.items;
  10352. if (b.kind == c.CollectionEventKind.ADD)
  10353. for (var d = d.length, e = 0; e < d; e++) this.itemAdded(b.location + e);
  10354. else if (b.kind == c.CollectionEventKind.REMOVE)
  10355. for (d = d.length, e = d - 1; 0 <= e; e--) this.itemRemoved(b.location + e);
  10356. 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)
  10357. };
  10358. a.NO_SELECTION = -1;
  10359. a.NO_PROPOSED_SELECTION = -2;
  10360. a.CUSTOM_SELECTED_ITEM = -3;
  10361. a.TYPE_MAP = {
  10362. rollOver: "itemRollOver",
  10363. rollOut: "itemRollOut"
  10364. };
  10365. return a
  10366. }(c.SkinnableDataContainer);
  10367. c.ListBase = e
  10368. })(egret || (egret = {}));
  10369. __extends = this.__extends || function(c, e) {
  10370. function d() {
  10371. this.constructor = c
  10372. }
  10373. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10374. d.prototype = e.prototype;
  10375. c.prototype = new d
  10376. };
  10377. (function(c) {
  10378. var e = function(c) {
  10379. function a() {
  10380. c.call(this);
  10381. this._title = "";
  10382. this.hostComponentKey = "egret.Panel";
  10383. this.touchEnabled = !1
  10384. }
  10385. __extends(a, c);
  10386. Object.defineProperty(a.prototype, "title", {
  10387. get: function() {
  10388. return this._title
  10389. },
  10390. set: function(b) {
  10391. this._title = b;
  10392. this.titleDisplay && (this.titleDisplay.text = this.title)
  10393. },
  10394. enumerable: !0,
  10395. configurable: !0
  10396. });
  10397. a.prototype.partAdded = function(b, a) {
  10398. c.prototype.partAdded.call(this, b, a);
  10399. a == this.titleDisplay && (this.titleDisplay.text = this.title)
  10400. };
  10401. return a
  10402. }(c.SkinnableContainer);
  10403. c.Panel = e
  10404. })(egret || (egret = {}));
  10405. __extends = this.__extends || function(c, e) {
  10406. function d() {
  10407. this.constructor = c
  10408. }
  10409. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10410. d.prototype = e.prototype;
  10411. c.prototype = new d
  10412. };
  10413. (function(c) {
  10414. var e = function(d) {
  10415. function a() {
  10416. d.call(this);
  10417. this._autoBackToStage = this._showCloseButton = !0;
  10418. this.hostComponentKey = "egret.TitleWindow";
  10419. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onWindowMouseDown, this, !0, 100)
  10420. }
  10421. __extends(a, d);
  10422. a.prototype.onWindowMouseDown = function(b) {
  10423. this.enabled && this.isPopUp && b.target != this.closeButton && c.PopUpManager.bringToFront(this)
  10424. };
  10425. Object.defineProperty(a.prototype, "showCloseButton", {
  10426. get: function() {
  10427. return this._showCloseButton
  10428. },
  10429. set: function(b) {
  10430. this._showCloseButton !=
  10431. b && (this._showCloseButton = b, this.closeButton && (this.closeButton.visible = this._showCloseButton))
  10432. },
  10433. enumerable: !0,
  10434. configurable: !0
  10435. });
  10436. Object.defineProperty(a.prototype, "autoBackToStage", {
  10437. get: function() {
  10438. return this._autoBackToStage
  10439. },
  10440. set: function(b) {
  10441. this._autoBackToStage = b
  10442. },
  10443. enumerable: !0,
  10444. configurable: !0
  10445. });
  10446. a.prototype.partAdded = function(b, a) {
  10447. d.prototype.partAdded.call(this, b, a);
  10448. a == this.moveArea ? this.moveArea.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.moveArea_mouseDownHandler, this) : a == this.closeButton &&
  10449. (this.closeButton.addEventListener(c.TouchEvent.TOUCH_TAP, this.closeButton_clickHandler, this), this.closeButton.visible = this._showCloseButton)
  10450. };
  10451. a.prototype.partRemoved = function(b, a) {
  10452. d.prototype.partRemoved.call(this, b, a);
  10453. 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)
  10454. };
  10455. a.prototype.closeButton_clickHandler = function(b) {
  10456. c.CloseEvent.dispatchCloseEvent(this,
  10457. c.CloseEvent.CLOSE)
  10458. };
  10459. a.prototype.moveArea_mouseDownHandler = function(b) {
  10460. 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,
  10461. this))
  10462. };
  10463. a.prototype.moveArea_mouseMoveHandler = function(b) {
  10464. b = this.globalToLocal(b.stageX, b.stageY, c.Point.identity);
  10465. this.x += b.x - this._offsetPointX;
  10466. this.y += b.y - this._offsetPointY
  10467. };
  10468. a.prototype.moveArea_mouseUpHandler = function(b) {
  10469. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.moveArea_mouseMoveHandler, this);
  10470. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.moveArea_mouseUpHandler, this);
  10471. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.moveArea_mouseUpHandler,
  10472. this);
  10473. this._autoBackToStage && this.adjustPosForStage();
  10474. c.LayoutUtil.adjustRelativeByXY(this);
  10475. this.includeInLayout = !0
  10476. };
  10477. a.prototype.adjustPosForStage = function() {
  10478. if (this.moveArea && this.stage) {
  10479. var b = this.moveArea.localToGlobal(0, 0),
  10480. a = b.x,
  10481. c = b.y;
  10482. 35 > b.x + this.moveArea.width && (a = 35 - this.moveArea.width);
  10483. b.x > this.stage.stageWidth - 20 && (a = this.stage.stageWidth - 20);
  10484. 20 > b.y + this.moveArea.height && (c = 20 - this.moveArea.height);
  10485. b.y > this.stage.stageHeight - 20 && (c = this.stage.stageHeight - 20);
  10486. this.x += a - b.x;
  10487. this.y += c - b.y
  10488. }
  10489. };
  10490. return a
  10491. }(c.Panel);
  10492. c.TitleWindow = e
  10493. })(egret || (egret = {}));
  10494. __extends = this.__extends || function(c, e) {
  10495. function d() {
  10496. this.constructor = c
  10497. }
  10498. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10499. d.prototype = e.prototype;
  10500. c.prototype = new d
  10501. };
  10502. (function(c) {
  10503. var e = function(d) {
  10504. function a() {
  10505. d.call(this);
  10506. this._contentText = this._secondButtonLabel = this._firstButtonLabel = "";
  10507. this.hostComponentKey = "egret.Alert"
  10508. }
  10509. __extends(a, d);
  10510. a.show = function(b, d, e, m, f, h, k) {
  10511. "undefined" === typeof b && (b = "");
  10512. "undefined" === typeof d && (d = "");
  10513. "undefined" === typeof e && (e = null);
  10514. "undefined" === typeof m && (m = "\u786e\u5b9a");
  10515. "undefined" === typeof f && (f = "");
  10516. "undefined" === typeof h && (h = !0);
  10517. "undefined" === typeof k && (k = !0);
  10518. var n = new a;
  10519. n.contentText = b;
  10520. n.title = d;
  10521. n._firstButtonLabel = m;
  10522. n._secondButtonLabel =
  10523. f;
  10524. n.closeHandler = e;
  10525. c.PopUpManager.addPopUp(n, h, k);
  10526. return n
  10527. };
  10528. Object.defineProperty(a.prototype, "firstButtonLabel", {
  10529. get: function() {
  10530. return this._firstButtonLabel
  10531. },
  10532. set: function(b) {
  10533. this._firstButtonLabel != b && (this._firstButtonLabel = b, this.firstButton && (this.firstButton.label = b))
  10534. },
  10535. enumerable: !0,
  10536. configurable: !0
  10537. });
  10538. Object.defineProperty(a.prototype, "secondButtonLabel", {
  10539. get: function() {
  10540. return this._secondButtonLabel
  10541. },
  10542. set: function(b) {
  10543. this._secondButtonLabel != b && (this._secondButtonLabel = b, !this.secondButton ||
  10544. null != b && "" != b || (this.secondButton.includeInLayout = this.secondButton.visible = "" != this._secondButtonLabel && null != this._secondButtonLabel))
  10545. },
  10546. enumerable: !0,
  10547. configurable: !0
  10548. });
  10549. Object.defineProperty(a.prototype, "contentText", {
  10550. get: function() {
  10551. return this._contentText
  10552. },
  10553. set: function(b) {
  10554. this._contentText != b && (this._contentText = b, this.contentDisplay && (this.contentDisplay.text = b))
  10555. },
  10556. enumerable: !0,
  10557. configurable: !0
  10558. });
  10559. a.prototype.onClose = function(b) {
  10560. c.PopUpManager.removePopUp(this);
  10561. if (null != this.closeHandler) {
  10562. var d =
  10563. new c.CloseEvent(c.CloseEvent.CLOSE);
  10564. switch (b.currentTarget) {
  10565. case this.firstButton:
  10566. d.detail = a.FIRST_BUTTON;
  10567. break;
  10568. case this.secondButton:
  10569. d.detail = a.SECOND_BUTTON
  10570. }
  10571. this.closeHandler(d)
  10572. }
  10573. };
  10574. a.prototype.closeButton_clickHandler = function(b) {
  10575. d.prototype.closeButton_clickHandler.call(this, b);
  10576. c.PopUpManager.removePopUp(this);
  10577. b = new c.CloseEvent(c.CloseEvent.CLOSE, !1, !1, a.CLOSE_BUTTON);
  10578. null != this.closeHandler && this.closeHandler(b)
  10579. };
  10580. a.prototype.partAdded = function(b, a) {
  10581. d.prototype.partAdded.call(this, b, a);
  10582. a == this.contentDisplay ?
  10583. 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))
  10584. };
  10585. a.prototype.partRemoved = function(b, a) {
  10586. d.prototype.partRemoved.call(this,
  10587. b, a);
  10588. 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)
  10589. };
  10590. a.FIRST_BUTTON = "firstButton";
  10591. a.SECOND_BUTTON = "secondButton";
  10592. a.CLOSE_BUTTON = "closeButton";
  10593. return a
  10594. }(c.TitleWindow);
  10595. c.Alert = e
  10596. })(egret || (egret = {}));
  10597. __extends = this.__extends || function(c, e) {
  10598. function d() {
  10599. this.constructor = c
  10600. }
  10601. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10602. d.prototype = e.prototype;
  10603. c.prototype = new d
  10604. };
  10605. (function(c) {
  10606. var e = function(d) {
  10607. function a() {
  10608. d.call(this);
  10609. this._slideDuration = 500;
  10610. this._direction = c.ProgressBarDirection.LEFT_TO_RIGHT;
  10611. this.animationValue = 0;
  10612. this.trackResizedOrMoved = !1;
  10613. this.hostComponentKey = "egret.ProgressBar"
  10614. }
  10615. __extends(a, d);
  10616. Object.defineProperty(a.prototype, "labelFunction", {
  10617. get: function() {
  10618. return this._labelFunction
  10619. },
  10620. set: function(b) {
  10621. this._labelFunction != b && (this._labelFunction = b, this.invalidateDisplayList())
  10622. },
  10623. enumerable: !0,
  10624. configurable: !0
  10625. });
  10626. a.prototype.valueToLabel = function(b, a) {
  10627. return null !=
  10628. this.labelFunction ? this._labelFunction(b, a) : b + " / " + a
  10629. };
  10630. Object.defineProperty(a.prototype, "slideDuration", {
  10631. get: function() {
  10632. return this._slideDuration
  10633. },
  10634. set: function(b) {
  10635. this._slideDuration != b && (this._slideDuration = b, this.animator && this.animator.isPlaying && (this.animator.stop(), this._setValue(this.slideToValue)))
  10636. },
  10637. enumerable: !0,
  10638. configurable: !0
  10639. });
  10640. Object.defineProperty(a.prototype, "direction", {
  10641. get: function() {
  10642. return this._direction
  10643. },
  10644. set: function(b) {
  10645. this._direction != b && (this._direction = b, this.invalidateDisplayList())
  10646. },
  10647. enumerable: !0,
  10648. configurable: !0
  10649. });
  10650. Object.defineProperty(a.prototype, "value", {
  10651. get: function() {
  10652. return this._getValue()
  10653. },
  10654. set: function(b) {
  10655. 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 !=
  10656. 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 = [{
  10657. prop: "value",
  10658. from: this.animationValue,
  10659. to: this.slideToValue
  10660. }], this.animator.play())) : this.animationValue = this._getValue())
  10661. },
  10662. enumerable: !0,
  10663. configurable: !0
  10664. });
  10665. a.prototype.animationUpdateHandler = function(b) {
  10666. b = this.nearestValidValue(b.currentValue.value, this.snapInterval);
  10667. this.animationValue = Math.min(this.maximum, Math.max(this.minimum,
  10668. b));
  10669. this.invalidateDisplayList()
  10670. };
  10671. a.prototype.setValue = function(b) {
  10672. d.prototype.setValue.call(this, b);
  10673. this.invalidateDisplayList()
  10674. };
  10675. a.prototype.updateDisplayList = function(b, a) {
  10676. d.prototype.updateDisplayList.call(this, b, a);
  10677. this.updateSkinDisplayList()
  10678. };
  10679. a.prototype.partAdded = function(b, a) {
  10680. 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))
  10681. };
  10682. a.prototype.partRemoved =
  10683. function(b, a) {
  10684. 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))
  10685. };
  10686. a.prototype.onTrackResizeOrMove = function(b) {
  10687. this.trackResizedOrMoved = !0;
  10688. this.invalidateProperties()
  10689. };
  10690. a.prototype.commitProperties = function() {
  10691. d.prototype.commitProperties.call(this);
  10692. this.trackResizedOrMoved && (this.trackResizedOrMoved = !1, this.updateSkinDisplayList())
  10693. };
  10694. a.prototype.updateSkinDisplayList =
  10695. function() {
  10696. this.trackResizedOrMoved = !1;
  10697. var b = this.value;
  10698. this.animator && this.animator.isPlaying ? b = this.animationValue : (b = this.value, isNaN(b) && (b = 0));
  10699. var a = isNaN(this.maximum) ? 0 : this.maximum;
  10700. if (this.thumb && this.track) {
  10701. var d = isNaN(this.track.width) ? 0 : this.track.width,
  10702. d = d * this.track.scaleX,
  10703. e = isNaN(this.track.height) ? 0 : this.track.height,
  10704. e = e * this.track.scaleY,
  10705. f = Math.round(b / a * d);
  10706. if (isNaN(f) || 0 > f || Infinity === f) f = 0;
  10707. var h = Math.round(b / a * e);
  10708. if (isNaN(h) || 0 > h || Infinity === h) h = 0;
  10709. var k = this.track.localToGlobal(0,
  10710. 0),
  10711. n = this.globalToLocal(k.x, k.y, c.Point.identity),
  10712. k = n.x,
  10713. n = n.y;
  10714. switch (this._direction) {
  10715. case c.ProgressBarDirection.LEFT_TO_RIGHT:
  10716. this.thumb.width = f;
  10717. this.thumb.height = e;
  10718. this.thumb.x = k;
  10719. break;
  10720. case c.ProgressBarDirection.RIGHT_TO_LEFT:
  10721. this.thumb.width = f;
  10722. this.thumb.height = e;
  10723. this.thumb.x = k + d - f;
  10724. break;
  10725. case c.ProgressBarDirection.TOP_TO_BOTTOM:
  10726. this.thumb.width = d;
  10727. this.thumb.height = h;
  10728. this.thumb.y = n;
  10729. break;
  10730. case c.ProgressBarDirection.BOTTOM_TO_TOP:
  10731. this.thumb.width = d, this.thumb.height = h, this.thumb.y = n + e - h
  10732. }
  10733. }
  10734. this.labelDisplay &&
  10735. (this.labelDisplay.text = this.valueToLabel(b, a))
  10736. };
  10737. return a
  10738. }(c.Range);
  10739. c.ProgressBar = e
  10740. })(egret || (egret = {}));
  10741. (function(c) {
  10742. var e = function() {
  10743. function c() {}
  10744. c.LEFT_TO_RIGHT = "leftToRight";
  10745. c.RIGHT_TO_LEFT = "rightToLeft";
  10746. c.TOP_TO_BOTTOM = "topToBottom";
  10747. c.BOTTOM_TO_TOP = "bottomToTop";
  10748. return c
  10749. }();
  10750. c.ProgressBarDirection = e
  10751. })(egret || (egret = {}));
  10752. __extends = this.__extends || function(c, e) {
  10753. function d() {
  10754. this.constructor = c
  10755. }
  10756. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10757. d.prototype = e.prototype;
  10758. c.prototype = new d
  10759. };
  10760. (function(c) {
  10761. var e = function(d) {
  10762. function a() {
  10763. d.call(this);
  10764. this.hostComponentKey = "egret.HSlider"
  10765. }
  10766. __extends(a, d);
  10767. a.prototype.pointToValue = function(b, a) {
  10768. if (!this.thumb || !this.track) return 0;
  10769. var c = this.maximum - this.minimum,
  10770. d = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth;
  10771. return this.minimum + (0 != d ? b / d * c : 0)
  10772. };
  10773. a.prototype.updateSkinDisplayList = function() {
  10774. if (this.thumb && this.track) {
  10775. var b = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth,
  10776. a = this.maximum - this.minimum,
  10777. b = 0 < a ? (this.pendingValue -
  10778. this.minimum) / a * b : 0,
  10779. d = this.track.localToGlobal(b, 0),
  10780. a = d.x,
  10781. d = d.y,
  10782. e = this.thumb.parent.globalToLocal(a, d, c.Point.identity).x;
  10783. this.thumb.setLayoutBoundsPosition(Math.round(e), this.thumb.layoutBoundsY);
  10784. 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))
  10785. }
  10786. };
  10787. return a
  10788. }(c.SliderBase);
  10789. c.HSlider = e
  10790. })(egret || (egret = {}));
  10791. __extends = this.__extends || function(c, e) {
  10792. function d() {
  10793. this.constructor = c
  10794. }
  10795. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10796. d.prototype = e.prototype;
  10797. c.prototype = new d
  10798. };
  10799. (function(c) {
  10800. var e = function(d) {
  10801. function a() {
  10802. d.call(this);
  10803. this.hostComponentKey = "egret.VSlider"
  10804. }
  10805. __extends(a, d);
  10806. a.prototype.pointToValue = function(b, a) {
  10807. if (!this.thumb || !this.track) return 0;
  10808. var c = this.maximum - this.minimum,
  10809. d = this.track.layoutBoundsHeight - this.thumb.layoutBoundsHeight;
  10810. return this.minimum + (0 != d ? (d - a) / d * c : 0)
  10811. };
  10812. a.prototype.updateSkinDisplayList = function() {
  10813. if (this.thumb && this.track) {
  10814. var b = this.thumb.layoutBoundsHeight,
  10815. a = this.track.layoutBoundsHeight - b,
  10816. d = this.maximum - this.minimum,
  10817. e = this.track.localToGlobal(0,
  10818. 0 < d ? a - (this.pendingValue - this.minimum) / d * a : 0),
  10819. d = e.x,
  10820. e = e.y,
  10821. f = this.thumb.parent.globalToLocal(d, e, c.Point.identity).y;
  10822. this.thumb.setLayoutBoundsPosition(this.thumb.layoutBoundsX, Math.round(f));
  10823. 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))
  10824. }
  10825. };
  10826. return a
  10827. }(c.SliderBase);
  10828. c.VSlider = e
  10829. })(egret || (egret = {}));
  10830. __extends = this.__extends || function(c, e) {
  10831. function d() {
  10832. this.constructor = c
  10833. }
  10834. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10835. d.prototype = e.prototype;
  10836. c.prototype = new d
  10837. };
  10838. (function(c) {
  10839. var e = function(d) {
  10840. function a() {
  10841. d.call(this);
  10842. this._allowMultipleSelection = !1;
  10843. this._selectedIndices = [];
  10844. this._captureItemRenderer = !0;
  10845. this.hostComponentKey = "egret.List";
  10846. this.useVirtualLayout = !0
  10847. }
  10848. __extends(a, d);
  10849. a.prototype.createChildren = function() {
  10850. this.itemRenderer || (this.itemRenderer = c.DataGroup.defaultRendererFactory);
  10851. d.prototype.createChildren.call(this)
  10852. };
  10853. Object.defineProperty(a.prototype, "useVirtualLayout", {
  10854. get: function() {
  10855. return this._getUseVirtualLayout()
  10856. },
  10857. set: function(b) {
  10858. this._setUseVirtualLayout(b)
  10859. },
  10860. enumerable: !0,
  10861. configurable: !0
  10862. });
  10863. Object.defineProperty(a.prototype, "allowMultipleSelection", {
  10864. get: function() {
  10865. return this._allowMultipleSelection
  10866. },
  10867. set: function(b) {
  10868. this._allowMultipleSelection = b
  10869. },
  10870. enumerable: !0,
  10871. configurable: !0
  10872. });
  10873. Object.defineProperty(a.prototype, "selectedIndices", {
  10874. get: function() {
  10875. return this._proposedSelectedIndices ? this._proposedSelectedIndices : this._selectedIndices
  10876. },
  10877. set: function(b) {
  10878. this._setSelectedIndices(b, !1)
  10879. },
  10880. enumerable: !0,
  10881. configurable: !0
  10882. });
  10883. Object.defineProperty(a.prototype, "selectedIndex", {
  10884. get: function() {
  10885. return this._proposedSelectedIndices ? 0 < this._proposedSelectedIndices.length ? this._proposedSelectedIndices[0] : -1 : this._getSelectedIndex()
  10886. },
  10887. set: function(b) {
  10888. this._setSelectedIndex(b)
  10889. },
  10890. enumerable: !0,
  10891. configurable: !0
  10892. });
  10893. Object.defineProperty(a.prototype, "selectedItems", {
  10894. get: function() {
  10895. var b = [],
  10896. a = this.selectedIndices;
  10897. if (a)
  10898. for (var c = a.length, d = 0; d < c; d++) b[d] = this.dataProvider.getItemAt(a[d]);
  10899. return b
  10900. },
  10901. set: function(b) {
  10902. var a = [];
  10903. if (b)
  10904. for (var c = b.length, d = 0; d < c; d++) {
  10905. var e = this.dataProvider.getItemIndex(b[d]); - 1 != e && a.splice(0, 0, e);
  10906. if (-1 == e) {
  10907. a = [];
  10908. break
  10909. }
  10910. }
  10911. this._setSelectedIndices(a, !1)
  10912. },
  10913. enumerable: !0,
  10914. configurable: !0
  10915. });
  10916. a.prototype._setSelectedIndices = function(b, a) {
  10917. "undefined" === typeof a && (a = !1);
  10918. a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a);
  10919. this._proposedSelectedIndices = b ? b : [];
  10920. this.invalidateProperties()
  10921. };
  10922. a.prototype.commitProperties = function() {
  10923. d.prototype.commitProperties.call(this);
  10924. this._proposedSelectedIndices && this.commitSelection()
  10925. };
  10926. a.prototype.commitSelection = function(b) {
  10927. "undefined" ===
  10928. typeof b && (b = !0);
  10929. var a = this._selectedIndex;
  10930. if (this._proposedSelectedIndices) {
  10931. this._proposedSelectedIndices = this._proposedSelectedIndices.filter(this.isValidIndex);
  10932. if (!this.allowMultipleSelection && 0 < this._proposedSelectedIndices.length) {
  10933. var e = [];
  10934. e.push(this._proposedSelectedIndices[0]);
  10935. this._proposedSelectedIndices = e
  10936. }
  10937. this._proposedSelectedIndex = 0 < this._proposedSelectedIndices.length ? this._proposedSelectedIndices[0] : -1
  10938. }
  10939. e = d.prototype.commitSelection.call(this, !1);
  10940. if (!e) return this._proposedSelectedIndices =
  10941. null, !1;
  10942. this.selectedIndex > c.ListBase.NO_SELECTION && (this._proposedSelectedIndices ? -1 == this._proposedSelectedIndices.indexOf(this.selectedIndex) && this._proposedSelectedIndices.push(this.selectedIndex) : this._proposedSelectedIndices = [this.selectedIndex]);
  10943. this._proposedSelectedIndices && (-1 != this._proposedSelectedIndices.indexOf(a) && this.itemSelected(a, !0), this.commitMultipleSelection());
  10944. b && e && (this._dispatchChangeAfterSelection && (c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGE,
  10945. a, this._selectedIndex), this._dispatchChangeAfterSelection = !1), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10946. return e
  10947. };
  10948. a.prototype.isValidIndex = function(b, a, c) {
  10949. return this.dataProvider && 0 <= b && b < this.dataProvider.length
  10950. };
  10951. a.prototype.commitMultipleSelection = function() {
  10952. var b = [],
  10953. a = [],
  10954. c, d;
  10955. if (0 < this._selectedIndices.length && 0 < this._proposedSelectedIndices.length) {
  10956. d = this._proposedSelectedIndices.length;
  10957. for (c = 0; c < d; c++) - 1 == this._selectedIndices.indexOf(this._proposedSelectedIndices[c]) && a.push(this._proposedSelectedIndices[c]);
  10958. d = this._selectedIndices.length;
  10959. for (c = 0; c < d; c++) - 1 == this._proposedSelectedIndices.indexOf(this._selectedIndices[c]) && b.push(this._selectedIndices[c])
  10960. } else 0 < this._selectedIndices.length ? b = this._selectedIndices : 0 < this._proposedSelectedIndices.length && (a = this._proposedSelectedIndices);
  10961. this._selectedIndices = this._proposedSelectedIndices;
  10962. if (0 < b.length)
  10963. for (d = b.length, c = 0; c < d; c++) this.itemSelected(b[c], !1);
  10964. if (0 < a.length)
  10965. for (d = a.length, c = 0; c < d; c++) this.itemSelected(a[c], !0);
  10966. this._proposedSelectedIndices =
  10967. null
  10968. };
  10969. a.prototype._isItemIndexSelected = function(b) {
  10970. return this._allowMultipleSelection ? -1 != this._selectedIndices.indexOf(b) : d.prototype._isItemIndexSelected.call(this, b)
  10971. };
  10972. a.prototype.dataGroup_rendererAddHandler = function(b) {
  10973. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  10974. b = b.renderer;
  10975. null != b && (b.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.item_mouseDownHandler, this), b.addEventListener(c.TouchEvent.TOUCH_END, this.item_mouseUpHandler, this))
  10976. };
  10977. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  10978. d.prototype.dataGroup_rendererRemoveHandler.call(this,
  10979. b);
  10980. b = b.renderer;
  10981. null != b && (b.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.item_mouseDownHandler, this), b.removeEventListener(c.TouchEvent.TOUCH_END, this.item_mouseUpHandler, this))
  10982. };
  10983. a.prototype.item_mouseDownHandler = function(b) {
  10984. if (!b.isDefaultPrevented()) {
  10985. var a = b.currentTarget,
  10986. d;
  10987. d = a ? a.itemIndex : this.dataGroup.getElementIndex(b.currentTarget);
  10988. this._allowMultipleSelection ? this._setSelectedIndices(this.calculateSelectedIndices(d, b.shiftKey, b.ctrlKey), !0) : this._setSelectedIndex(d, !0);
  10989. this._captureItemRenderer &&
  10990. (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))
  10991. }
  10992. };
  10993. a.prototype.calculateSelectedIndices = function(b, a, c) {
  10994. var d = [];
  10995. if (a)
  10996. if (a = 0 < this._selectedIndices.length ? this._selectedIndices[this._selectedIndices.length - 1] : 0, a < b)
  10997. for (; a <= b; a++) d.splice(0, 0, a);
  10998. else
  10999. for (; a >= b; a--) d.splice(0, 0, a);
  11000. else if (c)
  11001. if (0 < this._selectedIndices.length)
  11002. if (1 == this._selectedIndices.length &&
  11003. this._selectedIndices[0] == b) {
  11004. if (!this.requireSelection) return d;
  11005. d.splice(0, 0, this._selectedIndices[0])
  11006. } else {
  11007. c = !1;
  11008. 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]);
  11009. c || d.splice(0, 0, b)
  11010. } else d.splice(0, 0, b);
  11011. else d.splice(0, 0, b);
  11012. return d
  11013. };
  11014. a.prototype.item_mouseUpHandler = function(b) {
  11015. var a = b.currentTarget;
  11016. a == this.mouseDownItemRenderer && this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, a)
  11017. };
  11018. a.prototype.stage_mouseUpHandler =
  11019. function(b) {
  11020. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  11021. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  11022. this.mouseDownItemRenderer = null
  11023. };
  11024. return a
  11025. }(c.ListBase);
  11026. c.List = e
  11027. })(egret || (egret = {}));
  11028. __extends = this.__extends || function(c, e) {
  11029. function d() {
  11030. this.constructor = c
  11031. }
  11032. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11033. d.prototype = e.prototype;
  11034. c.prototype = new d
  11035. };
  11036. (function(c) {
  11037. var e = function(d) {
  11038. function a() {
  11039. d.call(this);
  11040. this._displayPopUp = this._popUpWidthMatchesAnchorWidth = this._popUpHeightMatchesAnchorHeight = this.addedToStage = this.popUpIsDisplayed = !1;
  11041. this._popUpPosition = c.PopUpPosition.TOP_LEFT;
  11042. this.inAnimation = !1;
  11043. this.animator = null;
  11044. this._openDuration = 250;
  11045. this._closeDuration = 150;
  11046. this.valueRange = 1;
  11047. this.addEventListener(c.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  11048. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.removedFromStageHandler, this)
  11049. }
  11050. __extends(a,
  11051. d);
  11052. Object.defineProperty(a.prototype, "popUpHeightMatchesAnchorHeight", {
  11053. get: function() {
  11054. return this._popUpHeightMatchesAnchorHeight
  11055. },
  11056. set: function(b) {
  11057. this._popUpHeightMatchesAnchorHeight != b && (this._popUpHeightMatchesAnchorHeight = b, this.invalidateDisplayList())
  11058. },
  11059. enumerable: !0,
  11060. configurable: !0
  11061. });
  11062. Object.defineProperty(a.prototype, "popUpWidthMatchesAnchorWidth", {
  11063. get: function() {
  11064. return this._popUpWidthMatchesAnchorWidth
  11065. },
  11066. set: function(b) {
  11067. this._popUpWidthMatchesAnchorWidth != b && (this._popUpWidthMatchesAnchorWidth =
  11068. b, this.invalidateDisplayList())
  11069. },
  11070. enumerable: !0,
  11071. configurable: !0
  11072. });
  11073. Object.defineProperty(a.prototype, "displayPopUp", {
  11074. get: function() {
  11075. return this._displayPopUp
  11076. },
  11077. set: function(b) {
  11078. this._displayPopUp != b && (this._displayPopUp = b, this.addOrRemovePopUp())
  11079. },
  11080. enumerable: !0,
  11081. configurable: !0
  11082. });
  11083. Object.defineProperty(a.prototype, "popUp", {
  11084. get: function() {
  11085. return this._popUp
  11086. },
  11087. set: function(b) {
  11088. this._popUp != b && (this._popUp = b, this.dispatchEventWith("popUpChanged"))
  11089. },
  11090. enumerable: !0,
  11091. configurable: !0
  11092. });
  11093. Object.defineProperty(a.prototype,
  11094. "popUpPosition", {
  11095. get: function() {
  11096. return this._popUpPosition
  11097. },
  11098. set: function(b) {
  11099. this._popUpPosition != b && (this._popUpPosition = b, this.invalidateDisplayList())
  11100. },
  11101. enumerable: !0,
  11102. configurable: !0
  11103. });
  11104. a.prototype.updateDisplayList = function(b, a) {
  11105. d.prototype.updateDisplayList.call(this, b, a);
  11106. this.applyPopUpTransform(b, a)
  11107. };
  11108. a.prototype.updatePopUpTransform = function() {
  11109. this.applyPopUpTransform(this.width, this.height)
  11110. };
  11111. a.prototype.calculatePopUpPosition = function() {
  11112. var b = c.Point.identity;
  11113. switch (this._popUpPosition) {
  11114. case c.PopUpPosition.BELOW:
  11115. b.x =
  11116. 0;
  11117. b.y = this.height;
  11118. break;
  11119. case c.PopUpPosition.ABOVE:
  11120. b.x = 0;
  11121. b.y = -this.popUp.layoutBoundsHeight;
  11122. break;
  11123. case c.PopUpPosition.LEFT:
  11124. b.x = -this.popUp.layoutBoundsWidth;
  11125. b.y = 0;
  11126. break;
  11127. case c.PopUpPosition.RIGHT:
  11128. b.x = this.width;
  11129. b.y = 0;
  11130. break;
  11131. case c.PopUpPosition.CENTER:
  11132. b.x = 0.5 * (this.width - this.popUp.layoutBoundsWidth), b.y = 0.5 * (this.height - this.popUp.layoutBoundsHeight)
  11133. }
  11134. b = this.localToGlobal(b.x, b.y, b);
  11135. return b = this.popUp.parent.globalToLocal(b.x, b.y, b)
  11136. };
  11137. Object.defineProperty(a.prototype, "openDuration", {
  11138. get: function() {
  11139. return this._openDuration
  11140. },
  11141. set: function(b) {
  11142. this._openDuration = b
  11143. },
  11144. enumerable: !0,
  11145. configurable: !0
  11146. });
  11147. Object.defineProperty(a.prototype, "closeDuration", {
  11148. get: function() {
  11149. return this._closeDuration
  11150. },
  11151. set: function(b) {
  11152. this._closeDuration = b
  11153. },
  11154. enumerable: !0,
  11155. configurable: !0
  11156. });
  11157. a.prototype.animationStartHandler = function(b) {
  11158. this.inAnimation = !0;
  11159. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !1)
  11160. };
  11161. a.prototype.animationUpdateHandler = function(b) {
  11162. var a = this.popUp._scrollRect,
  11163. d = Math.round(b.currentValue.x);
  11164. b = Math.round(b.currentValue.y);
  11165. a ?
  11166. (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)
  11167. };
  11168. a.prototype.animationEndHandler = function(b) {
  11169. this.inAnimation = !1;
  11170. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !0);
  11171. this.popUp.scrollRect = null;
  11172. this.popUpIsDisplayed || (c.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  11173. };
  11174. a.prototype.addOrRemovePopUp = function() {
  11175. this.addedToStage && this.popUp && (null == this.popUp.parent && this.displayPopUp ?
  11176. (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() {
  11177. 0 < this.openDuration && this.startAnimation()
  11178. }, this)) : null == this.popUp.parent || this.displayPopUp || this.removeAndResetPopUp())
  11179. };
  11180. a.prototype.removeAndResetPopUp = function() {
  11181. this.inAnimation && this.animator.end();
  11182. this.popUpIsDisplayed = !1;
  11183. 0 < this._closeDuration ? this.startAnimation() : (c.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  11184. };
  11185. a.prototype.applyPopUpTransform = function(b, a) {
  11186. if (this.popUpIsDisplayed) {
  11187. this.popUpWidthMatchesAnchorWidth && (this.popUp.width = b);
  11188. this.popUpHeightMatchesAnchorHeight && (this.popUp.height = a);
  11189. "validateNow" in this.popUp && this.popUp.validateNow();
  11190. var c = this.calculatePopUpPosition();
  11191. this.popUp.x = c.x;
  11192. this.popUp.y = c.y
  11193. }
  11194. };
  11195. a.prototype.startAnimation = function() {
  11196. this.animator || (this.animator = new c.Animation(this.animationUpdateHandler,
  11197. this), this.animator.endFunction = this.animationEndHandler, this.animator.startFunction = this.animationStartHandler);
  11198. this.animator.motionPaths = this.createMotionPath();
  11199. this.animator.duration = this.popUpIsDisplayed ? this._openDuration : this._closeDuration;
  11200. this.animator.play()
  11201. };
  11202. a.prototype.createMotionPath = function() {
  11203. var b = {
  11204. prop: "x"
  11205. },
  11206. a = {
  11207. prop: "y"
  11208. },
  11209. d = [b, a];
  11210. switch (this._popUpPosition) {
  11211. case c.PopUpPosition.TOP_LEFT:
  11212. case c.PopUpPosition.CENTER:
  11213. case c.PopUpPosition.BELOW:
  11214. b.from = b.to = 0;
  11215. a.from = this.popUp.height;
  11216. a.to =
  11217. 0;
  11218. this.valueRange = this.popUp.height;
  11219. break;
  11220. case c.PopUpPosition.ABOVE:
  11221. b.from = b.to = 0;
  11222. a.from = -this.popUp.height;
  11223. a.to = 0;
  11224. this.valueRange = this.popUp.height;
  11225. break;
  11226. case c.PopUpPosition.LEFT:
  11227. a.from = a.to = 0;
  11228. b.from = -this.popUp.width;
  11229. b.to = 0;
  11230. this.valueRange = this.popUp.width;
  11231. break;
  11232. case c.PopUpPosition.RIGHT:
  11233. a.from = a.to = 0;
  11234. b.from = this.popUp.width;
  11235. b.to = 0;
  11236. this.valueRange = this.popUp.width;
  11237. break;
  11238. default:
  11239. this.valueRange = 1
  11240. }
  11241. this.valueRange = Math.abs(this.valueRange);
  11242. if (!this.popUpIsDisplayed) {
  11243. var e = b.from;
  11244. b.from = b.to;
  11245. b.to =
  11246. e;
  11247. e = a.from;
  11248. a.from = a.to;
  11249. a.to = e
  11250. }
  11251. return d
  11252. };
  11253. a.prototype.addedToStageHandler = function(b) {
  11254. this.addedToStage = !0;
  11255. c.callLater(this.checkPopUpState, this)
  11256. };
  11257. a.prototype.checkPopUpState = function() {
  11258. this.addedToStage ? this.addOrRemovePopUp() : null != this.popUp && null != this.popUp.parent && this.removeAndResetPopUp()
  11259. };
  11260. a.prototype.removedFromStageHandler = function(b) {
  11261. this.addedToStage = !1;
  11262. c.callLater(this.checkPopUpState, this)
  11263. };
  11264. return a
  11265. }(c.UIComponent);
  11266. c.PopUpAnchor = e
  11267. })(egret || (egret = {}));
  11268. __extends = this.__extends || function(c, e) {
  11269. function d() {
  11270. this.constructor = c
  11271. }
  11272. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11273. d.prototype = e.prototype;
  11274. c.prototype = new d
  11275. };
  11276. (function(c) {
  11277. var e = function(d) {
  11278. function a() {
  11279. d.call(this);
  11280. this._isOpen = !1;
  11281. this._closeOnResize = !0;
  11282. this._rollOverOpenDelay = NaN
  11283. }
  11284. __extends(a, d);
  11285. Object.defineProperty(a.prototype, "openButton", {
  11286. get: function() {
  11287. return this._openButton
  11288. },
  11289. set: function(b) {
  11290. this._openButton !== b && (this.removeOpenTriggers(), this._openButton = b, this.addOpenTriggers())
  11291. },
  11292. enumerable: !0,
  11293. configurable: !0
  11294. });
  11295. Object.defineProperty(a.prototype, "dropDown", {
  11296. get: function() {
  11297. return this._dropDown
  11298. },
  11299. set: function(b) {
  11300. this._dropDown !== b && (this._dropDown =
  11301. b)
  11302. },
  11303. enumerable: !0,
  11304. configurable: !0
  11305. });
  11306. Object.defineProperty(a.prototype, "isOpen", {
  11307. get: function() {
  11308. return this._isOpen
  11309. },
  11310. enumerable: !0,
  11311. configurable: !0
  11312. });
  11313. Object.defineProperty(a.prototype, "closeOnResize", {
  11314. get: function() {
  11315. return this._closeOnResize
  11316. },
  11317. set: function(b) {
  11318. this._closeOnResize != b && (this.isOpen && this.removeCloseOnResizeTrigger(), this._closeOnResize = b, this.addCloseOnResizeTrigger())
  11319. },
  11320. enumerable: !0,
  11321. configurable: !0
  11322. });
  11323. Object.defineProperty(a.prototype, "rollOverOpenDelay", {
  11324. get: function() {
  11325. return this._rollOverOpenDelay
  11326. },
  11327. set: function(b) {
  11328. this._rollOverOpenDelay != b && (this.removeOpenTriggers(), this._rollOverOpenDelay = b, this.addOpenTriggers())
  11329. },
  11330. enumerable: !0,
  11331. configurable: !0
  11332. });
  11333. a.prototype.addOpenTriggers = function() {
  11334. 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))
  11335. };
  11336. a.prototype.removeOpenTriggers = function() {
  11337. this.openButton && (isNaN(this.rollOverOpenDelay) ?
  11338. this.openButton.removeEventListener(c.UIEvent.BUTTON_DOWN, this._openButton_buttonDownHandler, this) : this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this._openButton_rollOverHandler, this))
  11339. };
  11340. a.prototype.addCloseTriggers = function() {
  11341. 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)) :
  11342. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this), this.addCloseOnResizeTrigger())
  11343. };
  11344. a.prototype.removeCloseTriggers = function() {
  11345. 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,
  11346. 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())
  11347. };
  11348. a.prototype.addCloseOnResizeTrigger = function() {
  11349. this.closeOnResize && c.UIGlobals.stage.addEventListener(c.Event.RESIZE, this.stage_resizeHandler, this)
  11350. };
  11351. a.prototype.removeCloseOnResizeTrigger = function() {
  11352. this.closeOnResize && c.UIGlobals.stage.removeEventListener(c.Event.RESIZE, this.stage_resizeHandler,
  11353. this)
  11354. };
  11355. a.prototype.isTargetOverDropDownOrOpenButton = function(b) {
  11356. if (b) {
  11357. if (this.openButton && this.openButton.contains(b)) return !0;
  11358. if (null != this.hitAreaAdditions)
  11359. for (var a = 0; a < this.hitAreaAdditions.length; a++)
  11360. if (this.hitAreaAdditions[a] == b || this.hitAreaAdditions[a] instanceof c.DisplayObjectContainer && this.hitAreaAdditions[a].contains(b)) return !0;
  11361. if (this.dropDown instanceof c.DisplayObjectContainer) {
  11362. if (this.dropDown.contains(b)) return !0
  11363. } else if (b == this.dropDown) return !0
  11364. }
  11365. return !1
  11366. };
  11367. a.prototype.openDropDown =
  11368. function() {
  11369. this.openDropDownHelper()
  11370. };
  11371. a.prototype.openDropDownHelper = function() {
  11372. this.isOpen || (this.addCloseTriggers(), this._isOpen = !0, this.openButton && this.openButton._setKeepDown(!0), c.UIEvent.dispatchUIEvent(this, c.UIEvent.OPEN))
  11373. };
  11374. a.prototype.closeDropDown = function(b) {
  11375. if (this.isOpen) {
  11376. this._isOpen = !1;
  11377. this.openButton && this.openButton._setKeepDown(!1);
  11378. var a = new c.UIEvent(c.UIEvent.CLOSE, !1, !0);
  11379. b || a.preventDefault();
  11380. this.dispatchEvent(a);
  11381. this.removeCloseTriggers()
  11382. }
  11383. };
  11384. a.prototype._openButton_buttonDownHandler =
  11385. function(b) {
  11386. this.isOpen ? this.closeDropDown(!0) : (this.mouseIsDown = !0, this.openDropDownHelper())
  11387. };
  11388. a.prototype._openButton_rollOverHandler = function(b) {
  11389. 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())
  11390. };
  11391. a.prototype.openButton_rollOutHandler = function(b) {
  11392. this.rollOverOpenDelayTimer && this.rollOverOpenDelayTimer.running && (this.rollOverOpenDelayTimer.stop(), this.rollOverOpenDelayTimer = null);
  11393. this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this)
  11394. };
  11395. a.prototype.rollOverDelay_timerCompleteHandler = function(b) {
  11396. this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this);
  11397. this.rollOverOpenDelayTimer = null;
  11398. this.openDropDownHelper()
  11399. };
  11400. a.prototype.stage_mouseDownHandler = function(b) {
  11401. if (this.mouseIsDown) this.mouseIsDown = !1;
  11402. else if (!this.dropDown || this.dropDown && (b.target == this.dropDown || this.dropDown instanceof c.DisplayObjectContainer && !this.dropDown.contains(b.target))) {
  11403. var a = b.target;
  11404. if (!(this.openButton && a && this.openButton.contains(a))) {
  11405. if (null != this.hitAreaAdditions)
  11406. for (a = 0; a < this.hitAreaAdditions.length; a++)
  11407. if (this.hitAreaAdditions[a] == b.target || this.hitAreaAdditions[a] instanceof c.DisplayObjectContainer && this.hitAreaAdditions[a].contains(b.target)) return;
  11408. this.closeDropDown(!0)
  11409. }
  11410. }
  11411. };
  11412. a.prototype.stage_mouseMoveHandler = function(b) {
  11413. 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))
  11414. };
  11415. a.prototype.stage_mouseUpHandler_noRollOverOpenDelay = function(b) {
  11416. this.mouseIsDown && (this.mouseIsDown = !1)
  11417. };
  11418. a.prototype.stage_mouseUpHandler =
  11419. function(b) {
  11420. 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)
  11421. };
  11422. a.prototype.stage_resizeHandler = function(b) {
  11423. this.closeDropDown(!0)
  11424. };
  11425. a.prototype.stage_mouseWheelHandler = function(b) {
  11426. !this.dropDown || this.dropDown.contains(b.target) && b.isDefaultPrevented() || this.closeDropDown(!1)
  11427. };
  11428. return a
  11429. }(c.EventDispatcher);
  11430. c.DropDownController = e
  11431. })(egret || (egret = {}));
  11432. __extends = this.__extends || function(c, e) {
  11433. function d() {
  11434. this.constructor = c
  11435. }
  11436. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11437. d.prototype = e.prototype;
  11438. c.prototype = new d
  11439. };
  11440. (function(c) {
  11441. var e = function(d) {
  11442. function a() {
  11443. d.call(this);
  11444. this._labelChanged = !1;
  11445. this._userProposedSelectedIndex = c.ListBase.NO_SELECTION;
  11446. this._captureItemRenderer = !1;
  11447. this.dropDownController = new c.DropDownController
  11448. }
  11449. __extends(a, d);
  11450. a.prototype._setDataProvider = function(b) {
  11451. this.dataProvider !== b && (d.prototype._setDataProvider.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11452. };
  11453. a.prototype._setLabelField = function(b) {
  11454. this.labelField != b && (d.prototype._setLabelField.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11455. };
  11456. a.prototype._setLabelFunction = function(b) {
  11457. this.labelFunction != b && (d.prototype._setLabelFunction.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11458. };
  11459. Object.defineProperty(a.prototype, "dropDownController", {
  11460. get: function() {
  11461. return this._dropDownController
  11462. },
  11463. set: function(b) {
  11464. this._dropDownController != b && (this._dropDownController = b, this._dropDownController.addEventListener(c.UIEvent.OPEN, this._dropDownController_openHandler, this), this._dropDownController.addEventListener(c.UIEvent.CLOSE,
  11465. this.dropDownController_closeHandler, this), this.openButton && (this._dropDownController.openButton = this.openButton), this.dropDown && (this._dropDownController.dropDown = this.dropDown))
  11466. },
  11467. enumerable: !0,
  11468. configurable: !0
  11469. });
  11470. Object.defineProperty(a.prototype, "isDropDownOpen", {
  11471. get: function() {
  11472. return this.dropDownController ? this.dropDownController.isOpen : !1
  11473. },
  11474. enumerable: !0,
  11475. configurable: !0
  11476. });
  11477. a.prototype.commitProperties = function() {
  11478. d.prototype.commitProperties.call(this);
  11479. this._labelChanged && (this._labelChanged = !1,
  11480. this.updateLabelDisplay())
  11481. };
  11482. a.prototype.partAdded = function(b, a) {
  11483. d.prototype.partAdded.call(this, b, a);
  11484. a == this.openButton ? this.dropDownController && (this.dropDownController.openButton = this.openButton) : a == this.dropDown && this.dropDownController && (this.dropDownController.dropDown = this.dropDown)
  11485. };
  11486. a.prototype.partRemoved = function(b, a) {
  11487. this.dropDownController && (a == this.openButton && (this.dropDownController.openButton = null), a == this.dropDown && (this.dropDownController.dropDown = null));
  11488. d.prototype.partRemoved.call(this,
  11489. b, a)
  11490. };
  11491. a.prototype.getCurrentSkinState = function() {
  11492. return this.enabled ? this.isDropDownOpen ? "open" : "normal" : "disabled"
  11493. };
  11494. a.prototype.commitSelection = function(b) {
  11495. "undefined" === typeof b && (b = !0);
  11496. b = d.prototype.commitSelection.call(this, b);
  11497. this.updateLabelDisplay();
  11498. return b
  11499. };
  11500. a.prototype._isItemIndexSelected = function(b) {
  11501. return this._userProposedSelectedIndex == b
  11502. };
  11503. a.prototype.openDropDown = function() {
  11504. this.dropDownController.openDropDown()
  11505. };
  11506. a.prototype.closeDropDown = function(b) {
  11507. this.dropDownController.closeDropDown(b)
  11508. };
  11509. a.prototype.updateLabelDisplay = function(b) {};
  11510. a.prototype._changeHighlightedSelection = function(b, a) {
  11511. this.itemSelected(this._userProposedSelectedIndex, !1);
  11512. this._userProposedSelectedIndex = b;
  11513. this.itemSelected(this._userProposedSelectedIndex, !0)
  11514. };
  11515. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  11516. d.prototype.dataProvider_collectionChangeHandler.call(this, b);
  11517. this._labelChanged = !0;
  11518. this.invalidateProperties()
  11519. };
  11520. a.prototype.item_mouseDownHandler = function(b) {
  11521. d.prototype.item_mouseDownHandler.call(this,
  11522. b);
  11523. this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, b.currentTarget);
  11524. this._userProposedSelectedIndex = this.selectedIndex;
  11525. this.closeDropDown(!0)
  11526. };
  11527. a.prototype._dropDownController_openHandler = function(b) {
  11528. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this._open_updateCompleteHandler, this);
  11529. this._userProposedSelectedIndex = this.selectedIndex;
  11530. this.invalidateSkinState()
  11531. };
  11532. a.prototype._open_updateCompleteHandler = function(b) {
  11533. this.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this._open_updateCompleteHandler,
  11534. this);
  11535. c.UIEvent.dispatchUIEvent(this, c.UIEvent.OPEN)
  11536. };
  11537. a.prototype.dropDownController_closeHandler = function(b) {
  11538. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.close_updateCompleteHandler, this);
  11539. this.invalidateSkinState();
  11540. b.isDefaultPrevented() ? this._changeHighlightedSelection(this.selectedIndex) : this._setSelectedIndex(this._userProposedSelectedIndex, !0)
  11541. };
  11542. a.prototype.close_updateCompleteHandler = function(b) {
  11543. this.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.close_updateCompleteHandler, this);
  11544. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CLOSE)
  11545. };
  11546. a.PAGE_SIZE = 5;
  11547. return a
  11548. }(c.List);
  11549. c.DropDownListBase = e
  11550. })(egret || (egret = {}));
  11551. __extends = this.__extends || function(c, e) {
  11552. function d() {
  11553. this.constructor = c
  11554. }
  11555. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11556. d.prototype = e.prototype;
  11557. c.prototype = new d
  11558. };
  11559. (function(c) {
  11560. var e = function(d) {
  11561. function a() {
  11562. d.call(this);
  11563. this.iconFieldOrFunctionChanged = !1;
  11564. this.hostComponentKey = "egret.Tree"
  11565. }
  11566. __extends(a, d);
  11567. a.prototype.createChildren = function() {
  11568. this.itemRenderer || (this.itemRenderer = a.defaultTreeRendererFactory);
  11569. d.prototype.createChildren.call(this)
  11570. };
  11571. a.prototype.updateRenderer = function(b, a, c) {
  11572. if ("hasChildren" in b && "hasChildren" in this.dataProvider) {
  11573. var e = this.dataProvider;
  11574. b.hasChildren = e.hasChildren(c);
  11575. b.opened = e.isItemOpen(c);
  11576. b.depth = e.getDepth(c);
  11577. b.iconSkinName =
  11578. this.itemToIcon(c)
  11579. }
  11580. return d.prototype.updateRenderer.call(this, b, a, c)
  11581. };
  11582. a.prototype.itemToIcon = function(b) {
  11583. if (!b) return null;
  11584. if (null != this._iconFunction) return this._iconFunction(b);
  11585. var a;
  11586. if (b instanceof Object) try {
  11587. b[this.iconField] && (a = b[this.iconField])
  11588. } catch (c) {}
  11589. return a
  11590. };
  11591. a.prototype.dataGroup_rendererAddHandler = function(b) {
  11592. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  11593. b.renderer && "hasChildren" in b.renderer && b.renderer.addEventListener(c.TreeEvent.ITEM_OPENING, this.onItemOpening, this)
  11594. };
  11595. a.prototype.onItemOpening = function(b) {
  11596. var a = b.itemRenderer,
  11597. d = b.item,
  11598. e = this._getDataProvider();
  11599. 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))
  11600. };
  11601. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  11602. d.prototype.dataGroup_rendererRemoveHandler.call(this, b);
  11603. b.renderer && "hasChildren" in b.renderer && b.renderer.removeEventListener(c.TreeEvent.ITEM_OPENING, this.onItemOpening,
  11604. this)
  11605. };
  11606. Object.defineProperty(a.prototype, "iconField", {
  11607. get: function() {
  11608. return this._iconField
  11609. },
  11610. set: function(b) {
  11611. this._iconField != b && (this._iconField = b, this.iconFieldOrFunctionChanged = !0, this.invalidateProperties())
  11612. },
  11613. enumerable: !0,
  11614. configurable: !0
  11615. });
  11616. Object.defineProperty(a.prototype, "iconFunction", {
  11617. get: function() {
  11618. return this._iconFunction
  11619. },
  11620. set: function(b) {
  11621. this._iconFunction != b && (this._iconFunction = b, this.iconFieldOrFunctionChanged = !0, this.invalidateProperties())
  11622. },
  11623. enumerable: !0,
  11624. configurable: !0
  11625. });
  11626. a.prototype.expandItem =
  11627. function(b, a) {
  11628. "undefined" === typeof a && (a = !0);
  11629. var c = this._getDataProvider();
  11630. c && "hasChildren" in c && c.expandItem(b, a)
  11631. };
  11632. a.prototype.isItemOpen = function(b) {
  11633. var a = this._getDataProvider();
  11634. return a && "hasChildren" in a ? a.isItemOpen(b) : !1
  11635. };
  11636. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  11637. d.prototype.dataProvider_collectionChangeHandler.call(this, b);
  11638. if (b.kind == c.CollectionEventKind.OPEN || b.kind == c.CollectionEventKind.CLOSE) {
  11639. var a = this.dataGroup ? this.dataGroup.getElementAt(b.location) : null;
  11640. a && (this.updateRenderer(a,
  11641. b.location, b.items[0]), b.kind == c.CollectionEventKind.CLOSE && this.layout && this.layout.useVirtualLayout && (this.layout.clearVirtualLayoutCache(), this.invalidateSize()))
  11642. }
  11643. };
  11644. a.prototype.commitProperties = function() {
  11645. d.prototype.commitProperties.call(this);
  11646. if (this.iconFieldOrFunctionChanged) {
  11647. if (null != this.dataGroup) {
  11648. var b;
  11649. if (this.layout && this.layout.useVirtualLayout)
  11650. for (var a = this.dataGroup.getElementIndicesInView(), c = a.length, e = 0; e < c; e++) b = a[e], this.updateRendererIconProperty(b);
  11651. else
  11652. for (a = this.dataGroup.numElements,
  11653. b = 0; b < a; b++) this.updateRendererIconProperty(b)
  11654. }
  11655. this.iconFieldOrFunctionChanged = !1
  11656. }
  11657. };
  11658. a.prototype.updateRendererIconProperty = function(b) {
  11659. if (b = this.dataGroup.getElementAt(b)) b.iconSkinName = this.itemToIcon(b.data)
  11660. };
  11661. a.defaultTreeRendererFactory = new c.ClassFactory(c.TreeItemRenderer);
  11662. return a
  11663. }(c.List);
  11664. c.Tree = e
  11665. })(egret || (egret = {}));
  11666. __extends = this.__extends || function(c, e) {
  11667. function d() {
  11668. this.constructor = c
  11669. }
  11670. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11671. d.prototype = e.prototype;
  11672. c.prototype = new d
  11673. };
  11674. (function(c) {
  11675. var e = function(c) {
  11676. function a() {
  11677. c.call(this);
  11678. this._prompt = "";
  11679. this.hostComponentKey = "egret.DropDownList"
  11680. }
  11681. __extends(a, c);
  11682. Object.defineProperty(a.prototype, "prompt", {
  11683. get: function() {
  11684. return this._prompt
  11685. },
  11686. set: function(b) {
  11687. this._prompt != b && (this._prompt = b, this._labelChanged = !0, this.invalidateProperties())
  11688. },
  11689. enumerable: !0,
  11690. configurable: !0
  11691. });
  11692. a.prototype.partAdded = function(b, a) {
  11693. c.prototype.partAdded.call(this, b, a);
  11694. a == this.labelDisplay && (this._labelChanged = !0, this.invalidateProperties())
  11695. };
  11696. a.prototype.updateLabelDisplay =
  11697. function(b) {
  11698. "undefined" === typeof b && (b = void 0);
  11699. this.labelDisplay && (void 0 == b && (b = this.selectedItem), this.labelDisplay.text = null != b && void 0 != b ? this.itemToLabel(b) : this._prompt)
  11700. };
  11701. return a
  11702. }(c.DropDownListBase);
  11703. c.DropDownList = e
  11704. })(egret || (egret = {}));
  11705. __extends = this.__extends || function(c, e) {
  11706. function d() {
  11707. this.constructor = c
  11708. }
  11709. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11710. d.prototype = e.prototype;
  11711. c.prototype = new d
  11712. };
  11713. (function(c) {
  11714. var e = function(c) {
  11715. function a() {
  11716. c.call(this);
  11717. this._allowDeselection = !0;
  11718. this.hostComponentKey = "egret.TabBarButton"
  11719. }
  11720. __extends(a, c);
  11721. Object.defineProperty(a.prototype, "allowDeselection", {
  11722. get: function() {
  11723. return this._allowDeselection
  11724. },
  11725. set: function(b) {
  11726. this._allowDeselection = b
  11727. },
  11728. enumerable: !0,
  11729. configurable: !0
  11730. });
  11731. Object.defineProperty(a.prototype, "data", {
  11732. get: function() {
  11733. return this._data
  11734. },
  11735. set: function(b) {
  11736. this._data = b;
  11737. this.dispatchEventWith("dataChange")
  11738. },
  11739. enumerable: !0,
  11740. configurable: !0
  11741. });
  11742. Object.defineProperty(a.prototype,
  11743. "itemIndex", {
  11744. get: function() {
  11745. return this._itemIndex
  11746. },
  11747. set: function(b) {
  11748. this._itemIndex = b
  11749. },
  11750. enumerable: !0,
  11751. configurable: !0
  11752. });
  11753. a.prototype._setLabel = function(b) {
  11754. b != this._getLabel() && (c.prototype._setLabel.call(this, b), this.labelDisplay && (this.labelDisplay.text = this._getLabel()))
  11755. };
  11756. a.prototype.buttonReleased = function() {
  11757. this.selected && !this.allowDeselection || c.prototype.buttonReleased.call(this)
  11758. };
  11759. return a
  11760. }(c.ToggleButtonBase);
  11761. c.TabBarButton = e
  11762. })(egret || (egret = {}));
  11763. __extends = this.__extends || function(c, e) {
  11764. function d() {
  11765. this.constructor = c
  11766. }
  11767. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11768. d.prototype = e.prototype;
  11769. c.prototype = new d
  11770. };
  11771. (function(c) {
  11772. var e = function(d) {
  11773. function a() {
  11774. d.call(this);
  11775. this.hostComponentKey = "egret.TabBar";
  11776. this.requireSelection = !0
  11777. }
  11778. __extends(a, d);
  11779. a.prototype.c = function(b) {
  11780. b != this._requireSelection && (d.prototype._setRequireSelection.call(this, b), this.requireSelectionChanged_tabBar = !0, this.invalidateProperties())
  11781. };
  11782. a.prototype._setDataProvider = function(b) {
  11783. this.dataProvider instanceof c.ViewStack && (this.dataProvider.removeEventListener("IndexChanged", this.onViewStackIndexChange, this), this.removeEventListener(c.IndexChangeEvent.CHANGE,
  11784. this.onIndexChanged, this));
  11785. b instanceof c.ViewStack && (b.addEventListener("IndexChanged", this.onViewStackIndexChange, this), this.addEventListener(c.IndexChangeEvent.CHANGE, this.onIndexChanged, this));
  11786. d.prototype._setDataProvider.call(this, b)
  11787. };
  11788. a.prototype.onIndexChanged = function(b) {
  11789. this.dataProvider._setSelectedIndex(b.newIndex, !1)
  11790. };
  11791. a.prototype.onViewStackIndexChange = function(b) {
  11792. this._setSelectedIndex(this.dataProvider.selectedIndex, !1)
  11793. };
  11794. a.prototype.commitProperties = function() {
  11795. d.prototype.commitProperties.call(this);
  11796. if (this.requireSelectionChanged_tabBar && this.dataGroup) {
  11797. this.requireSelectionChanged_tabBar = !1;
  11798. for (var b = this.dataGroup.numElements, a = 0; a < b; a++) {
  11799. var c = this.dataGroup.getElementAt(a);
  11800. c && (c.allowDeselection = !this.requireSelection)
  11801. }
  11802. }
  11803. };
  11804. a.prototype.dataGroup_rendererAddHandler = function(b) {
  11805. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  11806. if (b = b.renderer) b.addEventListener(c.TouchEvent.TOUCH_TAP, this.item_clickHandler, this), b instanceof c.TabBarButton && (b.allowDeselection = !this.requireSelection)
  11807. };
  11808. a.prototype.dataGroup_rendererRemoveHandler =
  11809. function(b) {
  11810. d.prototype.dataGroup_rendererRemoveHandler.call(this, b);
  11811. (b = b.renderer) && b.removeEventListener(c.TouchEvent.TOUCH_TAP, this.item_clickHandler, this)
  11812. };
  11813. a.prototype.item_clickHandler = function(b) {
  11814. var a = b.currentTarget,
  11815. d;
  11816. d = a ? a.itemIndex : this.dataGroup.getElementIndex(b.currentTarget);
  11817. d == this.selectedIndex ? this.requireSelection || this._setSelectedIndex(c.ListBase.NO_SELECTION, !0) : this._setSelectedIndex(d, !0);
  11818. this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, a)
  11819. };
  11820. return a
  11821. }(c.ListBase);
  11822. c.TabBar = e
  11823. })(egret ||
  11824. (egret = {}));
  11825. __extends = this.__extends || function(c, e) {
  11826. function d() {
  11827. this.constructor = c
  11828. }
  11829. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11830. d.prototype = e.prototype;
  11831. c.prototype = new d
  11832. };
  11833. (function(c) {
  11834. var e = function(d) {
  11835. function a() {
  11836. d.call(this);
  11837. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  11838. this.ignoreTouchBegin = !1;
  11839. this._velocityY = this._velocityX = 0;
  11840. this._previousVelocityX = [];
  11841. this._previousVelocityY = []
  11842. }
  11843. __extends(a, d);
  11844. a.prototype.measure = function() {
  11845. this._viewport && (this.measuredWidth = this._viewport.preferredWidth, this.measuredHeight = this._viewport.preferredHeight)
  11846. };
  11847. a.prototype.updateDisplayList = function(b, a) {
  11848. this._viewport.setLayoutBoundsSize(b, a)
  11849. };
  11850. Object.defineProperty(a.prototype,
  11851. "verticalScrollPolicy", {
  11852. get: function() {
  11853. return this._verticalScrollPolicy
  11854. },
  11855. set: function(b) {
  11856. this._verticalScrollPolicy = b
  11857. },
  11858. enumerable: !0,
  11859. configurable: !0
  11860. });
  11861. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  11862. get: function() {
  11863. return this._horizontalScrollPolicy
  11864. },
  11865. set: function(b) {
  11866. this._horizontalScrollPolicy = b
  11867. },
  11868. enumerable: !0,
  11869. configurable: !0
  11870. });
  11871. Object.defineProperty(a.prototype, "viewport", {
  11872. get: function() {
  11873. return this._viewport
  11874. },
  11875. set: function(b) {
  11876. b != this._viewport && (this.uninstallViewport(), this._viewport =
  11877. b, this.installViewport(), this.dispatchEventWith("viewportChanged"))
  11878. },
  11879. enumerable: !0,
  11880. configurable: !0
  11881. });
  11882. a.prototype.installViewport = function() {
  11883. 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))
  11884. };
  11885. a.prototype.uninstallViewport =
  11886. function() {
  11887. 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))
  11888. };
  11889. a.prototype.onTouchEndCapture = function(b) {
  11890. this.delayTouchBeginEvent && (b.stopPropagation(), this.delayTouchEndEvent = this.cloneTouchEvent(b),
  11891. this.onTouchBeginTimer(), this.touchEndTimer || (this.touchEndTimer = new c.Timer(100, 1), this.touchEndTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this.onTouchEndTimer, this)), this.touchEndTimer.start())
  11892. };
  11893. a.prototype.onTouchEndTimer = function(b) {
  11894. this.touchEndTimer.stop();
  11895. b = this.delayTouchEndEvent;
  11896. this.delayTouchEndEvent = null;
  11897. this.dispatchPropagationEvent(b)
  11898. };
  11899. a.prototype.dispatchPropagationEvent = function(b) {
  11900. for (var a = [], c = b._target; c;) a.push(c), c = c.parent;
  11901. for (var d = this._viewport, e = 1;; e += 2) {
  11902. c = a[e];
  11903. if (!c || c === d) break;
  11904. a.unshift(c)
  11905. }
  11906. c = a.indexOf(b._target);
  11907. this._dispatchPropagationEvent(b, a, c)
  11908. };
  11909. a.prototype.onTouchBeginCapture = function(b) {
  11910. var d = this.checkScrollPolicy();
  11911. if (d) {
  11912. for (var e = b.target; e != this;) {
  11913. if (e instanceof a && (d = e.checkScrollPolicy())) return;
  11914. e = e.parent
  11915. }
  11916. this.delayTouchEndEvent && (this.delayTouchEndEvent = null, this.touchEndTimer.stop());
  11917. b.stopPropagation();
  11918. this.delayTouchBeginEvent = this.cloneTouchEvent(b);
  11919. this.touchBeginTimer || (this.touchBeginTimer = new c.Timer(100, 1), this.touchBeginTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE,
  11920. this.onTouchBeginTimer, this));
  11921. this.touchBeginTimer.start();
  11922. this.onTouchBegin(b)
  11923. }
  11924. };
  11925. a.prototype.cloneTouchEvent = function(b) {
  11926. var a = new c.TouchEvent(b._type, b._bubbles, b.cancelable);
  11927. a.touchPointID = b.touchPointID;
  11928. a._stageX = b._stageX;
  11929. a._stageY = b._stageY;
  11930. a.ctrlKey = b.ctrlKey;
  11931. a.altKey = b.altKey;
  11932. a.shiftKey = b.shiftKey;
  11933. a.touchDown = b.touchDown;
  11934. a._isDefaultPrevented = !1;
  11935. a._target = b._target;
  11936. return a
  11937. };
  11938. a.prototype.onTouchBeginTimer = function(b) {
  11939. this.touchBeginTimer.stop();
  11940. b = this.delayTouchBeginEvent;
  11941. this.delayTouchBeginEvent =
  11942. null;
  11943. this.dispatchPropagationEvent(b)
  11944. };
  11945. a.prototype.checkScrollPolicy = function() {
  11946. var b = this._viewport,
  11947. a;
  11948. switch (this._horizontalScrollPolicy) {
  11949. case "auto":
  11950. a = b.contentWidth > b.width ? !0 : !1;
  11951. break;
  11952. case "on":
  11953. a = !0;
  11954. break;
  11955. case "off":
  11956. a = !1
  11957. }
  11958. this._horizontalCanScroll = a;
  11959. var c;
  11960. switch (this._verticalScrollPolicy) {
  11961. case "auto":
  11962. c = b.contentHeight > b.height ? !0 : !1;
  11963. break;
  11964. case "on":
  11965. c = !0;
  11966. break;
  11967. case "off":
  11968. c = !1
  11969. }
  11970. this._verticalCanScroll = c;
  11971. return a || c
  11972. };
  11973. a.prototype.onTouchBegin = function(b) {
  11974. if (!b.isDefaultPrevented() && this.checkScrollPolicy()) {
  11975. this.verticalAnimator &&
  11976. this.verticalAnimator.isPlaying && this.verticalAnimator.stop();
  11977. this.horizontalAnimator && this.horizontalAnimator.isPlaying && this.horizontalAnimator.stop();
  11978. var a = this._viewport,
  11979. d = a.horizontalScrollPosition,
  11980. a = a.verticalScrollPosition;
  11981. this._offsetPointX = d + b.stageX;
  11982. this._offsetPointY = a + b.stageY;
  11983. this._velocityY = this._velocityX = 0;
  11984. this._previousVelocityX.length = 0;
  11985. this._previousVelocityY.length = 0;
  11986. this._previousTouchTime = c.getTimer();
  11987. this._previousTouchX = this._startTouchX = this._currentTouchX = b.stageX;
  11988. this._previousTouchY =
  11989. this._startTouchY = this._currentTouchY = b.stageY;
  11990. this._startHorizontalScrollPosition = d;
  11991. this._startVerticalScrollPosition = a;
  11992. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  11993. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  11994. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.onTouchEnd, this);
  11995. this.addEventListener(c.Event.ENTER_FRAME, this.enterFrameHandler, this);
  11996. b.preventDefault()
  11997. }
  11998. };
  11999. a.prototype.onTouchMove = function(b) {
  12000. this._currentTouchX =
  12001. b.stageX;
  12002. this._currentTouchY = b.stageY;
  12003. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  12004. var a = this._viewport;
  12005. if (this._horizontalCanScroll) {
  12006. var c = this._offsetPointX - b.stageX;
  12007. 0 > c && (c *= 0.5);
  12008. c > a.contentWidth - a.width && (c = 0.5 * (c + a.contentWidth - a.width));
  12009. a.horizontalScrollPosition = c
  12010. }
  12011. 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)
  12012. };
  12013. a.prototype.onTouchEnd =
  12014. function(b) {
  12015. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  12016. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  12017. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.onTouchEnd, this);
  12018. this.removeEventListener(c.Event.ENTER_FRAME, this.enterFrameHandler, this);
  12019. this._horizontalCanScroll && this.checkHorizontalScrollPosition();
  12020. this._verticalCanScroll && this.checkVerticalScrollPosition()
  12021. };
  12022. a.easeOut = function(b) {
  12023. b -= 1;
  12024. return b * b * b + 1
  12025. };
  12026. a.prototype.enterFrameHandler = function(b) {
  12027. b = c.getTimer();
  12028. var a = b - this._previousTouchTime;
  12029. 0 < a && (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) / a, this._velocityY = (this._currentTouchY - this._previousTouchY) / a, this._previousTouchTime =
  12030. b, this._previousTouchX = this._currentTouchX, this._previousTouchY = this._currentTouchY);
  12031. b = Math.abs(this._currentTouchX - this._startTouchX);
  12032. a = Math.abs(this._currentTouchY - this._startTouchY);
  12033. this._horizontalCanScroll && 0.04 <= b && (this._startTouchX = this._currentTouchX, this._startHorizontalScrollPosition = this._viewport.horizontalScrollPosition);
  12034. this._verticalCanScroll && 0.04 <= a && (this._startTouchY = this._currentTouchY, this._startVerticalScrollPosition = this._viewport.verticalScrollPosition)
  12035. };
  12036. a.prototype.checkHorizontalScrollPosition =
  12037. function() {
  12038. for (var b = this._viewport, c = b.horizontalScrollPosition, b = b.contentWidth - b.width, b = Math.max(0, b), d = 2.33 * this._velocityX, e = this._previousVelocityX.length, f = 2.33, h = 0; h < e; h++) var k = a.VELOCITY_WEIGHTS[h],
  12039. d = d + this._previousVelocityX.shift() * k,
  12040. f = f + k;
  12041. d /= f;
  12042. 0.02 >= Math.abs(d) ? this.finishScrollingHorizontally() : (c = this.getAnimationDatas(d, c, b), this.throwHorizontally(c[0], c[1]))
  12043. };
  12044. a.prototype.checkVerticalScrollPosition = function() {
  12045. for (var b = this._viewport, c = b.verticalScrollPosition, b = b.contentHeight -
  12046. b.height, d = 2.33 * this._velocityY, e = this._previousVelocityY.length, f = 2.33, h = 0; h < e; h++) var k = a.VELOCITY_WEIGHTS[h],
  12047. d = d + this._previousVelocityY.shift() * k,
  12048. f = f + k;
  12049. d /= f;
  12050. 0.02 >= Math.abs(d) ? this.finishScrollingVertically() : (c = this.getAnimationDatas(d, c, b), this.throwVertically(c[0], c[1]))
  12051. };
  12052. a.prototype.getAnimationDatas = function(b, c, d) {
  12053. var e = Math.abs(b),
  12054. f = 0,
  12055. h = c + (b - 0.02) / Math.log(0.998);
  12056. if (0 > h || h > d)
  12057. for (h = c; 0.02 < Math.abs(b);) h -= b, b = 0 > h || h > d ? 0.998 * b * 0.95 : 0.998 * b, f++;
  12058. else f = Math.log(0.02 / e) / Math.log(0.998);
  12059. a.animationData ||
  12060. (a.animationData = [0, 0]);
  12061. b = a.animationData;
  12062. b[0] = h;
  12063. b[1] = f;
  12064. return b
  12065. };
  12066. a.prototype.finishScrollingHorizontally = function(b) {
  12067. var a = this._viewport;
  12068. b = a.horizontalScrollPosition;
  12069. var a = a.contentWidth - a.width,
  12070. c = b;
  12071. 0 > b && (c = 0);
  12072. b > a && (c = a);
  12073. this.throwHorizontally(c, 300)
  12074. };
  12075. a.prototype.throwHorizontally = function(b, d) {
  12076. "undefined" === typeof d && (d = 500);
  12077. var e = this._viewport.horizontalScrollPosition;
  12078. e != b && (this.horizontalAnimator || (this.horizontalAnimator = new c.Animation(this.horizontalUpdateHandler, this), this.horizontalAnimator.endFunction =
  12079. this.finishScrollingHorizontally, this.horizontalAnimator.easerFunction = a.easeOut), this.horizontalAnimator.isPlaying && this.horizontalAnimator.stop(), this.horizontalAnimator.duration = d, this.horizontalAnimator.motionPaths = [{
  12080. prop: "hsp",
  12081. from: e,
  12082. to: b
  12083. }], this.horizontalAnimator.play())
  12084. };
  12085. a.prototype.horizontalUpdateHandler = function(b) {
  12086. this._viewport.horizontalScrollPosition = b.currentValue.hsp
  12087. };
  12088. a.prototype.finishScrollingVertically = function(b) {
  12089. var a = this._viewport;
  12090. b = a.verticalScrollPosition;
  12091. var a = a.contentHeight -
  12092. a.height,
  12093. a = Math.max(0, a),
  12094. c = b;
  12095. 0 > b && (c = 0);
  12096. b > a && (c = a);
  12097. this.throwVertically(c, 300)
  12098. };
  12099. a.prototype.throwVertically = function(b, d) {
  12100. "undefined" === typeof d && (d = 500);
  12101. var e = this._viewport.verticalScrollPosition;
  12102. 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 =
  12103. d, this.verticalAnimator.motionPaths = [{
  12104. prop: "vsp",
  12105. from: e,
  12106. to: b
  12107. }], this.verticalAnimator.play())
  12108. };
  12109. a.prototype.verticalUpdateHandler = function(b) {
  12110. this._viewport.verticalScrollPosition = b.currentValue.vsp
  12111. };
  12112. Object.defineProperty(a.prototype, "numElements", {
  12113. get: function() {
  12114. return this.viewport ? 1 : 0
  12115. },
  12116. enumerable: !0,
  12117. configurable: !0
  12118. });
  12119. a.prototype.throwRangeError = function(b) {
  12120. throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  12121. };
  12122. a.prototype.getElementAt = function(b) {
  12123. if (this.viewport &&
  12124. 0 == b) return this.viewport;
  12125. this.throwRangeError(b);
  12126. return null
  12127. };
  12128. a.prototype.getElementIndex = function(b) {
  12129. return null != b && b == this.viewport ? 0 : -1
  12130. };
  12131. a.prototype.containsElement = function(b) {
  12132. return null != b && b == this.viewport ? !0 : !1
  12133. };
  12134. a.prototype.throwNotSupportedError = function() {
  12135. throw Error("\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!");
  12136. };
  12137. a.prototype.addElement = function(b) {
  12138. this.throwNotSupportedError();
  12139. return null
  12140. };
  12141. a.prototype.addElementAt = function(b, a) {
  12142. this.throwNotSupportedError();
  12143. return null
  12144. };
  12145. a.prototype.removeElement = function(b) {
  12146. this.throwNotSupportedError();
  12147. return null
  12148. };
  12149. a.prototype.removeElementAt = function(b) {
  12150. this.throwNotSupportedError();
  12151. return null
  12152. };
  12153. a.prototype.removeAllElements = function() {
  12154. this.throwNotSupportedError()
  12155. };
  12156. a.prototype.setElementIndex = function(b, a) {
  12157. this.throwNotSupportedError()
  12158. };
  12159. a.prototype.swapElements = function(b, a) {
  12160. this.throwNotSupportedError()
  12161. };
  12162. a.prototype.swapElementsAt = function(b, a) {
  12163. this.throwNotSupportedError()
  12164. };
  12165. a.prototype.addChild = function(b) {
  12166. this.throwNotSupportedError();
  12167. return null
  12168. };
  12169. a.prototype.addChildAt = function(b, a) {
  12170. this.throwNotSupportedError();
  12171. return null
  12172. };
  12173. a.prototype.removeChild = function(b) {
  12174. this.throwNotSupportedError();
  12175. return null
  12176. };
  12177. a.prototype.removeChildAt = function(b) {
  12178. this.throwNotSupportedError();
  12179. return null
  12180. };
  12181. a.prototype.setChildIndex = function(b, a) {
  12182. this.throwNotSupportedError()
  12183. };
  12184. a.prototype.swapChildren = function(b, a) {
  12185. this.throwNotSupportedError()
  12186. };
  12187. a.prototype.swapChildrenAt = function(b, a) {
  12188. this.throwNotSupportedError()
  12189. };
  12190. a.VELOCITY_WEIGHTS = [1, 1.33, 1.66, 2];
  12191. return a
  12192. }(c.UIComponent);
  12193. c.Scroller = e
  12194. })(egret || (egret = {}));
  12195. __extends = this.__extends || function(c, e) {
  12196. function d() {
  12197. this.constructor = c
  12198. }
  12199. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12200. d.prototype = e.prototype;
  12201. c.prototype = new d
  12202. };
  12203. (function(c) {
  12204. var e = function(d) {
  12205. function a(b, a, c) {
  12206. "undefined" === typeof a && (a = !1);
  12207. "undefined" === typeof c && (c = !1);
  12208. d.call(this, b, a, c)
  12209. }
  12210. __extends(a, d);
  12211. a.dispatchUIEvent = function(b, d) {
  12212. c.Event._dispatchByTarget(a, b, d)
  12213. };
  12214. a.INITIALIZE = "initialize";
  12215. a.CREATION_COMPLETE = "creationComplete";
  12216. a.UPDATE_COMPLETE = "updateComplete";
  12217. a.BUTTON_DOWN = "buttonDown";
  12218. a.CHANGE_END = "changeEnd";
  12219. a.CHANGE_START = "changeStart";
  12220. a.CHANGING = "changing";
  12221. a.VALUE_COMMIT = "valueCommit";
  12222. a.SKIN_CHANGED = "skinChanged";
  12223. a.CONTENT_CHANGED = "contentChanged";
  12224. a.OPEN = "open";
  12225. a.CLOSE = "close";
  12226. a.PLAY_COMPLETE = "playComplete";
  12227. return a
  12228. }(c.Event);
  12229. c.UIEvent = e
  12230. })(egret || (egret = {}));
  12231. __extends = this.__extends || function(c, e) {
  12232. function d() {
  12233. this.constructor = c
  12234. }
  12235. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12236. d.prototype = e.prototype;
  12237. c.prototype = new d
  12238. };
  12239. (function(c) {
  12240. var e = function(d) {
  12241. function a(b, a, c, e, f, h, k, n) {
  12242. "undefined" === typeof a && (a = !1);
  12243. "undefined" === typeof c && (c = !1);
  12244. "undefined" === typeof e && (e = null);
  12245. "undefined" === typeof f && (f = null);
  12246. "undefined" === typeof h && (h = null);
  12247. "undefined" === typeof k && (k = null);
  12248. "undefined" === typeof n && (n = null);
  12249. d.call(this, b, a, c);
  12250. this.kind = e;
  12251. this.property = f;
  12252. this.oldValue = h;
  12253. this.newValue = k;
  12254. this.source = n
  12255. }
  12256. __extends(a, d);
  12257. a.dispatchPropertyChangeEvent = function(b, d, e, m, f, h) {
  12258. "undefined" === typeof d && (d = null);
  12259. "undefined" === typeof e &&
  12260. (e = null);
  12261. "undefined" === typeof m && (m = null);
  12262. "undefined" === typeof f && (f = null);
  12263. "undefined" === typeof h && (h = null);
  12264. var k = c.Event._getPropertyData(a);
  12265. k.kind = d;
  12266. k.property = e;
  12267. k.oldValue = m;
  12268. k.newValue = f;
  12269. k.source = h;
  12270. c.Event._dispatchByTarget(a, b, a.PROPERTY_CHANGE, k)
  12271. };
  12272. a.PROPERTY_CHANGE = "propertyChange";
  12273. return a
  12274. }(c.Event);
  12275. c.PropertyChangeEvent = e
  12276. })(egret || (egret = {}));
  12277. (function(c) {
  12278. var e = function() {
  12279. function c() {}
  12280. c.UPDATE = "update";
  12281. c.DELETE = "delete";
  12282. return c
  12283. }();
  12284. c.PropertyChangeEventKind = e
  12285. })(egret || (egret = {}));
  12286. __extends = this.__extends || function(c, e) {
  12287. function d() {
  12288. this.constructor = c
  12289. }
  12290. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12291. d.prototype = e.prototype;
  12292. c.prototype = new d
  12293. };
  12294. (function(c) {
  12295. var e = function(d) {
  12296. function a(b, a, c, e, f) {
  12297. "undefined" === typeof a && (a = NaN);
  12298. "undefined" === typeof c && (c = NaN);
  12299. "undefined" === typeof e && (e = !1);
  12300. "undefined" === typeof f && (f = !1);
  12301. d.call(this, b, e, f);
  12302. this.oldX = a;
  12303. this.oldY = c
  12304. }
  12305. __extends(a, d);
  12306. a.dispatchMoveEvent = function(b, d, e) {
  12307. "undefined" === typeof d && (d = NaN);
  12308. "undefined" === typeof e && (e = NaN);
  12309. var m = c.Event._getPropertyData(a);
  12310. m.oldX = d;
  12311. m.oldY = e;
  12312. c.Event._dispatchByTarget(a, b, a.MOVE, m)
  12313. };
  12314. a.MOVE = "move";
  12315. return a
  12316. }(c.Event);
  12317. c.MoveEvent = e
  12318. })(egret || (egret = {}));
  12319. __extends = this.__extends || function(c, e) {
  12320. function d() {
  12321. this.constructor = c
  12322. }
  12323. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12324. d.prototype = e.prototype;
  12325. c.prototype = new d
  12326. };
  12327. (function(c) {
  12328. var e = function(d) {
  12329. function a(b, a, c, e, f) {
  12330. "undefined" === typeof a && (a = NaN);
  12331. "undefined" === typeof c && (c = NaN);
  12332. "undefined" === typeof e && (e = !1);
  12333. "undefined" === typeof f && (f = !1);
  12334. d.call(this, b, e, f);
  12335. this.oldWidth = a;
  12336. this.oldHeight = c
  12337. }
  12338. __extends(a, d);
  12339. a.dispatchResizeEvent = function(b, d, e) {
  12340. "undefined" === typeof d && (d = NaN);
  12341. "undefined" === typeof e && (e = NaN);
  12342. var m = c.Event._getPropertyData(a);
  12343. m.oldWidth = d;
  12344. m.oldHeight = e;
  12345. c.Event._dispatchByTarget(a, b, a.RESIZE, m)
  12346. };
  12347. a.RESIZE = "resize";
  12348. return a
  12349. }(c.Event);
  12350. c.ResizeEvent =
  12351. e
  12352. })(egret || (egret = {}));
  12353. __extends = this.__extends || function(c, e) {
  12354. function d() {
  12355. this.constructor = c
  12356. }
  12357. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12358. d.prototype = e.prototype;
  12359. c.prototype = new d
  12360. };
  12361. (function(c) {
  12362. var e = function(d) {
  12363. function a(b, a, c, e, f) {
  12364. "undefined" === typeof a && (a = !1);
  12365. "undefined" === typeof c && (c = !1);
  12366. "undefined" === typeof e && (e = null);
  12367. "undefined" === typeof f && (f = null);
  12368. d.call(this, b, a, c);
  12369. this.partName = e;
  12370. this.instance = f
  12371. }
  12372. __extends(a, d);
  12373. a.dispatchSkinPartEvent = function(b, d, e, m) {
  12374. "undefined" === typeof e && (e = null);
  12375. "undefined" === typeof m && (m = null);
  12376. var f = c.Event._getPropertyData(a);
  12377. f.partName = e;
  12378. f.instance = m;
  12379. c.Event._dispatchByTarget(a, b, d, f)
  12380. };
  12381. a.PART_ADDED = "partAdded";
  12382. a.PART_REMOVED = "partRemoved";
  12383. return a
  12384. }(c.Event);
  12385. c.SkinPartEvent = e
  12386. })(egret || (egret = {}));
  12387. __extends = this.__extends || function(c, e) {
  12388. function d() {
  12389. this.constructor = c
  12390. }
  12391. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12392. d.prototype = e.prototype;
  12393. c.prototype = new d
  12394. };
  12395. (function(c) {
  12396. var e = function(d) {
  12397. function a(b, a, c, e) {
  12398. "undefined" === typeof a && (a = !1);
  12399. "undefined" === typeof c && (c = !1);
  12400. "undefined" === typeof e && (e = -1);
  12401. d.call(this, b, a, c);
  12402. this.detail = e
  12403. }
  12404. __extends(a, d);
  12405. a.dispatchCloseEvent = function(b, d, e) {
  12406. "undefined" === typeof e && (e = -1);
  12407. var m = c.Event._getPropertyData(a);
  12408. m.detail = e;
  12409. c.Event._dispatchByTarget(a, b, d, m)
  12410. };
  12411. a.CLOSE = "close";
  12412. return a
  12413. }(c.Event);
  12414. c.CloseEvent = e
  12415. })(egret || (egret = {}));
  12416. __extends = this.__extends || function(c, e) {
  12417. function d() {
  12418. this.constructor = c
  12419. }
  12420. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12421. d.prototype = e.prototype;
  12422. c.prototype = new d
  12423. };
  12424. (function(c) {
  12425. var e = function(d) {
  12426. function a(b, a, c, e, f, h, k, n) {
  12427. "undefined" === typeof a && (a = !1);
  12428. "undefined" === typeof c && (c = !1);
  12429. "undefined" === typeof e && (e = null);
  12430. "undefined" === typeof f && (f = -1);
  12431. "undefined" === typeof h && (h = -1);
  12432. "undefined" === typeof k && (k = null);
  12433. "undefined" === typeof n && (n = null);
  12434. d.call(this, b, a, c);
  12435. this.kind = e;
  12436. this.location = f;
  12437. this.oldLocation = h;
  12438. this.items = k ? k : [];
  12439. this.oldItems = n ? n : []
  12440. }
  12441. __extends(a, d);
  12442. a.dispatchCollectionEvent = function(b, d, e, m, f, h, k) {
  12443. "undefined" === typeof e && (e = null);
  12444. "undefined" === typeof m &&
  12445. (m = -1);
  12446. "undefined" === typeof f && (f = -1);
  12447. "undefined" === typeof h && (h = null);
  12448. "undefined" === typeof k && (k = null);
  12449. var n = c.Event._getPropertyData(a);
  12450. n.kind = e;
  12451. n.location = m;
  12452. n.oldLocation = f;
  12453. n.items = h;
  12454. n.oldItems = k;
  12455. c.Event._dispatchByTarget(a, b, d, n)
  12456. };
  12457. a.COLLECTION_CHANGE = "collectionChange";
  12458. return a
  12459. }(c.Event);
  12460. c.CollectionEvent = e
  12461. })(egret || (egret = {}));
  12462. (function(c) {
  12463. var e = function() {
  12464. function c() {}
  12465. c.ADD = "add";
  12466. c.MOVE = "move";
  12467. c.REFRESH = "refresh";
  12468. c.REMOVE = "remove";
  12469. c.REPLACE = "replace";
  12470. c.RESET = "reset";
  12471. c.UPDATE = "update";
  12472. c.OPEN = "open";
  12473. c.CLOSE = "close";
  12474. return c
  12475. }();
  12476. c.CollectionEventKind = e
  12477. })(egret || (egret = {}));
  12478. __extends = this.__extends || function(c, e) {
  12479. function d() {
  12480. this.constructor = c
  12481. }
  12482. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12483. d.prototype = e.prototype;
  12484. c.prototype = new d
  12485. };
  12486. (function(c) {
  12487. var e = function(d) {
  12488. function a(b, a, c, e, f) {
  12489. "undefined" === typeof a && (a = !1);
  12490. "undefined" === typeof c && (c = !1);
  12491. "undefined" === typeof e && (e = null);
  12492. "undefined" === typeof f && (f = -1);
  12493. d.call(this, b, a, c);
  12494. this.element = e;
  12495. this.index = f
  12496. }
  12497. __extends(a, d);
  12498. a.dispatchElementExistenceEvent = function(b, d, e, m) {
  12499. "undefined" === typeof e && (e = null);
  12500. "undefined" === typeof m && (m = -1);
  12501. var f = c.Event._getPropertyData(a);
  12502. f.element = e;
  12503. f.index = m;
  12504. c.Event._dispatchByTarget(a, b, d, f)
  12505. };
  12506. a.ELEMENT_ADD = "elementAdd";
  12507. a.ELEMENT_REMOVE = "elementRemove";
  12508. return a
  12509. }(c.Event);
  12510. c.ElementExistenceEvent = e
  12511. })(egret || (egret = {}));
  12512. __extends = this.__extends || 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. };
  12520. (function(c) {
  12521. var e = function(d) {
  12522. function a(b, a, c, e, f) {
  12523. "undefined" === typeof a && (a = !1);
  12524. "undefined" === typeof c && (c = !1);
  12525. "undefined" === typeof e && (e = -1);
  12526. "undefined" === typeof f && (f = -1);
  12527. d.call(this, b, a, c);
  12528. this.oldIndex = e;
  12529. this.newIndex = f
  12530. }
  12531. __extends(a, d);
  12532. a.dispatchIndexChangeEvent = function(b, d, e, m, f) {
  12533. "undefined" === typeof e && (e = -1);
  12534. "undefined" === typeof m && (m = -1);
  12535. "undefined" === typeof f && (f = !1);
  12536. var h = c.Event._getPropertyData(a);
  12537. h.oldIndex = e;
  12538. h.newIndex = m;
  12539. return c.Event._dispatchByTarget(a, b, d, h, !1, f)
  12540. };
  12541. a.CHANGE = "change";
  12542. a.CHANGING = "changing";
  12543. return a
  12544. }(c.Event);
  12545. c.IndexChangeEvent = e
  12546. })(egret || (egret = {}));
  12547. __extends = this.__extends || function(c, e) {
  12548. function d() {
  12549. this.constructor = c
  12550. }
  12551. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12552. d.prototype = e.prototype;
  12553. c.prototype = new d
  12554. };
  12555. (function(c) {
  12556. var e = function(d) {
  12557. function a(b, a, c, e, f, h, k, n, q, p, r, s, t) {
  12558. "undefined" === typeof a && (a = !0);
  12559. "undefined" === typeof c && (c = !0);
  12560. "undefined" === typeof e && (e = 0);
  12561. "undefined" === typeof f && (f = 0);
  12562. "undefined" === typeof h && (h = 0);
  12563. "undefined" === typeof k && (k = !1);
  12564. "undefined" === typeof n && (n = !1);
  12565. "undefined" === typeof q && (q = !1);
  12566. "undefined" === typeof p && (p = !1);
  12567. "undefined" === typeof r && (r = -1);
  12568. "undefined" === typeof s && (s = null);
  12569. "undefined" === typeof t && (t = null);
  12570. d.call(this, b, a, c, e, f, h, k, n, q, p);
  12571. this.itemIndex = r;
  12572. this.item =
  12573. s;
  12574. this.itemRenderer = t
  12575. }
  12576. __extends(a, d);
  12577. a.dispatchListEvent = function(b, d, e, m, f, h) {
  12578. "undefined" === typeof e && (e = null);
  12579. "undefined" === typeof m && (m = -1);
  12580. "undefined" === typeof f && (f = null);
  12581. "undefined" === typeof h && (h = null);
  12582. var k = c.Event._getPropertyData(a);
  12583. k.touchPointID = e.touchPointID;
  12584. k._stageX = e.stageX;
  12585. k._stageY = e.stageY;
  12586. k.ctrlKey = e.ctrlKey;
  12587. k.altKey = e.altKey;
  12588. k.shiftKey = e.shiftKey;
  12589. k.touchDown = e.touchDown;
  12590. k.itemIndex = m;
  12591. k.item = f;
  12592. k.itemRenderer = h;
  12593. c.Event._dispatchByTarget(a, b, d, k)
  12594. };
  12595. a.ITEM_ROLL_OUT = "itemRollOut";
  12596. a.ITEM_ROLL_OVER = "itemRollOver";
  12597. a.ITEM_CLICK = "itemClick";
  12598. return a
  12599. }(c.TouchEvent);
  12600. c.ListEvent = e
  12601. })(egret || (egret = {}));
  12602. __extends = this.__extends || function(c, e) {
  12603. function d() {
  12604. this.constructor = c
  12605. }
  12606. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12607. d.prototype = e.prototype;
  12608. c.prototype = new d
  12609. };
  12610. (function(c) {
  12611. var e = function(d) {
  12612. function a(b, a, c, e, f) {
  12613. "undefined" === typeof a && (a = !1);
  12614. "undefined" === typeof c && (c = !1);
  12615. "undefined" === typeof e && (e = null);
  12616. "undefined" === typeof f && (f = !1);
  12617. d.call(this, b, a, c);
  12618. this.popUp = e;
  12619. this.modal = f
  12620. }
  12621. __extends(a, d);
  12622. a.dispatchPopUpEvent = function(b, d, e, m) {
  12623. "undefined" === typeof e && (e = null);
  12624. "undefined" === typeof m && (m = !1);
  12625. var f = c.Event._getPropertyData(a);
  12626. f.popUp = e;
  12627. f.modal = m;
  12628. c.Event._dispatchByTarget(a, b, d, f)
  12629. };
  12630. a.ADD_POPUP = "addPopUp";
  12631. a.REMOVE_POPUP = "removePopUp";
  12632. a.BRING_TO_FRONT =
  12633. "bringToFront";
  12634. return a
  12635. }(c.Event);
  12636. c.PopUpEvent = e
  12637. })(egret || (egret = {}));
  12638. __extends = this.__extends || function(c, e) {
  12639. function d() {
  12640. this.constructor = c
  12641. }
  12642. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12643. d.prototype = e.prototype;
  12644. c.prototype = new d
  12645. };
  12646. (function(c) {
  12647. var e = function(d) {
  12648. function a(a, c, e, m, f, h) {
  12649. "undefined" === typeof c && (c = !1);
  12650. "undefined" === typeof e && (e = !1);
  12651. "undefined" === typeof m && (m = null);
  12652. "undefined" === typeof f && (f = -1);
  12653. "undefined" === typeof h && (h = null);
  12654. d.call(this, a, c, e);
  12655. this.renderer = m;
  12656. this.index = f;
  12657. this.data = h
  12658. }
  12659. __extends(a, d);
  12660. a.dispatchRendererExistenceEvent = function(b, d, e, m, f) {
  12661. "undefined" === typeof e && (e = null);
  12662. "undefined" === typeof m && (m = -1);
  12663. "undefined" === typeof f && (f = null);
  12664. var h = c.Event._getPropertyData(a);
  12665. h.renderer = e;
  12666. h.index = m;
  12667. h.data =
  12668. f;
  12669. c.Event._dispatchByTarget(a, b, d, h)
  12670. };
  12671. a.RENDERER_ADD = "rendererAdd";
  12672. a.RENDERER_REMOVE = "rendererRemove";
  12673. return a
  12674. }(c.Event);
  12675. c.RendererExistenceEvent = e
  12676. })(egret || (egret = {}));
  12677. __extends = this.__extends || function(c, e) {
  12678. function d() {
  12679. this.constructor = c
  12680. }
  12681. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12682. d.prototype = e.prototype;
  12683. c.prototype = new d
  12684. };
  12685. (function(c) {
  12686. var e = function(d) {
  12687. function a(a, c, e, m, f) {
  12688. "undefined" === typeof c && (c = !1);
  12689. "undefined" === typeof e && (e = !1);
  12690. "undefined" === typeof m && (m = null);
  12691. "undefined" === typeof f && (f = null);
  12692. d.call(this, a, c, e);
  12693. this.oldState = m;
  12694. this.newState = f
  12695. }
  12696. __extends(a, d);
  12697. a.dispatchStateChangeEvent = function(b, d, e, m) {
  12698. "undefined" === typeof e && (e = null);
  12699. "undefined" === typeof m && (m = null);
  12700. var f = c.Event._getPropertyData(a);
  12701. f.oldState = e;
  12702. f.newState = m;
  12703. c.Event._dispatchByTarget(a, b, d, f)
  12704. };
  12705. a.CURRENT_STATE_CHANGE = "currentStateChange";
  12706. a.CURRENT_STATE_CHANGING =
  12707. "currentStateChanging";
  12708. return a
  12709. }(c.Event);
  12710. c.StateChangeEvent = e
  12711. })(egret || (egret = {}));
  12712. __extends = this.__extends || function(c, e) {
  12713. function d() {
  12714. this.constructor = c
  12715. }
  12716. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12717. d.prototype = e.prototype;
  12718. c.prototype = new d
  12719. };
  12720. (function(c) {
  12721. var e = function(d) {
  12722. function a(a, c, e) {
  12723. "undefined" === typeof c && (c = !1);
  12724. "undefined" === typeof e && (e = !1);
  12725. d.call(this, a, c, e)
  12726. }
  12727. __extends(a, d);
  12728. a.dispatchTrackBaseEvent = function(b, d) {
  12729. c.Event._dispatchByTarget(a, b, d)
  12730. };
  12731. a.THUMB_DRAG = "thumbDrag";
  12732. a.THUMB_PRESS = "thumbPress";
  12733. a.THUMB_RELEASE = "thumbRelease";
  12734. return a
  12735. }(c.Event);
  12736. c.TrackBaseEvent = e
  12737. })(egret || (egret = {}));
  12738. __extends = this.__extends || function(c, e) {
  12739. function d() {
  12740. this.constructor = c
  12741. }
  12742. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12743. d.prototype = e.prototype;
  12744. c.prototype = new d
  12745. };
  12746. (function(c) {
  12747. var e = function(d) {
  12748. function a(a, c, e, m, f, h) {
  12749. "undefined" === typeof c && (c = !1);
  12750. "undefined" === typeof e && (e = !0);
  12751. "undefined" === typeof m && (m = -1);
  12752. "undefined" === typeof f && (f = null);
  12753. "undefined" === typeof h && (h = null);
  12754. d.call(this, a, c, e);
  12755. this.item = f;
  12756. this.itemRenderer = h;
  12757. this.itemIndex = m
  12758. }
  12759. __extends(a, d);
  12760. a.dispatchTreeEvent = function(b, d, e, m, f, h) {
  12761. "undefined" === typeof e && (e = -1);
  12762. "undefined" === typeof m && (m = null);
  12763. "undefined" === typeof f && (f = null);
  12764. "undefined" === typeof h && (h = !1);
  12765. var k = c.Event._getPropertyData(a);
  12766. k.itemIndex = e;
  12767. k.item = m;
  12768. k.itemRenderer = f;
  12769. k.opening = h;
  12770. c.Event._dispatchByTarget(a, b, d, k)
  12771. };
  12772. a.ITEM_CLOSE = "itemClose";
  12773. a.ITEM_OPEN = "itemOpen";
  12774. a.ITEM_OPENING = "itemOpening";
  12775. return a
  12776. }(c.Event);
  12777. c.TreeEvent = e
  12778. })(egret || (egret = {}));
  12779. __extends = this.__extends || function(c, e) {
  12780. function d() {
  12781. this.constructor = c
  12782. }
  12783. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12784. d.prototype = e.prototype;
  12785. c.prototype = new d
  12786. };
  12787. (function(c) {
  12788. var e = function(c) {
  12789. function a() {
  12790. c.call(this);
  12791. this._useVirtualLayout = !1
  12792. }
  12793. __extends(a, c);
  12794. Object.defineProperty(a.prototype, "target", {
  12795. get: function() {
  12796. return this._target
  12797. },
  12798. set: function(a) {
  12799. this._target != a && (this._target = a, this.clearVirtualLayoutCache())
  12800. },
  12801. enumerable: !0,
  12802. configurable: !0
  12803. });
  12804. Object.defineProperty(a.prototype, "useVirtualLayout", {
  12805. get: function() {
  12806. return this._useVirtualLayout
  12807. },
  12808. set: function(a) {
  12809. this._useVirtualLayout != a && (this._useVirtualLayout = a, this.dispatchEventWith("useVirtualLayoutChanged"),
  12810. this._useVirtualLayout && !a && this.clearVirtualLayoutCache(), this.target && this.target.invalidateDisplayList())
  12811. },
  12812. enumerable: !0,
  12813. configurable: !0
  12814. });
  12815. Object.defineProperty(a.prototype, "typicalLayoutRect", {
  12816. get: function() {
  12817. return this._typicalLayoutRect
  12818. },
  12819. set: function(a) {
  12820. this._typicalLayoutRect != a && (this._typicalLayoutRect = a, this.target && this.target.invalidateSize())
  12821. },
  12822. enumerable: !0,
  12823. configurable: !0
  12824. });
  12825. a.prototype.scrollPositionChanged = function() {};
  12826. a.prototype.clearVirtualLayoutCache = function() {};
  12827. a.prototype.elementAdded =
  12828. function(a) {};
  12829. a.prototype.elementRemoved = function(a) {};
  12830. a.prototype.measure = function() {};
  12831. a.prototype.updateDisplayList = function(a, c) {};
  12832. return a
  12833. }(c.EventDispatcher);
  12834. c.LayoutBase = e
  12835. })(egret || (egret = {}));
  12836. __extends = this.__extends || function(c, e) {
  12837. function d() {
  12838. this.constructor = c
  12839. }
  12840. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12841. d.prototype = e.prototype;
  12842. c.prototype = new d
  12843. };
  12844. (function(c) {
  12845. var e = function(d) {
  12846. function a() {
  12847. d.call(this);
  12848. this._mouseWheelSpeed = 20
  12849. }
  12850. __extends(a, d);
  12851. Object.defineProperty(a.prototype, "useVirtualLayout", {
  12852. set: function(a) {},
  12853. enumerable: !0,
  12854. configurable: !0
  12855. });
  12856. Object.defineProperty(a.prototype, "mouseWheelSpeed", {
  12857. get: function() {
  12858. return this._mouseWheelSpeed
  12859. },
  12860. set: function(a) {
  12861. 0 == a && (a = 1);
  12862. this._mouseWheelSpeed = a
  12863. },
  12864. enumerable: !0,
  12865. configurable: !0
  12866. });
  12867. a.prototype.getElementBoundsLeftOfScrollRect = function(a) {
  12868. var d = new c.Rectangle;
  12869. d.x = a.x - this._mouseWheelSpeed;
  12870. d.right =
  12871. a.x;
  12872. return d
  12873. };
  12874. a.prototype.getElementBoundsRightOfScrollRect = function(a) {
  12875. var d = new c.Rectangle;
  12876. d.x = a.right;
  12877. d.right = a.right + this._mouseWheelSpeed;
  12878. return d
  12879. };
  12880. a.prototype.getElementBoundsAboveScrollRect = function(a) {
  12881. var d = new c.Rectangle;
  12882. d.y = a.y - this._mouseWheelSpeed;
  12883. d.bottom = a.y;
  12884. return d
  12885. };
  12886. a.prototype.getElementBoundsBelowScrollRect = function(a) {
  12887. var d = new c.Rectangle;
  12888. d.y = a.bottom;
  12889. d.bottom = a.bottom + this._mouseWheelSpeed;
  12890. return d
  12891. };
  12892. a.prototype.measure = function() {
  12893. d.prototype.measure.call(this);
  12894. if (null != this.target) {
  12895. for (var a =
  12896. 0, c = 0, e = this.target.numElements, m = 0; m < e; m++) {
  12897. var f = this.target.getElementAt(m);
  12898. if (f && f.includeInLayout) {
  12899. var h = f.horizontalCenter,
  12900. k = f.verticalCenter,
  12901. n = f.left,
  12902. q = f.right,
  12903. p = f.top,
  12904. r = f.bottom;
  12905. isNaN(n) || isNaN(q) ? isNaN(h) ? isNaN(n) && isNaN(q) ? h = f.preferredX : (h = isNaN(n) ? 0 : n, h += isNaN(q) ? 0 : q) : h = 2 * Math.abs(h) : h = n + q;
  12906. isNaN(p) || isNaN(r) ? isNaN(k) ? isNaN(p) && isNaN(r) ? k = f.preferredY : (k = isNaN(p) ? 0 : p, k += isNaN(r) ? 0 : r) : k = 2 * Math.abs(k) : k = p + r;
  12907. r = f.preferredHeight;
  12908. a = Math.ceil(Math.max(a, h + f.preferredWidth));
  12909. c = Math.ceil(Math.max(c,
  12910. k + r))
  12911. }
  12912. }
  12913. this.target.measuredWidth = a;
  12914. this.target.measuredHeight = c
  12915. }
  12916. };
  12917. a.prototype.updateDisplayList = function(a, c) {
  12918. d.prototype.updateDisplayList.call(this, a, c);
  12919. if (null != this.target) {
  12920. for (var e = this.target.numElements, m = 0, f = 0, h = 0; h < e; h++) {
  12921. var k = this.target.getElementAt(h);
  12922. if (null != k && k.includeInLayout) {
  12923. var n = k.horizontalCenter,
  12924. q = k.verticalCenter,
  12925. p = k.left,
  12926. r = k.right,
  12927. s = k.top,
  12928. t = k.bottom,
  12929. A = k.percentWidth,
  12930. w = k.percentHeight,
  12931. B = NaN,
  12932. C = NaN;
  12933. isNaN(p) || isNaN(r) ? isNaN(A) || (B = Math.round(a * Math.min(0.01 * A, 1))) : B = a - r - p;
  12934. isNaN(s) ||
  12935. isNaN(t) ? isNaN(w) || (C = Math.round(c * Math.min(0.01 * w, 1))) : C = c - t - s;
  12936. k.setLayoutBoundsSize(B, C);
  12937. A = k.layoutBoundsWidth;
  12938. w = k.layoutBoundsHeight;
  12939. C = B = NaN;
  12940. B = isNaN(n) ? isNaN(p) ? isNaN(r) ? k.layoutBoundsX : a - A - r : p : Math.round((a - A) / 2 + n);
  12941. C = isNaN(q) ? isNaN(s) ? isNaN(t) ? k.layoutBoundsY : c - w - t : s : Math.round((c - w) / 2 + q);
  12942. k.setLayoutBoundsPosition(B, C);
  12943. m = Math.max(m, B + A);
  12944. f = Math.max(f, C + w)
  12945. }
  12946. }
  12947. this.target.setContentSize(m, f)
  12948. }
  12949. };
  12950. return a
  12951. }(c.LayoutBase);
  12952. c.BasicLayout = e
  12953. })(egret || (egret = {}));
  12954. (function(c) {
  12955. var e = function() {
  12956. function c() {}
  12957. c.LEFT = "left";
  12958. c.JUSTIFY_USING_GAP = "justifyUsingGap";
  12959. c.JUSTIFY_USING_WIDTH = "justifyUsingWidth";
  12960. return c
  12961. }();
  12962. c.ColumnAlign = e
  12963. })(egret || (egret = {}));
  12964. (function(c) {
  12965. var e = function() {
  12966. function c() {}
  12967. c.TOP = "top";
  12968. c.JUSTIFY_USING_GAP = "justifyUsingGap";
  12969. c.JUSTIFY_USING_HEIGHT = "justifyUsingHeight";
  12970. return c
  12971. }();
  12972. c.RowAlign = e
  12973. })(egret || (egret = {}));
  12974. (function(c) {
  12975. var e = function() {
  12976. function c() {}
  12977. c.ROWS = "rows";
  12978. c.COLUMNS = "columns";
  12979. return c
  12980. }();
  12981. c.TileOrientation = e
  12982. })(egret || (egret = {}));
  12983. __extends = this.__extends || function(c, e) {
  12984. function d() {
  12985. this.constructor = c
  12986. }
  12987. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12988. d.prototype = e.prototype;
  12989. c.prototype = new d
  12990. };
  12991. (function(c) {
  12992. var e = function(a) {
  12993. function b() {
  12994. a.call(this);
  12995. this._horizontalAlign = c.HorizontalAlign.LEFT;
  12996. this._verticalAlign = c.VerticalAlign.TOP;
  12997. this._gap = 6;
  12998. this._padding = 0;
  12999. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  13000. this.elementSizeTable = [];
  13001. this.endIndex = this.startIndex = -1;
  13002. this.indexInViewCalculated = !1;
  13003. this.maxElementWidth = 0
  13004. }
  13005. __extends(b, a);
  13006. Object.defineProperty(b.prototype, "horizontalAlign", {
  13007. get: function() {
  13008. return this._horizontalAlign
  13009. },
  13010. set: function(a) {
  13011. this._horizontalAlign !=
  13012. a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  13013. },
  13014. enumerable: !0,
  13015. configurable: !0
  13016. });
  13017. Object.defineProperty(b.prototype, "verticalAlign", {
  13018. get: function() {
  13019. return this._verticalAlign
  13020. },
  13021. set: function(a) {
  13022. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  13023. },
  13024. enumerable: !0,
  13025. configurable: !0
  13026. });
  13027. Object.defineProperty(b.prototype, "gap", {
  13028. get: function() {
  13029. return this._gap
  13030. },
  13031. set: function(a) {
  13032. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(),
  13033. this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13034. },
  13035. enumerable: !0,
  13036. configurable: !0
  13037. });
  13038. Object.defineProperty(b.prototype, "padding", {
  13039. get: function() {
  13040. return this._padding
  13041. },
  13042. set: function(a) {
  13043. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13044. },
  13045. enumerable: !0,
  13046. configurable: !0
  13047. });
  13048. Object.defineProperty(b.prototype, "paddingLeft", {
  13049. get: function() {
  13050. return this._paddingLeft
  13051. },
  13052. set: function(a) {
  13053. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13054. },
  13055. enumerable: !0,
  13056. configurable: !0
  13057. });
  13058. Object.defineProperty(b.prototype, "paddingRight", {
  13059. get: function() {
  13060. return this._paddingRight
  13061. },
  13062. set: function(a) {
  13063. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13064. },
  13065. enumerable: !0,
  13066. configurable: !0
  13067. });
  13068. Object.defineProperty(b.prototype, "paddingTop", {
  13069. get: function() {
  13070. return this._paddingTop
  13071. },
  13072. set: function(a) {
  13073. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13074. },
  13075. enumerable: !0,
  13076. configurable: !0
  13077. });
  13078. Object.defineProperty(b.prototype,
  13079. "paddingBottom", {
  13080. get: function() {
  13081. return this._paddingBottom
  13082. },
  13083. set: function(a) {
  13084. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13085. },
  13086. enumerable: !0,
  13087. configurable: !0
  13088. });
  13089. b.prototype.invalidateTargetSizeAndDisplayList = function() {
  13090. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13091. };
  13092. b.prototype.measure = function() {
  13093. a.prototype.measure.call(this);
  13094. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  13095. };
  13096. b.prototype.measureVirtual =
  13097. function() {
  13098. 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, k = 0; k < e; k++) {
  13099. var n = d[k],
  13100. q = this.target.getElementAt(n);
  13101. if (null != q && q.includeInLayout) var p = q.preferredWidth,
  13102. c = c + q.preferredHeight,
  13103. c = c - (isNaN(this.elementSizeTable[n]) ? a : this.elementSizeTable[n]),
  13104. b = Math.max(b, p)
  13105. }
  13106. k = isNaN(this._padding) ? 0 : this._padding;
  13107. a = isNaN(this._paddingLeft) ?
  13108. k : this._paddingLeft;
  13109. d = isNaN(this._paddingRight) ? k : this._paddingRight;
  13110. e = isNaN(this._paddingTop) ? k : this._paddingTop;
  13111. k = isNaN(this._paddingBottom) ? k : this._paddingBottom;
  13112. e += k;
  13113. this.target.measuredWidth = Math.ceil(b + (a + d));
  13114. this.target.measuredHeight = Math.ceil(c + e)
  13115. };
  13116. b.prototype.measureReal = function() {
  13117. for (var a = this.target.numElements, b = a, c = 0, d = 0, e = 0; e < a; e++) {
  13118. var k = this.target.getElementAt(e);
  13119. if (k && k.includeInLayout) var n = k.preferredWidth,
  13120. d = d + k.preferredHeight,
  13121. c = Math.max(c, n);
  13122. else b--
  13123. }
  13124. a = isNaN(this._gap) ? 0 :
  13125. this._gap;
  13126. d += (b - 1) * a;
  13127. k = isNaN(this._padding) ? 0 : this._padding;
  13128. b = isNaN(this._paddingLeft) ? k : this._paddingLeft;
  13129. a = isNaN(this._paddingRight) ? k : this._paddingRight;
  13130. e = isNaN(this._paddingTop) ? k : this._paddingTop;
  13131. k = isNaN(this._paddingBottom) ? k : this._paddingBottom;
  13132. e += k;
  13133. this.target.measuredWidth = Math.ceil(c + (b + a));
  13134. this.target.measuredHeight = Math.ceil(d + e)
  13135. };
  13136. b.prototype.updateDisplayList = function(b, c) {
  13137. a.prototype.updateDisplayList.call(this, b, c);
  13138. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b,
  13139. c) : this.updateDisplayListReal(b, c))
  13140. };
  13141. b.prototype.getStartPosition = function(a) {
  13142. var b = isNaN(this._padding) ? 0 : this._padding,
  13143. c = isNaN(this._paddingTop) ? b : this._paddingTop,
  13144. b = isNaN(this._gap) ? 0 : this._gap;
  13145. if (!this.useVirtualLayout) {
  13146. var d;
  13147. this.target && (d = this.target.getElementAt(a));
  13148. return d ? d.y : c
  13149. }
  13150. d = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22;
  13151. for (var e = 0; e < a; e++) {
  13152. var k = this.elementSizeTable[e];
  13153. isNaN(k) && (k = d);
  13154. c += k + b
  13155. }
  13156. return c
  13157. };
  13158. b.prototype.getElementSize = function(a) {
  13159. return this.useVirtualLayout ?
  13160. (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22), a) : this.target ? this.target.getElementAt(a).height : 0
  13161. };
  13162. b.prototype.getElementTotalSize = function() {
  13163. 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++) {
  13164. var k = this.elementSizeTable[e];
  13165. isNaN(k) && (k = b);
  13166. c += k + a
  13167. }
  13168. return c - a
  13169. };
  13170. b.prototype.elementAdded = function(b) {
  13171. a.prototype.elementAdded.call(this, b);
  13172. this.elementSizeTable.splice(b,
  13173. 0, this.typicalLayoutRect ? this.typicalLayoutRect.height : 22)
  13174. };
  13175. b.prototype.elementRemoved = function(b) {
  13176. a.prototype.elementRemoved.call(this, b);
  13177. this.elementSizeTable.splice(b, 1)
  13178. };
  13179. b.prototype.clearVirtualLayoutCache = function() {
  13180. a.prototype.clearVirtualLayoutCache.call(this);
  13181. this.elementSizeTable = [];
  13182. this.maxElementWidth = 0
  13183. };
  13184. b.prototype.findIndexAt = function(a, b, c) {
  13185. var d = Math.floor(0.5 * (b + c)),
  13186. e = this.getStartPosition(d),
  13187. k = this.getElementSize(d),
  13188. n = isNaN(this._gap) ? 0 : this._gap;
  13189. return a >= e && a < e + k + n ? d : b == c ? -1 : a <
  13190. e ? this.findIndexAt(a, b, Math.max(b, d - 1)) : this.findIndexAt(a, Math.min(d + 1, c), c)
  13191. };
  13192. b.prototype.scrollPositionChanged = function() {
  13193. a.prototype.scrollPositionChanged.call(this);
  13194. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  13195. };
  13196. b.prototype.getIndexInView = function() {
  13197. 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, !1;
  13198. var a = isNaN(this._padding) ? 0 : this._padding,
  13199. b = isNaN(this._paddingTop) ? a : this._paddingTop,
  13200. c = isNaN(this._paddingBottom) ? a : this._paddingBottom,
  13201. a = this.target.numElements,
  13202. d = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + c,
  13203. e = this.target.verticalScrollPosition;
  13204. if (e > d - c) return this.endIndex = this.startIndex = -1, !1;
  13205. c = this.target.verticalScrollPosition + this.target.height;
  13206. if (c < b) return this.endIndex = this.startIndex = -1, !1;
  13207. b = this.startIndex;
  13208. d = this.endIndex;
  13209. this.startIndex = this.findIndexAt(e, 0, a - 1); - 1 ==
  13210. this.startIndex && (this.startIndex = 0);
  13211. this.endIndex = this.findIndexAt(c, 0, a - 1); - 1 == this.endIndex && (this.endIndex = a - 1);
  13212. return b != this.startIndex || d != this.endIndex
  13213. };
  13214. b.prototype.updateDisplayListVirtual = function(a, b) {
  13215. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  13216. var d = isNaN(this._padding) ? 0 : this._padding,
  13217. e = isNaN(this._paddingLeft) ? d : this._paddingLeft,
  13218. h = isNaN(this._paddingRight) ? d : this._paddingRight,
  13219. k = isNaN(this._paddingBottom) ? d : this._paddingBottom,
  13220. n = isNaN(this._gap) ? 0 :
  13221. this._gap,
  13222. q = this.target.numElements;
  13223. if (-1 == this.startIndex || -1 == this.endIndex) e = this.getStartPosition(q) - n + k, this.target.setContentSize(this.target.contentWidth, Math.ceil(e));
  13224. else {
  13225. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  13226. var p = this._horizontalAlign == c.HorizontalAlign.JUSTIFY || this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  13227. r = this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  13228. s = 0;
  13229. p || (this._horizontalAlign == c.HorizontalAlign.CENTER ? s = 0.5 : this._horizontalAlign ==
  13230. c.HorizontalAlign.RIGHT && (s = 1));
  13231. var t = Math.max(0, a - e - h),
  13232. A = Math.ceil(t),
  13233. w, B = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22,
  13234. d = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.width : 71, this.maxElementWidth);
  13235. if (r) {
  13236. for (var C = this.startIndex; C <= this.endIndex; C++)(w = this.target.getVirtualElementAt(C)) && w.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, w.preferredWidth));
  13237. A = Math.ceil(Math.max(t, this.maxElementWidth))
  13238. }
  13239. for (var u = 0, v = 0, C = 0, D = !1, z = this.startIndex; z <= this.endIndex; z++)
  13240. if (u =
  13241. 0, w = this.target.getVirtualElementAt(z)) w.includeInLayout ? (p ? (u = e, w.setLayoutBoundsSize(A, NaN)) : (u = (t - w.layoutBoundsWidth) * s, u = 0 < u ? u : 0, u = e + u), r || (this.maxElementWidth = Math.max(this.maxElementWidth, w.preferredWidth)), C = Math.max(C, w.layoutBoundsWidth), D || (v = isNaN(this.elementSizeTable[z]) ? B : this.elementSizeTable[z], v != w.layoutBoundsHeight && (D = !0)), 0 == z && 0 < this.elementSizeTable.length && this.elementSizeTable[z] != w.layoutBoundsHeight && (this.typicalLayoutRect = null), this.elementSizeTable[z] = w.layoutBoundsHeight,
  13242. v = this.getStartPosition(z), w.setLayoutBoundsPosition(Math.round(u), Math.round(v))) : this.elementSizeTable[z] = 0;
  13243. C += e + h;
  13244. e = this.getStartPosition(q) - n + k;
  13245. this.target.setContentSize(Math.ceil(C), Math.ceil(e));
  13246. (D || d < this.maxElementWidth) && this.target.invalidateSize()
  13247. }
  13248. };
  13249. b.prototype.updateDisplayListReal = function(a, e) {
  13250. var m = isNaN(this._padding) ? 0 : this._padding,
  13251. f = isNaN(this._paddingLeft) ? m : this._paddingLeft,
  13252. h = isNaN(this._paddingRight) ? m : this._paddingRight,
  13253. k = isNaN(this._paddingTop) ? m : this._paddingTop,
  13254. m = isNaN(this._paddingBottom) ?
  13255. m : this._paddingBottom,
  13256. n = isNaN(this._gap) ? 0 : this._gap,
  13257. q = Math.max(0, a - f - h),
  13258. p = Math.max(0, e - k - m),
  13259. r = this._verticalAlign == c.VerticalAlign.JUSTIFY,
  13260. s = this._horizontalAlign == c.HorizontalAlign.JUSTIFY || this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  13261. t = 0;
  13262. s || (this._horizontalAlign == c.HorizontalAlign.CENTER ? t = 0.5 : this._horizontalAlign == c.HorizontalAlign.RIGHT && (t = 1));
  13263. var A = this.target.numElements,
  13264. w = A,
  13265. B = f,
  13266. C = k,
  13267. u, v, D = 0,
  13268. B = 0,
  13269. z = [],
  13270. E, x = p;
  13271. for (u = 0; u < A; u++)(v = this.target.getElementAt(u)) && v.includeInLayout ? (this.maxElementWidth =
  13272. Math.max(this.maxElementWidth, v.preferredWidth), r ? D += v.preferredHeight : isNaN(v.percentHeight) ? x -= v.preferredHeight : (B += v.percentHeight, E = new d, E.layoutElement = v, E.percent = v.percentHeight, E.min = v.minHeight, E.max = v.maxHeight, z.push(E))) : w--;
  13273. var x = x - (w - 1) * n,
  13274. x = 0 < x ? x : 0,
  13275. y = p - D - n * (w - 1),
  13276. H, L = w,
  13277. G = [];
  13278. if (r) {
  13279. if (0 > y) {
  13280. H = x / w;
  13281. for (u = 0; u < A; u++)(v = this.target.getElementAt(u)) && v.includeInLayout && (v = v.preferredHeight, v <= H && (x -= v, L--));
  13282. x = 0 < x ? x : 0
  13283. }
  13284. } else if (0 < B) {
  13285. b.flexChildrenProportionally(p, x, B, z);
  13286. p = 0;
  13287. v = z.length;
  13288. for (u = 0; u <
  13289. v; u++) E = z[u], B = Math.round(E.size + p), p += E.size - B, G[E.layoutElement.hashCode] = B, x -= B;
  13290. x = 0 < x ? x : 0
  13291. }
  13292. this._verticalAlign == c.VerticalAlign.MIDDLE ? C = k + 0.5 * x : this._verticalAlign == c.VerticalAlign.BOTTOM && (C = k + x);
  13293. z = f;
  13294. v = w = 0;
  13295. E = Math.ceil(q);
  13296. this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY && (E = Math.ceil(Math.max(q, this.maxElementWidth)));
  13297. p = 0;
  13298. w = NaN;
  13299. for (u = 0; u < A; u++) B = 0, (v = this.target.getElementAt(u)) && v.includeInLayout && (w = NaN, r ? (B = NaN, 0 < y ? B = x * v.preferredHeight / D : 0 > y && v.preferredHeight > H && (B = x / L), isNaN(B) ||
  13300. (w = Math.round(B + p), p += B - w)) : w = G[v.hashCode], s ? (B = f, v.setLayoutBoundsSize(E, w)) : (B = NaN, isNaN(v.percentWidth) || (B = Math.min(100, v.percentWidth), B = Math.round(q * B * 0.01)), v.setLayoutBoundsSize(B, w), B = (q - v.layoutBoundsWidth) * t, B = 0 < B ? B : 0, B = f + B), v.setLayoutBoundsPosition(Math.round(B), Math.round(C)), w = Math.ceil(v.layoutBoundsWidth), v = Math.ceil(v.layoutBoundsHeight), z = Math.max(z, B + w), k = Math.max(k, C + v), C += v + n);
  13301. this.target.setContentSize(Math.ceil(z + h), Math.ceil(k + m))
  13302. };
  13303. b.flexChildrenProportionally = function(a,
  13304. b, c, d) {
  13305. var e = d.length,
  13306. k;
  13307. do {
  13308. k = !0;
  13309. var n = b - a * c / 100;
  13310. 0 < n ? b -= n : n = 0;
  13311. for (var q = b / c, p = 0; p < e; p++) {
  13312. var r = d[p],
  13313. s = r.percent * q;
  13314. if (s < r.min) {
  13315. k = r.min;
  13316. r.size = k;
  13317. d[p] = d[--e];
  13318. d[e] = r;
  13319. c -= r.percent;
  13320. n >= k || (b -= k - n);
  13321. k = !1;
  13322. break
  13323. } else if (s > r.max) {
  13324. k = r.max;
  13325. r.size = k;
  13326. d[p] = d[--e];
  13327. d[e] = r;
  13328. c -= r.percent;
  13329. n >= k || (b -= k - n);
  13330. k = !1;
  13331. break
  13332. } else r.size = s
  13333. }
  13334. } while (!k)
  13335. };
  13336. return b
  13337. }(c.LayoutBase);
  13338. c.VerticalLayout = e;
  13339. var d = function() {
  13340. return function() {
  13341. this.size = 0
  13342. }
  13343. }()
  13344. })(egret || (egret = {}));
  13345. __extends = this.__extends || function(c, e) {
  13346. function d() {
  13347. this.constructor = c
  13348. }
  13349. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  13350. d.prototype = e.prototype;
  13351. c.prototype = new d
  13352. };
  13353. (function(c) {
  13354. var e = function(a) {
  13355. function b() {
  13356. a.call(this);
  13357. this._horizontalAlign = c.HorizontalAlign.LEFT;
  13358. this._verticalAlign = c.VerticalAlign.TOP;
  13359. this._gap = 6;
  13360. this._padding = 0;
  13361. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  13362. this.elementSizeTable = [];
  13363. this.endIndex = this.startIndex = -1;
  13364. this.indexInViewCalculated = !1;
  13365. this.maxElementHeight = 0
  13366. }
  13367. __extends(b, a);
  13368. Object.defineProperty(b.prototype, "horizontalAlign", {
  13369. get: function() {
  13370. return this._horizontalAlign
  13371. },
  13372. set: function(a) {
  13373. this._horizontalAlign !=
  13374. a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  13375. },
  13376. enumerable: !0,
  13377. configurable: !0
  13378. });
  13379. Object.defineProperty(b.prototype, "verticalAlign", {
  13380. get: function() {
  13381. return this._verticalAlign
  13382. },
  13383. set: function(a) {
  13384. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  13385. },
  13386. enumerable: !0,
  13387. configurable: !0
  13388. });
  13389. Object.defineProperty(b.prototype, "gap", {
  13390. get: function() {
  13391. return this._gap
  13392. },
  13393. set: function(a) {
  13394. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(),
  13395. this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13396. },
  13397. enumerable: !0,
  13398. configurable: !0
  13399. });
  13400. Object.defineProperty(b.prototype, "padding", {
  13401. get: function() {
  13402. return this._padding
  13403. },
  13404. set: function(a) {
  13405. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13406. },
  13407. enumerable: !0,
  13408. configurable: !0
  13409. });
  13410. Object.defineProperty(b.prototype, "paddingLeft", {
  13411. get: function() {
  13412. return this._paddingLeft
  13413. },
  13414. set: function(a) {
  13415. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13416. },
  13417. enumerable: !0,
  13418. configurable: !0
  13419. });
  13420. Object.defineProperty(b.prototype, "paddingRight", {
  13421. get: function() {
  13422. return this._paddingRight
  13423. },
  13424. set: function(a) {
  13425. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13426. },
  13427. enumerable: !0,
  13428. configurable: !0
  13429. });
  13430. Object.defineProperty(b.prototype, "paddingTop", {
  13431. get: function() {
  13432. return this._paddingTop
  13433. },
  13434. set: function(a) {
  13435. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13436. },
  13437. enumerable: !0,
  13438. configurable: !0
  13439. });
  13440. Object.defineProperty(b.prototype,
  13441. "paddingBottom", {
  13442. get: function() {
  13443. return this._paddingBottom
  13444. },
  13445. set: function(a) {
  13446. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13447. },
  13448. enumerable: !0,
  13449. configurable: !0
  13450. });
  13451. b.prototype.invalidateTargetSizeAndDisplayList = function() {
  13452. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13453. };
  13454. b.prototype.measure = function() {
  13455. a.prototype.measure.call(this);
  13456. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  13457. };
  13458. b.prototype.measureVirtual =
  13459. function() {
  13460. 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, k = 0; k < e; k++) {
  13461. var n = d[k],
  13462. q = this.target.getElementAt(n);
  13463. if (null != q && q.includeInLayout) var p = q.preferredHeight,
  13464. c = c + q.preferredWidth,
  13465. c = c - (isNaN(this.elementSizeTable[n]) ? b : this.elementSizeTable[n]),
  13466. a = Math.max(a, p)
  13467. }
  13468. k = isNaN(this._padding) ? 0 : this._padding;
  13469. b =
  13470. isNaN(this._paddingLeft) ? k : this._paddingLeft;
  13471. d = isNaN(this._paddingRight) ? k : this._paddingRight;
  13472. e = isNaN(this._paddingTop) ? k : this._paddingTop;
  13473. k = isNaN(this._paddingBottom) ? k : this._paddingBottom;
  13474. e += k;
  13475. this.target.measuredWidth = Math.ceil(c + (b + d));
  13476. this.target.measuredHeight = Math.ceil(a + e)
  13477. };
  13478. b.prototype.measureReal = function() {
  13479. for (var a = this.target.numElements, b = a, c = 0, d = 0, e = 0; e < a; e++) {
  13480. var k = this.target.getElementAt(e);
  13481. if (k && k.includeInLayout) var n = k.preferredHeight,
  13482. c = c + k.preferredWidth,
  13483. d = Math.max(d, n);
  13484. else b--
  13485. }
  13486. a =
  13487. isNaN(this._gap) ? 0 : this._gap;
  13488. c += (b - 1) * a;
  13489. k = isNaN(this._padding) ? 0 : this._padding;
  13490. b = isNaN(this._paddingLeft) ? k : this._paddingLeft;
  13491. a = isNaN(this._paddingRight) ? k : this._paddingRight;
  13492. e = isNaN(this._paddingTop) ? k : this._paddingTop;
  13493. k = isNaN(this._paddingBottom) ? k : this._paddingBottom;
  13494. e += k;
  13495. this.target.measuredWidth = Math.ceil(c + (b + a));
  13496. this.target.measuredHeight = Math.ceil(d + e)
  13497. };
  13498. b.prototype.updateDisplayList = function(b, c) {
  13499. a.prototype.updateDisplayList.call(this, b, c);
  13500. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b,
  13501. c) : this.updateDisplayListReal(b, c))
  13502. };
  13503. b.prototype.getStartPosition = function(a) {
  13504. var b = isNaN(this._padding) ? 0 : this._padding,
  13505. c = isNaN(this._paddingLeft) ? b : this._paddingLeft,
  13506. b = isNaN(this._gap) ? 0 : this._gap;
  13507. if (!this.useVirtualLayout) {
  13508. var d;
  13509. this.target && (d = this.target.getElementAt(a));
  13510. return d ? d.x : c
  13511. }
  13512. d = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71;
  13513. for (var e = 0; e < a; e++) {
  13514. var k = this.elementSizeTable[e];
  13515. isNaN(k) && (k = d);
  13516. c += k + b
  13517. }
  13518. return c
  13519. };
  13520. b.prototype.getElementSize = function(a) {
  13521. return this.useVirtualLayout ?
  13522. (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71), a) : this.target ? this.target.getElementAt(a).width : 0
  13523. };
  13524. b.prototype.getElementTotalSize = function() {
  13525. 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++) {
  13526. var k = this.elementSizeTable[e];
  13527. isNaN(k) && (k = a);
  13528. c += k + b
  13529. }
  13530. return c - b
  13531. };
  13532. b.prototype.elementAdded = function(b) {
  13533. this.useVirtualLayout && (a.prototype.elementAdded.call(this, b), this.elementSizeTable.splice(b,
  13534. 0, this.typicalLayoutRect ? this.typicalLayoutRect.width : 71))
  13535. };
  13536. b.prototype.elementRemoved = function(b) {
  13537. this.useVirtualLayout && (a.prototype.elementRemoved.call(this, b), this.elementSizeTable.splice(b, 1))
  13538. };
  13539. b.prototype.clearVirtualLayoutCache = function() {
  13540. this.useVirtualLayout && (a.prototype.clearVirtualLayoutCache.call(this), this.elementSizeTable = [], this.maxElementHeight = 0)
  13541. };
  13542. b.prototype.findIndexAt = function(a, b, c) {
  13543. var d = Math.floor(0.5 * (b + c)),
  13544. e = this.getStartPosition(d),
  13545. k = this.getElementSize(d),
  13546. n = isNaN(this._gap) ?
  13547. 0 : this._gap;
  13548. return a >= e && a < e + k + 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)
  13549. };
  13550. b.prototype.scrollPositionChanged = function() {
  13551. a.prototype.scrollPositionChanged.call(this);
  13552. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  13553. };
  13554. b.prototype.getIndexInView = function() {
  13555. 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 =
  13556. this.endIndex = -1, !1;
  13557. var a = isNaN(this._padding) ? 0 : this._padding,
  13558. b = isNaN(this._paddingLeft) ? a : this._paddingLeft,
  13559. c = isNaN(this._paddingRight) ? a : this._paddingRight;
  13560. isNaN(this._paddingTop);
  13561. isNaN(this._paddingBottom);
  13562. var a = this.target.numElements,
  13563. d = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + c,
  13564. e = this.target.horizontalScrollPosition;
  13565. if (e > d - c) return this.endIndex = this.startIndex = -1, !1;
  13566. c = this.target.horizontalScrollPosition + this.target.width;
  13567. if (c < b) return this.endIndex = this.startIndex = -1, !1;
  13568. b = this.startIndex;
  13569. d = this.endIndex;
  13570. this.startIndex = this.findIndexAt(e, 0, a - 1); - 1 == this.startIndex && (this.startIndex = 0);
  13571. this.endIndex = this.findIndexAt(c, 0, a - 1); - 1 == this.endIndex && (this.endIndex = a - 1);
  13572. return b != this.startIndex || d != this.endIndex
  13573. };
  13574. b.prototype.updateDisplayListVirtual = function(a, b) {
  13575. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  13576. var d = isNaN(this._padding) ? 0 : this._padding,
  13577. e = isNaN(this._paddingRight) ? d : this._paddingRight,
  13578. h = isNaN(this._paddingTop) ? d : this._paddingTop,
  13579. k = isNaN(this._paddingBottom) ?
  13580. d : this._paddingBottom,
  13581. n = isNaN(this._gap) ? 0 : this._gap,
  13582. q = this.target.numElements;
  13583. if (-1 == this.startIndex || -1 == this.endIndex) e = this.getStartPosition(q) - n + e, this.target.setContentSize(Math.ceil(e), this.target.contentHeight);
  13584. else {
  13585. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  13586. var p = this._verticalAlign == c.VerticalAlign.JUSTIFY || this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13587. r = this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13588. s = 0;
  13589. p || (this._verticalAlign == c.VerticalAlign.MIDDLE ?
  13590. s = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (s = 1));
  13591. var t = Math.max(0, b - h - k),
  13592. A = Math.ceil(t),
  13593. w, B = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71,
  13594. d = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, this.maxElementHeight);
  13595. if (r) {
  13596. for (var C = this.startIndex; C <= this.endIndex; C++)(w = this.target.getVirtualElementAt(C)) && w.includeInLayout && (this.maxElementHeight = Math.max(this.maxElementHeight, w.preferredHeight));
  13597. A = Math.ceil(Math.max(t, this.maxElementHeight))
  13598. }
  13599. for (var u = 0, v = 0, C = 0, D = !1, z = this.startIndex; z <= this.endIndex; z++)
  13600. if (v = 0, w = this.target.getVirtualElementAt(z)) w.includeInLayout ? (p ? (v = h, w.setLayoutBoundsSize(NaN, A)) : (v = (t - w.layoutBoundsHeight) * s, v = 0 < v ? v : 0, v = h + v), r || (this.maxElementHeight = Math.max(this.maxElementHeight, w.preferredHeight)), C = Math.max(C, w.layoutBoundsHeight), D || (u = isNaN(this.elementSizeTable[z]) ? B : this.elementSizeTable[z], u != w.layoutBoundsWidth && (D = !0)), 0 == z && 0 < this.elementSizeTable.length && this.elementSizeTable[z] != w.layoutBoundsWidth && (this.typicalLayoutRect =
  13601. null), this.elementSizeTable[z] = w.layoutBoundsWidth, u = this.getStartPosition(z), w.setLayoutBoundsPosition(Math.round(u), Math.round(v))) : this.elementSizeTable[z] = 0;
  13602. C += h + k;
  13603. e = this.getStartPosition(q) - n + e;
  13604. this.target.setContentSize(Math.ceil(e), Math.ceil(C));
  13605. (D || d < this.maxElementHeight) && this.target.invalidateSize()
  13606. }
  13607. };
  13608. b.prototype.updateDisplayListReal = function(a, e) {
  13609. var m = isNaN(this._padding) ? 0 : this._padding,
  13610. f = isNaN(this._paddingLeft) ? m : this._paddingLeft,
  13611. h = isNaN(this._paddingRight) ? m : this._paddingRight,
  13612. k = isNaN(this._paddingTop) ? m : this._paddingTop,
  13613. m = isNaN(this._paddingBottom) ? m : this._paddingBottom,
  13614. n = isNaN(this._gap) ? 0 : this._gap,
  13615. q = Math.max(0, a - f - h),
  13616. p = Math.max(0, e - k - m),
  13617. r = this._horizontalAlign == c.HorizontalAlign.JUSTIFY,
  13618. s = this._verticalAlign == c.VerticalAlign.JUSTIFY || this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13619. t = 0;
  13620. s || (this._verticalAlign == c.VerticalAlign.MIDDLE ? t = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (t = 1));
  13621. var A = this.target.numElements,
  13622. w = A,
  13623. B = f,
  13624. C = k,
  13625. u, v, D = 0,
  13626. C = 0,
  13627. z = [],
  13628. E, x = q;
  13629. for (u = 0; u <
  13630. A; u++)(v = this.target.getElementAt(u)) && v.includeInLayout ? (this.maxElementHeight = Math.max(this.maxElementHeight, v.preferredHeight), r ? D += v.preferredWidth : isNaN(v.percentWidth) ? x -= v.preferredWidth : (C += v.percentWidth, E = new d, E.layoutElement = v, E.percent = v.percentWidth, E.min = v.minWidth, E.max = v.maxWidth, z.push(E))) : w--;
  13631. var x = x - n * (w - 1),
  13632. x = 0 < x ? x : 0,
  13633. y = q - D - n * (w - 1),
  13634. H, L = w,
  13635. G = [];
  13636. if (r) {
  13637. if (0 > y) {
  13638. H = x / w;
  13639. for (u = 0; u < A; u++)(v = this.target.getElementAt(u)) && v.includeInLayout && (v = v.preferredWidth, v <= H && (x -= v, L--));
  13640. x = 0 < x ? x : 0
  13641. }
  13642. } else if (0 <
  13643. C) {
  13644. b.flexChildrenProportionally(q, x, C, z);
  13645. q = 0;
  13646. v = z.length;
  13647. for (u = 0; u < v; u++) E = z[u], C = Math.round(E.size + q), q += E.size - C, G[E.layoutElement.hashCode] = C, x -= C;
  13648. x = 0 < x ? x : 0
  13649. }
  13650. this._horizontalAlign == c.HorizontalAlign.CENTER ? B = f + 0.5 * x : this._horizontalAlign == c.HorizontalAlign.RIGHT && (B = f + x);
  13651. z = k;
  13652. v = w = 0;
  13653. E = Math.ceil(p);
  13654. this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY && (E = Math.ceil(Math.max(p, this.maxElementHeight)));
  13655. for (u = q = 0; u < A; u++) C = 0, (v = this.target.getElementAt(u)) && v.includeInLayout && (w = NaN, r ? (C = NaN, 0 < y ? C = x * v.preferredWidth /
  13656. D : 0 > y && v.preferredWidth > H && (C = x / L), isNaN(C) || (w = Math.round(C + q), q += C - w)) : w = G[v.hashCode], s ? (C = k, v.setLayoutBoundsSize(w, E)) : (C = NaN, isNaN(v.percentHeight) || (C = Math.min(100, v.percentHeight), C = Math.round(p * C * 0.01)), v.setLayoutBoundsSize(w, C), C = (p - v.layoutBoundsHeight) * t, C = 0 < C ? C : 0, C = k + C), v.setLayoutBoundsPosition(Math.round(B), Math.round(C)), w = Math.ceil(v.layoutBoundsWidth), v = Math.ceil(v.layoutBoundsHeight), f = Math.max(f, B + w), z = Math.max(z, C + v), B += w + n);
  13657. this.target.setContentSize(Math.ceil(f + h), Math.ceil(z +
  13658. m))
  13659. };
  13660. b.flexChildrenProportionally = function(a, b, c, d) {
  13661. var e = d.length,
  13662. k;
  13663. do {
  13664. k = !0;
  13665. var n = b - a * c / 100;
  13666. 0 < n ? b -= n : n = 0;
  13667. for (var q = b / c, p = 0; p < e; p++) {
  13668. var r = d[p],
  13669. s = r.percent * q;
  13670. if (s < r.min) {
  13671. k = r.min;
  13672. r.size = k;
  13673. d[p] = d[--e];
  13674. d[e] = r;
  13675. c -= r.percent;
  13676. n >= k || (b -= k - n);
  13677. k = !1;
  13678. break
  13679. } else if (s > r.max) {
  13680. k = r.max;
  13681. r.size = k;
  13682. d[p] = d[--e];
  13683. d[e] = r;
  13684. c -= r.percent;
  13685. n >= k || (b -= k - n);
  13686. k = !1;
  13687. break
  13688. } else r.size = s
  13689. }
  13690. } while (!k)
  13691. };
  13692. return b
  13693. }(c.LayoutBase);
  13694. c.HorizontalLayout = e;
  13695. var d = function() {
  13696. return function() {
  13697. this.size = 0
  13698. }
  13699. }()
  13700. })(egret || (egret = {}));
  13701. __extends = this.__extends || function(c, e) {
  13702. function d() {
  13703. this.constructor = c
  13704. }
  13705. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  13706. d.prototype = e.prototype;
  13707. c.prototype = new d
  13708. };
  13709. (function(c) {
  13710. var e = function(d) {
  13711. function a() {
  13712. d.call(this);
  13713. this.explicitHorizontalGap = NaN;
  13714. this._horizontalGap = 6;
  13715. this.explicitVerticalGap = NaN;
  13716. this._verticalGap = 6;
  13717. this._columnCount = -1;
  13718. this._requestedColumnCount = 0;
  13719. this._rowCount = -1;
  13720. this._requestedRowCount = 0;
  13721. this._rowHeight = this.explicitRowHeight = this._columnWidth = this.explicitColumnWidth = NaN;
  13722. this._padding = 0;
  13723. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  13724. this._horizontalAlign = c.HorizontalAlign.JUSTIFY;
  13725. this._verticalAlign =
  13726. c.VerticalAlign.JUSTIFY;
  13727. this._columnAlign = c.ColumnAlign.LEFT;
  13728. this._rowAlign = c.RowAlign.TOP;
  13729. this._orientation = c.TileOrientation.ROWS;
  13730. this.maxElementHeight = this.maxElementWidth = 0;
  13731. this.endIndex = this.startIndex = -1;
  13732. this.indexInViewCalculated = !1
  13733. }
  13734. __extends(a, d);
  13735. Object.defineProperty(a.prototype, "horizontalGap", {
  13736. get: function() {
  13737. return this._horizontalGap
  13738. },
  13739. set: function(a) {
  13740. a != this._horizontalGap && (this._horizontalGap = this.explicitHorizontalGap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") &&
  13741. this.dispatchEventWith("gapChanged"))
  13742. },
  13743. enumerable: !0,
  13744. configurable: !0
  13745. });
  13746. Object.defineProperty(a.prototype, "verticalGap", {
  13747. get: function() {
  13748. return this._verticalGap
  13749. },
  13750. set: function(a) {
  13751. a != this._verticalGap && (this._verticalGap = this.explicitVerticalGap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13752. },
  13753. enumerable: !0,
  13754. configurable: !0
  13755. });
  13756. Object.defineProperty(a.prototype, "columnCount", {
  13757. get: function() {
  13758. return this._columnCount
  13759. },
  13760. enumerable: !0,
  13761. configurable: !0
  13762. });
  13763. Object.defineProperty(a.prototype, "requestedColumnCount", {
  13764. get: function() {
  13765. return this._requestedColumnCount
  13766. },
  13767. set: function(a) {
  13768. this._requestedColumnCount != a && (this._columnCount = this._requestedColumnCount = a, this.invalidateTargetSizeAndDisplayList())
  13769. },
  13770. enumerable: !0,
  13771. configurable: !0
  13772. });
  13773. Object.defineProperty(a.prototype, "rowCount", {
  13774. get: function() {
  13775. return this._rowCount
  13776. },
  13777. enumerable: !0,
  13778. configurable: !0
  13779. });
  13780. Object.defineProperty(a.prototype, "requestedRowCount", {
  13781. get: function() {
  13782. return this._requestedRowCount
  13783. },
  13784. set: function(a) {
  13785. this._requestedRowCount !=
  13786. a && (this._rowCount = this._requestedRowCount = a, this.invalidateTargetSizeAndDisplayList())
  13787. },
  13788. enumerable: !0,
  13789. configurable: !0
  13790. });
  13791. Object.defineProperty(a.prototype, "columnWidth", {
  13792. get: function() {
  13793. return this._columnWidth
  13794. },
  13795. set: function(a) {
  13796. a != this._columnWidth && (this._columnWidth = this.explicitColumnWidth = a, this.invalidateTargetSizeAndDisplayList())
  13797. },
  13798. enumerable: !0,
  13799. configurable: !0
  13800. });
  13801. Object.defineProperty(a.prototype, "rowHeight", {
  13802. get: function() {
  13803. return this._rowHeight
  13804. },
  13805. set: function(a) {
  13806. a != this._rowHeight && (this._rowHeight =
  13807. this.explicitRowHeight = a, this.invalidateTargetSizeAndDisplayList())
  13808. },
  13809. enumerable: !0,
  13810. configurable: !0
  13811. });
  13812. Object.defineProperty(a.prototype, "padding", {
  13813. get: function() {
  13814. return this._padding
  13815. },
  13816. set: function(a) {
  13817. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13818. },
  13819. enumerable: !0,
  13820. configurable: !0
  13821. });
  13822. Object.defineProperty(a.prototype, "paddingLeft", {
  13823. get: function() {
  13824. return this._paddingLeft
  13825. },
  13826. set: function(a) {
  13827. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13828. },
  13829. enumerable: !0,
  13830. configurable: !0
  13831. });
  13832. Object.defineProperty(a.prototype, "paddingRight", {
  13833. get: function() {
  13834. return this._paddingRight
  13835. },
  13836. set: function(a) {
  13837. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13838. },
  13839. enumerable: !0,
  13840. configurable: !0
  13841. });
  13842. Object.defineProperty(a.prototype, "paddingTop", {
  13843. get: function() {
  13844. return this._paddingTop
  13845. },
  13846. set: function(a) {
  13847. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13848. },
  13849. enumerable: !0,
  13850. configurable: !0
  13851. });
  13852. Object.defineProperty(a.prototype,
  13853. "paddingBottom", {
  13854. get: function() {
  13855. return this._paddingBottom
  13856. },
  13857. set: function(a) {
  13858. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13859. },
  13860. enumerable: !0,
  13861. configurable: !0
  13862. });
  13863. Object.defineProperty(a.prototype, "horizontalAlign", {
  13864. get: function() {
  13865. return this._horizontalAlign
  13866. },
  13867. set: function(a) {
  13868. this._horizontalAlign != a && (this._horizontalAlign = a, this.invalidateTargetSizeAndDisplayList())
  13869. },
  13870. enumerable: !0,
  13871. configurable: !0
  13872. });
  13873. Object.defineProperty(a.prototype, "verticalAlign", {
  13874. get: function() {
  13875. return this._verticalAlign
  13876. },
  13877. set: function(a) {
  13878. this._verticalAlign != a && (this._verticalAlign = a, this.invalidateTargetSizeAndDisplayList())
  13879. },
  13880. enumerable: !0,
  13881. configurable: !0
  13882. });
  13883. Object.defineProperty(a.prototype, "columnAlign", {
  13884. get: function() {
  13885. return this._columnAlign
  13886. },
  13887. set: function(a) {
  13888. this._columnAlign != a && (this._columnAlign = a, this.invalidateTargetSizeAndDisplayList())
  13889. },
  13890. enumerable: !0,
  13891. configurable: !0
  13892. });
  13893. Object.defineProperty(a.prototype, "rowAlign", {
  13894. get: function() {
  13895. return this._rowAlign
  13896. },
  13897. set: function(a) {
  13898. this._rowAlign != a && (this._rowAlign = a,
  13899. this.invalidateTargetSizeAndDisplayList())
  13900. },
  13901. enumerable: !0,
  13902. configurable: !0
  13903. });
  13904. Object.defineProperty(a.prototype, "orientation", {
  13905. get: function() {
  13906. return this._orientation
  13907. },
  13908. set: function(a) {
  13909. this._orientation != a && (this._orientation = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("orientationChanged") && this.dispatchEventWith("orientationChanged"))
  13910. },
  13911. enumerable: !0,
  13912. configurable: !0
  13913. });
  13914. a.prototype.invalidateTargetSizeAndDisplayList = function() {
  13915. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13916. };
  13917. a.prototype.measure = function() {
  13918. if (this.target) {
  13919. var a = this._columnCount,
  13920. c = this._rowCount,
  13921. d = this._columnWidth,
  13922. e = this._rowHeight,
  13923. f = 0,
  13924. h = 0;
  13925. this.calculateRowAndColumn(this.target.explicitWidth, this.target.explicitHeight);
  13926. var k = 0 < this._requestedColumnCount ? this._requestedColumnCount : this._columnCount,
  13927. n = 0 < this._requestedRowCount ? this._requestedRowCount : this._rowCount,
  13928. q = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13929. p = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13930. 0 < k && (f = k * (this._columnWidth + q) - q);
  13931. 0 < n && (h =
  13932. n * (this._rowHeight + p) - p);
  13933. p = isNaN(this._padding) ? 0 : this._padding;
  13934. k = isNaN(this._paddingLeft) ? p : this._paddingLeft;
  13935. n = isNaN(this._paddingRight) ? p : this._paddingRight;
  13936. q = isNaN(this._paddingTop) ? p : this._paddingTop;
  13937. p = isNaN(this._paddingBottom) ? p : this._paddingBottom;
  13938. q += p;
  13939. this.target.measuredWidth = Math.ceil(f + (k + n));
  13940. this.target.measuredHeight = Math.ceil(h + q);
  13941. this._columnCount = a;
  13942. this._rowCount = c;
  13943. this._columnWidth = d;
  13944. this._rowHeight = e
  13945. }
  13946. };
  13947. a.prototype.calculateRowAndColumn = function(a, d) {
  13948. var e = isNaN(this._horizontalGap) ?
  13949. 0 : this._horizontalGap,
  13950. m = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13951. this._rowCount = this._columnCount = -1;
  13952. for (var f = this.target.numElements, h = f, k = 0; k < h; k++) {
  13953. var n = this.target.getElementAt(k);
  13954. n && !n.includeInLayout && f--
  13955. }
  13956. if (0 == f) this._rowCount = this._columnCount = 0;
  13957. else {
  13958. (isNaN(this.explicitColumnWidth) || isNaN(this.explicitRowHeight)) && this.updateMaxElementSize();
  13959. isNaN(this.explicitColumnWidth) ? this._columnWidth = this.maxElementWidth : this._columnWidth = this.explicitColumnWidth;
  13960. isNaN(this.explicitRowHeight) ?
  13961. this._rowHeight = this.maxElementHeight : this._rowHeight = this.explicitRowHeight;
  13962. h = this._columnWidth + e;
  13963. 0 >= h && (h = 1);
  13964. k = this._rowHeight + m;
  13965. 0 >= k && (k = 1);
  13966. var n = this.orientation == c.TileOrientation.COLUMNS,
  13967. q = !isNaN(a),
  13968. p = !isNaN(d),
  13969. r = isNaN(this._padding) ? 0 : this._padding,
  13970. s = isNaN(this._paddingLeft) ? r : this._paddingLeft,
  13971. t = isNaN(this._paddingRight) ? r : this._paddingRight,
  13972. A = isNaN(this._paddingTop) ? r : this._paddingTop,
  13973. r = isNaN(this._paddingBottom) ? r : this._paddingBottom;
  13974. 0 < this._requestedColumnCount || 0 < this._requestedRowCount ?
  13975. (0 < this._requestedRowCount && (this._rowCount = Math.min(this._requestedRowCount, f)), 0 < this._requestedColumnCount && (this._columnCount = Math.min(this._requestedColumnCount, f))) : q || p ? !q || p && n ? (e = Math.max(0, d - A - r), this._rowCount = Math.floor((e + m) / k), this._rowCount = Math.max(1, Math.min(this._rowCount, f))) : (m = Math.max(0, a - s - t), this._columnCount = Math.floor((m + e) / h), this._columnCount = Math.max(1, Math.min(this._columnCount, f))) : (e = Math.sqrt(f * h * k), n ? this._rowCount = Math.max(1, Math.round(e / k)) : this._columnCount = Math.max(1,
  13976. Math.round(e / h))); - 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)));
  13977. 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)))
  13978. }
  13979. };
  13980. a.prototype.updateMaxElementSize = function() {
  13981. this.target && (this.useVirtualLayout ? this.updateMaxElementSizeVirtual() :
  13982. this.updateMaxElementSizeReal())
  13983. };
  13984. a.prototype.updateMaxElementSizeVirtual = function() {
  13985. var a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22;
  13986. this.maxElementWidth = Math.max(this.maxElementWidth, this.typicalLayoutRect ? this.typicalLayoutRect.width : 22);
  13987. this.maxElementHeight = Math.max(this.maxElementHeight, a);
  13988. if (-1 != this.startIndex && -1 != this.endIndex)
  13989. for (a = this.startIndex; a <= this.endIndex; a++) {
  13990. var c = this.target.getVirtualElementAt(a);
  13991. c && c.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth,
  13992. c.preferredWidth), this.maxElementHeight = Math.max(this.maxElementHeight, c.preferredHeight))
  13993. }
  13994. };
  13995. a.prototype.updateMaxElementSizeReal = function() {
  13996. for (var a = this.target.numElements, c = 0; c < a; c++) {
  13997. var d = this.target.getElementAt(c);
  13998. d && d.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, d.preferredWidth), this.maxElementHeight = Math.max(this.maxElementHeight, d.preferredHeight))
  13999. }
  14000. };
  14001. a.prototype.clearVirtualLayoutCache = function() {
  14002. d.prototype.clearVirtualLayoutCache.call(this);
  14003. this.maxElementHeight =
  14004. this.maxElementWidth = 0
  14005. };
  14006. a.prototype.scrollPositionChanged = function() {
  14007. d.prototype.scrollPositionChanged.call(this);
  14008. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  14009. };
  14010. a.prototype.getIndexInView = function() {
  14011. if (!this.target || 0 == this.target.numElements) return this.startIndex = this.endIndex = -1, !1;
  14012. var a = this.target.numElements;
  14013. if (!this.useVirtualLayout) return this.startIndex = 0, this.endIndex = a - 1, !1;
  14014. if (isNaN(this.target.width) || 0 == this.target.width ||
  14015. isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1, !1;
  14016. var d = this.startIndex,
  14017. e = this.endIndex,
  14018. m = isNaN(this._padding) ? 0 : this._padding,
  14019. f = isNaN(this._paddingLeft) ? m : this._paddingLeft,
  14020. m = isNaN(this._paddingTop) ? m : this._paddingTop,
  14021. h = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  14022. k = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  14023. if (this.orientation == c.TileOrientation.COLUMNS) {
  14024. h = this._columnWidth + h;
  14025. if (0 >= h) return this.startIndex = 0, this.endIndex = a - 1, !1;
  14026. k = this.target.horizontalScrollPosition +
  14027. this.target.width;
  14028. m = Math.floor((this.target.horizontalScrollPosition - f) / h);
  14029. 0 > m && (m = 0);
  14030. f = Math.ceil((k - f) / h);
  14031. 0 > f && (f = 0);
  14032. this.startIndex = Math.min(a - 1, Math.max(0, m * this._rowCount));
  14033. this.endIndex = Math.min(a - 1, Math.max(0, f * this._rowCount - 1))
  14034. } else {
  14035. h = this._rowHeight + k;
  14036. if (0 >= h) return this.startIndex = 0, this.endIndex = a - 1, !1;
  14037. k = this.target.verticalScrollPosition + this.target.height;
  14038. f = Math.floor((this.target.verticalScrollPosition - m) / h);
  14039. 0 > f && (f = 0);
  14040. m = Math.ceil((k - m) / h);
  14041. 0 > m && (m = 0);
  14042. this.startIndex = Math.min(a - 1, Math.max(0,
  14043. f * this._columnCount));
  14044. this.endIndex = Math.min(a - 1, Math.max(0, m * this._columnCount - 1))
  14045. }
  14046. return this.startIndex != d || this.endIndex != e
  14047. };
  14048. a.prototype.updateDisplayList = function(a, e) {
  14049. d.prototype.updateDisplayList.call(this, a, e);
  14050. if (this.target) {
  14051. var l = isNaN(this._padding) ? 0 : this._padding,
  14052. m = isNaN(this._paddingLeft) ? l : this._paddingLeft,
  14053. f = isNaN(this._paddingRight) ? l : this._paddingRight,
  14054. h = isNaN(this._paddingTop) ? l : this._paddingTop,
  14055. k = isNaN(this._paddingBottom) ? l : this._paddingBottom,
  14056. l = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  14057. n = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  14058. if (this.indexInViewCalculated) this.indexInViewCalculated = !1;
  14059. else {
  14060. this.calculateRowAndColumn(a, e);
  14061. if (0 == this._rowCount || 0 == this._columnCount) {
  14062. this.target.setContentSize(m + f, h + k);
  14063. return
  14064. }
  14065. this.adjustForJustify(a, e);
  14066. this.getIndexInView()
  14067. }
  14068. this.useVirtualLayout && (this.calculateRowAndColumn(a, e), this.adjustForJustify(a, e));
  14069. if (-1 == this.startIndex || -1 == this.endIndex) this.target.setContentSize(0, 0);
  14070. else {
  14071. this.target.setVirtualElementIndicesInView(this.startIndex,
  14072. this.endIndex);
  14073. for (var q, p, r, s = this.orientation == c.TileOrientation.COLUMNS, t = this.startIndex, A = this.startIndex; A <= this.endIndex; A++) q = this.useVirtualLayout ? this.target.getVirtualElementAt(A) : this.target.getElementAt(A), null != q && q.includeInLayout && (s ? (p = Math.ceil((t + 1) / this._rowCount) - 1, r = Math.ceil((t + 1) % this._rowCount) - 1, -1 == r && (r = this._rowCount - 1)) : (p = Math.ceil((t + 1) % this._columnCount) - 1, -1 == p && (p = this._columnCount - 1), r = Math.ceil((t + 1) / this._columnCount) - 1), p = p * (this._columnWidth + l) + m, r = r * (this._rowHeight +
  14074. n) + h, this.sizeAndPositionElement(q, p, r, this._columnWidth, this.rowHeight), t++);
  14075. h += k;
  14076. n = (this._rowHeight + n) * this._rowCount - n;
  14077. this.target.setContentSize(Math.ceil((this._columnWidth + l) * this._columnCount - l + (m + f)), Math.ceil(n + h))
  14078. }
  14079. }
  14080. };
  14081. a.prototype.sizeAndPositionElement = function(a, d, e, m, f) {
  14082. var h = NaN,
  14083. k = NaN;
  14084. this.horizontalAlign == c.HorizontalAlign.JUSTIFY ? h = m : isNaN(a.percentWidth) || (h = m * a.percentWidth * 0.01);
  14085. this.verticalAlign == c.VerticalAlign.JUSTIFY ? k = f : isNaN(a.percentHeight) || (k = f * a.percentHeight * 0.01);
  14086. a.setLayoutBoundsSize(Math.round(h),
  14087. Math.round(k));
  14088. h = d;
  14089. switch (this.horizontalAlign) {
  14090. case c.HorizontalAlign.RIGHT:
  14091. h += m - a.layoutBoundsWidth;
  14092. break;
  14093. case c.HorizontalAlign.CENTER:
  14094. h = d + (m - a.layoutBoundsWidth) / 2
  14095. }
  14096. d = e;
  14097. switch (this.verticalAlign) {
  14098. case c.VerticalAlign.BOTTOM:
  14099. d += f - a.layoutBoundsHeight;
  14100. break;
  14101. case c.VerticalAlign.MIDDLE:
  14102. d += (f - a.layoutBoundsHeight) / 2
  14103. }
  14104. a.setLayoutBoundsPosition(Math.round(h), Math.round(d))
  14105. };
  14106. a.prototype.adjustForJustify = function(a, d) {
  14107. var e = isNaN(this._padding) ? 0 : this._padding,
  14108. m = isNaN(this._paddingLeft) ? e : this._paddingLeft,
  14109. f = isNaN(this._paddingRight) ? e : this._paddingRight,
  14110. h = isNaN(this._paddingTop) ? e : this._paddingTop,
  14111. e = isNaN(this._paddingBottom) ? e : this._paddingBottom,
  14112. m = Math.max(0, a - m - f),
  14113. h = Math.max(0, d - h - e);
  14114. isNaN(this.explicitVerticalGap) || (this._verticalGap = this.explicitVerticalGap);
  14115. isNaN(this.explicitHorizontalGap) || (this._horizontalGap = this.explicitHorizontalGap);
  14116. this._verticalGap = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  14117. this._horizontalGap = isNaN(this._horizontalGap) ? 0 : this._horizontalGap;
  14118. h -= this._rowHeight * this._rowCount;
  14119. m -= this._columnWidth * this._columnCount;
  14120. 0 < h && (this.rowAlign == c.RowAlign.JUSTIFY_USING_GAP ? (f = Math.max(1, this._rowCount - 1), this._verticalGap = h / f) : this.rowAlign == c.RowAlign.JUSTIFY_USING_HEIGHT && 0 < this._rowCount && (this._rowHeight += (h - (this._rowCount - 1) * this._verticalGap) / this._rowCount));
  14121. 0 < m && (this.columnAlign == c.ColumnAlign.JUSTIFY_USING_GAP ? (f = Math.max(1, this._columnCount - 1), this._horizontalGap = m / f) : this.columnAlign == c.ColumnAlign.JUSTIFY_USING_WIDTH && 0 < this._columnCount && (this._columnWidth += (m - (this._columnCount -
  14122. 1) * this._horizontalGap) / this._columnCount))
  14123. };
  14124. return a
  14125. }(c.LayoutBase);
  14126. c.TileLayout = e
  14127. })(egret || (egret = {}));
  14128. (function(c) {
  14129. var e = function() {
  14130. function c(a, b, d) {
  14131. this.raw_getElementAt = "raw_getElementAt";
  14132. this.raw_addElementAt = "raw_addElementAt";
  14133. this.raw_getElementIndex = "raw_getElementIndex";
  14134. this.raw_removeElement = "raw_removeElement";
  14135. this.raw_removeElementAt = "raw_removeElementAt";
  14136. this.raw_setElementIndex = "raw_setElementIndex";
  14137. this.owner = a;
  14138. this.lowerBoundReference = b;
  14139. this.upperBoundReference = d
  14140. }
  14141. Object.defineProperty(c.prototype, "numElements", {
  14142. get: function() {
  14143. return this.owner[this.upperBoundReference] - this.owner[this.lowerBoundReference]
  14144. },
  14145. enumerable: !0,
  14146. configurable: !0
  14147. });
  14148. c.prototype.getElementAt = function(a) {
  14149. return this.owner[this.raw_getElementAt](this.owner[this.lowerBoundReference] + a)
  14150. };
  14151. c.prototype.addElement = function(a) {
  14152. var b = this.owner[this.upperBoundReference];
  14153. a.parent === this.owner && b--;
  14154. this.owner[this.upperBoundReference]++;
  14155. this.owner[this.raw_addElementAt](a, b);
  14156. a.ownerChanged(this);
  14157. return a
  14158. };
  14159. c.prototype.addElementAt = function(a, b) {
  14160. this.owner[this.upperBoundReference]++;
  14161. this.owner[this.raw_addElementAt](a, this.owner[this.lowerBoundReference] +
  14162. b);
  14163. a.ownerChanged(this);
  14164. return a
  14165. };
  14166. c.prototype.removeElement = function(a) {
  14167. var b = this.owner[this.raw_getElementIndex](a);
  14168. this.owner[this.lowerBoundReference] <= b && b < this.owner[this.upperBoundReference] && (this.owner[this.raw_removeElement](a), this.owner[this.upperBoundReference]--);
  14169. a.ownerChanged(null);
  14170. return a
  14171. };
  14172. c.prototype.removeElementAt = function(a) {
  14173. a += this.owner[this.lowerBoundReference];
  14174. var b;
  14175. this.owner[this.lowerBoundReference] <= a && a < this.owner[this.upperBoundReference] && (b = this.owner[this.raw_removeElementAt](a),
  14176. this.owner[this.upperBoundReference]--);
  14177. b.ownerChanged(null);
  14178. return b
  14179. };
  14180. c.prototype.getElementIndex = function(a) {
  14181. a = this.owner[this.raw_getElementIndex](a);
  14182. return a -= this.owner[this.lowerBoundReference]
  14183. };
  14184. c.prototype.setElementIndex = function(a, b) {
  14185. this.owner[this.raw_setElementIndex](a, this.owner[this.lowerBoundReference] + b)
  14186. };
  14187. return c
  14188. }();
  14189. c.UILayer = e
  14190. })(egret || (egret = {}));
  14191. __extends = this.__extends || function(c, e) {
  14192. function d() {
  14193. this.constructor = c
  14194. }
  14195. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14196. d.prototype = e.prototype;
  14197. c.prototype = new d
  14198. };
  14199. (function(c) {
  14200. var e = function(d) {
  14201. function a() {
  14202. d.call(this);
  14203. this._autoResize = !0;
  14204. this._cursorIndex = this._toolTipIndex = this._topMostIndex = this._noTopMostIndex = 0;
  14205. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  14206. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this)
  14207. }
  14208. __extends(a, d);
  14209. a.prototype.onAddToStage = function(a) {
  14210. 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");
  14211. c.UIGlobals._uiStage = this;
  14212. this._autoResize && (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize())
  14213. };
  14214. a.prototype.onRemoveFromStage = function(a) {
  14215. c.UIGlobals._uiStage = null;
  14216. this._autoResize && this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)
  14217. };
  14218. a.prototype.onResize = function(a) {
  14219. this._setWidth(this.stage.stageWidth);
  14220. this._setHeight(this.stage.stageHeight)
  14221. };
  14222. Object.defineProperty(a.prototype, "autoResize", {
  14223. get: function() {
  14224. return this._autoResize
  14225. },
  14226. set: function(a) {
  14227. this._autoResize !=
  14228. 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)))
  14229. },
  14230. enumerable: !0,
  14231. configurable: !0
  14232. });
  14233. Object.defineProperty(a.prototype, "x", {
  14234. get: function() {
  14235. return this._x
  14236. },
  14237. set: function(a) {
  14238. this._autoResize || (this._x = a)
  14239. },
  14240. enumerable: !0,
  14241. configurable: !0
  14242. });
  14243. Object.defineProperty(a.prototype, "y", {
  14244. get: function() {
  14245. return this._y
  14246. },
  14247. set: function(a) {
  14248. this._autoResize || (this._y = a)
  14249. },
  14250. enumerable: !0,
  14251. configurable: !0
  14252. });
  14253. Object.defineProperty(a.prototype, "width", {
  14254. get: function() {
  14255. return this._width
  14256. },
  14257. set: function(a) {
  14258. this._autoResize || this._setWidth(a)
  14259. },
  14260. enumerable: !0,
  14261. configurable: !0
  14262. });
  14263. Object.defineProperty(a.prototype, "height", {
  14264. get: function() {
  14265. return this._height
  14266. },
  14267. set: function(a) {
  14268. this._autoResize || this._setHeight(a)
  14269. },
  14270. enumerable: !0,
  14271. configurable: !0
  14272. });
  14273. Object.defineProperty(a.prototype, "scaleX", {
  14274. get: function() {
  14275. return this._scaleX
  14276. },
  14277. set: function(a) {
  14278. this._autoResize || this._setScaleX(a)
  14279. },
  14280. enumerable: !0,
  14281. configurable: !0
  14282. });
  14283. Object.defineProperty(a.prototype, "scaleY", {
  14284. get: function() {
  14285. return this._scaleY
  14286. },
  14287. set: function(a) {
  14288. this._autoResize || this._setScaleY(a)
  14289. },
  14290. enumerable: !0,
  14291. configurable: !0
  14292. });
  14293. a.prototype.setActualSize = function(a, c) {
  14294. this._autoResize || d.prototype.setActualSize.call(this, a, c)
  14295. };
  14296. a.prototype.setLayoutBoundsPosition = function(a, c) {
  14297. this._autoResize || d.prototype.setLayoutBoundsPosition.call(this, a, c)
  14298. };
  14299. a.prototype.setLayoutBoundsSize = function(a, c) {
  14300. this._autoResize || d.prototype.setLayoutBoundsSize.call(this,
  14301. a, c)
  14302. };
  14303. Object.defineProperty(a.prototype, "layout", {
  14304. get: function() {
  14305. return this._layout
  14306. },
  14307. set: function(a) {
  14308. a instanceof c.BasicLayout && this._setLayout(a)
  14309. },
  14310. enumerable: !0,
  14311. configurable: !0
  14312. });
  14313. Object.defineProperty(a.prototype, "popUpContainer", {
  14314. get: function() {
  14315. this._popUpContainer || (this._popUpContainer = new c.UILayer(this, "noTopMostIndex", "topMostIndex"));
  14316. return this._popUpContainer
  14317. },
  14318. enumerable: !0,
  14319. configurable: !0
  14320. });
  14321. Object.defineProperty(a.prototype, "toolTipContainer", {
  14322. get: function() {
  14323. this._toolTipContainer || (this._toolTipContainer =
  14324. new c.UILayer(this, "topMostIndex", "toolTipIndex"));
  14325. return this._toolTipContainer
  14326. },
  14327. enumerable: !0,
  14328. configurable: !0
  14329. });
  14330. Object.defineProperty(a.prototype, "cursorContainer", {
  14331. get: function() {
  14332. this._cursorContainer || (this._cursorContainer = new c.UILayer(this, "toolTipIndex", "cursorIndex"));
  14333. return this._cursorContainer
  14334. },
  14335. enumerable: !0,
  14336. configurable: !0
  14337. });
  14338. Object.defineProperty(a.prototype, "noTopMostIndex", {
  14339. get: function() {
  14340. return this._noTopMostIndex
  14341. },
  14342. set: function(a) {
  14343. var c = a - this._noTopMostIndex;
  14344. this._noTopMostIndex =
  14345. a;
  14346. this.topMostIndex += c
  14347. },
  14348. enumerable: !0,
  14349. configurable: !0
  14350. });
  14351. Object.defineProperty(a.prototype, "topMostIndex", {
  14352. get: function() {
  14353. return this._topMostIndex
  14354. },
  14355. set: function(a) {
  14356. var c = a - this._topMostIndex;
  14357. this._topMostIndex = a;
  14358. this.toolTipIndex += c
  14359. },
  14360. enumerable: !0,
  14361. configurable: !0
  14362. });
  14363. Object.defineProperty(a.prototype, "toolTipIndex", {
  14364. get: function() {
  14365. return this._toolTipIndex
  14366. },
  14367. set: function(a) {
  14368. var c = a - this._toolTipIndex;
  14369. this._toolTipIndex = a;
  14370. this.cursorIndex += c
  14371. },
  14372. enumerable: !0,
  14373. configurable: !0
  14374. });
  14375. Object.defineProperty(a.prototype,
  14376. "cursorIndex", {
  14377. get: function() {
  14378. return this._cursorIndex
  14379. },
  14380. set: function(a) {
  14381. this._cursorIndex = a
  14382. },
  14383. enumerable: !0,
  14384. configurable: !0
  14385. });
  14386. a.prototype.addElement = function(a) {
  14387. var c = this._noTopMostIndex;
  14388. a.parent == this && c--;
  14389. return this.addElementAt(a, c)
  14390. };
  14391. a.prototype.addElementAt = function(a, c) {
  14392. if (a.parent == this) {
  14393. var e = this.getElementIndex(a);
  14394. e < this._noTopMostIndex ? this.noTopMostIndex-- : e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex-- : e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex-- :
  14395. this.cursorIndex--
  14396. }
  14397. c <= this._noTopMostIndex ? this.noTopMostIndex++ : c > this._noTopMostIndex && c <= this._topMostIndex ? this.topMostIndex++ : c > this._topMostIndex && c <= this._toolTipIndex ? this.toolTipIndex++ : this.cursorIndex++;
  14398. return d.prototype.addElementAt.call(this, a, c)
  14399. };
  14400. a.prototype.removeElement = function(a) {
  14401. return this.removeElementAt(d.prototype.getElementIndex.call(this, a))
  14402. };
  14403. a.prototype.removeElementAt = function(a) {
  14404. var c = d.prototype.removeElementAt.call(this, a);
  14405. a < this._noTopMostIndex ? this.noTopMostIndex-- :
  14406. a >= this._noTopMostIndex && a < this._topMostIndex ? this.topMostIndex-- : a >= this._topMostIndex && a < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--;
  14407. return c
  14408. };
  14409. a.prototype.removeAllElements = function() {
  14410. for (; 0 < this._noTopMostIndex;) d.prototype.removeElementAt.call(this, 0), this.noTopMostIndex--
  14411. };
  14412. a.prototype._elementRemoved = function(a, e, l) {
  14413. "undefined" === typeof l && (l = !0);
  14414. l && c.Event.dispatchEvent(a, "removeFromUIStage");
  14415. d.prototype._elementRemoved.call(this, a, e, l)
  14416. };
  14417. a.prototype.raw_getElementAt = function(a) {
  14418. return d.prototype.getElementAt.call(this,
  14419. a)
  14420. };
  14421. a.prototype.raw_addElement = function(a) {
  14422. var c = this.numElements;
  14423. a.parent == this && c--;
  14424. return this.raw_addElementAt(a, c)
  14425. };
  14426. a.prototype.raw_addElementAt = function(a, c) {
  14427. if (a.parent == this) {
  14428. var e = this.getElementIndex(a);
  14429. e < this._noTopMostIndex ? this.noTopMostIndex-- : e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex-- : e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--
  14430. }
  14431. return d.prototype.addElementAt.call(this, a, c)
  14432. };
  14433. a.prototype.raw_removeElement = function(a) {
  14434. return d.prototype.removeElementAt.call(this,
  14435. d.prototype.getElementIndex.call(this, a))
  14436. };
  14437. a.prototype.raw_removeElementAt = function(a) {
  14438. return d.prototype.removeElementAt.call(this, a)
  14439. };
  14440. a.prototype.raw_removeAllElements = function() {
  14441. for (; 0 < this.numElements;) d.prototype.removeElementAt.call(this, 0)
  14442. };
  14443. a.prototype.raw_getElementIndex = function(a) {
  14444. return d.prototype.getElementIndex.call(this, a)
  14445. };
  14446. a.prototype.raw_setElementIndex = function(a, c) {
  14447. d.prototype.setElementIndex.call(this, a, c)
  14448. };
  14449. a.prototype.raw_swapElements = function(a, c) {
  14450. d.prototype.swapElementsAt.call(this,
  14451. d.prototype.getElementIndex.call(this, a), d.prototype.getElementIndex.call(this, c))
  14452. };
  14453. a.prototype.raw_swapElementsAt = function(a, c) {
  14454. d.prototype.swapElementsAt.call(this, a, c)
  14455. };
  14456. return a
  14457. }(c.Group);
  14458. c.UIStage = e
  14459. })(egret || (egret = {}));
  14460. __extends = this.__extends || function(c, e) {
  14461. function d() {
  14462. this.constructor = c
  14463. }
  14464. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14465. d.prototype = e.prototype;
  14466. c.prototype = new d
  14467. };
  14468. (function(c) {
  14469. var e = function(a) {
  14470. function b() {
  14471. a.call(this);
  14472. this._popUpList = [];
  14473. this.popUpDataList = [];
  14474. this._modalColor = 0;
  14475. this._modalAlpha = 0.5;
  14476. this.invalidateModalFlag = !1
  14477. }
  14478. __extends(b, a);
  14479. Object.defineProperty(b.prototype, "popUpList", {
  14480. get: function() {
  14481. return this._popUpList.concat()
  14482. },
  14483. enumerable: !0,
  14484. configurable: !0
  14485. });
  14486. b.prototype.findPopUpData = function(a) {
  14487. for (var b = this.popUpDataList, c = b.length, d = 0; d < c; d++) {
  14488. var e = b[d];
  14489. if (e.popUp == a) return e
  14490. }
  14491. return null
  14492. };
  14493. b.prototype.addPopUp = function(a, e, m) {
  14494. "undefined" === typeof e &&
  14495. (e = !1);
  14496. "undefined" === typeof m && (m = !0);
  14497. var f = c.UIGlobals.uiStage,
  14498. h = this.findPopUpData(a);
  14499. h ? (h.modal = e, a.removeEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this)) : (h = new d(a, e), this.popUpDataList.push(h), this._popUpList.push(a));
  14500. f.popUpContainer.addElement(a);
  14501. m && this.centerPopUp(a);
  14502. "isPopUp" in a && (a.isPopUp = !0);
  14503. e && this.invalidateModal();
  14504. a.addEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this)
  14505. };
  14506. b.prototype.onRemoved = function(a) {
  14507. for (var c = 0, d = this.popUpDataList, e = d.length, h = 0; h < e; h++) {
  14508. var k =
  14509. d[h];
  14510. if (k.popUp == a.target) {
  14511. "isPopUp" in k.popUp && (k.popUp.isPopUp = !1);
  14512. k.popUp.removeEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this);
  14513. this.popUpDataList.splice(c, 1);
  14514. this._popUpList.splice(c, 1);
  14515. this.invalidateModal();
  14516. break
  14517. }
  14518. c++
  14519. }
  14520. };
  14521. Object.defineProperty(b.prototype, "modalColor", {
  14522. get: function() {
  14523. return this._modalColor
  14524. },
  14525. set: function(a) {
  14526. this._modalColor != a && (this._modalColor = a, this.invalidateModal())
  14527. },
  14528. enumerable: !0,
  14529. configurable: !0
  14530. });
  14531. Object.defineProperty(b.prototype, "modalAlpha", {
  14532. get: function() {
  14533. return this._modalAlpha
  14534. },
  14535. set: function(a) {
  14536. this._modalAlpha != a && (this._modalAlpha = a, this.invalidateModal())
  14537. },
  14538. enumerable: !0,
  14539. configurable: !0
  14540. });
  14541. b.prototype.invalidateModal = function() {
  14542. 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())
  14543. };
  14544. b.prototype.validateModal = function(a) {
  14545. this.invalidateModalFlag = !1;
  14546. c.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME,
  14547. this.validateModal, this);
  14548. c.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.validateModal, this);
  14549. this.updateModal(c.UIGlobals.uiStage)
  14550. };
  14551. b.prototype.updateModal = function(a) {
  14552. for (var b = a.popUpContainer, d = !1, e = b.numElements - 1; 0 <= e; e--) {
  14553. var h = b.getElementAt(e);
  14554. if ((h = this.findPopUpData(h)) && h.modal) {
  14555. d = !0;
  14556. break
  14557. }
  14558. }
  14559. 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,
  14560. 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)
  14561. };
  14562. b.prototype.removePopUp = function(a) {
  14563. 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))
  14564. };
  14565. b.prototype.centerPopUp = function(a) {
  14566. a.top = a.bottom = a.left = a.right = NaN;
  14567. a.verticalCenter = a.horizontalCenter = 0;
  14568. var b = a.parent;
  14569. b && ("validateNow" in a && a.validateNow(), a.x = 0.5 * (b.width - a.layoutBoundsWidth), a.y = 0.5 * (b.height - a.layoutBoundsHeight))
  14570. };
  14571. b.prototype.bringToFront = function(a) {
  14572. if (this.findPopUpData(a) && a.parent && "popUpContainer" in a.parent) {
  14573. var b = a.parent;
  14574. b.popUpContainer.setElementIndex(a, b.popUpContainer.numElements - 1);
  14575. this.invalidateModal()
  14576. }
  14577. };
  14578. b.REMOVE_FROM_UISTAGE = "removeFromUIStage";
  14579. return b
  14580. }(c.EventDispatcher);
  14581. c.PopUpManagerImpl = e;
  14582. var d = function() {
  14583. return function(a, b) {
  14584. this.popUp = a;
  14585. this.modal = b
  14586. }
  14587. }()
  14588. })(egret || (egret = {}));
  14589. (function(c) {
  14590. var e = function() {
  14591. function d() {}
  14592. d.getImpl = function() {
  14593. if (!d._impl) try {
  14594. d._impl = c.Injector.getInstance("egret.IPopUpManager")
  14595. } catch (a) {
  14596. d._impl = new c.PopUpManagerImpl
  14597. }
  14598. return d._impl
  14599. };
  14600. Object.defineProperty(d.prototype, "modalColor", {
  14601. get: function() {
  14602. return d.getImpl().modalColor
  14603. },
  14604. set: function(a) {
  14605. d.getImpl().modalColor = a
  14606. },
  14607. enumerable: !0,
  14608. configurable: !0
  14609. });
  14610. Object.defineProperty(d.prototype, "modalAlpha", {
  14611. get: function() {
  14612. return d.getImpl().modalAlpha
  14613. },
  14614. set: function(a) {
  14615. d.getImpl().modalAlpha = a
  14616. },
  14617. enumerable: !0,
  14618. configurable: !0
  14619. });
  14620. d.addPopUp = function(a, b, e) {
  14621. "undefined" === typeof b && (b = !1);
  14622. "undefined" === typeof e && (e = !0);
  14623. d.getImpl().addPopUp(a, b, e);
  14624. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.ADD_POPUP, a, b)
  14625. };
  14626. d.removePopUp = function(a) {
  14627. d.getImpl().removePopUp(a);
  14628. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.REMOVE_POPUP, a)
  14629. };
  14630. d.centerPopUp = function(a) {
  14631. d.getImpl().centerPopUp(a)
  14632. };
  14633. d.bringToFront = function(a) {
  14634. d.getImpl().bringToFront(a);
  14635. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.BRING_TO_FRONT,
  14636. a)
  14637. };
  14638. Object.defineProperty(d, "popUpList", {
  14639. get: function() {
  14640. return d.getImpl().popUpList
  14641. },
  14642. enumerable: !0,
  14643. configurable: !0
  14644. });
  14645. d.addEventListener = function(a, b, c, e, m) {
  14646. "undefined" === typeof e && (e = !1);
  14647. "undefined" === typeof m && (m = 0);
  14648. d.getImpl().addEventListener(a, b, this, e, m)
  14649. };
  14650. d.removeEventListener = function(a, b, c, e) {
  14651. "undefined" === typeof e && (e = !1);
  14652. d.getImpl().removeEventListener(a, b, c, e)
  14653. };
  14654. return d
  14655. }();
  14656. c.PopUpManager = e
  14657. })(egret || (egret = {}));
  14658. var __extends = this.__extends || function(c, e) {
  14659. function d() {
  14660. this.constructor = c
  14661. }
  14662. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14663. d.prototype = e.prototype;
  14664. c.prototype = new d
  14665. },
  14666. dragonBones;
  14667. (function(c) {
  14668. (function(a) {
  14669. var b = function() {
  14670. function a(b, c) {
  14671. "undefined" === typeof b && (b = 0);
  14672. "undefined" === typeof c && (c = 0);
  14673. this.x = b;
  14674. this.y = c
  14675. }
  14676. a.prototype.toString = function() {
  14677. return "[Point (x=" + this.x + " y=" + this.y + ")]"
  14678. };
  14679. return a
  14680. }();
  14681. a.Point = b;
  14682. b = function() {
  14683. return function(a, b, c, d) {
  14684. "undefined" === typeof a && (a = 0);
  14685. "undefined" === typeof b && (b = 0);
  14686. "undefined" === typeof c && (c = 0);
  14687. "undefined" === typeof d && (d = 0);
  14688. this.x = a;
  14689. this.y = b;
  14690. this.width = c;
  14691. this.height = d
  14692. }
  14693. }();
  14694. a.Rectangle = b;
  14695. b = function() {
  14696. function a() {
  14697. this.a = 1;
  14698. this.c = this.b =
  14699. 0;
  14700. this.d = 1;
  14701. this.ty = this.tx = 0
  14702. }
  14703. a.prototype.invert = function() {
  14704. var a = this.a,
  14705. b = this.b,
  14706. c = this.c,
  14707. d = this.d,
  14708. e = this.tx,
  14709. g = a * d - b * c;
  14710. this.a = d / g;
  14711. this.b = -b / g;
  14712. this.c = -c / g;
  14713. this.d = a / g;
  14714. this.tx = (c * this.ty - d * e) / g;
  14715. this.ty = -(a * this.ty - b * e) / g
  14716. };
  14717. return a
  14718. }();
  14719. a.Matrix = b;
  14720. b = function() {
  14721. return function() {
  14722. this.redOffset = this.redMultiplier = this.greenOffset = this.greenMultiplier = this.blueOffset = this.blueMultiplier = this.alphaOffset = this.alphaMultiplier = 0
  14723. }
  14724. }();
  14725. a.ColorTransform = b
  14726. })(c.geom || (c.geom = {}));
  14727. var e = c.geom;
  14728. (function(a) {
  14729. var b = function() {
  14730. return function(a) {
  14731. this.type =
  14732. a
  14733. }
  14734. }();
  14735. a.Event = b;
  14736. var c = function(a) {
  14737. function b(c) {
  14738. a.call(this, c)
  14739. }
  14740. __extends(b, a);
  14741. b.FADE_IN = "fadeIn";
  14742. b.FADE_OUT = "fadeOut";
  14743. b.START = "start";
  14744. b.COMPLETE = "complete";
  14745. b.LOOP_COMPLETE = "loopComplete";
  14746. b.FADE_IN_COMPLETE = "fadeInComplete";
  14747. b.FADE_OUT_COMPLETE = "fadeOutComplete";
  14748. return b
  14749. }(b);
  14750. a.AnimationEvent = c;
  14751. c = function(a) {
  14752. function b(c) {
  14753. a.call(this, c)
  14754. }
  14755. __extends(b, a);
  14756. b.Z_ORDER_UPDATED = "zOrderUpdated";
  14757. return b
  14758. }(b);
  14759. a.ArmatureEvent = c;
  14760. c = function(a) {
  14761. function b(c) {
  14762. a.call(this, c)
  14763. }
  14764. __extends(b, a);
  14765. b.ANIMATION_FRAME_EVENT = "animationFrameEvent";
  14766. b.BONE_FRAME_EVENT = "boneFrameEvent";
  14767. return b
  14768. }(b);
  14769. a.FrameEvent = c;
  14770. b = function(a) {
  14771. function b(c) {
  14772. a.call(this, c)
  14773. }
  14774. __extends(b, a);
  14775. b.SOUND = "sound";
  14776. b.BONE_FRAME_EVENT = "boneFrameEvent";
  14777. return b
  14778. }(b);
  14779. a.SoundEvent = b;
  14780. b = function() {
  14781. function a() {}
  14782. a.prototype.hasEventListener = function(a) {
  14783. return this._listenersMap && this._listenersMap[a] ? !0 : !1
  14784. };
  14785. a.prototype.addEventListener = function(a, b) {
  14786. if (a && b) {
  14787. this._listenersMap || (this._listenersMap = {});
  14788. var c = this._listenersMap[a];
  14789. c && this.removeEventListener(a, b);
  14790. c ? c.push(b) : this._listenersMap[a] = [b]
  14791. }
  14792. };
  14793. a.prototype.removeEventListener = function(a, b) {
  14794. if (this._listenersMap && a && b) {
  14795. var c = this._listenersMap[a];
  14796. if (c)
  14797. for (var d = c.length, e = 0; e < d; e++) c[e] == b && (1 == d ? (c.length = 0, delete this._listenersMap[a]) : c.splice(e, 1))
  14798. }
  14799. };
  14800. a.prototype.removeAllEventListeners = function(a) {
  14801. a ? delete this._listenersMap[a] : this._listenersMap = null
  14802. };
  14803. a.prototype.dispatchEvent = function(a) {
  14804. if (a) {
  14805. var b = this._listenersMap[a.type];
  14806. if (b) {
  14807. a.target = this;
  14808. for (var c = b.concat(), b = b.length, d = 0; d < b; d++) c[d](a)
  14809. }
  14810. }
  14811. };
  14812. return a
  14813. }();
  14814. a.EventDispatcher =
  14815. b;
  14816. b = function(a) {
  14817. function b() {
  14818. a.call(this);
  14819. if (b._instance) throw Error("Singleton already constructed!");
  14820. }
  14821. __extends(b, a);
  14822. b.getInstance = function() {
  14823. b._instance || (b._instance = new b);
  14824. return b._instance
  14825. };
  14826. return b
  14827. }(b);
  14828. a.SoundEventManager = b
  14829. })(c.events || (c.events = {}));
  14830. var d = c.events;
  14831. (function(a) {
  14832. var c = function() {
  14833. function a() {
  14834. this.timeScale = 1;
  14835. this.time = 0.001 * (new Date).getTime();
  14836. this._animatableList = []
  14837. }
  14838. a.prototype.contains = function(a) {
  14839. return 0 <= this._animatableList.indexOf(a)
  14840. };
  14841. a.prototype.add = function(a) {
  14842. a &&
  14843. -1 == this._animatableList.indexOf(a) && this._animatableList.push(a)
  14844. };
  14845. a.prototype.remove = function(a) {
  14846. a = this._animatableList.indexOf(a);
  14847. 0 <= a && (this._animatableList[a] = null)
  14848. };
  14849. a.prototype.clear = function() {
  14850. this._animatableList.length = 0
  14851. };
  14852. a.prototype.advanceTime = function(a) {
  14853. if (0 > a) {
  14854. var b = 0.001 * (new Date).getTime();
  14855. a = b - this.time;
  14856. this.time = b
  14857. }
  14858. a *= this.timeScale;
  14859. b = this._animatableList.length;
  14860. if (0 != b) {
  14861. for (var c = 0, d = 0; d < b; d++) {
  14862. var e = this._animatableList[d];
  14863. e && (c != d && (this._animatableList[c] = e, this._animatableList[d] =
  14864. null), e.advanceTime(a), c++)
  14865. }
  14866. if (c != d) {
  14867. for (b = this._animatableList.length; d < b;) this._animatableList[c++] = this._animatableList[d++];
  14868. this._animatableList.length = c
  14869. }
  14870. }
  14871. };
  14872. a.clock = new a;
  14873. return a
  14874. }();
  14875. a.WorldClock = c;
  14876. var l = function() {
  14877. function a() {
  14878. this.transform = new b.DBTransform;
  14879. this.pivot = new e.Point;
  14880. this._durationTransform = new b.DBTransform;
  14881. this._durationPivot = new e.Point;
  14882. this._durationColor = new e.ColorTransform
  14883. }
  14884. a._borrowObject = function() {
  14885. return 0 == a._pool.length ? new a : a._pool.pop()
  14886. };
  14887. a._returnObject = function(b) {
  14888. 0 >
  14889. a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  14890. b.clear()
  14891. };
  14892. a._clear = function() {
  14893. for (var b = a._pool.length; b--;) a._pool[b].clear();
  14894. a._pool.length = 0
  14895. };
  14896. a.getEaseValue = function(b, c) {
  14897. if (1 < c) {
  14898. var d = 0.5 * (1 - Math.cos(b * Math.PI)) - b;
  14899. c -= 1
  14900. } else 0 < c ? d = Math.sin(b * a.HALF_PI) - b : 0 > c && (d = 1 - Math.cos(b * a.HALF_PI) - b, c *= -1);
  14901. return d * c + b
  14902. };
  14903. a.prototype.fadeIn = function(a, b, c) {
  14904. this._bone = a;
  14905. this._animationState = b;
  14906. this._timeline = c;
  14907. this._originTransform = this._timeline.originTransform;
  14908. this._originPivot = this._timeline.originPivot;
  14909. this._tweenColor =
  14910. this._tweenTransform = !1;
  14911. this._totalTime = this._animationState.totalTime;
  14912. this.transform.x = 0;
  14913. this.transform.y = 0;
  14914. this.transform.scaleX = 0;
  14915. this.transform.scaleY = 0;
  14916. this.transform.skewX = 0;
  14917. this.transform.skewY = 0;
  14918. this.pivot.x = 0;
  14919. this.pivot.y = 0;
  14920. this._durationTransform.x = 0;
  14921. this._durationTransform.y = 0;
  14922. this._durationTransform.scaleX = 0;
  14923. this._durationTransform.scaleY = 0;
  14924. this._durationTransform.skewX = 0;
  14925. this._durationTransform.skewY = 0;
  14926. this._durationPivot.x = 0;
  14927. this._durationPivot.y = 0;
  14928. this._currentFrame = null;
  14929. switch (this._timeline.getFrameList().length) {
  14930. case 0:
  14931. this._bone._arriveAtFrame(null,
  14932. this, this._animationState, !1);
  14933. this._updateState = 0;
  14934. break;
  14935. case 1:
  14936. this._updateState = -1;
  14937. break;
  14938. default:
  14939. this._updateState = 1
  14940. }
  14941. };
  14942. a.prototype.fadeOut = function() {
  14943. this.transform.skewX = g.TransformUtil.formatRadian(this.transform.skewX);
  14944. this.transform.skewY = g.TransformUtil.formatRadian(this.transform.skewY)
  14945. };
  14946. a.prototype.update = function(b) {
  14947. if (this._updateState)
  14948. if (0 < this._updateState) {
  14949. b = 0 == this._timeline.scale ? 1 : b / this._timeline.scale;
  14950. 1 == b && (b = 0.99999999);
  14951. b += this._timeline.offset;
  14952. var c = Math.floor(b);
  14953. b -= c;
  14954. for (var d =
  14955. this._totalTime * b, e = !1, l; !this._currentFrame || d > this._currentFramePosition + this._currentFrameDuration || d < this._currentFramePosition;) e && this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !0), e = !0, this._currentFrame ? (l = this._timeline.getFrameList().indexOf(this._currentFrame) + 1, l >= this._timeline.getFrameList().length && (l = 0), this._currentFrame = this._timeline.getFrameList()[l]) : (l = 0, this._currentFrame = this._timeline.getFrameList()[0]), this._currentFrameDuration = this._currentFrame.duration,
  14956. this._currentFramePosition = this._currentFrame.position;
  14957. e && (this.tweenActive = 0 <= this._currentFrame.displayIndex, l++, l >= this._timeline.getFrameList().length && (l = 0), e = this._timeline.getFrameList()[l], 0 == l && 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 ||
  14958. 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,
  14959. 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 == l && (this._durationTransform.skewX = g.TransformUtil.formatRadian(this._durationTransform.skewX), this._durationTransform.skewY = g.TransformUtil.formatRadian(this._durationTransform.skewY)), this._durationPivot.x = e.pivot.x - this._currentFrame.pivot.x,
  14960. 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 -
  14961. 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,
  14962. 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,
  14963. 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) :
  14964. 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 ||
  14965. (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,
  14966. 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)),
  14967. 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,
  14968. this._animationState, !1));
  14969. if (this._tweenTransform || this._tweenColor) b = (d - this._currentFramePosition) / this._currentFrameDuration, this._tweenEasing && (b = a.getEaseValue(b, this._tweenEasing));
  14970. 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 *
  14971. 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 =
  14972. 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));
  14973. this._tweenColor && (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset + this._durationColor.alphaOffset * b, this._currentFrame.color.redOffset + this._durationColor.redOffset *
  14974. 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 *
  14975. 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))
  14976. } else this._updateState = 0, 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 =
  14977. this.transform.scaleX = this.transform.scaleY = 0, this.pivot.x = 0, this.pivot.y = 0), this._currentFrame = this._timeline.getFrameList()[0], this.tweenActive = 0 <= this._currentFrame.displayIndex, 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), this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1)
  14978. };
  14979. a.prototype.clear = function() {
  14980. this._updateState = 0;
  14981. this._originPivot = this._originTransform = this._currentFrame = this._timeline = this._animationState = this._bone = null
  14982. };
  14983. a.HALF_PI = 0.5 * Math.PI;
  14984. a._pool = [];
  14985. return a
  14986. }();
  14987. a.TimelineState = l;
  14988. var f = function() {
  14989. function a() {
  14990. this.layer = this.loop = 0;
  14991. this._timelineStates = {}
  14992. }
  14993. a._borrowObject = function() {
  14994. return 0 == a._pool.length ? new a : a._pool.pop()
  14995. };
  14996. a._returnObject =
  14997. function(b) {
  14998. 0 > a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  14999. b.clear()
  15000. };
  15001. a._clear = function() {
  15002. for (var b = a._pool.length; b--;) a._pool[b].clear();
  15003. a._pool.length = 0
  15004. };
  15005. a.prototype.fadeIn = function(a, b, c, d, e, g, l, f) {
  15006. this.layer = g;
  15007. this.clip = b;
  15008. this.name = this.clip.name;
  15009. this.totalTime = this.clip.duration;
  15010. this._armature = a;
  15011. 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);
  15012. this._pauseBeforeFadeInComplete = f;
  15013. this._fadeInTime = c * this.timeScale;
  15014. this._fadeState = 1;
  15015. this._fadeOutBeginTime = 0;
  15016. this._fadeOutWeight = -1;
  15017. this._fadeWeight = 0;
  15018. this._fadeIn = !0;
  15019. this._fadeOut = !1;
  15020. this.loopCount = -1;
  15021. this.displayControl = l;
  15022. this.isPlaying = !0;
  15023. this.isComplete = !1;
  15024. this.weight = 1;
  15025. this.tweenEnabled = this.enabled = this.blend = !0;
  15026. this.updateTimelineStates()
  15027. };
  15028. a.prototype.fadeOut = function(a, b) {
  15029. "undefined" === typeof b && (b = !1);
  15030. if (this._armature && !(0 <= this._fadeOutWeight)) {
  15031. this._fadeState = -1;
  15032. this._fadeOutWeight =
  15033. this._fadeWeight;
  15034. this._fadeOutTime = a * this.timeScale;
  15035. this._fadeOutBeginTime = this.currentTime;
  15036. this._fadeOut = !0;
  15037. this.isPlaying = !b;
  15038. this.displayControl = !1;
  15039. for (var c in this._timelineStates) this._timelineStates[c].fadeOut();
  15040. this.enabled = !0
  15041. }
  15042. };
  15043. a.prototype.play = function() {
  15044. this.isPlaying = !0
  15045. };
  15046. a.prototype.stop = function() {
  15047. this.isPlaying = !1
  15048. };
  15049. a.prototype.getMixingTransform = function(a) {
  15050. return this._mixingTransforms ? Number(this._mixingTransforms[a]) : -1
  15051. };
  15052. a.prototype.addMixingTransform = function(a, b, c) {
  15053. "undefined" ===
  15054. typeof b && (b = 2);
  15055. "undefined" === typeof c && (c = !0);
  15056. if (this.clip && this.clip.getTimeline(a)) {
  15057. this._mixingTransforms || (this._mixingTransforms = {});
  15058. if (c) {
  15059. c = this._armature._boneList.length;
  15060. for (var d, e; c--;) d = this._armature._boneList[c], d.name == a && (e = d), e && (e == d || e.contains(d)) && (this._mixingTransforms[d.name] = b)
  15061. } else this._mixingTransforms[a] = b;
  15062. this.updateTimelineStates()
  15063. } else throw Error();
  15064. };
  15065. a.prototype.removeMixingTransform = function(a, b) {
  15066. "undefined" === typeof a && (a = null);
  15067. "undefined" === typeof b && (b = !0);
  15068. if (a) {
  15069. if (b)
  15070. for (var c =
  15071. this._armature._boneList.length, d, e; c--;) d = this._armature._boneList[c], d.name == a && (e = d), e && (e == d || e.contains(d)) && delete this._mixingTransforms[d.name];
  15072. else delete this._mixingTransforms[a];
  15073. for (var g in this._mixingTransforms) {
  15074. var l = !0;
  15075. break
  15076. }
  15077. l || (this._mixingTransforms = null)
  15078. } else this._mixingTransforms = null;
  15079. this.updateTimelineStates()
  15080. };
  15081. a.prototype.advanceTime = function(a) {
  15082. if (!this.enabled) return !1;
  15083. var b, c;
  15084. this._fadeIn && (this._fadeIn = !1, this._armature.hasEventListener(d.AnimationEvent.FADE_IN) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_IN),
  15085. b.animationState = this, this._armature._eventList.push(b)));
  15086. 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)));
  15087. this.currentTime += a * this.timeScale;
  15088. if (this.isPlaying && !this.isComplete) {
  15089. var e;
  15090. if (this._pauseBeforeFadeInComplete) this.isPlaying = this._pauseBeforeFadeInComplete = !1, a = 0, e = Math.floor(a);
  15091. else if (a = this.currentTime / this.totalTime, e = Math.floor(a),
  15092. 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) &&
  15093. (b = new d.AnimationEvent(d.AnimationEvent.LOOP_COMPLETE), b.animationState = this, this._armature._eventList.push(b));
  15094. for (var g in this._timelineStates) this._timelineStates[g].update(a);
  15095. b = this.clip.getFrameList();
  15096. if (0 < b.length) {
  15097. a = this.totalTime * (a - e);
  15098. 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), e = !0, this._currentFrame ? (g = b.indexOf(this._currentFrame), g++, g >= b.length &&
  15099. (g = 0), this._currentFrame = b[g]) : this._currentFrame = b[0];
  15100. e && this._armature._arriveAtFrame(this._currentFrame, null, this, !1)
  15101. }
  15102. }
  15103. 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 =
  15104. 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))));
  15105. else if (0 > this._fadeState) {
  15106. if (0 == this._fadeOutTime) return this._fadeState = this._fadeWeight = 0, this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE), b.animationState = this,
  15107. this._armature._eventList.push(b)), !0;
  15108. this._fadeWeight = (1 - (this.currentTime - this._fadeOutBeginTime) / this._fadeOutTime) * this._fadeOutWeight;
  15109. if (0 >= this._fadeWeight) return this._fadeState = this._fadeWeight = 0, 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)), !0
  15110. }
  15111. c && (this.isComplete = !0, 0 > this.loop && this.fadeOut((this._fadeOutWeight || this._fadeInTime) / this.timeScale, !0));
  15112. return !1
  15113. };
  15114. a.prototype.updateTimelineStates = function() {
  15115. if (this._mixingTransforms) {
  15116. for (var a in this._timelineStates) null == this._mixingTransforms[a] && this.removeTimelineState(a);
  15117. for (a in this._mixingTransforms) this._timelineStates[a] || this.addTimelineState(a)
  15118. } else
  15119. for (a in this.clip.getTimelines()) this._timelineStates[a] || this.addTimelineState(a)
  15120. };
  15121. a.prototype.addTimelineState = function(a) {
  15122. var b = this._armature.getBone(a);
  15123. if (b) {
  15124. var c = l._borrowObject(),
  15125. d = this.clip.getTimeline(a);
  15126. c.fadeIn(b, this, d);
  15127. this._timelineStates[a] =
  15128. c
  15129. }
  15130. };
  15131. a.prototype.removeTimelineState = function(a) {
  15132. l._returnObject(this._timelineStates[a]);
  15133. delete this._timelineStates[a]
  15134. };
  15135. a.prototype.clear = function() {
  15136. this.clip = null;
  15137. this.enabled = !1;
  15138. this._mixingTransforms = this._currentFrame = this._armature = null;
  15139. for (var a in this._timelineStates) this.removeTimelineState(a)
  15140. };
  15141. a._pool = [];
  15142. return a
  15143. }();
  15144. a.AnimationState = f;
  15145. c = function() {
  15146. function a(b) {
  15147. this._armature = b;
  15148. this._animationLayer = [];
  15149. this._isPlaying = !1;
  15150. this.animationNameList = [];
  15151. this.tweenEnabled = !0;
  15152. this.timeScale = 1
  15153. }
  15154. a.prototype.getLastAnimationName =
  15155. function() {
  15156. return this._lastAnimationState ? this._lastAnimationState.name : null
  15157. };
  15158. a.prototype.getLastAnimationState = function() {
  15159. return this._lastAnimationState
  15160. };
  15161. a.prototype.getAnimationDataList = function() {
  15162. return this._animationDataList
  15163. };
  15164. a.prototype.setAnimationDataList = function(a) {
  15165. this._animationDataList = a;
  15166. this.animationNameList.length = 0;
  15167. for (var b in this._animationDataList) this.animationNameList[this.animationNameList.length] = this._animationDataList[b].name
  15168. };
  15169. a.prototype.getIsPlaying = function() {
  15170. return this._isPlaying &&
  15171. !this.getIsComplete()
  15172. };
  15173. a.prototype.getIsComplete = function() {
  15174. if (this._lastAnimationState) {
  15175. if (!this._lastAnimationState.isComplete) return !1;
  15176. for (var a = this._animationLayer.length; a--;)
  15177. for (var b = this._animationLayer[a], c = b.length; c--;)
  15178. if (!b[c].isComplete) return !1;
  15179. return !0
  15180. }
  15181. return !1
  15182. };
  15183. a.prototype.dispose = function() {
  15184. if (this._armature) {
  15185. this.stop();
  15186. for (var a = this._animationLayer.length; a--;) {
  15187. for (var b = this._animationLayer[a], c = b.length; c--;) f._returnObject(b[c]);
  15188. b.length = 0
  15189. }
  15190. this._animationLayer.length = 0;
  15191. this.animationNameList.length =
  15192. 0;
  15193. this.animationNameList = this._animationDataList = this._animationLayer = this._armature = null
  15194. }
  15195. };
  15196. a.prototype.gotoAndPlay = function(b, c, d, e, g, l, m, k, h, q) {
  15197. "undefined" === typeof c && (c = -1);
  15198. "undefined" === typeof d && (d = -1);
  15199. "undefined" === typeof e && (e = NaN);
  15200. "undefined" === typeof g && (g = 0);
  15201. "undefined" === typeof l && (l = null);
  15202. "undefined" === typeof m && (m = a.SAME_LAYER_AND_GROUP);
  15203. "undefined" === typeof k && (k = !0);
  15204. "undefined" === typeof h && (h = !0);
  15205. "undefined" === typeof q && (q = !0);
  15206. if (!this._animationDataList) return null;
  15207. for (var n = this._animationDataList.length,
  15208. x; n--;)
  15209. if (this._animationDataList[n].name == b) {
  15210. x = this._animationDataList[n];
  15211. break
  15212. }
  15213. if (!x) return null;
  15214. this._isPlaying = !0;
  15215. c = 0 > c ? 0 > x.fadeInTime ? 0.3 : x.fadeInTime : c;
  15216. d = 0 > d ? 0 > x.scale ? 1 : x.scale : d / x.duration;
  15217. e = isNaN(e) ? x.loop : e;
  15218. g = this.addLayer(g);
  15219. var y;
  15220. switch (m) {
  15221. case a.NONE:
  15222. break;
  15223. case a.SAME_LAYER:
  15224. y = this._animationLayer[g];
  15225. for (n = y.length; n--;) m = y[n], m.fadeOut(c, h);
  15226. break;
  15227. case a.SAME_GROUP:
  15228. for (H = this._animationLayer.length; H--;)
  15229. for (y = this._animationLayer[H], n = y.length; n--;) m = y[n], m.group == l && m.fadeOut(c, h);
  15230. break;
  15231. case a.ALL:
  15232. for (var H = this._animationLayer.length; H--;)
  15233. for (y = this._animationLayer[H], n = y.length; n--;) m = y[n], m.fadeOut(c, h);
  15234. break;
  15235. default:
  15236. for (y = this._animationLayer[g], n = y.length; n--;) m = y[n], m.group == l && m.fadeOut(c, h)
  15237. }
  15238. this._lastAnimationState = f._borrowObject();
  15239. this._lastAnimationState.group = l;
  15240. this._lastAnimationState.tweenEnabled = this.tweenEnabled;
  15241. this._lastAnimationState.fadeIn(this._armature, x, c, 1 / d, e, g, k, q);
  15242. this.addState(this._lastAnimationState);
  15243. e = this._armature._slotList;
  15244. for (n = e.length; n--;) g =
  15245. e[n], (g = g.getChildArmature()) && g.animation.gotoAndPlay(b, c);
  15246. return this._lastAnimationState
  15247. };
  15248. a.prototype.play = function() {
  15249. this._animationDataList && 0 != this._animationDataList.length && (this._lastAnimationState ? this._isPlaying ? this.gotoAndPlay(this._lastAnimationState.name) : this._isPlaying = !0 : this.gotoAndPlay(this._animationDataList[0].name))
  15250. };
  15251. a.prototype.stop = function() {
  15252. this._isPlaying = !1
  15253. };
  15254. a.prototype.getState = function(a, b) {
  15255. "undefined" === typeof b && (b = 0);
  15256. var c = this._animationLayer.length;
  15257. if (0 == c) return null;
  15258. b >= c && (b = c - 1);
  15259. c = this._animationLayer[b];
  15260. if (!c) return null;
  15261. for (var d = c.length; d--;)
  15262. if (c[d].name == a) return c[d];
  15263. return null
  15264. };
  15265. a.prototype.hasAnimation = function(a) {
  15266. for (var b = this._animationDataList.length; b--;)
  15267. if (this._animationDataList[b].name == a) return !0;
  15268. return !1
  15269. };
  15270. a.prototype.advanceTime = function(a) {
  15271. if (this._isPlaying) {
  15272. a *= this.timeScale;
  15273. var b = this._armature._boneList.length,
  15274. c, d, e = b,
  15275. g, l, f, m, k, h, q, p, n, r, G, M, J, N, F, K, I;
  15276. for (b--; e--;) {
  15277. l = this._armature._boneList[e];
  15278. f = l.name;
  15279. m = 1;
  15280. M = G = r = n = p = q = h = k = 0;
  15281. for (c = this._animationLayer.length; c--;) {
  15282. J =
  15283. 0;
  15284. N = this._animationLayer[c];
  15285. g = N.length;
  15286. for (d = 0; d < g; d++) F = N[d], e == b && F.advanceTime(a) ? (this.removeState(F), d--, g--) : (K = F._timelineStates[f]) && K.tweenActive && (F = F._fadeWeight * F.weight * m, I = K.transform, K = K.pivot, k += I.x * F, h += I.y * F, q += I.skewX * F, p += I.skewY * F, n += I.scaleX * F, r += I.scaleY * F, G += K.x * F, M += K.y * F, J += F);
  15287. if (J >= m) break;
  15288. else m -= J
  15289. }
  15290. I = l.tween;
  15291. K = l._tweenPivot;
  15292. I.x = k;
  15293. I.y = h;
  15294. I.skewX = q;
  15295. I.skewY = p;
  15296. I.scaleX = n;
  15297. I.scaleY = r;
  15298. K.x = G;
  15299. K.y = M
  15300. }
  15301. }
  15302. };
  15303. a.prototype.addLayer = function(a) {
  15304. a >= this._animationLayer.length && (a = this._animationLayer.length,
  15305. this._animationLayer[a] = []);
  15306. return a
  15307. };
  15308. a.prototype.addState = function(a) {
  15309. this._animationLayer[a.layer].push(a)
  15310. };
  15311. a.prototype.removeState = function(a) {
  15312. var b = a.layer,
  15313. c = this._animationLayer[b];
  15314. c.splice(c.indexOf(a), 1);
  15315. f._returnObject(a);
  15316. 0 == c.length && b == this._animationLayer.length - 1 && this._animationLayer.length--
  15317. };
  15318. a.NONE = "none";
  15319. a.SAME_LAYER = "sameLayer";
  15320. a.SAME_GROUP = "sameGroup";
  15321. a.SAME_LAYER_AND_GROUP = "sameLayerAndGroup";
  15322. a.ALL = "all";
  15323. return a
  15324. }();
  15325. a.Animation = c
  15326. })(c.animation || (c.animation = {}));
  15327. var a = c.animation;
  15328. (function(a) {
  15329. var b = function() {
  15330. function a() {
  15331. this.skewY = this.skewX = this.y = this.x = 0;
  15332. this.scaleY = this.scaleX = 1
  15333. }
  15334. a.prototype.getRotation = function() {
  15335. return this.skewX
  15336. };
  15337. a.prototype.setRotation = function(a) {
  15338. this.skewX = this.skewY = a
  15339. };
  15340. a.prototype.copy = function(a) {
  15341. this.x = a.x;
  15342. this.y = a.y;
  15343. this.skewX = a.skewX;
  15344. this.skewY = a.skewY;
  15345. this.scaleX = a.scaleX;
  15346. this.scaleY = a.scaleY
  15347. };
  15348. a.prototype.toString = function() {
  15349. return "[DBTransform (x=" + this.x + " y=" + this.y + " skewX=" + this.skewX + " skewY=" + this.skewY + " scaleX=" + this.scaleX + " scaleY=" +
  15350. this.scaleY + ")]"
  15351. };
  15352. return a
  15353. }();
  15354. a.DBTransform = b;
  15355. var c = function() {
  15356. function a() {
  15357. this.duration = this.position = 0
  15358. }
  15359. a.prototype.dispose = function() {};
  15360. return a
  15361. }();
  15362. a.Frame = c;
  15363. var d = function(a) {
  15364. function c() {
  15365. a.call(this);
  15366. this.displayIndex = this.tweenRotate = this.tweenEasing = 0;
  15367. this.zOrder = NaN;
  15368. this.visible = !0;
  15369. this.global = new b;
  15370. this.transform = new b;
  15371. this.pivot = new e.Point
  15372. }
  15373. __extends(c, a);
  15374. c.prototype.dispose = function() {
  15375. a.prototype.dispose.call(this);
  15376. this.color = this.pivot = this.transform = this.global = null
  15377. };
  15378. return c
  15379. }(c);
  15380. a.TransformFrame =
  15381. d;
  15382. var l = function() {
  15383. function a() {
  15384. this._frameList = [];
  15385. this.duration = 0;
  15386. this.scale = 1
  15387. }
  15388. a.prototype.getFrameList = function() {
  15389. return this._frameList
  15390. };
  15391. a.prototype.dispose = function() {
  15392. for (var a = this._frameList.length; a--;) this._frameList[a].dispose();
  15393. this._frameList.length = 0;
  15394. this._frameList = null
  15395. };
  15396. a.prototype.addFrame = function(a) {
  15397. if (!a) throw Error();
  15398. if (0 > this._frameList.indexOf(a)) this._frameList[this._frameList.length] = a;
  15399. else throw Error();
  15400. };
  15401. return a
  15402. }();
  15403. a.Timeline = l;
  15404. var f = function(a) {
  15405. function c() {
  15406. a.call(this);
  15407. this.originTransform = new b;
  15408. this.originPivot = new e.Point;
  15409. this.offset = 0;
  15410. this.transformed = !1
  15411. }
  15412. __extends(c, a);
  15413. c.prototype.dispose = function() {
  15414. this != c.HIDE_TIMELINE && (a.prototype.dispose.call(this), this.originPivot = this.originTransform = null)
  15415. };
  15416. c.HIDE_TIMELINE = new c;
  15417. return c
  15418. }(l);
  15419. a.TransformTimeline = f;
  15420. var m = function(a) {
  15421. function b() {
  15422. a.call(this);
  15423. this.loop = this.frameRate = 0;
  15424. this.tweenEasing = NaN;
  15425. this.fadeInTime = 0;
  15426. this._timelines = {}
  15427. }
  15428. __extends(b, a);
  15429. b.prototype.getTimelines = function() {
  15430. return this._timelines
  15431. };
  15432. b.prototype.dispose =
  15433. function() {
  15434. a.prototype.dispose.call(this);
  15435. for (var b in this._timelines) this._timelines[b].dispose();
  15436. this._timelines = null
  15437. };
  15438. b.prototype.getTimeline = function(a) {
  15439. return this._timelines[a]
  15440. };
  15441. b.prototype.addTimeline = function(a, b) {
  15442. if (!a) throw Error();
  15443. this._timelines[b] = a
  15444. };
  15445. return b
  15446. }(l);
  15447. a.AnimationData = m;
  15448. var h = function() {
  15449. function a() {
  15450. this.transform = new b
  15451. }
  15452. a.prototype.dispose = function() {
  15453. this.pivot = this.transform = null
  15454. };
  15455. a.ARMATURE = "armature";
  15456. a.IMAGE = "image";
  15457. return a
  15458. }();
  15459. a.DisplayData = h;
  15460. var w = function() {
  15461. function a() {
  15462. this._displayDataList = [];
  15463. this.zOrder = 0;
  15464. this.blendMode = "normal"
  15465. }
  15466. a.prototype.getDisplayDataList = function() {
  15467. return this._displayDataList
  15468. };
  15469. a.prototype.dispose = function() {
  15470. for (var a = this._displayDataList.length; a--;) this._displayDataList[a].dispose();
  15471. this._displayDataList.length = 0;
  15472. this._displayDataList = null
  15473. };
  15474. a.prototype.addDisplayData = function(a) {
  15475. if (!a) throw Error();
  15476. if (0 > this._displayDataList.indexOf(a)) this._displayDataList[this._displayDataList.length] = a;
  15477. else throw Error();
  15478. };
  15479. a.prototype.getDisplayData = function(a) {
  15480. for (var b =
  15481. this._displayDataList.length; b--;)
  15482. if (this._displayDataList[b].name == a) return this._displayDataList[b];
  15483. return null
  15484. };
  15485. return a
  15486. }();
  15487. a.SlotData = w;
  15488. var B = function() {
  15489. function a() {
  15490. this.length = 0;
  15491. this.global = new b;
  15492. this.transform = new b;
  15493. this.scaleMode = 1;
  15494. this.fixedRotation = !1
  15495. }
  15496. a.prototype.dispose = function() {
  15497. this.transform = this.global = null
  15498. };
  15499. return a
  15500. }();
  15501. a.BoneData = B;
  15502. var C = function() {
  15503. function a() {
  15504. this._slotDataList = []
  15505. }
  15506. a.prototype.getSlotDataList = function() {
  15507. return this._slotDataList
  15508. };
  15509. a.prototype.dispose = function() {
  15510. for (var a =
  15511. this._slotDataList.length; a--;) this._slotDataList[a].dispose();
  15512. this._slotDataList.length = 0;
  15513. this._slotDataList = null
  15514. };
  15515. a.prototype.getSlotData = function(a) {
  15516. for (var b = this._slotDataList.length; b--;)
  15517. if (this._slotDataList[b].name == a) return this._slotDataList[b];
  15518. return null
  15519. };
  15520. a.prototype.addSlotData = function(a) {
  15521. if (!a) throw Error();
  15522. if (0 > this._slotDataList.indexOf(a)) this._slotDataList[this._slotDataList.length] = a;
  15523. else throw Error();
  15524. };
  15525. return a
  15526. }();
  15527. a.SkinData = C;
  15528. var u = function() {
  15529. function a() {
  15530. this._boneDataList = [];
  15531. this._skinDataList = [];
  15532. this._animationDataList = []
  15533. }
  15534. a.prototype.getBoneDataList = function() {
  15535. return this._boneDataList
  15536. };
  15537. a.prototype.getSkinDataList = function() {
  15538. return this._skinDataList
  15539. };
  15540. a.prototype.getAnimationDataList = function() {
  15541. return this._animationDataList
  15542. };
  15543. a.prototype.dispose = function() {
  15544. for (var a = this._boneDataList.length; a--;) this._boneDataList[a].dispose();
  15545. for (a = this._skinDataList.length; a--;) this._skinDataList[a].dispose();
  15546. for (a = this._animationDataList.length; a--;) this._animationDataList[a].dispose();
  15547. this._boneDataList.length = 0;
  15548. this._skinDataList.length = 0;
  15549. this._animationDataList.length = 0;
  15550. this._animationDataList = this._skinDataList = this._boneDataList = null
  15551. };
  15552. a.prototype.getBoneData = function(a) {
  15553. for (var b = this._boneDataList.length; b--;)
  15554. if (this._boneDataList[b].name == a) return this._boneDataList[b];
  15555. return null
  15556. };
  15557. a.prototype.getSkinData = function(a) {
  15558. if (!a) return this._skinDataList[0];
  15559. for (var b = this._skinDataList.length; b--;)
  15560. if (this._skinDataList[b].name == a) return this._skinDataList[b];
  15561. return null
  15562. };
  15563. a.prototype.getAnimationData =
  15564. function(a) {
  15565. for (var b = this._animationDataList.length; b--;)
  15566. if (this._animationDataList[b].name == a) return this._animationDataList[b];
  15567. return null
  15568. };
  15569. a.prototype.addBoneData = function(a) {
  15570. if (!a) throw Error();
  15571. if (0 > this._boneDataList.indexOf(a)) this._boneDataList[this._boneDataList.length] = a;
  15572. else throw Error();
  15573. };
  15574. a.prototype.addSkinData = function(a) {
  15575. if (!a) throw Error();
  15576. if (0 > this._skinDataList.indexOf(a)) this._skinDataList[this._skinDataList.length] = a;
  15577. else throw Error();
  15578. };
  15579. a.prototype.addAnimationData = function(a) {
  15580. if (!a) throw Error();
  15581. 0 > this._animationDataList.indexOf(a) && (this._animationDataList[this._animationDataList.length] = a)
  15582. };
  15583. a.prototype.sortBoneDataList = function() {
  15584. var a = this._boneDataList.length;
  15585. if (0 != a) {
  15586. for (var b = []; a--;) {
  15587. for (var c = this._boneDataList[a], d = 0, e = c; e && e.parent;) d++, e = this.getBoneData(e.parent);
  15588. b[a] = {
  15589. level: d,
  15590. boneData: c
  15591. }
  15592. }
  15593. b.sort(this.sortBoneData);
  15594. for (a = b.length; a--;) this._boneDataList[a] = b[a].boneData
  15595. }
  15596. };
  15597. a.prototype.sortBoneData = function(a, b) {
  15598. return a.level > b.level ? 1 : -1
  15599. };
  15600. return a
  15601. }();
  15602. a.ArmatureData = u;
  15603. var v = function() {
  15604. function a() {
  15605. this._armatureDataList = [];
  15606. this._subTexturePivots = {}
  15607. }
  15608. a.prototype.getArmatureNames = function() {
  15609. var a = [],
  15610. b;
  15611. for (b in this._armatureDataList) a[a.length] = this._armatureDataList[b].name;
  15612. return a
  15613. };
  15614. a.prototype.getArmatureDataList = function() {
  15615. return this._armatureDataList
  15616. };
  15617. a.prototype.dispose = function() {
  15618. for (var a in this._armatureDataList) this._armatureDataList[a].dispose();
  15619. this._armatureDataList.length = 0;
  15620. this._subTexturePivots = this._armatureDataList = null
  15621. };
  15622. a.prototype.getArmatureData = function(a) {
  15623. for (var b = this._armatureDataList.length; b--;)
  15624. if (this._armatureDataList[b].name ==
  15625. a) return this._armatureDataList[b];
  15626. return null
  15627. };
  15628. a.prototype.addArmatureData = function(a) {
  15629. if (!a) throw Error();
  15630. if (0 > this._armatureDataList.indexOf(a)) this._armatureDataList[this._armatureDataList.length] = a;
  15631. else throw Error();
  15632. };
  15633. a.prototype.removeArmatureData = function(a) {
  15634. a = this._armatureDataList.indexOf(a);
  15635. 0 <= a && this._armatureDataList.splice(a, 1)
  15636. };
  15637. a.prototype.removeArmatureDataByName = function(a) {
  15638. for (var b = this._armatureDataList.length; b--;) this._armatureDataList[b].name == a && this._armatureDataList.splice(b,
  15639. 1)
  15640. };
  15641. a.prototype.getSubTexturePivot = function(a) {
  15642. return this._subTexturePivots[a]
  15643. };
  15644. a.prototype.addSubTexturePivot = function(a, b, c) {
  15645. var d = this._subTexturePivots[c];
  15646. d ? (d.x = a, d.y = b) : this._subTexturePivots[c] = d = new e.Point(a, b);
  15647. return d
  15648. };
  15649. a.prototype.removeSubTexturePivot = function(a) {
  15650. if (a) delete this._subTexturePivots[a];
  15651. else
  15652. for (a in this._subTexturePivots) delete this._subTexturePivots[a]
  15653. };
  15654. return a
  15655. }();
  15656. a.SkeletonData = v;
  15657. l = function() {
  15658. function a() {}
  15659. a.parseTextureAtlasData = function(a, b) {
  15660. "undefined" === typeof b &&
  15661. (b = 1);
  15662. if (!a) throw Error();
  15663. var c = {};
  15664. c.__name = a[g.ConstValues.A_NAME];
  15665. var d = a[g.ConstValues.SUB_TEXTURE],
  15666. l;
  15667. for (l in d) {
  15668. var f = d[l],
  15669. m = f[g.ConstValues.A_NAME],
  15670. f = new e.Rectangle(Number(f[g.ConstValues.A_X]) / b, Number(f[g.ConstValues.A_Y]) / b, Number(f[g.ConstValues.A_WIDTH]) / b, Number(f[g.ConstValues.A_HEIGHT]) / b);
  15671. c[m] = f
  15672. }
  15673. return c
  15674. };
  15675. a.parseSkeletonData = function(b) {
  15676. if (!b) throw Error();
  15677. var c = Number(b[g.ConstValues.A_FRAME_RATE]),
  15678. d = new v;
  15679. d.name = b[g.ConstValues.A_NAME];
  15680. b = b[g.ConstValues.ARMATURE];
  15681. for (var e in b) d.addArmatureData(a.parseArmatureData(b[e],
  15682. d, c));
  15683. return d
  15684. };
  15685. a.parseArmatureData = function(b, c, d) {
  15686. var e = new u;
  15687. e.name = b[g.ConstValues.A_NAME];
  15688. var l = b[g.ConstValues.BONE],
  15689. f;
  15690. for (f in l) e.addBoneData(a.parseBoneData(l[f]));
  15691. l = b[g.ConstValues.SKIN];
  15692. for (f in l) e.addSkinData(a.parseSkinData(l[f], c));
  15693. g.DBDataUtil.transformArmatureData(e);
  15694. e.sortBoneDataList();
  15695. b = b[g.ConstValues.ANIMATION];
  15696. for (f in b) e.addAnimationData(a.parseAnimationData(b[f], e, d));
  15697. return e
  15698. };
  15699. a.parseBoneData = function(b) {
  15700. var c = new B;
  15701. c.name = b[g.ConstValues.A_NAME];
  15702. c.parent = b[g.ConstValues.A_PARENT];
  15703. c.length = Number(b[g.ConstValues.A_LENGTH]) || 0;
  15704. var d = Number(b[g.ConstValues.A_SCALE_MODE]);
  15705. !isNaN(d) && d && (c.scaleMode = d);
  15706. if (d = b[g.ConstValues.A_FIXED_ROTATION]) c.fixedRotation = d;
  15707. a.parseTransform(b[g.ConstValues.TRANSFORM], c.global);
  15708. c.transform.copy(c.global);
  15709. return c
  15710. };
  15711. a.parseSkinData = function(b, c) {
  15712. var d = new C;
  15713. d.name = b[g.ConstValues.A_NAME];
  15714. var e = b[g.ConstValues.SLOT],
  15715. l;
  15716. for (l in e) d.addSlotData(a.parseSlotData(e[l], c));
  15717. return d
  15718. };
  15719. a.parseSlotData = function(b, c) {
  15720. var d = new w;
  15721. d.name = b[g.ConstValues.A_NAME];
  15722. d.parent = b[g.ConstValues.A_PARENT];
  15723. d.zOrder = Number(b[g.ConstValues.A_Z_ORDER]);
  15724. d.blendMode = b[g.ConstValues.A_BLENDMODE];
  15725. d.blendMode || (d.blendMode = "normal");
  15726. var e = b[g.ConstValues.DISPLAY],
  15727. l;
  15728. for (l in e) d.addDisplayData(a.parseDisplayData(e[l], c));
  15729. return d
  15730. };
  15731. a.parseDisplayData = function(b, c) {
  15732. var d = new h;
  15733. d.name = b[g.ConstValues.A_NAME];
  15734. d.type = b[g.ConstValues.A_TYPE];
  15735. d.pivot = c.addSubTexturePivot(0, 0, d.name);
  15736. a.parseTransform(b[g.ConstValues.TRANSFORM], d.transform, d.pivot);
  15737. return d
  15738. };
  15739. a.parseAnimationData = function(b,
  15740. c, d) {
  15741. var e = new m;
  15742. e.name = b[g.ConstValues.A_NAME];
  15743. e.frameRate = d;
  15744. e.loop = Number(b[g.ConstValues.A_LOOP]) || 0;
  15745. e.fadeInTime = Number(b[g.ConstValues.A_FADE_IN_TIME]);
  15746. e.duration = Number(b[g.ConstValues.A_DURATION]) / d;
  15747. e.scale = Number(b[g.ConstValues.A_SCALE]);
  15748. if (b.hasOwnProperty(g.ConstValues.A_TWEEN_EASING)) {
  15749. var l = b[g.ConstValues.A_TWEEN_EASING];
  15750. e.tweenEasing = void 0 == l || null == l ? NaN : Number(l)
  15751. } else e.tweenEasing = NaN;
  15752. a.parseTimeline(b, e, a.parseMainFrame, d);
  15753. var f, l = b[g.ConstValues.TIMELINE],
  15754. k;
  15755. for (k in l) f = l[k], b =
  15756. a.parseTransformTimeline(f, e.duration, d), f = f[g.ConstValues.A_NAME], e.addTimeline(b, f);
  15757. g.DBDataUtil.addHideTimeline(e, c);
  15758. g.DBDataUtil.transformAnimationData(e, c);
  15759. return e
  15760. };
  15761. a.parseTimeline = function(a, b, c, d) {
  15762. var e = 0,
  15763. l;
  15764. a = a[g.ConstValues.FRAME];
  15765. for (var f in a) l = c(a[f], d), l.position = e, b.addFrame(l), e += l.duration;
  15766. l && (l.duration = b.duration - l.position)
  15767. };
  15768. a.parseTransformTimeline = function(b, c, d) {
  15769. var e = new f;
  15770. e.duration = c;
  15771. a.parseTimeline(b, e, a.parseTransformFrame, d);
  15772. e.scale = Number(b[g.ConstValues.A_SCALE]);
  15773. e.offset =
  15774. Number(b[g.ConstValues.A_OFFSET]);
  15775. return e
  15776. };
  15777. a.parseFrame = function(a, b, c) {
  15778. b.duration = Number(a[g.ConstValues.A_DURATION]) / c;
  15779. b.action = a[g.ConstValues.A_ACTION];
  15780. b.event = a[g.ConstValues.A_EVENT];
  15781. b.sound = a[g.ConstValues.A_SOUND]
  15782. };
  15783. a.parseMainFrame = function(b, d) {
  15784. var e = new c;
  15785. a.parseFrame(b, e, d);
  15786. return e
  15787. };
  15788. a.parseTransformFrame = function(b, c) {
  15789. var l = new d;
  15790. a.parseFrame(b, l, c);
  15791. l.visible = 1 != Number(b[g.ConstValues.A_HIDE]);
  15792. if (b.hasOwnProperty(g.ConstValues.A_TWEEN_EASING)) {
  15793. var f = b[g.ConstValues.A_TWEEN_EASING];
  15794. l.tweenEasing =
  15795. void 0 == f || null == f ? NaN : Number(f)
  15796. } else l.tweenEasing = 0;
  15797. l.tweenRotate = Number(b[g.ConstValues.A_TWEEN_ROTATE]) || 0;
  15798. l.displayIndex = Number(b[g.ConstValues.A_DISPLAY_INDEX]) || 0;
  15799. l.zOrder = Number(b[g.ConstValues.A_Z_ORDER]) || 0;
  15800. a.parseTransform(b[g.ConstValues.TRANSFORM], l.global, l.pivot);
  15801. l.transform.copy(l.global);
  15802. if (f = b[g.ConstValues.COLOR_TRANSFORM]) l.color = new e.ColorTransform, l.color.alphaOffset = Number(f[g.ConstValues.A_ALPHA_OFFSET]), l.color.redOffset = Number(f[g.ConstValues.A_RED_OFFSET]), l.color.greenOffset =
  15803. Number(f[g.ConstValues.A_GREEN_OFFSET]), l.color.blueOffset = Number(f[g.ConstValues.A_BLUE_OFFSET]), l.color.alphaMultiplier = 0.01 * Number(f[g.ConstValues.A_ALPHA_MULTIPLIER]), l.color.redMultiplier = 0.01 * Number(f[g.ConstValues.A_RED_MULTIPLIER]), l.color.greenMultiplier = 0.01 * Number(f[g.ConstValues.A_GREEN_MULTIPLIER]), l.color.blueMultiplier = 0.01 * Number(f[g.ConstValues.A_BLUE_MULTIPLIER]);
  15804. return l
  15805. };
  15806. a.parseTransform = function(a, b, c) {
  15807. "undefined" === typeof c && (c = null);
  15808. a && (b && (b.x = Number(a[g.ConstValues.A_X]),
  15809. b.y = Number(a[g.ConstValues.A_Y]), b.skewX = Number(a[g.ConstValues.A_SKEW_X]) * g.ConstValues.ANGLE_TO_RADIAN, b.skewY = Number(a[g.ConstValues.A_SKEW_Y]) * g.ConstValues.ANGLE_TO_RADIAN, b.scaleX = Number(a[g.ConstValues.A_SCALE_X]), b.scaleY = Number(a[g.ConstValues.A_SCALE_Y])), c && (c.x = Number(a[g.ConstValues.A_PIVOT_X]), c.y = Number(a[g.ConstValues.A_PIVOT_Y])))
  15810. };
  15811. return a
  15812. }();
  15813. a.DataParser = l
  15814. })(c.objects || (c.objects = {}));
  15815. var b = c.objects;
  15816. (function(a) {
  15817. var c = function(a) {
  15818. function c() {
  15819. a.call(this);
  15820. this._dataDic = {};
  15821. this._textureAtlasDic = {};
  15822. this._textureAtlasLoadingDic = {}
  15823. }
  15824. __extends(c, a);
  15825. c.prototype.getSkeletonData = function(a) {
  15826. return this._dataDic[a]
  15827. };
  15828. c.prototype.addSkeletonData = function(a, b) {
  15829. "undefined" === typeof b && (b = null);
  15830. if (!a) throw Error();
  15831. b = b || a.name;
  15832. if (!b) throw Error("Unnamed data!");
  15833. this._dataDic[b] = a
  15834. };
  15835. c.prototype.removeSkeletonData = function(a) {
  15836. delete this._dataDic[a]
  15837. };
  15838. c.prototype.getTextureAtlas = function(a) {
  15839. return this._textureAtlasDic[a]
  15840. };
  15841. c.prototype.addTextureAtlas = function(a, b) {
  15842. "undefined" === typeof b && (b = null);
  15843. if (!a) throw Error();
  15844. b = b || a.name;
  15845. if (!b) throw Error("Unnamed data!");
  15846. this._textureAtlasDic[b] = a
  15847. };
  15848. c.prototype.removeTextureAtlas = function(a) {
  15849. delete this._textureAtlasDic[a]
  15850. };
  15851. c.prototype.dispose = function(a) {
  15852. "undefined" === typeof a && (a = !0);
  15853. if (a) {
  15854. for (var b in this._dataDic) this._dataDic[b].dispose();
  15855. for (b in this._textureAtlasDic) this._textureAtlasDic[b].dispose()
  15856. }
  15857. this._currentTextureAtlasName = this._currentDataName = this._textureAtlasLoadingDic = this._textureAtlasDic = this._dataDic = null
  15858. };
  15859. c.prototype.buildArmature = function(a, c,
  15860. d, e, g) {
  15861. if (d) {
  15862. var l = this._dataDic[d];
  15863. if (l) var m = l.getArmatureData(a)
  15864. } else
  15865. for (d in this._dataDic)
  15866. if (l = this._dataDic[d], m = l.getArmatureData(a)) break; if (!m) return null;
  15867. this._currentDataName = d;
  15868. this._currentTextureAtlasName = e || d;
  15869. e = this._generateArmature();
  15870. e.name = a;
  15871. var k, h, q = m.getBoneDataList(),
  15872. p;
  15873. for (p in q) h = q[p], k = new f, k.name = h.name, k.fixedRotation = h.fixedRotation, k.scaleMode = h.scaleMode, k.origin.copy(h.transform), m.getBoneData(h.parent) ? e.addChild(k, h.parent) : e.addChild(k, null);
  15874. if (c && c != a) {
  15875. var n = l.getArmatureData(c);
  15876. if (!n)
  15877. for (d in this._dataDic)
  15878. if (l = this._dataDic[d], n = l.getArmatureData(c)) break
  15879. }
  15880. n ? e.animation.setAnimationDataList(n.getAnimationDataList()) : e.animation.setAnimationDataList(m.getAnimationDataList());
  15881. k = m.getSkinData(g);
  15882. if (!k) throw Error();
  15883. a = [];
  15884. d = k.getSlotDataList();
  15885. for (p in d)
  15886. if (l = d[p], k = e.getBone(l.parent)) {
  15887. g = l.getDisplayDataList();
  15888. c = this._generateSlot();
  15889. c.name = l.name;
  15890. c._blendMode = l.blendMode;
  15891. c._originZOrder = l.zOrder;
  15892. c._dislayDataList = g;
  15893. a.length = 0;
  15894. for (l = g.length; l--;) switch (m = g[l], m.type) {
  15895. case b.DisplayData.ARMATURE:
  15896. (m =
  15897. this.buildArmature(m.name, null, this._currentDataName, this._currentTextureAtlasName, null)) && (a[l] = m);
  15898. break;
  15899. default:
  15900. a[l] = this._generateDisplay(this._textureAtlasDic[this._currentTextureAtlasName], m.name, m.pivot.x, m.pivot.y)
  15901. }
  15902. c.setDisplayList(a);
  15903. c._changeDisplay(0);
  15904. k.addChild(c)
  15905. }
  15906. e._slotsZOrderChanged = !0;
  15907. e.advanceTime(0);
  15908. return e
  15909. };
  15910. c.prototype.getTextureDisplay = function(a, b, c, d) {
  15911. if (b) var e = this._textureAtlasDic[b];
  15912. if (!e && !b)
  15913. for (b in this._textureAtlasDic) {
  15914. e = this._textureAtlasDic[b];
  15915. if (e.getRegion(a)) break;
  15916. e = null
  15917. }
  15918. if (e) {
  15919. if (isNaN(c) || isNaN(d))
  15920. if (b = this._dataDic[b])
  15921. if (b = b.getSubTexturePivot(a)) c = b.x, d = b.y;
  15922. return this._generateDisplay(e, a, c, d)
  15923. }
  15924. return null
  15925. };
  15926. c.prototype._generateArmature = function() {
  15927. return null
  15928. };
  15929. c.prototype._generateSlot = function() {
  15930. return null
  15931. };
  15932. c.prototype._generateDisplay = function(a, b, c, d) {
  15933. return null
  15934. };
  15935. return c
  15936. }(d.EventDispatcher);
  15937. a.BaseFactory = c
  15938. })(c.factorys || (c.factorys = {}));
  15939. (function(c) {
  15940. var d = function() {
  15941. function a() {}
  15942. a.ANGLE_TO_RADIAN = Math.PI / 180;
  15943. a.DRAGON_BONES = "dragonBones";
  15944. a.ARMATURE =
  15945. "armature";
  15946. a.SKIN = "skin";
  15947. a.BONE = "bone";
  15948. a.SLOT = "slot";
  15949. a.DISPLAY = "display";
  15950. a.ANIMATION = "animation";
  15951. a.TIMELINE = "timeline";
  15952. a.FRAME = "frame";
  15953. a.TRANSFORM = "transform";
  15954. a.COLOR_TRANSFORM = "colorTransform";
  15955. a.TEXTURE_ATLAS = "TextureAtlas";
  15956. a.SUB_TEXTURE = "SubTexture";
  15957. a.A_VERSION = "version";
  15958. a.A_IMAGE_PATH = "imagePath";
  15959. a.A_FRAME_RATE = "frameRate";
  15960. a.A_NAME = "name";
  15961. a.A_PARENT = "parent";
  15962. a.A_LENGTH = "length";
  15963. a.A_TYPE = "type";
  15964. a.A_FADE_IN_TIME = "fadeInTime";
  15965. a.A_DURATION = "duration";
  15966. a.A_SCALE = "scale";
  15967. a.A_OFFSET = "offset";
  15968. a.A_LOOP =
  15969. "loop";
  15970. a.A_EVENT = "event";
  15971. a.A_SOUND = "sound";
  15972. a.A_ACTION = "action";
  15973. a.A_HIDE = "hide";
  15974. a.A_TWEEN_EASING = "tweenEasing";
  15975. a.A_TWEEN_ROTATE = "tweenRotate";
  15976. a.A_DISPLAY_INDEX = "displayIndex";
  15977. a.A_Z_ORDER = "z";
  15978. a.A_BLENDMODE = "blendMode";
  15979. a.A_WIDTH = "width";
  15980. a.A_HEIGHT = "height";
  15981. a.A_SCALE_MODE = "scaleMode";
  15982. a.A_FIXED_ROTATION = "fixedRotation";
  15983. a.A_X = "x";
  15984. a.A_Y = "y";
  15985. a.A_SKEW_X = "skX";
  15986. a.A_SKEW_Y = "skY";
  15987. a.A_SCALE_X = "scX";
  15988. a.A_SCALE_Y = "scY";
  15989. a.A_PIVOT_X = "pX";
  15990. a.A_PIVOT_Y = "pY";
  15991. a.A_ALPHA_OFFSET = "aO";
  15992. a.A_RED_OFFSET = "rO";
  15993. a.A_GREEN_OFFSET = "gO";
  15994. a.A_BLUE_OFFSET = "bO";
  15995. a.A_ALPHA_MULTIPLIER = "aM";
  15996. a.A_RED_MULTIPLIER = "rM";
  15997. a.A_GREEN_MULTIPLIER = "gM";
  15998. a.A_BLUE_MULTIPLIER = "bM";
  15999. return a
  16000. }();
  16001. c.ConstValues = d;
  16002. var g = function() {
  16003. function a() {}
  16004. a.transformPointWithParent = function(b, c) {
  16005. var d = a._helpMatrix;
  16006. a.transformToMatrix(c, d);
  16007. d.invert();
  16008. var e = b.x,
  16009. g = b.y;
  16010. b.x = d.a * e + d.c * g + d.tx;
  16011. b.y = d.d * g + d.b * e + d.ty;
  16012. b.skewX = a.formatRadian(b.skewX - c.skewX);
  16013. b.skewY = a.formatRadian(b.skewY - c.skewY)
  16014. };
  16015. a.transformToMatrix = function(a, b) {
  16016. b.a = a.scaleX * Math.cos(a.skewY);
  16017. b.b = a.scaleX * Math.sin(a.skewY);
  16018. b.c = -a.scaleY * Math.sin(a.skewX);
  16019. b.d = a.scaleY * Math.cos(a.skewX);
  16020. b.tx = a.x;
  16021. b.ty = a.y
  16022. };
  16023. a.formatRadian = function(b) {
  16024. b %= a.DOUBLE_PI;
  16025. b > Math.PI && (b -= a.DOUBLE_PI);
  16026. b < -Math.PI && (b += a.DOUBLE_PI);
  16027. return b
  16028. };
  16029. a.DOUBLE_PI = 2 * Math.PI;
  16030. a._helpMatrix = new e.Matrix;
  16031. return a
  16032. }();
  16033. c.TransformUtil = g;
  16034. d = function() {
  16035. function c() {}
  16036. c.transformArmatureData = function(a) {
  16037. for (var b = a.getBoneDataList(), c = b.length, d, e; c--;)
  16038. if (d = b[c], d.parent && (e = a.getBoneData(d.parent))) d.transform.copy(d.global), g.transformPointWithParent(d.transform, e.global)
  16039. };
  16040. c.transformArmatureDataAnimations = function(a) {
  16041. for (var b = a.getAnimationDataList(), d = b.length; d--;) c.transformAnimationData(b[d], a)
  16042. };
  16043. c.transformAnimationData = function(a, b) {
  16044. for (var d = b.getSkinData(null), e = b.getBoneDataList(), d = d.getSlotDataList(), l = e.length, f, m, k, h, n, z, E, x, y, H; l--;)
  16045. if (f = e[l], m = a.getTimeline(f.name)) {
  16046. k = null;
  16047. for (var L in d)
  16048. if (k = d[L], k.parent == f.name) break;
  16049. h = f.parent ? a.getTimeline(f.parent) : null;
  16050. n = m.getFrameList();
  16051. x = E = z = null;
  16052. H = n.length;
  16053. for (var G = 0; G < H; G++) {
  16054. y = n[G];
  16055. h ? (c._helpTransform1.copy(y.global),
  16056. c.getTimelineTransform(h, y.position, c._helpTransform2), g.transformPointWithParent(c._helpTransform1, c._helpTransform2), y.transform.copy(c._helpTransform1)) : y.transform.copy(y.global);
  16057. y.transform.x -= f.transform.x;
  16058. y.transform.y -= f.transform.y;
  16059. y.transform.skewX -= f.transform.skewX;
  16060. y.transform.skewY -= f.transform.skewY;
  16061. y.transform.scaleX -= f.transform.scaleX;
  16062. y.transform.scaleY -= f.transform.scaleY;
  16063. !m.transformed && k && (y.zOrder -= k.zOrder);
  16064. z || (z = m.originTransform, z.copy(y.transform), z.skewX = g.formatRadian(z.skewX),
  16065. z.skewY = g.formatRadian(z.skewY), E = m.originPivot, E.x = y.pivot.x, E.y = y.pivot.y);
  16066. y.transform.x -= z.x;
  16067. y.transform.y -= z.y;
  16068. y.transform.skewX = g.formatRadian(y.transform.skewX - z.skewX);
  16069. y.transform.skewY = g.formatRadian(y.transform.skewY - z.skewY);
  16070. y.transform.scaleX -= z.scaleX;
  16071. y.transform.scaleY -= z.scaleY;
  16072. m.transformed || (y.pivot.x -= E.x, y.pivot.y -= E.y);
  16073. if (x) {
  16074. var M = y.transform.skewX - x.transform.skewX;
  16075. x.tweenRotate ? 0 < x.tweenRotate ? (0 > M && (y.transform.skewX += 2 * Math.PI, y.transform.skewY += 2 * Math.PI), 1 < x.tweenRotate &&
  16076. (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 + g.formatRadian(y.transform.skewX - x.transform.skewX), y.transform.skewY = x.transform.skewY + g.formatRadian(y.transform.skewY - x.transform.skewY))
  16077. }
  16078. x = y
  16079. }
  16080. m.transformed = !0
  16081. }
  16082. };
  16083. c.getTimelineTransform =
  16084. function(b, c, d) {
  16085. for (var e = b.getFrameList(), l = e.length, f; l--;)
  16086. if (b = e[l], b.position <= c && b.position + b.duration > c) {
  16087. f = b.tweenEasing;
  16088. l == e.length - 1 || isNaN(f) || c == b.position ? d.copy(b.global) : (c = (c - b.position) / b.duration, f && (c = a.TimelineState.getEaseValue(c, f)), e = e[l + 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 = g.formatRadian(b.global.skewX + (e.global.skewX - b.global.skewX) * c), d.skewY = g.formatRadian(b.global.skewY + (e.global.skewY - b.global.skewY) * c), d.scaleX = b.global.scaleX +
  16089. (e.global.scaleX - b.global.scaleX) * c, d.scaleY = b.global.scaleY + (e.global.scaleY - b.global.scaleY) * c);
  16090. break
  16091. }
  16092. };
  16093. c.addHideTimeline = function(a, c) {
  16094. for (var d = c.getBoneDataList(), e = d.length, g; e--;) g = d[e], g = g.name, a.getTimeline(g) || a.addTimeline(b.TransformTimeline.HIDE_TIMELINE, g)
  16095. };
  16096. c._helpTransform1 = new b.DBTransform;
  16097. c._helpTransform2 = new b.DBTransform;
  16098. return c
  16099. }();
  16100. c.DBDataUtil = d
  16101. })(c.utils || (c.utils = {}));
  16102. var g = c.utils,
  16103. l = function() {
  16104. function a() {
  16105. this.global = new b.DBTransform;
  16106. this.origin = new b.DBTransform;
  16107. this.offset =
  16108. new b.DBTransform;
  16109. this.tween = new b.DBTransform;
  16110. this.tween.scaleX = this.tween.scaleY = 0;
  16111. this._globalTransformMatrix = new e.Matrix;
  16112. this._visible = !0;
  16113. this._isDisplayOnStage = this._isColorChanged = !1;
  16114. this._scaleType = 0;
  16115. this.fixedRotation = !1
  16116. }
  16117. a.prototype.getVisible = function() {
  16118. return this._visible
  16119. };
  16120. a.prototype.setVisible = function(a) {
  16121. this._visible = a
  16122. };
  16123. a.prototype._setParent = function(a) {
  16124. this.parent = a
  16125. };
  16126. a.prototype._setArmature = function(a) {
  16127. this.armature && this.armature._removeDBObject(this);
  16128. (this.armature = a) && this.armature._addDBObject(this)
  16129. };
  16130. a.prototype.dispose = function() {
  16131. this._globalTransformMatrix = this.tween = this.offset = this.origin = this.global = this.armature = this.parent = null
  16132. };
  16133. a.prototype._update = function() {
  16134. this.global.scaleX = (this.origin.scaleX + this.tween.scaleX) * this.offset.scaleX;
  16135. this.global.scaleY = (this.origin.scaleY + this.tween.scaleY) * this.offset.scaleY;
  16136. if (this.parent) {
  16137. var a = this.origin.x + this.offset.x + this.tween.x,
  16138. b = this.origin.y + this.offset.y + this.tween.y,
  16139. c = this.parent._globalTransformMatrix;
  16140. this._globalTransformMatrix.tx = this.global.x =
  16141. c.a * a + c.c * b + c.tx;
  16142. this._globalTransformMatrix.ty = this.global.y = c.d * b + c.b * a + c.ty;
  16143. 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);
  16144. this.parent.scaleMode >= this._scaleType && (this.global.scaleX *= this.parent.global.scaleX,
  16145. this.global.scaleY *= this.parent.global.scaleY)
  16146. } else this._globalTransformMatrix.tx = this.global.x = this.origin.x + this.offset.x + this.tween.x, this._globalTransformMatrix.ty = this.global.y = this.origin.y + this.offset.y + this.tween.y, this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY;
  16147. this._globalTransformMatrix.a = this.global.scaleX * Math.cos(this.global.skewY);
  16148. this._globalTransformMatrix.b = this.global.scaleX * Math.sin(this.global.skewY);
  16149. this._globalTransformMatrix.c = -this.global.scaleY * Math.sin(this.global.skewX);
  16150. this._globalTransformMatrix.d = this.global.scaleY * Math.cos(this.global.skewX)
  16151. };
  16152. return a
  16153. }();
  16154. c.DBObject = l;
  16155. var m = function(a) {
  16156. function b(c) {
  16157. a.call(this);
  16158. this._displayBridge = c;
  16159. this._displayList = [];
  16160. this._displayIndex = -1;
  16161. this._scaleType = 1;
  16162. this._offsetZOrder = this._tweenZorder = this._originZOrder = 0;
  16163. this._isHideDisplay = this._isDisplayOnStage = !1;
  16164. this._blendMode = "normal";
  16165. this._displayBridge.updateBlendMode(this._blendMode)
  16166. }
  16167. __extends(b,
  16168. a);
  16169. b.prototype.getZOrder = function() {
  16170. return this._originZOrder + this._tweenZorder + this._offsetZOrder
  16171. };
  16172. b.prototype.setZOrder = function(a) {
  16173. this.getZOrder() != a && (this._offsetZOrder = a - this._originZOrder - this._tweenZorder, this.armature && (this.armature._slotsZOrderChanged = !0))
  16174. };
  16175. b.prototype.getDisplay = function() {
  16176. var a = this._displayList[this._displayIndex];
  16177. return a instanceof h ? a.getDisplay() : a
  16178. };
  16179. b.prototype.setDisplay = function(a) {
  16180. this._displayList[this._displayIndex] = a;
  16181. this._setDisplay(a)
  16182. };
  16183. b.prototype.getBlendMode =
  16184. function() {
  16185. return this._blendMode
  16186. };
  16187. b.prototype.setBlendMode = function(a) {
  16188. this._blendMode != a && (this._blendMode = a, this._displayBridge.getDisplay() && this._displayBridge.updateBlendMode(this._blendMode))
  16189. };
  16190. b.prototype.getChildArmature = function() {
  16191. var a = this._displayList[this._displayIndex];
  16192. return a instanceof h ? a : null
  16193. };
  16194. b.prototype.setChildArmature = function(a) {
  16195. (this._displayList[this._displayIndex] = a) && this._setDisplay(a.getDisplay())
  16196. };
  16197. b.prototype.getDisplayList = function() {
  16198. return this._displayList
  16199. };
  16200. b.prototype.setDisplayList =
  16201. function(a) {
  16202. if (!a) throw Error();
  16203. for (var b = this._displayList.length = a.length; b--;) this._displayList[b] = a[b];
  16204. 0 <= this._displayIndex && (a = this._displayIndex, this._displayIndex = -1, this._changeDisplay(a))
  16205. };
  16206. b.prototype._setDisplay = function(a) {
  16207. this._displayBridge.getDisplay() ? this._displayBridge.setDisplay(a) : (this._displayBridge.setDisplay(a), this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0));
  16208. this.updateChildArmatureAnimation();
  16209. a && this._displayBridge.updateBlendMode(this._blendMode);
  16210. !this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  16211. };
  16212. b.prototype._changeDisplay = function(a) {
  16213. if (0 > a) this._isHideDisplay || (this._isHideDisplay = !0, this._displayBridge.removeDisplay(), this.updateChildArmatureAnimation());
  16214. else {
  16215. if (this._isHideDisplay) {
  16216. this._isHideDisplay = !1;
  16217. var b = !0;
  16218. this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0)
  16219. }
  16220. var c = this._displayList.length;
  16221. a >= c && 0 < c && (a = c - 1);
  16222. this._displayIndex !=
  16223. a ? (this._displayIndex = a, a = this._displayList[this._displayIndex], a instanceof h ? 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()
  16224. }!this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  16225. };
  16226. b.prototype.setVisible = function(a) {
  16227. a != this._visible && (this._visible = a, this._updateVisible(this._visible))
  16228. };
  16229. b.prototype._setArmature = function(b) {
  16230. a.prototype._setArmature.call(this, b);
  16231. this.armature ? (this.armature._slotsZOrderChanged = !0, this._displayBridge.addDisplay(this.armature.getDisplay(), -1)) : this._displayBridge.removeDisplay()
  16232. };
  16233. b.prototype.dispose = function() {
  16234. this._displayBridge && (a.prototype.dispose.call(this), this._displayBridge.dispose(), this._displayList.length = 0, this._dislayDataList = this._displayList = this._displayBridge = null)
  16235. };
  16236. b.prototype._update = function() {
  16237. a.prototype._update.call(this);
  16238. if (this._isDisplayOnStage) {
  16239. var b =
  16240. this.parent._tweenPivot.x,
  16241. c = this.parent._tweenPivot.y;
  16242. if (b || c) {
  16243. var d = this.parent._globalTransformMatrix;
  16244. this._globalTransformMatrix.tx += d.a * b + d.c * c;
  16245. this._globalTransformMatrix.ty += d.b * b + d.d * c
  16246. }
  16247. this._displayBridge.updateTransform(this._globalTransformMatrix, this.global)
  16248. }
  16249. };
  16250. b.prototype._updateVisible = function(a) {
  16251. this._displayBridge.setVisible(this.parent.getVisible() && this._visible && a)
  16252. };
  16253. b.prototype.updateChildArmatureAnimation = function() {
  16254. var a = this.getChildArmature();
  16255. if (a)
  16256. if (this._isHideDisplay) a.animation.stop(),
  16257. a.animation._lastAnimationState = null;
  16258. else {
  16259. var b = this.armature ? this.armature.animation.getLastAnimationName() : null;
  16260. b && a.animation.hasAnimation(b) ? a.animation.gotoAndPlay(b) : a.animation.play()
  16261. }
  16262. };
  16263. return b
  16264. }(l);
  16265. c.Slot = m;
  16266. var f = function(a) {
  16267. function b() {
  16268. a.call(this);
  16269. this._children = [];
  16270. this._scaleType = 2;
  16271. this._tweenPivot = new e.Point;
  16272. this.scaleMode = 1
  16273. }
  16274. __extends(b, a);
  16275. b.prototype.setVisible = function(a) {
  16276. if (this._visible != a)
  16277. for (this._visible = a, a = this._children.length; a--;) {
  16278. var b = this._children[a];
  16279. b instanceof m &&
  16280. b._updateVisible(this._visible)
  16281. }
  16282. };
  16283. b.prototype._setArmature = function(b) {
  16284. a.prototype._setArmature.call(this, b);
  16285. for (b = this._children.length; b--;) this._children[b]._setArmature(this.armature)
  16286. };
  16287. b.prototype.dispose = function() {
  16288. if (this._children) {
  16289. a.prototype.dispose.call(this);
  16290. for (var b = this._children.length; b--;) this._children[b].dispose();
  16291. this._children.length = 0;
  16292. this.slot = this._tweenPivot = this._children = null
  16293. }
  16294. };
  16295. b.prototype.contains = function(a) {
  16296. if (!a) throw Error();
  16297. if (a == this) return !1;
  16298. for (; a != this && null !=
  16299. a;) a = a.parent;
  16300. return a == this
  16301. };
  16302. b.prototype.addChild = function(a) {
  16303. if (!a) throw Error();
  16304. 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.)");
  16305. a.parent && a.parent.removeChild(a);
  16306. this._children[this._children.length] = a;
  16307. a._setParent(this);
  16308. a._setArmature(this.armature);
  16309. !this.slot && a instanceof m && (this.slot = a)
  16310. };
  16311. b.prototype.removeChild = function(a) {
  16312. if (!a) throw Error();
  16313. var b = this._children.indexOf(a);
  16314. if (0 <=
  16315. b) this._children.splice(b, 1), a._setParent(null), a._setArmature(null), a == this.slot && (this.slot = null);
  16316. else throw Error();
  16317. };
  16318. b.prototype.getSlots = function() {
  16319. for (var a = [], b = this._children.length; b--;) this._children[b] instanceof m && a.unshift(this._children[b]);
  16320. return a
  16321. };
  16322. b.prototype._arriveAtFrame = function(a, c, e, g) {
  16323. if (a) {
  16324. 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 !=
  16325. 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 =
  16326. e, c.sound = a.sound, b._soundManager.dispatchEvent(c)), a.action)
  16327. for (var l in this._children) this._children[l] instanceof m && (e = this._children[l].getChildArmature()) && e.animation.gotoAndPlay(a.action)
  16328. } else this.slot && this.slot._changeDisplay(-1)
  16329. };
  16330. b.prototype._updateColor = function(a, b, c, d, e, g, l, f, m) {
  16331. (m || this._isColorChanged) && this.slot._displayBridge.updateColor(a, b, c, d, e, g, l, f);
  16332. this._isColorChanged = m
  16333. };
  16334. b._soundManager = d.SoundEventManager.getInstance();
  16335. return b
  16336. }(l);
  16337. c.Bone = f;
  16338. var h = function(b) {
  16339. function c(d) {
  16340. b.call(this);
  16341. this.animation = new a.Animation(this);
  16342. this._display = d;
  16343. this._slotsZOrderChanged = !1;
  16344. this._slotList = [];
  16345. this._boneList = [];
  16346. this._eventList = []
  16347. }
  16348. __extends(c, b);
  16349. c.prototype.getDisplay = function() {
  16350. return this._display
  16351. };
  16352. c.prototype.dispose = function() {
  16353. if (this.animation) {
  16354. this.animation.dispose();
  16355. for (var a = this._slotList.length; a--;) this._slotList[a].dispose();
  16356. for (a = this._boneList.length; a--;) this._boneList[a].dispose();
  16357. this._slotList.length = 0;
  16358. this._boneList.length = 0;
  16359. this._eventList.length = 0;
  16360. this.animation = this._display =
  16361. this._eventList = this._boneList = this._slotList = null
  16362. }
  16363. };
  16364. c.prototype.advanceTime = function(a) {
  16365. this.animation.advanceTime(a);
  16366. a *= this.animation.timeScale;
  16367. for (var b = this._boneList.length; b--;) this._boneList[b]._update();
  16368. for (var b = this._slotList.length, c; b--;) c = this._slotList[b], c._update(), c._isDisplayOnStage && (c = c.getChildArmature()) && c.advanceTime(a);
  16369. this._slotsZOrderChanged && (this.updateSlotsZOrder(), this.hasEventListener(d.ArmatureEvent.Z_ORDER_UPDATED) && this.dispatchEvent(new d.ArmatureEvent(d.ArmatureEvent.Z_ORDER_UPDATED)));
  16370. if (this._eventList.length) {
  16371. a = this._eventList.length;
  16372. for (b = 0; b < a; b++) this.dispatchEvent(this._eventList[b]);
  16373. this._eventList.length = 0
  16374. }
  16375. };
  16376. c.prototype.getSlots = function(a) {
  16377. "undefined" === typeof a && (a = !0);
  16378. return a ? this._slotList.concat() : this._slotList
  16379. };
  16380. c.prototype.getBones = function(a) {
  16381. "undefined" === typeof a && (a = !0);
  16382. return a ? this._boneList.concat() : this._boneList
  16383. };
  16384. c.prototype.getSlot = function(a) {
  16385. for (var b = this._slotList.length; b--;)
  16386. if (this._slotList[b].name == a) return this._slotList[b];
  16387. return null
  16388. };
  16389. c.prototype.getSlotByDisplay =
  16390. function(a) {
  16391. if (a)
  16392. for (var b = this._slotList.length; b--;)
  16393. if (this._slotList[b].getDisplay() == a) return this._slotList[b];
  16394. return null
  16395. };
  16396. c.prototype.removeSlot = function(a) {
  16397. if (!a) throw Error();
  16398. if (0 <= this._slotList.indexOf(a)) a.parent.removeChild(a);
  16399. else throw Error();
  16400. };
  16401. c.prototype.removeSlotByName = function(a) {
  16402. a && (a = this.getSlot(a)) && this.removeSlot(a)
  16403. };
  16404. c.prototype.getBone = function(a) {
  16405. for (var b = this._boneList.length; b--;)
  16406. if (this._boneList[b].name == a) return this._boneList[b];
  16407. return null
  16408. };
  16409. c.prototype.getBoneByDisplay =
  16410. function(a) {
  16411. return (a = this.getSlotByDisplay(a)) ? a.parent : null
  16412. };
  16413. c.prototype.removeBone = function(a) {
  16414. if (!a) throw Error();
  16415. if (0 <= this._boneList.indexOf(a)) a.parent ? a.parent.removeChild(a) : a._setArmature(null);
  16416. else throw Error();
  16417. };
  16418. c.prototype.removeBoneByName = function(a) {
  16419. a && (a = this.getBone(a)) && this.removeBone(a)
  16420. };
  16421. c.prototype.addChild = function(a, b) {
  16422. if (!a) throw Error();
  16423. if (b) {
  16424. var c = this.getBone(b);
  16425. if (c) c.addChild(a);
  16426. else throw Error();
  16427. } else a.parent && a.parent.removeChild(a), a._setArmature(this)
  16428. };
  16429. c.prototype.updateSlotsZOrder =
  16430. function() {
  16431. this._slotList.sort(this.sortSlot);
  16432. for (var a = this._slotList.length, b; a--;) b = this._slotList[a], b._isDisplayOnStage && b._displayBridge.addDisplay(this._display, -1);
  16433. this._slotsZOrderChanged = !1
  16434. };
  16435. c.prototype._addDBObject = function(a) {
  16436. a instanceof m ? 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())
  16437. };
  16438. c.prototype._removeDBObject = function(a) {
  16439. a instanceof m ? (a = this._slotList.indexOf(a),
  16440. 0 <= a && this._slotList.splice(a, 1)) : a instanceof f && (a = this._boneList.indexOf(a), 0 <= a && this._boneList.splice(a, 1))
  16441. };
  16442. c.prototype._sortBoneList = function() {
  16443. var a = this._boneList.length;
  16444. if (0 != a) {
  16445. for (var b = [], c, d, e; a--;) {
  16446. c = 0;
  16447. for (e = d = this._boneList[a]; e;) c++, e = e.parent;
  16448. b[a] = {
  16449. level: c,
  16450. bone: d
  16451. }
  16452. }
  16453. b.sort(this.sortBone);
  16454. for (a = b.length; a--;) this._boneList[a] = b[a].bone
  16455. }
  16456. };
  16457. c.prototype._arriveAtFrame = function(a, b, e, g) {
  16458. a.event && this.hasEventListener(d.FrameEvent.ANIMATION_FRAME_EVENT) && (b = new d.FrameEvent(d.FrameEvent.ANIMATION_FRAME_EVENT),
  16459. b.animationState = e, b.frameLabel = a.event, this._eventList.push(b));
  16460. 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));
  16461. a.action && e.isPlaying && this.animation.gotoAndPlay(a.action)
  16462. };
  16463. c.prototype.sortSlot = function(a, b) {
  16464. return a.getZOrder() < b.getZOrder() ? 1 : -1
  16465. };
  16466. c.prototype.sortBone = function(a, b) {
  16467. return a.level < b.level ? 1 : -1
  16468. };
  16469. c._soundManager = d.SoundEventManager.getInstance();
  16470. return c
  16471. }(d.EventDispatcher);
  16472. c.Armature = h
  16473. })(dragonBones || (dragonBones = {}));
  16474. __extends = this.__extends || function(c, e) {
  16475. function d() {
  16476. this.constructor = c
  16477. }
  16478. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16479. d.prototype = e.prototype;
  16480. c.prototype = new d
  16481. };
  16482. (function(c) {
  16483. (function(c) {
  16484. var a = function() {
  16485. function a() {}
  16486. a.prototype.getVisible = function() {
  16487. return this._display ? this._display.visible : !1
  16488. };
  16489. a.prototype.setVisible = function(a) {
  16490. this._display && (this._display.visible = a)
  16491. };
  16492. a.prototype.getDisplay = function() {
  16493. return this._display
  16494. };
  16495. a.prototype.setDisplay = function(a) {
  16496. if (this._display != a) {
  16497. if (this._display) {
  16498. var b = this._display.parent;
  16499. if (b) var c = b.getChildIndex(this._display);
  16500. this.removeDisplay()
  16501. }
  16502. this._display = a;
  16503. this.addDisplay(b, c)
  16504. }
  16505. };
  16506. a.prototype.dispose = function() {
  16507. this._display =
  16508. null
  16509. };
  16510. a.prototype.updateTransform = function(c, d) {
  16511. this._display._x = c.tx;
  16512. this._display._y = c.ty;
  16513. this._display._skewX = d.skewX * a.RADIAN_TO_ANGLE;
  16514. this._display._skewY = d.skewY * a.RADIAN_TO_ANGLE;
  16515. this._display._scaleX = d.scaleX;
  16516. this._display._scaleY = d.scaleY
  16517. };
  16518. a.prototype.updateColor = function(a, b, c, d, e, k, n, q) {
  16519. this._display && (this._display._alpha = e)
  16520. };
  16521. a.prototype.updateBlendMode = function(a) {
  16522. this._display && a && (this._display.blendMode = egret.BlendMode.getBlendMode(a))
  16523. };
  16524. a.prototype.addDisplay = function(a, b) {
  16525. a && this._display &&
  16526. (this._display._parent && this._display._parent.removeChild(this._display), 0 > b ? a.addChild(this._display) : a.addChildAt(this._display, Math.min(b, a.numChildren)))
  16527. };
  16528. a.prototype.removeDisplay = function() {
  16529. this._display && this._display._parent && this._display._parent.removeChild(this._display)
  16530. };
  16531. a.RADIAN_TO_ANGLE = 180 / Math.PI;
  16532. return a
  16533. }();
  16534. c.DragonBonesEgretBridge = a
  16535. })(c.display || (c.display = {}));
  16536. var e = c.display;
  16537. (function(d) {
  16538. var a = function() {
  16539. function a(b, d, e) {
  16540. "undefined" === typeof e && (e = 1);
  16541. this.texture = b;
  16542. this.textureAtlasRawData =
  16543. d;
  16544. this._textureData = {};
  16545. this.scale = e;
  16546. this.name = d[c.utils.ConstValues.A_NAME];
  16547. this.parseData(d);
  16548. this.spriteSheet = new egret.SpriteSheet(b)
  16549. }
  16550. a.prototype.getTexture = function(a) {
  16551. var b = this.spriteSheet.getTexture(a);
  16552. b || (b = this._textureData[a], b = this.spriteSheet.createTexture(a, b.x, b.y, b.width, b.height));
  16553. return b
  16554. };
  16555. a.prototype.dispose = function() {
  16556. this.texture = null
  16557. };
  16558. a.prototype.getRegion = function(a) {
  16559. throw Error("error");
  16560. };
  16561. a.prototype.parseData = function(a) {
  16562. for (var b = a.SubTexture.length, c = 0; c < b; c++) {
  16563. var d = a.SubTexture[c];
  16564. this._textureData[d.name] = d
  16565. }
  16566. };
  16567. return a
  16568. }();
  16569. d.EgretTextureAtlas = a
  16570. })(c.textures || (c.textures = {}));
  16571. (function(d) {
  16572. var a = function(a) {
  16573. function d() {
  16574. a.call(this)
  16575. }
  16576. __extends(d, a);
  16577. d.prototype._generateArmature = function() {
  16578. return new c.Armature(new egret.DisplayObjectContainer)
  16579. };
  16580. d.prototype._generateSlot = function() {
  16581. return new c.Slot(new e.DragonBonesEgretBridge)
  16582. };
  16583. d.prototype._generateDisplay = function(a, b, c, d) {
  16584. var e = new egret.Bitmap;
  16585. e.texture = a.getTexture(b);
  16586. e.anchorOffsetX = c;
  16587. e.anchorOffsetY = d;
  16588. return e
  16589. };
  16590. return d
  16591. }(d.BaseFactory);
  16592. d.EgretFactory = a
  16593. })(c.factorys || (c.factorys = {}))
  16594. })(dragonBones || (dragonBones = {}));
  16595. (function(c) {
  16596. var e = function() {
  16597. function d() {}
  16598. d.TRACE_RENDER_LOOP = function(a) {
  16599. "undefined" === typeof a && (a = 0);
  16600. var b = c.Ticker.getInstance(),
  16601. d = c.MainContext.instance;
  16602. switch (a) {
  16603. case 0:
  16604. b.unregister(d.renderLoop, d);
  16605. break;
  16606. case 1:
  16607. d.renderLoop();
  16608. break;
  16609. case 2:
  16610. b.register(d.renderLoop, d)
  16611. }
  16612. };
  16613. d.DRAW_IMAGE = !0;
  16614. d.ADD_EVENT_LISTENER = !0;
  16615. d.SCALE_BITMAP_SET_SCALE_GRID = !0;
  16616. return d
  16617. }();
  16618. c.DEBUG = e
  16619. })(egret || (egret = {}));
  16620. (function(c) {
  16621. var e = function() {
  16622. function c() {}
  16623. c.isNumber = function(a) {
  16624. return "number" === typeof a && !isNaN(a)
  16625. };
  16626. return c
  16627. }();
  16628. c.NumberUtils = e
  16629. })(egret || (egret = {}));
  16630. var __extends = this.__extends || function(c, e) {
  16631. function d() {
  16632. this.constructor = c
  16633. }
  16634. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16635. d.prototype = e.prototype;
  16636. c.prototype = new d
  16637. },
  16638. RES;
  16639. (function(c) {
  16640. var e = function(c) {
  16641. function a(a, e, l) {
  16642. "undefined" === typeof e && (e = !1);
  16643. "undefined" === typeof l && (l = !1);
  16644. c.call(this, a, e, l);
  16645. this.itemsTotal = this.itemsLoaded = 0
  16646. }
  16647. __extends(a, c);
  16648. a.dispatchResourceEvent = function(b, c, d, e, f, h) {
  16649. "undefined" === typeof d && (d = "");
  16650. "undefined" === typeof e && (e = null);
  16651. "undefined" === typeof f && (f = 0);
  16652. "undefined" === typeof h && (h = 0);
  16653. var k = egret.Event._getPropertyData(a);
  16654. k.groupName = d;
  16655. k.resItem = e;
  16656. k.itemsLoaded = f;
  16657. k.itemsTotal = h;
  16658. egret.Event._dispatchByTarget(a, b, c, k)
  16659. };
  16660. a.ITEM_LOAD_ERROR =
  16661. "itemLoadError";
  16662. a.CONFIG_COMPLETE = "configComplete";
  16663. a.GROUP_PROGRESS = "groupProgress";
  16664. a.GROUP_COMPLETE = "groupComplete";
  16665. return a
  16666. }(egret.Event);
  16667. c.ResourceEvent = e
  16668. })(RES || (RES = {}));
  16669. (function(c) {
  16670. var e = function() {
  16671. function c(a, b, d) {
  16672. this._loaded = !1;
  16673. this.name = a;
  16674. this.url = b;
  16675. this.type = d
  16676. }
  16677. Object.defineProperty(c.prototype, "loaded", {
  16678. get: function() {
  16679. return this.data ? this.data.loaded : this._loaded
  16680. },
  16681. set: function(a) {
  16682. this.data && (this.data.loaded = a);
  16683. this._loaded = a
  16684. },
  16685. enumerable: !0,
  16686. configurable: !0
  16687. });
  16688. c.prototype.toString = function() {
  16689. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  16690. };
  16691. c.TYPE_XML = "xml";
  16692. c.TYPE_IMAGE = "image";
  16693. c.TYPE_BIN = "bin";
  16694. c.TYPE_TEXT = "text";
  16695. c.TYPE_JSON =
  16696. "json";
  16697. c.TYPE_SHEET = "sheet";
  16698. c.TYPE_FONT = "font";
  16699. c.TYPE_SOUND = "sound";
  16700. return c
  16701. }();
  16702. c.ResourceItem = e
  16703. })(RES || (RES = {}));
  16704. (function(c) {
  16705. var e = function() {
  16706. function d() {
  16707. this.keyMap = {};
  16708. this.groupDic = {}
  16709. }
  16710. d.prototype.getGroupByName = function(a) {
  16711. var b = [];
  16712. if (!this.groupDic[a]) return b;
  16713. a = this.groupDic[a];
  16714. for (var c = a.length, d = 0; d < c; d++) b.push(this.parseResourceItem(a[d]));
  16715. return b
  16716. };
  16717. d.prototype.getRawGroupByName = function(a) {
  16718. return this.groupDic[a] ? this.groupDic[a] : []
  16719. };
  16720. d.prototype.createGroup = function(a, b, c) {
  16721. "undefined" === typeof c && (c = !1);
  16722. if (!c && this.groupDic[a] || !b || 0 == b.length) return !1;
  16723. c = this.groupDic;
  16724. for (var d = [], e = b.length, f = 0; f <
  16725. e; f++) {
  16726. var h = b[f],
  16727. k = c[h];
  16728. if (k)
  16729. for (var h = k.length, n = 0; n < h; n++) {
  16730. var q = k[n]; - 1 == d.indexOf(q) && d.push(q)
  16731. } else(q = this.keyMap[h]) && -1 == d.indexOf(q) && d.push(q)
  16732. }
  16733. if (0 == d.length) return !1;
  16734. this.groupDic[a] = d;
  16735. return !0
  16736. };
  16737. d.prototype.parseConfig = function(a, b) {
  16738. if (a) {
  16739. var c = a.resources;
  16740. if (c)
  16741. for (var d = c.length, e = 0; e < d; e++) {
  16742. var f = c[e];
  16743. f.url = b + f.url;
  16744. this.keyMap[f.name] || (this.keyMap[f.name] = f)
  16745. }
  16746. if (c = a.groups)
  16747. for (d = c.length, e = 0; e < d; e++) {
  16748. for (var h = c[e], k = [], n = h.keys.split(","), q = n.length, p = 0; p < q; p++) f = n[p].trim(), (f = this.keyMap[f]) &&
  16749. -1 == k.indexOf(f) && k.push(f);
  16750. this.groupDic[h.name] = k
  16751. }
  16752. }
  16753. };
  16754. d.prototype.getType = function(a) {
  16755. return (a = this.keyMap[a]) ? a.type : ""
  16756. };
  16757. d.prototype.getRawResourceItem = function(a) {
  16758. return this.keyMap[a]
  16759. };
  16760. d.prototype.getResourceItem = function(a) {
  16761. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  16762. };
  16763. d.prototype.parseResourceItem = function(a) {
  16764. var b = new c.ResourceItem(a.name, a.url, a.type);
  16765. b.data = a;
  16766. return b
  16767. };
  16768. return d
  16769. }();
  16770. c.ResourceConfig = e
  16771. })(RES || (RES = {}));
  16772. __extends = this.__extends || function(c, e) {
  16773. function d() {
  16774. this.constructor = c
  16775. }
  16776. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16777. d.prototype = e.prototype;
  16778. c.prototype = new d
  16779. };
  16780. (function(c) {
  16781. var e = function(d) {
  16782. function a() {
  16783. d.call(this);
  16784. this.groupTotalDic = {};
  16785. this.numLoadedDic = {};
  16786. this.itemListDic = {};
  16787. this.priorityQueue = {};
  16788. this.lazyLoadList = [];
  16789. this.analyzerDic = {};
  16790. this.queueIndex = 0
  16791. }
  16792. __extends(a, d);
  16793. a.prototype.isGroupInLoading = function(a) {
  16794. return void 0 !== this.itemListDic[a]
  16795. };
  16796. a.prototype.loadGroup = function(a, d, e) {
  16797. "undefined" === typeof e && (e = 0);
  16798. if (!this.itemListDic[d] && d)
  16799. if (a && 0 != a.length) {
  16800. this.priorityQueue[e] ? this.priorityQueue[e].push(d) : this.priorityQueue[e] = [d];
  16801. this.itemListDic[d] =
  16802. a;
  16803. e = a.length;
  16804. for (var m = 0; m < e; m++) a[m].groupName = d;
  16805. this.groupTotalDic[d] = a.length;
  16806. this.numLoadedDic[d] = 0;
  16807. this.next()
  16808. } else a = new c.ResourceEvent(c.ResourceEvent.GROUP_COMPLETE), a.groupName = d, this.dispatchEvent(a)
  16809. };
  16810. a.prototype.loadItem = function(a) {
  16811. this.lazyLoadList.push(a);
  16812. a.groupName = "";
  16813. this.next()
  16814. };
  16815. a.prototype.next = function() {
  16816. var a = this.getOneResourceItem();
  16817. if (a)
  16818. if (a.loaded) this.onItemComplete(a);
  16819. else {
  16820. var d = this.analyzerDic[a.type];
  16821. d || (d = this.analyzerDic[a.type] = egret.Injector.getInstance(c.AnalyzerBase,
  16822. a.type));
  16823. d.loadFile(a, this.onItemComplete, this)
  16824. }
  16825. };
  16826. a.prototype.getOneResourceItem = function() {
  16827. var a = Number.NEGATIVE_INFINITY,
  16828. c;
  16829. for (c in this.priorityQueue) a = Math.max(a, c);
  16830. a = this.priorityQueue[a];
  16831. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  16832. c = a.length;
  16833. for (var d, e = 0; e < c; e++) {
  16834. this.queueIndex >= c && (this.queueIndex = 0);
  16835. d = this.itemListDic[a[this.queueIndex]];
  16836. if (0 < d.length) break;
  16837. this.queueIndex++
  16838. }
  16839. return 0 == d.length ? null : d.shift()
  16840. };
  16841. a.prototype.onItemComplete = function(a) {
  16842. var d =
  16843. a.groupName;
  16844. a.loaded || c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.ITEM_LOAD_ERROR, d, a);
  16845. if (d) {
  16846. this.numLoadedDic[d]++;
  16847. var e = this.numLoadedDic[d],
  16848. m = this.groupTotalDic[d];
  16849. c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.GROUP_PROGRESS, d, a, e, m);
  16850. e == m && (this.removeGroupName(d), delete this.groupTotalDic[d], delete this.numLoadedDic[d], delete this.itemListDic[d], c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, d))
  16851. } else this.callBack.call(this.resInstance,
  16852. a);
  16853. this.next()
  16854. };
  16855. a.prototype.removeGroupName = function(a) {
  16856. for (var c in this.priorityQueue) {
  16857. for (var d = this.priorityQueue[c], e = d.length, f = 0, h = !1, e = d.length, k = 0; k < e; k++) {
  16858. if (d[k] == a) {
  16859. d.splice(f, 1);
  16860. h = !0;
  16861. break
  16862. }
  16863. f++
  16864. }
  16865. if (h) {
  16866. 0 == d.length && delete this.priorityQueue[c];
  16867. break
  16868. }
  16869. }
  16870. };
  16871. return a
  16872. }(egret.EventDispatcher);
  16873. c.ResourceLoader = e
  16874. })(RES || (RES = {}));
  16875. __extends = this.__extends || function(c, e) {
  16876. function d() {
  16877. this.constructor = c
  16878. }
  16879. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16880. d.prototype = e.prototype;
  16881. c.prototype = new d
  16882. };
  16883. (function(c) {
  16884. var e = function(c) {
  16885. function a() {
  16886. c.call(this)
  16887. }
  16888. __extends(a, c);
  16889. a.prototype.loadFile = function(a, c, d) {};
  16890. a.prototype.getRes = function(a) {};
  16891. a.prototype.destroyRes = function(a) {
  16892. return !1
  16893. };
  16894. a.getStringPrefix = function(a) {
  16895. if (!a) return "";
  16896. var c = a.indexOf(".");
  16897. return -1 != c ? a.substring(0, c) : ""
  16898. };
  16899. a.getStringTail = function(a) {
  16900. if (!a) return "";
  16901. var c = a.indexOf(".");
  16902. return -1 != c ? a.substring(c + 1) : ""
  16903. };
  16904. return a
  16905. }(egret.HashObject);
  16906. c.AnalyzerBase = e
  16907. })(RES || (RES = {}));
  16908. __extends = this.__extends || function(c, e) {
  16909. function d() {
  16910. this.constructor = c
  16911. }
  16912. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16913. d.prototype = e.prototype;
  16914. c.prototype = new d
  16915. };
  16916. (function(c) {
  16917. var e = function(c) {
  16918. function a() {
  16919. c.call(this);
  16920. this.fileDic = {};
  16921. this.resItemDic = [];
  16922. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  16923. this.recycler = new egret.Recycler
  16924. }
  16925. __extends(a, c);
  16926. a.prototype.loadFile = function(a, c, d) {
  16927. if (this.fileDic[a.name]) c.call(d, a);
  16928. else {
  16929. var e = this.getLoader();
  16930. this.resItemDic[e.hashCode] = {
  16931. item: a,
  16932. func: c,
  16933. thisObject: d
  16934. };
  16935. e.load(new egret.URLRequest(a.url))
  16936. }
  16937. };
  16938. a.prototype.getLoader = function() {
  16939. var a = this.recycler.pop();
  16940. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  16941. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  16942. a.dataFormat = this._dataFormat;
  16943. return a
  16944. };
  16945. a.prototype.onLoadFinish = function(a) {
  16946. var c = a.target,
  16947. d = this.resItemDic[c.hashCode];
  16948. delete this.resItemDic[c.hashCode];
  16949. this.recycler.push(c);
  16950. var e = d.item,
  16951. f = d.func;
  16952. e.loaded = a.type == egret.Event.COMPLETE;
  16953. e.loaded && this.analyzeData(e, c.data);
  16954. f.call(d.thisObject, e)
  16955. };
  16956. a.prototype.analyzeData = function(a, c) {
  16957. var d = a.name;
  16958. !this.fileDic[d] && c && (this.fileDic[d] = c)
  16959. };
  16960. a.prototype.getRes =
  16961. function(a) {
  16962. return this.fileDic[a]
  16963. };
  16964. a.prototype.hasRes = function(a) {
  16965. return null != this.getRes(a)
  16966. };
  16967. a.prototype.destroyRes = function(a) {
  16968. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  16969. };
  16970. return a
  16971. }(c.AnalyzerBase);
  16972. c.BinAnalyzer = e
  16973. })(RES || (RES = {}));
  16974. __extends = this.__extends || function(c, e) {
  16975. function d() {
  16976. this.constructor = c
  16977. }
  16978. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16979. d.prototype = e.prototype;
  16980. c.prototype = new d
  16981. };
  16982. (function(c) {
  16983. var e = function(c) {
  16984. function a() {
  16985. c.call(this);
  16986. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  16987. }
  16988. __extends(a, c);
  16989. a.prototype.analyzeData = function(a, c) {
  16990. var d = a.name;
  16991. !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]))))
  16992. };
  16993. return a
  16994. }(c.BinAnalyzer);
  16995. c.ImageAnalyzer = e
  16996. })(RES || (RES = {}));
  16997. __extends = this.__extends || function(c, e) {
  16998. function d() {
  16999. this.constructor = c
  17000. }
  17001. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17002. d.prototype = e.prototype;
  17003. c.prototype = new d
  17004. };
  17005. (function(c) {
  17006. var e = function(c) {
  17007. function a() {
  17008. c.call(this);
  17009. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  17010. }
  17011. __extends(a, c);
  17012. a.prototype.analyzeData = function(a, c) {
  17013. var d = a.name;
  17014. if (!this.fileDic[d] && c) try {
  17015. this.fileDic[d] = JSON.parse(c)
  17016. } catch (e) {}
  17017. };
  17018. return a
  17019. }(c.BinAnalyzer);
  17020. c.JsonAnalyzer = e
  17021. })(RES || (RES = {}));
  17022. __extends = this.__extends || function(c, e) {
  17023. function d() {
  17024. this.constructor = c
  17025. }
  17026. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17027. d.prototype = e.prototype;
  17028. c.prototype = new d
  17029. };
  17030. (function(c) {
  17031. var e = function(c) {
  17032. function a() {
  17033. c.call(this);
  17034. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  17035. }
  17036. __extends(a, c);
  17037. return a
  17038. }(c.BinAnalyzer);
  17039. c.TextAnalyzer = e
  17040. })(RES || (RES = {}));
  17041. __extends = this.__extends || function(c, e) {
  17042. function d() {
  17043. this.constructor = c
  17044. }
  17045. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17046. d.prototype = e.prototype;
  17047. c.prototype = new d
  17048. };
  17049. (function(c) {
  17050. var e = function(d) {
  17051. function a() {
  17052. d.call(this);
  17053. this.sheetMap = {};
  17054. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  17055. }
  17056. __extends(a, d);
  17057. a.prototype.getRes = function(a) {
  17058. var d = this.fileDic[a];
  17059. !d && (d = c.AnalyzerBase.getStringPrefix(a), d = this.fileDic[d]) && (a = c.AnalyzerBase.getStringTail(a), d = d.getTexture(a));
  17060. return d
  17061. };
  17062. a.prototype.onLoadFinish = function(a) {
  17063. var c = a.target,
  17064. d = this.resItemDic[c.hashCode];
  17065. delete this.resItemDic[c.hashCode];
  17066. this.recycler.push(c);
  17067. var e = d.item,
  17068. f = d.func;
  17069. e.loaded = a.type == egret.Event.COMPLETE;
  17070. e.loaded && this.analyzeData(e, c.data);
  17071. "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)
  17072. };
  17073. a.prototype.analyzeData = function(a, c) {
  17074. var d = a.name;
  17075. if (!this.fileDic[d] && c) {
  17076. var e;
  17077. if ("string" == typeof c) {
  17078. try {
  17079. e = JSON.parse(c)
  17080. } catch (f) {}
  17081. e && (this.sheetMap[d] = e, a.loaded = !1, a.url = this.getRelativePath(a.url, e.file))
  17082. } else e = this.sheetMap[d], delete this.sheetMap[d], c && (e = this.parseSpriteSheet(c,
  17083. e), this.fileDic[d] = e)
  17084. }
  17085. };
  17086. a.prototype.getRelativePath = function(a, c) {
  17087. a = a.split("\\").join("/");
  17088. var d = a.lastIndexOf("/");
  17089. return a = -1 != d ? a.substring(0, d + 1) + c : c
  17090. };
  17091. a.prototype.parseSpriteSheet = function(a, c) {
  17092. var d = c.frames;
  17093. if (!d) return null;
  17094. var e = new egret.SpriteSheet(a),
  17095. f;
  17096. for (f in d) {
  17097. var h = d[f];
  17098. e.createTexture(f, h.x, h.y, h.w, h.h, h.offX, h.offY, h.sourceW, h.sourceH)
  17099. }
  17100. return e
  17101. };
  17102. return a
  17103. }(c.BinAnalyzer);
  17104. c.SheetAnalyzer = e
  17105. })(RES || (RES = {}));
  17106. __extends = this.__extends || function(c, e) {
  17107. function d() {
  17108. this.constructor = c
  17109. }
  17110. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17111. d.prototype = e.prototype;
  17112. c.prototype = new d
  17113. };
  17114. (function(c) {
  17115. var e = function(c) {
  17116. function a() {
  17117. c.call(this)
  17118. }
  17119. __extends(a, c);
  17120. a.prototype.analyzeData = function(a, c) {
  17121. var d = a.name;
  17122. if (!this.fileDic[d] && c) {
  17123. var e;
  17124. "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))
  17125. }
  17126. };
  17127. a.prototype.getTexturePath = function(a, c) {
  17128. var d = "",
  17129. e = c.split("\n")[2],
  17130. f = e.indexOf('file="'); - 1 != f && (e = e.substring(f + 6), f = e.indexOf('"'), d = e.substring(0,
  17131. f));
  17132. a = a.split("\\").join("/");
  17133. f = a.lastIndexOf("/");
  17134. return a = -1 != f ? a.substring(0, f + 1) + d : d
  17135. };
  17136. return a
  17137. }(c.SheetAnalyzer);
  17138. c.FontAnalyzer = e
  17139. })(RES || (RES = {}));
  17140. __extends = this.__extends || function(c, e) {
  17141. function d() {
  17142. this.constructor = c
  17143. }
  17144. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17145. d.prototype = e.prototype;
  17146. c.prototype = new d
  17147. };
  17148. (function(c) {
  17149. var e = function(c) {
  17150. function a() {
  17151. c.call(this);
  17152. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  17153. }
  17154. __extends(a, c);
  17155. return a
  17156. }(c.BinAnalyzer);
  17157. c.SoundAnalyzer = e
  17158. })(RES || (RES = {}));
  17159. __extends = this.__extends || function(c, e) {
  17160. function d() {
  17161. this.constructor = c
  17162. }
  17163. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17164. d.prototype = e.prototype;
  17165. c.prototype = new d
  17166. };
  17167. (function(c) {
  17168. var e = function(c) {
  17169. function a() {
  17170. c.call(this);
  17171. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  17172. }
  17173. __extends(a, c);
  17174. a.prototype.analyzeData = function(a, c) {
  17175. var d = a.name;
  17176. if (!this.fileDic[d] && c) try {
  17177. var e = egret.XML.parse(c);
  17178. this.fileDic[d] = e
  17179. } catch (f) {}
  17180. };
  17181. return a
  17182. }(c.BinAnalyzer);
  17183. c.XMLAnalyzer = e
  17184. })(RES || (RES = {}));
  17185. __extends = this.__extends || function(c, e) {
  17186. function d() {
  17187. this.constructor = c
  17188. }
  17189. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17190. d.prototype = e.prototype;
  17191. c.prototype = new d
  17192. };
  17193. (function(c) {
  17194. c.loadConfig = function(c, a) {
  17195. "undefined" === typeof a && (a = "");
  17196. e.loadConfig(c, a)
  17197. };
  17198. c.loadGroup = function(c, a) {
  17199. "undefined" === typeof a && (a = 0);
  17200. e.loadGroup(c, a)
  17201. };
  17202. c.isGroupLoaded = function(c) {
  17203. return e.isGroupLoaded(c)
  17204. };
  17205. c.getGroupByName = function(c) {
  17206. return e.getGroupByName(c)
  17207. };
  17208. c.createGroup = function(c, a, b) {
  17209. "undefined" === typeof b && (b = !1);
  17210. return e.createGroup(c, a, b)
  17211. };
  17212. c.hasRes = function(c) {
  17213. return e.hasRes(c)
  17214. };
  17215. c.getRes = function(c) {
  17216. return e.getRes(c)
  17217. };
  17218. c.getResAsync = function(c, a, b) {
  17219. e.getResAsync(c, a, b)
  17220. };
  17221. c.getResByUrl =
  17222. function(c, a, b, g) {
  17223. "undefined" === typeof g && (g = "");
  17224. e.getResByUrl(c, a, b, g)
  17225. };
  17226. c.destroyRes = function(c) {
  17227. return e.destroyRes(c)
  17228. };
  17229. c.addEventListener = function(c, a, b, g, l) {
  17230. "undefined" === typeof g && (g = !1);
  17231. "undefined" === typeof l && (l = 0);
  17232. e.addEventListener(c, a, b, g, l)
  17233. };
  17234. c.removeEventListener = function(c, a, b, g) {
  17235. "undefined" === typeof g && (g = !1);
  17236. e.removeEventListener(c, a, b, g)
  17237. };
  17238. var e = new(function(d) {
  17239. function a() {
  17240. d.call(this);
  17241. this.analyzerDic = {};
  17242. this.configComplete = !1;
  17243. this.loadedGroups = [];
  17244. this.groupNameList = [];
  17245. this.asyncDic = {};
  17246. this.init()
  17247. }
  17248. __extends(a, d);
  17249. a.prototype.getAnalyzerByType = function(a) {
  17250. var d = this.analyzerDic[a];
  17251. d || (d = this.analyzerDic[a] = egret.Injector.getInstance(c.AnalyzerBase, a));
  17252. return d
  17253. };
  17254. a.prototype.init = function() {
  17255. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(c.AnalyzerBase, c.BinAnalyzer, c.ResourceItem.TYPE_BIN);
  17256. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(c.AnalyzerBase, c.ImageAnalyzer, c.ResourceItem.TYPE_IMAGE);
  17257. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(c.AnalyzerBase, c.TextAnalyzer, c.ResourceItem.TYPE_TEXT);
  17258. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(c.AnalyzerBase, c.JsonAnalyzer, c.ResourceItem.TYPE_JSON);
  17259. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(c.AnalyzerBase, c.SheetAnalyzer, c.ResourceItem.TYPE_SHEET);
  17260. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_FONT) ||
  17261. egret.Injector.mapClass(c.AnalyzerBase, c.FontAnalyzer, c.ResourceItem.TYPE_FONT);
  17262. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(c.AnalyzerBase, c.SoundAnalyzer, c.ResourceItem.TYPE_SOUND);
  17263. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_XML) || egret.Injector.mapClass(c.AnalyzerBase, c.XMLAnalyzer, c.ResourceItem.TYPE_XML);
  17264. this.resConfig = new c.ResourceConfig;
  17265. this.resLoader = new c.ResourceLoader;
  17266. this.resLoader.callBack = this.onResourceItemComp;
  17267. this.resLoader.resInstance =
  17268. this;
  17269. this.resLoader.addEventListener(c.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  17270. };
  17271. a.prototype.loadConfig = function(b, d) {
  17272. this.configURL = b;
  17273. this.resourceRoot = d;
  17274. var e = [new c.ResourceItem(b, b, c.ResourceItem.TYPE_JSON)];
  17275. this.resLoader.loadGroup(e, a.GROUP_CONFIG, Number.MAX_VALUE)
  17276. };
  17277. a.prototype.isGroupLoaded = function(a) {
  17278. return -1 != this.loadedGroups.indexOf(a)
  17279. };
  17280. a.prototype.getGroupByName = function(a) {
  17281. return this.resConfig.getGroupByName(a)
  17282. };
  17283. a.prototype.loadGroup = function(a, c) {
  17284. "undefined" === typeof c &&
  17285. (c = 0);
  17286. if (-1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a))
  17287. if (this.configComplete) {
  17288. var d = this.resConfig.getGroupByName(a);
  17289. this.resLoader.loadGroup(d, a, c)
  17290. } else this.groupNameList.push({
  17291. name: a,
  17292. priority: c
  17293. })
  17294. };
  17295. a.prototype.createGroup = function(a, c, d) {
  17296. "undefined" === typeof d && (d = !1);
  17297. return this.resConfig.createGroup(a, c, d)
  17298. };
  17299. a.prototype.onGroupComp = function(b) {
  17300. if (b.groupName == a.GROUP_CONFIG) {
  17301. b = this.getAnalyzerByType(c.ResourceItem.TYPE_JSON);
  17302. var d = b.getRes(this.configURL);
  17303. b.destroyRes(this.configURL);
  17304. this.resConfig.parseConfig(d, this.resourceRoot);
  17305. this.configComplete = !0;
  17306. c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_COMPLETE);
  17307. b = this.groupNameList;
  17308. for (var d = b.length, e = 0; e < d; e++) {
  17309. var m = b[e];
  17310. this.loadGroup(m.name, m.priority)
  17311. }
  17312. this.groupNameList = []
  17313. } else this.loadedGroups.push(b.groupName), this.dispatchEvent(b)
  17314. };
  17315. a.prototype.hasRes = function(a) {
  17316. var d = this.resConfig.getType(a);
  17317. return "" == d && (a = c.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(a), "" == d) ? !1 : !0
  17318. };
  17319. a.prototype.getRes =
  17320. function(a) {
  17321. var d = this.resConfig.getType(a);
  17322. return "" == d && (d = c.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(d), "" == d) ? null : this.getAnalyzerByType(d).getRes(a)
  17323. };
  17324. a.prototype.getResAsync = function(a, d, e) {
  17325. var m = this.resConfig.getType(a),
  17326. f = a;
  17327. if ("" == m && (f = c.AnalyzerBase.getStringPrefix(a), m = this.resConfig.getType(f), "" == m)) {
  17328. d.call(e, null);
  17329. return
  17330. }(m = this.getAnalyzerByType(m).getRes(a)) ? d.call(e, m): (a = {
  17331. name: a,
  17332. compFunc: d,
  17333. thisObject: e
  17334. }, this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a],
  17335. f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  17336. };
  17337. a.prototype.getResByUrl = function(a, d, e, m) {
  17338. "undefined" === typeof m && (m = "");
  17339. if (a) {
  17340. m || (m = this.getTypeByUrl(a));
  17341. var f = this.getAnalyzerByType(m).getRes(a);
  17342. f ? d.call(e, f) : (d = {
  17343. name: a,
  17344. compFunc: d,
  17345. thisObject: e
  17346. }, this.asyncDic[a] ? this.asyncDic[a].push(d) : (this.asyncDic[a] = [d], a = new c.ResourceItem(a, a, m), this.resLoader.loadItem(a)))
  17347. } else d.call(e, null)
  17348. };
  17349. a.prototype.getTypeByUrl = function(a) {
  17350. a = a.substr(a.lastIndexOf(".") + 1);
  17351. switch (a) {
  17352. case c.ResourceItem.TYPE_XML:
  17353. case c.ResourceItem.TYPE_JSON:
  17354. case c.ResourceItem.TYPE_SHEET:
  17355. break;
  17356. case "png":
  17357. case "jpg":
  17358. case "gif":
  17359. a = c.ResourceItem.TYPE_IMAGE;
  17360. break;
  17361. case "fnt":
  17362. a = c.ResourceItem.TYPE_FONT;
  17363. break;
  17364. case "txt":
  17365. a = c.ResourceItem.TYPE_TEXT;
  17366. break;
  17367. default:
  17368. a = c.ResourceItem.TYPE_BIN
  17369. }
  17370. return a
  17371. };
  17372. a.prototype.onResourceItemComp = function(a) {
  17373. var c = this.asyncDic[a.name];
  17374. delete this.asyncDic[a.name];
  17375. a = this.getAnalyzerByType(a.type);
  17376. for (var d = c.length, e = 0; e < d; e++) {
  17377. var f = c[e],
  17378. h = a.getRes(f.name);
  17379. f.compFunc.call(f.thisObject, h)
  17380. }
  17381. };
  17382. a.prototype.destroyRes = function(a) {
  17383. var c = this.resConfig.getRawGroupByName(a);
  17384. if (c) {
  17385. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1);
  17386. a = c.length;
  17387. for (var e = 0; e < a; e++) {
  17388. d = c[e];
  17389. d.loaded = !1;
  17390. var f = this.getAnalyzerByType(d.type);
  17391. f.destroyRes(d.name)
  17392. }
  17393. return !0
  17394. }
  17395. c = this.resConfig.getType(a);
  17396. if ("" == c) return !1;
  17397. d = this.resConfig.getRawResourceItem(a);
  17398. d.loaded = !1;
  17399. f = this.getAnalyzerByType(c);
  17400. return f.destroyRes(a)
  17401. };
  17402. a.GROUP_CONFIG = "RES__CONFIG";
  17403. return a
  17404. }(egret.EventDispatcher))
  17405. })(RES || (RES = {}));
  17406. __extends = this.__extends || function(c, e) {
  17407. function d() {
  17408. this.constructor = c
  17409. }
  17410. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17411. d.prototype = e.prototype;
  17412. c.prototype = new d
  17413. };
  17414. (function(c) {
  17415. var e = function(d) {
  17416. function a() {
  17417. d.call(this);
  17418. this._time = 0;
  17419. this.frameRate = 60;
  17420. a.instance = this;
  17421. this.registerListener()
  17422. }
  17423. __extends(a, d);
  17424. a.prototype.enterFrame = function() {
  17425. var b = a.instance,
  17426. d = a._thisObject,
  17427. e = a._callback,
  17428. m = c.getTimer();
  17429. e.call(d, m - b._time);
  17430. b._time = m;
  17431. b._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame)
  17432. };
  17433. a.prototype.executeMainLoop = function(b, c) {
  17434. a._callback = b;
  17435. a._thisObject = c;
  17436. this.enterFrame()
  17437. };
  17438. a.prototype.reset = function() {
  17439. var b = a.instance;
  17440. b._requestAnimationId &&
  17441. (b._time = c.getTimer(), a.cancelAnimationFrame.call(window, b._requestAnimationId), b.enterFrame())
  17442. };
  17443. a.prototype.registerListener = function() {
  17444. var b = function() {
  17445. a.instance.reset()
  17446. },
  17447. c = function() {
  17448. document[d] || b()
  17449. };
  17450. window.onfocus = b;
  17451. window.onblur = function() {};
  17452. var d, e;
  17453. "undefined" !== typeof document.hidden ? (d = "hidden", e = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (d = "mozHidden", e = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (d = "msHidden", e = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden &&
  17454. (d = "webkitHidden", e = "webkitvisibilitychange");
  17455. "onpageshow" in window && "onpagehide" in window && window.addEventListener("pageshow", b, !1);
  17456. d && e && document.addEventListener(e, c, !1)
  17457. };
  17458. a.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(a) {
  17459. return window.setTimeout(a, 1E3 / 60)
  17460. };
  17461. a.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame ||
  17462. window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame || function(a) {
  17463. return window.clearTimeout(a)
  17464. };
  17465. return a
  17466. }(c.DeviceContext);
  17467. c.HTML5DeviceContext = e
  17468. })(egret || (egret = {}));
  17469. __extends = this.__extends || function(c, e) {
  17470. function d() {
  17471. this.constructor = c
  17472. }
  17473. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17474. d.prototype = e.prototype;
  17475. c.prototype = new d
  17476. };
  17477. (function(c) {
  17478. var e = function(d) {
  17479. function a(a) {
  17480. this.canvas = a;
  17481. this.canvasContext = a.getContext("2d");
  17482. var c = this.canvasContext.setTransform,
  17483. e = this;
  17484. this.canvasContext.setTransform = function(a, b, d, k, n, q) {
  17485. e._matrixA = a;
  17486. e._matrixB = b;
  17487. e._matrixC = d;
  17488. e._matrixD = k;
  17489. e._matrixTx = n;
  17490. e._matrixTy = q;
  17491. c.call(e.canvasContext, a, b, d, k, n, q)
  17492. };
  17493. this._matrixA = 1;
  17494. this._matrixC = this._matrixB = 0;
  17495. this._matrixD = 1;
  17496. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  17497. d.call(this)
  17498. }
  17499. __extends(a, d);
  17500. a.prototype.clearScreen = function() {
  17501. this.setTransform(c.Matrix.identity.identity());
  17502. for (var a = c.RenderFilter.getInstance().getDrawAreaList(), d = 0, e = a.length; d < e; d++) {
  17503. var m = a[d];
  17504. this.clearRect(m.x + this._transformTx, m.y + this._transformTy, m.width, m.height)
  17505. }
  17506. this.renderCost = 0
  17507. };
  17508. a.prototype.clearRect = function(a, c, d, e) {
  17509. this.canvasContext.clearRect(a, c, d, e)
  17510. };
  17511. a.prototype.drawImage = function(a, e, l, m, f, h, k, n, q) {
  17512. e /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17513. l /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17514. m /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17515. f /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17516. a = a._bitmapData;
  17517. h += this._transformTx;
  17518. k += this._transformTy;
  17519. var p = c.getTimer();
  17520. this.canvasContext.drawImage(a, e, l, m, f, h, k, n, q);
  17521. d.prototype.drawImage.call(this, a, e, l, m, f, h, k, n, q);
  17522. this.renderCost += c.getTimer() - p
  17523. };
  17524. a.prototype.setTransform = function(a) {
  17525. 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 =
  17526. 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))
  17527. };
  17528. a.prototype.setAlpha = function(a, d) {
  17529. a != this.canvasContext.globalAlpha && (this.canvasContext.globalAlpha = a);
  17530. 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 =
  17531. c.BlendMode.NORMAL.value)
  17532. };
  17533. a.prototype.setupFont = function(a) {
  17534. var c = this.canvasContext,
  17535. d = a.italic ? "italic " : "normal ",
  17536. d = d + (a.bold ? "bold " : "normal "),
  17537. d = d + (a.size + "px " + a.fontFamily);
  17538. c.font = d;
  17539. c.textAlign = "left";
  17540. c.textBaseline = "middle"
  17541. };
  17542. a.prototype.measureText = function(a) {
  17543. return this.canvasContext.measureText(a).width
  17544. };
  17545. a.prototype.drawText = function(a, c, e, m, f) {
  17546. var h = a._strokeColorString,
  17547. k = a.stroke,
  17548. n = this.canvasContext;
  17549. n.fillStyle = a._textColorString;
  17550. n.strokeStyle = h;
  17551. k && (n.lineWidth = 2 * k, n.strokeText(c, e +
  17552. this._transformTx, m + this._transformTy, f || 65535));
  17553. n.fillText(c, e + this._transformTx, m + this._transformTy, f || 65535);
  17554. d.prototype.drawText.call(this, a, c, e, m, f)
  17555. };
  17556. a.prototype.strokeRect = function(a, c, d, e, f) {
  17557. this.canvasContext.strokeStyle = f;
  17558. this.canvasContext.strokeRect(a, c, d, e)
  17559. };
  17560. a.prototype.pushMask = function(a) {
  17561. this.canvasContext.save();
  17562. this.canvasContext.beginPath();
  17563. this.canvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  17564. this.canvasContext.clip();
  17565. this.canvasContext.closePath()
  17566. };
  17567. a.prototype.popMask = function() {
  17568. this.canvasContext.restore();
  17569. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  17570. };
  17571. return a
  17572. }(c.RendererContext);
  17573. c.HTML5CanvasRenderer = e
  17574. })(egret || (egret = {}));
  17575. var egret_h5_graphics;
  17576. (function(c) {
  17577. c.beginFill = function(c, a) {
  17578. "undefined" === typeof a && (a = 1);
  17579. var b = "rgba(" + (c >> 16) + "," + ((c & 65280) >> 8) + "," + (c & 255) + "," + a + ")";
  17580. this.fillStyleColor = b;
  17581. this.commandQueue.push(new e(this._setStyle, this, [b]))
  17582. };
  17583. c.drawRect = function(c, a, b, g) {
  17584. this.commandQueue.push(new e(function(a, b, c, d) {
  17585. var e = this.renderContext;
  17586. this.canvasContext.beginPath();
  17587. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  17588. this.canvasContext.closePath()
  17589. }, this, [c, a, b, g]));
  17590. this._fill()
  17591. };
  17592. c.drawCircle = function(c, a, b) {
  17593. this.commandQueue.push(new e(function(a,
  17594. b, c) {
  17595. var d = this.renderContext;
  17596. this.canvasContext.beginPath();
  17597. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, c, 0, 2 * Math.PI);
  17598. this.canvasContext.closePath()
  17599. }, this, [c, a, b]));
  17600. this._fill()
  17601. };
  17602. c.lineStyle = function(c, a, b, g, l, m, f, h) {
  17603. "undefined" === typeof c && (c = NaN);
  17604. "undefined" === typeof a && (a = 0);
  17605. "undefined" === typeof b && (b = 1);
  17606. "undefined" === typeof g && (g = !1);
  17607. "undefined" === typeof l && (l = "normal");
  17608. "undefined" === typeof m && (m = null);
  17609. "undefined" === typeof f && (f = null);
  17610. "undefined" === typeof h && (h = 3);
  17611. this.strokeStyleColor &&
  17612. (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  17613. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + b + ")";
  17614. this.commandQueue.push(new e(function(a, b) {
  17615. this.canvasContext.lineWidth = a;
  17616. this.canvasContext.strokeStyle = b;
  17617. this.canvasContext.beginPath()
  17618. }, this, [c, a]));
  17619. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  17620. this.moveTo(this.lineX, this.lineY)
  17621. };
  17622. c.lineTo = function(c, a) {
  17623. this.commandQueue.push(new e(function(a, c) {
  17624. var d = this.renderContext;
  17625. this.canvasContext.lineTo(d._transformTx +
  17626. a, d._transformTy + c)
  17627. }, this, [c, a]));
  17628. this.lineX = c;
  17629. this.lineY = a
  17630. };
  17631. c.curveTo = function(c, a, b, g) {
  17632. this.commandQueue.push(new e(function(a, b, c, d) {
  17633. var e = this.renderContext;
  17634. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, c, d)
  17635. }, this, [c, a, b, g]));
  17636. this.lineX = b;
  17637. this.lineY = g
  17638. };
  17639. c.moveTo = function(c, a) {
  17640. this.commandQueue.push(new e(function(a, c) {
  17641. var d = this.renderContext;
  17642. this.canvasContext.moveTo(d._transformTx + a, d._transformTy + c)
  17643. }, this, [c, a]))
  17644. };
  17645. c.clear = function() {
  17646. this.lineY = this.lineX = this.commandQueue.length =
  17647. 0;
  17648. this.fillStyleColor = this.strokeStyleColor = null
  17649. };
  17650. c.createEndFillCommand = function() {
  17651. this.endFillCommand || (this.endFillCommand = new e(function() {
  17652. this.canvasContext.fill();
  17653. this.canvasContext.closePath()
  17654. }, this, null))
  17655. };
  17656. c.endFill = function() {
  17657. null != this.fillStyleColor && this._fill();
  17658. this.fillStyleColor = null
  17659. };
  17660. c._fill = function() {
  17661. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  17662. };
  17663. c.createEndLineCommand = function() {
  17664. this.endLineCommand || (this.endLineCommand = new e(function() {
  17665. this.canvasContext.stroke();
  17666. this.canvasContext.closePath()
  17667. }, this, null))
  17668. };
  17669. c._draw = function(c) {
  17670. this.renderContext = c;
  17671. c = this.canvasContext = this.renderContext.canvasContext;
  17672. c.save();
  17673. var a = this.commandQueue.length;
  17674. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  17675. for (var b = 0; b < a; b++) {
  17676. var e = this.commandQueue[b];
  17677. e.method.apply(e.thisObject, e.args)
  17678. }
  17679. c.restore()
  17680. };
  17681. var e = function() {
  17682. return function(c, a, b) {
  17683. this.method = c;
  17684. this.thisObject = a;
  17685. this.args =
  17686. b
  17687. }
  17688. }();
  17689. c._setStyle = function(c) {
  17690. this.canvasContext.fillStyle = c;
  17691. this.canvasContext.beginPath()
  17692. };
  17693. c.init = function() {
  17694. for (var d in c) egret.Graphics.prototype[d] = c[d];
  17695. egret.RendererContext.createRendererContext = function(a) {
  17696. return new egret.HTML5CanvasRenderer(a)
  17697. }
  17698. }
  17699. })(egret_h5_graphics || (egret_h5_graphics = {}));
  17700. egret_h5_graphics.init();
  17701. __extends = this.__extends || function(c, e) {
  17702. function d() {
  17703. this.constructor = c
  17704. }
  17705. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17706. d.prototype = e.prototype;
  17707. c.prototype = new d
  17708. };
  17709. (function(c) {
  17710. var e = function(d) {
  17711. function a(a) {
  17712. d.call(this);
  17713. this.size = 2E3;
  17714. this.vertSize = 6;
  17715. this.contextLost = !1;
  17716. this.glContextId = 0;
  17717. this.currentBlendMode = "";
  17718. this.currentBaseTexture = null;
  17719. this.currentBatchSize = 0;
  17720. this.maskList = [];
  17721. this.maskDataFreeList = [];
  17722. this.canvasContext = document.createElement("canvas").getContext("2d");
  17723. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  17724. this.canvas = a;
  17725. a.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  17726. a.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  17727. this.projectionX = a.width / 2;
  17728. this.projectionY = -a.height / 2;
  17729. a = 6 * this.size;
  17730. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  17731. this.indices = new Uint16Array(a);
  17732. for (var e = 0, l = 0; e < a; e += 6, l += 4) this.indices[e + 0] = l + 0, this.indices[e + 1] = l + 1, this.indices[e + 2] = l + 2, this.indices[e + 3] = l + 0, this.indices[e + 4] = l + 2, this.indices[e + 5] = l + 3;
  17733. this.initWebGL();
  17734. this.shaderManager = new c.WebGLShaderManager(this.gl);
  17735. this.worldTransform = new c.Matrix;
  17736. this.initBlendMode();
  17737. c.MainContext.instance.addEventListener(c.Event.FINISH_RENDER,
  17738. this._draw, this);
  17739. c.TextField.prototype._draw = function(a) {
  17740. this._textDirty && (this.cacheAsBitmap = !0);
  17741. c.DisplayObject.prototype._draw.call(this, a)
  17742. }
  17743. }
  17744. __extends(a, d);
  17745. a.prototype.handleContextLost = function() {
  17746. this.contextLost = !0
  17747. };
  17748. a.prototype.handleContextRestored = function() {
  17749. this.initWebGL();
  17750. this.shaderManager.setContext(this.gl);
  17751. this.contextLost = !1
  17752. };
  17753. a.prototype.initWebGL = function() {
  17754. for (var a = {
  17755. stencil: !0
  17756. }, c, d = ["experimental-webgl", "webgl"], e = 0; e < d.length; e++) {
  17757. try {
  17758. c = this.canvas.getContext(d[e], a)
  17759. } catch (f) {}
  17760. if (c) break
  17761. }
  17762. if (!c) throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  17763. this.setContext(c)
  17764. };
  17765. a.prototype.setContext = function(a) {
  17766. this.gl = a;
  17767. a.id = this.glContextId++;
  17768. this.vertexBuffer = a.createBuffer();
  17769. this.indexBuffer = a.createBuffer();
  17770. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  17771. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  17772. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  17773. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  17774. a.disable(a.DEPTH_TEST);
  17775. a.disable(a.CULL_FACE);
  17776. a.enable(a.BLEND);
  17777. a.colorMask(!0, !0, !0, !0)
  17778. };
  17779. a.prototype.initBlendMode = function() {
  17780. a.blendModesWebGL[c.BlendMode.NORMAL.value] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  17781. a.blendModesWebGL[c.BlendMode.ADD.value] = [this.gl.SRC_ALPHA, this.gl.DST_ALPHA]
  17782. };
  17783. a.prototype.start = function() {
  17784. if (!this.contextLost) {
  17785. var a = this.gl;
  17786. a.activeTexture(a.TEXTURE0);
  17787. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  17788. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  17789. var d = this.shaderManager.defaultShader;
  17790. a.uniform2f(d.projectionVector, this.projectionX, this.projectionY);
  17791. var e = 4 * this.vertSize;
  17792. a.vertexAttribPointer(d.aVertexPosition, 2, a.FLOAT, !1, e, 0);
  17793. a.vertexAttribPointer(d.aTextureCoord, 2, a.FLOAT, !1, e, 8);
  17794. a.vertexAttribPointer(d.colorAttribute, 2, a.FLOAT, !1, e, 16);
  17795. this.setBlendMode(c.BlendMode.NORMAL.value)
  17796. }
  17797. };
  17798. a.prototype.clearScreen = function() {
  17799. var a = this.gl;
  17800. a.colorMask(!0, !0, !0, !0);
  17801. for (var d = c.RenderFilter.getInstance().getDrawAreaList(), e = 0, m = d.length; e < m; e++) {
  17802. var f = d[e];
  17803. a.viewport(f.x, f.y, f.width, f.height);
  17804. a.bindFramebuffer(a.FRAMEBUFFER, null);
  17805. a.clearColor(0, 0, 0, 0);
  17806. a.clear(a.COLOR_BUFFER_BIT)
  17807. }
  17808. this.renderCost = 0
  17809. };
  17810. a.prototype.setBlendMode = function(b) {
  17811. this.currentBlendMode !=
  17812. b && (this.currentBlendMode = b, b = a.blendModesWebGL[this.currentBlendMode], this.gl.blendFunc(b[0], b[1]))
  17813. };
  17814. a.prototype.drawImage = function(a, d, e, m, f, h, k, n, q) {
  17815. if (!this.contextLost) {
  17816. var p = c.MainContext.instance.rendererContext.texture_scale_factor;
  17817. d /= p;
  17818. e /= p;
  17819. m /= p;
  17820. f /= p;
  17821. this.createWebGLTexture(a);
  17822. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size) this._draw(), this.currentBaseTexture = a.webGLTexture;
  17823. var r = this.worldTransform,
  17824. s = r.a,
  17825. t = r.b,
  17826. A = r.c,
  17827. w = r.d,
  17828. B = r.tx,
  17829. C = r.ty;
  17830. 0 == h && 0 == k || r.append(1,
  17831. 0, 0, 1, h, k);
  17832. 1 == m / n && 1 == f / q || r.append(n / m, 0, 0, q / f, 0, 0);
  17833. h = r.a;
  17834. k = r.b;
  17835. n = r.c;
  17836. q = r.d;
  17837. var p = r.tx,
  17838. u = r.ty;
  17839. r.a = s;
  17840. r.b = t;
  17841. r.c = A;
  17842. r.d = w;
  17843. r.tx = B;
  17844. r.ty = C;
  17845. s = a._sourceWidth;
  17846. t = a._sourceHeight;
  17847. a = m;
  17848. r = f;
  17849. d /= s;
  17850. e /= t;
  17851. m /= s;
  17852. f /= t;
  17853. s = this.vertices;
  17854. t = 4 * this.currentBatchSize * this.vertSize;
  17855. A = this.worldAlpha;
  17856. s[t++] = p;
  17857. s[t++] = u;
  17858. s[t++] = d;
  17859. s[t++] = e;
  17860. s[t++] = A;
  17861. s[t++] = 16777215;
  17862. s[t++] = h * a + p;
  17863. s[t++] = k * a + u;
  17864. s[t++] = m + d;
  17865. s[t++] = e;
  17866. s[t++] = A;
  17867. s[t++] = 16777215;
  17868. s[t++] = h * a + n * r + p;
  17869. s[t++] = q * r + k * a + u;
  17870. s[t++] = m + d;
  17871. s[t++] = f + e;
  17872. s[t++] = A;
  17873. s[t++] = 16777215;
  17874. s[t++] = n * r + p;
  17875. s[t++] =
  17876. q * r + u;
  17877. s[t++] = d;
  17878. s[t++] = f + e;
  17879. s[t++] = A;
  17880. s[t++] = 16777215;
  17881. this.currentBatchSize++
  17882. }
  17883. };
  17884. a.prototype._draw = function() {
  17885. if (0 != this.currentBatchSize && !this.contextLost) {
  17886. var a = c.getTimer();
  17887. this.start();
  17888. var d = this.gl;
  17889. d.bindTexture(d.TEXTURE_2D, this.currentBaseTexture);
  17890. var e = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  17891. d.bufferSubData(d.ARRAY_BUFFER, 0, e);
  17892. d.drawElements(d.TRIANGLES, 6 * this.currentBatchSize, d.UNSIGNED_SHORT, 0);
  17893. this.currentBatchSize = 0;
  17894. this.renderCost += c.getTimer() - a;
  17895. c.Profiler.getInstance().onDrawImage()
  17896. }
  17897. };
  17898. a.prototype.setTransform = function(a) {
  17899. var c = this.worldTransform;
  17900. c.a = a.a;
  17901. c.b = a.b;
  17902. c.c = a.c;
  17903. c.d = a.d;
  17904. c.tx = a.tx;
  17905. c.ty = a.ty
  17906. };
  17907. a.prototype.setAlpha = function(a, c) {
  17908. this.worldAlpha = a;
  17909. c && this.setBlendMode(c.value)
  17910. };
  17911. a.prototype.createWebGLTexture = function(a) {
  17912. if (!a.webGLTexture) {
  17913. var c = this.gl;
  17914. a.webGLTexture = c.createTexture();
  17915. c.bindTexture(c.TEXTURE_2D, a.webGLTexture);
  17916. c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  17917. c.texImage2D(c.TEXTURE_2D, 0, c.RGBA, c.RGBA, c.UNSIGNED_BYTE, a._bitmapData);
  17918. c.texParameteri(c.TEXTURE_2D,
  17919. c.TEXTURE_MAG_FILTER, c.LINEAR);
  17920. c.texParameteri(c.TEXTURE_2D, c.TEXTURE_MIN_FILTER, c.LINEAR);
  17921. c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_S, c.CLAMP_TO_EDGE);
  17922. c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_T, c.CLAMP_TO_EDGE);
  17923. c.bindTexture(c.TEXTURE_2D, null)
  17924. }
  17925. };
  17926. a.prototype.pushMask = function(a) {
  17927. this._draw();
  17928. var c = this.gl;
  17929. 0 == this.maskList.length && (c.enable(c.STENCIL_TEST), c.stencilFunc(c.ALWAYS, 1, 1));
  17930. var d = this.maskDataFreeList.pop();
  17931. d ? (d.x = a.x, d.y = a.y, d.w = a.width, d.h = a.height) : d = {
  17932. x: a.x,
  17933. y: a.y,
  17934. w: a.width,
  17935. h: a.height
  17936. };
  17937. this.maskList.push(d);
  17938. c.colorMask(!1, !1, !1, !1);
  17939. c.stencilOp(c.KEEP, c.KEEP, c.INCR);
  17940. this.renderGraphics(d);
  17941. c.colorMask(!0, !0, !0, !0);
  17942. c.stencilFunc(c.NOTEQUAL, 0, this.maskList.length);
  17943. c.stencilOp(c.KEEP, c.KEEP, c.KEEP)
  17944. };
  17945. a.prototype.popMask = function() {
  17946. this._draw();
  17947. var a = this.gl,
  17948. c = this.maskList.pop();
  17949. c && (a.colorMask(!1, !1, !1, !1), a.stencilOp(a.KEEP, a.KEEP, a.DECR), this.renderGraphics(c), a.colorMask(!0, !0, !0, !0), a.stencilFunc(a.NOTEQUAL, 0, this.maskList.length), a.stencilOp(a.KEEP, a.KEEP, a.KEEP), this.maskDataFreeList.push(c));
  17950. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  17951. };
  17952. a.prototype.setupFont = function(a) {
  17953. var c = this.canvasContext,
  17954. d = a.italic ? "italic " : "normal ",
  17955. d = d + (a.bold ? "bold " : "normal "),
  17956. d = d + (a.size + "px " + a.fontFamily);
  17957. c.font = d;
  17958. c.textAlign = "left";
  17959. c.textBaseline = "middle"
  17960. };
  17961. a.prototype.measureText = function(a) {
  17962. return this.canvasContext.measureText(a).width
  17963. };
  17964. a.prototype.renderGraphics = function(a) {
  17965. var c = this.gl,
  17966. d = this.shaderManager.primitiveShader;
  17967. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length =
  17968. 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = c.createBuffer(), this.graphicsIndexBuffer = c.createBuffer());
  17969. this.updateGraphics(a);
  17970. this.shaderManager.activateShader(d);
  17971. c.blendFunc(c.ONE, c.ONE_MINUS_SRC_ALPHA);
  17972. c.uniformMatrix3fv(d.translationMatrix, !1, this.worldTransform.toArray(!0));
  17973. c.uniform2f(d.projectionVector, this.projectionX, -this.projectionY);
  17974. c.uniform2f(d.offsetVector, 0, 0);
  17975. c.uniform3fv(d.tintColor, [1, 1, 1]);
  17976. c.uniform1f(d.alpha, this.worldAlpha);
  17977. c.bindBuffer(c.ARRAY_BUFFER,
  17978. this.graphicsBuffer);
  17979. c.vertexAttribPointer(d.aVertexPosition, 2, c.FLOAT, !1, 24, 0);
  17980. c.vertexAttribPointer(d.colorAttribute, 4, c.FLOAT, !1, 24, 8);
  17981. c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  17982. c.drawElements(c.TRIANGLE_STRIP, this.graphicsIndices.length, c.UNSIGNED_SHORT, 0);
  17983. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  17984. };
  17985. a.prototype.updateGraphics = function(a) {
  17986. var c = this.gl;
  17987. this.buildRectangle(a);
  17988. c.bindBuffer(c.ARRAY_BUFFER, this.graphicsBuffer);
  17989. c.bufferData(c.ARRAY_BUFFER,
  17990. new Float32Array(this.graphicsPoints), c.STATIC_DRAW);
  17991. c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  17992. c.bufferData(c.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), c.STATIC_DRAW)
  17993. };
  17994. a.prototype.buildRectangle = function(a) {
  17995. var c = a.x,
  17996. d = a.y,
  17997. e = a.w;
  17998. a = a.h;
  17999. var f = this.graphicsPoints,
  18000. h = this.graphicsIndices,
  18001. k = f.length / 6;
  18002. f.push(c, d);
  18003. f.push(0, 0, 0, 1);
  18004. f.push(c + e, d);
  18005. f.push(0, 0, 0, 1);
  18006. f.push(c, d + a);
  18007. f.push(0, 0, 0, 1);
  18008. f.push(c + e, d + a);
  18009. f.push(0, 0, 0, 1);
  18010. h.push(k, k, k + 1, k + 2, k + 3, k + 3)
  18011. };
  18012. a.blendModesWebGL = {};
  18013. return a
  18014. }(c.RendererContext);
  18015. c.WebGLRenderer = e
  18016. })(egret || (egret = {}));
  18017. (function(c) {
  18018. var e = function() {
  18019. function c() {}
  18020. c.compileProgram = function(a, b, e) {
  18021. e = c.compileFragmentShader(a, e);
  18022. b = c.compileVertexShader(a, b);
  18023. var l = a.createProgram();
  18024. a.attachShader(l, b);
  18025. a.attachShader(l, e);
  18026. a.linkProgram(l);
  18027. a.getProgramParameter(l, a.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  18028. return l
  18029. };
  18030. c.compileFragmentShader = function(a, b) {
  18031. return c._compileShader(a, b, a.FRAGMENT_SHADER)
  18032. };
  18033. c.compileVertexShader = function(a, b) {
  18034. return c._compileShader(a, b, a.VERTEX_SHADER)
  18035. };
  18036. c._compileShader =
  18037. function(a, b, c) {
  18038. c = a.createShader(c);
  18039. a.shaderSource(c, b);
  18040. a.compileShader(c);
  18041. return a.getShaderParameter(c, a.COMPILE_STATUS) ? c : (console.log(a.getShaderInfoLog(c)), null)
  18042. };
  18043. c.checkCanUseWebGL = function() {
  18044. if (void 0 == c.canUseWebGL) try {
  18045. var a = document.createElement("canvas");
  18046. c.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  18047. } catch (b) {
  18048. c.canUseWebGL = !1
  18049. }
  18050. return c.canUseWebGL
  18051. };
  18052. return c
  18053. }();
  18054. c.WebGLUtils = e
  18055. })(egret || (egret = {}));
  18056. (function(c) {
  18057. var e = function() {
  18058. function b(a) {
  18059. this.maxAttibs = 10;
  18060. this.attribState = [];
  18061. this.tempAttribState = [];
  18062. for (var b = 0; b < this.maxAttibs; b++) this.attribState[b] = !1;
  18063. this.setContext(a)
  18064. }
  18065. b.prototype.setContext = function(b) {
  18066. this.gl = b;
  18067. this.primitiveShader = new a(b);
  18068. this.defaultShader = new d(b);
  18069. this.activateShader(this.defaultShader)
  18070. };
  18071. b.prototype.activateShader = function(a) {
  18072. this.gl.useProgram(a.program);
  18073. this.setAttribs(a.attributes)
  18074. };
  18075. b.prototype.setAttribs = function(a) {
  18076. var b, c;
  18077. c = this.tempAttribState.length;
  18078. for (b =
  18079. 0; b < c; b++) this.tempAttribState[b] = !1;
  18080. c = a.length;
  18081. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  18082. a = this.gl;
  18083. c = this.attribState.length;
  18084. for (b = 0; b < c; b++) this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  18085. };
  18086. return b
  18087. }();
  18088. c.WebGLShaderManager = e;
  18089. var d = function() {
  18090. function a(b) {
  18091. this.defaultVertexSrc = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;\n vColor = vec4(color * aColor.x, aColor.x);\n}";
  18092. this.program = null;
  18093. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\n gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  18094. this.gl = b;
  18095. this.init()
  18096. }
  18097. a.prototype.init = function() {
  18098. var a = this.gl,
  18099. b = c.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  18100. a.useProgram(b);
  18101. this.uSampler = a.getUniformLocation(b, "uSampler");
  18102. this.projectionVector = a.getUniformLocation(b, "projectionVector");
  18103. this.offsetVector =
  18104. a.getUniformLocation(b, "offsetVector");
  18105. this.dimensions = a.getUniformLocation(b, "dimensions");
  18106. this.aVertexPosition = a.getAttribLocation(b, "aVertexPosition");
  18107. this.aTextureCoord = a.getAttribLocation(b, "aTextureCoord");
  18108. this.colorAttribute = a.getAttribLocation(b, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  18109. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  18110. this.program = b
  18111. };
  18112. return a
  18113. }();
  18114. c.EgretShader = d;
  18115. var a = function() {
  18116. function a(b) {
  18117. this.alpha = this.translationMatrix =
  18118. this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  18119. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  18120. this.vertexSrc = "attribute vec2 aVertexPosition;\nattribute vec4 aColor;\nuniform mat3 translationMatrix;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nuniform float alpha;\nuniform vec3 tint;\nvarying vec4 vColor;\nvoid main(void) {\n vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);\n v -= offsetVector.xyx;\n gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);\n vColor = aColor * vec4(tint * alpha, alpha);\n}";
  18121. this.gl = b;
  18122. this.init()
  18123. }
  18124. a.prototype.init = function() {
  18125. var a = this.gl,
  18126. b = c.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  18127. a.useProgram(b);
  18128. this.projectionVector = a.getUniformLocation(b, "projectionVector");
  18129. this.offsetVector = a.getUniformLocation(b, "offsetVector");
  18130. this.tintColor = a.getUniformLocation(b, "tint");
  18131. this.aVertexPosition = a.getAttribLocation(b, "aVertexPosition");
  18132. this.colorAttribute = a.getAttribLocation(b, "aColor");
  18133. this.attributes = [this.aVertexPosition, this.colorAttribute];
  18134. this.translationMatrix =
  18135. a.getUniformLocation(b, "translationMatrix");
  18136. this.alpha = a.getUniformLocation(b, "alpha");
  18137. this.program = b
  18138. };
  18139. return a
  18140. }();
  18141. c.PrimitiveShader = a
  18142. })(egret || (egret = {}));
  18143. __extends = this.__extends || function(c, e) {
  18144. function d() {
  18145. this.constructor = c
  18146. }
  18147. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18148. d.prototype = e.prototype;
  18149. c.prototype = new d
  18150. };
  18151. (function(c) {
  18152. var e = function(d) {
  18153. function a() {
  18154. d.call(this)
  18155. }
  18156. __extends(a, d);
  18157. a.prototype.proceed = function(a) {
  18158. function d(e) {
  18159. c.IOErrorEvent.dispatchIOErrorEvent(a)
  18160. }
  18161. function e(d) {
  18162. switch (a.dataFormat) {
  18163. case c.URLLoaderDataFormat.TEXT:
  18164. a.data = f.responseText;
  18165. break;
  18166. case c.URLLoaderDataFormat.VARIABLES:
  18167. a.data = new c.URLVariables(f.responseText);
  18168. break;
  18169. case c.URLLoaderDataFormat.BINARY:
  18170. a.data = f.response;
  18171. break;
  18172. default:
  18173. a.data = f.responseText
  18174. }
  18175. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  18176. }
  18177. if (a.dataFormat ==
  18178. c.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  18179. else if (a.dataFormat == c.URLLoaderDataFormat.SOUND) this.loadSound(a);
  18180. else {
  18181. var m = a._request,
  18182. f = this.getXHR();
  18183. f.onerror = d;
  18184. f.onload = e;
  18185. f.open(m.method, m.url, !0);
  18186. this.setResponseType(f, a.dataFormat);
  18187. m.method != c.URLRequestMethod.GET && m.data ? m.data instanceof c.URLVariables ? (f.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), f.send(m.data.toString())) : (f.setRequestHeader("Content-Type", "multipart/form-data"), f.send(m.data)) : f.send()
  18188. }
  18189. };
  18190. a.prototype.loadSound =
  18191. function(a) {
  18192. function d(f) {
  18193. m.removeEventListener("canplaythrough", d, !1);
  18194. m.removeEventListener("error", e, !1);
  18195. f = new c.Sound;
  18196. f.audio = m;
  18197. a.data = f;
  18198. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  18199. }
  18200. function e(f) {
  18201. m.removeEventListener("canplaythrough", d, !1);
  18202. m.removeEventListener("error", e, !1);
  18203. c.IOErrorEvent.dispatchIOErrorEvent(a)
  18204. }
  18205. var m = new Audio(a._request.url);
  18206. m.addEventListener("canplaythrough", d, !1);
  18207. m.addEventListener("error", e, !1);
  18208. m.load()
  18209. };
  18210. a.prototype.getXHR = function() {
  18211. return window.XMLHttpRequest ?
  18212. new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  18213. };
  18214. a.prototype.setResponseType = function(a, d) {
  18215. switch (d) {
  18216. case c.URLLoaderDataFormat.TEXT:
  18217. case c.URLLoaderDataFormat.VARIABLES:
  18218. a.responseType = c.URLLoaderDataFormat.TEXT;
  18219. break;
  18220. case c.URLLoaderDataFormat.BINARY:
  18221. a.responseType = "arraybuffer";
  18222. break;
  18223. default:
  18224. a.responseType = d
  18225. }
  18226. };
  18227. a.prototype.loadTexture = function(a) {
  18228. var d = a._request,
  18229. e = new Image;
  18230. e.crossOrigin = "Anonymous";
  18231. e.onload = function(d) {
  18232. e.onerror = null;
  18233. e.onload = null;
  18234. d = new c.Texture;
  18235. d._setBitmapData(e);
  18236. a.data = d;
  18237. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  18238. };
  18239. e.onerror = function(d) {
  18240. e.onerror = null;
  18241. e.onload = null;
  18242. c.IOErrorEvent.dispatchIOErrorEvent(a)
  18243. };
  18244. e.src = d.url
  18245. };
  18246. return a
  18247. }(c.NetContext);
  18248. c.HTML5NetContext = e
  18249. })(egret || (egret = {}));
  18250. __extends = this.__extends || function(c, e) {
  18251. function d() {
  18252. this.constructor = c
  18253. }
  18254. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18255. d.prototype = e.prototype;
  18256. c.prototype = new d
  18257. };
  18258. (function(c) {
  18259. var e = function(d) {
  18260. function a(a) {
  18261. d.call(this);
  18262. this.canvas = a;
  18263. this._isTouchDown = !1
  18264. }
  18265. __extends(a, d);
  18266. a.prototype.run = function() {
  18267. var a = this;
  18268. "ontouchstart" in window ? (this.canvas.addEventListener("touchstart", function(c) {
  18269. for (var d = c.changedTouches.length, e = 0; e < d && e < a.maxTouches; e++) a._onTouchBegin(c.changedTouches[e]);
  18270. c.stopPropagation();
  18271. c.preventDefault()
  18272. }, !1), this.canvas.addEventListener("touchmove", function(c) {
  18273. for (var d = c.changedTouches.length, e = 0; e < d && e < a.maxTouches; e++) a._onTouchMove(c.changedTouches[e]);
  18274. c.stopPropagation();
  18275. c.preventDefault()
  18276. }, !1), this.canvas.addEventListener("touchend", function(c) {
  18277. for (var d = c.changedTouches.length, e = 0; e < d && e < a.maxTouches; e++) a._onTouchEnd(c.changedTouches[e]);
  18278. c.stopPropagation();
  18279. c.preventDefault()
  18280. }, !1), this.canvas.addEventListener("touchcancel", function(c) {
  18281. for (var d = c.changedTouches.length, e = 0; e < d && e < a.maxTouches; e++) a._onTouchEnd(c.changedTouches[e]);
  18282. c.stopPropagation();
  18283. c.preventDefault()
  18284. }, !1)) : window.navigator.msPointerEnabled ? (this.canvas.addEventListener("MSPointerDown",
  18285. function(c) {
  18286. a._onTouchBegin(c);
  18287. c.stopPropagation();
  18288. c.preventDefault()
  18289. }, !1), this.canvas.addEventListener("MSPointerMove", function(c) {
  18290. a._onTouchMove(c);
  18291. c.stopPropagation();
  18292. c.preventDefault()
  18293. }, !1), this.canvas.addEventListener("MSPointerUp", function(c) {
  18294. a._onTouchEnd(c);
  18295. c.stopPropagation();
  18296. c.preventDefault()
  18297. }, !1)) : (this.canvas.addEventListener("mousedown", function(c) {
  18298. a._onTouchBegin(c)
  18299. }), this.canvas.addEventListener("mousemove", function(c) {
  18300. a._onTouchMove(c)
  18301. }), this.canvas.addEventListener("mouseup", function(c) {
  18302. a._onTouchEnd(c)
  18303. }));
  18304. window.addEventListener("mousedown", function(c) {
  18305. a.inOutOfCanvas(c) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  18306. });
  18307. window.addEventListener("mouseup", function(c) {
  18308. a._isTouchDown && a.inOutOfCanvas(c) && a.dispatchLeaveStageEvent();
  18309. a._isTouchDown = !1
  18310. })
  18311. };
  18312. a.prototype.inOutOfCanvas = function(a) {
  18313. a = this.getLocation(this.canvas, a);
  18314. return 0 > a.x || 0 > a.y || a.x > this.canvas.width || a.y > this.canvas.height ? !0 : !1
  18315. };
  18316. a.prototype.dispatchLeaveStageEvent = function() {
  18317. c.MainContext.instance.stage.dispatchEventWith(c.Event.LEAVE_STAGE)
  18318. };
  18319. a.prototype._onTouchBegin = function(a) {
  18320. var c = this.getLocation(this.canvas, a),
  18321. d = -1;
  18322. a.hasOwnProperty("identifier") && (d = a.identifier);
  18323. this.onTouchBegan(c.x, c.y, d)
  18324. };
  18325. a.prototype._onTouchMove = function(a) {
  18326. var c = this.getLocation(this.canvas, a),
  18327. d = -1;
  18328. a.hasOwnProperty("identifier") && (d = a.identifier);
  18329. this.onTouchMove(c.x, c.y, d)
  18330. };
  18331. a.prototype._onTouchEnd = function(a) {
  18332. var c = this.getLocation(this.canvas, a),
  18333. d = -1;
  18334. a.hasOwnProperty("identifier") && (d = a.identifier);
  18335. this.onTouchEnd(c.x, c.y, d)
  18336. };
  18337. a.prototype.getLocation = function(a,
  18338. d) {
  18339. var e = document.documentElement,
  18340. m = window,
  18341. f, h;
  18342. "function" === typeof a.getBoundingClientRect ? (h = a.getBoundingClientRect(), f = h.left, h = h.top) : h = f = 0;
  18343. f += m.pageXOffset - e.clientLeft;
  18344. h += m.pageYOffset - e.clientTop;
  18345. null != d.pageX ? (e = d.pageX, m = d.pageY) : (f -= document.body.scrollLeft, h -= document.body.scrollTop, e = d.clientX, m = d.clientY);
  18346. var k = c.Point.identity;
  18347. k.x = (e - f) / c.StageDelegate.getInstance().getScaleX();
  18348. k.y = (m - h) / c.StageDelegate.getInstance().getScaleY();
  18349. return k
  18350. };
  18351. return a
  18352. }(c.TouchContext);
  18353. c.HTML5TouchContext =
  18354. e
  18355. })(egret || (egret = {}));
  18356. __extends = this.__extends || function(c, e) {
  18357. function d() {
  18358. this.constructor = c
  18359. }
  18360. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18361. d.prototype = e.prototype;
  18362. c.prototype = new d
  18363. };
  18364. (function(c) {
  18365. var e = function(d) {
  18366. function a() {
  18367. d.call(this);
  18368. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  18369. this._xmlDict = {};
  18370. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  18371. }
  18372. __extends(a, d);
  18373. a.getInstance = function() {
  18374. a._instance || (a._instance = new a);
  18375. return a._instance
  18376. };
  18377. a.prototype.parserXML = function(a) {
  18378. for (var d = 0;
  18379. "\n" == a.charAt(d) || "\t" == a.charAt(d) || "\r" == a.charAt(d) || " " == a.charAt(d);) d++;
  18380. 0 != d && (a = a.substring(d, a.length));
  18381. this._isSupportDOMParser ?
  18382. d = this._parser.parseFromString(a, "text/xml") : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(a));
  18383. null == d && c.Logger.info("xml not found!");
  18384. return d
  18385. };
  18386. a._instance = null;
  18387. return a
  18388. }(c.HashObject);
  18389. c.SAXParser = e
  18390. })(egret || (egret = {}));
  18391. var __extends = this.__extends || function(c, e) {
  18392. function d() {
  18393. this.constructor = c
  18394. }
  18395. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18396. d.prototype = e.prototype;
  18397. c.prototype = new d
  18398. },
  18399. GoalDialog = function(c) {
  18400. function e(d, a, b, e) {
  18401. this.stageWidth = d;
  18402. this.stageHeight = a;
  18403. this.goalMsg = b;
  18404. this.myTest = e;
  18405. c.call(this);
  18406. this.drawForm()
  18407. }
  18408. __extends(e, c);
  18409. e.prototype.drawForm = function() {
  18410. this.alpha = 0.9;
  18411. this.y = this.x = 0;
  18412. this.width = this.stageWidth - 2 * this.x;
  18413. this.height = this.stageHeight;
  18414. var c = this.createBitmapByName("bg");
  18415. this.addChild(c);
  18416. c.width = this.width;
  18417. c.height = this.height;
  18418. this.textContainer = new egret.Sprite;
  18419. this.textContainer.anchorX = this.textContainer.anchorY = 0.5;
  18420. this.textContainer.x = this.stageWidth / 2;
  18421. this.textContainer.y = 0.4 * this.stageHeight;
  18422. this.textContainer.width = 0.9 * this.stageWidth;
  18423. this.textContainer.height = 0.4 * this.stageHeight;
  18424. this.textContainer.alpha = 1;
  18425. this.addChild(this.textContainer);
  18426. c = new egret.TextField;
  18427. c.x = 0;
  18428. c.anchorX = c.anchorY = 0;
  18429. c.textColor = 16744231;
  18430. c.text = this.goalMsg;
  18431. c.size = 40;
  18432. c.width = this.textContainer.width;
  18433. this.textContainer.addChild(c);
  18434. c = this.createBitmapByName("share");
  18435. c.anchorX = c.anchorY = 0.5;
  18436. this.addChild(c);
  18437. c.touchEnabled = !0;
  18438. c.x = 0.3 * this.width;
  18439. c.y = 0.6 * this.height;
  18440. c.scaleX = 1;
  18441. c.scaleY = 1;
  18442. c.name = "btn1";
  18443. c.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onShare, this);
  18444. c = this.createBitmapByName("again");
  18445. c.anchorX = c.anchorY = 0.5;
  18446. this.addChild(c);
  18447. c.touchEnabled = !0;
  18448. c.x = 0.7 * this.width;
  18449. c.y = 0.6 * this.height;
  18450. c.scaleX = 1;
  18451. c.scaleY = 1;
  18452. c.name = "btn2";
  18453. c.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onRestart, this)
  18454. };
  18455. e.prototype.onShare = function(c) {
  18456. // Play68.shareFriend();
  18457. };
  18458. e.prototype.onRestart = function(c) {
  18459. this.myTest.stage.removeChild(this);
  18460. this.myTest.restartGame()
  18461. };
  18462. e.prototype.createBitmapByName = function(c) {
  18463. var a = new egret.Bitmap;
  18464. c = RES.getRes(c);
  18465. a.texture = c;
  18466. return a
  18467. };
  18468. return e
  18469. }(egret.DisplayObjectContainer),
  18470. __extends = this.__extends || function(c, e) {
  18471. function d() {
  18472. this.constructor =
  18473. c
  18474. }
  18475. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18476. d.prototype = e.prototype;
  18477. c.prototype = new d
  18478. },
  18479. LoadingUI = function(c) {
  18480. function e() {
  18481. c.call(this);
  18482. this.createView()
  18483. }
  18484. __extends(e, c);
  18485. e.prototype.createView = function() {
  18486. this.textField = new egret.TextField;
  18487. this.addChild(this.textField);
  18488. this.textField.y = 300;
  18489. this.textField.width = 480;
  18490. this.textField.height = 100;
  18491. this.textField.textAlign = "center"
  18492. };
  18493. e.prototype.setProgress = function(c, a) {
  18494. this.textField.text = "\u6e38\u620f\u52a0\u8f7d\u4e2d..." + c + "/" + a
  18495. };
  18496. return e
  18497. }(egret.Sprite),
  18498. __extends = this.__extends || function(c, e) {
  18499. function d() {
  18500. this.constructor = c
  18501. }
  18502. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18503. d.prototype = e.prototype;
  18504. c.prototype = new d
  18505. },
  18506. StartDialog = function(c) {
  18507. function e(d, a, b, e) {
  18508. this.stageWidth = d;
  18509. this.stageHeight = a;
  18510. this.goalMsg = b;
  18511. this.myTest = e;
  18512. c.call(this);
  18513. this.drawForm()
  18514. }
  18515. __extends(e, c);
  18516. e.prototype.drawForm = function() {
  18517. this.alpha = 0.9;
  18518. this.x = 0.1 * this.stageWidth;
  18519. this.y = 0.2 * this.stageHeight;
  18520. this.width = this.stageWidth - 2 * this.x;
  18521. this.height = this.stageHeight - 2 * this.y;
  18522. var c = this.createBitmapByName("bgImage");
  18523. this.addChild(c);
  18524. c.width = this.width;
  18525. c.height = this.height;
  18526. this.textContainer = new egret.Sprite;
  18527. this.textContainer.anchorX = this.textContainer.anchorY = 0.5;
  18528. this.textContainer.x = this.stageWidth / 2;
  18529. this.textContainer.y = 0.4 * this.stageHeight;
  18530. this.textContainer.width = 0.9 * this.width;
  18531. this.textContainer.height = 0.4 * this.height;
  18532. this.textContainer.alpha = 1;
  18533. this.addChild(this.textContainer);
  18534. c = new egret.TextField;
  18535. c.x = 0;
  18536. c.anchorX = c.anchorY = 0;
  18537. c.textColor = 16744231;
  18538. c.text = this.goalMsg;
  18539. c.size = 40;
  18540. c.width = this.textContainer.width;
  18541. this.textContainer.addChild(c);
  18542. c = this.createBitmapByName("again");
  18543. c.anchorX = c.anchorY = 0.5;
  18544. this.addChild(c);
  18545. c.touchEnabled = !0;
  18546. c.x = 0.5 * this.width;
  18547. c.y = 0.6 * this.height;
  18548. c.scaleX = 1;
  18549. c.scaleY = 1;
  18550. c.name = "btn2";
  18551. c.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onRestart, this)
  18552. };
  18553. e.prototype.onRestart = function(c) {
  18554. this.myTest.stage.removeChild(this);
  18555. this.myTest.restartGame()
  18556. };
  18557. e.prototype.createBitmapByName = function(c) {
  18558. var a = new egret.Bitmap;
  18559. c = RES.getRes(c);
  18560. a.texture = c;
  18561. return a
  18562. };
  18563. return e
  18564. }(egret.DisplayObjectContainer),
  18565. __extends = this.__extends || function(c, e) {
  18566. function d() {
  18567. this.constructor = c
  18568. }
  18569. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18570. d.prototype = e.prototype;
  18571. c.prototype = new d
  18572. },
  18573. ChangeLight = function(c) {
  18574. function e(d) {
  18575. c.call(this);
  18576. this.timer = new egret.Timer(d)
  18577. }
  18578. __extends(e, c);
  18579. e.prototype.setData = function(c, a) {
  18580. this.mt = c;
  18581. this.lightIndex = a;
  18582. this.timer.addEventListener(egret.TimerEvent.TIMER, this.onTimerHandler, this);
  18583. this.timer.start()
  18584. };
  18585. e.prototype.onTimerHandler = function(c) {
  18586. this.timer.stop();
  18587. this.mt.changeLight(this.lightIndex,
  18588. 1)
  18589. };
  18590. return e
  18591. }(egret.DisplayObjectContainer),
  18592. __extends = this.__extends || function(c, e) {
  18593. function d() {
  18594. this.constructor = c
  18595. }
  18596. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18597. d.prototype = e.prototype;
  18598. c.prototype = new d
  18599. },
  18600. MyTest = function(c) {
  18601. function e() {
  18602. c.call(this);
  18603. this.afterWinStageTimer = new egret.Timer(1E3);
  18604. this.shareMsg = "\u6311\u6218\u8bb0\u5fc6\u529b\uff0c\u4e00\u8d77\u6765\u73a9\u5427\u3002";
  18605. this.stageTextColor = 4147404;
  18606. this.waitShowLightTimer = new egret.Timer(100);
  18607. this.stageNo = 1;
  18608. this.timer = new egret.Timer(500);
  18609. this.lastIndex = -1;
  18610. this.showLightNum = 3;
  18611. this.winStage = this.finishClock = !1;
  18612. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  18613. }
  18614. __extends(e, c);
  18615. e.prototype.onAddToStage = function(c) {
  18616. this.loadingView = new LoadingUI;
  18617. this.stage.addChild(this.loadingView);
  18618. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  18619. RES.loadConfig("resource/resource.json", "resource/")
  18620. };
  18621. e.prototype.onConfigComplete = function(c) {
  18622. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE,
  18623. this.onConfigComplete, this);
  18624. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  18625. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  18626. RES.loadGroup("preload")
  18627. };
  18628. e.prototype.onResourceLoadComplete = function(c) {
  18629. "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,
  18630. this), this.createGameScene())
  18631. };
  18632. e.prototype.onResourceProgress = function(c) {
  18633. "preload" == c.groupName && this.loadingView.setProgress(c.itemsLoaded, c.itemsTotal)
  18634. };
  18635. e.prototype.changeLight = function(c, a) {
  18636. var b = this.container1.getChildByName("light" + c.toString());
  18637. this.container1.removeChild(b);
  18638. var e = this.createBitmapByName(0 == a ? "light1" : "light2");
  18639. e.anchorX = e.anchorY = b.anchorX;
  18640. this.container1.addChild(e);
  18641. e.touchEnabled = !0;
  18642. e.x = b.x;
  18643. e.y = b.y;
  18644. e.scaleX = b.scaleX;
  18645. e.scaleY = b.scaleY;
  18646. e.name = b.name;
  18647. this.winStage && (this.textContainer.removeChildren(),
  18648. this.textContainer.alpha = 1, b = new egret.TextField, b.x = 0, b.anchorX = b.anchorY = 0, b.textColor = 16744231, b.text = "\u8fc7\u5173,\u8fdb\u5165\u4e0b\u4e00\u5173", b.size = 60, this.textContainer.addChild(b), this.afterWinStageTimer.addEventListener(egret.TimerEvent.TIMER, this.onAfterWinStageHandler, this), this.afterWinStageTimer.start())
  18649. };
  18650. e.prototype.onAfterWinStageHandler = function(c) {
  18651. this.afterWinStageTimer.stop();
  18652. this.stageContainer.removeChildren();
  18653. c = new egret.TextField;
  18654. c.x = 0;
  18655. c.anchorX = c.anchorY = 0;
  18656. c.textColor =
  18657. this.stageTextColor;
  18658. c.text = "\u7b2c" + this.stageNo.toString() + "\u5173";
  18659. c.size = 80;
  18660. this.stageContainer.addChild(c);
  18661. RES.getResAsync("clock", this.startAnimation, this)
  18662. };
  18663. e.prototype.onTouchContainer = function(c) {
  18664. if (!(this.winStage || 0 < this.showLightNum || "ctn1" != c.currentTarget.name))
  18665. if (c = parseInt(c.target.name.substr(5)), this.changeLight(c, 0), (new ChangeLight(200)).setData(this, c), this.iArray[this.touchArray.length] == c) this.touchArray.push(c), this.touchArray.length == this.iArray.length && (this.stageNo++, this.showLightNum =
  18666. this.stageNo + 2, this.winStage = !0);
  18667. else {
  18668. c = this.getRememberLightNumber();
  18669. if (7 <= c) {
  18670. var a = Math.round(100 * (20 + Math.pow(c, 0.2) / Math.pow(210, 0.2) * 80)) / 100,
  18671. b = "\u7684\u8bb0\u5fc6\u529b\u4e0d\u592a\u7ed9\u529b";
  18672. 150 < c ? b = "\u7684\u8bb0\u5fc6\u529b\u7f55\u89c1\u5f97\u5f3a" : 100 < c ? b = "\u7684\u8bb0\u5fc6\u529b\u8d85\u5f3a" : 60 < c ? b = "\u7684\u8bb0\u5fc6\u529b\u5f88\u5f3a" : 40 < c ? b = "\u7684\u8bb0\u5fc6\u529b\u6bd4\u8f83\u5f3a" : 30 < c ? b = "\u7684\u8bb0\u5fc6\u529b\u8fd8\u4e0d\u9519" : 20 < c ? b = "\u7684\u8bb0\u5fc6\u529b\u9a6c\u9a6c\u864e\u864e" :
  18673. 15 < c && (b = "\u7684\u8bb0\u5fc6\u529b\u6709\u70b9\u52c9\u5f3a");
  18674. var e = "\u6e38\u620f\u7ed3\u675f\uff0c\u60a8\u95ef\u5230\u7b2c" + this.stageNo.toString() + "\u5173\uff0c\u6b63\u786e\u70b9\u4eae" + c.toString() + "\u76cf\u706f\uff0c\u60a8" + b + "\uff0c\u6253\u8d25\u4e86" + a + "%\u7684\u4eba\u3002";
  18675. this.shareMsg = "\u6211\u95ef\u5230\u7b2c" + this.stageNo.toString() + "\u5173\uff0c\u6b63\u786e\u70b9\u4eae" + c.toString() + "\u76cf\u706f\uff0c\u6211" + b + "\uff0c\u6253\u8d25\u4e86" + a + "%\u7684\u4eba\uff0c\u8c01\u6765\u6311\u6218\u4e0b\u8bb0\u5fc6\u529b\u3002"
  18676. } else e =
  18677. "\u5931\u8bef\u4e86\uff0c\u6ca1\u5173\u7cfb\uff0c\u518d\u6765\u4e00\u6b21\u3002", this.shareMsg = "\u6311\u6218\u8bb0\u5fc6\u529b\uff0c\u4e00\u8d77\u6765\u73a9\u5427\u3002";
  18678. // Play68.setRankingScoreDesc(this.stageNo.toString() - 1);
  18679. // Play68.setShareInfo(this.shareMsg, 'ÌôÕ½¼ÇÒäÁ¦');
  18680. c = new GoalDialog(this.stage.stageWidth, this.stage.stageHeight, e, this);
  18681. this.stage.addChild(c)
  18682. }
  18683. };
  18684. e.prototype.getRememberLightNumber = function() {
  18685. if (1 == this.stageNo) return this.touchArray.length;
  18686. for (var c = 0, a = 1; a < this.stageNo; a++) c += a + 2;
  18687. return c + this.touchArray.length
  18688. };
  18689. e.prototype.createGameScene = function() {
  18690. var c =
  18691. this.createBitmapByName("bg");
  18692. this.addChild(c);
  18693. var a = this.stage.stageWidth,
  18694. b = this.stage.stageHeight;
  18695. c.width = a;
  18696. c.height = b;
  18697. c = new egret.Sprite;
  18698. c.anchorX = c.anchorY = 0.5;
  18699. this.addChild(c);
  18700. c.x = a / 2;
  18701. c.y = b / 3 - 60;
  18702. c.alpha = 1;
  18703. this.stageContainer = c;
  18704. this.stageContainer.removeChildren();
  18705. c = new egret.TextField;
  18706. c.x = 0;
  18707. c.anchorX = c.anchorY = 0;
  18708. c.textColor = this.stageTextColor;
  18709. c.text = "\u7b2c" + this.stageNo.toString() + "\u5173";
  18710. c.size = 80;
  18711. this.stageContainer.addChild(c);
  18712. c = new egret.Sprite;
  18713. c.anchorX = c.anchorY = 0.5;
  18714. this.addChild(c);
  18715. c.x = a / 2;
  18716. c.y = b / 2 + 60;
  18717. c.alpha = 1;
  18718. this.textContainer = c;
  18719. this.textContainer.removeChildren();
  18720. c = new egret.TextField;
  18721. c.x = 0;
  18722. c.anchorX = c.anchorY = 0;
  18723. c.textColor = 16744231;
  18724. c.text = "\u51ed\u60a8\u7684\u8bb0\u5fc6\u5c1d\u8bd5\u91cd\u590d\u706f\u70b9\u4eae\u7684\u987a\u5e8f";
  18725. c.size = 24;
  18726. this.textContainer.addChild(c);
  18727. c = this.createBitmapByName("start");
  18728. c.touchEnabled = !0;
  18729. c.anchorX = c.anchorY = 0.5;
  18730. c.x = a / 2;
  18731. c.y = 2 * b / 3 + 20;
  18732. this.addChild(c);
  18733. c.addEventListener(egret.TouchEvent.TOUCH_TAP, this.btnStartGame, this);
  18734. this.createLightScene()
  18735. };
  18736. e.prototype.createLightScene = function() {
  18737. var c = this.stage.stageWidth,
  18738. a = this.stage.stageHeight,
  18739. b = new egret.DisplayObjectContainer,
  18740. e = 1,
  18741. l = 1 * c / 5;
  18742. 60 > l && (e = l / 60);
  18743. for (var m = 0, m = 0; 5 > m; m++) {
  18744. var f = this.createBitmapByName("light2");
  18745. f.anchorX = f.anchorY = 0.5;
  18746. b.addChild(f);
  18747. f.touchEnabled = !0;
  18748. f.x = 0 * c + (m + 0.5) * l;
  18749. f.y = a / 3 + 80;
  18750. f.scaleX = e;
  18751. f.scaleY = e;
  18752. f.name = "light" + m.toString()
  18753. }
  18754. b.touchEnabled = !0;
  18755. b.name = "ctn1";
  18756. this.addChild(b);
  18757. this.container1 = b;
  18758. b.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchContainer, this)
  18759. };
  18760. e.prototype.restartGame =
  18761. function() {
  18762. this.stageNo = 1;
  18763. this.showLightNum = this.stageNo + 2;
  18764. this.stageContainer.removeChildren();
  18765. var c = new egret.TextField;
  18766. c.x = 0;
  18767. c.anchorX = c.anchorY = 0;
  18768. c.textColor = this.stageTextColor;
  18769. c.text = "\u7b2c" + this.stageNo.toString() + "\u5173";
  18770. c.size = 80;
  18771. this.stageContainer.addChild(c);
  18772. RES.getResAsync("clock", this.startAnimation, this)
  18773. };
  18774. e.prototype.startGame = function(c) {
  18775. this.removeChild(c.currentTarget);
  18776. RES.getResAsync("clock", this.startAnimation, this)
  18777. };
  18778. e.prototype.btnStartGame = function(c) {
  18779. this.removeChild(c.currentTarget);
  18780. this.stageContainer.removeChildren();
  18781. c = new egret.TextField;
  18782. c.x = 0;
  18783. c.anchorX = c.anchorY = 0;
  18784. c.textColor = this.stageTextColor;
  18785. c.text = "\u7b2c" + this.stageNo.toString() + "\u5173";
  18786. c.size = 80;
  18787. this.stageContainer.addChild(c);
  18788. RES.getResAsync("clock", this.startAnimation, this)
  18789. };
  18790. e.prototype.onWaitShowLightHandler = function(c) {
  18791. this.finishClock && (alert("true2"), this.waitShowLightTimer.stop(), this.showLight())
  18792. };
  18793. e.prototype.showLight = function() {
  18794. this.winStage = !1;
  18795. this.iArray = [];
  18796. this.touchArray = [];
  18797. this.timer.addEventListener(egret.TimerEvent.TIMER,
  18798. this.onShowLightHandler, this);
  18799. this.timer.start()
  18800. };
  18801. e.prototype.onShowLightHandler = function(c) {
  18802. if (0 >= this.showLightNum) this.timer.stop();
  18803. else {
  18804. c = this.container1._children.length;
  18805. var a = Math.random();
  18806. c = Math.floor(a * c);
  18807. this.iArray.push(c);
  18808. this.lastIndex = c;
  18809. this.changeLight(c, 0);
  18810. (new ChangeLight(300)).setData(this, c);
  18811. this.showLightNum--
  18812. }
  18813. };
  18814. e.prototype.createBitmapByName = function(c) {
  18815. var a = new egret.Bitmap;
  18816. c = RES.getRes(c);
  18817. a.texture = c;
  18818. return a
  18819. };
  18820. e.prototype.startAnimation = function(c) {
  18821. var a = this.textContainer,
  18822. b = -1,
  18823. e = this,
  18824. l = function() {
  18825. b++;
  18826. if (b >= c.length) a.removeChildren(), e.showLight();
  18827. else {
  18828. e.changeDescription(a, c[b]);
  18829. var m = egret.Tween.get(a);
  18830. m.to({
  18831. alpha: 1
  18832. }, 200);
  18833. m.wait(600);
  18834. m.to({
  18835. alpha: 0
  18836. }, 200);
  18837. m.call(l, this)
  18838. }
  18839. };
  18840. l()
  18841. };
  18842. e.prototype.changeDescription = function(c, a) {
  18843. c.removeChildren();
  18844. for (var b = 0, e = 0; e < a.length; e++) {
  18845. var l = a[e],
  18846. m = new egret.TextField;
  18847. m.x = b;
  18848. m.anchorX = m.anchorY = 0;
  18849. m.textColor = parseInt(l.textColor);
  18850. m.text = l.text;
  18851. m.size = 80;
  18852. c.addChild(m);
  18853. b += m.width
  18854. }
  18855. };
  18856. return e
  18857. }(egret.DisplayObjectContainer);