go-debug.js 1.5 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882
  1. /*
  2. * GoJS v1.8.13 JavaScript Library for HTML Diagrams
  3. * Northwoods Software, https://www.nwoods.com/
  4. * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
  5. * Copyright (C) 1998-2018 by Northwoods Software Corporation. All Rights Reserved.
  6. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/1.8.13/doc/license.html.
  7. */
  8. (function(window) {
  9. var f, ba = {};
  10. if (!window.document || void 0 === window.document.createElement("canvas").getContext) throw window.console && window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."), Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");
  11. if (!Object.defineProperty) throw Error("GoJS requires a newer version of JavaScript");
  12. Function.prototype.bind || (Function.prototype.bind = function(a) {
  13. function b() { return g.apply(a, e.concat(d.call(arguments))) }
  14. function c() {}
  15. var d = Array.prototype.slice,
  16. e = d.call(arguments, 1),
  17. g = this;
  18. c.prototype = this.prototype;
  19. b.prototype = new c;
  20. return b
  21. });
  22. (function() {
  23. for (var a = 0, b = ["ms", "moz", "webkit", "o"], c = 0; c < b.length && !window.requestAnimationFrame; ++c) window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"];
  24. window.requestAnimationFrame || (window.requestAnimationFrame = function(b) {
  25. var c = (new Date).getTime(),
  26. g = Math.max(8, 16 - (c - a)),
  27. h = window.setTimeout(function() { b(c + g) }, g);
  28. a = c + g;
  29. return h
  30. });
  31. window.cancelAnimationFrame || (window.cancelAnimationFrame =
  32. function(a) { window.clearTimeout(a) })
  33. })();
  34. var v = {
  35. Dj: !1,
  36. WA: !1,
  37. AF: !1,
  38. JI: !1,
  39. lM: !1,
  40. $F: !1,
  41. lu: null,
  42. enableBoundsInfo: function(a) {
  43. v.Dj = !0;
  44. a && a.ro()
  45. },
  46. disableBoundsInfo: function(a) {
  47. v.Dj = !1;
  48. a && (a.dd.De(!0), a.ro())
  49. },
  50. xF: function(a, b) {
  51. void 0 === a && (a = v.lu);
  52. void 0 === b && (b = a.pm("").rb);
  53. var c = b.length,
  54. d = a.dd;
  55. d.fillStyle = "rgba(255,255,0,.3)";
  56. for (var e = 0; e < c; e++) {
  57. var g = b.fa(e),
  58. h = g.aa;
  59. if (g instanceof x) v.xF(a, g.xa);
  60. else {
  61. var k = g.Ni.copy();
  62. k.GB(g.Nc);
  63. d.save();
  64. d.transform(k.m11, k.m12, k.m21, k.m22, k.dx, k.dy);
  65. d.fillRect(h.x, h.y, h.width, h.height);
  66. d.restore()
  67. }
  68. }
  69. },
  70. yF: function(a,
  71. b) {
  72. a || (a = v.lu);
  73. b || (b = a.pm("").rb);
  74. var c = a.dd,
  75. d = b.length;
  76. c.fillStyle = "rgba(0,0,255,.3)";
  77. for (var e = 0; e < d; e++) {
  78. var g = b.fa(e),
  79. h = g.Ga,
  80. k = g.Ni;
  81. g instanceof x ? v.yF(a, g.xa) : (c.save(), c.transform(k.m11, k.m12, k.m21, k.m22, k.dx, k.dy), c.fillRect(h.x, h.y, h.width, h.height), c.restore())
  82. }
  83. },
  84. EI: function(a, b) {
  85. a || (a = v.lu);
  86. b || (b = a.pm("").rb);
  87. var c = a.dd,
  88. d = b.length;
  89. c.fillStyle = "rgba(0,0,255,.3)";
  90. for (var e = 0; e < d; e++) {
  91. var g = b.fa(e),
  92. h = g.Fa,
  93. k = g.Ni;
  94. g instanceof x ? v.EI(a, g.xa) : (c.save(), c.transform(k.m11, k.m12, k.m21, k.m22, k.dx,
  95. k.dy), c.fillRect(h.x || 0, h.y || 0, h.width, h.height), c.restore())
  96. }
  97. },
  98. LL: function() {
  99. v.yF();
  100. v.xF()
  101. },
  102. ML: function(a) {
  103. a || (a = v.lu);
  104. var b = a.kd;
  105. a = a.dd;
  106. a.strokeStyle = "rgba(0,255,0,.9)";
  107. a.rect(b.x, b.y, b.width, b.height);
  108. a.stroke()
  109. },
  110. zF: function(a, b) {
  111. b.fillStyle = "red";
  112. b.fillRect(0, 0, 8, 8);
  113. b.lineWidth = 8;
  114. b.strokeStyle = "rgba(255,255,0,.6)";
  115. var c = a.wb;
  116. b.rect(c.x, c.y, c.width, c.height);
  117. b.stroke();
  118. b.fillStyle = "rgba(0,255,0,.2)";
  119. b.fillRect(a.kd.x, a.kd.y, a.kd.width, a.kd.height)
  120. },
  121. FI: function(a, b) {
  122. b instanceof da || (a.lineWidth =
  123. 2, a.strokeStyle = "rgba(255,0,0,.5)", a.rect(b.bc.x, b.bc.y, b.bc.width, b.bc.height), a.stroke(), b instanceof z && (a.strokeStyle = b.stroke, a.lineWidth = b.lb), null !== b.R && b.R.type === fa && (a.lineWidth = 1, a.strokeStyle = "rgba(10,200,10,.6)", b instanceof z && (a.strokeStyle = b.stroke, a.lineWidth = b.lb)))
  124. },
  125. GI: function(a, b) {
  126. a.lineWidth = 1;
  127. a.strokeStyle = "rgba(0,0,255,.5)";
  128. a.rect(b.Ga.x, b.Ga.y, b.Ga.width, b.Ga.height);
  129. a.stroke();
  130. void 0 !== b.stroke && (a.strokeStyle = b.stroke);
  131. void 0 !== b.Rg && (a.lineWidth = b.Rg)
  132. },
  133. VA: function(a, b,
  134. c) {
  135. a.setTransform(1, 0, 0, 1, 0, 0);
  136. a.scale(b.ud, b.ud);
  137. a.transform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy);
  138. c = b.dc.length;
  139. for (var d = 0; d < c; d++)
  140. for (var e = b.dc.fa(d), g = e.rb.length, h = 0; h < g; h++) {
  141. var k = e.rb.fa(h);
  142. if (void 0 !== k.location && null !== k.location) {
  143. if (k.location.H()) {
  144. var l = k.location.x,
  145. m = k.location.y;
  146. a.beginPath();
  147. a.strokeStyle = "limegreen";
  148. a.lineWidth = 2;
  149. a.moveTo(l, m + 6);
  150. a.lineTo(l, m);
  151. a.lineTo(l + 6, m);
  152. a.moveTo(l, m);
  153. a.lineTo(l + 10, m + 20);
  154. a.stroke()
  155. }
  156. l = k.position.x;
  157. m = k.position.y;
  158. a.beginPath();
  159. a.strokeStyle = "red";
  160. a.lineWidth = 2;
  161. a.moveTo(l, m + 6);
  162. a.lineTo(l, m);
  163. a.lineTo(l + 6, m);
  164. a.moveTo(l, m);
  165. a.lineTo(l + 20, m + 10);
  166. a.stroke()
  167. }
  168. }
  169. a.setTransform(1, 0, 0, 1, 0, 0)
  170. },
  171. NL: function(a, b, c) {
  172. var d = a.length;
  173. b.fillStyle = "rgba(255,0,0,.1)";
  174. for (var e = 0; e < d; e++) {
  175. var g, h = a[e];
  176. g = c.Nc;
  177. var k = h.x,
  178. l = h.y,
  179. m = k + h.width,
  180. n = l + h.height,
  181. p = g.m11,
  182. q = g.m12,
  183. r = g.m21,
  184. s = g.m22,
  185. u = g.dx,
  186. t = g.dy,
  187. y = k * p + l * r + u,
  188. h = k * q + l * s + t;
  189. g = m * p + l * r + u;
  190. var l = m * q + l * s + t,
  191. w = k * p + n * r + u,
  192. k = k * q + n * s + t,
  193. p = m * p + n * r + u,
  194. m = m * q + n * s + t,
  195. n = y,
  196. q = h,
  197. n = Math.min(n, g),
  198. y = Math.max(y, g),
  199. q = Math.min(q, l),
  200. h = Math.max(h, l),
  201. n =
  202. Math.min(n, w),
  203. y = Math.max(y, w),
  204. q = Math.min(q, k),
  205. h = Math.max(h, k),
  206. n = Math.min(n, p),
  207. y = Math.max(y, p),
  208. q = Math.min(q, m),
  209. h = Math.max(h, m);
  210. g = new C(n, q, y - n, h - q);
  211. b.fillRect(g.x, g.y, g.width, g.height)
  212. }
  213. },
  214. HI: function(a, b, c, d, e) {
  215. a.fillStyle = "rgba(0,255,0,.2)";
  216. a.fillRect(b, c, d, e)
  217. },
  218. II: function(a, b, c) {
  219. a.save();
  220. var d = b.Nc;
  221. d.reset();
  222. 1 !== b.scale && d.scale(b.scale);
  223. b = b.position;
  224. 0 === b.x && 0 === b.y || d.translate(-b.x, -b.y);
  225. a.setTransform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
  226. c = c.gd.o;
  227. d = c.length;
  228. for (b = 0; b < d; b++) {
  229. var e = c[b];
  230. a.beginPath();
  231. a.moveTo(e.x - 4, e.y);
  232. a.lineTo(e.x + 4, e.y);
  233. a.moveTo(e.x, e.y - 4);
  234. a.lineTo(e.x, e.y + 4);
  235. a.lineWidth = 2;
  236. a.strokeStyle = "rgba(255,0,0,.9)";
  237. a.stroke()
  238. }
  239. a.restore()
  240. },
  241. JL: function(a) { a || (a = v.lu); for (a = a.ao; a.next();) D.trace(a.value.toString()) },
  242. zM: function(a, b) {
  243. var c = b.dp(a),
  244. d = b.cc;
  245. d.te = b.pC(c);
  246. d.ha = c;
  247. return ga(b, d, a)
  248. },
  249. uM: function(a, b) { b.Je(a.ha) && (b.dd.fillStyle = "lime", b.dd.fillRect(a.te.x, a.te.y, 1 * b.scale, 1 * b.scale)) },
  250. vM: function(a) {
  251. var b = ha(a, !1, null, null);
  252. if (!b.vq) {
  253. var c = a.wb,
  254. d = a.scale;
  255. a = a.dd;
  256. for (var e = 0; e <= b.zn; e++)
  257. for (var g =
  258. 0; g <= b.An; g++) {
  259. var h = b.sd[e][g];
  260. if (0 !== h) {
  261. var k = (e * b.he + b.$f - c.x) * d,
  262. l = (g * b.Rd + b.ag - c.y) * d;
  263. 0 !== h && (a.fillStyle = "rgba(255, 0, 0, .2)", a.fillRect(k, l, b.he * d, b.Rd * d));
  264. 999999 <= h || (h %= 10, a.fillStyle = "blue", a.fillText(h.toString(), k, l + b.Rd))
  265. }
  266. }
  267. }
  268. },
  269. dumpReferences: function(a) {
  270. if (a instanceof E)
  271. for (a = a.ao; a.next();) {
  272. var b = a.value;
  273. D.trace(b.toString());
  274. for (b = b.Hi; b.next();) v.dumpReferences(b.value)
  275. } else if (a instanceof F) {
  276. D.trace("References for " + a);
  277. null !== a.layer && D.trace(" " + a.layer.toString() + ' LayerName: "' +
  278. a.Nf + '"');
  279. a.to !== a && D.trace(" SelectionObject: " + a.to.toString() + ' SelectionObjectName: "' + a.Py + '"');
  280. a.Bf !== a && D.trace(" LocationObject: " + a.Bf.toString() + ' LocationObjectName: "' + a.uy + '"');
  281. if (a.lh) {
  282. for (var b = "", c = a.lh.j; c.next();) b += c.key + " ";
  283. D.trace(" Adornments: " + b)
  284. }
  285. null !== a.Ka && D.trace(" ContainingGroup: " + a.Ka.toString());
  286. if (a instanceof G) {
  287. if (0 < a.Od.count) {
  288. b = "";
  289. for (c = a.Od; c.next();) b += c.value.toString() + ", ";
  290. D.trace(" Links: " + b)
  291. }
  292. null !== a.Xb && D.trace(" LabeledLink: " + a.Xb.toString());
  293. if (a instanceof I) {
  294. D.trace(" Placeholder: " + a.placeholder);
  295. b = "";
  296. for (c = a.uc; c.next();) b += c.value.toString() + ", ";
  297. D.trace(" Members: " + b);
  298. b = "";
  299. for (c = a.gn.j; c.next();) b += c.value.toString() + ", ";
  300. D.trace(" NestedGroups: " + b);
  301. D.trace(" Layout: " + a.Yb)
  302. }
  303. } else if (a instanceof J) {
  304. D.trace(" Path: " + a.path);
  305. D.trace(" From: " + a.$ + " " + a.oc + ' "' + a.hg + '"');
  306. D.trace(" To: " + a.ba + " " + a.Gc + ' "' + a.jh + '"');
  307. b = "";
  308. for (a = a.Af; a.next();) b += a.value.toString() + ", ";
  309. D.trace(" LabelNodes: " + b)
  310. }
  311. }
  312. },
  313. dumpVisualTree: function(a) {
  314. if (a instanceof E)
  315. for (a = a.ao; a.next();) {
  316. var b = a.value;
  317. D.trace(b.toString());
  318. for (b = b.Hi; b.next();) v.dumpVisualTree(b.value)
  319. } else a instanceof F && (b = " ", a.nF && (b += "c"), a.rF && (b += "d"), a.YF && (b += "g"), a.zG && (b += "m"), a.OG && (b += "h"), a.PG && (b += "z"), a.UG && (b += "o"), a.il && (b += "s"), a.kH && (b += "t"), a.$G && (b += "A"), a.hy && (b += "B"), a.tB && (b += "L"), a.ib && (b += "S"), a.dl && (b += "H"), v.sD(a, 1, b))
  320. },
  321. sD: function(a, b, c) {
  322. for (var d = "", e = 0; e < b; e++) d += " ";
  323. d += a.toString();
  324. c && (d += c);
  325. c = a.name ? ' "' + a.name + '" ' : " ";
  326. c = a.visible ? c + "v" : c + "!v";
  327. c = a.tg ? c +
  328. "p" : c + "!p";
  329. a.Ue && (c += "m");
  330. a.Hu && (c += "a");
  331. d += c;
  332. if (0 !== a.Sb || 0 !== a.column) d += " [" + a.Sb + "," + a.column + "]";
  333. d += " " + a.aa.toString();
  334. a.Ea.H() && (d += " d:" + a.Ea.toString());
  335. a.Ga.H() && (d += " n:" + a.Ga.toString());
  336. 1 !== a.scale && (d += " s:" + a.scale);
  337. 0 !== a.angle && (d += " a:" + a.angle);
  338. null !== a.background && (d += " b:" + a.background.toString());
  339. null !== a.gm && (d += " a:" + a.background.toString());
  340. a instanceof x && (d += " elts:" + a.xa.count, a.isEnabled || (d += " !ENABLED"), a.yq && (d += " CLIPPING"), 0 !== a.qH && (d += " top:" + a.qH), 0 !== a.sG && (d +=
  341. " left:" + a.sG), null !== a.el && (d += " itemArray#:" + D.cb(a.el)), a.oG && (d += " cat:" + a.oG), null !== a.data && (d += " data:" + a.data));
  342. null !== a.yd && (d += ' portId: "' + a.yd + '"');
  343. D.trace(d);
  344. if (a instanceof x)
  345. for (a = a.elements; a.next();) v.sD(a.value, b + 1, "")
  346. },
  347. PL: function(a) {
  348. D.trace("DelayedReferences (" + a.zg.count + ")");
  349. for (a = a.zg.j; a.next();) {
  350. for (var b = "", c = a.value.j; c.next();) b += ia(c.value) + ", ";
  351. D.trace(" " + a.key + ": " + b)
  352. }
  353. },
  354. fF: function(a, b) {
  355. if (!D.Qa(b) || b instanceof Element || b instanceof CanvasRenderingContext2D || b instanceof ja || b instanceof ma) return "";
  356. var c = "",
  357. d;
  358. for (d in b)
  359. if ("string" !== typeof d) "" === c && (c = b + "\n"), c += " " + d + " is not a string property\n";
  360. else if ("_" !== d.charAt(0) && !(2 >= d.length)) {
  361. var e = D.xb(b, d);
  362. if (null !== e && "function" !== typeof e) {
  363. if (b.hasOwnProperty(d)) { var g = Object.getPrototypeOf(b); if (g && g.Rw && g.Rw[d]) continue } else if (D.by(b, d)) continue;
  364. "" === c && (c = b + "\n");
  365. c += ' unknown property "' + d + '" has value: ' + e + " at " + a + "\n"
  366. }
  367. }
  368. return c
  369. },
  370. Hx: function(a, b) {
  371. if (null !== b && void 0 !== b && "number" !== typeof b && "string" !==
  372. typeof b && "boolean" !== typeof b && "function" !== typeof b)
  373. if (void 0 !== D.Nd(b)) {
  374. if (!v.gx.contains(b))
  375. if (v.gx.add(b), v.Fw.add(v.fF(a, b)), b instanceof K || b instanceof L || b instanceof oa)
  376. for (var c = b.j; c.next();) v.Hx(a + "[" + c.key + "]", c.value);
  377. else
  378. for (c in b) {
  379. var d = D.xb(b, c);
  380. if (void 0 !== d && null !== d && D.Qa(d) && d !== b.Rw) {
  381. if (b instanceof pa) { if (d === b.sf) continue } else if (b instanceof x) { if ("data" === c || d === b.Sd) continue; if ("itemArray" === c || d === b.ej) continue; if (b instanceof F && d === b.Sl) continue } else if (!(b instanceof E))
  382. if (b instanceof qa) { if ("archetypeGroupData" === c || d === b.nz) continue } else if (b instanceof ra) { if ("archetypeLinkData" === c || d === b.pz) continue; if ("archetypeLabelNodeData" === c || d === b.oz) continue } else if (b instanceof ta) { if ("archetypeNodeData" === c || d === b.yl) continue } else if (b instanceof M) { if ("nodeDataArray" === c || d === b.ze) continue; if ("linkDataArray" === c || d === b.df || d === b.ki) continue; if (d === b.Kc) continue; if (d === b.zg) continue } else if (b instanceof ua || b instanceof va || b instanceof wa) continue;
  383. v.Hx(a + "." +
  384. c, d)
  385. }
  386. }
  387. } else if (Array.isArray(b))
  388. for (c = 0; c < b.length; c++) v.Hx(a + "[" + c + "]", b[c]);
  389. else v.Fw.add(v.fF(a, b))
  390. },
  391. checkProperties: function(a) {
  392. void 0 === v.gx ? v.gx = new L(Object) : v.gx.clear();
  393. v.Fw = new xa;
  394. v.Hx("", a);
  395. a = v.Fw.toString();
  396. v.Fw = null;
  397. return a
  398. }
  399. };
  400. ba.Debug = v;
  401. var D = {
  402. Ad: 1,
  403. bd: 2,
  404. rd: 4,
  405. qd: 8,
  406. Xn: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("534.30") && 0 < window.navigator.userAgent.indexOf("Android"),
  407. Mu: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 9.0"),
  408. zq: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 10.0"),
  409. Aq: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Trident/7"),
  410. rB: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Edge/"),
  411. Qh: void 0 !== window.navigator && void 0 !==
  412. window.navigator.platform && 0 <= window.navigator.platform.toUpperCase().indexOf("MAC"),
  413. iG: void 0 !== window.navigator && void 0 !== window.navigator.platform && null !== window.navigator.platform.match(/(iPhone|iPod|iPad)/i),
  414. oF: function(a, b, c) {
  415. var d = -1;
  416. return function() {
  417. var e = this,
  418. g = arguments; - 1 !== d && D.clearTimeout(d);
  419. d = D.setTimeout(function() {
  420. d = -1;
  421. c || a.apply(e, g)
  422. }, b);
  423. c && !d && a.apply(e, g)
  424. }
  425. },
  426. setTimeout: function(a, b) { return window.setTimeout(a, b) },
  427. clearTimeout: function(a) { window.clearTimeout(a) },
  428. createElement: function(a) { return window.document.createElement(a) },
  429. k: function(a) { throw Error(a); },
  430. qa: function(a, b) {
  431. var c = "The object is frozen, so its properties cannot be set: " + a.toString();
  432. void 0 !== b && (c += " to value: " + b);
  433. D.k(c)
  434. },
  435. l: function(a, b, c, d) { a instanceof b || (c = D.getTypeName(c), void 0 !== d && (c += "." + d), D.kc(a, b, c)) },
  436. h: function(a, b, c, d) { typeof a !== b && (c = D.getTypeName(c), void 0 !== d && (c += "." + d), D.kc(a, b, c)) },
  437. p: function(a, b, c) {
  438. "number" === typeof a && isFinite(a) || (b = D.getTypeName(b), void 0 !== c && (b += "." + c), D.k(b + " must be a real number type, and not NaN or Infinity: " +
  439. a))
  440. },
  441. Da: function(a, b, c, d) { a instanceof ya && a.Qe === b || (c = D.getTypeName(c), void 0 !== d && (c += "." + d), D.kc(a, "a constant of class " + D.wf(b), c)) },
  442. hu: function(a, b) { "string" === typeof a ? za(a) || D.k('Color "' + a + '" is not a valid color string for ' + b) : a instanceof Ba || D.k("Value for " + b + " must be a color string or a Brush, not " + a) },
  443. kc: function(a, b, c, d) {
  444. b = D.getTypeName(b);
  445. c = D.getTypeName(c);
  446. void 0 !== d && (c += "." + d);
  447. "string" === typeof a ? D.k(c + " value is not an instance of " + b + ': "' + a + '"') : D.k(c + " value is not an instance of " +
  448. b + ": " + a)
  449. },
  450. ua: function(a, b, c, d) {
  451. c = D.getTypeName(c);
  452. void 0 !== d && (c += "." + d);
  453. D.k(c + " is not in the range " + b + ": " + a)
  454. },
  455. zd: function(a) { D.k(D.wf(a) + " constructor cannot take any arguments.") },
  456. Va: function(a) { D.k("Collection was modified during iteration: " + a.toString() + "\n Perhaps you should iterate over a copy of the collection,\n or you could collect items to be removed from the collection after the iteration.") },
  457. ak: function(a, b) { D.k("No property to set for this enum value: " + b + " on " + a.toString()) },
  458. trace: function(a) { window.console && window.console.log(a) },
  459. Qx: {},
  460. On: function(a, b) {!0 !== D.Qx[a] && (D.Qx[a] = !0, window.console && window.console.log(a + " is deprecated in " + b + ", see the GoJS change log for more information.")) },
  461. Qa: function(a) { return "object" === typeof a && null !== a },
  462. isArray: function(a) { return Array.isArray(a) || a instanceof NodeList || a instanceof HTMLCollection },
  463. qJ: function(a) { return Array.isArray(a) },
  464. gu: function(a, b, c) { D.isArray(a) || D.kc(a, "Array or NodeList or HTMLCollection", b, c) },
  465. cb: function(a) { return a.length },
  466. km: function(a) { return Array.prototype.slice.call(a) },
  467. La: function(a, b) { Array.isArray(a); return a[b] },
  468. cF: function(a, b, c) { Array.isArray(a) ? a[b] = c : D.k("Cannot replace an object in an HTMLCollection or NodeList at " + b) },
  469. hm: function(a, b) {
  470. if (Array.isArray(a)) return a.indexOf(b);
  471. for (var c = a.length, d = 0; d < c; d++)
  472. if (a[d] === b) return d;
  473. return -1
  474. },
  475. Ih: function(a, b, c) { Array.isArray(a) ? b >= a.length ? a.push(c) : a.splice(b, 0, c) : D.k("Cannot insert an object into an HTMLCollection or NodeList: " + c + " at " + b) },
  476. Vg: function(a,
  477. b) { Array.isArray(a) ? b >= a.length ? a.pop() : a.splice(b, 1) : D.k("Cannot remove an object from an HTMLCollection or NodeList at " + b) },
  478. ez: [],
  479. P: function() { var a = D.ez.pop(); return void 0 === a ? new N : a },
  480. Fb: function(a, b) {
  481. var c = D.ez.pop();
  482. if (void 0 === c) return new N(a, b);
  483. c.x = a;
  484. c.y = b;
  485. return c
  486. },
  487. A: function(a) { D.ez.push(a) },
  488. DC: [],
  489. Gm: function() { var a = D.DC.pop(); return void 0 === a ? new Ca : a },
  490. Zk: function(a) { D.DC.push(a) },
  491. fz: [],
  492. Sf: function() { var a = D.fz.pop(); return void 0 === a ? new C : a },
  493. vg: function(a, b, c, d) {
  494. var e = D.fz.pop();
  495. if (void 0 === e) return new C(a, b, c, d);
  496. e.x = a;
  497. e.y = b;
  498. e.width = c;
  499. e.height = d;
  500. return e
  501. },
  502. Lb: function(a) { D.fz.push(a) },
  503. EC: [],
  504. hh: function() { var a = D.EC.pop(); return void 0 === a ? new Ea : a },
  505. lf: function(a) { D.EC.push(a) },
  506. gz: null,
  507. v: function() { var a = D.gz; return null !== a ? (D.gz = null, a) : new Fa },
  508. u: function(a) {
  509. a.reset();
  510. D.gz = a
  511. },
  512. CC: [],
  513. mb: function() { var a = D.CC.pop(); return void 0 === a ? [] : a },
  514. ya: function(a) {
  515. a.length = 0;
  516. D.CC.push(a)
  517. },
  518. Do: Object.freeze([]),
  519. Km: 1,
  520. xc: function(a) { a.__gohashid = D.Km++ },
  521. sq: function(a) {
  522. var b = a.__gohashid;
  523. void 0 === b && (b = D.Km++, a.__gohashid = b);
  524. return b
  525. },
  526. Nd: function(a) { return a.__gohashid },
  527. ka: function(a, b) {
  528. b.vz = a;
  529. ba[a] = b
  530. },
  531. Ta: function(a, b) {
  532. function c() {}
  533. c.prototype = b.prototype;
  534. a.prototype = new c;
  535. a.prototype.constructor = a
  536. },
  537. Di: function(a) { a.PH = !0 },
  538. defineProperty: function(a, b, c, d, e) {
  539. D.h(a, "function", "Util.defineProperty:classfunc");
  540. D.h(b, "object", "Util.defineProperty:propobj");
  541. D.h(c, "function", "Util.defineProperty:getter");
  542. D.h(d, "function", "Util.defineProperty:setter");
  543. for (var g in b) {
  544. b = b[g];
  545. c = {
  546. get: c,
  547. set: d,
  548. enumerable: !0
  549. };
  550. if (void 0 !== e)
  551. for (var h in e) c[h] = e[h];
  552. Object.defineProperty(a.prototype, g, c);
  553. e = Object.getOwnPropertyDescriptor(a.prototype, g);
  554. b && e && Object.defineProperty(a.prototype, b, e);
  555. break
  556. }
  557. },
  558. NK: !1,
  559. w: function(a, b, c, d) {
  560. D.h(a, "function", "Util.defineReadOnlyProperty:classfunc");
  561. D.h(b, "object", "Util.defineReadOnlyProperty:propobj");
  562. D.h(c, "function", "Util.defineReadOnlyProperty:getter");
  563. for (var e in b) {
  564. var g = b[e];
  565. b = {
  566. get: c,
  567. set: function(a) {
  568. D.k('The property "' + g + '" is read-only and cannot be set to ' +
  569. a)
  570. },
  571. enumerable: !0
  572. };
  573. if (void 0 !== d)
  574. for (var h in d) b[h] = d[h];
  575. Object.defineProperty(a.prototype, e, b);
  576. d = Object.getOwnPropertyDescriptor(a.prototype, e);
  577. g && d && Object.defineProperty(a.prototype, g, d);
  578. break
  579. }
  580. },
  581. me: function(a, b) {
  582. for (var c in b) b[c] = !0;
  583. a.prototype.Rw = b
  584. },
  585. getTypeName: function(a) { return void 0 === a ? "" : "string" === typeof a ? a : "function" === typeof a ? D.wf(a) : null === a ? "*" : "" },
  586. wf: function(a) {
  587. if ("function" === typeof a) {
  588. if (a.vz) return a.vz;
  589. if (a.name) return a.name;
  590. var b = a.toString(),
  591. c = b.indexOf("("),
  592. b = b.substring(9,
  593. c).trim();
  594. if ("" !== b) return a.vz = b
  595. } else if (D.Qa(a) && a.constructor) return D.wf(a.constructor);
  596. return typeof a
  597. },
  598. s: function(a, b, c) {
  599. D.h(a, "function", "Util.defineEnumValue:classfunc");
  600. D.h(b, "string", "Util.defineEnumValue:name");
  601. D.h(c, "number", "Util.defineEnumValue:num");
  602. c = new ya(a, b, c);
  603. Object.freeze(c);
  604. a[b] = c;
  605. var d = a.zv;
  606. d instanceof oa || (d = new oa("string", ya), a.zv = d);
  607. d.add(b, c);
  608. return c
  609. },
  610. xb: function(a, b) {
  611. if (!a || !b) return null;
  612. var c = void 0;
  613. try {
  614. "function" === typeof b ? c = b(a) : "function" === typeof a.getAttribute ?
  615. (c = a.getAttribute(b), null === c && (c = void 0)) : c = a[b]
  616. } catch (d) { v && D.trace("property get error: " + d.toString()) }
  617. return c
  618. },
  619. Ua: function(a, b, c) { if (a && b) try { "function" === typeof b ? b(a, c) : "function" === typeof a.setAttribute ? a.setAttribute(b, c) : a[b] = c } catch (d) { v && D.trace("property set error: " + d.toString()) } },
  620. nv: function(a, b) {
  621. D.h(a, "object", "Setting properties requires Objects as arguments");
  622. D.h(b, "object", "Setting properties requires Objects as arguments");
  623. var c = a instanceof x,
  624. d = a instanceof E,
  625. e;
  626. for (e in b) {
  627. "" ===
  628. e && D.k("Setting properties requires non-empty property names");
  629. var g = a,
  630. h = e;
  631. if (c || d) {
  632. var k = e.indexOf(".");
  633. if (0 < k) {
  634. var l = e.substring(0, k);
  635. if (c) g = a.Md(l);
  636. else if (g = a[l], void 0 === g || null === g) g = a.nb[l];
  637. D.Qa(g) ? h = e.substr(k + 1) : D.k("Unable to find object named: " + l + " in " + a.toString() + " when trying to set property: " + e)
  638. }
  639. }
  640. if ("_" !== h[0] && !D.by(g, h))
  641. if (d && "ModelChanged" === h) { a.ZH(b[h]); continue } else if (d && "Changed" === h) { a.Bn(b[h]); continue } else if (d && D.by(a.nb, h)) g = a.nb;
  642. else if (d && Ga(a, h)) { a.xx(h, b[h]); continue } else if (a instanceof M && "Changed" === h) { a.Bn(b[h]); continue } else D.k('Trying to set undefined property "' + h + '" on object: ' + g.toString());
  643. g[h] = b[e];
  644. "_" === h[0] && g instanceof O && g.WH(h)
  645. }
  646. },
  647. by: function(a, b) {
  648. if (a.hasOwnProperty(b)) return !0;
  649. for (var c = Object.getPrototypeOf(a); c && c !== Function;) {
  650. if (c.hasOwnProperty(b)) return !0;
  651. var d = c.Rw;
  652. if (d && d[b]) return !0;
  653. c = Object.getPrototypeOf(c)
  654. }
  655. return !1
  656. },
  657. bK: function(a) {
  658. for (var b = [], c = 0; 256 > c; c++) b[c] = c;
  659. for (var d = 0, e = 0, c = 0; 256 > c; c++) d = (d + b[c] + 119) % 256, e = b[c], b[c] = b[d], b[d] = e;
  660. for (var d = c = 0,
  661. g = "", h = 0; h < a.length; h++) c = (c + 1) % 256, d = (d + b[c]) % 256, e = b[c], b[c] = b[d], b[d] = e, g += String.fromCharCode(a.charCodeAt(h) ^ b[(b[c] + b[d]) % 256]);
  662. return g
  663. },
  664. dJ: function(a) {
  665. for (var b = {}, c = 0; 256 > c; c++) b["0123456789abcdef".charAt(c >> 4) + "0123456789abcdef".charAt(c & 15)] = String.fromCharCode(c);
  666. a.length % 2 && (a = "0" + a);
  667. for (var d = [], e = 0, c = 0; c < a.length; c += 2) d[e++] = b[a.substr(c, 2)];
  668. a = d.join("");
  669. return "" === a ? "0" : a
  670. },
  671. Wg: function(a) { return D.bK(D.dJ(a)) },
  672. Im: null,
  673. adym: "7da71ca0ad381e90",
  674. vfo: "2be64efdb265",
  675. qL: "@COLOR1",
  676. rL: "@COLOR2",
  677. pF: !1,
  678. ju: null,
  679. ku: null
  680. };
  681. D.Im = function() {
  682. var a = window.document.createElement("canvas"),
  683. b = a.getContext("2d");
  684. b[D.Wg("7ca11abfd022028846")] = D.Wg("398c3597c01238");
  685. for (var c = ["5da73c80a36755dc038e4972187c3cae51fd22", "32ab5ff3b26f42dc0ed90f22432913b54ae6247590da4bb21c324ba3a84e385776", "54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387", "74bf19bce72555874c86"], d = 1; 5 > d; d++) b[D.Wg("7ca11abfd7330390")](D.Wg(c[d - 1]), 10, 15 * d + 0);
  686. b[D.Wg("7ca11abfd022028846")] = D.Wg("39f046ebb36e4b");
  687. for (d = 1; 5 > d; d++) b[D.Wg("7ca11abfd7330390")](D.Wg(c[d -
  688. 1]), 10, 15 * d + 0);
  689. if (4 !== c.length || "5" !== c[0][0] || "7" !== c[3][0]) D.s = function(a, b) {
  690. var c = new ya(a, b, 2);
  691. Object.freeze(c);
  692. a[b] = c;
  693. var d = a.zv;
  694. d instanceof oa || (d = new oa("string", ya), a.zv = d);
  695. d.add(b, c);
  696. return c
  697. };
  698. return a
  699. }();
  700. function ya(a, b, c) {
  701. D.xc(this);
  702. this.OC = a;
  703. this.$b = b;
  704. this.TH = c
  705. }
  706. D.ka("EnumValue", ya);
  707. ya.prototype.toString = function() { return D.wf(this.OC) + "." + this.$b };
  708. D.w(ya, { Qe: "classType" }, function() { return this.OC });
  709. D.w(ya, { name: "name" }, function() { return this.$b });
  710. D.w(ya, { value: "value" }, function() { return this.TH });
  711. var Ha;
  712. ya.findName = Ha = function(a, b) {
  713. if (void 0 === b || null === b || "" === b) return null;
  714. D.h(a, "function", "findName:classfunc");
  715. D.h(b, "string", "EnumValue.findName:name");
  716. var c = a.zv;
  717. return c instanceof oa ? c.oa(b) : null
  718. };
  719. function xa() { this.NC = [] }
  720. xa.prototype.toString = function() { return this.NC.join("") };
  721. xa.prototype.add = function(a) { "" !== a && this.NC.push(a) };
  722. function ma() {}
  723. function Ia(a) {
  724. void 0 === a && (a = 42);
  725. this.seed = a;
  726. this.az = 48271;
  727. this.yv = 2147483647;
  728. this.BC = this.yv / this.az;
  729. this.BH = this.yv % this.az;
  730. this.AH = 1 / this.yv;
  731. this.random()
  732. }
  733. Ia.prototype.random = function() {
  734. var a = this.seed % this.BC * this.az - this.seed / this.BC * this.BH;
  735. this.seed = 0 < a ? a : a + this.yv;
  736. return this.seed * this.AH
  737. };
  738. function Ja() {}
  739. D.w(Ja, { j: "iterator" }, function() { return this });
  740. Ja.prototype.reset = Ja.prototype.reset = function() {};
  741. Ja.prototype.next = Ja.prototype.next = function() { return !1 };
  742. Ja.prototype.hasNext = function() { return !1 };
  743. Ja.prototype.first = Ja.prototype.first = function() { return null };
  744. Ja.prototype.any = function() { return !1 };
  745. Ja.prototype.all = function() { return !0 };
  746. Ja.prototype.each = function() { return this };
  747. Ja.prototype.map = function() { return this };
  748. Ja.prototype.filter = function() { return this };
  749. Ja.prototype.concat = function(a) { return a.j };
  750. D.w(Ja, { count: "count" }, function() { return 0 });
  751. Ja.prototype.Vf = function() {};
  752. Ja.prototype.toString = function() { return "EmptyIterator" };
  753. var Ka = new Ja;
  754. function Ma(a) {
  755. this.key = -1;
  756. this.value = a
  757. }
  758. D.me(Ma, { key: !0, value: !0 });
  759. D.w(Ma, { j: "iterator" }, function() { return this });
  760. Ma.prototype.reset = Ma.prototype.reset = function() { this.key = -1 };
  761. Ma.prototype.next = Ma.prototype.next = function() { return -1 === this.key ? (this.key = 0, !0) : !1 };
  762. Ma.prototype.hasNext = function() { return this.next() };
  763. Ma.prototype.first = Ma.prototype.first = function() { this.key = 0; return this.value };
  764. Ma.prototype.any = function(a) { this.key = -1; return a(this.value) };
  765. Ma.prototype.all = function(a) { this.key = -1; return a(this.value) };
  766. Ma.prototype.each = function(a) {
  767. this.key = -1;
  768. a(this.value);
  769. return this
  770. };
  771. Ma.prototype.map = function(a) { return new Ma(a(this.value)) };
  772. Ma.prototype.filter = function(a) { return a(this.value) ? new Ma(this.value) : Ka };
  773. Ma.prototype.concat = function(a) { return new Na(this, a.j) };
  774. D.w(Ma, { count: "count" }, function() { return 1 });
  775. Ma.prototype.Vf = function() { this.value = null };
  776. Ma.prototype.toString = function() { return "SingletonIterator(" + this.value + ")" };
  777. function Na(a, b) {
  778. this.Ll = a;
  779. this.Ml = b;
  780. this.Av = !1
  781. }
  782. D.me(Na, { key: !0, value: !0 });
  783. D.w(Na, { j: "iterator" }, function() { return this });
  784. Na.prototype.reset = Na.prototype.reset = function() {
  785. this.Ll.reset();
  786. this.Ml.reset();
  787. this.Av = !1
  788. };
  789. Na.prototype.next = Na.prototype.next = function() {
  790. if (!this.Av) {
  791. var a = this.Ll;
  792. if (a.next()) return this.key = a.key, this.value = a.value, !0;
  793. this.Av = !0
  794. }
  795. return this.Av && (a = this.Ml, a.next()) ? (this.key = a.key, this.value = a.value, !0) : !1
  796. };
  797. Na.prototype.hasNext = function() { return this.next() };
  798. Na.prototype.first = Na.prototype.first = function() { this.reset(); return this.next() ? this.value : null };
  799. Na.prototype.any = function(a) { return this.Ll.any(a) || this.Ml.any(a) ? !0 : !1 };
  800. Na.prototype.all = function(a) { return this.Ll.all(a) && this.Ml.all(a) ? !0 : !1 };
  801. Na.prototype.each = function(a) {
  802. this.Ll.each(a);
  803. this.Ml.each(a);
  804. return this
  805. };
  806. Na.prototype.map = function(a) { return new Na(this.Ll.map(a), this.Ml.map(a)) };
  807. Na.prototype.filter = function(a) { return new Na(this.Ll.filter(a), this.Ml.filter(a)) };
  808. Na.prototype.concat = function(a) { return new Na(this, a.j) };
  809. D.w(Na, { count: "count" }, function() { return this.Ll.count + this.Ml.count });
  810. Na.prototype.Vf = function() { this.value = this.key = null };
  811. Na.prototype.toString = function() { return "ConcatIterator()" };
  812. function Qa(a) {
  813. this.Jc = a;
  814. this.pi = null;
  815. a.Zb = null;
  816. this.Za = a.I;
  817. this.Ic = -1
  818. }
  819. D.me(Qa, { key: !0, value: !0 });
  820. D.w(Qa, { j: "iterator" }, function() { return this });
  821. D.defineProperty(Qa, { Nq: "predicate" }, function() { return this.pi }, function(a) { this.pi = a });
  822. Qa.prototype.reset = Qa.prototype.reset = function() {
  823. var a = this.Jc;
  824. a.Zb = null;
  825. this.Za = a.I;
  826. this.Ic = -1
  827. };
  828. Qa.prototype.next = Qa.prototype.next = function() {
  829. var a = this.Jc;
  830. if (a.I !== this.Za) {
  831. if (0 > this.key) return !1;
  832. D.Va(a)
  833. }
  834. var a = a.o,
  835. b = a.length,
  836. c = ++this.Ic,
  837. d = this.pi;
  838. if (null !== d)
  839. for (; c < b;) {
  840. var e = a[c];
  841. if (d(e)) return this.key = this.Ic = c, this.value = e, !0;
  842. c++
  843. } else {
  844. if (c < b) return this.key = c, this.value = a[c], !0;
  845. this.Vf()
  846. }
  847. return !1
  848. };
  849. Qa.prototype.hasNext = function() { return this.next() };
  850. Qa.prototype.first = Qa.prototype.first = function() {
  851. var a = this.Jc;
  852. this.Za = a.I;
  853. this.Ic = 0;
  854. var a = a.o,
  855. b = a.length,
  856. c = this.pi;
  857. if (null !== c) {
  858. for (var d = 0; d < b;) {
  859. var e = a[d];
  860. if (c(e)) return this.key = this.Ic = d, this.value = e;
  861. d++
  862. }
  863. return null
  864. }
  865. return 0 < b ? (e = a[0], this.key = 0, this.value = e) : null
  866. };
  867. Qa.prototype.any = function(a) {
  868. var b = this.Jc;
  869. b.Zb = null;
  870. var c = b.I;
  871. this.Ic = -1;
  872. for (var d = b.o, e = d.length, g = this.pi, h = 0; h < e; h++) {
  873. var k = d[h];
  874. if (null === g || g(k)) {
  875. if (a(k)) return !0;
  876. b.I !== c && D.Va(b)
  877. }
  878. }
  879. return !1
  880. };
  881. Qa.prototype.all = function(a) {
  882. var b = this.Jc;
  883. b.Zb = null;
  884. var c = b.I;
  885. this.Ic = -1;
  886. for (var d = b.o, e = d.length, g = this.pi, h = 0; h < e; h++) {
  887. var k = d[h];
  888. if (null === g || g(k)) {
  889. if (!a(k)) return !1;
  890. b.I !== c && D.Va(b)
  891. }
  892. }
  893. return !0
  894. };
  895. Qa.prototype.each = function(a) {
  896. var b = this.Jc;
  897. b.Zb = null;
  898. var c = b.I;
  899. this.Ic = -1;
  900. for (var d = b.o, e = d.length, g = this.pi, h = 0; h < e; h++) { var k = d[h]; if (null === g || g(k)) a(k), b.I !== c && D.Va(b) }
  901. return this
  902. };
  903. Qa.prototype.map = function(a) {
  904. var b = this.Jc;
  905. b.Zb = null;
  906. var c = b.I;
  907. this.Ic = -1;
  908. for (var d = [], e = b.o, g = e.length, h = this.pi, k = 0; k < g; k++) { var l = e[k]; if (null === h || h(l)) d.push(a(l)), b.I !== c && D.Va(b) }
  909. a = new K;
  910. a.o = d;
  911. a.Uc();
  912. return a.j
  913. };
  914. Qa.prototype.filter = function(a) {
  915. var b = this.Jc;
  916. b.Zb = null;
  917. var c = b.I;
  918. this.Ic = -1;
  919. for (var d = [], e = b.o, g = e.length, h = this.pi, k = 0; k < g; k++) { var l = e[k]; if (null === h || h(l)) a(l) && d.push(l), b.I !== c && D.Va(b) }
  920. a = new K(b.da);
  921. a.o = d;
  922. a.Uc();
  923. return a.j
  924. };
  925. Qa.prototype.concat = function(a) { this.Jc.Zb = null; return new Na(this, a.j) };
  926. D.w(Qa, { count: "count" }, function() { var a = this.pi; if (null !== a) { for (var b = 0, c = this.Jc.o, d = c.length, e = 0; e < d; e++) a(c[e]) && b++; return b } return this.Jc.o.length });
  927. Qa.prototype.Vf = function() {
  928. this.key = -1;
  929. this.value = null;
  930. this.Za = -1;
  931. this.pi = null;
  932. this.Jc.Zb = this
  933. };
  934. Qa.prototype.toString = function() { return "ListIterator@" + this.Ic + "/" + this.Jc.count };
  935. function Ua(a) {
  936. this.Jc = a;
  937. a.fj = null;
  938. this.Za = a.I;
  939. this.Ic = a.o.length
  940. }
  941. D.me(Ua, { key: !0, value: !0 });
  942. D.w(Ua, { j: "iterator" }, function() { return this });
  943. Ua.prototype.reset = Ua.prototype.reset = function() {
  944. var a = this.Jc;
  945. a.fj = null;
  946. this.Za = a.I;
  947. this.Ic = a.o.length
  948. };
  949. Ua.prototype.next = Ua.prototype.next = function() {
  950. var a = this.Jc;
  951. if (a.I !== this.Za) {
  952. if (0 > this.key) return !1;
  953. D.Va(a)
  954. }
  955. var b = --this.Ic;
  956. if (0 <= b) return this.key = b, this.value = a.o[b], !0;
  957. this.Vf();
  958. return !1
  959. };
  960. Ua.prototype.hasNext = function() { return this.next() };
  961. Ua.prototype.first = Ua.prototype.first = function() {
  962. var a = this.Jc;
  963. this.Za = a.I;
  964. var b = a.o;
  965. this.Ic = a = b.length - 1;
  966. return 0 <= a ? (b = b[a], this.key = a, this.value = b) : null
  967. };
  968. Ua.prototype.any = function(a) {
  969. var b = this.Jc;
  970. b.fj = null;
  971. var c = b.I,
  972. d = b.o,
  973. e = d.length;
  974. this.Ic = e;
  975. for (e -= 1; 0 <= e; e--) {
  976. if (a(d[e])) return !0;
  977. b.I !== c && D.Va(b)
  978. }
  979. return !1
  980. };
  981. Ua.prototype.all = function(a) {
  982. var b = this.Jc;
  983. b.fj = null;
  984. var c = b.I,
  985. d = b.o,
  986. e = d.length;
  987. this.Ic = e;
  988. for (e -= 1; 0 <= e; e--) {
  989. if (!a(d[e])) return !1;
  990. b.I !== c && D.Va(b)
  991. }
  992. return !0
  993. };
  994. Ua.prototype.each = function(a) {
  995. var b = this.Jc;
  996. b.fj = null;
  997. var c = b.I,
  998. d = b.o,
  999. e = d.length;
  1000. this.Ic = e;
  1001. for (e -= 1; 0 <= e; e--) a(d[e]), b.I !== c && D.Va(b);
  1002. return this
  1003. };
  1004. Ua.prototype.map = function(a) {
  1005. var b = this.Jc;
  1006. b.fj = null;
  1007. var c = b.I,
  1008. d = [],
  1009. e = b.o,
  1010. g = e.length;
  1011. this.Ic = g;
  1012. for (g -= 1; 0 <= g; g--) d.push(a(e[g])), b.I !== c && D.Va(b);
  1013. a = new K;
  1014. a.o = d;
  1015. a.Uc();
  1016. return a.j
  1017. };
  1018. Ua.prototype.filter = function(a) {
  1019. var b = this.Jc;
  1020. b.fj = null;
  1021. var c = b.I,
  1022. d = [],
  1023. e = b.o,
  1024. g = e.length;
  1025. this.Ic = g;
  1026. for (g -= 1; 0 <= g; g--) {
  1027. var h = e[g];
  1028. a(h) && d.push(h);
  1029. b.I !== c && D.Va(b)
  1030. }
  1031. a = new K(b.da);
  1032. a.o = d;
  1033. a.Uc();
  1034. return a.j
  1035. };
  1036. Ua.prototype.concat = function(a) { this.Jc.fj = null; return new Na(this, a.j) };
  1037. D.w(Ua, { count: "count" }, function() { return this.Jc.o.length });
  1038. Ua.prototype.Vf = function() {
  1039. this.key = -1;
  1040. this.value = null;
  1041. this.Za = -1;
  1042. this.Jc.fj = this
  1043. };
  1044. Ua.prototype.toString = function() { return "ListIteratorBackwards(" + this.Ic + "/" + this.Jc.count + ")" };
  1045. function K(a) {
  1046. D.xc(this);
  1047. this.J = !1;
  1048. this.o = [];
  1049. this.I = 0;
  1050. this.fj = this.Zb = null;
  1051. void 0 === a || null === a ? this.da = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a || "boolean" === a || "function" === a ? this.da = a : D.ua(a, "the string 'object', 'number', 'string', 'boolean', or 'function'", "List constructor: type") : "function" === typeof a ? this.da = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a === Boolean ? "boolean" : a === Function ? "function" : a : D.ua(a, "null, a primitive type name, or a class type",
  1052. "List constructor: type")
  1053. }
  1054. D.ka("List", K);
  1055. K.prototype.nh = function(a) { null !== this.da && ("string" === typeof this.da ? typeof a === this.da && null !== a || D.kc(a, this.da) : a instanceof this.da || D.kc(a, this.da)) };
  1056. K.prototype.Uc = function() {
  1057. var a = this.I;
  1058. a++;
  1059. 999999999 < a && (a = 0);
  1060. this.I = a
  1061. };
  1062. K.prototype.freeze = K.prototype.freeze = function() { this.J = !0; return this };
  1063. K.prototype.thaw = K.prototype.Xa = function() { this.J = !1; return this };
  1064. K.prototype.toString = function() { return "List(" + D.getTypeName(this.da) + ")#" + D.Nd(this) };
  1065. K.prototype.add = K.prototype.add = function(a) { null !== a && (v && this.nh(a), this.J && D.qa(this, a), this.o.push(a), this.Uc()) };
  1066. K.prototype.push = K.prototype.push = function(a) { this.add(a) };
  1067. K.prototype.addAll = K.prototype.Vc = function(a) {
  1068. if (null === a) return this;
  1069. this.J && D.qa(this);
  1070. var b = this.o;
  1071. if (D.isArray(a))
  1072. for (var c = D.cb(a), d = 0; d < c; d++) {
  1073. var e = D.La(a, d);
  1074. v && this.nh(e);
  1075. b.push(e)
  1076. } else
  1077. for (a = a.j; a.next();) e = a.value, v && this.nh(e), b.push(e);
  1078. this.Uc();
  1079. return this
  1080. };
  1081. K.prototype.clear = K.prototype.clear = function() {
  1082. this.J && D.qa(this);
  1083. this.o.length = 0;
  1084. this.Uc()
  1085. };
  1086. K.prototype.contains = K.prototype.contains = function(a) {
  1087. if (null === a) return !1;
  1088. v && this.nh(a);
  1089. return -1 !== this.o.indexOf(a)
  1090. };
  1091. K.prototype.has = K.prototype.has = function(a) { return this.contains(a) };
  1092. K.prototype.indexOf = K.prototype.indexOf = function(a) {
  1093. if (null === a) return -1;
  1094. v && this.nh(a);
  1095. return this.o.indexOf(a)
  1096. };
  1097. K.prototype.elt = K.prototype.fa = function(a) {
  1098. v && D.p(a, K, "elt:i");
  1099. var b = this.o;
  1100. (0 > a || a >= b.length) && D.ua(a, "0 <= i < length", K, "elt:i");
  1101. return b[a]
  1102. };
  1103. K.prototype.get = K.prototype.get = function(a) { return this.fa(a) };
  1104. K.prototype.setElt = K.prototype.ug = function(a, b) {
  1105. v && (this.nh(b), D.p(a, K, "setElt:i"));
  1106. var c = this.o;
  1107. (0 > a || a >= c.length) && D.ua(a, "0 <= i < length", K, "setElt:i");
  1108. this.J && D.qa(this, a);
  1109. c[a] = b
  1110. };
  1111. K.prototype.set = K.prototype.set = function(a, b) { this.ug(a, b) };
  1112. K.prototype.first = K.prototype.first = function() { var a = this.o; return 0 === a.length ? null : a[0] };
  1113. K.prototype.last = K.prototype.re = function() {
  1114. var a = this.o,
  1115. b = a.length;
  1116. return 0 < b ? a[b - 1] : null
  1117. };
  1118. K.prototype.pop = K.prototype.pop = function() { this.J && D.qa(this); var a = this.o; return 0 < a.length ? a.pop() : null };
  1119. K.prototype.any = function(a) {
  1120. for (var b = this.o, c = this.I, d = b.length, e = 0; e < d; e++) {
  1121. if (a(b[e])) return !0;
  1122. this.I !== c && D.Va(this)
  1123. }
  1124. return !1
  1125. };
  1126. K.prototype.all = function(a) {
  1127. for (var b = this.o, c = this.I, d = b.length, e = 0; e < d; e++) {
  1128. if (!a(b[e])) return !1;
  1129. this.I !== c && D.Va(this)
  1130. }
  1131. return !0
  1132. };
  1133. K.prototype.each = function(a) { for (var b = this.o, c = this.I, d = b.length, e = 0; e < d; e++) a(b[e]), this.I !== c && D.Va(this); return this };
  1134. K.prototype.map = function(a) {
  1135. for (var b = new K, c = [], d = this.o, e = this.I, g = d.length, h = 0; h < g; h++) c.push(a(d[h])), this.I !== e && D.Va(this);
  1136. b.o = c;
  1137. b.Uc();
  1138. return b
  1139. };
  1140. K.prototype.filter = function(a) {
  1141. for (var b = new K(this.da), c = [], d = this.o, e = this.I, g = d.length, h = 0; h < g; h++) {
  1142. var k = d[h];
  1143. a(k) && c.push(k);
  1144. this.I !== e && D.Va(this)
  1145. }
  1146. b.o = c;
  1147. b.Uc();
  1148. return b
  1149. };
  1150. K.prototype.concat = function(a) { return this.copy().Vc(a) };
  1151. K.prototype.insertAt = K.prototype.be = function(a, b) {
  1152. v && (this.nh(b), D.p(a, K, "insertAt:i"));
  1153. 0 > a && D.ua(a, ">= 0", K, "insertAt:i");
  1154. this.J && D.qa(this, a);
  1155. var c = this.o;
  1156. a >= c.length ? c.push(b) : c.splice(a, 0, b);
  1157. this.Uc();
  1158. return !0
  1159. };
  1160. K.prototype.remove = K.prototype["delete"] = K.prototype.remove = function(a) {
  1161. if (null === a) return !1;
  1162. v && this.nh(a);
  1163. this.J && D.qa(this, a);
  1164. var b = this.o;
  1165. a = b.indexOf(a);
  1166. if (-1 === a) return !1;
  1167. a === b.length - 1 ? b.pop() : b.splice(a, 1);
  1168. this.Uc();
  1169. return !0
  1170. };
  1171. K.prototype.removeAt = K.prototype.pd = function(a) {
  1172. v && D.p(a, K, "removeAt:i");
  1173. var b = this.o;
  1174. (0 > a || a >= b.length) && D.ua(a, "0 <= i < length", K, "removeAt:i");
  1175. this.J && D.qa(this, a);
  1176. a === b.length - 1 ? b.pop() : b.splice(a, 1);
  1177. this.Uc()
  1178. };
  1179. K.prototype.removeRange = K.prototype.removeRange = function(a, b) {
  1180. v && (D.p(a, K, "removeRange:from"), D.p(b, K, "removeRange:to"));
  1181. var c = this.o,
  1182. d = c.length;
  1183. if (0 > a) a = 0;
  1184. else if (a >= d) return this;
  1185. if (0 > b) return this;
  1186. b >= d && (b = d - 1);
  1187. if (a > b) return this;
  1188. this.J && D.qa(this);
  1189. for (var e = a, g = b + 1; g < d;) c[e++] = c[g++];
  1190. c.length = d - (b - a + 1);
  1191. this.Uc();
  1192. return this
  1193. };
  1194. K.prototype.copy = function() {
  1195. var a = new K(this.da),
  1196. b = this.o;
  1197. 0 < b.length && (a.o = Array.prototype.slice.call(b));
  1198. return a
  1199. };
  1200. K.prototype.toArray = K.prototype.Fc = function() { for (var a = this.o, b = this.count, c = Array(b), d = 0; d < b; d++) c[d] = a[d]; return c };
  1201. K.prototype.toSet = K.prototype.pH = function() { for (var a = new L(this.da), b = this.o, c = this.count, d = 0; d < c; d++) a.add(b[d]); return a };
  1202. K.prototype.sort = K.prototype.sort = function(a) {
  1203. v && D.h(a, "function", K, "sort:sortfunc");
  1204. this.J && D.qa(this);
  1205. this.o.sort(a);
  1206. this.Uc();
  1207. return this
  1208. };
  1209. K.prototype.sortRange = K.prototype.Zq = function(a, b, c) {
  1210. var d = this.o,
  1211. e = d.length;
  1212. void 0 === b && (b = 0);
  1213. void 0 === c && (c = e);
  1214. v && (D.h(a, "function", K, "sortRange:sortfunc"), D.p(b, K, "sortRange:from"), D.p(c, K, "sortRange:to"));
  1215. this.J && D.qa(this);
  1216. var g = c - b;
  1217. if (1 >= g) return this;
  1218. (0 > b || b >= e - 1) && D.ua(b, "0 <= from < length", K, "sortRange:from");
  1219. if (2 === g) return c = d[b], e = d[b + 1], 0 < a(c, e) && (d[b] = e, d[b + 1] = c, this.Uc()), this;
  1220. if (0 === b)
  1221. if (c >= e) d.sort(a);
  1222. else
  1223. for (g = d.slice(0, c), g.sort(a), a = 0; a < c; a++) d[a] = g[a];
  1224. else if (c >= e)
  1225. for (g = d.slice(b),
  1226. g.sort(a), a = b; a < e; a++) d[a] = g[a - b];
  1227. else
  1228. for (g = d.slice(b, c), g.sort(a), a = b; a < c; a++) d[a] = g[a - b];
  1229. this.Uc();
  1230. return this
  1231. };
  1232. K.prototype.reverse = K.prototype.reverse = function() {
  1233. this.J && D.qa(this);
  1234. this.o.reverse();
  1235. this.Uc();
  1236. return this
  1237. };
  1238. D.w(K, { count: "count" }, function() { return this.o.length });
  1239. D.w(K, { size: "size" }, function() { return this.o.length });
  1240. D.w(K, { length: "length" }, function() { return this.o.length });
  1241. D.w(K, { j: "iterator" }, function() { if (0 >= this.o.length) return Ka; var a = this.Zb; return null !== a ? (a.reset(), a) : new Qa(this) });
  1242. D.w(K, { $n: "iteratorBackwards" }, function() { if (0 >= this.o.length) return Ka; var a = this.fj; return null !== a ? (a.reset(), a) : new Ua(this) });
  1243. function Va(a) {
  1244. this.ri = a;
  1245. a.Zb = null;
  1246. this.Za = a.I;
  1247. this.bb = null
  1248. }
  1249. D.me(Va, { key: !0, value: !0 });
  1250. D.w(Va, { j: "iterator" }, function() { return this });
  1251. Va.prototype.reset = Va.prototype.reset = function() {
  1252. var a = this.ri;
  1253. a.Zb = null;
  1254. this.Za = a.I;
  1255. this.bb = null
  1256. };
  1257. Va.prototype.next = Va.prototype.next = function() {
  1258. var a = this.ri;
  1259. if (a.I !== this.Za) {
  1260. if (null === this.key) return !1;
  1261. D.Va(a)
  1262. }
  1263. var b = this.bb,
  1264. b = null === b ? a.Ma : b.gb;
  1265. if (null !== b) return this.bb = b, this.value = b.value, this.key = b.key, !0;
  1266. this.Vf();
  1267. return !1
  1268. };
  1269. Va.prototype.hasNext = function() { return this.next() };
  1270. Va.prototype.first = Va.prototype.first = function() {
  1271. var a = this.ri;
  1272. this.Za = a.I;
  1273. a = a.Ma;
  1274. if (null !== a) {
  1275. this.bb = a;
  1276. var b = a.value;
  1277. this.key = a.key;
  1278. return this.value = b
  1279. }
  1280. return null
  1281. };
  1282. Va.prototype.any = function(a) {
  1283. var b = this.ri;
  1284. b.Zb = null;
  1285. var c = b.I;
  1286. this.bb = null;
  1287. for (var d = b.Ma; null !== d;) {
  1288. if (a(d.value)) return !0;
  1289. b.I !== c && D.Va(b);
  1290. d = d.gb
  1291. }
  1292. return !1
  1293. };
  1294. Va.prototype.all = function(a) {
  1295. var b = this.ri;
  1296. b.Zb = null;
  1297. var c = b.I;
  1298. this.bb = null;
  1299. for (var d = b.Ma; null !== d;) {
  1300. if (!a(d.value)) return !1;
  1301. b.I !== c && D.Va(b);
  1302. d = d.gb
  1303. }
  1304. return !0
  1305. };
  1306. Va.prototype.each = function(a) {
  1307. var b = this.ri;
  1308. b.Zb = null;
  1309. var c = b.I;
  1310. this.bb = null;
  1311. for (var d = b.Ma; null !== d;) a(d.value), b.I !== c && D.Va(b), d = d.gb;
  1312. return this
  1313. };
  1314. Va.prototype.map = function(a) {
  1315. var b = this.ri;
  1316. b.Zb = null;
  1317. for (var c = new K, d = b.I, e = b.Ma; null !== e;) c.add(a(e.value)), b.I !== d && D.Va(b), e = e.gb;
  1318. return c.j
  1319. };
  1320. Va.prototype.filter = function(a) {
  1321. var b = this.ri;
  1322. b.Zb = null;
  1323. for (var c = new K(b.da), d = b.I, e = b.Ma; null !== e;) {
  1324. var g = e.value;
  1325. a(g) && c.add(g);
  1326. b.I !== d && D.Va(b);
  1327. e = e.gb
  1328. }
  1329. return c.j
  1330. };
  1331. Va.prototype.concat = function(a) { this.ri.Zb = null; return new Na(this, a.j) };
  1332. D.w(Va, { count: "count" }, function() { return this.ri.Cd });
  1333. Va.prototype.Vf = function() {
  1334. this.value = this.key = null;
  1335. this.Za = -1;
  1336. this.ri.Zb = this
  1337. };
  1338. Va.prototype.toString = function() { return null !== this.bb ? "SetIterator@" + this.bb.value : "SetIterator" };
  1339. function L(a) {
  1340. D.xc(this);
  1341. this.J = !1;
  1342. void 0 === a || null === a ? this.da = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.da = a : D.ua(a, "the string 'object', 'number' or 'string'", "Set constructor: type") : "function" === typeof a ? this.da = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : D.ua(a, "null, a primitive type name, or a class type", "Set constructor: type");
  1343. this.Dd = {};
  1344. this.Cd = 0;
  1345. this.Zb = null;
  1346. this.I = 0;
  1347. this.ii = this.Ma = null
  1348. }
  1349. D.ka("Set", L);
  1350. L.prototype.nh = function(a) { null !== this.da && ("string" === typeof this.da ? typeof a === this.da && null !== a || D.kc(a, this.da) : a instanceof this.da || D.kc(a, this.da)) };
  1351. L.prototype.Uc = function() {
  1352. var a = this.I;
  1353. a++;
  1354. 999999999 < a && (a = 0);
  1355. this.I = a
  1356. };
  1357. L.prototype.freeze = L.prototype.freeze = function() { this.J = !0; return this };
  1358. L.prototype.thaw = L.prototype.Xa = function() { this.J = !1; return this };
  1359. L.prototype.toString = function() { return "Set(" + D.getTypeName(this.da) + ")#" + D.Nd(this) };
  1360. L.prototype.add = L.prototype.add = function(a) {
  1361. if (null === a) return !1;
  1362. v && this.nh(a);
  1363. this.J && D.qa(this, a);
  1364. var b = a;
  1365. D.Qa(a) && (b = D.sq(a));
  1366. return void 0 === this.Dd[b] ? (this.Cd++, a = new Wa(a, a), this.Dd[b] = a, b = this.ii, null === b ? this.Ma = a : (a.Ep = b, b.gb = a), this.ii = a, this.Uc(), !0) : !1
  1367. };
  1368. L.prototype.addAll = L.prototype.Vc = function(a) {
  1369. if (null === a) return this;
  1370. this.J && D.qa(this);
  1371. if (D.isArray(a))
  1372. for (var b = D.cb(a), c = 0; c < b; c++) this.add(D.La(a, c));
  1373. else
  1374. for (a = a.j; a.next();) this.add(a.value);
  1375. return this
  1376. };
  1377. L.prototype.contains = L.prototype.contains = function(a) {
  1378. if (null === a) return !1;
  1379. v && this.nh(a);
  1380. var b = a;
  1381. return D.Qa(a) && (b = D.Nd(a), void 0 === b) ? !1 : void 0 !== this.Dd[b]
  1382. };
  1383. L.prototype.has = L.prototype.has = function(a) { return this.contains(a) };
  1384. L.prototype.containsAll = function(a) {
  1385. if (null === a) return !0;
  1386. for (a = a.j; a.next();)
  1387. if (!this.contains(a.value)) return !1;
  1388. return !0
  1389. };
  1390. L.prototype.containsAny = function(a) {
  1391. if (null === a) return !0;
  1392. for (a = a.j; a.next();)
  1393. if (this.contains(a.value)) return !0;
  1394. return !1
  1395. };
  1396. L.prototype.first = L.prototype.first = function() { var a = this.Ma; return null === a ? null : a.value };
  1397. L.prototype.any = function(a) {
  1398. for (var b = this.I, c = this.Ma; null !== c;) {
  1399. if (a(c.value)) return !0;
  1400. this.I !== b && D.Va(this);
  1401. c = c.gb
  1402. }
  1403. return !1
  1404. };
  1405. L.prototype.all = function(a) {
  1406. for (var b = this.I, c = this.Ma; null !== c;) {
  1407. if (!a(c.value)) return !1;
  1408. this.I !== b && D.Va(this);
  1409. c = c.gb
  1410. }
  1411. return !0
  1412. };
  1413. L.prototype.each = function(a) { for (var b = this.I, c = this.Ma; null !== c;) a(c.value), this.I !== b && D.Va(this), c = c.gb; return this };
  1414. L.prototype.map = function(a) { for (var b = new L, c = this.I, d = this.Ma; null !== d;) b.add(a(d.value)), this.I !== c && D.Va(this), d = d.gb; return b };
  1415. L.prototype.filter = function(a) {
  1416. for (var b = new L(this.da), c = this.I, d = this.Ma; null !== d;) {
  1417. var e = d.value;
  1418. a(e) && b.add(e);
  1419. this.I !== c && D.Va(this);
  1420. d = d.gb
  1421. }
  1422. return b
  1423. };
  1424. L.prototype.concat = function(a) { return this.copy().Vc(a) };
  1425. L.prototype.remove = L.prototype["delete"] = L.prototype.remove = function(a) {
  1426. if (null === a) return !1;
  1427. v && this.nh(a);
  1428. this.J && D.qa(this, a);
  1429. var b = a;
  1430. if (D.Qa(a) && (b = D.Nd(a), void 0 === b)) return !1;
  1431. a = this.Dd[b];
  1432. if (void 0 === a) return !1;
  1433. var c = a.gb,
  1434. d = a.Ep;
  1435. null !== c && (c.Ep = d);
  1436. null !== d && (d.gb = c);
  1437. this.Ma === a && (this.Ma = c);
  1438. this.ii === a && (this.ii = d);
  1439. delete this.Dd[b];
  1440. this.Cd--;
  1441. this.Uc();
  1442. return !0
  1443. };
  1444. L.prototype.removeAll = L.prototype.Iy = function(a) {
  1445. if (null === a) return this;
  1446. this.J && D.qa(this);
  1447. if (D.isArray(a))
  1448. for (var b = D.cb(a), c = 0; c < b; c++) this.remove(D.La(a, c));
  1449. else
  1450. for (a = a.j; a.next();) this.remove(a.value);
  1451. return this
  1452. };
  1453. L.prototype.retainAll = function(a) {
  1454. if (null === a || 0 === this.count) return this;
  1455. this.J && D.qa(this);
  1456. var b = new L(this.da);
  1457. b.Vc(a);
  1458. a = [];
  1459. for (var c = this.j; c.next();) {
  1460. var d = c.value;
  1461. b.contains(d) || a.push(d)
  1462. }
  1463. this.Iy(a);
  1464. return this
  1465. };
  1466. L.prototype.clear = L.prototype.clear = function() {
  1467. this.J && D.qa(this);
  1468. this.Dd = {};
  1469. this.Cd = 0;
  1470. this.ii = this.Ma = null;
  1471. this.Uc()
  1472. };
  1473. L.prototype.copy = function() {
  1474. var a = new L(this.da),
  1475. b = this.Dd,
  1476. c;
  1477. for (c in b) a.add(b[c].value);
  1478. return a
  1479. };
  1480. L.prototype.toArray = L.prototype.Fc = function() {
  1481. var a = Array(this.Cd),
  1482. b = this.Dd,
  1483. c = 0,
  1484. d;
  1485. for (d in b) a[c] = b[d].value, c++;
  1486. return a
  1487. };
  1488. L.prototype.toList = function() {
  1489. var a = new K(this.da),
  1490. b = this.Dd,
  1491. c;
  1492. for (c in b) a.add(b[c].value);
  1493. return a
  1494. };
  1495. D.w(L, { count: "count" }, function() { return this.Cd });
  1496. D.w(L, { size: "size" }, function() { return this.Cd });
  1497. D.w(L, { j: "iterator" }, function() { if (0 >= this.Cd) return Ka; var a = this.Zb; return null !== a ? (a.reset(), a) : new Va(this) });
  1498. function Xa(a) {
  1499. this.Na = a;
  1500. this.Za = a.I;
  1501. this.bb = null
  1502. }
  1503. D.me(Xa, { key: !0, value: !0 });
  1504. D.w(Xa, { j: "iterator" }, function() { return this });
  1505. Xa.prototype.reset = Xa.prototype.reset = function() {
  1506. this.Za = this.Na.I;
  1507. this.bb = null
  1508. };
  1509. Xa.prototype.next = Xa.prototype.next = function() {
  1510. var a = this.Na;
  1511. if (a.I !== this.Za) {
  1512. if (null === this.key) return !1;
  1513. D.Va(a)
  1514. }
  1515. var b = this.bb,
  1516. b = null === b ? a.Ma : b.gb;
  1517. if (null !== b) return this.bb = b, this.value = this.key = a = b.key, !0;
  1518. this.Vf();
  1519. return !1
  1520. };
  1521. Xa.prototype.hasNext = function() { return this.next() };
  1522. Xa.prototype.first = Xa.prototype.first = function() {
  1523. var a = this.Na;
  1524. this.Za = a.I;
  1525. a = a.Ma;
  1526. return null !== a ? (this.bb = a, this.value = this.key = a = a.key) : null
  1527. };
  1528. Xa.prototype.any = function(a) {
  1529. var b = this.Na,
  1530. c = b.I;
  1531. this.bb = null;
  1532. for (var d = b.Ma; null !== d;) {
  1533. if (a(d.key)) return !0;
  1534. b.I !== c && D.Va(b);
  1535. d = d.gb
  1536. }
  1537. return !1
  1538. };
  1539. Xa.prototype.all = function(a) {
  1540. var b = this.Na,
  1541. c = b.I;
  1542. this.bb = null;
  1543. for (var d = b.Ma; null !== d;) {
  1544. if (!a(d.key)) return !1;
  1545. b.I !== c && D.Va(b);
  1546. d = d.gb
  1547. }
  1548. return !0
  1549. };
  1550. Xa.prototype.each = function(a) {
  1551. var b = this.Na,
  1552. c = b.I;
  1553. this.bb = null;
  1554. for (var d = b.Ma; null !== d;) a(d.key), b.I !== c && D.Va(b), d = d.gb;
  1555. return this
  1556. };
  1557. Xa.prototype.map = function(a) {
  1558. var b = this.Na,
  1559. c = b.I;
  1560. this.bb = null;
  1561. for (var d = new K, e = b.Ma; null !== e;) d.add(a(e.key)), b.I !== c && D.Va(b), e = e.gb;
  1562. return d.j
  1563. };
  1564. Xa.prototype.filter = function(a) {
  1565. var b = this.Na,
  1566. c = b.I;
  1567. this.bb = null;
  1568. for (var d = new K(b.cf), e = b.Ma; null !== e;) {
  1569. var g = e.key;
  1570. a(g) && d.add(g);
  1571. b.I !== c && D.Va(b);
  1572. e = e.gb
  1573. }
  1574. return d.j
  1575. };
  1576. Xa.prototype.concat = function(a) { return new Na(this, a.j) };
  1577. D.w(Xa, { count: "count" }, function() { return this.Na.Cd });
  1578. Xa.prototype.Vf = function() {
  1579. this.value = this.key = null;
  1580. this.Za = -1
  1581. };
  1582. Xa.prototype.toString = function() { return null !== this.bb ? "MapKeySetIterator@" + this.bb.value : "MapKeySetIterator" };
  1583. function Ya(a) {
  1584. D.xc(this);
  1585. this.J = !0;
  1586. this.Na = a
  1587. }
  1588. D.Ta(Ya, L);
  1589. Ya.prototype.freeze = function() { return this };
  1590. Ya.prototype.Xa = function() { return this };
  1591. Ya.prototype.toString = function() { return "MapKeySet(" + this.Na.toString() + ")" };
  1592. Ya.prototype.add = Ya.prototype.add = function() { D.k("This Set is read-only: " + this.toString()); return !1 };
  1593. Ya.prototype.set = Ya.prototype.set = function() { D.k("This Set is read-only: " + this.toString()); return !1 };
  1594. Ya.prototype.contains = Ya.prototype.contains = function(a) { return this.Na.contains(a) };
  1595. Ya.prototype.has = Ya.prototype.has = function(a) { return this.contains(a) };
  1596. Ya.prototype.remove = Ya.prototype["delete"] = Ya.prototype.remove = function() { D.k("This Set is read-only: " + this.toString()); return !1 };
  1597. Ya.prototype.clear = Ya.prototype.clear = function() { D.k("This Set is read-only: " + this.toString()) };
  1598. Ya.prototype.first = Ya.prototype.first = function() { var a = this.Na.Ma; return null !== a ? a.key : null };
  1599. Ya.prototype.any = function(a) {
  1600. for (var b = this.Na.Ma; null !== b;) {
  1601. if (a(b.key)) return !0;
  1602. b = b.gb
  1603. }
  1604. return !1
  1605. };
  1606. Ya.prototype.all = function(a) {
  1607. for (var b = this.Na.Ma; null !== b;) {
  1608. if (!a(b.key)) return !1;
  1609. b = b.gb
  1610. }
  1611. return !0
  1612. };
  1613. Ya.prototype.each = function(a) { for (var b = this.Na.Ma; null !== b;) a(b.key), b = b.gb; return this };
  1614. Ya.prototype.map = function(a) { for (var b = new L, c = this.Na.Ma; null !== c;) b.add(a(c.key)), c = c.gb; return b };
  1615. Ya.prototype.filter = function(a) {
  1616. for (var b = new L(this.Na.cf), c = this.Na.Ma; null !== c;) {
  1617. var d = c.key;
  1618. a(d) && b.add(d);
  1619. c = c.gb
  1620. }
  1621. return b
  1622. };
  1623. Ya.prototype.concat = function(a) { return this.pH().Vc(a) };
  1624. Ya.prototype.copy = function() { return new Ya(this.Na) };
  1625. Ya.prototype.toSet = Ya.prototype.pH = function() {
  1626. var a = new L(this.Na.cf),
  1627. b = this.Na.Dd,
  1628. c;
  1629. for (c in b) a.add(b[c].key);
  1630. return a
  1631. };
  1632. Ya.prototype.toArray = Ya.prototype.Fc = function() {
  1633. var a = this.Na.Dd,
  1634. b = Array(this.Na.Cd),
  1635. c = 0,
  1636. d;
  1637. for (d in a) b[c] = a[d].key, c++;
  1638. return b
  1639. };
  1640. Ya.prototype.toList = function() {
  1641. var a = new K(this.Na.cf),
  1642. b = this.Na.Dd,
  1643. c;
  1644. for (c in b) a.add(b[c].key);
  1645. return a
  1646. };
  1647. D.w(Ya, { count: "count" }, function() { return this.Na.Cd });
  1648. D.w(Ya, { size: "size" }, function() { return this.Na.Cd });
  1649. D.w(Ya, { j: "iterator" }, function() { return 0 >= this.Na.Cd ? Ka : new Xa(this.Na) });
  1650. function Za(a) {
  1651. this.Na = a;
  1652. a.gj = null;
  1653. this.Za = a.I;
  1654. this.bb = null
  1655. }
  1656. D.me(Za, { key: !0, value: !0 });
  1657. D.w(Za, { j: "iterator" }, function() { return this });
  1658. Za.prototype.reset = Za.prototype.reset = function() {
  1659. var a = this.Na;
  1660. a.gj = null;
  1661. this.Za = a.I;
  1662. this.bb = null
  1663. };
  1664. Za.prototype.next = Za.prototype.next = function() {
  1665. var a = this.Na;
  1666. if (a.I !== this.Za) {
  1667. if (null === this.key) return !1;
  1668. D.Va(a)
  1669. }
  1670. var b = this.bb,
  1671. b = null === b ? a.Ma : b.gb;
  1672. if (null !== b) return this.bb = b, this.value = b.value, this.key = b.key, !0;
  1673. this.Vf();
  1674. return !1
  1675. };
  1676. Za.prototype.hasNext = function() { return this.next() };
  1677. Za.prototype.first = Za.prototype.first = function() {
  1678. var a = this.Na;
  1679. this.Za = a.I;
  1680. a = a.Ma;
  1681. if (null !== a) {
  1682. this.bb = a;
  1683. var b = a.value;
  1684. this.key = a.key;
  1685. return this.value = b
  1686. }
  1687. return null
  1688. };
  1689. Za.prototype.any = function(a) {
  1690. var b = this.Na;
  1691. b.gj = null;
  1692. var c = b.I;
  1693. this.bb = null;
  1694. for (var d = b.Ma; null !== d;) {
  1695. if (a(d.value)) return !0;
  1696. b.I !== c && D.Va(b);
  1697. d = d.gb
  1698. }
  1699. return !1
  1700. };
  1701. Za.prototype.all = function(a) {
  1702. var b = this.Na;
  1703. b.gj = null;
  1704. var c = b.I;
  1705. this.bb = null;
  1706. for (var d = b.Ma; null !== d;) {
  1707. if (!a(d.value)) return !1;
  1708. b.I !== c && D.Va(b);
  1709. d = d.gb
  1710. }
  1711. return !0
  1712. };
  1713. Za.prototype.each = function(a) {
  1714. var b = this.Na;
  1715. b.gj = null;
  1716. var c = b.I;
  1717. this.bb = null;
  1718. for (var d = b.Ma; null !== d;) a(d.value), b.I !== c && D.Va(b), d = d.gb;
  1719. return this
  1720. };
  1721. Za.prototype.map = function(a) {
  1722. var b = this.Na;
  1723. b.gj = null;
  1724. var c = b.I;
  1725. this.bb = null;
  1726. for (var d = new K, e = b.Ma; null !== e;) d.add(a(e.value)), b.I !== c && D.Va(b), e = e.gb;
  1727. return d.j
  1728. };
  1729. Za.prototype.filter = function(a) {
  1730. var b = this.Na;
  1731. b.gj = null;
  1732. var c = b.I;
  1733. this.bb = null;
  1734. for (var d = new K(b.cf), e = b.Ma; null !== e;) {
  1735. var g = e.value;
  1736. a(g) && d.add(g);
  1737. b.I !== c && D.Va(b);
  1738. e = e.gb
  1739. }
  1740. return d.j
  1741. };
  1742. Za.prototype.concat = function(a) { this.Na.gj = null; return new Na(this, a.j) };
  1743. D.w(Za, { count: "count" }, function() { return this.Na.Cd });
  1744. Za.prototype.Vf = function() {
  1745. this.value = this.key = null;
  1746. this.Za = -1;
  1747. this.Na.gj = this
  1748. };
  1749. Za.prototype.toString = function() { return null !== this.bb ? "MapValueSetIterator@" + this.bb.value : "MapValueSetIterator" };
  1750. function Wa(a, b) {
  1751. this.key = a;
  1752. this.value = b;
  1753. this.Ep = this.gb = null
  1754. }
  1755. D.me(Wa, { key: !0, value: !0 });
  1756. Wa.prototype.toString = function() { return "{" + this.key + ":" + this.value + "}" };
  1757. function $a(a) {
  1758. this.Na = a;
  1759. a.Zb = null;
  1760. this.Za = a.I;
  1761. this.bb = null
  1762. }
  1763. D.me($a, { key: !0, value: !0 });
  1764. D.w($a, { j: "iterator" }, function() { return this });
  1765. $a.prototype.reset = $a.prototype.reset = function() {
  1766. var a = this.Na;
  1767. a.Zb = null;
  1768. this.Za = a.I;
  1769. this.bb = null
  1770. };
  1771. $a.prototype.next = $a.prototype.next = function() {
  1772. var a = this.Na;
  1773. if (a.I !== this.Za) {
  1774. if (null === this.key) return !1;
  1775. D.Va(a)
  1776. }
  1777. var b = this.bb,
  1778. b = null === b ? a.Ma : b.gb;
  1779. if (null !== b) return this.bb = b, this.key = b.key, this.value = b.value, !0;
  1780. this.Vf();
  1781. return !1
  1782. };
  1783. $a.prototype.hasNext = function() { return this.next() };
  1784. $a.prototype.first = $a.prototype.first = function() {
  1785. var a = this.Na;
  1786. this.Za = a.I;
  1787. a = a.Ma;
  1788. return null !== a ? (this.bb = a, this.key = a.key, this.value = a.value, a) : null
  1789. };
  1790. $a.prototype.any = function(a) {
  1791. var b = this.Na;
  1792. b.Zb = null;
  1793. var c = b.I;
  1794. this.bb = null;
  1795. for (var d = b.Ma; null !== d;) {
  1796. if (a(d)) return !0;
  1797. b.I !== c && D.Va(b);
  1798. d = d.gb
  1799. }
  1800. return !1
  1801. };
  1802. $a.prototype.all = function(a) {
  1803. var b = this.Na;
  1804. b.Zb = null;
  1805. var c = b.I;
  1806. this.bb = null;
  1807. for (var d = b.Ma; null !== d;) {
  1808. if (!a(d)) return !1;
  1809. b.I !== c && D.Va(b);
  1810. d = d.gb
  1811. }
  1812. return !0
  1813. };
  1814. $a.prototype.each = function(a) {
  1815. var b = this.Na;
  1816. b.Zb = null;
  1817. var c = b.I;
  1818. this.bb = null;
  1819. for (var d = b.Ma; null !== d;) a(d), b.I !== c && D.Va(b), d = d.gb;
  1820. return this
  1821. };
  1822. $a.prototype.map = function(a) {
  1823. var b = this.Na;
  1824. b.Zb = null;
  1825. var c = b.I;
  1826. this.bb = null;
  1827. for (var d = new K, e = b.Ma; null !== e;) d.add(a(e)), b.I !== c && D.Va(b), e = e.gb;
  1828. return d.j
  1829. };
  1830. $a.prototype.filter = function(a) {
  1831. var b = this.Na;
  1832. b.Zb = null;
  1833. var c = b.I;
  1834. this.bb = null;
  1835. for (var d = new K, e = b.Ma; null !== e;) a(e) && d.add(e), b.I !== c && D.Va(b), e = e.gb;
  1836. return d.j
  1837. };
  1838. $a.prototype.concat = function(a) { this.Na.Zb = null; return new Na(this, a.j) };
  1839. D.w($a, { count: "count" }, function() { return this.Na.Cd });
  1840. $a.prototype.Vf = function() {
  1841. this.value = this.key = null;
  1842. this.Za = -1;
  1843. this.Na.Zb = this
  1844. };
  1845. $a.prototype.toString = function() { return null !== this.bb ? "MapIterator@" + this.bb : "MapIterator" };
  1846. function oa(a, b) {
  1847. D.xc(this);
  1848. this.J = !1;
  1849. void 0 === a || null === a ? this.cf = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.cf = a : D.ua(a, "the string 'object', 'number' or 'string'", "Map constructor: keytype") : "function" === typeof a ? this.cf = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : D.ua(a, "null, a primitive type name, or a class type", "Map constructor: keytype");
  1850. void 0 === b || null === b ? this.Bi = null : "string" === typeof b ? "object" === b || "string" === b || "boolean" === b || "number" ===
  1851. b || "function" === b ? this.Bi = b : D.ua(b, "the string 'object', 'number', 'string', 'boolean', or 'function'", "Map constructor: valtype") : "function" === typeof b ? this.Bi = b === Object ? "object" : b === String ? "string" : b === Number ? "number" : b === Boolean ? "boolean" : b === Function ? "function" : b : D.ua(b, "null, a primitive type name, or a class type", "Map constructor: valtype");
  1852. this.Dd = {};
  1853. this.Cd = 0;
  1854. this.gj = this.Zb = null;
  1855. this.I = 0;
  1856. this.ii = this.Ma = null
  1857. }
  1858. D.ka("Map", oa);
  1859. function bb(a, b) { null !== a.cf && ("string" === typeof a.cf ? typeof b === a.cf && null !== b || D.kc(b, a.cf) : b instanceof a.cf || D.kc(b, a.cf)) }
  1860. oa.prototype.Uc = function() {
  1861. var a = this.I;
  1862. a++;
  1863. 999999999 < a && (a = 0);
  1864. this.I = a
  1865. };
  1866. oa.prototype.freeze = oa.prototype.freeze = function() { this.J = !0; return this };
  1867. oa.prototype.thaw = oa.prototype.Xa = function() { this.J = !1; return this };
  1868. oa.prototype.toString = function() { return "Map(" + D.getTypeName(this.cf) + "," + D.getTypeName(this.Bi) + ")#" + D.Nd(this) };
  1869. oa.prototype.add = oa.prototype.add = function(a, b) {
  1870. v && (bb(this, a), null !== this.Bi && ("string" === typeof this.Bi ? typeof b === this.Bi && null !== b || D.kc(b, this.Bi) : b instanceof this.Bi || D.kc(b, this.Bi)));
  1871. this.J && D.qa(this, a);
  1872. var c = a;
  1873. D.Qa(a) && (c = D.sq(a));
  1874. var d = this.Dd[c];
  1875. if (void 0 === d) return this.Cd++, d = new Wa(a, b), this.Dd[c] = d, c = this.ii, null === c ? this.Ma = d : (d.Ep = c, c.gb = d), this.ii = d, this.Uc(), !0;
  1876. d.value = b;
  1877. return !1
  1878. };
  1879. oa.prototype.set = oa.prototype.set = function(a, b) { return this.add(a, b) };
  1880. oa.prototype.addAll = oa.prototype.Vc = function(a) {
  1881. if (null === a) return this;
  1882. if (D.isArray(a))
  1883. for (var b = D.cb(a), c = 0; c < b; c++) {
  1884. var d = D.La(a, c);
  1885. this.add(d.key, d.value)
  1886. } else
  1887. for (a = a.j; a.next();) this.add(a.key, a.value);
  1888. return this
  1889. };
  1890. oa.prototype.first = oa.prototype.first = function() { return this.Ma };
  1891. oa.prototype.any = function(a) {
  1892. for (var b = this.I, c = this.Ma; null !== c;) {
  1893. if (a(c)) return !0;
  1894. this.I !== b && D.Va(this);
  1895. c = c.gb
  1896. }
  1897. return !1
  1898. };
  1899. oa.prototype.all = function(a) {
  1900. for (var b = this.I, c = this.Ma; null !== c;) {
  1901. if (!a(c)) return !1;
  1902. this.I !== b && D.Va(this);
  1903. c = c.gb
  1904. }
  1905. return !0
  1906. };
  1907. oa.prototype.each = function(a) { for (var b = this.I, c = this.Ma; null !== c;) a(c), this.I !== b && D.Va(this), c = c.gb; return this };
  1908. oa.prototype.map = function(a) { for (var b = new oa(this.cf), c = this.I, d = this.Ma; null !== d;) b.add(d.key, a(d)), this.I !== c && D.Va(this), d = d.gb; return b };
  1909. oa.prototype.filter = function(a) { for (var b = new oa(this.cf, this.Bi), c = this.I, d = this.Ma; null !== d;) a(d) && b.add(d.key, d.value), this.I !== c && D.Va(this), d = d.gb; return b };
  1910. oa.prototype.concat = function(a) { return this.copy().Vc(a) };
  1911. oa.prototype.contains = oa.prototype.contains = function(a) { v && bb(this, a); var b = a; return D.Qa(a) && (b = D.Nd(a), void 0 === b) ? !1 : void 0 !== this.Dd[b] };
  1912. oa.prototype.has = oa.prototype.has = function(a) { return this.contains(a) };
  1913. oa.prototype.getValue = oa.prototype.oa = function(a) {
  1914. v && bb(this, a);
  1915. var b = a;
  1916. if (D.Qa(a) && (b = D.Nd(a), void 0 === b)) return null;
  1917. a = this.Dd[b];
  1918. return void 0 === a ? null : a.value
  1919. };
  1920. oa.prototype.get = oa.prototype.get = function(a) { return this.oa(a) };
  1921. oa.prototype.remove = oa.prototype["delete"] = oa.prototype.remove = function(a) {
  1922. if (null === a) return !1;
  1923. v && bb(this, a);
  1924. this.J && D.qa(this, a);
  1925. var b = a;
  1926. if (D.Qa(a) && (b = D.Nd(a), void 0 === b)) return !1;
  1927. a = this.Dd[b];
  1928. if (void 0 === a) return !1;
  1929. var c = a.gb,
  1930. d = a.Ep;
  1931. null !== c && (c.Ep = d);
  1932. null !== d && (d.gb = c);
  1933. this.Ma === a && (this.Ma = c);
  1934. this.ii === a && (this.ii = d);
  1935. delete this.Dd[b];
  1936. this.Cd--;
  1937. this.Uc();
  1938. return !0
  1939. };
  1940. oa.prototype.clear = oa.prototype.clear = function() {
  1941. this.J && D.qa(this);
  1942. this.Dd = {};
  1943. this.Cd = 0;
  1944. this.ii = this.Ma = null;
  1945. this.Uc()
  1946. };
  1947. oa.prototype.copy = function() {
  1948. var a = new oa(this.cf, this.Bi),
  1949. b = this.Dd,
  1950. c;
  1951. for (c in b) {
  1952. var d = b[c];
  1953. a.add(d.key, d.value)
  1954. }
  1955. return a
  1956. };
  1957. oa.prototype.toArray = oa.prototype.Fc = function() {
  1958. var a = this.Dd,
  1959. b = Array(this.Cd),
  1960. c = 0,
  1961. d;
  1962. for (d in a) {
  1963. var e = a[d];
  1964. b[c] = new Wa(e.key, e.value);
  1965. c++
  1966. }
  1967. return b
  1968. };
  1969. oa.prototype.toKeySet = oa.prototype.bk = function() { return new Ya(this) };
  1970. D.w(oa, { count: "count" }, function() { return this.Cd });
  1971. D.w(oa, { size: "size" }, function() { return this.Cd });
  1972. D.w(oa, { j: "iterator" }, function() { if (0 >= this.count) return Ka; var a = this.Zb; return null !== a ? (a.reset(), a) : new $a(this) });
  1973. D.w(oa, { pG: "iteratorKeys" }, function() { return 0 >= this.count ? Ka : new Xa(this) });
  1974. D.w(oa, { qG: "iteratorValues" }, function() { if (0 >= this.count) return Ka; var a = this.gj; return null !== a ? (a.reset(), a) : new Za(this) });
  1975. function N(a, b) {
  1976. void 0 === a ? this.N = this.M = 0 : "number" === typeof a && "number" === typeof b ? (this.M = a, this.N = b) : D.k("Invalid arguments to Point constructor: " + a + ", " + b);
  1977. this.J = !1
  1978. }
  1979. D.ka("Point", N);
  1980. D.Di(N);
  1981. D.me(N, { x: !0, y: !0 });
  1982. N.prototype.assign = function(a) {
  1983. this.M = a.M;
  1984. this.N = a.N
  1985. };
  1986. N.prototype.setTo = N.prototype.n = function(a, b) {
  1987. v && (D.h(a, "number", N, "setTo:x"), D.h(b, "number", N, "setTo:y"));
  1988. this.M = a;
  1989. this.N = b;
  1990. return this
  1991. };
  1992. N.prototype.set = N.prototype.set = function(a) {
  1993. v && D.l(a, N, N, "set:p");
  1994. this.Sa();
  1995. this.M = a.M;
  1996. this.N = a.N;
  1997. return this
  1998. };
  1999. N.prototype.copy = function() {
  2000. var a = new N;
  2001. a.M = this.M;
  2002. a.N = this.N;
  2003. return a
  2004. };
  2005. f = N.prototype;
  2006. f.Oa = function() {
  2007. this.J = !0;
  2008. Object.freeze(this);
  2009. return this
  2010. };
  2011. f.V = function() { return Object.isFrozen(this) ? this : this.copy().freeze() };
  2012. f.freeze = function() { this.J = !0; return this };
  2013. f.Xa = function() {
  2014. Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
  2015. this.J = !1;
  2016. return this
  2017. };
  2018. f.Sa = function(a) {
  2019. if (this.J) {
  2020. var b = "The Point is frozen, so its properties cannot be set: " + this.toString();
  2021. void 0 !== a && (b += " to value: " + a);
  2022. D.k(b)
  2023. }
  2024. };
  2025. N.parse = function(a) {
  2026. if ("string" === typeof a) {
  2027. a = a.split(" ");
  2028. for (var b = 0, c = 0;
  2029. "" === a[b];) b++;
  2030. var d = a[b++];
  2031. d && (c = parseFloat(d));
  2032. for (var e = 0;
  2033. "" === a[b];) b++;
  2034. (d = a[b++]) && (e = parseFloat(d));
  2035. return new N(c, e)
  2036. }
  2037. return new N
  2038. };
  2039. N.stringify = function(a) { v && D.l(a, N); return a.x.toString() + " " + a.y.toString() };
  2040. N.prototype.toString = function() { return "Point(" + this.x + "," + this.y + ")" };
  2041. N.prototype.equals = N.prototype.O = function(a) { return a instanceof N ? this.M === a.x && this.N === a.y : !1 };
  2042. N.prototype.equalTo = N.prototype.Tx = function(a, b) { return this.M === a && this.N === b };
  2043. N.prototype.equalsApprox = N.prototype.Wc = function(a) { return Q(this.M, a.x) && Q(this.N, a.y) };
  2044. N.prototype.add = N.prototype.add = function(a) {
  2045. v && D.l(a, N, N, "add:p");
  2046. this.Sa();
  2047. this.M += a.x;
  2048. this.N += a.y;
  2049. return this
  2050. };
  2051. N.prototype.subtract = N.prototype.$j = function(a) {
  2052. v && D.l(a, N, N, "subtract:p");
  2053. this.Sa();
  2054. this.M -= a.x;
  2055. this.N -= a.y;
  2056. return this
  2057. };
  2058. N.prototype.offset = N.prototype.offset = function(a, b) {
  2059. v && (D.p(a, N, "offset:dx"), D.p(b, N, "offset:dy"));
  2060. this.Sa();
  2061. this.M += a;
  2062. this.N += b;
  2063. return this
  2064. };
  2065. N.prototype.rotate = N.prototype.rotate = function(a) {
  2066. v && D.p(a, N, "rotate:angle");
  2067. this.Sa();
  2068. if (0 === a) return this;
  2069. var b = this.M,
  2070. c = this.N;
  2071. if (0 === b && 0 === c) return this;
  2072. var d = 0,
  2073. e = 0;
  2074. 360 <= a ? a -= 360 : 0 > a && (a += 360);
  2075. 90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (a = a * Math.PI / 180, d = Math.cos(a), e = Math.sin(a));
  2076. this.M = d * b - e * c;
  2077. this.N = e * b + d * c;
  2078. return this
  2079. };
  2080. N.prototype.scale = N.prototype.scale = function(a, b) {
  2081. v && (D.p(a, N, "scale:sx"), D.p(b, N, "scale:sy"));
  2082. this.M *= a;
  2083. this.N *= b;
  2084. return this
  2085. };
  2086. N.prototype.distanceSquaredPoint = N.prototype.Kf = function(a) {
  2087. v && D.l(a, N, N, "distanceSquaredPoint:p");
  2088. var b = a.x - this.M;
  2089. a = a.y - this.N;
  2090. return b * b + a * a
  2091. };
  2092. N.prototype.distanceSquared = N.prototype.mq = function(a, b) {
  2093. v && (D.p(a, N, "distanceSquared:px"), D.p(b, N, "distanceSquared:py"));
  2094. var c = a - this.M,
  2095. d = b - this.N;
  2096. return c * c + d * d
  2097. };
  2098. N.prototype.normalize = N.prototype.normalize = function() {
  2099. this.Sa();
  2100. var a = this.M,
  2101. b = this.N,
  2102. c = Math.sqrt(a * a + b * b);
  2103. 0 < c && (this.M = a / c, this.N = b / c);
  2104. return this
  2105. };
  2106. N.prototype.directionPoint = N.prototype.Wb = function(a) { v && D.l(a, N, N, "directionPoint:p"); return cb(a.x - this.M, a.y - this.N) };
  2107. N.prototype.direction = N.prototype.direction = function(a, b) { v && (D.p(a, N, "direction:px"), D.p(b, N, "direction:py")); return cb(a - this.M, b - this.N) };
  2108. function cb(a, b) {
  2109. if (0 === a) return 0 < b ? 90 : 0 > b ? 270 : 0;
  2110. if (0 === b) return 0 < a ? 0 : 180;
  2111. if (isNaN(a) || isNaN(b)) return 0;
  2112. var c = 180 * Math.atan(Math.abs(b / a)) / Math.PI;
  2113. 0 > a ? c = 0 > b ? c + 180 : 180 - c : 0 > b && (c = 360 - c);
  2114. return c
  2115. }
  2116. N.prototype.projectOntoLineSegment = function(a, b, c, d) {
  2117. v && (D.p(a, N, "projectOntoLineSegment:px"), D.p(b, N, "projectOntoLineSegment:py"), D.p(c, N, "projectOntoLineSegment:qx"), D.p(d, N, "projectOntoLineSegment:qy"));
  2118. fb(a, b, c, d, this.M, this.N, this);
  2119. return this
  2120. };
  2121. N.prototype.projectOntoLineSegmentPoint = function(a, b) {
  2122. v && (D.l(a, N, N, "projectOntoLineSegmentPoint:p"), D.l(b, N, N, "projectOntoLineSegmentPoint:q"));
  2123. fb(a.x, a.y, b.x, b.y, this.M, this.N, this);
  2124. return this
  2125. };
  2126. N.prototype.snapToGrid = function(a, b, c, d) {
  2127. v && (D.p(a, N, "snapToGrid:originx"), D.p(b, N, "snapToGrid:originy"), D.p(c, N, "snapToGrid:cellwidth"), D.p(d, N, "snapToGrid:cellheight"));
  2128. jb(this.M, this.N, a, b, c, d, this);
  2129. return this
  2130. };
  2131. N.prototype.snapToGridPoint = function(a, b) {
  2132. v && (D.l(a, N, N, "snapToGridPoint:p"), D.l(b, Ca, N, "snapToGridPoint:q"));
  2133. jb(this.M, this.N, a.x, a.y, b.width, b.height, this);
  2134. return this
  2135. };
  2136. N.prototype.setRectSpot = N.prototype.uo = function(a, b) {
  2137. v && (D.l(a, C, N, "setRectSpot:r"), D.l(b, S, N, "setRectSpot:spot"));
  2138. this.Sa();
  2139. this.M = a.x + b.x * a.width + b.offsetX;
  2140. this.N = a.y + b.y * a.height + b.offsetY;
  2141. return this
  2142. };
  2143. N.prototype.setSpot = N.prototype.pv = function(a, b, c, d, e) {
  2144. v && (D.p(a, N, "setSpot:x"), D.p(b, N, "setSpot:y"), D.p(c, N, "setSpot:w"), D.p(d, N, "setSpot:h"), (0 > c || 0 > d) && D.k("Point.setSpot:Width and height cannot be negative"), D.l(e, S, N, "setSpot:spot"));
  2145. this.Sa();
  2146. this.M = a + e.x * c + e.offsetX;
  2147. this.N = b + e.y * d + e.offsetY;
  2148. return this
  2149. };
  2150. N.prototype.transform = function(a) {
  2151. v && D.l(a, Ea, N, "transform:t");
  2152. a.vb(this);
  2153. return this
  2154. };
  2155. function kb(a, b) {
  2156. v && D.l(b, Ea, N, "transformInverted:t");
  2157. b.Oh(a);
  2158. return a
  2159. }
  2160. var lb;
  2161. N.distanceLineSegmentSquared = lb = function(a, b, c, d, e, g) {
  2162. v && (D.p(a, N, "distanceLineSegmentSquared:px"), D.p(b, N, "distanceLineSegmentSquared:py"), D.p(c, N, "distanceLineSegmentSquared:ax"), D.p(d, N, "distanceLineSegmentSquared:ay"), D.p(e, N, "distanceLineSegmentSquared:bx"), D.p(g, N, "distanceLineSegmentSquared:by"));
  2163. var h = e - c,
  2164. k = g - d,
  2165. l = h * h + k * k;
  2166. c -= a;
  2167. d -= b;
  2168. var m = -c * h - d * k;
  2169. if (0 >= m || m >= l) return h = e - a, k = g - b, Math.min(c * c + d * d, h * h + k * k);
  2170. a = h * d - k * c;
  2171. return a * a / l
  2172. };
  2173. var ob;
  2174. N.distanceSquared = ob = function(a, b, c, d) {
  2175. v && (D.p(a, N, "distanceSquared:px"), D.p(b, N, "distanceSquared:py"), D.p(c, N, "distanceSquared:qx"), D.p(d, N, "distanceSquared:qy"));
  2176. a = c - a;
  2177. b = d - b;
  2178. return a * a + b * b
  2179. };
  2180. var wb;
  2181. N.direction = wb = function(a, b, c, d) {
  2182. v && (D.p(a, N, "direction:px"), D.p(b, N, "direction:py"), D.p(c, N, "direction:qx"), D.p(d, N, "direction:qy"));
  2183. a = c - a;
  2184. b = d - b;
  2185. if (0 === a) return 0 < b ? 90 : 0 > b ? 270 : 0;
  2186. if (0 === b) return 0 < a ? 0 : 180;
  2187. if (isNaN(a) || isNaN(b)) return 0;
  2188. d = 180 * Math.atan(Math.abs(b / a)) / Math.PI;
  2189. 0 > a ? d = 0 > b ? d + 180 : 180 - d : 0 > b && (d = 360 - d);
  2190. return d
  2191. };
  2192. D.defineProperty(N, { x: "x" }, function() { return this.M }, function(a) {
  2193. this.Sa(a);
  2194. v && D.h(a, "number", N, "x");
  2195. this.M = a
  2196. });
  2197. D.defineProperty(N, { y: "y" }, function() { return this.N }, function(a) {
  2198. this.Sa(a);
  2199. v && D.h(a, "number", N, "y");
  2200. this.N = a
  2201. });
  2202. N.prototype.isReal = N.prototype.H = function() { return isFinite(this.x) && isFinite(this.y) };
  2203. function Ca(a, b) {
  2204. void 0 === a ? this.Ha = this.Ia = 0 : "number" === typeof a && (0 <= a || isNaN(a)) && "number" === typeof b && (0 <= b || isNaN(b)) ? (this.Ia = a, this.Ha = b) : D.k("Invalid arguments to Size constructor: " + a + ", " + b);
  2205. this.J = !1
  2206. }
  2207. D.ka("Size", Ca);
  2208. D.Di(Ca);
  2209. D.me(Ca, { width: !0, height: !0 });
  2210. Ca.prototype.assign = function(a) {
  2211. this.Ia = a.Ia;
  2212. this.Ha = a.Ha
  2213. };
  2214. Ca.prototype.setTo = Ca.prototype.n = function(a, b) {
  2215. v && (D.h(a, "number", Ca, "setTo:w"), D.h(b, "number", Ca, "setTo:h"), 0 > a && D.ua(a, ">= 0", Ca, "setTo:w"), 0 > b && D.ua(b, ">= 0", Ca, "setTo:h"));
  2216. this.Ia = a;
  2217. this.Ha = b;
  2218. return this
  2219. };
  2220. Ca.prototype.set = Ca.prototype.set = function(a) {
  2221. v && D.l(a, Ca, Ca, "set:s");
  2222. this.Sa();
  2223. this.Ia = a.Ia;
  2224. this.Ha = a.Ha;
  2225. return this
  2226. };
  2227. Ca.prototype.copy = function() {
  2228. var a = new Ca;
  2229. a.Ia = this.Ia;
  2230. a.Ha = this.Ha;
  2231. return a
  2232. };
  2233. f = Ca.prototype;
  2234. f.Oa = function() {
  2235. this.J = !0;
  2236. Object.freeze(this);
  2237. return this
  2238. };
  2239. f.V = function() { return Object.isFrozen(this) ? this : this.copy().freeze() };
  2240. f.freeze = function() { this.J = !0; return this };
  2241. f.Xa = function() {
  2242. Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
  2243. this.J = !1;
  2244. return this
  2245. };
  2246. f.Sa = function(a) {
  2247. if (this.J) {
  2248. var b = "The Size is frozen, so its properties cannot be set: " + this.toString();
  2249. void 0 !== a && (b += " to value: " + a);
  2250. D.k(b)
  2251. }
  2252. };
  2253. Ca.parse = function(a) {
  2254. if ("string" === typeof a) {
  2255. a = a.split(" ");
  2256. for (var b = 0, c = 0;
  2257. "" === a[b];) b++;
  2258. var d = a[b++];
  2259. d && (c = parseFloat(d));
  2260. for (var e = 0;
  2261. "" === a[b];) b++;
  2262. (d = a[b++]) && (e = parseFloat(d));
  2263. return new Ca(c, e)
  2264. }
  2265. return new Ca
  2266. };
  2267. Ca.stringify = function(a) { v && D.l(a, Ca); return a.width.toString() + " " + a.height.toString() };
  2268. Ca.prototype.toString = function() { return "Size(" + this.width + "," + this.height + ")" };
  2269. Ca.prototype.equals = Ca.prototype.O = function(a) { return a instanceof Ca ? this.Ia === a.width && this.Ha === a.height : !1 };
  2270. Ca.prototype.equalTo = Ca.prototype.Tx = function(a, b) { return this.Ia === a && this.Ha === b };
  2271. Ca.prototype.equalsApprox = Ca.prototype.Wc = function(a) { return Q(this.Ia, a.width) && Q(this.Ha, a.height) };
  2272. D.defineProperty(Ca, { width: "width" }, function() { return this.Ia }, function(a) {
  2273. this.Sa(a);
  2274. v && D.h(a, "number", Ca, "width");
  2275. 0 > a && D.ua(a, ">= 0", Ca, "width");
  2276. this.Ia = a
  2277. });
  2278. D.defineProperty(Ca, { height: "height" }, function() { return this.Ha }, function(a) {
  2279. this.Sa(a);
  2280. v && D.h(a, "number", Ca, "height");
  2281. 0 > a && D.ua(a, ">= 0", Ca, "height");
  2282. this.Ha = a
  2283. });
  2284. Ca.prototype.isReal = Ca.prototype.H = function() { return isFinite(this.width) && isFinite(this.height) };
  2285. function C(a, b, c, d) {
  2286. void 0 === a ? this.Ha = this.Ia = this.N = this.M = 0 : a instanceof N ? b instanceof N ? (this.M = Math.min(a.M, b.M), this.N = Math.min(a.N, b.N), this.Ia = Math.abs(a.M - b.M), this.Ha = Math.abs(a.N - b.N)) : b instanceof Ca ? (this.M = a.M, this.N = a.N, this.Ia = b.Ia, this.Ha = b.Ha) : D.k("Incorrect arguments supplied to Rect constructor") : "number" === typeof a && "number" === typeof b && "number" === typeof c && (0 <= c || isNaN(c)) && "number" === typeof d && (0 <= d || isNaN(d)) ? (this.M = a, this.N = b, this.Ia = c, this.Ha = d) : D.k("Invalid arguments to Rect constructor: " +
  2287. a + ", " + b + ", " + c + ", " + d);
  2288. this.J = !1
  2289. }
  2290. D.ka("Rect", C);
  2291. D.Di(C);
  2292. D.me(C, { x: !0, y: !0, width: !0, height: !0 });
  2293. C.prototype.assign = function(a) {
  2294. this.M = a.M;
  2295. this.N = a.N;
  2296. this.Ia = a.Ia;
  2297. this.Ha = a.Ha
  2298. };
  2299. function Cb(a, b, c) {
  2300. a.Ia = b;
  2301. a.Ha = c
  2302. }
  2303. C.prototype.setTo = C.prototype.n = function(a, b, c, d) {
  2304. v && (D.h(a, "number", C, "setTo:x"), D.h(b, "number", C, "setTo:y"), D.h(c, "number", C, "setTo:w"), D.h(d, "number", C, "setTo:h"), 0 > c && D.ua(c, ">= 0", C, "setTo:w"), 0 > d && D.ua(d, ">= 0", C, "setTo:h"));
  2305. this.M = a;
  2306. this.N = b;
  2307. this.Ia = c;
  2308. this.Ha = d;
  2309. return this
  2310. };
  2311. C.prototype.set = C.prototype.set = function(a) {
  2312. v && D.l(a, C, C, "set:r");
  2313. this.Sa();
  2314. this.M = a.M;
  2315. this.N = a.N;
  2316. this.Ia = a.Ia;
  2317. this.Ha = a.Ha;
  2318. return this
  2319. };
  2320. C.prototype.setPoint = C.prototype.gh = function(a) {
  2321. v && D.l(a, N, C, "setPoint:p");
  2322. this.Sa();
  2323. this.M = a.M;
  2324. this.N = a.N;
  2325. return this
  2326. };
  2327. C.prototype.setSize = function(a) {
  2328. v && D.l(a, Ca, C, "setSize:s");
  2329. this.Sa();
  2330. this.Ia = a.Ia;
  2331. this.Ha = a.Ha;
  2332. return this
  2333. };
  2334. C.prototype.copy = function() {
  2335. var a = new C;
  2336. a.M = this.M;
  2337. a.N = this.N;
  2338. a.Ia = this.Ia;
  2339. a.Ha = this.Ha;
  2340. return a
  2341. };
  2342. f = C.prototype;
  2343. f.Oa = function() {
  2344. this.J = !0;
  2345. Object.freeze(this);
  2346. return this
  2347. };
  2348. f.V = function() { return Object.isFrozen(this) ? this : this.copy().freeze() };
  2349. f.freeze = function() { this.J = !0; return this };
  2350. f.Xa = function() {
  2351. Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
  2352. this.J = !1;
  2353. return this
  2354. };
  2355. f.Sa = function(a) {
  2356. if (this.J) {
  2357. var b = "The Rect is frozen, so its properties cannot be set: " + this.toString();
  2358. void 0 !== a && (b += " to value: " + a);
  2359. D.k(b)
  2360. }
  2361. };
  2362. C.parse = function(a) {
  2363. if ("string" === typeof a) {
  2364. a = a.split(" ");
  2365. for (var b = 0, c = 0;
  2366. "" === a[b];) b++;
  2367. var d = a[b++];
  2368. d && (c = parseFloat(d));
  2369. for (var e = 0;
  2370. "" === a[b];) b++;
  2371. (d = a[b++]) && (e = parseFloat(d));
  2372. for (var g = 0;
  2373. "" === a[b];) b++;
  2374. (d = a[b++]) && (g = parseFloat(d));
  2375. for (var h = 0;
  2376. "" === a[b];) b++;
  2377. (d = a[b++]) && (h = parseFloat(d));
  2378. return new C(c, e, g, h)
  2379. }
  2380. return new C
  2381. };
  2382. C.stringify = function(a) { v && D.l(a, C); return a.x.toString() + " " + a.y.toString() + " " + a.width.toString() + " " + a.height.toString() };
  2383. C.prototype.toString = function() { return "Rect(" + this.x + "," + this.y + "," + this.width + "," + this.height + ")" };
  2384. C.prototype.equals = C.prototype.O = function(a) { return a instanceof C ? this.M === a.x && this.N === a.y && this.Ia === a.width && this.Ha === a.height : !1 };
  2385. C.prototype.equalTo = C.prototype.Tx = function(a, b, c, d) { return this.M === a && this.N === b && this.Ia === c && this.Ha === d };
  2386. C.prototype.equalsApprox = C.prototype.Wc = function(a) { return Q(this.M, a.x) && Q(this.N, a.y) && Q(this.Ia, a.width) && Q(this.Ha, a.height) };
  2387. function Db(a, b) { return Eb(a.M, b.x) && Eb(a.N, b.y) && Eb(a.Ia, b.width) && Eb(a.Ha, b.height) }
  2388. C.prototype.containsPoint = C.prototype.Pa = function(a) { v && D.l(a, N, C, "containsPoint:p"); return this.M <= a.x && this.M + this.Ia >= a.x && this.N <= a.y && this.N + this.Ha >= a.y };
  2389. C.prototype.containsRect = C.prototype.Sk = function(a) { v && D.l(a, C, C, "containsRect:r"); return this.M <= a.x && a.x + a.width <= this.M + this.Ia && this.N <= a.y && a.y + a.height <= this.N + this.Ha };
  2390. C.prototype.contains = C.prototype.contains = function(a, b, c, d) { v ? (D.p(a, C, "contains:x"), D.p(b, C, "contains:y"), void 0 === c ? c = 0 : D.p(c, C, "contains:w"), void 0 === d ? d = 0 : D.p(d, C, "contains:h"), (0 > c || 0 > d) && D.k("Rect.contains:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0)); return this.M <= a && a + c <= this.M + this.Ia && this.N <= b && b + d <= this.N + this.Ha };
  2391. C.prototype.reset = function() {
  2392. this.Sa();
  2393. this.Ha = this.Ia = this.N = this.M = 0
  2394. };
  2395. C.prototype.offset = C.prototype.offset = function(a, b) {
  2396. v && (D.p(a, C, "offset:dx"), D.p(b, C, "offset:dy"));
  2397. this.Sa();
  2398. this.M += a;
  2399. this.N += b;
  2400. return this
  2401. };
  2402. C.prototype.inflate = C.prototype.ig = function(a, b) { v && (D.p(a, C, "inflate:w"), D.p(b, C, "inflate:h")); return Gb(this, b, a, b, a) };
  2403. C.prototype.addMargin = C.prototype.yx = function(a) { v && D.l(a, Lb, C, "addMargin:m"); return Gb(this, a.top, a.right, a.bottom, a.left) };
  2404. C.prototype.subtractMargin = C.prototype.zK = function(a) { v && D.l(a, Lb, C, "subtractMargin:m"); return Gb(this, -a.top, -a.right, -a.bottom, -a.left) };
  2405. C.prototype.grow = function(a, b, c, d) { v && (D.p(a, C, "grow:t"), D.p(b, C, "grow:r"), D.p(c, C, "grow:b"), D.p(d, C, "grow:l")); return Gb(this, a, b, c, d) };
  2406. function Gb(a, b, c, d, e) {
  2407. a.Sa();
  2408. var g = a.Ia;
  2409. c + e <= -g ? (a.M += g / 2, a.Ia = 0) : (a.M -= e, a.Ia += c + e);
  2410. c = a.Ha;
  2411. b + d <= -c ? (a.N += c / 2, a.Ha = 0) : (a.N -= b, a.Ha += b + d);
  2412. return a
  2413. }
  2414. C.prototype.intersectRect = function(a) { v && D.l(a, C, C, "intersectRect:r"); return Nb(this, a.x, a.y, a.width, a.height) };
  2415. C.prototype.intersect = C.prototype.bG = function(a, b, c, d) { v && (D.p(a, C, "intersect:x"), D.p(b, C, "intersect:y"), D.p(c, C, "intersect:w"), D.p(d, C, "intersect:h"), (0 > c || 0 > d) && D.k("Rect.intersect:Width and height cannot be negative")); return Nb(this, a, b, c, d) };
  2416. function Nb(a, b, c, d, e) {
  2417. a.Sa();
  2418. var g = Math.max(a.M, b),
  2419. h = Math.max(a.N, c);
  2420. b = Math.min(a.M + a.Ia, b + d);
  2421. c = Math.min(a.N + a.Ha, c + e);
  2422. a.M = g;
  2423. a.N = h;
  2424. a.Ia = Math.max(0, b - g);
  2425. a.Ha = Math.max(0, c - h);
  2426. return a
  2427. }
  2428. C.prototype.intersectsRect = C.prototype.jg = function(a) { v && D.l(a, C, C, "intersectsRect:r"); return this.cG(a.x, a.y, a.width, a.height) };
  2429. C.prototype.intersects = C.prototype.cG = function(a, b, c, d) {
  2430. v && (D.p(a, C, "intersects:x"), D.p(b, C, "intersects:y"), D.p(a, C, "intersects:w"), D.p(b, C, "intersects:h"), (0 > c || 0 > d) && D.k("Rect.intersects:Width and height cannot be negative"));
  2431. var e = this.Ia,
  2432. g = this.M;
  2433. if (Infinity !== e && Infinity !== c && (e += g, c += a, isNaN(c) || isNaN(e) || g > c || a > e)) return !1;
  2434. a = this.Ha;
  2435. c = this.N;
  2436. return Infinity !== a && Infinity !== d && (a += c, d += b, isNaN(d) || isNaN(a) || c > d || b > a) ? !1 : !0
  2437. };
  2438. function Ob(a, b) {
  2439. var c = a.Ia,
  2440. d = b.width + 10 + 10,
  2441. e = a.M,
  2442. g = b.x - 10;
  2443. if (e > d + g || g > c + e) return !1;
  2444. c = a.Ha;
  2445. d = b.height + 10 + 10;
  2446. e = a.N;
  2447. g = b.y - 10;
  2448. return e > d + g || g > c + e ? !1 : !0
  2449. }
  2450. C.prototype.unionPoint = C.prototype.Mi = function(a) { v && D.l(a, N, C, "unionPoint:p"); return Ub(this, a.x, a.y, 0, 0) };
  2451. C.prototype.unionRect = C.prototype.Zh = function(a) { v && D.l(a, C, C, "unionRect:r"); return Ub(this, a.M, a.N, a.Ia, a.Ha) };
  2452. C.prototype.union = C.prototype.uH = function(a, b, c, d) {
  2453. this.Sa();
  2454. v ? (D.p(a, C, "union:x"), D.p(b, C, "union:y"), void 0 === c ? c = 0 : D.p(c, C, "union:w"), void 0 === d ? d = 0 : D.p(d, C, "union:h"), (0 > c || 0 > d) && D.k("Rect.union:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0));
  2455. return Ub(this, a, b, c, d)
  2456. };
  2457. function Ub(a, b, c, d, e) {
  2458. var g = Math.min(a.M, b),
  2459. h = Math.min(a.N, c);
  2460. b = Math.max(a.M + a.Ia, b + d);
  2461. c = Math.max(a.N + a.Ha, c + e);
  2462. a.M = g;
  2463. a.N = h;
  2464. a.Ia = b - g;
  2465. a.Ha = c - h;
  2466. return a
  2467. }
  2468. C.prototype.setSpot = C.prototype.pv = function(a, b, c) {
  2469. v && (D.p(a, C, "setSpot:x"), D.p(b, C, "setSpot:y"), D.l(c, S, C, "setSpot:spot"));
  2470. this.Sa();
  2471. this.M = a - c.offsetX - c.x * this.Ia;
  2472. this.N = b - c.offsetY - c.y * this.Ha;
  2473. return this
  2474. };
  2475. var Vb;
  2476. C.contains = Vb = function(a, b, c, d, e, g, h, k) { v ? (D.p(a, C, "contains:rx"), D.p(b, C, "contains:ry"), D.p(c, C, "contains:rw"), D.p(d, C, "contains:rh"), D.p(e, C, "contains:x"), D.p(g, C, "contains:y"), void 0 === h ? h = 0 : D.p(h, C, "contains:w"), void 0 === k ? k = 0 : D.p(k, C, "contains:h"), (0 > c || 0 > d || 0 > h || 0 > k) && D.k("Rect.contains:Width and height cannot be negative")) : (void 0 === h && (h = 0), void 0 === k && (k = 0)); return a <= e && e + h <= a + c && b <= g && g + k <= b + d };
  2477. C.intersects = function(a, b, c, d, e, g, h, k) {
  2478. v && (D.p(a, C, "intersects:rx"), D.p(b, C, "intersects:ry"), D.p(c, C, "intersects:rw"), D.p(d, C, "intersects:rh"), D.p(e, C, "intersects:x"), D.p(g, C, "intersects:y"), D.p(h, C, "intersects:w"), D.p(k, C, "intersects:h"), (0 > c || 0 > d || 0 > h || 0 > k) && D.k("Rect.intersects:Width and height cannot be negative"));
  2479. c += a;
  2480. h += e;
  2481. if (a > h || e > c) return !1;
  2482. a = d + b;
  2483. k += g;
  2484. return b > k || g > a ? !1 : !0
  2485. };
  2486. D.defineProperty(C, { x: "x" }, function() { return this.M }, function(a) {
  2487. this.Sa(a);
  2488. v && D.h(a, "number", C, "x");
  2489. this.M = a
  2490. });
  2491. D.defineProperty(C, { y: "y" }, function() { return this.N }, function(a) {
  2492. this.Sa(a);
  2493. v && D.h(a, "number", C, "y");
  2494. this.N = a
  2495. });
  2496. D.defineProperty(C, { width: "width" }, function() { return this.Ia }, function(a) {
  2497. this.Sa(a);
  2498. v && D.h(a, "number", C, "width");
  2499. 0 > a && D.ua(a, ">= 0", C, "width");
  2500. this.Ia = a
  2501. });
  2502. D.defineProperty(C, { height: "height" }, function() { return this.Ha }, function(a) {
  2503. this.Sa(a);
  2504. v && D.h(a, "number", C, "height");
  2505. 0 > a && D.ua(a, ">= 0", C, "height");
  2506. this.Ha = a
  2507. });
  2508. D.defineProperty(C, { left: "left" }, function() { return this.M }, function(a) {
  2509. this.Sa(a);
  2510. v && D.h(a, "number", C, "left");
  2511. this.M = a
  2512. });
  2513. D.defineProperty(C, { top: "top" }, function() { return this.N }, function(a) {
  2514. this.Sa(a);
  2515. v && D.h(a, "number", C, "top");
  2516. this.N = a
  2517. });
  2518. D.defineProperty(C, { right: "right" }, function() { return this.M + this.Ia }, function(a) {
  2519. this.Sa(a);
  2520. v && D.p(a, C, "right");
  2521. this.M += a - (this.M + this.Ia)
  2522. });
  2523. D.defineProperty(C, { bottom: "bottom" }, function() { return this.N + this.Ha }, function(a) {
  2524. this.Sa(a);
  2525. v && D.p(a, C, "top");
  2526. this.N += a - (this.N + this.Ha)
  2527. });
  2528. D.defineProperty(C, { position: "position" }, function() { return new N(this.M, this.N) }, function(a) {
  2529. this.Sa(a);
  2530. v && D.l(a, N, C, "position");
  2531. this.M = a.x;
  2532. this.N = a.y
  2533. });
  2534. D.defineProperty(C, { size: "size" }, function() { return new Ca(this.Ia, this.Ha) }, function(a) {
  2535. this.Sa(a);
  2536. v && D.l(a, Ca, C, "size");
  2537. this.Ia = a.width;
  2538. this.Ha = a.height
  2539. });
  2540. D.defineProperty(C, { jm: "center" }, function() { return new N(this.M + this.Ia / 2, this.N + this.Ha / 2) }, function(a) {
  2541. this.Sa(a);
  2542. v && D.l(a, N, C, "center");
  2543. this.M = a.x - this.Ia / 2;
  2544. this.N = a.y - this.Ha / 2
  2545. });
  2546. D.defineProperty(C, { pa: "centerX" }, function() { return this.M + this.Ia / 2 }, function(a) {
  2547. this.Sa(a);
  2548. v && D.p(a, C, "centerX");
  2549. this.M = a - this.Ia / 2
  2550. });
  2551. D.defineProperty(C, { va: "centerY" }, function() { return this.N + this.Ha / 2 }, function(a) {
  2552. this.Sa(a);
  2553. v && D.p(a, C, "centerY");
  2554. this.N = a - this.Ha / 2
  2555. });
  2556. C.prototype.isReal = C.prototype.H = function() { return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height) };
  2557. C.prototype.isEmpty = function() { return 0 === this.width && 0 === this.height };
  2558. function Lb(a, b, c, d) {
  2559. void 0 === a ? this.vh = this.mh = this.Dh = this.Eh = 0 : void 0 === b ? this.left = this.bottom = this.right = this.top = a : void 0 === c ? (d = b, this.top = a, this.right = b, this.bottom = a, this.left = d) : void 0 !== d ? (this.top = a, this.right = b, this.bottom = c, this.left = d) : D.k("Invalid arguments to Margin constructor: " + a + ", " + b + ", " + c + ", " + d);
  2560. this.J = !1
  2561. }
  2562. D.ka("Margin", Lb);
  2563. D.Di(Lb);
  2564. D.me(Lb, { top: !0, right: !0, bottom: !0, left: !0 });
  2565. Lb.prototype.assign = function(a) {
  2566. this.Eh = a.Eh;
  2567. this.Dh = a.Dh;
  2568. this.mh = a.mh;
  2569. this.vh = a.vh
  2570. };
  2571. Lb.prototype.setTo = Lb.prototype.n = function(a, b, c, d) {
  2572. v && (D.h(a, "number", Lb, "setTo:t"), D.h(b, "number", Lb, "setTo:r"), D.h(c, "number", Lb, "setTo:b"), D.h(d, "number", Lb, "setTo:l"));
  2573. this.Sa();
  2574. this.Eh = a;
  2575. this.Dh = b;
  2576. this.mh = c;
  2577. this.vh = d;
  2578. return this
  2579. };
  2580. Lb.prototype.set = Lb.prototype.set = function(a) {
  2581. v && D.l(a, Lb, Lb, "assign:m");
  2582. this.Sa();
  2583. this.Eh = a.Eh;
  2584. this.Dh = a.Dh;
  2585. this.mh = a.mh;
  2586. this.vh = a.vh;
  2587. return this
  2588. };
  2589. Lb.prototype.copy = function() {
  2590. var a = new Lb;
  2591. a.Eh = this.Eh;
  2592. a.Dh = this.Dh;
  2593. a.mh = this.mh;
  2594. a.vh = this.vh;
  2595. return a
  2596. };
  2597. f = Lb.prototype;
  2598. f.Oa = function() {
  2599. this.J = !0;
  2600. Object.freeze(this);
  2601. return this
  2602. };
  2603. f.V = function() { return Object.isFrozen(this) ? this : this.copy().freeze() };
  2604. f.freeze = function() { this.J = !0; return this };
  2605. f.Xa = function() {
  2606. Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
  2607. this.J = !1;
  2608. return this
  2609. };
  2610. f.Sa = function(a) {
  2611. if (this.J) {
  2612. var b = "The Margin is frozen, so its properties cannot be set: " + this.toString();
  2613. void 0 !== a && (b += " to value: " + a);
  2614. D.k(b)
  2615. }
  2616. };
  2617. Lb.parse = function(a) {
  2618. if ("string" === typeof a) {
  2619. a = a.split(" ");
  2620. for (var b = 0, c = NaN;
  2621. "" === a[b];) b++;
  2622. var d = a[b++];
  2623. d && (c = parseFloat(d));
  2624. if (isNaN(c)) return new Lb;
  2625. for (var e = NaN;
  2626. "" === a[b];) b++;
  2627. (d = a[b++]) && (e = parseFloat(d));
  2628. if (isNaN(e)) return new Lb(c);
  2629. for (var g = NaN;
  2630. "" === a[b];) b++;
  2631. (d = a[b++]) && (g = parseFloat(d));
  2632. if (isNaN(g)) return new Lb(c, e);
  2633. for (var h = NaN;
  2634. "" === a[b];) b++;
  2635. (d = a[b++]) && (h = parseFloat(d));
  2636. return isNaN(h) ? new Lb(c, e) : new Lb(c, e, g, h)
  2637. }
  2638. return new Lb
  2639. };
  2640. Lb.stringify = function(a) { v && D.l(a, Lb); return a.top.toString() + " " + a.right.toString() + " " + a.bottom.toString() + " " + a.left.toString() };
  2641. Lb.prototype.toString = function() { return "Margin(" + this.top + "," + this.right + "," + this.bottom + "," + this.left + ")" };
  2642. Lb.prototype.equals = Lb.prototype.O = function(a) { return a instanceof Lb ? this.Eh === a.top && this.Dh === a.right && this.mh === a.bottom && this.vh === a.left : !1 };
  2643. Lb.prototype.equalTo = Lb.prototype.Tx = function(a, b, c, d) { return this.Eh === a && this.Dh === b && this.mh === c && this.vh === d };
  2644. Lb.prototype.equalsApprox = Lb.prototype.Wc = function(a) { return Q(this.Eh, a.top) && Q(this.Dh, a.right) && Q(this.mh, a.bottom) && Q(this.vh, a.left) };
  2645. D.defineProperty(Lb, { top: "top" }, function() { return this.Eh }, function(a) {
  2646. this.Sa(a);
  2647. v && D.p(a, Lb, "top");
  2648. this.Eh = a
  2649. });
  2650. D.defineProperty(Lb, { right: "right" }, function() { return this.Dh }, function(a) {
  2651. this.Sa(a);
  2652. v && D.p(a, Lb, "right");
  2653. this.Dh = a
  2654. });
  2655. D.defineProperty(Lb, { bottom: "bottom" }, function() { return this.mh }, function(a) {
  2656. this.Sa(a);
  2657. v && D.p(a, Lb, "bottom");
  2658. this.mh = a
  2659. });
  2660. D.defineProperty(Lb, { left: "left" }, function() { return this.vh }, function(a) {
  2661. this.Sa(a);
  2662. v && D.p(a, Lb, "left");
  2663. this.vh = a
  2664. });
  2665. Lb.prototype.isReal = Lb.prototype.H = function() { return isFinite(this.top) && isFinite(this.right) && isFinite(this.bottom) && isFinite(this.left) };
  2666. function Ea() {
  2667. this.m11 = 1;
  2668. this.m21 = this.m12 = 0;
  2669. this.m22 = 1;
  2670. this.dy = this.dx = 0
  2671. }
  2672. D.Di(Ea);
  2673. D.me(Ea, { m11: !0, m12: !0, m21: !0, m22: !0, dx: !0, dy: !0 });
  2674. Ea.prototype.set = Ea.prototype.set = function(a) {
  2675. v && D.l(a, Ea, Ea, "set:t");
  2676. this.m11 = a.m11;
  2677. this.m12 = a.m12;
  2678. this.m21 = a.m21;
  2679. this.m22 = a.m22;
  2680. this.dx = a.dx;
  2681. this.dy = a.dy;
  2682. return this
  2683. };
  2684. Ea.prototype.copy = function() {
  2685. var a = new Ea;
  2686. a.m11 = this.m11;
  2687. a.m12 = this.m12;
  2688. a.m21 = this.m21;
  2689. a.m22 = this.m22;
  2690. a.dx = this.dx;
  2691. a.dy = this.dy;
  2692. return a
  2693. };
  2694. Ea.prototype.toString = function() { return "Transform(" + this.m11 + "," + this.m12 + "," + this.m21 + "," + this.m22 + "," + this.dx + "," + this.dy + ")" };
  2695. Ea.prototype.equals = Ea.prototype.O = function(a) { return a instanceof Ea ? this.m11 === a.m11 && this.m12 === a.m12 && this.m21 === a.m21 && this.m22 === a.m22 && this.dx === a.dx && this.dy === a.dy : !1 };
  2696. Ea.prototype.isIdentity = Ea.prototype.Nu = function() { return 1 === this.m11 && 0 === this.m12 && 0 === this.m21 && 1 === this.m22 && 0 === this.dx && 0 === this.dy };
  2697. Ea.prototype.reset = Ea.prototype.reset = function() {
  2698. this.m11 = 1;
  2699. this.m21 = this.m12 = 0;
  2700. this.m22 = 1;
  2701. this.dy = this.dx = 0;
  2702. return this
  2703. };
  2704. Ea.prototype.multiply = Ea.prototype.multiply = function(a) {
  2705. v && D.l(a, Ea, Ea, "multiply:matrix");
  2706. var b = this.m12 * a.m11 + this.m22 * a.m12,
  2707. c = this.m11 * a.m21 + this.m21 * a.m22,
  2708. d = this.m12 * a.m21 + this.m22 * a.m22,
  2709. e = this.m11 * a.dx + this.m21 * a.dy + this.dx,
  2710. g = this.m12 * a.dx + this.m22 * a.dy + this.dy;
  2711. this.m11 = this.m11 * a.m11 + this.m21 * a.m12;
  2712. this.m12 = b;
  2713. this.m21 = c;
  2714. this.m22 = d;
  2715. this.dx = e;
  2716. this.dy = g;
  2717. return this
  2718. };
  2719. Ea.prototype.multiplyInverted = Ea.prototype.GB = function(a) {
  2720. v && D.l(a, Ea, Ea, "multiplyInverted:matrix");
  2721. var b = 1 / (a.m11 * a.m22 - a.m12 * a.m21),
  2722. c = a.m22 * b,
  2723. d = -a.m12 * b,
  2724. e = -a.m21 * b,
  2725. g = a.m11 * b,
  2726. h = b * (a.m21 * a.dy - a.m22 * a.dx),
  2727. k = b * (a.m12 * a.dx - a.m11 * a.dy);
  2728. a = this.m12 * c + this.m22 * d;
  2729. b = this.m11 * e + this.m21 * g;
  2730. e = this.m12 * e + this.m22 * g;
  2731. g = this.m11 * h + this.m21 * k + this.dx;
  2732. h = this.m12 * h + this.m22 * k + this.dy;
  2733. this.m11 = this.m11 * c + this.m21 * d;
  2734. this.m12 = a;
  2735. this.m21 = b;
  2736. this.m22 = e;
  2737. this.dx = g;
  2738. this.dy = h;
  2739. return this
  2740. };
  2741. Ea.prototype.invert = Ea.prototype.pB = function() {
  2742. var a = 1 / (this.m11 * this.m22 - this.m12 * this.m21),
  2743. b = -this.m12 * a,
  2744. c = -this.m21 * a,
  2745. d = this.m11 * a,
  2746. e = a * (this.m21 * this.dy - this.m22 * this.dx),
  2747. g = a * (this.m12 * this.dx - this.m11 * this.dy);
  2748. this.m11 = this.m22 * a;
  2749. this.m12 = b;
  2750. this.m21 = c;
  2751. this.m22 = d;
  2752. this.dx = e;
  2753. this.dy = g;
  2754. return this
  2755. };
  2756. Ea.prototype.rotate = Ea.prototype.rotate = function(a, b, c) {
  2757. v && (D.p(a, Ea, "rotate:angle"), D.p(b, Ea, "rotate:rx"), D.p(c, Ea, "rotate:ry"));
  2758. 360 <= a ? a -= 360 : 0 > a && (a += 360);
  2759. if (0 === a) return this;
  2760. this.translate(b, c);
  2761. var d = 0,
  2762. e = 0;
  2763. 90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (e = a * Math.PI / 180, d = Math.cos(e), e = Math.sin(e));
  2764. a = this.m12 * d + this.m22 * e;
  2765. var g = this.m11 * -e + this.m21 * d,
  2766. h = this.m12 * -e + this.m22 * d;
  2767. this.m11 = this.m11 * d + this.m21 * e;
  2768. this.m12 = a;
  2769. this.m21 = g;
  2770. this.m22 = h;
  2771. this.translate(-b, -c);
  2772. return this
  2773. };
  2774. Ea.prototype.translate = Ea.prototype.translate = function(a, b) {
  2775. v && (D.p(a, Ea, "translate:x"), D.p(b, Ea, "translate:y"));
  2776. this.dx += this.m11 * a + this.m21 * b;
  2777. this.dy += this.m12 * a + this.m22 * b;
  2778. return this
  2779. };
  2780. Ea.prototype.scale = Ea.prototype.scale = function(a, b) {
  2781. void 0 === b && (b = a);
  2782. v && (D.p(a, Ea, "translate:sx"), D.p(b, Ea, "translate:sy"));
  2783. this.m11 *= a;
  2784. this.m12 *= a;
  2785. this.m21 *= b;
  2786. this.m22 *= b;
  2787. return this
  2788. };
  2789. Ea.prototype.transformPoint = Ea.prototype.vb = function(a) {
  2790. v && D.l(a, N, Ea, "transformPoint:p");
  2791. var b = a.M,
  2792. c = a.N;
  2793. a.M = b * this.m11 + c * this.m21 + this.dx;
  2794. a.N = b * this.m12 + c * this.m22 + this.dy;
  2795. return a
  2796. };
  2797. Ea.prototype.invertedTransformPoint = Ea.prototype.Oh = function(a) {
  2798. v && D.l(a, N, Ea, "invertedTransformPoint:p");
  2799. var b = 1 / (this.m11 * this.m22 - this.m12 * this.m21),
  2800. c = -this.m12 * b,
  2801. d = this.m11 * b,
  2802. e = b * (this.m12 * this.dx - this.m11 * this.dy),
  2803. g = a.M,
  2804. h = a.N;
  2805. a.M = g * this.m22 * b + h * -this.m21 * b + b * (this.m21 * this.dy - this.m22 * this.dx);
  2806. a.N = g * c + h * d + e;
  2807. return a
  2808. };
  2809. Ea.prototype.transformRect = Ea.prototype.tH = function(a) {
  2810. v && D.l(a, C, Ea, "transformRect:rect");
  2811. var b = a.M,
  2812. c = a.N,
  2813. d = b + a.Ia,
  2814. e = c + a.Ha,
  2815. g = this.m11,
  2816. h = this.m12,
  2817. k = this.m21,
  2818. l = this.m22,
  2819. m = this.dx,
  2820. n = this.dy,
  2821. p = b * g + c * k + m,
  2822. q = b * h + c * l + n,
  2823. r = d * g + c * k + m,
  2824. c = d * h + c * l + n,
  2825. s = b * g + e * k + m,
  2826. b = b * h + e * l + n,
  2827. g = d * g + e * k + m,
  2828. d = d * h + e * l + n,
  2829. e = p,
  2830. h = q,
  2831. p = Math.min(p, r),
  2832. e = Math.max(e, r),
  2833. h = Math.min(h, c),
  2834. q = Math.max(q, c),
  2835. p = Math.min(p, s),
  2836. e = Math.max(e, s),
  2837. h = Math.min(h, b),
  2838. q = Math.max(q, b),
  2839. p = Math.min(p, g),
  2840. e = Math.max(e, g),
  2841. h = Math.min(h, d),
  2842. q = Math.max(q, d);
  2843. a.M = p;
  2844. a.N = h;
  2845. a.Ia =
  2846. e - p;
  2847. a.Ha = q - h;
  2848. return a
  2849. };
  2850. function S(a, b, c, d) {
  2851. void 0 === a ? this.Ng = this.Mg = this.N = this.M = 0 : (void 0 === b && (b = 0), void 0 === c && (c = 0), void 0 === d && (d = 0), this.x = a, this.y = b, this.offsetX = c, this.offsetY = d);
  2852. this.J = !1
  2853. }
  2854. D.ka("Spot", S);
  2855. D.Di(S);
  2856. D.me(S, { x: !0, y: !0, offsetX: !0, offsetY: !0 });
  2857. S.prototype.assign = function(a) {
  2858. this.M = a.M;
  2859. this.N = a.N;
  2860. this.Mg = a.Mg;
  2861. this.Ng = a.Ng
  2862. };
  2863. S.prototype.setTo = S.prototype.n = function(a, b, c, d) {
  2864. v && (Wb(a, "setTo:x"), Wb(b, "setTo:y"), Zb(c, "setTo:offx"), Zb(d, "setTo:offy"));
  2865. this.Sa();
  2866. this.M = a;
  2867. this.N = b;
  2868. this.Mg = c;
  2869. this.Ng = d;
  2870. return this
  2871. };
  2872. S.prototype.set = S.prototype.set = function(a) {
  2873. v && D.l(a, S, S, "set:s");
  2874. this.Sa();
  2875. this.M = a.M;
  2876. this.N = a.N;
  2877. this.Mg = a.Mg;
  2878. this.Ng = a.Ng;
  2879. return this
  2880. };
  2881. S.prototype.copy = function() {
  2882. var a = new S;
  2883. a.M = this.M;
  2884. a.N = this.N;
  2885. a.Mg = this.Mg;
  2886. a.Ng = this.Ng;
  2887. return a
  2888. };
  2889. f = S.prototype;
  2890. f.Oa = function() {
  2891. this.J = !0;
  2892. Object.freeze(this);
  2893. return this
  2894. };
  2895. f.V = function() { return Object.isFrozen(this) ? this : this.copy().freeze() };
  2896. f.freeze = function() { this.J = !0; return this };
  2897. f.Xa = function() {
  2898. Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
  2899. this.J = !1;
  2900. return this
  2901. };
  2902. f.Sa = function(a) {
  2903. if (this.J) {
  2904. var b = "The Spot is frozen, so its properties cannot be set: " + this.toString();
  2905. void 0 !== a && (b += " to value: " + a);
  2906. D.k(b)
  2907. }
  2908. };
  2909. function bc(a, b) {
  2910. a.M = NaN;
  2911. a.N = NaN;
  2912. a.Mg = b;
  2913. return a
  2914. }
  2915. function Wb(a, b) {
  2916. (isNaN(a) || 1 < a || 0 > a) && D.ua(a, "0 <= " + b + " <= 1", S, b)
  2917. }
  2918. function Zb(a, b) {
  2919. (isNaN(a) || Infinity === a || -Infinity === a) && D.ua(a, "real number, not NaN or Infinity", S, b)
  2920. }
  2921. var cc;
  2922. S.parse = cc = function(a) {
  2923. if ("string" === typeof a) {
  2924. a = a.trim();
  2925. if ("None" === a) return dc;
  2926. if ("TopLeft" === a) return ec;
  2927. if ("Top" === a || "TopCenter" === a || "MiddleTop" === a) return jc;
  2928. if ("TopRight" === a) return kc;
  2929. if ("Left" === a || "LeftCenter" === a || "MiddleLeft" === a) return lc;
  2930. if ("Center" === a) return mc;
  2931. if ("Right" === a || "RightCenter" === a || "MiddleRight" === a) return nc;
  2932. if ("BottomLeft" === a) return tc;
  2933. if ("Bottom" === a || "BottomCenter" === a || "MiddleBottom" === a) return uc;
  2934. if ("BottomRight" === a) return vc;
  2935. if ("TopSide" === a) return wc;
  2936. if ("LeftSide" ===
  2937. a) return xc;
  2938. if ("RightSide" === a) return yc;
  2939. if ("BottomSide" === a) return Dc;
  2940. if ("TopBottomSides" === a) return Ec;
  2941. if ("LeftRightSides" === a) return Jc;
  2942. if ("TopLeftSides" === a) return Kc;
  2943. if ("TopRightSides" === a) return Lc;
  2944. if ("BottomLeftSides" === a) return Mc;
  2945. if ("BottomRightSides" === a) return Nc;
  2946. if ("NotTopSide" === a) return Oc;
  2947. if ("NotLeftSide" === a) return Pc;
  2948. if ("NotRightSide" === a) return Sc;
  2949. if ("NotBottomSide" === a) return Tc;
  2950. if ("AllSides" === a) return Uc;
  2951. if ("Default" === a) return Vc;
  2952. a = a.split(" ");
  2953. for (var b = 0, c = 0;
  2954. "" === a[b];) b++;
  2955. var d = a[b++];
  2956. void 0 !== d && 0 < d.length && (c = parseFloat(d));
  2957. for (var e = 0;
  2958. "" === a[b];) b++;
  2959. d = a[b++];
  2960. void 0 !== d && 0 < d.length && (e = parseFloat(d));
  2961. for (var g = 0;
  2962. "" === a[b];) b++;
  2963. d = a[b++];
  2964. void 0 !== d && 0 < d.length && (g = parseFloat(d));
  2965. for (var h = 0;
  2966. "" === a[b];) b++;
  2967. d = a[b++];
  2968. void 0 !== d && 0 < d.length && (h = parseFloat(d));
  2969. return new S(c, e, g, h)
  2970. }
  2971. return new S
  2972. };
  2973. S.stringify = function(a) { v && D.l(a, S); return a.Xc() ? a.x.toString() + " " + a.y.toString() + " " + a.offsetX.toString() + " " + a.offsetY.toString() : a.toString() };
  2974. S.prototype.toString = function() {
  2975. return this.Xc() ? 0 === this.Mg && 0 === this.Ng ? "Spot(" + this.x + "," + this.y + ")" : "Spot(" + this.x + "," + this.y + "," + this.offsetX + "," + this.offsetY + ")" : this.O(dc) ? "None" : this.O(ec) ? "TopLeft" : this.O(jc) ? "Top" : this.O(kc) ? "TopRight" : this.O(lc) ? "Left" : this.O(mc) ? "Center" : this.O(nc) ? "Right" : this.O(tc) ? "BottomLeft" : this.O(uc) ? "Bottom" : this.O(vc) ? "BottomRight" : this.O(wc) ? "TopSide" : this.O(xc) ? "LeftSide" : this.O(yc) ? "RightSide" : this.O(Dc) ? "BottomSide" : this.O(Ec) ? "TopBottomSides" : this.O(Jc) ?
  2976. "LeftRightSides" : this.O(Kc) ? "TopLeftSides" : this.O(Lc) ? "TopRightSides" : this.O(Mc) ? "BottomLeftSides" : this.O(Nc) ? "BottomRightSides" : this.O(Oc) ? "NotTopSide" : this.O(Pc) ? "NotLeftSide" : this.O(Sc) ? "NotRightSide" : this.O(Tc) ? "NotBottomSide" : this.O(Uc) ? "AllSides" : this.O(Vc) ? "Default" : "None"
  2977. };
  2978. S.prototype.equals = S.prototype.O = function(a) { return a instanceof S ? (this.M === a.x || isNaN(this.M) && isNaN(a.x)) && (this.N === a.y || isNaN(this.N) && isNaN(a.y)) && this.Mg === a.offsetX && this.Ng === a.offsetY : !1 };
  2979. S.prototype.opposite = S.prototype.DG = function() { return new S(.5 - (this.M - .5), .5 - (this.N - .5), -this.Mg, -this.Ng) };
  2980. S.prototype.includesSide = S.prototype.Mj = function(a) {
  2981. if (!this.Pj()) return !1;
  2982. if (!a.Pj())
  2983. if (a.O(Wc)) a = xc;
  2984. else if (a.O(Xc)) a = yc;
  2985. else if (a.O(Yc)) a = wc;
  2986. else if (a.O(Zc)) a = Dc;
  2987. else return !1;
  2988. a = a.offsetY;
  2989. return (this.Ng & a) === a
  2990. };
  2991. D.defineProperty(S, { x: "x" }, function() { return this.M }, function(a) {
  2992. this.Sa(a);
  2993. v && Wb(a, "x");
  2994. this.M = a
  2995. });
  2996. D.defineProperty(S, { y: "y" }, function() { return this.N }, function(a) {
  2997. this.Sa(a);
  2998. v && Wb(a, "y");
  2999. this.N = a
  3000. });
  3001. D.defineProperty(S, { offsetX: "offsetX" }, function() { return this.Mg }, function(a) {
  3002. this.Sa(a);
  3003. v && Zb(a, "offsetX");
  3004. this.Mg = a
  3005. });
  3006. D.defineProperty(S, { offsetY: "offsetY" }, function() { return this.Ng }, function(a) {
  3007. this.Sa(a);
  3008. v && Zb(a, "offsetY");
  3009. this.Ng = a
  3010. });
  3011. S.prototype.isSpot = S.prototype.Xc = function() { return !isNaN(this.x) && !isNaN(this.y) };
  3012. S.prototype.isNoSpot = S.prototype.de = function() { return isNaN(this.x) || isNaN(this.y) };
  3013. S.prototype.isSide = S.prototype.Pj = function() { return isNaN(this.x) && isNaN(this.y) && 1 === this.offsetX && 0 !== this.offsetY };
  3014. S.prototype.isNone = S.prototype.sJ = function() { return isNaN(this.x) && isNaN(this.y) && 0 === this.offsetX && 0 === this.offsetY };
  3015. S.prototype.isDefault = S.prototype.ld = function() { return isNaN(this.x) && isNaN(this.y) && -1 === this.offsetX && 0 === this.offsetY };
  3016. var dc;
  3017. S.None = dc = bc(new S(0, 0, 0, 0), 0).Oa();
  3018. var Vc;
  3019. S.Default = Vc = bc(new S(0, 0, -1, 0), -1).Oa();
  3020. var ec;
  3021. S.TopLeft = ec = (new S(0, 0, 0, 0)).Oa();
  3022. var jc;
  3023. S.TopCenter = jc = (new S(.5, 0, 0, 0)).Oa();
  3024. var kc;
  3025. S.TopRight = kc = (new S(1, 0, 0, 0)).Oa();
  3026. var lc;
  3027. S.LeftCenter = lc = (new S(0, .5, 0, 0)).Oa();
  3028. var mc;
  3029. S.Center = mc = (new S(.5, .5, 0, 0)).Oa();
  3030. var nc;
  3031. S.RightCenter = nc = (new S(1, .5, 0, 0)).Oa();
  3032. var tc;
  3033. S.BottomLeft = tc = (new S(0, 1, 0, 0)).Oa();
  3034. var uc;
  3035. S.BottomCenter = uc = (new S(.5, 1, 0, 0)).Oa();
  3036. var vc;
  3037. S.BottomRight = vc = (new S(1, 1, 0, 0)).Oa();
  3038. var $c;
  3039. S.MiddleTop = $c = jc;
  3040. var ed;
  3041. S.MiddleLeft = ed = lc;
  3042. var fd;
  3043. S.MiddleRight = fd = nc;
  3044. var gd;
  3045. S.MiddleBottom = gd = uc;
  3046. var Yc;
  3047. S.Top = Yc = jc;
  3048. var Wc;
  3049. S.Left = Wc = lc;
  3050. var Xc;
  3051. S.Right = Xc = nc;
  3052. var Zc;
  3053. S.Bottom = Zc = uc;
  3054. var wc;
  3055. S.TopSide = wc = bc(new S(0, 0, 1, D.Ad), 1).Oa();
  3056. var xc;
  3057. S.LeftSide = xc = bc(new S(0, 0, 1, D.bd), 1).Oa();
  3058. var yc;
  3059. S.RightSide = yc = bc(new S(0, 0, 1, D.rd), 1).Oa();
  3060. var Dc;
  3061. S.BottomSide = Dc = bc(new S(0, 0, 1, D.qd), 1).Oa();
  3062. var Ec;
  3063. S.TopBottomSides = Ec = bc(new S(0, 0, 1, D.Ad | D.qd), 1).Oa();
  3064. var Jc;
  3065. S.LeftRightSides = Jc = bc(new S(0, 0, 1, D.bd | D.rd), 1).Oa();
  3066. var Kc;
  3067. S.TopLeftSides = Kc = bc(new S(0, 0, 1, D.Ad | D.bd), 1).Oa();
  3068. var Lc;
  3069. S.TopRightSides = Lc = bc(new S(0, 0, 1, D.Ad | D.rd), 1).Oa();
  3070. var Mc;
  3071. S.BottomLeftSides = Mc = bc(new S(0, 0, 1, D.qd | D.bd), 1).Oa();
  3072. var Nc;
  3073. S.BottomRightSides = Nc = bc(new S(0, 0, 1, D.qd | D.rd), 1).Oa();
  3074. var Oc;
  3075. S.NotTopSide = Oc = bc(new S(0, 0, 1, D.bd | D.rd | D.qd), 1).Oa();
  3076. var Pc;
  3077. S.NotLeftSide = Pc = bc(new S(0, 0, 1, D.Ad | D.rd | D.qd), 1).Oa();
  3078. var Sc;
  3079. S.NotRightSide = Sc = bc(new S(0, 0, 1, D.Ad | D.bd | D.qd), 1).Oa();
  3080. var Tc;
  3081. S.NotBottomSide = Tc = bc(new S(0, 0, 1, D.Ad | D.bd | D.rd), 1).Oa();
  3082. var Uc;
  3083. S.AllSides = Uc = bc(new S(0, 0, 1, D.Ad | D.bd | D.rd | D.qd), 1).Oa();
  3084. function hd() { this.ac = [1, 0, 0, 1, 0, 0] }
  3085. hd.prototype.copy = function() {
  3086. var a = new hd;
  3087. a.ac[0] = this.ac[0];
  3088. a.ac[1] = this.ac[1];
  3089. a.ac[2] = this.ac[2];
  3090. a.ac[3] = this.ac[3];
  3091. a.ac[4] = this.ac[4];
  3092. a.ac[5] = this.ac[5];
  3093. return a
  3094. };
  3095. hd.prototype.translate = function(a, b) {
  3096. this.ac[4] += this.ac[0] * a + this.ac[2] * b;
  3097. this.ac[5] += this.ac[1] * a + this.ac[3] * b
  3098. };
  3099. hd.prototype.scale = function(a, b) {
  3100. this.ac[0] *= a;
  3101. this.ac[1] *= a;
  3102. this.ac[2] *= b;
  3103. this.ac[3] *= b
  3104. };
  3105. function id(a) {
  3106. this.type = a;
  3107. this.r2 = this.y2 = this.x2 = this.r1 = this.y1 = this.x1 = 0;
  3108. this.hF = [];
  3109. this.pattern = null
  3110. }
  3111. id.prototype.addColorStop = function(a, b) { this.hF.push({ offset: a, color: b }) };
  3112. function qd(a, b, c) {
  3113. this.fillStyle = "#000000";
  3114. this.font = "10px sans-serif";
  3115. this.globalAlpha = 1;
  3116. this.lineCap = "butt";
  3117. this.bo = 0;
  3118. this.lineJoin = "miter";
  3119. this.lineWidth = 1;
  3120. this.miterLimit = 10;
  3121. this.shadowBlur = 0;
  3122. this.shadowColor = "rgba(0, 0, 0, 0)";
  3123. this.shadowOffsetY = this.shadowOffsetX = 0;
  3124. this.strokeStyle = "#000000";
  3125. this.textAlign = "start";
  3126. this.eq = !1;
  3127. this.Pg = this.Gt = this.Ft = 0;
  3128. this.document = b || document;
  3129. this.BF = c;
  3130. this.ny = null;
  3131. this.path = [];
  3132. this.Mh = new hd;
  3133. this.stack = [];
  3134. this.xf = [];
  3135. this.Rx = a;
  3136. this.XJ = "http://www.w3.org/2000/svg";
  3137. this.width = this.Rx.width;
  3138. this.height = this.Rx.height;
  3139. this.Em = rd(this, "svg", { width: this.width + "px", height: this.height + "px", viewBox: "0 0 " + this.Rx.width + " " + this.Rx.height });
  3140. this.Em.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2000/svg");
  3141. this.Em.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink");
  3142. sd(this, 1, 0, 0, 1, 0, 0);
  3143. a = D.Km++;
  3144. b = rd(this, "clipPath", { id: "mainClip" + a });
  3145. b.appendChild(rd(this, "rect", { x: 0, y: 0, width: this.width, height: this.height }));
  3146. this.Em.appendChild(b);
  3147. this.xf[0].setAttributeNS(null, "clip-path", "url(#mainClip" + a + ")")
  3148. }
  3149. f = qd.prototype;
  3150. f.arc = function(a, b, c, d, e, g) { td(this, a, b, c, d, e, g) };
  3151. f.beginPath = function() { this.path = [] };
  3152. f.bezierCurveTo = function(a, b, c, d, e, g) { this.path.push(["C", a, b, c, d, e, g]) };
  3153. f.clearRect = function() {};
  3154. f.clip = function() { ud(this, "clipPath", this.path, new hd) };
  3155. f.closePath = function() { this.path.push(["z"]) };
  3156. f.createLinearGradient = function(a, b, c, d) {
  3157. var e = new id("linear");
  3158. e.x1 = a;
  3159. e.y1 = b;
  3160. e.x2 = c;
  3161. e.y2 = d;
  3162. return e
  3163. };
  3164. f.createPattern = function() { return null };
  3165. f.createRadialGradient = function(a, b, c, d, e, g) {
  3166. var h = new id("radial");
  3167. h.x1 = a;
  3168. h.y1 = b;
  3169. h.r1 = c;
  3170. h.x2 = d;
  3171. h.y2 = e;
  3172. h.r2 = g;
  3173. return h
  3174. };
  3175. f.drawImage = function(a, b, c, d, e, g, h, k, l) {
  3176. var m = "";
  3177. a instanceof HTMLCanvasElement && (m = a.toDataURL());
  3178. a instanceof HTMLImageElement && (m = a.src);
  3179. void 0 === d && (g = b, h = c, k = d = a.naturalWidth, l = e = a.naturalHeight);
  3180. d = d || 0;
  3181. e = e || 0;
  3182. g = g || 0;
  3183. h = h || 0;
  3184. k = k || 0;
  3185. l = l || 0;
  3186. m = { x: 0, y: 0, width: a.naturalWidth, height: a.naturalHeight, href: m, preserveAspectRatio: "xMidYMid slice" };
  3187. Eb(d, k) && Eb(e, l) || (m.preserveAspectRatio = "none");
  3188. var n = "";
  3189. k /= d;
  3190. l /= e;
  3191. if (0 !== g || 0 !== h) n += " translate(" + g + ", " + h + ")";
  3192. if (1 !== k || 1 !== l) n += " scale(" + k + ", " + l + ")";
  3193. if (0 !==
  3194. b || 0 !== c) n += " translate(" + -b + ", " + -c + ")";
  3195. if (0 !== b || 0 !== c || d !== a.naturalWidth || e !== a.naturalHeight) a = "CLIP" + D.Km++, g = rd(this, "clipPath", { id: a }), g.appendChild(rd(this, "rect", { x: b, y: c, width: d, height: e })), this.Em.appendChild(g), m["clip-path"] = "url(#" + a + ")";
  3196. Ed(this, "image", m, this.Mh, n);
  3197. this.addElement("image", m)
  3198. };
  3199. f.fill = function() { ud(this, "fill", this.path, this.Mh) };
  3200. f.Xg = function() { this.eq ? this.clip() : this.fill() };
  3201. f.fillRect = function(a, b, c, d) { Fd(this, "fill", [a, b, c, d], this.Mh) };
  3202. f.fillText = function(a, b, c) {
  3203. a = [a, b, c];
  3204. b = this.textAlign;
  3205. "left" === b ? b = "start" : "right" === b ? b = "end" : "center" === b && (b = "middle");
  3206. b = { x: a[1], y: a[2], style: "font: " + this.font, "text-anchor": b };
  3207. Ed(this, "fill", b, this.Mh);
  3208. this.addElement("text", b, a[0])
  3209. };
  3210. f.lineTo = function(a, b) { this.path.push(["L", a, b]) };
  3211. f.moveTo = function(a, b) { this.path.push(["M", a, b]) };
  3212. f.quadraticCurveTo = function(a, b, c, d) { this.path.push(["Q", a, b, c, d]) };
  3213. f.rect = function(a, b, c, d) { this.path.push(["M", a, b], ["L", a + c, b], ["L", a + c, b + d], ["L", a, b + d], ["z"]) };
  3214. f.restore = function() {
  3215. this.Mh = this.stack.pop();
  3216. this.path = this.stack.pop();
  3217. var a = this.stack.pop();
  3218. this.fillStyle = a.fillStyle;
  3219. this.font = a.font;
  3220. this.globalAlpha = a.globalAlpha;
  3221. this.lineCap = a.lineCap;
  3222. this.bo = a.bo;
  3223. this.lineJoin = a.lineJoin;
  3224. this.lineWidth = a.lineWidth;
  3225. this.miterLimit = a.miterLimit;
  3226. this.shadowBlur = a.shadowBlur;
  3227. this.shadowColor = a.shadowColor;
  3228. this.shadowOffsetX = a.shadowOffsetX;
  3229. this.shadowOffsetY = a.shadowOffsetY;
  3230. this.strokeStyle = a.strokeStyle;
  3231. this.textAlign = a.textAlign
  3232. };
  3233. f.save = function() {
  3234. this.stack.push({ fillStyle: this.fillStyle, font: this.font, globalAlpha: this.globalAlpha, lineCap: this.lineCap, bo: this.bo, lineJoin: this.lineJoin, lineWidth: this.lineWidth, miterLimit: this.miterLimit, shadowBlur: this.shadowBlur, shadowColor: this.shadowColor, shadowOffsetX: this.shadowOffsetX, shadowOffsetY: this.shadowOffsetY, strokeStyle: this.strokeStyle, textAlign: this.textAlign });
  3235. for (var a = [], b = 0; b < this.path.length; b++) a.push(this.path[b]);
  3236. this.stack.push(a);
  3237. this.stack.push(this.Mh.copy())
  3238. };
  3239. f.setTransform = function(a, b, c, d, e, g) { 1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === g || sd(this, a, b, c, d, e, g) };
  3240. f.scale = function(a, b) { this.Mh.scale(a, b) };
  3241. f.translate = function(a, b) { this.Mh.translate(a, b) };
  3242. f.transform = function() {};
  3243. f.stroke = function() { ud(this, "stroke", this.path, this.Mh) };
  3244. f.Zj = function() { this.eq || this.stroke() };
  3245. f.strokeRect = function(a, b, c, d) { Fd(this, "stroke", [a, b, c, d], this.Mh) };
  3246. function rd(a, b, c, d) {
  3247. a = a.document.createElementNS(a.XJ, b);
  3248. if (D.Qa(c))
  3249. for (var e in c) a.setAttributeNS("href" === e ? "http://www.w3.org/1999/xlink" : "", e, c[e]);
  3250. void 0 !== d && (a.textContent = d);
  3251. return a
  3252. }
  3253. f.addElement = function(a, b, c) {
  3254. a = rd(this, a, b, c);
  3255. 0 < this.xf.length ? this.xf[this.xf.length - 1].appendChild(a) : this.Em.appendChild(a);
  3256. return this.ny = a
  3257. };
  3258. function Ed(a, b, c, d, e) {
  3259. 1 !== a.globalAlpha && (c.opacity = a.globalAlpha);
  3260. "fill" === b ? (a.fillStyle instanceof id ? c.fill = Gd(a, a.fillStyle) : (/^rgba\(/.test(a.fillStyle) && (b = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle), c.fill = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")", c["fill-opacity"] = b[4]), c.fill = a.fillStyle), c.stroke = "none") : "stroke" === b && (c.fill = "none", a.strokeStyle instanceof id ? c.stroke = Gd(a, a.strokeStyle) : (/^rgba\(/.test(a.strokeStyle) && (b = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle),
  3261. c.stroke = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")", c["stroke-opacity"] = b[4]), c.stroke = a.strokeStyle), c["stroke-width"] = a.lineWidth, c["stroke-linecap"] = a.lineCap, c["stroke-linejoin"] = a.lineJoin, c["stroke-miterlimit"] = a.miterLimit);
  3262. a = d.ac;
  3263. a = "matrix(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ")";
  3264. void 0 !== e && (a += e);
  3265. c.transform = a
  3266. }
  3267. function Gd(a, b) {
  3268. var c = "GRAD" + D.Km++,
  3269. d;
  3270. if ("linear" === b.type) d = rd(a, "linearGradient", { x1: b.x1, x2: b.x2, y1: b.y1, y2: b.y2, id: c, gradientUnits: "userSpaceOnUse" });
  3271. else if ("radial" === b.type) d = rd(a, "radialGradient", { x1: b.x1, x2: b.x2, y1: b.y1, y2: b.y2, r1: b.r1, r2: b.r2, id: c });
  3272. else if ("pattern" === b.type) {
  3273. var e = b.pattern;
  3274. d = { width: e.width, height: e.height, id: c, patternUnits: "userSpaceOnUse" };
  3275. var g = "";
  3276. e instanceof HTMLCanvasElement && (g = e.toDataURL());
  3277. e instanceof HTMLImageElement && (g = e.src);
  3278. e = {
  3279. x: 0,
  3280. y: 0,
  3281. width: e.width,
  3282. height: e.height,
  3283. href: g
  3284. };
  3285. d = rd(a, "pattern", d);
  3286. d.appendChild(rd(a, "image", e))
  3287. } else throw Error("invalid gradient");
  3288. for (var e = b.hF, g = e.length, h = [], k = 0; k < g; k++) {
  3289. var l = e[k],
  3290. m = l.color,
  3291. l = { offset: l.offset, "stop-color": m };
  3292. /^rgba\(/.test(m) && (m = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m), l["stop-color"] = "rgb(" + m[1] + "," + m[2] + "," + m[3] + ")", l["stop-opacity"] = m[4]);
  3293. h.push(l)
  3294. }
  3295. h.sort(function(a, b) { return a.offset > b.offset ? 1 : -1 });
  3296. for (k = 0; k < g; k++) d.appendChild(rd(a, "stop", h[k]));
  3297. a.Em.appendChild(d);
  3298. return "url(#" + c + ")"
  3299. }
  3300. function Fd(a, b, c, d) {
  3301. c = { x: c[0], y: c[1], width: c[2], height: c[3] };
  3302. Ed(a, b, c, d);
  3303. a.addElement("rect", c)
  3304. }
  3305. function ud(a, b, c, d) {
  3306. for (var e = [], g = 0; g < c.length; g++) {
  3307. var h = D.km(c[g]),
  3308. k = [h.shift()];
  3309. if ("A" === k[0]) k.push(h.shift() + "," + h.shift(), h.shift(), h.shift() + "," + h.shift(), h.shift() + "," + h.shift());
  3310. else
  3311. for (; h.length;) k.push(h.shift() + "," + h.shift());
  3312. e.push(k.join(" "))
  3313. }
  3314. c = { d: e.join(" ") };
  3315. Ed(a, b, c, d);
  3316. "clipPath" === b ? (b = "CLIP" + D.Km++, d = rd(a, "clipPath", { id: b }), d.appendChild(rd(a, "path", c)), a.Em.appendChild(d), 0 < a.xf.length && a.xf[a.xf.length - 1].setAttributeNS(null, "clip-path", "url(#" + b + ")")) : a.addElement("path",
  3317. c)
  3318. }
  3319. function td(a, b, c, d, e, g, h) {
  3320. var k = Math.abs(e - g);
  3321. if (e !== g) {
  3322. var l = b + d * Math.cos(g);
  3323. g = c + d * Math.sin(g);
  3324. k >= 2 * Math.PI ? (td(a, b, c, d, e, e + Math.PI, h), td(a, b, c, d, e + Math.PI, e + 2 * Math.PI, h), a.path.push(["M", l, g])) : (b += d * Math.cos(e), c += d * Math.sin(e), k = 180 * k / Math.PI, e = h ? 0 : 1, h = 180 <= k === !!h ? 0 : 1, 0 !== a.path.length ? a.path.push(["L", b, c]) : a.path.push(["M", b, c]), a.path.push(["A", d, d, k, h, e, l, g]))
  3325. }
  3326. }
  3327. function sd(a, b, c, d, e, g, h) {
  3328. var k = new hd;
  3329. k.ac = [b, c, d, e, g, h];
  3330. b = {};
  3331. Ed(a, "g", b, k);
  3332. k = a.addElement("g", b);
  3333. a.xf.push(k)
  3334. }
  3335. f.jb = function() {
  3336. if (0 !== this.shadowOffsetX || 0 !== this.shadowOffsetY || 0 !== this.shadowBlur) {
  3337. var a = "SHADOW" + D.Km++,
  3338. b = this.addElement("filter", { id: a, x: "-100%", y: "-100%", width: "300%", height: "300%" }, null),
  3339. c, d, e, g, h;
  3340. c = rd(this, "feGaussianBlur", { "in": "SourceAlpha", result: "blur", IM: this.shadowBlur / 2 });
  3341. d = rd(this, "feFlood", { "in": "blur", result: "flood", "flood-color": this.shadowColor });
  3342. e = rd(this, "feComposite", { "in": "flood", in2: "blur", operator: "in", result: "comp" });
  3343. g = rd(this, "feOffset", {
  3344. "in": "comp",
  3345. result: "offsetBlur",
  3346. dx: this.shadowOffsetX,
  3347. dy: this.shadowOffsetY
  3348. });
  3349. h = rd(this, "feMerge", {});
  3350. h.appendChild(rd(this, "feMergeNode", { "in": "offsetBlur" }));
  3351. h.appendChild(rd(this, "feMergeNode", { "in": "SourceGraphic" }));
  3352. b.appendChild(c);
  3353. b.appendChild(d);
  3354. b.appendChild(e);
  3355. b.appendChild(g);
  3356. b.appendChild(h);
  3357. 0 < this.xf.length && this.xf[this.xf.length - 1].setAttributeNS(null, "filter", "url(#" + a + ")")
  3358. }
  3359. };
  3360. f.fC = function(a, b, c) {
  3361. this.Ft = a;
  3362. this.Gt = b;
  3363. this.Pg = c
  3364. };
  3365. f.Cm = function() { this.shadowBlur = this.shadowOffsetY = this.shadowOffsetX = 0 };
  3366. f.wo = function() {
  3367. this.shadowOffsetX = this.Ft;
  3368. this.shadowOffsetY = this.Gt;
  3369. this.shadowBlur = this.Pg
  3370. };
  3371. f.YA = function() { return !1 };
  3372. f.TA = function() {};
  3373. f.De = function() {};
  3374. f.Sy = function() {};
  3375. qd.prototype.rotate = function() {};
  3376. function ja(a, b) {
  3377. this.ownerDocument = void 0 === b ? document : b;
  3378. var c = this.ownerDocument.createElement("canvas");
  3379. c.tabIndex = 0;
  3380. this.$d = c;
  3381. this.Tk = new Hd(c);
  3382. c.ca = a;
  3383. Object.seal(this)
  3384. }
  3385. f = ja.prototype;
  3386. f.toDataURL = function(a, b) { return this.$d.toDataURL(a, b) };
  3387. f.getBoundingClientRect = function() { return this.$d.getBoundingClientRect() };
  3388. f.focus = function() { return this.$d.focus() };
  3389. f.addEventListener = function(a, b, c) { this.$d.addEventListener(a, b, c) };
  3390. f.removeEventListener = function(a, b, c) { this.$d.removeEventListener(a, b, c) };
  3391. D.defineProperty(ja, { width: "width" }, function() { return this.$d.width }, function(a) { this.$d.width = a });
  3392. D.defineProperty(ja, { height: "height" }, function() { return this.$d.height }, function(a) { this.$d.height = a });
  3393. D.w(ja, { style: "style" }, function() { return this.$d.style });
  3394. function Hd(a) {
  3395. a.getContext && a.getContext("2d") || D.k("Browser does not support HTML Canvas Element");
  3396. this.za = a.getContext("2d");
  3397. this.qz = this.sz = this.rz = "";
  3398. this.vr = !1;
  3399. this.Pg = this.Gt = this.Ft = 0;
  3400. Object.seal(this)
  3401. }
  3402. Hd.prototype.Sy = function(a) { this.za.lB = a };
  3403. D.defineProperty(Hd, { fillStyle: "fillStyle" }, function() { return this.za.fillStyle }, function(a) { this.qz !== a && (this.qz = this.za.fillStyle = a) });
  3404. D.defineProperty(Hd, { font: "font" }, function() { return this.za.font }, function(a) { this.rz !== a && (this.rz = this.za.font = a) });
  3405. D.defineProperty(Hd, { globalAlpha: "globalAlpha" }, function() { return this.za.globalAlpha }, function(a) { this.za.globalAlpha = a });
  3406. D.defineProperty(Hd, { lineCap: "lineCap" }, function() { return this.za.lineCap }, function(a) { this.za.lineCap = a });
  3407. D.defineProperty(Hd, { bo: "lineDashOffset" }, function() { return this.za.bo }, function(a) { this.za.bo = a });
  3408. D.defineProperty(Hd, { lineJoin: "lineJoin" }, function() { return this.za.lineJoin }, function(a) { this.za.lineJoin = a });
  3409. D.defineProperty(Hd, { lineWidth: "lineWidth" }, function() { return this.za.lineWidth }, function(a) { this.za.lineWidth = a });
  3410. D.defineProperty(Hd, { miterLimit: "miterLimit" }, function() { return this.za.miterLimit }, function(a) { this.za.miterLimit = a });
  3411. D.defineProperty(Hd, { shadowBlur: "shadowBlur" }, function() { return this.za.shadowBlur }, function(a) { this.za.shadowBlur = a });
  3412. D.defineProperty(Hd, { shadowColor: "shadowColor" }, function() { return this.za.shadowColor }, function(a) { this.za.shadowColor = a });
  3413. D.defineProperty(Hd, { shadowOffsetX: "shadowOffsetX" }, function() { return this.za.shadowOffsetX }, function(a) { this.za.shadowOffsetX = a });
  3414. D.defineProperty(Hd, { shadowOffsetY: "shadowOffsetY" }, function() { return this.za.shadowOffsetY }, function(a) { this.za.shadowOffsetY = a });
  3415. D.defineProperty(Hd, { strokeStyle: "strokeStyle" }, function() { return this.za.strokeStyle }, function(a) { this.sz !== a && (this.sz = this.za.strokeStyle = a) });
  3416. D.defineProperty(Hd, { textAlign: "textAlign" }, function() { return this.za.textAlign }, function(a) { this.za.textAlign = a });
  3417. D.defineProperty(Hd, { lB: "imageSmoothingEnabled" }, function() { return this.za.lB }, function(a) { this.za.lB = a });
  3418. f = Hd.prototype;
  3419. f.arc = function(a, b, c, d, e, g) { this.za.arc(a, b, c, d, e, g) };
  3420. f.beginPath = function() { this.za.beginPath() };
  3421. f.bezierCurveTo = function(a, b, c, d, e, g) { this.za.bezierCurveTo(a, b, c, d, e, g) };
  3422. f.clearRect = function(a, b, c, d) { this.za.clearRect(a, b, c, d) };
  3423. f.clip = function() { this.za.clip() };
  3424. f.closePath = function() { this.za.closePath() };
  3425. f.createLinearGradient = function(a, b, c, d) { return this.za.createLinearGradient(a, b, c, d) };
  3426. f.createPattern = function(a, b) { return this.za.createPattern(a, b) };
  3427. f.createRadialGradient = function(a, b, c, d, e, g) { return this.za.createRadialGradient(a, b, c, d, e, g) };
  3428. f.drawImage = function(a, b, c, d, e, g, h, k, l) { void 0 === d ? this.za.drawImage(a, b, c) : this.za.drawImage(a, b, c, d, e, g, h, k, l) };
  3429. f.fill = function() { this.za.fill() };
  3430. f.fillRect = function(a, b, c, d) { this.za.fillRect(a, b, c, d) };
  3431. f.fillText = function(a, b, c) { this.za.fillText(a, b, c) };
  3432. f.getImageData = function(a, b, c, d) { return this.za.getImageData(a, b, c, d) };
  3433. f.lineTo = function(a, b) { this.za.lineTo(a, b) };
  3434. f.measureText = function(a) { return this.za.measureText(a) };
  3435. f.moveTo = function(a, b) { this.za.moveTo(a, b) };
  3436. f.quadraticCurveTo = function(a, b, c, d) { this.za.quadraticCurveTo(a, b, c, d) };
  3437. f.rect = function(a, b, c, d) { this.za.rect(a, b, c, d) };
  3438. f.restore = function() { this.za.restore() };
  3439. Hd.prototype.rotate = function(a) { this.za.rotate(a) };
  3440. f = Hd.prototype;
  3441. f.save = function() { this.za.save() };
  3442. f.setTransform = function(a, b, c, d, e, g) { this.za.setTransform(a, b, c, d, e, g) };
  3443. f.scale = function(a, b) { this.za.scale(a, b) };
  3444. f.stroke = function() { this.za.stroke() };
  3445. f.transform = function(a, b, c, d, e, g) { 1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === g || this.za.transform(a, b, c, d, e, g) };
  3446. f.translate = function(a, b) { this.za.translate(a, b) };
  3447. f.Xg = function(a) {
  3448. if (a instanceof Ba && a.type === Id) {
  3449. var b = a.Mo;
  3450. a = a.xz;
  3451. a > b ? (this.scale(b / a, 1), this.translate((a - b) / 2, 0)) : b > a && (this.scale(1, a / b), this.translate(0, (b - a) / 2));
  3452. this.vr ? this.clip() : this.fill();
  3453. a > b ? (this.translate(-(a - b) / 2, 0), this.scale(1 / (b / a), 1)) : b > a && (this.translate(0, -(b - a) / 2), this.scale(1, 1 / (a / b)))
  3454. } else this.vr ? this.clip() : this.fill()
  3455. };
  3456. f.Zj = function() { this.vr || this.stroke() };
  3457. D.defineProperty(Hd, { eq: "clipInsteadOfFill" }, function() { return this.vr }, function(a) { this.vr = a });
  3458. f = Hd.prototype;
  3459. f.fC = function(a, b, c) {
  3460. this.Ft = a;
  3461. this.Gt = b;
  3462. this.Pg = c
  3463. };
  3464. f.Cm = function() { this.shadowBlur = this.shadowOffsetY = this.shadowOffsetX = 0 };
  3465. f.wo = function() {
  3466. this.shadowOffsetX = this.Ft;
  3467. this.shadowOffsetY = this.Gt;
  3468. this.shadowBlur = this.Pg
  3469. };
  3470. f.YA = function(a, b) {
  3471. var c = this.za;
  3472. if (void 0 !== c.setLineDash) c.setLineDash(a), c.lineDashOffset = b;
  3473. else if (void 0 !== c.webkitLineDash) c.webkitLineDash = a, c.webkitLineDashOffset = b;
  3474. else return !1;
  3475. return !0
  3476. };
  3477. f.TA = function() {
  3478. var a = this.za;
  3479. void 0 !== a.setLineDash ? (a.setLineDash(D.Do), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash && (a.webkitLineDash = D.Do, a.webkitLineDashOffset = 0)
  3480. };
  3481. f.De = function(a) {
  3482. a && (this.rz = "");
  3483. this.qz = this.sz = ""
  3484. };
  3485. var Jd = (Math.sqrt(2) - 1) / 3 * 4,
  3486. Kd = (new N(0, 0)).Oa(),
  3487. Ld = (new C(0, 0, 0, 0)).Oa(),
  3488. Sd = (new Lb(0, 0, 0, 0)).Oa(),
  3489. Td = (new Lb(2, 2, 2, 2)).Oa(),
  3490. Ud = (new N(6, 6)).Oa(),
  3491. Vd = (new N(-Infinity, -Infinity)).Oa(),
  3492. Wd = (new N(Infinity, Infinity)).Oa(),
  3493. Xd = (new Ca(0, 0)).Oa(),
  3494. Yd = (new Ca(1, 1)).Oa(),
  3495. Zd = (new Ca(6, 6)).Oa(),
  3496. $d = (new Ca(8, 8)).Oa(),
  3497. ae = (new Ca(10, 10)).Oa(),
  3498. ge = (new Ca(Infinity, Infinity)).Oa(),
  3499. he = (new N(NaN, NaN)).Oa(),
  3500. ie = (new Ca(NaN, NaN)).Oa(),
  3501. je = (new C(NaN, NaN, NaN, NaN)).Oa(),
  3502. ke = (new S(.156, .156)).Oa(),
  3503. le = (new S(.844, .844)).Oa(),
  3504. me = new ma,
  3505. ne = new ma,
  3506. oe = null;
  3507. function pe(a) {
  3508. if (0 >= a) return 0;
  3509. var b = oe;
  3510. if (null === b) {
  3511. for (var b = [], c = 0; 2E3 >= c; c++) b[c] = Math.sqrt(c);
  3512. oe = b
  3513. }
  3514. return 1 > a ? (c = 1 / a, 2E3 >= c ? 1 / b[c | 0] : Math.sqrt(a)) : 2E3 >= a ? b[a | 0] : Math.sqrt(a)
  3515. }
  3516. function Q(a, b) { var c = a - b; return .5 > c && -.5 < c }
  3517. function Eb(a, b) { var c = a - b; return 5E-8 > c && -5E-8 < c }
  3518. function qe(a, b, c, d, e, g, h) {
  3519. 0 >= e && (e = 1E-6);
  3520. var k = 0,
  3521. l = 0,
  3522. m = 0,
  3523. n = 0;
  3524. a < c ? (l = a, k = c) : (l = c, k = a);
  3525. b < d ? (n = b, m = d) : (n = d, m = b);
  3526. if (a === c) return n <= h && h <= m && a - e <= g && g <= a + e;
  3527. if (b === d) return l <= g && g <= k && b - e <= h && h <= b + e;
  3528. k += e;
  3529. l -= e;
  3530. if (l <= g && g <= k && (m += e, n -= e, n <= h && h <= m))
  3531. if (k - l > m - n)
  3532. if (a - c > e || c - a > e) { if (g = (d - b) / (c - a) * (g - a) + b, g - e <= h && h <= g + e) return !0 } else return !0;
  3533. else if (b - d > e || d - b > e) { if (h = (c - a) / (d - b) * (h - b) + a, h - e <= g && g <= h + e) return !0 } else return !0;
  3534. return !1
  3535. }
  3536. function re(a, b, c, d, e, g, h, k, l, m, n, p) {
  3537. if (qe(a, b, h, k, p, c, d) && qe(a, b, h, k, p, e, g)) return qe(a, b, h, k, p, m, n);
  3538. var q = (a + c) / 2,
  3539. r = (b + d) / 2,
  3540. s = (c + e) / 2,
  3541. u = (d + g) / 2;
  3542. e = (e + h) / 2;
  3543. g = (g + k) / 2;
  3544. d = (q + s) / 2;
  3545. c = (r + u) / 2;
  3546. var s = (s + e) / 2,
  3547. u = (u + g) / 2,
  3548. t = (d + s) / 2,
  3549. y = (c + u) / 2;
  3550. return re(a, b, q, r, d, c, t, y, l, m, n, p) || re(t, y, s, u, e, g, h, k, l, m, n, p)
  3551. }
  3552. function Ae(a, b, c, d, e, g, h, k, l, m) {
  3553. if (qe(a, b, h, k, l, c, d) && qe(a, b, h, k, l, e, g)) Ub(m, a, b, 0, 0), Ub(m, h, k, 0, 0);
  3554. else {
  3555. var n = (a + c) / 2,
  3556. p = (b + d) / 2,
  3557. q = (c + e) / 2,
  3558. r = (d + g) / 2;
  3559. e = (e + h) / 2;
  3560. g = (g + k) / 2;
  3561. d = (n + q) / 2;
  3562. c = (p + r) / 2;
  3563. var q = (q + e) / 2,
  3564. r = (r + g) / 2,
  3565. s = (d + q) / 2,
  3566. u = (c + r) / 2;
  3567. Ae(a, b, n, p, d, c, s, u, l, m);
  3568. Ae(s, u, q, r, e, g, h, k, l, m)
  3569. }
  3570. }
  3571. function Be(a, b, c, d, e, g, h, k, l, m) {
  3572. if (qe(a, b, h, k, l, c, d) && qe(a, b, h, k, l, e, g)) 0 === m.length && (m.push(a), m.push(b)), m.push(h), m.push(k);
  3573. else {
  3574. var n = (a + c) / 2,
  3575. p = (b + d) / 2,
  3576. q = (c + e) / 2,
  3577. r = (d + g) / 2;
  3578. e = (e + h) / 2;
  3579. g = (g + k) / 2;
  3580. d = (n + q) / 2;
  3581. c = (p + r) / 2;
  3582. var q = (q + e) / 2,
  3583. r = (r + g) / 2,
  3584. s = (d + q) / 2,
  3585. u = (c + r) / 2;
  3586. Be(a, b, n, p, d, c, s, u, l, m);
  3587. Be(s, u, q, r, e, g, h, k, l, m)
  3588. }
  3589. }
  3590. function Ce(a, b, c, d, e, g, h, k, l, m, n, p, q, r) {
  3591. var s = 1 - l;
  3592. a = a * s + c * l;
  3593. b = b * s + d * l;
  3594. c = c * s + e * l;
  3595. d = d * s + g * l;
  3596. e = e * s + h * l;
  3597. g = g * s + k * l;
  3598. k = a * s + c * l;
  3599. h = b * s + d * l;
  3600. c = c * s + e * l;
  3601. d = d * s + g * l;
  3602. m.x = a;
  3603. m.y = b;
  3604. n.x = k;
  3605. n.y = h;
  3606. p.x = k * s + c * l;
  3607. p.y = h * s + d * l;
  3608. q.x = c;
  3609. q.y = d;
  3610. r.x = e;
  3611. r.y = g
  3612. }
  3613. function De(a, b, c, d, e, g, h, k, l, m) {
  3614. if (qe(a, b, e, g, m, c, d)) return qe(a, b, e, g, m, k, l);
  3615. var n = (a + c) / 2,
  3616. p = (b + d) / 2;
  3617. c = (c + e) / 2;
  3618. d = (d + g) / 2;
  3619. var q = (n + c) / 2,
  3620. r = (p + d) / 2;
  3621. return De(a, b, n, p, q, r, h, k, l, m) || De(q, r, c, d, e, g, h, k, l, m)
  3622. }
  3623. function Ee(a, b, c, d, e, g, h, k) {
  3624. if (qe(a, b, e, g, h, c, d)) Ub(k, a, b, 0, 0), Ub(k, e, g, 0, 0);
  3625. else {
  3626. var l = (a + c) / 2,
  3627. m = (b + d) / 2;
  3628. c = (c + e) / 2;
  3629. d = (d + g) / 2;
  3630. var n = (l + c) / 2,
  3631. p = (m + d) / 2;
  3632. Ee(a, b, l, m, n, p, h, k);
  3633. Ee(n, p, c, d, e, g, h, k)
  3634. }
  3635. }
  3636. function Fe(a, b, c, d, e, g, h, k) {
  3637. if (qe(a, b, e, g, h, c, d)) 0 === k.length && (k.push(a), k.push(b)), k.push(e), k.push(g);
  3638. else {
  3639. var l = (a + c) / 2,
  3640. m = (b + d) / 2;
  3641. c = (c + e) / 2;
  3642. d = (d + g) / 2;
  3643. var n = (l + c) / 2,
  3644. p = (m + d) / 2;
  3645. Fe(a, b, l, m, n, p, h, k);
  3646. Fe(n, p, c, d, e, g, h, k)
  3647. }
  3648. }
  3649. function Ge(a, b, c, d, e, g, h, k, l, m, n, p, q, r) {
  3650. 0 >= q && (q = 1E-6);
  3651. if (qe(a, b, h, k, q, c, d) && qe(a, b, h, k, q, e, g)) {
  3652. var s = (a - h) * (m - p) - (b - k) * (l - n);
  3653. if (0 === s) return !1;
  3654. q = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / s;
  3655. s = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / s;
  3656. if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) { if (h = l = 0, b < k ? (l = b, h = k) : (l = k, h = b), s < l || s > h) return !1 } else if (a < h ? l = a : (l = h, h = a), q < l || q > h) return !1;
  3657. r.x = q;
  3658. r.y = s;
  3659. return !0
  3660. }
  3661. var s = (a + c) / 2,
  3662. u = (b + d) / 2;
  3663. c = (c + e) / 2;
  3664. d = (d + g) / 2;
  3665. e = (e + h) / 2;
  3666. g = (g + k) / 2;
  3667. var t = (s + c) / 2,
  3668. y = (u + d) / 2;
  3669. c = (c + e) / 2;
  3670. d = (d + g) / 2;
  3671. var w = (t + c) / 2,
  3672. A = (y + d) / 2,
  3673. B = (n - l) * (n - l) + (p - m) * (p - m),
  3674. P = !1;
  3675. Ge(a, b, s, u, t, y, w, A, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < B && (B = b, P = !0));
  3676. a = r.x;
  3677. s = r.y;
  3678. Ge(w, A, c, d, e, g, h, k, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < B ? P = !0 : (r.x = a, r.y = s));
  3679. return P
  3680. }
  3681. function He(a, b, c, d, e, g, h, k, l, m, n, p, q) {
  3682. var r = 0;
  3683. 0 >= q && (q = 1E-6);
  3684. if (qe(a, b, h, k, q, c, d) && qe(a, b, h, k, q, e, g)) {
  3685. q = (a - h) * (m - p) - (b - k) * (l - n);
  3686. if (0 === q) return r;
  3687. var s = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / q,
  3688. u = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / q;
  3689. if (s >= n) return r;
  3690. if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) { if (a = l = 0, b < k ? (l = b, a = k) : (l = k, a = b), u < l || u > a) return r } else if (a < h ? (l = a, a = h) : l = h, s < l || s > a) return r;
  3691. 0 < q ? r++ : 0 > q && r--
  3692. } else {
  3693. var s = (a + c) / 2,
  3694. u = (b + d) / 2,
  3695. t = (c + e) / 2,
  3696. y = (d + g) / 2;
  3697. e = (e + h) / 2;
  3698. g = (g + k) / 2;
  3699. d = (s + t) / 2;
  3700. c = (u + y) / 2;
  3701. var t = (t + e) / 2,
  3702. y = (y + g) / 2,
  3703. w = (d + t) / 2,
  3704. A = (c + y) / 2,
  3705. r = r + He(a, b, s, u, d, c, w, A, l, m, n, p, q),
  3706. r = r + He(w, A, t, y, e, g, h, k, l, m, n, p, q)
  3707. }
  3708. return r
  3709. }
  3710. function fb(a, b, c, d, e, g, h) {
  3711. if (Eb(a, c)) {
  3712. var k = 0;
  3713. c = 0;
  3714. b < d ? (k = b, c = d) : (k = d, c = b);
  3715. d = g;
  3716. if (d < k) return h.x = a, h.y = k, !1;
  3717. if (d > c) return h.x = a, h.y = c, !1;
  3718. h.x = a;
  3719. h.y = d;
  3720. return !0
  3721. }
  3722. if (Eb(b, d)) {
  3723. a < c ? k = a : (k = c, c = a);
  3724. d = e;
  3725. if (d < k) return h.x = k, h.y = b, !1;
  3726. if (d > c) return h.x = c, h.y = b, !1;
  3727. h.x = d;
  3728. h.y = b;
  3729. return !0
  3730. }
  3731. k = ((a - e) * (a - c) + (b - g) * (b - d)) / ((c - a) * (c - a) + (d - b) * (d - b));
  3732. if (-5E-6 > k) return h.x = a, h.y = b, !1;
  3733. if (1.000005 < k) return h.x = c, h.y = d, !1;
  3734. h.x = a + k * (c - a);
  3735. h.y = b + k * (d - b);
  3736. return !0
  3737. }
  3738. function Ie(a, b, c, d, e, g, h, k, l) {
  3739. if (Q(a, c) && Q(b, d)) return l.x = a, l.y = b, !1;
  3740. if (Eb(e, h)) {
  3741. if (Eb(a, c)) return fb(a, b, c, d, e, g, l), !1;
  3742. g = (d - b) / (c - a) * (e - a) + b;
  3743. return fb(a, b, c, d, e, g, l)
  3744. }
  3745. k = (k - g) / (h - e);
  3746. if (Eb(a, c)) {
  3747. g = k * (a - e) + g;
  3748. c = h = 0;
  3749. b < d ? (h = b, c = d) : (h = d, c = b);
  3750. if (g < h) return l.x = a, l.y = h, !1;
  3751. if (g > c) return l.x = a, l.y = c, !1;
  3752. l.x = a;
  3753. l.y = g;
  3754. return !0
  3755. }
  3756. h = (d - b) / (c - a);
  3757. if (Eb(k, h)) return fb(a, b, c, d, e, g, l), !1;
  3758. e = (h * a - k * e + g - b) / (h - k);
  3759. if (Eb(h, 0)) {
  3760. a < c ? h = a : (h = c, c = a);
  3761. if (e < h) return l.x = h, l.y = b, !1;
  3762. if (e > c) return l.x = c, l.y = b, !1;
  3763. l.x = e;
  3764. l.y = b;
  3765. return !0
  3766. }
  3767. g =
  3768. h * (e - a) + b;
  3769. return fb(a, b, c, d, e, g, l)
  3770. }
  3771. function Je(a, b, c, d, e, g, h, k, l) {
  3772. var m = 1E21,
  3773. n = a,
  3774. p = b;
  3775. if (Ie(a, b, a, d, e, g, h, k, l)) {
  3776. var q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g);
  3777. q < m && (m = q, n = l.x, p = l.y)
  3778. }
  3779. Ie(c, b, c, d, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
  3780. Ie(a, b, c, b, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
  3781. Ie(a, d, c, d, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
  3782. l.x = n;
  3783. l.y = p;
  3784. return 1E21 > m
  3785. }
  3786. function Ke(a, b, c, d, e, g, h, k, l) {
  3787. c = a - c;
  3788. var m = e - h,
  3789. n = h = 0;
  3790. 0 === c || 0 === m ? 0 === c ? (k = (g - k) / m, h = a, n = k * h + (g - k * e)) : (d = (b - d) / c, h = e, n = d * h + (b - d * a)) : (d = (b - d) / c, k = (g - k) / m, a = b - d * a, h = (g - k * e - a) / (d - k), n = d * h + a);
  3791. l.n(h, n);
  3792. return l
  3793. }
  3794. function Le(a, b, c) {
  3795. var d = b.x,
  3796. e = b.y,
  3797. g = c.x,
  3798. h = c.y,
  3799. k = a.left,
  3800. l = a.right,
  3801. m = a.top,
  3802. n = a.bottom;
  3803. return d === g ? (g = a = 0, e < h ? (a = e, g = h) : (a = h, g = e), k <= d && d <= l && a <= n && g >= m) : e === h ? (d < g ? a = d : (a = g, g = d), m <= e && e <= n && a <= l && g >= k) : a.Pa(b) || a.Pa(c) || Pe(k, m, l, m, d, e, g, h) || Pe(l, m, l, n, d, e, g, h) || Pe(l, n, k, n, d, e, g, h) || Pe(k, n, k, m, d, e, g, h) ? !0 : !1
  3804. }
  3805. function Pe(a, b, c, d, e, g, h, k) { return 0 >= Qe(a, b, c, d, e, g) * Qe(a, b, c, d, h, k) && 0 >= Qe(e, g, h, k, a, b) * Qe(e, g, h, k, c, d) }
  3806. function Qe(a, b, c, d, e, g) {
  3807. c -= a;
  3808. d -= b;
  3809. a = e - a;
  3810. b = g - b;
  3811. g = a * d - b * c;
  3812. 0 === g && (g = a * c + b * d, 0 < g && (g = (a - c) * c + (b - d) * d, 0 > g && (g = 0)));
  3813. return 0 > g ? -1 : 0 < g ? 1 : 0
  3814. }
  3815. function Re(a) {
  3816. 0 > a && (a += 360);
  3817. 360 <= a && (a -= 360);
  3818. return a
  3819. }
  3820. function Se(a, b, c, d) {
  3821. var e = Math.PI;
  3822. d || (b *= e / 180, c *= e / 180);
  3823. var g = b > c ? -1 : 1;
  3824. d = [];
  3825. var h = e / 2,
  3826. k = b;
  3827. c = Math.min(2 * e, Math.abs(c - b));
  3828. if (1E-5 > c) return b = k + g * Math.min(c, h), g = 0 + a * Math.cos(k), k = 0 + a * Math.sin(k), h = 0 + a * Math.cos(b), a = 0 + a * Math.sin(b), b = (g + h) / 2, c = (k + a) / 2, d.push([g, k, b, c, b, c, h, a]), d;
  3829. for (; 1E-5 < c;) {
  3830. b = k + g * Math.min(c, h);
  3831. var e = (b - k) / 2,
  3832. l = a * Math.cos(e),
  3833. m = a * Math.sin(e),
  3834. n = -m,
  3835. p = l * l + n * n,
  3836. q = p + l * l + n * m,
  3837. p = 4 / 3 * (Math.sqrt(2 * p * q) - q) / (l * m - n * l),
  3838. m = l - p * n,
  3839. l = n + p * l,
  3840. n = -l,
  3841. p = e + k,
  3842. e = Math.cos(p),
  3843. p = Math.sin(p);
  3844. d.push([0 + a * Math.cos(k),
  3845. 0 + a * Math.sin(k), 0 + m * e - l * p, 0 + m * p + l * e, 0 + m * e - n * p, 0 + m * p + n * e, 0 + a * Math.cos(b), 0 + a * Math.sin(b)
  3846. ]);
  3847. c -= Math.abs(b - k);
  3848. k = b
  3849. }
  3850. return d
  3851. }
  3852. function jb(a, b, c, d, e, g, h) {
  3853. c = Math.floor((a - c) / e) * e + c;
  3854. d = Math.floor((b - d) / g) * g + d;
  3855. var k = c;
  3856. c + e - a < e / 2 && (k = c + e);
  3857. a = d;
  3858. d + g - b < g / 2 && (a = d + g);
  3859. h.n(k, a)
  3860. }
  3861. function Te(a, b) {
  3862. var c = Math.max(a, b),
  3863. d = Math.min(a, b),
  3864. e = 1,
  3865. g = 1;
  3866. do e = c % d, c = g = d, d = e; while (0 < e);
  3867. return g
  3868. }
  3869. function Ue(a, b, c, d) {
  3870. var e = 0 > c,
  3871. g = 0 > d,
  3872. h = 0,
  3873. k = h = 0;
  3874. a < b ? (h = 1, k = 0) : (h = 0, k = 1);
  3875. var l = 0,
  3876. m = 0,
  3877. n = 0,
  3878. p = 0,
  3879. l = 0 === h ? a : b,
  3880. n = 0 === h ? c : d;
  3881. if (0 === h ? e : g) n = -n;
  3882. h = k;
  3883. m = 0 === h ? a : b;
  3884. p = 0 === h ? c : d;
  3885. if (0 === h ? e : g) p = -p;
  3886. a = a = 0;
  3887. if (0 < p)
  3888. if (0 < n) {
  3889. b = l * l;
  3890. a = m * m;
  3891. l *= n;
  3892. c = m * p;
  3893. d = -a + c;
  3894. e = -a + Math.sqrt(l * l + c * c);
  3895. m = d;
  3896. for (g = 0; 9999999999 > g; ++g) {
  3897. m = .5 * (d + e);
  3898. if (m === d || m === e) break;
  3899. k = l / (m + b);
  3900. h = c / (m + a);
  3901. k = k * k + h * h - 1;
  3902. if (0 < k) d = m;
  3903. else if (0 > k) e = m;
  3904. else break
  3905. }
  3906. n = b * n / (m + b) - n;
  3907. p = a * p / (m + a) - p;
  3908. a = Math.sqrt(n * n + p * p)
  3909. } else a = Math.abs(p - m);
  3910. else p = l * l - m * m, a = l * n, a < p ? (p = a / p, a = m * Math.sqrt(Math.abs(1 -
  3911. p * p)), n = l * p - n, a = Math.sqrt(n * n + a * a)) : a = Math.abs(n - l);
  3912. return a
  3913. }
  3914. function Ve(a) {
  3915. 1 < arguments.length && D.k("Geometry constructor can take at most one optional argument, the Geometry type.");
  3916. D.xc(this);
  3917. this.J = !1;
  3918. void 0 === a ? a = We : v && D.Da(a, Ve, Ve, "constructor:type");
  3919. this.da = a;
  3920. this.Jb = this.Cb = this.Mc = this.Ac = 0;
  3921. this.jk = new K(Xe);
  3922. this.dw = this.jk.I;
  3923. this.Pv = (new C).freeze();
  3924. this.ob = !0;
  3925. this.kr = this.Go = null;
  3926. this.lr = NaN;
  3927. this.xi = ec;
  3928. this.yi = vc;
  3929. this.jp = this.lp = NaN;
  3930. this.Xi = Ye
  3931. }
  3932. D.ka("Geometry", Ve);
  3933. D.Di(Ve);
  3934. Ve.prototype.copy = function() {
  3935. var a = new Ve;
  3936. a.da = this.da;
  3937. a.Ac = this.Ac;
  3938. a.Mc = this.Mc;
  3939. a.Cb = this.Cb;
  3940. a.Jb = this.Jb;
  3941. for (var b = this.jk.o, c = b.length, d = a.jk, e = 0; e < c; e++) {
  3942. var g = b[e].copy();
  3943. d.add(g)
  3944. }
  3945. a.dw = this.dw;
  3946. a.Pv.assign(this.Pv);
  3947. a.ob = this.ob;
  3948. a.Go = this.Go;
  3949. a.kr = this.kr;
  3950. a.lr = this.lr;
  3951. a.xi = this.xi.V();
  3952. a.yi = this.yi.V();
  3953. a.lp = this.lp;
  3954. a.jp = this.jp;
  3955. a.Xi = this.Xi;
  3956. return a
  3957. };
  3958. var Ze;
  3959. Ve.Line = Ze = D.s(Ve, "Line", 0);
  3960. var tf;
  3961. Ve.Rectangle = tf = D.s(Ve, "Rectangle", 1);
  3962. var uf;
  3963. Ve.Ellipse = uf = D.s(Ve, "Ellipse", 2);
  3964. var We;
  3965. Ve.Path = We = D.s(Ve, "Path", 3);
  3966. Ve.prototype.Oa = function() {
  3967. this.freeze();
  3968. Object.freeze(this);
  3969. return this
  3970. };
  3971. Ve.prototype.freeze = function() {
  3972. this.J = !0;
  3973. var a = this.nc;
  3974. a.freeze();
  3975. for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].freeze();
  3976. return this
  3977. };
  3978. Ve.prototype.Xa = function() {
  3979. Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
  3980. this.J = !1;
  3981. var a = this.nc;
  3982. a.Xa();
  3983. for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].Xa();
  3984. return this
  3985. };
  3986. Ve.prototype.equalsApprox = Ve.prototype.Wc = function(a) {
  3987. if (!(a instanceof Ve)) return !1;
  3988. if (this.type !== a.type) return this.type === Ze && a.type === We ? vf(this, a) : a.type === Ze && this.type === We ? vf(a, this) : !1;
  3989. if (this.type === We) {
  3990. var b = this.nc.o;
  3991. a = a.nc.o;
  3992. var c = b.length;
  3993. if (c !== a.length) return !1;
  3994. for (var d = 0; d < c; d++)
  3995. if (!b[d].Wc(a[d])) return !1;
  3996. return !0
  3997. }
  3998. return Q(this.la, a.la) && Q(this.ja, a.ja) && Q(this.F, a.F) && Q(this.G, a.G)
  3999. };
  4000. function vf(a, b) { if (a.type !== Ze || b.type !== We) return !1; if (1 === b.nc.count) { var c = b.nc.fa(0); if (1 === c.Eb.count && Q(a.la, c.la) && Q(a.ja, c.ja) && (c = c.Eb.fa(0), c.type === wf && Q(a.F, c.F) && Q(a.G, c.G))) return !0 } return !1 }
  4001. var xf;
  4002. Ve.stringify = xf = function(a) { return a.toString() };
  4003. Ve.prototype.qc = function(a) { a.Qe === Ve ? this.type = a : D.ak(this, a) };
  4004. Ve.prototype.toString = function(a) {
  4005. void 0 === a && (a = -1);
  4006. switch (this.type) {
  4007. case Ze:
  4008. return 0 > a ? "M" + this.la.toString() + " " + this.ja.toString() + "L" + this.F.toString() + " " + this.G.toString() : "M" + this.la.toFixed(a) + " " + this.ja.toFixed(a) + "L" + this.F.toFixed(a) + " " + this.G.toFixed(a);
  4009. case tf:
  4010. var b = new C(this.la, this.ja, 0, 0);
  4011. b.uH(this.F, this.G, 0, 0);
  4012. return 0 > a ? "M" + b.x.toString() + " " + b.y.toString() + "H" + b.right.toString() + "V" + b.bottom.toString() + "H" + b.left.toString() + "z" : "M" + b.x.toFixed(a) + " " + b.y.toFixed(a) + "H" + b.right.toFixed(a) +
  4013. "V" + b.bottom.toFixed(a) + "H" + b.left.toFixed(a) + "z";
  4014. case uf:
  4015. b = new C(this.la, this.ja, 0, 0);
  4016. b.uH(this.F, this.G, 0, 0);
  4017. if (0 > a) {
  4018. var c = b.left.toString() + " " + (b.y + b.height / 2).toString(),
  4019. d = b.right.toString() + " " + (b.y + b.height / 2).toString();
  4020. return "M" + c + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + d + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + c
  4021. }
  4022. c = b.left.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a);
  4023. d = b.right.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a);
  4024. return "M" + c + "A" + (b.width /
  4025. 2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + d + "A" + (b.width / 2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + c;
  4026. case We:
  4027. for (var b = "", c = this.nc.o, d = c.length, e = 0; e < d; e++) {
  4028. var g = c[e];
  4029. 0 < e && (b += " x ");
  4030. g.Ku && (b += "F ");
  4031. b += g.toString(a)
  4032. }
  4033. return b;
  4034. default:
  4035. return this.type.toString()
  4036. }
  4037. };
  4038. Ve.fillPath = function(a) {
  4039. "string" !== typeof a && D.kc(a, "string", Ve, "fillPath:str");
  4040. a = a.split(/[Xx]/);
  4041. for (var b = a.length, c = "", d = 0; d < b; d++) var e = a[d],
  4042. c = null !== e.match(/[Ff]/) ? 0 === d ? c + e : c + ("X" + (" " === e[0] ? "" : " ") + e) : c + ((0 === d ? "" : "X ") + "F" + (" " === e[0] ? "" : " ") + e);
  4043. return c
  4044. };
  4045. var yf;
  4046. Ve.parse = yf = function(a, b) {
  4047. function c() { return t >= P - 1 ? !0 : null !== l[t + 1].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/) }
  4048. function d() { t++; return l[t] }
  4049. function e() {
  4050. var a = new N(parseFloat(d()), parseFloat(d()));
  4051. y === y.toLowerCase() && (a.x = B.x + a.x, a.y = B.y + a.y);
  4052. return a
  4053. }
  4054. function g() { return B = e() }
  4055. function h() { return A = e() }
  4056. function k() { return "c" !== w.toLowerCase() && "s" !== w.toLowerCase() ? B : new N(2 * B.x - A.x, 2 * B.y - A.y) }
  4057. void 0 === b && (b = !1);
  4058. "string" !== typeof a && D.kc(a, "string", Ve, "parse:str");
  4059. a = a.replace(/,/gm, " ");
  4060. a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,
  4061. "$1 $2");
  4062. a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, "$1 $2");
  4063. a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^\s])/gm, "$1 $2");
  4064. a = a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm, "$1 $2");
  4065. a = a.replace(/([0-9])([+\-])/gm, "$1 $2");
  4066. a = a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm, "$1 $3 $4 ");
  4067. a = a.replace(/[\s\r\t\n]+/gm, " ");
  4068. a = a.replace(/^\s+|\s+$/g, "");
  4069. for (var l = a.split(" "), m = 0; m < l.length; m++) {
  4070. var n = l[m];
  4071. if (null !== n.match(/(\.[0-9]*)(\.)/gm)) {
  4072. for (var p = [], q = "", r = !1, s = 0; s < n.length; s++) { var u = n[s]; "." !== u || r ? "." === u ? (p.push(q), q = ".") : q += u : (r = !0, q += u) }
  4073. p.push(q);
  4074. l.splice(m, 1);
  4075. for (n = 0; n < p.length; n++) l.splice(m + n, 0, p[n]);
  4076. m += p.length - 1
  4077. }
  4078. }
  4079. for (var t = -1, y = "", w = "", n = new N(0, 0), A = new N(0, 0), B = new N(0, 0), P = l.length, p = D.v(), r = q = !1, s = !0, m = null; !(t >= P - 1);)
  4080. if (w = y, y = d(), "" !== y) switch (y.toUpperCase()) {
  4081. case "X":
  4082. s = !0;
  4083. r = q = !1;
  4084. break;
  4085. case "M":
  4086. m = g();
  4087. null === p.fc || !0 === s ? (T(p, m.x, m.y, q, !1, !r), s = !1) : p.moveTo(m.x, m.y);
  4088. for (n = B; !c();) m = g(), p.lineTo(m.x, m.y);
  4089. break;
  4090. case "L":
  4091. for (; !c();) m =
  4092. g(), p.lineTo(m.x, m.y);
  4093. break;
  4094. case "H":
  4095. for (; !c();) B = m = new N((y === y.toLowerCase() ? B.x : 0) + parseFloat(d()), B.y), p.lineTo(B.x, B.y);
  4096. break;
  4097. case "V":
  4098. for (; !c();) B = m = new N(B.x, (y === y.toLowerCase() ? B.y : 0) + parseFloat(d())), p.lineTo(B.x, B.y);
  4099. break;
  4100. case "C":
  4101. for (; !c();) {
  4102. var u = e(),
  4103. H = h(),
  4104. m = g();
  4105. U(p, u.x, u.y, H.x, H.y, m.x, m.y)
  4106. }
  4107. break;
  4108. case "S":
  4109. for (; !c();) u = k(), H = h(), m = g(), U(p, u.x, u.y, H.x, H.y, m.x, m.y);
  4110. break;
  4111. case "Q":
  4112. for (; !c();) H = h(), m = g(), zf(p, H.x, H.y, m.x, m.y);
  4113. break;
  4114. case "T":
  4115. for (; !c();) A = H = k(), m = g(), zf(p, H.x, H.y, m.x, m.y);
  4116. break;
  4117. case "B":
  4118. for (; !c();) {
  4119. var m = parseFloat(d()),
  4120. u = parseFloat(d()),
  4121. H = parseFloat(d()),
  4122. R = parseFloat(d()),
  4123. aa = parseFloat(d()),
  4124. V = aa,
  4125. ea = !1;
  4126. c() || (V = parseFloat(d()), c() || (ea = 0 !== parseFloat(d())));
  4127. y === y.toLowerCase() && (H += B.x, R += B.y);
  4128. p.arcTo(m, u, H, R, aa, V, ea)
  4129. }
  4130. break;
  4131. case "A":
  4132. for (; !c();) u = Math.abs(parseFloat(d())), H = Math.abs(parseFloat(d())), R = parseFloat(d()), aa = !!parseFloat(d()), V = !!parseFloat(d()), m = g(), Af(p, u, H, R, aa, V, m.x, m.y);
  4133. break;
  4134. case "Z":
  4135. m = p.q.nc.o[p.q.nc.length - 1];
  4136. X(p);
  4137. B = n;
  4138. break;
  4139. case "F":
  4140. u = "";
  4141. for (m = 1; l[t +
  4142. m];)
  4143. if (null !== l[t + m].match(/[Uu]/)) m++;
  4144. else if (null === l[t + m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)) m++;
  4145. else { u = l[t + m]; break }
  4146. u.match(/[Mm]/) ? q = !0 : Bf(p);
  4147. break;
  4148. case "U":
  4149. u = "";
  4150. for (m = 1; l[t + m];)
  4151. if (null !== l[t + m].match(/[Ff]/)) m++;
  4152. else if (null === l[t + m].match(/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/)) m++;
  4153. else { u = l[t + m]; break }
  4154. u.match(/[Mm]/) ? r = !0 : p.jb(!1)
  4155. }
  4156. n = p.q;
  4157. D.u(p);
  4158. if (b)
  4159. for (p = n.nc.j; p.next();) m = p.value, m.Ku = !0;
  4160. return n
  4161. };
  4162. function Cf(a, b) {
  4163. for (var c = a.length, d = D.P(), e = 0; e < c; e++) {
  4164. var g = a[e];
  4165. d.x = g[0];
  4166. d.y = g[1];
  4167. b.vb(d);
  4168. g[0] = d.x;
  4169. g[1] = d.y;
  4170. d.x = g[2];
  4171. d.y = g[3];
  4172. b.vb(d);
  4173. g[2] = d.x;
  4174. g[3] = d.y;
  4175. d.x = g[4];
  4176. d.y = g[5];
  4177. b.vb(d);
  4178. g[4] = d.x;
  4179. g[5] = d.y;
  4180. d.x = g[6];
  4181. d.y = g[7];
  4182. b.vb(d);
  4183. g[6] = d.x;
  4184. g[7] = d.y
  4185. }
  4186. D.A(d)
  4187. }
  4188. Ve.prototype.iy = function() {
  4189. if (this.ob || this.dw !== this.nc.I) return !0;
  4190. for (var a = this.nc.o, b = a.length, c = 0; c < b; c++)
  4191. if (a[c].iy()) return !0;
  4192. return !1
  4193. };
  4194. Ve.prototype.Yy = function() {
  4195. this.ob = !1;
  4196. this.kr = this.Go = null;
  4197. this.lr = NaN;
  4198. this.dw = this.nc.I;
  4199. for (var a = this.nc.o, b = a.length, c = 0; c < b; c++) a[c].Yy()
  4200. };
  4201. Ve.prototype.Kh = function() {
  4202. var a = this.Pv;
  4203. a.Xa();
  4204. isNaN(this.lp) || isNaN(this.jp) ? a.n(0, 0, 0, 0) : a.n(0, 0, this.lp, this.jp);
  4205. Df(this, a, !1);
  4206. Ub(a, 0, 0, 0, 0);
  4207. a.freeze()
  4208. };
  4209. Ve.prototype.computeBoundsWithoutOrigin = Ve.prototype.mI = function() {
  4210. var a = new C;
  4211. Df(this, a, !0);
  4212. return a
  4213. };
  4214. function Df(a, b, c) {
  4215. switch (a.type) {
  4216. case Ze:
  4217. case tf:
  4218. case uf:
  4219. c ? b.n(a.Ac, a.Mc, 0, 0) : Ub(b, a.Ac, a.Mc, 0, 0);
  4220. Ub(b, a.Cb, a.Jb, 0, 0);
  4221. break;
  4222. case We:
  4223. var d = a.nc;
  4224. a = d.o;
  4225. for (var d = d.length, e = 0; e < d; e++) {
  4226. var g = a[e];
  4227. c && 0 === e ? b.n(g.la, g.ja, 0, 0) : Ub(b, g.la, g.ja, 0, 0);
  4228. for (var h = g.Eb.o, k = h.length, l = g.la, m = g.ja, n = 0; n < k; n++) {
  4229. var p = h[n];
  4230. switch (p.type) {
  4231. case wf:
  4232. case Ef:
  4233. l = p.F;
  4234. m = p.G;
  4235. Ub(b, l, m, 0, 0);
  4236. break;
  4237. case Ff:
  4238. Ae(l, m, p.Ec, p.$c, p.Uh, p.Vh, p.F, p.G, .5, b);
  4239. l = p.F;
  4240. m = p.G;
  4241. break;
  4242. case Gf:
  4243. Ee(l, m, p.Ec, p.$c, p.F, p.G, .5, b);
  4244. l = p.F;
  4245. m = p.G;
  4246. break;
  4247. case Hf:
  4248. case If:
  4249. var q =
  4250. p.type === Hf ? Vf(p, g) : Wf(p, g, l, m),
  4251. r = q.length;
  4252. if (0 === r) {
  4253. l = p.pa;
  4254. m = p.va;
  4255. Ub(b, l, m, 0, 0);
  4256. break
  4257. }
  4258. for (var p = null, s = 0; s < r; s++) p = q[s], Ae(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], .5, b);
  4259. null !== p && (l = p[6], m = p[7]);
  4260. break;
  4261. default:
  4262. D.k("Unknown Segment type: " + p.type)
  4263. }
  4264. }
  4265. }
  4266. break;
  4267. default:
  4268. D.k("Unknown Geometry type: " + a.type)
  4269. }
  4270. }
  4271. Ve.prototype.normalize = Ve.prototype.normalize = function() {
  4272. this.J && D.qa(this);
  4273. var a = this.mI();
  4274. this.offset(-a.x, -a.y);
  4275. return new N(-a.x, -a.y)
  4276. };
  4277. Ve.prototype.offset = Ve.prototype.offset = function(a, b) {
  4278. this.J && D.qa(this);
  4279. v && (D.p(a, Ve, "offset"), D.p(b, Ve, "offset"));
  4280. this.transform(1, 0, 0, 1, a, b);
  4281. return this
  4282. };
  4283. Ve.prototype.scale = Ve.prototype.scale = function(a, b) {
  4284. this.J && D.qa(this);
  4285. v && (D.p(a, Ve, "scale:x"), D.p(b, Ve, "scale:y"), 0 === a && D.ua(a, "scale must be non-zero", Ve, "scale:x"), 0 === b && D.ua(b, "scale must be non-zero", Ve, "scale:y"));
  4286. this.transform(a, 0, 0, b, 0, 0);
  4287. return this
  4288. };
  4289. Ve.prototype.rotate = Ve.prototype.rotate = function(a, b, c) {
  4290. this.J && D.qa(this);
  4291. void 0 === b && (b = 0);
  4292. void 0 === c && (c = 0);
  4293. v && (D.p(a, Ve, "rotate:angle"), D.p(b, Ve, "rotate:x"), D.p(c, Ve, "rotate:y"));
  4294. var d = D.hh();
  4295. d.reset();
  4296. d.rotate(a, b, c);
  4297. this.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
  4298. D.lf(d);
  4299. return this
  4300. };
  4301. Ve.prototype.transform = Ve.prototype.transform = function(a, b, c, d, e, g) {
  4302. var h = 0,
  4303. k = 0;
  4304. switch (this.type) {
  4305. case Ze:
  4306. case tf:
  4307. case uf:
  4308. h = this.Ac;
  4309. k = this.Mc;
  4310. this.Ac = h * a + k * c + e;
  4311. this.Mc = h * b + k * d + g;
  4312. h = this.Cb;
  4313. k = this.Jb;
  4314. this.Cb = h * a + k * c + e;
  4315. this.Jb = h * b + k * d + g;
  4316. break;
  4317. case We:
  4318. for (var l = this.nc.o, m = l.length, n = 0; n < m; n++) {
  4319. var p = l[n],
  4320. h = p.la,
  4321. k = p.ja;
  4322. p.la = h * a + k * c + e;
  4323. p.ja = h * b + k * d + g;
  4324. for (var p = p.Eb.o, q = p.length, r = 0; r < q; r++) {
  4325. var s = p[r];
  4326. switch (s.type) {
  4327. case wf:
  4328. case Ef:
  4329. h = s.F;
  4330. k = s.G;
  4331. s.F = h * a + k * c + e;
  4332. s.G = h * b + k * d + g;
  4333. break;
  4334. case Ff:
  4335. h = s.Ec;
  4336. k = s.$c;
  4337. s.Ec =
  4338. h * a + k * c + e;
  4339. s.$c = h * b + k * d + g;
  4340. h = s.Uh;
  4341. k = s.Vh;
  4342. s.Uh = h * a + k * c + e;
  4343. s.Vh = h * b + k * d + g;
  4344. h = s.F;
  4345. k = s.G;
  4346. s.F = h * a + k * c + e;
  4347. s.G = h * b + k * d + g;
  4348. break;
  4349. case Gf:
  4350. h = s.Ec;
  4351. k = s.$c;
  4352. s.Ec = h * a + k * c + e;
  4353. s.$c = h * b + k * d + g;
  4354. h = s.F;
  4355. k = s.G;
  4356. s.F = h * a + k * c + e;
  4357. s.G = h * b + k * d + g;
  4358. break;
  4359. case Hf:
  4360. h = s.pa;
  4361. k = s.va;
  4362. s.pa = h * a + k * c + e;
  4363. s.va = h * b + k * d + g;
  4364. 0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.Me += h);
  4365. 0 > a && (s.Me = 180 - s.Me, s.Df = -s.Df);
  4366. 0 > d && (s.Me = -s.Me, s.Df = -s.Df);
  4367. s.radiusX *= Math.sqrt(a * a + c * c);
  4368. void 0 !== s.radiusY && (s.radiusY *= Math.sqrt(b * b + d * d));
  4369. break;
  4370. case If:
  4371. h = s.F;
  4372. k = s.G;
  4373. s.F = h *
  4374. a + k * c + e;
  4375. s.G = h * b + k * d + g;
  4376. 0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.ck += h);
  4377. 0 > a && (s.ck = 180 - s.ck, s.wm = !s.wm);
  4378. 0 > d && (s.ck = -s.ck, s.wm = !s.wm);
  4379. s.radiusX *= Math.sqrt(a * a + c * c);
  4380. s.radiusY *= Math.sqrt(b * b + d * d);
  4381. break;
  4382. default:
  4383. D.k("Unknown Segment type: " + s.type)
  4384. }
  4385. }
  4386. }
  4387. }
  4388. this.ob = !0;
  4389. return this
  4390. };
  4391. Ve.prototype.Pa = function(a, b, c, d) {
  4392. var e = a.x,
  4393. g = a.y,
  4394. h = this.pb.x - 20;
  4395. a = a.y;
  4396. for (var k = 0, l = 0, m = 0, n = 0, p = 0, q = 0, r = this.nc.o, s = r.length, u = 0; u < s; u++) {
  4397. var t = r[u];
  4398. if (t.Ku) {
  4399. if (c && t.Pa(e, g, b)) return !0;
  4400. for (var y = t.Eb, l = t.la, m = t.ja, w = l, A = m, B = y.o, P = 0; P <= y.length; P++) {
  4401. var H, R;
  4402. P !== y.length ? (H = B[P], R = H.type, p = H.F, q = H.G) : (R = wf, p = w, q = A);
  4403. switch (R) {
  4404. case Ef:
  4405. n = Xf(e, g, h, a, l, m, w, A);
  4406. if (isNaN(n)) return !0;
  4407. k += n;
  4408. w = p;
  4409. A = q;
  4410. break;
  4411. case wf:
  4412. n = Xf(e, g, h, a, l, m, p, q);
  4413. if (isNaN(n)) return !0;
  4414. k += n;
  4415. break;
  4416. case Ff:
  4417. n = He(l, m, H.Ec, H.$c, H.Uh, H.Vh, p, q, h,
  4418. a, e, g, .5);
  4419. k += n;
  4420. break;
  4421. case Gf:
  4422. n = He(l, m, (l + 2 * H.Ec) / 3, (m + 2 * H.$c) / 3, (2 * H.Ec + p) / 3, (2 * H.$c + q) / 3, p, q, h, a, e, g, .5);
  4423. k += n;
  4424. break;
  4425. case Hf:
  4426. case If:
  4427. R = H.type === Hf ? Vf(H, t) : Wf(H, t, l, m);
  4428. var aa = R.length;
  4429. if (0 === aa) {
  4430. n = Xf(e, g, h, a, l, m, H.pa, H.va);
  4431. if (isNaN(n)) return !0;
  4432. k += n;
  4433. break
  4434. }
  4435. for (var V = null, ea = 0; ea < aa; ea++) {
  4436. V = R[ea];
  4437. if (0 === ea) {
  4438. n = Xf(e, g, h, a, l, m, V[0], V[1]);
  4439. if (isNaN(n)) return !0;
  4440. k += n
  4441. }
  4442. n = He(V[0], V[1], V[2], V[3], V[4], V[5], V[6], V[7], h, a, e, g, .5);
  4443. k += n
  4444. }
  4445. null !== V && (p = V[6], q = V[7]);
  4446. break;
  4447. default:
  4448. D.k("Unknown Segment type: " + H.type)
  4449. }
  4450. l = p;
  4451. m = q
  4452. }
  4453. if (0 !== k) return !0;
  4454. k = 0
  4455. } else if (t.Pa(e, g, d ? b : b + 2)) return !0
  4456. }
  4457. return 0 !== k
  4458. };
  4459. function Xf(a, b, c, d, e, g, h, k) {
  4460. if (qe(e, g, h, k, .05, a, b)) return NaN;
  4461. var l = (a - c) * (g - k);
  4462. if (0 === l) return 0;
  4463. var m = ((a * d - b * c) * (e - h) - (a - c) * (e * k - g * h)) / l;
  4464. b = (a * d - b * c) * (g - k) / l;
  4465. if (m >= a) return 0;
  4466. if ((e > h ? e - h : h - e) < (g > k ? g - k : k - g)) { if (e = a = 0, g < k ? (a = g, e = k) : (a = k, e = g), b < a || b > e) return 0 } else if (e < h ? (a = e, e = h) : a = h, m < a || m > e) return 0;
  4467. return 0 < l ? 1 : -1
  4468. }
  4469. function Yf(a, b, c, d) {
  4470. a = a.nc.o;
  4471. for (var e = a.length, g = 0; g < e; g++)
  4472. if (a[g].Pa(b, c, d)) return !0;
  4473. return !1
  4474. }
  4475. Ve.prototype.getPointAlongPath = Ve.prototype.XI = function(a, b) {
  4476. 0 > a ? a = 0 : 1 < a && (a = 1);
  4477. void 0 === b && (b = new N);
  4478. if (this.type === Ze) return b.n(this.la + a * (this.F - this.la), this.ja + a * (this.G - this.ja)), b;
  4479. for (var c = this.Zx, d = this.uu, e = c.length, g = this.vu * a, h = 0, k = 0; k < e; k++)
  4480. for (var l = d[k], m = l.length, n = 0; n < m; n++) {
  4481. var p = l[n];
  4482. if (h + p >= g) return d = (g - h) / p, c = c[k], k = c[2 * n], e = c[2 * n + 1], b.n(k + (c[2 * n + 2] - k) * d, e + (c[2 * n + 3] - e) * d), b;
  4483. h += p
  4484. }
  4485. b.n(NaN, NaN);
  4486. return b
  4487. };
  4488. Ve.prototype.getAngleAlongPath = Ve.prototype.OF = function(a) {
  4489. 0 > a ? a = 0 : 1 < a && (a = 1);
  4490. var b = 0;
  4491. if (this.type === Ze) return b = 180 * Math.atan2(this.G - this.ja, this.F - this.la) / Math.PI;
  4492. for (var b = this.Zx, c = this.uu, d = b.length, e = this.vu * a, g = 0, h = 0; h < d; h++) {
  4493. var k = c[h],
  4494. l = k.length;
  4495. for (a = 0; a < l; a++) {
  4496. var m = k[a];
  4497. if (g + m >= e) return b = b[h], b = 180 * Math.atan2(b[2 * a + 3] - b[2 * a + 1], b[2 * a + 2] - b[2 * a]) / Math.PI;
  4498. g += m
  4499. }
  4500. }
  4501. return NaN
  4502. };
  4503. Ve.prototype.getFractionForPoint = Ve.prototype.TI = function(a) {
  4504. if (this.type === Ze) {
  4505. var b = this.la,
  4506. c = this.ja,
  4507. d = this.F,
  4508. e = this.G;
  4509. if (b !== d || c !== e) {
  4510. var g = a.x;
  4511. a = a.y;
  4512. var h = 0,
  4513. k = 0;
  4514. return b === d ? (c < e ? (h = c, k = e) : (h = e, k = c), a <= h ? h === c ? 0 : 1 : a >= k ? k === c ? 0 : 1 : Math.abs(a - c) / (k - h)) : c === e ? (b < d ? (h = b, k = d) : (h = d, k = b), g <= h ? h === b ? 0 : 1 : g >= k ? k === b ? 0 : 1 : Math.abs(g - b) / (k - h)) : ((g - b) * (g - b) + (a - c) * (a - c)) / ((d - b) * (d - b) + (e - c) * (e - c))
  4515. }
  4516. } else if (this.type === tf) {
  4517. if (b = this.la, c = this.ja, d = this.F, e = this.G, b !== d || c !== e) {
  4518. var h = d - b,
  4519. k = e - c,
  4520. l = 2 * h + 2 * k,
  4521. g = a.x;
  4522. a = a.y;
  4523. g = Math.min(Math.max(g, b), d);
  4524. a = Math.min(Math.max(a, c), e);
  4525. var b = Math.abs(g - b),
  4526. d = Math.abs(g - d),
  4527. c = Math.abs(a - c),
  4528. e = Math.abs(a - e),
  4529. m = Math.min(b, d, c, e);
  4530. if (m === c) return g / l;
  4531. if (m === d) return (h + a) / l;
  4532. if (m === e) return (2 * h + k - g) / l;
  4533. if (m === b) return (2 * h + 2 * k - a) / l
  4534. }
  4535. } else {
  4536. for (var e = this.Zx, h = this.uu, k = this.vu, l = D.P(), c = Infinity, b = d = 0, g = e.length, n = m = 0, p = 0; p < g; p++)
  4537. for (var q = e[p], r = h[p], s = q.length, u = 0; u < s; u += 2) {
  4538. var t = q[u],
  4539. y = q[u + 1];
  4540. if (0 !== u) {
  4541. fb(m, n, t, y, a.x, a.y, l);
  4542. var w = (l.x - a.x) * (l.x - a.x) + (l.y - a.y) * (l.y - a.y);
  4543. w < c && (c = w,
  4544. d = b, d += Math.sqrt((l.x - m) * (l.x - m) + (l.y - n) * (l.y - n)));
  4545. b += r[(u - 2) / 2]
  4546. }
  4547. m = t;
  4548. n = y
  4549. }
  4550. D.A(l);
  4551. a = d / k;
  4552. return 0 > a ? 0 : 1 < a ? 1 : a
  4553. }
  4554. return 0
  4555. };
  4556. D.w(Ve, { Zx: null }, function() { Zf(this); return this.Go });
  4557. function Zf(a) {
  4558. if (null === a.Go) {
  4559. a.iy() && a.Yy();
  4560. var b = a.Go = [],
  4561. c = a.kr = [],
  4562. d = [],
  4563. e = [];
  4564. if (a.type === Ze) d.push(a.la), d.push(a.ja), d.push(a.F), d.push(a.G), b.push(d), e.push(Math.sqrt((a.la - a.F) * (a.la - a.F) + (a.ja - a.G) * (a.ja - a.G))), c.push(e);
  4565. else if (a.type === tf) d.push(a.la), d.push(a.ja), d.push(a.F), d.push(a.ja), d.push(a.F), d.push(a.G), d.push(a.la), d.push(a.G), d.push(a.la), d.push(a.ja), b.push(d), e.push(Math.abs(a.la - a.F)), e.push(Math.abs(a.ja - a.G)), e.push(Math.abs(a.la - a.F)), e.push(Math.abs(a.ja - a.G)), c.push(e);
  4566. else if (a.type === uf) {
  4567. var g = new Xe;
  4568. g.la = a.F;
  4569. g.ja = (a.ja + a.G) / 2;
  4570. var h = new $f(Hf);
  4571. h.Me = 0;
  4572. h.Df = 360;
  4573. h.pa = (a.la + a.F) / 2;
  4574. h.va = (a.ja + a.G) / 2;
  4575. h.radiusX = Math.abs(a.la - a.F) / 2;
  4576. h.radiusY = Math.abs(a.ja - a.G) / 2;
  4577. g.add(h);
  4578. a = Vf(h, g);
  4579. e = a.length;
  4580. if (0 === e) d.push(h.pa), d.push(h.va);
  4581. else
  4582. for (var h = g.la, g = g.ja, k = 0; k < e; k++) {
  4583. var l = a[k];
  4584. Be(h, g, l[2], l[3], l[4], l[5], l[6], l[7], .5, d);
  4585. h = l[6];
  4586. g = l[7]
  4587. }
  4588. b.push(d);
  4589. c.push(ag(d))
  4590. } else
  4591. for (var m = a.nc.j; m.next();) {
  4592. var n = m.value,
  4593. d = [];
  4594. d.push(n.la);
  4595. d.push(n.ja);
  4596. for (var h = n.la, g = n.ja, p = h, q = g, r = n.Eb.o,
  4597. s = r.length, u = 0; u < s; u++) {
  4598. var t = r[u];
  4599. switch (t.da) {
  4600. case Ef:
  4601. 4 <= d.length && (b.push(d), c.push(ag(d)));
  4602. d = [];
  4603. d.push(t.F);
  4604. d.push(t.G);
  4605. h = t.F;
  4606. g = t.G;
  4607. p = h;
  4608. q = g;
  4609. break;
  4610. case wf:
  4611. d.push(t.F);
  4612. d.push(t.G);
  4613. h = t.F;
  4614. g = t.G;
  4615. break;
  4616. case Ff:
  4617. Be(h, g, t.Vd, t.ff, t.Ch, t.Og, t.Cb, t.Jb, .5, d);
  4618. h = t.F;
  4619. g = t.G;
  4620. break;
  4621. case Gf:
  4622. Fe(h, g, t.Vd, t.ff, t.Cb, t.Jb, .5, d);
  4623. h = t.F;
  4624. g = t.G;
  4625. break;
  4626. case Hf:
  4627. a = Vf(t, n);
  4628. e = a.length;
  4629. if (0 === e) {
  4630. d.push(t.pa);
  4631. d.push(t.va);
  4632. h = t.pa;
  4633. g = t.va;
  4634. break
  4635. }
  4636. for (k = 0; k < e; k++) l = a[k], Be(h, g, l[2], l[3], l[4], l[5], l[6], l[7], .5, d), h = l[6], g = l[7];
  4637. break;
  4638. case If:
  4639. a =
  4640. Wf(t, n, h, g);
  4641. e = a.length;
  4642. if (0 === e) {
  4643. d.push(t.pa);
  4644. d.push(t.va);
  4645. h = t.pa;
  4646. g = t.va;
  4647. break
  4648. }
  4649. for (k = 0; k < e; k++) l = a[k], Be(h, g, l[2], l[3], l[4], l[5], l[6], l[7], .5, d), h = l[6], g = l[7];
  4650. break;
  4651. default:
  4652. D.k("Segment not of valid type: " + t.da)
  4653. }
  4654. t.hi && (d.push(p), d.push(q))
  4655. }
  4656. 4 <= d.length && (b.push(d), c.push(ag(d)))
  4657. }
  4658. }
  4659. }
  4660. D.w(Ve, { uu: null }, function() { Zf(this); return this.kr });
  4661. D.w(Ve, { vu: null }, function() {
  4662. var a = this.lr;
  4663. if (isNaN(a)) {
  4664. if (this.type === Ze) var a = Math.abs(this.F - this.la),
  4665. b = Math.abs(this.G - this.ja),
  4666. a = Math.sqrt(a * a + b * b);
  4667. else if (this.type === tf) a = Math.abs(this.F - this.la), b = Math.abs(this.G - this.ja), a = 2 * a + 2 * b;
  4668. else
  4669. for (var b = this.uu, c = b.length, d = a = 0; d < c; d++)
  4670. for (var e = b[d], g = e.length, h = 0; h < g; h++) a += e[h];
  4671. this.lr = a
  4672. }
  4673. return a
  4674. });
  4675. function ag(a) {
  4676. for (var b = [], c = 0, d = 0, e = a.length, g = 0; g < e; g += 2) {
  4677. var h = a[g],
  4678. k = a[g + 1];
  4679. 0 !== g && (c = Math.sqrt(ob(c, d, h, k)), b.push(c));
  4680. c = h;
  4681. d = k
  4682. }
  4683. return b
  4684. }
  4685. D.defineProperty(Ve, { type: "type" }, function() { return this.da }, function(a) { this.da !== a && (v && D.Da(a, Ve, Ve, "type"), this.J && D.qa(this, a), this.da = a, this.ob = !0) });
  4686. D.defineProperty(Ve, { la: "startX" }, function() { return this.Ac }, function(a) { this.Ac !== a && (v && D.p(a, Ve, "startX"), this.J && D.qa(this, a), this.Ac = a, this.ob = !0) });
  4687. D.defineProperty(Ve, { ja: "startY" }, function() { return this.Mc }, function(a) { this.Mc !== a && (v && D.p(a, Ve, "startY"), this.J && D.qa(this, a), this.Mc = a, this.ob = !0) });
  4688. D.defineProperty(Ve, { F: "endX" }, function() { return this.Cb }, function(a) { this.Cb !== a && (v && D.p(a, Ve, "endX"), this.J && D.qa(this, a), this.Cb = a, this.ob = !0) });
  4689. D.defineProperty(Ve, { G: "endY" }, function() { return this.Jb }, function(a) { this.Jb !== a && (v && D.p(a, Ve, "endY"), this.J && D.qa(this, a), this.Jb = a, this.ob = !0) });
  4690. D.defineProperty(Ve, { nc: "figures" }, function() { return this.jk }, function(a) { this.jk !== a && (v && D.l(a, K, Ve, "figures"), this.J && D.qa(this, a), this.jk = a, this.ob = !0) });
  4691. Ve.prototype.add = Ve.prototype.add = function(a) { this.jk.add(a); return this };
  4692. Ve.prototype.setSpots = function(a, b, c, d, e, g, h, k) {
  4693. this.J && D.qa(this);
  4694. this.xi = (new S(a, b, e, g)).freeze();
  4695. this.yi = (new S(c, d, h, k)).freeze();
  4696. return this
  4697. };
  4698. D.defineProperty(Ve, { C: "spot1" }, function() { return this.xi }, function(a) {
  4699. v && D.l(a, S, Ve, "spot1");
  4700. this.J && D.qa(this, a);
  4701. this.xi = a.V()
  4702. });
  4703. D.defineProperty(Ve, { D: "spot2" }, function() { return this.yi }, function(a) {
  4704. v && D.l(a, S, Ve, "spot2");
  4705. this.J && D.qa(this, a);
  4706. this.yi = a.V()
  4707. });
  4708. D.defineProperty(Ve, { le: "defaultStretch" }, function() { return this.Xi }, function(a) {
  4709. v && D.Da(a, O, Ve, "stretch");
  4710. this.J && D.qa(this, a);
  4711. this.Xi = a
  4712. });
  4713. D.w(Ve, { pb: "bounds" }, function() { this.iy() && (this.Yy(), this.Kh()); return this.Pv });
  4714. function Xe(a, b, c, d) {
  4715. D.xc(this);
  4716. this.J = !1;
  4717. void 0 === c && (c = !0);
  4718. this.Xm = c;
  4719. void 0 === d && (d = !0);
  4720. this.mp = d;
  4721. void 0 !== a ? (v && D.p(a, Xe, "sx"), this.Ac = a) : this.Ac = 0;
  4722. void 0 !== b ? (v && D.p(b, Xe, "sy"), this.Mc = b) : this.Mc = 0;
  4723. this.Ip = new K($f);
  4724. this.hx = this.Ip.I;
  4725. this.ob = !0
  4726. }
  4727. D.ka("PathFigure", Xe);
  4728. D.Di(Xe);
  4729. Xe.prototype.copy = function() {
  4730. var a = new Xe;
  4731. a.Xm = this.Xm;
  4732. a.mp = this.mp;
  4733. a.Ac = this.Ac;
  4734. a.Mc = this.Mc;
  4735. for (var b = this.Ip.o, c = b.length, d = a.Ip, e = 0; e < c; e++) {
  4736. var g = b[e].copy();
  4737. d.add(g)
  4738. }
  4739. a.hx = this.hx;
  4740. a.ob = this.ob;
  4741. return a
  4742. };
  4743. Xe.prototype.equalsApprox = Xe.prototype.Wc = function(a) {
  4744. if (!(a instanceof Xe && Q(this.la, a.la) && Q(this.ja, a.ja))) return !1;
  4745. var b = this.Eb.o;
  4746. a = a.Eb.o;
  4747. var c = b.length;
  4748. if (c !== a.length) return !1;
  4749. for (var d = 0; d < c; d++)
  4750. if (!b[d].Wc(a[d])) return !1;
  4751. return !0
  4752. };
  4753. f = Xe.prototype;
  4754. f.toString = function(a) { void 0 === a && (a = -1); for (var b = 0 > a ? "M" + this.la.toString() + " " + this.ja.toString() : "M" + this.la.toFixed(a) + " " + this.ja.toFixed(a), c = this.Eb.o, d = c.length, e = 0; e < d; e++) b += " " + c[e].toString(a); return b };
  4755. f.freeze = function() {
  4756. this.J = !0;
  4757. var a = this.Eb;
  4758. a.freeze();
  4759. for (var b = a.o, a = a.length, c = 0; c < a; c++) b[c].freeze();
  4760. return this
  4761. };
  4762. f.Xa = function() {
  4763. this.J = !1;
  4764. var a = this.Eb;
  4765. a.Xa();
  4766. for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].Xa();
  4767. return this
  4768. };
  4769. f.iy = function() {
  4770. if (this.ob) return !0;
  4771. var a = this.Eb;
  4772. if (this.hx !== a.I) return !0;
  4773. for (var a = a.o, b = a.length, c = 0; c < b; c++)
  4774. if (a[c].ob) return !0;
  4775. return !1
  4776. };
  4777. f.Yy = function() {
  4778. this.ob = !1;
  4779. var a = this.Eb;
  4780. this.hx = a.I;
  4781. for (var a = a.o, b = a.length, c = 0; c < b; c++) {
  4782. var d = a[c];
  4783. d.ob = !1;
  4784. d.$h = null
  4785. }
  4786. };
  4787. D.defineProperty(Xe, { Ku: "isFilled" }, function() { return this.Xm }, function(a) {
  4788. v && D.h(a, "boolean", Xe, "isFilled");
  4789. this.J && D.qa(this, a);
  4790. this.Xm = a
  4791. });
  4792. D.defineProperty(Xe, { dl: "isShadowed" }, function() { return this.mp }, function(a) {
  4793. v && D.h(a, "boolean", Xe, "isShadowed");
  4794. this.J && D.qa(this, a);
  4795. this.mp = a
  4796. });
  4797. D.defineProperty(Xe, { la: "startX" }, function() { return this.Ac }, function(a) {
  4798. v && D.p(a, Xe, "startX");
  4799. this.J && D.qa(this, a);
  4800. this.Ac = a;
  4801. this.ob = !0
  4802. });
  4803. D.defineProperty(Xe, { ja: "startY" }, function() { return this.Mc }, function(a) {
  4804. v && D.p(a, Xe, "startY");
  4805. this.J && D.qa(this, a);
  4806. this.Mc = a;
  4807. this.ob = !0
  4808. });
  4809. D.defineProperty(Xe, { Eb: "segments" }, function() { return this.Ip }, function(a) {
  4810. v && D.l(a, K, Xe, "segments");
  4811. this.J && D.qa(this, a);
  4812. this.Ip = a;
  4813. this.ob = !0
  4814. });
  4815. Xe.prototype.add = Xe.prototype.add = function(a) { this.Ip.add(a); return this };
  4816. Xe.prototype.Pa = function(a, b, c) {
  4817. for (var d = this.la, e = this.ja, g = d, h = e, k = this.Eb.o, l = k.length, m = 0; m < l; m++) {
  4818. var n = k[m];
  4819. switch (n.type) {
  4820. case Ef:
  4821. g = n.F;
  4822. h = n.G;
  4823. d = n.F;
  4824. e = n.G;
  4825. break;
  4826. case wf:
  4827. if (qe(d, e, n.F, n.G, c, a, b)) return !0;
  4828. d = n.F;
  4829. e = n.G;
  4830. break;
  4831. case Ff:
  4832. if (re(d, e, n.Ec, n.$c, n.Uh, n.Vh, n.F, n.G, .5, a, b, c)) return !0;
  4833. d = n.F;
  4834. e = n.G;
  4835. break;
  4836. case Gf:
  4837. if (De(d, e, n.Ec, n.$c, n.F, n.G, .5, a, b, c)) return !0;
  4838. d = n.F;
  4839. e = n.G;
  4840. break;
  4841. case Hf:
  4842. case If:
  4843. var p = n.type === Hf ? Vf(n, this) : Wf(n, this, d, e),
  4844. q = p.length;
  4845. if (0 === q) {
  4846. if (qe(d, e, n.pa, n.va, c, a, b)) return !0;
  4847. d = n.pa;
  4848. e = n.va;
  4849. break
  4850. }
  4851. for (var r = null, s = 0; s < q; s++)
  4852. if (r = p[s], 0 === s && qe(d, e, r[0], r[1], c, a, b) || re(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], .5, a, b, c)) return !0;
  4853. null !== r && (d = r[6], e = r[7]);
  4854. break;
  4855. default:
  4856. D.k("Unknown Segment type: " + n.type)
  4857. }
  4858. if (n.ey && (d !== g || e !== h) && qe(d, e, g, h, c, a, b)) return !0
  4859. }
  4860. return !1
  4861. };
  4862. function $f(a, b, c, d, e, g, h, k) {
  4863. D.xc(this);
  4864. this.J = !1;
  4865. void 0 === a ? a = wf : v && D.Da(a, $f, $f, "constructor:type");
  4866. this.da = a;
  4867. void 0 !== b ? (v && D.p(b, $f, "ex"), this.Cb = b) : this.Cb = 0;
  4868. void 0 !== c ? (v && D.p(c, $f, "ey"), this.Jb = c) : this.Jb = 0;
  4869. void 0 === d && (d = 0);
  4870. void 0 === e && (e = 0);
  4871. void 0 === g && (g = 0);
  4872. void 0 === h && (h = 0);
  4873. a === If ? (a = g % 360, 0 > a && (a += 360), this.Vd = a, this.ff = 0, v && D.p(d, $f, "x1"), this.Ch = Math.max(d, 0), v && D.p(e, $f, "y1"), this.Og = Math.max(e, 0), this.qp = "boolean" === typeof h ? !!h : !1, this.Ko = !!k) : (v && D.p(d, $f, "x1"), this.Vd = d, v && D.p(e,
  4874. $f, "y1"), this.ff = e, v && D.p(g, $f, "x2"), a === Hf && (g = Math.max(g, 0)), this.Ch = g, "number" === typeof h ? (a === Hf && (h = Math.max(h, 0)), this.Og = h) : this.Og = 0, this.Ko = this.qp = !1);
  4875. this.hi = !1;
  4876. this.ob = !0;
  4877. this.$h = null
  4878. }
  4879. D.ka("PathSegment", $f);
  4880. D.Di($f);
  4881. $f.prototype.copy = function() {
  4882. var a = new $f;
  4883. a.da = this.da;
  4884. a.Cb = this.Cb;
  4885. a.Jb = this.Jb;
  4886. a.Vd = this.Vd;
  4887. a.ff = this.ff;
  4888. a.Ch = this.Ch;
  4889. a.Og = this.Og;
  4890. a.qp = this.qp;
  4891. a.Ko = this.Ko;
  4892. a.hi = this.hi;
  4893. a.ob = this.ob;
  4894. return a
  4895. };
  4896. $f.prototype.equalsApprox = $f.prototype.Wc = function(a) {
  4897. if (!(a instanceof $f) || this.type !== a.type || this.ey !== a.ey) return !1;
  4898. switch (this.type) {
  4899. case Ef:
  4900. case wf:
  4901. return Q(this.F, a.F) && Q(this.G, a.G);
  4902. case Ff:
  4903. return Q(this.F, a.F) && Q(this.G, a.G) && Q(this.Ec, a.Ec) && Q(this.$c, a.$c) && Q(this.Uh, a.Uh) && Q(this.Vh, a.Vh);
  4904. case Gf:
  4905. return Q(this.F, a.F) && Q(this.G, a.G) && Q(this.Ec, a.Ec) && Q(this.$c, a.$c);
  4906. case Hf:
  4907. return Q(this.Me, a.Me) && Q(this.Df, a.Df) && Q(this.pa, a.pa) && Q(this.va, a.va) && Q(this.radiusX, a.radiusX) && Q(this.radiusY,
  4908. a.radiusY);
  4909. case If:
  4910. return this.wm === a.wm && this.jy === a.jy && Q(this.ck, a.ck) && Q(this.F, a.F) && Q(this.G, a.G) && Q(this.radiusX, a.radiusX) && Q(this.radiusY, a.radiusY);
  4911. default:
  4912. return !1
  4913. }
  4914. };
  4915. $f.prototype.qc = function(a) { a.Qe === $f ? this.type = a : D.ak(this, a) };
  4916. $f.prototype.toString = function(a) {
  4917. void 0 === a && (a = -1);
  4918. var b = "";
  4919. switch (this.type) {
  4920. case Ef:
  4921. b = 0 > a ? "M" + this.F.toString() + " " + this.G.toString() : "M" + this.F.toFixed(a) + " " + this.G.toFixed(a);
  4922. break;
  4923. case wf:
  4924. b = 0 > a ? "L" + this.F.toString() + " " + this.G.toString() : "L" + this.F.toFixed(a) + " " + this.G.toFixed(a);
  4925. break;
  4926. case Ff:
  4927. b = 0 > a ? "C" + this.Ec.toString() + " " + this.$c.toString() + " " + this.Uh.toString() + " " + this.Vh.toString() + " " + this.F.toString() + " " + this.G.toString() : "C" + this.Ec.toFixed(a) + " " + this.$c.toFixed(a) + " " + this.Uh.toFixed(a) +
  4928. " " + this.Vh.toFixed(a) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a);
  4929. break;
  4930. case Gf:
  4931. b = 0 > a ? "Q" + this.Ec.toString() + " " + this.$c.toString() + " " + this.F.toString() + " " + this.G.toString() : "Q" + this.Ec.toFixed(a) + " " + this.$c.toFixed(a) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a);
  4932. break;
  4933. case Hf:
  4934. b = 0 > a ? "B" + this.Me.toString() + " " + this.Df.toString() + " " + this.pa.toString() + " " + this.va.toString() + " " + this.radiusX : "B" + this.Me.toFixed(a) + " " + this.Df.toFixed(a) + " " + this.pa.toFixed(a) + " " + this.va.toFixed(a) + " " + this.radiusX;
  4935. break;
  4936. case If:
  4937. b = 0 > a ? "A" + this.radiusX.toString() + " " + this.radiusY.toString() + " " + this.ck.toString() + " " + (this.jy ? 1 : 0) + " " + (this.wm ? 1 : 0) + " " + this.F.toString() + " " + this.G.toString() : "A" + this.radiusX.toFixed(a) + " " + this.radiusY.toFixed(a) + " " + this.ck.toFixed(a) + " " + (this.jy ? 1 : 0) + " " + (this.wm ? 1 : 0) + " " + this.F.toFixed(a) + " " + this.G.toFixed(a);
  4938. break;
  4939. default:
  4940. b = this.type.toString()
  4941. }
  4942. return b + (this.hi ? "z" : "")
  4943. };
  4944. var Ef;
  4945. $f.Move = Ef = D.s($f, "Move", 0);
  4946. var wf;
  4947. $f.Line = wf = D.s($f, "Line", 1);
  4948. var Ff;
  4949. $f.Bezier = Ff = D.s($f, "Bezier", 2);
  4950. var Gf;
  4951. $f.QuadraticBezier = Gf = D.s($f, "QuadraticBezier", 3);
  4952. var Hf;
  4953. $f.Arc = Hf = D.s($f, "Arc", 4);
  4954. var If;
  4955. $f.SvgArc = If = D.s($f, "SvgArc", 4);
  4956. $f.prototype.freeze = function() { this.J = !0; return this };
  4957. $f.prototype.Xa = function() { this.J = !1; return this };
  4958. $f.prototype.close = $f.prototype.close = function() { this.hi = !0; return this };
  4959. function Vf(a, b) {
  4960. if (null !== a.$h && !1 === b.ob) return a.$h;
  4961. var c = a.radiusX,
  4962. d = a.radiusY;
  4963. void 0 === d && (d = c);
  4964. if (0 === c || 0 === d) return a.$h = [], a.$h;
  4965. var e = a.Vd,
  4966. g = a.ff,
  4967. h = Se(c < d ? c : d, a.Me, a.Me + a.Df, !1);
  4968. if (c !== d) {
  4969. var k = D.hh();
  4970. k.reset();
  4971. c < d ? k.scale(1, d / c) : k.scale(c / d, 1);
  4972. Cf(h, k);
  4973. D.lf(k)
  4974. }
  4975. c = h.length;
  4976. for (d = 0; d < c; d++) k = h[d], k[0] += e, k[1] += g, k[2] += e, k[3] += g, k[4] += e, k[5] += g, k[6] += e, k[7] += g;
  4977. a.$h = h;
  4978. return a.$h
  4979. }
  4980. function Wf(a, b, c, d) {
  4981. function e(a, b, c, d) { return (a * d < b * c ? -1 : 1) * Math.acos((a * c + b * d) / (Math.sqrt(a * a + b * b) * Math.sqrt(c * c + d * d))) }
  4982. if (null !== a.$h && !1 === b.ob) return a.$h;
  4983. b = a.Ch;
  4984. var g = a.Og;
  4985. 0 === b && (b = 1E-4);
  4986. 0 === g && (g = 1E-4);
  4987. var h = Math.PI / 180 * a.Vd,
  4988. k = a.qp,
  4989. l = a.Ko,
  4990. m = a.Cb,
  4991. n = a.Jb,
  4992. p = Math.cos(h),
  4993. q = Math.sin(h),
  4994. r = p * (c - m) / 2 + q * (d - n) / 2,
  4995. h = -q * (c - m) / 2 + p * (d - n) / 2,
  4996. s = r * r / (b * b) + h * h / (g * g);
  4997. 1 < s && (b *= Math.sqrt(s), g *= Math.sqrt(s));
  4998. s = (k === l ? -1 : 1) * Math.sqrt((b * b * g * g - b * b * h * h - g * g * r * r) / (b * b * h * h + g * g * r * r));
  4999. isNaN(s) && (s = 0);
  5000. k = s * b * h / g;
  5001. s = s * -g * r /
  5002. b;
  5003. isNaN(k) && (k = 0);
  5004. isNaN(s) && (s = 0);
  5005. c = (c + m) / 2 + p * k - q * s;
  5006. d = (d + n) / 2 + q * k + p * s;
  5007. n = e(1, 0, (r - k) / b, (h - s) / g);
  5008. p = (r - k) / b;
  5009. m = (h - s) / g;
  5010. r = (-r - k) / b;
  5011. k = (-h - s) / g;
  5012. h = e(p, m, r, k);
  5013. r = (p * r + m * k) / (Math.sqrt(p * p + m * m) * Math.sqrt(r * r + k * k)); - 1 >= r ? h = Math.PI : 1 <= r && (h = 0);
  5014. !l && 0 < h && (h -= 2 * Math.PI);
  5015. l && 0 > h && (h += 2 * Math.PI);
  5016. l = b > g ? 1 : b / g;
  5017. r = b > g ? g / b : 1;
  5018. b = Se(b > g ? b : g, n, n + h, !0);
  5019. g = D.hh();
  5020. g.reset();
  5021. g.translate(c, d);
  5022. g.rotate(a.Vd, 0, 0);
  5023. g.scale(l, r);
  5024. Cf(b, g);
  5025. D.lf(g);
  5026. a.$h = b;
  5027. return a.$h
  5028. }
  5029. D.defineProperty($f, { ey: "isClosed" }, function() { return this.hi }, function(a) { this.hi !== a && (this.hi = a, this.ob = !0) });
  5030. D.defineProperty($f, { type: "type" }, function() { return this.da }, function(a) {
  5031. v && D.Da(a, $f, $f, "type");
  5032. this.J && D.qa(this, a);
  5033. this.da = a;
  5034. this.ob = !0
  5035. });
  5036. D.defineProperty($f, { F: "endX" }, function() { return this.Cb }, function(a) {
  5037. v && D.p(a, $f, "endX");
  5038. this.J && D.qa(this, a);
  5039. this.Cb = a;
  5040. this.ob = !0
  5041. });
  5042. D.defineProperty($f, { G: "endY" }, function() { return this.Jb }, function(a) {
  5043. v && D.p(a, $f, "endY");
  5044. this.J && D.qa(this, a);
  5045. this.Jb = a;
  5046. this.ob = !0
  5047. });
  5048. D.defineProperty($f, { Ec: "point1X" }, function() { return this.Vd }, function(a) {
  5049. v && D.p(a, $f, "point1X");
  5050. this.J && D.qa(this, a);
  5051. this.Vd = a;
  5052. this.ob = !0
  5053. });
  5054. D.defineProperty($f, { $c: "point1Y" }, function() { return this.ff }, function(a) {
  5055. v && D.p(a, $f, "point1Y");
  5056. this.J && D.qa(this, a);
  5057. this.ff = a;
  5058. this.ob = !0
  5059. });
  5060. D.defineProperty($f, { Uh: "point2X" }, function() { return this.Ch }, function(a) {
  5061. v && D.p(a, $f, "point2X");
  5062. this.J && D.qa(this, a);
  5063. this.Ch = a;
  5064. this.ob = !0
  5065. });
  5066. D.defineProperty($f, { Vh: "point2Y" }, function() { return this.Og }, function(a) {
  5067. v && D.p(a, $f, "point2Y");
  5068. this.J && D.qa(this, a);
  5069. this.Og = a;
  5070. this.ob = !0
  5071. });
  5072. D.defineProperty($f, { pa: "centerX" }, function() { return this.Vd }, function(a) {
  5073. v && D.p(a, $f, "centerX");
  5074. this.J && D.qa(this, a);
  5075. this.Vd = a;
  5076. this.ob = !0
  5077. });
  5078. D.defineProperty($f, { va: "centerY" }, function() { return this.ff }, function(a) {
  5079. v && D.p(a, $f, "centerY");
  5080. this.J && D.qa(this, a);
  5081. this.ff = a;
  5082. this.ob = !0
  5083. });
  5084. D.defineProperty($f, { radiusX: "radiusX" }, function() { return this.Ch }, function(a) {
  5085. v && D.p(a, $f, "radiusX");
  5086. 0 > a && D.ua(a, ">= zero", $f, "radiusX");
  5087. this.J && D.qa(this, a);
  5088. this.Ch = a;
  5089. this.ob = !0
  5090. });
  5091. D.defineProperty($f, { radiusY: "radiusY" }, function() { return this.Og }, function(a) {
  5092. v && D.p(a, $f, "radiusY");
  5093. 0 > a && D.ua(a, ">= zero", $f, "radiusY");
  5094. this.J && D.qa(this, a);
  5095. this.Og = a;
  5096. this.ob = !0
  5097. });
  5098. D.defineProperty($f, { Me: "startAngle" }, function() { return this.Cb }, function(a) { this.Cb !== a && (this.J && D.qa(this, a), v && D.p(a, $f, "startAngle"), a %= 360, 0 > a && (a += 360), this.Cb = a, this.ob = !0) });
  5099. D.defineProperty($f, { Df: "sweepAngle" }, function() { return this.Jb }, function(a) {
  5100. v && D.p(a, $f, "sweepAngle");
  5101. this.J && D.qa(this, a);
  5102. 360 < a && (a = 360); - 360 > a && (a = -360);
  5103. this.Jb = a;
  5104. this.ob = !0
  5105. });
  5106. D.defineProperty($f, { wm: "isClockwiseArc" }, function() { return this.Ko }, function(a) {
  5107. this.J && D.qa(this, a);
  5108. this.Ko = a;
  5109. this.ob = !0
  5110. });
  5111. D.defineProperty($f, { jy: "isLargeArc" }, function() { return this.qp }, function(a) {
  5112. this.J && D.qa(this, a);
  5113. this.qp = a;
  5114. this.ob = !0
  5115. });
  5116. D.defineProperty($f, { ck: "xAxisRotation" }, function() { return this.Vd }, function(a) {
  5117. v && D.p(a, $f, "xAxisRotation");
  5118. a %= 360;
  5119. 0 > a && (a += 360);
  5120. this.J && D.qa(this, a);
  5121. this.Vd = a;
  5122. this.ob = !0
  5123. });
  5124. function bg() {
  5125. this.ca = null;
  5126. this.AA = (new N(0, 0)).freeze();
  5127. this.Gz = (new N(0, 0)).freeze();
  5128. this.Mv = this.Iw = 0;
  5129. this.Nv = 1;
  5130. this.vw = "";
  5131. this.sx = this.$v = !1;
  5132. this.Yv = this.Ov = 0;
  5133. this.ek = this.hw = this.rw = !1;
  5134. this.$r = null;
  5135. this.px = 0;
  5136. this.Sg = this.ox = null
  5137. }
  5138. D.ka("InputEvent", bg);
  5139. bg.prototype.copy = function() {
  5140. var a = new bg;
  5141. a.ca = this.ca;
  5142. a.AA.assign(this.te);
  5143. a.Gz.assign(this.ha);
  5144. a.Iw = this.Iw;
  5145. a.Mv = this.Mv;
  5146. a.Nv = this.Nv;
  5147. a.vw = this.vw;
  5148. a.$v = this.$v;
  5149. a.sx = this.sx;
  5150. a.Ov = this.Ov;
  5151. a.Yv = this.Yv;
  5152. a.rw = this.rw;
  5153. a.hw = this.hw;
  5154. a.ek = this.ek;
  5155. a.$r = this.$r;
  5156. a.px = this.px;
  5157. a.ox = this.ox;
  5158. a.Sg = this.Sg;
  5159. return a
  5160. };
  5161. bg.prototype.toString = function() {
  5162. var a = "^";
  5163. 0 !== this.xd && (a += "M:" + this.xd);
  5164. 0 !== this.button && (a += "B:" + this.button);
  5165. "" !== this.key && (a += "K:" + this.key);
  5166. 0 !== this.Ee && (a += "C:" + this.Ee);
  5167. 0 !== this.Uk && (a += "D:" + this.Uk);
  5168. this.Cc && (a += "h");
  5169. this.bubbles && (a += "b");
  5170. null !== this.ha && (a += "@" + this.ha.toString());
  5171. return a
  5172. };
  5173. D.defineProperty(bg, { g: "diagram" }, function() { return this.ca }, function(a) { this.ca = a });
  5174. D.defineProperty(bg, { te: "viewPoint" }, function() { return this.AA }, function(a) {
  5175. D.l(a, N, bg, "viewPoint");
  5176. this.AA.assign(a)
  5177. });
  5178. D.defineProperty(bg, { ha: "documentPoint" }, function() { return this.Gz }, function(a) {
  5179. D.l(a, N, bg, "documentPoint");
  5180. this.Gz.assign(a)
  5181. });
  5182. bg.prototype.getMultiTouchViewPoint = bg.prototype.$x = function(a, b) {
  5183. var c = this.g;
  5184. if (null === c) return b;
  5185. cg(c, this.event, a, b);
  5186. return b
  5187. };
  5188. bg.prototype.getMultiTouchDocumentPoint = function(a, b) {
  5189. var c = this.g;
  5190. if (null === c) return b;
  5191. cg(c, this.event, a, b);
  5192. b.assign(c.qC(b));
  5193. return b
  5194. };
  5195. D.defineProperty(bg, { xd: "modifiers" }, function() { return this.Iw }, function(a) { this.Iw = a });
  5196. D.defineProperty(bg, { button: "button" }, function() { return this.Mv }, function(a) {
  5197. this.Mv = a;
  5198. if (null === this.event) switch (a) {
  5199. case 0:
  5200. this.buttons = 1;
  5201. break;
  5202. case 1:
  5203. this.buttons = 4;
  5204. break;
  5205. case 2:
  5206. this.buttons = 2
  5207. }
  5208. });
  5209. D.defineProperty(bg, { buttons: "buttons" }, function() { return this.Nv }, function(a) { this.Nv = a });
  5210. D.defineProperty(bg, { key: "key" }, function() { return this.vw }, function(a) { this.vw = a });
  5211. D.defineProperty(bg, { Vk: "down" }, function() { return this.$v }, function(a) { this.$v = a });
  5212. D.defineProperty(bg, { up: "up" }, function() { return this.sx }, function(a) { this.sx = a });
  5213. D.defineProperty(bg, { Ee: "clickCount" }, function() { return this.Ov }, function(a) { this.Ov = a });
  5214. D.defineProperty(bg, { Uk: "delta" }, function() { return this.Yv }, function(a) { this.Yv = a });
  5215. D.defineProperty(bg, { Ou: "isMultiTouch" }, function() { return this.rw }, function(a) { this.rw = a });
  5216. D.defineProperty(bg, { Cc: "handled" }, function() { return this.hw }, function(a) { this.hw = a });
  5217. D.defineProperty(bg, { bubbles: "bubbles" }, function() { return this.ek }, function(a) { this.ek = a });
  5218. D.defineProperty(bg, { event: "event" }, function() { return this.$r }, function(a) { this.$r = a });
  5219. D.w(bg, { Qj: "isTouchEvent" }, function() {
  5220. var a = window.TouchEvent,
  5221. b = this.event;
  5222. return a && b instanceof a ? !0 : (a = window.PointerEvent) && b instanceof a && ("touch" === b.pointerType || "pen" === b.pointerType)
  5223. });
  5224. D.w(bg, { Qh: "isMac" }, function() { return D.Qh });
  5225. D.defineProperty(bg, { timestamp: "timestamp" }, function() { return this.px }, function(a) { this.px = a });
  5226. D.defineProperty(bg, { Qf: "targetDiagram" }, function() { return this.ox }, function(a) { this.ox = a });
  5227. D.defineProperty(bg, { Ne: "targetObject" }, function() { return this.Sg }, function(a) { this.Sg = a });
  5228. D.defineProperty(bg, { control: "control" }, function() { return 0 !== (this.xd & 1) }, function(a) { this.xd = a ? this.xd | 1 : this.xd & -2 });
  5229. D.defineProperty(bg, { shift: "shift" }, function() { return 0 !== (this.xd & 4) }, function(a) { this.xd = a ? this.xd | 4 : this.xd & -5 });
  5230. D.defineProperty(bg, { alt: "alt" }, function() { return 0 !== (this.xd & 2) }, function(a) { this.xd = a ? this.xd | 2 : this.xd & -3 });
  5231. D.defineProperty(bg, { Xu: "meta" }, function() { return 0 !== (this.xd & 8) }, function(a) { this.xd = a ? this.xd | 8 : this.xd & -9 });
  5232. D.defineProperty(bg, { left: "left" }, function() { var a = this.event; return null === a || "mousedown" !== a.type && "mouseup" !== a.type && "pointerdown" !== a.type && "pointerup" !== a.type ? 0 !== (this.buttons & 1) : 0 === this.button }, function(a) { this.buttons = a ? this.buttons | 1 : this.buttons & -2 });
  5233. D.defineProperty(bg, { right: "right" }, function() { var a = this.event; return null === a || "mousedown" !== a.type && "mouseup" !== a.type && "pointerdown" !== a.type && "pointerup" !== a.type ? 0 !== (this.buttons & 2) : 2 === this.button }, function(a) { this.buttons = a ? this.buttons | 2 : this.buttons & -3 });
  5234. D.defineProperty(bg, { iM: "middle" }, function() { var a = this.event; return null === a || "mousedown" !== a.type && "mouseup" !== a.type && "pointerdown" !== a.type && "pointerup" !== a.type ? 0 !== (this.buttons & 4) : 1 === this.button }, function(a) { this.buttons = a ? this.buttons | 4 : this.buttons & -5 });
  5235. function dg() {
  5236. this.ca = null;
  5237. this.$b = "";
  5238. this.Sw = this.mx = null;
  5239. this.sr = !1
  5240. }
  5241. D.ka("DiagramEvent", dg);
  5242. dg.prototype.copy = function() {
  5243. var a = new dg;
  5244. a.ca = this.ca;
  5245. a.$b = this.$b;
  5246. a.mx = this.mx;
  5247. a.Sw = this.Sw;
  5248. a.sr = this.sr;
  5249. return a
  5250. };
  5251. dg.prototype.toString = function() {
  5252. var a = "*" + this.name;
  5253. null !== this.hC && (a += ":" + this.hC.toString());
  5254. null !== this.LB && (a += "(" + this.LB.toString() + ")");
  5255. return a
  5256. };
  5257. D.defineProperty(dg, { g: "diagram" }, function() { return this.ca }, function(a) { this.ca = a });
  5258. D.defineProperty(dg, { name: "name" }, function() { return this.$b }, function(a) { this.$b = a });
  5259. D.defineProperty(dg, { hC: "subject" }, function() { return this.mx }, function(a) { this.mx = a });
  5260. D.defineProperty(dg, { LB: "parameter" }, function() { return this.Sw }, function(a) { this.Sw = a });
  5261. D.defineProperty(dg, { cancel: "cancel" }, function() { return this.sr }, function(a) {
  5262. this.sr !== a && D.On("DiagramEvent.cancel", "2.0");
  5263. this.sr = a
  5264. });
  5265. function eg() {
  5266. this.tr = fg;
  5267. this.nn = this.Hw = "";
  5268. this.Xs = this.Ys = this.ct = this.dt = this.at = this.ca = this.ye = null
  5269. }
  5270. D.ka("ChangedEvent", eg);
  5271. var gg;
  5272. eg.Transaction = gg = D.s(eg, "Transaction", -1);
  5273. var fg;
  5274. eg.Property = fg = D.s(eg, "Property", 0);
  5275. var hg;
  5276. eg.Insert = hg = D.s(eg, "Insert", 1);
  5277. var ig;
  5278. eg.Remove = ig = D.s(eg, "Remove", 2);
  5279. eg.prototype.clear = eg.prototype.clear = function() { this.Xs = this.Ys = this.ct = this.dt = this.at = this.ca = this.ye = null };
  5280. eg.prototype.copy = function() {
  5281. var a = new eg;
  5282. a.tr = this.tr;
  5283. a.Hw = this.Hw;
  5284. a.nn = this.nn;
  5285. a.ye = this.ye;
  5286. a.ca = this.ca;
  5287. a.at = this.at;
  5288. var b = this.dt;
  5289. a.dt = D.Qa(b) && "function" === typeof b.V ? b.V() : b;
  5290. b = this.ct;
  5291. a.ct = D.Qa(b) && "function" === typeof b.V ? b.V() : b;
  5292. b = this.Ys;
  5293. a.Ys = D.Qa(b) && "function" === typeof b.V ? b.V() : b;
  5294. b = this.Xs;
  5295. a.Xs = D.Qa(b) && "function" === typeof b.V ? b.V() : b;
  5296. return a
  5297. };
  5298. eg.prototype.qc = function(a) { a.Qe === eg ? this.Oc = a : D.ak(this, a) };
  5299. eg.prototype.toString = function() {
  5300. var a = "",
  5301. a = this.Oc === gg ? a + "* " : this.Oc === fg ? a + (null !== this.ea ? "!m" : "!d") : a + ((null !== this.ea ? "!m" : "!d") + this.Oc);
  5302. this.propertyName && "string" === typeof this.propertyName && (a += " " + this.propertyName);
  5303. this.Cf && this.Cf !== this.propertyName && (a += " " + this.Cf);
  5304. a += ": ";
  5305. this.Oc === gg ? null !== this.oldValue && (a += " " + this.oldValue) : (null !== this.object && (a += ia(this.object)), null !== this.oldValue && (a += " old: " + ia(this.oldValue)), null !== this.Wj && (a += " " + this.Wj), null !== this.newValue &&
  5306. (a += " new: " + ia(this.newValue)), null !== this.Uj && (a += " " + this.Uj));
  5307. return a
  5308. };
  5309. eg.prototype.getValue = eg.prototype.oa = function(a) { return a ? this.oldValue : this.newValue };
  5310. eg.prototype.getParam = function(a) { return a ? this.Wj : this.Uj };
  5311. eg.prototype.canUndo = eg.prototype.canUndo = function() { return null !== this.ea || null !== this.g ? !0 : !1 };
  5312. eg.prototype.undo = eg.prototype.undo = function() { this.canUndo() && (null !== this.ea ? this.ea.Fn(this, !0) : null !== this.g && this.g.Fn(this, !0)) };
  5313. eg.prototype.canRedo = eg.prototype.canRedo = function() { return null !== this.ea || null !== this.g ? !0 : !1 };
  5314. eg.prototype.redo = eg.prototype.redo = function() { this.canRedo() && (null !== this.ea ? this.ea.Fn(this, !1) : null !== this.g && this.g.Fn(this, !1)) };
  5315. D.defineProperty(eg, { ea: "model" }, function() { return this.ye }, function(a) { this.ye = a });
  5316. D.defineProperty(eg, { g: "diagram" }, function() { return this.ca }, function(a) { this.ca = a });
  5317. D.defineProperty(eg, { Oc: "change" }, function() { return this.tr }, function(a) {
  5318. v && D.Da(a, eg, eg, "change");
  5319. this.tr = a
  5320. });
  5321. D.defineProperty(eg, { Cf: "modelChange" }, function() { return this.Hw }, function(a) {
  5322. v && D.h(a, "string", eg, "modelChange");
  5323. this.Hw = a
  5324. });
  5325. D.defineProperty(eg, { propertyName: "propertyName" }, function() { return this.nn }, function(a) {
  5326. v && "string" !== typeof a && D.h(a, "function", eg, "propertyName");
  5327. this.nn = a
  5328. });
  5329. D.w(eg, { nG: "isTransactionFinished" }, function() { return this.tr === gg && ("CommittedTransaction" === this.nn || "FinishedUndo" === this.nn || "FinishedRedo" === this.nn) });
  5330. D.defineProperty(eg, { object: "object" }, function() { return this.at }, function(a) { this.at = a });
  5331. D.defineProperty(eg, { oldValue: "oldValue" }, function() { return this.dt }, function(a) { this.dt = a });
  5332. D.defineProperty(eg, { Wj: "oldParam" }, function() { return this.ct }, function(a) { this.ct = a });
  5333. D.defineProperty(eg, { newValue: "newValue" }, function() { return this.Ys }, function(a) { this.Ys = a });
  5334. D.defineProperty(eg, { Uj: "newParam" }, function() { return this.Xs }, function(a) { this.Xs = a });
  5335. function M(a) {
  5336. 1 < arguments.length && D.k("Model constructor can only take one optional argument, the Array of node data.");
  5337. D.xc(this);
  5338. this.Ir = this.$b = "";
  5339. this.dj = !1;
  5340. this.dA = {};
  5341. this.ze = [];
  5342. this.Kc = new oa(null, Object);
  5343. this.Ck = "key";
  5344. this.Po = this.vp = null;
  5345. this.zr = this.Ar = !1;
  5346. this.jr = null;
  5347. this.hn = "category";
  5348. this.zg = new oa(null, L);
  5349. this.yk = null;
  5350. this.vj = !1;
  5351. this.zA = null;
  5352. this.na = new tg;
  5353. void 0 !== a && (this.qg = a)
  5354. }
  5355. D.ka("Model", M);
  5356. M.prototype.cloneProtected = function(a) {
  5357. a.$b = this.$b;
  5358. a.Ir = this.Ir;
  5359. a.dj = this.dj;
  5360. a.Ck = this.Ck;
  5361. a.vp = this.vp;
  5362. a.Po = this.Po;
  5363. a.Ar = this.Ar;
  5364. a.zr = this.zr;
  5365. a.jr = this.jr;
  5366. a.hn = this.hn
  5367. };
  5368. M.prototype.copy = function() {
  5369. var a = new this.constructor;
  5370. this.cloneProtected(a);
  5371. return a
  5372. };
  5373. M.prototype.clear = M.prototype.clear = function() {
  5374. this.ze = [];
  5375. this.Kc.clear();
  5376. this.zg.clear();
  5377. this.na.clear()
  5378. };
  5379. f = M.prototype;
  5380. f.toString = function(a) {
  5381. void 0 === a && (a = 0);
  5382. if (1 < a) return this.kC();
  5383. var b = ("" !== this.name ? this.name : "") + " Model";
  5384. if (0 < a) {
  5385. b += "\n node data:";
  5386. a = this.qg;
  5387. for (var c = D.cb(a), d = 0; d < c; d++) var e = D.La(a, d),
  5388. b = b + (" " + this.zb(e) + ":" + ia(e))
  5389. }
  5390. return b
  5391. };
  5392. f.Ao = function() {
  5393. var a = "";
  5394. "" !== this.name && (a += ',\n "name": ' + this.quote(this.name));
  5395. "" !== this.nm && (a += ',\n "dataFormat": ' + this.quote(this.nm));
  5396. this.qb && (a += ',\n "isReadOnly": ' + this.qb);
  5397. "key" !== this.Vj && "string" === typeof this.Vj && (a += ',\n "nodeKeyProperty": ' + this.quote(this.Vj));
  5398. this.PA && (a += ',\n "copiesArrays": true');
  5399. this.OA && (a += ',\n "copiesArrayObjects": true');
  5400. "category" !== this.oo && "string" === typeof this.oo && (a += ',\n "nodeCategoryProperty": ' + this.quote(this.oo));
  5401. return a
  5402. };
  5403. f.fv = function(a) {
  5404. a.name && (this.name = a.name);
  5405. a.dataFormat && (this.nm = a.dataFormat);
  5406. a.isReadOnly && (this.qb = a.isReadOnly);
  5407. a.nodeKeyProperty && (this.Vj = a.nodeKeyProperty);
  5408. a.copiesArrays && (this.PA = a.copiesArrays);
  5409. a.copiesArrayObjects && (this.OA = a.copiesArrayObjects);
  5410. a.nodeCategoryProperty && (this.oo = a.nodeCategoryProperty)
  5411. };
  5412. function ug(a) { return ',\n "modelData": ' + vg(a, a.fl) }
  5413. function wg(a, b) {
  5414. var c = b.modelData;
  5415. D.Qa(c) && (a.iv(c), a.fl = c)
  5416. }
  5417. f.xC = function() {
  5418. var a = this.fl,
  5419. b = !1,
  5420. c;
  5421. for (c in a)
  5422. if (!xg(c, a[c])) { b = !0; break }
  5423. a = "";
  5424. b && (a = ug(this));
  5425. return a + ',\n "nodeDataArray": ' + yg(this, this.qg, !0)
  5426. };
  5427. f.OB = function(a) {
  5428. wg(this, a);
  5429. a = a.nodeDataArray;
  5430. D.isArray(a) && (this.iv(a), this.qg = a)
  5431. };
  5432. function zg(a, b, c, d) {
  5433. if (b === c) return !0;
  5434. if (typeof b !== typeof c || "function" === typeof b || "function" === typeof c) return !1;
  5435. if (Array.isArray(b) && Array.isArray(c)) {
  5436. if (d.oa(b) === c) return !0;
  5437. d.add(b, c);
  5438. if (b.length !== c.length) return !1;
  5439. for (var e = 0; e < b.length; e++)
  5440. if (!zg(a, b[e], c[e], d)) return !1;
  5441. return !0
  5442. }
  5443. if (D.Qa(b) && D.Qa(c)) {
  5444. if (d.oa(b) === c) return !0;
  5445. d.add(b, c);
  5446. for (e in b) { var g = b[e]; if (!xg(e, g)) { var h = c[e]; if (void 0 === h || !zg(a, g, h, d)) return !1 } }
  5447. for (var k in c)
  5448. if (h = c[k], !xg(k, h) && (g = b[k], void 0 === g || !zg(a, g, h, d))) return !1;
  5449. return !0
  5450. }
  5451. return !1
  5452. }
  5453. function Ag(a, b, c) { a[c] !== b[c] && D.k("Model.computeJsonDifference: Model." + c + ' is not the same in both models: "' + a[c] + '" and "' + b[c] + '"') }
  5454. f.yC = function(a) {
  5455. Ag(this, a, "nodeKeyProperty");
  5456. this instanceof Bg && Ag(this, a, "nodeParentKeyProperty");
  5457. for (var b = new L, c = new L, d = (new L).Vc(this.Kc.pG), e = new oa, g = a.qg, h = 0; h < g.length; h++) {
  5458. var k = g[h],
  5459. l = a.zb(k);
  5460. if (void 0 !== l) {
  5461. d.remove(l);
  5462. var m = this.Ie(l);
  5463. null === m ? (b.add(l), c.add(k)) : zg(this, m, k, e) || c.add(k)
  5464. } else this.zB(k), l = this.zb(k), b.add(l), c.add(k)
  5465. }
  5466. g = "";
  5467. zg(this, this.fl, a.fl, e) || (g += ug(this));
  5468. 0 < b.count && (g += this.iz + yg(this, b.Fc(), !0));
  5469. 0 < c.count && (g += this.GC + yg(this, c.Fc(), !0));
  5470. 0 < d.count && (g += this.kz +
  5471. yg(this, d.Fc(), !0));
  5472. return g
  5473. };
  5474. M.prototype.computeJsonDifference = M.prototype.computeJSONDifference = function(a, b) {
  5475. D.l(a, M, M, "computeJsonDifference:newmodel");
  5476. void 0 === b && (b = this.constructor === M ? "go.Model" : this.constructor === Y ? "go.GraphLinksModel" : this.constructor === Bg ? "go.TreeModel" : D.wf(this));
  5477. return '{ "class": ' + this.quote(b) + ', "incremental": 1' + this.Ao() + this.yC(a) + "}"
  5478. };
  5479. f = M.prototype;
  5480. f.iz = ',\n "insertedNodeKeys": ';
  5481. f.GC = ',\n "modifiedNodeData": ';
  5482. f.kz = ',\n "removedNodeKeys": ';
  5483. f.wC = function(a, b) {
  5484. var c = this,
  5485. d = !1,
  5486. e = new L,
  5487. g = new L,
  5488. h = new L;
  5489. a.fg.each(function(a) { a.ea === c && ("nodeDataArray" === a.Cf ? a.Oc === hg ? e.add(a.newValue) : a.Oc === ig && h.add(a.oldValue) : c.ke(a.object) ? g.add(a.object) : c.fl === a.object && a.Oc === fg && (d = !0)) });
  5490. var k = new L;
  5491. e.each(function(a) {
  5492. k.add(c.zb(a));
  5493. b || g.add(a)
  5494. });
  5495. var l = new L;
  5496. h.each(function(a) {
  5497. l.add(c.zb(a));
  5498. b && g.add(a)
  5499. });
  5500. var m = "";
  5501. d && (m += ug(this));
  5502. 0 < k.count && (m += (b ? this.kz : this.iz) + yg(this, k.Fc(), !0));
  5503. 0 < g.count && (m += this.GC + yg(this, g.Fc(), !0));
  5504. 0 < l.count && (m += (b ?
  5505. this.iz : this.kz) + yg(this, l.Fc(), !0));
  5506. return m
  5507. };
  5508. f.NB = function(a) {
  5509. wg(this, a);
  5510. var b = a.insertedNodeKeys,
  5511. c = a.modifiedNodeData,
  5512. d = new oa;
  5513. if (D.isArray(c))
  5514. for (var e = 0; e < c.length; e++) {
  5515. var g = D.La(c, e),
  5516. h = this.zb(g);
  5517. void 0 !== h && null !== h && d.set(h, g)
  5518. }
  5519. if (D.isArray(b))
  5520. for (var e = D.cb(b), k = 0; k < e; k++) g = D.La(b, k), h = this.Ie(g), null === h && (h = (h = d.get(g)) ? h : this.copyNodeData({}), this.Ty(h, g), this.dm(h));
  5521. if (D.isArray(c))
  5522. for (e = D.cb(c), k = 0; k < e; k++)
  5523. if (g = D.La(c, k), h = this.zb(g), h = this.Ie(h), null !== h)
  5524. for (var l in g) "__gohashid" !== l && l !== this.Vj && l !== this.Iq && this.setDataProperty(h,
  5525. l, g[l]);
  5526. a = a.removedNodeKeys;
  5527. if (D.isArray(a))
  5528. for (e = D.cb(a), k = 0; k < e; k++) g = D.La(a, k), h = this.Ie(g), null !== h && this.Ky(h)
  5529. };
  5530. M.prototype.toIncrementalJson = M.prototype.toIncrementalJSON = function(a, b) {
  5531. D.l(a, eg, M, "toIncrementalJson:e");
  5532. a.Oc !== gg && D.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:" + a.toString());
  5533. var c = a.object;
  5534. if (!(a.nG && c instanceof Cg)) return '{ "incremental": 0 }';
  5535. void 0 === b && (b = this.constructor === M ? "go.Model" : this.constructor === Y ? "go.GraphLinksModel" : this.constructor === Bg ? "go.TreeModel" : D.wf(this));
  5536. return '{ "class": ' + this.quote(b) + ', "incremental": 1' + this.Ao() + this.wC(c, "FinishedUndo" ===
  5537. a.propertyName) + "}"
  5538. };
  5539. M.prototype.toJson = M.prototype.toJSON = M.prototype.kC = function(a) { void 0 === a && (a = this.constructor === M ? "go.Model" : this.constructor === Y ? "go.GraphLinksModel" : this.constructor === Bg ? "go.TreeModel" : D.wf(this)); return '{ "class": ' + this.quote(a) + this.Ao() + this.xC() + "}" };
  5540. M.prototype.applyIncrementalJson = M.prototype.applyIncrementalJSON = function(a) {
  5541. var b = null;
  5542. if ("string" === typeof a)
  5543. if (window.JSON && window.JSON.parse) try { b = window.JSON.parse(a) } catch (c) { v && D.trace("JSON.parse error: " + c.toString()) } else D.trace("WARNING: no JSON.parse available");
  5544. else "object" === typeof a ? b = a : D.k("Unable to modify a Model from: " + a);
  5545. var d = b.incremental;
  5546. "number" !== typeof d && D.k("Unable to apply non-incremental changes to Model: " + a);
  5547. 0 !== d && (this.Nb("applyIncrementalJson"), this.NB(b), this.jd("applyIncrementalJson"))
  5548. };
  5549. M.fromJson = M.fromJSON = function(a, b) {
  5550. void 0 === b && (b = null);
  5551. null !== b && D.l(b, M, M, "fromJson:model");
  5552. var c = null;
  5553. if ("string" === typeof a)
  5554. if (window.JSON && window.JSON.parse) try { c = window.JSON.parse(a) } catch (d) { v && D.trace("JSON.parse error: " + d.toString()) } else D.trace("WARNING: no JSON.parse available");
  5555. else "object" === typeof a ? c = a : D.k("Unable to construct a Model from: " + a);
  5556. if (null === b) {
  5557. var e;
  5558. e = null;
  5559. var g = c["class"];
  5560. if ("string" === typeof g) try {
  5561. var h = null;
  5562. 0 === g.indexOf("go.") ? (g = g.substr(3), h = ba[g]) : (h = ba[g],
  5563. void 0 === h && (h = window[g]));
  5564. "function" === typeof h && (e = new h)
  5565. } catch (k) {}
  5566. null === e || e instanceof M ? b = e : D.k("Unable to construct a Model of declared class: " + c["class"])
  5567. }
  5568. null === b && (b = new Y);
  5569. b.fv(c);
  5570. b.OB(c);
  5571. return b
  5572. };
  5573. M.prototype.replaceJsonObjects = M.prototype.iv = function(a) {
  5574. if (D.isArray(a))
  5575. for (var b = D.cb(a), c = 0; c < b; c++) {
  5576. var d = D.La(a, c);
  5577. D.Qa(d) && D.cF(a, c, this.iv(d))
  5578. } else if (D.Qa(a)) {
  5579. for (c in a)
  5580. if (d = a[c], D.Qa(d) && (d = this.iv(d), a[c] = d, "points" === c && Array.isArray(d))) {
  5581. for (var e = 0 === d.length % 2, g = 0; g < d.length; g++)
  5582. if ("number" !== typeof d[g]) { e = !1; break }
  5583. if (e) {
  5584. e = new K(N);
  5585. for (g = 0; g < d.length / 2; g++) {
  5586. var h = new N(d[2 * g], d[2 * g + 1]);
  5587. e.add(h)
  5588. }
  5589. e.freeze();
  5590. a[c] = e
  5591. }
  5592. }
  5593. if ("object" === typeof a) {
  5594. c = a;
  5595. d = a["class"];
  5596. if ("NaN" === d) c = NaN;
  5597. else if ("Date" ===
  5598. d) c = new Date(a.value);
  5599. else if ("go.Point" === d) c = new N(Dg(a.x), Dg(a.y));
  5600. else if ("go.Size" === d) c = new Ca(Dg(a.width), Dg(a.height));
  5601. else if ("go.Rect" === d) c = new C(Dg(a.x), Dg(a.y), Dg(a.width), Dg(a.height));
  5602. else if ("go.Margin" === d) c = new Lb(Dg(a.top), Dg(a.right), Dg(a.bottom), Dg(a.left));
  5603. else if ("go.Spot" === d) c = "string" === typeof a["enum"] ? cc(a["enum"]) : new S(Dg(a.x), Dg(a.y), Dg(a.offsetX), Dg(a.offsetY));
  5604. else if ("go.Brush" === d) {
  5605. if (c = new Ba, c.type = Ha(Ba, a.type), "string" === typeof a.color && (c.color = a.color), a.start instanceof S && (c.start = a.start), a.end instanceof S && (c.end = a.end), "number" === typeof a.startRadius && (c.sv = Dg(a.startRadius)), "number" === typeof a.endRadius && (c.ou = Dg(a.endRadius)), a = a.colorStops, D.Qa(a))
  5606. for (b in a) c.addColorStop(parseFloat(b), a[b])
  5607. } else "go.Geometry" === d ? (b = null, b = "string" === typeof a.path ? yf(a.path) : new Ve, b.type = Ha(Ve, a.type), "number" === typeof a.startX && (b.la = Dg(a.startX)), "number" === typeof a.startY && (b.ja = Dg(a.startY)), "number" === typeof a.endX && (b.F = Dg(a.endX)), "number" === typeof a.endY && (b.G =
  5608. Dg(a.endY)), a.spot1 instanceof S && (b.C = a.spot1), a.spot2 instanceof S && (b.D = a.spot2), c = b) : "go.EnumValue" === d && (b = a.classType, 0 === b.indexOf("go.") && (b = b.substr(3)), c = Ha(ba[b], a.name));
  5609. a = c
  5610. }
  5611. }
  5612. return a
  5613. };
  5614. M.prototype.quote = function(a) {
  5615. for (var b = "", c = a.length, d = 0; d < c; d++) {
  5616. var e = a[d];
  5617. if ('"' === e || "\\" === e) b += "\\" + e;
  5618. else if ("\b" === e) b += "\\b";
  5619. else if ("\f" === e) b += "\\f";
  5620. else if ("\n" === e) b += "\\n";
  5621. else if ("\r" === e) b += "\\r";
  5622. else if ("\t" === e) b += "\\t";
  5623. else var g = a.charCodeAt(d),
  5624. b = 16 > g ? b + ("\\u000" + a.charCodeAt(d).toString(16)) : 32 > g ? b + ("\\u00" + a.charCodeAt(d).toString(16)) : 8232 === g ? b + "\\u2028" : 8233 === g ? b + "\\u2029" : b + e
  5625. }
  5626. return '"' + b + '"'
  5627. };
  5628. M.prototype.writeJsonValue = M.prototype.xv = function(a) { return void 0 === a ? "undefined" : null === a ? "null" : !0 === a ? "true" : !1 === a ? "false" : "string" === typeof a ? this.quote(a) : "number" === typeof a ? Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : isNaN(a) ? '{"class":"NaN"}' : a.toString() : a instanceof Date ? '{"class":"Date", "value":"' + a.toJSON() + '"}' : a instanceof Number ? this.xv(a.valueOf()) : D.isArray(a) ? yg(this, a) : D.Qa(a) ? vg(this, a) : "function" === typeof a ? "null" : a.toString() };
  5629. function yg(a, b, c) {
  5630. void 0 === c && (c = !1);
  5631. var d = D.cb(b);
  5632. if (0 >= d) return "[]";
  5633. var e = new xa;
  5634. e.add("[ ");
  5635. c && 1 < d && e.add("\n");
  5636. for (var g = 0; g < d; g++) {
  5637. var h = D.La(b, g);
  5638. void 0 !== h && (0 < g && (e.add(","), c && e.add("\n")), e.add(a.xv(h)))
  5639. }
  5640. c && 1 < d && e.add("\n");
  5641. e.add(" ]");
  5642. return e.toString()
  5643. }
  5644. function xg(a, b) { return void 0 === b || "__gohashid" === a || "_" === a[0] || "function" === typeof b ? !0 : !1 }
  5645. function Eg(a) { return isNaN(a) ? "NaN" : Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : a }
  5646. function vg(a, b) {
  5647. var c = b;
  5648. if (c instanceof N) b = { "class": "go.Point", x: Eg(c.x), y: Eg(c.y) };
  5649. else if (c instanceof Ca) b = { "class": "go.Size", width: Eg(c.width), height: Eg(c.height) };
  5650. else if (c instanceof C) b = { "class": "go.Rect", x: Eg(c.x), y: Eg(c.y), width: Eg(c.width), height: Eg(c.height) };
  5651. else if (c instanceof Lb) b = { "class": "go.Margin", top: Eg(c.top), right: Eg(c.right), bottom: Eg(c.bottom), left: Eg(c.left) };
  5652. else if (c instanceof S) b = c.Xc() ? { "class": "go.Spot", x: Eg(c.x), y: Eg(c.y), offsetX: Eg(c.offsetX), offsetY: Eg(c.offsetY) } : { "class": "go.Spot", "enum": c.toString() };
  5653. else if (c instanceof Ba) {
  5654. b = { "class": "go.Brush", type: c.type.name };
  5655. if (c.type === Fg) b.color = c.color;
  5656. else if (c.type === Gg || c.type === Id) b.start = c.start, b.end = c.end, c.type === Id && (0 !== c.sv && (b.startRadius = Eg(c.sv)), isNaN(c.ou) || (b.endRadius = Eg(c.ou)));
  5657. if (null !== c.Qk) {
  5658. for (var d = {}, c = c.Qk.j; c.next();) d[c.key] = c.value;
  5659. b.colorStops = d
  5660. }
  5661. } else if (c instanceof Ve) b = { "class": "go.Geometry", type: c.type.name }, 0 !== c.la && (b.startX = Eg(c.la)), 0 !== c.ja && (b.startY = Eg(c.ja)), 0 !== c.F && (b.endX =
  5662. Eg(c.F)), 0 !== c.G && (b.endY = Eg(c.G)), c.C.O(ec) || (b.spot1 = c.C), c.D.O(vc) || (b.spot2 = c.D), c.type === We && (b.path = xf(c));
  5663. else if (c instanceof ya) b = { "class": "go.EnumValue", classType: D.wf(c.Qe), name: c.name };
  5664. else if (c instanceof O || c instanceof E || c instanceof Hg || c instanceof M || c instanceof Zg || c instanceof qa || c instanceof $g || c instanceof ua || c instanceof tg || c instanceof Cg) return D.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: " + c.toString()),
  5665. "{}";
  5666. var d = "{",
  5667. c = !0,
  5668. e;
  5669. for (e in b) {
  5670. var g = D.xb(b, e);
  5671. if (!xg(e, g))
  5672. if (c ? c = !1 : d += ", ", d += '"' + e + '":', "points" === e && g instanceof K && g.da === N) {
  5673. for (var h = "[", g = g.j; g.next();) {
  5674. var k = g.value;
  5675. 1 < h.length && (h += ",");
  5676. h += a.xv(k.x);
  5677. h += ",";
  5678. h += a.xv(k.y)
  5679. }
  5680. h += "]";
  5681. d += h
  5682. } else d += a.xv(g)
  5683. }
  5684. return d + "}"
  5685. }
  5686. function Dg(a) { return "number" === typeof a ? a : "NaN" === a ? NaN : "9e9999" === a ? Infinity : "-9e9999" === a ? -Infinity : parseFloat(a) }
  5687. D.defineProperty(M, { name: "name" }, function() { return this.$b }, function(a) {
  5688. var b = this.$b;
  5689. b !== a && (D.h(a, "string", M, "name"), this.$b = a, this.i("name", b, a))
  5690. });
  5691. D.defineProperty(M, { nm: "dataFormat" }, function() { return this.Ir }, function(a) {
  5692. var b = this.Ir;
  5693. b !== a && (D.h(a, "string", M, "dataFormat"), this.Ir = a, this.i("dataFormat", b, a))
  5694. });
  5695. D.defineProperty(M, { qb: "isReadOnly" }, function() { return this.dj }, function(a) {
  5696. var b = this.dj;
  5697. b !== a && (D.h(a, "boolean", M, "isReadOnly"), this.dj = a, this.i("isReadOnly", b, a))
  5698. });
  5699. D.defineProperty(M, { fl: "modelData" }, function() { return this.dA }, function(a) {
  5700. var b = this.dA;
  5701. b !== a && (D.h(a, "object", M, "modelData"), this.dA = a, this.i("modelData", b, a), this.Ob(a))
  5702. });
  5703. M.prototype.addChangedListener = M.prototype.Bn = function(a) {
  5704. D.h(a, "function", M, "addChangedListener:listener");
  5705. null === this.yk && (this.yk = new K("function"));
  5706. this.yk.add(a)
  5707. };
  5708. M.prototype.removeChangedListener = M.prototype.gv = function(a) {
  5709. D.h(a, "function", M, "removeChangedListener:listener");
  5710. null !== this.yk && (this.yk.remove(a), 0 === this.yk.count && (this.yk = null))
  5711. };
  5712. M.prototype.Gx = function(a) {
  5713. this.kb || this.na.ZF(a);
  5714. if (null !== this.yk)
  5715. for (var b = this.yk, c = b.length, d = 0; d < c; d++) b.fa(d)(a)
  5716. };
  5717. M.prototype.raiseChangedEvent = M.prototype.od = function(a, b, c, d, e, g, h) { ah(this, "", a, b, c, d, e, g, h) };
  5718. M.prototype.raiseChanged = M.prototype.i = function(a, b, c, d, e) { ah(this, "", fg, a, this, b, c, d, e) };
  5719. M.prototype.raiseDataChanged = M.prototype.MB = function(a, b, c, d, e, g) { ah(this, "", fg, b, a, c, d, e, g) };
  5720. function ah(a, b, c, d, e, g, h, k, l) {
  5721. void 0 === k && (k = null);
  5722. void 0 === l && (l = null);
  5723. var m = new eg;
  5724. m.ea = a;
  5725. m.Oc = c;
  5726. m.Cf = b;
  5727. m.propertyName = d;
  5728. m.object = e;
  5729. m.oldValue = g;
  5730. m.Wj = k;
  5731. m.newValue = h;
  5732. m.Uj = l;
  5733. a.Gx(m)
  5734. }
  5735. D.defineProperty(M, { na: "undoManager" }, function() { return this.zA }, function(a) {
  5736. var b = this.zA;
  5737. b !== a && (D.l(a, tg, M, "undoManager"), null !== b && b.fK(this), this.zA = a, null !== a && a.YH(this))
  5738. });
  5739. D.defineProperty(M, { kb: "skipsUndoManager" }, function() { return this.vj }, function(a) {
  5740. D.h(a, "boolean", M, "skipsUndoManager");
  5741. this.vj = a
  5742. });
  5743. M.prototype.Fn = function(a, b) {
  5744. if (null !== a && a.ea === this)
  5745. if (a.Oc === fg) {
  5746. var c = a.object,
  5747. d = a.propertyName,
  5748. e = a.oa(b);
  5749. D.Ua(c, d, e)
  5750. } else a.Oc === hg ? (c = a.Uj, "nodeDataArray" === a.Cf ? (d = a.newValue, D.Qa(d) && "number" === typeof c && (e = this.zb(d), b ? (D.La(this.ze, c) === d && D.Vg(this.ze, c), void 0 !== e && this.Kc.remove(e)) : (D.La(this.ze, c) !== d && D.Ih(this.ze, c, d), void 0 !== e && this.Kc.add(e, d)))) : "" === a.Cf ? (d = a.object, !D.isArray(d) && a.propertyName && (d = D.xb(a.object, a.propertyName)), D.isArray(d) && "number" === typeof c && (e = a.newValue,
  5751. b ? D.Vg(d, c) : D.Ih(d, c, e))) : D.k("unknown ChangedEvent.Insert modelChange: " + a.toString())) : a.Oc === ig ? (c = a.Wj, "nodeDataArray" === a.Cf ? (d = a.oldValue, D.Qa(d) && "number" === typeof c && (e = this.zb(d), b ? (D.La(this.ze, c) !== d && D.Ih(this.ze, c, d), void 0 !== e && this.Kc.add(e, d)) : (D.La(this.ze, c) === d && D.Vg(this.ze, c), void 0 !== e && this.Kc.remove(e)))) : "" === a.Cf ? (d = a.object, !D.isArray(d) && a.propertyName && (d = D.xb(a.object, a.propertyName)), D.isArray(d) && "number" === typeof c && (e = a.oldValue, b ? D.Ih(d, c, e) : D.Vg(d, c))) : D.k("unknown ChangedEvent.Remove modelChange: " +
  5752. a.toString())) : a.Oc !== gg && D.k("unknown ChangedEvent: " + a.toString())
  5753. };
  5754. M.prototype.startTransaction = M.prototype.Nb = function(a) { return this.na.Nb(a) };
  5755. M.prototype.commitTransaction = M.prototype.jd = function(a) { return this.na.jd(a) };
  5756. M.prototype.rollbackTransaction = M.prototype.Am = function() { return this.na.Am() };
  5757. M.prototype.commit = function(a, b) {
  5758. var c = b;
  5759. void 0 === c && (c = "");
  5760. var d = this.kb;
  5761. null === c && (this.kb = !0, c = "");
  5762. this.na.Nb(c);
  5763. var e = !1;
  5764. try { a(this), e = !0 } finally { e ? this.na.jd(c) : this.na.Am(), this.kb = d }
  5765. };
  5766. M.prototype.updateTargetBindings = M.prototype.Ob = function(a, b) {
  5767. void 0 === b && (b = "");
  5768. ah(this, "SourceChanged", gg, b, a, null, null)
  5769. };
  5770. D.defineProperty(M, { Vj: "nodeKeyProperty" }, function() { return this.Ck }, function(a) {
  5771. var b = this.Ck;
  5772. b !== a && (bh(a, M, "nodeKeyProperty"), "" === a && D.k("Model.nodeKeyProperty may not be the empty string"), 0 < this.Kc.count && D.k("Cannot set Model.nodeKeyProperty when there is existing node data"), this.Ck = a, this.i("nodeKeyProperty", b, a))
  5773. });
  5774. function bh(a, b, c) { "string" !== typeof a && "function" !== typeof a && D.kc(a, "string or function", b, c) }
  5775. M.prototype.getKeyForNodeData = M.prototype.zb = function(a) {
  5776. if (null !== a) {
  5777. var b = this.Ck;
  5778. if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
  5779. if (ch(b)) return b;
  5780. D.k("Key value for node data " + a + " is not a number or a string: " + b)
  5781. }
  5782. }
  5783. };
  5784. M.prototype.setKeyForNodeData = M.prototype.Ty = function(a, b) {
  5785. void 0 !== b && null !== b && ch(b) || D.kc(b, "number or string", M, "setKeyForNodeData:key");
  5786. if (null !== a) {
  5787. var c = this.Ck;
  5788. if ("" !== c)
  5789. if (this.ke(a)) {
  5790. var d = D.xb(a, c);
  5791. d !== b && null === this.Ie(b) && (D.Ua(a, c, b), this.Kc.remove(d), this.Kc.add(b, a), ah(this, "nodeKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c), this.hv(d, b))
  5792. } else D.Ua(a, c, b)
  5793. }
  5794. };
  5795. D.defineProperty(M, { bM: "makeUniqueKeyFunction" }, function() { return this.vp }, function(a) {
  5796. var b = this.vp;
  5797. b !== a && (null !== a && D.h(a, "function", M, "makeUniqueKeyFunction"), this.vp = a, this.i("makeUniqueKeyFunction", b, a))
  5798. });
  5799. function ch(a) { return "number" === typeof a || "string" === typeof a }
  5800. M.prototype.containsNodeData = M.prototype.ke = function(a) { var b = this.zb(a); return void 0 === b ? !1 : this.Kc.oa(b) === a };
  5801. M.prototype.findNodeDataForKey = M.prototype.Ie = function(a) { null === a && D.k("Model.findNodeDataForKey:key must not be null"); return void 0 !== a && ch(a) ? this.Kc.oa(a) : null };
  5802. D.defineProperty(M, { qg: "nodeDataArray" }, function() { return this.ze }, function(a) {
  5803. var b = this.ze;
  5804. if (b !== a) {
  5805. D.gu(a, M, "nodeDataArray");
  5806. this.Kc.clear();
  5807. this.sC();
  5808. for (var c = D.cb(a), d = 0; d < c; d++) {
  5809. var e = D.La(a, d);
  5810. if (!D.Qa(e)) { D.k("Model.nodeDataArray must only contain Objects, not: " + e); return }
  5811. D.sq(e)
  5812. }
  5813. this.ze = a;
  5814. for (var g = new K(Object), d = 0; d < c; d++) {
  5815. var e = D.La(a, d),
  5816. h = this.zb(e);
  5817. void 0 === h ? g.add(e) : null !== this.Kc.oa(h) ? g.add(e) : this.Kc.add(h, e)
  5818. }
  5819. for (d = g.j; d.next();) e = d.value, this.zB(e), g = this.zb(e), void 0 !== g &&
  5820. this.Kc.add(g, e);
  5821. ah(this, "nodeDataArray", fg, "nodeDataArray", this, b, a);
  5822. for (d = 0; d < c; d++) e = D.La(a, d), this.Qq(e), this.Pq(e);
  5823. this.gF();
  5824. D.qJ(a) || (this.qb = !0)
  5825. }
  5826. });
  5827. M.prototype.makeNodeDataKeyUnique = M.prototype.zB = function(a) {
  5828. if (null !== a) {
  5829. var b = this.Ck;
  5830. if ("" !== b) {
  5831. var c = this.zb(a);
  5832. if (void 0 === c || this.Kc.contains(c)) {
  5833. var d = this.vp;
  5834. if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.Kc.contains(c))) { D.Ua(a, b, c); return }
  5835. if ("string" === typeof c) {
  5836. for (d = 2; this.Kc.contains(c + d);) d++;
  5837. D.Ua(a, b, c + d)
  5838. } else if (void 0 === c || "number" === typeof c) {
  5839. for (d = -this.Kc.count - 1; this.Kc.contains(d);) d--;
  5840. D.Ua(a, b, d)
  5841. } else D.k("Model.getKeyForNodeData returned something other than a string or a number: " +
  5842. c)
  5843. }
  5844. }
  5845. }
  5846. };
  5847. M.prototype.addNodeData = M.prototype.dm = function(a) { null !== a && (D.sq(a), this.ke(a) || dh(this, a, !0)) };
  5848. function dh(a, b, c) { var d = a.zb(b); if (void 0 === d || a.Kc.oa(d) !== b) a.zB(b), d = a.zb(b), void 0 === d ? D.k("Model.makeNodeDataKeyUnique failed on " + b + ". Data not added to Model.") : (a.Kc.add(d, b), d = null, c && (d = D.cb(a.ze), D.Ih(a.ze, d, b)), ah(a, "nodeDataArray", hg, "nodeDataArray", a, null, b, null, d), a.Qq(b), a.Pq(b)) }
  5849. M.prototype.addNodeDataCollection = function(a) {
  5850. if (D.isArray(a))
  5851. for (var b = D.cb(a), c = 0; c < b; c++) this.dm(D.La(a, c));
  5852. else
  5853. for (a = a.j; a.next();) this.dm(a.value)
  5854. };
  5855. M.prototype.removeNodeData = M.prototype.Ky = function(a) { null !== a && eh(this, a, !0) };
  5856. function eh(a, b, c) {
  5857. var d = a.zb(b);
  5858. void 0 !== d && a.Kc.remove(d);
  5859. d = null;
  5860. if (c) {
  5861. d = D.hm(a.ze, b);
  5862. if (0 > d) return;
  5863. D.Vg(a.ze, d)
  5864. }
  5865. ah(a, "nodeDataArray", ig, "nodeDataArray", a, b, null, d, null);
  5866. a.wv(b)
  5867. }
  5868. M.prototype.removeNodeDataCollection = function(a) {
  5869. if (D.isArray(a))
  5870. for (var b = D.cb(a), c = 0; c < b; c++) this.Ky(D.La(a, c));
  5871. else
  5872. for (a = a.j; a.next();) this.Ky(a.value)
  5873. };
  5874. f = M.prototype;
  5875. f.hv = function(a, b) {
  5876. var c = fh(this, a);
  5877. c instanceof L && this.zg.add(b, c)
  5878. };
  5879. f.sC = function() {};
  5880. f.Qq = function() {};
  5881. f.Pq = function() {};
  5882. f.wv = function() {};
  5883. function gh(a, b, c) {
  5884. if (void 0 !== b) {
  5885. var d = a.zg.oa(b);
  5886. null === d && (d = new L(Object), a.zg.add(b, d));
  5887. d.add(c)
  5888. }
  5889. }
  5890. function hh(a, b, c) {
  5891. if (void 0 !== b) {
  5892. var d = a.zg.oa(b);
  5893. d instanceof L && (void 0 === c || null === c ? a.zg.remove(b) : (d.remove(c), 0 === d.count && a.zg.remove(b)))
  5894. }
  5895. }
  5896. function fh(a, b) { if (void 0 === b) return null; var c = a.zg.oa(b); return c instanceof L ? c : null }
  5897. M.prototype.clearUnresolvedReferences = M.prototype.gF = function(a) { void 0 === a ? this.zg.clear() : this.zg.remove(a) };
  5898. D.defineProperty(M, { uL: "copyNodeDataFunction" }, function() { return this.Po }, function(a) {
  5899. var b = this.Po;
  5900. b !== a && (null !== a && D.h(a, "function", M, "copyNodeDataFunction"), this.Po = a, this.i("copyNodeDataFunction", b, a))
  5901. });
  5902. D.defineProperty(M, { PA: "copiesArrays" }, function() { return this.Ar }, function(a) {
  5903. var b = this.Ar;
  5904. b !== a && (null !== a && D.h(a, "boolean", M, "copiesArrays"), this.Ar = a, this.i("copiesArrays", b, a))
  5905. });
  5906. D.defineProperty(M, { OA: "copiesArrayObjects" }, function() { return this.zr }, function(a) {
  5907. var b = this.zr;
  5908. b !== a && (null !== a && D.h(a, "boolean", M, "copiesArrayObjects"), this.zr = a, this.i("copiesArrayObjects", b, a))
  5909. });
  5910. M.prototype.copyNodeData = function(a) {
  5911. if (null === a) return null;
  5912. var b = null,
  5913. b = this.Po,
  5914. b = null !== b ? b(a, this) : ih(this, a, !0);
  5915. D.Qa(b) && D.xc(b);
  5916. return b
  5917. };
  5918. function ih(a, b, c) {
  5919. if (a.PA && Array.isArray(b)) {
  5920. var d = [];
  5921. for (c = 0; c < b.length; c++) {
  5922. var e = ih(a, b[c], a.OA);
  5923. d.push(e)
  5924. }
  5925. D.xc(d);
  5926. return d
  5927. }
  5928. if (c && D.Qa(b)) {
  5929. c = (c = b.constructor) ? new c : {};
  5930. for (d in b)
  5931. if ("__gohashid" !== d) {
  5932. var e = D.xb(b, d),
  5933. g;
  5934. g = e;
  5935. g instanceof O || g instanceof E || g instanceof Hg || g instanceof jh || g instanceof kh || g instanceof Zg || g instanceof qa || g instanceof $g || g instanceof bg || g instanceof dg ? ("_" !== d[0] && D.trace('Warning: found GraphObject or Diagram reference when copying model data on property "' +
  5936. d + '" of data object: ' + b.toString() + " \nModel data should not have any references to a Diagram or any part of a diagram, such as: " + g.toString()), g = !0) : g = g instanceof M || g instanceof tg || g instanceof Cg || g instanceof eg ? !0 : !1;
  5937. g || (e = ih(a, e, !1));
  5938. D.Ua(c, d, e)
  5939. }
  5940. D.xc(c);
  5941. return c
  5942. }
  5943. return b instanceof N ? b.copy() : b instanceof Ca ? b.copy() : b instanceof C ? b.copy() : b instanceof S ? b.copy() : b instanceof Lb ? b.copy() : b
  5944. }
  5945. D.defineProperty(M, { $H: "afterCopyFunction" }, function() { return this.jr }, function(a) {
  5946. var b = this.jr;
  5947. b !== a && (null !== a && D.h(a, "function", M, "afterCopyFunction"), this.jr = a, this.i("afterCopyFunction", b, a))
  5948. });
  5949. var lh = !1;
  5950. M.prototype.set = function(a, b, c) { this.setDataProperty(a, b, c) };
  5951. M.prototype.set = M.prototype.setDataProperty = function(a, b, c) {
  5952. v && (D.h(a, "object", M, "setDataProperty:data"), D.h(b, "string", M, "setDataProperty:propname"), "" === b && D.k("Model.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
  5953. if (this.ke(a))
  5954. if (b === this.Vj) this.Ty(a, c);
  5955. else { if (b === this.oo) { this.Ry(a, c); return } }
  5956. else !lh && a instanceof O && (lh = !0, D.trace('Model.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), D.trace(" Is that really your intent?"));
  5957. var d = D.xb(a,
  5958. b);
  5959. d !== c && (D.Ua(a, b, c), this.MB(a, b, d, c))
  5960. };
  5961. M.prototype.addArrayItem = function(a, b) { this.mB(a, -1, b) };
  5962. M.prototype.insertArrayItem = M.prototype.mB = function(a, b, c) {
  5963. v && (D.gu(a, M, "insertArrayItem:arr"), D.p(b, M, "insertArrayItem:idx"));
  5964. a === this.ze && D.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");
  5965. 0 > b && (b = D.cb(a));
  5966. D.Ih(a, b, c);
  5967. ah(this, "", hg, "", a, null, c, null, b)
  5968. };
  5969. M.prototype.removeArrayItem = M.prototype.IG = function(a, b) {
  5970. void 0 === b && (b = -1);
  5971. v && (D.gu(a, M, "removeArrayItem:arr"), D.p(b, M, "removeArrayItem:idx"));
  5972. a === this.ze && D.k("Model.removeArrayItem should not be called on the Model.nodeDataArray"); - 1 === b && (b = D.cb(a) - 1);
  5973. var c = D.La(a, b);
  5974. D.Vg(a, b);
  5975. ah(this, "", ig, "", a, c, null, b, null)
  5976. };
  5977. D.defineProperty(M, { oo: "nodeCategoryProperty" }, function() { return this.hn }, function(a) {
  5978. var b = this.hn;
  5979. b !== a && (bh(a, M, "nodeCategoryProperty"), this.hn = a, this.i("nodeCategoryProperty", b, a))
  5980. });
  5981. M.prototype.getCategoryForNodeData = M.prototype.eB = function(a) {
  5982. if (null === a) return "";
  5983. var b = this.hn;
  5984. if ("" === b) return "";
  5985. b = D.xb(a, b);
  5986. if (void 0 === b) return "";
  5987. if ("string" === typeof b) return b;
  5988. D.k("getCategoryForNodeData found a non-string category for " + a + ": " + b);
  5989. return ""
  5990. };
  5991. M.prototype.setCategoryForNodeData = M.prototype.Ry = function(a, b) {
  5992. D.h(b, "string", M, "setCategoryForNodeData:cat");
  5993. if (null !== a) {
  5994. var c = this.hn;
  5995. if ("" !== c)
  5996. if (this.ke(a)) {
  5997. var d = D.xb(a, c);
  5998. void 0 === d && (d = "");
  5999. d !== b && (D.Ua(a, c, b), ah(this, "nodeCategory", fg, c, a, d, b))
  6000. } else D.Ua(a, c, b)
  6001. }
  6002. };
  6003. function Y(a, b) {
  6004. M.call(this);
  6005. 2 < arguments.length && D.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");
  6006. this.df = [];
  6007. this.ki = new L(Object);
  6008. this.td = new oa(null, Object);
  6009. this.Ol = "";
  6010. this.yl = this.Oo = this.wp = null;
  6011. this.li = "from";
  6012. this.mi = "to";
  6013. this.dn = this.cn = "";
  6014. this.bn = "category";
  6015. this.Kg = "";
  6016. this.zp = "isGroup";
  6017. this.Ah = "group";
  6018. this.Br = !1;
  6019. void 0 !== a && (this.qg = a);
  6020. void 0 !== b && (this.$g = b)
  6021. }
  6022. D.Ta(Y, M);
  6023. D.ka("GraphLinksModel", Y);
  6024. Y.prototype.cloneProtected = function(a) {
  6025. M.prototype.cloneProtected.call(this, a);
  6026. a.Ol = this.Ol;
  6027. a.wp = this.wp;
  6028. a.Oo = this.Oo;
  6029. a.li = this.li;
  6030. a.mi = this.mi;
  6031. a.cn = this.cn;
  6032. a.dn = this.dn;
  6033. a.bn = this.bn;
  6034. a.Kg = this.Kg;
  6035. a.zp = this.zp;
  6036. a.Ah = this.Ah;
  6037. a.Br = this.Br
  6038. };
  6039. Y.prototype.clear = Y.prototype.clear = function() {
  6040. M.prototype.clear.call(this);
  6041. this.df = [];
  6042. this.td.clear();
  6043. this.ki.clear()
  6044. };
  6045. f = Y.prototype;
  6046. f.toString = function(a) {
  6047. void 0 === a && (a = 0);
  6048. if (2 <= a) return this.kC();
  6049. var b = ("" !== this.name ? this.name : "") + " GraphLinksModel";
  6050. if (0 < a) {
  6051. b += "\n node data:";
  6052. a = this.qg;
  6053. for (var c = D.cb(a), d = 0, d = 0; d < c; d++) var e = D.La(a, d),
  6054. b = b + (" " + this.zb(e) + ":" + ia(e));
  6055. b += "\n link data:";
  6056. a = this.$g;
  6057. c = D.cb(a);
  6058. for (d = 0; d < c; d++) e = D.La(a, d), b += " " + this.tm(e) + "--\x3e" + this.um(e)
  6059. }
  6060. return b
  6061. };
  6062. f.Ao = function() {
  6063. var a = M.prototype.Ao.call(this),
  6064. b = "";
  6065. "category" !== this.Su && "string" === typeof this.Su && (b += ',\n "linkCategoryProperty": ' + this.quote(this.Su));
  6066. "" !== this.Tj && "string" === typeof this.Tj && (b += ',\n "linkKeyProperty": ' + this.quote(this.Tj));
  6067. "from" !== this.co && "string" === typeof this.co && (b += ',\n "linkFromKeyProperty": ' + this.quote(this.co));
  6068. "to" !== this.eo && "string" === typeof this.eo && (b += ',\n "linkToKeyProperty": ' + this.quote(this.eo));
  6069. "" !== this.Tu && "string" === typeof this.Tu && (b += ',\n "linkFromPortIdProperty": ' +
  6070. this.quote(this.Tu));
  6071. "" !== this.Vu && "string" === typeof this.Vu && (b += ',\n "linkToPortIdProperty": ' + this.quote(this.Vu));
  6072. "" !== this.Uu && "string" === typeof this.Uu && (b += ',\n "linkLabelKeysProperty": ' + this.quote(this.Uu));
  6073. "isGroup" !== this.Iq && "string" === typeof this.Iq && (b += ',\n "nodeIsGroupProperty": ' + this.quote(this.Iq));
  6074. "group" !== this.bv && "string" === typeof this.bv && (b += ',\n "nodeGroupKeyProperty": ' + this.quote(this.bv));
  6075. return a + b
  6076. };
  6077. f.fv = function(a) {
  6078. M.prototype.fv.call(this, a);
  6079. a.linkKeyProperty && (this.Tj = a.linkKeyProperty);
  6080. a.linkFromKeyProperty && (this.co = a.linkFromKeyProperty);
  6081. a.linkToKeyProperty && (this.eo = a.linkToKeyProperty);
  6082. a.linkFromPortIdProperty && (this.Tu = a.linkFromPortIdProperty);
  6083. a.linkToPortIdProperty && (this.Vu = a.linkToPortIdProperty);
  6084. a.linkCategoryProperty && (this.Su = a.linkCategoryProperty);
  6085. a.linkLabelKeysProperty && (this.Uu = a.linkLabelKeysProperty);
  6086. a.nodeIsGroupProperty && (this.Iq = a.nodeIsGroupProperty);
  6087. a.nodeGroupKeyProperty &&
  6088. (this.bv = a.nodeGroupKeyProperty)
  6089. };
  6090. f.xC = function() {
  6091. var a = M.prototype.xC.call(this),
  6092. b = ',\n "linkDataArray": ' + yg(this, this.$g, !0);
  6093. return a + b
  6094. };
  6095. f.OB = function(a) {
  6096. M.prototype.OB.call(this, a);
  6097. a = a.linkDataArray;
  6098. D.isArray(a) && (this.iv(a), this.$g = a)
  6099. };
  6100. f.yC = function(a) {
  6101. if (!(a instanceof Y)) return D.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel"), "";
  6102. "" === this.Tj && D.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");
  6103. var b = M.prototype.yC.call(this, a);
  6104. Ag(this, a, "linkKeyProperty");
  6105. Ag(this, a, "linkFromKeyProperty");
  6106. Ag(this, a, "linkToKeyProperty");
  6107. Ag(this, a, "linkLabelKeysProperty");
  6108. Ag(this, a, "nodeIsGroupProperty");
  6109. Ag(this, a, "nodeGroupKeyProperty");
  6110. for (var c = new L, d = new L, e = (new L).Vc(this.td.pG),
  6111. g = new oa, h = a.$g, k = 0; k < h.length; k++) {
  6112. var l = h[k],
  6113. m = a.mf(l);
  6114. if (void 0 !== m) {
  6115. e.remove(m);
  6116. var n = this.oq(m);
  6117. null === n ? (c.add(m), d.add(l)) : zg(this, n, l, g) || d.add(l)
  6118. } else this.vy(l), m = this.mf(l), c.add(m), d.add(l)
  6119. }
  6120. a = b;
  6121. 0 < c.count && (a += this.hz + yg(this, c.Fc(), !0));
  6122. 0 < d.count && (a += this.FC + yg(this, d.Fc(), !0));
  6123. 0 < e.count && (a += this.jz + yg(this, e.Fc(), !0));
  6124. return a
  6125. };
  6126. f.hz = ',\n "insertedLinkKeys": ';
  6127. f.FC = ',\n "modifiedLinkData": ';
  6128. f.jz = ',\n "removedLinkKeys": ';
  6129. f.wC = function(a, b) {
  6130. "" === this.Tj && D.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");
  6131. var c = M.prototype.wC.call(this, a, b),
  6132. d = this,
  6133. e = new L,
  6134. g = new L,
  6135. h = new L;
  6136. a.fg.each(function(a) { a.ea === d && ("linkDataArray" === a.Cf ? a.Oc === hg ? e.add(a.newValue) : a.Oc === ig && h.add(a.oldValue) : d.Lh(a.object) && g.add(a.object)) });
  6137. var k = new L;
  6138. e.each(function(a) {
  6139. k.add(d.mf(a));
  6140. b || g.add(a)
  6141. });
  6142. var l = new L;
  6143. h.each(function(a) {
  6144. l.add(d.mf(a));
  6145. b && g.add(a)
  6146. });
  6147. 0 < k.count && (c += (b ? this.jz : this.hz) +
  6148. yg(this, k.Fc(), !0));
  6149. 0 < g.count && (c += this.FC + yg(this, g.Fc(), !0));
  6150. 0 < l.count && (c += (b ? this.hz : this.jz) + yg(this, l.Fc(), !0));
  6151. return c
  6152. };
  6153. f.NB = function(a) {
  6154. M.prototype.NB.call(this, a);
  6155. var b = a.insertedLinkKeys,
  6156. c = a.modifiedLinkData,
  6157. d = new oa;
  6158. if (D.isArray(c))
  6159. for (var e = 0; e < c.length; e++) {
  6160. var g = D.La(c, e),
  6161. h = this.mf(g);
  6162. void 0 !== h && null !== h && d.set(h, g)
  6163. }
  6164. if (D.isArray(b))
  6165. for (var e = D.cb(b), k = 0; k < e; k++) g = D.La(b, k), h = this.oq(g), null === h && (h = (h = d.get(g)) ? h : this.Kx({}), this.cH(h, g), this.au(h));
  6166. if (D.isArray(c))
  6167. for (e = D.cb(c), k = 0; k < e; k++)
  6168. if (g = D.La(c, k), h = this.mf(g), h = this.oq(h), null !== h)
  6169. for (var l in g) "__gohashid" !== l && l !== this.Tj && this.setDataProperty(h,
  6170. l, g[l]);
  6171. a = a.removedLinkKeys;
  6172. if (D.isArray(a))
  6173. for (e = D.cb(a), k = 0; k < e; k++) g = D.La(a, k), h = this.oq(g), null !== h && this.Jy(h)
  6174. };
  6175. f.Fn = function(a, b) {
  6176. if (a.Oc === hg) {
  6177. var c = a.Uj;
  6178. if ("linkDataArray" === a.Cf) {
  6179. var d = a.newValue;
  6180. if (D.Qa(d) && "number" === typeof c) {
  6181. var e = this.mf(d);
  6182. b ? (this.ki.remove(d), D.La(this.df, c) === d && D.Vg(this.df, c), void 0 !== e && this.td.remove(e)) : (this.ki.add(d), D.La(this.df, c) !== d && D.Ih(this.df, c, d), void 0 !== e && this.td.add(e, d))
  6183. }
  6184. return
  6185. }
  6186. if ("linkLabelKeys" === a.Cf) {
  6187. d = this.$k(a.object);
  6188. D.isArray(d) && "number" === typeof c && (b ? (c = D.hm(d, a.newValue), 0 <= c && D.Vg(d, c)) : 0 > D.hm(d, a.newValue) && D.Ih(d, c, a.newValue));
  6189. return
  6190. }
  6191. } else if (a.Oc ===
  6192. ig) {
  6193. c = a.Wj;
  6194. if ("linkDataArray" === a.Cf) {
  6195. d = a.oldValue;
  6196. D.Qa(d) && "number" === typeof c && (e = this.mf(d), b ? (this.ki.add(d), D.La(this.df, c) !== d && D.Ih(this.df, c, d), void 0 !== e && this.td.add(e, d)) : (this.ki.remove(d), D.La(this.df, c) === d && D.Vg(this.df, c), void 0 !== e && this.td.remove(e)));
  6197. return
  6198. }
  6199. if ("linkLabelKeys" === a.Cf) {
  6200. d = this.$k(a.object);
  6201. D.isArray(d) && "number" === typeof c && (b ? 0 > D.hm(d, a.newValue) && D.Ih(d, c, a.newValue) : (c = D.hm(d, a.newValue), 0 <= c && D.Vg(d, c)));
  6202. return
  6203. }
  6204. }
  6205. M.prototype.Fn.call(this, a, b)
  6206. };
  6207. D.defineProperty(Y, { GA: "archetypeNodeData" }, function() { return this.yl }, function(a) {
  6208. var b = this.yl;
  6209. b !== a && (null !== a && D.l(a, Object, Y, "archetypeNodeData"), this.yl = a, this.i("archetypeNodeData", b, a))
  6210. });
  6211. Y.prototype.fo = function(a) {
  6212. if (void 0 !== a) {
  6213. var b = this.yl;
  6214. if (null !== b) {
  6215. var c = this.Ie(a);
  6216. null === c && (c = this.copyNodeData(b), D.Ua(c, this.Ck, a), this.dm(c))
  6217. }
  6218. return a
  6219. }
  6220. };
  6221. D.defineProperty(Y, { co: "linkFromKeyProperty" }, function() { return this.li }, function(a) {
  6222. var b = this.li;
  6223. b !== a && (bh(a, Y, "linkFromKeyProperty"), this.li = a, this.i("linkFromKeyProperty", b, a))
  6224. });
  6225. Y.prototype.getFromKeyForLinkData = Y.prototype.tm = function(a) {
  6226. if (null !== a) {
  6227. var b = this.li;
  6228. if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
  6229. if (ch(b)) return b;
  6230. D.k("FromKey value for link data " + a + " is not a number or a string: " + b)
  6231. }
  6232. }
  6233. };
  6234. Y.prototype.setFromKeyForLinkData = Y.prototype.YB = function(a, b) {
  6235. null === b && (b = void 0);
  6236. void 0 === b || ch(b) || D.kc(b, "number or string", Y, "setFromKeyForLinkData:key");
  6237. if (null !== a) {
  6238. var c = this.li;
  6239. if ("" !== c)
  6240. if (b = this.fo(b), this.Lh(a)) {
  6241. var d = D.xb(a, c);
  6242. d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "linkFromKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
  6243. } else D.Ua(a, c, b)
  6244. }
  6245. };
  6246. D.defineProperty(Y, { eo: "linkToKeyProperty" }, function() { return this.mi }, function(a) {
  6247. var b = this.mi;
  6248. b !== a && (bh(a, Y, "linkToKeyProperty"), this.mi = a, this.i("linkToKeyProperty", b, a))
  6249. });
  6250. Y.prototype.getToKeyForLinkData = Y.prototype.um = function(a) {
  6251. if (null !== a) {
  6252. var b = this.mi;
  6253. if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
  6254. if (ch(b)) return b;
  6255. D.k("ToKey value for link data " + a + " is not a number or a string: " + b)
  6256. }
  6257. }
  6258. };
  6259. Y.prototype.setToKeyForLinkData = Y.prototype.dC = function(a, b) {
  6260. null === b && (b = void 0);
  6261. void 0 === b || ch(b) || D.kc(b, "number or string", Y, "setToKeyForLinkData:key");
  6262. if (null !== a) {
  6263. var c = this.mi;
  6264. if ("" !== c)
  6265. if (b = this.fo(b), this.Lh(a)) {
  6266. var d = D.xb(a, c);
  6267. d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "linkToKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
  6268. } else D.Ua(a, c, b)
  6269. }
  6270. };
  6271. D.defineProperty(Y, { Tu: "linkFromPortIdProperty" }, function() { return this.cn }, function(a) {
  6272. var b = this.cn;
  6273. b !== a && (bh(a, Y, "linkFromPortIdProperty"), a !== this.co && a !== this.eo || D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: " + a), this.cn = a, this.i("linkFromPortIdProperty", b, a))
  6274. });
  6275. Y.prototype.getFromPortIdForLinkData = Y.prototype.UI = function(a) {
  6276. if (null === a) return "";
  6277. var b = this.cn;
  6278. if ("" === b) return "";
  6279. a = D.xb(a, b);
  6280. return void 0 === a ? "" : a
  6281. };
  6282. Y.prototype.setFromPortIdForLinkData = Y.prototype.ZB = function(a, b) {
  6283. D.h(b, "string", Y, "setFromPortIdForLinkData:portname");
  6284. if (null !== a) {
  6285. var c = this.cn;
  6286. if ("" !== c)
  6287. if (this.Lh(a)) {
  6288. var d = D.xb(a, c);
  6289. void 0 === d && (d = "");
  6290. d !== b && (D.Ua(a, c, b), ah(this, "linkFromPortId", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
  6291. } else D.Ua(a, c, b)
  6292. }
  6293. };
  6294. D.defineProperty(Y, { Vu: "linkToPortIdProperty" }, function() { return this.dn }, function(a) {
  6295. var b = this.dn;
  6296. b !== a && (bh(a, Y, "linkToPortIdProperty"), a !== this.co && a !== this.eo || D.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: " + a), this.dn = a, this.i("linkToPortIdProperty", b, a))
  6297. });
  6298. Y.prototype.getToPortIdForLinkData = Y.prototype.YI = function(a) {
  6299. if (null === a) return "";
  6300. var b = this.dn;
  6301. if ("" === b) return "";
  6302. a = D.xb(a, b);
  6303. return void 0 === a ? "" : a
  6304. };
  6305. Y.prototype.setToPortIdForLinkData = Y.prototype.eC = function(a, b) {
  6306. D.h(b, "string", Y, "setToPortIdForLinkData:portname");
  6307. if (null !== a) {
  6308. var c = this.dn;
  6309. if ("" !== c)
  6310. if (this.Lh(a)) {
  6311. var d = D.xb(a, c);
  6312. void 0 === d && (d = "");
  6313. d !== b && (D.Ua(a, c, b), ah(this, "linkToPortId", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
  6314. } else D.Ua(a, c, b)
  6315. }
  6316. };
  6317. D.defineProperty(Y, { Uu: "linkLabelKeysProperty" }, function() { return this.Kg }, function(a) {
  6318. var b = this.Kg;
  6319. b !== a && (bh(a, Y, "linkLabelKeysProperty"), this.Kg = a, this.i("linkLabelKeysProperty", b, a))
  6320. });
  6321. Y.prototype.getLabelKeysForLinkData = Y.prototype.$k = function(a) {
  6322. if (null === a) return D.Do;
  6323. var b = this.Kg;
  6324. if ("" === b) return D.Do;
  6325. a = D.xb(a, b);
  6326. return void 0 === a ? D.Do : a
  6327. };
  6328. Y.prototype.setLabelKeysForLinkData = Y.prototype.dH = function(a, b) {
  6329. D.gu(b, Y, "setLabelKeysForLinkData:arr");
  6330. if (null !== a) {
  6331. var c = this.Kg;
  6332. if ("" !== c)
  6333. if (this.Lh(a)) {
  6334. var d = D.xb(a, c);
  6335. void 0 === d && (d = D.Do);
  6336. if (d !== b) {
  6337. for (var e = D.cb(d), g = 0; g < e; g++) {
  6338. var h = D.La(d, g);
  6339. hh(this, h, a)
  6340. }
  6341. D.Ua(a, c, b);
  6342. e = D.cb(b);
  6343. for (g = 0; g < e; g++) h = D.La(b, g), null === this.Ie(h) && gh(this, h, a);
  6344. ah(this, "linkLabelKeys", fg, c, a, d, b);
  6345. "string" === typeof c && this.Ob(a, c)
  6346. }
  6347. } else D.Ua(a, c, b)
  6348. }
  6349. };
  6350. Y.prototype.addLabelKeyForLinkData = Y.prototype.VE = function(a, b) {
  6351. if (null !== b && void 0 !== b && (ch(b) || D.kc(b, "number or string", Y, "addLabelKeyForLinkData:key"), null !== a)) {
  6352. var c = this.Kg;
  6353. if ("" !== c) {
  6354. var d = D.xb(a, c);
  6355. if (void 0 === d) c = [], c.push(b), this.dH(a, c);
  6356. else if (D.isArray(d)) {
  6357. var e = D.hm(d, b);
  6358. 0 <= e || (e = D.cb(d), D.Ih(d, Infinity, b), this.Lh(a) && (null === this.Ie(b) && gh(this, b, a), ah(this, "linkLabelKeys", hg, c, a, null, b, null, e)))
  6359. } else D.k(c + " property is not an Array; cannot addLabelKeyForLinkData: " + a)
  6360. }
  6361. }
  6362. };
  6363. Y.prototype.removeLabelKeyForLinkData = Y.prototype.eK = function(a, b) {
  6364. if (null !== b && void 0 !== b && (ch(b) || D.kc(b, "number or string", Y, "removeLabelKeyForLinkData:key"), null !== a)) {
  6365. var c = this.Kg;
  6366. if ("" !== c) {
  6367. var d = D.xb(a, c);
  6368. if (D.isArray(d)) {
  6369. var e = D.hm(d, b);
  6370. 0 > e || (D.Vg(d, e), this.Lh(a) && (hh(this, b, a), ah(this, "linkLabelKeys", ig, c, a, b, null, e, null)))
  6371. } else void 0 !== d && D.k(c + " property is not an Array; cannot removeLabelKeyforLinkData: " + a)
  6372. }
  6373. }
  6374. };
  6375. D.defineProperty(Y, { $g: "linkDataArray" }, function() { return this.df }, function(a) {
  6376. var b = this.df;
  6377. if (b !== a) {
  6378. D.gu(a, Y, "linkDataArray");
  6379. this.td.clear();
  6380. for (var c = D.cb(a), d = 0; d < c; d++) {
  6381. var e = D.La(a, d);
  6382. if (!D.Qa(e)) { D.k("GraphLinksModel.linkDataArray must only contain Objects, not: " + e); return }
  6383. D.sq(e)
  6384. }
  6385. this.df = a;
  6386. if ("" !== this.Tj) {
  6387. for (var g = new K(Object), d = 0; d < c; d++) {
  6388. var e = D.La(a, d),
  6389. h = this.mf(e);
  6390. void 0 === h ? g.add(e) : null !== this.td.oa(h) ? g.add(e) : this.td.add(h, e)
  6391. }
  6392. for (d = g.j; d.next();) e = d.value, this.vy(e), g = this.mf(e),
  6393. void 0 !== g && this.td.add(g, e)
  6394. }
  6395. g = new L(Object);
  6396. for (d = 0; d < c; d++) e = D.La(a, d), g.add(e);
  6397. this.ki = g;
  6398. ah(this, "linkDataArray", fg, "linkDataArray", this, b, a);
  6399. for (d = 0; d < c; d++) e = D.La(a, d), mh(this, e)
  6400. }
  6401. });
  6402. D.defineProperty(Y, { Tj: "linkKeyProperty" }, function() { return this.Ol }, function(a) {
  6403. var b = this.Ol;
  6404. if (b !== a) {
  6405. bh(a, Y, "linkKeyProperty");
  6406. this.Ol = a;
  6407. this.td.clear();
  6408. for (var c = D.cb(this.$g), d = 0; d < c; d++) {
  6409. var e = D.La(this.$g, d),
  6410. g = this.mf(e);
  6411. void 0 === g && (this.vy(e), g = this.mf(e));
  6412. void 0 !== g && this.td.add(g, e)
  6413. }
  6414. this.i("linkKeyProperty", b, a)
  6415. }
  6416. });
  6417. Y.prototype.getKeyForLinkData = Y.prototype.mf = function(a) {
  6418. if (null !== a) {
  6419. var b = this.Ol;
  6420. if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
  6421. if (ch(b)) return b;
  6422. D.k("Key value for link data " + a + " is not a number or a string: " + b)
  6423. }
  6424. }
  6425. };
  6426. Y.prototype.setKeyForLinkData = Y.prototype.cH = function(a, b) {
  6427. void 0 !== b && null !== b && ch(b) || D.kc(b, "number or string", Y, "setKeyForLinkData:key");
  6428. if (null !== a) {
  6429. var c = this.Ol;
  6430. if ("" !== c)
  6431. if (this.Lh(a)) {
  6432. var d = D.xb(a, c);
  6433. d !== b && null === this.oq(b) && (D.Ua(a, c, b), this.td.remove(d), this.td.add(b, a), ah(this, "linkKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
  6434. } else D.Ua(a, c, b)
  6435. }
  6436. };
  6437. D.defineProperty(Y, { cM: "makeUniqueLinkKeyFunction" }, function() { return this.wp }, function(a) {
  6438. var b = this.wp;
  6439. b !== a && (null !== a && D.h(a, "function", Y, "makeUniqueLinkKeyFunction"), this.wp = a, this.i("makeUniqueLinkKeyFunction", b, a))
  6440. });
  6441. Y.prototype.findLinkDataForKey = Y.prototype.oq = function(a) { null === a && D.k("GraphLinksModel.findLinkDataForKey:key must not be null"); return void 0 !== a && ch(a) ? this.td.oa(a) : null };
  6442. Y.prototype.makeLinkDataKeyUnique = Y.prototype.vy = function(a) {
  6443. if (null !== a) {
  6444. var b = this.Ol;
  6445. if ("" !== b) {
  6446. var c = this.mf(a);
  6447. if (void 0 === c || this.td.contains(c)) {
  6448. var d = this.wp;
  6449. if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.td.contains(c))) { D.Ua(a, b, c); return }
  6450. if ("string" === typeof c) {
  6451. for (d = 2; this.td.contains(c + d);) d++;
  6452. D.Ua(a, b, c + d)
  6453. } else if (void 0 === c || "number" === typeof c) {
  6454. for (d = -this.td.count - 1; this.td.contains(d);) d--;
  6455. D.Ua(a, b, d)
  6456. } else D.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: " +
  6457. c)
  6458. }
  6459. }
  6460. }
  6461. };
  6462. Y.prototype.containsLinkData = Y.prototype.Lh = function(a) { return null === a ? !1 : this.ki.contains(a) };
  6463. Y.prototype.addLinkData = Y.prototype.au = function(a) { null !== a && (D.sq(a), this.Lh(a) || nh(this, a, !0)) };
  6464. function nh(a, b, c) {
  6465. if ("" !== a.Tj) {
  6466. var d = a.mf(b);
  6467. if (void 0 !== d && a.td.oa(d) === b) return;
  6468. a.vy(b);
  6469. d = a.mf(b);
  6470. if (void 0 === d) { D.k("GraphLinksModel.makeLinkDataKeyUnique failed on " + b + ". Data not added to model."); return }
  6471. a.td.add(d, b)
  6472. }
  6473. a.ki.add(b);
  6474. d = null;
  6475. c && (d = D.cb(a.df), D.Ih(a.df, d, b));
  6476. ah(a, "linkDataArray", hg, "linkDataArray", a, null, b, null, d);
  6477. mh(a, b)
  6478. }
  6479. Y.prototype.addLinkDataCollection = function(a) {
  6480. if (D.isArray(a))
  6481. for (var b = D.cb(a), c = 0; c < b; c++) this.au(D.La(a, c));
  6482. else
  6483. for (a = a.j; a.next();) this.au(a.value)
  6484. };
  6485. Y.prototype.removeLinkData = Y.prototype.Jy = function(a) { null !== a && oh(this, a, !0) };
  6486. function oh(a, b, c) {
  6487. a.ki.remove(b);
  6488. var d = a.mf(b);
  6489. void 0 !== d && a.td.remove(d);
  6490. d = null;
  6491. if (c) {
  6492. d = D.hm(a.df, b);
  6493. if (0 > d) return;
  6494. D.Vg(a.df, d)
  6495. }
  6496. ah(a, "linkDataArray", ig, "linkDataArray", a, b, null, d, null);
  6497. c = a.tm(b);
  6498. hh(a, c, b);
  6499. c = a.um(b);
  6500. hh(a, c, b);
  6501. d = a.$k(b);
  6502. if (D.isArray(d))
  6503. for (var e = D.cb(d), g = 0; g < e; g++) c = D.La(d, g), hh(a, c, b)
  6504. }
  6505. Y.prototype.removeLinkDataCollection = function(a) {
  6506. if (D.isArray(a))
  6507. for (var b = D.cb(a), c = 0; c < b; c++) this.Jy(D.La(a, c));
  6508. else
  6509. for (a = a.j; a.next();) this.Jy(a.value)
  6510. };
  6511. function mh(a, b) {
  6512. var c = a.tm(b),
  6513. c = a.fo(c);
  6514. null === a.Ie(c) && gh(a, c, b);
  6515. c = a.um(b);
  6516. c = a.fo(c);
  6517. null === a.Ie(c) && gh(a, c, b);
  6518. var d = a.$k(b);
  6519. if (D.isArray(d))
  6520. for (var e = D.cb(d), g = 0; g < e; g++) c = D.La(d, g), null === a.Ie(c) && gh(a, c, b)
  6521. }
  6522. D.defineProperty(Y, { tL: "copyLinkDataFunction" }, function() { return this.Oo }, function(a) {
  6523. var b = this.Oo;
  6524. b !== a && (null !== a && D.h(a, "function", Y, "copyLinkDataFunction"), this.Oo = a, this.i("copyLinkDataFunction", b, a))
  6525. });
  6526. Y.prototype.copyLinkData = Y.prototype.Kx = function(a) {
  6527. if (null === a) return null;
  6528. var b = null,
  6529. b = this.Oo,
  6530. b = null !== b ? b(a, this) : ih(this, a, !0);
  6531. D.Qa(b) && (D.xc(b), "" !== this.li && D.Ua(b, this.li, void 0), "" !== this.mi && D.Ua(b, this.mi, void 0), "" !== this.Kg && D.Ua(b, this.Kg, []));
  6532. return b
  6533. };
  6534. D.defineProperty(Y, { Iq: "nodeIsGroupProperty" }, function() { return this.zp }, function(a) {
  6535. var b = this.zp;
  6536. b !== a && (bh(a, Y, "nodeIsGroupProperty"), this.zp = a, this.i("nodeIsGroupProperty", b, a))
  6537. });
  6538. Y.prototype.isGroupForNodeData = Y.prototype.sB = function(a) { if (null === a) return !1; var b = this.zp; return "" === b ? !1 : D.xb(a, b) ? !0 : !1 };
  6539. D.defineProperty(Y, { bv: "nodeGroupKeyProperty" }, function() { return this.Ah }, function(a) {
  6540. var b = this.Ah;
  6541. b !== a && (bh(a, Y, "nodeGroupKeyProperty"), this.Ah = a, this.i("nodeGroupKeyProperty", b, a))
  6542. });
  6543. D.defineProperty(Y, { Jn: "copiesGroupKeyOfNodeData" }, function() { return this.Br }, function(a) { this.Br !== a && (D.h(a, "boolean", Y, "copiesGroupKeyOfNodeData"), this.Br = a) });
  6544. Y.prototype.getGroupKeyForNodeData = Y.prototype.Sn = function(a) {
  6545. if (null !== a) {
  6546. var b = this.Ah;
  6547. if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
  6548. if (ch(b)) return b;
  6549. D.k("GroupKey value for node data " + a + " is not a number or a string: " + b)
  6550. }
  6551. }
  6552. };
  6553. Y.prototype.setGroupKeyForNodeData = Y.prototype.$B = function(a, b) {
  6554. null === b && (b = void 0);
  6555. void 0 === b || ch(b) || D.kc(b, "number or string", Y, "setGroupKeyForNodeData:key");
  6556. if (null !== a) {
  6557. var c = this.Ah;
  6558. if ("" !== c)
  6559. if (this.ke(a)) {
  6560. var d = D.xb(a, c);
  6561. d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "nodeGroupKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
  6562. } else D.Ua(a, c, b)
  6563. }
  6564. };
  6565. Y.prototype.copyNodeData = function(a) {
  6566. if (null === a) return null;
  6567. a = M.prototype.copyNodeData.call(this, a);
  6568. this.Jn || "" === this.Ah || void 0 === D.xb(a, this.Ah) || D.Ua(a, this.Ah, void 0);
  6569. return a
  6570. };
  6571. Y.prototype.setDataProperty = function(a, b, c) {
  6572. v && (D.h(a, "object", Y, "setDataProperty:data"), D.h(b, "string", Y, "setDataProperty:propname"), "" === b && D.k("GraphLinksModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
  6573. if (this.ke(a))
  6574. if (b === this.Vj) this.Ty(a, c);
  6575. else {
  6576. if (b === this.oo) { this.Ry(a, c); return }
  6577. if (b === this.bv) { this.$B(a, c); return }
  6578. b === this.Iq && D.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: " + b)
  6579. }
  6580. else if (this.Lh(a)) {
  6581. if (b ===
  6582. this.co) { this.YB(a, c); return }
  6583. if (b === this.eo) { this.dC(a, c); return }
  6584. if (b === this.Tu) { this.ZB(a, c); return }
  6585. if (b === this.Vu) { this.eC(a, c); return }
  6586. if (b === this.Tj) { this.cH(a, c); return }
  6587. if (b === this.Su) { this.bH(a, c); return }
  6588. if (b === this.Uu) { this.dH(a, c); return }
  6589. } else !lh && a instanceof O && (lh = !0, D.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), D.trace(" Is that really your intent?"));
  6590. var d = D.xb(a, b);
  6591. d !== c && (D.Ua(a, b, c), this.MB(a, b, d, c))
  6592. };
  6593. f = Y.prototype;
  6594. f.hv = function(a, b) {
  6595. M.prototype.hv.call(this, a, b);
  6596. for (var c = this.Kc.j; c.next();) this.SB(c.value, a, b);
  6597. for (c = this.ki.j; c.next();) {
  6598. var d = c.value,
  6599. e = a,
  6600. g = b;
  6601. if (this.tm(d) === e) {
  6602. var h = this.li;
  6603. D.Ua(d, h, g);
  6604. ah(this, "linkFromKey", fg, h, d, e, g);
  6605. "string" === typeof h && this.Ob(d, h)
  6606. }
  6607. this.um(d) === e && (h = this.mi, D.Ua(d, h, g), ah(this, "linkToKey", fg, h, d, e, g), "string" === typeof h && this.Ob(d, h));
  6608. h = this.$k(d);
  6609. if (D.isArray(h))
  6610. for (var k = D.cb(h), l = this.Kg, m = 0; m < k; m++) D.La(h, m) === e && (D.cF(h, m, g), ah(this, "linkLabelKeys", hg, l, d, e, g, m,
  6611. m))
  6612. }
  6613. };
  6614. f.SB = function(a, b, c) {
  6615. if (this.Sn(a) === b) {
  6616. var d = this.Ah;
  6617. D.Ua(a, d, c);
  6618. ah(this, "nodeGroupKey", fg, d, a, b, c);
  6619. "string" === typeof d && this.Ob(a, d)
  6620. }
  6621. };
  6622. f.sC = function() {
  6623. M.prototype.sC.call(this);
  6624. for (var a = this.$g, b = D.cb(a), c = 0; c < b; c++) {
  6625. var d = D.La(a, c);
  6626. mh(this, d)
  6627. }
  6628. };
  6629. f.Qq = function(a) {
  6630. M.prototype.Qq.call(this, a);
  6631. a = this.zb(a);
  6632. var b = fh(this, a);
  6633. if (null !== b) {
  6634. for (var c = new K(Object), b = b.j; b.next();) {
  6635. var d = b.value;
  6636. if (this.ke(d)) {
  6637. if (this.Sn(d) === a) {
  6638. var e = this.Ah;
  6639. ah(this, "nodeGroupKey", fg, e, d, a, a);
  6640. "string" === typeof e && this.Ob(d, e);
  6641. c.add(d)
  6642. }
  6643. } else if (this.tm(d) === a && (e = this.li, ah(this, "linkFromKey", fg, e, d, a, a), "string" === typeof e && this.Ob(d, e), c.add(d)), this.um(d) === a && (e = this.mi, ah(this, "linkToKey", fg, e, d, a, a), "string" === typeof e && this.Ob(d, e), c.add(d)), e = this.$k(d), D.isArray(e))
  6644. for (var g =
  6645. D.cb(e), h = this.Kg, k = 0; k < g; k++) D.La(e, k) === a && (ah(this, "linkLabelKeys", hg, h, d, a, a, k, k), c.add(d))
  6646. }
  6647. for (c = c.j; c.next();) hh(this, a, c.value)
  6648. }
  6649. };
  6650. f.Pq = function(a) {
  6651. M.prototype.Pq.call(this, a);
  6652. var b = this.Sn(a);
  6653. null === this.Ie(b) && gh(this, b, a)
  6654. };
  6655. f.wv = function(a) {
  6656. M.prototype.wv.call(this, a);
  6657. var b = this.Sn(a);
  6658. hh(this, b, a)
  6659. };
  6660. D.defineProperty(Y, { Su: "linkCategoryProperty" }, function() { return this.bn }, function(a) {
  6661. var b = this.bn;
  6662. b !== a && (bh(a, Y, "linkCategoryProperty"), this.bn = a, this.i("linkCategoryProperty", b, a))
  6663. });
  6664. Y.prototype.getCategoryForLinkData = Y.prototype.Bu = function(a) {
  6665. if (null === a) return "";
  6666. var b = this.bn;
  6667. if ("" === b) return "";
  6668. b = D.xb(a, b);
  6669. if (void 0 === b) return "";
  6670. if ("string" === typeof b) return b;
  6671. D.k("getCategoryForLinkData found a non-string category for " + a + ": " + b);
  6672. return ""
  6673. };
  6674. Y.prototype.setCategoryForLinkData = Y.prototype.bH = function(a, b) {
  6675. D.h(b, "string", Y, "setCategoryForLinkData:cat");
  6676. if (null !== a) {
  6677. var c = this.bn;
  6678. if ("" !== c)
  6679. if (this.Lh(a)) {
  6680. var d = D.xb(a, c);
  6681. void 0 === d && (d = "");
  6682. d !== b && (D.Ua(a, c, b), ah(this, "linkCategory", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
  6683. } else D.Ua(a, c, b)
  6684. }
  6685. };
  6686. function Bg(a) {
  6687. 1 < arguments.length && D.k("TreeModel constructor can only take one optional argument, the Array of node data.");
  6688. M.call(this);
  6689. this.Bh = "parent";
  6690. this.Cr = !1;
  6691. this.ln = "parentLinkCategory";
  6692. void 0 !== a && (this.qg = a)
  6693. }
  6694. D.Ta(Bg, M);
  6695. D.ka("TreeModel", Bg);
  6696. Bg.prototype.cloneProtected = function(a) {
  6697. M.prototype.cloneProtected.call(this, a);
  6698. a.Bh = this.Bh;
  6699. a.Cr = this.Cr;
  6700. a.ln = this.ln
  6701. };
  6702. Bg.prototype.toString = function(a) {
  6703. void 0 === a && (a = 0);
  6704. if (2 <= a) return this.kC();
  6705. var b = ("" !== this.name ? this.name : "") + " TreeModel";
  6706. if (0 < a) {
  6707. b += "\n node data:";
  6708. a = this.qg;
  6709. for (var c = D.cb(a), d = 0; d < c; d++) var e = D.La(a, d),
  6710. b = b + (" " + this.zb(e) + ":" + ia(e))
  6711. }
  6712. return b
  6713. };
  6714. Bg.prototype.Ao = function() {
  6715. var a = M.prototype.Ao.call(this),
  6716. b = "";
  6717. "parent" !== this.cv && "string" === typeof this.cv && (b += ',\n "nodeParentKeyProperty": ' + this.quote(this.cv));
  6718. return a + b
  6719. };
  6720. Bg.prototype.fv = function(a) {
  6721. M.prototype.fv.call(this, a);
  6722. a.nodeParentKeyProperty && (this.cv = a.nodeParentKeyProperty)
  6723. };
  6724. Bg.prototype.fo = function(a) { return a };
  6725. D.defineProperty(Bg, { cv: "nodeParentKeyProperty" }, function() { return this.Bh }, function(a) {
  6726. var b = this.Bh;
  6727. b !== a && (bh(a, Bg, "nodeParentKeyProperty"), this.Bh = a, this.i("nodeParentKeyProperty", b, a))
  6728. });
  6729. D.defineProperty(Bg, { Kn: "copiesParentKeyOfNodeData" }, function() { return this.Cr }, function(a) { this.Cr !== a && (D.h(a, "boolean", Bg, "copiesParentKeyOfNodeData"), this.Cr = a) });
  6730. Bg.prototype.getParentKeyForNodeData = Bg.prototype.Un = function(a) {
  6731. if (null !== a) {
  6732. var b = this.Bh;
  6733. if ("" !== b && (b = D.xb(a, b), void 0 !== b)) {
  6734. if (ch(b)) return b;
  6735. D.k("ParentKey value for node data " + a + " is not a number or a string: " + b)
  6736. }
  6737. }
  6738. };
  6739. Bg.prototype.setParentKeyForNodeData = Bg.prototype.Ii = function(a, b) {
  6740. null === b && (b = void 0);
  6741. void 0 === b || ch(b) || D.kc(b, "number or string", Bg, "setParentKeyForNodeData:key");
  6742. if (null !== a) {
  6743. var c = this.Bh;
  6744. if ("" !== c)
  6745. if (b = this.fo(b), this.ke(a)) {
  6746. var d = D.xb(a, c);
  6747. d !== b && (hh(this, d, a), D.Ua(a, c, b), null === this.Ie(b) && gh(this, b, a), ah(this, "nodeParentKey", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
  6748. } else D.Ua(a, c, b)
  6749. }
  6750. };
  6751. D.defineProperty(Bg, { wM: "parentLinkCategoryProperty" }, function() { return this.ln }, function(a) {
  6752. var b = this.ln;
  6753. b !== a && (bh(a, Bg, "parentLinkCategoryProperty"), this.ln = a, this.i("parentLinkCategoryProperty", b, a))
  6754. });
  6755. Bg.prototype.getParentLinkCategoryForNodeData = Bg.prototype.WI = function(a) {
  6756. if (null === a) return "";
  6757. var b = this.ln;
  6758. if ("" === b) return "";
  6759. b = D.xb(a, b);
  6760. if (void 0 === b) return "";
  6761. if ("string" === typeof b) return b;
  6762. D.k("getParentLinkCategoryForNodeData found a non-string category for " + a + ": " + b);
  6763. return ""
  6764. };
  6765. Bg.prototype.setParentLinkCategoryForNodeData = Bg.prototype.rK = function(a, b) {
  6766. D.h(b, "string", Bg, "setParentLinkCategoryForNodeData:cat");
  6767. if (null !== a) {
  6768. var c = this.ln;
  6769. if ("" !== c)
  6770. if (this.ke(a)) {
  6771. var d = D.xb(a, c);
  6772. void 0 === d && (d = "");
  6773. d !== b && (D.Ua(a, c, b), ah(this, "parentLinkCategory", fg, c, a, d, b), "string" === typeof c && this.Ob(a, c))
  6774. } else D.Ua(a, c, b)
  6775. }
  6776. };
  6777. Bg.prototype.copyNodeData = function(a) {
  6778. if (null === a) return null;
  6779. a = M.prototype.copyNodeData.call(this, a);
  6780. this.Kn || "" === this.Bh || void 0 === D.xb(a, this.Bh) || D.Ua(a, this.Bh, void 0);
  6781. return a
  6782. };
  6783. Bg.prototype.setDataProperty = function(a, b, c) {
  6784. v && (D.h(a, "object", Bg, "setDataProperty:data"), D.h(b, "string", Bg, "setDataProperty:propname"), "" === b && D.k("TreeModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
  6785. if (this.ke(a))
  6786. if (b === this.Vj) this.Ty(a, c);
  6787. else { if (b === this.oo) { this.Ry(a, c); return } if (b === this.cv) { this.Ii(a, c); return } }
  6788. else !lh && a instanceof O && (lh = !0, D.trace('TreeModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), D.trace(" Is that really your intent?"));
  6789. var d = D.xb(a, b);
  6790. d !== c && (D.Ua(a, b, c), this.MB(a, b, d, c))
  6791. };
  6792. f = Bg.prototype;
  6793. f.hv = function(a, b) { M.prototype.hv.call(this, a, b); for (var c = this.Kc.j; c.next();) this.SB(c.value, a, b) };
  6794. f.SB = function(a, b, c) {
  6795. if (this.Un(a) === b) {
  6796. var d = this.Bh;
  6797. D.Ua(a, d, c);
  6798. ah(this, "nodeParentKey", fg, d, a, b, c);
  6799. "string" === typeof d && this.Ob(a, d)
  6800. }
  6801. };
  6802. f.Qq = function(a) {
  6803. M.prototype.Qq.call(this, a);
  6804. a = this.zb(a);
  6805. var b = fh(this, a);
  6806. if (null !== b) {
  6807. for (var c = new K(Object), b = b.j; b.next();) {
  6808. var d = b.value;
  6809. if (this.ke(d) && this.Un(d) === a) {
  6810. var e = this.Bh;
  6811. ah(this, "nodeParentKey", fg, e, d, a, a);
  6812. "string" === typeof e && this.Ob(d, e);
  6813. c.add(d)
  6814. }
  6815. }
  6816. for (c = c.j; c.next();) hh(this, a, c.value)
  6817. }
  6818. };
  6819. f.Pq = function(a) {
  6820. M.prototype.Pq.call(this, a);
  6821. var b = this.Un(a),
  6822. b = this.fo(b);
  6823. null === this.Ie(b) && gh(this, b, a)
  6824. };
  6825. f.wv = function(a) {
  6826. M.prototype.wv.call(this, a);
  6827. var b = this.Un(a);
  6828. hh(this, b, a)
  6829. };
  6830. function ph(a, b, c) {
  6831. D.xc(this);
  6832. this.J = !1;
  6833. void 0 === a ? a = "" : D.h(a, "string", ph, "constructor:targetprop");
  6834. void 0 === b ? b = a : D.h(b, "string", ph, "constructor:sourceprop");
  6835. void 0 === c ? c = null : null !== c && D.h(c, "function", ph, "constructor:conv");
  6836. this.xE = -1;
  6837. this.Sg = null;
  6838. this.Up = a;
  6839. this.Tp = this.Pt = 0;
  6840. this.jx = null;
  6841. this.us = !1;
  6842. this.Kp = b;
  6843. this.yr = c;
  6844. this.Os = qh;
  6845. this.rr = null;
  6846. this.Pz = new L
  6847. }
  6848. D.ka("Binding", ph);
  6849. ph.prototype.copy = function() {
  6850. var a = new ph;
  6851. a.Up = this.Up;
  6852. a.Pt = this.Pt;
  6853. a.Tp = this.Tp;
  6854. a.jx = this.jx;
  6855. a.us = this.us;
  6856. a.Kp = this.Kp;
  6857. a.yr = this.yr;
  6858. a.Os = this.Os;
  6859. a.rr = this.rr;
  6860. return a
  6861. };
  6862. var qh;
  6863. ph.OneWay = qh = D.s(ph, "OneWay", 1);
  6864. var rh;
  6865. ph.TwoWay = rh = D.s(ph, "TwoWay", 2);
  6866. ph.parseEnum = function(a, b) {
  6867. D.h(a, "function", ph, "parseEnum:ctor");
  6868. D.Da(b, a, ph, "parseEnum:defval");
  6869. return function(c) { c = Ha(a, c); return null === c ? b : c }
  6870. };
  6871. ph.prototype.qc = function(a) { a.Qe === ph ? this.mode = a : D.ak(this, a) };
  6872. var ia;
  6873. ph.toString = ia = function(a) {
  6874. var b = a;
  6875. D.Qa(a) && (a.text ? b = a.text : a.name ? b = a.name : void 0 !== a.key ? b = a.key : void 0 !== a.id ? b = a.id : a.constructor === Object && (a.Text ? b = a.Text : a.Name ? b = a.Name : void 0 !== a.Key ? b = a.Key : void 0 !== a.Id ? b = a.Id : void 0 !== a.ID && (b = a.ID)));
  6876. return void 0 === b ? "undefined" : null === b ? "null" : b.toString()
  6877. };
  6878. ph.prototype.toString = function() { return "Binding(" + this.tv + ":" + this.gH + (-1 !== this.Fm ? " " + this.Fm : "") + " " + this.mode.name + ")" };
  6879. ph.prototype.freeze = function() { this.J = !0; return this };
  6880. ph.prototype.Xa = function() { this.J = !1; return this };
  6881. D.defineProperty(ph, { Fm: null }, function() { return this.xE }, function(a) {
  6882. this.J && D.qa(this);
  6883. D.h(a, "number", ph, "targetId");
  6884. this.xE = a
  6885. });
  6886. D.defineProperty(ph, { tv: "targetProperty" }, function() { return this.Up }, function(a) {
  6887. this.J && D.qa(this);
  6888. D.h(a, "string", ph, "targetProperty");
  6889. this.Up = a
  6890. });
  6891. D.defineProperty(ph, { $q: "sourceName" }, function() { return this.jx }, function(a) {
  6892. this.J && D.qa(this);
  6893. null !== a && D.h(a, "string", ph, "sourceName");
  6894. this.jx = a;
  6895. null !== a && (this.us = !1)
  6896. });
  6897. D.defineProperty(ph, { ly: "isToModel" }, function() { return this.us }, function(a) {
  6898. this.J && D.qa(this);
  6899. D.h(a, "boolean", ph, "isToModel");
  6900. this.us = a
  6901. });
  6902. D.defineProperty(ph, { gH: "sourceProperty" }, function() { return this.Kp }, function(a) {
  6903. this.J && D.qa(this);
  6904. D.h(a, "string", ph, "sourceProperty");
  6905. this.Kp = a
  6906. });
  6907. D.defineProperty(ph, { pI: "converter" }, function() { return this.yr }, function(a) {
  6908. this.J && D.qa(this);
  6909. null !== a && D.h(a, "function", ph, "converter");
  6910. this.yr = a
  6911. });
  6912. D.defineProperty(ph, { eI: "backConverter" }, function() { return this.rr }, function(a) {
  6913. this.J && D.qa(this);
  6914. null !== a && D.h(a, "function", ph, "backConverter");
  6915. this.rr = a
  6916. });
  6917. D.defineProperty(ph, { mode: "mode" }, function() { return this.Os }, function(a) {
  6918. this.J && D.qa(this);
  6919. D.Da(a, ph, ph, "mode");
  6920. this.Os = a
  6921. });
  6922. ph.prototype.makeTwoWay = ph.prototype.GJ = function(a) {
  6923. void 0 === a && (a = null);
  6924. null !== a && D.h(a, "function", ph, "makeTwoWay");
  6925. this.mode = rh;
  6926. this.eI = a;
  6927. return this
  6928. };
  6929. ph.prototype.ofObject = ph.prototype.yy = function(a) {
  6930. void 0 === a && (a = "");
  6931. v && D.h(a, "string", ph, "ofObject:srcname");
  6932. this.$q = a;
  6933. this.ly = !1;
  6934. return this
  6935. };
  6936. ph.prototype.ofModel = function() {
  6937. this.$q = null;
  6938. this.ly = !0;
  6939. return this
  6940. };
  6941. function sh(a, b, c) { a = a.$q; var d = null; return d = null === a || "" === a ? b : "/" === a ? c.Y : "." === a ? c : ".." === a ? c.R : b.Md(a) }
  6942. ph.prototype.updateTarget = ph.prototype.wH = function(a, b, c) {
  6943. var d = this.Kp;
  6944. if (void 0 === c || "" === d || d === c) {
  6945. c = this.Up;
  6946. var e = this.yr;
  6947. if (null === e && "" === c) D.trace("Binding error: target property is the empty string: " + this.toString());
  6948. else {
  6949. v && "string" === typeof c && ("function" !== typeof a.setAttribute && 0 < c.length && "_" !== c[0] && !D.by(a, c) ? D.trace("Binding error: undefined target property: " + c + " on " + a.toString()) : "name" === c && a instanceof O && D.trace("Binding error: cannot modify GraphObject.name on " + a.toString()));
  6950. var g = b;
  6951. "" !== d && (g = D.xb(b, d));
  6952. if (void 0 !== g)
  6953. if (null === e) "" !== c && D.Ua(a, c, g);
  6954. else try {
  6955. if ("" !== c) {
  6956. var h = e(g, a);
  6957. v && void 0 === h && D.trace('Binding warning: conversion function returned undefined when setting target property "' + c + '" on ' + a.toString() + ", function is: " + e);
  6958. D.Ua(a, c, h)
  6959. } else e(g, a)
  6960. } catch (k) { v && D.trace("Binding error: " + k.toString() + ' setting target property "' + c + '" on ' + a.toString() + " with conversion function: " + e) }
  6961. }
  6962. }
  6963. };
  6964. ph.prototype.updateSource = ph.prototype.Wy = function(a, b, c, d) {
  6965. if (this.Os === rh) {
  6966. var e = this.Up;
  6967. if (void 0 === c || e === c) {
  6968. c = this.Kp;
  6969. var g = this.rr,
  6970. h = a;
  6971. "" !== e && (h = D.xb(a, e));
  6972. if (void 0 !== h && !this.Pz.contains(a)) try {
  6973. this.Pz.add(a);
  6974. var k = null !== d ? d.g : null,
  6975. l = null !== k ? k.ea : null;
  6976. if (null === g)
  6977. if ("" !== c) null !== l ? (v && l.Vj === c && l.ke(b) && D.trace("Binding error: cannot have TwoWay Binding on node data key property: " + this.toString()), l.setDataProperty(b, c, h)) : D.Ua(b, c, h);
  6978. else {
  6979. if (null !== l && null !== d && 0 <= d.Qu && null !== d.R &&
  6980. Array.isArray(d.R.el)) {
  6981. var m = d.Qu,
  6982. n = d.R.el;
  6983. l.IG(n, m);
  6984. l.mB(n, m, h)
  6985. }
  6986. }
  6987. else try {
  6988. if ("" !== c) {
  6989. var p = g(h, b, l);
  6990. null !== l ? (v && (l.Vj === c && l.ke(b) && D.trace("Binding error: cannot have TwoWay Binding on node data key property: " + this.toString()), void 0 === p && D.trace('Binding warning: conversion function returned undefined when setting source property "' + c + '" on ' + b.toString() + ", function is: " + g)), l.setDataProperty(b, c, p)) : D.Ua(b, c, p)
  6991. } else p = g(h, b, l), void 0 !== p && null !== l && null !== d && 0 <= d.Qu && null !== d.R && Array.isArray(d.R.el) &&
  6992. (m = d.Qu, n = d.R.el, l.IG(n, m), l.mB(n, m, p))
  6993. } catch (q) { v && D.trace("Binding error: " + q.toString() + ' setting source property "' + c + '" on ' + b.toString() + " with conversion function: " + g) }
  6994. } finally { this.Pz.remove(a) }
  6995. }
  6996. }
  6997. };
  6998. function Cg() {
  6999. this.CH = (new K(eg)).freeze();
  7000. this.$b = "";
  7001. this.DD = !1
  7002. }
  7003. D.ka("Transaction", Cg);
  7004. Cg.prototype.toString = function(a) {
  7005. var b = "Transaction: " + this.name + " " + this.fg.count.toString() + (this.Iu ? "" : ", incomplete");
  7006. if (void 0 !== a && 0 < a) {
  7007. a = this.fg.count;
  7008. for (var c = 0; c < a; c++) {
  7009. var d = this.fg.fa(c);
  7010. null !== d && (b += "\n " + d.toString())
  7011. }
  7012. }
  7013. return b
  7014. };
  7015. Cg.prototype.clear = Cg.prototype.clear = function() {
  7016. var a = this.fg;
  7017. a.Xa();
  7018. for (var b = a.count - 1; 0 <= b; b--) {
  7019. var c = a.fa(b);
  7020. null !== c && c.clear()
  7021. }
  7022. a.clear();
  7023. a.freeze()
  7024. };
  7025. Cg.prototype.canUndo = Cg.prototype.canUndo = function() { return this.Iu };
  7026. Cg.prototype.undo = Cg.prototype.undo = function() {
  7027. if (this.canUndo())
  7028. for (var a = this.fg.count - 1; 0 <= a; a--) {
  7029. var b = this.fg.fa(a);
  7030. null !== b && b.undo()
  7031. }
  7032. };
  7033. Cg.prototype.canRedo = Cg.prototype.canRedo = function() { return this.Iu };
  7034. Cg.prototype.redo = Cg.prototype.redo = function() {
  7035. if (this.canRedo())
  7036. for (var a = this.fg.count, b = 0; b < a; b++) {
  7037. var c = this.fg.fa(b);
  7038. null !== c && c.redo()
  7039. }
  7040. };
  7041. D.w(Cg, { fg: "changes" }, function() { return this.CH });
  7042. D.defineProperty(Cg, { name: "name" }, function() { return this.$b }, function(a) { this.$b = a });
  7043. D.defineProperty(Cg, { Iu: "isComplete" }, function() { return this.DD }, function(a) { this.DD = a });
  7044. function tg() {
  7045. this.eA = new L(M);
  7046. this.rf = !1;
  7047. this.GH = (new K(Cg)).freeze();
  7048. this.rh = -1;
  7049. this.SD = 999;
  7050. this.uh = !1;
  7051. this.Xv = null;
  7052. this.am = 0;
  7053. this.uz = !1;
  7054. v && (this.uz = !0);
  7055. this.zh = (new K("string")).freeze();
  7056. this.yp = new K("number");
  7057. this.Qz = !0;
  7058. this.$z = !1
  7059. }
  7060. D.ka("UndoManager", tg);
  7061. tg.prototype.toString = function(a) {
  7062. for (var b = "UndoManager " + this.Lj + "<" + this.history.count + "<=" + this.vG, b = b + "[", c = this.AG.count, d = 0; d < c; d++) 0 < d && (b += " "), b += this.AG.fa(d);
  7063. b += "]";
  7064. if (void 0 !== a && 0 < a)
  7065. for (c = this.history.count, d = 0; d < c; d++) b += "\n " + this.history.fa(d).toString(a - 1);
  7066. return b
  7067. };
  7068. tg.prototype.clear = tg.prototype.clear = function() {
  7069. var a = this.history;
  7070. a.Xa();
  7071. for (var b = a.count - 1; 0 <= b; b--) {
  7072. var c = a.fa(b);
  7073. null !== c && c.clear()
  7074. }
  7075. a.clear();
  7076. this.rh = -1;
  7077. a.freeze();
  7078. this.uh = !1;
  7079. this.Xv = null;
  7080. this.am = 0;
  7081. this.zh.Xa();
  7082. this.zh.clear();
  7083. this.zh.freeze();
  7084. this.yp.clear()
  7085. };
  7086. tg.prototype.addModel = tg.prototype.YH = function(a) { this.eA.add(a) };
  7087. tg.prototype.removeModel = tg.prototype.fK = function(a) { this.eA.remove(a) };
  7088. tg.prototype.startTransaction = tg.prototype.Nb = function(a) {
  7089. void 0 === a && (a = "");
  7090. null === a && (a = "");
  7091. if (this.ub) return !1;
  7092. !0 === this.Qz && (this.Qz = !1, this.am++, this.vd("StartingFirstTransaction", a, this.Gj), 0 < this.am && this.am--);
  7093. this.isEnabled && (this.zh.Xa(), this.zh.add(a), this.zh.freeze(), null === this.Gj ? this.yp.add(0) : this.yp.add(this.Gj.fg.count));
  7094. this.am++;
  7095. var b = 1 === this.Ki;
  7096. b && this.vd("StartedTransaction", a, this.Gj);
  7097. return b
  7098. };
  7099. tg.prototype.commitTransaction = tg.prototype.jd = function(a) { void 0 === a && (a = ""); return th(this, !0, a) };
  7100. tg.prototype.rollbackTransaction = tg.prototype.Am = function() { return th(this, !1, "") };
  7101. function th(a, b, c) {
  7102. if (a.ub) return !1;
  7103. a.IA && 1 > a.Ki && D.trace("Ending transaction without having started a transaction: " + c);
  7104. var d = 1 === a.Ki;
  7105. d && b && a.vd("CommittingTransaction", c, a.Gj);
  7106. var e = 0;
  7107. if (0 < a.Ki && (a.am--, a.isEnabled)) {
  7108. var g = a.zh.count;
  7109. 0 < g && ("" === c && (c = a.zh.fa(0)), a.zh.Xa(), a.zh.pd(g - 1), a.zh.freeze());
  7110. g = a.yp.count;
  7111. 0 < g && (e = a.yp.fa(g - 1), a.yp.pd(g - 1))
  7112. }
  7113. g = a.Gj;
  7114. if (d) {
  7115. if (b) {
  7116. a.$z = !1;
  7117. if (a.isEnabled && null !== g) {
  7118. b = g;
  7119. b.Iu = !0;
  7120. b.name = c;
  7121. d = a.history;
  7122. d.Xa();
  7123. for (e = d.count - 1; e > a.Lj; e--) g = d.fa(e), null !== g && g.clear(),
  7124. d.pd(e), a.$z = !0;
  7125. e = a.vG;
  7126. 0 === e && (e = 1);
  7127. 0 < e && d.count >= e && (g = d.fa(0), null !== g && g.clear(), d.pd(0), a.rh--);
  7128. d.add(b);
  7129. a.rh++;
  7130. d.freeze();
  7131. g = b
  7132. }
  7133. a.vd("CommittedTransaction", c, g)
  7134. } else {
  7135. a.uh = !0;
  7136. try { a.isEnabled && null !== g && (g.Iu = !0, g.undo()) } finally { a.vd("RolledBackTransaction", c, g), a.uh = !1 }
  7137. null !== g && g.clear()
  7138. }
  7139. a.Xv = null;
  7140. return !0
  7141. }
  7142. if (a.isEnabled && !b && null !== g) {
  7143. a = e;
  7144. c = g.fg;
  7145. for (b = c.count - 1; b >= a; b--) d = c.fa(b), null !== d && d.undo(), c.Xa(), c.pd(b);
  7146. c.freeze()
  7147. }
  7148. return !1
  7149. }
  7150. tg.prototype.canUndo = tg.prototype.canUndo = function() { if (!this.isEnabled || 0 < this.Ki) return !1; var a = this.sH; return null !== a && a.canUndo() ? !0 : !1 };
  7151. tg.prototype.undo = tg.prototype.undo = function() { if (this.canUndo()) { var a = this.sH; try { this.uh = !0, this.vd("StartingUndo", "Undo", a), this.rh--, a.undo() } catch (b) { D.trace("undo error: " + b.toString()) } finally { this.vd("FinishedUndo", "Undo", a), this.uh = !1 } } };
  7152. tg.prototype.canRedo = tg.prototype.canRedo = function() { if (!this.isEnabled || 0 < this.Ki) return !1; var a = this.rH; return null !== a && a.canRedo() ? !0 : !1 };
  7153. tg.prototype.redo = tg.prototype.redo = function() { if (this.canRedo()) { var a = this.rH; try { this.uh = !0, this.vd("StartingRedo", "Redo", a), this.rh++, a.redo() } catch (b) { D.trace("redo error: " + b.toString()) } finally { this.vd("FinishedRedo", "Redo", a), this.uh = !1 } } };
  7154. tg.prototype.vd = function(a, b, c) {
  7155. void 0 === c && (c = null);
  7156. var d = new eg;
  7157. d.Oc = gg;
  7158. d.propertyName = a;
  7159. d.object = c;
  7160. d.oldValue = b;
  7161. for (a = this.QJ; a.next();) b = a.value, d.ea = b, b.Gx(d)
  7162. };
  7163. tg.prototype.handleChanged = tg.prototype.ZF = function(a) {
  7164. if (this.isEnabled && !this.ub && !this.skipsEvent(a)) {
  7165. var b = this.Gj;
  7166. null === b && (this.Xv = b = new Cg);
  7167. var c = a.copy(),
  7168. b = b.fg;
  7169. b.Xa();
  7170. b.add(c);
  7171. b.freeze();
  7172. this.IA && 0 >= this.Ki && !this.Qz && (a = a.g, null !== a && !1 === a.Zn || D.trace("Change not within a transaction: " + c.toString()))
  7173. }
  7174. };
  7175. tg.prototype.skipsEvent = function(a) {
  7176. if (null === a || 0 > a.Oc.value) return !0;
  7177. a = a.object;
  7178. if (a instanceof O) { if (a = a.layer, null !== a && a.Yc) return !0 } else if (a instanceof Hg && a.Yc) return !0;
  7179. return !1
  7180. };
  7181. D.w(tg, { QJ: "models" }, function() { return this.eA.j });
  7182. D.defineProperty(tg, { isEnabled: "isEnabled" }, function() { return this.rf }, function(a) { this.rf = a });
  7183. D.w(tg, { sH: "transactionToUndo" }, function() { return 0 <= this.Lj && this.Lj <= this.history.count - 1 ? this.history.fa(this.Lj) : null });
  7184. D.w(tg, { rH: "transactionToRedo" }, function() { return this.Lj < this.history.count - 1 ? this.history.fa(this.Lj + 1) : null });
  7185. D.w(tg, { ub: "isUndoingRedoing" }, function() { return this.uh });
  7186. D.w(tg, { history: "history" }, function() { return this.GH });
  7187. D.defineProperty(tg, { vG: "maxHistoryLength" }, function() { return this.SD }, function(a) { this.SD = a });
  7188. D.w(tg, { Lj: "historyIndex" }, function() { return this.rh });
  7189. D.w(tg, { Gj: "currentTransaction" }, function() { return this.Xv });
  7190. D.w(tg, { Ki: "transactionLevel" }, function() { return this.am });
  7191. D.w(tg, { jG: "isInTransaction" }, function() { return 0 < this.am });
  7192. D.defineProperty(tg, { IA: "checksTransactionLevel" }, function() { return this.uz }, function(a) { this.uz = a });
  7193. D.w(tg, { AG: "nestedTransactionNames" }, function() { return this.zh });
  7194. function qa() {
  7195. 0 < arguments.length && D.zd(qa);
  7196. D.xc(this);
  7197. this.ca = null;
  7198. this.QC = !1;
  7199. this.kD = this.RC = !0;
  7200. this.TC = this.UC = this.lD = this.VC = !1;
  7201. this.Rl = this.nz = null;
  7202. this.PE = 1.05;
  7203. this.hD = 1;
  7204. this.aA = NaN;
  7205. this.PD = null;
  7206. this.DA = NaN;
  7207. this.CA = Ld;
  7208. this.uj = null;
  7209. this.nE = 0
  7210. }
  7211. D.ka("CommandHandler", qa);
  7212. var Nh = null,
  7213. Oh = "";
  7214. qa.prototype.toString = function() { return "CommandHandler" };
  7215. D.w(qa, { g: "diagram" }, function() { return this.ca });
  7216. qa.prototype.ad = function(a) {
  7217. v && null !== a && D.l(a, E, qa, "setDiagram");
  7218. this.ca = a
  7219. };
  7220. qa.prototype.doKeyDown = function() {
  7221. var a = this.g;
  7222. if (null !== a) {
  7223. var b = a.U,
  7224. c = D.Qh ? b.Xu : b.control,
  7225. d = b.shift,
  7226. e = b.alt,
  7227. g = b.key;
  7228. !c || "C" !== g && "Insert" !== g ? c && "X" === g || d && "Del" === g ? this.canCutSelection() && this.cutSelection() : c && "V" === g || d && "Insert" === g ? this.canPasteSelection() && this.pasteSelection() : c && "Y" === g || e && d && "Backspace" === g ? this.canRedo() && this.redo() : c && "Z" === g || e && "Backspace" === g ? this.canUndo() && this.undo() : "Del" === g || "Backspace" === g ? this.canDeleteSelection() && this.deleteSelection() : c && "A" === g ? this.canSelectAll() &&
  7229. this.selectAll() : "Esc" === g ? this.canStopCommand() && this.stopCommand() : "Up" === g ? a.Ce && (c ? a.scroll("pixel", "up") : a.scroll("line", "up")) : "Down" === g ? a.Ce && (c ? a.scroll("pixel", "down") : a.scroll("line", "down")) : "Left" === g ? a.Be && (c ? a.scroll("pixel", "left") : a.scroll("line", "left")) : "Right" === g ? a.Be && (c ? a.scroll("pixel", "right") : a.scroll("line", "right")) : "PageUp" === g ? d && a.Be ? a.scroll("page", "left") : a.Ce && a.scroll("page", "up") : "PageDown" === g ? d && a.Be ? a.scroll("page", "right") : a.Ce && a.scroll("page", "down") : "Home" ===
  7230. g ? c && a.Ce ? a.scroll("document", "up") : !c && a.Be && a.scroll("document", "left") : "End" === g ? c && a.Ce ? a.scroll("document", "down") : !c && a.Be && a.scroll("document", "right") : " " === g ? this.canScrollToPart() && this.scrollToPart() : "Subtract" === g ? this.canDecreaseZoom() && this.decreaseZoom() : "Add" === g ? this.canIncreaseZoom() && this.increaseZoom() : c && "0" === g ? this.canResetZoom() && this.resetZoom() : d && "Z" === g ? this.canZoomToFit() && this.zoomToFit() : c && !d && "G" === g ? this.canGroupSelection() && this.groupSelection() : c && d && "G" === g ? this.canUngroupSelection() &&
  7231. this.ungroupSelection() : b.event && 113 === b.event.which ? this.canEditTextBlock() && this.editTextBlock() : b.event && 93 === b.event.which ? this.canShowContextMenu() && this.showContextMenu() : b.bubbles = !0 : this.canCopySelection() && this.copySelection()
  7232. }
  7233. };
  7234. qa.prototype.doKeyUp = function() {
  7235. var a = this.g;
  7236. null !== a && (a.U.bubbles = !0)
  7237. };
  7238. qa.prototype.stopCommand = function() {
  7239. var a = this.g;
  7240. if (null !== a) {
  7241. var b = a.eb;
  7242. b instanceof Ph && a.Jf && a.Ix();
  7243. null !== b && b.doCancel()
  7244. }
  7245. };
  7246. qa.prototype.canStopCommand = function() { return !0 };
  7247. qa.prototype.selectAll = function() {
  7248. var a = this.g;
  7249. if (null !== a) {
  7250. a.ra();
  7251. try {
  7252. a.sc = "wait";
  7253. a.Ja("ChangingSelection");
  7254. for (var b = a.Hi; b.next();) b.value.ib = !0;
  7255. for (var c = a.rg; c.next();) c.value.ib = !0;
  7256. for (var d = a.links; d.next();) d.value.ib = !0
  7257. } finally { a.Ja("ChangedSelection"), a.sc = "" }
  7258. }
  7259. };
  7260. qa.prototype.canSelectAll = function() { var a = this.g; return null !== a && a.Jf };
  7261. qa.prototype.deleteSelection = function() {
  7262. var a = this.g;
  7263. if (null !== a && !a.Ja("SelectionDeleting", a.selection)) try {
  7264. a.sc = "wait";
  7265. a.Nb("Delete");
  7266. a.Ja("ChangingSelection");
  7267. for (var b = new L(F), c = a.selection.j; c.next();) Qh(b, c.value, !0, this.yI ? Infinity : 0, this.vF, function(a) { return a.canDelete() });
  7268. a.RB(b, !0);
  7269. a.Ja("SelectionDeleted", b)
  7270. } finally { a.Ja("ChangedSelection"), a.jd("Delete"), a.sc = "" }
  7271. };
  7272. qa.prototype.canDeleteSelection = function() { var a = this.g; return null === a || a.qb || a.Mf || !a.Cn || 0 === a.selection.count ? !1 : !0 };
  7273. function Qh(a, b, c, d, e, g) {
  7274. void 0 === g && (g = null);
  7275. if (!(a.contains(b) || null !== g && !g(b) || b instanceof da))
  7276. if (a.add(b), b instanceof G) {
  7277. if (c && b instanceof I)
  7278. for (var h = b.uc; h.next();) Qh(a, h.value, c, d, e, g);
  7279. if (e)
  7280. for (h = b.Od; h.next();) {
  7281. var k = h.value;
  7282. if (!a.contains(k)) {
  7283. var l = k.$,
  7284. m = k.ba;
  7285. null !== l && a.contains(l) && null !== m && a.contains(m) ? Qh(a, k, c, d, e, g) : null !== l && null !== m || Qh(a, k, c, d, e, g)
  7286. }
  7287. }
  7288. if (1 < d)
  7289. for (b = b.KF(); b.next();) Qh(a, b.value, c, d - 1, e, g)
  7290. } else if (b instanceof J)
  7291. for (b = b.Af; b.next();) Qh(a, b.value, c, d, e, g)
  7292. }
  7293. qa.prototype.hq = function(a, b, c) {
  7294. var d = new oa(F, F);
  7295. for (a = a.j; a.next();) Rh(this, a.value, b, d, c);
  7296. if (null !== b) {
  7297. c = b.ea;
  7298. a = !1;
  7299. null !== b.nb.Ge && (a = b.nb.Ge.Ij);
  7300. for (var e = new L(J), g = new oa(J, J), h = d.j; h.next();) {
  7301. var k = h.value;
  7302. if (k instanceof J) {
  7303. var l = k;
  7304. a || null !== l.$ && null !== l.ba || e.add(l)
  7305. } else if (c instanceof Bg && k instanceof G && null !== k.data) {
  7306. var l = c,
  7307. m = k,
  7308. k = h.key,
  7309. n = k.Yk();
  7310. null !== n && (n = d.oa(n), null !== n ? (l.Ii(m.data, l.zb(n.data)), l = b.gg(m.data), k = k.Qn(), null !== k && null !== l && g.add(k, l)) : l.Ii(m.data, void 0))
  7311. }
  7312. }
  7313. 0 < e.count &&
  7314. b.RB(e, !1);
  7315. if (0 < g.count)
  7316. for (c = g.j; c.next();) d.add(c.key, c.value)
  7317. }
  7318. if (null !== b && null !== this.g && (b = b.ea, c = b.$H, null !== c)) {
  7319. var p = new oa;
  7320. d.each(function(a) { null !== a.key.data && p.add(a.key.data, a.value.data) });
  7321. c(p, b, this.g.ea)
  7322. }
  7323. for (b = d.j; b.next();) b.value.Ob();
  7324. return d
  7325. };
  7326. function Rh(a, b, c, d, e) {
  7327. if (null === b || e && !b.canCopy()) return null;
  7328. if (d.contains(b)) return d.oa(b);
  7329. var g = null,
  7330. h = b.data;
  7331. if (null !== h && null !== c) {
  7332. var k = c.ea;
  7333. b instanceof J ? k instanceof Y && (h = k.Kx(h), D.Qa(h) && (k.au(h), g = c.gg(h))) : (h = k.copyNodeData(h), D.Qa(h) && (k.dm(h), g = c.Nh(h)))
  7334. } else Sh(b), g = b.copy(), null !== g && (null !== c ? c.add(g) : null !== h && null !== a.g && a.qI && (k = a.g.ea, h = g instanceof J && k instanceof Y ? k.Kx(h) : k.copyNodeData(h), D.Qa(h) && (g.data = h)));
  7335. if (!(g instanceof F)) return null;
  7336. g.ib = !1;
  7337. g.Zg = !1;
  7338. d.add(b, g);
  7339. if (b instanceof G) {
  7340. for (h = b.Od; h.next();) {
  7341. k = h.value;
  7342. if (k.$ === b) {
  7343. var l = d.oa(k);
  7344. null !== l && (l.$ = g)
  7345. }
  7346. k.ba === b && (l = d.oa(k), null !== l && (l.ba = g))
  7347. }
  7348. if (b instanceof I && g instanceof I)
  7349. for (h = g, b = b.uc; b.next();) k = Rh(a, b.value, c, d, e), k instanceof J || null === k || (k.Ka = h)
  7350. } else if (b instanceof J && g instanceof J)
  7351. for (h = b.$, null !== h && (h = d.oa(h), null !== h && (g.$ = h)), h = b.ba, null !== h && (h = d.oa(h), null !== h && (g.ba = h)), b = b.Af; b.next();) h = Rh(a, b.value, c, d, e), null !== h && h instanceof G && (h.Xb = g);
  7352. return g
  7353. }
  7354. qa.prototype.copySelection = function() {
  7355. var a = this.g;
  7356. if (null !== a) {
  7357. for (var b = new L(F), a = a.selection.j; a.next();) Qh(b, a.value, !0, this.tI ? Infinity : 0, this.rI, function(a) { return a.canCopy() });
  7358. this.copyToClipboard(b)
  7359. }
  7360. };
  7361. qa.prototype.canCopySelection = function() { var a = this.g; return null !== a && a.Pk && a.EA && 0 !== a.selection.count ? !0 : !1 };
  7362. qa.prototype.cutSelection = function() {
  7363. this.copySelection();
  7364. this.deleteSelection()
  7365. };
  7366. qa.prototype.canCutSelection = function() { var a = this.g; return null !== a && !a.qb && !a.Mf && a.Pk && a.Cn && a.EA && 0 !== a.selection.count ? !0 : !1 };
  7367. qa.prototype.copyToClipboard = function(a) {
  7368. var b = this.g;
  7369. if (null !== b) {
  7370. var c = null;
  7371. if (null === a) Nh = null, Oh = "";
  7372. else {
  7373. var c = b.ea,
  7374. d = !1,
  7375. e = !1,
  7376. g = null;
  7377. try {
  7378. if (c instanceof Bg) {
  7379. var h = c,
  7380. d = h.Kn;
  7381. h.Kn = this.mF
  7382. }
  7383. c instanceof Y && (h = c, e = h.Jn, h.Jn = this.lF);
  7384. g = b.hq(a, null, !0)
  7385. } finally { c instanceof Bg && (c.Kn = d), c instanceof Y && (c.Jn = e), c = new K(F), c.Vc(g), Nh = c, Oh = b.ea.nm }
  7386. }
  7387. b.Ja("ClipboardChanged", c)
  7388. }
  7389. };
  7390. qa.prototype.pasteFromClipboard = function() {
  7391. var a = new L(F),
  7392. b = Nh;
  7393. if (null === b) return a;
  7394. var c = this.g;
  7395. if (null === c || Oh !== c.ea.nm) return a;
  7396. var d = c.ea,
  7397. e = !1,
  7398. g = !1,
  7399. h = null;
  7400. try {
  7401. if (d instanceof Bg) {
  7402. var k = d,
  7403. e = k.Kn;
  7404. k.Kn = this.mF
  7405. }
  7406. d instanceof Y && (k = d, g = k.Jn, k.Jn = this.lF);
  7407. h = c.hq(b, c, !1)
  7408. } finally { for (d instanceof Bg && (d.Kn = e), d instanceof Y && (d.Jn = g), b = h.j; b.next();) c = b.value, d = b.key, c.location.H() || (d.location.H() ? c.location = d.location : !c.position.H() && d.position.H() && (c.position = d.position)), a.add(c) }
  7409. return a
  7410. };
  7411. qa.prototype.pasteSelection = function(a) {
  7412. void 0 === a && (a = null);
  7413. var b = this.g;
  7414. if (null !== b) try {
  7415. b.sc = "wait";
  7416. b.Nb("Paste");
  7417. b.Ja("ChangingSelection");
  7418. var c = this.pasteFromClipboard();
  7419. 0 < c.count && Th(b);
  7420. for (var d = c.j; d.next();) d.value.ib = !0;
  7421. b.Ja("ChangedSelection");
  7422. if (null !== a) {
  7423. var e = b.computePartsBounds(b.selection);
  7424. if (e.H()) {
  7425. var g = b.nb.Ge;
  7426. null === g && (g = new Uh, g.ad(b));
  7427. var h = g.computeEffectiveCollection(b.selection);
  7428. g.moveParts(h, new N(a.x - e.pa, a.y - e.va), !1)
  7429. }
  7430. }
  7431. b.Ja("ClipboardPasted", c)
  7432. } finally {
  7433. b.jd("Paste"), b.sc =
  7434. ""
  7435. }
  7436. };
  7437. qa.prototype.canPasteSelection = function() { var a = this.g; return null === a || a.qb || a.Mf || !a.Zp || !a.EA || null === Nh || Oh !== a.ea.nm ? !1 : !0 };
  7438. qa.prototype.undo = function() {
  7439. var a = this.g;
  7440. null !== a && a.na.undo()
  7441. };
  7442. qa.prototype.canUndo = function() { var a = this.g; return null === a || a.qb || a.Mf ? !1 : a.YE && a.na.canUndo() };
  7443. qa.prototype.redo = function() {
  7444. var a = this.g;
  7445. null !== a && a.na.redo()
  7446. };
  7447. qa.prototype.canRedo = function() { var a = this.g; return null === a || a.qb || a.Mf ? !1 : a.YE && a.na.canRedo() };
  7448. qa.prototype.decreaseZoom = function(a) {
  7449. void 0 === a && (a = 1 / this.$y);
  7450. D.p(a, qa, "decreaseZoom:factor");
  7451. var b = this.g;
  7452. null !== b && b.im === Vh && (a *= b.scale, a < b.Sh || a > b.Rh || (b.scale = a))
  7453. };
  7454. qa.prototype.canDecreaseZoom = function(a) {
  7455. void 0 === a && (a = 1 / this.$y);
  7456. D.p(a, qa, "canDecreaseZoom:factor");
  7457. var b = this.g;
  7458. if (null === b || b.im !== Vh) return !1;
  7459. a *= b.scale;
  7460. return a < b.Sh || a > b.Rh ? !1 : b.Fx
  7461. };
  7462. qa.prototype.increaseZoom = function(a) {
  7463. void 0 === a && (a = this.$y);
  7464. D.p(a, qa, "increaseZoom:factor");
  7465. var b = this.g;
  7466. null !== b && b.im === Vh && (a *= b.scale, a < b.Sh || a > b.Rh || (b.scale = a))
  7467. };
  7468. qa.prototype.canIncreaseZoom = function(a) {
  7469. void 0 === a && (a = this.$y);
  7470. D.p(a, qa, "canIncreaseZoom:factor");
  7471. var b = this.g;
  7472. if (null === b || b.im !== Vh) return !1;
  7473. a *= b.scale;
  7474. return a < b.Sh || a > b.Rh ? !1 : b.Fx
  7475. };
  7476. qa.prototype.resetZoom = function(a) {
  7477. void 0 === a && (a = this.Ox);
  7478. D.p(a, qa, "resetZoom:newscale");
  7479. var b = this.g;
  7480. null === b || a < b.Sh || a > b.Rh || (b.scale = a)
  7481. };
  7482. qa.prototype.canResetZoom = function(a) {
  7483. void 0 === a && (a = this.Ox);
  7484. D.p(a, qa, "canResetZoom:newscale");
  7485. var b = this.g;
  7486. return null === b || a < b.Sh || a > b.Rh ? !1 : b.Fx
  7487. };
  7488. qa.prototype.zoomToFit = function() {
  7489. var a = this.g;
  7490. if (null !== a) {
  7491. var b = a.scale,
  7492. c = a.position;
  7493. b === this.DA && !isNaN(this.aA) && a.kd.O(this.CA) ? (a.scale = this.aA, a.position = this.PD, this.DA = NaN, this.CA = Ld) : (this.aA = b, this.PD = c.copy(), a.zoomToFit(), this.DA = a.scale, this.CA = a.kd.copy())
  7494. }
  7495. };
  7496. qa.prototype.canZoomToFit = function() { var a = this.g; return null === a ? !1 : a.Fx };
  7497. qa.prototype.scrollToPart = function(a) {
  7498. void 0 === a && (a = null);
  7499. null !== a && D.l(a, F, qa, "part");
  7500. var b = this.g;
  7501. if (null !== b) {
  7502. if (null === a) {
  7503. try { null !== this.uj && (this.uj.next() ? a = this.uj.value : this.uj = null) } catch (c) { this.uj = null }
  7504. null === a && (0 < b.vm.count ? this.uj = b.vm.j : 0 < b.selection.count && (this.uj = b.selection.j), null !== this.uj && this.uj.next() && (a = this.uj.value))
  7505. }
  7506. if (null !== a) {
  7507. var d = b.Ra;
  7508. d.po("Scroll To Part");
  7509. var e = this.nK;
  7510. if (0 < e) {
  7511. var g = Wh(this, a, [a]),
  7512. h = function() {
  7513. b.Nb();
  7514. for (var a = g.pop(); 0 < g.length && a instanceof G && a.Dc && (!(a instanceof I) || a.md);) a = g.pop();
  7515. 0 < g.length ? (a instanceof F && b.WG(a.aa), a instanceof G && !a.Dc && (a.Dc = !0), a instanceof I && !a.md && (a.md = !0)) : (a instanceof F && b.eF(a.aa), b.QB("LayoutCompleted", k));
  7516. b.jd("Scroll To Part")
  7517. },
  7518. k = function() { setTimeout(h, (d.isEnabled ? d.duration : 0) + e) };
  7519. b.xx("LayoutCompleted", k);
  7520. h()
  7521. } else {
  7522. var l = b.position.copy();
  7523. b.eF(a.aa);
  7524. l.Wc(b.position) && d.Yh()
  7525. }
  7526. }
  7527. }
  7528. };
  7529. function Wh(a, b, c) {
  7530. if (b.isVisible()) return c;
  7531. if (b instanceof da) Wh(a, b.If, c);
  7532. else if (b instanceof J) {
  7533. var d = b.$;
  7534. null !== d && Wh(a, d, c);
  7535. b = b.ba;
  7536. null !== b && Wh(a, b, c)
  7537. } else b instanceof G && (d = b.Xb, null !== d && Wh(a, d, c), d = b.Yk(), null !== d && (d.Dc || d.br || c.push(d), Wh(a, d, c))), b = b.Ka, null !== b && (b.md || b.Zy || c.push(b), Wh(a, b, c));
  7538. return c
  7539. }
  7540. qa.prototype.canScrollToPart = function(a) {
  7541. void 0 === a && (a = null);
  7542. if (null !== a && !(a instanceof F)) return !1;
  7543. a = this.g;
  7544. return null === a || 0 === a.selection.count && 0 === a.vm.count ? !1 : a.Be && a.Ce
  7545. };
  7546. qa.prototype.collapseTree = function(a) {
  7547. void 0 === a && (a = null);
  7548. var b = this.g;
  7549. if (null !== b) try {
  7550. b.Nb("Collapse Tree");
  7551. b.Ra.po("Collapse Tree");
  7552. var c = new K(G);
  7553. if (null !== a && a.Dc) a.collapseTree(), c.add(a);
  7554. else
  7555. for (var d = b.selection.j; d.next();) {
  7556. var e = d.value;
  7557. e instanceof G && (a = e, a.Dc && (a.collapseTree(), c.add(a)))
  7558. }
  7559. b.Ja("TreeCollapsed", c)
  7560. } finally { b.jd("Collapse Tree") }
  7561. };
  7562. qa.prototype.canCollapseTree = function(a) {
  7563. void 0 === a && (a = null);
  7564. var b = this.g;
  7565. if (null === b || b.qb) return !1;
  7566. if (null !== a) { if (!(a instanceof G && a.Dc)) return !1; if (0 < a.Yx().count) return !0 } else
  7567. for (a = b.selection.j; a.next();)
  7568. if (b = a.value, b instanceof G && b.Dc && 0 < b.Yx().count) return !0; return !1
  7569. };
  7570. qa.prototype.expandTree = function(a) {
  7571. void 0 === a && (a = null);
  7572. var b = this.g;
  7573. if (null !== b) try {
  7574. b.Nb("Expand Tree");
  7575. b.Ra.po("Expand Tree");
  7576. var c = new K(G);
  7577. if (null === a || a.Dc)
  7578. for (var d = b.selection.j; d.next();) {
  7579. var e = d.value;
  7580. e instanceof G && (a = e, a.Dc || (a.expandTree(), c.add(a)))
  7581. } else a.expandTree(), c.add(a);
  7582. b.Ja("TreeExpanded", c)
  7583. } finally { b.jd("Expand Tree") }
  7584. };
  7585. qa.prototype.canExpandTree = function(a) {
  7586. void 0 === a && (a = null);
  7587. var b = this.g;
  7588. if (null === b || b.qb) return !1;
  7589. if (null !== a) { if (!(a instanceof G) || a.Dc) return !1; if (0 < a.Yx().count) return !0 } else
  7590. for (a = b.selection.j; a.next();)
  7591. if (b = a.value, b instanceof G && !b.Dc && 0 < b.Yx().count) return !0; return !1
  7592. };
  7593. qa.prototype.groupSelection = function() {
  7594. var a = this.g;
  7595. if (null !== a) {
  7596. var b = a.ea;
  7597. if (b instanceof Y) {
  7598. var c = this.ZE;
  7599. if (null !== c) {
  7600. var d = null;
  7601. try {
  7602. a.sc = "wait";
  7603. a.Nb("Group");
  7604. a.Ja("ChangingSelection");
  7605. for (var e = new K(F), g = a.selection.j; g.next();) {
  7606. var h = g.value;
  7607. h.qe() && h.canGroup() && e.add(h)
  7608. }
  7609. for (var k = new K(F), l = e.j; l.next();) {
  7610. for (var m = l.value, g = !1, n = e.j; n.next();)
  7611. if (m.Fi(n.value)) { g = !0; break }
  7612. g || k.add(m)
  7613. }
  7614. if (0 < k.count) {
  7615. var p = k.first().Ka;
  7616. if (null !== p)
  7617. for (; null !== p;) {
  7618. for (var e = !1, q = k.j; q.next();)
  7619. if (!q.value.Fi(p)) {
  7620. e = !0;
  7621. break
  7622. }
  7623. if (e) p = p.Ka;
  7624. else break
  7625. }
  7626. if (c instanceof I) Sh(c), d = c.copy(), null !== d && a.add(d);
  7627. else if (b.sB(c)) {
  7628. var r = b.copyNodeData(c);
  7629. D.Qa(r) && (b.dm(r), d = a.Xx(r))
  7630. }
  7631. if (null !== d) {
  7632. null !== p && this.isValidMember(p, d) && (d.Ka = p);
  7633. for (var s = k.j; s.next();) {
  7634. var u = s.value;
  7635. this.isValidMember(d, u) && (u.Ka = d)
  7636. }
  7637. a.select(d)
  7638. }
  7639. }
  7640. a.Ja("ChangedSelection");
  7641. a.Ja("SelectionGrouped", d)
  7642. } finally { a.jd("Group"), a.sc = "" }
  7643. }
  7644. }
  7645. }
  7646. };
  7647. qa.prototype.canGroupSelection = function() { var a = this.g; if (null === a || a.qb || a.Mf || !a.Zp || !a.Ax || !(a.ea instanceof Y) || null === this.ZE) return !1; for (a = a.selection.j; a.next();) { var b = a.value; if (b.qe() && b.canGroup()) return !0 } return !1 };
  7648. function Xh(a) {
  7649. var b = D.mb();
  7650. for (a = a.j; a.next();) {
  7651. var c = a.value;
  7652. c instanceof J || b.push(c)
  7653. }
  7654. a = new L(F);
  7655. for (var c = b.length, d = 0; d < c; d++) {
  7656. for (var e = b[d], g = !0, h = 0; h < c; h++)
  7657. if (e.Fi(b[h])) { g = !1; break }
  7658. g && a.add(e)
  7659. }
  7660. D.ya(b);
  7661. return a
  7662. }
  7663. qa.prototype.isValidMember = function(a, b) {
  7664. if (null === b || a === b || b instanceof J) return !1;
  7665. if (null !== a) { if (a === b || a.Fi(b)) return !1; var c = a.BB; if (null !== c && !c(a, b) || null === a.data && null !== b.data || null !== a.data && null === b.data) return !1 }
  7666. c = this.BB;
  7667. return null !== c ? c(a, b) : !0
  7668. };
  7669. qa.prototype.ungroupSelection = function(a) {
  7670. void 0 === a && (a = null);
  7671. var b = this.g;
  7672. if (null !== b) {
  7673. var c = b.ea;
  7674. if (c instanceof Y) try {
  7675. b.sc = "wait";
  7676. b.Nb("Ungroup");
  7677. b.Ja("ChangingSelection");
  7678. var d = new K(I);
  7679. if (null !== a) d.add(a);
  7680. else
  7681. for (var e = b.selection.j; e.next();) {
  7682. var g = e.value;
  7683. g instanceof I && (a = g, a.canUngroup() && d.add(a))
  7684. }
  7685. if (0 < d.count) {
  7686. b.Ix();
  7687. for (var h = d.j; h.next();) {
  7688. var k = h.value;
  7689. k.expandSubGraph();
  7690. var l = k.Ka,
  7691. m = null !== l && null !== l.data ? c.zb(l.data) : void 0,
  7692. n = new K(F);
  7693. n.Vc(k.uc);
  7694. for (var p = n.j; p.next();) {
  7695. var q =
  7696. p.value;
  7697. q.ib = !0;
  7698. if (!(q instanceof J)) {
  7699. var r = q.data;
  7700. null !== r ? c.$B(r, m) : q.Ka = l
  7701. }
  7702. }
  7703. b.remove(k)
  7704. }
  7705. }
  7706. b.Ja("ChangedSelection");
  7707. b.Ja("SelectionUngrouped", d, n)
  7708. } finally { b.jd("Ungroup"), b.sc = "" }
  7709. }
  7710. };
  7711. qa.prototype.canUngroupSelection = function(a) {
  7712. void 0 === a && (a = null);
  7713. var b = this.g;
  7714. if (null === b || b.qb || b.Mf || !b.Cn || !b.Ex || !(b.ea instanceof Y)) return !1;
  7715. if (null !== a) { if (!(a instanceof I)) return !1; if (a.canUngroup()) return !0 } else
  7716. for (a = b.selection.j; a.next();)
  7717. if (b = a.value, b instanceof I && b.canUngroup()) return !0; return !1
  7718. };
  7719. qa.prototype.addTopLevelParts = function(a, b) {
  7720. for (var c = !0, d = Xh(a).j; d.next();) {
  7721. var e = d.value;
  7722. null !== e.Ka && (!b || this.isValidMember(null, e) ? e.Ka = null : c = !1)
  7723. }
  7724. return c
  7725. };
  7726. qa.prototype.collapseSubGraph = function(a) {
  7727. void 0 === a && (a = null);
  7728. var b = this.g;
  7729. if (null !== b) try {
  7730. b.Nb("Collapse SubGraph");
  7731. b.Ra.po("Collapse SubGraph");
  7732. var c = new K(I);
  7733. if (null !== a && a.md) a.collapseSubGraph(), c.add(a);
  7734. else
  7735. for (var d = b.selection.j; d.next();) {
  7736. var e = d.value;
  7737. e instanceof I && (a = e, a.md && (a.collapseSubGraph(), c.add(a)))
  7738. }
  7739. b.Ja("SubGraphCollapsed", c)
  7740. } finally { b.jd("Collapse SubGraph") }
  7741. };
  7742. qa.prototype.canCollapseSubGraph = function(a) {
  7743. void 0 === a && (a = null);
  7744. var b = this.g;
  7745. if (null === b || b.qb) return !1;
  7746. if (null !== a) return a instanceof I && a.md ? !0 : !1;
  7747. for (a = b.selection.j; a.next();)
  7748. if (b = a.value, b instanceof I && b.md) return !0;
  7749. return !1
  7750. };
  7751. qa.prototype.expandSubGraph = function(a) {
  7752. void 0 === a && (a = null);
  7753. var b = this.g;
  7754. if (null !== b) try {
  7755. b.Nb("Expand SubGraph");
  7756. b.Ra.po("Expand SubGraph");
  7757. var c = new K(I);
  7758. if (null === a || a.md)
  7759. for (var d = b.selection.j; d.next();) {
  7760. var e = d.value;
  7761. e instanceof I && (a = e, a.md || (a.expandSubGraph(), c.add(a)))
  7762. } else a.expandSubGraph(), c.add(a);
  7763. b.Ja("SubGraphExpanded", c)
  7764. } finally { b.jd("Expand SubGraph") }
  7765. };
  7766. qa.prototype.canExpandSubGraph = function(a) {
  7767. void 0 === a && (a = null);
  7768. var b = this.g;
  7769. if (null === b || b.qb) return !1;
  7770. if (null !== a) return a instanceof I && !a.md ? !0 : !1;
  7771. for (a = b.selection.j; a.next();)
  7772. if (b = a.value, b instanceof I && !b.md) return !0;
  7773. return !1
  7774. };
  7775. qa.prototype.editTextBlock = function(a) {
  7776. void 0 === a && (a = null);
  7777. null !== a && D.l(a, pa, qa, "editTextBlock");
  7778. var b = this.g;
  7779. if (null !== b) {
  7780. var c = b.nb.iC;
  7781. if (null !== c) {
  7782. if (null === a) {
  7783. a = null;
  7784. for (var d = b.selection.j; d.next();) { var e = d.value; if (e.canEdit()) { a = e; break } }
  7785. if (null === a) return;
  7786. a = a.qu(function(a) { return a instanceof pa && a.XA })
  7787. }
  7788. null !== a && (b.eb = null, c.ih = a, b.eb = c)
  7789. }
  7790. }
  7791. };
  7792. qa.prototype.canEditTextBlock = function(a) {
  7793. void 0 === a && (a = null);
  7794. var b = this.g;
  7795. if (null === b || b.qb || b.Mf || !b.Dx || null === b.nb.iC) return !1;
  7796. if (null !== a) {
  7797. if (!(a instanceof pa)) return !1;
  7798. a = a.Y;
  7799. if (null !== a && a.canEdit()) return !0
  7800. } else
  7801. for (b = b.selection.j; b.next();)
  7802. if (a = b.value, a.canEdit() && (a = a.qu(function(a) { return a instanceof pa && a.XA }), null !== a)) return !0; return !1
  7803. };
  7804. qa.prototype.showContextMenu = function(a) {
  7805. var b = this.g;
  7806. if (null !== b) {
  7807. var c = b.nb.NA;
  7808. if (null !== c && (void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b), a = c.findObjectWithContextMenu(a), null !== a)) {
  7809. var d = new bg,
  7810. e = null;
  7811. a instanceof O ? e = a.fb(mc) : b.rJ || (e = b.wb, e = new N(e.x + e.width / 2, e.y + e.height / 2));
  7812. null !== e && (d.g = b, d.te = b.pC(e), d.ha = e, d.left = !1, d.right = !0, d.up = !0, b.U = d);
  7813. b.eb = c;
  7814. Yh(c, !1, a)
  7815. }
  7816. }
  7817. };
  7818. qa.prototype.canShowContextMenu = function(a) {
  7819. var b = this.g;
  7820. if (null === b) return !1;
  7821. var c = b.nb.NA;
  7822. if (null === c) return !1;
  7823. void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b);
  7824. return null === c.findObjectWithContextMenu(a) ? !1 : !0
  7825. };
  7826. D.defineProperty(qa, { qI: "copiesClipboardData" }, function() { return this.QC }, function(a) {
  7827. D.h(a, "boolean", qa, "copiesClipboardData");
  7828. this.QC = a
  7829. });
  7830. D.defineProperty(qa, { rI: "copiesConnectedLinks" }, function() { return this.RC }, function(a) {
  7831. D.h(a, "boolean", qa, "copiesConnectedLinks");
  7832. this.RC = a
  7833. });
  7834. D.defineProperty(qa, { vF: "deletesConnectedLinks" }, function() { return this.kD }, function(a) {
  7835. D.h(a, "boolean", qa, "deletesConnectedLinks");
  7836. this.kD = a
  7837. });
  7838. D.defineProperty(qa, { tI: "copiesTree" }, function() { return this.VC }, function(a) {
  7839. D.h(a, "boolean", qa, "copiesTree");
  7840. this.VC = a
  7841. });
  7842. D.defineProperty(qa, { yI: "deletesTree" }, function() { return this.lD }, function(a) {
  7843. D.h(a, "boolean", qa, "deletesTree");
  7844. this.lD = a
  7845. });
  7846. D.defineProperty(qa, { mF: "copiesParentKey" }, function() { return this.UC }, function(a) {
  7847. D.h(a, "boolean", qa, "copiesParentKey");
  7848. this.UC = a
  7849. });
  7850. D.defineProperty(qa, { lF: "copiesGroupKey" }, function() { return this.TC }, function(a) {
  7851. D.h(a, "boolean", qa, "copiesGroupKey");
  7852. this.TC = a
  7853. });
  7854. D.defineProperty(qa, { ZE: "archetypeGroupData" }, function() { return this.nz }, function(a) {
  7855. null !== a && D.l(a, Object, qa, "archetypeGroupData");
  7856. var b = this.g;
  7857. null !== b && (b = b.ea, b instanceof Y && (a instanceof I || b.sB(a) || D.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: " + a)));
  7858. this.nz = a
  7859. });
  7860. D.defineProperty(qa, { BB: "memberValidation" }, function() { return this.Rl }, function(a) {
  7861. null !== a && D.h(a, "function", qa, "memberValidation");
  7862. this.Rl = a
  7863. });
  7864. D.defineProperty(qa, { Ox: "defaultScale" }, function() { return this.hD }, function(a) {
  7865. D.p(a, qa, "defaultScale");
  7866. 0 < a || D.k("defaultScale must be larger than zero, not: " + a);
  7867. this.hD = a
  7868. });
  7869. D.defineProperty(qa, { $y: "zoomFactor" }, function() { return this.PE }, function(a) {
  7870. D.p(a, qa, "zoomFactor");
  7871. 1 < a || D.k("zoomFactor must be larger than 1.0, not: " + a);
  7872. this.PE = a
  7873. });
  7874. D.defineProperty(qa, { nK: "scrollToPartPause" }, function() { return this.nE }, function(a) {
  7875. D.p(a, qa, "scrollToPartPause");
  7876. this.nE = a
  7877. });
  7878. function Zg() {
  7879. 0 < arguments.length && D.zd(Zg);
  7880. D.xc(this);
  7881. this.ca = null;
  7882. this.$b = "";
  7883. this.rf = !0;
  7884. this.BD = !1;
  7885. this.JE = null;
  7886. this.vx = -1
  7887. }
  7888. D.ka("Tool", Zg);
  7889. Zg.prototype.ad = function(a) {
  7890. v && null !== a && D.l(a, E, Zg, "setDiagram");
  7891. this.ca = a
  7892. };
  7893. Zg.prototype.toString = function() { return "" !== this.name ? this.name + " Tool" : D.wf(Object.getPrototypeOf(this)) };
  7894. Zg.prototype.updateAdornments = function() {};
  7895. Zg.prototype.canStart = function() { return this.isEnabled };
  7896. Zg.prototype.doStart = function() {};
  7897. Zg.prototype.doActivate = function() { this.wa = !0 };
  7898. Zg.prototype.doDeactivate = function() { this.wa = !1 };
  7899. Zg.prototype.doStop = function() {};
  7900. Zg.prototype.doCancel = function() { this.stopTool() };
  7901. Zg.prototype.stopTool = function() {
  7902. var a = this.g;
  7903. null !== a && a.eb === this && (a.eb = null, a.sc = "")
  7904. };
  7905. Zg.prototype.doMouseDown = function() {!this.wa && this.canStart() && this.doActivate() };
  7906. Zg.prototype.doMouseMove = function() {};
  7907. Zg.prototype.doMouseUp = function() { this.stopTool() };
  7908. Zg.prototype.doMouseWheel = function() {};
  7909. Zg.prototype.canStartMultiTouch = function() { return !0 };
  7910. Zg.prototype.standardPinchZoomStart = function() {
  7911. var a = this.g;
  7912. if (null !== a) {
  7913. var b = a.U,
  7914. c = b.$x(0, D.Fb(NaN, NaN)),
  7915. d = b.$x(1, D.Fb(NaN, NaN));
  7916. if (c.H() && d.H() && (this.doCancel(), a.Cu("hasGestureZoom"))) {
  7917. a.aE = a.scale;
  7918. var e = d.x - c.x,
  7919. g = d.y - c.y;
  7920. a.sE = Math.sqrt(e * e + g * g);
  7921. b.bubbles = !1
  7922. }
  7923. D.A(c);
  7924. D.A(d)
  7925. }
  7926. };
  7927. Zg.prototype.standardPinchZoomMove = function() {
  7928. var a = this.g;
  7929. if (null !== a) {
  7930. var b = a.U,
  7931. c = b.$x(0, D.Fb(NaN, NaN)),
  7932. d = b.$x(1, D.Fb(NaN, NaN));
  7933. if (c.H() && d.H() && (this.doCancel(), a.Cu("hasGestureZoom"))) {
  7934. var e = d.x - c.x,
  7935. g = d.y - c.y,
  7936. g = Math.sqrt(e * e + g * g) / a.sE,
  7937. e = new N((Math.min(d.x, c.x) + Math.max(d.x, c.x)) / 2, (Math.min(d.y, c.y) + Math.max(d.y, c.y)) / 2),
  7938. g = a.aE * g,
  7939. h = a.yb;
  7940. if (g !== a.scale && h.canResetZoom(g)) {
  7941. var k = a.Jm;
  7942. a.Jm = e;
  7943. h.resetZoom(g);
  7944. a.Jm = k
  7945. }
  7946. b.bubbles = !1
  7947. }
  7948. D.A(c);
  7949. D.A(d)
  7950. }
  7951. };
  7952. Zg.prototype.doKeyDown = function() {
  7953. var a = this.g;
  7954. null !== a && "Esc" === a.U.key && this.doCancel()
  7955. };
  7956. Zg.prototype.doKeyUp = function() {};
  7957. Zg.prototype.startTransaction = Zg.prototype.Nb = function(a) {
  7958. void 0 === a && (a = this.name);
  7959. this.Tf = null;
  7960. var b = this.g;
  7961. return null === b ? !1 : b.Nb(a)
  7962. };
  7963. Zg.prototype.stopTransaction = Zg.prototype.kl = function() { var a = this.g; return null === a ? !1 : null === this.Tf ? a.Am() : a.jd(this.Tf) };
  7964. Zg.prototype.standardMouseSelect = function() {
  7965. var a = this.g;
  7966. if (null !== a && a.Jf) {
  7967. var b = a.U,
  7968. c = a.su(b.ha, !1);
  7969. if (null !== c)
  7970. if (D.Qh ? b.Xu : b.control) {
  7971. a.Ja("ChangingSelection");
  7972. for (b = c; null !== b && !b.canSelect();) b = b.Ka;
  7973. null !== b && (b.ib = !b.ib);
  7974. a.Ja("ChangedSelection")
  7975. } else if (b.shift) {
  7976. if (!c.ib) {
  7977. a.Ja("ChangingSelection");
  7978. for (b = c; null !== b && !b.canSelect();) b = b.Ka;
  7979. null !== b && (b.ib = !0);
  7980. a.Ja("ChangedSelection")
  7981. }
  7982. } else {
  7983. if (!c.ib) {
  7984. for (b = c; null !== b && !b.canSelect();) b = b.Ka;
  7985. null !== b && a.select(b)
  7986. }
  7987. } else !b.left || (D.Qh ? b.Xu : b.control) ||
  7988. b.shift || a.Ix()
  7989. }
  7990. };
  7991. Zg.prototype.standardMouseClick = function(a, b) {
  7992. void 0 === a && (a = null);
  7993. void 0 === b && (b = function(a) { return !a.layer.Yc });
  7994. var c = this.g;
  7995. if (null === c) return !1;
  7996. var d = c.U,
  7997. e = c.Je(d.ha, a, b);
  7998. d.Ne = e;
  7999. Zh(e, d, c);
  8000. return d.Cc
  8001. };
  8002. function Zh(a, b, c) {
  8003. b.Cc = !1;
  8004. if (null === a || a.Ju()) {
  8005. var d = 0;
  8006. b.left ? d = 1 === b.Ee ? 1 : 2 === b.Ee ? 2 : 1 : b.right && 1 === b.Ee && (d = 3);
  8007. var e = "";
  8008. if (null !== a) {
  8009. switch (d) {
  8010. case 1:
  8011. e = "ObjectSingleClicked";
  8012. break;
  8013. case 2:
  8014. e = "ObjectDoubleClicked";
  8015. break;
  8016. case 3:
  8017. e = "ObjectContextClicked"
  8018. }
  8019. 0 !== d && c.Ja(e, a)
  8020. } else {
  8021. switch (d) {
  8022. case 1:
  8023. e = "BackgroundSingleClicked";
  8024. break;
  8025. case 2:
  8026. e = "BackgroundDoubleClicked";
  8027. break;
  8028. case 3:
  8029. e = "BackgroundContextClicked"
  8030. }
  8031. 0 !== d && c.Ja(e)
  8032. }
  8033. if (null !== a)
  8034. for (; null !== a;) {
  8035. c = null;
  8036. switch (d) {
  8037. case 1:
  8038. c = a.click;
  8039. break;
  8040. case 2:
  8041. c = a.nu ? a.nu :
  8042. a.click;
  8043. break;
  8044. case 3:
  8045. c = a.MA
  8046. }
  8047. if (null !== c && (c(b, a), b.Cc)) break;
  8048. a = a.R
  8049. } else {
  8050. a = null;
  8051. switch (d) {
  8052. case 1:
  8053. a = c.click;
  8054. break;
  8055. case 2:
  8056. a = c.nu ? c.nu : c.click;
  8057. break;
  8058. case 3:
  8059. a = c.MA
  8060. }
  8061. null !== a && a(b)
  8062. }
  8063. }
  8064. }
  8065. Zg.prototype.standardMouseOver = function() {
  8066. var a = this.g;
  8067. if (null !== a) {
  8068. var b = a.U;
  8069. if (null !== b.g && !0 !== a.Ra.zc) {
  8070. var c = a.kb;
  8071. a.kb = !0;
  8072. var d = a.th ? a.Je(b.ha, null, null) : null;
  8073. b.Ne = d;
  8074. var e = !1;
  8075. if (d !== a.Qo) {
  8076. var g = a.Qo,
  8077. h = g;
  8078. a.Qo = d;
  8079. this.doCurrentObjectChanged(g, d);
  8080. for (b.Cc = !1; null !== g;) {
  8081. var k = g.Zu;
  8082. if (null !== k) {
  8083. if (d === g) break;
  8084. if (null !== d && d.xm(g)) break;
  8085. k(b, g, d);
  8086. e = !0;
  8087. if (b.Cc) break
  8088. }
  8089. g = g.R
  8090. }
  8091. g = h;
  8092. for (b.Cc = !1; null !== d;) {
  8093. k = d.Yu;
  8094. if (null !== k) {
  8095. if (g === d) break;
  8096. if (null !== g && g.xm(d)) break;
  8097. k(b, d, g);
  8098. e = !0;
  8099. if (b.Cc) break
  8100. }
  8101. d = d.R
  8102. }
  8103. d = a.Qo
  8104. }
  8105. if (null !==
  8106. d) {
  8107. g = d;
  8108. for (h = ""; null !== g;) {
  8109. h = g.cursor;
  8110. if ("" !== h) break;
  8111. g = g.R
  8112. }
  8113. a.sc = h;
  8114. b.Cc = !1;
  8115. for (g = d; null !== g;) {
  8116. d = g.FB;
  8117. if (null !== d && (d(b, g), e = !0, b.Cc)) break;
  8118. g = g.R
  8119. }
  8120. } else a.sc = "", d = a.FB, null !== d && (d(b), e = !0);
  8121. e && a.Ve();
  8122. a.kb = c
  8123. }
  8124. }
  8125. };
  8126. Zg.prototype.doCurrentObjectChanged = function() {};
  8127. Zg.prototype.standardMouseWheel = function() {
  8128. var a = this.g;
  8129. if (null !== a) {
  8130. var b = a.U,
  8131. c = b.Uk;
  8132. if (0 !== c && a.kd.H()) {
  8133. var d = a.yb,
  8134. e = a.nb.$u;
  8135. if ((e === $h && !b.shift || e === ai && b.control) && (0 < c ? d.canIncreaseZoom() : d.canDecreaseZoom())) e = a.Jm, a.Jm = b.te, 0 < c ? d.increaseZoom() : d.decreaseZoom(), a.Jm = e, b.bubbles = !1;
  8136. else if (e === $h && b.shift || e === ai && !b.control) {
  8137. var d = a.position.copy(),
  8138. e = 0 < c ? c : -c,
  8139. g = b.event.deltaMode,
  8140. h = b.event.deltaX,
  8141. k = b.event.deltaY,
  8142. l = "pixel";
  8143. if (D.zq || D.Aq || D.rB) g = 1, 0 < h && (h = 3), 0 > h && (h = -3), 0 < k && (k = 3), 0 > k && (k = -3);
  8144. if (void 0 === g || void 0 === h || void 0 === k || 0 === h && 0 === k || b.shift) !b.shift && a.Ce ? (g = a.mv, e = 3 * e * g, 0 < c ? a.scroll("pixel", "up", e) : a.scroll("pixel", "down", e)) : b.shift && a.Be && (g = a.lv, e = 3 * e * g, 0 < c ? a.scroll("pixel", "left", e) : a.scroll("pixel", "right", e));
  8145. else {
  8146. switch (g) {
  8147. case 0:
  8148. l = "pixel";
  8149. break;
  8150. case 1:
  8151. l = "line";
  8152. break;
  8153. case 2:
  8154. l = "page";
  8155. break;
  8156. default:
  8157. l = "pixel"
  8158. }
  8159. 0 !== h && a.Be && (0 < h ? a.scroll(l, "left", -h) : a.scroll(l, "right", h));
  8160. 0 !== k && a.Ce && (0 < k ? a.scroll(l, "up", -k) : a.scroll(l, "down", k))
  8161. }
  8162. a.position.O(d) || (b.bubbles = !1)
  8163. }
  8164. }
  8165. }
  8166. };
  8167. Zg.prototype.standardWaitAfter = function(a, b) {
  8168. D.h(a, "number", Zg, "standardWaitAfter:delay");
  8169. this.cancelWaitAfter();
  8170. var c = this,
  8171. d = b.copy();
  8172. this.vx = D.setTimeout(function() { c.doWaitAfter(d) }, a)
  8173. };
  8174. Zg.prototype.cancelWaitAfter = function() {
  8175. -1 !== this.vx && D.clearTimeout(this.vx);
  8176. this.vx = -1
  8177. };
  8178. Zg.prototype.doWaitAfter = function() {};
  8179. Zg.prototype.findToolHandleAt = function(a, b) {
  8180. var c = this.g;
  8181. if (null === c) return null;
  8182. c = c.Je(a, function(a) { for (; null !== a && !(a.R instanceof da);) a = a.R; return a });
  8183. return null === c ? null : c.Y.Kd === b ? c : null
  8184. };
  8185. Zg.prototype.isBeyondDragSize = function(a, b) {
  8186. var c = this.g;
  8187. if (null === c) return !1;
  8188. void 0 === a && (a = c.Pc.te);
  8189. void 0 === b && (b = c.U.te);
  8190. var d = c.nb.CI,
  8191. e = d.width,
  8192. d = d.height;
  8193. c.Pc.Qj && (e += 6, d += 6);
  8194. return Math.abs(b.x - a.x) > e || Math.abs(b.y - a.y) > d
  8195. };
  8196. D.w(Zg, { g: "diagram" }, function() { return this.ca });
  8197. D.defineProperty(Zg, { name: "name" }, function() { return this.$b }, function(a) {
  8198. D.h(a, "string", Zg, "name");
  8199. this.$b = a
  8200. });
  8201. D.defineProperty(Zg, { isEnabled: "isEnabled" }, function() { return this.rf }, function(a) {
  8202. D.h(a, "boolean", Zg, "isEnabled");
  8203. this.rf = a
  8204. });
  8205. D.defineProperty(Zg, { wa: "isActive" }, function() { return this.BD }, function(a) {
  8206. D.h(a, "boolean", Zg, "isActive");
  8207. this.BD = a
  8208. });
  8209. D.defineProperty(Zg, { Tf: "transactionResult" }, function() { return this.JE }, function(a) {
  8210. null !== a && D.h(a, "string", Zg, "transactionResult");
  8211. this.JE = a
  8212. });
  8213. function Uh() {
  8214. Zg.call(this);
  8215. 0 < arguments.length && D.zd(Uh);
  8216. this.name = "Dragging";
  8217. this.SC = this.FD = !0;
  8218. this.os = this.qD = !1;
  8219. this.KD = !0;
  8220. this.Rz = (new Ca(NaN, NaN)).freeze();
  8221. this.Sz = ec;
  8222. this.Tz = (new N(NaN, NaN)).freeze();
  8223. this.pD = !1;
  8224. this.Mw = this.Lw = this.Hz = this.PC = this.oD = this.$C = this.sj = null;
  8225. this.Vr = this.HD = !1;
  8226. this.Np = new N(NaN, NaN);
  8227. this.kx = new N;
  8228. this.nx = !1;
  8229. this.ED = !0;
  8230. this.Wo = 100;
  8231. this.ik = [];
  8232. this.FH = (new L(F)).freeze()
  8233. }
  8234. D.Ta(Uh, Zg);
  8235. D.ka("DraggingTool", Uh);
  8236. D.defineProperty(Uh, { gG: "isCopyEnabled" }, function() { return this.FD }, function(a) {
  8237. D.h(a, "boolean", Uh, "isCopyEnabled");
  8238. this.FD = a
  8239. });
  8240. D.defineProperty(Uh, { sI: "copiesEffectiveCollection" }, function() { return this.SC }, function(a) {
  8241. D.h(a, "boolean", Uh, "copiesEffectiveCollection");
  8242. this.SC = a
  8243. });
  8244. D.defineProperty(Uh, { DI: "dragsTree" }, function() { return this.qD }, function(a) {
  8245. D.h(a, "boolean", Uh, "dragsTree");
  8246. this.qD = a
  8247. });
  8248. D.defineProperty(Uh, { Lu: "isGridSnapEnabled" }, function() { return this.os }, function(a) {
  8249. D.h(a, "boolean", Uh, "isGridSnapEnabled");
  8250. this.os = a
  8251. });
  8252. D.defineProperty(Uh, { mJ: "isComplexRoutingRealtime" }, function() { return this.ED }, function(a) {
  8253. D.h(a, "boolean", Uh, "isComplexRoutingRealtime");
  8254. this.ED = a
  8255. });
  8256. D.defineProperty(Uh, { oJ: "isGridSnapRealtime" }, function() { return this.KD }, function(a) {
  8257. D.h(a, "boolean", Uh, "isGridSnapRealtime");
  8258. this.KD = a
  8259. });
  8260. D.defineProperty(Uh, { XF: "gridSnapCellSize" }, function() { return this.Rz }, function(a) {
  8261. D.l(a, Ca, Uh, "gridSnapCellSize");
  8262. this.Rz.O(a) || (this.Rz = a = a.V())
  8263. });
  8264. D.defineProperty(Uh, { ZI: "gridSnapCellSpot" }, function() { return this.Sz }, function(a) {
  8265. D.l(a, S, Uh, "gridSnapCellSpot");
  8266. this.Sz.O(a) || (this.Sz = a = a.V())
  8267. });
  8268. D.defineProperty(Uh, { $I: "gridSnapOrigin" }, function() { return this.Tz }, function(a) {
  8269. D.l(a, N, Uh, "gridSnapOrigin");
  8270. this.Tz.O(a) || (this.Tz = a = a.V())
  8271. });
  8272. D.defineProperty(Uh, { Ij: "dragsLink" }, function() { return this.pD }, function(a) {
  8273. D.h(a, "boolean", Uh, "dragsLink");
  8274. this.pD = a
  8275. });
  8276. D.defineProperty(Uh, { Mn: "currentPart" }, function() { return this.$C }, function(a) {
  8277. null !== a && D.l(a, F, Uh, "currentPart");
  8278. this.$C = a
  8279. });
  8280. D.defineProperty(Uh, { mc: "copiedParts" }, function() { return this.PC }, function(a) { this.PC = a });
  8281. D.defineProperty(Uh, { hc: "draggedParts" }, function() { return this.oD }, function(a) { this.oD = a });
  8282. D.w(Uh, { KL: "draggingParts" }, function() { return null !== this.mc ? this.mc.bk() : null !== this.hc ? this.hc.bk() : this.FH });
  8283. D.defineProperty(Uh, { wd: "draggedLink" }, function() { return this.Hz }, function(a) {
  8284. null !== a && D.l(a, J, Uh, "draggedLink");
  8285. this.Hz !== a && (this.Hz = a, null !== a ? (this.Lw = a.oc, this.Mw = a.Gc) : this.Mw = this.Lw = null)
  8286. });
  8287. D.defineProperty(Uh, { gy: "isDragOutStarted" }, function() { return this.HD }, function(a) { this.HD = a });
  8288. D.defineProperty(Uh, { jl: "startPoint" }, function() { return this.kx }, function(a) {
  8289. D.l(a, N, Uh, "startPoint");
  8290. this.kx.O(a) || (this.kx = a = a.V())
  8291. });
  8292. D.defineProperty(Uh, { qF: "delay" }, function() { return this.Wo }, function(a) {
  8293. D.h(a, "number", Uh, "delay");
  8294. this.Wo = a
  8295. });
  8296. Uh.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; if (null === a || a.qb && !a.du || !a.fm && !a.Pk && !a.du || !a.Jf) return !1; var b = a.U; return !b.left || a.eb !== this && (!this.isBeyondDragSize() || b.Qj && b.timestamp - a.Pc.timestamp < this.Wo) ? !1 : null !== this.findDraggablePart() };
  8297. Uh.prototype.findDraggablePart = function() {
  8298. var a = this.g;
  8299. if (null === a) return null;
  8300. a = a.su(a.Pc.ha, !1);
  8301. if (null === a) return null;
  8302. for (; null !== a && !a.canSelect();) a = a.Ka;
  8303. return null !== a && (a.canMove() || a.canCopy()) ? a : null
  8304. };
  8305. Uh.prototype.standardMouseSelect = function() {
  8306. var a = this.g;
  8307. if (null !== a && a.Jf) {
  8308. var b = a.su(a.Pc.ha, !1);
  8309. if (null !== b) {
  8310. for (; null !== b && !b.canSelect();) b = b.Ka;
  8311. this.Mn = b;
  8312. this.Mn.ib || (a.Ja("ChangingSelection"), b = a.U, (D.Qh ? b.Xu : b.control) || b.shift || Th(a), this.Mn.ib = !0, a.Ja("ChangedSelection"))
  8313. }
  8314. }
  8315. };
  8316. Uh.prototype.doActivate = function() {
  8317. var a = this.g;
  8318. if (null !== a) {
  8319. null === this.Mn && this.standardMouseSelect();
  8320. var b = this.Mn;
  8321. null !== b && (b.canMove() || b.canCopy()) && (this.wa = !0, this.Np.set(a.position), bi(this, a.selection), this.ik.length = 0, this.hc = this.computeEffectiveCollection(a.selection), a.rv = !0, ci(this, this.hc), this.Nb("Drag"), this.jl = a.Pc.ha, a.of = !0, a.du && (this.gy = !0, this.Vr = !1, di = this, ei = this.g, this.doSimulatedDragOut()))
  8322. }
  8323. };
  8324. function bi(a, b) {
  8325. if (a.Ij) {
  8326. var c = a.g;
  8327. null !== c && c.Dn && (c.ea instanceof Y && 1 === b.count && b.first() instanceof J ? (a.wd = b.first(), a.wd.canRelinkFrom() && a.wd.canRelinkTo() && a.wd.iu(), a.sj = c.nb.HG, null === a.sj && (a.sj = new fi, a.sj.ad(c))) : (a.wd = null, a.sj = null))
  8328. }
  8329. }
  8330. Uh.prototype.computeEffectiveCollection = function(a) {
  8331. var b = null !== this.g && this.g.eb === this,
  8332. c = new oa(F);
  8333. if (null === a) return c;
  8334. for (var d = a.j; d.next();) gi(this, c, d.value, b);
  8335. if (null !== this.wd && this.Ij) return c;
  8336. for (d = a.j; d.next();) a = d.value, a instanceof J && (b = a.$, null === b || c.contains(b) ? (b = a.ba, null === b || c.contains(b) || c.remove(a)) : c.remove(a));
  8337. return c
  8338. };
  8339. function hi(a, b) { return void 0 === b ? new qi(Kd) : a.Lu ? new qi(new N(Math.round(b.x), Math.round(b.y))) : new qi(b.copy()) }
  8340. function gi(a, b, c, d) {
  8341. if (!b.contains(c) && (!d || c.canMove() || c.canCopy()))
  8342. if (c instanceof G) {
  8343. b.add(c, hi(a, c.location));
  8344. if (c instanceof I)
  8345. for (var e = c.uc; e.next();) gi(a, b, e.value, d);
  8346. for (e = c.Od; e.next();) {
  8347. var g = e.value;
  8348. if (!b.contains(g)) {
  8349. var h = g.$,
  8350. k = g.ba;
  8351. null !== h && b.contains(h) && null !== k && b.contains(k) && gi(a, b, g, d)
  8352. }
  8353. }
  8354. if (a.DI)
  8355. for (c = c.KF(); c.next();) gi(a, b, c.value, d)
  8356. } else if (c instanceof J)
  8357. for (g = c, b.add(g, hi(a)), c = g.Af; c.next();) gi(a, b, c.value, d);
  8358. else c instanceof da || b.add(c, hi(a, c.location))
  8359. }
  8360. Uh.prototype.doDeactivate = function() {
  8361. this.wa = !1;
  8362. var a = this.g;
  8363. null !== a && Di(a);
  8364. Ei(this);
  8365. Fi(this, this.hc);
  8366. this.hc = this.Mn = null;
  8367. this.Vr = this.gy = !1;
  8368. if (0 < Gi.count) {
  8369. for (var b = Gi.length, c = 0; c < b; c++) {
  8370. var d = Gi.fa(c);
  8371. Hi(d);
  8372. Ii(d);
  8373. Ei(d);
  8374. null !== d.g && Di(d.g)
  8375. }
  8376. Gi.clear()
  8377. }
  8378. Hi(this);
  8379. this.Np.n(NaN, NaN);
  8380. di = ei = null;
  8381. Ii(this);
  8382. a.of = !1;
  8383. a.sc = "";
  8384. a.rv = !1;
  8385. this.kl()
  8386. };
  8387. function Ei(a) {
  8388. var b = a.g;
  8389. if (null !== b) {
  8390. var c = b.kb;
  8391. b.kb = !0;
  8392. Ji(a, b.U, null);
  8393. b.kb = c
  8394. }
  8395. a.ik.length = 0
  8396. }
  8397. function Ki() {
  8398. var a = di;
  8399. Ii(a);
  8400. Li(a);
  8401. var b = a.g;
  8402. null !== b && a.Np.H() && (b.position = a.Np);
  8403. null !== b && Di(b)
  8404. }
  8405. Uh.prototype.doCancel = function() {
  8406. Ii(this);
  8407. Li(this);
  8408. var a = this.g;
  8409. null !== a && this.Np.H() && (a.position = this.Np);
  8410. this.stopTool()
  8411. };
  8412. function ci(a, b) {
  8413. if (null !== b) {
  8414. a.nx = !0;
  8415. for (var c = b.j; c.next();) {
  8416. var d = c.key;
  8417. d instanceof J && (d.Ji = !0)
  8418. }
  8419. }
  8420. }
  8421. function Fi(a, b) {
  8422. if (null !== b) {
  8423. for (var c = b.j; c.next();) {
  8424. var d = c.key;
  8425. d instanceof J && (d.Ji = !1, Mi(d) && d.ec())
  8426. }
  8427. a.nx = !1
  8428. }
  8429. }
  8430. Uh.prototype.doKeyDown = function() {
  8431. var a = this.g;
  8432. null !== a && (a = a.U, null !== a && this.wa && ("Esc" === a.key ? this.doCancel() : this.doMouseMove()))
  8433. };
  8434. Uh.prototype.doKeyUp = function() {
  8435. var a = this.g;
  8436. null !== a && null !== a.U && this.wa && this.doMouseMove()
  8437. };
  8438. function Ni(a, b) {
  8439. for (var c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = a.j; h.next();) {
  8440. var k = h.value;
  8441. if (k.qe() && k.isVisible()) {
  8442. var l = k.location,
  8443. k = l.x,
  8444. l = l.y;
  8445. isNaN(k) || isNaN(l) || (k < c && (c = k), l < d && (d = l), k > e && (e = k), l > g && (g = l))
  8446. }
  8447. }
  8448. Infinity === c ? b.n(0, 0, 0, 0) : b.n(c, d, e - c, g - d)
  8449. }
  8450. function Oi(a, b) {
  8451. if (null === a.mc) {
  8452. var c = a.g;
  8453. if (!(null === c || b && (c.qb || c.Mf)) && null !== a.hc) {
  8454. var d = c.na;
  8455. d.isEnabled && d.jG ? null !== d.Gj && 0 < d.Gj.fg.count && (c.na.Am(), c.Nb("Drag")) : Li(a);
  8456. c.kb = !b;
  8457. c.hr = !b;
  8458. a.jl = c.Pc.ha;
  8459. d = a.sI ? a.hc.bk() : c.selection;
  8460. d = c.hq(d, c, !0);
  8461. for (c = d.j; c.next();) c.value.location = c.key.location;
  8462. c = D.Sf();
  8463. Ni(d, c);
  8464. D.Lb(c);
  8465. for (var c = new oa(F), e = a.hc.j; e.next();) {
  8466. var g = e.key;
  8467. g.qe() && g.canCopy() && (g = d.oa(g), null !== g && (g.kf(), c.add(g, hi(a, g.location))))
  8468. }
  8469. for (d = d.j; d.next();) e = d.value, e instanceof
  8470. J && e.canCopy() && c.add(e, hi(a));
  8471. a.mc = c;
  8472. bi(a, c.bk());
  8473. null !== a.wd && (c = a.wd, d = c.so, c.gl(a.jl.x - (d.x + d.width / 2), a.jl.y - (d.y + d.height / 2)))
  8474. }
  8475. }
  8476. }
  8477. function Ii(a) {
  8478. var b = a.g;
  8479. if (null !== b) {
  8480. if (null !== a.mc && (b.RB(a.mc.bk(), !1), a.mc = null, null !== a.hc))
  8481. for (var c = a.hc.j; c.next();) c.key instanceof J && (c.value.point = new N(0, 0));
  8482. b.kb = !1;
  8483. b.hr = !1;
  8484. a.jl = b.Pc.ha
  8485. }
  8486. }
  8487. function Hi(a) {
  8488. if (null !== a.wd) {
  8489. if (a.Ij && null !== a.sj) {
  8490. var b = a.sj;
  8491. null !== b.g && (b.g.remove(b.fe), b.g.remove(b.ge))
  8492. }
  8493. a.wd = null;
  8494. a.sj = null
  8495. }
  8496. }
  8497. function Pi(a, b, c) {
  8498. var d = a.g;
  8499. if (null !== d) {
  8500. var e = a.jl,
  8501. g = D.P();
  8502. g.assign(d.U.ha);
  8503. a.moveParts(b, g.$j(e), c);
  8504. D.A(g)
  8505. }
  8506. }
  8507. Uh.prototype.moveParts = function(a, b, c) {
  8508. if (null !== a && (D.l(a, oa, Uh, "moveParts:parts"), 0 !== a.count)) {
  8509. var d = D.P(),
  8510. e = D.P();
  8511. e.assign(b);
  8512. isNaN(e.x) && (e.x = 0);
  8513. isNaN(e.y) && (e.y = 0);
  8514. (b = this.nx) || ci(this, a);
  8515. for (var g = new K(Qi), h = new K(Wa), k = a.j; k.next();) {
  8516. var l = k.key;
  8517. if (l.qe()) {
  8518. var m = Ri(this, l, a);
  8519. if (null !== m) g.add(new Qi(l, k.value, m));
  8520. else if (!c || l.canMove()) {
  8521. m = k.value.point;
  8522. d.assign(m);
  8523. var n = new N,
  8524. p = this.computeMove(l, d.add(e), a, n);
  8525. l.location = p;
  8526. k.value.eH = n.$j(m)
  8527. }
  8528. } else k.key instanceof J && h.add(k.bb)
  8529. }
  8530. for (c = g.j; c.next();) g =
  8531. c.value, m = g.info.point, d.assign(m), g.Zc.location = d.add(g.aJ.eH);
  8532. c = D.P();
  8533. m = D.P();
  8534. for (h = h.j; h.next();)
  8535. if (k = h.value, g = k.key, g instanceof J)
  8536. if (g.Ji) l = g.$, n = g.ba, null !== this.wd && this.Ij ? (k = k.value.point, a.add(g, hi(this, e)), l = e.x - k.x, k = e.y - k.y, g.gl(l, k)) : (null !== l && (c.assign(l.location), p = a.oa(l), null !== p && c.$j(p.point)), null !== n && (m.assign(n.location), p = a.oa(n), null !== p && m.$j(p.point)), null !== l && null !== n ? c.Wc(m) ? (k = k.value.point, l = d, l.assign(c), l.$j(k), a.add(g, hi(this, c)), g.gl(l.x, l.y)) : (g.Ji = !1, g.ec()) :
  8537. (k = k.value.point, n = null !== l ? c : null !== n ? m : e, a.add(g, hi(this, n)), l = n.x - k.x, k = n.y - k.y, g.gl(l, k)));
  8538. else if (null === g.$ || null === g.ba) k = k.value.point, a.add(g, hi(this, e)), l = e.x - k.x, k = e.y - k.y, g.gl(l, k);
  8539. D.A(d);
  8540. D.A(e);
  8541. D.A(c);
  8542. D.A(m);
  8543. b || (Si(this.g), Fi(this, a))
  8544. }
  8545. };
  8546. function Ri(a, b, c) {
  8547. b = b.Ka;
  8548. if (null !== b) {
  8549. a = Ri(a, b, c);
  8550. if (null !== a) return a;
  8551. a = c.oa(b);
  8552. if (null !== a) return a
  8553. }
  8554. return null
  8555. }
  8556. function Li(a) {
  8557. if (null !== a.hc) {
  8558. for (var b = a.g, c = a.hc.j; c.next();) {
  8559. var d = c.key;
  8560. d.qe() && (d.location = c.value.point)
  8561. }
  8562. for (c = a.hc.j; c.next();)
  8563. if (d = c.key, d instanceof J && d.Ji) {
  8564. var e = c.value.point;
  8565. a.hc.add(d, hi(a));
  8566. d.gl(-e.x, -e.y)
  8567. }
  8568. b.lg()
  8569. }
  8570. }
  8571. Uh.prototype.computeMove = function(a, b, c, d) {
  8572. void 0 === d && (d = new N);
  8573. d.assign(b);
  8574. if (null === a) return d;
  8575. void 0 === c && (c = null);
  8576. var e = b;
  8577. if (this.Lu && (this.oJ || null === c || null !== this.g && this.g.U.up) && (e = D.P(), c = e, c.assign(b), null !== a)) {
  8578. var g = this.g;
  8579. if (null !== g) {
  8580. var h = g.Vn,
  8581. k = this.XF,
  8582. g = k.width,
  8583. k = k.height,
  8584. l = this.$I,
  8585. m = l.x,
  8586. l = l.y,
  8587. n = this.ZI;
  8588. if (null !== h) {
  8589. var p = h.ay;
  8590. isNaN(g) && (g = p.width);
  8591. isNaN(k) && (k = p.height);
  8592. h = h.WF;
  8593. isNaN(m) && (m = h.x);
  8594. isNaN(l) && (l = h.y)
  8595. }
  8596. h = D.Fb(0, 0);
  8597. h.pv(0, 0, g, k, n);
  8598. jb(b.x, b.y, m + h.x, l + h.y, g, k, c);
  8599. D.A(h)
  8600. }
  8601. }
  8602. c =
  8603. null !== a.wF ? a.wF(a, b, e) : e;
  8604. k = a.PJ;
  8605. g = k.x;
  8606. isNaN(g) && (g = a.location.x);
  8607. k = k.y;
  8608. isNaN(k) && (k = a.location.y);
  8609. h = a.JJ;
  8610. m = h.x;
  8611. isNaN(m) && (m = a.location.x);
  8612. h = h.y;
  8613. isNaN(h) && (h = a.location.y);
  8614. d.n(Math.max(g, Math.min(c.x, m)), Math.max(k, Math.min(c.y, h)));
  8615. e !== b && D.A(e);
  8616. return d
  8617. };
  8618. function Ti(a, b) { if (null === b) return !0; var c = b.Y; return null === c || c instanceof da || c.layer.Yc || a.hc && a.hc.contains(c) || a.mc && a.mc.contains(c) ? !0 : !1 }
  8619. function Ui(a, b) {
  8620. var c = a.g;
  8621. if (null !== c) {
  8622. a.Ij && (null !== a.wd && (a.wd.$ = null, a.wd.ba = null), Vi(a, !1));
  8623. var d = Wi(c, b, null, function(b) { return !Ti(a, b) }),
  8624. e = c.U;
  8625. e.Ne = d;
  8626. var g = c.kb,
  8627. h = !1;
  8628. try {
  8629. c.kb = !0;
  8630. h = Ji(a, e, d);
  8631. if (!a.wa && null === di) return;
  8632. if (null === d) {
  8633. var k = c.TJ;
  8634. null !== k && (k(e), h = !0)
  8635. }
  8636. if (!a.wa && null === di) return;
  8637. a.doDragOver(b, d);
  8638. if (!a.wa && null === di) return
  8639. } finally { c.kb = g, h && c.lg() }(c.Be || c.Ce) && c.UA(e.te)
  8640. }
  8641. }
  8642. function Ji(a, b, c) {
  8643. var d = !1,
  8644. e = a.ik.length,
  8645. g = 0 < e ? a.ik[0] : null;
  8646. if (c === g) return !1;
  8647. b.Cc = !1;
  8648. for (var h = 0; h < e; h++) {
  8649. var k = a.ik[h],
  8650. l = k.SJ;
  8651. if (null !== l && (l(b, k, c), d = !0, b.Cc)) break
  8652. }
  8653. a.ik.length = 0;
  8654. if (!a.wa && null === di || null === c) return d;
  8655. for (b.Cc = !1; null !== c;) a.ik.push(c), c = Xi(c);
  8656. e = a.ik.length;
  8657. for (h = 0; h < e && (k = a.ik[h], l = k.RJ, null === l || (l(b, k, g), d = !0, !b.Cc)); h++);
  8658. return d
  8659. }
  8660. function Xi(a) { var b = a.R; return null !== b ? b : a instanceof F && !(a instanceof I) && (a = a.Ka, null !== a && a.cJ) ? a : null }
  8661. function Yi(a, b, c) {
  8662. var d = a.sj;
  8663. if (null === d) return null;
  8664. var e = a.g.Pn(b, d.FG, function(a) { return d.findValidLinkablePort(a, c) });
  8665. a = D.P();
  8666. for (var g = Infinity, h = null, e = e.j; e.next();) {
  8667. var k = e.value;
  8668. if (null !== k.Y) {
  8669. var l = k.fb(mc, a),
  8670. l = b.Kf(l);
  8671. l < g && (h = k, g = l)
  8672. }
  8673. }
  8674. D.A(a);
  8675. return h
  8676. }
  8677. function Vi(a, b) {
  8678. var c = a.wd;
  8679. if (null !== c && !(2 > c.ta)) {
  8680. var d = a.g;
  8681. if (null !== d && !d.qb) {
  8682. var e = a.sj;
  8683. if (null !== e) {
  8684. var g = null,
  8685. h = null;
  8686. null === c.$ && (g = Yi(a, c.m(0), !1), null !== g && (h = g.Y));
  8687. var k = null,
  8688. l = null;
  8689. null === c.ba && (k = Yi(a, c.m(c.ta - 1), !0), null !== k && (l = k.Y));
  8690. e.isValidLink(h, g, l, k) ? b ? (c.iq = c.m(0), c.jq = c.m(c.ta - 1), c.Ji = !1, c.$ = h, null !== g && (c.hg = g.yd), c.ba = l, null !== k && (c.jh = k.yd), c.oc !== a.Lw && d.Ja("LinkRelinked", c, a.Lw), c.Gc !== a.Mw && d.Ja("LinkRelinked", c, a.Mw)) : Zi(e, h, g, l, k) : Zi(e, null, null, null, null)
  8691. }
  8692. }
  8693. }
  8694. }
  8695. Uh.prototype.doDragOver = function() {};
  8696. function $i(a, b) {
  8697. var c = a.g;
  8698. if (null !== c) {
  8699. a.Ij && Vi(a, !0);
  8700. Ei(a);
  8701. var d = Wi(c, b, null, function(b) { return !Ti(a, b) }),
  8702. e = c.U;
  8703. e.Ne = d;
  8704. if (null !== d) {
  8705. e.Cc = !1;
  8706. for (var g = d; null !== g;) {
  8707. var h = g.CB;
  8708. if (null !== h && (h(e, g), e.Cc)) break;
  8709. g = Xi(g)
  8710. }
  8711. } else g = c.CB, null !== g && g(e);
  8712. if (a.wa || null !== di) {
  8713. for (e = (a.mc || a.hc).j; e.next();) g = e.key, g instanceof G && g.Od.each(function(a) { a.Ji = !1 });
  8714. a.doDropOnto(b, d);
  8715. if (a.wa || null !== di) {
  8716. d = D.Sf();
  8717. for (e = c.selection.j; e.next();) g = e.value, g instanceof G && aj(c, g.getAvoidableRect(d));
  8718. D.Lb(d)
  8719. }
  8720. }
  8721. }
  8722. }
  8723. function aj(a, b) {
  8724. var c = !1;
  8725. a.wb.Sk(b) && (c = !0);
  8726. c = a.$A(b, function(a) { return a.Y }, function(a) { return a instanceof J }, !0, function(a) { return a instanceof J }, c);
  8727. if (0 !== c.count)
  8728. for (c = c.j; c.next();) {
  8729. var d = c.value;
  8730. d.Nj && d.ec()
  8731. }
  8732. }
  8733. Uh.prototype.doDropOnto = function() {};
  8734. Uh.prototype.doMouseMove = function() {
  8735. if (this.wa) {
  8736. var a = this.g;
  8737. null !== a && null !== this.Mn && null !== this.hc && (this.mayCopy() ? (a.sc = "copy", Oi(this, !1), ci(this, this.mc), Pi(this, this.mc, !1), Fi(this, this.mc)) : this.mayMove() ? (Ii(this), Pi(this, this.hc, !0)) : this.mayDragOut() ? (a.sc = "no-drop", Oi(this, !1), Pi(this, this.mc, !1)) : Ii(this), Ui(this, a.U.ha))
  8738. }
  8739. };
  8740. Uh.prototype.doMouseUp = function() {
  8741. if (this.wa) {
  8742. var a = this.g;
  8743. if (null !== a) {
  8744. var b = !1,
  8745. c = this.mayCopy();
  8746. c && null !== this.mc ? (Ii(this), Oi(this, !0), ci(this, this.mc), Pi(this, this.mc, !1), Fi(this, this.mc), null !== this.mc && a.ZG(this.mc.bk())) : (b = !0, Ii(this), this.mayMove() && (Pi(this, this.hc, !0), Ui(this, a.U.ha)));
  8747. this.Vr = !0;
  8748. $i(this, a.U.ha);
  8749. if (this.wa) {
  8750. this.mc = null;
  8751. if (b && null !== this.hc)
  8752. for (b = this.hc.j; b.next();) {
  8753. var d = b.key;
  8754. d instanceof G && (d = d.Ka, null === d || null === d.placeholder || this.hc.contains(d) || d.placeholder.K())
  8755. }
  8756. a.Qc();
  8757. Fi(this, this.hc);
  8758. this.Tf = c ? "Copy" : "Move";
  8759. a.Ja(c ? "SelectionCopied" : "SelectionMoved", a.selection)
  8760. }
  8761. this.stopTool()
  8762. }
  8763. }
  8764. };
  8765. Uh.prototype.mayCopy = function() { if (!this.gG) return !1; var a = this.g; if (null === a || a.qb || a.Mf || !a.Zp || !a.Pk || (D.Qh ? !a.U.alt : !a.U.control)) return !1; for (a = a.selection.j; a.next();) { var b = a.value; if (b.qe() && b.canCopy()) return !0 } return null !== this.wd && this.Ij && this.wd.canCopy() ? !0 : !1 };
  8766. Uh.prototype.mayDragOut = function() { if (!this.gG) return !1; var a = this.g; if (null === a || !a.du || !a.Pk || a.fm) return !1; for (a = a.selection.j; a.next();) { var b = a.value; if (b.qe() && b.canCopy()) return !0 } return null !== this.wd && this.Ij && this.wd.canCopy() ? !0 : !1 };
  8767. Uh.prototype.mayMove = function() { var a = this.g; if (null === a || a.qb || !a.fm) return !1; for (a = a.selection.j; a.next();) { var b = a.value; if (b.qe() && b.canMove()) return !0 } return null !== this.wd && this.Ij && this.wd.canMove() ? !0 : !1 };
  8768. var Gi = new K(Uh),
  8769. di = null,
  8770. ei = null;
  8771. Uh.prototype.getDraggingSource = function() { return di };
  8772. Uh.prototype.mayDragIn = function() { var a = this.g; if (null === a || !a.XE || a.qb || a.Mf || !a.Zp) return !1; var b = di; return null === b || null === b.g || b.g.ea.nm !== a.ea.nm ? !1 : !0 };
  8773. Uh.prototype.doSimulatedDragEnter = function() {
  8774. if (this.mayDragIn()) {
  8775. var a = this.g;
  8776. a.Ra.Yh();
  8777. bj(a);
  8778. a.Ra.Yh();
  8779. a = di;
  8780. null !== a && null !== a.g && (a.g.sc = "copy")
  8781. }
  8782. };
  8783. Uh.prototype.doSimulatedDragLeave = function() {
  8784. var a = di;
  8785. null !== a && a.doSimulatedDragOut();
  8786. this.doCancel()
  8787. };
  8788. Uh.prototype.doSimulatedDragOver = function() {
  8789. var a = this.g;
  8790. if (null !== a) {
  8791. var b = di;
  8792. null !== b && null !== b.hc && this.mayDragIn() && (a.sc = "copy", cj(this, b.hc.bk(), !1), Pi(this, this.mc, !1), Ui(this, a.U.ha))
  8793. }
  8794. };
  8795. Uh.prototype.doSimulatedDrop = function() {
  8796. var a = this.g;
  8797. if (null !== a) {
  8798. var b = di;
  8799. if (null !== b) {
  8800. var c = b.g;
  8801. b.Vr = !0;
  8802. Ii(this);
  8803. this.mayDragIn() && (this.Nb("Drop"), cj(this, b.hc.bk(), !0), Pi(this, this.mc, !1), null !== this.mc && a.ZG(this.mc.bk()), $i(this, a.U.ha), a.Qc(), b = a.selection, null !== this.mc ? this.Tf = "ExternalCopy" : b = new L(F), this.mc = null, a.doFocus(), a.Ja("ExternalObjectsDropped", b, c), this.kl())
  8804. }
  8805. }
  8806. };
  8807. function cj(a, b, c) {
  8808. if (null === a.mc) {
  8809. var d = a.g;
  8810. if (null !== d && !d.qb && !d.Mf) {
  8811. d.kb = !c;
  8812. d.hr = !c;
  8813. a.jl = d.U.ha;
  8814. c = d.hq(b, d, !0);
  8815. var e = D.Sf();
  8816. Ni(b, e);
  8817. var d = e.x + e.width / 2,
  8818. g = e.y + e.height / 2;
  8819. D.Lb(e);
  8820. var e = a.kx,
  8821. h = new oa(F),
  8822. k = D.P();
  8823. for (b = b.j; b.next();) {
  8824. var l = b.value,
  8825. m = c.oa(l);
  8826. l.qe() && l.canCopy() ? (l = l.location, k.n(e.x - (d - l.x), e.y - (g - l.y)), m.location = k, m.kf(), h.add(m, hi(a, k))) : l instanceof J && l.canCopy() && (m.gl(e.x - d, e.y - g), h.add(m, hi(a)))
  8827. }
  8828. D.A(k);
  8829. a.mc = h;
  8830. bi(a, h.bk());
  8831. null !== a.wd && (c = a.wd, d = c.so, c.gl(a.jl.x - (d.x + d.width /
  8832. 2), a.jl.y - (d.y + d.height / 2)))
  8833. }
  8834. }
  8835. }
  8836. Uh.prototype.doSimulatedDragOut = function() {
  8837. var a = this.g;
  8838. null !== a && (this.mayCopy() || this.mayMove() ? a.sc = "" : a.sc = "no-drop")
  8839. };
  8840. function qi(a) {
  8841. this.point = a;
  8842. this.eH = Kd
  8843. }
  8844. D.ka("DraggingInfo", qi);
  8845. function Qi(a, b, c) {
  8846. this.Zc = a;
  8847. this.info = b;
  8848. this.aJ = c
  8849. }
  8850. function dj() {
  8851. 0 < arguments.length && D.zd(dj);
  8852. Zg.call(this);
  8853. this.jE = 100;
  8854. this.ND = !1;
  8855. var a = new J,
  8856. b = new z;
  8857. b.Ue = !0;
  8858. b.stroke = "blue";
  8859. a.add(b);
  8860. b = new z;
  8861. b.ar = "Standard";
  8862. b.fill = "blue";
  8863. b.stroke = "blue";
  8864. a.add(b);
  8865. a.Nf = "Tool";
  8866. this.DE = a;
  8867. a = new G;
  8868. b = new z;
  8869. b.yd = "";
  8870. b.Kb = "Rectangle";
  8871. b.fill = null;
  8872. b.stroke = "magenta";
  8873. b.lb = 2;
  8874. b.Ea = Yd;
  8875. a.add(b);
  8876. a.il = !1;
  8877. a.Nf = "Tool";
  8878. this.BE = a;
  8879. this.CE = b;
  8880. a = new G;
  8881. b = new z;
  8882. b.yd = "";
  8883. b.Kb = "Rectangle";
  8884. b.fill = null;
  8885. b.stroke = "magenta";
  8886. b.lb = 2;
  8887. b.Ea = Yd;
  8888. a.add(b);
  8889. a.il = !1;
  8890. a.Nf = "Tool";
  8891. this.EE = a;
  8892. this.FE = b;
  8893. this.iE = this.hE =
  8894. this.dE = this.cE = this.eE = null;
  8895. this.JD = !0;
  8896. this.SH = new oa(O, "boolean");
  8897. this.kE = this.Pl = this.yE = null
  8898. }
  8899. D.Ta(dj, Zg);
  8900. D.ka("LinkingBaseTool", dj);
  8901. dj.prototype.doStop = function() {
  8902. var a = this.g;
  8903. null !== a && Di(a);
  8904. this.fh = this.eh = this.dh = this.bh = this.vc = null;
  8905. this.Xy.clear();
  8906. this.Rf = null
  8907. };
  8908. D.defineProperty(dj, { FG: "portGravity" }, function() { return this.jE }, function(a) {
  8909. D.h(a, "number", dj, "portGravity");
  8910. 0 <= a && (this.jE = a)
  8911. });
  8912. D.defineProperty(dj, { Cq: "isUnconnectedLinkValid" }, function() { return this.ND }, function(a) {
  8913. D.h(a, "boolean", dj, "isUnconnectedLinkValid");
  8914. this.ND = a
  8915. });
  8916. D.defineProperty(dj, { Ef: "temporaryLink" }, function() { return this.DE }, function(a) {
  8917. D.l(a, J, dj, "temporaryLink");
  8918. this.DE = a
  8919. });
  8920. D.defineProperty(dj, { fe: "temporaryFromNode" }, function() { return this.BE }, function(a) {
  8921. D.l(a, G, dj, "temporaryFromNode");
  8922. this.BE = a
  8923. });
  8924. D.defineProperty(dj, { xo: "temporaryFromPort" }, function() { return this.CE }, function(a) {
  8925. D.l(a, O, dj, "temporaryFromPort");
  8926. this.CE = a
  8927. });
  8928. D.defineProperty(dj, { ge: "temporaryToNode" }, function() { return this.EE }, function(a) {
  8929. D.l(a, G, dj, "temporaryToNode");
  8930. this.EE = a
  8931. });
  8932. D.defineProperty(dj, { yo: "temporaryToPort" }, function() { return this.FE }, function(a) {
  8933. D.l(a, O, dj, "temporaryToPort");
  8934. this.FE = a
  8935. });
  8936. D.defineProperty(dj, { vc: "originalLink" }, function() { return this.eE }, function(a) {
  8937. null !== a && D.l(a, J, dj, "originalLink");
  8938. this.eE = a
  8939. });
  8940. D.defineProperty(dj, { bh: "originalFromNode" }, function() { return this.cE }, function(a) {
  8941. null !== a && D.l(a, G, dj, "originalFromNode");
  8942. this.cE = a
  8943. });
  8944. D.defineProperty(dj, { dh: "originalFromPort" }, function() { return this.dE }, function(a) {
  8945. null !== a && D.l(a, O, dj, "originalFromPort");
  8946. this.dE = a
  8947. });
  8948. D.defineProperty(dj, { eh: "originalToNode" }, function() { return this.hE }, function(a) {
  8949. null !== a && D.l(a, G, dj, "originalToNode");
  8950. this.hE = a
  8951. });
  8952. D.defineProperty(dj, { fh: "originalToPort" }, function() { return this.iE }, function(a) {
  8953. null !== a && D.l(a, O, dj, "originalToPort");
  8954. this.iE = a
  8955. });
  8956. D.defineProperty(dj, { ce: "isForwards" }, function() { return this.JD }, function(a) {
  8957. D.h(a, "boolean", dj, "isForwards");
  8958. this.JD = a
  8959. });
  8960. D.w(dj, { Xy: "validPortsCache" }, function() { return this.SH });
  8961. D.defineProperty(dj, { Rf: "targetPort" }, function() { return this.yE }, function(a) {
  8962. null !== a && D.l(a, O, dj, "targetPort");
  8963. this.yE = a
  8964. });
  8965. dj.prototype.copyPortProperties = function(a, b, c, d, e) {
  8966. if (null !== a && null !== b && null !== c && null !== d) {
  8967. d.Ea = b.aa.size;
  8968. e ? (d.Hb = b.Hb, d.Hm = b.Hm) : (d.Gb = b.Gb, d.rm = b.rm);
  8969. c.Of = mc;
  8970. var g = D.P();
  8971. c.location = b.fb(mc, g);
  8972. D.A(g);
  8973. d.angle = b.sm();
  8974. null !== this.Ey && this.Ey(a, b, c, d, e)
  8975. }
  8976. };
  8977. dj.prototype.setNoTargetPortProperties = function(a, b, c) {
  8978. null !== b && (b.Ea = Yd, b.Gb = dc, b.Hb = dc);
  8979. null !== a && null !== this.g && (a.location = this.g.U.ha);
  8980. null !== this.Ey && this.Ey(null, null, a, b, c)
  8981. };
  8982. dj.prototype.doMouseDown = function() { this.wa && this.doMouseMove() };
  8983. dj.prototype.doMouseMove = function() {
  8984. if (this.wa) {
  8985. var a = this.g;
  8986. if (null !== a) {
  8987. this.Rf = this.findTargetPort(this.ce);
  8988. if (null !== this.Rf && this.Rf.Y instanceof G) {
  8989. var b = this.Rf.Y;
  8990. this.ce ? this.copyPortProperties(b, this.Rf, this.ge, this.yo, !0) : this.copyPortProperties(b, this.Rf, this.fe, this.xo, !1)
  8991. } else this.ce ? this.setNoTargetPortProperties(this.ge, this.yo, !0) : this.setNoTargetPortProperties(this.fe, this.xo, !1);
  8992. (a.Be || a.Ce) && a.UA(a.U.te)
  8993. }
  8994. }
  8995. };
  8996. dj.prototype.findValidLinkablePort = function(a, b) {
  8997. if (null === a) return null;
  8998. var c = a.Y;
  8999. if (!(c instanceof G)) return null;
  9000. for (; null !== a;) {
  9001. var d = b ? a.nH : a.MF;
  9002. if (!0 === d && (null !== a.yd || a instanceof G) && (b ? this.isValidTo(c, a) : this.isValidFrom(c, a))) return a;
  9003. if (!1 === d) break;
  9004. a = a.R
  9005. }
  9006. return null
  9007. };
  9008. dj.prototype.findTargetPort = function(a) {
  9009. var b = this.g,
  9010. c = b.U.ha,
  9011. d = this.FG;
  9012. 0 >= d && (d = .1);
  9013. for (var e = this, g = b.Pn(c, d, function(b) { return e.findValidLinkablePort(b, a) }, null, !0), d = Infinity, b = null, g = g.j; g.next();) {
  9014. var h = g.value,
  9015. k = h.Y;
  9016. if (k instanceof G) {
  9017. var l = h.fb(mc, D.P()),
  9018. m = c.x - l.x,
  9019. n = c.y - l.y;
  9020. D.A(l);
  9021. l = m * m + n * n;
  9022. l < d && (m = this.Xy.oa(h), null !== m ? m && (b = h, d = l) : a && this.isValidLink(this.bh, this.dh, k, h) || !a && this.isValidLink(k, h, this.eh, this.fh) ? (this.Xy.add(h, !0), b = h, d = l) : this.Xy.add(h, !1))
  9023. }
  9024. }
  9025. return null !== b && (c = b.Y,
  9026. c instanceof G && (null === c.layer || c.layer.eu)) ? b : null
  9027. };
  9028. dj.prototype.isValidFrom = function(a, b) {
  9029. if (null === a || null === b) return this.Cq;
  9030. if (null !== this.g && this.g.eb === this && (null !== a.layer && !a.layer.eu || !0 !== b.MF)) return !1;
  9031. var c = b.cB;
  9032. if (Infinity > c) {
  9033. if (null !== this.vc && a === this.bh && b === this.dh) return !0;
  9034. var d = b.yd;
  9035. null === d && (d = "");
  9036. if (a.Wx(d).count >= c) return !1
  9037. }
  9038. return !0
  9039. };
  9040. dj.prototype.isValidTo = function(a, b) {
  9041. if (null === a || null === b) return this.Cq;
  9042. if (null !== this.g && this.g.eb === this && (null !== a.layer && !a.layer.eu || !0 !== b.nH)) return !1;
  9043. var c = b.EK;
  9044. if (Infinity > c) {
  9045. if (null !== this.vc && a === this.eh && b === this.fh) return !0;
  9046. var d = b.yd;
  9047. null === d && (d = "");
  9048. if (a.Yg(d).count >= c) return !1
  9049. }
  9050. return !0
  9051. };
  9052. dj.prototype.isInSameNode = function(a, b) {
  9053. if (null === a || null === b) return !1;
  9054. if (a === b) return !0;
  9055. var c = a.Y,
  9056. d = b.Y;
  9057. return null !== c && c === d
  9058. };
  9059. dj.prototype.isLinked = function(a, b) {
  9060. if (null === a || null === b) return !1;
  9061. var c = a.Y;
  9062. if (!(c instanceof G)) return !1;
  9063. var d = a.yd;
  9064. null === d && (d = "");
  9065. var e = b.Y;
  9066. if (!(e instanceof G)) return !1;
  9067. var g = b.yd;
  9068. null === g && (g = "");
  9069. for (e = e.Yg(g); e.next();)
  9070. if (g = e.value, g.$ === c && g.hg === d) return !0;
  9071. return !1
  9072. };
  9073. dj.prototype.isValidLink = function(a, b, c, d) {
  9074. if (!this.isValidFrom(a, b) || !this.isValidTo(c, d) || !(null === b || null === d || (b.RI && d.DK || !this.isInSameNode(b, d)) && (b.QI && d.CK || !this.isLinked(b, d))) || null !== this.vc && (null !== a && this.isLabelDependentOnLink(a, this.vc) || null !== c && this.isLabelDependentOnLink(c, this.vc)) || null !== a && null !== c && (null === a.data && null !== c.data || null !== a.data && null === c.data) || !this.isValidCycle(a, c, this.vc)) return !1;
  9075. if (null !== a) { var e = a.sy; if (null !== e && !e(a, b, c, d, this.vc)) return !1 }
  9076. if (null !==
  9077. c && (e = c.sy, null !== e && !e(a, b, c, d, this.vc))) return !1;
  9078. e = this.sy;
  9079. return null !== e ? e(a, b, c, d, this.vc) : !0
  9080. };
  9081. dj.prototype.isLabelDependentOnLink = function(a, b) {
  9082. if (null === a) return !1;
  9083. var c = a.Xb;
  9084. if (null === c) return !1;
  9085. if (c === b) return !0;
  9086. var d = new L(G);
  9087. d.add(a);
  9088. return ej(this, c, b, d)
  9089. };
  9090. function ej(a, b, c, d) {
  9091. if (b === c) return !0;
  9092. var e = b.$;
  9093. if (null !== e && e.Lf && (d.add(e), ej(a, e.Xb, c, d))) return !0;
  9094. b = b.ba;
  9095. return null !== b && b.Lf && (d.add(b), ej(a, b.Xb, c, d)) ? !0 : !1
  9096. }
  9097. dj.prototype.isValidCycle = function(a, b, c) {
  9098. void 0 === c && (c = null);
  9099. if (null === a || null === b) return this.Cq;
  9100. var d = null !== this.g ? this.g.KK : fj;
  9101. if (d !== fj) {
  9102. if (d === gj) { d = c || this.Ef; if (null !== d && !d.jc) return !0; for (d = b.Od; d.next();) { var e = d.value; if (e !== c && e.jc && e.ba === b) return !1 } return !hj(this, a, b, c, !0) }
  9103. if (d === ij) {
  9104. d = c || this.Ef;
  9105. if (null !== d && !d.jc) return !0;
  9106. for (d = a.Od; d.next();)
  9107. if (e = d.value, e !== c && e.jc && e.$ === a) return !1;
  9108. return !hj(this, a, b, c, !0)
  9109. }
  9110. if (d === jj) return a === b ? a = !0 : (d = new L(G), d.add(b), a = kj(this, d, a, b, c)), !a;
  9111. if (d === lj) return !hj(this, a, b, c, !1);
  9112. if (d === mj) return a === b ? a = !0 : (d = new L(G), d.add(b), a = nj(this, d, a, b, c)), !a
  9113. }
  9114. return !0
  9115. };
  9116. function hj(a, b, c, d, e) { if (b === c) return !0; if (null === b || null === c) return !1; for (var g = b.Od; g.next();) { var h = g.value; if (h !== d && (!e || h.jc) && h.ba === b && (h = h.$, h !== b && hj(a, h, c, d, e))) return !0 } return !1 }
  9117. function kj(a, b, c, d, e) {
  9118. if (c === d) return !0;
  9119. if (null === c || null === d || b.contains(c)) return !1;
  9120. b.add(c);
  9121. for (var g = c.Od; g.next();) { var h = g.value; if (h !== e && h.ba === c && (h = h.$, h !== c && kj(a, b, h, d, e))) return !0 }
  9122. return !1
  9123. }
  9124. function nj(a, b, c, d, e) {
  9125. if (c === d) return !0;
  9126. if (null === c || null === d || b.contains(c)) return !1;
  9127. b.add(c);
  9128. for (var g = c.Od; g.next();) {
  9129. var h = g.value;
  9130. if (h !== e) {
  9131. var k = h.$,
  9132. h = h.ba,
  9133. k = k === c ? h : k;
  9134. if (k !== c && nj(a, b, k, d, e)) return !0
  9135. }
  9136. }
  9137. return !1
  9138. }
  9139. D.defineProperty(dj, { sy: "linkValidation" }, function() { return this.Pl }, function(a) {
  9140. null !== a && D.h(a, "function", dj, "linkValidation");
  9141. this.Pl = a
  9142. });
  9143. D.defineProperty(dj, { Ey: "portTargeted" }, function() { return this.kE }, function(a) {
  9144. null !== a && D.h(a, "function", dj, "portTargeted");
  9145. this.kE = a
  9146. });
  9147. function ra() {
  9148. 0 < arguments.length && D.zd(ra);
  9149. dj.call(this);
  9150. this.name = "Linking";
  9151. this.pz = {};
  9152. this.oz = null;
  9153. this.ga = oj;
  9154. this.tE = null
  9155. }
  9156. D.Ta(ra, dj);
  9157. D.ka("LinkingTool", ra);
  9158. var oj;
  9159. ra.Either = oj = D.s(ra, "Either", 0);
  9160. var pj;
  9161. ra.ForwardsOnly = pj = D.s(ra, "ForwardsOnly", 0);
  9162. var qj;
  9163. ra.BackwardsOnly = qj = D.s(ra, "BackwardsOnly", 0);
  9164. D.defineProperty(ra, { aF: "archetypeLinkData" }, function() { return this.pz }, function(a) {
  9165. null !== a && D.l(a, Object, ra, "archetypeLinkData");
  9166. a instanceof O && D.l(a, J, ra, "archetypeLinkData");
  9167. this.pz = a
  9168. });
  9169. D.defineProperty(ra, { $E: "archetypeLabelNodeData" }, function() { return this.oz }, function(a) {
  9170. null !== a && D.l(a, Object, ra, "archetypeLabelNodeData");
  9171. a instanceof O && D.l(a, G, ra, "archetypeLabelNodeData");
  9172. this.oz = a
  9173. });
  9174. D.defineProperty(ra, { direction: "direction" }, function() { return this.ga }, function(a) {
  9175. D.Da(a, ra, ra, "direction");
  9176. this.ga = a
  9177. });
  9178. D.defineProperty(ra, { hH: "startObject" }, function() { return this.tE }, function(a) {
  9179. null !== a && D.l(a, O, ra, "startObject");
  9180. this.tE = a
  9181. });
  9182. ra.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; if (null === a || a.qb || a.Mf || !a.eu) return !1; var b = a.ea; return (b instanceof Y || b instanceof Bg) && a.U.left && (a.eb === this || this.isBeyondDragSize()) ? null !== this.findLinkablePort() : !1 };
  9183. ra.prototype.findLinkablePort = function() {
  9184. var a = this.g;
  9185. if (null === a) return null;
  9186. var b = this.hH;
  9187. null === b && (b = a.Je(a.Pc.ha, null, null));
  9188. if (null === b || !(b.Y instanceof G)) return null;
  9189. a = this.direction;
  9190. if (a === oj || a === pj) { var c = this.findValidLinkablePort(b, !1); if (null !== c) return this.ce = !0, c }
  9191. if (a === oj || a === qj)
  9192. if (c = this.findValidLinkablePort(b, !0), null !== c) return this.ce = !1, c;
  9193. return null
  9194. };
  9195. ra.prototype.doActivate = function() {
  9196. var a = this.g;
  9197. if (null !== a) {
  9198. var b = this.findLinkablePort();
  9199. null !== b && (this.Nb(this.name), a.of = !0, a.sc = "pointer", this.ce ? (null === this.ge || this.ge.location.H() || (this.ge.location = a.U.ha), this.dh = b, b = this.dh.Y, b instanceof G && (this.bh = b), this.copyPortProperties(this.bh, this.dh, this.fe, this.xo, !1)) : (null === this.fe || this.fe.location.H() || (this.fe.location = a.U.ha), this.fh = b, b = this.fh.Y, b instanceof G && (this.eh = b), this.copyPortProperties(this.eh, this.fh, this.ge, this.yo, !0)),
  9200. a.add(this.fe), a.add(this.ge), null !== this.Ef && (null !== this.fe && (this.Ef.$ = this.fe), null !== this.ge && (this.Ef.ba = this.ge), this.Ef.jc = this.isNewTreeLink(), this.Ef.ec(), a.add(this.Ef)), this.wa = !0)
  9201. }
  9202. };
  9203. ra.prototype.doDeactivate = function() {
  9204. this.wa = !1;
  9205. var a = this.g;
  9206. null !== a && (a.remove(this.Ef), a.remove(this.fe), a.remove(this.ge), a.of = !1, a.sc = "", this.kl())
  9207. };
  9208. ra.prototype.doStop = function() {
  9209. dj.prototype.doStop.call(this);
  9210. this.hH = null
  9211. };
  9212. ra.prototype.doMouseUp = function() {
  9213. if (this.wa) {
  9214. var a = this.g;
  9215. if (null === a) return;
  9216. var b = this.Tf = null,
  9217. c = null,
  9218. d = null,
  9219. e = null,
  9220. g = this.Rf = this.findTargetPort(this.ce);
  9221. if (null !== g) {
  9222. var h = g.Y;
  9223. h instanceof G && (this.ce ? (null !== this.bh && (b = this.bh, c = this.dh), d = h, e = g) : (b = h, c = g, null !== this.eh && (d = this.eh, e = this.fh)))
  9224. } else this.ce ? null !== this.bh && this.Cq && (b = this.bh, c = this.dh) : null !== this.eh && this.Cq && (d = this.eh, e = this.fh);
  9225. null !== b || null !== d ? (h = this.insertLink(b, c, d, e), null !== h ? (null === g && (this.ce ? h.jq = a.U.ha : h.iq =
  9226. a.U.ha), a.Jf && a.select(h), this.Tf = this.name, a.Ja("LinkDrawn", h)) : (a.ea.gF(), this.doNoLink(b, c, d, e))) : this.ce ? this.doNoLink(this.bh, this.dh, null, null) : this.doNoLink(null, null, this.eh, this.fh)
  9227. }
  9228. this.stopTool()
  9229. };
  9230. ra.prototype.isNewTreeLink = function() {
  9231. var a = this.aF;
  9232. if (null === a) return !0;
  9233. if (a instanceof J) return a.jc;
  9234. var b = this.g;
  9235. if (null === b) return !0;
  9236. a = b.Bu(a);
  9237. b = rj(b, a);
  9238. return null !== b ? b.jc : !0
  9239. };
  9240. ra.prototype.insertLink = function(a, b, c, d) {
  9241. var e = this.g;
  9242. if (null === e) return null;
  9243. var g = e.ea;
  9244. if (g instanceof Bg) {
  9245. var h = a;
  9246. b = c;
  9247. e.ee || (h = c, b = a);
  9248. if (null !== h && null !== b) return g.Ii(b.data, g.zb(h.data)), b.Qn()
  9249. } else if (g instanceof Y)
  9250. if (h = "", null !== a && (null === b && (b = a), h = b.yd, null === h && (h = "")), b = "", null !== c && (null === d && (d = c), b = d.yd, null === b && (b = "")), d = this.aF, d instanceof J) {
  9251. if (Sh(d), g = d.copy(), null !== g) return g.$ = a, g.hg = h, g.ba = c, g.jh = b, e.add(g), a = this.$E, a instanceof G && (Sh(a), a = a.copy(), null !== a && (a.Xb = g, e.add(a))),
  9252. g
  9253. } else if (null !== d && (d = g.Kx(d), D.Qa(d))) return null !== a && g.YB(d, g.zb(a.data)), g.ZB(d, h), null !== c && g.dC(d, g.zb(c.data)), g.eC(d, b), g.au(d), a = this.$E, null === a || a instanceof G || (a = g.copyNodeData(a), D.Qa(a) && (g.dm(a), a = g.zb(a), void 0 !== a && g.VE(d, a))), g = e.gg(d);
  9254. return null
  9255. };
  9256. ra.prototype.doNoLink = function() {};
  9257. function fi() {
  9258. 0 < arguments.length && D.zd(fi);
  9259. dj.call(this);
  9260. this.name = "Relinking";
  9261. var a = new z;
  9262. a.Kb = "Diamond";
  9263. a.Ea = $d;
  9264. a.fill = "lightblue";
  9265. a.stroke = "dodgerblue";
  9266. a.cursor = "pointer";
  9267. a.We = 0;
  9268. this.vD = a;
  9269. a = new z;
  9270. a.Kb = "Diamond";
  9271. a.Ea = $d;
  9272. a.fill = "lightblue";
  9273. a.stroke = "dodgerblue";
  9274. a.cursor = "pointer";
  9275. a.We = -1;
  9276. this.GE = a;
  9277. this.pc = null;
  9278. this.fE = new C
  9279. }
  9280. D.Ta(fi, dj);
  9281. D.ka("RelinkingTool", fi);
  9282. fi.prototype.updateAdornments = function(a) {
  9283. if (null !== a && a instanceof J) {
  9284. var b = "RelinkFrom",
  9285. c = null;
  9286. if (a.ib && null !== this.g && !this.g.qb) {
  9287. var d = a.to;
  9288. null !== d && a.canRelinkFrom() && a.aa.H() && a.isVisible() && d.aa.H() && d.Sj() && (c = a.nq(b), null === c && (c = this.makeAdornment(d, !1), a.cm(b, c)))
  9289. }
  9290. null === c && a.Xj(b);
  9291. b = "RelinkTo";
  9292. c = null;
  9293. a.ib && null !== this.g && !this.g.qb && (d = a.to, null !== d && a.canRelinkTo() && a.aa.H() && a.isVisible() && d.aa.H() && d.Sj() && (c = a.nq(b), null === c && (c = this.makeAdornment(d, !0), a.cm(b, c))));
  9294. null === c && a.Xj(b)
  9295. }
  9296. };
  9297. fi.prototype.makeAdornment = function(a, b) {
  9298. var c = new da;
  9299. c.type = sj;
  9300. var d = b ? this.BK : this.OI;
  9301. null !== d && c.add(d.copy());
  9302. c.Bb = a;
  9303. return c
  9304. };
  9305. D.defineProperty(fi, { OI: "fromHandleArchetype" }, function() { return this.vD }, function(a) {
  9306. null !== a && D.l(a, O, fi, "fromHandleArchetype");
  9307. this.vD = a
  9308. });
  9309. D.defineProperty(fi, { BK: "toHandleArchetype" }, function() { return this.GE }, function(a) {
  9310. null !== a && D.l(a, O, fi, "toHandleArchetype");
  9311. this.GE = a
  9312. });
  9313. D.w(fi, { handle: "handle" }, function() { return this.pc });
  9314. fi.prototype.canStart = function() {
  9315. if (!this.isEnabled) return !1;
  9316. var a = this.g;
  9317. if (null === a || a.qb || a.Mf || !a.Dn) return !1;
  9318. var b = a.ea;
  9319. if (!(b instanceof Y || b instanceof Bg) || !a.U.left) return !1;
  9320. b = this.findToolHandleAt(a.Pc.ha, "RelinkFrom");
  9321. null === b && (b = this.findToolHandleAt(a.Pc.ha, "RelinkTo"));
  9322. return null !== b
  9323. };
  9324. fi.prototype.doActivate = function() {
  9325. var a = this.g;
  9326. if (null !== a) {
  9327. if (null === this.vc) {
  9328. var b = this.findToolHandleAt(a.Pc.ha, "RelinkFrom");
  9329. null === b && (b = this.findToolHandleAt(a.Pc.ha, "RelinkTo"));
  9330. if (null === b) return;
  9331. var c = b.Y;
  9332. if (!(c instanceof da && c.If instanceof J)) return;
  9333. this.pc = b;
  9334. this.ce = null === c || "RelinkTo" === c.Kd;
  9335. this.vc = c.If
  9336. }
  9337. this.Nb(this.name);
  9338. a.of = !0;
  9339. a.sc = "pointer";
  9340. this.dh = this.vc.oc;
  9341. this.bh = this.vc.$;
  9342. this.fh = this.vc.Gc;
  9343. this.eh = this.vc.ba;
  9344. this.fE.set(this.vc.aa);
  9345. null !== this.vc && 0 < this.vc.ta && (null ===
  9346. this.vc.$ && (null !== this.xo && (this.xo.Ea = Xd), null !== this.fe && (this.fe.location = this.vc.m(0))), null === this.vc.ba && (null !== this.yo && (this.yo.Ea = Xd), null !== this.ge && (this.ge.location = this.vc.m(this.vc.ta - 1))));
  9347. this.copyPortProperties(this.bh, this.dh, this.fe, this.xo, !1);
  9348. this.copyPortProperties(this.eh, this.fh, this.ge, this.yo, !0);
  9349. a.add(this.fe);
  9350. a.add(this.ge);
  9351. null !== this.Ef && (null !== this.fe && (this.Ef.$ = this.fe), null !== this.ge && (this.Ef.ba = this.ge), this.copyLinkProperties(this.vc, this.Ef), this.Ef.ec(), a.add(this.Ef));
  9352. this.wa = !0
  9353. }
  9354. };
  9355. fi.prototype.copyLinkProperties = function(a, b) {
  9356. if (null !== a && null !== b) {
  9357. b.Yp = a.Yp;
  9358. b.QA = a.QA;
  9359. var c = a.jf;
  9360. if (c === tj || c === uj) c = vj;
  9361. b.jf = c;
  9362. b.Nx = a.Nx;
  9363. b.jc = a.jc;
  9364. b.points = a.points;
  9365. b.My = a.My;
  9366. b.Yq = a.Yq;
  9367. b.Gb = a.Gb;
  9368. b.rm = a.rm;
  9369. b.zu = a.zu;
  9370. b.Au = a.Au;
  9371. b.Hb = a.Hb;
  9372. b.Hm = a.Hm;
  9373. b.uv = a.uv;
  9374. b.vv = a.vv
  9375. }
  9376. };
  9377. fi.prototype.doDeactivate = function() {
  9378. this.wa = !1;
  9379. var a = this.g;
  9380. null !== a && (a.remove(this.Ef), a.remove(this.fe), a.remove(this.ge), a.of = !1, a.sc = "", this.kl())
  9381. };
  9382. fi.prototype.doStop = function() {
  9383. dj.prototype.doStop.call(this);
  9384. this.pc = null
  9385. };
  9386. fi.prototype.doMouseUp = function() {
  9387. if (this.wa) {
  9388. var a = this.g;
  9389. if (null === a) return;
  9390. this.Tf = null;
  9391. var b = this.bh,
  9392. c = this.dh,
  9393. d = this.eh,
  9394. e = this.fh,
  9395. g = this.vc;
  9396. this.Rf = this.findTargetPort(this.ce);
  9397. if (null !== this.Rf) {
  9398. var h = this.Rf.Y;
  9399. h instanceof G && (this.ce ? (d = h, e = this.Rf) : (b = h, c = this.Rf))
  9400. } else this.Cq ? this.ce ? e = d = null : c = b = null : g = null;
  9401. null !== g ? (this.reconnectLink(g, this.ce ? d : b, this.ce ? e : c, this.ce), null === this.Rf && (this.ce ? g.jq = a.U.ha : g.iq = a.U.ha, g.ec()), a.Jf && (g.ib = !0), this.Tf = this.name, a.Ja("LinkRelinked", g, this.ce ?
  9402. this.fh : this.dh)) : this.doNoRelink(this.vc, this.ce);
  9403. Oj(this.vc, this.fE)
  9404. }
  9405. this.stopTool()
  9406. };
  9407. fi.prototype.reconnectLink = function(a, b, c, d) {
  9408. if (null === this.g) return !1;
  9409. c = null !== c && null !== c.yd ? c.yd : "";
  9410. d ? (a.ba = b, a.jh = c) : (a.$ = b, a.hg = c);
  9411. return !0
  9412. };
  9413. fi.prototype.doNoRelink = function() {};
  9414. function Zi(a, b, c, d, e) { null !== a.g && (null !== b ? (a.copyPortProperties(b, c, a.fe, a.xo, !1), a.g.add(a.fe)) : a.g.remove(a.fe), null !== d ? (a.copyPortProperties(d, e, a.ge, a.yo, !0), a.g.add(a.ge)) : a.g.remove(a.ge)) }
  9415. function Pj() {
  9416. 0 < arguments.length && D.zd(Pj);
  9417. Zg.call(this);
  9418. this.name = "LinkReshaping";
  9419. var a = new z;
  9420. a.Kb = "Rectangle";
  9421. a.Ea = Zd;
  9422. a.fill = "lightblue";
  9423. a.stroke = "dodgerblue";
  9424. this.Fl = a;
  9425. a = new z;
  9426. a.Kb = "Diamond";
  9427. a.Ea = Zd;
  9428. a.fill = "lightblue";
  9429. a.stroke = "dodgerblue";
  9430. this.TD = a;
  9431. this.lE = 3;
  9432. this.lz = this.pc = null;
  9433. this.Bp = new N;
  9434. this.Ow = null
  9435. }
  9436. D.Ta(Pj, Zg);
  9437. D.ka("LinkReshapingTool", Pj);
  9438. var Qj;
  9439. Pj.None = Qj = D.s(Pj, "None", 0);
  9440. var Rj;
  9441. Pj.Horizontal = Rj = D.s(Pj, "Horizontal", 1);
  9442. var Sj;
  9443. Pj.Vertical = Sj = D.s(Pj, "Vertical", 2);
  9444. var Tj;
  9445. Pj.All = Tj = D.s(Pj, "All", 3);
  9446. Pj.prototype.getReshapingBehavior = Pj.prototype.RF = function(a) { return a && a.kA ? a.kA : Qj };
  9447. Pj.prototype.setReshapingBehavior = Pj.prototype.ov = function(a, b) {
  9448. D.l(a, O, Pj, "setReshapingBehavior:obj");
  9449. D.Da(b, Pj, Pj, "setReshapingBehavior:behavior");
  9450. a.kA = b
  9451. };
  9452. Pj.prototype.updateAdornments = function(a) {
  9453. if (null !== a && a instanceof J) {
  9454. if (a.ib && null !== this.g && !this.g.qb) { var b = a.path; if (null !== b && a.canReshape() && a.aa.H() && a.isVisible() && b.aa.H() && b.Sj()) { var c = a.nq(this.name); if (null === c || c.$D !== a.ta || c.OE !== a.jv) c = this.makeAdornment(b), null !== c && (c.$D = a.ta, c.OE = a.jv, a.cm(this.name, c)); if (null !== c) { c.location = a.position; return } } }
  9455. a.Xj(this.name)
  9456. }
  9457. };
  9458. Pj.prototype.makeAdornment = function(a) {
  9459. var b = a.Y,
  9460. c = b.ta,
  9461. d = b.ic,
  9462. e = null;
  9463. if (null !== b.points && 1 < c) {
  9464. e = new da;
  9465. e.type = sj;
  9466. var c = b.tu,
  9467. g = b.oy,
  9468. h = d ? 1 : 0;
  9469. if (b.jv && b.jf !== Uj)
  9470. for (var k = c + h; k < g - h; k++) {
  9471. var l = this.makeResegmentHandle(a, k);
  9472. null !== l && (l.We = k, l.WB = .5, l.cB = 999, e.add(l))
  9473. }
  9474. for (k = c + 1; k < g; k++)
  9475. if (l = this.makeHandle(a, k), null !== l) {
  9476. l.We = k;
  9477. if (k !== c)
  9478. if (k === c + 1 && d) {
  9479. var h = b.m(c),
  9480. m = b.m(c + 1);
  9481. Q(h.x, m.x) && Q(h.y, m.y) && (m = b.m(c - 1));
  9482. Q(h.x, m.x) ? (this.ov(l, Sj), l.cursor = "n-resize") : Q(h.y, m.y) && (this.ov(l, Rj), l.cursor = "w-resize")
  9483. } else k ===
  9484. g - 1 && d ? (h = b.m(g - 1), m = b.m(g), Q(h.x, m.x) && Q(h.y, m.y) && (h = b.m(g + 1)), Q(h.x, m.x) ? (this.ov(l, Sj), l.cursor = "n-resize") : Q(h.y, m.y) && (this.ov(l, Rj), l.cursor = "w-resize")) : k !== g && (this.ov(l, Tj), l.cursor = "move");
  9485. e.add(l)
  9486. }
  9487. e.Bb = a
  9488. }
  9489. return e
  9490. };
  9491. Pj.prototype.makeHandle = function() { var a = this.Eu; return null === a ? null : a.copy() };
  9492. D.defineProperty(Pj, { Eu: "handleArchetype" }, function() { return this.Fl }, function(a) {
  9493. null !== a && D.l(a, O, Pj, "handleArchetype");
  9494. this.Fl = a
  9495. });
  9496. Pj.prototype.makeResegmentHandle = function() { var a = this.OJ; return null === a ? null : a.copy() };
  9497. D.defineProperty(Pj, { OJ: "midHandleArchetype" }, function() { return this.TD }, function(a) {
  9498. null !== a && D.l(a, O, Pj, "midHandleArchetype");
  9499. this.TD = a
  9500. });
  9501. D.w(Pj, { handle: "handle" }, function() { return this.pc });
  9502. D.w(Pj, { cu: "adornedLink" }, function() { return this.lz });
  9503. Pj.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; return null !== a && !a.qb && a.Bx && a.U.left ? null !== this.findToolHandleAt(a.Pc.ha, this.name) : !1 };
  9504. Pj.prototype.doActivate = function() {
  9505. var a = this.g;
  9506. if (null !== a && (this.pc = this.findToolHandleAt(a.Pc.ha, this.name), null !== this.pc)) {
  9507. var b = this.pc.Y.If;
  9508. if (b instanceof J) {
  9509. this.lz = b;
  9510. a.of = !0;
  9511. this.Nb(this.name);
  9512. if (b.jv && 999 === this.pc.cB) {
  9513. var c = b.points.copy(),
  9514. d = this.pc.fb(mc);
  9515. c.be(this.pc.We + 1, d);
  9516. b.ic && c.be(this.pc.We + 1, d);
  9517. b.points = c;
  9518. b.pe();
  9519. this.pc = this.findToolHandleAt(a.Pc.ha, this.name);
  9520. if (null === this.pc) { this.doDeactivate(); return }
  9521. }
  9522. this.Bp = b.m(this.pc.We);
  9523. this.Ow = b.points.copy();
  9524. this.wa = !0
  9525. }
  9526. }
  9527. };
  9528. Pj.prototype.doDeactivate = function() {
  9529. this.kl();
  9530. this.lz = this.pc = null;
  9531. var a = this.g;
  9532. null !== a && (a.of = !1);
  9533. this.wa = !1
  9534. };
  9535. Pj.prototype.doCancel = function() {
  9536. var a = this.cu;
  9537. null !== a && (a.points = this.Ow);
  9538. this.stopTool()
  9539. };
  9540. Pj.prototype.doMouseMove = function() {
  9541. var a = this.g;
  9542. this.wa && null !== a && (a = this.computeReshape(a.U.ha), this.reshape(a))
  9543. };
  9544. Pj.prototype.doMouseUp = function() {
  9545. var a = this.g;
  9546. if (this.wa && null !== a) {
  9547. var b = this.computeReshape(a.U.ha);
  9548. this.reshape(b);
  9549. b = this.cu;
  9550. if (null !== b && b.jv) {
  9551. var c = this.handle.We,
  9552. d = b.m(c - 1),
  9553. e = b.m(c),
  9554. g = b.m(c + 1);
  9555. if (b.ic) {
  9556. if (c > b.tu + 1 && c < b.oy - 1) {
  9557. var h = b.m(c - 2);
  9558. if (Math.abs(d.x - e.x) < this.Wh && Math.abs(d.y - e.y) < this.Wh && (Vj(this, h, d, e, g, !0) || Vj(this, h, d, e, g, !1))) {
  9559. var k = b.points.copy();
  9560. Vj(this, h, d, e, g, !0) ? (k.ug(c - 2, new N(h.x, (g.y + h.y) / 2)), k.ug(c + 1, new N(g.x, (g.y + h.y) / 2))) : (k.ug(c - 2, new N((g.x + h.x) / 2, h.y)), k.ug(c + 1,
  9561. new N((g.x + h.x) / 2, g.y)));
  9562. k.pd(c);
  9563. k.pd(c - 1);
  9564. b.points = k;
  9565. b.pe()
  9566. } else h = b.m(c + 2), Math.abs(e.x - g.x) < this.Wh && Math.abs(e.y - g.y) < this.Wh && (Vj(this, d, e, g, h, !0) || Vj(this, d, e, g, h, !1)) && (k = b.points.copy(), Vj(this, d, e, g, h, !0) ? (k.ug(c - 1, new N(d.x, (d.y + h.y) / 2)), k.ug(c + 2, new N(h.x, (d.y + h.y) / 2))) : (k.ug(c - 1, new N((d.x + h.x) / 2, d.y)), k.ug(c + 2, new N((d.x + h.x) / 2, h.y))), k.pd(c + 1), k.pd(c), b.points = k, b.pe())
  9567. }
  9568. } else h = D.P(), fb(d.x, d.y, g.x, g.y, e.x, e.y, h) && h.Kf(e) < this.Wh * this.Wh && (k = b.points.copy(), k.pd(c), b.points = k, b.pe()),
  9569. D.A(h)
  9570. }
  9571. a.Qc();
  9572. this.Tf = this.name;
  9573. a.Ja("LinkReshaped", this.cu, this.Ow)
  9574. }
  9575. this.stopTool()
  9576. };
  9577. function Vj(a, b, c, d, e, g) { return g ? Math.abs(b.y - c.y) < a.Wh && Math.abs(c.y - d.y) < a.Wh && Math.abs(d.y - e.y) < a.Wh : Math.abs(b.x - c.x) < a.Wh && Math.abs(c.x - d.x) < a.Wh && Math.abs(d.x - e.x) < a.Wh }
  9578. D.defineProperty(Pj, { Wh: "resegmentingDistance" }, function() { return this.lE }, function(a) {
  9579. D.h(a, "number", Pj, "resegmentingDistance");
  9580. this.lE = a
  9581. });
  9582. Pj.prototype.reshape = function(a) {
  9583. var b = this.cu;
  9584. b.Dm();
  9585. var c = this.handle.We,
  9586. d = this.RF(this.handle);
  9587. if (b.ic)
  9588. if (c === b.tu + 1) c = b.tu + 1, d === Sj ? (b.ia(c, b.m(c - 1).x, a.y), b.ia(c + 1, b.m(c + 2).x, a.y)) : d === Rj && (b.ia(c, a.x, b.m(c - 1).y), b.ia(c + 1, a.x, b.m(c + 2).y));
  9589. else if (c === b.oy - 1) c = b.oy - 1, d === Sj ? (b.ia(c - 1, b.m(c - 2).x, a.y), b.ia(c, b.m(c + 1).x, a.y)) : d === Rj && (b.ia(c - 1, a.x, b.m(c - 2).y), b.ia(c, a.x, b.m(c + 1).y));
  9590. else {
  9591. var d = c,
  9592. e = b.m(d),
  9593. g = b.m(d - 1),
  9594. h = b.m(d + 1);
  9595. Q(g.x, e.x) && Q(e.y, h.y) ? (Q(g.x, b.m(d - 2).x) && !Q(g.y, b.m(d - 2).y) ? (b.B(d, a.x,
  9596. g.y), c++, d++) : b.ia(d - 1, a.x, g.y), Q(h.y, b.m(d + 2).y) && !Q(h.x, b.m(d + 2).x) ? b.B(d + 1, h.x, a.y) : b.ia(d + 1, h.x, a.y)) : Q(g.y, e.y) && Q(e.x, h.x) ? (Q(g.y, b.m(d - 2).y) && !Q(g.x, b.m(d - 2).x) ? (b.B(d, g.x, a.y), c++, d++) : b.ia(d - 1, g.x, a.y), Q(h.x, b.m(d + 2).x) && !Q(h.y, b.m(d + 2).y) ? b.B(d + 1, a.x, h.y) : b.ia(d + 1, a.x, h.y)) : Q(g.x, e.x) && Q(e.x, h.x) ? (Q(g.x, b.m(d - 2).x) && !Q(g.y, b.m(d - 2).y) ? (b.B(d, a.x, g.y), c++, d++) : b.ia(d - 1, a.x, g.y), Q(h.x, b.m(d + 2).x) && !Q(h.y, b.m(d + 2).y) ? b.B(d + 1, a.x, h.y) : b.ia(d + 1, a.x, h.y)) : Q(g.y, e.y) && Q(e.y, h.y) && (Q(g.y, b.m(d -
  9597. 2).y) && !Q(g.x, b.m(d - 2).x) ? (b.B(d, g.x, a.y), c++, d++) : b.ia(d - 1, g.x, a.y), Q(h.y, b.m(d + 2).y) && !Q(h.x, b.m(d + 2).x) ? b.B(d + 1, h.x, a.y) : b.ia(d + 1, h.x, a.y));
  9598. b.ia(c, a.x, a.y)
  9599. } else b.ia(c, a.x, a.y), e = b.$, g = b.oc, null !== e && (d = e.findVisibleNode(), null !== d && d !== e && (e = d, g = e.port)), 1 === c && b.computeSpot(!0, g).de() && (d = g.fb(mc, D.P()), e = b.getLinkPointFromPoint(e, g, d, a, !0, D.P()), b.ia(0, e.x, e.y), D.A(d), D.A(e)), e = b.ba, g = b.Gc, null !== e && (d = e.findVisibleNode(), null !== d && d !== e && (e = d, g = e.port)), c === b.ta - 2 && b.computeSpot(!1, g).de() &&
  9600. (d = g.fb(mc, D.P()), e = b.getLinkPointFromPoint(e, g, d, a, !1, D.P()), b.ia(b.ta - 1, e.x, e.y), D.A(d), D.A(e));
  9601. b.Ej()
  9602. };
  9603. Pj.prototype.computeReshape = function(a) {
  9604. var b = this.cu,
  9605. c = this.handle.We;
  9606. switch (this.RF(this.handle)) {
  9607. case Tj:
  9608. return a;
  9609. case Sj:
  9610. return b = b.m(c), new N(b.x, a.y);
  9611. case Rj:
  9612. return b = b.m(c), new N(a.x, b.y);
  9613. default:
  9614. case Qj:
  9615. return b.m(c)
  9616. }
  9617. };
  9618. D.w(Pj, { qM: "originalPoint" }, function() { return this.Bp });
  9619. D.w(Pj, { rM: "originalPoints" }, function() { return this.Ow });
  9620. function Wj() {
  9621. 0 < arguments.length && D.zd(Wj);
  9622. Zg.call(this);
  9623. this.name = "Resizing";
  9624. this.oi = (new Ca(1, 1)).freeze();
  9625. this.ni = (new Ca(9999, 9999)).freeze();
  9626. this.fk = (new Ca(NaN, NaN)).freeze();
  9627. this.os = !1;
  9628. this.Tc = null;
  9629. var a = new z;
  9630. a.Gh = mc;
  9631. a.Kb = "Rectangle";
  9632. a.Ea = Zd;
  9633. a.fill = "lightblue";
  9634. a.stroke = "dodgerblue";
  9635. a.lb = 1;
  9636. a.cursor = "pointer";
  9637. this.Fl = a;
  9638. this.pc = null;
  9639. this.Bp = new N;
  9640. this.bE = new Ca;
  9641. this.gE = new N;
  9642. this.Oz = new Ca(0, 0);
  9643. this.Nz = new Ca(Infinity, Infinity);
  9644. this.Mz = new Ca(1, 1);
  9645. this.ZD = !0
  9646. }
  9647. D.Ta(Wj, Zg);
  9648. D.ka("ResizingTool", Wj);
  9649. Wj.prototype.updateAdornments = function(a) {
  9650. if (!(null === a || a instanceof J)) {
  9651. if (a.ib && null !== this.g && !this.g.qb) {
  9652. var b = a.RG;
  9653. if (null !== b && a.canResize() && a.aa.H() && a.isVisible() && b.aa.H() && b.Sj()) {
  9654. var c = a.nq(this.name);
  9655. if (null === c || c.Bb !== b) c = this.makeAdornment(b);
  9656. if (null !== c) {
  9657. var d = b.sm();
  9658. c.angle = d;
  9659. var e = b.fb(c.Of, D.P()),
  9660. g = b.Jj();
  9661. c.location = e;
  9662. D.A(e);
  9663. e = c.placeholder;
  9664. if (null !== e) {
  9665. var b = b.Ga,
  9666. h = D.Gm();
  9667. h.n(b.width * g, b.height * g);
  9668. e.Ea = h;
  9669. D.Zk(h)
  9670. }
  9671. this.updateResizeHandles(c, d);
  9672. a.cm(this.name, c);
  9673. return
  9674. }
  9675. }
  9676. }
  9677. a.Xj(this.name)
  9678. }
  9679. };
  9680. Wj.prototype.makeAdornment = function(a) {
  9681. var b = null,
  9682. b = a.Y.QG;
  9683. if (null === b) {
  9684. b = new da;
  9685. b.type = Xj;
  9686. b.Of = mc;
  9687. var c = new Yj;
  9688. c.Ue = !0;
  9689. b.add(c);
  9690. b.add(this.makeHandle(a, ec));
  9691. b.add(this.makeHandle(a, kc));
  9692. b.add(this.makeHandle(a, vc));
  9693. b.add(this.makeHandle(a, tc));
  9694. b.add(this.makeHandle(a, $c));
  9695. b.add(this.makeHandle(a, fd));
  9696. b.add(this.makeHandle(a, gd));
  9697. b.add(this.makeHandle(a, ed))
  9698. } else if (Sh(b), b = b.copy(), null === b) return null;
  9699. b.Bb = a;
  9700. return b
  9701. };
  9702. Wj.prototype.makeHandle = function(a, b) {
  9703. var c = this.Eu;
  9704. if (null === c) return null;
  9705. c = c.copy();
  9706. c.alignment = b;
  9707. return c
  9708. };
  9709. Wj.prototype.updateResizeHandles = function(a, b) {
  9710. if (null !== a)
  9711. if (!a.alignment.ld() && ("pointer" === a.cursor || 0 < a.cursor.indexOf("resize"))) a: {
  9712. var c = a.alignment;c.de() && (c = mc);
  9713. var d = b;
  9714. if (0 >= c.x) d = 0 >= c.y ? d + 225 : 1 <= c.y ? d + 135 : d + 180;
  9715. else if (1 <= c.x) 0 >= c.y ? d += 315 : 1 <= c.y && (d += 45);
  9716. else if (0 >= c.y) d += 270;
  9717. else if (1 <= c.y) d += 90;
  9718. else break a;0 > d ? d += 360 : 360 <= d && (d -= 360);a.cursor = 22.5 > d ? "e-resize" : 67.5 > d ? "se-resize" : 112.5 > d ? "s-resize" : 157.5 > d ? "sw-resize" : 202.5 > d ? "w-resize" : 247.5 > d ? "nw-resize" : 292.5 > d ? "n-resize" : 337.5 > d ?
  9719. "ne-resize" : "e-resize"
  9720. }
  9721. else if (a instanceof x)
  9722. for (c = a.elements; c.next();) this.updateResizeHandles(c.value, b)
  9723. };
  9724. D.defineProperty(Wj, { Eu: "handleArchetype" }, function() { return this.Fl }, function(a) {
  9725. null !== a && D.l(a, O, Wj, "handleArchetype");
  9726. this.Fl = a
  9727. });
  9728. D.w(Wj, { handle: "handle" }, function() { return this.pc });
  9729. D.defineProperty(Wj, { Bb: "adornedObject" }, function() { return this.Tc }, function(a) {
  9730. null !== a && D.l(a, O, Wj, "adornedObject");
  9731. this.Tc = a
  9732. });
  9733. Wj.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; return null !== a && !a.qb && a.fu && a.U.left ? null !== this.findToolHandleAt(a.Pc.ha, this.name) : !1 };
  9734. Wj.prototype.doActivate = function() {
  9735. var a = this.g;
  9736. null !== a && (this.pc = this.findToolHandleAt(a.Pc.ha, this.name), null !== this.pc && (this.Tc = this.pc.Y.Bb, this.Bp.set(this.Bb.fb(this.handle.alignment.DG())), this.gE.set(this.Tc.Y.location), this.bE.set(this.Tc.Ea), this.Mz = this.computeCellSize(), this.Oz = this.computeMinSize(), this.Nz = this.computeMaxSize(), a.of = !0, this.ZD = a.Ra.isEnabled, a.Ra.isEnabled = !1, this.Nb(this.name), this.wa = !0))
  9737. };
  9738. Wj.prototype.doDeactivate = function() {
  9739. var a = this.g;
  9740. null !== a && (this.kl(), this.Tc = this.pc = null, this.wa = a.of = !1, a.Ra.isEnabled = this.ZD)
  9741. };
  9742. Wj.prototype.doCancel = function() {
  9743. null !== this.Bb && (this.Bb.Ea = this.EG, this.Bb.Y.location = this.YJ);
  9744. this.stopTool()
  9745. };
  9746. Wj.prototype.doMouseMove = function() {
  9747. var a = this.g;
  9748. if (this.wa && null !== a) {
  9749. var b = this.Oz,
  9750. c = this.Nz,
  9751. d = this.Mz,
  9752. e = this.Bb.PF(a.U.ha, D.P()),
  9753. g = this.computeReshape(),
  9754. b = this.computeResize(e, this.handle.alignment, b, c, d, g);
  9755. this.resize(b);
  9756. a.lg();
  9757. D.A(e)
  9758. }
  9759. };
  9760. Wj.prototype.doMouseUp = function() {
  9761. var a = this.g;
  9762. if (this.wa && null !== a) {
  9763. var b = this.Oz,
  9764. c = this.Nz,
  9765. d = this.Mz,
  9766. e = this.Bb.PF(a.U.ha, D.P()),
  9767. g = this.computeReshape(),
  9768. b = this.computeResize(e, this.handle.alignment, b, c, d, g);
  9769. this.resize(b);
  9770. D.A(e);
  9771. a.Qc();
  9772. this.Tf = this.name;
  9773. a.Ja("PartResized", this.Bb, this.EG)
  9774. }
  9775. this.stopTool()
  9776. };
  9777. Wj.prototype.resize = function(a) {
  9778. var b = this.g;
  9779. if (null !== b) {
  9780. var c = this.Bb,
  9781. d = c.Y;
  9782. c.Ea = a.size;
  9783. d.kf();
  9784. a = this.Bb.fb(this.handle.alignment.DG());
  9785. d instanceof I ? (c = new K(F), c.add(d), b.moveParts(c, this.Bp.copy().$j(a), !0)) : d.location = d.location.copy().$j(a).add(this.Bp)
  9786. }
  9787. };
  9788. Wj.prototype.computeResize = function(a, b, c, d, e, g) {
  9789. b.de() && (b = mc);
  9790. var h = this.Bb.Ga,
  9791. k = h.x,
  9792. l = h.y,
  9793. m = h.x + h.width,
  9794. n = h.y + h.height,
  9795. p = 1;
  9796. if (!g) {
  9797. var p = h.width,
  9798. q = h.height;
  9799. 0 >= p && (p = 1);
  9800. 0 >= q && (q = 1);
  9801. p = q / p
  9802. }
  9803. q = D.P();
  9804. jb(a.x, a.y, k, l, e.width, e.height, q);
  9805. a = h.copy();
  9806. 0 >= b.x ? 0 >= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = Math.max(n - a.y, c.height), g || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : (a.width =
  9807. a.height / p, a.x = m - a.width))) : 1 <= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (b = a.height / a.width, p < b ? a.height = p * a.width : (a.width = a.height / p, a.x = m - a.width))) : (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = m - a.x, g || (a.height = p * a.width, a.y = l + .5 * (n - l - a.height))) : 1 <= b.x ? 0 >= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height),
  9808. a.height = Math.max(n - a.y, c.height), g || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : a.width = a.height / p)) : 1 <= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (b = a.height / a.width, p < b ? a.height = p * a.width : a.width = a.height / p)) : (a.width = Math.max(Math.min(q.x - k, d.width), c.width), g || (a.height = p * a.width, a.y = l + .5 * (n - l - a.height))) : 0 >= b.y ? (a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = n - a.y, g || (a.width = a.height / p, a.x =
  9809. k + .5 * (m - k - a.width))) : 1 <= b.y && (a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (a.width = a.height / p, a.x = k + .5 * (m - k - a.width)));
  9810. D.A(q);
  9811. return a
  9812. };
  9813. Wj.prototype.computeReshape = function() {
  9814. var a = Zj;
  9815. this.Bb instanceof z && (a = ak(this.Bb));
  9816. return !(a === bk || a === ck || null !== this.g && this.g.U.shift)
  9817. };
  9818. Wj.prototype.computeMinSize = function() {
  9819. var a = this.Bb.ah.copy(),
  9820. b = this.ah;
  9821. !isNaN(b.width) && b.width > a.width && (a.width = b.width);
  9822. !isNaN(b.height) && b.height > a.height && (a.height = b.height);
  9823. return a
  9824. };
  9825. Wj.prototype.computeMaxSize = function() {
  9826. var a = this.Bb.pf.copy(),
  9827. b = this.pf;
  9828. !isNaN(b.width) && b.width < a.width && (a.width = b.width);
  9829. !isNaN(b.height) && b.height < a.height && (a.height = b.height);
  9830. return a
  9831. };
  9832. Wj.prototype.computeCellSize = function() {
  9833. var a = new Ca(NaN, NaN),
  9834. b = this.Bb.Y;
  9835. if (null !== b) { var c = b.gK;!isNaN(c.width) && 0 < c.width && (a.width = c.width);!isNaN(c.height) && 0 < c.height && (a.height = c.height) }
  9836. c = this.bq;
  9837. isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width);
  9838. isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height);
  9839. b = this.g;
  9840. (isNaN(a.width) || isNaN(a.height)) && b && (c = b.nb.Ge, null !== c && c.Lu && (c = c.XF, isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width), isNaN(a.height) && !isNaN(c.height) &&
  9841. 0 < c.height && (a.height = c.height)), b = b.Vn, null !== b && b.visible && this.Lu && (c = b.ay, isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width), isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height)));
  9842. if (isNaN(a.width) || 0 === a.width || Infinity === a.width) a.width = 1;
  9843. if (isNaN(a.height) || 0 === a.height || Infinity === a.height) a.height = 1;
  9844. return a
  9845. };
  9846. D.defineProperty(Wj, { ah: "minSize" }, function() { return this.oi }, function(a) {
  9847. D.l(a, Ca, Wj, "minSize");
  9848. if (!this.oi.O(a)) {
  9849. var b = a.width;
  9850. isNaN(b) && (b = 0);
  9851. a = a.height;
  9852. isNaN(a) && (a = 0);
  9853. this.oi.n(b, a)
  9854. }
  9855. });
  9856. D.defineProperty(Wj, { pf: "maxSize" }, function() { return this.ni }, function(a) {
  9857. D.l(a, Ca, Wj, "maxSize");
  9858. if (!this.ni.O(a)) {
  9859. var b = a.width;
  9860. isNaN(b) && (b = Infinity);
  9861. a = a.height;
  9862. isNaN(a) && (a = Infinity);
  9863. this.ni.n(b, a)
  9864. }
  9865. });
  9866. D.defineProperty(Wj, { bq: "cellSize" }, function() { return this.fk }, function(a) {
  9867. D.l(a, Ca, Wj, "cellSize");
  9868. this.fk.O(a) || this.fk.assign(a)
  9869. });
  9870. D.defineProperty(Wj, { Lu: "isGridSnapEnabled" }, function() { return this.os }, function(a) {
  9871. D.h(a, "boolean", Wj, "isGridSnapEnabled");
  9872. this.os = a
  9873. });
  9874. D.w(Wj, { EG: "originalDesiredSize" }, function() { return this.bE });
  9875. D.w(Wj, { YJ: "originalLocation" }, function() { return this.gE });
  9876. function dk() {
  9877. 0 < arguments.length && D.zd(dk);
  9878. Zg.call(this);
  9879. this.name = "Rotating";
  9880. this.rE = 45;
  9881. this.qE = 2;
  9882. this.Tc = null;
  9883. var a = new z;
  9884. a.Kb = "Ellipse";
  9885. a.Ea = $d;
  9886. a.fill = "lightblue";
  9887. a.stroke = "dodgerblue";
  9888. a.lb = 1;
  9889. a.cursor = "pointer";
  9890. this.Fl = a;
  9891. this.pc = null;
  9892. this.Nw = 0;
  9893. this.mE = new N
  9894. }
  9895. D.Ta(dk, Zg);
  9896. D.ka("RotatingTool", dk);
  9897. dk.prototype.updateAdornments = function(a) {
  9898. if (null !== a) {
  9899. if (a instanceof J) { var b = a.TB; if (b === a || b === a.path || b.Ue) return }
  9900. if (a.ib && null !== this.g && !this.g.qb && (b = a.TB, null !== b && a.canRotate() && a.aa.H() && a.isVisible() && b.aa.H() && b.Sj())) {
  9901. var c = a.nq(this.name);
  9902. if (null === c || c.Bb !== b) c = this.makeAdornment(b);
  9903. if (null !== c) {
  9904. c.angle = b.sm();
  9905. var d = null,
  9906. e = null;
  9907. b === a || b === a.Bf ? (d = a.Bf, e = a.Of) : (d = b, e = mc);
  9908. for (var g = d.Ga, e = D.Fb(g.width * e.x + e.offsetX, g.height * e.y + e.offsetY); null !== d && d !== b;) d.transform.vb(e), d = d.R;
  9909. var d =
  9910. e.y,
  9911. g = Math.max(e.x - b.Ga.width, 0),
  9912. h = D.P();
  9913. c.location = b.fb(new S(1, 0, 50 + g, d), h);
  9914. D.A(h);
  9915. D.A(e);
  9916. a.cm(this.name, c);
  9917. return
  9918. }
  9919. }
  9920. a.Xj(this.name)
  9921. }
  9922. };
  9923. dk.prototype.makeAdornment = function(a) {
  9924. var b = null,
  9925. b = a.Y.iK;
  9926. if (null === b) {
  9927. b = new da;
  9928. b.type = ek;
  9929. b.Of = mc;
  9930. var c = this.Eu;
  9931. null !== c && b.add(c.copy())
  9932. } else if (Sh(b), b = b.copy(), null === b) return null;
  9933. b.Bb = a;
  9934. return b
  9935. };
  9936. D.defineProperty(dk, { Eu: "handleArchetype" }, function() { return this.Fl }, function(a) {
  9937. null !== a && D.l(a, O, dk, "handleArchetype");
  9938. this.Fl = a
  9939. });
  9940. D.w(dk, { handle: "handle" }, function() { return this.pc });
  9941. D.defineProperty(dk, { Bb: "adornedObject" }, function() { return this.Tc }, function(a) {
  9942. null !== a && D.l(a, O, dk, "adornedObject");
  9943. this.Tc = a
  9944. });
  9945. dk.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; return null !== a && !a.qb && a.Cx && a.U.left ? null !== this.findToolHandleAt(a.Pc.ha, this.name) : !1 };
  9946. dk.prototype.doActivate = function() {
  9947. var a = this.g;
  9948. if (null !== a && (this.pc = this.findToolHandleAt(a.Pc.ha, this.name), null !== this.pc)) {
  9949. this.Tc = this.pc.Y.Bb;
  9950. var b = this.Tc.Y,
  9951. c = b.Bf;
  9952. this.mE = this.Tc === b || this.Tc === c ? c.fb(b.Of) : this.Tc.fb(mc);
  9953. this.Nw = this.Tc.angle;
  9954. a.of = !0;
  9955. a.SA = !0;
  9956. this.Nb(this.name);
  9957. this.wa = !0
  9958. }
  9959. };
  9960. dk.prototype.doDeactivate = function() {
  9961. var a = this.g;
  9962. null !== a && (this.kl(), this.Tc = this.pc = null, this.wa = a.of = !1)
  9963. };
  9964. dk.prototype.doCancel = function() {
  9965. var a = this.g;
  9966. null !== a && (a.SA = !1);
  9967. this.rotate(this.Nw);
  9968. this.stopTool()
  9969. };
  9970. dk.prototype.doMouseMove = function() {
  9971. var a = this.g;
  9972. this.wa && null !== a && (a = this.computeRotate(a.U.ha), this.rotate(a))
  9973. };
  9974. dk.prototype.doMouseUp = function() {
  9975. var a = this.g;
  9976. if (this.wa && null !== a) {
  9977. a.SA = !1;
  9978. var b = this.computeRotate(a.U.ha);
  9979. this.rotate(b);
  9980. a.Qc();
  9981. this.Tf = this.name;
  9982. a.Ja("PartRotated", this.Tc, this.Nw)
  9983. }
  9984. this.stopTool()
  9985. };
  9986. dk.prototype.rotate = function(a) {
  9987. v && D.p(a, dk, "rotate:newangle");
  9988. null !== this.Tc && (this.Tc.angle = a)
  9989. };
  9990. dk.prototype.computeRotate = function(a) {
  9991. a = this.mE.Wb(a);
  9992. var b = this.Tc.R;
  9993. null !== b && (a -= b.sm(), 360 <= a ? a -= 360 : 0 > a && (a += 360));
  9994. var b = Math.min(Math.abs(this.vK), 180),
  9995. c = Math.min(Math.abs(this.uK), b / 2);
  9996. (null === this.g || !this.g.U.shift) && 0 < b && 0 < c && (a % b < c ? a = Math.floor(a / b) * b : a % b > b - c && (a = (Math.floor(a / b) + 1) * b));
  9997. 360 <= a ? a -= 360 : 0 > a && (a += 360);
  9998. return a
  9999. };
  10000. D.defineProperty(dk, { vK: "snapAngleMultiple" }, function() { return this.rE }, function(a) {
  10001. D.h(a, "number", dk, "snapAngleMultiple");
  10002. this.rE = a
  10003. });
  10004. D.defineProperty(dk, { uK: "snapAngleEpsilon" }, function() { return this.qE }, function(a) {
  10005. D.h(a, "number", dk, "snapAngleEpsilon");
  10006. this.qE = a
  10007. });
  10008. D.w(dk, { pM: "originalAngle" }, function() { return this.Nw });
  10009. function fk() {
  10010. Zg.call(this);
  10011. 0 < arguments.length && D.zd(fk);
  10012. this.name = "ClickSelecting"
  10013. }
  10014. D.Ta(fk, Zg);
  10015. D.ka("ClickSelectingTool", fk);
  10016. fk.prototype.canStart = function() { return !this.isEnabled || null === this.g || this.isBeyondDragSize() ? !1 : !0 };
  10017. fk.prototype.doMouseUp = function() {
  10018. this.wa && (this.standardMouseSelect(), !this.standardMouseClick() && null !== this.g && this.g.U.Qj && this.g.nb.doToolTip());
  10019. this.stopTool()
  10020. };
  10021. function gk() {
  10022. Zg.call(this);
  10023. 0 < arguments.length && D.zd(gk);
  10024. this.name = "Action";
  10025. this.Eo = null
  10026. }
  10027. D.Ta(gk, Zg);
  10028. D.ka("ActionTool", gk);
  10029. gk.prototype.canStart = function() {
  10030. if (!this.isEnabled) return !1;
  10031. var a = this.g;
  10032. if (null === a) return !1;
  10033. var b = a.U,
  10034. c = a.Je(b.ha, function(a) { for (; null !== a.R && !a.Hu;) a = a.R; return a });
  10035. if (null !== c) {
  10036. if (!c.Hu) return !1;
  10037. this.Eo = c;
  10038. a.Qo = a.Je(b.ha, null, null);
  10039. return !0
  10040. }
  10041. return !1
  10042. };
  10043. gk.prototype.doMouseDown = function() {
  10044. if (this.wa) {
  10045. var a = this.g.U,
  10046. b = this.Eo;
  10047. null !== b && (a.Ne = b, null !== b.RE && b.RE(a, b))
  10048. } else this.canStart() && this.doActivate()
  10049. };
  10050. gk.prototype.doMouseMove = function() {
  10051. if (this.wa) {
  10052. var a = this.g.U,
  10053. b = this.Eo;
  10054. null !== b && (a.Ne = b, null !== b.SE && b.SE(a, b))
  10055. }
  10056. };
  10057. gk.prototype.doMouseUp = function() {
  10058. if (this.wa) {
  10059. var a = this.g,
  10060. b = a.U,
  10061. c = this.Eo;
  10062. if (null === c) return;
  10063. b.Ne = c;
  10064. null !== c.TE && c.TE(b, c);
  10065. this.isBeyondDragSize() || Zh(c, b, a)
  10066. }
  10067. this.stopTool()
  10068. };
  10069. gk.prototype.doCancel = function() {
  10070. var a = this.g;
  10071. if (null !== a) {
  10072. var a = a.U,
  10073. b = this.Eo;
  10074. if (null === b) return;
  10075. a.Ne = b;
  10076. null !== b.QE && b.QE(a, b)
  10077. }
  10078. this.stopTool()
  10079. };
  10080. gk.prototype.doStop = function() { this.Eo = null };
  10081. function ta() {
  10082. Zg.call(this);
  10083. 0 < arguments.length && D.zd(ta);
  10084. this.name = "ClickCreating";
  10085. this.yl = null;
  10086. this.GD = !0;
  10087. this.uD = new N(0, 0)
  10088. }
  10089. D.Ta(ta, Zg);
  10090. D.ka("ClickCreatingTool", ta);
  10091. ta.prototype.canStart = function() { if (!this.isEnabled || null === this.GA) return !1; var a = this.g; if (null === a || a.qb || a.Mf || !a.Zp || !a.U.left || this.isBeyondDragSize()) return !1; if (this.nJ) { if (1 === a.U.Ee && (this.uD = a.U.te.copy()), 2 !== a.U.Ee || this.isBeyondDragSize(this.uD)) return !1 } else if (1 !== a.U.Ee) return !1; return a.eb !== this && null !== a.su(a.U.ha, !0) ? !1 : !0 };
  10092. ta.prototype.doMouseUp = function() {
  10093. var a = this.g;
  10094. this.wa && null !== a && this.insertPart(a.U.ha);
  10095. this.stopTool()
  10096. };
  10097. ta.prototype.insertPart = function(a) {
  10098. var b = this.g;
  10099. if (null === b) return null;
  10100. var c = this.GA;
  10101. if (null === c) return null;
  10102. this.Nb(this.name);
  10103. var d = null;
  10104. c instanceof F ? c.qe() && (Sh(c), d = c.copy(), null !== d && b.add(d)) : null !== c && (c = b.ea.copyNodeData(c), D.Qa(c) && (b.ea.dm(c), d = b.Nh(c)));
  10105. null !== d && (d.location = a, b.Jf && b.select(d));
  10106. b.Qc();
  10107. this.Tf = this.name;
  10108. b.Ja("PartCreated", d);
  10109. this.kl();
  10110. return d
  10111. };
  10112. D.defineProperty(ta, { GA: "archetypeNodeData" }, function() { return this.yl }, function(a) {
  10113. null !== a && D.l(a, Object, ta, "archetypeNodeData");
  10114. this.yl = a
  10115. });
  10116. D.defineProperty(ta, { nJ: "isDoubleClick" }, function() { return this.GD }, function(a) {
  10117. D.h(a, "boolean", ta, "isDoubleClick");
  10118. this.GD = a
  10119. });
  10120. function hk() { this.LE = this.RD = this.Vz = this.qA = null }
  10121. D.ka("HTMLInfo", hk);
  10122. D.defineProperty(hk, { yB: "mainElement" }, function() { return this.RD }, function(a) {
  10123. null !== a && D.l(a, HTMLElement, hk, "mainElement");
  10124. this.RD = a
  10125. });
  10126. D.defineProperty(hk, { show: "show" }, function() { return this.qA }, function(a) { this.qA !== a && (null !== a && D.h(a, "function", hk, "show"), this.qA = a) });
  10127. D.defineProperty(hk, { Wn: "hide" }, function() { return this.Vz }, function(a) { this.Vz !== a && (null !== a && D.h(a, "function", hk, "hide"), this.Vz = a) });
  10128. D.defineProperty(hk, { uC: "valueFunction" }, function() { return this.LE }, function(a) { this.LE = a });
  10129. function ik(a, b, c) {
  10130. this.text = a;
  10131. this.iF = b;
  10132. this.visible = c
  10133. }
  10134. function jk() {
  10135. Zg.call(this);
  10136. 0 < arguments.length && D.zd(jk);
  10137. this.name = "ContextMenu";
  10138. this.ZC = this.yz = this.WC = null;
  10139. this.XD = new N;
  10140. this.Az = this.Sm = null;
  10141. var a = this;
  10142. this.xA = function() { a.stopTool() };
  10143. kk(this)
  10144. }
  10145. D.Ta(jk, Zg);
  10146. D.ka("ContextMenuTool", jk);
  10147. function kk(a) {
  10148. var b = new hk;
  10149. b.show = function(a, b, c) { c.showDefaultContextMenu() };
  10150. b.Wn = function(a, b) { b.hideDefaultContextMenu() };
  10151. a.Sm = b;
  10152. a.xA = function() { a.stopTool() };
  10153. if (!1 === D.pF) {
  10154. var b = D.createElement("div"),
  10155. c = D.createElement("div");
  10156. b.style.cssText = "top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";
  10157. c.style.cssText = "z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";
  10158. var d = D.createElement("style");
  10159. window.document.getElementsByTagName("head")[0].appendChild(d);
  10160. d.sheet.insertRule(".goCXul { list-style: none; }", 0);
  10161. d.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }", 0);
  10162. d.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }", 0);
  10163. b.addEventListener("contextmenu", lk, !1);
  10164. b.addEventListener("selectstart", lk, !1);
  10165. c.addEventListener("contextmenu", lk, !1);
  10166. window.document.body && (window.document.body.appendChild(b), window.document.body.appendChild(c));
  10167. D.ku = b;
  10168. D.ju = c;
  10169. D.pF = !0
  10170. }
  10171. }
  10172. function lk(a) { a.preventDefault(); return !1 }
  10173. jk.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; return null === a || this.isBeyondDragSize() || !a.U.right ? !1 : null !== this.Sm && a.U.Qj || null !== this.findObjectWithContextMenu() ? !0 : !1 };
  10174. jk.prototype.doStart = function() {
  10175. var a = this.g;
  10176. null !== a && this.XD.set(a.Pc.ha)
  10177. };
  10178. jk.prototype.doStop = function() {
  10179. this.hideContextMenu();
  10180. this.Mx = null
  10181. };
  10182. jk.prototype.findObjectWithContextMenu = function(a) {
  10183. void 0 === a && (a = null);
  10184. var b = this.g;
  10185. if (null === b) return null;
  10186. var c = b.U,
  10187. d = null;
  10188. a instanceof E || (d = a instanceof O ? a : b.Je(c.ha, null, function(a) { return !a.layer.Yc }));
  10189. if (null !== d) {
  10190. for (a = d; null !== a;) {
  10191. if (null !== a.contextMenu) return a;
  10192. a = a.R
  10193. }
  10194. if (null !== this.Sm && b.U.Qj) return d.Y
  10195. } else if (null !== b.contextMenu) return b;
  10196. return null
  10197. };
  10198. jk.prototype.doActivate = function() {};
  10199. jk.prototype.doMouseDown = function() {
  10200. Zg.prototype.doMouseDown.call(this);
  10201. null !== this.g && this.g.nb.qf.contains(this) && mk(this)
  10202. };
  10203. jk.prototype.doMouseUp = function() { mk(this) };
  10204. function mk(a) {
  10205. var b = a.g;
  10206. if (null !== b)
  10207. if (a.wa) {
  10208. var c = a.lm;
  10209. if (null !== c) {
  10210. if (!(c instanceof hk)) {
  10211. var d = b.Je(b.U.ha, null, null);
  10212. null !== d && d.xm(c) && a.standardMouseClick(null, null)
  10213. }
  10214. a.stopTool();
  10215. a.canStart() && (b.eb = a, a.doMouseUp())
  10216. }
  10217. } else a.canStart() && (Yh(a, !0), a.wa || a.stopTool())
  10218. }
  10219. function Yh(a, b, c) {
  10220. void 0 === c && (c = null);
  10221. b && a.standardMouseSelect();
  10222. if (!a.standardMouseClick())
  10223. if (a.wa = !0, b = a.Sm, null === c && (c = a.findObjectWithContextMenu()), null !== c) {
  10224. var d = c.contextMenu;
  10225. null !== d ? (a.Mx = c instanceof O ? c : null, a.showContextMenu(d, a.Mx)) : null !== b && a.showContextMenu(b, a.Mx)
  10226. } else null !== b && a.showContextMenu(b, null)
  10227. }
  10228. jk.prototype.doMouseMove = function() { this.wa && null !== this.g && this.g.nb.doMouseMove() };
  10229. jk.prototype.showContextMenu = function(a, b) {
  10230. !v || a instanceof da || a instanceof hk || D.k("showContextMenu:contextMenu must be an Adornment or HTMLInfo.");
  10231. null !== b && D.l(b, O, jk, "showContextMenu:obj");
  10232. var c = this.g;
  10233. if (null !== c) {
  10234. a !== this.lm && this.hideContextMenu();
  10235. if (a instanceof da) {
  10236. a.Nf = "Tool";
  10237. a.il = !1;
  10238. a.scale = 1 / c.scale;
  10239. a.Kd = this.name;
  10240. null !== a.placeholder && (a.placeholder.scale = c.scale);
  10241. c.add(a);
  10242. if (null !== b) {
  10243. var c = null,
  10244. d = b.qm();
  10245. null !== d && (c = d.data);
  10246. a.Bb = b;
  10247. a.data = c
  10248. } else a.data = c.ea;
  10249. a.kf();
  10250. this.positionContextMenu(a,
  10251. b)
  10252. } else a instanceof hk && a.show(b, c, this);
  10253. this.lm = a
  10254. }
  10255. };
  10256. jk.prototype.positionContextMenu = function(a) {
  10257. if (null === a.placeholder) {
  10258. var b = this.g;
  10259. if (null !== b) {
  10260. var c = b.U.ha.copy(),
  10261. d = a.Fa,
  10262. e = b.wb;
  10263. b.U.Qj && (c.x -= d.width);
  10264. c.x + d.width > e.right && (c.x -= d.width + 5);
  10265. c.x < e.x && (c.x = e.x);
  10266. c.y + d.height > e.bottom && (c.y -= d.height + 5);
  10267. c.y < e.y && (c.y = e.y);
  10268. a.position = c
  10269. }
  10270. }
  10271. };
  10272. jk.prototype.hideContextMenu = function() {
  10273. var a = this.g;
  10274. if (null !== a) {
  10275. var b = this.lm;
  10276. null !== b && (b instanceof da ? (a.remove(b), null !== this.yz && this.yz.Xj(b.Kd), b.data = null, b.Bb = null) : b instanceof hk && (null !== b.Wn ? b.Wn(a, this) : null !== b.yB && (b.yB.style.display = "none")), this.lm = null, this.standardMouseOver())
  10277. }
  10278. };
  10279. function nk(a) {
  10280. if (null === a.g) return null;
  10281. a = new K(ik);
  10282. a.add(new ik("Copy", function(a) { a.yb.copySelection() }, function(a) { return a.yb.canCopySelection() }));
  10283. a.add(new ik("Cut", function(a) { a.yb.cutSelection() }, function(a) { return a.yb.canCutSelection() }));
  10284. a.add(new ik("Delete", function(a) { a.yb.deleteSelection() }, function(a) { return a.yb.canDeleteSelection() }));
  10285. a.add(new ik("Paste", function(a) { a.yb.pasteSelection(a.U.ha) }, function(a) { return a.yb.canPasteSelection() }));
  10286. a.add(new ik("Select All", function(a) { a.yb.selectAll() },
  10287. function(a) { return a.yb.canSelectAll() }));
  10288. a.add(new ik("Undo", function(a) { a.yb.undo() }, function(a) { return a.yb.canUndo() }));
  10289. a.add(new ik("Redo", function(a) { a.yb.redo() }, function(a) { return a.yb.canRedo() }));
  10290. a.add(new ik("Scroll To Part", function(a) { a.yb.scrollToPart() }, function(a) { return a.yb.canScrollToPart() }));
  10291. a.add(new ik("Zoom To Fit", function(a) { a.yb.zoomToFit() }, function(a) { return a.yb.canZoomToFit() }));
  10292. a.add(new ik("Reset Zoom", function(a) { a.yb.resetZoom() }, function(a) { return a.yb.canResetZoom() }));
  10293. a.add(new ik("Group Selection", function(a) { a.yb.groupSelection() }, function(a) { return a.yb.canGroupSelection() }));
  10294. a.add(new ik("Ungroup Selection", function(a) { a.yb.ungroupSelection() }, function(a) { return a.yb.canUngroupSelection() }));
  10295. a.add(new ik("Edit Text", function(a) { a.yb.editTextBlock() }, function(a) { return a.yb.canEditTextBlock() }));
  10296. return a
  10297. }
  10298. jk.prototype.showDefaultContextMenu = function() {
  10299. var a = this.g;
  10300. if (null !== a) {
  10301. null === this.Az && (this.Az = nk(this));
  10302. D.ku.innerHTML = "";
  10303. D.ju.addEventListener("click", this.xA, !1);
  10304. var b = this,
  10305. c = D.createElement("ul");
  10306. c.className = "goCXul";
  10307. D.ku.appendChild(c);
  10308. c.innerHTML = "";
  10309. for (var d = this.Az.j; d.next();) {
  10310. var e = d.value,
  10311. g = e.visible;
  10312. if ("function" === typeof e.iF && ("function" !== typeof g || g(a))) {
  10313. g = D.createElement("li");
  10314. g.className = "goCXli";
  10315. var h = D.createElement("a");
  10316. h.className = "goCXa";
  10317. h.href = "#";
  10318. h.DH = e.iF;
  10319. h.addEventListener("click",
  10320. function(c) {
  10321. this.DH(a);
  10322. b.stopTool();
  10323. c.preventDefault();
  10324. return !1
  10325. }, !1);
  10326. h.textContent = e.text;
  10327. g.appendChild(h);
  10328. c.appendChild(g)
  10329. }
  10330. }
  10331. D.ku.style.display = "block";
  10332. D.ju.style.display = "block"
  10333. }
  10334. };
  10335. jk.prototype.hideDefaultContextMenu = function() { null !== this.lm && this.lm === this.Sm && (D.ku.style.display = "none", D.ju.style.display = "none", D.ju.removeEventListener("click", this.xA, !1), this.lm = null) };
  10336. D.defineProperty(jk, { lm: "currentContextMenu" }, function() { return this.WC }, function(a) {
  10337. !v || null === a || a instanceof da || a instanceof hk || D.k("ContextMenuTool.currentContextMenu must be an Adornment or HTMLInfo.");
  10338. this.WC = a;
  10339. this.yz = a instanceof da ? a.If : null
  10340. });
  10341. D.defineProperty(jk, { IL: "defaultTouchContextMenu" }, function() { return this.Sm }, function(a) {
  10342. !v || null === a || a instanceof da || a instanceof hk || D.k("ContextMenuTool.defaultTouchContextMenu must be an Adornment or HTMLInfo.");
  10343. this.Sm = a
  10344. });
  10345. D.defineProperty(jk, { Mx: "currentObject" }, function() { return this.ZC }, function(a) {
  10346. null !== a && D.l(a, O, jk, "currentObject");
  10347. this.ZC = a
  10348. });
  10349. D.w(jk, { kM: "mouseDownPoint" }, function() { return this.XD });
  10350. function ok() {
  10351. Zg.call(this);
  10352. 0 < arguments.length && D.zd(ok);
  10353. this.name = "DragSelecting";
  10354. this.Wo = 175;
  10355. this.MD = !1;
  10356. var a = new F;
  10357. a.Nf = "Tool";
  10358. a.il = !1;
  10359. var b = new z;
  10360. b.name = "SHAPE";
  10361. b.Kb = "Rectangle";
  10362. b.fill = null;
  10363. b.stroke = "magenta";
  10364. a.add(b);
  10365. this.Om = a
  10366. }
  10367. D.Ta(ok, Zg);
  10368. D.ka("DragSelectingTool", ok);
  10369. ok.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; if (null === a || !a.Jf) return !1; var b = a.U; return !b.left || a.eb !== this && (!this.isBeyondDragSize() || b.timestamp - a.Pc.timestamp < this.qF || null !== a.su(b.ha, !0)) ? !1 : !0 };
  10370. ok.prototype.doActivate = function() {
  10371. var a = this.g;
  10372. null !== a && (this.wa = !0, a.of = !0, a.kb = !0, a.add(this.Jh), this.doMouseMove())
  10373. };
  10374. ok.prototype.doDeactivate = function() {
  10375. var a = this.g;
  10376. null !== a && (Di(a), a.remove(this.Jh), a.kb = !1, this.wa = a.of = !1)
  10377. };
  10378. ok.prototype.doMouseMove = function() {
  10379. var a = this.g;
  10380. if (null !== a && this.wa && null !== this.Jh) {
  10381. var b = this.computeBoxBounds(),
  10382. c = this.Jh.Md("SHAPE");
  10383. null === c && (c = this.Jh.Ld());
  10384. c.Ea = b.size;
  10385. this.Jh.position = b.position;
  10386. (a.Be || a.Ce) && a.UA(a.U.te)
  10387. }
  10388. };
  10389. ok.prototype.doMouseUp = function() {
  10390. if (this.wa) {
  10391. var a = this.g;
  10392. a.remove(this.Jh);
  10393. try { a.sc = "wait", this.selectInRect(this.computeBoxBounds()) } finally { a.sc = "" }
  10394. }
  10395. this.stopTool()
  10396. };
  10397. ok.prototype.computeBoxBounds = function() { var a = this.g; return null === a ? new C(0, 0, 0, 0) : new C(a.Pc.ha, a.U.ha) };
  10398. ok.prototype.selectInRect = function(a) {
  10399. var b = this.g;
  10400. if (null !== b) {
  10401. var c = b.U;
  10402. b.Ja("ChangingSelection");
  10403. a = b.Xk(a, null, function(a) { return a instanceof F ? a.canSelect() : !1 }, this.uJ);
  10404. if (D.Qh ? c.Xu : c.control)
  10405. if (c.shift)
  10406. for (a = a.j; a.next();) c = a.value, c.ib && (c.ib = !1);
  10407. else
  10408. for (a = a.j; a.next();) c = a.value, c.ib = !c.ib;
  10409. else {
  10410. if (!c.shift) {
  10411. for (var c = new K(F), d = b.selection.j; d.next();) {
  10412. var e = d.value;
  10413. a.contains(e) || c.add(e)
  10414. }
  10415. for (c = c.j; c.next();) c.value.ib = !1
  10416. }
  10417. for (a = a.j; a.next();) c = a.value, c.ib || (c.ib = !0)
  10418. }
  10419. b.Ja("ChangedSelection")
  10420. }
  10421. };
  10422. D.defineProperty(ok, { qF: "delay" }, function() { return this.Wo }, function(a) {
  10423. D.h(a, "number", ok, "delay");
  10424. this.Wo = a
  10425. });
  10426. D.defineProperty(ok, { uJ: "isPartialInclusion" }, function() { return this.MD }, function(a) {
  10427. D.h(a, "boolean", ok, "isPartialInclusion");
  10428. this.MD = a
  10429. });
  10430. D.defineProperty(ok, { Jh: "box" }, function() { return this.Om }, function(a) {
  10431. null !== a && D.l(a, F, ok, "box");
  10432. this.Om = a
  10433. });
  10434. function pk() {
  10435. Zg.call(this);
  10436. 0 < arguments.length && D.zd(pk);
  10437. this.name = "Panning";
  10438. this.hA = new N;
  10439. this.ek = !1;
  10440. var a = this;
  10441. this.vE = function() {
  10442. window.document.removeEventListener("scroll", a.vE, !1);
  10443. a.stopTool()
  10444. }
  10445. }
  10446. D.Ta(pk, Zg);
  10447. D.ka("PanningTool", pk);
  10448. pk.prototype.canStart = function() { if (!this.isEnabled) return !1; var a = this.g; return null === a || !a.Be && !a.Ce || !a.U.left || a.eb !== this && !this.isBeyondDragSize() ? !1 : !0 };
  10449. pk.prototype.doActivate = function() {
  10450. var a = this.g;
  10451. null !== a && (this.ek ? (a.U.bubbles = !0, window.document.addEventListener("scroll", this.vE, !1)) : (a.sc = "move", a.of = !0, this.hA = a.position.copy()), this.wa = !0)
  10452. };
  10453. pk.prototype.doDeactivate = function() {
  10454. var a = this.g;
  10455. null !== a && (a.sc = "", this.wa = a.of = !1)
  10456. };
  10457. pk.prototype.doCancel = function() {
  10458. var a = this.g;
  10459. null !== a && (a.position = this.hA, a.of = !1);
  10460. this.stopTool()
  10461. };
  10462. pk.prototype.doMouseMove = function() { this.move() };
  10463. pk.prototype.doMouseUp = function() {
  10464. this.move();
  10465. this.stopTool()
  10466. };
  10467. pk.prototype.move = function() {
  10468. var a = this.g;
  10469. if (this.wa && a)
  10470. if (this.ek) a.U.bubbles = !0;
  10471. else {
  10472. var b = a.position,
  10473. c = a.Pc.ha,
  10474. d = a.U.ha,
  10475. e = b.x + c.x - d.x,
  10476. c = b.y + c.y - d.y;
  10477. a.Be || (e = b.x);
  10478. a.Ce || (c = b.y);
  10479. a.position = new N(e, c)
  10480. }
  10481. };
  10482. D.defineProperty(pk, { bubbles: "bubbles" }, function() { return this.ek }, function(a) {
  10483. D.h(a, "boolean", pk, "bubbles");
  10484. this.ek = a
  10485. });
  10486. D.w(pk, { sM: "originalPosition" }, function() { return this.hA });
  10487. function qk() {
  10488. 0 < arguments.length && D.zd(qk);
  10489. Zg.call(this);
  10490. this.name = "TextEditing";
  10491. this.vA = this.Ik = null;
  10492. this.uE = rk;
  10493. this.Zl = null;
  10494. this.Za = sk;
  10495. this.bt = null;
  10496. this.UD = 1;
  10497. this.oE = !0;
  10498. var a = new hk;
  10499. this.aD = null;
  10500. this.iD = a;
  10501. this.Bz = null;
  10502. tk(this, a)
  10503. }
  10504. D.ka("TextEditingTool", qk);
  10505. D.Ta(qk, Zg);
  10506. var uk;
  10507. qk.LostFocus = uk = D.s(qk, "LostFocus", 0);
  10508. var vk;
  10509. qk.MouseDown = vk = D.s(qk, "MouseDown", 1);
  10510. var wk;
  10511. qk.Tab = wk = D.s(qk, "Tab", 2);
  10512. var xk;
  10513. qk.Enter = xk = D.s(qk, "Enter", 3);
  10514. qk.SingleClick = D.s(qk, "SingleClick", 0);
  10515. var rk;
  10516. qk.SingleClickSelected = rk = D.s(qk, "SingleClickSelected", 1);
  10517. var yk;
  10518. qk.DoubleClick = yk = D.s(qk, "DoubleClick", 2);
  10519. var sk;
  10520. qk.StateNone = sk = D.s(qk, "StateNone", 0);
  10521. var zk;
  10522. qk.StateActive = zk = D.s(qk, "StateActive", 1);
  10523. var Ak;
  10524. qk.StateEditing = Ak = D.s(qk, "StateEditing", 2);
  10525. var Bk;
  10526. qk.StateValidating = Bk = D.s(qk, "StateValidating", 3);
  10527. var Ck;
  10528. qk.StateInvalid = Ck = D.s(qk, "StateInvalid", 4);
  10529. var Dk;
  10530. qk.StateValidated = Dk = D.s(qk, "StateValidated", 5);
  10531. function tk(a, b) {
  10532. var c = D.createElement("textarea");
  10533. a.Bz = c;
  10534. c.addEventListener("input", function() {
  10535. if (null !== a.ih) {
  10536. var b = a.LJ(this.value),
  10537. c = this.AK;
  10538. this.style.width = 20 + b.Fa.width * c + "px";
  10539. this.style.height = 10 + b.Fa.height * c + "px";
  10540. this.rows = b.wB
  10541. }
  10542. }, !1);
  10543. c.addEventListener("keydown", function(b) {
  10544. if (null !== a.ih) {
  10545. var c = b.which;
  10546. 13 === c ? (!1 === a.ih.ky && b.preventDefault(), a.acceptText(xk)) : 9 === c ? (a.acceptText(wk), b.preventDefault()) : 27 === c && (a.doCancel(), null !== a.g && a.g.doFocus())
  10547. }
  10548. }, !1);
  10549. c.addEventListener("focus", function() { Ek(a) }, !1);
  10550. c.addEventListener("blur", function() { Fk(a) }, !1);
  10551. b.uC = function() { return c.value };
  10552. b.yB = c;
  10553. b.show = function(a, b, g) {
  10554. if (g.state === Ck) c.style.border = "3px solid red", c.focus();
  10555. else {
  10556. var h = a.fb(mc),
  10557. k = b.position,
  10558. l = b.scale,
  10559. m = a.Jj() * l;
  10560. m < g.yG && (m = g.yG);
  10561. var n = a.Ga.width * m + 6,
  10562. p = a.Ga.height * m + 2,
  10563. q = (h.x - k.x) * l,
  10564. h = (h.y - k.y) * l;
  10565. c.value = a.text;
  10566. b.Hj.style.font = a.font;
  10567. c.style.position = " absolute";
  10568. c.style.zIndex = "100";
  10569. c.style.font = "inherit";
  10570. c.style.fontSize = " " + 100 * m + "%";
  10571. c.style.lineHeight = " normal";
  10572. c.style.width = " " + n + "px";
  10573. c.style.height = " " + p + "px";
  10574. c.style.left = " " + ((q - n / 2 | 0) - 1) + "px";
  10575. c.style.top = " " + ((h - p / 2 | 0) - 1) + "px";
  10576. c.style.text = "align: " + a.textAlign + "";
  10577. c.style.margin = " 0";
  10578. c.style.padding = " 1px";
  10579. c.style.border = " 0";
  10580. c.style.outline = " none";
  10581. c.style.white = "space: pre-wrap";
  10582. c.style.overflow = " hidden";
  10583. c.AK = m;
  10584. b.Hj.appendChild(c);
  10585. c.focus();
  10586. g.Qy && (c.select(), c.setSelectionRange(0, 9999))
  10587. }
  10588. };
  10589. b.Wn = function(a) { a.Hj.removeChild(c) }
  10590. }
  10591. D.defineProperty(qk, { ih: "textBlock" }, function() { return this.vA }, function(a) {
  10592. null !== a && D.l(a, pa, qk, "textBlock");
  10593. this.vA = a
  10594. });
  10595. D.defineProperty(qk, { Fj: "currentTextEditor" }, function() { return this.aD }, function(a) { this.aD = a });
  10596. D.defineProperty(qk, { xI: "defaultTextEditor" }, function() { return this.iD }, function(a) {
  10597. !v || a instanceof HTMLElement || a instanceof hk || D.k("TextEditingTool.defaultTextEditor must be an Element or HTMLInfo.");
  10598. this.iD = a
  10599. });
  10600. D.defineProperty(qk, { iH: "starting" }, function() { return this.uE }, function(a) {
  10601. D.Da(a, qk, qk, "starting");
  10602. this.uE = a
  10603. });
  10604. qk.prototype.canStart = function() {
  10605. if (!this.isEnabled) return !1;
  10606. var a = this.g;
  10607. if (null === a || a.qb || !a.U.left || this.isBeyondDragSize()) return !1;
  10608. var b = a.Je(a.U.ha);
  10609. if (!(null !== b && b instanceof pa && b.XA && b.Y.canEdit())) return !1;
  10610. b = b.Y;
  10611. return null === b || this.iH === rk && !b.ib || this.iH === yk && 2 > a.U.Ee ? !1 : !0
  10612. };
  10613. qk.prototype.doStart = function() { this.wa || null === this.ih || this.doActivate() };
  10614. qk.prototype.doActivate = function() {
  10615. if (!this.wa) {
  10616. var a = this.g;
  10617. if (null !== a) {
  10618. var b = this.ih;
  10619. null === b && (b = a.Je(a.U.ha));
  10620. if (null !== b && b instanceof pa && (this.ih = b, null !== b.Y)) {
  10621. this.wa = !0;
  10622. this.Za = zk;
  10623. var c = this.xI;
  10624. null !== b.mH && (c = b.mH);
  10625. this.Ik = this.ih.copy();
  10626. var d = new C(this.ih.fb(ec), this.ih.fb(vc));
  10627. a.WG(d);
  10628. if (c instanceof hk) c.show(b, a, this);
  10629. else {
  10630. c.style.position = "absolute";
  10631. c.style.zIndex = "100";
  10632. c.textEditingTool = this;
  10633. if ("function" === typeof c.onActivate) c.onActivate();
  10634. a.Hj.appendChild(c);
  10635. "function" === typeof c.focus &&
  10636. c.focus();
  10637. "function" === typeof c.select && this.Qy && (c.select(), c.setSelectionRange(0, 9999))
  10638. }
  10639. this.Fj = c
  10640. }
  10641. }
  10642. }
  10643. };
  10644. qk.prototype.doCancel = function() {
  10645. null !== this.bt && this.Fj instanceof HTMLElement && (this.Fj.style.border = this.bt, this.bt = null);
  10646. this.stopTool()
  10647. };
  10648. qk.prototype.doMouseUp = function() {!this.wa && this.canStart() && this.doActivate() };
  10649. qk.prototype.doMouseDown = function() { this.wa && this.acceptText(vk) };
  10650. qk.prototype.acceptText = function(a) {
  10651. switch (a) {
  10652. case vk:
  10653. if (this.Za === Dk) this.Fj instanceof HTMLElement && this.Fj.focus();
  10654. else if (this.Za === zk || this.Za === Ck || this.Za === Ak) this.Za = Bk, Gk(this);
  10655. break;
  10656. case uk:
  10657. case xk:
  10658. case wk:
  10659. if (xk === a && !0 === this.vA.ky) break;
  10660. if (this.Za === zk || this.Za === Ck || this.Za === Ak) this.Za = Bk, Gk(this)
  10661. }
  10662. };
  10663. function Gk(a) {
  10664. var b = a.ih,
  10665. c = a.g,
  10666. d = a.Fj;
  10667. if (null !== b && null !== d) {
  10668. var e = b.text,
  10669. g = "";
  10670. d instanceof hk ? null !== d.uC && (g = d.uC()) : (g = d.value, g = "function" === typeof g ? g() : g);
  10671. a.isValidText(b, e, g) ? (a.Nb(a.name), a.Za = Dk, a.Tf = a.name, b.text = g, null !== b.lH && b.lH(b, e, g), null !== c && c.Ja("TextEdited", b, e), a.kl(), a.stopTool(), null !== c && c.doFocus()) : (a.Za = Ck, null !== b.ZA && b.ZA(a, e, g), d instanceof hk ? d.show(b, c, a) : (null === a.bt && (a.bt = d.style.border, d.style.border = "3px solid red"), "function" === typeof d.focus && d.focus()))
  10672. }
  10673. }
  10674. qk.prototype.doDeactivate = function() {
  10675. var a = this.g;
  10676. if (null !== a) {
  10677. this.Za = sk;
  10678. this.ih = null;
  10679. if (null !== this.Fj) {
  10680. var b = this.Fj;
  10681. if (b instanceof hk) b.Wn(a, this);
  10682. else {
  10683. if ("function" === typeof b.onDeactivate) b.onDeactivate();
  10684. null !== b && a.Hj.removeChild(b)
  10685. }
  10686. }
  10687. this.wa = !1
  10688. }
  10689. };
  10690. qk.prototype.doFocus = function() {
  10691. v && D.On("TextEditingTool.doFocus", "2.0");
  10692. Ek(this)
  10693. };
  10694. qk.prototype.doBlur = function() {
  10695. v && D.On("TextEditingTool.doBlur", "2.0");
  10696. Fk(this)
  10697. };
  10698. function Ek(a) {
  10699. if (null !== a.Fj && a.state !== sk) {
  10700. var b = a.Bz;
  10701. a.Za === zk && (a.Za = Ak);
  10702. "function" === typeof b.select && a.Qy && (b.select(), b.setSelectionRange(0, 9999))
  10703. }
  10704. }
  10705. function Fk(a) { if (null !== a.Fj && a.state !== sk) { var b = a.Bz; "function" === typeof b.focus && b.focus(); "function" === typeof b.select && a.Qy && (b.select(), b.setSelectionRange(0, 9999)) } }
  10706. qk.prototype.isValidText = function(a, b, c) {
  10707. D.l(a, pa, qk, "isValidText:textblock");
  10708. var d = this.jC;
  10709. if (null !== d && !d(a, b, c)) return !1;
  10710. d = a.jC;
  10711. return null === d || d(a, b, c) ? !0 : !1
  10712. };
  10713. D.defineProperty(qk, { jC: "textValidation" }, function() { return this.Zl }, function(a) {
  10714. null !== a && D.h(a, "function", qk, "textValidation");
  10715. this.Zl = a
  10716. });
  10717. D.defineProperty(qk, { yG: "minimumEditorScale" }, function() { return this.UD }, function(a) {
  10718. null !== a && D.h(a, "number", qk, "minimumEditorScale");
  10719. this.UD = a
  10720. });
  10721. D.defineProperty(qk, { Qy: "selectsTextOnActivate" }, function() { return this.oE }, function(a) {
  10722. null !== a && D.h(a, "boolean", qk, "selectsTextOnActivate");
  10723. this.oE = a
  10724. });
  10725. D.defineProperty(qk, { state: "state" }, function() { return this.Za }, function(a) { this.Za !== a && (D.Da(a, qk, qk, "starting"), this.Za = a) });
  10726. qk.prototype.measureTemporaryTextBlock = qk.prototype.LJ = function(a) {
  10727. var b = this.Ik;
  10728. b.text = a;
  10729. Hk(b, this.ih.rp, Infinity);
  10730. return b
  10731. };
  10732. function Ph() {
  10733. Zg.call(this);
  10734. this.name = "ToolManager";
  10735. this.IH = new K(Zg);
  10736. this.JH = new K(Zg);
  10737. this.KH = new K(Zg);
  10738. this.yD = this.zD = 850;
  10739. this.nD = (new Ca(2, 2)).Oa();
  10740. this.HE = 5E3;
  10741. this.YD = ai;
  10742. this.wD = Ik;
  10743. this.Wv = this.bD = null;
  10744. this.yn = -1
  10745. }
  10746. D.Ta(Ph, Zg);
  10747. D.ka("ToolManager", Ph);
  10748. var ai;
  10749. Ph.WheelScroll = ai = D.s(Ph, "WheelScroll", 0);
  10750. var $h;
  10751. Ph.WheelZoom = $h = D.s(Ph, "WheelZoom", 1);
  10752. Ph.WheelNone = D.s(Ph, "WheelNone", 2);
  10753. var Ik;
  10754. Ph.GestureZoom = Ik = D.s(Ph, "GestureZoom", 3);
  10755. var Vk;
  10756. Ph.GestureCancel = Vk = D.s(Ph, "GestureCancel", 4);
  10757. var Wk;
  10758. Ph.GestureNone = Wk = D.s(Ph, "GestureNone", 5);
  10759. D.defineProperty(Ph, { $u: "mouseWheelBehavior" }, function() { return this.YD }, function(a) {
  10760. D.Da(a, Ph, Ph, "mouseWheelBehavior");
  10761. this.YD = a
  10762. });
  10763. D.defineProperty(Ph, { rq: "gestureBehavior" }, function() { return this.wD }, function(a) {
  10764. D.Da(a, Ph, Ph, "gestureBehavior");
  10765. this.wD = a
  10766. });
  10767. Ph.prototype.initializeStandardTools = function() {
  10768. this.UH = new gk;
  10769. this.HG = new fi;
  10770. this.DJ = new Pj;
  10771. this.TG = new Wj;
  10772. this.kK = new dk;
  10773. this.uG = new ra;
  10774. this.Ge = new Uh;
  10775. this.BI = new ok;
  10776. this.ZJ = new pk;
  10777. this.NA = new jk;
  10778. this.iC = new qk;
  10779. this.gI = new ta;
  10780. this.hI = new fk
  10781. };
  10782. Ph.prototype.updateAdornments = function(a) {
  10783. var b = this.mm;
  10784. if (b instanceof da && this.Wv === a) {
  10785. var c = b.Bb;
  10786. (null !== a ? c.Y === a : null === c) ? this.showToolTip(b, c): this.hideToolTip()
  10787. }
  10788. };
  10789. Ph.prototype.doMouseDown = function() {
  10790. var a = this.g;
  10791. if (null !== a) {
  10792. var b = a.U;
  10793. b.Qj && this.rq === Vk && (b.bubbles = !1);
  10794. if (b.Ou) { this.cancelWaitAfter(); if (this.rq === Wk) { b.bubbles = !0; return } if (this.rq === Vk) return; if (a.eb.canStartMultiTouch()) { a.eb.standardPinchZoomStart(); return } }
  10795. var c = a.na;
  10796. c.IA && 0 !== c.Ki && D.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");
  10797. for (var c = this.qf.length, d = 0; d < c; d++) {
  10798. var e = this.qf.fa(d);
  10799. null === e.g && e.ad(this.g);
  10800. if (e.canStart()) {
  10801. a.doFocus();
  10802. a.eb = e;
  10803. a.eb === e && (e.wa || e.doActivate(), e.doMouseDown());
  10804. return
  10805. }
  10806. }
  10807. 1 === a.U.button && (this.$u === ai ? this.$u = $h : this.$u === $h && (this.$u = ai));
  10808. this.doActivate();
  10809. this.standardWaitAfter(this.aG, b)
  10810. }
  10811. };
  10812. Ph.prototype.doMouseMove = function() {
  10813. var a = this.g;
  10814. if (null !== a) {
  10815. var b = a.U;
  10816. if (b.Ou) { if (this.rq === Wk) { b.bubbles = !0; return } if (this.rq === Vk) return; if (a.eb.canStartMultiTouch()) { a.eb.standardPinchZoomMove(); return } }
  10817. if (this.wa)
  10818. for (var c = this.mg.length, d = 0; d < c; d++) {
  10819. var e = this.mg.fa(d);
  10820. null === e.g && e.ad(this.g);
  10821. if (e.canStart()) {
  10822. a.doFocus();
  10823. a.eb = e;
  10824. a.eb === e && (e.wa || e.doActivate(), e.doMouseMove());
  10825. return
  10826. }
  10827. }
  10828. Xk(this, a);
  10829. a = b.event;
  10830. null === a || "mousemove" !== a.type && "pointermove" !== a.type && a.cancelable || (b.bubbles = !0)
  10831. }
  10832. };
  10833. function Xk(a, b) {
  10834. a.standardMouseOver();
  10835. a.isBeyondDragSize() && a.standardWaitAfter(a.wa ? a.aG : a.fJ, b.U)
  10836. }
  10837. Ph.prototype.doCurrentObjectChanged = function(a, b) {
  10838. var c = this.mm;
  10839. null === c || null !== b && c instanceof da && (b === c || b.xm(c)) || this.hideToolTip()
  10840. };
  10841. Ph.prototype.doWaitAfter = function(a) {
  10842. var b = this.g;
  10843. null !== b && b.Ib && (this.doMouseHover(), this.wa || this.doToolTip(), a.Qj && !b.U.Cc && (a = a.copy(), a.button = 2, a.buttons = 2, b.U = a, b.Sp = !0, b.doMouseUp()))
  10844. };
  10845. Ph.prototype.doMouseHover = function() {
  10846. var a = this.g;
  10847. if (null !== a) {
  10848. var b = a.U;
  10849. null === b.Ne && (b.Ne = a.Je(b.ha, null, null));
  10850. var c = b.Ne;
  10851. if (null !== c)
  10852. for (b.Cc = !1; null !== c;) {
  10853. a = this.wa ? c.DB : c.EB;
  10854. if (null !== a && (a(b, c), b.Cc)) break;
  10855. c = c.R
  10856. } else c = this.wa ? a.DB : a.EB, null !== c && c(b)
  10857. }
  10858. };
  10859. Ph.prototype.doToolTip = function() {
  10860. var a = this.g;
  10861. if (null !== a) {
  10862. var b = a.U;
  10863. null === b.Ne && (b.Ne = a.Je(b.ha, null, null));
  10864. b = b.Ne;
  10865. if (null !== b) {
  10866. if (a = this.mm, !(a instanceof da) || b !== a && !b.xm(a)) {
  10867. for (; null !== b;) {
  10868. a = b.lC;
  10869. if (null !== a) { this.showToolTip(a, b); return }
  10870. b = b.R
  10871. }
  10872. this.hideToolTip()
  10873. }
  10874. } else a = a.lC, null !== a ? this.showToolTip(a, null) : this.hideToolTip()
  10875. }
  10876. };
  10877. Ph.prototype.showToolTip = function(a, b) {
  10878. !v || a instanceof da || a instanceof hk || D.k("showToolTip:tooltip must be an Adornment or HTMLInfo.");
  10879. null !== b && D.l(b, O, Ph, "showToolTip:obj");
  10880. var c = this.g;
  10881. if (null !== c) {
  10882. a !== this.mm && this.hideToolTip();
  10883. if (a instanceof da) {
  10884. a.Nf = "Tool";
  10885. a.il = !1;
  10886. a.scale = 1 / c.scale;
  10887. a.Kd = "ToolTip";
  10888. null !== a.placeholder && (a.placeholder.scale = c.scale);
  10889. c.add(a);
  10890. if (null !== b) {
  10891. var c = null,
  10892. d = b.qm();
  10893. null !== d && (c = d.data);
  10894. a.Bb = b;
  10895. a.data = c
  10896. } else a.data = c.ea;
  10897. a.kf();
  10898. this.positionToolTip(a, b)
  10899. } else a instanceof
  10900. hk && a !== this.mm && a.show(b, c, this);
  10901. this.mm = a; - 1 !== this.yn && (D.clearTimeout(this.yn), this.yn = -1);
  10902. c = this.FK;
  10903. if (0 < c && Infinity !== c) {
  10904. var e = this;
  10905. this.yn = D.setTimeout(function() { e.hideToolTip() }, c)
  10906. }
  10907. }
  10908. };
  10909. Ph.prototype.positionToolTip = function(a) {
  10910. if (null === a.placeholder) {
  10911. var b = this.g;
  10912. if (null !== b) {
  10913. var c = b.U.ha.copy(),
  10914. d = a.Fa,
  10915. e = b.wb;
  10916. b.U.Qj && (c.x -= d.width);
  10917. c.x + d.width > e.right && (c.x -= d.width + 5);
  10918. c.x < e.x && (c.x = e.x);
  10919. c.y = c.y + 20 + d.height > e.bottom ? c.y - (d.height + 5) : c.y + 20;
  10920. c.y < e.y && (c.y = e.y);
  10921. a.position = c
  10922. }
  10923. }
  10924. };
  10925. Ph.prototype.hideToolTip = function() {
  10926. -1 !== this.yn && (D.clearTimeout(this.yn), this.yn = -1);
  10927. var a = this.g;
  10928. if (null !== a) {
  10929. var b = this.mm;
  10930. null !== b && (b instanceof da ? (a.remove(b), null !== this.Wv && this.Wv.Xj(b.Kd), b.data = null, b.Bb = null) : b instanceof hk && null !== b.Wn && b.Wn(a, this), this.mm = null)
  10931. }
  10932. };
  10933. D.defineProperty(Ph, { mm: "currentToolTip" }, function() { return this.bD }, function(a) {
  10934. !v || null === a || a instanceof da || a instanceof hk || D.k("ToolManager.currentToolTip must be an Adornment or HTMLInfo.");
  10935. this.bD = a;
  10936. this.Wv = null !== a && a instanceof da ? a.If : null
  10937. });
  10938. Ph.prototype.doMouseUp = function() {
  10939. this.cancelWaitAfter();
  10940. var a = this.g;
  10941. if (null !== a) {
  10942. if (this.wa)
  10943. for (var b = this.ng.length, c = 0; c < b; c++) {
  10944. var d = this.ng.fa(c);
  10945. null === d.g && d.ad(this.g);
  10946. if (d.canStart()) {
  10947. a.doFocus();
  10948. a.eb = d;
  10949. a.eb === d && (d.wa || d.doActivate(), d.doMouseUp());
  10950. return
  10951. }
  10952. }
  10953. a.doFocus();
  10954. this.doDeactivate()
  10955. }
  10956. };
  10957. Ph.prototype.doMouseWheel = function() { this.standardMouseWheel() };
  10958. Ph.prototype.doKeyDown = function() {
  10959. var a = this.g;
  10960. null !== a && a.yb.doKeyDown()
  10961. };
  10962. Ph.prototype.doKeyUp = function() {
  10963. var a = this.g;
  10964. null !== a && a.yb.doKeyUp()
  10965. };
  10966. Ph.prototype.doCancel = function() {
  10967. null !== di && di.doCancel();
  10968. Zg.prototype.doCancel.call(this)
  10969. };
  10970. Ph.prototype.findTool = function(a) {
  10971. D.h(a, "string", Ph, "findTool:name");
  10972. for (var b = this.qf.length, c = 0; c < b; c++) { var d = this.qf.fa(c); if (d.name === a) return d }
  10973. b = this.mg.length;
  10974. for (c = 0; c < b; c++)
  10975. if (d = this.mg.fa(c), d.name === a) return d;
  10976. b = this.ng.length;
  10977. for (c = 0; c < b; c++)
  10978. if (d = this.ng.fa(c), d.name === a) return d;
  10979. return null
  10980. };
  10981. Ph.prototype.replaceTool = function(a, b) {
  10982. D.h(a, "string", Ph, "replaceTool:name");
  10983. null !== b && (D.l(b, Zg, Ph, "replaceTool:newtool"), b.g && b.g !== this.g && D.k("Cannot share tools between Diagrams: " + b.toString()), b.ad(this.g));
  10984. for (var c = this.qf.length, d = 0; d < c; d++) { var e = this.qf.fa(d); if (e.name === a) return null !== b ? this.qf.ug(d, b) : this.qf.pd(d), e }
  10985. c = this.mg.length;
  10986. for (d = 0; d < c; d++)
  10987. if (e = this.mg.fa(d), e.name === a) return null !== b ? this.mg.ug(d, b) : this.mg.pd(d), e;
  10988. c = this.ng.length;
  10989. for (d = 0; d < c; d++)
  10990. if (e = this.ng.fa(d), e.name ===
  10991. a) return null !== b ? this.ng.ug(d, b) : this.ng.pd(d), e;
  10992. return null
  10993. };
  10994. function Yk(a, b, c, d) {
  10995. D.h(b, "string", Ph, "replaceStandardTool:name");
  10996. D.l(d, K, Ph, "replaceStandardTool:list");
  10997. null !== c && (D.l(c, Zg, Ph, "replaceStandardTool:newtool"), c.g && c.g !== a.g && D.k("Cannot share tools between Diagrams: " + c.toString()), c.name = b, c.ad(a.g));
  10998. a.findTool(b) ? a.replaceTool(b, c) : null !== c && d.add(c)
  10999. }
  11000. D.w(Ph, { qf: "mouseDownTools" }, function() { return this.IH });
  11001. D.w(Ph, { mg: "mouseMoveTools" }, function() { return this.JH });
  11002. D.w(Ph, { ng: "mouseUpTools" }, function() { return this.KH });
  11003. D.defineProperty(Ph, { fJ: "hoverDelay" }, function() { return this.zD }, function(a) {
  11004. D.h(a, "number", Ph, "hoverDelay");
  11005. this.zD = a
  11006. });
  11007. D.defineProperty(Ph, { aG: "holdDelay" }, function() { return this.yD }, function(a) {
  11008. D.h(a, "number", Ph, "holdDelay");
  11009. this.yD = a
  11010. });
  11011. D.defineProperty(Ph, { CI: "dragSize" }, function() { return this.nD }, function(a) {
  11012. D.l(a, Ca, Ph, "dragSize");
  11013. this.nD = a.V()
  11014. });
  11015. D.defineProperty(Ph, { FK: "toolTipDuration" }, function() { return this.HE }, function(a) {
  11016. D.h(a, "number", Ph, "toolTipDuration");
  11017. this.HE = a
  11018. });
  11019. D.defineProperty(Ph, { UH: "actionTool" }, function() { return this.findTool("Action") }, function(a) { Yk(this, "Action", a, this.qf) });
  11020. D.defineProperty(Ph, { HG: "relinkingTool" }, function() { return this.findTool("Relinking") }, function(a) { Yk(this, "Relinking", a, this.qf) });
  11021. D.defineProperty(Ph, { DJ: "linkReshapingTool" }, function() { return this.findTool("LinkReshaping") }, function(a) { Yk(this, "LinkReshaping", a, this.qf) });
  11022. D.defineProperty(Ph, { TG: "resizingTool" }, function() { return this.findTool("Resizing") }, function(a) { Yk(this, "Resizing", a, this.qf) });
  11023. D.defineProperty(Ph, { kK: "rotatingTool" }, function() { return this.findTool("Rotating") }, function(a) { Yk(this, "Rotating", a, this.qf) });
  11024. D.defineProperty(Ph, { uG: "linkingTool" }, function() { return this.findTool("Linking") }, function(a) { Yk(this, "Linking", a, this.mg) });
  11025. D.defineProperty(Ph, { Ge: "draggingTool" }, function() { return this.findTool("Dragging") }, function(a) { Yk(this, "Dragging", a, this.mg) });
  11026. D.defineProperty(Ph, { BI: "dragSelectingTool" }, function() { return this.findTool("DragSelecting") }, function(a) { Yk(this, "DragSelecting", a, this.mg) });
  11027. D.defineProperty(Ph, { ZJ: "panningTool" }, function() { return this.findTool("Panning") }, function(a) { Yk(this, "Panning", a, this.mg) });
  11028. D.defineProperty(Ph, { NA: "contextMenuTool" }, function() { return this.findTool("ContextMenu") }, function(a) { Yk(this, "ContextMenu", a, this.ng) });
  11029. D.defineProperty(Ph, { iC: "textEditingTool" }, function() { return this.findTool("TextEditing") }, function(a) { Yk(this, "TextEditing", a, this.ng) });
  11030. D.defineProperty(Ph, { gI: "clickCreatingTool" }, function() { return this.findTool("ClickCreating") }, function(a) { Yk(this, "ClickCreating", a, this.ng) });
  11031. D.defineProperty(Ph, { hI: "clickSelectingTool" }, function() { return this.findTool("ClickSelecting") }, function(a) { Yk(this, "ClickSelecting", a, this.ng) });
  11032. function kh() {
  11033. this.cD = cl;
  11034. this.Nr = this.Pr = this.ca = null;
  11035. this.Mm = this.Qr = this.Rr = 0;
  11036. this.Ho = this.zc = this.np = this.sk = !1;
  11037. this.Kl = this.rf = !0;
  11038. this.Uv = this.Tv = this.YC = null;
  11039. this.XC = 0;
  11040. this.Vv = null;
  11041. this.Jv = new L("string");
  11042. this.Jz = 600;
  11043. this.LH = new N(0, 0);
  11044. this.MC = this.LC = this.KE = !1;
  11045. this.jn = new oa(O, dl)
  11046. }
  11047. D.ka("AnimationManager", kh);
  11048. kh.prototype.ad = function(a) { this.ca = a };
  11049. function cl(a, b, c, d) { a /= d / 2; return 1 > a ? c / 2 * a * a + b : -c / 2 * (--a * (a - 2) - 1) + b }
  11050. D.w(kh, { lL: "animationReasons" }, function() { return this.Jv });
  11051. kh.prototype.canStart = function() { return !0 };
  11052. kh.prototype.prepareAutomaticAnimation = kh.prototype.po = function(a) { this.rf && (this.Kl || this.ca.Zn) && (this.Jv.add(a), this.canStart(a) && (this.sk && this.Yh(), this.zc = !0)) };
  11053. function el(a) {
  11054. if (a.rf && (a.Jv.clear(), a.zc))
  11055. if (!a.Ho) a.zc = !1;
  11056. else if (0 === a.Mm) {
  11057. var b = +new Date;
  11058. a.Mm = b;
  11059. requestAnimationFrame(function() {
  11060. if (!1 !== a.zc && !a.sk && a.Mm === b) {
  11061. var c = a.ca;
  11062. c.Kj("temporaryPixelRatio") && (c.Hk = 1);
  11063. fl(c);
  11064. a.zc = !1;
  11065. c.Ja("AnimationStarting");
  11066. gl(a, b)
  11067. }
  11068. })
  11069. }
  11070. }
  11071. function hl(a, b, c, d, e, g) {
  11072. if (a.zc && (v && D.l(b, O, kh, "addPropToAnimation:obj"), !("position" === c && d.O(e) || b instanceof F && !b.eG))) {
  11073. var h = a.jn;
  11074. if (h.contains(b)) {
  11075. var h = h.oa(b),
  11076. k = h.start,
  11077. l = h.end;
  11078. void 0 === k[c] && (k[c] = il(d));
  11079. h.Lx && void 0 !== l[c] ? h.pu[c] = il(e) : (g || (h.pu[c] = il(e)), l[c] = il(e));
  11080. g && 0 === c.indexOf("position:") && b instanceof F && (h.pu.location = il(b.location))
  11081. } else k = new ma, l = new ma, k[c] = il(d), l[c] = il(e), d = l, e = k.position, e instanceof N && !e.H() && a.Jv.contains("Expand SubGraph") && e.assign(d.position), k =
  11082. new dl(k, l, g), g && 0 === c.indexOf("position:") && b instanceof F && (k.pu.location = il(b.location)), h.add(b, k);
  11083. a.Ho = !0
  11084. }
  11085. }
  11086. function il(a) { return a instanceof N ? a.copy() : a instanceof Ca ? a.copy() : a }
  11087. function gl(a, b) {
  11088. var c;
  11089. function d() {
  11090. if (!1 !== g.sk && g.Mm === b) {
  11091. var a = +new Date,
  11092. c = a > s ? m : a - r;
  11093. jl(g);
  11094. kl(g, e, q, h, c, m);
  11095. g.Tv && g.Tv();
  11096. bj(e);
  11097. ll(g);
  11098. a > s ? ml(g) : requestAnimationFrame(d)
  11099. }
  11100. }
  11101. void 0 === c && (c = new ma);
  11102. var e = a.ca;
  11103. if (null !== e) {
  11104. var g = a,
  11105. h = c.QL || a.cD,
  11106. k = c.nM || null,
  11107. l = c.oM || null,
  11108. m = c.duration || a.Jz,
  11109. n = a.LH;
  11110. for (c = a.jn.j; c.next();) {
  11111. var p = c.value.start.position;
  11112. p instanceof N && (p.H() || p.assign(n))
  11113. }
  11114. a.YC = h;
  11115. a.Tv = k;
  11116. a.Uv = l;
  11117. a.XC = m;
  11118. a.Vv = a.jn;
  11119. var q = a.Vv;
  11120. for (c = q.j; c.next();) k = c.value.end, k["position:placeholder"] && (l = c.key.findVisibleNode(),
  11121. l instanceof I && null !== l.placeholder && (l = l.placeholder, n = l.fb(ec), n.x += l.padding.left, n.y += l.padding.top, k["position:placeholder"] = n));
  11122. a.sk = !0;
  11123. jl(a);
  11124. kl(a, e, q, h, 0, m);
  11125. bj(a.ca);
  11126. ll(a);
  11127. var r = +new Date,
  11128. s = r + m;
  11129. g.Mm === b && requestAnimationFrame(function() { d() })
  11130. }
  11131. }
  11132. function jl(a) {
  11133. if (!a.np) {
  11134. var b = a.ca;
  11135. a.KE = b.kb;
  11136. a.LC = b.Xe;
  11137. a.MC = b.rv;
  11138. b.kb = !0;
  11139. b.Xe = !0;
  11140. b.rv = !0;
  11141. a.np = !0
  11142. }
  11143. }
  11144. function ll(a) {
  11145. var b = a.ca;
  11146. b.kb = a.KE;
  11147. b.Xe = a.LC;
  11148. b.rv = a.MC;
  11149. a.np = !1
  11150. }
  11151. function kl(a, b, c, d, e, g) {
  11152. for (c = c.j; c.next();) {
  11153. var h = c.key,
  11154. k = c.value,
  11155. l = k.start,
  11156. k = k.end,
  11157. m;
  11158. for (m in k)
  11159. if (("position" !== m || !k["position:placeholder"] && !k["position:node"]) && void 0 !== nl[m]) nl[m](h, l[m], k[m], d, e, g)
  11160. }
  11161. d = b.qB;
  11162. b.qB = !0;
  11163. m = a.cD;
  11164. 0 !== a.Rr && 0 !== a.Qr && (c = a.Rr, b.Db = m(e, c, a.Qr - c, g));
  11165. null !== a.Pr && null !== a.Nr && (c = a.Pr, a = a.Nr, b.sb = new N(m(e, c.x, a.x - c.x, g), m(e, c.y, a.y - c.y, g)));
  11166. b.qB = d
  11167. }
  11168. kh.prototype.stopAnimation = kh.prototype.Yh = function() {
  11169. !0 === this.zc && (this.zc = !1, this.Mm = 0, this.Ho && this.ca.Ve());
  11170. this.sk && this.rf && ml(this)
  11171. };
  11172. function ml(a) {
  11173. a.sk = !1;
  11174. a.Ho = !1;
  11175. jl(a);
  11176. for (var b = a.ca, c = a.YC, d = a.XC, e = a.Vv.j; e.next();) {
  11177. var g = e.key,
  11178. h = e.value,
  11179. k = h.start,
  11180. l = h.end,
  11181. m = h.pu,
  11182. n;
  11183. for (n in l)
  11184. if (void 0 !== nl[n]) {
  11185. var p = n;
  11186. !h.Lx || "position:node" !== p && "position:placeholder" !== p || (p = "position");
  11187. nl[p](g, k[n], void 0 !== m[n] ? m[n] : h.Lx ? k[n] : l[n], c, d, d)
  11188. }
  11189. h.Lx && void 0 !== m.location && g instanceof F && (g.location = m.location);
  11190. h.Hy && g instanceof F && g.Pd(!1)
  11191. }
  11192. for (c = a.ca.links; c.next();) d = c.value, null !== d.Hp && (d.points = d.Hp, d.Hp = null);
  11193. b.ty.clear();
  11194. b.Hk = null;
  11195. b.Qc();
  11196. b.ra();
  11197. b.lg();
  11198. ol(b);
  11199. ll(a);
  11200. a.Uv && a.Uv();
  11201. a.Mm = 0;
  11202. a.Vv = null;
  11203. a.Uv = null;
  11204. a.Tv = null;
  11205. a.Pr = null;
  11206. a.Nr = null;
  11207. a.Rr = 0;
  11208. a.Qr = 0;
  11209. a.jn = new oa(O, dl);
  11210. b.Ja("AnimationFinished");
  11211. b.Ve()
  11212. }
  11213. function pl(a, b, c) {
  11214. var d = b.aa,
  11215. e = c.aa,
  11216. g = null;
  11217. c instanceof I && (g = c.placeholder);
  11218. null !== g ? (d = g.fb(ec), d.x += g.padding.left, d.y += g.padding.top, hl(a, b, "position", d, b.position, !1)) : hl(a, b, "position", new N(e.x + e.width / 2 - d.width / 2, e.y + e.height / 2 - d.height / 2), b.position, !1);
  11219. hl(a, b, "scale", .01, b.scale, !1);
  11220. if (b instanceof I)
  11221. for (b = b.uc; b.next();) g = b.value, g instanceof G && pl(a, g, c)
  11222. }
  11223. function ql(a, b, c) {
  11224. if (b.isVisible()) {
  11225. var d = null;
  11226. c instanceof I && (d = c.placeholder);
  11227. null !== d ? hl(a, b, "position:placeholder", b.position, d, !0) : hl(a, b, "position:node", b.position, c, !0);
  11228. hl(a, b, "scale", b.scale, .01, !0);
  11229. a.zc && (d = a.jn, d.contains(b) && (d.oa(b).Hy = !0));
  11230. if (b instanceof I)
  11231. for (b = b.uc; b.next();) d = b.value, d instanceof G && ql(a, d, c)
  11232. }
  11233. }
  11234. function rl(a, b, c) { a.zc && (null === a.Pr && b.H() && null === a.Nr && (a.Pr = b.copy()), a.Nr = c.copy(), a.Ho = !0) }
  11235. function sl(a, b, c) { a.zc && a.ca.Zn && (0 === a.Rr && 0 === a.Qr && (a.Rr = b), a.Qr = c, a.Ho = !0) }
  11236. D.defineProperty(kh, { isEnabled: "isEnabled" }, function() { return this.rf }, function(a) {
  11237. D.h(a, "boolean", kh, "isEnabled");
  11238. this.rf = a
  11239. });
  11240. D.defineProperty(kh, { duration: "duration" }, function() { return this.Jz }, function(a) {
  11241. D.h(a, "number", kh, "duration");
  11242. 1 > a && D.ua(a, ">= 1", kh, "duration");
  11243. this.Jz = a
  11244. });
  11245. D.w(kh, { nf: "isAnimating" }, function() { return this.sk });
  11246. D.w(kh, { vJ: "isTicking" }, function() { return this.np });
  11247. D.defineProperty(kh, { kG: "isInitial" }, function() { return this.Kl }, function(a) {
  11248. D.h(a, "boolean", kh, "isInitial");
  11249. this.Kl = a
  11250. });
  11251. function dl(a, b, c) {
  11252. this.start = a;
  11253. this.end = b;
  11254. this.pu = new ma;
  11255. this.Lx = c;
  11256. this.Hy = !1
  11257. }
  11258. var nl = {
  11259. opacity: function(a, b, c, d, e, g) { a.opacity = d(e, b, c - b, g) },
  11260. position: function(a, b, c, d, e, g) { e !== g ? a.Uy(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) : a.position = new N(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) },
  11261. "position:node": function(a, b, c, d, e, g) {
  11262. var h = a.aa,
  11263. k = c.aa;
  11264. c = k.x + k.width / 2 - h.width / 2;
  11265. h = k.y + k.height / 2 - h.height / 2;
  11266. e !== g ? a.Uy(d(e, b.x, c - b.x, g), d(e, b.y, h - b.y, g)) : a.position = new N(d(e, b.x, c - b.x, g), d(e, b.y, h - b.y, g))
  11267. },
  11268. "position:placeholder": function(a, b, c, d, e, g) {
  11269. e !== g ? a.Uy(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) :
  11270. a.position = new N(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g))
  11271. },
  11272. scale: function(a, b, c, d, e, g) { a.scale = d(e, b, c - b, g) },
  11273. visible: function(a, b, c, d, e, g) { a.visible = e !== g ? b : c }
  11274. };
  11275. function Hg() {
  11276. 0 < arguments.length && D.zd(Hg);
  11277. D.xc(this);
  11278. this.ca = null;
  11279. this.rb = new K(F);
  11280. this.$b = "";
  11281. this.Lc = 1;
  11282. this.Zz = !1;
  11283. this.Ul = this.BA = this.ul = this.tl = this.sl = this.rl = this.pl = this.ql = this.ol = this.wl = this.nl = this.vl = this.ml = this.ll = !0;
  11284. this.Wz = !1;
  11285. this.Pw = []
  11286. }
  11287. D.ka("Layer", Hg);
  11288. Hg.prototype.ad = function(a) { this.ca = a };
  11289. Hg.prototype.toString = function(a) {
  11290. void 0 === a && (a = 0);
  11291. var b = 'Layer "' + this.name + '"';
  11292. if (0 >= a) return b;
  11293. for (var c = 0, d = 0, e = 0, g = 0, h = 0, k = this.rb.j; k.next();) {
  11294. var l = k.value;
  11295. l instanceof I ? e++ : l instanceof G ? d++ : l instanceof J ? g++ : l instanceof da ? h++ : c++
  11296. }
  11297. k = "";
  11298. 0 < c && (k += c + " Parts ");
  11299. 0 < d && (k += d + " Nodes ");
  11300. 0 < e && (k += e + " Groups ");
  11301. 0 < g && (k += g + " Links ");
  11302. 0 < h && (k += h + " Adornments ");
  11303. if (1 < a)
  11304. for (a = this.rb.j; a.next();) c = a.value, k += "\n " + c.toString(), d = c.data, null !== d && D.Nd(d) && (k += " #" + D.Nd(d)), c instanceof G ? k += " " +
  11305. ia(d) : c instanceof J && (k += " " + ia(c.$) + " " + ia(c.ba));
  11306. return b + " " + this.rb.count + ": " + k
  11307. };
  11308. Hg.prototype.findObjectAt = Hg.prototype.Je = function(a, b, c) {
  11309. void 0 === b && (b = null);
  11310. void 0 === c && (c = null);
  11311. if (!1 === this.Ul) return null;
  11312. v && !a.H() && D.k("findObjectAt: Point must have a real value, not: " + a.toString());
  11313. var d = !1;
  11314. null !== this.g && this.g.wb.Pa(a) && (d = !0);
  11315. for (var e = D.P(), g = this.rb.o, h = g.length; h--;) { var k = g[h]; if ((!0 !== d || !1 !== tl(k)) && k.isVisible() && (e.assign(a), kb(e, k.Hh), k = k.Je(e, b, c), null !== k && (null !== b && (k = b(k)), null !== k && (null === c || c(k))))) return D.A(e), k }
  11316. D.A(e);
  11317. return null
  11318. };
  11319. Hg.prototype.findObjectsAt = Hg.prototype.ru = function(a, b, c, d) {
  11320. void 0 === b && (b = null);
  11321. void 0 === c && (c = null);
  11322. d instanceof K || d instanceof L || (d = new L(O));
  11323. if (!1 === this.Ul) return d;
  11324. v && !a.H() && D.k("findObjectsAt: Point must have a real value, not: " + a.toString());
  11325. var e = !1;
  11326. null !== this.g && this.g.wb.Pa(a) && (e = !0);
  11327. for (var g = D.P(), h = this.rb.o, k = h.length; k--;) {
  11328. var l = h[k];
  11329. if ((!0 !== e || !1 !== tl(l)) && l.isVisible()) {
  11330. g.assign(a);
  11331. kb(g, l.Hh);
  11332. var m = l;
  11333. l.ru(g, b, c, d) && (null !== b && (m = b(m)), null === m || null !== c && !c(m) || (d instanceof L && d.add(m), d instanceof K && d.add(m)))
  11334. }
  11335. }
  11336. D.A(g);
  11337. return d
  11338. };
  11339. Hg.prototype.findObjectsIn = Hg.prototype.Xk = function(a, b, c, d, e) {
  11340. void 0 === b && (b = null);
  11341. void 0 === c && (c = null);
  11342. void 0 === d && (d = !1);
  11343. e instanceof K || e instanceof L || (e = new L(O));
  11344. if (!1 === this.Ul) return e;
  11345. v && !a.H() && D.k("findObjectsIn: Rect must have a real value, not: " + a.toString());
  11346. var g = !1;
  11347. null !== this.g && this.g.wb.Sk(a) && (g = !0);
  11348. for (var h = this.rb.o, k = h.length; k--;) {
  11349. var l = h[k];
  11350. if ((!0 !== g || !1 !== tl(l)) && l.isVisible()) {
  11351. var m = l;
  11352. l.Xk(a, b, c, d, e) && (null !== b && (m = b(m)), null === m || null !== c && !c(m) || (e instanceof L && e.add(m),
  11353. e instanceof K && e.add(m)))
  11354. }
  11355. }
  11356. return e
  11357. };
  11358. Hg.prototype.$A = function(a, b, c, d, e, g, h) {
  11359. if (!1 === this.Ul) return e;
  11360. for (var k = this.rb.o, l = k.length; l--;) {
  11361. var m = k[l];
  11362. if ((!0 !== h || !1 !== tl(m)) && g(m) && m.isVisible()) {
  11363. var n = m;
  11364. m.Xk(a, b, c, d, e) && (null !== b && (n = b(n)), null === n || null !== c && !c(n) || (e instanceof L && e.add(n), e instanceof K && e.add(n)))
  11365. }
  11366. }
  11367. return e
  11368. };
  11369. Hg.prototype.findObjectsNear = Hg.prototype.Pn = function(a, b, c, d, e, g) {
  11370. void 0 === c && (c = null);
  11371. void 0 === d && (d = null);
  11372. void 0 === e && (e = !0);
  11373. if (!1 !== e && !0 !== e) {
  11374. if (e instanceof K || e instanceof L) g = e;
  11375. e = !0
  11376. }
  11377. g instanceof K || g instanceof L || (g = new L(O));
  11378. if (!1 === this.Ul) return g;
  11379. v && !a.H() && D.k("findObjectsNear: Point must have a real value, not: " + a.toString());
  11380. var h = !1;
  11381. null !== this.g && this.g.wb.Pa(a) && (h = !0);
  11382. for (var k = D.P(), l = D.P(), m = this.rb.o, n = m.length; n--;) {
  11383. var p = m[n];
  11384. if ((!0 !== h || !1 !== tl(p)) && p.isVisible()) {
  11385. k.assign(a);
  11386. kb(k, p.Hh);
  11387. l.n(a.x + b, a.y);
  11388. kb(l, p.Hh);
  11389. var q = p;
  11390. p.Pn(k, l, c, d, e, g) && (null !== c && (q = c(q)), null === q || null !== d && !d(q) || (g instanceof L && g.add(q), g instanceof K && g.add(q)))
  11391. }
  11392. }
  11393. D.A(k);
  11394. D.A(l);
  11395. return g
  11396. };
  11397. f = Hg.prototype;
  11398. f.Pf = function(a, b) {
  11399. if (this.visible) {
  11400. var c;
  11401. c = void 0 === b ? a.wb : b;
  11402. for (var d = this.rb.o, e = d.length, g = 0; g < e; g++) {
  11403. var h = d[g];
  11404. h.QD = g;
  11405. if (!(h instanceof J && !1 === h.Uf)) {
  11406. if (h instanceof da) { var k = h; if (null !== k.If) continue }
  11407. if (Ob(h.aa, c))
  11408. for (h.Pf(!0), ul(h), h = h.zx; h.next();) k = h.value, Hk(k, Infinity, Infinity), k.rc(), k.Pf(!0);
  11409. else h.Pf(!1), null !== h.zx && 0 < h.zx.count && ul(h)
  11410. }
  11411. }
  11412. }
  11413. };
  11414. f.He = function(a, b, c) {
  11415. if (this.visible && 0 !== this.Lc && (void 0 === c && (c = !0), c || !this.Yc)) {
  11416. c = this.rb.o;
  11417. var d = c.length;
  11418. if (0 !== d) {
  11419. 1 !== this.Lc && (a.globalAlpha = this.Lc);
  11420. var e = this.Pw;
  11421. e.length = 0;
  11422. for (var g = b.scale, h = 0; h < d; h++) {
  11423. var k = c[h];
  11424. if (tl(k)) {
  11425. if (k instanceof J) {
  11426. var l = k;
  11427. l.ic && e.push(l);
  11428. if (!1 === l.Uf) continue
  11429. }
  11430. l = k.aa;
  11431. 1 < l.width * g || 1 < l.height * g ? k.He(a, b) : vl(k, a)
  11432. }
  11433. }
  11434. a.globalAlpha = 1
  11435. }
  11436. }
  11437. };
  11438. function wl(a, b, c, d) {
  11439. if (a.visible && 0 !== a.Lc) {
  11440. 1 !== a.Lc && (b.globalAlpha = a.Lc);
  11441. var e = a.Pw;
  11442. e.length = 0;
  11443. var g = c.scale;
  11444. a = a.rb.o;
  11445. for (var h = a.length, k = d.length, l = 0; l < h; l++) {
  11446. var m = a[l];
  11447. if (tl(m)) {
  11448. if (m instanceof J) {
  11449. var n = m;
  11450. n.ic && e.push(n);
  11451. if (!1 === n.Uf) continue
  11452. }
  11453. var n = xl(m, m.aa),
  11454. p;
  11455. a: {
  11456. p = n;
  11457. for (var q = d, r = k, s = 2 / g, u = 4 / g, t = 0; t < r; t++) { var y = q[t]; if (0 !== y.width && 0 !== y.height && p.cG(y.x - s, y.y - s, y.width + u, y.height + u)) { p = !0; break a } }
  11458. p = !1
  11459. }
  11460. p && (1 < n.width * g || 1 < n.height * g ? m.He(b, c) : vl(m, b))
  11461. }
  11462. }
  11463. b.globalAlpha = 1
  11464. }
  11465. }
  11466. f.i = function(a, b, c, d, e) {
  11467. var g = this.g;
  11468. null !== g && g.od(fg, a, this, b, c, d, e)
  11469. };
  11470. f.uq = function(a, b, c) {
  11471. var d = this.rb;
  11472. b.xw = this;
  11473. if (a >= d.count) a = d.count;
  11474. else if (d.fa(a) === b) return -1;
  11475. d.be(a, b);
  11476. b.Fu(c);
  11477. d = this.g;
  11478. null !== d && (c ? d.ra() : d.uq(b));
  11479. yl(this, a, b);
  11480. return a
  11481. };
  11482. f.yf = function(a, b, c) {
  11483. if (!c && b.layer !== this && null !== b.layer) return b.layer.yf(a, b, c);
  11484. var d = this.rb;
  11485. if (0 > a || a >= d.length) { if (a = d.indexOf(b), 0 > a) return -1 } else if (d.fa(a) !== b && (a = d.indexOf(b), 0 > a)) return -1;
  11486. b.Gu(c);
  11487. d.pd(a);
  11488. d = this.g;
  11489. null !== d && (c ? d.ra() : d.yf(b));
  11490. b.xw = null;
  11491. return a
  11492. };
  11493. function yl(a, b, c) {
  11494. b = zl(a, b, c);
  11495. if (c instanceof I && null !== c && isNaN(c.Co)) {
  11496. if (0 !== c.uc.count) { for (var d = -1, e = a.rb.o, g = e.length, h = 0; h < g; h++) { var k = e[h]; if (k === c && (b = h, 0 <= d)) break; if (0 > d && k.Ka === c && (d = h, 0 <= b)) break }!(0 > d) && d < b && (e = a.rb, e.pd(b), e.be(d, c)) }
  11497. c = c.Ka;
  11498. null !== c && yl(a, -1, c)
  11499. }
  11500. }
  11501. function zl(a, b, c) {
  11502. var d = c.Co;
  11503. if (isNaN(d)) return b;
  11504. a = a.rb;
  11505. var e = a.count;
  11506. if (1 >= e) return b;
  11507. 0 > b && (b = a.indexOf(c));
  11508. if (0 > b) return -1;
  11509. for (var g = b - 1, h = NaN; 0 <= g;) {
  11510. h = a.fa(g).Co;
  11511. if (!isNaN(h)) break;
  11512. g--
  11513. }
  11514. for (var k = b + 1, l = NaN; k < e;) {
  11515. l = a.fa(k).Co;
  11516. if (!isNaN(l)) break;
  11517. k++
  11518. }
  11519. if (!isNaN(h) && h > d)
  11520. for (;;) {
  11521. if (-1 === g || h <= d) {
  11522. g++;
  11523. if (g === b) break;
  11524. a.pd(b);
  11525. a.be(g, c);
  11526. return g
  11527. }
  11528. for (h = NaN; 0 <= --g && (h = a.fa(g).Co, isNaN(h)););
  11529. } else if (!isNaN(l) && l < d)
  11530. for (;;) {
  11531. if (k === e || l >= d) {
  11532. k--;
  11533. if (k === b) break;
  11534. a.pd(b);
  11535. a.be(k, c);
  11536. return k
  11537. }
  11538. for (l = NaN; ++k < e && (l = a.fa(k).Co,
  11539. isNaN(l)););
  11540. }
  11541. return b
  11542. }
  11543. f.clear = function() { for (var a = this.rb.Fc(), b = a.length, c = 0; c < b; c++) a[c].Pf(!1), this.yf(-1, a[c], !1) };
  11544. D.w(Hg, { Hi: "parts" }, function() { return this.rb.j });
  11545. D.w(Hg, { xM: "partsBackwards" }, function() { return this.rb.$n });
  11546. D.w(Hg, { g: "diagram" }, function() { return this.ca });
  11547. D.defineProperty(Hg, { name: "name" }, function() { return this.$b }, function(a) {
  11548. D.h(a, "string", Hg, "name");
  11549. var b = this.$b;
  11550. if (b !== a) {
  11551. var c = this.g;
  11552. if (null !== c)
  11553. for ("" === b && D.k("Cannot rename default Layer to: " + a), c = c.ao; c.next();) c.value.name === a && D.k("Layer.name is already present in this diagram: " + a);
  11554. this.$b = a;
  11555. this.i("name", b, a);
  11556. for (a = this.rb.j; a.next();) a.value.Nf = this.$b
  11557. }
  11558. });
  11559. D.defineProperty(Hg, { opacity: "opacity" }, function() { return this.Lc }, function(a) {
  11560. var b = this.Lc;
  11561. b !== a && (D.h(a, "number", Hg, "opacity"), (0 > a || 1 < a) && D.ua(a, "0 <= value <= 1", Hg, "opacity"), this.Lc = a, this.i("opacity", b, a), a = this.g, null !== a && a.ra())
  11562. });
  11563. D.defineProperty(Hg, { Yc: "isTemporary" }, function() { return this.Zz }, function(a) {
  11564. var b = this.Zz;
  11565. b !== a && (D.h(a, "boolean", Hg, "isTemporary"), this.Zz = a, this.i("isTemporary", b, a))
  11566. });
  11567. D.defineProperty(Hg, { visible: "visible" }, function() { return this.BA }, function(a) {
  11568. var b = this.BA;
  11569. if (b !== a) {
  11570. D.h(a, "boolean", Hg, "visible");
  11571. this.BA = a;
  11572. this.i("visible", b, a);
  11573. for (b = this.rb.j; b.next();) b.value.Pd(a);
  11574. a = this.g;
  11575. null !== a && a.ra()
  11576. }
  11577. });
  11578. D.defineProperty(Hg, { tg: "pickable" }, function() { return this.Ul }, function(a) {
  11579. var b = this.Ul;
  11580. b !== a && (D.h(a, "boolean", Hg, "pickable"), this.Ul = a, this.i("pickable", b, a))
  11581. });
  11582. D.defineProperty(Hg, { fG: "isBoundsIncluded" }, function() { return this.Wz }, function(a) { this.Wz !== a && (this.Wz = a, null !== this.g && this.g.Qc()) });
  11583. D.defineProperty(Hg, { Pk: "allowCopy" }, function() { return this.ll }, function(a) {
  11584. var b = this.ll;
  11585. b !== a && (D.h(a, "boolean", Hg, "allowCopy"), this.ll = a, this.i("allowCopy", b, a))
  11586. });
  11587. D.defineProperty(Hg, { Cn: "allowDelete" }, function() { return this.ml }, function(a) {
  11588. var b = this.ml;
  11589. b !== a && (D.h(a, "boolean", Hg, "allowDelete"), this.ml = a, this.i("allowDelete", b, a))
  11590. });
  11591. D.defineProperty(Hg, { Dx: "allowTextEdit" }, function() { return this.vl }, function(a) {
  11592. var b = this.vl;
  11593. b !== a && (D.h(a, "boolean", Hg, "allowTextEdit"), this.vl = a, this.i("allowTextEdit", b, a))
  11594. });
  11595. D.defineProperty(Hg, { Ax: "allowGroup" }, function() { return this.nl }, function(a) {
  11596. var b = this.nl;
  11597. b !== a && (D.h(a, "boolean", Hg, "allowGroup"), this.nl = a, this.i("allowGroup", b, a))
  11598. });
  11599. D.defineProperty(Hg, { Ex: "allowUngroup" }, function() { return this.wl }, function(a) {
  11600. var b = this.wl;
  11601. b !== a && (D.h(a, "boolean", Hg, "allowUngroup"), this.wl = a, this.i("allowUngroup", b, a))
  11602. });
  11603. D.defineProperty(Hg, { eu: "allowLink" }, function() { return this.ol }, function(a) {
  11604. var b = this.ol;
  11605. b !== a && (D.h(a, "boolean", Hg, "allowLink"), this.ol = a, this.i("allowLink", b, a))
  11606. });
  11607. D.defineProperty(Hg, { Dn: "allowRelink" }, function() { return this.ql }, function(a) {
  11608. var b = this.ql;
  11609. b !== a && (D.h(a, "boolean", Hg, "allowRelink"), this.ql = a, this.i("allowRelink", b, a))
  11610. });
  11611. D.defineProperty(Hg, { fm: "allowMove" }, function() { return this.pl }, function(a) {
  11612. var b = this.pl;
  11613. b !== a && (D.h(a, "boolean", Hg, "allowMove"), this.pl = a, this.i("allowMove", b, a))
  11614. });
  11615. D.defineProperty(Hg, { Bx: "allowReshape" }, function() { return this.rl }, function(a) {
  11616. var b = this.rl;
  11617. b !== a && (D.h(a, "boolean", Hg, "allowReshape"), this.rl = a, this.i("allowReshape", b, a))
  11618. });
  11619. D.defineProperty(Hg, { fu: "allowResize" }, function() { return this.sl }, function(a) {
  11620. var b = this.sl;
  11621. b !== a && (D.h(a, "boolean", Hg, "allowResize"), this.sl = a, this.i("allowResize", b, a))
  11622. });
  11623. D.defineProperty(Hg, { Cx: "allowRotate" }, function() { return this.tl }, function(a) {
  11624. var b = this.tl;
  11625. b !== a && (D.h(a, "boolean", Hg, "allowRotate"), this.tl = a, this.i("allowRotate", b, a))
  11626. });
  11627. D.defineProperty(Hg, { Jf: "allowSelect" }, function() { return this.ul }, function(a) {
  11628. var b = this.ul;
  11629. b !== a && (D.h(a, "boolean", Hg, "allowSelect"), this.ul = a, this.i("allowSelect", b, a))
  11630. });
  11631. function E(a) {
  11632. function b() {
  11633. window.document.removeEventListener("DOMContentLoaded", b, !1);
  11634. Al(c)
  11635. }
  11636. 1 < arguments.length && D.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");
  11637. D.xc(this);
  11638. Bl = [];
  11639. this.ed = !0;
  11640. this.JC = new kh;
  11641. this.JC.ad(this);
  11642. this.Xd = 17;
  11643. this.rs = !1;
  11644. this.lA = "default";
  11645. var c = this;
  11646. null !== window.document.body ? Al(this) : window.document.addEventListener("DOMContentLoaded", b, !1);
  11647. this.dc = new K(Hg);
  11648. this.Tb = this.Pb = 0;
  11649. this.Ek = this.Ub = this.dd = this.Ib = null;
  11650. this.NG();
  11651. this.kp =
  11652. null;
  11653. this.MG();
  11654. this.sb = (new N(NaN, NaN)).freeze();
  11655. this.Db = 1;
  11656. this.mw = (new N(NaN, NaN)).freeze();
  11657. this.nw = NaN;
  11658. this.Gw = 1E-4;
  11659. this.Dw = 100;
  11660. this.Nc = new Ea;
  11661. this.wx = (new N(NaN, NaN)).freeze();
  11662. this.ew = (new C(NaN, NaN, NaN, NaN)).freeze();
  11663. this.Zw = (new Lb(0, 0, 0, 0)).freeze();
  11664. this.$w = Cl;
  11665. this.ex = !0;
  11666. this.Ww = this.Uw = null;
  11667. this.Nm = Vh;
  11668. this.No = Vc;
  11669. this.Il = Vh;
  11670. this.hp = Vc;
  11671. this.ow = this.lw = ec;
  11672. this.Oe = !0;
  11673. this.ms = !1;
  11674. this.Gg = new L(F);
  11675. this.Cl = new oa(J, C);
  11676. this.Ur = !0;
  11677. this.pr = 250;
  11678. this.Io = -1;
  11679. this.Lv = (new Lb(16, 16, 16, 16)).freeze();
  11680. this.Sr =
  11681. this.cg = !1;
  11682. this.bp = !0;
  11683. this.aj = new bg;
  11684. this.Hd = new bg;
  11685. this.cc = new bg;
  11686. this.xh = this.Qi = null;
  11687. this.Sp = !1;
  11688. this.Ez = this.Fz = null;
  11689. this.mz = window.PointerEvent && (D.zq || D.Aq || D.rB) && window.navigator && !1 !== window.navigator.msPointerEnabled;
  11690. Dl(this);
  11691. this.Ap = new L(G);
  11692. this.$l = new L(I);
  11693. this.tp = new L(J);
  11694. this.rb = new L(F);
  11695. this.tw = !0;
  11696. this.qx = El;
  11697. this.CD = !1;
  11698. this.tx = fj;
  11699. this.zz = this.Cz = this.wA = null;
  11700. this.Sv = "";
  11701. this.Mr = "auto";
  11702. this.Ui = this.wj = this.kj = this.Jw = this.lj = this.mj = this.nj = this.Ti = this.Yi = this.Ri = null;
  11703. this.fA = !1;
  11704. this.jA = {};
  11705. this.Dp = [null, null];
  11706. this.wz = null;
  11707. this.hr = this.Dz = this.rA = this.pE = this.vj = !1;
  11708. this.OD = !0;
  11709. this.Yz = this.je = !1;
  11710. this.ye = null;
  11711. var d = this;
  11712. this.VD = function(a) { if (a.ea === d.ea && d.$a) { d.$a = !1; try { var b = a.Oc; "" === a.Cf && b === fg && Fl(d, a.object, a.propertyName) } finally { d.$a = !0 } } };
  11713. this.WD = function(a) { Gl(d, a) };
  11714. this.NE = !0;
  11715. this.rh = -2;
  11716. this.Vi = new oa(Object, F);
  11717. this.gk = new oa(Object, J);
  11718. this.Zm = new oa(Object, Array);
  11719. this.Cp = new oa("string", Array);
  11720. this.iA = new K(Hl);
  11721. this.dj = !1;
  11722. this.ml = this.ll = this.Bv = this.rf = !0;
  11723. this.Dv = this.Cv = !1;
  11724. this.Iv = this.Gv = this.ul = this.tl = this.sl = this.rl = this.pl = this.ql = this.ol = this.Fv = this.wl = this.nl = this.vl = !0;
  11725. this.th = this.LD = !1;
  11726. this.Hv = this.Ev = this.jw = this.iw = !0;
  11727. this.bx = this.Yw = 16;
  11728. this.nA = this.Xw = !1;
  11729. this.yt = this.ax = null;
  11730. this.oA = this.pA = 0;
  11731. this.tf = (new Lb(5)).freeze();
  11732. this.ix = (new L(F)).freeze();
  11733. this.Ew = 999999999;
  11734. this.kw = (new L(F)).freeze();
  11735. this.Jl = this.Wm = this.rk = !0;
  11736. this.Gl = this.qk = !1;
  11737. this.we = null;
  11738. this.xl = !0;
  11739. this.sh = !1;
  11740. this.HH = new L(J);
  11741. this.AD = new L(Il);
  11742. this.Wd = null;
  11743. this.aE = 1;
  11744. this.sE = 0;
  11745. this.Fh = { scale: 1, position: new N, bounds: new C, isScroll: !1 };
  11746. this.ME = (new C(NaN, NaN, NaN, NaN)).freeze();
  11747. this.Zv = (new C(NaN, NaN, NaN, NaN)).freeze();
  11748. this.uw = !1;
  11749. this.aw = null;
  11750. this.Qw = new L(Jl);
  11751. Kl(this);
  11752. this.zw = this.gw = this.Kw = this.fD = this.eD = this.gD = this.xk = this.El = this.oj = null;
  11753. Ll(this);
  11754. this.Ed = null;
  11755. this.fw = !1;
  11756. this.Qo = null;
  11757. this.nb = new Ph;
  11758. this.nb.initializeStandardTools();
  11759. this.eb = this.mu = this.nb;
  11760. this.yb = new qa;
  11761. this.ea = new Y;
  11762. this.vj = !0;
  11763. this.Yb = new $g;
  11764. this.vj = !1;
  11765. this.rD = this.Iz = null;
  11766. this.ud = 1;
  11767. this.Hk = null;
  11768. var e = D.vfo.split(".");
  11769. !0 !== D.Qx.licenseKey && "1" === e[0] && 7 > parseInt(e[1], 10) && (D.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version " + D.vfo + ". This license key will do nothing until you upgrade to GoJS 1.7 or later."), D.Qx.licenseKey = !0);
  11770. this.ji = 1;
  11771. this.wk = 0;
  11772. this.ww = new N;
  11773. this.yA = 500;
  11774. this.Kv = new N;
  11775. this.Ht = null;
  11776. this.uk = !1;
  11777. this.preventDefault = this.Gy = this.Lq = this.Mq = this.Kq = this.Jq = this.ko = this.mo = this.lo = this.io = this.jo = this.vC = this.mC = this.nC = this.oC = this.Wl = this.ut =
  11778. this.Vl = this.tt = null;
  11779. this.qw = !1;
  11780. this.Hl = new Ml;
  11781. void 0 !== a && Nl(this, a);
  11782. this.ed = !1
  11783. }
  11784. D.ka("Diagram", E);
  11785. E.prototype.clear = E.prototype.clear = function() {
  11786. var a = null;
  11787. null !== this.Ed && (a = this.Ed.Y);
  11788. this.ea.clear();
  11789. for (var b = this.dc.length, c = 0; c < b; c++) this.dc.o[c].clear();
  11790. this.Gg.clear();
  11791. this.Cl.clear();
  11792. this.Ap.clear();
  11793. this.$l.clear();
  11794. this.tp.clear();
  11795. this.rb.clear();
  11796. this.Vi.clear();
  11797. this.gk.clear();
  11798. this.Zm.clear();
  11799. this.ix.Xa();
  11800. this.ix.clear();
  11801. this.ix.freeze();
  11802. this.kw.Xa();
  11803. this.kw.clear();
  11804. this.kw.freeze();
  11805. Nh = this.Qo = null;
  11806. Oh = "";
  11807. this.Zv = (new C(NaN, NaN, NaN, NaN)).freeze();
  11808. null !== a && (this.add(a), this.rb.remove(a));
  11809. this.ra()
  11810. };
  11811. E.prototype.reset = E.prototype.reset = function() {
  11812. this.ed = !0;
  11813. this.clear();
  11814. this.dc = new K(Hg);
  11815. this.NG();
  11816. this.MG();
  11817. this.sb = (new N(NaN, NaN)).freeze();
  11818. this.Db = 1;
  11819. this.mw = (new N(NaN, NaN)).freeze();
  11820. this.nw = NaN;
  11821. this.Gw = 1E-4;
  11822. this.Dw = 100;
  11823. this.wx = (new N(NaN, NaN)).freeze();
  11824. this.ew = (new C(NaN, NaN, NaN, NaN)).freeze();
  11825. this.Zw = (new Lb(0, 0, 0, 0)).freeze();
  11826. this.$w = Cl;
  11827. this.ex = !0;
  11828. this.Ww = this.Uw = null;
  11829. this.Nm = Vh;
  11830. this.No = Vc;
  11831. this.Il = Vh;
  11832. this.hp = Vc;
  11833. this.ow = this.lw = ec;
  11834. this.pr = 250;
  11835. this.Lv = (new Lb(16, 16, 16, 16)).freeze();
  11836. this.tw = !0;
  11837. this.qx = El;
  11838. this.tx = fj;
  11839. this.Mr = "auto";
  11840. this.Ui = this.wj = this.kj = this.Jw = this.lj = this.mj = this.nj = this.Ti = this.Yi = this.Ri = null;
  11841. this.dj = !1;
  11842. this.ml = this.ll = this.Bv = this.rf = !0;
  11843. this.Dv = this.Cv = !1;
  11844. this.Hv = this.Ev = this.jw = this.iw = this.Iv = this.Gv = this.ul = this.tl = this.sl = this.rl = this.pl = this.ql = this.ol = this.Fv = this.wl = this.nl = this.vl = !0;
  11845. this.bx = this.Yw = 16;
  11846. this.tf = (new Lb(5)).freeze();
  11847. this.Ew = 999999999;
  11848. this.we = null;
  11849. this.uw = !1;
  11850. Ll(this);
  11851. this.Ed = null;
  11852. this.nb = new Ph;
  11853. this.nb.initializeStandardTools();
  11854. this.eb = this.mu =
  11855. this.nb;
  11856. this.yb = new qa;
  11857. this.vj = !0;
  11858. Kl(this);
  11859. this.Yb = new $g;
  11860. this.vj = !1;
  11861. this.ea = new Y;
  11862. this.sh = !1;
  11863. this.bp = !0;
  11864. this.ed = this.cg = !1;
  11865. this.ra();
  11866. this.xh = this.Qi = null;
  11867. Dl(this);
  11868. this.Sv = ""
  11869. };
  11870. function Ll(a) {
  11871. a.oj = new oa("string", F);
  11872. var b = new G,
  11873. c = new pa;
  11874. c.bind(new ph("text", "", ia));
  11875. b.add(c);
  11876. a.gD = b;
  11877. a.oj.add("", b);
  11878. b = new G;
  11879. c = new pa;
  11880. c.stroke = "brown";
  11881. c.bind(new ph("text", "", ia));
  11882. b.add(c);
  11883. a.oj.add("Comment", b);
  11884. b = new G;
  11885. b.il = !1;
  11886. b.HA = !1;
  11887. c = new z;
  11888. c.Kb = "Ellipse";
  11889. c.fill = "black";
  11890. c.stroke = null;
  11891. c.Ea = (new Ca(3, 3)).Oa();
  11892. b.add(c);
  11893. a.oj.add("LinkLabel", b);
  11894. a.El = new oa("string", I);
  11895. b = new I;
  11896. b.Py = "GROUPPANEL";
  11897. b.type = Ol;
  11898. c = new pa;
  11899. c.font = "bold 12pt sans-serif";
  11900. c.bind(new ph("text", "", ia));
  11901. b.add(c);
  11902. c = new x(Pl);
  11903. c.name =
  11904. "GROUPPANEL";
  11905. var d = new z;
  11906. d.Kb = "Rectangle";
  11907. d.fill = "rgba(128,128,128,0.2)";
  11908. d.stroke = "black";
  11909. c.add(d);
  11910. d = new Yj;
  11911. d.padding = (new Lb(5, 5, 5, 5)).Oa();
  11912. c.add(d);
  11913. b.add(c);
  11914. a.eD = b;
  11915. a.El.add("", b);
  11916. a.xk = new oa("string", J);
  11917. b = new J;
  11918. c = new z;
  11919. c.Ue = !0;
  11920. b.add(c);
  11921. c = new z;
  11922. c.ar = "Standard";
  11923. c.fill = "black";
  11924. c.stroke = null;
  11925. c.lb = 0;
  11926. b.add(c);
  11927. a.fD = b;
  11928. a.xk.add("", b);
  11929. b = new J;
  11930. c = new z;
  11931. c.Ue = !0;
  11932. c.stroke = "brown";
  11933. b.add(c);
  11934. a.xk.add("Comment", b);
  11935. b = new da;
  11936. b.type = Pl;
  11937. c = new z;
  11938. c.fill = null;
  11939. c.stroke = "dodgerblue";
  11940. c.lb = 3;
  11941. b.add(c);
  11942. c = new Yj;
  11943. c.margin = (new Lb(1.5,
  11944. 1.5, 1.5, 1.5)).Oa();
  11945. b.add(c);
  11946. a.Kw = b;
  11947. a.gw = b;
  11948. b = new da;
  11949. b.type = sj;
  11950. c = new z;
  11951. c.Ue = !0;
  11952. c.fill = null;
  11953. c.stroke = "dodgerblue";
  11954. c.lb = 3;
  11955. b.add(c);
  11956. a.zw = b
  11957. }
  11958. function Al(a) {
  11959. var b = D.createElement("p");
  11960. b.style.width = "100%";
  11961. b.style.height = "200px";
  11962. b.style.boxSizing = "content-box";
  11963. var c = D.createElement("div");
  11964. c.style.position = "absolute";
  11965. c.style.visibility = "hidden";
  11966. c.style.width = "200px";
  11967. c.style.height = "150px";
  11968. c.style.overflow = "hidden";
  11969. c.style.boxSizing = "content-box";
  11970. c.appendChild(b);
  11971. window.document.body.appendChild(c);
  11972. var d = b.offsetWidth;
  11973. c.style.overflow = "scroll";
  11974. b = b.offsetWidth;
  11975. d === b && (b = c.clientWidth);
  11976. window.document.body.removeChild(c);
  11977. c = d - b;
  11978. 0 !== c || D.iG ||
  11979. (c = 11);
  11980. a.Xd = c;
  11981. c = D.createElement("div");
  11982. c.dir = "rtl";
  11983. c.style.cssText = "font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;";
  11984. c.textContent = "A";
  11985. window.document.body.appendChild(c);
  11986. d = "reverse";
  11987. 0 < c.scrollLeft ? d = "default" : (c.scrollLeft = 1, 0 === c.scrollLeft && (d = "negative"));
  11988. window.document.body.removeChild(c);
  11989. a.lA = d
  11990. }
  11991. E.prototype.qc = function(a) { a.Qe === E ? this.im = a : D.ak(this, a) };
  11992. E.prototype.toString = function(a) {
  11993. void 0 === a && (a = 0);
  11994. var b = "";
  11995. this.Hj && this.Hj.id && (b = this.Hj.id);
  11996. b = 'Diagram "' + b + '"';
  11997. if (0 >= a) return b;
  11998. for (var c = this.dc.j; c.next();) b += "\n " + c.value.toString(a - 1);
  11999. return b
  12000. };
  12001. E.fromDiv = function(a) { var b = a; "string" === typeof a && (b = window.document.getElementById(a)); return b instanceof HTMLDivElement && b.ca instanceof E ? b.ca : null };
  12002. D.defineProperty(E, { Hj: "div" }, function() { return this.Ub }, function(a) {
  12003. null !== a && D.l(a, HTMLDivElement, E, "div");
  12004. if (this.Ub !== a) {
  12005. Bl = [];
  12006. var b = this.Ub;
  12007. null !== b ? (b.ca = void 0, b.innerHTML = "", null !== this.Ib && (this.Ib.removeEventListener("touchstart", this.oC, !1), this.Ib.removeEventListener("touchmove", this.nC, !1), this.Ib.removeEventListener("touchend", this.mC, !1), this.Ib.$d.ca = null), b = this.nb, null !== b && (b.qf.each(function(a) { a.cancelWaitAfter() }), b.mg.each(function(a) { a.cancelWaitAfter() }), b.ng.each(function(a) { a.cancelWaitAfter() })),
  12008. b.cancelWaitAfter(), this.eb.doCancel(), this.dd = this.Ib = null, window.removeEventListener("resize", this.vC, !1), window.removeEventListener("mousemove", this.jo, !0), window.removeEventListener("mousedown", this.io, !0), window.removeEventListener("mouseup", this.lo, !0), window.removeEventListener("wheel", this.mo, !0), window.removeEventListener("mouseout", this.ko, !0)) : this.sh = !1;
  12009. this.Ub = null;
  12010. if (null !== a) {
  12011. if (b = a.ca) b.Hj = null;
  12012. Nl(this, a);
  12013. this.ro()
  12014. }
  12015. }
  12016. });
  12017. function Ql(a) {
  12018. var b = a.Ib;
  12019. a.mz ? (b.addEventListener("pointerdown", a.Jq, !1), b.addEventListener("pointermove", a.Kq, !1), b.addEventListener("pointerup", a.Mq, !1), b.addEventListener("pointerout", a.Lq, !1)) : (b.addEventListener("touchstart", a.oC, !1), b.addEventListener("touchmove", a.nC, !1), b.addEventListener("touchend", a.mC, !1), b.addEventListener("mousemove", a.jo, !1), b.addEventListener("mousedown", a.io, !1), b.addEventListener("mouseup", a.lo, !1), b.addEventListener("mouseout", a.ko, !1));
  12020. b.addEventListener("wheel",
  12021. a.mo, !1);
  12022. b.addEventListener("keydown", a.xJ, !1);
  12023. b.addEventListener("keyup", a.yJ, !1);
  12024. b.addEventListener("selectstart", function(a) { a.preventDefault(); return !1 }, !1);
  12025. b.addEventListener("contextmenu", function(a) { a.preventDefault(); return !1 }, !1);
  12026. b.addEventListener("gesturechange", function(b) { a.nb.rq === Vk && b.preventDefault() }, !1);
  12027. window.addEventListener("resize", a.vC, !1)
  12028. }
  12029. E.prototype.computePixelRatio = function() { if (null !== this.Hk) return this.Hk; var a = this.dd; return (window.devicePixelRatio || 1) / (a.za.webkitBackingStorePixelRatio || a.za.mozBackingStorePixelRatio || a.za.msBackingStorePixelRatio || a.za.oBackingStorePixelRatio || a.za.backingStorePixelRatio || 1) };
  12030. E.prototype.doMouseMove = function() { this.eb.doMouseMove() };
  12031. E.prototype.doMouseDown = function() { this.eb.doMouseDown() };
  12032. E.prototype.doMouseUp = function() { this.eb.doMouseUp() };
  12033. E.prototype.doMouseWheel = function() { this.eb.doMouseWheel() };
  12034. E.prototype.doKeyDown = function() { this.eb.doKeyDown() };
  12035. E.prototype.doKeyUp = function() { this.eb.doKeyUp() };
  12036. E.prototype.doFocus = function() { this.focus() };
  12037. E.prototype.focus = E.prototype.focus = function() {
  12038. if (this.Ib)
  12039. if (this.oK) this.Ib.focus();
  12040. else {
  12041. var a = window.scrollX || window.pageXOffset,
  12042. b = window.scrollY || window.pageYOffset;
  12043. this.Ib.focus();
  12044. window.scrollTo(a, b)
  12045. }
  12046. };
  12047. function fl(a) {
  12048. if (null !== a.Ib) {
  12049. var b = a.Ub;
  12050. if (0 !== b.clientWidth && 0 !== b.clientHeight) {
  12051. var c = a.Gl ? a.Xd : 0,
  12052. d = a.qk ? a.Xd : 0,
  12053. e = a.ud;
  12054. a.ud = a.computePixelRatio();
  12055. a.ud !== e && (a.ms = !0, a.Ve());
  12056. if (b.clientWidth !== a.Pb + c || b.clientHeight !== a.Tb + d) a.Wm = !0, a.Oe = !0, b = a.Yb, null !== b && b.my && a.im === Vh && (a.Sr = !0, b.L()), a.je || a.Ve()
  12057. }
  12058. }
  12059. }
  12060. function Kl(a) {
  12061. var b = new Hg;
  12062. b.name = "Background";
  12063. a.$t(b);
  12064. b = new Hg;
  12065. b.name = "";
  12066. a.$t(b);
  12067. b = new Hg;
  12068. b.name = "Foreground";
  12069. a.$t(b);
  12070. b = new Hg;
  12071. b.name = "Adornment";
  12072. b.Yc = !0;
  12073. a.$t(b);
  12074. b = new Hg;
  12075. b.name = "Tool";
  12076. b.Yc = !0;
  12077. b.fG = !0;
  12078. a.$t(b);
  12079. b = new Hg;
  12080. b.name = "Grid";
  12081. b.Jf = !1;
  12082. b.tg = !1;
  12083. b.Yc = !0;
  12084. a.XH(b, a.pm("Background"))
  12085. }
  12086. function Rl(a) {
  12087. a.Ed = new x(Sl);
  12088. a.Ed.name = "GRID";
  12089. var b = new z;
  12090. b.Kb = "LineH";
  12091. b.stroke = "lightgray";
  12092. b.lb = .5;
  12093. b.interval = 1;
  12094. a.Ed.add(b);
  12095. b = new z;
  12096. b.Kb = "LineH";
  12097. b.stroke = "gray";
  12098. b.lb = .5;
  12099. b.interval = 5;
  12100. a.Ed.add(b);
  12101. b = new z;
  12102. b.Kb = "LineH";
  12103. b.stroke = "gray";
  12104. b.lb = 1;
  12105. b.interval = 10;
  12106. a.Ed.add(b);
  12107. b = new z;
  12108. b.Kb = "LineV";
  12109. b.stroke = "lightgray";
  12110. b.lb = .5;
  12111. b.interval = 1;
  12112. a.Ed.add(b);
  12113. b = new z;
  12114. b.Kb = "LineV";
  12115. b.stroke = "gray";
  12116. b.lb = .5;
  12117. b.interval = 5;
  12118. a.Ed.add(b);
  12119. b = new z;
  12120. b.Kb = "LineV";
  12121. b.stroke = "gray";
  12122. b.lb = 1;
  12123. b.interval = 10;
  12124. a.Ed.add(b);
  12125. b = new F;
  12126. b.add(a.Ed);
  12127. b.Nf = "Grid";
  12128. b.Co = 0;
  12129. b.hy = !1;
  12130. b.eG = !1;
  12131. b.tg = !1;
  12132. b.uy = "GRID";
  12133. a.add(b);
  12134. a.rb.remove(b);
  12135. a.Ed.visible = !1
  12136. }
  12137. function Tl() { this.ca.isEnabled ? this.ca.AI(this) : Ul(this.ca) }
  12138. function Vl(a) { this.ca.isEnabled ? (this.ca.nA = !0, this.ca.pA = a.target.scrollTop, this.ca.oA = a.target.scrollLeft) : Ul(this.ca) }
  12139. E.prototype.diagramScroll = E.prototype.AI = function(a) {
  12140. if (this.nA && null !== this.Ib) {
  12141. this.Xw = !0;
  12142. var b = this.kd,
  12143. c = this.wb,
  12144. d = this.Ny,
  12145. e = b.x - d.left,
  12146. g = b.y - d.top,
  12147. h = b.width + d.left + d.right,
  12148. k = b.height + d.top + d.bottom,
  12149. l = b.right + d.right,
  12150. d = b.bottom + d.bottom,
  12151. m = c.x,
  12152. b = c.y,
  12153. n = c.width,
  12154. p = c.height,
  12155. q = c.right,
  12156. r = c.bottom,
  12157. c = this.scale,
  12158. s;
  12159. s = a.scrollLeft;
  12160. if (this.rs) switch (this.lA) {
  12161. case "negative":
  12162. s = s + a.scrollWidth - a.clientWidth;
  12163. break;
  12164. case "reverse":
  12165. s = a.scrollWidth - s - a.clientWidth
  12166. }
  12167. var u = s;
  12168. n < h || p < k ? (s = D.Fb(this.position.x, this.position.y),
  12169. this.Be && this.oA !== u && (s.x = u / c + e, this.oA = u), this.Ce && this.pA !== a.scrollTop && (s.y = a.scrollTop / c + g, this.pA = a.scrollTop), this.position = s, D.A(s), this.Wm = this.Xw = !1) : (s = D.P(), a.NH && this.Be && (e < m && (this.position = s.n(u + e, this.position.y)), l > q && (this.position = s.n(-(this.ax.scrollWidth - this.Pb) + u - this.Pb / c + l, this.position.y))), a.OH && this.Ce && (g < b && (this.position = s.n(this.position.x, a.scrollTop + g)), d > r && (this.position = s.n(this.position.x, -(this.ax.scrollHeight - this.Tb) + a.scrollTop - this.Tb / c + d))), D.A(s), Wl(this),
  12170. this.Wm = this.Xw = !1, b = this.kd, c = this.wb, l = b.right, q = c.right, d = b.bottom, r = c.bottom, e = b.x, m = c.x, g = b.y, b = c.y, n >= h && e >= m && l <= q && (this.yt.style.width = "1px"), p >= k && g >= b && d <= r && (this.yt.style.height = "1px"))
  12171. }
  12172. };
  12173. E.prototype.computeBounds = E.prototype.Kh = function() { 0 < this.Gg.count && Si(this); return Xl(this) };
  12174. function Xl(a) {
  12175. if (a.LF.H()) {
  12176. var b = a.LF.copy();
  12177. b.yx(a.padding);
  12178. return b
  12179. }
  12180. for (var c = !0, d = a.dc.o, e = d.length, g = 0; g < e; g++) {
  12181. var h = d[g];
  12182. if (h.visible && (!h.Yc || h.fG))
  12183. for (var h = h.rb.o, k = h.length, l = 0; l < k; l++) {
  12184. var m = h[l];
  12185. m.hy && m.isVisible() && (m = m.aa, m.H() && (c ? (c = !1, b = m.copy()) : b.Zh(m)))
  12186. }
  12187. }
  12188. c && (b = new C(0, 0, 0, 0));
  12189. b.yx(a.padding);
  12190. return b
  12191. }
  12192. E.prototype.computePartsBounds = function(a, b) { void 0 === b && (b = !1); for (var c = null, d = a.j; d.next();) { var e = d.value;!b && e instanceof J || (e.kf(), null === c ? c = e.aa.copy() : c.Zh(e.aa)) } return null === c ? new C(NaN, NaN, 0, 0) : c };
  12193. function Yl(a, b) {
  12194. if ((b || a.sh) && !a.ed && null !== a.Ib && !a.Ra.nf && a.kd.H()) {
  12195. a.ed = !0;
  12196. var c = a.Nm;
  12197. b && a.Il !== Vh && (c = a.Il);
  12198. var d = c !== Vh ? Zl(a, c) : a.scale,
  12199. c = a.wb.copy(),
  12200. e = a.Pb / d,
  12201. g = a.Tb / d,
  12202. h = null,
  12203. k = a.Ra;
  12204. k.zc && (h = a.sb.copy());
  12205. a.position.Xa();
  12206. var l = a.No;
  12207. b && !l.Xc() && a.hp.Xc() && (l = a.hp);
  12208. $l(a, a.sb, a.kd, e, g, l, b);
  12209. a.position.freeze();
  12210. null !== h && rl(k, h, a.sb);
  12211. e = a.scale;
  12212. a.scale = d;
  12213. a.ed = !1;
  12214. d = a.wb;
  12215. d.Wc(c) || a.dv(c, d, e, a.scale, !1)
  12216. }
  12217. }
  12218. function Zl(a, b) {
  12219. var c = a.yb.Ox;
  12220. if (null === a.Ib) return c;
  12221. a.rk && am(a, a.Kh());
  12222. var d = a.kd;
  12223. if (!d.H()) return c;
  12224. var e = d.width,
  12225. d = d.height,
  12226. g = a.Pb,
  12227. h = a.Tb,
  12228. k = g / e,
  12229. l = h / d;
  12230. return b === bm ? (e = Math.min(l, k), e > c && (e = c), e < a.Sh && (e = a.Sh), e > a.Rh && (e = a.Rh), e) : b === cm ? (e = l > k ? (h - a.Xd) / d : (g - a.Xd) / e, e > c && (e = c), e < a.Sh && (e = a.Sh), e > a.Rh && (e = a.Rh), e) : a.scale
  12231. }
  12232. E.prototype.zoomToFit = E.prototype.zoomToFit = function() { this.scale = Zl(this, bm) };
  12233. E.prototype.zoomToRect = function(a, b) {
  12234. void 0 === b && (b = bm);
  12235. var c = a.width,
  12236. d = a.height;
  12237. if (!(0 === c || 0 === d || isNaN(c) && isNaN(d))) {
  12238. var e = 1;
  12239. if (b === bm || b === cm)
  12240. if (isNaN(c)) e = this.wb.height * this.scale / d;
  12241. else if (isNaN(d)) e = this.wb.width * this.scale / c;
  12242. else var e = this.Pb,
  12243. g = this.Tb,
  12244. e = b === cm ? g / d > e / c ? (g - (this.qk ? this.Xd : 0)) / d : (e - (this.Gl ? this.Xd : 0)) / c : Math.min(g / d, e / c);
  12245. this.scale = e;
  12246. this.position = new N(a.x, a.y)
  12247. }
  12248. };
  12249. D.defineProperty(E, { qB: null }, function() { return this.ed }, function(a) { this.ed = a });
  12250. E.prototype.alignDocument = function(a, b) {
  12251. this.rk && am(this, this.Kh());
  12252. var c = this.kd,
  12253. d = this.wb;
  12254. this.position = new N(c.x + (a.x * c.width + a.offsetX) - (b.x * d.width - b.offsetX), c.y + (a.y * c.height + a.offsetY) - (b.y * d.height - b.offsetY))
  12255. };
  12256. function $l(a, b, c, d, e, g, h) {
  12257. var k = b.x,
  12258. l = b.y;
  12259. if (h || a.VB === Cl) g.Xc() && (d > c.width && (k = c.x + (g.x * c.width + g.offsetX) - (g.x * d - g.offsetX)), e > c.height && (l = c.y + (g.y * c.height + g.offsetY) - (g.y * e - g.offsetY))), g = a.Ny, h = d - c.width, d < c.width + g.left + g.right ? (k = Math.min(k + d / 2, c.right + Math.max(h, g.right) - d / 2), k = Math.max(k, c.left - Math.max(h, g.left) + d / 2), k -= d / 2) : k > c.left ? k = c.left : k < c.right - d && (k = c.right - d), d = e - c.height, e < c.height + g.top + g.bottom ? (l = Math.min(l + e / 2, c.bottom + Math.max(d, g.bottom) - e / 2), l = Math.max(l, c.top - Math.max(d,
  12260. g.top) + e / 2), l -= e / 2) : l > c.top ? l = c.top : l < c.bottom - e && (l = c.bottom - e);
  12261. b.x = isFinite(k) ? k : -a.padding.left;
  12262. b.y = isFinite(l) ? l : -a.padding.top;
  12263. null !== a.GG && (a = a.GG(a, b), b.x = a.x, b.y = a.y)
  12264. }
  12265. E.prototype.findPartAt = E.prototype.su = function(a, b) { var c = b ? Wi(this, a, function(a) { return a.Y }, function(a) { return a.canSelect() }) : Wi(this, a, function(a) { return a.Y }); return c instanceof F ? c : null };
  12266. E.prototype.findObjectAt = E.prototype.Je = function(a, b, c) {
  12267. void 0 === b && (b = null);
  12268. void 0 === c && (c = null);
  12269. Si(this);
  12270. for (var d = this.dc.$n; d.next();) { var e = d.value; if (e.visible && (e = e.Je(a, b, c), null !== e)) return e }
  12271. return null
  12272. };
  12273. function Wi(a, b, c, d) {
  12274. void 0 === c && (c = null);
  12275. void 0 === d && (d = null);
  12276. Si(a);
  12277. for (a = a.dc.$n; a.next();) { var e = a.value; if (e.visible && !e.Yc && (e = e.Je(b, c, d), null !== e)) return e }
  12278. return null
  12279. }
  12280. E.prototype.findObjectsAt = E.prototype.ru = function(a, b, c, d) {
  12281. void 0 === b && (b = null);
  12282. void 0 === c && (c = null);
  12283. d instanceof K || d instanceof L || (d = new L(O));
  12284. Si(this);
  12285. for (var e = this.dc.$n; e.next();) {
  12286. var g = e.value;
  12287. g.visible && g.ru(a, b, c, d)
  12288. }
  12289. return d
  12290. };
  12291. E.prototype.findObjectsIn = E.prototype.Xk = function(a, b, c, d, e) {
  12292. void 0 === b && (b = null);
  12293. void 0 === c && (c = null);
  12294. void 0 === d && (d = !1);
  12295. e instanceof K || e instanceof L || (e = new L(O));
  12296. Si(this);
  12297. for (var g = this.dc.$n; g.next();) {
  12298. var h = g.value;
  12299. h.visible && h.Xk(a, b, c, d, e)
  12300. }
  12301. return e
  12302. };
  12303. E.prototype.$A = function(a, b, c, d, e, g) {
  12304. var h = new L(O);
  12305. Si(this);
  12306. for (var k = this.dc.$n; k.next();) {
  12307. var l = k.value;
  12308. l.visible && l.$A(a, b, c, d, h, e, g)
  12309. }
  12310. return h
  12311. };
  12312. E.prototype.findObjectsNear = E.prototype.Pn = function(a, b, c, d, e, g) {
  12313. void 0 === c && (c = null);
  12314. void 0 === d && (d = null);
  12315. void 0 === e && (e = !0);
  12316. if (!1 !== e && !0 !== e) {
  12317. if (e instanceof K || e instanceof L) g = e;
  12318. e = !0
  12319. }
  12320. g instanceof K || g instanceof L || (g = new L(O));
  12321. Si(this);
  12322. for (var h = this.dc.$n; h.next();) {
  12323. var k = h.value;
  12324. k.visible && k.Pn(a, b, c, d, e, g)
  12325. }
  12326. return g
  12327. };
  12328. E.prototype.acceptEvent = function(a) {
  12329. var b = this.Hd;
  12330. this.Hd = this.cc;
  12331. this.cc = b;
  12332. dm(this, this, a, b, a instanceof MouseEvent);
  12333. return b
  12334. };
  12335. function dm(a, b, c, d, e) {
  12336. d.g = b;
  12337. d.event = c;
  12338. e ? em(a, c, d) : (d.te = b.cc.te, d.ha = b.cc.ha);
  12339. a = 0;
  12340. c.ctrlKey && (a += 1);
  12341. c.altKey && (a += 2);
  12342. c.shiftKey && (a += 4);
  12343. c.metaKey && (a += 8);
  12344. d.xd = a;
  12345. d.button = c.button;
  12346. void 0 === c.buttons || D.Mu || (d.buttons = c.buttons);
  12347. D.Qh && 0 === c.button && c.ctrlKey && (d.button = 2);
  12348. d.Vk = !1;
  12349. d.up = !1;
  12350. d.Ee = 1;
  12351. d.Uk = 0;
  12352. d.Cc = !1;
  12353. d.bubbles = !1;
  12354. d.timestamp = Date.now();
  12355. d.Ou = !1;
  12356. d.Qf = fm(c);
  12357. d.Ne = null
  12358. }
  12359. function fm(a) {
  12360. var b = a.target.ca;
  12361. if (!b) {
  12362. var c = a.path;
  12363. c || "function" !== typeof a.lI || (c = a.lI());
  12364. c && c[0] && (b = c[0].ca)
  12365. }
  12366. return b ? b : null
  12367. }
  12368. function gm(a, b, c, d) {
  12369. var e = a.Hd;
  12370. a.Hd = a.cc;
  12371. a.cc = e;
  12372. e.g = a;
  12373. em(a, c, e);
  12374. e.button = 0;
  12375. e.buttons = 1;
  12376. c = 0;
  12377. b.ctrlKey && (c += 1);
  12378. b.altKey && (c += 2);
  12379. b.shiftKey && (c += 4);
  12380. b.metaKey && (c += 8);
  12381. e.xd = c;
  12382. e.Vk = !0;
  12383. e.up = !1;
  12384. e.Ee = 1;
  12385. e.Uk = 0;
  12386. e.Cc = !1;
  12387. e.bubbles = !0;
  12388. e.event = b;
  12389. e.timestamp = Date.now();
  12390. e.Ou = d;
  12391. e.Qf = fm(b);
  12392. e.Ne = null;
  12393. d || (a.aj = e.copy());
  12394. di = null;
  12395. return e
  12396. }
  12397. function hm(a, b, c, d) {
  12398. var e = a.Hd;
  12399. a.Hd = a.cc;
  12400. a.cc = e;
  12401. var g = null;
  12402. e.g = a;
  12403. null !== c ? ((g = window.document.elementFromPoint(c.clientX, c.clientY)) && g.ca ? g = g.ca : (c = void 0 !== b.targetTouches ? b.targetTouches[0] : b, g = a), e.Qf = g, em(a, c, e)) : null !== a.Hd ? (e.ha = a.Hd.ha, e.te = a.Hd.te, e.Qf = a.Hd.Qf) : null !== a.aj && (e.ha = a.aj.ha, e.te = a.aj.te, e.Qf = a.aj.Qf);
  12404. e.button = 0;
  12405. e.buttons = 1;
  12406. a = 0;
  12407. b.ctrlKey && (a += 1);
  12408. b.altKey && (a += 2);
  12409. b.shiftKey && (a += 4);
  12410. b.metaKey && (a += 8);
  12411. e.xd = a;
  12412. e.Vk = !1;
  12413. e.up = !1;
  12414. e.Ee = 1;
  12415. e.Uk = 0;
  12416. e.Cc = !1;
  12417. e.bubbles = !1;
  12418. e.event = b;
  12419. e.timestamp =
  12420. Date.now();
  12421. e.Ou = d;
  12422. e.Ne = null;
  12423. return e
  12424. }
  12425. function ga(a, b, c) {
  12426. if (b.bubbles) return v && v.$F && D.trace("NOT handled " + c.type + " " + b.toString()), !0;
  12427. v && v.$F && D.trace("handled " + c.type + " " + a.eb.name + " " + b.toString());
  12428. void 0 !== c.stopPropagation && c.stopPropagation();
  12429. c.preventDefault();
  12430. c.cancelBubble = !0;
  12431. return !1
  12432. }
  12433. E.prototype.xJ = function(a) {
  12434. if (!this.ca.isEnabled) return !1;
  12435. var b = this.ca.cc;
  12436. dm(this.ca, this.ca, a, b, !1);
  12437. b.key = String.fromCharCode(a.which);
  12438. b.Vk = !0;
  12439. switch (a.which) {
  12440. case 8:
  12441. b.key = "Backspace";
  12442. break;
  12443. case 33:
  12444. b.key = "PageUp";
  12445. break;
  12446. case 34:
  12447. b.key = "PageDown";
  12448. break;
  12449. case 35:
  12450. b.key = "End";
  12451. break;
  12452. case 36:
  12453. b.key = "Home";
  12454. break;
  12455. case 37:
  12456. b.key = "Left";
  12457. break;
  12458. case 38:
  12459. b.key = "Up";
  12460. break;
  12461. case 39:
  12462. b.key = "Right";
  12463. break;
  12464. case 40:
  12465. b.key = "Down";
  12466. break;
  12467. case 45:
  12468. b.key = "Insert";
  12469. break;
  12470. case 46:
  12471. b.key = "Del";
  12472. break;
  12473. case 48:
  12474. b.key = "0";
  12475. break;
  12476. case 187:
  12477. case 61:
  12478. case 107:
  12479. b.key =
  12480. "Add";
  12481. break;
  12482. case 189:
  12483. case 173:
  12484. case 109:
  12485. b.key = "Subtract";
  12486. break;
  12487. case 27:
  12488. b.key = "Esc"
  12489. }
  12490. this.ca.doKeyDown();
  12491. return ga(this.ca, b, a)
  12492. };
  12493. E.prototype.yJ = function(a) {
  12494. if (!this.ca.isEnabled) return !1;
  12495. var b = this.ca.cc;
  12496. dm(this.ca, this.ca, a, b, !1);
  12497. b.key = String.fromCharCode(a.which);
  12498. b.up = !0;
  12499. switch (a.which) {
  12500. case 8:
  12501. b.key = "Backspace";
  12502. break;
  12503. case 33:
  12504. b.key = "PageUp";
  12505. break;
  12506. case 34:
  12507. b.key = "PageDown";
  12508. break;
  12509. case 35:
  12510. b.key = "End";
  12511. break;
  12512. case 36:
  12513. b.key = "Home";
  12514. break;
  12515. case 37:
  12516. b.key = "Left";
  12517. break;
  12518. case 38:
  12519. b.key = "Up";
  12520. break;
  12521. case 39:
  12522. b.key = "Right";
  12523. break;
  12524. case 40:
  12525. b.key = "Down";
  12526. break;
  12527. case 45:
  12528. b.key = "Insert";
  12529. break;
  12530. case 46:
  12531. b.key = "Del"
  12532. }
  12533. this.ca.doKeyUp();
  12534. return ga(this.ca, b, a)
  12535. };
  12536. E.prototype.dp = function(a) {
  12537. var b = this.Ib;
  12538. if (null === b) return new N(0, 0);
  12539. var c = this.Pb,
  12540. d = this.Tb,
  12541. b = b.getBoundingClientRect(),
  12542. c = a.clientX - c / b.width * b.left;
  12543. a = a.clientY - d / b.height * b.top;
  12544. return null !== this.Nc ? (a = new N(c, a), kb(a, this.Nc), a) : new N(c, a)
  12545. };
  12546. function em(a, b, c) {
  12547. var d = a.Ib,
  12548. e = a.Pb,
  12549. g = a.Tb,
  12550. h = 0,
  12551. k = 0;
  12552. null !== d && (d = d.getBoundingClientRect(), h = b.clientX - e / d.width * d.left, k = b.clientY - g / d.height * d.top);
  12553. c.te.n(h, k);
  12554. null !== a.Nc ? (b = D.Fb(h, k), a.Nc.Oh(b), c.ha.assign(b), D.A(b)) : c.ha.n(h, k)
  12555. }
  12556. function cg(a, b, c, d) {
  12557. var e = null;
  12558. if (void 0 !== b.targetTouches) {
  12559. if (2 > b.targetTouches.length) return;
  12560. e = b.targetTouches[c]
  12561. } else if (null !== a.Dp[0]) e = a.Dp[c];
  12562. else return;
  12563. c = a.Ib;
  12564. b = a.Pb;
  12565. a = a.Tb;
  12566. var g = 0,
  12567. h = 0;
  12568. null !== c && null !== e && (c = c.getBoundingClientRect(), g = e.clientX - b / c.width * c.left, h = e.clientY - a / c.height * c.top);
  12569. d.n(g, h)
  12570. }
  12571. E.prototype.invalidateDocumentBounds = E.prototype.Qc = function() { this.rk || (this.rk = !0, this.Ve(!0)) };
  12572. function ol(a) {
  12573. a.je || Si(a);
  12574. a.rk && am(a, a.Kh())
  12575. }
  12576. E.prototype.redraw = E.prototype.ro = function() { this.ed || this.je || (this.ra(), im(this), Wl(this), this.Qc(), this.lg()) };
  12577. E.prototype.isUpdateRequested = function() { return this.cg };
  12578. E.prototype.delayInitialization = function(a) {
  12579. void 0 === a && (a = null);
  12580. var b = this.Ra,
  12581. c = b.isEnabled;
  12582. b.Yh();
  12583. b.isEnabled = !1;
  12584. bj(this);
  12585. this.sh = !1;
  12586. b.isEnabled = c;
  12587. null !== a && D.setTimeout(a, 1)
  12588. };
  12589. E.prototype.requestUpdate = E.prototype.Ve = function(a) {
  12590. void 0 === a && (a = !1);
  12591. if (!0 !== this.cg && !(this.ed || !1 === a && this.je)) {
  12592. this.cg = !0;
  12593. var b = this;
  12594. requestAnimationFrame(function() { b.cg && b.lg() })
  12595. }
  12596. };
  12597. E.prototype.maybeUpdate = E.prototype.lg = function() { if (!this.bp || this.cg) this.bp && (this.bp = !1), bj(this) };
  12598. function jm(a, b) { a.Ra.nf || a.ed || !a.Wm || Ul(a) || (b && Si(a), Yl(a, !1)) }
  12599. function bj(a) {
  12600. if (!a.je && (a.cg = !1, null !== a.Ub)) {
  12601. a.je = !0;
  12602. var b = a.Ra,
  12603. c = a.iA;
  12604. if (!b.np && 0 !== c.length) {
  12605. for (var d = c.o, e = d.length, g = 0; g < e; g++) {
  12606. var h = d[g];
  12607. km(h, !1);
  12608. h.K()
  12609. }
  12610. c.clear()
  12611. }
  12612. c = a.AD;
  12613. 0 < c.count && (c.each(function(a) { a.tC() }), c.clear());
  12614. d = c = !1;
  12615. b.nf && (d = !0, c = a.kb, a.kb = !0);
  12616. b.zc || fl(a);
  12617. jm(a, !1);
  12618. null !== a.Ed && (a.Ed.visible && !a.fw && (lm(a), a.fw = !0), !a.Ed.visible && a.fw && (a.fw = !1));
  12619. Si(a);
  12620. e = !1;
  12621. if (!a.sh || a.xl) a.sh ? mm(a, !a.Sr) : (a.Nb("Initial Layout"), !1 === b.isEnabled && b.Yh(), mm(a, !1)), e = !0;
  12622. a.Sr = !1;
  12623. Si(a);
  12624. a.rA || b.nf ||
  12625. ol(a);
  12626. jm(a, !0);
  12627. e && (a.sh || pm(a), a.Ja("LayoutCompleted"));
  12628. Si(a);
  12629. e && !a.sh && (a.sh = !0, a.jd("Initial Layout"), a.kb || a.na.clear(), D.setTimeout(function() { a.Gi = !1 }, 1));
  12630. xm(a);
  12631. el(b);
  12632. a.He(a.dd);
  12633. d && (a.kb = c);
  12634. a.je = !1
  12635. }
  12636. }
  12637. D.w(E, { Zn: null }, function() { return this.sh });
  12638. function pm(a) {
  12639. var b = a.dc.o;
  12640. a.Pf(b, b.length, a);
  12641. a.Il !== Vh ? a.scale = Zl(a, a.Il) : a.Nm !== Vh ? a.scale = Zl(a, a.Nm) : (b = a.jJ, isFinite(b) && 0 < b && (a.scale = b));
  12642. b = a.iJ;
  12643. if (b.H()) a.position = b;
  12644. else {
  12645. b = D.P();
  12646. b.uo(a.kd, a.hJ);
  12647. var c = a.wb,
  12648. c = D.vg(0, 0, c.width, c.height),
  12649. d = D.P();
  12650. d.uo(c, a.kJ);
  12651. d.n(b.x - d.x, b.y - d.y);
  12652. a.position = d;
  12653. D.Lb(c);
  12654. D.A(d);
  12655. D.A(b);
  12656. im(a);
  12657. jm(a, !0);
  12658. Yl(a, !0)
  12659. }
  12660. a.Ja("InitialLayoutCompleted");
  12661. lm(a)
  12662. }
  12663. function Si(a) {
  12664. if ((a.je || !a.Ra.nf) && 0 !== a.Gg.count) {
  12665. for (var b = 0; 23 > b; b++) {
  12666. var c = a.Gg.j;
  12667. if (null === c || 0 === a.Gg.count) break;
  12668. a.Gg = new L(F);
  12669. a.tC(c, a.Gg);
  12670. v && 22 === b && D.trace("failure to validate parts")
  12671. }
  12672. a.rg.each(function(a) { a instanceof I && 0 !== (a.Ca & 65536) !== !1 && (a.Ca ^= 65536) })
  12673. }
  12674. }
  12675. E.prototype.tC = function(a, b) { for (a.reset(); a.next();) { var c = a.value;!c.qe() || c instanceof I || (c.ym() ? (Hk(c, Infinity, Infinity), c.rc()) : b.add(c)) } for (a.reset(); a.next();) c = a.value, c instanceof I && c.isVisible() && Mm(this, c); for (a.reset(); a.next();) c = a.value, c instanceof J && c.isVisible() && (c.ym() ? (Hk(c, Infinity, Infinity), c.rc()) : b.add(c)); for (a.reset(); a.next();) c = a.value, c instanceof da && c.isVisible() && (c.ym() ? (Hk(c, Infinity, Infinity), c.rc()) : b.add(c)) };
  12676. function Mm(a, b) {
  12677. for (var c = D.mb(), d = D.mb(), e = b.uc; e.next();) {
  12678. var g = e.value;
  12679. g.isVisible() && (g instanceof I ? (Nm(g) || Om(g) || Pm(g)) && Mm(a, g) : g instanceof J ? g.$ === b || g.ba === b ? d.push(g) : c.push(g) : (Hk(g, Infinity, Infinity), g.rc()))
  12680. }
  12681. for (var e = c.length, h = 0; h < e; h++) g = c[h], Hk(g, Infinity, Infinity), g.rc();
  12682. D.ya(c);
  12683. Hk(b, Infinity, Infinity);
  12684. b.rc();
  12685. e = d.length;
  12686. for (h = 0; h < e; h++) g = d[h], Hk(g, Infinity, Infinity), g.rc();
  12687. D.ya(d)
  12688. }
  12689. E.prototype.Pf = function(a, b, c, d) {
  12690. var e = this.Ra;
  12691. if (this.Jl || e.nf)
  12692. for (e = 0; e < b; e++) a[e].Pf(c, d)
  12693. };
  12694. E.prototype.He = function(a, b) {
  12695. void 0 === b && (b = null);
  12696. null === this.Ub && D.k("No div specified");
  12697. var c = this.Ib;
  12698. null === c && D.k("No canvas specified");
  12699. var d = this.Ra;
  12700. if (!d.zc && (Qm(this), "0" !== this.Ub.style.opacity)) {
  12701. var e = a !== this.dd,
  12702. g = this.dc.o,
  12703. h = g.length,
  12704. k = this;
  12705. this.Pf(g, h, k);
  12706. if (e) a.De(!0), Wl(this);
  12707. else if (!this.Oe && null === b && !d.sk) return;
  12708. var h = this.sb,
  12709. l = this.Db,
  12710. m = Math.round(h.x * l) / l,
  12711. n = Math.round(h.y * l) / l,
  12712. d = this.Nc;
  12713. d.reset();
  12714. 1 !== l && d.scale(l);
  12715. 0 === h.x && 0 === h.y || d.translate(-m, -n);
  12716. l = this.ud;
  12717. D.Xn ? (c.width = c.width,
  12718. a.De(!0), a.scale(l, l)) : (a.setTransform(1, 0, 0, 1, 0, 0), a.scale(l, l), a.clearRect(0, 0, this.Pb, this.Tb));
  12719. a.setTransform(1, 0, 0, 1, 0, 0);
  12720. a.scale(l, l);
  12721. a.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
  12722. v && v.Dj && v.zF(this, a);
  12723. c = null !== b ? function(c) {
  12724. var d = b;
  12725. if (c.visible && 0 !== c.Lc) {
  12726. var e = c.rb.o,
  12727. g = e.length;
  12728. if (0 !== g) {
  12729. 1 !== c.Lc && (a.globalAlpha = c.Lc);
  12730. c = c.Pw;
  12731. c.length = 0;
  12732. for (var h = k.scale, l = 0; l < g; l++) {
  12733. var m = e[l];
  12734. if (tl(m) && !d.contains(m)) {
  12735. if (m instanceof J) {
  12736. var n = m;
  12737. n.ic && c.push(n);
  12738. if (!1 === n.Uf) continue
  12739. }
  12740. n = m.aa;
  12741. 1 < n.width * h || 1 <
  12742. n.height * h ? m.He(a, k) : vl(m, a)
  12743. }
  12744. }
  12745. a.globalAlpha = 1
  12746. }
  12747. }
  12748. } : function(b) { b.He(a, k) };
  12749. Rm(this, a);
  12750. h = g.length;
  12751. for (m = 0; m < h; m++) a.setTransform(1, 0, 0, 1, 0, 0), a.scale(l, l), a.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), c(g[m]);
  12752. this.Hl ? this.Hl.Im(this) && this.aw() : this.dp = function() { return new N(0, 0) };
  12753. v && (v.WA || v.Dj) && v.VA(a, this, d);
  12754. e ? (this.dd.De(!0), Wl(this)) : this.Oe = this.Jl = !1
  12755. }
  12756. };
  12757. function Sm(a, b, c, d, e) {
  12758. null === a.Ub && D.k("No div specified");
  12759. var g = a.Ib;
  12760. null === g && D.k("No canvas specified");
  12761. if (!a.Ra.zc) {
  12762. var h = a.dd;
  12763. if (a.Oe) {
  12764. Qm(a);
  12765. var k = a.ud;
  12766. D.Xn ? (g.width = g.width, h.De(!0)) : (h.setTransform(1, 0, 0, 1, 0, 0), h.clearRect(0, 0, a.Pb * k, a.Tb * k));
  12767. h.Sy(!1);
  12768. h.drawImage(a.Iz.$d, 0 < d ? 0 : Math.round(-d), 0 < e ? 0 : Math.round(-e));
  12769. e = a.sb;
  12770. var g = a.Db,
  12771. l = Math.round(e.x * g) / g,
  12772. m = Math.round(e.y * g) / g;
  12773. d = a.Nc;
  12774. d.reset();
  12775. 1 !== g && d.scale(g);
  12776. 0 === e.x && 0 === e.y || d.translate(-l, -m);
  12777. h.save();
  12778. h.beginPath();
  12779. e = c.length;
  12780. for (g = 0; g <
  12781. e; g++) l = c[g], 0 !== l.width && 0 !== l.height && h.rect(Math.floor(l.x), Math.floor(l.y), Math.ceil(l.width), Math.ceil(l.height));
  12782. h.clip();
  12783. h.setTransform(1, 0, 0, 1, 0, 0);
  12784. h.scale(k, k);
  12785. h.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
  12786. v && v.Dj && v.zF(a, h);
  12787. c = a.dc.o;
  12788. e = c.length;
  12789. a.Pf(c, e, a);
  12790. Rm(a, h);
  12791. for (g = 0; g < e; g++) wl(c[g], h, a, b);
  12792. h.restore();
  12793. h.De(!0);
  12794. v && (v.WA || v.Dj) && v.VA(h, a, d);
  12795. a.Hl ? a.Hl.Im(a) && a.aw() : a.dp = function() { return new N(0, 0) };
  12796. a.Jl = !1;
  12797. a.Oe = !1;
  12798. a.Gy()
  12799. }
  12800. }
  12801. }
  12802. function Tm(a, b, c, d, e, g, h, k, l, m) {
  12803. null === a.Ub && D.k("No div specified");
  12804. null === a.Ib && D.k("No canvas specified");
  12805. void 0 === h && (h = null);
  12806. void 0 === k && (k = null);
  12807. void 0 === l && (l = !1);
  12808. void 0 === m && (m = !1);
  12809. Qm(a);
  12810. a.dd.De(!0);
  12811. Wl(a);
  12812. a.Yz = !0;
  12813. var n = a.Db;
  12814. a.Db = e;
  12815. var p = a.dc.o,
  12816. q = p.length;
  12817. try {
  12818. var r = new C(g.x, g.y, d.width / e, d.height / e),
  12819. s = r.copy();
  12820. s.yx(c);
  12821. lm(a, s);
  12822. Si(a);
  12823. a.Pf(p, q, a, r);
  12824. var u = a.ud;
  12825. b.setTransform(1, 0, 0, 1, 0, 0);
  12826. b.scale(u, u);
  12827. b.clearRect(0, 0, d.width, d.height);
  12828. null !== k && "" !== k && (b.fillStyle = k, b.fillRect(0, 0, d.width, d.height));
  12829. var t = D.hh();
  12830. t.reset();
  12831. t.translate(c.left, c.top);
  12832. t.scale(e);
  12833. 0 === g.x && 0 === g.y || t.translate(-g.x, -g.y);
  12834. b.setTransform(t.m11, t.m12, t.m21, t.m22, t.dx, t.dy);
  12835. D.lf(t);
  12836. Rm(a, b);
  12837. var y;
  12838. if (null !== h) {
  12839. var w = new L(F),
  12840. A = h.j;
  12841. for (A.reset(); A.next();) { var B = A.value;!1 === m && "Grid" === B.layer.name || null === B || w.add(B) }
  12842. y = function(c) {
  12843. var d = l;
  12844. if (c.visible && 0 !== c.Lc && (void 0 === d && (d = !0), d || !c.Yc)) {
  12845. var d = c.rb.o,
  12846. e = d.length;
  12847. if (0 !== e) {
  12848. 1 !== c.Lc && (b.globalAlpha = c.Lc);
  12849. c = c.Pw;
  12850. c.length = 0;
  12851. for (var g = a.scale, h = 0; h < e; h++) {
  12852. var k = d[h];
  12853. if (tl(k) &&
  12854. w.contains(k)) {
  12855. if (k instanceof J) {
  12856. var m = k;
  12857. m.ic && c.push(m);
  12858. if (!1 === m.Uf) continue
  12859. }
  12860. m = k.aa;
  12861. 1 < m.width * g || 1 < m.height * g ? k.He(b, a) : vl(k, b)
  12862. }
  12863. }
  12864. b.globalAlpha = 1
  12865. }
  12866. }
  12867. }
  12868. } else if (!l && m) {
  12869. var P = a.Vn.Y,
  12870. H = P.layer;
  12871. y = function(c) { c === H ? P.He(b, a) : c.He(b, a, l) }
  12872. } else y = function(c) { c.He(b, a, l) };
  12873. for (c = 0; c < q; c++) y(p[c]);
  12874. a.Yz = !1;
  12875. a.Hl ? a.Hl.Im(a) && a.aw() : a.dp = function() { return new N(0, 0) }
  12876. } finally { a.Db = n, a.dd.De(!0), Wl(a), a.Pf(p, q, a), lm(a) }
  12877. }
  12878. E.prototype.getRenderingHint = E.prototype.Kj = function(a) { return this.Ek[a] };
  12879. E.prototype.setRenderingHint = E.prototype.sK = function(a, b) {
  12880. this.Ek[a] = b;
  12881. this.ro()
  12882. };
  12883. E.prototype.resetRenderingHints = E.prototype.NG = function() {
  12884. this.Ek = new ma;
  12885. this.Ek.drawShadows = !0;
  12886. this.Ek.textGreeking = !0;
  12887. this.Ek.viewportOptimizations = D.iG || D.zq || D.Aq ? !1 : !0;
  12888. this.Ek.temporaryPixelRatio = !0;
  12889. this.Ek.pictureRatioOptimization = !0
  12890. };
  12891. function Rm(a, b) {
  12892. var c = a.Ek;
  12893. null !== c && (void 0 !== c.imageSmoothingEnabled && b.Sy(!!c.imageSmoothingEnabled), c = c.defaultFont, void 0 !== c && null !== c && (b.font = c))
  12894. }
  12895. E.prototype.getInputOption = E.prototype.Cu = function(a) { return this.kp[a] };
  12896. E.prototype.setInputOption = function(a, b) { this.kp[a] = b };
  12897. E.prototype.resetInputOptions = E.prototype.MG = function() {
  12898. this.kp = new ma;
  12899. this.kp.extraTouchArea = 10;
  12900. this.kp.extraTouchThreshold = 10;
  12901. this.kp.hasGestureZoom = !0
  12902. };
  12903. E.prototype.setProperties = function(a) { D.nv(this, a) };
  12904. function xm(a) {
  12905. if (0 === a.na.Ki && 0 !== a.Cl.count) {
  12906. for (; 0 < a.Cl.count;) {
  12907. var b = a.Cl;
  12908. a.Cl = new oa(J, C);
  12909. for (b = b.j; b.next();) {
  12910. var c = b.key;
  12911. Oj(c, b.value);
  12912. c.Te()
  12913. }
  12914. }
  12915. a.ra()
  12916. }
  12917. }
  12918. E.prototype.ra = function(a) {
  12919. void 0 === a && (a = null);
  12920. if (null === a) this.Oe = !0, this.Ve();
  12921. else {
  12922. var b = this.wb;
  12923. null !== a && a.H() && b.jg(a) && (this.Oe = !0, this.Ve())
  12924. }
  12925. for (b = this.Qw.j; b.next();) b.value.ra(a)
  12926. };
  12927. E.prototype.dG = function(a, b) {
  12928. if (!0 !== this.Oe) {
  12929. this.Oe = !0;
  12930. var c = !0 === this.Kj("temporaryPixelRatio");
  12931. if (!0 === this.Kj("viewportOptimizations") && this.VB !== Um && this.Ny.Tx(0, 0, 0, 0) && b.width === a.width && b.height === a.height) {
  12932. var d = this.scale,
  12933. e = D.Sf(),
  12934. g = Math.max(a.x, b.x),
  12935. h = Math.max(a.y, b.y),
  12936. k = Math.min(a.x + a.width, b.x + b.width),
  12937. l = Math.min(a.y + a.height, b.y + b.height);
  12938. e.x = g;
  12939. e.y = h;
  12940. e.width = Math.max(0, k - g) * d;
  12941. e.height = Math.max(0, l - h) * d;
  12942. if (0 < e.width && 0 < e.height) {
  12943. if (!this.je && (this.cg = !1, null !== this.Ub)) {
  12944. this.je = !0;
  12945. xm(this);
  12946. this.kd.H() || am(this, this.Kh());
  12947. var m = this.Ib;
  12948. if (null !== m) {
  12949. var n = this.ud,
  12950. h = this.Pb * n,
  12951. k = this.Tb * n,
  12952. g = this.scale * n,
  12953. d = Math.round(Math.round(b.x * g) - Math.round(a.x * g)),
  12954. g = Math.round(Math.round(b.y * g) - Math.round(a.y * g)),
  12955. l = this.Iz,
  12956. p = this.rD;
  12957. l.width !== h && (l.width = h);
  12958. l.height !== k && (l.height = k);
  12959. p.clearRect(0, 0, h, k);
  12960. var l = 190 * this.ud,
  12961. q = 70 * this.ud,
  12962. r = Math.max(d, 0),
  12963. s = Math.max(g, 0),
  12964. u = Math.floor(h - r),
  12965. t = Math.floor(k - s);
  12966. p.Sy(!1);
  12967. p.drawImage(m.$d, r, s, u, t, 0, 0, u, t);
  12968. this.Hl.Im(this) && p.clearRect(0, 0, l, q);
  12969. var m = D.mb(),
  12970. p =
  12971. D.mb(),
  12972. t = Math.abs(d),
  12973. u = Math.abs(g),
  12974. y = 0 === r ? 0 : h - t,
  12975. r = D.Fb(y, 0),
  12976. t = D.Fb(t + y, k);
  12977. p.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y)));
  12978. var w = this.Nc;
  12979. w.reset();
  12980. w.scale(n, n);
  12981. 1 !== this.Db && w.scale(this.Db);
  12982. n = this.sb;
  12983. (0 !== n.x || 0 !== n.y) && isFinite(n.x) && isFinite(n.y) && w.translate(-n.x, -n.y);
  12984. kb(r, w);
  12985. kb(t, w);
  12986. m.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y)));
  12987. y = 0 === s ? 0 : k - u;
  12988. r.n(0, y);
  12989. t.n(h, u + y);
  12990. p.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x -
  12991. t.x), Math.abs(r.y - t.y)));
  12992. kb(r, w);
  12993. kb(t, w);
  12994. m.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y)));
  12995. this.Hl.Im(this) && (h = 0 < d ? 0 : -d, k = 0 < g ? 0 : -g, r.n(h, k), t.n(l + h, q + k), p.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))), kb(r, w), kb(t, w), m.push(new C(Math.min(r.x, t.x), Math.min(r.y, t.y), Math.abs(r.x - t.x), Math.abs(r.y - t.y))));
  12996. D.A(r);
  12997. D.A(t);
  12998. jm(this, !1);
  12999. Sm(this, m, p, d, g);
  13000. D.ya(m);
  13001. D.ya(p);
  13002. this.je = !1
  13003. }
  13004. }
  13005. } else this.lg();
  13006. D.Lb(e);
  13007. c && (this.Hk = 1, this.lg(),
  13008. this.Hk = null, this.Gy())
  13009. } else c ? (this.Hk = 1, this.lg(), this.Hk = null, this.Gy()) : this.lg()
  13010. }
  13011. };
  13012. function im(a) {!1 === a.Wm && (a.Wm = !0) }
  13013. function Wl(a) {!1 === a.Jl && (a.Jl = !0) }
  13014. function Qm(a) {!1 !== a.ms && (a.ms = !1, Vm(a, a.Pb, a.Tb)) }
  13015. function Vm(a, b, c) {
  13016. var d = a.Ib,
  13017. e = a.ud,
  13018. g = b * e,
  13019. e = c * e;
  13020. if (d.width !== g || d.height !== e) d.width = g, d.height = e, d.style.width = b + "px", d.style.height = c + "px", a.Oe = !0, a.dd.De(!0)
  13021. }
  13022. function Ul(a) {
  13023. var b = a.Ib;
  13024. if (null === b) return !0;
  13025. var c = a.Ub,
  13026. d = a.Pb,
  13027. e = a.Tb,
  13028. g = a.ME.copy();
  13029. if (!g.H()) return !0;
  13030. var h = !1,
  13031. k = a.Gl ? a.Xd : 0,
  13032. l = a.qk ? a.Xd : 0,
  13033. m = c.clientWidth || d + k,
  13034. c = c.clientHeight || e + l;
  13035. if (m !== d + k || c !== e + l) a.Gl = !1, a.qk = !1, l = k = 0, a.Pb = m, a.Tb = c, h = a.ms = !0;
  13036. a.Wm = !1;
  13037. var n = a.wb,
  13038. p = a.kd,
  13039. q = 0,
  13040. r = 0,
  13041. s = 0,
  13042. u = 0,
  13043. m = n.width,
  13044. c = n.height,
  13045. t = a.Ny;
  13046. a.LA.Xc() ? (p.width > m && (q = t.left, r = t.right), p.height > c && (s = t.top, u = t.bottom)) : (q = t.left, r = t.right, s = t.top, u = t.bottom);
  13047. var t = p.width + q + r,
  13048. y = p.height + s + u,
  13049. q = p.x - q,
  13050. w = n.x,
  13051. r = p.right + r,
  13052. A = n.right +
  13053. k,
  13054. s = p.y - s,
  13055. B = n.y,
  13056. u = p.bottom + u,
  13057. n = n.bottom + l,
  13058. P = "1px",
  13059. H = "1px",
  13060. p = a.scale,
  13061. R = !(t < m + k),
  13062. aa = !(y < c + l);
  13063. a.VB === Cl && (R || aa) && (R && a.jB && a.Be && (P = 1, q + 1 < w && (P = Math.max((w - q) * p + a.Pb, P)), r > A + 1 && (P = Math.max((r - A) * p + a.Pb, P)), m + k + 1 < t && (P = Math.max((t - m + k) * p + a.Pb, P)), P = P.toString() + "px"), aa && a.kB && a.Ce && (H = 1, s + 1 < B && (H = Math.max((B - s) * p + a.Tb, H)), u > n + 1 && (H = Math.max((u - n) * p + a.Tb, H)), c + l + 1 < y && (H = Math.max((y - c + l) * p + a.Tb, H)), H = H.toString() + "px"));
  13064. var R = "1px" !== P,
  13065. V = "1px" !== H;
  13066. R && V || !R && !V || (aa = !(y < c + l), V && (A -= a.Xd), R && (n -= a.Xd),
  13067. t < m + k || !a.jB || !a.Be || (P = 1, q + 1 < w && (P = Math.max((w - q) * p + a.Pb, P)), r > A + 1 && (P = Math.max((r - A) * p + a.Pb, P)), m + 1 < t && (P = Math.max((t - m) * p + a.Pb, P)), P = P.toString() + "px"), R = "1px" !== P, k = R !== a.qk ? a.Tb - a.Xd : a.Tb, aa && a.kB && a.Ce && (H = 1, s + 1 < B && (H = Math.max((B - s) * p + k, H)), u > n + 1 && (H = Math.max((u - n) * p + k, H)), c + 1 < y && (H = Math.max((y - c) * p + k, H)), H = H.toString() + "px"), V = "1px" !== H);
  13068. if (a.Xw && R === a.qk && V === a.Gl) return d === a.Pb && e === a.Tb || a.lg(), !1;
  13069. R !== a.qk && (a.Tb = "1px" === P ? a.Tb + a.Xd : Math.max(a.Tb - a.Xd, 1), h = !0);
  13070. a.qk = R;
  13071. a.yt.style.width = P;
  13072. V !== a.Gl && (a.Pb = "1px" === H ? a.Pb + a.Xd : Math.max(a.Pb - a.Xd, 1), h = !0, a.rs && (k = D.P(), V ? (b.style.left = a.Xd + "px", a.position = k.n(a.sb.x + a.Xd / a.scale, a.sb.y)) : (b.style.left = "0px", a.position = k.n(a.sb.x - a.Xd / a.scale, a.sb.y)), D.A(k)));
  13073. a.Gl = V;
  13074. a.yt.style.height = H;
  13075. b = a.ax;
  13076. k = b.scrollLeft;
  13077. a.jB && a.Be && (m + 1 < t ? k = (a.position.x - q) * p : q + 1 < w ? k = b.scrollWidth - b.clientWidth : r > A + 1 && (k = a.position.x * p));
  13078. if (a.rs) switch (a.lA) {
  13079. case "negative":
  13080. k = -(b.scrollWidth - k - b.clientWidth);
  13081. break;
  13082. case "reverse":
  13083. k = b.scrollWidth - k - b.clientWidth
  13084. }
  13085. b.scrollLeft =
  13086. k;
  13087. a.kB && a.Ce && (c + 1 < y ? b.scrollTop = (a.position.y - s) * p : s + 1 < B ? b.scrollTop = b.scrollHeight - b.clientHeight : u > n + 1 && (b.scrollTop = a.position.y * p));
  13088. h && (a.ms = !0);
  13089. m = a.Pb;
  13090. c = a.Tb;
  13091. b.style.width = m + (a.Gl ? a.Xd : 0) + "px";
  13092. b.style.height = c + (a.qk ? a.Xd : 0) + "px";
  13093. a.nA = !1;
  13094. return d !== m || e !== c || a.Ra.zc ? (n = a.wb, a.dv(g, n, p, a.scale, h), !1) : !0
  13095. }
  13096. E.prototype.add = E.prototype.add = function(a) {
  13097. D.l(a, F, E, "add:part");
  13098. var b = a.g;
  13099. if (b !== this) {
  13100. null !== b && D.k("Cannot add part " + a.toString() + " to " + this.toString() + ". It is already a part of " + b.toString());
  13101. this.hr && (a.Nl = "Tool");
  13102. var c = a.Nf,
  13103. b = this.pm(c);
  13104. null === b && (b = this.pm(""));
  13105. null === b && D.k('Cannot add a Part when unable find a Layer named "' + c + '" and there is no default Layer');
  13106. a.layer !== b && (c = b.uq(99999999, a, a.g === this), 0 <= c && this.od(hg, "parts", b, null, a, null, c), b.Yc || this.Qc(), a.L(Wm), c = a.py, null !==
  13107. c && c(a, null, b))
  13108. }
  13109. };
  13110. E.prototype.uq = function(a) {
  13111. if (a instanceof G) {
  13112. if (this.Ap.add(a), a instanceof I) {
  13113. var b = a.Ka;
  13114. null === b ? this.$l.add(a) : b.gn.add(a);
  13115. b = a.Yb;
  13116. null !== b && (b.g = this)
  13117. }
  13118. } else a instanceof J ? this.tp.add(a) : a instanceof da || this.rb.add(a);
  13119. var c = this;
  13120. Xm(a, function(a) { Ym(c, a) });
  13121. (a instanceof da || a instanceof I && null !== a.Rb) && a.K();
  13122. b = a.data;
  13123. null !== b && (a instanceof da || (a instanceof J ? this.gk.add(b, a) : this.Vi.add(b, a)), Xm(a, function(a) { Zm(c, a) }));
  13124. !0 !== Om(a) && !0 !== Pm(a) || this.Gg.add(a);
  13125. $m(a, !0, this);
  13126. an(a) ? (a.aa.H() &&
  13127. this.ra(xl(a, a.aa)), this.Qc()) : a.isVisible() && a.aa.H() && this.ra(xl(a, a.aa));
  13128. this.Ve()
  13129. };
  13130. E.prototype.yf = function(a) {
  13131. a.iu();
  13132. if (a instanceof G) {
  13133. if (this.Ap.remove(a), a instanceof I) {
  13134. var b = a.Ka;
  13135. null === b ? this.$l.remove(a) : b.gn.remove(a);
  13136. b = a.Yb;
  13137. null !== b && (b.g = null)
  13138. }
  13139. } else a instanceof J ? this.tp.remove(a) : a instanceof da || this.rb.remove(a);
  13140. var c = this;
  13141. Xm(a, function(a) { bn(c, a) });
  13142. b = a.data;
  13143. null !== b && (a instanceof da || (a instanceof J ? this.gk.remove(b) : this.Vi.remove(b)), Xm(a, function(a) { cn(c, a) }));
  13144. this.Gg.remove(a);
  13145. an(a) ? (a.aa.H() && this.ra(xl(a, a.aa)), this.Qc()) : a.isVisible() && a.aa.H() && this.ra(xl(a,
  13146. a.aa));
  13147. this.Ve()
  13148. };
  13149. E.prototype.remove = E.prototype.remove = function(a) {
  13150. D.l(a, F, E, "remove:part");
  13151. dn(this, a, !0)
  13152. };
  13153. function dn(a, b, c) {
  13154. var d = b.layer;
  13155. null !== d && d.g === a && (b.ib = !1, b.Zg = !1, b.L(en), c && b.Nn(), c = d.yf(-1, b, !1), 0 <= c && a.od(ig, "parts", d, b, null, c, null), a = b.py, null !== a && a(b, d, null))
  13156. }
  13157. E.prototype.removeParts = E.prototype.RB = function(a, b) {
  13158. if (D.isArray(a))
  13159. for (var c = D.cb(a), d = 0; d < c; d++) {
  13160. var e = D.La(a, d);
  13161. b && !e.canDelete() || this.remove(e)
  13162. } else
  13163. for (e = new L(F), e.Vc(a), c = e.j; c.next();) e = c.value, b && !e.canDelete() || this.remove(e)
  13164. };
  13165. E.prototype.copyParts = E.prototype.hq = function(a, b, c) { return this.yb.hq(a, b, c) };
  13166. E.prototype.moveParts = E.prototype.moveParts = function(a, b, c) {
  13167. D.l(b, N, E, "moveParts:offset");
  13168. var d = this.nb;
  13169. if (null !== d) {
  13170. d = d.Ge;
  13171. null === d && (d = new Uh, d.ad(this));
  13172. var e = new oa(F);
  13173. if (null !== a) a = a.j;
  13174. else {
  13175. for (a = this.Hi; a.next();) gi(d, e, a.value, c);
  13176. for (a = this.rg; a.next();) gi(d, e, a.value, c);
  13177. a = this.links
  13178. }
  13179. for (; a.next();) gi(d, e, a.value, c);
  13180. d.moveParts(e, b, c)
  13181. }
  13182. };
  13183. function fn(a, b, c) {
  13184. D.l(b, Hg, E, "addLayer:layer");
  13185. null !== b.g && b.g !== a && D.k("Cannot share a Layer with another Diagram: " + b + " of " + b.g);
  13186. null === c ? null !== b.g && D.k("Cannot add an existing Layer to this Diagram again: " + b) : (D.l(c, Hg, E, "addLayer:existingLayer"), c.g !== a && D.k("Existing Layer must be in this Diagram: " + c + " not in " + c.g), b === c && D.k("Cannot move a Layer before or after itself: " + b));
  13187. if (b.g !== a) {
  13188. b = b.name;
  13189. a = a.dc;
  13190. c = a.count;
  13191. for (var d = 0; d < c; d++) a.fa(d).name === b && D.k("Cannot add Layer with the name '" +
  13192. b + "'; a Layer with the same name is already present in this Diagram.")
  13193. }
  13194. }
  13195. E.prototype.addLayer = E.prototype.$t = function(a) {
  13196. fn(this, a, null);
  13197. a.ad(this);
  13198. var b = this.dc,
  13199. c = b.count - 1;
  13200. if (!a.Yc)
  13201. for (; 0 <= c && b.fa(c).Yc;) c--;
  13202. b.be(c + 1, a);
  13203. null !== this.ye && this.od(hg, "layers", this, null, a, null, c + 1);
  13204. this.ra();
  13205. this.Qc()
  13206. };
  13207. E.prototype.addLayerBefore = E.prototype.XH = function(a, b) {
  13208. fn(this, a, b);
  13209. a.ad(this);
  13210. var c = this.dc,
  13211. d = c.indexOf(a);
  13212. 0 <= d && (c.remove(a), null !== this.ye && this.od(ig, "layers", this, a, null, d, null));
  13213. for (var e = c.count, g = 0; g < e; g++)
  13214. if (c.fa(g) === b) { c.be(g, a); break }
  13215. null !== this.ye && this.od(hg, "layers", this, null, a, null, g);
  13216. this.ra();
  13217. 0 > d && this.Qc()
  13218. };
  13219. E.prototype.addLayerAfter = function(a, b) {
  13220. fn(this, a, b);
  13221. a.ad(this);
  13222. var c = this.dc,
  13223. d = c.indexOf(a);
  13224. 0 <= d && (c.remove(a), null !== this.ye && this.od(ig, "layers", this, a, null, d, null));
  13225. for (var e = c.count, g = 0; g < e; g++)
  13226. if (c.fa(g) === b) { c.be(g + 1, a); break }
  13227. null !== this.ye && this.od(hg, "layers", this, null, a, null, g + 1);
  13228. this.ra();
  13229. 0 > d && this.Qc()
  13230. };
  13231. E.prototype.removeLayer = function(a) {
  13232. D.l(a, Hg, E, "removeLayer:layer");
  13233. a.g !== this && D.k("Cannot remove a Layer from another Diagram: " + a + " of " + a.g);
  13234. if ("" !== a.name) {
  13235. var b = this.dc,
  13236. c = b.indexOf(a);
  13237. if (b.remove(a)) {
  13238. for (b = a.rb.copy().j; b.next();) {
  13239. var d = b.value,
  13240. e = d.Nf;
  13241. d.Nf = e !== a.name ? e : ""
  13242. }
  13243. null !== this.ye && this.od(ig, "layers", this, a, null, c, null);
  13244. this.ra();
  13245. this.Qc()
  13246. }
  13247. }
  13248. };
  13249. E.prototype.findLayer = E.prototype.pm = function(a) { for (var b = this.ao; b.next();) { var c = b.value; if (c.name === a) return c } return null };
  13250. E.prototype.addModelChangedListener = E.prototype.ZH = function(a) {
  13251. D.h(a, "function", E, "addModelChangedListener:listener");
  13252. null === this.xh && (this.xh = new K("function"));
  13253. this.xh.add(a);
  13254. this.ea.Bn(a)
  13255. };
  13256. E.prototype.removeModelChangedListener = function(a) {
  13257. D.h(a, "function", E, "removeModelChangedListener:listener");
  13258. null !== this.xh && (this.xh.remove(a), 0 === this.xh.count && (this.xh = null));
  13259. this.ea.gv(a)
  13260. };
  13261. E.prototype.addChangedListener = E.prototype.Bn = function(a) {
  13262. D.h(a, "function", E, "addChangedListener:listener");
  13263. null === this.Qi && (this.Qi = new K("function"));
  13264. this.Qi.add(a)
  13265. };
  13266. E.prototype.removeChangedListener = E.prototype.gv = function(a) {
  13267. D.h(a, "function", E, "removeChangedListener:listener");
  13268. null !== this.Qi && (this.Qi.remove(a), 0 === this.Qi.count && (this.Qi = null))
  13269. };
  13270. E.prototype.Gx = function(a) {
  13271. this.kb || this.na.ZF(a);
  13272. a.Oc !== gg && (this.Gi = !0);
  13273. if (null !== this.Qi)
  13274. for (var b = this.Qi, c = b.length, d = 0; d < c; d++) b.fa(d)(a)
  13275. };
  13276. E.prototype.raiseChangedEvent = E.prototype.od = function(a, b, c, d, e, g, h) {
  13277. void 0 === g && (g = null);
  13278. void 0 === h && (h = null);
  13279. var k = new eg;
  13280. k.g = this;
  13281. k.Oc = a;
  13282. k.propertyName = b;
  13283. k.object = c;
  13284. k.oldValue = d;
  13285. k.Wj = g;
  13286. k.newValue = e;
  13287. k.Uj = h;
  13288. this.Gx(k)
  13289. };
  13290. E.prototype.raiseChanged = E.prototype.i = function(a, b, c, d, e) { this.od(fg, a, this, b, c, d, e) };
  13291. D.w(E, { Ra: "animationManager" }, function() { return this.JC });
  13292. D.w(E, { na: "undoManager" }, function() { return this.ye.na });
  13293. D.defineProperty(E, { kb: "skipsUndoManager" }, function() { return this.vj }, function(a) {
  13294. D.h(a, "boolean", E, "skipsUndoManager");
  13295. this.vj = a;
  13296. this.ye.vj = a
  13297. });
  13298. D.defineProperty(E, { SA: "delaysLayout" }, function() { return this.Dz }, function(a) { this.Dz = a });
  13299. E.prototype.Fn = function(a, b) {
  13300. if (null !== a && a.g === this) {
  13301. var c = this.Xe;
  13302. try {
  13303. this.Xe = !0;
  13304. var d = a.Oc,
  13305. e;
  13306. if (d === fg) {
  13307. var g = a.object,
  13308. h = a.propertyName,
  13309. k = a.oa(b);
  13310. D.Ua(g, h, k);
  13311. if (g instanceof O) {
  13312. var l, m = g.Y;
  13313. null !== m && m.pe()
  13314. }
  13315. this.Gi = !0
  13316. } else if (d === hg) {
  13317. var n = a.object,
  13318. p = a.Uj,
  13319. g = a.newValue;
  13320. if (n instanceof x)
  13321. if ("number" === typeof p && g instanceof O) {
  13322. l = g;
  13323. var q = n;
  13324. b ? q.yf(p) : q.be(p, l);
  13325. m = n.Y;
  13326. null !== m && m.pe()
  13327. } else {
  13328. if ("number" === typeof p && g instanceof jh) {
  13329. var r = g,
  13330. q = n;
  13331. b ? r.Ke ? q.LG(p) : q.JG(p) : (e = r.Ke ? q.oe(r.index) : q.ne(r.index),
  13332. e.gq(r))
  13333. }
  13334. }
  13335. else if (n instanceof Hg) {
  13336. var s = !0 === a.Wj;
  13337. if ("number" === typeof p && g instanceof F) {
  13338. var m = g,
  13339. u = n;
  13340. b ? (m.ib = !1, m.Zg = !1, m.pe(), u.yf(s ? p : -1, m, s)) : u.uq(p, m, s)
  13341. }
  13342. } else if (n instanceof E) {
  13343. if ("number" === typeof p && g instanceof Hg) {
  13344. var t = g;
  13345. b ? this.dc.pd(p) : (d = t, d.ad(this), this.dc.be(p, d))
  13346. }
  13347. } else D.k("unknown ChangedEvent.Insert object: " + a.toString());
  13348. this.Gi = !0
  13349. } else d === ig ? (n = a.object, p = a.Wj, g = a.oldValue, n instanceof x ? "number" === typeof p && g instanceof O ? (q = n, b ? q.be(p, g) : q.yf(p)) : "number" === typeof p && g instanceof jh && (r = g, q = n, b ? (e = r.Ke ? q.oe(r.index) : q.ne(r.index), e.gq(r)) : r.Ke ? q.LG(p) : q.JG(p)) : n instanceof Hg ? (s = !0 === a.Uj, "number" === typeof p && g instanceof F && (m = g, u = n, b ? u.uq(p, m, s) : (m.ib = !1, m.Zg = !1, m.pe(), u.yf(s ? p : -1, m, s)))) : n instanceof E ? "number" === typeof p && g instanceof Hg && (t = g, b ? (d = t, d.ad(this), this.dc.be(p, d)) : this.dc.pd(p)) : D.k("unknown ChangedEvent.Remove object: " + a.toString()), this.Gi = !0) : d !== gg && D.k("unknown ChangedEvent: " + a.toString())
  13350. } finally { this.Xe = c }
  13351. }
  13352. };
  13353. E.prototype.startTransaction = E.prototype.Nb = function(a) { return this.na.Nb(a) };
  13354. E.prototype.commitTransaction = E.prototype.jd = function(a) { return this.na.jd(a) };
  13355. E.prototype.rollbackTransaction = E.prototype.Am = function() { return this.na.Am() };
  13356. E.prototype.commit = function(a, b) {
  13357. var c = b;
  13358. void 0 === c && (c = "");
  13359. var d = this.kb;
  13360. null === c && (this.kb = !0, c = "");
  13361. this.na.Nb(c);
  13362. var e = !1;
  13363. try { a(this), e = !0 } finally { e ? this.na.jd(c) : this.na.Am(), this.kb = d }
  13364. };
  13365. E.prototype.updateAllTargetBindings = E.prototype.vH = function(a) { void 0 === a && (a = ""); for (var b = this.Hi; b.next();) b.value.Ob(a); for (b = this.rg; b.next();) b.value.Ob(a); for (b = this.links; b.next();) b.value.Ob(a) };
  13366. E.prototype.updateAllRelationshipsFromData = E.prototype.JK = function() {
  13367. for (var a = this.ea, b = new L, c = a.qg, d = 0; d < c.length; d++) {
  13368. var e = c[d];
  13369. b.add(e)
  13370. }
  13371. var g = [];
  13372. this.rg.each(function(a) { null === a.data || b.contains(a.data) || g.push(a.data) });
  13373. this.Hi.each(function(a) { null === a.data || b.contains(a.data) || g.push(a.data) });
  13374. g.forEach(function(b) { eh(a, b, !1) });
  13375. for (d = 0; d < c.length; d++) {
  13376. var e = c[d],
  13377. h = this.Nh(e);
  13378. null === h && dh(a, e, !1)
  13379. }
  13380. if (a instanceof Y) {
  13381. for (var k = new L, c = a.$g, d = 0; d < c.length; d++) e = c[d], k.add(e);
  13382. var l = [];
  13383. this.links.each(function(a) {
  13384. null ===
  13385. a.data || k.contains(a.data) || l.push(a.data)
  13386. });
  13387. l.forEach(function(b) { oh(a, b, !1) });
  13388. for (d = 0; d < c.length; d++) e = c[d], h = this.gg(e), null === h && nh(a, e, !1)
  13389. }
  13390. for (d = this.Hi; d.next();) h = d.value, h.updateRelationshipsFromData();
  13391. for (d = this.rg; d.next();) d.value.updateRelationshipsFromData();
  13392. for (d = this.links; d.next();) h = d.value, h.updateRelationshipsFromData()
  13393. };
  13394. function gn(a, b, c) {
  13395. if (a.ed || a.je) a.Db = c, c = a.Ra, c.zc && sl(c, b, a.Db);
  13396. else if (a.ed = !0, null === a.Ib) a.Db = c;
  13397. else {
  13398. var d = a.wb.copy(),
  13399. e = a.Pb,
  13400. g = a.Tb;
  13401. d.width = a.Pb / b;
  13402. d.height = a.Tb / b;
  13403. var h = a.Jm.x,
  13404. k = a.Jm.y,
  13405. l = a.LA;
  13406. isNaN(h) && (l.Pj() ? l.Mj(xc) ? h = 0 : l.Mj(yc) && (h = e - 1) : h = l.Xc() ? l.x * (e - 1) : e / 2);
  13407. isNaN(k) && (l.Pj() ? l.Mj(wc) ? k = 0 : l.Mj(Dc) && (k = g - 1) : k = l.Xc() ? l.y * (g - 1) : g / 2);
  13408. null !== a.VG && (c = a.VG(a, c));
  13409. c < a.Sh && (c = a.Sh);
  13410. c > a.Rh && (c = a.Rh);
  13411. e = D.Fb(a.sb.x + h / b - h / c, a.sb.y + k / b - k / c);
  13412. a.position = e;
  13413. D.A(e);
  13414. a.Db = c;
  13415. a.dv(d, a.wb, b, c, !1);
  13416. a.ed = !1;
  13417. Yl(a, !1);
  13418. c = a.Ra;
  13419. c.zc && sl(c, b, a.Db);
  13420. a.ra();
  13421. im(a)
  13422. }
  13423. }
  13424. E.prototype.dv = function(a, b, c, d, e) { a.O(b) || (void 0 === e && (e = !1), e || im(this), Wl(this), d = this.Yb, null === d || !d.my || this.im !== Vh || e || a.width === b.width && a.height === b.height || d.L(), d = this.eb, !0 === this.th && d instanceof Ph && (this.U.ha = this.qC(this.U.te), Xk(d, this)), this.ed || this.dG(a, b), lm(this), this.Fh.scale = c, this.Fh.position.x = a.x, this.Fh.position.y = a.y, this.Fh.bounds.set(a), this.Fh.isScroll = e, this.Ja("ViewportBoundsChanged", this.Fh, a), this.uB && this.links.each(function(a) { a.Nj && a.aa.jg(b) && a.ec() })) };
  13425. function lm(a, b) {
  13426. void 0 === b && (b = null);
  13427. var c = a.Ed;
  13428. if (null !== c && c.visible) {
  13429. for (var d = D.Gm(), e = 1, g = 1, h = c.xa.o, k = h.length, l = 0; l < k; l++) {
  13430. var m = h[l],
  13431. n = m.interval;
  13432. 2 > n || (hn(m.Kb) ? g = g * n / Te(g, n) : e = e * n / Te(e, n))
  13433. }
  13434. h = c.ay;
  13435. d.n(g * h.width, e * h.height);
  13436. h = g = l = k = 0;
  13437. if (null !== b) k = b.width, l = b.height, g = b.x, h = b.y;
  13438. else {
  13439. e = D.Sf();
  13440. g = a.wb;
  13441. e.n(g.x, g.y, g.width, g.height);
  13442. for (h = a.Qw.j; h.next();) g = h.value.wb, g.H() && Ub(e, g.x, g.y, g.width, g.height);
  13443. if (!e.H()) { D.Lb(e); return }
  13444. k = e.width;
  13445. l = e.height;
  13446. g = e.x;
  13447. h = e.y;
  13448. D.Lb(e)
  13449. }
  13450. c.width = k + 2 * d.width;
  13451. c.height =
  13452. l + 2 * d.height;
  13453. e = D.P();
  13454. jb(g, h, 0, 0, d.width, d.height, e);
  13455. e.offset(-d.width, -d.height);
  13456. D.Zk(d);
  13457. c.Y.location = e;
  13458. D.A(e)
  13459. }
  13460. }
  13461. E.prototype.clearSelection = E.prototype.Ix = function() {
  13462. var a = 0 < this.selection.count;
  13463. a && this.Ja("ChangingSelection");
  13464. Th(this);
  13465. a && this.Ja("ChangedSelection")
  13466. };
  13467. function Th(a) {
  13468. a = a.selection;
  13469. if (0 < a.count) {
  13470. for (var b = a.Fc(), c = b.length, d = 0; d < c; d++) b[d].ib = !1;
  13471. a.Xa();
  13472. a.clear();
  13473. a.freeze()
  13474. }
  13475. }
  13476. E.prototype.select = E.prototype.select = function(a) { null !== a && (D.l(a, F, E, "select:part"), a.layer.g === this && (!a.ib || 1 < this.selection.count) && (this.Ja("ChangingSelection"), Th(this), a.ib = !0, this.Ja("ChangedSelection"))) };
  13477. E.prototype.selectCollection = E.prototype.ZG = function(a) {
  13478. this.Ja("ChangingSelection");
  13479. Th(this);
  13480. if (D.isArray(a))
  13481. for (var b = D.cb(a), c = 0; c < b; c++) {
  13482. var d = D.La(a, c);
  13483. d instanceof F || D.k("Diagram.selectCollection given something that is not a Part: " + d);
  13484. d.ib = !0
  13485. } else
  13486. for (a = a.j; a.next();) d = a.value, d instanceof F || D.k("Diagram.selectCollection given something that is not a Part: " + d), d.ib = !0;
  13487. this.Ja("ChangedSelection")
  13488. };
  13489. E.prototype.clearHighlighteds = E.prototype.fI = function() {
  13490. var a = this.vm;
  13491. if (0 < a.count) {
  13492. for (var b = a.Fc(), c = b.length, d = 0; d < c; d++) b[d].Zg = !1;
  13493. a.Xa();
  13494. a.clear();
  13495. a.freeze()
  13496. }
  13497. };
  13498. E.prototype.highlight = function(a) { null !== a && a.layer.g === this && (D.l(a, F, E, "highlight:part"), !a.Zg || 1 < this.vm.count) && (this.fI(), a.Zg = !0) };
  13499. E.prototype.highlightCollection = function(a) { for (var b = (new L(F)).Vc(a), c = this.vm.copy().Iy(b).j; c.next();) a = c.value, a.Zg = !1; for (b = b.j; b.next();) a = b.value, a instanceof F || D.k("Diagram.highlightCollection given something that is not a Part: " + a), a.Zg = !0 };
  13500. E.prototype.scroll = E.prototype.scroll = function(a, b, c) {
  13501. void 0 === c && (c = 1);
  13502. var d = "up" === b || "down" === b,
  13503. e = 0;
  13504. if ("pixel" === a) e = c;
  13505. else if ("line" === a) e = c * (d ? this.mv : this.lv);
  13506. else if ("page" === a) a = d ? this.wb.height : this.wb.width, a *= this.scale, 0 !== a && (e = Math.max(a - (d ? this.mv : this.lv), 0), e *= c);
  13507. else {
  13508. if ("document" === a) {
  13509. e = this.kd;
  13510. d = this.wb;
  13511. c = D.P();
  13512. "up" === b ? this.position = c.n(d.x, e.y) : "left" === b ? this.position = c.n(e.x, d.y) : "down" === b ? this.position = c.n(d.x, e.bottom - d.height) : "right" === b && (this.position = c.n(e.right - d.width,
  13513. d.y));
  13514. D.A(c);
  13515. return
  13516. }
  13517. D.k("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: " + a)
  13518. }
  13519. e /= this.scale;
  13520. c = this.position.copy();
  13521. "up" === b ? c.y = this.position.y - e : "down" === b ? c.y = this.position.y + e : "left" === b ? c.x = this.position.x - e : "right" === b ? c.x = this.position.x + e : D.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: " + b);
  13522. this.position = c
  13523. };
  13524. E.prototype.scrollToRect = E.prototype.WG = function(a) {
  13525. var b = this.wb;
  13526. b.Sk(a) || (a = a.jm, a.x -= b.width / 2, a.y -= b.height / 2, this.position = a)
  13527. };
  13528. E.prototype.centerRect = E.prototype.eF = function(a) {
  13529. var b = this.wb;
  13530. a = a.jm;
  13531. a.x -= b.width / 2;
  13532. a.y -= b.height / 2;
  13533. this.position = a
  13534. };
  13535. E.prototype.transformDocToView = E.prototype.pC = function(a) {
  13536. var b = this.Nc;
  13537. b.reset();
  13538. 1 !== this.Db && b.scale(this.Db);
  13539. var c = this.sb;
  13540. (0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y);
  13541. return a.copy().transform(this.Nc)
  13542. };
  13543. E.prototype.transformViewToDoc = E.prototype.qC = function(a) {
  13544. var b = this.Nc;
  13545. b.reset();
  13546. 1 !== this.Db && b.scale(this.Db);
  13547. var c = this.sb;
  13548. (0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y);
  13549. return kb(a.copy(), this.Nc)
  13550. };
  13551. var Vh;
  13552. E.None = Vh = D.s(E, "None", 0);
  13553. var bm;
  13554. E.Uniform = bm = D.s(E, "Uniform", 1);
  13555. var cm;
  13556. E.UniformToFill = cm = D.s(E, "UniformToFill", 2);
  13557. var fj;
  13558. E.CycleAll = fj = D.s(E, "CycleAll", 10);
  13559. var jj;
  13560. E.CycleNotDirected = jj = D.s(E, "CycleNotDirected", 11);
  13561. var lj;
  13562. E.CycleNotDirectedFast = lj = D.s(E, "CycleNotDirectedFast", 12);
  13563. var mj;
  13564. E.CycleNotUndirected = mj = D.s(E, "CycleNotUndirected", 13);
  13565. var gj;
  13566. E.CycleDestinationTree = gj = D.s(E, "CycleDestinationTree", 14);
  13567. var ij;
  13568. E.CycleSourceTree = ij = D.s(E, "CycleSourceTree", 15);
  13569. var Cl;
  13570. E.DocumentScroll = Cl = D.s(E, "DocumentScroll", 1);
  13571. var Um;
  13572. E.InfiniteScroll = Um = D.s(E, "InfiniteScroll", 2);
  13573. var El;
  13574. E.TreeParentCollapsed = El = D.s(E, "TreeParentCollapsed", 21);
  13575. var jn;
  13576. E.AllParentsCollapsed = jn = D.s(E, "AllParentsCollapsed", 22);
  13577. var kn;
  13578. E.AnyParentsCollapsed = kn = D.s(E, "AnyParentsCollapsed", 23);
  13579. D.defineProperty(E, { KK: "validCycle" }, function() { return this.tx }, function(a) {
  13580. var b = this.tx;
  13581. b !== a && (D.Da(a, E, E, "validCycle"), this.tx = a, this.i("validCycle", b, a))
  13582. });
  13583. D.w(E, { ao: "layers" }, function() { return this.dc.j });
  13584. D.defineProperty(E, { Mf: "isModelReadOnly" }, function() { var a = this.ye; return null === a ? !1 : a.qb }, function(a) {
  13585. var b = this.ye;
  13586. null !== b && (b.qb = a)
  13587. });
  13588. D.defineProperty(E, { qb: "isReadOnly" }, function() { return this.dj }, function(a) {
  13589. var b = this.dj;
  13590. b !== a && (D.h(a, "boolean", E, "isReadOnly"), this.dj = a, this.i("isReadOnly", b, a))
  13591. });
  13592. D.defineProperty(E, { isEnabled: "isEnabled" }, function() { return this.rf }, function(a) {
  13593. var b = this.rf;
  13594. b !== a && (D.h(a, "boolean", E, "isEnabled"), this.rf = a, this.i("isEnabled", b, a))
  13595. });
  13596. D.defineProperty(E, { EA: "allowClipboard" }, function() { return this.Bv }, function(a) {
  13597. var b = this.Bv;
  13598. b !== a && (D.h(a, "boolean", E, "allowClipboard"), this.Bv = a, this.i("allowClipboard", b, a))
  13599. });
  13600. D.defineProperty(E, { Pk: "allowCopy" }, function() { return this.ll }, function(a) {
  13601. var b = this.ll;
  13602. b !== a && (D.h(a, "boolean", E, "allowCopy"), this.ll = a, this.i("allowCopy", b, a))
  13603. });
  13604. D.defineProperty(E, { Cn: "allowDelete" }, function() { return this.ml }, function(a) {
  13605. var b = this.ml;
  13606. b !== a && (D.h(a, "boolean", E, "allowDelete"), this.ml = a, this.i("allowDelete", b, a))
  13607. });
  13608. D.defineProperty(E, { du: "allowDragOut" }, function() { return this.Cv }, function(a) {
  13609. var b = this.Cv;
  13610. b !== a && (D.h(a, "boolean", E, "allowDragOut"), this.Cv = a, this.i("allowDragOut", b, a))
  13611. });
  13612. D.defineProperty(E, { XE: "allowDrop" }, function() { return this.Dv }, function(a) {
  13613. var b = this.Dv;
  13614. b !== a && (D.h(a, "boolean", E, "allowDrop"), this.Dv = a, this.i("allowDrop", b, a))
  13615. });
  13616. D.defineProperty(E, { Dx: "allowTextEdit" }, function() { return this.vl }, function(a) {
  13617. var b = this.vl;
  13618. b !== a && (D.h(a, "boolean", E, "allowTextEdit"), this.vl = a, this.i("allowTextEdit", b, a))
  13619. });
  13620. D.defineProperty(E, { Ax: "allowGroup" }, function() { return this.nl }, function(a) {
  13621. var b = this.nl;
  13622. b !== a && (D.h(a, "boolean", E, "allowGroup"), this.nl = a, this.i("allowGroup", b, a))
  13623. });
  13624. D.defineProperty(E, { Ex: "allowUngroup" }, function() { return this.wl }, function(a) {
  13625. var b = this.wl;
  13626. b !== a && (D.h(a, "boolean", E, "allowUngroup"), this.wl = a, this.i("allowUngroup", b, a))
  13627. });
  13628. D.defineProperty(E, { Zp: "allowInsert" }, function() { return this.Fv }, function(a) {
  13629. var b = this.Fv;
  13630. b !== a && (D.h(a, "boolean", E, "allowInsert"), this.Fv = a, this.i("allowInsert", b, a))
  13631. });
  13632. D.defineProperty(E, { eu: "allowLink" }, function() { return this.ol }, function(a) {
  13633. var b = this.ol;
  13634. b !== a && (D.h(a, "boolean", E, "allowLink"), this.ol = a, this.i("allowLink", b, a))
  13635. });
  13636. D.defineProperty(E, { Dn: "allowRelink" }, function() { return this.ql }, function(a) {
  13637. var b = this.ql;
  13638. b !== a && (D.h(a, "boolean", E, "allowRelink"), this.ql = a, this.i("allowRelink", b, a))
  13639. });
  13640. D.defineProperty(E, { fm: "allowMove" }, function() { return this.pl }, function(a) {
  13641. var b = this.pl;
  13642. b !== a && (D.h(a, "boolean", E, "allowMove"), this.pl = a, this.i("allowMove", b, a))
  13643. });
  13644. D.defineProperty(E, { Bx: "allowReshape" }, function() { return this.rl }, function(a) {
  13645. var b = this.rl;
  13646. b !== a && (D.h(a, "boolean", E, "allowReshape"), this.rl = a, this.i("allowReshape", b, a))
  13647. });
  13648. D.defineProperty(E, { fu: "allowResize" }, function() { return this.sl }, function(a) {
  13649. var b = this.sl;
  13650. b !== a && (D.h(a, "boolean", E, "allowResize"), this.sl = a, this.i("allowResize", b, a))
  13651. });
  13652. D.defineProperty(E, { Cx: "allowRotate" }, function() { return this.tl }, function(a) {
  13653. var b = this.tl;
  13654. b !== a && (D.h(a, "boolean", E, "allowRotate"), this.tl = a, this.i("allowRotate", b, a))
  13655. });
  13656. D.defineProperty(E, { Jf: "allowSelect" }, function() { return this.ul }, function(a) {
  13657. var b = this.ul;
  13658. b !== a && (D.h(a, "boolean", E, "allowSelect"), this.ul = a, this.i("allowSelect", b, a))
  13659. });
  13660. D.defineProperty(E, { YE: "allowUndo" }, function() { return this.Gv }, function(a) {
  13661. var b = this.Gv;
  13662. b !== a && (D.h(a, "boolean", E, "allowUndo"), this.Gv = a, this.i("allowUndo", b, a))
  13663. });
  13664. D.defineProperty(E, { Fx: "allowZoom" }, function() { return this.Iv }, function(a) {
  13665. var b = this.Iv;
  13666. b !== a && (D.h(a, "boolean", E, "allowZoom"), this.Iv = a, this.i("allowZoom", b, a))
  13667. });
  13668. D.defineProperty(E, { kB: "hasVerticalScrollbar" }, function() { return this.jw }, function(a) {
  13669. var b = this.jw;
  13670. b !== a && (D.h(a, "boolean", E, "hasVerticalScrollbar"), this.jw = a, im(this), this.ra(), this.i("hasVerticalScrollbar", b, a), Yl(this, !1))
  13671. });
  13672. D.defineProperty(E, { jB: "hasHorizontalScrollbar" }, function() { return this.iw }, function(a) {
  13673. var b = this.iw;
  13674. b !== a && (D.h(a, "boolean", E, "hasHorizontalScrollbar"), this.iw = a, im(this), this.ra(), this.i("hasHorizontalScrollbar", b, a), Yl(this, !1))
  13675. });
  13676. D.defineProperty(E, { Be: "allowHorizontalScroll" }, function() { return this.Ev }, function(a) {
  13677. var b = this.Ev;
  13678. b !== a && (D.h(a, "boolean", E, "allowHorizontalScroll"), this.Ev = a, this.i("allowHorizontalScroll", b, a), Yl(this, !1))
  13679. });
  13680. D.defineProperty(E, { Ce: "allowVerticalScroll" }, function() { return this.Hv }, function(a) {
  13681. var b = this.Hv;
  13682. b !== a && (D.h(a, "boolean", E, "allowVerticalScroll"), this.Hv = a, this.i("allowVerticalScroll", b, a), Yl(this, !1))
  13683. });
  13684. D.defineProperty(E, { lv: "scrollHorizontalLineChange" }, function() { return this.Yw }, function(a) {
  13685. var b = this.Yw;
  13686. b !== a && (D.h(a, "number", E, "scrollHorizontalLineChange"), 0 > a && D.ua(a, ">= 0", E, "scrollHorizontalLineChange"), this.Yw = a, this.i("scrollHorizontalLineChange", b, a))
  13687. });
  13688. D.defineProperty(E, { mv: "scrollVerticalLineChange" }, function() { return this.bx }, function(a) {
  13689. var b = this.bx;
  13690. b !== a && (D.h(a, "number", E, "scrollVerticalLineChange"), 0 > a && D.ua(a, ">= 0", E, "scrollVerticalLineChange"), this.bx = a, this.i("scrollVerticalLineChange", b, a))
  13691. });
  13692. D.defineProperty(E, { U: "lastInput" }, function() { return this.cc }, function(a) {
  13693. v && D.l(a, bg, E, "lastInput");
  13694. this.cc = a
  13695. });
  13696. D.defineProperty(E, { Pc: "firstInput" }, function() { return this.aj }, function(a) {
  13697. v && D.l(a, bg, E, "firstInput");
  13698. this.aj = a
  13699. });
  13700. D.defineProperty(E, { sc: "currentCursor" }, function() { return this.Sv }, function(a) {
  13701. "" === a && (a = this.Mr);
  13702. var b = this.Sv;
  13703. if (b !== a) {
  13704. D.h(a, "string", E, "currentCursor");
  13705. var c = this.Ib,
  13706. d = this.Ub;
  13707. null !== c && (this.Sv = a, c.style.cursor = a, d.style.cursor = a, c.style.cursor === b && (c.style.cursor = "-webkit-" + a, d.style.cursor = "-webkit-" + a, c.style.cursor === b && (c.style.cursor = "-moz-" + a, d.style.cursor = "-moz-" + a, c.style.cursor === b && (c.style.cursor = a, d.style.cursor = a))))
  13708. }
  13709. });
  13710. D.defineProperty(E, { zL: "defaultCursor" }, function() { return this.Mr }, function(a) {
  13711. "" === a && (a = "auto");
  13712. var b = this.Mr;
  13713. b !== a && (D.h(a, "string", E, "defaultCursor"), this.Mr = a, this.i("defaultCursor", b, a))
  13714. });
  13715. D.defineProperty(E, { click: "click" }, function() { return this.Ri }, function(a) {
  13716. var b = this.Ri;
  13717. b !== a && (null !== a && D.h(a, "function", E, "click"), this.Ri = a, this.i("click", b, a))
  13718. });
  13719. D.defineProperty(E, { nu: "doubleClick" }, function() { return this.Yi }, function(a) {
  13720. var b = this.Yi;
  13721. b !== a && (null !== a && D.h(a, "function", E, "doubleClick"), this.Yi = a, this.i("doubleClick", b, a))
  13722. });
  13723. D.defineProperty(E, { MA: "contextClick" }, function() { return this.Ti }, function(a) {
  13724. var b = this.Ti;
  13725. b !== a && (null !== a && D.h(a, "function", E, "contextClick"), this.Ti = a, this.i("contextClick", b, a))
  13726. });
  13727. D.defineProperty(E, { FB: "mouseOver" }, function() { return this.nj }, function(a) {
  13728. var b = this.nj;
  13729. b !== a && (null !== a && D.h(a, "function", E, "mouseOver"), this.nj = a, this.i("mouseOver", b, a))
  13730. });
  13731. D.defineProperty(E, { EB: "mouseHover" }, function() { return this.mj }, function(a) {
  13732. var b = this.mj;
  13733. b !== a && (null !== a && D.h(a, "function", E, "mouseHover"), this.mj = a, this.i("mouseHover", b, a))
  13734. });
  13735. D.defineProperty(E, { DB: "mouseHold" }, function() { return this.lj }, function(a) {
  13736. var b = this.lj;
  13737. b !== a && (null !== a && D.h(a, "function", E, "mouseHold"), this.lj = a, this.i("mouseHold", b, a))
  13738. });
  13739. D.defineProperty(E, { TJ: "mouseDragOver" }, function() { return this.Jw }, function(a) {
  13740. var b = this.Jw;
  13741. b !== a && (null !== a && D.h(a, "function", E, "mouseDragOver"), this.Jw = a, this.i("mouseDragOver", b, a))
  13742. });
  13743. D.defineProperty(E, { CB: "mouseDrop" }, function() { return this.kj }, function(a) {
  13744. var b = this.kj;
  13745. b !== a && (null !== a && D.h(a, "function", E, "mouseDrop"), this.kj = a, this.i("mouseDrop", b, a))
  13746. });
  13747. D.defineProperty(E, { lC: "toolTip" }, function() { return this.wj }, function(a) {
  13748. var b = this.wj;
  13749. b !== a && (!v || null === a || a instanceof da || a instanceof hk || D.k("Diagram.toolTip must be an Adornment or HTMLInfo."), this.wj = a, this.i("toolTip", b, a))
  13750. });
  13751. D.defineProperty(E, { contextMenu: "contextMenu" }, function() { return this.Ui }, function(a) {
  13752. var b = this.Ui;
  13753. b !== a && (!v || a instanceof da || a instanceof hk || D.k("Diagram.contextMenu must be an Adornment or HTMLInfo."), this.Ui = a, this.i("contextMenu", b, a))
  13754. });
  13755. D.defineProperty(E, { yb: "commandHandler" }, function() { return this.wz }, function(a) {
  13756. var b = this.wz;
  13757. b !== a && (D.l(a, qa, E, "commandHandler"), null !== a.g && D.k("Cannot share CommandHandlers between Diagrams: " + a.toString()), null !== b && b.ad(null), this.wz = a, a.ad(this))
  13758. });
  13759. D.defineProperty(E, { nb: "toolManager" }, function() { return this.wA }, function(a) {
  13760. var b = this.wA;
  13761. b !== a && (D.l(a, Ph, E, "toolManager"), null !== a.g && D.k("Cannot share ToolManagers between Diagrams: " + a.toString()), null !== b && b.ad(null), this.wA = a, a.ad(this))
  13762. });
  13763. D.defineProperty(E, { mu: "defaultTool" }, function() { return this.Cz }, function(a) {
  13764. var b = this.Cz;
  13765. b !== a && (D.l(a, Zg, E, "defaultTool"), this.Cz = a, this.eb === b && (this.eb = a))
  13766. });
  13767. D.defineProperty(E, { eb: "currentTool" }, function() { return this.zz }, function(a) {
  13768. var b = this.zz;
  13769. null !== b && (b.wa && b.doDeactivate(), b.cancelWaitAfter(), b.doStop());
  13770. null === a && (a = this.mu);
  13771. null !== a && (D.l(a, Zg, E, "currentTool"), this.zz = a, a.ad(this), a.doStart())
  13772. });
  13773. D.w(E, { selection: "selection" }, function() { return this.ix });
  13774. D.defineProperty(E, { KJ: "maxSelectionCount" }, function() { return this.Ew }, function(a) {
  13775. var b = this.Ew;
  13776. if (b !== a)
  13777. if (D.h(a, "number", E, "maxSelectionCount"), 0 <= a && !isNaN(a)) {
  13778. if (this.Ew = a, this.i("maxSelectionCount", b, a), !this.na.ub && (a = this.selection.count - a, 0 < a)) {
  13779. this.Ja("ChangingSelection");
  13780. for (var b = this.selection.Fc(), c = 0; c < a; c++) b[c].ib = !1;
  13781. this.Ja("ChangedSelection")
  13782. }
  13783. } else D.ua(a, ">= 0", E, "maxSelectionCount")
  13784. });
  13785. D.defineProperty(E, { WJ: "nodeSelectionAdornmentTemplate" }, function() { return this.Kw }, function(a) {
  13786. var b = this.Kw;
  13787. b !== a && (D.l(a, da, E, "nodeSelectionAdornmentTemplate"), this.Kw = a, this.i("nodeSelectionAdornmentTemplate", b, a))
  13788. });
  13789. D.defineProperty(E, { bJ: "groupSelectionAdornmentTemplate" }, function() { return this.gw }, function(a) {
  13790. var b = this.gw;
  13791. b !== a && (D.l(a, da, E, "groupSelectionAdornmentTemplate"), this.gw = a, this.i("groupSelectionAdornmentTemplate", b, a))
  13792. });
  13793. D.defineProperty(E, { EJ: "linkSelectionAdornmentTemplate" }, function() { return this.zw }, function(a) {
  13794. var b = this.zw;
  13795. b !== a && (D.l(a, da, E, "linkSelectionAdornmentTemplate"), this.zw = a, this.i("linkSelectionAdornmentTemplate", b, a))
  13796. });
  13797. D.w(E, { vm: "highlighteds" }, function() { return this.kw });
  13798. D.defineProperty(E, { Gi: "isModified" }, function() { var a = this.na; return a.isEnabled ? null !== a.Gj ? !0 : this.qw && this.rh !== a.Lj : this.qw }, function(a) {
  13799. if (this.qw !== a) {
  13800. D.h(a, "boolean", E, "isModified");
  13801. this.qw = a;
  13802. var b = this.na;
  13803. !a && b.isEnabled && (this.rh = b.Lj);
  13804. a || ln(this)
  13805. }
  13806. });
  13807. function ln(a) {
  13808. var b = a.Gi;
  13809. a.NE !== b && (a.NE = b, a.Ja("Modified"))
  13810. }
  13811. D.defineProperty(E, { ea: "model" }, function() { return this.ye }, function(a) {
  13812. var b = this.ye;
  13813. if (b !== a) {
  13814. D.l(a, M, E, "model");
  13815. this.eb.doCancel();
  13816. null !== b && b.na !== a.na && b.na.jG && D.k("Do not replace a Diagram.model while a transaction is in progress.");
  13817. this.Ra.Yh();
  13818. this.Ix();
  13819. this.sh = !1;
  13820. this.bp = !0;
  13821. this.rh = -2;
  13822. this.cg = !1;
  13823. var c = this.je;
  13824. this.je = !0;
  13825. this.Ra.po("Model");
  13826. null !== b && (null !== this.xh && this.xh.each(function(a) { b.gv(a) }), b.gv(this.WD), b instanceof Y && mn(this, b.$g), mn(this, b.qg));
  13827. this.ye = a;
  13828. a.Bn(this.VD);
  13829. nn(this,
  13830. a.qg);
  13831. a instanceof Y && on(this, a.$g);
  13832. a.gv(this.VD);
  13833. a.Bn(this.WD);
  13834. null !== this.xh && this.xh.each(function(b) { a.Bn(b) });
  13835. this.je = c;
  13836. this.ed || this.ra();
  13837. null !== b && (a.na.isEnabled = b.na.isEnabled)
  13838. }
  13839. });
  13840. D.defineProperty(E, { $a: null }, function() { return this.OD }, function(a) { this.OD = a });
  13841. D.w(E, { ty: null }, function() { return this.HH });
  13842. function Gl(a, b) {
  13843. if (b.ea === a.ea) {
  13844. var c = b.Oc,
  13845. d = b.propertyName;
  13846. if (c === gg && "S" === d[0])
  13847. if ("StartingFirstTransaction" === d) c = a.nb, c.qf.each(function(b) { b.ad(a) }), c.mg.each(function(b) { b.ad(a) }), c.ng.each(function(b) { b.ad(a) }), a.je || a.sh || (a.Sr = !0, a.bp && (a.cg = !0));
  13848. else if ("StartingUndo" === d || "StartingRedo" === d) {
  13849. var e = a.Ra;
  13850. e.nf && !a.kb && e.Yh();
  13851. a.Ja("ChangingSelection")
  13852. } else "StartedTransaction" === d && (e = a.Ra, e.nf && !a.kb && e.Yh());
  13853. else if (a.$a) {
  13854. a.$a = !1;
  13855. try {
  13856. var g = b.Cf;
  13857. if ("" !== g)
  13858. if (c === fg) {
  13859. if ("linkFromKey" === g) {
  13860. var h =
  13861. b.object,
  13862. k = a.gg(h);
  13863. if (null !== k) {
  13864. var l = b.newValue,
  13865. m = a.Se(l);
  13866. k.$ = m
  13867. }
  13868. } else if ("linkToKey" === g) h = b.object, k = a.gg(h), null !== k && (l = b.newValue, m = a.Se(l), k.ba = m);
  13869. else if ("linkFromPortId" === g) { if (h = b.object, k = a.gg(h), null !== k) { var n = b.newValue; "string" === typeof n && (k.hg = n) } } else if ("linkToPortId" === g) h = b.object, k = a.gg(h), null !== k && (n = b.newValue, "string" === typeof n && (k.jh = n));
  13870. else if ("nodeGroupKey" === g) {
  13871. var h = b.object,
  13872. p = a.Nh(h);
  13873. if (null !== p) {
  13874. var q = b.newValue;
  13875. if (void 0 !== q) {
  13876. var r = a.Se(q);
  13877. p.Ka = r instanceof I ? r :
  13878. null
  13879. } else p.Ka = null
  13880. }
  13881. } else if ("linkLabelKeys" === g) {
  13882. if (h = b.object, k = a.gg(h), null !== k) {
  13883. var s = b.oldValue,
  13884. u = b.newValue;
  13885. if (D.isArray(s))
  13886. for (var t = D.cb(s), y = 0; y < t; y++) {
  13887. var w = D.La(s, y),
  13888. m = a.Se(w);
  13889. null !== m && (m.Xb = null)
  13890. }
  13891. if (D.isArray(u))
  13892. for (t = D.cb(u), y = 0; y < t; y++) w = D.La(u, y), m = a.Se(w), null !== m && (m.Xb = k)
  13893. }
  13894. } else if ("nodeParentKey" === g) {
  13895. var A = b.object,
  13896. B = a.Se(b.newValue),
  13897. P = a.Xx(A);
  13898. if (null !== P) {
  13899. var H = P.Qn();
  13900. null !== H ? null === B ? a.remove(H) : a.ee ? H.$ = B : H.ba = B : pn(a, B, P)
  13901. }
  13902. } else if ("parentLinkCategory" === g) {
  13903. var A = b.object,
  13904. P =
  13905. a.Xx(A),
  13906. R = b.newValue;
  13907. null !== P && "string" === typeof R && (H = P.Qn(), null !== H && (H.Kd = R))
  13908. } else if ("nodeCategory" === g) {
  13909. var h = b.object,
  13910. aa = a.Nh(h),
  13911. R = b.newValue;
  13912. null !== aa && "string" === typeof R && (aa.Kd = R)
  13913. } else if ("linkCategory" === g) {
  13914. var h = b.object,
  13915. V = a.gg(h),
  13916. R = b.newValue;
  13917. null !== V && "string" === typeof R && (V.Kd = R)
  13918. } else if ("nodeDataArray" === g) {
  13919. var ea = b.oldValue;
  13920. mn(a, ea);
  13921. var la = b.newValue;
  13922. nn(a, la)
  13923. } else "linkDataArray" === g && (ea = b.oldValue, mn(a, ea), la = b.newValue, on(a, la));
  13924. a.Gi = !0
  13925. } else c === hg ? (la = b.newValue, "nodeDataArray" ===
  13926. g && D.Qa(la) ? qn(a, la) : "linkDataArray" === g && D.Qa(la) ? rn(a, la) : "linkLabelKeys" === g && ch(la) && (k = a.gg(b.object), m = a.Se(la), null !== k && null !== m && (m.Xb = k)), a.Gi = !0) : c === ig ? (ea = b.oldValue, "nodeDataArray" === g && D.Qa(ea) ? sn(a, ea) : "linkDataArray" === g && D.Qa(ea) ? sn(a, ea) : "linkLabelKeys" === g && ch(ea) && (m = a.Se(ea), null !== m && (m.Xb = null)), a.Gi = !0) : c === gg && ("SourceChanged" === g ? null !== b.object ? Fl(a, b.object, b.propertyName) : (a.JK(), a.vH()) : "ModelDisplaced" === g && a.zm());
  13927. else if (c === fg) {
  13928. var Da = b.propertyName,
  13929. h = b.object;
  13930. if (h ===
  13931. a.ea) { if ("nodeKeyProperty" === Da || "nodeCategoryProperty" === Da || "linkFromKeyProperty" === Da || "linkToKeyProperty" === Da || "linkFromPortIdProperty" === Da || "linkToPortIdProperty" === Da || "linkLabelKeysProperty" === Da || "nodeIsGroupProperty" === Da || "nodeGroupKeyProperty" === Da || "nodeParentKeyProperty" === Da || "linkCategoryProperty" === Da) a.na.ub || a.zm() } else Fl(a, h, Da);
  13932. a.Gi = !0
  13933. } else if (c === hg || c === ig) tn(a, b), a.Gi = !0;
  13934. else if (c === gg) {
  13935. if ("FinishedUndo" === d || "FinishedRedo" === d) a.Ja("ChangedSelection"), Si(a);
  13936. e = a.Ra;
  13937. "RolledBackTransaction" ===
  13938. d && e.Yh();
  13939. a.Sr = !0;
  13940. a.lg();
  13941. 0 === a.na.Ki && el(e);
  13942. "CommittedTransaction" === d && a.na.$z && (a.rh = Math.min(a.rh, a.na.Lj - 1));
  13943. var La = b.nG;
  13944. La && (ln(a), a.ty.clear());
  13945. !a.fA && La && (a.fA = !0, D.setTimeout(function() {
  13946. a.eb.standardMouseOver();
  13947. a.fA = !1
  13948. }, 10))
  13949. }
  13950. } finally { a.$a = !0 }
  13951. }
  13952. }
  13953. }
  13954. function Fl(a, b, c) {
  13955. if ("string" === typeof c) {
  13956. var d = a.Nh(b);
  13957. if (null !== d) d.Ob(c), a.ea instanceof Bg && (d = a.gg(b), null !== d && d.Ob(c));
  13958. else {
  13959. for (var d = null, e = a.Zm.j; e.next();) {
  13960. for (var g = e.value, h = 0; h < g.length; h++) {
  13961. var k = g[h].MI(b);
  13962. null !== k && (null === d && (d = D.mb()), d.push(k))
  13963. }
  13964. if (null !== d) break
  13965. }
  13966. if (null !== d) {
  13967. for (e = 0; e < d.length; e++) d[e].Ob(c);
  13968. D.ya(d)
  13969. }
  13970. }
  13971. b === a.ea.fl && a.vH(c)
  13972. }
  13973. }
  13974. D.defineProperty(E, { Xe: "skipsModelSourceBindings" }, function() { return this.pE }, function(a) { this.pE = a });
  13975. D.defineProperty(E, { rv: null }, function() { return this.rA }, function(a) { this.rA = a });
  13976. function tn(a, b) {
  13977. var c = b.Oc === hg,
  13978. d = c ? b.Uj : b.Wj,
  13979. e = c ? b.newValue : b.oldValue,
  13980. g = a.Zm.oa(b.object);
  13981. if (Array.isArray(g))
  13982. for (var h = 0; h < g.length; h++) {
  13983. var k = g[h];
  13984. if (c) un(k, e, d);
  13985. else {
  13986. var l = d;
  13987. if (!(0 > l)) {
  13988. var m = l;
  13989. vn(k) && m++;
  13990. k.yf(m, !0);
  13991. wn(k, m, l)
  13992. }
  13993. }
  13994. }
  13995. }
  13996. function Zm(a, b) {
  13997. var c = b.ej;
  13998. if (D.isArray(c)) {
  13999. var d = a.Zm.oa(c);
  14000. if (null === d) d = [], d.push(b), a.Zm.add(c, d);
  14001. else {
  14002. for (c = 0; c < d.length; c++)
  14003. if (d[c] === b) return;
  14004. d.push(b)
  14005. }
  14006. }
  14007. }
  14008. function cn(a, b) {
  14009. var c = b.ej;
  14010. if (D.isArray(c)) {
  14011. var d = a.Zm.oa(c);
  14012. if (null !== d)
  14013. for (var e = 0; e < d.length; e++)
  14014. if (d[e] === b) {
  14015. d.splice(e, 1);
  14016. 0 === d.length && a.Zm.remove(c);
  14017. break
  14018. }
  14019. }
  14020. }
  14021. function Ym(a, b) {
  14022. for (var c = b.xa.o, d = c.length, e = 0; e < d; e++) {
  14023. var g = c[e];
  14024. g instanceof Hl && xn(a, g)
  14025. }
  14026. }
  14027. function xn(a, b) {
  14028. var c = b.element;
  14029. if (null !== c && c instanceof HTMLImageElement) {
  14030. var d = b.af;
  14031. null !== d && (d.ep instanceof Event && null !== b.bf && b.bf(b, d.ep), !0 === d.ps && (null !== b.zi && b.zi(b, d.mA), null !== b.g && b.g.iA.add(b)));
  14032. c = c.src;
  14033. d = a.Cp.oa(c);
  14034. if (null === d) d = [], d.push(b), a.Cp.add(c, d);
  14035. else {
  14036. for (c = 0; c < d.length; c++)
  14037. if (d[c] === b) return;
  14038. d.push(b)
  14039. }
  14040. }
  14041. }
  14042. function bn(a, b) {
  14043. for (var c = b.xa.o, d = c.length, e = 0; e < d; e++) {
  14044. var g = c[e];
  14045. g instanceof Hl && yn(a, g)
  14046. }
  14047. }
  14048. function yn(a, b) {
  14049. var c = b.element;
  14050. if (null !== c && c instanceof HTMLImageElement) {
  14051. var c = c.src,
  14052. d = a.Cp.oa(c);
  14053. if (null !== d)
  14054. for (var e = 0; e < d.length; e++)
  14055. if (d[e] === b) {
  14056. d.splice(e, 1);
  14057. 0 === d.length && a.Cp.remove(c);
  14058. break
  14059. }
  14060. }
  14061. }
  14062. E.prototype.rebuildParts = E.prototype.zm = function() {
  14063. for (var a = this.JB.j; a.next();) {
  14064. var b = a.value,
  14065. c = a.key;
  14066. (!b.qe() || b instanceof I) && D.k('Invalid node template in Diagram.nodeTemplateMap: template for "' + c + '" must be a Node or a simple Part, not a Group or Link: ' + b)
  14067. }
  14068. for (a = this.iB.j; a.next();) b = a.value, c = a.key, b instanceof I || D.k('Invalid group template in Diagram.groupTemplateMap: template for "' + c + '" must be a Group, not a normal Node or Link: ' + b);
  14069. for (a = this.xB.j; a.next();) b = a.value, c = a.key, b instanceof
  14070. J || D.k('Invalid link template in Diagram.linkTemplateMap: template for "' + c + '" must be a Link, not a normal Node or simple Part: ' + b);
  14071. a = D.mb();
  14072. for (b = this.selection.j; b.next();)(c = b.value.data) && a.push(c);
  14073. for (var b = D.mb(), d = this.vm.j; d.next();)(c = d.value.data) && b.push(c);
  14074. c = D.mb();
  14075. for (d = this.rg.j; d.next();) {
  14076. var e = d.value;
  14077. null !== e.data && (c.push(e.data), c.push(e.location))
  14078. }
  14079. for (d = this.links.j; d.next();) e = d.value, null !== e.data && (c.push(e.data), c.push(e.location));
  14080. for (d = this.Hi.j; d.next();) e = d.value, null !==
  14081. e.data && (c.push(e.data), c.push(e.location));
  14082. d = this.ea;
  14083. d instanceof Y && mn(this, d.$g);
  14084. mn(this, d.qg);
  14085. nn(this, d.qg);
  14086. d instanceof Y && on(this, d.$g);
  14087. for (d = 0; d < a.length; d++) e = this.Nh(a[d]), null !== e && (e.ib = !0);
  14088. for (d = 0; d < b.length; d++) e = this.Nh(b[d]), null !== e && (e.Zg = !0);
  14089. for (d = 0; d < c.length; d += 2) e = this.Nh(c[d]), null !== e && (e.location = c[d + 1]);
  14090. D.ya(a);
  14091. D.ya(b);
  14092. D.ya(c)
  14093. };
  14094. function nn(a, b) {
  14095. if (null !== b) {
  14096. for (var c = a.ea, d = c instanceof Y, e = D.cb(b), g = 0; g < e; g++) {
  14097. var h = D.La(b, g);
  14098. c.ke(h) ? qn(a, h, !1) : d && rn(a, h)
  14099. }
  14100. if (d || c instanceof Bg) {
  14101. for (g = 0; g < e; g++) h = D.La(b, g), c.ke(h) && zn(a, h);
  14102. if (d)
  14103. for (c = a.links; c.next();) An(c.value)
  14104. }
  14105. Bn(a, !1)
  14106. }
  14107. }
  14108. function qn(a, b, c) {
  14109. if (void 0 !== b && null !== b && !a.na.ub && !a.Vi.contains(b)) {
  14110. void 0 === c && (c = !0);
  14111. var d = a.eB(b),
  14112. e = Cn(a, b, d);
  14113. if (null !== e && (Sh(e), e = e.copy(), null !== e)) {
  14114. var g = a.Xe;
  14115. a.Xe = !0;
  14116. e.Pi = d;
  14117. e.Sd = b;
  14118. a.add(e);
  14119. e.Sd = null;
  14120. e.data = b;
  14121. c && zn(a, b);
  14122. a.Xe = g
  14123. }
  14124. }
  14125. }
  14126. E.prototype.eB = function(a) { return this.ea.eB(a) };
  14127. var Dn = !1,
  14128. En = !1;
  14129. function Cn(a, b, c) {
  14130. var d = !1,
  14131. e = a.ea;
  14132. e instanceof Y && (d = e.sB(b));
  14133. d ? (b = a.iB.oa(c), null === b && (b = a.iB.oa(""), null === b && (En || (En = !0, D.trace('No Group template found for category "' + c + '"'), D.trace(" Using default group template")), b = a.eD))) : (b = a.JB.oa(c), null === b && (b = a.JB.oa(""), null === b && (Dn || (Dn = !0, D.trace('No Node template found for category "' + c + '"'), D.trace(" Using default node template")), b = a.gD)));
  14134. return b
  14135. }
  14136. function zn(a, b) {
  14137. var c = a.ea;
  14138. if (c instanceof Y || c instanceof Bg) {
  14139. var d = c.zb(b);
  14140. if (void 0 !== d) {
  14141. var e = fh(c, d),
  14142. g = a.Nh(b);
  14143. if (null !== e && null !== g) {
  14144. for (e = e.j; e.next();) {
  14145. var h = e.value;
  14146. if (c instanceof Y) {
  14147. var k = c;
  14148. if (k.ke(h)) {
  14149. if (g instanceof I && k.Sn(h) === d) {
  14150. var l = g,
  14151. h = a.Nh(h);
  14152. null !== h && (h.Ka = l)
  14153. }
  14154. } else {
  14155. var m = a.gg(h);
  14156. if (null !== m && g instanceof G && (l = g, k.tm(h) === d && (m.$ = l), k.um(h) === d && (m.ba = l), h = k.$k(h), D.isArray(h)))
  14157. for (k = 0; k < D.cb(h); k++)
  14158. if (D.La(h, k) === d) { l.Xb = m; break }
  14159. }
  14160. } else c instanceof Bg && (m = c, m.ke(h) && g instanceof G && (l = g, m.Un(h) === d && (h = a.Xx(h), pn(a, l, h))))
  14161. }
  14162. hh(c, d)
  14163. }
  14164. c instanceof Y ? (c = c.Sn(b), void 0 !== c && (c = a.Se(c), c instanceof I && (g.Ka = c))) : c instanceof Bg && (c = c.Un(b), void 0 !== c && g instanceof G && (l = g, g = a.Se(c), pn(a, g, l)))
  14165. }
  14166. }
  14167. }
  14168. function pn(a, b, c) {
  14169. if (null !== b && null !== c) {
  14170. var d = a.nb.uG,
  14171. e = b,
  14172. g = c;
  14173. if (a.ee)
  14174. for (b = g.Od; b.next();) { if (b.value.ba === g) return } else
  14175. for (e = c, g = b, b = e.Od; b.next();)
  14176. if (b.value.$ === e) return;
  14177. if (null === d || !hj(d, e, g, null, !0))
  14178. if (d = a.Bu(c.data), b = rj(a, d), null !== b && (Sh(b), b = b.copy(), null !== b)) {
  14179. var h = a.Xe;
  14180. a.Xe = !0;
  14181. b.Pi = d;
  14182. b.Sd = c.data;
  14183. b.$ = e;
  14184. b.ba = g;
  14185. a.add(b);
  14186. b.Sd = null;
  14187. b.data = c.data;
  14188. a.Xe = h
  14189. }
  14190. }
  14191. }
  14192. function on(a, b) {
  14193. if (null !== b) {
  14194. for (var c = D.cb(b), d = 0; d < c; d++) {
  14195. var e = D.La(b, d);
  14196. rn(a, e)
  14197. }
  14198. Bn(a, !1)
  14199. }
  14200. }
  14201. function rn(a, b) {
  14202. if (void 0 !== b && null !== b && !a.na.ub && !a.gk.contains(b)) {
  14203. var c = a.Bu(b),
  14204. d = rj(a, c);
  14205. if (null !== d && (Sh(d), d = d.copy(), null !== d)) {
  14206. var e = a.Xe;
  14207. a.Xe = !0;
  14208. d.Pi = c;
  14209. d.Sd = b;
  14210. var c = a.ea,
  14211. g = c.UI(b);
  14212. "" !== g && (d.hg = g);
  14213. g = c.tm(b);
  14214. void 0 !== g && (g = a.Se(g), g instanceof G && (d.$ = g));
  14215. g = c.YI(b);
  14216. "" !== g && (d.jh = g);
  14217. g = c.um(b);
  14218. void 0 !== g && (g = a.Se(g), g instanceof G && (d.ba = g));
  14219. c = c.$k(b);
  14220. if (D.isArray(c))
  14221. for (var g = D.cb(c), h = 0; h < g; h++) {
  14222. var k = D.La(c, h),
  14223. k = a.Se(k);
  14224. null !== k && (k.Xb = d)
  14225. }
  14226. a.add(d);
  14227. d.Sd = null;
  14228. d.data = b;
  14229. a.Xe = e
  14230. }
  14231. }
  14232. }
  14233. E.prototype.Bu = function(a) {
  14234. var b = this.ea,
  14235. c = "";
  14236. b instanceof Y ? c = b.Bu(a) : b instanceof Bg && (c = b.WI(a));
  14237. return c
  14238. };
  14239. var Fn = !1;
  14240. function rj(a, b) {
  14241. var c = a.xB.oa(b);
  14242. null === c && (c = a.xB.oa(""), null === c && (Fn || (Fn = !0, D.trace('No Link template found for category "' + b + '"'), D.trace(" Using default link template")), c = a.fD));
  14243. return c
  14244. }
  14245. function mn(a, b) {
  14246. for (var c = D.cb(b), d = 0; d < c; d++) {
  14247. var e = D.La(b, d);
  14248. sn(a, e)
  14249. }
  14250. }
  14251. function sn(a, b) {
  14252. if (void 0 !== b && null !== b) {
  14253. var c = a.Nh(b);
  14254. if (null !== c) {
  14255. dn(a, c, !1);
  14256. var d = a.ea;
  14257. if (d instanceof Y && c instanceof G) {
  14258. var e = d.zb(c.data);
  14259. if (void 0 !== e) {
  14260. for (var g = c.Od; g.next();) gh(d, e, g.value.data);
  14261. c.Lf && (g = c.Xb, null !== g && gh(d, e, g.data));
  14262. if (c instanceof I)
  14263. for (c = c.uc; c.next();) g = c.value.data, d.ke(g) && gh(d, e, g)
  14264. }
  14265. } else if (d instanceof Bg && c instanceof G) {
  14266. g = a.gg(c.data);
  14267. if (null !== g) {
  14268. g.ib = !1;
  14269. g.Zg = !1;
  14270. var h = g.layer;
  14271. if (null !== h) {
  14272. var k = h.yf(-1, g, !1);
  14273. 0 <= k && a.od(ig, "parts", h, g, null, k, null);
  14274. k = g.py;
  14275. null !==
  14276. k && k(g, h, null)
  14277. }
  14278. }
  14279. g = a.ee;
  14280. for (c = c.Od; c.next();) h = c.value, h = (g ? h.ba : h.$).data, d.ke(h) && gh(d, e, h)
  14281. }
  14282. }
  14283. }
  14284. }
  14285. E.prototype.findPartForKey = E.prototype.NI = function(a) { if (null === a || void 0 === a) return null; var b = this.ea.Ie(a); return null !== b ? this.Vi.oa(b) : this.ea instanceof Y && (b = this.ea.oq(a), null !== b) ? this.gk.oa(b) : null };
  14286. E.prototype.findNodeForKey = E.prototype.Se = function(a) {
  14287. if (null === a || void 0 === a) return null;
  14288. a = this.ea.Ie(a);
  14289. if (null === a) return null;
  14290. a = this.Vi.oa(a);
  14291. return a instanceof G ? a : null
  14292. };
  14293. E.prototype.findPartForData = E.prototype.Nh = function(a) { if (null === a) return null; var b = this.Vi.oa(a); return null !== b ? b : b = this.gk.oa(a) };
  14294. E.prototype.findNodeForData = E.prototype.Xx = function(a) {
  14295. if (null === a) return null;
  14296. a = this.Vi.oa(a);
  14297. return a instanceof G ? a : null
  14298. };
  14299. E.prototype.findLinkForData = E.prototype.gg = function(a) { return null === a ? null : this.gk.oa(a) };
  14300. E.prototype.findNodesByExample = function(a) {
  14301. for (var b = new L(G), c = this.Ap.j; c.next();) {
  14302. var d = c.value,
  14303. e = d.data;
  14304. if (null !== e)
  14305. for (var g = 0; g < arguments.length; g++) { var h = arguments[g]; if (D.Qa(h) && Gn(this, e, h)) { b.add(d); break } }
  14306. }
  14307. return b.j
  14308. };
  14309. E.prototype.findLinksByExample = function(a) {
  14310. for (var b = new L(J), c = this.tp.j; c.next();) {
  14311. var d = c.value,
  14312. e = d.data;
  14313. if (null !== e)
  14314. for (var g = 0; g < arguments.length; g++) { var h = arguments[g]; if (D.Qa(h) && Gn(this, e, h)) { b.add(d); break } }
  14315. }
  14316. return b.j
  14317. };
  14318. function Gn(a, b, c) {
  14319. for (var d in c) {
  14320. var e = b[d],
  14321. g = c[d];
  14322. if (D.isArray(g)) {
  14323. if (!D.isArray(e) || e.length < g.length) return !1;
  14324. for (var h = 0; h < e.length; h++) {
  14325. var k = e[h],
  14326. l = g[h];
  14327. if (void 0 !== l && !Hn(a, k, l)) return !1
  14328. }
  14329. } else if (!Hn(a, e, g)) return !1
  14330. }
  14331. return !0
  14332. }
  14333. function Hn(a, b, c) { if ("function" === typeof c) { if (!c(b)) return !1 } else if (c instanceof RegExp) { if (!b || !c.test(b.toString())) return !1 } else if (D.Qa(b) && D.Qa(c)) { if (!Gn(a, b, c)) return !1 } else if (b !== c) return !1; return !0 }
  14334. D.defineProperty(E, { mM: "nodeTemplate" }, function() { return this.oj.oa("") }, function(a) {
  14335. var b = this.oj.oa("");
  14336. b !== a && (D.l(a, F, E, "nodeTemplate"), this.oj.add("", a), this.i("nodeTemplate", b, a), this.na.ub || this.zm())
  14337. });
  14338. D.defineProperty(E, { JB: "nodeTemplateMap" }, function() { return this.oj }, function(a) {
  14339. var b = this.oj;
  14340. b !== a && (D.l(a, oa, E, "nodeTemplateMap"), this.oj = a, this.i("nodeTemplateMap", b, a), this.na.ub || this.zm())
  14341. });
  14342. D.defineProperty(E, { SL: "groupTemplate" }, function() { return this.El.oa("") }, function(a) {
  14343. var b = this.El.oa("");
  14344. b !== a && (D.l(a, I, E, "groupTemplate"), this.El.add("", a), this.i("groupTemplate", b, a), this.na.ub || this.zm())
  14345. });
  14346. D.defineProperty(E, { iB: "groupTemplateMap" }, function() { return this.El }, function(a) {
  14347. var b = this.El;
  14348. b !== a && (D.l(a, oa, E, "groupTemplateMap"), this.El = a, this.i("groupTemplateMap", b, a), this.na.ub || this.zm())
  14349. });
  14350. D.defineProperty(E, { aM: "linkTemplate" }, function() { return this.xk.oa("") }, function(a) {
  14351. var b = this.xk.oa("");
  14352. b !== a && (D.l(a, J, E, "linkTemplate"), this.xk.add("", a), this.i("linkTemplate", b, a), this.na.ub || this.zm())
  14353. });
  14354. D.defineProperty(E, { xB: "linkTemplateMap" }, function() { return this.xk }, function(a) {
  14355. var b = this.xk;
  14356. b !== a && (D.l(a, oa, E, "linkTemplateMap"), this.xk = a, this.i("linkTemplateMap", b, a), this.na.ub || this.zm())
  14357. });
  14358. D.defineProperty(E, { rJ: null }, function() { return this.th }, function(a) { this.th = a });
  14359. D.defineProperty(E, { of: "isMouseCaptured" }, function() { return this.LD }, function(a) {
  14360. var b = this.Ib;
  14361. null !== b && (a ? (this.U.bubbles = !1, this.mz ? (b.removeEventListener("pointermove", this.Kq, !1), b.removeEventListener("pointerdown", this.Jq, !1), b.removeEventListener("pointerup", this.Mq, !1), b.removeEventListener("pointerout", this.Lq, !1), window.addEventListener("pointermove", this.Kq, !0), window.addEventListener("pointerdown", this.Jq, !0), window.addEventListener("pointerup", this.Mq, !0), window.addEventListener("pointerout",
  14362. this.Lq, !0)) : (b.removeEventListener("mousemove", this.jo, !1), b.removeEventListener("mousedown", this.io, !1), b.removeEventListener("mouseup", this.lo, !1), b.removeEventListener("mouseout", this.ko, !1), window.addEventListener("mousemove", this.jo, !0), window.addEventListener("mousedown", this.io, !0), window.addEventListener("mouseup", this.lo, !0), window.addEventListener("mouseout", this.ko, !0)), b.removeEventListener("wheel", this.mo, !1), window.addEventListener("wheel", this.mo, !0), window.addEventListener("selectstart",
  14363. this.preventDefault, !1)) : (this.mz ? (window.removeEventListener("pointermove", this.Kq, !0), window.removeEventListener("pointerdown", this.Jq, !0), window.removeEventListener("pointerup", this.Mq, !0), window.removeEventListener("pointerout", this.Lq, !0), b.addEventListener("pointermove", this.Kq, !1), b.addEventListener("pointerdown", this.Jq, !1), b.addEventListener("pointerup", this.Mq, !1), b.addEventListener("pointerout", this.Lq, !1)) : (window.removeEventListener("mousemove", this.jo, !0), window.removeEventListener("mousedown",
  14364. this.io, !0), window.removeEventListener("mouseup", this.lo, !0), window.removeEventListener("mouseout", this.ko, !0), b.addEventListener("mousemove", this.jo, !1), b.addEventListener("mousedown", this.io, !1), b.addEventListener("mouseup", this.lo, !1), b.addEventListener("mouseout", this.ko, !1)), window.removeEventListener("wheel", this.mo, !0), window.removeEventListener("selectstart", this.preventDefault, !1), b.addEventListener("wheel", this.mo, !1)), this.LD = a)
  14365. });
  14366. D.defineProperty(E, { position: "position" }, function() { return this.sb }, function(a) {
  14367. var b = this.sb;
  14368. if (!b.O(a)) {
  14369. D.l(a, N, E, "position");
  14370. var c = this.wb.copy();
  14371. a = a.copy();
  14372. if (!this.ed && null !== this.Ib) {
  14373. this.ed = !0;
  14374. var d = this.scale;
  14375. $l(this, a, this.kd, this.Pb / d, this.Tb / d, this.No, !1);
  14376. this.ed = !1
  14377. }
  14378. this.sb = a.V();
  14379. a = this.Ra;
  14380. a.zc && rl(a, b, this.sb);
  14381. this.ed || this.dv(c, this.wb, this.Db, this.Db, !1)
  14382. }
  14383. });
  14384. D.defineProperty(E, { iJ: "initialPosition" }, function() { return this.mw }, function(a) { this.mw.O(a) || (D.l(a, N, E, "initialPosition"), this.mw = a.V()) });
  14385. D.defineProperty(E, { jJ: "initialScale" }, function() { return this.nw }, function(a) { this.nw !== a && (D.h(a, "number", E, "initialScale"), this.nw = a) });
  14386. D.defineProperty(E, { Vn: "grid" }, function() { null === this.Ed && Rl(this); return this.Ed }, function(a) {
  14387. var b = this.Ed;
  14388. if (b !== a) {
  14389. null === b && (Rl(this), b = this.Ed);
  14390. D.l(a, x, E, "grid");
  14391. a.type !== Sl && D.k("Diagram.grid must be a Panel of type Panel.Grid");
  14392. var c = b.R;
  14393. null !== c && c.remove(b);
  14394. this.Ed = a;
  14395. a.name = "GRID";
  14396. null !== c && c.add(a);
  14397. lm(this);
  14398. this.ra();
  14399. this.i("grid", b, a)
  14400. }
  14401. });
  14402. D.w(E, { wb: "viewportBounds" }, function() {
  14403. var a = this.ME;
  14404. if (null === this.Ib) return a;
  14405. var b = this.sb,
  14406. c = this.Db;
  14407. a.n(b.x, b.y, Math.max(this.Pb, 0) / c, Math.max(this.Tb, 0) / c);
  14408. return a
  14409. });
  14410. D.defineProperty(E, { LF: "fixedBounds" }, function() { return this.ew }, function(a) {
  14411. var b = this.ew;
  14412. b.O(a) || (D.l(a, C, E, "fixedBounds"), (v && Infinity === a.width || -Infinity === a.width || Infinity === a.height || -Infinity === a.height) && D.k("fixedBounds width/height must not be Infinity"), this.ew = a = a.V(), this.Qc(), this.i("fixedBounds", b, a))
  14413. });
  14414. D.defineProperty(E, { Ny: "scrollMargin" }, function() { return this.Zw }, function(a) {
  14415. "number" === typeof a ? a = new Lb(a) : D.l(a, Lb, E, "scrollMargin");
  14416. var b = this.Zw;
  14417. b.O(a) || (this.Zw = a = a.V(), this.i("scrollMargin", b, a), this.ro())
  14418. });
  14419. D.defineProperty(E, { VB: "scrollMode" }, function() { return this.$w }, function(a) {
  14420. var b = this.$w;
  14421. b !== a && (D.Da(a, E, E, "scrollMode"), this.$w = a, a === Cl && Yl(this, !1), this.i("scrollMode", b, a))
  14422. });
  14423. D.defineProperty(E, { oK: "scrollsPageOnFocus" }, function() { return this.ex }, function(a) {
  14424. var b = this.ex;
  14425. b !== a && (D.h(a, "boolean", E, "scrollsPageOnFocus"), this.ex = a, this.i("scrollsPageOnFocus", b, a))
  14426. });
  14427. D.defineProperty(E, { GG: "positionComputation" }, function() { return this.Uw }, function(a) {
  14428. var b = this.Uw;
  14429. b !== a && (null !== a && D.h(a, "function", E, "positionComputation"), this.Uw = a, Yl(this, !1), this.i("positionComputation", b, a))
  14430. });
  14431. D.defineProperty(E, { VG: "scaleComputation" }, function() { return this.Ww }, function(a) {
  14432. var b = this.Ww;
  14433. b !== a && (null !== a && D.h(a, "function", E, "scaleComputation"), this.Ww = a, gn(this, this.scale, this.scale), this.i("scaleComputation", b, a))
  14434. });
  14435. D.w(E, { kd: "documentBounds" }, function() { return this.Zv });
  14436. function am(a, b) {
  14437. a.rk = !1;
  14438. var c = a.Zv;
  14439. c.O(b) || (b = b.V(), a.Zv = b, Yl(a, !1), a.Ja("DocumentBoundsChanged", null, c.copy()), im(a))
  14440. }
  14441. D.defineProperty(E, { uB: "isVirtualized" }, function() { return this.uw }, function(a) {
  14442. var b = this.uw;
  14443. b !== a && (D.h(a, "boolean", E, "isVirtualized"), this.uw = a, this.i("isVirtualized", b, a))
  14444. });
  14445. D.defineProperty(E, { scale: "scale" }, function() { return this.Db }, function(a) {
  14446. var b = this.Db;
  14447. D.p(a, E, "scale");
  14448. b !== a && gn(this, b, a)
  14449. });
  14450. D.defineProperty(E, { im: "autoScale" }, function() { return this.Nm }, function(a) {
  14451. var b = this.Nm;
  14452. b !== a && (D.Da(a, E, E, "autoScale"), this.Nm = a, this.i("autoScale", b, a), a !== Vh && Yl(this, !1))
  14453. });
  14454. D.defineProperty(E, { VL: "initialAutoScale" }, function() { return this.Il }, function(a) {
  14455. var b = this.Il;
  14456. b !== a && (D.Da(a, E, E, "initialAutoScale"), this.Il = a, this.i("initialAutoScale", b, a))
  14457. });
  14458. D.defineProperty(E, { kJ: "initialViewportSpot" }, function() { return this.ow }, function(a) {
  14459. var b = this.ow;
  14460. b !== a && (D.l(a, S, E, "initialViewportSpot"), a.Xc() || D.k("initialViewportSpot must be a specific Spot: " + a), this.ow = a, this.i("initialViewportSpot", b, a))
  14461. });
  14462. D.defineProperty(E, { hJ: "initialDocumentSpot" }, function() { return this.lw }, function(a) {
  14463. var b = this.lw;
  14464. b !== a && (D.l(a, S, E, "initialDocumentSpot"), a.Xc() || D.k("initialViewportSpot must be a specific Spot: " + a), this.lw = a, this.i("initialDocumentSpot", b, a))
  14465. });
  14466. D.defineProperty(E, { Sh: "minScale" }, function() { return this.Gw }, function(a) {
  14467. D.p(a, E, "minScale");
  14468. var b = this.Gw;
  14469. b !== a && (0 < a ? (this.Gw = a, this.i("minScale", b, a), a > this.scale && (this.scale = a)) : D.ua(a, "> 0", E, "minScale"))
  14470. });
  14471. D.defineProperty(E, { Rh: "maxScale" }, function() { return this.Dw }, function(a) {
  14472. D.p(a, E, "maxScale");
  14473. var b = this.Dw;
  14474. b !== a && (0 < a ? (this.Dw = a, this.i("maxScale", b, a), a < this.scale && (this.scale = a)) : D.ua(a, "> 0", E, "maxScale"))
  14475. });
  14476. D.defineProperty(E, { Jm: "zoomPoint" }, function() { return this.wx }, function(a) { this.wx.O(a) || (D.l(a, N, E, "zoomPoint"), this.wx = a = a.V()) });
  14477. D.defineProperty(E, { LA: "contentAlignment" }, function() { return this.No }, function(a) {
  14478. var b = this.No;
  14479. b.O(a) || (D.l(a, S, E, "contentAlignment"), this.No = a = a.V(), this.i("contentAlignment", b, a), Yl(this, !1))
  14480. });
  14481. D.defineProperty(E, { WL: "initialContentAlignment" }, function() { return this.hp }, function(a) {
  14482. var b = this.hp;
  14483. b.O(a) || (D.l(a, S, E, "initialContentAlignment"), this.hp = a = a.V(), this.i("initialContentAlignment", b, a))
  14484. });
  14485. D.defineProperty(E, { padding: "padding" }, function() { return this.tf }, function(a) {
  14486. "number" === typeof a ? a = new Lb(a) : D.l(a, Lb, E, "padding");
  14487. var b = this.tf;
  14488. b.O(a) || (this.tf = a = a.V(), this.Qc(), this.i("padding", b, a))
  14489. });
  14490. D.w(E, { rg: "nodes" }, function() { return this.Ap.j });
  14491. D.w(E, { links: "links" }, function() { return this.tp.j });
  14492. D.w(E, { Hi: "parts" }, function() { return this.rb.j });
  14493. E.prototype.findTopLevelNodesAndLinks = function() {
  14494. for (var a = new L(F), b = this.Ap.j; b.next();) {
  14495. var c = b.value;
  14496. c.Bq && a.add(c)
  14497. }
  14498. for (b = this.tp.j; b.next();) c = b.value, c.Bq && a.add(c);
  14499. return a.j
  14500. };
  14501. E.prototype.findTopLevelGroups = function() { return this.$l.j };
  14502. D.defineProperty(E, { Yb: "layout" }, function() { return this.we }, function(a) {
  14503. var b = this.we;
  14504. b !== a && (D.l(a, $g, E, "layout"), null !== b && (b.g = null, b.group = null), this.we = a, a.g = this, a.group = null, this.xl = !0, this.i("layout", b, a), this.Ve())
  14505. });
  14506. E.prototype.layoutDiagram = function(a) {
  14507. Si(this);
  14508. a && Bn(this, !0);
  14509. mm(this, !1)
  14510. };
  14511. function Bn(a, b) {
  14512. for (var c = a.$l.j; c.next();) In(a, c.value, b);
  14513. null !== a.Yb && (b ? a.Yb.zf = !1 : a.Yb.L())
  14514. }
  14515. function In(a, b, c) {
  14516. if (null !== b) {
  14517. for (var d = b.gn.j; d.next();) In(a, d.value, c);
  14518. null !== b.Yb && (c ? b.Yb.zf = !1 : b.Yb.L())
  14519. }
  14520. }
  14521. function mm(a, b) {
  14522. if (a.xl && !a.Dz) {
  14523. var c = a.$a;
  14524. a.$a = !0;
  14525. try {
  14526. var d = a.na.Ki;
  14527. 0 === d && a.Nb("Layout");
  14528. var e = a.Ra;
  14529. 1 >= d && !e.nf && !e.zc && (b || e.po("Layout"));
  14530. a.xl = !1;
  14531. for (var g = a.$l.j; g.next();) Jn(a, g.value, b, d);
  14532. var h = a.Yb;
  14533. h.zf || (!b || h.mG || 0 === d ? (h.doLayout(a), Si(a), h.zf = !0) : a.xl = !0)
  14534. } finally { 0 === d && a.jd("Layout"), a.xl = !h.zf, a.$a = c }
  14535. }
  14536. }
  14537. function Jn(a, b, c, d) {
  14538. if (null !== b) {
  14539. for (var e = b.gn.j; e.next();) Jn(a, e.value, c, d);
  14540. e = b.Yb;
  14541. null === e || e.zf || (!c || e.mG || 0 === d ? (b.no = !b.location.H(), e.doLayout(b), b.L(Kn), Mm(a, b), e.zf = !0) : a.xl = !0)
  14542. }
  14543. }
  14544. D.defineProperty(E, { ee: "isTreePathToChildren" }, function() { return this.tw }, function(a) {
  14545. var b = this.tw;
  14546. if (b !== a && (D.h(a, "boolean", E, "isTreePathToChildren"), this.tw = a, this.i("isTreePathToChildren", b, a), !this.na.ub))
  14547. for (a = this.rg; a.next();) Ln(a.value)
  14548. });
  14549. E.prototype.findTreeRoots = function() {
  14550. for (var a = new K(G), b = this.rg; b.next();) {
  14551. var c = b.value;
  14552. c.Bq && null === c.Qn() && a.add(c)
  14553. }
  14554. return a.j
  14555. };
  14556. D.defineProperty(E, { rC: "treeCollapsePolicy" }, function() { return this.qx }, function(a) {
  14557. var b = this.qx;
  14558. b !== a && (a !== El && a !== jn && a !== kn && D.k("Unknown Diagram.treeCollapsePolicy: " + a), this.qx = a, this.i("treeCollapsePolicy", b, a))
  14559. });
  14560. D.defineProperty(E, { Ph: null }, function() { return this.CD }, function(a) { this.CD = a });
  14561. function Dl(a) {
  14562. function b(a) {
  14563. var b = a.toLowerCase(),
  14564. h = new K("function");
  14565. c.add(a, h);
  14566. c.add(b, h);
  14567. d.add(a, a);
  14568. d.add(b, a)
  14569. }
  14570. var c = new oa("string", K),
  14571. d = new oa("string", "string");
  14572. b("AnimationStarting");
  14573. b("AnimationFinished");
  14574. b("BackgroundSingleClicked");
  14575. b("BackgroundDoubleClicked");
  14576. b("BackgroundContextClicked");
  14577. b("ClipboardChanged");
  14578. b("ClipboardPasted");
  14579. b("DocumentBoundsChanged");
  14580. b("ExternalObjectsDropped");
  14581. b("InitialLayoutCompleted");
  14582. b("LayoutCompleted");
  14583. b("LinkDrawn");
  14584. b("LinkRelinked");
  14585. b("LinkReshaped");
  14586. b("Modified");
  14587. b("ObjectSingleClicked");
  14588. b("ObjectDoubleClicked");
  14589. b("ObjectContextClicked");
  14590. b("PartCreated");
  14591. b("PartResized");
  14592. b("PartRotated");
  14593. b("SelectionMoved");
  14594. b("SelectionCopied");
  14595. b("SelectionDeleting");
  14596. b("SelectionDeleted");
  14597. b("SelectionGrouped");
  14598. b("SelectionUngrouped");
  14599. b("ChangingSelection");
  14600. b("ChangedSelection");
  14601. b("SubGraphCollapsed");
  14602. b("SubGraphExpanded");
  14603. b("TextEdited");
  14604. b("TreeCollapsed");
  14605. b("TreeExpanded");
  14606. b("ViewportBoundsChanged");
  14607. a.Fz = c;
  14608. a.Ez = d
  14609. }
  14610. function Ga(a, b) { var c = a.Ez.oa(b); return null !== c ? c : a.Ez.oa(b.toLowerCase()) }
  14611. function Mn(a, b) {
  14612. var c = a.Fz.oa(b);
  14613. if (null !== c) return c;
  14614. c = a.Fz.oa(b.toLowerCase());
  14615. if (null !== c) return c;
  14616. D.k("Unknown DiagramEvent name: " + b);
  14617. return null
  14618. }
  14619. E.prototype.addDiagramListener = E.prototype.xx = function(a, b) {
  14620. D.h(a, "string", E, "addDiagramListener:name");
  14621. D.h(b, "function", E, "addDiagramListener:listener");
  14622. var c = Mn(this, a);
  14623. null !== c && c.add(b)
  14624. };
  14625. E.prototype.removeDiagramListener = E.prototype.QB = function(a, b) {
  14626. D.h(a, "string", E, "removeDiagramListener:name");
  14627. D.h(b, "function", E, "addDiagramListener:listener");
  14628. var c = Mn(this, a);
  14629. null !== c && c.remove(b)
  14630. };
  14631. E.prototype.raiseDiagramEvent = E.prototype.Ja = function(a, b, c) {
  14632. v && D.h(a, "string", E, "raiseDiagramEvent:name");
  14633. var d = Mn(this, a),
  14634. e = new dg;
  14635. e.g = this;
  14636. a = Ga(this, a);
  14637. null !== a && (e.name = a);
  14638. void 0 !== b && (e.hC = b);
  14639. void 0 !== c && (e.LB = c);
  14640. b = d.length;
  14641. if (1 === b) d = d.fa(0), d(e);
  14642. else if (0 !== b)
  14643. for (c = d.Fc(), a = 0; a < b; a++) d = c[a], d(e);
  14644. return e.cancel
  14645. };
  14646. E.prototype.isUnoccupied = E.prototype.Dq = function(a, b) { void 0 === b && (b = null); return ha(this, !1, null, b).Dq(a.x, a.y, a.width, a.height) };
  14647. E.prototype.computeOccupiedArea = function() { return this.uB ? this.wb.copy() : this.rk ? Xl(this) : this.kd.copy() };
  14648. function ha(a, b, c, d) {
  14649. null === a.Wd && (a.Wd = new Nn);
  14650. if (a.Wd.vq || a.Wd.group !== c || a.Wd.gC !== d) {
  14651. if (null === c) {
  14652. b = a.computeOccupiedArea();
  14653. b.ig(100, 100);
  14654. a.Wd.initialize(b);
  14655. b = D.Sf();
  14656. for (var e = a.rg; e.next();) {
  14657. var g = e.value,
  14658. h = g.layer;
  14659. null !== h && h.visible && !h.Yc && On(a, g, d, b)
  14660. }
  14661. } else
  14662. for (0 < c.uc.count && (b = a.computePartsBounds(c.uc, !1), b.ig(20, 20), a.Wd.initialize(b)), b = D.Sf(), e = c.uc; e.next();) g = e.value, g instanceof G && On(a, g, d, b);
  14663. D.Lb(b);
  14664. a.Wd.group = c;
  14665. a.Wd.gC = d;
  14666. a.Wd.vq = !1
  14667. } else b && Pn(a.Wd);
  14668. return a.Wd
  14669. }
  14670. function On(a, b, c, d) {
  14671. if (b !== c)
  14672. if (b.isVisible() && b.HA && !b.Lf) {
  14673. c = b.getAvoidableRect(d);
  14674. d = a.Wd.cq;
  14675. b = a.Wd.aq;
  14676. for (var e = c.x + c.width, g = c.y + c.height, h = c.x; h < e; h += d) {
  14677. for (var k = c.y; k < g; k += b) Qn(a.Wd, h, k);
  14678. Qn(a.Wd, h, g)
  14679. }
  14680. for (k = c.y; k < g; k += b) Qn(a.Wd, e, k);
  14681. Qn(a.Wd, e, g)
  14682. } else if (b instanceof I)
  14683. for (b = b.uc; b.next();) e = b.value, e instanceof G && On(a, e, c, d)
  14684. }
  14685. E.invalidatePositionArray = E.prototype.oB = function(a) { null !== this.Wd && !this.Wd.vq && (void 0 === a && (a = null), null === a || a.HA && !a.Lf) && (this.Wd.vq = !0) };
  14686. E.prototype.simulatedMouseMove = function(a, b, c) {
  14687. if (null !== di) {
  14688. var d = di.g;
  14689. c instanceof E || (c = null);
  14690. var e = ei;
  14691. c !== e && (null !== e && e !== d && null !== e.nb.Ge && (Di(e), di.gy = !1, e.nb.Ge.doSimulatedDragLeave()), ei = c, null !== c && c !== d && null !== c.nb.Ge && (Ki(), e = c.nb.Ge, Gi.contains(e) || Gi.add(e), c.nb.Ge.doSimulatedDragEnter()));
  14692. if (null === c || c === d || !c.XE || c.qb || !c.Zp) return !1;
  14693. d = c.nb.Ge;
  14694. null !== d && (null !== a ? b = c.dp(a) : null === b && (b = new N), c.cc.ha = b, c.cc.Vk = !1, c.cc.up = !1, d.doSimulatedDragOver());
  14695. return !0
  14696. }
  14697. return !1
  14698. };
  14699. E.prototype.simulatedMouseUp = function(a, b, c, d) {
  14700. if (null !== di) {
  14701. null === d && (d = b);
  14702. b = ei;
  14703. var e = di.g;
  14704. if (d !== b) {
  14705. if (null !== b && b !== e && null !== b.nb.Ge) return Di(b), di.gy = !1, b.nb.Ge.doSimulatedDragLeave(), !1;
  14706. ei = d;
  14707. null !== d && null !== d.nb.Ge && (Ki(), b = d.nb.Ge, Gi.contains(b) || Gi.add(b), d.nb.Ge.doSimulatedDragEnter())
  14708. }
  14709. if (null === d) return di.doCancel(), !0;
  14710. if (d !== this) return null !== a && (c = d.dp(a)), d.cc.ha = c, d.cc.Vk = !1, d.cc.up = !0, a = d.nb.Ge, null !== a && a.doSimulatedDrop(), a = di, null !== a && (d = a.mayCopy(), a.Tf = d ? "Copy" : "Move", a.stopTool()), !0
  14711. }
  14712. return !1
  14713. };
  14714. D.defineProperty(E, { oL: "autoScrollInterval" }, function() { return this.pr }, function(a) {
  14715. var b = this.pr;
  14716. D.p(a, E, "scale");
  14717. b !== a && (this.pr = a, this.i("autoScrollInterval", b, a))
  14718. });
  14719. D.defineProperty(E, { dF: "autoScrollRegion" }, function() { return this.Lv }, function(a) {
  14720. "number" === typeof a ? a = new Lb(a) : D.l(a, Lb, E, "autoScrollRegion");
  14721. var b = this.Lv;
  14722. b.O(a) || (this.Lv = a = a.V(), this.Qc(), this.i("autoScrollRegion", b, a))
  14723. });
  14724. E.prototype.doAutoScroll = E.prototype.UA = function(a) {
  14725. this.Kv.assign(a);
  14726. Rn(this, this.Kv).Wc(this.position) ? Di(this) : Sn(this)
  14727. };
  14728. function Sn(a) {
  14729. -1 === a.Io && (a.Io = D.setTimeout(function() {
  14730. if (-1 !== a.Io) {
  14731. Di(a);
  14732. var b = a.U.event;
  14733. if (null !== b) {
  14734. var c = Rn(a, a.Kv);
  14735. c.Wc(a.position) || (a.position = c, a.U.ha = a.qC(a.Kv), c = fm(b), a.simulatedMouseMove(b, null, c) || a.doMouseMove(), a.rk = !0, am(a, a.Kh()), a.Oe = !0, a.lg(), Sn(a))
  14736. }
  14737. }
  14738. }, a.pr))
  14739. }
  14740. function Di(a) {-1 !== a.Io && (D.clearTimeout(a.Io), a.Io = -1) }
  14741. function Rn(a, b) {
  14742. var c = a.position,
  14743. d = a.dF;
  14744. if (0 >= d.top && 0 >= d.left && 0 >= d.right && 0 >= d.bottom) return c;
  14745. var e = a.wb,
  14746. g = a.scale,
  14747. e = D.vg(0, 0, e.width * g, e.height * g),
  14748. h = D.Fb(0, 0);
  14749. if (b.x >= e.x && b.x < e.x + d.left) {
  14750. var k = Math.max(a.lv, 1),
  14751. k = k | 0;
  14752. h.x -= k;
  14753. b.x < e.x + d.left / 2 && (h.x -= k);
  14754. b.x < e.x + d.left / 4 && (h.x -= 4 * k)
  14755. } else b.x <= e.x + e.width && b.x > e.x + e.width - d.right && (k = Math.max(a.lv, 1), k |= 0, h.x += k, b.x > e.x + e.width - d.right / 2 && (h.x += k), b.x > e.x + e.width - d.right / 4 && (h.x += 4 * k));
  14756. b.y >= e.y && b.y < e.y + d.top ? (k = Math.max(a.mv, 1), k |= 0, h.y -= k, b.y < e.y +
  14757. d.top / 2 && (h.y -= k), b.y < e.y + d.top / 4 && (h.y -= 4 * k)) : b.y <= e.y + e.height && b.y > e.y + e.height - d.bottom && (k = Math.max(a.mv, 1), k |= 0, h.y += k, b.y > e.y + e.height - d.bottom / 2 && (h.y += k), b.y > e.y + e.height - d.bottom / 4 && (h.y += 4 * k));
  14758. h.Wc(Kd) || (c = new N(c.x + h.x / g, c.y + h.y / g));
  14759. D.Lb(e);
  14760. D.A(h);
  14761. return c
  14762. }
  14763. E.prototype.makeSvg = E.prototype.makeSVG = function(a) {
  14764. void 0 === a && (a = new ma);
  14765. a.context = "svg";
  14766. a = Tn(this, a);
  14767. return null !== a ? a.Em : null
  14768. };
  14769. E.prototype.makeImage = function(a) {
  14770. void 0 === a && (a = new ma);
  14771. var b = (a.document || document).createElement("img");
  14772. b.src = this.FJ(a);
  14773. return b
  14774. };
  14775. E.prototype.makeImageData = E.prototype.FJ = function(a) {
  14776. void 0 === a && (a = new ma);
  14777. var b = Tn(this, a);
  14778. if (null !== b) {
  14779. var c = a.returnType,
  14780. c = void 0 === c ? "string" : c.toLowerCase();
  14781. switch (c) {
  14782. case "imagedata":
  14783. return b.Tk.getImageData(0, 0, b.width, b.height);
  14784. case "blob":
  14785. b = b.$d;
  14786. c = a.callback;
  14787. if ("function" !== typeof c) { D.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.'); break }
  14788. if ("function" === typeof b.toBlob) return b.toBlob(c, a.type, a.details), "toBlob";
  14789. if ("function" ===
  14790. typeof b.msToBlob) return c(b.msToBlob()), "msToBlob";
  14791. c(null);
  14792. break;
  14793. default:
  14794. return b.toDataURL(a.type, a.details)
  14795. }
  14796. }
  14797. return ""
  14798. };
  14799. var Un = !1;
  14800. function Tn(a, b) {
  14801. a.Ra.Yh();
  14802. a.lg();
  14803. if (null === a.Ib) return null;
  14804. "object" !== typeof b && D.k("properties argument must be an Object.");
  14805. var c = !1,
  14806. d = b.size || null,
  14807. e = b.scale || null;
  14808. void 0 !== b.scale && isNaN(b.scale) && (e = "NaN");
  14809. var g = b.maxSize;
  14810. void 0 === b.maxSize && (c = !0, g = "svg" === b.context ? new Ca(Infinity, Infinity) : new Ca(2E3, 2E3));
  14811. var h = b.position || null,
  14812. k = b.parts || null,
  14813. l = void 0 === b.padding ? 1 : b.padding,
  14814. m = b.background || null,
  14815. n = b.omitTemporary;
  14816. void 0 === n && (n = !0);
  14817. var p = b.document || document,
  14818. q = b.elementFinished || null,
  14819. r =
  14820. b.showTemporary;
  14821. void 0 === r && (r = !n);
  14822. n = b.showGrid;
  14823. void 0 === n && (n = r);
  14824. null !== d && isNaN(d.width) && isNaN(d.height) && (d = null);
  14825. "number" === typeof l ? l = new Lb(l) : l instanceof Lb || (l = new Lb(0));
  14826. l.left = Math.max(l.left, 0);
  14827. l.right = Math.max(l.right, 0);
  14828. l.top = Math.max(l.top, 0);
  14829. l.bottom = Math.max(l.bottom, 0);
  14830. a.dd.De(!0);
  14831. var s = new ja(null, p),
  14832. u = s.Tk;
  14833. if (!(d || e || k || h)) {
  14834. s.width = a.Pb + Math.ceil(l.left + l.right);
  14835. s.height = a.Tb + Math.ceil(l.top + l.bottom);
  14836. if ("svg" === b.context) return u = new qd(s.$d, p, q), Tm(a, u, l, new Ca(s.width, s.height),
  14837. a.Db, a.sb, k, m, r, n), u;
  14838. a.Ur = !1;
  14839. Tm(a, u, l, new Ca(s.width, s.height), a.Db, a.sb, k, m, r, n);
  14840. a.Ur = !0;
  14841. return s
  14842. }
  14843. var t = a.yb.Ox,
  14844. y = new N(0, 0),
  14845. w = a.kd.copy();
  14846. w.zK(a.padding);
  14847. if (r)
  14848. for (var A = !0, A = a.dc.o, B = A.length, P = 0; P < B; P++) {
  14849. var H = A[P];
  14850. if (H.visible && H.Yc)
  14851. for (var H = H.rb.o, R = H.length, aa = 0; aa < R; aa++) {
  14852. var V = H[aa];
  14853. V.hy && V.isVisible() && (V = V.aa, V.H() && w.Zh(V))
  14854. }
  14855. }
  14856. y.x = w.x;
  14857. y.y = w.y;
  14858. if (null !== k) {
  14859. var ea, A = !0,
  14860. B = k.j;
  14861. for (B.reset(); B.next();) V = B.value, V instanceof F && (H = V.layer, null !== H && !H.visible || null !== H && !r && H.Yc || !V.isVisible() ||
  14862. (V = V.aa, V.H() && (A ? (A = !1, ea = V.copy()) : ea.Zh(V))));
  14863. A && (ea = new C(0, 0, 0, 0));
  14864. w.width = ea.width;
  14865. w.height = ea.height;
  14866. y.x = ea.x;
  14867. y.y = ea.y
  14868. }
  14869. null !== h && h.H() && (y = h, e || (e = t));
  14870. A = V = 0;
  14871. null !== l && (V = l.left + l.right, A = l.top + l.bottom);
  14872. P = B = 0;
  14873. null !== d && (B = d.width, P = d.height, isFinite(B) && (B = Math.max(0, B - V)), isFinite(P) && (P = Math.max(0, P - A)));
  14874. ea = h = 0;
  14875. null !== d && null !== e ? ("NaN" === e && (e = t), d.H() ? (h = B, ea = P) : isNaN(P) ? (h = B, ea = w.height * e) : (h = w.width * e, ea = P)) : null !== d ? d.H() ? (e = Math.min(B / w.width, P / w.height), h = B, ea = P) : isNaN(P) ? (e = B / w.width,
  14876. h = B, ea = w.height * e) : (e = P / w.height, h = w.width * e, ea = P) : null !== e ? "NaN" === e && g.H() ? (e = Math.min((g.width - V) / w.width, (g.height - A) / w.height), e > t ? (e = t, h = w.width, ea = w.height) : (h = g.width, ea = g.height)) : (h = w.width * e, ea = w.height * e) : (e = t, h = w.width, ea = w.height);
  14877. null !== l ? (h += V, ea += A) : l = new Lb(0);
  14878. null !== g && (d = g.width, g = g.height, "svg" !== b.context && c && !Un && (h > d || ea > g) && (D.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. (" + Math.ceil(h) + "x" + Math.ceil(ea) + " vs 2000x2000) Consider increasing the max size."),
  14879. Un = !0), isNaN(d) && (d = 2E3), isNaN(g) && (g = 2E3), isFinite(d) && (h = Math.min(h, d)), isFinite(g) && (ea = Math.min(ea, g)));
  14880. s.width = Math.ceil(h);
  14881. s.height = Math.ceil(ea);
  14882. if ("svg" === b.context) return u = new qd(s.$d, p, q), Tm(a, u, l, new Ca(Math.ceil(h), Math.ceil(ea)), e, y, k, m, r, n), u;
  14883. a.Ur = !1;
  14884. Tm(a, u, l, new Ca(Math.ceil(h), Math.ceil(ea)), e, y, k, m, r, n);
  14885. a.Ur = !0;
  14886. return s
  14887. }
  14888. E.inherit = function(a, b) {
  14889. D.h(a, "function", E, "inherit");
  14890. D.h(b, "function", E, "inherit");
  14891. b.PH && D.k("Cannot inherit from " + D.wf(b));
  14892. D.Ta(a, b)
  14893. };
  14894. function Ml() {
  14895. this.wE = null;
  14896. this.RH = "63ad05bbe23a1786468a4c741b6d2";
  14897. this.Zi = this.RH === this._tk ? !0 : null
  14898. }
  14899. Ml.prototype.Im = function(a) {
  14900. a.dd.setTransform(a.ud, 0, 0, a.ud, 0, 0);
  14901. if (null === this.Zi) {
  14902. var b = "f",
  14903. c = window[D.Wg("76a715b2f73f148a")][D.Wg("72ba13b5")];
  14904. a = D.Wg;
  14905. this.Zi = !0;
  14906. if (window[a("7da7")] && window[a("7da7")][a("76a115b6ed251eaf4692")]) {
  14907. var d = window[a("7da7")][a("76a115b6ed251eaf4692")],
  14908. d = a(d).split(a("39e9"));
  14909. if (!(6 > d.length)) {
  14910. var e = a(d[1]).split(".");
  14911. if ("7da71ca0" === d[4]) {
  14912. var g = a(D[a("6cae19")]).split(".");
  14913. if (e[0] > g[0] || e[0] === g[0] && e[1] >= g[1]) {
  14914. g = c[a("76ad18b4f73e")];
  14915. for (e = c[a("73a612b6fb191d")](a("35e7")) +
  14916. 2; e < g; e++) b += c[e];
  14917. c = b[a("73a612b6fb191d")](a(d[2]));
  14918. 0 > c && a(d[2]) !== a("7da71ca0ad381e90") && (c = b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));
  14919. 0 > c && (c = b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));
  14920. if (this.Zi = !(0 <= c && c < b[a("73a612b6fb191d")](a("35"))))
  14921. if (b = a(d[2]), "#" === b[0]) {
  14922. c = window.document[a("79ba13b2f7333e8846865a7d00")]("div");
  14923. for (e = d[0].replace(/[A-Za-z]/g, ""); 4 > e.length;) e += "9";
  14924. e = e.substr(e.length - 4);
  14925. d = "" + ["gsh", "gsf"][parseInt(e.substr(0, 1), 10) % 2];
  14926. d += ["Header", "Background", "Display", "Feedback"][parseInt(e.substr(0,
  14927. 1), 10) % 4];
  14928. c[a("79a417a0f0181a8946")] = d;
  14929. if (window.document[a("78a712aa")]) {
  14930. if (window.document[a("78a712aa")][a("7bb806b6ed32388c4a875b")](c), e = window[a("7dad0290ec3b0b91578e5b40007031bf")](c)[a("7dad0283f1390b81519f4645156528bf")](a("78a704b7e62456904c9b12701b6532a8")), window.document[a("78a712aa")][a("68ad1bbcf533388c4a875b")](c), e)
  14931. if (-1 !== e.indexOf(parseInt(b[1] + b[2], 16)) && -1 !== e.indexOf(parseInt(b[3] + b[4], 16))) this.Zi = !1;
  14932. else if (D.Mu || D.zq || D.Aq || D.rB)
  14933. for (d = "." + d, e = 0; e < document.styleSheets.length; e++) {
  14934. a =
  14935. document.styleSheets[e].rules || document.styleSheets[e].cssRules;
  14936. for (var h in a)
  14937. if (d === a[h].selectorText) { this.Zi = !1; break }
  14938. }
  14939. } else this.Zi = null, this.Zi = !1
  14940. }
  14941. }
  14942. }
  14943. }
  14944. } else {
  14945. g = c[a("76ad18b4f73e")];
  14946. for (e = c[a("73a612b6fb191d")](a("35e7")) + 2; e < g; e++) b += c[e];
  14947. c = b[a("73a612b6fb191d")](a("7da71ca0ad381e90"));
  14948. this.Zi = !(0 <= c && c < b[a("73a612b6fb191d")](a("35")))
  14949. }
  14950. }
  14951. return 0 < this.Zi && this !== this.wE ? !0 : !1
  14952. };
  14953. Ml.prototype.t = function() { this.wE = null };
  14954. function Nl(a, b) {
  14955. void 0 !== b && null !== b || D.k("Diagram setup requires an argument DIV.");
  14956. null !== a.Ub && D.k("Diagram has already completed setup.");
  14957. "string" === typeof b ? a.Ub = window.document.getElementById(b) : b instanceof HTMLDivElement ? a.Ub = b : D.k("No DIV or DIV id supplied: " + b);
  14958. null === a.Ub && D.k("Invalid DIV id; could not get element with id: " + b);
  14959. void 0 !== a.Ub.ca && D.k("Invalid div id; div already has a Diagram associated with it.");
  14960. "static" === window.getComputedStyle(a.Ub, null).position && (a.Ub.style.position =
  14961. "relative");
  14962. a.Ub.style["-webkit-tap-highlight-color"] = "rgba(255, 255, 255, 0)";
  14963. a.Ub.style["-ms-touch-action"] = "none";
  14964. a.Ub.innerHTML = "";
  14965. a.Ub.ca = a;
  14966. var c = new ja(a);
  14967. c.$d.innerHTML = "This text is displayed if your browser does not support the Canvas HTML element.";
  14968. void 0 !== c.style && (c.style.position = "absolute", c.style.top = "0px", c.style.left = "0px", "rtl" === window.getComputedStyle(a.Ub, null).getPropertyValue("direction") && (a.rs = !0), c.style.zIndex = "2", c.style.QM = "none", c.style.webkitUserSelect = "none", c.style.MozUserSelect =
  14969. "none");
  14970. a.Pb = a.Ub.clientWidth || 1;
  14971. a.Tb = a.Ub.clientHeight || 1;
  14972. a.Ib = c;
  14973. a.dd = c.Tk;
  14974. var d = a.dd;
  14975. a.ud = a.computePixelRatio();
  14976. Vm(a, a.Pb, a.Tb);
  14977. // a.aw = d[D.Wg("7eba17a4ca3b1a8346")][D.Wg("78a118b7")](d, D.Im, 4, 4);
  14978. a.aw = function() { return true; };
  14979. a.Ub.insertBefore(c.$d, a.Ub.firstChild);
  14980. c = new ja(null);
  14981. c.width = 1;
  14982. c.height = 1;
  14983. a.Iz = c;
  14984. a.rD = c.Tk;
  14985. var c = D.createElement("div"),
  14986. e = D.createElement("div");
  14987. c.style.position = "absolute";
  14988. c.style.overflow = "auto";
  14989. c.style.width = a.Pb + "px";
  14990. c.style.height = a.Tb + "px";
  14991. c.style.zIndex = "1";
  14992. e.style.position = "absolute";
  14993. e.style.width =
  14994. "1px";
  14995. e.style.height = "1px";
  14996. a.Ub.appendChild(c);
  14997. c.appendChild(e);
  14998. c.onscroll = Tl;
  14999. c.onmousedown = Vl;
  15000. c.ontouchstart = Vl;
  15001. c.ca = a;
  15002. c.NH = !0;
  15003. c.OH = !0;
  15004. a.ax = c;
  15005. a.yt = e;
  15006. a.Gy = D.oF(function() {
  15007. a.Hk = null;
  15008. a.ra()
  15009. }, 300, !1);
  15010. a.vC = D.oF(function() { fl(a) }, 250, !1);
  15011. a.preventDefault = function(a) { a.preventDefault(); return !1 };
  15012. a.jo = function(b) {
  15013. if (a.isEnabled) {
  15014. a.th = !0;
  15015. var c = a.Hd;
  15016. D.Xn && c.Qj ? (b.preventDefault(), b.simulated = !0, a.Ht = b) : (a.Hd = a.cc, a.cc = c, dm(a, a, b, c, !0), a.simulatedMouseMove(b, null, b.target.ca) || (a.doMouseMove(), a.eb.isBeyondDragSize() &&
  15017. (a.ji = 0), ga(a, c, b)))
  15018. }
  15019. };
  15020. a.io = function(b) {
  15021. if (a.isEnabled) {
  15022. a.th = !0;
  15023. var c = a.Hd;
  15024. if (D.Xn && null !== a.Ht) a.Ht = b, b.preventDefault();
  15025. else if (D.Xn && 400 > b.timeStamp - a.wk) b.preventDefault();
  15026. else if (a.uk) b.preventDefault();
  15027. else {
  15028. a.Hd = a.cc;
  15029. a.cc = c;
  15030. dm(a, a, b, c, !0);
  15031. c.Vk = !0;
  15032. c.Ee = b.detail;
  15033. if (D.zq || D.Aq) b.timeStamp - a.wk < a.yA && !a.eb.isBeyondDragSize() ? a.ji++ : a.ji = 1, a.wk = b.timeStamp, c.Ee = a.ji;
  15034. a.aj = c;
  15035. !0 === c.$r.simulated ? (b.preventDefault(), b.simulated = !0) : (di = null, a.doMouseDown(), a.aj = a.aj.copy(), 1 === b.button ? b.preventDefault() :
  15036. ga(a, c, b))
  15037. }
  15038. }
  15039. };
  15040. a.lo = function(b) {
  15041. if (a.isEnabled)
  15042. if (a.uk && 2 === b.button) b.preventDefault();
  15043. else if (a.uk && 0 === b.button && (a.uk = !1), a.Sp) b.preventDefault();
  15044. else {
  15045. a.th = !0;
  15046. var c = a.Hd;
  15047. if (D.Xn) {
  15048. if (400 > b.timeStamp - a.wk) { b.preventDefault(); return }
  15049. a.wk = b.timeStamp
  15050. }
  15051. if (D.Xn && null !== a.Ht) a.Ht = null, b.preventDefault();
  15052. else {
  15053. a.Hd = a.cc;
  15054. a.cc = c;
  15055. dm(a, a, b, c, !0);
  15056. c.up = !0;
  15057. c.Ee = b.detail;
  15058. if (D.zq || D.Aq) c.Ee = a.ji;
  15059. c.bubbles = b.bubbles;
  15060. c.Qf = fm(b);
  15061. a.simulatedMouseUp(b, null, new N, c.Qf) || (a.doMouseUp(), Di(a), ga(a, c, b))
  15062. }
  15063. }
  15064. };
  15065. a.mo = function(b) {
  15066. if (a.isEnabled) {
  15067. var c =
  15068. a.Hd;
  15069. a.Hd = a.cc;
  15070. a.cc = c;
  15071. dm(a, a, b, c, !0);
  15072. c.bubbles = !0;
  15073. var d = 0,
  15074. e = 0;
  15075. void 0 !== b.wheelDelta && (e = 0 < b.wheelDelta ? 1 : -1);
  15076. void 0 !== b.wheelDeltaY && (e = 0 < b.wheelDeltaY ? 1 : -1);
  15077. void 0 !== b.wheelDeltaX && (d = 0 < b.wheelDeltaX ? 1 : -1);
  15078. void 0 !== b.deltaY && (e = 0 < b.deltaY ? 1 : -1);
  15079. void 0 !== b.deltaX && (d = 0 < b.deltaX ? 1 : -1);
  15080. c.Uk = 0 === e ? -d : -e;
  15081. a.doMouseWheel();
  15082. ga(a, c, b)
  15083. }
  15084. };
  15085. a.ko = function() {
  15086. if (a.isEnabled) {
  15087. a.th = !1;
  15088. var b = a.eb;
  15089. b.cancelWaitAfter();
  15090. b.standardMouseOver()
  15091. }
  15092. };
  15093. a.oC = function(b) {
  15094. if (a.isEnabled) {
  15095. a.Sp = !1;
  15096. a.uk = !0;
  15097. var c = gm(a, b, b.targetTouches[0],
  15098. 1 < b.touches.length);
  15099. a.doMouseDown();
  15100. ga(a, c, b)
  15101. }
  15102. };
  15103. a.nC = function(b) {
  15104. if (a.isEnabled) {
  15105. var c = null;
  15106. 0 < b.targetTouches.length ? c = b.targetTouches[0] : 0 < b.changedTouches.length && (c = b.changedTouches[0]);
  15107. var d = hm(a, b, c, 1 < b.touches.length);
  15108. a.simulatedMouseMove(c ? c : b, null, d.Qf) || a.doMouseMove();
  15109. ga(a, d, b)
  15110. }
  15111. };
  15112. a.mC = function(b) {
  15113. if (a.isEnabled)
  15114. if (a.Sp) b.preventDefault();
  15115. else if (!(1 < b.touches.length)) {
  15116. var c = null,
  15117. d = null;
  15118. 0 < b.targetTouches.length ? d = b.targetTouches[0] : 0 < b.changedTouches.length && (d = b.changedTouches[0]);
  15119. var e =
  15120. a.Hd;
  15121. a.Hd = a.cc;
  15122. a.cc = e;
  15123. e.g = a;
  15124. e.Ee = 1;
  15125. if (null !== d) {
  15126. c = window.document.elementFromPoint(d.clientX, d.clientY);
  15127. null !== c && c.ca instanceof E && c.ca !== a && em(c.ca, d, e);
  15128. em(a, d, e);
  15129. var m = d.screenX,
  15130. n = d.screenY,
  15131. p = a.ww;
  15132. b.timeStamp - a.wk < a.yA && !(25 < Math.abs(p.x - m) || 25 < Math.abs(p.y - n)) ? a.ji++ : a.ji = 1;
  15133. e.Ee = a.ji;
  15134. a.wk = b.timeStamp;
  15135. a.ww.n(m, n)
  15136. }
  15137. m = 0;
  15138. b.ctrlKey && (m += 1);
  15139. b.altKey && (m += 2);
  15140. b.shiftKey && (m += 4);
  15141. b.metaKey && (m += 8);
  15142. e.xd = m;
  15143. e.button = 0;
  15144. e.buttons = 1;
  15145. e.Vk = !1;
  15146. e.up = !0;
  15147. e.Uk = 0;
  15148. e.Cc = !1;
  15149. e.bubbles = !1;
  15150. e.event = b;
  15151. e.timestamp = Date.now();
  15152. e.Qf = null === c ? fm(b) : c.ca ? c.ca : null;
  15153. e.Ne = null;
  15154. a.simulatedMouseUp(d ? d : b, null, new N, e.Qf) || a.doMouseUp();
  15155. ga(a, e, b);
  15156. a.uk = !1
  15157. }
  15158. };
  15159. a.Jq = function(b) {
  15160. if (a.isEnabled) {
  15161. a.th = !0;
  15162. var c = a.jA;
  15163. void 0 === c[b.pointerId] && (c[b.pointerId] = b);
  15164. var c = a.Dp,
  15165. d = !1;
  15166. if (null !== c[0] && c[0].pointerId === b.pointerId) c[0] = b;
  15167. else if (null !== c[1] && c[1].pointerId === b.pointerId) c[1] = b, d = !0;
  15168. else if (null === c[0]) c[0] = b;
  15169. else if (null === c[1]) c[1] = b, d = !0;
  15170. else { b.preventDefault(); return }
  15171. if ("touch" === b.pointerType || "pen" === b.pointerType) a.Sp = !1, a.uk = !0;
  15172. c = gm(a, b, b, d);
  15173. "touch" !== b.pointerType && (c.button = b.button, void 0 === b.buttons || D.Mu || (c.buttons = b.buttons), D.Qh && 0 === b.button && b.ctrlKey && (c.button = 2));
  15174. a.doMouseDown();
  15175. 1 === b.button ? b.preventDefault() : ga(a, c, b)
  15176. }
  15177. };
  15178. a.Kq = function(b) {
  15179. if (a.isEnabled) {
  15180. a.th = !0;
  15181. var c = a.Dp;
  15182. if (null !== c[0] && c[0].pointerId === b.pointerId) c[0] = b;
  15183. else {
  15184. if (null !== c[1] && c[1].pointerId === b.pointerId) { c[1] = b; return }
  15185. if (null === c[0]) c[0] = b;
  15186. else return
  15187. }
  15188. c[0].pointerId === b.pointerId && (c = hm(a, b, b, null !== c[1]), "touch" !== b.pointerType && (c.button =
  15189. b.button, void 0 === b.buttons || D.Mu || (c.buttons = b.buttons), D.Qh && 0 === b.button && b.ctrlKey && (c.button = 2)), a.simulatedMouseMove(b, null, c.Qf) || (a.doMouseMove(), ga(a, c, b)))
  15190. }
  15191. };
  15192. a.Mq = function(b) {
  15193. if (a.isEnabled) {
  15194. a.th = !0;
  15195. var c = "touch" === b.pointerType || "pen" === b.pointerType,
  15196. d = a.jA;
  15197. if (c && a.Sp) delete d[b.pointerId], b.preventDefault();
  15198. else if (d = a.Dp, null !== d[0] && d[0].pointerId === b.pointerId) {
  15199. d[0] = null;
  15200. d = a.Hd;
  15201. a.Hd = a.cc;
  15202. a.cc = d;
  15203. var e = window.document.elementFromPoint(b.clientX, b.clientY);
  15204. null !== e && e.ca instanceof E &&
  15205. e.ca !== a && em(e.ca, b, d);
  15206. em(a, b, d);
  15207. d.g = a;
  15208. var m = a.ww,
  15209. n = c ? 25 : 10;
  15210. b.timeStamp - a.wk < a.yA && !(Math.abs(m.x - b.screenX) > n || Math.abs(m.y - b.screenY) > n) ? a.ji++ : a.ji = 1;
  15211. d.Ee = a.ji;
  15212. a.wk = b.timeStamp;
  15213. a.ww.n(b.screenX, b.screenY);
  15214. m = 0;
  15215. b.ctrlKey && (m += 1);
  15216. b.altKey && (m += 2);
  15217. b.shiftKey && (m += 4);
  15218. b.metaKey && (m += 8);
  15219. d.xd = m;
  15220. d.button = b.button;
  15221. void 0 === b.buttons || D.Mu || (d.buttons = b.buttons);
  15222. D.Qh && 0 === b.button && b.ctrlKey && (d.button = 2);
  15223. d.Vk = !1;
  15224. d.up = !0;
  15225. d.Uk = 0;
  15226. d.Cc = !1;
  15227. d.bubbles = !0;
  15228. d.event = b;
  15229. d.timestamp = Date.now();
  15230. d.Qf = null === e ? fm(b) : e.ca ?
  15231. e.ca : null;
  15232. d.Ne = null;
  15233. a.simulatedMouseUp(b, null, new N, d.Qf) || (a.doMouseUp(), Di(a), ga(a, d, b), c && (a.uk = !1))
  15234. } else null !== d[1] && d[1].pointerId === b.pointerId && (d[1] = null)
  15235. }
  15236. };
  15237. a.Lq = function(b) {
  15238. if (a.isEnabled) {
  15239. a.th = !1;
  15240. var c = a.jA;
  15241. c[b.pointerId] && delete c[b.pointerId];
  15242. c = a.Dp;
  15243. null !== c[0] && c[0].pointerId === b.pointerId && (c[0] = null);
  15244. null !== c[1] && c[1].pointerId === b.pointerId && (c[1] = null);
  15245. "touch" !== b.pointerType && "pen" !== b.pointerType && (b = a.eb, b.cancelWaitAfter(), b.standardMouseOver())
  15246. }
  15247. };
  15248. d.De(!0);
  15249. Ql(a)
  15250. }
  15251. function Vn(a) {
  15252. 1 < arguments.length && D.k("Palette constructor can only take one optional argument, the DIV HTML element or its id.");
  15253. E.call(this, a);
  15254. this.du = !0;
  15255. this.fm = !1;
  15256. this.qb = !0;
  15257. this.LA = jc;
  15258. this.Yb = new Wn
  15259. }
  15260. D.Ta(Vn, E);
  15261. D.ka("Palette", Vn);
  15262. function Jl(a) {
  15263. 1 < arguments.length && D.k("Overview constructor can only take one optional argument, the DIV HTML element or its id.");
  15264. E.call(this, a);
  15265. this.Ra.isEnabled = !1;
  15266. this.ed = !0;
  15267. this.Dk = null;
  15268. this.bw = !0;
  15269. this.sK("drawShadows", !1);
  15270. var b = new F,
  15271. c = new z;
  15272. c.stroke = "magenta";
  15273. c.lb = 2;
  15274. c.fill = "transparent";
  15275. c.name = "BOXSHAPE";
  15276. b.il = !0;
  15277. b.Py = "BOXSHAPE";
  15278. b.uy = "BOXSHAPE";
  15279. b.SG = "BOXSHAPE";
  15280. b.cursor = "move";
  15281. b.add(c);
  15282. this.Om = b;
  15283. c = new da;
  15284. c.type = Xj;
  15285. c.Of = mc;
  15286. var d = new Yj;
  15287. d.Ue = !0;
  15288. c.add(d);
  15289. d = new z;
  15290. d.Gh = mc;
  15291. d.Kb = "Rectangle";
  15292. d.Ea = new Ca(64,
  15293. 64);
  15294. d.cursor = "se-resize";
  15295. d.alignment = vc;
  15296. c.add(d);
  15297. b.QG = c;
  15298. this.Cn = this.Pk = !1;
  15299. this.Jf = this.fu = !0;
  15300. this.dF = new Lb(0, 0, 0, 0);
  15301. this.tA = new ja(null);
  15302. this.QH = this.tA.Tk;
  15303. this.nb.Ge = new Xn;
  15304. this.nb.TG = new Yn;
  15305. var e = this;
  15306. this.click = function() {
  15307. var a = e.Dk;
  15308. if (null !== a) {
  15309. var b = a.wb,
  15310. c = e.U.ha;
  15311. a.position = new N(c.x - b.width / 2, c.y - b.height / 2)
  15312. }
  15313. };
  15314. this.CG = function() { Zn(e) };
  15315. this.BG = function() { null !== e.Dk && (e.Qc(), e.ra()) };
  15316. this.im = bm;
  15317. this.ed = !1
  15318. }
  15319. D.Ta(Jl, E);
  15320. D.ka("Overview", Jl);
  15321. function $n(a) {
  15322. a.ed || a.je || !1 !== a.cg || (a.cg = !0, requestAnimationFrame(function() {
  15323. if (a.cg && !a.je && (a.cg = !1, null !== a.Ub)) {
  15324. a.je = !0;
  15325. Si(a);
  15326. a.kd.H() || am(a, a.Kh());
  15327. null === a.Ub && D.k("No div specified");
  15328. null === a.Ib && D.k("No canvas specified");
  15329. if (a.Oe) {
  15330. var b = a.Dk;
  15331. if (null !== b && !b.Ra.nf && !b.Ra.zc) {
  15332. var b = a.dd,
  15333. c = a.tA;
  15334. b.setTransform(1, 0, 0, 1, 0, 0);
  15335. b.clearRect(0, 0, a.Ib.width, a.Ib.height);
  15336. b.drawImage(c.$d, 0, 0);
  15337. c = a.Nc;
  15338. c.reset();
  15339. 1 !== a.scale && c.scale(a.scale);
  15340. 0 === a.position.x && 0 === a.position.y || c.translate(-a.position.x, -a.position.y);
  15341. b.scale(a.ud, a.ud);
  15342. b.transform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy);
  15343. for (var c = a.dc.o, d = c.length, e = 0; e < d; e++) c[e].He(b, a);
  15344. a.Jl = !1;
  15345. a.Oe = !1
  15346. }
  15347. }
  15348. a.je = !1
  15349. }
  15350. }))
  15351. }
  15352. Jl.prototype.computePixelRatio = function() { return 1 };
  15353. Jl.prototype.He = function() {
  15354. null === this.Ub && D.k("No div specified");
  15355. null === this.Ib && D.k("No canvas specified");
  15356. if (this.Oe) {
  15357. var a = this.Dk;
  15358. if (null !== a && !a.Ra.nf) {
  15359. Qm(this);
  15360. var b = a.Vn;
  15361. (null !== b && b.visible && isNaN(b.width) || isNaN(b.height)) && lm(a);
  15362. var c = this.Ib,
  15363. b = this.dd,
  15364. d = this.tA,
  15365. e = this.QH;
  15366. d.width = c.width;
  15367. d.height = c.height;
  15368. b.De(!0);
  15369. b.setTransform(1, 0, 0, 1, 0, 0);
  15370. b.clearRect(0, 0, c.width, c.height);
  15371. var g = this.Nc;
  15372. g.reset();
  15373. 1 !== this.scale && g.scale(this.scale);
  15374. 0 === this.position.x && 0 === this.position.y || g.translate(-this.position.x, -this.position.y);
  15375. b.scale(this.ud, this.ud);
  15376. b.transform(g.m11, g.m12, g.m21, g.m22, g.dx, g.dy);
  15377. for (var h = this.bw, k = this.wb, l = a.dc.o, m = l.length, a = 0; a < m; a++) {
  15378. var n = l[a],
  15379. p = b,
  15380. q = k,
  15381. r = h;
  15382. if (n.visible && 0 !== n.Lc && (void 0 === r && (r = !0), r || !n.Yc)) {
  15383. 1 !== n.Lc && (p.globalAlpha = n.Lc);
  15384. for (var r = this.scale, n = n.rb.o, s = n.length, u = 0; u < s; u++) {
  15385. var t = n[u],
  15386. y = t.aa;
  15387. y.jg(q) && (1 < y.width * r || 1 < y.height * r ? t.He(p, this) : vl(t, p))
  15388. }
  15389. p.globalAlpha = 1
  15390. }
  15391. }
  15392. e.drawImage(c.$d, 0, 0);
  15393. v && v.Dj && (e.fillStyle = "red", e.fillRect(0, d.height / 2, d.width, 4));
  15394. c = this.dc.o;
  15395. d = c.length;
  15396. for (a = 0; a < d; a++) c[a].He(b, this);
  15397. v && (v.WA || v.Dj) && v.VA(b, this, g);
  15398. this.Oe = this.Jl = !1
  15399. }
  15400. }
  15401. };
  15402. D.defineProperty(Jl, { KB: "observed" }, function() { return this.Dk }, function(a) {
  15403. var b = this.Dk;
  15404. null !== a && D.l(a, E, Jl, "observed");
  15405. a instanceof Jl && D.k("Overview.observed Diagram may not be an Overview itself: " + a);
  15406. b !== a && (null !== b && (this.remove(this.Jh), b.QB("ViewportBoundsChanged", this.CG), b.QB("DocumentBoundsChanged", this.BG), b.Qw.remove(this)), this.Dk = a, null !== a && (a.xx("ViewportBoundsChanged", this.CG), a.xx("DocumentBoundsChanged", this.BG), a.Qw.add(this), this.add(this.Jh), Zn(this)), this.Qc(), this.i("observed",
  15407. b, a))
  15408. });
  15409. D.defineProperty(Jl, { Jh: "box" }, function() { return this.Om }, function(a) {
  15410. var b = this.Om;
  15411. b !== a && (this.Om = a, this.remove(b), this.add(this.Om), Zn(this), this.i("box", b, a))
  15412. });
  15413. D.defineProperty(Jl, { OL: "drawsTemporaryLayers" }, function() { return this.bw }, function(a) { this.bw !== a && (this.bw = a, this.ro()) });
  15414. function Zn(a) {
  15415. var b = a.Jh;
  15416. if (null !== b) {
  15417. var c = a.Dk;
  15418. if (null !== c) {
  15419. a.Oe = !0;
  15420. var c = c.wb,
  15421. d = b.to,
  15422. e = D.Gm();
  15423. e.n(c.width, c.height);
  15424. d.Ea = e;
  15425. D.Zk(e);
  15426. a = 2 / a.scale;
  15427. d instanceof z && (d.lb = a);
  15428. b.location = new N(c.x - a / 2, c.y - a / 2)
  15429. }
  15430. }
  15431. }
  15432. Jl.prototype.Kh = function() { var a = this.Dk; return null === a ? Ld : a.kd };
  15433. Jl.prototype.dG = function() {!0 !== this.Oe && (this.Oe = !0, $n(this)) };
  15434. Jl.prototype.dv = function(a, b, c, d, e) { this.ed || (Wl(this), this.ra(), im(this), this.Qc(), Zn(this), this.Fh.scale = c, this.Fh.position.x = a.x, this.Fh.position.y = a.y, this.Fh.bounds.set(a), this.Fh.isScroll = e, this.Ja("ViewportBoundsChanged", this.Fh, a)) };
  15435. function Xn() {
  15436. Uh.call(this);
  15437. this.Tl = null
  15438. }
  15439. D.Ta(Xn, Uh);
  15440. Xn.prototype.canStart = function() {
  15441. if (!this.isEnabled) return !1;
  15442. var a = this.g;
  15443. if (null === a || !a.fm || !a.Jf) return !1;
  15444. var b = a.KB;
  15445. if (null === b) return !1;
  15446. if (null === this.findDraggablePart()) {
  15447. var c = b.wb;
  15448. this.Tl = new N(c.width / 2, c.height / 2);
  15449. a = a.Pc.ha;
  15450. b.position = new N(a.x - this.Tl.x, a.y - this.Tl.y)
  15451. }
  15452. return !0
  15453. };
  15454. Xn.prototype.doActivate = function() {
  15455. this.Tl = null;
  15456. Uh.prototype.doActivate.call(this)
  15457. };
  15458. Xn.prototype.moveParts = function() {
  15459. var a = this.g,
  15460. b = a.KB;
  15461. if (null !== b) {
  15462. var c = a.Jh;
  15463. if (null !== c) {
  15464. if (null === this.Tl) {
  15465. var d = a.Pc.ha,
  15466. c = c.location;
  15467. this.Tl = new N(d.x - c.x, d.y - c.y)
  15468. }
  15469. a = a.U.ha;
  15470. b.position = new N(a.x - this.Tl.x, a.y - this.Tl.y)
  15471. }
  15472. }
  15473. };
  15474. function Yn() { Wj.call(this) }
  15475. D.Ta(Yn, Wj);
  15476. Yn.prototype.resize = function(a) {
  15477. var b = this.g.KB;
  15478. if (null !== b) {
  15479. var c = b.wb.copy();
  15480. b.position = a.position;
  15481. (c.width !== a.width || c.height !== a.height) && 0 < a.width && 0 < a.height && (b.scale = Math.min(c.width / a.width, c.height / a.height))
  15482. }
  15483. };
  15484. function ao() { this.pg = this.nd = this.Qd = this.Rc = 0 }
  15485. function Ba(a) {
  15486. 1 < arguments.length && D.k("Brush constructor can take at most one optional argument, the Brush type.");
  15487. D.xc(this);
  15488. this.J = !1;
  15489. void 0 === a ? (this.da = Fg, this.Lo = "black") : "string" === typeof a ? (this.da = Fg, v && !za(a) && D.k('Color "' + a + '" is not a valid color string for Brush constructor'), this.Lo = a) : (v && D.Da(a, Ba, Ba, "constructor:type"), this.da = a, this.Lo = "black");
  15490. var b = this.da;
  15491. b === Gg ? (this.Mp = jc, this.Zo = uc) : this.Zo = b === Id ? this.Mp = mc : this.Mp = dc;
  15492. this.lx = 0;
  15493. this.cw = NaN;
  15494. this.qh = this.Tw = this.ph = null;
  15495. this.xz =
  15496. this.Mo = 0
  15497. }
  15498. D.ka("Brush", Ba);
  15499. var Fg;
  15500. Ba.Solid = Fg = D.s(Ba, "Solid", 0);
  15501. var Gg;
  15502. Ba.Linear = Gg = D.s(Ba, "Linear", 1);
  15503. var Id;
  15504. Ba.Radial = Id = D.s(Ba, "Radial", 2);
  15505. var bo;
  15506. Ba.Pattern = bo = D.s(Ba, "Pattern", 4);
  15507. var co;
  15508. Ba.Lab = co = D.s(Ba, "Lab", 5);
  15509. var eo;
  15510. Ba.HSL = eo = D.s(Ba, "HSL", 6);
  15511. Ba.prototype.copy = function() {
  15512. var a = new Ba;
  15513. a.da = this.da;
  15514. a.Lo = this.Lo;
  15515. a.Mp = this.Mp.V();
  15516. a.Zo = this.Zo.V();
  15517. a.lx = this.lx;
  15518. a.cw = this.cw;
  15519. null !== this.ph && (a.ph = this.ph.copy());
  15520. a.Tw = this.Tw;
  15521. return a
  15522. };
  15523. f = Ba.prototype;
  15524. f.Oa = function() {
  15525. this.freeze();
  15526. Object.freeze(this);
  15527. return this
  15528. };
  15529. f.freeze = function() {
  15530. this.J = !0;
  15531. null !== this.ph && this.ph.freeze();
  15532. return this
  15533. };
  15534. f.Xa = function() {
  15535. Object.isFrozen(this) && D.k("cannot thaw constant: " + this);
  15536. this.J = !1;
  15537. null !== this.ph && this.ph.Xa();
  15538. return this
  15539. };
  15540. f.qc = function(a) { a.Qe === Ba ? this.type = a : D.ak(this, a) };
  15541. f.toString = function() {
  15542. var a = "Brush(";
  15543. if (this.type === Fg) a += this.color;
  15544. else if (a = this.type === Gg ? a + "Linear " : this.type === Id ? a + "Radial " : this.type === bo ? a + "Pattern " : a + "(unknown) ", a += this.start + " " + this.end, null !== this.Qk)
  15545. for (var b = this.Qk.j; b.next();) a += " " + b.key + ":" + b.value;
  15546. return a + ")"
  15547. };
  15548. Ba.prototype.addColorStop = Ba.prototype.addColorStop = function(a, b) {
  15549. this.J && D.qa(this);
  15550. ("number" !== typeof a || !isFinite(a) || 1 < a || 0 > a) && D.ua(a, "0 <= loc <= 1", Ba, "addColorStop:loc");
  15551. D.h(b, "string", Ba, "addColorStop:color");
  15552. v && !za(b) && D.k('Color "' + b + '" is not a valid color string for Brush.addColorStop');
  15553. null === this.ph && (this.ph = new oa("number", "string"));
  15554. this.ph.add(a, b);
  15555. this.da === Fg && (this.type = Gg);
  15556. this.qh = null
  15557. };
  15558. D.defineProperty(Ba, { type: "type" }, function() { return this.da }, function(a) {
  15559. this.J && D.qa(this, a);
  15560. D.Da(a, Ba, Ba, "type");
  15561. this.da = a;
  15562. this.start.de() && (a === Gg ? this.start = jc : a === Id && (this.start = mc));
  15563. this.end.de() && (a === Gg ? this.end = uc : a === Id && (this.end = mc));
  15564. this.qh = null
  15565. });
  15566. D.defineProperty(Ba, { color: "color" }, function() { return this.Lo }, function(a) {
  15567. this.J && D.qa(this, a);
  15568. v && !za(a) && D.k('Color "' + a + '" is not a valid color string for Brush.color');
  15569. this.Lo = a;
  15570. this.qh = null
  15571. });
  15572. D.defineProperty(Ba, { start: "start" }, function() { return this.Mp }, function(a) {
  15573. this.J && D.qa(this, a);
  15574. D.l(a, S, Ba, "start");
  15575. this.Mp = a.V();
  15576. this.qh = null
  15577. });
  15578. D.defineProperty(Ba, { end: "end" }, function() { return this.Zo }, function(a) {
  15579. this.J && D.qa(this, a);
  15580. D.l(a, S, Ba, "end");
  15581. this.Zo = a.V();
  15582. this.qh = null
  15583. });
  15584. D.defineProperty(Ba, { sv: "startRadius" }, function() { return this.lx }, function(a) {
  15585. this.J && D.qa(this, a);
  15586. D.p(a, Ba, "startRadius");
  15587. 0 > a && D.ua(a, ">= zero", Ba, "startRadius");
  15588. this.lx = a;
  15589. this.qh = null
  15590. });
  15591. D.defineProperty(Ba, { ou: "endRadius" }, function() { return this.cw }, function(a) {
  15592. this.J && D.qa(this, a);
  15593. D.p(a, Ba, "endRadius");
  15594. 0 > a && D.ua(a, ">= zero", Ba, "endRadius");
  15595. this.cw = a;
  15596. this.qh = null
  15597. });
  15598. D.defineProperty(Ba, { Qk: "colorStops" }, function() { return this.ph }, function(a) {
  15599. this.J && D.qa(this, a);
  15600. v && D.l(a, oa, Ba, "colorStops");
  15601. this.ph = a;
  15602. this.qh = null
  15603. });
  15604. D.defineProperty(Ba, { pattern: "pattern" }, function() { return this.Tw }, function(a) {
  15605. this.J && D.qa(this, a);
  15606. this.Tw = a;
  15607. this.qh = null
  15608. });
  15609. Ba.randomColor = function(a, b) {
  15610. void 0 === a && (a = 128);
  15611. v && (D.p(a, Ba, "randomColor:min"), (0 > a || 255 < a) && D.ua(a, "0 <= min <= 255", Ba, "randomColor:min"));
  15612. void 0 === b && (b = Math.max(a, 255));
  15613. v && (D.p(b, Ba, "randomColor:max"), (b < a || 255 < b) && D.ua(b, "min <= max <= 255", Ba, "randomColor:max"));
  15614. var c = Math.abs(b - a),
  15615. d = Math.floor(a + Math.random() * c).toString(16),
  15616. e = Math.floor(a + Math.random() * c).toString(16),
  15617. c = Math.floor(a + Math.random() * c).toString(16);
  15618. 2 > d.length && (d = "0" + d);
  15619. 2 > e.length && (e = "0" + e);
  15620. 2 > c.length && (c = "0" + c);
  15621. return "#" +
  15622. d + e + c
  15623. };
  15624. var fo = (new ja(null)).Tk,
  15625. za;
  15626. Ba.isValidColor = za = function(a) {
  15627. if ("black" === a) return !0;
  15628. if ("" === a) return !1;
  15629. v && D.h(a, "string", Ba, "isValidColor");
  15630. fo.fillStyle = "#000000";
  15631. var b = fo.fillStyle;
  15632. fo.fillStyle = a;
  15633. if (fo.fillStyle !== b) return !0;
  15634. fo.fillStyle = "#FFFFFF";
  15635. b = fo.fillStyle;
  15636. fo.fillStyle = a;
  15637. return fo.fillStyle !== b
  15638. };
  15639. var ho = new ao,
  15640. io = new ao,
  15641. jo = new ao,
  15642. ko = new ao;
  15643. Ba.lighten = function(a) { return lo(a) };
  15644. Ba.prototype.lightenBy = function(a, b) {
  15645. this.J && D.qa(this);
  15646. var c = void 0 === a || "number" !== typeof a ? .2 : a,
  15647. d = void 0 === b ? co : b;
  15648. if (this.type === Fg) mo(this.color), this.color = no(c, d);
  15649. else if ((this.type === Gg || this.type === Id) && null !== this.Qk)
  15650. for (var e = this.Qk.j; e.next();) mo(e.value), this.addColorStop(e.key, no(c, d));
  15651. return this
  15652. };
  15653. var lo;
  15654. Ba.lightenBy = lo = function(a, b, c) {
  15655. b = void 0 === b || "number" !== typeof b ? .2 : b;
  15656. c = void 0 === c ? co : c;
  15657. mo(a);
  15658. return no(b, c)
  15659. };
  15660. Ba.darken = function(a) { return oo(a) };
  15661. Ba.prototype.darkenBy = function(a, b) {
  15662. this.J && D.qa(this);
  15663. var c = void 0 === a || "number" !== typeof a ? .2 : a,
  15664. d = void 0 === b ? co : b;
  15665. if (this.type === Fg) mo(this.color), this.color = no(-c, d);
  15666. else if ((this.type === Gg || this.type === Id) && null !== this.Qk)
  15667. for (var e = this.Qk.j; e.next();) mo(e.value), this.addColorStop(e.key, no(-c, d));
  15668. return this
  15669. };
  15670. var oo;
  15671. Ba.darkenBy = oo = function(a, b, c) {
  15672. b = void 0 === b || "number" !== typeof b ? .2 : b;
  15673. c = void 0 === c ? co : c;
  15674. mo(a);
  15675. return no(-b, c)
  15676. };
  15677. function no(a, b) {
  15678. switch (b) {
  15679. case co:
  15680. var c = 100 * po(ho.Rc),
  15681. d = 100 * po(ho.Qd),
  15682. e = 100 * po(ho.nd);
  15683. jo.Rc = .4124564 * c + .3575761 * d + .1804375 * e;
  15684. jo.Qd = .2126729 * c + .7151522 * d + .072175 * e;
  15685. jo.nd = .0193339 * c + .119192 * d + .9503041 * e;
  15686. jo.pg = ho.pg;
  15687. c = qo(jo.Rc / ro[0]);
  15688. d = qo(jo.Qd / ro[1]);
  15689. e = qo(jo.nd / ro[2]);
  15690. ko.Rc = 116 * d - 16;
  15691. ko.Qd = 500 * (c - d);
  15692. ko.nd = 200 * (d - e);
  15693. ko.pg = jo.pg;
  15694. ko.Rc = Math.min(100, Math.max(0, ko.Rc + 100 * a));
  15695. c = (ko.Rc + 16) / 116;
  15696. d = c - ko.nd / 200;
  15697. jo.Rc = ro[0] * so(ko.Qd / 500 + c);
  15698. jo.Qd = ro[1] * (ko.Rc > to * uo ? Math.pow(c, 3) : ko.Rc / to);
  15699. jo.nd = ro[2] * so(d);
  15700. jo.pg =
  15701. ko.pg;
  15702. c = -.969266 * jo.Rc + 1.8760108 * jo.Qd + .041556 * jo.nd;
  15703. d = .0556434 * jo.Rc + -.2040259 * jo.Qd + 1.0572252 * jo.nd;
  15704. ho.Rc = 255 * vo((3.2404542 * jo.Rc + -1.5371385 * jo.Qd + -.4985314 * jo.nd) / 100);
  15705. ho.Qd = 255 * vo(c / 100);
  15706. ho.nd = 255 * vo(d / 100);
  15707. ho.pg = jo.pg;
  15708. ho.Rc = Math.round(ho.Rc);
  15709. 255 < ho.Rc ? ho.Rc = 255 : 0 > ho.Rc && (ho.Rc = 0);
  15710. ho.Qd = Math.round(ho.Qd);
  15711. 255 < ho.Qd ? ho.Qd = 255 : 0 > ho.Qd && (ho.Qd = 0);
  15712. ho.nd = Math.round(ho.nd);
  15713. 255 < ho.nd ? ho.nd = 255 : 0 > ho.nd && (ho.nd = 0);
  15714. return "rgba(" + ho.Rc + ", " + ho.Qd + ", " + ho.nd + ", " + ho.pg + ")";
  15715. case eo:
  15716. var e = ho.Rc / 255,
  15717. g = ho.Qd /
  15718. 255,
  15719. h = ho.nd / 255,
  15720. k = Math.max(e, g, h),
  15721. d = Math.min(e, g, h),
  15722. l = k - d,
  15723. d = (k + d) / 2;
  15724. if (0 === l) c = e = 0;
  15725. else {
  15726. switch (k) {
  15727. case e:
  15728. c = (g - h) / l % 6;
  15729. break;
  15730. case g:
  15731. c = (h - e) / l + 2;
  15732. break;
  15733. case h:
  15734. c = (e - g) / l + 4
  15735. }
  15736. c *= 60;
  15737. 0 > c && (c += 360);
  15738. e = l / (1 - Math.abs(2 * d - 1))
  15739. }
  15740. io.Rc = Math.round(c);
  15741. io.Qd = Math.round(100 * e);
  15742. io.nd = Math.round(100 * d);
  15743. io.pg = ho.pg;
  15744. io.nd = Math.min(100, Math.max(0, io.nd + 100 * a));
  15745. return "hsla(" + io.Rc + ", " + io.Qd + "%, " + io.nd + "%, " + io.pg + ")";
  15746. default:
  15747. return D.k("Unknown color space: " + b), "rgba(0, 0, 0, 1)"
  15748. }
  15749. }
  15750. function mo(a) {
  15751. fo.clearRect(0, 0, 1, 1);
  15752. fo.fillStyle = "#000000";
  15753. var b = fo.fillStyle;
  15754. fo.fillStyle = a;
  15755. fo.fillStyle !== b ? (fo.fillRect(0, 0, 1, 1), a = fo.getImageData(0, 0, 1, 1).data, ho.Rc = a[0], ho.Qd = a[1], ho.nd = a[2], ho.pg = a[3] / 255) : (fo.fillStyle = "#FFFFFF", b = fo.fillStyle, fo.fillStyle = a, fo.fillStyle === b && v && D.k('Color "' + a + '" is not a valid color string for RGBA color conversion'), ho.Rc = 0, ho.Qd = 0, ho.nd = 0, ho.pg = 1)
  15756. }
  15757. function po(a) { a /= 255; return .04045 >= a ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4) }
  15758. function vo(a) { return .0031308 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - .055 }
  15759. var uo = 216 / 24389,
  15760. to = 24389 / 27,
  15761. ro = [95.047, 100, 108.883];
  15762. function qo(a) { return a > uo ? Math.pow(a, 1 / 3) : (to * a + 16) / 116 }
  15763. function so(a) { var b = a * a * a; return b > uo ? b : (116 * a - 16) / to }
  15764. function O() {
  15765. D.xc(this);
  15766. this.S = 4225027;
  15767. this.Lc = 1;
  15768. this.rj = null;
  15769. this.$b = "";
  15770. this.lc = this.Mb = null;
  15771. this.sb = (new N(NaN, NaN)).freeze();
  15772. this.$e = ie;
  15773. this.oi = Xd;
  15774. this.ni = ge;
  15775. this.Nc = new Ea;
  15776. this.Ni = new Ea;
  15777. this.ij = new Ea;
  15778. this.Db = this.Xo = 1;
  15779. this.wg = 0;
  15780. this.Qg = wo;
  15781. this.en = Sd;
  15782. this.Fd = (new C(NaN, NaN, NaN, NaN)).freeze();
  15783. this.bc = (new C(NaN, NaN, NaN, NaN)).freeze();
  15784. this.fd = (new C(0, 0, NaN, NaN)).freeze();
  15785. this.Z = this.it = this.jt = null;
  15786. this.Lm = this.ue = Vc;
  15787. this.vt = 0;
  15788. this.tj = 1;
  15789. this.wr = 0;
  15790. this.Si = 1;
  15791. this.Lt = null;
  15792. this.zt = -Infinity;
  15793. this.qn =
  15794. 0;
  15795. this.rn = Kd;
  15796. this.sn = vj;
  15797. this.Fr = "";
  15798. this.Hc = this.ma = null;
  15799. this.Jo = -1;
  15800. this.wn = this.yg = this.Bl = this.Lp = null;
  15801. this.kA = Qj;
  15802. this.mn = null
  15803. }
  15804. D.Di(O);
  15805. D.ka("GraphObject", O);
  15806. O.prototype.cloneProtected = function(a) {
  15807. a.S = this.S | 6144;
  15808. a.Lc = this.Lc;
  15809. a.$b = this.$b;
  15810. a.Mb = this.Mb;
  15811. a.lc = this.lc;
  15812. a.sb.assign(this.sb);
  15813. a.$e = this.$e.V();
  15814. a.oi = this.oi.V();
  15815. a.ni = this.ni.V();
  15816. a.ij = this.ij.copy();
  15817. a.Db = this.Db;
  15818. a.wg = this.wg;
  15819. a.Qg = this.Qg;
  15820. a.en = this.en.V();
  15821. a.Fd.assign(this.Fd);
  15822. a.bc.assign(this.bc);
  15823. a.fd.assign(this.fd);
  15824. a.it = this.it;
  15825. null !== this.Z && (a.Z = this.Z.copy());
  15826. a.ue = this.ue.V();
  15827. a.Lm = this.Lm.V();
  15828. a.vt = this.vt;
  15829. a.tj = this.tj;
  15830. a.wr = this.wr;
  15831. a.Si = this.Si;
  15832. a.Lt = this.Lt;
  15833. a.zt = this.zt;
  15834. a.qn = this.qn;
  15835. a.rn = this.rn.V();
  15836. a.sn = this.sn;
  15837. a.Fr = this.Fr;
  15838. null !== this.ma && (a.ma = this.ma.copy());
  15839. a.Hc = this.Hc;
  15840. a.Jo = this.Jo;
  15841. null !== this.Bl && (a.Bl = D.km(this.Bl));
  15842. null !== this.yg && (a.yg = this.yg.copy());
  15843. a.wn = this.wn
  15844. };
  15845. O.prototype.addCopyProperty = O.prototype.WH = function(a) {
  15846. var b = this.Bl;
  15847. if (D.isArray(b))
  15848. for (var c = 0; c < b.length; c++) { if (b[c] === a) return } else this.Bl = b = [];
  15849. b.push(a)
  15850. };
  15851. O.prototype.Ei = function(a) {
  15852. a.jt = null;
  15853. a.mn = null;
  15854. a.K()
  15855. };
  15856. O.prototype.clone = function() {
  15857. var a = new this.constructor;
  15858. this.cloneProtected(a);
  15859. if (null !== this.Bl)
  15860. for (var b = 0; b < this.Bl.length; b++) {
  15861. var c = this.Bl[b];
  15862. a[c] = this[c]
  15863. }
  15864. return a
  15865. };
  15866. O.prototype.copy = function() { return this.clone() };
  15867. O.prototype.qc = function(a) { a.Qe === J ? 0 === a.name.indexOf("Orient") ? this.Uq = a : D.k("Unknown Link enum value for GraphObject.segmentOrientation property: " + a) : a.Qe === O ? this.stretch = a : D.ak(this, a) };
  15868. O.prototype.toString = function() { return D.wf(Object.getPrototypeOf(this)) + "#" + D.Nd(this) };
  15869. var Zj;
  15870. O.None = Zj = D.s(O, "None", 0);
  15871. var wo;
  15872. O.Default = wo = D.s(O, "Default", 0);
  15873. var xo;
  15874. O.Vertical = xo = D.s(O, "Vertical", 4);
  15875. var yo;
  15876. O.Horizontal = yo = D.s(O, "Horizontal", 5);
  15877. var Ye;
  15878. O.Fill = Ye = D.s(O, "Fill", 3);
  15879. var bk;
  15880. O.Uniform = bk = D.s(O, "Uniform", 1);
  15881. var ck;
  15882. O.UniformToFill = ck = D.s(O, "UniformToFill", 2);
  15883. var zo;
  15884. O.FlipVertical = zo = D.s(O, "FlipVertical", 1);
  15885. var Ao;
  15886. O.FlipHorizontal = Ao = D.s(O, "FlipHorizontal", 2);
  15887. var Bo;
  15888. O.FlipBoth = Bo = D.s(O, "FlipBoth", 3);
  15889. function Co(a) { null === a.ma && (a.ma = new Do) }
  15890. O.prototype.ae = function() {
  15891. if (null === this.Z) {
  15892. var a = new Eo;
  15893. a.ok = dc;
  15894. a.Mk = dc;
  15895. a.mk = 10;
  15896. a.Kk = 10;
  15897. a.lk = Fo;
  15898. a.Jk = Fo;
  15899. a.nk = 0;
  15900. a.Lk = 0;
  15901. this.Z = a
  15902. }
  15903. };
  15904. function Go(a, b, c, d, e, g, h) {
  15905. var k = .001,
  15906. l = g.length;
  15907. a.moveTo(b, c);
  15908. d -= b;
  15909. k = e - c;
  15910. 0 === d && (d = .001);
  15911. e = k / d;
  15912. for (var m = Math.sqrt(d * d + k * k), n = 0, p = !0, q = 0 === h ? !1 : !0; .1 <= m;) {
  15913. if (q) {
  15914. k = g[n++ % l];
  15915. for (k -= h; 0 > k;) k += g[n++ % l], p = !p;
  15916. q = !1
  15917. } else k = g[n++ % l];
  15918. k > m && (k = m);
  15919. var r = Math.sqrt(k * k / (1 + e * e));
  15920. 0 > d && (r = -r);
  15921. b += r;
  15922. c += e * r;
  15923. p ? a.lineTo(b, c) : a.moveTo(b, c);
  15924. m -= k;
  15925. p = !p
  15926. }
  15927. }
  15928. O.prototype.raiseChangedEvent = O.prototype.od = function(a, b, c, d, e, g, h) {
  15929. var k = this.Y;
  15930. if (null !== k && (k.qo(a, b, c, d, e, g, h), Ho(this) && c === this && a === fg && Io(this, k, b), c === k && 0 !== (k.S & 16777216) && null !== k.data))
  15931. for (a = this.xa.o, c = a.length, d = 0; d < c; d++) e = a[d], e instanceof x && Xm(e, function(a) { null !== a.data && 0 !== (a.S & 16777216) && a.Ob(b) })
  15932. };
  15933. function Io(a, b, c) {
  15934. var d = a.qm();
  15935. if (null !== d)
  15936. for (var e = a.Hc.j; e.next();) {
  15937. var g = e.value,
  15938. h = null;
  15939. if (null !== g.$q) {
  15940. h = sh(g, d, a);
  15941. if (null === h) continue;
  15942. g.Wy(a, h, c, null)
  15943. } else if (g.ly) {
  15944. var k = b.g;
  15945. null === k || k.Xe || g.Wy(a, k.ea.fl, c, d)
  15946. } else {
  15947. var l = d.data;
  15948. if (null === l) continue;
  15949. k = b.g;
  15950. null === k || k.Xe || g.Wy(a, l, c, d)
  15951. }
  15952. h === a && (k = d.Vx(g.Fm), null !== k && g.wH(k, h, c))
  15953. }
  15954. }
  15955. O.prototype.Vx = function(a) { return this.Jo === a ? this : null };
  15956. O.prototype.raiseChanged = O.prototype.i = function(a, b, c) { this.od(fg, a, this, b, c) };
  15957. function Jo(a, b, c, d, e) {
  15958. var g = a.Fd,
  15959. h = a.ij;
  15960. h.reset();
  15961. Ko(a, h, b, c, d, e);
  15962. a.ij = h;
  15963. g.x = b;
  15964. g.y = c;
  15965. g.width = d;
  15966. g.height = e;
  15967. h.Nu() || h.tH(g)
  15968. }
  15969. function Lo(a, b, c, d) {
  15970. if (!1 === a.tg) return !1;
  15971. d.multiply(a.transform);
  15972. return c ? a.jg(b, d) : a.In(b, d)
  15973. }
  15974. O.prototype.JF = function(a, b, c) {
  15975. if (!1 === this.tg) return !1;
  15976. var d = this.Ga;
  15977. b = a.Kf(b);
  15978. var e = !1;
  15979. c && (e = lb(a.x, a.y, 0, 0, 0, d.height) < b || lb(a.x, a.y, 0, d.height, d.width, d.height) < b || lb(a.x, a.y, d.width, d.height, d.width, 0) < b || lb(a.x, a.y, d.width, 0, 0, 0) < b);
  15980. c || (e = lb(a.x, a.y, 0, 0, 0, d.height) < b && lb(a.x, a.y, 0, d.height, d.width, d.height) < b && lb(a.x, a.y, d.width, d.height, d.width, 0) < b && lb(a.x, a.y, d.width, 0, 0, 0) < b);
  15981. return e
  15982. };
  15983. O.prototype.kh = function() { return !0 };
  15984. O.prototype.containsPoint = O.prototype.Pa = function(a) {
  15985. v && D.l(a, N, O, "containsPoint:p");
  15986. var b = D.P();
  15987. b.assign(a);
  15988. this.transform.vb(b);
  15989. var c = this.aa;
  15990. if (!c.H()) return D.A(b), !1;
  15991. var d = this.g;
  15992. if (null !== d && d.uk) {
  15993. var e = d.Cu("extraTouchThreshold"),
  15994. g = d.Cu("extraTouchArea"),
  15995. h = g / 2,
  15996. k = this.Ga,
  15997. d = this.Jj() * d.scale,
  15998. l = 1 / d;
  15999. if (k.width * d < e && k.height * d < e) return a = Vb(c.x - h * l, c.y - h * l, c.width + g * l, c.height + g * l, b.x, b.y), D.A(b), a
  16000. }
  16001. if (this instanceof da || this instanceof z ? Vb(c.x - 5, c.y - 5, c.width + 10, c.height + 10, b.x, b.y) : c.Pa(b)) return e = !1, e = this.yg && !this.yg.Pa(b) ? !1 : null !== this.lc && c.Pa(b) ? !0 : null !== this.Mb && this.fd.Pa(a) ? !0 : this.Rk(a), D.A(b), e;
  16002. D.A(b);
  16003. return !1
  16004. };
  16005. O.prototype.Rk = function(a) { var b = this.Ga; return Vb(0, 0, b.width, b.height, a.x, a.y) };
  16006. O.prototype.containsRect = O.prototype.Sk = function(a) {
  16007. v && D.l(a, C, O, "containsRect:r");
  16008. if (0 === this.angle) return this.aa.Sk(a);
  16009. var b = this.Ga,
  16010. b = D.vg(0, 0, b.width, b.height),
  16011. c = this.transform,
  16012. d = !1,
  16013. e = D.Fb(a.x, a.y);
  16014. b.Pa(c.Oh(e)) && (e.n(a.x, a.bottom), b.Pa(c.Oh(e)) && (e.n(a.right, a.bottom), b.Pa(c.Oh(e)) && (e.n(a.right, a.y), b.Pa(c.Oh(e)) && (d = !0))));
  16015. D.A(e);
  16016. D.Lb(b);
  16017. return d
  16018. };
  16019. O.prototype.containedInRect = O.prototype.In = function(a, b) {
  16020. v && D.l(a, C, O, "containedInRect:r");
  16021. if (void 0 === b) return a.Sk(this.aa);
  16022. var c = this.Ga,
  16023. d = !1,
  16024. e = D.Fb(0, 0);
  16025. a.Pa(b.vb(e)) && (e.n(0, c.height), a.Pa(b.vb(e)) && (e.n(c.width, c.height), a.Pa(b.vb(e)) && (e.n(c.width, 0), a.Pa(b.vb(e)) && (d = !0))));
  16026. D.A(e);
  16027. return d
  16028. };
  16029. O.prototype.intersectsRect = O.prototype.jg = function(a, b) {
  16030. v && D.l(a, C, O, "intersectsRect:r");
  16031. if (void 0 === b && (b = this.transform, 0 === this.angle)) return a.jg(this.aa);
  16032. var c = this.Ga,
  16033. d = b,
  16034. e = D.Fb(0, 0),
  16035. g = D.Fb(0, c.height),
  16036. h = D.Fb(c.width, c.height),
  16037. k = D.Fb(c.width, 0),
  16038. l = !1;
  16039. if (a.Pa(d.vb(e)) || a.Pa(d.vb(g)) || a.Pa(d.vb(h)) || a.Pa(d.vb(k))) l = !0;
  16040. else {
  16041. var c = D.vg(0, 0, c.width, c.height),
  16042. m = D.Fb(a.x, a.y);
  16043. c.Pa(d.Oh(m)) ? l = !0 : (m.n(a.x, a.bottom), c.Pa(d.Oh(m)) ? l = !0 : (m.n(a.right, a.bottom), c.Pa(d.Oh(m)) ? l = !0 : (m.n(a.right, a.y), c.Pa(d.Oh(m)) &&
  16044. (l = !0))));
  16045. D.A(m);
  16046. D.Lb(c);
  16047. !l && (Le(a, e, g) || Le(a, g, h) || Le(a, h, k) || Le(a, k, e)) && (l = !0)
  16048. }
  16049. D.A(e);
  16050. D.A(g);
  16051. D.A(h);
  16052. D.A(k);
  16053. return l
  16054. };
  16055. O.prototype.getDocumentPoint = O.prototype.fb = function(a, b) {
  16056. void 0 === b && (b = new N);
  16057. if (a instanceof S) {
  16058. a.de() && D.k("getDocumentPoint:s Spot must be specific: " + a.toString());
  16059. var c = this.Ga;
  16060. b.n(a.x * c.width + a.offsetX, a.y * c.height + a.offsetY)
  16061. } else b.set(a);
  16062. this.Hh.vb(b);
  16063. return b
  16064. };
  16065. O.prototype.getDocumentAngle = O.prototype.sm = function() {
  16066. var a;
  16067. a = this.Hh;
  16068. 1 === a.m11 && 0 === a.m12 ? a = 0 : (a = 180 * Math.atan2(a.m12, a.m11) / Math.PI, 0 > a && (a += 360));
  16069. return a
  16070. };
  16071. O.prototype.getDocumentScale = O.prototype.Jj = function() { if (0 !== (this.S & 4096) === !1) return this.Xo; var a = this.Db; return null !== this.R ? a * this.R.Jj() : a };
  16072. O.prototype.getLocalPoint = O.prototype.PF = function(a, b) {
  16073. void 0 === b && (b = new N);
  16074. b.assign(a);
  16075. this.Hh.Oh(b);
  16076. return b
  16077. };
  16078. O.prototype.getNearestIntersectionPoint = O.prototype.QF = function(a, b, c) { return this.Tn(a.x, a.y, b.x, b.y, c) };
  16079. f = O.prototype;
  16080. f.Tn = function(a, b, c, d, e) {
  16081. var g = this.transform,
  16082. h = 1 / (g.m11 * g.m22 - g.m12 * g.m21),
  16083. k = g.m22 * h,
  16084. l = -g.m12 * h,
  16085. m = -g.m21 * h,
  16086. n = g.m11 * h,
  16087. p = h * (g.m21 * g.dy - g.m22 * g.dx),
  16088. q = h * (g.m12 * g.dx - g.m11 * g.dy);
  16089. if (null !== this.gm) return g = this.aa, Je(g.left, g.top, g.right, g.bottom, a, b, c, d, e);
  16090. h = a * k + b * m + p;
  16091. a = a * l + b * n + q;
  16092. b = c * k + d * m + p;
  16093. c = c * l + d * n + q;
  16094. e.n(0, 0);
  16095. d = this.Ga;
  16096. c = Je(0, 0, d.width, d.height, h, a, b, c, e);
  16097. e.transform(g);
  16098. return c
  16099. };
  16100. function Hk(a, b, c, d, e) {
  16101. if (!1 !== Nm(a)) {
  16102. var g = a.margin,
  16103. h = g.right + g.left,
  16104. g = g.top + g.bottom;
  16105. b = Math.max(b - h, 0);
  16106. c = Math.max(c - g, 0);
  16107. e = e || 0;
  16108. d = Math.max((d || 0) - h, 0);
  16109. e = Math.max(e - g, 0);
  16110. var h = a.angle,
  16111. g = 0,
  16112. g = a.Ea,
  16113. k = 0;
  16114. a instanceof z && (k = a.lb);
  16115. 90 === h || 270 === h ? (b = isFinite(g.height) ? g.height + k : b, c = isFinite(g.width) ? g.width + k : c) : (b = isFinite(g.width) ? g.width + k : b, c = isFinite(g.height) ? g.height + k : c);
  16116. var g = d || 0,
  16117. k = e || 0,
  16118. l = a instanceof x;
  16119. switch (Mo(a, !0)) {
  16120. case Zj:
  16121. k = g = 0;
  16122. l && (c = b = Infinity);
  16123. break;
  16124. case Ye:
  16125. isFinite(b) && b > d && (g = b);
  16126. isFinite(c) &&
  16127. c > e && (k = c);
  16128. break;
  16129. case yo:
  16130. isFinite(b) && b > d && (g = b);
  16131. k = 0;
  16132. l && (c = Infinity);
  16133. break;
  16134. case xo:
  16135. isFinite(c) && c > e && (k = c), g = 0, l && (b = Infinity)
  16136. }
  16137. var l = a.pf,
  16138. m = a.ah;
  16139. g > l.width && m.width < l.width && (g = l.width);
  16140. k > l.height && m.height < l.height && (k = l.height);
  16141. d = Math.max(g / a.scale, m.width);
  16142. e = Math.max(k / a.scale, m.height);
  16143. l.width < d && (d = Math.min(m.width, d));
  16144. l.height < e && (e = Math.min(m.height, e));
  16145. b = Math.min(l.width, b);
  16146. c = Math.min(l.height, c);
  16147. b = Math.max(d, b);
  16148. c = Math.max(e, c);
  16149. if (90 === h || 270 === h) g = b, b = c, c = g, g = d, d = e, e = g;
  16150. a.Fd.Xa();
  16151. a.ho(b, c,
  16152. d, e);
  16153. a.Fd.freeze();
  16154. a.Fd.H() || D.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Fd.toString());
  16155. km(a, !1)
  16156. }
  16157. }
  16158. f.ho = function() {};
  16159. f.Oj = function() { return !1 };
  16160. f.rc = function(a, b, c, d, e) {
  16161. this.cj();
  16162. var g = D.Sf();
  16163. g.assign(this.bc);
  16164. this.bc.Xa();
  16165. if (!1 === Om(this)) {
  16166. var h = this.bc;
  16167. h.x = a;
  16168. h.y = b;
  16169. h.width = c;
  16170. h.height = d
  16171. } else this.Cj(a, b, c, d);
  16172. this.bc.freeze();
  16173. this.yg = void 0 === e ? null : e;
  16174. c = !1;
  16175. void 0 !== e ? c = !0 : null !== this.R && (e = this.R.fd, d = this.Fa, null !== this.gm && (d = this.bc), c = b + d.height, d = a + d.width, c = !(0 <= a + .05 && d <= e.width + .05 && 0 <= b + .05 && c <= e.height + .05), this instanceof pa && (a = this.fd, this.Cw > a.height || this.sf.Pe > a.width)) && (c = !0);
  16176. this.S = c ? this.S | 256 : this.S & -257;
  16177. this.bc.H() ||
  16178. D.k("Non-real actualBounds has been set. Object " + this + ", actualBounds: " + this.bc.toString());
  16179. this.zy(g, this.bc);
  16180. No(this, !1);
  16181. D.Lb(g)
  16182. };
  16183. f.Cj = function() {};
  16184. function Oo(a, b, c, d, e) {
  16185. var g = a.aa;
  16186. g.x = b;
  16187. g.y = c;
  16188. g.width = d;
  16189. g.height = e;
  16190. if (!a.Ea.H()) {
  16191. g = a.Fd;
  16192. c = a.margin;
  16193. b = c.right + c.left;
  16194. var h = c.top + c.bottom;
  16195. c = g.width + b;
  16196. g = g.height + h;
  16197. d += b;
  16198. e += h;
  16199. b = Mo(a, !0);
  16200. c === d && g === e && (b = Zj);
  16201. switch (b) {
  16202. case Zj:
  16203. if (c > d || g > e) km(a, !0), Hk(a, c > d ? d : c, g > e ? e : g);
  16204. break;
  16205. case Ye:
  16206. km(a, !0);
  16207. Hk(a, d, e, 0, 0);
  16208. break;
  16209. case yo:
  16210. km(a, !0);
  16211. Hk(a, d, g, 0, 0);
  16212. break;
  16213. case xo:
  16214. km(a, !0), Hk(a, c, e, 0, 0)
  16215. }
  16216. }
  16217. }
  16218. f.zy = function(a, b) {
  16219. var c = this.Y;
  16220. null !== c && null !== c.g && (c.to !== this && c.RG !== this && c.TB !== this || Po(c, !0), this.ra(), Db(a, b) || (c.cl(), this.$s(c)))
  16221. };
  16222. f.$s = function(a) { null !== this.yd && (Po(a, !0), a instanceof G && Qo(a, this)) };
  16223. D.defineProperty(O, { vo: "shadowVisible" }, function() { return this.wn }, function(a) {
  16224. var b = this.wn;
  16225. b !== a && (v && null !== a && D.h(a, "boolean", O, "shadowVisible"), this.wn = a, this.ra(), this.i("shadowVisible", b, a))
  16226. });
  16227. O.prototype.He = function(a, b) {
  16228. if (this.visible) {
  16229. var c = this.bc;
  16230. if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y)) {
  16231. var d = this.opacity,
  16232. e = 1;
  16233. if (1 !== d) {
  16234. if (0 === d) return;
  16235. e = a.globalAlpha;
  16236. a.globalAlpha = e * d
  16237. }
  16238. if (a instanceof qd) a: {
  16239. if (this.visible) {
  16240. var g = null,
  16241. h = a.ny;
  16242. if (this instanceof x && (this.type === Ro || this.type === So)) To(this, a, b);
  16243. else {
  16244. var k = this.bc;
  16245. if (0 !== k.width && 0 !== k.height && !isNaN(k.x) && !isNaN(k.y)) {
  16246. var l = this.transform,
  16247. m = this.R;
  16248. 0 !== (this.S & 4096) === !0 && Uo(this);
  16249. var c = 0 !== (this.S & 256),
  16250. n = !1;
  16251. this instanceof
  16252. pa && (a.font = this.font);
  16253. if (c) {
  16254. n = m.kh() ? m.Ga : m.aa;
  16255. if (null !== this.yg) var p = this.yg,
  16256. q = p.x,
  16257. r = p.y,
  16258. s = p.width,
  16259. p = p.height;
  16260. else q = Math.max(k.x, n.x), r = Math.max(k.y, n.y), s = Math.min(k.right, n.right) - q, p = Math.min(k.bottom, n.bottom) - r;
  16261. if (q > k.width + k.x || k.x > n.width + n.x || r > k.height + k.y || k.y > n.height + n.y) break a;
  16262. n = !0;
  16263. sd(a, 1, 0, 0, 1, 0, 0);
  16264. a.save();
  16265. a.beginPath();
  16266. a.rect(q, r, s, p);
  16267. a.clip()
  16268. }
  16269. if (this.Oj()) { var u = this; if (!u.isVisible()) break a }
  16270. a.Mh.ac = [1, 0, 0, 1, 0, 0];
  16271. this instanceof pa && 1 < this.wB && sd(a, 1, 0, 0, 1, 0, 0);
  16272. q = !1;
  16273. this.Oj() &&
  16274. this.dl && b.Kj("drawShadows") && (r = this.vn, a.fC(r.x * b.scale * b.ud, r.y * b.scale * b.ud, u.Pg), a.wo(), a.shadowColor = u.un);
  16275. u = !1;
  16276. this.Y && b.Kj("drawShadows") && (u = this.Y.dl);
  16277. !0 === this.vo ? (a.wo(), !1 === q && u && (sd(a, 1, 0, 0, 1, 0, 0), a.jb(), q = !0)) : !1 === this.vo && a.Cm();
  16278. null !== this.lc && (Vo(this, a, this.lc, !0, !0), !1 === q && u && (sd(a, 1, 0, 0, 1, 0, 0), a.jb(), q = !0), this.lc instanceof Ba && this.lc.type === Id ? (a.beginPath(), a.rect(k.x, k.y, k.width, k.height), a.Xg(this.lc)) : a.fillRect(k.x, k.y, k.width, k.height));
  16279. this instanceof x ? sd(a, l.m11,
  16280. l.m12, l.m21, l.m22, l.dx, l.dy) : a.Mh.ac = [l.m11, l.m12, l.m21, l.m22, l.dx, l.dy];
  16281. null !== this.Mb && (!1 === q && u && (sd(a, 1, 0, 0, 1, 0, 0), a.jb(), q = !0), s = this.Ga, l = k = 0, r = s.width, s = s.height, p = 0, this instanceof z && (s = this.ab.pb, k = s.x, l = s.y, r = s.width, s = s.height, p = this.Rg), Vo(this, a, this.Mb, !0, !1), this.Mb instanceof Ba && this.Mb.type === Id ? (a.beginPath(), a.rect(k - p / 2, l - p / 2, r + p, s + p), a.Xg(this.Mb)) : a.fillRect(k - p / 2, l - p / 2, r + p, s + p));
  16282. u && (null !== this.Mb || null !== this.lc || null !== m && 0 !== (m.S & 512) || null !== m && (m.type === Pl || m.type ===
  16283. Xj) && m.Ld() !== this) ? (Wo(this, !0), null === this.vo && a.Cm()) : Wo(this, !1);
  16284. this.Wk(a, b);
  16285. u && 0 !== (this.S & 512) === !0 && a.wo();
  16286. this.Oj() && u && a.Cm();
  16287. c && (a.restore(), n && a.xf.pop());
  16288. this instanceof x && (g = a.xf.pop());
  16289. !0 === q && a.xf.pop();
  16290. this instanceof pa && 1 < this.wB && (g = a.xf.pop());
  16291. null !== a.BF && (null === g && (h === a.ny ? (sd(a, 1, 0, 0, 1, 0, 0), g = a.xf.pop()) : g = a.ny), a.BF(this, g))
  16292. }
  16293. }
  16294. }
  16295. }
  16296. else {
  16297. if (this instanceof x && (this.type === Ro || this.type === So)) {
  16298. To(this, a, b);
  16299. 1 !== d && (a.globalAlpha = e);
  16300. return
  16301. }
  16302. this instanceof J && this.Wu(!1);
  16303. v && v.Dj &&
  16304. v.FI(a, this);
  16305. g = this.transform;
  16306. h = this.R;
  16307. 0 !== (this.S & 4096) === !0 && Uo(this);
  16308. m = 0 !== (this.S & 256);
  16309. a.eq && (m = !1);
  16310. this instanceof pa && (a.font = this.font);
  16311. if (m) {
  16312. v && v.AF && D.trace("clip" + this.toString());
  16313. n = h.kh() ? h.Ga : h.aa;
  16314. null !== this.yg ? (q = this.yg, k = q.x, l = q.y, u = q.width, q = q.height) : (k = Math.max(c.x, n.x), l = Math.max(c.y, n.y), u = Math.min(c.right, n.right) - k, q = Math.min(c.bottom, n.bottom) - l);
  16315. if (k > c.width + c.x || c.x > n.width + n.x || l > c.height + c.y || c.y > n.height + n.y) { 1 !== d && (a.globalAlpha = e); return }
  16316. v && v.AF && v.HI(a, k, l, u, q);
  16317. a.save();
  16318. a.beginPath();
  16319. a.rect(k, l, u, q);
  16320. a.clip()
  16321. }
  16322. if (this.Oj()) {
  16323. if (!this.isVisible()) { 1 !== d && (a.globalAlpha = e); return }
  16324. this.dl && b.Kj("drawShadows") && (n = this.vn, a.fC(n.x * b.scale * b.ud, n.y * b.scale * b.ud, this.Pg), a.wo(), a.shadowColor = this.un)
  16325. }
  16326. n = !1;
  16327. this.Y && b.Kj("drawShadows") && (n = this.Y.dl);
  16328. !0 === this.vo ? a.wo() : !1 === this.vo && a.Cm();
  16329. null !== this.lc && (Vo(this, a, this.lc, !0, !0), this.lc instanceof Ba && this.lc.type === Id ? (a.beginPath(), a.rect(c.x, c.y, c.width, c.height), a.Xg(this.lc)) : a.fillRect(c.x, c.y, c.width, c.height));
  16330. g.Nu() ||
  16331. a.transform(g.m11, g.m12, g.m21, g.m22, g.dx, g.dy);
  16332. n && (null !== h && 0 !== (h.S & 512) || null !== h && (h.type === Pl || h.type === Xj) && h.Ld() !== this) && null === this.vo && a.Cm();
  16333. null !== this.Mb && (u = this.Ga, k = c = 0, l = u.width, u = u.height, q = 0, this instanceof z && (u = this.ab.pb, c = u.x, k = u.y, l = u.width, u = u.height, q = this.Rg), Vo(this, a, this.Mb, !0, !1), this.Mb instanceof Ba && this.Mb.type === Id ? (a.beginPath(), a.rect(c - q / 2, k - q / 2, l + q, u + q), a.Xg(this.Mb)) : a.fillRect(c - q / 2, k - q / 2, l + q, u + q));
  16334. v && v.Dj && v.GI(a, this);
  16335. n && (null !== this.Mb || null !== this.lc ||
  16336. null !== h && 0 !== (h.S & 512) || null !== h && (h.type === Pl || h.type === Xj) && h.Ld() !== this) ? (Wo(this, !0), null === this.vo && a.Cm()) : Wo(this, !1);
  16337. this.Wk(a, b);
  16338. n && 0 !== (this.S & 512) === !0 && a.wo();
  16339. this.Oj() && n && a.Cm();
  16340. m ? (a.restore(), this instanceof x ? a.De(!0) : a.De(!1)) : g.Nu() || (h = 1 / (g.m11 * g.m22 - g.m12 * g.m21), a.transform(g.m22 * h, -g.m12 * h, -g.m21 * h, g.m11 * h, h * (g.m21 * g.dy - g.m22 * g.dx), h * (g.m12 * g.dx - g.m11 * g.dy)))
  16341. }
  16342. 1 !== d && (a.globalAlpha = e)
  16343. }
  16344. }
  16345. };
  16346. function To(a, b, c) {
  16347. var d = a.bc;
  16348. 0 === d.width || 0 === d.height || isNaN(d.x) || isNaN(d.y) || (null !== a.lc && (Vo(a, b, a.lc, !0, !0), a.lc instanceof Ba && a.lc.type === Id ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), b.Xg(a.lc)) : b.fillRect(d.x, d.y, d.width, d.height)), null !== a.Mb && (Vo(a, b, a.Mb, !0, !1), a.Mb instanceof Ba && a.Mb.type === Id ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), b.Xg(a.Mb)) : b.fillRect(d.x, d.y, d.width, d.height)), a.Wk(b, c))
  16349. }
  16350. O.prototype.Wk = function() {};
  16351. function Vo(a, b, c, d, e) {
  16352. if (null !== c) {
  16353. var g = 1,
  16354. h = 1;
  16355. if ("string" === typeof c) d ? b.fillStyle = c : b.strokeStyle = c;
  16356. else if (c.type === Fg) d ? b.fillStyle = c.color : b.strokeStyle = c.color;
  16357. else {
  16358. var k, h = a.Ga,
  16359. g = h.width,
  16360. h = h.height;
  16361. if (e) var l = a.aa,
  16362. g = l.width,
  16363. h = l.height;
  16364. var m = b instanceof Hd;
  16365. if (m && c.qh && (c.type === bo || c.Mo === g && c.xz === h)) k = c.qh;
  16366. else {
  16367. var n = l = 0,
  16368. p = 0,
  16369. q = 0,
  16370. r = 0,
  16371. s = 0,
  16372. s = r = 0;
  16373. e && (l = a.aa, g = l.width, h = l.height, r = l.x, s = l.y);
  16374. l = c.start.x * g + c.start.offsetX;
  16375. n = c.start.y * h + c.start.offsetY;
  16376. p = c.end.x * g + c.end.offsetX;
  16377. q = c.end.y * h + c.end.offsetY;
  16378. l += r;
  16379. p += r;
  16380. n += s;
  16381. q += s;
  16382. if (c.type === Gg) k = b.createLinearGradient(l, n, p, q);
  16383. else if (c.type === Id) s = isNaN(c.ou) ? Math.max(g, h) / 2 : c.ou, isNaN(c.sv) ? (r = 0, s = Math.max(g, h) / 2) : r = c.sv, k = b.createRadialGradient(l, n, r, p, q, s);
  16384. else if (c.type === bo) try { k = b.createPattern(c.pattern, "repeat") } catch (u) { k = null } else D.kc(c.type, "Brush type");
  16385. if (c.type !== bo && (e = c.Qk, null !== e))
  16386. for (e = e.j; e.next();) k.addColorStop(e.key, e.value);
  16387. if (m && (c.qh = k, null !== k && (c.Mo = g, c.xz = h), null === k && c.type === bo && -1 !== c.Mo)) {
  16388. c.Mo = -1;
  16389. var t = a.g;
  16390. null !== t &&
  16391. -1 === c.Mo && D.setTimeout(function() { t.ro() }, 600)
  16392. }
  16393. }
  16394. d ? b.fillStyle = k : b.strokeStyle = k
  16395. }
  16396. }
  16397. }
  16398. O.prototype.isContainedBy = O.prototype.xm = function(a) {
  16399. if (a instanceof x) a: {
  16400. if (this !== a && null !== a)
  16401. for (var b = this.R; null !== b;) {
  16402. if (b === a) { a = !0; break a }
  16403. b = b.R
  16404. }
  16405. a = !1
  16406. }
  16407. else a = !1;
  16408. return a
  16409. };
  16410. O.prototype.isVisibleObject = O.prototype.Sj = function() { if (!this.visible) return !1; var a = this.R; return null !== a ? a.Sj() : !0 };
  16411. O.prototype.isEnabledObject = O.prototype.Ju = function() { for (var a = this instanceof x ? this : this.R; null !== a && a.isEnabled;) a = a.R; return null === a };
  16412. D.defineProperty(O, { CF: "enabledChanged" }, function() { return null !== this.ma ? this.ma.Yr : null }, function(a) {
  16413. Co(this);
  16414. var b = this.ma.Yr;
  16415. b !== a && (null !== a && D.h(a, "function", O, "enabledChanged"), this.ma.Yr = a, this.i("enabledChanged", b, a))
  16416. });
  16417. function Uo(a) {
  16418. if (0 !== (a.S & 2048) === !0) {
  16419. var b = a.Nc;
  16420. b.reset();
  16421. if (!a.bc.H() || !a.Fd.H()) { Xo(a, !1); return }
  16422. b.translate(a.bc.x, a.bc.y);
  16423. b.translate(-a.Fa.x, -a.Fa.y);
  16424. var c = a.Ga;
  16425. Ko(a, b, c.x, c.y, c.width, c.height);
  16426. Xo(a, !1);
  16427. Yo(a, !0)
  16428. }
  16429. 0 !== (a.S & 4096) === !0 && (b = a.R, null === b ? (a.Ni.set(a.Nc), a.Xo = a.scale, Yo(a, !1)) : null !== b.Hh && (c = a.Ni, c.reset(), b.kh() ? c.multiply(b.Ni) : null !== b.R && c.multiply(b.R.Ni), c.multiply(a.Nc), a.Xo = a.scale * b.Xo, Yo(a, !1)))
  16430. }
  16431. function Ko(a, b, c, d, e, g) {
  16432. 1 !== a.scale && b.scale(a.scale);
  16433. if (0 !== a.angle) {
  16434. var h = mc;
  16435. a.Oj() && a.Of.Xc() && (h = a.Of);
  16436. var k = D.P();
  16437. if (a instanceof F && a.Bf !== a)
  16438. for (c = a.Bf, d = c.Ga, k.pv(d.x, d.y, d.width, d.height, h), c.ij.vb(k), k.offset(-c.Fa.x, -c.Fa.y), h = c.R; null !== h && h !== a;) h.ij.vb(k), k.offset(-h.Fa.x, -h.Fa.y), h = h.R;
  16439. else k.pv(c, d, e, g, h);
  16440. b.rotate(a.angle, k.x, k.y);
  16441. D.A(k)
  16442. }
  16443. }
  16444. f = O.prototype;
  16445. f.K = function(a) {
  16446. void 0 === a && (a = !1);
  16447. if (!0 !== Nm(this)) {
  16448. km(this, !0);
  16449. No(this, !0);
  16450. var b = this.R;
  16451. null === b || a || b.K()
  16452. }
  16453. };
  16454. f.xq = function() {!0 !== Nm(this) && (km(this, !0), No(this, !0)) };
  16455. function Zo(a) {
  16456. if (!1 === Om(a)) {
  16457. var b = a.R;
  16458. null !== b ? b.K() : a.Oj() && (b = a.g, null !== b && (b.Gg.add(a), a instanceof G && a.kg(), b.Ve()));
  16459. No(a, !0)
  16460. }
  16461. }
  16462. f.cj = function() { 0 !== (this.S & 2048) === !1 && (Xo(this, !0), Yo(this, !0)) };
  16463. f.nB = function() { Yo(this, !0) };
  16464. f.ra = function() {
  16465. var a = this.Y;
  16466. null !== a && a.ra()
  16467. };
  16468. function Mo(a, b) {
  16469. var c = a.stretch,
  16470. d = a.R;
  16471. if (null !== d && d.da === fa) return $o(a, d.oe(a.Sb), d.ne(a.column), b);
  16472. if (null !== d && d.da === Pl && d.Ld() === a) return ap(a, Ye, b);
  16473. if (c === wo) {
  16474. if (null !== d) {
  16475. if (d.da === Xj && d.Ld() === a) return ap(a, Ye, b);
  16476. c = d.le;
  16477. return c === wo ? ap(a, Zj, b) : ap(a, c, b)
  16478. }
  16479. return ap(a, Zj, b)
  16480. }
  16481. return ap(a, c, b)
  16482. }
  16483. function $o(a, b, c, d) {
  16484. var e = a.stretch;
  16485. if (e !== wo) return ap(a, e, d);
  16486. var g = e = null;
  16487. switch (b.stretch) {
  16488. case xo:
  16489. g = !0;
  16490. break;
  16491. case Ye:
  16492. g = !0
  16493. }
  16494. switch (c.stretch) {
  16495. case yo:
  16496. e = !0;
  16497. break;
  16498. case Ye:
  16499. e = !0
  16500. }
  16501. b = a.R.le;
  16502. null === e && (e = b === yo || b === Ye);
  16503. null === g && (g = b === xo || b === Ye);
  16504. return !0 === e && !0 === g ? ap(a, Ye, d) : !0 === e ? ap(a, yo, d) : !0 === g ? ap(a, xo, d) : ap(a, Zj, d)
  16505. }
  16506. function ap(a, b, c) {
  16507. if (c) return b;
  16508. if (b === Zj) return Zj;
  16509. c = a.Ea;
  16510. if (c.H()) return Zj;
  16511. a = a.angle;
  16512. if (!isNaN(c.width))
  16513. if (90 !== a && 270 !== a) { if (b === yo) return Zj; if (b === Ye) return xo } else { if (b === xo) return Zj; if (b === Ye) return yo }
  16514. if (!isNaN(c.height))
  16515. if (90 !== a && 270 !== a) { if (b === xo) return Zj; if (b === Ye) return yo } else { if (b === yo) return Zj; if (b === Ye) return xo }
  16516. return b
  16517. }
  16518. D.defineProperty(O, { Uq: "segmentOrientation" }, function() { return this.sn }, function(a) {
  16519. var b = this.sn;
  16520. b !== a && (v && D.Da(a, J, O, "segmentOrientation"), this.sn = a, this.K(), this.i("segmentOrientation", b, a), a === vj && (this.angle = 0))
  16521. });
  16522. D.defineProperty(O, { We: "segmentIndex" }, function() { return this.zt }, function(a) {
  16523. v && D.h(a, "number", O, "segmentIndex");
  16524. a = Math.round(a);
  16525. var b = this.zt;
  16526. b !== a && (this.zt = a, this.K(), this.i("segmentIndex", b, a))
  16527. });
  16528. D.defineProperty(O, { WB: "segmentFraction" }, function() { return this.qn }, function(a) {
  16529. v && D.h(a, "number", O, "segmentFraction");
  16530. isNaN(a) ? a = 0 : 0 > a ? a = 0 : 1 < a && (a = 1);
  16531. var b = this.qn;
  16532. b !== a && (this.qn = a, this.K(), this.i("segmentFraction", b, a))
  16533. });
  16534. D.defineProperty(O, { XB: "segmentOffset" }, function() { return this.rn }, function(a) {
  16535. var b = this.rn;
  16536. b.O(a) || (v && D.l(a, N, O, "segmentOffset"), this.rn = a = a.V(), this.K(), this.i("segmentOffset", b, a))
  16537. });
  16538. D.defineProperty(O, { stretch: "stretch" }, function() { return this.Qg }, function(a) {
  16539. var b = this.Qg;
  16540. b !== a && (v && D.Da(a, O, O, "stretch"), this.Qg = a, this.K(), this.i("stretch", b, a))
  16541. });
  16542. D.defineProperty(O, { name: "name" }, function() { return this.$b }, function(a) {
  16543. var b = this.$b;
  16544. b !== a && (v && D.h(a, "string", O, "name"), this.$b = a, null !== this.Y && (this.Y.Sl = null), this.i("name", b, a))
  16545. });
  16546. D.defineProperty(O, { opacity: "opacity" }, function() { return this.Lc }, function(a) {
  16547. var b = this.Lc;
  16548. b !== a && (D.h(a, "number", O, "opacity"), (0 > a || 1 < a) && D.ua(a, "0 <= value <= 1", O, "opacity"), this.Lc = a, this.i("opacity", b, a), a = this.g, b = this.Y, null !== a && null !== b && a.ra(xl(b, b.aa)))
  16549. });
  16550. D.defineProperty(O, { visible: "visible" }, function() { return 0 !== (this.S & 1) }, function(a) {
  16551. var b = 0 !== (this.S & 1);
  16552. b !== a && (v && D.h(a, "boolean", O, "visible"), this.S ^= 1, this.i("visible", b, a), b = this.R, null !== b ? b.K() : this.Oj() && this.Pd(a), this.ra(), bp(this))
  16553. });
  16554. D.defineProperty(O, { tg: "pickable" }, function() { return 0 !== (this.S & 2) }, function(a) {
  16555. var b = 0 !== (this.S & 2);
  16556. b !== a && (v && D.h(a, "boolean", O, "pickable"), this.S ^= 2, this.i("pickable", b, a))
  16557. });
  16558. D.defineProperty(O, { QI: "fromLinkableDuplicates" }, function() { return 0 !== (this.S & 4) }, function(a) {
  16559. var b = 0 !== (this.S & 4);
  16560. b !== a && (v && D.h(a, "boolean", O, "fromLinkableDuplicates"), this.S ^= 4, this.i("fromLinkableDuplicates", b, a))
  16561. });
  16562. D.defineProperty(O, { RI: "fromLinkableSelfNode" }, function() { return 0 !== (this.S & 8) }, function(a) {
  16563. var b = 0 !== (this.S & 8);
  16564. b !== a && (v && D.h(a, "boolean", O, "fromLinkableSelfNode"), this.S ^= 8, this.i("fromLinkableSelfNode", b, a))
  16565. });
  16566. D.defineProperty(O, { CK: "toLinkableDuplicates" }, function() { return 0 !== (this.S & 16) }, function(a) {
  16567. var b = 0 !== (this.S & 16);
  16568. b !== a && (v && D.h(a, "boolean", O, "toLinkableDuplicates"), this.S ^= 16, this.i("toLinkableDuplicates", b, a))
  16569. });
  16570. D.defineProperty(O, { DK: "toLinkableSelfNode" }, function() { return 0 !== (this.S & 32) }, function(a) {
  16571. var b = 0 !== (this.S & 32);
  16572. b !== a && (v && D.h(a, "boolean", O, "toLinkableSelfNode"), this.S ^= 32, this.i("toLinkableSelfNode", b, a))
  16573. });
  16574. D.defineProperty(O, { Ue: "isPanelMain" }, function() { return 0 !== (this.S & 64) }, function(a) {
  16575. var b = 0 !== (this.S & 64);
  16576. b !== a && (v && D.h(a, "boolean", O, "isPanelMain"), this.S ^= 64, this.K(), this.i("isPanelMain", b, a))
  16577. });
  16578. D.defineProperty(O, { Hu: "isActionable" }, function() { return 0 !== (this.S & 128) }, function(a) {
  16579. var b = 0 !== (this.S & 128);
  16580. b !== a && (v && D.h(a, "boolean", O, "isActionable"), this.S ^= 128, this.i("isActionable", b, a))
  16581. });
  16582. D.defineProperty(O, { gm: "areaBackground" }, function() { return this.lc }, function(a) {
  16583. var b = this.lc;
  16584. b !== a && (v && null !== a && D.hu(a, "GraphObject.areaBackground"), a instanceof Ba && a.freeze(), this.lc = a, this.ra(), this.i("areaBackground", b, a))
  16585. });
  16586. D.defineProperty(O, { background: "background" }, function() { return this.Mb }, function(a) {
  16587. var b = this.Mb;
  16588. b !== a && (v && null !== a && D.hu(a, "GraphObject.background"), a instanceof Ba && a.freeze(), this.Mb = a, this.ra(), this.i("background", b, a))
  16589. });
  16590. function Wo(a, b) { a.S = b ? a.S | 512 : a.S & -513 }
  16591. function Ho(a) { return 0 !== (a.S & 1024) }
  16592. function cp(a, b) { a.S = b ? a.S | 1024 : a.S & -1025 }
  16593. function Xo(a, b) { a.S = b ? a.S | 2048 : a.S & -2049 }
  16594. function Yo(a, b) { a.S = b ? a.S | 4096 : a.S & -4097 }
  16595. function Nm(a) { return 0 !== (a.S & 8192) }
  16596. function km(a, b) { a.S = b ? a.S | 8192 : a.S & -8193 }
  16597. function Om(a) { return 0 !== (a.S & 16384) }
  16598. function No(a, b) { a.S = b ? a.S | 16384 : a.S & -16385 }
  16599. D.w(O, { Y: "part" }, function() {
  16600. if (this.Oj()) return this;
  16601. if (null !== this.mn) return this.mn;
  16602. var a;
  16603. for (a = this.R; a;) {
  16604. if (a instanceof F) return this.mn = a;
  16605. a = a.R
  16606. }
  16607. return null
  16608. });
  16609. D.w(O, { R: "panel" }, function() { return this.rj });
  16610. O.prototype.Bm = function(a) { this.rj = a };
  16611. D.w(O, { layer: "layer" }, function() { var a = this.Y; return null !== a ? a.layer : null }, { configurable: !0 });
  16612. D.w(O, { g: "diagram" }, function() { var a = this.Y; return null !== a ? a.g : null }, { configurable: !0 });
  16613. D.defineProperty(O, { position: "position" }, function() { return this.sb }, function(a) {
  16614. v && D.l(a, N, O, "position");
  16615. var b = a.x,
  16616. c = a.y,
  16617. d = this.sb,
  16618. e = d.x,
  16619. g = d.y;
  16620. (e === b || isNaN(e) && isNaN(b)) && (g === c || isNaN(g) && isNaN(c)) ? this.cC(): (a = a.V(), this.bC(a, d) && this.i("position", d, a))
  16621. });
  16622. O.prototype.cC = function() {};
  16623. O.prototype.bC = function(a) {
  16624. this.sb = a;
  16625. Zo(this);
  16626. this.cj();
  16627. return !0
  16628. };
  16629. O.prototype.Uy = function(a, b) {
  16630. this.sb.n(a, b);
  16631. this.cj()
  16632. };
  16633. D.w(O, { aa: "actualBounds" }, function() { return this.bc });
  16634. D.defineProperty(O, { scale: "scale" }, function() { return this.Db }, function(a) {
  16635. var b = this.Db;
  16636. b !== a && (v && D.p(a, O, "scale"), 0 >= a && D.k("GraphObject.scale for " + this + " must be greater than zero, not: " + a), this.Db = a, this.cj(), this.K(), this.i("scale", b, a))
  16637. });
  16638. D.defineProperty(O, { angle: "angle" }, function() { return this.wg }, function(a) {
  16639. var b = this.wg;
  16640. b !== a && (v && D.p(a, O, "angle"), a %= 360, 0 > a && (a += 360), b !== a && (this.wg = a, bp(this), this.K(), this.cj(), this.i("angle", b, a)))
  16641. });
  16642. D.defineProperty(O, { Ea: "desiredSize" }, function() { return this.$e }, function(a) {
  16643. v && D.l(a, Ca, O, "desiredSize");
  16644. var b = a.width,
  16645. c = a.height,
  16646. d = this.$e,
  16647. e = d.width,
  16648. g = d.height;
  16649. (e === b || isNaN(e) && isNaN(b)) && (g === c || isNaN(g) && isNaN(c)) || (this.$e = a = a.V(), this.K(), this instanceof z && this.Te(), this.i("desiredSize", d, a), Ho(this) && (a = this.Y, null !== a && (Io(this, a, "width"), Io(this, a, "height"))))
  16650. });
  16651. D.defineProperty(O, { width: "width" }, function() { return this.$e.width }, function(a) {
  16652. var b = this.$e.width;
  16653. b === a || isNaN(b) && isNaN(a) || (v && D.h(a, "number", O, "width"), b = this.$e, this.$e = a = (new Ca(a, this.$e.height)).freeze(), this.K(), this instanceof z && this.Te(), this.i("desiredSize", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "width")))
  16654. });
  16655. D.defineProperty(O, { height: "height" }, function() { return this.$e.height }, function(a) {
  16656. var b = this.$e.height;
  16657. b === a || isNaN(b) && isNaN(a) || (v && D.h(a, "number", O, "height"), b = this.$e, this.$e = a = (new Ca(this.$e.width, a)).freeze(), this.K(), this instanceof z && this.Te(), this.i("desiredSize", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "height")))
  16658. });
  16659. D.defineProperty(O, { ah: "minSize" }, function() { return this.oi }, function(a) {
  16660. var b = this.oi;
  16661. b.O(a) || (v && D.l(a, Ca, O, "minSize"), a = a.copy(), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), a.freeze(), this.oi = a, this.K(), this.i("minSize", b, a))
  16662. });
  16663. D.defineProperty(O, { pf: "maxSize" }, function() { return this.ni }, function(a) {
  16664. var b = this.ni;
  16665. b.O(a) || (v && D.l(a, Ca, O, "maxSize"), a = a.copy(), isNaN(a.width) && (a.width = Infinity), isNaN(a.height) && (a.height = Infinity), a.freeze(), this.ni = a, this.K(), this.i("maxSize", b, a))
  16666. });
  16667. D.w(O, { Fa: "measuredBounds" }, function() { return this.Fd });
  16668. D.w(O, { Ga: "naturalBounds" }, function() { return this.fd }, { configurable: !0 });
  16669. D.defineProperty(O, { margin: "margin" }, function() { return this.en }, function(a) {
  16670. "number" === typeof a ? a = new Lb(a) : v && D.l(a, Lb, O, "margin");
  16671. var b = this.en;
  16672. b.O(a) || (this.en = a = a.V(), this.K(), this.i("margin", b, a))
  16673. });
  16674. D.w(O, { transform: null }, function() { 0 !== (this.S & 2048) === !0 && Uo(this); return this.Nc });
  16675. D.w(O, { Hh: null }, function() { 0 !== (this.S & 4096) === !0 && Uo(this); return this.Ni });
  16676. D.defineProperty(O, { alignment: "alignment" }, function() { return this.ue }, function(a) {
  16677. var b = this.ue;
  16678. b.O(a) || (v && D.l(a, S, O, "alignment"), a.de() && !a.ld() && D.k("GraphObject.alignment for " + this + " must be a real Spot or Spot.Default, not: " + a), this.ue = a = a.V(), Zo(this), this.i("alignment", b, a))
  16679. });
  16680. D.defineProperty(O, { column: "column" }, function() { return this.wr }, function(a) {
  16681. v && D.p(a, O, "column");
  16682. a = Math.round(a);
  16683. var b = this.wr;
  16684. b !== a && (0 > a && D.ua(a, ">= 0", O, "column"), this.wr = a, this.K(), this.i("column", b, a))
  16685. });
  16686. D.defineProperty(O, { kI: "columnSpan" }, function() { return this.Si }, function(a) {
  16687. v && D.h(a, "number", O, "columnSpan");
  16688. a = Math.round(a);
  16689. var b = this.Si;
  16690. b !== a && (1 > a && D.ua(a, ">= 1", O, "columnSpan"), this.Si = a, this.K(), this.i("columnSpan", b, a))
  16691. });
  16692. D.defineProperty(O, { Sb: "row" }, function() { return this.vt }, function(a) {
  16693. v && D.p(a, O, "row");
  16694. a = Math.round(a);
  16695. var b = this.vt;
  16696. b !== a && (0 > a && D.ua(a, ">= 0", O, "row"), this.vt = a, this.K(), this.i("row", b, a))
  16697. });
  16698. D.defineProperty(O, { rowSpan: "rowSpan" }, function() { return this.tj }, function(a) {
  16699. v && D.h(a, "number", O, "rowSpan");
  16700. a = Math.round(a);
  16701. var b = this.tj;
  16702. b !== a && (1 > a && D.ua(a, ">= 1", O, "rowSpan"), this.tj = a, this.K(), this.i("rowSpan", b, a))
  16703. });
  16704. D.defineProperty(O, { Vy: "spanAllocation" }, function() { return this.Lt }, function(a) {
  16705. var b = this.Lt;
  16706. b !== a && (null !== a && D.h(a, "function", O, "spanAllocation"), this.Lt = a, this.K(), this.i("spanAllocation", b, a))
  16707. });
  16708. D.defineProperty(O, { Gh: "alignmentFocus" }, function() { return this.Lm }, function(a) {
  16709. var b = this.Lm;
  16710. b.O(a) || (v && D.l(a, S, O, "alignmentFocus"), !a.de() || a.ld() || a.O(dc) && this instanceof G || D.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: " + a), this.Lm = a = a.V(), this.K(), this.i("alignmentFocus", b, a))
  16711. });
  16712. D.defineProperty(O, { yd: "portId" }, function() { return this.it }, function(a) {
  16713. var b = this.it;
  16714. if (b !== a) {
  16715. v && null !== a && D.h(a, "string", O, "portId");
  16716. var c = this.Y;
  16717. null === c || c instanceof G || (D.k("Cannot set portID on a Link: " + a), c = null);
  16718. null !== b && null !== c && dp(c, this);
  16719. this.it = a;
  16720. if (null !== a && c) {
  16721. c.bl = !0;
  16722. null === c.Ae && ep(c);
  16723. var d = this.yd;
  16724. null !== d && c.Ae.add(d, this)
  16725. }
  16726. this.i("portId", b, a)
  16727. }
  16728. });
  16729. function fp(a) {
  16730. var b = a.Y;
  16731. if (b instanceof G && (null !== a.yd || a === b.port)) {
  16732. var c = b.g;
  16733. null === c || c.na.ub || Qo(b, a)
  16734. }
  16735. }
  16736. function bp(a) {
  16737. var b = a.g;
  16738. null === b || b.na.ub || (a instanceof x ? a instanceof G ? a.kg() : gp(a, a, function(a) { fp(a) }) : fp(a))
  16739. }
  16740. D.defineProperty(O, { Hb: "toSpot" }, function() { return null !== this.Z ? this.Z.Mk : dc }, function(a) {
  16741. this.ae();
  16742. var b = this.Z.Mk;
  16743. b.O(a) || (v && D.l(a, S, O, "toSpot"), a = a.V(), this.Z.Mk = a, this.i("toSpot", b, a), fp(this))
  16744. });
  16745. D.defineProperty(O, { Hm: "toEndSegmentLength" }, function() { return null !== this.Z ? this.Z.Kk : 10 }, function(a) {
  16746. this.ae();
  16747. var b = this.Z.Kk;
  16748. b !== a && (v && D.h(a, "number", O, "toEndSegmentLength"), 0 > a && D.ua(a, ">= 0", O, "toEndSegmentLength"), this.Z.Kk = a, this.i("toEndSegmentLength", b, a), fp(this))
  16749. });
  16750. D.defineProperty(O, { uv: "toEndSegmentDirection" }, function() { return null !== this.Z ? this.Z.Jk : Fo }, function(a) {
  16751. this.ae();
  16752. var b = this.Z.Jk;
  16753. b !== a && (D.On("GraphObject.toEndSegmentDirection", "2.0"), v && D.Da(a, G, O, "toEndSegmentDirection"), this.Z.Jk = a, this.i("toEndSegmentDirection", b, a), fp(this))
  16754. });
  16755. D.defineProperty(O, { vv: "toShortLength" }, function() { return null !== this.Z ? this.Z.Lk : 0 }, function(a) {
  16756. this.ae();
  16757. var b = this.Z.Lk;
  16758. b !== a && (v && D.h(a, "number", O, "toShortLength"), this.Z.Lk = a, this.i("toShortLength", b, a), fp(this))
  16759. });
  16760. D.defineProperty(O, { nH: "toLinkable" }, function() { return null !== this.Z ? this.Z.St : null }, function(a) {
  16761. this.ae();
  16762. var b = this.Z.St;
  16763. b !== a && (v && null !== a && D.h(a, "boolean", O, "toLinkable"), this.Z.St = a, this.i("toLinkable", b, a))
  16764. });
  16765. D.defineProperty(O, { EK: "toMaxLinks" }, function() { return null !== this.Z ? this.Z.Tt : Infinity }, function(a) {
  16766. this.ae();
  16767. var b = this.Z.Tt;
  16768. b !== a && (v && D.h(a, "number", O, "toMaxLinks"), 0 > a && D.ua(a, ">= 0", O, "toMaxLinks"), this.Z.Tt = a, this.i("toMaxLinks", b, a))
  16769. });
  16770. D.defineProperty(O, { Gb: "fromSpot" }, function() { return null !== this.Z ? this.Z.ok : dc }, function(a) {
  16771. this.ae();
  16772. var b = this.Z.ok;
  16773. b.O(a) || (v && D.l(a, S, O, "fromSpot"), a = a.V(), this.Z.ok = a, this.i("fromSpot", b, a), fp(this))
  16774. });
  16775. D.defineProperty(O, { rm: "fromEndSegmentLength" }, function() { return null !== this.Z ? this.Z.mk : 10 }, function(a) {
  16776. this.ae();
  16777. var b = this.Z.mk;
  16778. b !== a && (v && D.h(a, "number", O, "fromEndSegmentLength"), 0 > a && D.ua(a, ">= 0", O, "fromEndSegmentLength"), this.Z.mk = a, this.i("fromEndSegmentLength", b, a), fp(this))
  16779. });
  16780. D.defineProperty(O, { zu: "fromEndSegmentDirection" }, function() { return null !== this.Z ? this.Z.lk : Fo }, function(a) {
  16781. this.ae();
  16782. var b = this.Z.lk;
  16783. b !== a && (D.On("GraphObject.fromEndSegmentDirection", "2.0"), v && D.Da(a, G, O, "fromEndSegmentDirection"), this.Z.lk = a, this.i("fromEndSegmentDirection", b, a), fp(this))
  16784. });
  16785. D.defineProperty(O, { Au: "fromShortLength" }, function() { return null !== this.Z ? this.Z.nk : 0 }, function(a) {
  16786. this.ae();
  16787. var b = this.Z.nk;
  16788. b !== a && (v && D.h(a, "number", O, "fromShortLength"), this.Z.nk = a, this.i("fromShortLength", b, a), fp(this))
  16789. });
  16790. D.defineProperty(O, { MF: "fromLinkable" }, function() { return null !== this.Z ? this.Z.as : null }, function(a) {
  16791. this.ae();
  16792. var b = this.Z.as;
  16793. b !== a && (v && null !== a && D.h(a, "boolean", O, "fromLinkable"), this.Z.as = a, this.i("fromLinkable", b, a))
  16794. });
  16795. D.defineProperty(O, { cB: "fromMaxLinks" }, function() { return null !== this.Z ? this.Z.bs : Infinity }, function(a) {
  16796. this.ae();
  16797. var b = this.Z.bs;
  16798. b !== a && (v && D.h(a, "number", O, "fromMaxLinks"), 0 > a && D.ua(a, ">= 0", O, "fromMaxLinks"), this.Z.bs = a, this.i("fromMaxLinks", b, a))
  16799. });
  16800. D.defineProperty(O, { cursor: "cursor" }, function() { return this.Fr }, function(a) {
  16801. var b = this.Fr;
  16802. b !== a && (D.h(a, "string", O, "cursor"), this.Fr = a, this.i("cursor", b, a))
  16803. });
  16804. D.defineProperty(O, { click: "click" }, function() { return null !== this.ma ? this.ma.Ri : null }, function(a) {
  16805. Co(this);
  16806. var b = this.ma.Ri;
  16807. b !== a && (null !== a && D.h(a, "function", O, "click"), this.ma.Ri = a, this.i("click", b, a))
  16808. });
  16809. D.defineProperty(O, { nu: "doubleClick" }, function() { return null !== this.ma ? this.ma.Yi : null }, function(a) {
  16810. Co(this);
  16811. var b = this.ma.Yi;
  16812. b !== a && (null !== a && D.h(a, "function", O, "doubleClick"), this.ma.Yi = a, this.i("doubleClick", b, a))
  16813. });
  16814. D.defineProperty(O, { MA: "contextClick" }, function() { return null !== this.ma ? this.ma.Ti : null }, function(a) {
  16815. Co(this);
  16816. var b = this.ma.Ti;
  16817. b !== a && (null !== a && D.h(a, "function", O, "contextClick"), this.ma.Ti = a, this.i("contextClick", b, a))
  16818. });
  16819. D.defineProperty(O, { Yu: "mouseEnter" }, function() { return null !== this.ma ? this.ma.Rs : null }, function(a) {
  16820. Co(this);
  16821. var b = this.ma.Rs;
  16822. b !== a && (null !== a && D.h(a, "function", O, "mouseEnter"), this.ma.Rs = a, this.i("mouseEnter", b, a))
  16823. });
  16824. D.defineProperty(O, { Zu: "mouseLeave" }, function() { return null !== this.ma ? this.ma.Ss : null }, function(a) {
  16825. Co(this);
  16826. var b = this.ma.Ss;
  16827. b !== a && (null !== a && D.h(a, "function", O, "mouseLeave"), this.ma.Ss = a, this.i("mouseLeave", b, a))
  16828. });
  16829. D.defineProperty(O, { FB: "mouseOver" }, function() { return null !== this.ma ? this.ma.nj : null }, function(a) {
  16830. Co(this);
  16831. var b = this.ma.nj;
  16832. b !== a && (null !== a && D.h(a, "function", O, "mouseOver"), this.ma.nj = a, this.i("mouseOver", b, a))
  16833. });
  16834. D.defineProperty(O, { EB: "mouseHover" }, function() { return null !== this.ma ? this.ma.mj : null }, function(a) {
  16835. Co(this);
  16836. var b = this.ma.mj;
  16837. b !== a && (null !== a && D.h(a, "function", O, "mouseHover"), this.ma.mj = a, this.i("mouseHover", b, a))
  16838. });
  16839. D.defineProperty(O, { DB: "mouseHold" }, function() { return null !== this.ma ? this.ma.lj : null }, function(a) {
  16840. Co(this);
  16841. var b = this.ma.lj;
  16842. b !== a && (null !== a && D.h(a, "function", O, "mouseHold"), this.ma.lj = a, this.i("mouseHold", b, a))
  16843. });
  16844. D.defineProperty(O, { RJ: "mouseDragEnter" }, function() { return null !== this.ma ? this.ma.Ps : null }, function(a) {
  16845. Co(this);
  16846. var b = this.ma.Ps;
  16847. b !== a && (null !== a && D.h(a, "function", O, "mouseDragEnter"), this.ma.Ps = a, this.i("mouseDragEnter", b, a))
  16848. });
  16849. D.defineProperty(O, { SJ: "mouseDragLeave" }, function() { return null !== this.ma ? this.ma.Qs : null }, function(a) {
  16850. Co(this);
  16851. var b = this.ma.Qs;
  16852. b !== a && (null !== a && D.h(a, "function", O, "mouseDragLeave"), this.ma.Qs = a, this.i("mouseDragLeave", b, a))
  16853. });
  16854. D.defineProperty(O, { CB: "mouseDrop" }, function() { return null !== this.ma ? this.ma.kj : null }, function(a) {
  16855. Co(this);
  16856. var b = this.ma.kj;
  16857. b !== a && (null !== a && D.h(a, "function", O, "mouseDrop"), this.ma.kj = a, this.i("mouseDrop", b, a))
  16858. });
  16859. D.defineProperty(O, { RE: "actionDown" }, function() { return null !== this.ma ? this.ma.er : null }, function(a) {
  16860. Co(this);
  16861. var b = this.ma.er;
  16862. b !== a && (null !== a && D.h(a, "function", O, "actionDown"), this.ma.er = a, this.i("actionDown", b, a))
  16863. });
  16864. D.defineProperty(O, { SE: "actionMove" }, function() { return null !== this.ma ? this.ma.fr : null }, function(a) {
  16865. Co(this);
  16866. var b = this.ma.fr;
  16867. b !== a && (null !== a && D.h(a, "function", O, "actionMove"), this.ma.fr = a, this.i("actionMove", b, a))
  16868. });
  16869. D.defineProperty(O, { TE: "actionUp" }, function() { return null !== this.ma ? this.ma.gr : null }, function(a) {
  16870. Co(this);
  16871. var b = this.ma.gr;
  16872. b !== a && (null !== a && D.h(a, "function", O, "actionUp"), this.ma.gr = a, this.i("actionUp", b, a))
  16873. });
  16874. D.defineProperty(O, { QE: "actionCancel" }, function() { return null !== this.ma ? this.ma.dr : null }, function(a) {
  16875. Co(this);
  16876. var b = this.ma.dr;
  16877. b !== a && (null !== a && D.h(a, "function", O, "actionCancel"), this.ma.dr = a, this.i("actionCancel", b, a))
  16878. });
  16879. D.defineProperty(O, { lC: "toolTip" }, function() { return null !== this.ma ? this.ma.wj : null }, function(a) {
  16880. Co(this);
  16881. var b = this.ma.wj;
  16882. b !== a && (!v || null === a || a instanceof da || a instanceof hk || D.k("GraphObject.toolTip must be an Adornment or HTMLInfo."), this.ma.wj = a, this.i("toolTip", b, a))
  16883. });
  16884. D.defineProperty(O, { contextMenu: "contextMenu" }, function() { return null !== this.ma ? this.ma.Ui : null }, function(a) {
  16885. Co(this);
  16886. var b = this.ma.Ui;
  16887. b !== a && (!v || a instanceof da || a instanceof hk || D.k("GraphObject.contextMenu must be an Adornment or HTMLInfo."), this.ma.Ui = a, this.i("contextMenu", b, a))
  16888. });
  16889. O.prototype.bind = O.prototype.bind = function(a) {
  16890. a.Sg = this;
  16891. var b = this.qm();
  16892. null !== b && hp(b) && D.k("Cannot add a Binding to a template that has already been copied: " + a);
  16893. null === this.Hc && (this.Hc = new K(ph));
  16894. this.Hc.add(a)
  16895. };
  16896. O.prototype.findTemplateBinder = O.prototype.qm = function() {
  16897. for (var a = this instanceof x ? this : this.R; null !== a;) {
  16898. if (null !== a.zl) return a;
  16899. a = a.R
  16900. }
  16901. return null
  16902. };
  16903. O.prototype.setProperties = function(a) { D.nv(this, a) };
  16904. var ip;
  16905. O.make = ip = function(a, b) {
  16906. var c = arguments,
  16907. d = null,
  16908. e = null;
  16909. if ("function" === typeof a) e = a;
  16910. else if ("string" === typeof a) { var g = jp.oa(a); "function" === typeof g ? (c = D.km(arguments), d = g(c), D.Qa(d) || D.k('GraphObject.make invoked object builder "' + a + '", but it did not return an Object')) : e = ba[a] }
  16911. null === d && (void 0 !== e && null !== e && e.constructor || D.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: " + a), d = new e);
  16912. g = 1;
  16913. if (d instanceof E && 1 < c.length) {
  16914. var h = d,
  16915. e = c[1];
  16916. if ("string" ===
  16917. typeof e || e instanceof HTMLDivElement) Nl(h, e), g++
  16918. }
  16919. for (; g < c.length; g++) e = c[g], void 0 === e ? D.k("Undefined value at argument " + g + " for object being constructed by GraphObject.make: " + d) : kp(d, e);
  16920. return d
  16921. };
  16922. function kp(a, b) {
  16923. if ("string" === typeof b)
  16924. if (a instanceof pa) a.text = b;
  16925. else if (a instanceof z) a.Kb = b;
  16926. else if (a instanceof Hl) a.source = b;
  16927. else if (a instanceof x) {
  16928. var c = Ha(x, b);
  16929. null !== c ? a.type = c : D.k("Unknown Panel type as an argument to GraphObject.make: " + b)
  16930. } else a instanceof Ba ? (c = Ha(Ba, b), null !== c ? a.type = c : D.k("Unknown Brush type as an argument to GraphObject.make: " + b)) : a instanceof Ve ? (c = Ha(Ve, b), null !== c ? a.type = c : D.k("Unknown Geometry type as an argument to GraphObject.make: " + b)) : a instanceof $f ?
  16931. (c = Ha($f, b), null !== c ? a.type = c : D.k("Unknown PathSegment type as an argument to GraphObject.make: " + b)) : D.k("Unable to use a string as an argument to GraphObject.make: " + b);
  16932. else if (b instanceof O) c = b, a instanceof x || D.k("A GraphObject can only be added to a Panel, not to: " + a), a.add(c);
  16933. else if (b instanceof jh) {
  16934. var d = b,
  16935. c = a,
  16936. e;
  16937. d.Ke && c.getRowDefinition ? e = c.getRowDefinition(d.index) : !d.Ke && c.getColumnDefinition ? e = c.getColumnDefinition(d.index) : D.k("A RowColumnDefinition can only be added to a Panel, not to: " +
  16938. a);
  16939. e.gq(d)
  16940. } else if (b instanceof ya) "function" === typeof a.qc ? a.qc(b) : D.ak(a, b);
  16941. else if (b instanceof ph) a instanceof O ? a.bind(b) : a instanceof jh ? a.bind(b) : D.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: " + a);
  16942. else if (b instanceof Xe) a instanceof Ve ? a.nc.add(b) : D.k("A PathFigure can only be added to a Geometry, not to: " + a);
  16943. else if (b instanceof $f) a instanceof Xe ? a.Eb.add(b) : D.k("A PathSegment can only be added to a PathFigure, not to: " + a);
  16944. else if (b instanceof $g) a instanceof
  16945. E ? a.Yb = b : a instanceof I ? a.Yb = b : D.k("A Layout can only be assigned to a Diagram or a Group, not to: " + a);
  16946. else if (Array.isArray(b))
  16947. for (c = 0; c < b.length; c++) kp(a, b[c]);
  16948. else if ("object" === typeof b && null !== b)
  16949. if (a instanceof Ba) {
  16950. e = new ma;
  16951. for (c in b) d = parseFloat(c), isNaN(d) ? e[c] = b[c] : a.addColorStop(d, b[c]);
  16952. D.nv(a, e)
  16953. } else if (a instanceof jh) {
  16954. void 0 !== b.row ? (e = b.row, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && D.k("Must specify non-negative integer row for RowColumnDefinition " + b + ", not: " + e), a.Ke = !0,
  16955. a.index = e) : void 0 !== b.column && (e = b.column, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && D.k("Must specify non-negative integer column for RowColumnDefinition " + b + ", not: " + e), a.Ke = !1, a.index = e);
  16956. e = new ma;
  16957. for (c in b) "row" !== c && "column" !== c && (e[c] = b[c]);
  16958. D.nv(a, e)
  16959. } else D.nv(a, b);
  16960. else D.k('Unknown initializer "' + b + '" for object being constructed by GraphObject.make: ' + a)
  16961. }
  16962. var jp = new oa("string", "function");
  16963. O.getBuilders = function() {
  16964. var a = new oa("string", "function"),
  16965. b;
  16966. for (b in jp)
  16967. if (b !== b.toLowerCase()) { var c = jp.oa(b); "function" === typeof c && a.add(b, c) }
  16968. a.freeze();
  16969. return a
  16970. };
  16971. var lp;
  16972. O.defineBuilder = lp = function(a, b) {
  16973. D.h(a, "string", O, "defineBuilder:name");
  16974. D.h(b, "function", O, "defineBuilder:func");
  16975. var c = a.toLowerCase();
  16976. "" !== a && "none" !== c && a !== c || D.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a);
  16977. jp.add(a, b)
  16978. };
  16979. var mp;
  16980. O.takeBuilderArgument = mp = function(a, b, c) { void 0 === c && (c = null); var d = a[1]; if ("function" === typeof c ? c(d) : "string" === typeof d) return a.splice(1, 1), d; if (void 0 === b) throw Error("no " + ("function" === typeof c ? "satisfactory" : "string") + " argument for GraphObject builder " + a[0]); return b };
  16981. lp("Button", function() {
  16982. var a = new Ba(Gg);
  16983. a.addColorStop(0, "white");
  16984. a.addColorStop(1, "lightgray");
  16985. var b = new Ba(Gg);
  16986. b.addColorStop(0, "white");
  16987. b.addColorStop(1, "dodgerblue");
  16988. a = ip(x, Pl, {
  16989. Hu: !0,
  16990. CF: function(a, b) {
  16991. var e = a.Md("ButtonBorder");
  16992. null !== e && (e.fill = b ? a._buttonFillNormal : a._buttonFillDisabled)
  16993. },
  16994. _buttonFillNormal: a,
  16995. _buttonStrokeNormal: "gray",
  16996. _buttonFillOver: b,
  16997. _buttonStrokeOver: "blue",
  16998. _buttonFillDisabled: "darkgray"
  16999. }, ip(z, {
  17000. name: "ButtonBorder",
  17001. Kb: "Rectangle",
  17002. C: new S(0, 0, 2.761423749153968, 2.761423749153968),
  17003. D: new S(1, 1, -2.761423749153968, -2.761423749153968),
  17004. fill: a,
  17005. stroke: "gray"
  17006. }));
  17007. a.Yu = function(a, b) {
  17008. if (b.Ju()) {
  17009. var e = b.Md("ButtonBorder");
  17010. if (e instanceof z) {
  17011. var g = b._buttonFillOver;
  17012. b._buttonFillNormal = e.fill;
  17013. e.fill = g;
  17014. g = b._buttonStrokeOver;
  17015. b._buttonStrokeNormal = e.stroke;
  17016. e.stroke = g
  17017. }
  17018. }
  17019. };
  17020. a.Zu = function(a, b) {
  17021. if (b.Ju()) {
  17022. var e = b.Md("ButtonBorder");
  17023. e instanceof z && (e.fill = b._buttonFillNormal, e.stroke = b._buttonStrokeNormal)
  17024. }
  17025. };
  17026. return a
  17027. });
  17028. lp("TreeExpanderButton", function() {
  17029. var a = ip("Button", { _treeExpandedFigure: "MinusLine", _treeCollapsedFigure: "PlusLine" }, ip(z, { name: "ButtonIcon", Kb: "MinusLine", Ea: Zd }, (new ph("figure", "isTreeExpanded", function(a, c) { var d = c.R; return a ? d._treeExpandedFigure : d._treeCollapsedFigure })).yy()), { visible: !1 }, (new ph("visible", "isTreeLeaf", function(a) { return !a })).yy());
  17030. a.click = function(a, c) {
  17031. var d = c.Y;
  17032. d instanceof da && (d = d.If);
  17033. if (d instanceof G) {
  17034. var e = d.g;
  17035. if (null !== e) {
  17036. e = e.yb;
  17037. if (d.Dc) { if (!e.canCollapseTree(d)) return } else if (!e.canExpandTree(d)) return;
  17038. a.Cc = !0;
  17039. d.Dc ? e.collapseTree(d) : e.expandTree(d)
  17040. }
  17041. }
  17042. };
  17043. return a
  17044. });
  17045. lp("SubGraphExpanderButton", function() {
  17046. var a = ip("Button", { _subGraphExpandedFigure: "MinusLine", _subGraphCollapsedFigure: "PlusLine" }, ip(z, { name: "ButtonIcon", Kb: "MinusLine", Ea: Zd }, (new ph("figure", "isSubGraphExpanded", function(a, c) { var d = c.R; return a ? d._subGraphExpandedFigure : d._subGraphCollapsedFigure })).yy()));
  17047. a.click = function(a, c) {
  17048. var d = c.Y;
  17049. d instanceof da && (d = d.If);
  17050. if (d instanceof I) {
  17051. var e = d.g;
  17052. if (null !== e) {
  17053. e = e.yb;
  17054. if (d.md) { if (!e.canCollapseSubGraph(d)) return } else if (!e.canExpandSubGraph(d)) return;
  17055. a.Cc = !0;
  17056. d.md ? e.collapseSubGraph(d) : e.expandSubGraph(d)
  17057. }
  17058. }
  17059. };
  17060. return a
  17061. });
  17062. lp("ToolTip", function() {
  17063. var a = new da(Pl),
  17064. b = new z;
  17065. b.name = "Border";
  17066. b.fill = "#FFFFE0";
  17067. b.stroke = "#CCCCCC";
  17068. a.add(b);
  17069. return a
  17070. });
  17071. lp("ContextMenu", function() { return new da(Ol) });
  17072. lp("ContextMenuButton", function() {
  17073. var a = ip("Button");
  17074. a.stretch = yo;
  17075. var b = a.Md("ButtonBorder");
  17076. b instanceof z && (b.Kb = "Rectangle", b.C = new S(0, 0, 2, 3), b.D = new S(1, 1, -2, -2));
  17077. return a
  17078. });
  17079. lp("PanelExpanderButton", function(a) {
  17080. var b = mp(a, "COLLAPSIBLE"),
  17081. c = ip("Button", { _buttonExpandedFigure: "TriangleUp", _buttonCollapsedFigure: "TriangleDown" }, ip(z, "TriangleUp", { name: "ButtonIcon", Ea: new Ca(6, 4) }, (new ph("figure", "visible", function(a) { return a ? c._buttonExpandedFigure : c._buttonCollapsedFigure })).yy(b)));
  17082. a = c.Md("ButtonBorder");
  17083. a instanceof z && (a.stroke = null, a.fill = "transparent");
  17084. c.click = function(a, c) {
  17085. var g = c.g;
  17086. if (null !== g && !g.qb) {
  17087. var h = c.qm();
  17088. null === h && (h = c.Y);
  17089. null !== h && (h = h.Md(b), null !== h &&
  17090. (g.Nb("Collapse/Expand Panel"), h.visible = !h.visible, g.jd("Collapse/Expand Panel")))
  17091. }
  17092. };
  17093. return c
  17094. });
  17095. lp("CheckBoxButton", function(a) {
  17096. var b = mp(a);
  17097. a = ip("Button", { "ButtonBorder.fill": "white", "ButtonBorder.stroke": "gray", width: 14, height: 14 }, ip(z, { name: "ButtonIcon", SI: "M0 4 L3 9 9 0", lb: 2, stretch: Ye, dB: bk, visible: !1 }, "" !== b ? (new ph("visible", b)).GJ() : []));
  17098. a.click = function(a, d) {
  17099. var e = a.g;
  17100. if (!(null === e || e.qb || "" !== b && e.ea.qb)) {
  17101. a.Cc = !0;
  17102. var g = d.Md("ButtonIcon");
  17103. e.Nb("checkbox");
  17104. g.visible = !g.visible;
  17105. "function" === typeof d._doClick && d._doClick(a, d);
  17106. e.jd("checkbox")
  17107. }
  17108. };
  17109. return a
  17110. });
  17111. lp("CheckBox", function(a) {
  17112. a = mp(a);
  17113. a = ip("CheckBoxButton", a, { name: "Button", margin: new Lb(0, 1, 0, 0) });
  17114. var b = ip(x, "Horizontal", a, { Hu: !0, margin: 1, _buttonFillNormal: a._buttonFillNormal, _buttonStrokeNormal: a._buttonStrokeNormal, _buttonFillOver: a._buttonFillOver, _buttonStrokeOver: a._buttonStrokeOver, _buttonFillDisabled: a._buttonFillDisabled, Yu: a.Yu, Zu: a.Zu, click: a.click, _buttonClick: a.click });
  17115. a.Yu = null;
  17116. a.Zu = null;
  17117. a.click = null;
  17118. return b
  17119. });
  17120. function Do() { this.Yr = this.Ui = this.wj = this.dr = this.gr = this.fr = this.er = this.kj = this.Qs = this.Ps = this.lj = this.mj = this.nj = this.Ss = this.Rs = this.Ti = this.Yi = this.Ri = null }
  17121. Do.prototype.copy = function() {
  17122. var a = new Do;
  17123. a.Ri = this.Ri;
  17124. a.Yi = this.Yi;
  17125. a.Ti = this.Ti;
  17126. a.Rs = this.Rs;
  17127. a.Ss = this.Ss;
  17128. a.nj = this.nj;
  17129. a.mj = this.mj;
  17130. a.lj = this.lj;
  17131. a.Ps = this.Ps;
  17132. a.Qs = this.Qs;
  17133. a.kj = this.kj;
  17134. a.er = this.er;
  17135. a.fr = this.fr;
  17136. a.gr = this.gr;
  17137. a.dr = this.dr;
  17138. a.wj = this.wj;
  17139. a.Ui = this.Ui;
  17140. a.Yr = this.Yr;
  17141. return a
  17142. };
  17143. function x(a) {
  17144. O.call(this);
  17145. void 0 === a ? this.da = ek : (D.Da(a, x, x, "type"), this.da = a);
  17146. this.xa = new K(O);
  17147. this.tf = Sd;
  17148. this.da === Sl && (this.Yn = !0);
  17149. this.Jr = Vc;
  17150. this.Xi = wo;
  17151. this.da === fa && np(this);
  17152. this.Wp = bk;
  17153. this.js = ae;
  17154. this.ks = Kd;
  17155. this.fs = 0;
  17156. this.es = 100;
  17157. this.hs = 10;
  17158. this.gs = 0;
  17159. this.zl = this.Sd = this.pk = this.Tm = this.Vm = null;
  17160. this.xs = NaN;
  17161. this.Ig = this.ej = null;
  17162. this.op = "category";
  17163. this.Hg = null;
  17164. this.yj = new C(NaN, NaN, NaN, NaN);
  17165. this.Ik = this.wt = this.Xl = null;
  17166. this.dk = ""
  17167. }
  17168. D.Ta(x, O);
  17169. D.Di(x);
  17170. D.ka("Panel", x);
  17171. function np(a) {
  17172. a.hk = Sd;
  17173. a.fi = 1;
  17174. a.Wi = null;
  17175. a.Rm = null;
  17176. a.ei = 1;
  17177. a.di = null;
  17178. a.Qm = null;
  17179. a.hd = [];
  17180. a.cd = [];
  17181. a.pn = op;
  17182. a.Pm = op;
  17183. a.xj = 0;
  17184. a.hj = 0
  17185. }
  17186. x.prototype.cloneProtected = function(a) {
  17187. O.prototype.cloneProtected.call(this, a);
  17188. a.da = this.da;
  17189. a.tf = this.tf.V();
  17190. a.Jr = this.Jr.V();
  17191. a.Xi = this.Xi;
  17192. if (a.da === fa) {
  17193. a.hk = this.hk.V();
  17194. a.fi = this.fi;
  17195. a.Wi = this.Wi;
  17196. a.Rm = this.Rm;
  17197. a.ei = this.ei;
  17198. a.di = this.di;
  17199. a.Qm = this.Qm;
  17200. var b = [];
  17201. if (0 < this.hd.length)
  17202. for (var c = this.hd, d = c.length, e = 0; e < d; e++)
  17203. if (void 0 !== c[e]) {
  17204. var g = c[e].copy();
  17205. g.Bm(a);
  17206. b[e] = g
  17207. }
  17208. a.hd = b;
  17209. b = [];
  17210. if (0 < this.cd.length)
  17211. for (c = this.cd, d = c.length, e = 0; e < d; e++) void 0 !== c[e] && (g = c[e].copy(), g.Bm(a), b[e] = g);
  17212. a.cd = b;
  17213. a.pn = this.pn;
  17214. a.Pm = this.Pm;
  17215. a.xj = this.xj;
  17216. a.hj = this.hj
  17217. }
  17218. a.Wp = this.Wp;
  17219. a.js = this.js.V();
  17220. a.ks = this.ks.V();
  17221. a.fs = this.fs;
  17222. a.es = this.es;
  17223. a.hs = this.hs;
  17224. a.gs = this.gs;
  17225. a.Vm = this.Vm;
  17226. a.pk = this.pk;
  17227. a.Sd = this.Sd;
  17228. a.zl = this.zl;
  17229. a.xs = this.xs;
  17230. a.ej = this.ej;
  17231. a.Ig = this.Ig;
  17232. a.op = this.op;
  17233. a.yj.assign(this.yj);
  17234. a.dk = this.dk;
  17235. null !== this.wt && (a.wt = this.wt)
  17236. };
  17237. x.prototype.Ei = function(a) {
  17238. O.prototype.Ei.call(this, a);
  17239. a.xa = this.xa;
  17240. for (var b = a.xa.o, c = b.length, d = 0; d < c; d++) b[d].rj = a;
  17241. a.Xl = null
  17242. };
  17243. x.prototype.copy = function() {
  17244. var a = O.prototype.copy.call(this);
  17245. if (null !== a) {
  17246. for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) {
  17247. var e = b[d].copy(),
  17248. g = a;
  17249. e.Bm(g);
  17250. e.mn = null;
  17251. var h = g.xa,
  17252. k = h.count;
  17253. h.be(k, e);
  17254. h = g.Y;
  17255. if (null !== h) {
  17256. h.Sl = null;
  17257. null !== e.yd && h instanceof G && (h.bl = !0);
  17258. var l = g.g;
  17259. null !== l && l.na.ub || h.od(hg, "elements", g, null, e, null, k)
  17260. }
  17261. }
  17262. return a
  17263. }
  17264. return null
  17265. };
  17266. x.prototype.qc = function(a) { a.Qe === x ? this.type = a : O.prototype.qc.call(this, a) };
  17267. x.prototype.toString = function() { return "Panel(" + this.type + ")#" + D.Nd(this) };
  17268. var ek;
  17269. x.Position = ek = D.s(x, "Position", 0);
  17270. x.Horizontal = D.s(x, "Horizontal", 1);
  17271. var Ol;
  17272. x.Vertical = Ol = D.s(x, "Vertical", 2);
  17273. var Xj;
  17274. x.Spot = Xj = D.s(x, "Spot", 3);
  17275. var Pl;
  17276. x.Auto = Pl = D.s(x, "Auto", 4);
  17277. var fa;
  17278. x.Table = fa = D.s(x, "Table", 5);
  17279. x.Viewbox = D.s(x, "Viewbox", 6);
  17280. var Ro;
  17281. x.TableRow = Ro = D.s(x, "TableRow", 7);
  17282. var So;
  17283. x.TableColumn = So = D.s(x, "TableColumn", 8);
  17284. var sj;
  17285. x.Link = sj = D.s(x, "Link", 9);
  17286. var Sl;
  17287. x.Grid = Sl = D.s(x, "Grid", 10);
  17288. var pp;
  17289. x.Graduated = pp = D.s(x, "Graduated", 11);
  17290. D.defineProperty(x, { type: "type" }, function() { return this.da }, function(a) {
  17291. var b = this.da;
  17292. b !== a && (v && D.Da(a, x, x, "type"), b !== Ro && b !== So || D.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: " + a), this.da = a, this.da === Sl ? this.Yn = !0 : this.da === fa && np(this), this.K(), this.i("type", b, a))
  17293. });
  17294. D.w(x, { elements: "elements" }, function() { return this.xa.j });
  17295. D.w(x, { Ga: "naturalBounds" }, function() { return this.fd });
  17296. D.defineProperty(x, { padding: "padding" }, function() { return this.tf }, function(a) {
  17297. "number" === typeof a ? (0 > a && D.ua(a, ">= 0", x, "padding"), a = new Lb(a)) : (D.l(a, Lb, x, "padding"), 0 > a.left && D.ua(a.left, ">= 0", x, "padding:value.left"), 0 > a.right && D.ua(a.right, ">= 0", x, "padding:value.right"), 0 > a.top && D.ua(a.top, ">= 0", x, "padding:value.top"), 0 > a.bottom && D.ua(a.bottom, ">= 0", x, "padding:value.bottom"));
  17298. var b = this.tf;
  17299. b.O(a) || (this.tf = a = a.V(), this.K(), this.i("padding", b, a))
  17300. });
  17301. D.defineProperty(x, { om: "defaultAlignment" }, function() { return this.Jr }, function(a) {
  17302. var b = this.Jr;
  17303. b.O(a) || (v && D.l(a, S, x, "defaultAlignment"), this.Jr = a = a.V(), this.K(), this.i("defaultAlignment", b, a))
  17304. });
  17305. D.defineProperty(x, { le: "defaultStretch" }, function() { return this.Xi }, function(a) {
  17306. var b = this.Xi;
  17307. b !== a && (D.Da(a, O, x, "defaultStretch"), this.Xi = a, this.K(), this.i("defaultStretch", b, a))
  17308. });
  17309. D.defineProperty(x, { FL: "defaultSeparatorPadding" }, function() { return void 0 === this.hk ? Sd : this.hk }, function(a) {
  17310. if (void 0 !== this.hk) {
  17311. "number" === typeof a ? a = new Lb(a) : v && D.l(a, Lb, x, "defaultSeparatorPadding");
  17312. var b = this.hk;
  17313. b.O(a) || (this.hk = a = a.V(), this.K(), this.i("defaultSeparatorPadding", b, a))
  17314. }
  17315. });
  17316. D.defineProperty(x, { DL: "defaultRowSeparatorStroke" }, function() { return void 0 === this.Wi ? null : this.Wi }, function(a) {
  17317. var b = this.Wi;
  17318. b !== a && (null === a || "string" === typeof a || a instanceof Ba) && (a instanceof Ba && a.freeze(), this.Wi = a, this.ra(), this.i("defaultRowSeparatorStroke", b, a))
  17319. });
  17320. D.defineProperty(x, { EL: "defaultRowSeparatorStrokeWidth" }, function() { return void 0 === this.fi ? 1 : this.fi }, function(a) {
  17321. if (void 0 !== this.fi) {
  17322. var b = this.fi;
  17323. b !== a && isFinite(a) && 0 <= a && (this.fi = a, this.K(), this.i("defaultRowSeparatorStrokeWidth", b, a))
  17324. }
  17325. });
  17326. D.defineProperty(x, { CL: "defaultRowSeparatorDashArray" }, function() { return void 0 === this.Rm ? null : this.Rm }, function(a) {
  17327. if (void 0 !== this.Rm) {
  17328. var b = this.Rm;
  17329. if (b !== a) {
  17330. null === a || Array.isArray(a) || D.kc(a, "Array", x, "defaultRowSeparatorDashArray:value");
  17331. if (null !== a) {
  17332. for (var c = a.length, d = 0, e = 0; e < c; e++) {
  17333. var g = a[e];
  17334. "number" === typeof g && 0 <= g && isFinite(g) || D.k("defaultRowSeparatorDashArray value " + g + " at index " + e + " must be a positive number or zero.");
  17335. d += g
  17336. }
  17337. if (0 === d) {
  17338. if (null === b) return;
  17339. a = null
  17340. }
  17341. }
  17342. this.Rm = a;
  17343. this.ra();
  17344. this.i("defaultRowSeparatorDashArray", b, a)
  17345. }
  17346. }
  17347. });
  17348. D.defineProperty(x, { xL: "defaultColumnSeparatorStroke" }, function() { return void 0 === this.di ? null : this.di }, function(a) {
  17349. if (void 0 !== this.di) {
  17350. var b = this.di;
  17351. b !== a && (null === a || "string" === typeof a || a instanceof Ba) && (a instanceof Ba && a.freeze(), this.di = a, this.ra(), this.i("defaultColumnSeparatorStroke", b, a))
  17352. }
  17353. });
  17354. D.defineProperty(x, { yL: "defaultColumnSeparatorStrokeWidth" }, function() { return void 0 === this.ei ? 1 : this.ei }, function(a) {
  17355. if (void 0 !== this.ei) {
  17356. var b = this.ei;
  17357. b !== a && isFinite(a) && 0 <= a && (this.ei = a, this.K(), this.i("defaultColumnSeparatorStrokeWidth", b, a))
  17358. }
  17359. });
  17360. D.defineProperty(x, { wL: "defaultColumnSeparatorDashArray" }, function() { return void 0 === this.Qm ? null : this.Qm }, function(a) {
  17361. if (void 0 !== this.Qm) {
  17362. var b = this.Qm;
  17363. if (b !== a) {
  17364. null === a || Array.isArray(a) || D.kc(a, "Array", x, "defaultColumnSeparatorDashArray:value");
  17365. if (null !== a) {
  17366. for (var c = a.length, d = 0, e = 0; e < c; e++) {
  17367. var g = a[e];
  17368. "number" === typeof g && 0 <= g && isFinite(g) || D.k("defaultColumnSeparatorDashArray value " + g + " at index " + e + " must be a positive number or zero.");
  17369. d += g
  17370. }
  17371. if (0 === d) {
  17372. if (null === b) return;
  17373. a = null
  17374. }
  17375. }
  17376. this.Qm =
  17377. a;
  17378. this.ra();
  17379. this.i("defaultColumnSeparatorDashArray", b, a)
  17380. }
  17381. }
  17382. });
  17383. D.defineProperty(x, { SM: "viewboxStretch" }, function() { return this.Wp }, function(a) {
  17384. var b = this.Wp;
  17385. b !== a && (D.Da(a, O, x, "viewboxStretch"), this.Wp = a, this.K(), this.i("viewboxStretch", b, a))
  17386. });
  17387. D.defineProperty(x, { ay: "gridCellSize" }, function() { return this.js }, function(a) {
  17388. var b = this.js;
  17389. if (!b.O(a)) {
  17390. D.l(a, Ca, x, "gridCellSize");
  17391. a.H() && 0 !== a.width && 0 !== a.height || D.k("Invalid Panel.gridCellSize: " + a);
  17392. this.js = a.V();
  17393. var c = this.g;
  17394. null !== c && this === c.Vn && lm(c);
  17395. this.ra();
  17396. this.i("gridCellSize", b, a)
  17397. }
  17398. });
  17399. D.defineProperty(x, { WF: "gridOrigin" }, function() { return this.ks }, function(a) {
  17400. var b = this.ks;
  17401. if (!b.O(a)) {
  17402. D.l(a, N, x, "gridOrigin");
  17403. a.H() || D.k("Invalid Panel.gridOrigin: " + a);
  17404. this.ks = a.V();
  17405. var c = this.g;
  17406. null !== c && this === c.Vn && lm(c);
  17407. this.ra();
  17408. this.i("gridOrigin", b, a)
  17409. }
  17410. });
  17411. D.defineProperty(x, { al: "graduatedMin" }, function() { return this.fs }, function(a) {
  17412. D.p(a, x, "graduatedMin");
  17413. var b = this.fs;
  17414. b !== a && (this.fs = a, this.K(), this.i("graduatedMin", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "graduatedRange")))
  17415. });
  17416. D.defineProperty(x, { gB: "graduatedMax" }, function() { return this.es }, function(a) {
  17417. D.p(a, x, "graduatedMax");
  17418. var b = this.es;
  17419. b !== a && (this.es = a, this.K(), this.i("graduatedMax", b, a), Ho(this) && (a = this.Y, null !== a && Io(this, a, "graduatedRange")))
  17420. });
  17421. D.w(x, { Du: "graduatedRange" }, function() { return this.gB - this.al });
  17422. D.defineProperty(x, { hB: "graduatedTickUnit" }, function() { return this.hs }, function(a) {
  17423. D.p(a, x, "graduatedTickUnit");
  17424. var b = this.hs;
  17425. b !== a && 0 < a && (this.hs = a, this.K(), this.i("graduatedTickUnit", b, a))
  17426. });
  17427. D.defineProperty(x, { VF: "graduatedTickBase" }, function() { return this.gs }, function(a) {
  17428. D.p(a, x, "graduatedTickBase");
  17429. var b = this.gs;
  17430. b !== a && (this.gs = a, this.K(), this.i("graduatedTickBase", b, a))
  17431. });
  17432. f = x.prototype;
  17433. f.$s = function(a) { O.prototype.$s.call(this, a); for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) b[d].$s(a) };
  17434. f.Wk = function(a, b) {
  17435. if (this.da === Sl) {
  17436. var c = this.Jj() * b.scale;
  17437. 0 >= c && (c = 1);
  17438. var d = this.ay,
  17439. e = d.width,
  17440. d = d.height,
  17441. g = this.Ga,
  17442. h = g.width,
  17443. g = g.height,
  17444. k = Math.ceil(h / e),
  17445. l = Math.ceil(g / d),
  17446. m = this.WF;
  17447. a.save();
  17448. a.beginPath();
  17449. a.rect(0, 0, h, g);
  17450. a.clip();
  17451. for (var n = [], p = this.xa.o, q = p.length, r = 0; r < q; r++) {
  17452. var s = p[r],
  17453. u = [];
  17454. n.push(u);
  17455. if (s.visible)
  17456. for (var s = hn(s.Kb), t = r + 1; t < q; t++) {
  17457. var y = p[t];
  17458. y.visible && hn(y.Kb) === s && (y = y.interval, 2 <= y && u.push(y))
  17459. }
  17460. }
  17461. p = this.xa.o;
  17462. q = p.length;
  17463. for (r = 0; r < q; r++) {
  17464. var w = p[r];
  17465. if (w.visible && (u = w.interval, !(2 >
  17466. e * u * c))) {
  17467. s = w.opacity;
  17468. t = 1;
  17469. if (1 !== s) {
  17470. if (0 === s) continue;
  17471. t = a.globalAlpha;
  17472. a.globalAlpha = t * s
  17473. }
  17474. var y = n[r],
  17475. A = !1,
  17476. B = !0,
  17477. P = w.jH;
  17478. null !== P && (A = !0, B = a.YA(P, w.Hf));
  17479. if ("LineV" === w.Kb && null !== w.stroke) {
  17480. a.lineWidth = w.lb;
  17481. Vo(this, a, w.stroke, !1, !1);
  17482. a.beginPath();
  17483. for (var H = Math.floor(-m.x / e), R = H; R <= H + k; R++) {
  17484. var aa = R * e + m.x;
  17485. 0 <= aa && aa <= h && qp(R, u, y) && (A && !B ? Go(a, aa, 0, aa, g, P, w.Hf) : (a.moveTo(aa, 0), a.lineTo(aa, g)))
  17486. }
  17487. a.stroke()
  17488. } else if ("LineH" === w.Kb && null !== w.stroke) {
  17489. a.lineWidth = w.lb;
  17490. Vo(this, a, w.stroke, !1, !1);
  17491. a.beginPath();
  17492. for (R =
  17493. H = Math.floor(-m.y / d); R <= H + l; R++) aa = R * d + m.y, 0 <= aa && aa <= g && qp(R, u, y) && (A && !B ? Go(a, 0, aa, h, aa, P, w.Hf) : (a.moveTo(0, aa), a.lineTo(h, aa)));
  17494. a.stroke()
  17495. } else if ("BarV" === w.Kb && null !== w.fill)
  17496. for (Vo(this, a, w.fill, !0, !1), w = w.width, isNaN(w) && (w = e), R = H = Math.floor(-m.x / e); R <= H + k; R++) aa = R * e + m.x, 0 <= aa && aa <= h && qp(R, u, y) && a.fillRect(aa, 0, w, g);
  17497. else if ("BarH" === w.Kb && null !== w.fill)
  17498. for (Vo(this, a, w.fill, !0, !1), w = w.height, isNaN(w) && (w = d), R = H = Math.floor(-m.y / d); R <= H + l; R++) aa = R * d + m.y, 0 <= aa && aa <= g && qp(R, u, y) && a.fillRect(0, aa,
  17499. h, w);
  17500. A && a.TA();
  17501. 1 !== s && (a.globalAlpha = t)
  17502. }
  17503. }
  17504. a.restore();
  17505. a.De(!1)
  17506. } else if (this.da === pp) {
  17507. e = this.Ga;
  17508. c = e.width;
  17509. e = e.height;
  17510. a.save();
  17511. a.beginPath();
  17512. a.rect(-1, -1, c + 1, e + 1);
  17513. a.clip();
  17514. c = this.Ld();
  17515. c.He(a, b);
  17516. e = this.Jj() * b.scale;
  17517. 0 >= e && (e = 1);
  17518. d = c.aa;
  17519. h = this.xa.o;
  17520. g = this.Vm;
  17521. k = h.length;
  17522. for (l = 0; l < k; l++)
  17523. if (q = h[l], m = g[l], n = m.length, q.visible && q !== c && 0 !== m.length)
  17524. if (q instanceof z) {
  17525. if (!(2 > this.hB * q.interval * c.vf.vu / this.Du * e))
  17526. for (r = q.Fa, u = q.lb * q.scale, s = q.Gh, s.de() && (s = jc), p = 0; p < n; p++) t = q, y = m[p][0], A = d, H = m[p][1], R = r, w = u, B = s,
  17527. P = t.Nc, P.reset(), P.translate(y.x + A.x, y.y + A.y), P.rotate(H + t.angle, 0, 0), P.translate(-R.width * B.x + B.offsetX + w / 2, -R.height * B.y + B.offsetY + w / 2), P.scale(t.scale, t.scale), Xo(t, !1), t.Ni.set(t.Nc), t.Xo = t.scale, Yo(t, !1), q.He(a, b), q.Nc.reset()
  17528. } else if (q instanceof pa)
  17529. for (null === this.Ik && (this.Ik = new pa), r = this.Ik, rp(q, r), p = 0; p < n; p++) y = m[p], 3 < y.length && (s = y[6], r.Yd = y[2], r.wg = y[3], r.xe = y[4], r.sf = y[5], r.fd = y[8], r.rc(s.x, s.y, s.width, s.height), q = r, u = d, t = y[7], y = y[8], A = q.Nc, A.reset(), A.translate(s.x + u.x, s.y + u.y), A.translate(-t.x, -t.y), Ko(q, A, y.x, y.y, y.width, y.height), Xo(q, !1), q.Ni.set(q.Nc), q.Xo = q.scale, Yo(q, !1), r.He(a, b));
  17530. a.restore();
  17531. a.De(!0)
  17532. } else {
  17533. this.da === fa && (a.lineCap = "butt", sp(this, a, !0, this.hd, !0), sp(this, a, !1, this.cd, !0), tp(this, a, !0, this.hd), tp(this, a, !1, this.cd), sp(this, a, !0, this.hd, !1), sp(this, a, !1, this.cd, !1));
  17534. if (c = this.yq) a.save(), v && this.type !== Xj && D.trace("Warning: Panel.isClipping set on non-Spot Panel: " + this.toString());
  17535. e = this.Ld();
  17536. d = this.xa.o;
  17537. h = d.length;
  17538. for (g = 0; g < h; g++) k = d[g], c && k === e && (a.eq = !0), k.He(a,
  17539. b), c && k === e && (a.eq = !1);
  17540. c && (a.restore(), a.De(!0));
  17541. v && v.JI && this instanceof J && v.II(a, b, this)
  17542. }
  17543. };
  17544. function rp(a, b) {
  17545. b.S = a.S | 6144;
  17546. b.Lc = a.Lc;
  17547. b.Mb = a.Mb;
  17548. b.lc = a.lc;
  17549. b.$e = a.$e.V();
  17550. b.oi = a.oi.V();
  17551. b.ni = a.ni.V();
  17552. b.ij = a.ij.copy();
  17553. b.Db = a.Db;
  17554. b.wg = a.wg;
  17555. b.Qg = a.Qg;
  17556. b.en = a.en.V();
  17557. b.ue = a.ue.V();
  17558. b.Lm = a.Lm.V();
  17559. b.qn = a.qn;
  17560. b.rn = a.rn.V();
  17561. b.sn = a.sn;
  17562. null !== a.yg && (b.yg = a.yg.copy());
  17563. b.wn = a.wn;
  17564. a instanceof pa && (b.Yd = a.Yd, b.Bc = a.Bc, b.Bg = a.Bg, b.Yl = a.Yl, b.Ag = a.Ag, b.bm = a.bm, b.Ym = a.Ym, b.vk = a.vk, b.tk = a.tk, b.pj = a.pj, b.Aj = a.Aj, b.sf.kk = null, b.vi = a.vi, b.wi = a.wi, b.wh = a.wh, b.rp = a.rp, b.Fg = a.Fg, b.Eg = a.Eg, b.Dg = a.Dg, b.Um = a.Um)
  17565. }
  17566. function tp(a, b, c, d) {
  17567. for (var e = d.length, g = a.aa, h = !0, k = 0; k < e; k++) {
  17568. var l = d[k];
  17569. if (void 0 !== l)
  17570. if (h) h = !1;
  17571. else if (0 !== l.hb) {
  17572. if (c) { if (l.position > g.height) continue } else if (l.position > g.width) continue;
  17573. var m = l.Wq;
  17574. isNaN(m) && (m = c ? a.fi : a.ei);
  17575. var n = l.Vq;
  17576. null === n && (n = c ? a.Wi : a.di);
  17577. 0 !== m && null !== n && (Vo(a, b, n, !1, !1), b.beginPath(), n = l.position + m, c ? n > g.height && (m -= n - g.height) : n > g.width && (m -= n - g.width), l = l.position + m / 2, b.lineWidth = m, n = a.padding, c ? (l += n.top, m = n.left, n = g.width - n.right, b.moveTo(m, l), b.lineTo(n, l)) : (l += n.left,
  17578. m = n.top, n = g.height - n.bottom, b.moveTo(l, m), b.lineTo(l, n)), b.stroke())
  17579. }
  17580. }
  17581. }
  17582. function sp(a, b, c, d, e) {
  17583. for (var g = d.length, h = a.aa, k = 0; k < g; k++) {
  17584. var l = d[k];
  17585. if (void 0 !== l && null !== l.background && l.RA !== e && 0 !== l.hb) {
  17586. var m = c ? h.height : h.width;
  17587. if (!(l.position > m)) {
  17588. var n = l.hf(),
  17589. p = l.Wq;
  17590. isNaN(p) && (p = c ? a.fi : a.ei);
  17591. var q = l.Vq;
  17592. null === q && (q = c ? a.Wi : a.di);
  17593. null === q && (p = 0);
  17594. n -= p;
  17595. p = l.position + p;
  17596. n += l.hb;
  17597. p + n > m && (n = m - p);
  17598. 0 >= n || (m = a.padding, Vo(a, b, l.background, !0, !1), c ? b.fillRect(m.left, p + m.top, h.width - (m.left + m.right), n) : b.fillRect(p + m.left, m.top, n, h.height - (m.top + m.bottom)))
  17599. }
  17600. }
  17601. }
  17602. }
  17603. function qp(a, b, c) {
  17604. if (0 !== a % b) return !1;
  17605. b = c.length;
  17606. for (var d = 0; d < b; d++)
  17607. if (0 === a % c[d]) return !1;
  17608. return !0
  17609. }
  17610. function hn(a) { return "LineV" === a || "BarV" === a }
  17611. f.Tn = function(a, b, c, d, e) {
  17612. var g = this.kh(),
  17613. h = this.transform,
  17614. k = 1 / (h.m11 * h.m22 - h.m12 * h.m21),
  17615. l = h.m22 * k,
  17616. m = -h.m12 * k,
  17617. n = -h.m21 * k,
  17618. p = h.m11 * k,
  17619. q = k * (h.m21 * h.dy - h.m22 * h.dx),
  17620. r = k * (h.m12 * h.dx - h.m11 * h.dy);
  17621. if (null !== this.gm) return h = this.aa, Je(h.left, h.top, h.right, h.bottom, a, b, c, d, e);
  17622. if (null !== this.background) g = a * l + b * n + q, k = a * m + b * p + r, a = c * l + d * n + q, l = c * m + d * p + r, e.n(0, 0), c = this.Ga, c = Je(0, 0, c.width, c.height, g, k, a, l, e), e.transform(h);
  17623. else {
  17624. g || (l = 1, n = m = 0, p = 1, r = q = 0);
  17625. k = a * l + b * n + q;
  17626. a = a * m + b * p + r;
  17627. l = c * l + d * n + q;
  17628. d = c * m + d * p + r;
  17629. e.n(l, d);
  17630. m = (l -
  17631. k) * (l - k) + (d - a) * (d - a);
  17632. c = !1;
  17633. p = this.xa.o;
  17634. r = p.length;
  17635. n = D.P();
  17636. q = null;
  17637. b = Infinity;
  17638. var s = null;
  17639. this.yq && (s = D.P(), q = this.Ld(), (c = q.Tn(k, a, l, d, s)) && (b = (k - s.x) * (k - s.x) + (a - s.y) * (a - s.y)));
  17640. for (var u = 0; u < r; u++) {
  17641. var t = p[u];
  17642. t.visible && t !== q && t.Tn(k, a, l, d, n) && (c = !0, t = (k - n.x) * (k - n.x) + (a - n.y) * (a - n.y), t < m && (m = t, e.set(n)))
  17643. }
  17644. this.yq && (b > m && e.set(s), D.A(s));
  17645. D.A(n);
  17646. g && e.transform(h)
  17647. }
  17648. return c
  17649. };
  17650. f.K = function(a) {
  17651. O.prototype.K.call(this, a);
  17652. a = null;
  17653. if (this.da === Pl || this.da === sj) a = this.Ld();
  17654. for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) {
  17655. var e = b[d];
  17656. (e === a || e.Ue) && e.K(!0);
  17657. if (!e.Ea.H()) {
  17658. var g = Mo(e, !1);
  17659. (e instanceof Yj || e instanceof x || e instanceof pa || g !== Zj) && e.K(!0)
  17660. }
  17661. }
  17662. };
  17663. f.xq = function() {
  17664. if (!1 === Nm(this)) {
  17665. km(this, !0);
  17666. No(this, !0);
  17667. for (var a = this.xa.o, b = a.length, c = 0; c < b; c++) a[c].xq()
  17668. }
  17669. };
  17670. f.cj = function() {
  17671. if (0 !== (this.S & 2048) === !1) {
  17672. Xo(this, !0);
  17673. Yo(this, !0);
  17674. for (var a = this.xa.o, b = a.length, c = 0; c < b; c++) a[c].nB()
  17675. }
  17676. };
  17677. f.nB = function() { Yo(this, !0); for (var a = this.xa.o, b = a.length, c = 0; c < b; c++) a[c].nB() };
  17678. f.ho = function(a, b, c, d) {
  17679. var e = this.yj;
  17680. e.width = 0;
  17681. e.height = 0;
  17682. var g = this.Ea,
  17683. h = this.ah;
  17684. void 0 === c && (c = h.width, d = h.height);
  17685. c = Math.max(c, h.width);
  17686. d = Math.max(d, h.height);
  17687. var k = this.pf;
  17688. isNaN(g.width) || (a = Math.min(g.width, k.width));
  17689. isNaN(g.height) || (b = Math.min(g.height, k.height));
  17690. a = Math.max(c, a);
  17691. b = Math.max(d, b);
  17692. var l = this.padding;
  17693. a = Math.max(a - l.left - l.right, 0);
  17694. b = Math.max(b - l.top - l.bottom, 0);
  17695. var m = this.xa.o;
  17696. if (0 !== m.length) {
  17697. var n = this.da.$b;
  17698. switch (n) {
  17699. case "Position":
  17700. var p = a,
  17701. q = b,
  17702. r = c,
  17703. s = d,
  17704. u = m.length;
  17705. e.x = 0;
  17706. e.y =
  17707. 0;
  17708. e.width = 0;
  17709. e.height = 0;
  17710. for (var t = Rp(this), y = 0; y < u; y++) {
  17711. var w = m[y];
  17712. if (w.visible || w === t) {
  17713. var A = w.margin,
  17714. B = A.right + A.left,
  17715. P = A.top + A.bottom;
  17716. Hk(w, p, q, r, s);
  17717. var H = w.Fa,
  17718. R = Math.max(H.width + B, 0),
  17719. aa = Math.max(H.height + P, 0),
  17720. V = w.position.x,
  17721. ea = w.position.y;
  17722. isFinite(V) || (V = 0);
  17723. isFinite(ea) || (ea = 0);
  17724. if (w instanceof z) {
  17725. var la = w;
  17726. if (la.hG) var Da = la.lb / 2,
  17727. V = V - Da,
  17728. ea = ea - Da
  17729. }
  17730. Ub(e, V, ea, R, aa)
  17731. }
  17732. }
  17733. break;
  17734. case "Vertical":
  17735. for (var La = a, gb = c, Aa = m.length, W = D.mb(), xb = Rp(this), Pb = 0; Pb < Aa; Pb++) {
  17736. var Sa = m[Pb];
  17737. if (Sa.visible || Sa === xb) {
  17738. var Qc =
  17739. Mo(Sa, !1);
  17740. if (Qc !== Zj && Qc !== xo) W.push(Sa);
  17741. else {
  17742. var Ra = Sa.margin,
  17743. jg = Ra.right + Ra.left,
  17744. kg = Ra.top + Ra.bottom;
  17745. Hk(Sa, La, Infinity, gb, 0);
  17746. var vd = Sa.Fa,
  17747. wd = Math.max(vd.width + jg, 0),
  17748. Rc = Math.max(vd.height + kg, 0);
  17749. e.width = Math.max(e.width, wd);
  17750. e.height += Rc
  17751. }
  17752. }
  17753. }
  17754. var uh = W.length;
  17755. if (0 !== uh) {
  17756. this.Ea.width ? La = Math.min(this.Ea.width, this.pf.width) : 0 !== e.width && (La = Math.min(e.width, this.pf.width));
  17757. for (Pb = 0; Pb < uh; Pb++)
  17758. if (Sa = W[Pb], Sa.visible || Sa === xb) Ra = Sa.margin, jg = Ra.right + Ra.left, kg = Ra.top + Ra.bottom, Hk(Sa, La, Infinity, gb, 0), vd =
  17759. Sa.Fa, wd = Math.max(vd.width + jg, 0), Rc = Math.max(vd.height + kg, 0), e.width = Math.max(e.width, wd), e.height += Rc;
  17760. D.ya(W)
  17761. }
  17762. break;
  17763. case "Horizontal":
  17764. for (var $e = b, hb = d, ub = m.length, sa = D.mb(), na = Rp(this), ab = 0; ab < ub; ab++) {
  17765. var Oa = m[ab];
  17766. if (Oa.visible || Oa === na) {
  17767. var pb = Mo(Oa, !1);
  17768. if (pb !== Zj && pb !== yo) sa.push(Oa);
  17769. else {
  17770. var Md = Oa.margin,
  17771. Jf = Md.right + Md.left,
  17772. se = Md.top + Md.bottom;
  17773. Hk(Oa, Infinity, $e, 0, hb);
  17774. var be = Oa.Fa,
  17775. jd = Math.max(be.width + Jf, 0),
  17776. vh = Math.max(be.height + se, 0);
  17777. e.width += jd;
  17778. e.height = Math.max(e.height, vh)
  17779. }
  17780. }
  17781. }
  17782. var Kf = sa.length;
  17783. if (0 !== Kf) {
  17784. this.Ea.height ? $e = Math.min(this.Ea.height, this.pf.height) : 0 !== e.height && ($e = Math.min(e.height, this.pf.height));
  17785. for (ab = 0; ab < Kf; ab++)
  17786. if (Oa = sa[ab], Oa.visible || Oa === na) Md = Oa.margin, Jf = Md.right + Md.left, se = Md.top + Md.bottom, Hk(Oa, Infinity, $e, 0, hb), be = Oa.Fa, jd = Math.max(be.width + Jf, 0), vh = Math.max(be.height + se, 0), e.width += jd, e.height = Math.max(e.height, vh);
  17787. D.ya(sa)
  17788. }
  17789. break;
  17790. case "Spot":
  17791. a: {
  17792. var Ig = a,
  17793. Hb = b,
  17794. oc = c,
  17795. xd = d,
  17796. wh = m.length,
  17797. qb = this.Ld(),
  17798. Pa = qb.margin,
  17799. Qb = 0,
  17800. Lf = 0,
  17801. Jg = Pa.right + Pa.left,
  17802. xh = Pa.top + Pa.bottom;
  17803. Hk(qb, Ig, Hb, oc, xd);
  17804. for (var ib = qb.Fa, zc = ib.width, $b = ib.height, te = Math.max(zc + Jg, 0), Ac = Math.max($b + xh, 0), Bc = this.yq, vb = D.vg(-Pa.left, -Pa.top, te, Ac), pc = !0, yb = Rp(this), Fc = 0; Fc < wh; Fc++) {
  17805. var db = m[Fc];
  17806. if (db !== qb && (db.visible || db === yb)) {
  17807. Pa = db.margin;
  17808. Qb = Pa.right + Pa.left;
  17809. Lf = Pa.top + Pa.bottom;
  17810. Hk(db, Ig, Hb, 0, 0);
  17811. var ib = db.Fa,
  17812. te = Math.max(ib.width + Qb, 0),
  17813. Ac = Math.max(ib.height + Lf, 0),
  17814. Ta = db.alignment;
  17815. Ta.ld() && (Ta = this.om);
  17816. Ta.Xc() || (Ta = mc);
  17817. var Mb = db.Gh;
  17818. Mb.ld() && (Mb = mc);
  17819. var yd = null;
  17820. db instanceof x && "" !== db.dk && (db.rc(0,
  17821. 0, ib.width, ib.height), yd = db.Md(db.dk), yd === db && (yd = null));
  17822. var lg, af;
  17823. if (null !== yd) {
  17824. for (var bf = yd.Ga, wj = yd.margin, Rb = D.Fb(Mb.x * bf.width + Mb.offsetX - wj.left, Mb.y * bf.height + Mb.offsetY - wj.top); yd !== db;) yd.transform.vb(Rb), yd = yd.R;
  17825. lg = Ta.x * zc + Ta.offsetX - Rb.x;
  17826. af = Ta.y * $b + Ta.offsetY - Rb.y;
  17827. D.A(Rb)
  17828. } else lg = Ta.x * zc + Ta.offsetX - (Mb.x * ib.width - Mb.offsetX) - Pa.left, af = Ta.y * $b + Ta.offsetY - (Mb.y * ib.height - Mb.offsetY) - Pa.top;
  17829. pc ? (pc = !1, e.x = lg, e.y = af, e.width = te, e.height = Ac) : Ub(e, lg, af, te, Ac)
  17830. }
  17831. }
  17832. pc ? e.assign(vb) : Bc ? e.bG(vb.x,
  17833. vb.y, vb.width, vb.height) : Ub(e, vb.x, vb.y, vb.width, vb.height);D.Lb(vb);
  17834. var qc = qb.stretch;qc === wo && (qc = Mo(qb, !1));
  17835. switch (qc) {
  17836. case Zj:
  17837. break a;
  17838. case Ye:
  17839. if (!isFinite(Ig) && !isFinite(Hb)) break a;
  17840. break;
  17841. case yo:
  17842. if (!isFinite(Ig)) break a;
  17843. break;
  17844. case xo:
  17845. if (!isFinite(Hb)) break a
  17846. }
  17847. ib = qb.Fa;zc = ib.width;$b = ib.height;te = Math.max(zc + Jg, 0);Ac = Math.max($b + xh, 0);Pa = qb.margin;vb = D.vg(-Pa.left, -Pa.top, te, Ac);
  17848. for (Fc = 0; Fc < wh; Fc++) db = m[Fc],
  17849. db === qb || !db.visible && db !== yb || (Pa = db.margin, Qb = Pa.right + Pa.left, Lf = Pa.top + Pa.bottom, ib =
  17850. db.Fa, te = Math.max(ib.width + Qb, 0), Ac = Math.max(ib.height + Lf, 0), Ta = db.alignment, Ta.ld() && (Ta = this.om), Ta.Xc() || (Ta = mc), Mb = db.Gh, Mb.ld() && (Mb = mc), pc ? (pc = !1, e.x = Ta.x * zc + Ta.offsetX - (Mb.x * ib.width - Mb.offsetX) - Pa.left, e.y = Ta.y * $b + Ta.offsetY - (Mb.y * ib.height - Mb.offsetY) - Pa.top, e.width = te, e.height = Ac) : Ub(e, Ta.x * zc + Ta.offsetX - (Mb.x * ib.width - Mb.offsetX) - Pa.left, Ta.y * $b + Ta.offsetY - (Mb.y * ib.height - Mb.offsetY) - Pa.top, te, Ac));pc ? e.assign(vb) : Bc ? e.bG(vb.x, vb.y, vb.width, vb.height) : Ub(e, vb.x, vb.y, vb.width, vb.height);
  17851. D.Lb(vb)
  17852. }
  17853. break;
  17854. case "Auto":
  17855. var fc = a,
  17856. kd = b,
  17857. mb = c,
  17858. Sb = d,
  17859. ue = m.length,
  17860. zb = this.Ld(),
  17861. ce = zb.margin,
  17862. yh = fc,
  17863. zh = kd,
  17864. Kg = ce.right + ce.left,
  17865. ld = ce.top + ce.bottom;
  17866. Hk(zb, fc, kd, mb, Sb);
  17867. var Nd = zb.Fa,
  17868. gc = 0,
  17869. Ab = null;
  17870. zb instanceof z && (Ab = zb, gc = Ab.lb * Ab.scale);
  17871. var zd = Math.max(Nd.width + Kg, 0),
  17872. nb = Math.max(Nd.height + ld, 0),
  17873. hc = Sp(zb),
  17874. ii = hc.x * zd + hc.offsetX,
  17875. ad = hc.y * nb + hc.offsetY,
  17876. Ib = Tp(zb),
  17877. ve = Ib.x * zd + Ib.offsetX,
  17878. cf = Ib.y * nb + Ib.offsetY;
  17879. isFinite(fc) && (yh = Math.max(Math.abs(ii - ve) - gc, 0));
  17880. isFinite(kd) && (zh = Math.max(Math.abs(ad - cf) - gc, 0));
  17881. var bd =
  17882. D.Gm();
  17883. bd.n(0, 0);
  17884. for (var Mf = Rp(this), Nf = 0; Nf < ue; Nf++) {
  17885. var Ah = m[Nf];
  17886. if (Ah !== zb && (Ah.visible || Ah === Mf)) {
  17887. var ce = Ah.margin,
  17888. Jk = ce.right + ce.left,
  17889. Bb = ce.top + ce.bottom;
  17890. Hk(Ah, yh, zh, 0, 0);
  17891. Nd = Ah.Fa;
  17892. zd = Math.max(Nd.width + Jk, 0);
  17893. nb = Math.max(Nd.height + Bb, 0);
  17894. bd.n(Math.max(zd, bd.width), Math.max(nb, bd.height))
  17895. }
  17896. }
  17897. if (1 === ue) e.width = zd, e.height = nb, D.Zk(bd);
  17898. else {
  17899. var hc = Sp(zb),
  17900. Ib = Tp(zb),
  17901. de = 0,
  17902. md = 0;
  17903. Ib.x !== hc.x && Ib.y !== hc.y && (de = bd.width / Math.abs(Ib.x - hc.x), md = bd.height / Math.abs(Ib.y - hc.y));
  17904. D.Zk(bd);
  17905. gc = 0;
  17906. null !== Ab && (gc = Ab.lb *
  17907. Ab.scale, ak(Ab) === bk && (de = md = Math.max(de, md)));
  17908. var de = de + (Math.abs(hc.offsetX) + Math.abs(Ib.offsetX) + gc),
  17909. md = md + (Math.abs(hc.offsetY) + Math.abs(Ib.offsetY) + gc),
  17910. Me = zb.stretch;
  17911. Me === wo && (Me = Mo(zb, !1));
  17912. switch (Me) {
  17913. case Zj:
  17914. Sb = mb = 0;
  17915. break;
  17916. case Ye:
  17917. isFinite(fc) && (de = fc);
  17918. isFinite(kd) && (md = kd);
  17919. break;
  17920. case yo:
  17921. isFinite(fc) && (de = fc);
  17922. Sb = 0;
  17923. break;
  17924. case xo:
  17925. mb = 0, isFinite(kd) && (md = kd)
  17926. }
  17927. zb.xq();
  17928. Hk(zb, de, md, mb, Sb);
  17929. e.width = zb.Fa.width + Kg;
  17930. e.height = zb.Fa.height + ld
  17931. }
  17932. break;
  17933. case "Table":
  17934. for (var ji = a, ki = b, xj = c, yj = d, Jb = m.length, Bh = D.mb(),
  17935. Ch = D.mb(), ka = 0; ka < Jb; ka++) {
  17936. var ca = m[ka],
  17937. ic = ca instanceof x ? ca : null;
  17938. if (null === ic || ic.type !== Ro && ic.type !== So || !ca.visible) Bh.push(ca);
  17939. else {
  17940. v && (ic.Ea.H() && D.k(ic.toString() + " TableRow/TableColumn Panels cannot set a desiredSize: " + ic.Ea.toString()), ic.ah.O(Xd) || D.k(ic.toString() + " TableRow/TableColumn Panels cannot set a minSize: " + ic.ah.toString()), ic.pf.O(ge) || D.k(ic.toString() + " TableRow/TableColumn Panels cannot set a maxSize: " + ic.pf.toString()));
  17941. Ch.push(ic);
  17942. for (var mg = ic.xa.o, li = mg.length, Kb =
  17943. 0; Kb < li; Kb++) {
  17944. var mi = mg[Kb];
  17945. ic.type === Ro ? mi.Sb = ca.Sb : ic.type === So && (mi.column = ca.column);
  17946. Bh.push(mi)
  17947. }
  17948. }
  17949. }
  17950. Jb = Bh.length;
  17951. 0 === Jb && (this.oe(0), this.ne(0));
  17952. for (var Xb = [], ka = 0; ka < Jb; ka++) ca = Bh[ka], km(ca, !0), No(ca, !0), Xb[ca.Sb] || (Xb[ca.Sb] = []), Xb[ca.Sb][ca.column] || (Xb[ca.Sb][ca.column] = []), Xb[ca.Sb][ca.column].push(ca);
  17953. D.ya(Bh);
  17954. for (var df = D.mb(), Ne = D.mb(), ef = D.mb(), we = { count: 0 }, xe = { count: 0 }, cd = ji, Od = ki, Dh = this.hd, Jb = Dh.length, ka = 0; ka < Jb; ka++) {
  17955. var Z = Dh[ka];
  17956. void 0 !== Z && (Z.hb = 0)
  17957. }
  17958. Dh = this.cd;
  17959. Jb = Dh.length;
  17960. for (ka =
  17961. 0; ka < Jb; ka++) Z = Dh[ka], void 0 !== Z && (Z.hb = 0);
  17962. for (var nd = Xb.length, ng = 0, ka = 0; ka < nd; ka++) Xb[ka] && (ng = Math.max(ng, Xb[ka].length));
  17963. for (var ni = Math.min(this.xj, nd - 1), Eh = Math.min(this.hj, ng - 1), rc = 0, nd = Xb.length, Fh = Rp(this), ka = 0; ka < nd; ka++)
  17964. if (Xb[ka])
  17965. for (var ng = Xb[ka].length, rb = this.oe(ka), Kb = rb.hb = 0; Kb < ng; Kb++)
  17966. if (Xb[ka][Kb]) {
  17967. var sb = this.ne(Kb);
  17968. void 0 === df[Kb] && (sb.hb = 0, df[Kb] = !0);
  17969. for (var nm = Xb[ka][Kb], ff = nm.length, Kk = 0; Kk < ff; Kk++)
  17970. if (ca = nm[Kk], ca.visible || ca === Fh) {
  17971. var oi = 1 < ca.tj || 1 < ca.Si;
  17972. oi && (ka < ni || Kb < Eh ||
  17973. Ne.push(ca));
  17974. var Cc = ca.margin,
  17975. Of = Cc.right + Cc.left,
  17976. og = Cc.top + Cc.bottom,
  17977. Tb = $o(ca, rb, sb, !1),
  17978. gf = ca.Ea,
  17979. Lk = !isNaN(gf.height),
  17980. om = !isNaN(gf.width) && Lk;
  17981. oi || Tb === Zj || om || ka < ni || Kb < Eh || (void 0 !== we[Kb] || Tb !== Ye && Tb !== yo || (we[Kb] = -1, we.count++), void 0 !== xe[ka] || Tb !== Ye && Tb !== xo || (xe[ka] = -1, xe.count++), ef.push(ca));
  17982. Hk(ca, Infinity, Infinity, 0, 0);
  17983. if (!(ka < ni || Kb < Eh)) {
  17984. var Pf = ca.Fa,
  17985. hf = Math.max(Pf.width + Of, 0),
  17986. jf = Math.max(Pf.height + og, 0);
  17987. if (1 === ca.tj && (Tb === Zj || Tb === yo)) {
  17988. var Z = this.oe(ka),
  17989. sc = Z.hf(),
  17990. rc = Math.max(jf - Z.hb,
  17991. 0);
  17992. rc + sc > Od && (rc = Math.max(Od - sc, 0));
  17993. var pg = 0 === Z.hb;
  17994. Z.hb += rc;
  17995. Od = Math.max(Od - (rc + (pg ? sc : 0)), 0)
  17996. }
  17997. 1 !== ca.Si || Tb !== Zj && Tb !== xo || (Z = this.ne(Kb), sc = Z.hf(), rc = Math.max(hf - Z.hb, 0), rc + sc > cd && (rc = Math.max(cd - sc, 0)), pg = 0 === Z.hb, Z.hb += rc, cd = Math.max(cd - (rc + (pg ? sc : 0)), 0));
  17998. oi && ca.xq()
  17999. }
  18000. }
  18001. }
  18002. D.ya(df);
  18003. for (var Gc = 0, Fb = 0, Jb = this.fq, ka = 0; ka < Jb; ka++) {
  18004. var pi = this.cd[ka];
  18005. void 0 !== pi && (Gc += pi.Ya, 0 !== pi.Ya && (Gc += pi.hf()))
  18006. }
  18007. Jb = this.Tq;
  18008. for (ka = 0; ka < Jb; ka++) {
  18009. var Lg = this.hd[ka];
  18010. void 0 !== Lg && (Fb += Lg.Ya, 0 !== Lg.Ya && (Fb += Lg.hf()))
  18011. }
  18012. for (var cd =
  18013. Math.max(ji - Gc, 0), zj = Od = Math.max(ki - Fb, 0), up = cd, Jb = ef.length, ka = 0; ka < Jb; ka++) {
  18014. var ca = ef[ka],
  18015. rb = this.oe(ca.Sb),
  18016. sb = this.ne(ca.column),
  18017. Mg = ca.Fa,
  18018. Cc = ca.margin,
  18019. Of = Cc.right + Cc.left,
  18020. og = Cc.top + Cc.bottom;
  18021. we[ca.column] = 0 === sb.hb && void 0 !== we[ca.column] ? Math.max(Mg.width + Of, we[ca.column]) : null;
  18022. xe[ca.Sb] = 0 === rb.hb && void 0 !== xe[ca.Sb] ? Math.max(Mg.height + og, xe[ca.Sb]) : null
  18023. }
  18024. var Qf = 0,
  18025. Ng = 0,
  18026. Og;
  18027. for (Og in xe) "count" !== Og && (Qf += xe[Og]);
  18028. for (Og in we) "count" !== Og && (Ng += we[Og]);
  18029. for (var tb = D.Gm(), ka = 0; ka < Jb; ka++)
  18030. if (ca = ef[ka],
  18031. ca.visible || ca === Fh) {
  18032. var rb = this.oe(ca.Sb),
  18033. sb = this.ne(ca.column),
  18034. ac = 0;
  18035. isFinite(sb.width) ? ac = sb.width : (ac = isFinite(cd) && null !== we[ca.column] ? 0 === Ng ? sb.hb + cd : we[ca.column] / Ng * up : null !== we[ca.column] ? cd : sb.hb || cd, ac = Math.max(0, ac - sb.hf()));
  18036. var Hc = 0;
  18037. isFinite(rb.height) ? Hc = rb.height : (Hc = isFinite(Od) && null !== xe[ca.Sb] ? 0 === Qf ? rb.hb + Od : xe[ca.Sb] / Qf * zj : null !== xe[ca.Sb] ? Od : rb.hb || Od, Hc = Math.max(0, Hc - rb.hf()));
  18038. tb.n(Math.max(sb.Th, Math.min(ac, sb.se)), Math.max(rb.Th, Math.min(Hc, rb.se)));
  18039. Tb = $o(ca, rb, sb, !1);
  18040. switch (Tb) {
  18041. case yo:
  18042. tb.height =
  18043. Math.max(tb.height, rb.hb + Od);
  18044. break;
  18045. case xo:
  18046. tb.width = Math.max(tb.width, sb.hb + cd)
  18047. }
  18048. Cc = ca.margin;
  18049. Of = Cc.right + Cc.left;
  18050. og = Cc.top + Cc.bottom;
  18051. ca.xq();
  18052. Hk(ca, tb.width, tb.height, sb.Th, rb.Th);
  18053. Pf = ca.Fa;
  18054. hf = Math.max(Pf.width + Of, 0);
  18055. jf = Math.max(Pf.height + og, 0);
  18056. isFinite(cd) && (hf = Math.min(hf, tb.width));
  18057. isFinite(Od) && (jf = Math.min(jf, tb.height));
  18058. var kf = 0,
  18059. kf = rb.hb;
  18060. rb.hb = Math.max(rb.hb, jf);
  18061. rc = rb.hb - kf;
  18062. Od = Math.max(Od - rc, 0);
  18063. kf = sb.hb;
  18064. sb.hb = Math.max(sb.hb, hf);
  18065. rc = sb.hb - kf;
  18066. cd = Math.max(cd - rc, 0)
  18067. }
  18068. D.ya(ef);
  18069. var Pd = D.Gm(),
  18070. Jb = Ne.length;
  18071. if (0 !== Jb)
  18072. for (var Ad = D.mb(), lf = D.mb(), ka = 0; ka < nd; ka++)
  18073. if (Xb[ka])
  18074. for (ng = Xb[ka].length, rb = this.oe(ka), Ad[ka] = rb.hb, Kb = 0; Kb < ng; Kb++) Xb[ka][Kb] && (sb = this.ne(Kb), lf[Kb] = sb.hb);
  18075. for (ka = 0; ka < Jb; ka++)
  18076. if (ca = Ne[ka], ca.visible || ca === Fh) {
  18077. rb = this.oe(ca.Sb);
  18078. sb = this.ne(ca.column);
  18079. tb.n(Math.max(sb.Th, Math.min(ji, sb.se)), Math.max(rb.Th, Math.min(ki, rb.se)));
  18080. Tb = $o(ca, rb, sb, !1);
  18081. switch (Tb) {
  18082. case Ye:
  18083. 0 !== lf[sb.index] && (tb.width = Math.min(tb.width, lf[sb.index]));
  18084. 0 !== Ad[rb.index] && (tb.height = Math.min(tb.height, Ad[rb.index]));
  18085. break;
  18086. case yo:
  18087. 0 !== lf[sb.index] && (tb.width = Math.min(tb.width, lf[sb.index]));
  18088. break;
  18089. case xo:
  18090. 0 !== Ad[rb.index] && (tb.height = Math.min(tb.height, Ad[rb.index]))
  18091. }
  18092. isFinite(sb.width) && (tb.width = sb.width);
  18093. isFinite(rb.height) && (tb.height = rb.height);
  18094. Pd.n(0, 0);
  18095. for (var eb = 1; eb < ca.tj && !(ca.Sb + eb >= this.Tq); eb++) Z = this.oe(ca.Sb + eb), rc = Tb === Ye || Tb === xo ? Math.max(Z.Th, 0 === Ad[ca.Sb + eb] ? Z.se : Math.min(Ad[ca.Sb + eb], Z.se)) : Math.max(Z.Th, isNaN(Z.uf) ? Z.se : Math.min(Z.uf, Z.se)), Pd.height += rc;
  18096. for (eb = 1; eb < ca.Si && !(ca.column + eb >= this.fq); eb++) Z =
  18097. this.ne(ca.column + eb), rc = Tb === Ye || Tb === yo ? Math.max(Z.Th, 0 === lf[ca.column + eb] ? Z.se : Math.min(lf[ca.column + eb], Z.se)) : Math.max(Z.Th, isNaN(Z.uf) ? Z.se : Math.min(Z.uf, Z.se)), Pd.width += rc;
  18098. tb.width += Pd.width;
  18099. tb.height += Pd.height;
  18100. Cc = ca.margin;
  18101. Of = Cc.right + Cc.left;
  18102. og = Cc.top + Cc.bottom;
  18103. Hk(ca, tb.width, tb.height, xj, yj);
  18104. for (var Pf = ca.Fa, hf = Math.max(Pf.width + Of, 0), jf = Math.max(Pf.height + og, 0), mf = 0, eb = 0; eb < ca.tj && !(ca.Sb + eb >= this.Tq); eb++) Z = this.oe(ca.Sb + eb), mf += Z.total || 0;
  18105. if (mf < jf) {
  18106. var od = jf - mf,
  18107. Pg = jf - mf;
  18108. if (null !== ca.Vy)
  18109. for (var nf =
  18110. ca.Vy, eb = 0; eb < ca.tj && !(0 >= od) && !(ca.Sb + eb >= this.Tq); eb++) {
  18111. var Z = this.oe(ca.Sb + eb),
  18112. Ic = Z.Ya || 0,
  18113. Rf = nf(ca, Z, Pg);
  18114. v && "number" !== typeof Rf && D.k(ca + " spanAllocation does not return a number: " + Rf);
  18115. Z.hb = Math.min(Z.se, Ic + Rf);
  18116. Z.Ya !== Ic && (od -= Z.Ya - Ic)
  18117. }
  18118. for (; 0 < od;) {
  18119. Ic = Z.Ya || 0;
  18120. isNaN(Z.height) && Z.se > Ic && (Z.hb = Math.min(Z.se, Ic + od), Z.Ya !== Ic && (od -= Z.Ya - Ic));
  18121. if (0 === Z.index) break;
  18122. Z = this.oe(Z.index - 1)
  18123. }
  18124. }
  18125. for (var Oe = 0, eb = 0; eb < ca.Si && !(ca.column + eb >= this.fq); eb++) Z = this.ne(ca.column + eb), Oe += Z.total || 0;
  18126. if (Oe < hf) {
  18127. od = hf - Oe;
  18128. Pg = hf - Oe;
  18129. if (null !== ca.Vy)
  18130. for (nf = ca.Vy, eb = 0; eb < ca.Si && !(0 >= od) && !(ca.column + eb >= this.fq); eb++) Z = this.ne(ca.column + eb), Ic = Z.Ya || 0, Rf = nf(ca, Z, Pg), v && "number" !== typeof Rf && D.k(ca + " spanAllocation does not return a number: " + Rf), Z.hb = Math.min(Z.se, Ic + Rf), Z.Ya !== Ic && (od -= Z.Ya - Ic);
  18131. for (; 0 < od;) {
  18132. Ic = Z.Ya || 0;
  18133. isNaN(Z.width) && Z.se > Ic && (Z.hb = Math.min(Z.se, Ic + od), Z.Ya !== Ic && (od -= Z.Ya - Ic));
  18134. if (0 === Z.index) break;
  18135. Z = this.ne(Z.index - 1)
  18136. }
  18137. }
  18138. }
  18139. D.ya(Ne);
  18140. D.Zk(Pd);
  18141. D.Zk(tb);
  18142. void 0 !== Ad && D.ya(Ad);
  18143. void 0 !== lf && D.ya(lf);
  18144. for (var Qg =
  18145. 0, Rg = 0, Tb = Mo(this, !0), Aj = this.Ea, Mk = this.pf, ye = Fb = Gc = 0, dd = 0, Jb = this.fq, ka = 0; ka < Jb; ka++) void 0 !== this.cd[ka] && (Z = this.ne(ka), isFinite(Z.width) ? (ye += Z.width, ye += Z.hf()) : Up(Z) === Vp ? (ye += Z.Ya, ye += Z.hf()) : 0 !== Z.Ya && (Gc += Z.Ya, Gc += Z.hf()));
  18146. var Qg = isFinite(Aj.width) ? Math.min(Aj.width, Mk.width) : Tb !== Zj && isFinite(ji) ? ji : Gc,
  18147. Qg = Math.max(Qg, this.ah.width),
  18148. Qg = Math.max(Qg - ye, 0),
  18149. Nk = Math.max(Qg / Gc, 1);
  18150. isFinite(Nk) || (Nk = 1);
  18151. for (ka = 0; ka < Jb; ka++) void 0 !== this.cd[ka] && (Z = this.ne(ka), isFinite(Z.width) || Up(Z) === Vp || (Z.hb =
  18152. Z.Ya * Nk), Z.position = e.width, 0 !== Z.Ya && (e.width += Z.Ya, e.width += Z.hf()));
  18153. Jb = this.Tq;
  18154. for (ka = 0; ka < Jb; ka++) void 0 !== this.hd[ka] && (Z = this.oe(ka), isFinite(Z.height) ? (dd += Z.height, dd += Z.hf()) : Up(Z) === Vp ? (dd += Z.Ya, dd += Z.hf()) : 0 !== Z.Ya && (Fb += Z.Ya, 0 !== Z.Ya && (Fb += Z.hf())));
  18155. var Rg = isFinite(Aj.height) ? Math.min(Aj.height, Mk.height) : Tb !== Zj && isFinite(ki) ? ki : Fb,
  18156. Rg = Math.max(Rg, this.ah.height),
  18157. Rg = Math.max(Rg - dd, 0),
  18158. Gh = Math.max(Rg / Fb, 1);
  18159. isFinite(Gh) || (Gh = 1);
  18160. for (ka = 0; ka < Jb; ka++) void 0 !== this.hd[ka] && (Z = this.oe(ka), isFinite(Z.height) ||
  18161. Up(Z) === Vp || (Z.hb = Z.Ya * Gh), Z.position = e.height, 0 !== Z.Ya && (e.height += Z.Ya, 0 !== Z.Ya && (e.height += Z.hf())));
  18162. Jb = Ch.length;
  18163. for (ka = 0; ka < Jb; ka++) {
  18164. var pd = Ch[ka];
  18165. pd.type === Ro ? (ac = e.width, Z = this.oe(pd.Sb), Hc = Z.hb) : (Z = this.ne(pd.column), ac = Z.hb, Hc = e.height);
  18166. pd.Fd.n(0, 0, ac, Hc);
  18167. km(pd, !1);
  18168. Xb[pd.Sb] || (Xb[pd.Sb] = []);
  18169. Xb[pd.Sb][pd.column] || (Xb[pd.Sb][pd.column] = []);
  18170. Xb[pd.Sb][pd.column].push(pd)
  18171. }
  18172. D.ya(Ch);
  18173. this.wt = Xb;
  18174. break;
  18175. case "Viewbox":
  18176. var Bj = a,
  18177. qm = b,
  18178. rt = c,
  18179. st = d;
  18180. 1 < m.length && D.k("Viewbox Panel cannot contain more than one GraphObject.");
  18181. var of = m[0];
  18182. of.Db = 1;
  18183. of.xq();
  18184. Hk(of, Infinity, Infinity, rt, st);
  18185. var Ok = of.Fa,
  18186. rm = of.margin,
  18187. tt = rm.right + rm.left,
  18188. ut = rm.top + rm.bottom;
  18189. if (isFinite(Bj) || isFinite(qm)) {
  18190. var jw = of.scale,
  18191. sm = Ok.width,
  18192. tm = Ok.height,
  18193. vt = Math.max(Bj - tt, 0),
  18194. wt = Math.max(qm - ut, 0),
  18195. Pk = 1;
  18196. this.Wp === bk ? 0 !== sm && 0 !== tm && (Pk = Math.min(vt / sm, wt / tm)) : 0 !== sm && 0 !== tm && (Pk = Math.max(vt / sm, wt / tm));
  18197. 0 === Pk && (Pk = 1E-4);
  18198. of.Db *= Pk;
  18199. jw !== of.scale && (km(of, !0), Hk(of, Infinity, Infinity, rt, st))
  18200. }
  18201. Ok = of.Fa;
  18202. e.width = isFinite(Bj) ? Bj : Math.max(Ok.width + tt, 0);
  18203. e.height = isFinite(qm) ?
  18204. qm : Math.max(Ok.height + ut, 0);
  18205. break;
  18206. case "Link":
  18207. var xt = m.length;
  18208. if (this instanceof da || this instanceof J) {
  18209. var ri = null;
  18210. this instanceof J && (ri = this);
  18211. this instanceof da && (ri = this.If);
  18212. if (ri instanceof J) {
  18213. var Qk = ri;
  18214. if (0 === xt) {
  18215. var um = this.Ga;
  18216. Cb(um, 0, 0);
  18217. var ze = this.Fa;
  18218. ze.n(0, 0, 0, 0)
  18219. } else {
  18220. var vm = this instanceof da ? null : ri.path,
  18221. Sg = ri.so,
  18222. pf = this.yj;
  18223. pf.assign(Sg);
  18224. pf.x = 0;
  18225. pf.y = 0;
  18226. var Hh = Qk.points,
  18227. si = ri.ta;
  18228. this.Wu(!1);
  18229. var yt = Sg.width,
  18230. zt = Sg.height;
  18231. this.jj.n(Sg.x, Sg.y);
  18232. null === this.oh && (this.oh = new K(C));
  18233. this.oh.clear();
  18234. null !== vm && (Wp(vm, yt, zt, this), ze = vm.Fa, pf.Zh(ze), this.oh.add(ze));
  18235. for (var Tg = D.hh(), Rk = D.P(), Ug = D.P(), vp = 0; vp < xt; vp++) {
  18236. var Yb = m[vp];
  18237. if (Yb !== vm)
  18238. if (Yb.Ue && Yb instanceof z) Wp(Yb, yt, zt, this), ze = Yb.Fa, pf.Zh(ze), this.oh.add(ze);
  18239. else if (2 > si) Hk(Yb, Infinity, Infinity), ze = Yb.Fa, pf.Zh(ze), this.oh.add(ze);
  18240. else {
  18241. var Bd = Yb.We,
  18242. Bt = Yb.WB,
  18243. wp = Yb.Gh;
  18244. wp.de() && (wp = mc);
  18245. var qg = Yb.Uq,
  18246. kw = Yb.XB,
  18247. Sk = 0,
  18248. Tk = 0,
  18249. wm = 0;
  18250. if (Bd < -si || Bd >= si) {
  18251. var Ct = Qk.xG,
  18252. Sf = Qk.wG;
  18253. qg !== vj && (wm = Qk.computeAngle(Yb, qg, Sf), Yb.wg = wm);
  18254. Sk = Ct.x - Sg.x;
  18255. Tk = Ct.y - Sg.y
  18256. } else {
  18257. var Qd,
  18258. qf;
  18259. if (0 <= Bd) Qd = Hh.fa(Bd), qf = Bd < si - 1 ? Hh.fa(Bd + 1) : Qd;
  18260. else {
  18261. var ti = si + Bd;
  18262. Qd = Hh.fa(ti);
  18263. qf = 0 < ti ? Hh.fa(ti - 1) : Qd
  18264. }
  18265. if (Qd.Wc(qf)) {
  18266. var ui, vi;
  18267. 0 <= Bd ? (ui = 0 < Bd ? Hh.fa(Bd - 1) : Qd, vi = Bd < si - 2 ? Hh.fa(Bd + 2) : qf) : (ui = ti < si - 1 ? Hh.fa(ti + 1) : Qd, vi = 1 < ti ? Hh.fa(ti - 2) : qf);
  18268. var Dt = ui.Kf(Qd),
  18269. Et = qf.Kf(vi),
  18270. Sf = Dt > Et + 10 ? 0 <= Bd ? ui.Wb(Qd) : Qd.Wb(ui) : Et > Dt + 10 ? 0 <= Bd ? qf.Wb(vi) : vi.Wb(qf) : 0 <= Bd ? ui.Wb(vi) : vi.Wb(ui)
  18271. } else Sf = 0 <= Bd ? Qd.Wb(qf) : qf.Wb(Qd);
  18272. qg !== vj && (wm = Qk.computeAngle(Yb, qg, Sf), Yb.wg = wm);
  18273. Sk = Qd.x + (qf.x - Qd.x) * Bt - Sg.x;
  18274. Tk = Qd.y + (qf.y - Qd.y) * Bt - Sg.y
  18275. }
  18276. Hk(Yb,
  18277. Infinity, Infinity);
  18278. var ze = Yb.Fa,
  18279. um = Yb.Ga,
  18280. Uk = 0;
  18281. Yb instanceof z && (Uk = Yb.lb);
  18282. var wi = um.width + Uk,
  18283. Cj = um.height + Uk;
  18284. Tg.reset();
  18285. Tg.translate(-ze.x, -ze.y);
  18286. Tg.scale(Yb.scale, Yb.scale);
  18287. Tg.rotate(qg === vj ? Yb.angle : Sf, wi / 2, Cj / 2);
  18288. qg !== Xp && qg !== Yp || Tg.rotate(90, wi / 2, Cj / 2);
  18289. qg !== Zp && qg !== $p || Tg.rotate(-90, wi / 2, Cj / 2);
  18290. qg === aq && (45 < Sf && 135 > Sf || 225 < Sf && 315 > Sf) && Tg.rotate(-Sf, wi / 2, Cj / 2);
  18291. var Dj = new C(0, 0, wi, Cj);
  18292. Rk.uo(Dj, wp);
  18293. Tg.vb(Rk);
  18294. var lw = -Rk.x + Uk / 2 * Yb.scale,
  18295. mw = -Rk.y + Uk / 2 * Yb.scale;
  18296. Ug.assign(kw);
  18297. isNaN(Ug.x) && (Ug.x = 0 <= Bd ?
  18298. wi / 2 + 3 : -(wi / 2 + 3));
  18299. isNaN(Ug.y) && (Ug.y = -(Cj / 2 + 3));
  18300. Ug.rotate(Sf);
  18301. Sk += Ug.x;
  18302. Tk += Ug.y;
  18303. Dj.set(ze);
  18304. Dj.x = Sk + lw;
  18305. Dj.y = Tk + mw;
  18306. this.oh.add(Dj);
  18307. pf.Zh(Dj)
  18308. }
  18309. }
  18310. if (this instanceof J)
  18311. for (var Ft = this.Af; Ft.next();) Hk(Ft.value, Infinity, Infinity);
  18312. this.yj = pf;
  18313. var xp = this.jj;
  18314. xp.n(xp.x + pf.x, xp.y + pf.y);
  18315. Cb(e, pf.width || 0, pf.height || 0);
  18316. D.lf(Tg);
  18317. D.A(Rk);
  18318. D.A(Ug)
  18319. }
  18320. }
  18321. }
  18322. break;
  18323. case "Grid":
  18324. break;
  18325. case "Graduated":
  18326. var nw = a,
  18327. ow = b,
  18328. pw = c,
  18329. qw = d,
  18330. Vg = this.Ld();
  18331. this.Tm = [];
  18332. var Ej = Vg.margin,
  18333. rw = Ej.right + Ej.left,
  18334. sw = Ej.top + Ej.bottom;
  18335. Hk(Vg, nw, ow, pw, qw);
  18336. var Gt =
  18337. Vg.Fa,
  18338. tw = Gt.height,
  18339. uw = Math.max(Gt.width + rw, 0),
  18340. vw = Math.max(tw + sw, 0),
  18341. Ht = new C(-Ej.left, -Ej.top, uw, vw);
  18342. this.Tm.push(Ht);
  18343. e.assign(Ht);
  18344. for (var Zk = Vg.vf, It = Vg.lb, yp = Zk.Zx, Fj = Zk.uu, xi = Zk.vu, ww = yp.length, zp = 0, Ap = 0, Gj = D.mb(), Bp = 0; Bp < ww; Bp++) {
  18345. for (var Cp = yp[Bp], Jt = [], Ap = zp = 0, xw = Cp.length, Hj = 0; Hj < xw; Hj += 2) {
  18346. var Kt = Cp[Hj],
  18347. Lt = Cp[Hj + 1];
  18348. if (0 !== Hj) {
  18349. var Cd = 180 * Math.atan2(Lt - Ap, Kt - zp) / Math.PI;
  18350. 0 > Cd && (Cd += 360);
  18351. Jt.push(Cd)
  18352. }
  18353. zp = Kt;
  18354. Ap = Lt
  18355. }
  18356. Gj.push(Jt)
  18357. }
  18358. var Mt;
  18359. if (null === this.pk) {
  18360. for (var Nt = [], Dp = this.xa.o, Ot = Dp.length, Ep = 0; Ep <
  18361. Ot; Ep++) {
  18362. var $k = Dp[Ep],
  18363. Pt = [];
  18364. Nt.push(Pt);
  18365. if ($k.visible)
  18366. for (var yw = $k.interval, Fp = 0; Fp < Ot; Fp++) {
  18367. var al = Dp[Fp];
  18368. if (al.visible && $k !== al && !($k instanceof z && !(al instanceof z) || $k instanceof pa && !(al instanceof pa))) {
  18369. var Qt = al.interval;
  18370. Qt > yw && Pt.push(Qt)
  18371. }
  18372. }
  18373. }
  18374. this.pk = Nt
  18375. }
  18376. Mt = this.pk;
  18377. var Rt = this.xa.o,
  18378. zw = Rt.length,
  18379. Ih = 0,
  18380. St = 0,
  18381. Tt = xi;
  18382. this.Vm = [];
  18383. for (var ym = [], zm = 0; zm < zw; zm++) {
  18384. var Jh = Rt[zm],
  18385. ym = [];
  18386. if (Jh.visible && Jh !== Vg) {
  18387. var Ut = Jh.interval,
  18388. Vt = this.hB;
  18389. if (!(2 > Vt * Ut * xi / this.Du)) {
  18390. var ee = this.VF,
  18391. Wt = Mt[zm],
  18392. yi = Fj[0][0],
  18393. Tf =
  18394. 0,
  18395. Dd = 0,
  18396. St = xi * Jh.UF - 1E-4,
  18397. Tt = xi * Jh.SF + 1E-4,
  18398. Ij = Vt * Ut;
  18399. if (ee < this.al) var zi = (this.al - ee) / Ij,
  18400. zi = 0 === zi % 1 ? zi : Math.floor(zi + 1),
  18401. ee = ee + zi * Ij;
  18402. else ee > this.al + Ij && (zi = Math.floor((ee - this.al) / Ij), ee -= zi * Ij);
  18403. for (; ee <= this.gB;) {
  18404. var Gp;
  18405. a: {
  18406. for (var Aw = Wt.length, Hp = 0; Hp < Aw; Hp++)
  18407. if (Eb((ee - this.VF) % (Wt[Hp] * this.hB), 0)) { Gp = !1; break a }
  18408. Gp = !0
  18409. }
  18410. if (Gp && (Ih = (ee - this.al) * xi / this.Du, Ih > xi && (Ih = xi), St <= Ih && Ih <= Tt)) {
  18411. for (var Cd = Gj[Tf][Dd], Jj = Fj[Tf][Dd]; Tf < Fj.length;) {
  18412. for (; Ih > yi && Dd < Fj[Tf].length - 1;) Dd++, Cd = Gj[Tf][Dd], Jj = Fj[Tf][Dd],
  18413. yi += Jj;
  18414. if (Ih <= yi) break;
  18415. Tf++;
  18416. Dd = 0;
  18417. Cd = Gj[Tf][Dd];
  18418. Jj = Fj[Tf][Dd];
  18419. yi += Jj
  18420. }
  18421. var Rd = yp[Tf],
  18422. Xt = Rd[2 * Dd],
  18423. Yt = Rd[2 * Dd + 1],
  18424. Am = (Ih - (yi - Jj)) / Jj,
  18425. Ip = new N(Xt + (Rd[2 * Dd + 2] - Xt) * Am + It / 2 - Zk.pb.x, Yt + (Rd[2 * Dd + 3] - Yt) * Am + It / 2 - Zk.pb.y);
  18426. Ip.scale(Vg.scale, Vg.scale);
  18427. var rg = Cd,
  18428. Kj = Gj[Tf];
  18429. 1E-4 > Am ? 0 < Dd ? rg = Kj[Dd - 1] : Eb(Rd[0], Rd[Rd.length - 2]) && Eb(Rd[1], Rd[Rd.length - 1]) && (rg = Kj[Kj.length - 1]) : .9999 < Am && (Dd + 1 < Kj.length ? rg = Kj[Dd + 1] : Eb(Rd[0], Rd[Rd.length - 2]) && Eb(Rd[1], Rd[Rd.length - 1]) && (rg = Kj[0]));
  18430. Cd !== rg && (180 < Math.abs(Cd - rg) && (Cd < rg ? Cd +=
  18431. 360 : rg += 360), Cd = (Cd + rg) / 2 % 360);
  18432. if (Jh instanceof pa) {
  18433. var Bm = "",
  18434. Bm = null !== Jh.TF ? Jh.TF(ee) : (+ee.toFixed(2)).toString();
  18435. v && D.h(Bm, "string");
  18436. "" !== Bm && ym.push([Ip, Cd, Bm])
  18437. } else ym.push([Ip, Cd])
  18438. }
  18439. ee += Ij
  18440. }
  18441. }
  18442. }
  18443. this.Vm.push(ym)
  18444. }
  18445. D.ya(Gj);
  18446. for (var Bw = this.Vm, Cw = m.length, Cm = 0; Cm < Cw; Cm++) {
  18447. var Ai = m[Cm],
  18448. Jp = Bw[Cm];
  18449. if (Ai.visible && Ai !== Vg && 0 !== Jp.length) {
  18450. if (Ai instanceof z) {
  18451. var Kh = Ai,
  18452. Zt = Jp,
  18453. Dw = e,
  18454. Kp = Kh.Gh;
  18455. Kp.de() && (Kp = jc);
  18456. var Ew = Kh.angle;
  18457. Kh.wg = 0;
  18458. Hk(Kh, Infinity, Infinity);
  18459. Kh.wg = Ew;
  18460. var $t = Kh.Fa,
  18461. Lp = $t.width,
  18462. Mp = $t.height,
  18463. au = D.vg(0,
  18464. 0, Lp, Mp),
  18465. fe = D.P();
  18466. fe.uo(au, Kp);
  18467. D.Lb(au);
  18468. for (var Dm = -fe.x, Em = -fe.y, Bi = new C, Fw = Zt.length, Fm = 0; Fm < Fw; Fm++)
  18469. for (var Np = Zt[Fm], bu = Np[0].x, cu = Np[0].y, du = Np[1], Gm = 0; 4 > Gm; Gm++) {
  18470. switch (Gm) {
  18471. case 0:
  18472. fe.n(Dm, Em);
  18473. break;
  18474. case 1:
  18475. fe.n(Dm + Lp, Em);
  18476. break;
  18477. case 2:
  18478. fe.n(Dm, Em + Mp);
  18479. break;
  18480. case 3:
  18481. fe.n(Dm + Lp, Em + Mp)
  18482. }
  18483. fe.rotate(du + Kh.angle);
  18484. fe.offset(bu, cu);
  18485. 0 === Fm && 0 === Gm ? Bi.n(fe.x, fe.y, 0, 0) : Bi.Mi(fe);
  18486. fe.offset(-bu, -cu);
  18487. fe.rotate(-du - Kh.angle)
  18488. }
  18489. D.A(fe);
  18490. this.Tm.push(Bi);
  18491. Ub(Dw, Bi.x, Bi.y, Bi.width, Bi.height)
  18492. } else if (Ai instanceof pa) {
  18493. var Hm =
  18494. Ai,
  18495. eu = Jp,
  18496. Gw = e;
  18497. null === this.Ik && (this.Ik = new pa);
  18498. var Uf = this.Ik;
  18499. rp(Hm, Uf);
  18500. var Op = Hm.Gh;
  18501. Op.de() && (Op = jc);
  18502. for (var Lh = Hm.Uq, Hw = Hm.XB, Ci = null, Im = 0, Jm = 0, Wg = 0, Pp = 0, Iw = eu.length, Km = 0; Km < Iw; Km++) {
  18503. var sg = eu[Km],
  18504. Im = sg[0].x,
  18505. Jm = sg[0].y,
  18506. Wg = sg[1];
  18507. Lh !== vj && (Pp = J.computeAngle(Lh, Wg), Uf.wg = Pp);
  18508. Uf.text = sg[2];
  18509. Hk(Uf, Infinity, Infinity);
  18510. var Mh = Uf.Fa,
  18511. Lj = Uf.Ga,
  18512. Mj = Lj.width,
  18513. Nj = Lj.height,
  18514. Xg = D.hh();
  18515. Xg.reset();
  18516. Xg.translate(-Mh.x, -Mh.y);
  18517. Xg.scale(Uf.scale, Uf.scale);
  18518. Xg.rotate(Lh === vj ? Uf.angle : Wg, Mj / 2, Nj / 2);
  18519. Lh !== Xp && Lh !== Yp || Xg.rotate(90,
  18520. Mj / 2, Nj / 2);
  18521. Lh !== Zp && Lh !== $p || Xg.rotate(-90, Mj / 2, Nj / 2);
  18522. Lh === aq && (45 < Wg && 135 > Wg || 225 < Wg && 315 > Wg) && Xg.rotate(-Wg, Mj / 2, Nj / 2);
  18523. var fu = D.vg(0, 0, Mj, Nj),
  18524. bl = D.P();
  18525. bl.uo(fu, Op);
  18526. Xg.vb(bl);
  18527. var Jw = -bl.x,
  18528. Kw = -bl.y,
  18529. Yg = D.P();
  18530. Yg.assign(Hw);
  18531. isNaN(Yg.x) && (Yg.x = Mj / 2 + 3);
  18532. isNaN(Yg.y) && (Yg.y = -(Nj / 2 + 3));
  18533. Yg.rotate(Wg);
  18534. var Im = Im + (Yg.x + Jw),
  18535. Jm = Jm + (Yg.y + Kw),
  18536. Qp = new C(Im, Jm, Mh.width, Mh.height),
  18537. Lw = new C(Mh.x, Mh.y, Mh.width, Mh.height),
  18538. Mw = new C(Lj.x, Lj.y, Lj.width, Lj.height),
  18539. gu = new bq;
  18540. gu.gq(Uf.sf);
  18541. sg.push(Pp);
  18542. sg.push(Uf.xe);
  18543. sg.push(gu);
  18544. sg.push(Qp);
  18545. sg.push(Lw);
  18546. sg.push(Mw);
  18547. 0 === Km ? Ci = Qp.copy() : Ci.Zh(Qp);
  18548. D.A(Yg);
  18549. D.A(bl);
  18550. D.Lb(fu);
  18551. D.lf(Xg)
  18552. }
  18553. this.Tm.push(Ci);
  18554. Ub(Gw, Ci.x, Ci.y, Ci.width, Ci.height)
  18555. }
  18556. km(Ai, !1)
  18557. }
  18558. }
  18559. break;
  18560. case "TableRow":
  18561. case "TableColumn":
  18562. D.k(this.toString() + " is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");
  18563. break;
  18564. default:
  18565. D.k("Unknown panel type: " + n)
  18566. }
  18567. }
  18568. var rf = e.width,
  18569. sf = e.height,
  18570. Lm = this.padding,
  18571. Nw = Lm.top + Lm.bottom,
  18572. rf = rf + (Lm.left + Lm.right),
  18573. sf = sf + Nw;
  18574. isFinite(g.width) && (rf =
  18575. g.width);
  18576. isFinite(g.height) && (sf = g.height);
  18577. rf = Math.min(k.width, rf);
  18578. sf = Math.min(k.height, sf);
  18579. rf = Math.max(h.width, rf);
  18580. sf = Math.max(h.height, sf);
  18581. rf = Math.max(c, rf);
  18582. sf = Math.max(d, sf);
  18583. e.width = rf;
  18584. e.height = sf;
  18585. Cb(this.fd, rf, sf);
  18586. Jo(this, 0, 0, rf, sf)
  18587. };
  18588. x.prototype.findMainElement = x.prototype.Ld = function() {
  18589. if (null === this.Xl) {
  18590. var a = this.xa.o,
  18591. b = a.length;
  18592. if (0 === b) return null;
  18593. for (var c = 0; c < b; c++) { var d = a[c]; if (!0 === d.Ue) return this.Xl = d }
  18594. this.Xl = a[0]
  18595. }
  18596. return this.Xl
  18597. };
  18598. function Rp(a) { return null !== a.Y ? a.Y.Bf : null }
  18599. x.prototype.Cj = function(a, b, c, d) {
  18600. var e = this.yj,
  18601. g = this.xa.o,
  18602. h = D.vg(0, 0, 0, 0);
  18603. if (0 === g.length) {
  18604. var k = this.aa;
  18605. k.x = a;
  18606. k.y = b;
  18607. k.width = c;
  18608. k.height = d
  18609. } else {
  18610. if (!this.Ea.H()) {
  18611. var l = Mo(this, !0),
  18612. m = this.Fd,
  18613. n = m.width,
  18614. p = m.height,
  18615. q = this.margin,
  18616. r = q.left + q.right,
  18617. s = q.top + q.bottom;
  18618. n === c && p === d && (l = Zj);
  18619. switch (l) {
  18620. case Zj:
  18621. if (n > c || p > d) this.K(), Hk(this, n > c ? c : n, p > d ? d : p);
  18622. break;
  18623. case Ye:
  18624. this.K(!0);
  18625. Hk(this, c + r, d + s, 0, 0);
  18626. break;
  18627. case yo:
  18628. this.K(!0);
  18629. Hk(this, c + r, p + s, 0, 0);
  18630. break;
  18631. case xo:
  18632. this.K(!0), Hk(this, n + r, d + s, 0, 0)
  18633. }
  18634. }
  18635. k = this.aa;
  18636. k.x = a;
  18637. k.y =
  18638. b;
  18639. k.width = c;
  18640. k.height = d;
  18641. var u = this.da.$b;
  18642. switch (u) {
  18643. case "Position":
  18644. for (var t = g.length, y = e.x - this.padding.left, w = e.y - this.padding.top, A = 0; A < t; A++) {
  18645. var B = g[A],
  18646. P = B.Fa,
  18647. H = B.margin,
  18648. R = B.position.x,
  18649. aa = B.position.y;
  18650. h.x = isNaN(R) ? -y : R - y;
  18651. h.y = isNaN(aa) ? -w : aa - w;
  18652. if (B instanceof z) {
  18653. var V = B;
  18654. if (V.hG) {
  18655. var ea = V.lb / 2;
  18656. h.x -= ea;
  18657. h.y -= ea
  18658. }
  18659. }
  18660. h.x += H.left;
  18661. h.y += H.top;
  18662. h.width = P.width;
  18663. h.height = P.height;
  18664. B.visible && B.rc(h.x, h.y, h.width, h.height)
  18665. }
  18666. break;
  18667. case "Vertical":
  18668. for (var la = g.length, Da = this.padding.left, La = this.lG, gb = La ? e.height :
  18669. this.padding.top, Aa = 0; Aa < la; Aa++) {
  18670. var W = Da,
  18671. xb = g[Aa];
  18672. if (xb.visible) {
  18673. var Pb = xb.Fa,
  18674. Sa = xb.margin,
  18675. Qc = Sa.left + Sa.right,
  18676. Ra = Da + this.padding.right,
  18677. jg = Pb.width,
  18678. kg = Mo(xb, !1);
  18679. if (isNaN(xb.Ea.width) && kg === Ye || kg === yo) jg = Math.max(e.width - Qc - Ra, 0);
  18680. var vd = jg + Qc + Ra,
  18681. wd = xb.alignment;
  18682. wd.ld() && (wd = this.om);
  18683. wd.Xc() || (wd = mc);
  18684. La && (gb -= Pb.height + Sa.bottom + Sa.top);
  18685. xb.rc(W + wd.offsetX + Sa.left + (e.width * wd.x - vd * wd.x), gb + wd.offsetY + Sa.top, jg, Pb.height);
  18686. La || (gb += Pb.height + Sa.bottom + Sa.top)
  18687. }
  18688. }
  18689. break;
  18690. case "Horizontal":
  18691. for (var Rc = g.length,
  18692. uh = this.padding.top, $e = this.lG, hb = $e ? e.width : this.padding.left, ub = 0; ub < Rc; ub++) {
  18693. var sa = uh,
  18694. na = g[ub];
  18695. if (na.visible) {
  18696. var ab = na.Fa,
  18697. Oa = na.margin,
  18698. pb = Oa.top + Oa.bottom,
  18699. Md = uh + this.padding.bottom,
  18700. Jf = ab.height,
  18701. se = Mo(na, !1);
  18702. if (isNaN(na.Ea.height) && se === Ye || se === xo) Jf = Math.max(e.height - pb - Md, 0);
  18703. var be = Jf + pb + Md,
  18704. jd = na.alignment;
  18705. jd.ld() && (jd = this.om);
  18706. jd.Xc() || (jd = mc);
  18707. $e && (hb -= ab.width + Oa.left + Oa.right);
  18708. na.rc(hb + jd.offsetX + Oa.left, sa + jd.offsetY + Oa.top + (e.height * jd.y - be * jd.y), ab.width, Jf);
  18709. $e || (hb += ab.width + Oa.left +
  18710. Oa.right)
  18711. }
  18712. }
  18713. break;
  18714. case "Spot":
  18715. var vh = g.length,
  18716. Kf = this.Ld(),
  18717. Ig = Kf.Fa,
  18718. Hb = Ig.width,
  18719. oc = Ig.height,
  18720. xd = this.padding,
  18721. wh = xd.left,
  18722. qb = xd.top;
  18723. h.x = wh - e.x;
  18724. h.y = qb - e.y;
  18725. Kf.rc(h.x, h.y, Hb, oc);
  18726. for (var Pa = 0; Pa < vh; Pa++) {
  18727. var Qb = g[Pa];
  18728. if (Qb !== Kf) {
  18729. var Lf = Qb.Fa,
  18730. Jg = Lf.width,
  18731. xh = Lf.height,
  18732. ib = Qb.alignment;
  18733. ib.ld() && (ib = this.om);
  18734. ib.Xc() || (ib = mc);
  18735. var zc = Qb.Gh;
  18736. zc.ld() && (zc = mc);
  18737. var $b = null;
  18738. Qb instanceof x && "" !== Qb.dk && ($b = Qb.Md(Qb.dk), $b === Qb && ($b = null));
  18739. if (null !== $b) {
  18740. for (var te = $b.Ga, Ac = D.Fb(zc.x * te.width + zc.offsetX, zc.y * te.height +
  18741. zc.offsetY); $b !== Qb;) $b.transform.vb(Ac), $b = $b.R;
  18742. h.x = ib.x * Hb + ib.offsetX - Ac.x;
  18743. h.y = ib.y * oc + ib.offsetY - Ac.y;
  18744. D.A(Ac)
  18745. } else h.x = ib.x * Hb + ib.offsetX - (zc.x * Jg - zc.offsetX), h.y = ib.y * oc + ib.offsetY - (zc.y * xh - zc.offsetY);
  18746. h.x -= e.x;
  18747. h.y -= e.y;
  18748. Qb.visible && Qb.rc(wh + h.x, qb + h.y, Jg, xh)
  18749. }
  18750. }
  18751. break;
  18752. case "Auto":
  18753. var Bc = g.length,
  18754. vb = this.Ld(),
  18755. pc = vb.Fa,
  18756. yb = D.Sf();
  18757. yb.n(0, 0, 1, 1);
  18758. var Fc = vb.margin,
  18759. db = Fc.left,
  18760. Ta = Fc.top,
  18761. Mb = this.padding,
  18762. yd = Mb.left,
  18763. lg = Mb.top;
  18764. h.x = db;
  18765. h.y = Ta;
  18766. h.width = pc.width;
  18767. h.height = pc.height;
  18768. vb.rc(yd + h.x, lg + h.y, h.width, h.height);
  18769. var af = Sp(vb),
  18770. bf = Tp(vb),
  18771. wj = 0 + af.y * pc.height + af.offsetY,
  18772. Rb = 0 + bf.x * pc.width + bf.offsetX,
  18773. qc = 0 + bf.y * pc.height + bf.offsetY;
  18774. yb.x = 0 + af.x * pc.width + af.offsetX;
  18775. yb.y = wj;
  18776. Ub(yb, Rb, qc, 0, 0);
  18777. yb.x += db + yd;
  18778. yb.y += Ta + lg;
  18779. for (var fc = 0; fc < Bc; fc++) {
  18780. var kd = g[fc];
  18781. if (kd !== vb) {
  18782. var mb = kd.Fa,
  18783. Fc = kd.margin,
  18784. Sb = Math.max(mb.width + Fc.right + Fc.left, 0),
  18785. ue = Math.max(mb.height + Fc.top + Fc.bottom, 0),
  18786. zb = kd.alignment;
  18787. zb.ld() && (zb = this.om);
  18788. zb.Xc() || (zb = mc);
  18789. h.x = yb.width * zb.x + zb.offsetX - Sb * zb.x + Fc.left + yb.x;
  18790. h.y = yb.height * zb.y + zb.offsetY - ue * zb.y + Fc.top +
  18791. yb.y;
  18792. h.width = yb.width;
  18793. h.height = yb.height;
  18794. kd.visible && (Vb(yb.x, yb.y, yb.width, yb.height, h.x, h.y, mb.width, mb.height) ? kd.rc(h.x, h.y, mb.width, mb.height) : kd.rc(h.x, h.y, mb.width, mb.height, new C(yb.x, yb.y, yb.width, yb.height)))
  18795. }
  18796. }
  18797. D.Lb(yb);
  18798. break;
  18799. case "Table":
  18800. for (var ce = g.length, yh = this.padding, zh = yh.left, Kg = yh.top, ld = this.wt, Nd = 0, gc = 0, Ab = ld.length, zd = 0, nb = 0; nb < Ab; nb++) ld[nb] && (zd = Math.max(zd, ld[nb].length));
  18801. for (var hc = Math.min(this.xj, Ab - 1); hc !== Ab && (void 0 === this.hd[hc] || 0 === this.hd[hc].Ya);) hc++;
  18802. for (var hc =
  18803. Math.min(hc, Ab - 1), ii = -this.hd[hc].sb, ad = Math.min(this.hj, zd - 1); ad !== zd && (void 0 === this.cd[ad] || 0 === this.cd[ad].Ya);) ad++;
  18804. for (var ad = Math.min(ad, zd - 1), Ib = -this.cd[ad].sb, ve = D.Gm(), nb = 0; nb < Ab; nb++)
  18805. if (ld[nb]) {
  18806. var zd = ld[nb].length,
  18807. cf = this.oe(nb),
  18808. gc = cf.sb + ii + Kg;
  18809. 0 !== cf.Ya && (gc += cf.jF());
  18810. for (var bd = 0; bd < zd; bd++)
  18811. if (ld[nb][bd]) {
  18812. var Mf = this.ne(bd),
  18813. Nd = Mf.sb + Ib + zh;
  18814. 0 !== Mf.Ya && (Nd += Mf.jF());
  18815. for (var Nf = ld[nb][bd], Ah = Nf.length, Jk = 0; Jk < Ah; Jk++) {
  18816. var Bb = Nf[Jk],
  18817. de = Bb.Fa,
  18818. md = Bb instanceof x ? Bb : null;
  18819. if (null === md || md.type !==
  18820. Ro && md.type !== So) {
  18821. ve.n(0, 0);
  18822. for (var Me = 1; Me < Bb.rowSpan && !(nb + Me >= this.Tq); Me++) {
  18823. var ji = this.oe(nb + Me);
  18824. ve.height += ji.total
  18825. }
  18826. for (Me = 1; Me < Bb.kI && !(bd + Me >= this.fq); Me++) {
  18827. var ki = this.ne(bd + Me);
  18828. ve.width += ki.total
  18829. }
  18830. var xj = Mf.Ya + ve.width,
  18831. yj = cf.Ya + ve.height;
  18832. h.x = Nd;
  18833. h.y = gc;
  18834. h.width = xj;
  18835. h.height = yj;
  18836. var Jb = Nd,
  18837. Bh = gc,
  18838. Ch = xj,
  18839. ka = yj;
  18840. Nd + xj > e.width && (Ch = Math.max(e.width - Nd, 0));
  18841. gc + yj > e.height && (ka = Math.max(e.height - gc, 0));
  18842. var ca = Bb.alignment,
  18843. ic = 0,
  18844. mg = 0,
  18845. li = 0,
  18846. Kb = 0;
  18847. if (ca.ld()) {
  18848. ca = this.om;
  18849. ca.Xc() || (ca = mc);
  18850. var ic = ca.x,
  18851. mg = ca.y,
  18852. li =
  18853. ca.offsetX,
  18854. Kb = ca.offsetY,
  18855. mi = Mf.alignment,
  18856. Xb = cf.alignment;
  18857. mi.Xc() && (ic = mi.x, li = mi.offsetX);
  18858. Xb.Xc() && (mg = Xb.y, Kb = Xb.offsetY)
  18859. } else ic = ca.x, mg = ca.y, li = ca.offsetX, Kb = ca.offsetY;
  18860. if (isNaN(ic) || isNaN(mg)) mg = ic = .5, Kb = li = 0;
  18861. var df = de.width,
  18862. Ne = de.height,
  18863. ef = Bb.margin,
  18864. we = ef.left + ef.right,
  18865. xe = ef.top + ef.bottom,
  18866. cd = $o(Bb, cf, Mf, !1);
  18867. !isNaN(Bb.Ea.width) || cd !== Ye && cd !== yo || (df = Math.max(xj - we, 0));
  18868. !isNaN(Bb.Ea.height) || cd !== Ye && cd !== xo || (Ne = Math.max(yj - xe, 0));
  18869. var Od = Bb.pf,
  18870. Dh = Bb.ah,
  18871. df = Math.min(Od.width, df),
  18872. Ne = Math.min(Od.height,
  18873. Ne),
  18874. df = Math.max(Dh.width, df),
  18875. Ne = Math.max(Dh.height, Ne),
  18876. Z = Ne + xe;
  18877. h.x += h.width * ic - (df + we) * ic + li + ef.left;
  18878. h.y += h.height * mg - Z * mg + Kb + ef.top;
  18879. Bb.visible && (Vb(Jb, Bh, Ch, ka, h.x, h.y, de.width, de.height) ? Bb.rc(h.x, h.y, df, Ne) : Bb.rc(h.x, h.y, df, Ne, new C(Jb, Bh, Ch, ka)))
  18880. } else {
  18881. Bb.cj();
  18882. Bb.bc.Xa();
  18883. var nd = Bb.bc,
  18884. ng = D.vg(nd.x, nd.y, nd.width, nd.height);
  18885. nd.x = md.type === Ro ? zh : Nd;
  18886. nd.y = md.type === So ? Kg : gc;
  18887. nd.width = de.width;
  18888. nd.height = de.height;
  18889. Bb.bc.freeze();
  18890. No(Bb, !1);
  18891. if (!Db(ng, nd)) {
  18892. var ni = Bb.Y;
  18893. null !== ni && (ni.cl(), Bb.$s(ni))
  18894. }
  18895. D.Lb(ng)
  18896. }
  18897. }
  18898. }
  18899. }
  18900. D.Zk(ve);
  18901. for (nb = 0; nb < ce; nb++) Bb = g[nb], md = Bb instanceof x ? Bb : null, null === md || md.type !== Ro && md.type !== So || (nd = Bb.bc, Bb.fd.Xa(), Bb.fd.n(0, 0, nd.width, nd.height), Bb.fd.freeze());
  18902. break;
  18903. case "Viewbox":
  18904. var Eh = g[0],
  18905. rc = Eh.Fa,
  18906. Fh = Eh.margin,
  18907. rb = Fh.top + Fh.bottom,
  18908. sb = Math.max(rc.width + (Fh.right + Fh.left), 0),
  18909. nm = Math.max(rc.height + rb, 0),
  18910. ff = Eh.alignment;
  18911. ff.ld() && (ff = this.om);
  18912. ff.Xc() || (ff = mc);
  18913. h.x = e.width * ff.x - sb * ff.x + ff.offsetX;
  18914. h.y = e.height * ff.y - nm * ff.y + ff.offsetY;
  18915. h.width = rc.width;
  18916. h.height = rc.height;
  18917. Eh.rc(h.x, h.y, h.width, h.height);
  18918. break;
  18919. case "Link":
  18920. var Kk = g.length;
  18921. if (this instanceof da || this instanceof J) {
  18922. var oi = null;
  18923. this instanceof J && (oi = this);
  18924. this instanceof da && (oi = this.If);
  18925. var Cc = oi,
  18926. Of = this instanceof da ? null : Cc.path;
  18927. if (null !== this.oh) {
  18928. var og = this.oh.o,
  18929. Tb = 0;
  18930. if (null !== Of && Tb < this.oh.count) {
  18931. var gf = og[Tb];
  18932. Tb++;
  18933. Of.rc(gf.x - this.yj.x, gf.y - this.yj.y, gf.width, gf.height)
  18934. }
  18935. for (var Lk = 0; Lk < Kk; Lk++) {
  18936. var om = g[Lk];
  18937. om !== Of && Tb < this.oh.count && (gf = og[Tb], Tb++, om.rc(gf.x - this.yj.x, gf.y - this.yj.y, gf.width, gf.height))
  18938. }
  18939. }
  18940. var Pf = Cc.points,
  18941. hf =
  18942. Pf.count;
  18943. if (2 <= hf && this instanceof J)
  18944. for (var jf = this.Af; jf.next();) {
  18945. var sc = jf.value,
  18946. pg = hf,
  18947. Gc = Pf,
  18948. Fb = sc.We,
  18949. pi = sc.WB,
  18950. Lg = sc.Gh,
  18951. zj = sc.Uq,
  18952. up = sc.XB,
  18953. Mg = 0,
  18954. Qf = 0,
  18955. Ng = 0;
  18956. if (Fb < -pg || Fb >= pg) {
  18957. var Og = this.xG,
  18958. tb = this.wG;
  18959. zj !== vj && (Ng = this.computeAngle(sc, zj, tb), sc.angle = Ng);
  18960. Mg = Og.x;
  18961. Qf = Og.y
  18962. } else {
  18963. var ac = void 0,
  18964. Hc = void 0;
  18965. if (0 <= Fb) ac = Gc.o[Fb], Hc = Fb < pg - 1 ? Gc.o[Fb + 1] : ac;
  18966. else var kf = pg + Fb,
  18967. ac = Gc.o[kf],
  18968. Hc = 0 < kf ? Gc.o[kf - 1] : ac;
  18969. if (ac.Wc(Hc)) {
  18970. var Pd = void 0,
  18971. Ad = void 0;
  18972. 0 <= Fb ? (Pd = 0 < Fb ? Gc.o[Fb - 1] : ac, Ad = Fb < pg - 2 ? Gc.o[Fb + 2] : Hc) : (Pd = kf < pg -
  18973. 1 ? Gc.o[kf + 1] : ac, Ad = 1 < kf ? Gc.o[kf - 2] : Hc);
  18974. var lf = Pd.Kf(ac),
  18975. eb = Hc.Kf(Ad),
  18976. tb = lf > eb + 10 ? 0 <= Fb ? Pd.Wb(ac) : ac.Wb(Pd) : eb > lf + 10 ? 0 <= Fb ? Hc.Wb(Ad) : Ad.Wb(Hc) : 0 <= Fb ? Pd.Wb(Ad) : Ad.Wb(Pd)
  18977. } else tb = 0 <= Fb ? ac.Wb(Hc) : Hc.Wb(ac);
  18978. zj !== vj && (Ng = this.computeAngle(sc, zj, tb), sc.angle = Ng);
  18979. Mg = ac.x + (Hc.x - ac.x) * pi;
  18980. Qf = ac.y + (Hc.y - ac.y) * pi
  18981. }
  18982. if (Lg.O(dc)) sc.location = new N(Mg, Qf);
  18983. else {
  18984. Lg.de() && (Lg = mc);
  18985. var mf = D.hh();
  18986. mf.reset();
  18987. mf.scale(sc.scale, sc.scale);
  18988. mf.rotate(sc.angle, 0, 0);
  18989. var od = sc.Ga,
  18990. Pg = D.vg(0, 0, od.width, od.height),
  18991. nf = D.P();
  18992. nf.uo(Pg,
  18993. Lg);
  18994. mf.vb(nf);
  18995. var Ic = -nf.x,
  18996. Rf = -nf.y,
  18997. Oe = up.copy();
  18998. isNaN(Oe.x) && (Oe.x = 0 <= Fb ? nf.x + 3 : -(nf.x + 3));
  18999. isNaN(Oe.y) && (Oe.y = -(nf.y + 3));
  19000. Oe.rotate(tb);
  19001. Mg += Oe.x;
  19002. Qf += Oe.y;
  19003. mf.tH(Pg);
  19004. var Ic = Ic + Pg.x,
  19005. Rf = Rf + Pg.y,
  19006. Qg = D.Fb(Mg + Ic, Qf + Rf);
  19007. sc.move(Qg);
  19008. D.A(Qg);
  19009. D.A(nf);
  19010. D.Lb(Pg);
  19011. D.lf(mf)
  19012. }
  19013. }
  19014. this.Wu(!1)
  19015. }
  19016. break;
  19017. case "Grid":
  19018. break;
  19019. case "Graduated":
  19020. if (null !== this.Tm) {
  19021. var Rg = this.Ld(),
  19022. Aj = this.Vm,
  19023. Mk = this.Tm,
  19024. ye = 0,
  19025. dd = Mk[ye];
  19026. ye++;
  19027. Rg.rc(dd.x - e.x, dd.y - e.y, dd.width, dd.height);
  19028. for (var Nk = g.length, Gh = 0; Gh < Nk; Gh++) {
  19029. var pd = g[Gh],
  19030. Bj = Aj[Gh];
  19031. pd.visible &&
  19032. pd !== Rg && 0 !== Bj.length && (dd = Mk[ye], ye++, pd.rc(dd.x - e.x, dd.y - e.y, dd.width, dd.height))
  19033. }
  19034. this.Tm = null
  19035. }
  19036. break;
  19037. case "TableRow":
  19038. case "TableColumn":
  19039. D.k(this.toString() + " is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel.");
  19040. break;
  19041. default:
  19042. D.k("Unknown panel type: " + u)
  19043. }
  19044. D.Lb(h)
  19045. }
  19046. };
  19047. x.prototype.Rk = function(a) {
  19048. var b = this.Ga,
  19049. c = Rp(this);
  19050. if (Vb(0, 0, b.width, b.height, a.x, a.y)) {
  19051. for (var b = this.xa.o, d = b.length, e = D.Fb(0, 0); d--;) {
  19052. var g = b[d];
  19053. if (g.visible || g === c)
  19054. if (kb(e.set(a), g.transform), g.Pa(e)) return D.A(e), !0
  19055. }
  19056. D.A(e);
  19057. return null === this.Mb && null === this.lc ? !1 : !0
  19058. }
  19059. return !1
  19060. };
  19061. x.prototype.Vx = function(a) { if (this.Jo === a) return this; for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) { var e = b[d].Vx(a); if (null !== e) return e } return null };
  19062. function gp(a, b, c) { c(a, b); if (b instanceof x) { b = b.xa.o; for (var d = b.length, e = 0; e < d; e++) gp(a, b[e], c) } }
  19063. function Xm(a, b) { cq(a, a, b) }
  19064. function cq(a, b, c) {
  19065. c(b);
  19066. b = b.xa.o;
  19067. for (var d = b.length, e = 0; e < d; e++) {
  19068. var g = b[e];
  19069. g instanceof x && cq(a, g, c)
  19070. }
  19071. }
  19072. x.prototype.walkVisualTree = x.prototype.LK = function(a) { dq(this, this, a) };
  19073. function dq(a, b, c) { c(b); if (b instanceof x) { b = b.xa.o; for (var d = b.length, e = 0; e < d; e++) dq(a, b[e], c) } }
  19074. x.prototype.findInVisualTree = x.prototype.qu = function(a) { return eq(this, this, a) };
  19075. function eq(a, b, c) { if (c(b)) return b; if (b instanceof x) { b = b.xa.o; for (var d = b.length, e = 0; e < d; e++) { var g = eq(a, b[e], c); if (null !== g) return g } } return null }
  19076. x.prototype.findObject = x.prototype.Md = function(a) {
  19077. if (this.name === a) return this;
  19078. for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) {
  19079. var e = b[d];
  19080. if (e.name === a) return e;
  19081. if (e instanceof x)
  19082. if (null === e.ej && null === e.Ig) { if (e = e.Md(a), null !== e) return e } else if (vn(e) && (e = e.xa.first(), null !== e && (e = e.Md(a), null !== e))) return e
  19083. }
  19084. return null
  19085. };
  19086. function fq(a) {
  19087. a = a.xa.o;
  19088. for (var b = a.length, c = 0, d = 0; d < b; d++) {
  19089. var e = a[d];
  19090. if (e instanceof x) c = Math.max(c, fq(e));
  19091. else if (e instanceof z) {
  19092. a: {
  19093. if (null !== !e.bg) switch (e.$o) {
  19094. case "None":
  19095. case "Square":
  19096. case "Ellipse":
  19097. case "Circle":
  19098. case "LineH":
  19099. case "LineV":
  19100. case "FramedRectangle":
  19101. case "RoundedRectangle":
  19102. case "Line1":
  19103. case "Line2":
  19104. case "Border":
  19105. case "Cube1":
  19106. case "Cube2":
  19107. case "Junction":
  19108. case "Cylinder1":
  19109. case "Cylinder2":
  19110. case "Cylinder3":
  19111. case "Cylinder4":
  19112. case "PlusLine":
  19113. case "XLine":
  19114. case "ThinCross":
  19115. case "ThickCross":
  19116. e =
  19117. 0;
  19118. break a
  19119. }
  19120. e = e.Rg / 2 * e.xn * e.Jj()
  19121. }
  19122. c = Math.max(c, e)
  19123. }
  19124. }
  19125. return c
  19126. }
  19127. f = x.prototype;
  19128. f.kh = function() { return !(this.type === Ro || this.type === So) };
  19129. f.Je = function(a, b, c) {
  19130. if (!1 === this.tg) return null;
  19131. void 0 === b && (b = null);
  19132. void 0 === c && (c = null);
  19133. if (Om(this)) return null;
  19134. var d = this.Ga,
  19135. e = 1 / this.Jj(),
  19136. g = this.kh(),
  19137. h = g ? a : kb(D.Fb(a.x, a.y), this.transform),
  19138. k = this.g,
  19139. l = 10,
  19140. m = 5;
  19141. null !== k && (l = k.Cu("extraTouchArea"), m = l / 2);
  19142. if (Vb(-(m * e), -(m * e), d.width + l * e, d.height + l * e, h.x, h.y)) {
  19143. if (!this.Yn) {
  19144. var e = this.xa.o,
  19145. n = e.length,
  19146. k = D.P(),
  19147. m = (l = this.yq) ? this.Ld() : null;
  19148. if (l && (m.kh() ? kb(k.set(a), m.transform) : k.set(a), !m.Pa(k))) return D.A(k), g || D.A(h), null;
  19149. for (var p = Rp(this); n--;) {
  19150. var q =
  19151. e[n];
  19152. if (q.visible || q === p)
  19153. if (q.kh() ? kb(k.set(a), q.transform) : k.set(a), !l || q !== m) {
  19154. var r = null;
  19155. q instanceof x ? r = q.Je(k, b, c) : !0 === q.tg && q.Pa(k) && (r = q);
  19156. if (null !== r && (null !== b && (r = b(r)), null !== r && (null === c || c(r)))) return D.A(k), g || D.A(h), r
  19157. }
  19158. }
  19159. D.A(k)
  19160. }
  19161. if (null === this.background && null === this.gm) return g || D.A(h), null;
  19162. a = Vb(0, 0, d.width, d.height, h.x, h.y) ? this : null;
  19163. g || D.A(h);
  19164. return a
  19165. }
  19166. g || D.A(h);
  19167. return null
  19168. };
  19169. f.ru = function(a, b, c, d) {
  19170. if (!1 === this.tg) return !1;
  19171. void 0 === b && (b = null);
  19172. void 0 === c && (c = null);
  19173. d instanceof K || d instanceof L || (d = new K(O));
  19174. var e = this.Ga,
  19175. g = this.kh(),
  19176. h = g ? a : kb(D.Fb(a.x, a.y), this.transform);
  19177. if (Vb(0, 0, e.width, e.height, h.x, h.y)) {
  19178. if (!this.Yn) {
  19179. for (var e = this.xa.o, k = e.length, l = D.P(), m = Rp(this); k--;) {
  19180. var n = e[k];
  19181. if (n.visible || n === m) {
  19182. n.kh() ? kb(l.set(a), n.transform) : l.set(a);
  19183. var p = n,
  19184. n = n instanceof x ? n : null;
  19185. (null !== n ? n.ru(l, b, c, d) : p.Pa(l)) && !1 !== p.tg && (null !== b && (p = b(p)), null === p || null !== c && !c(p) ||
  19186. d.add(p))
  19187. }
  19188. }
  19189. D.A(l)
  19190. }
  19191. g || D.A(h);
  19192. return null !== this.background || null !== this.gm
  19193. }
  19194. g || D.A(h);
  19195. return !1
  19196. };
  19197. f.Xk = function(a, b, c, d, e, g) {
  19198. if (!1 === this.tg) return !1;
  19199. void 0 === b && (b = null);
  19200. void 0 === c && (c = null);
  19201. var h = g;
  19202. void 0 === g && (h = D.hh(), h.reset());
  19203. h.multiply(this.transform);
  19204. if (this.In(a, h)) return gq(this, b, c, e), void 0 === g && D.lf(h), !0;
  19205. if (this.jg(a, h)) {
  19206. if (!this.Yn)
  19207. for (var k = Rp(this), l = this.xa.o, m = l.length; m--;) {
  19208. var n = l[m];
  19209. if (n.visible || n === k) {
  19210. var p = n.aa,
  19211. q = this.Ga;
  19212. if (!(p.x > q.width || p.y > q.height || 0 > p.x + p.width || 0 > p.y + p.height)) {
  19213. p = n;
  19214. n = n instanceof x ? n : null;
  19215. q = D.hh();
  19216. q.set(h);
  19217. if (null !== n ? n.Xk(a, b, c, d, e, q) : Lo(p, a, d,
  19218. q)) null !== b && (p = b(p)), null === p || null !== c && !c(p) || e.add(p);
  19219. D.lf(q)
  19220. }
  19221. }
  19222. }
  19223. void 0 === g && D.lf(h);
  19224. return d
  19225. }
  19226. void 0 === g && D.lf(h);
  19227. return !1
  19228. };
  19229. function gq(a, b, c, d) {
  19230. for (var e = a.xa.o, g = e.length; g--;) {
  19231. var h = e[g];
  19232. if (h.visible) {
  19233. var k = h.aa,
  19234. l = a.Ga;
  19235. k.x > l.width || k.y > l.height || 0 > k.x + k.width || 0 > k.y + k.height || (h instanceof x && gq(h, b, c, d), null !== b && (h = b(h)), null === h || null !== c && !c(h) || d.add(h))
  19236. }
  19237. }
  19238. }
  19239. f.Pn = function(a, b, c, d, e, g) {
  19240. if (!1 === this.tg) return !1;
  19241. void 0 === c && (c = null);
  19242. void 0 === d && (d = null);
  19243. var h = this.Ga,
  19244. k = this.kh(),
  19245. l = k ? a : kb(D.Fb(a.x, a.y), this.transform),
  19246. m = k ? b : kb(D.Fb(b.x, b.y), this.transform),
  19247. n = l.Kf(m),
  19248. p = 0 < l.x && l.x < h.width && 0 < l.y && l.y < h.height || lb(l.x, l.y, 0, 0, 0, h.height) < n || lb(l.x, l.y, 0, h.height, h.width, h.height) < n || lb(l.x, l.y, h.width, h.height, h.width, 0) < n || lb(l.x, l.y, h.width, 0, 0, 0) < n,
  19249. h = 0 < l.x && l.x < h.width && 0 < l.y && l.y < h.height && lb(l.x, l.y, 0, 0, 0, h.height) < n && lb(l.x, l.y, 0, h.height, h.width, h.height) <
  19250. n && lb(l.x, l.y, h.width, h.height, h.width, 0) < n && lb(l.x, l.y, h.width, 0, 0, 0) < n;
  19251. k || (D.A(l), D.A(m));
  19252. if (p) {
  19253. if (!this.Yn) {
  19254. for (var l = D.P(), m = D.P(), n = Rp(this), q = this.xa.o, r = q.length; r--;) {
  19255. var s = q[r];
  19256. if (s.visible || s === n) {
  19257. var u = s.aa,
  19258. t = this.Ga;
  19259. if (!k || !(u.x > t.width || u.y > t.height || 0 > u.x + u.width || 0 > u.y + u.height))
  19260. if (s.kh() ? (u = s.transform, kb(l.set(a), u), kb(m.set(b), u)) : (l.set(a), m.set(b)), u = s, s = s instanceof x ? s : null, null !== s ? s.Pn(l, m, c, d, e, g) : u.JF(l, m, e)) null !== c && (u = c(u)), null === u || null !== d && !d(u) || g.add(u)
  19261. }
  19262. }
  19263. D.A(l);
  19264. D.A(m)
  19265. }
  19266. return e ? p : h
  19267. }
  19268. return !1
  19269. };
  19270. function Sp(a) {
  19271. var b = null;
  19272. a instanceof z && (b = a.C, b === Vc && (b = null), a = a.vf, null !== a && null === b && (b = a.C));
  19273. null === b && (b = ec);
  19274. return b
  19275. }
  19276. function Tp(a) {
  19277. var b = null;
  19278. a instanceof z && (b = a.D, b === Vc && (b = null), a = a.vf, null !== a && null === b && (b = a.D));
  19279. null === b && (b = vc);
  19280. return b
  19281. }
  19282. x.prototype.add = x.prototype.add = function(a) {
  19283. D.l(a, O, x, "add:element");
  19284. this.be(this.xa.count, a)
  19285. };
  19286. x.prototype.elt = x.prototype.fa = function(a) { return this.xa.fa(a) };
  19287. x.prototype.insertAt = x.prototype.be = function(a, b) {
  19288. b instanceof F && D.k("Cannot add a Part to a Panel: " + b + "; use a Panel instead");
  19289. if (this === b || this.xm(b)) this === b && D.k("Cannot make a Panel contain itself: " + this.toString()), D.k("Cannot make a Panel indirectly contain itself: " + this.toString() + " already contains " + b.toString());
  19290. var c = b.R;
  19291. null !== c && c !== this && D.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: " + b.toString() + ", already contained by " + c.toString() + ", cannot be shared by this Panel: " +
  19292. this.toString());
  19293. this.da !== Sl || b instanceof z || D.k("Can only add Shapes to a Grid Panel, not: " + b);
  19294. this.da !== pp || b instanceof z || b instanceof pa || D.k("Can only add Shapes or TextBlocks to a Graduated Panel, not: " + b);
  19295. b.Bm(this);
  19296. b.mn = null;
  19297. if (null !== this.el) {
  19298. var d = b.data;
  19299. null !== d && "object" === typeof d && (null === this.Hg && (this.Hg = new oa(Object, x)), this.Hg.add(d, b))
  19300. }
  19301. var e = this.xa,
  19302. d = -1;
  19303. if (c === this) {
  19304. for (var g = -1, h = this.xa.o, k = h.length, l = 0; l < k; l++)
  19305. if (h[l] === b) { g = l; break }
  19306. if (-1 !== g) {
  19307. if (g === a || g + 1 >= e.count &&
  19308. a >= e.count) return;
  19309. e.pd(g);
  19310. d = g
  19311. } else D.k("element " + b.toString() + " has panel " + c.toString() + " but is not contained by it.")
  19312. }
  19313. if (0 > a || a > e.count) a = e.count;
  19314. e.be(a, b);
  19315. if (0 === a || b.Ue) this.Xl = null;
  19316. this.K();
  19317. b.K();
  19318. null !== b.yd ? this.bl = !0 : b instanceof x && !0 === b.bl && (this.bl = !0);
  19319. this.pk = null;
  19320. c = this.Y;
  19321. null !== c && (c.Sl = null, c.zk = NaN, this.bl && c instanceof G && (c.bl = !0), c.bl && c instanceof G && (c.Ae = null), e = this.g, null !== e && e.na.ub || (-1 !== d && c.od(ig, "elements", this, b, null, d, null), c.od(hg, "elements", this, null, b, null, a),
  19322. this.Ju() || hq(this, b, !1)))
  19323. };
  19324. D.defineProperty(x, { bl: null }, function() { return 0 !== (this.S & 8388608) }, function(a) { 0 !== (this.S & 8388608) !== a && (this.S ^= 8388608) });
  19325. function iq(a, b) { a.S = b ? a.S | 16777216 : a.S & -16777217 }
  19326. x.prototype.remove = x.prototype.remove = function(a) {
  19327. D.l(a, O, x, "remove:element");
  19328. for (var b = this.xa.o, c = b.length, d = -1, e = 0; e < c; e++)
  19329. if (b[e] === a) { d = e; break } - 1 !== d && this.yf(d, !0)
  19330. };
  19331. x.prototype.removeAt = x.prototype.pd = function(a) {
  19332. v && D.p(a, x, "removeAt:idx");
  19333. 0 <= a && this.yf(a, !0)
  19334. };
  19335. x.prototype.yf = function(a, b) {
  19336. var c = this.xa,
  19337. d = c.fa(a);
  19338. d.mn = null;
  19339. d.Bm(null);
  19340. if (null !== this.Hg) { var e = d.data; "object" === typeof e && this.Hg.remove(e) }
  19341. c.pd(a);
  19342. km(this, !1);
  19343. this.K();
  19344. this.Xl === d && (this.Xl = null);
  19345. this.pk = null;
  19346. var g = this.Y;
  19347. null !== g && (g.Sl = null, g.zk = NaN, g.pe(), g instanceof G && (d instanceof x ? gp(d, d, function(a, c) { dp(g, c, b) }) : dp(g, d, b)), c = this.g, null !== c && c.na.ub || g.od(ig, "elements", this, d, null, a, null))
  19348. };
  19349. D.w(x, { Tq: "rowCount" }, function() { return void 0 === this.hd ? 0 : this.hd.length });
  19350. x.prototype.getRowDefinition = x.prototype.oe = function(a) {
  19351. v && D.p(a, x, "getRowDefinition:idx");
  19352. 0 > a && D.ua(a, ">= 0", x, "getRowDefinition:idx");
  19353. a = Math.round(a);
  19354. var b = this.hd;
  19355. if (void 0 === b[a]) {
  19356. var c = new jh;
  19357. c.Bm(this);
  19358. c.Ke = !0;
  19359. c.index = a;
  19360. b[a] = c
  19361. }
  19362. return b[a]
  19363. };
  19364. x.prototype.removeRowDefinition = x.prototype.LG = function(a) {
  19365. v && D.p(a, x, "removeRowDefinition:idx");
  19366. 0 > a && D.ua(a, ">= 0", x, "removeRowDefinition:idx");
  19367. a = Math.round(a);
  19368. var b = this.hd;
  19369. this.od(ig, "coldefs", this, b[a], null, a, null);
  19370. b[a] && delete b[a];
  19371. this.K()
  19372. };
  19373. D.w(x, { fq: "columnCount" }, function() { return void 0 === this.cd ? 0 : this.cd.length });
  19374. x.prototype.getColumnDefinition = x.prototype.ne = function(a) {
  19375. v && D.p(a, x, "getColumnDefinition:idx");
  19376. 0 > a && D.ua(a, ">= 0", x, "getColumnDefinition:idx");
  19377. a = Math.round(a);
  19378. var b = this.cd;
  19379. if (void 0 === b[a]) {
  19380. var c = new jh;
  19381. c.Bm(this);
  19382. c.Ke = !1;
  19383. c.index = a;
  19384. b[a] = c
  19385. }
  19386. return b[a]
  19387. };
  19388. x.prototype.removeColumnDefinition = x.prototype.JG = function(a) {
  19389. v && D.p(a, x, "removeColumnDefinition:idx");
  19390. 0 > a && D.ua(a, ">= 0", x, "removeColumnDefinition:idx");
  19391. a = Math.round(a);
  19392. var b = this.cd;
  19393. this.od(ig, "coldefs", this, b[a], null, a, null);
  19394. b[a] && delete b[a];
  19395. this.K()
  19396. };
  19397. D.defineProperty(x, { mK: "rowSizing" }, function() { return void 0 === this.pn ? op : this.pn }, function(a) {
  19398. if (void 0 !== this.pn) {
  19399. var b = this.pn;
  19400. b !== a && (a !== op && a !== Vp && D.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: " + a), this.pn = a, this.K(), this.i("rowSizing", b, a))
  19401. }
  19402. });
  19403. D.defineProperty(x, { jI: "columnSizing" }, function() { return void 0 === this.Pm ? op : this.Pm }, function(a) {
  19404. if (void 0 !== this.Pm) {
  19405. var b = this.Pm;
  19406. b !== a && (a !== op && a !== Vp && D.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: " + a), this.Pm = a, this.K(), this.i("columnSizing", b, a))
  19407. }
  19408. });
  19409. D.defineProperty(x, { qH: "topIndex" }, function() { return void 0 === this.xj ? 0 : this.xj }, function(a) {
  19410. if (void 0 !== this.xj) {
  19411. var b = this.xj;
  19412. b !== a && ((!isFinite(a) || 0 > a) && D.k("Panel.topIndex must be greater than zero and a real number, not: " + a), this.xj = a, this.K(), this.i("topIndex", b, a))
  19413. }
  19414. });
  19415. D.defineProperty(x, { sG: "leftIndex" }, function() { return void 0 === this.hj ? 0 : this.hj }, function(a) {
  19416. if (void 0 !== this.hj) {
  19417. var b = this.hj;
  19418. b !== a && ((!isFinite(a) || 0 > a) && D.k("Panel.leftIndex must be greater than zero and a real number, not: " + a), this.hj = a, this.K(), this.i("leftIndex", b, a))
  19419. }
  19420. });
  19421. x.prototype.findRowForLocalY = function(a) { if (0 > a || this.type !== fa) return -1; for (var b = 0, c = this.hd, d = c.length, e = this.xj; e < d; e++) { var g = c[e]; if (void 0 !== g && (b += g.total, a < b)) break } return e };
  19422. x.prototype.findColumnForLocalX = function(a) { if (0 > a || this.type !== fa) return -1; for (var b = 0, c = this.cd, d = c.length, e = this.hj; e < d; e++) { var g = c[e]; if (void 0 !== g && (b += g.total, a < b)) break } return e };
  19423. x.prototype.graduatedPointForValue = function(a, b) {
  19424. void 0 === b && (b = new N(NaN, NaN));
  19425. if (this.type !== pp) return b.n(NaN, NaN), b;
  19426. a = Math.min(Math.max(a, this.al), this.gB);
  19427. var c = (a - this.al) / this.Du,
  19428. d = this.Ld();
  19429. d.vf.XI(c, b);
  19430. return d.transform.vb(b)
  19431. };
  19432. x.prototype.graduatedValueForPoint = function(a) {
  19433. if (this.type !== pp) return NaN;
  19434. var b = this.Ld(),
  19435. c = b.vf;
  19436. b.transform.Oh(a);
  19437. return c.TI(a) * this.Du + this.al
  19438. };
  19439. D.defineProperty(x, { data: "data" }, function() { return this.Sd }, function(a) {
  19440. var b = this.Sd;
  19441. if (b !== a) {
  19442. var c = this instanceof F && !(this instanceof da);
  19443. c && D.h(a, "object", x, "data");
  19444. Sh(this);
  19445. this.Sd = a;
  19446. var d = this.g;
  19447. null !== d && (c ? this instanceof J ? (null !== b && d.gk.remove(b), null !== a && d.gk.add(a, this)) : this instanceof F && (null !== b && d.Vi.remove(b), null !== a && d.Vi.add(a, this)) : (c = this.R, null !== c && null !== c.Hg && (null !== b && c.Hg.remove(b), null !== a && c.Hg.add(a, this))));
  19448. this.i("data", b, a);
  19449. null !== d && d.na.ub || null !== a && this.Ob()
  19450. }
  19451. });
  19452. D.defineProperty(x, { Qu: "itemIndex" }, function() { return this.xs }, function(a) {
  19453. var b = this.xs;
  19454. b !== a && (this.xs = a, this.i("itemIndex", b, a))
  19455. });
  19456. function hp(a) { a = a.zl; return null !== a && a.J }
  19457. function Sh(a) {
  19458. var b = a.zl;
  19459. if (null === b) null !== a.data && D.k("Template cannot have .data be non-null: " + a), a.zl = b = new K(ph);
  19460. else if (b.J) return;
  19461. var c = new K(O);
  19462. iq(a, !1);
  19463. gp(a, a, function(a, d) {
  19464. var e = d.Hc;
  19465. if (null !== e)
  19466. for (cp(d, !1), e = e.j; e.next();) {
  19467. var g = e.value;
  19468. g.mode === rh && cp(d, !0);
  19469. var h = g.$q;
  19470. null !== h && ("/" === h && iq(a, !0), h = sh(g, a, d), null !== h && (c.add(h), null === h.Lp && (h.Lp = new K(ph)), h.Lp.add(g)));
  19471. b.add(g)
  19472. }
  19473. if (d instanceof x && d.type === fa) {
  19474. if (0 < d.hd.length)
  19475. for (e = d.hd, g = e.length, h = 0; h < g; h++) {
  19476. var k = e[h];
  19477. if (void 0 !==
  19478. k && null !== k.Hc)
  19479. for (var l = k.Hc.j; l.next();) {
  19480. var t = l.value;
  19481. t.Sg = k;
  19482. t.Pt = 2;
  19483. t.Tp = k.index;
  19484. b.add(t)
  19485. }
  19486. }
  19487. if (0 < d.cd.length)
  19488. for (e = d.cd, g = e.length, h = 0; h < g; h++)
  19489. if (k = e[h], void 0 !== k && null !== k.Hc)
  19490. for (l = k.Hc.j; l.next();) t = l.value, t.Sg = k, t.Pt = 1, t.Tp = k.index, b.add(t)
  19491. }
  19492. });
  19493. for (var d = c.j; d.next();) {
  19494. var e = d.value;
  19495. if (null !== e.Lp) {
  19496. cp(e, !0);
  19497. for (var g = e.Lp.j; g.next();) {
  19498. var h = g.value;
  19499. null === e.Hc && (e.Hc = new K(ph));
  19500. e.Hc.add(h)
  19501. }
  19502. }
  19503. e.Lp = null
  19504. }
  19505. for (d = b.j; d.next();)
  19506. if (e = d.value, g = e.Sg, null !== g) {
  19507. e.Sg = null;
  19508. var k = e.tv,
  19509. l = k.indexOf(".");
  19510. 0 < l &&
  19511. g instanceof x && (h = k.substring(0, l), k = k.substr(l + 1), l = g.Md(h), null !== l ? (g = l, e.tv = k) : D.trace('Warning: unable to find GraphObject named "' + h + '" for Binding: ' + e.toString()));
  19512. g instanceof jh ? (e.Fm = D.Nd(g.R), g.R.Jo = e.Fm) : (e.Fm = D.Nd(g), g.Jo = e.Fm)
  19513. }
  19514. b.freeze();
  19515. a instanceof F && (a.qe() && a.kf(), v && !jq && gp(a, a, function(a, c) {
  19516. if (c instanceof x && (c.type === Pl || c.type === Xj || c.type === pp) && 1 >= c.elements.count && !(c instanceof F)) {
  19517. if (1 === c.elements.count) {
  19518. var d = null !== c.el;
  19519. if (!d)
  19520. for (var e = b.j; e.next();)
  19521. if ("itemArray" ===
  19522. e.value.tv) { d = !0; break }
  19523. }
  19524. d || (D.trace("Auto, Spot, or Graduated Panel should not have zero or one elements: " + c.toString() + " in " + a.toString()), jq = !0)
  19525. }
  19526. }))
  19527. }
  19528. var jq = !1;
  19529. x.prototype.copyTemplate = function() {
  19530. var a = this.copy();
  19531. a.LK(function(a) {
  19532. a instanceof x && (a.zl = null, a.Sd = null);
  19533. var c = a.Hc;
  19534. null !== c && (a.Hc = null, c.each(function(c) { a.bind(c.copy()) }))
  19535. });
  19536. return a
  19537. };
  19538. x.prototype.updateTargetBindings = x.prototype.Ob = function(a) {
  19539. var b = this.zl;
  19540. if (null !== b)
  19541. for (void 0 === a && (a = ""), b = b.j; b.next();) {
  19542. var c = b.value,
  19543. d = c.gH;
  19544. if ("" === a || "" === d || d === a)
  19545. if (d = c.tv, null !== c.pI || "" !== d) {
  19546. var d = this.data,
  19547. e = c.$q;
  19548. if (null !== e) d = "" === e ? this : "/" === e ? this : "." === e ? this : ".." === e ? this : this.Md(e);
  19549. else {
  19550. var g = this.g;
  19551. null !== g && c.ly && (d = g.ea.fl)
  19552. }
  19553. if (null === d) v && D.trace("Binding error: missing GraphObject named " + e + " in " + this.toString());
  19554. else {
  19555. var g = this,
  19556. h = c.Fm;
  19557. if (-1 !== h) { if (g = this.Vx(h), null === g) continue } else null !==
  19558. c.Sg && (g = c.Sg);
  19559. "/" === e ? d = g.Y : "." === e ? d = g : ".." === e && (d = g.R);
  19560. e = c.Pt;
  19561. if (0 !== e) {
  19562. if (!(g instanceof x)) continue;
  19563. h = g;
  19564. 1 === e ? g = h.ne(c.Tp) : 2 === e && (g = h.oe(c.Tp))
  19565. }
  19566. void 0 !== g && c.wH(g, d)
  19567. }
  19568. }
  19569. }
  19570. };
  19571. D.defineProperty(x, { el: "itemArray" }, function() { return this.ej }, function(a) {
  19572. var b = this.ej;
  19573. if (b !== a) {
  19574. v && null !== a && !D.isArray(a) && D.k("Panel.itemArray must be an Array-like object or null, not: " + a);
  19575. var c = this.g;
  19576. null !== c && null !== b && cn(c, this);
  19577. this.ej = a;
  19578. null !== c && null !== a && Zm(c, this);
  19579. this.i("itemArray", b, a);
  19580. null !== c && c.na.ub || this.PB()
  19581. }
  19582. });
  19583. function vn(a) { return a.type === Xj || a.type === Pl || a.type === sj || a.type === fa && 0 < a.xa.length && (a = a.xa.fa(0), a.Ue && a instanceof x && (a.type === Ro || a.type === So)) ? !0 : !1 }
  19584. x.prototype.rebuildItemElements = x.prototype.PB = function() {
  19585. var a = 0;
  19586. for (vn(this) && (a = 1); this.xa.length > a;) this.yf(this.xa.length - 1, !1);
  19587. a = this.el;
  19588. if (null !== a)
  19589. for (var b = D.cb(a), c = 0; c < b; c++) un(this, D.La(a, c), c)
  19590. };
  19591. x.prototype.findItemPanelForData = x.prototype.MI = function(a) {
  19592. if (void 0 === a || null === a || null === this.Hg) return null;
  19593. D.h(a, "object", x, "findItemPanelForData");
  19594. return this.Hg.oa(a)
  19595. };
  19596. function un(a, b, c) {
  19597. if (!(void 0 === b || null === b || 0 > c)) {
  19598. var d;
  19599. d = kq(a, b);
  19600. var e = a.wJ,
  19601. g = null;
  19602. null !== e && (g = e.oa(d));
  19603. null === g && (lq || (lq = !0, D.trace('No item template Panel found for category "' + d + '" on ' + a), D.trace(" Using default item template."), d = new x, e = new pa, e.bind(new ph("text", "", ia)), d.add(e), mq = d), g = mq);
  19604. d = g;
  19605. null !== d && (Sh(d), d = d.copy(), 0 !== (d.S & 16777216) && (e = a.qm(), null !== e && iq(e, !0)), "object" === typeof b && (null === a.Hg && (a.Hg = new oa(Object, x)), a.Hg.add(b, d)), e = c, vn(a) && e++, a.be(e, d), d.Sd = b, wn(a, e,
  19606. c), d.Sd = null, d.data = b)
  19607. }
  19608. }
  19609. function wn(a, b, c) {
  19610. for (a = a.xa; b < a.length;) {
  19611. var d = a.fa(b);
  19612. if (d instanceof x) {
  19613. var e = b,
  19614. g = c;
  19615. d.type === Ro ? d.Sb = e : d.type === So && (d.column = e);
  19616. d.Qu = g
  19617. }
  19618. b++;
  19619. c++
  19620. }
  19621. }
  19622. D.defineProperty(x, { ZL: "itemTemplate" }, function() { return null === this.Ig ? null : this.Ig.oa("") }, function(a) {
  19623. if (null === this.Ig) {
  19624. if (null === a) return;
  19625. this.Ig = new oa("string", x)
  19626. }
  19627. var b = this.Ig.oa("");
  19628. b !== a && (D.l(a, x, x, "itemTemplate"), (a instanceof F || a.Ue) && D.k("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: " + a), this.Ig.add("", a), this.i("itemTemplate", b, a), a = this.g, null !== a && a.na.ub || this.PB())
  19629. });
  19630. D.defineProperty(x, { wJ: "itemTemplateMap" }, function() { return this.Ig }, function(a) {
  19631. var b = this.Ig;
  19632. if (b !== a) {
  19633. D.l(a, oa, x, "itemTemplateMap");
  19634. for (var c = a.j; c.next();) {
  19635. var d = c.value;
  19636. (d instanceof F || d.Ue) && D.k("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: " + d)
  19637. }
  19638. this.Ig = a;
  19639. this.i("itemTemplateMap", b, a);
  19640. a = this.g;
  19641. null !== a && a.na.ub || this.PB()
  19642. }
  19643. });
  19644. D.defineProperty(x, { oG: "itemCategoryProperty" }, function() { return this.op }, function(a) {
  19645. var b = this.op;
  19646. b !== a && ("string" !== typeof a && "function" !== typeof a && D.kc(a, "string or function", x, "itemCategoryProperty"), this.op = a, this.i("itemCategoryProperty", b, a))
  19647. });
  19648. function kq(a, b) {
  19649. if (null === b) return "";
  19650. var c = a.op,
  19651. d = "";
  19652. if ("function" === typeof c) d = c(b);
  19653. else if ("string" === typeof c && "object" === typeof b) {
  19654. if ("" === c) return "";
  19655. d = D.xb(b, c)
  19656. } else return "";
  19657. if (void 0 === d) return "";
  19658. if ("string" === typeof d) return d;
  19659. D.k("Panel.getCategoryForItemData found a non-string category for " + b + ": " + d);
  19660. return ""
  19661. }
  19662. var lq = !1,
  19663. mq = null;
  19664. D.defineProperty(x, { Yn: "isAtomic" }, function() { return 0 !== (this.S & 1048576) }, function(a) {
  19665. var b = 0 !== (this.S & 1048576);
  19666. b !== a && (D.h(a, "boolean", x, "isAtomic"), this.S ^= 1048576, this.i("isAtomic", b, a))
  19667. });
  19668. D.defineProperty(x, { yq: "isClipping" }, function() { return 0 !== (this.S & 2097152) }, function(a) {
  19669. var b = 0 !== (this.S & 2097152);
  19670. b !== a && (D.h(a, "boolean", x, "isClipping"), this.S ^= 2097152, this.K(), this.i("isClipping", b, a))
  19671. });
  19672. D.defineProperty(x, { lG: "isOpposite" }, function() { return 0 !== (this.S & 33554432) }, function(a) {
  19673. var b = 0 !== (this.S & 33554432);
  19674. b !== a && (D.h(a, "boolean", x, "isOpposite"), this.S ^= 33554432, this.K(), this.i("isOpposite", b, a))
  19675. });
  19676. D.defineProperty(x, { isEnabled: "isEnabled" }, function() { return 0 !== (this.S & 4194304) }, function(a) {
  19677. var b = 0 !== (this.S & 4194304);
  19678. if (b !== a) {
  19679. D.h(a, "boolean", x, "isEnabled");
  19680. var c = null === this.R || this.R.Ju();
  19681. this.S ^= 4194304;
  19682. this.i("isEnabled", b, a);
  19683. b = this.g;
  19684. null !== b && b.na.ub || c && hq(this, this, a)
  19685. }
  19686. });
  19687. function hq(a, b, c) {
  19688. var d = b.CF;
  19689. null !== d && d(b, c);
  19690. if (b instanceof x) {
  19691. b = b.xa.o;
  19692. for (var d = b.length, e = 0; e < d; e++) {
  19693. var g = b[e];
  19694. c && g instanceof x && !g.isEnabled || hq(a, g, c)
  19695. }
  19696. }
  19697. }
  19698. D.defineProperty(x, { RK: "alignmentFocusName" }, function() { return this.dk }, function(a) {
  19699. var b = this.dk;
  19700. b !== a && (v && D.h(a, "string", x, "alignmentFocusName"), this.dk = a, this.K(), this.i("alignmentFocusName", b, a))
  19701. });
  19702. function jh() {
  19703. D.xc(this);
  19704. this.rj = null;
  19705. this.sw = !0;
  19706. this.Ic = 0;
  19707. this.uf = NaN;
  19708. this.Bk = 0;
  19709. this.Ak = Infinity;
  19710. this.ue = Vc;
  19711. this.sb = this.Ya = 0;
  19712. this.Hc = null;
  19713. this.It = nq;
  19714. this.Qg = wo;
  19715. this.Dt = this.Fk = null;
  19716. this.Et = NaN;
  19717. this.Mb = this.qi = null;
  19718. this.Er = !1
  19719. }
  19720. D.ka("RowColumnDefinition", jh);
  19721. jh.prototype.copy = function() {
  19722. var a = new jh;
  19723. a.sw = this.sw;
  19724. a.Ic = this.Ic;
  19725. a.uf = this.uf;
  19726. a.Bk = this.Bk;
  19727. a.Ak = this.Ak;
  19728. a.ue = this.ue;
  19729. a.Ya = this.Ya;
  19730. a.sb = this.sb;
  19731. a.Qg = this.Qg;
  19732. a.It = this.It;
  19733. a.Fk = null === this.Fk ? null : this.Fk.V();
  19734. a.Dt = this.Dt;
  19735. a.Et = this.Et;
  19736. a.qi = null;
  19737. null !== this.qi && (a.qi = D.km(this.qi));
  19738. a.Mb = this.Mb;
  19739. a.Er = this.Er;
  19740. a.Hc = this.Hc;
  19741. return a
  19742. };
  19743. jh.prototype.gq = function(a) {
  19744. D.l(a, jh, jh, "copyFrom:pd");
  19745. a.Ke ? this.height = a.height : this.width = a.width;
  19746. this.Th = a.Th;
  19747. this.se = a.se;
  19748. this.alignment = a.alignment;
  19749. this.stretch = a.stretch;
  19750. this.qv = a.qv;
  19751. this.Fk = null === a.Fk ? null : a.Fk.V();
  19752. this.Vq = a.Vq;
  19753. this.Wq = a.Wq;
  19754. this.qi = null;
  19755. a.qi && (this.qi = D.km(a.qi));
  19756. this.background = a.background;
  19757. this.RA = a.RA;
  19758. this.Hc = a.Hc
  19759. };
  19760. jh.prototype.qc = function(a) { a.Qe === jh ? this.qv = a : D.ak(this, a) };
  19761. jh.prototype.toString = function() { return "RowColumnDefinition " + (this.Ke ? "(Row " : "(Column ") + this.index + ") #" + D.Nd(this) };
  19762. var nq;
  19763. jh.Default = nq = D.s(jh, "Default", 0);
  19764. var Vp;
  19765. jh.None = Vp = D.s(jh, "None", 1);
  19766. var op;
  19767. jh.ProportionalExtra = op = D.s(jh, "ProportionalExtra", 2);
  19768. jh.prototype.Bm = function(a) { this.rj = a };
  19769. jh.prototype.computeEffectiveSpacingTop = jh.prototype.jF = function() {
  19770. var a = 0,
  19771. b = this.rj,
  19772. c = 0,
  19773. d = this.Ke;
  19774. if (null !== b)
  19775. for (var e = d ? b.hd.length : b.cd.length, g = 0; g < e; g++) { var h = d ? b.hd[g] : b.cd[g]; if (void 0 !== h) { c = h.index; break } }
  19776. this.index !== c && (c = this.Vq, null === c && null !== b && (c = this.Ke ? b.Wi : b.di), null !== c && (a = this.Wq, isNaN(a) && (a = null !== b ? this.Ke ? b.fi : b.ei : 0)));
  19777. c = this.aH;
  19778. if (null === c)
  19779. if (null !== b) c = b.hk;
  19780. else return a;
  19781. return a + (this.Ke ? c.top : c.left)
  19782. };
  19783. jh.prototype.computeEffectiveSpacing = jh.prototype.hf = function() {
  19784. var a = 0,
  19785. b = this.rj,
  19786. c = 0,
  19787. d = this.Ke;
  19788. if (null !== b)
  19789. for (var e = d ? b.hd.length : b.cd.length, g = 0; g < e; g++) { var h = d ? b.hd[g] : b.cd[g]; if (void 0 !== h) { c = h.index; break } }
  19790. this.index !== c && (c = this.Vq, null === c && null !== b && (c = d ? b.Wi : b.di), null !== c && (a = this.Wq, isNaN(a) && (a = null !== b ? d ? b.fi : b.ei : 0)));
  19791. d = this.aH;
  19792. if (null === d)
  19793. if (null !== b) d = b.hk;
  19794. else return a;
  19795. return a + (this.Ke ? d.top + d.bottom : d.left + d.right)
  19796. };
  19797. jh.prototype.vd = function(a, b, c, d, e) {
  19798. var g = this.rj;
  19799. if (null !== g && (g.od(fg, a, this, b, c, d, e), null !== this.Hc && (b = g.g, null !== b && !b.Xe && (g = g.qm(), null !== g && (b = g.data, null !== b)))))
  19800. for (c = this.Hc.j; c.next();) c.value.Wy(this, b, a, g)
  19801. };
  19802. D.w(jh, { R: "panel" }, function() { return this.rj });
  19803. D.defineProperty(jh, { Ke: "isRow" }, function() { return this.sw }, function(a) { this.sw = a });
  19804. D.defineProperty(jh, { index: "index" }, function() { return this.Ic }, function(a) { this.Ic = a });
  19805. D.defineProperty(jh, { height: "height" }, function() { return this.uf }, function(a) {
  19806. var b = this.uf;
  19807. b !== a && (v && D.h(a, "number", jh, "height"), 0 > a && D.ua(a, ">= 0", jh, "height"), this.uf = a, this.hb = this.Ya, null !== this.R && this.R.K(), this.vd("height", b, a))
  19808. });
  19809. D.defineProperty(jh, { width: "width" }, function() { return this.uf }, function(a) {
  19810. var b = this.uf;
  19811. b !== a && (v && D.h(a, "number", jh, "width"), 0 > a && D.ua(a, ">= 0", jh, "width"), this.uf = a, this.hb = this.Ya, null !== this.R && this.R.K(), this.vd("width", b, a))
  19812. });
  19813. D.defineProperty(jh, { Th: "minimum" }, function() { return this.Bk }, function(a) {
  19814. var b = this.Bk;
  19815. b !== a && (v && D.h(a, "number", jh, "minimum"), (0 > a || !isFinite(a)) && D.ua(a, ">= 0", jh, "minimum"), this.Bk = a, this.hb = this.Ya, null !== this.R && this.R.K(), this.vd("minimum", b, a))
  19816. });
  19817. D.defineProperty(jh, { se: "maximum" }, function() { return this.Ak }, function(a) {
  19818. var b = this.Ak;
  19819. b !== a && (v && D.h(a, "number", jh, "maximum"), 0 > a && D.ua(a, ">= 0", jh, "maximum"), this.Ak = a, this.hb = this.Ya, null !== this.R && this.R.K(), this.vd("maximum", b, a))
  19820. });
  19821. D.defineProperty(jh, { alignment: "alignment" }, function() { return this.ue }, function(a) {
  19822. var b = this.ue;
  19823. b.O(a) || (v && D.l(a, S, jh, "alignment"), this.ue = a.V(), null !== this.R && this.R.K(), this.vd("alignment", b, a))
  19824. });
  19825. D.defineProperty(jh, { stretch: "stretch" }, function() { return this.Qg }, function(a) {
  19826. var b = this.Qg;
  19827. b !== a && (v && D.Da(a, O, jh, "stretch"), this.Qg = a, null !== this.R && this.R.K(), this.vd("stretch", b, a))
  19828. });
  19829. D.defineProperty(jh, { aH: "separatorPadding" }, function() { return this.Fk }, function(a) {
  19830. "number" === typeof a ? a = new Lb(a) : null !== a && v && D.l(a, Lb, jh, "separatorPadding");
  19831. var b = this.Fk;
  19832. null !== a && null !== b && b.O(a) || (null !== a && (a = a.V()), this.Fk = a, null !== this.R && this.R.K(), this.vd("separatorPadding", b, a))
  19833. });
  19834. D.defineProperty(jh, { Vq: "separatorStroke" }, function() { return this.Dt }, function(a) {
  19835. var b = this.Dt;
  19836. b !== a && (null === a || "string" === typeof a || a instanceof Ba) && (a instanceof Ba && a.freeze(), this.Dt = a, null !== this.R && this.R.K(), this.vd("separatorStroke", b, a))
  19837. });
  19838. D.defineProperty(jh, { Wq: "separatorStrokeWidth" }, function() { return this.Et }, function(a) {
  19839. var b = this.Et;
  19840. b !== a && (this.Et = a, null !== this.R && this.R.K(), this.vd("separatorStrokeWidth", b, a))
  19841. });
  19842. D.defineProperty(jh, { EM: "separatorDashArray" }, function() { return this.qi }, function(a) {
  19843. var b = this.qi;
  19844. if (b !== a) {
  19845. null === a || Array.isArray(a) || D.kc(a, "Array", jh, "separatorDashArray:value");
  19846. if (null !== a) {
  19847. for (var c = a.length, d = 0, e = 0; e < c; e++) {
  19848. var g = a[e];
  19849. "number" === typeof g && 0 <= g && isFinite(g) || D.k("separatorDashArray value " + g + " at index " + e + " must be a positive number or zero.");
  19850. d += g
  19851. }
  19852. if (0 === d) {
  19853. if (null === b) return;
  19854. a = null
  19855. }
  19856. }
  19857. this.qi = a;
  19858. null !== this.R && this.R.ra();
  19859. this.vd("separatorDashArray", b, a)
  19860. }
  19861. });
  19862. D.defineProperty(jh, { background: "background" }, function() { return this.Mb }, function(a) {
  19863. var b = this.Mb;
  19864. b !== a && (null === a || "string" === typeof a || a instanceof Ba) && (a instanceof Ba && a.freeze(), this.Mb = a, null !== this.R && this.R.ra(), this.vd("background", b, a))
  19865. });
  19866. D.defineProperty(jh, { RA: "coversSeparators" }, function() { return this.Er }, function(a) {
  19867. var b = this.Er;
  19868. b !== a && (D.h(a, "boolean", jh, "coversSeparators"), this.Er = a, null !== this.R && this.R.ra(), this.vd("coversSeparators", b, a))
  19869. });
  19870. D.defineProperty(jh, { qv: "sizing" }, function() { return this.It }, function(a) {
  19871. var b = this.It;
  19872. b !== a && (v && D.Da(a, jh, jh, "sizing"), this.It = a, null !== this.R && this.R.K(), this.vd("sizing", b, a))
  19873. });
  19874. function Up(a) { if (a.qv === nq) { var b = a.rj; return a.Ke ? b.mK : b.jI } return a.qv }
  19875. D.defineProperty(jh, { hb: "actual" }, function() { return this.Ya }, function(a) { this.Ya = isNaN(this.uf) ? Math.max(Math.min(this.Ak, a), this.Bk) : Math.max(Math.min(this.Ak, this.uf), this.Bk) });
  19876. D.defineProperty(jh, { total: "total" }, function() { return this.Ya + this.hf() }, function(a) {
  19877. this.Ya = isNaN(this.uf) ? Math.max(Math.min(this.Ak, a), this.Bk) : Math.max(Math.min(this.Ak, this.uf), this.Bk);
  19878. this.Ya = Math.max(0, this.Ya - this.hf())
  19879. });
  19880. D.defineProperty(jh, { position: "position" }, function() { return this.sb }, function(a) { this.sb = a });
  19881. jh.prototype.bind = jh.prototype.bind = function(a) {
  19882. a.Sg = this;
  19883. var b = this.R;
  19884. if (null !== b) {
  19885. var c = b.qm();
  19886. null !== c && hp(c) && D.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: " + a + " on " + b)
  19887. }
  19888. null === this.Hc && (this.Hc = new K(ph));
  19889. this.Hc.add(a)
  19890. };
  19891. function z() {
  19892. O.call(this);
  19893. this.bg = this.ab = null;
  19894. this.$o = "None";
  19895. this.ds = wo;
  19896. this.Bc = this.Ud = "black";
  19897. this.Rg = 1;
  19898. this.Op = "butt";
  19899. this.Qp = "miter";
  19900. this.xn = 10;
  19901. this.Pp = null;
  19902. this.Hf = 0;
  19903. this.yi = this.xi = Vc;
  19904. this.ft = this.et = NaN;
  19905. this.ns = !1;
  19906. this.ht = null;
  19907. this.cp = this.Vp = "None";
  19908. this.Fg = 1;
  19909. this.Eg = 0;
  19910. this.Dg = 1
  19911. }
  19912. D.Ta(z, O);
  19913. D.ka("Shape", z);
  19914. z.prototype.cloneProtected = function(a) {
  19915. O.prototype.cloneProtected.call(this, a);
  19916. a.ab = this.ab;
  19917. a.$o = this.$o;
  19918. a.ds = this.ds;
  19919. a.bg = this.bg;
  19920. a.Ud = this.Ud;
  19921. a.Bc = this.Bc;
  19922. a.Rg = this.Rg;
  19923. a.Op = this.Op;
  19924. a.Qp = this.Qp;
  19925. a.xn = this.xn;
  19926. null !== this.Pp && (a.Pp = D.km(this.Pp));
  19927. a.Hf = this.Hf;
  19928. a.xi = this.xi.V();
  19929. a.yi = this.yi.V();
  19930. a.et = this.et;
  19931. a.ft = this.ft;
  19932. a.ns = this.ns;
  19933. a.ht = this.ht;
  19934. a.Vp = this.Vp;
  19935. a.cp = this.cp;
  19936. a.Fg = this.Fg;
  19937. a.Eg = this.Eg;
  19938. a.Dg = this.Dg
  19939. };
  19940. z.prototype.qc = function(a) { a === Zj || a === bk || a === ck || a === wo ? this.dB = a : O.prototype.qc.call(this, a) };
  19941. z.prototype.toString = function() { return "Shape(" + ("None" !== this.Kb ? this.Kb : "None" !== this.ar ? this.ar : this.bB) + ")#" + D.Nd(this) };
  19942. function oq(a, b, c, d) {
  19943. var e = c.length;
  19944. if (!(4 > e)) {
  19945. for (var g = d.Fa, h = Math.max(1, g.width), g = g.height, k = c[0], l = c[1], m = 0, n = 0, p = 0, q = 0, r = 0, s = 0, u = q = 0, t = D.mb(), y = 2; y < e; y += 2) m = c[y], n = c[y + 1], p = m - k, q = n - l, 0 === p && (p = .001), r = q / p, s = Math.atan2(q, p), q = Math.sqrt(p * p + q * q), t.push([p, s, r, q]), u += q, k = m, l = n;
  19946. k = c[0];
  19947. l = c[1];
  19948. p = d.Fa.width;
  19949. d instanceof z && (p -= d.lb);
  19950. 1 > p && (p = 1);
  19951. for (var e = c = p, m = h / 2, n = 0 === m ? !1 : !0, y = 0, q = t[y], p = q[0], s = q[1], r = q[2], q = q[3], w = 0; .1 <= u;) {
  19952. 0 === w && (n ? (e = c, e -= m, u -= m, n = !1) : e = c, 0 === e && (e = 1));
  19953. if (e > u) { D.ya(t); return }
  19954. e >
  19955. q ? (w = e - q, e = q) : w = 0;
  19956. var A = Math.sqrt(e * e / (1 + r * r));
  19957. 0 > p && (A = -A);
  19958. k += A;
  19959. l += r * A;
  19960. a.translate(k, l);
  19961. a.rotate(s);
  19962. a.translate(-(h / 2), -(g / 2));
  19963. 0 === w && d.Wk(a, b);
  19964. a.translate(h / 2, g / 2);
  19965. a.rotate(-s);
  19966. a.translate(-k, -l);
  19967. u -= e;
  19968. q -= e;
  19969. if (0 !== w) {
  19970. y++;
  19971. if (y === t.length) { D.ya(t); return }
  19972. q = t[y];
  19973. p = q[0];
  19974. s = q[1];
  19975. r = q[2];
  19976. q = q[3];
  19977. e = w
  19978. }
  19979. }
  19980. D.ya(t)
  19981. }
  19982. }
  19983. z.prototype.Wk = function(a, b) {
  19984. if (null !== this.Bc || null !== this.Ud) {
  19985. null !== this.Ud && Vo(this, a, this.Ud, !0, !1);
  19986. null !== this.Bc && Vo(this, a, this.Bc, !1, !1);
  19987. var c = this.Rg;
  19988. if (0 === c) {
  19989. var d = this.Y;
  19990. d instanceof da && d.type === sj && "Selection" === d.Kd && d.Bb instanceof z && d.If.Ld() === d.Bb && (c = d.Bb.lb)
  19991. }
  19992. a.lineWidth = c;
  19993. a.lineJoin = this.Qp;
  19994. a.lineCap = this.Op;
  19995. a.miterLimit = this.xn;
  19996. var e = !1;
  19997. this.Y && b.Kj("drawShadows") && (e = this.Y.dl);
  19998. var g = !0;
  19999. null !== this.Bc && null === this.Ud && (g = !1);
  20000. var d = !1,
  20001. h = !0,
  20002. k = this.jH;
  20003. null !== k && (d = !0, h = a.YA(k,
  20004. this.Hf));
  20005. var l = this.ab;
  20006. if (null !== l) {
  20007. if (l.da === Ze) a.beginPath(), d && !h ? Go(a, l.Ac, l.Mc, l.Cb, l.Jb, k, this.Hf) : (a.moveTo(l.Ac, l.Mc), a.lineTo(l.Cb, l.Jb)), null !== this.Ud && a.Xg(this.Ud), 0 !== c && null !== this.Bc && a.Zj();
  20008. else if (l.da === tf) {
  20009. var m = l.Ac,
  20010. n = l.Mc,
  20011. p = l.Cb,
  20012. q = l.Jb,
  20013. l = Math.min(m, p),
  20014. r = Math.min(n, q),
  20015. m = Math.abs(p - m),
  20016. n = Math.abs(q - n);
  20017. null !== this.Ud && (a.beginPath(), a.rect(l, r, m, n), a.Xg(this.Ud));
  20018. if (null !== this.Bc) {
  20019. var s = p = 0,
  20020. u = 0;
  20021. g && e && (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY =
  20022. 0, a.shadowBlur = 0);
  20023. d && !h ? (h = D.mb(), h.push(l), h.push(r), h.push(l + m), h.push(r), h.push(l + m), h.push(r + n), h.push(l), h.push(r + n), h.push(l), h.push(r), a.beginPath(), pq(a, h, k, this.Hf), a.Zj(), D.ya(h)) : 0 !== c && (a.beginPath(), a.rect(l, r, m, n), a.Zj());
  20024. g && e && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u)
  20025. }
  20026. } else if (l.da === uf) m = l.Ac, n = l.Mc, p = l.Cb, q = l.Jb, l = Math.abs(p - m) / 2, r = Math.abs(q - n) / 2, m = Math.min(m, p) + l, n = Math.min(n, q) + r, a.beginPath(), a.moveTo(m, n - r), a.bezierCurveTo(m + Jd * l, n - r, m + l, n - Jd * r, m + l, n), a.bezierCurveTo(m +
  20027. l, n + Jd * r, m + Jd * l, n + r, m, n + r), a.bezierCurveTo(m - Jd * l, n + r, m - l, n + Jd * r, m - l, n), a.bezierCurveTo(m - l, n - Jd * r, m - Jd * l, n - r, m, n - r), a.closePath(), null !== this.Ud && a.Xg(this.Ud), d && !h && (h = D.mb(), Be(m, n - r, m + Jd * l, n - r, m + l, n - Jd * r, m + l, n, .5, h), Be(m + l, n, m + l, n + Jd * r, m + Jd * l, n + r, m, n + r, .5, h), Be(m, n + r, m - Jd * l, n + r, m - l, n + Jd * r, m - l, n, .5, h), Be(m - l, n, m - l, n - Jd * r, m - Jd * l, n - r, m, n - r, .5, h), a.beginPath(), pq(a, h, k, this.Hf), D.ya(h)), 0 !== c && null !== this.Bc && (g && e ? (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY =
  20028. 0, a.shadowBlur = 0, a.Zj(), a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u) : a.Zj());
  20029. else if (l.da === We) {
  20030. r = l.jk;
  20031. n = r.length;
  20032. for (q = 0; q < n; q++) {
  20033. m = r.o[q];
  20034. a.beginPath();
  20035. a.moveTo(m.la, m.ja);
  20036. for (var p = m.Eb.o, s = p.length, t = null, u = 0; u < s; u++) {
  20037. var y = p[u];
  20038. switch (y.da) {
  20039. case Ef:
  20040. a.moveTo(y.F, y.G);
  20041. break;
  20042. case wf:
  20043. a.lineTo(y.F, y.G);
  20044. break;
  20045. case Ff:
  20046. a.bezierCurveTo(y.Vd, y.ff, y.Ch, y.Og, y.Cb, y.Jb);
  20047. break;
  20048. case Gf:
  20049. a.quadraticCurveTo(y.Vd, y.ff, y.Cb, y.Jb);
  20050. break;
  20051. case Hf:
  20052. if (y.radiusX === y.radiusY) t = Math.PI / 180, a.arc(y.Vd, y.ff, y.radiusX,
  20053. y.Me * t, (y.Me + y.Df) * t, 0 > y.Df);
  20054. else {
  20055. var t = Vf(y, m),
  20056. w = t.length;
  20057. if (0 === w) { a.lineTo(y.pa, y.va); break }
  20058. for (var A = 0; A < w; A++) {
  20059. var B = t[A];
  20060. 0 === A && a.lineTo(B[0], B[1]);
  20061. a.bezierCurveTo(B[2], B[3], B[4], B[5], B[6], B[7])
  20062. }
  20063. }
  20064. break;
  20065. case If:
  20066. A = w = 0;
  20067. if (null !== t && t.type === Hf) {
  20068. t = Vf(t, m);
  20069. B = t.length;
  20070. if (0 === B) { a.lineTo(y.pa, y.va); break }
  20071. t = t[B - 1] || null;
  20072. null !== t && (w = t[6], A = t[7])
  20073. } else w = null !== t ? t.F : m.la, A = null !== t ? t.G : m.ja;
  20074. t = Wf(y, m, w, A);
  20075. w = t.length;
  20076. if (0 === w) { a.lineTo(y.pa, y.va); break }
  20077. for (A = 0; A < w; A++) B = t[A], a.bezierCurveTo(B[2], B[3],
  20078. B[4], B[5], B[6], B[7]);
  20079. break;
  20080. default:
  20081. D.k("Segment not of valid type: " + y.da)
  20082. }
  20083. y.hi && a.closePath();
  20084. t = y
  20085. }
  20086. e ? (u = s = p = 0, m.mp ? (!0 === m.Xm && null !== this.Ud ? (a.Xg(this.Ud), g = !0) : g = !1, 0 !== c && null !== this.Bc && (g && (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), d && !h || a.Zj(), g && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u))) : (g && (p = a.shadowOffsetX, s = a.shadowOffsetY, u = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), !0 === m.Xm && null !== this.Ud &&
  20087. a.Xg(this.Ud), 0 !== c && null !== this.Bc && (d && !h || a.Zj()), g && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = u))) : (!0 === m.Xm && null !== this.Ud && a.Xg(this.Ud), 0 === c || null === this.Bc || d && !h || a.Zj())
  20088. }
  20089. if (d && !h)
  20090. for (c = g, g = l.jk, h = g.length, l = 0; l < h; l++) {
  20091. r = g.o[l];
  20092. a.beginPath();
  20093. n = D.mb();
  20094. n.push(r.la);
  20095. n.push(r.ja);
  20096. q = r.la;
  20097. m = r.ja;
  20098. p = q;
  20099. s = m;
  20100. u = r.Eb.o;
  20101. y = u.length;
  20102. for (t = 0; t < y; t++) {
  20103. w = u[t];
  20104. switch (w.da) {
  20105. case Ef:
  20106. pq(a, n, k, this.Hf);
  20107. n.length = 0;
  20108. n.push(w.F);
  20109. n.push(w.G);
  20110. q = w.F;
  20111. m = w.G;
  20112. p = q;
  20113. s = m;
  20114. break;
  20115. case wf:
  20116. n.push(w.F);
  20117. n.push(w.G);
  20118. q = w.F;
  20119. m = w.G;
  20120. break;
  20121. case Ff:
  20122. Be(q, m, w.Vd, w.ff, w.Ch, w.Og, w.Cb, w.Jb, .5, n);
  20123. q = w.F;
  20124. m = w.G;
  20125. break;
  20126. case Gf:
  20127. Fe(q, m, w.Vd, w.ff, w.Cb, w.Jb, .5, n);
  20128. q = w.F;
  20129. m = w.G;
  20130. break;
  20131. case Hf:
  20132. A = Vf(w, r);
  20133. B = A.length;
  20134. if (0 === B) {
  20135. n.push(w.pa);
  20136. n.push(w.va);
  20137. q = w.pa;
  20138. m = w.va;
  20139. break
  20140. }
  20141. for (var P = 0; P < B; P++) {
  20142. var H = A[P];
  20143. Be(q, m, H[2], H[3], H[4], H[5], H[6], H[7], .5, n);
  20144. q = H[6];
  20145. m = H[7]
  20146. }
  20147. break;
  20148. case If:
  20149. A = Wf(w, r, q, m);
  20150. B = A.length;
  20151. if (0 === B) {
  20152. n.push(w.pa);
  20153. n.push(w.va);
  20154. q = w.pa;
  20155. m = w.va;
  20156. break
  20157. }
  20158. for (P = 0; P < B; P++) H = A[P], Be(q, m, H[2], H[3], H[4], H[5], H[6], H[7], .5, n), q = H[6], m = H[7];
  20159. break;
  20160. default:
  20161. D.k("Segment not of valid type: " +
  20162. w.da)
  20163. }
  20164. w.hi && (n.push(p), n.push(s), pq(a, n, k, this.Hf))
  20165. }
  20166. pq(a, n, k, this.Hf);
  20167. D.ya(n);
  20168. null !== this.Bc && (q = n = r = 0, c && e && (r = a.shadowOffsetX, n = a.shadowOffsetY, q = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), a.Zj(), c && e && (a.shadowOffsetX = r, a.shadowOffsetY = n, a.shadowBlur = q))
  20169. }
  20170. }
  20171. d && a.TA();
  20172. if (null !== this.By) {
  20173. d = this.By;
  20174. Hk(d, Infinity, Infinity);
  20175. k = d.Fa;
  20176. d.rc(0, 0, k.width, k.height);
  20177. c = this.vf;
  20178. a.save();
  20179. a.beginPath();
  20180. k = D.mb();
  20181. if (c.type === Ze) k.push(c.la), k.push(c.ja), k.push(c.F), k.push(c.G), oq(a, b, k, d);
  20182. else if (c.type ===
  20183. We)
  20184. for (h = c.nc.j; h.next();) {
  20185. l = h.value;
  20186. k.length = 0;
  20187. k.push(l.la);
  20188. k.push(l.ja);
  20189. g = l.la;
  20190. r = l.ja;
  20191. n = g;
  20192. q = r;
  20193. m = l.Eb.o;
  20194. p = m.length;
  20195. for (s = 0; s < p; s++) {
  20196. u = m[s];
  20197. switch (u.da) {
  20198. case Ef:
  20199. oq(a, b, k, d);
  20200. k.length = 0;
  20201. k.push(u.F);
  20202. k.push(u.G);
  20203. g = u.F;
  20204. r = u.G;
  20205. n = g;
  20206. q = r;
  20207. break;
  20208. case wf:
  20209. k.push(u.F);
  20210. k.push(u.G);
  20211. g = u.F;
  20212. r = u.G;
  20213. break;
  20214. case Ff:
  20215. Be(g, r, u.Vd, u.ff, u.Ch, u.Og, u.Cb, u.Jb, .5, k);
  20216. g = u.F;
  20217. r = u.G;
  20218. break;
  20219. case Gf:
  20220. Fe(g, r, u.Vd, u.ff, u.Cb, u.Jb, .5, k);
  20221. g = u.F;
  20222. r = u.G;
  20223. break;
  20224. case Hf:
  20225. c = Vf(u, l);
  20226. e = c.length;
  20227. if (0 === e) {
  20228. k.push(u.pa);
  20229. k.push(u.va);
  20230. g = u.pa;
  20231. r = u.va;
  20232. break
  20233. }
  20234. for (y =
  20235. 0; y < e; y++) t = c[y], Be(g, r, t[2], t[3], t[4], t[5], t[6], t[7], .5, k), g = t[6], r = t[7];
  20236. break;
  20237. case If:
  20238. c = Wf(u, l, g, r);
  20239. e = c.length;
  20240. if (0 === e) {
  20241. k.push(u.pa);
  20242. k.push(u.va);
  20243. g = u.pa;
  20244. r = u.va;
  20245. break
  20246. }
  20247. for (y = 0; y < e; y++) t = c[y], Be(g, r, t[2], t[3], t[4], t[5], t[6], t[7], .5, k), g = t[6], r = t[7];
  20248. break;
  20249. default:
  20250. D.k("Segment not of valid type: " + u.da)
  20251. }
  20252. u.hi && (k.push(n), k.push(q), oq(a, b, k, d))
  20253. }
  20254. oq(a, b, k, d)
  20255. } else if (c.type === tf) k.push(c.la), k.push(c.ja), k.push(c.F), k.push(c.ja), k.push(c.F), k.push(c.G), k.push(c.la), k.push(c.G), k.push(c.la), k.push(c.ja),
  20256. oq(a, b, k, d);
  20257. else if (c.type === uf) {
  20258. h = new Xe;
  20259. h.la = c.F;
  20260. h.ja = (c.ja + c.G) / 2;
  20261. g = new $f(Hf);
  20262. g.Me = 0;
  20263. g.Df = 360;
  20264. g.pa = (c.la + c.F) / 2;
  20265. g.va = (c.ja + c.G) / 2;
  20266. g.radiusX = Math.abs(c.la - c.F) / 2;
  20267. g.radiusY = Math.abs(c.ja - c.G) / 2;
  20268. h.add(g);
  20269. c = Vf(g, h);
  20270. e = c.length;
  20271. if (0 === e) k.push(g.pa), k.push(g.va);
  20272. else
  20273. for (g = h.la, r = h.ja, y = 0; y < e; y++) t = c[y], Be(g, r, t[2], t[3], t[4], t[5], t[6], t[7], .5, k), g = t[6], r = t[7];
  20274. oq(a, b, k, d)
  20275. }
  20276. D.ya(k);
  20277. a.restore();
  20278. a.De(!1)
  20279. }
  20280. }
  20281. }
  20282. };
  20283. function pq(a, b, c, d) {
  20284. var e = b.length;
  20285. if (!(4 > e)) {
  20286. var g = .001,
  20287. h = c.length,
  20288. k = b[0],
  20289. l = b[1];
  20290. if (4 === e) Go(a, k, l, b[2], b[3], c, d);
  20291. else {
  20292. a.moveTo(k, l);
  20293. for (var m = g = 0, n = 0, p = 0, q = 0, r = p = 0, s = D.mb(), u = 2; u < e; u += 2) g = b[u], m = b[u + 1], n = g - k, p = m - l, 0 === n && (n = .001), q = p / n, p = Math.sqrt(n * n + p * p), s.push([n, q, p]), r += p, k = g, l = m;
  20294. k = b[0];
  20295. l = b[1];
  20296. b = 0;
  20297. for (var e = !0, g = c[b % h], m = 0 !== d, u = 0, p = s[u], n = p[0], q = p[1], p = p[2], t = 0; .1 <= r;) {
  20298. 0 === t && (g = c[b % h], b++, m && (d %= g, g -= d, m = !1));
  20299. g > r && (g = r);
  20300. g > p ? (t = g - p, g = p) : t = 0;
  20301. var y = Math.sqrt(g * g / (1 + q * q));
  20302. 0 > n && (y = -y);
  20303. k += y;
  20304. l +=
  20305. q * y;
  20306. e ? a.lineTo(k, l) : a.moveTo(k, l);
  20307. r -= g;
  20308. p -= g;
  20309. if (0 !== t) {
  20310. u++;
  20311. if (u === s.length) { D.ya(s); return }
  20312. p = s[u];
  20313. n = p[0];
  20314. q = p[1];
  20315. p = p[2];
  20316. g = t
  20317. } else e = !e
  20318. }
  20319. D.ya(s)
  20320. }
  20321. }
  20322. }
  20323. z.prototype.getDocumentPoint = z.prototype.fb = function(a, b) {
  20324. void 0 === b && (b = new N);
  20325. if (a instanceof S) {
  20326. a.de() && D.k("getDocumentPoint Spot must be a real, specific Spot, not: " + a.toString());
  20327. var c = this.Ga,
  20328. d = this.lb;
  20329. b.n(a.x * (c.width + d) - d / 2 + c.x + a.offsetX, a.y * (c.height + d) - d / 2 + c.y + a.offsetY)
  20330. } else b.set(a);
  20331. this.Hh.vb(b);
  20332. return b
  20333. };
  20334. z.prototype.Rk = function(a, b) {
  20335. var c = this.vf;
  20336. if (null === c || null === this.fill && null === this.stroke) return !1;
  20337. var d = c.pb,
  20338. e = this.lb / 2;
  20339. c.type !== Ze || b || (e += 2);
  20340. var g = D.Sf();
  20341. g.assign(d);
  20342. g.ig(e + 2, e + 2);
  20343. if (!g.Pa(a)) return D.Lb(g), !1;
  20344. d = e + 1E-4;
  20345. if (c.type === Ze) {
  20346. if (null === this.stroke) return !1;
  20347. d = (c.F - c.la) * (a.x - c.la) + (c.G - c.ja) * (a.y - c.ja);
  20348. if (0 > (c.la - c.F) * (a.x - c.F) + (c.ja - c.G) * (a.y - c.G) || 0 > d) return !1;
  20349. D.Lb(g);
  20350. return qe(c.la, c.ja, c.F, c.G, e, a.x, a.y)
  20351. }
  20352. if (c.type === tf) {
  20353. var h = c.la,
  20354. k = c.ja,
  20355. l = c.F,
  20356. c = c.G;
  20357. g.x = Math.min(h, l);
  20358. g.y = Math.min(k,
  20359. c);
  20360. g.width = Math.abs(l - h);
  20361. g.height = Math.abs(c - k);
  20362. if (null === this.fill) {
  20363. g.ig(-d, -d);
  20364. if (g.Pa(a)) return D.Lb(g), !1;
  20365. g.ig(d, d)
  20366. }
  20367. null !== this.stroke && g.ig(e, e);
  20368. d = g.Pa(a);
  20369. D.Lb(g);
  20370. return d
  20371. }
  20372. if (c.type === uf) {
  20373. var h = c.la,
  20374. k = c.ja,
  20375. l = c.F,
  20376. c = c.G,
  20377. e = Math.min(h, l),
  20378. m = Math.min(k, c),
  20379. h = Math.abs(l - h) / 2,
  20380. k = Math.abs(c - k) / 2,
  20381. e = a.x - (e + h),
  20382. m = a.y - (m + k);
  20383. if (null === this.fill) {
  20384. h -= d;
  20385. k -= d;
  20386. if (0 >= h || 0 >= k || 1 >= e * e / (h * h) + m * m / (k * k)) return D.Lb(g), !1;
  20387. h += d;
  20388. k += d
  20389. }
  20390. null !== this.stroke && (h += d, k += d);
  20391. D.Lb(g);
  20392. return 0 >= h || 0 >= k ? !1 : 1 >= e * e / (h * h) + m * m / (k * k)
  20393. }
  20394. if (c.type ===
  20395. We) return D.Lb(g), null === this.fill ? Yf(c, a.x, a.y, e) : c.Pa(a, e, 1 < this.lb, b);
  20396. D.k("Unknown Geometry type: " + c.type);
  20397. return !1
  20398. };
  20399. z.prototype.ho = function(a, b, c, d) {
  20400. var e = this.Ea,
  20401. g = this.Rg;
  20402. a = Math.max(a, 0);
  20403. b = Math.max(b, 0);
  20404. var h;
  20405. if (null !== this.bg) h = this.vf.pb;
  20406. else {
  20407. var k = this.Kb,
  20408. l = me[k];
  20409. if (void 0 === l) { var m = qq[k]; "string" === typeof m && (m = qq[m]); "function" === typeof m ? (l = m(null, 100, 100), me[k] = l) : D.k("Unsupported Figure: " + k) }
  20410. h = l.pb
  20411. }
  20412. var k = h.width,
  20413. l = h.height,
  20414. m = h.width,
  20415. n = h.height;
  20416. switch (Mo(this, !0)) {
  20417. case Zj:
  20418. d = c = 0;
  20419. break;
  20420. case Ye:
  20421. m = Math.max(a - g, 0);
  20422. n = Math.max(b - g, 0);
  20423. break;
  20424. case yo:
  20425. m = Math.max(a - g, 0);
  20426. d = 0;
  20427. break;
  20428. case xo:
  20429. c = 0, n = Math.max(b - g, 0)
  20430. }
  20431. isFinite(e.width) &&
  20432. (m = e.width);
  20433. isFinite(e.height) && (n = e.height);
  20434. e = this.pf;
  20435. h = this.ah;
  20436. c = Math.max(c, h.width) - g;
  20437. d = Math.max(d, h.height) - g;
  20438. m = Math.min(e.width, m);
  20439. n = Math.min(e.height, n);
  20440. m = isFinite(m) ? Math.max(c, m) : Math.max(k, c);
  20441. n = isFinite(n) ? Math.max(d, n) : Math.max(l, d);
  20442. c = ak(this);
  20443. switch (c) {
  20444. case Zj:
  20445. break;
  20446. case Ye:
  20447. k = m;
  20448. l = n;
  20449. break;
  20450. case bk:
  20451. c = Math.min(m / k, n / l);
  20452. isFinite(c) || (c = 1);
  20453. k *= c;
  20454. l *= c;
  20455. break;
  20456. default:
  20457. D.k(c + " is not a valid geometryStretch.")
  20458. }
  20459. null !== this.bg ? (k = Math.max(k, .01), l = Math.max(l, .01), h = null !== this.bg ? this.bg : this.ab, e = k,
  20460. d = l, c = h.copy(), h = h.pb, e /= h.width, d /= h.height, isFinite(e) || (e = 1), isFinite(d) || (d = 1), 1 === e && 1 === d || c.scale(e, d), v && c.freeze(), this.ab = c) : null !== this.ab && Eb(this.ab.lp, a - g) && Eb(this.ab.jp, b - g) || (this.ab = z.makeGeometry(this, k, l));
  20461. h = this.ab.pb;
  20462. Infinity === a || Infinity === b ? Jo(this, h.x - g / 2, h.y - g / 2, 0 === a && 0 === k ? 0 : h.width + g, 0 === b && 0 === l ? 0 : h.height + g) : Jo(this, -(g / 2), -(g / 2), m + g, n + g)
  20463. };
  20464. function Wp(a, b, c, d) {
  20465. if (!1 !== Nm(a)) {
  20466. a.Fd.Xa();
  20467. var e = a.Rg;
  20468. 0 === e && d instanceof da && d.type === sj && d.Bb instanceof z && (e = d.Bb.lb);
  20469. e *= a.Db;
  20470. d instanceof J && null !== d.ab ? (b = d.ab.pb, Jo(a, b.x - e / 2, b.y - e / 2, b.width + e, b.height + e)) : Jo(a, -(e / 2), -(e / 2), b + e, c + e);
  20471. a.Fd.freeze();
  20472. a.Fd.H() || D.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Fd.toString());
  20473. km(a, !1)
  20474. }
  20475. }
  20476. function ak(a) { var b = a.dB; return null !== a.bg ? b === wo ? Ye : b : b === wo ? me[a.Kb].le : b }
  20477. z.prototype.Cj = function(a, b, c, d) { Oo(this, a, b, c, d) };
  20478. z.prototype.getNearestIntersectionPoint = z.prototype.QF = function(a, b, c) { return this.Tn(a.x, a.y, b.x, b.y, c) };
  20479. z.prototype.Tn = function(a, b, c, d, e) {
  20480. var g = this.transform,
  20481. h = 1 / (g.m11 * g.m22 - g.m12 * g.m21),
  20482. k = g.m22 * h,
  20483. l = -g.m12 * h,
  20484. m = -g.m21 * h,
  20485. n = g.m11 * h,
  20486. p = h * (g.m21 * g.dy - g.m22 * g.dx),
  20487. q = h * (g.m12 * g.dx - g.m11 * g.dy),
  20488. g = a * k + b * m + p,
  20489. h = a * l + b * n + q,
  20490. k = c * k + d * m + p,
  20491. l = c * l + d * n + q,
  20492. m = this.lb / 2,
  20493. p = this.ab;
  20494. null === p && (Hk(this, Infinity, Infinity), p = this.ab);
  20495. q = p.pb;
  20496. n = !1;
  20497. if (p.type === Ze)
  20498. if (1.5 >= this.lb) n = Ie(p.Ac, p.Mc, p.Cb, p.Jb, g, h, k, l, e);
  20499. else {
  20500. var r = 0,
  20501. s = 0;
  20502. p.Ac === p.Cb ? (r = m, s = 0) : (b = (p.Jb - p.Mc) / (p.Cb - p.Ac), s = m / Math.sqrt(1 + b * b), r = s * b);
  20503. d = D.mb();
  20504. b = new N;
  20505. Ie(p.Ac +
  20506. r, p.Mc + s, p.Cb + r, p.Jb + s, g, h, k, l, b) && d.push(b);
  20507. b = new N;
  20508. Ie(p.Ac - r, p.Mc - s, p.Cb - r, p.Jb - s, g, h, k, l, b) && d.push(b);
  20509. b = new N;
  20510. Ie(p.Ac + r, p.Mc + s, p.Ac - r, p.Mc - s, g, h, k, l, b) && d.push(b);
  20511. b = new N;
  20512. Ie(p.Cb + r, p.Jb + s, p.Cb - r, p.Jb - s, g, h, k, l, b) && d.push(b);
  20513. b = d.length;
  20514. if (0 === b) return D.ya(d), !1;
  20515. n = !0;
  20516. s = Infinity;
  20517. for (r = 0; r < b; r++) {
  20518. var k = d[r],
  20519. u = (k.x - g) * (k.x - g) + (k.y - h) * (k.y - h);
  20520. u < s && (s = u, e.x = k.x, e.y = k.y)
  20521. }
  20522. D.ya(d)
  20523. }
  20524. else if (p.type === tf) b = q.x - m, n = Je(b, q.y - m, q.x + q.width + m, q.y + q.height + m, g, h, k, l, e);
  20525. else if (p.type === uf) a: if (b = q.copy().ig(m,
  20526. m), 0 === b.width) n = Ie(b.x, b.y, b.x, b.y + b.height, g, h, k, l, e);
  20527. else if (0 === b.height) n = Ie(b.x, b.y, b.x + b.width, b.y, g, h, k, l, e);
  20528. else {
  20529. a = b.width / 2;
  20530. var t = b.height / 2;
  20531. d = b.x + a;
  20532. b = b.y + t;
  20533. c = 9999;
  20534. g !== k && (c = (h - l) / (g - k));
  20535. if (9999 > Math.abs(c)) {
  20536. n = h - b - c * (g - d);
  20537. if (0 > a * a * c * c + t * t - n * n) {
  20538. e.x = NaN;
  20539. e.y = NaN;
  20540. n = !1;
  20541. break a
  20542. }
  20543. m = Math.sqrt(a * a * c * c + t * t - n * n);
  20544. k = (-(a * a * c * n) + a * t * m) / (t * t + a * a * c * c) + d;
  20545. a = (-(a * a * c * n) - a * t * m) / (t * t + a * a * c * c) + d;
  20546. l = c * (k - d) + n + b;
  20547. b = c * (a - d) + n + b;
  20548. d = Math.abs((g - k) * (g - k)) + Math.abs((h - l) * (h - l));
  20549. h = Math.abs((g - a) * (g - a)) + Math.abs((h - b) * (h -
  20550. b));
  20551. d < h ? (e.x = k, e.y = l) : (e.x = a, e.y = b)
  20552. } else {
  20553. k = t * t;
  20554. l = g - d;
  20555. k -= k / (a * a) * l * l;
  20556. if (0 > k) {
  20557. e.x = NaN;
  20558. e.y = NaN;
  20559. n = !1;
  20560. break a
  20561. }
  20562. m = Math.sqrt(k);
  20563. l = b + m;
  20564. b -= m;
  20565. d = Math.abs(l - h);
  20566. h = Math.abs(b - h);
  20567. d < h ? (e.x = g, e.y = l) : (e.x = g, e.y = b)
  20568. }
  20569. n = !0
  20570. } else if (p.type === We) {
  20571. var y = 0,
  20572. w = 0,
  20573. A = u = 0,
  20574. q = D.P(),
  20575. r = k - g,
  20576. s = l - h,
  20577. s = r * r + s * s;
  20578. e.x = k;
  20579. e.y = l;
  20580. for (r = 0; r < p.nc.count; r++)
  20581. for (var B = p.nc.o[r], P = B.Eb, y = B.la, w = B.ja, H = y, R = w, aa = 0; aa < P.count; aa++) {
  20582. var V = P.o[aa],
  20583. ea = V.type,
  20584. u = V.F,
  20585. A = V.G,
  20586. la = !1;
  20587. switch (ea) {
  20588. case Ef:
  20589. H = u;
  20590. R = A;
  20591. break;
  20592. case wf:
  20593. la = rq(y, w, u, A, g, h, k, l, q);
  20594. break;
  20595. case Ff:
  20596. var la =
  20597. V.Ec,
  20598. ea = V.$c,
  20599. Da = V.Uh,
  20600. La = V.Vh,
  20601. la = Ge(y, w, la, ea, Da, La, u, A, g, h, k, l, .5, q);
  20602. break;
  20603. case Gf:
  20604. la = (y + 2 * V.Ec) / 3;
  20605. ea = (w + 2 * V.$c) / 3;
  20606. Da = (2 * V.Ec + u) / 3;
  20607. La = (2 * V.Ec + u) / 3;
  20608. la = Ge(y, w, la, ea, Da, La, u, A, g, h, k, l, .5, q);
  20609. break;
  20610. case Hf:
  20611. case If:
  20612. ea = V.type === Hf ? Vf(V, B) : Wf(V, B, y, w);
  20613. Da = ea.length;
  20614. if (0 === Da) { la = rq(y, w, V.pa, V.va, g, h, k, l, q); break }
  20615. for (A = 0; A < Da; A++) t = ea[A], 0 === A && rq(y, w, t[0], t[1], g, h, k, l, q) && (u = sq(g, h, q, s, e), u < s && (s = u, n = !0)), Ge(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], g, h, k, l, .5, q) && (u = sq(g, h, q, s, e), u < s && (s = u, n = !0));
  20616. u = t[6];
  20617. A =
  20618. t[7];
  20619. break;
  20620. default:
  20621. D.k("Unknown Segment type: " + ea)
  20622. }
  20623. y = u;
  20624. w = A;
  20625. la && (u = sq(g, h, q, s, e), u < s && (s = u, n = !0));
  20626. V.ey && (u = H, A = R, rq(y, w, u, A, g, h, k, l, q) && (u = sq(g, h, q, s, e), u < s && (s = u, n = !0)))
  20627. }
  20628. g = c - a;
  20629. h = d - b;
  20630. b = Math.sqrt(g * g + h * h);
  20631. 0 !== b && (g /= b, h /= b);
  20632. e.x -= g * m;
  20633. e.y -= h * m;
  20634. D.A(q)
  20635. } else D.k("Unknown Geometry type: " + p.type);
  20636. if (!n) return !1;
  20637. this.transform.vb(e);
  20638. return !0
  20639. };
  20640. function sq(a, b, c, d, e) {
  20641. a = c.x - a;
  20642. b = c.y - b;
  20643. b = a * a + b * b;
  20644. return b < d ? (e.x = c.x, e.y = c.y, b) : d
  20645. }
  20646. function rq(a, b, c, d, e, g, h, k, l) {
  20647. var m = !1,
  20648. n = (e - h) * (b - d) - (g - k) * (a - c);
  20649. if (0 === n) return !1;
  20650. l.x = ((e * k - g * h) * (a - c) - (e - h) * (a * d - b * c)) / n;
  20651. l.y = ((e * k - g * h) * (b - d) - (g - k) * (a * d - b * c)) / n;
  20652. (a > c ? a - c : c - a) < (b > d ? b - d : d - b) ? (e = b < d ? b : d, a = b < d ? d : b, (l.y > e || Eb(l.y, e)) && (l.y < a || Eb(l.y, a)) && (m = !0)) : (e = a < c ? a : c, a = a < c ? c : a, (l.x > e || Eb(l.x, e)) && (l.x < a || Eb(l.x, a)) && (m = !0));
  20653. return m
  20654. }
  20655. z.prototype.containedInRect = z.prototype.In = function(a, b) {
  20656. if (void 0 === b) return a.Sk(this.aa);
  20657. var c = this.ab;
  20658. null === c && (Hk(this, Infinity, Infinity), c = this.ab);
  20659. var c = c.pb,
  20660. d = this.lb / 2,
  20661. e = !1,
  20662. g = D.P();
  20663. g.n(c.x - d, c.y - d);
  20664. a.Pa(b.vb(g)) && (g.n(c.x - d, c.bottom + d), a.Pa(b.vb(g)) && (g.n(c.right + d, c.bottom + d), a.Pa(b.vb(g)) && (g.n(c.right + d, c.y - d), a.Pa(b.vb(g)) && (e = !0))));
  20665. D.A(g);
  20666. return e
  20667. };
  20668. z.prototype.intersectsRect = z.prototype.jg = function(a, b) {
  20669. if (this.In(a, b) || void 0 === b && (b = this.transform, a.Sk(this.aa))) return !0;
  20670. var c = D.hh();
  20671. c.set(b);
  20672. c.pB();
  20673. var d = a.left,
  20674. e = a.right,
  20675. g = a.top,
  20676. h = a.bottom,
  20677. k = D.P();
  20678. k.n(d, g);
  20679. c.vb(k);
  20680. if (this.Rk(k, !0)) return D.A(k), !0;
  20681. k.n(e, g);
  20682. c.vb(k);
  20683. if (this.Rk(k, !0)) return D.A(k), !0;
  20684. k.n(d, h);
  20685. c.vb(k);
  20686. if (this.Rk(k, !0)) return D.A(k), !0;
  20687. k.n(e, h);
  20688. c.vb(k);
  20689. if (this.Rk(k, !0)) return D.A(k), !0;
  20690. var l = D.P(),
  20691. m = D.P();
  20692. c.set(b);
  20693. c.GB(this.transform);
  20694. c.pB();
  20695. l.x = e;
  20696. l.y = g;
  20697. l.transform(c);
  20698. k.x = d;
  20699. k.y =
  20700. g;
  20701. k.transform(c);
  20702. var n = !1;
  20703. tq(this, k, l, m) ? n = !0 : (k.x = e, k.y = h, k.transform(c), tq(this, k, l, m) ? n = !0 : (l.x = d, l.y = h, l.transform(c), tq(this, k, l, m) ? n = !0 : (k.x = d, k.y = g, k.transform(c), tq(this, k, l, m) && (n = !0))));
  20704. D.A(k);
  20705. D.lf(c);
  20706. D.A(l);
  20707. D.A(m);
  20708. return n
  20709. };
  20710. function tq(a, b, c, d) {
  20711. if (!a.QF(b, c, d)) return !1;
  20712. a = b.x;
  20713. b = b.y;
  20714. var e = c.x;
  20715. c = c.y;
  20716. var g = d.x;
  20717. d = d.y;
  20718. if (a === e) {
  20719. var h = 0;
  20720. a = 0;
  20721. b < c ? (h = b, a = c) : (h = c, a = b);
  20722. return d >= h && d <= a
  20723. }
  20724. a < e ? (h = a, a = e) : h = e;
  20725. return g >= h && g <= a
  20726. }
  20727. z.prototype.JF = function(a, b, c) {
  20728. function d(a, b) {
  20729. for (var c = a.length, d = 0; d < c; d += 2)
  20730. if (b.mq(a[d], a[d + 1]) > e) return !0;
  20731. return !1
  20732. }
  20733. if (c && null !== this.fill && this.Rk(a, !0)) return !0;
  20734. var e = a.Kf(b);
  20735. b = e;
  20736. 1.5 < this.lb && (e = this.lb / 2 + Math.sqrt(e), e *= e);
  20737. var g = this.ab;
  20738. if (null === g && (Hk(this, Infinity, Infinity), g = this.ab, null === g)) return !1;
  20739. if (!c) {
  20740. var h = g.pb,
  20741. k = h.x,
  20742. l = h.y,
  20743. m = h.x + h.width,
  20744. h = h.y + h.height;
  20745. if (ob(a.x, a.y, k, l) <= e && ob(a.x, a.y, m, l) <= e && ob(a.x, a.y, k, h) <= e && ob(a.x, a.y, m, h) <= e) return !0
  20746. }
  20747. k = g.Ac;
  20748. l = g.Mc;
  20749. m = g.Cb;
  20750. h = g.Jb;
  20751. if (g.type ===
  20752. Ze) { if (c = lb(a.x, a.y, k, l, m, h), g = (k - m) * (a.x - m) + (l - h) * (a.y - h), c <= (0 <= (m - k) * (a.x - k) + (h - l) * (a.y - l) && 0 <= g ? e : b)) return !0 } else {
  20753. if (g.type === tf) return b = !1, c && (b = lb(a.x, a.y, k, l, k, h) <= e || lb(a.x, a.y, k, l, m, l) <= e || lb(a.x, a.y, m, l, m, h) <= e || lb(a.x, a.y, k, h, m, h) <= e), b;
  20754. if (g.type === uf) {
  20755. b = a.x - (k + m) / 2;
  20756. var g = a.y - (l + h) / 2,
  20757. n = Math.abs(m - k) / 2,
  20758. p = Math.abs(h - l) / 2;
  20759. if (0 === n || 0 === p) return c = lb(a.x, a.y, k, l, m, h), c <= e ? !0 : !1;
  20760. if (c) { if (a = Ue(n, p, b, g), a * a <= e) return !0 } else return ob(b, g, -n, 0) >= e || ob(b, g, 0, -p) >= e || ob(b, g, 0, p) >= e || ob(b, g, n, 0) >=
  20761. e ? !1 : !0
  20762. } else if (g.type === We) {
  20763. h = g.pb;
  20764. k = h.x;
  20765. l = h.y;
  20766. m = h.x + h.width;
  20767. h = h.y + h.height;
  20768. if (a.x > m && a.x < k && a.y > h && a.y < l && lb(a.x, a.y, k, l, k, h) > e && lb(a.x, a.y, k, l, m, l) > e && lb(a.x, a.y, m, h, k, h) > e && lb(a.x, a.y, m, h, m, l) > e) return !1;
  20769. b = Math.sqrt(e);
  20770. if (c) { if (null === this.fill ? Yf(g, a.x, a.y, b) : g.Pa(a, b, !0)) return !0 } else {
  20771. c = g.nc;
  20772. for (b = 0; b < c.count; b++) {
  20773. k = c.o[b];
  20774. n = k.la;
  20775. p = k.ja;
  20776. if (a.mq(n, p) > e) return !1;
  20777. l = k.Eb.o;
  20778. m = l.length;
  20779. for (h = 0; h < m; h++) {
  20780. var q = l[h];
  20781. switch (q.type) {
  20782. case Ef:
  20783. case wf:
  20784. n = q.F;
  20785. p = q.G;
  20786. if (a.mq(n, p) > e) return !1;
  20787. break;
  20788. case Ff:
  20789. g = D.mb();
  20790. Be(n, p, q.Ec, q.$c, q.Uh, q.Vh, q.F, q.G, .8, g);
  20791. n = d(g, a);
  20792. D.ya(g);
  20793. if (n) return !1;
  20794. n = q.F;
  20795. p = q.G;
  20796. if (a.mq(n, p) > e) return !1;
  20797. break;
  20798. case Gf:
  20799. g = D.mb();
  20800. Fe(n, p, q.Ec, q.$c, q.F, q.G, .8, g);
  20801. n = d(g, a);
  20802. D.ya(g);
  20803. if (n) return !1;
  20804. n = q.F;
  20805. p = q.G;
  20806. if (a.mq(n, p) > e) return !1;
  20807. break;
  20808. case Hf:
  20809. case If:
  20810. var r = q.type === Hf ? Vf(q, k) : Wf(q, k, n, p),
  20811. s = r.length;
  20812. if (0 === s) {
  20813. n = q.pa;
  20814. p = q.va;
  20815. if (a.mq(n, p) > e) return !1;
  20816. break
  20817. }
  20818. q = null;
  20819. g = D.mb();
  20820. for (b = 0; b < s; b++)
  20821. if (q = r[b], g.length = 0, Be(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7], .8, g), d(g, a)) return D.ya(g), !1;
  20822. D.ya(g);
  20823. null !== q && (n =
  20824. q[6], p = q[7]);
  20825. break;
  20826. default:
  20827. D.k("Unknown Segment type: " + q.type)
  20828. }
  20829. }
  20830. }
  20831. return !0
  20832. }
  20833. }
  20834. }
  20835. return !1
  20836. };
  20837. D.defineProperty(z, { vf: "geometry" }, function() { return null !== this.ab ? this.ab : this.bg }, function(a) {
  20838. var b = this.ab;
  20839. if (b !== a) {
  20840. null !== a ? (v && D.l(a, Ve, z, "geometry"), this.bg = this.ab = a.freeze()) : this.bg = this.ab = null;
  20841. var c = this.Y;
  20842. null !== c && (c.zk = NaN);
  20843. this.K();
  20844. this.i("geometry", b, a);
  20845. Ho(this) && (a = this.Y, null !== a && Io(this, a, "geometryString"))
  20846. }
  20847. });
  20848. D.defineProperty(z, { SI: "geometryString" }, function() { return null === this.vf ? "" : this.vf.toString() }, function(a) {
  20849. a = yf(a);
  20850. var b = a.normalize();
  20851. this.vf = a;
  20852. this.position = a = D.Fb(-b.x, -b.y);
  20853. D.A(a)
  20854. });
  20855. D.defineProperty(z, { hG: "isGeometryPositioned" }, function() { return this.ns }, function(a) {
  20856. v && D.h(a, "boolean", z, "isGeometryPositioned");
  20857. var b = this.ns;
  20858. b !== a && (this.ns = a, this.K(), this.i("isGeometryPositioned", b, a))
  20859. });
  20860. z.prototype.Te = function() { this.ab = null };
  20861. D.defineProperty(z, { fill: "fill" }, function() { return this.Ud }, function(a) {
  20862. var b = this.Ud;
  20863. b !== a && (v && null !== a && D.hu(a, "Shape.fill"), a instanceof Ba && a.freeze(), this.Ud = a, this.ra(), this.i("fill", b, a))
  20864. });
  20865. D.defineProperty(z, { stroke: "stroke" }, function() { return this.Bc }, function(a) {
  20866. var b = this.Bc;
  20867. b !== a && (v && null !== a && D.hu(a, "Shape.stroke"), a instanceof Ba && a.freeze(), this.Bc = a, this.ra(), this.i("stroke", b, a))
  20868. });
  20869. D.defineProperty(z, { lb: "strokeWidth" }, function() { return this.Rg }, function(a) {
  20870. var b = this.Rg;
  20871. if (b !== a)
  20872. if (v && D.p(a, z, "strokeWidth"), 0 <= a) {
  20873. this.Rg = a;
  20874. this.K();
  20875. var c = this.Y;
  20876. null !== c && (c.zk = NaN);
  20877. this.i("strokeWidth", b, a)
  20878. } else D.ua(a, "value >= 0", z, "strokeWidth:value")
  20879. });
  20880. D.defineProperty(z, { JM: "strokeCap" }, function() { return this.Op }, function(a) {
  20881. var b = this.Op;
  20882. b !== a && ("string" !== typeof a || "butt" !== a && "round" !== a && "square" !== a ? D.ua(a, '"butt", "round", or "square"', z, "strokeCap") : (this.Op = a, this.ra(), this.i("strokeCap", b, a)))
  20883. });
  20884. D.defineProperty(z, { LM: "strokeJoin" }, function() { return this.Qp }, function(a) {
  20885. var b = this.Qp;
  20886. b !== a && ("string" !== typeof a || "miter" !== a && "bevel" !== a && "round" !== a ? D.ua(a, '"miter", "bevel", or "round"', z, "strokeJoin") : (this.Qp = a, this.ra(), this.i("strokeJoin", b, a)))
  20887. });
  20888. D.defineProperty(z, { MM: "strokeMiterLimit" }, function() { return this.xn }, function(a) {
  20889. var b = this.xn;
  20890. if (b !== a)
  20891. if (v && D.p(a, z, "strokeMiterLimit"), 1 <= a) {
  20892. this.xn = a;
  20893. this.ra();
  20894. var c = this.Y;
  20895. null !== c && (c.zk = NaN);
  20896. this.i("strokeMiterLimit", b, a)
  20897. } else D.ua(a, "value >= 1", z, "strokeWidth:value")
  20898. });
  20899. D.defineProperty(z, { jH: "strokeDashArray" }, function() { return this.Pp }, function(a) {
  20900. var b = this.Pp;
  20901. if (b !== a) {
  20902. null === a || Array.isArray(a) || D.kc(a, "Array", z, "strokeDashArray:value");
  20903. if (null !== a) {
  20904. for (var c = a.length, d = 0, e = 0; e < c; e++) {
  20905. var g = a[e];
  20906. "number" === typeof g && 0 <= g && isFinite(g) || D.k("strokeDashArray:value " + g + " at index " + e + " must be a positive number or zero.");
  20907. d += g
  20908. }
  20909. if (0 === d) {
  20910. if (null === b) return;
  20911. a = null
  20912. }
  20913. }
  20914. this.Pp = a;
  20915. this.ra();
  20916. this.i("strokeDashArray", b, a)
  20917. }
  20918. });
  20919. D.defineProperty(z, { KM: "strokeDashOffset" }, function() { return this.Hf }, function(a) {
  20920. var b = this.Hf;
  20921. b !== a && (v && D.p(a, z, "strokeDashOffset"), 0 <= a && (this.Hf = a, this.ra(), this.i("strokeDashOffset", b, a)))
  20922. });
  20923. D.defineProperty(z, { Kb: "figure" }, function() { return this.$o }, function(a) {
  20924. var b = this.$o;
  20925. if (b !== a) {
  20926. v && D.h(a, "string", z, "figure");
  20927. var c = qq[a];
  20928. "function" === typeof c ? c = a : (c = qq[a.toLowerCase()]) || D.k("Unknown Shape.figure: " + a);
  20929. b !== c && (a = this.Y, null !== a && (a.zk = NaN), this.$o = c, this.bg = null, this.Te(), this.K(), this.i("figure", b, c))
  20930. }
  20931. });
  20932. D.defineProperty(z, { ar: "toArrow" }, function() { return this.Vp }, function(a) {
  20933. var b = this.Vp;
  20934. !0 === a ? a = "Standard" : !1 === a && (a = "");
  20935. if (b !== a) {
  20936. v && D.h(a, "string", z, "toArrow");
  20937. var c = uq(a);
  20938. null === c ? D.k("Unknown Shape.toArrow: " + a) : b !== c && (this.Vp = c, this.bg = null, this.Te(), this.K(), vq(this), this.i("toArrow", b, c))
  20939. }
  20940. });
  20941. D.defineProperty(z, { bB: "fromArrow" }, function() { return this.cp }, function(a) {
  20942. var b = this.cp;
  20943. !0 === a ? a = "Standard" : !1 === a && (a = "");
  20944. if (b !== a) {
  20945. v && D.h(a, "string", z, "fromArrow");
  20946. var c = uq(a);
  20947. null === c ? D.k("Unknown Shape.fromArrow: " + a) : b !== c && (this.cp = c, this.bg = null, this.Te(), this.K(), vq(this), this.i("fromArrow", b, c))
  20948. }
  20949. });
  20950. function vq(a) {
  20951. var b = a.g;
  20952. null !== b && b.na.ub || (a.Uq = wq, "None" !== a.Vp ? (a.We = -1, a.Gh = fd) : "None" !== a.cp && (a.We = 0, a.Gh = new S(1 - fd.x, fd.y)))
  20953. }
  20954. D.defineProperty(z, { C: "spot1" }, function() { return this.xi }, function(a) {
  20955. D.l(a, S, z, "spot1");
  20956. var b = this.xi;
  20957. b.O(a) || (this.xi = a = a.V(), this.K(), this.i("spot1", b, a))
  20958. });
  20959. D.defineProperty(z, { D: "spot2" }, function() { return this.yi }, function(a) {
  20960. D.l(a, S, z, "spot2");
  20961. var b = this.yi;
  20962. b.O(a) || (this.yi = a = a.V(), this.K(), this.i("spot2", b, a))
  20963. });
  20964. D.defineProperty(z, { Sc: "parameter1" }, function() { return this.et }, function(a) {
  20965. var b = this.et;
  20966. b !== a && (this.et = a, this.Te(), this.K(), this.i("parameter1", b, a))
  20967. });
  20968. D.defineProperty(z, { ev: "parameter2" }, function() { return this.ft }, function(a) {
  20969. var b = this.ft;
  20970. b !== a && (this.ft = a, this.Te(), this.K(), this.i("parameter2", b, a))
  20971. });
  20972. D.w(z, { Ga: "naturalBounds" }, function() { if (null !== this.ab) return this.fd.assign(this.ab.pb), this.fd; var a = this.Ea; return new C(0, 0, a.width, a.height) });
  20973. D.defineProperty(z, { By: "pathPattern" }, function() { return this.ht }, function(a) {
  20974. var b = this.ht;
  20975. b !== a && (v && D.l(a, O, z, "pathPattern"), this.ht = a, this.ra(), this.i("pathPattern", b, a))
  20976. });
  20977. D.defineProperty(z, { yM: "pathObject" }, function() { return this.By }, function(a) { this.By = a });
  20978. D.defineProperty(z, { dB: "geometryStretch" }, function() { return this.ds }, function(a) {
  20979. var b = this.ds;
  20980. b !== a && (D.Da(a, O, z, "geometryStretch"), this.ds = a, this.i("geometryStretch", b, a))
  20981. });
  20982. D.defineProperty(z, { interval: "interval" }, function() { return this.Fg }, function(a) {
  20983. var b = this.Fg;
  20984. v && D.p(a, z, "interval");
  20985. a = Math.floor(a);
  20986. if (b !== a && 0 <= a) {
  20987. this.Fg = a;
  20988. var c = this.g;
  20989. null !== c && this.R === c.Vn && lm(c);
  20990. this.K();
  20991. c = this.R;
  20992. null !== c && c.type === pp && (c.pk = null);
  20993. this.i("interval", b, a)
  20994. }
  20995. });
  20996. D.defineProperty(z, { UF: "graduatedStart" }, function() { return this.Eg }, function(a) {
  20997. var b = this.Eg;
  20998. v && D.p(a, z, "graduatedStart");
  20999. b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.Eg = a, this.K(), this.i("graduatedStart", b, a))
  21000. });
  21001. D.defineProperty(z, { SF: "graduatedEnd" }, function() { return this.Dg }, function(a) {
  21002. var b = this.Dg;
  21003. v && D.p(a, z, "graduatedEnd");
  21004. b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.Dg = a, this.K(), this.i("graduatedEnd", b, a))
  21005. });
  21006. z.makeGeometry = function(a, b, c) {
  21007. var d = null;
  21008. if ("None" !== a.ar) d = ne[a.ar];
  21009. else if ("None" !== a.bB) d = ne[a.bB];
  21010. else {
  21011. var e = qq[a.Kb];
  21012. "string" === typeof e && (e = qq[e]);
  21013. void 0 === e && D.k("Unknown Shape.figure: " + a.Kb);
  21014. d = e(a, b, c);
  21015. d.lp = b;
  21016. d.jp = c
  21017. }
  21018. null === d && (e = qq.Rectangle, "function" === typeof e && (d = e(a, b, c)));
  21019. return d
  21020. };
  21021. z.getFigureGenerators = function() {
  21022. var a = new oa("string", "function"),
  21023. b;
  21024. for (b in qq)
  21025. if (b !== b.toLowerCase()) { var c = qq[b]; "function" === typeof c && a.add(b, c) }
  21026. a.freeze();
  21027. return a
  21028. };
  21029. z.defineFigureGenerator = function(a, b) {
  21030. D.h(a, "string", z, "defineFigureGenerator:name");
  21031. "string" === typeof b ? "" !== b && qq[b] || D.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: " + b) : D.h(b, "function", z, "defineFigureGenerator:func");
  21032. var c = a.toLowerCase();
  21033. "" !== a && "none" !== c && a !== c || D.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a);
  21034. qq[a] = b;
  21035. qq[c] = a
  21036. };
  21037. z.getArrowheadGeometries = function() {
  21038. var a = new oa("string", Ve),
  21039. b;
  21040. for (b in xq)
  21041. if (void 0 === ne[b]) {
  21042. var c = yf(xq[b], !1);
  21043. ne[b] = c;
  21044. c = b.toLowerCase();
  21045. c !== b && (ne[c] = b)
  21046. }
  21047. for (b in ne) b !== b.toLowerCase() && (c = ne[b], c instanceof Ve && a.add(b, c));
  21048. a.freeze();
  21049. return a
  21050. };
  21051. z.defineArrowheadGeometry = function(a, b) {
  21052. D.h(a, "string", z, "defineArrowheadGeometry:name");
  21053. var c = null;
  21054. "string" === typeof b ? (D.h(b, "string", z, "defineArrowheadGeometry:pathstr"), c = yf(b, !1)) : (D.l(b, Ve, z, "defineArrowheadGeometry:pathstr"), c = b);
  21055. var d = a.toLowerCase();
  21056. "" !== a && "none" !== d && a !== d || D.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: " + a);
  21057. ne[a] = c;
  21058. ne[d] = a
  21059. };
  21060. function pa() {
  21061. O.call(this);
  21062. this.Yd = "";
  21063. this.Bc = "black";
  21064. this.Bg = "13px sans-serif";
  21065. this.Yl = "start";
  21066. this.Ag = Zj;
  21067. this.bm = Yc;
  21068. this.Ym = !0;
  21069. this.tk = this.vk = !1;
  21070. this.pj = yq;
  21071. this.Aj = zq;
  21072. this.Cw = this.xe = 0;
  21073. this.bA = this.cA = null;
  21074. this.sf = new bq;
  21075. this.Xr = !1;
  21076. this.bf = this.ur = this.Qt = this.Zl = this.Rt = null;
  21077. this.wi = this.vi = 0;
  21078. this.wh = Infinity;
  21079. this.rp = 0;
  21080. this.Fg = 1;
  21081. this.Eg = 0;
  21082. this.Dg = 1;
  21083. this.Um = null
  21084. }
  21085. D.Ta(pa, O);
  21086. D.ka("TextBlock", pa);
  21087. var Aq = /[ \u200b\u00ad]/;
  21088. pa.prototype.cloneProtected = function(a) {
  21089. O.prototype.cloneProtected.call(this, a);
  21090. a.Yd = this.Yd;
  21091. a.Bc = this.Bc;
  21092. a.Bg = this.Bg;
  21093. a.Yl = this.Yl;
  21094. a.Ag = this.Ag;
  21095. a.bm = this.bm;
  21096. a.Ym = this.Ym;
  21097. a.vk = this.vk;
  21098. a.tk = this.tk;
  21099. a.pj = this.pj;
  21100. a.Aj = this.Aj;
  21101. a.xe = this.xe;
  21102. a.Cw = this.Cw;
  21103. a.cA = this.cA;
  21104. a.bA = this.bA;
  21105. a.sf.gq(this.sf);
  21106. a.Xr = this.Xr;
  21107. a.Rt = this.Rt;
  21108. a.Zl = this.Zl;
  21109. a.Qt = this.Qt;
  21110. a.ur = this.ur;
  21111. a.bf = this.bf;
  21112. a.vi = this.vi;
  21113. a.wi = this.wi;
  21114. a.wh = this.wh;
  21115. a.rp = this.rp;
  21116. a.Fg = this.Fg;
  21117. a.Eg = this.Eg;
  21118. a.Dg = this.Dg;
  21119. a.Um = this.Um
  21120. };
  21121. pa.prototype.qc = function(a) { a.Qe === pa ? this.yH = a : O.prototype.qc.call(this, a) };
  21122. pa.prototype.toString = function() { return 22 < this.Yd.length ? 'TextBlock("' + this.Yd.substring(0, 20) + '"...)' : 'TextBlock("' + this.Yd + '")' };
  21123. var Bq = new ma,
  21124. Cq = 0,
  21125. Dq = new ma,
  21126. Eq = 0,
  21127. Fq = "...",
  21128. Gq = "",
  21129. Hq = (new ja(null)).Tk;
  21130. pa.getEllipsis = function() { return Fq };
  21131. pa.setEllipsis = function(a) {
  21132. Fq = a;
  21133. Dq = new ma;
  21134. Eq = 0
  21135. };
  21136. var Iq;
  21137. pa.None = Iq = D.s(pa, "None", 0);
  21138. var Jq;
  21139. pa.WrapFit = Jq = D.s(pa, "WrapFit", 1);
  21140. var zq;
  21141. pa.WrapDesiredSize = zq = D.s(pa, "WrapDesiredSize", 2);
  21142. var Kq;
  21143. pa.WrapBreakAll = Kq = D.s(pa, "WrapBreakAll", 3);
  21144. var yq;
  21145. pa.OverflowClip = yq = D.s(pa, "OverflowClip", 0);
  21146. var Lq;
  21147. pa.OverflowEllipsis = Lq = D.s(pa, "OverflowEllipsis", 1);
  21148. pa.prototype.K = function() {
  21149. O.prototype.K.call(this);
  21150. this.bA = this.cA = null
  21151. };
  21152. D.defineProperty(pa, { font: "font" }, function() { return this.Bg }, function(a) {
  21153. var b = this.Bg;
  21154. b !== a && (v && (D.h(a, "string", pa, "font"), Mq(a) || D.k('Not a valid font: "' + a + '"')), this.Bg = a, this.sf.kk = null, this.K(), this.i("font", b, a))
  21155. });
  21156. var Mq;
  21157. pa.isValidFont = Mq = function(a) {
  21158. var b = Hq.font;
  21159. if (a === b || "10px sans-serif" === a) return !0;
  21160. Hq.font = "10px sans-serif";
  21161. var c;
  21162. Hq.font = a;
  21163. var d = Hq.font;
  21164. if ("10px sans-serif" !== d) return Hq.font = b, !0;
  21165. Hq.font = "19px serif";
  21166. c = Hq.font;
  21167. Hq.font = a;
  21168. d = Hq.font;
  21169. Hq.font = b;
  21170. return d !== c
  21171. };
  21172. D.defineProperty(pa, { text: "text" }, function() { return this.Yd }, function(a) {
  21173. var b = this.Yd;
  21174. a = null !== a && void 0 !== a ? a.toString() : "";
  21175. b !== a && (this.Yd = a, this.K(), this.i("text", b, a))
  21176. });
  21177. D.defineProperty(pa, { textAlign: "textAlign" }, function() { return this.Yl }, function(a) {
  21178. var b = this.Yl;
  21179. b !== a && (v && D.h(a, "string", pa, "textAlign"), "start" === a || "end" === a || "left" === a || "right" === a || "center" === a ? (this.Yl = a, this.ra(), this.i("textAlign", b, a)) : D.ua(a, '"start", "end", "left", "right", or "center"', pa, "textAlign"))
  21180. });
  21181. D.defineProperty(pa, { wu: "flip" }, function() { return this.Ag }, function(a) {
  21182. var b = this.Ag;
  21183. b !== a && (D.Da(a, O, pa, "flip"), this.Ag = a, this.ra(), this.i("flip", b, a))
  21184. });
  21185. D.defineProperty(pa, { RM: "verticalAlignment" }, function() { return this.bm }, function(a) {
  21186. var b = this.bm;
  21187. b.O(a) || (v && D.l(a, S, pa, "verticalAlignment"), a.de() && D.k("TextBlock.verticalAlignment for " + this + " must be a real Spot, not:" + a), this.bm = a = a.V(), Zo(this), this.i("verticalAlignment", b, a))
  21188. });
  21189. D.w(pa, { Ga: "naturalBounds" }, function() {
  21190. if (!this.fd.H()) {
  21191. var a = Nq(this, this.Yd, this.sf, 999999).width,
  21192. b = Oq(this, a, this.sf),
  21193. c = this.Ea;
  21194. isNaN(c.width) || (a = c.width);
  21195. isNaN(c.height) || (b = c.height);
  21196. Cb(this.fd, a, b)
  21197. }
  21198. return this.fd
  21199. });
  21200. D.defineProperty(pa, { ky: "isMultiline" }, function() { return this.Ym }, function(a) {
  21201. var b = this.Ym;
  21202. b !== a && (v && D.h(a, "boolean", pa, "isMultiline"), this.Ym = a, this.K(), this.i("isMultiline", b, a))
  21203. });
  21204. D.defineProperty(pa, { YL: "isUnderline" }, function() { return this.vk }, function(a) {
  21205. var b = this.vk;
  21206. b !== a && (v && D.h(a, "boolean", pa, "isUnderline"), this.vk = a, this.ra(), this.i("isUnderline", b, a))
  21207. });
  21208. D.defineProperty(pa, { XL: "isStrikethrough" }, function() { return this.tk }, function(a) {
  21209. var b = this.tk;
  21210. b !== a && (v && D.h(a, "boolean", pa, "isStrikethrough"), this.tk = a, this.ra(), this.i("isStrikethrough", b, a))
  21211. });
  21212. D.defineProperty(pa, { yH: "wrap" }, function() { return this.Aj }, function(a) {
  21213. var b = this.Aj;
  21214. b !== a && (v && D.Da(a, pa, pa, "wrap"), this.Aj = a, this.K(), this.i("wrap", b, a))
  21215. });
  21216. D.defineProperty(pa, { overflow: "overflow" }, function() { return this.pj }, function(a) {
  21217. var b = this.pj;
  21218. b !== a && (v && D.Da(a, pa, pa, "overflow"), this.pj = a, this.K(), this.i("overflow", b, a))
  21219. });
  21220. D.defineProperty(pa, { stroke: "stroke" }, function() { return this.Bc }, function(a) {
  21221. var b = this.Bc;
  21222. b !== a && (v && null !== a && D.hu(a, "TextBlock.stroke"), a instanceof Ba && a.freeze(), this.Bc = a, this.ra(), this.i("stroke", b, a))
  21223. });
  21224. D.w(pa, { wB: "lineCount" }, function() { return this.xe });
  21225. D.defineProperty(pa, { XA: "editable" }, function() { return this.Xr }, function(a) {
  21226. var b = this.Xr;
  21227. b !== a && (v && D.h(a, "boolean", pa, "editable"), this.Xr = a, this.i("editable", b, a))
  21228. });
  21229. D.defineProperty(pa, { mH: "textEditor" }, function() { return this.Rt }, function(a) {
  21230. var b = this.Rt;
  21231. b !== a && (!v || a instanceof HTMLElement || a instanceof hk || D.k("TextEditingTool.defaultTextEditor must be an HTMLElement or HTMLInfo."), this.Rt = a, this.i("textEditor", b, a))
  21232. });
  21233. D.defineProperty(pa, { ZA: "errorFunction" }, function() { return this.bf }, function(a) {
  21234. var b = this.bf;
  21235. b !== a && (null !== a && D.h(a, "function", pa, "errorFunction"), this.bf = a, this.i("errorFunction", b, a))
  21236. });
  21237. D.defineProperty(pa, { interval: "interval" }, function() { return this.Fg }, function(a) {
  21238. var b = this.Fg;
  21239. v && D.p(a, pa, "interval");
  21240. a = Math.floor(a);
  21241. if (b !== a && 0 <= a) {
  21242. this.Fg = a;
  21243. this.K();
  21244. var c = this.R;
  21245. null !== c && c.type === pp && (c.pk = null);
  21246. this.i("interval", b, a)
  21247. }
  21248. });
  21249. D.defineProperty(pa, { UF: "graduatedStart" }, function() { return this.Eg }, function(a) {
  21250. var b = this.Eg;
  21251. v && D.p(a, pa, "graduatedStart");
  21252. b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.Eg = a, this.K(), this.i("graduatedStart", b, a))
  21253. });
  21254. D.defineProperty(pa, { SF: "graduatedEnd" }, function() { return this.Dg }, function(a) {
  21255. var b = this.Dg;
  21256. v && D.p(a, pa, "graduatedEnd");
  21257. b !== a && (0 > a ? a = 0 : 1 < a && (a = 1), this.Dg = a, this.K(), this.i("graduatedEnd", b, a))
  21258. });
  21259. D.defineProperty(pa, { TF: "graduatedFunction" }, function() { return this.Um }, function(a) {
  21260. var b = this.Um;
  21261. b !== a && (null !== a && D.h(a, "function", pa, "graduatedFunction"), this.Um = a, this.K(), this.i("graduatedFunction", b, a))
  21262. });
  21263. pa.prototype.Wk = function(a, b) {
  21264. if (null !== this.Bc && 0 !== this.Yd.length && null !== this.Bg) {
  21265. var c = this.Ga.width,
  21266. d = this.Ga.height,
  21267. e = Pq(this),
  21268. g = a.textAlign = this.Yl,
  21269. h = b.rs;
  21270. "start" === g && (g = h ? "right" : "left");
  21271. "end" === g && (g = h ? "left" : "right");
  21272. Vo(this, a, this.Bc, !0, !1);
  21273. (this.vk || this.tk) && Vo(this, a, this.Bc, !1, !1);
  21274. var k = 0,
  21275. h = !1,
  21276. l = D.Fb(0, 0);
  21277. this.Hh.vb(l);
  21278. var m = D.Fb(0, e);
  21279. this.Hh.vb(m);
  21280. var n = l.Kf(m);
  21281. D.A(l);
  21282. D.A(m);
  21283. l = b.scale;
  21284. 8 > n * l * l && (h = !0);
  21285. b.dd !== a && (h = !1);
  21286. !1 === b.Kj("textGreeking") && (h = !1);
  21287. n = this.vi;
  21288. l = this.wi;
  21289. switch (this.wu) {
  21290. case Ao:
  21291. a.translate(c,
  21292. 0);
  21293. a.scale(-1, 1);
  21294. break;
  21295. case zo:
  21296. a.translate(0, d);
  21297. a.scale(1, -1);
  21298. break;
  21299. case Bo:
  21300. a.translate(c, d), a.scale(-1, -1)
  21301. }
  21302. var m = this.xe,
  21303. p = (n + e + l) * m;
  21304. d > p && (k = this.bm, k = k.y * d - k.y * p + k.offsetY);
  21305. for (var p = this.sf, q = 0; q < m; q++) {
  21306. var r = p.Ff[q],
  21307. s = p.Ze[q];
  21308. r > c && (r = c);
  21309. var k = k + n,
  21310. u = s,
  21311. s = a,
  21312. t = k,
  21313. y = c,
  21314. w = e,
  21315. A = g,
  21316. B = 0;
  21317. h ? ("left" === A ? B = 0 : "right" === A ? B = y - r : "center" === A && (B = (y - r) / 2), s.fillRect(0 + B, t + .25 * w, r, 1)) : ("left" === A ? B = 0 : "right" === A ? B = y : "center" === A && (B = y / 2), s.fillText(u, 0 + B, t + w - .25 * w), u = w / 20 | 0, 0 === u && (u = 1), "right" === A ? B -= r : "center" ===
  21318. A && (B -= r / 2), this.vk && (s.beginPath(), s.lineWidth = u, s.moveTo(0 + B, t + w - .2 * w), s.lineTo(0 + B + r, t + w - .2 * w), s.stroke()), this.tk && (s.beginPath(), s.lineWidth = u, t = t + w - w / 2.2 | 0, 0 !== u % 2 && (t += .5), s.moveTo(0 + B, t), s.lineTo(0 + B + r, t), s.stroke()));
  21319. k += e + l
  21320. }
  21321. switch (this.wu) {
  21322. case Ao:
  21323. a.scale(-1, 1);
  21324. a.translate(-c, 0);
  21325. break;
  21326. case zo:
  21327. a.scale(1, -1);
  21328. a.translate(0, -d);
  21329. break;
  21330. case Bo:
  21331. a.scale(-1, -1), a.translate(-c, -d)
  21332. }
  21333. }
  21334. };
  21335. pa.prototype.ho = function(a, b, c, d) {
  21336. this.rp = a;
  21337. var e = this.sf;
  21338. e.reset();
  21339. var g = 0,
  21340. h = 0;
  21341. if (isNaN(this.Ea.width)) {
  21342. g = this.Yd.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
  21343. if (0 === g.length) g = 0;
  21344. else if (this.ky) {
  21345. for (var k = h = 0, l = !1; !l;) {
  21346. var m = g.indexOf("\n", k); - 1 === m && (m = g.length, l = !0);
  21347. k = Qq(g.substr(k, m - k).replace(/^\s+|\s+$/g, ""), this.Bg);
  21348. k > h && (h = k);
  21349. k = m + 1
  21350. }
  21351. g = h
  21352. } else h = g.indexOf("\n", 0), 0 <= h && (g = g.substr(0, h)), g = k = Qq(g, this.Bg);
  21353. g = Math.min(g, a / this.scale);
  21354. g = Math.max(8, g)
  21355. } else g = this.Ea.width;
  21356. null !== this.R && (g = Math.min(g,
  21357. this.R.pf.width));
  21358. h = Oq(this, g, e);
  21359. m = h = isNaN(this.Ea.height) ? Math.min(h, b / this.scale) : this.Ea.height;
  21360. if (0 !== e.Pe && 1 !== e.Ze.length && this.pj === Lq && (b = this.Bg, l = this.pj === Lq ? Rq(b) : 0, k = this.vi + this.wi, k = Math.max(0, Pq(this) + k), m = Math.min(this.IJ - 1, Math.max(Math.floor(m / k + .01) - 1, 0)), !(m + 1 >= e.Ze.length))) {
  21361. k = e.Ze[m];
  21362. for (l = Math.max(1, a - l); Qq(k, b) > l && 1 < k.length;) k = k.substr(0, k.length - 1);
  21363. k += Fq;
  21364. b = Qq(k, b);
  21365. e.Ze[m] = k;
  21366. e.Ze = e.Ze.slice(0, m + 1);
  21367. e.Ff[m] = b;
  21368. e.Ff = e.Ff.slice(0, m + 1);
  21369. e.zj = e.Ze.length;
  21370. e.Pe = Math.max(e.Pe, b);
  21371. this.xe =
  21372. e.zj
  21373. }
  21374. if (this.yH === Jq || isNaN(this.Ea.width)) g = isNaN(a) ? e.Pe : Math.min(a, e.Pe), isNaN(this.Ea.width) && (g = Math.max(8, g));
  21375. g = Math.max(c, g);
  21376. h = Math.max(d, h);
  21377. Cb(this.fd, g, h);
  21378. Jo(this, 0, 0, g, h)
  21379. };
  21380. pa.prototype.Cj = function(a, b, c, d) { Oo(this, a, b, c, d) };
  21381. function Nq(a, b, c, d) {
  21382. b = b.replace(/^\s+|\s+$/g, "");
  21383. var e = 0,
  21384. g = 0,
  21385. h = 0,
  21386. k = a.Bg,
  21387. g = a.vi + a.wi,
  21388. l = Math.max(0, Pq(a) + g),
  21389. h = a.pj === Lq ? Rq(k) : 0;
  21390. if (a.xe >= a.wh) return new Ca(0, l);
  21391. if (a.Aj === Iq) {
  21392. c.zj = 1;
  21393. g = Qq(b, k);
  21394. if (0 === h || g <= d) return c.Pe = Math.max(c.Pe, g), c.Ff.push(c.Pe), c.Ze.push(b), new Ca(g, l);
  21395. var m = Sq(a, b);
  21396. b = b.substr(m.length);
  21397. for (var n = Sq(a, b), g = Qq(m + n, k); 0 < n.length && g <= d;) m += n, b = b.substr(n.length), n = Sq(a, b), g = Qq((m + n).replace(/^\s+|\s+$/g, ""), k);
  21398. m += n.replace(/^\s+|\s+$/g, "");
  21399. for (d = Math.max(1, d - h); Qq(m, k) > d && 1 < m.length;) m =
  21400. m.substr(0, m.length - 1);
  21401. m += Fq;
  21402. h = Qq(m, k);
  21403. c.Ff.push(h);
  21404. c.Pe = h;
  21405. c.Ze.push(m);
  21406. return new Ca(h, l)
  21407. }
  21408. var p = 0;
  21409. 0 === b.length && (p = 1, c.Ff.push(0), c.Ze.push(b));
  21410. for (; 0 < b.length;) {
  21411. m = Sq(a, b);
  21412. for (b = b.substr(m.length); Qq(m, k) > d;) {
  21413. n = 1;
  21414. g = Qq(m.substr(0, n), k);
  21415. for (h = 0; g <= d;) n++, h = g, g = Qq(m.substr(0, n), k);
  21416. 1 === n ? (c.Ff[a.xe + p] = g, e = Math.max(e, g)) : (c.Ff[a.xe + p] = h, e = Math.max(e, h));
  21417. n--;
  21418. 1 > n && (n = 1);
  21419. c.Ze[a.xe + p] = m.substr(0, n);
  21420. p++;
  21421. m = m.substr(n);
  21422. if (a.xe + p > a.wh) break
  21423. }
  21424. n = Sq(a, b);
  21425. for (g = Qq(m + n, k); 0 < n.length && g <= d;) m += n, b = b.substr(n.length),
  21426. n = Sq(a, b), g = Qq((m + n).replace(/^\s+|\s+$/g, ""), k);
  21427. m = m.replace(/^\s+|\s+$/g, "");
  21428. if ("" !== m && ("\u00ad" === m[m.length - 1] && (m = m.substring(0, m.length - 1) + "\u2010"), 0 === n.length ? (c.Ff.push(g), e = Math.max(e, g)) : (h = Qq(m, k), c.Ff.push(h), e = Math.max(e, h)), c.Ze.push(m), p++, a.xe + p > a.wh)) break
  21429. }
  21430. c.zj = Math.min(a.wh, p);
  21431. c.Pe = Math.max(c.Pe, e);
  21432. return new Ca(c.Pe, l * c.zj)
  21433. }
  21434. function Sq(a, b) { if (a.Aj === Kq) return b.substr(0, 1); for (var c = b.length, d = 0; d < c && !Aq.test(b.charAt(d));) d++; for (; d < c && Aq.test(b.charAt(d));) d++; return d >= c ? b : b.substr(0, d) }
  21435. function Qq(a, b) { Gq !== b && (Gq = Hq.font = b); return Hq.measureText(a).width }
  21436. function Pq(a) {
  21437. if (null !== a.sf.kk) return a.sf.kk;
  21438. var b = a.Bg;
  21439. Gq !== b && (Gq = Hq.font = b);
  21440. var c = 0;
  21441. void 0 !== Bq[b] && 5E3 > Cq ? c = Bq[b] : (c = 1.3 * Hq.measureText("M").width, Bq[b] = c, Cq++);
  21442. return a.sf.kk = c
  21443. }
  21444. function Rq(a) {
  21445. Gq !== a && (Gq = Hq.font = a);
  21446. var b = 0;
  21447. void 0 !== Dq[a] && 5E3 > Eq ? b = Dq[a] : (b = Hq.measureText(Fq).width, Dq[a] = b, Eq++);
  21448. return b
  21449. }
  21450. function Oq(a, b, c) {
  21451. var d = a.Yd.replace(/\r\n/g, "\n").replace(/\r/g, "\n"),
  21452. e = a.vi + a.wi,
  21453. e = Math.max(0, Pq(a) + e);
  21454. if (0 === d.length) return c.Pe = 0, a.xe = 1, e;
  21455. if (!a.ky) {
  21456. var g = d.indexOf("\n", 0);
  21457. 0 <= g && (d = d.substr(0, g))
  21458. }
  21459. for (var g = 0, h = a.xe = 0, k = -1, l = !1; !l;) k = d.indexOf("\n", h), -1 === k && (k = d.length, l = !0), h <= k && (h = d.substr(h, k - h), a.Aj !== Iq ? (c.zj = 0, h = Nq(a, h, c, b), g += h.height, a.xe += c.zj) : (Nq(a, h, c, b), g += e, a.xe++), a.xe === a.wh && (l = !0)), h = k + 1;
  21460. return a.Cw = g
  21461. }
  21462. D.defineProperty(pa, { jC: "textValidation" }, function() { return this.Zl }, function(a) {
  21463. var b = this.Zl;
  21464. b !== a && (null !== a && D.h(a, "function", pa, "textValidation"), this.Zl = a, this.i("textValidation", b, a))
  21465. });
  21466. D.defineProperty(pa, { lH: "textEdited" }, function() { return this.Qt }, function(a) {
  21467. var b = this.Qt;
  21468. b !== a && (null !== a && D.h(a, "function", pa, "textEdited"), this.Qt = a, this.i("textEdited", b, a))
  21469. });
  21470. D.defineProperty(pa, { GM: "spacingAbove" }, function() { return this.vi }, function(a) {
  21471. var b = this.vi;
  21472. b !== a && (v && D.h(a, "number", pa, "spacingAbove"), this.vi = a, this.i("spacingAbove", b, a))
  21473. });
  21474. D.defineProperty(pa, { HM: "spacingBelow" }, function() { return this.wi }, function(a) {
  21475. var b = this.wi;
  21476. b !== a && (v && D.h(a, "number", pa, "spacingBelow"), this.wi = a, this.i("spacingBelow", b, a))
  21477. });
  21478. D.defineProperty(pa, { IJ: "maxLines" }, function() { return this.wh }, function(a) {
  21479. var b = this.wh;
  21480. b !== a && (v && D.h(a, "number", pa, "maxLines"), a = Math.floor(a), 0 >= a && D.ua(a, "> 0", pa, "maxLines"), this.wh = a, this.i("maxLines", b, a), this.K())
  21481. });
  21482. D.w(pa, { hM: "metrics" }, function() { return this.sf });
  21483. D.defineProperty(pa, { pL: "choices" }, function() { return this.ur }, function(a) {
  21484. var b = this.ur;
  21485. b !== a && (null === a || Array.isArray(a) || D.kc(a, "Array", pa, "choices:value"), this.ur = a, this.i("choices", b, a))
  21486. });
  21487. function bq() {
  21488. this.Pe = this.zj = 0;
  21489. this.Ff = [];
  21490. this.Ze = [];
  21491. this.kk = null
  21492. }
  21493. bq.prototype.reset = function() {
  21494. this.Pe = this.zj = 0;
  21495. this.kk = null;
  21496. this.Ff = [];
  21497. this.Ze = []
  21498. };
  21499. bq.prototype.gq = function(a) {
  21500. this.zj = a.zj;
  21501. this.kk = a.kk;
  21502. this.Pe = a.Pe;
  21503. this.Ff = D.km(a.Ff);
  21504. this.Ze = D.km(a.Ze)
  21505. };
  21506. D.w(bq, { mL: "arrSize" }, function() { return this.Ff });
  21507. D.w(bq, { nL: "arrText" }, function() { return this.Ze });
  21508. D.w(bq, { gM: "maxLineWidth" }, function() { return this.Pe });
  21509. D.w(bq, { RL: "fontHeight" }, function() { return this.kk });
  21510. function Hl() {
  21511. O.call(this);
  21512. this.af = null;
  21513. this.Kt = "";
  21514. this.Gk = je;
  21515. this.gp = Ye;
  21516. this.zi = this.bf = null;
  21517. this.fp = mc;
  21518. this.Ag = Zj;
  21519. this.Rp = null;
  21520. this.Xz = !1;
  21521. this.ap = !0;
  21522. this.Aw = !1;
  21523. this.Jp = null
  21524. }
  21525. D.Ta(Hl, O);
  21526. D.ka("Picture", Hl);
  21527. Hl.prototype.cloneProtected = function(a) {
  21528. O.prototype.cloneProtected.call(this, a);
  21529. a.element = this.af;
  21530. a.Kt = this.Kt;
  21531. a.Gk = this.Gk.V();
  21532. a.gp = this.gp;
  21533. a.Ag = this.Ag;
  21534. a.bf = this.bf;
  21535. a.zi = this.zi;
  21536. a.fp = this.fp.V();
  21537. a.ap = this.ap;
  21538. a.Jp = this.Jp
  21539. };
  21540. Hl.prototype.qc = function(a) { a === Zj || a === bk || a === ck ? this.gJ = a : O.prototype.qc.call(this, a) };
  21541. Hl.prototype.toString = function() { return "Picture(" + this.source + ")#" + D.Nd(this) };
  21542. var Tq = new ma,
  21543. Uq = 0,
  21544. Bl = [];
  21545. function Vq() {
  21546. var a = Bl;
  21547. if (0 === a.length)
  21548. for (var b = window.document.getElementsByTagName("canvas"), c = b.length, d = 0; d < c; d++) {
  21549. var e = b[d];
  21550. e.parentElement && e.parentElement.ca && a.push(e.parentElement.ca)
  21551. }
  21552. return a
  21553. }
  21554. var Wq;
  21555. Hl.clearCache = Wq = function(a) {
  21556. void 0 === a && (a = "");
  21557. D.h(a, "string", Hl, "clearCache:url");
  21558. "" !== a ? Tq[a] && (delete Tq[a], Uq--) : (Tq = new ma, Uq = 0)
  21559. };
  21560. D.defineProperty(Hl, { element: "element" }, function() { return this.af }, function(a) {
  21561. var b = this.af;
  21562. if (b !== a) {
  21563. null === a || a instanceof HTMLImageElement || a instanceof HTMLVideoElement || a instanceof HTMLCanvasElement || D.k("Picture.element must be an instance of Image, Canvas, or Video, not: " + a);
  21564. this.Xz = a instanceof HTMLCanvasElement;
  21565. this.af = a;
  21566. if (null !== a)
  21567. if (a instanceof HTMLCanvasElement || !0 === a.complete) a.ep instanceof Event && null !== this.bf && this.bf(this, a.ep), !0 === a.ps && null !== this.zi && this.zi(this, a.mA),
  21568. a.ps = !0, this.Ea.H() || (km(this, !1), this.K());
  21569. else {
  21570. var c = this;
  21571. a.xD || (a.addEventListener("load", function(b) {
  21572. Xq(a, b);
  21573. c.Ea.H() || (km(c, !1), c.K())
  21574. }), a.addEventListener("error", function(b) { Yq(a, b) }), a.xD = !0)
  21575. }
  21576. this.i("element", b, a);
  21577. this.ra()
  21578. }
  21579. });
  21580. D.defineProperty(Hl, { source: "source" }, function() { return this.Kt }, function(a) {
  21581. var b = this.Kt;
  21582. if (b !== a) {
  21583. D.h(a, "string", Hl, "source");
  21584. this.Kt = a;
  21585. var c = Tq,
  21586. d = this.g;
  21587. if (void 0 !== c[a]) var e = c[a].$p[0].source;
  21588. else {
  21589. 30 < Uq && (Wq(), c = Tq);
  21590. var e = D.createElement("img"),
  21591. g = this;
  21592. e.addEventListener("load", function(a) {
  21593. Xq(e, a);
  21594. g.Ea.H() || (km(g, !1), g.K())
  21595. });
  21596. e.addEventListener("error", function(a) { Yq(e, a) });
  21597. e.xD = !0;
  21598. var h = this.Jp;
  21599. null !== h && (e.crossOrigin = h(this));
  21600. e.src = a;
  21601. c[a] = new Zq(e);
  21602. Uq++
  21603. }
  21604. null !== d && yn(d, this);
  21605. this.element = e;
  21606. null !== d && xn(d, this);
  21607. this.K();
  21608. this.ra();
  21609. this.i("source", b, a)
  21610. }
  21611. });
  21612. function Xq(a, b) {
  21613. a.ps = !0;
  21614. a.ep = !1;
  21615. for (var c = null, d = Vq(), e = d.length, g = 0; g < e; g++) {
  21616. var h = d[g],
  21617. k = h.Cp.oa(a.src);
  21618. if (null !== k)
  21619. for (var l = k.length, m = 0; m < l; m++) c = k[m], h.iA.add(c), h.Ve(), null === a.mA && (a.mA = b, null !== c.zi && c.zi(c, b))
  21620. }
  21621. }
  21622. function Yq(a, b) {
  21623. a.ep = b;
  21624. for (var c = null, d = Vq(), e = d.length, g = 0; g < e; g++)
  21625. if (c = d[g].Cp.oa(a.src), null !== c) {
  21626. for (var h = c.length, k = D.mb(), l = 0; l < h; l++) k.push(c[l]);
  21627. for (l = 0; l < h; l++) c = k[l], null !== c.bf && c.bf(c, b);
  21628. D.ya(k)
  21629. }
  21630. }
  21631. D.defineProperty(Hl, { FM: "sourceCrossOrigin" }, function() { return this.Jp }, function(a) {
  21632. if (this.Jp !== a && (null !== a && D.h(a, "function", Hl, "sourceCrossOrigin"), this.Jp = a, null !== this.element)) {
  21633. var b = this.element.src;
  21634. null === a && "string" === typeof b ? this.element.crossOrigin = null : null !== a && (this.element.crossOrigin = a(this));
  21635. this.element.src = b
  21636. }
  21637. });
  21638. D.defineProperty(Hl, { Yj: "sourceRect" }, function() { return this.Gk }, function(a) {
  21639. var b = this.Gk;
  21640. b.O(a) || (D.l(a, C, Hl, "sourceRect"), this.Gk = a = a.V(), this.ra(), this.i("sourceRect", b, a))
  21641. });
  21642. D.defineProperty(Hl, { gJ: "imageStretch" }, function() { return this.gp }, function(a) {
  21643. var b = this.gp;
  21644. b !== a && (D.Da(a, O, Hl, "imageStretch"), this.gp = a, this.ra(), this.i("imageStretch", b, a))
  21645. });
  21646. D.defineProperty(Hl, { wu: "flip" }, function() { return this.Ag }, function(a) {
  21647. var b = this.Ag;
  21648. b !== a && (D.Da(a, O, Hl, "flip"), this.Ag = a, this.ra(), this.i("flip", b, a))
  21649. });
  21650. D.defineProperty(Hl, { TL: "imageAlignment" }, function() { return this.fp }, function(a) {
  21651. D.l(a, S, Hl, "imageAlignment");
  21652. var b = this.fp;
  21653. b.O(a) || (this.fp = a = a.V(), this.K(), this.i("imageAlignment", b, a))
  21654. });
  21655. D.defineProperty(Hl, { ZA: "errorFunction" }, function() { return this.bf }, function(a) {
  21656. var b = this.bf;
  21657. b !== a && (null !== a && D.h(a, "function", Hl, "errorFunction"), this.bf = a, this.i("errorFunction", b, a))
  21658. });
  21659. D.defineProperty(Hl, { PM: "successFunction" }, function() { return this.zi }, function(a) {
  21660. var b = this.zi;
  21661. b !== a && (null !== a && D.h(a, "function", Hl, "successFunction"), this.zi = a, this.i("successFunction", b, a))
  21662. });
  21663. Hl.prototype.Wk = function(a, b) {
  21664. var c = this.af;
  21665. if (null !== c) {
  21666. var d = c.src;
  21667. null !== d && "" !== d || D.k('Element has no source ("src") attribute: ' + c);
  21668. if (!(c.ep instanceof Event) && !1 !== c.ps) {
  21669. var d = this.Ga,
  21670. e = 0,
  21671. g = 0,
  21672. h = this.Xz,
  21673. k = h ? +c.width : c.naturalWidth,
  21674. h = h ? +c.height : c.naturalHeight;
  21675. void 0 === k && c.videoWidth && (k = c.videoWidth);
  21676. void 0 === h && c.videoHeight && (h = c.videoHeight);
  21677. k = k || d.width;
  21678. h = h || d.height;
  21679. if (0 !== k && 0 !== h) {
  21680. var l = k,
  21681. m = h;
  21682. this.Yj.H() && (e = this.Gk.x, g = this.Gk.y, k = this.Gk.width, h = this.Gk.height);
  21683. var n = k,
  21684. p = h,
  21685. q = this.gp,
  21686. r = this.fp;
  21687. switch (q) {
  21688. case Zj:
  21689. if (this.Yj.H()) break;
  21690. n >= d.width && (e = e + r.offsetX + (n * r.x - d.width * r.x));
  21691. p >= d.height && (g = g + r.offsetY + (p * r.y - d.height * r.y));
  21692. k = Math.min(d.width, n);
  21693. h = Math.min(d.height, p);
  21694. break;
  21695. case Ye:
  21696. n = d.width;
  21697. p = d.height;
  21698. break;
  21699. case bk:
  21700. case ck:
  21701. var s = 0;
  21702. q === bk ? (s = Math.min(d.height / p, d.width / n), n *= s, p *= s) : q === ck && (s = Math.max(d.height / p, d.width / n), n *= s, p *= s, n >= d.width && (e = (e + r.offsetX + (n * r.x - d.width * r.x) / n) * k), p >= d.height && (g = (g + r.offsetY + (p * r.y - d.height * r.y) / p) * h), k *= 1 / (n / d.width), h *= 1 / (p / d.height),
  21703. n = d.width, p = d.height)
  21704. }
  21705. var q = this.Jj() * b.scale,
  21706. u = k * h / (n * q * p * q),
  21707. s = Tq[this.source],
  21708. q = null;
  21709. if (c.ps && void 0 !== s && 16 < u) {
  21710. 2 > s.$p.length && ($q(s, 4, l, m), $q(s, 16, l, m));
  21711. for (var l = s.$p, m = l.length, q = l[0], t = 0; t < m; t++)
  21712. if (l[t].Oq * l[t].Oq < u) q = l[t];
  21713. else break
  21714. }
  21715. if (!b.Ur) {
  21716. if (null === this.Rp)
  21717. if (null === this.af) this.Rp = !1;
  21718. else {
  21719. l = (new ja(null)).Tk;
  21720. l.drawImage(this.af, 0, 0);
  21721. try { l.getImageData(0, 0, 1, 1).data[3] && (this.Rp = !1), this.Rp = !1 } catch (y) { this.Rp = !0 }
  21722. }
  21723. if (this.Rp) return
  21724. }
  21725. l = 0;
  21726. n < d.width && (l = r.offsetX + (d.width * r.x - n * r.x));
  21727. m = 0;
  21728. p <
  21729. d.height && (m = r.offsetY + (d.height * r.y - p * r.y));
  21730. switch (this.wu) {
  21731. case Ao:
  21732. a.translate(Math.min(d.width, n), 0);
  21733. a.scale(-1, 1);
  21734. break;
  21735. case zo:
  21736. a.translate(0, Math.min(d.height, p));
  21737. a.scale(1, -1);
  21738. break;
  21739. case Bo:
  21740. a.translate(Math.min(d.width, n), Math.min(d.height, p)), a.scale(-1, -1)
  21741. }
  21742. if (b.Kj("pictureRatioOptimization") && !b.Yz && void 0 !== s && null !== q && 1 !== q.Oq) {
  21743. a.save();
  21744. s = q.Oq;
  21745. try { a.drawImage(q.source, e / s, g / s, Math.min(q.source.width, k / s), Math.min(q.source.height, h / s), l, m, Math.min(d.width, n), Math.min(d.height, p)) } catch (w) {
  21746. v &&
  21747. this.ap && D.trace(w.toString()), this.ap = !1
  21748. }
  21749. a.restore()
  21750. } else try { a.drawImage(c, e, g, k, h, l, m, Math.min(d.width, n), Math.min(d.height, p)) } catch (A) { v && this.ap && D.trace(A.toString()), this.ap = !1 }
  21751. switch (this.wu) {
  21752. case Ao:
  21753. a.scale(-1, 1);
  21754. a.translate(-Math.min(d.width, n), 0);
  21755. break;
  21756. case zo:
  21757. a.scale(1, -1);
  21758. a.translate(0, -Math.min(d.height, p));
  21759. break;
  21760. case Bo:
  21761. a.scale(-1, -1), a.translate(-Math.min(d.width, n), -Math.min(d.height, p))
  21762. }
  21763. }
  21764. }
  21765. }
  21766. };
  21767. D.w(Hl, { Ga: "naturalBounds" }, function() { return this.fd });
  21768. Hl.prototype.ho = function(a, b, c, d) {
  21769. var e = this.Ea,
  21770. g = Mo(this, !0),
  21771. h = this.af,
  21772. k = this.Xz;
  21773. if (k || !this.Aw && h && h.complete) this.Aw = !0;
  21774. null === h && (isFinite(e.width) || (a = 0), isFinite(e.height) || (b = 0));
  21775. isFinite(e.width) || g === Ye || g === yo ? (isFinite(a) || (a = this.Yj.H() ? this.Yj.width : k ? +h.width : h.naturalWidth), c = 0) : null !== h && !1 !== this.Aw && (a = this.Yj.H() ? this.Yj.width : k ? +h.width : h.naturalWidth);
  21776. isFinite(e.height) || g === Ye || g === xo ? (isFinite(b) || (b = this.Yj.H() ? this.Yj.height : k ? +h.height : h.naturalHeight), d = 0) : null !== h && !1 !==
  21777. this.Aw && (b = this.Yj.H() ? this.Yj.height : k ? +h.height : h.naturalHeight);
  21778. isFinite(e.width) && (a = e.width);
  21779. isFinite(e.height) && (b = e.height);
  21780. e = this.pf;
  21781. g = this.ah;
  21782. c = Math.max(c, g.width);
  21783. d = Math.max(d, g.height);
  21784. a = Math.min(e.width, a);
  21785. b = Math.min(e.height, b);
  21786. a = Math.max(c, a);
  21787. b = Math.max(d, b);
  21788. null === h || h.complete || (isFinite(a) || (a = 0), isFinite(b) || (b = 0));
  21789. Cb(this.fd, a, b);
  21790. Jo(this, 0, 0, a, b)
  21791. };
  21792. Hl.prototype.Cj = function(a, b, c, d) { Oo(this, a, b, c, d) };
  21793. function Zq(a) { this.$p = [new ar(a, 1)] }
  21794. function $q(a, b, c, d) {
  21795. var e = new ja(null),
  21796. g = e.Tk,
  21797. h = 1 / b;
  21798. e.width = c / b;
  21799. e.height = d / b;
  21800. b = new ar(e.$d, b);
  21801. c = a.$p[a.$p.length - 1];
  21802. g.setTransform(h * c.Oq, 0, 0, h * c.Oq, 0, 0);
  21803. g.drawImage(c.source, 0, 0);
  21804. a.$p.push(b)
  21805. }
  21806. function ar(a, b) {
  21807. this.source = a;
  21808. this.Oq = b
  21809. }
  21810. function Fa() {
  21811. this.q = new Ve;
  21812. this.fc = null
  21813. }
  21814. f = Fa.prototype;
  21815. f.reset = function() {
  21816. this.q = new Ve;
  21817. this.fc = null
  21818. };
  21819. function T(a, b, c, d, e, g) {
  21820. null === a.q && D.k("StreamGeometryContext has been closed");
  21821. void 0 !== e && !0 === e ? (null === a.fc && D.k("Need to call beginFigure first"), d = new $f(Ef), d.F = b, d.G = c, a.fc.Eb.add(d)) : (a.fc = new Xe, a.fc.la = b, a.fc.ja = c, a.fc.Ku = d, a.q.nc.add(a.fc));
  21822. void 0 !== g && (a.fc.mp = g)
  21823. }
  21824. function X(a) {
  21825. null === a.q && D.k("StreamGeometryContext has been closed");
  21826. null === a.fc && D.k("Need to call beginFigure first");
  21827. var b = a.fc.Eb.length;
  21828. 0 < b && a.fc.Eb.fa(b - 1).close()
  21829. }
  21830. function Bf(a) {
  21831. null === a.q && D.k("StreamGeometryContext has been closed");
  21832. null === a.fc && D.k("Need to call beginFigure first");
  21833. 0 < a.fc.Eb.length && (a.fc.Ku = !0)
  21834. }
  21835. f.jb = function(a) {
  21836. null === this.q && D.k("StreamGeometryContext has been closed");
  21837. null === this.fc && D.k("Need to call beginFigure first");
  21838. this.fc.dl = a
  21839. };
  21840. f.moveTo = function(a, b, c) {
  21841. void 0 === c && (c = !1);
  21842. null === this.q && D.k("StreamGeometryContext has been closed");
  21843. null === this.fc && D.k("Need to call beginFigure first");
  21844. var d = new $f(Ef);
  21845. d.F = a;
  21846. d.G = b;
  21847. c && d.close();
  21848. this.fc.Eb.add(d)
  21849. };
  21850. f.lineTo = function(a, b, c) {
  21851. void 0 === c && (c = !1);
  21852. null === this.q && D.k("StreamGeometryContext has been closed");
  21853. null === this.fc && D.k("Need to call beginFigure first");
  21854. var d = new $f(wf);
  21855. d.F = a;
  21856. d.G = b;
  21857. c && d.close();
  21858. this.fc.Eb.add(d)
  21859. };
  21860. function U(a, b, c, d, e, g, h, k) {
  21861. void 0 === k && (k = !1);
  21862. null === a.q && D.k("StreamGeometryContext has been closed");
  21863. null === a.fc && D.k("Need to call beginFigure first");
  21864. var l = new $f(Ff);
  21865. l.Ec = b;
  21866. l.$c = c;
  21867. l.Uh = d;
  21868. l.Vh = e;
  21869. l.F = g;
  21870. l.G = h;
  21871. k && l.close();
  21872. a.fc.Eb.add(l)
  21873. }
  21874. function zf(a, b, c, d, e) {
  21875. var g;
  21876. void 0 === g && (g = !1);
  21877. null === a.q && D.k("StreamGeometryContext has been closed");
  21878. null === a.fc && D.k("Need to call beginFigure first");
  21879. var h = new $f(Gf);
  21880. h.Ec = b;
  21881. h.$c = c;
  21882. h.F = d;
  21883. h.G = e;
  21884. g && h.close();
  21885. a.fc.Eb.add(h)
  21886. }
  21887. f.arcTo = function(a, b, c, d, e, g, h) {
  21888. void 0 === g && (g = 0);
  21889. void 0 === h && (h = !1);
  21890. null === this.q && D.k("StreamGeometryContext has been closed");
  21891. null === this.fc && D.k("Need to call beginFigure first");
  21892. var k = new $f(Hf);
  21893. k.Me = a;
  21894. k.Df = b;
  21895. k.pa = c;
  21896. k.va = d;
  21897. k.radiusX = e;
  21898. k.radiusY = 0 !== g ? g : e;
  21899. h && k.close();
  21900. this.fc.Eb.add(k)
  21901. };
  21902. function Af(a, b, c, d, e, g, h, k) {
  21903. var l;
  21904. void 0 === l && (l = !1);
  21905. null === a.q && D.k("StreamGeometryContext has been closed");
  21906. null === a.fc && D.k("Need to call beginFigure first");
  21907. b = new $f(If, h, k, b, c, d, e, g);
  21908. l && b.close();
  21909. a.fc.Eb.add(b)
  21910. }
  21911. function br(a) {
  21912. a = cr(a);
  21913. var b = D.mb();
  21914. b[0] = a[0];
  21915. for (var c = 1, d = 1; d < a.length;) b[c] = a[d], b[c + 1] = a[d], b[c + 2] = a[d + 1], d += 2, c += 3;
  21916. D.ya(a);
  21917. return b
  21918. }
  21919. function cr(a) {
  21920. var b = dr(a),
  21921. c = D.mb(),
  21922. d = Math.floor(b.length / 2),
  21923. e = b.length - 1;
  21924. a = 0 === a % 2 ? 2 : 1;
  21925. for (var g = 0; g < e; g++) {
  21926. var h = b[g],
  21927. k = b[g + 1],
  21928. l = b[(d + g - 1) % e],
  21929. m = b[(d + g + a) % e];
  21930. c[2 * g] = h;
  21931. c[2 * g + 1] = Ke(h.x, h.y, l.x, l.y, k.x, k.y, m.x, m.y, new N)
  21932. }
  21933. c[c.length] = c[0];
  21934. D.ya(b);
  21935. return c
  21936. }
  21937. function dr(a) {
  21938. for (var b = D.mb(), c = 1.5 * Math.PI, d = 0, e = 0; e < a; e++) d = 2 * Math.PI / a * e + c, b[e] = new N(.5 + .5 * Math.cos(d), .5 + .5 * Math.sin(d));
  21939. b.push(b[0]);
  21940. return b
  21941. }
  21942. var qq = {
  21943. None: "Rectangle",
  21944. Rectangle: function(a, b, c) {
  21945. a = new Ve;
  21946. a.type = tf;
  21947. a.la = 0;
  21948. a.ja = 0;
  21949. a.F = b;
  21950. a.G = c;
  21951. return a
  21952. },
  21953. Square: function(a, b, c) {
  21954. a = new Ve;
  21955. a.le = bk;
  21956. a.type = tf;
  21957. a.la = 0;
  21958. a.ja = 0;
  21959. a.F = Math.min(b, c);
  21960. a.G = Math.min(b, c);
  21961. return a
  21962. },
  21963. Ellipse: function(a, b, c) {
  21964. a = new Ve;
  21965. a.type = uf;
  21966. a.la = 0;
  21967. a.ja = 0;
  21968. a.F = b;
  21969. a.G = c;
  21970. a.C = ke;
  21971. a.D = le;
  21972. return a
  21973. },
  21974. Circle: function(a, b, c) {
  21975. a = new Ve;
  21976. a.le = bk;
  21977. a.type = uf;
  21978. a.la = 0;
  21979. a.ja = 0;
  21980. a.F = Math.min(b, c);
  21981. a.G = Math.min(b, c);
  21982. a.C = ke;
  21983. a.D = le;
  21984. return a
  21985. },
  21986. Connector: "Ellipse",
  21987. TriangleRight: function(a, b, c) {
  21988. a = new Ve;
  21989. var d = new Xe,
  21990. e = new $f;
  21991. e.F = b;
  21992. e.G = .5 * c;
  21993. d.Eb.add(e);
  21994. b = new $f;
  21995. b.F = 0;
  21996. b.G = c;
  21997. d.Eb.add(b.close());
  21998. a.nc.add(d);
  21999. a.C = new S(0, .25);
  22000. a.D = new S(.5, .75);
  22001. return a
  22002. },
  22003. TriangleDown: function(a, b, c) {
  22004. a = new Ve;
  22005. var d = new Xe,
  22006. e = new $f;
  22007. e.F = b;
  22008. e.G = 0;
  22009. d.Eb.add(e);
  22010. e = new $f;
  22011. e.F = .5 * b;
  22012. e.G = c;
  22013. d.Eb.add(e.close());
  22014. a.nc.add(d);
  22015. a.C = new S(.25, 0);
  22016. a.D = new S(.75, .5);
  22017. return a
  22018. },
  22019. TriangleLeft: function(a, b, c) {
  22020. a = new Ve;
  22021. var d = new Xe;
  22022. d.la = b;
  22023. d.ja = c;
  22024. var e = new $f;
  22025. e.F = 0;
  22026. e.G = .5 * c;
  22027. d.Eb.add(e);
  22028. c = new $f;
  22029. c.F = b;
  22030. c.G = 0;
  22031. d.Eb.add(c.close());
  22032. a.nc.add(d);
  22033. a.C = new S(.5, .25);
  22034. a.D = new S(1,
  22035. .75);
  22036. return a
  22037. },
  22038. TriangleUp: function(a, b, c) {
  22039. a = new Ve;
  22040. var d = new Xe;
  22041. d.la = b;
  22042. d.ja = c;
  22043. var e = new $f;
  22044. e.F = 0;
  22045. e.G = c;
  22046. d.Eb.add(e);
  22047. c = new $f;
  22048. c.F = .5 * b;
  22049. c.G = 0;
  22050. d.Eb.add(c.close());
  22051. a.nc.add(d);
  22052. a.C = new S(.25, .5);
  22053. a.D = new S(.75, 1);
  22054. return a
  22055. },
  22056. Line1: function(a, b, c) {
  22057. a = new Ve;
  22058. a.type = Ze;
  22059. a.la = 0;
  22060. a.ja = 0;
  22061. a.F = b;
  22062. a.G = c;
  22063. return a
  22064. },
  22065. Line2: function(a, b, c) {
  22066. a = new Ve;
  22067. a.type = Ze;
  22068. a.la = b;
  22069. a.ja = 0;
  22070. a.F = 0;
  22071. a.G = c;
  22072. return a
  22073. },
  22074. MinusLine: "LineH",
  22075. LineH: function(a, b, c) {
  22076. a = new Ve;
  22077. a.type = Ze;
  22078. a.la = 0;
  22079. a.ja = c / 2;
  22080. a.F = b;
  22081. a.G = c / 2;
  22082. return a
  22083. },
  22084. LineV: function(a, b, c) {
  22085. a = new Ve;
  22086. a.type =
  22087. Ze;
  22088. a.la = b / 2;
  22089. a.ja = 0;
  22090. a.F = b / 2;
  22091. a.G = c;
  22092. return a
  22093. },
  22094. BarH: "Rectangle",
  22095. BarV: "Rectangle",
  22096. Curve1: function(a, b, c) {
  22097. a = D.v();
  22098. T(a, 0, 0, !1);
  22099. U(a, Jd * b, 0, 1 * b, (1 - Jd) * c, b, c);
  22100. b = a.q;
  22101. D.u(a);
  22102. return b
  22103. },
  22104. Curve2: function(a, b, c) {
  22105. a = D.v();
  22106. T(a, 0, 0, !1);
  22107. U(a, 0, Jd * c, (1 - Jd) * b, c, b, c);
  22108. b = a.q;
  22109. D.u(a);
  22110. return b
  22111. },
  22112. Curve3: function(a, b, c) {
  22113. a = D.v();
  22114. T(a, 1 * b, 0, !1);
  22115. U(a, 1 * b, Jd * c, Jd * b, 1 * c, 0, 1 * c);
  22116. b = a.q;
  22117. D.u(a);
  22118. return b
  22119. },
  22120. Curve4: function(a, b, c) {
  22121. a = D.v();
  22122. T(a, 1 * b, 0, !1);
  22123. U(a, (1 - Jd) * b, 0, 0, (1 - Jd) * c, 0, 1 * c);
  22124. b = a.q;
  22125. D.u(a);
  22126. return b
  22127. },
  22128. Alternative: "Triangle",
  22129. Merge: "Triangle",
  22130. Triangle: function(a, b, c) {
  22131. a = D.v();
  22132. T(a, .5 * b, 0 * c, !0);
  22133. a.lineTo(0 * b, 1 * c);
  22134. a.lineTo(1 * b, 1 * c, !0);
  22135. b = a.q;
  22136. b.C = new S(.25, .5);
  22137. b.D = new S(.75, 1);
  22138. D.u(a);
  22139. return b
  22140. },
  22141. Decision: "Diamond",
  22142. Diamond: function(a, b, c) {
  22143. a = D.v();
  22144. T(a, .5 * b, 0, !0);
  22145. a.lineTo(0, .5 * c);
  22146. a.lineTo(.5 * b, 1 * c);
  22147. a.lineTo(1 * b, .5 * c, !0);
  22148. b = a.q;
  22149. b.C = new S(.25, .25);
  22150. b.D = new S(.75, .75);
  22151. D.u(a);
  22152. return b
  22153. },
  22154. Pentagon: function(a, b, c) {
  22155. var d = dr(5);
  22156. a = D.v();
  22157. T(a, d[0].x * b, d[0].y * c, !0);
  22158. for (var e = 1; 5 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22159. D.ya(d);
  22160. X(a);
  22161. b = a.q;
  22162. b.C = new S(.2, .22);
  22163. b.D = new S(.8,
  22164. .9);
  22165. D.u(a);
  22166. return b
  22167. },
  22168. DataTransmission: "Hexagon",
  22169. Hexagon: function(a, b, c) {
  22170. var d = dr(6);
  22171. a = D.v();
  22172. T(a, d[0].x * b, d[0].y * c, !0);
  22173. for (var e = 1; 6 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22174. D.ya(d);
  22175. X(a);
  22176. b = a.q;
  22177. b.C = new S(.07, .25);
  22178. b.D = new S(.93, .75);
  22179. D.u(a);
  22180. return b
  22181. },
  22182. Heptagon: function(a, b, c) {
  22183. var d = dr(7);
  22184. a = D.v();
  22185. T(a, d[0].x * b, d[0].y * c, !0);
  22186. for (var e = 1; 7 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22187. D.ya(d);
  22188. X(a);
  22189. b = a.q;
  22190. b.C = new S(.2, .15);
  22191. b.D = new S(.8, .85);
  22192. D.u(a);
  22193. return b
  22194. },
  22195. Octagon: function(a, b, c) {
  22196. var d = dr(8);
  22197. a = D.v();
  22198. T(a, d[0].x * b, d[0].y * c, !0);
  22199. for (var e = 1; 8 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22200. D.ya(d);
  22201. X(a);
  22202. b = a.q;
  22203. b.C = new S(.15, .15);
  22204. b.D = new S(.85, .85);
  22205. D.u(a);
  22206. return b
  22207. },
  22208. Nonagon: function(a, b, c) {
  22209. var d = dr(9);
  22210. a = D.v();
  22211. T(a, d[0].x * b, d[0].y * c, !0);
  22212. for (var e = 1; 9 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22213. D.ya(d);
  22214. X(a);
  22215. b = a.q;
  22216. b.C = new S(.17, .13);
  22217. b.D = new S(.82, .82);
  22218. D.u(a);
  22219. return b
  22220. },
  22221. Decagon: function(a, b, c) {
  22222. var d = dr(10);
  22223. a = D.v();
  22224. T(a, d[0].x * b, d[0].y * c, !0);
  22225. for (var e = 1; 10 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22226. D.ya(d);
  22227. X(a);
  22228. b = a.q;
  22229. b.C = new S(.16, .16);
  22230. b.D = new S(.84, .84);
  22231. D.u(a);
  22232. return b
  22233. },
  22234. Dodecagon: function(a, b, c) {
  22235. var d = dr(12);
  22236. a = D.v();
  22237. T(a, d[0].x * b, d[0].y * c, !0);
  22238. for (var e = 1; 12 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22239. D.ya(d);
  22240. X(a);
  22241. b = a.q;
  22242. b.C = new S(.16, .16);
  22243. b.D = new S(.84, .84);
  22244. D.u(a);
  22245. return b
  22246. },
  22247. FivePointedStar: function(a, b, c) {
  22248. var d = cr(5);
  22249. a = D.v();
  22250. T(a, d[0].x * b, d[0].y * c, !0);
  22251. for (var e = 1; 10 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22252. D.ya(d);
  22253. X(a);
  22254. b = a.q;
  22255. b.C = new S(.312, .383);
  22256. b.D = new S(.693, .765);
  22257. D.u(a);
  22258. return b
  22259. },
  22260. SixPointedStar: function(a, b, c) {
  22261. var d = cr(6);
  22262. a = D.v();
  22263. T(a, d[0].x * b, d[0].y * c, !0);
  22264. for (var e = 1; 12 > e; e++) a.lineTo(d[e].x *
  22265. b, d[e].y * c);
  22266. D.ya(d);
  22267. X(a);
  22268. b = a.q;
  22269. b.C = new S(.17, .251);
  22270. b.D = new S(.833, .755);
  22271. D.u(a);
  22272. return b
  22273. },
  22274. SevenPointedStar: function(a, b, c) {
  22275. var d = cr(7);
  22276. a = D.v();
  22277. T(a, d[0].x * b, d[0].y * c, !0);
  22278. for (var e = 1; 14 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22279. D.ya(d);
  22280. X(a);
  22281. b = a.q;
  22282. b.C = new S(.363, .361);
  22283. b.D = new S(.641, .709);
  22284. D.u(a);
  22285. return b
  22286. },
  22287. EightPointedStar: function(a, b, c) {
  22288. var d = cr(8);
  22289. a = D.v();
  22290. T(a, d[0].x * b, d[0].y * c, !0);
  22291. for (var e = 1; 16 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22292. D.ya(d);
  22293. X(a);
  22294. b = a.q;
  22295. b.C = new S(.252, .255);
  22296. b.D = new S(.75, .75);
  22297. D.u(a);
  22298. return b
  22299. },
  22300. NinePointedStar: function(a,
  22301. b, c) {
  22302. var d = cr(9);
  22303. a = D.v();
  22304. T(a, d[0].x * b, d[0].y * c, !0);
  22305. for (var e = 1; 18 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22306. D.ya(d);
  22307. X(a);
  22308. b = a.q;
  22309. b.C = new S(.355, .361);
  22310. b.D = new S(.645, .651);
  22311. D.u(a);
  22312. return b
  22313. },
  22314. TenPointedStar: function(a, b, c) {
  22315. var d = cr(10);
  22316. a = D.v();
  22317. T(a, d[0].x * b, d[0].y * c, !0);
  22318. for (var e = 1; 20 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
  22319. D.ya(d);
  22320. X(a);
  22321. b = a.q;
  22322. b.C = new S(.281, .261);
  22323. b.D = new S(.723, .748);
  22324. D.u(a);
  22325. return b
  22326. },
  22327. FivePointedBurst: function(a, b, c) {
  22328. var d = br(5);
  22329. a = D.v();
  22330. T(a, d[0].x * b, d[0].y * c, !0);
  22331. for (var e = 1; e < d.length; e += 3) U(a, d[e].x *
  22332. b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
  22333. D.ya(d);
  22334. X(a);
  22335. b = a.q;
  22336. b.C = new S(.312, .383);
  22337. b.D = new S(.693, .765);
  22338. D.u(a);
  22339. return b
  22340. },
  22341. SixPointedBurst: function(a, b, c) {
  22342. var d = br(6);
  22343. a = D.v();
  22344. T(a, d[0].x * b, d[0].y * c, !0);
  22345. for (var e = 1; e < d.length; e += 3) U(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
  22346. D.ya(d);
  22347. X(a);
  22348. b = a.q;
  22349. b.C = new S(.17, .251);
  22350. b.D = new S(.833, .755);
  22351. D.u(a);
  22352. return b
  22353. },
  22354. SevenPointedBurst: function(a, b, c) {
  22355. var d = br(7);
  22356. a = D.v();
  22357. T(a, d[0].x * b, d[0].y * c, !0);
  22358. for (var e = 1; e < d.length; e += 3) U(a, d[e].x *
  22359. b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
  22360. D.ya(d);
  22361. X(a);
  22362. b = a.q;
  22363. b.C = new S(.363, .361);
  22364. b.D = new S(.641, .709);
  22365. D.u(a);
  22366. return b
  22367. },
  22368. EightPointedBurst: function(a, b, c) {
  22369. var d = br(8);
  22370. a = D.v();
  22371. T(a, d[0].x * b, d[0].y * c, !0);
  22372. for (var e = 1; e < d.length; e += 3) U(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
  22373. D.ya(d);
  22374. X(a);
  22375. b = a.q;
  22376. b.C = new S(.252, .255);
  22377. b.D = new S(.75, .75);
  22378. D.u(a);
  22379. return b
  22380. },
  22381. NinePointedBurst: function(a, b, c) {
  22382. var d = br(9);
  22383. a = D.v();
  22384. T(a, d[0].x * b, d[0].y * c, !0);
  22385. for (var e = 1; e < d.length; e += 3) U(a, d[e].x *
  22386. b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
  22387. D.ya(d);
  22388. X(a);
  22389. b = a.q;
  22390. b.C = new S(.355, .361);
  22391. b.D = new S(.645, .651);
  22392. D.u(a);
  22393. return b
  22394. },
  22395. TenPointedBurst: function(a, b, c) {
  22396. var d = br(10);
  22397. a = D.v();
  22398. T(a, d[0].x * b, d[0].y * c, !0);
  22399. for (var e = 1; e < d.length; e += 3) U(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
  22400. D.ya(d);
  22401. X(a);
  22402. b = a.q;
  22403. b.C = new S(.281, .261);
  22404. b.D = new S(.723, .748);
  22405. D.u(a);
  22406. return b
  22407. },
  22408. Cloud: function(a, b, c) {
  22409. a = D.v();
  22410. T(a, .08034461 * b, .1944299 * c, !0);
  22411. U(a, -.09239631 * b, .07836421 * c, .1406031 * b, -.0542823 * c, .2008615 *
  22412. b, .05349299 * c);
  22413. U(a, .2450511 * b, -.00697547 * c, .3776197 * b, -.01112067 * c, .4338609 * b, .074219 * c);
  22414. U(a, .4539471 * b, 0, .6066018 * b, -.02526587 * c, .6558228 * b, .07004196 * c);
  22415. U(a, .6914277 * b, -.01904177 * c, .8921095 * b, -.01220843 * c, .8921095 * b, .08370865 * c);
  22416. U(a, 1.036446 * b, .04105738 * c, 1.020377 * b, .3022052 * c, .9147671 * b, .3194596 * c);
  22417. U(a, 1.04448 * b, .360238 * c, .992256 * b, .5219009 * c, .9082935 * b, .562044 * c);
  22418. U(a, 1.032337 * b, .5771781 * c, 1.018411 * b, .8120651 * c, .9212406 * b, .8217117 * c);
  22419. U(a, 1.028411 * b, .9571472 * c, .8556702 * b, 1.052487 * c, .7592566 * b, .9156953 *
  22420. c);
  22421. U(a, .7431877 * b, 1.009325 * c, .5624123 * b, 1.021761 * c, .5101666 * b, .9310455 * c);
  22422. U(a, .4820677 * b, 1.031761 * c, .3030112 * b, 1.002796 * c, .2609328 * b, .9344623 * c);
  22423. U(a, .2329994 * b, 1.01518 * c, .03213784 * b, 1.01518 * c, .08034461 * b, .870098 * c);
  22424. U(a, -.02812061 * b, .9032597 * c, -.01205169 * b, .6835638 * c, .06829292 * b, .6545475 * c);
  22425. U(a, -.01812061 * b, .6089503 * c, -.00606892 * b, .4555777 * c, .06427569 * b, .4265613 * c);
  22426. U(a, -.01606892 * b, .3892545 * c, -.01205169 * b, .1944299 * c, .08034461 * b, .1944299 * c);
  22427. X(a);
  22428. b = a.q;
  22429. b.C = new S(.1, .1);
  22430. b.D = new S(.9, .9);
  22431. D.u(a);
  22432. return b
  22433. },
  22434. Gate: "Crescent",
  22435. Crescent: function(a, b, c) {
  22436. a = D.v();
  22437. T(a, 0, 0, !0);
  22438. U(a, 1 * b, 0, 1 * b, 1 * c, 0, 1 * c);
  22439. U(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0);
  22440. X(a);
  22441. b = a.q;
  22442. b.C = new S(.511, .19);
  22443. b.D = new S(.776, .76);
  22444. D.u(a);
  22445. return b
  22446. },
  22447. FramedRectangle: function(a, b, c) {
  22448. var d = D.v(),
  22449. e = a ? a.Sc : NaN;
  22450. a = a ? a.ev : NaN;
  22451. isNaN(e) && (e = .1);
  22452. isNaN(a) && (a = .1);
  22453. T(d, 0, 0, !0);
  22454. d.lineTo(1 * b, 0);
  22455. d.lineTo(1 * b, 1 * c);
  22456. d.lineTo(0, 1 * c, !0);
  22457. T(d, e * b, a * c, !1, !0);
  22458. d.lineTo(e * b, (1 - a) * c);
  22459. d.lineTo((1 - e) * b, (1 - a) * c);
  22460. d.lineTo((1 - e) * b, a * c, !0);
  22461. b = d.q;
  22462. b.C = new S(e, a);
  22463. b.D = new S(1 - e, 1 - a);
  22464. D.u(d);
  22465. return b
  22466. },
  22467. Delay: "HalfEllipse",
  22468. HalfEllipse: function(a, b, c) {
  22469. a = D.v();
  22470. T(a, 0, 0, !0);
  22471. U(a, Jd * b, 0, 1 * b, (.5 - Jd / 2) * c, 1 * b, .5 * c);
  22472. U(a, 1 * b, (.5 + Jd / 2) * c, Jd * b, 1 * c, 0, 1 * c);
  22473. X(a);
  22474. b = a.q;
  22475. b.C = new S(0, .2);
  22476. b.D = new S(.75, .8);
  22477. D.u(a);
  22478. return b
  22479. },
  22480. Heart: function(a, b, c) {
  22481. a = D.v();
  22482. T(a, .5 * b, 1 * c, !0);
  22483. U(a, .1 * b, .8 * c, 0, .5 * c, 0 * b, .3 * c);
  22484. U(a, 0 * b, 0, .45 * b, 0, .5 * b, .3 * c);
  22485. U(a, .55 * b, 0, 1 * b, 0, 1 * b, .3 * c);
  22486. U(a, b, .5 * c, .9 * b, .8 * c, .5 * b, 1 * c);
  22487. X(a);
  22488. b = a.q;
  22489. b.C = new S(.15, .29);
  22490. b.D = new S(.86, .68);
  22491. D.u(a);
  22492. return b
  22493. },
  22494. Spade: function(a, b, c) {
  22495. a = D.v();
  22496. T(a, .5 * b, 0, !0);
  22497. a.lineTo(.51 * b, .01 * c);
  22498. U(a, .6 * b, .2 * c, b, .25 * c, b, .5 * c);
  22499. U(a, b, .8 * c, .6 * b, .8 * c, .55 * b, .7 * c);
  22500. U(a, .5 * b, .75 * c, .55 * b, .95 * c, .75 * b, c);
  22501. a.lineTo(.25 * b, c);
  22502. U(a, .45 * b, .95 * c, .5 * b, .75 * c, .45 * b, .7 * c);
  22503. U(a, .4 * b, .8 * c, 0, .8 * c, 0, .5 * c);
  22504. U(a, 0, .25 * c, .4 * b, .2 * c, .49 * b, .01 * c);
  22505. X(a);
  22506. b = a.q;
  22507. b.C = new S(.19, .26);
  22508. b.D = new S(.8, .68);
  22509. D.u(a);
  22510. return b
  22511. },
  22512. Club: function(a, b, c) {
  22513. a = D.v();
  22514. T(a, .4 * b, .6 * c, !0);
  22515. U(a, .5 * b, .75 * c, .45 * b, .95 * c, .15 * b, 1 * c);
  22516. a.lineTo(.85 * b, c);
  22517. U(a, .55 * b, .95 * c, .5 * b, .75 * c, .6 * b, .6 * c);
  22518. var d = .2,
  22519. e = .3,
  22520. g = 0,
  22521. h = 4 * (Math.SQRT2 - 1) / 3 * d;
  22522. U(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) *
  22523. b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
  22524. U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
  22525. U(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
  22526. U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e + .05) * b, (.5 - h + g - .02) * c, .65 * b, .36771243 * c);
  22527. d = .2;
  22528. e = 0;
  22529. g = -.3;
  22530. h = 4 * (Math.SQRT2 - 1) / 3 * d;
  22531. U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
  22532. U(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
  22533. U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
  22534. U(a, (.5 - d +
  22535. e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, .35 * b, .36771243 * c);
  22536. d = .2;
  22537. e = -.3;
  22538. g = 0;
  22539. h = 4 * (Math.SQRT2 - 1) / 3 * d;
  22540. U(a, (.5 + d + e - .05) * b, (.5 - h + g - .02) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
  22541. U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
  22542. U(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
  22543. U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, .4 * b, .6 * c);
  22544. X(a);
  22545. b = a.q;
  22546. b.C = new S(.06, .39);
  22547. b.D = new S(.93, .58);
  22548. D.u(a);
  22549. return b
  22550. },
  22551. Ring: function(a, b, c) {
  22552. a = D.v();
  22553. var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
  22554. T(a, b, .5 *
  22555. c, !0);
  22556. U(a, b, (.5 - d) * c, (.5 + d) * b, 0, .5 * b, 0);
  22557. U(a, (.5 - d) * b, 0, 0, (.5 - d) * c, 0, .5 * c);
  22558. U(a, 0, (.5 + d) * c, (.5 - d) * b, c, .5 * b, c);
  22559. U(a, (.5 + d) * b, c, b, (.5 + d) * c, b, .5 * c);
  22560. d = 4 * (Math.SQRT2 - 1) / 3 * .4;
  22561. T(a, .5 * b, .1 * c, !0, !0);
  22562. U(a, (.5 + d) * b, .1 * c, .9 * b, (.5 - d) * c, .9 * b, .5 * c);
  22563. U(a, .9 * b, (.5 + d) * c, (.5 + d) * b, .9 * c, .5 * b, .9 * c);
  22564. U(a, (.5 - d) * b, .9 * c, .1 * b, (.5 + d) * c, .1 * b, .5 * c);
  22565. U(a, .1 * b, (.5 - d) * c, (.5 - d) * b, .1 * c, .5 * b, .1 * c);
  22566. b = a.q;
  22567. b.C = new S(.146, .146);
  22568. b.D = new S(.853, .853);
  22569. b.le = bk;
  22570. D.u(a);
  22571. return b
  22572. },
  22573. YinYang: function(a, b, c) {
  22574. var d = .5;
  22575. a = D.v();
  22576. d = .5;
  22577. T(a, .5 * b, 0, !0);
  22578. a.arcTo(270,
  22579. 180, .5 * b, .5 * b, .5 * b);
  22580. U(a, 1 * b, d * c, 0, d * c, d * b, 0, !0);
  22581. var d = .1,
  22582. e = .25;
  22583. T(a, (.5 + d) * b, e * c, !0, !0);
  22584. a.arcTo(0, -360, .5 * b, c * e, d * b);
  22585. X(a);
  22586. T(a, .5 * b, 0, !1);
  22587. a.arcTo(270, -180, .5 * b, .5 * b, .5 * b);
  22588. a.jb(!1);
  22589. e = .75;
  22590. T(a, (.5 + d) * b, e * c, !0);
  22591. a.arcTo(0, 360, .5 * b, c * e, d * b);
  22592. X(a);
  22593. b = a.q;
  22594. b.le = bk;
  22595. D.u(a);
  22596. return b
  22597. },
  22598. Peace: function(a, b, c) {
  22599. a = D.v();
  22600. var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
  22601. T(a, b, .5 * c, !0);
  22602. U(a, b, (.5 - d) * c, (.5 + d) * b, 0, .5 * b, 0);
  22603. U(a, (.5 - d) * b, 0, 0, (.5 - d) * c, 0, .5 * c);
  22604. U(a, 0, (.5 + d) * c, (.5 - d) * b, c, .5 * b, c);
  22605. U(a, (.5 + d) * b, c, b, (.5 + d) * c, b, .5 * c);
  22606. d = 4 * (Math.SQRT2 - 1) / 3 * .4;
  22607. T(a, .5 * b, .1 * c, !0, !0);
  22608. U(a, (.5 + d) * b, .1 * c, .9 * b, (.5 - d) * c, .9 * b, .5 * c);
  22609. U(a, .9 * b, (.5 + d) * c, (.5 + d) * b, .9 * c, .5 * b, .9 * c);
  22610. U(a, (.5 - d) * b, .9 * c, .1 * b, (.5 + d) * c, .1 * b, .5 * c);
  22611. U(a, .1 * b, (.5 - d) * c, (.5 - d) * b, .1 * c, .5 * b, .1 * c);
  22612. var d = .07,
  22613. e = 0,
  22614. g = -.707 * .11,
  22615. h = 4 * (Math.SQRT2 - 1) / 3 * d;
  22616. T(a, (.5 + d + e) * b, (.5 + g) * c, !0);
  22617. U(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
  22618. U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
  22619. U(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
  22620. U(a, (.5 + h + e) * b, (.5 + d + g) *
  22621. c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
  22622. d = .07;
  22623. e = -.707 * .11;
  22624. g = .707 * .11;
  22625. h = 4 * (Math.SQRT2 - 1) / 3 * d;
  22626. T(a, (.5 + d + e) * b, (.5 + g) * c, !0);
  22627. U(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
  22628. U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
  22629. U(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
  22630. U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
  22631. d = .07;
  22632. e = .707 * .11;
  22633. g = .707 * .11;
  22634. h = 4 * (Math.SQRT2 - 1) / 3 * d;
  22635. T(a, (.5 + d + e) * b, (.5 + g) * c, !0);
  22636. U(a, (.5 + d + e) * b, (.5 - h +
  22637. g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
  22638. U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
  22639. U(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
  22640. U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
  22641. b = a.q;
  22642. b.C = new S(.146, .146);
  22643. b.D = new S(.853, .853);
  22644. b.le = bk;
  22645. D.u(a);
  22646. return b
  22647. },
  22648. NotAllowed: function(a, b, c) {
  22649. var d = .5 * Jd,
  22650. e = .5;
  22651. a = D.v();
  22652. T(a, .5 * b, (.5 - e) * c, !0);
  22653. U(a, (.5 - d) * b, (.5 - e) * c, (.5 - e) * b, (.5 - d) * c, (.5 - e) * b, .5 * c);
  22654. U(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b,
  22655. (.5 + e) * c);
  22656. U(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 + e) * b, .5 * c);
  22657. U(a, (.5 + e) * b, (.5 - d) * c, (.5 + d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
  22658. var e = .4,
  22659. d = .4 * Jd,
  22660. g = D.P(),
  22661. h = D.P(),
  22662. k = D.P(),
  22663. l = D.P();
  22664. Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .42, g, h, k, l, l);
  22665. var m = D.P(),
  22666. n = D.P(),
  22667. p = D.P();
  22668. Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .58, l, l, p, m, n);
  22669. var q = D.P(),
  22670. r = D.P(),
  22671. s = D.P();
  22672. Ce(.5, .5 + e, .5 - d, .5 + e, .5 - e, .5 + d, .5 - e, .5, .42, q, r, s, l, l);
  22673. var u = D.P(),
  22674. t = D.P(),
  22675. y = D.P();
  22676. Ce(.5, .5 + e, .5 - d, .5 + e, .5 - e, .5 + d, .5 - e, .5, .58, l, l, y, u, t);
  22677. T(a, y.x * b, y.y * c, !0, !0);
  22678. U(a, u.x * b,
  22679. u.y * c, t.x * b, t.y * c, (.5 - e) * b, .5 * c);
  22680. U(a, (.5 - e) * b, (.5 - d) * c, (.5 - d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
  22681. U(a, g.x * b, g.y * c, h.x * b, h.y * c, k.x * b, k.y * c);
  22682. a.lineTo(y.x * b, y.y * c);
  22683. X(a);
  22684. T(a, s.x * b, s.y * c, !0, !0);
  22685. a.lineTo(p.x * b, p.y * c);
  22686. U(a, m.x * b, m.y * c, n.x * b, n.y * c, (.5 + e) * b, .5 * c);
  22687. U(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
  22688. U(a, q.x * b, q.y * c, r.x * b, r.y * c, s.x * b, s.y * c);
  22689. X(a);
  22690. D.A(g);
  22691. D.A(h);
  22692. D.A(k);
  22693. D.A(l);
  22694. D.A(m);
  22695. D.A(n);
  22696. D.A(p);
  22697. D.A(q);
  22698. D.A(r);
  22699. D.A(s);
  22700. D.A(u);
  22701. D.A(t);
  22702. D.A(y);
  22703. b = a.q;
  22704. D.u(a);
  22705. b.le = bk;
  22706. return b
  22707. },
  22708. Fragile: function(a, b, c) {
  22709. a = D.v();
  22710. T(a,
  22711. 0, 0, !0);
  22712. a.lineTo(.25 * b, 0);
  22713. a.lineTo(.2 * b, .15 * c);
  22714. a.lineTo(.3 * b, .25 * c);
  22715. a.lineTo(.29 * b, .33 * c);
  22716. a.lineTo(.35 * b, .25 * c);
  22717. a.lineTo(.3 * b, .15 * c);
  22718. a.lineTo(.4 * b, 0);
  22719. a.lineTo(1 * b, 0);
  22720. U(a, 1 * b, .25 * c, .75 * b, .5 * c, .55 * b, .5 * c);
  22721. a.lineTo(.55 * b, .9 * c);
  22722. a.lineTo(.7 * b, .9 * c);
  22723. a.lineTo(.7 * b, 1 * c);
  22724. a.lineTo(.3 * b, 1 * c);
  22725. a.lineTo(.3 * b, .9 * c);
  22726. a.lineTo(.45 * b, .9 * c);
  22727. a.lineTo(.45 * b, .5 * c);
  22728. U(a, .25 * b, .5 * c, 0, .25 * c, 0, 0);
  22729. X(a);
  22730. b = a.q;
  22731. b.C = new S(.25, 0);
  22732. b.D = new S(.75, .4);
  22733. D.u(a);
  22734. return b
  22735. },
  22736. HourGlass: function(a, b, c) {
  22737. a = D.v();
  22738. T(a, .65 * b, .5 * c, !0);
  22739. a.lineTo(1 * b,
  22740. 1 * c);
  22741. a.lineTo(0, 1 * c);
  22742. a.lineTo(.35 * b, .5 * c);
  22743. a.lineTo(0, 0);
  22744. a.lineTo(1 * b, 0);
  22745. X(a);
  22746. b = a.q;
  22747. D.u(a);
  22748. return b
  22749. },
  22750. Lightning: function(a, b, c) {
  22751. a = D.v();
  22752. T(a, 0 * b, .55 * c, !0);
  22753. a.lineTo(.75 * b, 0);
  22754. a.lineTo(.25 * b, .45 * c);
  22755. a.lineTo(.9 * b, .48 * c);
  22756. a.lineTo(.4 * b, 1 * c);
  22757. a.lineTo(.65 * b, .55 * c);
  22758. X(a);
  22759. b = a.q;
  22760. D.u(a);
  22761. return b
  22762. },
  22763. Parallelogram1: function(a, b, c) {
  22764. a = a ? a.Sc : NaN;
  22765. isNaN(a) && (a = .1);
  22766. var d = D.v();
  22767. T(d, a * b, 0, !0);
  22768. d.lineTo(1 * b, 0);
  22769. d.lineTo((1 - a) * b, 1 * c);
  22770. d.lineTo(0, 1 * c);
  22771. X(d);
  22772. b = d.q;
  22773. b.C = new S(a, 0);
  22774. b.D = new S(1 - a, 1);
  22775. D.u(d);
  22776. return b
  22777. },
  22778. Input: "Output",
  22779. Output: function(a,
  22780. b, c) {
  22781. a = D.v();
  22782. T(a, 0, 1 * c, !0);
  22783. a.lineTo(.1 * b, 0);
  22784. a.lineTo(1 * b, 0);
  22785. a.lineTo(.9 * b, 1 * c);
  22786. X(a);
  22787. b = a.q;
  22788. b.C = new S(.1, 0);
  22789. b.D = new S(.9, 1);
  22790. D.u(a);
  22791. return b
  22792. },
  22793. Parallelogram2: function(a, b, c) {
  22794. a = a ? a.Sc : NaN;
  22795. isNaN(a) && (a = .25);
  22796. var d = D.v();
  22797. T(d, a * b, 0, !0);
  22798. d.lineTo(1 * b, 0);
  22799. d.lineTo((1 - a) * b, 1 * c);
  22800. d.lineTo(0, 1 * c);
  22801. X(d);
  22802. b = d.q;
  22803. b.C = new S(a, 0);
  22804. b.D = new S(1 - a, 1);
  22805. D.u(d);
  22806. return b
  22807. },
  22808. ThickCross: function(a, b, c) {
  22809. a = a ? a.Sc : NaN;
  22810. isNaN(a) && (a = .25);
  22811. var d = D.v();
  22812. T(d, (.5 - a / 2) * b, 0, !0);
  22813. d.lineTo((.5 + a / 2) * b, 0);
  22814. d.lineTo((.5 + a / 2) * b, (.5 - a / 2) * c);
  22815. d.lineTo(1 * b, (.5 -
  22816. a / 2) * c);
  22817. d.lineTo(1 * b, (.5 + a / 2) * c);
  22818. d.lineTo((.5 + a / 2) * b, (.5 + a / 2) * c);
  22819. d.lineTo((.5 + a / 2) * b, 1 * c);
  22820. d.lineTo((.5 - a / 2) * b, 1 * c);
  22821. d.lineTo((.5 - a / 2) * b, (.5 + a / 2) * c);
  22822. d.lineTo(0, (.5 + a / 2) * c);
  22823. d.lineTo(0, (.5 - a / 2) * c);
  22824. d.lineTo((.5 - a / 2) * b, (.5 - a / 2) * c);
  22825. X(d);
  22826. b = d.q;
  22827. b.C = new S(.5 - a / 2, .5 - a / 2);
  22828. b.D = new S(.5 + a / 2, .5 + a / 2);
  22829. D.u(d);
  22830. return b
  22831. },
  22832. ThickX: function(a, b, c) {
  22833. a = .25 / Math.SQRT2;
  22834. var d = D.v();
  22835. T(d, .3 * b, 0, !0);
  22836. d.lineTo(.5 * b, .2 * c);
  22837. d.lineTo(.7 * b, 0);
  22838. d.lineTo(1 * b, .3 * c);
  22839. d.lineTo(.8 * b, .5 * c);
  22840. d.lineTo(1 * b, .7 * c);
  22841. d.lineTo(.7 * b, 1 * c);
  22842. d.lineTo(.5 * b, .8 *
  22843. c);
  22844. d.lineTo(.3 * b, 1 * c);
  22845. d.lineTo(0, .7 * c);
  22846. d.lineTo(.2 * b, .5 * c);
  22847. d.lineTo(0, .3 * c);
  22848. X(d);
  22849. b = d.q;
  22850. b.C = new S(.5 - a, .5 - a);
  22851. b.D = new S(.5 + a, .5 + a);
  22852. D.u(d);
  22853. return b
  22854. },
  22855. ThinCross: function(a, b, c) {
  22856. var d = a ? a.Sc : NaN;
  22857. isNaN(d) && (d = .1);
  22858. a = D.v();
  22859. T(a, (.5 - d / 2) * b, 0, !0);
  22860. a.lineTo((.5 + d / 2) * b, 0);
  22861. a.lineTo((.5 + d / 2) * b, (.5 - d / 2) * c);
  22862. a.lineTo(1 * b, (.5 - d / 2) * c);
  22863. a.lineTo(1 * b, (.5 + d / 2) * c);
  22864. a.lineTo((.5 + d / 2) * b, (.5 + d / 2) * c);
  22865. a.lineTo((.5 + d / 2) * b, 1 * c);
  22866. a.lineTo((.5 - d / 2) * b, 1 * c);
  22867. a.lineTo((.5 - d / 2) * b, (.5 + d / 2) * c);
  22868. a.lineTo(0, (.5 + d / 2) * c);
  22869. a.lineTo(0, (.5 - d / 2) * c);
  22870. a.lineTo((.5 -
  22871. d / 2) * b, (.5 - d / 2) * c);
  22872. X(a);
  22873. b = a.q;
  22874. D.u(a);
  22875. return b
  22876. },
  22877. ThinX: function(a, b, c) {
  22878. a = D.v();
  22879. T(a, .1 * b, 0, !0);
  22880. a.lineTo(.5 * b, .4 * c);
  22881. a.lineTo(.9 * b, 0);
  22882. a.lineTo(1 * b, .1 * c);
  22883. a.lineTo(.6 * b, .5 * c);
  22884. a.lineTo(1 * b, .9 * c);
  22885. a.lineTo(.9 * b, 1 * c);
  22886. a.lineTo(.5 * b, .6 * c);
  22887. a.lineTo(.1 * b, 1 * c);
  22888. a.lineTo(0, .9 * c);
  22889. a.lineTo(.4 * b, .5 * c);
  22890. a.lineTo(0, .1 * c);
  22891. X(a);
  22892. b = a.q;
  22893. D.u(a);
  22894. return b
  22895. },
  22896. RightTriangle: function(a, b, c) {
  22897. a = D.v();
  22898. T(a, 0, 0, !0);
  22899. a.lineTo(1 * b, 1 * c);
  22900. a.lineTo(0, 1 * c);
  22901. X(a);
  22902. b = a.q;
  22903. b.C = new S(0, .5);
  22904. b.D = new S(.5, 1);
  22905. D.u(a);
  22906. return b
  22907. },
  22908. RoundedIBeam: function(a, b, c) {
  22909. a =
  22910. D.v();
  22911. T(a, 0, 0, !0);
  22912. a.lineTo(1 * b, 0);
  22913. U(a, .5 * b, .25 * c, .5 * b, .75 * c, 1 * b, 1 * c);
  22914. a.lineTo(0, 1 * c);
  22915. U(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0);
  22916. X(a);
  22917. b = a.q;
  22918. D.u(a);
  22919. return b
  22920. },
  22921. RoundedRectangle: function(a, b, c) {
  22922. var d = a ? a.Sc : NaN;
  22923. isNaN(d) && (d = 5);
  22924. d = Math.min(d, b / 3);
  22925. d = Math.min(d, c / 3);
  22926. a = d * Jd;
  22927. var e = D.v();
  22928. T(e, d, 0, !0);
  22929. e.lineTo(b - d, 0);
  22930. U(e, b - a, 0, b, a, b, d);
  22931. e.lineTo(b, c - d);
  22932. U(e, b, c - a, b - a, c, b - d, c);
  22933. e.lineTo(d, c);
  22934. U(e, a, c, 0, c - a, 0, c - d);
  22935. e.lineTo(0, d);
  22936. U(e, 0, a, a, 0, d, 0);
  22937. X(e);
  22938. b = e.q;
  22939. 1 < a ? (b.C = new S(0, 0, a, a), b.D = new S(1, 1, -a, -a)) : (b.C = ec, b.D = vc);
  22940. D.u(e);
  22941. return b
  22942. },
  22943. Border: function(a, b, c) {
  22944. var d = a ? a.Sc : NaN;
  22945. isNaN(d) && (d = 5);
  22946. d = Math.min(d, b / 3);
  22947. d = Math.min(d, c / 3);
  22948. a = D.v();
  22949. T(a, d, 0, !0);
  22950. a.lineTo(b - d, 0);
  22951. U(a, b - 0, 0, b, 0, b, d);
  22952. a.lineTo(b, c - d);
  22953. U(a, b, c - 0, b - 0, c, b - d, c);
  22954. a.lineTo(d, c);
  22955. U(a, 0, c, 0, c - 0, 0, c - d);
  22956. a.lineTo(0, d);
  22957. U(a, 0, 0, 0, 0, d, 0);
  22958. X(a);
  22959. b = a.q;
  22960. b.C = ec;
  22961. b.D = vc;
  22962. D.u(a);
  22963. return b
  22964. },
  22965. SquareIBeam: function(a, b, c) {
  22966. var d = a ? a.Sc : NaN;
  22967. isNaN(d) && (d = .2);
  22968. a = D.v();
  22969. T(a, 0, 0, !0);
  22970. a.lineTo(1 * b, 0);
  22971. a.lineTo(1 * b, d * c);
  22972. a.lineTo((.5 + d / 2) * b, d * c);
  22973. a.lineTo((.5 + d / 2) * b, (1 - d) * c);
  22974. a.lineTo(1 * b, (1 - d) * c);
  22975. a.lineTo(1 * b, 1 *
  22976. c);
  22977. a.lineTo(0, 1 * c);
  22978. a.lineTo(0, (1 - d) * c);
  22979. a.lineTo((.5 - d / 2) * b, (1 - d) * c);
  22980. a.lineTo((.5 - d / 2) * b, d * c);
  22981. a.lineTo(0, d * c);
  22982. X(a);
  22983. b = a.q;
  22984. D.u(a);
  22985. return b
  22986. },
  22987. Trapezoid: function(a, b, c) {
  22988. a = a ? a.Sc : NaN;
  22989. isNaN(a) && (a = .2);
  22990. var d = D.v();
  22991. T(d, a * b, 0, !0);
  22992. d.lineTo((1 - a) * b, 0);
  22993. d.lineTo(1 * b, 1 * c);
  22994. d.lineTo(0, 1 * c);
  22995. X(d);
  22996. b = d.q;
  22997. b.C = new S(a, 0);
  22998. b.D = new S(1 - a, 1);
  22999. D.u(d);
  23000. return b
  23001. },
  23002. ManualLoop: "ManualOperation",
  23003. ManualOperation: function(a, b, c) {
  23004. var d = a ? a.Sc : NaN;
  23005. isNaN(d) && (d = 0);
  23006. a = D.v();
  23007. T(a, d, 0, !0);
  23008. a.lineTo(0, 0);
  23009. a.lineTo(1 * b, 0);
  23010. a.lineTo(.9 * b, 1 * c);
  23011. a.lineTo(.1 *
  23012. b, 1 * c);
  23013. X(a);
  23014. b = a.q;
  23015. b.C = new S(.1, 0);
  23016. b.D = new S(.9, 1);
  23017. D.u(a);
  23018. return b
  23019. },
  23020. GenderMale: function(a, b, c) {
  23021. a = D.v();
  23022. var d = .4 * Jd,
  23023. e = .4,
  23024. g = D.P(),
  23025. h = D.P(),
  23026. k = D.P(),
  23027. l = D.P();
  23028. T(a, (.5 - e) * b, .5 * c, !0);
  23029. U(a, (.5 - e) * b, (.5 - d) * c, (.5 - d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
  23030. Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .44, k, l, h, g, g);
  23031. U(a, k.x * b, k.y * c, l.x * b, l.y * c, h.x * b, h.y * c);
  23032. var m = D.Fb(h.x, h.y);
  23033. Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .56, g, g, h, k, l);
  23034. var n = D.Fb(h.x, h.y);
  23035. a.lineTo((.1 * m.x + .855) * b, .1 * m.y * c);
  23036. a.lineTo(.85 * b, .1 * m.y * c);
  23037. a.lineTo(.85 * b, 0);
  23038. a.lineTo(1 *
  23039. b, 0);
  23040. a.lineTo(1 * b, .15 * c);
  23041. a.lineTo((.1 * n.x + .9) * b, .15 * c);
  23042. a.lineTo((.1 * n.x + .9) * b, (.1 * n.y + .05 * .9) * c);
  23043. a.lineTo(n.x * b, n.y * c);
  23044. U(a, k.x * b, k.y * c, l.x * b, l.y * c, (.5 + e) * b, .5 * c);
  23045. U(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
  23046. U(a, (.5 - d) * b, (.5 + e) * c, (.5 - e) * b, (.5 + d) * c, (.5 - e) * b, .5 * c);
  23047. e = .35;
  23048. d = .35 * Jd;
  23049. T(a, .5 * b, (.5 - e) * c, !0, !0);
  23050. U(a, (.5 - d) * b, (.5 - e) * c, (.5 - e) * b, (.5 - d) * c, (.5 - e) * b, .5 * c);
  23051. U(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
  23052. U(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 + e) * b, .5 * c);
  23053. U(a, (.5 + e) * b, (.5 - d) * c, (.5 +
  23054. d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
  23055. T(a, (.5 - e) * b, .5 * c, !0);
  23056. D.A(g);
  23057. D.A(h);
  23058. D.A(k);
  23059. D.A(l);
  23060. D.A(m);
  23061. D.A(n);
  23062. b = a.q;
  23063. b.C = new S(.202, .257);
  23064. b.D = new S(.692, .839);
  23065. b.le = bk;
  23066. D.u(a);
  23067. return b
  23068. },
  23069. GenderFemale: function(a, b, c) {
  23070. a = D.v();
  23071. var d = .375,
  23072. e = 0,
  23073. g = -.125,
  23074. h = 4 * (Math.SQRT2 - 1) / 3 * d;
  23075. T(a, (.525 + e) * b, (.5 + d + g) * c, !0);
  23076. U(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
  23077. U(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
  23078. U(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
  23079. U(a, (.5 - d + e) * b,
  23080. (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.475 + e) * b, (.5 + d + g) * c);
  23081. a.lineTo(.475 * b, .85 * c);
  23082. a.lineTo(.425 * b, .85 * c);
  23083. a.lineTo(.425 * b, .9 * c);
  23084. a.lineTo(.475 * b, .9 * c);
  23085. a.lineTo(.475 * b, 1 * c);
  23086. a.lineTo(.525 * b, 1 * c);
  23087. a.lineTo(.525 * b, .9 * c);
  23088. a.lineTo(.575 * b, .9 * c);
  23089. a.lineTo(.575 * b, .85 * c);
  23090. a.lineTo(.525 * b, .85 * c);
  23091. X(a);
  23092. d = .325;
  23093. e = 0;
  23094. g = -.125;
  23095. h = 4 * (Math.SQRT2 - 1) / 3 * d;
  23096. T(a, (.5 + d + e) * b, (.5 + g) * c, !0, !0);
  23097. U(a, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
  23098. U(a, (.5 - h + e) * b, (.5 + d + g) * c, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
  23099. U(a, (.5 -
  23100. d + e) * b, (.5 - h + g) * c, (.5 - h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
  23101. U(a, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
  23102. T(a, (.525 + e) * b, (.5 + d + g) * c, !0);
  23103. b = a.q;
  23104. b.C = new S(.232, .136);
  23105. b.D = new S(.782, .611);
  23106. b.le = bk;
  23107. D.u(a);
  23108. return b
  23109. },
  23110. PlusLine: function(a, b, c) {
  23111. a = D.v();
  23112. T(a, 0, .5 * c, !1);
  23113. a.lineTo(1 * b, .5 * c);
  23114. a.moveTo(.5 * b, 0);
  23115. a.lineTo(.5 * b, 1 * c);
  23116. b = a.q;
  23117. D.u(a);
  23118. return b
  23119. },
  23120. XLine: function(a, b, c) {
  23121. a = D.v();
  23122. T(a, 0, 1 * c, !1);
  23123. a.lineTo(1 * b, 0);
  23124. a.moveTo(0, 0);
  23125. a.lineTo(1 * b, 1 * c);
  23126. b = a.q;
  23127. D.u(a);
  23128. return b
  23129. },
  23130. AsteriskLine: function(a, b, c) {
  23131. a =
  23132. D.v();
  23133. var d = .2 / Math.SQRT2;
  23134. T(a, d * b, (1 - d) * c, !1);
  23135. a.lineTo((1 - d) * b, d * c);
  23136. a.moveTo(d * b, d * c);
  23137. a.lineTo((1 - d) * b, (1 - d) * c);
  23138. a.moveTo(0 * b, .5 * c);
  23139. a.lineTo(1 * b, .5 * c);
  23140. a.moveTo(.5 * b, 0 * c);
  23141. a.lineTo(.5 * b, 1 * c);
  23142. b = a.q;
  23143. D.u(a);
  23144. return b
  23145. },
  23146. CircleLine: function(a, b, c) {
  23147. var d = .5 * Jd;
  23148. a = D.v();
  23149. T(a, 1 * b, .5 * c, !1);
  23150. U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  23151. U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
  23152. U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
  23153. U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  23154. b = a.q;
  23155. b.C = new S(.146, .146);
  23156. b.D = new S(.853, .853);
  23157. b.le = bk;
  23158. D.u(a);
  23159. return b
  23160. },
  23161. Pie: function(a,
  23162. b, c) {
  23163. a = D.v();
  23164. var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
  23165. T(a, (.5 * Math.SQRT2 / 2 + .5) * b, (.5 - .5 * Math.SQRT2 / 2) * c, !0);
  23166. U(a, .7 * b, 0 * c, .5 * b, 0 * c, .5 * b, 0 * c);
  23167. U(a, (.5 - d + 0) * b, 0 * c, 0 * b, (.5 - d + 0) * c, 0 * b, .5 * c);
  23168. U(a, 0 * b, (.5 + d + 0) * c, (.5 - d + 0) * b, 1 * c, .5 * b, 1 * c);
  23169. U(a, (.5 + d + 0) * b, 1 * c, 1 * b, (.5 + d + 0) * c, 1 * b, .5 * c);
  23170. a.lineTo(.5 * b, .5 * c);
  23171. X(a);
  23172. b = a.q;
  23173. D.u(a);
  23174. return b
  23175. },
  23176. PiePiece: function(a, b, c) {
  23177. var d = Jd / Math.SQRT2 * .5,
  23178. e = Math.SQRT2 / 2,
  23179. g = 1 - Math.SQRT2 / 2;
  23180. a = D.v();
  23181. T(a, b, c, !0);
  23182. U(a, b, (1 - d) * c, (e + d) * b, (g + d) * c, e * b, g * c);
  23183. a.lineTo(0, c);
  23184. X(a);
  23185. b = a.q;
  23186. D.u(a);
  23187. return b
  23188. },
  23189. StopSign: function(a,
  23190. b, c) {
  23191. a = 1 / (Math.SQRT2 + 2);
  23192. var d = D.v();
  23193. T(d, a * b, 0, !0);
  23194. d.lineTo((1 - a) * b, 0);
  23195. d.lineTo(1 * b, a * c);
  23196. d.lineTo(1 * b, (1 - a) * c);
  23197. d.lineTo((1 - a) * b, 1 * c);
  23198. d.lineTo(a * b, 1 * c);
  23199. d.lineTo(0, (1 - a) * c);
  23200. d.lineTo(0, a * c);
  23201. X(d);
  23202. b = d.q;
  23203. b.C = new S(a / 2, a / 2);
  23204. b.D = new S(1 - a / 2, 1 - a / 2);
  23205. D.u(d);
  23206. return b
  23207. },
  23208. LogicImplies: function(a, b, c) {
  23209. var d = a ? a.Sc : NaN;
  23210. isNaN(d) && (d = .2);
  23211. a = D.v();
  23212. T(a, (1 - d) * b, 0 * c, !1);
  23213. a.lineTo(1 * b, .5 * c);
  23214. a.lineTo((1 - d) * b, c);
  23215. a.moveTo(0, .5 * c);
  23216. a.lineTo(b, .5 * c);
  23217. b = a.q;
  23218. b.C = ec;
  23219. b.D = new S(.8, .5);
  23220. D.u(a);
  23221. return b
  23222. },
  23223. LogicIff: function(a, b, c) {
  23224. var d = a ? a.Sc :
  23225. NaN;
  23226. isNaN(d) && (d = .2);
  23227. a = D.v();
  23228. T(a, (1 - d) * b, 0 * c, !1);
  23229. a.lineTo(1 * b, .5 * c);
  23230. a.lineTo((1 - d) * b, c);
  23231. a.moveTo(0, .5 * c);
  23232. a.lineTo(b, .5 * c);
  23233. a.moveTo(d * b, 0);
  23234. a.lineTo(0, .5 * c);
  23235. a.lineTo(d * b, c);
  23236. b = a.q;
  23237. b.C = new S(.2, 0);
  23238. b.D = new S(.8, .5);
  23239. D.u(a);
  23240. return b
  23241. },
  23242. LogicNot: function(a, b, c) {
  23243. a = D.v();
  23244. T(a, 0, 0, !1);
  23245. a.lineTo(1 * b, 0);
  23246. a.lineTo(1 * b, 1 * c);
  23247. b = a.q;
  23248. D.u(a);
  23249. return b
  23250. },
  23251. LogicAnd: function(a, b, c) {
  23252. a = D.v();
  23253. T(a, 0, 1 * c, !1);
  23254. a.lineTo(.5 * b, 0);
  23255. a.lineTo(1 * b, 1 * c);
  23256. b = a.q;
  23257. b.C = new S(.25, .5);
  23258. b.D = new S(.75, 1);
  23259. D.u(a);
  23260. return b
  23261. },
  23262. LogicOr: function(a, b, c) {
  23263. a = D.v();
  23264. T(a, 0, 0, !1);
  23265. a.lineTo(.5 * b, 1 * c);
  23266. a.lineTo(1 * b, 0);
  23267. b = a.q;
  23268. b.C = new S(.219, 0);
  23269. b.D = new S(.78, .409);
  23270. D.u(a);
  23271. return b
  23272. },
  23273. LogicXor: function(a, b, c) {
  23274. a = D.v();
  23275. T(a, .5 * b, 0, !1);
  23276. a.lineTo(.5 * b, 1 * c);
  23277. a.moveTo(0, .5 * c);
  23278. a.lineTo(1 * b, .5 * c);
  23279. var d = .5 * Jd;
  23280. U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  23281. U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
  23282. U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
  23283. U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  23284. b = a.q;
  23285. b.le = bk;
  23286. D.u(a);
  23287. return b
  23288. },
  23289. LogicTruth: function(a, b, c) {
  23290. a = D.v();
  23291. T(a, 0, 0, !1);
  23292. a.lineTo(1 * b, 0);
  23293. a.moveTo(.5 * b, 0);
  23294. a.lineTo(.5 * b, 1 * c);
  23295. b = a.q;
  23296. D.u(a);
  23297. return b
  23298. },
  23299. LogicFalsity: function(a, b, c) {
  23300. a = D.v();
  23301. T(a, 0, 1 * c, !1);
  23302. a.lineTo(1 * b, 1 * c);
  23303. a.moveTo(.5 * b, 1 * c);
  23304. a.lineTo(.5 * b, 0);
  23305. b = a.q;
  23306. D.u(a);
  23307. return b
  23308. },
  23309. LogicThereExists: function(a, b, c) {
  23310. a = D.v();
  23311. T(a, 0, 0, !1);
  23312. a.lineTo(1 * b, 0);
  23313. a.lineTo(1 * b, .5 * c);
  23314. a.lineTo(0, .5 * c);
  23315. a.moveTo(1 * b, .5 * c);
  23316. a.lineTo(1 * b, 1 * c);
  23317. a.lineTo(0, 1 * c);
  23318. b = a.q;
  23319. D.u(a);
  23320. return b
  23321. },
  23322. LogicForAll: function(a, b, c) {
  23323. a = D.v();
  23324. T(a, 0, 0, !1);
  23325. a.lineTo(.5 * b, 1 * c);
  23326. a.lineTo(1 * b, 0);
  23327. a.moveTo(.25 * b, .5 * c);
  23328. a.lineTo(.75 * b, .5 * c);
  23329. b = a.q;
  23330. b.C = new S(.25, 0);
  23331. b.D = new S(.75, .5);
  23332. D.u(a);
  23333. return b
  23334. },
  23335. LogicIsDefinedAs: function(a, b, c) {
  23336. a = D.v();
  23337. T(a, 0, 0, !1);
  23338. a.lineTo(b, 0);
  23339. a.moveTo(0, .5 * c);
  23340. a.lineTo(b, .5 * c);
  23341. a.moveTo(0, c);
  23342. a.lineTo(b, c);
  23343. b = a.q;
  23344. b.C = new S(.01, .01);
  23345. b.D = new S(.99, .49);
  23346. D.u(a);
  23347. return b
  23348. },
  23349. LogicIntersect: function(a, b, c) {
  23350. var d = .5 * Jd;
  23351. a = D.v();
  23352. T(a, 0, 1 * c, !1);
  23353. a.lineTo(0, .5 * c);
  23354. U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
  23355. U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  23356. a.lineTo(1 * b, 1 * c);
  23357. b = a.q;
  23358. b.C = new S(0, .5);
  23359. b.D = vc;
  23360. D.u(a);
  23361. return b
  23362. },
  23363. LogicUnion: function(a, b, c) {
  23364. var d = .5 * Jd;
  23365. a = D.v();
  23366. T(a, 1 * b, 0, !1);
  23367. a.lineTo(1 * b, .5 * c);
  23368. U(a,
  23369. 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  23370. U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
  23371. a.lineTo(0, 0);
  23372. b = a.q;
  23373. b.C = ec;
  23374. b.D = new S(1, .5);
  23375. D.u(a);
  23376. return b
  23377. },
  23378. Arrow: function(a, b, c) {
  23379. var d = a ? a.Sc : NaN,
  23380. e = a ? a.ev : NaN;
  23381. isNaN(d) && (d = .3);
  23382. isNaN(e) && (e = .3);
  23383. a = D.v();
  23384. T(a, 0, (.5 - e / 2) * c, !0);
  23385. a.lineTo((1 - d) * b, (.5 - e / 2) * c);
  23386. a.lineTo((1 - d) * b, 0);
  23387. a.lineTo(1 * b, .5 * c);
  23388. a.lineTo((1 - d) * b, 1 * c);
  23389. a.lineTo((1 - d) * b, (.5 + e / 2) * c);
  23390. a.lineTo(0, (.5 + e / 2) * c);
  23391. X(a);
  23392. b = a.q;
  23393. b.C = new S(0, .5 - e / 2);
  23394. d = Ke(0, .5 + e / 2, 1, .5 + e / 2, 1 - d, 1, 1, .5, D.P());
  23395. b.D = new S(d.x, d.y);
  23396. D.A(d);
  23397. D.u(a);
  23398. return b
  23399. },
  23400. ISOProcess: "Chevron",
  23401. Chevron: function(a, b, c) {
  23402. a = D.v();
  23403. T(a, 0, 0, !0);
  23404. a.lineTo(.5 * b, 0);
  23405. a.lineTo(1 * b, .5 * c);
  23406. a.lineTo(.5 * b, 1 * c);
  23407. a.lineTo(0, 1 * c);
  23408. a.lineTo(.5 * b, .5 * c);
  23409. X(a);
  23410. b = a.q;
  23411. D.u(a);
  23412. return b
  23413. },
  23414. DoubleArrow: function(a, b, c) {
  23415. a = D.v();
  23416. T(a, 0, 0, !0);
  23417. a.lineTo(.3 * b, .214 * c);
  23418. a.lineTo(.3 * b, 0);
  23419. a.lineTo(1 * b, .5 * c);
  23420. a.lineTo(.3 * b, 1 * c);
  23421. a.lineTo(.3 * b, .786 * c);
  23422. a.lineTo(0, 1 * c);
  23423. X(a);
  23424. T(a, .3 * b, .214 * c, !1);
  23425. a.lineTo(.3 * b, .786 * c);
  23426. a.jb(!1);
  23427. b = a.q;
  23428. D.u(a);
  23429. return b
  23430. },
  23431. DoubleEndArrow: function(a, b, c) {
  23432. a = D.v();
  23433. T(a, 1 * b, .5 * c, !0);
  23434. a.lineTo(.7 * b, 1 * c);
  23435. a.lineTo(.7 * b, .7 * c);
  23436. a.lineTo(.3 * b, .7 * c);
  23437. a.lineTo(.3 * b, 1 * c);
  23438. a.lineTo(0, .5 * c);
  23439. a.lineTo(.3 * b, 0);
  23440. a.lineTo(.3 * b, .3 * c);
  23441. a.lineTo(.7 * b, .3 * c);
  23442. a.lineTo(.7 * b, 0);
  23443. X(a);
  23444. b = a.q;
  23445. c = Ke(0, .5, .3, 0, 0, .3, .3, .3, D.P());
  23446. b.C = new S(c.x, c.y);
  23447. c = Ke(.7, 1, 1, .5, .7, .7, 1, .7, c);
  23448. b.D = new S(c.x, c.y);
  23449. D.A(c);
  23450. D.u(a);
  23451. return b
  23452. },
  23453. IBeamArrow: function(a, b, c) {
  23454. a = D.v();
  23455. T(a, 1 * b, .5 * c, !0);
  23456. a.lineTo(.7 * b, 1 * c);
  23457. a.lineTo(.7 * b, .7 * c);
  23458. a.lineTo(.2 * b, .7 * c);
  23459. a.lineTo(.2 * b, 1 * c);
  23460. a.lineTo(0, 1 * c);
  23461. a.lineTo(0, 0);
  23462. a.lineTo(.2 * b, 0);
  23463. a.lineTo(.2 * b, .3 * c);
  23464. a.lineTo(.7 * b, .3 * c);
  23465. a.lineTo(.7 * b, 0);
  23466. X(a);
  23467. b = a.q;
  23468. b.C = new S(0, .3);
  23469. c = Ke(.7, 1, 1, .5, .7, .7, 1, .7, D.P());
  23470. b.D = new S(c.x, c.y);
  23471. D.A(c);
  23472. D.u(a);
  23473. return b
  23474. },
  23475. Pointer: function(a, b, c) {
  23476. a = D.v();
  23477. T(a, 1 * b, .5 * c, !0);
  23478. a.lineTo(0, 1 * c);
  23479. a.lineTo(.2 * b, .5 * c);
  23480. a.lineTo(0, 0);
  23481. X(a);
  23482. b = a.q;
  23483. b.C = new S(.2, .35);
  23484. c = Ke(.2, .65, 1, .65, 0, 1, 1, .5, D.P());
  23485. b.D = new S(c.x, c.y);
  23486. D.A(c);
  23487. D.u(a);
  23488. return b
  23489. },
  23490. RoundedPointer: function(a, b, c) {
  23491. a = D.v();
  23492. T(a, 1 * b, .5 * c, !0);
  23493. a.lineTo(0, 1 * c);
  23494. U(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0);
  23495. X(a);
  23496. b = a.q;
  23497. b.C = new S(.4, .35);
  23498. c = Ke(.2, .65, 1, .65, 0, 1, 1, .5, D.P());
  23499. b.D = new S(c.x,
  23500. c.y);
  23501. D.A(c);
  23502. D.u(a);
  23503. return b
  23504. },
  23505. SplitEndArrow: function(a, b, c) {
  23506. a = D.v();
  23507. T(a, 1 * b, .5 * c, !0);
  23508. a.lineTo(.7 * b, 1 * c);
  23509. a.lineTo(.7 * b, .7 * c);
  23510. a.lineTo(0, .7 * c);
  23511. a.lineTo(.2 * b, .5 * c);
  23512. a.lineTo(0, .3 * c);
  23513. a.lineTo(.7 * b, .3 * c);
  23514. a.lineTo(.7 * b, 0);
  23515. X(a);
  23516. b = a.q;
  23517. b.C = new S(.2, .3);
  23518. c = Ke(.7, 1, 1, .5, .7, .7, 1, .7, D.P());
  23519. b.D = new S(c.x, c.y);
  23520. D.A(c);
  23521. D.u(a);
  23522. return b
  23523. },
  23524. MessageToUser: "SquareArrow",
  23525. SquareArrow: function(a, b, c) {
  23526. a = D.v();
  23527. T(a, 1 * b, .5 * c, !0);
  23528. a.lineTo(.7 * b, 1 * c);
  23529. a.lineTo(0, 1 * c);
  23530. a.lineTo(0, 0);
  23531. a.lineTo(.7 * b, 0);
  23532. X(a);
  23533. b = a.q;
  23534. b.C = ec;
  23535. b.D = new S(.7, 1);
  23536. D.u(a);
  23537. return b
  23538. },
  23539. Cone1: function(a, b, c) {
  23540. var d = .5 * Jd,
  23541. e = .1 * Jd;
  23542. a = D.v();
  23543. T(a, 0, .9 * c, !0);
  23544. a.lineTo(.5 * b, 0);
  23545. a.lineTo(1 * b, .9 * c);
  23546. U(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  23547. U(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
  23548. X(a);
  23549. b = a.q;
  23550. b.C = new S(.25, .5);
  23551. b.D = new S(.75, .97);
  23552. D.u(a);
  23553. return b
  23554. },
  23555. Cone2: function(a, b, c) {
  23556. a = D.v();
  23557. T(a, 0, .9 * c, !0);
  23558. U(a, (1 - .85 / .9) * b, 1 * c, .85 / .9 * b, 1 * c, 1 * b, .9 * c);
  23559. a.lineTo(.5 * b, 0);
  23560. a.lineTo(0, .9 * c);
  23561. X(a);
  23562. T(a, 0, .9 * c, !1);
  23563. U(a, (1 - .85 / .9) * b, .8 * c, .85 / .9 * b, .8 * c, 1 * b, .9 * c);
  23564. a.jb(!1);
  23565. b = a.q;
  23566. b.C = new S(.25, .5);
  23567. b.D = new S(.75, .82);
  23568. D.u(a);
  23569. return b
  23570. },
  23571. Cube1: function(a, b, c) {
  23572. a = D.v();
  23573. T(a, .5 * b, 1 * c, !0);
  23574. a.lineTo(1 * b, .85 * c);
  23575. a.lineTo(1 * b, .15 * c);
  23576. a.lineTo(.5 * b, 0 * c);
  23577. a.lineTo(0 * b, .15 * c);
  23578. a.lineTo(0 * b, .85 * c);
  23579. X(a);
  23580. T(a, .5 * b, 1 * c, !1);
  23581. a.lineTo(.5 * b, .3 * c);
  23582. a.lineTo(0, .15 * c);
  23583. a.moveTo(.5 * b, .3 * c);
  23584. a.lineTo(1 * b, .15 * c);
  23585. a.jb(!1);
  23586. b = a.q;
  23587. b.C = new S(0, .3);
  23588. b.D = new S(.5, .85);
  23589. D.u(a);
  23590. return b
  23591. },
  23592. Cube2: function(a, b, c) {
  23593. a = D.v();
  23594. T(a, 0, .3 * c, !0);
  23595. a.lineTo(0 * b, 1 * c);
  23596. a.lineTo(.7 * b, c);
  23597. a.lineTo(1 * b, .7 * c);
  23598. a.lineTo(1 * b, 0 * c);
  23599. a.lineTo(.3 * b, 0 * c);
  23600. X(a);
  23601. T(a, 0, .3 * c, !1);
  23602. a.lineTo(.7 * b, .3 * c);
  23603. a.lineTo(1 * b,
  23604. 0 * c);
  23605. a.moveTo(.7 * b, .3 * c);
  23606. a.lineTo(.7 * b, 1 * c);
  23607. a.jb(!1);
  23608. b = a.q;
  23609. b.C = new S(0, .3);
  23610. b.D = new S(.7, 1);
  23611. D.u(a);
  23612. return b
  23613. },
  23614. MagneticData: "Cylinder1",
  23615. Cylinder1: function(a, b, c) {
  23616. var d = .5 * Jd,
  23617. e = .1 * Jd;
  23618. a = D.v();
  23619. T(a, 0, .1 * c, !0);
  23620. U(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
  23621. U(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
  23622. a.lineTo(b, .9 * c);
  23623. U(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  23624. U(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
  23625. a.lineTo(0, .1 * c);
  23626. T(a, 0, .1 * c, !1);
  23627. U(a, 0, (.1 + e) * c, (.5 - d) * b, .2 * c, .5 * b, .2 * c);
  23628. U(a, (.5 + d) * b, .2 * c, 1 * b, (.1 + e) * c, 1 * b, .1 * c);
  23629. a.jb(!1);
  23630. b = a.q;
  23631. b.C = new S(0,
  23632. .2);
  23633. b.D = new S(1, .9);
  23634. D.u(a);
  23635. return b
  23636. },
  23637. Cylinder2: function(a, b, c) {
  23638. var d = .5 * Jd,
  23639. e = .1 * Jd;
  23640. a = D.v();
  23641. T(a, 0, .9 * c, !0);
  23642. a.lineTo(0, .1 * c);
  23643. U(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
  23644. U(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
  23645. a.lineTo(1 * b, .9 * c);
  23646. U(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  23647. U(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
  23648. T(a, 0, .9 * c, !1);
  23649. U(a, 0, (.9 - e) * c, (.5 - d) * b, .8 * c, .5 * b, .8 * c);
  23650. U(a, (.5 + d) * b, .8 * c, 1 * b, (.9 - e) * c, 1 * b, .9 * c);
  23651. a.jb(!1);
  23652. b = a.q;
  23653. b.C = new S(0, .1);
  23654. b.D = new S(1, .8);
  23655. D.u(a);
  23656. return b
  23657. },
  23658. Cylinder3: function(a, b, c) {
  23659. var d = .1 * Jd,
  23660. e = .5 * Jd;
  23661. a = D.v();
  23662. T(a, .1 * b, 0, !0);
  23663. a.lineTo(.9 * b, 0);
  23664. U(a, (.9 + d) * b, 0, 1 * b, (.5 - e) * c, 1 * b, .5 * c);
  23665. U(a, 1 * b, (.5 + e) * c, (.9 + d) * b, 1 * c, .9 * b, 1 * c);
  23666. a.lineTo(.1 * b, 1 * c);
  23667. U(a, (.1 - d) * b, 1 * c, 0, (.5 + e) * c, 0, .5 * c);
  23668. U(a, 0, (.5 - e) * c, (.1 - d) * b, 0, .1 * b, 0);
  23669. T(a, .1 * b, 0, !1);
  23670. U(a, (.1 + d) * b, 0, .2 * b, (.5 - e) * c, .2 * b, .5 * c);
  23671. U(a, .2 * b, (.5 + e) * c, (.1 + d) * b, 1 * c, .1 * b, 1 * c);
  23672. a.jb(!1);
  23673. b = a.q;
  23674. b.C = new S(.2, 0);
  23675. b.D = new S(.9, 1);
  23676. D.u(a);
  23677. return b
  23678. },
  23679. DirectData: "Cylinder4",
  23680. Cylinder4: function(a, b, c) {
  23681. var d = .1 * Jd,
  23682. e = .5 * Jd;
  23683. a = D.v();
  23684. T(a, .9 * b, 0, !0);
  23685. U(a, (.9 + d) * b, 0, 1 * b, (.5 - e) * c, 1 * b, .5 * c);
  23686. U(a, 1 * b, (.5 +
  23687. e) * c, (.9 + d) * b, 1 * c, .9 * b, 1 * c);
  23688. a.lineTo(.1 * b, 1 * c);
  23689. U(a, (.1 - d) * b, 1 * c, 0, (.5 + e) * c, 0, .5 * c);
  23690. U(a, 0, (.5 - e) * c, (.1 - d) * b, 0, .1 * b, 0);
  23691. a.lineTo(.9 * b, 0);
  23692. T(a, .9 * b, 0, !1);
  23693. U(a, (.9 - d) * b, 0, .8 * b, (.5 - e) * c, .8 * b, .5 * c);
  23694. U(a, .8 * b, (.5 + e) * c, (.9 - d) * b, 1 * c, .9 * b, 1 * c);
  23695. a.jb(!1);
  23696. b = a.q;
  23697. b.C = new S(.1, 0);
  23698. b.D = new S(.8, 1);
  23699. D.u(a);
  23700. return b
  23701. },
  23702. Prism1: function(a, b, c) {
  23703. a = D.v();
  23704. T(a, .25 * b, .25 * c, !0);
  23705. a.lineTo(.75 * b, 0);
  23706. a.lineTo(b, .5 * c);
  23707. a.lineTo(.5 * b, c);
  23708. a.lineTo(0, c);
  23709. X(a);
  23710. T(a, .25 * b, .25 * c, !1);
  23711. a.lineTo(.5 * b, c);
  23712. a.jb(!1);
  23713. b = a.q;
  23714. b.C = new S(.408, .172);
  23715. b.D = new S(.833,
  23716. .662);
  23717. D.u(a);
  23718. return b
  23719. },
  23720. Prism2: function(a, b, c) {
  23721. a = D.v();
  23722. T(a, 0, .25 * c, !0);
  23723. a.lineTo(.75 * b, 0);
  23724. a.lineTo(1 * b, .25 * c);
  23725. a.lineTo(.75 * b, .75 * c);
  23726. a.lineTo(0, 1 * c);
  23727. X(a);
  23728. T(a, 0, c, !1);
  23729. a.lineTo(.25 * b, .5 * c);
  23730. a.lineTo(b, .25 * c);
  23731. a.moveTo(0, .25 * c);
  23732. a.lineTo(.25 * b, .5 * c);
  23733. a.jb(!1);
  23734. b = a.q;
  23735. b.C = new S(.25, .5);
  23736. b.D = new S(.75, .75);
  23737. D.u(a);
  23738. return b
  23739. },
  23740. Pyramid1: function(a, b, c) {
  23741. a = D.v();
  23742. T(a, .5 * b, 0, !0);
  23743. a.lineTo(b, .75 * c);
  23744. a.lineTo(.5 * b, 1 * c);
  23745. a.lineTo(0, .75 * c);
  23746. X(a);
  23747. T(a, .5 * b, 0, !1);
  23748. a.lineTo(.5 * b, 1 * c);
  23749. a.jb(!1);
  23750. b = a.q;
  23751. b.C = new S(.25, .367);
  23752. b.D = new S(.75,
  23753. .875);
  23754. D.u(a);
  23755. return b
  23756. },
  23757. Pyramid2: function(a, b, c) {
  23758. a = D.v();
  23759. T(a, .5 * b, 0, !0);
  23760. a.lineTo(b, .85 * c);
  23761. a.lineTo(.5 * b, 1 * c);
  23762. a.lineTo(0, .85 * c);
  23763. X(a);
  23764. T(a, .5 * b, 0, !1);
  23765. a.lineTo(.5 * b, .7 * c);
  23766. a.lineTo(0, .85 * c);
  23767. a.moveTo(.5 * b, .7 * c);
  23768. a.lineTo(1 * b, .85 * c);
  23769. a.jb(!1);
  23770. b = a.q;
  23771. b.C = new S(.25, .367);
  23772. b.D = new S(.75, .875);
  23773. D.u(a);
  23774. return b
  23775. },
  23776. Actor: function(a, b, c) {
  23777. var d = .2 * Jd,
  23778. e = .1 * Jd,
  23779. g = .5,
  23780. h = .1;
  23781. a = D.v();
  23782. T(a, g * b, (h + .1) * c, !0);
  23783. U(a, (g - d) * b, (h + .1) * c, (g - .2) * b, (h + e) * c, (g - .2) * b, h * c);
  23784. U(a, (g - .2) * b, (h - e) * c, (g - d) * b, (h - .1) * c, g * b, (h - .1) * c);
  23785. U(a, (g + d) * b, (h - .1) * c,
  23786. (g + .2) * b, (h - e) * c, (g + .2) * b, h * c);
  23787. U(a, (g + .2) * b, (h + e) * c, (g + d) * b, (h + .1) * c, g * b, (h + .1) * c);
  23788. d = .05;
  23789. e = Jd * d;
  23790. T(a, .5 * b, .2 * c, !0);
  23791. a.lineTo(.95 * b, .2 * c);
  23792. g = .95;
  23793. h = .25;
  23794. U(a, (g + e) * b, (h - d) * c, (g + d) * b, (h - e) * c, (g + d) * b, h * c);
  23795. a.lineTo(1 * b, .6 * c);
  23796. a.lineTo(.85 * b, .6 * c);
  23797. a.lineTo(.85 * b, .35 * c);
  23798. d = .025;
  23799. e = Jd * d;
  23800. g = .825;
  23801. h = .35;
  23802. U(a, (g + d) * b, (h - e) * c, (g + e) * b, (h - d) * c, g * b, (h - d) * c);
  23803. U(a, (g - e) * b, (h - d) * c, (g - d) * b, (h - e) * c, (g - d) * b, h * c);
  23804. a.lineTo(.8 * b, 1 * c);
  23805. a.lineTo(.55 * b, 1 * c);
  23806. a.lineTo(.55 * b, .7 * c);
  23807. d = .05;
  23808. e = Jd * d;
  23809. g = .5;
  23810. h = .7;
  23811. U(a, (g + d) * b, (h - e) * c, (g + e) * b, (h - d) * c,
  23812. g * b, (h - d) * c);
  23813. U(a, (g - e) * b, (h - d) * c, (g - d) * b, (h - e) * c, (g - d) * b, h * c);
  23814. a.lineTo(.45 * b, 1 * c);
  23815. a.lineTo(.2 * b, 1 * c);
  23816. a.lineTo(.2 * b, .35 * c);
  23817. d = .025;
  23818. e = Jd * d;
  23819. g = .175;
  23820. h = .35;
  23821. U(a, (g + d) * b, (h - e) * c, (g + e) * b, (h - d) * c, g * b, (h - d) * c);
  23822. U(a, (g - e) * b, (h - d) * c, (g - d) * b, (h - e) * c, (g - d) * b, h * c);
  23823. a.lineTo(.15 * b, .6 * c);
  23824. a.lineTo(0 * b, .6 * c);
  23825. a.lineTo(0 * b, .25 * c);
  23826. d = .05;
  23827. e = Jd * d;
  23828. g = .05;
  23829. h = .25;
  23830. U(a, (g - d) * b, (h - e) * c, (g - e) * b, (h - d) * c, g * b, (h - d) * c);
  23831. a.lineTo(.5 * b, .2 * c);
  23832. b = a.q;
  23833. b.C = new S(.2, .2);
  23834. b.D = new S(.8, .65);
  23835. D.u(a);
  23836. return b
  23837. },
  23838. Card: function(a, b, c) {
  23839. a = D.v();
  23840. T(a, 1 * b, 0 * c, !0);
  23841. a.lineTo(1 * b, 1 * c);
  23842. a.lineTo(0 * b, 1 * c);
  23843. a.lineTo(0 * b, .2 * c);
  23844. a.lineTo(.2 * b, 0 * c);
  23845. X(a);
  23846. b = a.q;
  23847. b.C = new S(0, .2);
  23848. b.D = vc;
  23849. D.u(a);
  23850. return b
  23851. },
  23852. Collate: function(a, b, c) {
  23853. a = D.v();
  23854. T(a, .5 * b, .5 * c, !0);
  23855. a.lineTo(0, 0);
  23856. a.lineTo(1 * b, 0);
  23857. a.lineTo(.5 * b, .5 * c);
  23858. T(a, .5 * b, .5 * c, !0);
  23859. a.lineTo(1 * b, 1 * c);
  23860. a.lineTo(0, 1 * c);
  23861. a.lineTo(.5 * b, .5 * c);
  23862. b = a.q;
  23863. b.C = new S(.25, 0);
  23864. b.D = new S(.75, .25);
  23865. D.u(a);
  23866. return b
  23867. },
  23868. CreateRequest: function(a, b, c) {
  23869. a = a ? a.Sc : NaN;
  23870. isNaN(a) && (a = .1);
  23871. var d = D.v();
  23872. T(d, 0, 0, !0);
  23873. d.lineTo(1 * b, 0);
  23874. d.lineTo(1 * b, 1 * c);
  23875. d.lineTo(0, 1 * c);
  23876. X(d);
  23877. T(d, 0,
  23878. a * c, !1);
  23879. d.lineTo(1 * b, a * c);
  23880. d.moveTo(0, (1 - a) * c);
  23881. d.lineTo(1 * b, (1 - a) * c);
  23882. d.jb(!1);
  23883. b = d.q;
  23884. b.C = new S(0, a);
  23885. b.D = new S(1, 1 - a);
  23886. D.u(d);
  23887. return b
  23888. },
  23889. Database: function(a, b, c) {
  23890. a = D.v();
  23891. var d = .5 * Jd,
  23892. e = .1 * Jd;
  23893. T(a, 1 * b, .1 * c, !0);
  23894. a.lineTo(1 * b, .9 * c);
  23895. U(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  23896. U(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
  23897. a.lineTo(0, .1 * c);
  23898. U(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
  23899. U(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
  23900. T(a, 1 * b, .1 * c, !1);
  23901. U(a, 1 * b, (.1 + e) * c, (.5 + d) * b, .2 * c, .5 * b, .2 * c);
  23902. U(a, (.5 - d) * b, .2 * c, 0, (.1 + e) * c, 0, .1 * c);
  23903. a.moveTo(1 * b, .2 * c);
  23904. U(a, 1 * b, (.2 + e) * c, (.5 + d) * b, .3 * c, .5 * b, .3 * c);
  23905. U(a, (.5 - d) * b, .3 * c, 0, (.2 + e) * c, 0, .2 * c);
  23906. a.moveTo(1 * b, .3 * c);
  23907. U(a, 1 * b, (.3 + e) * c, (.5 + d) * b, .4 * c, .5 * b, .4 * c);
  23908. U(a, (.5 - d) * b, .4 * c, 0, (.3 + e) * c, 0, .3 * c);
  23909. a.jb(!1);
  23910. b = a.q;
  23911. b.C = new S(0, .4);
  23912. b.D = new S(1, .9);
  23913. D.u(a);
  23914. return b
  23915. },
  23916. StoredData: "DataStorage",
  23917. DataStorage: function(a, b, c) {
  23918. a = D.v();
  23919. T(a, 0, 0, !0);
  23920. a.lineTo(.75 * b, 0);
  23921. U(a, 1 * b, 0, 1 * b, 1 * c, .75 * b, 1 * c);
  23922. a.lineTo(0, 1 * c);
  23923. U(a, .25 * b, .9 * c, .25 * b, .1 * c, 0, 0);
  23924. X(a);
  23925. b = a.q;
  23926. b.C = new S(.226, 0);
  23927. b.D = new S(.81, 1);
  23928. D.u(a);
  23929. return b
  23930. },
  23931. DiskStorage: function(a, b, c) {
  23932. a =
  23933. D.v();
  23934. var d = .5 * Jd,
  23935. e = .1 * Jd;
  23936. T(a, 1 * b, .1 * c, !0);
  23937. a.lineTo(1 * b, .9 * c);
  23938. U(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  23939. U(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
  23940. a.lineTo(0, .1 * c);
  23941. U(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
  23942. U(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
  23943. T(a, 1 * b, .1 * c, !1);
  23944. U(a, 1 * b, (.1 + e) * c, (.5 + d) * b, .2 * c, .5 * b, .2 * c);
  23945. U(a, (.5 - d) * b, .2 * c, 0, (.1 + e) * c, 0, .1 * c);
  23946. a.moveTo(1 * b, .2 * c);
  23947. U(a, 1 * b, (.2 + e) * c, (.5 + d) * b, .3 * c, .5 * b, .3 * c);
  23948. U(a, (.5 - d) * b, .3 * c, 0, (.2 + e) * c, 0, .2 * c);
  23949. a.jb(!1);
  23950. b = a.q;
  23951. b.C = new S(0, .3);
  23952. b.D = new S(1, .9);
  23953. D.u(a);
  23954. return b
  23955. },
  23956. Display: function(a,
  23957. b, c) {
  23958. a = D.v();
  23959. T(a, .25 * b, 0, !0);
  23960. a.lineTo(.75 * b, 0);
  23961. U(a, 1 * b, 0, 1 * b, 1 * c, .75 * b, 1 * c);
  23962. a.lineTo(.25 * b, 1 * c);
  23963. a.lineTo(0, .5 * c);
  23964. X(a);
  23965. b = a.q;
  23966. b.C = new S(.25, 0);
  23967. b.D = new S(.75, 1);
  23968. D.u(a);
  23969. return b
  23970. },
  23971. DividedEvent: function(a, b, c) {
  23972. a = a ? a.Sc : NaN;
  23973. isNaN(a) ? a = .2 : .15 > a && (a = .15);
  23974. var d = D.v(),
  23975. e = .2 * Jd;
  23976. T(d, 0, .2 * c, !0);
  23977. U(d, 0, (.2 - e) * c, (.2 - e) * b, 0, .2 * b, 0);
  23978. d.lineTo(.8 * b, 0);
  23979. U(d, (.8 + e) * b, 0, 1 * b, (.2 - e) * c, 1 * b, .2 * c);
  23980. d.lineTo(1 * b, .8 * c);
  23981. U(d, 1 * b, (.8 + e) * c, (.8 + e) * b, 1 * c, .8 * b, 1 * c);
  23982. d.lineTo(.2 * b, 1 * c);
  23983. U(d, (.2 - e) * b, 1 * c, 0, (.8 + e) * c, 0, .8 * c);
  23984. d.lineTo(0, .2 * c);
  23985. T(d, 0, a * c, !1);
  23986. d.lineTo(1 * b, a * c);
  23987. d.jb(!1);
  23988. b = d.q;
  23989. b.C = new S(0, a);
  23990. b.D = new S(1, 1 - a);
  23991. D.u(d);
  23992. return b
  23993. },
  23994. DividedProcess: function(a, b, c) {
  23995. a = a ? a.Sc : NaN;
  23996. if (isNaN(a) || .1 > a) a = .1;
  23997. var d = D.v();
  23998. T(d, 0, 0, !0);
  23999. d.lineTo(1 * b, 0);
  24000. d.lineTo(1 * b, 1 * c);
  24001. d.lineTo(0, 1 * c);
  24002. X(d);
  24003. T(d, 0, a * c, !1);
  24004. d.lineTo(1 * b, a * c);
  24005. d.jb(!1);
  24006. b = d.q;
  24007. b.C = new S(0, a);
  24008. b.D = vc;
  24009. D.u(d);
  24010. return b
  24011. },
  24012. Document: function(a, b, c) {
  24013. c /= .8;
  24014. a = D.v();
  24015. T(a, 0, .7 * c, !0);
  24016. a.lineTo(0, 0);
  24017. a.lineTo(1 * b, 0);
  24018. a.lineTo(1 * b, .7 * c);
  24019. U(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c);
  24020. X(a);
  24021. b = a.q;
  24022. b.C = ec;
  24023. b.D = new S(1, .6);
  24024. D.u(a);
  24025. return b
  24026. },
  24027. ExternalOrganization: function(a, b, c) {
  24028. a = a ? a.Sc : NaN;
  24029. if (isNaN(a) || .2 > a) a = .2;
  24030. var d = D.v();
  24031. T(d, 0, 0, !0);
  24032. d.lineTo(1 * b, 0);
  24033. d.lineTo(1 * b, 1 * c);
  24034. d.lineTo(0, 1 * c);
  24035. X(d);
  24036. T(d, a * b, 0, !1);
  24037. d.lineTo(0, a * c);
  24038. d.moveTo(1 * b, a * c);
  24039. d.lineTo((1 - a) * b, 0);
  24040. d.moveTo(0, (1 - a) * c);
  24041. d.lineTo(a * b, 1 * c);
  24042. d.moveTo((1 - a) * b, 1 * c);
  24043. d.lineTo(1 * b, (1 - a) * c);
  24044. d.jb(!1);
  24045. b = d.q;
  24046. b.C = new S(a / 2, a / 2);
  24047. b.D = new S(1 - a / 2, 1 - a / 2);
  24048. D.u(d);
  24049. return b
  24050. },
  24051. ExternalProcess: function(a, b, c) {
  24052. a = D.v();
  24053. T(a, .5 * b, 0, !0);
  24054. a.lineTo(1 * b, .5 * c);
  24055. a.lineTo(.5 * b, 1 * c);
  24056. a.lineTo(0, .5 * c);
  24057. X(a);
  24058. T(a, .1 * b, .4 * c, !1);
  24059. a.lineTo(.1 * b, .6 * c);
  24060. a.moveTo(.9 * b, .6 * c);
  24061. a.lineTo(.9 * b, .4 * c);
  24062. a.moveTo(.6 * b, .1 * c);
  24063. a.lineTo(.4 * b, .1 * c);
  24064. a.moveTo(.4 * b, .9 * c);
  24065. a.lineTo(.6 * b, .9 * c);
  24066. a.jb(!1);
  24067. b = a.q;
  24068. b.C = new S(.25, .25);
  24069. b.D = new S(.75, .75);
  24070. D.u(a);
  24071. return b
  24072. },
  24073. File: function(a, b, c) {
  24074. a = D.v();
  24075. T(a, 0, 0, !0);
  24076. a.lineTo(.75 * b, 0);
  24077. a.lineTo(1 * b, .25 * c);
  24078. a.lineTo(1 * b, 1 * c);
  24079. a.lineTo(0, 1 * c);
  24080. X(a);
  24081. T(a, .75 * b, 0, !1);
  24082. a.lineTo(.75 * b, .25 * c);
  24083. a.lineTo(1 * b, .25 * c);
  24084. a.jb(!1);
  24085. b = a.q;
  24086. b.C = new S(0, .25);
  24087. b.D = vc;
  24088. D.u(a);
  24089. return b
  24090. },
  24091. Interrupt: function(a, b, c) {
  24092. a = D.v();
  24093. T(a, 1 * b,
  24094. .5 * c, !0);
  24095. a.lineTo(0, 1 * c);
  24096. a.lineTo(0, 0);
  24097. a.lineTo(1 * b, .5 * c);
  24098. T(a, 1 * b, .5 * c, !1);
  24099. a.lineTo(1 * b, 1 * c);
  24100. T(a, 1 * b, .5 * c, !1);
  24101. a.lineTo(1 * b, 0);
  24102. b = a.q;
  24103. b.C = new S(0, .25);
  24104. b.D = new S(.5, .75);
  24105. D.u(a);
  24106. return b
  24107. },
  24108. InternalStorage: function(a, b, c) {
  24109. var d = a ? a.Sc : NaN;
  24110. a = a ? a.ev : NaN;
  24111. isNaN(d) && (d = .1);
  24112. isNaN(a) && (a = .1);
  24113. var e = D.v();
  24114. T(e, 0, 0, !0);
  24115. e.lineTo(1 * b, 0);
  24116. e.lineTo(1 * b, 1 * c);
  24117. e.lineTo(0, 1 * c);
  24118. X(e);
  24119. T(e, d * b, 0, !1);
  24120. e.lineTo(d * b, 1 * c);
  24121. e.moveTo(0, a * c);
  24122. e.lineTo(1 * b, a * c);
  24123. e.jb(!1);
  24124. b = e.q;
  24125. b.C = new S(d, a);
  24126. b.D = vc;
  24127. D.u(e);
  24128. return b
  24129. },
  24130. Junction: function(a, b,
  24131. c) {
  24132. a = D.v();
  24133. var d = 1 / Math.SQRT2,
  24134. e = (1 - 1 / Math.SQRT2) / 2,
  24135. g = .5 * Jd;
  24136. T(a, 1 * b, .5 * c, !0);
  24137. U(a, 1 * b, (.5 + g) * c, (.5 + g) * b, 1 * c, .5 * b, 1 * c);
  24138. U(a, (.5 - g) * b, 1 * c, 0, (.5 + g) * c, 0, .5 * c);
  24139. U(a, 0, (.5 - g) * c, (.5 - g) * b, 0, .5 * b, 0);
  24140. U(a, (.5 + g) * b, 0, 1 * b, (.5 - g) * c, 1 * b, .5 * c);
  24141. T(a, (e + d) * b, (e + d) * c, !1);
  24142. a.lineTo(e * b, e * c);
  24143. a.moveTo(e * b, (e + d) * c);
  24144. a.lineTo((e + d) * b, e * c);
  24145. a.jb(!1);
  24146. b = a.q;
  24147. b.le = bk;
  24148. D.u(a);
  24149. return b
  24150. },
  24151. LinedDocument: function(a, b, c) {
  24152. c /= .8;
  24153. a = D.v();
  24154. T(a, 0, .7 * c, !0);
  24155. a.lineTo(0, 0);
  24156. a.lineTo(1 * b, 0);
  24157. a.lineTo(1 * b, .7 * c);
  24158. U(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c);
  24159. X(a);
  24160. T(a, .1 *
  24161. b, 0, !1);
  24162. a.lineTo(.1 * b, .75 * c);
  24163. a.jb(!1);
  24164. b = a.q;
  24165. b.C = new S(.1, 0);
  24166. b.D = new S(1, .6);
  24167. D.u(a);
  24168. return b
  24169. },
  24170. LoopLimit: function(a, b, c) {
  24171. a = D.v();
  24172. T(a, 0, 1 * c, !0);
  24173. a.lineTo(0, .25 * c);
  24174. a.lineTo(.25 * b, 0);
  24175. a.lineTo(.75 * b, 0);
  24176. a.lineTo(1 * b, .25 * c);
  24177. a.lineTo(1 * b, 1 * c);
  24178. X(a);
  24179. b = a.q;
  24180. b.C = new S(0, .25);
  24181. b.D = vc;
  24182. D.u(a);
  24183. return b
  24184. },
  24185. SequentialData: "MagneticTape",
  24186. MagneticTape: function(a, b, c) {
  24187. a = D.v();
  24188. var d = .5 * Jd;
  24189. T(a, .5 * b, 1 * c, !0);
  24190. U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
  24191. U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
  24192. U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  24193. U(a, 1 * b, (.5 +
  24194. d) * c, (.5 + d) * b, .9 * c, .6 * b, .9 * c);
  24195. a.lineTo(1 * b, .9 * c);
  24196. a.lineTo(1 * b, 1 * c);
  24197. a.lineTo(.5 * b, 1 * c);
  24198. b = a.q;
  24199. b.C = new S(.15, .15);
  24200. b.D = new S(.85, .8);
  24201. D.u(a);
  24202. return b
  24203. },
  24204. ManualInput: function(a, b, c) {
  24205. a = D.v();
  24206. T(a, 1 * b, 0, !0);
  24207. a.lineTo(1 * b, 1 * c);
  24208. a.lineTo(0, 1 * c);
  24209. a.lineTo(0, .25 * c);
  24210. X(a);
  24211. b = a.q;
  24212. b.C = new S(0, .25);
  24213. b.D = vc;
  24214. D.u(a);
  24215. return b
  24216. },
  24217. MessageFromUser: function(a, b, c) {
  24218. a = a ? a.Sc : NaN;
  24219. isNaN(a) && (a = .7);
  24220. var d = D.v();
  24221. T(d, 0, 0, !0);
  24222. d.lineTo(1 * b, 0);
  24223. d.lineTo(a * b, .5 * c);
  24224. d.lineTo(1 * b, 1 * c);
  24225. d.lineTo(0, 1 * c);
  24226. X(d);
  24227. b = d.q;
  24228. b.C = ec;
  24229. b.D = new S(a, 1);
  24230. D.u(d);
  24231. return b
  24232. },
  24233. MicroformProcessing: function(a, b, c) {
  24234. a = a ? a.Sc : NaN;
  24235. isNaN(a) && (a = .25);
  24236. var d = D.v();
  24237. T(d, 0, 0, !0);
  24238. d.lineTo(.5 * b, a * c);
  24239. d.lineTo(1 * b, 0);
  24240. d.lineTo(1 * b, 1 * c);
  24241. d.lineTo(.5 * b, (1 - a) * c);
  24242. d.lineTo(0, 1 * c);
  24243. X(d);
  24244. b = d.q;
  24245. b.C = new S(0, a);
  24246. b.D = new S(1, 1 - a);
  24247. D.u(d);
  24248. return b
  24249. },
  24250. MicroformRecording: function(a, b, c) {
  24251. a = D.v();
  24252. T(a, 0, 0, !0);
  24253. a.lineTo(.75 * b, .25 * c);
  24254. a.lineTo(1 * b, .15 * c);
  24255. a.lineTo(1 * b, .85 * c);
  24256. a.lineTo(.75 * b, .75 * c);
  24257. a.lineTo(0, 1 * c);
  24258. X(a);
  24259. b = a.q;
  24260. b.C = new S(0, .25);
  24261. b.D = new S(1, .75);
  24262. D.u(a);
  24263. return b
  24264. },
  24265. MultiDocument: function(a, b, c) {
  24266. c /= .8;
  24267. a = D.v();
  24268. T(a, b, 0, !0);
  24269. a.lineTo(b, .5 * c);
  24270. U(a, .96 * b, .47 * c, .93 * b, .45 * c, .9 * b, .44 * c);
  24271. a.lineTo(.9 * b, .6 * c);
  24272. U(a, .86 * b, .57 * c, .83 * b, .55 * c, .8 * b, .54 * c);
  24273. a.lineTo(.8 * b, .7 * c);
  24274. U(a, .4 * b, .4 * c, .4 * b, 1 * c, 0, .7 * c);
  24275. a.lineTo(0, .2 * c);
  24276. a.lineTo(.1 * b, .2 * c);
  24277. a.lineTo(.1 * b, .1 * c);
  24278. a.lineTo(.2 * b, .1 * c);
  24279. a.lineTo(.2 * b, 0);
  24280. X(a);
  24281. T(a, .1 * b, .2 * c, !1);
  24282. a.lineTo(.8 * b, .2 * c);
  24283. a.lineTo(.8 * b, .54 * c);
  24284. a.moveTo(.2 * b, .1 * c);
  24285. a.lineTo(.9 * b, .1 * c);
  24286. a.lineTo(.9 * b, .44 * c);
  24287. a.jb(!1);
  24288. b = a.q;
  24289. b.C = new S(0, .25);
  24290. b.D = new S(.8, .77);
  24291. D.u(a);
  24292. return b
  24293. },
  24294. MultiProcess: function(a, b, c) {
  24295. a = D.v();
  24296. T(a, .1 * b, .1 * c, !0);
  24297. a.lineTo(.2 * b, .1 * c);
  24298. a.lineTo(.2 * b, 0);
  24299. a.lineTo(1 * b, 0);
  24300. a.lineTo(1 * b, .8 * c);
  24301. a.lineTo(.9 * b, .8 * c);
  24302. a.lineTo(.9 * b, .9 * c);
  24303. a.lineTo(.8 * b, .9 * c);
  24304. a.lineTo(.8 * b, 1 * c);
  24305. a.lineTo(0, 1 * c);
  24306. a.lineTo(0, .2 * c);
  24307. a.lineTo(.1 * b, .2 * c);
  24308. X(a);
  24309. T(a, .2 * b, .1 * c, !1);
  24310. a.lineTo(.9 * b, .1 * c);
  24311. a.lineTo(.9 * b, .8 * c);
  24312. a.moveTo(.1 * b, .2 * c);
  24313. a.lineTo(.8 * b, .2 * c);
  24314. a.lineTo(.8 * b, .9 * c);
  24315. a.jb(!1);
  24316. b = a.q;
  24317. b.C = new S(0, .2);
  24318. b.D = new S(.8, 1);
  24319. D.u(a);
  24320. return b
  24321. },
  24322. OfflineStorage: function(a, b, c) {
  24323. a = a ? a.Sc : NaN;
  24324. isNaN(a) && (a = .1);
  24325. var d = 1 - a,
  24326. e = D.v();
  24327. T(e, 0, 0, !0);
  24328. e.lineTo(1 *
  24329. b, 0);
  24330. e.lineTo(.5 * b, 1 * c);
  24331. X(e);
  24332. T(e, .5 * a * b, a * c, !1);
  24333. e.lineTo((1 - .5 * a) * b, a * c);
  24334. e.jb(!1);
  24335. b = e.q;
  24336. b.C = new S(d / 4 + .5 * a, a);
  24337. b.D = new S(3 * d / 4 + .5 * a, a + .5 * d);
  24338. D.u(e);
  24339. return b
  24340. },
  24341. OffPageConnector: function(a, b, c) {
  24342. a = D.v();
  24343. T(a, 0, 0, !0);
  24344. a.lineTo(.75 * b, 0);
  24345. a.lineTo(1 * b, .5 * c);
  24346. a.lineTo(.75 * b, 1 * c);
  24347. a.lineTo(0, 1 * c);
  24348. X(a);
  24349. b = a.q;
  24350. b.C = ec;
  24351. b.D = new S(.75, 1);
  24352. D.u(a);
  24353. return b
  24354. },
  24355. Or: function(a, b, c) {
  24356. a = D.v();
  24357. var d = .5 * Jd;
  24358. T(a, 1 * b, .5 * c, !0);
  24359. U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  24360. U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
  24361. U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
  24362. U(a,
  24363. (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  24364. T(a, 1 * b, .5 * c, !1);
  24365. a.lineTo(0, .5 * c);
  24366. a.moveTo(.5 * b, 1 * c);
  24367. a.lineTo(.5 * b, 0);
  24368. a.jb(!1);
  24369. b = a.q;
  24370. b.le = bk;
  24371. D.u(a);
  24372. return b
  24373. },
  24374. PaperTape: function(a, b, c) {
  24375. c /= .8;
  24376. a = D.v();
  24377. T(a, 0, .7 * c, !0);
  24378. a.lineTo(0, .3 * c);
  24379. U(a, .5 * b, .6 * c, .5 * b, 0, 1 * b, .3 * c);
  24380. a.lineTo(1 * b, .7 * c);
  24381. U(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c);
  24382. X(a);
  24383. b = a.q;
  24384. b.C = new S(0, .49);
  24385. b.D = new S(1, .75);
  24386. D.u(a);
  24387. return b
  24388. },
  24389. PrimitiveFromCall: function(a, b, c) {
  24390. var d = a ? a.Sc : NaN;
  24391. a = a ? a.ev : NaN;
  24392. isNaN(d) && (d = .1);
  24393. isNaN(a) && (a = .3);
  24394. var e = D.v();
  24395. T(e, 0, 0, !0);
  24396. e.lineTo(1 * b, 0);
  24397. e.lineTo((1 -
  24398. a) * b, .5 * c);
  24399. e.lineTo(1 * b, 1 * c);
  24400. e.lineTo(0, 1 * c);
  24401. X(e);
  24402. b = e.q;
  24403. b.C = new S(d, 0);
  24404. b.D = new S(1 - a, 1);
  24405. D.u(e);
  24406. return b
  24407. },
  24408. PrimitiveToCall: function(a, b, c) {
  24409. var d = a ? a.Sc : NaN;
  24410. a = a ? a.ev : NaN;
  24411. isNaN(d) && (d = .1);
  24412. isNaN(a) && (a = .3);
  24413. var e = D.v();
  24414. T(e, 0, 0, !0);
  24415. e.lineTo((1 - a) * b, 0);
  24416. e.lineTo(1 * b, .5 * c);
  24417. e.lineTo((1 - a) * b, 1 * c);
  24418. e.lineTo(0, 1 * c);
  24419. X(e);
  24420. b = e.q;
  24421. b.C = new S(d, 0);
  24422. b.D = new S(1 - a, 1);
  24423. D.u(e);
  24424. return b
  24425. },
  24426. Subroutine: "Procedure",
  24427. Procedure: function(a, b, c) {
  24428. a = a ? a.Sc : NaN;
  24429. isNaN(a) && (a = .1);
  24430. var d = D.v();
  24431. T(d, 0, 0, !0);
  24432. d.lineTo(1 * b, 0);
  24433. d.lineTo(1 * b, 1 * c);
  24434. d.lineTo(0,
  24435. 1 * c);
  24436. X(d);
  24437. T(d, (1 - a) * b, 0, !1);
  24438. d.lineTo((1 - a) * b, 1 * c);
  24439. d.moveTo(a * b, 0);
  24440. d.lineTo(a * b, 1 * c);
  24441. d.jb(!1);
  24442. b = d.q;
  24443. b.C = new S(a, 0);
  24444. b.D = new S(1 - a, 1);
  24445. D.u(d);
  24446. return b
  24447. },
  24448. Process: function(a, b, c) {
  24449. a = a ? a.Sc : NaN;
  24450. isNaN(a) && (a = .1);
  24451. var d = D.v();
  24452. T(d, 0, 0, !0);
  24453. d.lineTo(1 * b, 0);
  24454. d.lineTo(1 * b, 1 * c);
  24455. d.lineTo(0, 1 * c);
  24456. X(d);
  24457. T(d, a * b, 0, !1);
  24458. d.lineTo(a * b, 1 * c);
  24459. d.jb(!1);
  24460. b = d.q;
  24461. b.C = new S(a, 0);
  24462. b.D = vc;
  24463. D.u(d);
  24464. return b
  24465. },
  24466. Sort: function(a, b, c) {
  24467. a = D.v();
  24468. T(a, .5 * b, 0, !0);
  24469. a.lineTo(1 * b, .5 * c);
  24470. a.lineTo(.5 * b, 1 * c);
  24471. a.lineTo(0, .5 * c);
  24472. X(a);
  24473. T(a, 0, .5 * c, !1);
  24474. a.lineTo(1 * b, .5 *
  24475. c);
  24476. a.jb(!1);
  24477. b = a.q;
  24478. b.C = new S(.25, .25);
  24479. b.D = new S(.75, .5);
  24480. D.u(a);
  24481. return b
  24482. },
  24483. Start: function(a, b, c) {
  24484. a = D.v();
  24485. T(a, .25 * b, 0, !0);
  24486. T(a, .25 * b, 0, !0);
  24487. a.arcTo(270, 180, .75 * b, .5 * c, .25 * b, .5 * c);
  24488. a.arcTo(90, 180, .25 * b, .5 * c, .25 * b, .5 * c);
  24489. T(a, .25 * b, 0, !1);
  24490. a.lineTo(.25 * b, 1 * c);
  24491. a.moveTo(.75 * b, 0);
  24492. a.lineTo(.75 * b, 1 * c);
  24493. a.jb(!1);
  24494. b = a.q;
  24495. b.C = new S(.25, 0);
  24496. b.D = new S(.75, 1);
  24497. D.u(a);
  24498. return b
  24499. },
  24500. Terminator: function(a, b, c) {
  24501. a = D.v();
  24502. T(a, .25 * b, 0, !0);
  24503. a.arcTo(270, 180, .75 * b, .5 * c, .25 * b, .5 * c);
  24504. a.arcTo(90, 180, .25 * b, .5 * c, .25 * b, .5 * c);
  24505. b = a.q;
  24506. b.C = new S(.23, 0);
  24507. b.D = new S(.77, 1);
  24508. D.u(a);
  24509. return b
  24510. },
  24511. TransmittalTape: function(a, b, c) {
  24512. a = a ? a.Sc : NaN;
  24513. isNaN(a) && (a = .1);
  24514. var d = D.v();
  24515. T(d, 0, 0, !0);
  24516. d.lineTo(1 * b, 0);
  24517. d.lineTo(1 * b, 1 * c);
  24518. d.lineTo(.75 * b, (1 - a) * c);
  24519. d.lineTo(0, (1 - a) * c);
  24520. X(d);
  24521. b = d.q;
  24522. b.C = ec;
  24523. b.D = new S(1, 1 - a);
  24524. D.u(d);
  24525. return b
  24526. },
  24527. AndGate: function(a, b, c) {
  24528. a = D.v();
  24529. var d = .5 * Jd;
  24530. T(a, 0, 0, !0);
  24531. a.lineTo(.5 * b, 0);
  24532. U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  24533. U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  24534. a.lineTo(0, 1 * c);
  24535. X(a);
  24536. b = a.q;
  24537. b.C = ec;
  24538. b.D = new S(.55, 1);
  24539. D.u(a);
  24540. return b
  24541. },
  24542. Buffer: function(a, b, c) {
  24543. a = D.v();
  24544. T(a,
  24545. 0, 0, !0);
  24546. a.lineTo(1 * b, .5 * c);
  24547. a.lineTo(0, 1 * c);
  24548. X(a);
  24549. b = a.q;
  24550. b.C = new S(0, .25);
  24551. b.D = new S(.5, .75);
  24552. D.u(a);
  24553. return b
  24554. },
  24555. Clock: function(a, b, c) {
  24556. a = D.v();
  24557. var d = .5 * Jd;
  24558. T(a, 1 * b, .5 * c, !0);
  24559. U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  24560. U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
  24561. U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
  24562. U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  24563. T(a, 1 * b, .5 * c, !1);
  24564. a.lineTo(1 * b, .5 * c);
  24565. T(a, .8 * b, .75 * c, !1);
  24566. a.lineTo(.8 * b, .25 * c);
  24567. a.lineTo(.6 * b, .25 * c);
  24568. a.lineTo(.6 * b, .75 * c);
  24569. a.lineTo(.4 * b, .75 * c);
  24570. a.lineTo(.4 * b, .25 * c);
  24571. a.lineTo(.2 * b, .25 * c);
  24572. a.lineTo(.2 *
  24573. b, .75 * c);
  24574. a.jb(!1);
  24575. b = a.q;
  24576. b.le = bk;
  24577. D.u(a);
  24578. return b
  24579. },
  24580. Ground: function(a, b, c) {
  24581. a = D.v();
  24582. T(a, .5 * b, 0, !1);
  24583. a.lineTo(.5 * b, .4 * c);
  24584. a.moveTo(.2 * b, .6 * c);
  24585. a.lineTo(.8 * b, .6 * c);
  24586. a.moveTo(.3 * b, .8 * c);
  24587. a.lineTo(.7 * b, .8 * c);
  24588. a.moveTo(.4 * b, 1 * c);
  24589. a.lineTo(.6 * b, 1 * c);
  24590. b = a.q;
  24591. D.u(a);
  24592. return b
  24593. },
  24594. Inverter: function(a, b, c) {
  24595. a = D.v();
  24596. var d = .1 * Jd;
  24597. T(a, .8 * b, .5 * c, !0);
  24598. a.lineTo(0, 1 * c);
  24599. a.lineTo(0, 0);
  24600. a.lineTo(.8 * b, .5 * c);
  24601. T(a, 1 * b, .5 * c, !0);
  24602. U(a, 1 * b, (.5 + d) * c, (.9 + d) * b, .6 * c, .9 * b, .6 * c);
  24603. U(a, (.9 - d) * b, .6 * c, .8 * b, (.5 + d) * c, .8 * b, .5 * c);
  24604. U(a, .8 * b, (.5 - d) * c, (.9 - d) * b, .4 *
  24605. c, .9 * b, .4 * c);
  24606. U(a, (.9 + d) * b, .4 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  24607. b = a.q;
  24608. b.C = new S(0, .25);
  24609. b.D = new S(.4, .75);
  24610. D.u(a);
  24611. return b
  24612. },
  24613. NandGate: function(a, b, c) {
  24614. a = D.v();
  24615. var d = .5 * Jd,
  24616. e = .4 * Jd,
  24617. g = .1 * Jd;
  24618. T(a, .8 * b, .5 * c, !0);
  24619. U(a, .8 * b, (.5 + e) * c, (.4 + d) * b, 1 * c, .4 * b, 1 * c);
  24620. a.lineTo(0, 1 * c);
  24621. a.lineTo(0, 0);
  24622. a.lineTo(.4 * b, 0);
  24623. U(a, (.4 + d) * b, 0, .8 * b, (.5 - e) * c, .8 * b, .5 * c);
  24624. T(a, 1 * b, .5 * c, !0);
  24625. U(a, 1 * b, (.5 + g) * c, (.9 + g) * b, .6 * c, .9 * b, .6 * c);
  24626. U(a, (.9 - g) * b, .6 * c, .8 * b, (.5 + g) * c, .8 * b, .5 * c);
  24627. U(a, .8 * b, (.5 - g) * c, (.9 - g) * b, .4 * c, .9 * b, .4 * c);
  24628. U(a, (.9 + g) * b, .4 * c, 1 * b, (.5 - g) * c, 1 * b, .5 *
  24629. c);
  24630. b = a.q;
  24631. b.C = new S(0, .05);
  24632. b.D = new S(.55, .95);
  24633. D.u(a);
  24634. return b
  24635. },
  24636. NorGate: function(a, b, c) {
  24637. a = D.v();
  24638. var d = .5,
  24639. e = Jd * d,
  24640. g = 0,
  24641. h = .5;
  24642. T(a, .8 * b, .5 * c, !0);
  24643. U(a, .7 * b, (h + e) * c, (g + e) * b, (h + d) * c, 0, 1 * c);
  24644. U(a, .25 * b, .75 * c, .25 * b, .25 * c, 0, 0);
  24645. U(a, (g + e) * b, (h - d) * c, .7 * b, (h - e) * c, .8 * b, .5 * c);
  24646. d = .1;
  24647. e = .1 * Jd;
  24648. g = .9;
  24649. h = .5;
  24650. T(a, (g - d) * b, h * c, !0);
  24651. U(a, (g - d) * b, (h - e) * c, (g - e) * b, (h - d) * c, g * b, (h - d) * c);
  24652. U(a, (g + e) * b, (h - d) * c, (g + d) * b, (h - e) * c, (g + d) * b, h * c);
  24653. U(a, (g + d) * b, (h + e) * c, (g + e) * b, (h + d) * c, g * b, (h + d) * c);
  24654. U(a, (g - e) * b, (h + d) * c, (g - d) * b, (h + e) * c, (g - d) * b, h * c);
  24655. b = a.q;
  24656. b.C =
  24657. new S(.2, .25);
  24658. b.D = new S(.6, .75);
  24659. D.u(a);
  24660. return b
  24661. },
  24662. OrGate: function(a, b, c) {
  24663. a = D.v();
  24664. var d = .5 * Jd;
  24665. T(a, 0, 0, !0);
  24666. U(a, (0 + d + d) * b, 0 * c, .8 * b, (.5 - d) * c, 1 * b, .5 * c);
  24667. U(a, .8 * b, (.5 + d) * c, (0 + d + d) * b, 1 * c, 0, 1 * c);
  24668. U(a, .25 * b, .75 * c, .25 * b, .25 * c, 0, 0);
  24669. X(a);
  24670. b = a.q;
  24671. b.C = new S(.2, .25);
  24672. b.D = new S(.75, .75);
  24673. D.u(a);
  24674. return b
  24675. },
  24676. XnorGate: function(a, b, c) {
  24677. a = D.v();
  24678. var d = .5,
  24679. e = Jd * d,
  24680. g = .2,
  24681. h = .5;
  24682. T(a, .1 * b, 0, !1);
  24683. U(a, .35 * b, .25 * c, .35 * b, .75 * c, .1 * b, 1 * c);
  24684. T(a, .8 * b, .5 * c, !0);
  24685. U(a, .7 * b, (h + e) * c, (g + e) * b, (h + d) * c, .2 * b, 1 * c);
  24686. U(a, .45 * b, .75 * c, .45 * b, .25 * c, .2 * b, 0);
  24687. U(a, (g + e) *
  24688. b, (h - d) * c, .7 * b, (h - e) * c, .8 * b, .5 * c);
  24689. d = .1;
  24690. e = .1 * Jd;
  24691. g = .9;
  24692. h = .5;
  24693. T(a, (g - d) * b, h * c, !0);
  24694. U(a, (g - d) * b, (h - e) * c, (g - e) * b, (h - d) * c, g * b, (h - d) * c);
  24695. U(a, (g + e) * b, (h - d) * c, (g + d) * b, (h - e) * c, (g + d) * b, h * c);
  24696. U(a, (g + d) * b, (h + e) * c, (g + e) * b, (h + d) * c, g * b, (h + d) * c);
  24697. U(a, (g - e) * b, (h + d) * c, (g - d) * b, (h + e) * c, (g - d) * b, h * c);
  24698. b = a.q;
  24699. b.C = new S(.4, .25);
  24700. b.D = new S(.65, .75);
  24701. D.u(a);
  24702. return b
  24703. },
  24704. XorGate: function(a, b, c) {
  24705. a = D.v();
  24706. var d = .5 * Jd;
  24707. T(a, .1 * b, 0, !1);
  24708. U(a, .35 * b, .25 * c, .35 * b, .75 * c, .1 * b, 1 * c);
  24709. T(a, .2 * b, 0, !0);
  24710. U(a, (.2 + d) * b, 0 * c, .9 * b, (.5 - d) * c, 1 * b, .5 * c);
  24711. U(a, .9 * b, (.5 + d) *
  24712. c, (.2 + d) * b, 1 * c, .2 * b, 1 * c);
  24713. U(a, .45 * b, .75 * c, .45 * b, .25 * c, .2 * b, 0);
  24714. X(a);
  24715. b = a.q;
  24716. b.C = new S(.4, .25);
  24717. b.D = new S(.8, .75);
  24718. D.u(a);
  24719. return b
  24720. },
  24721. Capacitor: function(a, b, c) {
  24722. a = D.v();
  24723. T(a, 0, 0, !1);
  24724. a.lineTo(0, 1 * c);
  24725. a.moveTo(1 * b, 0);
  24726. a.lineTo(1 * b, 1 * c);
  24727. b = a.q;
  24728. D.u(a);
  24729. return b
  24730. },
  24731. Resistor: function(a, b, c) {
  24732. a = D.v();
  24733. T(a, 0, .5 * c, !1);
  24734. a.lineTo(.1 * b, 0);
  24735. a.lineTo(.2 * b, 1 * c);
  24736. a.lineTo(.3 * b, 0);
  24737. a.lineTo(.4 * b, 1 * c);
  24738. a.lineTo(.5 * b, 0);
  24739. a.lineTo(.6 * b, 1 * c);
  24740. a.lineTo(.7 * b, .5 * c);
  24741. b = a.q;
  24742. D.u(a);
  24743. return b
  24744. },
  24745. Inductor: function(a, b, c) {
  24746. a = D.v();
  24747. var d = .1 * Jd,
  24748. e = .1;
  24749. T(a, (e - .5 *
  24750. d) * b, c, !1);
  24751. U(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
  24752. e = .3;
  24753. U(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c);
  24754. U(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
  24755. e = .5;
  24756. U(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c);
  24757. U(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
  24758. e = .7;
  24759. U(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c);
  24760. U(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
  24761. e = .9;
  24762. U(a, (e + .1) * b, 0, (e + d) * b, c, (e + .5 * d) * b, c);
  24763. b = a.q;
  24764. D.u(a);
  24765. return b
  24766. },
  24767. ACvoltageSource: function(a, b, c) {
  24768. a = D.v();
  24769. var d = .5 * Jd;
  24770. T(a, 0 * b, .5 * c, !1);
  24771. U(a, 0 * b, (.5 - d) * c, (.5 - d) * b, 0 * c, .5 * b, 0 * c);
  24772. U(a, (.5 + d) * b, 0 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  24773. U(a, 1 * b, (.5 + d) *
  24774. c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  24775. U(a, (.5 - d) * b, 1 * c, 0 * b, (.5 + d) * c, 0 * b, .5 * c);
  24776. a.moveTo(.1 * b, .5 * c);
  24777. U(a, .5 * b, 0 * c, .5 * b, 1 * c, .9 * b, .5 * c);
  24778. b = a.q;
  24779. b.le = bk;
  24780. D.u(a);
  24781. return b
  24782. },
  24783. DCvoltageSource: function(a, b, c) {
  24784. a = D.v();
  24785. T(a, 0, .75 * c, !1);
  24786. a.lineTo(0, .25 * c);
  24787. a.moveTo(1 * b, 0);
  24788. a.lineTo(1 * b, 1 * c);
  24789. b = a.q;
  24790. D.u(a);
  24791. return b
  24792. },
  24793. Diode: function(a, b, c) {
  24794. a = D.v();
  24795. T(a, 1 * b, 0, !1);
  24796. a.lineTo(1 * b, .5 * c);
  24797. a.lineTo(0, 1 * c);
  24798. a.lineTo(0, 0);
  24799. a.lineTo(1 * b, .5 * c);
  24800. a.lineTo(1 * b, 1 * c);
  24801. b = a.q;
  24802. b.C = new S(0, .25);
  24803. b.D = new S(.5, .75);
  24804. D.u(a);
  24805. return b
  24806. },
  24807. Wifi: function(a, b, c) {
  24808. var d = b,
  24809. e = c;
  24810. b *= .38;
  24811. c *= .6;
  24812. a = D.v();
  24813. var g = .8 * Jd,
  24814. h = .8,
  24815. k = 0,
  24816. l = .5,
  24817. d = (d - b) / 2,
  24818. e = (e - c) / 2;
  24819. T(a, k * b + d, (l + h) * c + e, !0);
  24820. U(a, (k - g) * b + d, (l + h) * c + e, (k - h) * b + d, (l + g) * c + e, (k - h) * b + d, l * c + e);
  24821. U(a, (k - h) * b + d, (l - g) * c + e, (k - g) * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
  24822. U(a, k * b + d, (l - h) * c + e, (k - h + .5 * g) * b + d, (l - g) * c + e, (k - h + .5 * g) * b + d, l * c + e);
  24823. U(a, (k - h + .5 * g) * b + d, (l + g) * c + e, k * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
  24824. X(a);
  24825. g = .4 * Jd;
  24826. h = .4;
  24827. k = .2;
  24828. l = .5;
  24829. T(a, k * b + d, (l + h) * c + e, !0);
  24830. U(a, (k - g) * b + d, (l + h) * c + e, (k - h) * b + d, (l + g) * c + e, (k - h) * b + d, l * c + e);
  24831. U(a, (k - h) * b + d, (l - g) * c + e, (k - g) * b + d, (l - h) * c + e, k *
  24832. b + d, (l - h) * c + e);
  24833. U(a, k * b + d, (l - h) * c + e, (k - h + .5 * g) * b + d, (l - g) * c + e, (k - h + .5 * g) * b + d, l * c + e);
  24834. U(a, (k - h + .5 * g) * b + d, (l + g) * c + e, k * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
  24835. X(a);
  24836. g = .2 * Jd;
  24837. h = .2;
  24838. l = k = .5;
  24839. T(a, (k - h) * b + d, l * c + e, !0);
  24840. U(a, (k - h) * b + d, (l - g) * c + e, (k - g) * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
  24841. U(a, (k + g) * b + d, (l - h) * c + e, (k + h) * b + d, (l - g) * c + e, (k + h) * b + d, l * c + e);
  24842. U(a, (k + h) * b + d, (l + g) * c + e, (k + g) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
  24843. U(a, (k - g) * b + d, (l + h) * c + e, (k - h) * b + d, (l + g) * c + e, (k - h) * b + d, l * c + e);
  24844. g = .4 * Jd;
  24845. h = .4;
  24846. k = .8;
  24847. l = .5;
  24848. T(a, k * b + d, (l - h) * c + e, !0);
  24849. U(a, (k + g) * b + d, (l -
  24850. h) * c + e, (k + h) * b + d, (l - g) * c + e, (k + h) * b + d, l * c + e);
  24851. U(a, (k + h) * b + d, (l + g) * c + e, (k + g) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
  24852. U(a, k * b + d, (l + h) * c + e, (k + h - .5 * g) * b + d, (l + g) * c + e, (k + h - .5 * g) * b + d, l * c + e);
  24853. U(a, (k + h - .5 * g) * b + d, (l - g) * c + e, k * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
  24854. X(a);
  24855. g = .8 * Jd;
  24856. h = .8;
  24857. k = 1;
  24858. l = .5;
  24859. T(a, k * b + d, (l - h) * c + e, !0);
  24860. U(a, (k + g) * b + d, (l - h) * c + e, (k + h) * b + d, (l - g) * c + e, (k + h) * b + d, l * c + e);
  24861. U(a, (k + h) * b + d, (l + g) * c + e, (k + g) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
  24862. U(a, k * b + d, (l + h) * c + e, (k + h - .5 * g) * b + d, (l + g) * c + e, (k + h - .5 * g) * b + d, l * c + e);
  24863. U(a, (k + h - .5 * g) * b + d, (l - g) * c +
  24864. e, k * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
  24865. X(a);
  24866. b = a.q;
  24867. D.u(a);
  24868. return b
  24869. },
  24870. Email: function(a, b, c) {
  24871. a = D.v();
  24872. T(a, 0, 0, !0);
  24873. a.lineTo(1 * b, 0);
  24874. a.lineTo(1 * b, 1 * c);
  24875. a.lineTo(0, 1 * c);
  24876. a.lineTo(0, 0);
  24877. X(a);
  24878. T(a, 0, 0, !1);
  24879. a.lineTo(.5 * b, .6 * c);
  24880. a.lineTo(1 * b, 0);
  24881. a.moveTo(0, 1 * c);
  24882. a.lineTo(.45 * b, .54 * c);
  24883. a.moveTo(1 * b, 1 * c);
  24884. a.lineTo(.55 * b, .54 * c);
  24885. a.jb(!1);
  24886. b = a.q;
  24887. D.u(a);
  24888. return b
  24889. },
  24890. Ethernet: function(a, b, c) {
  24891. a = D.v();
  24892. T(a, .35 * b, 0, !0);
  24893. a.lineTo(.65 * b, 0);
  24894. a.lineTo(.65 * b, .4 * c);
  24895. a.lineTo(.35 * b, .4 * c);
  24896. a.lineTo(.35 * b, 0);
  24897. X(a);
  24898. T(a, .1 * b, 1 * c, !0, !0);
  24899. a.lineTo(.4 * b, 1 * c);
  24900. a.lineTo(.4 * b, .6 * c);
  24901. a.lineTo(.1 * b, .6 * c);
  24902. a.lineTo(.1 * b, 1 * c);
  24903. X(a);
  24904. T(a, .6 * b, 1 * c, !0, !0);
  24905. a.lineTo(.9 * b, 1 * c);
  24906. a.lineTo(.9 * b, .6 * c);
  24907. a.lineTo(.6 * b, .6 * c);
  24908. a.lineTo(.6 * b, 1 * c);
  24909. X(a);
  24910. T(a, 0, .5 * c, !1);
  24911. a.lineTo(1 * b, .5 * c);
  24912. a.moveTo(.5 * b, .5 * c);
  24913. a.lineTo(.5 * b, .4 * c);
  24914. a.moveTo(.75 * b, .5 * c);
  24915. a.lineTo(.75 * b, .6 * c);
  24916. a.moveTo(.25 * b, .5 * c);
  24917. a.lineTo(.25 * b, .6 * c);
  24918. a.jb(!1);
  24919. b = a.q;
  24920. D.u(a);
  24921. return b
  24922. },
  24923. Power: function(a, b, c) {
  24924. a = D.v();
  24925. var d = .4 * Jd,
  24926. e = .4,
  24927. g = D.P(),
  24928. h = D.P(),
  24929. k = D.P(),
  24930. l = D.P();
  24931. Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .5, g, g, h, k, l);
  24932. var m = D.Fb(h.x,
  24933. h.y);
  24934. T(a, h.x * b, h.y * c, !0);
  24935. U(a, k.x * b, k.y * c, l.x * b, l.y * c, (.5 + e) * b, .5 * c);
  24936. U(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
  24937. U(a, (.5 - d) * b, (.5 + e) * c, (.5 - e) * b, (.5 + d) * c, (.5 - e) * b, .5 * c);
  24938. Ce(.5 - e, .5, .5 - e, .5 - d, .5 - d, .5 - e, .5, .5 - e, .5, k, l, h, g, g);
  24939. U(a, k.x * b, k.y * c, l.x * b, l.y * c, h.x * b, h.y * c);
  24940. d = .3 * Jd;
  24941. e = .3;
  24942. Ce(.5 - e, .5, .5 - e, .5 - d, .5 - d, .5 - e, .5, .5 - e, .5, k, l, h, g, g);
  24943. a.lineTo(h.x * b, h.y * c);
  24944. U(a, l.x * b, l.y * c, k.x * b, k.y * c, (.5 - e) * b, .5 * c);
  24945. U(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
  24946. U(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 +
  24947. e) * b, .5 * c);
  24948. Ce(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .5, g, g, h, k, l);
  24949. U(a, l.x * b, l.y * c, k.x * b, k.y * c, h.x * b, h.y * c);
  24950. X(a);
  24951. T(a, .45 * b, 0, !0);
  24952. a.lineTo(.45 * b, .5 * c);
  24953. a.lineTo(.55 * b, .5 * c);
  24954. a.lineTo(.55 * b, 0);
  24955. X(a);
  24956. D.A(g);
  24957. D.A(h);
  24958. D.A(k);
  24959. D.A(l);
  24960. D.A(m);
  24961. b = a.q;
  24962. b.C = new S(.25, .55);
  24963. b.D = new S(.75, .8);
  24964. D.u(a);
  24965. return b
  24966. },
  24967. Fallout: function(a, b, c) {
  24968. a = D.v();
  24969. var d = .5 * Jd;
  24970. T(a, 0 * b, .5 * c, !0);
  24971. U(a, 0 * b, (.5 - d) * c, (.5 - d) * b, 0 * c, .5 * b, 0 * c);
  24972. U(a, (.5 + d) * b, 0 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  24973. U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  24974. U(a, (.5 - d) * b, 1 * c, 0 * b, (.5 + d) * c, 0 * b,
  24975. .5 * c);
  24976. var e = d = 0;
  24977. T(a, (.3 + d) * b, (.8 + e) * c, !0, !0);
  24978. a.lineTo((.5 + d) * b, (.5 + e) * c);
  24979. a.lineTo((.1 + d) * b, (.5 + e) * c);
  24980. a.lineTo((.3 + d) * b, (.8 + e) * c);
  24981. d = .4;
  24982. e = 0;
  24983. X(a);
  24984. T(a, (.3 + d) * b, (.8 + e) * c, !0, !0);
  24985. a.lineTo((.5 + d) * b, (.5 + e) * c);
  24986. a.lineTo((.1 + d) * b, (.5 + e) * c);
  24987. a.lineTo((.3 + d) * b, (.8 + e) * c);
  24988. d = .2;
  24989. e = -.3;
  24990. X(a);
  24991. T(a, (.3 + d) * b, (.8 + e) * c, !0, !0);
  24992. a.lineTo((.5 + d) * b, (.5 + e) * c);
  24993. a.lineTo((.1 + d) * b, (.5 + e) * c);
  24994. a.lineTo((.3 + d) * b, (.8 + e) * c);
  24995. X(a);
  24996. b = a.q;
  24997. b.le = bk;
  24998. D.u(a);
  24999. return b
  25000. },
  25001. IrritationHazard: function(a, b, c) {
  25002. a = D.v();
  25003. T(a, .2 * b, 0 * c, !0);
  25004. a.lineTo(.5 * b, .3 * c);
  25005. a.lineTo(.8 *
  25006. b, 0 * c);
  25007. a.lineTo(1 * b, .2 * c);
  25008. a.lineTo(.7 * b, .5 * c);
  25009. a.lineTo(1 * b, .8 * c);
  25010. a.lineTo(.8 * b, 1 * c);
  25011. a.lineTo(.5 * b, .7 * c);
  25012. a.lineTo(.2 * b, 1 * c);
  25013. a.lineTo(0 * b, .8 * c);
  25014. a.lineTo(.3 * b, .5 * c);
  25015. a.lineTo(0 * b, .2 * c);
  25016. X(a);
  25017. b = a.q;
  25018. b.C = new S(.3, .3);
  25019. b.D = new S(.7, .7);
  25020. D.u(a);
  25021. return b
  25022. },
  25023. ElectricalHazard: function(a, b, c) {
  25024. a = D.v();
  25025. T(a, .37 * b, 0 * c, !0);
  25026. a.lineTo(.5 * b, .11 * c);
  25027. a.lineTo(.77 * b, .04 * c);
  25028. a.lineTo(.33 * b, .49 * c);
  25029. a.lineTo(1 * b, .37 * c);
  25030. a.lineTo(.63 * b, .86 * c);
  25031. a.lineTo(.77 * b, .91 * c);
  25032. a.lineTo(.34 * b, 1 * c);
  25033. a.lineTo(.34 * b, .78 * c);
  25034. a.lineTo(.44 * b, .8 * c);
  25035. a.lineTo(.65 *
  25036. b, .56 * c);
  25037. a.lineTo(0 * b, .68 * c);
  25038. X(a);
  25039. b = a.q;
  25040. D.u(a);
  25041. return b
  25042. },
  25043. FireHazard: function(a, b, c) {
  25044. a = D.v();
  25045. T(a, .1 * b, 1 * c, !0);
  25046. U(a, -.25 * b, .63 * c, .45 * b, .44 * c, .29 * b, 0 * c);
  25047. U(a, .48 * b, .17 * c, .54 * b, .35 * c, .51 * b, .42 * c);
  25048. U(a, .59 * b, .29 * c, .58 * b, .28 * c, .59 * b, .18 * c);
  25049. U(a, .8 * b, .34 * c, .88 * b, .43 * c, .75 * b, .6 * c);
  25050. U(a, .87 * b, .48 * c, .88 * b, .43 * c, .88 * b, .31 * c);
  25051. U(a, 1.17 * b, .76 * c, .82 * b, .8 * c, .9 * b, 1 * c);
  25052. X(a);
  25053. b = a.q;
  25054. b.C = new S(.05, .645);
  25055. b.D = new S(.884, .908);
  25056. D.u(a);
  25057. return b
  25058. },
  25059. BpmnActivityLoop: function(a, b, c) {
  25060. a = D.v();
  25061. var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
  25062. T(a, .65 * b, 1 * c, !1);
  25063. U(a, (1 - d + 0) * b, 1 * c, 1 * b, (.5 + d + 0) * c, 1 * b, .5 * c);
  25064. U(a, 1 * b, (.5 - d + 0) * c, (.5 + d + 0) * b, 0 * c, .5 * b, 0 * c);
  25065. U(a, (.5 - d + 0) * b, 0 * c, 0 * b, (.5 - d + 0) * c, 0 * b, .5 * c);
  25066. U(a, 0 * b, (.5 + d + 0) * c, (.5 - d + 0) * b, 1 * c, .35 * b, .98 * c);
  25067. a.moveTo(.25 * b, .8 * c);
  25068. a.lineTo(.35 * b, 1 * c);
  25069. a.lineTo(.1 * b, 1 * c);
  25070. b = a.q;
  25071. D.u(a);
  25072. return b
  25073. },
  25074. BpmnActivityParallel: function(a, b, c) {
  25075. a = D.v();
  25076. T(a, 0, 0, !1);
  25077. a.lineTo(0, 1 * c);
  25078. a.moveTo(.5 * b, 0);
  25079. a.lineTo(.5 * b, 1 * c);
  25080. a.moveTo(1 * b, 0);
  25081. a.lineTo(1 * b, 1 * c);
  25082. b = a.q;
  25083. D.u(a);
  25084. return b
  25085. },
  25086. BpmnActivitySequential: function(a, b, c) {
  25087. a = D.v();
  25088. T(a, 0, 0, !1);
  25089. a.lineTo(1 *
  25090. b, 0);
  25091. a.moveTo(0, .5 * c);
  25092. a.lineTo(1 * b, .5 * c);
  25093. a.moveTo(0, 1 * c);
  25094. a.lineTo(1 * b, 1 * c);
  25095. b = a.q;
  25096. D.u(a);
  25097. return b
  25098. },
  25099. BpmnActivityAdHoc: function(a, b, c) {
  25100. a = D.v();
  25101. T(a, 0, 0, !1);
  25102. T(a, 1 * b, 1 * c, !1);
  25103. T(a, 0, .5 * c, !1);
  25104. U(a, .2 * b, .35 * c, .3 * b, .35 * c, .5 * b, .5 * c);
  25105. U(a, .7 * b, .65 * c, .8 * b, .65 * c, 1 * b, .5 * c);
  25106. b = a.q;
  25107. D.u(a);
  25108. return b
  25109. },
  25110. BpmnActivityCompensation: function(a, b, c) {
  25111. a = D.v();
  25112. T(a, 0, .5 * c, !0);
  25113. a.lineTo(.5 * b, 0);
  25114. a.lineTo(.5 * b, .5 * c);
  25115. a.lineTo(1 * b, 1 * c);
  25116. a.lineTo(1 * b, 0);
  25117. a.lineTo(.5 * b, .5 * c);
  25118. a.lineTo(.5 * b, 1 * c);
  25119. X(a);
  25120. b = a.q;
  25121. D.u(a);
  25122. return b
  25123. },
  25124. BpmnTaskMessage: function(a,
  25125. b, c) {
  25126. a = D.v();
  25127. T(a, 0, .2 * c, !0);
  25128. a.lineTo(1 * b, .2 * c);
  25129. a.lineTo(1 * b, .8 * c);
  25130. a.lineTo(0, .8 * c);
  25131. a.lineTo(0, .8 * c);
  25132. X(a);
  25133. T(a, 0, .2 * c, !1);
  25134. a.lineTo(.5 * b, .5 * c);
  25135. a.lineTo(1 * b, .2 * c);
  25136. a.jb(!1);
  25137. b = a.q;
  25138. D.u(a);
  25139. return b
  25140. },
  25141. BpmnTaskScript: function(a, b, c) {
  25142. a = D.v();
  25143. T(a, .7 * b, 1 * c, !0);
  25144. a.lineTo(.3 * b, 1 * c);
  25145. U(a, .6 * b, .5 * c, 0, .5 * c, .3 * b, 0);
  25146. a.lineTo(.7 * b, 0);
  25147. U(a, .4 * b, .5 * c, 1 * b, .5 * c, .7 * b, 1 * c);
  25148. X(a);
  25149. T(a, .45 * b, .73 * c, !1);
  25150. a.lineTo(.7 * b, .73 * c);
  25151. a.moveTo(.38 * b, .5 * c);
  25152. a.lineTo(.63 * b, .5 * c);
  25153. a.moveTo(.31 * b, .27 * c);
  25154. a.lineTo(.56 * b, .27 * c);
  25155. a.jb(!1);
  25156. b = a.q;
  25157. D.u(a);
  25158. return b
  25159. },
  25160. BpmnTaskUser: function(a, b, c) {
  25161. a = D.v();
  25162. T(a, 0, 0, !1);
  25163. T(a, .335 * b, (1 - .555) * c, !0);
  25164. a.lineTo(.335 * b, .595 * c);
  25165. a.lineTo(.665 * b, .595 * c);
  25166. a.lineTo(.665 * b, (1 - .555) * c);
  25167. U(a, .88 * b, .46 * c, .98 * b, .54 * c, 1 * b, .68 * c);
  25168. a.lineTo(1 * b, 1 * c);
  25169. a.lineTo(0, 1 * c);
  25170. a.lineTo(0, .68 * c);
  25171. U(a, .02 * b, .54 * c, .12 * b, .46 * c, .335 * b, (1 - .555) * c);
  25172. a.lineTo(.365 * b, .405 * c);
  25173. var d = .5 - .285,
  25174. e = Math.PI / 4,
  25175. g = 4 * (1 - Math.cos(e)) / (3 * Math.sin(e)),
  25176. e = g * d,
  25177. g = g * d;
  25178. U(a, (.5 - (e + d) / 2) * b, (d + (d + g) / 2) * c, (.5 - d) * b, (d + g) * c, (.5 - d) * b, d * c);
  25179. U(a, (.5 - d) * b, (d - g) * c, (.5 - e) * b, (d - d) * c, .5 * b, (d - d) * c);
  25180. U(a, (.5 + e) * b, (d - d) * c, (.5 + d) * b, (d - g) * c, (.5 + d) * b, d * c);
  25181. U(a, (.5 + d) * b, (d + g) * c, (.5 + (e + d) / 2) * b, (d + (d + g) / 2) * c, .635 * b, .405 * c);
  25182. a.lineTo(.635 * b, .405 * c);
  25183. a.lineTo(.665 * b, (1 - .555) * c);
  25184. a.lineTo(.665 * b, .595 * c);
  25185. a.lineTo(.335 * b, .595 * c);
  25186. T(a, .2 * b, 1 * c, !1);
  25187. a.lineTo(.2 * b, .8 * c);
  25188. T(a, .8 * b, 1 * c, !1);
  25189. a.lineTo(.8 * b, .8 * c);
  25190. b = a.q;
  25191. D.u(a);
  25192. return b
  25193. },
  25194. BpmnEventConditional: function(a, b, c) {
  25195. a = D.v();
  25196. T(a, .1 * b, 0, !0);
  25197. a.lineTo(.9 * b, 0);
  25198. a.lineTo(.9 * b, 1 * c);
  25199. a.lineTo(.1 * b, 1 * c);
  25200. X(a);
  25201. T(a, .2 * b, .2 * c, !1);
  25202. a.lineTo(.8 * b, .2 * c);
  25203. a.moveTo(.2 * b, .4 * c);
  25204. a.lineTo(.8 *
  25205. b, .4 * c);
  25206. a.moveTo(.2 * b, .6 * c);
  25207. a.lineTo(.8 * b, .6 * c);
  25208. a.moveTo(.2 * b, .8 * c);
  25209. a.lineTo(.8 * b, .8 * c);
  25210. a.jb(!1);
  25211. b = a.q;
  25212. D.u(a);
  25213. return b
  25214. },
  25215. BpmnEventError: function(a, b, c) {
  25216. a = D.v();
  25217. T(a, 0, 1 * c, !0);
  25218. a.lineTo(.33 * b, 0);
  25219. a.lineTo(.66 * b, .5 * c);
  25220. a.lineTo(1 * b, 0);
  25221. a.lineTo(.66 * b, 1 * c);
  25222. a.lineTo(.33 * b, .5 * c);
  25223. X(a);
  25224. b = a.q;
  25225. D.u(a);
  25226. return b
  25227. },
  25228. BpmnEventEscalation: function(a, b, c) {
  25229. a = D.v();
  25230. T(a, 0, 0, !1);
  25231. T(a, 1 * b, 1 * c, !1);
  25232. T(a, .1 * b, 1 * c, !0);
  25233. a.lineTo(.5 * b, 0);
  25234. a.lineTo(.9 * b, 1 * c);
  25235. a.lineTo(.5 * b, .5 * c);
  25236. X(a);
  25237. b = a.q;
  25238. D.u(a);
  25239. return b
  25240. },
  25241. BpmnEventTimer: function(a, b, c) {
  25242. a =
  25243. D.v();
  25244. var d = .5 * Jd;
  25245. T(a, 1 * b, .5 * c, !0);
  25246. U(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
  25247. U(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
  25248. U(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
  25249. U(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
  25250. T(a, .5 * b, 0, !1);
  25251. a.lineTo(.5 * b, .15 * c);
  25252. a.moveTo(.5 * b, 1 * c);
  25253. a.lineTo(.5 * b, .85 * c);
  25254. a.moveTo(0, .5 * c);
  25255. a.lineTo(.15 * b, .5 * c);
  25256. a.moveTo(1 * b, .5 * c);
  25257. a.lineTo(.85 * b, .5 * c);
  25258. a.moveTo(.5 * b, .5 * c);
  25259. a.lineTo(.58 * b, .1 * c);
  25260. a.moveTo(.5 * b, .5 * c);
  25261. a.lineTo(.78 * b, .54 * c);
  25262. a.jb(!1);
  25263. b = a.q;
  25264. b.le = bk;
  25265. D.u(a);
  25266. return b
  25267. }
  25268. },
  25269. er;
  25270. for (er in qq) qq[er.toLowerCase()] = er;
  25271. var xq = {
  25272. "": "",
  25273. Standard: "F1 m 0,0 l 8,4 -8,4 2,-4 z",
  25274. Backward: "F1 m 8,0 l -2,4 2,4 -8,-4 z",
  25275. Triangle: "F1 m 0,0 l 8,4.62 -8,4.62 z",
  25276. BackwardTriangle: "F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",
  25277. Boomerang: "F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",
  25278. BackwardBoomerang: "F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",
  25279. SidewaysV: "m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",
  25280. BackwardV: "m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",
  25281. OpenTriangle: "m 0,0 l 8,4 -8,4",
  25282. BackwardOpenTriangle: "m 8,0 l -8,4 8,4",
  25283. OpenTriangleLine: "m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",
  25284. BackwardOpenTriangleLine: "m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",
  25285. OpenTriangleTop: "m 0,0 l 8,4 m 0,4",
  25286. BackwardOpenTriangleTop: "m 8,0 l -8,4 m 0,4",
  25287. OpenTriangleBottom: "m 0,8 l 8,-4",
  25288. BackwardOpenTriangleBottom: "m 0,4 l 8,4",
  25289. HalfTriangleTop: "F1 m 0,0 l 0,4 8,0 z m 0,8",
  25290. BackwardHalfTriangleTop: "F1 m 8,0 l 0,4 -8,0 z m 0,8",
  25291. HalfTriangleBottom: "F1 m 0,4 l 0,4 8,-4 z",
  25292. BackwardHalfTriangleBottom: "F1 m 8,4 l 0,4 -8,-4 z",
  25293. ForwardSemiCircle: "m 4,0 b 270 180 0 4 4",
  25294. BackwardSemiCircle: "m 4,8 b 90 180 0 -4 4",
  25295. Feather: "m 0,0 l 3,4 -3,4",
  25296. BackwardFeather: "m 3,0 l -3,4 3,4",
  25297. DoubleFeathers: "m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",
  25298. BackwardDoubleFeathers: "m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",
  25299. TripleFeathers: "m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",
  25300. BackwardTripleFeathers: "m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",
  25301. ForwardSlash: "m 0,8 l 5,-8",
  25302. BackSlash: "m 0,0 l 5,8",
  25303. DoubleForwardSlash: "m 0,8 l 4,-8 m -2,8 l 4,-8",
  25304. DoubleBackSlash: "m 0,0 l 4,8 m -2,-8 l 4,8",
  25305. TripleForwardSlash: "m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",
  25306. TripleBackSlash: "m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",
  25307. Fork: "m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",
  25308. BackwardFork: "m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",
  25309. LineFork: "m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",
  25310. BackwardLineFork: "m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",
  25311. CircleFork: "F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
  25312. BackwardCircleFork: "F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",
  25313. CircleLineFork: "F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
  25314. BackwardCircleLineFork: "F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",
  25315. Circle: "F1 m 8,4 b 0 360 -4 0 4 z",
  25316. Block: "F1 m 0,0 l 0,8 8,0 0,-8 z",
  25317. StretchedDiamond: "F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",
  25318. Diamond: "F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",
  25319. Chevron: "F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",
  25320. StretchedChevron: "F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",
  25321. NormalArrow: "F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",
  25322. X: "m 0,0 l 8,8 m 0,-8 l -8,8",
  25323. TailedNormalArrow: "F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",
  25324. DoubleTriangle: "F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",
  25325. BigEndArrow: "F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",
  25326. ConcaveTailArrow: "F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",
  25327. RoundedTriangle: "F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",
  25328. SimpleArrow: "F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",
  25329. AccelerationArrow: "F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",
  25330. BoxArrow: "F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",
  25331. TriangleLine: "F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",
  25332. CircleEndedArrow: "F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",
  25333. DynamicWidthArrow: "F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",
  25334. EquilibriumArrow: "m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",
  25335. FastForward: "F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",
  25336. Kite: "F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",
  25337. HalfArrowTop: "F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",
  25338. HalfArrowBottom: "F1 m 0,8 l 4,-4 4,0 -8,4 z",
  25339. OpposingDirectionDoubleArrow: "F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",
  25340. PartialDoubleTriangle: "F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",
  25341. LineCircle: "F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",
  25342. DoubleLineCircle: "F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",
  25343. TripleLineCircle: "F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",
  25344. CircleLine: "F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",
  25345. DiamondCircle: "F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",
  25346. PlusCircle: "F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",
  25347. OpenRightTriangleTop: "m 8,0 l 0,4 -8,0 m 0,4",
  25348. OpenRightTriangleBottom: "m 8,8 l 0,-4 -8,0",
  25349. Line: "m 0,0 l 0,8",
  25350. DoubleLine: "m 0,0 l 0,8 m 2,0 l 0,-8",
  25351. TripleLine: "m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",
  25352. PentagonArrow: "F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"
  25353. };
  25354. function uq(a) {
  25355. var b = ne[a];
  25356. if (void 0 === b) {
  25357. var c = a.toLowerCase();
  25358. if ("none" === c) return "None";
  25359. b = ne[c];
  25360. if (void 0 === b) {
  25361. var d = null,
  25362. e;
  25363. for (e in xq)
  25364. if (e.toLowerCase() === c) { d = e; break }
  25365. if (null !== d) return a = yf(xq[d], !1), ne[d] = a, c !== d && (ne[c] = d), d
  25366. }
  25367. }
  25368. return "string" === typeof b ? b : b instanceof Ve ? a : null
  25369. }
  25370. function F(a) {
  25371. x.call(this, a);
  25372. this.T = 2408959;
  25373. this.Nl = this.Pi = "";
  25374. this.rt = this.ot = this.At = this.zs = null;
  25375. this.Ct = "";
  25376. this.lh = this.ls = this.Bt = this.tn = null;
  25377. this.qt = "";
  25378. this.Fp = null;
  25379. this.pt = ie;
  25380. this.st = "";
  25381. this.Gp = null;
  25382. this.Yd = "";
  25383. this.xw = this.xr = this.Al = null;
  25384. this.jj = (new N(NaN, NaN)).freeze();
  25385. this.Es = "";
  25386. this.Ql = null;
  25387. this.Fs = ec;
  25388. this.Ns = Vd;
  25389. this.Gs = Wd;
  25390. this.Tr = null;
  25391. this.As = fr;
  25392. this.vn = Ud;
  25393. this.un = "gray";
  25394. this.Pg = 4;
  25395. this.QD = -1;
  25396. this.Zt = NaN;
  25397. this.EH = new C;
  25398. this.Sl = null;
  25399. this.zk = NaN
  25400. }
  25401. D.Ta(F, x);
  25402. D.ka("Part", F);
  25403. F.prototype.cloneProtected = function(a) {
  25404. x.prototype.cloneProtected.call(this, a);
  25405. a.T = this.T & -4097 | 49152;
  25406. a.Pi = this.Pi;
  25407. a.Nl = this.Nl;
  25408. a.zs = this.zs;
  25409. a.At = this.At;
  25410. a.ot = this.ot;
  25411. a.rt = this.rt;
  25412. a.Ct = this.Ct;
  25413. a.Bt = this.Bt;
  25414. a.ls = this.ls;
  25415. a.lh = null;
  25416. a.qt = this.qt;
  25417. a.pt = this.pt.V();
  25418. a.st = this.st;
  25419. a.Yd = this.Yd;
  25420. a.xr = this.xr;
  25421. a.jj.assign(this.jj);
  25422. a.Es = this.Es;
  25423. a.Fs = this.Fs.V();
  25424. a.Ns = this.Ns.V();
  25425. a.Gs = this.Gs.V();
  25426. a.Tr = this.Tr;
  25427. a.As = this.As;
  25428. a.vn = this.vn.V();
  25429. a.un = this.un;
  25430. a.Pg = this.Pg;
  25431. a.Zt = this.Zt
  25432. };
  25433. F.prototype.Ei = function(a) {
  25434. x.prototype.Ei.call(this, a);
  25435. a.cl();
  25436. a.tn = null;
  25437. a.Fp = null;
  25438. a.Gp = null;
  25439. a.Ql = null;
  25440. a.Sl = null
  25441. };
  25442. F.prototype.toString = function() {
  25443. var a = D.wf(Object.getPrototypeOf(this)) + "#" + D.Nd(this);
  25444. null !== this.data && (a += "(" + ia(this.data) + ")");
  25445. return a
  25446. };
  25447. F.LayoutNone = 0;
  25448. var Wm;
  25449. F.LayoutAdded = Wm = 1;
  25450. var en;
  25451. F.LayoutRemoved = en = 2;
  25452. F.LayoutShown = 4;
  25453. F.LayoutHidden = 8;
  25454. F.LayoutNodeSized = 16;
  25455. var Kn;
  25456. F.LayoutGroupLayout = Kn = 32;
  25457. F.LayoutNodeReplaced = 64;
  25458. var fr;
  25459. F.LayoutStandard = fr = Wm | en | 28 | Kn | 64;
  25460. F.LayoutAll = 16777215;
  25461. F.prototype.qo = function(a, b, c, d, e, g, h) {
  25462. var k = this.g;
  25463. null !== k && (a === hg && "elements" === b ? e instanceof x ? Xm(e, function(a) {
  25464. Zm(k, a);
  25465. Ym(k, a)
  25466. }) : e instanceof Hl && xn(k, e) : a === ig && "elements" === b && (e instanceof x ? Xm(e, function(a) {
  25467. cn(k, a);
  25468. bn(k, a)
  25469. }) : e instanceof Hl && yn(k, e)), k.od(a, b, c, d, e, g, h))
  25470. };
  25471. F.prototype.updateTargetBindings = F.prototype.Ob = function(a) {
  25472. x.prototype.Ob.call(this, a);
  25473. if (null !== this.data) {
  25474. a = this.xa.o;
  25475. for (var b = a.length, c = 0; c < b; c++) {
  25476. var d = a[c];
  25477. d instanceof x && Xm(d, function(a) { null !== a.data && a.Ob() })
  25478. }
  25479. }
  25480. };
  25481. F.prototype.updateRelationshipsFromData = function() {
  25482. var a = this.data;
  25483. if (null !== a) {
  25484. var b = this.g;
  25485. if (null !== b) {
  25486. var c = b.ea;
  25487. c instanceof Y && (a = c.Sn(a), b = b.NI(a), null === b || b instanceof I) && (this.Ka = b)
  25488. }
  25489. }
  25490. };
  25491. D.w(F, { key: "key" }, function() { var a = this.g; return null === a ? void 0 : a.ea.zb(this.data) }, { configurable: !0 });
  25492. D.w(F, { zx: "adornments" }, function() { return null === this.lh ? Ka : this.lh.qG });
  25493. F.prototype.findAdornment = F.prototype.nq = function(a) { v && D.h(a, "string", F, "findAdornment:category"); var b = this.lh; return null === b ? null : b.oa(a) };
  25494. F.prototype.addAdornment = F.prototype.cm = function(a, b) {
  25495. if (null !== b) {
  25496. v && (D.h(a, "string", F, "addAdornment:category"), D.l(b, da, F, "addAdornment:ad"));
  25497. var c = null,
  25498. d = this.lh;
  25499. null !== d && (c = d.oa(a));
  25500. if (c !== b) {
  25501. if (null !== c) {
  25502. var e = c.g;
  25503. null !== e && e.remove(c)
  25504. }
  25505. null === d && (this.lh = d = new oa("string", da));
  25506. b.Pi !== a && (b.Kd = a);
  25507. d.add(a, b);
  25508. c = this.g;
  25509. null !== c && (c.add(b), b.data = this.data)
  25510. }
  25511. }
  25512. };
  25513. F.prototype.removeAdornment = F.prototype.Xj = function(a) {
  25514. v && D.h(a, "string", F, "removeAdornment:category");
  25515. var b = this.lh;
  25516. if (null !== b) {
  25517. var c = b.oa(a);
  25518. if (null !== c) {
  25519. var d = c.g;
  25520. null !== d && d.remove(c)
  25521. }
  25522. b.remove(a);
  25523. 0 === b.count && (this.lh = null)
  25524. }
  25525. };
  25526. F.prototype.clearAdornments = F.prototype.iu = function() {
  25527. var a = this.lh;
  25528. if (null !== a) {
  25529. for (var b = D.mb(), a = a.j; a.next();) b.push(a.key);
  25530. for (var a = b.length, c = 0; c < a; c++) this.Xj(b[c]);
  25531. D.ya(b)
  25532. }
  25533. };
  25534. F.prototype.updateAdornments = function() {
  25535. var a = this.g;
  25536. if (null !== a) {
  25537. a: {
  25538. if (this.ib && this.$G) {
  25539. var b = this.to;
  25540. if (!(null !== b && this.aa.H() && this.isVisible() && b.Sj() && b.aa.H())) break a;
  25541. var c = this.nq("Selection");
  25542. if (null === c) {
  25543. c = this.pK;
  25544. null === c && (c = this instanceof J ? a.EJ : this instanceof I ? a.bJ : a.WJ);
  25545. if (!(c instanceof da)) break a;
  25546. Sh(c);
  25547. c = c.copy();
  25548. null !== c && (c.Bb = b)
  25549. }
  25550. if (null !== c) {
  25551. var d = c.placeholder;
  25552. if (null !== d) {
  25553. var e = b.Jj(),
  25554. g = 0;
  25555. b instanceof z && (g = b.lb);
  25556. var h = D.Gm();
  25557. h.n((b.Ga.width + g) * e, (b.Ga.height + g) * e);
  25558. d.Ea =
  25559. h;
  25560. D.Zk(h)
  25561. }
  25562. c.angle = b.sm();
  25563. c.type !== sj && (d = D.P(), c.location = b.fb(ec, d), D.A(d));
  25564. this.cm("Selection", c);
  25565. break a
  25566. }
  25567. }
  25568. this.Xj("Selection")
  25569. }
  25570. gr(this, a);
  25571. for (a = this.zx; a.next();) b = a.value,
  25572. b.Ob(),
  25573. b.K()
  25574. }
  25575. };
  25576. function gr(a, b) {
  25577. b.nb.qf.each(function(b) { b.isEnabled && b.updateAdornments(a) });
  25578. b.nb.updateAdornments(a)
  25579. }
  25580. D.w(F, { layer: "layer" }, function() { return this.xw });
  25581. D.w(F, { g: "diagram" }, function() { var a = this.xw; return null !== a ? a.g : null });
  25582. D.defineProperty(F, { Nf: "layerName" }, function() { return this.Nl }, function(a) {
  25583. var b = this.Nl;
  25584. if (b !== a) {
  25585. D.h(a, "string", F, "layerName");
  25586. var c = this.g;
  25587. if (null === c || null !== c.pm(a) && !c.hr)
  25588. if (this.Nl = a, null !== c && c.Qc(), this.i("layerName", b, a), b = this.layer, null !== b && b.name !== a && (c = b.g, null !== c && (a = c.pm(a), null !== a && a !== b))) {
  25589. var d = b.yf(-1, this, !0);
  25590. 0 <= d && c.od(ig, "parts", b, this, null, d, !0);
  25591. d = a.uq(99999999, this, !0);
  25592. b.visible !== a.visible && this.Pd(a.visible);
  25593. 0 <= d && c.od(hg, "parts", a, null, this, !0, d);
  25594. d = this.py;
  25595. if (null !==
  25596. d) {
  25597. var e = c.$a;
  25598. c.$a = !0;
  25599. d(this, b, a);
  25600. c.$a = e
  25601. }
  25602. }
  25603. }
  25604. });
  25605. D.defineProperty(F, { py: "layerChanged" }, function() { return this.zs }, function(a) {
  25606. var b = this.zs;
  25607. b !== a && (null !== a && D.h(a, "function", F, "layerChanged"), this.zs = a, this.i("layerChanged", b, a))
  25608. });
  25609. D.defineProperty(F, { Co: "zOrder" }, function() { return this.Zt }, function(a) {
  25610. var b = this.Zt;
  25611. if (b !== a) {
  25612. D.h(a, "number", F, "zOrder");
  25613. this.Zt = a;
  25614. var c = this.layer;
  25615. null !== c && yl(c, -1, this);
  25616. this.i("zOrder", b, a);
  25617. a = this.g;
  25618. null !== a && a.ra()
  25619. }
  25620. });
  25621. F.prototype.invalidateAdornments = F.prototype.pe = function() {
  25622. var a = this.g;
  25623. null !== a && (Wl(a), 0 !== (this.T & 16384) !== !0 && (this.T |= 16384, a.Ve()))
  25624. };
  25625. function ul(a) { 0 !== (a.T & 16384) !== !1 && (a.updateAdornments(), a.T &= -16385) }
  25626. function hr(a) {
  25627. if (!1 === Pm(a)) {
  25628. var b = a.g;
  25629. null !== b && (b.Gg.add(a), b.Ve());
  25630. ir(a, !0);
  25631. a.cj()
  25632. }
  25633. }
  25634. function jr(a) {
  25635. a.T |= 2097152;
  25636. if (!1 !== Pm(a)) {
  25637. var b = a.position,
  25638. c = a.location;
  25639. c.H() && b.H() || kr(a, b, c);
  25640. var c = a.bc,
  25641. d = c.copy();
  25642. c.Xa();
  25643. c.x = b.x;
  25644. c.y = b.y;
  25645. c.freeze();
  25646. a.zy(d, c);
  25647. ir(a, !1)
  25648. }
  25649. }
  25650. D.w(F, { Bf: "locationObject" }, function() { if (null === this.Ql) { var a = this.uy; "" !== a ? (a = this.Md(a), this.Ql = null !== a ? a : this) : this.Ql = this instanceof da ? this.type !== sj && null !== this.placeholder ? this.placeholder : this : this } return this.Ql.visible ? this.Ql : this });
  25651. D.defineProperty(F, { PJ: "minLocation" }, function() { return this.Ns }, function(a) {
  25652. var b = this.Ns;
  25653. b.O(a) || (v && D.l(a, N, F, "minLocation"), this.Ns = a = a.V(), this.i("minLocation", b, a))
  25654. });
  25655. D.defineProperty(F, { JJ: "maxLocation" }, function() { return this.Gs }, function(a) {
  25656. var b = this.Gs;
  25657. b.O(a) || (v && D.l(a, N, F, "maxLocation"), this.Gs = a = a.V(), this.i("maxLocation", b, a))
  25658. });
  25659. D.defineProperty(F, { uy: "locationObjectName" }, function() { return this.Es }, function(a) {
  25660. var b = this.Es;
  25661. b !== a && (v && D.h(a, "string", F, "locationObjectName"), this.Es = a, this.Ql = null, this.K(), this.i("locationObjectName", b, a))
  25662. });
  25663. D.defineProperty(F, { Of: "locationSpot" }, function() { return this.Fs }, function(a) {
  25664. var b = this.Fs;
  25665. b.O(a) || (v && (D.l(a, S, F, "locationSpot"), a.Xc() || D.k("Part.locationSpot must be a specific Spot value, not: " + a)), this.Fs = a = a.V(), this.K(), this.i("locationSpot", b, a))
  25666. });
  25667. F.prototype.move = function(a) { this.position = a };
  25668. F.prototype.moveTo = F.prototype.moveTo = function(a, b) {
  25669. var c = D.Fb(a, b);
  25670. this.move(c);
  25671. D.A(c)
  25672. };
  25673. F.prototype.isVisible = function() {
  25674. if (!this.visible) return !1;
  25675. var a = this.layer;
  25676. if (null !== a && !a.visible) return !1;
  25677. a = this.g;
  25678. if (null !== a && (a = a.Ra, a.nf && (a = a.jn.oa(this), null !== a && a.Hy))) return !0;
  25679. a = this.Ka;
  25680. return null === a || a.md && a.isVisible() ? !0 : !1
  25681. };
  25682. F.prototype.Pd = function(a) {
  25683. var b = this.g;
  25684. a ? (this.L(4), this.pe(), null !== b && b.Gg.add(this)) : (this.L(8), this.iu());
  25685. this.cl();
  25686. null !== b && (b.Qc(), b.ra())
  25687. };
  25688. F.prototype.findObject = F.prototype.Md = function(a) {
  25689. if (this.name === a) return this;
  25690. var b = this.Sl;
  25691. null === b && (this.Sl = b = new ma);
  25692. if (void 0 !== b[a]) return b[a];
  25693. for (var c = this.xa.o, d = c.length, e = 0; e < d; e++) {
  25694. var g = c[e];
  25695. if (g.name === a) return b[a] = g;
  25696. if (g instanceof x)
  25697. if (null === g.ej && null === g.Ig) { if (g = g.Md(a), null !== g) return b[a] = g } else if (vn(g) && (g = g.xa.first(), null !== g && g.name === a)) return b[a] = g
  25698. }
  25699. return b[a] = null
  25700. };
  25701. function lr(a, b, c, d) {
  25702. void 0 === d && (d = new N);
  25703. c = c.de() ? mc : c;
  25704. var e = b.Ga;
  25705. d.n(e.width * c.x + c.offsetX, e.height * c.y + c.offsetY);
  25706. if (null === b || b === a) return d;
  25707. b.transform.vb(d);
  25708. for (b = b.R; null !== b && b !== a;) b.transform.vb(d), b = b.R;
  25709. a.ij.vb(d);
  25710. d.offset(-a.Fd.x, -a.Fd.y);
  25711. return d
  25712. }
  25713. F.prototype.ensureBounds = F.prototype.kf = function() {
  25714. Hk(this, Infinity, Infinity);
  25715. this.rc()
  25716. };
  25717. function xl(a, b) {
  25718. var c = a.EH,
  25719. d;
  25720. isNaN(a.zk) && (a.zk = fq(a));
  25721. d = a.zk;
  25722. var e = 2 * d;
  25723. if (!a.dl) return c.n(b.x - 1 - d, b.y - 1 - d, b.width + 2 + e, b.height + 2 + e), c;
  25724. d = b.x;
  25725. var e = b.y,
  25726. g = b.width,
  25727. h = b.height,
  25728. k = a.shadowBlur,
  25729. l = a.tK,
  25730. g = g + k,
  25731. h = h + k;
  25732. d -= k / 2;
  25733. e -= k / 2;
  25734. 0 < l.x ? g += l.x : (d += l.x, g -= l.x);
  25735. 0 < l.y ? h += l.y : (e += l.y, h -= l.y);
  25736. c.n(d - 1, e - 1, g + 2, h + 2);
  25737. return c
  25738. }
  25739. F.prototype.rc = function() {
  25740. this.cj();
  25741. if (!1 === Om(this)) jr(this);
  25742. else {
  25743. var a = this.bc,
  25744. b = D.Sf();
  25745. b.assign(a);
  25746. a.Xa();
  25747. var c = tl(this);
  25748. this.Cj(0, 0, this.Fd.width, this.Fd.height);
  25749. var d = this.position;
  25750. kr(this, d, this.location);
  25751. a.x = d.x;
  25752. a.y = d.y;
  25753. a.freeze();
  25754. this.zy(b, a);
  25755. No(this, !1);
  25756. b.O(a) ? this.Pf(c) : !this.qe() || Q(b.width, a.width) && Q(b.height, a.height) || 0 <= this.QD && this.L(16);
  25757. D.Lb(b);
  25758. ir(this, !1)
  25759. }
  25760. };
  25761. F.prototype.zy = function(a, b) {
  25762. var c = this.g;
  25763. if (null !== c) {
  25764. var d = !1;
  25765. if (!1 === c.rk && a.H()) {
  25766. var e = c.kd,
  25767. g = c.padding,
  25768. h = e.x + g.left,
  25769. k = e.y + g.top,
  25770. l = e.width - 2 * g.right,
  25771. e = e.height - 2 * g.bottom;
  25772. a.x > h && a.y > k && a.right < l && a.bottom < e && b.x > h && b.y > k && b.right < l && b.bottom < e && (d = !0)
  25773. }
  25774. 0 !== (this.T & 65536) !== !0 && a.O(b) || $m(this, d, c);
  25775. c.ra();
  25776. Db(a, b) || (this instanceof G && !c.na.ub && this.kg(), this.cl())
  25777. }
  25778. };
  25779. D.defineProperty(F, { location: "location" }, function() { return this.jj }, function(a) {
  25780. v && D.l(a, N, F, "location");
  25781. var b = a.x,
  25782. c = a.y,
  25783. d = this.jj,
  25784. e = d.x,
  25785. g = d.y;
  25786. (e === b || isNaN(e) && isNaN(b)) && (g === c || isNaN(g) && isNaN(c)) || (a = a.V(), b = a, this instanceof J ? b = !1 : (this.jj = b, this.T |= 2097152, !1 === Om(this) && (hr(this), c = this.sb, c.H() && (e = c.copy(), c.n(c.x + (b.x - d.x), c.y + (b.y - d.y)), mr(this, this.g, c, e), this.i("position", e, c))), b = !0), b && this.i("location", d, a))
  25787. });
  25788. f = F.prototype;
  25789. f.bC = function(a, b) {
  25790. if (this instanceof J || !a.H()) return !1;
  25791. var c = this.g;
  25792. if (null !== c && (mr(this, c, a, b), !0 === c.na.ub)) return !0;
  25793. this.sb = a;
  25794. this.T &= -2097153;
  25795. c = this.jj;
  25796. if (c.H()) {
  25797. var d = c.copy();
  25798. c.n(c.x + (a.x - b.x), c.y + (a.y - b.y));
  25799. this.i("location", d, c)
  25800. }!1 === Pm(this) && !1 === Om(this) && (hr(this), jr(this));
  25801. return !0
  25802. };
  25803. function mr(a, b, c, d) { null === b || a instanceof da || (b = b.Ra, b.zc && hl(b, a, "position", d.copy(), c.copy(), !1)) }
  25804. f.Uy = function(a, b) {
  25805. var c = this.jj,
  25806. d = this.sb;
  25807. Pm(this) || Om(this) ? c.n(NaN, NaN) : c.n(c.x + a - d.x, c.y + b - d.y);
  25808. d.n(a, b);
  25809. hr(this)
  25810. };
  25811. f.cC = function() {
  25812. this.T &= -2097153;
  25813. hr(this)
  25814. };
  25815. function kr(a, b, c) {
  25816. var d = D.P(),
  25817. e = a.Of,
  25818. g = a.Bf;
  25819. e.de() && D.k("determineOffset: Part's locationSpot must be real: " + e.toString());
  25820. var h = g.Ga,
  25821. k = g instanceof z ? g.lb : 0;
  25822. d.pv(0, 0, h.width + k, h.height + k, e);
  25823. if (g !== a)
  25824. for (d.offset(-k / 2, -k / 2), g.transform.vb(d), e = g.R; null !== e && e !== a;) e.transform.vb(d), e = e.R;
  25825. a.ij.vb(d);
  25826. d.offset(-a.Fd.x, -a.Fd.y);
  25827. e = a.g;
  25828. g = c.H();
  25829. h = b.H();
  25830. g && h ? 0 !== (a.T & 2097152) ? nr(a, b, c, e, d) : or(a, b, c, e, d) : g ? nr(a, b, c, e, d) : h && or(a, b, c, e, d);
  25831. a.T |= 2097152;
  25832. D.A(d);
  25833. a.cj()
  25834. }
  25835. function nr(a, b, c, d, e) {
  25836. var g = b.x,
  25837. h = b.y;
  25838. b.n(c.x - e.x, c.y - e.y);
  25839. null !== d && (c = d.Ra, (e = c.sk) || !c.zc || a instanceof da || hl(c, a, "position", new N(g, h), b, !1), e || b.x === g && b.y === h || (c = d.kb, d.kb = !0, a.i("position", new N(g, h), b), d.kb = c))
  25840. }
  25841. function or(a, b, c, d, e) {
  25842. var g = c.copy();
  25843. c.n(b.x + e.x, b.y + e.y);
  25844. c.O(g) || null === d || (b = d.kb, d.kb = !0, a.i("location", g, c), d.kb = b)
  25845. }
  25846. function $m(a, b, c) {
  25847. Po(a, !1);
  25848. a instanceof G && c.oB(a);
  25849. a.layer.Yc || b || c.Qc();
  25850. b = a.bc;
  25851. var d = c.wb;
  25852. d.H() ? (tl(a) ? Ob(b, d) || a.Pf(!1) : b.jg(d) && a.Pf(!0), a.updateAdornments()) : c.Jl = !0
  25853. }
  25854. f.ym = function() { return !0 };
  25855. function vl(a, b) {
  25856. var c = a.bc;
  25857. if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y) && a.isVisible()) {
  25858. var d = a.transform;
  25859. null !== a.lc && (Vo(a, b, a.lc, !0, !0), b.fillRect(c.x, c.y, c.width, c.height));
  25860. null === a.lc && null === a.Mb && (Vo(a, b, "rgba(0,0,0,0.4)", !0, !1), b.fillRect(c.x, c.y, c.width, c.height));
  25861. null !== a.Mb && (d.Nu() || b.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), c = a.Ga, Vo(a, b, a.Mb, !0, !1), b.fillRect(0, 0, c.width, c.height), d.Nu() || (c = 1 / (d.m11 * d.m22 - d.m12 * d.m21), b.transform(d.m22 * c, -d.m12 * c, -d.m21 * c, d.m11 * c, c * (d.m21 *
  25862. d.dy - d.m22 * d.dx), c * (d.m12 * d.dx - d.m11 * d.dy))))
  25863. }
  25864. }
  25865. f.qe = function() { return !0 };
  25866. f.Oj = function() { return !0 };
  25867. D.defineProperty(F, { Kd: "category" }, function() { return this.Pi }, function(a) {
  25868. var b = this.Pi;
  25869. if (b !== a) {
  25870. D.h(a, "string", F, "category");
  25871. var c = this.g,
  25872. d = this.data,
  25873. e = null;
  25874. if (null !== c && null !== d && !(this instanceof da)) {
  25875. var g = c.ea.na;
  25876. g.isEnabled && !g.ub && (e = this.clone(), e.xa.Vc(this.xa))
  25877. }
  25878. this.Pi = a;
  25879. this.i("category", b, a);
  25880. null === c || null === d || this instanceof da ? (e = this.If, null !== e && (a = e.lh, null !== a && a.remove(b), e.cm(this.Kd, this))) : (g = c.ea, g.na.ub || (this instanceof J ? (g instanceof Y ? g.bH(d, a) : g instanceof Bg && g.rK(d,
  25881. a), c = rj(c, a), null !== c && (Sh(c), c = c.copy(), null !== c && pr(this, c, b, a))) : (null !== g && g.Ry(d, a), c = Cn(c, d, a), null !== c && (Sh(c), c = c.copy(), null === c || c instanceof J || (c.location = this.location, pr(this, c, b, a)))), null !== e && (b = this.clone(), b.xa.Vc(this.xa), this.i("self", e, b))))
  25882. }
  25883. });
  25884. D.defineProperty(F, { self: "self" }, function() { return this }, function(a) { pr(this, a, this.Kd, a.Kd) });
  25885. var qr = !1;
  25886. function pr(a, b, c, d) {
  25887. b.constructor === a.constructor || qr || (qr = !0, D.trace('Should not change the class of the Part when changing category from "' + c + '" to "' + d + '"'), D.trace(" Old class: " + D.wf(a) + ", new class: " + D.wf(b) + ", part: " + a.toString()));
  25888. a.iu();
  25889. var e = a.data;
  25890. c = a.Nf;
  25891. var g = a.ib,
  25892. h = a.Zg,
  25893. k = !0,
  25894. l = !0,
  25895. m = !1;
  25896. if (a instanceof G) var n = a,
  25897. k = n.Rj,
  25898. l = n.Dc,
  25899. m = n.br;
  25900. b.Ei(a);
  25901. b.cloneProtected(a);
  25902. a.Pi = d;
  25903. a.K();
  25904. a.ra();
  25905. b = a.g;
  25906. d = !0;
  25907. null !== b && (d = b.kb, b.kb = !0);
  25908. a.Sd = e;
  25909. null !== e && a.Ob();
  25910. null !== b && (b.kb = d);
  25911. e = a.Nf;
  25912. e !== c && (a.Nl = c,
  25913. a.Nf = e);
  25914. a instanceof G && (n = a, n.Rj = k, n.Dc = l, n.br = m, n.qe() && n.L(64));
  25915. a.ib = g;
  25916. a.Zg = h
  25917. }
  25918. F.prototype.canCopy = function() {
  25919. if (!this.nF) return !1;
  25920. var a = this.layer;
  25921. if (null === a) return !0;
  25922. if (!a.Pk) return !1;
  25923. a = a.g;
  25924. return null === a ? !0 : a.Pk ? !0 : !1
  25925. };
  25926. F.prototype.canDelete = function() {
  25927. if (!this.rF) return !1;
  25928. var a = this.layer;
  25929. if (null === a) return !0;
  25930. if (!a.Cn) return !1;
  25931. a = a.g;
  25932. return null === a ? !0 : a.Cn ? !0 : !1
  25933. };
  25934. F.prototype.canEdit = function() {
  25935. if (!this.kH) return !1;
  25936. var a = this.layer;
  25937. if (null === a) return !0;
  25938. if (!a.Dx) return !1;
  25939. a = a.g;
  25940. return null === a ? !0 : a.Dx ? !0 : !1
  25941. };
  25942. F.prototype.canGroup = function() {
  25943. if (!this.YF) return !1;
  25944. var a = this.layer;
  25945. if (null === a) return !0;
  25946. if (!a.Ax) return !1;
  25947. a = a.g;
  25948. return null === a ? !0 : a.Ax ? !0 : !1
  25949. };
  25950. F.prototype.canMove = function() {
  25951. if (!this.zG) return !1;
  25952. var a = this.layer;
  25953. if (null === a) return !0;
  25954. if (!a.fm) return !1;
  25955. a = a.g;
  25956. return null === a ? !0 : a.fm ? !0 : !1
  25957. };
  25958. F.prototype.canReshape = function() {
  25959. if (!this.OG) return !1;
  25960. var a = this.layer;
  25961. if (null === a) return !0;
  25962. if (!a.Bx) return !1;
  25963. a = a.g;
  25964. return null === a ? !0 : a.Bx ? !0 : !1
  25965. };
  25966. F.prototype.canResize = function() {
  25967. if (!this.PG) return !1;
  25968. var a = this.layer;
  25969. if (null === a) return !0;
  25970. if (!a.fu) return !1;
  25971. a = a.g;
  25972. return null === a ? !0 : a.fu ? !0 : !1
  25973. };
  25974. F.prototype.canRotate = function() {
  25975. if (!this.UG) return !1;
  25976. var a = this.layer;
  25977. if (null === a) return !0;
  25978. if (!a.Cx) return !1;
  25979. a = a.g;
  25980. return null === a ? !0 : a.Cx ? !0 : !1
  25981. };
  25982. F.prototype.canSelect = function() {
  25983. if (!this.il) return !1;
  25984. var a = this.layer;
  25985. if (null === a) return !0;
  25986. if (!a.Jf) return !1;
  25987. a = a.g;
  25988. return null === a ? !0 : a.Jf ? !0 : !1
  25989. };
  25990. D.defineProperty(F, { nF: "copyable" }, function() { return 0 !== (this.T & 1) }, function(a) {
  25991. var b = 0 !== (this.T & 1);
  25992. b !== a && (v && D.h(a, "boolean", F, "copyable"), this.T ^= 1, this.i("copyable", b, a))
  25993. });
  25994. D.defineProperty(F, { rF: "deletable" }, function() { return 0 !== (this.T & 2) }, function(a) {
  25995. var b = 0 !== (this.T & 2);
  25996. b !== a && (v && D.h(a, "boolean", F, "deletable"), this.T ^= 2, this.i("deletable", b, a))
  25997. });
  25998. D.defineProperty(F, { kH: "textEditable" }, function() { return 0 !== (this.T & 4) }, function(a) {
  25999. var b = 0 !== (this.T & 4);
  26000. b !== a && (v && D.h(a, "boolean", F, "textEditable"), this.T ^= 4, this.i("textEditable", b, a), this.pe())
  26001. });
  26002. D.defineProperty(F, { YF: "groupable" }, function() { return 0 !== (this.T & 8) }, function(a) {
  26003. var b = 0 !== (this.T & 8);
  26004. b !== a && (v && D.h(a, "boolean", F, "groupable"), this.T ^= 8, this.i("groupable", b, a))
  26005. });
  26006. D.defineProperty(F, { zG: "movable" }, function() { return 0 !== (this.T & 16) }, function(a) {
  26007. var b = 0 !== (this.T & 16);
  26008. b !== a && (v && D.h(a, "boolean", F, "movable"), this.T ^= 16, this.i("movable", b, a))
  26009. });
  26010. D.defineProperty(F, { $G: "selectionAdorned" }, function() { return 0 !== (this.T & 32) }, function(a) {
  26011. var b = 0 !== (this.T & 32);
  26012. b !== a && (v && D.h(a, "boolean", F, "selectionAdorned"), this.T ^= 32, this.i("selectionAdorned", b, a), this.pe())
  26013. });
  26014. D.defineProperty(F, { hy: "isInDocumentBounds" }, function() { return 0 !== (this.T & 64) }, function(a) {
  26015. var b = 0 !== (this.T & 64);
  26016. if (b !== a) {
  26017. v && D.h(a, "boolean", F, "isInDocumentBounds");
  26018. this.T ^= 64;
  26019. var c = this.g;
  26020. null !== c && c.Qc();
  26021. this.i("isInDocumentBounds", b, a)
  26022. }
  26023. });
  26024. D.defineProperty(F, { tB: "isLayoutPositioned" }, function() { return 0 !== (this.T & 128) }, function(a) {
  26025. var b = 0 !== (this.T & 128);
  26026. b !== a && (v && D.h(a, "boolean", F, "isLayoutPositioned"), this.T ^= 128, this.i("isLayoutPositioned", b, a), this.L(a ? 4 : 8))
  26027. });
  26028. D.defineProperty(F, { il: "selectable" }, function() { return 0 !== (this.T & 256) }, function(a) {
  26029. var b = 0 !== (this.T & 256);
  26030. b !== a && (v && D.h(a, "boolean", F, "selectable"), this.T ^= 256, this.i("selectable", b, a), this.pe())
  26031. });
  26032. D.defineProperty(F, { OG: "reshapable" }, function() { return 0 !== (this.T & 512) }, function(a) {
  26033. var b = 0 !== (this.T & 512);
  26034. b !== a && (v && D.h(a, "boolean", F, "reshapable"), this.T ^= 512, this.i("reshapable", b, a), this.pe())
  26035. });
  26036. D.defineProperty(F, { PG: "resizable" }, function() { return 0 !== (this.T & 1024) }, function(a) {
  26037. var b = 0 !== (this.T & 1024);
  26038. b !== a && (v && D.h(a, "boolean", F, "resizable"), this.T ^= 1024, this.i("resizable", b, a), this.pe())
  26039. });
  26040. D.defineProperty(F, { UG: "rotatable" }, function() { return 0 !== (this.T & 2048) }, function(a) {
  26041. var b = 0 !== (this.T & 2048);
  26042. b !== a && (v && D.h(a, "boolean", F, "rotatable"), this.T ^= 2048, this.i("rotatable", b, a), this.pe())
  26043. });
  26044. D.defineProperty(F, { ib: "isSelected" }, function() { return 0 !== (this.T & 4096) }, function(a) {
  26045. var b = 0 !== (this.T & 4096);
  26046. if (b !== a) {
  26047. v && D.h(a, "boolean", F, "isSelected");
  26048. var c = this.g;
  26049. if (!a || this.canSelect() && !(null !== c && c.selection.count >= c.KJ)) {
  26050. this.T ^= 4096;
  26051. var d = !1;
  26052. if (null !== c) {
  26053. d = c.kb;
  26054. c.kb = !0;
  26055. var e = c.selection;
  26056. e.Xa();
  26057. a ? e.add(this) : e.remove(this);
  26058. e.freeze()
  26059. }
  26060. this.i("isSelected", b, a);
  26061. this.pe();
  26062. a = this.qK;
  26063. null !== a && a(this);
  26064. null !== c && (c.Ve(), c.kb = d)
  26065. }
  26066. }
  26067. });
  26068. D.defineProperty(F, { Zg: "isHighlighted" }, function() { return 0 !== (this.T & 524288) }, function(a) {
  26069. var b = 0 !== (this.T & 524288);
  26070. if (b !== a) {
  26071. v && D.h(a, "boolean", F, "isHighlighted");
  26072. this.T ^= 524288;
  26073. var c = this.g;
  26074. null !== c && (c = c.vm, c.Xa(), a ? c.add(this) : c.remove(this), c.freeze());
  26075. this.i("isHighlighted", b, a);
  26076. this.ra();
  26077. a = this.eJ;
  26078. null !== a && a(this)
  26079. }
  26080. });
  26081. D.defineProperty(F, { dl: "isShadowed" }, function() { return 0 !== (this.T & 8192) }, function(a) {
  26082. var b = 0 !== (this.T & 8192);
  26083. b !== a && (v && D.h(a, "boolean", F, "isShadowed"), this.T ^= 8192, this.i("isShadowed", b, a), this.ra())
  26084. });
  26085. function Pm(a) { return 0 !== (a.T & 32768) }
  26086. function ir(a, b) { a.T = b ? a.T | 32768 : a.T & -32769 }
  26087. function Po(a, b) { a.T = b ? a.T | 65536 : a.T & -65537 }
  26088. function tl(a) { return 0 !== (a.T & 131072) }
  26089. F.prototype.Pf = function(a) { this.T = a ? this.T | 131072 : this.T & -131073 };
  26090. function rr(a, b) { a.T = b ? a.T | 1048576 : a.T & -1048577 }
  26091. D.defineProperty(F, { eG: "isAnimated" }, function() { return 0 !== (this.T & 262144) }, function(a) {
  26092. var b = 0 !== (this.T & 262144);
  26093. b !== a && (v && D.h(a, "boolean", F, "isAnimated"), this.T ^= 262144, this.i("isAnimated", b, a))
  26094. });
  26095. D.defineProperty(F, { eJ: "highlightedChanged" }, function() { return this.ls }, function(a) {
  26096. var b = this.ls;
  26097. b !== a && (null !== a && D.h(a, "function", F, "highlightedChanged"), this.ls = a, this.i("highlightedChanged", b, a))
  26098. });
  26099. D.defineProperty(F, { Py: "selectionObjectName" }, function() { return this.Ct }, function(a) {
  26100. var b = this.Ct;
  26101. b !== a && (v && D.h(a, "string", F, "selectionObjectName"), this.Ct = a, this.tn = null, this.i("selectionObjectName", b, a))
  26102. });
  26103. D.defineProperty(F, { pK: "selectionAdornmentTemplate" }, function() { return this.At }, function(a) {
  26104. var b = this.At;
  26105. b !== a && (v && D.l(a, da, F, "selectionAdornmentTemplate"), this instanceof J && (a.type = sj), this.At = a, this.i("selectionAdornmentTemplate", b, a))
  26106. });
  26107. D.w(F, { to: "selectionObject" }, function() {
  26108. if (null === this.tn) {
  26109. var a = this.Py;
  26110. null !== a && "" !== a ? (a = this.Md(a), this.tn = null !== a ? a : this) : this instanceof J ? (a = this.path, this.tn = null !== a ? a : this) : this.tn = this
  26111. }
  26112. return this.tn
  26113. });
  26114. D.defineProperty(F, { qK: "selectionChanged" }, function() { return this.Bt }, function(a) {
  26115. var b = this.Bt;
  26116. b !== a && (null !== a && D.h(a, "function", F, "selectionChanged"), this.Bt = a, this.i("selectionChanged", b, a))
  26117. });
  26118. D.defineProperty(F, { QG: "resizeAdornmentTemplate" }, function() { return this.ot }, function(a) {
  26119. var b = this.ot;
  26120. b !== a && (v && D.l(a, da, F, "resizeAdornmentTemplate"), this.ot = a, this.i("resizeAdornmentTemplate", b, a))
  26121. });
  26122. D.defineProperty(F, { SG: "resizeObjectName" }, function() { return this.qt }, function(a) {
  26123. var b = this.qt;
  26124. b !== a && (v && D.h(a, "string", F, "resizeObjectName"), this.qt = a, this.Fp = null, this.i("resizeObjectName", b, a))
  26125. });
  26126. D.w(F, { RG: "resizeObject" }, function() {
  26127. if (null === this.Fp) {
  26128. var a = this.SG;
  26129. null !== a && "" !== a ? (a = this.Md(a), this.Fp = null !== a ? a : this) : this.Fp = this
  26130. }
  26131. return this.Fp
  26132. });
  26133. D.defineProperty(F, { gK: "resizeCellSize" }, function() { return this.pt }, function(a) {
  26134. var b = this.pt;
  26135. b.O(a) || (v && D.l(a, Ca, F, "resizeCellSize"), this.pt = a = a.V(), this.i("resizeCellSize", b, a))
  26136. });
  26137. D.defineProperty(F, { iK: "rotateAdornmentTemplate" }, function() { return this.rt }, function(a) {
  26138. var b = this.rt;
  26139. b !== a && (v && D.l(a, da, F, "rotateAdornmentTemplate"), this.rt = a, this.i("rotateAdornmentTemplate", b, a))
  26140. });
  26141. D.defineProperty(F, { jK: "rotateObjectName" }, function() { return this.st }, function(a) {
  26142. var b = this.st;
  26143. b !== a && (v && D.h(a, "string", F, "rotateObjectName"), this.st = a, this.Gp = null, this.i("rotateObjectName", b, a))
  26144. });
  26145. D.w(F, { TB: "rotateObject" }, function() {
  26146. if (null === this.Gp) {
  26147. var a = this.jK;
  26148. null !== a && "" !== a ? (a = this.Md(a), this.Gp = null !== a ? a : this) : this.Gp = this
  26149. }
  26150. return this.Gp
  26151. });
  26152. D.defineProperty(F, { text: "text" }, function() { return this.Yd }, function(a) {
  26153. var b = this.Yd;
  26154. b !== a && (v && D.h(a, "string", F, "text"), this.Yd = a, this.i("text", b, a))
  26155. });
  26156. D.defineProperty(F, { Ka: "containingGroup" }, function() { return this.Al }, function(a) {
  26157. if (this.qe()) {
  26158. var b = this.Al;
  26159. if (b !== a) {
  26160. v && null !== a && D.l(a, I, F, "containingGroup");
  26161. null === a || this !== a && !a.Fi(this) || (this === a && D.k("Cannot make a Group a member of itself: " + this.toString()), D.k("Cannot make a Group indirectly contain itself: " + this.toString() + " already contains " + a.toString()));
  26162. this.L(en);
  26163. var c = this.g;
  26164. null !== b ? sr(b, this) : this instanceof I && null !== c && c.$l.remove(this);
  26165. this.Al = a;
  26166. null !== a ? tr(a, this) : this instanceof
  26167. I && null !== c && c.$l.add(this);
  26168. this.L(Wm);
  26169. if (null !== c) {
  26170. var d = this.data,
  26171. e = c.ea;
  26172. null !== d && e instanceof Y && e.$B(d, e.zb(null !== a ? a.data : null))
  26173. }
  26174. d = this.kF;
  26175. null !== d && (e = !0, null !== c && (e = c.$a, c.$a = !0), d(this, b, a), null !== c && (c.$a = e));
  26176. if (this instanceof I)
  26177. for (c = new L(F), Qh(c, this, !0, 0, !0), c = c.j; c.next();)
  26178. if (d = c.value, d instanceof G)
  26179. for (d = d.Od; d.next();) An(d.value);
  26180. if (this instanceof G) {
  26181. for (d = this.Od; d.next();) An(d.value);
  26182. c = this.Xb;
  26183. null !== c && An(c)
  26184. }
  26185. this.i("containingGroup", b, a);
  26186. null !== a && (b = a.layer, null !== b && yl(b, -1, a))
  26187. }
  26188. } else D.k("cannot set the Part.containingGroup of a Link or Adornment")
  26189. });
  26190. f = F.prototype;
  26191. f.cl = function() {
  26192. var a = this.Ka;
  26193. null !== a && (a.K(), null !== a.Rb && a.Rb.K(), a.kg())
  26194. };
  26195. f.ra = function() {
  26196. var a = this.g;
  26197. null !== a && !Om(this) && !Pm(this) && this.isVisible() && this.bc.H() && a.ra(xl(this, this.bc))
  26198. };
  26199. f.K = function() {
  26200. x.prototype.K.call(this);
  26201. var a = this.g;
  26202. null !== a && (a.Gg.add(this), this instanceof G && null !== this.Xb && Zo(this.Xb), a.Ve(!0))
  26203. };
  26204. f.Fu = function(a) { a || (a = this.Al, null !== a && tr(a, this)) };
  26205. f.Gu = function(a) { a || (a = this.Al, null !== a && sr(a, this)) };
  26206. f.Nn = function() {
  26207. var a = this.data;
  26208. if (null !== a) {
  26209. var b = this.g;
  26210. null !== b && (b = b.ea, null !== b && b.Ky(a))
  26211. }
  26212. };
  26213. D.defineProperty(F, { kF: "containingGroupChanged" }, function() { return this.xr }, function(a) {
  26214. var b = this.xr;
  26215. b !== a && (null !== a && D.h(a, "function", F, "containingGroupChanged"), this.xr = a, this.i("containingGroupChanged", b, a))
  26216. });
  26217. F.prototype.findSubGraphLevel = function() { return ur(this, this) };
  26218. function ur(a, b) { var c = b.Ka; return null !== c ? 1 + ur(a, c) : b instanceof G && (c = b.Xb, null !== c) ? ur(a, c) : 0 }
  26219. F.prototype.findTopLevelPart = function() { return vr(this, this) };
  26220. function vr(a, b) { var c = b.Ka; return null !== c ? vr(a, c) : b instanceof G && (c = b.Xb, null !== c) ? vr(a, c) : b }
  26221. D.w(F, { Bq: "isTopLevel" }, function() { return null !== this.Ka || this instanceof G && null !== this.Xb ? !1 : !0 });
  26222. F.prototype.isMemberOf = F.prototype.Fi = function(a) { return a instanceof I ? wr(this, this, a) : !1 };
  26223. function wr(a, b, c) { if (b === c || null === c) return !1; var d = b.Ka; return null === d || d !== c && !wr(a, d, c) ? b instanceof G && (b = b.Xb, null !== b) ? wr(a, b, c) : !1 : !0 }
  26224. F.prototype.findCommonContainingGroup = F.prototype.LI = function(a) {
  26225. if (null === a) return null;
  26226. v && D.l(a, F, F, "findCommonContainingGroup:other");
  26227. if (this === a) return this.Ka;
  26228. for (var b = this; null !== b;) {
  26229. b instanceof I && rr(b, !0);
  26230. if (b instanceof G) {
  26231. var c = b.Xb;
  26232. null !== c && (b = c)
  26233. }
  26234. b = b.Ka
  26235. }
  26236. for (var d = null, b = a; null !== b;) {
  26237. if (0 !== (b.T & 1048576)) { d = b; break }
  26238. b instanceof G && (c = b.Xb, null !== c && (b = c));
  26239. b = b.Ka
  26240. }
  26241. for (b = this; null !== b;) b instanceof I && rr(b, !1), b instanceof G && (c = b.Xb, null !== c && (b = c)), b = b.Ka;
  26242. return d
  26243. };
  26244. D.defineProperty(F, { AJ: "layoutConditions" }, function() { return this.As }, function(a) {
  26245. var b = this.As;
  26246. b !== a && (v && D.h(a, "number", F, "layoutConditions"), this.As = a, this.i("layoutConditions", b, a))
  26247. });
  26248. F.prototype.canLayout = function() { if (!this.tB || !this.isVisible()) return !1; var a = this.layer; return null !== a && a.Yc || this instanceof G && this.Lf ? !1 : !0 };
  26249. F.prototype.invalidateLayout = F.prototype.L = function(a) {
  26250. void 0 === a && (a = 16777215);
  26251. var b;
  26252. this.tB && 0 !== (a & this.AJ) ? (b = this.layer, null !== b && b.Yc || this instanceof G && this.Lf ? b = !1 : (b = this.g, b = null !== b && b.na.ub ? !1 : !0)) : b = !1;
  26253. if (b)
  26254. if (b = this.Al, null !== b) {
  26255. var c = b.Yb;
  26256. null !== c ? c.L() : b.L(a)
  26257. } else a = this.g, null !== a && (c = a.Yb, null !== c && c.L())
  26258. };
  26259. function an(a) {
  26260. if (!a.isVisible()) return !1;
  26261. a = a.layer;
  26262. return null !== a && a.Yc ? !1 : !0
  26263. }
  26264. D.defineProperty(F, { wF: "dragComputation" }, function() { return this.Tr }, function(a) {
  26265. var b = this.Tr;
  26266. b !== a && (null !== a && D.h(a, "function", F, "dragComputation"), this.Tr = a, this.i("dragComputation", b, a))
  26267. });
  26268. D.defineProperty(F, { tK: "shadowOffset" }, function() { return this.vn }, function(a) {
  26269. var b = this.vn;
  26270. b.O(a) || (v && D.l(a, N, F, "shadowOffset"), this.vn = a = a.V(), this.ra(), this.i("shadowOffset", b, a))
  26271. });
  26272. D.defineProperty(F, { shadowColor: "shadowColor" }, function() { return this.un }, function(a) {
  26273. var b = this.un;
  26274. b !== a && (v && D.h(a, "string", F, "shadowColor"), this.un = a, this.ra(), this.i("shadowColor", b, a))
  26275. });
  26276. D.defineProperty(F, { shadowBlur: "shadowBlur" }, function() { return this.Pg }, function(a) {
  26277. var b = this.Pg;
  26278. b !== a && (v && D.h(a, "number", F, "shadowBlur"), this.Pg = a, this.ra(), this.i("shadowBlur", b, a))
  26279. });
  26280. function da(a) {
  26281. 0 === arguments.length ? F.call(this, ek) : F.call(this, a);
  26282. this.T &= -257;
  26283. this.Nl = "Adornment";
  26284. this.Tc = null;
  26285. this.$D = 0;
  26286. this.OE = !1;
  26287. this.Rb = this.oh = null
  26288. }
  26289. D.Ta(da, F);
  26290. D.ka("Adornment", da);
  26291. da.prototype.toString = function() { var a = this.If; return "Adornment(" + this.Kd + ")" + (null !== a ? a.toString() : "") };
  26292. da.prototype.updateRelationshipsFromData = function() {};
  26293. da.prototype.Wu = function(a) {
  26294. var b = this.Bb.Y,
  26295. c = this.Bb;
  26296. if (b instanceof J && c instanceof z) {
  26297. var d = b.path,
  26298. c = d.vf;
  26299. b.Wu(a);
  26300. c = d.vf;
  26301. a = this.xa.o;
  26302. b = a.length;
  26303. for (d = 0; d < b; d++) {
  26304. var e = a[d];
  26305. e.Ue && e instanceof z && (e.ab = c)
  26306. }
  26307. }
  26308. };
  26309. D.w(da, { placeholder: "placeholder" }, function() { return this.Rb });
  26310. D.defineProperty(da, { Bb: "adornedObject" }, function() { return this.Tc }, function(a) {
  26311. v && null !== a && D.l(a, O, F, "adornedObject:value");
  26312. var b = this.If,
  26313. c = null;
  26314. null !== a && (c = a.Y);
  26315. null === b || null !== a && b === c || b.Xj(this.Kd);
  26316. this.Tc = a;
  26317. null !== c && c.cm(this.Kd, this)
  26318. });
  26319. D.w(da, { If: "adornedPart" }, function() { var a = this.Tc; return null !== a ? a.Y : null });
  26320. da.prototype.ym = function() {
  26321. var a = this.Tc;
  26322. if (null === a) return !0;
  26323. a = a.Y;
  26324. return null === a || !Om(a)
  26325. };
  26326. da.prototype.qe = function() { return !1 };
  26327. D.w(da, { Ka: "containingGroup" }, function() { return null });
  26328. da.prototype.qo = function(a, b, c, d, e, g, h) {
  26329. if (a === hg && "elements" === b)
  26330. if (e instanceof Yj) {
  26331. var k = e;
  26332. null === this.Rb ? this.Rb = k : this.Rb !== k && D.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")
  26333. } else e instanceof x && (k = e.qu(function(a) { return a instanceof Yj }), k instanceof Yj && (null === this.Rb ? this.Rb = k : this.Rb !== k && D.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")));
  26334. else a === ig && "elements" === b && null !== this.Rb && (d === this.Rb ? this.Rb = null : d instanceof x &&
  26335. this.Rb.xm(d) && (this.Rb = null));
  26336. F.prototype.qo.call(this, a, b, c, d, e, g, h)
  26337. };
  26338. da.prototype.updateAdornments = function() {};
  26339. da.prototype.Nn = function() {};
  26340. function G(a) {
  26341. F.call(this, a);
  26342. this.Ca = 13;
  26343. this.yc = new K(J);
  26344. this.Vt = this.pp = this.Pl = this.Cs = this.Bs = null;
  26345. this.qr = Td;
  26346. this.Ae = this.ai = null;
  26347. this.kt = xr;
  26348. this.Nk = !1
  26349. }
  26350. D.Ta(G, F);
  26351. D.ka("Node", G);
  26352. G.prototype.cloneProtected = function(a) {
  26353. F.prototype.cloneProtected.call(this, a);
  26354. a.Ca = this.Ca;
  26355. a.Ca = this.Ca & -17;
  26356. a.Bs = this.Bs;
  26357. a.Cs = this.Cs;
  26358. a.Pl = this.Pl;
  26359. a.Vt = this.Vt;
  26360. a.qr = this.qr.V();
  26361. a.kt = this.kt
  26362. };
  26363. G.prototype.Ei = function(a) {
  26364. F.prototype.Ei.call(this, a);
  26365. a.kg();
  26366. a.ai = this.ai;
  26367. a.Ae = null
  26368. };
  26369. var yr;
  26370. G.DirectionDefault = yr = D.s(G, "DirectionDefault", 0);
  26371. G.DirectionAbsolute = D.s(G, "DirectionAbsolute", 1);
  26372. var zr;
  26373. G.DirectionRotatedNode = zr = D.s(G, "DirectionRotatedNode", 2);
  26374. var Fo;
  26375. G.DirectionRotatedNodeOrthogonal = Fo = D.s(G, "DirectionRotatedNodeOrthogonal", 3);
  26376. G.SpreadingNone = D.s(G, "SpreadingNone", 10);
  26377. var xr;
  26378. G.SpreadingEvenly = xr = D.s(G, "SpreadingEvenly", 11);
  26379. var Ar;
  26380. G.SpreadingPacked = Ar = D.s(G, "SpreadingPacked", 12);
  26381. function Br(a, b) { null !== b && (null === a.ai && (a.ai = new L(Il)), a.ai.add(b)) }
  26382. function Cr(a, b, c, d) { if (null === b || null === a.ai) return null; for (var e = a.ai.j; e.next();) { var g = e.value; if (g.Hq === a && g.av === b && g.Cy === c && g.Dy === d || g.Hq === b && g.av === a && g.Cy === d && g.Dy === c) return g } return null }
  26383. G.prototype.invalidateLinkBundle = function(a, b, c) {
  26384. if (void 0 === b || null === b) b = "";
  26385. if (void 0 === c || null === c) c = "";
  26386. a = Cr(this, a, b, c);
  26387. null !== a && a.wq()
  26388. };
  26389. G.prototype.qo = function(a, b, c, d, e, g, h) {
  26390. a === hg && "elements" === b ? this.Ae = null : a === ig && "elements" === b && (this.Ae = null);
  26391. F.prototype.qo.call(this, a, b, c, d, e, g, h)
  26392. };
  26393. G.prototype.invalidateConnectedLinks = G.prototype.kg = function(a) {
  26394. void 0 === a && (a = null);
  26395. for (var b = this.Od; b.next();) {
  26396. var c = b.value;
  26397. null !== a && a.contains(c) || (Dr(this, c.oc), Dr(this, c.Gc), c.ec())
  26398. }
  26399. };
  26400. function Qo(a, b) { for (var c = a.Od; c.next();) { var d = c.value; if (d.oc === b || d.Gc === b) Dr(a, d.oc), Dr(a, d.Gc), d.ec() } }
  26401. function Dr(a, b) {
  26402. if (null !== b) {
  26403. var c = b.jt;
  26404. null !== c && c.wq();
  26405. c = a.Ka;
  26406. null === c || c.md || Dr(c, c.port)
  26407. }
  26408. }
  26409. G.prototype.ym = function() { return !0 };
  26410. D.defineProperty(G, { $J: "portSpreading" }, function() { return this.kt }, function(a) {
  26411. var b = this.kt;
  26412. b !== a && (v && D.Da(a, G, G, "portSpreading"), this.kt = a, this.i("portSpreading", b, a), a = this.g, null !== a && a.na.ub || this.kg())
  26413. });
  26414. D.defineProperty(G, { HA: "avoidable" }, function() { return 0 !== (this.Ca & 8) }, function(a) {
  26415. var b = 0 !== (this.Ca & 8);
  26416. if (b !== a) {
  26417. v && D.h(a, "boolean", G, "avoidable");
  26418. this.Ca ^= 8;
  26419. var c = this.g;
  26420. null !== c && c.oB(this);
  26421. this.i("avoidable", b, a)
  26422. }
  26423. });
  26424. D.defineProperty(G, { dI: "avoidableMargin" }, function() { return this.qr }, function(a) {
  26425. "number" === typeof a ? a = new Lb(a) : D.l(a, Lb, G, "avoidableMargin");
  26426. var b = this.qr;
  26427. if (!b.O(a)) {
  26428. this.qr = a = a.V();
  26429. var c = this.g;
  26430. null !== c && c.oB(this);
  26431. this.i("avoidableMargin", b, a)
  26432. }
  26433. });
  26434. G.prototype.getAvoidableRect = function(a) {
  26435. a.set(this.aa);
  26436. a.yx(this.dI);
  26437. return a
  26438. };
  26439. G.prototype.findVisibleNode = function() { for (var a = this; null !== a && !a.isVisible();) a = a.Ka; return a };
  26440. G.prototype.isVisible = function() {
  26441. if (!F.prototype.isVisible.call(this)) return !1;
  26442. var a = !0,
  26443. b = El,
  26444. c = this.g;
  26445. if (null !== c) {
  26446. a = c.Ra;
  26447. if (a.nf && (a = a.jn.oa(this), null !== a && a.Hy)) return !0;
  26448. a = c.ee;
  26449. b = c.rC
  26450. }
  26451. if (b === El) { if (c = this.Yk(), null !== c && !c.Dc) return !1 } else if (b === jn) { if (c = a ? this.HF() : this.IF(), 0 < c.count && c.all(function(a) { return !a.Dc })) return !1 } else if (b === kn && (c = a ? this.HF() : this.IF(), 0 < c.count && c.any(function(a) { return !a.Dc }))) return !1;
  26452. c = this.Xb;
  26453. return null !== c ? c.isVisible() : !0
  26454. };
  26455. G.prototype.Pd = function(a) { F.prototype.Pd.call(this, a); for (var b = this.Od; b.next();) b.value.Pd(a) };
  26456. D.w(G, { Od: "linksConnected" }, function() { return this.yc.j });
  26457. G.prototype.findLinksConnected = G.prototype.FF = function(a) {
  26458. void 0 === a && (a = null);
  26459. if (null === a) return this.yc.j;
  26460. v && D.h(a, "string", G, "findLinksConnected:pid");
  26461. var b = new Qa(this.yc),
  26462. c = this;
  26463. b.Nq = function(b) { return b.$ === c && b.hg === a || b.ba === c && b.jh === a };
  26464. return b
  26465. };
  26466. G.prototype.findLinksOutOf = G.prototype.Wx = function(a) {
  26467. void 0 === a && (a = null);
  26468. v && null !== a && D.h(a, "string", G, "findLinksOutOf:pid");
  26469. var b = new Qa(this.yc),
  26470. c = this;
  26471. b.Nq = function(b) { return b.$ !== c ? !1 : null === a ? !0 : b.hg === a };
  26472. return b
  26473. };
  26474. G.prototype.findLinksInto = G.prototype.Yg = function(a) {
  26475. void 0 === a && (a = null);
  26476. v && null !== a && D.h(a, "string", G, "findLinksInto:pid");
  26477. var b = new Qa(this.yc),
  26478. c = this;
  26479. b.Nq = function(b) { return b.ba !== c ? !1 : null === a ? !0 : b.jh === a };
  26480. return b
  26481. };
  26482. G.prototype.findNodesConnected = G.prototype.GF = function(a) {
  26483. void 0 === a && (a = null);
  26484. v && null !== a && D.h(a, "string", G, "findNodesConnected:pid");
  26485. for (var b = null, c = null, d = this.yc.j; d.next();) { var e = d.value; if (e.$ === this) { if (null === a || e.hg === a) e = e.ba, null !== b ? b.add(e) : null !== c && c !== e ? (b = new L(G), b.add(c), b.add(e)) : c = e } else e.ba !== this || null !== a && e.jh !== a || (e = e.$, null !== b ? b.add(e) : null !== c && c !== e ? (b = new L(G), b.add(c), b.add(e)) : c = e) }
  26486. return null !== b ? b.j : null !== c ? new Ma(c) : Ka
  26487. };
  26488. G.prototype.findNodesOutOf = G.prototype.IF = function(a) {
  26489. void 0 === a && (a = null);
  26490. v && null !== a && D.h(a, "string", G, "findNodesOutOf:pid");
  26491. for (var b = null, c = null, d = this.yc.j; d.next();) {
  26492. var e = d.value;
  26493. e.$ !== this || null !== a && e.hg !== a || (e = e.ba, null !== b ? b.add(e) : null !== c && c !== e ? (b = new L(G), b.add(c), b.add(e)) : c = e)
  26494. }
  26495. return null !== b ? b.j : null !== c ? new Ma(c) : Ka
  26496. };
  26497. G.prototype.findNodesInto = G.prototype.HF = function(a) {
  26498. void 0 === a && (a = null);
  26499. v && null !== a && D.h(a, "string", G, "findNodesInto:pid");
  26500. for (var b = null, c = null, d = this.yc.j; d.next();) {
  26501. var e = d.value;
  26502. e.ba !== this || null !== a && e.jh !== a || (e = e.$, null !== b ? b.add(e) : null !== c && c !== e ? (b = new L(G), b.add(c), b.add(e)) : c = e)
  26503. }
  26504. return null !== b ? b.j : null !== c ? new Ma(c) : Ka
  26505. };
  26506. G.prototype.findLinksBetween = function(a, b, c) {
  26507. void 0 === b && (b = null);
  26508. void 0 === c && (c = null);
  26509. v && (D.l(a, G, G, "findLinksBetween:othernode"), null !== b && D.h(b, "string", G, "findLinksBetween:pid"), null !== c && D.h(c, "string", G, "findLinksBetween:otherpid"));
  26510. var d = new Qa(this.yc),
  26511. e = this;
  26512. d.Nq = function(d) { return (d.$ !== e || d.ba !== a || null !== b && d.hg !== b || null !== c && d.jh !== c) && (d.$ !== a || d.ba !== e || null !== c && d.hg !== c || null !== b && d.jh !== b) ? !1 : !0 };
  26513. return d
  26514. };
  26515. G.prototype.findLinksTo = function(a, b, c) {
  26516. void 0 === b && (b = null);
  26517. void 0 === c && (c = null);
  26518. v && (D.l(a, G, G, "findLinksTo:othernode"), null !== b && D.h(b, "string", G, "findLinksTo:pid"), null !== c && D.h(c, "string", G, "findLinksTo:otherpid"));
  26519. var d = new Qa(this.yc),
  26520. e = this;
  26521. d.Nq = function(d) { return d.$ !== e || d.ba !== a || null !== b && d.hg !== b || null !== c && d.jh === c ? !1 : !0 };
  26522. return d
  26523. };
  26524. D.defineProperty(G, { BJ: "linkConnected" }, function() { return this.Bs }, function(a) {
  26525. var b = this.Bs;
  26526. b !== a && (null !== a && D.h(a, "function", G, "linkConnected"), this.Bs = a, this.i("linkConnected", b, a))
  26527. });
  26528. D.defineProperty(G, { CJ: "linkDisconnected" }, function() { return this.Cs }, function(a) {
  26529. var b = this.Cs;
  26530. b !== a && (null !== a && D.h(a, "function", G, "linkDisconnected"), this.Cs = a, this.i("linkDisconnected", b, a))
  26531. });
  26532. D.defineProperty(G, { sy: "linkValidation" }, function() { return this.Pl }, function(a) {
  26533. var b = this.Pl;
  26534. b !== a && (null !== a && D.h(a, "function", G, "linkValidation"), this.Pl = a, this.i("linkValidation", b, a))
  26535. });
  26536. function Er(a, b, c) {
  26537. Dr(a, c);
  26538. var d = a.yc.contains(b);
  26539. d || a.yc.add(b);
  26540. if (!d || b.$ === b.ba) {
  26541. var e = a.BJ;
  26542. if (null !== e) {
  26543. var g = !0,
  26544. h = a.g;
  26545. null !== h && (g = h.$a, h.$a = !0);
  26546. e(a, b, c);
  26547. null !== h && (h.$a = g)
  26548. }
  26549. }!d && b.jc && (c = b.$, b = b.ba, null !== c && null !== b && c !== b && (d = !0, h = a.g, null !== h && (d = h.ee), a = d ? b : c, e = d ? c : b, a.Nk || (a.Nk = e), !e.Rj || null !== h && h.na.ub || (d ? c === e && (e.Rj = !1) : b === e && (e.Rj = !1))))
  26550. }
  26551. function Fr(a, b, c) {
  26552. Dr(a, c);
  26553. var d = a.yc.remove(b);
  26554. if (d || b.ba === b.$) {
  26555. var e = a.CJ,
  26556. g = a.g;
  26557. if (null !== e) {
  26558. var h = !0;
  26559. null !== g && (h = g.$a, g.$a = !0);
  26560. e(a, b, c);
  26561. null !== g && (g.$a = h)
  26562. }
  26563. }
  26564. d && b.jc && (c = !0, null !== g && (c = g.ee), a = c ? b.ba : b.$, b = c ? b.$ : b.ba, null !== a && (a.Nk = !1), null === b || b.Rj || (0 === b.yc.count ? (b.Nk = null, null !== g && g.na.ub || (b.Rj = !0)) : Ln(b)))
  26565. }
  26566. function Ln(a) {
  26567. a.Nk = !1;
  26568. if (0 !== a.yc.count) {
  26569. var b = !0,
  26570. c = a.g;
  26571. if (null === c || !c.na.ub) {
  26572. null !== c && (b = c.ee);
  26573. for (c = a.yc.j; c.next();) {
  26574. var d = c.value;
  26575. if (d.jc)
  26576. if (b) { if (d.$ === a) { a.Rj = !1; return } } else if (d.ba === a) { a.Rj = !1; return }
  26577. }
  26578. a.Rj = !0
  26579. }
  26580. }
  26581. }
  26582. G.prototype.updateRelationshipsFromData = function() {
  26583. F.prototype.updateRelationshipsFromData.call(this);
  26584. var a = this.data;
  26585. if (null !== a) {
  26586. var b = this.g;
  26587. if (null !== b) {
  26588. var c = b.ea;
  26589. c instanceof Bg && (a = c.Un(a), a = b.Se(a), c = this.Yk(), a !== c && (c = this.Qn(), null !== a ? null !== c ? b.ee ? c.$ = a : c.ba = a : pn(b, a, this) : null !== c && dn(b, c, !1)))
  26590. }
  26591. }
  26592. };
  26593. G.prototype.Fu = function(a) {
  26594. F.prototype.Fu.call(this, a);
  26595. a || (Ln(this), a = this.pp, null !== a && Gr(a, this))
  26596. };
  26597. G.prototype.Gu = function(a) {
  26598. F.prototype.Gu.call(this, a);
  26599. a || (a = this.pp, null !== a && null !== a.Gf && (a.Gf.remove(this), a.K()))
  26600. };
  26601. G.prototype.Nn = function() {
  26602. if (0 < this.yc.count) {
  26603. var a = this.g;
  26604. if (null !== a)
  26605. for (var b = a.yb.vF, c = this.yc.copy().j; c.next();) {
  26606. var d = c.value;
  26607. b ? a.remove(d) : (d.$ === this && (d.$ = null), d.ba === this && (d.ba = null))
  26608. }
  26609. }
  26610. this.Xb = null;
  26611. F.prototype.Nn.call(this)
  26612. };
  26613. D.w(G, { Lf: "isLinkLabel" }, function() { return null !== this.pp });
  26614. D.defineProperty(G, { Xb: "labeledLink" }, function() { return this.pp }, function(a) {
  26615. var b = this.pp;
  26616. if (b !== a) {
  26617. v && null !== a && D.l(a, J, G, "labeledLink");
  26618. var c = this.g,
  26619. d = this.data;
  26620. if (null !== b) {
  26621. null !== b.Gf && (b.Gf.remove(this), b.K());
  26622. if (null !== c && null !== d && !c.na.ub) {
  26623. var e = b.data,
  26624. g = c.ea;
  26625. if (null !== e && g instanceof Y) {
  26626. var h = g.zb(d);
  26627. void 0 !== h && g.eK(e, h)
  26628. }
  26629. }
  26630. this.Ka = null
  26631. }
  26632. this.pp = a;
  26633. null !== a && (Gr(a, this), null === c || null === d || c.na.ub || (e = a.data, g = c.ea, null !== e && g instanceof Y && (h = g.zb(d), void 0 !== h && g.VE(e, h))), this.Ka = a.Ka);
  26634. Zo(this);
  26635. this.i("labeledLink", b, a)
  26636. }
  26637. });
  26638. G.prototype.findPort = G.prototype.aB = function(a) {
  26639. v && D.h(a, "string", G, "findPort:pid");
  26640. if (null === this.Ae) {
  26641. if ("" === a && !1 === this.bl) return this;
  26642. ep(this)
  26643. }
  26644. var b = this.Ae.oa(a);
  26645. return null !== b || "" !== a && (b = this.Ae.oa(""), null !== b) ? b : this
  26646. };
  26647. D.w(G, { port: "port" }, function() { return this.aB("") });
  26648. D.w(G, { ports: "ports" }, function() { null === this.Ae && ep(this); return this.Ae.qG });
  26649. function ep(a) {
  26650. null === a.Ae ? a.Ae = new oa("string", O) : a.Ae.clear();
  26651. gp(a, a, function(a, c) {
  26652. var d = c.yd;
  26653. null !== d && a.Ae.add(d, c)
  26654. });
  26655. 0 === a.Ae.count && a.Ae.add("", a)
  26656. }
  26657. function dp(a, b, c) {
  26658. var d = b.yd;
  26659. if (null !== d && (null !== a.Ae && a.Ae.remove(d), b = a.g, null !== b && c)) {
  26660. c = null;
  26661. for (d = a.FF(d); d.next();) a = d.value, null === c && (c = D.mb()), c.push(a);
  26662. if (null !== c) {
  26663. for (d = 0; d < c.length; d++) a = c[d], b.remove(a);
  26664. D.ya(c)
  26665. }
  26666. }
  26667. }
  26668. G.prototype.isInTreeOf = function(a) {
  26669. if (null === a || a === this) return !1;
  26670. var b = !0,
  26671. c = this.g;
  26672. null !== c && (b = c.ee);
  26673. c = this;
  26674. if (b)
  26675. for (; c !== a;) {
  26676. for (var b = null, d = c.yc.j; d.next();) { var e = d.value; if (e.jc && (b = e.$, b !== c && b !== this)) break }
  26677. if (b === this || null === b || b === c) return !1;
  26678. c = b
  26679. } else
  26680. for (; c !== a;) {
  26681. b = null;
  26682. for (d = c.yc.j; d.next() && (e = d.value, !e.jc || (b = e.ba, b === c || b === this)););
  26683. if (b === this || null === b || b === c) return !1;
  26684. c = b
  26685. }
  26686. return !0
  26687. };
  26688. G.prototype.findTreeRoot = function() {
  26689. var a = !0,
  26690. b = this.g;
  26691. null !== b && (a = b.ee);
  26692. b = this;
  26693. if (a)
  26694. for (;;) {
  26695. for (var a = null, c = b.yc.j; c.next();) { var d = c.value; if (d.jc && (a = d.$, a !== b && a !== this)) break }
  26696. if (a === this) return this;
  26697. if (null === a || a === b) return b;
  26698. b = a
  26699. } else
  26700. for (;;) {
  26701. a = null;
  26702. for (c = b.yc.j; c.next() && (d = c.value, !d.jc || (a = d.ba, a === b || a === this)););
  26703. if (a === this) return this;
  26704. if (null === a || a === b) return b;
  26705. b = a
  26706. }
  26707. };
  26708. G.prototype.findCommonTreeParent = function(a) {
  26709. if (null === a) return null;
  26710. v && D.l(a, G, G, "findCommonTreeParent:other");
  26711. if (this === a) return this;
  26712. for (var b = this; null !== b;) rr(b, !0), b = b.Yk();
  26713. for (var c = null, b = a; null !== b;) {
  26714. if (0 !== (b.T & 1048576)) { c = b; break }
  26715. b = b.Yk()
  26716. }
  26717. for (b = this; null !== b;) rr(b, !1), b = b.Yk();
  26718. return c
  26719. };
  26720. G.prototype.findTreeParentLink = G.prototype.Qn = function() {
  26721. var a = !0,
  26722. b = this.g;
  26723. null !== b && (a = b.ee);
  26724. b = this.yc.j;
  26725. if (a)
  26726. for (; b.next();) { if (a = b.value, a.jc && a.$ !== this) return a } else
  26727. for (; b.next();)
  26728. if (a = b.value, a.jc && a.ba !== this) return a;
  26729. return null
  26730. };
  26731. G.prototype.findTreeParentNode = G.prototype.Yk = function() {
  26732. var a = this.Nk;
  26733. if (null === a) return null;
  26734. if (a instanceof G) return a;
  26735. var b = !0,
  26736. a = this.g;
  26737. null !== a && (b = a.ee);
  26738. a = this.yc.j;
  26739. if (b)
  26740. for (; a.next();) { if (b = a.value, b.jc && (b = b.$, b !== this)) return this.Nk = b } else
  26741. for (; a.next();)
  26742. if (b = a.value, b.jc && (b = b.ba, b !== this)) return this.Nk = b;
  26743. return this.Nk = null
  26744. };
  26745. G.prototype.findTreeParentChain = function() {
  26746. function a(b, d) {
  26747. if (null !== b) {
  26748. d.add(b);
  26749. var e = b.Qn();
  26750. null !== e && (d.add(e), a(b.Yk(), d))
  26751. }
  26752. }
  26753. var b = new L(F);
  26754. a(this, b);
  26755. return b
  26756. };
  26757. G.prototype.findTreeLevel = function() { return Hr(this, this) };
  26758. function Hr(a, b) { var c = b.Yk(); return null === c ? 0 : 1 + Hr(a, c) }
  26759. G.prototype.findTreeChildrenLinks = G.prototype.Yx = function() {
  26760. var a = !0,
  26761. b = this.g;
  26762. null !== b && (a = b.ee);
  26763. var b = new Qa(this.yc),
  26764. c = this;
  26765. b.Nq = a ? function(a) { return a.jc && a.$ === c ? !0 : !1 } : function(a) { return a.jc && a.ba === c ? !0 : !1 };
  26766. return b
  26767. };
  26768. G.prototype.findTreeChildrenNodes = G.prototype.KF = function() {
  26769. var a = !0,
  26770. b = this.g;
  26771. null !== b && (a = b.ee);
  26772. var c = b = null,
  26773. d = this.yc.j;
  26774. if (a)
  26775. for (; d.next();) a = d.value, a.jc && a.$ === this && (a = a.ba, null !== b ? b.add(a) : null !== c && c !== a ? (b = new K(G), b.add(c), b.add(a)) : c = a);
  26776. else
  26777. for (; d.next();) a = d.value, a.jc && a.ba === this && (a = a.$, null !== b ? b.add(a) : null !== c && c !== a ? (b = new K(G), b.add(c), b.add(a)) : c = a);
  26778. return null !== b ? b.j : null !== c ? new Ma(c) : Ka
  26779. };
  26780. G.prototype.findTreeParts = function(a) {
  26781. void 0 === a && (a = Infinity);
  26782. D.h(a, "number", G, "findTreeParts:level");
  26783. var b = new L(F);
  26784. Qh(b, this, !1, a, !0);
  26785. return b
  26786. };
  26787. G.prototype.collapseTree = G.prototype.collapseTree = function(a) {
  26788. void 0 === a && (a = 1);
  26789. D.p(a, G, "collapseTree:level");
  26790. 1 > a && (a = 1);
  26791. var b = this.g;
  26792. if (null !== b && !b.Ph) {
  26793. b.Ph = !0;
  26794. var c = new L(G);
  26795. c.add(this);
  26796. Ir(this, c, b.ee, a, b.Ra, this, b.rC === El);
  26797. b.Ph = !1
  26798. }
  26799. };
  26800. function Ir(a, b, c, d, e, g, h) {
  26801. if (1 < d)
  26802. for (var k = c ? a.Wx() : a.Yg(); k.next();) {
  26803. var l = k.value;
  26804. l.jc && (l = l.fB(a), null === l || l === a || b.contains(l) || (b.add(l), Ir(l, b, c, d - 1, e, g, h)))
  26805. } else Jr(a, b, c, e, g, h)
  26806. }
  26807. function Jr(a, b, c, d, e, g) {
  26808. for (var h = e === a ? !0 : a.Dc, k = c ? a.Wx() : a.Yg(); k.next();) {
  26809. var l = k.value;
  26810. l.jc && (l = l.fB(a), null === l || l === a || b.contains(l) || (b.add(l), h && (g && ql(d, l, e), l.cl(), l.Pd(!1)), l.Dc && (l.br = l.Dc, Jr(l, b, c, d, e, g))))
  26811. }
  26812. a.Dc = !1
  26813. }
  26814. G.prototype.expandTree = G.prototype.expandTree = function(a) {
  26815. void 0 === a && (a = 2);
  26816. D.p(a, G, "expandTree:level");
  26817. 2 > a && (a = 2);
  26818. var b = this.g;
  26819. if (null !== b && !b.Ph) {
  26820. b.Ph = !0;
  26821. var c = new L(G);
  26822. c.add(this);
  26823. Kr(this, c, b.ee, a, b.Ra, this, b.rC === El);
  26824. b.Ph = !1
  26825. }
  26826. };
  26827. function Kr(a, b, c, d, e, g, h) {
  26828. for (var k = g === a ? !1 : a.Dc, l = c ? a.Wx() : a.Yg(); l.next();) {
  26829. var m = l.value;
  26830. m.jc && (k || m.Uf || m.ec(), m = m.fB(a), null !== m && m !== a && !b.contains(m) && (b.add(m), k || (m.Pd(!0), m.cl(), h && pl(e, m, g)), 2 < d || m.br)) && (m.br = !1, Kr(m, b, c, d - 1, e, g, h))
  26831. }
  26832. a.Dc = !0
  26833. }
  26834. D.defineProperty(G, { Dc: "isTreeExpanded" }, function() { return 0 !== (this.Ca & 1) }, function(a) {
  26835. var b = 0 !== (this.Ca & 1);
  26836. if (b !== a) {
  26837. v && D.h(a, "boolean", G, "isTreeExpanded");
  26838. this.Ca ^= 1;
  26839. var c = this.g;
  26840. this.i("isTreeExpanded", b, a);
  26841. b = this.GK;
  26842. if (null !== b) {
  26843. var d = !0;
  26844. null !== c && (d = c.$a, c.$a = !0);
  26845. b(this);
  26846. null !== c && (c.$a = d)
  26847. }
  26848. null !== c && c.na.ub ? this.Pd(a) : a ? this.expandTree() : this.collapseTree()
  26849. }
  26850. });
  26851. D.defineProperty(G, { br: "wasTreeExpanded" }, function() { return 0 !== (this.Ca & 2) }, function(a) {
  26852. var b = 0 !== (this.Ca & 2);
  26853. b !== a && (v && D.h(a, "boolean", G, "wasTreeExpanded"), this.Ca ^= 2, this.i("wasTreeExpanded", b, a))
  26854. });
  26855. D.defineProperty(G, { GK: "treeExpandedChanged" }, function() { return this.Vt }, function(a) {
  26856. var b = this.Vt;
  26857. b !== a && (null !== a && D.h(a, "function", G, "treeExpandedChanged"), this.Vt = a, this.i("treeExpandedChanged", b, a))
  26858. });
  26859. D.defineProperty(G, { Rj: "isTreeLeaf" }, function() { return 0 !== (this.Ca & 4) }, function(a) {
  26860. var b = 0 !== (this.Ca & 4);
  26861. b !== a && (v && D.h(a, "boolean", G, "isTreeLeaf"), this.Ca ^= 4, this.i("isTreeLeaf", b, a))
  26862. });
  26863. function J() {
  26864. F.call(this, sj);
  26865. this.gc = 8;
  26866. this.Cg = null;
  26867. this.gi = "";
  26868. this.Tg = this.cs = null;
  26869. this.Ai = "";
  26870. this.Ut = null;
  26871. this.ir = vj;
  26872. this.Dr = 0;
  26873. this.Gr = vj;
  26874. this.Hr = NaN;
  26875. this.on = Lr;
  26876. this.Jt = .5;
  26877. this.Gf = null;
  26878. this.gd = (new K(N)).freeze();
  26879. this.oh = this.jD = this.dD = this.Oi = this.$i = this.ab = this.Vw = this.Hp = this.ef = null;
  26880. this.uA = new N;
  26881. this.Z = this.AE = this.zE = null
  26882. }
  26883. D.Ta(J, F);
  26884. D.ka("Link", J);
  26885. J.prototype.cloneProtected = function(a) {
  26886. F.prototype.cloneProtected.call(this, a);
  26887. a.gc = this.gc & -113;
  26888. a.gi = this.gi;
  26889. a.cs = this.cs;
  26890. a.Ai = this.Ai;
  26891. a.Ut = this.Ut;
  26892. a.ir = this.ir;
  26893. a.Dr = this.Dr;
  26894. a.Gr = this.Gr;
  26895. a.Hr = this.Hr;
  26896. a.on = this.on;
  26897. a.Jt = this.Jt;
  26898. null !== this.Z && (a.Z = this.Z.copy())
  26899. };
  26900. J.prototype.Ei = function(a) {
  26901. F.prototype.Ei.call(this, a);
  26902. this.gi = a.gi;
  26903. this.Ai = a.Ai;
  26904. a.ef = null;
  26905. a.ec();
  26906. a.Oi = this.Oi
  26907. };
  26908. J.prototype.qc = function(a) { a.Qe === J ? 2 === (a.value & 2) ? this.My = a : a === Uj || a === uj || a === tj ? this.jf = a : a === Mr || a === Nr || a === Or ? this.Yp = a : a !== Lr && a !== vj && D.k("Unknown Link enum value for a Link property: " + a) : F.prototype.qc.call(this, a) };
  26909. var Lr;
  26910. J.Normal = Lr = D.s(J, "Normal", 1);
  26911. J.Orthogonal = D.s(J, "Orthogonal", 2);
  26912. J.AvoidsNodes = D.s(J, "AvoidsNodes", 6);
  26913. var Pr;
  26914. J.AvoidsNodesStraight = Pr = D.s(J, "AvoidsNodesStraight", 7);
  26915. var vj;
  26916. J.None = vj = D.s(J, "None", 0);
  26917. var Uj;
  26918. J.Bezier = Uj = D.s(J, "Bezier", 9);
  26919. var uj;
  26920. J.JumpGap = uj = D.s(J, "JumpGap", 10);
  26921. var tj;
  26922. J.JumpOver = tj = D.s(J, "JumpOver", 11);
  26923. var Mr;
  26924. J.End = Mr = D.s(J, "End", 17);
  26925. var Nr;
  26926. J.Scale = Nr = D.s(J, "Scale", 18);
  26927. var Or;
  26928. J.Stretch = Or = D.s(J, "Stretch", 19);
  26929. var wq;
  26930. J.OrientAlong = wq = D.s(J, "OrientAlong", 21);
  26931. var Xp;
  26932. J.OrientPlus90 = Xp = D.s(J, "OrientPlus90", 22);
  26933. var Zp;
  26934. J.OrientMinus90 = Zp = D.s(J, "OrientMinus90", 23);
  26935. var Qr;
  26936. J.OrientOpposite = Qr = D.s(J, "OrientOpposite", 24);
  26937. var Rr;
  26938. J.OrientUpright = Rr = D.s(J, "OrientUpright", 25);
  26939. var Yp;
  26940. J.OrientPlus90Upright = Yp = D.s(J, "OrientPlus90Upright", 26);
  26941. var $p;
  26942. J.OrientMinus90Upright = $p = D.s(J, "OrientMinus90Upright", 27);
  26943. var aq;
  26944. J.OrientUpright45 = aq = D.s(J, "OrientUpright45", 28);
  26945. f = J.prototype;
  26946. f.ae = function() { null === this.Z && (this.Z = new Eo) };
  26947. f.ym = function() {
  26948. var a = this.$;
  26949. if (null !== a) {
  26950. var b = a.findVisibleNode();
  26951. null !== b && (a = b);
  26952. if (Om(a) || Pm(a)) return !1
  26953. }
  26954. a = this.ba;
  26955. return null !== a && (b = a.findVisibleNode(), null !== b && (a = b), Om(a) || Pm(a)) ? !1 : !0
  26956. };
  26957. f.bC = function() { return !1 };
  26958. f.cC = function() {};
  26959. f.qe = function() { return !1 };
  26960. J.prototype.computeAngle = function(a, b, c) { return J.computeAngle(b, c) };
  26961. J.computeAngle = function(a, b) {
  26962. var c = 0;
  26963. switch (a) {
  26964. default:
  26965. case vj:
  26966. c = 0;
  26967. break;
  26968. case wq:
  26969. c = b;
  26970. break;
  26971. case Xp:
  26972. c = b + 90;
  26973. break;
  26974. case Zp:
  26975. c = b - 90;
  26976. break;
  26977. case Qr:
  26978. c = b + 180;
  26979. break;
  26980. case Rr:
  26981. c = Re(b);90 < c && 270 > c && (c -= 180);
  26982. break;
  26983. case Yp:
  26984. c = Re(b + 90);90 < c && 270 > c && (c -= 180);
  26985. break;
  26986. case $p:
  26987. c = Re(b - 90);90 < c && 270 > c && (c -= 180);
  26988. break;
  26989. case aq:
  26990. c = Re(b);
  26991. if (45 < c && 135 > c || 225 < c && 315 > c) return 0;90 < c && 270 > c && (c -= 180)
  26992. }
  26993. return Re(c)
  26994. };
  26995. D.defineProperty(J, { $: "fromNode" }, function() { return this.Cg }, function(a) {
  26996. var b = this.Cg;
  26997. if (b !== a) {
  26998. v && null !== a && D.l(a, G, J, "fromNode");
  26999. var c = this.oc;
  27000. null !== b && (this.Tg !== b && Fr(b, this, c), Sr(this), this.L(en));
  27001. this.Cg = a;
  27002. null !== a && this.Pd(a.isVisible());
  27003. this.$i = null;
  27004. this.ec();
  27005. var d = this.g;
  27006. if (null !== d) {
  27007. var e = this.data,
  27008. g = d.ea;
  27009. if (null !== e)
  27010. if (g instanceof Y) {
  27011. var h = null !== a ? a.data : null;
  27012. g.YB(e, g.zb(h))
  27013. } else g instanceof Bg && (h = null !== a ? a.data : null, d.ee ? g.Ii(e, g.zb(h)) : (null !== b && g.Ii(b.data, void 0), g.Ii(h, g.zb(null !==
  27014. this.Tg ? this.Tg.data : null))))
  27015. }
  27016. e = this.oc;
  27017. g = this.NF;
  27018. null !== g && (h = !0, null !== d && (h = d.$a, d.$a = !0), g(this, c, e), null !== d && (d.$a = h));
  27019. null !== a && (this.Tg !== a && Er(a, this, e), Tr(this), this.L(Wm));
  27020. this.i("fromNode", b, a);
  27021. An(this)
  27022. }
  27023. });
  27024. D.defineProperty(J, { hg: "fromPortId" }, function() { return this.gi }, function(a) {
  27025. var b = this.gi;
  27026. if (b !== a) {
  27027. v && D.h(a, "string", J, "fromPortId");
  27028. var c = this.$,
  27029. d = this.oc;
  27030. null !== d && Dr(c, d);
  27031. Sr(this);
  27032. this.gi = a;
  27033. var e = this.oc;
  27034. null !== e && Dr(c, e);
  27035. c = this.g;
  27036. if (null !== c) {
  27037. var g = this.data,
  27038. h = c.ea;
  27039. null !== g && h instanceof Y && h.ZB(g, a)
  27040. }
  27041. d !== e && (this.$i = null, this.ec(), g = this.NF, null !== g && (h = !0, null !== c && (h = c.$a, c.$a = !0), g(this, d, e), null !== c && (c.$a = h)));
  27042. Tr(this);
  27043. this.i("fromPortId", b, a)
  27044. }
  27045. });
  27046. D.w(J, { oc: "fromPort" }, function() { var a = this.Cg; return null === a ? null : a.aB(this.gi) });
  27047. D.defineProperty(J, { NF: "fromPortChanged" }, function() { return this.cs }, function(a) {
  27048. var b = this.cs;
  27049. b !== a && (null !== a && D.h(a, "function", J, "fromPortChanged"), this.cs = a, this.i("fromPortChanged", b, a))
  27050. });
  27051. D.defineProperty(J, { ba: "toNode" }, function() { return this.Tg }, function(a) {
  27052. var b = this.Tg;
  27053. if (b !== a) {
  27054. v && null !== a && D.l(a, G, J, "toNode");
  27055. var c = this.Gc;
  27056. null !== b && (this.Cg !== b && Fr(b, this, c), Sr(this), this.L(en));
  27057. this.Tg = a;
  27058. null !== a && this.Pd(a.isVisible());
  27059. this.$i = null;
  27060. this.ec();
  27061. var d = this.g;
  27062. if (null !== d) {
  27063. var e = this.data,
  27064. g = d.ea;
  27065. if (null !== e)
  27066. if (g instanceof Y) {
  27067. var h = null !== a ? a.data : null;
  27068. g.dC(e, g.zb(h))
  27069. } else g instanceof Bg && (h = null !== a ? a.data : null, d.ee ? (null !== b && g.Ii(b.data, void 0), g.Ii(h, g.zb(null !== this.Cg ? this.Cg.data :
  27070. null))) : g.Ii(e, g.zb(h)))
  27071. }
  27072. e = this.Gc;
  27073. g = this.oH;
  27074. null !== g && (h = !0, null !== d && (h = d.$a, d.$a = !0), g(this, c, e), null !== d && (d.$a = h));
  27075. null !== a && (this.Cg !== a && Er(a, this, e), Tr(this), this.L(Wm));
  27076. this.i("toNode", b, a);
  27077. An(this)
  27078. }
  27079. });
  27080. D.defineProperty(J, { jh: "toPortId" }, function() { return this.Ai }, function(a) {
  27081. var b = this.Ai;
  27082. if (b !== a) {
  27083. v && D.h(a, "string", J, "toPortId");
  27084. var c = this.ba,
  27085. d = this.Gc;
  27086. null !== d && Dr(c, d);
  27087. Sr(this);
  27088. this.Ai = a;
  27089. var e = this.Gc;
  27090. null !== e && Dr(c, e);
  27091. c = this.g;
  27092. if (null !== c) {
  27093. var g = this.data,
  27094. h = c.ea;
  27095. null !== g && h instanceof Y && h.eC(g, a)
  27096. }
  27097. d !== e && (this.$i = null, this.ec(), g = this.oH, null !== g && (h = !0, null !== c && (h = c.$a, c.$a = !0), g(this, d, e), null !== c && (c.$a = h)));
  27098. Tr(this);
  27099. this.i("toPortId", b, a)
  27100. }
  27101. });
  27102. D.w(J, { Gc: "toPort" }, function() { var a = this.Tg; return null === a ? null : a.aB(this.Ai) });
  27103. D.defineProperty(J, { oH: "toPortChanged" }, function() { return this.Ut }, function(a) {
  27104. var b = this.Ut;
  27105. b !== a && (null !== a && D.h(a, "function", J, "toPortChanged"), this.Ut = a, this.i("toPortChanged", b, a))
  27106. });
  27107. D.defineProperty(J, { Gb: "fromSpot" }, function() { return null !== this.Z ? this.Z.ok : Vc }, function(a) {
  27108. this.ae();
  27109. var b = this.Z.ok;
  27110. b.O(a) || (v && D.l(a, S, J, "fromSpot"), a = a.V(), this.Z.ok = a, this.i("fromSpot", b, a), this.ec())
  27111. });
  27112. D.defineProperty(J, { rm: "fromEndSegmentLength" }, function() { return null !== this.Z ? this.Z.mk : NaN }, function(a) {
  27113. this.ae();
  27114. var b = this.Z.mk;
  27115. b !== a && (v && D.h(a, "number", J, "fromEndSegmentLength"), 0 > a && D.ua(a, ">= 0", J, "fromEndSegmentLength"), this.Z.mk = a, this.i("fromEndSegmentLength", b, a), this.ec())
  27116. });
  27117. D.defineProperty(J, { zu: "fromEndSegmentDirection" }, function() { return null !== this.Z ? this.Z.lk : yr }, function(a) {
  27118. this.ae();
  27119. var b = this.Z.lk;
  27120. b !== a && (D.On("Link.fromEndSegmentDirection", "2.0"), v && D.Da(a, G, J, "fromEndSegmentDirection"), this.Z.lk = a, this.i("fromEndSegmentDirection", b, a), this.ec())
  27121. });
  27122. D.defineProperty(J, { Au: "fromShortLength" }, function() { return null !== this.Z ? this.Z.nk : NaN }, function(a) {
  27123. this.ae();
  27124. var b = this.Z.nk;
  27125. b !== a && (v && D.h(a, "number", J, "fromShortLength"), this.Z.nk = a, this.i("fromShortLength", b, a), this.ec())
  27126. });
  27127. D.defineProperty(J, { Hb: "toSpot" }, function() { return null !== this.Z ? this.Z.Mk : Vc }, function(a) {
  27128. this.ae();
  27129. var b = this.Z.Mk;
  27130. b.O(a) || (v && D.l(a, S, J, "toSpot"), a = a.V(), this.Z.Mk = a, this.i("toSpot", b, a), this.ec())
  27131. });
  27132. D.defineProperty(J, { Hm: "toEndSegmentLength" }, function() { return null !== this.Z ? this.Z.Kk : NaN }, function(a) {
  27133. this.ae();
  27134. var b = this.Z.Kk;
  27135. b !== a && (v && D.h(a, "number", J, "toEndSegmentLength"), 0 > a && D.ua(a, ">= 0", J, "toEndSegmentLength"), this.Z.Kk = a, this.i("toEndSegmentLength", b, a), this.ec())
  27136. });
  27137. D.defineProperty(J, { uv: "toEndSegmentDirection" }, function() { return null !== this.Z ? this.Z.Jk : yr }, function(a) {
  27138. this.ae();
  27139. var b = this.Z.Jk;
  27140. b !== a && (D.On("Link.toEndSegmentDirection", "2.0"), v && D.Da(a, G, J, "toEndSegmentDirection"), this.Z.Jk = a, this.i("toEndSegmentDirection", b, a), this.ec())
  27141. });
  27142. D.defineProperty(J, { vv: "toShortLength" }, function() { return null !== this.Z ? this.Z.Lk : NaN }, function(a) {
  27143. this.ae();
  27144. var b = this.Z.Lk;
  27145. b !== a && (v && D.h(a, "number", J, "toShortLength"), this.Z.Lk = a, this.i("toShortLength", b, a), this.ec())
  27146. });
  27147. function An(a) {
  27148. var b = a.$,
  27149. c = a.ba,
  27150. d = null,
  27151. b = d = null !== b ? null !== c ? b.LI(c) : b.Ka : null !== c ? c.Ka : null,
  27152. c = a.Al;
  27153. if (c !== b) {
  27154. null !== c && sr(c, a);
  27155. a.Al = b;
  27156. null !== b && tr(b, a);
  27157. var e = a.kF;
  27158. if (null !== e) {
  27159. var g = !0,
  27160. h = a.g;
  27161. null !== h && (g = h.$a, h.$a = !0);
  27162. e(a, c, b);
  27163. null !== h && (h.$a = g)
  27164. }!a.Uf || a.zE !== c && a.AE !== c || a.ec()
  27165. }
  27166. if (a.pJ)
  27167. for (a = a.Af; a.next();) a.value.Ka = d
  27168. }
  27169. J.prototype.cl = function() {
  27170. var a = this.Ka;
  27171. null !== a && this.$ !== a && this.ba !== a && a.Jx && F.prototype.cl.call(this)
  27172. };
  27173. J.prototype.getOtherNode = J.prototype.fB = function(a) { v && D.l(a, G, J, "getOtherNode:node"); var b = this.$; return a === b ? this.ba : b };
  27174. J.prototype.getOtherPort = function(a) { v && D.l(a, O, J, "getOtherPort:port"); var b = this.oc; return a === b ? this.Gc : b };
  27175. D.w(J, { pJ: "isLabeledLink" }, function() { return null === this.Gf ? !1 : 0 < this.Gf.count });
  27176. D.w(J, { Af: "labelNodes" }, function() { return null === this.Gf ? Ka : this.Gf.j });
  27177. function Gr(a, b) {
  27178. null === a.Gf && (a.Gf = new L(G));
  27179. a.Gf.add(b);
  27180. a.K()
  27181. }
  27182. J.prototype.Fu = function(a) {
  27183. F.prototype.Fu.call(this, a);
  27184. Ur(this) && Oj(this, this.aa);
  27185. if (!a) {
  27186. a = this.Cg;
  27187. var b = null;
  27188. null !== a && (b = this.oc, Er(a, this, b));
  27189. var c = this.Tg,
  27190. d = null;
  27191. null !== c && (d = this.Gc, c === a && d === b || Er(c, this, d));
  27192. Tr(this)
  27193. }
  27194. };
  27195. J.prototype.Gu = function(a) {
  27196. F.prototype.Gu.call(this, a);
  27197. Ur(this) && Oj(this, this.aa);
  27198. if (!a) {
  27199. a = this.Cg;
  27200. var b = null;
  27201. null !== a && (b = this.oc, Fr(a, this, b));
  27202. var c = this.Tg,
  27203. d = null;
  27204. null !== c && (d = this.Gc, c === a && d === b || Fr(c, this, d));
  27205. Sr(this)
  27206. }
  27207. };
  27208. J.prototype.Nn = function() {
  27209. this.Uf = !0;
  27210. if (null !== this.Gf) {
  27211. var a = this.g;
  27212. if (null !== a)
  27213. for (var b = this.Gf.copy().j; b.next();) a.remove(b.value)
  27214. }
  27215. b = this.data;
  27216. null !== b && (a = this.g, null !== a && (a = a.ea, a instanceof Y ? a.Jy(b) : a instanceof Bg && a.Ii(b, void 0)))
  27217. };
  27218. J.prototype.updateRelationshipsFromData = function() {
  27219. var a = this.data;
  27220. if (null !== a) {
  27221. var b = this.g;
  27222. if (null !== b) {
  27223. var c = b.ea;
  27224. if (c instanceof Y) {
  27225. var d = c.tm(a);
  27226. this.$ = d = b.Se(d);
  27227. d = c.um(a);
  27228. this.ba = d = b.Se(d);
  27229. a = c.$k(a);
  27230. if (0 < a.length || 0 < this.Af.count) {
  27231. if (1 === a.length && 1 === this.Af.count) {
  27232. var d = a[0],
  27233. e = this.Af.first();
  27234. if (c.zb(e.data) === d) return
  27235. }
  27236. var d = (new L).Vc(a),
  27237. g = new L;
  27238. this.Af.each(function(a) { null !== a.data && (a = c.zb(a.data), void 0 !== a && g.add(a)) });
  27239. a = g.copy();
  27240. a.Iy(d);
  27241. d = d.copy();
  27242. d.Iy(g);
  27243. if (0 < a.count || 0 < d.count) {
  27244. var h =
  27245. this;
  27246. a.each(function(a) {
  27247. a = b.Se(a);
  27248. null !== a && a.Xb === h && (a.Xb = null)
  27249. });
  27250. d.each(function(a) {
  27251. a = b.Se(a);
  27252. null !== a && a.Xb !== h && (a.Xb = h)
  27253. })
  27254. }
  27255. }
  27256. }
  27257. }
  27258. }
  27259. };
  27260. J.prototype.move = function(a) {
  27261. var b = this.position,
  27262. c = b.x;
  27263. isNaN(c) && (c = 0);
  27264. b = b.y;
  27265. isNaN(b) && (b = 0);
  27266. c = a.x - c;
  27267. b = a.y - b;
  27268. F.prototype.move.call(this, a);
  27269. this.gl(c, b);
  27270. for (a = this.Af; a.next();) {
  27271. var d = a.value,
  27272. e = d.position;
  27273. d.moveTo(e.x + c, e.y + b)
  27274. }
  27275. };
  27276. D.defineProperty(J, { cK: "relinkableFrom" }, function() { return 0 !== (this.gc & 1) }, function(a) {
  27277. var b = 0 !== (this.gc & 1);
  27278. b !== a && (v && D.h(a, "boolean", J, "relinkableFrom"), this.gc ^= 1, this.i("relinkableFrom", b, a), this.pe())
  27279. });
  27280. D.defineProperty(J, { dK: "relinkableTo" }, function() { return 0 !== (this.gc & 2) }, function(a) {
  27281. var b = 0 !== (this.gc & 2);
  27282. b !== a && (v && D.h(a, "boolean", J, "relinkableTo"), this.gc ^= 2, this.i("relinkableTo", b, a), this.pe())
  27283. });
  27284. J.prototype.canRelinkFrom = function() {
  27285. if (!this.cK) return !1;
  27286. var a = this.layer;
  27287. if (null === a) return !0;
  27288. if (!a.Dn) return !1;
  27289. a = a.g;
  27290. return null === a || a.Dn ? !0 : !1
  27291. };
  27292. J.prototype.canRelinkTo = function() {
  27293. if (!this.dK) return !1;
  27294. var a = this.layer;
  27295. if (null === a) return !0;
  27296. if (!a.Dn) return !1;
  27297. a = a.g;
  27298. return null === a || a.Dn ? !0 : !1
  27299. };
  27300. D.defineProperty(J, { jv: "resegmentable" }, function() { return 0 !== (this.gc & 4) }, function(a) {
  27301. var b = 0 !== (this.gc & 4);
  27302. b !== a && (v && D.h(a, "boolean", J, "resegmentable"), this.gc ^= 4, this.i("resegmentable", b, a), this.pe())
  27303. });
  27304. D.defineProperty(J, { jc: "isTreeLink" }, function() { return 0 !== (this.gc & 8) }, function(a) {
  27305. var b = 0 !== (this.gc & 8);
  27306. b !== a && (v && D.h(a, "boolean", J, "isTreeLink"), this.gc ^= 8, this.i("isTreeLink", b, a), null !== this.$ && Ln(this.$), null !== this.ba && Ln(this.ba))
  27307. });
  27308. D.w(J, { path: "path" }, function() { var a = this.Ld(); return a instanceof z ? a : null });
  27309. D.w(J, { so: "routeBounds" }, function() {
  27310. this.zo();
  27311. var a = new C;
  27312. var b = Infinity,
  27313. c = Infinity,
  27314. d = this.ta;
  27315. if (0 === d) a.n(NaN, NaN, 0, 0);
  27316. else {
  27317. if (1 === d) d = this.m(0), b = Math.min(d.x, b), c = Math.min(d.y, c), a.n(d.x, d.y, 0, 0);
  27318. else if (2 === d) {
  27319. var e = this.m(0),
  27320. g = this.m(1),
  27321. b = Math.min(e.x, g.x),
  27322. c = Math.min(e.y, g.y);
  27323. a.n(e.x, e.y, 0, 0);
  27324. a.Mi(g)
  27325. } else if (this.computeCurve() === Uj && 3 <= d && !this.ic)
  27326. if (e = this.m(0), b = e.x, c = e.y, a.n(b, c, 0, 0), 3 === d) d = this.m(1), b = Math.min(d.x, b), c = Math.min(d.y, c), g = this.m(2), b = Math.min(g.x, b), c = Math.min(g.y, c), Ae(e.x,
  27327. e.y, d.x, d.y, d.x, d.y, g.x, g.y, .5, a);
  27328. else
  27329. for (var h = 3; h < d; h += 3) {
  27330. var k = this.m(h - 2);
  27331. h + 3 >= d && (h = d - 1);
  27332. var l = this.m(h - 1),
  27333. g = this.m(h);
  27334. Ae(e.x, e.y, k.x, k.y, l.x, l.y, g.x, g.y, .5, a);
  27335. b = Math.min(g.x, b);
  27336. c = Math.min(g.y, c);
  27337. e = g
  27338. } else
  27339. for (e = this.m(0), g = this.m(1), b = Math.min(e.x, g.x), c = Math.min(e.y, g.y), a.n(e.x, e.y, 0, 0), a.Mi(g), h = 2; h < d; h++) e = this.m(h), b = Math.min(e.x, b), c = Math.min(e.y, c), a.Mi(e);
  27340. this.uA.n(b - a.x, c - a.y)
  27341. }
  27342. return this.Vw = a
  27343. });
  27344. D.w(J, { xG: "midPoint" }, function() { this.zo(); return this.computeMidPoint(new N) });
  27345. J.prototype.computeMidPoint = function(a) {
  27346. var b = this.ta;
  27347. if (0 === b) return a.assign(he), a;
  27348. if (1 === b) return a.assign(this.m(0)), a;
  27349. if (2 === b) {
  27350. var c = this.m(0),
  27351. d = this.m(1);
  27352. a.n((c.x + d.x) / 2, (c.y + d.y) / 2);
  27353. return a
  27354. }
  27355. if (this.computeCurve() === Uj && 3 <= b && !this.ic) {
  27356. if (3 === b) return this.m(1);
  27357. var c = (b - 1) / 3 | 0,
  27358. e = 3 * (c / 2 | 0);
  27359. if (1 === c % 2) {
  27360. var c = this.m(e),
  27361. d = this.m(e + 1),
  27362. g = this.m(e + 2),
  27363. e = this.m(e + 3),
  27364. b = d.x,
  27365. h = d.y,
  27366. d = g.x,
  27367. k = g.y,
  27368. g = (b + d) / 2,
  27369. l = (h + k) / 2,
  27370. h = ((c.y + h) / 2 + l) / 2,
  27371. k = (l + (k + e.y) / 2) / 2;
  27372. a.x = (((c.x + b) / 2 + g) / 2 + (g + (d + e.x) / 2) / 2) / 2;
  27373. a.y = (h + k) / 2
  27374. } else a.assign(this.m(e));
  27375. return a
  27376. }
  27377. e = 0;
  27378. g = D.mb();
  27379. for (h = 0; h < b - 1; h++) c = 0, c = this.m(h), d = this.m(h + 1), Eb(c.x, d.x) ? (c = d.y - c.y, 0 > c && (c = -c)) : Eb(c.y, d.y) ? (c = d.x - c.x, 0 > c && (c = -c)) : c = Math.sqrt(c.Kf(d)), g.push(c), e += c;
  27380. for (d = h = c = 0; c < e / 2 && h < b;) {
  27381. d = g[h];
  27382. if (c + d > e / 2) break;
  27383. c += d;
  27384. h++
  27385. }
  27386. D.ya(g);
  27387. b = this.m(h);
  27388. g = this.m(h + 1);
  27389. b.x === g.x ? b.y > g.y ? a.n(b.x, b.y - (e / 2 - c)) : a.n(b.x, b.y + (e / 2 - c)) : b.y === g.y ? b.x > g.x ? a.n(b.x - (e / 2 - c), b.y) : a.n(b.x + (e / 2 - c), b.y) : (c = (e / 2 - c) / d, a.n(b.x + c * (g.x - b.x), b.y + c * (g.y - b.y)));
  27390. return a
  27391. };
  27392. D.w(J, { wG: "midAngle" }, function() { this.zo(); return this.computeMidAngle() });
  27393. J.prototype.computeMidAngle = function() {
  27394. var a = this.ta;
  27395. if (2 > a) return NaN;
  27396. if (this.computeCurve() === Uj && 4 <= a && !this.ic) {
  27397. var b = (a - 1) / 3 | 0,
  27398. c = 3 * (b / 2 | 0);
  27399. if (1 === b % 2) {
  27400. var c = Math.floor(c),
  27401. b = this.m(c),
  27402. d = this.m(c + 1),
  27403. a = this.m(c + 2),
  27404. c = this.m(c + 3),
  27405. e = d.x,
  27406. d = d.y,
  27407. g = a.x,
  27408. a = a.y,
  27409. h = (e + g) / 2,
  27410. k = (d + a) / 2;
  27411. return wb(((b.x + e) / 2 + h) / 2, ((b.y + d) / 2 + k) / 2, (h + (g + c.x) / 2) / 2, (k + (a + c.y) / 2) / 2)
  27412. }
  27413. if (0 < c && c + 1 < a) return b = this.m(c - 1), d = this.m(c + 1), b.Wb(d)
  27414. }
  27415. c = a / 2 | 0;
  27416. if (0 === a % 2) return b = this.m(c - 1), d = this.m(c), 4 <= a && b.Wc(d) ? (b = this.m(c - 2), a = this.m(c + 1),
  27417. c = b.Kf(d), e = d.Kf(a), c > e + 10 ? b.Wb(d) : e > c + 10 ? d.Wb(a) : b.Wb(a)) : null === this.ab || this.ic ? b.Wb(d) : this.ab.OF(.5);
  27418. if (null !== this.ab && !this.ic) return this.ab.OF(.5);
  27419. b = this.m(c - 1);
  27420. d = this.m(c);
  27421. a = this.m(c + 1);
  27422. c = b.Kf(d);
  27423. e = d.Kf(a);
  27424. return c > e + 10 ? b.Wb(d) : e > c + 10 ? d.Wb(a) : b.Wb(a)
  27425. };
  27426. D.defineProperty(J, { points: "points" }, function() { return this.gd }, function(a) {
  27427. var b = this.gd;
  27428. if (b !== a) {
  27429. var c = null;
  27430. if (Array.isArray(a)) {
  27431. var d = 0 === a.length % 2;
  27432. if (d)
  27433. for (var e = 0; e < a.length; e++)
  27434. if ("number" !== typeof a[e] || isNaN(a[e])) { d = !1; break }
  27435. if (d)
  27436. for (c = new K(N), d = 0; d < a.length / 2; d++) e = (new N(a[2 * d], a[2 * d + 1])).freeze(), c.add(e);
  27437. else {
  27438. e = !0;
  27439. for (d = 0; d < a.length; d++) { var g = a[d]; if (!D.Qa(g) || "number" !== typeof g.x || isNaN(g.x) || "number" !== typeof g.y || isNaN(g.y)) { e = !1; break } }
  27440. if (e)
  27441. for (c = new K(N), d = 0; d < a.length; d++) e =
  27442. a[d], c.add((new N(e.x, e.y)).freeze());
  27443. else D.k("Link.points array must contain only an even number of numbers or objects with x and y properties, not: " + a)
  27444. }
  27445. } else if (a instanceof K)
  27446. for (c = a.copy(), a = c.j; a.next();) a.value.freeze();
  27447. else D.k("Link.points value is not an instance of List or Array: " + a);
  27448. c.freeze();
  27449. this.gd = c;
  27450. this.Te();
  27451. this.K();
  27452. Vr(this);
  27453. a = this.g;
  27454. null !== a && (a.Zn || a.na.ub || a.ty.add(this), a.Ra.zc && (this.Hp = c));
  27455. this.i("points", b, c)
  27456. }
  27457. });
  27458. D.w(J, { ta: "pointsCount" }, function() { return this.gd.count });
  27459. J.prototype.getPoint = J.prototype.m = function(a) { return this.gd.o[a] };
  27460. J.prototype.setPoint = J.prototype.gh = function(a, b) {
  27461. v && (D.l(b, N, J, "setPoint"), b.H() || D.k("Link.setPoint called with a Point that does not have real numbers: " + b.toString()));
  27462. null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
  27463. this.gd.ug(a, b)
  27464. };
  27465. J.prototype.setPointAt = J.prototype.ia = function(a, b, c) {
  27466. v && (D.p(b, J, "setPointAt:x"), D.p(c, J, "setPointAt:y"));
  27467. null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
  27468. this.gd.ug(a, new N(b, c))
  27469. };
  27470. J.prototype.insertPoint = function(a, b) {
  27471. v && (D.l(b, N, J, "insertPoint"), b.H() || D.k("Link.insertPoint called with a Point that does not have real numbers: " + b.toString()));
  27472. null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
  27473. this.gd.be(a, b)
  27474. };
  27475. J.prototype.insertPointAt = J.prototype.B = function(a, b, c) {
  27476. v && (D.p(b, J, "insertPointAt:x"), D.p(c, J, "insertPointAt:y"));
  27477. null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
  27478. this.gd.be(a, new N(b, c))
  27479. };
  27480. J.prototype.addPoint = J.prototype.Ci = function(a) {
  27481. v && (D.l(a, N, J, "addPoint"), a.H() || D.k("Link.addPoint called with a Point that does not have real numbers: " + a.toString()));
  27482. null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
  27483. this.gd.add(a)
  27484. };
  27485. J.prototype.addPointAt = J.prototype.Bj = function(a, b) {
  27486. v && (D.p(a, J, "insertPointAt:x"), D.p(b, J, "insertPointAt:y"));
  27487. null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
  27488. this.gd.add(new N(a, b))
  27489. };
  27490. J.prototype.removePoint = J.prototype.KG = function(a) {
  27491. null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
  27492. this.gd.pd(a)
  27493. };
  27494. J.prototype.clearPoints = J.prototype.dq = function() {
  27495. null === this.ef && D.k("Call Link.startRoute before modifying the points of the route.");
  27496. this.gd.clear()
  27497. };
  27498. J.prototype.movePoints = J.prototype.gl = function(a, b) {
  27499. if (0 !== a || 0 !== b) {
  27500. for (var c = this.Uf, d = new K(N), e = this.gd.j; e.next();) {
  27501. var g = e.value;
  27502. d.add((new N(g.x + a, g.y + b)).freeze())
  27503. }
  27504. d.freeze();
  27505. e = this.gd;
  27506. this.gd = d;
  27507. this.K();
  27508. c && Vr(this);
  27509. c = this.g;
  27510. null !== c && c.Ra.zc && (this.Hp = d);
  27511. this.i("points", e, d)
  27512. }
  27513. };
  27514. J.prototype.startRoute = J.prototype.Dm = function() { null === this.ef && (this.ef = this.gd, this.gd = this.gd.copy()) };
  27515. J.prototype.commitRoute = J.prototype.Ej = function() {
  27516. if (null !== this.ef) {
  27517. for (var a = this.ef, b = this.gd, c = Infinity, d = Infinity, e = a.o, g = e.length, h = 0; h < g; h++) var k = e[h],
  27518. c = Math.min(k.x, c),
  27519. d = Math.min(k.y, d);
  27520. for (var l = Infinity, m = Infinity, n = b.o, p = n.length, h = 0; h < p; h++) k = n[h], l = Math.min(k.x, l), m = Math.min(k.y, m), k.freeze();
  27521. b.freeze();
  27522. if (p === g)
  27523. for (h = 0; h < p; h++) {
  27524. if (g = e[h], k = n[h], g.x - c !== k.x - l || g.y - d !== k.y - m) {
  27525. this.K();
  27526. this.Te();
  27527. break
  27528. }
  27529. } else this.K(), this.Te();
  27530. this.ef = null;
  27531. c = this.g;
  27532. null !== c && c.Ra.zc && (this.Hp = b);
  27533. Vr(this);
  27534. this.i("points", a, b)
  27535. }
  27536. };
  27537. J.prototype.rollbackRoute = J.prototype.hK = function() { null !== this.ef && (this.gd = this.ef, this.ef = null) };
  27538. function Vr(a) { 0 === a.gd.count ? a.Uf = !1 : (a.Uf = !0, a.iq = a.m(0), a.jq = a.m(a.ta - 1), Wr(a, !1)) }
  27539. J.prototype.invalidateRoute = J.prototype.ec = function() {
  27540. if (!this.Ji) {
  27541. var a = this.g;
  27542. a && (a.ty.contains(this) || a.na.ub || a.Ra.vJ && !a.Ra.nf) || (a = this.path, null !== a && (this.Uf = !1, this.K(), a.K()))
  27543. }
  27544. };
  27545. D.defineProperty(J, { Uf: null }, function() { return 0 !== (this.gc & 16) }, function(a) { 0 !== (this.gc & 16) !== a && (this.gc ^= 16) });
  27546. D.defineProperty(J, { Ji: "suspendsRouting" }, function() { return 0 !== (this.gc & 32) }, function(a) { 0 !== (this.gc & 32) !== a && (this.gc ^= 32) });
  27547. D.defineProperty(J, { KA: null }, function() { return 0 !== (this.gc & 64) }, function(a) { 0 !== (this.gc & 64) !== a && (this.gc ^= 64) });
  27548. D.defineProperty(J, { iq: "defaultFromPoint" }, function() { return this.dD }, function(a) { this.dD = a.copy() });
  27549. D.defineProperty(J, { jq: "defaultToPoint" }, function() { return this.jD }, function(a) { this.jD = a.copy() });
  27550. J.prototype.updateRoute = J.prototype.zo = function() { if (!this.Uf && !this.KA) { var a = !0; try { this.KA = !0, this.Dm(), a = this.computePoints() } finally { this.KA = !1, a ? this.Ej() : this.hK() } } };
  27551. J.prototype.computePoints = function() {
  27552. var a = this.g;
  27553. if (null === a) return !1;
  27554. var b = this.$,
  27555. c = null;
  27556. null === b ? (a.Vl || (a.tt = new z, a.tt.Ea = Xd, a.tt.lb = 0, a.Vl = new G, a.Vl.add(a.tt), a.Vl.kf()), this.iq && (a.Vl.position = a.Vl.location = this.iq, a.Vl.kf(), b = a.Vl, c = a.tt)) : c = this.oc;
  27557. if (null !== c && !b.isVisible()) {
  27558. var d = b.findVisibleNode();
  27559. null !== d && d !== b ? (b = d, c = d.port) : b = d
  27560. }
  27561. this.zE = b;
  27562. if (null === b || !b.location.H()) return !1;
  27563. for (; !(null === c || c.aa.H() && c.Sj());) c = c.R;
  27564. if (null === c) return !1;
  27565. var e = this.ba,
  27566. g = null;
  27567. null === e ? (a.Wl || (a.ut =
  27568. new z, a.ut.Ea = Xd, a.ut.lb = 0, a.Wl = new G, a.Wl.add(a.ut), a.Wl.kf()), this.jq && (a.Wl.position = a.Wl.location = this.jq, a.Wl.kf(), e = a.Wl, g = a.ut)) : g = this.Gc;
  27569. null === g || e.isVisible() || (a = e.findVisibleNode(), null !== a && a !== e ? (e = a, g = a.port) : e = a);
  27570. this.AE = e;
  27571. if (null === e || !e.location.H()) return !1;
  27572. for (; !(null === g || g.aa.H() && g.Sj());) g = g.R;
  27573. if (null === g) return !1;
  27574. var h = this.ta,
  27575. d = this.computeSpot(!0, c),
  27576. a = this.computeSpot(!1, g),
  27577. k = d === dc,
  27578. l = a === dc,
  27579. m = c === g && null !== c,
  27580. n = this.ic,
  27581. p = this.jf === Uj;
  27582. this.$i = m && !n ? p = !0 : !1;
  27583. var q = this.Yp ===
  27584. vj || m;
  27585. if (!n && !m && k && l) {
  27586. if (k = !1, !q && 3 <= h && (q = this.getLinkPoint(b, c, d, !0, !1, e, g), l = this.getLinkPoint(e, g, a, !1, !1, b, c), k = this.adjustPoints(0, q, h - 1, l)) && (q = this.getLinkPoint(b, c, d, !0, !1, e, g), l = this.getLinkPoint(e, g, a, !1, !1, b, c), this.adjustPoints(0, q, h - 1, l)), !k)
  27587. if (this.dq(), p) {
  27588. var h = this.getLinkPoint(b, c, d, !0, !1, e, g),
  27589. q = this.getLinkPoint(e, g, a, !1, !1, b, c),
  27590. k = q.x - h.x,
  27591. l = q.y - h.y,
  27592. m = this.computeCurviness(),
  27593. p = n = 0,
  27594. r = h.x + k / 3,
  27595. s = h.y + l / 3,
  27596. u = r,
  27597. t = s;
  27598. Q(l, 0) ? t = 0 < k ? t - m : t + m : (n = -k / l, p = Math.sqrt(m * m / (n * n + 1)), 0 > m && (p = -p), u = (0 >
  27599. l ? -1 : 1) * p + r, t = n * (u - r) + s);
  27600. var r = h.x + 2 * k / 3,
  27601. s = h.y + 2 * l / 3,
  27602. y = r,
  27603. w = s;
  27604. Q(l, 0) ? w = 0 < k ? w - m : w + m : (y = (0 > l ? -1 : 1) * p + r, w = n * (y - r) + s);
  27605. this.dq();
  27606. this.Ci(h);
  27607. this.Bj(u, t);
  27608. this.Bj(y, w);
  27609. this.Ci(q);
  27610. this.gh(0, this.getLinkPoint(b, c, d, !0, !1, e, g));
  27611. this.gh(3, this.getLinkPoint(e, g, a, !1, !1, b, c))
  27612. } else d = this.getLinkPoint(b, c, d, !0, !1, e, g), a = this.getLinkPoint(e, g, a, !1, !1, b, c), this.hasCurviness() ? (q = a.x - d.x, e = a.y - d.y, g = this.computeCurviness(), b = d.x + q / 2, c = d.y + e / 2, h = b, k = c, Q(e, 0) ? k = 0 < q ? k - g : k + g : (q = -q / e, h = Math.sqrt(g * g / (q * q + 1)), 0 > g && (h = -h),
  27613. h = (0 > e ? -1 : 1) * h + b, k = q * (h - b) + c), this.Ci(d), this.Bj(h, k)) : this.Ci(d), this.Ci(a)
  27614. } else {
  27615. p = this.Nj;
  27616. q && (n && p || m) && this.dq();
  27617. var A = m ? this.computeCurviness() : 0,
  27618. p = this.getLinkPoint(b, c, d, !0, n, e, g),
  27619. r = u = s = 0;
  27620. if (n || !k || m)
  27621. if (t = this.computeEndSegmentLength(b, c, d, !0), r = this.getLinkDirection(b, c, p, d, !0, n, e, g), m && (k || d.O(a) || !n && 1 === d.x + a.x && 1 === d.y + a.y) && (r -= n ? 90 : 30, 0 > A && (r -= 180)), 0 > r ? r += 360 : 360 <= r && (r -= 360), m && (t += Math.abs(A) * (n ? 1 : 2)), 0 === r ? s = t : 90 === r ? u = t : 180 === r ? s = -t : 270 === r ? u = -t : (s = t * Math.cos(r * Math.PI / 180), u = t *
  27622. Math.sin(r * Math.PI / 180)), d.de() && m) {
  27623. var B = c.fb(mc, D.P()),
  27624. P = D.Fb(B.x + 1E3 * s, B.y + 1E3 * u);
  27625. this.getLinkPointFromPoint(b, c, B, P, !0, p);
  27626. D.A(B);
  27627. D.A(P)
  27628. }
  27629. var t = this.getLinkPoint(e, g, a, !1, n, b, c),
  27630. H = w = y = 0;
  27631. if (n || !l || m) B = this.computeEndSegmentLength(e, g, a, !1), H = this.getLinkDirection(e, g, t, a, !1, n, b, c), m && (l || d.O(a) || !n && 1 === d.x + a.x && 1 === d.y + a.y) && (H += n ? 0 : 30, 0 > A && (H += 180)), 0 > H ? H += 360 : 360 <= H && (H -= 360), m && (B += Math.abs(A) * (n ? 1 : 2)), 0 === H ? y = B : 90 === H ? w = B : 180 === H ? y = -B : 270 === H ? w = -B : (y = B * Math.cos(H * Math.PI / 180), w = B * Math.sin(H *
  27632. Math.PI / 180)), a.de() && m && (B = g.fb(mc, D.P()), P = D.Fb(B.x + 1E3 * y, B.y + 1E3 * w), this.getLinkPointFromPoint(e, g, B, P, !1, t), D.A(B), D.A(P));
  27633. a = p;
  27634. if (n || !k || m) a = new N(p.x + s, p.y + u);
  27635. d = t;
  27636. if (n || !l || m) d = new N(t.x + y, t.y + w);
  27637. !q && !n && k && 3 < h && this.adjustPoints(0, p, h - 2, d) ? this.gh(h - 1, t) : !q && !n && l && 3 < h && this.adjustPoints(1, a, h - 1, t) ? this.gh(0, p) : !q && (n ? 6 <= h : 4 < h) && this.adjustPoints(1, a, h - 2, d) ? (this.gh(0, p), this.gh(h - 1, t)) : (this.dq(), this.Ci(p), (n || !k || m) && this.Ci(a), n && this.addOrthoPoints(a, r, d, H, b, e), (n || !l || m) && this.Ci(d), this.Ci(t))
  27638. }
  27639. return !0
  27640. };
  27641. function Xr(a, b) { Math.abs(b.x - a.x) > Math.abs(b.y - a.y) ? (b.x = b.x >= a.x ? a.x + 9E9 : a.x - 9E9, b.y = a.y) : (b.y = b.y >= a.y ? a.y + 9E9 : a.y - 9E9, b.x = a.x); return b }
  27642. J.prototype.getLinkPointFromPoint = function(a, b, c, d, e, g) {
  27643. void 0 === g && (g = new N);
  27644. if (null === a || null === b) return g.assign(c), g;
  27645. a.isVisible() || (e = a.findVisibleNode(), null !== e && e !== a && (b = e.port));
  27646. var h = e = 0,
  27647. k = 0,
  27648. l = 0;
  27649. a = null;
  27650. e = b.R;
  27651. null === e || e.kh() || (e = e.R);
  27652. if (null === e) e = d.x, h = d.y, k = c.x, l = c.y;
  27653. else {
  27654. a = e.Hh;
  27655. e = 1 / (a.m11 * a.m22 - a.m12 * a.m21);
  27656. var k = a.m22 * e,
  27657. l = -a.m12 * e,
  27658. m = -a.m21 * e,
  27659. n = a.m11 * e,
  27660. p = e * (a.m21 * a.dy - a.m22 * a.dx),
  27661. q = e * (a.m12 * a.dx - a.m11 * a.dy);
  27662. e = d.x * k + d.y * m + p;
  27663. h = d.x * l + d.y * n + q;
  27664. k = c.x * k + c.y * m + p;
  27665. l = c.x * l + c.y * n + q
  27666. }
  27667. b.Tn(e, h, k, l,
  27668. g);
  27669. null !== a && g.transform(a);
  27670. return g
  27671. };
  27672. function Yr(a, b) {
  27673. var c = b.jt;
  27674. null === c && (c = new Zr, c.port = b, c.Zc = b.Y, b.jt = c);
  27675. return $r(c, a)
  27676. }
  27677. J.prototype.getLinkPoint = function(a, b, c, d, e, g, h, k) {
  27678. void 0 === k && (k = new N);
  27679. if (c.Xc()) return b.fb(c, k), k;
  27680. if (c.Pj()) {
  27681. var l = Yr(this, b);
  27682. if (null !== l) {
  27683. k.assign(l.Eq);
  27684. if (e && this.My === Pr) {
  27685. var m = Yr(this, h);
  27686. if (null !== m && l.Ln < m.Ln) {
  27687. var l = D.P(),
  27688. m = D.P(),
  27689. n = new C(b.fb(ec, l), b.fb(vc, m)),
  27690. p = this.computeSpot(!d, h);
  27691. a = this.getLinkPoint(g, h, p, !d, e, a, b, m);
  27692. (c.Mj(xc) || c.Mj(yc)) && a.y >= n.y && a.y <= n.y + n.height ? k.y = a.y : (c.Mj(wc) || c.Mj(Dc)) && a.x >= n.x && a.x <= n.x + n.width && (k.x = a.x);
  27693. D.A(l);
  27694. D.A(m)
  27695. }
  27696. }
  27697. return k
  27698. }
  27699. }
  27700. c = b.fb(mc, D.P());
  27701. l = g = null;
  27702. this.ta > (e ? 6 : 2) ? (l = d ? this.m(1) : this.m(this.ta - 2), e && (l = Xr(c, l.copy()))) : (g = D.P(), l = h.fb(mc, g), e && (l = Xr(c, l)), D.A(g));
  27703. this.getLinkPointFromPoint(a, b, c, l, d, k);
  27704. D.A(c);
  27705. return k
  27706. };
  27707. J.prototype.getLinkDirection = function(a, b, c, d, e, g, h, k) {
  27708. a: if (d.Xc()) c = d.x > d.y ? d.x > 1 - d.y ? 0 : d.x < 1 - d.y ? 270 : 315 : d.x < d.y ? d.x > 1 - d.y ? 90 : d.x < 1 - d.y ? 180 : 135 : .5 > d.x ? 225 : .5 < d.x ? 45 : 0;
  27709. else {
  27710. if (d.Pj()) {
  27711. var l = Yr(this, b);
  27712. if (null !== l) switch (l.Le) {
  27713. case D.Ad:
  27714. c = 270;
  27715. break a;
  27716. case D.bd:
  27717. c = 180;
  27718. break a;
  27719. default:
  27720. case D.rd:
  27721. c = 0;
  27722. break a;
  27723. case D.qd:
  27724. c = 90;
  27725. break a
  27726. }
  27727. }
  27728. var l = b.fb(mc, D.P()),
  27729. m = null,
  27730. n = null;
  27731. this.ta > (g ? 6 : 2) ? (n = e ? this.m(1) : this.m(this.ta - 2), n = g ? Xr(l, n.copy()) : c) : (m = D.P(), n = k.fb(mc, m), D.A(m));
  27732. c = 0;
  27733. c = Math.abs(n.x - l.x) > Math.abs(n.y -
  27734. l.y) ? n.x >= l.x ? 0 : 180 : n.y >= l.y ? 90 : 270;
  27735. D.A(l)
  27736. }d.de() && h.Fi(a) && (c += 180, 360 <= c && (c -= 360));a = yr;a = e ? this.zu : this.uv;a === yr && (a = e ? b.zu : b.uv);
  27737. switch (a) {
  27738. case zr:
  27739. b = b.sm();
  27740. c += b;
  27741. 360 <= c && (c -= 360);
  27742. break;
  27743. case yr:
  27744. case Fo:
  27745. if (d.sJ()) break;
  27746. b = b.sm();
  27747. if (0 === b) break;
  27748. 45 <= b && 135 > b ? c += 90 : 135 <= b && 225 > b ? c += 180 : 225 <= b && 315 > b && (c += 270);
  27749. 360 <= c && (c -= 360)
  27750. }
  27751. return c
  27752. };
  27753. J.prototype.computeEndSegmentLength = function(a, b, c, d) {
  27754. if (null !== b && c.Pj() && (a = Yr(this, b), null !== a)) return a.Sx;
  27755. a = NaN;
  27756. a = d ? this.rm : this.Hm;
  27757. null !== b && isNaN(a) && (a = d ? b.rm : b.Hm);
  27758. isNaN(a) && (a = 10);
  27759. return a
  27760. };
  27761. J.prototype.computeSpot = function(a, b) {
  27762. var c;
  27763. if (a)
  27764. if (c = b ? b : this.oc, null === c) c = mc;
  27765. else {
  27766. var d = this.Gb;
  27767. d.ld() && null !== c && (d = c.Gb);
  27768. c = d === Vc ? dc : d
  27769. }
  27770. else c = b ? b : this.Gc, null === c ? c = mc : (d = this.Hb, d.ld() && null !== c && (d = c.Hb), c = d === Vc ? dc : d);
  27771. return c
  27772. };
  27773. J.prototype.computeOtherPoint = function(a, b) {
  27774. var c = b.fb(mc),
  27775. d;
  27776. d = b.jt;
  27777. d = null !== d ? $r(d, this) : null;
  27778. null !== d && (c = d.Eq);
  27779. return c
  27780. };
  27781. J.prototype.computeShortLength = function(a) {
  27782. if (a) {
  27783. if (a = this.Au, isNaN(a)) {
  27784. var b = this.oc;
  27785. null !== b && (a = b.Au)
  27786. }
  27787. } else a = this.vv, isNaN(a) && (b = this.Gc, null !== b && (a = b.vv));
  27788. return isNaN(a) ? 0 : a
  27789. };
  27790. J.prototype.Xk = function(a, b, c, d, e, g) {
  27791. if (!1 === this.tg) return !1;
  27792. void 0 === b && (b = null);
  27793. void 0 === c && (c = null);
  27794. var h = g;
  27795. void 0 === g && (h = D.hh(), h.reset());
  27796. h.multiply(this.transform);
  27797. if (this.In(a, h)) return gq(this, b, c, e), void 0 === g && D.lf(h), !0;
  27798. if (this.jg(a, h)) {
  27799. var k = !1;
  27800. if (!this.Yn)
  27801. for (var l = this.xa.o, m = l.length; m--;) {
  27802. var n = l[m];
  27803. if (n.visible || n === this.Bf) {
  27804. var p = n.aa,
  27805. q = this.Ga;
  27806. if (!(p.x > q.width || p.y > q.height || 0 > p.x + p.width || 0 > p.y + p.height)) {
  27807. p = D.hh();
  27808. p.set(h);
  27809. if (n instanceof x) k = n.Xk(a, b, c, d, e, p);
  27810. else if (this.path ===
  27811. n) {
  27812. if (n instanceof z) {
  27813. var k = n,
  27814. r = a,
  27815. s = d,
  27816. q = p;
  27817. if (!1 === k.tg) k = !1;
  27818. else if (q.multiply(k.transform), s) b: {
  27819. var u = r,
  27820. t = q;
  27821. if (k.In(u, t)) k = !0;
  27822. else {
  27823. if (void 0 === t && (t = k.transform, u.Sk(k.aa))) { k = !0; break b }
  27824. var q = u.left,
  27825. r = u.right,
  27826. s = u.top,
  27827. u = u.bottom,
  27828. y = D.P(),
  27829. w = D.P(),
  27830. A = D.P(),
  27831. B = D.hh();
  27832. B.set(t);
  27833. B.GB(k.transform);
  27834. B.pB();
  27835. w.x = r;
  27836. w.y = s;
  27837. w.transform(B);
  27838. y.x = q;
  27839. y.y = s;
  27840. y.transform(B);
  27841. t = !1;
  27842. tq(k, y, w, A) ? t = !0 : (y.x = r, y.y = u, y.transform(B), tq(k, y, w, A) ? t = !0 : (w.x = q, w.y = u, w.transform(B), tq(k, y, w, A) ? t = !0 : (y.x = q, y.y = s, y.transform(B), tq(k, y, w, A) &&
  27843. (t = !0))));
  27844. D.lf(B);
  27845. D.A(y);
  27846. D.A(w);
  27847. D.A(A);
  27848. k = t
  27849. }
  27850. }
  27851. else k = k.In(r, q)
  27852. }
  27853. } else k = Lo(n, a, d, p);
  27854. k && (null !== b && (n = b(n)), n && (null === c || c(n)) && (e instanceof L && e.add(n), e instanceof K && e.add(n)));
  27855. D.lf(p)
  27856. }
  27857. }
  27858. }
  27859. void 0 === g && D.lf(h);
  27860. return k || null !== this.background || null !== this.gm
  27861. }
  27862. void 0 === g && D.lf(h);
  27863. return !1
  27864. };
  27865. D.w(J, { ic: "isOrthogonal" }, function() { return 2 === (this.on.value & 2) });
  27866. D.w(J, { Nj: "isAvoiding" }, function() { return 4 === (this.on.value & 4) });
  27867. J.prototype.computeCurve = function() {
  27868. if (null === this.$i) {
  27869. var a = this.oc,
  27870. b = this.ic;
  27871. this.$i = null !== a && a === this.Gc && !b
  27872. }
  27873. return this.$i ? Uj : this.jf
  27874. };
  27875. J.prototype.computeCorner = function() { if (this.jf === Uj) return 0; var a = this.QA; if (isNaN(a) || 0 > a) a = 10; return a };
  27876. J.prototype.findMidLabel = function() {
  27877. for (var a = this.path, b = this.xa.o, c = b.length, d = 0; d < c; d++) { var e = b[d]; if (e !== a && !e.Ue && (-Infinity === e.We || isNaN(e.We))) return e }
  27878. for (a = this.Af; a.next();)
  27879. if (b = a.value, -Infinity === b.We || isNaN(b.We)) return b;
  27880. return null
  27881. };
  27882. J.prototype.computeSpacing = function() {
  27883. if (!this.isVisible()) return 0;
  27884. var a;
  27885. a = Math.max(14, this.computeThickness());
  27886. var b = this.oc,
  27887. c = this.Gc;
  27888. if (null !== b && null !== c) {
  27889. var d = this.findMidLabel();
  27890. if (null !== d) {
  27891. var e = d.Ga,
  27892. g = d.margin,
  27893. h = isNaN(e.width) ? 30 : e.width * d.scale + g.left + g.right,
  27894. e = isNaN(e.height) ? 14 : e.height * d.scale + g.top + g.bottom,
  27895. d = d.Uq;
  27896. d === wq || d === Rr || d === Qr ? a = Math.max(a, e) : d === Zp || d === $p || d === Xp || d === Yp ? a = Math.max(a, h) : (b = b.fb(mc).Wb(c.fb(mc)) / 180 * Math.PI, a = Math.max(a, Math.abs(Math.sin(b) * h) + Math.abs(Math.cos(b) *
  27897. e) + 1));
  27898. this.jf === Uj && (a *= 1.333)
  27899. }
  27900. }
  27901. return a
  27902. };
  27903. J.prototype.arrangeBundledLinks = function(a, b) {
  27904. if (b)
  27905. for (var c = 0; c < a.length; c++) {
  27906. var d = a[c];
  27907. d.Yp === vj && d.ec()
  27908. }
  27909. };
  27910. J.prototype.computeCurviness = function() {
  27911. var a = this.Nx;
  27912. if (isNaN(a)) {
  27913. var a = 16,
  27914. b = this.Oi;
  27915. if (null !== b) {
  27916. for (var c = D.mb(), d = 0, e = b.links, g = 0; g < e.length; g++) {
  27917. var h = e[g],
  27918. h = h.computeSpacing();
  27919. c.push(h);
  27920. d += h
  27921. }
  27922. d = -d / 2;
  27923. for (g = 0; g < e.length; g++) {
  27924. h = e[g];
  27925. if (h === this) { a = d + c[g] / 2; break }
  27926. d += c[g]
  27927. }
  27928. b.Hq === this.$ && (a = -a);
  27929. D.ya(c)
  27930. }
  27931. }
  27932. return a
  27933. };
  27934. J.prototype.computeThickness = function() { if (!this.isVisible()) return 0; var a = this.path; return null !== a ? Math.max(a.lb, 1) : 1 };
  27935. J.prototype.hasCurviness = function() { return !isNaN(this.Nx) || null !== this.Oi };
  27936. J.prototype.adjustPoints = function(a, b, c, d) {
  27937. var e = this.Yp;
  27938. if (this.ic) {
  27939. if (e === Nr) return !1;
  27940. e === Or && (e = Mr)
  27941. }
  27942. switch (e) {
  27943. case Nr:
  27944. var g = this.m(a),
  27945. h = this.m(c);
  27946. if (!g.Wc(b) || !h.Wc(d)) {
  27947. var e = g.x,
  27948. g = g.y,
  27949. k = h.x - e,
  27950. l = h.y - g,
  27951. m = Math.sqrt(k * k + l * l);
  27952. if (!Eb(m, 0)) {
  27953. var n = 0;
  27954. Eb(k, 0) ? n = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (n = Math.atan(l / Math.abs(k)), 0 > k && (n = Math.PI - n));
  27955. var h = b.x,
  27956. p = b.y,
  27957. l = d.x - h,
  27958. q = d.y - p,
  27959. r = Math.sqrt(l * l + q * q),
  27960. k = 0;
  27961. Eb(l, 0) ? k = 0 > q ? -Math.PI / 2 : Math.PI / 2 : (k = Math.atan(q / Math.abs(l)), 0 > l && (k = Math.PI - k));
  27962. m = r / m;
  27963. n = k - n;
  27964. this.gh(a, b);
  27965. for (a +=
  27966. 1; a < c; a++) b = this.m(a), k = b.x - e, l = b.y - g, b = Math.sqrt(k * k + l * l), Eb(b, 0) || (q = 0, Eb(k, 0) ? q = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (q = Math.atan(l / Math.abs(k)), 0 > k && (q = Math.PI - q)), k = q + n, b *= m, this.ia(a, h + b * Math.cos(k), p + b * Math.sin(k)));
  27967. this.gh(c, d)
  27968. }
  27969. }
  27970. return !0;
  27971. case Or:
  27972. g = this.m(a);
  27973. p = this.m(c);
  27974. if (!g.Wc(b) || !p.Wc(d)) {
  27975. var e = g.x,
  27976. g = g.y,
  27977. h = p.x,
  27978. p = p.y,
  27979. m = (h - e) * (h - e) + (p - g) * (p - g),
  27980. k = b.x,
  27981. n = b.y,
  27982. l = d.x,
  27983. q = d.y,
  27984. r = 0,
  27985. s = 1;
  27986. 0 !== l - k ? (r = (q - n) / (l - k), s = Math.sqrt(1 + 1 / (r * r))) : r = 9E9;
  27987. this.gh(a, b);
  27988. for (a += 1; a < c; a++) {
  27989. b = this.m(a);
  27990. var u = b.x,
  27991. t = b.y,
  27992. y = .5;
  27993. 0 !== m && (y =
  27994. ((e - u) * (e - h) + (g - t) * (g - p)) / m);
  27995. var w = e + y * (h - e),
  27996. A = g + y * (p - g);
  27997. b = Math.sqrt((u - w) * (u - w) + (t - A) * (t - A));
  27998. t < r * (u - w) + A && (b = -b);
  27999. 0 < r && (b = -b);
  28000. u = k + y * (l - k);
  28001. y = n + y * (q - n);
  28002. 0 !== r ? (b = u + b / s, this.ia(a, b, y - (b - u) / r)) : this.ia(a, u, y + b)
  28003. }
  28004. this.gh(c, d)
  28005. }
  28006. return !0;
  28007. case Mr:
  28008. a: {
  28009. if (this.ic && (e = this.m(a), g = this.m(a + 1), h = this.m(a + 2), k = g.x, n = g.y, p = k, m = n, Q(e.y, g.y) ? Q(g.x, h.x) ? n = b.y : Q(g.y, h.y) && (k = b.x) : Q(e.x, g.x) && (Q(g.y, h.y) ? k = b.x : Q(g.x, h.x) && (n = b.y)), this.ia(a + 1, k, n), e = this.m(c), g = this.m(c - 1), h = this.m(c - 2), k = g.x, n = g.y, l = k, q = n, Q(e.y, g.y) ? Q(g.x,
  28010. h.x) ? n = d.y : Q(g.y, h.y) && (k = d.x) : Q(e.x, g.x) && (Q(g.y, h.y) ? k = d.x : Q(g.x, h.x) && (n = d.y)), this.ia(c - 1, k, n), Mi(this))) {
  28011. this.ia(a + 1, p, m);
  28012. this.ia(c - 1, l, q);
  28013. c = !1;
  28014. break a
  28015. }
  28016. this.gh(a, b);this.gh(c, d);c = !0
  28017. }
  28018. return c;
  28019. default:
  28020. return !1
  28021. }
  28022. };
  28023. J.prototype.addOrthoPoints = function(a, b, c, d, e, g) {
  28024. b = -45 <= b && 45 > b ? 0 : 45 <= b && 135 > b ? 90 : 135 <= b && 225 > b ? 180 : 270;
  28025. d = -45 <= d && 45 > d ? 0 : 45 <= d && 135 > d ? 90 : 135 <= d && 225 > d ? 180 : 270;
  28026. var h = e.aa.copy(),
  28027. k = g.aa.copy();
  28028. if (h.H() && k.H()) {
  28029. h.ig(8, 8);
  28030. k.ig(8, 8);
  28031. h.Mi(a);
  28032. k.Mi(c);
  28033. var l, m;
  28034. if (0 === b)
  28035. if (c.x > a.x || 270 === d && c.y < a.y && k.right > a.x || 90 === d && c.y > a.y && k.right > a.x) l = new N(c.x, a.y), m = new N(c.x, (a.y + c.y) / 2), 180 === d ? (l.x = this.computeMidOrthoPosition(a.x, c.x, !1), m.x = l.x, m.y = c.y) : 270 === d && c.y < a.y || 90 === d && c.y > a.y ? (l.x = a.x < k.left ? this.computeMidOrthoPosition(a.x,
  28036. k.left, !1) : a.x < k.right && (270 === d && a.y < k.top || 90 === d && a.y > k.bottom) ? this.computeMidOrthoPosition(a.x, c.x, !1) : k.right, m.x = l.x, m.y = c.y) : 0 === d && a.x < k.left && a.y > k.top && a.y < k.bottom && (l.x = a.x, l.y = a.y < c.y ? Math.min(c.y, k.top) : Math.max(c.y, k.bottom), m.y = l.y);
  28037. else {
  28038. l = new N(a.x, c.y);
  28039. m = new N((a.x + c.x) / 2, c.y);
  28040. if (180 === d || 90 === d && c.y < h.top || 270 === d && c.y > h.bottom) 180 === d && (k.Pa(a) || h.Pa(c)) ? l.y = this.computeMidOrthoPosition(a.y, c.y, !0) : c.y < a.y && (180 === d || 90 === d) ? l.y = this.computeMidOrthoPosition(h.top, Math.max(c.y,
  28041. k.bottom), !0) : c.y > a.y && (180 === d || 270 === d) && (l.y = this.computeMidOrthoPosition(h.bottom, Math.min(c.y, k.top), !0)), m.x = c.x, m.y = l.y;
  28042. if (l.y > h.top && l.y < h.bottom)
  28043. if (c.x >= h.left && c.x <= a.x || a.x <= k.right && a.x >= c.x) { if (90 === d || 270 === d) l = new N(Math.max((a.x + c.x) / 2, a.x), a.y), m = new N(l.x, c.y) } else l.y = 270 === d || (0 === d || 180 === d) && c.y < a.y ? Math.min(c.y, 0 === d ? h.top : Math.min(h.top, k.top)) : Math.max(c.y, 0 === d ? h.bottom : Math.max(h.bottom, k.bottom)), m.x = c.x, m.y = l.y
  28044. }
  28045. else if (180 === b)
  28046. if (c.x < a.x || 270 === d && c.y < a.y && k.left < a.x ||
  28047. 90 === d && c.y > a.y && k.left < a.x) l = new N(c.x, a.y), m = new N(c.x, (a.y + c.y) / 2), 0 === d ? (l.x = this.computeMidOrthoPosition(a.x, c.x, !1), m.x = l.x, m.y = c.y) : 270 === d && c.y < a.y || 90 === d && c.y > a.y ? (l.x = a.x > k.right ? this.computeMidOrthoPosition(a.x, k.right, !1) : a.x > k.left && (270 === d && a.y < k.top || 90 === d && a.y > k.bottom) ? this.computeMidOrthoPosition(a.x, c.x, !1) : k.left, m.x = l.x, m.y = c.y) : 180 === d && a.x > k.right && a.y > k.top && a.y < k.bottom && (l.x = a.x, l.y = a.y < c.y ? Math.min(c.y, k.top) : Math.max(c.y, k.bottom), m.y = l.y);
  28048. else {
  28049. l = new N(a.x, c.y);
  28050. m = new N((a.x +
  28051. c.x) / 2, c.y);
  28052. if (0 === d || 90 === d && c.y < h.top || 270 === d && c.y > h.bottom) 0 === d && (k.Pa(a) || h.Pa(c)) ? l.y = this.computeMidOrthoPosition(a.y, c.y, !0) : c.y < a.y && (0 === d || 90 === d) ? l.y = this.computeMidOrthoPosition(h.top, Math.max(c.y, k.bottom), !0) : c.y > a.y && (0 === d || 270 === d) && (l.y = this.computeMidOrthoPosition(h.bottom, Math.min(c.y, k.top), !0)), m.x = c.x, m.y = l.y;
  28053. if (l.y > h.top && l.y < h.bottom)
  28054. if (c.x <= h.right && c.x >= a.x || a.x >= k.left && a.x <= c.x) { if (90 === d || 270 === d) l = new N(Math.min((a.x + c.x) / 2, a.x), a.y), m = new N(l.x, c.y) } else l.y = 270 ===
  28055. d || (0 === d || 180 === d) && c.y < a.y ? Math.min(c.y, 180 === d ? h.top : Math.min(h.top, k.top)) : Math.max(c.y, 180 === d ? h.bottom : Math.max(h.bottom, k.bottom)), m.x = c.x, m.y = l.y
  28056. }
  28057. else if (90 === b)
  28058. if (c.y > a.y || 180 === d && c.x < a.x && k.bottom > a.y || 0 === d && c.x > a.x && k.bottom > a.y) l = new N(a.x, c.y), m = new N((a.x + c.x) / 2, c.y), 270 === d ? (l.y = this.computeMidOrthoPosition(a.y, c.y, !0), m.x = c.x, m.y = l.y) : 180 === d && c.x < a.x || 0 === d && c.x > a.x ? (l.y = a.y < k.top ? this.computeMidOrthoPosition(a.y, k.top, !0) : a.y < k.bottom && (180 === d && a.x < k.left || 0 === d && a.x > k.right) ?
  28059. this.computeMidOrthoPosition(a.y, c.y, !0) : k.bottom, m.x = c.x, m.y = l.y) : 90 === d && a.y < k.top && a.x > k.left && a.x < k.right && (l.x = a.x < c.x ? Math.min(c.x, k.left) : Math.max(c.x, k.right), l.y = a.y, m.x = l.x);
  28060. else {
  28061. l = new N(c.x, a.y);
  28062. m = new N(c.x, (a.y + c.y) / 2);
  28063. if (270 === d || 0 === d && c.x < h.left || 180 === d && c.x > h.right) 270 === d && (k.Pa(a) || h.Pa(c)) ? l.x = this.computeMidOrthoPosition(a.x, c.x, !1) : c.x < a.x && (270 === d || 0 === d) ? l.x = this.computeMidOrthoPosition(h.left, Math.max(c.x, k.right), !1) : c.x > a.x && (270 === d || 180 === d) && (l.x = this.computeMidOrthoPosition(h.right,
  28064. Math.min(c.x, k.left), !1)), m.x = l.x, m.y = c.y;
  28065. if (l.x > h.left && l.x < h.right)
  28066. if (c.y >= h.top && c.y <= a.y || a.y <= k.bottom && a.y >= c.y) { if (0 === d || 180 === d) l = new N(a.x, Math.max((a.y + c.y) / 2, a.y)), m = new N(c.x, l.y) } else l.x = 180 === d || (90 === d || 270 === d) && c.x < a.x ? Math.min(c.x, 90 === d ? h.left : Math.min(h.left, k.left)) : Math.max(c.x, 90 === d ? h.right : Math.max(h.right, k.right)), m.x = l.x, m.y = c.y
  28067. }
  28068. else if (c.y < a.y || 180 === d && c.x < a.x && k.top < a.y || 0 === d && c.x > a.x && k.top < a.y) l = new N(a.x, c.y), m = new N((a.x + c.x) / 2, c.y), 90 === d ? (l.y = this.computeMidOrthoPosition(a.y,
  28069. c.y, !0), m.x = c.x, m.y = l.y) : 180 === d && c.x < a.x || 0 === d && c.x >= a.x ? (l.y = a.y > k.bottom ? this.computeMidOrthoPosition(a.y, k.bottom, !0) : a.y > k.top && (180 === d && a.x < k.left || 0 === d && a.x > k.right) ? this.computeMidOrthoPosition(a.y, c.y, !0) : k.top, m.x = c.x, m.y = l.y) : 270 === d && a.y > k.bottom && a.x > k.left && a.x < k.right && (l.x = a.x < c.x ? Math.min(c.x, k.left) : Math.max(c.x, k.right), l.y = a.y, m.x = l.x);
  28070. else {
  28071. l = new N(c.x, a.y);
  28072. m = new N(c.x, (a.y + c.y) / 2);
  28073. if (90 === d || 0 === d && c.x < h.left || 180 === d && c.x > h.right) 90 === d && (k.Pa(a) || h.Pa(c)) ? l.x = this.computeMidOrthoPosition(a.x,
  28074. c.x, !1) : c.x < a.x && (90 === d || 0 === d) ? l.x = this.computeMidOrthoPosition(h.left, Math.max(c.x, k.right), !1) : c.x > a.x && (90 === d || 180 === d) && (l.x = this.computeMidOrthoPosition(h.right, Math.min(c.x, k.left), !1)), m.x = l.x, m.y = c.y;
  28075. if (l.x > h.left && l.x < h.right)
  28076. if (c.y <= h.bottom && c.y >= a.y || a.y >= k.top && a.y <= c.y) { if (0 === d || 180 === d) l = new N(a.x, Math.min((a.y + c.y) / 2, a.y)), m = new N(c.x, l.y) } else l.x = 180 === d || (90 === d || 270 === d) && c.x < a.x ? Math.min(c.x, 270 === d ? h.left : Math.min(h.left, k.left)) : Math.max(c.x, 270 === d ? h.right : Math.max(h.right,
  28077. k.right)), m.x = l.x, m.y = c.y
  28078. }
  28079. var n = l,
  28080. p = m;
  28081. if (this.Nj) {
  28082. var q = this.g,
  28083. r;
  28084. (r = null === q) || (q.Ra.nf ? r = !1 : (r = q.eb, r = r instanceof Uh ? !r.nx || r.mJ : !0), r = !r);
  28085. if (r || h.Pa(c) && !g.Fi(e) || k.Pa(a) && !e.Fi(g) || e === g || this.layer.Yc) b = !1;
  28086. else {
  28087. var s = ha(q, !0, this.Ka, null);
  28088. if (s.Dq(Math.min(a.x, n.x), Math.min(a.y, n.y), Math.abs(a.x - n.x), Math.abs(a.y - n.y)) && s.Dq(Math.min(n.x, p.x), Math.min(n.y, p.y), Math.abs(n.x - p.x), Math.abs(n.y - p.y)) && s.Dq(Math.min(p.x, c.x), Math.min(p.y, c.y), Math.abs(p.x - c.x), Math.abs(p.y - c.y))) b = !1;
  28089. else {
  28090. e = a;
  28091. g = c;
  28092. var u = r = null;
  28093. if (q.uB) {
  28094. q = s.pb.copy();
  28095. q.ig(-s.cq, -s.aq);
  28096. var t = D.P();
  28097. as(s, a.x, a.y) || (Je(q.x, q.y, q.x + q.width, q.y + q.height, a.x, a.y, n.x, n.y, t) ? (r = a = t.copy(), b = t.Wb(n)) : Je(q.x, q.y, q.x + q.width, q.y + q.height, n.x, n.y, p.x, p.y, t) ? (r = a = t.copy(), b = t.Wb(p)) : Je(q.x, q.y, q.x + q.width, q.y + q.height, p.x, p.y, c.x, c.y, t) && (r = a = t.copy(), b = t.Wb(c)));
  28098. as(s, c.x, c.y) || (Je(q.x, q.y, q.x + q.width, q.y + q.height, c.x, c.y, p.x, p.y, t) ? (u = c = t.copy(), d = p.Wb(t)) : Je(q.x, q.y, q.x + q.width, q.y + q.height, p.x, p.y, n.x, n.y, t) ? (u = c = t.copy(), d = n.Wb(t)) : Je(q.x,
  28099. q.y, q.x + q.width, q.y + q.height, n.x, n.y, a.x, a.y, t) && (u = c = t.copy(), d = a.Wb(t)));
  28100. D.A(t)
  28101. }
  28102. h = h.copy().Zh(k);
  28103. k = s.fH;
  28104. h.ig(s.cq * k, s.aq * k);
  28105. bs(s, a, b, c, d, h);
  28106. k = cs(s, c.x, c.y);
  28107. !s.abort && 999999 <= k && (Pn(s), k = s.rG, h.ig(s.cq * k, s.aq * k), bs(s, a, b, c, d, h), k = cs(s, c.x, c.y));
  28108. !s.abort && 999999 <= k && s.xH && (Pn(s), bs(s, a, b, c, d, s.pb), k = cs(s, c.x, c.y));
  28109. if (!s.abort && 999999 > k && 0 !== cs(s, c.x, c.y)) {
  28110. ds(this, s, c.x, c.y, d, !0);
  28111. h = this.m(2);
  28112. if (4 > this.ta) 0 === b || 180 === b ? (h.x = a.x, h.y = c.y) : (h.x = c.x, h.y = a.y), this.ia(2, h.x, h.y), this.B(3, h.x, h.y);
  28113. else if (c =
  28114. this.m(3), 0 === b || 180 === b) Q(h.x, c.x) ? (h = 0 === b ? Math.max(h.x, a.x) : Math.min(h.x, a.x), this.ia(2, h, a.y), this.ia(3, h, c.y)) : Q(h.y, c.y) ? (Math.abs(a.y - h.y) <= s.aq / 2 && (this.ia(2, h.x, a.y), this.ia(3, c.x, a.y)), this.B(2, h.x, a.y)) : this.ia(2, a.x, h.y);
  28115. else if (90 === b || 270 === b) Q(h.y, c.y) ? (h = 90 === b ? Math.max(h.y, a.y) : Math.min(h.y, a.y), this.ia(2, a.x, h), this.ia(3, c.x, h)) : Q(h.x, c.x) ? (Math.abs(a.x - h.x) <= s.cq / 2 && (this.ia(2, a.x, h.y), this.ia(3, a.x, c.y)), this.B(2, a.x, h.y)) : this.ia(2, h.x, a.y);
  28116. null !== r && (a = this.m(1), c = this.m(2),
  28117. a.x !== c.x && a.y !== c.y ? 0 === b || 180 === b ? this.B(2, a.x, c.y) : this.B(2, c.x, a.y) : 0 === b || 180 === b ? this.B(2, e.x, r.y) : this.B(2, r.x, e.y));
  28118. null !== u && (0 === d || 180 === d ? this.Bj(g.x, u.y) : this.Bj(u.x, g.y));
  28119. b = !0
  28120. } else b = !1
  28121. }
  28122. }
  28123. } else b = !1;
  28124. b || (this.Ci(l), this.Ci(m))
  28125. }
  28126. };
  28127. J.prototype.computeMidOrthoPosition = function(a, b) { if (this.hasCurviness()) { var c = this.computeCurviness(); return (a + b) / 2 + c } return (a + b) / 2 };
  28128. function Mi(a) {
  28129. if (null === a.g || !a.Nj) return !1;
  28130. var b = a.points.o,
  28131. c = b.length;
  28132. if (4 > c) return !1;
  28133. a = ha(a.g, !0, a.Ka, null);
  28134. for (var d = 1; d < c - 2; d++) {
  28135. var e = b[d],
  28136. g = b[d + 1];
  28137. if (!a.Dq(Math.min(e.x, g.x), Math.min(e.y, g.y), Math.abs(e.x - g.x), Math.abs(e.y - g.y))) return !0
  28138. }
  28139. return !1
  28140. }
  28141. function ds(a, b, c, d, e, g) {
  28142. var h = b.cq,
  28143. k = b.aq,
  28144. l = cs(b, c, d),
  28145. m = c,
  28146. n = d;
  28147. for (0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k; 1 < l && cs(b, m, n) === l - 1;) c = m, d = n, 0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k, l -= 1;
  28148. if (g) {
  28149. if (1 < l)
  28150. if (180 === e || 0 === e) c = Math.floor(c / h) * h + h / 2;
  28151. else if (90 === e || 270 === e) d = Math.floor(d / k) * k + k / 2
  28152. } else c = Math.floor(c / h) * h + h / 2, d = Math.floor(d / k) * k + k / 2;
  28153. 1 < l && (g = e, m = c, n = d, 0 === e ? (g = 90, n += k) : 90 === e ? (g = 180, m -= h) : 180 === e ? (g = 270, n -= k) : 270 === e && (g = 0, m += h), cs(b, m, n) === l - 1 ? ds(a, b, m, n, g, !1) : (m = c, n = d, 0 === e ? (g = 270, n -= k) : 90 ===
  28154. e ? (g = 0, m += h) : 180 === e ? (g = 90, n += k) : 270 === e && (g = 180, m -= h), cs(b, m, n) === l - 1 && ds(a, b, m, n, g, !1)));
  28155. a.Bj(c, d)
  28156. }
  28157. J.prototype.findClosestSegment = function(a) {
  28158. v && D.l(a, N, J, "findClosestSegment:p");
  28159. var b = a.x;
  28160. a = a.y;
  28161. for (var c = this.m(0), d = this.m(1), e = lb(b, a, c.x, c.y, d.x, d.y), g = 0, h = 1; h < this.ta - 1; h++) {
  28162. var c = this.m(h + 1),
  28163. k = lb(b, a, d.x, d.y, c.x, c.y),
  28164. d = c;
  28165. k < e && (g = h, e = k)
  28166. }
  28167. return g
  28168. };
  28169. J.prototype.Te = function() { this.ab = null };
  28170. D.w(J, { vf: "geometry" }, function() { null === this.ab && (this.zo(), this.ab = this.makeGeometry()); return this.ab });
  28171. J.prototype.Wu = function(a) {
  28172. if (!a) {
  28173. if (!1 === this.Uf) return;
  28174. a = this.Ld();
  28175. if (null !== this.ab && (null === a || null !== a.vf)) return
  28176. }
  28177. this.ab = this.makeGeometry();
  28178. a = this.path;
  28179. if (null !== a) {
  28180. a.ab = this.ab;
  28181. for (var b = this.xa.o, c = b.length, d = 0; d < c; d++) {
  28182. var e = b[d];
  28183. e !== a && e.Ue && e instanceof z && (e.ab = this.ab)
  28184. }
  28185. }
  28186. };
  28187. J.prototype.makeGeometry = function() {
  28188. var a = this.ta;
  28189. if (2 > a) return new Ve(Ze);
  28190. var b = !1,
  28191. c = this.g;
  28192. null !== c && Ur(this) && c.Cl.contains(this) && null !== this.Vw && (b = !0);
  28193. var d = c = 0,
  28194. e = this.m(0).copy(),
  28195. g = e.copy(),
  28196. c = this.gd.o,
  28197. h = this.computeCurve();
  28198. if (h === Uj && 3 <= a && !Eb(this.Yq, 0))
  28199. if (3 === a) var k = this.m(1),
  28200. c = Math.min(e.x, k.x),
  28201. d = Math.min(e.y, k.y),
  28202. k = this.m(2),
  28203. c = Math.min(c, k.x),
  28204. d = Math.min(d, k.y);
  28205. else {
  28206. if (this.ic)
  28207. for (k = 0; k < a; k++) d = c[k], g.x = Math.min(d.x, g.x), g.y = Math.min(d.y, g.y);
  28208. else
  28209. for (k = 3; k < a; k += 3) k + 3 >= a && (k = a - 1), c = this.m(k),
  28210. g.x = Math.min(c.x, g.x), g.y = Math.min(c.y, g.y);
  28211. c = g.x;
  28212. d = g.y
  28213. }
  28214. else {
  28215. for (k = 0; k < a; k++) d = c[k], g.x = Math.min(d.x, g.x), g.y = Math.min(d.y, g.y);
  28216. c = g.x;
  28217. d = g.y
  28218. }
  28219. c -= this.uA.x;
  28220. d -= this.uA.y;
  28221. e.x -= c;
  28222. e.y -= d;
  28223. if (2 !== a || Ur(this)) {
  28224. var l = D.v();
  28225. 0 !== this.computeShortLength(!0) && (e = es(this, e, !0, g));
  28226. T(l, e.x, e.y, !1, !1);
  28227. if (h === Uj && 3 <= a && !Eb(this.Yq, 0))
  28228. if (3 === a) k = this.m(1), a = k.x - c, b = k.y - d, k = this.m(2).copy(), k.x -= c, k.y -= d, 0 !== this.computeShortLength(!1) && (k = es(this, k, !1, g)), U(l, a, b, a, b, k.x, k.y);
  28229. else if (this.ic) {
  28230. for (var g = new N(c, d), e = this.m(1).copy(),
  28231. h = new N(c, d), a = new N(c, d), b = this.m(0), m = null, n = this.Yq / 3, k = 1; k < this.ta - 1; k++) {
  28232. var m = this.m(k),
  28233. p = b,
  28234. q = m,
  28235. r = this.m(fs(this, m, k, !1));
  28236. if (!Eb(p.x, q.x) || !Eb(q.x, r.x))
  28237. if (!Eb(p.y, q.y) || !Eb(q.y, r.y)) {
  28238. var s = n,
  28239. u = h,
  28240. t = a;
  28241. isNaN(s) && (s = this.Yq / 3);
  28242. var y = p.x,
  28243. p = p.y,
  28244. w = q.x,
  28245. q = q.y,
  28246. A = r.x,
  28247. r = r.y,
  28248. B = s * gs(y, p, w, q),
  28249. s = s * gs(w, q, A, r);
  28250. Eb(p, q) && Eb(w, A) && (w > y ? r > q ? (u.x = w - B, u.y = q - B, t.x = w + s, t.y = q + s) : (u.x = w - B, u.y = q + B, t.x = w + s, t.y = q - s) : r > q ? (u.x = w + B, u.y = q - B, t.x = w - s, t.y = q + s) : (u.x = w + B, u.y = q + B, t.x = w - s, t.y = q - s));
  28251. Eb(y, w) && Eb(q, r) && (q > p ? (A > w ? (u.x =
  28252. w - B, u.y = q - B, t.x = w + s) : (u.x = w + B, u.y = q - B, t.x = w - s), t.y = q + s) : (A > w ? (u.x = w - B, u.y = q + B, t.x = w + s) : (u.x = w + B, u.y = q + B, t.x = w - s), t.y = q - s));
  28253. if (Eb(y, w) && Eb(w, A) || Eb(p, q) && Eb(q, r)) y = .5 * (y + A), p = .5 * (p + r), u.x = y, u.y = p, t.x = y, t.y = p;
  28254. 1 === k ? (e.x = .5 * (b.x + m.x), e.y = .5 * (b.y + m.y)) : 2 === k && Eb(b.x, this.m(0).x) && Eb(b.y, this.m(0).y) && (e.x = .5 * (b.x + m.x), e.y = .5 * (b.y + m.y));
  28255. U(l, e.x - c, e.y - d, h.x - c, h.y - d, m.x - c, m.y - d);
  28256. g.set(h);
  28257. e.set(a);
  28258. b = m
  28259. }
  28260. }
  28261. k = b.x;
  28262. b = b.y;
  28263. g = this.m(this.ta - 1);
  28264. 0 !== this.computeShortLength(!1) && (g = es(this, g.copy(), !1, Kd));
  28265. k = .5 * (k + g.x);
  28266. b = .5 * (b + g.y);
  28267. U(l, a.x - c, a.y - d, k - c, b - d, g.x - c, g.y - d)
  28268. } else
  28269. for (k = 3; k < a; k += 3) b = this.m(k - 2), k + 3 >= a && (k = a - 1), g = this.m(k - 1), e = this.m(k), k === a - 1 && 0 !== this.computeShortLength(!1) && (e = es(this, e.copy(), !1, Kd)), U(l, b.x - c, b.y - d, g.x - c, g.y - d, e.x - c, e.y - d);
  28270. else {
  28271. g = D.P();
  28272. g.assign(this.m(0));
  28273. k = 1;
  28274. for (e = 0; k < a;) {
  28275. k = fs(this, g, k, 1 < k);
  28276. u = this.m(k);
  28277. if (k >= a - 1) {
  28278. if (!g.O(u)) 0 !== this.computeShortLength(!1) && (u = es(this, u.copy(), !1, Kd)), hs(this, l, -c, -d, g, u, b);
  28279. else if (0 === e)
  28280. for (k = 1; k < a;) u = this.m(k++), hs(this, l, -c, -d, g, u, b), g.assign(u);
  28281. break
  28282. }
  28283. e = fs(this, u, k + 1, k < a - 3);
  28284. k = l;
  28285. h = -c;
  28286. m = -d;
  28287. n = g;
  28288. t = this.m(e);
  28289. y = g;
  28290. p = b;
  28291. Q(n.y, u.y) && Q(u.x, t.x) ? (s = this.computeCorner(), s = Math.min(s, Math.abs(u.x - n.x) / 2), s = w = Math.min(s, Math.abs(t.y - u.y) / 2), Q(s, 0) ? (hs(this, k, h, m, n, u, p), y.assign(u)) : (q = u.x, A = u.y, r = q, B = A, q = u.x > n.x ? u.x - s : u.x + s, B = t.y > u.y ? u.y + w : u.y - w, hs(this, k, h, m, n, new N(q, A), p), zf(k, u.x + h, u.y + m, r + h, B + m), y.n(r, B))) : Q(n.x, u.x) && Q(u.y, t.y) ? (s = this.computeCorner(), w = Math.min(s, Math.abs(u.y - n.y) / 2), w = s = Math.min(w, Math.abs(t.x - u.x) / 2), Q(s, 0) ? (hs(this, k, h, m, n, u,
  28292. p), y.assign(u)) : (q = u.x, B = A = u.y, A = u.y > n.y ? u.y - w : u.y + w, r = t.x > u.x ? u.x + s : u.x - s, hs(this, k, h, m, n, new N(q, A), p), zf(k, u.x + h, u.y + m, r + h, B + m), y.n(r, B))) : (hs(this, k, h, m, n, u, p), y.assign(u));
  28293. k = e
  28294. }
  28295. D.A(g)
  28296. }
  28297. c = l.q;
  28298. D.u(l)
  28299. } else l = this.m(1).copy(), l.x -= c, l.y -= d, 0 !== this.computeShortLength(!0) && (e = es(this, e, !0, g)), 0 !== this.computeShortLength(!1) && (l = es(this, l, !1, g)), c = new Ve(Ze), c.la = e.x, c.ja = e.y, c.F = l.x, c.G = l.y;
  28300. return c
  28301. };
  28302. function gs(a, b, c, d) {
  28303. a = c - a;
  28304. if (isNaN(a) || Infinity === a || -Infinity === a) return NaN;
  28305. 0 > a && (a = -a);
  28306. b = d - b;
  28307. if (isNaN(b) || Infinity === b || -Infinity === b) return NaN;
  28308. 0 > b && (b = -b);
  28309. return Eb(a, 0) ? b : Eb(b, 0) ? a : Math.sqrt(a * a + b * b)
  28310. }
  28311. function es(a, b, c, d) {
  28312. var e = a.ta;
  28313. if (2 > e) return b;
  28314. if (c) {
  28315. var g = a.m(1);
  28316. c = g.x - d.x;
  28317. d = g.y - d.y;
  28318. g = gs(b.x, b.y, c, d);
  28319. if (0 === g) return b;
  28320. e = 2 === e ? .5 * g : g;
  28321. a = a.computeShortLength(!0);
  28322. a > e && (a = e);
  28323. c = a * (c - b.x) / g;
  28324. a = a * (d - b.y) / g;
  28325. b.x += c;
  28326. b.y += a
  28327. } else {
  28328. g = a.m(e - 2);
  28329. c = g.x - d.x;
  28330. d = g.y - d.y;
  28331. g = gs(b.x, b.y, c, d);
  28332. if (0 === g) return b;
  28333. e = 2 === e ? .5 * g : g;
  28334. a = a.computeShortLength(!1);
  28335. a > e && (a = e);
  28336. c = a * (b.x - c) / g;
  28337. a = a * (b.y - d) / g;
  28338. b.x -= c;
  28339. b.y -= a
  28340. }
  28341. return b
  28342. }
  28343. function fs(a, b, c, d) {
  28344. for (var e = a.ta, g = b; Eb(b.x, g.x) && Eb(b.y, g.y);) {
  28345. if (c >= e) return e - 1;
  28346. g = a.m(c++)
  28347. }
  28348. if (!Eb(b.x, g.x) && !Eb(b.y, g.y)) return c - 1;
  28349. for (var h = g; Eb(b.x, g.x) && Eb(g.x, h.x) && (!d || (b.y >= g.y ? g.y >= h.y : g.y <= h.y)) || Eb(b.y, g.y) && Eb(g.y, h.y) && (!d || (b.x >= g.x ? g.x >= h.x : g.x <= h.x));) {
  28350. if (c >= e) return e - 1;
  28351. h = a.m(c++)
  28352. }
  28353. return c - 2
  28354. }
  28355. function hs(a, b, c, d, e, g, h) {
  28356. if (!h && Ur(a)) {
  28357. h = [];
  28358. var k = 0;
  28359. a.isVisible() && (k = is(a, e, g, h));
  28360. var l = e.x,
  28361. l = e.y;
  28362. if (0 < k)
  28363. if (Q(e.y, g.y))
  28364. if (e.x < g.x)
  28365. for (var m = 0; m < k;) {
  28366. var n = Math.max(e.x, Math.min(h[m++] - 5, g.x - 10));
  28367. b.lineTo(n + c, g.y + d);
  28368. for (var l = n + c, p = Math.min(n + 10, g.x); m < k;) {
  28369. var q = h[m];
  28370. if (q < p + 10) m++, p = Math.min(q + 5, g.x);
  28371. else break
  28372. }
  28373. q = (n + p) / 2 + c;
  28374. q = g.y - 10 + d;
  28375. n = p + c;
  28376. p = g.y + d;
  28377. a.jf === uj ? T(b, n, p, !1, !1) : U(b, l, q, n, q, n, p)
  28378. } else
  28379. for (m = k - 1; 0 <= m;) {
  28380. n = Math.min(e.x, Math.max(h[m--] + 5, g.x + 10));
  28381. b.lineTo(n + c, g.y + d);
  28382. l = n + c;
  28383. for (p = Math.max(n - 10,
  28384. g.x); 0 <= m;)
  28385. if (q = h[m], q > p - 10) m--, p = Math.max(q - 5, g.x);
  28386. else break;
  28387. q = g.y - 10 + d;
  28388. n = p + c;
  28389. p = g.y + d;
  28390. a.jf === uj ? T(b, n, p, !1, !1) : U(b, l, q, n, q, n, p)
  28391. } else if (Q(e.x, g.x))
  28392. if (e.y < g.y)
  28393. for (m = 0; m < k;) {
  28394. n = Math.max(e.y, Math.min(h[m++] - 5, g.y - 10));
  28395. b.lineTo(g.x + c, n + d);
  28396. l = n + d;
  28397. for (p = Math.min(n + 10, g.y); m < k;)
  28398. if (q = h[m], q < p + 10) m++, p = Math.min(q + 5, g.y);
  28399. else break;
  28400. q = g.x - 10 + c;
  28401. n = g.x + c;
  28402. p += d;
  28403. a.jf === uj ? T(b, n, p, !1, !1) : U(b, q, l, q, p, n, p)
  28404. } else
  28405. for (m = k - 1; 0 <= m;) {
  28406. n = Math.min(e.y, Math.max(h[m--] + 5, g.y + 10));
  28407. b.lineTo(g.x + c, n + d);
  28408. l = n + d;
  28409. for (p = Math.max(n - 10, g.y); 0 <=
  28410. m;)
  28411. if (q = h[m], q > p - 10) m--, p = Math.max(q - 5, g.y);
  28412. else break;
  28413. q = g.x - 10 + c;
  28414. n = g.x + c;
  28415. p += d;
  28416. a.jf === uj ? T(b, n, p, !1, !1) : U(b, q, l, q, p, n, p)
  28417. }
  28418. }
  28419. b.lineTo(g.x + c, g.y + d)
  28420. }
  28421. function is(a, b, c, d) {
  28422. var e = a.g;
  28423. if (null === e || b.O(c)) return 0;
  28424. for (e = e.ao; e.next();) {
  28425. var g = e.value;
  28426. if (null !== g && g.visible)
  28427. for (var g = g.rb.o, h = g.length, k = 0; k < h; k++) {
  28428. var l = g[k];
  28429. if (l instanceof J) {
  28430. if (l === a) return 0 < d.length && d.sort(function(a, b) { return a - b }), d.length;
  28431. if (l.isVisible() && Ur(l)) {
  28432. var m = l.so;
  28433. m.H() && a.so.jg(m) && !a.usesSamePort(l) && (m = l.path, null !== m && m.Sj() && js(b, c, d, l))
  28434. }
  28435. }
  28436. }
  28437. }
  28438. 0 < d.length && d.sort(function(a, b) { return a - b });
  28439. return d.length
  28440. }
  28441. function js(a, b, c, d) {
  28442. for (var e = Q(a.y, b.y), g = d.ta, h = d.m(0), k = D.P(), l = 1; l < g; l++) {
  28443. var m = d.m(l);
  28444. if (l < g - 1) { var n = d.m(l + 1); if (h.y === m.y && m.y === n.y) { if (m.x > h.x && n.x > m.x || m.x < h.x && n.x < m.x) m = n, l++ } else h.x === m.x && m.x === n.x && (m.y > h.y && n.y > m.y || m.y < h.y && n.y < m.y) && (m = n, l++) }
  28445. a: {
  28446. var n = k,
  28447. p = a.x,
  28448. q = a.y,
  28449. r = b.x,
  28450. s = b.y,
  28451. u = h.x,
  28452. h = h.y,
  28453. t = m.x,
  28454. y = m.y;
  28455. if (!Q(p, r)) {
  28456. if (Q(q, s) && Q(u, t) && Math.min(p, r) < u && Math.max(p, r) > u && Math.min(h, y) < q && Math.max(h, y) > q && !Q(h, y)) {
  28457. n.x = u;
  28458. n.y = q;
  28459. n = !0;
  28460. break a
  28461. }
  28462. } else if (!Q(q, s) && Q(h, y) && Math.min(q, s) < h && Math.max(q,
  28463. s) > h && Math.min(u, t) < p && Math.max(u, t) > p && !Q(u, t)) {
  28464. n.x = p;
  28465. n.y = h;
  28466. n = !0;
  28467. break a
  28468. }
  28469. n.x = 0;n.y = 0;n = !1
  28470. }
  28471. n && (e ? c.push(k.x) : c.push(k.y));
  28472. h = m
  28473. }
  28474. D.A(k)
  28475. }
  28476. D.w(J, { tu: "firstPickIndex" }, function() {
  28477. var a;
  28478. 2 >= this.ta ? a = 0 : ((a = this.ic) || (a = this.computeSpot(!0) !== dc), a = a ? 1 : 0);
  28479. return a
  28480. });
  28481. D.w(J, { oy: "lastPickIndex" }, function() {
  28482. var a = this.ta;
  28483. if (0 === a) a = 0;
  28484. else if (2 >= a) a -= 1;
  28485. else {
  28486. var b;
  28487. (b = this.ic) || (b = this.computeSpot(!1) !== dc);
  28488. a = b ? a - 2 : a - 1
  28489. }
  28490. return a
  28491. });
  28492. function Ur(a) { a = a.jf; return a === tj || a === uj }
  28493. function Wr(a, b) {
  28494. if (b || Ur(a)) {
  28495. var c = a.g;
  28496. null === c || c.Cl.contains(a) || null === a.Vw || c.Cl.add(a, a.Vw)
  28497. }
  28498. }
  28499. function Oj(a, b) {
  28500. var c = a.layer;
  28501. if (null !== c && c.visible && !c.Yc) {
  28502. var d = c.g;
  28503. if (null !== d)
  28504. for (var e = !1, d = d.ao; d.next();) {
  28505. var g = d.value;
  28506. if (g.visible)
  28507. if (g === c)
  28508. for (var e = !0, h = !1, g = g.rb.o, k = g.length, l = 0; l < k; l++) {
  28509. var m = g[l];
  28510. m instanceof J && (m === a ? h = !0 : h && ks(a, m, b))
  28511. } else if (e)
  28512. for (g = g.rb.o, k = g.length, l = 0; l < k; l++) m = g[l], m instanceof J && ks(a, m, b)
  28513. }
  28514. }
  28515. }
  28516. function ks(a, b, c) {
  28517. if (null !== b && null !== b.ab && Ur(b)) {
  28518. var d = b.so;
  28519. d.H() && (a.so.jg(d) || c.jg(d)) && (a.usesSamePort(b) || b.Te())
  28520. }
  28521. }
  28522. J.prototype.usesSamePort = function(a) {
  28523. var b = this.ta,
  28524. c = a.ta;
  28525. if (0 < b && 0 < c) {
  28526. var d = this.m(0),
  28527. e = a.m(0);
  28528. if (d.Wc(e)) return !0;
  28529. b = this.m(b - 1);
  28530. a = a.m(c - 1);
  28531. if (b.Wc(a) || d.Wc(a) || b.Wc(e)) return !0
  28532. } else if (this.$ === a.$ || this.ba === a.ba || this.$ === a.ba || this.ba === a.$) return !0;
  28533. return !1
  28534. };
  28535. J.prototype.isVisible = function() {
  28536. if (!F.prototype.isVisible.call(this)) return !1;
  28537. var a = this.Ka,
  28538. b = !0,
  28539. c = this.g;
  28540. null !== c && (b = c.ee);
  28541. var d = this.$;
  28542. if (null !== d) {
  28543. if (this.jc && b && !d.Dc) return !1;
  28544. if (d === a) return !0;
  28545. for (c = d; null !== c;) {
  28546. if (c.Xb === this) return !0;
  28547. c = c.Ka
  28548. }
  28549. c = d.findVisibleNode();
  28550. if (null === c || c === a) return !1
  28551. }
  28552. d = this.ba;
  28553. if (null !== d) {
  28554. if (this.jc && !b && !d.Dc) return !1;
  28555. if (d === a) return !0;
  28556. for (c = d; null !== c;) {
  28557. if (c.Xb === this) return !0;
  28558. c = c.Ka
  28559. }
  28560. b = d.findVisibleNode();
  28561. if (null === b || b === a) return !1
  28562. }
  28563. return !0
  28564. };
  28565. J.prototype.Pd = function(a) {
  28566. F.prototype.Pd.call(this, a);
  28567. null !== this.Oi && this.Oi.wq();
  28568. if (null !== this.Gf)
  28569. for (var b = this.Gf.j; b.next();) b.value.Pd(a)
  28570. };
  28571. D.defineProperty(J, { Yp: "adjusting" }, function() { return this.ir }, function(a) {
  28572. var b = this.ir;
  28573. b !== a && (v && D.Da(a, J, J, "adjusting"), this.ir = a, this.i("adjusting", b, a))
  28574. });
  28575. D.defineProperty(J, { QA: "corner" }, function() { return this.Dr }, function(a) {
  28576. var b = this.Dr;
  28577. b !== a && (v && D.h(a, "number", J, "corner"), this.Dr = a, this.Te(), this.i("corner", b, a))
  28578. });
  28579. D.defineProperty(J, { jf: "curve" }, function() { return this.Gr }, function(a) {
  28580. var b = this.Gr;
  28581. b !== a && (v && D.Da(a, J, J, "curve"), this.Gr = a, this.ec(), this.Te(), Wr(this, b === uj || b === tj || a === uj || a === tj), this.i("curve", b, a))
  28582. });
  28583. D.defineProperty(J, { Nx: "curviness" }, function() { return this.Hr }, function(a) {
  28584. var b = this.Hr;
  28585. b !== a && (v && D.h(a, "number", J, "curviness"), this.Hr = a, this.ec(), this.Te(), this.i("curviness", b, a))
  28586. });
  28587. D.defineProperty(J, { My: "routing" }, function() { return this.on }, function(a) {
  28588. var b = this.on;
  28589. b !== a && (v && D.Da(a, J, J, "routing"), this.on = a, this.$i = null, this.ec(), Wr(this, 2 === (b.value & 2) || 2 === (a.value & 2)), this.i("routing", b, a))
  28590. });
  28591. D.defineProperty(J, { Yq: "smoothness" }, function() { return this.Jt }, function(a) {
  28592. var b = this.Jt;
  28593. b !== a && (v && D.h(a, "number", J, "smoothness"), this.Jt = a, this.Te(), this.i("smoothness", b, a))
  28594. });
  28595. function Tr(a) {
  28596. var b = a.Cg;
  28597. if (null !== b) {
  28598. var c = a.Tg;
  28599. if (null !== c) {
  28600. var d = a.gi;
  28601. a = a.Ai;
  28602. for (var e = null, g = null, h = b.yc.o, k = h.length, l = 0; l < k; l++) { var m = h[l]; if (m.Cg === b && m.gi === d && m.Tg === c && m.Ai === a || m.Cg === c && m.gi === a && m.Tg === b && m.Ai === d) null === g ? g = m : (null === e && (e = [], e.push(g)), e.push(m)) }
  28603. if (null !== e) {
  28604. g = Cr(b, c, d, a);
  28605. null === g && (g = new Il, g.Hq = b, g.Cy = d, g.av = c, g.Dy = a, Br(b, g), Br(c, g));
  28606. g.links = e;
  28607. for (l = 0; l < e.length; l++) m = e[l], m.Oi = g;
  28608. g.wq()
  28609. }
  28610. }
  28611. }
  28612. }
  28613. function Sr(a) {
  28614. var b = a.Oi;
  28615. null !== b && (a.Oi = null, a = b.links.indexOf(a), 0 <= a && (D.Vg(b.links, a), b.wq()))
  28616. }
  28617. D.w(J, { key: "key" }, function() { var a = this.g; return null !== a && a.ea instanceof Y ? a.ea.mf(this.data) : void 0 }, { configurable: !0 });
  28618. function Il() {
  28619. D.xc(this);
  28620. this.uh = this.pw = !1;
  28621. this.Dy = this.av = this.Cy = this.Hq = null;
  28622. this.links = []
  28623. }
  28624. Il.prototype.wq = function() {
  28625. if (!this.pw) {
  28626. var a = this.links;
  28627. 0 < a.length && (a = a[0].g, null !== a && (a.AD.add(this), this.uh = a.na.ub))
  28628. }
  28629. this.pw = !0
  28630. };
  28631. Il.prototype.tC = function() {
  28632. if (this.pw) {
  28633. this.pw = !1;
  28634. var a = this.links;
  28635. if (0 < a.length) {
  28636. var b = a[0],
  28637. c = b.g,
  28638. c = null === c || c.Zn && !this.uh;
  28639. this.uh = !1;
  28640. b.arrangeBundledLinks(a, c);
  28641. 1 === a.length && (b.Oi = null, a.length = 0)
  28642. }
  28643. 0 === a.length && (a = this.Hq, null !== this && null !== a.ai && a.ai.remove(this), a = this.av, null !== this && null !== a.ai && a.ai.remove(this))
  28644. }
  28645. };
  28646. D.me(Il, { Hq: !0, Cy: !0, av: !0, Dy: !0, links: !0, spacing: !0 });
  28647. function Nn() {
  28648. D.xc(this);
  28649. this.gC = this.group = null;
  28650. this.vq = !0;
  28651. this.abort = !1;
  28652. this.ag = this.$f = 1;
  28653. this.Is = this.Hs = -1;
  28654. this.Rd = this.he = 8;
  28655. this.sd = null;
  28656. this.xH = !1;
  28657. this.fH = 22;
  28658. this.rG = 111
  28659. }
  28660. D.me(Nn, { group: !0, gC: !0, vq: !0, abort: !0, xH: !0, fH: !0, rG: !0 });
  28661. Nn.prototype.initialize = function(a) {
  28662. if (!(0 >= a.width || 0 >= a.height)) {
  28663. var b = a.y,
  28664. c = a.x + a.width,
  28665. d = a.y + a.height;
  28666. this.$f = Math.floor((a.x - this.he) / this.he) * this.he;
  28667. this.ag = Math.floor((b - this.Rd) / this.Rd) * this.Rd;
  28668. this.Hs = Math.ceil((c + 2 * this.he) / this.he) * this.he;
  28669. this.Is = Math.ceil((d + 2 * this.Rd) / this.Rd) * this.Rd;
  28670. a = 1 + (Math.ceil((this.Hs - this.$f) / this.he) | 0);
  28671. b = 1 + (Math.ceil((this.Is - this.ag) / this.Rd) | 0);
  28672. if (null === this.sd || this.zn < a - 1 || this.An < b - 1) {
  28673. c = [];
  28674. for (d = 0; d <= a; d++) c[d] = [];
  28675. this.sd = c;
  28676. this.zn = a - 1;
  28677. this.An = b - 1
  28678. }
  28679. if (null !==
  28680. this.sd)
  28681. for (a = 0; a <= this.zn; a++)
  28682. for (b = 0; b <= this.An; b++) this.sd[a][b] = 1E6
  28683. }
  28684. };
  28685. D.w(Nn, { pb: null }, function() { return new C(this.$f, this.ag, this.Hs - this.$f, this.Is - this.ag) });
  28686. D.defineProperty(Nn, { cq: null }, function() { return this.he }, function(a) { 0 < a && a !== this.he && (this.he = a, this.initialize(this.pb)) });
  28687. D.defineProperty(Nn, { aq: null }, function() { return this.Rd }, function(a) { 0 < a && a !== this.Rd && (this.Rd = a, this.initialize(this.pb)) });
  28688. function as(a, b, c) { return a.$f <= b && b <= a.Hs && a.ag <= c && c <= a.Is }
  28689. function cs(a, b, c) {
  28690. if (!as(a, b, c)) return 1E6;
  28691. b -= a.$f;
  28692. b /= a.he;
  28693. c -= a.ag;
  28694. c /= a.Rd;
  28695. return a.sd[b | 0][c | 0]
  28696. }
  28697. function Qn(a, b, c) { as(a, b, c) && (b -= a.$f, b /= a.he, c -= a.ag, c /= a.Rd, a.sd[b | 0][c | 0] = 0) }
  28698. function Pn(a) {
  28699. if (null !== a.sd)
  28700. for (var b = 0; b <= a.zn; b++)
  28701. for (var c = 0; c <= a.An; c++) 1 <= a.sd[b][c] && (a.sd[b][c] = 1E6)
  28702. }
  28703. Nn.prototype.Dq = function(a, b, c, d) {
  28704. if (a > this.Hs || a + c < this.$f || b > this.Is || b + d < this.ag) return !0;
  28705. a = (a - this.$f) / this.he | 0;
  28706. b = (b - this.ag) / this.Rd | 0;
  28707. c = Math.max(0, c) / this.he + 1 | 0;
  28708. var e = Math.max(0, d) / this.Rd + 1 | 0;
  28709. 0 > a && (c += a, a = 0);
  28710. 0 > b && (e += b, b = 0);
  28711. if (0 > c || 0 > e) return !0;
  28712. d = Math.min(a + c - 1, this.zn) | 0;
  28713. for (c = Math.min(b + e - 1, this.An) | 0; a <= d; a++)
  28714. for (e = b; e <= c; e++)
  28715. if (0 === this.sd[a][e]) return !1;
  28716. return !0
  28717. };
  28718. function ls(a, b, c, d, e, g, h, k, l) {
  28719. if (!(b < g || b > h || c < k || c > l)) {
  28720. var m, n;
  28721. m = b | 0;
  28722. n = c | 0;
  28723. var p = a.sd[m][n];
  28724. if (1 <= p && 999999 > p)
  28725. for (e ? n += d : m += d, p += 1; g <= m && m <= h && k <= n && n <= l && !(p >= a.sd[m][n]);) a.sd[m][n] = p, p += 1, e ? n += d : m += d;
  28726. m = e ? n : m;
  28727. if (e)
  28728. if (0 < d)
  28729. for (c += d; c < m; c += d) ls(a, b, c, 1, !e, g, h, k, l), ls(a, b, c, -1, !e, g, h, k, l);
  28730. else
  28731. for (c += d; c > m; c += d) ls(a, b, c, 1, !e, g, h, k, l), ls(a, b, c, -1, !e, g, h, k, l);
  28732. else if (0 < d)
  28733. for (b += d; b < m; b += d) ls(a, b, c, 1, !e, g, h, k, l), ls(a, b, c, -1, !e, g, h, k, l);
  28734. else
  28735. for (b += d; b > m; b += d) ls(a, b, c, 1, !e, g, h, k, l), ls(a, b, c, -1, !e, g, h,
  28736. k, l)
  28737. }
  28738. }
  28739. function ms(a, b, c, d, e, g, h, k, l) {
  28740. b |= 0;
  28741. c |= 0;
  28742. var m = 0,
  28743. n = 1;
  28744. for (a.sd[b][c] = n; 0 === m && b > g && b < h && c > k && c < l;) n += 1, a.sd[b][c] = n, e ? c += d : b += d, m = a.sd[b][c]
  28745. }
  28746. function ns(a, b, c, d, e, g, h, k, l) {
  28747. b |= 0;
  28748. c |= 0;
  28749. var m = 0;
  28750. for (a.sd[b][c] = 999999; 0 === m && b > g && b < h && c > k && c < l;) a.sd[b][c] = 999999, e ? c += d : b += d, m = a.sd[b][c]
  28751. }
  28752. function bs(a, b, c, d, e, g) {
  28753. if (null !== a.sd) {
  28754. a.abort = !1;
  28755. var h = b.x,
  28756. k = b.y;
  28757. if (as(a, h, k) && (h -= a.$f, h /= a.he, k -= a.ag, k /= a.Rd, b = d.x, d = d.y, as(a, b, d)))
  28758. if (b -= a.$f, b /= a.he, d -= a.ag, d /= a.Rd, 1 >= Math.abs(h - b) && 1 >= Math.abs(k - d)) a.abort = !0;
  28759. else {
  28760. var l = g.x,
  28761. m = g.y,
  28762. n = g.x + g.width,
  28763. p = g.y + g.height,
  28764. l = l - a.$f,
  28765. l = l / a.he,
  28766. m = m - a.ag,
  28767. m = m / a.Rd,
  28768. n = n - a.$f,
  28769. n = n / a.he,
  28770. p = p - a.ag,
  28771. p = p / a.Rd;
  28772. g = Math.max(0, Math.min(a.zn, l | 0));
  28773. n = Math.min(a.zn, Math.max(0, n | 0));
  28774. m = Math.max(0, Math.min(a.An, m | 0));
  28775. p = Math.min(a.An, Math.max(0, p | 0));
  28776. h |= 0;
  28777. k |= 0;
  28778. b |= 0;
  28779. d |= 0;
  28780. l = 0 === c ||
  28781. 90 === c ? 1 : -1;
  28782. c = 90 === c || 270 === c;
  28783. 0 === a.sd[h][k] ? (ms(a, h, k, l, c, g, n, m, p), ms(a, h, k, 1, !c, g, n, m, p), ms(a, h, k, -1, !c, g, n, m, p)) : ms(a, h, k, l, c, h, k, h, k);
  28784. 0 === a.sd[b][d] ? (ns(a, b, d, 0 === e || 90 === e ? 1 : -1, 90 === e || 270 === e, g, n, m, p), ns(a, b, d, 1, !(90 === e || 270 === e), g, n, m, p), ns(a, b, d, -1, !(90 === e || 270 === e), g, n, m, p)) : ns(a, b, d, l, c, b, d, b, d);
  28785. a.abort || (ls(a, h, k, 1, !1, g, n, m, p), ls(a, h, k, -1, !1, g, n, m, p), ls(a, h, k, 1, !0, g, n, m, p), ls(a, h, k, -1, !0, g, n, m, p))
  28786. }
  28787. }
  28788. }
  28789. function Zr() {
  28790. D.xc(this);
  28791. this.port = this.Zc = null;
  28792. this.og = [];
  28793. this.Gq = !1
  28794. }
  28795. D.me(Zr, { Zc: !0, port: !0, og: !0, Gq: !0 });
  28796. Zr.prototype.toString = function() {
  28797. for (var a = this.og, b = this.Zc.toString() + " " + a.length.toString() + ":", c = 0; c < a.length; c++) {
  28798. var d = a[c];
  28799. null !== d && (b += "\n " + d.toString())
  28800. }
  28801. return b
  28802. };
  28803. function os(a, b, c, d) {
  28804. b = b.offsetY;
  28805. switch (b) {
  28806. case D.qd:
  28807. return 90;
  28808. case D.bd:
  28809. return 180;
  28810. case D.Ad:
  28811. return 270;
  28812. case D.rd:
  28813. return 0
  28814. }
  28815. switch (b) {
  28816. case D.qd | D.Ad:
  28817. return 180 < c ? 270 : 90;
  28818. case D.bd | D.rd:
  28819. return 90 < c && 270 >= c ? 180 : 0
  28820. }
  28821. a = 180 * Math.atan2(a.height, a.width) / Math.PI;
  28822. switch (b) {
  28823. case D.bd | D.Ad:
  28824. return c > a && c <= 180 + a ? 180 : 270;
  28825. case D.Ad | D.rd:
  28826. return c > 180 - a && c <= 360 - a ? 270 : 0;
  28827. case D.rd | D.qd:
  28828. return c > a && c <= 180 + a ? 90 : 0;
  28829. case D.qd | D.bd:
  28830. return c > 180 - a && c <= 360 - a ? 180 : 90;
  28831. case D.bd | D.Ad | D.rd:
  28832. return 90 < c && c <= 180 + a ? 180 : c > 180 + a && c <= 360 -
  28833. a ? 270 : 0;
  28834. case D.Ad | D.rd | D.qd:
  28835. return 180 < c && c <= 360 - a ? 270 : c > a && 180 >= c ? 90 : 0;
  28836. case D.rd | D.qd | D.bd:
  28837. return c > a && c <= 180 - a ? 90 : c > 180 - a && 270 >= c ? 180 : 0;
  28838. case D.qd | D.bd | D.Ad:
  28839. return c > 180 - a && c <= 180 + a ? 180 : c > 180 + a ? 270 : 90
  28840. }
  28841. d && b !== (D.bd | D.Ad | D.rd | D.qd) && (c -= 15, 0 > c && (c += 360));
  28842. return c > a && c < 180 - a ? 90 : c >= 180 - a && c <= 180 + a ? 180 : c > 180 + a && c < 360 - a ? 270 : 0
  28843. }
  28844. Zr.prototype.wq = function() { this.og.length = 0 };
  28845. function $r(a, b) {
  28846. var c = a.og;
  28847. if (0 === c.length) {
  28848. a: if (!a.Gq) {
  28849. c = a.Gq;
  28850. a.Gq = !0;
  28851. var d, e = null,
  28852. g = a.Zc,
  28853. g = g instanceof I ? g : null;
  28854. if (null === g || g.md) d = a.Zc.FF(a.port.yd);
  28855. else {
  28856. if (!g.aa.H()) { a.Gq = c; break a }
  28857. e = g;
  28858. d = e.EF()
  28859. }
  28860. var h = a.og.length = 0,
  28861. k = a.port.fb(ec, D.P()),
  28862. l = a.port.fb(vc, D.P()),
  28863. g = D.vg(k.x, k.y, 0, 0);
  28864. g.Mi(l);
  28865. D.A(k);
  28866. D.A(l);
  28867. k = D.Fb(g.x + g.width / 2, g.y + g.height / 2);
  28868. l = a.port.sm();
  28869. for (d = d.j; d.next();) {
  28870. var m = d.value;
  28871. if (m.isVisible() && m.oc !== m.Gc) {
  28872. var n = m.oc === a.port || m.$.Fi(e),
  28873. p = m.computeSpot(n, a.port);
  28874. if (p.Pj() && (n = n ? m.Gc :
  28875. m.oc, null !== n)) {
  28876. var q = n.Y;
  28877. if (null !== q) {
  28878. var r = q.findVisibleNode();
  28879. null !== r && r !== q && (q = r, n = q.port);
  28880. n = m.computeOtherPoint(q, n);
  28881. q = k.Wb(n);
  28882. q -= l;
  28883. 0 > q && (q += 360);
  28884. p = os(g, p, q, m.ic);
  28885. r = 0;
  28886. 0 === p ? (r = D.rd, 180 < q && (q -= 360)) : r = 90 === p ? D.qd : 180 === p ? D.bd : D.Ad;
  28887. p = a.og[h];
  28888. void 0 === p ? (p = new ps(m, q, r), a.og[h] = p) : (p.link = m, p.angle = q, p.Le = r);
  28889. p.Ay.set(n);
  28890. h++
  28891. }
  28892. }
  28893. }
  28894. }
  28895. D.A(k);
  28896. a.og.sort(Zr.prototype.VJ);
  28897. e = a.og.length;
  28898. k = -1;
  28899. for (h = l = 0; h < e; h++) p = a.og[h], void 0 !== p && (p.Le !== k && (k = p.Le, l = 0), p.tq = l, l++);
  28900. k = -1;
  28901. l = 0;
  28902. for (h = e - 1; 0 <= h; h--) p = a.og[h], void 0 !==
  28903. p && (p.Le !== k && (k = p.Le, l = p.tq + 1), p.Ln = l);
  28904. h = a.og;
  28905. p = a.port;
  28906. e = a.Zc.$J;
  28907. k = D.P();
  28908. l = D.P();
  28909. d = D.P();
  28910. m = D.P();
  28911. p.fb(ec, k);
  28912. p.fb(kc, l);
  28913. p.fb(vc, d);
  28914. p.fb(tc, m);
  28915. r = q = n = p = 0;
  28916. if (e === Ar)
  28917. for (var s = 0; s < h.length; s++) {
  28918. var u = h[s];
  28919. if (null !== u) {
  28920. var t = u.link.computeThickness();
  28921. switch (u.Le) {
  28922. case D.qd:
  28923. q += t;
  28924. break;
  28925. case D.bd:
  28926. r += t;
  28927. break;
  28928. case D.Ad:
  28929. p += t;
  28930. break;
  28931. default:
  28932. case D.rd:
  28933. n += t
  28934. }
  28935. }
  28936. }
  28937. for (var y = 0, w = 0, A = 1, s = 0; s < h.length; s++)
  28938. if (u = h[s], null !== u) {
  28939. var B, P;
  28940. if (y !== u.Le) {
  28941. y = u.Le;
  28942. switch (y) {
  28943. case D.qd:
  28944. B = d;
  28945. P = m;
  28946. break;
  28947. case D.bd:
  28948. B = m;
  28949. P = k;
  28950. break;
  28951. case D.Ad:
  28952. B =
  28953. k;
  28954. P = l;
  28955. break;
  28956. default:
  28957. case D.rd:
  28958. B = l, P = d
  28959. }
  28960. var H = P.x - B.x;
  28961. P = P.y - B.y;
  28962. switch (y) {
  28963. case D.qd:
  28964. q > Math.abs(H) ? (A = Math.abs(H) / q, q = Math.abs(H)) : A = 1;
  28965. break;
  28966. case D.bd:
  28967. r > Math.abs(P) ? (A = Math.abs(P) / r, r = Math.abs(P)) : A = 1;
  28968. break;
  28969. case D.Ad:
  28970. p > Math.abs(H) ? (A = Math.abs(H) / p, p = Math.abs(H)) : A = 1;
  28971. break;
  28972. default:
  28973. case D.rd:
  28974. n > Math.abs(P) ? (A = Math.abs(P) / n, n = Math.abs(P)) : A = 1
  28975. }
  28976. w = 0
  28977. }
  28978. var R = u.Eq;
  28979. if (e === Ar) {
  28980. t = u.link.computeThickness();
  28981. t *= A;
  28982. R.set(B);
  28983. switch (y) {
  28984. case D.qd:
  28985. R.x = B.x + H / 2 + q / 2 - w - t / 2;
  28986. break;
  28987. case D.bd:
  28988. R.y = B.y + P / 2 + r / 2 - w - t / 2;
  28989. break;
  28990. case D.Ad:
  28991. R.x =
  28992. B.x + H / 2 - p / 2 + w + t / 2;
  28993. break;
  28994. default:
  28995. case D.rd:
  28996. R.y = B.y + P / 2 - n / 2 + w + t / 2
  28997. }
  28998. w += t
  28999. } else t = .5, e === xr && (t = (u.tq + 1) / (u.Ln + 1)), R.x = B.x + H * t, R.y = B.y + P * t
  29000. }
  29001. D.A(k);
  29002. D.A(l);
  29003. D.A(d);
  29004. D.A(m);
  29005. B = a.og;
  29006. for (H = 0; H < B.length; H++) P = B[H], null !== P && (P.Sx = a.computeEndSegmentLength(P));
  29007. a.Gq = c;
  29008. D.Lb(g)
  29009. }c = a.og
  29010. }
  29011. for (g = 0; g < c.length; g++)
  29012. if (B = c[g], null !== B && B.link === b) return B;
  29013. return null
  29014. }
  29015. Zr.prototype.VJ = function(a, b) { return a === b ? 0 : null === a ? -1 : null === b ? 1 : a.Le < b.Le ? -1 : a.Le > b.Le ? 1 : a.angle < b.angle ? -1 : a.angle > b.angle ? 1 : 0 };
  29016. Zr.prototype.computeEndSegmentLength = function(a) {
  29017. var b = a.link,
  29018. c = b.computeEndSegmentLength(this.Zc, this.port, dc, b.oc === this.port),
  29019. d = a.tq;
  29020. if (0 > d) return c;
  29021. var e = a.Ln;
  29022. if (1 >= e || !b.ic) return c;
  29023. var b = a.Ay,
  29024. g = a.Eq;
  29025. if (a.Le === D.bd || a.Le === D.qd) d = e - 1 - d;
  29026. return ((a = a.Le === D.bd || a.Le === D.rd) ? b.y < g.y : b.x < g.x) ? c + 8 * d : (a ? b.y === g.y : b.x === g.x) ? c : c + 8 * (e - 1 - d)
  29027. };
  29028. function ps(a, b, c) {
  29029. this.link = a;
  29030. this.angle = b;
  29031. this.Le = c;
  29032. this.Ay = new N;
  29033. this.Ln = this.tq = 0;
  29034. this.Eq = new N;
  29035. this.Sx = 0
  29036. }
  29037. D.me(ps, { link: !0, angle: !0, Le: !0, Ay: !0, tq: !0, Ln: !0, Eq: !0, Sx: !0 });
  29038. ps.prototype.toString = function() { return this.link.toString() + " " + this.angle.toString() + " " + this.Le.toString() + ":" + this.tq.toString() + "/" + this.Ln.toString() + " " + this.Eq.toString() + " " + this.Sx.toString() + " " + this.Ay.toString() };
  29039. function Eo() {
  29040. this.Mk = this.ok = Vc;
  29041. this.Kk = this.mk = NaN;
  29042. this.Jk = this.lk = yr;
  29043. this.Lk = this.nk = NaN;
  29044. this.St = this.as = null;
  29045. this.Tt = this.bs = Infinity
  29046. }
  29047. Eo.prototype.copy = function() {
  29048. var a = new Eo;
  29049. a.ok = this.ok.V();
  29050. a.Mk = this.Mk.V();
  29051. a.mk = this.mk;
  29052. a.Kk = this.Kk;
  29053. a.lk = this.lk;
  29054. a.Jk = this.Jk;
  29055. a.nk = this.nk;
  29056. a.Lk = this.Lk;
  29057. a.as = this.as;
  29058. a.St = this.St;
  29059. a.bs = this.bs;
  29060. a.Tt = this.Tt;
  29061. return a
  29062. };
  29063. function I(a) {
  29064. G.call(this, a);
  29065. this.Ca |= 4608;
  29066. this.Ks = new L(F);
  29067. this.gn = new L(I);
  29068. this.Rb = this.Nt = this.Rl = this.Ls = this.Js = null;
  29069. this.we = new $g;
  29070. this.we.group = this
  29071. }
  29072. D.Ta(I, G);
  29073. D.ka("Group", I);
  29074. I.prototype.cloneProtected = function(a) {
  29075. G.prototype.cloneProtected.call(this, a);
  29076. this.Ca &= -32769;
  29077. a.Js = this.Js;
  29078. a.Ls = this.Ls;
  29079. a.Rl = this.Rl;
  29080. a.Nt = this.Nt;
  29081. var b = a.qu(function(a) { return a instanceof Yj });
  29082. a.Rb = b instanceof Yj ? b : null;
  29083. null !== this.we ? (a.we = this.we.copy(), a.we.group = a) : (null !== a.we && (a.we.group = null), a.we = null)
  29084. };
  29085. I.prototype.Ei = function(a) {
  29086. G.prototype.Ei.call(this, a);
  29087. var b = a.pq();
  29088. for (a = a.uc; a.next();) {
  29089. var c = a.value;
  29090. c.K();
  29091. c.L(8);
  29092. c.iu();
  29093. if (c instanceof G) c.kg(b);
  29094. else if (c instanceof J)
  29095. for (c = c.Af; c.next();) c.value.kg(b)
  29096. }
  29097. };
  29098. I.prototype.qo = function(a, b, c, d, e, g, h) {
  29099. if (a === hg && "elements" === b)
  29100. if (e instanceof Yj) {
  29101. var k = e;
  29102. null === this.Rb ? this.Rb = k : this.Rb !== k && D.k("Cannot insert a second Placeholder into the visual tree of a Group.")
  29103. } else e instanceof x && (k = e.qu(function(a) { return a instanceof Yj }), k instanceof Yj && (null === this.Rb ? this.Rb = k : this.Rb !== k && D.k("Cannot insert a second Placeholder into the visual tree of a Group.")));
  29104. else a === ig && "elements" === b && null !== this.Rb && (d === this.Rb ? this.Rb = null : d instanceof x && this.Rb.xm(d) &&
  29105. (this.Rb = null));
  29106. G.prototype.qo.call(this, a, b, c, d, e, g, h)
  29107. };
  29108. I.prototype.Cj = function(a, b, c, d) {
  29109. this.Ql = this.Rb;
  29110. x.prototype.Cj.call(this, a, b, c, d)
  29111. };
  29112. I.prototype.ym = function() { if (!G.prototype.ym.call(this)) return !1; for (var a = this.uc; a.next();) { var b = a.value; if (b instanceof G) { if (b.isVisible() && Om(b)) return !1 } else if (b instanceof J && b.isVisible() && Om(b) && b.$ !== this && b.ba !== this) return !1 } return !0 };
  29113. D.w(I, { placeholder: "placeholder" }, function() { return this.Rb });
  29114. D.defineProperty(I, { nI: "computesBoundsAfterDrag" }, function() { return 0 !== (this.Ca & 2048) }, function(a) {
  29115. var b = 0 !== (this.Ca & 2048);
  29116. b !== a && (D.h(a, "boolean", I, "computesBoundsAfterDrag"), this.Ca ^= 2048, this.i("computesBoundsAfterDrag", b, a))
  29117. });
  29118. D.defineProperty(I, { Jx: "computesBoundsIncludingLinks" }, function() { return 0 !== (this.Ca & 4096) }, function(a) {
  29119. D.h(a, "boolean", I, "computesBoundsIncludingLinks");
  29120. var b = 0 !== (this.Ca & 4096);
  29121. b !== a && (this.Ca ^= 4096, this.i("computesBoundsIncludingLinks", b, a))
  29122. });
  29123. D.defineProperty(I, { oI: "computesBoundsIncludingLocation" }, function() { return 0 !== (this.Ca & 8192) }, function(a) {
  29124. D.h(a, "boolean", I, "computesBoundsIncludingLocation");
  29125. var b = 0 !== (this.Ca & 8192);
  29126. b !== a && (this.Ca ^= 8192, this.i("computesBoundsIncludingLocation", b, a))
  29127. });
  29128. D.defineProperty(I, { cJ: "handlesDragDropForMembers" }, function() { return 0 !== (this.Ca & 16384) }, function(a) {
  29129. D.h(a, "boolean", I, "handlesDragDropForMembers");
  29130. var b = 0 !== (this.Ca & 16384);
  29131. b !== a && (this.Ca ^= 16384, this.i("handlesDragDropForMembers", b, a))
  29132. });
  29133. D.w(I, { uc: "memberParts" }, function() { return this.Ks.j });
  29134. function tr(a, b) {
  29135. if (a.Ks.add(b)) {
  29136. b instanceof I && a.gn.add(b);
  29137. var c = a.MJ;
  29138. if (null !== c) {
  29139. var d = !0,
  29140. e = a.g;
  29141. null !== e && (d = e.$a, e.$a = !0);
  29142. c(a, b);
  29143. null !== e && (e.$a = d)
  29144. }
  29145. a.isVisible() && a.md || b.Pd(!1)
  29146. }
  29147. b instanceof J && !a.Jx || (c = a.Rb, null === c && (c = a), c.K())
  29148. }
  29149. function sr(a, b) {
  29150. if (a.Ks.remove(b)) {
  29151. b instanceof I && a.gn.remove(b);
  29152. var c = a.NJ;
  29153. if (null !== c) {
  29154. var d = !0,
  29155. e = a.g;
  29156. null !== e && (d = e.$a, e.$a = !0);
  29157. c(a, b);
  29158. null !== e && (e.$a = d)
  29159. }
  29160. a.isVisible() && a.md || b.Pd(!0)
  29161. }
  29162. b instanceof J && !a.Jx || (c = a.Rb, null === c && (c = a), c.K())
  29163. }
  29164. I.prototype.Nn = function() {
  29165. if (0 < this.Ks.count) {
  29166. var a = this.g;
  29167. if (null !== a)
  29168. for (var b = this.Ks.copy().j; b.next();) a.remove(b.value)
  29169. }
  29170. G.prototype.Nn.call(this)
  29171. };
  29172. D.defineProperty(I, { Yb: "layout" }, function() { return this.we }, function(a) {
  29173. var b = this.we;
  29174. b !== a && (null !== a && D.l(a, $g, I, "layout"), null !== b && (b.g = null, b.group = null), this.we = a, null !== a && (a.g = this.g, a.group = this), this.i("layout", b, a))
  29175. });
  29176. D.defineProperty(I, { MJ: "memberAdded" }, function() { return this.Js }, function(a) {
  29177. var b = this.Js;
  29178. b !== a && (null !== a && D.h(a, "function", I, "memberAdded"), this.Js = a, this.i("memberAdded", b, a))
  29179. });
  29180. D.defineProperty(I, { NJ: "memberRemoved" }, function() { return this.Ls }, function(a) {
  29181. var b = this.Ls;
  29182. b !== a && (null !== a && D.h(a, "function", I, "memberRemoved"), this.Ls = a, this.i("memberRemoved", b, a))
  29183. });
  29184. D.defineProperty(I, { BB: "memberValidation" }, function() { return this.Rl }, function(a) {
  29185. var b = this.Rl;
  29186. b !== a && (null !== a && D.h(a, "function", I, "memberValidation"), this.Rl = a, this.i("memberValidation", b, a))
  29187. });
  29188. I.prototype.canAddMembers = function(a) {
  29189. var b = this.g;
  29190. if (null === b) return !1;
  29191. b = b.yb;
  29192. for (a = Xh(a).j; a.next();)
  29193. if (!b.isValidMember(this, a.value)) return !1;
  29194. return !0
  29195. };
  29196. I.prototype.addMembers = function(a, b) { var c = this.g; if (null === c) return !1; for (var c = c.yb, d = !0, e = Xh(a).j; e.next();) { var g = e.value;!b || c.isValidMember(this, g) ? g.Ka = this : d = !1 } return d };
  29197. D.defineProperty(I, { IK: "ungroupable" }, function() { return 0 !== (this.Ca & 256) }, function(a) {
  29198. var b = 0 !== (this.Ca & 256);
  29199. b !== a && (D.h(a, "boolean", I, "ungroupable"), this.Ca ^= 256, this.i("ungroupable", b, a))
  29200. });
  29201. I.prototype.canUngroup = function() {
  29202. if (!this.IK) return !1;
  29203. var a = this.layer;
  29204. if (null !== a && !a.Ex) return !1;
  29205. a = a.g;
  29206. return null === a || a.Ex ? !0 : !1
  29207. };
  29208. I.prototype.kg = function(a) {
  29209. void 0 === a && (a = null);
  29210. var b = 0 !== (this.Ca & 65536);
  29211. G.prototype.kg.call(this, a);
  29212. if (!b)
  29213. for (0 !== (this.Ca & 65536) !== !0 && (this.Ca ^= 65536), b = this.EF(); b.next();) {
  29214. var c = b.value;
  29215. if (null === a || !a.contains(c)) {
  29216. var d = c.$;
  29217. null !== d && d !== this && d.Fi(this) && !d.isVisible() ? (Dr(d, c.oc), Dr(d, c.Gc), c.ec()) : (d = c.ba, null !== d && d !== this && d.Fi(this) && !d.isVisible() && (Dr(d, c.oc), Dr(d, c.Gc), c.ec()))
  29218. }
  29219. }
  29220. };
  29221. I.prototype.findExternalLinksConnected = I.prototype.EF = function() {
  29222. var a = this.pq();
  29223. a.add(this);
  29224. for (var b = new L(J), c = a.j; c.next();) {
  29225. var d = c.value;
  29226. if (d instanceof G)
  29227. for (d = d.Od; d.next();) {
  29228. var e = d.value;
  29229. a.contains(e) || b.add(e)
  29230. }
  29231. }
  29232. return b.j
  29233. };
  29234. I.prototype.findExternalNodesConnected = function() {
  29235. var a = this.pq();
  29236. a.add(this);
  29237. for (var b = new L(G), c = a.j; c.next();) {
  29238. var d = c.value;
  29239. if (d instanceof G)
  29240. for (d = d.Od; d.next();) {
  29241. var e = d.value,
  29242. g = e.$;
  29243. a.contains(g) && g !== this || b.add(g);
  29244. e = e.ba;
  29245. a.contains(e) && e !== this || b.add(e)
  29246. }
  29247. }
  29248. return b.j
  29249. };
  29250. I.prototype.findContainingGroupChain = function() {
  29251. function a(b, d) { null !== b && (d.add(b), a(b.Ka, d)) }
  29252. var b = new L(I);
  29253. a(this, b);
  29254. return b
  29255. };
  29256. I.prototype.findSubGraphParts = I.prototype.pq = function() {
  29257. var a = new L(F);
  29258. Qh(a, this, !0, 0, !0);
  29259. a.remove(this);
  29260. return a
  29261. };
  29262. I.prototype.Pd = function(a) { G.prototype.Pd.call(this, a); for (var b = this.uc; b.next();) b.value.Pd(a) };
  29263. I.prototype.collapseSubGraph = I.prototype.collapseSubGraph = function() {
  29264. var a = this.g;
  29265. if (null !== a && !a.Ph) {
  29266. a.Ph = !0;
  29267. var b = this.pq();
  29268. qs(this, b, a.Ra, this);
  29269. a.Ph = !1
  29270. }
  29271. };
  29272. function qs(a, b, c, d) {
  29273. for (var e = a.uc; e.next();) {
  29274. var g = e.value;
  29275. g.Pd(!1);
  29276. if (g instanceof I) {
  29277. var h = g;
  29278. h.md && (h.Zy = h.md, qs(h, b, c, d))
  29279. }
  29280. if (g instanceof G) g.kg(b), ql(c, g, d);
  29281. else if (g instanceof J)
  29282. for (g = g.Af; g.next();) g.value.kg(b)
  29283. }
  29284. a.md = !1
  29285. }
  29286. I.prototype.expandSubGraph = I.prototype.expandSubGraph = function() {
  29287. var a = this.g;
  29288. if (null !== a && !a.Ph) {
  29289. a.Ph = !0;
  29290. var b = this.pq();
  29291. rs(this, b, a.Ra, this);
  29292. a.Ph = !1
  29293. }
  29294. };
  29295. function rs(a, b, c, d) {
  29296. for (var e = a.uc; e.next();) {
  29297. var g = e.value;
  29298. g.Pd(!0);
  29299. if (g instanceof I) {
  29300. var h = g;
  29301. h.Zy && (h.Zy = !1, rs(h, b, c, d))
  29302. }
  29303. if (g instanceof G) g.kg(b), pl(c, g, d);
  29304. else if (g instanceof J)
  29305. for (g = g.Af; g.next();) g.value.kg(b)
  29306. }
  29307. a.md = !0
  29308. }
  29309. D.defineProperty(I, { md: "isSubGraphExpanded" }, function() { return 0 !== (this.Ca & 512) }, function(a) {
  29310. var b = 0 !== (this.Ca & 512);
  29311. if (b !== a) {
  29312. D.h(a, "boolean", I, "isSubGraphExpanded");
  29313. this.Ca ^= 512;
  29314. var c = this.g;
  29315. this.i("isSubGraphExpanded", b, a);
  29316. b = this.yK;
  29317. if (null !== b) {
  29318. var d = !0;
  29319. null !== c && (d = c.$a, c.$a = !0);
  29320. b(this);
  29321. null !== c && (c.$a = d)
  29322. }
  29323. null !== c && c.na.ub ? null !== this.Rb && this.Rb.K() : a ? this.expandSubGraph() : this.collapseSubGraph()
  29324. }
  29325. });
  29326. D.defineProperty(I, { Zy: "wasSubGraphExpanded" }, function() { return 0 !== (this.Ca & 1024) }, function(a) {
  29327. var b = 0 !== (this.Ca & 1024);
  29328. b !== a && (D.h(a, "boolean", I, "wasSubGraphExpanded"), this.Ca ^= 1024, this.i("wasSubGraphExpanded", b, a))
  29329. });
  29330. D.defineProperty(I, { yK: "subGraphExpandedChanged" }, function() { return this.Nt }, function(a) {
  29331. var b = this.Nt;
  29332. b !== a && (null !== a && D.h(a, "function", I, "subGraphExpandedChanged"), this.Nt = a, this.i("subGraphExpandedChanged", b, a))
  29333. });
  29334. I.prototype.move = function(a) {
  29335. var b = this.position,
  29336. c = b.x;
  29337. isNaN(c) && (c = 0);
  29338. b = b.y;
  29339. isNaN(b) && (b = 0);
  29340. var c = a.x - c,
  29341. b = a.y - b,
  29342. d = D.Fb(c, b);
  29343. G.prototype.move.call(this, a);
  29344. a = new L(J);
  29345. for (var e = this.pq().j; e.next();) {
  29346. var g = e.value;
  29347. g instanceof J && (g.Ji && a.add(g), g.Ji = !0)
  29348. }
  29349. for (e.reset(); e.next();)
  29350. if (g = e.value, !(g instanceof J || g instanceof G && g.Lf)) {
  29351. var h = g.position,
  29352. k = g.location;
  29353. h.H() ? (d.x = h.x + c, d.y = h.y + b, g.position = d) : k.H() && (d.x = k.x + c, d.y = k.y + b, g.location = d)
  29354. }
  29355. for (e.reset(); e.next();)
  29356. if (g = e.value, g instanceof J && (g.Ji =
  29357. a.contains(g), g.Uf || g.$ !== this && g.ba !== this)) h = g.position, d.x = h.x + c, d.y = h.y + b, g.move(d), Mi(g) && g.ec();
  29358. D.A(d)
  29359. };
  29360. D.defineProperty(I, { no: null }, function() { return 0 !== (this.Ca & 32768) }, function(a) { 0 !== (this.Ca & 32768) !== a && (this.Ca ^= 32768) });
  29361. function Yj() {
  29362. O.call(this);
  29363. this.tf = Sd;
  29364. this.xt = new C(NaN, NaN, NaN, NaN)
  29365. }
  29366. D.Ta(Yj, O);
  29367. D.ka("Placeholder", Yj);
  29368. Yj.prototype.cloneProtected = function(a) {
  29369. O.prototype.cloneProtected.call(this, a);
  29370. a.tf = this.tf.V();
  29371. a.xt = this.xt.copy()
  29372. };
  29373. Yj.prototype.Rk = function(a) { if (null === this.background && null === this.gm) return !1; var b = this.Ga; return Vb(0, 0, b.width, b.height, a.x, a.y) };
  29374. Yj.prototype.ho = function() {
  29375. var a = this.Y;
  29376. null !== a && (a instanceof I || a instanceof da) || D.k("Placeholder is not inside a Group or Adornment.");
  29377. if (a instanceof I) {
  29378. var b = this.computeBorder(this.xt),
  29379. c = this.fd;
  29380. Cb(c, b.width || 0, b.height || 0);
  29381. Jo(this, 0, 0, c.width, c.height);
  29382. for (var d = a.uc, c = !1; d.next();)
  29383. if (d.value.isVisible()) { c = !0; break }
  29384. d = a.g;
  29385. !c || null === d || d.Ra.nf || isNaN(b.x) || isNaN(b.y) || (c = D.P(), c.uo(b, a.Of), a.location = new N(c.x, c.y), D.A(c))
  29386. } else {
  29387. var b = this.Ea,
  29388. c = this.fd,
  29389. d = this.padding,
  29390. e = d.left + d.right,
  29391. g = d.top +
  29392. d.bottom;
  29393. if (b.H()) Cb(c, b.width + e || 0, b.height + g || 0), Jo(this, -d.left, -d.top, c.width, c.height);
  29394. else {
  29395. var h = a.Bb,
  29396. k = h.fb(ec, D.P()),
  29397. b = D.vg(k.x, k.y, 0, 0);
  29398. b.Mi(h.fb(vc, k));
  29399. b.Mi(h.fb(kc, k));
  29400. b.Mi(h.fb(tc, k));
  29401. a.jj.n(b.x, b.y);
  29402. Cb(c, b.width + e || 0, b.height + g || 0);
  29403. Jo(this, -d.left, -d.top, c.width, c.height);
  29404. D.A(k);
  29405. D.Lb(b)
  29406. }
  29407. }
  29408. };
  29409. Yj.prototype.Cj = function(a, b, c, d) {
  29410. var e = this.aa;
  29411. e.x = a;
  29412. e.y = b;
  29413. e.width = c;
  29414. e.height = d
  29415. };
  29416. Yj.prototype.computeBorder = function(a) {
  29417. var b = this.Y;
  29418. if (b instanceof I) { var c = b; if (c.nI && this.xt.H()) { var d = c.g; if (null !== d && (d = d.eb, d instanceof Uh && !d.Vr && null !== d.hc && !d.hc.contains(c))) return a.assign(this.xt), a } }
  29419. var c = D.Sf(),
  29420. d = this.computeMemberBounds(c),
  29421. e = this.padding;
  29422. a.n(d.x - e.left, d.y - e.top, Math.max(d.width + e.left + e.right, 0), Math.max(d.height + e.top + e.bottom, 0));
  29423. D.Lb(c);
  29424. b instanceof I && (c = b, c.oI && c.location.H() && a.Mi(c.location));
  29425. return a
  29426. };
  29427. Yj.prototype.computeMemberBounds = function(a) {
  29428. if (!(this.Y instanceof I)) return a.n(0, 0, 0, 0), a;
  29429. for (var b = this.Y, c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = b.uc; h.next();) {
  29430. var k = h.value;
  29431. if (k.isVisible()) {
  29432. if (k instanceof J) { var l = k; if (!b.Jx) continue; if (Nm(l)) continue; if (l.$ === b || l.ba === b) continue }
  29433. k = k.aa;
  29434. k.left < c && (c = k.left);
  29435. k.top < d && (d = k.top);
  29436. k.right > e && (e = k.right);
  29437. k.bottom > g && (g = k.bottom)
  29438. }
  29439. }
  29440. isFinite(c) && isFinite(d) ? a.n(c, d, e - c, g - d) : (b = b.location, c = this.padding, a.n(b.x + c.left, b.y + c.top, 0, 0));
  29441. return a
  29442. };
  29443. D.defineProperty(Yj, { padding: "padding" }, function() { return this.tf }, function(a) {
  29444. "number" === typeof a ? a = new Lb(a) : D.l(a, Lb, Yj, "padding");
  29445. var b = this.tf;
  29446. b.O(a) || (this.tf = a = a.V(), this.i("padding", b, a))
  29447. });
  29448. function $g() {
  29449. 0 < arguments.length && D.zd($g);
  29450. D.xc(this);
  29451. this.Uz = this.ca = null;
  29452. this.Kl = this.qs = !0;
  29453. this.ws = !1;
  29454. this.mr = (new N(0, 0)).freeze();
  29455. this.ss = this.ts = !0;
  29456. this.mD = "";
  29457. this.vs = !1;
  29458. this.gA = null
  29459. }
  29460. D.ka("Layout", $g);
  29461. $g.prototype.cloneProtected = function(a) {
  29462. a.qs = this.qs;
  29463. a.Kl = this.Kl;
  29464. a.ws = this.ws;
  29465. a.mr.assign(this.mr);
  29466. a.ts = this.ts;
  29467. a.ss = this.ss;
  29468. a.mD = this.mD;
  29469. a.vs = !0
  29470. };
  29471. $g.prototype.copy = function() {
  29472. var a = new this.constructor;
  29473. this.cloneProtected(a);
  29474. return a
  29475. };
  29476. $g.prototype.qc = function(a) { D.ak(this, a) };
  29477. $g.prototype.toString = function() {
  29478. var a = D.wf(Object.getPrototypeOf(this)),
  29479. a = a + "(";
  29480. null !== this.group && (a += " in " + this.group);
  29481. null !== this.g && (a += " for " + this.g);
  29482. return a + ")"
  29483. };
  29484. D.defineProperty($g, { g: "diagram" }, function() { return this.ca }, function(a) {
  29485. null !== a && D.l(a, E, $g, "diagram");
  29486. this.ca = a
  29487. });
  29488. D.defineProperty($g, { group: "group" }, function() { return this.Uz }, function(a) { this.Uz !== a && (null !== a && D.l(a, I, $g, "group"), this.Uz = a, null !== a && (this.ca = a.g)) });
  29489. D.defineProperty($g, { tJ: "isOngoing" }, function() { return this.qs }, function(a) { this.qs !== a && (D.h(a, "boolean", $g, "isOngoing"), this.qs = a) });
  29490. D.defineProperty($g, { kG: "isInitial" }, function() { return this.Kl }, function(a) {
  29491. D.h(a, "boolean", $g, "isInitial");
  29492. this.Kl = a;
  29493. a || (this.vs = !0)
  29494. });
  29495. D.defineProperty($g, { my: "isViewportSized" }, function() { return this.ws }, function(a) { this.ws !== a && (D.h(a, "boolean", $g, "isViewportSized"), (this.ws = a) && this.L()) });
  29496. D.defineProperty($g, { Pu: "isRouting" }, function() { return this.ts }, function(a) { this.ts !== a && (D.h(a, "boolean", $g, "isRouting"), this.ts = a) });
  29497. D.defineProperty($g, { mG: "isRealtime" }, function() { return this.ss }, function(a) { this.ss !== a && (D.h(a, "boolean", $g, "isRealtime"), this.ss = a) });
  29498. D.defineProperty($g, { zf: "isValidLayout" }, function() { return this.vs }, function(a) { this.vs !== a && (D.h(a, "boolean", $g, "isValidLayout"), this.vs = a, a || (a = this.g, null !== a && (a.xl = !0))) });
  29499. $g.prototype.invalidateLayout = $g.prototype.L = function() { if (this.zf) { var a = this.g; if (null !== a && !a.na.ub) { var b = a.Ra;!b.np && (b.nf && b.Yh(), this.tJ && a.Zn || this.kG && !a.Zn) && (this.zf = !1, a.Ve()) } } };
  29500. D.defineProperty($g, { network: "network" }, function() { return this.gA }, function(a) {
  29501. var b = this.gA;
  29502. b !== a && (null !== a && D.l(a, ua, $g, "network"), null !== b && (b.Yb = null), this.gA = a, null !== a && (a.Yb = this))
  29503. });
  29504. $g.prototype.createNetwork = function() { return new ua };
  29505. $g.prototype.makeNetwork = function(a) {
  29506. var b = this.createNetwork();
  29507. b.Yb = this;
  29508. a instanceof E ? (b.Ok(a.rg, !0), b.Ok(a.links, !0)) : a instanceof I ? b.Ok(a.uc) : b.Ok(a.j);
  29509. return b
  29510. };
  29511. $g.prototype.updateParts = function() {
  29512. var a = this.g;
  29513. if (null === a && null !== this.network)
  29514. for (var b = this.network.vertexes.j; b.next();) { var c = b.value.Zc; if (null !== c && (a = c.g, null !== a)) break }
  29515. this.zf = !0;
  29516. try { null !== a && a.Nb("Layout"), this.commitLayout() } finally { null !== a && a.jd("Layout") }
  29517. };
  29518. $g.prototype.commitLayout = function() {
  29519. for (var a = this.network.vertexes.j; a.next();) a.value.commit();
  29520. if (this.Pu)
  29521. for (a = this.network.edges.j; a.next();) a.value.commit()
  29522. };
  29523. $g.prototype.doLayout = function(a) {
  29524. null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
  29525. var b = new L(F);
  29526. a instanceof E ? (ss(this, b, a.rg, !0, this.no, !0, !1, !0), ss(this, b, a.Hi, !0, this.no, !0, !1, !0)) : a instanceof I ? ss(this, b, a.uc, !1, this.no, !0, !1, !0) : b.Vc(a.j);
  29527. var c = b.count;
  29528. if (0 < c) {
  29529. a = this.g;
  29530. null !== a && a.Nb("Layout");
  29531. c = Math.ceil(Math.sqrt(c));
  29532. this.Zd = this.initialOrigin(this.Zd);
  29533. for (var d = this.Zd.x, e = d, g = this.Zd.y, h = 0, k = 0, b = b.j; b.next();) {
  29534. var l =
  29535. b.value;
  29536. l.kf();
  29537. var m = l.Fa,
  29538. n = m.width,
  29539. m = m.height;
  29540. l.moveTo(e, g);
  29541. l instanceof I && (l.no = !1);
  29542. e += Math.max(n, 50) + 20;
  29543. k = Math.max(k, Math.max(m, 50));
  29544. h >= c - 1 ? (h = 0, e = d, g += k + 20, k = 0) : h++
  29545. }
  29546. null !== a && a.jd("Layout")
  29547. }
  29548. this.zf = !0
  29549. };
  29550. $g.prototype.no = function(a) { return !a.location.H() || a instanceof I && a.no ? !0 : !1 };
  29551. function ss(a, b, c, d, e, g, h, k) {
  29552. for (c = c.j; c.next();) {
  29553. var l = c.value;
  29554. d && !l.Bq || null !== e && !e(l) || !l.canLayout() || (g && l instanceof G ? l.Lf || (l instanceof I ? null === l.Yb ? ss(a, b, l.uc, !1, e, g, h, k) : (ts(l), b.add(l)) : (ts(l), b.add(l))) : h && l instanceof J ? b.add(l) : !k || !l.qe() || l instanceof G || (ts(l), b.add(l)))
  29555. }
  29556. }
  29557. function ts(a) {
  29558. var b = a.aa;
  29559. (0 === b.width || 0 === b.height || isNaN(b.width) || isNaN(b.height)) && a.kf()
  29560. }
  29561. $g.prototype.collectParts = $g.prototype.iI = function(a) {
  29562. var b = new L(F);
  29563. a instanceof E ? (ss(this, b, a.rg, !0, null, !0, !0, !0), ss(this, b, a.links, !0, null, !0, !0, !0), ss(this, b, a.Hi, !0, null, !0, !0, !0)) : a instanceof I ? ss(this, b, a.uc, !1, null, !0, !0, !0) : ss(this, b, a.j, !1, null, !0, !0, !0);
  29564. return b
  29565. };
  29566. D.defineProperty($g, { Zd: "arrangementOrigin" }, function() { return this.mr }, function(a) {
  29567. D.l(a, N, $g, "arrangementOrigin");
  29568. this.mr.O(a) || (this.mr.assign(a), this.L())
  29569. });
  29570. $g.prototype.initialOrigin = function(a) {
  29571. var b = this.group;
  29572. if (null !== b) {
  29573. var c = b.position.copy();
  29574. (isNaN(c.x) || isNaN(c.y)) && c.set(a);
  29575. b = b.placeholder;
  29576. null !== b && (c = b.fb(ec), (isNaN(c.x) || isNaN(c.y)) && c.set(a), c.x += b.padding.left, c.y += b.padding.top);
  29577. return c
  29578. }
  29579. return a
  29580. };
  29581. function ua() {
  29582. D.xc(this);
  29583. this.we = null;
  29584. if (this.vertexes)
  29585. for (var a = this.vertexes.j; a.next();) {
  29586. var b = a.value;
  29587. b.clear();
  29588. b.network = null
  29589. }
  29590. if (this.edges)
  29591. for (a = this.edges.j; a.next();) b = a.value, b.clear(), b.network = null;
  29592. this.vertexes = new L(va);
  29593. this.edges = new L(wa);
  29594. this.xy = new oa(G, va);
  29595. this.qy = new oa(J, wa)
  29596. }
  29597. D.ka("LayoutNetwork", ua);
  29598. ua.prototype.clear = function() {
  29599. if (this.vertexes)
  29600. for (var a = this.vertexes.j; a.next();) {
  29601. var b = a.value;
  29602. b.clear();
  29603. b.network = null
  29604. }
  29605. if (this.edges)
  29606. for (a = this.edges.j; a.next();) b = a.value, b.clear(), b.network = null;
  29607. this.vertexes = new L(va);
  29608. this.edges = new L(wa);
  29609. this.xy = new oa(G, va);
  29610. this.qy = new oa(J, wa)
  29611. };
  29612. ua.prototype.toString = function(a) {
  29613. void 0 === a && (a = 0);
  29614. var b = "LayoutNetwork" + (null !== this.Yb ? "(" + this.Yb.toString() + ")" : "");
  29615. if (0 >= a) return b;
  29616. b += " vertexes: " + this.vertexes.count + " edges: " + this.edges.count;
  29617. if (1 < a) { for (var c = this.vertexes.j; c.next();) b += "\n " + c.value.toString(a - 1); for (c = this.edges.j; c.next();) b += "\n " + c.value.toString(a - 1) }
  29618. return b
  29619. };
  29620. D.defineProperty(ua, { Yb: "layout" }, function() { return this.we }, function(a) {
  29621. v && null !== a && D.l(a, $g, ua, "layout");
  29622. this.we = a
  29623. });
  29624. ua.prototype.createVertex = function() { return new va };
  29625. ua.prototype.createEdge = function() { return new wa };
  29626. ua.prototype.addParts = ua.prototype.Ok = function(a, b, c) {
  29627. if (null !== a) {
  29628. void 0 === b && (b = !1);
  29629. D.h(b, "boolean", ua, "addParts:toplevelonly");
  29630. void 0 === c && (c = null);
  29631. null === c && (c = function(a) {
  29632. if (a instanceof G) return !a.Lf;
  29633. if (a instanceof J) {
  29634. var b = a.$;
  29635. if (null === b || b.Lf) return !1;
  29636. a = a.ba;
  29637. return null === a || a.Lf ? !1 : !0
  29638. }
  29639. return !1
  29640. });
  29641. for (a = a.j; a.next();) {
  29642. var d = a.value;
  29643. if (d instanceof G && (!b || d.Bq) && d.canLayout() && c(d))
  29644. if (d instanceof I && null === d.Yb) this.Ok(d.uc, !1);
  29645. else if (null === this.Rn(d)) {
  29646. var e = this.createVertex();
  29647. e.Zc = d;
  29648. this.em(e)
  29649. }
  29650. }
  29651. for (a.reset(); a.next();)
  29652. if (d = a.value, d instanceof J && (!b || d.Bq) && d.canLayout() && c(d) && null === this.Ux(d)) {
  29653. var g = d.$,
  29654. e = d.ba;
  29655. null !== g && null !== e && g !== e && (g = this.findGroupVertex(g), e = this.findGroupVertex(e), null !== g && null !== e && this.Fq(g, e, d))
  29656. }
  29657. }
  29658. };
  29659. ua.prototype.findGroupVertex = function(a) {
  29660. if (null === a) return null;
  29661. var b = a.findVisibleNode();
  29662. if (null === b) return null;
  29663. a = this.Rn(b);
  29664. if (null !== a) return a;
  29665. for (b = b.Ka; null !== b;) {
  29666. a = this.Rn(b);
  29667. if (null !== a) return a;
  29668. b = b.Ka
  29669. }
  29670. return null
  29671. };
  29672. ua.prototype.addVertex = ua.prototype.em = function(a) {
  29673. if (null !== a) {
  29674. v && D.l(a, va, ua, "addVertex:vertex");
  29675. this.vertexes.add(a);
  29676. var b = a.Zc;
  29677. null !== b && this.xy.add(b, a);
  29678. a.network = this
  29679. }
  29680. };
  29681. ua.prototype.addNode = ua.prototype.bu = function(a) {
  29682. if (null === a) return null;
  29683. v && D.l(a, G, ua, "addNode:node");
  29684. var b = this.Rn(a);
  29685. null === b && (b = this.createVertex(), b.Zc = a, this.em(b));
  29686. return b
  29687. };
  29688. ua.prototype.deleteVertex = ua.prototype.uF = function(a) {
  29689. if (null !== a && (v && D.l(a, va, ua, "deleteVertex:vertex"), us(this, a))) {
  29690. for (var b = a.Ye, c = b.count - 1; 0 <= c; c--) {
  29691. var d = b.fa(c);
  29692. this.kq(d)
  29693. }
  29694. b = a.Re;
  29695. for (c = b.count - 1; 0 <= c; c--) d = b.fa(c), this.kq(d)
  29696. }
  29697. };
  29698. function us(a, b) {
  29699. if (null === b) return !1;
  29700. var c = a.vertexes.remove(b);
  29701. c && (a.xy.remove(b.Zc), b.network = null);
  29702. return c
  29703. }
  29704. ua.prototype.deleteNode = function(a) { null !== a && (v && D.l(a, G, ua, "deleteNode:node"), a = this.Rn(a), null !== a && this.uF(a)) };
  29705. ua.prototype.findVertex = ua.prototype.Rn = function(a) {
  29706. if (null === a) return null;
  29707. v && D.l(a, G, ua, "findVertex:node");
  29708. return this.xy.oa(a)
  29709. };
  29710. ua.prototype.addEdge = ua.prototype.Xp = function(a) {
  29711. if (null !== a) {
  29712. v && D.l(a, wa, ua, "addEdge:edge");
  29713. this.edges.add(a);
  29714. var b = a.link;
  29715. null !== b && null === this.Ux(b) && this.qy.add(b, a);
  29716. b = a.toVertex;
  29717. null !== b && b.WE(a);
  29718. b = a.fromVertex;
  29719. null !== b && b.UE(a);
  29720. a.network = this
  29721. }
  29722. };
  29723. ua.prototype.addLink = function(a) {
  29724. if (null === a) return null;
  29725. v && D.l(a, J, ua, "addLink:link");
  29726. var b = a.$,
  29727. c = a.ba,
  29728. d = this.Ux(a);
  29729. null === d ? (d = this.createEdge(), d.link = a, null !== b && (d.fromVertex = this.bu(b)), null !== c && (d.toVertex = this.bu(c)), this.Xp(d)) : (d.fromVertex = null !== b ? this.bu(b) : null, d.toVertex = null !== c ? this.bu(c) : null);
  29730. return d
  29731. };
  29732. ua.prototype.deleteEdge = ua.prototype.kq = function(a) {
  29733. if (null !== a) {
  29734. v && D.l(a, wa, ua, "deleteEdge:edge");
  29735. var b = a.toVertex;
  29736. null !== b && b.tF(a);
  29737. b = a.fromVertex;
  29738. null !== b && b.sF(a);
  29739. vs(this, a)
  29740. }
  29741. };
  29742. function vs(a, b) { null !== b && a.edges.remove(b) && (a.qy.remove(b.link), b.network = null) }
  29743. ua.prototype.deleteLink = function(a) { null !== a && (v && D.l(a, J, ua, "deleteLink:link"), a = this.Ux(a), null !== a && this.kq(a)) };
  29744. ua.prototype.findEdge = ua.prototype.Ux = function(a) {
  29745. if (null === a) return null;
  29746. v && D.l(a, J, ua, "findEdge:link");
  29747. return this.qy.oa(a)
  29748. };
  29749. ua.prototype.linkVertexes = ua.prototype.Fq = function(a, b, c) {
  29750. if (null === a || null === b) return null;
  29751. v && (D.l(a, va, ua, "linkVertexes:fromVertex"), D.l(b, va, ua, "linkVertexes:toVertex"), null !== c && D.l(c, J, ua, "linkVertexes:link"));
  29752. if (a.network === this && b.network === this) {
  29753. var d = this.createEdge();
  29754. d.link = c;
  29755. d.fromVertex = a;
  29756. d.toVertex = b;
  29757. this.Xp(d);
  29758. return d
  29759. }
  29760. return null
  29761. };
  29762. ua.prototype.reverseEdge = ua.prototype.Ly = function(a) {
  29763. if (null !== a) {
  29764. v && D.l(a, wa, ua, "reverseEdge:edge");
  29765. var b = a.fromVertex,
  29766. c = a.toVertex;
  29767. null !== b && null !== c && (b.sF(a), c.tF(a), a.Ly(), b.WE(a), c.UE(a))
  29768. }
  29769. };
  29770. ua.prototype.deleteSelfEdges = ua.prototype.Px = function() {
  29771. for (var a = D.mb(), b = this.edges.j; b.next();) {
  29772. var c = b.value;
  29773. c.fromVertex === c.toVertex && a.push(c)
  29774. }
  29775. b = a.length;
  29776. for (c = 0; c < b; c++) this.kq(a[c]);
  29777. D.ya(a)
  29778. };
  29779. ua.prototype.deleteArtificialVertexes = function() {
  29780. for (var a = D.mb(), b = this.vertexes.j; b.next();) {
  29781. var c = b.value;
  29782. null === c.Zc && a.push(c)
  29783. }
  29784. for (var c = a.length, d = 0; d < c; d++) this.uF(a[d]);
  29785. b = D.mb();
  29786. for (c = this.edges.j; c.next();) d = c.value, null === d.link && b.push(d);
  29787. c = b.length;
  29788. for (d = 0; d < c; d++) this.kq(b[d]);
  29789. D.ya(a);
  29790. D.ya(b)
  29791. };
  29792. function ws(a) {
  29793. for (var b = D.mb(), c = a.edges.j; c.next();) {
  29794. var d = c.value;
  29795. null !== d.fromVertex && null !== d.toVertex || b.push(d)
  29796. }
  29797. c = b.length;
  29798. for (d = 0; d < c; d++) a.kq(b[d]);
  29799. D.ya(b)
  29800. }
  29801. ua.prototype.splitIntoSubNetworks = ua.prototype.xK = function() {
  29802. this.deleteArtificialVertexes();
  29803. ws(this);
  29804. this.Px();
  29805. for (var a = new K(ua), b = !0; b;)
  29806. for (var b = !1, c = this.vertexes.j; c.next();) {
  29807. var d = c.value;
  29808. if (0 < d.Ye.count || 0 < d.Re.count) {
  29809. b = this.Yb.createNetwork();
  29810. a.add(b);
  29811. xs(this, b, d);
  29812. b = !0;
  29813. break
  29814. }
  29815. }
  29816. a.sort(function(a, b) { return null === a || null === b || a === b ? 0 : b.vertexes.count - a.vertexes.count });
  29817. return a
  29818. };
  29819. function xs(a, b, c) {
  29820. if (null !== c && c.network !== b) {
  29821. us(a, c);
  29822. b.em(c);
  29823. for (var d = c.wc; d.next();) {
  29824. var e = d.value;
  29825. e.network !== b && (vs(a, e), b.Xp(e), xs(a, b, e.fromVertex))
  29826. }
  29827. for (d = c.tc; d.next();) c = d.value, c.network !== b && (vs(a, c), b.Xp(c), xs(a, b, c.toVertex))
  29828. }
  29829. }
  29830. ua.prototype.findAllParts = function() { for (var a = new L(F), b = this.vertexes.j; b.next();) a.add(b.value.Zc); for (b = this.edges.j; b.next();) a.add(b.value.link); return a };
  29831. function va() {
  29832. D.xc(this);
  29833. this.network = null;
  29834. this.Q = (new C(0, 0, 10, 10)).freeze();
  29835. this.W = (new N(5, 5)).freeze();
  29836. this.Gd = this.Sd = null;
  29837. this.Ye = new K(wa);
  29838. this.Re = new K(wa)
  29839. }
  29840. D.ka("LayoutVertex", va);
  29841. va.prototype.clear = function() {
  29842. this.Gd = this.Sd = null;
  29843. this.Ye = new K(wa);
  29844. this.Re = new K(wa)
  29845. };
  29846. va.prototype.toString = function(a) {
  29847. void 0 === a && (a = 0);
  29848. var b = "LayoutVertex#" + D.Nd(this);
  29849. if (0 < a && (b += null !== this.Zc ? "(" + this.Zc.toString() + ")" : "", 1 < a)) {
  29850. a = "";
  29851. for (var c = !0, d = this.Ye.j; d.next();) {
  29852. var e = d.value;
  29853. c ? c = !1 : a += ",";
  29854. a += e.toString(0)
  29855. }
  29856. e = "";
  29857. c = !0;
  29858. for (d = this.Re.j; d.next();) {
  29859. var g = d.value;
  29860. c ? c = !1 : e += ",";
  29861. e += g.toString(0)
  29862. }
  29863. b += " sources: " + a + " destinations: " + e
  29864. }
  29865. return b
  29866. };
  29867. D.defineProperty(va, { data: "data" }, function() { return this.Sd }, function(a) {
  29868. this.Sd = a;
  29869. if (null !== a) {
  29870. var b = a.bounds;
  29871. a = b.x;
  29872. var c = b.y,
  29873. d = b.width,
  29874. b = b.height;
  29875. this.W.n(d / 2, b / 2);
  29876. this.Q.n(a, c, d, b)
  29877. }
  29878. });
  29879. D.defineProperty(va, { Zc: "node" }, function() { return this.Gd }, function(a) {
  29880. if (this.Gd !== a) {
  29881. v && null !== a && D.l(a, G, va, "node");
  29882. this.Gd = a;
  29883. a.kf();
  29884. var b = a.aa,
  29885. c = b.x,
  29886. d = b.y,
  29887. e = b.width,
  29888. b = b.height;
  29889. isNaN(c) && (c = 0);
  29890. isNaN(d) && (d = 0);
  29891. this.Q.n(c, d, e, b);
  29892. if (!(a instanceof I) && (a = a.Bf.fb(mc), a.H())) { this.W.n(a.x - c, a.y - d); return }
  29893. this.W.n(e / 2, b / 2)
  29894. }
  29895. });
  29896. D.defineProperty(va, { pb: "bounds" }, function() { return this.Q }, function(a) { this.Q.O(a) || (v && D.l(a, C, va, "bounds"), this.Q.assign(a)) });
  29897. D.defineProperty(va, { focus: "focus" }, function() { return this.W }, function(a) { this.W.O(a) || (v && D.l(a, N, va, "focus"), this.W.assign(a)) });
  29898. D.defineProperty(va, { pa: "centerX" }, function() { return this.Q.x + this.W.x }, function(a) {
  29899. var b = this.Q;
  29900. b.x + this.W.x !== a && (v && D.p(a, va, "centerX"), b.Xa(), b.x = a - this.W.x, b.freeze())
  29901. });
  29902. D.defineProperty(va, { va: "centerY" }, function() { return this.Q.y + this.W.y }, function(a) {
  29903. var b = this.Q;
  29904. b.y + this.W.y !== a && (v && D.p(a, va, "centerY"), b.Xa(), b.y = a - this.W.y, b.freeze())
  29905. });
  29906. D.defineProperty(va, { xu: "focusX" }, function() { return this.W.x }, function(a) {
  29907. var b = this.W;
  29908. b.x !== a && (b.Xa(), b.x = a, b.freeze())
  29909. });
  29910. D.defineProperty(va, { yu: "focusY" }, function() { return this.W.y }, function(a) {
  29911. var b = this.W;
  29912. b.y !== a && (b.Xa(), b.y = a, b.freeze())
  29913. });
  29914. D.defineProperty(va, { x: "x" }, function() { return this.Q.x }, function(a) {
  29915. var b = this.Q;
  29916. b.x !== a && (b.Xa(), b.x = a, b.freeze())
  29917. });
  29918. D.defineProperty(va, { y: "y" }, function() { return this.Q.y }, function(a) {
  29919. var b = this.Q;
  29920. b.y !== a && (b.Xa(), b.y = a, b.freeze())
  29921. });
  29922. D.defineProperty(va, { width: "width" }, function() { return this.Q.width }, function(a) {
  29923. var b = this.Q;
  29924. b.width !== a && (b.Xa(), b.width = a, b.freeze())
  29925. });
  29926. D.defineProperty(va, { height: "height" }, function() { return this.Q.height }, function(a) {
  29927. var b = this.Q;
  29928. b.height !== a && (b.Xa(), b.height = a, b.freeze())
  29929. });
  29930. va.prototype.commit = function() {
  29931. var a = this.Sd;
  29932. if (null !== a) {
  29933. var b = this.pb,
  29934. c = a.bounds;
  29935. D.Qa(c) ? (c.x = b.x, c.y = b.y, c.width = b.width, c.height = b.height) : a.bounds = b.copy()
  29936. } else if (a = this.Zc, null !== a) {
  29937. b = this.pb;
  29938. if (!(a instanceof I)) {
  29939. var c = a.aa,
  29940. d = a.Bf.fb(mc);
  29941. if (c.H() && d.H()) { a.moveTo(b.x + this.xu - (d.x - c.x), b.y + this.yu - (d.y - c.y)); return }
  29942. }
  29943. a.moveTo(b.x, b.y)
  29944. }
  29945. };
  29946. va.prototype.addSourceEdge = va.prototype.WE = function(a) { null !== a && (v && D.l(a, wa, va, "addSourceEdge:edge"), this.Ye.contains(a) || this.Ye.add(a)) };
  29947. va.prototype.deleteSourceEdge = va.prototype.tF = function(a) { null !== a && (v && D.l(a, wa, va, "deleteSourceEdge:edge"), this.Ye.remove(a)) };
  29948. va.prototype.addDestinationEdge = va.prototype.UE = function(a) { null !== a && (v && D.l(a, wa, va, "addDestinationEdge:edge"), this.Re.contains(a) || this.Re.add(a)) };
  29949. va.prototype.deleteDestinationEdge = va.prototype.sF = function(a) { null !== a && (v && D.l(a, wa, va, "deleteDestinationEdge:edge"), this.Re.remove(a)) };
  29950. D.w(va, { wK: "sourceVertexes" }, function() { for (var a = new L(va), b = this.wc; b.next();) a.add(b.value.fromVertex); return a.j });
  29951. D.w(va, { zI: "destinationVertexes" }, function() { for (var a = new L(va), b = this.tc; b.next();) a.add(b.value.toVertex); return a.j });
  29952. D.w(va, { vertexes: "vertexes" }, function() { for (var a = new L(va), b = this.wc; b.next();) a.add(b.value.fromVertex); for (b = this.tc; b.next();) a.add(b.value.toVertex); return a.j });
  29953. D.w(va, { wc: "sourceEdges" }, function() { return this.Ye.j });
  29954. D.w(va, { tc: "destinationEdges" }, function() { return this.Re.j });
  29955. D.w(va, { edges: "edges" }, function() { for (var a = new K(wa), b = this.wc; b.next();) a.add(b.value); for (b = this.tc; b.next();) a.add(b.value); return a.j });
  29956. D.w(va, { KI: "edgesCount" }, function() { return this.Ye.count + this.Re.count });
  29957. var ys;
  29958. va.standardComparer = ys = function(a, b) {
  29959. v && D.l(a, va, va, "standardComparer:m");
  29960. v && D.l(b, va, va, "standardComparer:n");
  29961. var c = a.Gd,
  29962. d = b.Gd;
  29963. return c ? d ? (c = c.text, d = d.text, c < d ? -1 : c > d ? 1 : 0) : 1 : null !== d ? -1 : 0
  29964. };
  29965. va.smartComparer = function(a, b) {
  29966. v && D.l(a, va, va, "smartComparer:m");
  29967. v && D.l(b, va, va, "smartComparer:n");
  29968. if (null !== a) {
  29969. if (null !== b) {
  29970. var c = a.Gd,
  29971. d = b.Gd;
  29972. if (null !== c) {
  29973. if (null !== d) {
  29974. for (var c = c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e = 0; e < c.length; e++)
  29975. if ("" !== d[e] && void 0 !== d[e]) {
  29976. var g = parseFloat(c[e]),
  29977. h = parseFloat(d[e]);
  29978. if (isNaN(g)) { if (!isNaN(h)) return 1; if (0 !== c[e].localeCompare(d[e])) return c[e].localeCompare(d[e]) } else {
  29979. if (isNaN(h)) return -1;
  29980. if (0 !== g - h) return g - h
  29981. }
  29982. } else if ("" !== c[e]) return 1;
  29983. return "" !== d[e] && void 0 !== d[e] ? -1 : 0
  29984. }
  29985. return 1
  29986. }
  29987. return null !== d ? -1 : 0
  29988. }
  29989. return 1
  29990. }
  29991. return null !== b ? -1 : 0
  29992. };
  29993. function wa() {
  29994. D.xc(this);
  29995. this.toVertex = this.fromVertex = this.link = this.data = this.network = null
  29996. }
  29997. D.ka("LayoutEdge", wa);
  29998. wa.prototype.clear = function() { this.toVertex = this.fromVertex = this.link = this.data = null };
  29999. wa.prototype.toString = function(a) {
  30000. void 0 === a && (a = 0);
  30001. var b = "LayoutEdge#" + D.Nd(this);
  30002. 0 < a && (b += null !== this.link ? "(" + this.link.toString() + ")" : "", 1 < a && (b += " " + (this.fromVertex ? this.fromVertex.toString() : "null") + " --\x3e " + (this.toVertex ? this.toVertex.toString() : "null")));
  30003. return b
  30004. };
  30005. wa.prototype.Ly = function() {
  30006. var a = this.fromVertex;
  30007. this.fromVertex = this.toVertex;
  30008. this.toVertex = a
  30009. };
  30010. wa.prototype.commit = function() {};
  30011. wa.prototype.getOtherVertex = wa.prototype.VI = function(a) { v && D.l(a, va, wa, "getOtherVertex:v"); return this.toVertex === a ? this.fromVertex : this.fromVertex === a ? this.toVertex : null };
  30012. function Wn() {
  30013. 0 < arguments.length && D.zd(Wn);
  30014. $g.call(this);
  30015. this.my = !0;
  30016. this.Xt = this.Yt = NaN;
  30017. this.fk = (new Ca(NaN, NaN)).freeze();
  30018. this.ui = (new Ca(10, 10)).freeze();
  30019. this.ue = zs;
  30020. this.Bd = As;
  30021. this.ti = Bs;
  30022. this.ci = Cs
  30023. }
  30024. D.Ta(Wn, $g);
  30025. D.ka("GridLayout", Wn);
  30026. Wn.prototype.cloneProtected = function(a) {
  30027. $g.prototype.cloneProtected.call(this, a);
  30028. a.Yt = this.Yt;
  30029. a.Xt = this.Xt;
  30030. a.fk.assign(this.fk);
  30031. a.ui.assign(this.ui);
  30032. a.ue = this.ue;
  30033. a.Bd = this.Bd;
  30034. a.ti = this.ti;
  30035. a.ci = this.ci
  30036. };
  30037. Wn.prototype.qc = function(a) { a.Qe === Wn ? a === Bs || a === Ds || a === Es || a === Fs ? this.sorting = a : a === As || a === Gs ? this.eg = a : a === zs || a === Hs ? this.alignment = a : D.k("Unknown enum value: " + a) : $g.prototype.qc.call(this, a) };
  30038. Wn.prototype.doLayout = function(a) {
  30039. null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
  30040. this.Zd = this.initialOrigin(this.Zd);
  30041. var b = this.g;
  30042. a = this.iI(a);
  30043. for (var c = a.copy().j; c.next();) {
  30044. var d = c.value;
  30045. if (d instanceof J) { var e = d; if (null !== e.$ || null !== e.ba) { a.remove(e); continue } }
  30046. d.kf();
  30047. if (d instanceof I)
  30048. for (d = d.uc; d.next();) a.remove(d.value)
  30049. }
  30050. e = a.Fc();
  30051. if (0 !== e.length) {
  30052. switch (this.sorting) {
  30053. case Fs:
  30054. e.reverse();
  30055. break;
  30056. case Bs:
  30057. e.sort(this.comparer);
  30058. break;
  30059. case Ds:
  30060. e.sort(this.comparer), e.reverse()
  30061. }
  30062. var g = this.MK;
  30063. isNaN(g) && (g = 0);
  30064. var h = this.zH,
  30065. h = isNaN(h) && null !== b ? Math.max(b.wb.width - b.padding.left - b.padding.right, 0) : Math.max(this.zH, 0);
  30066. 0 >= g && 0 >= h && (g = 1);
  30067. a = this.spacing.width;
  30068. isFinite(a) || (a = 0);
  30069. c = this.spacing.height;
  30070. isFinite(c) || (c = 0);
  30071. null !== b && b.Nb("Layout");
  30072. d = [];
  30073. switch (this.alignment) {
  30074. case Hs:
  30075. var k = a,
  30076. l = c,
  30077. m = Math.max(this.bq.width, 1);
  30078. if (!isFinite(m))
  30079. for (var n = m = 0; n < e.length; n++) var p = e[n],
  30080. q = p.Fa,
  30081. m = Math.max(m, q.width);
  30082. var m = Math.max(m + k, 1),
  30083. r = Math.max(this.bq.height,
  30084. 1);
  30085. if (!isFinite(r))
  30086. for (n = r = 0; n < e.length; n++) p = e[n], q = p.Fa, r = Math.max(r, q.height);
  30087. for (var r = Math.max(r + l, 1), s = this.eg, u = this.Zd.x, t = u, y = this.Zd.y, w = 0, A = 0, n = 0; n < e.length; n++) {
  30088. var p = e[n],
  30089. q = p.Fa,
  30090. B = Math.ceil((q.width + k) / m) * m,
  30091. P = Math.ceil((q.height + l) / r) * r,
  30092. H = 0;
  30093. switch (s) {
  30094. case Gs:
  30095. H = Math.abs(t - q.width);
  30096. break;
  30097. default:
  30098. H = t + q.width
  30099. }
  30100. if (0 < g && w > g - 1 || 0 < h && 0 < w && H > h) d.push(new C(0, y, h + k, A)), w = 0, t = u, y += A, A = 0;
  30101. A = Math.max(A, P);
  30102. P = 0;
  30103. switch (s) {
  30104. case Gs:
  30105. P = -q.width;
  30106. break;
  30107. default:
  30108. P = 0
  30109. }
  30110. p.moveTo(t + P, y);
  30111. switch (s) {
  30112. case Gs:
  30113. t -= B;
  30114. break;
  30115. default:
  30116. t += B
  30117. }
  30118. w++
  30119. }
  30120. d.push(new C(0, y, h + k, A));
  30121. break;
  30122. case zs:
  30123. k = g;
  30124. l = a;
  30125. m = c;
  30126. n = Math.max(this.bq.width, 1);
  30127. p = y = B = 0;
  30128. q = D.P();
  30129. for (g = 0; g < e.length; g++) r = e[g], s = r.Fa, u = lr(r, r.Bf, r.Of, q), B = Math.max(B, u.x), y = Math.max(y, s.width - u.x), p = Math.max(p, u.y);
  30130. t = this.eg;
  30131. switch (t) {
  30132. case Gs:
  30133. B += l;
  30134. break;
  30135. default:
  30136. y += l
  30137. }
  30138. var n = isFinite(n) ? Math.max(n + l, 1) : Math.max(B + y, 1),
  30139. R = y = this.Zd.x,
  30140. w = this.Zd.y,
  30141. A = 0;
  30142. h >= B && (h -= B);
  30143. for (var B = P = 0, H = Math.max(this.bq.height, 1), aa = p = 0, V = !0, ea = D.P(), g = 0; g < e.length; g++) {
  30144. r = e[g];
  30145. s = r.Fa;
  30146. u = lr(r, r.Bf, r.Of, q);
  30147. if (0 < A) switch (t) {
  30148. case Gs:
  30149. R =
  30150. (R - y - (s.width - u.x)) / n;
  30151. R = Eb(Math.round(R), R) ? Math.round(R) : Math.floor(R);
  30152. R = R * n + y;
  30153. break;
  30154. default:
  30155. R = (R - y + u.x) / n, R = Eb(Math.round(R), R) ? Math.round(R) : Math.ceil(R), R = R * n + y
  30156. } else switch (t) {
  30157. case Gs:
  30158. P = R + u.x + s.width;
  30159. break;
  30160. default:
  30161. P = R - u.x
  30162. }
  30163. var la = 0;
  30164. switch (t) {
  30165. case Gs:
  30166. la = -(R + u.x) + P;
  30167. break;
  30168. default:
  30169. la = R + s.width - u.x - P
  30170. }
  30171. if (0 < k && A > k - 1 || 0 < h && 0 < A && la > h) {
  30172. d.push(new C(0, V ? w - p : w, h + l, aa + p + m));
  30173. for (R = 0; R < A && g !== A; R++) {
  30174. var la = e[g - A + R],
  30175. Da = lr(la, la.Bf, la.Of, ea);
  30176. la.moveTo(la.position.x, la.position.y + p - Da.y)
  30177. }
  30178. aa += m;
  30179. w = V ? w + aa : w + (aa + p);
  30180. A = aa = p = 0;
  30181. R = y;
  30182. V = !1
  30183. }
  30184. R === y && (B = t === Gs ? Math.max(B, s.width - u.x) : Math.min(B, -u.x));
  30185. p = Math.max(p, u.y);
  30186. aa = Math.max(aa, s.height - u.y);
  30187. isFinite(H) && (aa = Math.max(aa, Math.max(s.height, H) - u.y));
  30188. V ? r.moveTo(R - u.x, w - u.y) : r.moveTo(R - u.x, w);
  30189. switch (t) {
  30190. case Gs:
  30191. R -= u.x + l;
  30192. break;
  30193. default:
  30194. R += s.width - u.x + l
  30195. }
  30196. A++
  30197. }
  30198. d.push(new C(0, w, h + l, (V ? aa : aa + p) + m));
  30199. for (R = 0; R < A && g !== A; R++) la = e[g - A + R], Da = lr(la, la.Bf, la.Of, q), la.moveTo(la.position.x, la.position.y + p - Da.y);
  30200. D.A(q);
  30201. D.A(ea);
  30202. if (t === Gs)
  30203. for (g = 0; g < d.length; g++) e = d[g], e.width += B, e.x -= B;
  30204. else
  30205. for (g =
  30206. 0; g < d.length; g++) e = d[g], e.x > B && (e.width += e.x - B, e.x = B)
  30207. }
  30208. for (k = g = h = e = 0; k < d.length; k++) l = d[k], e = Math.min(e, l.x), h = Math.min(h, l.y), g = Math.max(g, l.x + l.width);
  30209. this.eg === Gs ? this.commitLayers(d, new N(e + a / 2 - (g + e), h - c / 2)) : this.commitLayers(d, new N(e - a / 2, h - c / 2));
  30210. null !== b && b.jd("Layout");
  30211. this.zf = !0
  30212. }
  30213. };
  30214. Wn.prototype.commitLayers = function() {};
  30215. D.defineProperty(Wn, { zH: "wrappingWidth" }, function() { return this.Yt }, function(a) { this.Yt !== a && (D.h(a, "number", Wn, "wrappingWidth"), 0 < a || isNaN(a)) && (this.Yt = a, this.my = isNaN(a), this.L()) });
  30216. D.defineProperty(Wn, { MK: "wrappingColumn" }, function() { return this.Xt }, function(a) { this.Xt !== a && (D.h(a, "number", Wn, "wrappingColumn"), 0 < a || isNaN(a)) && (this.Xt = a, this.L()) });
  30217. D.defineProperty(Wn, { bq: "cellSize" }, function() { return this.fk }, function(a) {
  30218. D.l(a, Ca, Wn, "cellSize");
  30219. this.fk.O(a) || (this.fk.assign(a), this.L())
  30220. });
  30221. D.defineProperty(Wn, { spacing: "spacing" }, function() { return this.ui }, function(a) {
  30222. D.l(a, Ca, Wn, "spacing");
  30223. this.ui.O(a) || (this.ui.assign(a), this.L())
  30224. });
  30225. D.defineProperty(Wn, { alignment: "alignment" }, function() { return this.ue }, function(a) { this.ue !== a && (D.Da(a, Wn, Wn, "alignment"), a === zs || a === Hs) && (this.ue = a, this.L()) });
  30226. D.defineProperty(Wn, { eg: "arrangement" }, function() { return this.Bd }, function(a) { this.Bd !== a && (D.Da(a, Wn, Wn, "arrangement"), a === As || a === Gs) && (this.Bd = a, this.L()) });
  30227. D.defineProperty(Wn, { sorting: "sorting" }, function() { return this.ti }, function(a) { this.ti !== a && (D.Da(a, Wn, Wn, "sorting"), a === Es || a === Fs || a === Bs || a === Ds) && (this.ti = a, this.L()) });
  30228. D.defineProperty(Wn, { comparer: "comparer" }, function() { return this.ci }, function(a) { this.ci !== a && (D.h(a, "function", Wn, "comparer"), this.ci = a, this.L()) });
  30229. var Cs;
  30230. Wn.standardComparer = Cs = function(a, b) {
  30231. v && D.l(a, F, Wn, "standardComparer:a");
  30232. v && D.l(b, F, Wn, "standardComparer:b");
  30233. var c = a.text,
  30234. d = b.text;
  30235. return c < d ? -1 : c > d ? 1 : 0
  30236. };
  30237. Wn.smartComparer = function(a, b) {
  30238. v && D.l(a, F, Wn, "standardComparer:a");
  30239. v && D.l(b, F, Wn, "standardComparer:b");
  30240. if (null !== a) {
  30241. if (null !== b) {
  30242. for (var c = a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e = 0; e < c.length; e++)
  30243. if ("" !== d[e] && void 0 !== d[e]) {
  30244. var g = parseFloat(c[e]),
  30245. h = parseFloat(d[e]);
  30246. if (isNaN(g)) { if (!isNaN(h)) return 1; if (0 !== c[e].localeCompare(d[e])) return c[e].localeCompare(d[e]) } else {
  30247. if (isNaN(h)) return -1;
  30248. if (0 !== g - h) return g - h
  30249. }
  30250. } else if ("" !== c[e]) return 1;
  30251. return "" !== d[e] && void 0 !== d[e] ? -1 : 0
  30252. }
  30253. return 1
  30254. }
  30255. return null !== b ? -1 : 0
  30256. };
  30257. var Hs;
  30258. Wn.Position = Hs = D.s(Wn, "Position", 0);
  30259. var zs;
  30260. Wn.Location = zs = D.s(Wn, "Location", 1);
  30261. var As;
  30262. Wn.LeftToRight = As = D.s(Wn, "LeftToRight", 2);
  30263. var Gs;
  30264. Wn.RightToLeft = Gs = D.s(Wn, "RightToLeft", 3);
  30265. var Es;
  30266. Wn.Forward = Es = D.s(Wn, "Forward", 4);
  30267. var Fs;
  30268. Wn.Reverse = Fs = D.s(Wn, "Reverse", 5);
  30269. var Bs;
  30270. Wn.Ascending = Bs = D.s(Wn, "Ascending", 6);
  30271. var Ds;
  30272. Wn.Descending = Ds = D.s(Wn, "Descending", 7);
  30273. function Is() {
  30274. 0 < arguments.length && D.zd(Is);
  30275. $g.call(this);
  30276. this.Lz = this.Yo = this.Td = 0;
  30277. this.Wr = 360;
  30278. this.Kz = Js;
  30279. this.Dl = 0;
  30280. this.HC = new N;
  30281. this.tD = Js;
  30282. this.Qv = this.dg = this.IE = 0;
  30283. this.ux = new Ks;
  30284. this.Rv = this.kn = 0;
  30285. this.MH = 600;
  30286. this.lt = NaN;
  30287. this.or = 1;
  30288. this.Mt = 0;
  30289. this.Ot = 360;
  30290. this.Bd = Js;
  30291. this.ga = Ls;
  30292. this.ti = Ms;
  30293. this.ci = ys;
  30294. this.ui = 6;
  30295. this.Zs = Ns
  30296. }
  30297. D.Ta(Is, $g);
  30298. D.ka("CircularLayout", Is);
  30299. Is.prototype.cloneProtected = function(a) {
  30300. $g.prototype.cloneProtected.call(this, a);
  30301. a.lt = this.lt;
  30302. a.or = this.or;
  30303. a.Mt = this.Mt;
  30304. a.Ot = this.Ot;
  30305. a.Bd = this.Bd;
  30306. a.ga = this.ga;
  30307. a.ti = this.ti;
  30308. a.ci = this.ci;
  30309. a.ui = this.ui;
  30310. a.Zs = this.Zs
  30311. };
  30312. Is.prototype.qc = function(a) {
  30313. if (a.Qe === Is)
  30314. if (a === Os || a === Ps || a === Qs || a === Rs || a === Ms) this.sorting = a;
  30315. else if (a === Ss || a === Ts || a === Ls || a === Us) this.direction = a;
  30316. else if (a === Vs || a === Ws || a === Js || a === Xs) this.eg = a;
  30317. else { if (a === Ys || a === Ns) this.wy = a } else $g.prototype.qc.call(this, a)
  30318. };
  30319. Is.prototype.createNetwork = function() { return new Zs };
  30320. Is.prototype.doLayout = function(a) {
  30321. null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
  30322. null === this.network && (this.network = this.makeNetwork(a));
  30323. this.Zd = this.initialOrigin(this.Zd);
  30324. a = this.network.vertexes;
  30325. if (1 >= a.count) 1 === a.count && (a = a.first(), a.pa = 0, a.va = 0);
  30326. else {
  30327. var b = new K($s);
  30328. b.Vc(a.j);
  30329. a = new K($s);
  30330. var c = new K($s),
  30331. d;
  30332. d = this.sort(b);
  30333. var e = this.Kz,
  30334. g = this.tD,
  30335. h = this.Td,
  30336. k = this.Yo,
  30337. l = this.Lz,
  30338. m = this.Wr,
  30339. b = this.Dl,
  30340. n = this.IE,
  30341. p = this.dg,
  30342. q = this.Qv,
  30343. e = this.eg,
  30344. g = this.wy,
  30345. h = this.aK;
  30346. if (!isFinite(h) || 0 >= h) h = NaN;
  30347. k = this.cI;
  30348. if (!isFinite(k) || 0 >= k) k = 1;
  30349. l = this.Me;
  30350. isFinite(l) || (l = 0);
  30351. m = this.Df;
  30352. if (!isFinite(m) || 360 < m || 1 > m) m = 360;
  30353. b = this.spacing;
  30354. isFinite(b) || (b = NaN);
  30355. e === Xs && g === Ys ? e = Js : e === Xs && g !== Ys && (g = Ys, e = this.eg);
  30356. if ((this.direction === Ss || this.direction === Ts) && this.sorting !== Ms) {
  30357. for (var r = 0; !(r >= d.length); r += 2) {
  30358. a.add(d.fa(r));
  30359. if (r + 1 >= d.length) break;
  30360. c.add(d.fa(r + 1))
  30361. }
  30362. this.direction === Ss ? (this.eg === Xs && a.reverse(), d = new K($s), d.Vc(a), d.Vc(c)) : (this.eg === Xs &&
  30363. c.reverse(), d = new K($s), d.Vc(c), d.Vc(a))
  30364. }
  30365. for (var s = d.length, u = n = 0, r = 0; r < d.length; r++) {
  30366. var p = l + m * u * (this.direction === Ls ? 1 : -1) / s,
  30367. t = d.fa(r).diameter;
  30368. isNaN(t) && (t = at(d.fa(r), p));
  30369. 360 > m && (0 === r || r === d.length - 1) && (t /= 2);
  30370. n += t;
  30371. u++
  30372. }
  30373. if (isNaN(h) || e === Xs) {
  30374. isNaN(b) && (b = 6);
  30375. if (e !== Js && e !== Xs) {
  30376. t = -Infinity;
  30377. for (r = 0; r < s; r++) {
  30378. var q = d.fa(r),
  30379. y = d.fa(r === s - 1 ? 0 : r + 1);
  30380. isNaN(q.diameter) && at(q, 0);
  30381. isNaN(y.diameter) && at(y, 0);
  30382. t = Math.max(t, (q.diameter + y.diameter) / 2)
  30383. }
  30384. q = t + b;
  30385. e === Vs ? (p = 2 * Math.PI / s, h = (t + b) / p) : h = bt(this, q * (360 <= m ? s : s - 1),
  30386. k, l * Math.PI / 180, m * Math.PI / 180)
  30387. } else h = bt(this, n + (360 <= m ? s : s - 1) * (e !== Xs ? b : 1.6 * b), k, l * Math.PI / 180, m * Math.PI / 180);
  30388. p = h * k
  30389. } else if (p = h * k, u = ct(this, h, p, l * Math.PI / 180, m * Math.PI / 180), isNaN(b)) { if (e === Js || e === Xs) b = (u - n) / (360 <= m ? s : s - 1) } else if (e === Js || e === Xs) r = (u - n) / (360 <= m ? s : s - 1), r < b ? (h = bt(this, n + b * (360 <= m ? s : s - 1), k, l * Math.PI / 180, m * Math.PI / 180), p = h * k) : b = r;
  30390. else {
  30391. t = -Infinity;
  30392. for (r = 0; r < s; r++) q = d.fa(r), y = d.fa(r === s - 1 ? 0 : r + 1), isNaN(q.diameter) && at(q, 0), isNaN(y.diameter) && at(y, 0), t = Math.max(t, (q.diameter + y.diameter) /
  30393. 2);
  30394. q = t + b;
  30395. r = bt(this, q * (360 <= m ? s : s - 1), k, l * Math.PI / 180, m * Math.PI / 180);
  30396. r > h ? (h = r, p = h * k) : q = u / (360 <= m ? s : s - 1)
  30397. }
  30398. this.Kz = e;
  30399. this.tD = g;
  30400. this.Td = h;
  30401. this.Yo = k;
  30402. this.Lz = l;
  30403. this.Wr = m;
  30404. this.Dl = b;
  30405. this.IE = n;
  30406. this.dg = p;
  30407. this.Qv = q;
  30408. b = d;
  30409. d = this.Kz;
  30410. e = this.Td;
  30411. g = this.Lz;
  30412. k = this.Wr;
  30413. l = this.Dl;
  30414. m = this.dg;
  30415. n = this.Qv;
  30416. if (this.direction !== Ss && this.direction !== Ts || d !== Xs)
  30417. if (this.direction === Ss || this.direction === Ts) {
  30418. h = 0;
  30419. switch (d) {
  30420. case Ws:
  30421. h = 180 * dt(this, e, m, g, n) / Math.PI;
  30422. break;
  30423. case Js:
  30424. n = b = 0;
  30425. h = a.first();
  30426. null !== h && (b = at(h, Math.PI / 2));
  30427. h = c.first();
  30428. null !==
  30429. h && (n = at(h, Math.PI / 2));
  30430. h = 180 * dt(this, e, m, g, l + (b + n) / 2) / Math.PI;
  30431. break;
  30432. case Vs:
  30433. h = k / b.length
  30434. }
  30435. if (this.direction === Ss) {
  30436. switch (d) {
  30437. case Ws:
  30438. et(this, a, g, Us);
  30439. break;
  30440. case Js:
  30441. ft(this, a, g, Us);
  30442. break;
  30443. case Vs:
  30444. gt(this, a, k / 2, g, Us)
  30445. }
  30446. switch (d) {
  30447. case Ws:
  30448. et(this, c, g + h, Ls);
  30449. break;
  30450. case Js:
  30451. ft(this, c, g + h, Ls);
  30452. break;
  30453. case Vs:
  30454. gt(this, c, k / 2, g + h, Ls)
  30455. }
  30456. } else {
  30457. switch (d) {
  30458. case Ws:
  30459. et(this, c, g, Us);
  30460. break;
  30461. case Js:
  30462. ft(this, c, g, Us);
  30463. break;
  30464. case Vs:
  30465. gt(this, c, k / 2, g, Us)
  30466. }
  30467. switch (d) {
  30468. case Ws:
  30469. et(this, a, g + h, Ls);
  30470. break;
  30471. case Js:
  30472. ft(this, a, g + h, Ls);
  30473. break;
  30474. case Vs:
  30475. gt(this,
  30476. a, k / 2, g + h, Ls)
  30477. }
  30478. }
  30479. } else switch (d) {
  30480. case Ws:
  30481. et(this, b, g, this.direction);
  30482. break;
  30483. case Js:
  30484. ft(this, b, g, this.direction);
  30485. break;
  30486. case Vs:
  30487. gt(this, b, k, g, this.direction);
  30488. break;
  30489. case Xs:
  30490. ht(this, b, k, g, this.direction)
  30491. } else ht(this, b, k, g - k / 2, Ls)
  30492. }
  30493. this.updateParts();
  30494. this.network = null;
  30495. this.zf = !0
  30496. };
  30497. function gt(a, b, c, d, e) {
  30498. var g = a.Wr,
  30499. h = a.Td;
  30500. a = a.dg;
  30501. d = d * Math.PI / 180;
  30502. c = c * Math.PI / 180;
  30503. for (var k = b.length, l = 0; l < k; l++) {
  30504. var m = d + (e === Ls ? l * c / (360 <= g ? k : k - 1) : -(l * c) / k),
  30505. n = b.fa(l),
  30506. p = h * Math.tan(m) / a,
  30507. p = Math.sqrt((h * h + a * a * p * p) / (1 + p * p));
  30508. n.pa = p * Math.cos(m);
  30509. n.va = p * Math.sin(m);
  30510. n.actualAngle = 180 * m / Math.PI
  30511. }
  30512. }
  30513. function ft(a, b, c, d) {
  30514. var e = a.Td,
  30515. g = a.dg,
  30516. h = a.Dl;
  30517. c = c * Math.PI / 180;
  30518. for (var k = b.length, l = 0; l < k; l++) {
  30519. var m = b.fa(l),
  30520. n = b.fa(l === k - 1 ? 0 : l + 1),
  30521. p = g * Math.sin(c);
  30522. m.pa = e * Math.cos(c);
  30523. m.va = p;
  30524. m.actualAngle = 180 * c / Math.PI;
  30525. isNaN(m.diameter) && at(m, 0);
  30526. isNaN(n.diameter) && at(n, 0);
  30527. m = dt(a, e, g, d === Ls ? c : -c, (m.diameter + n.diameter) / 2 + h);
  30528. c += d === Ls ? m : -m
  30529. }
  30530. }
  30531. function et(a, b, c, d) {
  30532. var e = a.Td,
  30533. g = a.dg,
  30534. h = a.Qv;
  30535. c = c * Math.PI / 180;
  30536. for (var k = b.length, l = 0; l < k; l++) {
  30537. var m = b.fa(l);
  30538. m.pa = e * Math.cos(c);
  30539. m.va = g * Math.sin(c);
  30540. m.actualAngle = 180 * c / Math.PI;
  30541. m = dt(a, e, g, d === Ls ? c : -c, h);
  30542. c += d === Ls ? m : -m
  30543. }
  30544. }
  30545. function ht(a, b, c, d, e) {
  30546. var g = a.Rv,
  30547. g = a.Wr;
  30548. a.kn = 0;
  30549. a.ux = new Ks;
  30550. if (360 > c) {
  30551. for (g = d + (e === Ls ? g : -g); 0 > g;) g += 360;
  30552. g %= 360;
  30553. 180 < g && (g -= 360);
  30554. g *= Math.PI / 180;
  30555. a.Rv = g;
  30556. it(a, b, c, d, e)
  30557. } else jt(a, b, c, d, e);
  30558. a.ux.commit(b)
  30559. }
  30560. function jt(a, b, c, d, e) {
  30561. var g = a.Td,
  30562. h = a.Dl,
  30563. k = a.Yo,
  30564. l = g * Math.cos(d * Math.PI / 180),
  30565. m = a.dg * Math.sin(d * Math.PI / 180),
  30566. n = b.Fc();
  30567. if (3 === n.length) n[0].pa = g, n[0].va = 0, n[1].pa = n[0].pa - n[0].width / 2 - n[1].width / 2 - h, n[1].y = n[0].y, n[2].pa = (n[0].pa + n[1].pa) / 2, n[2].y = n[0].y - n[2].height - h;
  30568. else if (4 === n.length) n[0].pa = g, n[0].va = 0, n[2].pa = -n[0].pa, n[2].va = n[0].va, n[1].pa = 0, n[1].y = Math.min(n[0].y, n[2].y) - n[1].height - h, n[3].pa = 0, n[3].y = Math.max(n[0].y + n[0].height + h, n[2].y + n[2].height + h);
  30569. else {
  30570. for (var g = D.P(), p = 0; p < n.length; p++) {
  30571. n[p].pa =
  30572. l;
  30573. n[p].va = m;
  30574. if (p >= n.length - 1) break;
  30575. kt(a, l, m, n, p, e, g) || lt(a, l, m, n, p, e, g);
  30576. l = g.x;
  30577. m = g.y
  30578. }
  30579. D.A(g);
  30580. a.kn++;
  30581. if (!(23 < a.kn)) {
  30582. var l = n[0].pa,
  30583. m = n[0].va,
  30584. g = n[n.length - 1].pa,
  30585. p = n[n.length - 1].va,
  30586. q = Math.abs(l - g) - ((n[0].width + n[n.length - 1].width) / 2 + h),
  30587. r = Math.abs(m - p) - ((n[0].height + n[n.length - 1].height) / 2 + h),
  30588. h = 0;
  30589. 1 > Math.abs(r) ? Math.abs(l - g) < (n[0].width + n[n.length - 1].width) / 2 && (h = 0) : h = 0 < r ? r : 1 > Math.abs(q) ? 0 : q;
  30590. q = !1;
  30591. q = Math.abs(g) > Math.abs(p) ? 0 < g !== m > p : 0 < p !== l < g;
  30592. if (q = e === Ls ? q : !q) h = -Math.abs(h), h = Math.min(h, -n[n.length - 1].width),
  30593. h = Math.min(h, -n[n.length - 1].height);
  30594. a.ux.compare(h, n);
  30595. 1 < Math.abs(h) && (a.Td = 8 > a.kn ? a.Td - h / (2 * Math.PI) : 5 > n.length && 10 < h ? a.Td / 2 : a.Td - (0 < h ? 1.7 : -2.3), a.dg = a.Td * k, jt(a, b, c, d, e))
  30596. }
  30597. }
  30598. }
  30599. function it(a, b, c, d, e) {
  30600. for (var g = a.Td, h = a.dg, k = a.Yo, l = g * Math.cos(d * Math.PI / 180), m = h * Math.sin(d * Math.PI / 180), n = D.P(), p = b.Fc(), q = 0; q < p.length; q++) {
  30601. p[q].pa = l;
  30602. p[q].va = m;
  30603. if (q >= p.length - 1) break;
  30604. kt(a, l, m, p, q, e, n) || lt(a, l, m, p, q, e, n);
  30605. l = n.x;
  30606. m = n.y
  30607. }
  30608. D.A(n);
  30609. a.kn++;
  30610. if (!(23 < a.kn)) {
  30611. l = Math.atan2(m, l);
  30612. l = e === Ls ? a.Rv - l : l - a.Rv;
  30613. l = Math.abs(l) < Math.abs(l - 2 * Math.PI) ? l : l - 2 * Math.PI;
  30614. g = l * (g + h) / 2;
  30615. h = a.ux;
  30616. if (Math.abs(g) < Math.abs(h.qq))
  30617. for (h.qq = g, h.Bo = [], h.cr = [], l = 0; l < p.length; l++) h.Bo[l] = p[l].pb.x, h.cr[l] = p[l].pb.y;
  30618. 1 < Math.abs(g) &&
  30619. (a.Td = 8 > a.kn ? a.Td - g / (2 * Math.PI) : a.Td - (0 < g ? 1.7 : -2.3), a.dg = a.Td * k, it(a, b, c, d, e))
  30620. }
  30621. }
  30622. function kt(a, b, c, d, e, g, h) {
  30623. var k = a.Td,
  30624. l = a.dg,
  30625. m = 0,
  30626. n = 0;
  30627. a = (d[e].width + d[e + 1].width) / 2 + a.Dl;
  30628. var p = !1;
  30629. if (0 <= c !== (g === Ls)) {
  30630. if (m = b + a, m > k) {
  30631. m = b - a;
  30632. if (m < -k) return h.x = m, h.y = n, !1;
  30633. p = !0
  30634. }
  30635. } else if (m = b - a, m < -k) {
  30636. m = b + a;
  30637. if (m > k) return h.x = m, h.y = n, !1;
  30638. p = !0
  30639. }
  30640. n = Math.sqrt(1 - Math.min(1, m * m / (k * k))) * l;
  30641. 0 > c !== p && (n = -n);
  30642. if (Math.abs(c - n) > (d[e].height + d[e + 1].height) / 2) return h.x = m, h.y = n, !1;
  30643. h.x = m;
  30644. h.y = n;
  30645. return !0
  30646. }
  30647. function lt(a, b, c, d, e, g, h) {
  30648. var k = a.Td,
  30649. l = a.dg,
  30650. m = 0,
  30651. n = 0;
  30652. a = (d[e].height + d[e + 1].height) / 2 + a.Dl;
  30653. d = !1;
  30654. if (0 <= b !== (g === Ls)) {
  30655. if (n = c - a, n < -l) {
  30656. n = c + a;
  30657. if (n > l) {
  30658. h.x = m;
  30659. h.y = n;
  30660. return
  30661. }
  30662. d = !0
  30663. }
  30664. } else if (n = c + a, n > l) {
  30665. n = c - a;
  30666. if (n < -l) {
  30667. h.x = m;
  30668. h.y = n;
  30669. return
  30670. }
  30671. d = !0
  30672. }
  30673. m = Math.sqrt(1 - Math.min(1, n * n / (l * l))) * k;
  30674. 0 > b !== d && (m = -m);
  30675. h.x = m;
  30676. h.y = n
  30677. }
  30678. Is.prototype.commitLayout = function() {
  30679. this.commitNodes();
  30680. this.Pu && this.commitLinks()
  30681. };
  30682. Is.prototype.commitNodes = function() {
  30683. var a = this.VH,
  30684. b = null !== this.group && null !== this.group.placeholder && this.group.md,
  30685. c = b ? this.group.location.copy() : null;
  30686. b ? a = new N(0, 0) : (a.x = this.Zd.x + this.Td, a.y = this.Zd.y + this.dg);
  30687. for (var d = this.network.vertexes.j; d.next();) {
  30688. var e = d.value;
  30689. e.x += a.x;
  30690. e.y += a.y;
  30691. e.commit()
  30692. }
  30693. b && (this.group.kf(), a = this.group.position.copy(), b = this.group.location.copy(), c = c.$j(b.$j(a)), this.group.move(c), this.HC = c.$j(a))
  30694. };
  30695. Is.prototype.commitLinks = function() { for (var a = this.network.edges.j; a.next();) a.value.commit() };
  30696. function ct(a, b, c, d, e) {
  30697. var g = a.MH;
  30698. if (.001 > Math.abs(a.Yo - 1)) return void 0 !== d && void 0 !== e ? e * b : 2 * Math.PI * b;
  30699. a = b > c ? Math.sqrt(b * b - c * c) / b : Math.sqrt(c * c - b * b) / c;
  30700. for (var h = 0, k = 0, k = void 0 !== d && void 0 !== e ? e / (g + 1) : Math.PI / (2 * (g + 1)), l = 0, m = 0; m <= g; m++) l = void 0 !== d && void 0 !== e ? d + m * e / g : m * Math.PI / (2 * g), l = Math.sin(l), h += Math.sqrt(1 - a * a * l * l) * k;
  30701. return void 0 !== d && void 0 !== e ? (b > c ? b : c) * h : 4 * (b > c ? b : c) * h
  30702. }
  30703. function bt(a, b, c, d, e) {
  30704. var g = 0,
  30705. g = void 0 !== d && void 0 !== e ? ct(a, 1, c, d, e) : ct(a, 1, c);
  30706. return b / g
  30707. }
  30708. function dt(a, b, c, d, e) {
  30709. if (.001 > Math.abs(a.Yo - 1)) return e / b;
  30710. var g = b > c ? Math.sqrt(b * b - c * c) / b : Math.sqrt(c * c - b * b) / c,
  30711. h = 0;
  30712. a = 2 * Math.PI / (700 * a.network.vertexes.count);
  30713. b > c && (d += Math.PI / 2);
  30714. for (var k = 0;; k++) {
  30715. var l = Math.sin(d + k * a),
  30716. h = h + (b > c ? b : c) * Math.sqrt(1 - g * g * l * l) * a;
  30717. if (h >= e) return k * a
  30718. }
  30719. }
  30720. Is.prototype.sort = function(a) {
  30721. switch (this.sorting) {
  30722. case Qs:
  30723. break;
  30724. case Rs:
  30725. a.reverse();
  30726. break;
  30727. case Os:
  30728. a.sort(this.comparer);
  30729. break;
  30730. case Ps:
  30731. a.sort(this.comparer);
  30732. a.reverse();
  30733. break;
  30734. case Ms:
  30735. for (var b = [], c = 0; c < a.length; c++) b.push(0);
  30736. for (var d = new K($s), c = 0; c < a.length; c++) {
  30737. var e = -1,
  30738. g = -1;
  30739. if (0 === c)
  30740. for (var h = 0; h < a.length; h++) {
  30741. var k = a.fa(h).KI;
  30742. k > e && (e = k, g = h)
  30743. } else
  30744. for (h = 0; h < a.length; h++) k = b[h], k > e && (e = k, g = h);
  30745. d.add(a.fa(g));
  30746. b[g] = -1;
  30747. g = a.fa(g);
  30748. e = 0;
  30749. for (h = g.wc; h.next();) e = a.indexOf(h.value.fromVertex), 0 > e || 0 <= b[e] &&
  30750. b[e]++;
  30751. for (g = g.tc; g.next();) e = a.indexOf(g.value.toVertex), 0 > e || 0 <= b[e] && b[e]++
  30752. }
  30753. a = [];
  30754. for (g = 0; g < d.length; g++) {
  30755. b = d.fa(g);
  30756. a[g] = [];
  30757. for (var l = 0, c = b.tc; c.next();) l = d.indexOf(c.value.toVertex), l !== g && 0 > a[g].indexOf(l) && a[g].push(l);
  30758. for (b = b.wc; b.next();) l = d.indexOf(b.value.fromVertex), l !== g && 0 > a[g].indexOf(l) && a[g].push(l)
  30759. }
  30760. h = [];
  30761. for (g = 0; g < a.length; g++) h[g] = 0;
  30762. for (var b = [], k = [], m = [], c = [], e = new K($s), n = 0, g = 0; g < a.length; g++) {
  30763. var p = a[g].length;
  30764. if (1 === p) c.push(g);
  30765. else if (0 === p) e.add(d.fa(g));
  30766. else {
  30767. if (0 === n) b.push(g);
  30768. else {
  30769. for (var q = Infinity, r = Infinity, s = -1, u = [], p = 0; p < b.length; p++) 0 > a[b[p]].indexOf(b[p === b.length - 1 ? 0 : p + 1]) && u.push(p === b.length - 1 ? 0 : p + 1);
  30770. if (0 === u.length)
  30771. for (p = 0; p < b.length; p++) u.push(p);
  30772. for (p = 0; p < u.length; p++) {
  30773. var t = u[p],
  30774. y, l = a[g];
  30775. y = k;
  30776. for (var w = m, A = h, B = t, P = b, H = 0, R = 0; R < y.length; R++) {
  30777. var aa = A[y[R]],
  30778. V = A[w[R]],
  30779. ea = 0,
  30780. la = 0;
  30781. aa < V ? (ea = aa, la = V) : (ea = V, la = aa);
  30782. if (ea < B && B <= la)
  30783. for (aa = 0; aa < l.length; aa++) V = l[aa], 0 > P.indexOf(V) || ea < A[V] && A[V] < la || ea === A[V] || la === A[V] || H++;
  30784. else
  30785. for (aa = 0; aa < l.length; aa++) V = l[aa], 0 > P.indexOf(V) ||
  30786. ea < A[V] && A[V] < la && ea !== A[V] && la !== A[V] && H++
  30787. }
  30788. y = H;
  30789. for (A = w = 0; A < a[g].length; A++) l = b.indexOf(a[g][A]), 0 <= l && (l = Math.abs(t - (l >= t ? l + 1 : l)), w += l < b.length + 1 - l ? l : b.length + 1 - l);
  30790. for (A = 0; A < k.length; A++) l = h[k[A]], B = h[m[A]], l >= t && l++, B >= t && B++, l > B && (P = B, B = l, l = P), B - l < (b.length + 2) / 2 === (l < t && t <= B) && w++;
  30791. if (y < q || y === q && w < r) q = y, r = w, s = t
  30792. }
  30793. b.splice(s, 0, g);
  30794. for (p = 0; p < b.length; p++) h[b[p]] = p;
  30795. for (p = 0; p < a[g].length; p++) q = a[g][p], 0 <= b.indexOf(q) && (k.push(g), m.push(q))
  30796. }
  30797. n++
  30798. }
  30799. }
  30800. g = !1;
  30801. for (h = b.length;;) {
  30802. g = !0;
  30803. for (k = 0; k < c.length; k++)
  30804. if (m =
  30805. c[k], n = a[m][0], l = b.indexOf(n), 0 <= l) {
  30806. for (r = p = 0; r < a[n].length; r++) q = a[n][r], q = b.indexOf(q), 0 > q || q === l || (s = q > l ? q - l : l - q, p += q < l !== s > h - s ? 1 : -1);
  30807. b.splice(0 > p ? l : l + 1, 0, m);
  30808. c.splice(k, 1);
  30809. k--
  30810. } else g = !1;
  30811. if (g) break;
  30812. else b.push(c[0]), c.splice(0, 1)
  30813. }
  30814. for (g = 0; g < b.length; g++) e.add(d.fa(b[g]));
  30815. return e;
  30816. default:
  30817. D.k("Invalid sorting type.")
  30818. }
  30819. return a
  30820. };
  30821. D.defineProperty(Is, { aK: "radius" }, function() { return this.lt }, function(a) { this.lt !== a && (D.h(a, "number", Is, "radius"), 0 < a || isNaN(a)) && (this.lt = a, this.L()) });
  30822. D.defineProperty(Is, { cI: "aspectRatio" }, function() { return this.or }, function(a) { this.or !== a && (D.h(a, "number", Is, "aspectRatio"), 0 < a && (this.or = a, this.L())) });
  30823. D.defineProperty(Is, { Me: "startAngle" }, function() { return this.Mt }, function(a) { this.Mt !== a && (D.h(a, "number", Is, "startAngle"), this.Mt = a, this.L()) });
  30824. D.defineProperty(Is, { Df: "sweepAngle" }, function() { return this.Ot }, function(a) { this.Ot !== a && (D.h(a, "number", Is, "sweepAngle"), this.Ot = 0 < a && 360 >= a ? a : 360, this.L()) });
  30825. D.defineProperty(Is, { eg: "arrangement" }, function() { return this.Bd }, function(a) { this.Bd !== a && (D.Da(a, Is, Is, "arrangement"), a === Xs || a === Js || a === Ws || a === Vs) && (this.Bd = a, this.L()) });
  30826. D.defineProperty(Is, { direction: "direction" }, function() { return this.ga }, function(a) { this.ga !== a && (D.Da(a, Is, Is, "direction"), a === Ls || a === Us || a === Ss || a === Ts) && (this.ga = a, this.L()) });
  30827. D.defineProperty(Is, { sorting: "sorting" }, function() { return this.ti }, function(a) { this.ti !== a && (D.Da(a, Is, Is, "sorting"), a === Qs || a === Rs || a === Os || Ps || a === Ms) && (this.ti = a, this.L()) });
  30828. D.defineProperty(Is, { comparer: "comparer" }, function() { return this.ci }, function(a) { this.ci !== a && (D.h(a, "function", Is, "comparer"), this.ci = a, this.L()) });
  30829. D.defineProperty(Is, { spacing: "spacing" }, function() { return this.ui }, function(a) { this.ui !== a && (D.h(a, "number", Is, "spacing"), this.ui = a, this.L()) });
  30830. D.defineProperty(Is, { wy: "nodeDiameterFormula" }, function() { return this.Zs }, function(a) { this.Zs !== a && (D.Da(a, Is, Is, "nodeDiameterFormula"), a === Ns || a === Ys) && (this.Zs = a, this.L()) });
  30831. D.w(Is, { PK: "actualXRadius" }, function() { return this.Td });
  30832. D.w(Is, { QK: "actualYRadius" }, function() { return this.dg });
  30833. D.w(Is, { OK: "actualSpacing" }, function() { return this.Dl });
  30834. D.w(Is, { VH: "actualCenter" }, function() { return this.HC });
  30835. var Js;
  30836. Is.ConstantSpacing = Js = D.s(Is, "ConstantSpacing", 0);
  30837. var Ws;
  30838. Is.ConstantDistance = Ws = D.s(Is, "ConstantDistance", 1);
  30839. var Vs;
  30840. Is.ConstantAngle = Vs = D.s(Is, "ConstantAngle", 2);
  30841. var Xs;
  30842. Is.Packed = Xs = D.s(Is, "Packed", 3);
  30843. var Ls;
  30844. Is.Clockwise = Ls = D.s(Is, "Clockwise", 4);
  30845. var Us;
  30846. Is.Counterclockwise = Us = D.s(Is, "Counterclockwise", 5);
  30847. var Ss;
  30848. Is.BidirectionalLeft = Ss = D.s(Is, "BidirectionalLeft", 6);
  30849. var Ts;
  30850. Is.BidirectionalRight = Ts = D.s(Is, "BidirectionalRight", 7);
  30851. var Qs;
  30852. Is.Forwards = Qs = D.s(Is, "Forwards", 8);
  30853. var Rs;
  30854. Is.Reverse = Rs = D.s(Is, "Reverse", 9);
  30855. var Os;
  30856. Is.Ascending = Os = D.s(Is, "Ascending", 10);
  30857. var Ps;
  30858. Is.Descending = Ps = D.s(Is, "Descending", 11);
  30859. var Ms;
  30860. Is.Optimized = Ms = D.s(Is, "Optimized", 12);
  30861. var Ns;
  30862. Is.Pythagorean = Ns = D.s(Is, "Pythagorean", 13);
  30863. var Ys;
  30864. Is.Circular = Ys = D.s(Is, "Circular", 14);
  30865. function Ks() {
  30866. this.qq = -Infinity;
  30867. this.cr = this.Bo = null
  30868. }
  30869. Ks.prototype.compare = function(a, b) {
  30870. if (0 < a && 0 > this.qq || Math.abs(a) < Math.abs(this.qq) && !(0 > a && 0 < this.qq)) {
  30871. this.qq = a;
  30872. this.Bo = [];
  30873. this.cr = [];
  30874. for (var c = 0; c < b.length; c++) this.Bo[c] = b[c].pb.x, this.cr[c] = b[c].pb.y
  30875. }
  30876. };
  30877. Ks.prototype.commit = function(a) {
  30878. if (null !== this.Bo && null !== this.cr)
  30879. for (var b = 0; b < this.Bo.length; b++) {
  30880. var c = a.fa(b);
  30881. c.x = this.Bo[b];
  30882. c.y = this.cr[b]
  30883. }
  30884. };
  30885. function Zs() { ua.call(this) }
  30886. D.Ta(Zs, ua);
  30887. D.ka("CircularNetwork", Zs);
  30888. Zs.prototype.createVertex = function() { return new $s };
  30889. Zs.prototype.createEdge = function() { return new mt };
  30890. function $s() {
  30891. va.call(this);
  30892. this.actualAngle = this.diameter = NaN
  30893. }
  30894. D.Ta($s, va);
  30895. D.ka("CircularVertex", $s);
  30896. function at(a, b) {
  30897. var c = a.network;
  30898. if (null === c) return NaN;
  30899. c = c.Yb;
  30900. if (null === c) return NaN;
  30901. if (c.eg === Xs)
  30902. if (c.wy === Ys) a.diameter = Math.max(a.width, a.height);
  30903. else {
  30904. var c = Math.abs(Math.sin(b)),
  30905. d = Math.abs(Math.cos(b));
  30906. if (0 === c) return a.width;
  30907. if (0 === d) return a.height;
  30908. a.diameter = Math.min(a.height / c, a.width / d)
  30909. }
  30910. else a.diameter = c.wy === Ys ? Math.max(a.width, a.height) : Math.sqrt(a.width * a.width + a.height * a.height);
  30911. return a.diameter
  30912. }
  30913. function mt() { wa.call(this) }
  30914. D.Ta(mt, wa);
  30915. D.ka("CircularEdge", mt);
  30916. function nt() {
  30917. 0 < arguments.length && D.zd(nt);
  30918. $g.call(this);
  30919. this.Ug = null;
  30920. this.ys = 0;
  30921. this.xg = (new Ca(100, 100)).freeze();
  30922. this.nr = !1;
  30923. this.si = !0;
  30924. this.bi = !1;
  30925. this.xp = 100;
  30926. this.Zr = 1;
  30927. this.bj = 1E3;
  30928. this.Ts = 10;
  30929. this.mt = Math;
  30930. this.Vo = .05;
  30931. this.Uo = 50;
  30932. this.So = 150;
  30933. this.To = 0;
  30934. this.Lr = 10;
  30935. this.Kr = 5
  30936. }
  30937. D.Ta(nt, $g);
  30938. D.ka("ForceDirectedLayout", nt);
  30939. nt.prototype.cloneProtected = function(a) {
  30940. $g.prototype.cloneProtected.call(this, a);
  30941. a.xg.assign(this.xg);
  30942. a.nr = this.nr;
  30943. a.si = this.si;
  30944. a.bi = this.bi;
  30945. a.xp = this.xp;
  30946. a.Zr = this.Zr;
  30947. a.bj = this.bj;
  30948. a.Ts = this.Ts;
  30949. a.mt = this.mt;
  30950. a.Vo = this.Vo;
  30951. a.Uo = this.Uo;
  30952. a.So = this.So;
  30953. a.To = this.To;
  30954. a.Lr = this.Lr;
  30955. a.Kr = this.Kr
  30956. };
  30957. nt.prototype.createNetwork = function() { return new ot };
  30958. nt.prototype.doLayout = function(a) {
  30959. null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
  30960. null === this.network && (this.network = this.makeNetwork(a));
  30961. a = this.AB;
  30962. if (0 < this.network.vertexes.count) {
  30963. this.network.Px();
  30964. for (var b = this.network.vertexes.j; b.next();) {
  30965. var c = b.value;
  30966. c.charge = this.electricalCharge(c);
  30967. c.mass = this.gravitationalMass(c)
  30968. }
  30969. for (b = this.network.edges.j; b.next();) c = b.value, c.stiffness = this.springStiffness(c), c.length = this.springLength(c);
  30970. this.FA();
  30971. this.ys = 0;
  30972. if (this.needsClusterLayout()) {
  30973. b = this.network;
  30974. for (c = b.xK().j; c.next();) {
  30975. this.network = c.value;
  30976. for (var d = this.network.vertexes.j; d.next();) {
  30977. var e = d.value;
  30978. e.sg = e.vertexes.count;
  30979. e.hl = 1;
  30980. e.Hn = null;
  30981. e.Xh = null
  30982. }
  30983. pt(this, 0, a)
  30984. }
  30985. this.network = b;
  30986. c.reset();
  30987. v && D.l(b, ot, nt, "arrangeConnectedGraphs:singletons");
  30988. for (var d = this.bF, g = c.count, h = !0, k = e = 0, l = D.mb(), m = 0; m < g + b.vertexes.count + 2; m++) l[m] = null;
  30989. g = 0;
  30990. c.reset();
  30991. for (var n = D.Sf(); c.next();)
  30992. if (m = c.value, this.Kh(m, n), h) h = !1, e = n.x + n.width / 2, k = n.y + n.height /
  30993. 2, l[0] = new N(n.x + n.width + d.width, n.y), l[1] = new N(n.x, n.y + n.height + d.height), g = 2;
  30994. else {
  30995. var p = qt(l, g, e, k, n.width, n.height, d),
  30996. q = l[p],
  30997. r = new N(q.x + n.width + d.width, q.y),
  30998. s = new N(q.x, q.y + n.height + d.height);
  30999. p + 1 < g && l.splice(p + 1, 0, null);
  31000. l[p] = r;
  31001. l[p + 1] = s;
  31002. g++;
  31003. p = q.x - n.x;
  31004. q = q.y - n.y;
  31005. for (m = m.vertexes.j; m.next();) r = m.value, r.pa += p, r.va += q
  31006. }
  31007. D.Lb(n);
  31008. for (m = b.vertexes.j; m.next();) h = m.value, n = h.pb, 2 > g ? (e = n.x + n.width / 2, k = n.y + n.height / 2, l[0] = new N(n.x + n.width + d.width, n.y), l[1] = new N(n.x, n.y + n.height + d.height), g = 2) : (p = qt(l, g,
  31009. e, k, n.width, n.height, d), q = l[p], r = new N(q.x + n.width + d.width, q.y), s = new N(q.x, q.y + n.height + d.height), p + 1 < g && l.splice(p + 1, 0, null), l[p] = r, l[p + 1] = s, g++, h.pa = q.x + h.width / 2, h.va = q.y + h.height / 2);
  31010. D.ya(l);
  31011. for (c.reset(); c.next();) { d = c.value; for (e = d.vertexes.j; e.next();) b.em(e.value); for (d = d.edges.j; d.next();) b.Xp(d.value) }
  31012. }
  31013. At(this, a);
  31014. this.updateParts()
  31015. }
  31016. this.xp = a;
  31017. this.network = null;
  31018. this.zf = !0
  31019. };
  31020. nt.prototype.needsClusterLayout = function() {
  31021. if (3 > this.network.vertexes.count) return !1;
  31022. for (var a = 0, b = 0, c = this.network.vertexes.first().pb, d = this.network.vertexes.j; d.next();) {
  31023. if (d.value.pb.jg(c) && (a++, 2 < a)) return !0;
  31024. if (10 < b) break;
  31025. b++
  31026. }
  31027. return !1
  31028. };
  31029. nt.prototype.Kh = function(a, b) {
  31030. for (var c = !0, d = a.vertexes.j; d.next();) {
  31031. var e = d.value;
  31032. c ? (c = !1, b.set(e.pb)) : b.Zh(e.pb)
  31033. }
  31034. return b
  31035. };
  31036. function hu(a, b, c) { v && (D.p(b, nt, "computeClusterLayoutIterations:level"), D.p(c, nt, "computeClusterLayoutIterations:maxiter")); return Math.max(Math.min(a.network.vertexes.count, c * (b + 1) / 11), 10) }
  31037. function pt(a, b, c) {
  31038. v && (D.p(b, nt, "layoutClusters:level"), D.p(c, nt, "layoutClusters:maxiter"));
  31039. if (iu(a, b)) {
  31040. var d = a.bj;
  31041. a.bj *= 1 + 1 / (b + 1);
  31042. var e = ju(a, b),
  31043. g = Math.max(0, hu(a, b, c));
  31044. a.AB += g;
  31045. pt(a, b + 1, c);
  31046. At(a, g);
  31047. ku(a, e, b);
  31048. c = a.Ug;
  31049. null === c ? c = new K(lu) : c.clear();
  31050. c.Vc(e.vertexes);
  31051. c.sort(function(a, b) { return null === a || null === b || a === b ? 0 : b.sg - a.sg });
  31052. for (e = c.j; e.next();) mu(a, e.value, b);
  31053. a.bj = d
  31054. }
  31055. }
  31056. function iu(a, b) {
  31057. v && D.p(b, nt, "hasClusters:level");
  31058. if (10 < b || 3 > a.network.vertexes.count) return !1;
  31059. null === a.Ug ? a.Ug = new K(lu) : a.Ug.clear();
  31060. a.Ug.Vc(a.network.vertexes);
  31061. var c = a.Ug;
  31062. c.sort(function(a, b) { return null === a || null === b || a === b ? 0 : b.sg - a.sg });
  31063. for (var d = c.count - 1; 0 <= d && 1 >= c.fa(d).sg;) d--;
  31064. return 1 < c.count - d
  31065. }
  31066. function ju(a, b) {
  31067. v && D.p(b, nt, "pushSubNetwork:level");
  31068. for (var c = a.network, d = new ot, e = a.Ug.j; e.next();) {
  31069. var g = e.value;
  31070. if (1 < g.sg) {
  31071. d.em(g);
  31072. var h = new nu;
  31073. h.cz = g.sg;
  31074. h.dz = g.width;
  31075. h.bz = g.height;
  31076. h.zC = g.W.x;
  31077. h.AC = g.W.y;
  31078. null === g.Xh && (g.Xh = new K(nu));
  31079. g.Xh.add(h);
  31080. g.UB = g.Xh.count - 1
  31081. } else break
  31082. }
  31083. for (var k = c.edges.j; k.next();)
  31084. if (h = k.value, e = h.fromVertex, g = h.toVertex, e.network === d && g.network === d) d.Xp(h);
  31085. else if (e.network === d) {
  31086. var l = e.Hn;
  31087. null === l && (l = new K(lu), e.Hn = l);
  31088. l.add(g);
  31089. e.sg--;
  31090. e.hl += g.hl
  31091. } else g.network === d && (l =
  31092. g.Hn, null === l && (l = new K(lu), g.Hn = l), l.add(e), g.sg--, g.hl += e.hl);
  31093. for (e = d.edges.j; e.next();) g = e.value, g.length *= Math.max(1, pe((g.fromVertex.hl + g.toVertex.hl) / (4 * b + 1)));
  31094. for (e = d.vertexes.j; e.next();)
  31095. if (g = e.value, l = g.Hn, null !== l && 0 < l.count && (h = g.Xh.fa(g.Xh.count - 1), h = h.cz - g.sg, !(0 >= h))) {
  31096. for (var m = 0, n = 0, p = l.count - h; p < l.count; p++) {
  31097. for (var q = l.fa(p), r = null, k = q.edges.j; k.next();) { var s = k.value; if (s.VI(q) === g) { r = s; break } }
  31098. null !== r && (n += r.length, m += q.width * q.height)
  31099. }
  31100. k = g.pa;
  31101. l = g.va;
  31102. p = g.width;
  31103. q = g.height;
  31104. r = g.W;
  31105. s =
  31106. p * q;
  31107. 1 > s && (s = 1);
  31108. m = pe((m + s + n * n * 4 / (h * h)) / s);
  31109. h = (m - 1) * p / 2;
  31110. m = (m - 1) * q / 2;
  31111. g.pb = new C(k - r.x - h, l - r.y - m, p + 2 * h, q + 2 * m);
  31112. g.focus = new N(r.x + h, r.y + m)
  31113. }
  31114. a.network = d;
  31115. return c
  31116. }
  31117. function ku(a, b, c) {
  31118. v && (D.l(b, ot, nt, "popNetwork:oldnet"), D.p(c, nt, "popNetwork:level"));
  31119. for (c = a.network.vertexes.j; c.next();) {
  31120. var d = c.value;
  31121. d.network = b;
  31122. if (null !== d.Xh) {
  31123. var e = d.Xh.fa(d.UB);
  31124. d.sg = e.cz;
  31125. var g = e.zC,
  31126. h = e.AC;
  31127. d.pb = new C(d.pa - g, d.va - h, e.dz, e.bz);
  31128. d.focus = new N(g, h);
  31129. d.UB--
  31130. }
  31131. }
  31132. for (c = a.network.edges.j; c.next();) c.value.network = b;
  31133. a.network = b
  31134. }
  31135. function mu(a, b, c) {
  31136. v && (D.l(b, lu, nt, "surroundNode:oldnet"), D.p(c, nt, "surroundNode:level"));
  31137. var d = b.Hn;
  31138. if (null !== d && 0 !== d.count) {
  31139. c = b.pa;
  31140. var e = b.va,
  31141. g = b.width,
  31142. h = b.height;
  31143. null !== b.Xh && 0 < b.Xh.count && (h = b.Xh.fa(0), g = h.dz, h = h.bz);
  31144. for (var g = pe(g * g + h * h) / 2, k = !1, l = h = 0, m = 0, n = b.vertexes.j; n.next();) {
  31145. var p = n.value;
  31146. 1 >= p.sg ? l++ : (k = !0, m++, h += Math.atan2(b.va - p.va, b.pa - p.pa))
  31147. }
  31148. if (0 !== l)
  31149. for (0 < m && (h /= m), m = b = 0, b = k ? 2 * Math.PI / (l + 1) : 2 * Math.PI / l, 0 === l % 2 && (m = b / 2), 1 < d.count && d.sort(function(a, b) {
  31150. return null === a || null === b || a ===
  31151. b ? 0 : b.width * b.height - a.width * a.height
  31152. }), k = 0 === l % 2 ? 0 : 1, d = d.j; d.next();)
  31153. if (l = d.value, !(1 < l.sg || a.isFixed(l))) {
  31154. n = null;
  31155. for (p = l.edges.j; p.next();) { n = p.value; break }
  31156. var p = l.width,
  31157. q = l.height,
  31158. p = pe(p * p + q * q) / 2,
  31159. n = g + n.length + p,
  31160. p = h + (b * (k / 2 >> 1) + m) * (0 === k % 2 ? 1 : -1);
  31161. l.pa = c + n * Math.cos(p);
  31162. l.va = e + n * Math.sin(p);
  31163. k++
  31164. }
  31165. }
  31166. }
  31167. function qt(a, b, c, d, e, g, h) {
  31168. var k = 9E19,
  31169. l = -1,
  31170. m = 0;
  31171. a: for (; m < b; m++) {
  31172. var n = a[m],
  31173. p = n.x - c,
  31174. q = n.y - d,
  31175. p = p * p + q * q;
  31176. if (p < k) {
  31177. for (q = m - 1; 0 <= q; q--)
  31178. if (a[q].y > n.y && a[q].x - n.x < e + h.width) continue a;
  31179. for (q = m + 1; q < b; q++)
  31180. if (a[q].x > n.x && a[q].y - n.y < g + h.height) continue a;
  31181. l = m;
  31182. k = p
  31183. }
  31184. }
  31185. return l
  31186. }
  31187. nt.prototype.FA = function() {
  31188. if (this.comments)
  31189. for (var a = this.network.vertexes.j; a.next();) this.addComments(a.value)
  31190. };
  31191. nt.prototype.addComments = function(a) {
  31192. var b = a.Zc;
  31193. if (null !== b)
  31194. for (b = b.GF(); b.next();) {
  31195. var c = b.value;
  31196. if ("Comment" === c.Kd && c.isVisible()) {
  31197. var d = this.network.Rn(c);
  31198. null === d && (d = this.network.bu(c));
  31199. d.charge = this.vI;
  31200. for (var c = null, e = d.tc; e.next();) { var g = e.value; if (g.toVertex === a) { c = g; break } }
  31201. if (null === c)
  31202. for (e = d.wc; e.next();)
  31203. if (g = e.value, g.fromVertex === a) { c = g; break }
  31204. null === c && (c = this.network.Fq(a, d, null));
  31205. c.length = this.wI
  31206. }
  31207. }
  31208. };
  31209. function ou(a, b) {
  31210. v && (D.l(a, lu, nt, "getNodeDistance:vertexA"), D.l(b, lu, nt, "getNodeDistance:vertexB"));
  31211. var c = a.Q,
  31212. d = c.x,
  31213. e = c.y,
  31214. g = c.width,
  31215. c = c.height,
  31216. h = b.Q,
  31217. k = h.x,
  31218. l = h.y,
  31219. m = h.width,
  31220. h = h.height;
  31221. return d + g < k ? e > l + h ? (d = d + g - k, e = e - l - h, pe(d * d + e * e)) : e + c < l ? (d = d + g - k, e = e + c - l, pe(d * d + e * e)) : k - (d + g) : d > k + m ? e > l + h ? (d = d - k - m, e = e - l - h, pe(d * d + e * e)) : e + c < l ? (d = d - k - m, e = e + c - l, pe(d * d + e * e)) : d - (k + m) : e > l + h ? e - (l + h) : e + c < l ? l - (e + c) : .1
  31222. }
  31223. function At(a, b) {
  31224. v && D.p(b, nt, "performIterations:num");
  31225. a.Ug = null;
  31226. for (var c = a.ys + b; a.ys < c && (a.ys++, pu(a)););
  31227. a.Ug = null
  31228. }
  31229. function pu(a) {
  31230. null === a.Ug && (a.Ug = new K(lu), a.Ug.Vc(a.network.vertexes));
  31231. var b = a.Ug.o;
  31232. if (0 >= b.length) return !1;
  31233. var c = b[0];
  31234. c.forceX = 0;
  31235. c.forceY = 0;
  31236. for (var d = c.pa, e = d, g = c.va, h = g, c = 1; c < b.length; c++) {
  31237. var k = b[c];
  31238. k.forceX = 0;
  31239. k.forceY = 0;
  31240. var l = k.pa,
  31241. k = k.va,
  31242. d = Math.min(d, l),
  31243. e = Math.max(e, l),
  31244. g = Math.min(g, k),
  31245. h = Math.max(h, k)
  31246. }(g = e - d > h - g) ? b.sort(function(a, b) { return null === a || null === b || a === b ? 0 : a.pa - b.pa }): b.sort(function(a, b) { return null === a || null === b || a === b ? 0 : a.va - b.va });
  31247. for (var h = a.bj, m = 0, n = 0, p = 0, c = 0; c < b.length; c++) {
  31248. var k =
  31249. b[c],
  31250. l = k.Q,
  31251. q = k.W,
  31252. d = l.x + q.x,
  31253. l = l.y + q.y,
  31254. n = k.charge * a.electricalFieldX(d, l),
  31255. p = k.charge * a.electricalFieldY(d, l),
  31256. n = n + k.mass * a.gravitationalFieldX(d, l),
  31257. p = p + k.mass * a.gravitationalFieldY(d, l);
  31258. k.forceX += n;
  31259. k.forceY += p;
  31260. for (q = c + 1; q < b.length; q++)
  31261. if (e = b[q], e !== k) {
  31262. var r = e.Q,
  31263. n = e.W,
  31264. p = r.x + n.x,
  31265. r = r.y + n.y;
  31266. if (d - p > h || p - d > h) { if (g) break } else if (l - r > h || r - l > h) { if (!g) break } else {
  31267. var s = ou(k, e);
  31268. 1 > s ? (n = a.Fy, null === n && (a.Fy = n = new Ia(0)), m = n.random(), s = n.random(), d > p ? (n = Math.abs(e.Q.right - k.Q.x), n = (1 + n) * m) : d < p ? (n = Math.abs(e.Q.x - k.Q.right),
  31269. n = -(1 + n) * m) : (n = Math.max(e.width, k.width), n = (1 + n) * m - n / 2), l > r ? (p = Math.abs(e.Q.bottom - k.Q.y), p = (1 + p) * s) : d < p ? (p = Math.abs(e.Q.y - k.Q.bottom), p = -(1 + p) * s) : (p = Math.max(e.height, k.height), p = (1 + p) * s - p / 2)) : (m = -(k.charge * e.charge) / (s * s), n = (p - d) / s * m, p = (r - l) / s * m);
  31270. k.forceX += n;
  31271. k.forceY += p;
  31272. e.forceX -= n;
  31273. e.forceY -= p
  31274. }
  31275. }
  31276. }
  31277. for (c = a.network.edges.j; c.next();) g = c.value, k = g.fromVertex, e = g.toVertex, l = k.Q, q = k.W, d = l.x + q.x, l = l.y + q.y, r = e.Q, n = e.W, p = r.x + n.x, r = r.y + n.y, s = ou(k, e), 1 > s ? (n = a.Fy, null === n && (a.Fy = n = new Ia(0)), m = n.random(), s =
  31278. n.random(), n = (d > p ? 1 : -1) * (1 + (e.width > k.width ? e.width : k.width)) * m, p = (l > r ? 1 : -1) * (1 + (e.height > k.height ? e.height : k.height)) * s) : (m = g.stiffness * (s - g.length), n = (p - d) / s * m, p = (r - l) / s * m), k.forceX += n, k.forceY += p, e.forceX -= n, e.forceY -= p;
  31279. c = 0;
  31280. d = a.UJ;
  31281. for (e = 0; e < b.length; e++) k = b[e], a.isFixed(k) ? a.moveFixedVertex(k) : (g = k.forceX, h = k.forceY, g < -d ? g = -d : g > d && (g = d), h < -d ? h = -d : h > d && (h = d), k.pa += g, k.va += h, c = Math.max(c, g * g + h * h));
  31282. return c > a.DF * a.DF
  31283. }
  31284. nt.prototype.moveFixedVertex = function() {};
  31285. nt.prototype.commitLayout = function() {
  31286. this.aC();
  31287. this.commitNodes();
  31288. this.Pu && this.commitLinks()
  31289. };
  31290. nt.prototype.aC = function() {
  31291. if (this.Xq)
  31292. for (var a = this.network.edges.j; a.next();) {
  31293. var b = a.value.link;
  31294. null !== b && (b.Gb = Vc, b.Hb = Vc)
  31295. }
  31296. };
  31297. nt.prototype.commitNodes = function() {
  31298. var a = 0,
  31299. b = 0;
  31300. if (this.bI) {
  31301. var c = D.Sf();
  31302. this.Kh(this.network, c);
  31303. b = this.Zd;
  31304. a = b.x - c.x;
  31305. b = b.y - c.y;
  31306. D.Lb(c)
  31307. }
  31308. for (var c = D.Sf(), d = this.network.vertexes.j; d.next();) {
  31309. var e = d.value;
  31310. if (0 !== a || 0 !== b) c.assign(e.pb), c.x += a, c.y += b, e.pb = c;
  31311. e.commit()
  31312. }
  31313. D.Lb(c)
  31314. };
  31315. nt.prototype.commitLinks = function() { for (var a = this.network.edges.j; a.next();) a.value.commit() };
  31316. nt.prototype.springStiffness = function(a) { a = a.stiffness; return isNaN(a) ? this.Vo : a };
  31317. nt.prototype.springLength = function(a) { a = a.length; return isNaN(a) ? this.Uo : a };
  31318. nt.prototype.electricalCharge = function(a) { a = a.charge; return isNaN(a) ? this.So : a };
  31319. nt.prototype.electricalFieldX = function() { return 0 };
  31320. nt.prototype.electricalFieldY = function() { return 0 };
  31321. nt.prototype.gravitationalMass = function(a) { a = a.mass; return isNaN(a) ? this.To : a };
  31322. nt.prototype.gravitationalFieldX = function() { return 0 };
  31323. nt.prototype.gravitationalFieldY = function() { return 0 };
  31324. nt.prototype.isFixed = function(a) { return a.isFixed };
  31325. D.w(nt, { vL: "currentIteration" }, function() { return this.ys });
  31326. D.defineProperty(nt, { bF: "arrangementSpacing" }, function() { return this.xg }, function(a) {
  31327. D.l(a, Ca, nt, "arrangementSpacing");
  31328. this.xg.O(a) || (this.xg.assign(a), this.L())
  31329. });
  31330. D.defineProperty(nt, { bI: "arrangesToOrigin" }, function() { return this.nr }, function(a) { this.nr !== a && (D.h(a, "boolean", nt, "arrangesToOrigin"), this.nr = a, this.L()) });
  31331. D.defineProperty(nt, { Xq: "setsPortSpots" }, function() { return this.si }, function(a) { this.si !== a && (D.h(a, "boolean", nt, "setsPortSpots"), this.si = a, this.L()) });
  31332. D.defineProperty(nt, { comments: "comments" }, function() { return this.bi }, function(a) { this.bi !== a && (D.h(a, "boolean", nt, "comments"), this.bi = a, this.L()) });
  31333. D.defineProperty(nt, { AB: "maxIterations" }, function() { return this.xp }, function(a) { this.xp !== a && (D.h(a, "number", nt, "maxIterations"), 0 <= a && (this.xp = a, this.L())) });
  31334. D.defineProperty(nt, { DF: "epsilonDistance" }, function() { return this.Zr }, function(a) { this.Zr !== a && (D.h(a, "number", nt, "epsilonDistance"), 0 < a && (this.Zr = a, this.L())) });
  31335. D.defineProperty(nt, { UL: "infinityDistance" }, function() { return this.bj }, function(a) { this.bj !== a && (D.h(a, "number", nt, "infinityDistance"), 1 < a && (this.bj = a, this.L())) });
  31336. D.defineProperty(nt, { UJ: "moveLimit" }, function() { return this.Ts }, function(a) { this.Ts !== a && (D.h(a, "number", nt, "moveLimit"), 1 < a && (this.Ts = a, this.L())) });
  31337. D.defineProperty(nt, { Fy: "randomNumberGenerator" }, function() { return this.mt }, function(a) { this.mt !== a && (null !== a && "function" !== typeof a.random && D.k('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: ' + a), this.mt = a) });
  31338. D.defineProperty(nt, { HL: "defaultSpringStiffness" }, function() { return this.Vo }, function(a) { this.Vo !== a && (D.h(a, "number", nt, "defaultSpringStiffness"), this.Vo = a, this.L()) });
  31339. D.defineProperty(nt, { GL: "defaultSpringLength" }, function() { return this.Uo }, function(a) { this.Uo !== a && (D.h(a, "number", nt, "defaultSpringLength"), this.Uo = a, this.L()) });
  31340. D.defineProperty(nt, { AL: "defaultElectricalCharge" }, function() { return this.So }, function(a) { this.So !== a && (D.h(a, "number", nt, "defaultElectricalCharge"), this.So = a, this.L()) });
  31341. D.defineProperty(nt, { BL: "defaultGravitationalMass" }, function() { return this.To }, function(a) { this.To !== a && (D.h(a, "number", nt, "defaultGravitationalMass"), this.To = a, this.L()) });
  31342. D.defineProperty(nt, { wI: "defaultCommentSpringLength" }, function() { return this.Lr }, function(a) { this.Lr !== a && (D.h(a, "number", nt, "defaultCommentSpringLength"), this.Lr = a, this.L()) });
  31343. D.defineProperty(nt, { vI: "defaultCommentElectricalCharge" }, function() { return this.Kr }, function(a) { this.Kr !== a && (D.h(a, "number", nt, "defaultCommentElectricalCharge"), this.Kr = a, this.L()) });
  31344. function nu() { this.AC = this.zC = this.bz = this.dz = this.cz = 0 }
  31345. function ot() { ua.call(this) }
  31346. D.Ta(ot, ua);
  31347. D.ka("ForceDirectedNetwork", ot);
  31348. ot.prototype.createVertex = function() { return new lu };
  31349. ot.prototype.createEdge = function() { return new qu };
  31350. function lu() {
  31351. va.call(this);
  31352. this.isFixed = !1;
  31353. this.mass = this.charge = NaN;
  31354. this.hl = this.sg = this.forceY = this.forceX = 0;
  31355. this.Xh = this.Hn = null;
  31356. this.UB = 0
  31357. }
  31358. D.Ta(lu, va);
  31359. D.ka("ForceDirectedVertex", lu);
  31360. function qu() {
  31361. wa.call(this);
  31362. this.length = this.stiffness = NaN
  31363. }
  31364. D.Ta(qu, wa);
  31365. D.ka("ForceDirectedEdge", qu);
  31366. function ru() {
  31367. 0 < arguments.length && D.zd(ru);
  31368. $g.call(this);
  31369. this.ie = this.an = 25;
  31370. this.ga = 0;
  31371. this.Ro = su;
  31372. this.sp = tu;
  31373. this.ip = uu;
  31374. this.$m = 4;
  31375. this.Fo = vu;
  31376. this.qj = wu;
  31377. this.si = !0;
  31378. this.Ds = 4;
  31379. this.Qb = this.Bw = this.Ab = -1;
  31380. this.Zf = this.Ms = 0;
  31381. this.Vb = this.Xf = this.Yf = this.Jg = this.ve = null;
  31382. this.Vs = 0;
  31383. this.Us = this.fn = null;
  31384. this.Lg = 0;
  31385. this.Ws = null;
  31386. this.KC = new N;
  31387. this.yh = [];
  31388. this.yh.length = 100
  31389. }
  31390. D.Ta(ru, $g);
  31391. D.ka("LayeredDigraphLayout", ru);
  31392. ru.prototype.cloneProtected = function(a) {
  31393. $g.prototype.cloneProtected.call(this, a);
  31394. a.an = this.an;
  31395. a.ie = this.ie;
  31396. a.ga = this.ga;
  31397. a.Ro = this.Ro;
  31398. a.sp = this.sp;
  31399. a.ip = this.ip;
  31400. a.$m = this.$m;
  31401. a.Fo = this.Fo;
  31402. a.qj = this.qj;
  31403. a.si = this.si;
  31404. a.Ds = this.Ds
  31405. };
  31406. ru.prototype.qc = function(a) { a.Qe === ru ? 0 === a.name.indexOf("Aggressive") ? this.aI = a : 0 === a.name.indexOf("Cycle") ? this.uI = a : 0 === a.name.indexOf("Init") ? this.lJ = a : 0 === a.name.indexOf("Layer") ? this.zJ = a : D.k("Unknown enum value: " + a) : $g.prototype.qc.call(this, a) };
  31407. ru.prototype.createNetwork = function() { return new xu };
  31408. ru.prototype.doLayout = function(a) {
  31409. null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
  31410. null === this.network && (this.network = this.makeNetwork(a));
  31411. this.Zd = this.initialOrigin(this.Zd);
  31412. this.Bw = -1;
  31413. this.Zf = this.Ms = 0;
  31414. this.Ws = this.Us = this.fn = null;
  31415. for (a = 0; a < this.yh.length; a++) this.yh[a] = null;
  31416. if (0 < this.network.vertexes.count) {
  31417. this.network.Px();
  31418. for (a = this.network.edges.j; a.next();) a.value.rev = !1;
  31419. switch (this.Ro) {
  31420. default:
  31421. case yu:
  31422. a = this.network;
  31423. var b =
  31424. 0,
  31425. c = a.vertexes.count - 1,
  31426. d = [];d.length = c + 1;
  31427. for (var e = a.vertexes.j; e.next();) e.value.valid = !0;
  31428. for (; null !== zu(a);) {
  31429. for (e = Au(a); null !== e;) d[c] = e, c--, e.valid = !1, e = Au(a);
  31430. for (e = Bu(a); null !== e;) d[b] = e, b++, e.valid = !1, e = Bu(a);
  31431. for (var e = null, g = 0, h = this.network.vertexes.j; h.next();) { var k = h.value; if (k.valid) { for (var l = 0, m = k.tc; m.next();) m.value.toVertex.valid && l++; for (var m = 0, n = k.wc; n.next();) n.value.fromVertex.valid && m++; if (null === e || g < l - m) e = k, g = l - m } }
  31432. null !== e && (d[b] = e, b++, e.valid = !1)
  31433. }
  31434. for (b = 0; b < a.vertexes.count; b++) d[b].index =
  31435. b;
  31436. for (d = a.edges.j; d.next();) b = d.value,
  31437. b.fromVertex.index > b.toVertex.index && (a.Ly(b), b.rev = !0);
  31438. break;
  31439. case su:
  31440. for (d = this.network.vertexes.j; d.next();) a = d.value, a.lq = -1, a.finish = -1;
  31441. for (a = this.network.edges.j; a.next();) a.value.forest = !1;this.Vs = 0;
  31442. for (d.reset(); d.next();) b = d.value,
  31443. 0 === b.wc.count && Cu(this, b);
  31444. for (d.reset(); d.next();) b = d.value,
  31445. -1 === b.lq && Cu(this, b);
  31446. for (a.reset(); a.next();) d = a.value,
  31447. d.forest || (b = d.fromVertex, c = b.finish, e = d.toVertex, g = e.finish, e.lq < b.lq && c < g && (this.network.Ly(d), d.rev = !0))
  31448. }
  31449. for (a =
  31450. this.network.vertexes.j; a.next();) a.value.layer = -1;
  31451. this.Ab = -1;
  31452. this.assignLayers();
  31453. for (a.reset(); a.next();) this.Ab = Math.max(this.Ab, a.value.layer);
  31454. a = this.network;
  31455. d = [];
  31456. for (c = a.edges.j; c.next();) b = c.value, b.valid = !1, d.push(b);
  31457. for (c = 0; c < d.length; c++)
  31458. if (b = d[c], g = b.fromVertex, e = b.toVertex, !b.valid && (null !== g.Gd && null !== e.Gd || g.layer !== e.layer)) {
  31459. m = k = l = h = 0;
  31460. if (null !== b.link) {
  31461. l = b.link;
  31462. if (null === l) continue;
  31463. var p = g.Gd,
  31464. h = e.Gd;
  31465. if (null === p || null === h) continue;
  31466. var q = l.$,
  31467. k = l.ba,
  31468. r = l.oc,
  31469. m = l.Gc;
  31470. b.rev && (l = q, n = r, q = k, r =
  31471. m, k = l, m = n);
  31472. var s = g.W,
  31473. l = e.W,
  31474. u = b.rev ? e.Q : g.Q,
  31475. n = D.P();
  31476. u.H() ? (lr(q, r, mc, n), n.H() || n.assign(s)) : n.assign(s);
  31477. p !== q && u.H() && q.isVisible() && (p = g.Q, p.H() && (n.x += u.x - p.x, n.y += u.y - p.y));
  31478. q = b.rev ? g.Q : e.Q;
  31479. p = D.P();
  31480. q.H() ? (lr(k, m, mc, p), p.H() || p.assign(l)) : p.assign(l);
  31481. h !== k && q.H() && k.isVisible() && (h = e.Q, h.H() && (p.x += q.x - h.x, p.y += q.y - h.y));
  31482. 90 === this.ga || 270 === this.ga ? (h = Math.round((n.x - s.x) / this.ie), k = n.x, l = Math.round((p.x - l.x) / this.ie), m = p.x) : (h = Math.round((n.y - s.y) / this.ie), k = n.y, l = Math.round((p.y - l.y) / this.ie), m =
  31483. p.y);
  31484. D.A(n);
  31485. D.A(p);
  31486. b.portFromColOffset = h;
  31487. b.portFromPos = k;
  31488. b.portToColOffset = l;
  31489. b.portToPos = m
  31490. } else b.portFromColOffset = 0, b.portFromPos = 0, b.portToColOffset = 0, b.portToPos = 0;
  31491. n = g.layer;
  31492. s = e.layer;
  31493. a: if (p = b, q = 0, u = p.link, null !== u) {
  31494. var t = u.oc,
  31495. y = u.Gc;
  31496. if (null !== t && null !== y) {
  31497. var w = u.$,
  31498. r = u.ba;
  31499. if (null !== w && null !== r) {
  31500. var A = t.Gb,
  31501. B = y.Hb;
  31502. this.Xq || (u.Gb.ld() || (A = u.Gb), u.Hb.ld() || (B = u.Hb));
  31503. var P = u.ic,
  31504. H = Du(this, !0);
  31505. if (A.ld() || A === dc) A = H;
  31506. var R = Du(this, !1);
  31507. if (B.ld() || B === dc) B = R;
  31508. if (A.Pj() && A.Mj(R) && B.Pj() && B.Mj(H)) { q = 0; break a }
  31509. H =
  31510. u.getLinkPoint(w, t, A, !0, P, r, y, D.P());
  31511. A = u.getLinkDirection(w, t, H, A, !0, P, r, y);
  31512. D.A(H);
  31513. A === Eu(this, p, !0) ? q += 1 : this.Xq && null !== w && 1 === w.ports.count && p.rev && (q += 1);
  31514. A = u.getLinkPoint(r, y, B, !1, P, w, t, D.P());
  31515. u = u.getLinkDirection(r, y, A, B, !1, P, w, t);
  31516. D.A(A);
  31517. u === Eu(this, p, !1) ? q += 2 : this.Xq && null !== r && 1 === r.ports.count && p.rev && (q += 2)
  31518. }
  31519. }
  31520. }
  31521. p = 1 === q || 3 === q ? !0 : !1;
  31522. if (q = 2 === q || 3 === q ? !0 : !1) r = a.createVertex(), r.Gd = null, r.En = 1, r.layer = n, r.near = g, a.em(r), g = a.Fq(g, r, b.link), g.valid = !1, g.rev = b.rev, g.portFromColOffset = h, g.portToColOffset =
  31523. 0, g.portFromPos = k, g.portToPos = 0, g = r;
  31524. u = 1;
  31525. p && u--;
  31526. if (n - s > u && 0 < n) {
  31527. b.valid = !1;
  31528. r = a.createVertex();
  31529. r.Gd = null;
  31530. r.En = 2;
  31531. r.layer = n - 1;
  31532. a.em(r);
  31533. g = a.Fq(g, r, b.link);
  31534. g.valid = !0;
  31535. g.rev = b.rev;
  31536. g.portFromColOffset = q ? 0 : h;
  31537. g.portToColOffset = 0;
  31538. g.portFromPos = q ? 0 : k;
  31539. g.portToPos = 0;
  31540. g = r;
  31541. for (n--; n - s > u && 0 < n;) r = a.createVertex(), r.Gd = null, r.En = 3, r.layer = n - 1, a.em(r), g = a.Fq(g, r, b.link), g.valid = !0, g.rev = b.rev, g.portFromColOffset = 0, g.portToColOffset = 0, g.portFromPos = 0, g.portToPos = 0, g = r, n--;
  31542. g = a.Fq(r, e, b.link);
  31543. g.valid = !p;
  31544. p && (r.near = e);
  31545. g.rev =
  31546. b.rev;
  31547. g.portFromColOffset = 0;
  31548. g.portToColOffset = l;
  31549. g.portFromPos = 0;
  31550. g.portToPos = m
  31551. } else b.valid = !0
  31552. }
  31553. d = this.ve = [];
  31554. for (b = 0; b <= this.Ab; b++) d[b] = 0;
  31555. for (a = this.network.vertexes.j; a.next();) a.value.index = -1;
  31556. this.initializeIndices();
  31557. this.Bw = -1;
  31558. for (b = this.Zf = this.Ms = 0; b <= this.Ab; b++) d[b] > d[this.Zf] && (this.Bw = d[b] - 1, this.Zf = b), d[b] < d[this.Ms] && (this.Ms = b);
  31559. this.Ws = [];
  31560. for (b = 0; b < d.length; b++) this.Ws[b] = [];
  31561. for (a.reset(); a.next();) d = a.value, this.Ws[d.layer][d.index] = d;
  31562. this.Qb = -1;
  31563. for (a = 0; a <= this.Ab; a++) {
  31564. d = Fu(this, a);
  31565. b =
  31566. 0;
  31567. c = this.ve[a];
  31568. for (e = 0; e < c; e++) g = d[e], b += this.nodeMinColumnSpace(g, !0), g.column = b, b += 1, b += this.nodeMinColumnSpace(g, !1);
  31569. this.Qb = Math.max(this.Qb, b - 1);
  31570. Gu(this, a, d)
  31571. }
  31572. this.reduceCrossings();
  31573. this.straightenAndPack();
  31574. this.updateParts()
  31575. }
  31576. this.network = null;
  31577. this.zf = !0
  31578. };
  31579. ru.prototype.linkMinLength = function() { return 1 };
  31580. function Hu(a) {
  31581. var b = a.fromVertex.Gd;
  31582. a = a.toVertex.Gd;
  31583. return null === b && null === a ? 8 : null === b || null === a ? 4 : 1
  31584. }
  31585. ru.prototype.nodeMinLayerSpace = function(a, b) { return null === a.Gd ? 0 : 90 === this.ga || 270 === this.ga ? b ? a.W.y + 10 : a.Q.height - a.W.y + 10 : b ? a.W.x + 10 : a.Q.width - a.W.x + 10 };
  31586. ru.prototype.nodeMinColumnSpace = function(a, b) {
  31587. if (null === a.Gd) return 0;
  31588. var c = b ? a.IB : a.HB;
  31589. if (null !== c) return c;
  31590. c = this.ga;
  31591. return 90 === c || 270 === c ? b ? a.IB = a.W.x / this.ie + 1 | 0 : a.HB = (a.Q.width - a.W.x) / this.ie + 1 | 0 : b ? a.IB = a.W.y / this.ie + 1 | 0 : a.HB = (a.Q.height - a.W.y) / this.ie + 1 | 0
  31592. };
  31593. function Iu(a) {
  31594. null === a.fn && (a.fn = []);
  31595. for (var b = 0, c = a.network.vertexes.j; c.next();) {
  31596. var d = c.value;
  31597. a.fn[b] = d.layer;
  31598. b++;
  31599. a.fn[b] = d.column;
  31600. b++;
  31601. a.fn[b] = d.index;
  31602. b++
  31603. }
  31604. return a.fn
  31605. }
  31606. function Ju(a, b) {
  31607. for (var c = 0, d = a.network.vertexes.j; d.next();) {
  31608. var e = d.value;
  31609. e.layer = b[c];
  31610. c++;
  31611. e.column = b[c];
  31612. c++;
  31613. e.index = b[c];
  31614. c++
  31615. }
  31616. }
  31617. function Ku(a, b, c) {
  31618. v && (D.p(b, ru, "crossingMatrix:unfixedLayer"), D.p(c, ru, "crossingMatrix:direction"));
  31619. var d = Fu(a, b),
  31620. e = a.ve[b];
  31621. if (null === a.Us || a.Us.length < e * e) a.Us = [];
  31622. for (var g = a.Us, h = 0; h < e; h++) {
  31623. var k = 0,
  31624. l = d[h],
  31625. m = l.near,
  31626. n = 0;
  31627. if (null !== m && m.layer === l.layer)
  31628. if (n = m.index, n > h)
  31629. for (var p = h + 1; p < n; p++) l = d[p], l.near === m && l.En === m.En || k++;
  31630. else
  31631. for (p = h - 1; p > n; p--) l = d[p], l.near === m && l.En === m.En || k++;
  31632. var m = 0,
  31633. q, r = q = p = l = 0,
  31634. s, u = 0,
  31635. t = 0;
  31636. s = 0;
  31637. var y;
  31638. if (0 <= c)
  31639. for (n = d[h].Ye, m = 0; m < n.count; m++)
  31640. if (q = n.o[m], q.valid && q.fromVertex.layer !==
  31641. b)
  31642. for (l = q.fromVertex.index, p = q.portToPos, q = q.portFromPos, r = m + 1; r < n.count; r++) s = n.o[r], s.valid && s.fromVertex.layer !== b && (u = s.fromVertex.index, t = s.portToPos, s = s.portFromPos, p < t && (l > u || l === u && q > s) && k++, t < p && (u > l || u === l && s > q) && k++);
  31643. if (0 >= c)
  31644. for (n = d[h].Re, m = 0; m < n.count; m++)
  31645. if (q = n.o[m], q.valid && q.toVertex.layer !== b)
  31646. for (l = q.toVertex.index, p = q.portToPos, q = q.portFromPos, r = m + 1; r < n.count; r++) s = n.o[r], s.valid && s.toVertex.layer !== b && (u = s.toVertex.index, t = s.portToPos, s = s.portFromPos, q < s && (l > u || l === u && p > t) && k++,
  31647. s < q && (u > l || u === l && t > p) && k++);
  31648. g[h * e + h] = k;
  31649. for (n = h + 1; n < e; n++) {
  31650. var w = 0,
  31651. A = 0;
  31652. if (0 <= c)
  31653. for (k = d[h].Ye, y = d[n].Ye, m = 0; m < k.count; m++)
  31654. if (q = k.o[m], q.valid && q.fromVertex.layer !== b)
  31655. for (l = q.fromVertex.index, q = q.portFromPos, r = 0; r < y.count; r++) s = y.o[r], s.valid && s.fromVertex.layer !== b && (u = s.fromVertex.index, s = s.portFromPos, (l < u || l === u && q < s) && A++, (u < l || u === l && s < q) && w++);
  31656. if (0 >= c)
  31657. for (k = d[h].Re, y = d[n].Re, m = 0; m < k.count; m++)
  31658. if (q = k.o[m], q.valid && q.toVertex.layer !== b)
  31659. for (l = q.toVertex.index, p = q.portToPos, r = 0; r < y.count; r++) s = y.o[r],
  31660. s.valid && s.toVertex.layer !== b && (u = s.toVertex.index, t = s.portToPos, (l < u || l === u && p < t) && A++, (u < l || u === l && t < p) && w++);
  31661. g[h * e + n] = w;
  31662. g[n * e + h] = A
  31663. }
  31664. }
  31665. Gu(a, b, d);
  31666. return g
  31667. }
  31668. ru.prototype.countCrossings = function() {
  31669. for (var a = 0, b = 0; b <= this.Ab; b++)
  31670. for (var c = Ku(this, b, 1), d = this.ve[b], e = 0; e < d; e++)
  31671. for (var g = e; g < d; g++) a += c[e * d + g];
  31672. return a
  31673. };
  31674. function Lu(a) {
  31675. for (var b = 0, c = 0; c <= a.Ab; c++) {
  31676. for (var d = a, e = c, g = Fu(d, e), h = d.ve[e], k = 0, l = 0; l < h; l++) {
  31677. var m = null,
  31678. m = g[l].Re,
  31679. n, p = 0,
  31680. q = 0;
  31681. if (null !== m)
  31682. for (var r = 0; r < m.count; r++) n = m.o[r], n.valid && n.toVertex.layer !== e && (p = n.fromVertex.column + n.portFromColOffset, q = n.toVertex.column + n.portToColOffset, k += (Math.abs(p - q) + 1) * Hu(n))
  31683. }
  31684. Gu(d, e, g);
  31685. b += k
  31686. }
  31687. return b
  31688. }
  31689. ru.prototype.normalize = function() {
  31690. var a = Infinity;
  31691. this.Qb = -1;
  31692. for (var b = this.network.vertexes.j; b.next();) {
  31693. var c = b.value,
  31694. a = Math.min(a, c.column - this.nodeMinColumnSpace(c, !0));
  31695. this.Qb = Math.max(this.Qb, c.column + this.nodeMinColumnSpace(c, !1))
  31696. }
  31697. for (b.reset(); b.next();) b.value.column -= a;
  31698. this.Qb -= a
  31699. };
  31700. function Mu(a, b, c) {
  31701. v && (D.p(b, ru, "barycenters:unfixedLayer"), D.p(c, ru, "barycenters:direction"));
  31702. for (var d = Fu(a, b), e = a.ve[b], g = [], h = 0; h < e; h++) {
  31703. var k = d[h],
  31704. l = null;
  31705. 0 >= c && (l = k.Ye);
  31706. var m = null;
  31707. 0 <= c && (m = k.Re);
  31708. var n = 0,
  31709. p = 0,
  31710. q = k.near;
  31711. null !== q && q.layer === k.layer && (n += q.column - 1, p++);
  31712. if (null !== l)
  31713. for (q = 0; q < l.count; q++) {
  31714. var k = l.o[q],
  31715. r = k.fromVertex;
  31716. k.valid && !k.rev && r.layer !== b && (n += r.column, p++)
  31717. }
  31718. if (null !== m)
  31719. for (l = 0; l < m.count; l++) k = m.o[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (n += q.column, p++);
  31720. g[h] = 0 === p ? -1 : n /
  31721. p
  31722. }
  31723. Gu(a, b, d);
  31724. return g
  31725. }
  31726. function Nu(a, b, c) {
  31727. v && (D.p(b, ru, "medians:unfixedLayer"), D.p(c, ru, "medians:direction"));
  31728. for (var d = Fu(a, b), e = a.ve[b], g = [], h = 0; h < e; h++) {
  31729. var k = d[h],
  31730. l = null;
  31731. 0 >= c && (l = k.Ye);
  31732. var m = null;
  31733. 0 <= c && (m = k.Re);
  31734. var n = 0,
  31735. p = [],
  31736. q = k.near;
  31737. null !== q && q.layer === k.layer && (p[n] = q.column - 1, n++);
  31738. if (null !== l)
  31739. for (q = 0; q < l.count; q++) {
  31740. var k = l.o[q],
  31741. r = k.fromVertex;
  31742. k.valid && !k.rev && r.layer !== b && (p[n] = r.column + k.portFromColOffset, n++)
  31743. }
  31744. if (null !== m)
  31745. for (l = 0; l < m.count; l++) k = m.o[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (p[n] = q.column + k.portToColOffset,
  31746. n++);
  31747. 0 === n ? g[h] = -1 : (p.sort(function(a, b) { return a - b }), m = n >> 1, g[h] = 0 !== (n & 1) ? p[m] : p[m - 1] + p[m] >> 1)
  31748. }
  31749. Gu(a, b, d);
  31750. return g
  31751. }
  31752. function Ou(a, b, c, d, e, g) {
  31753. if (b.component === d) {
  31754. b.component = c;
  31755. var h = 0,
  31756. k = 0;
  31757. if (e)
  31758. for (var l = b.tc; l.next();) {
  31759. var k = l.value,
  31760. m = k.toVertex,
  31761. h = b.layer - m.layer,
  31762. k = a.linkMinLength(k);
  31763. h === k && Ou(a, m, c, d, e, g)
  31764. }
  31765. if (g)
  31766. for (l = b.wc; l.next();) k = l.value, m = k.fromVertex, h = m.layer - b.layer, k = a.linkMinLength(k), h === k && Ou(a, m, c, d, e, g)
  31767. }
  31768. }
  31769. function Pu(a, b, c, d, e, g) {
  31770. if (b.component === d) {
  31771. b.component = c;
  31772. if (e)
  31773. for (var h = b.tc; h.next();) Pu(a, h.value.toVertex, c, d, e, g);
  31774. if (g)
  31775. for (b = b.wc; b.next();) Pu(a, b.value.fromVertex, c, d, e, g)
  31776. }
  31777. }
  31778. function zu(a) { for (a = a.vertexes.j; a.next();) { var b = a.value; if (b.valid) return b } return null }
  31779. function Au(a) {
  31780. for (a = a.vertexes.j; a.next();) {
  31781. var b = a.value;
  31782. if (b.valid) {
  31783. for (var c = !0, d = b.tc; d.next();)
  31784. if (d.value.toVertex.valid) { c = !1; break }
  31785. if (c) return b
  31786. }
  31787. }
  31788. return null
  31789. }
  31790. function Bu(a) {
  31791. for (a = a.vertexes.j; a.next();) {
  31792. var b = a.value;
  31793. if (b.valid) {
  31794. for (var c = !0, d = b.wc; d.next();)
  31795. if (d.value.fromVertex.valid) { c = !1; break }
  31796. if (c) return b
  31797. }
  31798. }
  31799. return null
  31800. }
  31801. function Cu(a, b) {
  31802. b.lq = a.Vs;
  31803. a.Vs++;
  31804. for (var c = b.tc; c.next();) {
  31805. var d = c.value,
  31806. e = d.toVertex; - 1 === e.lq && (d.forest = !0, Cu(a, e))
  31807. }
  31808. b.finish = a.Vs;
  31809. a.Vs++
  31810. }
  31811. ru.prototype.assignLayers = function() {
  31812. switch (this.sp) {
  31813. case Qu:
  31814. Ru(this);
  31815. break;
  31816. case Su:
  31817. for (var a = 0, b = this.network.vertexes.j; b.next();) a = Tu(this, b.value), this.Ab = Math.max(a, this.Ab);
  31818. for (b.reset(); b.next();) a = b.value, a.layer = this.Ab - a.layer;
  31819. break;
  31820. default:
  31821. case tu:
  31822. Ru(this);
  31823. for (b = this.network.vertexes.j; b.next();) b.value.valid = !1;
  31824. for (b.reset(); b.next();) a = b.value, 0 === a.wc.count && Uu(this, a);
  31825. a = Infinity;
  31826. for (b.reset(); b.next();) a = Math.min(a, b.value.layer);
  31827. this.Ab = -1;
  31828. for (b.reset(); b.next();) {
  31829. var c = b.value;
  31830. c.layer -=
  31831. a;
  31832. this.Ab = Math.max(this.Ab, c.layer)
  31833. }
  31834. }
  31835. };
  31836. function Ru(a) {
  31837. for (var b = a.network.vertexes.j; b.next();) {
  31838. var c = Vu(a, b.value);
  31839. a.Ab = Math.max(c, a.Ab)
  31840. }
  31841. }
  31842. function Vu(a, b) {
  31843. var c = 0;
  31844. if (-1 === b.layer) {
  31845. for (var d = b.tc; d.next();) var e = d.value,
  31846. g = e.toVertex,
  31847. e = a.linkMinLength(e),
  31848. c = Math.max(c, Vu(a, g) + e);
  31849. b.layer = c
  31850. } else c = b.layer;
  31851. return c
  31852. }
  31853. function Tu(a, b) {
  31854. var c = 0;
  31855. if (-1 === b.layer) {
  31856. for (var d = b.wc; d.next();) var e = d.value,
  31857. g = e.fromVertex,
  31858. e = a.linkMinLength(e),
  31859. c = Math.max(c, Tu(a, g) + e);
  31860. b.layer = c
  31861. } else c = b.layer;
  31862. return c
  31863. }
  31864. function Uu(a, b) {
  31865. if (!b.valid) {
  31866. b.valid = !0;
  31867. for (var c = b.tc; c.next();) Uu(a, c.value.toVertex);
  31868. for (c = a.network.vertexes.j; c.next();) c.value.component = -1;
  31869. for (var d = b.Ye.o, e = d.length, g = 0; g < e; g++) {
  31870. var h = d[g],
  31871. k = h.fromVertex,
  31872. l = h.toVertex,
  31873. h = a.linkMinLength(h);
  31874. k.layer - l.layer > h && Ou(a, k, 0, -1, !0, !1)
  31875. }
  31876. for (Ou(a, b, 1, -1, !0, !0); 0 !== b.component;) {
  31877. for (var k = 0, d = Infinity, l = 0, m = null, n = a.network.vertexes.j; n.next();) {
  31878. var p = n.value;
  31879. if (1 === p.component) {
  31880. for (var q = 0, r = !1, s = p.Ye.o, e = s.length, g = 0; g < e; g++) {
  31881. var h = s[g],
  31882. u = h.fromVertex,
  31883. q = q + 1;
  31884. 1 !== u.component && (k += 1, u = u.layer - p.layer, h = a.linkMinLength(h), d = Math.min(d, u - h))
  31885. }
  31886. h = p.Re.o;
  31887. e = h.length;
  31888. for (g = 0; g < e; g++) s = h[g].toVertex, q -= 1, 1 !== s.component ? k -= 1 : r = !0;
  31889. (null === m || q < l) && !r && (m = p, l = q)
  31890. }
  31891. }
  31892. if (0 < k) {
  31893. for (c.reset(); c.next();) e = c.value, 1 === e.component && (e.layer += d);
  31894. b.component = 0
  31895. } else m.component = 0
  31896. }
  31897. for (c = a.network.vertexes.j; c.next();) c.value.component = -1;
  31898. for (Ou(a, b, 1, -1, !0, !1); 0 !== b.component;) {
  31899. g = 0;
  31900. e = Infinity;
  31901. d = 0;
  31902. h = null;
  31903. for (k = a.network.vertexes.j; k.next();)
  31904. if (l = k.value, 1 === l.component) {
  31905. m =
  31906. 0;
  31907. n = !1;
  31908. r = l.Ye.o;
  31909. p = r.length;
  31910. for (q = 0; q < p; q++) s = r[q].fromVertex, m += 1, 1 !== s.component ? g += 1 : n = !0;
  31911. r = l.Re.o;
  31912. p = r.length;
  31913. for (q = 0; q < p; q++) s = r[q], u = s.toVertex, m -= 1, 1 !== u.component && (g -= 1, u = l.layer - u.layer, s = a.linkMinLength(s), e = Math.min(e, u - s));
  31914. (null === h || m > d) && !n && (h = l, d = m)
  31915. }
  31916. if (0 > g) {
  31917. for (c.reset(); c.next();) g = c.value, 1 === g.component && (g.layer -= e);
  31918. b.component = 0
  31919. } else h.component = 0
  31920. }
  31921. }
  31922. }
  31923. function Eu(a, b, c) { return 90 === a.ga ? c && !b.rev || !c && b.rev ? 270 : 90 : 180 === a.ga ? c && !b.rev || !c && b.rev ? 0 : 180 : 270 === a.ga ? c && !b.rev || !c && b.rev ? 90 : 270 : c && !b.rev || !c && b.rev ? 180 : 0 }
  31924. ru.prototype.initializeIndices = function() {
  31925. switch (this.ip) {
  31926. default:
  31927. case Wu:
  31928. for (var a = this.network.vertexes.j; a.next();) {
  31929. var b = a.value,
  31930. c = b.layer;
  31931. b.index = this.ve[c];
  31932. this.ve[c]++
  31933. }
  31934. break;
  31935. case uu:
  31936. a = this.network.vertexes.j;
  31937. for (b = this.Ab; 0 <= b; b--)
  31938. for (a.reset(); a.next();) c = a.value, c.layer === b && -1 === c.index && Xu(this, c);
  31939. break;
  31940. case Yu:
  31941. for (a = this.network.vertexes.j, b = 0; b <= this.Ab; b++)
  31942. for (a.reset(); a.next();) c = a.value, c.layer === b && -1 === c.index && Zu(this, c)
  31943. }
  31944. };
  31945. function Xu(a, b) {
  31946. var c = b.layer;
  31947. b.index = a.ve[c];
  31948. a.ve[c]++;
  31949. for (var c = b.Re.Fc(), d = !0; d;)
  31950. for (var d = !1, e = 0; e < c.length - 1; e++) {
  31951. var g = c[e],
  31952. h = c[e + 1];
  31953. g.portFromColOffset > h.portFromColOffset && (d = !0, c[e] = h, c[e + 1] = g)
  31954. }
  31955. for (e = 0; e < c.length; e++) d = c[e], d.valid && (d = d.toVertex, -1 === d.index && Xu(a, d))
  31956. }
  31957. function Zu(a, b) {
  31958. var c = b.layer;
  31959. b.index = a.ve[c];
  31960. a.ve[c]++;
  31961. for (var c = b.Ye.Fc(), d = !0, e = 0; d;)
  31962. for (d = !1, e = 0; e < c.length - 1; e++) {
  31963. var g = c[e],
  31964. h = c[e + 1];
  31965. g.portToColOffset > h.portToColOffset && (d = !0, c[e] = h, c[e + 1] = g)
  31966. }
  31967. for (e = 0; e < c.length; e++) d = c[e], d.valid && (d = d.fromVertex, -1 === d.index && Zu(a, d))
  31968. }
  31969. ru.prototype.reduceCrossings = function() {
  31970. for (var a = this.countCrossings(), b = Iu(this), c = 0, d = 0, e = 0, c = 0; c < this.$m; c++) {
  31971. for (d = 0; d <= this.Ab; d++) $u(this, d, 1), av(this, d, 1);
  31972. e = this.countCrossings();
  31973. e < a && (a = e, b = Iu(this));
  31974. for (d = this.Ab; 0 <= d; d--) $u(this, d, -1), av(this, d, -1);
  31975. e = this.countCrossings();
  31976. e < a && (a = e, b = Iu(this))
  31977. }
  31978. Ju(this, b);
  31979. for (c = 0; c < this.$m; c++) {
  31980. for (d = 0; d <= this.Ab; d++) $u(this, d, 0), av(this, d, 0);
  31981. e = this.countCrossings();
  31982. e < a && (a = e, b = Iu(this));
  31983. for (d = this.Ab; 0 <= d; d--) $u(this, d, 0), av(this, d, 0);
  31984. e = this.countCrossings();
  31985. e < a && (a = e, b = Iu(this))
  31986. }
  31987. Ju(this, b);
  31988. var g = !1,
  31989. h = c = 0,
  31990. k = 0,
  31991. d = 0;
  31992. switch (this.Fo) {
  31993. case bv:
  31994. break;
  31995. case cv:
  31996. for (k = a + 1;
  31997. (d = this.countCrossings()) < k;)
  31998. for (k = d, c = this.Ab; 0 <= c; c--)
  31999. for (h = 0; h <= c; h++) {
  32000. for (g = !0; g;)
  32001. for (g = !1, d = c; d >= h; d--) g = av(this, d, -1) || g;
  32002. e = this.countCrossings();
  32003. e >= a ? Ju(this, b) : (a = e, b = Iu(this));
  32004. for (g = !0; g;)
  32005. for (g = !1, d = c; d >= h; d--) g = av(this, d, 1) || g;
  32006. e = this.countCrossings();
  32007. e >= a ? Ju(this, b) : (a = e, b = Iu(this));
  32008. for (g = !0; g;)
  32009. for (g = !1, d = h; d <= c; d++) g = av(this, d, 1) || g;
  32010. e >= a ? Ju(this, b) : (a = e, b = Iu(this));
  32011. for (g = !0; g;)
  32012. for (g = !1,
  32013. d = h; d <= c; d++) g = av(this, d, -1) || g;
  32014. e >= a ? Ju(this, b) : (a = e, b = Iu(this));
  32015. for (g = !0; g;)
  32016. for (g = !1, d = c; d >= h; d--) g = av(this, d, 0) || g;
  32017. e >= a ? Ju(this, b) : (a = e, b = Iu(this));
  32018. for (g = !0; g;)
  32019. for (g = !1, d = h; d <= c; d++) g = av(this, d, 0) || g;
  32020. e >= a ? Ju(this, b) : (a = e, b = Iu(this))
  32021. }
  32022. break;
  32023. default:
  32024. case vu:
  32025. for (c = this.Ab, h = 0, k = a + 1;
  32026. (d = this.countCrossings()) < k;) {
  32027. k = d;
  32028. for (g = !0; g;)
  32029. for (g = !1, d = c; d >= h; d--) g = av(this, d, -1) || g;
  32030. e = this.countCrossings();
  32031. e >= a ? Ju(this, b) : (a = e, b = Iu(this));
  32032. for (g = !0; g;)
  32033. for (g = !1, d = c; d >= h; d--) g = av(this, d, 1) || g;
  32034. e = this.countCrossings();
  32035. e >= a ? Ju(this, b) : (a = e, b = Iu(this));
  32036. for (g = !0; g;)
  32037. for (g = !1, d = h; d <= c; d++) g = av(this, d, 1) || g;
  32038. e >= a ? Ju(this, b) : (a = e, b = Iu(this));
  32039. for (g = !0; g;)
  32040. for (g = !1, d = h; d <= c; d++) g = av(this, d, -1) || g;
  32041. e >= a ? Ju(this, b) : (a = e, b = Iu(this));
  32042. for (g = !0; g;)
  32043. for (g = !1, d = c; d >= h; d--) g = av(this, d, 0) || g;
  32044. e >= a ? Ju(this, b) : (a = e, b = Iu(this));
  32045. for (g = !0; g;)
  32046. for (g = !1, d = h; d <= c; d++) g = av(this, d, 0) || g;
  32047. e >= a ? Ju(this, b) : (a = e, b = Iu(this))
  32048. }
  32049. }
  32050. Ju(this, b)
  32051. };
  32052. function $u(a, b, c) {
  32053. v && (D.p(b, ru, "medianBarycenterCrossingReduction:unfixedLayer"), D.p(c, ru, "medianBarycenterCrossingReduction:direction"));
  32054. var d = 0,
  32055. e = Fu(a, b),
  32056. g = a.ve[b],
  32057. h = Nu(a, b, c);
  32058. c = Mu(a, b, c);
  32059. for (d = 0; d < g; d++) - 1 === c[d] && (c[d] = e[d].column), -1 === h[d] && (h[d] = e[d].column);
  32060. for (var k = !0, l; k;)
  32061. for (k = !1, d = 0; d < g - 1; d++)
  32062. if (h[d + 1] < h[d] || h[d + 1] === h[d] && c[d + 1] < c[d]) k = !0, l = h[d], h[d] = h[d + 1], h[d + 1] = l, l = c[d], c[d] = c[d + 1], c[d + 1] = l, l = e[d], e[d] = e[d + 1], e[d + 1] = l;
  32063. for (d = h = 0; d < g; d++) l = e[d], l.index = d, h += a.nodeMinColumnSpace(l, !0), l.column = h, h += 1, h += a.nodeMinColumnSpace(l, !1);
  32064. Gu(a, b, e)
  32065. }
  32066. function av(a, b, c) {
  32067. var d = Fu(a, b),
  32068. e = a.ve[b];
  32069. c = Ku(a, b, c);
  32070. var g = 0,
  32071. h;
  32072. h = [];
  32073. for (g = 0; g < e; g++) h[g] = -1;
  32074. var k;
  32075. k = [];
  32076. for (g = 0; g < e; g++) k[g] = -1;
  32077. for (var l = !1, m = !0; m;)
  32078. for (m = !1, g = 0; g < e - 1; g++) {
  32079. var n = c[d[g].index * e + d[g + 1].index],
  32080. p = c[d[g + 1].index * e + d[g].index],
  32081. q = 0,
  32082. r = 0,
  32083. s = d[g].column,
  32084. u = d[g + 1].column,
  32085. t = a.nodeMinColumnSpace(d[g], !0),
  32086. y = a.nodeMinColumnSpace(d[g], !1),
  32087. w = a.nodeMinColumnSpace(d[g + 1], !0),
  32088. A = a.nodeMinColumnSpace(d[g + 1], !1),
  32089. t = s - t + w,
  32090. y = u - y + A,
  32091. w = w = 0,
  32092. B = d[g].wc.j;
  32093. for (B.reset(); B.next();)
  32094. if (w = B.value, A = w.fromVertex, w.valid &&
  32095. A.layer === b) {
  32096. for (w = 0; d[w] !== A;) w++;
  32097. w < g && (q += 2 * (g - w), r += 2 * (g + 1 - w));
  32098. w === g + 1 && (q += 1);
  32099. w > g + 1 && (q += 4 * (w - g), r += 4 * (w - (g + 1)))
  32100. }
  32101. B = d[g].tc.j;
  32102. for (B.reset(); B.next();)
  32103. if (w = B.value, A = w.toVertex, w.valid && A.layer === b) {
  32104. for (w = 0; d[w] !== A;) w++;
  32105. w === g + 1 && (r += 1)
  32106. }
  32107. B = d[g + 1].wc.j;
  32108. for (B.reset(); B.next();)
  32109. if (w = B.value, A = w.fromVertex, w.valid && A.layer === b) {
  32110. for (w = 0; d[w] !== A;) w++;
  32111. w < g && (q += 2 * (g + 1 - w), r += 2 * (g - w));
  32112. w === g && (r += 1);
  32113. w > g + 1 && (q += 4 * (w - (g + 1)), r += 4 * (w - g))
  32114. }
  32115. B = d[g + 1].tc.j;
  32116. for (B.reset(); B.next();)
  32117. if (w = B.value, A = w.toVertex, w.valid &&
  32118. A.layer === b) {
  32119. for (w = 0; d[w] !== A;) w++;
  32120. w === g && (q += 1)
  32121. }
  32122. var w = A = 0,
  32123. B = h[d[g].index],
  32124. P = k[d[g].index],
  32125. H = h[d[g + 1].index],
  32126. R = k[d[g + 1].index]; - 1 !== B && (A += Math.abs(B - s), w += Math.abs(B - y)); - 1 !== P && (A += Math.abs(P - s), w += Math.abs(P - y)); - 1 !== H && (A += Math.abs(H - u), w += Math.abs(H - t)); - 1 !== R && (A += Math.abs(R - u), w += Math.abs(R - t));
  32127. if (r < q - .5 || r === q && p < n - .5 || r === q && p === n && w < A - .5) m = l = !0, d[g].column = y, d[g + 1].column = t, n = d[g], d[g] = d[g + 1], d[g + 1] = n
  32128. }
  32129. for (g = 0; g < e; g++) d[g].index = g;
  32130. Gu(a, b, d);
  32131. return l
  32132. }
  32133. ru.prototype.straightenAndPack = function() {
  32134. var a = 0,
  32135. b = !1,
  32136. c = 0 !== (this.qj & dv),
  32137. a = this.qj === wu;
  32138. 1E3 < this.network.edges.count && !a && (c = !1);
  32139. if (c) {
  32140. b = [];
  32141. for (a = a = 0; a <= this.Ab; a++) b[a] = 0;
  32142. for (var d = 0, e = this.network.vertexes.j; e.next();) {
  32143. var g = e.value,
  32144. a = g.layer,
  32145. d = g.column,
  32146. g = this.nodeMinColumnSpace(g, !1);
  32147. b[a] = Math.max(b[a], d + g)
  32148. }
  32149. for (e.reset(); e.next();) g = e.value, a = g.layer, d = g.column, g.column = (8 * (this.Qb - b[a]) >> 1) + 8 * d;
  32150. this.Qb *= 8
  32151. }
  32152. if (0 !== (this.qj & ev))
  32153. for (b = !0; b;) {
  32154. b = !1;
  32155. for (a = this.Zf + 1; a <= this.Ab; a++) b = fv(this, a, 1) || b;
  32156. for (a = this.Zf - 1; 0 <= a; a--) b = fv(this, a, -1) || b;
  32157. b = fv(this, this.Zf, 0) || b
  32158. }
  32159. if (0 !== (this.qj & gv)) {
  32160. for (a = this.Zf + 1; a <= this.Ab; a++) hv(this, a, 1);
  32161. for (a = this.Zf - 1; 0 <= a; a--) hv(this, a, -1);
  32162. hv(this, this.Zf, 0)
  32163. }
  32164. c && (iv(this, -1), iv(this, 1));
  32165. if (0 !== (this.qj & ev))
  32166. for (b = !0; b;) {
  32167. b = !1;
  32168. b = fv(this, this.Zf, 0) || b;
  32169. for (a = this.Zf + 1; a <= this.Ab; a++) b = fv(this, a, 0) || b;
  32170. for (a = this.Zf - 1; 0 <= a; a--) b = fv(this, a, 0) || b
  32171. }
  32172. };
  32173. function fv(a, b, c) { v && (D.p(b, ru, "bendStraighten:unfixedLayer"), D.p(c, ru, "bendStraighten:direction")); for (var d = !1; jv(a, b, c);) d = !0; return d }
  32174. function jv(a, b, c) {
  32175. v && (D.p(b, ru, "shiftbendStraighten:unfixedLayer"), D.p(c, ru, "shiftbendStraighten:direction"));
  32176. var d = 0,
  32177. e = Fu(a, b),
  32178. g = a.ve[b],
  32179. h = Mu(a, b, -1);
  32180. if (0 < c)
  32181. for (d = 0; d < g; d++) h[d] = -1;
  32182. var k = Mu(a, b, 1);
  32183. if (0 > c)
  32184. for (d = 0; d < g; d++) k[d] = -1;
  32185. for (var l = !1, m = !0; m;)
  32186. for (m = !1, d = 0; d < g; d++) {
  32187. var n = e[d].column,
  32188. p = a.nodeMinColumnSpace(e[d], !0),
  32189. q = a.nodeMinColumnSpace(e[d], !1),
  32190. r = 0,
  32191. r = 0 > d - 1 || n - e[d - 1].column - 1 > p + a.nodeMinColumnSpace(e[d - 1], !1) ? n - 1 : n,
  32192. p = 0,
  32193. p = d + 1 >= g || e[d + 1].column - n - 1 > q + a.nodeMinColumnSpace(e[d + 1], !0) ? n + 1 : n,
  32194. s = q =
  32195. 0,
  32196. u = 0,
  32197. t = 0,
  32198. y = 0,
  32199. w = 0;
  32200. if (0 >= c)
  32201. for (var A = e[d].wc.j; A.next();) {
  32202. var w = A.value,
  32203. B = w.fromVertex;
  32204. w.valid && B.layer !== b && (t = Hu(w), y = w.portFromColOffset, w = w.portToColOffset, B = B.column, q += (Math.abs(n + w - (B + y)) + 1) * t, s += (Math.abs(r + w - (B + y)) + 1) * t, u += (Math.abs(p + w - (B + y)) + 1) * t)
  32205. }
  32206. if (0 <= c)
  32207. for (A = e[d].tc.j; A.next();) w = A.value, B = w.toVertex, w.valid && B.layer !== b && (t = Hu(w), y = w.portFromColOffset, w = w.portToColOffset, B = B.column, q += (Math.abs(n + y - (B + w)) + 1) * t, s += (Math.abs(r + y - (B + w)) + 1) * t, u += (Math.abs(p + y - (B + w)) + 1) * t);
  32208. w = y = t = 0;
  32209. A = h[e[d].index];
  32210. B = k[e[d].index]; - 1 !== A && (t += Math.abs(A - n), y += Math.abs(A - r), w += Math.abs(A - p)); - 1 !== B && (t += Math.abs(B - n), y += Math.abs(B - r), w += Math.abs(B - p));
  32211. if (s < q || s === q && y < t) m = l = !0, e[d].column = r;
  32212. else if (u < q || u === q && w < t) m = l = !0, e[d].column = p
  32213. }
  32214. Gu(a, b, e);
  32215. a.normalize();
  32216. return l
  32217. }
  32218. function hv(a, b, c) {
  32219. v && (D.p(b, ru, "medianStraighten:unfixedLayer"), D.p(c, ru, "medianStraighten:direction"));
  32220. var d = 0,
  32221. e = Fu(a, b),
  32222. g = a.ve[b],
  32223. h = Nu(a, b, c);
  32224. c = [];
  32225. for (d = 0; d < g; d++) c[d] = h[d];
  32226. for (h = !0; h;)
  32227. for (h = !1, d = 0; d < g; d++) {
  32228. var k = e[d].column,
  32229. l = a.nodeMinColumnSpace(e[d], !0),
  32230. m = a.nodeMinColumnSpace(e[d], !1),
  32231. n = 0,
  32232. p = 0,
  32233. q = 0,
  32234. q = p = 0; - 1 === c[d] ? 0 === d && d === g - 1 ? n = k : 0 === d ? (p = e[d + 1].column, n = p - k === m + a.nodeMinColumnSpace(e[d + 1], !0) ? k - 1 : k) : d === g - 1 ? (q = e[d - 1].column, n = k - q === l + a.nodeMinColumnSpace(e[d - 1], !1) ? k + 1 : k) : (q = e[d - 1].column,
  32235. q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, n = (q + p) / 2 | 0) : 0 === d && d === g - 1 ? n = c[d] : 0 === d ? (p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, n = Math.min(c[d], p)) : d === g - 1 ? (q = e[d - 1].column, q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, n = Math.max(c[d], q)) : (q = e[d - 1].column, q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, q < c[d] && c[d] < p ? n = c[d] : q >= c[d] ? n = q : p <= c[d] && (n = p));
  32236. n !== k && (h = !0, e[d].column = n)
  32237. }
  32238. Gu(a, b, e);
  32239. a.normalize()
  32240. }
  32241. function kv(a, b) {
  32242. v && (D.p(b, ru, "packAux:column"), D.p(1, ru, "packAux:direction"));
  32243. for (var c = !0, d = a.network.vertexes.j; d.next();) {
  32244. var e = d.value,
  32245. g = a.nodeMinColumnSpace(e, !0),
  32246. h = a.nodeMinColumnSpace(e, !1);
  32247. if (e.column - g <= b && e.column + h >= b) { c = !1; break }
  32248. }
  32249. e = !1;
  32250. if (c)
  32251. for (d.reset(); d.next();) c = d.value, c.column > b && (c.column -= 1, e = !0);
  32252. return e
  32253. }
  32254. function lv(a, b) {
  32255. v && (D.p(b, ru, "tightPackAux:column"), D.p(1, ru, "tightPackAux:direction"));
  32256. for (var c = b, c = b + 1, d = 0, e = [], g = [], d = 0; d <= a.Ab; d++) e[d] = !1, g[d] = !1;
  32257. for (var h = a.network.vertexes.j; h.next();) {
  32258. var d = h.value,
  32259. k = d.column - a.nodeMinColumnSpace(d, !0),
  32260. l = d.column + a.nodeMinColumnSpace(d, !1);
  32261. k <= b && l >= b && (e[d.layer] = !0);
  32262. k <= c && l >= c && (g[d.layer] = !0)
  32263. }
  32264. k = !0;
  32265. c = !1;
  32266. for (d = 0; d <= a.Ab; d++) k = k && !(e[d] && g[d]);
  32267. if (k)
  32268. for (h.reset(); h.next();) e = h.value, e.column > b && (e.column -= 1, c = !0);
  32269. return c
  32270. }
  32271. function iv(a, b) {
  32272. v && D.p(b, ru, "componentPack:direction");
  32273. for (var c = 0; c <= a.Qb; c++)
  32274. for (; kv(a, c););
  32275. a.normalize();
  32276. for (c = 0; c < a.Qb; c++)
  32277. for (; lv(a, c););
  32278. a.normalize();
  32279. var c = 0,
  32280. d, e = 0,
  32281. g = 0,
  32282. h = 0;
  32283. if (0 < b)
  32284. for (c = 0; c <= a.Qb; c++)
  32285. for (d = Iu(a), e = Lu(a), g = e + 1; e < g;) g = e, mv(a, c, 1), h = Lu(a), h > e ? Ju(a, d) : h < e && (e = h, d = Iu(a));
  32286. if (0 > b)
  32287. for (c = a.Qb; 0 <= c; c--)
  32288. for (d = Iu(a), e = Lu(a), g = e + 1; e < g;) g = e, mv(a, c, -1), h = Lu(a), h > e ? Ju(a, d) : h < e && (e = h, d = Iu(a));
  32289. a.normalize()
  32290. }
  32291. function mv(a, b, c) {
  32292. a.Lg = 0;
  32293. for (var d = a.network.vertexes.j; d.next();) d.value.component = -1;
  32294. if (0 < c)
  32295. for (d.reset(); d.next();) {
  32296. var e = d.value;
  32297. e.column - a.nodeMinColumnSpace(e, !0) <= b && (e.component = a.Lg)
  32298. }
  32299. if (0 > c)
  32300. for (d.reset(); d.next();) e = d.value, e.column + a.nodeMinColumnSpace(e, !1) >= b && (e.component = a.Lg);
  32301. a.Lg++;
  32302. for (d.reset(); d.next();) b = d.value, -1 === b.component && (Pu(a, b, a.Lg, -1, !0, !0), a.Lg++);
  32303. var g = 0;
  32304. b = [];
  32305. for (g = 0; g < a.Lg * a.Lg; g++) b[g] = !1;
  32306. e = [];
  32307. for (g = 0; g < (a.Ab + 1) * (a.Qb + 1); g++) e[g] = -1;
  32308. for (d.reset(); d.next();)
  32309. for (var g =
  32310. d.value, h = g.layer, k = Math.max(0, g.column - a.nodeMinColumnSpace(g, !0)), l = Math.min(a.Qb, g.column + a.nodeMinColumnSpace(g, !1)); k <= l; k++) e[h * (a.Qb + 1) + k] = g.component;
  32311. for (g = 0; g <= a.Ab; g++) {
  32312. if (0 < c)
  32313. for (k = 0; k < a.Qb; k++) - 1 !== e[g * (a.Qb + 1) + k] && -1 !== e[g * (a.Qb + 1) + k + 1] && e[g * (a.Qb + 1) + k] !== e[g * (a.Qb + 1) + k + 1] && (b[e[g * (a.Qb + 1) + k] * a.Lg + e[g * (a.Qb + 1) + k + 1]] = !0);
  32314. if (0 > c)
  32315. for (k = a.Qb; 0 < k; k--) - 1 !== e[g * (a.Qb + 1) + k] && -1 !== e[g * (a.Qb + 1) + k - 1] && e[g * (a.Qb + 1) + k] !== e[g * (a.Qb + 1) + k - 1] && (b[e[g * (a.Qb + 1) + k] * a.Lg + e[g * (a.Qb + 1) + k - 1]] = !0)
  32316. }
  32317. e = [];
  32318. for (g =
  32319. 0; g < a.Lg; g++) e[g] = !0;
  32320. h = new K("number");
  32321. h.add(0);
  32322. for (l = 0; 0 !== h.count;)
  32323. if (l = h.o[h.count - 1], h.pd(h.count - 1), e[l])
  32324. for (e[l] = !1, g = 0; g < a.Lg; g++) b[l * a.Lg + g] && h.be(0, g);
  32325. if (0 < c)
  32326. for (d.reset(); d.next();) a = d.value, e[a.component] && (a.column -= 1);
  32327. if (0 > c)
  32328. for (d.reset(); d.next();) c = d.value, e[c.component] && (c.column += 1)
  32329. }
  32330. ru.prototype.commitLayout = function() {
  32331. if (this.Xq)
  32332. for (var a = Du(this, !0), b = Du(this, !1), c = this.network.edges.j; c.next();) {
  32333. var d = c.value.link;
  32334. null !== d && (d.Gb = a, d.Hb = b)
  32335. }
  32336. this.commitNodes();
  32337. this.JA();
  32338. this.Pu && this.commitLinks()
  32339. };
  32340. function Du(a, b) { return 270 === a.ga ? b ? $c : gd : 90 === a.ga ? b ? gd : $c : 180 === a.ga ? b ? ed : fd : b ? fd : ed }
  32341. ru.prototype.commitNodes = function() {
  32342. this.Jg = [];
  32343. this.Yf = [];
  32344. this.Xf = [];
  32345. this.Vb = [];
  32346. for (var a = 0; a <= this.Ab; a++) this.Jg[a] = 0, this.Yf[a] = 0, this.Xf[a] = 0, this.Vb[a] = 0;
  32347. for (a = this.network.vertexes.j; a.next();) {
  32348. var b = a.value,
  32349. c = b.layer;
  32350. this.Jg[c] = Math.max(this.Jg[c], this.nodeMinLayerSpace(b, !0));
  32351. this.Yf[c] = Math.max(this.Yf[c], this.nodeMinLayerSpace(b, !1))
  32352. }
  32353. for (var b = 0, d = this.an, c = 0; c <= this.Ab; c++) {
  32354. var e = d;
  32355. 0 >= this.Jg[c] + this.Yf[c] && (e = 0);
  32356. 0 < c && (b += e / 2);
  32357. 90 === this.ga || 0 === this.ga ? (b += this.Yf[c], this.Xf[c] = b, b += this.Jg[c]) :
  32358. (b += this.Jg[c], this.Xf[c] = b, b += this.Yf[c]);
  32359. c < this.Ab && (b += e / 2);
  32360. this.Vb[c] = b
  32361. }
  32362. d = b;
  32363. b = this.Zd;
  32364. for (c = 0; c <= this.Ab; c++) 270 === this.ga ? this.Xf[c] = b.y + this.Xf[c] : 90 === this.ga ? (this.Xf[c] = b.y + d - this.Xf[c], this.Vb[c] = d - this.Vb[c]) : 180 === this.ga ? this.Xf[c] = b.x + this.Xf[c] : (this.Xf[c] = b.x + d - this.Xf[c], this.Vb[c] = d - this.Vb[c]);
  32365. a.reset();
  32366. for (d = e = Infinity; a.next();) {
  32367. var c = a.value,
  32368. g = c.layer,
  32369. h = c.column | 0,
  32370. k = 0,
  32371. l = 0;
  32372. 270 === this.ga || 90 === this.ga ? (k = b.x + this.ie * h, l = this.Xf[g]) : (k = this.Xf[g], l = b.y + this.ie * h);
  32373. c.pa = k;
  32374. c.va = l;
  32375. e = Math.min(c.x, e);
  32376. d = Math.min(c.y, d)
  32377. }
  32378. e = b.x - e;
  32379. b = b.y - d;
  32380. this.KC = new N(e, b);
  32381. for (a.reset(); a.next();) c = a.value, c.x += e, c.y += b, c.commit()
  32382. };
  32383. ru.prototype.JA = function() {
  32384. for (var a = 0, b = this.an, c = 0; c <= this.Ab; c++) a += this.Jg[c], a += this.Yf[c];
  32385. for (var a = a + this.Ab * b, b = [], c = this.ie * this.Qb, d = this.HJ; 0 <= d; d--) 270 === this.ga ? 0 === d ? b.push(new C(0, 0, c, Math.abs(this.Vb[0]))) : b.push(new C(0, this.Vb[d - 1], c, Math.abs(this.Vb[d - 1] - this.Vb[d]))) : 90 === this.ga ? 0 === d ? b.push(new C(0, this.Vb[0], c, Math.abs(this.Vb[0] - a))) : b.push(new C(0, this.Vb[d], c, Math.abs(this.Vb[d - 1] - this.Vb[d]))) : 180 === this.ga ? 0 === d ? b.push(new C(0, 0, Math.abs(this.Vb[0]), c)) : b.push(new C(this.Vb[d -
  32386. 1], 0, Math.abs(this.Vb[d - 1] - this.Vb[d]), c)) : 0 === d ? b.push(new C(this.Vb[0], 0, Math.abs(this.Vb[0] - a), c)) : b.push(new C(this.Vb[d], 0, Math.abs(this.Vb[d - 1] - this.Vb[d]), c));
  32387. this.commitLayers(b, this.KC)
  32388. };
  32389. ru.prototype.commitLayers = function() {};
  32390. ru.prototype.commitLinks = function() {
  32391. for (var a = this.network.edges.j, b; a.next();) b = a.value.link, null !== b && (b.Dm(), b.dq(), b.Ej());
  32392. for (a.reset(); a.next();) b = a.value.link, null !== b && b.zo();
  32393. for (a.reset(); a.next();) {
  32394. var c = a.value;
  32395. b = c.link;
  32396. if (null !== b) {
  32397. b.Dm();
  32398. var d = b,
  32399. e = d.$,
  32400. g = d.ba,
  32401. h = d.oc,
  32402. k = d.Gc;
  32403. if (null !== e) {
  32404. var l = e.findVisibleNode();
  32405. null !== l && l !== e && (e = l, h = l.port)
  32406. }
  32407. if (null !== g) {
  32408. var m = g.findVisibleNode();
  32409. null !== m && m !== g && (g = m, k = m.port)
  32410. }
  32411. var n = b.computeSpot(!0, h),
  32412. p = b.computeSpot(!1, k),
  32413. q = c.fromVertex,
  32414. r = c.toVertex;
  32415. if (c.valid) {
  32416. if (b.jf === Uj && 4 === b.ta) {
  32417. if (c.rev) var s = e,
  32418. e = g,
  32419. g = s,
  32420. u = h,
  32421. h = k,
  32422. k = u;
  32423. if (q.column === r.column) {
  32424. var t = b.getLinkPoint(e, h, n, !0, !1, g, k),
  32425. y = b.getLinkPoint(g, k, p, !1, !1, e, h);
  32426. t.H() || t.set(e.aa.jm);
  32427. y.H() || y.set(g.aa.jm);
  32428. b.dq();
  32429. b.Bj(t.x, t.y);
  32430. b.Bj((2 * t.x + y.x) / 3, (2 * t.y + y.y) / 3);
  32431. b.Bj((t.x + 2 * y.x) / 3, (t.y + 2 * y.y) / 3);
  32432. b.Bj(y.x, y.y)
  32433. } else {
  32434. var w = !1,
  32435. A = !1;
  32436. null !== h && n === dc && (w = !0);
  32437. null !== k && p === dc && (A = !0);
  32438. if (w || A) {
  32439. var B = b.m(0).x,
  32440. P = b.m(0).y,
  32441. H = b.m(1).x,
  32442. R = b.m(1).y,
  32443. aa = b.m(2).x,
  32444. V = b.m(2).y,
  32445. ea = b.m(3).x,
  32446. la = b.m(3).y;
  32447. if (w) {
  32448. 90 === this.ga ||
  32449. 270 === this.ga ? (H = B, R = (P + la) / 2) : (H = (B + ea) / 2, R = P);
  32450. b.ia(1, H, R);
  32451. var Da = b.getLinkPoint(e, h, n, !0, !1, g, k);
  32452. Da.H() || Da.set(e.aa.jm);
  32453. b.ia(0, Da.x, Da.y)
  32454. }
  32455. A && (90 === this.ga || 270 === this.ga ? (aa = ea, V = (P + la) / 2) : (aa = (B + ea) / 2, V = la), b.ia(2, aa, V), Da = b.getLinkPoint(g, k, p, !1, !1, e, h), Da.H() || Da.set(g.aa.jm), b.ia(3, Da.x, Da.y))
  32456. }
  32457. }
  32458. }
  32459. b.Ej()
  32460. } else if (q.layer === r.layer) b.Ej();
  32461. else {
  32462. var La = !1,
  32463. gb = !1,
  32464. Aa = 0,
  32465. W = b.tu + 1;
  32466. if (b.ic) gb = !0, Aa = b.ta, 4 < Aa && b.points.removeRange(2, Aa - 3);
  32467. else if (b.jf === Uj) La = !0, Aa = b.ta, 4 < Aa && b.points.removeRange(2, Aa - 3),
  32468. W = 2;
  32469. else {
  32470. var Aa = b.ta,
  32471. xb = n === dc,
  32472. Pb = p === dc;
  32473. 2 < Aa && xb && Pb ? b.points.removeRange(1, Aa - 2) : 3 < Aa && xb && !Pb ? b.points.removeRange(1, Aa - 3) : 3 < Aa && !xb && Pb ? b.points.removeRange(2, Aa - 2) : 4 < Aa && !xb && !Pb && b.points.removeRange(2, Aa - 3)
  32474. }
  32475. var Sa, Qc;
  32476. if (c.rev) {
  32477. for (var Ra = 0; null !== r && q !== r;) {
  32478. Qc = Sa = null;
  32479. for (var jg = r.wc.j; jg.next();) { var kg = jg.value; if (kg.link === c.link && (Sa = kg.fromVertex, Qc = kg.toVertex, null === Sa.Gd)) break }
  32480. if (Sa !== q)
  32481. if (hb = b.m(W - 1).x, ub = b.m(W - 1).y, sa = Sa.pa, na = Sa.va, gb) 180 === this.ga || 0 === this.ga ? 2 === W ? (b.B(W++, hb,
  32482. ub), b.B(W++, hb, na)) : (Md = null !== Qc ? Qc.va : ub, Md !== na && (ab = this.Vb[Sa.layer - 1], b.B(W++, ab, ub), b.B(W++, ab, na))) : 2 === W ? (b.B(W++, hb, ub), b.B(W++, sa, ub)) : (Jf = null !== Qc ? Qc.pa : hb, Jf !== sa && (ab = this.Vb[Sa.layer - 1], b.B(W++, hb, ab), b.B(W++, sa, ab)));
  32483. else if (2 === W)
  32484. if (Oa = Math.max(10, this.Jg[r.layer]), pb = Math.max(10, this.Yf[r.layer]), La) 180 === this.ga ? sa <= r.Q.x ? (Ra = r.Q.x, b.B(W++, Ra - Oa, na), b.B(W++, Ra, na), b.B(W++, Ra + pb, na)) : (b.B(W++, sa - Oa, na), b.B(W++, sa, na), b.B(W++, sa + pb, na)) : 90 === this.ga ? na >= r.Q.bottom ? (Ra = r.Q.y + r.Q.height,
  32485. b.B(W++, sa, Ra + pb), b.B(W++, sa, Ra), b.B(W++, sa, Ra - Oa)) : (b.B(W++, sa, na + pb), b.B(W++, sa, na), b.B(W++, sa, na - Oa)) : 270 === this.ga ? na <= r.Q.y ? (Ra = r.Q.y, b.B(W++, sa, Ra - Oa), b.B(W++, sa, Ra), b.B(W++, sa, Ra + pb)) : (b.B(W++, sa, na - Oa), b.B(W++, sa, na), b.B(W++, sa, na + pb)) : 0 === this.ga && (sa >= r.Q.right ? (Ra = r.Q.x + r.Q.width, b.B(W++, Ra + pb, na), b.B(W++, Ra, na), b.B(W++, Ra - Oa, na)) : (b.B(W++, sa + pb, na), b.B(W++, sa, na), b.B(W++, sa - Oa, na)));
  32486. else {
  32487. b.B(W++, hb, ub);
  32488. var vd = 0;
  32489. if (180 === this.ga || 0 === this.ga) {
  32490. if (180 === this.ga ? sa >= r.Q.right : sa <= r.Q.x) vd =
  32491. (0 === this.ga ? -Oa : pb) / 2;
  32492. b.B(W++, hb + vd, na)
  32493. } else {
  32494. if (270 === this.ga ? na >= r.Q.bottom : na <= r.Q.y) vd = (90 === this.ga ? -Oa : pb) / 2;
  32495. b.B(W++, sa, ub + vd)
  32496. }
  32497. b.B(W++, sa, na)
  32498. }
  32499. else Oa = Math.max(10, this.Jg[Sa.layer]), pb = Math.max(10, this.Yf[Sa.layer]), 180 === this.ga ? (La && b.B(W++, sa - Oa, na), b.B(W++, sa, na), La && b.B(W++, sa + pb, na)) : 90 === this.ga ? (La && b.B(W++, sa, na + pb), b.B(W++, sa, na), La && b.B(W++, sa, na - Oa)) : 270 === this.ga ? (La && b.B(W++, sa, na - Oa), b.B(W++, sa, na), La && b.B(W++, sa, na + pb)) : (La && b.B(W++, sa + pb, na), b.B(W++, sa, na), La && b.B(W++, sa - Oa,
  32500. na));
  32501. r = Sa
  32502. }
  32503. if (null === k || n !== dc || gb)
  32504. if (hb = b.m(W - 1).x, ub = b.m(W - 1).y, sa = b.m(W).x, na = b.m(W).y, gb) {
  32505. var wd = this.Yf[q.layer],
  32506. Rc = 0;
  32507. 180 === this.ga || 0 === this.ga ? (Rc = ub, Rc >= q.Q.y && Rc <= q.Q.bottom && (180 === this.ga ? sa >= q.Q.x : sa <= q.Q.right) && (Ra = q.pa + (180 === this.ga ? -wd : wd), Rc = Rc < q.Q.y + q.Q.height / 2 ? q.Q.y - this.ie / 2 : q.Q.bottom + this.ie / 2, b.B(W++, Ra, ub), b.B(W++, Ra, Rc)), b.B(W++, sa, Rc)) : (Rc = hb, Rc >= q.Q.x && Rc <= q.Q.right && (270 === this.ga ? na >= q.Q.y : na <= q.Q.bottom) && (Ra = q.va + (270 === this.ga ? -wd : wd), Rc = Rc < q.Q.x + q.Q.width / 2 ? q.Q.x -
  32508. this.ie / 2 : q.Q.right + this.ie / 2, b.B(W++, hb, Ra), b.B(W++, Rc, Ra)), b.B(W++, Rc, na));
  32509. b.B(W++, sa, na)
  32510. } else if (La) Oa = Math.max(10, this.Jg[q.layer]), pb = Math.max(10, this.Yf[q.layer]), 180 === this.ga && sa >= q.Q.x ? (Ra = q.Q.x + q.Q.width, b.ia(W - 2, Ra, ub), b.ia(W - 1, Ra + pb, ub)) : 90 === this.ga && na <= q.Q.bottom ? (Ra = q.Q.y, b.ia(W - 2, hb, Ra), b.ia(W - 1, hb, Ra - Oa)) : 270 === this.ga && na >= q.Q.y ? (Ra = q.Q.y + q.Q.height, b.ia(W - 2, hb, Ra), b.ia(W - 1, hb, Ra + pb)) : 0 === this.ga && sa <= q.Q.right && (Ra = q.Q.x, b.ia(W - 2, Ra, ub), b.ia(W - 1, Ra - Oa, ub));
  32511. else {
  32512. Oa = Math.max(10,
  32513. this.Jg[q.layer]);
  32514. pb = Math.max(10, this.Yf[q.layer]);
  32515. vd = 0;
  32516. if (180 === this.ga || 0 === this.ga) {
  32517. if (180 === this.ga ? sa <= q.Q.x : sa >= q.Q.right) vd = (0 === this.ga ? pb : -Oa) / 2;
  32518. b.B(W++, sa + vd, ub)
  32519. } else {
  32520. if (270 === this.ga ? na <= q.Q.y : na >= q.Q.bottom) vd = (90 === this.ga ? pb : -Oa) / 2;
  32521. b.B(W++, hb, na + vd)
  32522. }
  32523. b.B(W++, sa, na)
  32524. }
  32525. } else {
  32526. for (; null !== q && q !== r;) {
  32527. Qc = Sa = null;
  32528. for (var uh = q.tc.j; uh.next();) { var $e = uh.value; if ($e.link === c.link && (Sa = $e.toVertex, Qc = $e.fromVertex, null !== Qc.Gd && (Qc = null), null === Sa.Gd)) break }
  32529. var hb = 0,
  32530. ub = 0,
  32531. sa = 0,
  32532. na = 0,
  32533. ab = 0,
  32534. Oa = 0,
  32535. pb = 0;
  32536. if (Sa !== r)
  32537. if (hb = b.m(W - 1).x, ub = b.m(W - 1).y, sa = Sa.pa, na = Sa.va, gb)
  32538. if (180 === this.ga || 0 === this.ga) {
  32539. var Md = null !== Qc ? Qc.va : ub;
  32540. Md !== na && (ab = this.Vb[Sa.layer], 2 === W && (ab = 0 === this.ga ? Math.max(ab, hb) : Math.min(ab, hb)), b.B(W++, ab, ub), b.B(W++, ab, na))
  32541. } else {
  32542. var Jf = null !== Qc ? Qc.pa : hb;
  32543. Jf !== sa && (ab = this.Vb[Sa.layer], 2 === W && (ab = 90 === this.ga ? Math.max(ab, ub) : Math.min(ab, ub)), b.B(W++, hb, ab), b.B(W++, sa, ab))
  32544. }
  32545. else Oa = Math.max(10, this.Jg[Sa.layer]), pb = Math.max(10, this.Yf[Sa.layer]), 180 === this.ga ? (b.B(W++, sa + pb, na), La && b.B(W++,
  32546. sa, na), b.B(W++, sa - Oa, na)) : 90 === this.ga ? (b.B(W++, sa, na - Oa), La && b.B(W++, sa, na), b.B(W++, sa, na + pb)) : 270 === this.ga ? (b.B(W++, sa, na + pb), La && b.B(W++, sa, na), b.B(W++, sa, na - Oa)) : (b.B(W++, sa - Oa, na), La && b.B(W++, sa, na), b.B(W++, sa + pb, na));
  32547. q = Sa
  32548. }
  32549. gb && (hb = b.m(W - 1).x, ub = b.m(W - 1).y, sa = b.m(W).x, na = b.m(W).y, 180 === this.ga || 0 === this.ga ? ub !== na && (ab = 0 === this.ga ? Math.min(Math.max((sa + hb) / 2, this.Vb[r.layer]), sa) : Math.max(Math.min((sa + hb) / 2, this.Vb[r.layer]), sa), b.B(W++, ab, ub), b.B(W++, ab, na)) : hb !== sa && (ab = 90 === this.ga ? Math.min(Math.max((na +
  32550. ub) / 2, this.Vb[r.layer]), na) : Math.max(Math.min((na + ub) / 2, this.Vb[r.layer]), na), b.B(W++, hb, ab), b.B(W++, sa, ab)))
  32551. }
  32552. if (null !== d && La) {
  32553. if (null !== h) {
  32554. if (n === dc) {
  32555. var se = b.m(0),
  32556. be = b.m(2);
  32557. se.O(be) || b.ia(1, (se.x + be.x) / 2, (se.y + be.y) / 2)
  32558. }
  32559. Da = b.getLinkPoint(e, h, dc, !0, !1, g, k);
  32560. Da.H() || Da.set(e.aa.jm);
  32561. b.ia(0, Da.x, Da.y)
  32562. }
  32563. null !== k && (p === dc && (se = b.m(b.ta - 1), be = b.m(b.ta - 3), se.O(be) || b.ia(b.ta - 2, (se.x + be.x) / 2, (se.y + be.y) / 2)), Da = b.getLinkPoint(g, k, dc, !1, !1, e, h), Da.H() || Da.set(g.aa.jm), b.ia(b.ta - 1, Da.x, Da.y))
  32564. }
  32565. b.Ej();
  32566. c.commit()
  32567. }
  32568. }
  32569. }
  32570. for (var jd =
  32571. new K(J), vh = this.network.edges.j; vh.next();) {
  32572. var Kf = vh.value.link;
  32573. null !== Kf && Kf.ic && !jd.contains(Kf) && jd.add(Kf)
  32574. }
  32575. if (0 < jd.count)
  32576. if (90 === this.ga || 270 === this.ga) {
  32577. for (var Ig = 0, Hb = new K(nv), oc, xd, wh = jd.j; wh.next();) {
  32578. var qb = wh.value;
  32579. if (null !== qb && qb.ic)
  32580. for (var Pa = 2; Pa < qb.ta - 3; Pa++)
  32581. if (oc = qb.m(Pa), xd = qb.m(Pa + 1), ov(oc.y, xd.y) && !ov(oc.x, xd.x)) {
  32582. var Qb = new nv;
  32583. Qb.layer = Math.floor(oc.y / 2);
  32584. var Lf = qb.m(0),
  32585. Jg = qb.m(qb.ta - 1);
  32586. Qb.first = Lf.x * Lf.x + Lf.y;
  32587. Qb.re = Jg.x * Jg.x + Jg.y;
  32588. Qb.gf = Math.min(oc.x, xd.x);
  32589. Qb.Fe = Math.max(oc.x,
  32590. xd.x);
  32591. Qb.index = Pa;
  32592. Qb.link = qb;
  32593. if (Pa + 2 < qb.ta) {
  32594. var xh = qb.m(Pa - 1),
  32595. ib = qb.m(Pa + 2),
  32596. zc = 0;
  32597. xh.y < oc.y ? zc = ib.y < oc.y ? 3 : oc.x < xd.x ? 2 : 1 : xh.y > oc.y && (zc = ib.y > oc.y ? 0 : xd.x < oc.x ? 2 : 1);
  32598. Qb.Li = zc
  32599. }
  32600. Hb.add(Qb)
  32601. }
  32602. }
  32603. if (1 < Hb.count) {
  32604. Hb.sort(this.YG);
  32605. for (var $b = 0; $b < Hb.count;) {
  32606. for (var te = Hb.o[$b].layer, Ac = $b + 1; Ac < Hb.count && Hb.o[Ac].layer === te;) Ac++;
  32607. if (1 < Ac - $b)
  32608. for (var Bc = $b; Bc < Ac;) {
  32609. for (var vb = Hb.o[Bc].Fe, pc = $b + 1; pc < Ac && Hb.o[pc].gf < vb;) vb = Math.max(vb, Hb.o[pc].Fe), pc++;
  32610. var yb = pc - Bc;
  32611. if (1 < yb) {
  32612. Hb.Zq(this.Oy, Bc, Bc + yb);
  32613. for (var Fc = 1, db = Hb.o[Bc].re,
  32614. Pa = Bc; Pa < pc; Pa++) {
  32615. var Ta = Hb.o[Pa];
  32616. Ta.re !== db && (Fc++, db = Ta.re)
  32617. }
  32618. Hb.Zq(this.XG, Bc, Bc + yb);
  32619. for (var Mb = 1, db = Hb.o[Bc].first, Pa = Bc; Pa < pc; Pa++) Ta = Hb.o[Pa], Ta.first !== db && (Mb++, db = Ta.first);
  32620. var yd = !0,
  32621. lg = Mb;
  32622. Fc < Mb ? (yd = !1, lg = Fc, db = Hb.o[Bc].re, Hb.Zq(this.Oy, Bc, Bc + yb)) : db = Hb.o[Bc].first;
  32623. for (var af = 0, Pa = Bc; Pa < pc; Pa++) {
  32624. Ta = Hb.o[Pa];
  32625. (yd ? Ta.first : Ta.re) !== db && (af++, db = yd ? Ta.first : Ta.re);
  32626. qb = Ta.link;
  32627. oc = qb.m(Ta.index);
  32628. xd = qb.m(Ta.index + 1);
  32629. var bf = this.tG * (af - (lg - 1) / 2);
  32630. if (!qb.Nj || pv(oc.x, oc.y + bf, xd.x, xd.y + bf)) Ig++, qb.Dm(),
  32631. qb.ia(Ta.index, oc.x, oc.y + bf), qb.ia(Ta.index + 1, xd.x, xd.y + bf), qb.Ej()
  32632. }
  32633. }
  32634. Bc = pc
  32635. }
  32636. $b = Ac
  32637. }
  32638. }
  32639. } else {
  32640. for (var wj = 0, Rb = new K(nv), qc, fc, kd = jd.j; kd.next();) {
  32641. var mb = kd.value;
  32642. if (null !== mb && mb.ic)
  32643. for (var Sb = 2; Sb < mb.ta - 3; Sb++)
  32644. if (qc = mb.m(Sb), fc = mb.m(Sb + 1), ov(qc.x, fc.x) && !ov(qc.y, fc.y)) {
  32645. var ue = new nv;
  32646. ue.layer = Math.floor(qc.x / 2);
  32647. var zb = mb.m(0),
  32648. ce = mb.m(mb.ta - 1);
  32649. ue.first = zb.x + zb.y * zb.y;
  32650. ue.re = ce.x + ce.y * ce.y;
  32651. ue.gf = Math.min(qc.y, fc.y);
  32652. ue.Fe = Math.max(qc.y, fc.y);
  32653. ue.index = Sb;
  32654. ue.link = mb;
  32655. if (Sb + 2 < mb.ta) {
  32656. var yh = mb.m(Sb - 1),
  32657. zh = mb.m(Sb +
  32658. 2),
  32659. Kg = 0;
  32660. yh.x < qc.x ? Kg = zh.x < qc.x ? 3 : qc.y < fc.y ? 2 : 1 : yh.x > qc.x && (Kg = zh.x > qc.x ? 0 : fc.y < qc.y ? 2 : 1);
  32661. ue.Li = Kg
  32662. }
  32663. Rb.add(ue)
  32664. }
  32665. }
  32666. if (1 < Rb.count) {
  32667. Rb.sort(this.YG);
  32668. for (var ld = 0; ld < Rb.count;) {
  32669. for (var Nd = Rb.o[ld].layer, gc = ld + 1; gc < Rb.count && Rb.o[gc].layer === Nd;) gc++;
  32670. if (1 < gc - ld)
  32671. for (var Ab = ld; Ab < gc;) {
  32672. for (var zd = Rb.o[Ab].Fe, nb = ld + 1; nb < gc && Rb.o[nb].gf < zd;) zd = Math.max(zd, Rb.o[nb].Fe), nb++;
  32673. var hc = nb - Ab;
  32674. if (1 < hc) {
  32675. Rb.Zq(this.Oy, Ab, Ab + hc);
  32676. for (var ii = 1, ad = Rb.o[Ab].re, Sb = Ab; Sb < nb; Sb++) {
  32677. var Ib = Rb.o[Sb];
  32678. Ib.re !== ad && (ii++, ad = Ib.re)
  32679. }
  32680. Rb.Zq(this.XG,
  32681. Ab, Ab + hc);
  32682. for (var ve = 1, ad = Rb.o[Ab].first, Sb = Ab; Sb < nb; Sb++) Ib = Rb.o[Sb], Ib.first !== ad && (ve++, ad = Ib.first);
  32683. var cf = !0,
  32684. bd = ve;
  32685. ii < ve ? (cf = !1, bd = ii, ad = Rb.o[Ab].re, Rb.Zq(this.Oy, Ab, Ab + hc)) : ad = Rb.o[Ab].first;
  32686. for (var Mf = 0, Sb = Ab; Sb < nb; Sb++) {
  32687. Ib = Rb.o[Sb];
  32688. (cf ? Ib.first : Ib.re) !== ad && (Mf++, ad = cf ? Ib.first : Ib.re);
  32689. mb = Ib.link;
  32690. qc = mb.m(Ib.index);
  32691. fc = mb.m(Ib.index + 1);
  32692. var Nf = this.tG * (Mf - (bd - 1) / 2);
  32693. if (!mb.Nj || pv(qc.x + Nf, qc.y, fc.x + Nf, fc.y)) wj++, mb.Dm(), mb.ia(Ib.index, qc.x + Nf, qc.y), mb.ia(Ib.index + 1, fc.x + Nf, fc.y), mb.Ej()
  32694. }
  32695. }
  32696. Ab = nb
  32697. }
  32698. ld =
  32699. gc
  32700. }
  32701. }
  32702. }
  32703. };
  32704. ru.prototype.YG = function(a, b) { return a instanceof nv && b instanceof nv && a !== b ? a.layer < b.layer ? -1 : a.layer > b.layer ? 1 : a.gf < b.gf ? -1 : a.gf > b.gf ? 1 : a.Fe < b.Fe ? -1 : a.Fe > b.Fe ? 1 : 0 : 0 };
  32705. ru.prototype.XG = function(a, b) { return a instanceof nv && b instanceof nv && a !== b ? a.first < b.first ? -1 : a.first > b.first || a.Li < b.Li ? 1 : a.Li > b.Li || a.gf < b.gf ? -1 : a.gf > b.gf ? 1 : a.Fe < b.Fe ? -1 : a.Fe > b.Fe ? 1 : 0 : 0 };
  32706. ru.prototype.Oy = function(a, b) { return a instanceof nv && b instanceof nv && a !== b ? a.re < b.re ? -1 : a.re > b.re || a.Li < b.Li ? 1 : a.Li > b.Li || a.gf < b.gf ? -1 : a.gf > b.gf ? 1 : a.Fe < b.Fe ? -1 : a.Fe > b.Fe ? 1 : 0 : 0 };
  32707. function ov(a, b) { v && (D.p(a, ru, "isApprox:a"), D.p(b, ru, "isApprox:b")); var c = a - b; return -1 < c && 1 > c }
  32708. function pv(a, b, c, d) { v && (D.p(a, ru, "isUnoccupied2:px"), D.p(b, ru, "isUnoccupied2:py"), D.p(c, ru, "isUnoccupied2:qx"), D.p(d, ru, "isUnoccupied2:qy")); return !0 }
  32709. function Fu(a, b) {
  32710. var c, d = a.ve[b];
  32711. if (d >= a.yh.length) {
  32712. c = [];
  32713. for (var e = 0; e < a.yh.length; e++) c[e] = a.yh[e];
  32714. a.yh = c
  32715. }
  32716. void 0 === a.yh[d] || null === a.yh[d] ? c = [] : (c = a.yh[d], a.yh[d] = null);
  32717. d = a.Ws[b];
  32718. for (e = 0; e < d.length; e++) {
  32719. var g = d[e];
  32720. c[g.index] = g
  32721. }
  32722. return c
  32723. }
  32724. function Gu(a, b, c) { a.yh[a.ve[b]] = c }
  32725. D.defineProperty(ru, { layerSpacing: "layerSpacing" }, function() { return this.an }, function(a) { this.an !== a && (D.h(a, "number", ru, "layerSpacing"), 0 <= a && (this.an = a, this.L())) });
  32726. D.defineProperty(ru, { sL: "columnSpacing" }, function() { return this.ie }, function(a) { this.ie !== a && (D.h(a, "number", ru, "columnSpacing"), 0 < a && (this.ie = a, this.L())) });
  32727. D.defineProperty(ru, { direction: "direction" }, function() { return this.ga }, function(a) { this.ga !== a && (D.h(a, "number", ru, "direction"), 0 === a || 90 === a || 180 === a || 270 === a ? (this.ga = a, this.L()) : D.k("LayeredDigraphLayout.direction must be 0, 90, 180, or 270")) });
  32728. D.defineProperty(ru, { angle: "angle" }, function() { return this.direction }, function(a) { this.direction = a });
  32729. D.defineProperty(ru, { uI: "cycleRemoveOption" }, function() { return this.Ro }, function(a) { this.Ro !== a && (D.Da(a, ru, ru, "cycleRemoveOption"), a === yu || a === su) && (this.Ro = a, this.L()) });
  32730. D.defineProperty(ru, { zJ: "layeringOption" }, function() { return this.sp }, function(a) { this.sp !== a && (D.Da(a, ru, ru, "layeringOption"), a === tu || a === Qu || a === Su) && (this.sp = a, this.L()) });
  32731. D.defineProperty(ru, { lJ: "initializeOption" }, function() { return this.ip }, function(a) { this.ip !== a && (D.Da(a, ru, ru, "initializeOption"), a === uu || a === Yu || a === Wu) && (this.ip = a, this.L()) });
  32732. D.defineProperty(ru, { $L: "iterations" }, function() { return this.$m }, function(a) { this.$m !== a && (D.p(a, xu, "iterations"), 0 <= a && (this.$m = a, this.L())) });
  32733. D.defineProperty(ru, { aI: "aggressiveOption" }, function() { return this.Fo }, function(a) { this.Fo !== a && (D.Da(a, ru, ru, "aggressiveOption"), a === bv || a === vu || a === cv) && (this.Fo = a, this.L()) });
  32734. D.defineProperty(ru, { tM: "packOption" }, function() { return this.qj }, function(a) { this.qj !== a && (D.h(a, "number", ru, "packOption"), 0 <= a && 8 > a && (this.qj = a, this.L())) });
  32735. D.defineProperty(ru, { Xq: "setsPortSpots" }, function() { return this.si }, function(a) { this.si !== a && (D.h(a, "boolean", ru, "setsPortSpots"), this.si = a, this.L()) });
  32736. D.defineProperty(ru, { tG: "linkSpacing" }, function() { return this.Ds }, function(a) { this.Ds !== a && (D.h(a, "number", ru, "linkSpacing"), 0 <= a && (this.Ds = a, this.L())) });
  32737. D.w(ru, { HJ: "maxLayer" }, function() { return this.Ab });
  32738. D.w(ru, { eM: "maxIndex" }, function() { return this.Bw });
  32739. D.w(ru, { dM: "maxColumn" }, function() { return this.Qb });
  32740. D.w(ru, { jM: "minIndexLayer" }, function() { return this.Ms });
  32741. D.w(ru, { fM: "maxIndexLayer" }, function() { return this.Zf });
  32742. var su;
  32743. ru.CycleDepthFirst = su = D.s(ru, "CycleDepthFirst", 0);
  32744. var yu;
  32745. ru.CycleGreedy = yu = D.s(ru, "CycleGreedy", 1);
  32746. var tu;
  32747. ru.LayerOptimalLinkLength = tu = D.s(ru, "LayerOptimalLinkLength", 0);
  32748. var Qu;
  32749. ru.LayerLongestPathSink = Qu = D.s(ru, "LayerLongestPathSink", 1);
  32750. var Su;
  32751. ru.LayerLongestPathSource = Su = D.s(ru, "LayerLongestPathSource", 2);
  32752. var uu;
  32753. ru.InitDepthFirstOut = uu = D.s(ru, "InitDepthFirstOut", 0);
  32754. var Yu;
  32755. ru.InitDepthFirstIn = Yu = D.s(ru, "InitDepthFirstIn", 1);
  32756. var Wu;
  32757. ru.InitNaive = Wu = D.s(ru, "InitNaive", 2);
  32758. var bv;
  32759. ru.AggressiveNone = bv = D.s(ru, "AggressiveNone", 0);
  32760. var vu;
  32761. ru.AggressiveLess = vu = D.s(ru, "AggressiveLess", 1);
  32762. var cv;
  32763. ru.AggressiveMore = cv = D.s(ru, "AggressiveMore", 2);
  32764. ru.PackNone = 0;
  32765. var dv;
  32766. ru.PackExpand = dv = 1;
  32767. var ev;
  32768. ru.PackStraighten = ev = 2;
  32769. var gv;
  32770. ru.PackMedian = gv = 4;
  32771. var wu;
  32772. ru.PackAll = wu = 7;
  32773. function nv() {
  32774. this.index = this.Fe = this.gf = this.re = this.first = this.layer = 0;
  32775. this.link = null;
  32776. this.Li = 0
  32777. }
  32778. D.me(nv, { layer: !0, first: !0, re: !0, gf: !0, Fe: !0, index: !0, link: !0, Li: !0 });
  32779. function xu() { ua.call(this) }
  32780. D.Ta(xu, ua);
  32781. D.ka("LayeredDigraphNetwork", xu);
  32782. xu.prototype.createVertex = function() { return new qv };
  32783. xu.prototype.createEdge = function() { return new rv };
  32784. function qv() {
  32785. va.call(this);
  32786. this.index = this.column = this.layer = -1;
  32787. this.component = NaN;
  32788. this.near = null;
  32789. this.valid = !1;
  32790. this.finish = this.lq = NaN;
  32791. this.En = 0;
  32792. this.HB = this.IB = null
  32793. }
  32794. D.Ta(qv, va);
  32795. D.ka("LayeredDigraphVertex", qv);
  32796. function rv() {
  32797. wa.call(this);
  32798. this.forest = this.rev = this.valid = !1;
  32799. this.portToPos = this.portFromPos = NaN;
  32800. this.portToColOffset = this.portFromColOffset = 0
  32801. }
  32802. D.Ta(rv, wa);
  32803. D.ka("LayeredDigraphEdge", rv);
  32804. function $() {
  32805. 0 < arguments.length && D.zd($);
  32806. $g.call(this);
  32807. this.Jd = new L(Object);
  32808. this.gt = sv;
  32809. this.Wf = tv;
  32810. this.Wt = uv;
  32811. this.yw = vv;
  32812. this.IC = null;
  32813. this.bi = !0;
  32814. this.Bd = wv;
  32815. this.xg = (new Ca(10, 10)).freeze();
  32816. this.Aa = new xv;
  32817. this.Ba = new xv;
  32818. this.sA = []
  32819. }
  32820. D.Ta($, $g);
  32821. D.ka("TreeLayout", $);
  32822. $.prototype.cloneProtected = function(a) {
  32823. $g.prototype.cloneProtected.call(this, a);
  32824. a.gt = this.gt;
  32825. a.Wt = this.Wt;
  32826. a.yw = this.yw;
  32827. a.bi = this.bi;
  32828. a.Bd = this.Bd;
  32829. a.xg.assign(this.xg);
  32830. a.Aa.copyInheritedPropertiesFrom(this.Aa);
  32831. a.Ba.copyInheritedPropertiesFrom(this.Ba)
  32832. };
  32833. $.prototype.qc = function(a) { a.Qe === $ ? 0 === a.name.indexOf("Alignment") ? this.alignment = a : 0 === a.name.indexOf("Arrangement") ? this.eg = a : 0 === a.name.indexOf("Compaction") ? this.compaction = a : 0 === a.name.indexOf("Path") ? this.path = a : 0 === a.name.indexOf("Sorting") ? this.sorting = a : 0 === a.name.indexOf("Style") ? this.HK = a : D.k("Unknown enum value: " + a) : $g.prototype.qc.call(this, a) };
  32834. $.prototype.createNetwork = function() { return new yv };
  32835. $.prototype.makeNetwork = function(a) {
  32836. function b(a) {
  32837. if (a instanceof G) return !a.Lf && "Comment" !== a.Kd;
  32838. if (a instanceof J) {
  32839. var b = a.$;
  32840. if (null === b || b.Lf || "Comment" === b.Kd) return !1;
  32841. a = a.ba;
  32842. return null === a || a.Lf || "Comment" === a.Kd ? !1 : !0
  32843. }
  32844. return !1
  32845. }
  32846. var c = this.createNetwork();
  32847. c.Yb = this;
  32848. a instanceof E ? (c.Ok(a.rg, !0, b), c.Ok(a.links, !0, b)) : a instanceof I ? c.Ok(a.uc, !1, b) : c.Ok(a.j, !1, b);
  32849. return c
  32850. };
  32851. $.prototype.doLayout = function(a) {
  32852. null === a && D.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
  32853. null === this.network && (this.network = this.makeNetwork(a));
  32854. this.eg !== zv && (this.Zd = this.initialOrigin(this.Zd));
  32855. var b = this.g;
  32856. null === b && a instanceof E && (b = a);
  32857. this.Wf = this.path === sv && null !== b ? b.ee ? tv : Av : this.path === sv ? tv : this.path;
  32858. if (0 < this.network.vertexes.count) {
  32859. this.network.Px();
  32860. for (a = this.network.vertexes.j; a.next();) b = a.value, b.initialized = !1, b.level =
  32861. 0, b.parent = null, b.children = [];
  32862. if (0 < this.Jd.count) {
  32863. a = new L(xv);
  32864. for (b = this.Jd.j; b.next();) {
  32865. var c = b.value;
  32866. c instanceof G ? (c = this.network.Rn(c), null !== c && a.add(c)) : c instanceof xv && a.add(c)
  32867. }
  32868. this.Jd = a
  32869. }
  32870. 0 === this.Jd.count && this.findRoots();
  32871. for (a = this.Jd.copy().j; a.next();) b = a.value, b.initialized || (b.initialized = !0, Bv(this, b));
  32872. b = this.network.vertexes;
  32873. for (a = null; a = Cv(b), 0 < a.count;) b = Dv(this, a), null !== b && this.Jd.add(b), b.initialized = !0, Bv(this, b), b = a;
  32874. for (a = this.Jd.j; a.next();) b = a.value, b instanceof xv && Ev(this,
  32875. b);
  32876. for (a = this.Jd.j; a.next();) b = a.value, b instanceof xv && Fv(this, b);
  32877. for (a = this.Jd.j; a.next();) b = a.value, b instanceof xv && Gv(this, b);
  32878. this.FA();
  32879. if (this.vB === Hv) {
  32880. c = [];
  32881. for (a = this.network.vertexes.j; a.next();) {
  32882. var d = a.value,
  32883. b = d.parent;
  32884. null === b && (b = d);
  32885. var b = 0 === b.angle || 180 === b.angle,
  32886. e = c[d.level];
  32887. void 0 === e && (e = 0);
  32888. c[d.level] = Math.max(e, b ? d.width : d.height)
  32889. }
  32890. for (d = 0; d < c.length; d++) void 0 === c[d] && (c[d] = 0);
  32891. this.IC = c;
  32892. for (a = this.network.vertexes.j; a.next();) d = a.value, b = d.parent, null === b && (b = d), 0 === b.angle || 180 ===
  32893. b.angle ? (180 === b.angle && (d.xu += c[d.level] - d.width), d.width = c[d.level]) : (270 === b.angle && (d.yu += c[d.level] - d.height), d.height = c[d.level])
  32894. } else if (this.vB === Iv)
  32895. for (a = this.network.vertexes.j; a.next();) {
  32896. c = a.value;
  32897. b = 0 === c.angle || 180 === c.angle;
  32898. e = -1;
  32899. for (d = 0; d < c.children.length; d++) var g = c.children[d],
  32900. e = Math.max(e, b ? g.width : g.height);
  32901. if (0 <= e)
  32902. for (d = 0; d < c.children.length; d++) g = c.children[d], b ? (180 === c.angle && (g.xu += e - g.width), g.width = e) : (270 === c.angle && (g.yu += e - g.height), g.height = e)
  32903. }
  32904. for (a = this.Jd.j; a.next();) b =
  32905. a.value, b instanceof xv && this.layoutTree(b);
  32906. this.arrangeTrees();
  32907. this.updateParts()
  32908. }
  32909. this.network = null;
  32910. this.Jd = new L(Object);
  32911. this.zf = !0
  32912. };
  32913. function Cv(a) {
  32914. var b = new L(xv);
  32915. for (a = a.j; a.next();) {
  32916. var c = a.value;
  32917. c.initialized || b.add(c)
  32918. }
  32919. return b
  32920. }
  32921. $.prototype.findRoots = function() {
  32922. for (var a = this.network.vertexes, b = a.j; b.next();) {
  32923. var c = b.value;
  32924. switch (this.Wf) {
  32925. case tv:
  32926. 0 === c.wc.count && this.Jd.add(c);
  32927. break;
  32928. case Av:
  32929. 0 === c.tc.count && this.Jd.add(c);
  32930. break;
  32931. default:
  32932. D.k("Unhandled path value " + this.Wf.toString())
  32933. }
  32934. }
  32935. 0 === this.Jd.count && (a = Dv(this, a), null !== a && this.Jd.add(a))
  32936. };
  32937. function Dv(a, b) {
  32938. for (var c = 999999, d = null, e = b.j; e.next();) {
  32939. var g = e.value;
  32940. switch (a.Wf) {
  32941. case tv:
  32942. g.wc.count < c && (c = g.wc.count, d = g);
  32943. break;
  32944. case Av:
  32945. g.tc.count < c && (c = g.tc.count, d = g);
  32946. break;
  32947. default:
  32948. D.k("Unhandled path value " + a.Wf.toString())
  32949. }
  32950. }
  32951. return d
  32952. }
  32953. function Bv(a, b) {
  32954. if (null !== b) {
  32955. v && D.l(b, xv, $, "walkTree:v");
  32956. switch (a.Wf) {
  32957. case tv:
  32958. if (0 < b.tc.count) {
  32959. for (var c = new K(xv), d = b.zI; d.next();) {
  32960. var e = d.value;
  32961. Jv(a, b, e) && c.add(e)
  32962. }
  32963. 0 < c.count && (b.children = c.Fc())
  32964. }
  32965. break;
  32966. case Av:
  32967. if (0 < b.wc.count) {
  32968. c = new K(xv);
  32969. for (d = b.wK; d.next();) e = d.value, Jv(a, b, e) && c.add(e);
  32970. 0 < c.count && (b.children = c.Fc())
  32971. }
  32972. break;
  32973. default:
  32974. D.k("Unhandled path value" + a.Wf.toString())
  32975. }
  32976. c = b.children;
  32977. d = c.length;
  32978. for (e = 0; e < d; e++) {
  32979. var g = c[e];
  32980. g.initialized = !0;
  32981. g.level = b.level + 1;
  32982. g.parent = b;
  32983. a.Jd.remove(g)
  32984. }
  32985. for (e =
  32986. 0; e < d; e++) g = c[e], Bv(a, g)
  32987. }
  32988. }
  32989. function Jv(a, b, c) {
  32990. v && D.l(b, xv, $, "walkOK:v");
  32991. v && D.l(c, xv, $, "walkOK:c");
  32992. if (c.initialized) {
  32993. var d;
  32994. if (null === b) d = !1;
  32995. else {
  32996. v && D.l(c, xv, $, "isAncestor:a");
  32997. v && D.l(b, xv, $, "isAncestor:b");
  32998. for (d = b.parent; null !== d && d !== c;) d = d.parent;
  32999. d = d === c
  33000. }
  33001. if (d || c.level > b.level) return !1;
  33002. a.removeChild(c.parent, c)
  33003. }
  33004. return !0
  33005. }
  33006. $.prototype.removeChild = function(a, b) {
  33007. if (null !== a && null !== b) {
  33008. v && D.l(a, xv, $, "removeChild:p");
  33009. v && D.l(b, xv, $, "removeChild:c");
  33010. for (var c = a.children, d = 0, e = 0; e < c.length; e++) c[e] === b && d++;
  33011. if (0 < d) {
  33012. for (var d = Array(c.length - d), g = 0, e = 0; e < c.length; e++) c[e] !== b && (d[g++] = c[e]);
  33013. a.children = d
  33014. }
  33015. }
  33016. };
  33017. function Ev(a, b) {
  33018. if (null !== b) {
  33019. v && D.l(b, xv, $, "initializeTree:v");
  33020. a.initializeTreeVertexValues(b);
  33021. b.alignment === Kv && a.sortTreeVertexChildren(b);
  33022. for (var c = 0, d = b.Gn, e = 0, g = b.children, h = g.length, k = 0; k < h; k++) {
  33023. var l = g[k];
  33024. Ev(a, l);
  33025. c += l.descendantCount + 1;
  33026. d = Math.max(d, l.maxChildrenCount);
  33027. e = Math.max(e, l.maxGenerationCount)
  33028. }
  33029. b.descendantCount = c;
  33030. b.maxChildrenCount = d;
  33031. b.maxGenerationCount = 0 < d ? e + 1 : 0
  33032. }
  33033. }
  33034. function Lv(a, b) {
  33035. v && D.l(b, xv, $, "mom:v");
  33036. switch (a.Wt) {
  33037. default:
  33038. case uv:
  33039. return null !== b.parent ? b.parent : a.Aa;
  33040. case Mv:
  33041. return null === b.parent ? a.Aa : null === b.parent.parent ? a.Ba : b.parent;
  33042. case Nv:
  33043. return null !== b.parent ? null !== b.parent.parent ? b.parent.parent : a.Ba : a.Aa;
  33044. case Ov:
  33045. var c = !0;
  33046. if (0 === b.Gn) c = !1;
  33047. else
  33048. for (var d = b.children, e = d.length, g = 0; g < e; g++)
  33049. if (0 < d[g].Gn) { c = !1; break } return c && null !== b.parent ? a.Ba : null !== b.parent ? b.parent : a.Aa
  33050. }
  33051. }
  33052. $.prototype.initializeTreeVertexValues = function(a) {
  33053. v && D.l(a, xv, $, "initializeTreeVertexValues:v");
  33054. var b = Lv(this, a);
  33055. a.copyInheritedPropertiesFrom(b);
  33056. if (null !== a.parent && a.parent.alignment === Kv) {
  33057. for (var b = a.angle, c = a.parent.children, d = 0; d < c.length && a !== c[d];) d++;
  33058. 0 === d % 2 ? d !== c.length - 1 && (b = 90 === b ? 180 : 180 === b ? 270 : 270 === b ? 180 : 270) : b = 90 === b ? 0 : 180 === b ? 90 : 270 === b ? 0 : 90;
  33059. a.angle = b
  33060. }
  33061. a.initialized = !0
  33062. };
  33063. function Fv(a, b) {
  33064. if (null !== b) {
  33065. v && D.l(b, xv, $, "assignTree:v");
  33066. a.assignTreeVertexValues(b);
  33067. for (var c = b.children, d = c.length, e = 0; e < d; e++) Fv(a, c[e])
  33068. }
  33069. }
  33070. $.prototype.assignTreeVertexValues = function() {};
  33071. function Gv(a, b) {
  33072. if (null !== b) {
  33073. v && D.l(b, xv, $, "sortTree:v");
  33074. b.alignment !== Kv && a.sortTreeVertexChildren(b);
  33075. for (var c = b.children, d = c.length, e = 0; e < d; e++) Gv(a, c[e])
  33076. }
  33077. }
  33078. $.prototype.sortTreeVertexChildren = function(a) {
  33079. v && D.l(a, xv, $, "sortTreeVertexChildren:v");
  33080. switch (a.sorting) {
  33081. case Pv:
  33082. break;
  33083. case Qv:
  33084. a.children.reverse();
  33085. break;
  33086. case Rv:
  33087. a.children.sort(a.comparer);
  33088. break;
  33089. case Sv:
  33090. a.children.sort(a.comparer);
  33091. a.children.reverse();
  33092. break;
  33093. default:
  33094. D.k("Unhandled sorting value " + a.sorting.toString())
  33095. }
  33096. };
  33097. $.prototype.FA = function() {
  33098. if (this.comments)
  33099. for (var a = this.network.vertexes.j; a.next();) this.addComments(a.value)
  33100. };
  33101. $.prototype.addComments = function(a) {
  33102. v && D.l(a, xv, $, "addComments:v");
  33103. var b = a.angle,
  33104. c = a.parent,
  33105. d = 0,
  33106. e = Tv,
  33107. e = !1;
  33108. null !== c && (d = c.angle, e = c.alignment, e = Uv(e));
  33109. var b = 90 === b || 270 === b,
  33110. d = 90 === d || 270 === d,
  33111. c = 0 === a.Gn,
  33112. g = 0,
  33113. h = 0,
  33114. k = 0,
  33115. l = a.commentSpacing;
  33116. if (null !== a.Zc)
  33117. for (var m = a.Zc.GF(); m.next();) {
  33118. var n = m.value;
  33119. "Comment" === n.Kd && n.canLayout() && (null === a.comments && (a.comments = []), a.comments.push(n), n.kf(), n = n.Fa, b && !c || !e && !d && c || e && d && c ? (g = Math.max(g, n.width), h += n.height + Math.abs(k)) : (g += n.width + Math.abs(k), h = Math.max(h,
  33120. n.height)), k = l)
  33121. }
  33122. null !== a.comments && (b && !c || !e && !d && c || e && d && c ? (g += Math.abs(a.commentMargin), h = Math.max(0, h - a.height)) : (h += Math.abs(a.commentMargin), g = Math.max(0, g - a.width)), e = D.vg(0, 0, a.Q.width + g, a.Q.height + h), a.pb = e, D.Lb(e))
  33123. };
  33124. function Uv(a) { return a === Vv || a === Kv || a === Wv || a === Xv }
  33125. function Yv(a) { return a === Vv || a === Kv }
  33126. function Zv(a) { v && D.l(a, xv, $, "isLeftSideBus:v"); var b = a.parent; if (null !== b) { var c = b.alignment; if (Uv(c)) { if (Yv(c)) { b = b.children; for (c = 0; c < b.length && a !== b[c];) c++; return 0 === c % 2 } if (c === Wv) return !0 } } return !1 }
  33127. $.prototype.layoutComments = function(a) {
  33128. v && D.l(a, xv, $, "layoutComments:v");
  33129. if (null !== a.comments) {
  33130. var b = a.Zc.Fa,
  33131. c = a.parent,
  33132. d = a.angle,
  33133. e = 0,
  33134. g = Tv,
  33135. g = !1;
  33136. null !== c && (e = c.angle, g = c.alignment, g = Uv(g));
  33137. for (var c = 90 === d || 270 === d, d = 90 === e || 270 === e, h = 0 === a.Gn, k = Zv(a), l = 0, m = a.comments, n = m.length, p = D.P(), q = 0; q < n; q++) {
  33138. var r = m[q],
  33139. s = r.Fa;
  33140. if (c && !h || !g && !d && h || g && d && h) {
  33141. if (135 < e && !g || d && k)
  33142. if (0 <= a.commentMargin)
  33143. for (p.n(a.Q.x - a.commentMargin - s.width, a.Q.y + l), r.move(p), r = r.Yg(); r.next();) {
  33144. var u = r.value;
  33145. u.Gb = ed;
  33146. u.Hb = fd
  33147. } else
  33148. for (p.n(a.Q.x +
  33149. 2 * a.W.x - a.commentMargin, a.Q.y + l), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = fd, u.Hb = ed;
  33150. else if (0 <= a.commentMargin)
  33151. for (p.n(a.Q.x + 2 * a.W.x + a.commentMargin, a.Q.y + l), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = fd, u.Hb = ed;
  33152. else
  33153. for (p.n(a.Q.x + a.commentMargin - s.width, a.Q.y + l), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = ed, u.Hb = fd;
  33154. l = 0 <= a.commentSpacing ? l + (s.height + a.commentSpacing) : l + (a.commentSpacing - s.height)
  33155. } else {
  33156. if (135 < e && !g || !d && k)
  33157. if (0 <= a.commentMargin)
  33158. for (p.n(a.Q.x + l, a.Q.y - a.commentMargin - s.height),
  33159. r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = $c, u.Hb = gd;
  33160. else
  33161. for (p.n(a.Q.x + l, a.Q.y + 2 * a.W.y - a.commentMargin), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = gd, u.Hb = $c;
  33162. else if (0 <= a.commentMargin)
  33163. for (p.n(a.Q.x + l, a.Q.y + 2 * a.W.y + a.commentMargin), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = gd, u.Hb = $c;
  33164. else
  33165. for (p.n(a.Q.x + l, a.Q.y + a.commentMargin - s.height), r.move(p), r = r.Yg(); r.next();) u = r.value, u.Gb = $c, u.Hb = gd;
  33166. l = 0 <= a.commentSpacing ? l + (s.width + a.commentSpacing) : l + (a.commentSpacing - s.width)
  33167. }
  33168. }
  33169. D.A(p);
  33170. b = l - a.commentSpacing -
  33171. (c ? b.height : b.width);
  33172. if (this.Wf === tv)
  33173. for (e = a.tc; e.next();) a = e.value.link, null === a || a.Nj || (a.rm = 0 < b ? b : NaN);
  33174. else
  33175. for (e = a.wc; e.next();) a = e.value.link, null === a || a.Nj || (a.Hm = 0 < b ? b : NaN)
  33176. }
  33177. };
  33178. $.prototype.layoutTree = function(a) {
  33179. if (null !== a) {
  33180. v && D.l(a, xv, $, "layoutTree:v");
  33181. for (var b = a.children, c = b.length, d = 0; d < c; d++) this.layoutTree(b[d]);
  33182. switch (a.compaction) {
  33183. case $v:
  33184. aw(this, a);
  33185. break;
  33186. case bw:
  33187. if (a.alignment === Kv) aw(this, a);
  33188. else if (v && D.l(a, xv, $, "layoutTreeBlock:v"), 0 === a.Gn) {
  33189. var d = a.parent,
  33190. b = !1,
  33191. c = 0,
  33192. e = Tv;
  33193. null !== d && (c = d.angle, e = d.alignment, b = Uv(e));
  33194. d = Zv(a);
  33195. a.sa.n(0, 0);
  33196. a.tb.n(a.width, a.height);
  33197. null === a.parent || null === a.comments || (180 !== c && 270 !== c || b) && !d ? a.Wa.n(0, 0) : 180 === c && !b || (90 === c || 270 ===
  33198. c) && d ? a.Wa.n(a.width - 2 * a.W.x, 0) : a.Wa.n(0, a.height - 2 * a.W.y);
  33199. a.Ru = null;
  33200. a.kv = null
  33201. } else {
  33202. for (var g = cw(a), b = 90 === g || 270 === g, h = 0, k = a.children, l = k.length, m = 0; m < l; m++) var n = k[m],
  33203. h = Math.max(h, b ? n.tb.width : n.tb.height);
  33204. var p = a.alignment,
  33205. d = p === dw,
  33206. q = p === ew,
  33207. r = Uv(p),
  33208. s = Math.max(0, a.breadthLimit),
  33209. c = fw(a),
  33210. u = a.nodeSpacing,
  33211. t = gw(a),
  33212. y = a.rowSpacing,
  33213. w = 0;
  33214. if (d || q || a.Rq || a.Sq && 1 === a.maxGenerationCount) w = Math.max(0, a.rowIndent);
  33215. var d = a.width,
  33216. e = a.height,
  33217. A = 0,
  33218. B = 0,
  33219. P = 0,
  33220. H = null,
  33221. R = null,
  33222. aa = 0,
  33223. V = 0,
  33224. ea = 0,
  33225. la = 0,
  33226. Da = 0,
  33227. La = 0,
  33228. gb = 0,
  33229. Aa = 0,
  33230. n = 0;
  33231. r &&
  33232. !Yv(p) && 135 < g && k.reverse();
  33233. if (Yv(p))
  33234. if (1 < l)
  33235. for (m = 0; m < l; m++) 0 === m % 2 && m !== l - 1 ? Aa = Math.max(Aa, b ? k[m].tb.width : k[m].tb.height) : 0 !== m % 2 && (n = Math.max(n, b ? k[m].tb.width : k[m].tb.height));
  33236. else 1 === l && (Aa = b ? k[0].tb.width : k[0].tb.height);
  33237. if (r) {
  33238. switch (p) {
  33239. case Vv:
  33240. B = 135 > g ? hw(a, k, Aa, A, B) : iw(a, k, Aa, A, B);
  33241. Aa = B.x;
  33242. A = B.width;
  33243. B = B.height;
  33244. break;
  33245. case Wv:
  33246. for (m = 0; m < l; m++) {
  33247. var n = k[m],
  33248. W = n.tb,
  33249. H = 0 === La ? 0 : y;
  33250. b ? (n.sa.n(h - W.width, la + H), A = Math.max(A, W.width), B = Math.max(B, la + H + W.height), la += H + W.height) : (n.sa.n(ea + H, h - W.height), A = Math.max(A,
  33251. ea + H + W.width), B = Math.max(B, W.height), ea += H + W.width);
  33252. La++
  33253. }
  33254. break;
  33255. case Xv:
  33256. for (m = 0; m < l; m++) n = k[m], W = n.tb, H = 0 === La ? 0 : y, b ? (n.sa.n(u / 2 + a.W.x, la + H), A = Math.max(A, W.width), B = Math.max(B, la + H + W.height), la += H + W.height) : (n.sa.n(ea + H, u / 2 + a.W.y), A = Math.max(A, ea + H + W.width), B = Math.max(B, W.height), ea += H + W.width), La++
  33257. }
  33258. H = Ow(this, 2);
  33259. R = Ow(this, 2);
  33260. b ? (H[0].n(0, 0), H[1].n(0, B), R[0].n(A, 0)) : (H[0].n(0, 0), H[1].n(A, 0), R[0].n(0, B));
  33261. R[1].n(A, B)
  33262. } else
  33263. for (m = 0; m < l; m++) {
  33264. n = k[m];
  33265. W = n.tb;
  33266. if (b) {
  33267. 0 < s && 0 < La && ea + u + W.width > s && (ea < h && Pw(a, p, h -
  33268. ea, 0, gb, m - 1), Da++, La = 0, gb = m, P = B, ea = 0, la = 135 < g ? -B - y : B + y);
  33269. Qw(this, n, 0, la);
  33270. var xb = 0;
  33271. if (0 === La) { if (H = n.Ru, R = n.kv, aa = W.width, V = W.height, null === H || null === R || g !== cw(n)) H = Ow(this, 2), R = Ow(this, 2), H[0].n(0, 0), H[1].n(0, V), R[0].n(aa, 0), R[1].n(aa, V) } else {
  33272. var Pb = D.mb(),
  33273. V = Rw(this, a, n, H, R, aa, V, Pb),
  33274. xb = V.x,
  33275. H = Pb[0],
  33276. R = Pb[1],
  33277. aa = V.width,
  33278. V = V.height;
  33279. D.ya(Pb);
  33280. ea < W.width && 0 > xb && (Sw(a, -xb, 0, gb, m - 1), Tw(H, -xb, 0), Tw(R, -xb, 0), xb = 0)
  33281. }
  33282. n.sa.n(xb, la);
  33283. A = Math.max(A, aa);
  33284. B = Math.max(B, P + (0 === Da ? 0 : y) + W.height);
  33285. ea = aa
  33286. } else {
  33287. 0 < s && 0 < La && la + u +
  33288. W.height > s && (la < h && Pw(a, p, 0, h - la, gb, m - 1), Da++, La = 0, gb = m, P = A, la = 0, ea = 135 < g ? -A - y : A + y);
  33289. Qw(this, n, ea, 0);
  33290. xb = 0;
  33291. if (0 === La) { if (H = n.Ru, R = n.kv, aa = W.width, V = W.height, null === H || null === R || g !== cw(n)) H = Ow(this, 2), R = Ow(this, 2), H[0].n(0, 0), H[1].n(aa, 0), R[0].n(0, V), R[1].n(aa, V) } else Pb = D.mb(), V = Rw(this, a, n, H, R, aa, V, Pb), xb = V.x, H = Pb[0], R = Pb[1], aa = V.width, V = V.height, D.ya(Pb), la < W.height && 0 > xb && (Sw(a, 0, -xb, gb, m - 1), Tw(H, 0, -xb), Tw(R, 0, -xb), xb = 0);
  33292. n.sa.n(ea, xb);
  33293. B = Math.max(B, V);
  33294. A = Math.max(A, P + (0 === Da ? 0 : y) + W.width);
  33295. la = V
  33296. }
  33297. La++
  33298. }
  33299. 0 <
  33300. Da && (b ? (B += Math.max(0, c), ea < A && Pw(a, p, A - ea, 0, gb, l - 1), 0 < w && (q || Sw(a, w, 0, 0, l - 1), A += w)) : (A += Math.max(0, c), la < B && Pw(a, p, 0, B - la, gb, l - 1), 0 < w && (q || Sw(a, 0, w, 0, l - 1), B += w)));
  33301. w = q = 0;
  33302. switch (p) {
  33303. case Uw:
  33304. b ? q += A / 2 - a.W.x - t / 2 : w += B / 2 - a.W.y - t / 2;
  33305. break;
  33306. case Tv:
  33307. 0 < Da ? b ? q += A / 2 - a.W.x - t / 2 : w += B / 2 - a.W.y - t / 2 : b ? (Aa = k[0].sa.x + k[0].Wa.x, m = k[l - 1].sa.x + k[l - 1].Wa.x + 2 * k[l - 1].W.x, q += Aa + (m - Aa) / 2 - a.W.x - t / 2) : (Aa = k[0].sa.y + k[0].Wa.y, m = k[l - 1].sa.y + k[l - 1].Wa.y + 2 * k[l - 1].W.y, w += Aa + (m - Aa) / 2 - a.W.y - t / 2);
  33308. break;
  33309. case dw:
  33310. b ? (q -= t, A += t) : (w -= t, B += t);
  33311. break;
  33312. case ew:
  33313. b ? (q += A - a.width + t, A += t) : (w += B - a.height + t, B += t);
  33314. break;
  33315. case Vv:
  33316. b ? q = 1 < l ? q + (Aa + u / 2 - a.W.x) : q + (k[0].W.x - a.W.x + k[0].Wa.x) : w = 1 < l ? w + (Aa + u / 2 - a.W.y) : w + (k[0].W.y - a.W.y + k[0].Wa.y);
  33317. break;
  33318. case Wv:
  33319. b ? q += A + u / 2 - a.W.x : w += B + u / 2 - a.W.y;
  33320. break;
  33321. case Xv:
  33322. break;
  33323. default:
  33324. D.k("Unhandled alignment value " + p.toString())
  33325. }
  33326. for (m = 0; m < l; m++) n = k[m], b ? n.sa.n(n.sa.x + n.Wa.x - q, n.sa.y + (135 < g ? (r ? -B : -n.tb.height) + n.Wa.y - c : e + c + n.Wa.y)) : n.sa.n(n.sa.x + (135 < g ? (r ? -A : -n.tb.width) + n.Wa.x - c : d + c + n.Wa.x), n.sa.y + n.Wa.y - w);
  33327. l = k = 0;
  33328. r ? b ? (A = Vw(a, A, q),
  33329. 0 > q && (q = 0), 135 < g && (w += B + c), B += e + c, p === Xv && (k += u / 2 + a.W.x), l += e + c) : (135 < g && (q += A + c), A += d + c, B = Ww(a, B, w), 0 > w && (w = 0), p === Xv && (l += u / 2 + a.W.y), k += d + c) : b ? (null === a.comments ? d > A && (p = Xw(p, d - A, 0), k = p.x, l = p.y, A = d, q = 0) : A = Vw(a, A, q), 0 > q && (k -= q, q = 0), 135 < g && (w += B + c), B = Math.max(Math.max(B, e), B + e + c), l += e + c) : (135 < g && (q += A + c), A = Math.max(Math.max(A, d), A + d + c), null === a.comments ? e > B && (p = Xw(p, 0, e - B), k = p.x, l = p.y, B = e, w = 0) : B = Ww(a, B, w), 0 > w && (l -= w, w = 0), k += d + c);
  33330. if (0 < Da) g = Ow(this, 4), p = Ow(this, 4), b ? (g[2].n(0, e + c), g[3].n(g[2].x, B),
  33331. p[2].n(A, g[2].y), p[3].n(p[2].x, g[3].y)) : (g[2].n(d + c, 0), g[3].n(A, g[2].y), p[2].n(g[2].x, B), p[3].n(g[3].x, p[2].y));
  33332. else {
  33333. g = Ow(this, H.length + 2);
  33334. p = Ow(this, R.length + 2);
  33335. for (m = 0; m < H.length; m++) r = H[m], g[m + 2].n(r.x + k, r.y + l);
  33336. for (m = 0; m < R.length; m++) r = R[m], p[m + 2].n(r.x + k, r.y + l)
  33337. }
  33338. b ? (g[0].n(q, 0), g[1].n(g[0].x, e), g[2].y < g[1].y && (g[2].x > g[0].x ? g[2].assign(g[1]) : g[1].assign(g[2])), g[3].y < g[2].y && (g[3].x > g[0].x ? g[3].assign(g[2]) : g[2].assign(g[3])), p[0].n(q + d, 0), p[1].n(p[0].x, e), p[2].y < p[1].y && (p[2].x < p[0].x ? p[2].assign(p[1]) :
  33339. p[1].assign(p[2])), p[3].y < p[2].y && (p[3].x < p[0].x ? p[3].assign(p[2]) : p[2].assign(p[3])), g[2].y -= c / 2, p[2].y -= c / 2) : (g[0].n(0, w), g[1].n(d, g[0].y), g[2].x < g[1].x && (g[2].y > g[0].y ? g[2].assign(g[1]) : g[1].assign(g[2])), g[3].x < g[2].x && (g[3].y > g[0].y ? g[3].assign(g[2]) : g[2].assign(g[3])), p[0].n(0, w + e), p[1].n(d, p[0].y), p[2].x < p[1].x && (p[2].y < p[0].y ? p[2].assign(p[1]) : p[1].assign(p[2])), p[3].x < p[2].x && (p[3].y < p[0].y ? p[3].assign(p[2]) : p[2].assign(p[3])), g[2].x -= c / 2, p[2].x -= c / 2);
  33340. Yw(this, H);
  33341. Yw(this, R);
  33342. a.Ru = g;
  33343. a.kv = p;
  33344. a.Wa.n(q, w);
  33345. a.tb.n(A, B)
  33346. }
  33347. break;
  33348. default:
  33349. D.k("Unhandled compaction value " + a.compaction.toString())
  33350. }
  33351. }
  33352. };
  33353. function aw(a, b) {
  33354. v && D.l(b, xv, $, "layoutTreeNone:v");
  33355. if (0 === b.Gn) {
  33356. var c = !1,
  33357. d = 0,
  33358. e = Tv;
  33359. null !== b.parent && (d = b.parent.angle, e = b.parent.alignment, c = Uv(e));
  33360. e = Zv(b);
  33361. b.sa.n(0, 0);
  33362. b.tb.n(b.width, b.height);
  33363. null === b.parent || null === b.comments || (180 !== d && 270 !== d || c) && !e ? b.Wa.n(0, 0) : 180 === d && !c || (90 === d || 270 === d) && e ? b.Wa.n(b.width - 2 * b.W.x, 0) : b.Wa.n(0, b.height - 2 * b.W.y)
  33364. } else {
  33365. for (var c = cw(b), d = 90 === c || 270 === c, g = 0, e = b.children, h = e.length, k = 0; k < h; k++) var l = e[k],
  33366. g = Math.max(g, d ? l.tb.width : l.tb.height);
  33367. var m = b.alignment,
  33368. n =
  33369. m === dw,
  33370. p = m === ew,
  33371. q = Uv(m),
  33372. r = Math.max(0, b.breadthLimit),
  33373. s = fw(b),
  33374. u = b.nodeSpacing,
  33375. t = gw(b),
  33376. y = n || p ? 0 : t / 2,
  33377. w = b.rowSpacing,
  33378. A = 0;
  33379. if (n || p || b.Rq || b.Sq && 1 === b.maxGenerationCount) A = Math.max(0, b.rowIndent);
  33380. var n = b.width,
  33381. B = b.height,
  33382. P = 0,
  33383. H = 0,
  33384. R = 0,
  33385. aa = 0,
  33386. V = 0,
  33387. ea = 0,
  33388. la = 0,
  33389. Da = 0,
  33390. La = 0,
  33391. gb = 0;
  33392. q && !Yv(m) && 135 < c && e.reverse();
  33393. if (Yv(m))
  33394. if (1 < h)
  33395. for (k = 0; k < h; k++) {
  33396. var l = e[k],
  33397. Aa = l.tb;
  33398. 0 === k % 2 && k !== h - 1 ? La = Math.max(La, (d ? Aa.width : Aa.height) + Zw(l) - u) : 0 !== k % 2 && (gb = Math.max(gb, (d ? Aa.width : Aa.height) + Zw(l) - u))
  33399. } else 1 === h && (La = d ? e[0].tb.width : e[0].tb.height);
  33400. if (q) switch (m) {
  33401. case Vv:
  33402. case Kv:
  33403. H = 135 > c ? hw(b, e, La, P, H) : iw(b, e, La, P, H);
  33404. La = H.x;
  33405. P = H.width;
  33406. H = H.height;
  33407. break;
  33408. case Wv:
  33409. for (k = 0; k < h; k++) l = e[k], Aa = l.tb, r = 0 === la ? 0 : w, d ? (l.sa.n(g - Aa.width, V + r), P = Math.max(P, Aa.width), H = Math.max(H, V + r + Aa.height), V += r + Aa.height) : (l.sa.n(aa + r, g - Aa.height), P = Math.max(P, aa + r + Aa.width), H = Math.max(H, Aa.height), aa += r + Aa.width), la++;
  33410. break;
  33411. case Xv:
  33412. for (g = 0; g < h; g++) l = e[g], Aa = l.tb, r = 0 === la ? 0 : w, d ? (l.sa.n(u / 2 + b.W.x, V + r), P = Math.max(P, Aa.width), H = Math.max(H, V + r + Aa.height), V += r + Aa.height) : (l.sa.n(aa +
  33413. r, u / 2 + b.W.y), P = Math.max(P, aa + r + Aa.width), H = Math.max(H, Aa.height), aa += r + Aa.width), la++
  33414. } else
  33415. for (k = 0; k < h; k++) l = e[k], Aa = l.tb, d ? (0 < r && 0 < la && aa + u + Aa.width > r && (aa < g && Pw(b, m, g - aa, 0, Da, k - 1), ea++, la = 0, Da = k, R = H, aa = 0, V = 135 < c ? -H - w : H + w), gb = 0 === la ? y : u, Qw(a, l, 0, V), l.sa.n(aa + gb, V), P = Math.max(P, aa + gb + Aa.width), H = Math.max(H, R + (0 === ea ? 0 : w) + Aa.height), aa += gb + Aa.width) : (0 < r && 0 < la && V + u + Aa.height > r && (V < g && Pw(b, m, 0, g - V, Da, k - 1), ea++, la = 0, Da = k, R = P, V = 0, aa = 135 < c ? -P - w : P + w), gb = 0 === la ? y : u, Qw(a, l, aa, 0), l.sa.n(aa, V + gb), H = Math.max(H,
  33416. V + gb + Aa.height), P = Math.max(P, R + (0 === ea ? 0 : w) + Aa.width), V += gb + Aa.height), la++;
  33417. 0 < ea && (d ? (H += Math.max(0, s), aa < P && Pw(b, m, P - aa, 0, Da, h - 1), 0 < A && (p || Sw(b, A, 0, 0, h - 1), P += A)) : (P += Math.max(0, s), V < H && Pw(b, m, 0, H - V, Da, h - 1), 0 < A && (p || Sw(b, 0, A, 0, h - 1), H += A)));
  33418. A = p = 0;
  33419. switch (m) {
  33420. case Uw:
  33421. d ? p += P / 2 - b.W.x - t / 2 : A += H / 2 - b.W.y - t / 2;
  33422. break;
  33423. case Tv:
  33424. 0 < ea ? d ? p += P / 2 - b.W.x - t / 2 : A += H / 2 - b.W.y - t / 2 : d ? (m = e[0].sa.x + e[0].Wa.x, u = e[h - 1].sa.x + e[h - 1].Wa.x + 2 * e[h - 1].W.x, p += m + (u - m) / 2 - b.W.x - t / 2) : (m = e[0].sa.y + e[0].Wa.y, u = e[h - 1].sa.y + e[h - 1].Wa.y + 2 * e[h - 1].W.y,
  33425. A += m + (u - m) / 2 - b.W.y - t / 2);
  33426. break;
  33427. case dw:
  33428. d ? (p -= t, P += t) : (A -= t, H += t);
  33429. break;
  33430. case ew:
  33431. d ? (p += P - b.width + t, P += t) : (A += H - b.height + t, H += t);
  33432. break;
  33433. case Vv:
  33434. case Kv:
  33435. d ? p = 1 < h ? p + (La + u / 2 - b.W.x) : p + (e[0].W.x - b.W.x + e[0].Wa.x) : A = 1 < h ? A + (La + u / 2 - b.W.y) : A + (e[0].W.y - b.W.y + e[0].Wa.y);
  33436. break;
  33437. case Wv:
  33438. d ? p += P + u / 2 - b.W.x : A += H + u / 2 - b.W.y;
  33439. break;
  33440. case Xv:
  33441. break;
  33442. default:
  33443. D.k("Unhandled alignment value " + m.toString())
  33444. }
  33445. for (k = 0; k < h; k++) l = e[k], d ? l.sa.n(l.sa.x + l.Wa.x - p, l.sa.y + (135 < c ? (q ? -H : -l.tb.height) + l.Wa.y - s : B + s + l.Wa.y)) : l.sa.n(l.sa.x + (135 < c ? (q ?
  33446. -P : -l.tb.width) + l.Wa.x - s : n + s + l.Wa.x), l.sa.y + l.Wa.y - A);
  33447. d ? (P = Vw(b, P, p), 0 > p && (p = 0), 135 < c && (A += H + s), H += B + s) : (135 < c && (p += P + s), P += n + s, H = Ww(b, H, A), 0 > A && (A = 0));
  33448. b.Wa.n(p, A);
  33449. b.tb.n(P, H)
  33450. }
  33451. }
  33452. function hw(a, b, c, d, e) {
  33453. v && D.l(a, xv, $, "layoutBusChildrenPosDir:v");
  33454. var g = b.length;
  33455. if (0 === g) return new C(c, 0, d, e);
  33456. if (1 === g) {
  33457. var h = b[0];
  33458. d = h.tb.width;
  33459. e = h.tb.height;
  33460. return new C(c, 0, d, e)
  33461. }
  33462. for (var k = a.nodeSpacing, l = a.rowSpacing, m = 90 === cw(a), n = 0, p = 0, q = 0, r = 0; r < g; r++)
  33463. if (!(0 !== r % 2 || 1 < g && r === g - 1)) {
  33464. var h = b[r],
  33465. s = h.tb,
  33466. u = 0 === n ? 0 : l;
  33467. if (m) {
  33468. var t = Zw(h) - k;
  33469. h.sa.n(c - (s.width + t), q + u);
  33470. d = Math.max(d, s.width + t);
  33471. e = Math.max(e, q + u + s.height);
  33472. q += u + s.height
  33473. } else t = Zw(h) - k, h.sa.n(p + u, c - (s.height + t)), e = Math.max(e, s.height + t), d = Math.max(d,
  33474. p + u + s.width), p += u + s.width;
  33475. n++
  33476. }
  33477. var n = 0,
  33478. y = p,
  33479. w = q;
  33480. m ? (p = c + k, q = 0) : (p = 0, q = c + k);
  33481. for (r = 0; r < g; r++) 0 !== r % 2 && (h = b[r], s = h.tb, u = 0 === n ? 0 : l, m ? (t = Zw(h) - k, h.sa.n(p + t, q + u), d = Math.max(d, p + s.width + t), e = Math.max(e, q + u + s.height), q += u + s.height) : (t = Zw(h) - k, h.sa.n(p + u, q + t), d = Math.max(d, p + u + s.width), e = Math.max(e, q + s.height + t), p += u + s.width), n++);
  33482. 1 < g && 1 === g % 2 && (h = b[g - 1], s = h.tb, b = $w(h, m ? Math.max(Math.abs(w), Math.abs(q)) : Math.max(Math.abs(y), Math.abs(p))), m ? (h.sa.n(c + k / 2 - h.W.x - h.Wa.x, e + b), m = c + k / 2 - h.W.x - h.Wa.x, d = Math.max(d, m + s.width),
  33483. 0 > m && (d -= m), e = Math.max(e, Math.max(w, q) + b + s.height), 0 > h.sa.x && (c = ax(a, h.sa.x, !1, c, k))) : (h.sa.n(d + b, c + k / 2 - h.W.y - h.Wa.y), d = Math.max(d, Math.max(y, p) + b + s.width), m = c + k / 2 - h.W.y - h.Wa.y, e = Math.max(e, m + s.height), 0 > m && (e -= m), 0 > h.sa.y && (c = ax(a, h.sa.y, !0, c, k))));
  33484. return new C(c, 0, d, e)
  33485. }
  33486. function iw(a, b, c, d, e) {
  33487. v && D.l(a, xv, $, "layoutBusChildrenNegDir:v");
  33488. var g = b.length;
  33489. if (0 === g) return new C(c, 0, d, e);
  33490. if (1 === g) {
  33491. var h = b[0];
  33492. d = h.tb.width;
  33493. e = h.tb.height;
  33494. return new C(c, 0, d, e)
  33495. }
  33496. for (var k = a.nodeSpacing, l = a.rowSpacing, m = 270 === cw(a), n = 0, p = 0, q = 0, r = 0; r < g; r++)
  33497. if (!(0 !== r % 2 || 1 < g && r === g - 1)) {
  33498. var h = b[r],
  33499. s = h.tb,
  33500. u = 0 === n ? 0 : l;
  33501. if (m) {
  33502. var t = Zw(h) - k,
  33503. q = q - (u + s.height);
  33504. h.sa.n(c - (s.width + t), q);
  33505. d = Math.max(d, s.width + t);
  33506. e = Math.max(e, Math.abs(q))
  33507. } else t = Zw(h) - k, p -= u + s.width, h.sa.n(p, c - (s.height + t)), e = Math.max(e, s.height +
  33508. t), d = Math.max(d, Math.abs(p));
  33509. n++
  33510. }
  33511. var n = 0,
  33512. y = p,
  33513. w = q;
  33514. m ? (p = c + k, q = 0) : (p = 0, q = c + k);
  33515. for (r = 0; r < g; r++) 0 !== r % 2 && (h = b[r], s = h.tb, u = 0 === n ? 0 : l, m ? (t = Zw(h) - k, q -= u + s.height, h.sa.n(p + t, q), d = Math.max(d, p + s.width + t), e = Math.max(e, Math.abs(q))) : (t = Zw(h) - k, p -= u + s.width, h.sa.n(p, q + t), e = Math.max(e, q + s.height + t), d = Math.max(d, Math.abs(p))), n++);
  33516. 1 < g && 1 === g % 2 && (h = b[g - 1], s = h.tb, l = $w(h, m ? Math.max(Math.abs(w), Math.abs(q)) : Math.max(Math.abs(y), Math.abs(p))), m ? (h.sa.n(c + k / 2 - h.W.x - h.Wa.x, -e - s.height - l), p = c + k / 2 - h.W.x - h.Wa.x, d = Math.max(d,
  33517. p + s.width), 0 > p && (d -= p), e = Math.max(e, Math.abs(Math.min(w, q)) + l + s.height), 0 > h.sa.x && (c = ax(a, h.sa.x, !1, c, k))) : (h.sa.n(-d - s.width - l, c + k / 2 - h.W.y - h.Wa.y), d = Math.max(d, Math.abs(Math.min(y, p)) + l + s.width), p = c + k / 2 - h.W.y - h.Wa.y, e = Math.max(e, p + s.height), 0 > p && (e -= p), 0 > h.sa.y && (c = ax(a, h.sa.y, !0, c, k))));
  33518. for (r = 0; r < g; r++) h = b[r], m ? h.sa.n(h.sa.x, h.sa.y + e) : h.sa.n(h.sa.x + d, h.sa.y);
  33519. return new C(c, 0, d, e)
  33520. }
  33521. function Zw(a) { v && D.l(a, xv, $, "fixRelativePostions:child"); return null === a.parent ? 0 : a.parent.nodeSpacing }
  33522. function $w(a) { v && D.l(a, xv, $, "fixRelativePostions:lastchild"); return null === a.parent ? 0 : a.parent.rowSpacing }
  33523. function ax(a, b, c, d, e) {
  33524. v && D.l(a, xv, $, "fixRelativePostions:v");
  33525. a = a.children;
  33526. for (var g = a.length, h = 0; h < g; h++) c ? a[h].sa.n(a[h].sa.x, a[h].sa.y - b) : a[h].sa.n(a[h].sa.x - b, a[h].sa.y);
  33527. b = a[g - 1];
  33528. return Math.max(d, c ? b.Wa.y + b.W.y - e / 2 : b.Wa.x + b.W.x - e / 2)
  33529. }
  33530. function Vw(a, b, c) {
  33531. v && D.l(a, xv, $, "calculateSubwidth:v");
  33532. switch (a.alignment) {
  33533. case Tv:
  33534. case Uw:
  33535. var d = b;
  33536. c + a.width > d && (d = c + a.width);
  33537. 0 > c && (d -= c);
  33538. return d;
  33539. case dw:
  33540. return a.width > b ? a.width : b;
  33541. case ew:
  33542. return 2 * a.W.x > b ? a.width : b + a.width - 2 * a.W.x;
  33543. case Vv:
  33544. case Kv:
  33545. return d = Math.min(0, c), c = Math.max(b, c + a.width), Math.max(a.width, c - d);
  33546. case Wv:
  33547. return a.width - a.W.x + a.nodeSpacing / 2 + b;
  33548. case Xv:
  33549. return Math.max(a.width, a.W.x + a.nodeSpacing / 2 + b);
  33550. default:
  33551. return b
  33552. }
  33553. }
  33554. function Ww(a, b, c) {
  33555. v && D.l(a, xv, $, "calculateSubheight:v");
  33556. switch (a.alignment) {
  33557. case Tv:
  33558. case Uw:
  33559. var d = b;
  33560. c + a.height > d && (d = c + a.height);
  33561. 0 > c && (d -= c);
  33562. return d;
  33563. case dw:
  33564. return a.height > b ? a.height : b;
  33565. case ew:
  33566. return 2 * a.W.y > b ? a.height : b + a.height - 2 * a.W.y;
  33567. case Vv:
  33568. case Kv:
  33569. return d = Math.min(0, c), c = Math.max(b, c + a.height), Math.max(a.height, c - d);
  33570. case Wv:
  33571. return a.height - a.W.y + a.nodeSpacing / 2 + b;
  33572. case Xv:
  33573. return Math.max(a.height, a.W.y + a.nodeSpacing / 2 + b);
  33574. default:
  33575. return b
  33576. }
  33577. }
  33578. function Xw(a, b, c) {
  33579. v && D.l(a, ya, $, "alignOffset:align");
  33580. switch (a) {
  33581. case Uw:
  33582. b /= 2;
  33583. c /= 2;
  33584. break;
  33585. case Tv:
  33586. b /= 2;
  33587. c /= 2;
  33588. break;
  33589. case dw:
  33590. c = b = 0;
  33591. break;
  33592. case ew:
  33593. break;
  33594. default:
  33595. D.k("Unhandled alignment value " + a.toString())
  33596. }
  33597. return new N(b, c)
  33598. }
  33599. function Pw(a, b, c, d, e, g) {
  33600. v && D.l(a, xv, $, "shiftRelPosAlign:v");
  33601. v && D.l(b, ya, $, "shiftRelPosAlign:align");
  33602. b = Xw(b, c, d);
  33603. Sw(a, b.x, b.y, e, g)
  33604. }
  33605. function Sw(a, b, c, d, e) {
  33606. v && D.l(a, xv, $, "shiftRelPos:v");
  33607. if (0 !== b || 0 !== c)
  33608. for (a = a.children; d <= e; d++) {
  33609. var g = a[d].sa;
  33610. g.x += b;
  33611. g.y += c
  33612. }
  33613. }
  33614. function Qw(a, b, c, d) {
  33615. v && (D.l(b, xv, $, "recordMidPoints:v"), D.h(c, "number", $, "recordMidPoints:x"), D.h(d, "number", $, "recordMidPoints:y"));
  33616. var e = b.parent;
  33617. switch (a.Wf) {
  33618. case tv:
  33619. for (a = b.wc; a.next();) b = a.value, b.fromVertex === e && b.nt.n(c, d);
  33620. break;
  33621. case Av:
  33622. for (a = b.tc; a.next();) b = a.value, b.toVertex === e && b.nt.n(c, d);
  33623. break;
  33624. default:
  33625. D.k("Unhandled path value " + a.Wf.toString())
  33626. }
  33627. }
  33628. function Tw(a, b, c) {
  33629. for (var d = 0; d < a.length; d++) {
  33630. var e = a[d];
  33631. e.x += b;
  33632. e.y += c
  33633. }
  33634. }
  33635. function Rw(a, b, c, d, e, g, h, k) {
  33636. v && D.l(b, xv, $, "mergeFringes:parent");
  33637. v && D.l(c, xv, $, "mergeFringes:child");
  33638. var l = cw(b),
  33639. m = 90 === l || 270 === l,
  33640. n = b.nodeSpacing;
  33641. b = d;
  33642. var p = e;
  33643. d = g;
  33644. e = h;
  33645. var q = c.Ru,
  33646. r = c.kv;
  33647. h = c.tb;
  33648. var s = m ? Math.max(e, h.height) : Math.max(d, h.width);
  33649. if (null === q || l !== cw(c)) q = Ow(a, 2), r = Ow(a, 2), m ? (q[0].n(0, 0), q[1].n(0, h.height), r[0].n(h.width, 0), r[1].n(r[0].x, q[1].y)) : (q[0].n(0, 0), q[1].n(h.width, 0), r[0].n(0, h.height), r[1].n(q[1].x, r[0].y));
  33650. if (m) {
  33651. c = d;
  33652. d = 9999999;
  33653. if (!(null === p || 2 > p.length || null === q || 2 > q.length))
  33654. for (m =
  33655. l = 0; l < p.length && m < q.length;) {
  33656. e = p[l];
  33657. var u = q[m];
  33658. g = u.x;
  33659. var t = u.y;
  33660. g += c;
  33661. var y = e;
  33662. l + 1 < p.length && (y = p[l + 1]);
  33663. var w = u,
  33664. u = w.x,
  33665. w = w.y;
  33666. m + 1 < q.length && (w = q[m + 1], u = w.x, w = w.y, u += c);
  33667. var A = d;
  33668. e.y === t ? A = g - e.x : e.y > t && e.y < w ? A = g + (e.y - t) / (w - t) * (u - g) - e.x : t > e.y && t < y.y && (A = g - (e.x + (t - e.y) / (y.y - e.y) * (y.x - e.x)));
  33669. A < d && (d = A);
  33670. y.y <= e.y ? l++ : w <= t ? m++ : (y.y <= w && l++, w <= y.y && m++)
  33671. }
  33672. c -= d;
  33673. c += n;
  33674. l = q;
  33675. m = c;
  33676. if (null === b || 2 > b.length || null === l || 2 > l.length) d = null;
  33677. else {
  33678. n = Ow(a, b.length + l.length);
  33679. for (d = g = e = 0; g < l.length && l[g].y < b[0].y;) t = l[g++], n[d++].n(t.x +
  33680. m, t.y);
  33681. for (; e < b.length;) t = b[e++], n[d++].n(t.x, t.y);
  33682. for (e = b[b.length - 1].y; g < l.length && l[g].y <= e;) g++;
  33683. for (; g < l.length && l[g].y > e;) t = l[g++], n[d++].n(t.x + m, t.y);
  33684. l = Ow(a, d);
  33685. for (e = 0; e < d; e++) l[e].assign(n[e]);
  33686. Yw(a, n);
  33687. d = l
  33688. }
  33689. g = r;
  33690. t = c;
  33691. if (null === p || 2 > p.length || null === g || 2 > g.length) e = null;
  33692. else {
  33693. n = Ow(a, p.length + g.length);
  33694. for (m = y = l = 0; l < p.length && p[l].y < g[0].y;) e = p[l++], n[m++].n(e.x, e.y);
  33695. for (; y < g.length;) e = g[y++], n[m++].n(e.x + t, e.y);
  33696. for (g = g[g.length - 1].y; l < p.length && p[l].y <= g;) l++;
  33697. for (; l < p.length && p[l].y > g;) e = p[l++],
  33698. n[m++].n(e.x, e.y);
  33699. e = Ow(a, m);
  33700. for (l = 0; l < m; l++) e[l].assign(n[l]);
  33701. Yw(a, n)
  33702. }
  33703. g = Math.max(0, c) + h.width;
  33704. h = s
  33705. } else {
  33706. c = e;
  33707. d = 9999999;
  33708. if (!(null === p || 2 > p.length || null === q || 2 > q.length))
  33709. for (m = l = 0; l < p.length && m < q.length;) e = p[l], u = q[m], g = u.x, t = u.y, t += c, y = e, l + 1 < p.length && (y = p[l + 1]), w = u, u = w.x, w = w.y, m + 1 < q.length && (w = q[m + 1], u = w.x, w = w.y, w += c), A = d, e.x === g ? A = t - e.y : e.x > g && e.x < u ? A = t + (e.x - g) / (u - g) * (w - t) - e.y : g > e.x && g < y.x && (A = t - (e.y + (g - e.x) / (y.x - e.x) * (y.y - e.y))), A < d && (d = A), y.x <= e.x ? l++ : u <= g ? m++ : (y.x <= u && l++, u <= y.x && m++);
  33710. c -= d;
  33711. c += n;
  33712. l = q;
  33713. m = c;
  33714. if (null === b || 2 > b.length || null === l || 2 > l.length) d = null;
  33715. else {
  33716. n = Ow(a, b.length + l.length);
  33717. for (d = g = e = 0; g < l.length && l[g].x < b[0].x;) t = l[g++], n[d++].n(t.x, t.y + m);
  33718. for (; e < b.length;) t = b[e++], n[d++].n(t.x, t.y);
  33719. for (e = b[b.length - 1].x; g < l.length && l[g].x <= e;) g++;
  33720. for (; g < l.length && l[g].x > e;) t = l[g++], n[d++].n(t.x, t.y + m);
  33721. l = Ow(a, d);
  33722. for (e = 0; e < d; e++) l[e].assign(n[e]);
  33723. Yw(a, n);
  33724. d = l
  33725. }
  33726. g = r;
  33727. t = c;
  33728. if (null === p || 2 > p.length || null === g || 2 > g.length) e = null;
  33729. else {
  33730. n = Ow(a, p.length + g.length);
  33731. for (m = y = l = 0; l < p.length && p[l].x < g[0].x;) e = p[l++],
  33732. n[m++].n(e.x, e.y);
  33733. for (; y < g.length;) e = g[y++], n[m++].n(e.x, e.y + t);
  33734. for (g = g[g.length - 1].x; l < p.length && p[l].x <= g;) l++;
  33735. for (; l < p.length && p[l].x > g;) e = p[l++], n[m++].n(e.x, e.y);
  33736. e = Ow(a, m);
  33737. for (l = 0; l < m; l++) e[l].assign(n[l]);
  33738. Yw(a, n)
  33739. }
  33740. g = s;
  33741. h = Math.max(0, c) + h.height
  33742. }
  33743. Yw(a, b);
  33744. Yw(a, q);
  33745. Yw(a, p);
  33746. Yw(a, r);
  33747. k[0] = d;
  33748. k[1] = e;
  33749. return new C(c, 0, g, h)
  33750. }
  33751. function Ow(a, b) { var c = a.sA[b]; if (void 0 !== c && (c = c.pop(), void 0 !== c)) return c; for (var c = [], d = 0; d < b; d++) c[d] = new N; return c }
  33752. function Yw(a, b) {
  33753. var c = b.length,
  33754. d = a.sA[c];
  33755. void 0 === d && (d = [], a.sA[c] = d);
  33756. d.push(b)
  33757. }
  33758. $.prototype.arrangeTrees = function() {
  33759. if (this.Bd === zv)
  33760. for (var a = this.Jd.j; a.next();) {
  33761. var b = a.value;
  33762. if (b instanceof xv) {
  33763. var c = b.Zc;
  33764. if (null !== c) {
  33765. var d = c.position,
  33766. c = d.x,
  33767. d = d.y;
  33768. isFinite(c) || (c = 0);
  33769. isFinite(d) || (d = 0);
  33770. bx(this, b, c, d)
  33771. }
  33772. }
  33773. } else {
  33774. c = [];
  33775. for (a = this.Jd.j; a.next();) b = a.value, b instanceof xv && c.push(b);
  33776. switch (this.sorting) {
  33777. case Pv:
  33778. break;
  33779. case Qv:
  33780. c.reverse();
  33781. break;
  33782. case Rv:
  33783. c.sort(this.comparer);
  33784. break;
  33785. case Sv:
  33786. c.sort(this.comparer);
  33787. c.reverse();
  33788. break;
  33789. default:
  33790. D.k("Unhandled sorting value " + this.sorting.toString())
  33791. }
  33792. b =
  33793. this.Zd;
  33794. a = b.x;
  33795. b = b.y;
  33796. for (d = 0; d < c.length; d++) {
  33797. var e = c[d];
  33798. bx(this, e, a + e.Wa.x, b + e.Wa.y);
  33799. switch (this.Bd) {
  33800. case wv:
  33801. b += e.tb.height + this.xg.height;
  33802. break;
  33803. case cx:
  33804. a += e.tb.width + this.xg.width;
  33805. break;
  33806. default:
  33807. D.k("Unhandled arrangement value " + this.Bd.toString())
  33808. }
  33809. }
  33810. }
  33811. };
  33812. function bx(a, b, c, d) {
  33813. if (null !== b) {
  33814. v && D.l(b, xv, $, "assignAbsolutePositions:v");
  33815. b.x = c;
  33816. b.y = d;
  33817. b = b.children;
  33818. for (var e = b.length, g = 0; g < e; g++) {
  33819. var h = b[g];
  33820. bx(a, h, c + h.sa.x, d + h.sa.y)
  33821. }
  33822. }
  33823. }
  33824. $.prototype.commitLayout = function() {
  33825. this.aC();
  33826. this.commitNodes();
  33827. this.JA();
  33828. this.Pu && this.commitLinks()
  33829. };
  33830. $.prototype.commitNodes = function() { for (var a = this.network.vertexes.j; a.next();) a.value.commit(); for (a.reset(); a.next();) this.layoutComments(a.value) };
  33831. $.prototype.JA = function() {
  33832. if (this.vB === Hv) {
  33833. for (var a = this.IC, b = [], c = null, d = this.network.vertexes.j; d.next();) {
  33834. var e = d.value;
  33835. null === c ? c = e.pb.copy() : c.Zh(e.pb);
  33836. var g = b[e.level],
  33837. g = void 0 === g ? fw(e) : Math.max(g, fw(e));
  33838. b[e.level] = g
  33839. }
  33840. for (d = 0; d < b.length; d++) void 0 === b[d] && (b[d] = 0);
  33841. 90 === this.angle || 270 === this.angle ? (c.ig(this.nodeSpacing / 2, this.layerSpacing), e = new N(-this.nodeSpacing / 2, -this.layerSpacing / 2)) : (c.ig(this.layerSpacing, this.nodeSpacing / 2), e = new N(-this.layerSpacing / 2, -this.nodeSpacing / 2));
  33842. var g = [],
  33843. c = 90 === this.angle || 270 === this.angle ? c.width : c.height,
  33844. h = 0;
  33845. if (180 === this.angle || 270 === this.angle)
  33846. for (d = 0; d < a.length; d++) h += a[d] + b[d];
  33847. for (d = 0; d < a.length; d++) {
  33848. var k = a[d] + b[d];
  33849. 270 === this.angle ? (h -= k, g.push(new C(0, h, c, k))) : 90 === this.angle ? (g.push(new C(0, h, c, k)), h += k) : 180 === this.angle ? (h -= k, g.push(new C(h, 0, k, c))) : (g.push(new C(h, 0, k, c)), h += k)
  33850. }
  33851. this.commitLayers(g, e)
  33852. }
  33853. };
  33854. $.prototype.commitLayers = function() {};
  33855. $.prototype.commitLinks = function() { for (var a = this.network.edges.j; a.next();) a.value.commit() };
  33856. $.prototype.aC = function() {
  33857. for (var a = this.Jd.j; a.next();) {
  33858. var b = a.value;
  33859. b instanceof xv && dx(this, b)
  33860. }
  33861. };
  33862. function dx(a, b) {
  33863. if (null !== b) {
  33864. v && D.l(b, xv, $, "setPortSpotsTree:v");
  33865. a.setPortSpots(b);
  33866. for (var c = b.children, d = c.length, e = 0; e < d; e++) dx(a, c[e])
  33867. }
  33868. }
  33869. $.prototype.setPortSpots = function(a) {
  33870. v && D.l(a, xv, $, "setPortSpots:v");
  33871. var b = a.alignment;
  33872. if (Uv(b)) {
  33873. v && D.l(a, xv, $, "setPortSpotsBus:v");
  33874. v && D.l(b, ya, $, "setPortSpots:align");
  33875. var c = this.Wf === tv,
  33876. d = cw(a),
  33877. e;
  33878. switch (d) {
  33879. case 0:
  33880. e = fd;
  33881. break;
  33882. case 90:
  33883. e = gd;
  33884. break;
  33885. case 180:
  33886. e = ed;
  33887. break;
  33888. default:
  33889. e = $c
  33890. }
  33891. var g = a.children,
  33892. h = g.length;
  33893. switch (b) {
  33894. case Vv:
  33895. case Kv:
  33896. for (b = 0; b < h; b++) {
  33897. var k = g[b],
  33898. k = (c ? k.wc : k.tc).first();
  33899. if (null !== k && (k = k.link, null !== k)) {
  33900. var l = 90 === d || 270 === d ? ed : $c;
  33901. if (1 === h || b === h - 1 && 1 === h % 2) switch (d) {
  33902. case 0:
  33903. l = ed;
  33904. break;
  33905. case 90:
  33906. l =
  33907. $c;
  33908. break;
  33909. case 180:
  33910. l = fd;
  33911. break;
  33912. default:
  33913. l = gd
  33914. } else 0 === b % 2 && (l = 90 === d || 270 === d ? fd : gd);
  33915. c ? (a.setsPortSpot && (k.Gb = e), a.setsChildPortSpot && (k.Hb = l)) : (a.setsPortSpot && (k.Gb = l), a.setsChildPortSpot && (k.Hb = e))
  33916. }
  33917. }
  33918. break;
  33919. case Wv:
  33920. l = 90 === d || 270 === d ? fd : gd;
  33921. for (d = c ? a.tc : a.wc; d.next();) k = d.value.link, null !== k && (c ? (a.setsPortSpot && (k.Gb = e), a.setsChildPortSpot && (k.Hb = l)) : (a.setsPortSpot && (k.Gb = l), a.setsChildPortSpot && (k.Hb = e)));
  33922. break;
  33923. case Xv:
  33924. for (l = 90 === d || 270 === d ? ed : $c, d = c ? a.tc : a.wc; d.next();) k = d.value.link, null !== k && (c ?
  33925. (a.setsPortSpot && (k.Gb = e), a.setsChildPortSpot && (k.Hb = l)) : (a.setsPortSpot && (k.Gb = l), a.setsChildPortSpot && (k.Hb = e)))
  33926. }
  33927. } else if (c = cw(a), this.Wf === tv)
  33928. for (e = a.tc; e.next();) {
  33929. if (d = e.value.link, null !== d) {
  33930. if (a.setsPortSpot)
  33931. if (a.portSpot.ld()) switch (c) {
  33932. case 0:
  33933. d.Gb = fd;
  33934. break;
  33935. case 90:
  33936. d.Gb = gd;
  33937. break;
  33938. case 180:
  33939. d.Gb = ed;
  33940. break;
  33941. default:
  33942. d.Gb = $c
  33943. } else d.Gb = a.portSpot;
  33944. if (a.setsChildPortSpot)
  33945. if (a.childPortSpot.ld()) switch (c) {
  33946. case 0:
  33947. d.Hb = ed;
  33948. break;
  33949. case 90:
  33950. d.Hb = $c;
  33951. break;
  33952. case 180:
  33953. d.Hb = fd;
  33954. break;
  33955. default:
  33956. d.Hb = gd
  33957. } else d.Hb = a.childPortSpot
  33958. }
  33959. } else
  33960. for (e =
  33961. a.wc; e.next();)
  33962. if (d = e.value.link, null !== d) {
  33963. if (a.setsPortSpot)
  33964. if (a.portSpot.ld()) switch (c) {
  33965. case 0:
  33966. d.Hb = fd;
  33967. break;
  33968. case 90:
  33969. d.Hb = gd;
  33970. break;
  33971. case 180:
  33972. d.Hb = ed;
  33973. break;
  33974. default:
  33975. d.Hb = $c
  33976. } else d.Hb = a.portSpot;
  33977. if (a.setsChildPortSpot)
  33978. if (a.childPortSpot.ld()) switch (c) {
  33979. case 0:
  33980. d.Gb = ed;
  33981. break;
  33982. case 90:
  33983. d.Gb = $c;
  33984. break;
  33985. case 180:
  33986. d.Gb = fd;
  33987. break;
  33988. default:
  33989. d.Gb = gd
  33990. } else d.Gb = a.childPortSpot
  33991. }
  33992. };
  33993. function cw(a) { a = a.angle; return 45 >= a ? 0 : 135 >= a ? 90 : 225 >= a ? 180 : 315 >= a ? 270 : 0 }
  33994. function fw(a) {
  33995. v && D.l(a, xv, $, "computeLayerSpacing:v");
  33996. var b = cw(a),
  33997. b = 90 === b || 270 === b,
  33998. c = a.layerSpacing;
  33999. if (0 < a.layerSpacingParentOverlap) var d = Math.min(1, a.layerSpacingParentOverlap),
  34000. c = c - (b ? a.height * d : a.width * d);
  34001. c < (b ? -a.height : -a.width) && (c = b ? -a.height : -a.width);
  34002. return c
  34003. }
  34004. function gw(a) {
  34005. v && D.l(a, xv, $, "computeNodeIndent:v");
  34006. var b = cw(a),
  34007. b = 90 === b || 270 === b,
  34008. c = a.nodeIndent;
  34009. if (0 < a.nodeIndentPastParent) var d = Math.min(1, a.nodeIndentPastParent),
  34010. c = c + (b ? a.width * d : a.height * d);
  34011. return c = Math.max(0, c)
  34012. }
  34013. D.defineProperty($, { DM: "roots" }, function() { return this.Jd }, function(a) { this.Jd !== a && (D.l(a, L, $, "roots"), this.Jd = a, this.L()) });
  34014. D.defineProperty($, { path: "path" }, function() { return this.gt }, function(a) { this.gt !== a && (D.Da(a, $, $, "path"), this.gt = a, this.L()) });
  34015. D.defineProperty($, { HK: "treeStyle" }, function() { return this.Wt }, function(a) { this.Bd !== a && (D.Da(a, $, $, "treeStyle"), a === uv || a === Nv || a === Ov || a === Mv) && (this.Wt = a, this.L()) });
  34016. D.defineProperty($, { vB: "layerStyle" }, function() { return this.yw }, function(a) { this.Bd !== a && (D.Da(a, $, $, "layerStyle"), a === vv || a === Iv || a === Hv) && (this.yw = a, this.L()) });
  34017. D.defineProperty($, { comments: "comments" }, function() { return this.bi }, function(a) { this.bi !== a && (D.h(a, "boolean", $, "comments"), this.bi = a, this.L()) });
  34018. D.defineProperty($, { eg: "arrangement" }, function() { return this.Bd }, function(a) { this.Bd !== a && (D.Da(a, $, $, "arrangement"), a === wv || a === cx || a === zv) && (this.Bd = a, this.L()) });
  34019. D.defineProperty($, { bF: "arrangementSpacing" }, function() { return this.xg }, function(a) {
  34020. D.l(a, Ca, $, "arrangementSpacing");
  34021. this.xg.O(a) || (this.xg.assign(a), this.L())
  34022. });
  34023. D.defineProperty($, { CM: "rootDefaults" }, function() { return this.Aa }, function(a) { this.Aa !== a && (D.l(a, xv, $, "rootDefaults"), this.Aa = a, this.L()) });
  34024. D.defineProperty($, { $K: "alternateDefaults" }, function() { return this.Ba }, function(a) { this.Ba !== a && (D.l(a, xv, $, "alternateDefaults"), this.Ba = a, this.L()) });
  34025. D.defineProperty($, { sorting: "sorting" }, function() { return this.Aa.sorting }, function(a) { this.Aa.sorting !== a && (D.Da(a, $, $, "sorting"), a === Pv || a === Qv || a === Rv || Sv) && (this.Aa.sorting = a, this.L()) });
  34026. D.defineProperty($, { comparer: "comparer" }, function() { return this.Aa.comparer }, function(a) { this.Aa.comparer !== a && (D.h(a, "function", $, "comparer"), this.Aa.comparer = a, this.L()) });
  34027. D.defineProperty($, { angle: "angle" }, function() { return this.Aa.angle }, function(a) { this.Aa.angle !== a && (D.h(a, "number", $, "angle"), 0 === a || 90 === a || 180 === a || 270 === a ? (this.Aa.angle = a, this.L()) : D.k("TreeLayout.angle must be 0, 90, 180, or 270")) });
  34028. D.defineProperty($, { alignment: "alignment" }, function() { return this.Aa.alignment }, function(a) { this.Aa.alignment !== a && (D.Da(a, $, $, "alignment"), this.Aa.alignment = a, this.L()) });
  34029. D.defineProperty($, { nodeIndent: "nodeIndent" }, function() { return this.Aa.nodeIndent }, function(a) { this.Aa.nodeIndent !== a && (D.h(a, "number", $, "nodeIndent"), 0 <= a && (this.Aa.nodeIndent = a, this.L())) });
  34030. D.defineProperty($, { nodeIndentPastParent: "nodeIndentPastParent" }, function() { return this.Aa.nodeIndentPastParent }, function(a) { this.Aa.nodeIndentPastParent !== a && (D.h(a, "number", $, "nodeIndentPastParent"), 0 <= a && 1 >= a && (this.Aa.nodeIndentPastParent = a, this.L())) });
  34031. D.defineProperty($, { nodeSpacing: "nodeSpacing" }, function() { return this.Aa.nodeSpacing }, function(a) { this.Aa.nodeSpacing !== a && (D.h(a, "number", $, "nodeSpacing"), this.Aa.nodeSpacing = a, this.L()) });
  34032. D.defineProperty($, { layerSpacing: "layerSpacing" }, function() { return this.Aa.layerSpacing }, function(a) { this.Aa.layerSpacing !== a && (D.h(a, "number", $, "layerSpacing"), this.Aa.layerSpacing = a, this.L()) });
  34033. D.defineProperty($, { layerSpacingParentOverlap: "layerSpacingParentOverlap" }, function() { return this.Aa.layerSpacingParentOverlap }, function(a) { this.Aa.layerSpacingParentOverlap !== a && (D.h(a, "number", $, "layerSpacingParentOverlap"), 0 <= a && 1 >= a && (this.Aa.layerSpacingParentOverlap = a, this.L())) });
  34034. D.defineProperty($, { compaction: "compaction" }, function() { return this.Aa.compaction }, function(a) { this.Aa.compaction !== a && (D.Da(a, $, $, "compaction"), a === $v || a === bw) && (this.Aa.compaction = a, this.L()) });
  34035. D.defineProperty($, { breadthLimit: "breadthLimit" }, function() { return this.Aa.breadthLimit }, function(a) { this.Aa.breadthLimit !== a && (D.h(a, "number", $, "breadthLimit"), 0 <= a && (this.Aa.breadthLimit = a, this.L())) });
  34036. D.defineProperty($, { rowSpacing: "rowSpacing" }, function() { return this.Aa.rowSpacing }, function(a) { this.Aa.rowSpacing !== a && (D.h(a, "number", $, "rowSpacing"), this.Aa.rowSpacing = a, this.L()) });
  34037. D.defineProperty($, { rowIndent: "rowIndent" }, function() { return this.Aa.rowIndent }, function(a) { this.Aa.rowIndent !== a && (D.h(a, "number", $, "rowIndent"), 0 <= a && (this.Aa.rowIndent = a, this.L())) });
  34038. D.defineProperty($, { commentSpacing: "commentSpacing" }, function() { return this.Aa.commentSpacing }, function(a) { this.Aa.commentSpacing !== a && (D.h(a, "number", $, "commentSpacing"), this.Aa.commentSpacing = a, this.L()) });
  34039. D.defineProperty($, { commentMargin: "commentMargin" }, function() { return this.Aa.commentMargin }, function(a) { this.Aa.commentMargin !== a && (D.h(a, "number", $, "commentMargin"), this.Aa.commentMargin = a, this.L()) });
  34040. D.defineProperty($, { setsPortSpot: "setsPortSpot" }, function() { return this.Aa.setsPortSpot }, function(a) { this.Aa.setsPortSpot !== a && (D.h(a, "boolean", $, "setsPortSpot"), this.Aa.setsPortSpot = a, this.L()) });
  34041. D.defineProperty($, { portSpot: "portSpot" }, function() { return this.Aa.portSpot }, function(a) {
  34042. D.l(a, S, $, "portSpot");
  34043. this.Aa.portSpot.O(a) || (this.Aa.portSpot = a, this.L())
  34044. });
  34045. D.defineProperty($, { setsChildPortSpot: "setsChildPortSpot" }, function() { return this.Aa.setsChildPortSpot }, function(a) { this.Aa.setsChildPortSpot !== a && (D.h(a, "boolean", $, "setsChildPortSpot"), this.Aa.setsChildPortSpot = a, this.L()) });
  34046. D.defineProperty($, { childPortSpot: "childPortSpot" }, function() { return this.Aa.childPortSpot }, function(a) {
  34047. D.l(a, S, $, "childPortSpot");
  34048. this.Aa.childPortSpot.O(a) || (this.Aa.childPortSpot = a, this.L())
  34049. });
  34050. D.defineProperty($, { kL: "alternateSorting" }, function() { return this.Ba.sorting }, function(a) { this.Ba.sorting !== a && (D.Da(a, $, $, "alternateSorting"), a === Pv || a === Qv || a === Rv || Sv) && (this.Ba.sorting = a, this.L()) });
  34051. D.defineProperty($, { ZK: "alternateComparer" }, function() { return this.Ba.comparer }, function(a) { this.Ba.comparer !== a && (D.h(a, "function", $, "alternateComparer"), this.Ba.comparer = a, this.L()) });
  34052. D.defineProperty($, { TK: "alternateAngle" }, function() { return this.Ba.angle }, function(a) { this.Ba.angle !== a && (D.h(a, "number", $, "alternateAngle"), 0 === a || 90 === a || 180 === a || 270 === a) && (this.Ba.angle = a, this.L()) });
  34053. D.defineProperty($, { SK: "alternateAlignment" }, function() { return this.Ba.alignment }, function(a) { this.Ba.alignment !== a && (D.Da(a, $, $, "alternateAlignment"), this.Ba.alignment = a, this.L()) });
  34054. D.defineProperty($, { cL: "alternateNodeIndent" }, function() { return this.Ba.nodeIndent }, function(a) { this.Ba.nodeIndent !== a && (D.h(a, "number", $, "alternateNodeIndent"), 0 <= a && (this.Ba.nodeIndent = a, this.L())) });
  34055. D.defineProperty($, { dL: "alternateNodeIndentPastParent" }, function() { return this.Ba.nodeIndentPastParent }, function(a) { this.Ba.nodeIndentPastParent !== a && (D.h(a, "number", $, "alternateNodeIndentPastParent"), 0 <= a && 1 >= a && (this.Ba.nodeIndentPastParent = a, this.L())) });
  34056. D.defineProperty($, { eL: "alternateNodeSpacing" }, function() { return this.Ba.nodeSpacing }, function(a) { this.Ba.nodeSpacing !== a && (D.h(a, "number", $, "alternateNodeSpacing"), this.Ba.nodeSpacing = a, this.L()) });
  34057. D.defineProperty($, { aL: "alternateLayerSpacing" }, function() { return this.Ba.layerSpacing }, function(a) { this.Ba.layerSpacing !== a && (D.h(a, "number", $, "alternateLayerSpacing"), this.Ba.layerSpacing = a, this.L()) });
  34058. D.defineProperty($, { bL: "alternateLayerSpacingParentOverlap" }, function() { return this.Ba.layerSpacingParentOverlap }, function(a) { this.Ba.layerSpacingParentOverlap !== a && (D.h(a, "number", $, "alternateLayerSpacingParentOverlap"), 0 <= a && 1 >= a && (this.Ba.layerSpacingParentOverlap = a, this.L())) });
  34059. D.defineProperty($, { YK: "alternateCompaction" }, function() { return this.Ba.compaction }, function(a) { this.Ba.compaction !== a && (D.Da(a, $, $, "alternateCompaction"), a === $v || a === bw) && (this.Ba.compaction = a, this.L()) });
  34060. D.defineProperty($, { UK: "alternateBreadthLimit" }, function() { return this.Ba.breadthLimit }, function(a) { this.Ba.breadthLimit !== a && (D.h(a, "number", $, "alternateBreadthLimit"), 0 <= a && (this.Ba.breadthLimit = a, this.L())) });
  34061. D.defineProperty($, { hL: "alternateRowSpacing" }, function() { return this.Ba.rowSpacing }, function(a) { this.Ba.rowSpacing !== a && (D.h(a, "number", $, "alternateRowSpacing"), this.Ba.rowSpacing = a, this.L()) });
  34062. D.defineProperty($, { gL: "alternateRowIndent" }, function() { return this.Ba.rowIndent }, function(a) { this.Ba.rowIndent !== a && (D.h(a, "number", $, "alternateRowIndent"), 0 <= a && (this.Ba.rowIndent = a, this.L())) });
  34063. D.defineProperty($, { XK: "alternateCommentSpacing" }, function() { return this.Ba.commentSpacing }, function(a) { this.Ba.commentSpacing !== a && (D.h(a, "number", $, "alternateCommentSpacing"), this.Ba.commentSpacing = a, this.L()) });
  34064. D.defineProperty($, { WK: "alternateCommentMargin" }, function() { return this.Ba.commentMargin }, function(a) { this.Ba.commentMargin !== a && (D.h(a, "number", $, "alternateCommentMargin"), this.Ba.commentMargin = a, this.L()) });
  34065. D.defineProperty($, { jL: "alternateSetsPortSpot" }, function() { return this.Ba.setsPortSpot }, function(a) { this.Ba.setsPortSpot !== a && (D.h(a, "boolean", $, "alternateSetsPortSpot"), this.Ba.setsPortSpot = a, this.L()) });
  34066. D.defineProperty($, { fL: "alternatePortSpot" }, function() { return this.Ba.portSpot }, function(a) {
  34067. D.l(a, S, $, "alternatePortSpot");
  34068. this.Ba.portSpot.O(a) || (this.Ba.portSpot = a, this.L())
  34069. });
  34070. D.defineProperty($, { iL: "alternateSetsChildPortSpot" }, function() { return this.Ba.setsChildPortSpot }, function(a) { this.Ba.setsChildPortSpot !== a && (D.h(a, "boolean", $, "alternateSetsChildPortSpot"), this.Ba.setsChildPortSpot = a, this.L()) });
  34071. D.defineProperty($, { VK: "alternateChildPortSpot" }, function() { return this.Ba.childPortSpot }, function(a) {
  34072. D.l(a, S, $, "alternateChildPortSpot");
  34073. this.Ba.childPortSpot.O(a) || (this.Ba.childPortSpot = a, this.L())
  34074. });
  34075. var sv;
  34076. $.PathDefault = sv = D.s($, "PathDefault", -1);
  34077. var tv;
  34078. $.PathDestination = tv = D.s($, "PathDestination", 0);
  34079. var Av;
  34080. $.PathSource = Av = D.s($, "PathSource", 1);
  34081. var Pv;
  34082. $.SortingForwards = Pv = D.s($, "SortingForwards", 10);
  34083. var Qv;
  34084. $.SortingReverse = Qv = D.s($, "SortingReverse", 11);
  34085. var Rv;
  34086. $.SortingAscending = Rv = D.s($, "SortingAscending", 12);
  34087. var Sv;
  34088. $.SortingDescending = Sv = D.s($, "SortingDescending", 13);
  34089. var Uw;
  34090. $.AlignmentCenterSubtrees = Uw = D.s($, "AlignmentCenterSubtrees", 20);
  34091. var Tv;
  34092. $.AlignmentCenterChildren = Tv = D.s($, "AlignmentCenterChildren", 21);
  34093. var dw;
  34094. $.AlignmentStart = dw = D.s($, "AlignmentStart", 22);
  34095. var ew;
  34096. $.AlignmentEnd = ew = D.s($, "AlignmentEnd", 23);
  34097. var Vv;
  34098. $.AlignmentBus = Vv = D.s($, "AlignmentBus", 24);
  34099. var Kv;
  34100. $.AlignmentBusBranching = Kv = D.s($, "AlignmentBusBranching", 25);
  34101. var Wv;
  34102. $.AlignmentTopLeftBus = Wv = D.s($, "AlignmentTopLeftBus", 26);
  34103. var Xv;
  34104. $.AlignmentBottomRightBus = Xv = D.s($, "AlignmentBottomRightBus", 27);
  34105. var $v;
  34106. $.CompactionNone = $v = D.s($, "CompactionNone", 30);
  34107. var bw;
  34108. $.CompactionBlock = bw = D.s($, "CompactionBlock", 31);
  34109. var uv;
  34110. $.StyleLayered = uv = D.s($, "StyleLayered", 40);
  34111. var Ov;
  34112. $.StyleLastParents = Ov = D.s($, "StyleLastParents", 41);
  34113. var Nv;
  34114. $.StyleAlternating = Nv = D.s($, "StyleAlternating", 42);
  34115. var Mv;
  34116. $.StyleRootOnly = Mv = D.s($, "StyleRootOnly", 43);
  34117. var wv;
  34118. $.ArrangementVertical = wv = D.s($, "ArrangementVertical", 50);
  34119. var cx;
  34120. $.ArrangementHorizontal = cx = D.s($, "ArrangementHorizontal", 51);
  34121. var zv;
  34122. $.ArrangementFixedRoots = zv = D.s($, "ArrangementFixedRoots", 52);
  34123. var vv;
  34124. $.LayerIndividual = vv = D.s($, "LayerIndividual", 60);
  34125. var Iv;
  34126. $.LayerSiblings = Iv = D.s($, "LayerSiblings", 61);
  34127. var Hv;
  34128. $.LayerUniform = Hv = D.s($, "LayerUniform", 62);
  34129. function yv() { ua.call(this) }
  34130. D.Ta(yv, ua);
  34131. D.ka("TreeNetwork", yv);
  34132. yv.prototype.createVertex = function() { return new xv };
  34133. yv.prototype.createEdge = function() { return new ex };
  34134. function xv() {
  34135. va.call(this);
  34136. this.initialized = !1;
  34137. this.parent = null;
  34138. this.children = [];
  34139. this.maxGenerationCount = this.maxChildrenCount = this.descendantCount = this.level = 0;
  34140. this.comments = null;
  34141. this.sa = new N(0, 0);
  34142. this.tb = new Ca(0, 0);
  34143. this.Wa = new N(0, 0);
  34144. this.Sq = this.Rq = this.lK = !1;
  34145. this.kv = this.Ru = null;
  34146. this.sorting = Pv;
  34147. this.comparer = ys;
  34148. this.angle = 0;
  34149. this.alignment = Tv;
  34150. this.nodeIndentPastParent = this.nodeIndent = 0;
  34151. this.nodeSpacing = 20;
  34152. this.layerSpacing = 50;
  34153. this.layerSpacingParentOverlap = 0;
  34154. this.compaction = bw;
  34155. this.breadthLimit =
  34156. 0;
  34157. this.rowSpacing = 25;
  34158. this.commentSpacing = this.rowIndent = 10;
  34159. this.commentMargin = 20;
  34160. this.setsPortSpot = !0;
  34161. this.portSpot = Vc;
  34162. this.setsChildPortSpot = !0;
  34163. this.childPortSpot = Vc
  34164. }
  34165. D.Ta(xv, va);
  34166. D.ka("TreeVertex", xv);
  34167. xv.prototype.copyInheritedPropertiesFrom = function(a) {
  34168. null !== a && (this.sorting = a.sorting, this.comparer = a.comparer, this.angle = a.angle, this.alignment = a.alignment, this.nodeIndent = a.nodeIndent, this.nodeIndentPastParent = a.nodeIndentPastParent, this.nodeSpacing = a.nodeSpacing, this.layerSpacing = a.layerSpacing, this.layerSpacingParentOverlap = a.layerSpacingParentOverlap, this.compaction = a.compaction, this.breadthLimit = a.breadthLimit, this.rowSpacing = a.rowSpacing, this.rowIndent = a.rowIndent, this.commentSpacing = a.commentSpacing,
  34169. this.commentMargin = a.commentMargin, this.setsPortSpot = a.setsPortSpot, this.portSpot = a.portSpot, this.setsChildPortSpot = a.setsChildPortSpot, this.childPortSpot = a.childPortSpot)
  34170. };
  34171. D.w(xv, { Gn: "childrenCount" }, function() { return this.children.length });
  34172. D.defineProperty(xv, { BM: "relativePosition" }, function() { return this.sa }, function(a) { this.sa.set(a) });
  34173. D.defineProperty(xv, { OM: "subtreeSize" }, function() { return this.tb }, function(a) { this.tb.set(a) });
  34174. D.defineProperty(xv, { NM: "subtreeOffset" }, function() { return this.Wa }, function(a) { this.Wa.set(a) });
  34175. function ex() {
  34176. wa.call(this);
  34177. this.nt = new N(0, 0)
  34178. }
  34179. D.Ta(ex, wa);
  34180. D.ka("TreeEdge", ex);
  34181. ex.prototype.commit = function() {
  34182. var a = this.link;
  34183. if (null !== a && !a.Nj) {
  34184. var b = this.network.Yb,
  34185. c = null,
  34186. d = null;
  34187. switch (b.Wf) {
  34188. case tv:
  34189. c = this.fromVertex;
  34190. d = this.toVertex;
  34191. break;
  34192. case Av:
  34193. c = this.toVertex;
  34194. d = this.fromVertex;
  34195. break;
  34196. default:
  34197. D.k("Unhandled path value " + b.Wf.toString())
  34198. }
  34199. if (null !== c && null !== d)
  34200. if (b = this.nt, 0 !== b.x || 0 !== b.y || c.lK) {
  34201. var d = c.pb,
  34202. e = cw(c),
  34203. g = fw(c),
  34204. h = c.rowSpacing;
  34205. a.zo();
  34206. var k = a.jf === Uj,
  34207. l = a.ic,
  34208. m = 0,
  34209. n, p;
  34210. a.Dm();
  34211. if (l || k) {
  34212. for (m = 2; 4 < a.ta;) a.KG(2);
  34213. n = a.m(1);
  34214. p = a.m(2)
  34215. } else {
  34216. for (m = 1; 3 < a.ta;) a.KG(1);
  34217. n = a.m(0);
  34218. p =
  34219. a.m(a.ta - 1)
  34220. }
  34221. var q = a.m(a.ta - 1),
  34222. r = 0;
  34223. 0 === e ? (c.alignment === ew ? (r = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (r = Math.min(r, Math.max(n.y, r - gw(c))))) : c.alignment === dw ? (r = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (r = Math.max(r, Math.min(n.y, r + gw(c))))) : r = c.Rq || c.Sq && 1 === c.maxGenerationCount ? d.top - c.Wa.y + b.y : d.y + d.height / 2 + b.y, k ? (a.B(m, n.x, r), m++, a.B(m, d.right + g, r), m++, a.B(m, d.right + g + (b.x - h) / 3, r), m++, a.B(m, d.right + g + 2 * (b.x - h) / 3, r), m++, a.B(m, d.right + g + (b.x - h), r), m++, a.B(m, p.x, r)) : (l && (a.B(m, d.right + g / 2, n.y),
  34224. m++), a.B(m, d.right + g / 2, r), m++, a.B(m, d.right + g + b.x - (l ? h / 2 : h), r), m++, l && a.B(m, a.m(m - 1).x, p.y))) : 90 === e ? (c.alignment === ew ? (r = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (r = Math.min(r, Math.max(n.x, r - gw(c))))) : c.alignment === dw ? (r = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (r = Math.max(r, Math.min(n.x, r + gw(c))))) : r = c.Rq || c.Sq && 1 === c.maxGenerationCount ? d.left - c.Wa.x + b.x : d.x + d.width / 2 + b.x, k ? (a.B(m, r, n.y), m++, a.B(m, r, d.bottom + g), m++, a.B(m, r, d.bottom + g + (b.y - h) / 3), m++, a.B(m, r, d.bottom + g + 2 * (b.y - h) / 3), m++, a.B(m, r, d.bottom +
  34225. g + (b.y - h)), m++, a.B(m, r, p.y)) : (l && (a.B(m, n.x, d.bottom + g / 2), m++), a.B(m, r, d.bottom + g / 2), m++, a.B(m, r, d.bottom + g + b.y - (l ? h / 2 : h)), m++, l && a.B(m, p.x, a.m(m - 1).y))) : 180 === e ? (c.alignment === ew ? (r = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (r = Math.min(r, Math.max(n.y, r - gw(c))))) : c.alignment === dw ? (r = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (r = Math.max(r, Math.min(n.y, r + gw(c))))) : r = c.Rq || c.Sq && 1 === c.maxGenerationCount ? d.top - c.Wa.y + b.y : d.y + d.height / 2 + b.y, k ? (a.B(m, n.x, r), m++, a.B(m, d.left - g, r), m++, a.B(m, d.left - g + (b.x +
  34226. h) / 3, r), m++, a.B(m, d.left - g + 2 * (b.x + h) / 3, r), m++, a.B(m, d.left - g + (b.x + h), r), m++, a.B(m, p.x, r)) : (l && (a.B(m, d.left - g / 2, n.y), m++), a.B(m, d.left - g / 2, r), m++, a.B(m, d.left - g + b.x + (l ? h / 2 : h), r), m++, l && a.B(m, a.m(m - 1).x, p.y))) : 270 === e ? (c.alignment === ew ? (r = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (r = Math.min(r, Math.max(n.x, r - gw(c))))) : c.alignment === dw ? (r = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (r = Math.max(r, Math.min(n.x, r + gw(c))))) : r = c.Rq || c.Sq && 1 === c.maxGenerationCount ? d.left - c.Wa.x + b.x : d.x + d.width / 2 + b.x, k ? (a.B(m,
  34227. r, n.y), m++, a.B(m, r, d.top - g), m++, a.B(m, r, d.top - g + (b.y + h) / 3), m++, a.B(m, r, d.top - g + 2 * (b.y + h) / 3), m++, a.B(m, r, d.top - g + (b.y + h)), m++, a.B(m, r, p.y)) : (l && (a.B(m, n.x, d.top - g / 2), m++), a.B(m, r, d.top - g / 2), m++, a.B(m, r, d.top - g + b.y + (l ? h / 2 : h)), m++, l && a.B(m, p.x, a.m(m - 1).y))) : D.k("Invalid angle " + e);
  34228. a.Ej()
  34229. } else e = c, g = d, v && D.l(e, xv, ex, "adjustRouteForAngleChange:parent"), v && D.l(g, xv, ex, "adjustRouteForAngleChange:child"), a = this.link, c = cw(e), c !== cw(g) && (b = fw(e), d = e.pb, e = g.pb, 0 === c && e.left - d.right < b + 1 || 90 === c && e.top - d.bottom <
  34230. b + 1 || 180 === c && d.left - e.right < b + 1 || 270 === c && d.top - e.bottom < b + 1 || (a.zo(), e = a.jf === Uj, g = a.ic, h = Uv(this.fromVertex.alignment), a.Dm(), 0 === c ? (c = d.right + b / 2, e ? 4 === a.ta && (b = a.m(3).y, a.ia(1, c - 20, a.m(1).y), a.B(2, c - 20, b), a.B(3, c, b), a.B(4, c + 20, b), a.ia(5, a.m(5).x, b)) : g ? h ? a.ia(3, a.m(2).x, a.m(4).y) : 6 === a.ta && (a.ia(2, c, a.m(2).y), a.ia(3, c, a.m(3).y)) : 4 === a.ta ? a.B(2, c, a.m(2).y) : 3 === a.ta ? a.ia(1, c, a.m(2).y) : 2 === a.ta && a.B(1, c, a.m(1).y)) : 90 === c ? (b = d.bottom + b / 2, e ? 4 === a.ta && (c = a.m(3).x, a.ia(1, a.m(1).x, b - 20), a.B(2, c, b - 20),
  34231. a.B(3, c, b), a.B(4, c, b + 20), a.ia(5, c, a.m(5).y)) : g ? h ? a.ia(3, a.m(2).x, a.m(4).y) : 6 === a.ta && (a.ia(2, a.m(2).x, b), a.ia(3, a.m(3).x, b)) : 4 === a.ta ? a.B(2, a.m(2).x, b) : 3 === a.ta ? a.ia(1, a.m(2).x, b) : 2 === a.ta && a.B(1, a.m(1).x, b)) : 180 === c ? (c = d.left - b / 2, e ? 4 === a.ta && (b = a.m(3).y, a.ia(1, c + 20, a.m(1).y), a.B(2, c + 20, b), a.B(3, c, b), a.B(4, c - 20, b), a.ia(5, a.m(5).x, b)) : g ? h ? a.ia(3, a.m(2).x, a.m(4).y) : 6 === a.ta && (a.ia(2, c, a.m(2).y), a.ia(3, c, a.m(3).y)) : 4 === a.ta ? a.B(2, c, a.m(2).y) : 3 === a.ta ? a.ia(1, c, a.m(2).y) : 2 === a.ta && a.B(1, c, a.m(1).y)) : 270 ===
  34232. c && (b = d.top - b / 2, e ? 4 === a.ta && (c = a.m(3).x, a.ia(1, a.m(1).x, b + 20), a.B(2, c, b + 20), a.B(3, c, b), a.B(4, c, b - 20), a.ia(5, c, a.m(5).y)) : g ? h ? a.ia(3, a.m(2).x, a.m(4).y) : 6 === a.ta && (a.ia(2, a.m(2).x, b), a.ia(3, a.m(3).x, b)) : 4 === a.ta ? a.B(2, a.m(2).x, b) : 3 === a.ta ? a.ia(1, a.m(2).x, b) : 2 === a.ta && a.B(1, a.m(1).x, b)), a.Ej()))
  34233. }
  34234. };
  34235. D.defineProperty(ex, { AM: "relativePoint" }, function() { return this.nt }, function(a) { this.nt.set(a) });
  34236. function fx() {
  34237. O.call(this);
  34238. this.af = null
  34239. }
  34240. D.Ta(fx, O);
  34241. fx.prototype.cloneProtected = function(a) {
  34242. O.prototype.cloneProtected.call(this, a);
  34243. a.element = this.af.cloneNode(!0)
  34244. };
  34245. fx.prototype.toString = function() { return "HTMLHost(" + this.af.toString() + ")#" + D.Nd(this) };
  34246. fx.prototype.Wk = function(a, b) {
  34247. var c = this.af;
  34248. if (null !== c) {
  34249. var d = this.fb(mc);
  34250. d.x -= this.aa.width / 2;
  34251. d.y -= this.aa.height / 2;
  34252. d.x -= this.aa.x;
  34253. d.y -= this.aa.y;
  34254. var d = b.pC(d),
  34255. e = b.Hj;
  34256. null === e || e.contains(c) || e.appendChild(c);
  34257. e = this.transform;
  34258. c.style.transform = "matrix(" + e.m11 + "," + e.m12 + "," + e.m21 + "," + e.m22 + "," + e.dx + "," + e.dy + ")";
  34259. c.style.transformOrigin = "0 0";
  34260. e = d.y;
  34261. c.style.left = d.x + "px";
  34262. c.style.top = e + "px"
  34263. }
  34264. };
  34265. fx.prototype.ho = function(a, b, c, d) {
  34266. var e = this.Ea;
  34267. isFinite(e.width) && (a = e.width);
  34268. isFinite(e.height) && (b = e.height);
  34269. var e = this.pf,
  34270. g = this.ah;
  34271. c = Math.max(c, g.width);
  34272. d = Math.max(d, g.height);
  34273. a = Math.min(e.width, a);
  34274. b = Math.min(e.height, b);
  34275. a = Math.max(c, a);
  34276. b = Math.max(d, b);
  34277. c = this.af;
  34278. null !== c && (b = c.getBoundingClientRect(), a = b.width, b = b.height);
  34279. Cb(this.fd, a, b);
  34280. Jo(this, 0, 0, a, b)
  34281. };
  34282. fx.prototype.Cj = function(a, b, c, d) { Oo(this, a, b, c, d) };
  34283. D.w(fx, { Ga: "naturalBounds" }, function() { return this.fd });
  34284. D.defineProperty(fx, { element: "element" }, function() { return this.af }, function(a) {
  34285. var b = this.af;
  34286. b !== a && (a instanceof HTMLElement || D.k("HTMLHost.element must be an instance of Element."), this.af = a, a.className = "HTMLHost", this.i("element", b, a), this.ra())
  34287. });
  34288. ba.version = "1.8.13";
  34289. window && (window.module && "object" === typeof window.module && "object" === typeof window.module.exports ? window.module.exports = ba : window.define && "function" === typeof window.define && window.define.amd ? (window.go = ba, window.define(ba)) : window.go = ba);
  34290. "undefined" !== typeof module && "object" === typeof module.exports && (module.exports = ba);
  34291. })(window);