12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614(* 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"externaldecode_html_entities:js_stringt->js_stringt="caml_js_html_entities"classtypecssStyleDeclaration=objectmethodanimation: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_buttonclasstypeevent=objectinherit[element]Dom.eventendand['a]customEvent=objectinherit[element,'a]Dom.customEventendandfocusEvent=objectinheriteventmethodrelatedTarget:elementtoptoptdefreadonly_propendandmouseEvent=objectinheriteventmethodrelatedTarget:elementtoptoptdefreadonly_propmethodclientX:intreadonly_propmethodclientY:intreadonly_propmethodscreenX:intreadonly_propmethodscreenY: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_propmethodkeyIdentifier:js_stringtoptdefreadonly_propendandmousewheelEvent=object(* All browsers but Firefox *)inheritmouseEventmethodwheelDelta:intreadonly_propmethodwheelDeltaX:intoptdefreadonly_propmethodwheelDeltaY:intoptdefreadonly_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_propendanddragEvent=objectinheritmouseEventmethoddataTransfer:dataTransfertreadonly_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_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_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:floatJs.readonly_propmethodheight:floatJs.readonly_propmethodpressure:floatJs.readonly_propmethodtangentialPressure:floatJs.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:floatreadonly_propmethodpseudoElement:js_stringtreadonly_propendandmediaEvent=objectinheriteventendandnodeSelector=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_propmethodstyle:cssStyleDeclarationtpropmethodinnerHTML:js_stringtpropmethodouterHTML:js_stringtpropmethodtextContent:js_stringtoptpropmethodclientLeft: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:floatreadonly_propmethodright:floatreadonly_propmethodbottom:floatreadonly_propmethodleft:floatreadonly_propmethodwidth:floatoptdefreadonly_propmethodheight:floatoptdefreadonly_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.typletclick=Dom.Event.make"click"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"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"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"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"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,eventt)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=elementclasstypedivElement=elementclasstypeparagraphElement=elementclasstypeheadingElement=elementclasstypequoteElement=objectinheritelementmethodcite:js_stringtpropendclasstypepreElement=elementclasstypebrElement=elementclasstypehrElement=elementclasstypemodElement=objectinheritelementmethodcite:js_stringtpropmethoddateTime:js_stringtpropendclasstypeanchorElement=objectinheritelementmethodaccessKey:js_stringtpropmethodcharset:js_stringtpropmethodcoords:js_stringtpropmethodhref:js_stringtpropmethodhreflang:js_stringtpropmethodname:js_stringtpropmethodrel:js_stringtpropmethodrev:js_stringtpropmethodshape:js_stringtpropmethodtabIndex:intpropmethodtarget:js_stringtpropmethod_type:js_stringtpropendclasstypeimageElement=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->floatmethmethodend_:int->floatmethendtypenetworkState=|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:floatpropmethodduration:floatreadonly_propmethodended:booltreadonly_propmethodloop:booltpropmethodmediagroup:js_stringtpropmethodmuted:booltpropmethodnetworkState_int:intreadonly_propmethodnetworkState:networkStatereadonly_propmethodpaused:booltreadonly_propmethodplaybackRate:floatpropmethodplayed:timeRangestreadonly_propmethodpreload:js_stringtpropmethodreadyState_int:intreadonly_propmethodreadyState:readyStatereadonly_propmethodseekable:timeRangestreadonly_propmethodseeking:booltreadonly_propmethodsrc:js_stringtpropmethodvolume:floatpropmethodoncanplay:('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->float->js_stringtmethmethodgetContext:js_stringt->canvasRenderingContext2DtmethendandcanvasRenderingContext2D=objectmethodcanvas:canvasElementtreadonly_propmethodsave:unitmethmethodrestore:unitmethmethodscale:float->float->unitmethmethodrotate:float->unitmethmethodtranslate:float->float->unitmethmethodtransform:float->float->float->float->float->float->unitmethmethodsetTransform:float->float->float->float->float->float->unitmethmethodglobalAlpha:floatpropmethodglobalCompositeOperation:js_stringtpropmethodstrokeStyle:js_stringtwriteonly_propmethodstrokeStyle_gradient:canvasGradienttwriteonly_propmethodstrokeStyle_pattern:canvasPatterntwriteonly_propmethodfillStyle:js_stringtwriteonly_propmethodfillStyle_gradient:canvasGradienttwriteonly_propmethodfillStyle_pattern:canvasPatterntwriteonly_propmethodcreateLinearGradient:float->float->float->float->canvasGradienttmethmethodcreateRadialGradient:float->float->float->float->float->float->canvasGradienttmethmethodcreatePattern:imageElementt->js_stringt->canvasPatterntmethmethodcreatePattern_fromCanvas:canvasElementt->js_stringt->canvasPatterntmethmethodcreatePattern_fromVideo:videoElementt->js_stringt->canvasPatterntmethmethodlineWidth:floatpropmethodlineCap:js_stringtpropmethodlineJoin:js_stringtpropmethodmiterLimit:floatpropmethodshadowOffsetX:floatpropmethodshadowOffsetY:floatpropmethodshadowBlur:floatpropmethodshadowColor:js_stringtpropmethodclearRect:float->float->float->float->unitmethmethodfillRect:float->float->float->float->unitmethmethodstrokeRect:float->float->float->float->unitmethmethodbeginPath:unitmethmethodclosePath:unitmethmethodmoveTo:float->float->unitmethmethodlineTo:float->float->unitmethmethodquadraticCurveTo:float->float->float->float->unitmethmethodbezierCurveTo:float->float->float->float->float->float->unitmethmethodarcTo:float->float->float->float->float->unitmethmethodrect:float->float->float->float->unitmethmethodarc:float->float->float->float->float->boolt->unitmethmethodfill:unitmethmethodstroke:unitmethmethodclip:unitmethmethodisPointInPath:float->float->booltmethmethoddrawFocusRing:#elementt->float->float->boolt->booltmethmethodfont:js_stringtpropmethodtextAlign:js_stringtpropmethodtextBaseline:js_stringtpropmethodfillText:js_stringt->float->float->unitmethmethodfillText_withWidth:js_stringt->float->float->float->unitmethmethodstrokeText:js_stringt->float->float->unitmethmethodstrokeText_withWidth:js_stringt->float->float->float->unitmethmethodmeasureText:js_stringt->textMetricstmethmethoddrawImage:imageElementt->float->float->unitmethmethoddrawImage_withSize:imageElementt->float->float->float->float->unitmethmethoddrawImage_full:imageElementt->float->float->float->float->float->float->float->float->unitmethmethoddrawImage_fromCanvas:canvasElementt->float->float->unitmethmethoddrawImage_fromCanvasWithSize:canvasElementt->float->float->float->float->unitmethmethoddrawImage_fullFromCanvas:canvasElementt->float->float->float->float->float->float->float->float->unitmethmethoddrawImage_fromVideoWithVideo:videoElementt->float->float->unitmethmethoddrawImage_fromVideoWithSize:videoElementt->float->float->float->float->unitmethmethoddrawImage_fullFromVideo:videoElementt->float->float->float->float->float->float->float->float->unitmethmethodcreateImageData:int->int->imageDatatmethmethodgetImageData:float->float->float->float->imageDatatmethmethodputImageData:imageDatat->float->float->unitmethendandcanvasGradient=objectmethodaddColorStop:float->js_stringt->unitmethendandtextMetrics=objectmethodwidth:floatreadonly_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_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_propmethoduserAgent:js_stringtreadonly_propmethodlanguage:js_stringtoptdefreadonly_propmethoduserLanguage:js_stringtoptdefreadonly_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->float->interval_idmethmethodclearInterval:interval_id->unitmethmethodsetTimeout:(unit->unit)Js.callback->float->timeout_idmethmethodclearTimeout:timeout_id->unitmethmethodrequestAnimationFrame:(float->unit)Js.callback->animation_frame_request_idmethmethodcancelAnimationFrame:animation_frame_request_id->unitmethmethodscreen:screentreadonly_propmethodinnerWidth:intoptdefreadonly_propmethodinnerHeight:intoptdefreadonly_propmethodouterWidth:intoptdefreadonly_propmethodouterHeight:intoptdefreadonly_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:floatreadonly_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\">"))inel##.tagName##toLowerCase==Js.string"input"&&el##.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"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=ifdefhtml_element==undefinedthen(* ie < 9 does not have HTMLElement: we have to cheat to check
that something is an html element *)fune->ifdef(Js.Unsafe.coercee)##.innerHTML==undefinedthenJs.nullelseJs.some(Js.Unsafe.coercee)elsefune->ifJs.instanceofehtml_elementthenJs.some(Js.Unsafe.coercee)elseJs.nullletunsafeCoercetag(e:#elementt)=ife##.tagName##toLowerCase==Js.stringtagthenJs.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"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)=ifdefconstr!=undefined&&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##._PopStateEventevend(****)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(truncater##.left-body##.clientLeft-html##.clientLeft,truncater##.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)lethasMousewheelEvents()=letd=createDivdocumentind##setAttribute(Js.string"onmousewheel")(Js.string"return;");Js.typeof(Js.Unsafe.getd(Js.string"onmousewheel"))==Js.string"function"letaddMousewheelEventListenerWithOptionse?capture?once?passiveh=ifhasMousewheelEvents()thenaddEventListenerWithOptions?capture?once?passiveeEvent.mousewheel(handler(fun(e:mousewheelEventt)->letdx=-Optdef.gete##.wheelDeltaX(fun()->0)/40inletdy=-Optdef.gete##.wheelDeltaY(fun()->e##.wheelDelta)/40inh(e:>mouseEventt)~dx~dy))elseaddEventListenerWithOptions?capture?once?passiveeEvent._DOMMouseScroll(handler(fun(e:mouseScrollEventt)->letd=e##.detailinife##.axis==e##._HORIZONTAL_AXISthenh(e:>mouseEventt)~dx:d~dy:0elseh(e:>mouseEventt)~dx:0~dy:d))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(key##charCodeAt0))|_->Noneend(*****)letelement:#Dom.elementt->elementt=Js.Unsafe.coercetypetaggedElement=|AofanchorElementt|AreaofareaElementt|AudioofaudioElementt|BaseofbaseElementt|BlockquoteofquoteElementt|BodyofbodyElementt|BrofbrElementt|ButtonofbuttonElementt|CanvasofcanvasElementt|CaptionoftableCaptionElementt|ColoftableColElementt|ColgroupoftableColElementt|DelofmodElementt|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|PofparamElementt|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|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()->OtherEvent(ev:>eventt))(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()=(new%jsJs.date_now)##getTimeinletlast=ref(now())infuncallback->lett=now()inletdt=!last+.(1000./.60.)-.tinletdt=ifPoly.(dt<0.)then0.elsedtinlast:=t;ignore(window##setTimeoutcallbackdt))(****)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)step)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|])