123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696(* Js_of_ocaml library
* http://www.ocsigen.org/js_of_ocaml/
* Copyright (C) 2010 Jérôme Vouillon
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)openJsopen!Importexternalcaml_js_on_ie:unit->boolt="caml_js_on_ie"letonIE=Js.to_bool(caml_js_on_ie())externalhtml_escape:js_stringt->js_stringt="caml_js_html_escape"externalhtml_entities:js_stringt->js_stringtopt="caml_js_html_entities"letdecode_html_entitiess=Js.Opt.get(html_entitiess)(fun()->failwith("Invalid entity "^Js.to_strings))classtypecssStyleDeclaration=objectmethodsetProperty:js_stringt->js_stringt->js_stringtoptdef->js_stringtmethmethodgetPropertyValue:js_stringt->js_stringtmethmethodgetPropertyPriority:js_stringt->js_stringtmethmethodremoveProperty:js_stringt->js_stringtmethmethodanimation:js_stringtpropmethodanimationDelay:js_stringtpropmethodanimationDirection:js_stringtpropmethodanimationDuration:js_stringtpropmethodanimationFillMode:js_stringtpropmethodanimationIterationCount:js_stringtpropmethodanimationName:js_stringtpropmethodanimationPlayState:js_stringtpropmethodanimationTimingFunction:js_stringtpropmethodbackground:js_stringtpropmethodbackgroundAttachment:js_stringtpropmethodbackgroundColor:js_stringtpropmethodbackgroundImage:js_stringtpropmethodbackgroundPosition:js_stringtpropmethodbackgroundRepeat:js_stringtpropmethodborder:js_stringtpropmethodborderBottom:js_stringtpropmethodborderBottomColor:js_stringtpropmethodborderBottomStyle:js_stringtpropmethodborderBottomWidth:js_stringtpropmethodborderCollapse:js_stringtpropmethodborderColor:js_stringtpropmethodborderLeft:js_stringtpropmethodborderLeftColor:js_stringtpropmethodborderLeftStyle:js_stringtpropmethodborderLeftWidth:js_stringtpropmethodborderRadius:js_stringtpropmethodborderRight:js_stringtpropmethodborderRightColor:js_stringtpropmethodborderRightStyle:js_stringtpropmethodborderRightWidth:js_stringtpropmethodborderSpacing:js_stringtpropmethodborderStyle:js_stringtpropmethodborderTop:js_stringtpropmethodborderTopColor:js_stringtpropmethodborderTopStyle:js_stringtpropmethodborderTopWidth:js_stringtpropmethodborderWidth:js_stringtpropmethodbottom:js_stringtpropmethodcaptionSide:js_stringtpropmethodclear:js_stringtpropmethodclip:js_stringtpropmethodcolor:js_stringtpropmethodcontent:js_stringtpropmethodcounterIncrement:js_stringtpropmethodcounterReset:js_stringtpropmethodcssFloat:js_stringtpropmethodcssText:js_stringtpropmethodcursor:js_stringtpropmethoddirection:js_stringtpropmethoddisplay:js_stringtpropmethodemptyCells:js_stringtpropmethodfill:js_stringtpropmethodfont:js_stringtpropmethodfontFamily:js_stringtpropmethodfontSize:js_stringtpropmethodfontStyle:js_stringtpropmethodfontVariant:js_stringtpropmethodfontWeight:js_stringtpropmethodheight:js_stringtpropmethodleft:js_stringtpropmethodletterSpacing:js_stringtpropmethodlineHeight:js_stringtpropmethodlistStyle:js_stringtpropmethodlistStyleImage:js_stringtpropmethodlistStylePosition:js_stringtpropmethodlistStyleType:js_stringtpropmethodmargin:js_stringtpropmethodmarginBottom:js_stringtpropmethodmarginLeft:js_stringtpropmethodmarginRight:js_stringtpropmethodmarginTop:js_stringtpropmethodmaxHeight:js_stringtpropmethodmaxWidth:js_stringtpropmethodminHeight:js_stringtpropmethodminWidth:js_stringtpropmethodopacity:js_stringtoptdefpropmethodoutline:js_stringtpropmethodoutlineColor:js_stringtpropmethodoutlineOffset:js_stringtpropmethodoutlineStyle:js_stringtpropmethodoutlineWidth:js_stringtpropmethodoverflow:js_stringtpropmethodoverflowX:js_stringtpropmethodoverflowY:js_stringtpropmethodpadding:js_stringtpropmethodpaddingBottom:js_stringtpropmethodpaddingLeft:js_stringtpropmethodpaddingRight:js_stringtpropmethodpaddingTop:js_stringtpropmethodpageBreakAfter:js_stringtpropmethodpageBreakBefore:js_stringtpropmethodpointerEvents:js_stringtpropmethodposition:js_stringtpropmethodright:js_stringtpropmethodstroke:js_stringtpropmethodstrokeWidth:js_stringtpropmethodtableLayout:js_stringtpropmethodtextAlign:js_stringtpropmethodtextAnchor:js_stringtpropmethodtextDecoration:js_stringtpropmethodtextIndent:js_stringtpropmethodtextTransform:js_stringtpropmethodtop:js_stringtpropmethodtransform:js_stringtpropmethodverticalAlign:js_stringtpropmethodvisibility:js_stringtpropmethodwhiteSpace:js_stringtpropmethodwidth:js_stringtpropmethodwordSpacing:js_stringtpropmethodzIndex:js_stringtpropendtype('a,'b)event_listener=('a,'b)Dom.event_listenertypemouse_button=|No_button|Left_button|Middle_button|Right_buttontypedelta_mode=|Delta_pixel|Delta_line|Delta_pageclasstypeevent=objectinherit[element]Dom.eventendand['a]customEvent=objectinherit[element,'a]Dom.customEventendandfocusEvent=objectinheriteventmethodrelatedTarget:elementtoptoptdefreadonly_propendandmouseEvent=objectinheriteventmethodrelatedTarget:elementtoptoptdefreadonly_propmethodclientX:intreadonly_propmethodclientY:intreadonly_propmethodscreenX:intreadonly_propmethodscreenY:intreadonly_propmethodoffsetX:intreadonly_propmethodoffsetY:intreadonly_propmethodctrlKey:booltreadonly_propmethodshiftKey:booltreadonly_propmethodaltKey:booltreadonly_propmethodmetaKey:booltreadonly_propmethodbutton:intreadonly_propmethodwhich:mouse_buttonoptdefreadonly_propmethodfromElement:elementtoptoptdefreadonly_propmethodtoElement:elementtoptoptdefreadonly_propmethodpageX:intoptdefreadonly_propmethodpageY:intoptdefreadonly_propendandkeyboardEvent=objectinheriteventmethodaltKey:booltreadonly_propmethodshiftKey:booltreadonly_propmethodctrlKey:booltreadonly_propmethodmetaKey:booltreadonly_propmethodlocation:intreadonly_propmethodkey:js_stringtoptdefreadonly_propmethodcode:js_stringtoptdefreadonly_propmethodwhich:intoptdefreadonly_propmethodcharCode:intoptdefreadonly_propmethodkeyCode:intreadonly_propmethodgetModifierState:js_stringt->booltmethmethodkeyIdentifier:js_stringtoptdefreadonly_propendandmousewheelEvent=object(* All modern browsers *)inheritmouseEventmethodwheelDelta:intreadonly_propmethodwheelDeltaX:intoptdefreadonly_propmethodwheelDeltaY:intoptdefreadonly_propmethoddeltaX:number_treadonly_propmethoddeltaY:number_treadonly_propmethoddeltaZ:number_treadonly_propmethoddeltaMode:delta_modereadonly_propendandmouseScrollEvent=object(* Firefox *)inheritmouseEventmethoddetail:intreadonly_propmethodaxis:intoptdefreadonly_propmethod_HORIZONTAL_AXIS:intoptdefreadonly_propmethod_VERTICAL_AXIS:intoptdefreadonly_propendandtouchEvent=objectinheriteventmethodtouches:touchListtreadonly_propmethodtargetTouches:touchListtreadonly_propmethodchangedTouches:touchListtreadonly_propmethodctrlKey:booltreadonly_propmethodshiftKey:booltreadonly_propmethodaltKey:booltreadonly_propmethodmetaKey:booltreadonly_propmethodrelatedTarget:elementtoptoptdefreadonly_propendandtouchList=objectmethodlength:intreadonly_propmethoditem:int->touchtoptdefmethendandtouch=objectmethodidentifier:intreadonly_propmethodtarget:elementtoptdefreadonly_propmethodscreenX:intreadonly_propmethodscreenY:intreadonly_propmethodclientX:intreadonly_propmethodclientY:intreadonly_propmethodpageX:intreadonly_propmethodpageY:intreadonly_propendandsubmitEvent=objectinheriteventmethodsubmitter:elementtoptdefreadonly_propendanddragEvent=objectinheritmouseEventmethoddataTransfer:dataTransfertreadonly_propendandclipboardEvent=objectinheriteventmethodclipboardData:dataTransfertreadonly_propendandtoggleEvent=objectinheriteventmethodnewState:js_stringtreadonly_propmethodoldState:js_stringtreadonly_propendanddataTransfer=objectmethoddropEffect:js_stringtpropmethodeffectAllowed:js_stringtpropmethodfiles:File.fileListtreadonly_propmethodtypes:js_stringtjs_arraytreadonly_propmethodaddElement:elementt->unitmethmethodclearData:js_stringt->unitmethmethodclearData_all:unitmethmethodgetData:js_stringt->js_stringtmethmethodsetData:js_stringt->js_stringt->unitmethmethodsetDragImage:elementt->int->int->unitmethendandeventTarget=object('self)methodonclick:('selft,mouseEventt)event_listenerwriteonly_propmethodondblclick:('selft,mouseEventt)event_listenerwriteonly_propmethodonmousedown:('selft,mouseEventt)event_listenerwriteonly_propmethodonmouseup:('selft,mouseEventt)event_listenerwriteonly_propmethodonmouseover:('selft,mouseEventt)event_listenerwriteonly_propmethodonmousemove:('selft,mouseEventt)event_listenerwriteonly_propmethodonmouseout:('selft,mouseEventt)event_listenerwriteonly_propmethodonkeypress:('selft,keyboardEventt)event_listenerwriteonly_propmethodonkeydown:('selft,keyboardEventt)event_listenerwriteonly_propmethodonkeyup:('selft,keyboardEventt)event_listenerwriteonly_propmethodonscroll:('selft,eventt)event_listenerwriteonly_propmethodonwheel:('selft,mousewheelEventt)event_listenerwriteonly_propmethodondragstart:('selft,dragEventt)event_listenerwriteonly_propmethodondragend:('selft,dragEventt)event_listenerwriteonly_propmethodondragenter:('selft,dragEventt)event_listenerwriteonly_propmethodondragover:('selft,dragEventt)event_listenerwriteonly_propmethodondragleave:('selft,dragEventt)event_listenerwriteonly_propmethodondrag:('selft,dragEventt)event_listenerwriteonly_propmethodondrop:('selft,dragEventt)event_listenerwriteonly_propmethodonanimationstart:('selft,animationEventt)event_listenerwriteonly_propmethodonanimationend:('selft,animationEventt)event_listenerwriteonly_propmethodonanimationiteration:('selft,animationEventt)event_listenerwriteonly_propmethodonanimationcancel:('selft,animationEventt)event_listenerwriteonly_propmethodontransitionrun:('selft,transitionEventt)event_listenerwriteonly_propmethodontransitionstart:('selft,transitionEventt)event_listenerwriteonly_propmethodontransitionend:('selft,transitionEventt)event_listenerwriteonly_propmethodontransitioncancel:('selft,transitionEventt)event_listenerwriteonly_propmethodongotpointercapture:('selft,pointerEventt)event_listenerwriteonly_propmethodonlostpointercapture:('selft,pointerEventt)event_listenerwriteonly_propmethodonpointerenter:('selft,pointerEventt)event_listenerwriteonly_propmethodonpointercancel:('selft,pointerEventt)event_listenerwriteonly_propmethodonpointerdown:('selft,pointerEventt)event_listenerwriteonly_propmethodonpointerleave:('selft,pointerEventt)event_listenerwriteonly_propmethodonpointermove:('selft,pointerEventt)event_listenerwriteonly_propmethodonpointerout:('selft,pointerEventt)event_listenerwriteonly_propmethodonpointerover:('selft,pointerEventt)event_listenerwriteonly_propmethodonpointerup:('selft,pointerEventt)event_listenerwriteonly_propmethoddispatchEvent:eventt->booltmethendandpopStateEvent=objectinheriteventmethodstate:Js.Unsafe.anyreadonly_propendandpointerEvent=objectinheritmouseEventmethodpointerId:intJs.readonly_propmethodwidth:number_tJs.readonly_propmethodheight:number_tJs.readonly_propmethodpressure:number_tJs.readonly_propmethodtangentialPressure:number_tJs.readonly_propmethodtiltX:intJs.readonly_propmethodtiltY:intJs.readonly_propmethodtwist:intJs.readonly_propmethodpointerType:Js.js_stringJs.tJs.readonly_propmethodisPrimary:boolJs.tJs.readonly_propendandstorageEvent=objectinheriteventmethodkey:js_stringtoptreadonly_propmethodoldValue:js_stringtoptreadonly_propmethodnewValue:js_stringtoptreadonly_propmethodurl:js_stringtreadonly_propmethodstorageArea:storagetoptreadonly_propendandstorage=objectmethodlength:intreadonly_propmethodkey:int->js_stringtoptmethmethodgetItem:js_stringt->js_stringtoptmethmethodsetItem:js_stringt->js_stringt->unitmethmethodremoveItem:js_stringt->unitmethmethodclear:unitmethendandhashChangeEvent=objectinheriteventmethodoldURL:js_stringtreadonly_propmethodnewURL:js_stringtreadonly_propendandanimationEvent=objectinheriteventmethodanimationName:js_stringtreadonly_propmethodelapsedTime:number_treadonly_propmethodpseudoElement:js_stringtreadonly_propendandtransitionEvent=objectinheriteventmethodpropertyName:js_stringtreadonly_propmethodelapsedTime:number_treadonly_propmethodpseudoElement:js_stringtreadonly_propendandmediaEvent=objectinheriteventendandmessageEvent=objectinheriteventmethoddata:Unsafe.anyoptreadonly_propmethodsource:Unsafe.anyoptreadonly_propendandnodeSelector=objectmethodquerySelector:js_stringt->elementtoptmethmethodquerySelectorAll:js_stringt->elementDom.nodeListtmethendandtokenList=objectmethodlength:intreadonly_propmethoditem:int->js_stringtoptdefmethmethodcontains:js_stringt->booltmethmethodadd:js_stringt->unitmethmethodremove:js_stringt->unitmethmethodtoggle:js_stringt->booltmethmethodstringifier:js_stringtpropendandelement=objectinheritDom.elementinheritnodeSelectormethodid:js_stringtpropmethodtitle:js_stringtpropmethodlang:js_stringtpropmethoddir:js_stringtpropmethodclassName:js_stringtpropmethodclassList:tokenListtreadonly_propmethodclosest:js_stringt->elementtoptmethmethodstyle:cssStyleDeclarationtpropmethodinnerHTML:js_stringtpropmethodouterHTML:js_stringtpropmethodtextContent:js_stringtoptpropmethodinnerText:js_stringtpropmethodclientLeft:intreadonly_propmethodclientTop:intreadonly_propmethodclientWidth:intreadonly_propmethodclientHeight:intreadonly_propmethodoffsetLeft:intreadonly_propmethodoffsetTop:intreadonly_propmethodoffsetParent:elementtoptreadonly_propmethodoffsetWidth:intreadonly_propmethodoffsetHeight:intreadonly_propmethodscrollLeft:intpropmethodscrollTop:intpropmethodscrollWidth:intpropmethodscrollHeight:intpropmethodgetClientRects:clientRectListtmethmethodgetBoundingClientRect:clientRecttmethmethodscrollIntoView:boolt->unitmethmethodclick:unitmethmethodfocus:unitmethmethodblur:unitmethinheriteventTargetendandclientRect=objectmethodtop:number_treadonly_propmethodright:number_treadonly_propmethodbottom:number_treadonly_propmethodleft:number_treadonly_propmethodwidth:number_toptdefreadonly_propmethodheight:number_toptdefreadonly_propendandclientRectList=objectmethodlength:intreadonly_propmethoditem:int->clientRecttoptmethendletno_handler:('a,'b)event_listener=Dom.no_handlerlethandler=Dom.handlerletfull_handler=Dom.full_handlerletinvoke_handler=Dom.invoke_handlermoduleEvent=structtype'atyp='aDom.Event.typletcancel=Dom.Event.make"cancel"letclick=Dom.Event.make"click"letclose=Dom.Event.make"close"letcopy=Dom.Event.make"copy"letcut=Dom.Event.make"cut"letpaste=Dom.Event.make"paste"letdblclick=Dom.Event.make"dblclick"letmousedown=Dom.Event.make"mousedown"letmouseup=Dom.Event.make"mouseup"letmouseover=Dom.Event.make"mouseover"letmousemove=Dom.Event.make"mousemove"letmouseout=Dom.Event.make"mouseout"letkeypress=Dom.Event.make"keypress"letkeydown=Dom.Event.make"keydown"letkeyup=Dom.Event.make"keyup"letmousewheel=Dom.Event.make"mousewheel"letwheel=Dom.Event.make"wheel"let_DOMMouseScroll=Dom.Event.make"DOMMouseScroll"lettouchstart=Dom.Event.make"touchstart"lettouchmove=Dom.Event.make"touchmove"lettouchend=Dom.Event.make"touchend"lettouchcancel=Dom.Event.make"touchcancel"letdragstart=Dom.Event.make"dragstart"letdragend=Dom.Event.make"dragend"letdragenter=Dom.Event.make"dragenter"letdragover=Dom.Event.make"dragover"letdragleave=Dom.Event.make"dragleave"letdrag=Dom.Event.make"drag"letdrop=Dom.Event.make"drop"lethashchange=Dom.Event.make"hashchange"letchange=Dom.Event.make"change"letinput=Dom.Event.make"input"lettimeupdate=Dom.Event.make"timeupdate"letsubmit=Dom.Event.make"submit"letscroll=Dom.Event.make"scroll"letfocus=Dom.Event.make"focus"letblur=Dom.Event.make"blur"letload=Dom.Event.make"load"letunload=Dom.Event.make"unload"letbeforeunload=Dom.Event.make"beforeunload"letresize=Dom.Event.make"resize"letorientationchange=Dom.Event.make"orientationchange"letpopstate=Dom.Event.make"popstate"leterror=Dom.Event.make"error"letabort=Dom.Event.make"abort"letselect=Dom.Event.make"select"letonline=Dom.Event.make"online"letoffline=Dom.Event.make"offline"letchecking=Dom.Event.make"checking"letnoupdate=Dom.Event.make"noupdate"letdownloading=Dom.Event.make"downloading"letprogress=Dom.Event.make"progress"letupdateready=Dom.Event.make"updateready"letcached=Dom.Event.make"cached"letobsolete=Dom.Event.make"obsolete"letdomContentLoaded=Dom.Event.make"DOMContentLoaded"letanimationstart=Dom.Event.make"animationstart"letanimationend=Dom.Event.make"animationend"letanimationiteration=Dom.Event.make"animationiteration"letanimationcancel=Dom.Event.make"animationcancel"lettransitionrun=Dom.Event.make"transitionrun"lettransitionstart=Dom.Event.make"transitionstart"lettransitionend=Dom.Event.make"transitionend"lettransitioncancel=Dom.Event.make"transitioncancel"letcanplay=Dom.Event.make"canplay"letcanplaythrough=Dom.Event.make"canplaythrough"letdurationchange=Dom.Event.make"durationchange"letemptied=Dom.Event.make"emptied"letended=Dom.Event.make"ended"letgotpointercapture=Dom.Event.make"gotpointercapture"letloadeddata=Dom.Event.make"loadeddata"letloadedmetadata=Dom.Event.make"loadedmetadata"letloadstart=Dom.Event.make"loadstart"letlostpointercapture=Dom.Event.make"lostpointercapture"letmessage=Dom.Event.make"message"letpause=Dom.Event.make"pause"letplay=Dom.Event.make"play"letplaying=Dom.Event.make"playing"letpointerenter=Dom.Event.make"pointerenter"letpointercancel=Dom.Event.make"pointercancel"letpointerdown=Dom.Event.make"pointerdown"letpointerleave=Dom.Event.make"pointerleave"letpointermove=Dom.Event.make"pointermove"letpointerout=Dom.Event.make"pointerout"letpointerover=Dom.Event.make"pointerover"letpointerup=Dom.Event.make"pointerup"letratechange=Dom.Event.make"ratechange"letseeked=Dom.Event.make"seeked"letseeking=Dom.Event.make"seeking"letstalled=Dom.Event.make"stalled"letsuspend=Dom.Event.make"suspend"letvolumechange=Dom.Event.make"volumechange"letwaiting=Dom.Event.make"waiting"lettoggle=Dom.Event.make"toggle"letmake=Dom.Event.makeendtypeevent_listener_id=Dom.event_listener_idletaddEventListener=Dom.addEventListenerletaddEventListenerWithOptions=Dom.addEventListenerWithOptionsletremoveEventListener=Dom.removeEventListenerletcreateCustomEvent=Dom.createCustomEventclasstype['node]collection=objectmethodlength:intreadonly_propmethoditem:int->'nodetoptmethmethodnamedItem:js_stringt->'nodetoptmethendclasstypehtmlElement=elementclasstypeheadElement=objectinheritelementmethodprofile:js_stringtpropendclasstypelinkElement=objectinheritelementmethoddisabled:booltpropmethodcharset:js_stringtpropmethodcrossorigin:js_stringtpropmethodhref:js_stringtpropmethodhreflang:js_stringtpropmethodmedia:js_stringtpropmethodrel:js_stringtpropmethodrev:js_stringtpropmethodtarget:js_stringtpropmethod_type:js_stringtpropendclasstypetitleElement=objectinheritelementmethodtext:js_stringtpropendclasstypemetaElement=objectinheritelementmethodcontent:js_stringtpropmethodhttpEquiv:js_stringtpropmethodname:js_stringtpropmethodscheme:js_stringtpropendclasstypebaseElement=objectinheritelementmethodhref:js_stringtpropmethodtarget:js_stringtpropendclasstypestyleElement=objectinheritelementmethoddisabled:booltpropmethodmedia:js_stringtpropmethod_type:js_stringtpropendclasstypebodyElement=elementclasstypeformElement=objectinheritelementmethodelements:elementcollectiontreadonly_propmethodlength:intreadonly_propmethodacceptCharset:js_stringtpropmethodaction:js_stringtpropmethodenctype:js_stringtpropmethod_method:js_stringtpropmethodtarget:js_stringtpropmethodsubmit:unitmethmethodreset:unitmethmethodonsubmit:('selft,submitEventt)event_listenerwriteonly_propendclasstypeoptGroupElement=objectinheritelementmethoddisabled:booltpropmethodlabel:js_stringtpropendclasstypeoptionElement=objectinheritoptGroupElementmethodform:formElementtoptreadonly_propmethoddefaultSelected:booltpropmethodtext:js_stringtreadonly_propmethodindex:intreadonly_propmethodselected:booltpropmethodvalue:js_stringtpropendclasstypeselectElement=object('self)inheritelementmethod_type:js_stringtreadonly_propmethodselectedIndex:intpropmethodvalue:js_stringtpropmethodlength:intpropmethodform:formElementtoptreadonly_propmethodoptions:optionElementcollectiontreadonly_propmethoddisabled:booltpropmethodmultiple:booltpropmethodname:js_stringtreadonly_propmethodsize:intpropmethodtabIndex:intpropmethodadd:#optGroupElementt->#optGroupElementtopt->unitmethmethodremove:int->unitmethmethodrequired:booltwriteonly_propmethodonchange:('selft,eventt)event_listenerpropmethodoninput:('selft,eventt)event_listenerpropendclasstypeinputElement=object('self)inheritelementmethoddefaultValue:js_stringtpropmethoddefaultChecked:js_stringtpropmethodform:formElementtoptreadonly_propmethodaccept:js_stringtpropmethodaccessKey:js_stringtpropmethodalign:js_stringtpropmethodalt:js_stringtpropmethodchecked:booltpropmethoddisabled:booltpropmethodmaxLength:intpropmethodname:js_stringtreadonly_propmethodreadOnly:booltpropmethodrequired:booltwriteonly_propmethodsize:intpropmethodsrc:js_stringtpropmethodtabIndex:intpropmethod_type:js_stringtreadonly_propmethoduseMap:js_stringtpropmethodvalue:js_stringtpropmethodselect:unitmethmethodfiles:File.fileListtoptdefreadonly_propmethodplaceholder:js_stringtwriteonly_propmethodselectionDirection:js_stringtpropmethodselectionStart:intpropmethodselectionEnd:intpropmethodonselect:('selft,eventt)event_listenerpropmethodonchange:('selft,eventt)event_listenerpropmethodoninput:('selft,eventt)event_listenerpropmethodonblur:('selft,focusEventt)event_listenerpropmethodonfocus:('selft,focusEventt)event_listenerpropendclasstypetextAreaElement=object('self)inheritelementmethoddefaultValue:js_stringtpropmethodform:formElementtoptreadonly_propmethodaccessKey:js_stringtpropmethodcols:intpropmethoddisabled:booltpropmethodname:js_stringtreadonly_propmethodreadOnly:booltpropmethodrows:intpropmethodselectionDirection:js_stringtpropmethodselectionEnd:intpropmethodselectionStart:intpropmethodtabIndex:intpropmethod_type:js_stringtreadonly_propmethodvalue:js_stringtpropmethodselect:unitmethmethodrequired:booltwriteonly_propmethodplaceholder:js_stringtwriteonly_propmethodonselect:('selft,eventt)event_listenerpropmethodonchange:('selft,eventt)event_listenerpropmethodoninput:('selft,eventt)event_listenerpropmethodonblur:('selft,focusEventt)event_listenerpropmethodonfocus:('selft,focusEventt)event_listenerpropendclasstypebuttonElement=objectinheritelementmethodform:formElementtoptreadonly_propmethodaccessKey:js_stringtpropmethoddisabled:booltpropmethodname:js_stringtreadonly_propmethodtabIndex:intpropmethod_type:js_stringtreadonly_propmethodvalue:js_stringtpropendclasstypelabelElement=objectinheritelementmethodform:formElementtoptreadonly_propmethodaccessKey:js_stringtpropmethodhtmlFor:js_stringtpropendclasstypefieldSetElement=objectinheritelementmethodform:formElementtoptreadonly_propendclasstypelegendElement=objectinheritelementmethodform:formElementtoptreadonly_propmethodaccessKey:js_stringtpropendclasstypeuListElement=elementclasstypeoListElement=elementclasstypedListElement=elementclasstypeliElement=elementclasstypedialogElement=objectinheritelementmethodclose:unitmethmethodclose_returnValue:js_stringt->unitmethmethodopen_:booltpropmethodreturnValue:js_stringtpropmethodshow:unitmethmethodshowModal:unitmethmethodoncancel:('selft,eventt)event_listenerpropmethodonclose:('selft,eventt)event_listenerpropendclasstypedivElement=elementclasstypeparagraphElement=elementclasstypeheadingElement=elementclasstypequoteElement=objectinheritelementmethodcite:js_stringtpropendclasstypepreElement=elementclasstypebrElement=elementclasstypehrElement=elementclasstypemodElement=objectinheritelementmethodcite:js_stringtpropmethoddateTime:js_stringtpropendclasstypeanchorElement=objectinheritelementmethodaccessKey:js_stringtpropmethodcharset:js_stringtpropmethodcoords:js_stringtpropmethoddownload:js_stringtpropmethodhref:js_stringtpropmethodhreflang:js_stringtpropmethodname:js_stringtpropmethodrel:js_stringtpropmethodrev:js_stringtpropmethodshape:js_stringtpropmethodtabIndex:intpropmethodtarget:js_stringtpropmethod_type:js_stringtpropendclasstypedetailsElement=object('self)inheritelementmethodopen_:booltpropmethodname:js_stringtpropmethodontoggle:('selft,toggleEventt)event_listenerpropendclasstypeimageElement=object('self)inheritelementmethodalt:js_stringtpropmethodsrc:js_stringtpropmethoduseMap:js_stringtpropmethodisMap:booltpropmethodwidth:intpropmethodheight:intpropmethodnaturalWidth:intoptdefreadonly_propmethodnaturalHeight:intoptdefreadonly_propmethodcomplete:booltpropmethodonload:('selft,eventt)event_listenerpropmethodonerror:('selft,eventt)event_listenerpropmethodonabort:('selft,eventt)event_listenerpropendclasstypeobjectElement=objectinheritelementmethodform:formElementtoptreadonly_propmethodcode:js_stringtpropmethodarchive:js_stringtpropmethodcodeBase:js_stringtpropmethodcodeType:js_stringtpropmethoddata:js_stringtpropmethoddeclare:booltpropmethodheight:js_stringtpropmethodname:js_stringtpropmethodstandby:js_stringtpropmethodtabIndex:intpropmethod_type:js_stringtpropmethoduseMap:js_stringtpropmethodwidth:js_stringtpropmethoddocument:Dom.elementDom.documenttoptreadonly_propendclasstypeparamElement=objectinheritelementmethodname:js_stringtpropmethod_type:js_stringtpropmethodvalue:js_stringtpropmethodvalueType:js_stringtpropendclasstypeareaElement=objectinheritelementmethodaccessKey:js_stringtpropmethodalt:js_stringtpropmethodcoords:js_stringtpropmethodhref:js_stringtpropmethodnoHref:booltpropmethodshape:js_stringtpropmethodtabIndex:intpropmethodtarget:js_stringtpropendclasstypemapElement=objectinheritelementmethodareas:areaElementcollectiontreadonly_propmethodname:js_stringtpropendclasstypescriptElement=objectinheritelementmethodtext:js_stringtpropmethodcharset:js_stringtpropmethoddefer:booltpropmethodsrc:js_stringtpropmethod_type:js_stringtpropmethodasync:booltpropendclasstypeembedElement=objectinheritelementmethodsrc:js_stringtpropmethodheight:js_stringtpropmethodwidth:js_stringtpropmethod_type:js_stringtpropendclasstypetableCellElement=objectinheritelementmethodcellIndex:intreadonly_propmethodabbr:js_stringtpropmethodalign:js_stringtpropmethodaxis:js_stringtpropmethodch:js_stringtpropmethodchOff:js_stringtpropmethodcolSpan:intpropmethodheaders:js_stringtpropmethodrowSpan:intpropmethodscope:js_stringtpropmethodvAlign:js_stringtpropendclasstypetableRowElement=objectinheritelementmethodrowIndex:intreadonly_propmethodsectionRowIndex:intreadonly_propmethodcells:tableCellElementcollectiontreadonly_propmethodalign:js_stringtpropmethodch:js_stringtpropmethodchOff:js_stringtpropmethodvAlign:js_stringtpropmethodinsertCell:int->tableCellElementtmethmethoddeleteCell:int->unitmethendclasstypetableColElement=objectinheritelementmethodalign:js_stringtpropmethodch:js_stringtpropmethodchOff:js_stringtpropmethodspan:intpropmethodvAlign:js_stringtpropmethodwidth:js_stringtpropendclasstypetableSectionElement=objectinheritelementmethodalign:js_stringtpropmethodch:js_stringtpropmethodchOff:js_stringtpropmethodvAlign:js_stringtpropmethodrows:tableRowElementcollectiontreadonly_propmethodinsertRow:int->tableRowElementtmethmethoddeleteRow:int->unitmethendclasstypetableCaptionElement=elementclasstypetableElement=objectinheritelementmethodcaption:tableCaptionElementtpropmethodtHead:tableSectionElementtpropmethodtFoot:tableSectionElementtpropmethodrows:tableRowElementcollectiontreadonly_propmethodtBodies:tableSectionElementcollectiontreadonly_propmethodalign:js_stringtpropmethodborder:js_stringtpropmethodcellPadding:js_stringtpropmethodcellSpacing:js_stringtpropmethodframe:js_stringtpropmethodrules:js_stringtpropmethodsummary:js_stringtpropmethodwidth:js_stringtpropmethodcreateTHead:tableSectionElementtmethmethoddeleteTHead:unitmethmethodcreateTFoot:tableSectionElementtmethmethoddeleteTFoot:unitmethmethodcreateCaption:tableCaptionElementtmethmethoddeleteCaption:unitmethmethodinsertRow:int->tableRowElementtmethmethoddeleteRow:int->unitmethendclasstypetimeRanges=objectmethodlength:intreadonly_propmethodstart:int->number_tmethmethodend_:int->number_tmethendtypenetworkState=|NETWORK_EMPTY|NETWORK_IDLE|NETWORK_LOADING|NETWORK_NO_SOURCEtypereadyState=|HAVE_NOTHING|HAVE_METADATA|HAVE_CURRENT_DATA|HAVE_FUTURE_DATA|HAVE_ENOUGH_DATA(* http://www.w3schools.com/tags/ref_av_dom.asp *)(* only features supported by all browser. (IE9+) *)classtypemediaElement=objectinheritelementmethodcanPlayType:js_stringt->js_stringtmethmethodload:unitmethmethodplay:unitmethmethodpause:unitmethmethodautoplay:booltpropmethodbuffered:timeRangestreadonly_propmethodcontrols:booltpropmethodcurrentSrc:js_stringtreadonly_propmethodcurrentTime:number_tpropmethodduration:number_treadonly_propmethodended:booltreadonly_propmethodloop:booltpropmethodmediagroup:js_stringtpropmethodmuted:booltpropmethodnetworkState_int:intreadonly_propmethodnetworkState:networkStatereadonly_propmethodpaused:booltreadonly_propmethodplaybackRate:number_tpropmethodplayed:timeRangestreadonly_propmethodpreload:js_stringtpropmethodreadyState_int:intreadonly_propmethodreadyState:readyStatereadonly_propmethodseekable:timeRangestreadonly_propmethodseeking:booltreadonly_propmethodsrc:js_stringtpropmethodvolume:number_tpropmethodoncanplay:('selft,mediaEventt)event_listenerwriteonly_propmethodoncanplaythrough:('selft,mediaEventt)event_listenerwriteonly_propmethodondurationchange:('selft,mediaEventt)event_listenerwriteonly_propmethodonemptied:('selft,mediaEventt)event_listenerwriteonly_propmethodonended:('selft,mediaEventt)event_listenerwriteonly_propmethodonloadeddata:('selft,mediaEventt)event_listenerwriteonly_propmethodonloadedmetadata:('selft,mediaEventt)event_listenerwriteonly_propmethodonloadstart:('selft,mediaEventt)event_listenerwriteonly_propmethodonpause:('selft,mediaEventt)event_listenerwriteonly_propmethodonplay:('selft,mediaEventt)event_listenerwriteonly_propmethodonplaying:('selft,mediaEventt)event_listenerwriteonly_propmethodonratechange:('selft,mediaEventt)event_listenerwriteonly_propmethodonseeked:('selft,mediaEventt)event_listenerwriteonly_propmethodonseeking:('selft,mediaEventt)event_listenerwriteonly_propmethodonstalled:('selft,mediaEventt)event_listenerwriteonly_propmethodonsuspend:('selft,mediaEventt)event_listenerwriteonly_propmethodonvolumechange:('selft,mediaEventt)event_listenerwriteonly_propmethodonwaiting:('selft,mediaEventt)event_listenerwriteonly_propendclasstypeaudioElement=objectinheritmediaElementendclasstypevideoElement=objectinheritmediaElementendtypecontext=js_stringtlet_2d_=Js.string"2d"typecanvasPatternclasstypecanvasElement=objectinheritelementmethodwidth:intpropmethodheight:intpropmethodtoDataURL:js_stringtmethmethodtoDataURL_type:js_stringt->js_stringtmethmethodtoDataURL_type_compression:js_stringt->number_t->js_stringtmethmethodgetContext:js_stringt->canvasRenderingContext2DtmethendandcanvasRenderingContext2D=objectmethodcanvas:canvasElementtreadonly_propmethodsave:unitmethmethodrestore:unitmethmethodscale:number_t->number_t->unitmethmethodrotate:number_t->unitmethmethodtranslate:number_t->number_t->unitmethmethodtransform:number_t->number_t->number_t->number_t->number_t->number_t->unitmethmethodsetTransform:number_t->number_t->number_t->number_t->number_t->number_t->unitmethmethodglobalAlpha:number_tpropmethodglobalCompositeOperation:js_stringtpropmethodstrokeStyle:js_stringtwriteonly_propmethodstrokeStyle_gradient:canvasGradienttwriteonly_propmethodstrokeStyle_pattern:canvasPatterntwriteonly_propmethodfillStyle:js_stringtwriteonly_propmethodfillStyle_gradient:canvasGradienttwriteonly_propmethodfillStyle_pattern:canvasPatterntwriteonly_propmethodcreateLinearGradient:number_t->number_t->number_t->number_t->canvasGradienttmethmethodcreateRadialGradient:number_t->number_t->number_t->number_t->number_t->number_t->canvasGradienttmethmethodcreatePattern:imageElementt->js_stringt->canvasPatterntmethmethodcreatePattern_fromCanvas:canvasElementt->js_stringt->canvasPatterntmethmethodcreatePattern_fromVideo:videoElementt->js_stringt->canvasPatterntmethmethodlineWidth:number_tpropmethodlineCap:js_stringtpropmethodlineJoin:js_stringtpropmethodmiterLimit:number_tpropmethodshadowOffsetX:number_tpropmethodshadowOffsetY:number_tpropmethodshadowBlur:number_tpropmethodshadowColor:js_stringtpropmethodclearRect:number_t->number_t->number_t->number_t->unitmethmethodfillRect:number_t->number_t->number_t->number_t->unitmethmethodstrokeRect:number_t->number_t->number_t->number_t->unitmethmethodbeginPath:unitmethmethodclosePath:unitmethmethodmoveTo:number_t->number_t->unitmethmethodlineTo:number_t->number_t->unitmethmethodquadraticCurveTo:number_t->number_t->number_t->number_t->unitmethmethodbezierCurveTo:number_t->number_t->number_t->number_t->number_t->number_t->unitmethmethodarcTo:number_t->number_t->number_t->number_t->number_t->unitmethmethodrect:number_t->number_t->number_t->number_t->unitmethmethodarc:number_t->number_t->number_t->number_t->number_t->boolt->unitmethmethodellipse:number_t->number_t->number_t->number_t->number_t->number_t->number_t->boolt->unitmethmethodfill:unitmethmethodstroke:unitmethmethodclip:unitmethmethodisPointInPath:number_t->number_t->booltmethmethoddrawFocusRing:#elementt->number_t->number_t->boolt->booltmethmethodfont:js_stringtpropmethodtextAlign:js_stringtpropmethodtextBaseline:js_stringtpropmethodfillText:js_stringt->number_t->number_t->unitmethmethodfillText_withWidth:js_stringt->number_t->number_t->number_t->unitmethmethodstrokeText:js_stringt->number_t->number_t->unitmethmethodstrokeText_withWidth:js_stringt->number_t->number_t->number_t->unitmethmethodmeasureText:js_stringt->textMetricstmethmethoddrawImage:imageElementt->number_t->number_t->unitmethmethoddrawImage_withSize:imageElementt->number_t->number_t->number_t->number_t->unitmethmethoddrawImage_full:imageElementt->number_t->number_t->number_t->number_t->number_t->number_t->number_t->number_t->unitmethmethoddrawImage_fromCanvas:canvasElementt->number_t->number_t->unitmethmethoddrawImage_fromCanvasWithSize:canvasElementt->number_t->number_t->number_t->number_t->unitmethmethoddrawImage_fullFromCanvas:canvasElementt->number_t->number_t->number_t->number_t->number_t->number_t->number_t->number_t->unitmethmethoddrawImage_fromVideoWithVideo:videoElementt->number_t->number_t->unitmethmethoddrawImage_fromVideoWithSize:videoElementt->number_t->number_t->number_t->number_t->unitmethmethoddrawImage_fullFromVideo:videoElementt->number_t->number_t->number_t->number_t->number_t->number_t->number_t->number_t->unitmethmethodcreateImageData:int->int->imageDatatmethmethodgetImageData:number_t->number_t->number_t->number_t->imageDatatmethmethodputImageData:imageDatat->number_t->number_t->unitmethendandcanvasGradient=objectmethodaddColorStop:number_t->js_stringt->unitmethendandtextMetrics=objectmethodwidth:number_treadonly_propendandimageData=objectmethodwidth:intreadonly_propmethodheight:intreadonly_propmethoddata:canvasPixelArraytreadonly_propendandcanvasPixelArray=objectmethodlength:intreadonly_propendexternalpixel_get:canvasPixelArrayt->int->int="caml_js_get"externalpixel_set:canvasPixelArrayt->int->int->unit="caml_js_set"classtyperange=objectmethodcollapsed:booltreadonly_propmethodstartOffset:intreadonly_propmethodendOffset:intreadonly_propmethodstartContainer:Dom.nodetreadonly_propmethodendContainer:Dom.nodetreadonly_propmethodsetStart:Dom.nodet->int->unitmethmethodsetEnd:Dom.nodet->int->unitmethmethodsetStartBefore:Dom.nodet->unitmethmethodsetEndBefore:Dom.nodet->unitmethmethodsetStartAfter:Dom.nodet->unitmethmethodsetEndAfter:Dom.nodet->unitmethmethodselectNode:Dom.nodet->unitmethmethodselectNodeContents:Dom.nodet->unitmethmethodcollapse:boolt->unitmethmethodcloneContents:Dom.documentFragmenttmethmethodextractContents:Dom.documentFragmenttmethmethoddeleteContents:unitmethmethodinsertNode:Dom.nodet->unitmethmethodsurroundContents:Dom.nodet->unitmethmethodcloneRange:rangetmethmethodtoString:js_stringtmethend(** Information on current selection *)classtypeselection=objectmethodanchorNode:Dom.nodetreadonly_propmethodanchorOffset:intreadonly_propmethodfocusNode:Dom.nodetreadonly_propmethodfocusOffset:intreadonly_propmethodisCollapsed:booltreadonly_propmethodrangeCount:intreadonly_propmethodgetRangeAt:int->rangetmethmethodcollapse:boolt->unitmethmethodextend:Dom.nodet->int->unitmethmethodmodify:js_stringt->js_stringt->js_stringt->unitmethmethodcollapseToStart:unitmethmethodcollapseToEnd:unitmethmethodselectAllChildren:Dom.nodet->unitmethmethodaddRange:ranget->unitmethmethodremoveRange:ranget->unitmethmethodremoveAllRanges:unitmethmethoddeleteFromDocument:unitmethmethodcontainsNode:Dom.nodet->boolt->booltmethmethodtoString:js_stringtmethendclasstypedocument=objectinherit[element]Dom.documentinheritnodeSelectorinheriteventTargetmethodtitle:js_stringtpropmethodreferrer:js_stringtreadonly_propmethoddomain:js_stringtpropmethod_URL:js_stringtreadonly_propmethodhead:headElementtpropmethodbody:bodyElementtpropmethoddocumentElement:htmlElementtreadonly_propmethodimages:imageElementcollectiontreadonly_propmethodapplets:elementcollectiontreadonly_propmethodlinks:elementcollectiontreadonly_propmethodforms:formElementcollectiontreadonly_propmethodanchors:elementcollectiontreadonly_propmethodcookie:js_stringtpropmethoddesignMode:js_stringtpropmethodopen_:unitmethmethodclose:unitmethmethodwrite:js_stringt->unitmethmethodexecCommand:js_stringt->boolt->js_stringtopt->unitmethmethodcreateRange:rangetmethmethodreadyState:js_stringtreadonly_propmethodgetElementsByClassName:js_stringt->elementDom.nodeListtmethmethodgetElementsByName:js_stringt->elementDom.nodeListtmethmethodactiveElement:elementtoptreadonly_propmethodhidden:booltreadonly_propmethodonfullscreenchange:(documentt,eventt)event_listenerwriteonly_propmethodonwebkitfullscreenchange:(documentt,eventt)event_listenerwriteonly_propinheriteventTargetendtypeinterval_idtypetimeout_idtypeanimation_frame_request_idclasstypelocation=objectmethodhref:js_stringtpropmethodprotocol:js_stringtpropmethodhost:js_stringtpropmethodhostname:js_stringtpropmethodorigin:js_stringtoptdefreadonly_propmethodport:js_stringtpropmethodpathname:js_stringtpropmethodsearch:js_stringtpropmethodhash:js_stringtpropmethodassign:js_stringt->unitmethmethodreplace:js_stringt->unitmethmethodreload:unitmethendletlocation_origin(loc:locationt)=Optdef.caseloc##.origin(fun()->letprotocol=loc##.protocolinlethostname=loc##.hostnameinletport=loc##.portinifprotocol##.length=0&&hostname##.length=0thenJs.string""elseletorigin=protocol##concat_2(Js.string"//")hostnameinifport##.length>0thenorigin##concat_2(Js.string":")loc##.portelseorigin)(funo->o)classtypehistory=objectmethodlength:intreadonly_propmethodstate:Js.Unsafe.anyreadonly_propmethodgo:intopt->unitmethmethodback:unitmethmethodforward:unitmethmethodpushState:'a.'a->js_stringt->js_stringtopt->unitmethmethodreplaceState:'a.'a->js_stringt->js_stringtopt->unitmethendclasstypeundoManager=objectendclasstypenavigator=objectmethodappCodeName:js_stringtreadonly_propmethodappName:js_stringtreadonly_propmethodappVersion:js_stringtreadonly_propmethodcookieEnabled:booltreadonly_propmethodonLine:booltreadonly_propmethodplatform:js_stringtreadonly_propmethodvendor:js_stringtreadonly_propmethoduserAgent:js_stringtreadonly_propmethodlanguage:js_stringtoptdefreadonly_propmethoduserLanguage:js_stringtoptdefreadonly_propmethodmaxTouchPoints:intreadonly_propendclasstypescreen=objectmethodwidth:intreadonly_propmethodheight:intreadonly_propmethodavailWidth:intreadonly_propmethodavailHeight:intreadonly_propendclasstypeapplicationCache=objectmethodstatus:intreadonly_propmethodupdate:unitmethmethodabort:unitmethmethodswapCache:unitmethmethodonchecking:(applicationCachet,eventt)event_listenerpropmethodonerror:(applicationCachet,eventt)event_listenerpropmethodonnoupdate:(applicationCachet,eventt)event_listenerpropmethodondownloading:(applicationCachet,eventt)event_listenerpropmethodonprogress:(applicationCachet,eventt)event_listenerpropmethodonupdateready:(applicationCachet,eventt)event_listenerpropmethodoncached:(applicationCachet,eventt)event_listenerpropmethodonobsolete:(applicationCachet,eventt)event_listenerpropinheriteventTargetendclasstype_URL=objectmethodcreateObjectURL:#File.blobt->js_stringtmethmethodrevokeObjectURL:js_stringt->unitmethendclasstypewindow=objectinheriteventTargetmethoddocument:documenttreadonly_propmethodapplicationCache:applicationCachetreadonly_propmethodname:js_stringtpropmethodlocation:locationtreadonly_propmethodhistory:historytreadonly_propmethodundoManager:undoManagertreadonly_propmethodnavigator:navigatortreadonly_propmethodgetSelection:selectiontmethmethodclose:unitmethmethodclosed:booltreadonly_propmethodstop:unitmethmethodfocus:unitmethmethodblur:unitmethmethodscroll:int->int->unitmethmethodscrollBy:int->int->unitmethmethodsessionStorage:storagetoptdefreadonly_propmethodlocalStorage:storagetoptdefreadonly_propmethodtop:windowtreadonly_propmethodparent:windowtreadonly_propmethodframeElement:elementtoptreadonly_propmethodopen_:js_stringt->js_stringt->js_stringtopt->windowtoptmethmethodalert:js_stringt->unitmethmethodconfirm:js_stringt->booltmethmethodprompt:js_stringt->js_stringt->js_stringtoptmethmethodprint:unitmethmethodsetInterval:(unit->unit)Js.callback->number_t->interval_idmethmethodclearInterval:interval_id->unitmethmethodsetTimeout:(unit->unit)Js.callback->number_t->timeout_idmethmethodclearTimeout:timeout_id->unitmethmethodrequestAnimationFrame:(number_t->unit)Js.callback->animation_frame_request_idmethmethodcancelAnimationFrame:animation_frame_request_id->unitmethmethodscreen:screentreadonly_propmethodinnerWidth:intreadonly_propmethodinnerHeight:intreadonly_propmethodouterWidth:intreadonly_propmethodouterHeight:intreadonly_propmethodgetComputedStyle:#elementt->cssStyleDeclarationtmethmethodgetComputedStyle_pseudoElt:#elementt->js_stringt->cssStyleDeclarationtmethmethodatob:js_stringt->js_stringtmethmethodbtoa:js_stringt->js_stringtmethmethodonload:(windowt,eventt)event_listenerpropmethodonunload:(windowt,eventt)event_listenerpropmethodonbeforeunload:(windowt,eventt)event_listenerpropmethodonblur:(windowt,focusEventt)event_listenerpropmethodonfocus:(windowt,focusEventt)event_listenerpropmethodonresize:(windowt,eventt)event_listenerpropmethodonorientationchange:(windowt,eventt)event_listenerpropmethodonpopstate:(windowt,popStateEventt)event_listenerpropmethodonhashchange:(windowt,hashChangeEventt)event_listenerpropmethodononline:(windowt,eventt)event_listenerwriteonly_propmethodonoffline:(windowt,eventt)event_listenerwriteonly_propmethod_URL:_URLtreadonly_propmethoddevicePixelRatio:number_treadonly_propendletwindow:windowt=Js.Unsafe.global(* The toplevel object *)letdocument=window##.documentletgetElementByIdid=Js.Opt.case(document##getElementById(Js.stringid))(fun()->raiseNot_found)(funpnode->pnode)letgetElementById_exnid=Js.Opt.case(document##getElementById(Js.stringid))(fun()->failwith(Printf.sprintf"getElementById_exn: %S not found"id))(funpnode->pnode)letgetElementById_optid=Js.Opt.to_option(document##getElementById(Js.stringid))letgetElementById_coerceidcoerce=Js.Opt.case(document##getElementById(Js.stringid))(fun()->None)(fune->Js.Opt.to_option(coercee))(****)classtypeframeSetElement=objectinheritelementmethodcols:js_stringtpropmethodrows:js_stringtpropendclasstypeframeElement=objectinheritelementmethodframeBorder:js_stringtpropmethodlongDesc:js_stringtpropmethodmarginHeight:js_stringtpropmethodmarginWidth:js_stringtpropmethodname:js_stringtpropmethodnoResize:booltpropmethodscrolling:js_stringtpropmethodsrc:js_stringtpropmethodcontentDocument:documenttoptreadonly_propendclasstypeiFrameElement=objectinheritelementmethodframeBorder:js_stringtpropmethodheight:js_stringtpropmethodwidth:js_stringtpropmethodlongDesc:js_stringtpropmethodmarginHeight:js_stringtpropmethodmarginWidth:js_stringtpropmethodname:js_stringtpropmethodscrolling:js_stringtpropmethodsrc:js_stringtpropmethodcontentDocument:documenttoptreadonly_propmethodcontentWindow:windowtreadonly_propend(****)(*XXX Should provide creation functions a la lablgtk... *)letopt_iterxf=matchxwith|None->()|Somev->fvletcreateElement(doc:documentt)name=doc##createElement(Js.stringname)letunsafeCreateElementdocname=Js.Unsafe.coerce(createElementdocname)letcreateElementSyntax=ref`UnknownletrecunsafeCreateElementEx?_type?namedocelt=ifPoly.(_type=None)&&Poly.(name=None)thenJs.Unsafe.coerce(createElementdocelt)elsematch!createElementSyntaxwith|`Standard->letres=Js.Unsafe.coerce(createElementdocelt)inopt_iter_type(funt->res##._type:=t);opt_itername(funn->res##.name:=n);res|`Extended->leta=new%jsJs.array_emptyinignore(a##push_2(Js.string"<")(Js.stringelt));opt_iter_type(funt->ignore(a##push_3(Js.string" type=\"")(html_escapet)(Js.string"\"")));opt_itername(funn->ignore(a##push_3(Js.string" name=\"")(html_escapen)(Js.string"\"")));ignore(a##push(Js.string">"));Js.Unsafe.coerce(doc##createElement(a##join(Js.string"")))|`Unknown->createElementSyntax:=iftryletel:inputElementJs.t=Js.Unsafe.coerce(document##createElement(Js.string"<input name=\"x\">"))inJs.equalsel##.tagName##toLowerCase(Js.string"input")&&Js.equalsel##.name(Js.string"x")with_->falsethen`Extendedelse`Standard;unsafeCreateElementEx?_type?namedoceltletcreateHtmldoc:htmlElementt=unsafeCreateElementdoc"html"letcreateHeaddoc:headElementt=unsafeCreateElementdoc"head"letcreateLinkdoc:linkElementt=unsafeCreateElementdoc"link"letcreateTitledoc:titleElementt=unsafeCreateElementdoc"title"letcreateMetadoc:metaElementt=unsafeCreateElementdoc"meta"letcreateBasedoc:baseElementt=unsafeCreateElementdoc"base"letcreateStyledoc:styleElementt=unsafeCreateElementdoc"style"letcreateBodydoc:bodyElementt=unsafeCreateElementdoc"body"letcreateFormdoc:formElementt=unsafeCreateElementdoc"form"letcreateOptgroupdoc:optGroupElementt=unsafeCreateElementdoc"optgroup"letcreateOptiondoc:optionElementt=unsafeCreateElementdoc"option"letcreateSelect?_type?namedoc:selectElementt=unsafeCreateElementEx?_type?namedoc"select"letcreateInput?_type?namedoc:inputElementt=unsafeCreateElementEx?_type?namedoc"input"letcreateTextarea?_type?namedoc:textAreaElementt=unsafeCreateElementEx?_type?namedoc"textarea"letcreateButton?_type?namedoc:buttonElementt=unsafeCreateElementEx?_type?namedoc"button"letcreateLabeldoc:labelElementt=unsafeCreateElementdoc"label"letcreateFieldsetdoc:fieldSetElementt=unsafeCreateElementdoc"fieldset"letcreateLegenddoc:legendElementt=unsafeCreateElementdoc"legend"letcreateUldoc:uListElementt=unsafeCreateElementdoc"ul"letcreateOldoc:oListElementt=unsafeCreateElementdoc"ol"letcreateDldoc:dListElementt=unsafeCreateElementdoc"dl"letcreateLidoc:liElementt=unsafeCreateElementdoc"li"letcreateDialogdoc:dialogElementt=unsafeCreateElementdoc"dialog"letcreateDivdoc:divElementt=unsafeCreateElementdoc"div"letcreateEmbeddoc:embedElementt=unsafeCreateElementdoc"embed"letcreatePdoc:paragraphElementt=unsafeCreateElementdoc"p"letcreateH1doc:headingElementt=unsafeCreateElementdoc"h1"letcreateH2doc:headingElementt=unsafeCreateElementdoc"h2"letcreateH3doc:headingElementt=unsafeCreateElementdoc"h3"letcreateH4doc:headingElementt=unsafeCreateElementdoc"h4"letcreateH5doc:headingElementt=unsafeCreateElementdoc"h5"letcreateH6doc:headingElementt=unsafeCreateElementdoc"h6"letcreateQdoc:quoteElementt=unsafeCreateElementdoc"q"letcreateBlockquotedoc:quoteElementt=unsafeCreateElementdoc"blockquote"letcreatePredoc:preElementt=unsafeCreateElementdoc"pre"letcreateBrdoc:brElementt=unsafeCreateElementdoc"br"letcreateHrdoc:hrElementt=unsafeCreateElementdoc"hr"letcreateInsdoc:modElementt=unsafeCreateElementdoc"ins"letcreateDeldoc:modElementt=unsafeCreateElementdoc"del"letcreateAdoc:anchorElementt=unsafeCreateElementdoc"a"letcreateImgdoc:imageElementt=unsafeCreateElementdoc"img"letcreateObjectdoc:objectElementt=unsafeCreateElementdoc"object"letcreateParamdoc:paramElementt=unsafeCreateElementdoc"param"letcreateMapdoc:mapElementt=unsafeCreateElementdoc"map"letcreateAreadoc:areaElementt=unsafeCreateElementdoc"area"letcreateScriptdoc:scriptElementt=unsafeCreateElementdoc"script"letcreateTabledoc:tableElementt=unsafeCreateElementdoc"table"letcreateCaptiondoc:tableCaptionElementt=unsafeCreateElementdoc"caption"letcreateColdoc:tableColElementt=unsafeCreateElementdoc"col"letcreateColgroupdoc:tableColElementt=unsafeCreateElementdoc"colgroup"letcreateTheaddoc:tableSectionElementt=unsafeCreateElementdoc"thead"letcreateTfootdoc:tableSectionElementt=unsafeCreateElementdoc"tfoot"letcreateTbodydoc:tableSectionElementt=unsafeCreateElementdoc"tbody"letcreateTrdoc:tableRowElementt=unsafeCreateElementdoc"tr"letcreateThdoc:tableCellElementt=unsafeCreateElementdoc"th"letcreateTddoc:tableCellElementt=unsafeCreateElementdoc"td"letcreateSubdoc=createElementdoc"sub"letcreateSupdoc=createElementdoc"sup"letcreateSpandoc=createElementdoc"span"letcreateTtdoc=createElementdoc"tt"letcreateIdoc=createElementdoc"i"letcreateBdoc=createElementdoc"b"letcreateBigdoc=createElementdoc"big"letcreateSmalldoc=createElementdoc"small"letcreateEmdoc=createElementdoc"em"letcreateStrongdoc=createElementdoc"strong"letcreateCitedoc=createElementdoc"cite"letcreateDfndoc=createElementdoc"dfn"letcreateCodedoc=createElementdoc"code"letcreateSampdoc=createElementdoc"samp"letcreateKbddoc=createElementdoc"kbd"letcreateVardoc=createElementdoc"var"letcreateAbbrdoc=createElementdoc"abbr"letcreateDddoc=createElementdoc"dd"letcreateDtdoc=createElementdoc"dt"letcreateNoscriptdoc=createElementdoc"noscript"letcreateAddressdoc=createElementdoc"address"letcreateFramesetdoc:frameSetElementt=unsafeCreateElementdoc"frameset"letcreateFramedoc:frameElementt=unsafeCreateElementdoc"frame"letcreateIframedoc:iFrameElementt=unsafeCreateElementdoc"iframe"letcreateAudiodoc:audioElementt=unsafeCreateElementdoc"audio"letcreateVideodoc:audioElementt=unsafeCreateElementdoc"video"exceptionCanvas_not_availableletcreateCanvasdoc:canvasElementt=letc=unsafeCreateElementdoc"canvas"inifnot(Opt.testc##.getContext)thenraiseCanvas_not_available;clethtml_element:htmlElementtconstr=Js.Unsafe.global##._HTMLElementmoduleCoerceTo=structletelement:#Dom.nodeJs.t->elementJs.tJs.opt=ifnot(Js.Optdef.test(defhtml_element))then(* ie < 9 does not have HTMLElement: we have to cheat to check
that something is an html element *)fune->ifnot(Js.Optdef.test(def(Js.Unsafe.coercee)##.innerHTML))thenJs.nullelseJs.some(Js.Unsafe.coercee)elsefune->ifJs.instanceofehtml_elementthenJs.some(Js.Unsafe.coercee)elseJs.nullletunsafeCoercetag(e:#elementt)=ifJs.equalse##.tagName##toLowerCase(Js.stringtag)thenJs.some(Js.Unsafe.coercee)elseJs.nullletae=unsafeCoerce"a"eletareae=unsafeCoerce"area"eletbasee=unsafeCoerce"base"eletblockquotee=unsafeCoerce"blockquote"eletbodye=unsafeCoerce"body"eletbre=unsafeCoerce"br"eletbuttone=unsafeCoerce"button"eletcanvase=unsafeCoerce"canvas"eletcaptione=unsafeCoerce"caption"eletcole=unsafeCoerce"col"eletcolgroupe=unsafeCoerce"colgroup"eletdele=unsafeCoerce"del"eletdetailse=unsafeCoerce"details"eletdive=unsafeCoerce"div"eletdle=unsafeCoerce"dl"eletfieldsete=unsafeCoerce"fieldset"eletembede=unsafeCoerce"embed"eletforme=unsafeCoerce"form"eletframesete=unsafeCoerce"frameset"eletframee=unsafeCoerce"frame"eleth1e=unsafeCoerce"h1"eleth2e=unsafeCoerce"h2"eleth3e=unsafeCoerce"h3"eleth4e=unsafeCoerce"h4"eleth5e=unsafeCoerce"h5"eleth6e=unsafeCoerce"h6"eletheade=unsafeCoerce"head"elethre=unsafeCoerce"hr"elethtmle=unsafeCoerce"html"eletiframee=unsafeCoerce"iframe"eletimge=unsafeCoerce"img"eletinpute=unsafeCoerce"input"eletinse=unsafeCoerce"ins"eletlabele=unsafeCoerce"label"eletlegende=unsafeCoerce"legend"eletlie=unsafeCoerce"li"eletlinke=unsafeCoerce"link"eletmape=unsafeCoerce"map"eletmetae=unsafeCoerce"meta"elet_objecte=unsafeCoerce"object"eletole=unsafeCoerce"ol"eletoptgroupe=unsafeCoerce"optgroup"eletoptione=unsafeCoerce"option"eletpe=unsafeCoerce"p"eletparame=unsafeCoerce"param"eletpree=unsafeCoerce"pre"eletqe=unsafeCoerce"q"eletscripte=unsafeCoerce"script"eletselecte=unsafeCoerce"select"eletstylee=unsafeCoerce"style"elettablee=unsafeCoerce"table"elettbodye=unsafeCoerce"tbody"elettde=unsafeCoerce"td"elettextareae=unsafeCoerce"textarea"elettfoote=unsafeCoerce"tfoot"eletthe=unsafeCoerce"th"elettheade=unsafeCoerce"thead"elettitlee=unsafeCoerce"title"elettre=unsafeCoerce"tr"eletule=unsafeCoerce"ul"eletaudioe=unsafeCoerce"audio"eletvideoe=unsafeCoerce"video"eletunsafeCoerceEventconstr(ev:#eventt)=ifJs.Optdef.test(defconstr)&&Js.instanceofevconstrthenJs.some(Js.Unsafe.coerceev)elseJs.nullletmouseEventev=unsafeCoerceEventJs.Unsafe.global##._MouseEventevletkeyboardEventev=unsafeCoerceEventJs.Unsafe.global##._KeyboardEventevletwheelEventev=unsafeCoerceEventJs.Unsafe.global##._WheelEventevletmouseScrollEventev=unsafeCoerceEventJs.Unsafe.global##._MouseScrollEventevletpopStateEventev=unsafeCoerceEventJs.Unsafe.global##._PopStateEventevletmessageEventev=unsafeCoerceEventJs.Unsafe.global##._MessageEventevend(****)leteventTarget=Dom.eventTargetleteventRelatedTarget(e:#mouseEventt)=Optdef.gete##.relatedTarget(fun()->matchJs.to_stringe##._typewith|"mouseover"->Optdef.gete##.fromElement(fun()->assertfalse)|"mouseout"->Optdef.gete##.toElement(fun()->assertfalse)|_->Js.null)leteventAbsolutePosition'(e:#mouseEventt)=letbody=document##.bodyinlethtml=document##.documentElementin(e##.clientX+body##.scrollLeft+html##.scrollLeft,e##.clientY+body##.scrollTop+html##.scrollTop)leteventAbsolutePosition(e:#mouseEventt)=Optdef.casee##.pageX(fun()->eventAbsolutePosition'e)(funx->Optdef.casee##.pageY(fun()->eventAbsolutePosition'e)(funy->x,y))letelementClientPosition(e:#elementt)=letr=e##getBoundingClientRectinletbody=document##.bodyinlethtml=document##.documentElementin(truncate(Js.to_floatr##.left)-body##.clientLeft-html##.clientLeft,truncate(Js.to_floatr##.top)-body##.clientTop-html##.clientTop)letgetDocumentScroll()=letbody=document##.bodyinlethtml=document##.documentElementinbody##.scrollLeft+html##.scrollLeft,body##.scrollTop+html##.scrollTopletbuttonPressed(ev:#mouseEventJs.t)=Js.Optdef.caseev##.which(fun()->matchev##.buttonwith|1->Left_button|2->Right_button|4->Middle_button|_->No_button)(funx->x)letaddMousewheelEventListenerWithOptionse?capture?once?passiveh=addEventListenerWithOptions?capture?once?passiveeEvent.wheel(handler(fun(e:mousewheelEventt)->letdx=-Optdef.gete##.wheelDeltaX(fun()->0)/40inletdy=-Optdef.gete##.wheelDeltaY(fun()->e##.wheelDelta)/40inh(e:>mouseEventt)~dx~dy))letaddMousewheelEventListenerehcapt=addMousewheelEventListenerWithOptions~capture:capteh(*****)moduleKeyboard_code=structtypet=|Unidentified(* Alphabetic Characters *)|KeyA|KeyB|KeyC|KeyD|KeyE|KeyF|KeyG|KeyH|KeyI|KeyJ|KeyK|KeyL|KeyM|KeyN|KeyO|KeyP|KeyQ|KeyR|KeyS|KeyT|KeyU|KeyV|KeyW|KeyX|KeyY|KeyZ(* Digits *)|Digit0|Digit1|Digit2|Digit3|Digit4|Digit5|Digit6|Digit7|Digit8|Digit9|Minus|Equal(* Whitespace *)|Tab|Enter|Space(* Editing *)|Escape|Backspace|Insert|Delete|CapsLock(* Misc Printable *)|BracketLeft|BracketRight|Semicolon|Quote|Backquote|Backslash|Comma|Period|Slash(* Function keys *)|F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12(* Numpad keys *)|Numpad0|Numpad1|Numpad2|Numpad3|Numpad4|Numpad5|Numpad6|Numpad7|Numpad8|Numpad9|NumpadMultiply|NumpadSubtract|NumpadAdd|NumpadDecimal|NumpadEqual|NumpadEnter|NumpadDivide|NumLock(* Modifier keys *)|ControlLeft|ControlRight|MetaLeft|MetaRight|ShiftLeft|ShiftRight|AltLeft|AltRight(* Arrow keys *)|ArrowLeft|ArrowRight|ArrowUp|ArrowDown(* Navigation *)|PageUp|PageDown|Home|End(* Sound *)|VolumeMute|VolumeDown|VolumeUp(* Media *)|MediaTrackPrevious|MediaTrackNext|MediaPlayPause|MediaStop(* Browser special *)|ContextMenu|BrowserSearch|BrowserHome|BrowserFavorites|BrowserRefresh|BrowserStop|BrowserForward|BrowserBack(* Misc *)|OSLeft|OSRight|ScrollLock|PrintScreen|IntlBackslash|IntlYen|Pauselettry_codev=matchJs.to_stringvwith(* Alphabetic Characters *)|"KeyA"->KeyA|"KeyB"->KeyB|"KeyC"->KeyC|"KeyD"->KeyD|"KeyE"->KeyE|"KeyF"->KeyF|"KeyG"->KeyG|"KeyH"->KeyH|"KeyI"->KeyI|"KeyJ"->KeyJ|"KeyK"->KeyK|"KeyL"->KeyL|"KeyM"->KeyM|"KeyN"->KeyN|"KeyO"->KeyO|"KeyP"->KeyP|"KeyQ"->KeyQ|"KeyR"->KeyR|"KeyS"->KeyS|"KeyT"->KeyT|"KeyU"->KeyU|"KeyV"->KeyV|"KeyW"->KeyW|"KeyX"->KeyX|"KeyY"->KeyY|"KeyZ"->KeyZ(* Digits *)|"Digit0"->Digit0|"Digit1"->Digit1|"Digit2"->Digit2|"Digit3"->Digit3|"Digit4"->Digit4|"Digit5"->Digit5|"Digit6"->Digit6|"Digit7"->Digit7|"Digit8"->Digit8|"Digit9"->Digit9|"Minus"->Minus|"Equal"->Equal(* Whitespace *)|"Tab"->Tab|"Enter"->Enter|"Space"->Space(* Editing *)|"Escape"->Escape|"Backspace"->Backspace|"Insert"->Insert|"Delete"->Delete|"CapsLock"->CapsLock(* Misc Printable *)|"BracketLeft"->BracketLeft|"BracketRight"->BracketRight|"Semicolon"->Semicolon|"Quote"->Quote|"Backquote"->Backquote|"Backslash"->Backslash|"Comma"->Comma|"Period"->Period|"Slash"->Slash(* Function keys *)|"F1"->F1|"F2"->F2|"F3"->F3|"F4"->F4|"F5"->F5|"F6"->F6|"F7"->F7|"F8"->F8|"F9"->F9|"F10"->F10|"F11"->F11|"F12"->F12(* Numpad keys *)|"Numpad0"->Numpad0|"Numpad1"->Numpad1|"Numpad2"->Numpad2|"Numpad3"->Numpad3|"Numpad4"->Numpad4|"Numpad5"->Numpad5|"Numpad6"->Numpad6|"Numpad7"->Numpad7|"Numpad8"->Numpad8|"Numpad9"->Numpad9|"NumpadMultiply"->NumpadMultiply|"NumpadSubtract"->NumpadSubtract|"NumpadAdd"->NumpadAdd|"NumpadDecimal"->NumpadDecimal|"NumpadEqual"->NumpadEqual|"NumpadEnter"->NumpadEnter|"NumpadDivide"->NumpadDivide|"NumLock"->NumLock(* Modifier keys *)|"ControlLeft"->ControlLeft|"ControlRight"->ControlRight|"MetaLeft"->MetaLeft|"MetaRight"->MetaRight|"ShiftLeft"->ShiftLeft|"ShiftRight"->ShiftRight|"AltLeft"->AltLeft|"AltRight"->AltRight(* Arrow keys *)|"ArrowLeft"->ArrowLeft|"ArrowRight"->ArrowRight|"ArrowUp"->ArrowUp|"ArrowDown"->ArrowDown(* Navigation *)|"PageUp"->PageUp|"PageDown"->PageDown|"Home"->Home|"End"->End(* Sound *)|"VolumeMute"->VolumeMute|"VolumeDown"->VolumeDown|"VolumeUp"->VolumeUp(* Media *)|"MediaTrackPrevious"->MediaTrackPrevious|"MediaTrackNext"->MediaTrackNext|"MediaPlayPause"->MediaPlayPause|"MediaStop"->MediaStop(* Browser special *)|"ContextMenu"->ContextMenu|"BrowserSearch"->BrowserSearch|"BrowserHome"->BrowserHome|"BrowserFavorites"->BrowserFavorites|"BrowserRefresh"->BrowserRefresh|"BrowserStop"->BrowserStop|"BrowserForward"->BrowserForward|"BrowserBack"->BrowserBack(* Misc *)|"OSLeft"->OSLeft|"OSRight"->OSRight|"ScrollLock"->ScrollLock|"PrintScreen"->PrintScreen|"IntlBackslash"->IntlBackslash|"IntlYen"->IntlYen|"Pause"->Pause|_->Unidentifiedlettry_key_code_left=function|16->ShiftLeft|17->ControlLeft|18->AltLeft|91->MetaLeft|_->Unidentifiedlettry_key_code_right=function|16->ShiftRight|17->ControlRight|18->AltRight|91->MetaRight|_->Unidentifiedlettry_key_code_numpad=function|46->NumpadDecimal|45->Numpad0|35->Numpad1|40->Numpad2|34->Numpad3|37->Numpad4|12->Numpad5|39->Numpad6|36->Numpad7|38->Numpad8|33->Numpad9|13->NumpadEnter|111->NumpadDivide|107->NumpadAdd|109->NumpadSubtract|106->NumpadMultiply|110->NumpadDecimal|96->Numpad0|97->Numpad1|98->Numpad2|99->Numpad3|100->Numpad4|101->Numpad5|102->Numpad6|103->Numpad7|104->Numpad8|105->Numpad9|_->Unidentifiedlettry_key_code_normal=function|27->Escape|112->F1|113->F2|114->F3|115->F4|116->F5|117->F6|118->F7|119->F8|120->F9|121->F10|122->F11|123->F12|42->PrintScreen|145->ScrollLock|19->Pause|192->Backquote|49->Digit1|50->Digit2|51->Digit3|52->Digit4|53->Digit5|54->Digit6|55->Digit7|56->Digit8|57->Digit9|48->Digit0|189->Minus|187->Equal|8->Backspace|9->Tab|81->KeyQ|87->KeyW|69->KeyE|82->KeyR|84->KeyT|89->KeyY|85->KeyU|73->KeyI|79->KeyO|80->KeyP|219->BracketLeft|221->BracketRight|220->Backslash|20->CapsLock|65->KeyA|83->KeyS|68->KeyD|70->KeyF|71->KeyG|72->KeyH|74->KeyJ|75->KeyK|76->KeyL|186->Semicolon|222->Quote|13->Enter|90->KeyZ|88->KeyX|67->KeyC|86->KeyV|66->KeyB|78->KeyN|77->KeyM|188->Comma|190->Period|191->Slash|32->Space|93->ContextMenu|45->Insert|36->Home|33->PageUp|46->Delete|35->End|34->PageDown|37->ArrowLeft|40->ArrowDown|39->ArrowRight|38->ArrowUp|_->Unidentifiedletmake_unidentified_=Unidentifiedlettry_nextvaluef=function|Unidentified->Optdef.casevaluemake_unidentifiedf|v->vletrun_nextvaluef=function|Unidentified->fvalue|v->vletget_key_codeevt=evt##.keyCodelettry_key_locationevt=matchevt##.locationwith|1->run_next(get_key_codeevt)try_key_code_left|2->run_next(get_key_codeevt)try_key_code_right|3->run_next(get_key_codeevt)try_key_code_numpad|_->make_unidentifiedlet(|>)xf=fxletof_eventevt=Unidentified|>try_nextevt##.codetry_code|>try_key_locationevt|>run_next(get_key_codeevt)try_key_code_normalletof_key_code=try_key_code_normalendmoduleKeyboard_key=structtypet=Uchar.toptionletchar_of_intvalue=if0<valuethentrySome(Uchar.of_intvalue)with_->NoneelseNoneletempty_string_=Js.string""letnone_=Noneletof_eventevt=letkey=Optdef.getevt##.keyempty_stringinmatchkey##.lengthwith|0->Optdef.caseevt##.charCodenonechar_of_int|1->char_of_int(int_of_float(Js.to_float(key##charCodeAt0)))|_->Noneend(*****)letelement:#Dom.elementt->elementt=Js.Unsafe.coercetypetaggedElement=|AofanchorElementt|AreaofareaElementt|AudioofaudioElementt|BaseofbaseElementt|BlockquoteofquoteElementt|BodyofbodyElementt|BrofbrElementt|ButtonofbuttonElementt|CanvasofcanvasElementt|CaptionoftableCaptionElementt|ColoftableColElementt|ColgroupoftableColElementt|DelofmodElementt|DialogofdialogElementt|DivofdivElementt|DlofdListElementt|EmbedofembedElementt|FieldsetoffieldSetElementt|FormofformElementt|FramesetofframeSetElementt|FrameofframeElementt|H1ofheadingElementt|H2ofheadingElementt|H3ofheadingElementt|H4ofheadingElementt|H5ofheadingElementt|H6ofheadingElementt|HeadofheadElementt|HrofhrElementt|HtmlofhtmlElementt|IframeofiFrameElementt|ImgofimageElementt|InputofinputElementt|InsofmodElementt|LabeloflabelElementt|LegendoflegendElementt|LiofliElementt|LinkoflinkElementt|MapofmapElementt|MetaofmetaElementt|ObjectofobjectElementt|OlofoListElementt|OptgroupofoptGroupElementt|OptionofoptionElementt|PofparagraphElementt|ParamofparamElementt|PreofpreElementt|QofquoteElementt|ScriptofscriptElementt|SelectofselectElementt|StyleofstyleElementt|TableoftableElementt|TbodyoftableSectionElementt|TdoftableCellElementt|TextareaoftextAreaElementt|TfootoftableSectionElementt|ThoftableCellElementt|TheadoftableSectionElementt|TitleoftitleElementt|TroftableRowElementt|UlofuListElementt|VideoofvideoElementt|Otherofelementtletothere=Other(e:#elementt:>elementt)lettagged(e:#elementt)=lettag=Js.to_bytestringe##.tagName##toLowerCaseinifString.lengthtag=0thenothereelsematchString.unsafe_gettag0with|'a'->(matchtagwith|"a"->A(Js.Unsafe.coercee)|"area"->Area(Js.Unsafe.coercee)|"audio"->Audio(Js.Unsafe.coercee)|_->othere)|'b'->(matchtagwith|"base"->Base(Js.Unsafe.coercee)|"blockquote"->Blockquote(Js.Unsafe.coercee)|"body"->Body(Js.Unsafe.coercee)|"br"->Br(Js.Unsafe.coercee)|"button"->Button(Js.Unsafe.coercee)|_->othere)|'c'->(matchtagwith|"canvas"->Canvas(Js.Unsafe.coercee)|"caption"->Caption(Js.Unsafe.coercee)|"col"->Col(Js.Unsafe.coercee)|"colgroup"->Colgroup(Js.Unsafe.coercee)|_->othere)|'d'->(matchtagwith|"del"->Del(Js.Unsafe.coercee)|"div"->Div(Js.Unsafe.coercee)|"dl"->Dl(Js.Unsafe.coercee)|_->othere)|'e'->(matchtagwith|"embed"->Embed(Js.Unsafe.coercee)|_->othere)|'f'->(matchtagwith|"fieldset"->Fieldset(Js.Unsafe.coercee)|"form"->Form(Js.Unsafe.coercee)|"frameset"->Frameset(Js.Unsafe.coercee)|"frame"->Frame(Js.Unsafe.coercee)|_->othere)|'h'->(matchtagwith|"h1"->H1(Js.Unsafe.coercee)|"h2"->H2(Js.Unsafe.coercee)|"h3"->H3(Js.Unsafe.coercee)|"h4"->H4(Js.Unsafe.coercee)|"h5"->H5(Js.Unsafe.coercee)|"h6"->H6(Js.Unsafe.coercee)|"head"->Head(Js.Unsafe.coercee)|"hr"->Hr(Js.Unsafe.coercee)|"html"->Html(Js.Unsafe.coercee)|_->othere)|'i'->(matchtagwith|"iframe"->Iframe(Js.Unsafe.coercee)|"img"->Img(Js.Unsafe.coercee)|"input"->Input(Js.Unsafe.coercee)|"ins"->Ins(Js.Unsafe.coercee)|_->othere)|'l'->(matchtagwith|"label"->Label(Js.Unsafe.coercee)|"legend"->Legend(Js.Unsafe.coercee)|"li"->Li(Js.Unsafe.coercee)|"link"->Link(Js.Unsafe.coercee)|_->othere)|'m'->(matchtagwith|"map"->Map(Js.Unsafe.coercee)|"meta"->Meta(Js.Unsafe.coercee)|_->othere)|'o'->(matchtagwith|"object"->Object(Js.Unsafe.coercee)|"ol"->Ol(Js.Unsafe.coercee)|"optgroup"->Optgroup(Js.Unsafe.coercee)|"option"->Option(Js.Unsafe.coercee)|_->othere)|'p'->(matchtagwith|"p"->P(Js.Unsafe.coercee)|"param"->Param(Js.Unsafe.coercee)|"pre"->Pre(Js.Unsafe.coercee)|_->othere)|'q'->(matchtagwith|"q"->Q(Js.Unsafe.coercee)|_->othere)|'s'->(matchtagwith|"script"->Script(Js.Unsafe.coercee)|"select"->Select(Js.Unsafe.coercee)|"style"->Style(Js.Unsafe.coercee)|_->othere)|'t'->(matchtagwith|"table"->Table(Js.Unsafe.coercee)|"tbody"->Tbody(Js.Unsafe.coercee)|"td"->Td(Js.Unsafe.coercee)|"textarea"->Textarea(Js.Unsafe.coercee)|"tfoot"->Tfoot(Js.Unsafe.coercee)|"th"->Th(Js.Unsafe.coercee)|"thead"->Thead(Js.Unsafe.coercee)|"title"->Title(Js.Unsafe.coercee)|"tr"->Tr(Js.Unsafe.coercee)|_->othere)|'u'->(matchtagwith|"ul"->Ul(Js.Unsafe.coercee)|_->othere)|'v'->(matchtagwith|"video"->Video(Js.Unsafe.coercee)|_->othere)|_->othereletopt_taggede=Opt.casee(fun()->None)(fune->Some(taggede))typetaggedEvent=|MouseEventofmouseEventt|KeyboardEventofkeyboardEventt|MessageEventofmessageEventt|MousewheelEventofmousewheelEventt|MouseScrollEventofmouseScrollEventt|PopStateEventofpopStateEventt|OtherEventofeventtlettaggedEvent(ev:#eventJs.t)=Js.Opt.case(CoerceTo.mouseEventev)(fun()->Js.Opt.case(CoerceTo.keyboardEventev)(fun()->Js.Opt.case(CoerceTo.wheelEventev)(fun()->Js.Opt.case(CoerceTo.mouseScrollEventev)(fun()->Js.Opt.case(CoerceTo.popStateEventev)(fun()->Js.Opt.case(CoerceTo.messageEventev)(fun()->OtherEvent(ev:>eventt))(funev->MessageEventev))(funev->PopStateEventev))(funev->MouseScrollEventev))(funev->MousewheelEventev))(funev->KeyboardEventev))(funev->MouseEventev)letopt_taggedEventev=Opt.caseev(fun()->None)(funev->Some(taggedEventev))letstopPropagationev=lete=Js.Unsafe.coerceevinOptdef.casee##.stopPropagation(fun()->e##.cancelBubble:=Js._true)(fun_->e##_stopPropagation)let_requestAnimationFrame:(unit->unit)Js.callback->unit=Js.Unsafe.pure_expr(fun_->letw=Js.Unsafe.coercewindowinletl=[w##.requestAnimationFrame;w##.mozRequestAnimationFrame;w##.webkitRequestAnimationFrame;w##.oRequestAnimationFrame;w##.msRequestAnimationFrame]intryletreq=List.find(func->Js.Optdef.testc)linfuncallback->Js.Unsafe.fun_callreq[|Js.Unsafe.injectcallback|]withNot_found->letnow()=Js.to_float(new%jsJs.date_now)##getTimeinletlast=ref(now())infuncallback->lett=now()inletdt=!last+.(1000./.60.)-.tinletdt=ifPoly.(dt<0.)then0.elsedtinlast:=t;ignore(window##setTimeoutcallback(Js.floatdt)))(****)lethasPushState()=Js.Optdef.test(Js.Unsafe.coercewindow##.history)##.pushStatelethasPlaceholder()=leti=createInputdocumentinJs.Optdef.test(Js.Unsafe.coercei)##.placeholderlethasRequired()=leti=createInputdocumentinJs.Optdef.test(Js.Unsafe.coercei)##.requiredletoverflow_limit=2147483_000.(* ms *)typetimeout_id_safe=timeout_idoptionrefletsetTimeoutcallbackd:timeout_id_safe=letid=refNoneinletrecloopd()=letstep,remain=ifPoly.(d>overflow_limit)thenoverflow_limit,d-.overflow_limitelsed,0.inletcb=ifPoly.(remain=0.)thencallbackelseloopremaininid:=Some(window##setTimeout(Js.wrap_callbackcb)(Js.floatstep))inloopd();idletclearTimeout(id:timeout_id_safe)=match!idwith|None->()|Somex->id:=None;window##clearTimeoutxletjs_array_of_collection(c:#elementcollectionJs.t):#elementJs.tJs.js_arrayJs.t=Js.Unsafe.(meth_call(js_expr"[].slice")"call"[|injectc|])